diff --git a/.gitignore b/.gitignore index 4a494a75..99ab2c51 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ .env # Ignore master key for decrypting credentials and more. -/config/master.key +/config/master.key \ No newline at end of file diff --git a/app/controllers/movies_controller.rb b/app/controllers/movies_controller.rb index 362e2791..1682d28f 100644 --- a/app/controllers/movies_controller.rb +++ b/app/controllers/movies_controller.rb @@ -1,6 +1,9 @@ class MoviesController < ApplicationController before_action :require_movie, only: [:show] + BASE_IMG_URL = "https://image.tmdb.org/t/p/" + DEFAULT_IMG_SIZE = "w185" + def index if params[:query] data = MovieWrapper.search(params[:query]) @@ -16,9 +19,21 @@ def show status: :ok, json: @movie.as_json( only: [:title, :overview, :release_date, :inventory], - methods: [:available_inventory] - ) - ) + methods: [:available_inventory], + ), + ) + end + + def create + movie = Movie.new(movie_params) + better_image = movie.image_url.gsub("https://image.tmdb.org/t/p/w185", "") + movie.image_url = better_image + + if movie.save + render json: {id: movie.id}, status: :ok + else + render json: {errors: movie.errors.messages}, status: :bad_request + end end private @@ -26,7 +41,11 @@ def show def require_movie @movie = Movie.find_by(title: params[:title]) unless @movie - render status: :not_found, json: { errors: { title: ["No movie with title #{params["title"]}"] } } + render status: :not_found, json: {errors: {title: ["No movie with title #{params["title"]}"]}} end end + + def movie_params + params.permit(:title, :overview, :release_date, :image_url, :external_id) + end end diff --git a/config/database.yml b/config/database.yml index 50748d61..c421185c 100644 --- a/config/database.yml +++ b/config/database.yml @@ -25,3 +25,4 @@ production: username: password: <%= ENV['_DATABASE_PASSWORD'] %> + diff --git a/config/routes.rb b/config/routes.rb index f4c99688..76715f9a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,7 @@ resources :customers, only: [:index] - resources :movies, only: [:index, :show], param: :title + resources :movies, only: [:index, :show, :create], param: :title post "/rentals/:title/check-out", to: "rentals#check_out", as: "check_out" post "/rentals/:title/return", to: "rentals#check_in", as: "check_in" diff --git a/node_modules/.bin/loose-envify b/node_modules/.bin/loose-envify new file mode 120000 index 00000000..ed9009c5 --- /dev/null +++ b/node_modules/.bin/loose-envify @@ -0,0 +1 @@ +../loose-envify/cli.js \ No newline at end of file diff --git a/node_modules/@babel/runtime/LICENSE b/node_modules/@babel/runtime/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/runtime/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other 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/@babel/runtime/README.md b/node_modules/@babel/runtime/README.md new file mode 100644 index 00000000..72e8daa3 --- /dev/null +++ b/node_modules/@babel/runtime/README.md @@ -0,0 +1,19 @@ +# @babel/runtime + +> babel's modular runtime helpers + +See our website [@babel/runtime](https://babeljs.io/docs/en/next/babel-runtime.html) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/runtime +``` + +or using yarn: + +```sh +yarn add @babel/runtime +``` diff --git a/node_modules/@babel/runtime/helpers/AsyncGenerator.js b/node_modules/@babel/runtime/helpers/AsyncGenerator.js new file mode 100644 index 00000000..0365c437 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/AsyncGenerator.js @@ -0,0 +1,100 @@ +var AwaitValue = require("./AwaitValue"); + +function AsyncGenerator(gen) { + var front, back; + + function send(key, arg) { + return new Promise(function (resolve, reject) { + var request = { + key: key, + arg: arg, + resolve: resolve, + reject: reject, + next: null + }; + + if (back) { + back = back.next = request; + } else { + front = back = request; + resume(key, arg); + } + }); + } + + function resume(key, arg) { + try { + var result = gen[key](arg); + var value = result.value; + var wrappedAwait = value instanceof AwaitValue; + Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { + if (wrappedAwait) { + resume("next", arg); + return; + } + + settle(result.done ? "return" : "normal", arg); + }, function (err) { + resume("throw", err); + }); + } catch (err) { + settle("throw", err); + } + } + + function settle(type, value) { + switch (type) { + case "return": + front.resolve({ + value: value, + done: true + }); + break; + + case "throw": + front.reject(value); + break; + + default: + front.resolve({ + value: value, + done: false + }); + break; + } + + front = front.next; + + if (front) { + resume(front.key, front.arg); + } else { + back = null; + } + } + + this._invoke = send; + + if (typeof gen["return"] !== "function") { + this["return"] = undefined; + } +} + +if (typeof Symbol === "function" && Symbol.asyncIterator) { + AsyncGenerator.prototype[Symbol.asyncIterator] = function () { + return this; + }; +} + +AsyncGenerator.prototype.next = function (arg) { + return this._invoke("next", arg); +}; + +AsyncGenerator.prototype["throw"] = function (arg) { + return this._invoke("throw", arg); +}; + +AsyncGenerator.prototype["return"] = function (arg) { + return this._invoke("return", arg); +}; + +module.exports = AsyncGenerator; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/AwaitValue.js b/node_modules/@babel/runtime/helpers/AwaitValue.js new file mode 100644 index 00000000..f9f41841 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/AwaitValue.js @@ -0,0 +1,5 @@ +function _AwaitValue(value) { + this.wrapped = value; +} + +module.exports = _AwaitValue; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js b/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js new file mode 100644 index 00000000..b0b41ddd --- /dev/null +++ b/node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js @@ -0,0 +1,30 @@ +function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object.keys(descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object.defineProperty(target, property, desc); + desc = null; + } + + return desc; +} + +module.exports = _applyDecoratedDescriptor; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/arrayWithHoles.js b/node_modules/@babel/runtime/helpers/arrayWithHoles.js new file mode 100644 index 00000000..5a62a8ce --- /dev/null +++ b/node_modules/@babel/runtime/helpers/arrayWithHoles.js @@ -0,0 +1,5 @@ +function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; +} + +module.exports = _arrayWithHoles; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js b/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js new file mode 100644 index 00000000..3234017e --- /dev/null +++ b/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js @@ -0,0 +1,11 @@ +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } +} + +module.exports = _arrayWithoutHoles; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/assertThisInitialized.js b/node_modules/@babel/runtime/helpers/assertThisInitialized.js new file mode 100644 index 00000000..98d29498 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/assertThisInitialized.js @@ -0,0 +1,9 @@ +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; +} + +module.exports = _assertThisInitialized; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js b/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js new file mode 100644 index 00000000..3fb99659 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/asyncGeneratorDelegate.js @@ -0,0 +1,53 @@ +function _asyncGeneratorDelegate(inner, awaitWrap) { + var iter = {}, + waiting = false; + + function pump(key, value) { + waiting = true; + value = new Promise(function (resolve) { + resolve(inner[key](value)); + }); + return { + done: false, + value: awaitWrap(value) + }; + } + + ; + + if (typeof Symbol === "function" && Symbol.iterator) { + iter[Symbol.iterator] = function () { + return this; + }; + } + + iter.next = function (value) { + if (waiting) { + waiting = false; + return value; + } + + return pump("next", value); + }; + + if (typeof inner["throw"] === "function") { + iter["throw"] = function (value) { + if (waiting) { + waiting = false; + throw value; + } + + return pump("throw", value); + }; + } + + if (typeof inner["return"] === "function") { + iter["return"] = function (value) { + return pump("return", value); + }; + } + + return iter; +} + +module.exports = _asyncGeneratorDelegate; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/asyncIterator.js b/node_modules/@babel/runtime/helpers/asyncIterator.js new file mode 100644 index 00000000..ef5db274 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/asyncIterator.js @@ -0,0 +1,19 @@ +function _asyncIterator(iterable) { + var method; + + if (typeof Symbol !== "undefined") { + if (Symbol.asyncIterator) { + method = iterable[Symbol.asyncIterator]; + if (method != null) return method.call(iterable); + } + + if (Symbol.iterator) { + method = iterable[Symbol.iterator]; + if (method != null) return method.call(iterable); + } + } + + throw new TypeError("Object is not async iterable"); +} + +module.exports = _asyncIterator; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/asyncToGenerator.js b/node_modules/@babel/runtime/helpers/asyncToGenerator.js new file mode 100644 index 00000000..f5db93df --- /dev/null +++ b/node_modules/@babel/runtime/helpers/asyncToGenerator.js @@ -0,0 +1,37 @@ +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} + +function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + + _next(undefined); + }); + }; +} + +module.exports = _asyncToGenerator; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js b/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js new file mode 100644 index 00000000..59f797af --- /dev/null +++ b/node_modules/@babel/runtime/helpers/awaitAsyncGenerator.js @@ -0,0 +1,7 @@ +var AwaitValue = require("./AwaitValue"); + +function _awaitAsyncGenerator(value) { + return new AwaitValue(value); +} + +module.exports = _awaitAsyncGenerator; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classCallCheck.js b/node_modules/@babel/runtime/helpers/classCallCheck.js new file mode 100644 index 00000000..f389f2e8 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classCallCheck.js @@ -0,0 +1,7 @@ +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +module.exports = _classCallCheck; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classNameTDZError.js b/node_modules/@babel/runtime/helpers/classNameTDZError.js new file mode 100644 index 00000000..8c1bdf55 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classNameTDZError.js @@ -0,0 +1,5 @@ +function _classNameTDZError(name) { + throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); +} + +module.exports = _classNameTDZError; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js b/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js new file mode 100644 index 00000000..4a9c3c8e --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classPrivateFieldGet.js @@ -0,0 +1,15 @@ +function _classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + + var descriptor = privateMap.get(receiver); + + if (descriptor.get) { + return descriptor.get.call(receiver); + } + + return descriptor.value; +} + +module.exports = _classPrivateFieldGet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js b/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js new file mode 100644 index 00000000..64ed79df --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classPrivateFieldLooseBase.js @@ -0,0 +1,9 @@ +function _classPrivateFieldBase(receiver, privateKey) { + if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { + throw new TypeError("attempted to use private field on non-instance"); + } + + return receiver; +} + +module.exports = _classPrivateFieldBase; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js b/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js new file mode 100644 index 00000000..a1a6417a --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classPrivateFieldLooseKey.js @@ -0,0 +1,7 @@ +var id = 0; + +function _classPrivateFieldKey(name) { + return "__private_" + id++ + "_" + name; +} + +module.exports = _classPrivateFieldKey; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js b/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js new file mode 100644 index 00000000..0cab8692 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classPrivateFieldSet.js @@ -0,0 +1,21 @@ +function _classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + + var descriptor = privateMap.get(receiver); + + if (descriptor.set) { + descriptor.set.call(receiver, value); + } else { + if (!descriptor.writable) { + throw new TypeError("attempted to set read only private field"); + } + + descriptor.value = value; + } + + return value; +} + +module.exports = _classPrivateFieldSet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js b/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js new file mode 100644 index 00000000..a3432b9a --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classPrivateMethodGet.js @@ -0,0 +1,9 @@ +function _classPrivateMethodGet(receiver, privateSet, fn) { + if (!privateSet.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + + return fn; +} + +module.exports = _classPrivateMethodGet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js b/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js new file mode 100644 index 00000000..38472848 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classPrivateMethodSet.js @@ -0,0 +1,5 @@ +function _classPrivateMethodSet() { + throw new TypeError("attempted to reassign private method"); +} + +module.exports = _classPrivateMethodSet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js b/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js new file mode 100644 index 00000000..cb751096 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js @@ -0,0 +1,9 @@ +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { + if (receiver !== classConstructor) { + throw new TypeError("Private static access of wrong provenance"); + } + + return descriptor.value; +} + +module.exports = _classStaticPrivateFieldSpecGet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js b/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js new file mode 100644 index 00000000..d758fcfa --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js @@ -0,0 +1,14 @@ +function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { + if (receiver !== classConstructor) { + throw new TypeError("Private static access of wrong provenance"); + } + + if (!descriptor.writable) { + throw new TypeError("attempted to set read only private field"); + } + + descriptor.value = value; + return value; +} + +module.exports = _classStaticPrivateFieldSpecSet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js b/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js new file mode 100644 index 00000000..f9b0d003 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classStaticPrivateMethodGet.js @@ -0,0 +1,9 @@ +function _classStaticPrivateMethodGet(receiver, classConstructor, method) { + if (receiver !== classConstructor) { + throw new TypeError("Private static access of wrong provenance"); + } + + return method; +} + +module.exports = _classStaticPrivateMethodGet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js b/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js new file mode 100644 index 00000000..89042da5 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/classStaticPrivateMethodSet.js @@ -0,0 +1,5 @@ +function _classStaticPrivateMethodSet() { + throw new TypeError("attempted to set read only static private field"); +} + +module.exports = _classStaticPrivateMethodSet; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/construct.js b/node_modules/@babel/runtime/helpers/construct.js new file mode 100644 index 00000000..723a7eaa --- /dev/null +++ b/node_modules/@babel/runtime/helpers/construct.js @@ -0,0 +1,33 @@ +var setPrototypeOf = require("./setPrototypeOf"); + +function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } +} + +function _construct(Parent, args, Class) { + if (isNativeReflectConstruct()) { + module.exports = _construct = Reflect.construct; + } else { + module.exports = _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + + return _construct.apply(null, arguments); +} + +module.exports = _construct; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/createClass.js b/node_modules/@babel/runtime/helpers/createClass.js new file mode 100644 index 00000000..f9d48410 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/createClass.js @@ -0,0 +1,17 @@ +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); + } +} + +function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} + +module.exports = _createClass; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/decorate.js b/node_modules/@babel/runtime/helpers/decorate.js new file mode 100644 index 00000000..77c0b980 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/decorate.js @@ -0,0 +1,400 @@ +var toArray = require("./toArray"); + +var toPropertyKey = require("./toPropertyKey"); + +function _decorate(decorators, factory, superClass, mixins) { + var api = _getDecoratorsApi(); + + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + api = mixins[i](api); + } + } + + var r = factory(function initialize(O) { + api.initializeInstanceElements(O, decorated.elements); + }, superClass); + var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); + api.initializeClassElements(r.F, decorated.elements); + return api.runClassFinishers(r.F, decorated.finishers); +} + +function _getDecoratorsApi() { + _getDecoratorsApi = function _getDecoratorsApi() { + return api; + }; + + var api = { + elementsDefinitionOrder: [["method"], ["field"]], + initializeInstanceElements: function initializeInstanceElements(O, elements) { + ["method", "field"].forEach(function (kind) { + elements.forEach(function (element) { + if (element.kind === kind && element.placement === "own") { + this.defineClassElement(O, element); + } + }, this); + }, this); + }, + initializeClassElements: function initializeClassElements(F, elements) { + var proto = F.prototype; + ["method", "field"].forEach(function (kind) { + elements.forEach(function (element) { + var placement = element.placement; + + if (element.kind === kind && (placement === "static" || placement === "prototype")) { + var receiver = placement === "static" ? F : proto; + this.defineClassElement(receiver, element); + } + }, this); + }, this); + }, + defineClassElement: function defineClassElement(receiver, element) { + var descriptor = element.descriptor; + + if (element.kind === "field") { + var initializer = element.initializer; + descriptor = { + enumerable: descriptor.enumerable, + writable: descriptor.writable, + configurable: descriptor.configurable, + value: initializer === void 0 ? void 0 : initializer.call(receiver) + }; + } + + Object.defineProperty(receiver, element.key, descriptor); + }, + decorateClass: function decorateClass(elements, decorators) { + var newElements = []; + var finishers = []; + var placements = { + "static": [], + prototype: [], + own: [] + }; + elements.forEach(function (element) { + this.addElementPlacement(element, placements); + }, this); + elements.forEach(function (element) { + if (!_hasDecorators(element)) return newElements.push(element); + var elementFinishersExtras = this.decorateElement(element, placements); + newElements.push(elementFinishersExtras.element); + newElements.push.apply(newElements, elementFinishersExtras.extras); + finishers.push.apply(finishers, elementFinishersExtras.finishers); + }, this); + + if (!decorators) { + return { + elements: newElements, + finishers: finishers + }; + } + + var result = this.decorateConstructor(newElements, decorators); + finishers.push.apply(finishers, result.finishers); + result.finishers = finishers; + return result; + }, + addElementPlacement: function addElementPlacement(element, placements, silent) { + var keys = placements[element.placement]; + + if (!silent && keys.indexOf(element.key) !== -1) { + throw new TypeError("Duplicated element (" + element.key + ")"); + } + + keys.push(element.key); + }, + decorateElement: function decorateElement(element, placements) { + var extras = []; + var finishers = []; + + for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { + var keys = placements[element.placement]; + keys.splice(keys.indexOf(element.key), 1); + var elementObject = this.fromElementDescriptor(element); + var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); + element = elementFinisherExtras.element; + this.addElementPlacement(element, placements); + + if (elementFinisherExtras.finisher) { + finishers.push(elementFinisherExtras.finisher); + } + + var newExtras = elementFinisherExtras.extras; + + if (newExtras) { + for (var j = 0; j < newExtras.length; j++) { + this.addElementPlacement(newExtras[j], placements); + } + + extras.push.apply(extras, newExtras); + } + } + + return { + element: element, + finishers: finishers, + extras: extras + }; + }, + decorateConstructor: function decorateConstructor(elements, decorators) { + var finishers = []; + + for (var i = decorators.length - 1; i >= 0; i--) { + var obj = this.fromClassDescriptor(elements); + var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); + + if (elementsAndFinisher.finisher !== undefined) { + finishers.push(elementsAndFinisher.finisher); + } + + if (elementsAndFinisher.elements !== undefined) { + elements = elementsAndFinisher.elements; + + for (var j = 0; j < elements.length - 1; j++) { + for (var k = j + 1; k < elements.length; k++) { + if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { + throw new TypeError("Duplicated element (" + elements[j].key + ")"); + } + } + } + } + } + + return { + elements: elements, + finishers: finishers + }; + }, + fromElementDescriptor: function fromElementDescriptor(element) { + var obj = { + kind: element.kind, + key: element.key, + placement: element.placement, + descriptor: element.descriptor + }; + var desc = { + value: "Descriptor", + configurable: true + }; + Object.defineProperty(obj, Symbol.toStringTag, desc); + if (element.kind === "field") obj.initializer = element.initializer; + return obj; + }, + toElementDescriptors: function toElementDescriptors(elementObjects) { + if (elementObjects === undefined) return; + return toArray(elementObjects).map(function (elementObject) { + var element = this.toElementDescriptor(elementObject); + this.disallowProperty(elementObject, "finisher", "An element descriptor"); + this.disallowProperty(elementObject, "extras", "An element descriptor"); + return element; + }, this); + }, + toElementDescriptor: function toElementDescriptor(elementObject) { + var kind = String(elementObject.kind); + + if (kind !== "method" && kind !== "field") { + throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); + } + + var key = toPropertyKey(elementObject.key); + var placement = String(elementObject.placement); + + if (placement !== "static" && placement !== "prototype" && placement !== "own") { + throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); + } + + var descriptor = elementObject.descriptor; + this.disallowProperty(elementObject, "elements", "An element descriptor"); + var element = { + kind: kind, + key: key, + placement: placement, + descriptor: Object.assign({}, descriptor) + }; + + if (kind !== "field") { + this.disallowProperty(elementObject, "initializer", "A method descriptor"); + } else { + this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); + this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); + this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); + element.initializer = elementObject.initializer; + } + + return element; + }, + toElementFinisherExtras: function toElementFinisherExtras(elementObject) { + var element = this.toElementDescriptor(elementObject); + + var finisher = _optionalCallableProperty(elementObject, "finisher"); + + var extras = this.toElementDescriptors(elementObject.extras); + return { + element: element, + finisher: finisher, + extras: extras + }; + }, + fromClassDescriptor: function fromClassDescriptor(elements) { + var obj = { + kind: "class", + elements: elements.map(this.fromElementDescriptor, this) + }; + var desc = { + value: "Descriptor", + configurable: true + }; + Object.defineProperty(obj, Symbol.toStringTag, desc); + return obj; + }, + toClassDescriptor: function toClassDescriptor(obj) { + var kind = String(obj.kind); + + if (kind !== "class") { + throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); + } + + this.disallowProperty(obj, "key", "A class descriptor"); + this.disallowProperty(obj, "placement", "A class descriptor"); + this.disallowProperty(obj, "descriptor", "A class descriptor"); + this.disallowProperty(obj, "initializer", "A class descriptor"); + this.disallowProperty(obj, "extras", "A class descriptor"); + + var finisher = _optionalCallableProperty(obj, "finisher"); + + var elements = this.toElementDescriptors(obj.elements); + return { + elements: elements, + finisher: finisher + }; + }, + runClassFinishers: function runClassFinishers(constructor, finishers) { + for (var i = 0; i < finishers.length; i++) { + var newConstructor = (0, finishers[i])(constructor); + + if (newConstructor !== undefined) { + if (typeof newConstructor !== "function") { + throw new TypeError("Finishers must return a constructor."); + } + + constructor = newConstructor; + } + } + + return constructor; + }, + disallowProperty: function disallowProperty(obj, name, objectType) { + if (obj[name] !== undefined) { + throw new TypeError(objectType + " can't have a ." + name + " property."); + } + } + }; + return api; +} + +function _createElementDescriptor(def) { + var key = toPropertyKey(def.key); + var descriptor; + + if (def.kind === "method") { + descriptor = { + value: def.value, + writable: true, + configurable: true, + enumerable: false + }; + } else if (def.kind === "get") { + descriptor = { + get: def.value, + configurable: true, + enumerable: false + }; + } else if (def.kind === "set") { + descriptor = { + set: def.value, + configurable: true, + enumerable: false + }; + } else if (def.kind === "field") { + descriptor = { + configurable: true, + writable: true, + enumerable: true + }; + } + + var element = { + kind: def.kind === "field" ? "field" : "method", + key: key, + placement: def["static"] ? "static" : def.kind === "field" ? "own" : "prototype", + descriptor: descriptor + }; + if (def.decorators) element.decorators = def.decorators; + if (def.kind === "field") element.initializer = def.value; + return element; +} + +function _coalesceGetterSetter(element, other) { + if (element.descriptor.get !== undefined) { + other.descriptor.get = element.descriptor.get; + } else { + other.descriptor.set = element.descriptor.set; + } +} + +function _coalesceClassElements(elements) { + var newElements = []; + + var isSameElement = function isSameElement(other) { + return other.kind === "method" && other.key === element.key && other.placement === element.placement; + }; + + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + var other; + + if (element.kind === "method" && (other = newElements.find(isSameElement))) { + if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { + if (_hasDecorators(element) || _hasDecorators(other)) { + throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); + } + + other.descriptor = element.descriptor; + } else { + if (_hasDecorators(element)) { + if (_hasDecorators(other)) { + throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); + } + + other.decorators = element.decorators; + } + + _coalesceGetterSetter(element, other); + } + } else { + newElements.push(element); + } + } + + return newElements; +} + +function _hasDecorators(element) { + return element.decorators && element.decorators.length; +} + +function _isDataDescriptor(desc) { + return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); +} + +function _optionalCallableProperty(obj, name) { + var value = obj[name]; + + if (value !== undefined && typeof value !== "function") { + throw new TypeError("Expected '" + name + "' to be a function"); + } + + return value; +} + +module.exports = _decorate; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/defaults.js b/node_modules/@babel/runtime/helpers/defaults.js new file mode 100644 index 00000000..55ba1feb --- /dev/null +++ b/node_modules/@babel/runtime/helpers/defaults.js @@ -0,0 +1,16 @@ +function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + + return obj; +} + +module.exports = _defaults; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js b/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js new file mode 100644 index 00000000..5d80ea1e --- /dev/null +++ b/node_modules/@babel/runtime/helpers/defineEnumerableProperties.js @@ -0,0 +1,24 @@ +function _defineEnumerableProperties(obj, descs) { + for (var key in descs) { + var desc = descs[key]; + desc.configurable = desc.enumerable = true; + if ("value" in desc) desc.writable = true; + Object.defineProperty(obj, key, desc); + } + + if (Object.getOwnPropertySymbols) { + var objectSymbols = Object.getOwnPropertySymbols(descs); + + for (var i = 0; i < objectSymbols.length; i++) { + var sym = objectSymbols[i]; + var desc = descs[sym]; + desc.configurable = desc.enumerable = true; + if ("value" in desc) desc.writable = true; + Object.defineProperty(obj, sym, desc); + } + } + + return obj; +} + +module.exports = _defineEnumerableProperties; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/defineProperty.js b/node_modules/@babel/runtime/helpers/defineProperty.js new file mode 100644 index 00000000..32a8d73f --- /dev/null +++ b/node_modules/@babel/runtime/helpers/defineProperty.js @@ -0,0 +1,16 @@ +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; +} + +module.exports = _defineProperty; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js b/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js new file mode 100644 index 00000000..a4e24029 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/AsyncGenerator.js @@ -0,0 +1,97 @@ +import AwaitValue from "./AwaitValue"; +export default function AsyncGenerator(gen) { + var front, back; + + function send(key, arg) { + return new Promise(function (resolve, reject) { + var request = { + key: key, + arg: arg, + resolve: resolve, + reject: reject, + next: null + }; + + if (back) { + back = back.next = request; + } else { + front = back = request; + resume(key, arg); + } + }); + } + + function resume(key, arg) { + try { + var result = gen[key](arg); + var value = result.value; + var wrappedAwait = value instanceof AwaitValue; + Promise.resolve(wrappedAwait ? value.wrapped : value).then(function (arg) { + if (wrappedAwait) { + resume("next", arg); + return; + } + + settle(result.done ? "return" : "normal", arg); + }, function (err) { + resume("throw", err); + }); + } catch (err) { + settle("throw", err); + } + } + + function settle(type, value) { + switch (type) { + case "return": + front.resolve({ + value: value, + done: true + }); + break; + + case "throw": + front.reject(value); + break; + + default: + front.resolve({ + value: value, + done: false + }); + break; + } + + front = front.next; + + if (front) { + resume(front.key, front.arg); + } else { + back = null; + } + } + + this._invoke = send; + + if (typeof gen["return"] !== "function") { + this["return"] = undefined; + } +} + +if (typeof Symbol === "function" && Symbol.asyncIterator) { + AsyncGenerator.prototype[Symbol.asyncIterator] = function () { + return this; + }; +} + +AsyncGenerator.prototype.next = function (arg) { + return this._invoke("next", arg); +}; + +AsyncGenerator.prototype["throw"] = function (arg) { + return this._invoke("throw", arg); +}; + +AsyncGenerator.prototype["return"] = function (arg) { + return this._invoke("return", arg); +}; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/AwaitValue.js b/node_modules/@babel/runtime/helpers/esm/AwaitValue.js new file mode 100644 index 00000000..5237e18f --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/AwaitValue.js @@ -0,0 +1,3 @@ +export default function _AwaitValue(value) { + this.wrapped = value; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js b/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js new file mode 100644 index 00000000..84b59617 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/applyDecoratedDescriptor.js @@ -0,0 +1,28 @@ +export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { + var desc = {}; + Object.keys(descriptor).forEach(function (key) { + desc[key] = descriptor[key]; + }); + desc.enumerable = !!desc.enumerable; + desc.configurable = !!desc.configurable; + + if ('value' in desc || desc.initializer) { + desc.writable = true; + } + + desc = decorators.slice().reverse().reduce(function (desc, decorator) { + return decorator(target, property, desc) || desc; + }, desc); + + if (context && desc.initializer !== void 0) { + desc.value = desc.initializer ? desc.initializer.call(context) : void 0; + desc.initializer = undefined; + } + + if (desc.initializer === void 0) { + Object.defineProperty(target, property, desc); + desc = null; + } + + return desc; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js b/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js new file mode 100644 index 00000000..be734fc3 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js @@ -0,0 +1,3 @@ +export default function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js b/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js new file mode 100644 index 00000000..cbcffa15 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js @@ -0,0 +1,9 @@ +export default function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js b/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js new file mode 100644 index 00000000..bbf849ca --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js @@ -0,0 +1,7 @@ +export default function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js b/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js new file mode 100644 index 00000000..c3f586f0 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/asyncGeneratorDelegate.js @@ -0,0 +1,51 @@ +export default function _asyncGeneratorDelegate(inner, awaitWrap) { + var iter = {}, + waiting = false; + + function pump(key, value) { + waiting = true; + value = new Promise(function (resolve) { + resolve(inner[key](value)); + }); + return { + done: false, + value: awaitWrap(value) + }; + } + + ; + + if (typeof Symbol === "function" && Symbol.iterator) { + iter[Symbol.iterator] = function () { + return this; + }; + } + + iter.next = function (value) { + if (waiting) { + waiting = false; + return value; + } + + return pump("next", value); + }; + + if (typeof inner["throw"] === "function") { + iter["throw"] = function (value) { + if (waiting) { + waiting = false; + throw value; + } + + return pump("throw", value); + }; + } + + if (typeof inner["return"] === "function") { + iter["return"] = function (value) { + return pump("return", value); + }; + } + + return iter; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/asyncIterator.js b/node_modules/@babel/runtime/helpers/esm/asyncIterator.js new file mode 100644 index 00000000..e03fa978 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/asyncIterator.js @@ -0,0 +1,17 @@ +export default function _asyncIterator(iterable) { + var method; + + if (typeof Symbol !== "undefined") { + if (Symbol.asyncIterator) { + method = iterable[Symbol.asyncIterator]; + if (method != null) return method.call(iterable); + } + + if (Symbol.iterator) { + method = iterable[Symbol.iterator]; + if (method != null) return method.call(iterable); + } + } + + throw new TypeError("Object is not async iterable"); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js b/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js new file mode 100644 index 00000000..2a25f543 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js @@ -0,0 +1,35 @@ +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + Promise.resolve(value).then(_next, _throw); + } +} + +export default function _asyncToGenerator(fn) { + return function () { + var self = this, + args = arguments; + return new Promise(function (resolve, reject) { + var gen = fn.apply(self, args); + + function _next(value) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); + } + + function _throw(err) { + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); + } + + _next(undefined); + }); + }; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js b/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js new file mode 100644 index 00000000..462f99cd --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js @@ -0,0 +1,4 @@ +import AwaitValue from "./AwaitValue"; +export default function _awaitAsyncGenerator(value) { + return new AwaitValue(value); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classCallCheck.js b/node_modules/@babel/runtime/helpers/esm/classCallCheck.js new file mode 100644 index 00000000..2f1738a3 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classCallCheck.js @@ -0,0 +1,5 @@ +export default function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js b/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js new file mode 100644 index 00000000..f7b6dd57 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classNameTDZError.js @@ -0,0 +1,3 @@ +export default function _classNameTDZError(name) { + throw new Error("Class \"" + name + "\" cannot be referenced in computed property keys."); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js new file mode 100644 index 00000000..25682122 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldGet.js @@ -0,0 +1,13 @@ +export default function _classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + + var descriptor = privateMap.get(receiver); + + if (descriptor.get) { + return descriptor.get.call(receiver); + } + + return descriptor.value; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js new file mode 100644 index 00000000..5b10916f --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js @@ -0,0 +1,7 @@ +export default function _classPrivateFieldBase(receiver, privateKey) { + if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { + throw new TypeError("attempted to use private field on non-instance"); + } + + return receiver; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js new file mode 100644 index 00000000..5b7e5ac0 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js @@ -0,0 +1,4 @@ +var id = 0; +export default function _classPrivateFieldKey(name) { + return "__private_" + id++ + "_" + name; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js new file mode 100644 index 00000000..0ce65f82 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classPrivateFieldSet.js @@ -0,0 +1,19 @@ +export default function _classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + + var descriptor = privateMap.get(receiver); + + if (descriptor.set) { + descriptor.set.call(receiver, value); + } else { + if (!descriptor.writable) { + throw new TypeError("attempted to set read only private field"); + } + + descriptor.value = value; + } + + return value; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js b/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js new file mode 100644 index 00000000..38b9d584 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classPrivateMethodGet.js @@ -0,0 +1,7 @@ +export default function _classPrivateMethodGet(receiver, privateSet, fn) { + if (!privateSet.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + + return fn; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js b/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js new file mode 100644 index 00000000..2bbaf3a7 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classPrivateMethodSet.js @@ -0,0 +1,3 @@ +export default function _classPrivateMethodSet() { + throw new TypeError("attempted to reassign private method"); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js new file mode 100644 index 00000000..29ae49bb --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js @@ -0,0 +1,7 @@ +export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { + if (receiver !== classConstructor) { + throw new TypeError("Private static access of wrong provenance"); + } + + return descriptor.value; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js new file mode 100644 index 00000000..15013f5f --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js @@ -0,0 +1,12 @@ +export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { + if (receiver !== classConstructor) { + throw new TypeError("Private static access of wrong provenance"); + } + + if (!descriptor.writable) { + throw new TypeError("attempted to set read only private field"); + } + + descriptor.value = value; + return value; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js new file mode 100644 index 00000000..da9b1e57 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js @@ -0,0 +1,7 @@ +export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) { + if (receiver !== classConstructor) { + throw new TypeError("Private static access of wrong provenance"); + } + + return method; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js new file mode 100644 index 00000000..d5ab60a9 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js @@ -0,0 +1,3 @@ +export default function _classStaticPrivateMethodSet() { + throw new TypeError("attempted to set read only static private field"); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/construct.js b/node_modules/@babel/runtime/helpers/esm/construct.js new file mode 100644 index 00000000..82f20fae --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/construct.js @@ -0,0 +1,31 @@ +import setPrototypeOf from "./setPrototypeOf"; + +function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } +} + +export default function _construct(Parent, args, Class) { + if (isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + + return _construct.apply(null, arguments); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/createClass.js b/node_modules/@babel/runtime/helpers/esm/createClass.js new file mode 100644 index 00000000..d6cf4122 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/createClass.js @@ -0,0 +1,15 @@ +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); + } +} + +export default function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/decorate.js b/node_modules/@babel/runtime/helpers/esm/decorate.js new file mode 100644 index 00000000..b6acd1ff --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/decorate.js @@ -0,0 +1,396 @@ +import toArray from "./toArray"; +import toPropertyKey from "./toPropertyKey"; +export default function _decorate(decorators, factory, superClass, mixins) { + var api = _getDecoratorsApi(); + + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + api = mixins[i](api); + } + } + + var r = factory(function initialize(O) { + api.initializeInstanceElements(O, decorated.elements); + }, superClass); + var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); + api.initializeClassElements(r.F, decorated.elements); + return api.runClassFinishers(r.F, decorated.finishers); +} + +function _getDecoratorsApi() { + _getDecoratorsApi = function _getDecoratorsApi() { + return api; + }; + + var api = { + elementsDefinitionOrder: [["method"], ["field"]], + initializeInstanceElements: function initializeInstanceElements(O, elements) { + ["method", "field"].forEach(function (kind) { + elements.forEach(function (element) { + if (element.kind === kind && element.placement === "own") { + this.defineClassElement(O, element); + } + }, this); + }, this); + }, + initializeClassElements: function initializeClassElements(F, elements) { + var proto = F.prototype; + ["method", "field"].forEach(function (kind) { + elements.forEach(function (element) { + var placement = element.placement; + + if (element.kind === kind && (placement === "static" || placement === "prototype")) { + var receiver = placement === "static" ? F : proto; + this.defineClassElement(receiver, element); + } + }, this); + }, this); + }, + defineClassElement: function defineClassElement(receiver, element) { + var descriptor = element.descriptor; + + if (element.kind === "field") { + var initializer = element.initializer; + descriptor = { + enumerable: descriptor.enumerable, + writable: descriptor.writable, + configurable: descriptor.configurable, + value: initializer === void 0 ? void 0 : initializer.call(receiver) + }; + } + + Object.defineProperty(receiver, element.key, descriptor); + }, + decorateClass: function decorateClass(elements, decorators) { + var newElements = []; + var finishers = []; + var placements = { + "static": [], + prototype: [], + own: [] + }; + elements.forEach(function (element) { + this.addElementPlacement(element, placements); + }, this); + elements.forEach(function (element) { + if (!_hasDecorators(element)) return newElements.push(element); + var elementFinishersExtras = this.decorateElement(element, placements); + newElements.push(elementFinishersExtras.element); + newElements.push.apply(newElements, elementFinishersExtras.extras); + finishers.push.apply(finishers, elementFinishersExtras.finishers); + }, this); + + if (!decorators) { + return { + elements: newElements, + finishers: finishers + }; + } + + var result = this.decorateConstructor(newElements, decorators); + finishers.push.apply(finishers, result.finishers); + result.finishers = finishers; + return result; + }, + addElementPlacement: function addElementPlacement(element, placements, silent) { + var keys = placements[element.placement]; + + if (!silent && keys.indexOf(element.key) !== -1) { + throw new TypeError("Duplicated element (" + element.key + ")"); + } + + keys.push(element.key); + }, + decorateElement: function decorateElement(element, placements) { + var extras = []; + var finishers = []; + + for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { + var keys = placements[element.placement]; + keys.splice(keys.indexOf(element.key), 1); + var elementObject = this.fromElementDescriptor(element); + var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); + element = elementFinisherExtras.element; + this.addElementPlacement(element, placements); + + if (elementFinisherExtras.finisher) { + finishers.push(elementFinisherExtras.finisher); + } + + var newExtras = elementFinisherExtras.extras; + + if (newExtras) { + for (var j = 0; j < newExtras.length; j++) { + this.addElementPlacement(newExtras[j], placements); + } + + extras.push.apply(extras, newExtras); + } + } + + return { + element: element, + finishers: finishers, + extras: extras + }; + }, + decorateConstructor: function decorateConstructor(elements, decorators) { + var finishers = []; + + for (var i = decorators.length - 1; i >= 0; i--) { + var obj = this.fromClassDescriptor(elements); + var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); + + if (elementsAndFinisher.finisher !== undefined) { + finishers.push(elementsAndFinisher.finisher); + } + + if (elementsAndFinisher.elements !== undefined) { + elements = elementsAndFinisher.elements; + + for (var j = 0; j < elements.length - 1; j++) { + for (var k = j + 1; k < elements.length; k++) { + if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { + throw new TypeError("Duplicated element (" + elements[j].key + ")"); + } + } + } + } + } + + return { + elements: elements, + finishers: finishers + }; + }, + fromElementDescriptor: function fromElementDescriptor(element) { + var obj = { + kind: element.kind, + key: element.key, + placement: element.placement, + descriptor: element.descriptor + }; + var desc = { + value: "Descriptor", + configurable: true + }; + Object.defineProperty(obj, Symbol.toStringTag, desc); + if (element.kind === "field") obj.initializer = element.initializer; + return obj; + }, + toElementDescriptors: function toElementDescriptors(elementObjects) { + if (elementObjects === undefined) return; + return toArray(elementObjects).map(function (elementObject) { + var element = this.toElementDescriptor(elementObject); + this.disallowProperty(elementObject, "finisher", "An element descriptor"); + this.disallowProperty(elementObject, "extras", "An element descriptor"); + return element; + }, this); + }, + toElementDescriptor: function toElementDescriptor(elementObject) { + var kind = String(elementObject.kind); + + if (kind !== "method" && kind !== "field") { + throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); + } + + var key = toPropertyKey(elementObject.key); + var placement = String(elementObject.placement); + + if (placement !== "static" && placement !== "prototype" && placement !== "own") { + throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); + } + + var descriptor = elementObject.descriptor; + this.disallowProperty(elementObject, "elements", "An element descriptor"); + var element = { + kind: kind, + key: key, + placement: placement, + descriptor: Object.assign({}, descriptor) + }; + + if (kind !== "field") { + this.disallowProperty(elementObject, "initializer", "A method descriptor"); + } else { + this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); + this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); + this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); + element.initializer = elementObject.initializer; + } + + return element; + }, + toElementFinisherExtras: function toElementFinisherExtras(elementObject) { + var element = this.toElementDescriptor(elementObject); + + var finisher = _optionalCallableProperty(elementObject, "finisher"); + + var extras = this.toElementDescriptors(elementObject.extras); + return { + element: element, + finisher: finisher, + extras: extras + }; + }, + fromClassDescriptor: function fromClassDescriptor(elements) { + var obj = { + kind: "class", + elements: elements.map(this.fromElementDescriptor, this) + }; + var desc = { + value: "Descriptor", + configurable: true + }; + Object.defineProperty(obj, Symbol.toStringTag, desc); + return obj; + }, + toClassDescriptor: function toClassDescriptor(obj) { + var kind = String(obj.kind); + + if (kind !== "class") { + throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); + } + + this.disallowProperty(obj, "key", "A class descriptor"); + this.disallowProperty(obj, "placement", "A class descriptor"); + this.disallowProperty(obj, "descriptor", "A class descriptor"); + this.disallowProperty(obj, "initializer", "A class descriptor"); + this.disallowProperty(obj, "extras", "A class descriptor"); + + var finisher = _optionalCallableProperty(obj, "finisher"); + + var elements = this.toElementDescriptors(obj.elements); + return { + elements: elements, + finisher: finisher + }; + }, + runClassFinishers: function runClassFinishers(constructor, finishers) { + for (var i = 0; i < finishers.length; i++) { + var newConstructor = (0, finishers[i])(constructor); + + if (newConstructor !== undefined) { + if (typeof newConstructor !== "function") { + throw new TypeError("Finishers must return a constructor."); + } + + constructor = newConstructor; + } + } + + return constructor; + }, + disallowProperty: function disallowProperty(obj, name, objectType) { + if (obj[name] !== undefined) { + throw new TypeError(objectType + " can't have a ." + name + " property."); + } + } + }; + return api; +} + +function _createElementDescriptor(def) { + var key = toPropertyKey(def.key); + var descriptor; + + if (def.kind === "method") { + descriptor = { + value: def.value, + writable: true, + configurable: true, + enumerable: false + }; + } else if (def.kind === "get") { + descriptor = { + get: def.value, + configurable: true, + enumerable: false + }; + } else if (def.kind === "set") { + descriptor = { + set: def.value, + configurable: true, + enumerable: false + }; + } else if (def.kind === "field") { + descriptor = { + configurable: true, + writable: true, + enumerable: true + }; + } + + var element = { + kind: def.kind === "field" ? "field" : "method", + key: key, + placement: def["static"] ? "static" : def.kind === "field" ? "own" : "prototype", + descriptor: descriptor + }; + if (def.decorators) element.decorators = def.decorators; + if (def.kind === "field") element.initializer = def.value; + return element; +} + +function _coalesceGetterSetter(element, other) { + if (element.descriptor.get !== undefined) { + other.descriptor.get = element.descriptor.get; + } else { + other.descriptor.set = element.descriptor.set; + } +} + +function _coalesceClassElements(elements) { + var newElements = []; + + var isSameElement = function isSameElement(other) { + return other.kind === "method" && other.key === element.key && other.placement === element.placement; + }; + + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + var other; + + if (element.kind === "method" && (other = newElements.find(isSameElement))) { + if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { + if (_hasDecorators(element) || _hasDecorators(other)) { + throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); + } + + other.descriptor = element.descriptor; + } else { + if (_hasDecorators(element)) { + if (_hasDecorators(other)) { + throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); + } + + other.decorators = element.decorators; + } + + _coalesceGetterSetter(element, other); + } + } else { + newElements.push(element); + } + } + + return newElements; +} + +function _hasDecorators(element) { + return element.decorators && element.decorators.length; +} + +function _isDataDescriptor(desc) { + return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); +} + +function _optionalCallableProperty(obj, name) { + var value = obj[name]; + + if (value !== undefined && typeof value !== "function") { + throw new TypeError("Expected '" + name + "' to be a function"); + } + + return value; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/defaults.js b/node_modules/@babel/runtime/helpers/esm/defaults.js new file mode 100644 index 00000000..3de1d8ec --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/defaults.js @@ -0,0 +1,14 @@ +export default function _defaults(obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + + return obj; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js b/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js new file mode 100644 index 00000000..7981acd4 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/defineEnumerableProperties.js @@ -0,0 +1,22 @@ +export default function _defineEnumerableProperties(obj, descs) { + for (var key in descs) { + var desc = descs[key]; + desc.configurable = desc.enumerable = true; + if ("value" in desc) desc.writable = true; + Object.defineProperty(obj, key, desc); + } + + if (Object.getOwnPropertySymbols) { + var objectSymbols = Object.getOwnPropertySymbols(descs); + + for (var i = 0; i < objectSymbols.length; i++) { + var sym = objectSymbols[i]; + var desc = descs[sym]; + desc.configurable = desc.enumerable = true; + if ("value" in desc) desc.writable = true; + Object.defineProperty(obj, sym, desc); + } + } + + return obj; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/defineProperty.js b/node_modules/@babel/runtime/helpers/esm/defineProperty.js new file mode 100644 index 00000000..7cf6e59f --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/defineProperty.js @@ -0,0 +1,14 @@ +export default 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; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/extends.js b/node_modules/@babel/runtime/helpers/esm/extends.js new file mode 100644 index 00000000..b9b138d8 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/extends.js @@ -0,0 +1,17 @@ +export default function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/get.js b/node_modules/@babel/runtime/helpers/esm/get.js new file mode 100644 index 00000000..c0b7bce6 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/get.js @@ -0,0 +1,21 @@ +import getPrototypeOf from "./getPrototypeOf"; +import superPropBase from "./superPropBase"; +export default function _get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + + if (desc.get) { + return desc.get.call(receiver); + } + + return desc.value; + }; + } + + return _get(target, property, receiver || target); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js b/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js new file mode 100644 index 00000000..5abafe38 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js @@ -0,0 +1,6 @@ +export default function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/inherits.js b/node_modules/@babel/runtime/helpers/esm/inherits.js new file mode 100644 index 00000000..035648d0 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/inherits.js @@ -0,0 +1,15 @@ +import setPrototypeOf from "./setPrototypeOf"; +export default function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) setPrototypeOf(subClass, superClass); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js b/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js new file mode 100644 index 00000000..32017e66 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js @@ -0,0 +1,5 @@ +export default function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js b/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js new file mode 100644 index 00000000..26fdea08 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/initializerDefineProperty.js @@ -0,0 +1,9 @@ +export default function _initializerDefineProperty(target, property, descriptor, context) { + if (!descriptor) return; + Object.defineProperty(target, property, { + enumerable: descriptor.enumerable, + configurable: descriptor.configurable, + writable: descriptor.writable, + value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 + }); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js b/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js new file mode 100644 index 00000000..d40ca01c --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/initializerWarningHelper.js @@ -0,0 +1,3 @@ +export default function _initializerWarningHelper(descriptor, context) { + throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/instanceof.js b/node_modules/@babel/runtime/helpers/esm/instanceof.js new file mode 100644 index 00000000..51f1e67d --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/instanceof.js @@ -0,0 +1,7 @@ +export default function _instanceof(left, right) { + if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { + return right[Symbol.hasInstance](left); + } else { + return left instanceof right; + } +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js b/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js new file mode 100644 index 00000000..c2df7b64 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js @@ -0,0 +1,5 @@ +export default function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + "default": obj + }; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js b/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js new file mode 100644 index 00000000..b28510ee --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js @@ -0,0 +1,24 @@ +export default function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; + + if (desc.get || desc.set) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + } + + newObj["default"] = obj; + return newObj; + } +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js b/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js new file mode 100644 index 00000000..7b1bc821 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/isNativeFunction.js @@ -0,0 +1,3 @@ +export default function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/iterableToArray.js b/node_modules/@babel/runtime/helpers/esm/iterableToArray.js new file mode 100644 index 00000000..671e400d --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/iterableToArray.js @@ -0,0 +1,3 @@ +export default function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js b/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js new file mode 100644 index 00000000..7234d8e6 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js @@ -0,0 +1,25 @@ +export default function _iterableToArrayLimit(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js b/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js new file mode 100644 index 00000000..4261e294 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js @@ -0,0 +1,11 @@ +export default function _iterableToArrayLimitLoose(arr, i) { + var _arr = []; + + for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { + _arr.push(_step.value); + + if (i && _arr.length === i) break; + } + + return _arr; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/jsx.js b/node_modules/@babel/runtime/helpers/esm/jsx.js new file mode 100644 index 00000000..0866a55f --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/jsx.js @@ -0,0 +1,46 @@ +var REACT_ELEMENT_TYPE; +export default function _createRawReactElement(type, props, key, children) { + if (!REACT_ELEMENT_TYPE) { + REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; + } + + var defaultProps = type && type.defaultProps; + var childrenLength = arguments.length - 3; + + if (!props && childrenLength !== 0) { + props = { + children: void 0 + }; + } + + if (props && defaultProps) { + for (var propName in defaultProps) { + if (props[propName] === void 0) { + props[propName] = defaultProps[propName]; + } + } + } else if (!props) { + props = defaultProps || {}; + } + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = new Array(childrenLength); + + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 3]; + } + + props.children = childArray; + } + + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key === undefined ? null : '' + key, + ref: null, + props: props, + _owner: null + }; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js b/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js new file mode 100644 index 00000000..d6cd8643 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/newArrowCheck.js @@ -0,0 +1,5 @@ +export default function _newArrowCheck(innerThis, boundThis) { + if (innerThis !== boundThis) { + throw new TypeError("Cannot instantiate an arrow function"); + } +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js b/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js new file mode 100644 index 00000000..f94186da --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js @@ -0,0 +1,3 @@ +export default function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js b/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js new file mode 100644 index 00000000..d6bc738a --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js @@ -0,0 +1,3 @@ +export default function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance"); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js b/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js new file mode 100644 index 00000000..82b67d2c --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js @@ -0,0 +1,3 @@ +export default function _objectDestructuringEmpty(obj) { + if (obj == null) throw new TypeError("Cannot destructure undefined"); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/objectSpread.js b/node_modules/@babel/runtime/helpers/esm/objectSpread.js new file mode 100644 index 00000000..918bc8e9 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/objectSpread.js @@ -0,0 +1,19 @@ +import defineProperty from "./defineProperty"; +export default function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + + ownKeys.forEach(function (key) { + defineProperty(target, key, source[key]); + }); + } + + return target; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js b/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js new file mode 100644 index 00000000..2af6091d --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js @@ -0,0 +1,19 @@ +import objectWithoutPropertiesLoose from "./objectWithoutPropertiesLoose"; +export default function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + var target = objectWithoutPropertiesLoose(source, excluded); + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js b/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js new file mode 100644 index 00000000..c36815ce --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js @@ -0,0 +1,14 @@ +export default function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js b/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js new file mode 100644 index 00000000..be7b7a44 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js @@ -0,0 +1,9 @@ +import _typeof from "../../helpers/esm/typeof"; +import assertThisInitialized from "./assertThisInitialized"; +export default function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === "object" || typeof call === "function")) { + return call; + } + + return assertThisInitialized(self); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/readOnlyError.js b/node_modules/@babel/runtime/helpers/esm/readOnlyError.js new file mode 100644 index 00000000..45d01d72 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/readOnlyError.js @@ -0,0 +1,3 @@ +export default function _readOnlyError(name) { + throw new Error("\"" + name + "\" is read-only"); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/set.js b/node_modules/@babel/runtime/helpers/esm/set.js new file mode 100644 index 00000000..b6a4c340 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/set.js @@ -0,0 +1,52 @@ +import getPrototypeOf from "./getPrototypeOf"; +import superPropBase from "./superPropBase"; +import defineProperty from "./defineProperty"; + +function set(target, property, value, receiver) { + if (typeof Reflect !== "undefined" && Reflect.set) { + set = Reflect.set; + } else { + set = function set(target, property, value, receiver) { + var base = superPropBase(target, property); + var desc; + + if (base) { + desc = Object.getOwnPropertyDescriptor(base, property); + + if (desc.set) { + desc.set.call(receiver, value); + return true; + } else if (!desc.writable) { + return false; + } + } + + desc = Object.getOwnPropertyDescriptor(receiver, property); + + if (desc) { + if (!desc.writable) { + return false; + } + + desc.value = value; + Object.defineProperty(receiver, property, desc); + } else { + defineProperty(receiver, property, value); + } + + return true; + }; + } + + return set(target, property, value, receiver); +} + +export default function _set(target, property, value, receiver, isStrict) { + var s = set(target, property, value, receiver || target); + + if (!s && isStrict) { + throw new Error('failed to set property'); + } + + return value; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js b/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js new file mode 100644 index 00000000..e6ef03e5 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js @@ -0,0 +1,8 @@ +export default function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js b/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js new file mode 100644 index 00000000..cadd9bb5 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/skipFirstGeneratorNext.js @@ -0,0 +1,7 @@ +export default function _skipFirstGeneratorNext(fn) { + return function () { + var it = fn.apply(this, arguments); + it.next(); + return it; + }; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/slicedToArray.js b/node_modules/@babel/runtime/helpers/esm/slicedToArray.js new file mode 100644 index 00000000..f6f10816 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/slicedToArray.js @@ -0,0 +1,6 @@ +import arrayWithHoles from "./arrayWithHoles"; +import iterableToArrayLimit from "./iterableToArrayLimit"; +import nonIterableRest from "./nonIterableRest"; +export default function _slicedToArray(arr, i) { + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest(); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js b/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js new file mode 100644 index 00000000..e6757890 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/slicedToArrayLoose.js @@ -0,0 +1,6 @@ +import arrayWithHoles from "./arrayWithHoles"; +import iterableToArrayLimitLoose from "./iterableToArrayLimitLoose"; +import nonIterableRest from "./nonIterableRest"; +export default function _slicedToArrayLoose(arr, i) { + return arrayWithHoles(arr) || iterableToArrayLimitLoose(arr, i) || nonIterableRest(); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/superPropBase.js b/node_modules/@babel/runtime/helpers/esm/superPropBase.js new file mode 100644 index 00000000..eace947c --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/superPropBase.js @@ -0,0 +1,9 @@ +import getPrototypeOf from "./getPrototypeOf"; +export default function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = getPrototypeOf(object); + if (object === null) break; + } + + return object; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js b/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js new file mode 100644 index 00000000..421f18ab --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js @@ -0,0 +1,11 @@ +export default function _taggedTemplateLiteral(strings, raw) { + if (!raw) { + raw = strings.slice(0); + } + + return Object.freeze(Object.defineProperties(strings, { + raw: { + value: Object.freeze(raw) + } + })); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js b/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js new file mode 100644 index 00000000..c8f081e9 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js @@ -0,0 +1,8 @@ +export default function _taggedTemplateLiteralLoose(strings, raw) { + if (!raw) { + raw = strings.slice(0); + } + + strings.raw = raw; + return strings; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/temporalRef.js b/node_modules/@babel/runtime/helpers/esm/temporalRef.js new file mode 100644 index 00000000..4b0679c6 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/temporalRef.js @@ -0,0 +1,8 @@ +import undef from "./temporalUndefined"; +export default function _temporalRef(val, name) { + if (val === undef) { + throw new ReferenceError(name + " is not defined - temporal dead zone"); + } else { + return val; + } +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js b/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js new file mode 100644 index 00000000..7c645e42 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/temporalUndefined.js @@ -0,0 +1 @@ +export default {}; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/toArray.js b/node_modules/@babel/runtime/helpers/esm/toArray.js new file mode 100644 index 00000000..5acb22b3 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/toArray.js @@ -0,0 +1,6 @@ +import arrayWithHoles from "./arrayWithHoles"; +import iterableToArray from "./iterableToArray"; +import nonIterableRest from "./nonIterableRest"; +export default function _toArray(arr) { + return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest(); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js b/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js new file mode 100644 index 00000000..7e480b9d --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js @@ -0,0 +1,6 @@ +import arrayWithoutHoles from "./arrayWithoutHoles"; +import iterableToArray from "./iterableToArray"; +import nonIterableSpread from "./nonIterableSpread"; +export default function _toConsumableArray(arr) { + return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread(); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/toPrimitive.js b/node_modules/@babel/runtime/helpers/esm/toPrimitive.js new file mode 100644 index 00000000..72a4a097 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/toPrimitive.js @@ -0,0 +1,13 @@ +import _typeof from "../../helpers/esm/typeof"; +export default function _toPrimitive(input, hint) { + if (_typeof(input) !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (_typeof(res) !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + + return (hint === "string" ? String : Number)(input); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js b/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js new file mode 100644 index 00000000..7b53a4de --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js @@ -0,0 +1,6 @@ +import _typeof from "../../helpers/esm/typeof"; +import toPrimitive from "./toPrimitive"; +export default function _toPropertyKey(arg) { + var key = toPrimitive(arg, "string"); + return _typeof(key) === "symbol" ? key : String(key); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/typeof.js b/node_modules/@babel/runtime/helpers/esm/typeof.js new file mode 100644 index 00000000..7825537f --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/typeof.js @@ -0,0 +1,15 @@ +function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } + +export default function _typeof(obj) { + if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { + _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); + }; + } + + return _typeof(obj); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js b/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js new file mode 100644 index 00000000..6d6d9811 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js @@ -0,0 +1,6 @@ +import AsyncGenerator from "./AsyncGenerator"; +export default function _wrapAsyncGenerator(fn) { + return function () { + return new AsyncGenerator(fn.apply(this, arguments)); + }; +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js b/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js new file mode 100644 index 00000000..5c55d058 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js @@ -0,0 +1,37 @@ +import getPrototypeOf from "./getPrototypeOf"; +import setPrototypeOf from "./setPrototypeOf"; +import isNativeFunction from "./isNativeFunction"; +import construct from "./construct"; +export default function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !isNativeFunction(Class)) return Class; + + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + + _cache.set(Class, Wrapper); + } + + function Wrapper() { + return construct(Class, arguments, getPrototypeOf(this).constructor); + } + + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return setPrototypeOf(Wrapper, Class); + }; + + return _wrapNativeSuper(Class); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js b/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js new file mode 100644 index 00000000..4aa1af06 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/esm/wrapRegExp.js @@ -0,0 +1,69 @@ +import _typeof from "../../helpers/esm/typeof"; +import wrapNativeSuper from "./wrapNativeSuper"; +import getPrototypeOf from "./getPrototypeOf"; +import possibleConstructorReturn from "./possibleConstructorReturn"; +import inherits from "./inherits"; +export default function _wrapRegExp(re, groups) { + _wrapRegExp = function _wrapRegExp(re, groups) { + return new BabelRegExp(re, groups); + }; + + var _RegExp = wrapNativeSuper(RegExp); + + var _super = RegExp.prototype; + + var _groups = new WeakMap(); + + function BabelRegExp(re, groups) { + var _this = _RegExp.call(this, re); + + _groups.set(_this, groups); + + return _this; + } + + inherits(BabelRegExp, _RegExp); + + BabelRegExp.prototype.exec = function (str) { + var result = _super.exec.call(this, str); + + if (result) result.groups = buildGroups(result, this); + return result; + }; + + BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { + if (typeof substitution === "string") { + var groups = _groups.get(this); + + return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { + return "$" + groups[name]; + })); + } else if (typeof substitution === "function") { + var _this = this; + + return _super[Symbol.replace].call(this, str, function () { + var args = []; + args.push.apply(args, arguments); + + if (_typeof(args[args.length - 1]) !== "object") { + args.push(buildGroups(args, _this)); + } + + return substitution.apply(this, args); + }); + } else { + return _super[Symbol.replace].call(this, str, substitution); + } + }; + + function buildGroups(result, re) { + var g = _groups.get(re); + + return Object.keys(g).reduce(function (groups, name) { + groups[name] = result[g[name]]; + return groups; + }, Object.create(null)); + } + + return _wrapRegExp.apply(this, arguments); +} \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/extends.js b/node_modules/@babel/runtime/helpers/extends.js new file mode 100644 index 00000000..1816877e --- /dev/null +++ b/node_modules/@babel/runtime/helpers/extends.js @@ -0,0 +1,19 @@ +function _extends() { + module.exports = _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +module.exports = _extends; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/get.js b/node_modules/@babel/runtime/helpers/get.js new file mode 100644 index 00000000..2cd0bb43 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/get.js @@ -0,0 +1,25 @@ +var getPrototypeOf = require("./getPrototypeOf"); + +var superPropBase = require("./superPropBase"); + +function _get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + module.exports = _get = Reflect.get; + } else { + module.exports = _get = function _get(target, property, receiver) { + var base = superPropBase(target, property); + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + + if (desc.get) { + return desc.get.call(receiver); + } + + return desc.value; + }; + } + + return _get(target, property, receiver || target); +} + +module.exports = _get; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/getPrototypeOf.js b/node_modules/@babel/runtime/helpers/getPrototypeOf.js new file mode 100644 index 00000000..5fc9a169 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/getPrototypeOf.js @@ -0,0 +1,8 @@ +function _getPrototypeOf(o) { + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); +} + +module.exports = _getPrototypeOf; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/inherits.js b/node_modules/@babel/runtime/helpers/inherits.js new file mode 100644 index 00000000..6b4f286d --- /dev/null +++ b/node_modules/@babel/runtime/helpers/inherits.js @@ -0,0 +1,18 @@ +var setPrototypeOf = require("./setPrototypeOf"); + +function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) setPrototypeOf(subClass, superClass); +} + +module.exports = _inherits; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/inheritsLoose.js b/node_modules/@babel/runtime/helpers/inheritsLoose.js new file mode 100644 index 00000000..c3f7cdb4 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/inheritsLoose.js @@ -0,0 +1,7 @@ +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +module.exports = _inheritsLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/initializerDefineProperty.js b/node_modules/@babel/runtime/helpers/initializerDefineProperty.js new file mode 100644 index 00000000..4caa5ca6 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/initializerDefineProperty.js @@ -0,0 +1,11 @@ +function _initializerDefineProperty(target, property, descriptor, context) { + if (!descriptor) return; + Object.defineProperty(target, property, { + enumerable: descriptor.enumerable, + configurable: descriptor.configurable, + writable: descriptor.writable, + value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 + }); +} + +module.exports = _initializerDefineProperty; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/initializerWarningHelper.js b/node_modules/@babel/runtime/helpers/initializerWarningHelper.js new file mode 100644 index 00000000..56e0c173 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/initializerWarningHelper.js @@ -0,0 +1,5 @@ +function _initializerWarningHelper(descriptor, context) { + throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and set to use loose mode. ' + 'To use proposal-class-properties in spec mode with decorators, wait for ' + 'the next major version of decorators in stage 2.'); +} + +module.exports = _initializerWarningHelper; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/instanceof.js b/node_modules/@babel/runtime/helpers/instanceof.js new file mode 100644 index 00000000..d3cd18a5 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/instanceof.js @@ -0,0 +1,9 @@ +function _instanceof(left, right) { + if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { + return right[Symbol.hasInstance](left); + } else { + return left instanceof right; + } +} + +module.exports = _instanceof; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/interopRequireDefault.js b/node_modules/@babel/runtime/helpers/interopRequireDefault.js new file mode 100644 index 00000000..f713d130 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/interopRequireDefault.js @@ -0,0 +1,7 @@ +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + "default": obj + }; +} + +module.exports = _interopRequireDefault; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/interopRequireWildcard.js b/node_modules/@babel/runtime/helpers/interopRequireWildcard.js new file mode 100644 index 00000000..dd9c045a --- /dev/null +++ b/node_modules/@babel/runtime/helpers/interopRequireWildcard.js @@ -0,0 +1,26 @@ +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; + + if (desc.get || desc.set) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + } + + newObj["default"] = obj; + return newObj; + } +} + +module.exports = _interopRequireWildcard; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/isNativeFunction.js b/node_modules/@babel/runtime/helpers/isNativeFunction.js new file mode 100644 index 00000000..e2dc3ed7 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/isNativeFunction.js @@ -0,0 +1,5 @@ +function _isNativeFunction(fn) { + return Function.toString.call(fn).indexOf("[native code]") !== -1; +} + +module.exports = _isNativeFunction; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/iterableToArray.js b/node_modules/@babel/runtime/helpers/iterableToArray.js new file mode 100644 index 00000000..e917e579 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/iterableToArray.js @@ -0,0 +1,5 @@ +function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); +} + +module.exports = _iterableToArray; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js b/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js new file mode 100644 index 00000000..14c1daa6 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js @@ -0,0 +1,27 @@ +function _iterableToArrayLimit(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; +} + +module.exports = _iterableToArrayLimit; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js b/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js new file mode 100644 index 00000000..c7dfeb30 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/iterableToArrayLimitLoose.js @@ -0,0 +1,13 @@ +function _iterableToArrayLimitLoose(arr, i) { + var _arr = []; + + for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { + _arr.push(_step.value); + + if (i && _arr.length === i) break; + } + + return _arr; +} + +module.exports = _iterableToArrayLimitLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/jsx.js b/node_modules/@babel/runtime/helpers/jsx.js new file mode 100644 index 00000000..000fd617 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/jsx.js @@ -0,0 +1,49 @@ +var REACT_ELEMENT_TYPE; + +function _createRawReactElement(type, props, key, children) { + if (!REACT_ELEMENT_TYPE) { + REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; + } + + var defaultProps = type && type.defaultProps; + var childrenLength = arguments.length - 3; + + if (!props && childrenLength !== 0) { + props = { + children: void 0 + }; + } + + if (props && defaultProps) { + for (var propName in defaultProps) { + if (props[propName] === void 0) { + props[propName] = defaultProps[propName]; + } + } + } else if (!props) { + props = defaultProps || {}; + } + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = new Array(childrenLength); + + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 3]; + } + + props.children = childArray; + } + + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key === undefined ? null : '' + key, + ref: null, + props: props, + _owner: null + }; +} + +module.exports = _createRawReactElement; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/newArrowCheck.js b/node_modules/@babel/runtime/helpers/newArrowCheck.js new file mode 100644 index 00000000..9b59f58c --- /dev/null +++ b/node_modules/@babel/runtime/helpers/newArrowCheck.js @@ -0,0 +1,7 @@ +function _newArrowCheck(innerThis, boundThis) { + if (innerThis !== boundThis) { + throw new TypeError("Cannot instantiate an arrow function"); + } +} + +module.exports = _newArrowCheck; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/nonIterableRest.js b/node_modules/@babel/runtime/helpers/nonIterableRest.js new file mode 100644 index 00000000..eb447dd7 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/nonIterableRest.js @@ -0,0 +1,5 @@ +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); +} + +module.exports = _nonIterableRest; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/nonIterableSpread.js b/node_modules/@babel/runtime/helpers/nonIterableSpread.js new file mode 100644 index 00000000..7d7ca436 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/nonIterableSpread.js @@ -0,0 +1,5 @@ +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance"); +} + +module.exports = _nonIterableSpread; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js b/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js new file mode 100644 index 00000000..1d5c04a7 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/objectDestructuringEmpty.js @@ -0,0 +1,5 @@ +function _objectDestructuringEmpty(obj) { + if (obj == null) throw new TypeError("Cannot destructure undefined"); +} + +module.exports = _objectDestructuringEmpty; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/objectSpread.js b/node_modules/@babel/runtime/helpers/objectSpread.js new file mode 100644 index 00000000..b9234007 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/objectSpread.js @@ -0,0 +1,22 @@ +var defineProperty = require("./defineProperty"); + +function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); + + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + + ownKeys.forEach(function (key) { + defineProperty(target, key, source[key]); + }); + } + + return target; +} + +module.exports = _objectSpread; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/objectWithoutProperties.js b/node_modules/@babel/runtime/helpers/objectWithoutProperties.js new file mode 100644 index 00000000..253d33c9 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/objectWithoutProperties.js @@ -0,0 +1,22 @@ +var objectWithoutPropertiesLoose = require("./objectWithoutPropertiesLoose"); + +function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + var target = objectWithoutPropertiesLoose(source, excluded); + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; +} + +module.exports = _objectWithoutProperties; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js b/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js new file mode 100644 index 00000000..a58c56b0 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js @@ -0,0 +1,16 @@ +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +module.exports = _objectWithoutPropertiesLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js b/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js new file mode 100644 index 00000000..84f7bf63 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js @@ -0,0 +1,13 @@ +var _typeof = require("../helpers/typeof"); + +var assertThisInitialized = require("./assertThisInitialized"); + +function _possibleConstructorReturn(self, call) { + if (call && (_typeof(call) === "object" || typeof call === "function")) { + return call; + } + + return assertThisInitialized(self); +} + +module.exports = _possibleConstructorReturn; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/readOnlyError.js b/node_modules/@babel/runtime/helpers/readOnlyError.js new file mode 100644 index 00000000..4e61e3fd --- /dev/null +++ b/node_modules/@babel/runtime/helpers/readOnlyError.js @@ -0,0 +1,5 @@ +function _readOnlyError(name) { + throw new Error("\"" + name + "\" is read-only"); +} + +module.exports = _readOnlyError; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/set.js b/node_modules/@babel/runtime/helpers/set.js new file mode 100644 index 00000000..aad38c22 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/set.js @@ -0,0 +1,56 @@ +var getPrototypeOf = require("./getPrototypeOf"); + +var superPropBase = require("./superPropBase"); + +var defineProperty = require("./defineProperty"); + +function set(target, property, value, receiver) { + if (typeof Reflect !== "undefined" && Reflect.set) { + set = Reflect.set; + } else { + set = function set(target, property, value, receiver) { + var base = superPropBase(target, property); + var desc; + + if (base) { + desc = Object.getOwnPropertyDescriptor(base, property); + + if (desc.set) { + desc.set.call(receiver, value); + return true; + } else if (!desc.writable) { + return false; + } + } + + desc = Object.getOwnPropertyDescriptor(receiver, property); + + if (desc) { + if (!desc.writable) { + return false; + } + + desc.value = value; + Object.defineProperty(receiver, property, desc); + } else { + defineProperty(receiver, property, value); + } + + return true; + }; + } + + return set(target, property, value, receiver); +} + +function _set(target, property, value, receiver, isStrict) { + var s = set(target, property, value, receiver || target); + + if (!s && isStrict) { + throw new Error('failed to set property'); + } + + return value; +} + +module.exports = _set; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/setPrototypeOf.js b/node_modules/@babel/runtime/helpers/setPrototypeOf.js new file mode 100644 index 00000000..d86e2fc3 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/setPrototypeOf.js @@ -0,0 +1,10 @@ +function _setPrototypeOf(o, p) { + module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); +} + +module.exports = _setPrototypeOf; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js b/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js new file mode 100644 index 00000000..e1d6c86b --- /dev/null +++ b/node_modules/@babel/runtime/helpers/skipFirstGeneratorNext.js @@ -0,0 +1,9 @@ +function _skipFirstGeneratorNext(fn) { + return function () { + var it = fn.apply(this, arguments); + it.next(); + return it; + }; +} + +module.exports = _skipFirstGeneratorNext; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/slicedToArray.js b/node_modules/@babel/runtime/helpers/slicedToArray.js new file mode 100644 index 00000000..243ea9e2 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/slicedToArray.js @@ -0,0 +1,11 @@ +var arrayWithHoles = require("./arrayWithHoles"); + +var iterableToArrayLimit = require("./iterableToArrayLimit"); + +var nonIterableRest = require("./nonIterableRest"); + +function _slicedToArray(arr, i) { + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest(); +} + +module.exports = _slicedToArray; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js b/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js new file mode 100644 index 00000000..c7e4313b --- /dev/null +++ b/node_modules/@babel/runtime/helpers/slicedToArrayLoose.js @@ -0,0 +1,11 @@ +var arrayWithHoles = require("./arrayWithHoles"); + +var iterableToArrayLimitLoose = require("./iterableToArrayLimitLoose"); + +var nonIterableRest = require("./nonIterableRest"); + +function _slicedToArrayLoose(arr, i) { + return arrayWithHoles(arr) || iterableToArrayLimitLoose(arr, i) || nonIterableRest(); +} + +module.exports = _slicedToArrayLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/superPropBase.js b/node_modules/@babel/runtime/helpers/superPropBase.js new file mode 100644 index 00000000..bbb34a2d --- /dev/null +++ b/node_modules/@babel/runtime/helpers/superPropBase.js @@ -0,0 +1,12 @@ +var getPrototypeOf = require("./getPrototypeOf"); + +function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = getPrototypeOf(object); + if (object === null) break; + } + + return object; +} + +module.exports = _superPropBase; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js b/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js new file mode 100644 index 00000000..bdcc1e9d --- /dev/null +++ b/node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js @@ -0,0 +1,13 @@ +function _taggedTemplateLiteral(strings, raw) { + if (!raw) { + raw = strings.slice(0); + } + + return Object.freeze(Object.defineProperties(strings, { + raw: { + value: Object.freeze(raw) + } + })); +} + +module.exports = _taggedTemplateLiteral; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js b/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js new file mode 100644 index 00000000..beced541 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/taggedTemplateLiteralLoose.js @@ -0,0 +1,10 @@ +function _taggedTemplateLiteralLoose(strings, raw) { + if (!raw) { + raw = strings.slice(0); + } + + strings.raw = raw; + return strings; +} + +module.exports = _taggedTemplateLiteralLoose; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/temporalRef.js b/node_modules/@babel/runtime/helpers/temporalRef.js new file mode 100644 index 00000000..20b2652a --- /dev/null +++ b/node_modules/@babel/runtime/helpers/temporalRef.js @@ -0,0 +1,11 @@ +var temporalUndefined = require("./temporalUndefined"); + +function _temporalRef(val, name) { + if (val === temporalUndefined) { + throw new ReferenceError(name + " is not defined - temporal dead zone"); + } else { + return val; + } +} + +module.exports = _temporalRef; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/temporalUndefined.js b/node_modules/@babel/runtime/helpers/temporalUndefined.js new file mode 100644 index 00000000..a0995453 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/temporalUndefined.js @@ -0,0 +1 @@ +module.exports = {}; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/toArray.js b/node_modules/@babel/runtime/helpers/toArray.js new file mode 100644 index 00000000..c28fd9e4 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/toArray.js @@ -0,0 +1,11 @@ +var arrayWithHoles = require("./arrayWithHoles"); + +var iterableToArray = require("./iterableToArray"); + +var nonIterableRest = require("./nonIterableRest"); + +function _toArray(arr) { + return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest(); +} + +module.exports = _toArray; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/toConsumableArray.js b/node_modules/@babel/runtime/helpers/toConsumableArray.js new file mode 100644 index 00000000..4cd54a33 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/toConsumableArray.js @@ -0,0 +1,11 @@ +var arrayWithoutHoles = require("./arrayWithoutHoles"); + +var iterableToArray = require("./iterableToArray"); + +var nonIterableSpread = require("./nonIterableSpread"); + +function _toConsumableArray(arr) { + return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread(); +} + +module.exports = _toConsumableArray; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/toPrimitive.js b/node_modules/@babel/runtime/helpers/toPrimitive.js new file mode 100644 index 00000000..cd1d383f --- /dev/null +++ b/node_modules/@babel/runtime/helpers/toPrimitive.js @@ -0,0 +1,16 @@ +var _typeof = require("../helpers/typeof"); + +function _toPrimitive(input, hint) { + if (_typeof(input) !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + + if (prim !== undefined) { + var res = prim.call(input, hint || "default"); + if (_typeof(res) !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + + return (hint === "string" ? String : Number)(input); +} + +module.exports = _toPrimitive; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/toPropertyKey.js b/node_modules/@babel/runtime/helpers/toPropertyKey.js new file mode 100644 index 00000000..108b083e --- /dev/null +++ b/node_modules/@babel/runtime/helpers/toPropertyKey.js @@ -0,0 +1,10 @@ +var _typeof = require("../helpers/typeof"); + +var toPrimitive = require("./toPrimitive"); + +function _toPropertyKey(arg) { + var key = toPrimitive(arg, "string"); + return _typeof(key) === "symbol" ? key : String(key); +} + +module.exports = _toPropertyKey; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/typeof.js b/node_modules/@babel/runtime/helpers/typeof.js new file mode 100644 index 00000000..fd7d3edf --- /dev/null +++ b/node_modules/@babel/runtime/helpers/typeof.js @@ -0,0 +1,17 @@ +function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } + +function _typeof(obj) { + if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") { + module.exports = _typeof = function _typeof(obj) { + return _typeof2(obj); + }; + } else { + module.exports = _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); + }; + } + + return _typeof(obj); +} + +module.exports = _typeof; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js b/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js new file mode 100644 index 00000000..11554f3d --- /dev/null +++ b/node_modules/@babel/runtime/helpers/wrapAsyncGenerator.js @@ -0,0 +1,9 @@ +var AsyncGenerator = require("./AsyncGenerator"); + +function _wrapAsyncGenerator(fn) { + return function () { + return new AsyncGenerator(fn.apply(this, arguments)); + }; +} + +module.exports = _wrapAsyncGenerator; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/wrapNativeSuper.js b/node_modules/@babel/runtime/helpers/wrapNativeSuper.js new file mode 100644 index 00000000..3d4bd7a0 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/wrapNativeSuper.js @@ -0,0 +1,43 @@ +var getPrototypeOf = require("./getPrototypeOf"); + +var setPrototypeOf = require("./setPrototypeOf"); + +var isNativeFunction = require("./isNativeFunction"); + +var construct = require("./construct"); + +function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + + module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !isNativeFunction(Class)) return Class; + + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + + _cache.set(Class, Wrapper); + } + + function Wrapper() { + return construct(Class, arguments, getPrototypeOf(this).constructor); + } + + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return setPrototypeOf(Wrapper, Class); + }; + + return _wrapNativeSuper(Class); +} + +module.exports = _wrapNativeSuper; \ No newline at end of file diff --git a/node_modules/@babel/runtime/helpers/wrapRegExp.js b/node_modules/@babel/runtime/helpers/wrapRegExp.js new file mode 100644 index 00000000..08bcb542 --- /dev/null +++ b/node_modules/@babel/runtime/helpers/wrapRegExp.js @@ -0,0 +1,76 @@ +var _typeof = require("../helpers/typeof"); + +var wrapNativeSuper = require("./wrapNativeSuper"); + +var getPrototypeOf = require("./getPrototypeOf"); + +var possibleConstructorReturn = require("./possibleConstructorReturn"); + +var inherits = require("./inherits"); + +function _wrapRegExp(re, groups) { + module.exports = _wrapRegExp = function _wrapRegExp(re, groups) { + return new BabelRegExp(re, groups); + }; + + var _RegExp = wrapNativeSuper(RegExp); + + var _super = RegExp.prototype; + + var _groups = new WeakMap(); + + function BabelRegExp(re, groups) { + var _this = _RegExp.call(this, re); + + _groups.set(_this, groups); + + return _this; + } + + inherits(BabelRegExp, _RegExp); + + BabelRegExp.prototype.exec = function (str) { + var result = _super.exec.call(this, str); + + if (result) result.groups = buildGroups(result, this); + return result; + }; + + BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { + if (typeof substitution === "string") { + var groups = _groups.get(this); + + return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { + return "$" + groups[name]; + })); + } else if (typeof substitution === "function") { + var _this = this; + + return _super[Symbol.replace].call(this, str, function () { + var args = []; + args.push.apply(args, arguments); + + if (_typeof(args[args.length - 1]) !== "object") { + args.push(buildGroups(args, _this)); + } + + return substitution.apply(this, args); + }); + } else { + return _super[Symbol.replace].call(this, str, substitution); + } + }; + + function buildGroups(result, re) { + var g = _groups.get(re); + + return Object.keys(g).reduce(function (groups, name) { + groups[name] = result[g[name]]; + return groups; + }, Object.create(null)); + } + + return _wrapRegExp.apply(this, arguments); +} + +module.exports = _wrapRegExp; \ No newline at end of file diff --git a/node_modules/@babel/runtime/package.json b/node_modules/@babel/runtime/package.json new file mode 100644 index 00000000..0d7d2fd1 --- /dev/null +++ b/node_modules/@babel/runtime/package.json @@ -0,0 +1,53 @@ +{ + "_from": "@babel/runtime@^7.1.2", + "_id": "@babel/runtime@7.4.5", + "_inBundle": false, + "_integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==", + "_location": "/@babel/runtime", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "@babel/runtime@^7.1.2", + "name": "@babel/runtime", + "escapedName": "@babel%2fruntime", + "scope": "@babel", + "rawSpec": "^7.1.2", + "saveSpec": null, + "fetchSpec": "^7.1.2" + }, + "_requiredBy": [ + "/history", + "/mini-create-react-context", + "/react-router", + "/react-router-dom" + ], + "_resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz", + "_shasum": "582bb531f5f9dc67d2fcb682979894f75e253f12", + "_spec": "@babel/runtime@^7.1.2", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/react-router-dom", + "author": { + "name": "Sebastian McKenzie", + "email": "sebmck@gmail.com" + }, + "bundleDependencies": false, + "dependencies": { + "regenerator-runtime": "^0.13.2" + }, + "deprecated": false, + "description": "babel's modular runtime helpers", + "devDependencies": { + "@babel/helpers": "^7.4.4" + }, + "gitHead": "33ab4f166117e2380de3955a0842985f578b01b8", + "license": "MIT", + "name": "@babel/runtime", + "publishConfig": { + "access": "public" + }, + "repository": { + "type": "git", + "url": "https://github.com/babel/babel/tree/master/packages/babel-runtime" + }, + "version": "7.4.5" +} diff --git a/node_modules/@babel/runtime/regenerator/index.js b/node_modules/@babel/runtime/regenerator/index.js new file mode 100644 index 00000000..9fd4158a --- /dev/null +++ b/node_modules/@babel/runtime/regenerator/index.js @@ -0,0 +1 @@ +module.exports = require("regenerator-runtime"); diff --git a/node_modules/gud/README.md b/node_modules/gud/README.md new file mode 100644 index 00000000..b598a54f --- /dev/null +++ b/node_modules/gud/README.md @@ -0,0 +1,25 @@ +# gud + +> Create a 'gud nuff' (not cryptographically secure) globally unique id + +## Install + +``` +yarn add gud +``` + +## Usage + +```js +const gud = require('gud'); + +console.log(gud()); // 1 +console.log(gud()); // 2 +``` + +This is ever so slightly better than using something like `_.uniqueId` because +it will work across multiple copies of the same module. + +Do not use this in place of actual UUIDs, security folks will hate me. + +This will not be unique across processes/workers. diff --git a/node_modules/gud/index.js b/node_modules/gud/index.js new file mode 100644 index 00000000..2e564fa9 --- /dev/null +++ b/node_modules/gud/index.js @@ -0,0 +1,8 @@ +// @flow +'use strict'; + +var key = '__global_unique_id__'; + +module.exports = function() { + return global[key] = (global[key] || 0) + 1; +}; diff --git a/node_modules/gud/package.json b/node_modules/gud/package.json new file mode 100644 index 00000000..82d2d576 --- /dev/null +++ b/node_modules/gud/package.json @@ -0,0 +1,63 @@ +{ + "_from": "gud@^1.0.0", + "_id": "gud@1.0.0", + "_inBundle": false, + "_integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==", + "_location": "/gud", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "gud@^1.0.0", + "name": "gud", + "escapedName": "gud", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/mini-create-react-context" + ], + "_resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz", + "_shasum": "a489581b17e6a70beca9abe3ae57de7a499852c0", + "_spec": "gud@^1.0.0", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/mini-create-react-context", + "author": { + "name": "Jamie Kyle", + "email": "me@thejameskyle.com" + }, + "bugs": { + "url": "https://github.com/jamiebuilds/global-unique-id/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Create a 'gud nuff' (not cryptographically secure) globally unique id", + "devDependencies": { + "ava": "^0.25.0", + "flow-bin": "^0.66.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/jamiebuilds/global-unique-id#readme", + "keywords": [ + "global", + "unique", + "id", + "identifier", + "number", + "uuid", + "uid" + ], + "license": "MIT", + "main": "index.js", + "name": "gud", + "repository": { + "type": "git", + "url": "git+https://github.com/jamiebuilds/global-unique-id.git" + }, + "scripts": { + "test": "ava" + }, + "version": "1.0.0" +} diff --git a/node_modules/history/CHANGES.md b/node_modules/history/CHANGES.md new file mode 100644 index 00000000..8e63ba0d --- /dev/null +++ b/node_modules/history/CHANGES.md @@ -0,0 +1,395 @@ +## [v4.6.3] +> Jun 20, 2017 + +- Add main/module entries to package.json (thanks @pshrmn) + +[v4.6.3]: https://github.com/ReactTraining/history/compare/v4.6.2...v4.6.3 + +## [v4.6.2] +> Jun 14, 2017 + +- Rely on the user/browser to encode pathname portion of the URL +- Add more complete basename matching support (case insensitive matching, basename must be a complete match, see [#459]) + +[v4.6.2]: https://github.com/ReactTraining/history/compare/v4.6.1...v4.6.2 +[#459]: https://github.com/ReactTraining/history/pull/459 + +## [v4.6.1] +> Mar 15, 2017 + +- Only encode/decode pathname portion of the URL (see [#445]) + +[v4.6.1]: https://github.com/ReactTraining/history/compare/v4.6.0...v4.6.1 +[#445]: https://github.com/ReactTraining/history/pull/445 + +## [v4.6.0] +> Mar 7, 2017 + +- Encode/decode URLs +- Added `location.key` to the initial location in memory history +- Added ES modules build in `es` package directory +- Improve `basename` slash handling (source of a common user error, see [#404] and [#432]) + +[v4.6.0]: https://github.com/ReactTraining/history/compare/v4.5.1...v4.6.0 +[#404]: https://github.com/ReactTraining/history/issues/404 +[#432]: https://github.com/ReactTraining/history/pull/432 + +## [v4.5.1] +> Jan 9, 2017 + +- Fix a bug that allowed a history listener to still be called if it was + unregistered in another listener + +[v4.5.1]: https://github.com/ReactTraining/history/compare/v4.5.0...v4.5.1 + +## [v4.5.0] +> Dec 14, 2016 + +- Added `history.createHref(location)` for creating hrefs suitable for use in `` + +[v4.5.0]: https://github.com/ReactTraining/history/compare/v4.4.1...v4.5.0 + +## [v4.4.1] +> Nov 24, 2016 + +- Fix the back button on Chrome iOS + +[v4.4.1]: https://github.com/ReactTraining/history/compare/v4.4.0...v4.4.1 + +## [v4.4.0] +> Nov 1, 2016 + +- Use `value-equal` instead of own `deepEqual` function for checking state equality + +[v4.4.0]: https://github.com/ReactTraining/history/compare/v4.3.0...v4.4.0 + +## [v4.3.0] +> Sep 29, 2016 + +- Allow relative pathnames in `history.push` and `history.replace` ([#135]) + +[v4.3.0]: https://github.com/ReactTraining/history/compare/v4.2.1...v4.3.0 +[#135]: https://github.com/ReactTraining/history/issues/135 + +## [v4.2.1] +> Sep 29, 2016 + +- Fixed `createLocation` defaults when using objects instead of strings + +[v4.2.1]: https://github.com/ReactTraining/history/compare/v4.2.0...v4.2.1 + +## [v4.2.0] +> Sep 15, 2016 + +- Add `createLocation` to top-level exports +- Better warnings + +[v4.2.0]: https://github.com/ReactTraining/history/compare/v4.1.0...v4.2.0 + +## [v4.1.0] +> Sep 15, 2016 + +- Automatically use a leading `/` when doing `history.push('')` +- Automatically clean up bad location descriptors + +[v4.1.0]: https://github.com/ReactTraining/history/compare/v4.0.0...v4.1.0 + +## [v4.0.0] +> Sep 10, 2016 + +- Added back two-arg form of `push` and `replace` + +[v4.0.0]: https://github.com/ReactTraining/history/compare/v4.0.0-2...v4.0.0 + +## [v4.0.0-2] +> Sep 9, 2016 + +- Added `history.length`, `history.location`, and `history.action` properties +- Added `history.index` and `history.entries` properties in memory history +- Added `location.pathname`, `location.search`, and `location.hash` instead of + `location.path` since this is work most people will always have to do +- Added `parsePath` and `createPath` helpers to top-level exports +- Removed `history.getCurrentLocation()` + +[v4.0.0-2]: https://github.com/ReactTraining/history/compare/v4.0.0-1...v4.0.0-2 + +## [v4.0.0-1] +> Sep 6, 2016 + +- Fix blocking POP transitions in browsers where listen() has not yet been called +- Use block(false) to prevent transitions +- Better warnings for PUSH with the same path using hash history + +[v4.0.0-1]: https://github.com/ReactTraining/history/compare/v4.0.0-0...v4.0.0-1 + +## [v4.0.0-0] +> Sep 3, 2016 + +- Easier top-level `import`s. Use `import createHistory from "history/createBrowserHistory"` instead of `history/lib/createBrowserHistory`. +- Removed the "middleware" API (i.e. all "use" functions). +- Moved path and query parsing out of core. Location objects are now `{ path, state, key }`. Any other parsing can be done outside core. +- Removed the `Actions` module. `location.action` is now just a string. No need to `import` our constants. +- Switched to using `window.history.state` in `createBrowserHistory` instead of `sessionStorage`. +- Removed `location.state` entirely from `createHashHistory` locations. +- Removed support for basename in `createMemoryHistory`. +- Refactored the test suite. Tests are much more flexible and easier to zero in on one that is failing. + +[v4.0.0-0]: https://github.com/ReactTraining/history/compare/v3.2.1...v4.0.0-0 + +## [v3.2.0] +> Sep 1, 2016 + +- Exposed `canGo` in memory history + +[v3.2.0]: https://github.com/ReactTraining/history/compare/v3.1.0...v3.2.0 + +## [v3.1.0] +> Sep 1, 2016 + +- Added `hashType` option to hash history for supporting different + hash URL schemes including "hashbang" and no leading slash +- **Bugfix:** Fix URL restoration on canceled popstate transitions +- Better React Native support + +[v3.1.0]: https://github.com/ReactTraining/history/compare/v3.0.0...v3.1.0 + +## [v3.0.0] +> May 30, 2016 + +- `location.query` has no prototype +- Warn about protocol-relative URLs ([#243]) +- **Bugfix:** Ignore errors when saving hash history state if + `window.sessionStorage` is undefined ([#295]) +- **Bugfix:** Fix replacing hash path in IE served via file protocol ([#126]) + +[v3.0.0]: https://github.com/ReactTraining/history/compare/v3.0.0-2...v3.0.0 +[#243]: https://github.com/ReactTraining/history/issues/243 +[#295]: https://github.com/ReactTraining/history/issues/295 +[#126]: https://github.com/ReactTraining/history/issues/126 + +## [v3.0.0-2] +> Apr 19, 2016 + +- Lower-cased UMD build file name + +[v3.0.0-2]: https://github.com/ReactTraining/history/compare/v3.0.0-1...v3.0.0-2 + +## [v3.0.0-1] +> Apr 19, 2016 + +- Added `locationsAreEqual` to top-level exports +- **Breakage:** Removed support for `` as `basename` ([#94]) +- Removed dependency on `deep-equal` + +[v3.0.0-1]: https://github.com/ReactTraining/history/compare/v3.0.0-0...v3.0.0-1 +[#94]: https://github.com/ReactTraining/history/issues/94 + +## [3.0.0-0] +> Mar 19, 2016 + +- Added `history.getCurrentLocation()` method +- **Breakage:** `history.listen` no longer calls the callback synchronously once. + Use `history.getCurrentLocation` instead +- **Breakage:** `location.key` on the initial POP is `null`. Users who relied on + this key may immediately use `replace` to get it back +- **Breakage:** `location.state` is `undefined` (instead of `null`) if the location + has no state. This helps us know when we need to access session storage and when + we can safely ignore it +- **Bugfix:** Hash history now uses a custom query string key/value pair only if + the location has state. This obsoletes using `{ queryKey: false }` to prevent + the query string from being used ([#163]) +- **Bugfix:** Do not access `window.sessionStorage` unless the location has state. + This should minimize the # of times we access session storage and allow users to + opt-out of using it entirely by not using location state + +[3.0.0-0]: https://github.com/ReactTraining/history/compare/v2.0.0...v3.0.0-0 +[#163]: https://github.com/ReactTraining/history/issues/163 + +## [v2.0.0] +> Feb 4, 2016 + +- **Bugfix:** Fix search base logic with an empty query ([#221]) +- **Bugfix:** Fail gracefully when Safari 5 security settings prevent access to window.sessionStorage ([#223]) + +[v2.0.0]: https://github.com/ReactTraining/history/compare/v2.0.0-rc3...v2.0.0 +[#221]: https://github.com/ReactTraining/history/issues/221 +[#223]: https://github.com/ReactTraining/history/pull/223 + +## [v2.0.0-rc3] +> Feb 3, 2016 + +- **Bugfix:** Don't convert same-path `PUSH` to `REPLACE` when `location.state` changes ([#179]) +- **Bugfix:** Re-enable browser history on Chrome iOS ([#208]) +- **Bugfix:** Properly support location descriptors in `history.createLocation` ([#200]) + +[v2.0.0-rc3]: https://github.com/ReactTraining/history/compare/v2.0.0-rc2...v2.0.0-rc3 +[#179]: https://github.com/ReactTraining/history/pull/179 +[#208]: https://github.com/ReactTraining/history/pull/208 +[#200]: https://github.com/ReactTraining/history/pull/200 + +## [v2.0.0-rc2] +> Jan 9, 2016 + +- Add back deprecation warnings + +[v2.0.0-rc2]: https://github.com/ReactTraining/history/compare/v2.0.0-rc1...v2.0.0-rc2 + +## [v2.0.0-rc1] +> Jan 2, 2016 + +- **Bugfix:** Don't create empty entries in session storage ([#177]) + +[v2.0.0-rc1]: https://github.com/ReactTraining/history/compare/v1.17.0...v2.0.0-rc1 +[#177]: https://github.com/ReactTraining/history/pull/177 + +## [v1.17.0] +> Dec 19, 2015 + +- **Bugfix:** Don't throw in memory history when out of history entries ([#170]) +- **Bugfix:** Fix the deprecation warnings on `createPath` and `createHref` ([#189]) + +[v1.17.0]: https://github.com/ReactTraining/history/compare/v1.16.0...v1.17.0 +[#170]: https://github.com/ReactTraining/history/pull/170 +[#189]: https://github.com/ReactTraining/history/pull/189 + +## [v1.16.0] +> Dec 10, 2015 + +- **Bugfix:** Silence all warnings that were introduced since 1.13 (see [reactjs/react-router#2682]) +- Deprecate the `createLocation` method in the top-level exports +- Deprecate the `state` arg to `history.createLocation` + +[v1.16.0]: https://github.com/ReactTraining/history/compare/v1.15.0...v1.16.0 +[reactjs/react-router#2682]: https://github.com/reactjs/react-router/issues/2682 + +## [v1.15.0] +> Dec 7, 2015 + +- Accept location descriptors in `createPath` and `createHref` ([#173]) +- Deprecate the `query` arg to `createPath` and `createHref` in favor of using location descriptor objects ([#173]) + +[v1.15.0]: https://github.com/ReactTraining/history/compare/v1.14.0...v1.15.0 +[#173]: https://github.com/ReactTraining/history/pull/173 + +## [v1.14.0] +> Dec 6, 2015 + +- Accept objects in `history.push` and `history.replace` ([#141]) +- Deprecate `history.pushState` and `history.replaceState` in favor of passing objects to `history.push` and `history.replace` ([#168]) +- **Bugfix:** Disable browser history on Chrome iOS ([#146]) +- **Bugfix:** Do not convert same-path PUSH to REPLACE if the hash has changed ([#167]) +- Add ES2015 module build ([#152]) +- Use query-string module instead of qs to save on bytes ([#121]) + +[v1.14.0]: https://github.com/ReactTraining/history/compare/v1.13.1...v1.14.0 +[#121]: https://github.com/ReactTraining/history/issues/121 +[#141]: https://github.com/ReactTraining/history/pull/141 +[#146]: https://github.com/ReactTraining/history/pull/146 +[#152]: https://github.com/ReactTraining/history/pull/152 +[#167]: https://github.com/ReactTraining/history/pull/167 +[#168]: https://github.com/ReactTraining/history/pull/168 + +## [v1.13.1] +> Nov 13, 2015 + +- Fail gracefully when Safari security settings prevent access to window.sessionStorage +- Pushing the currently active path will result in a replace to not create additional browser history entries ([#43]) +- Strip the protocol and domain from `` ([#139]) + +[v1.13.1]: https://github.com/ReactTraining/history/compare/v1.13.0...v1.13.1 +[#43]: https://github.com/ReactTraining/history/pull/43 +[#139]: https://github.com/ReactTraining/history/pull/139 + +## [v1.13.0] +> Oct 28, 2015 + +- `useBasename` transparently handles trailing slashes ([#108]) +- `useBasename` automatically uses the value of `` when no + `basename` option is provided ([#94]) + +[v1.13.0]: https://github.com/ReactTraining/history/compare/v1.12.6...v1.13.0 +[#108]: https://github.com/ReactTraining/history/pull/108 +[#94]: https://github.com/ReactTraining/history/issues/94 + +## [v1.12.6] +> Oct 25, 2015 + +- Add `forceRefresh` option to `createBrowserHistory` that forces + full page refreshes even when the browser supports pushState ([#95]) + +[v1.12.6]: https://github.com/ReactTraining/history/compare/v1.12.5...v1.12.6 +[#95]: https://github.com/ReactTraining/history/issues/95 + +## [v1.12.5] +> Oct 11, 2015 + +- Un-deprecate top-level createLocation method +- Add ability to use `{ pathname, search, hash }` object anywhere + a path can be used +- Fix `useQueries` handling of hashes ([#93]) + +[v1.12.5]: https://github.com/ReactTraining/history/compare/v1.12.4...v1.12.5 +[#93]: https://github.com/ReactTraining/history/issues/93 + +## [v1.12.4] +> Oct 9, 2015 + +- Fix npm postinstall hook on Windows ([#62]) + +[v1.12.4]: https://github.com/ReactTraining/history/compare/v1.12.3...v1.12.4 +[#62]: https://github.com/ReactTraining/history/issues/62 + +## [v1.12.3] +> Oct 7, 2015 + +- Fix listenBefore hooks not being called unless a listen hook was also registered ([#71]) +- Add a warning when we cannot save state in Safari private mode ([#42]) + +[v1.12.3]: https://github.com/ReactTraining/history/compare/v1.12.2...v1.12.3 +[#71]: https://github.com/ReactTraining/history/issues/71 +[#42]: https://github.com/ReactTraining/history/issues/42 + +## [v1.12.2] +> Oct 6, 2015 + +- Fix hash support (see [comments in #51][#51-comments]) + +[v1.12.2]: https://github.com/ReactTraining/history/compare/v1.12.1...v1.12.2 +[#51-comments]: https://github.com/ReactTraining/history/pull/51#issuecomment-143189672 + +## [v1.12.1] +> Oct 5, 2015 + +- Give `location` objects a `key` by default +- Deprecate `history.setState` + +[v1.12.1]: https://github.com/ReactTraining/history/compare/v1.12.0...v1.12.1 + +## [v1.12.0] +> Oct 4, 2015 + +- Add `history.createLocation` instance method. This allows history enhancers such as `useQueries` to modify `location` objects when creating them directly +- Deprecate `createLocation` method on top-level exports + +[v1.12.0]: https://github.com/ReactTraining/history/compare/v1.11.1...v1.12.0 + +## [v1.11.1] +> Sep 26, 2015 + +- Fix `location.basename` when location matches exactly ([#68]) +- Allow transitions to be interrupted by another + +[v1.11.1]: https://github.com/ReactTraining/history/compare/v1.11.0...v1.11.1 +[#68]: https://github.com/ReactTraining/history/issues/68 + +## [v1.11.0] +> Sep 24, 2015 + +- Add `useBasename` history enhancer +- Add `history.listenBefore` +- Add `history.listenBeforeUnload` to `useBeforeUnload` history enhancer +- Deprecate (un)registerTransitionHook +- Deprecate (un)registerBeforeUnloadHook +- Fix installing directly from git repo + +[v1.11.0]: https://github.com/ReactTraining/history/compare/v1.10.2...v1.11.0 diff --git a/node_modules/history/DOMUtils.js b/node_modules/history/DOMUtils.js new file mode 100644 index 00000000..c4f93d31 --- /dev/null +++ b/node_modules/history/DOMUtils.js @@ -0,0 +1,3 @@ +'use strict'; +require('./warnAboutDeprecatedCJSRequire.js')('DOMUtils'); +module.exports = require('./index.js').DOMUtils; diff --git a/node_modules/history/ExecutionEnvironment.js b/node_modules/history/ExecutionEnvironment.js new file mode 100644 index 00000000..44de3b2f --- /dev/null +++ b/node_modules/history/ExecutionEnvironment.js @@ -0,0 +1,3 @@ +'use strict'; +require('./warnAboutDeprecatedCJSRequire.js')('ExecutionEnvironment'); +module.exports = require('./index.js').ExecutionEnvironment; diff --git a/node_modules/history/LICENSE b/node_modules/history/LICENSE new file mode 100644 index 00000000..dc15fe3f --- /dev/null +++ b/node_modules/history/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) React Training 2016-2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/history/LocationUtils.js b/node_modules/history/LocationUtils.js new file mode 100644 index 00000000..a8612056 --- /dev/null +++ b/node_modules/history/LocationUtils.js @@ -0,0 +1,3 @@ +'use strict'; +require('./warnAboutDeprecatedCJSRequire.js')('LocationUtils'); +module.exports = require('./index.js').LocationUtils; diff --git a/node_modules/history/PathUtils.js b/node_modules/history/PathUtils.js new file mode 100644 index 00000000..7dc98c20 --- /dev/null +++ b/node_modules/history/PathUtils.js @@ -0,0 +1,3 @@ +'use strict'; +require('./warnAboutDeprecatedCJSRequire.js')('PathUtils'); +module.exports = require('./index.js').PathUtils; diff --git a/node_modules/history/README.md b/node_modules/history/README.md new file mode 100644 index 00000000..e52b4a15 --- /dev/null +++ b/node_modules/history/README.md @@ -0,0 +1,282 @@ +# history [![Travis][build-badge]][build] [![npm package][npm-badge]][npm] + +[build-badge]: https://img.shields.io/travis/ReactTraining/history/master.svg?style=flat-square +[build]: https://travis-ci.org/ReactTraining/history +[npm-badge]: https://img.shields.io/npm/v/history.svg?style=flat-square +[npm]: https://www.npmjs.org/package/history + +[`history`](https://www.npmjs.com/package/history) is a JavaScript library that lets you easily manage session history anywhere JavaScript runs. `history` abstracts away the differences in various environments and provides a minimal API that lets you manage the history stack, navigate, confirm navigation, and persist state between sessions. + +## Installation + +Using [npm](https://www.npmjs.com/): + + $ npm install --save history + +Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else: + +```js +// using ES6 modules +import { createBrowserHistory } from 'history'; + +// using CommonJS modules +var createBrowserHistory = require('history').createBrowserHistory; +``` + +The UMD build is also available on [unpkg](https://unpkg.com): + +```html + +``` + +You can find the library on `window.History`. + +## Usage + +`history` provides 3 different methods for creating a `history` object, depending on your environment. + +- `createBrowserHistory` is for use in modern web browsers that support the [HTML5 history API](http://diveintohtml5.info/history.html) (see [cross-browser compatibility](http://caniuse.com/#feat=history)) +- `createMemoryHistory` is used as a reference implementation and may also be used in non-DOM environments, like [React Native](https://facebook.github.io/react-native/) or tests +- `createHashHistory` is for use in legacy web browsers + +Depending on the method you want to use to keep track of history, you'll `import` (or `require`) one of these methods directly from the package root (i.e. `history/createBrowserHistory`). The remainder of this document uses the term `createHistory` to refer to any of these implementations. + +Basic usage looks like this: + +```js +import { createBrowserHistory } from 'history'; + +const history = createBrowserHistory(); + +// Get the current location. +const location = history.location; + +// Listen for changes to the current location. +const unlisten = history.listen((location, action) => { + // location is an object like window.location + console.log(action, location.pathname, location.state); +}); + +// Use push, replace, and go to navigate around. +history.push('/home', { some: 'state' }); + +// To stop listening, call the function returned from listen(). +unlisten(); +``` + +The options that each `create` method takes, along with its default values, are: + +```js +createBrowserHistory({ + basename: '', // The base URL of the app (see below) + forceRefresh: false, // Set true to force full page refreshes + keyLength: 6, // The length of location.key + // A function to use to confirm navigation with the user (see below) + getUserConfirmation: (message, callback) => callback(window.confirm(message)) +}); + +createMemoryHistory({ + initialEntries: ['/'], // The initial URLs in the history stack + initialIndex: 0, // The starting index in the history stack + keyLength: 6, // The length of location.key + // A function to use to confirm navigation with the user. Required + // if you return string prompts from transition hooks (see below) + getUserConfirmation: null +}); + +createHashHistory({ + basename: '', // The base URL of the app (see below) + hashType: 'slash', // The hash type to use (see below) + // A function to use to confirm navigation with the user (see below) + getUserConfirmation: (message, callback) => callback(window.confirm(message)) +}); +``` + +### Properties + +Each `history` object has the following properties: + +- `history.length` - The number of entries in the history stack +- `history.location` - The current location (see below) +- `history.action` - The current navigation action (see below) + +Additionally, `createMemoryHistory` provides `history.index` and `history.entries` properties that let you inspect the history stack. + +### Listening + +You can listen for changes to the current location using `history.listen`: + +```js +history.listen((location, action) => { + console.log( + `The current URL is ${location.pathname}${location.search}${location.hash}` + ); + console.log(`The last navigation action was ${action}`); +}); +``` + +The `location` object implements a subset of [the `window.location` interface](https://developer.mozilla.org/en-US/docs/Web/API/Location), including: + +- `location.pathname` - The path of the URL +- `location.search` - The URL query string +- `location.hash` - The URL hash fragment + +Locations may also have the following properties: + +- `location.state` - Some extra state for this location that does not reside in the URL (supported in `createBrowserHistory` and `createMemoryHistory`) +- `location.key` - A unique string representing this location (supported in `createBrowserHistory` and `createMemoryHistory`) + +The `action` is one of `PUSH`, `REPLACE`, or `POP` depending on how the user got to the current URL. + +#### Cleaning up + +When you attach a listener using `history.listen`, it returns a function that can be used to remove the listener, which can then be invoked in cleanup logic: + +```js +const unlisten = history.listen(myListener); +// ... +unlisten(); +``` + +### Navigation + +`history` objects may be used to programmatically change the current location using the following methods: + +- `history.push(path, [state])` +- `history.replace(path, [state])` +- `history.go(n)` +- `history.goBack()` +- `history.goForward()` +- `history.canGo(n)` (only in `createMemoryHistory`) + +When using `push` or `replace` you can either specify both the URL path and state as separate arguments or include everything in a single location-like object as the first argument. + +1. A URL path _or_ +2. A location-like object with `{ pathname, search, hash, state }` + +```js +// Push a new entry onto the history stack. +history.push('/home'); + +// Push a new entry onto the history stack with a query string +// and some state. Location state does not appear in the URL. +history.push('/home?the=query', { some: 'state' }); + +// If you prefer, use a single location-like object to specify both +// the URL and state. This is equivalent to the example above. +history.push({ + pathname: '/home', + search: '?the=query', + state: { some: 'state' } +}); + +// Go back to the previous history entry. The following +// two lines are synonymous. +history.go(-1); +history.goBack(); +``` + +**Note:** Location state is only supported in `createBrowserHistory` and `createMemoryHistory`. + +### Blocking Transitions + +`history` lets you register a prompt message that will be shown to the user before location listeners are notified. This allows you to make sure the user wants to leave the current page before they navigate away. + +```js +// Register a simple prompt message that will be shown the +// user before they navigate away from the current page. +const unblock = history.block('Are you sure you want to leave this page?'); + +// Or use a function that returns the message when it's needed. +history.block((location, action) => { + // The location and action arguments indicate the location + // we're transitioning to and how we're getting there. + + // A common use case is to prevent the user from leaving the + // page if there's a form they haven't submitted yet. + if (input.value !== '') return 'Are you sure you want to leave this page?'; +}); + +// To stop blocking transitions, call the function returned from block(). +unblock(); +``` + +**Note:** You'll need to provide a `getUserConfirmation` function to use this feature with `createMemoryHistory` (see below). + +### Customizing the Confirm Dialog + +By default, [`window.confirm`](https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm) is used to show prompt messages to the user. If you need to override this behavior (or if you're using `createMemoryHistory`, which doesn't assume a DOM environment), provide a `getUserConfirmation` function when you create your history object. + +```js +const history = createHistory({ + getUserConfirmation(message, callback) { + // Show some custom dialog to the user and call + // callback(true) to continue the transiton, or + // callback(false) to abort it. + } +}); +``` + +### Using a Base URL + +If all the URLs in your app are relative to some other "base" URL, use the `basename` option. This option transparently adds the given string to the front of all URLs you use. + +```js +const history = createHistory({ + basename: '/the/base' +}); + +history.listen(location => { + console.log(location.pathname); // /home +}); + +history.push('/home'); // URL is now /the/base/home +``` + +**Note:** `basename` is not suppported in `createMemoryHistory`. + +### Forcing Full Page Refreshes in createBrowserHistory + +By default `createBrowserHistory` uses HTML5 `pushState` and `replaceState` to prevent reloading the entire page from the server while navigating around. If instead you would like to reload as the URL changes, use the `forceRefresh` option. + +```js +const history = createBrowserHistory({ + forceRefresh: true +}); +``` + +### Modifying the Hash Type in createHashHistory + +By default `createHashHistory` uses a leading slash in hash-based URLs. You can use the `hashType` option to use a different hash formatting. + +```js +const history = createHashHistory({ + hashType: 'slash' // the default +}); + +history.push('/home'); // window.location.hash is #/home + +const history = createHashHistory({ + hashType: 'noslash' // Omit the leading slash +}); + +history.push('/home'); // window.location.hash is #home + +const history = createHashHistory({ + hashType: 'hashbang' // Google's legacy AJAX URL format +}); + +history.push('/home'); // window.location.hash is #!/home +``` + +## About + +`history` is developed and maintained by [React Training](https://reacttraining.com). If +you're interested in learning more about what React can do for your company, please +[get in touch](mailto:hello@reacttraining.com)! + +## Thanks + +A big thank-you to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to run our build in real browsers. + +Also, thanks to [Dan Shaw](https://www.npmjs.com/~dshaw) for letting us use the `history` npm package name. Thanks Dan! diff --git a/node_modules/history/cjs/history.js b/node_modules/history/cjs/history.js new file mode 100644 index 00000000..263ef7ff --- /dev/null +++ b/node_modules/history/cjs/history.js @@ -0,0 +1,933 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var resolvePathname = _interopDefault(require('resolve-pathname')); +var valueEqual = _interopDefault(require('value-equal')); +var warning = _interopDefault(require('tiny-warning')); +var invariant = _interopDefault(require('tiny-invariant')); + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function addLeadingSlash(path) { + return path.charAt(0) === '/' ? path : '/' + path; +} +function stripLeadingSlash(path) { + return path.charAt(0) === '/' ? path.substr(1) : path; +} +function hasBasename(path, prefix) { + return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path); +} +function stripBasename(path, prefix) { + return hasBasename(path, prefix) ? path.substr(prefix.length) : path; +} +function stripTrailingSlash(path) { + return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path; +} +function parsePath(path) { + var pathname = path || '/'; + var search = ''; + var hash = ''; + var hashIndex = pathname.indexOf('#'); + + if (hashIndex !== -1) { + hash = pathname.substr(hashIndex); + pathname = pathname.substr(0, hashIndex); + } + + var searchIndex = pathname.indexOf('?'); + + if (searchIndex !== -1) { + search = pathname.substr(searchIndex); + pathname = pathname.substr(0, searchIndex); + } + + return { + pathname: pathname, + search: search === '?' ? '' : search, + hash: hash === '#' ? '' : hash + }; +} +function createPath(location) { + var pathname = location.pathname, + search = location.search, + hash = location.hash; + var path = pathname || '/'; + if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search; + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash; + return path; +} + +function createLocation(path, state, key, currentLocation) { + var location; + + if (typeof path === 'string') { + // Two-arg form: push(path, state) + location = parsePath(path); + location.state = state; + } else { + // One-arg form: push(location) + location = _extends({}, path); + if (location.pathname === undefined) location.pathname = ''; + + if (location.search) { + if (location.search.charAt(0) !== '?') location.search = '?' + location.search; + } else { + location.search = ''; + } + + if (location.hash) { + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; + } else { + location.hash = ''; + } + + if (state !== undefined && location.state === undefined) location.state = state; + } + + try { + location.pathname = decodeURI(location.pathname); + } catch (e) { + if (e instanceof URIError) { + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); + } else { + throw e; + } + } + + if (key) location.key = key; + + if (currentLocation) { + // Resolve incomplete/relative pathname relative to current location. + if (!location.pathname) { + location.pathname = currentLocation.pathname; + } else if (location.pathname.charAt(0) !== '/') { + location.pathname = resolvePathname(location.pathname, currentLocation.pathname); + } + } else { + // When there is no prior location and pathname is empty, set it to / + if (!location.pathname) { + location.pathname = '/'; + } + } + + return location; +} +function locationsAreEqual(a, b) { + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state); +} + +function createTransitionManager() { + var prompt = null; + + function setPrompt(nextPrompt) { + warning(prompt == null, 'A history supports only one prompt at a time'); + prompt = nextPrompt; + return function () { + if (prompt === nextPrompt) prompt = null; + }; + } + + function confirmTransitionTo(location, action, getUserConfirmation, callback) { + // TODO: If another transition starts while we're still confirming + // the previous one, we may end up in a weird state. Figure out the + // best way to handle this. + if (prompt != null) { + var result = typeof prompt === 'function' ? prompt(location, action) : prompt; + + if (typeof result === 'string') { + if (typeof getUserConfirmation === 'function') { + getUserConfirmation(result, callback); + } else { + warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message'); + callback(true); + } + } else { + // Return false from a transition hook to cancel the transition. + callback(result !== false); + } + } else { + callback(true); + } + } + + var listeners = []; + + function appendListener(fn) { + var isActive = true; + + function listener() { + if (isActive) fn.apply(void 0, arguments); + } + + listeners.push(listener); + return function () { + isActive = false; + listeners = listeners.filter(function (item) { + return item !== listener; + }); + }; + } + + function notifyListeners() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + listeners.forEach(function (listener) { + return listener.apply(void 0, args); + }); + } + + return { + setPrompt: setPrompt, + confirmTransitionTo: confirmTransitionTo, + appendListener: appendListener, + notifyListeners: notifyListeners + }; +} + +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); +function getConfirmation(message, callback) { + callback(window.confirm(message)); // eslint-disable-line no-alert +} +/** + * Returns true if the HTML5 history API is supported. Taken from Modernizr. + * + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586 + */ + +function supportsHistory() { + var ua = window.navigator.userAgent; + if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; + return window.history && 'pushState' in window.history; +} +/** + * Returns true if browser fires popstate on hash change. + * IE10 and IE11 do not. + */ + +function supportsPopStateOnHashChange() { + return window.navigator.userAgent.indexOf('Trident') === -1; +} +/** + * Returns false if using go(n) with hash history causes a full page reload. + */ + +function supportsGoWithoutReloadUsingHash() { + return window.navigator.userAgent.indexOf('Firefox') === -1; +} +/** + * Returns true if a given popstate event is an extraneous WebKit event. + * Accounts for the fact that Chrome on iOS fires real popstate events + * containing undefined state when pressing the back button. + */ + +function isExtraneousPopstateEvent(event) { + event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; +} + +var PopStateEvent = 'popstate'; +var HashChangeEvent = 'hashchange'; + +function getHistoryState() { + try { + return window.history.state || {}; + } catch (e) { + // IE 11 sometimes throws when accessing window.history.state + // See https://github.com/ReactTraining/history/pull/289 + return {}; + } +} +/** + * Creates a history object that uses the HTML5 history API including + * pushState, replaceState, and the popstate event. + */ + + +function createBrowserHistory(props) { + if (props === void 0) { + props = {}; + } + + !canUseDOM ? invariant(false, 'Browser history needs a DOM') : void 0; + var globalHistory = window.history; + var canUseHistory = supportsHistory(); + var needsHashChangeListener = !supportsPopStateOnHashChange(); + var _props = props, + _props$forceRefresh = _props.forceRefresh, + forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, + _props$getUserConfirm = _props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, + _props$keyLength = _props.keyLength, + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; + + function getDOMLocation(historyState) { + var _ref = historyState || {}, + key = _ref.key, + state = _ref.state; + + var _window$location = window.location, + pathname = _window$location.pathname, + search = _window$location.search, + hash = _window$location.hash; + var path = pathname + search + hash; + warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); + if (basename) path = stripBasename(path, basename); + return createLocation(path, state, key); + } + + function createKey() { + return Math.random().toString(36).substr(2, keyLength); + } + + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = globalHistory.length; + transitionManager.notifyListeners(history.location, history.action); + } + + function handlePopState(event) { + // Ignore extraneous popstate events in WebKit. + if (isExtraneousPopstateEvent(event)) return; + handlePop(getDOMLocation(event.state)); + } + + function handleHashChange() { + handlePop(getDOMLocation(getHistoryState())); + } + + var forceNextPop = false; + + function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location + }); + } else { + revertPop(location); + } + }); + } + } + + function revertPop(fromLocation) { + var toLocation = history.location; // TODO: We could probably make this more reliable by + // keeping a list of keys we've seen in sessionStorage. + // Instead, we just default to 0 for keys we don't know. + + var toIndex = allKeys.indexOf(toLocation.key); + if (toIndex === -1) toIndex = 0; + var fromIndex = allKeys.indexOf(fromLocation.key); + if (fromIndex === -1) fromIndex = 0; + var delta = toIndex - fromIndex; + + if (delta) { + forceNextPop = true; + go(delta); + } + } + + var initialLocation = getDOMLocation(getHistoryState()); + var allKeys = [initialLocation.key]; // Public interface + + function createHref(location) { + return basename + createPath(location); + } + + function push(path, state) { + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'PUSH'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var href = createHref(location); + var key = location.key, + state = location.state; + + if (canUseHistory) { + globalHistory.pushState({ + key: key, + state: state + }, null, href); + + if (forceRefresh) { + window.location.href = href; + } else { + var prevIndex = allKeys.indexOf(history.location.key); + var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + nextKeys.push(location.key); + allKeys = nextKeys; + setState({ + action: action, + location: location + }); + } + } else { + warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history'); + window.location.href = href; + } + }); + } + + function replace(path, state) { + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'REPLACE'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var href = createHref(location); + var key = location.key, + state = location.state; + + if (canUseHistory) { + globalHistory.replaceState({ + key: key, + state: state + }, null, href); + + if (forceRefresh) { + window.location.replace(href); + } else { + var prevIndex = allKeys.indexOf(history.location.key); + if (prevIndex !== -1) allKeys[prevIndex] = location.key; + setState({ + action: action, + location: location + }); + } + } else { + warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history'); + window.location.replace(href); + } + }); + } + + function go(n) { + globalHistory.go(n); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + var listenerCount = 0; + + function checkDOMListeners(delta) { + listenerCount += delta; + + if (listenerCount === 1 && delta === 1) { + window.addEventListener(PopStateEvent, handlePopState); + if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange); + } else if (listenerCount === 0) { + window.removeEventListener(PopStateEvent, handlePopState); + if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange); + } + } + + var isBlocked = false; + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + var unblock = transitionManager.setPrompt(prompt); + + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } + + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } + + return unblock(); + }; + } + + function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); + return function () { + checkDOMListeners(-1); + unlisten(); + }; + } + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; + return history; +} + +var HashChangeEvent$1 = 'hashchange'; +var HashPathCoders = { + hashbang: { + encodePath: function encodePath(path) { + return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path); + }, + decodePath: function decodePath(path) { + return path.charAt(0) === '!' ? path.substr(1) : path; + } + }, + noslash: { + encodePath: stripLeadingSlash, + decodePath: addLeadingSlash + }, + slash: { + encodePath: addLeadingSlash, + decodePath: addLeadingSlash + } +}; + +function getHashPath() { + // We can't use window.location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + var href = window.location.href; + var hashIndex = href.indexOf('#'); + return hashIndex === -1 ? '' : href.substring(hashIndex + 1); +} + +function pushHashPath(path) { + window.location.hash = path; +} + +function replaceHashPath(path) { + var hashIndex = window.location.href.indexOf('#'); + window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path); +} + +function createHashHistory(props) { + if (props === void 0) { + props = {}; + } + + !canUseDOM ? invariant(false, 'Hash history needs a DOM') : void 0; + var globalHistory = window.history; + var canGoWithoutReload = supportsGoWithoutReloadUsingHash(); + var _props = props, + _props$getUserConfirm = _props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, + _props$hashType = _props.hashType, + hashType = _props$hashType === void 0 ? 'slash' : _props$hashType; + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; + var _HashPathCoders$hashT = HashPathCoders[hashType], + encodePath = _HashPathCoders$hashT.encodePath, + decodePath = _HashPathCoders$hashT.decodePath; + + function getDOMLocation() { + var path = decodePath(getHashPath()); + warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); + if (basename) path = stripBasename(path, basename); + return createLocation(path); + } + + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = globalHistory.length; + transitionManager.notifyListeners(history.location, history.action); + } + + var forceNextPop = false; + var ignorePath = null; + + function handleHashChange() { + var path = getHashPath(); + var encodedPath = encodePath(path); + + if (path !== encodedPath) { + // Ensure we always have a properly-encoded hash. + replaceHashPath(encodedPath); + } else { + var location = getDOMLocation(); + var prevLocation = history.location; + if (!forceNextPop && locationsAreEqual(prevLocation, location)) return; // A hashchange doesn't always == location change. + + if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace. + + ignorePath = null; + handlePop(location); + } + } + + function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location + }); + } else { + revertPop(location); + } + }); + } + } + + function revertPop(fromLocation) { + var toLocation = history.location; // TODO: We could probably make this more reliable by + // keeping a list of paths we've seen in sessionStorage. + // Instead, we just default to 0 for paths we don't know. + + var toIndex = allPaths.lastIndexOf(createPath(toLocation)); + if (toIndex === -1) toIndex = 0; + var fromIndex = allPaths.lastIndexOf(createPath(fromLocation)); + if (fromIndex === -1) fromIndex = 0; + var delta = toIndex - fromIndex; + + if (delta) { + forceNextPop = true; + go(delta); + } + } // Ensure the hash is encoded properly before doing anything else. + + + var path = getHashPath(); + var encodedPath = encodePath(path); + if (path !== encodedPath) replaceHashPath(encodedPath); + var initialLocation = getDOMLocation(); + var allPaths = [createPath(initialLocation)]; // Public interface + + function createHref(location) { + return '#' + encodePath(basename + createPath(location)); + } + + function push(path, state) { + warning(state === undefined, 'Hash history cannot push state; it is ignored'); + var action = 'PUSH'; + var location = createLocation(path, undefined, undefined, history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var path = createPath(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath() !== encodedPath; + + if (hashChanged) { + // We cannot tell if a hashchange was caused by a PUSH, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + pushHashPath(encodedPath); + var prevIndex = allPaths.lastIndexOf(createPath(history.location)); + var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + nextPaths.push(path); + allPaths = nextPaths; + setState({ + action: action, + location: location + }); + } else { + warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack'); + setState(); + } + }); + } + + function replace(path, state) { + warning(state === undefined, 'Hash history cannot replace state; it is ignored'); + var action = 'REPLACE'; + var location = createLocation(path, undefined, undefined, history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var path = createPath(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath() !== encodedPath; + + if (hashChanged) { + // We cannot tell if a hashchange was caused by a REPLACE, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + replaceHashPath(encodedPath); + } + + var prevIndex = allPaths.indexOf(createPath(history.location)); + if (prevIndex !== -1) allPaths[prevIndex] = path; + setState({ + action: action, + location: location + }); + }); + } + + function go(n) { + warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser'); + globalHistory.go(n); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + var listenerCount = 0; + + function checkDOMListeners(delta) { + listenerCount += delta; + + if (listenerCount === 1 && delta === 1) { + window.addEventListener(HashChangeEvent$1, handleHashChange); + } else if (listenerCount === 0) { + window.removeEventListener(HashChangeEvent$1, handleHashChange); + } + } + + var isBlocked = false; + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + var unblock = transitionManager.setPrompt(prompt); + + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } + + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } + + return unblock(); + }; + } + + function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); + return function () { + checkDOMListeners(-1); + unlisten(); + }; + } + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; + return history; +} + +function clamp(n, lowerBound, upperBound) { + return Math.min(Math.max(n, lowerBound), upperBound); +} +/** + * Creates a history object that stores locations in memory. + */ + + +function createMemoryHistory(props) { + if (props === void 0) { + props = {}; + } + + var _props = props, + getUserConfirmation = _props.getUserConfirmation, + _props$initialEntries = _props.initialEntries, + initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries, + _props$initialIndex = _props.initialIndex, + initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex, + _props$keyLength = _props.keyLength, + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = history.entries.length; + transitionManager.notifyListeners(history.location, history.action); + } + + function createKey() { + return Math.random().toString(36).substr(2, keyLength); + } + + var index = clamp(initialIndex, 0, initialEntries.length - 1); + var entries = initialEntries.map(function (entry) { + return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey()); + }); // Public interface + + var createHref = createPath; + + function push(path, state) { + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'PUSH'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var prevIndex = history.index; + var nextIndex = prevIndex + 1; + var nextEntries = history.entries.slice(0); + + if (nextEntries.length > nextIndex) { + nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); + } else { + nextEntries.push(location); + } + + setState({ + action: action, + location: location, + index: nextIndex, + entries: nextEntries + }); + }); + } + + function replace(path, state) { + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'REPLACE'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + history.entries[history.index] = location; + setState({ + action: action, + location: location + }); + }); + } + + function go(n) { + var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); + var action = 'POP'; + var location = history.entries[nextIndex]; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location, + index: nextIndex + }); + } else { + // Mimic the behavior of DOM histories by + // causing a render after a cancelled POP. + setState(); + } + }); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + function canGo(n) { + var nextIndex = history.index + n; + return nextIndex >= 0 && nextIndex < history.entries.length; + } + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + return transitionManager.setPrompt(prompt); + } + + function listen(listener) { + return transitionManager.appendListener(listener); + } + + var history = { + length: entries.length, + action: 'POP', + location: entries[index], + index: index, + entries: entries, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + canGo: canGo, + block: block, + listen: listen + }; + return history; +} + +exports.createBrowserHistory = createBrowserHistory; +exports.createHashHistory = createHashHistory; +exports.createMemoryHistory = createMemoryHistory; +exports.createLocation = createLocation; +exports.locationsAreEqual = locationsAreEqual; +exports.parsePath = parsePath; +exports.createPath = createPath; diff --git a/node_modules/history/cjs/history.min.js b/node_modules/history/cjs/history.min.js new file mode 100644 index 00000000..50d9e0dd --- /dev/null +++ b/node_modules/history/cjs/history.min.js @@ -0,0 +1 @@ +"use strict";function _interopDefault(n){return n&&"object"==typeof n&&"default"in n?n.default:n}Object.defineProperty(exports,"__esModule",{value:!0});var resolvePathname=_interopDefault(require("resolve-pathname")),valueEqual=_interopDefault(require("value-equal"));require("tiny-warning");var invariant=_interopDefault(require("tiny-invariant"));function _extends(){return(_extends=Object.assign||function(n){for(var t=1;tt?e.splice(t,e.length-t,a):e.push(a),u({action:"PUSH",location:a,index:t,entries:e})}})},replace:function(n,t){var e="REPLACE",a=createLocation(n,t,f(),g.location);h.confirmTransitionTo(a,e,o,function(n){n&&(g.entries[g.index]=a,u({action:e,location:a}))})},go:p,goBack:function(){p(-1)},goForward:function(){p(1)},canGo:function(n){var t=g.index+n;return 0<=t&&t 0 + ? format.replace(/%s/g, function() { + return subs[index++]; + }) + : format); + + if (typeof console !== 'undefined') { + console.error(message); + } + + try { + // --- Welcome to debugging history --- + // This error was thrown as a convenience so that you can use the + // stack trace to find the callsite that triggered this warning. + throw new Error(message); + } catch (e) {} + }; +} + +export default function(member) { + printWarning( + 'Please use `import { %s } from "history"` instead of `import %s from "history/es/%s"`. ' + + 'Support for the latter will be removed in the next major release.', + [member, member] + ); +} diff --git a/node_modules/history/esm/history.js b/node_modules/history/esm/history.js new file mode 100644 index 00000000..fc4a0e83 --- /dev/null +++ b/node_modules/history/esm/history.js @@ -0,0 +1,904 @@ +import _extends from '@babel/runtime/helpers/esm/extends'; +import resolvePathname from 'resolve-pathname'; +import valueEqual from 'value-equal'; +import warning from 'tiny-warning'; +import invariant from 'tiny-invariant'; + +function addLeadingSlash(path) { + return path.charAt(0) === '/' ? path : '/' + path; +} +function stripLeadingSlash(path) { + return path.charAt(0) === '/' ? path.substr(1) : path; +} +function hasBasename(path, prefix) { + return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path); +} +function stripBasename(path, prefix) { + return hasBasename(path, prefix) ? path.substr(prefix.length) : path; +} +function stripTrailingSlash(path) { + return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path; +} +function parsePath(path) { + var pathname = path || '/'; + var search = ''; + var hash = ''; + var hashIndex = pathname.indexOf('#'); + + if (hashIndex !== -1) { + hash = pathname.substr(hashIndex); + pathname = pathname.substr(0, hashIndex); + } + + var searchIndex = pathname.indexOf('?'); + + if (searchIndex !== -1) { + search = pathname.substr(searchIndex); + pathname = pathname.substr(0, searchIndex); + } + + return { + pathname: pathname, + search: search === '?' ? '' : search, + hash: hash === '#' ? '' : hash + }; +} +function createPath(location) { + var pathname = location.pathname, + search = location.search, + hash = location.hash; + var path = pathname || '/'; + if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search; + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash; + return path; +} + +function createLocation(path, state, key, currentLocation) { + var location; + + if (typeof path === 'string') { + // Two-arg form: push(path, state) + location = parsePath(path); + location.state = state; + } else { + // One-arg form: push(location) + location = _extends({}, path); + if (location.pathname === undefined) location.pathname = ''; + + if (location.search) { + if (location.search.charAt(0) !== '?') location.search = '?' + location.search; + } else { + location.search = ''; + } + + if (location.hash) { + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; + } else { + location.hash = ''; + } + + if (state !== undefined && location.state === undefined) location.state = state; + } + + try { + location.pathname = decodeURI(location.pathname); + } catch (e) { + if (e instanceof URIError) { + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); + } else { + throw e; + } + } + + if (key) location.key = key; + + if (currentLocation) { + // Resolve incomplete/relative pathname relative to current location. + if (!location.pathname) { + location.pathname = currentLocation.pathname; + } else if (location.pathname.charAt(0) !== '/') { + location.pathname = resolvePathname(location.pathname, currentLocation.pathname); + } + } else { + // When there is no prior location and pathname is empty, set it to / + if (!location.pathname) { + location.pathname = '/'; + } + } + + return location; +} +function locationsAreEqual(a, b) { + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state); +} + +function createTransitionManager() { + var prompt = null; + + function setPrompt(nextPrompt) { + process.env.NODE_ENV !== "production" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0; + prompt = nextPrompt; + return function () { + if (prompt === nextPrompt) prompt = null; + }; + } + + function confirmTransitionTo(location, action, getUserConfirmation, callback) { + // TODO: If another transition starts while we're still confirming + // the previous one, we may end up in a weird state. Figure out the + // best way to handle this. + if (prompt != null) { + var result = typeof prompt === 'function' ? prompt(location, action) : prompt; + + if (typeof result === 'string') { + if (typeof getUserConfirmation === 'function') { + getUserConfirmation(result, callback); + } else { + process.env.NODE_ENV !== "production" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0; + callback(true); + } + } else { + // Return false from a transition hook to cancel the transition. + callback(result !== false); + } + } else { + callback(true); + } + } + + var listeners = []; + + function appendListener(fn) { + var isActive = true; + + function listener() { + if (isActive) fn.apply(void 0, arguments); + } + + listeners.push(listener); + return function () { + isActive = false; + listeners = listeners.filter(function (item) { + return item !== listener; + }); + }; + } + + function notifyListeners() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + listeners.forEach(function (listener) { + return listener.apply(void 0, args); + }); + } + + return { + setPrompt: setPrompt, + confirmTransitionTo: confirmTransitionTo, + appendListener: appendListener, + notifyListeners: notifyListeners + }; +} + +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); +function getConfirmation(message, callback) { + callback(window.confirm(message)); // eslint-disable-line no-alert +} +/** + * Returns true if the HTML5 history API is supported. Taken from Modernizr. + * + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586 + */ + +function supportsHistory() { + var ua = window.navigator.userAgent; + if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; + return window.history && 'pushState' in window.history; +} +/** + * Returns true if browser fires popstate on hash change. + * IE10 and IE11 do not. + */ + +function supportsPopStateOnHashChange() { + return window.navigator.userAgent.indexOf('Trident') === -1; +} +/** + * Returns false if using go(n) with hash history causes a full page reload. + */ + +function supportsGoWithoutReloadUsingHash() { + return window.navigator.userAgent.indexOf('Firefox') === -1; +} +/** + * Returns true if a given popstate event is an extraneous WebKit event. + * Accounts for the fact that Chrome on iOS fires real popstate events + * containing undefined state when pressing the back button. + */ + +function isExtraneousPopstateEvent(event) { + event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; +} + +var PopStateEvent = 'popstate'; +var HashChangeEvent = 'hashchange'; + +function getHistoryState() { + try { + return window.history.state || {}; + } catch (e) { + // IE 11 sometimes throws when accessing window.history.state + // See https://github.com/ReactTraining/history/pull/289 + return {}; + } +} +/** + * Creates a history object that uses the HTML5 history API including + * pushState, replaceState, and the popstate event. + */ + + +function createBrowserHistory(props) { + if (props === void 0) { + props = {}; + } + + !canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0; + var globalHistory = window.history; + var canUseHistory = supportsHistory(); + var needsHashChangeListener = !supportsPopStateOnHashChange(); + var _props = props, + _props$forceRefresh = _props.forceRefresh, + forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, + _props$getUserConfirm = _props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, + _props$keyLength = _props.keyLength, + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; + + function getDOMLocation(historyState) { + var _ref = historyState || {}, + key = _ref.key, + state = _ref.state; + + var _window$location = window.location, + pathname = _window$location.pathname, + search = _window$location.search, + hash = _window$location.hash; + var path = pathname + search + hash; + process.env.NODE_ENV !== "production" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0; + if (basename) path = stripBasename(path, basename); + return createLocation(path, state, key); + } + + function createKey() { + return Math.random().toString(36).substr(2, keyLength); + } + + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = globalHistory.length; + transitionManager.notifyListeners(history.location, history.action); + } + + function handlePopState(event) { + // Ignore extraneous popstate events in WebKit. + if (isExtraneousPopstateEvent(event)) return; + handlePop(getDOMLocation(event.state)); + } + + function handleHashChange() { + handlePop(getDOMLocation(getHistoryState())); + } + + var forceNextPop = false; + + function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location + }); + } else { + revertPop(location); + } + }); + } + } + + function revertPop(fromLocation) { + var toLocation = history.location; // TODO: We could probably make this more reliable by + // keeping a list of keys we've seen in sessionStorage. + // Instead, we just default to 0 for keys we don't know. + + var toIndex = allKeys.indexOf(toLocation.key); + if (toIndex === -1) toIndex = 0; + var fromIndex = allKeys.indexOf(fromLocation.key); + if (fromIndex === -1) fromIndex = 0; + var delta = toIndex - fromIndex; + + if (delta) { + forceNextPop = true; + go(delta); + } + } + + var initialLocation = getDOMLocation(getHistoryState()); + var allKeys = [initialLocation.key]; // Public interface + + function createHref(location) { + return basename + createPath(location); + } + + function push(path, state) { + process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0; + var action = 'PUSH'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var href = createHref(location); + var key = location.key, + state = location.state; + + if (canUseHistory) { + globalHistory.pushState({ + key: key, + state: state + }, null, href); + + if (forceRefresh) { + window.location.href = href; + } else { + var prevIndex = allKeys.indexOf(history.location.key); + var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + nextKeys.push(location.key); + allKeys = nextKeys; + setState({ + action: action, + location: location + }); + } + } else { + process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0; + window.location.href = href; + } + }); + } + + function replace(path, state) { + process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0; + var action = 'REPLACE'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var href = createHref(location); + var key = location.key, + state = location.state; + + if (canUseHistory) { + globalHistory.replaceState({ + key: key, + state: state + }, null, href); + + if (forceRefresh) { + window.location.replace(href); + } else { + var prevIndex = allKeys.indexOf(history.location.key); + if (prevIndex !== -1) allKeys[prevIndex] = location.key; + setState({ + action: action, + location: location + }); + } + } else { + process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0; + window.location.replace(href); + } + }); + } + + function go(n) { + globalHistory.go(n); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + var listenerCount = 0; + + function checkDOMListeners(delta) { + listenerCount += delta; + + if (listenerCount === 1 && delta === 1) { + window.addEventListener(PopStateEvent, handlePopState); + if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange); + } else if (listenerCount === 0) { + window.removeEventListener(PopStateEvent, handlePopState); + if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange); + } + } + + var isBlocked = false; + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + var unblock = transitionManager.setPrompt(prompt); + + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } + + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } + + return unblock(); + }; + } + + function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); + return function () { + checkDOMListeners(-1); + unlisten(); + }; + } + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; + return history; +} + +var HashChangeEvent$1 = 'hashchange'; +var HashPathCoders = { + hashbang: { + encodePath: function encodePath(path) { + return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path); + }, + decodePath: function decodePath(path) { + return path.charAt(0) === '!' ? path.substr(1) : path; + } + }, + noslash: { + encodePath: stripLeadingSlash, + decodePath: addLeadingSlash + }, + slash: { + encodePath: addLeadingSlash, + decodePath: addLeadingSlash + } +}; + +function getHashPath() { + // We can't use window.location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + var href = window.location.href; + var hashIndex = href.indexOf('#'); + return hashIndex === -1 ? '' : href.substring(hashIndex + 1); +} + +function pushHashPath(path) { + window.location.hash = path; +} + +function replaceHashPath(path) { + var hashIndex = window.location.href.indexOf('#'); + window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path); +} + +function createHashHistory(props) { + if (props === void 0) { + props = {}; + } + + !canUseDOM ? process.env.NODE_ENV !== "production" ? invariant(false, 'Hash history needs a DOM') : invariant(false) : void 0; + var globalHistory = window.history; + var canGoWithoutReload = supportsGoWithoutReloadUsingHash(); + var _props = props, + _props$getUserConfirm = _props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, + _props$hashType = _props.hashType, + hashType = _props$hashType === void 0 ? 'slash' : _props$hashType; + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; + var _HashPathCoders$hashT = HashPathCoders[hashType], + encodePath = _HashPathCoders$hashT.encodePath, + decodePath = _HashPathCoders$hashT.decodePath; + + function getDOMLocation() { + var path = decodePath(getHashPath()); + process.env.NODE_ENV !== "production" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0; + if (basename) path = stripBasename(path, basename); + return createLocation(path); + } + + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = globalHistory.length; + transitionManager.notifyListeners(history.location, history.action); + } + + var forceNextPop = false; + var ignorePath = null; + + function handleHashChange() { + var path = getHashPath(); + var encodedPath = encodePath(path); + + if (path !== encodedPath) { + // Ensure we always have a properly-encoded hash. + replaceHashPath(encodedPath); + } else { + var location = getDOMLocation(); + var prevLocation = history.location; + if (!forceNextPop && locationsAreEqual(prevLocation, location)) return; // A hashchange doesn't always == location change. + + if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace. + + ignorePath = null; + handlePop(location); + } + } + + function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location + }); + } else { + revertPop(location); + } + }); + } + } + + function revertPop(fromLocation) { + var toLocation = history.location; // TODO: We could probably make this more reliable by + // keeping a list of paths we've seen in sessionStorage. + // Instead, we just default to 0 for paths we don't know. + + var toIndex = allPaths.lastIndexOf(createPath(toLocation)); + if (toIndex === -1) toIndex = 0; + var fromIndex = allPaths.lastIndexOf(createPath(fromLocation)); + if (fromIndex === -1) fromIndex = 0; + var delta = toIndex - fromIndex; + + if (delta) { + forceNextPop = true; + go(delta); + } + } // Ensure the hash is encoded properly before doing anything else. + + + var path = getHashPath(); + var encodedPath = encodePath(path); + if (path !== encodedPath) replaceHashPath(encodedPath); + var initialLocation = getDOMLocation(); + var allPaths = [createPath(initialLocation)]; // Public interface + + function createHref(location) { + return '#' + encodePath(basename + createPath(location)); + } + + function push(path, state) { + process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Hash history cannot push state; it is ignored') : void 0; + var action = 'PUSH'; + var location = createLocation(path, undefined, undefined, history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var path = createPath(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath() !== encodedPath; + + if (hashChanged) { + // We cannot tell if a hashchange was caused by a PUSH, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + pushHashPath(encodedPath); + var prevIndex = allPaths.lastIndexOf(createPath(history.location)); + var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + nextPaths.push(path); + allPaths = nextPaths; + setState({ + action: action, + location: location + }); + } else { + process.env.NODE_ENV !== "production" ? warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0; + setState(); + } + }); + } + + function replace(path, state) { + process.env.NODE_ENV !== "production" ? warning(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0; + var action = 'REPLACE'; + var location = createLocation(path, undefined, undefined, history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var path = createPath(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath() !== encodedPath; + + if (hashChanged) { + // We cannot tell if a hashchange was caused by a REPLACE, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + replaceHashPath(encodedPath); + } + + var prevIndex = allPaths.indexOf(createPath(history.location)); + if (prevIndex !== -1) allPaths[prevIndex] = path; + setState({ + action: action, + location: location + }); + }); + } + + function go(n) { + process.env.NODE_ENV !== "production" ? warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0; + globalHistory.go(n); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + var listenerCount = 0; + + function checkDOMListeners(delta) { + listenerCount += delta; + + if (listenerCount === 1 && delta === 1) { + window.addEventListener(HashChangeEvent$1, handleHashChange); + } else if (listenerCount === 0) { + window.removeEventListener(HashChangeEvent$1, handleHashChange); + } + } + + var isBlocked = false; + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + var unblock = transitionManager.setPrompt(prompt); + + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } + + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } + + return unblock(); + }; + } + + function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); + return function () { + checkDOMListeners(-1); + unlisten(); + }; + } + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; + return history; +} + +function clamp(n, lowerBound, upperBound) { + return Math.min(Math.max(n, lowerBound), upperBound); +} +/** + * Creates a history object that stores locations in memory. + */ + + +function createMemoryHistory(props) { + if (props === void 0) { + props = {}; + } + + var _props = props, + getUserConfirmation = _props.getUserConfirmation, + _props$initialEntries = _props.initialEntries, + initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries, + _props$initialIndex = _props.initialIndex, + initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex, + _props$keyLength = _props.keyLength, + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = history.entries.length; + transitionManager.notifyListeners(history.location, history.action); + } + + function createKey() { + return Math.random().toString(36).substr(2, keyLength); + } + + var index = clamp(initialIndex, 0, initialEntries.length - 1); + var entries = initialEntries.map(function (entry) { + return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey()); + }); // Public interface + + var createHref = createPath; + + function push(path, state) { + process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0; + var action = 'PUSH'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var prevIndex = history.index; + var nextIndex = prevIndex + 1; + var nextEntries = history.entries.slice(0); + + if (nextEntries.length > nextIndex) { + nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); + } else { + nextEntries.push(location); + } + + setState({ + action: action, + location: location, + index: nextIndex, + entries: nextEntries + }); + }); + } + + function replace(path, state) { + process.env.NODE_ENV !== "production" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0; + var action = 'REPLACE'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + history.entries[history.index] = location; + setState({ + action: action, + location: location + }); + }); + } + + function go(n) { + var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); + var action = 'POP'; + var location = history.entries[nextIndex]; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location, + index: nextIndex + }); + } else { + // Mimic the behavior of DOM histories by + // causing a render after a cancelled POP. + setState(); + } + }); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + function canGo(n) { + var nextIndex = history.index + n; + return nextIndex >= 0 && nextIndex < history.entries.length; + } + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + return transitionManager.setPrompt(prompt); + } + + function listen(listener) { + return transitionManager.appendListener(listener); + } + + var history = { + length: entries.length, + action: 'POP', + location: entries[index], + index: index, + entries: entries, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + canGo: canGo, + block: block, + listen: listen + }; + return history; +} + +export { createBrowserHistory, createHashHistory, createMemoryHistory, createLocation, locationsAreEqual, parsePath, createPath }; diff --git a/node_modules/history/index.js b/node_modules/history/index.js new file mode 100644 index 00000000..1e506e52 --- /dev/null +++ b/node_modules/history/index.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/history.min.js'); +} else { + module.exports = require('./cjs/history.js'); +} diff --git a/node_modules/history/package.json b/node_modules/history/package.json new file mode 100644 index 00000000..8d9e1567 --- /dev/null +++ b/node_modules/history/package.json @@ -0,0 +1,117 @@ +{ + "_from": "history@^4.9.0", + "_id": "history@4.9.0", + "_inBundle": false, + "_integrity": "sha512-H2DkjCjXf0Op9OAr6nJ56fcRkTSNrUiv41vNJ6IswJjif6wlpZK0BTfFbi7qK9dXLSYZxkq5lBsj3vUjlYBYZA==", + "_location": "/history", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "history@^4.9.0", + "name": "history", + "escapedName": "history", + "rawSpec": "^4.9.0", + "saveSpec": null, + "fetchSpec": "^4.9.0" + }, + "_requiredBy": [ + "/react-router", + "/react-router-dom" + ], + "_resolved": "https://registry.npmjs.org/history/-/history-4.9.0.tgz", + "_shasum": "84587c2068039ead8af769e9d6a6860a14fa1bca", + "_spec": "history@^4.9.0", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/react-router-dom", + "author": { + "name": "Michael Jackson" + }, + "browserify": { + "transform": [ + "loose-envify" + ] + }, + "bugs": { + "url": "https://github.com/ReactTraining/history/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^2.2.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^0.4.0" + }, + "deprecated": false, + "description": "Manage session history with JavaScript", + "devDependencies": { + "@babel/core": "^7.1.2", + "@babel/plugin-transform-object-assign": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.1.0", + "@babel/preset-env": "^7.1.0", + "babel-core": "^7.0.0-bridge.0", + "babel-eslint": "^7.0.0", + "babel-loader": "^8.0.4", + "babel-plugin-dev-expression": "^0.2.1", + "eslint": "^3.3.0", + "eslint-plugin-import": "^2.0.0", + "expect": "^21.0.0", + "jest-mock": "^21.0.0", + "karma": "^3.1.3", + "karma-browserstack-launcher": "^1.3.0", + "karma-chrome-launcher": "^2.2.0", + "karma-firefox-launcher": "^1.1.0", + "karma-mocha": "^1.3.0", + "karma-mocha-reporter": "^2.2.5", + "karma-sourcemap-loader": "^0.3.7", + "karma-webpack": "^3.0.5", + "mocha": "^5.2.0", + "rollup": "^0.66.6", + "rollup-plugin-babel": "^4.0.3", + "rollup-plugin-commonjs": "^9.2.0", + "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-replace": "^2.1.0", + "rollup-plugin-size-snapshot": "^0.7.0", + "rollup-plugin-uglify": "^6.0.0", + "webpack": "^3.12.0" + }, + "files": [ + "DOMUtils.js", + "ExecutionEnvironment.js", + "LocationUtils.js", + "PathUtils.js", + "cjs", + "createBrowserHistory.js", + "createHashHistory.js", + "createMemoryHistory.js", + "createTransitionManager.js", + "es", + "esm", + "umd", + "warnAboutDeprecatedCJSRequire.js" + ], + "homepage": "https://github.com/ReactTraining/history#readme", + "keywords": [ + "history", + "location" + ], + "license": "MIT", + "main": "index.js", + "module": "esm/history.js", + "name": "history", + "repository": { + "type": "git", + "url": "git+https://github.com/ReactTraining/history.git" + }, + "scripts": { + "build": "rollup -c", + "clean": "git clean -fdX .", + "lint": "eslint modules", + "prepublishOnly": "npm run build", + "test": "karma start --single-run" + }, + "sideEffects": false, + "unpkg": "umd/history.js", + "version": "4.9.0" +} diff --git a/node_modules/history/umd/history.js b/node_modules/history/umd/history.js new file mode 100644 index 00000000..8dab20e4 --- /dev/null +++ b/node_modules/history/umd/history.js @@ -0,0 +1,1059 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.History = {}))); +}(this, (function (exports) { 'use strict'; + + function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); + } + + function warning(condition, message) { + { + if (condition) { + return; + } + + console.warn(message); + } + } + + var prefix = 'Invariant failed'; + function invariant(condition, message) { + if (condition) { + return; + } + + { + throw new Error(prefix + ": " + (message || '')); + } + } + + function isAbsolute(pathname) { + return pathname.charAt(0) === '/'; + } + + // 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(); + } + + // This implementation is based heavily on node's url.parse + function resolvePathname(to) { + var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + + var toParts = to && to.split('/') || []; + var fromParts = from && from.split('/') || []; + + var isToAbs = to && isAbsolute(to); + var isFromAbs = from && isAbsolute(from); + var mustEndAbs = isToAbs || isFromAbs; + + if (to && isAbsolute(to)) { + // to is absolute + fromParts = toParts; + } else if (toParts.length) { + // to is relative, drop the filename + fromParts.pop(); + fromParts = fromParts.concat(toParts); + } + + if (!fromParts.length) return '/'; + + var hasTrailingSlash = void 0; + if (fromParts.length) { + var last = fromParts[fromParts.length - 1]; + hasTrailingSlash = last === '.' || last === '..' || last === ''; + } else { + hasTrailingSlash = false; + } + + var up = 0; + for (var i = fromParts.length; i >= 0; i--) { + var part = fromParts[i]; + + if (part === '.') { + spliceOne(fromParts, i); + } else if (part === '..') { + spliceOne(fromParts, i); + up++; + } else if (up) { + spliceOne(fromParts, i); + up--; + } + } + + if (!mustEndAbs) for (; up--; up) { + fromParts.unshift('..'); + }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(''); + + var result = fromParts.join('/'); + + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; + + return result; + } + + 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 valueEqual(a, b) { + if (a === b) return true; + + if (a == null || b == null) return false; + + if (Array.isArray(a)) { + return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return valueEqual(item, b[index]); + }); + } + + var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); + var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); + + if (aType !== bType) return false; + + if (aType === 'object') { + var aValue = a.valueOf(); + var bValue = b.valueOf(); + + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); + + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + + if (aKeys.length !== bKeys.length) return false; + + return aKeys.every(function (key) { + return valueEqual(a[key], b[key]); + }); + } + + return false; + } + + function addLeadingSlash(path) { + return path.charAt(0) === '/' ? path : '/' + path; + } + function stripLeadingSlash(path) { + return path.charAt(0) === '/' ? path.substr(1) : path; + } + function hasBasename(path, prefix) { + return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path); + } + function stripBasename(path, prefix) { + return hasBasename(path, prefix) ? path.substr(prefix.length) : path; + } + function stripTrailingSlash(path) { + return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path; + } + function parsePath(path) { + var pathname = path || '/'; + var search = ''; + var hash = ''; + var hashIndex = pathname.indexOf('#'); + + if (hashIndex !== -1) { + hash = pathname.substr(hashIndex); + pathname = pathname.substr(0, hashIndex); + } + + var searchIndex = pathname.indexOf('?'); + + if (searchIndex !== -1) { + search = pathname.substr(searchIndex); + pathname = pathname.substr(0, searchIndex); + } + + return { + pathname: pathname, + search: search === '?' ? '' : search, + hash: hash === '#' ? '' : hash + }; + } + function createPath(location) { + var pathname = location.pathname, + search = location.search, + hash = location.hash; + var path = pathname || '/'; + if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search; + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash; + return path; + } + + function createLocation(path, state, key, currentLocation) { + var location; + + if (typeof path === 'string') { + // Two-arg form: push(path, state) + location = parsePath(path); + location.state = state; + } else { + // One-arg form: push(location) + location = _extends({}, path); + if (location.pathname === undefined) location.pathname = ''; + + if (location.search) { + if (location.search.charAt(0) !== '?') location.search = '?' + location.search; + } else { + location.search = ''; + } + + if (location.hash) { + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; + } else { + location.hash = ''; + } + + if (state !== undefined && location.state === undefined) location.state = state; + } + + try { + location.pathname = decodeURI(location.pathname); + } catch (e) { + if (e instanceof URIError) { + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); + } else { + throw e; + } + } + + if (key) location.key = key; + + if (currentLocation) { + // Resolve incomplete/relative pathname relative to current location. + if (!location.pathname) { + location.pathname = currentLocation.pathname; + } else if (location.pathname.charAt(0) !== '/') { + location.pathname = resolvePathname(location.pathname, currentLocation.pathname); + } + } else { + // When there is no prior location and pathname is empty, set it to / + if (!location.pathname) { + location.pathname = '/'; + } + } + + return location; + } + function locationsAreEqual(a, b) { + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state); + } + + function createTransitionManager() { + var prompt = null; + + function setPrompt(nextPrompt) { + warning(prompt == null, 'A history supports only one prompt at a time'); + prompt = nextPrompt; + return function () { + if (prompt === nextPrompt) prompt = null; + }; + } + + function confirmTransitionTo(location, action, getUserConfirmation, callback) { + // TODO: If another transition starts while we're still confirming + // the previous one, we may end up in a weird state. Figure out the + // best way to handle this. + if (prompt != null) { + var result = typeof prompt === 'function' ? prompt(location, action) : prompt; + + if (typeof result === 'string') { + if (typeof getUserConfirmation === 'function') { + getUserConfirmation(result, callback); + } else { + warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message'); + callback(true); + } + } else { + // Return false from a transition hook to cancel the transition. + callback(result !== false); + } + } else { + callback(true); + } + } + + var listeners = []; + + function appendListener(fn) { + var isActive = true; + + function listener() { + if (isActive) fn.apply(void 0, arguments); + } + + listeners.push(listener); + return function () { + isActive = false; + listeners = listeners.filter(function (item) { + return item !== listener; + }); + }; + } + + function notifyListeners() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + listeners.forEach(function (listener) { + return listener.apply(void 0, args); + }); + } + + return { + setPrompt: setPrompt, + confirmTransitionTo: confirmTransitionTo, + appendListener: appendListener, + notifyListeners: notifyListeners + }; + } + + var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + function getConfirmation(message, callback) { + callback(window.confirm(message)); // eslint-disable-line no-alert + } + /** + * Returns true if the HTML5 history API is supported. Taken from Modernizr. + * + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586 + */ + + function supportsHistory() { + var ua = window.navigator.userAgent; + if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; + return window.history && 'pushState' in window.history; + } + /** + * Returns true if browser fires popstate on hash change. + * IE10 and IE11 do not. + */ + + function supportsPopStateOnHashChange() { + return window.navigator.userAgent.indexOf('Trident') === -1; + } + /** + * Returns false if using go(n) with hash history causes a full page reload. + */ + + function supportsGoWithoutReloadUsingHash() { + return window.navigator.userAgent.indexOf('Firefox') === -1; + } + /** + * Returns true if a given popstate event is an extraneous WebKit event. + * Accounts for the fact that Chrome on iOS fires real popstate events + * containing undefined state when pressing the back button. + */ + + function isExtraneousPopstateEvent(event) { + event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; + } + + var PopStateEvent = 'popstate'; + var HashChangeEvent = 'hashchange'; + + function getHistoryState() { + try { + return window.history.state || {}; + } catch (e) { + // IE 11 sometimes throws when accessing window.history.state + // See https://github.com/ReactTraining/history/pull/289 + return {}; + } + } + /** + * Creates a history object that uses the HTML5 history API including + * pushState, replaceState, and the popstate event. + */ + + + function createBrowserHistory(props) { + if (props === void 0) { + props = {}; + } + + !canUseDOM ? invariant(false, 'Browser history needs a DOM') : void 0; + var globalHistory = window.history; + var canUseHistory = supportsHistory(); + var needsHashChangeListener = !supportsPopStateOnHashChange(); + var _props = props, + _props$forceRefresh = _props.forceRefresh, + forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, + _props$getUserConfirm = _props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, + _props$keyLength = _props.keyLength, + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; + + function getDOMLocation(historyState) { + var _ref = historyState || {}, + key = _ref.key, + state = _ref.state; + + var _window$location = window.location, + pathname = _window$location.pathname, + search = _window$location.search, + hash = _window$location.hash; + var path = pathname + search + hash; + warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); + if (basename) path = stripBasename(path, basename); + return createLocation(path, state, key); + } + + function createKey() { + return Math.random().toString(36).substr(2, keyLength); + } + + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = globalHistory.length; + transitionManager.notifyListeners(history.location, history.action); + } + + function handlePopState(event) { + // Ignore extraneous popstate events in WebKit. + if (isExtraneousPopstateEvent(event)) return; + handlePop(getDOMLocation(event.state)); + } + + function handleHashChange() { + handlePop(getDOMLocation(getHistoryState())); + } + + var forceNextPop = false; + + function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location + }); + } else { + revertPop(location); + } + }); + } + } + + function revertPop(fromLocation) { + var toLocation = history.location; // TODO: We could probably make this more reliable by + // keeping a list of keys we've seen in sessionStorage. + // Instead, we just default to 0 for keys we don't know. + + var toIndex = allKeys.indexOf(toLocation.key); + if (toIndex === -1) toIndex = 0; + var fromIndex = allKeys.indexOf(fromLocation.key); + if (fromIndex === -1) fromIndex = 0; + var delta = toIndex - fromIndex; + + if (delta) { + forceNextPop = true; + go(delta); + } + } + + var initialLocation = getDOMLocation(getHistoryState()); + var allKeys = [initialLocation.key]; // Public interface + + function createHref(location) { + return basename + createPath(location); + } + + function push(path, state) { + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'PUSH'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var href = createHref(location); + var key = location.key, + state = location.state; + + if (canUseHistory) { + globalHistory.pushState({ + key: key, + state: state + }, null, href); + + if (forceRefresh) { + window.location.href = href; + } else { + var prevIndex = allKeys.indexOf(history.location.key); + var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + nextKeys.push(location.key); + allKeys = nextKeys; + setState({ + action: action, + location: location + }); + } + } else { + warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history'); + window.location.href = href; + } + }); + } + + function replace(path, state) { + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'REPLACE'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var href = createHref(location); + var key = location.key, + state = location.state; + + if (canUseHistory) { + globalHistory.replaceState({ + key: key, + state: state + }, null, href); + + if (forceRefresh) { + window.location.replace(href); + } else { + var prevIndex = allKeys.indexOf(history.location.key); + if (prevIndex !== -1) allKeys[prevIndex] = location.key; + setState({ + action: action, + location: location + }); + } + } else { + warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history'); + window.location.replace(href); + } + }); + } + + function go(n) { + globalHistory.go(n); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + var listenerCount = 0; + + function checkDOMListeners(delta) { + listenerCount += delta; + + if (listenerCount === 1 && delta === 1) { + window.addEventListener(PopStateEvent, handlePopState); + if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange); + } else if (listenerCount === 0) { + window.removeEventListener(PopStateEvent, handlePopState); + if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange); + } + } + + var isBlocked = false; + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + var unblock = transitionManager.setPrompt(prompt); + + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } + + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } + + return unblock(); + }; + } + + function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); + return function () { + checkDOMListeners(-1); + unlisten(); + }; + } + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; + return history; + } + + var HashChangeEvent$1 = 'hashchange'; + var HashPathCoders = { + hashbang: { + encodePath: function encodePath(path) { + return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path); + }, + decodePath: function decodePath(path) { + return path.charAt(0) === '!' ? path.substr(1) : path; + } + }, + noslash: { + encodePath: stripLeadingSlash, + decodePath: addLeadingSlash + }, + slash: { + encodePath: addLeadingSlash, + decodePath: addLeadingSlash + } + }; + + function getHashPath() { + // We can't use window.location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + var href = window.location.href; + var hashIndex = href.indexOf('#'); + return hashIndex === -1 ? '' : href.substring(hashIndex + 1); + } + + function pushHashPath(path) { + window.location.hash = path; + } + + function replaceHashPath(path) { + var hashIndex = window.location.href.indexOf('#'); + window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path); + } + + function createHashHistory(props) { + if (props === void 0) { + props = {}; + } + + !canUseDOM ? invariant(false, 'Hash history needs a DOM') : void 0; + var globalHistory = window.history; + var canGoWithoutReload = supportsGoWithoutReloadUsingHash(); + var _props = props, + _props$getUserConfirm = _props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, + _props$hashType = _props.hashType, + hashType = _props$hashType === void 0 ? 'slash' : _props$hashType; + var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; + var _HashPathCoders$hashT = HashPathCoders[hashType], + encodePath = _HashPathCoders$hashT.encodePath, + decodePath = _HashPathCoders$hashT.decodePath; + + function getDOMLocation() { + var path = decodePath(getHashPath()); + warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); + if (basename) path = stripBasename(path, basename); + return createLocation(path); + } + + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = globalHistory.length; + transitionManager.notifyListeners(history.location, history.action); + } + + var forceNextPop = false; + var ignorePath = null; + + function handleHashChange() { + var path = getHashPath(); + var encodedPath = encodePath(path); + + if (path !== encodedPath) { + // Ensure we always have a properly-encoded hash. + replaceHashPath(encodedPath); + } else { + var location = getDOMLocation(); + var prevLocation = history.location; + if (!forceNextPop && locationsAreEqual(prevLocation, location)) return; // A hashchange doesn't always == location change. + + if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace. + + ignorePath = null; + handlePop(location); + } + } + + function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location + }); + } else { + revertPop(location); + } + }); + } + } + + function revertPop(fromLocation) { + var toLocation = history.location; // TODO: We could probably make this more reliable by + // keeping a list of paths we've seen in sessionStorage. + // Instead, we just default to 0 for paths we don't know. + + var toIndex = allPaths.lastIndexOf(createPath(toLocation)); + if (toIndex === -1) toIndex = 0; + var fromIndex = allPaths.lastIndexOf(createPath(fromLocation)); + if (fromIndex === -1) fromIndex = 0; + var delta = toIndex - fromIndex; + + if (delta) { + forceNextPop = true; + go(delta); + } + } // Ensure the hash is encoded properly before doing anything else. + + + var path = getHashPath(); + var encodedPath = encodePath(path); + if (path !== encodedPath) replaceHashPath(encodedPath); + var initialLocation = getDOMLocation(); + var allPaths = [createPath(initialLocation)]; // Public interface + + function createHref(location) { + return '#' + encodePath(basename + createPath(location)); + } + + function push(path, state) { + warning(state === undefined, 'Hash history cannot push state; it is ignored'); + var action = 'PUSH'; + var location = createLocation(path, undefined, undefined, history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var path = createPath(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath() !== encodedPath; + + if (hashChanged) { + // We cannot tell if a hashchange was caused by a PUSH, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + pushHashPath(encodedPath); + var prevIndex = allPaths.lastIndexOf(createPath(history.location)); + var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + nextPaths.push(path); + allPaths = nextPaths; + setState({ + action: action, + location: location + }); + } else { + warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack'); + setState(); + } + }); + } + + function replace(path, state) { + warning(state === undefined, 'Hash history cannot replace state; it is ignored'); + var action = 'REPLACE'; + var location = createLocation(path, undefined, undefined, history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var path = createPath(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath() !== encodedPath; + + if (hashChanged) { + // We cannot tell if a hashchange was caused by a REPLACE, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + replaceHashPath(encodedPath); + } + + var prevIndex = allPaths.indexOf(createPath(history.location)); + if (prevIndex !== -1) allPaths[prevIndex] = path; + setState({ + action: action, + location: location + }); + }); + } + + function go(n) { + warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser'); + globalHistory.go(n); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + var listenerCount = 0; + + function checkDOMListeners(delta) { + listenerCount += delta; + + if (listenerCount === 1 && delta === 1) { + window.addEventListener(HashChangeEvent$1, handleHashChange); + } else if (listenerCount === 0) { + window.removeEventListener(HashChangeEvent$1, handleHashChange); + } + } + + var isBlocked = false; + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + var unblock = transitionManager.setPrompt(prompt); + + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } + + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } + + return unblock(); + }; + } + + function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); + return function () { + checkDOMListeners(-1); + unlisten(); + }; + } + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; + return history; + } + + function clamp(n, lowerBound, upperBound) { + return Math.min(Math.max(n, lowerBound), upperBound); + } + /** + * Creates a history object that stores locations in memory. + */ + + + function createMemoryHistory(props) { + if (props === void 0) { + props = {}; + } + + var _props = props, + getUserConfirmation = _props.getUserConfirmation, + _props$initialEntries = _props.initialEntries, + initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries, + _props$initialIndex = _props.initialIndex, + initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex, + _props$keyLength = _props.keyLength, + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = history.entries.length; + transitionManager.notifyListeners(history.location, history.action); + } + + function createKey() { + return Math.random().toString(36).substr(2, keyLength); + } + + var index = clamp(initialIndex, 0, initialEntries.length - 1); + var entries = initialEntries.map(function (entry) { + return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey()); + }); // Public interface + + var createHref = createPath; + + function push(path, state) { + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'PUSH'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var prevIndex = history.index; + var nextIndex = prevIndex + 1; + var nextEntries = history.entries.slice(0); + + if (nextEntries.length > nextIndex) { + nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); + } else { + nextEntries.push(location); + } + + setState({ + action: action, + location: location, + index: nextIndex, + entries: nextEntries + }); + }); + } + + function replace(path, state) { + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'REPLACE'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + history.entries[history.index] = location; + setState({ + action: action, + location: location + }); + }); + } + + function go(n) { + var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); + var action = 'POP'; + var location = history.entries[nextIndex]; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location, + index: nextIndex + }); + } else { + // Mimic the behavior of DOM histories by + // causing a render after a cancelled POP. + setState(); + } + }); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + function canGo(n) { + var nextIndex = history.index + n; + return nextIndex >= 0 && nextIndex < history.entries.length; + } + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + return transitionManager.setPrompt(prompt); + } + + function listen(listener) { + return transitionManager.appendListener(listener); + } + + var history = { + length: entries.length, + action: 'POP', + location: entries[index], + index: index, + entries: entries, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + canGo: canGo, + block: block, + listen: listen + }; + return history; + } + + exports.createBrowserHistory = createBrowserHistory; + exports.createHashHistory = createHashHistory; + exports.createMemoryHistory = createMemoryHistory; + exports.createLocation = createLocation; + exports.locationsAreEqual = locationsAreEqual; + exports.parsePath = parsePath; + exports.createPath = createPath; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/history/umd/history.min.js b/node_modules/history/umd/history.min.js new file mode 100644 index 00000000..5a9f238e --- /dev/null +++ b/node_modules/history/umd/history.min.js @@ -0,0 +1 @@ +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.History={})}(this,function(n){"use strict";function S(){return(S=Object.assign||function(n){for(var t=1;tt?e.splice(t,e.length-t,o):e.push(o),s({action:"PUSH",location:o,index:t,entries:e})}})},replace:function(n,t){var e="REPLACE",o=R(n,t,h(),y.location);u.confirmTransitionTo(o,e,i,function(n){n&&(y.entries[y.index]=o,s({action:e,location:o}))})},go:p,goBack:function(){p(-1)},goForward:function(){p(1)},canGo:function(n){var t=y.index+n;return 0<=t&&t 0 + ? format.replace(/%s/g, function() { + return subs[index++]; + }) + : format); + + if (typeof console !== 'undefined') { + console.error(message); + } + + try { + // --- Welcome to debugging history --- + // This error was thrown as a convenience so that you can use the + // stack trace to find the callsite that triggered this warning. + throw new Error(message); + } catch (e) {} + }; +} + +module.exports = function(member) { + printWarning( + 'Please use `require("history").%s` instead of `require("history/%s")`. ' + + 'Support for the latter will be removed in the next major release.', + [member, member] + ); +}; diff --git a/node_modules/hoist-non-react-statics/CHANGELOG.md b/node_modules/hoist-non-react-statics/CHANGELOG.md new file mode 100644 index 00000000..ae4c8940 --- /dev/null +++ b/node_modules/hoist-non-react-statics/CHANGELOG.md @@ -0,0 +1,30 @@ +# 3.3.0 (January 23, 2019) +- Prevent hoisting of React.memo statics (#73) + +# 3.2.1 (December 3, 2018) +- Fixed `defaultProps`, `displayName` and `propTypes` being hoisted from `React.forwardRef` to `React.forwardRef`. ([#71]) + +# 3.2.0 (November 26, 2018) +- Added support for `getDerivedStateFromError`. ([#68]) +- Added support for React versions less than 0.14. ([#69]) + +# 3.1.0 (October 30, 2018) +- Added support for `contextType`. ([#62]) +- Reduced bundle size. ([e89c7a6]) +- Removed TypeScript definitions. ([#61]) + +# 3.0.1 (July 28, 2018) +- Fixed prop-types warnings. ([e0846fe]) + +# 3.0.0 (July 27, 2018) +- Dropped support for React versions less than 0.14. ([#55]) +- Added support for `React.forwardRef` components. ([#55]) + +[#55]: https://github.com/mridgway/hoist-non-react-statics/pull/55 +[#61]: https://github.com/mridgway/hoist-non-react-statics/pull/61 +[#62]: https://github.com/mridgway/hoist-non-react-statics/pull/62 +[#68]: https://github.com/mridgway/hoist-non-react-statics/pull/68 +[#69]: https://github.com/mridgway/hoist-non-react-statics/pull/69 +[#71]: https://github.com/mridgway/hoist-non-react-statics/pull/71 +[e0846fe]: https://github.com/mridgway/hoist-non-react-statics/commit/e0846feefbad8b34d300de9966ffd607aacb81a3 +[e89c7a6]: https://github.com/mridgway/hoist-non-react-statics/commit/e89c7a6168edc19eeadb2d149e600b888e8b0446 diff --git a/node_modules/hoist-non-react-statics/LICENSE.md b/node_modules/hoist-non-react-statics/LICENSE.md new file mode 100644 index 00000000..2464f59e --- /dev/null +++ b/node_modules/hoist-non-react-statics/LICENSE.md @@ -0,0 +1,29 @@ +Software License Agreement (BSD License) +======================================== + +Copyright (c) 2015, Yahoo! Inc. All rights reserved. +---------------------------------------------------- + +Redistribution and use of this software 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 Yahoo! Inc. nor the names of YUI's contributors may be + used to endorse or promote products derived from this software without + specific prior written permission of Yahoo! Inc. + +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/hoist-non-react-statics/README.md b/node_modules/hoist-non-react-statics/README.md new file mode 100644 index 00000000..24ea6887 --- /dev/null +++ b/node_modules/hoist-non-react-statics/README.md @@ -0,0 +1,55 @@ +# hoist-non-react-statics + +[![NPM version](https://badge.fury.io/js/hoist-non-react-statics.svg)](http://badge.fury.io/js/hoist-non-react-statics) +[![Build Status](https://img.shields.io/travis/mridgway/hoist-non-react-statics.svg)](https://travis-ci.org/mridgway/hoist-non-react-statics) +[![Coverage Status](https://img.shields.io/coveralls/mridgway/hoist-non-react-statics.svg)](https://coveralls.io/r/mridgway/hoist-non-react-statics?branch=master) +[![Dependency Status](https://img.shields.io/david/mridgway/hoist-non-react-statics.svg)](https://david-dm.org/mridgway/hoist-non-react-statics) +[![devDependency Status](https://img.shields.io/david/dev/mridgway/hoist-non-react-statics.svg)](https://david-dm.org/mridgway/hoist-non-react-statics#info=devDependencies) + +Copies non-react specific statics from a child component to a parent component. +Similar to `Object.assign`, but with React static keywords blacklisted from +being overridden. + +```bash +$ npm install --save hoist-non-react-statics +``` + +## Usage + +```js +import hoistNonReactStatics from 'hoist-non-react-statics'; + +hoistNonReactStatics(targetComponent, sourceComponent); +``` + +If you have specific statics that you don't want to be hoisted, you can also pass a third parameter to exclude them: + +```js +hoistNonReactStatics(targetComponent, sourceComponent, { myStatic: true, myOtherStatic: true }); +``` + +## What does this module do? + +See this [explanation](https://facebook.github.io/react/docs/higher-order-components.html#static-methods-must-be-copied-over) from the React docs. + +## Compatible React Versions + +Please use latest 3.x. Versions prior to 3.x will not support ForwardRefs. + +| hoist-non-react-statics Version | Compatible React Version | +|--------------------------|-------------------------------| +| 3.x | 0.13-16.x With ForwardRef Support | +| 2.x | 0.13-16.x Without ForwardRef Support | +| 1.x | 0.13-16.2 | + +## Browser Support + +This package uses `Object.defineProperty` which has a broken implementation in IE8. In order to use this package in IE8, you will need a polyfill that fixes this method. + +## License +This software is free to use under the Yahoo Inc. BSD license. +See the [LICENSE file][] for license text and copyright information. + +[LICENSE file]: https://github.com/mridgway/hoist-non-react-statics/blob/master/LICENSE.md + +Third-party open source code used are listed in our [package.json file]( https://github.com/mridgway/hoist-non-react-statics/blob/master/package.json). diff --git a/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js new file mode 100644 index 00000000..145e2ac0 --- /dev/null +++ b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js @@ -0,0 +1,103 @@ +'use strict'; + +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +var ReactIs = require('react-is'); +var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true +}; + +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true +}; + +var FORWARD_REF_STATICS = { + '$$typeof': true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true +}; + +var MEMO_STATICS = { + '$$typeof': true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true +}; + +var TYPE_STATICS = {}; +TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS; + +function getStatics(component) { + if (ReactIs.isMemo(component)) { + return MEMO_STATICS; + } + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; +} + +var defineProperty = Object.defineProperty; +var getOwnPropertyNames = Object.getOwnPropertyNames; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var getPrototypeOf = Object.getPrototypeOf; +var objectPrototype = Object.prototype; + +function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { + // don't hoist over string (html) components + + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + var keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } + + var targetStatics = getStatics(targetComponent); + var sourceStatics = getStatics(sourceComponent); + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + try { + // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + + return targetComponent; + } + + return targetComponent; +} + +module.exports = hoistNonReactStatics; diff --git a/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.js b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.js new file mode 100644 index 00000000..17cace27 --- /dev/null +++ b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.js @@ -0,0 +1,109 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.hoistNonReactStatics = factory()); +}(this, (function () { 'use strict'; + +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +var ReactIs = require('react-is'); +var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true +}; + +var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true +}; + +var FORWARD_REF_STATICS = { + '$$typeof': true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true +}; + +var MEMO_STATICS = { + '$$typeof': true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true +}; + +var TYPE_STATICS = {}; +TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS; + +function getStatics(component) { + if (ReactIs.isMemo(component)) { + return MEMO_STATICS; + } + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; +} + +var defineProperty = Object.defineProperty; +var getOwnPropertyNames = Object.getOwnPropertyNames; +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; +var getPrototypeOf = Object.getPrototypeOf; +var objectPrototype = Object.prototype; + +function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { + // don't hoist over string (html) components + + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + var keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } + + var targetStatics = getStatics(targetComponent); + var sourceStatics = getStatics(sourceComponent); + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + try { + // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + + return targetComponent; + } + + return targetComponent; +} + +return hoistNonReactStatics; + +}))); diff --git a/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.min.js b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.min.js new file mode 100644 index 00000000..748841e0 --- /dev/null +++ b/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.hoistNonReactStatics=t()}(this,function(){"use strict";var t=require("react-is"),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},f={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},p={};function d(e){return t.isMemo(e)?o:p[e.$$typeof]||r}p[t.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var u=Object.defineProperty,l=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols,g=Object.getOwnPropertyDescriptor,O=Object.getPrototypeOf,P=Object.prototype;return function e(t,r,o){if("string"!=typeof r){if(P){var p=O(r);p&&p!==P&&e(t,p,o)}var n=l(r);m&&(n=n.concat(m(r)));for(var a=d(t),i=d(r),s=0;s 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/build/build.js b/node_modules/isarray/build/build.js new file mode 100644 index 00000000..ec58596a --- /dev/null +++ b/node_modules/isarray/build/build.js @@ -0,0 +1,209 @@ + +/** + * Require the given path. + * + * @param {String} path + * @return {Object} exports + * @api public + */ + +function require(path, parent, orig) { + var resolved = require.resolve(path); + + // lookup failed + if (null == resolved) { + orig = orig || path; + parent = parent || 'root'; + var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); + err.path = orig; + err.parent = parent; + err.require = true; + throw err; + } + + var module = require.modules[resolved]; + + // perform real require() + // by invoking the module's + // registered function + if (!module.exports) { + module.exports = {}; + module.client = module.component = true; + module.call(this, module.exports, require.relative(resolved), module); + } + + return module.exports; +} + +/** + * Registered modules. + */ + +require.modules = {}; + +/** + * Registered aliases. + */ + +require.aliases = {}; + +/** + * Resolve `path`. + * + * Lookup: + * + * - PATH/index.js + * - PATH.js + * - PATH + * + * @param {String} path + * @return {String} path or null + * @api private + */ + +require.resolve = function(path) { + if (path.charAt(0) === '/') path = path.slice(1); + var index = path + '/index.js'; + + var paths = [ + path, + path + '.js', + path + '.json', + path + '/index.js', + path + '/index.json' + ]; + + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + if (require.modules.hasOwnProperty(path)) return path; + } + + if (require.aliases.hasOwnProperty(index)) { + return require.aliases[index]; + } +}; + +/** + * Normalize `path` relative to the current path. + * + * @param {String} curr + * @param {String} path + * @return {String} + * @api private + */ + +require.normalize = function(curr, path) { + var segs = []; + + if ('.' != path.charAt(0)) return path; + + curr = curr.split('/'); + path = path.split('/'); + + for (var i = 0; i < path.length; ++i) { + if ('..' == path[i]) { + curr.pop(); + } else if ('.' != path[i] && '' != path[i]) { + segs.push(path[i]); + } + } + + return curr.concat(segs).join('/'); +}; + +/** + * Register module at `path` with callback `definition`. + * + * @param {String} path + * @param {Function} definition + * @api private + */ + +require.register = function(path, definition) { + require.modules[path] = definition; +}; + +/** + * Alias a module definition. + * + * @param {String} from + * @param {String} to + * @api private + */ + +require.alias = function(from, to) { + if (!require.modules.hasOwnProperty(from)) { + throw new Error('Failed to alias "' + from + '", it does not exist'); + } + require.aliases[to] = from; +}; + +/** + * Return a require function relative to the `parent` path. + * + * @param {String} parent + * @return {Function} + * @api private + */ + +require.relative = function(parent) { + var p = require.normalize(parent, '..'); + + /** + * lastIndexOf helper. + */ + + function lastIndexOf(arr, obj) { + var i = arr.length; + while (i--) { + if (arr[i] === obj) return i; + } + return -1; + } + + /** + * The relative require() itself. + */ + + function localRequire(path) { + var resolved = localRequire.resolve(path); + return require(resolved, parent, path); + } + + /** + * Resolve relative to the parent. + */ + + localRequire.resolve = function(path) { + var c = path.charAt(0); + if ('/' == c) return path.slice(1); + if ('.' == c) return require.normalize(p, path); + + // resolve deps by returning + // the dep in the nearest "deps" + // directory + var segs = parent.split('/'); + var i = lastIndexOf(segs, 'deps') + 1; + if (!i) i = 0; + path = segs.slice(0, i + 1).join('/') + '/deps/' + path; + return path; + }; + + /** + * Check if module is defined at `path`. + */ + + localRequire.exists = function(path) { + return require.modules.hasOwnProperty(localRequire.resolve(path)); + }; + + return localRequire; +}; +require.register("isarray/index.js", function(exports, require, module){ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + +}); +require.alias("isarray/index.js", "isarray/index.js"); + diff --git a/node_modules/isarray/component.json b/node_modules/isarray/component.json new file mode 100644 index 00000000..9e31b683 --- /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 00000000..5f5ad45d --- /dev/null +++ b/node_modules/isarray/index.js @@ -0,0 +1,3 @@ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; diff --git a/node_modules/isarray/package.json b/node_modules/isarray/package.json new file mode 100644 index 00000000..7980fe0c --- /dev/null +++ b/node_modules/isarray/package.json @@ -0,0 +1,57 @@ +{ + "_from": "isarray@0.0.1", + "_id": "isarray@0.0.1", + "_inBundle": false, + "_integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "_location": "/isarray", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "isarray@0.0.1", + "name": "isarray", + "escapedName": "isarray", + "rawSpec": "0.0.1", + "saveSpec": null, + "fetchSpec": "0.0.1" + }, + "_requiredBy": [ + "/path-to-regexp" + ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "_spec": "isarray@0.0.1", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/path-to-regexp", + "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": { + "tap": "*" + }, + "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": "tap test/*.js" + }, + "version": "0.0.1" +} diff --git a/node_modules/js-tokens/CHANGELOG.md b/node_modules/js-tokens/CHANGELOG.md new file mode 100644 index 00000000..755e6f6e --- /dev/null +++ b/node_modules/js-tokens/CHANGELOG.md @@ -0,0 +1,151 @@ +### Version 4.0.0 (2018-01-28) ### + +- Added: Support for ES2018. The only change needed was recognizing the `s` + regex flag. +- Changed: _All_ tokens returned by the `matchToToken` function now have a + `closed` property. It is set to `undefined` for the tokens where “closed” + doesn’t make sense. This means that all tokens objects have the same shape, + which might improve performance. + +These are the breaking changes: + +- `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but + `['/a/s']`. (There are of course other variations of this.) +- Code that rely on some token objects not having the `closed` property could + now behave differently. + + +### Version 3.0.2 (2017-06-28) ### + +- No code changes. Just updates to the readme. + + +### Version 3.0.1 (2017-01-30) ### + +- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched + correctly. + + +### Version 3.0.0 (2017-01-11) ### + +This release contains one breaking change, that should [improve performance in +V8][v8-perf]: + +> So how can you, as a JavaScript developer, ensure that your RegExps are fast? +> If you are not interested in hooking into RegExp internals, make sure that +> neither the RegExp instance, nor its prototype is modified in order to get the +> best performance: +> +> ```js +> var re = /./g; +> re.exec(''); // Fast path. +> re.new_property = 'slow'; +> ``` + +This module used to export a single regex, with `.matchToToken` bolted +on, just like in the above example. This release changes the exports of +the module to avoid this issue. + +Before: + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens") +var matchToToken = jsTokens.matchToToken +``` + +After: + +```js +import jsTokens, {matchToToken} from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +var matchToToken = require("js-tokens").matchToToken +``` + +[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html + + +### Version 2.0.0 (2016-06-19) ### + +- Added: Support for ES2016. In other words, support for the `**` exponentiation + operator. + +These are the breaking changes: + +- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`. +- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`. + + +### Version 1.0.3 (2016-03-27) ### + +- Improved: Made the regex ever so slightly smaller. +- Updated: The readme. + + +### Version 1.0.2 (2015-10-18) ### + +- Improved: Limited npm package contents for a smaller download. Thanks to + @zertosh! + + +### Version 1.0.1 (2015-06-20) ### + +- Fixed: Declared an undeclared variable. + + +### Version 1.0.0 (2015-02-26) ### + +- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That + type is now equivalent to the Punctuator token in the ECMAScript + specification. (Backwards-incompatible change.) +- Fixed: A `-` followed by a number is now correctly matched as a punctuator + followed by a number. It used to be matched as just a number, but there is no + such thing as negative number literals. (Possibly backwards-incompatible + change.) + + +### Version 0.4.1 (2015-02-21) ### + +- Added: Support for the regex `u` flag. + + +### Version 0.4.0 (2015-02-21) ### + +- Improved: `jsTokens.matchToToken` performance. +- Added: Support for octal and binary number literals. +- Added: Support for template strings. + + +### Version 0.3.1 (2015-01-06) ### + +- Fixed: Support for unicode spaces. They used to be allowed in names (which is + very confusing), and some unicode newlines were wrongly allowed in strings and + regexes. + + +### Version 0.3.0 (2014-12-19) ### + +- Changed: The `jsTokens.names` array has been replaced with the + `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no + longer part of the public API; instead use said function. See this [gist] for + an example. (Backwards-incompatible change.) +- Changed: The empty string is now considered an “invalid” token, instead an + “empty” token (its own group). (Backwards-incompatible change.) +- Removed: component support. (Backwards-incompatible change.) + +[gist]: https://gist.github.com/lydell/be49dbf80c382c473004 + + +### Version 0.2.0 (2014-06-19) ### + +- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own + category (“functionArrow”), for simplicity. (Backwards-incompatible change.) +- Added: ES6 splats (`...`) are now matched as an operator (instead of three + punctuations). (Backwards-incompatible change.) + + +### Version 0.1.0 (2014-03-08) ### + +- Initial release. diff --git a/node_modules/js-tokens/LICENSE b/node_modules/js-tokens/LICENSE new file mode 100644 index 00000000..54aef52f --- /dev/null +++ b/node_modules/js-tokens/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014, 2015, 2016, 2017, 2018 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/js-tokens/README.md b/node_modules/js-tokens/README.md new file mode 100644 index 00000000..00cdf163 --- /dev/null +++ b/node_modules/js-tokens/README.md @@ -0,0 +1,240 @@ +Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) +======== + +A regex that tokenizes JavaScript. + +```js +var jsTokens = require("js-tokens").default + +var jsString = "var foo=opts.foo;\n..." + +jsString.match(jsTokens) +// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] +``` + + +Installation +============ + +`npm install js-tokens` + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +``` + + +Usage +===== + +### `jsTokens` ### + +A regex with the `g` flag that matches JavaScript tokens. + +The regex _always_ matches, even invalid JavaScript and the empty string. + +The next match is always directly after the previous. + +### `var token = matchToToken(match)` ### + +```js +import {matchToToken} from "js-tokens" +// or: +var matchToToken = require("js-tokens").matchToToken +``` + +Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: +String, value: String}` object. The following types are available: + +- string +- comment +- regex +- number +- name +- punctuator +- whitespace +- invalid + +Multi-line comments and strings also have a `closed` property indicating if the +token was closed or not (see below). + +Comments and strings both come in several flavors. To distinguish them, check if +the token starts with `//`, `/*`, `'`, `"` or `` ` ``. + +Names are ECMAScript IdentifierNames, that is, including both identifiers and +keywords. You may use [is-keyword-js] to tell them apart. + +Whitespace includes both line terminators and other whitespace. + +[is-keyword-js]: https://github.com/crissdev/is-keyword-js + + +ECMAScript support +================== + +The intention is to always support the latest ECMAScript version whose feature +set has been finalized. + +If adding support for a newer version requires changes, a new version with a +major verion bump will be released. + +Currently, ECMAScript 2018 is supported. + + +Invalid code handling +===================== + +Unterminated strings are still matched as strings. JavaScript strings cannot +contain (unescaped) newlines, so unterminated strings simply end at the end of +the line. Unterminated template strings can contain unescaped newlines, though, +so they go on to the end of input. + +Unterminated multi-line comments are also still matched as comments. They +simply go on to the end of the input. + +Unterminated regex literals are likely matched as division and whatever is +inside the regex. + +Invalid ASCII characters have their own capturing group. + +Invalid non-ASCII characters are treated as names, to simplify the matching of +names (except unicode spaces which are treated as whitespace). Note: See also +the [ES2018](#es2018) section. + +Regex literals may contain invalid regex syntax. They are still matched as +regex literals. They may also contain repeated regex flags, to keep the regex +simple. + +Strings may contain invalid escape sequences. + + +Limitations +=========== + +Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be +perfect. But that’s not the point either. + +You may compare jsTokens with [esprima] by using `esprima-compare.js`. +See `npm run esprima-compare`! + +[esprima]: http://esprima.org/ + +### Template string interpolation ### + +Template strings are matched as single tokens, from the starting `` ` `` to the +ending `` ` ``, including interpolations (whose tokens are not matched +individually). + +Matching template string interpolations requires recursive balancing of `{` and +`}`—something that JavaScript regexes cannot do. Only one level of nesting is +supported. + +### Division and regex literals collision ### + +Consider this example: + +```js +var g = 9.82 +var number = bar / 2/g + +var regex = / 2/g +``` + +A human can easily understand that in the `number` line we’re dealing with +division, and in the `regex` line we’re dealing with a regex literal. How come? +Because humans can look at the whole code to put the `/` characters in context. +A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also +look backwards. See the [ES2018](#es2018) section). + +When the `jsTokens` regex scans throught the above, it will see the following +at the end of both the `number` and `regex` rows: + +```js +/ 2/g +``` + +It is then impossible to know if that is a regex literal, or part of an +expression dealing with division. + +Here is a similar case: + +```js +foo /= 2/g +foo(/= 2/g) +``` + +The first line divides the `foo` variable with `2/g`. The second line calls the +`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only +sees forwards, it cannot tell the two cases apart. + +There are some cases where we _can_ tell division and regex literals apart, +though. + +First off, we have the simple cases where there’s only one slash in the line: + +```js +var foo = 2/g +foo /= 2 +``` + +Regex literals cannot contain newlines, so the above cases are correctly +identified as division. Things are only problematic when there are more than +one non-comment slash in a single line. + +Secondly, not every character is a valid regex flag. + +```js +var number = bar / 2/e +``` + +The above example is also correctly identified as division, because `e` is not a +valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` +(any letter) as flags, but it is not worth it since it increases the amount of +ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are +allowed. This means that the above example will be identified as division as +long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6 +characters long. + +Lastly, we can look _forward_ for information. + +- If the token following what looks like a regex literal is not valid after a + regex literal, but is valid in a division expression, then the regex literal + is treated as division instead. For example, a flagless regex cannot be + followed by a string, number or name, but all of those three can be the + denominator of a division. +- Generally, if what looks like a regex literal is followed by an operator, the + regex literal is treated as division instead. This is because regexes are + seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division + could likely be part of such an expression. + +Please consult the regex source and the test cases for precise information on +when regex or division is matched (should you need to know). In short, you +could sum it up as: + +If the end of a statement looks like a regex literal (even if it isn’t), it +will be treated as one. Otherwise it should work as expected (if you write sane +code). + +### ES2018 ### + +ES2018 added some nice regex improvements to the language. + +- [Unicode property escapes] should allow telling names and invalid non-ASCII + characters apart without blowing up the regex size. +- [Lookbehind assertions] should allow matching telling division and regex + literals apart in more cases. +- [Named capture groups] might simplify some things. + +These things would be nice to do, but are not critical. They probably have to +wait until the oldest maintained Node.js LTS release supports those features. + +[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html +[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html +[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html + + +License +======= + +[MIT](LICENSE). diff --git a/node_modules/js-tokens/index.js b/node_modules/js-tokens/index.js new file mode 100644 index 00000000..b23a4a0e --- /dev/null +++ b/node_modules/js-tokens/index.js @@ -0,0 +1,23 @@ +// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell +// License: MIT. (See LICENSE.) + +Object.defineProperty(exports, "__esModule", { + value: true +}) + +// This regex comes from regex.coffee, and is inserted here by generate-index.js +// (run `npm run build`). +exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g + +exports.matchToToken = function(match) { + var token = {type: "invalid", value: match[0], closed: undefined} + if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) + else if (match[ 5]) token.type = "comment" + else if (match[ 6]) token.type = "comment", token.closed = !!match[7] + else if (match[ 8]) token.type = "regex" + else if (match[ 9]) token.type = "number" + else if (match[10]) token.type = "name" + else if (match[11]) token.type = "punctuator" + else if (match[12]) token.type = "whitespace" + return token +} diff --git a/node_modules/js-tokens/package.json b/node_modules/js-tokens/package.json new file mode 100644 index 00000000..73ad5c4a --- /dev/null +++ b/node_modules/js-tokens/package.json @@ -0,0 +1,64 @@ +{ + "_from": "js-tokens@^3.0.0 || ^4.0.0", + "_id": "js-tokens@4.0.0", + "_inBundle": false, + "_integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "_location": "/js-tokens", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "js-tokens@^3.0.0 || ^4.0.0", + "name": "js-tokens", + "escapedName": "js-tokens", + "rawSpec": "^3.0.0 || ^4.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0 || ^4.0.0" + }, + "_requiredBy": [ + "/loose-envify" + ], + "_resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "_shasum": "19203fb59991df98e3a287050d4647cdeaf32499", + "_spec": "js-tokens@^3.0.0 || ^4.0.0", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/loose-envify", + "author": { + "name": "Simon Lydell" + }, + "bugs": { + "url": "https://github.com/lydell/js-tokens/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A regex that tokenizes JavaScript.", + "devDependencies": { + "coffeescript": "2.1.1", + "esprima": "4.0.0", + "everything.js": "1.0.3", + "mocha": "5.0.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/lydell/js-tokens#readme", + "keywords": [ + "JavaScript", + "js", + "token", + "tokenize", + "regex" + ], + "license": "MIT", + "name": "js-tokens", + "repository": { + "type": "git", + "url": "git+https://github.com/lydell/js-tokens.git" + }, + "scripts": { + "build": "node generate-index.js", + "dev": "npm run build && npm test", + "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", + "test": "mocha --ui tdd" + }, + "version": "4.0.0" +} diff --git a/node_modules/loose-envify/LICENSE b/node_modules/loose-envify/LICENSE new file mode 100644 index 00000000..fbafb487 --- /dev/null +++ b/node_modules/loose-envify/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 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/loose-envify/README.md b/node_modules/loose-envify/README.md new file mode 100644 index 00000000..7f4e07b0 --- /dev/null +++ b/node_modules/loose-envify/README.md @@ -0,0 +1,45 @@ +# loose-envify + +[![Build Status](https://travis-ci.org/zertosh/loose-envify.svg?branch=master)](https://travis-ci.org/zertosh/loose-envify) + +Fast (and loose) selective `process.env` replacer using [js-tokens](https://github.com/lydell/js-tokens) instead of an AST. Works just like [envify](https://github.com/hughsk/envify) but much faster. + +## Gotchas + +* Doesn't handle broken syntax. +* Doesn't look inside embedded expressions in template strings. + - **this won't work:** + ```js + console.log(`the current env is ${process.env.NODE_ENV}`); + ``` +* Doesn't replace oddly-spaced or oddly-commented expressions. + - **this won't work:** + ```js + console.log(process./*won't*/env./*work*/NODE_ENV); + ``` + +## Usage/Options + +loose-envify has the exact same interface as [envify](https://github.com/hughsk/envify), including the CLI. + +## Benchmark + +``` +envify: + + $ for i in {1..5}; do node bench/bench.js 'envify'; done + 708ms + 727ms + 791ms + 719ms + 720ms + +loose-envify: + + $ for i in {1..5}; do node bench/bench.js '../'; done + 51ms + 52ms + 52ms + 52ms + 52ms +``` diff --git a/node_modules/loose-envify/cli.js b/node_modules/loose-envify/cli.js new file mode 100755 index 00000000..c0b63cb1 --- /dev/null +++ b/node_modules/loose-envify/cli.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +'use strict'; + +var looseEnvify = require('./'); +var fs = require('fs'); + +if (process.argv[2]) { + fs.createReadStream(process.argv[2], {encoding: 'utf8'}) + .pipe(looseEnvify(process.argv[2])) + .pipe(process.stdout); +} else { + process.stdin.resume() + process.stdin + .pipe(looseEnvify(__filename)) + .pipe(process.stdout); +} diff --git a/node_modules/loose-envify/custom.js b/node_modules/loose-envify/custom.js new file mode 100644 index 00000000..6389bfac --- /dev/null +++ b/node_modules/loose-envify/custom.js @@ -0,0 +1,4 @@ +// envify compatibility +'use strict'; + +module.exports = require('./loose-envify'); diff --git a/node_modules/loose-envify/index.js b/node_modules/loose-envify/index.js new file mode 100644 index 00000000..8cd8305d --- /dev/null +++ b/node_modules/loose-envify/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./loose-envify')(process.env); diff --git a/node_modules/loose-envify/loose-envify.js b/node_modules/loose-envify/loose-envify.js new file mode 100644 index 00000000..b5a5be22 --- /dev/null +++ b/node_modules/loose-envify/loose-envify.js @@ -0,0 +1,36 @@ +'use strict'; + +var stream = require('stream'); +var util = require('util'); +var replace = require('./replace'); + +var jsonExtRe = /\.json$/; + +module.exports = function(rootEnv) { + rootEnv = rootEnv || process.env; + return function (file, trOpts) { + if (jsonExtRe.test(file)) { + return stream.PassThrough(); + } + var envs = trOpts ? [rootEnv, trOpts] : [rootEnv]; + return new LooseEnvify(envs); + }; +}; + +function LooseEnvify(envs) { + stream.Transform.call(this); + this._data = ''; + this._envs = envs; +} +util.inherits(LooseEnvify, stream.Transform); + +LooseEnvify.prototype._transform = function(buf, enc, cb) { + this._data += buf; + cb(); +}; + +LooseEnvify.prototype._flush = function(cb) { + var replaced = replace(this._data, this._envs); + this.push(replaced); + cb(); +}; diff --git a/node_modules/loose-envify/package.json b/node_modules/loose-envify/package.json new file mode 100644 index 00000000..fc9e2abd --- /dev/null +++ b/node_modules/loose-envify/package.json @@ -0,0 +1,70 @@ +{ + "_from": "loose-envify@^1.3.1", + "_id": "loose-envify@1.4.0", + "_inBundle": false, + "_integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "_location": "/loose-envify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "loose-envify@^1.3.1", + "name": "loose-envify", + "escapedName": "loose-envify", + "rawSpec": "^1.3.1", + "saveSpec": null, + "fetchSpec": "^1.3.1" + }, + "_requiredBy": [ + "/history", + "/prop-types", + "/react-router", + "/react-router-dom" + ], + "_resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "_shasum": "71ee51fa7be4caec1a63839f7e682d8132d30caf", + "_spec": "loose-envify@^1.3.1", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/react-router-dom", + "author": { + "name": "Andres Suarez", + "email": "zertosh@gmail.com" + }, + "bin": { + "loose-envify": "cli.js" + }, + "bugs": { + "url": "https://github.com/zertosh/loose-envify/issues" + }, + "bundleDependencies": false, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "deprecated": false, + "description": "Fast (and loose) selective `process.env` replacer using js-tokens instead of an AST", + "devDependencies": { + "browserify": "^13.1.1", + "envify": "^3.4.0", + "tap": "^8.0.0" + }, + "homepage": "https://github.com/zertosh/loose-envify", + "keywords": [ + "environment", + "variables", + "browserify", + "browserify-transform", + "transform", + "source", + "configuration" + ], + "license": "MIT", + "main": "index.js", + "name": "loose-envify", + "repository": { + "type": "git", + "url": "git://github.com/zertosh/loose-envify.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.4.0" +} diff --git a/node_modules/loose-envify/replace.js b/node_modules/loose-envify/replace.js new file mode 100644 index 00000000..ec15e81c --- /dev/null +++ b/node_modules/loose-envify/replace.js @@ -0,0 +1,65 @@ +'use strict'; + +var jsTokens = require('js-tokens').default; + +var processEnvRe = /\bprocess\.env\.[_$a-zA-Z][$\w]+\b/; +var spaceOrCommentRe = /^(?:\s|\/[/*])/; + +function replace(src, envs) { + if (!processEnvRe.test(src)) { + return src; + } + + var out = []; + var purge = envs.some(function(env) { + return env._ && env._.indexOf('purge') !== -1; + }); + + jsTokens.lastIndex = 0 + var parts = src.match(jsTokens); + + for (var i = 0; i < parts.length; i++) { + if (parts[i ] === 'process' && + parts[i + 1] === '.' && + parts[i + 2] === 'env' && + parts[i + 3] === '.') { + var prevCodeToken = getAdjacentCodeToken(-1, parts, i); + var nextCodeToken = getAdjacentCodeToken(1, parts, i + 4); + var replacement = getReplacementString(envs, parts[i + 4], purge); + if (prevCodeToken !== '.' && + nextCodeToken !== '.' && + nextCodeToken !== '=' && + typeof replacement === 'string') { + out.push(replacement); + i += 4; + continue; + } + } + out.push(parts[i]); + } + + return out.join(''); +} + +function getAdjacentCodeToken(dir, parts, i) { + while (true) { + var part = parts[i += dir]; + if (!spaceOrCommentRe.test(part)) { + return part; + } + } +} + +function getReplacementString(envs, name, purge) { + for (var j = 0; j < envs.length; j++) { + var env = envs[j]; + if (typeof env[name] !== 'undefined') { + return JSON.stringify(env[name]); + } + } + if (purge) { + return 'undefined'; + } +} + +module.exports = replace; diff --git a/node_modules/mini-create-react-context/LICENSE b/node_modules/mini-create-react-context/LICENSE new file mode 100644 index 00000000..4cfe1909 --- /dev/null +++ b/node_modules/mini-create-react-context/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2019-present StringEpsilon + +Copyright (c) 2017-2019 James Kyle + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/mini-create-react-context/README.md b/node_modules/mini-create-react-context/README.md new file mode 100644 index 00000000..82888951 --- /dev/null +++ b/node_modules/mini-create-react-context/README.md @@ -0,0 +1,117 @@ +# mini-create-react-context + +

+ + npm install size + + + npm bundle size + + + npm + +

+ +> (A smaller) Polyfill for the [proposed React context API](https://github.com/reactjs/rfcs/pull/2) + +## Install + +```sh +npm install mini-create-react-context +``` + +You'll need to also have `react` and `prop-types` installed. + +## API + +```js +const Context = createReactContext(defaultValue); +/* + + {children} + + + ... + + + {value => children} + +*/ +``` + +## Example + +```js +// @flow +import React, { type Node } from 'react'; +import createReactContext, { type Context } from 'mini-create-react-context'; + +type Theme = 'light' | 'dark'; +// Pass a default theme to ensure type correctness +const ThemeContext: Context = createReactContext('light'); + +class ThemeToggler extends React.Component< + { children: Node }, + { theme: Theme } +> { + state = { theme: 'light' }; + render() { + return ( + // Pass the current context value to the Provider's `value` prop. + // Changes are detected using strict comparison (Object.is) + + + {this.props.children} + + ); + } +} + +class Title extends React.Component<{ children: Node }> { + render() { + return ( + // The Consumer uses a render prop API. Avoids conflicts in the + // props namespace. + + {theme => ( +

+ {this.props.children} +

+ )} +
+ ); + } +} +``` + +## Compatibility + +This package only "ponyfills" the `React.createContext` API, not other unrelated React 16+ APIs. If you are using a version of React <16, keep in mind that you can only use features available in that version. + +For example, you cannot pass children types aren't valid pre React 16: + +```js + +
+
+ +``` + +It will throw `A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.` because `` can only receive a single child element. To fix the error just wrap everyting in a single `
`: + +```js + +
+
+
+
+ +``` diff --git a/node_modules/mini-create-react-context/dist/cjs/index.js b/node_modules/mini-create-react-context/dist/cjs/index.js new file mode 100644 index 00000000..98da2994 --- /dev/null +++ b/node_modules/mini-create-react-context/dist/cjs/index.js @@ -0,0 +1,165 @@ +'use strict';function _interopDefault(e){return(e&&(typeof e==='object')&&'default'in e)?e['default']:e}var React=require('react'),React__default=_interopDefault(React),_inheritsLoose=_interopDefault(require('@babel/runtime/helpers/inheritsLoose')),PropTypes=_interopDefault(require('prop-types')),gud=_interopDefault(require('gud')),warning=_interopDefault(require('tiny-warning'));var MAX_SIGNED_31_BIT_INT = 1073741823; + +function objectIs(x, y) { + if (x === y) { + return x !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } +} + +function createEventEmitter(value) { + var handlers = []; + return { + on: function on(handler) { + handlers.push(handler); + }, + off: function off(handler) { + handlers = handlers.filter(function (h) { + return h !== handler; + }); + }, + get: function get() { + return value; + }, + set: function set(newValue, changedBits) { + value = newValue; + handlers.forEach(function (handler) { + return handler(value, changedBits); + }); + } + }; +} + +function onlyChild(children) { + return Array.isArray(children) ? children[0] : children; +} + +function createReactContext(defaultValue, calculateChangedBits) { + var _Provider$childContex, _Consumer$contextType; + + var contextProp = '__create-react-context-' + gud() + '__'; + + var Provider = + /*#__PURE__*/ + function (_Component) { + _inheritsLoose(Provider, _Component); + + function Provider() { + var _this; + + _this = _Component.apply(this, arguments) || this; + _this.emitter = createEventEmitter(_this.props.value); + return _this; + } + + var _proto = Provider.prototype; + + _proto.getChildContext = function getChildContext() { + var _ref; + + return _ref = {}, _ref[contextProp] = this.emitter, _ref; + }; + + _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if (this.props.value !== nextProps.value) { + var oldValue = this.props.value; + var newValue = nextProps.value; + var changedBits; + + if (objectIs(oldValue, newValue)) { + changedBits = 0; + } else { + changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; + + if (process.env.NODE_ENV !== 'production') { + warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits); + } + + changedBits |= 0; + + if (changedBits !== 0) { + this.emitter.set(nextProps.value, changedBits); + } + } + } + }; + + _proto.render = function render() { + return this.props.children; + }; + + return Provider; + }(React.Component); + + Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex); + + var Consumer = + /*#__PURE__*/ + function (_Component2) { + _inheritsLoose(Consumer, _Component2); + + function Consumer() { + var _this2; + + _this2 = _Component2.apply(this, arguments) || this; + _this2.state = { + value: _this2.getValue() + }; + + _this2.onUpdate = function (newValue, changedBits) { + var observedBits = _this2.observedBits | 0; + + if ((observedBits & changedBits) !== 0) { + _this2.setState({ + value: _this2.getValue() + }); + } + }; + + return _this2; + } + + var _proto2 = Consumer.prototype; + + _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + var observedBits = nextProps.observedBits; + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits; + }; + + _proto2.componentDidMount = function componentDidMount() { + if (this.context[contextProp]) { + this.context[contextProp].on(this.onUpdate); + } + + var observedBits = this.props.observedBits; + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits; + }; + + _proto2.componentWillUnmount = function componentWillUnmount() { + if (this.context[contextProp]) { + this.context[contextProp].off(this.onUpdate); + } + }; + + _proto2.getValue = function getValue() { + if (this.context[contextProp]) { + return this.context[contextProp].get(); + } else { + return defaultValue; + } + }; + + _proto2.render = function render() { + return onlyChild(this.props.children)(this.state.value); + }; + + return Consumer; + }(React.Component); + + Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType); + return { + Provider: Provider, + Consumer: Consumer + }; +}var index = React__default.createContext || createReactContext;module.exports=index; \ No newline at end of file diff --git a/node_modules/mini-create-react-context/dist/cjs/index.min.js b/node_modules/mini-create-react-context/dist/cjs/index.min.js new file mode 100644 index 00000000..4141b6df --- /dev/null +++ b/node_modules/mini-create-react-context/dist/cjs/index.min.js @@ -0,0 +1 @@ +"use strict";function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var React=require("react"),React__default=_interopDefault(React),_inheritsLoose=_interopDefault(require("@babel/runtime/helpers/inheritsLoose")),PropTypes=_interopDefault(require("prop-types")),gud=_interopDefault(require("gud")),warning=_interopDefault(require("tiny-warning")),MAX_SIGNED_31_BIT_INT=1073741823;function objectIs(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function createEventEmitter(n){var r=[];return{on:function(t){r.push(t)},off:function(e){r=r.filter(function(t){return t!==e})},get:function(){return n},set:function(t,e){n=t,r.forEach(function(t){return t(n,e)})}}}function onlyChild(t){return Array.isArray(t)?t[0]:t}function createReactContext(r,o){var t,e,i="__create-react-context-"+gud()+"__",n=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).emitter=createEventEmitter(t.props.value),t}_inheritsLoose(t,e);var n=t.prototype;return n.getChildContext=function(){var t;return(t={})[i]=this.emitter,t},n.componentWillReceiveProps=function(t){if(this.props.value!==t.value){var e,n=this.props.value,r=t.value;objectIs(n,r)?e=0:(e="function"==typeof o?o(n,r):MAX_SIGNED_31_BIT_INT,"production"!==process.env.NODE_ENV&&warning((e&MAX_SIGNED_31_BIT_INT)===e,"calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: "+e),0!==(e|=0)&&this.emitter.set(t.value,e))}},n.render=function(){return this.props.children},t}(React.Component);n.childContextTypes=((t={})[i]=PropTypes.object.isRequired,t);var u=function(t){function e(){var n;return(n=t.apply(this,arguments)||this).state={value:n.getValue()},n.onUpdate=function(t,e){0!=((0|n.observedBits)&e)&&n.setState({value:n.getValue()})},n}_inheritsLoose(e,t);var n=e.prototype;return n.componentWillReceiveProps=function(t){var e=t.observedBits;this.observedBits=null==e?MAX_SIGNED_31_BIT_INT:e},n.componentDidMount=function(){this.context[i]&&this.context[i].on(this.onUpdate);var t=this.props.observedBits;this.observedBits=null==t?MAX_SIGNED_31_BIT_INT:t},n.componentWillUnmount=function(){this.context[i]&&this.context[i].off(this.onUpdate)},n.getValue=function(){return this.context[i]?this.context[i].get():r},n.render=function(){return onlyChild(this.props.children)(this.state.value)},e}(React.Component);return u.contextTypes=((e={})[i]=PropTypes.object,e),{Provider:n,Consumer:u}}var index=React__default.createContext||createReactContext;module.exports=index; \ No newline at end of file diff --git a/node_modules/mini-create-react-context/dist/esm/index.js b/node_modules/mini-create-react-context/dist/esm/index.js new file mode 100644 index 00000000..e5a499d6 --- /dev/null +++ b/node_modules/mini-create-react-context/dist/esm/index.js @@ -0,0 +1,175 @@ +import React, { Component } from 'react'; +import _inheritsLoose from '@babel/runtime/helpers/inheritsLoose'; +import PropTypes from 'prop-types'; +import gud from 'gud'; +import warning from 'tiny-warning'; + +var MAX_SIGNED_31_BIT_INT = 1073741823; + +function objectIs(x, y) { + if (x === y) { + return x !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } +} + +function createEventEmitter(value) { + var handlers = []; + return { + on: function on(handler) { + handlers.push(handler); + }, + off: function off(handler) { + handlers = handlers.filter(function (h) { + return h !== handler; + }); + }, + get: function get() { + return value; + }, + set: function set(newValue, changedBits) { + value = newValue; + handlers.forEach(function (handler) { + return handler(value, changedBits); + }); + } + }; +} + +function onlyChild(children) { + return Array.isArray(children) ? children[0] : children; +} + +function createReactContext(defaultValue, calculateChangedBits) { + var _Provider$childContex, _Consumer$contextType; + + var contextProp = '__create-react-context-' + gud() + '__'; + + var Provider = + /*#__PURE__*/ + function (_Component) { + _inheritsLoose(Provider, _Component); + + function Provider() { + var _this; + + _this = _Component.apply(this, arguments) || this; + _this.emitter = createEventEmitter(_this.props.value); + return _this; + } + + var _proto = Provider.prototype; + + _proto.getChildContext = function getChildContext() { + var _ref; + + return _ref = {}, _ref[contextProp] = this.emitter, _ref; + }; + + _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if (this.props.value !== nextProps.value) { + var oldValue = this.props.value; + var newValue = nextProps.value; + var changedBits; + + if (objectIs(oldValue, newValue)) { + changedBits = 0; + } else { + changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; + + if (process.env.NODE_ENV !== 'production') { + warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits); + } + + changedBits |= 0; + + if (changedBits !== 0) { + this.emitter.set(nextProps.value, changedBits); + } + } + } + }; + + _proto.render = function render() { + return this.props.children; + }; + + return Provider; + }(Component); + + Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex); + + var Consumer = + /*#__PURE__*/ + function (_Component2) { + _inheritsLoose(Consumer, _Component2); + + function Consumer() { + var _this2; + + _this2 = _Component2.apply(this, arguments) || this; + _this2.state = { + value: _this2.getValue() + }; + + _this2.onUpdate = function (newValue, changedBits) { + var observedBits = _this2.observedBits | 0; + + if ((observedBits & changedBits) !== 0) { + _this2.setState({ + value: _this2.getValue() + }); + } + }; + + return _this2; + } + + var _proto2 = Consumer.prototype; + + _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + var observedBits = nextProps.observedBits; + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits; + }; + + _proto2.componentDidMount = function componentDidMount() { + if (this.context[contextProp]) { + this.context[contextProp].on(this.onUpdate); + } + + var observedBits = this.props.observedBits; + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits; + }; + + _proto2.componentWillUnmount = function componentWillUnmount() { + if (this.context[contextProp]) { + this.context[contextProp].off(this.onUpdate); + } + }; + + _proto2.getValue = function getValue() { + if (this.context[contextProp]) { + return this.context[contextProp].get(); + } else { + return defaultValue; + } + }; + + _proto2.render = function render() { + return onlyChild(this.props.children)(this.state.value); + }; + + return Consumer; + }(Component); + + Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType); + return { + Provider: Provider, + Consumer: Consumer + }; +} + +var index = React.createContext || createReactContext; + +export default index; diff --git a/node_modules/mini-create-react-context/dist/index.d.ts b/node_modules/mini-create-react-context/dist/index.d.ts new file mode 100644 index 00000000..034d9c7a --- /dev/null +++ b/node_modules/mini-create-react-context/dist/index.d.ts @@ -0,0 +1,24 @@ +import * as React from 'react'; + +export default function createReactContext( + defaultValue: T, + calculateChangedBits?: (prev: T, next: T) => number +): Context; + +type RenderFn = (value: T) => React.ReactNode; + +export type Context = { + Provider: React.ComponentClass>; + Consumer: React.ComponentClass>; +}; + +export type ProviderProps = { + value: T; + children?: React.ReactNode; + observedBits?: any, +}; + +export type ConsumerProps = { + children: RenderFn | [RenderFn]; + observedBits?: number; +}; diff --git a/node_modules/mini-create-react-context/package.json b/node_modules/mini-create-react-context/package.json new file mode 100644 index 00000000..8e33004c --- /dev/null +++ b/node_modules/mini-create-react-context/package.json @@ -0,0 +1,99 @@ +{ + "_from": "mini-create-react-context@^0.3.0", + "_id": "mini-create-react-context@0.3.2", + "_inBundle": false, + "_integrity": "sha512-2v+OeetEyliMt5VHMXsBhABoJ0/M4RCe7fatd/fBy6SMiKazUSEt3gxxypfnk2SHMkdBYvorHRoQxuGoiwbzAw==", + "_location": "/mini-create-react-context", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "mini-create-react-context@^0.3.0", + "name": "mini-create-react-context", + "escapedName": "mini-create-react-context", + "rawSpec": "^0.3.0", + "saveSpec": null, + "fetchSpec": "^0.3.0" + }, + "_requiredBy": [ + "/react-router" + ], + "_resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.3.2.tgz", + "_shasum": "79fc598f283dd623da8e088b05db8cddab250189", + "_spec": "mini-create-react-context@^0.3.0", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/react-router", + "author": { + "name": "StringEpsilon" + }, + "bugs": { + "url": "https://github.com/StringEpsilon/mini-create-react-context/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@babel/runtime": "^7.4.0", + "gud": "^1.0.0", + "tiny-warning": "^1.0.2" + }, + "deprecated": false, + "description": "Smaller Polyfill for the proposed React context API", + "devDependencies": { + "@babel/cli": "^7.4.3", + "@babel/core": "^7.4.3", + "@babel/plugin-proposal-class-properties": "^7.4.0", + "@babel/preset-env": "^7.4.3", + "@babel/preset-react": "^7.0.0", + "@babel/preset-typescript": "^7.3.3", + "@types/enzyme": "^3.9.1", + "@types/jest": "^24.0.11", + "@types/react": "^16.8.13", + "@wessberg/rollup-plugin-ts": "^1.1.46", + "babel-jest": "^24.7.1", + "enzyme": "^3.9.0", + "enzyme-adapter-react-16": "^1.11.2", + "enzyme-to-json": "^3.3.5", + "jest": "^24.7.1", + "prop-types": "^15.6.0", + "raf": "^3.4.1", + "react": "^16.2.0", + "react-dom": "^16.2.0", + "rollup": "^1.10.0", + "rollup-plugin-commonjs": "^9.3.4", + "rollup-plugin-node-resolve": "^4.2.3", + "rollup-plugin-uglify": "^6.0.2" + }, + "files": [ + "dist/**" + ], + "homepage": "https://github.com/StringEpsilon/mini-create-react-context#readme", + "jest": { + "snapshotSerializers": [ + "enzyme-to-json/serializer" + ] + }, + "keywords": [ + "react", + "context", + "contextTypes", + "polyfill", + "ponyfill" + ], + "license": "MIT", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "name": "mini-create-react-context", + "peerDependencies": { + "prop-types": "^15.0.0", + "react": "^0.14.0 || ^15.0.0 || ^16.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/StringEpsilon/mini-create-react-context.git" + }, + "scripts": { + "build": "rollup -c rollup.config.js", + "prepublish": "npm run build", + "test": "jest" + }, + "types": "dist/index.d.ts", + "version": "0.3.2" +} diff --git a/node_modules/object-assign/index.js b/node_modules/object-assign/index.js new file mode 100644 index 00000000..0930cf88 --- /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 00000000..654d0bfe --- /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 00000000..2e6b249c --- /dev/null +++ b/node_modules/object-assign/package.json @@ -0,0 +1,74 @@ +{ + "_from": "object-assign@^4.1.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.1.1", + "name": "object-assign", + "escapedName": "object-assign", + "rawSpec": "^4.1.1", + "saveSpec": null, + "fetchSpec": "^4.1.1" + }, + "_requiredBy": [ + "/prop-types" + ], + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863", + "_spec": "object-assign@^4.1.1", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/prop-types", + "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 00000000..1be09d35 --- /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/path-to-regexp/History.md b/node_modules/path-to-regexp/History.md new file mode 100644 index 00000000..6672e788 --- /dev/null +++ b/node_modules/path-to-regexp/History.md @@ -0,0 +1,153 @@ +1.6.0 / 2016-10-03 +================== + + * Populate `RegExp.keys` when using the `tokensToRegExp` method (making it consistent with the main export) + * Allow a `delimiter` option to be passed in with `parse` + * Updated TypeScript definition with `Keys` and `Options` updated + +1.5.3 / 2016-06-15 +================== + + * Add `\\` to the ignore character group to avoid backtracking on mismatched parens + +1.5.2 / 2016-06-15 +================== + + * Escape `\\` in string segments of regexp + +1.5.1 / 2016-06-08 +================== + + * Add `index.d.ts` to NPM package + +1.5.0 / 2016-05-20 +================== + + * Handle partial token segments (better) + * Allow compile to handle asterisk token segments + +1.4.0 / 2016-05-18 +================== + + * Handle RegExp unions in path matching groups + +1.3.0 / 2016-05-08 +================== + + * Clarify README language and named parameter token support + * Support advanced Closure Compiler with type annotations + * Add pretty paths options to compiled function output + * Add TypeScript definition to project + * Improved prefix handling with non-complete segment parameters (E.g. `/:foo?-bar`) + +1.2.1 / 2015-08-17 +================== + + * Encode values before validation with path compilation function + * More examples of using compilation in README + +1.2.0 / 2015-05-20 +================== + + * Add support for matching an asterisk (`*`) as an unnamed match everything group (`(.*)`) + +1.1.1 / 2015-05-11 +================== + + * Expose methods for working with path tokens + +1.1.0 / 2015-05-09 +================== + + * Expose the parser implementation to consumers + * Implement a compiler function to generate valid strings + * Huge refactor of tests to be more DRY and cover new parse and compile functions + * Use chai in tests + * Add .editorconfig + +1.0.3 / 2015-01-17 +================== + + * Optimised function runtime + * Added `files` to `package.json` + +1.0.2 / 2014-12-17 +================== + + * Use `Array.isArray` shim + * Remove ES5 incompatible code + * Fixed repository path + * Added new readme badges + +1.0.1 / 2014-08-27 +================== + + * Ensure installation works correctly on 0.8 + +1.0.0 / 2014-08-17 +================== + + * No more API changes + +0.2.5 / 2014-08-07 +================== + + * Allow keys parameter to be omitted + +0.2.4 / 2014-08-02 +================== + + * Code coverage badge + * Updated readme + * Attach keys to the generated regexp + +0.2.3 / 2014-07-09 +================== + + * Add MIT license + +0.2.2 / 2014-07-06 +================== + + * A passed in trailing slash in non-strict mode will become optional + * In non-end mode, the optional trailing slash will only match at the end + +0.2.1 / 2014-06-11 +================== + + * Fixed a major capturing group regexp regression + +0.2.0 / 2014-06-09 +================== + + * Improved support for arrays + * Improved support for regexps + * Better support for non-ending strict mode matches with a trailing slash + * Travis CI support + * Block using regexp special characters in the path + * Removed support for the asterisk to match all + * New support for parameter suffixes - `*`, `+` and `?` + * Updated readme + * Provide delimiter information with keys array + +0.1.2 / 2014-03-10 +================== + + * Move testing dependencies to `devDependencies` + +0.1.1 / 2014-03-10 +================== + + * Match entire substring with `options.end` + * Properly handle ending and non-ending matches + +0.1.0 / 2014-03-06 +================== + + * Add `options.end` + +0.0.2 / 2013-02-10 +================== + + * Update to match current express + * Add .license property to component.json diff --git a/node_modules/path-to-regexp/LICENSE b/node_modules/path-to-regexp/LICENSE new file mode 100644 index 00000000..983fbe8a --- /dev/null +++ b/node_modules/path-to-regexp/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Blake Embrey (hello@blakeembrey.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-to-regexp/Readme.md b/node_modules/path-to-regexp/Readme.md new file mode 100644 index 00000000..379ecf4b --- /dev/null +++ b/node_modules/path-to-regexp/Readme.md @@ -0,0 +1,257 @@ +# Path-to-RegExp + +> Turn an Express-style path string such as `/user/:name` into a regular expression. + +[![NPM version][npm-image]][npm-url] +[![Build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Dependency Status][david-image]][david-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +## Installation + +``` +npm install path-to-regexp --save +``` + +## Usage + +```javascript +var pathToRegexp = require('path-to-regexp') + +// pathToRegexp(path, keys, options) +// pathToRegexp.parse(path) +// pathToRegexp.compile(path) +``` + +- **path** An Express-style string, an array of strings, or a regular expression. +- **keys** An array to be populated with the keys found in the path. +- **options** + - **sensitive** When `true` the route will be case sensitive. (default: `false`) + - **strict** When `false` the trailing slash is optional. (default: `false`) + - **end** When `false` the path will match at the beginning. (default: `true`) + - **delimiter** Set the default delimiter for repeat parameters. (default: `'/'`) + +```javascript +var keys = [] +var re = pathToRegexp('/foo/:bar', keys) +// re = /^\/foo\/([^\/]+?)\/?$/i +// keys = [{ name: 'bar', prefix: '/', delimiter: '/', optional: false, repeat: false, pattern: '[^\\/]+?' }] +``` + +**Please note:** The `RegExp` returned by `path-to-regexp` is intended for use with pathnames or hostnames. It can not handle the query strings or fragments of a URL. + +### Parameters + +The path string can be used to define parameters and populate the keys. + +#### Named Parameters + +Named parameters are defined by prefixing a colon to the parameter name (`:foo`). By default, the parameter will match until the following path segment. + +```js +var re = pathToRegexp('/:foo/:bar', keys) +// keys = [{ name: 'foo', prefix: '/', ... }, { name: 'bar', prefix: '/', ... }] + +re.exec('/test/route') +//=> ['/test/route', 'test', 'route'] +``` + +**Please note:** Named parameters must be made up of "word characters" (`[A-Za-z0-9_]`). + +```js +var re = pathToRegexp('/(apple-)?icon-:res(\\d+).png', keys) +// keys = [{ name: 0, prefix: '/', ... }, { name: 'res', prefix: '', ... }] + +re.exec('/icon-76.png') +//=> ['/icon-76.png', undefined, '76'] +``` + +#### Modified Parameters + +##### Optional + +Parameters can be suffixed with a question mark (`?`) to make the parameter optional. This will also make the prefix optional. + +```js +var re = pathToRegexp('/:foo/:bar?', keys) +// keys = [{ name: 'foo', ... }, { name: 'bar', delimiter: '/', optional: true, repeat: false }] + +re.exec('/test') +//=> ['/test', 'test', undefined] + +re.exec('/test/route') +//=> ['/test', 'test', 'route'] +``` + +##### Zero or more + +Parameters can be suffixed with an asterisk (`*`) to denote a zero or more parameter matches. The prefix is taken into account for each match. + +```js +var re = pathToRegexp('/:foo*', keys) +// keys = [{ name: 'foo', delimiter: '/', optional: true, repeat: true }] + +re.exec('/') +//=> ['/', undefined] + +re.exec('/bar/baz') +//=> ['/bar/baz', 'bar/baz'] +``` + +##### One or more + +Parameters can be suffixed with a plus sign (`+`) to denote a one or more parameter matches. The prefix is taken into account for each match. + +```js +var re = pathToRegexp('/:foo+', keys) +// keys = [{ name: 'foo', delimiter: '/', optional: false, repeat: true }] + +re.exec('/') +//=> null + +re.exec('/bar/baz') +//=> ['/bar/baz', 'bar/baz'] +``` + +#### Custom Match Parameters + +All parameters can be provided a custom regexp, which overrides the default (`[^\/]+`). + +```js +var re = pathToRegexp('/:foo(\\d+)', keys) +// keys = [{ name: 'foo', ... }] + +re.exec('/123') +//=> ['/123', '123'] + +re.exec('/abc') +//=> null +``` + +**Please note:** Backslashes need to be escaped with another backslash in strings. + +#### Unnamed Parameters + +It is possible to write an unnamed parameter that only consists of a matching group. It works the same as a named parameter, except it will be numerically indexed. + +```js +var re = pathToRegexp('/:foo/(.*)', keys) +// keys = [{ name: 'foo', ... }, { name: 0, ... }] + +re.exec('/test/route') +//=> ['/test/route', 'test', 'route'] +``` + +#### Asterisk + +An asterisk can be used for matching everything. It is equivalent to an unnamed matching group of `(.*)`. + +```js +var re = pathToRegexp('/foo/*', keys) +// keys = [{ name: '0', ... }] + +re.exec('/foo/bar/baz') +//=> ['/foo/bar/baz', 'bar/baz'] +``` + +### Parse + +The parse function is exposed via `pathToRegexp.parse`. This will return an array of strings and keys. + +```js +var tokens = pathToRegexp.parse('/route/:foo/(.*)') + +console.log(tokens[0]) +//=> "/route" + +console.log(tokens[1]) +//=> { name: 'foo', prefix: '/', delimiter: '/', optional: false, repeat: false, pattern: '[^\\/]+?' } + +console.log(tokens[2]) +//=> { name: 0, prefix: '/', delimiter: '/', optional: false, repeat: false, pattern: '.*' } +``` + +**Note:** This method only works with Express-style strings. + +### Compile ("Reverse" Path-To-RegExp) + +Path-To-RegExp exposes a compile function for transforming an Express-style path into a valid path. + +```js +var toPath = pathToRegexp.compile('/user/:id') + +toPath({ id: 123 }) //=> "/user/123" +toPath({ id: 'café' }) //=> "/user/caf%C3%A9" +toPath({ id: '/' }) //=> "/user/%2F" + +toPath({ id: ':' }) //=> "/user/%3A" +toPath({ id: ':' }, { pretty: true }) //=> "/user/:" + +var toPathRepeated = pathToRegexp.compile('/:segment+') + +toPathRepeated({ segment: 'foo' }) //=> "/foo" +toPathRepeated({ segment: ['a', 'b', 'c'] }) //=> "/a/b/c" + +var toPathRegexp = pathToRegexp.compile('/user/:id(\\d+)') + +toPathRegexp({ id: 123 }) //=> "/user/123" +toPathRegexp({ id: '123' }) //=> "/user/123" +toPathRegexp({ id: 'abc' }) //=> Throws `TypeError`. +``` + +**Note:** The generated function will throw on invalid input. It will do all necessary checks to ensure the generated path is valid. This method only works with strings. + +### Working with Tokens + +Path-To-RegExp exposes the two functions used internally that accept an array of tokens. + +* `pathToRegexp.tokensToRegExp(tokens, options)` Transform an array of tokens into a matching regular expression. +* `pathToRegexp.tokensToFunction(tokens)` Transform an array of tokens into a path generator function. + +#### Token Information + +* `name` The name of the token (`string` for named or `number` for index) +* `prefix` The prefix character for the segment (`/` or `.`) +* `delimiter` The delimiter for the segment (same as prefix or `/`) +* `optional` Indicates the token is optional (`boolean`) +* `repeat` Indicates the token is repeated (`boolean`) +* `partial` Indicates this token is a partial path segment (`boolean`) +* `pattern` The RegExp used to match this token (`string`) +* `asterisk` Indicates the token is an `*` match (`boolean`) + +## Compatibility with Express <= 4.x + +Path-To-RegExp breaks compatibility with Express <= `4.x`: + +* No longer a direct conversion to a RegExp with sugar on top - it's a path matcher with named and unnamed matching groups + * It's unlikely you previously abused this feature, it's rare and you could always use a RegExp instead +* All matching RegExp special characters can be used in a matching group. E.g. `/:user(.*)` + * Other RegExp features are not support - no nested matching groups, non-capturing groups or look aheads +* Parameters have suffixes that augment meaning - `*`, `+` and `?`. E.g. `/:user*` + +## TypeScript + +Includes a [`.d.ts`](index.d.ts) file for TypeScript users. + +## Live Demo + +You can see a live demo of this library in use at [express-route-tester](http://forbeslindesay.github.com/express-route-tester/). + +## License + +MIT + +[npm-image]: https://img.shields.io/npm/v/path-to-regexp.svg?style=flat +[npm-url]: https://npmjs.org/package/path-to-regexp +[travis-image]: https://img.shields.io/travis/pillarjs/path-to-regexp.svg?style=flat +[travis-url]: https://travis-ci.org/pillarjs/path-to-regexp +[coveralls-image]: https://img.shields.io/coveralls/pillarjs/path-to-regexp.svg?style=flat +[coveralls-url]: https://coveralls.io/r/pillarjs/path-to-regexp?branch=master +[david-image]: http://img.shields.io/david/pillarjs/path-to-regexp.svg?style=flat +[david-url]: https://david-dm.org/pillarjs/path-to-regexp +[license-image]: http://img.shields.io/npm/l/path-to-regexp.svg?style=flat +[license-url]: LICENSE.md +[downloads-image]: http://img.shields.io/npm/dm/path-to-regexp.svg?style=flat +[downloads-url]: https://npmjs.org/package/path-to-regexp diff --git a/node_modules/path-to-regexp/index.d.ts b/node_modules/path-to-regexp/index.d.ts new file mode 100644 index 00000000..705da2d0 --- /dev/null +++ b/node_modules/path-to-regexp/index.d.ts @@ -0,0 +1,77 @@ +declare function pathToRegexp (path: pathToRegexp.Path, options?: pathToRegexp.RegExpOptions & pathToRegexp.ParseOptions): pathToRegexp.PathRegExp; +declare function pathToRegexp (path: pathToRegexp.Path, keys?: pathToRegexp.Key[], options?: pathToRegexp.RegExpOptions & pathToRegexp.ParseOptions): pathToRegexp.PathRegExp; + +declare namespace pathToRegexp { + export interface PathRegExp extends RegExp { + // An array to be populated with the keys found in the path. + keys: Key[]; + } + + export interface RegExpOptions { + /** + * When `true` the route will be case sensitive. (default: `false`) + */ + sensitive?: boolean; + /** + * When `false` the trailing slash is optional. (default: `false`) + */ + strict?: boolean; + /** + * When `false` the path will match at the beginning. (default: `true`) + */ + end?: boolean; + /** + * Sets the final character for non-ending optimistic matches. (default: `/`) + */ + delimiter?: string; + } + + export interface ParseOptions { + /** + * Set the default delimiter for repeat parameters. (default: `'/'`) + */ + delimiter?: string; + } + + /** + * Parse an Express-style path into an array of tokens. + */ + export function parse (path: string, options?: ParseOptions): Token[]; + + /** + * Transforming an Express-style path into a valid path. + */ + export function compile (path: string, options?: ParseOptions): PathFunction; + + /** + * Transform an array of tokens into a path generator function. + */ + export function tokensToFunction (tokens: Token[]): PathFunction; + + /** + * Transform an array of tokens into a matching regular expression. + */ + export function tokensToRegExp (tokens: Token[], options?: RegExpOptions): PathRegExp; + export function tokensToRegExp (tokens: Token[], keys?: Key[], options?: RegExpOptions): PathRegExp; + + export interface Key { + name: string | number; + prefix: string; + delimiter: string; + optional: boolean; + repeat: boolean; + pattern: string; + partial: boolean; + asterisk: boolean; + } + + interface PathFunctionOptions { + pretty?: boolean; + } + + export type Token = string | Key; + export type Path = string | RegExp | Array; + export type PathFunction = (data?: Object, options?: PathFunctionOptions) => string; +} + +export = pathToRegexp; diff --git a/node_modules/path-to-regexp/index.js b/node_modules/path-to-regexp/index.js new file mode 100644 index 00000000..63e34163 --- /dev/null +++ b/node_modules/path-to-regexp/index.js @@ -0,0 +1,426 @@ +var isarray = require('isarray') + +/** + * Expose `pathToRegexp`. + */ +module.exports = pathToRegexp +module.exports.parse = parse +module.exports.compile = compile +module.exports.tokensToFunction = tokensToFunction +module.exports.tokensToRegExp = tokensToRegExp + +/** + * The main path matching regexp utility. + * + * @type {RegExp} + */ +var PATH_REGEXP = new RegExp([ + // Match escaped characters that would otherwise appear in future matches. + // This allows the user to escape special characters that won't transform. + '(\\\\.)', + // Match Express-style parameters and un-named parameters with a prefix + // and optional suffixes. Matches appear as: + // + // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] + // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] + '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' +].join('|'), 'g') + +/** + * Parse a string for the raw tokens. + * + * @param {string} str + * @param {Object=} options + * @return {!Array} + */ +function parse (str, options) { + var tokens = [] + var key = 0 + var index = 0 + var path = '' + var defaultDelimiter = options && options.delimiter || '/' + var res + + while ((res = PATH_REGEXP.exec(str)) != null) { + var m = res[0] + var escaped = res[1] + var offset = res.index + path += str.slice(index, offset) + index = offset + m.length + + // Ignore already escaped sequences. + if (escaped) { + path += escaped[1] + continue + } + + var next = str[index] + var prefix = res[2] + var name = res[3] + var capture = res[4] + var group = res[5] + var modifier = res[6] + var asterisk = res[7] + + // Push the current path onto the tokens. + if (path) { + tokens.push(path) + path = '' + } + + var partial = prefix != null && next != null && next !== prefix + var repeat = modifier === '+' || modifier === '*' + var optional = modifier === '?' || modifier === '*' + var delimiter = res[2] || defaultDelimiter + var pattern = capture || group + + tokens.push({ + name: name || key++, + prefix: prefix || '', + delimiter: delimiter, + optional: optional, + repeat: repeat, + partial: partial, + asterisk: !!asterisk, + pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') + }) + } + + // Match any characters still remaining. + if (index < str.length) { + path += str.substr(index) + } + + // If the path exists, push it onto the end. + if (path) { + tokens.push(path) + } + + return tokens +} + +/** + * Compile a string to a template function for the path. + * + * @param {string} str + * @param {Object=} options + * @return {!function(Object=, Object=)} + */ +function compile (str, options) { + return tokensToFunction(parse(str, options)) +} + +/** + * Prettier encoding of URI path segments. + * + * @param {string} + * @return {string} + */ +function encodeURIComponentPretty (str) { + return encodeURI(str).replace(/[\/?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +/** + * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. + * + * @param {string} + * @return {string} + */ +function encodeAsterisk (str) { + return encodeURI(str).replace(/[?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +/** + * Expose a method for transforming tokens into the path function. + */ +function tokensToFunction (tokens) { + // Compile all the tokens into regexps. + var matches = new Array(tokens.length) + + // Compile all the patterns before compilation. + for (var i = 0; i < tokens.length; i++) { + if (typeof tokens[i] === 'object') { + matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$') + } + } + + return function (obj, opts) { + var path = '' + var data = obj || {} + var options = opts || {} + var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i] + + if (typeof token === 'string') { + path += token + + continue + } + + var value = data[token.name] + var segment + + if (value == null) { + if (token.optional) { + // Prepend partial segment prefixes. + if (token.partial) { + path += token.prefix + } + + continue + } else { + throw new TypeError('Expected "' + token.name + '" to be defined') + } + } + + if (isarray(value)) { + if (!token.repeat) { + throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') + } + + if (value.length === 0) { + if (token.optional) { + continue + } else { + throw new TypeError('Expected "' + token.name + '" to not be empty') + } + } + + for (var j = 0; j < value.length; j++) { + segment = encode(value[j]) + + if (!matches[i].test(segment)) { + throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') + } + + path += (j === 0 ? token.prefix : token.delimiter) + segment + } + + continue + } + + segment = token.asterisk ? encodeAsterisk(value) : encode(value) + + if (!matches[i].test(segment)) { + throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') + } + + path += token.prefix + segment + } + + return path + } +} + +/** + * Escape a regular expression string. + * + * @param {string} str + * @return {string} + */ +function escapeString (str) { + return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') +} + +/** + * Escape the capturing group by escaping special characters and meaning. + * + * @param {string} group + * @return {string} + */ +function escapeGroup (group) { + return group.replace(/([=!:$\/()])/g, '\\$1') +} + +/** + * Attach the keys as a property of the regexp. + * + * @param {!RegExp} re + * @param {Array} keys + * @return {!RegExp} + */ +function attachKeys (re, keys) { + re.keys = keys + return re +} + +/** + * Get the flags for a regexp from the options. + * + * @param {Object} options + * @return {string} + */ +function flags (options) { + return options.sensitive ? '' : 'i' +} + +/** + * Pull out keys from a regexp. + * + * @param {!RegExp} path + * @param {!Array} keys + * @return {!RegExp} + */ +function regexpToRegexp (path, keys) { + // Use a negative lookahead to match only capturing groups. + var groups = path.source.match(/\((?!\?)/g) + + if (groups) { + for (var i = 0; i < groups.length; i++) { + keys.push({ + name: i, + prefix: null, + delimiter: null, + optional: false, + repeat: false, + partial: false, + asterisk: false, + pattern: null + }) + } + } + + return attachKeys(path, keys) +} + +/** + * Transform an array into a regexp. + * + * @param {!Array} path + * @param {Array} keys + * @param {!Object} options + * @return {!RegExp} + */ +function arrayToRegexp (path, keys, options) { + var parts = [] + + for (var i = 0; i < path.length; i++) { + parts.push(pathToRegexp(path[i], keys, options).source) + } + + var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)) + + return attachKeys(regexp, keys) +} + +/** + * Create a path regexp from string input. + * + * @param {string} path + * @param {!Array} keys + * @param {!Object} options + * @return {!RegExp} + */ +function stringToRegexp (path, keys, options) { + return tokensToRegExp(parse(path, options), keys, options) +} + +/** + * Expose a function for taking tokens and returning a RegExp. + * + * @param {!Array} tokens + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ +function tokensToRegExp (tokens, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options) + keys = [] + } + + options = options || {} + + var strict = options.strict + var end = options.end !== false + var route = '' + + // Iterate over the tokens and create our regexp string. + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i] + + if (typeof token === 'string') { + route += escapeString(token) + } else { + var prefix = escapeString(token.prefix) + var capture = '(?:' + token.pattern + ')' + + keys.push(token) + + if (token.repeat) { + capture += '(?:' + prefix + capture + ')*' + } + + if (token.optional) { + if (!token.partial) { + capture = '(?:' + prefix + '(' + capture + '))?' + } else { + capture = prefix + '(' + capture + ')?' + } + } else { + capture = prefix + '(' + capture + ')' + } + + route += capture + } + } + + var delimiter = escapeString(options.delimiter || '/') + var endsWithDelimiter = route.slice(-delimiter.length) === delimiter + + // In non-strict mode we allow a slash at the end of match. If the path to + // match already ends with a slash, we remove it for consistency. The slash + // is valid at the end of a path match, not in the middle. This is important + // in non-ending mode, where "/test/" shouldn't match "/test//route". + if (!strict) { + route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?' + } + + if (end) { + route += '$' + } else { + // In non-ending mode, we need the capturing groups to match as much as + // possible by using a positive lookahead to the end or next path segment. + route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)' + } + + return attachKeys(new RegExp('^' + route, flags(options)), keys) +} + +/** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + * + * @param {(string|RegExp|Array)} path + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ +function pathToRegexp (path, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options) + keys = [] + } + + options = options || {} + + if (path instanceof RegExp) { + return regexpToRegexp(path, /** @type {!Array} */ (keys)) + } + + if (isarray(path)) { + return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) + } + + return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) +} diff --git a/node_modules/path-to-regexp/package.json b/node_modules/path-to-regexp/package.json new file mode 100644 index 00000000..d8002ae8 --- /dev/null +++ b/node_modules/path-to-regexp/package.json @@ -0,0 +1,76 @@ +{ + "_from": "path-to-regexp@^1.7.0", + "_id": "path-to-regexp@1.7.0", + "_inBundle": false, + "_integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "_location": "/path-to-regexp", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-to-regexp@^1.7.0", + "name": "path-to-regexp", + "escapedName": "path-to-regexp", + "rawSpec": "^1.7.0", + "saveSpec": null, + "fetchSpec": "^1.7.0" + }, + "_requiredBy": [ + "/react-router" + ], + "_resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "_shasum": "59fde0f435badacba103a84e9d3bc64e96b9937d", + "_spec": "path-to-regexp@^1.7.0", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/react-router", + "bugs": { + "url": "https://github.com/pillarjs/path-to-regexp/issues" + }, + "bundleDependencies": false, + "component": { + "scripts": { + "path-to-regexp": "index.js" + } + }, + "dependencies": { + "isarray": "0.0.1" + }, + "deprecated": false, + "description": "Express style path to RegExp utility", + "devDependencies": { + "chai": "^2.3.0", + "istanbul": "~0.3.0", + "mocha": "~2.2.4", + "standard": "~3.7.3", + "ts-node": "^0.5.5", + "typescript": "^1.8.7", + "typings": "^1.0.4" + }, + "files": [ + "index.js", + "index.d.ts", + "LICENSE" + ], + "homepage": "https://github.com/pillarjs/path-to-regexp#readme", + "keywords": [ + "express", + "regexp", + "route", + "routing" + ], + "license": "MIT", + "main": "index.js", + "name": "path-to-regexp", + "repository": { + "type": "git", + "url": "git+https://github.com/pillarjs/path-to-regexp.git" + }, + "scripts": { + "lint": "standard", + "prepublish": "typings install", + "test": "npm run lint && npm run test-cov", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require ts-node/register -R spec test.ts", + "test-spec": "mocha --require ts-node/register -R spec --bail test.ts" + }, + "typings": "index.d.ts", + "version": "1.7.0" +} diff --git a/node_modules/prop-types/CHANGELOG.md b/node_modules/prop-types/CHANGELOG.md new file mode 100644 index 00000000..025d2f40 --- /dev/null +++ b/node_modules/prop-types/CHANGELOG.md @@ -0,0 +1,92 @@ +## 15.7.2 +* [Fix] ensure nullish values in `oneOf` do not crash ([#256](https://github.com/facebook/prop-types/issues/256)) +* [Fix] move `loose-envify` back to production deps, for browerify usage ([#203](https://github.com/facebook/prop-types/issues/203)) + +## 15.7.1 +* [Fix] avoid template literal syntax ([#255](https://github.com/facebook/prop-types/issues/255), [#254](https://github.com/facebook/prop-types/issues/254)) + +## 15.7.0 +* [New] Add `.elementType` ([#211](https://github.com/facebook/prop-types/pull/211)) +* [New] add `PropTypes.resetWarningCache` ([#178](https://github.com/facebook/prop-types/pull/178)) +* `oneOf`: improve warning when multiple arguments are supplied ([#244](https://github.com/facebook/prop-types/pull/244)) +* Fix `oneOf` when used with Symbols ([#224](https://github.com/facebook/prop-types/pull/224)) +* Avoid relying on `hasOwnProperty` being present on values' prototypes ([#112](https://github.com/facebook/prop-types/pull/112), [#187](https://github.com/facebook/prop-types/pull/187)) +* Improve readme ([#248](https://github.com/facebook/prop-types/pull/248), [#233](https://github.com/facebook/prop-types/pull/233)) +* Clean up mistaken runtime dep, swap envify for loose-envify ([#204](https://github.com/facebook/prop-types/pull/204)) + +## 15.6.2 +* Remove the `fbjs` dependency by inlining some helpers from it ([#194](https://github.com/facebook/prop-types/pull/194))) + +## 15.6.1 +* Fix an issue where outdated BSD license headers were still present in the published bundle [#162](https://github.com/facebook/prop-types/issues/162) + +## 15.6.0 + +* Switch from BSD + Patents to MIT license +* Add PropTypes.exact, like PropTypes.shape but warns on extra object keys. ([@thejameskyle](https://github.com/thejameskyle) and [@aweary](https://github.com/aweary) in [#41](https://github.com/facebook/prop-types/pull/41) and [#87](https://github.com/facebook/prop-types/pull/87)) + +## 15.5.10 + +* Fix a false positive warning when using a production UMD build of a third-party library with a DEV version of React. ([@gaearon](https://github.com/gaearon) in [#50](https://github.com/facebook/prop-types/pull/50)) + +## 15.5.9 + +* Add `loose-envify` Browserify transform for users who don't envify globally. ([@mridgway](https://github.com/mridgway) in [#45](https://github.com/facebook/prop-types/pull/45)) + +## 15.5.8 + +* Limit the manual PropTypes call warning count because it has false positives with React versions earlier than 15.2.0 in the 15.x branch and 0.14.9 in the 0.14.x branch. ([@gaearon](https://github.com/gaearon) in [#26](https://github.com/facebook/prop-types/pull/26)) + +## 15.5.7 + +* **Critical Bugfix:** Fix an accidental breaking change that caused errors in production when used through `React.PropTypes`. ([@gaearon](https://github.com/gaearon) in [#20](https://github.com/facebook/prop-types/pull/20)) +* Improve the size of production UMD build. ([@aweary](https://github.com/aweary) in [38ba18](https://github.com/facebook/prop-types/commit/38ba18a4a8f705f4b2b33c88204573ddd604f2d6) and [7882a7](https://github.com/facebook/prop-types/commit/7882a7285293db5f284bcf559b869fd2cd4c44d4)) + +## 15.5.6 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Fix a markdown issue in README. ([@bvaughn](https://github.com/bvaughn) in [174f77](https://github.com/facebook/prop-types/commit/174f77a50484fa628593e84b871fb40eed78b69a)) + +## 15.5.5 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Add missing documentation and license files. ([@bvaughn](https://github.com/bvaughn) in [0a53d3](https://github.com/facebook/prop-types/commit/0a53d3a34283ae1e2d3aa396632b6dc2a2061e6a)) + +## 15.5.4 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Reduce the size of the UMD Build. ([@acdlite](https://github.com/acdlite) in [31e9344](https://github.com/facebook/prop-types/commit/31e9344ca3233159928da66295da17dad82db1a8)) +* Remove bad package url. ([@ljharb](https://github.com/ljharb) in [158198f](https://github.com/facebook/prop-types/commit/158198fd6c468a3f6f742e0e355e622b3914048a)) +* Remove the accidentally included typechecking code from the production build. + +## 15.5.3 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Remove the accidentally included React package code from the UMD bundle. ([@acdlite](https://github.com/acdlite) in [df318bb](https://github.com/facebook/prop-types/commit/df318bba8a89bc5aadbb0292822cf4ed71d27ace)) + +## 15.5.2 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Remove dependency on React for CommonJS entry point. ([@acdlite](https://github.com/acdlite) in [cae72bb](https://github.com/facebook/prop-types/commit/cae72bb281a3766c765e3624f6088c3713567e6d)) + + +## 15.5.1 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Remove accidental uncompiled ES6 syntax in the published package. ([@acdlite](https://github.com/acdlite) in [e191963](https://github.com/facebook/react/commit/e1919638b39dd65eedd250a8bb649773ca61b6f1)) + +## 15.5.0 + +**Note: this release has a critical issue and was deprecated. Please update to 15.5.7 or higher.** + +* Initial release. + +## Before 15.5.0 + +PropTypes was previously included in React, but is now a separate package. For earlier history of PropTypes [see the React change log.](https://github.com/facebook/react/blob/master/CHANGELOG.md) diff --git a/node_modules/prop-types/LICENSE b/node_modules/prop-types/LICENSE new file mode 100644 index 00000000..188fb2b0 --- /dev/null +++ b/node_modules/prop-types/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013-present, Facebook, 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/prop-types/README.md b/node_modules/prop-types/README.md new file mode 100644 index 00000000..1a23c9d9 --- /dev/null +++ b/node_modules/prop-types/README.md @@ -0,0 +1,296 @@ +# prop-types [![Build Status](https://travis-ci.com/facebook/prop-types.svg?branch=master)](https://travis-ci.org/facebook/prop-types) + +Runtime type checking for React props and similar objects. + +You can use prop-types to document the intended types of properties passed to +components. React (and potentially other libraries—see the checkPropTypes() +reference below) will check props passed to your components against those +definitions, and warn in development if they don’t match. + +## Installation + +```shell +npm install --save prop-types +``` + +## Importing + +```js +import PropTypes from 'prop-types'; // ES6 +var PropTypes = require('prop-types'); // ES5 with npm +``` + +### CDN + +If you prefer to exclude `prop-types` from your application and use it +globally via `window.PropTypes`, the `prop-types` package provides +single-file distributions, which are hosted on the following CDNs: + +* [**unpkg**](https://unpkg.com/prop-types/) +```html + + + + + +``` + +* [**cdnjs**](https://cdnjs.com/libraries/prop-types) +```html + + + + + +``` + +To load a specific version of `prop-types` replace `15.6.0` with the version number. + +## Usage + +PropTypes was originally exposed as part of the React core module, and is +commonly used with React components. +Here is an example of using PropTypes with a React component, which also +documents the different validators provided: + +```js +import React from 'react'; +import PropTypes from 'prop-types'; + +class MyComponent extends React.Component { + render() { + // ... do things with the props + } +} + +MyComponent.propTypes = { + // You can declare that a prop is a specific JS primitive. By default, these + // are all optional. + optionalArray: PropTypes.array, + optionalBool: PropTypes.bool, + optionalFunc: PropTypes.func, + optionalNumber: PropTypes.number, + optionalObject: PropTypes.object, + optionalString: PropTypes.string, + optionalSymbol: PropTypes.symbol, + + // Anything that can be rendered: numbers, strings, elements or an array + // (or fragment) containing these types. + optionalNode: PropTypes.node, + + // A React element (ie. ). + optionalElement: PropTypes.element, + + // A React element type (ie. MyComponent). + optionalElementType: PropTypes.elementType, + + // You can also declare that a prop is an instance of a class. This uses + // JS's instanceof operator. + optionalMessage: PropTypes.instanceOf(Message), + + // You can ensure that your prop is limited to specific values by treating + // it as an enum. + optionalEnum: PropTypes.oneOf(['News', 'Photos']), + + // An object that could be one of many types + optionalUnion: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.number, + PropTypes.instanceOf(Message) + ]), + + // An array of a certain type + optionalArrayOf: PropTypes.arrayOf(PropTypes.number), + + // An object with property values of a certain type + optionalObjectOf: PropTypes.objectOf(PropTypes.number), + + // You can chain any of the above with `isRequired` to make sure a warning + // is shown if the prop isn't provided. + + // An object taking on a particular shape + optionalObjectWithShape: PropTypes.shape({ + optionalProperty: PropTypes.string, + requiredProperty: PropTypes.number.isRequired + }), + + // An object with warnings on extra properties + optionalObjectWithStrictShape: PropTypes.exact({ + optionalProperty: PropTypes.string, + requiredProperty: PropTypes.number.isRequired + }), + + requiredFunc: PropTypes.func.isRequired, + + // A value of any data type + requiredAny: PropTypes.any.isRequired, + + // You can also specify a custom validator. It should return an Error + // object if the validation fails. Don't `console.warn` or throw, as this + // won't work inside `oneOfType`. + customProp: function(props, propName, componentName) { + if (!/matchme/.test(props[propName])) { + return new Error( + 'Invalid prop `' + propName + '` supplied to' + + ' `' + componentName + '`. Validation failed.' + ); + } + }, + + // You can also supply a custom validator to `arrayOf` and `objectOf`. + // It should return an Error object if the validation fails. The validator + // will be called for each key in the array or object. The first two + // arguments of the validator are the array or object itself, and the + // current item's key. + customArrayProp: PropTypes.arrayOf(function(propValue, key, componentName, location, propFullName) { + if (!/matchme/.test(propValue[key])) { + return new Error( + 'Invalid prop `' + propFullName + '` supplied to' + + ' `' + componentName + '`. Validation failed.' + ); + } + }) +}; +``` + +Refer to the [React documentation](https://facebook.github.io/react/docs/typechecking-with-proptypes.html) for more information. + +## Migrating from React.PropTypes + +Check out [Migrating from React.PropTypes](https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes) for details on how to migrate to `prop-types` from `React.PropTypes`. + +Note that this blog posts **mentions a codemod script that performs the conversion automatically**. + +There are also important notes below. + +## How to Depend on This Package? + +For apps, we recommend putting it in `dependencies` with a caret range. +For example: + +```js + "dependencies": { + "prop-types": "^15.5.7" + } +``` + +For libraries, we *also* recommend leaving it in `dependencies`: + +```js + "dependencies": { + "prop-types": "^15.5.7" + }, + "peerDependencies": { + "react": "^15.5.0" + } +``` + +**Note:** there are known issues in versions before 15.5.7 so we recommend using it as the minimal version. + +Make sure that the version range uses a caret (`^`) and thus is broad enough for npm to efficiently deduplicate packages. + +For UMD bundles of your components, make sure you **don’t** include `PropTypes` in the build. Usually this is done by marking it as an external (the specifics depend on your bundler), just like you do with React. + +## Compatibility + +### React 0.14 + +This package is compatible with **React 0.14.9**. Compared to 0.14.8 (which was released in March of 2016), there are no other changes in 0.14.9, so it should be a painless upgrade. + +```shell +# ATTENTION: Only run this if you still use React 0.14! +npm install --save react@^0.14.9 react-dom@^0.14.9 +``` + +### React 15+ + +This package is compatible with **React 15.3.0** and higher. + +``` +npm install --save react@^15.3.0 react-dom@^15.3.0 +``` + +### What happens on other React versions? + +It outputs warnings with the message below even though the developer doesn’t do anything wrong. Unfortunately there is no solution for this other than updating React to either 15.3.0 or higher, or 0.14.9 if you’re using React 0.14. + +## Difference from `React.PropTypes`: Don’t Call Validator Functions + +First of all, **which version of React are you using**? You might be seeing this message because a component library has updated to use `prop-types` package, but your version of React is incompatible with it. See the [above section](#compatibility) for more details. + +Are you using either React 0.14.9 or a version higher than React 15.3.0? Read on. + +When you migrate components to use the standalone `prop-types`, **all validator functions will start throwing an error if you call them directly**. This makes sure that nobody relies on them in production code, and it is safe to strip their implementations to optimize the bundle size. + +Code like this is still fine: + +```js +MyComponent.propTypes = { + myProp: PropTypes.bool +}; +``` + +However, code like this will not work with the `prop-types` package: + +```js +// Will not work with `prop-types` package! +var errorOrNull = PropTypes.bool(42, 'myProp', 'MyComponent', 'prop'); +``` + +It will throw an error: + +``` +Calling PropTypes validators directly is not supported by the `prop-types` package. +Use PropTypes.checkPropTypes() to call them. +``` + +(If you see **a warning** rather than an error with this message, please check the [above section about compatibility](#compatibility).) + +This is new behavior, and you will only encounter it when you migrate from `React.PropTypes` to the `prop-types` package. For the vast majority of components, this doesn’t matter, and if you didn’t see [this warning](https://facebook.github.io/react/warnings/dont-call-proptypes.html) in your components, your code is safe to migrate. This is not a breaking change in React because you are only opting into this change for a component by explicitly changing your imports to use `prop-types`. If you temporarily need the old behavior, you can keep using `React.PropTypes` until React 16. + +**If you absolutely need to trigger the validation manually**, call `PropTypes.checkPropTypes()`. Unlike the validators themselves, this function is safe to call in production, as it will be replaced by an empty function: + +```js +// Works with standalone PropTypes +PropTypes.checkPropTypes(MyComponent.propTypes, props, 'prop', 'MyComponent'); +``` +See below for more info. + +**You might also see this error** if you’re calling a `PropTypes` validator from your own custom `PropTypes` validator. In this case, the fix is to make sure that you are passing *all* of the arguments to the inner function. There is a more in-depth explanation of how to fix it [on this page](https://facebook.github.io/react/warnings/dont-call-proptypes.html#fixing-the-false-positive-in-third-party-proptypes). Alternatively, you can temporarily keep using `React.PropTypes` until React 16, as it would still only warn in this case. + +If you use a bundler like Browserify or Webpack, don’t forget to [follow these instructions](https://reactjs.org/docs/optimizing-performance.html#use-the-production-build) to correctly bundle your application in development or production mode. Otherwise you’ll ship unnecessary code to your users. + +## PropTypes.checkPropTypes + +React will automatically check the propTypes you set on the component, but if +you are using PropTypes without React then you may want to manually call +`PropTypes.checkPropTypes`, like so: + +```js +const myPropTypes = { + name: PropTypes.string, + age: PropTypes.number, + // ... define your prop validations +}; + +const props = { + name: 'hello', // is valid + age: 'world', // not valid +}; + +// Let's say your component is called 'MyComponent' + +// Works with standalone PropTypes +PropTypes.checkPropTypes(myPropTypes, props, 'age', 'MyComponent'); +// This will warn as follows: +// Warning: Failed prop type: Invalid prop `age` of type `string` supplied to +// `MyComponent`, expected `number`. +``` + +## PropTypes.resetWarningCache() + +`PropTypes.checkPropTypes(...)` only `console.error.log(...)`s a given message once. To reset the cache while testing call `PropTypes.resetWarningCache()` + +### License + +prop-types is [MIT licensed](./LICENSE). diff --git a/node_modules/prop-types/checkPropTypes.js b/node_modules/prop-types/checkPropTypes.js new file mode 100644 index 00000000..49111df9 --- /dev/null +++ b/node_modules/prop-types/checkPropTypes.js @@ -0,0 +1,102 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var printWarning = function() {}; + +if (process.env.NODE_ENV !== 'production') { + var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + var loggedTypeFailures = {}; + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } +} + +/** + * Resets warning cache when testing. + * + * @private + */ +checkPropTypes.resetWarningCache = function() { + if (process.env.NODE_ENV !== 'production') { + loggedTypeFailures = {}; + } +} + +module.exports = checkPropTypes; diff --git a/node_modules/prop-types/factory.js b/node_modules/prop-types/factory.js new file mode 100644 index 00000000..abdf8e6d --- /dev/null +++ b/node_modules/prop-types/factory.js @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +// React 15.5 references this module, and assumes PropTypes are still callable in production. +// Therefore we re-export development-only version with all the PropTypes checks here. +// However if one is migrating to the `prop-types` npm library, they will go through the +// `index.js` entry point, and it will branch depending on the environment. +var factory = require('./factoryWithTypeCheckers'); +module.exports = function(isValidElement) { + // It is still allowed in 15.5. + var throwOnDirectAccess = false; + return factory(isValidElement, throwOnDirectAccess); +}; diff --git a/node_modules/prop-types/factoryWithThrowingShims.js b/node_modules/prop-types/factoryWithThrowingShims.js new file mode 100644 index 00000000..e5b2f9ce --- /dev/null +++ b/node_modules/prop-types/factoryWithThrowingShims.js @@ -0,0 +1,64 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + +function emptyFunction() {} +function emptyFunctionWithReset() {} +emptyFunctionWithReset.resetWarningCache = emptyFunction; + +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + elementType: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim, + + checkPropTypes: emptyFunctionWithReset, + resetWarningCache: emptyFunction + }; + + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; diff --git a/node_modules/prop-types/factoryWithTypeCheckers.js b/node_modules/prop-types/factoryWithTypeCheckers.js new file mode 100644 index 00000000..3711f0b6 --- /dev/null +++ b/node_modules/prop-types/factoryWithTypeCheckers.js @@ -0,0 +1,591 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var ReactIs = require('react-is'); +var assign = require('object-assign'); + +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); +var checkPropTypes = require('./checkPropTypes'); + +var has = Function.call.bind(Object.prototype.hasOwnProperty); +var printWarning = function() {}; + +if (process.env.NODE_ENV !== 'production') { + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} + +function emptyFunctionThatReturnsNull() { + return null; +} + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (process.env.NODE_ENV !== 'production') { + if (arguments.length > 1) { + printWarning( + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' + ); + } else { + printWarning('Invalid argument supplied to oneOf, expected an array.'); + } + } + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === 'symbol') { + return String(value); + } + return value; + }); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // falsy value can't be a Symbol + if (!propValue) { + return false; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; diff --git a/node_modules/prop-types/index.js b/node_modules/prop-types/index.js new file mode 100644 index 00000000..e9ef51d6 --- /dev/null +++ b/node_modules/prop-types/index.js @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +if (process.env.NODE_ENV !== 'production') { + var ReactIs = require('react-is'); + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = require('./factoryWithThrowingShims')(); +} diff --git a/node_modules/prop-types/lib/ReactPropTypesSecret.js b/node_modules/prop-types/lib/ReactPropTypesSecret.js new file mode 100644 index 00000000..f54525e7 --- /dev/null +++ b/node_modules/prop-types/lib/ReactPropTypesSecret.js @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; diff --git a/node_modules/prop-types/package.json b/node_modules/prop-types/package.json new file mode 100644 index 00000000..da0e3ae5 --- /dev/null +++ b/node_modules/prop-types/package.json @@ -0,0 +1,87 @@ +{ + "_from": "prop-types@^15.6.2", + "_id": "prop-types@15.7.2", + "_inBundle": false, + "_integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "_location": "/prop-types", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "prop-types@^15.6.2", + "name": "prop-types", + "escapedName": "prop-types", + "rawSpec": "^15.6.2", + "saveSpec": null, + "fetchSpec": "^15.6.2" + }, + "_requiredBy": [ + "/react-router", + "/react-router-dom" + ], + "_resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "_shasum": "52c41e75b8c87e72b9d9360e0206b99dcbffa6c5", + "_spec": "prop-types@^15.6.2", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/react-router-dom", + "browserify": { + "transform": [ + "loose-envify" + ] + }, + "bugs": { + "url": "https://github.com/facebook/prop-types/issues" + }, + "bundleDependencies": false, + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + }, + "deprecated": false, + "description": "Runtime type checking for React props and similar objects.", + "devDependencies": { + "babel-jest": "^19.0.0", + "babel-preset-react": "^6.24.1", + "browserify": "^16.2.3", + "bundle-collapser": "^1.2.1", + "eslint": "^5.13.0", + "jest": "^19.0.2", + "react": "^15.5.1", + "uglifyify": "^3.0.4", + "uglifyjs": "^2.4.10" + }, + "files": [ + "LICENSE", + "README.md", + "checkPropTypes.js", + "factory.js", + "factoryWithThrowingShims.js", + "factoryWithTypeCheckers.js", + "index.js", + "prop-types.js", + "prop-types.min.js", + "lib" + ], + "homepage": "https://facebook.github.io/react/", + "keywords": [ + "react" + ], + "license": "MIT", + "main": "index.js", + "name": "prop-types", + "repository": { + "type": "git", + "url": "git+https://github.com/facebook/prop-types.git" + }, + "scripts": { + "build": "yarn umd && yarn umd-min", + "lint": "eslint .", + "prepublish": "yarn build", + "pretest": "npm run lint", + "test": "npm run tests-only", + "tests-only": "jest", + "umd": "NODE_ENV=development browserify index.js -t loose-envify --standalone PropTypes -o prop-types.js", + "umd-min": "NODE_ENV=production browserify index.js -t loose-envify -t uglifyify --standalone PropTypes -p bundle-collapser/plugin -o | uglifyjs --compress unused,dead_code -o prop-types.min.js" + }, + "version": "15.7.2" +} diff --git a/node_modules/prop-types/prop-types.js b/node_modules/prop-types/prop-types.js new file mode 100644 index 00000000..867d6993 --- /dev/null +++ b/node_modules/prop-types/prop-types.js @@ -0,0 +1,1337 @@ +(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.PropTypes = 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 1) { + printWarning( + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' + ); + } else { + printWarning('Invalid argument supplied to oneOf, expected an array.'); + } + } + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === 'symbol') { + return String(value); + } + return value; + }); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + "development" !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // falsy value can't be a Symbol + if (!propValue) { + return false; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +},{"./checkPropTypes":1,"./lib/ReactPropTypesSecret":5,"object-assign":6,"react-is":10}],4:[function(require,module,exports){ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +if ("development" !== 'production') { + var ReactIs = require('react-is'); + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = require('./factoryWithThrowingShims')(); +} + +},{"./factoryWithThrowingShims":2,"./factoryWithTypeCheckers":3,"react-is":10}],5:[function(require,module,exports){ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + +},{}],6:[function(require,module,exports){ +/* +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; +}; + +},{}],7:[function(require,module,exports){ +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + +},{}],8:[function(require,module,exports){ +(function (process){ +/** @license React v16.8.1 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + + + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var hasSymbol = typeof Symbol === 'function' && Symbol.for; + +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + +function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); +} + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var lowPriorityWarning = function () {}; + +{ + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +var lowPriorityWarning$1 = lowPriorityWarning; + +function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + + return undefined; +} + +// AsyncMode is deprecated along with isAsyncMode +var AsyncMode = REACT_ASYNC_MODE_TYPE; +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; +var ContextConsumer = REACT_CONTEXT_TYPE; +var ContextProvider = REACT_PROVIDER_TYPE; +var Element = REACT_ELEMENT_TYPE; +var ForwardRef = REACT_FORWARD_REF_TYPE; +var Fragment = REACT_FRAGMENT_TYPE; +var Lazy = REACT_LAZY_TYPE; +var Memo = REACT_MEMO_TYPE; +var Portal = REACT_PORTAL_TYPE; +var Profiler = REACT_PROFILER_TYPE; +var StrictMode = REACT_STRICT_MODE_TYPE; +var Suspense = REACT_SUSPENSE_TYPE; + +var hasWarnedAboutDeprecatedIsAsyncMode = false; + +// AsyncMode should be deprecated +function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; +} +function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; +} +function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; +} +function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; +} +function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +} +function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; +} +function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; +} +function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; +} +function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; +} +function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; +} +function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; +} +function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; +} +function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; +} + +exports.typeOf = typeOf; +exports.AsyncMode = AsyncMode; +exports.ConcurrentMode = ConcurrentMode; +exports.ContextConsumer = ContextConsumer; +exports.ContextProvider = ContextProvider; +exports.Element = Element; +exports.ForwardRef = ForwardRef; +exports.Fragment = Fragment; +exports.Lazy = Lazy; +exports.Memo = Memo; +exports.Portal = Portal; +exports.Profiler = Profiler; +exports.StrictMode = StrictMode; +exports.Suspense = Suspense; +exports.isValidElementType = isValidElementType; +exports.isAsyncMode = isAsyncMode; +exports.isConcurrentMode = isConcurrentMode; +exports.isContextConsumer = isContextConsumer; +exports.isContextProvider = isContextProvider; +exports.isElement = isElement; +exports.isForwardRef = isForwardRef; +exports.isFragment = isFragment; +exports.isLazy = isLazy; +exports.isMemo = isMemo; +exports.isPortal = isPortal; +exports.isProfiler = isProfiler; +exports.isStrictMode = isStrictMode; +exports.isSuspense = isSuspense; + })(); +} + +}).call(this,require('_process')) +},{"_process":7}],9:[function(require,module,exports){ +/** @license React v16.8.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict';Object.defineProperty(exports,"__esModule",{value:!0}); +var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"): +60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n; +exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k}; +exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f}; +exports.isSuspense=function(a){return t(a)===p}; + +},{}],10:[function(require,module,exports){ +(function (process){ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-is.production.min.js'); +} else { + module.exports = require('./cjs/react-is.development.js'); +} + +}).call(this,require('_process')) +},{"./cjs/react-is.development.js":8,"./cjs/react-is.production.min.js":9,"_process":7}]},{},[4])(4) +}); \ No newline at end of file diff --git a/node_modules/prop-types/prop-types.min.js b/node_modules/prop-types/prop-types.min.js new file mode 100644 index 00000000..c9024331 --- /dev/null +++ b/node_modules/prop-types/prop-types.min.js @@ -0,0 +1 @@ +!function(f){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=f();else if("function"==typeof define&&define.amd)define([],f);else{var g;g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,g.PropTypes=f()}}(function(){return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&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||e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;o React.createElement("div"); + +const ForwardRefComponent = React.forwardRef((props, ref) => + React.createElement(Component, { forwardedRef: ref, ...props }) +); + +const Context = React.createContext(false); + +ReactIs.isValidElementType("div"); // true +ReactIs.isValidElementType(ClassComponent); // true +ReactIs.isValidElementType(StatelessComponent); // true +ReactIs.isValidElementType(ForwardRefComponent); // true +ReactIs.isValidElementType(Context.Provider); // true +ReactIs.isValidElementType(Context.Consumer); // true +ReactIs.isValidElementType(React.createFactory("div")); // true +``` + +### Determining an Element's Type + +#### ConcurrentMode + +```js +import React from "react"; +import * as ReactIs from 'react-is'; + +ReactIs.isConcurrentMode(); // true +ReactIs.typeOf() === ReactIs.ConcurrentMode; // true +``` + +#### Context + +```js +import React from "react"; +import * as ReactIs from 'react-is'; + +const ThemeContext = React.createContext("blue"); + +ReactIs.isContextConsumer(); // true +ReactIs.isContextProvider(); // true +ReactIs.typeOf() === ReactIs.ContextProvider; // true +ReactIs.typeOf() === ReactIs.ContextConsumer; // true +``` + +#### Element + +```js +import React from "react"; +import * as ReactIs from 'react-is'; + +ReactIs.isElement(
); // true +ReactIs.typeOf(
) === ReactIs.Element; // true +``` + +#### Fragment + +```js +import React from "react"; +import * as ReactIs from 'react-is'; + +ReactIs.isFragment(<>); // true +ReactIs.typeOf(<>) === ReactIs.Fragment; // true +``` + +#### Portal + +```js +import React from "react"; +import ReactDOM from "react-dom"; +import * as ReactIs from 'react-is'; + +const div = document.createElement("div"); +const portal = ReactDOM.createPortal(
, div); + +ReactIs.isPortal(portal); // true +ReactIs.typeOf(portal) === ReactIs.Portal; // true +``` + +#### StrictMode + +```js +import React from "react"; +import * as ReactIs from 'react-is'; + +ReactIs.isStrictMode(); // true +ReactIs.typeOf() === ReactIs.StrictMode; // true +``` diff --git a/node_modules/react-is/build-info.json b/node_modules/react-is/build-info.json new file mode 100644 index 00000000..e1796b48 --- /dev/null +++ b/node_modules/react-is/build-info.json @@ -0,0 +1,8 @@ +{ + "branch": "pull/15226", + "buildNumber": "14079", + "checksum": "4a4c239", + "commit": "297165f1e", + "environment": "ci", + "reactVersion": "16.8.5-canary-297165f1e" +} diff --git a/node_modules/react-is/cjs/react-is.development.js b/node_modules/react-is/cjs/react-is.development.js new file mode 100644 index 00000000..b3c38465 --- /dev/null +++ b/node_modules/react-is/cjs/react-is.development.js @@ -0,0 +1,227 @@ +/** @license React v16.8.6 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + + + +if (process.env.NODE_ENV !== "production") { + (function() { +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var hasSymbol = typeof Symbol === 'function' && Symbol.for; + +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + +function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); +} + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var lowPriorityWarning = function () {}; + +{ + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +var lowPriorityWarning$1 = lowPriorityWarning; + +function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + + return undefined; +} + +// AsyncMode is deprecated along with isAsyncMode +var AsyncMode = REACT_ASYNC_MODE_TYPE; +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; +var ContextConsumer = REACT_CONTEXT_TYPE; +var ContextProvider = REACT_PROVIDER_TYPE; +var Element = REACT_ELEMENT_TYPE; +var ForwardRef = REACT_FORWARD_REF_TYPE; +var Fragment = REACT_FRAGMENT_TYPE; +var Lazy = REACT_LAZY_TYPE; +var Memo = REACT_MEMO_TYPE; +var Portal = REACT_PORTAL_TYPE; +var Profiler = REACT_PROFILER_TYPE; +var StrictMode = REACT_STRICT_MODE_TYPE; +var Suspense = REACT_SUSPENSE_TYPE; + +var hasWarnedAboutDeprecatedIsAsyncMode = false; + +// AsyncMode should be deprecated +function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; +} +function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; +} +function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; +} +function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; +} +function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +} +function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; +} +function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; +} +function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; +} +function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; +} +function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; +} +function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; +} +function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; +} +function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; +} + +exports.typeOf = typeOf; +exports.AsyncMode = AsyncMode; +exports.ConcurrentMode = ConcurrentMode; +exports.ContextConsumer = ContextConsumer; +exports.ContextProvider = ContextProvider; +exports.Element = Element; +exports.ForwardRef = ForwardRef; +exports.Fragment = Fragment; +exports.Lazy = Lazy; +exports.Memo = Memo; +exports.Portal = Portal; +exports.Profiler = Profiler; +exports.StrictMode = StrictMode; +exports.Suspense = Suspense; +exports.isValidElementType = isValidElementType; +exports.isAsyncMode = isAsyncMode; +exports.isConcurrentMode = isConcurrentMode; +exports.isContextConsumer = isContextConsumer; +exports.isContextProvider = isContextProvider; +exports.isElement = isElement; +exports.isForwardRef = isForwardRef; +exports.isFragment = isFragment; +exports.isLazy = isLazy; +exports.isMemo = isMemo; +exports.isPortal = isPortal; +exports.isProfiler = isProfiler; +exports.isStrictMode = isStrictMode; +exports.isSuspense = isSuspense; + })(); +} diff --git a/node_modules/react-is/cjs/react-is.production.min.js b/node_modules/react-is/cjs/react-is.production.min.js new file mode 100644 index 00000000..b88bb327 --- /dev/null +++ b/node_modules/react-is/cjs/react-is.production.min.js @@ -0,0 +1,15 @@ +/** @license React v16.8.6 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict';Object.defineProperty(exports,"__esModule",{value:!0}); +var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"): +60115,r=b?Symbol.for("react.lazy"):60116;function t(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case h:return a;default:return u}}case r:case q:case d:return u}}}function v(a){return t(a)===m}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n; +exports.Fragment=e;exports.Lazy=r;exports.Memo=q;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n)};exports.isAsyncMode=function(a){return v(a)||t(a)===l};exports.isConcurrentMode=v;exports.isContextConsumer=function(a){return t(a)===k}; +exports.isContextProvider=function(a){return t(a)===h};exports.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===n};exports.isFragment=function(a){return t(a)===e};exports.isLazy=function(a){return t(a)===r};exports.isMemo=function(a){return t(a)===q};exports.isPortal=function(a){return t(a)===d};exports.isProfiler=function(a){return t(a)===g};exports.isStrictMode=function(a){return t(a)===f}; +exports.isSuspense=function(a){return t(a)===p}; diff --git a/node_modules/react-is/index.js b/node_modules/react-is/index.js new file mode 100644 index 00000000..3ae098d0 --- /dev/null +++ b/node_modules/react-is/index.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/react-is.production.min.js'); +} else { + module.exports = require('./cjs/react-is.development.js'); +} diff --git a/node_modules/react-is/package.json b/node_modules/react-is/package.json new file mode 100644 index 00000000..91878f9a --- /dev/null +++ b/node_modules/react-is/package.json @@ -0,0 +1,54 @@ +{ + "_from": "react-is@^16.8.1", + "_id": "react-is@16.8.6", + "_inBundle": false, + "_integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==", + "_location": "/react-is", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "react-is@^16.8.1", + "name": "react-is", + "escapedName": "react-is", + "rawSpec": "^16.8.1", + "saveSpec": null, + "fetchSpec": "^16.8.1" + }, + "_requiredBy": [ + "/hoist-non-react-statics", + "/prop-types", + "/react-router" + ], + "_resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", + "_shasum": "5bbc1e2d29141c9fbdfed456343fe2bc430a6a16", + "_spec": "react-is@^16.8.1", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/prop-types", + "bugs": { + "url": "https://github.com/facebook/react/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Brand checking of React Elements.", + "files": [ + "LICENSE", + "README.md", + "build-info.json", + "index.js", + "cjs/", + "umd/" + ], + "homepage": "https://reactjs.org/", + "keywords": [ + "react" + ], + "license": "MIT", + "main": "index.js", + "name": "react-is", + "repository": { + "type": "git", + "url": "git+https://github.com/facebook/react.git", + "directory": "packages/react-is" + }, + "version": "16.8.6" +} diff --git a/node_modules/react-is/umd/react-is.development.js b/node_modules/react-is/umd/react-is.development.js new file mode 100644 index 00000000..ee0eb970 --- /dev/null +++ b/node_modules/react-is/umd/react-is.development.js @@ -0,0 +1,227 @@ +/** @license React v16.8.6 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.ReactIs = {}))); +}(this, (function (exports) { 'use strict'; + +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. +var hasSymbol = typeof Symbol === 'function' && Symbol.for; + +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + +function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); +} + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var lowPriorityWarning = function () {}; + +{ + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +var lowPriorityWarning$1 = lowPriorityWarning; + +function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + + return undefined; +} + +// AsyncMode is deprecated along with isAsyncMode +var AsyncMode = REACT_ASYNC_MODE_TYPE; +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; +var ContextConsumer = REACT_CONTEXT_TYPE; +var ContextProvider = REACT_PROVIDER_TYPE; +var Element = REACT_ELEMENT_TYPE; +var ForwardRef = REACT_FORWARD_REF_TYPE; +var Fragment = REACT_FRAGMENT_TYPE; +var Lazy = REACT_LAZY_TYPE; +var Memo = REACT_MEMO_TYPE; +var Portal = REACT_PORTAL_TYPE; +var Profiler = REACT_PROFILER_TYPE; +var StrictMode = REACT_STRICT_MODE_TYPE; +var Suspense = REACT_SUSPENSE_TYPE; + +var hasWarnedAboutDeprecatedIsAsyncMode = false; + +// AsyncMode should be deprecated +function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; +} +function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; +} +function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; +} +function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; +} +function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +} +function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; +} +function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; +} +function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; +} +function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; +} +function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; +} +function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; +} +function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; +} +function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; +} + +exports.typeOf = typeOf; +exports.AsyncMode = AsyncMode; +exports.ConcurrentMode = ConcurrentMode; +exports.ContextConsumer = ContextConsumer; +exports.ContextProvider = ContextProvider; +exports.Element = Element; +exports.ForwardRef = ForwardRef; +exports.Fragment = Fragment; +exports.Lazy = Lazy; +exports.Memo = Memo; +exports.Portal = Portal; +exports.Profiler = Profiler; +exports.StrictMode = StrictMode; +exports.Suspense = Suspense; +exports.isValidElementType = isValidElementType; +exports.isAsyncMode = isAsyncMode; +exports.isConcurrentMode = isConcurrentMode; +exports.isContextConsumer = isContextConsumer; +exports.isContextProvider = isContextProvider; +exports.isElement = isElement; +exports.isForwardRef = isForwardRef; +exports.isFragment = isFragment; +exports.isLazy = isLazy; +exports.isMemo = isMemo; +exports.isPortal = isPortal; +exports.isProfiler = isProfiler; +exports.isStrictMode = isStrictMode; +exports.isSuspense = isSuspense; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/react-is/umd/react-is.production.min.js b/node_modules/react-is/umd/react-is.production.min.js new file mode 100644 index 00000000..4db65b64 --- /dev/null +++ b/node_modules/react-is/umd/react-is.production.min.js @@ -0,0 +1,13 @@ +/** @license React v16.8.6 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';(function(b,c){"object"===typeof exports&&"undefined"!==typeof module?c(exports):"function"===typeof define&&define.amd?define(["exports"],c):c(b.ReactIs={})})(this,function(b){function c(a){if("object"===typeof a&&null!==a){var b=a.$$typeof;switch(b){case r:switch(a=a.type,a){case t:case e:case f:case g:case h:case k:return a;default:switch(a=a&&a.$$typeof,a){case l:case m:case n:return a;default:return b}}case p:case q:case u:return b}}}function v(a){return c(a)===e}var d="function"=== +typeof Symbol&&Symbol.for,r=d?Symbol.for("react.element"):60103,u=d?Symbol.for("react.portal"):60106,f=d?Symbol.for("react.fragment"):60107,h=d?Symbol.for("react.strict_mode"):60108,g=d?Symbol.for("react.profiler"):60114,n=d?Symbol.for("react.provider"):60109,l=d?Symbol.for("react.context"):60110,t=d?Symbol.for("react.async_mode"):60111,e=d?Symbol.for("react.concurrent_mode"):60111,m=d?Symbol.for("react.forward_ref"):60112,k=d?Symbol.for("react.suspense"):60113,q=d?Symbol.for("react.memo"):60115, +p=d?Symbol.for("react.lazy"):60116;b.typeOf=c;b.AsyncMode=t;b.ConcurrentMode=e;b.ContextConsumer=l;b.ContextProvider=n;b.Element=r;b.ForwardRef=m;b.Fragment=f;b.Lazy=p;b.Memo=q;b.Portal=u;b.Profiler=g;b.StrictMode=h;b.Suspense=k;b.isValidElementType=function(a){return"string"===typeof a||"function"===typeof a||a===f||a===e||a===g||a===h||a===k||"object"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===q||a.$$typeof===n||a.$$typeof===l||a.$$typeof===m)};b.isAsyncMode=function(a){return v(a)||c(a)=== +t};b.isConcurrentMode=v;b.isContextConsumer=function(a){return c(a)===l};b.isContextProvider=function(a){return c(a)===n};b.isElement=function(a){return"object"===typeof a&&null!==a&&a.$$typeof===r};b.isForwardRef=function(a){return c(a)===m};b.isFragment=function(a){return c(a)===f};b.isLazy=function(a){return c(a)===p};b.isMemo=function(a){return c(a)===q};b.isPortal=function(a){return c(a)===u};b.isProfiler=function(a){return c(a)===g};b.isStrictMode=function(a){return c(a)===h};b.isSuspense=function(a){return c(a)=== +k};Object.defineProperty(b,"__esModule",{value:!0})}); diff --git a/node_modules/react-router-dom/BrowserRouter.js b/node_modules/react-router-dom/BrowserRouter.js new file mode 100644 index 00000000..841485c1 --- /dev/null +++ b/node_modules/react-router-dom/BrowserRouter.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("BrowserRouter"); +module.exports = require("./index.js").BrowserRouter; diff --git a/node_modules/react-router-dom/HashRouter.js b/node_modules/react-router-dom/HashRouter.js new file mode 100644 index 00000000..41a19075 --- /dev/null +++ b/node_modules/react-router-dom/HashRouter.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("HashRouter"); +module.exports = require("./index.js").HashRouter; diff --git a/node_modules/react-router-dom/LICENSE b/node_modules/react-router-dom/LICENSE new file mode 100644 index 00000000..dc15fe3f --- /dev/null +++ b/node_modules/react-router-dom/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) React Training 2016-2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/react-router-dom/Link.js b/node_modules/react-router-dom/Link.js new file mode 100644 index 00000000..67cd635b --- /dev/null +++ b/node_modules/react-router-dom/Link.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Link"); +module.exports = require("./index.js").Link; diff --git a/node_modules/react-router-dom/MemoryRouter.js b/node_modules/react-router-dom/MemoryRouter.js new file mode 100644 index 00000000..79b74bbd --- /dev/null +++ b/node_modules/react-router-dom/MemoryRouter.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("MemoryRouter"); +module.exports = require("./index.js").MemoryRouter; diff --git a/node_modules/react-router-dom/NavLink.js b/node_modules/react-router-dom/NavLink.js new file mode 100644 index 00000000..eeae4472 --- /dev/null +++ b/node_modules/react-router-dom/NavLink.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("NavLink"); +module.exports = require("./index.js").NavLink; diff --git a/node_modules/react-router-dom/Prompt.js b/node_modules/react-router-dom/Prompt.js new file mode 100644 index 00000000..20f629b4 --- /dev/null +++ b/node_modules/react-router-dom/Prompt.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Prompt"); +module.exports = require("./index.js").Prompt; diff --git a/node_modules/react-router-dom/README.md b/node_modules/react-router-dom/README.md new file mode 100644 index 00000000..f2abe64d --- /dev/null +++ b/node_modules/react-router-dom/README.md @@ -0,0 +1,37 @@ +# react-router-dom + +DOM bindings for [React Router](https://reacttraining.com/react-router). + +## Installation + +Using [npm](https://www.npmjs.com/): + + $ npm install --save react-router-dom + +Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else: + +```js +// using ES6 modules +import { BrowserRouter, Route, Link } from "react-router-dom"; + +// using CommonJS modules +const BrowserRouter = require("react-router-dom").BrowserRouter; +const Route = require("react-router-dom").Route; +const Link = require("react-router-dom").Link; +``` + +The UMD build is also available on [unpkg](https://unpkg.com): + +```html + +``` + +You can find the library on `window.ReactRouterDOM`. + +## Issues + +If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/ReactTraining/react-router/issues). + +## Credits + +React Router is built and maintained by [React Training](https://reacttraining.com). diff --git a/node_modules/react-router-dom/Redirect.js b/node_modules/react-router-dom/Redirect.js new file mode 100644 index 00000000..6c763abc --- /dev/null +++ b/node_modules/react-router-dom/Redirect.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Redirect"); +module.exports = require("./index.js").Redirect; diff --git a/node_modules/react-router-dom/Route.js b/node_modules/react-router-dom/Route.js new file mode 100644 index 00000000..0d3b1f59 --- /dev/null +++ b/node_modules/react-router-dom/Route.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Route"); +module.exports = require("./index.js").Route; diff --git a/node_modules/react-router-dom/Router.js b/node_modules/react-router-dom/Router.js new file mode 100644 index 00000000..ca27b72d --- /dev/null +++ b/node_modules/react-router-dom/Router.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Router"); +module.exports = require("./index.js").Router; diff --git a/node_modules/react-router-dom/StaticRouter.js b/node_modules/react-router-dom/StaticRouter.js new file mode 100644 index 00000000..6bc35134 --- /dev/null +++ b/node_modules/react-router-dom/StaticRouter.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("StaticRouter"); +module.exports = require("./index.js").StaticRouter; diff --git a/node_modules/react-router-dom/Switch.js b/node_modules/react-router-dom/Switch.js new file mode 100644 index 00000000..a4b38eb2 --- /dev/null +++ b/node_modules/react-router-dom/Switch.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Switch"); +module.exports = require("./index.js").Switch; diff --git a/node_modules/react-router-dom/cjs/react-router-dom.js b/node_modules/react-router-dom/cjs/react-router-dom.js new file mode 100644 index 00000000..9415c45a --- /dev/null +++ b/node_modules/react-router-dom/cjs/react-router-dom.js @@ -0,0 +1,294 @@ +'use strict'; + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var React = _interopDefault(require('react')); +var reactRouter = require('react-router'); +var history = require('history'); +var PropTypes = _interopDefault(require('prop-types')); +var warning = _interopDefault(require('tiny-warning')); +var invariant = _interopDefault(require('tiny-invariant')); + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +/** + * The public API for a that uses HTML5 history. + */ + +var BrowserRouter = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(BrowserRouter, _React$Component); + + function BrowserRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.history = history.createBrowserHistory(_this.props); + return _this; + } + + var _proto = BrowserRouter.prototype; + + _proto.render = function render() { + return React.createElement(reactRouter.Router, { + history: this.history, + children: this.props.children + }); + }; + + return BrowserRouter; +}(React.Component); + +{ + BrowserRouter.propTypes = { + basename: PropTypes.string, + children: PropTypes.node, + forceRefresh: PropTypes.bool, + getUserConfirmation: PropTypes.func, + keyLength: PropTypes.number + }; + + BrowserRouter.prototype.componentDidMount = function () { + warning(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { BrowserRouter as Router }`."); + }; +} + +/** + * The public API for a that uses window.location.hash. + */ + +var HashRouter = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(HashRouter, _React$Component); + + function HashRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.history = history.createHashHistory(_this.props); + return _this; + } + + var _proto = HashRouter.prototype; + + _proto.render = function render() { + return React.createElement(reactRouter.Router, { + history: this.history, + children: this.props.children + }); + }; + + return HashRouter; +}(React.Component); + +{ + HashRouter.propTypes = { + basename: PropTypes.string, + children: PropTypes.node, + getUserConfirmation: PropTypes.func, + hashType: PropTypes.oneOf(["hashbang", "noslash", "slash"]) + }; + + HashRouter.prototype.componentDidMount = function () { + warning(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { HashRouter as Router }`."); + }; +} + +function isModifiedEvent(event) { + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); +} +/** + * The public API for rendering a history-aware . + */ + + +var Link = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(Link, _React$Component); + + function Link() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Link.prototype; + + _proto.handleClick = function handleClick(event, history$$1) { + try { + if (this.props.onClick) this.props.onClick(event); + } catch (ex) { + event.preventDefault(); + throw ex; + } + + if (!event.defaultPrevented && // onClick prevented default + event.button === 0 && ( // ignore everything but left clicks + !this.props.target || this.props.target === "_self") && // let browser handle "target=_blank" etc. + !isModifiedEvent(event) // ignore clicks with modifier keys + ) { + event.preventDefault(); + var method = this.props.replace ? history$$1.replace : history$$1.push; + method(this.props.to); + } + }; + + _proto.render = function render() { + var _this = this; + + var _this$props = this.props, + innerRef = _this$props.innerRef, + replace = _this$props.replace, + to = _this$props.to, + rest = _objectWithoutPropertiesLoose(_this$props, ["innerRef", "replace", "to"]); // eslint-disable-line no-unused-vars + + + return React.createElement(reactRouter.__RouterContext.Consumer, null, function (context) { + !context ? invariant(false, "You should not use outside a ") : void 0; + var location = typeof to === "string" ? history.createLocation(to, null, null, context.location) : to; + var href = location ? context.history.createHref(location) : ""; + return React.createElement("a", _extends({}, rest, { + onClick: function onClick(event) { + return _this.handleClick(event, context.history); + }, + href: href, + ref: innerRef + })); + }); + }; + + return Link; +}(React.Component); + +{ + var toType = PropTypes.oneOfType([PropTypes.string, PropTypes.object]); + var innerRefType = PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.shape({ + current: PropTypes.any + })]); + Link.propTypes = { + innerRef: innerRefType, + onClick: PropTypes.func, + replace: PropTypes.bool, + target: PropTypes.string, + to: toType.isRequired + }; +} + +function joinClassnames() { + for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) { + classnames[_key] = arguments[_key]; + } + + return classnames.filter(function (i) { + return i; + }).join(" "); +} +/** + * A wrapper that knows if it's "active" or not. + */ + + +function NavLink(_ref) { + var _ref$ariaCurrent = _ref["aria-current"], + ariaCurrent = _ref$ariaCurrent === void 0 ? "page" : _ref$ariaCurrent, + _ref$activeClassName = _ref.activeClassName, + activeClassName = _ref$activeClassName === void 0 ? "active" : _ref$activeClassName, + activeStyle = _ref.activeStyle, + classNameProp = _ref.className, + exact = _ref.exact, + isActiveProp = _ref.isActive, + locationProp = _ref.location, + strict = _ref.strict, + styleProp = _ref.style, + to = _ref.to, + rest = _objectWithoutPropertiesLoose(_ref, ["aria-current", "activeClassName", "activeStyle", "className", "exact", "isActive", "location", "strict", "style", "to"]); + + var path = typeof to === "object" ? to.pathname : to; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202 + + var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); + return React.createElement(reactRouter.__RouterContext.Consumer, null, function (context) { + !context ? invariant(false, "You should not use outside a ") : void 0; + var pathToMatch = locationProp ? locationProp.pathname : context.location.pathname; + var match = escapedPath ? reactRouter.matchPath(pathToMatch, { + path: escapedPath, + exact: exact, + strict: strict + }) : null; + var isActive = !!(isActiveProp ? isActiveProp(match, context.location) : match); + var className = isActive ? joinClassnames(classNameProp, activeClassName) : classNameProp; + var style = isActive ? _extends({}, styleProp, activeStyle) : styleProp; + return React.createElement(Link, _extends({ + "aria-current": isActive && ariaCurrent || null, + className: className, + style: style, + to: to + }, rest)); + }); +} + +{ + var ariaCurrentType = PropTypes.oneOf(["page", "step", "location", "date", "time", "true"]); + NavLink.propTypes = _extends({}, Link.propTypes, { + "aria-current": ariaCurrentType, + activeClassName: PropTypes.string, + activeStyle: PropTypes.object, + className: PropTypes.string, + exact: PropTypes.bool, + isActive: PropTypes.func, + location: PropTypes.object, + strict: PropTypes.bool, + style: PropTypes.object + }); +} + +Object.keys(reactRouter).forEach(function (key) { exports[key] = reactRouter[key]; }); +exports.BrowserRouter = BrowserRouter; +exports.HashRouter = HashRouter; +exports.Link = Link; +exports.NavLink = NavLink; diff --git a/node_modules/react-router-dom/cjs/react-router-dom.min.js b/node_modules/react-router-dom/cjs/react-router-dom.min.js new file mode 100644 index 00000000..b3f0eecc --- /dev/null +++ b/node_modules/react-router-dom/cjs/react-router-dom.min.js @@ -0,0 +1 @@ +"use strict";function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var React=_interopDefault(require("react")),reactRouter=require("react-router"),history=require("history");require("prop-types"),require("tiny-warning");var invariant=_interopDefault(require("tiny-invariant"));function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e 0 + ? format.replace(/%s/g, function() { + return subs[index++]; + }) + : format); + + if (typeof console !== "undefined") { + console.error(message); + } + + try { + // --- Welcome to debugging React Router --- + // This error was thrown as a convenience so that you can use the + // stack trace to find the callsite that triggered this warning. + throw new Error(message); + } catch (e) {} + }; +} + +export default function(member) { + printWarning( + 'Please use `import { %s } from "react-router-dom"` instead of `import %s from "react-router-dom/es/%s"`. ' + + "Support for the latter will be removed in the next major release.", + [member, member] + ); +} diff --git a/node_modules/react-router-dom/es/withRouter.js b/node_modules/react-router-dom/es/withRouter.js new file mode 100644 index 00000000..0a4e4f81 --- /dev/null +++ b/node_modules/react-router-dom/es/withRouter.js @@ -0,0 +1,7 @@ +"use strict"; + +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js"; +warnAboutDeprecatedESMImport("withRouter"); + +import { withRouter } from "../esm/react-router-dom.js"; +export default withRouter; diff --git a/node_modules/react-router-dom/esm/react-router-dom.js b/node_modules/react-router-dom/esm/react-router-dom.js new file mode 100644 index 00000000..3a25e23b --- /dev/null +++ b/node_modules/react-router-dom/esm/react-router-dom.js @@ -0,0 +1,251 @@ +import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose'; +import React from 'react'; +import { Router, __RouterContext, matchPath } from 'react-router'; +export * from 'react-router'; +import { createBrowserHistory, createHashHistory, createLocation } from 'history'; +import PropTypes from 'prop-types'; +import warning from 'tiny-warning'; +import _extends from '@babel/runtime/helpers/esm/extends'; +import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose'; +import invariant from 'tiny-invariant'; + +/** + * The public API for a that uses HTML5 history. + */ + +var BrowserRouter = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(BrowserRouter, _React$Component); + + function BrowserRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.history = createBrowserHistory(_this.props); + return _this; + } + + var _proto = BrowserRouter.prototype; + + _proto.render = function render() { + return React.createElement(Router, { + history: this.history, + children: this.props.children + }); + }; + + return BrowserRouter; +}(React.Component); + +if (process.env.NODE_ENV !== "production") { + BrowserRouter.propTypes = { + basename: PropTypes.string, + children: PropTypes.node, + forceRefresh: PropTypes.bool, + getUserConfirmation: PropTypes.func, + keyLength: PropTypes.number + }; + + BrowserRouter.prototype.componentDidMount = function () { + process.env.NODE_ENV !== "production" ? warning(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { BrowserRouter as Router }`.") : void 0; + }; +} + +/** + * The public API for a that uses window.location.hash. + */ + +var HashRouter = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(HashRouter, _React$Component); + + function HashRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.history = createHashHistory(_this.props); + return _this; + } + + var _proto = HashRouter.prototype; + + _proto.render = function render() { + return React.createElement(Router, { + history: this.history, + children: this.props.children + }); + }; + + return HashRouter; +}(React.Component); + +if (process.env.NODE_ENV !== "production") { + HashRouter.propTypes = { + basename: PropTypes.string, + children: PropTypes.node, + getUserConfirmation: PropTypes.func, + hashType: PropTypes.oneOf(["hashbang", "noslash", "slash"]) + }; + + HashRouter.prototype.componentDidMount = function () { + process.env.NODE_ENV !== "production" ? warning(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { HashRouter as Router }`.") : void 0; + }; +} + +function isModifiedEvent(event) { + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); +} +/** + * The public API for rendering a history-aware . + */ + + +var Link = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(Link, _React$Component); + + function Link() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Link.prototype; + + _proto.handleClick = function handleClick(event, history) { + try { + if (this.props.onClick) this.props.onClick(event); + } catch (ex) { + event.preventDefault(); + throw ex; + } + + if (!event.defaultPrevented && // onClick prevented default + event.button === 0 && ( // ignore everything but left clicks + !this.props.target || this.props.target === "_self") && // let browser handle "target=_blank" etc. + !isModifiedEvent(event) // ignore clicks with modifier keys + ) { + event.preventDefault(); + var method = this.props.replace ? history.replace : history.push; + method(this.props.to); + } + }; + + _proto.render = function render() { + var _this = this; + + var _this$props = this.props, + innerRef = _this$props.innerRef, + replace = _this$props.replace, + to = _this$props.to, + rest = _objectWithoutPropertiesLoose(_this$props, ["innerRef", "replace", "to"]); // eslint-disable-line no-unused-vars + + + return React.createElement(__RouterContext.Consumer, null, function (context) { + !context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use outside a ") : invariant(false) : void 0; + var location = typeof to === "string" ? createLocation(to, null, null, context.location) : to; + var href = location ? context.history.createHref(location) : ""; + return React.createElement("a", _extends({}, rest, { + onClick: function onClick(event) { + return _this.handleClick(event, context.history); + }, + href: href, + ref: innerRef + })); + }); + }; + + return Link; +}(React.Component); + +if (process.env.NODE_ENV !== "production") { + var toType = PropTypes.oneOfType([PropTypes.string, PropTypes.object]); + var innerRefType = PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.shape({ + current: PropTypes.any + })]); + Link.propTypes = { + innerRef: innerRefType, + onClick: PropTypes.func, + replace: PropTypes.bool, + target: PropTypes.string, + to: toType.isRequired + }; +} + +function joinClassnames() { + for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) { + classnames[_key] = arguments[_key]; + } + + return classnames.filter(function (i) { + return i; + }).join(" "); +} +/** + * A wrapper that knows if it's "active" or not. + */ + + +function NavLink(_ref) { + var _ref$ariaCurrent = _ref["aria-current"], + ariaCurrent = _ref$ariaCurrent === void 0 ? "page" : _ref$ariaCurrent, + _ref$activeClassName = _ref.activeClassName, + activeClassName = _ref$activeClassName === void 0 ? "active" : _ref$activeClassName, + activeStyle = _ref.activeStyle, + classNameProp = _ref.className, + exact = _ref.exact, + isActiveProp = _ref.isActive, + locationProp = _ref.location, + strict = _ref.strict, + styleProp = _ref.style, + to = _ref.to, + rest = _objectWithoutPropertiesLoose(_ref, ["aria-current", "activeClassName", "activeStyle", "className", "exact", "isActive", "location", "strict", "style", "to"]); + + var path = typeof to === "object" ? to.pathname : to; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202 + + var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); + return React.createElement(__RouterContext.Consumer, null, function (context) { + !context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use outside a ") : invariant(false) : void 0; + var pathToMatch = locationProp ? locationProp.pathname : context.location.pathname; + var match = escapedPath ? matchPath(pathToMatch, { + path: escapedPath, + exact: exact, + strict: strict + }) : null; + var isActive = !!(isActiveProp ? isActiveProp(match, context.location) : match); + var className = isActive ? joinClassnames(classNameProp, activeClassName) : classNameProp; + var style = isActive ? _extends({}, styleProp, activeStyle) : styleProp; + return React.createElement(Link, _extends({ + "aria-current": isActive && ariaCurrent || null, + className: className, + style: style, + to: to + }, rest)); + }); +} + +if (process.env.NODE_ENV !== "production") { + var ariaCurrentType = PropTypes.oneOf(["page", "step", "location", "date", "time", "true"]); + NavLink.propTypes = _extends({}, Link.propTypes, { + "aria-current": ariaCurrentType, + activeClassName: PropTypes.string, + activeStyle: PropTypes.object, + className: PropTypes.string, + exact: PropTypes.bool, + isActive: PropTypes.func, + location: PropTypes.object, + strict: PropTypes.bool, + style: PropTypes.object + }); +} + +export { BrowserRouter, HashRouter, Link, NavLink }; diff --git a/node_modules/react-router-dom/generatePath.js b/node_modules/react-router-dom/generatePath.js new file mode 100644 index 00000000..d487dd2a --- /dev/null +++ b/node_modules/react-router-dom/generatePath.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("generatePath"); +module.exports = require("./index.js").generatePath; diff --git a/node_modules/react-router-dom/index.js b/node_modules/react-router-dom/index.js new file mode 100644 index 00000000..92172e2a --- /dev/null +++ b/node_modules/react-router-dom/index.js @@ -0,0 +1,7 @@ +"use strict"; + +if (process.env.NODE_ENV === "production") { + module.exports = require("./cjs/react-router-dom.min.js"); +} else { + module.exports = require("./cjs/react-router-dom.js"); +} diff --git a/node_modules/react-router-dom/matchPath.js b/node_modules/react-router-dom/matchPath.js new file mode 100644 index 00000000..6d1fe336 --- /dev/null +++ b/node_modules/react-router-dom/matchPath.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("matchPath"); +module.exports = require("./index.js").matchPath; diff --git a/node_modules/react-router-dom/package.json b/node_modules/react-router-dom/package.json new file mode 100644 index 00000000..10149ab0 --- /dev/null +++ b/node_modules/react-router-dom/package.json @@ -0,0 +1,126 @@ +{ + "_from": "react-router-dom", + "_id": "react-router-dom@5.0.1", + "_inBundle": false, + "_integrity": "sha512-zaVHSy7NN0G91/Bz9GD4owex5+eop+KvgbxXsP/O+iW1/Ln+BrJ8QiIR5a6xNPtrdTvLkxqlDClx13QO1uB8CA==", + "_location": "/react-router-dom", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "react-router-dom", + "name": "react-router-dom", + "escapedName": "react-router-dom", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.0.1.tgz", + "_shasum": "ee66f4a5d18b6089c361958e443489d6bab714be", + "_spec": "react-router-dom", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API", + "authors": [ + "Michael Jackson", + "Ryan Florence" + ], + "browserify": { + "transform": [ + "loose-envify" + ] + }, + "bugs": { + "url": "https://github.com/ReactTraining/react-router/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.2", + "react-router": "5.0.1", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "deprecated": false, + "description": "DOM bindings for React Router", + "devDependencies": { + "@babel/core": "^7.1.2", + "@babel/plugin-proposal-class-properties": "^7.1.0", + "@babel/plugin-transform-runtime": "^7.1.0", + "@babel/preset-env": "^7.1.0", + "@babel/preset-react": "^7.0.0", + "babel-eslint": "^10.0.1", + "babel-jest": "^24.8.0", + "babel-plugin-dev-expression": "^0.2.1", + "eslint": "^5.16.0", + "eslint-plugin-import": "^2.17.0", + "eslint-plugin-react": "^7.9.1", + "jest": "^24.8.0", + "jest-circus": "^24.8.0", + "raf": "^3.4.1", + "react": "^16.5.2", + "react-dom": "^16.5.2", + "rollup": "^0.66.6", + "rollup-plugin-babel": "^4.3.2", + "rollup-plugin-commonjs": "^9.3.4", + "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-replace": "^2.2.0", + "rollup-plugin-size-snapshot": "0.7.0", + "rollup-plugin-uglify": "^6.0.2" + }, + "files": [ + "BrowserRouter.js", + "HashRouter.js", + "Link.js", + "MemoryRouter.js", + "NavLink.js", + "Prompt.js", + "Redirect.js", + "Route.js", + "Router.js", + "StaticRouter.js", + "Switch.js", + "cjs", + "es", + "esm", + "index.js", + "generatePath.js", + "matchPath.js", + "withRouter.js", + "warnAboutDeprecatedCJSRequire.js", + "umd" + ], + "gitHead": "0c9a10d9807b879912f2dff2fbebffe0aa7048ed", + "homepage": "https://github.com/ReactTraining/react-router#readme", + "keywords": [ + "react", + "router", + "route", + "routing", + "history", + "link" + ], + "license": "MIT", + "main": "index.js", + "module": "esm/react-router-dom.js", + "name": "react-router-dom", + "peerDependencies": { + "react": ">=15" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ReactTraining/react-router.git" + }, + "scripts": { + "build": "rollup -c", + "lint": "eslint modules", + "prepublishOnly": "npm run build", + "test": "jest" + }, + "sideEffects": false, + "version": "5.0.1" +} diff --git a/node_modules/react-router-dom/umd/react-router-dom.js b/node_modules/react-router-dom/umd/react-router-dom.js new file mode 100644 index 00000000..5eedb639 --- /dev/null +++ b/node_modules/react-router-dom/umd/react-router-dom.js @@ -0,0 +1,4898 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : + typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : + (factory((global.ReactRouterDOM = {}),global.React)); +}(this, (function (exports,React) { 'use strict'; + + var React__default = 'default' in React ? React['default'] : React; + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } + } + + var objectAssign = 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; + }; + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + + var ReactPropTypesSecret_1 = ReactPropTypesSecret; + + var printWarning = function() {}; + + { + var ReactPropTypesSecret$1 = ReactPropTypesSecret_1; + var loggedTypeFailures = {}; + + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } + + /** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ + function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ); + + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } + } + + var checkPropTypes_1 = checkPropTypes; + + var printWarning$1 = function() {}; + + { + printWarning$1 = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } + + function emptyFunctionThatReturnsNull() { + return null; + } + + var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret_1) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if (typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning$1( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + printWarning$1('Invalid argument supplied to oneOf, expected an instance of array.'); + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.'); + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning$1( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = objectAssign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes_1; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; + }; + + var propTypes = createCommonjsModule(function (module) { + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess); + } + }); + + var key = '__global_unique_id__'; + + var gud = function() { + return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1; + }; + + function warning(condition, message) { + { + if (condition) { + return; + } + + var text = "Warning: " + message; + + if (typeof console !== 'undefined') { + console.warn(text); + } + + try { + throw Error(text); + } catch (x) {} + } + } + + 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; + } + + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; + } + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + var MAX_SIGNED_31_BIT_INT = 1073741823; // Inlined Object.is polyfill. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + + function objectIs(x, y) { + if (x === y) { + return x !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } + } + + function createEventEmitter(value) { + var handlers = []; + return { + on: function on(handler) { + handlers.push(handler); + }, + off: function off(handler) { + handlers = handlers.filter(function (h) { + return h !== handler; + }); + }, + get: function get() { + return value; + }, + set: function set(newValue, changedBits) { + value = newValue; + handlers.forEach(function (handler) { + return handler(value, changedBits); + }); + } + }; + } + + function onlyChild(children) { + return Array.isArray(children) ? children[0] : children; + } + + function createReactContext(defaultValue, calculateChangedBits) { + var _defineProperty2, _defineProperty3; + + var contextProp = '__create-react-context-' + gud() + '__'; + + var Provider = + /*#__PURE__*/ + function (_Component) { + _inheritsLoose(Provider, _Component); + + function Provider() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _Component.call.apply(_Component, [this].concat(args)) || this; + + _defineProperty(_assertThisInitialized(_this), "emitter", createEventEmitter(_this.props.value)); + + return _this; + } + + var _proto = Provider.prototype; + + _proto.getChildContext = function getChildContext() { + var _ref; + + return _ref = {}, _ref[contextProp] = this.emitter, _ref; + }; + + _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if (this.props.value !== nextProps.value) { + var oldValue = this.props.value; + var newValue = nextProps.value; + var changedBits; + + if (objectIs(oldValue, newValue)) { + changedBits = 0; // No change + } else { + changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; + + { + warning((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits); + } + + changedBits |= 0; + + if (changedBits !== 0) { + this.emitter.set(nextProps.value, changedBits); + } + } + } + }; + + _proto.render = function render() { + return this.props.children; + }; + + return Provider; + }(React.Component); + + _defineProperty(Provider, "childContextTypes", (_defineProperty2 = {}, _defineProperty2[contextProp] = propTypes.object.isRequired, _defineProperty2)); + + var Consumer = + /*#__PURE__*/ + function (_Component2) { + _inheritsLoose(Consumer, _Component2); + + function Consumer() { + var _this2; + + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + _this2 = _Component2.call.apply(_Component2, [this].concat(args)) || this; + + _defineProperty(_assertThisInitialized(_this2), "observedBits", void 0); + + _defineProperty(_assertThisInitialized(_this2), "state", { + value: _this2.getValue() + }); + + _defineProperty(_assertThisInitialized(_this2), "onUpdate", function (newValue, changedBits) { + var observedBits = _this2.observedBits | 0; + + if ((observedBits & changedBits) !== 0) { + _this2.setState({ + value: _this2.getValue() + }); + } + }); + + return _this2; + } + + var _proto2 = Consumer.prototype; + + _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + var observedBits = nextProps.observedBits; + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default + : observedBits; + }; + + _proto2.componentDidMount = function componentDidMount() { + if (this.context[contextProp]) { + this.context[contextProp].on(this.onUpdate); + } + + var observedBits = this.props.observedBits; + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default + : observedBits; + }; + + _proto2.componentWillUnmount = function componentWillUnmount() { + if (this.context[contextProp]) { + this.context[contextProp].off(this.onUpdate); + } + }; + + _proto2.getValue = function getValue() { + if (this.context[contextProp]) { + return this.context[contextProp].get(); + } else { + return defaultValue; + } + }; + + _proto2.render = function render() { + return onlyChild(this.props.children)(this.state.value); + }; + + return Consumer; + }(React.Component); + + _defineProperty(Consumer, "contextTypes", (_defineProperty3 = {}, _defineProperty3[contextProp] = propTypes.object, _defineProperty3)); + + return { + Provider: Provider, + Consumer: Consumer + }; + } + + var index = React__default.createContext || createReactContext; + + function _inheritsLoose$1(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; + } + + function warning$1(condition, message) { + { + if (condition) { + return; + } + + console.warn(message); + } + } + + function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); + } + + function isAbsolute(pathname) { + return pathname.charAt(0) === '/'; + } + + // 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(); + } + + // This implementation is based heavily on node's url.parse + function resolvePathname(to) { + var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + + var toParts = to && to.split('/') || []; + var fromParts = from && from.split('/') || []; + + var isToAbs = to && isAbsolute(to); + var isFromAbs = from && isAbsolute(from); + var mustEndAbs = isToAbs || isFromAbs; + + if (to && isAbsolute(to)) { + // to is absolute + fromParts = toParts; + } else if (toParts.length) { + // to is relative, drop the filename + fromParts.pop(); + fromParts = fromParts.concat(toParts); + } + + if (!fromParts.length) return '/'; + + var hasTrailingSlash = void 0; + if (fromParts.length) { + var last = fromParts[fromParts.length - 1]; + hasTrailingSlash = last === '.' || last === '..' || last === ''; + } else { + hasTrailingSlash = false; + } + + var up = 0; + for (var i = fromParts.length; i >= 0; i--) { + var part = fromParts[i]; + + if (part === '.') { + spliceOne(fromParts, i); + } else if (part === '..') { + spliceOne(fromParts, i); + up++; + } else if (up) { + spliceOne(fromParts, i); + up--; + } + } + + if (!mustEndAbs) for (; up--; up) { + fromParts.unshift('..'); + }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(''); + + var result = fromParts.join('/'); + + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; + + return result; + } + + 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 valueEqual(a, b) { + if (a === b) return true; + + if (a == null || b == null) return false; + + if (Array.isArray(a)) { + return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return valueEqual(item, b[index]); + }); + } + + var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); + var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); + + if (aType !== bType) return false; + + if (aType === 'object') { + var aValue = a.valueOf(); + var bValue = b.valueOf(); + + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); + + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + + if (aKeys.length !== bKeys.length) return false; + + return aKeys.every(function (key) { + return valueEqual(a[key], b[key]); + }); + } + + return false; + } + + var prefix = 'Invariant failed'; + function invariant(condition, message) { + if (condition) { + return; + } + + { + throw new Error(prefix + ": " + (message || '')); + } + } + + function parsePath(path) { + var pathname = path || '/'; + var search = ''; + var hash = ''; + var hashIndex = pathname.indexOf('#'); + + if (hashIndex !== -1) { + hash = pathname.substr(hashIndex); + pathname = pathname.substr(0, hashIndex); + } + + var searchIndex = pathname.indexOf('?'); + + if (searchIndex !== -1) { + search = pathname.substr(searchIndex); + pathname = pathname.substr(0, searchIndex); + } + + return { + pathname: pathname, + search: search === '?' ? '' : search, + hash: hash === '#' ? '' : hash + }; + } + function createPath(location) { + var pathname = location.pathname, + search = location.search, + hash = location.hash; + var path = pathname || '/'; + if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search; + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash; + return path; + } + + function createLocation(path, state, key, currentLocation) { + var location; + + if (typeof path === 'string') { + // Two-arg form: push(path, state) + location = parsePath(path); + location.state = state; + } else { + // One-arg form: push(location) + location = _extends({}, path); + if (location.pathname === undefined) location.pathname = ''; + + if (location.search) { + if (location.search.charAt(0) !== '?') location.search = '?' + location.search; + } else { + location.search = ''; + } + + if (location.hash) { + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; + } else { + location.hash = ''; + } + + if (state !== undefined && location.state === undefined) location.state = state; + } + + try { + location.pathname = decodeURI(location.pathname); + } catch (e) { + if (e instanceof URIError) { + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); + } else { + throw e; + } + } + + if (key) location.key = key; + + if (currentLocation) { + // Resolve incomplete/relative pathname relative to current location. + if (!location.pathname) { + location.pathname = currentLocation.pathname; + } else if (location.pathname.charAt(0) !== '/') { + location.pathname = resolvePathname(location.pathname, currentLocation.pathname); + } + } else { + // When there is no prior location and pathname is empty, set it to / + if (!location.pathname) { + location.pathname = '/'; + } + } + + return location; + } + function locationsAreEqual(a, b) { + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state); + } + + function createTransitionManager() { + var prompt = null; + + function setPrompt(nextPrompt) { + warning$1(prompt == null, 'A history supports only one prompt at a time'); + prompt = nextPrompt; + return function () { + if (prompt === nextPrompt) prompt = null; + }; + } + + function confirmTransitionTo(location, action, getUserConfirmation, callback) { + // TODO: If another transition starts while we're still confirming + // the previous one, we may end up in a weird state. Figure out the + // best way to handle this. + if (prompt != null) { + var result = typeof prompt === 'function' ? prompt(location, action) : prompt; + + if (typeof result === 'string') { + if (typeof getUserConfirmation === 'function') { + getUserConfirmation(result, callback); + } else { + warning$1(false, 'A history needs a getUserConfirmation function in order to use a prompt message'); + callback(true); + } + } else { + // Return false from a transition hook to cancel the transition. + callback(result !== false); + } + } else { + callback(true); + } + } + + var listeners = []; + + function appendListener(fn) { + var isActive = true; + + function listener() { + if (isActive) fn.apply(void 0, arguments); + } + + listeners.push(listener); + return function () { + isActive = false; + listeners = listeners.filter(function (item) { + return item !== listener; + }); + }; + } + + function notifyListeners() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + listeners.forEach(function (listener) { + return listener.apply(void 0, args); + }); + } + + return { + setPrompt: setPrompt, + confirmTransitionTo: confirmTransitionTo, + appendListener: appendListener, + notifyListeners: notifyListeners + }; + } + + var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + + function clamp(n, lowerBound, upperBound) { + return Math.min(Math.max(n, lowerBound), upperBound); + } + /** + * Creates a history object that stores locations in memory. + */ + + + function createMemoryHistory(props) { + if (props === void 0) { + props = {}; + } + + var _props = props, + getUserConfirmation = _props.getUserConfirmation, + _props$initialEntries = _props.initialEntries, + initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries, + _props$initialIndex = _props.initialIndex, + initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex, + _props$keyLength = _props.keyLength, + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = history.entries.length; + transitionManager.notifyListeners(history.location, history.action); + } + + function createKey() { + return Math.random().toString(36).substr(2, keyLength); + } + + var index = clamp(initialIndex, 0, initialEntries.length - 1); + var entries = initialEntries.map(function (entry) { + return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey()); + }); // Public interface + + var createHref = createPath; + + function push(path, state) { + warning$1(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'PUSH'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var prevIndex = history.index; + var nextIndex = prevIndex + 1; + var nextEntries = history.entries.slice(0); + + if (nextEntries.length > nextIndex) { + nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); + } else { + nextEntries.push(location); + } + + setState({ + action: action, + location: location, + index: nextIndex, + entries: nextEntries + }); + }); + } + + function replace(path, state) { + warning$1(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'REPLACE'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + history.entries[history.index] = location; + setState({ + action: action, + location: location + }); + }); + } + + function go(n) { + var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); + var action = 'POP'; + var location = history.entries[nextIndex]; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location, + index: nextIndex + }); + } else { + // Mimic the behavior of DOM histories by + // causing a render after a cancelled POP. + setState(); + } + }); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + function canGo(n) { + var nextIndex = history.index + n; + return nextIndex >= 0 && nextIndex < history.entries.length; + } + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + return transitionManager.setPrompt(prompt); + } + + function listen(listener) { + return transitionManager.appendListener(listener); + } + + var history = { + length: entries.length, + action: 'POP', + location: entries[index], + index: index, + entries: entries, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + canGo: canGo, + block: block, + listen: listen + }; + return history; + } + + var isarray = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; + }; + + /** + * Expose `pathToRegexp`. + */ + var pathToRegexp_1 = pathToRegexp; + var parse_1 = parse; + var compile_1 = compile; + var tokensToFunction_1 = tokensToFunction; + var tokensToRegExp_1 = tokensToRegExp; + + /** + * The main path matching regexp utility. + * + * @type {RegExp} + */ + var PATH_REGEXP = new RegExp([ + // Match escaped characters that would otherwise appear in future matches. + // This allows the user to escape special characters that won't transform. + '(\\\\.)', + // Match Express-style parameters and un-named parameters with a prefix + // and optional suffixes. Matches appear as: + // + // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] + // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] + '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' + ].join('|'), 'g'); + + /** + * Parse a string for the raw tokens. + * + * @param {string} str + * @param {Object=} options + * @return {!Array} + */ + function parse (str, options) { + var tokens = []; + var key = 0; + var index = 0; + var path = ''; + var defaultDelimiter = options && options.delimiter || '/'; + var res; + + while ((res = PATH_REGEXP.exec(str)) != null) { + var m = res[0]; + var escaped = res[1]; + var offset = res.index; + path += str.slice(index, offset); + index = offset + m.length; + + // Ignore already escaped sequences. + if (escaped) { + path += escaped[1]; + continue + } + + var next = str[index]; + var prefix = res[2]; + var name = res[3]; + var capture = res[4]; + var group = res[5]; + var modifier = res[6]; + var asterisk = res[7]; + + // Push the current path onto the tokens. + if (path) { + tokens.push(path); + path = ''; + } + + var partial = prefix != null && next != null && next !== prefix; + var repeat = modifier === '+' || modifier === '*'; + var optional = modifier === '?' || modifier === '*'; + var delimiter = res[2] || defaultDelimiter; + var pattern = capture || group; + + tokens.push({ + name: name || key++, + prefix: prefix || '', + delimiter: delimiter, + optional: optional, + repeat: repeat, + partial: partial, + asterisk: !!asterisk, + pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') + }); + } + + // Match any characters still remaining. + if (index < str.length) { + path += str.substr(index); + } + + // If the path exists, push it onto the end. + if (path) { + tokens.push(path); + } + + return tokens + } + + /** + * Compile a string to a template function for the path. + * + * @param {string} str + * @param {Object=} options + * @return {!function(Object=, Object=)} + */ + function compile (str, options) { + return tokensToFunction(parse(str, options)) + } + + /** + * Prettier encoding of URI path segments. + * + * @param {string} + * @return {string} + */ + function encodeURIComponentPretty (str) { + return encodeURI(str).replace(/[\/?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) + } + + /** + * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. + * + * @param {string} + * @return {string} + */ + function encodeAsterisk (str) { + return encodeURI(str).replace(/[?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) + } + + /** + * Expose a method for transforming tokens into the path function. + */ + function tokensToFunction (tokens) { + // Compile all the tokens into regexps. + var matches = new Array(tokens.length); + + // Compile all the patterns before compilation. + for (var i = 0; i < tokens.length; i++) { + if (typeof tokens[i] === 'object') { + matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$'); + } + } + + return function (obj, opts) { + var path = ''; + var data = obj || {}; + var options = opts || {}; + var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent; + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + + if (typeof token === 'string') { + path += token; + + continue + } + + var value = data[token.name]; + var segment; + + if (value == null) { + if (token.optional) { + // Prepend partial segment prefixes. + if (token.partial) { + path += token.prefix; + } + + continue + } else { + throw new TypeError('Expected "' + token.name + '" to be defined') + } + } + + if (isarray(value)) { + if (!token.repeat) { + throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') + } + + if (value.length === 0) { + if (token.optional) { + continue + } else { + throw new TypeError('Expected "' + token.name + '" to not be empty') + } + } + + for (var j = 0; j < value.length; j++) { + segment = encode(value[j]); + + if (!matches[i].test(segment)) { + throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') + } + + path += (j === 0 ? token.prefix : token.delimiter) + segment; + } + + continue + } + + segment = token.asterisk ? encodeAsterisk(value) : encode(value); + + if (!matches[i].test(segment)) { + throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') + } + + path += token.prefix + segment; + } + + return path + } + } + + /** + * Escape a regular expression string. + * + * @param {string} str + * @return {string} + */ + function escapeString (str) { + return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') + } + + /** + * Escape the capturing group by escaping special characters and meaning. + * + * @param {string} group + * @return {string} + */ + function escapeGroup (group) { + return group.replace(/([=!:$\/()])/g, '\\$1') + } + + /** + * Attach the keys as a property of the regexp. + * + * @param {!RegExp} re + * @param {Array} keys + * @return {!RegExp} + */ + function attachKeys (re, keys) { + re.keys = keys; + return re + } + + /** + * Get the flags for a regexp from the options. + * + * @param {Object} options + * @return {string} + */ + function flags (options) { + return options.sensitive ? '' : 'i' + } + + /** + * Pull out keys from a regexp. + * + * @param {!RegExp} path + * @param {!Array} keys + * @return {!RegExp} + */ + function regexpToRegexp (path, keys) { + // Use a negative lookahead to match only capturing groups. + var groups = path.source.match(/\((?!\?)/g); + + if (groups) { + for (var i = 0; i < groups.length; i++) { + keys.push({ + name: i, + prefix: null, + delimiter: null, + optional: false, + repeat: false, + partial: false, + asterisk: false, + pattern: null + }); + } + } + + return attachKeys(path, keys) + } + + /** + * Transform an array into a regexp. + * + * @param {!Array} path + * @param {Array} keys + * @param {!Object} options + * @return {!RegExp} + */ + function arrayToRegexp (path, keys, options) { + var parts = []; + + for (var i = 0; i < path.length; i++) { + parts.push(pathToRegexp(path[i], keys, options).source); + } + + var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); + + return attachKeys(regexp, keys) + } + + /** + * Create a path regexp from string input. + * + * @param {string} path + * @param {!Array} keys + * @param {!Object} options + * @return {!RegExp} + */ + function stringToRegexp (path, keys, options) { + return tokensToRegExp(parse(path, options), keys, options) + } + + /** + * Expose a function for taking tokens and returning a RegExp. + * + * @param {!Array} tokens + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ + function tokensToRegExp (tokens, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options); + keys = []; + } + + options = options || {}; + + var strict = options.strict; + var end = options.end !== false; + var route = ''; + + // Iterate over the tokens and create our regexp string. + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + + if (typeof token === 'string') { + route += escapeString(token); + } else { + var prefix = escapeString(token.prefix); + var capture = '(?:' + token.pattern + ')'; + + keys.push(token); + + if (token.repeat) { + capture += '(?:' + prefix + capture + ')*'; + } + + if (token.optional) { + if (!token.partial) { + capture = '(?:' + prefix + '(' + capture + '))?'; + } else { + capture = prefix + '(' + capture + ')?'; + } + } else { + capture = prefix + '(' + capture + ')'; + } + + route += capture; + } + } + + var delimiter = escapeString(options.delimiter || '/'); + var endsWithDelimiter = route.slice(-delimiter.length) === delimiter; + + // In non-strict mode we allow a slash at the end of match. If the path to + // match already ends with a slash, we remove it for consistency. The slash + // is valid at the end of a path match, not in the middle. This is important + // in non-ending mode, where "/test/" shouldn't match "/test//route". + if (!strict) { + route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'; + } + + if (end) { + route += '$'; + } else { + // In non-ending mode, we need the capturing groups to match as much as + // possible by using a positive lookahead to the end or next path segment. + route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'; + } + + return attachKeys(new RegExp('^' + route, flags(options)), keys) + } + + /** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + * + * @param {(string|RegExp|Array)} path + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ + function pathToRegexp (path, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options); + keys = []; + } + + options = options || {}; + + if (path instanceof RegExp) { + return regexpToRegexp(path, /** @type {!Array} */ (keys)) + } + + if (isarray(path)) { + return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) + } + + return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) + } + pathToRegexp_1.parse = parse_1; + pathToRegexp_1.compile = compile_1; + pathToRegexp_1.tokensToFunction = tokensToFunction_1; + pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; + + var reactIs_production_min = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports,"__esModule",{value:!0}); + var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.concurrent_mode"):60111,m=b?Symbol.for("react.forward_ref"):60112,n=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):60115,r=b?Symbol.for("react.lazy"): + 60116;function t(a){if("object"===typeof a&&null!==a){var p=a.$$typeof;switch(p){case c:switch(a=a.type,a){case l:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case m:case h:return a;default:return p}}case d:return p}}}function u(a){return t(a)===l}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=l;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=m;exports.Fragment=e;exports.Profiler=g;exports.Portal=d; + exports.StrictMode=f;exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===l||a===g||a===f||a===n||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===m)};exports.isAsyncMode=function(a){return u(a)};exports.isConcurrentMode=u;exports.isContextConsumer=function(a){return t(a)===k};exports.isContextProvider=function(a){return t(a)===h}; + exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===m};exports.isFragment=function(a){return t(a)===e};exports.isProfiler=function(a){return t(a)===g};exports.isPortal=function(a){return t(a)===d};exports.isStrictMode=function(a){return t(a)===f}; + }); + + unwrapExports(reactIs_production_min); + var reactIs_production_min_1 = reactIs_production_min.typeOf; + var reactIs_production_min_2 = reactIs_production_min.AsyncMode; + var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode; + var reactIs_production_min_4 = reactIs_production_min.ContextConsumer; + var reactIs_production_min_5 = reactIs_production_min.ContextProvider; + var reactIs_production_min_6 = reactIs_production_min.Element; + var reactIs_production_min_7 = reactIs_production_min.ForwardRef; + var reactIs_production_min_8 = reactIs_production_min.Fragment; + var reactIs_production_min_9 = reactIs_production_min.Profiler; + var reactIs_production_min_10 = reactIs_production_min.Portal; + var reactIs_production_min_11 = reactIs_production_min.StrictMode; + var reactIs_production_min_12 = reactIs_production_min.isValidElementType; + var reactIs_production_min_13 = reactIs_production_min.isAsyncMode; + var reactIs_production_min_14 = reactIs_production_min.isConcurrentMode; + var reactIs_production_min_15 = reactIs_production_min.isContextConsumer; + var reactIs_production_min_16 = reactIs_production_min.isContextProvider; + var reactIs_production_min_17 = reactIs_production_min.isElement; + var reactIs_production_min_18 = reactIs_production_min.isForwardRef; + var reactIs_production_min_19 = reactIs_production_min.isFragment; + var reactIs_production_min_20 = reactIs_production_min.isProfiler; + var reactIs_production_min_21 = reactIs_production_min.isPortal; + var reactIs_production_min_22 = reactIs_production_min.isStrictMode; + + var reactIs_development = createCommonjsModule(function (module, exports) { + + + + { + (function() { + + Object.defineProperty(exports, '__esModule', { value: true }); + + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var hasSymbol = typeof Symbol === 'function' && Symbol.for; + + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + + function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); + } + + /** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + var lowPriorityWarning = function () {}; + + { + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; + } + + var lowPriorityWarning$1 = lowPriorityWarning; + + function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + + switch (type) { + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + + return undefined; + } + + // AsyncMode alias is deprecated along with isAsyncMode + var AsyncMode = REACT_CONCURRENT_MODE_TYPE; + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; + var ContextConsumer = REACT_CONTEXT_TYPE; + var ContextProvider = REACT_PROVIDER_TYPE; + var Element = REACT_ELEMENT_TYPE; + var ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment = REACT_FRAGMENT_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var Portal = REACT_PORTAL_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + + var hasWarnedAboutDeprecatedIsAsyncMode = false; + + // AsyncMode should be deprecated + function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } + return isConcurrentMode(object); + } + function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; + } + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; + } + function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + + exports.typeOf = typeOf; + exports.AsyncMode = AsyncMode; + exports.ConcurrentMode = ConcurrentMode; + exports.ContextConsumer = ContextConsumer; + exports.ContextProvider = ContextProvider; + exports.Element = Element; + exports.ForwardRef = ForwardRef; + exports.Fragment = Fragment; + exports.Profiler = Profiler; + exports.Portal = Portal; + exports.StrictMode = StrictMode; + exports.isValidElementType = isValidElementType; + exports.isAsyncMode = isAsyncMode; + exports.isConcurrentMode = isConcurrentMode; + exports.isContextConsumer = isContextConsumer; + exports.isContextProvider = isContextProvider; + exports.isElement = isElement; + exports.isForwardRef = isForwardRef; + exports.isFragment = isFragment; + exports.isProfiler = isProfiler; + exports.isPortal = isPortal; + exports.isStrictMode = isStrictMode; + })(); + } + }); + + unwrapExports(reactIs_development); + var reactIs_development_1 = reactIs_development.typeOf; + var reactIs_development_2 = reactIs_development.AsyncMode; + var reactIs_development_3 = reactIs_development.ConcurrentMode; + var reactIs_development_4 = reactIs_development.ContextConsumer; + var reactIs_development_5 = reactIs_development.ContextProvider; + var reactIs_development_6 = reactIs_development.Element; + var reactIs_development_7 = reactIs_development.ForwardRef; + var reactIs_development_8 = reactIs_development.Fragment; + var reactIs_development_9 = reactIs_development.Profiler; + var reactIs_development_10 = reactIs_development.Portal; + var reactIs_development_11 = reactIs_development.StrictMode; + var reactIs_development_12 = reactIs_development.isValidElementType; + var reactIs_development_13 = reactIs_development.isAsyncMode; + var reactIs_development_14 = reactIs_development.isConcurrentMode; + var reactIs_development_15 = reactIs_development.isContextConsumer; + var reactIs_development_16 = reactIs_development.isContextProvider; + var reactIs_development_17 = reactIs_development.isElement; + var reactIs_development_18 = reactIs_development.isForwardRef; + var reactIs_development_19 = reactIs_development.isFragment; + var reactIs_development_20 = reactIs_development.isProfiler; + var reactIs_development_21 = reactIs_development.isPortal; + var reactIs_development_22 = reactIs_development.isStrictMode; + + var reactIs = createCommonjsModule(function (module) { + + { + module.exports = reactIs_development; + } + }); + var reactIs_1 = reactIs.isValidElementType; + + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; + } + + /** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ + + + var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true + }; + + var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true + }; + + var FORWARD_REF_STATICS = { + '$$typeof': true, + render: true + }; + + var TYPE_STATICS = {}; + TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; + + var defineProperty = Object.defineProperty; + var getOwnPropertyNames = Object.getOwnPropertyNames; + var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + var getPrototypeOf = Object.getPrototypeOf; + var objectPrototype = Object.prototype; + + function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { + // don't hoist over string (html) components + + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + var keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols$1) { + keys = keys.concat(getOwnPropertySymbols$1(sourceComponent)); + } + + var targetStatics = TYPE_STATICS[targetComponent['$$typeof']] || REACT_STATICS; + var sourceStatics = TYPE_STATICS[sourceComponent['$$typeof']] || REACT_STATICS; + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + try { + // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + + return targetComponent; + } + + return targetComponent; + } + + var hoistNonReactStatics_cjs = hoistNonReactStatics; + + var createNamedContext = function createNamedContext(name) { + var context = index(); + context.displayName = name; + return context; + }; + + var context = + /*#__PURE__*/ + createNamedContext("Router"); + /** + * The public API for putting history on context. + */ + + var Router = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose$1(Router, _React$Component); + + Router.computeRootMatch = function computeRootMatch(pathname) { + return { + path: "/", + url: "/", + params: {}, + isExact: pathname === "/" + }; + }; + + function Router(props) { + var _this; + + _this = _React$Component.call(this, props) || this; + _this.state = { + location: props.history.location + }; // This is a bit of a hack. We have to start listening for location + // changes here in the constructor in case there are any s + // on the initial render. If there are, they will replace/push when + // they mount and since cDM fires in children before parents, we may + // get a new location before the is mounted. + + _this._isMounted = false; + _this._pendingLocation = null; + + if (!props.staticContext) { + _this.unlisten = props.history.listen(function (location) { + if (_this._isMounted) { + _this.setState({ + location: location + }); + } else { + _this._pendingLocation = location; + } + }); + } + + return _this; + } + + var _proto = Router.prototype; + + _proto.componentDidMount = function componentDidMount() { + this._isMounted = true; + + if (this._pendingLocation) { + this.setState({ + location: this._pendingLocation + }); + } + }; + + _proto.componentWillUnmount = function componentWillUnmount() { + if (this.unlisten) this.unlisten(); + }; + + _proto.render = function render() { + return React__default.createElement(context.Provider, { + children: this.props.children || null, + value: { + history: this.props.history, + location: this.state.location, + match: Router.computeRootMatch(this.state.location.pathname), + staticContext: this.props.staticContext + } + }); + }; + + return Router; + }(React__default.Component); + + { + Router.propTypes = { + children: propTypes.node, + history: propTypes.object.isRequired, + staticContext: propTypes.object + }; + + Router.prototype.componentDidUpdate = function (prevProps) { + warning$1(prevProps.history === this.props.history, "You cannot change "); + }; + } + /** + * The public API for a that stores location in memory. + */ + + + var MemoryRouter = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose$1(MemoryRouter, _React$Component); + + function MemoryRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.history = createMemoryHistory(_this.props); + return _this; + } + + var _proto = MemoryRouter.prototype; + + _proto.render = function render() { + return React__default.createElement(Router, { + history: this.history, + children: this.props.children + }); + }; + + return MemoryRouter; + }(React__default.Component); + + { + MemoryRouter.propTypes = { + initialEntries: propTypes.array, + initialIndex: propTypes.number, + getUserConfirmation: propTypes.func, + keyLength: propTypes.number, + children: propTypes.node + }; + + MemoryRouter.prototype.componentDidMount = function () { + warning$1(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`."); + }; + } + + var Lifecycle = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose$1(Lifecycle, _React$Component); + + function Lifecycle() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Lifecycle.prototype; + + _proto.componentDidMount = function componentDidMount() { + if (this.props.onMount) this.props.onMount.call(this, this); + }; + + _proto.componentDidUpdate = function componentDidUpdate(prevProps) { + if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps); + }; + + _proto.componentWillUnmount = function componentWillUnmount() { + if (this.props.onUnmount) this.props.onUnmount.call(this, this); + }; + + _proto.render = function render() { + return null; + }; + + return Lifecycle; + }(React__default.Component); + /** + * The public API for prompting the user before navigating away from a screen. + */ + + + function Prompt(_ref) { + var message = _ref.message, + _ref$when = _ref.when, + when = _ref$when === void 0 ? true : _ref$when; + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + if (!when || context$$1.staticContext) return null; + var method = context$$1.history.block; + return React__default.createElement(Lifecycle, { + onMount: function onMount(self) { + self.release = method(message); + }, + onUpdate: function onUpdate(self, prevProps) { + if (prevProps.message !== message) { + self.release(); + self.release = method(message); + } + }, + onUnmount: function onUnmount(self) { + self.release(); + }, + message: message + }); + }); + } + + { + var messageType = propTypes.oneOfType([propTypes.func, propTypes.string]); + Prompt.propTypes = { + when: propTypes.bool, + message: messageType.isRequired + }; + } + + var cache = {}; + var cacheLimit = 10000; + var cacheCount = 0; + + function compilePath(path) { + if (cache[path]) return cache[path]; + var generator = pathToRegexp_1.compile(path); + + if (cacheCount < cacheLimit) { + cache[path] = generator; + cacheCount++; + } + + return generator; + } + /** + * Public API for generating a URL pathname from a path and parameters. + */ + + + function generatePath(path, params) { + if (path === void 0) { + path = "/"; + } + + if (params === void 0) { + params = {}; + } + + return path === "/" ? path : compilePath(path)(params, { + pretty: true + }); + } + /** + * The public API for navigating programmatically with a component. + */ + + + function Redirect(_ref) { + var computedMatch = _ref.computedMatch, + to = _ref.to, + _ref$push = _ref.push, + push = _ref$push === void 0 ? false : _ref$push; + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + var history = context$$1.history, + staticContext = context$$1.staticContext; + var method = push ? history.push : history.replace; + var location = createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, { + pathname: generatePath(to.pathname, computedMatch.params) + }) : to); // When rendering in a static context, + // set the new location immediately. + + if (staticContext) { + method(location); + return null; + } + + return React__default.createElement(Lifecycle, { + onMount: function onMount() { + method(location); + }, + onUpdate: function onUpdate(self, prevProps) { + var prevLocation = createLocation(prevProps.to); + + if (!locationsAreEqual(prevLocation, _extends({}, location, { + key: prevLocation.key + }))) { + method(location); + } + }, + to: to + }); + }); + } + + { + Redirect.propTypes = { + push: propTypes.bool, + from: propTypes.string, + to: propTypes.oneOfType([propTypes.string, propTypes.object]).isRequired + }; + } + + var cache$1 = {}; + var cacheLimit$1 = 10000; + var cacheCount$1 = 0; + + function compilePath$1(path, options) { + var cacheKey = "" + options.end + options.strict + options.sensitive; + var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {}); + if (pathCache[path]) return pathCache[path]; + var keys = []; + var regexp = pathToRegexp_1(path, keys, options); + var result = { + regexp: regexp, + keys: keys + }; + + if (cacheCount$1 < cacheLimit$1) { + pathCache[path] = result; + cacheCount$1++; + } + + return result; + } + /** + * Public API for matching a URL pathname to a path. + */ + + + function matchPath(pathname, options) { + if (options === void 0) { + options = {}; + } + + if (typeof options === "string") options = { + path: options + }; + var _options = options, + path = _options.path, + _options$exact = _options.exact, + exact = _options$exact === void 0 ? false : _options$exact, + _options$strict = _options.strict, + strict = _options$strict === void 0 ? false : _options$strict, + _options$sensitive = _options.sensitive, + sensitive = _options$sensitive === void 0 ? false : _options$sensitive; + var paths = [].concat(path); + return paths.reduce(function (matched, path) { + if (!path) return null; + if (matched) return matched; + + var _compilePath = compilePath$1(path, { + end: exact, + strict: strict, + sensitive: sensitive + }), + regexp = _compilePath.regexp, + keys = _compilePath.keys; + + var match = regexp.exec(pathname); + if (!match) return null; + var url = match[0], + values = match.slice(1); + var isExact = pathname === url; + if (exact && !isExact) return null; + return { + path: path, + // the path used to match + url: path === "/" && url === "" ? "/" : url, + // the matched portion of the URL + isExact: isExact, + // whether or not we matched exactly + params: keys.reduce(function (memo, key, index$$1) { + memo[key.name] = values[index$$1]; + return memo; + }, {}) + }; + }, null); + } + + function isEmptyChildren(children) { + return React__default.Children.count(children) === 0; + } + /** + * The public API for matching a single path and rendering. + */ + + + var Route = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose$1(Route, _React$Component); + + function Route() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Route.prototype; + + _proto.render = function render() { + var _this = this; + + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + var location = _this.props.location || context$$1.location; + var match = _this.props.computedMatch ? _this.props.computedMatch // already computed the match for us + : _this.props.path ? matchPath(location.pathname, _this.props) : context$$1.match; + + var props = _extends({}, context$$1, { + location: location, + match: match + }); + + var _this$props = _this.props, + children = _this$props.children, + component = _this$props.component, + render = _this$props.render; // Preact uses an empty array as children by + // default, so use null if that's the case. + + if (Array.isArray(children) && children.length === 0) { + children = null; + } + + if (typeof children === "function") { + children = children(props); + + if (children === undefined) { + { + var path = _this.props.path; + warning$1(false, "You returned `undefined` from the `children` function of " + (", but you ") + "should have returned a React element or `null`"); + } + + children = null; + } + } + + return React__default.createElement(context.Provider, { + value: props + }, children && !isEmptyChildren(children) ? children : props.match ? component ? React__default.createElement(component, props) : render ? render(props) : null : null); + }); + }; + + return Route; + }(React__default.Component); + + { + Route.propTypes = { + children: propTypes.oneOfType([propTypes.func, propTypes.node]), + component: function component(props, propName) { + if (props[propName] && !reactIs_1(props[propName])) { + return new Error("Invalid prop 'component' supplied to 'Route': the prop is not a valid React component"); + } + }, + exact: propTypes.bool, + location: propTypes.object, + path: propTypes.oneOfType([propTypes.string, propTypes.arrayOf(propTypes.string)]), + render: propTypes.func, + sensitive: propTypes.bool, + strict: propTypes.bool + }; + + Route.prototype.componentDidMount = function () { + warning$1(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.component), "You should not use and in the same route; will be ignored"); + warning$1(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.render), "You should not use and in the same route; will be ignored"); + warning$1(!(this.props.component && this.props.render), "You should not use and in the same route; will be ignored"); + }; + + Route.prototype.componentDidUpdate = function (prevProps) { + warning$1(!(this.props.location && !prevProps.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); + warning$1(!(!this.props.location && prevProps.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); + }; + } + + function addLeadingSlash$1(path) { + return path.charAt(0) === "/" ? path : "/" + path; + } + + function addBasename(basename, location) { + if (!basename) return location; + return _extends({}, location, { + pathname: addLeadingSlash$1(basename) + location.pathname + }); + } + + function stripBasename$1(basename, location) { + if (!basename) return location; + var base = addLeadingSlash$1(basename); + if (location.pathname.indexOf(base) !== 0) return location; + return _extends({}, location, { + pathname: location.pathname.substr(base.length) + }); + } + + function createURL(location) { + return typeof location === "string" ? location : createPath(location); + } + + function staticHandler(methodName) { + return function () { + invariant(false, "You cannot %s with ", methodName); + }; + } + + function noop() {} + /** + * The public top-level API for a "static" , so-called because it + * can't actually change the current location. Instead, it just records + * location changes in a context object. Useful mainly in testing and + * server-rendering scenarios. + */ + + + var StaticRouter = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose$1(StaticRouter, _React$Component); + + function StaticRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + + _this.handlePush = function (location) { + return _this.navigateTo(location, "PUSH"); + }; + + _this.handleReplace = function (location) { + return _this.navigateTo(location, "REPLACE"); + }; + + _this.handleListen = function () { + return noop; + }; + + _this.handleBlock = function () { + return noop; + }; + + return _this; + } + + var _proto = StaticRouter.prototype; + + _proto.navigateTo = function navigateTo(location, action) { + var _this$props = this.props, + _this$props$basename = _this$props.basename, + basename = _this$props$basename === void 0 ? "" : _this$props$basename, + _this$props$context = _this$props.context, + context = _this$props$context === void 0 ? {} : _this$props$context; + context.action = action; + context.location = addBasename(basename, createLocation(location)); + context.url = createURL(context.location); + }; + + _proto.render = function render() { + var _this$props2 = this.props, + _this$props2$basename = _this$props2.basename, + basename = _this$props2$basename === void 0 ? "" : _this$props2$basename, + _this$props2$context = _this$props2.context, + context = _this$props2$context === void 0 ? {} : _this$props2$context, + _this$props2$location = _this$props2.location, + location = _this$props2$location === void 0 ? "/" : _this$props2$location, + rest = _objectWithoutPropertiesLoose(_this$props2, ["basename", "context", "location"]); + + var history = { + createHref: function createHref(path) { + return addLeadingSlash$1(basename + createURL(path)); + }, + action: "POP", + location: stripBasename$1(basename, createLocation(location)), + push: this.handlePush, + replace: this.handleReplace, + go: staticHandler("go"), + goBack: staticHandler("goBack"), + goForward: staticHandler("goForward"), + listen: this.handleListen, + block: this.handleBlock + }; + return React__default.createElement(Router, _extends({}, rest, { + history: history, + staticContext: context + })); + }; + + return StaticRouter; + }(React__default.Component); + + { + StaticRouter.propTypes = { + basename: propTypes.string, + context: propTypes.object, + location: propTypes.oneOfType([propTypes.string, propTypes.object]) + }; + + StaticRouter.prototype.componentDidMount = function () { + warning$1(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`."); + }; + } + /** + * The public API for rendering the first that matches. + */ + + + var Switch = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose$1(Switch, _React$Component); + + function Switch() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Switch.prototype; + + _proto.render = function render() { + var _this = this; + + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + var location = _this.props.location || context$$1.location; + var element, match; // We use React.Children.forEach instead of React.Children.toArray().find() + // here because toArray adds keys to all child elements and we do not want + // to trigger an unmount/remount for two s that render the same + // component at different URLs. + + React__default.Children.forEach(_this.props.children, function (child) { + if (match == null && React__default.isValidElement(child)) { + element = child; + var path = child.props.path || child.props.from; + match = path ? matchPath(location.pathname, _extends({}, child.props, { + path: path + })) : context$$1.match; + } + }); + return match ? React__default.cloneElement(element, { + location: location, + computedMatch: match + }) : null; + }); + }; + + return Switch; + }(React__default.Component); + + { + Switch.propTypes = { + children: propTypes.node, + location: propTypes.object + }; + + Switch.prototype.componentDidUpdate = function (prevProps) { + warning$1(!(this.props.location && !prevProps.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); + warning$1(!(!this.props.location && prevProps.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); + }; + } + /** + * A public higher-order component to access the imperative API + */ + + + function withRouter(Component) { + var displayName = "withRouter(" + (Component.displayName || Component.name) + ")"; + + var C = function C(props) { + var wrappedComponentRef = props.wrappedComponentRef, + remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]); + + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use <" + displayName + " /> outside a ") : void 0; + return React__default.createElement(Component, _extends({}, remainingProps, context$$1, { + ref: wrappedComponentRef + })); + }); + }; + + C.displayName = displayName; + C.WrappedComponent = Component; + + { + C.propTypes = { + wrappedComponentRef: propTypes.oneOfType([propTypes.string, propTypes.func, propTypes.object]) + }; + } + + return hoistNonReactStatics_cjs(C, Component); + } + + { + if (typeof window !== "undefined") { + var global$1 = window; + var key$1 = "__react_router_build__"; + var buildNames = { + cjs: "CommonJS", + esm: "ES modules", + umd: "UMD" + }; + + if (global$1[key$1] && global$1[key$1] !== "esm") { + var initialBuildName = buildNames[global$1[key$1]]; + var secondaryBuildName = buildNames["esm"]; // TODO: Add link to article that explains in detail how to avoid + // loading 2 different builds. + + throw new Error("You are loading the " + secondaryBuildName + " build of React Router " + ("on a page that is already running the " + initialBuildName + " ") + "build, so things won't work right."); + } + + global$1[key$1] = "esm"; + } + } + + function _inheritsLoose$2(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; + } + + function _extends$1() { + _extends$1 = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends$1.apply(this, arguments); + } + + function isAbsolute$1(pathname) { + return pathname.charAt(0) === '/'; + } + + // About 1.5x faster than the two-arg version of Array#splice() + function spliceOne$1(list, index) { + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) { + list[i] = list[k]; + } + + list.pop(); + } + + // This implementation is based heavily on node's url.parse + function resolvePathname$1(to) { + var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + + var toParts = to && to.split('/') || []; + var fromParts = from && from.split('/') || []; + + var isToAbs = to && isAbsolute$1(to); + var isFromAbs = from && isAbsolute$1(from); + var mustEndAbs = isToAbs || isFromAbs; + + if (to && isAbsolute$1(to)) { + // to is absolute + fromParts = toParts; + } else if (toParts.length) { + // to is relative, drop the filename + fromParts.pop(); + fromParts = fromParts.concat(toParts); + } + + if (!fromParts.length) return '/'; + + var hasTrailingSlash = void 0; + if (fromParts.length) { + var last = fromParts[fromParts.length - 1]; + hasTrailingSlash = last === '.' || last === '..' || last === ''; + } else { + hasTrailingSlash = false; + } + + var up = 0; + for (var i = fromParts.length; i >= 0; i--) { + var part = fromParts[i]; + + if (part === '.') { + spliceOne$1(fromParts, i); + } else if (part === '..') { + spliceOne$1(fromParts, i); + up++; + } else if (up) { + spliceOne$1(fromParts, i); + up--; + } + } + + if (!mustEndAbs) for (; up--; up) { + fromParts.unshift('..'); + }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute$1(fromParts[0]))) fromParts.unshift(''); + + var result = fromParts.join('/'); + + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; + + return result; + } + + var _typeof$1 = 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 valueEqual$1(a, b) { + if (a === b) return true; + + if (a == null || b == null) return false; + + if (Array.isArray(a)) { + return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return valueEqual$1(item, b[index]); + }); + } + + var aType = typeof a === 'undefined' ? 'undefined' : _typeof$1(a); + var bType = typeof b === 'undefined' ? 'undefined' : _typeof$1(b); + + if (aType !== bType) return false; + + if (aType === 'object') { + var aValue = a.valueOf(); + var bValue = b.valueOf(); + + if (aValue !== a || bValue !== b) return valueEqual$1(aValue, bValue); + + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + + if (aKeys.length !== bKeys.length) return false; + + return aKeys.every(function (key) { + return valueEqual$1(a[key], b[key]); + }); + } + + return false; + } + + function warning$2(condition, message) { + { + if (condition) { + return; + } + + console.warn(message); + } + } + + var prefix$1 = 'Invariant failed'; + function invariant$1(condition, message) { + if (condition) { + return; + } + + { + throw new Error(prefix$1 + ": " + (message || '')); + } + } + + function addLeadingSlash$2(path) { + return path.charAt(0) === '/' ? path : '/' + path; + } + function stripLeadingSlash$1(path) { + return path.charAt(0) === '/' ? path.substr(1) : path; + } + function hasBasename$1(path, prefix) { + return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path); + } + function stripBasename$2(path, prefix) { + return hasBasename$1(path, prefix) ? path.substr(prefix.length) : path; + } + function stripTrailingSlash$1(path) { + return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path; + } + function parsePath$1(path) { + var pathname = path || '/'; + var search = ''; + var hash = ''; + var hashIndex = pathname.indexOf('#'); + + if (hashIndex !== -1) { + hash = pathname.substr(hashIndex); + pathname = pathname.substr(0, hashIndex); + } + + var searchIndex = pathname.indexOf('?'); + + if (searchIndex !== -1) { + search = pathname.substr(searchIndex); + pathname = pathname.substr(0, searchIndex); + } + + return { + pathname: pathname, + search: search === '?' ? '' : search, + hash: hash === '#' ? '' : hash + }; + } + function createPath$1(location) { + var pathname = location.pathname, + search = location.search, + hash = location.hash; + var path = pathname || '/'; + if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search; + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash; + return path; + } + + function createLocation$1(path, state, key, currentLocation) { + var location; + + if (typeof path === 'string') { + // Two-arg form: push(path, state) + location = parsePath$1(path); + location.state = state; + } else { + // One-arg form: push(location) + location = _extends$1({}, path); + if (location.pathname === undefined) location.pathname = ''; + + if (location.search) { + if (location.search.charAt(0) !== '?') location.search = '?' + location.search; + } else { + location.search = ''; + } + + if (location.hash) { + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; + } else { + location.hash = ''; + } + + if (state !== undefined && location.state === undefined) location.state = state; + } + + try { + location.pathname = decodeURI(location.pathname); + } catch (e) { + if (e instanceof URIError) { + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); + } else { + throw e; + } + } + + if (key) location.key = key; + + if (currentLocation) { + // Resolve incomplete/relative pathname relative to current location. + if (!location.pathname) { + location.pathname = currentLocation.pathname; + } else if (location.pathname.charAt(0) !== '/') { + location.pathname = resolvePathname$1(location.pathname, currentLocation.pathname); + } + } else { + // When there is no prior location and pathname is empty, set it to / + if (!location.pathname) { + location.pathname = '/'; + } + } + + return location; + } + function locationsAreEqual$1(a, b) { + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual$1(a.state, b.state); + } + + function createTransitionManager$1() { + var prompt = null; + + function setPrompt(nextPrompt) { + warning$2(prompt == null, 'A history supports only one prompt at a time'); + prompt = nextPrompt; + return function () { + if (prompt === nextPrompt) prompt = null; + }; + } + + function confirmTransitionTo(location, action, getUserConfirmation, callback) { + // TODO: If another transition starts while we're still confirming + // the previous one, we may end up in a weird state. Figure out the + // best way to handle this. + if (prompt != null) { + var result = typeof prompt === 'function' ? prompt(location, action) : prompt; + + if (typeof result === 'string') { + if (typeof getUserConfirmation === 'function') { + getUserConfirmation(result, callback); + } else { + warning$2(false, 'A history needs a getUserConfirmation function in order to use a prompt message'); + callback(true); + } + } else { + // Return false from a transition hook to cancel the transition. + callback(result !== false); + } + } else { + callback(true); + } + } + + var listeners = []; + + function appendListener(fn) { + var isActive = true; + + function listener() { + if (isActive) fn.apply(void 0, arguments); + } + + listeners.push(listener); + return function () { + isActive = false; + listeners = listeners.filter(function (item) { + return item !== listener; + }); + }; + } + + function notifyListeners() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + listeners.forEach(function (listener) { + return listener.apply(void 0, args); + }); + } + + return { + setPrompt: setPrompt, + confirmTransitionTo: confirmTransitionTo, + appendListener: appendListener, + notifyListeners: notifyListeners + }; + } + + var canUseDOM$1 = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + function getConfirmation$1(message, callback) { + callback(window.confirm(message)); // eslint-disable-line no-alert + } + /** + * Returns true if the HTML5 history API is supported. Taken from Modernizr. + * + * https://github.com/Modernizr/Modernizr/blob/master/LICENSE + * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js + * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586 + */ + + function supportsHistory$1() { + var ua = window.navigator.userAgent; + if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; + return window.history && 'pushState' in window.history; + } + /** + * Returns true if browser fires popstate on hash change. + * IE10 and IE11 do not. + */ + + function supportsPopStateOnHashChange$1() { + return window.navigator.userAgent.indexOf('Trident') === -1; + } + /** + * Returns false if using go(n) with hash history causes a full page reload. + */ + + function supportsGoWithoutReloadUsingHash$1() { + return window.navigator.userAgent.indexOf('Firefox') === -1; + } + /** + * Returns true if a given popstate event is an extraneous WebKit event. + * Accounts for the fact that Chrome on iOS fires real popstate events + * containing undefined state when pressing the back button. + */ + + function isExtraneousPopstateEvent$1(event) { + event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; + } + + var PopStateEvent$1 = 'popstate'; + var HashChangeEvent$2 = 'hashchange'; + + function getHistoryState$1() { + try { + return window.history.state || {}; + } catch (e) { + // IE 11 sometimes throws when accessing window.history.state + // See https://github.com/ReactTraining/history/pull/289 + return {}; + } + } + /** + * Creates a history object that uses the HTML5 history API including + * pushState, replaceState, and the popstate event. + */ + + + function createBrowserHistory$1(props) { + if (props === void 0) { + props = {}; + } + + !canUseDOM$1 ? invariant$1(false, 'Browser history needs a DOM') : void 0; + var globalHistory = window.history; + var canUseHistory = supportsHistory$1(); + var needsHashChangeListener = !supportsPopStateOnHashChange$1(); + var _props = props, + _props$forceRefresh = _props.forceRefresh, + forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, + _props$getUserConfirm = _props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation$1 : _props$getUserConfirm, + _props$keyLength = _props.keyLength, + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; + var basename = props.basename ? stripTrailingSlash$1(addLeadingSlash$2(props.basename)) : ''; + + function getDOMLocation(historyState) { + var _ref = historyState || {}, + key = _ref.key, + state = _ref.state; + + var _window$location = window.location, + pathname = _window$location.pathname, + search = _window$location.search, + hash = _window$location.hash; + var path = pathname + search + hash; + warning$2(!basename || hasBasename$1(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); + if (basename) path = stripBasename$2(path, basename); + return createLocation$1(path, state, key); + } + + function createKey() { + return Math.random().toString(36).substr(2, keyLength); + } + + var transitionManager = createTransitionManager$1(); + + function setState(nextState) { + _extends$1(history, nextState); + + history.length = globalHistory.length; + transitionManager.notifyListeners(history.location, history.action); + } + + function handlePopState(event) { + // Ignore extraneous popstate events in WebKit. + if (isExtraneousPopstateEvent$1(event)) return; + handlePop(getDOMLocation(event.state)); + } + + function handleHashChange() { + handlePop(getDOMLocation(getHistoryState$1())); + } + + var forceNextPop = false; + + function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location + }); + } else { + revertPop(location); + } + }); + } + } + + function revertPop(fromLocation) { + var toLocation = history.location; // TODO: We could probably make this more reliable by + // keeping a list of keys we've seen in sessionStorage. + // Instead, we just default to 0 for keys we don't know. + + var toIndex = allKeys.indexOf(toLocation.key); + if (toIndex === -1) toIndex = 0; + var fromIndex = allKeys.indexOf(fromLocation.key); + if (fromIndex === -1) fromIndex = 0; + var delta = toIndex - fromIndex; + + if (delta) { + forceNextPop = true; + go(delta); + } + } + + var initialLocation = getDOMLocation(getHistoryState$1()); + var allKeys = [initialLocation.key]; // Public interface + + function createHref(location) { + return basename + createPath$1(location); + } + + function push(path, state) { + warning$2(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'PUSH'; + var location = createLocation$1(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var href = createHref(location); + var key = location.key, + state = location.state; + + if (canUseHistory) { + globalHistory.pushState({ + key: key, + state: state + }, null, href); + + if (forceRefresh) { + window.location.href = href; + } else { + var prevIndex = allKeys.indexOf(history.location.key); + var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + nextKeys.push(location.key); + allKeys = nextKeys; + setState({ + action: action, + location: location + }); + } + } else { + warning$2(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history'); + window.location.href = href; + } + }); + } + + function replace(path, state) { + warning$2(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'REPLACE'; + var location = createLocation$1(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var href = createHref(location); + var key = location.key, + state = location.state; + + if (canUseHistory) { + globalHistory.replaceState({ + key: key, + state: state + }, null, href); + + if (forceRefresh) { + window.location.replace(href); + } else { + var prevIndex = allKeys.indexOf(history.location.key); + if (prevIndex !== -1) allKeys[prevIndex] = location.key; + setState({ + action: action, + location: location + }); + } + } else { + warning$2(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history'); + window.location.replace(href); + } + }); + } + + function go(n) { + globalHistory.go(n); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + var listenerCount = 0; + + function checkDOMListeners(delta) { + listenerCount += delta; + + if (listenerCount === 1 && delta === 1) { + window.addEventListener(PopStateEvent$1, handlePopState); + if (needsHashChangeListener) window.addEventListener(HashChangeEvent$2, handleHashChange); + } else if (listenerCount === 0) { + window.removeEventListener(PopStateEvent$1, handlePopState); + if (needsHashChangeListener) window.removeEventListener(HashChangeEvent$2, handleHashChange); + } + } + + var isBlocked = false; + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + var unblock = transitionManager.setPrompt(prompt); + + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } + + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } + + return unblock(); + }; + } + + function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); + return function () { + checkDOMListeners(-1); + unlisten(); + }; + } + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; + return history; + } + + var HashChangeEvent$1$1 = 'hashchange'; + var HashPathCoders$1 = { + hashbang: { + encodePath: function encodePath(path) { + return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash$1(path); + }, + decodePath: function decodePath(path) { + return path.charAt(0) === '!' ? path.substr(1) : path; + } + }, + noslash: { + encodePath: stripLeadingSlash$1, + decodePath: addLeadingSlash$2 + }, + slash: { + encodePath: addLeadingSlash$2, + decodePath: addLeadingSlash$2 + } + }; + + function getHashPath$1() { + // We can't use window.location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + var href = window.location.href; + var hashIndex = href.indexOf('#'); + return hashIndex === -1 ? '' : href.substring(hashIndex + 1); + } + + function pushHashPath$1(path) { + window.location.hash = path; + } + + function replaceHashPath$1(path) { + var hashIndex = window.location.href.indexOf('#'); + window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path); + } + + function createHashHistory$1(props) { + if (props === void 0) { + props = {}; + } + + !canUseDOM$1 ? invariant$1(false, 'Hash history needs a DOM') : void 0; + var globalHistory = window.history; + var canGoWithoutReload = supportsGoWithoutReloadUsingHash$1(); + var _props = props, + _props$getUserConfirm = _props.getUserConfirmation, + getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation$1 : _props$getUserConfirm, + _props$hashType = _props.hashType, + hashType = _props$hashType === void 0 ? 'slash' : _props$hashType; + var basename = props.basename ? stripTrailingSlash$1(addLeadingSlash$2(props.basename)) : ''; + var _HashPathCoders$hashT = HashPathCoders$1[hashType], + encodePath = _HashPathCoders$hashT.encodePath, + decodePath = _HashPathCoders$hashT.decodePath; + + function getDOMLocation() { + var path = decodePath(getHashPath$1()); + warning$2(!basename || hasBasename$1(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); + if (basename) path = stripBasename$2(path, basename); + return createLocation$1(path); + } + + var transitionManager = createTransitionManager$1(); + + function setState(nextState) { + _extends$1(history, nextState); + + history.length = globalHistory.length; + transitionManager.notifyListeners(history.location, history.action); + } + + var forceNextPop = false; + var ignorePath = null; + + function handleHashChange() { + var path = getHashPath$1(); + var encodedPath = encodePath(path); + + if (path !== encodedPath) { + // Ensure we always have a properly-encoded hash. + replaceHashPath$1(encodedPath); + } else { + var location = getDOMLocation(); + var prevLocation = history.location; + if (!forceNextPop && locationsAreEqual$1(prevLocation, location)) return; // A hashchange doesn't always == location change. + + if (ignorePath === createPath$1(location)) return; // Ignore this change; we already setState in push/replace. + + ignorePath = null; + handlePop(location); + } + } + + function handlePop(location) { + if (forceNextPop) { + forceNextPop = false; + setState(); + } else { + var action = 'POP'; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location + }); + } else { + revertPop(location); + } + }); + } + } + + function revertPop(fromLocation) { + var toLocation = history.location; // TODO: We could probably make this more reliable by + // keeping a list of paths we've seen in sessionStorage. + // Instead, we just default to 0 for paths we don't know. + + var toIndex = allPaths.lastIndexOf(createPath$1(toLocation)); + if (toIndex === -1) toIndex = 0; + var fromIndex = allPaths.lastIndexOf(createPath$1(fromLocation)); + if (fromIndex === -1) fromIndex = 0; + var delta = toIndex - fromIndex; + + if (delta) { + forceNextPop = true; + go(delta); + } + } // Ensure the hash is encoded properly before doing anything else. + + + var path = getHashPath$1(); + var encodedPath = encodePath(path); + if (path !== encodedPath) replaceHashPath$1(encodedPath); + var initialLocation = getDOMLocation(); + var allPaths = [createPath$1(initialLocation)]; // Public interface + + function createHref(location) { + return '#' + encodePath(basename + createPath$1(location)); + } + + function push(path, state) { + warning$2(state === undefined, 'Hash history cannot push state; it is ignored'); + var action = 'PUSH'; + var location = createLocation$1(path, undefined, undefined, history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var path = createPath$1(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath$1() !== encodedPath; + + if (hashChanged) { + // We cannot tell if a hashchange was caused by a PUSH, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + pushHashPath$1(encodedPath); + var prevIndex = allPaths.lastIndexOf(createPath$1(history.location)); + var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); + nextPaths.push(path); + allPaths = nextPaths; + setState({ + action: action, + location: location + }); + } else { + warning$2(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack'); + setState(); + } + }); + } + + function replace(path, state) { + warning$2(state === undefined, 'Hash history cannot replace state; it is ignored'); + var action = 'REPLACE'; + var location = createLocation$1(path, undefined, undefined, history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var path = createPath$1(location); + var encodedPath = encodePath(basename + path); + var hashChanged = getHashPath$1() !== encodedPath; + + if (hashChanged) { + // We cannot tell if a hashchange was caused by a REPLACE, so we'd + // rather setState here and ignore the hashchange. The caveat here + // is that other hash histories in the page will consider it a POP. + ignorePath = path; + replaceHashPath$1(encodedPath); + } + + var prevIndex = allPaths.indexOf(createPath$1(history.location)); + if (prevIndex !== -1) allPaths[prevIndex] = path; + setState({ + action: action, + location: location + }); + }); + } + + function go(n) { + warning$2(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser'); + globalHistory.go(n); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + var listenerCount = 0; + + function checkDOMListeners(delta) { + listenerCount += delta; + + if (listenerCount === 1 && delta === 1) { + window.addEventListener(HashChangeEvent$1$1, handleHashChange); + } else if (listenerCount === 0) { + window.removeEventListener(HashChangeEvent$1$1, handleHashChange); + } + } + + var isBlocked = false; + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + var unblock = transitionManager.setPrompt(prompt); + + if (!isBlocked) { + checkDOMListeners(1); + isBlocked = true; + } + + return function () { + if (isBlocked) { + isBlocked = false; + checkDOMListeners(-1); + } + + return unblock(); + }; + } + + function listen(listener) { + var unlisten = transitionManager.appendListener(listener); + checkDOMListeners(1); + return function () { + checkDOMListeners(-1); + unlisten(); + }; + } + + var history = { + length: globalHistory.length, + action: 'POP', + location: initialLocation, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + block: block, + listen: listen + }; + return history; + } + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols$2 = Object.getOwnPropertySymbols; + var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + var propIsEnumerable$1 = Object.prototype.propertyIsEnumerable; + + function toObject$1(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + function shouldUseNative$1() { + 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; + } + } + + var objectAssign$1 = shouldUseNative$1() ? Object.assign : function (target, source) { + var from; + var to = toObject$1(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty$1.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols$2) { + symbols = getOwnPropertySymbols$2(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable$1.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; + }; + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + var ReactPropTypesSecret$2 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + + var ReactPropTypesSecret_1$1 = ReactPropTypesSecret$2; + + var printWarning$2 = function() {}; + + { + var ReactPropTypesSecret$3 = ReactPropTypesSecret_1$1; + var loggedTypeFailures$1 = {}; + + printWarning$2 = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } + + /** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ + function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) { + { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$3); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning$2( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ); + + } + if (error instanceof Error && !(error.message in loggedTypeFailures$1)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures$1[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning$2( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } + } + + var checkPropTypes_1$1 = checkPropTypes$1; + + var printWarning$3 = function() {}; + + { + printWarning$3 = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } + + function emptyFunctionThatReturnsNull$1() { + return null; + } + + var factoryWithTypeCheckers$1 = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret_1$1) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if (typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning$3( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull$1); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1$1); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + printWarning$3('Invalid argument supplied to oneOf, expected an instance of array.'); + return emptyFunctionThatReturnsNull$1; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1$1); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + printWarning$3('Invalid argument supplied to oneOfType, expected an instance of array.'); + return emptyFunctionThatReturnsNull$1; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning$3( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull$1; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1$1) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1$1); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = objectAssign$1({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1$1); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes_1$1; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; + }; + + var propTypes$1 = createCommonjsModule(function (module) { + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = factoryWithTypeCheckers$1(isValidElement, throwOnDirectAccess); + } + }); + + /** + * The public API for a that uses HTML5 history. + */ + + var BrowserRouter = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose$2(BrowserRouter, _React$Component); + + function BrowserRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.history = createBrowserHistory$1(_this.props); + return _this; + } + + var _proto = BrowserRouter.prototype; + + _proto.render = function render() { + return React__default.createElement(Router, { + history: this.history, + children: this.props.children + }); + }; + + return BrowserRouter; + }(React__default.Component); + + { + BrowserRouter.propTypes = { + basename: propTypes$1.string, + children: propTypes$1.node, + forceRefresh: propTypes$1.bool, + getUserConfirmation: propTypes$1.func, + keyLength: propTypes$1.number + }; + + BrowserRouter.prototype.componentDidMount = function () { + warning$2(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { BrowserRouter as Router }`."); + }; + } + + /** + * The public API for a that uses window.location.hash. + */ + + var HashRouter = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose$2(HashRouter, _React$Component); + + function HashRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.history = createHashHistory$1(_this.props); + return _this; + } + + var _proto = HashRouter.prototype; + + _proto.render = function render() { + return React__default.createElement(Router, { + history: this.history, + children: this.props.children + }); + }; + + return HashRouter; + }(React__default.Component); + + { + HashRouter.propTypes = { + basename: propTypes$1.string, + children: propTypes$1.node, + getUserConfirmation: propTypes$1.func, + hashType: propTypes$1.oneOf(["hashbang", "noslash", "slash"]) + }; + + HashRouter.prototype.componentDidMount = function () { + warning$2(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { HashRouter as Router }`."); + }; + } + + function _objectWithoutPropertiesLoose$1(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; + } + + function isModifiedEvent(event) { + return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); + } + /** + * The public API for rendering a history-aware . + */ + + + var Link = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose$2(Link, _React$Component); + + function Link() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Link.prototype; + + _proto.handleClick = function handleClick(event, history) { + try { + if (this.props.onClick) this.props.onClick(event); + } catch (ex) { + event.preventDefault(); + throw ex; + } + + if (!event.defaultPrevented && // onClick prevented default + event.button === 0 && ( // ignore everything but left clicks + !this.props.target || this.props.target === "_self") && // let browser handle "target=_blank" etc. + !isModifiedEvent(event) // ignore clicks with modifier keys + ) { + event.preventDefault(); + var method = this.props.replace ? history.replace : history.push; + method(this.props.to); + } + }; + + _proto.render = function render() { + var _this = this; + + var _this$props = this.props, + innerRef = _this$props.innerRef, + replace = _this$props.replace, + to = _this$props.to, + rest = _objectWithoutPropertiesLoose$1(_this$props, ["innerRef", "replace", "to"]); // eslint-disable-line no-unused-vars + + + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant$1(false, "You should not use outside a ") : void 0; + var location = typeof to === "string" ? createLocation$1(to, null, null, context$$1.location) : to; + var href = location ? context$$1.history.createHref(location) : ""; + return React__default.createElement("a", _extends$1({}, rest, { + onClick: function onClick(event) { + return _this.handleClick(event, context$$1.history); + }, + href: href, + ref: innerRef + })); + }); + }; + + return Link; + }(React__default.Component); + + { + var toType = propTypes$1.oneOfType([propTypes$1.string, propTypes$1.object]); + var innerRefType = propTypes$1.oneOfType([propTypes$1.string, propTypes$1.func, propTypes$1.shape({ + current: propTypes$1.any + })]); + Link.propTypes = { + innerRef: innerRefType, + onClick: propTypes$1.func, + replace: propTypes$1.bool, + target: propTypes$1.string, + to: toType.isRequired + }; + } + + function joinClassnames() { + for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) { + classnames[_key] = arguments[_key]; + } + + return classnames.filter(function (i) { + return i; + }).join(" "); + } + /** + * A wrapper that knows if it's "active" or not. + */ + + + function NavLink(_ref) { + var _ref$ariaCurrent = _ref["aria-current"], + ariaCurrent = _ref$ariaCurrent === void 0 ? "page" : _ref$ariaCurrent, + _ref$activeClassName = _ref.activeClassName, + activeClassName = _ref$activeClassName === void 0 ? "active" : _ref$activeClassName, + activeStyle = _ref.activeStyle, + classNameProp = _ref.className, + exact = _ref.exact, + isActiveProp = _ref.isActive, + locationProp = _ref.location, + strict = _ref.strict, + styleProp = _ref.style, + to = _ref.to, + rest = _objectWithoutPropertiesLoose$1(_ref, ["aria-current", "activeClassName", "activeStyle", "className", "exact", "isActive", "location", "strict", "style", "to"]); + + var path = typeof to === "object" ? to.pathname : to; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202 + + var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant$1(false, "You should not use outside a ") : void 0; + var pathToMatch = locationProp ? locationProp.pathname : context$$1.location.pathname; + var match = escapedPath ? matchPath(pathToMatch, { + path: escapedPath, + exact: exact, + strict: strict + }) : null; + var isActive = !!(isActiveProp ? isActiveProp(match, context$$1.location) : match); + var className = isActive ? joinClassnames(classNameProp, activeClassName) : classNameProp; + var style = isActive ? _extends$1({}, styleProp, activeStyle) : styleProp; + return React__default.createElement(Link, _extends$1({ + "aria-current": isActive && ariaCurrent || null, + className: className, + style: style, + to: to + }, rest)); + }); + } + + { + var ariaCurrentType = propTypes$1.oneOf(["page", "step", "location", "date", "time", "true"]); + NavLink.propTypes = _extends$1({}, Link.propTypes, { + "aria-current": ariaCurrentType, + activeClassName: propTypes$1.string, + activeStyle: propTypes$1.object, + className: propTypes$1.string, + exact: propTypes$1.bool, + isActive: propTypes$1.func, + location: propTypes$1.object, + strict: propTypes$1.bool, + style: propTypes$1.object + }); + } + + exports.BrowserRouter = BrowserRouter; + exports.HashRouter = HashRouter; + exports.Link = Link; + exports.NavLink = NavLink; + exports.MemoryRouter = MemoryRouter; + exports.Prompt = Prompt; + exports.Redirect = Redirect; + exports.Route = Route; + exports.Router = Router; + exports.StaticRouter = StaticRouter; + exports.Switch = Switch; + exports.generatePath = generatePath; + exports.matchPath = matchPath; + exports.withRouter = withRouter; + exports.__RouterContext = context; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/react-router-dom/umd/react-router-dom.min.js b/node_modules/react-router-dom/umd/react-router-dom.min.js new file mode 100644 index 00000000..7e8af3e3 --- /dev/null +++ b/node_modules/react-router-dom/umd/react-router-dom.min.js @@ -0,0 +1 @@ +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n(t.ReactRouterDOM={},t.React)}(this,function(t,c){"use strict";var g="default"in c?c.default:c,u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function e(t,n){return t(n={exports:{}},n.exports),n.exports}var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var n={},e=0;e<10;e++)n["_"+String.fromCharCode(e)]=e;if("0123456789"!==Object.getOwnPropertyNames(n).map(function(t){return n[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()||Object.assign;function a(){}var s=e(function(t){t.exports=function(){function t(t,n,e,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function n(){return t}var e={array:t.isRequired=t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:n,element:t,instanceOf:n,node:t,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n};return e.checkPropTypes=a,e.PropTypes=e}()}),f="__global_unique_id__";function l(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function p(t,n){t.prototype=Object.create(n.prototype),(t.prototype.constructor=t).__proto__=n}function h(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var d=1073741823;var v=g.createContext||function(e,i){var t,n,r="__create-react-context-"+(u[f]=(u[f]||0)+1)+"__",o=function(o){function t(){for(var t,n=arguments.length,e=new Array(n),r=0;rn?e.splice(n,e.length-n,r):e.push(r),f({action:"PUSH",location:r,index:n,entries:e})}})},replace:function(t,n){var e="REPLACE",r=C(t,n,l(),y.location);s.confirmTransitionTo(r,e,o,function(t){t&&(y.entries[y.index]=r,f({action:e,location:r}))})},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(t){var n=y.index+t;return 0<=n&&n 0 + ? format.replace(/%s/g, function() { + return subs[index++]; + }) + : format); + + if (typeof console !== "undefined") { + console.error(message); + } + + try { + // --- Welcome to debugging React Router --- + // This error was thrown as a convenience so that you can use the + // stack trace to find the callsite that triggered this warning. + throw new Error(message); + } catch (e) {} + }; +} + +module.exports = function(member) { + printWarning( + 'Please use `require("react-router-dom").%s` instead of `require("react-router-dom/%s")`. ' + + "Support for the latter will be removed in the next major release.", + [member, member] + ); +}; diff --git a/node_modules/react-router-dom/withRouter.js b/node_modules/react-router-dom/withRouter.js new file mode 100644 index 00000000..214676a4 --- /dev/null +++ b/node_modules/react-router-dom/withRouter.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("withRouter"); +module.exports = require("./index.js").withRouter; diff --git a/node_modules/react-router/LICENSE b/node_modules/react-router/LICENSE new file mode 100644 index 00000000..dc15fe3f --- /dev/null +++ b/node_modules/react-router/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) React Training 2016-2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/react-router/MemoryRouter.js b/node_modules/react-router/MemoryRouter.js new file mode 100644 index 00000000..79b74bbd --- /dev/null +++ b/node_modules/react-router/MemoryRouter.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("MemoryRouter"); +module.exports = require("./index.js").MemoryRouter; diff --git a/node_modules/react-router/Prompt.js b/node_modules/react-router/Prompt.js new file mode 100644 index 00000000..20f629b4 --- /dev/null +++ b/node_modules/react-router/Prompt.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Prompt"); +module.exports = require("./index.js").Prompt; diff --git a/node_modules/react-router/README.md b/node_modules/react-router/README.md new file mode 100644 index 00000000..7cd1ec3d --- /dev/null +++ b/node_modules/react-router/README.md @@ -0,0 +1,39 @@ +# react-router + +Declarative routing for [React](https://facebook.github.io/react). + +## Installation + +Using [npm](https://www.npmjs.com/): + + $ npm install --save react-router + +**Note:** This package provides the core routing functionality for React Router, but you might not want to install it directly. If you are writing an application that will run in the browser, you should instead install `react-router-dom`. Similarly, if you are writing a React Native application, you should instead install `react-router-native`. Both of those will install `react-router` as a dependency. + +Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else: + +```js +// using ES6 modules +import { Router, Route, Switch } from "react-router"; + +// using CommonJS modules +var Router = require("react-router").Router; +var Route = require("react-router").Route; +var Switch = require("react-router").Switch; +``` + +The UMD build is also available on [unpkg](https://unpkg.com): + +```html + +``` + +You can find the library on `window.ReactRouter`. + +## Issues + +If you find a bug, please file an issue on [our issue tracker on GitHub](https://github.com/ReactTraining/react-router/issues). + +## Credits + +React Router is built and maintained by [React Training](https://reacttraining.com). diff --git a/node_modules/react-router/Redirect.js b/node_modules/react-router/Redirect.js new file mode 100644 index 00000000..6c763abc --- /dev/null +++ b/node_modules/react-router/Redirect.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Redirect"); +module.exports = require("./index.js").Redirect; diff --git a/node_modules/react-router/Route.js b/node_modules/react-router/Route.js new file mode 100644 index 00000000..0d3b1f59 --- /dev/null +++ b/node_modules/react-router/Route.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Route"); +module.exports = require("./index.js").Route; diff --git a/node_modules/react-router/Router.js b/node_modules/react-router/Router.js new file mode 100644 index 00000000..ca27b72d --- /dev/null +++ b/node_modules/react-router/Router.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Router"); +module.exports = require("./index.js").Router; diff --git a/node_modules/react-router/StaticRouter.js b/node_modules/react-router/StaticRouter.js new file mode 100644 index 00000000..6bc35134 --- /dev/null +++ b/node_modules/react-router/StaticRouter.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("StaticRouter"); +module.exports = require("./index.js").StaticRouter; diff --git a/node_modules/react-router/Switch.js b/node_modules/react-router/Switch.js new file mode 100644 index 00000000..a4b38eb2 --- /dev/null +++ b/node_modules/react-router/Switch.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("Switch"); +module.exports = require("./index.js").Switch; diff --git a/node_modules/react-router/cjs/react-router.js b/node_modules/react-router/cjs/react-router.js new file mode 100644 index 00000000..00ff6d18 --- /dev/null +++ b/node_modules/react-router/cjs/react-router.js @@ -0,0 +1,776 @@ +'use strict'; + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var createContext = _interopDefault(require('mini-create-react-context')); +var React = _interopDefault(require('react')); +var PropTypes = _interopDefault(require('prop-types')); +var warning = _interopDefault(require('tiny-warning')); +var history = require('history'); +var invariant = _interopDefault(require('tiny-invariant')); +var pathToRegexp = _interopDefault(require('path-to-regexp')); +var reactIs = require('react-is'); +var hoistStatics = _interopDefault(require('hoist-non-react-statics')); + +function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); +} + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; +} + +// TODO: Replace with React.createContext once we can assume React 16+ + +var createNamedContext = function createNamedContext(name) { + var context = createContext(); + context.displayName = name; + return context; +}; + +var context = +/*#__PURE__*/ +createNamedContext("Router"); + +/** + * The public API for putting history on context. + */ + +var Router = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(Router, _React$Component); + + Router.computeRootMatch = function computeRootMatch(pathname) { + return { + path: "/", + url: "/", + params: {}, + isExact: pathname === "/" + }; + }; + + function Router(props) { + var _this; + + _this = _React$Component.call(this, props) || this; + _this.state = { + location: props.history.location + }; // This is a bit of a hack. We have to start listening for location + // changes here in the constructor in case there are any s + // on the initial render. If there are, they will replace/push when + // they mount and since cDM fires in children before parents, we may + // get a new location before the is mounted. + + _this._isMounted = false; + _this._pendingLocation = null; + + if (!props.staticContext) { + _this.unlisten = props.history.listen(function (location) { + if (_this._isMounted) { + _this.setState({ + location: location + }); + } else { + _this._pendingLocation = location; + } + }); + } + + return _this; + } + + var _proto = Router.prototype; + + _proto.componentDidMount = function componentDidMount() { + this._isMounted = true; + + if (this._pendingLocation) { + this.setState({ + location: this._pendingLocation + }); + } + }; + + _proto.componentWillUnmount = function componentWillUnmount() { + if (this.unlisten) this.unlisten(); + }; + + _proto.render = function render() { + return React.createElement(context.Provider, { + children: this.props.children || null, + value: { + history: this.props.history, + location: this.state.location, + match: Router.computeRootMatch(this.state.location.pathname), + staticContext: this.props.staticContext + } + }); + }; + + return Router; +}(React.Component); + +{ + Router.propTypes = { + children: PropTypes.node, + history: PropTypes.object.isRequired, + staticContext: PropTypes.object + }; + + Router.prototype.componentDidUpdate = function (prevProps) { + warning(prevProps.history === this.props.history, "You cannot change "); + }; +} + +/** + * The public API for a that stores location in memory. + */ + +var MemoryRouter = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(MemoryRouter, _React$Component); + + function MemoryRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.history = history.createMemoryHistory(_this.props); + return _this; + } + + var _proto = MemoryRouter.prototype; + + _proto.render = function render() { + return React.createElement(Router, { + history: this.history, + children: this.props.children + }); + }; + + return MemoryRouter; +}(React.Component); + +{ + MemoryRouter.propTypes = { + initialEntries: PropTypes.array, + initialIndex: PropTypes.number, + getUserConfirmation: PropTypes.func, + keyLength: PropTypes.number, + children: PropTypes.node + }; + + MemoryRouter.prototype.componentDidMount = function () { + warning(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`."); + }; +} + +var Lifecycle = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(Lifecycle, _React$Component); + + function Lifecycle() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Lifecycle.prototype; + + _proto.componentDidMount = function componentDidMount() { + if (this.props.onMount) this.props.onMount.call(this, this); + }; + + _proto.componentDidUpdate = function componentDidUpdate(prevProps) { + if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps); + }; + + _proto.componentWillUnmount = function componentWillUnmount() { + if (this.props.onUnmount) this.props.onUnmount.call(this, this); + }; + + _proto.render = function render() { + return null; + }; + + return Lifecycle; +}(React.Component); + +/** + * The public API for prompting the user before navigating away from a screen. + */ + +function Prompt(_ref) { + var message = _ref.message, + _ref$when = _ref.when, + when = _ref$when === void 0 ? true : _ref$when; + return React.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + if (!when || context$$1.staticContext) return null; + var method = context$$1.history.block; + return React.createElement(Lifecycle, { + onMount: function onMount(self) { + self.release = method(message); + }, + onUpdate: function onUpdate(self, prevProps) { + if (prevProps.message !== message) { + self.release(); + self.release = method(message); + } + }, + onUnmount: function onUnmount(self) { + self.release(); + }, + message: message + }); + }); +} + +{ + var messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]); + Prompt.propTypes = { + when: PropTypes.bool, + message: messageType.isRequired + }; +} + +var cache = {}; +var cacheLimit = 10000; +var cacheCount = 0; + +function compilePath(path) { + if (cache[path]) return cache[path]; + var generator = pathToRegexp.compile(path); + + if (cacheCount < cacheLimit) { + cache[path] = generator; + cacheCount++; + } + + return generator; +} +/** + * Public API for generating a URL pathname from a path and parameters. + */ + + +function generatePath(path, params) { + if (path === void 0) { + path = "/"; + } + + if (params === void 0) { + params = {}; + } + + return path === "/" ? path : compilePath(path)(params, { + pretty: true + }); +} + +/** + * The public API for navigating programmatically with a component. + */ + +function Redirect(_ref) { + var computedMatch = _ref.computedMatch, + to = _ref.to, + _ref$push = _ref.push, + push = _ref$push === void 0 ? false : _ref$push; + return React.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + var history$$1 = context$$1.history, + staticContext = context$$1.staticContext; + var method = push ? history$$1.push : history$$1.replace; + var location = history.createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, { + pathname: generatePath(to.pathname, computedMatch.params) + }) : to); // When rendering in a static context, + // set the new location immediately. + + if (staticContext) { + method(location); + return null; + } + + return React.createElement(Lifecycle, { + onMount: function onMount() { + method(location); + }, + onUpdate: function onUpdate(self, prevProps) { + var prevLocation = history.createLocation(prevProps.to); + + if (!history.locationsAreEqual(prevLocation, _extends({}, location, { + key: prevLocation.key + }))) { + method(location); + } + }, + to: to + }); + }); +} + +{ + Redirect.propTypes = { + push: PropTypes.bool, + from: PropTypes.string, + to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired + }; +} + +var cache$1 = {}; +var cacheLimit$1 = 10000; +var cacheCount$1 = 0; + +function compilePath$1(path, options) { + var cacheKey = "" + options.end + options.strict + options.sensitive; + var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {}); + if (pathCache[path]) return pathCache[path]; + var keys = []; + var regexp = pathToRegexp(path, keys, options); + var result = { + regexp: regexp, + keys: keys + }; + + if (cacheCount$1 < cacheLimit$1) { + pathCache[path] = result; + cacheCount$1++; + } + + return result; +} +/** + * Public API for matching a URL pathname to a path. + */ + + +function matchPath(pathname, options) { + if (options === void 0) { + options = {}; + } + + if (typeof options === "string") options = { + path: options + }; + var _options = options, + path = _options.path, + _options$exact = _options.exact, + exact = _options$exact === void 0 ? false : _options$exact, + _options$strict = _options.strict, + strict = _options$strict === void 0 ? false : _options$strict, + _options$sensitive = _options.sensitive, + sensitive = _options$sensitive === void 0 ? false : _options$sensitive; + var paths = [].concat(path); + return paths.reduce(function (matched, path) { + if (!path) return null; + if (matched) return matched; + + var _compilePath = compilePath$1(path, { + end: exact, + strict: strict, + sensitive: sensitive + }), + regexp = _compilePath.regexp, + keys = _compilePath.keys; + + var match = regexp.exec(pathname); + if (!match) return null; + var url = match[0], + values = match.slice(1); + var isExact = pathname === url; + if (exact && !isExact) return null; + return { + path: path, + // the path used to match + url: path === "/" && url === "" ? "/" : url, + // the matched portion of the URL + isExact: isExact, + // whether or not we matched exactly + params: keys.reduce(function (memo, key, index) { + memo[key.name] = values[index]; + return memo; + }, {}) + }; + }, null); +} + +function isEmptyChildren(children) { + return React.Children.count(children) === 0; +} +/** + * The public API for matching a single path and rendering. + */ + + +var Route = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(Route, _React$Component); + + function Route() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Route.prototype; + + _proto.render = function render() { + var _this = this; + + return React.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + var location = _this.props.location || context$$1.location; + var match = _this.props.computedMatch ? _this.props.computedMatch // already computed the match for us + : _this.props.path ? matchPath(location.pathname, _this.props) : context$$1.match; + + var props = _extends({}, context$$1, { + location: location, + match: match + }); + + var _this$props = _this.props, + children = _this$props.children, + component = _this$props.component, + render = _this$props.render; // Preact uses an empty array as children by + // default, so use null if that's the case. + + if (Array.isArray(children) && children.length === 0) { + children = null; + } + + if (typeof children === "function") { + children = children(props); + + if (children === undefined) { + { + var path = _this.props.path; + warning(false, "You returned `undefined` from the `children` function of " + (", but you ") + "should have returned a React element or `null`"); + } + + children = null; + } + } + + return React.createElement(context.Provider, { + value: props + }, children && !isEmptyChildren(children) ? children : props.match ? component ? React.createElement(component, props) : render ? render(props) : null : null); + }); + }; + + return Route; +}(React.Component); + +{ + Route.propTypes = { + children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]), + component: function component(props, propName) { + if (props[propName] && !reactIs.isValidElementType(props[propName])) { + return new Error("Invalid prop 'component' supplied to 'Route': the prop is not a valid React component"); + } + }, + exact: PropTypes.bool, + location: PropTypes.object, + path: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), + render: PropTypes.func, + sensitive: PropTypes.bool, + strict: PropTypes.bool + }; + + Route.prototype.componentDidMount = function () { + warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.component), "You should not use and in the same route; will be ignored"); + warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.render), "You should not use and in the same route; will be ignored"); + warning(!(this.props.component && this.props.render), "You should not use and in the same route; will be ignored"); + }; + + Route.prototype.componentDidUpdate = function (prevProps) { + warning(!(this.props.location && !prevProps.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); + warning(!(!this.props.location && prevProps.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); + }; +} + +function addLeadingSlash(path) { + return path.charAt(0) === "/" ? path : "/" + path; +} + +function addBasename(basename, location) { + if (!basename) return location; + return _extends({}, location, { + pathname: addLeadingSlash(basename) + location.pathname + }); +} + +function stripBasename(basename, location) { + if (!basename) return location; + var base = addLeadingSlash(basename); + if (location.pathname.indexOf(base) !== 0) return location; + return _extends({}, location, { + pathname: location.pathname.substr(base.length) + }); +} + +function createURL(location) { + return typeof location === "string" ? location : history.createPath(location); +} + +function staticHandler(methodName) { + return function () { + invariant(false, "You cannot %s with ", methodName); + }; +} + +function noop() {} +/** + * The public top-level API for a "static" , so-called because it + * can't actually change the current location. Instead, it just records + * location changes in a context object. Useful mainly in testing and + * server-rendering scenarios. + */ + + +var StaticRouter = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(StaticRouter, _React$Component); + + function StaticRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + + _this.handlePush = function (location) { + return _this.navigateTo(location, "PUSH"); + }; + + _this.handleReplace = function (location) { + return _this.navigateTo(location, "REPLACE"); + }; + + _this.handleListen = function () { + return noop; + }; + + _this.handleBlock = function () { + return noop; + }; + + return _this; + } + + var _proto = StaticRouter.prototype; + + _proto.navigateTo = function navigateTo(location, action) { + var _this$props = this.props, + _this$props$basename = _this$props.basename, + basename = _this$props$basename === void 0 ? "" : _this$props$basename, + _this$props$context = _this$props.context, + context = _this$props$context === void 0 ? {} : _this$props$context; + context.action = action; + context.location = addBasename(basename, history.createLocation(location)); + context.url = createURL(context.location); + }; + + _proto.render = function render() { + var _this$props2 = this.props, + _this$props2$basename = _this$props2.basename, + basename = _this$props2$basename === void 0 ? "" : _this$props2$basename, + _this$props2$context = _this$props2.context, + context = _this$props2$context === void 0 ? {} : _this$props2$context, + _this$props2$location = _this$props2.location, + location = _this$props2$location === void 0 ? "/" : _this$props2$location, + rest = _objectWithoutPropertiesLoose(_this$props2, ["basename", "context", "location"]); + + var history$$1 = { + createHref: function createHref(path) { + return addLeadingSlash(basename + createURL(path)); + }, + action: "POP", + location: stripBasename(basename, history.createLocation(location)), + push: this.handlePush, + replace: this.handleReplace, + go: staticHandler("go"), + goBack: staticHandler("goBack"), + goForward: staticHandler("goForward"), + listen: this.handleListen, + block: this.handleBlock + }; + return React.createElement(Router, _extends({}, rest, { + history: history$$1, + staticContext: context + })); + }; + + return StaticRouter; +}(React.Component); + +{ + StaticRouter.propTypes = { + basename: PropTypes.string, + context: PropTypes.object, + location: PropTypes.oneOfType([PropTypes.string, PropTypes.object]) + }; + + StaticRouter.prototype.componentDidMount = function () { + warning(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`."); + }; +} + +/** + * The public API for rendering the first that matches. + */ + +var Switch = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(Switch, _React$Component); + + function Switch() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Switch.prototype; + + _proto.render = function render() { + var _this = this; + + return React.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + var location = _this.props.location || context$$1.location; + var element, match; // We use React.Children.forEach instead of React.Children.toArray().find() + // here because toArray adds keys to all child elements and we do not want + // to trigger an unmount/remount for two s that render the same + // component at different URLs. + + React.Children.forEach(_this.props.children, function (child) { + if (match == null && React.isValidElement(child)) { + element = child; + var path = child.props.path || child.props.from; + match = path ? matchPath(location.pathname, _extends({}, child.props, { + path: path + })) : context$$1.match; + } + }); + return match ? React.cloneElement(element, { + location: location, + computedMatch: match + }) : null; + }); + }; + + return Switch; +}(React.Component); + +{ + Switch.propTypes = { + children: PropTypes.node, + location: PropTypes.object + }; + + Switch.prototype.componentDidUpdate = function (prevProps) { + warning(!(this.props.location && !prevProps.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); + warning(!(!this.props.location && prevProps.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); + }; +} + +/** + * A public higher-order component to access the imperative API + */ + +function withRouter(Component) { + var displayName = "withRouter(" + (Component.displayName || Component.name) + ")"; + + var C = function C(props) { + var wrappedComponentRef = props.wrappedComponentRef, + remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]); + + return React.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use <" + displayName + " /> outside a ") : void 0; + return React.createElement(Component, _extends({}, remainingProps, context$$1, { + ref: wrappedComponentRef + })); + }); + }; + + C.displayName = displayName; + C.WrappedComponent = Component; + + { + C.propTypes = { + wrappedComponentRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object]) + }; + } + + return hoistStatics(C, Component); +} + +{ + if (typeof window !== "undefined") { + var global = window; + var key = "__react_router_build__"; + var buildNames = { + cjs: "CommonJS", + esm: "ES modules", + umd: "UMD" + }; + + if (global[key] && global[key] !== "cjs") { + var initialBuildName = buildNames[global[key]]; + var secondaryBuildName = buildNames["cjs"]; // TODO: Add link to article that explains in detail how to avoid + // loading 2 different builds. + + throw new Error("You are loading the " + secondaryBuildName + " build of React Router " + ("on a page that is already running the " + initialBuildName + " ") + "build, so things won't work right."); + } + + global[key] = "cjs"; + } +} + +exports.MemoryRouter = MemoryRouter; +exports.Prompt = Prompt; +exports.Redirect = Redirect; +exports.Route = Route; +exports.Router = Router; +exports.StaticRouter = StaticRouter; +exports.Switch = Switch; +exports.generatePath = generatePath; +exports.matchPath = matchPath; +exports.withRouter = withRouter; +exports.__RouterContext = context; diff --git a/node_modules/react-router/cjs/react-router.min.js b/node_modules/react-router/cjs/react-router.min.js new file mode 100644 index 00000000..91950a7c --- /dev/null +++ b/node_modules/react-router/cjs/react-router.min.js @@ -0,0 +1 @@ +"use strict";function _interopDefault(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var createContext=_interopDefault(require("mini-create-react-context")),React=_interopDefault(require("react"));require("prop-types"),require("tiny-warning");var history=require("history"),invariant=_interopDefault(require("tiny-invariant")),pathToRegexp=_interopDefault(require("path-to-regexp"));require("react-is");var hoistStatics=_interopDefault(require("hoist-non-react-statics"));function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e 0 + ? format.replace(/%s/g, function() { + return subs[index++]; + }) + : format); + + if (typeof console !== "undefined") { + console.error(message); + } + + try { + // --- Welcome to debugging React Router --- + // This error was thrown as a convenience so that you can use the + // stack trace to find the callsite that triggered this warning. + throw new Error(message); + } catch (e) {} + }; +} + +export default function(member) { + printWarning( + 'Please use `import { %s } from "react-router"` instead of `import %s from "react-router/es/%s"`. ' + + "Support for the latter will be removed in the next major release.", + [member, member] + ); +} diff --git a/node_modules/react-router/es/withRouter.js b/node_modules/react-router/es/withRouter.js new file mode 100644 index 00000000..bc7ba5ac --- /dev/null +++ b/node_modules/react-router/es/withRouter.js @@ -0,0 +1,7 @@ +"use strict"; + +import warnAboutDeprecatedESMImport from "./warnAboutDeprecatedESMImport.js"; +warnAboutDeprecatedESMImport("withRouter"); + +import { withRouter } from "../esm/react-router.js"; +export default withRouter; diff --git a/node_modules/react-router/esm/react-router.js b/node_modules/react-router/esm/react-router.js new file mode 100644 index 00000000..201e7262 --- /dev/null +++ b/node_modules/react-router/esm/react-router.js @@ -0,0 +1,726 @@ +import createContext from 'mini-create-react-context'; +import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose'; +import React from 'react'; +import PropTypes from 'prop-types'; +import warning from 'tiny-warning'; +import { createMemoryHistory, createLocation, locationsAreEqual, createPath } from 'history'; +import invariant from 'tiny-invariant'; +import pathToRegexp from 'path-to-regexp'; +import _extends from '@babel/runtime/helpers/esm/extends'; +import { isValidElementType } from 'react-is'; +import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose'; +import hoistStatics from 'hoist-non-react-statics'; + +// TODO: Replace with React.createContext once we can assume React 16+ + +var createNamedContext = function createNamedContext(name) { + var context = createContext(); + context.displayName = name; + return context; +}; + +var context = +/*#__PURE__*/ +createNamedContext("Router"); + +/** + * The public API for putting history on context. + */ + +var Router = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(Router, _React$Component); + + Router.computeRootMatch = function computeRootMatch(pathname) { + return { + path: "/", + url: "/", + params: {}, + isExact: pathname === "/" + }; + }; + + function Router(props) { + var _this; + + _this = _React$Component.call(this, props) || this; + _this.state = { + location: props.history.location + }; // This is a bit of a hack. We have to start listening for location + // changes here in the constructor in case there are any s + // on the initial render. If there are, they will replace/push when + // they mount and since cDM fires in children before parents, we may + // get a new location before the is mounted. + + _this._isMounted = false; + _this._pendingLocation = null; + + if (!props.staticContext) { + _this.unlisten = props.history.listen(function (location) { + if (_this._isMounted) { + _this.setState({ + location: location + }); + } else { + _this._pendingLocation = location; + } + }); + } + + return _this; + } + + var _proto = Router.prototype; + + _proto.componentDidMount = function componentDidMount() { + this._isMounted = true; + + if (this._pendingLocation) { + this.setState({ + location: this._pendingLocation + }); + } + }; + + _proto.componentWillUnmount = function componentWillUnmount() { + if (this.unlisten) this.unlisten(); + }; + + _proto.render = function render() { + return React.createElement(context.Provider, { + children: this.props.children || null, + value: { + history: this.props.history, + location: this.state.location, + match: Router.computeRootMatch(this.state.location.pathname), + staticContext: this.props.staticContext + } + }); + }; + + return Router; +}(React.Component); + +if (process.env.NODE_ENV !== "production") { + Router.propTypes = { + children: PropTypes.node, + history: PropTypes.object.isRequired, + staticContext: PropTypes.object + }; + + Router.prototype.componentDidUpdate = function (prevProps) { + process.env.NODE_ENV !== "production" ? warning(prevProps.history === this.props.history, "You cannot change ") : void 0; + }; +} + +/** + * The public API for a that stores location in memory. + */ + +var MemoryRouter = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(MemoryRouter, _React$Component); + + function MemoryRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.history = createMemoryHistory(_this.props); + return _this; + } + + var _proto = MemoryRouter.prototype; + + _proto.render = function render() { + return React.createElement(Router, { + history: this.history, + children: this.props.children + }); + }; + + return MemoryRouter; +}(React.Component); + +if (process.env.NODE_ENV !== "production") { + MemoryRouter.propTypes = { + initialEntries: PropTypes.array, + initialIndex: PropTypes.number, + getUserConfirmation: PropTypes.func, + keyLength: PropTypes.number, + children: PropTypes.node + }; + + MemoryRouter.prototype.componentDidMount = function () { + process.env.NODE_ENV !== "production" ? warning(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.") : void 0; + }; +} + +var Lifecycle = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(Lifecycle, _React$Component); + + function Lifecycle() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Lifecycle.prototype; + + _proto.componentDidMount = function componentDidMount() { + if (this.props.onMount) this.props.onMount.call(this, this); + }; + + _proto.componentDidUpdate = function componentDidUpdate(prevProps) { + if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps); + }; + + _proto.componentWillUnmount = function componentWillUnmount() { + if (this.props.onUnmount) this.props.onUnmount.call(this, this); + }; + + _proto.render = function render() { + return null; + }; + + return Lifecycle; +}(React.Component); + +/** + * The public API for prompting the user before navigating away from a screen. + */ + +function Prompt(_ref) { + var message = _ref.message, + _ref$when = _ref.when, + when = _ref$when === void 0 ? true : _ref$when; + return React.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use outside a ") : invariant(false) : void 0; + if (!when || context$$1.staticContext) return null; + var method = context$$1.history.block; + return React.createElement(Lifecycle, { + onMount: function onMount(self) { + self.release = method(message); + }, + onUpdate: function onUpdate(self, prevProps) { + if (prevProps.message !== message) { + self.release(); + self.release = method(message); + } + }, + onUnmount: function onUnmount(self) { + self.release(); + }, + message: message + }); + }); +} + +if (process.env.NODE_ENV !== "production") { + var messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]); + Prompt.propTypes = { + when: PropTypes.bool, + message: messageType.isRequired + }; +} + +var cache = {}; +var cacheLimit = 10000; +var cacheCount = 0; + +function compilePath(path) { + if (cache[path]) return cache[path]; + var generator = pathToRegexp.compile(path); + + if (cacheCount < cacheLimit) { + cache[path] = generator; + cacheCount++; + } + + return generator; +} +/** + * Public API for generating a URL pathname from a path and parameters. + */ + + +function generatePath(path, params) { + if (path === void 0) { + path = "/"; + } + + if (params === void 0) { + params = {}; + } + + return path === "/" ? path : compilePath(path)(params, { + pretty: true + }); +} + +/** + * The public API for navigating programmatically with a component. + */ + +function Redirect(_ref) { + var computedMatch = _ref.computedMatch, + to = _ref.to, + _ref$push = _ref.push, + push = _ref$push === void 0 ? false : _ref$push; + return React.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use outside a ") : invariant(false) : void 0; + var history = context$$1.history, + staticContext = context$$1.staticContext; + var method = push ? history.push : history.replace; + var location = createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, { + pathname: generatePath(to.pathname, computedMatch.params) + }) : to); // When rendering in a static context, + // set the new location immediately. + + if (staticContext) { + method(location); + return null; + } + + return React.createElement(Lifecycle, { + onMount: function onMount() { + method(location); + }, + onUpdate: function onUpdate(self, prevProps) { + var prevLocation = createLocation(prevProps.to); + + if (!locationsAreEqual(prevLocation, _extends({}, location, { + key: prevLocation.key + }))) { + method(location); + } + }, + to: to + }); + }); +} + +if (process.env.NODE_ENV !== "production") { + Redirect.propTypes = { + push: PropTypes.bool, + from: PropTypes.string, + to: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired + }; +} + +var cache$1 = {}; +var cacheLimit$1 = 10000; +var cacheCount$1 = 0; + +function compilePath$1(path, options) { + var cacheKey = "" + options.end + options.strict + options.sensitive; + var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {}); + if (pathCache[path]) return pathCache[path]; + var keys = []; + var regexp = pathToRegexp(path, keys, options); + var result = { + regexp: regexp, + keys: keys + }; + + if (cacheCount$1 < cacheLimit$1) { + pathCache[path] = result; + cacheCount$1++; + } + + return result; +} +/** + * Public API for matching a URL pathname to a path. + */ + + +function matchPath(pathname, options) { + if (options === void 0) { + options = {}; + } + + if (typeof options === "string") options = { + path: options + }; + var _options = options, + path = _options.path, + _options$exact = _options.exact, + exact = _options$exact === void 0 ? false : _options$exact, + _options$strict = _options.strict, + strict = _options$strict === void 0 ? false : _options$strict, + _options$sensitive = _options.sensitive, + sensitive = _options$sensitive === void 0 ? false : _options$sensitive; + var paths = [].concat(path); + return paths.reduce(function (matched, path) { + if (!path) return null; + if (matched) return matched; + + var _compilePath = compilePath$1(path, { + end: exact, + strict: strict, + sensitive: sensitive + }), + regexp = _compilePath.regexp, + keys = _compilePath.keys; + + var match = regexp.exec(pathname); + if (!match) return null; + var url = match[0], + values = match.slice(1); + var isExact = pathname === url; + if (exact && !isExact) return null; + return { + path: path, + // the path used to match + url: path === "/" && url === "" ? "/" : url, + // the matched portion of the URL + isExact: isExact, + // whether or not we matched exactly + params: keys.reduce(function (memo, key, index) { + memo[key.name] = values[index]; + return memo; + }, {}) + }; + }, null); +} + +function isEmptyChildren(children) { + return React.Children.count(children) === 0; +} +/** + * The public API for matching a single path and rendering. + */ + + +var Route = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(Route, _React$Component); + + function Route() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Route.prototype; + + _proto.render = function render() { + var _this = this; + + return React.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use outside a ") : invariant(false) : void 0; + var location = _this.props.location || context$$1.location; + var match = _this.props.computedMatch ? _this.props.computedMatch // already computed the match for us + : _this.props.path ? matchPath(location.pathname, _this.props) : context$$1.match; + + var props = _extends({}, context$$1, { + location: location, + match: match + }); + + var _this$props = _this.props, + children = _this$props.children, + component = _this$props.component, + render = _this$props.render; // Preact uses an empty array as children by + // default, so use null if that's the case. + + if (Array.isArray(children) && children.length === 0) { + children = null; + } + + if (typeof children === "function") { + children = children(props); + + if (children === undefined) { + if (process.env.NODE_ENV !== "production") { + var path = _this.props.path; + process.env.NODE_ENV !== "production" ? warning(false, "You returned `undefined` from the `children` function of " + (", but you ") + "should have returned a React element or `null`") : void 0; + } + + children = null; + } + } + + return React.createElement(context.Provider, { + value: props + }, children && !isEmptyChildren(children) ? children : props.match ? component ? React.createElement(component, props) : render ? render(props) : null : null); + }); + }; + + return Route; +}(React.Component); + +if (process.env.NODE_ENV !== "production") { + Route.propTypes = { + children: PropTypes.oneOfType([PropTypes.func, PropTypes.node]), + component: function component(props, propName) { + if (props[propName] && !isValidElementType(props[propName])) { + return new Error("Invalid prop 'component' supplied to 'Route': the prop is not a valid React component"); + } + }, + exact: PropTypes.bool, + location: PropTypes.object, + path: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), + render: PropTypes.func, + sensitive: PropTypes.bool, + strict: PropTypes.bool + }; + + Route.prototype.componentDidMount = function () { + process.env.NODE_ENV !== "production" ? warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.component), "You should not use and in the same route; will be ignored") : void 0; + process.env.NODE_ENV !== "production" ? warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.render), "You should not use and in the same route; will be ignored") : void 0; + process.env.NODE_ENV !== "production" ? warning(!(this.props.component && this.props.render), "You should not use and in the same route; will be ignored") : void 0; + }; + + Route.prototype.componentDidUpdate = function (prevProps) { + process.env.NODE_ENV !== "production" ? warning(!(this.props.location && !prevProps.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.') : void 0; + process.env.NODE_ENV !== "production" ? warning(!(!this.props.location && prevProps.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.') : void 0; + }; +} + +function addLeadingSlash(path) { + return path.charAt(0) === "/" ? path : "/" + path; +} + +function addBasename(basename, location) { + if (!basename) return location; + return _extends({}, location, { + pathname: addLeadingSlash(basename) + location.pathname + }); +} + +function stripBasename(basename, location) { + if (!basename) return location; + var base = addLeadingSlash(basename); + if (location.pathname.indexOf(base) !== 0) return location; + return _extends({}, location, { + pathname: location.pathname.substr(base.length) + }); +} + +function createURL(location) { + return typeof location === "string" ? location : createPath(location); +} + +function staticHandler(methodName) { + return function () { + process.env.NODE_ENV !== "production" ? invariant(false, "You cannot %s with ", methodName) : invariant(false); + }; +} + +function noop() {} +/** + * The public top-level API for a "static" , so-called because it + * can't actually change the current location. Instead, it just records + * location changes in a context object. Useful mainly in testing and + * server-rendering scenarios. + */ + + +var StaticRouter = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(StaticRouter, _React$Component); + + function StaticRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + + _this.handlePush = function (location) { + return _this.navigateTo(location, "PUSH"); + }; + + _this.handleReplace = function (location) { + return _this.navigateTo(location, "REPLACE"); + }; + + _this.handleListen = function () { + return noop; + }; + + _this.handleBlock = function () { + return noop; + }; + + return _this; + } + + var _proto = StaticRouter.prototype; + + _proto.navigateTo = function navigateTo(location, action) { + var _this$props = this.props, + _this$props$basename = _this$props.basename, + basename = _this$props$basename === void 0 ? "" : _this$props$basename, + _this$props$context = _this$props.context, + context = _this$props$context === void 0 ? {} : _this$props$context; + context.action = action; + context.location = addBasename(basename, createLocation(location)); + context.url = createURL(context.location); + }; + + _proto.render = function render() { + var _this$props2 = this.props, + _this$props2$basename = _this$props2.basename, + basename = _this$props2$basename === void 0 ? "" : _this$props2$basename, + _this$props2$context = _this$props2.context, + context = _this$props2$context === void 0 ? {} : _this$props2$context, + _this$props2$location = _this$props2.location, + location = _this$props2$location === void 0 ? "/" : _this$props2$location, + rest = _objectWithoutPropertiesLoose(_this$props2, ["basename", "context", "location"]); + + var history = { + createHref: function createHref(path) { + return addLeadingSlash(basename + createURL(path)); + }, + action: "POP", + location: stripBasename(basename, createLocation(location)), + push: this.handlePush, + replace: this.handleReplace, + go: staticHandler("go"), + goBack: staticHandler("goBack"), + goForward: staticHandler("goForward"), + listen: this.handleListen, + block: this.handleBlock + }; + return React.createElement(Router, _extends({}, rest, { + history: history, + staticContext: context + })); + }; + + return StaticRouter; +}(React.Component); + +if (process.env.NODE_ENV !== "production") { + StaticRouter.propTypes = { + basename: PropTypes.string, + context: PropTypes.object, + location: PropTypes.oneOfType([PropTypes.string, PropTypes.object]) + }; + + StaticRouter.prototype.componentDidMount = function () { + process.env.NODE_ENV !== "production" ? warning(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.") : void 0; + }; +} + +/** + * The public API for rendering the first that matches. + */ + +var Switch = +/*#__PURE__*/ +function (_React$Component) { + _inheritsLoose(Switch, _React$Component); + + function Switch() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Switch.prototype; + + _proto.render = function render() { + var _this = this; + + return React.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use outside a ") : invariant(false) : void 0; + var location = _this.props.location || context$$1.location; + var element, match; // We use React.Children.forEach instead of React.Children.toArray().find() + // here because toArray adds keys to all child elements and we do not want + // to trigger an unmount/remount for two s that render the same + // component at different URLs. + + React.Children.forEach(_this.props.children, function (child) { + if (match == null && React.isValidElement(child)) { + element = child; + var path = child.props.path || child.props.from; + match = path ? matchPath(location.pathname, _extends({}, child.props, { + path: path + })) : context$$1.match; + } + }); + return match ? React.cloneElement(element, { + location: location, + computedMatch: match + }) : null; + }); + }; + + return Switch; +}(React.Component); + +if (process.env.NODE_ENV !== "production") { + Switch.propTypes = { + children: PropTypes.node, + location: PropTypes.object + }; + + Switch.prototype.componentDidUpdate = function (prevProps) { + process.env.NODE_ENV !== "production" ? warning(!(this.props.location && !prevProps.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.') : void 0; + process.env.NODE_ENV !== "production" ? warning(!(!this.props.location && prevProps.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.') : void 0; + }; +} + +/** + * A public higher-order component to access the imperative API + */ + +function withRouter(Component) { + var displayName = "withRouter(" + (Component.displayName || Component.name) + ")"; + + var C = function C(props) { + var wrappedComponentRef = props.wrappedComponentRef, + remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]); + + return React.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <" + displayName + " /> outside a ") : invariant(false) : void 0; + return React.createElement(Component, _extends({}, remainingProps, context$$1, { + ref: wrappedComponentRef + })); + }); + }; + + C.displayName = displayName; + C.WrappedComponent = Component; + + if (process.env.NODE_ENV !== "production") { + C.propTypes = { + wrappedComponentRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object]) + }; + } + + return hoistStatics(C, Component); +} + +if (process.env.NODE_ENV !== "production") { + if (typeof window !== "undefined") { + var global = window; + var key = "__react_router_build__"; + var buildNames = { + cjs: "CommonJS", + esm: "ES modules", + umd: "UMD" + }; + + if (global[key] && global[key] !== "esm") { + var initialBuildName = buildNames[global[key]]; + var secondaryBuildName = buildNames["esm"]; // TODO: Add link to article that explains in detail how to avoid + // loading 2 different builds. + + throw new Error("You are loading the " + secondaryBuildName + " build of React Router " + ("on a page that is already running the " + initialBuildName + " ") + "build, so things won't work right."); + } + + global[key] = "esm"; + } +} + +export { MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, generatePath, matchPath, withRouter, context as __RouterContext }; diff --git a/node_modules/react-router/generatePath.js b/node_modules/react-router/generatePath.js new file mode 100644 index 00000000..d487dd2a --- /dev/null +++ b/node_modules/react-router/generatePath.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("generatePath"); +module.exports = require("./index.js").generatePath; diff --git a/node_modules/react-router/index.js b/node_modules/react-router/index.js new file mode 100644 index 00000000..3ebff74d --- /dev/null +++ b/node_modules/react-router/index.js @@ -0,0 +1,7 @@ +"use strict"; + +if (process.env.NODE_ENV === "production") { + module.exports = require("./cjs/react-router.min.js"); +} else { + module.exports = require("./cjs/react-router.js"); +} diff --git a/node_modules/react-router/matchPath.js b/node_modules/react-router/matchPath.js new file mode 100644 index 00000000..6d1fe336 --- /dev/null +++ b/node_modules/react-router/matchPath.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("matchPath"); +module.exports = require("./index.js").matchPath; diff --git a/node_modules/react-router/package.json b/node_modules/react-router/package.json new file mode 100644 index 00000000..af925c83 --- /dev/null +++ b/node_modules/react-router/package.json @@ -0,0 +1,124 @@ +{ + "_from": "react-router@5.0.1", + "_id": "react-router@5.0.1", + "_inBundle": false, + "_integrity": "sha512-EM7suCPNKb1NxcTZ2LEOWFtQBQRQXecLxVpdsP4DW4PbbqYWeRiLyV/Tt1SdCrvT2jcyXAXmVTmzvSzrPR63Bg==", + "_location": "/react-router", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "react-router@5.0.1", + "name": "react-router", + "escapedName": "react-router", + "rawSpec": "5.0.1", + "saveSpec": null, + "fetchSpec": "5.0.1" + }, + "_requiredBy": [ + "/react-router-dom" + ], + "_resolved": "https://registry.npmjs.org/react-router/-/react-router-5.0.1.tgz", + "_shasum": "04ee77df1d1ab6cb8939f9f01ad5702dbadb8b0f", + "_spec": "react-router@5.0.1", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/react-router-dom", + "authors": [ + "Michael Jackson", + "Ryan Florence" + ], + "browserify": { + "transform": [ + "loose-envify" + ] + }, + "bugs": { + "url": "https://github.com/ReactTraining/react-router/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "mini-create-react-context": "^0.3.0", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + }, + "deprecated": false, + "description": "Declarative routing for React", + "devDependencies": { + "@babel/core": "^7.1.2", + "@babel/plugin-proposal-class-properties": "^7.1.0", + "@babel/plugin-transform-runtime": "^7.1.0", + "@babel/preset-env": "^7.1.0", + "@babel/preset-react": "^7.0.0", + "babel-eslint": "^10.0.1", + "babel-jest": "^24.8.0", + "babel-plugin-dev-expression": "^0.2.1", + "eslint": "^5.16.0", + "eslint-plugin-import": "^2.17.0", + "eslint-plugin-react": "^7.9.1", + "jest": "^24.8.0", + "jest-circus": "^24.8.0", + "raf": "^3.4.1", + "react": "^16.5.2", + "react-dom": "^16.5.2", + "rollup": "^0.66.6", + "rollup-plugin-babel": "^4.3.2", + "rollup-plugin-commonjs": "^9.3.4", + "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-replace": "^2.2.0", + "rollup-plugin-size-snapshot": "0.7.0", + "rollup-plugin-uglify": "^6.0.2" + }, + "files": [ + "MemoryRouter.js", + "Prompt.js", + "Redirect.js", + "Route.js", + "Router.js", + "StaticRouter.js", + "Switch.js", + "cjs", + "es", + "esm", + "index.js", + "generatePath.js", + "matchPath.js", + "withRouter.js", + "warnAboutDeprecatedCJSRequire.js", + "umd" + ], + "gitHead": "0c9a10d9807b879912f2dff2fbebffe0aa7048ed", + "homepage": "https://github.com/ReactTraining/react-router#readme", + "keywords": [ + "react", + "router", + "route", + "routing", + "history", + "link" + ], + "license": "MIT", + "main": "index.js", + "module": "esm/react-router.js", + "name": "react-router", + "peerDependencies": { + "react": ">=15" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ReactTraining/react-router.git" + }, + "scripts": { + "build": "rollup -c", + "lint": "eslint modules", + "prepublishOnly": "npm run build", + "test": "jest" + }, + "sideEffects": false, + "version": "5.0.1" +} diff --git a/node_modules/react-router/umd/react-router.js b/node_modules/react-router/umd/react-router.js new file mode 100644 index 00000000..2e8c2402 --- /dev/null +++ b/node_modules/react-router/umd/react-router.js @@ -0,0 +1,2986 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : + typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : + (factory((global.ReactRouter = {}),global.React)); +}(this, (function (exports,React) { 'use strict'; + + var React__default = 'default' in React ? React['default'] : React; + + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; + } + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } + } + + var objectAssign = 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; + }; + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + + var ReactPropTypesSecret_1 = ReactPropTypesSecret; + + var printWarning = function() {}; + + { + var ReactPropTypesSecret$1 = ReactPropTypesSecret_1; + var loggedTypeFailures = {}; + + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } + + /** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ + function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ); + + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } + } + + var checkPropTypes_1 = checkPropTypes; + + var printWarning$1 = function() {}; + + { + printWarning$1 = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + } + + function emptyFunctionThatReturnsNull() { + return null; + } + + var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret_1) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if (typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning$1( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + printWarning$1('Invalid argument supplied to oneOf, expected an instance of array.'); + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.'); + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning$1( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = objectAssign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes_1; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; + }; + + var propTypes = createCommonjsModule(function (module) { + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = factoryWithTypeCheckers(isValidElement, throwOnDirectAccess); + } + }); + + function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + + return _extends.apply(this, arguments); + } + + function isAbsolute(pathname) { + return pathname.charAt(0) === '/'; + } + + // 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(); + } + + // This implementation is based heavily on node's url.parse + function resolvePathname(to) { + var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + + var toParts = to && to.split('/') || []; + var fromParts = from && from.split('/') || []; + + var isToAbs = to && isAbsolute(to); + var isFromAbs = from && isAbsolute(from); + var mustEndAbs = isToAbs || isFromAbs; + + if (to && isAbsolute(to)) { + // to is absolute + fromParts = toParts; + } else if (toParts.length) { + // to is relative, drop the filename + fromParts.pop(); + fromParts = fromParts.concat(toParts); + } + + if (!fromParts.length) return '/'; + + var hasTrailingSlash = void 0; + if (fromParts.length) { + var last = fromParts[fromParts.length - 1]; + hasTrailingSlash = last === '.' || last === '..' || last === ''; + } else { + hasTrailingSlash = false; + } + + var up = 0; + for (var i = fromParts.length; i >= 0; i--) { + var part = fromParts[i]; + + if (part === '.') { + spliceOne(fromParts, i); + } else if (part === '..') { + spliceOne(fromParts, i); + up++; + } else if (up) { + spliceOne(fromParts, i); + up--; + } + } + + if (!mustEndAbs) for (; up--; up) { + fromParts.unshift('..'); + }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(''); + + var result = fromParts.join('/'); + + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; + + return result; + } + + 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 valueEqual(a, b) { + if (a === b) return true; + + if (a == null || b == null) return false; + + if (Array.isArray(a)) { + return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return valueEqual(item, b[index]); + }); + } + + var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); + var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); + + if (aType !== bType) return false; + + if (aType === 'object') { + var aValue = a.valueOf(); + var bValue = b.valueOf(); + + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); + + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + + if (aKeys.length !== bKeys.length) return false; + + return aKeys.every(function (key) { + return valueEqual(a[key], b[key]); + }); + } + + return false; + } + + function warning(condition, message) { + { + if (condition) { + return; + } + + console.warn(message); + } + } + + var prefix = 'Invariant failed'; + function invariant(condition, message) { + if (condition) { + return; + } + + { + throw new Error(prefix + ": " + (message || '')); + } + } + + function parsePath(path) { + var pathname = path || '/'; + var search = ''; + var hash = ''; + var hashIndex = pathname.indexOf('#'); + + if (hashIndex !== -1) { + hash = pathname.substr(hashIndex); + pathname = pathname.substr(0, hashIndex); + } + + var searchIndex = pathname.indexOf('?'); + + if (searchIndex !== -1) { + search = pathname.substr(searchIndex); + pathname = pathname.substr(0, searchIndex); + } + + return { + pathname: pathname, + search: search === '?' ? '' : search, + hash: hash === '#' ? '' : hash + }; + } + function createPath(location) { + var pathname = location.pathname, + search = location.search, + hash = location.hash; + var path = pathname || '/'; + if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search; + if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash; + return path; + } + + function createLocation(path, state, key, currentLocation) { + var location; + + if (typeof path === 'string') { + // Two-arg form: push(path, state) + location = parsePath(path); + location.state = state; + } else { + // One-arg form: push(location) + location = _extends({}, path); + if (location.pathname === undefined) location.pathname = ''; + + if (location.search) { + if (location.search.charAt(0) !== '?') location.search = '?' + location.search; + } else { + location.search = ''; + } + + if (location.hash) { + if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; + } else { + location.hash = ''; + } + + if (state !== undefined && location.state === undefined) location.state = state; + } + + try { + location.pathname = decodeURI(location.pathname); + } catch (e) { + if (e instanceof URIError) { + throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); + } else { + throw e; + } + } + + if (key) location.key = key; + + if (currentLocation) { + // Resolve incomplete/relative pathname relative to current location. + if (!location.pathname) { + location.pathname = currentLocation.pathname; + } else if (location.pathname.charAt(0) !== '/') { + location.pathname = resolvePathname(location.pathname, currentLocation.pathname); + } + } else { + // When there is no prior location and pathname is empty, set it to / + if (!location.pathname) { + location.pathname = '/'; + } + } + + return location; + } + function locationsAreEqual(a, b) { + return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state); + } + + function createTransitionManager() { + var prompt = null; + + function setPrompt(nextPrompt) { + warning(prompt == null, 'A history supports only one prompt at a time'); + prompt = nextPrompt; + return function () { + if (prompt === nextPrompt) prompt = null; + }; + } + + function confirmTransitionTo(location, action, getUserConfirmation, callback) { + // TODO: If another transition starts while we're still confirming + // the previous one, we may end up in a weird state. Figure out the + // best way to handle this. + if (prompt != null) { + var result = typeof prompt === 'function' ? prompt(location, action) : prompt; + + if (typeof result === 'string') { + if (typeof getUserConfirmation === 'function') { + getUserConfirmation(result, callback); + } else { + warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message'); + callback(true); + } + } else { + // Return false from a transition hook to cancel the transition. + callback(result !== false); + } + } else { + callback(true); + } + } + + var listeners = []; + + function appendListener(fn) { + var isActive = true; + + function listener() { + if (isActive) fn.apply(void 0, arguments); + } + + listeners.push(listener); + return function () { + isActive = false; + listeners = listeners.filter(function (item) { + return item !== listener; + }); + }; + } + + function notifyListeners() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + listeners.forEach(function (listener) { + return listener.apply(void 0, args); + }); + } + + return { + setPrompt: setPrompt, + confirmTransitionTo: confirmTransitionTo, + appendListener: appendListener, + notifyListeners: notifyListeners + }; + } + + var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + + function clamp(n, lowerBound, upperBound) { + return Math.min(Math.max(n, lowerBound), upperBound); + } + /** + * Creates a history object that stores locations in memory. + */ + + + function createMemoryHistory(props) { + if (props === void 0) { + props = {}; + } + + var _props = props, + getUserConfirmation = _props.getUserConfirmation, + _props$initialEntries = _props.initialEntries, + initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries, + _props$initialIndex = _props.initialIndex, + initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex, + _props$keyLength = _props.keyLength, + keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; + var transitionManager = createTransitionManager(); + + function setState(nextState) { + _extends(history, nextState); + + history.length = history.entries.length; + transitionManager.notifyListeners(history.location, history.action); + } + + function createKey() { + return Math.random().toString(36).substr(2, keyLength); + } + + var index = clamp(initialIndex, 0, initialEntries.length - 1); + var entries = initialEntries.map(function (entry) { + return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey()); + }); // Public interface + + var createHref = createPath; + + function push(path, state) { + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'PUSH'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + var prevIndex = history.index; + var nextIndex = prevIndex + 1; + var nextEntries = history.entries.slice(0); + + if (nextEntries.length > nextIndex) { + nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); + } else { + nextEntries.push(location); + } + + setState({ + action: action, + location: location, + index: nextIndex, + entries: nextEntries + }); + }); + } + + function replace(path, state) { + warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); + var action = 'REPLACE'; + var location = createLocation(path, state, createKey(), history.location); + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (!ok) return; + history.entries[history.index] = location; + setState({ + action: action, + location: location + }); + }); + } + + function go(n) { + var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); + var action = 'POP'; + var location = history.entries[nextIndex]; + transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { + if (ok) { + setState({ + action: action, + location: location, + index: nextIndex + }); + } else { + // Mimic the behavior of DOM histories by + // causing a render after a cancelled POP. + setState(); + } + }); + } + + function goBack() { + go(-1); + } + + function goForward() { + go(1); + } + + function canGo(n) { + var nextIndex = history.index + n; + return nextIndex >= 0 && nextIndex < history.entries.length; + } + + function block(prompt) { + if (prompt === void 0) { + prompt = false; + } + + return transitionManager.setPrompt(prompt); + } + + function listen(listener) { + return transitionManager.appendListener(listener); + } + + var history = { + length: entries.length, + action: 'POP', + location: entries[index], + index: index, + entries: entries, + createHref: createHref, + push: push, + replace: replace, + go: go, + goBack: goBack, + goForward: goForward, + canGo: canGo, + block: block, + listen: listen + }; + return history; + } + + var key = '__global_unique_id__'; + + var gud = function() { + return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1; + }; + + function warning$1(condition, message) { + { + if (condition) { + return; + } + + var text = "Warning: " + message; + + if (typeof console !== 'undefined') { + console.warn(text); + } + + try { + throw Error(text); + } catch (x) {} + } + } + + 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; + } + + function _inheritsLoose$1(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; + } + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + var MAX_SIGNED_31_BIT_INT = 1073741823; // Inlined Object.is polyfill. + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + + function objectIs(x, y) { + if (x === y) { + return x !== 0 || 1 / x === 1 / y; + } else { + return x !== x && y !== y; + } + } + + function createEventEmitter(value) { + var handlers = []; + return { + on: function on(handler) { + handlers.push(handler); + }, + off: function off(handler) { + handlers = handlers.filter(function (h) { + return h !== handler; + }); + }, + get: function get() { + return value; + }, + set: function set(newValue, changedBits) { + value = newValue; + handlers.forEach(function (handler) { + return handler(value, changedBits); + }); + } + }; + } + + function onlyChild(children) { + return Array.isArray(children) ? children[0] : children; + } + + function createReactContext(defaultValue, calculateChangedBits) { + var _defineProperty2, _defineProperty3; + + var contextProp = '__create-react-context-' + gud() + '__'; + + var Provider = + /*#__PURE__*/ + function (_Component) { + _inheritsLoose$1(Provider, _Component); + + function Provider() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _Component.call.apply(_Component, [this].concat(args)) || this; + + _defineProperty(_assertThisInitialized(_this), "emitter", createEventEmitter(_this.props.value)); + + return _this; + } + + var _proto = Provider.prototype; + + _proto.getChildContext = function getChildContext() { + var _ref; + + return _ref = {}, _ref[contextProp] = this.emitter, _ref; + }; + + _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if (this.props.value !== nextProps.value) { + var oldValue = this.props.value; + var newValue = nextProps.value; + var changedBits; + + if (objectIs(oldValue, newValue)) { + changedBits = 0; // No change + } else { + changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; + + { + warning$1((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: ' + changedBits); + } + + changedBits |= 0; + + if (changedBits !== 0) { + this.emitter.set(nextProps.value, changedBits); + } + } + } + }; + + _proto.render = function render() { + return this.props.children; + }; + + return Provider; + }(React.Component); + + _defineProperty(Provider, "childContextTypes", (_defineProperty2 = {}, _defineProperty2[contextProp] = propTypes.object.isRequired, _defineProperty2)); + + var Consumer = + /*#__PURE__*/ + function (_Component2) { + _inheritsLoose$1(Consumer, _Component2); + + function Consumer() { + var _this2; + + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + _this2 = _Component2.call.apply(_Component2, [this].concat(args)) || this; + + _defineProperty(_assertThisInitialized(_this2), "observedBits", void 0); + + _defineProperty(_assertThisInitialized(_this2), "state", { + value: _this2.getValue() + }); + + _defineProperty(_assertThisInitialized(_this2), "onUpdate", function (newValue, changedBits) { + var observedBits = _this2.observedBits | 0; + + if ((observedBits & changedBits) !== 0) { + _this2.setState({ + value: _this2.getValue() + }); + } + }); + + return _this2; + } + + var _proto2 = Consumer.prototype; + + _proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + var observedBits = nextProps.observedBits; + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default + : observedBits; + }; + + _proto2.componentDidMount = function componentDidMount() { + if (this.context[contextProp]) { + this.context[contextProp].on(this.onUpdate); + } + + var observedBits = this.props.observedBits; + this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default + : observedBits; + }; + + _proto2.componentWillUnmount = function componentWillUnmount() { + if (this.context[contextProp]) { + this.context[contextProp].off(this.onUpdate); + } + }; + + _proto2.getValue = function getValue() { + if (this.context[contextProp]) { + return this.context[contextProp].get(); + } else { + return defaultValue; + } + }; + + _proto2.render = function render() { + return onlyChild(this.props.children)(this.state.value); + }; + + return Consumer; + }(React.Component); + + _defineProperty(Consumer, "contextTypes", (_defineProperty3 = {}, _defineProperty3[contextProp] = propTypes.object, _defineProperty3)); + + return { + Provider: Provider, + Consumer: Consumer + }; + } + + var index = React__default.createContext || createReactContext; + + // TODO: Replace with React.createContext once we can assume React 16+ + + var createNamedContext = function createNamedContext(name) { + var context = index(); + context.displayName = name; + return context; + }; + + var context = + /*#__PURE__*/ + createNamedContext("Router"); + + /** + * The public API for putting history on context. + */ + + var Router = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose(Router, _React$Component); + + Router.computeRootMatch = function computeRootMatch(pathname) { + return { + path: "/", + url: "/", + params: {}, + isExact: pathname === "/" + }; + }; + + function Router(props) { + var _this; + + _this = _React$Component.call(this, props) || this; + _this.state = { + location: props.history.location + }; // This is a bit of a hack. We have to start listening for location + // changes here in the constructor in case there are any s + // on the initial render. If there are, they will replace/push when + // they mount and since cDM fires in children before parents, we may + // get a new location before the is mounted. + + _this._isMounted = false; + _this._pendingLocation = null; + + if (!props.staticContext) { + _this.unlisten = props.history.listen(function (location) { + if (_this._isMounted) { + _this.setState({ + location: location + }); + } else { + _this._pendingLocation = location; + } + }); + } + + return _this; + } + + var _proto = Router.prototype; + + _proto.componentDidMount = function componentDidMount() { + this._isMounted = true; + + if (this._pendingLocation) { + this.setState({ + location: this._pendingLocation + }); + } + }; + + _proto.componentWillUnmount = function componentWillUnmount() { + if (this.unlisten) this.unlisten(); + }; + + _proto.render = function render() { + return React__default.createElement(context.Provider, { + children: this.props.children || null, + value: { + history: this.props.history, + location: this.state.location, + match: Router.computeRootMatch(this.state.location.pathname), + staticContext: this.props.staticContext + } + }); + }; + + return Router; + }(React__default.Component); + + { + Router.propTypes = { + children: propTypes.node, + history: propTypes.object.isRequired, + staticContext: propTypes.object + }; + + Router.prototype.componentDidUpdate = function (prevProps) { + warning(prevProps.history === this.props.history, "You cannot change "); + }; + } + + /** + * The public API for a that stores location in memory. + */ + + var MemoryRouter = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose(MemoryRouter, _React$Component); + + function MemoryRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + _this.history = createMemoryHistory(_this.props); + return _this; + } + + var _proto = MemoryRouter.prototype; + + _proto.render = function render() { + return React__default.createElement(Router, { + history: this.history, + children: this.props.children + }); + }; + + return MemoryRouter; + }(React__default.Component); + + { + MemoryRouter.propTypes = { + initialEntries: propTypes.array, + initialIndex: propTypes.number, + getUserConfirmation: propTypes.func, + keyLength: propTypes.number, + children: propTypes.node + }; + + MemoryRouter.prototype.componentDidMount = function () { + warning(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`."); + }; + } + + var Lifecycle = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose(Lifecycle, _React$Component); + + function Lifecycle() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Lifecycle.prototype; + + _proto.componentDidMount = function componentDidMount() { + if (this.props.onMount) this.props.onMount.call(this, this); + }; + + _proto.componentDidUpdate = function componentDidUpdate(prevProps) { + if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps); + }; + + _proto.componentWillUnmount = function componentWillUnmount() { + if (this.props.onUnmount) this.props.onUnmount.call(this, this); + }; + + _proto.render = function render() { + return null; + }; + + return Lifecycle; + }(React__default.Component); + + /** + * The public API for prompting the user before navigating away from a screen. + */ + + function Prompt(_ref) { + var message = _ref.message, + _ref$when = _ref.when, + when = _ref$when === void 0 ? true : _ref$when; + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + if (!when || context$$1.staticContext) return null; + var method = context$$1.history.block; + return React__default.createElement(Lifecycle, { + onMount: function onMount(self) { + self.release = method(message); + }, + onUpdate: function onUpdate(self, prevProps) { + if (prevProps.message !== message) { + self.release(); + self.release = method(message); + } + }, + onUnmount: function onUnmount(self) { + self.release(); + }, + message: message + }); + }); + } + + { + var messageType = propTypes.oneOfType([propTypes.func, propTypes.string]); + Prompt.propTypes = { + when: propTypes.bool, + message: messageType.isRequired + }; + } + + var isarray = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; + }; + + /** + * Expose `pathToRegexp`. + */ + var pathToRegexp_1 = pathToRegexp; + var parse_1 = parse; + var compile_1 = compile; + var tokensToFunction_1 = tokensToFunction; + var tokensToRegExp_1 = tokensToRegExp; + + /** + * The main path matching regexp utility. + * + * @type {RegExp} + */ + var PATH_REGEXP = new RegExp([ + // Match escaped characters that would otherwise appear in future matches. + // This allows the user to escape special characters that won't transform. + '(\\\\.)', + // Match Express-style parameters and un-named parameters with a prefix + // and optional suffixes. Matches appear as: + // + // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] + // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] + // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] + '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' + ].join('|'), 'g'); + + /** + * Parse a string for the raw tokens. + * + * @param {string} str + * @param {Object=} options + * @return {!Array} + */ + function parse (str, options) { + var tokens = []; + var key = 0; + var index = 0; + var path = ''; + var defaultDelimiter = options && options.delimiter || '/'; + var res; + + while ((res = PATH_REGEXP.exec(str)) != null) { + var m = res[0]; + var escaped = res[1]; + var offset = res.index; + path += str.slice(index, offset); + index = offset + m.length; + + // Ignore already escaped sequences. + if (escaped) { + path += escaped[1]; + continue + } + + var next = str[index]; + var prefix = res[2]; + var name = res[3]; + var capture = res[4]; + var group = res[5]; + var modifier = res[6]; + var asterisk = res[7]; + + // Push the current path onto the tokens. + if (path) { + tokens.push(path); + path = ''; + } + + var partial = prefix != null && next != null && next !== prefix; + var repeat = modifier === '+' || modifier === '*'; + var optional = modifier === '?' || modifier === '*'; + var delimiter = res[2] || defaultDelimiter; + var pattern = capture || group; + + tokens.push({ + name: name || key++, + prefix: prefix || '', + delimiter: delimiter, + optional: optional, + repeat: repeat, + partial: partial, + asterisk: !!asterisk, + pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') + }); + } + + // Match any characters still remaining. + if (index < str.length) { + path += str.substr(index); + } + + // If the path exists, push it onto the end. + if (path) { + tokens.push(path); + } + + return tokens + } + + /** + * Compile a string to a template function for the path. + * + * @param {string} str + * @param {Object=} options + * @return {!function(Object=, Object=)} + */ + function compile (str, options) { + return tokensToFunction(parse(str, options)) + } + + /** + * Prettier encoding of URI path segments. + * + * @param {string} + * @return {string} + */ + function encodeURIComponentPretty (str) { + return encodeURI(str).replace(/[\/?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) + } + + /** + * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. + * + * @param {string} + * @return {string} + */ + function encodeAsterisk (str) { + return encodeURI(str).replace(/[?#]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) + } + + /** + * Expose a method for transforming tokens into the path function. + */ + function tokensToFunction (tokens) { + // Compile all the tokens into regexps. + var matches = new Array(tokens.length); + + // Compile all the patterns before compilation. + for (var i = 0; i < tokens.length; i++) { + if (typeof tokens[i] === 'object') { + matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$'); + } + } + + return function (obj, opts) { + var path = ''; + var data = obj || {}; + var options = opts || {}; + var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent; + + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + + if (typeof token === 'string') { + path += token; + + continue + } + + var value = data[token.name]; + var segment; + + if (value == null) { + if (token.optional) { + // Prepend partial segment prefixes. + if (token.partial) { + path += token.prefix; + } + + continue + } else { + throw new TypeError('Expected "' + token.name + '" to be defined') + } + } + + if (isarray(value)) { + if (!token.repeat) { + throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') + } + + if (value.length === 0) { + if (token.optional) { + continue + } else { + throw new TypeError('Expected "' + token.name + '" to not be empty') + } + } + + for (var j = 0; j < value.length; j++) { + segment = encode(value[j]); + + if (!matches[i].test(segment)) { + throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') + } + + path += (j === 0 ? token.prefix : token.delimiter) + segment; + } + + continue + } + + segment = token.asterisk ? encodeAsterisk(value) : encode(value); + + if (!matches[i].test(segment)) { + throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') + } + + path += token.prefix + segment; + } + + return path + } + } + + /** + * Escape a regular expression string. + * + * @param {string} str + * @return {string} + */ + function escapeString (str) { + return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') + } + + /** + * Escape the capturing group by escaping special characters and meaning. + * + * @param {string} group + * @return {string} + */ + function escapeGroup (group) { + return group.replace(/([=!:$\/()])/g, '\\$1') + } + + /** + * Attach the keys as a property of the regexp. + * + * @param {!RegExp} re + * @param {Array} keys + * @return {!RegExp} + */ + function attachKeys (re, keys) { + re.keys = keys; + return re + } + + /** + * Get the flags for a regexp from the options. + * + * @param {Object} options + * @return {string} + */ + function flags (options) { + return options.sensitive ? '' : 'i' + } + + /** + * Pull out keys from a regexp. + * + * @param {!RegExp} path + * @param {!Array} keys + * @return {!RegExp} + */ + function regexpToRegexp (path, keys) { + // Use a negative lookahead to match only capturing groups. + var groups = path.source.match(/\((?!\?)/g); + + if (groups) { + for (var i = 0; i < groups.length; i++) { + keys.push({ + name: i, + prefix: null, + delimiter: null, + optional: false, + repeat: false, + partial: false, + asterisk: false, + pattern: null + }); + } + } + + return attachKeys(path, keys) + } + + /** + * Transform an array into a regexp. + * + * @param {!Array} path + * @param {Array} keys + * @param {!Object} options + * @return {!RegExp} + */ + function arrayToRegexp (path, keys, options) { + var parts = []; + + for (var i = 0; i < path.length; i++) { + parts.push(pathToRegexp(path[i], keys, options).source); + } + + var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); + + return attachKeys(regexp, keys) + } + + /** + * Create a path regexp from string input. + * + * @param {string} path + * @param {!Array} keys + * @param {!Object} options + * @return {!RegExp} + */ + function stringToRegexp (path, keys, options) { + return tokensToRegExp(parse(path, options), keys, options) + } + + /** + * Expose a function for taking tokens and returning a RegExp. + * + * @param {!Array} tokens + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ + function tokensToRegExp (tokens, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options); + keys = []; + } + + options = options || {}; + + var strict = options.strict; + var end = options.end !== false; + var route = ''; + + // Iterate over the tokens and create our regexp string. + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + + if (typeof token === 'string') { + route += escapeString(token); + } else { + var prefix = escapeString(token.prefix); + var capture = '(?:' + token.pattern + ')'; + + keys.push(token); + + if (token.repeat) { + capture += '(?:' + prefix + capture + ')*'; + } + + if (token.optional) { + if (!token.partial) { + capture = '(?:' + prefix + '(' + capture + '))?'; + } else { + capture = prefix + '(' + capture + ')?'; + } + } else { + capture = prefix + '(' + capture + ')'; + } + + route += capture; + } + } + + var delimiter = escapeString(options.delimiter || '/'); + var endsWithDelimiter = route.slice(-delimiter.length) === delimiter; + + // In non-strict mode we allow a slash at the end of match. If the path to + // match already ends with a slash, we remove it for consistency. The slash + // is valid at the end of a path match, not in the middle. This is important + // in non-ending mode, where "/test/" shouldn't match "/test//route". + if (!strict) { + route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'; + } + + if (end) { + route += '$'; + } else { + // In non-ending mode, we need the capturing groups to match as much as + // possible by using a positive lookahead to the end or next path segment. + route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'; + } + + return attachKeys(new RegExp('^' + route, flags(options)), keys) + } + + /** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + * + * @param {(string|RegExp|Array)} path + * @param {(Array|Object)=} keys + * @param {Object=} options + * @return {!RegExp} + */ + function pathToRegexp (path, keys, options) { + if (!isarray(keys)) { + options = /** @type {!Object} */ (keys || options); + keys = []; + } + + options = options || {}; + + if (path instanceof RegExp) { + return regexpToRegexp(path, /** @type {!Array} */ (keys)) + } + + if (isarray(path)) { + return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) + } + + return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) + } + pathToRegexp_1.parse = parse_1; + pathToRegexp_1.compile = compile_1; + pathToRegexp_1.tokensToFunction = tokensToFunction_1; + pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; + + var cache = {}; + var cacheLimit = 10000; + var cacheCount = 0; + + function compilePath(path) { + if (cache[path]) return cache[path]; + var generator = pathToRegexp_1.compile(path); + + if (cacheCount < cacheLimit) { + cache[path] = generator; + cacheCount++; + } + + return generator; + } + /** + * Public API for generating a URL pathname from a path and parameters. + */ + + + function generatePath(path, params) { + if (path === void 0) { + path = "/"; + } + + if (params === void 0) { + params = {}; + } + + return path === "/" ? path : compilePath(path)(params, { + pretty: true + }); + } + + /** + * The public API for navigating programmatically with a component. + */ + + function Redirect(_ref) { + var computedMatch = _ref.computedMatch, + to = _ref.to, + _ref$push = _ref.push, + push = _ref$push === void 0 ? false : _ref$push; + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + var history = context$$1.history, + staticContext = context$$1.staticContext; + var method = push ? history.push : history.replace; + var location = createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, { + pathname: generatePath(to.pathname, computedMatch.params) + }) : to); // When rendering in a static context, + // set the new location immediately. + + if (staticContext) { + method(location); + return null; + } + + return React__default.createElement(Lifecycle, { + onMount: function onMount() { + method(location); + }, + onUpdate: function onUpdate(self, prevProps) { + var prevLocation = createLocation(prevProps.to); + + if (!locationsAreEqual(prevLocation, _extends({}, location, { + key: prevLocation.key + }))) { + method(location); + } + }, + to: to + }); + }); + } + + { + Redirect.propTypes = { + push: propTypes.bool, + from: propTypes.string, + to: propTypes.oneOfType([propTypes.string, propTypes.object]).isRequired + }; + } + + var reactIs_production_min = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports,"__esModule",{value:!0}); + var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.concurrent_mode"):60111,m=b?Symbol.for("react.forward_ref"):60112,n=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.memo"):60115,r=b?Symbol.for("react.lazy"): + 60116;function t(a){if("object"===typeof a&&null!==a){var p=a.$$typeof;switch(p){case c:switch(a=a.type,a){case l:case e:case g:case f:return a;default:switch(a=a&&a.$$typeof,a){case k:case m:case h:return a;default:return p}}case d:return p}}}function u(a){return t(a)===l}exports.typeOf=t;exports.AsyncMode=l;exports.ConcurrentMode=l;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=m;exports.Fragment=e;exports.Profiler=g;exports.Portal=d; + exports.StrictMode=f;exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===l||a===g||a===f||a===n||"object"===typeof a&&null!==a&&(a.$$typeof===r||a.$$typeof===q||a.$$typeof===h||a.$$typeof===k||a.$$typeof===m)};exports.isAsyncMode=function(a){return u(a)};exports.isConcurrentMode=u;exports.isContextConsumer=function(a){return t(a)===k};exports.isContextProvider=function(a){return t(a)===h}; + exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return t(a)===m};exports.isFragment=function(a){return t(a)===e};exports.isProfiler=function(a){return t(a)===g};exports.isPortal=function(a){return t(a)===d};exports.isStrictMode=function(a){return t(a)===f}; + }); + + unwrapExports(reactIs_production_min); + var reactIs_production_min_1 = reactIs_production_min.typeOf; + var reactIs_production_min_2 = reactIs_production_min.AsyncMode; + var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode; + var reactIs_production_min_4 = reactIs_production_min.ContextConsumer; + var reactIs_production_min_5 = reactIs_production_min.ContextProvider; + var reactIs_production_min_6 = reactIs_production_min.Element; + var reactIs_production_min_7 = reactIs_production_min.ForwardRef; + var reactIs_production_min_8 = reactIs_production_min.Fragment; + var reactIs_production_min_9 = reactIs_production_min.Profiler; + var reactIs_production_min_10 = reactIs_production_min.Portal; + var reactIs_production_min_11 = reactIs_production_min.StrictMode; + var reactIs_production_min_12 = reactIs_production_min.isValidElementType; + var reactIs_production_min_13 = reactIs_production_min.isAsyncMode; + var reactIs_production_min_14 = reactIs_production_min.isConcurrentMode; + var reactIs_production_min_15 = reactIs_production_min.isContextConsumer; + var reactIs_production_min_16 = reactIs_production_min.isContextProvider; + var reactIs_production_min_17 = reactIs_production_min.isElement; + var reactIs_production_min_18 = reactIs_production_min.isForwardRef; + var reactIs_production_min_19 = reactIs_production_min.isFragment; + var reactIs_production_min_20 = reactIs_production_min.isProfiler; + var reactIs_production_min_21 = reactIs_production_min.isPortal; + var reactIs_production_min_22 = reactIs_production_min.isStrictMode; + + var reactIs_development = createCommonjsModule(function (module, exports) { + + + + { + (function() { + + Object.defineProperty(exports, '__esModule', { value: true }); + + // The Symbol used to tag the ReactElement-like types. If there is no native Symbol + // nor polyfill, then a plain number is used for performance. + var hasSymbol = typeof Symbol === 'function' && Symbol.for; + + var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; + var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; + var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; + var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; + var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; + var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; + var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; + var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; + var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; + var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; + var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; + var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; + + function isValidElementType(type) { + return typeof type === 'string' || typeof type === 'function' || + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE); + } + + /** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + var lowPriorityWarning = function () {}; + + { + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; + } + + var lowPriorityWarning$1 = lowPriorityWarning; + + function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + + switch (type) { + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + + return undefined; + } + + // AsyncMode alias is deprecated along with isAsyncMode + var AsyncMode = REACT_CONCURRENT_MODE_TYPE; + var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; + var ContextConsumer = REACT_CONTEXT_TYPE; + var ContextProvider = REACT_PROVIDER_TYPE; + var Element = REACT_ELEMENT_TYPE; + var ForwardRef = REACT_FORWARD_REF_TYPE; + var Fragment = REACT_FRAGMENT_TYPE; + var Profiler = REACT_PROFILER_TYPE; + var Portal = REACT_PORTAL_TYPE; + var StrictMode = REACT_STRICT_MODE_TYPE; + + var hasWarnedAboutDeprecatedIsAsyncMode = false; + + // AsyncMode should be deprecated + function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } + return isConcurrentMode(object); + } + function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; + } + function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; + } + function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; + } + function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; + } + function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; + } + function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; + } + function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; + } + function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; + } + function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; + } + + exports.typeOf = typeOf; + exports.AsyncMode = AsyncMode; + exports.ConcurrentMode = ConcurrentMode; + exports.ContextConsumer = ContextConsumer; + exports.ContextProvider = ContextProvider; + exports.Element = Element; + exports.ForwardRef = ForwardRef; + exports.Fragment = Fragment; + exports.Profiler = Profiler; + exports.Portal = Portal; + exports.StrictMode = StrictMode; + exports.isValidElementType = isValidElementType; + exports.isAsyncMode = isAsyncMode; + exports.isConcurrentMode = isConcurrentMode; + exports.isContextConsumer = isContextConsumer; + exports.isContextProvider = isContextProvider; + exports.isElement = isElement; + exports.isForwardRef = isForwardRef; + exports.isFragment = isFragment; + exports.isProfiler = isProfiler; + exports.isPortal = isPortal; + exports.isStrictMode = isStrictMode; + })(); + } + }); + + unwrapExports(reactIs_development); + var reactIs_development_1 = reactIs_development.typeOf; + var reactIs_development_2 = reactIs_development.AsyncMode; + var reactIs_development_3 = reactIs_development.ConcurrentMode; + var reactIs_development_4 = reactIs_development.ContextConsumer; + var reactIs_development_5 = reactIs_development.ContextProvider; + var reactIs_development_6 = reactIs_development.Element; + var reactIs_development_7 = reactIs_development.ForwardRef; + var reactIs_development_8 = reactIs_development.Fragment; + var reactIs_development_9 = reactIs_development.Profiler; + var reactIs_development_10 = reactIs_development.Portal; + var reactIs_development_11 = reactIs_development.StrictMode; + var reactIs_development_12 = reactIs_development.isValidElementType; + var reactIs_development_13 = reactIs_development.isAsyncMode; + var reactIs_development_14 = reactIs_development.isConcurrentMode; + var reactIs_development_15 = reactIs_development.isContextConsumer; + var reactIs_development_16 = reactIs_development.isContextProvider; + var reactIs_development_17 = reactIs_development.isElement; + var reactIs_development_18 = reactIs_development.isForwardRef; + var reactIs_development_19 = reactIs_development.isFragment; + var reactIs_development_20 = reactIs_development.isProfiler; + var reactIs_development_21 = reactIs_development.isPortal; + var reactIs_development_22 = reactIs_development.isStrictMode; + + var reactIs = createCommonjsModule(function (module) { + + { + module.exports = reactIs_development; + } + }); + var reactIs_1 = reactIs.isValidElementType; + + var cache$1 = {}; + var cacheLimit$1 = 10000; + var cacheCount$1 = 0; + + function compilePath$1(path, options) { + var cacheKey = "" + options.end + options.strict + options.sensitive; + var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {}); + if (pathCache[path]) return pathCache[path]; + var keys = []; + var regexp = pathToRegexp_1(path, keys, options); + var result = { + regexp: regexp, + keys: keys + }; + + if (cacheCount$1 < cacheLimit$1) { + pathCache[path] = result; + cacheCount$1++; + } + + return result; + } + /** + * Public API for matching a URL pathname to a path. + */ + + + function matchPath(pathname, options) { + if (options === void 0) { + options = {}; + } + + if (typeof options === "string") options = { + path: options + }; + var _options = options, + path = _options.path, + _options$exact = _options.exact, + exact = _options$exact === void 0 ? false : _options$exact, + _options$strict = _options.strict, + strict = _options$strict === void 0 ? false : _options$strict, + _options$sensitive = _options.sensitive, + sensitive = _options$sensitive === void 0 ? false : _options$sensitive; + var paths = [].concat(path); + return paths.reduce(function (matched, path) { + if (!path) return null; + if (matched) return matched; + + var _compilePath = compilePath$1(path, { + end: exact, + strict: strict, + sensitive: sensitive + }), + regexp = _compilePath.regexp, + keys = _compilePath.keys; + + var match = regexp.exec(pathname); + if (!match) return null; + var url = match[0], + values = match.slice(1); + var isExact = pathname === url; + if (exact && !isExact) return null; + return { + path: path, + // the path used to match + url: path === "/" && url === "" ? "/" : url, + // the matched portion of the URL + isExact: isExact, + // whether or not we matched exactly + params: keys.reduce(function (memo, key, index) { + memo[key.name] = values[index]; + return memo; + }, {}) + }; + }, null); + } + + function isEmptyChildren(children) { + return React__default.Children.count(children) === 0; + } + /** + * The public API for matching a single path and rendering. + */ + + + var Route = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose(Route, _React$Component); + + function Route() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Route.prototype; + + _proto.render = function render() { + var _this = this; + + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + var location = _this.props.location || context$$1.location; + var match = _this.props.computedMatch ? _this.props.computedMatch // already computed the match for us + : _this.props.path ? matchPath(location.pathname, _this.props) : context$$1.match; + + var props = _extends({}, context$$1, { + location: location, + match: match + }); + + var _this$props = _this.props, + children = _this$props.children, + component = _this$props.component, + render = _this$props.render; // Preact uses an empty array as children by + // default, so use null if that's the case. + + if (Array.isArray(children) && children.length === 0) { + children = null; + } + + if (typeof children === "function") { + children = children(props); + + if (children === undefined) { + { + var path = _this.props.path; + warning(false, "You returned `undefined` from the `children` function of " + (", but you ") + "should have returned a React element or `null`"); + } + + children = null; + } + } + + return React__default.createElement(context.Provider, { + value: props + }, children && !isEmptyChildren(children) ? children : props.match ? component ? React__default.createElement(component, props) : render ? render(props) : null : null); + }); + }; + + return Route; + }(React__default.Component); + + { + Route.propTypes = { + children: propTypes.oneOfType([propTypes.func, propTypes.node]), + component: function component(props, propName) { + if (props[propName] && !reactIs_1(props[propName])) { + return new Error("Invalid prop 'component' supplied to 'Route': the prop is not a valid React component"); + } + }, + exact: propTypes.bool, + location: propTypes.object, + path: propTypes.oneOfType([propTypes.string, propTypes.arrayOf(propTypes.string)]), + render: propTypes.func, + sensitive: propTypes.bool, + strict: propTypes.bool + }; + + Route.prototype.componentDidMount = function () { + warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.component), "You should not use and in the same route; will be ignored"); + warning(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.render), "You should not use and in the same route; will be ignored"); + warning(!(this.props.component && this.props.render), "You should not use and in the same route; will be ignored"); + }; + + Route.prototype.componentDidUpdate = function (prevProps) { + warning(!(this.props.location && !prevProps.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); + warning(!(!this.props.location && prevProps.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); + }; + } + + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; + } + + function addLeadingSlash$1(path) { + return path.charAt(0) === "/" ? path : "/" + path; + } + + function addBasename(basename, location) { + if (!basename) return location; + return _extends({}, location, { + pathname: addLeadingSlash$1(basename) + location.pathname + }); + } + + function stripBasename$1(basename, location) { + if (!basename) return location; + var base = addLeadingSlash$1(basename); + if (location.pathname.indexOf(base) !== 0) return location; + return _extends({}, location, { + pathname: location.pathname.substr(base.length) + }); + } + + function createURL(location) { + return typeof location === "string" ? location : createPath(location); + } + + function staticHandler(methodName) { + return function () { + invariant(false, "You cannot %s with ", methodName); + }; + } + + function noop() {} + /** + * The public top-level API for a "static" , so-called because it + * can't actually change the current location. Instead, it just records + * location changes in a context object. Useful mainly in testing and + * server-rendering scenarios. + */ + + + var StaticRouter = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose(StaticRouter, _React$Component); + + function StaticRouter() { + var _this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this; + + _this.handlePush = function (location) { + return _this.navigateTo(location, "PUSH"); + }; + + _this.handleReplace = function (location) { + return _this.navigateTo(location, "REPLACE"); + }; + + _this.handleListen = function () { + return noop; + }; + + _this.handleBlock = function () { + return noop; + }; + + return _this; + } + + var _proto = StaticRouter.prototype; + + _proto.navigateTo = function navigateTo(location, action) { + var _this$props = this.props, + _this$props$basename = _this$props.basename, + basename = _this$props$basename === void 0 ? "" : _this$props$basename, + _this$props$context = _this$props.context, + context = _this$props$context === void 0 ? {} : _this$props$context; + context.action = action; + context.location = addBasename(basename, createLocation(location)); + context.url = createURL(context.location); + }; + + _proto.render = function render() { + var _this$props2 = this.props, + _this$props2$basename = _this$props2.basename, + basename = _this$props2$basename === void 0 ? "" : _this$props2$basename, + _this$props2$context = _this$props2.context, + context = _this$props2$context === void 0 ? {} : _this$props2$context, + _this$props2$location = _this$props2.location, + location = _this$props2$location === void 0 ? "/" : _this$props2$location, + rest = _objectWithoutPropertiesLoose(_this$props2, ["basename", "context", "location"]); + + var history = { + createHref: function createHref(path) { + return addLeadingSlash$1(basename + createURL(path)); + }, + action: "POP", + location: stripBasename$1(basename, createLocation(location)), + push: this.handlePush, + replace: this.handleReplace, + go: staticHandler("go"), + goBack: staticHandler("goBack"), + goForward: staticHandler("goForward"), + listen: this.handleListen, + block: this.handleBlock + }; + return React__default.createElement(Router, _extends({}, rest, { + history: history, + staticContext: context + })); + }; + + return StaticRouter; + }(React__default.Component); + + { + StaticRouter.propTypes = { + basename: propTypes.string, + context: propTypes.object, + location: propTypes.oneOfType([propTypes.string, propTypes.object]) + }; + + StaticRouter.prototype.componentDidMount = function () { + warning(!this.props.history, " ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`."); + }; + } + + /** + * The public API for rendering the first that matches. + */ + + var Switch = + /*#__PURE__*/ + function (_React$Component) { + _inheritsLoose(Switch, _React$Component); + + function Switch() { + return _React$Component.apply(this, arguments) || this; + } + + var _proto = Switch.prototype; + + _proto.render = function render() { + var _this = this; + + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use outside a ") : void 0; + var location = _this.props.location || context$$1.location; + var element, match; // We use React.Children.forEach instead of React.Children.toArray().find() + // here because toArray adds keys to all child elements and we do not want + // to trigger an unmount/remount for two s that render the same + // component at different URLs. + + React__default.Children.forEach(_this.props.children, function (child) { + if (match == null && React__default.isValidElement(child)) { + element = child; + var path = child.props.path || child.props.from; + match = path ? matchPath(location.pathname, _extends({}, child.props, { + path: path + })) : context$$1.match; + } + }); + return match ? React__default.cloneElement(element, { + location: location, + computedMatch: match + }) : null; + }); + }; + + return Switch; + }(React__default.Component); + + { + Switch.propTypes = { + children: propTypes.node, + location: propTypes.object + }; + + Switch.prototype.componentDidUpdate = function (prevProps) { + warning(!(this.props.location && !prevProps.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); + warning(!(!this.props.location && prevProps.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); + }; + } + + /** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ + + + var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true + }; + + var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true + }; + + var FORWARD_REF_STATICS = { + '$$typeof': true, + render: true + }; + + var TYPE_STATICS = {}; + TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; + + var defineProperty = Object.defineProperty; + var getOwnPropertyNames = Object.getOwnPropertyNames; + var getOwnPropertySymbols$1 = Object.getOwnPropertySymbols; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + var getPrototypeOf = Object.getPrototypeOf; + var objectPrototype = Object.prototype; + + function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { + // don't hoist over string (html) components + + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + var keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols$1) { + keys = keys.concat(getOwnPropertySymbols$1(sourceComponent)); + } + + var targetStatics = TYPE_STATICS[targetComponent['$$typeof']] || REACT_STATICS; + var sourceStatics = TYPE_STATICS[sourceComponent['$$typeof']] || REACT_STATICS; + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + try { + // Avoid failures from read-only properties + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + + return targetComponent; + } + + return targetComponent; + } + + var hoistNonReactStatics_cjs = hoistNonReactStatics; + + /** + * A public higher-order component to access the imperative API + */ + + function withRouter(Component) { + var displayName = "withRouter(" + (Component.displayName || Component.name) + ")"; + + var C = function C(props) { + var wrappedComponentRef = props.wrappedComponentRef, + remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]); + + return React__default.createElement(context.Consumer, null, function (context$$1) { + !context$$1 ? invariant(false, "You should not use <" + displayName + " /> outside a ") : void 0; + return React__default.createElement(Component, _extends({}, remainingProps, context$$1, { + ref: wrappedComponentRef + })); + }); + }; + + C.displayName = displayName; + C.WrappedComponent = Component; + + { + C.propTypes = { + wrappedComponentRef: propTypes.oneOfType([propTypes.string, propTypes.func, propTypes.object]) + }; + } + + return hoistNonReactStatics_cjs(C, Component); + } + + { + if (typeof window !== "undefined") { + var global$1 = window; + var key$1 = "__react_router_build__"; + var buildNames = { + cjs: "CommonJS", + esm: "ES modules", + umd: "UMD" + }; + + if (global$1[key$1] && global$1[key$1] !== "umd") { + var initialBuildName = buildNames[global$1[key$1]]; + var secondaryBuildName = buildNames["umd"]; // TODO: Add link to article that explains in detail how to avoid + // loading 2 different builds. + + throw new Error("You are loading the " + secondaryBuildName + " build of React Router " + ("on a page that is already running the " + initialBuildName + " ") + "build, so things won't work right."); + } + + global$1[key$1] = "umd"; + } + } + + exports.MemoryRouter = MemoryRouter; + exports.Prompt = Prompt; + exports.Redirect = Redirect; + exports.Route = Route; + exports.Router = Router; + exports.StaticRouter = StaticRouter; + exports.Switch = Switch; + exports.generatePath = generatePath; + exports.matchPath = matchPath; + exports.withRouter = withRouter; + exports.__RouterContext = context; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/react-router/umd/react-router.min.js b/node_modules/react-router/umd/react-router.min.js new file mode 100644 index 00000000..9d2017a4 --- /dev/null +++ b/node_modules/react-router/umd/react-router.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e(t.ReactRouter={},t.React)}(this,function(t,a){"use strict";var s="default"in a?a.default:a;function r(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}var u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;(function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}})()&&Object.assign;function p(){}var l=n(function(t){t.exports=function(){function t(t,e,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}var n={array:t.isRequired=t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=p,n.PropTypes=n}()});function b(){return(b=Object.assign||function(t){for(var e=1;ee?n.splice(e,n.length-e,r):n.push(r),f({action:"PUSH",location:r,index:e,entries:n})}})},replace:function(t,e){var n="REPLACE",r=w(t,e,h(),g.location);l.confirmTransitionTo(r,n,o,function(t){t&&(g.entries[g.index]=r,f({action:n,location:r}))})},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(t){var e=g.index+t;return 0<=e&&e 0 + ? format.replace(/%s/g, function() { + return subs[index++]; + }) + : format); + + if (typeof console !== "undefined") { + console.error(message); + } + + try { + // --- Welcome to debugging React Router --- + // This error was thrown as a convenience so that you can use the + // stack trace to find the callsite that triggered this warning. + throw new Error(message); + } catch (e) {} + }; +} + +module.exports = function(member) { + printWarning( + 'Please use `require("react-router").%s` instead of `require("react-router/%s")`. ' + + "Support for the latter will be removed in the next major release.", + [member, member] + ); +}; diff --git a/node_modules/react-router/withRouter.js b/node_modules/react-router/withRouter.js new file mode 100644 index 00000000..214676a4 --- /dev/null +++ b/node_modules/react-router/withRouter.js @@ -0,0 +1,3 @@ +"use strict"; +require("./warnAboutDeprecatedCJSRequire")("withRouter"); +module.exports = require("./index.js").withRouter; diff --git a/node_modules/regenerator-runtime/README.md b/node_modules/regenerator-runtime/README.md new file mode 100644 index 00000000..d93386a3 --- /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 00000000..37c75a29 --- /dev/null +++ b/node_modules/regenerator-runtime/package.json @@ -0,0 +1,47 @@ +{ + "_from": "regenerator-runtime@^0.13.2", + "_id": "regenerator-runtime@0.13.2", + "_inBundle": false, + "_integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==", + "_location": "/regenerator-runtime", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "regenerator-runtime@^0.13.2", + "name": "regenerator-runtime", + "escapedName": "regenerator-runtime", + "rawSpec": "^0.13.2", + "saveSpec": null, + "fetchSpec": "^0.13.2" + }, + "_requiredBy": [ + "/@babel/runtime" + ], + "_resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "_shasum": "32e59c9a6fb9b1a4aff09b4930ca2d4477343447", + "_spec": "regenerator-runtime@^0.13.2", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/@babel/runtime", + "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.js", + "name": "regenerator-runtime", + "repository": { + "type": "git", + "url": "https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime" + }, + "sideEffects": true, + "version": "0.13.2" +} diff --git a/node_modules/regenerator-runtime/path.js b/node_modules/regenerator-runtime/path.js new file mode 100644 index 00000000..ced878b8 --- /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.js b/node_modules/regenerator-runtime/runtime.js new file mode 100644 index 00000000..92d18150 --- /dev/null +++ b/node_modules/regenerator-runtime/runtime.js @@ -0,0 +1,726 @@ +/** + * 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. + */ + +var runtime = (function (exports) { + "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"; + + 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; + } + exports.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); + }; + }); + } + + exports.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; + }; + + exports.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. + exports.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. + result.value = unwrapped; + resolve(result); + }, function(error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, 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; + }; + exports.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. + exports.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return exports.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") { + // Note: ["return"] must be used for ES3 parsing compatibility. + 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); + } + + exports.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 }; + } + exports.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; + } + }; + + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + +}( + // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + typeof module === "object" ? module.exports : {} +)); + +try { + regeneratorRuntime = runtime; +} catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + Function("r", "regeneratorRuntime = r")(runtime); +} diff --git a/node_modules/resolve-pathname/README.md b/node_modules/resolve-pathname/README.md new file mode 100644 index 00000000..e893e5d8 --- /dev/null +++ b/node_modules/resolve-pathname/README.md @@ -0,0 +1,65 @@ +# resolve-pathname [![Travis][build-badge]][build] [![npm package][npm-badge]][npm] + +[build-badge]: https://img.shields.io/travis/mjackson/resolve-pathname/master.svg?style=flat-square +[build]: https://travis-ci.org/mjackson/resolve-pathname + +[npm-badge]: https://img.shields.io/npm/v/resolve-pathname.svg?style=flat-square +[npm]: https://www.npmjs.org/package/resolve-pathname + +[resolve-pathname](https://www.npmjs.com/package/resolve-pathname) resolves URL pathnames identical to the way browsers resolve the pathname of an `` value. The goals are: + + - 100% compatibility with browser pathname resolution + - Pure JavaScript implementation (no DOM dependency) + +## Installation + +Using [npm](https://www.npmjs.com/): + + $ npm install --save resolve-pathname + +Then, use as you would anything else: + +```js +// using ES6 modules +import resolvePathname from 'resolve-pathname' + +// using CommonJS modules +var resolvePathname = require('resolve-pathname') +``` + +The UMD build is also available on [unpkg](https://unpkg.com): + +```html + +``` + +You can find the library on `window.resolvePathname`. + +## Usage + +```js +import resolvePathname from 'resolve-pathname' + +// Simply pass the pathname you'd like to resolve. Second +// argument is the path we're coming from, or the current +// pathname. It defaults to "/". +resolvePathname('about', '/company/jobs') // /company/about +resolvePathname('../jobs', '/company/team/ceo') // /company/jobs +resolvePathname('about') // /about +resolvePathname('/about') // /about + +// Index paths (with a trailing slash) are also supported and +// work the same way as browsers. +resolvePathname('about', '/company/info/') // /company/info/about + +// In browsers, it's easy to resolve a URL pathname relative to +// the current page. Just use window.location! e.g. if +// window.location.pathname == '/company/team/ceo' then +resolvePathname('cto', window.location.pathname) // /company/team/cto +resolvePathname('../jobs', window.location.pathname) // /company/jobs +``` + +## Prior Work + +- [url.resolve](https://nodejs.org/api/url.html#url_url_resolve_from_to) - node's `url.resolve` implementation for full URLs +- [resolve-url](https://www.npmjs.com/package/resolve-url) - A DOM-dependent implementation of the same algorithm diff --git a/node_modules/resolve-pathname/cjs/index.js b/node_modules/resolve-pathname/cjs/index.js new file mode 100644 index 00000000..01bd61e8 --- /dev/null +++ b/node_modules/resolve-pathname/cjs/index.js @@ -0,0 +1,74 @@ +'use strict'; + +exports.__esModule = true; +function isAbsolute(pathname) { + return pathname.charAt(0) === '/'; +} + +// 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(); +} + +// This implementation is based heavily on node's url.parse +function resolvePathname(to) { + var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + + var toParts = to && to.split('/') || []; + var fromParts = from && from.split('/') || []; + + var isToAbs = to && isAbsolute(to); + var isFromAbs = from && isAbsolute(from); + var mustEndAbs = isToAbs || isFromAbs; + + if (to && isAbsolute(to)) { + // to is absolute + fromParts = toParts; + } else if (toParts.length) { + // to is relative, drop the filename + fromParts.pop(); + fromParts = fromParts.concat(toParts); + } + + if (!fromParts.length) return '/'; + + var hasTrailingSlash = void 0; + if (fromParts.length) { + var last = fromParts[fromParts.length - 1]; + hasTrailingSlash = last === '.' || last === '..' || last === ''; + } else { + hasTrailingSlash = false; + } + + var up = 0; + for (var i = fromParts.length; i >= 0; i--) { + var part = fromParts[i]; + + if (part === '.') { + spliceOne(fromParts, i); + } else if (part === '..') { + spliceOne(fromParts, i); + up++; + } else if (up) { + spliceOne(fromParts, i); + up--; + } + } + + if (!mustEndAbs) for (; up--; up) { + fromParts.unshift('..'); + }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(''); + + var result = fromParts.join('/'); + + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; + + return result; +} + +exports.default = resolvePathname; +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/resolve-pathname/index.js b/node_modules/resolve-pathname/index.js new file mode 100644 index 00000000..a9907ca2 --- /dev/null +++ b/node_modules/resolve-pathname/index.js @@ -0,0 +1,70 @@ +function isAbsolute(pathname) { + return pathname.charAt(0) === '/'; +} + +// 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(); +} + +// This implementation is based heavily on node's url.parse +function resolvePathname(to) { + var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + + var toParts = to && to.split('/') || []; + var fromParts = from && from.split('/') || []; + + var isToAbs = to && isAbsolute(to); + var isFromAbs = from && isAbsolute(from); + var mustEndAbs = isToAbs || isFromAbs; + + if (to && isAbsolute(to)) { + // to is absolute + fromParts = toParts; + } else if (toParts.length) { + // to is relative, drop the filename + fromParts.pop(); + fromParts = fromParts.concat(toParts); + } + + if (!fromParts.length) return '/'; + + var hasTrailingSlash = void 0; + if (fromParts.length) { + var last = fromParts[fromParts.length - 1]; + hasTrailingSlash = last === '.' || last === '..' || last === ''; + } else { + hasTrailingSlash = false; + } + + var up = 0; + for (var i = fromParts.length; i >= 0; i--) { + var part = fromParts[i]; + + if (part === '.') { + spliceOne(fromParts, i); + } else if (part === '..') { + spliceOne(fromParts, i); + up++; + } else if (up) { + spliceOne(fromParts, i); + up--; + } + } + + if (!mustEndAbs) for (; up--; up) { + fromParts.unshift('..'); + }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(''); + + var result = fromParts.join('/'); + + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; + + return result; +} + +export default resolvePathname; \ No newline at end of file diff --git a/node_modules/resolve-pathname/package.json b/node_modules/resolve-pathname/package.json new file mode 100644 index 00000000..830a90d2 --- /dev/null +++ b/node_modules/resolve-pathname/package.json @@ -0,0 +1,75 @@ +{ + "_from": "resolve-pathname@^2.2.0", + "_id": "resolve-pathname@2.2.0", + "_inBundle": false, + "_integrity": "sha512-bAFz9ld18RzJfddgrO2e/0S2O81710++chRMUxHjXOYKF6jTAMrUNZrEZ1PvV0zlhfjidm08iRPdTLPno1FuRg==", + "_location": "/resolve-pathname", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "resolve-pathname@^2.2.0", + "name": "resolve-pathname", + "escapedName": "resolve-pathname", + "rawSpec": "^2.2.0", + "saveSpec": null, + "fetchSpec": "^2.2.0" + }, + "_requiredBy": [ + "/history" + ], + "_resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-2.2.0.tgz", + "_shasum": "7e9ae21ed815fd63ab189adeee64dc831eefa879", + "_spec": "resolve-pathname@^2.2.0", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/history", + "author": { + "name": "Michael Jackson" + }, + "bugs": { + "url": "https://github.com/mjackson/resolve-pathname/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Resolve URL pathnames using JavaScript", + "devDependencies": { + "babel-cli": "^6.5.1", + "babel-core": "^6.5.2", + "babel-eslint": "^7.0.0", + "babel-loader": "^6.2.3", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-preset-es2015": "^6.5.0", + "babel-preset-stage-1": "^6.24.1", + "eslint": "^3.2.2", + "eslint-plugin-import": "^2.0.0", + "expect": "^1.14.0", + "gzip-size": "^3.0.0", + "in-publish": "^2.0.0", + "mocha": "^3.0.0", + "pretty-bytes": "^4.0.2", + "readline-sync": "^1.4.1", + "webpack": "^1.12.14" + }, + "files": [ + "cjs", + "index.js", + "umd" + ], + "homepage": "https://github.com/mjackson/resolve-pathname#readme", + "license": "MIT", + "main": "cjs/index.js", + "module": "index.js", + "name": "resolve-pathname", + "repository": { + "type": "git", + "url": "git+https://github.com/mjackson/resolve-pathname.git" + }, + "scripts": { + "build": "node ./tools/build.js", + "clean": "git clean -fdX .", + "lint": "eslint modules", + "prepublish": "node ./tools/build.js", + "release": "node ./tools/release.js", + "test": "mocha --compilers js:babel-core/register modules/**/*-test.js" + }, + "version": "2.2.0" +} diff --git a/node_modules/resolve-pathname/umd/resolve-pathname.js b/node_modules/resolve-pathname/umd/resolve-pathname.js new file mode 100644 index 00000000..e8d238f8 --- /dev/null +++ b/node_modules/resolve-pathname/umd/resolve-pathname.js @@ -0,0 +1,134 @@ +(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["resolvePathname"] = factory(); + else + root["resolvePathname"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = 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; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + + 'use strict'; + + exports.__esModule = true; + function isAbsolute(pathname) { + return pathname.charAt(0) === '/'; + } + + // 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(); + } + + // This implementation is based heavily on node's url.parse + function resolvePathname(to) { + var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + + var toParts = to && to.split('/') || []; + var fromParts = from && from.split('/') || []; + + var isToAbs = to && isAbsolute(to); + var isFromAbs = from && isAbsolute(from); + var mustEndAbs = isToAbs || isFromAbs; + + if (to && isAbsolute(to)) { + // to is absolute + fromParts = toParts; + } else if (toParts.length) { + // to is relative, drop the filename + fromParts.pop(); + fromParts = fromParts.concat(toParts); + } + + if (!fromParts.length) return '/'; + + var hasTrailingSlash = void 0; + if (fromParts.length) { + var last = fromParts[fromParts.length - 1]; + hasTrailingSlash = last === '.' || last === '..' || last === ''; + } else { + hasTrailingSlash = false; + } + + var up = 0; + for (var i = fromParts.length; i >= 0; i--) { + var part = fromParts[i]; + + if (part === '.') { + spliceOne(fromParts, i); + } else if (part === '..') { + spliceOne(fromParts, i); + up++; + } else if (up) { + spliceOne(fromParts, i); + up--; + } + } + + if (!mustEndAbs) for (; up--; up) { + fromParts.unshift('..'); + }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(''); + + var result = fromParts.join('/'); + + if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; + + return result; + } + + exports.default = resolvePathname; + +/***/ }) +/******/ ]) +}); +; \ No newline at end of file diff --git a/node_modules/resolve-pathname/umd/resolve-pathname.min.js b/node_modules/resolve-pathname/umd/resolve-pathname.min.js new file mode 100644 index 00000000..5b09a170 --- /dev/null +++ b/node_modules/resolve-pathname/umd/resolve-pathname.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.resolvePathname=t():e.resolvePathname=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){"use strict";function n(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,o=n+1,r=e.length;o1&&void 0!==arguments[1]?arguments[1]:"",r=e&&e.split("/")||[],f=t&&t.split("/")||[],i=e&&n(e),u=t&&n(t),s=i||u;if(e&&n(e)?f=r:r.length&&(f.pop(),f=f.concat(r)),!f.length)return"/";var a=void 0;if(f.length){var l=f[f.length-1];a="."===l||".."===l||""===l}else a=!1;for(var p=0,c=f.length;c>=0;c--){var d=f[c];"."===d?o(f,c):".."===d?(o(f,c),p++):p&&(o(f,c),p--)}if(!s)for(;p--;p)f.unshift("..");!s||""===f[0]||f[0]&&n(f[0])||f.unshift("");var h=f.join("/");return a&&"/"!==h.substr(-1)&&(h+="/"),h}t.__esModule=!0,t.default=r}])}); \ No newline at end of file diff --git a/node_modules/tiny-invariant/LICENSE b/node_modules/tiny-invariant/LICENSE new file mode 100644 index 00000000..f3dcb580 --- /dev/null +++ b/node_modules/tiny-invariant/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Alexander Reardon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION 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/tiny-invariant/README.md b/node_modules/tiny-invariant/README.md new file mode 100644 index 00000000..b8d9f8d3 --- /dev/null +++ b/node_modules/tiny-invariant/README.md @@ -0,0 +1,88 @@ +# `tiny-invariant` 🔬💥 + +[![Build Status](https://travis-ci.org/alexreardon/tiny-invariant.svg?branch=master)](https://travis-ci.org/alexreardon/tiny-invariant) +[![npm](https://img.shields.io/npm/v/tiny-invariant.svg)](https://www.npmjs.com/package/tiny-invariant) [![dependencies](https://david-dm.org/alexreardon/tiny-invariant.svg)](https://david-dm.org/alexreardon/tiny-invariant) +[![min](https://img.shields.io/bundlephobia/min/tiny-invariant.svg)](https://www.npmjs.com/package/tiny-invariant) +[![minzip](https://img.shields.io/bundlephobia/minzip/tiny-invariant.svg)](https://www.npmjs.com/package/tiny-invariant) + +A tiny [`invariant`](https://www.npmjs.com/package/invariant) alternative. + +## What is `invariant`? + +An `invariant` function tasks a value, and if the value is [falsy](https://github.com/getify/You-Dont-Know-JS/blob/bdbe570600d4e1107d0b131787903ca1c9ec8140/up%20%26%20going/ch2.md#truthy--falsy) then the `invariant` function will throw. If the value is [truthy](https://github.com/getify/You-Dont-Know-JS/blob/bdbe570600d4e1107d0b131787903ca1c9ec8140/up%20%26%20going/ch2.md#truthy--falsy), then the function will not throw. + +```js +import invariant from 'tiny-invariant'; + +invariant(truthyValue, 'This should not throw!'); + +invariant(falsyValue, 'This will throw!'); +// Error('Invariant violation: This will throw!'); +``` + +## Why `tiny-invariant`? + +The [`library: invariant`](https://www.npmjs.com/package/invariant) supports passing in arguments to the `invariant` function in a sprintf style `(condition, format, a, b, c, d, e, f)`. It has internal logic to execute the sprintf substitutions. The sprintf logic is not removed in production builds. `tiny-invariant` has dropped all of the sprintf logic. `tiny-invariant` allows you to pass a single string message. With [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) there is really no need for a custom message formatter to be built into the library. If you need a multi part message you can just do this: `invariant(condition, 'Hello, ${name} - how are you today?')` + +## API: `(condition: mixed, message?: string) => void` + +- `condition` is required and can be anything +- `message` is an optional string + +## Installation + +```bash +# yarn +yarn add tiny-invariant + +# bash +npm add tiny-invariant --save +``` + +## Dropping your `message` for kb savings! + +We recommend using [`babel-plugin-dev-expression`](https://www.npmjs.com/package/babel-plugin-dev-expression) to remove the `message` argument from your `invariant` calls in production builds to save kbs! + +What it does it turn your code that looks like this: + +```js +invariant(condition, 'My cool message that takes up a lot of kbs'); +``` + +Into this + +```js +if (!condition) { + if ('production' !== process.env.NODE_ENV) { + invariant(false, 'My cool message that takes up a lot of kbs'); + } else { + invariant(false); + } +} +``` + +Your bundler can then drop the code in the `"production" !== process.env.NODE_ENV` block for your production builds + +Final result: + +```js +if (!condition) { + invariant(false); +} +``` + +> For `rollup` use [rollup-plugin-replace](https://github.com/rollup/rollup-plugin-replace) and set `NODE_ENV` to `production` and then `rollup` will treeshake out the unused code +> +> [`Webpack` instructions](https://webpack.js.org/guides/production/#specify-the-mode) + +## Builds + +- We have a `es` (EcmaScript module) build (because you _know_ you want to deduplicate this super heavy library) +- We have a `cjs` (CommonJS) build +- We have a `umd` (Universal module definition) build in case you needed it + +We expect `process.env.NODE_ENV` to be available at module compilation. We cache this value + +## That's it! + +🤘 diff --git a/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js b/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js new file mode 100644 index 00000000..3956f815 --- /dev/null +++ b/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js @@ -0,0 +1,17 @@ +'use strict'; + +var isProduction = process.env.NODE_ENV === 'production'; +var prefix = 'Invariant failed'; +function invariant(condition, message) { + if (condition) { + return; + } + + if (isProduction) { + throw new Error(prefix); + } else { + throw new Error(prefix + ": " + (message || '')); + } +} + +module.exports = invariant; diff --git a/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js.flow b/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js.flow new file mode 100644 index 00000000..6a6528bb --- /dev/null +++ b/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js.flow @@ -0,0 +1,3 @@ +// @flow + +export * from '../src'; diff --git a/node_modules/tiny-invariant/dist/tiny-invariant.esm.js b/node_modules/tiny-invariant/dist/tiny-invariant.esm.js new file mode 100644 index 00000000..a4363a18 --- /dev/null +++ b/node_modules/tiny-invariant/dist/tiny-invariant.esm.js @@ -0,0 +1,15 @@ +var isProduction = process.env.NODE_ENV === 'production'; +var prefix = 'Invariant failed'; +function invariant(condition, message) { + if (condition) { + return; + } + + if (isProduction) { + throw new Error(prefix); + } else { + throw new Error(prefix + ": " + (message || '')); + } +} + +export default invariant; diff --git a/node_modules/tiny-invariant/dist/tiny-invariant.js b/node_modules/tiny-invariant/dist/tiny-invariant.js new file mode 100644 index 00000000..5a8792cd --- /dev/null +++ b/node_modules/tiny-invariant/dist/tiny-invariant.js @@ -0,0 +1,20 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = global || self, global.invariant = factory()); +}(this, function () { 'use strict'; + + var prefix = 'Invariant failed'; + function invariant(condition, message) { + if (condition) { + return; + } + + { + throw new Error(prefix + ": " + (message || '')); + } + } + + return invariant; + +})); diff --git a/node_modules/tiny-invariant/dist/tiny-invariant.min.js b/node_modules/tiny-invariant/dist/tiny-invariant.min.js new file mode 100644 index 00000000..f83c5e79 --- /dev/null +++ b/node_modules/tiny-invariant/dist/tiny-invariant.min.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).invariant=n()}(this,function(){"use strict";return function(e,n){if(!e)throw new Error("Invariant failed")}}); diff --git a/node_modules/tiny-invariant/package.json b/node_modules/tiny-invariant/package.json new file mode 100644 index 00000000..47279653 --- /dev/null +++ b/node_modules/tiny-invariant/package.json @@ -0,0 +1,84 @@ +{ + "_from": "tiny-invariant@^1.0.2", + "_id": "tiny-invariant@1.0.4", + "_inBundle": false, + "_integrity": "sha512-lMhRd/djQJ3MoaHEBrw8e2/uM4rs9YMNk0iOr8rHQ0QdbM7D4l0gFl3szKdeixrlyfm9Zqi4dxHCM2qVG8ND5g==", + "_location": "/tiny-invariant", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "tiny-invariant@^1.0.2", + "name": "tiny-invariant", + "escapedName": "tiny-invariant", + "rawSpec": "^1.0.2", + "saveSpec": null, + "fetchSpec": "^1.0.2" + }, + "_requiredBy": [ + "/history", + "/react-router", + "/react-router-dom" + ], + "_resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.0.4.tgz", + "_shasum": "346b5415fd93cb696b0c4e8a96697ff590f92463", + "_spec": "tiny-invariant@^1.0.2", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/react-router-dom", + "author": { + "name": "Alex Reardon", + "email": "alexreardon@gmail.com" + }, + "bugs": { + "url": "https://github.com/alexreardon/tiny-invariant/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A tiny invariant function", + "devDependencies": { + "@babel/core": "^7.4.0", + "@babel/preset-env": "^7.4.2", + "@babel/preset-flow": "^7.0.0", + "@babel/runtime-corejs2": "^7.4.2", + "babel-core": "7.0.0-bridge.0", + "babel-jest": "^24.5.0", + "flow-bin": "^0.95.1", + "jest": "^24.5.0", + "prettier": "^1.16.4", + "rimraf": "^2.6.3", + "rollup": "^1.7.3", + "rollup-plugin-babel": "^4.3.2", + "rollup-plugin-replace": "^2.1.1", + "rollup-plugin-uglify": "^6.0.2" + }, + "files": [ + "/dist", + "/src" + ], + "homepage": "https://github.com/alexreardon/tiny-invariant#readme", + "keywords": [ + "invariant", + "error" + ], + "license": "MIT", + "main": "dist/tiny-invariant.cjs.js", + "module": "dist/tiny-invariant.esm.js", + "name": "tiny-invariant", + "repository": { + "type": "git", + "url": "git+https://github.com/alexreardon/tiny-invariant.git" + }, + "scripts": { + "build": "yarn build:clean && yarn build:dist && yarn build:flow", + "build:clean": "rimraf dist", + "build:dist": "yarn rollup --config rollup.config.js", + "build:flow": "echo \"// @flow\n\nexport * from '../src';\" > dist/tiny-invariant.cjs.js.flow", + "lint": "yarn prettier --debug-check src/** test/**", + "prepublishOnly": "yarn build", + "test": "yarn jest", + "typecheck": "yarn flow", + "validate": "yarn lint && yarn flow" + }, + "sideEffects": false, + "types": "src/index.d.ts", + "version": "1.0.4" +} diff --git a/node_modules/tiny-invariant/src/index.d.ts b/node_modules/tiny-invariant/src/index.d.ts new file mode 100644 index 00000000..fa9ad108 --- /dev/null +++ b/node_modules/tiny-invariant/src/index.d.ts @@ -0,0 +1 @@ +export default function invariant(condition: boolean, message?: string): void diff --git a/node_modules/tiny-invariant/src/index.js b/node_modules/tiny-invariant/src/index.js new file mode 100644 index 00000000..80a57f45 --- /dev/null +++ b/node_modules/tiny-invariant/src/index.js @@ -0,0 +1,22 @@ +// @flow +const isProduction: boolean = process.env.NODE_ENV === 'production'; +const prefix: string = 'Invariant failed'; + +// Throw an error if the condition fails +// Strip out error messages for production +// > Not providing an inline default argument for message as the result is smaller +export default function invariant(condition: mixed, message?: string) { + if (condition) { + return; + } + // Condition not passed + + if (isProduction) { + // In production we strip the message but still throw + throw new Error(prefix); + } else { + // When not in production we allow the message to pass through + // *This block will be removed in production builds* + throw new Error(`${prefix}: ${message || ''}`); + } +} diff --git a/node_modules/tiny-warning/README.md b/node_modules/tiny-warning/README.md new file mode 100644 index 00000000..85989be4 --- /dev/null +++ b/node_modules/tiny-warning/README.md @@ -0,0 +1,68 @@ +# tiny-warning 🔬⚠️ + +[![Build Status](https://travis-ci.org/alexreardon/tiny-warning.svg?branch=master)](https://travis-ci.org/alexreardon/tiny-warning) +[![npm](https://img.shields.io/npm/v/tiny-warning.svg)](https://www.npmjs.com/package/tiny-warning) [![Downloads per month](https://img.shields.io/npm/dm/tiny-warning.svg)](https://www.npmjs.com/package/tiny-warning) [![dependencies](https://david-dm.org/alexreardon/tiny-warning.svg)](https://david-dm.org/alexreardon/tiny-warning) +[![min](https://img.shields.io/bundlephobia/min/tiny-warning.svg)](https://www.npmjs.com/package/tiny-warning) +[![minzip](https://img.shields.io/bundlephobia/minzip/tiny-warning.svg)](https://www.npmjs.com/package/tiny-warning) + +A tiny [`warning`](https://www.npmjs.com/package/warning) alternative. + +```js +import warning from 'tiny-warning'; + +warning(truthyValue, 'This should not log a warning'); + +warning(falsyValue, 'This should log a warning'); +// console.warn('This should log a warning'); +``` + +## API: `(condition: mixed, message: string) => void` + +- `condition` is required and can be anything +- `message` is an required string that will be passed onto `console.warn` + +## Why `tiny-warning`? + +The [`library: warning`](https://www.npmjs.com/package/warning) supports passing in arguments to the `warning` function in a sprintf style `(condition, format, a, b, c, d, e, f)`. It has internal logic to execute the sprintf substitutions. `tiny-warning` has dropped all of the sprintf logic. `tiny-warning` allows you to pass a single string message. With [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) there is really no need for a custom message formatter to be built into the library. If you need a multi part message you can just do this: `warning(condition, 'Hello, ${name} - how are you today?')` + +## Dropping your `warning` for kb savings! + +We recommend using [`babel-plugin-dev-expression`](https://www.npmjs.com/package/babel-plugin-dev-expression) to remove `warning` calls from your production build. This saves you kb's as well as avoids logging warnings to the console for production. + +What it does it turn your code that looks like this: + +```js +warning(condition, 'My cool message that takes up a lot of kbs'); +``` + +Into this + +```js +if ('production' !== process.env.NODE_ENV) { + warning(condition, 'My cool message that takes up a lot of kbs'); +} +``` + +Your bundler can then drop the code in the `"production" !== process.env.NODE_ENV` block for your production builds + +Final result: + +```js +// nothing to see here! 👍 +``` + +> For `rollup` use [rollup-plugin-replace](https://github.com/rollup/rollup-plugin-replace) and set `NODE_ENV` to `production` and then `rollup` will treeshake out the unused code +> +> [`Webpack` instructions](https://webpack.js.org/guides/production/#specify-the-mode) + +## Builds + +- We have a `es` (EcmaScript module) build (because you _know_ you want to deduplicate this super heavy library) +- We have a `cjs` (CommonJS) build +- We have a `umd` (Universal module definition) build in case you needed it + +We expect `process.env.NODE_ENV` to be available at module compilation. We cache this value + +## That's it! + +🤘 diff --git a/node_modules/tiny-warning/dist/tiny-warning.cjs.js b/node_modules/tiny-warning/dist/tiny-warning.cjs.js new file mode 100644 index 00000000..221fdf5e --- /dev/null +++ b/node_modules/tiny-warning/dist/tiny-warning.cjs.js @@ -0,0 +1,22 @@ +'use strict'; + +var isProduction = process.env.NODE_ENV === 'production'; +function warning(condition, message) { + if (!isProduction) { + if (condition) { + return; + } + + var text = "Warning: " + message; + + if (typeof console !== 'undefined') { + console.warn(text); + } + + try { + throw Error(text); + } catch (x) {} + } +} + +module.exports = warning; diff --git a/node_modules/tiny-warning/dist/tiny-warning.cjs.js.flow b/node_modules/tiny-warning/dist/tiny-warning.cjs.js.flow new file mode 100644 index 00000000..6a6528bb --- /dev/null +++ b/node_modules/tiny-warning/dist/tiny-warning.cjs.js.flow @@ -0,0 +1,3 @@ +// @flow + +export * from '../src'; diff --git a/node_modules/tiny-warning/dist/tiny-warning.esm.js b/node_modules/tiny-warning/dist/tiny-warning.esm.js new file mode 100644 index 00000000..2bf1f8c4 --- /dev/null +++ b/node_modules/tiny-warning/dist/tiny-warning.esm.js @@ -0,0 +1,20 @@ +var isProduction = process.env.NODE_ENV === 'production'; +function warning(condition, message) { + if (!isProduction) { + if (condition) { + return; + } + + var text = "Warning: " + message; + + if (typeof console !== 'undefined') { + console.warn(text); + } + + try { + throw Error(text); + } catch (x) {} + } +} + +export default warning; diff --git a/node_modules/tiny-warning/dist/tiny-warning.js b/node_modules/tiny-warning/dist/tiny-warning.js new file mode 100644 index 00000000..b8865688 --- /dev/null +++ b/node_modules/tiny-warning/dist/tiny-warning.js @@ -0,0 +1,27 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + global.warning = factory(); +}(typeof self !== 'undefined' ? self : this, function () { 'use strict'; + + function warning(condition, message) { + { + if (condition) { + return; + } + + var text = "Warning: " + message; + + if (typeof console !== 'undefined') { + console.warn(text); + } + + try { + throw Error(text); + } catch (x) {} + } + } + + return warning; + +})); diff --git a/node_modules/tiny-warning/dist/tiny-warning.min.js b/node_modules/tiny-warning/dist/tiny-warning.min.js new file mode 100644 index 00000000..ae883611 --- /dev/null +++ b/node_modules/tiny-warning/dist/tiny-warning.min.js @@ -0,0 +1 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.warning=n()}("undefined"!=typeof self?self:this,function(){"use strict";return function(e,n){}}); diff --git a/node_modules/tiny-warning/package.json b/node_modules/tiny-warning/package.json new file mode 100644 index 00000000..499cbffd --- /dev/null +++ b/node_modules/tiny-warning/package.json @@ -0,0 +1,83 @@ +{ + "_from": "tiny-warning@^1.0.0", + "_id": "tiny-warning@1.0.2", + "_inBundle": false, + "_integrity": "sha512-rru86D9CpQRLvsFG5XFdy0KdLAvjdQDyZCsRcuu60WtzFylDM3eAWSxEVz5kzL2Gp544XiUvPbVKtOA/txLi9Q==", + "_location": "/tiny-warning", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "tiny-warning@^1.0.0", + "name": "tiny-warning", + "escapedName": "tiny-warning", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/history", + "/mini-create-react-context", + "/react-router", + "/react-router-dom" + ], + "_resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.2.tgz", + "_shasum": "1dfae771ee1a04396bdfde27a3adcebc6b648b28", + "_spec": "tiny-warning@^1.0.0", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/react-router-dom", + "author": { + "name": "Alex Reardon", + "email": "alexreardon@gmail.com" + }, + "bugs": { + "url": "https://github.com/alexreardon/tiny-warning/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "A tiny warning function", + "devDependencies": { + "@babel/core": "^7.2.2", + "@babel/preset-env": "^7.2.0", + "@babel/preset-flow": "^7.0.0", + "babel-core": "7.0.0-bridge.0", + "babel-jest": "^23.6.0", + "flow-bin": "0.89.0", + "jest": "^23.6.0", + "prettier": "1.15.3", + "rimraf": "^2.6.2", + "rollup": "^0.68.0", + "rollup-plugin-babel": "^4.1.0", + "rollup-plugin-replace": "^2.1.0", + "rollup-plugin-uglify": "^6.0.0" + }, + "files": [ + "/dist", + "/src" + ], + "homepage": "https://github.com/alexreardon/tiny-warning#readme", + "keywords": [ + "warning", + "warn" + ], + "license": "MIT", + "main": "dist/tiny-warning.cjs.js", + "module": "dist/tiny-warning.esm.js", + "name": "tiny-warning", + "repository": { + "type": "git", + "url": "git+https://github.com/alexreardon/tiny-warning.git" + }, + "scripts": { + "build": "yarn build:clean && yarn build:dist && yarn build:flow", + "build:clean": "rimraf dist", + "build:dist": "yarn rollup --config rollup.config.js", + "build:flow": "echo \"// @flow\n\nexport * from '../src';\" > dist/tiny-warning.cjs.js.flow", + "lint": "yarn prettier --debug-check src/** test/**", + "prepublishOnly": "yarn build", + "test": "yarn jest", + "typecheck": "yarn flow", + "validate": "yarn lint && yarn flow" + }, + "sideEffects": false, + "version": "1.0.2" +} diff --git a/node_modules/tiny-warning/src/index.js b/node_modules/tiny-warning/src/index.js new file mode 100644 index 00000000..8880e4a8 --- /dev/null +++ b/node_modules/tiny-warning/src/index.js @@ -0,0 +1,30 @@ +// @flow +const isProduction: boolean = process.env.NODE_ENV === 'production'; + +export default function warning(condition: mixed, message: string) { + // don't do anything in production + // wrapping in production check for better dead code elimination + if (!isProduction) { + // condition passed: do not log + if (condition) { + return; + } + + // Condition not passed + const text: string = `Warning: ${message}`; + + // check console for IE9 support which provides console + // only with open devtools + if (typeof console !== 'undefined') { + console.warn(text); + } + + // Throwing an error and catching it immediately + // to improve debugging + // A consumer can use 'pause on caught exceptions' + // https://github.com/facebook/react/issues/4216 + try { + throw Error(text); + } catch (x) {} + } +} diff --git a/node_modules/value-equal/README.md b/node_modules/value-equal/README.md new file mode 100644 index 00000000..473a81ce --- /dev/null +++ b/node_modules/value-equal/README.md @@ -0,0 +1,55 @@ +# value-equal [![Travis][build-badge]][build] [![npm package][npm-badge]][npm] + +[build-badge]: https://img.shields.io/travis/mjackson/value-equal/master.svg?style=flat-square +[build]: https://travis-ci.org/mjackson/value-equal + +[npm-badge]: https://img.shields.io/npm/v/value-equal.svg?style=flat-square +[npm]: https://www.npmjs.org/package/value-equal + +[`value-equal`](https://www.npmjs.com/package/value-equal) determines if two JavaScript values are equal using [`Object.prototype.valueOf`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf). + +In many instances when I'm checking for object equality, what I really want to know is if their **values** are equal. This is good for: + +- Stuff you keep in `localStorage` +- `window.history.state` values +- Query strings + +## Installation + +Using [npm](https://www.npmjs.com/): + + $ npm install --save value-equal + +Then with a module bundler like [webpack](https://webpack.github.io/), use as you would anything else: + +```js +// using ES6 modules +import valueEqual from 'value-equal' + +// using CommonJS modules +var valueEqual = require('value-equal') +``` + +The UMD build is also available on [unpkg](https://unpkg.com): + +```html + +``` + +You can find the library on `window.valueEqual`. + +## Usage + +```js +valueEqual(1, 1) // true +valueEqual('asdf', 'asdf') // true +valueEqual('asdf', new String('asdf')) // true +valueEqual(true, true) // true +valueEqual(true, false) // false +valueEqual({ a: 'a' }, { a: 'a' }) // true +valueEqual({ a: 'a' }, { a: 'b' }) // false +valueEqual([ 1, 2, 3 ], [ 1, 2, 3 ]) // true +valueEqual([ 1, 2, 3 ], [ 2, 3, 4 ]) // false +``` + +That's it. Enjoy! diff --git a/node_modules/value-equal/cjs/index.js b/node_modules/value-equal/cjs/index.js new file mode 100644 index 00000000..3562c44c --- /dev/null +++ b/node_modules/value-equal/cjs/index.js @@ -0,0 +1,43 @@ +'use strict'; + +exports.__esModule = true; + +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 valueEqual(a, b) { + if (a === b) return true; + + if (a == null || b == null) return false; + + if (Array.isArray(a)) { + return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return valueEqual(item, b[index]); + }); + } + + var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); + var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); + + if (aType !== bType) return false; + + if (aType === 'object') { + var aValue = a.valueOf(); + var bValue = b.valueOf(); + + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); + + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + + if (aKeys.length !== bKeys.length) return false; + + return aKeys.every(function (key) { + return valueEqual(a[key], b[key]); + }); + } + + return false; +} + +exports.default = valueEqual; +module.exports = exports['default']; \ No newline at end of file diff --git a/node_modules/value-equal/index.js b/node_modules/value-equal/index.js new file mode 100644 index 00000000..aa9ae333 --- /dev/null +++ b/node_modules/value-equal/index.js @@ -0,0 +1,38 @@ +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 valueEqual(a, b) { + if (a === b) return true; + + if (a == null || b == null) return false; + + if (Array.isArray(a)) { + return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return valueEqual(item, b[index]); + }); + } + + var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); + var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); + + if (aType !== bType) return false; + + if (aType === 'object') { + var aValue = a.valueOf(); + var bValue = b.valueOf(); + + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); + + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + + if (aKeys.length !== bKeys.length) return false; + + return aKeys.every(function (key) { + return valueEqual(a[key], b[key]); + }); + } + + return false; +} + +export default valueEqual; \ No newline at end of file diff --git a/node_modules/value-equal/package.json b/node_modules/value-equal/package.json new file mode 100644 index 00000000..e87ffe6b --- /dev/null +++ b/node_modules/value-equal/package.json @@ -0,0 +1,70 @@ +{ + "_from": "value-equal@^0.4.0", + "_id": "value-equal@0.4.0", + "_inBundle": false, + "_integrity": "sha512-x+cYdNnaA3CxvMaTX0INdTCN8m8aF2uY9BvEqmxuYp8bL09cs/kWVQPVGcA35fMktdOsP69IgU7wFj/61dJHEw==", + "_location": "/value-equal", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "value-equal@^0.4.0", + "name": "value-equal", + "escapedName": "value-equal", + "rawSpec": "^0.4.0", + "saveSpec": null, + "fetchSpec": "^0.4.0" + }, + "_requiredBy": [ + "/history" + ], + "_resolved": "https://registry.npmjs.org/value-equal/-/value-equal-0.4.0.tgz", + "_shasum": "c5bdd2f54ee093c04839d71ce2e4758a6890abc7", + "_spec": "value-equal@^0.4.0", + "_where": "/Users/kfasbender/Documents/ada/full_stack/VideoStoreConsumer-API/node_modules/history", + "author": { + "name": "Michael Jackson" + }, + "bugs": { + "url": "https://github.com/mjackson/value-equal/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Are these two JavaScript values equal?", + "devDependencies": { + "babel-cli": "^6.18.0", + "babel-core": "^6.18.0", + "babel-loader": "^6.2.5", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-preset-es2015": "^6.16.0", + "expect": "^1.20.2", + "gzip-size": "^3.0.0", + "in-publish": "^2.0.0", + "mocha": "^3.1.2", + "pretty-bytes": "^4.0.2", + "readline-sync": "^1.4.4", + "webpack": "^1.13.3" + }, + "files": [ + "cjs", + "index.js", + "umd" + ], + "homepage": "https://github.com/mjackson/value-equal#readme", + "license": "MIT", + "main": "cjs/index.js", + "module": "index.js", + "name": "value-equal", + "repository": { + "type": "git", + "url": "git+https://github.com/mjackson/value-equal.git" + }, + "scripts": { + "build": "node ./tools/build.js", + "clean": "git clean -fdX .", + "prepublish": "node ./tools/build.js", + "release": "node ./tools/release.js", + "test": "mocha --compilers js:babel-core/register modules/**/*-test.js" + }, + "version": "0.4.0" +} diff --git a/node_modules/value-equal/umd/resolve-pathname.js b/node_modules/value-equal/umd/resolve-pathname.js new file mode 100644 index 00000000..3d0802ae --- /dev/null +++ b/node_modules/value-equal/umd/resolve-pathname.js @@ -0,0 +1,101 @@ +(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["valueEqual"] = factory(); + else + root["valueEqual"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = 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; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + + 'use strict'; + + exports.__esModule = true; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var valueEqual = function valueEqual(a, b) { + if (a === b) return true; + + if (a == null || b == null) return false; + + if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return valueEqual(item, b[index]); + }); + + var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); + var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); + + if (aType !== bType) return false; + + if (aType === 'object') { + var aValue = a.valueOf(); + var bValue = b.valueOf(); + + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); + + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + + if (aKeys.length !== bKeys.length) return false; + + return aKeys.every(function (key) { + return valueEqual(a[key], b[key]); + }); + } + + return false; + }; + + exports.default = valueEqual; + +/***/ }) +/******/ ]) +}); +; \ No newline at end of file diff --git a/node_modules/value-equal/umd/resolve-pathname.min.js b/node_modules/value-equal/umd/resolve-pathname.min.js new file mode 100644 index 00000000..fb145d9f --- /dev/null +++ b/node_modules/value-equal/umd/resolve-pathname.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.valueEqual=t():e.valueEqual=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t){"use strict";t.__esModule=!0;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},n=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});var o="undefined"==typeof t?"undefined":r(t),u="undefined"==typeof n?"undefined":r(n);if(o!==u)return!1;if("object"===o){var f=t.valueOf(),i=n.valueOf();if(f!==t||i!==n)return e(f,i);var l=Object.keys(t),y=Object.keys(n);return l.length===y.length&&l.every(function(r){return e(t[r],n[r])})}return!1};t.default=n}])}); \ No newline at end of file diff --git a/node_modules/value-equal/umd/value-equal.js b/node_modules/value-equal/umd/value-equal.js new file mode 100644 index 00000000..253c3209 --- /dev/null +++ b/node_modules/value-equal/umd/value-equal.js @@ -0,0 +1,103 @@ +(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["valueEqual"] = factory(); + else + root["valueEqual"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = 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; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + + 'use strict'; + + exports.__esModule = true; + + 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 valueEqual(a, b) { + if (a === b) return true; + + if (a == null || b == null) return false; + + if (Array.isArray(a)) { + return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { + return valueEqual(item, b[index]); + }); + } + + var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); + var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); + + if (aType !== bType) return false; + + if (aType === 'object') { + var aValue = a.valueOf(); + var bValue = b.valueOf(); + + if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); + + var aKeys = Object.keys(a); + var bKeys = Object.keys(b); + + if (aKeys.length !== bKeys.length) return false; + + return aKeys.every(function (key) { + return valueEqual(a[key], b[key]); + }); + } + + return false; + } + + exports.default = valueEqual; + +/***/ }) +/******/ ]) +}); +; \ No newline at end of file diff --git a/node_modules/value-equal/umd/value-equal.min.js b/node_modules/value-equal/umd/value-equal.min.js new file mode 100644 index 00000000..2b56171a --- /dev/null +++ b/node_modules/value-equal/umd/value-equal.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.valueEqual=t():e.valueEqual=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t){"use strict";function r(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return r(e,t[n])});var o="undefined"==typeof e?"undefined":n(e),u="undefined"==typeof t?"undefined":n(t);if(o!==u)return!1;if("object"===o){var f=e.valueOf(),i=t.valueOf();if(f!==e||i!==t)return r(f,i);var l=Object.keys(e),y=Object.keys(t);return l.length===y.length&&l.every(function(n){return r(e[n],t[n])})}return!1}t.__esModule=!0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=r}])}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..84409c15 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,154 @@ +{ + "name": "video-store-api", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/runtime": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz", + "integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==", + "requires": { + "regenerator-runtime": "^0.13.2" + } + }, + "gud": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz", + "integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==" + }, + "history": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/history/-/history-4.9.0.tgz", + "integrity": "sha512-H2DkjCjXf0Op9OAr6nJ56fcRkTSNrUiv41vNJ6IswJjif6wlpZK0BTfFbi7qK9dXLSYZxkq5lBsj3vUjlYBYZA==", + "requires": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^2.2.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^0.4.0" + } + }, + "hoist-non-react-statics": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz", + "integrity": "sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==", + "requires": { + "react-is": "^16.7.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "mini-create-react-context": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.3.2.tgz", + "integrity": "sha512-2v+OeetEyliMt5VHMXsBhABoJ0/M4RCe7fatd/fBy6SMiKazUSEt3gxxypfnk2SHMkdBYvorHRoQxuGoiwbzAw==", + "requires": { + "@babel/runtime": "^7.4.0", + "gud": "^1.0.0", + "tiny-warning": "^1.0.2" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "requires": { + "isarray": "0.0.1" + } + }, + "prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } + }, + "react-is": { + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", + "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==" + }, + "react-router": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.0.1.tgz", + "integrity": "sha512-EM7suCPNKb1NxcTZ2LEOWFtQBQRQXecLxVpdsP4DW4PbbqYWeRiLyV/Tt1SdCrvT2jcyXAXmVTmzvSzrPR63Bg==", + "requires": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "hoist-non-react-statics": "^3.1.0", + "loose-envify": "^1.3.1", + "mini-create-react-context": "^0.3.0", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.2", + "react-is": "^16.6.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + } + }, + "react-router-dom": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.0.1.tgz", + "integrity": "sha512-zaVHSy7NN0G91/Bz9GD4owex5+eop+KvgbxXsP/O+iW1/Ln+BrJ8QiIR5a6xNPtrdTvLkxqlDClx13QO1uB8CA==", + "requires": { + "@babel/runtime": "^7.1.2", + "history": "^4.9.0", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.2", + "react-router": "5.0.1", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0" + } + }, + "regenerator-runtime": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" + }, + "resolve-pathname": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-2.2.0.tgz", + "integrity": "sha512-bAFz9ld18RzJfddgrO2e/0S2O81710++chRMUxHjXOYKF6jTAMrUNZrEZ1PvV0zlhfjidm08iRPdTLPno1FuRg==" + }, + "tiny-invariant": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.0.4.tgz", + "integrity": "sha512-lMhRd/djQJ3MoaHEBrw8e2/uM4rs9YMNk0iOr8rHQ0QdbM7D4l0gFl3szKdeixrlyfm9Zqi4dxHCM2qVG8ND5g==" + }, + "tiny-warning": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.2.tgz", + "integrity": "sha512-rru86D9CpQRLvsFG5XFdy0KdLAvjdQDyZCsRcuu60WtzFylDM3eAWSxEVz5kzL2Gp544XiUvPbVKtOA/txLi9Q==" + }, + "value-equal": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-0.4.0.tgz", + "integrity": "sha512-x+cYdNnaA3CxvMaTX0INdTCN8m8aF2uY9BvEqmxuYp8bL09cs/kWVQPVGcA35fMktdOsP69IgU7wFj/61dJHEw==" + } + } +} diff --git a/package.json b/package.json index e5f1f022..fd0f0054 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "express": "~4.13.1", "jade": "~1.11.0", "morgan": "~1.9.1", + "react-router-dom": "^5.0.1", "sequelize": "^5.1.0", "serve-favicon": "~2.3.0" }, diff --git a/test/controllers/movies_controller_test.rb b/test/controllers/movies_controller_test.rb index 9172cf6e..145839f4 100644 --- a/test/controllers/movies_controller_test.rb +++ b/test/controllers/movies_controller_test.rb @@ -1,11 +1,11 @@ -require 'test_helper' +require "test_helper" class MoviesControllerTest < ActionDispatch::IntegrationTest describe "index" do it "returns a JSON array" do get movies_url assert_response :success - @response.headers['Content-Type'].must_include 'json' + @response.headers["Content-Type"].must_include "json" # Attempt to parse data = JSON.parse @response.body @@ -46,7 +46,7 @@ class MoviesControllerTest < ActionDispatch::IntegrationTest it "Returns a JSON object" do get movie_url(title: movies(:one).title) assert_response :success - @response.headers['Content-Type'].must_include 'json' + @response.headers["Content-Type"].must_include "json" # Attempt to parse data = JSON.parse @response.body @@ -72,7 +72,52 @@ class MoviesControllerTest < ActionDispatch::IntegrationTest data = JSON.parse @response.body data.must_include "errors" data["errors"].must_include "title" + end + end + + describe "create" do + let(:movie_params) { + { + title: "Thing", + overview: "Test", + release_date: "2019-01-01", + image_url: "www.dogs.jpg", + external_id: 3533, + } + } + + it "should create a new movie given valid data" do + expect { + post movies_path(movie_params) + }.must_change "Movie.count", 1 + + body = JSON.parse(response.body) + + expect(body).must_be_kind_of Hash + expect(body).must_include "id" + movie = Movie.find(body["id"].to_i) + + expect(movie.title).must_equal movie_params[:title] + must_respond_with :success end + + # # update validations if you want to use this test + + # it "returns an error for invalid movie data" do + # movie_params[:title] = nil + + # expect { + # post movies_path(movie_params) + # }.wont_change "Movie.count" + + # body = JSON.parse(response.body) + + # expect(body).must_be_kind_of Hash + # expect(body).must_include "errors" + # expect(body["errors"]).must_include "title" + # expect(body["errors"]["title"]).must_equal ["can't be blank"] + # must_respond_with :bad_request + # end end end