mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-11 17:16:59 -05:00
7498 lines
290 KiB
JavaScript
7498 lines
290 KiB
JavaScript
<<<<<<< HEAD
|
|
/******/ (function(modules) { // webpackBootstrap
|
|
/******/ // The module cache
|
|
/******/ var installedModules = {};
|
|
/******/
|
|
/******/ // The require function
|
|
/******/ function __webpack_require__(moduleId) {
|
|
/******/
|
|
/******/ // Check if module is in cache
|
|
/******/ if(installedModules[moduleId]) {
|
|
/******/ return installedModules[moduleId].exports;
|
|
/******/ }
|
|
/******/ // Create a new module (and put it into the cache)
|
|
/******/ var module = installedModules[moduleId] = {
|
|
/******/ i: moduleId,
|
|
/******/ l: false,
|
|
/******/ exports: {}
|
|
/******/ };
|
|
/******/
|
|
/******/ // Execute the module function
|
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
/******/
|
|
/******/ // Flag the module as loaded
|
|
/******/ module.l = true;
|
|
/******/
|
|
/******/ // Return the exports of the module
|
|
/******/ return module.exports;
|
|
/******/ }
|
|
/******/
|
|
/******/
|
|
/******/ // expose the modules object (__webpack_modules__)
|
|
/******/ __webpack_require__.m = modules;
|
|
/******/
|
|
/******/ // expose the module cache
|
|
/******/ __webpack_require__.c = installedModules;
|
|
/******/
|
|
/******/ // define getter function for harmony exports
|
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
/******/ }
|
|
/******/ };
|
|
/******/
|
|
/******/ // define __esModule on exports
|
|
/******/ __webpack_require__.r = function(exports) {
|
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
/******/ }
|
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
/******/ };
|
|
/******/
|
|
/******/ // create a fake namespace object
|
|
/******/ // mode & 1: value is a module id, require it
|
|
/******/ // mode & 2: merge all properties of value into the ns
|
|
/******/ // mode & 4: return value when already ns object
|
|
/******/ // mode & 8|1: behave like require
|
|
/******/ __webpack_require__.t = function(value, mode) {
|
|
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
/******/ if(mode & 8) return value;
|
|
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
/******/ var ns = Object.create(null);
|
|
/******/ __webpack_require__.r(ns);
|
|
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
/******/ return ns;
|
|
/******/ };
|
|
/******/
|
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
/******/ __webpack_require__.n = function(module) {
|
|
/******/ var getter = module && module.__esModule ?
|
|
/******/ function getDefault() { return module['default']; } :
|
|
/******/ function getModuleExports() { return module; };
|
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
/******/ return getter;
|
|
/******/ };
|
|
/******/
|
|
/******/ // Object.prototype.hasOwnProperty.call
|
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
/******/
|
|
/******/ // __webpack_public_path__
|
|
/******/ __webpack_require__.p = "";
|
|
/******/
|
|
/******/
|
|
/******/ // Load entry module and return exports
|
|
/******/ return __webpack_require__(__webpack_require__.s = "249e");
|
|
/******/ })
|
|
/************************************************************************/
|
|
/******/ ({
|
|
|
|
/***/ "00ee":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var wellKnownSymbol = __webpack_require__("b622");
|
|
|
|
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
var test = {};
|
|
|
|
test[TO_STRING_TAG] = 'z';
|
|
|
|
module.exports = String(test) === '[object z]';
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "06cf":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var DESCRIPTORS = __webpack_require__("83ab");
|
|
var propertyIsEnumerableModule = __webpack_require__("d1e7");
|
|
var createPropertyDescriptor = __webpack_require__("5c6c");
|
|
var toIndexedObject = __webpack_require__("fc6a");
|
|
var toPrimitive = __webpack_require__("c04e");
|
|
var has = __webpack_require__("5135");
|
|
var IE8_DOM_DEFINE = __webpack_require__("0cfb");
|
|
|
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
|
|
// `Object.getOwnPropertyDescriptor` method
|
|
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
|
exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
|
O = toIndexedObject(O);
|
|
P = toPrimitive(P, true);
|
|
if (IE8_DOM_DEFINE) try {
|
|
return $getOwnPropertyDescriptor(O, P);
|
|
} catch (error) { /* empty */ }
|
|
if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "0719":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// @ts-ignore
|
|
try {
|
|
self['workbox:core:6.1.5'] && _();
|
|
}
|
|
catch (e) { }
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "0cfb":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var DESCRIPTORS = __webpack_require__("83ab");
|
|
var fails = __webpack_require__("d039");
|
|
var createElement = __webpack_require__("cc12");
|
|
|
|
// Thank's IE8 for his funny defineProperty
|
|
module.exports = !DESCRIPTORS && !fails(function () {
|
|
// eslint-disable-next-line es/no-object-defineproperty -- requied for testing
|
|
return Object.defineProperty(createElement('div'), 'a', {
|
|
get: function () { return 7; }
|
|
}).a != 7;
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "14c3":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var classof = __webpack_require__("c6b6");
|
|
var regexpExec = __webpack_require__("9263");
|
|
|
|
// `RegExpExec` abstract operation
|
|
// https://tc39.es/ecma262/#sec-regexpexec
|
|
module.exports = function (R, S) {
|
|
var exec = R.exec;
|
|
if (typeof exec === 'function') {
|
|
var result = exec.call(R, S);
|
|
if (typeof result !== 'object') {
|
|
throw TypeError('RegExp exec method returned something other than an Object or null');
|
|
}
|
|
return result;
|
|
}
|
|
|
|
if (classof(R) !== 'RegExp') {
|
|
throw TypeError('RegExp#exec called on incompatible receiver');
|
|
}
|
|
|
|
return regexpExec.call(R, S);
|
|
};
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "1d80":
|
|
/***/ (function(module, exports) {
|
|
|
|
// `RequireObjectCoercible` abstract operation
|
|
// https://tc39.es/ecma262/#sec-requireobjectcoercible
|
|
module.exports = function (it) {
|
|
if (it == undefined) throw TypeError("Can't call method on " + it);
|
|
return it;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "23cb":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var toInteger = __webpack_require__("a691");
|
|
|
|
var max = Math.max;
|
|
var min = Math.min;
|
|
|
|
// Helper for a popular repeating case of the spec:
|
|
// Let integer be ? ToInteger(index).
|
|
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
|
|
module.exports = function (index, length) {
|
|
var integer = toInteger(index);
|
|
return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "23e7":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var global = __webpack_require__("da84");
|
|
var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
|
|
var createNonEnumerableProperty = __webpack_require__("9112");
|
|
var redefine = __webpack_require__("6eeb");
|
|
var setGlobal = __webpack_require__("ce4e");
|
|
var copyConstructorProperties = __webpack_require__("e893");
|
|
var isForced = __webpack_require__("94ca");
|
|
|
|
/*
|
|
options.target - name of the target object
|
|
options.global - target is the global object
|
|
options.stat - export as static methods of target
|
|
options.proto - export as prototype methods of target
|
|
options.real - real prototype method for the `pure` version
|
|
options.forced - export even if the native feature is available
|
|
options.bind - bind methods to the target, required for the `pure` version
|
|
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
|
|
options.unsafe - use the simple assignment of property instead of delete + defineProperty
|
|
options.sham - add a flag to not completely full polyfills
|
|
options.enumerable - export as enumerable property
|
|
options.noTargetGet - prevent calling a getter on target
|
|
*/
|
|
module.exports = function (options, source) {
|
|
var TARGET = options.target;
|
|
var GLOBAL = options.global;
|
|
var STATIC = options.stat;
|
|
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
if (GLOBAL) {
|
|
target = global;
|
|
} else if (STATIC) {
|
|
target = global[TARGET] || setGlobal(TARGET, {});
|
|
} else {
|
|
target = (global[TARGET] || {}).prototype;
|
|
}
|
|
if (target) for (key in source) {
|
|
sourceProperty = source[key];
|
|
if (options.noTargetGet) {
|
|
descriptor = getOwnPropertyDescriptor(target, key);
|
|
targetProperty = descriptor && descriptor.value;
|
|
} else targetProperty = target[key];
|
|
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
|
// contained in target
|
|
if (!FORCED && targetProperty !== undefined) {
|
|
if (typeof sourceProperty === typeof targetProperty) continue;
|
|
copyConstructorProperties(sourceProperty, targetProperty);
|
|
}
|
|
// add a flag to not completely full polyfills
|
|
if (options.sham || (targetProperty && targetProperty.sham)) {
|
|
createNonEnumerableProperty(sourceProperty, 'sham', true);
|
|
}
|
|
// extend global
|
|
redefine(target, key, sourceProperty, options);
|
|
}
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "241c":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var internalObjectKeys = __webpack_require__("ca84");
|
|
var enumBugKeys = __webpack_require__("7839");
|
|
|
|
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
|
|
|
// `Object.getOwnPropertyNames` method
|
|
// https://tc39.es/ecma262/#sec-object.getownpropertynames
|
|
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
|
|
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
|
return internalObjectKeys(O, hiddenKeys);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "249e":
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
// ESM COMPAT FLAG
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
|
|
var es_object_to_string = __webpack_require__("d3b7");
|
|
|
|
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
|
|
|
|
|
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);
|
|
});
|
|
};
|
|
}
|
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
|
|
var es_regexp_exec = __webpack_require__("ac1f");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.match.js
|
|
var es_string_match = __webpack_require__("466d");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.constructor.js
|
|
var es_regexp_constructor = __webpack_require__("4d63");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.regexp.to-string.js
|
|
var es_regexp_to_string = __webpack_require__("25f0");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/regenerator-runtime/runtime.js
|
|
var runtime = __webpack_require__("96cf");
|
|
|
|
// EXTERNAL MODULE: ./node_modules/workbox-core/_version.js
|
|
var _version = __webpack_require__("0719");
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/models/messages/messages.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
const messages = {
|
|
'invalid-value': ({ paramName, validValueDescription, value }) => {
|
|
if (!paramName || !validValueDescription) {
|
|
throw new Error(`Unexpected input to 'invalid-value' error.`);
|
|
}
|
|
return `The '${paramName}' parameter was given a value with an ` +
|
|
`unexpected value. ${validValueDescription} Received a value of ` +
|
|
`${JSON.stringify(value)}.`;
|
|
},
|
|
'not-an-array': ({ moduleName, className, funcName, paramName }) => {
|
|
if (!moduleName || !className || !funcName || !paramName) {
|
|
throw new Error(`Unexpected input to 'not-an-array' error.`);
|
|
}
|
|
return `The parameter '${paramName}' passed into ` +
|
|
`'${moduleName}.${className}.${funcName}()' must be an array.`;
|
|
},
|
|
'incorrect-type': ({ expectedType, paramName, moduleName, className, funcName }) => {
|
|
if (!expectedType || !paramName || !moduleName || !funcName) {
|
|
throw new Error(`Unexpected input to 'incorrect-type' error.`);
|
|
}
|
|
return `The parameter '${paramName}' passed into ` +
|
|
`'${moduleName}.${className ? (className + '.') : ''}` +
|
|
`${funcName}()' must be of type ${expectedType}.`;
|
|
},
|
|
'incorrect-class': ({ expectedClass, paramName, moduleName, className, funcName, isReturnValueProblem }) => {
|
|
if (!expectedClass || !moduleName || !funcName) {
|
|
throw new Error(`Unexpected input to 'incorrect-class' error.`);
|
|
}
|
|
if (isReturnValueProblem) {
|
|
return `The return value from ` +
|
|
`'${moduleName}.${className ? (className + '.') : ''}${funcName}()' ` +
|
|
`must be an instance of class ${expectedClass.name}.`;
|
|
}
|
|
return `The parameter '${paramName}' passed into ` +
|
|
`'${moduleName}.${className ? (className + '.') : ''}${funcName}()' ` +
|
|
`must be an instance of class ${expectedClass.name}.`;
|
|
},
|
|
'missing-a-method': ({ expectedMethod, paramName, moduleName, className, funcName }) => {
|
|
if (!expectedMethod || !paramName || !moduleName || !className
|
|
|| !funcName) {
|
|
throw new Error(`Unexpected input to 'missing-a-method' error.`);
|
|
}
|
|
return `${moduleName}.${className}.${funcName}() expected the ` +
|
|
`'${paramName}' parameter to expose a '${expectedMethod}' method.`;
|
|
},
|
|
'add-to-cache-list-unexpected-type': ({ entry }) => {
|
|
return `An unexpected entry was passed to ` +
|
|
`'workbox-precaching.PrecacheController.addToCacheList()' The entry ` +
|
|
`'${JSON.stringify(entry)}' isn't supported. You must supply an array of ` +
|
|
`strings with one or more characters, objects with a url property or ` +
|
|
`Request objects.`;
|
|
},
|
|
'add-to-cache-list-conflicting-entries': ({ firstEntry, secondEntry }) => {
|
|
if (!firstEntry || !secondEntry) {
|
|
throw new Error(`Unexpected input to ` +
|
|
`'add-to-cache-list-duplicate-entries' error.`);
|
|
}
|
|
return `Two of the entries passed to ` +
|
|
`'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` +
|
|
`${firstEntry._entryId} but different revision details. Workbox is ` +
|
|
`unable to cache and version the asset correctly. Please remove one ` +
|
|
`of the entries.`;
|
|
},
|
|
'plugin-error-request-will-fetch': ({ thrownError }) => {
|
|
if (!thrownError) {
|
|
throw new Error(`Unexpected input to ` +
|
|
`'plugin-error-request-will-fetch', error.`);
|
|
}
|
|
return `An error was thrown by a plugins 'requestWillFetch()' method. ` +
|
|
`The thrown error message was: '${thrownError.message}'.`;
|
|
},
|
|
'invalid-cache-name': ({ cacheNameId, value }) => {
|
|
if (!cacheNameId) {
|
|
throw new Error(`Expected a 'cacheNameId' for error 'invalid-cache-name'`);
|
|
}
|
|
return `You must provide a name containing at least one character for ` +
|
|
`setCacheDetails({${cacheNameId}: '...'}). Received a value of ` +
|
|
`'${JSON.stringify(value)}'`;
|
|
},
|
|
'unregister-route-but-not-found-with-method': ({ method }) => {
|
|
if (!method) {
|
|
throw new Error(`Unexpected input to ` +
|
|
`'unregister-route-but-not-found-with-method' error.`);
|
|
}
|
|
return `The route you're trying to unregister was not previously ` +
|
|
`registered for the method type '${method}'.`;
|
|
},
|
|
'unregister-route-route-not-registered': () => {
|
|
return `The route you're trying to unregister was not previously ` +
|
|
`registered.`;
|
|
},
|
|
'queue-replay-failed': ({ name }) => {
|
|
return `Replaying the background sync queue '${name}' failed.`;
|
|
},
|
|
'duplicate-queue-name': ({ name }) => {
|
|
return `The Queue name '${name}' is already being used. ` +
|
|
`All instances of backgroundSync.Queue must be given unique names.`;
|
|
},
|
|
'expired-test-without-max-age': ({ methodName, paramName }) => {
|
|
return `The '${methodName}()' method can only be used when the ` +
|
|
`'${paramName}' is used in the constructor.`;
|
|
},
|
|
'unsupported-route-type': ({ moduleName, className, funcName, paramName }) => {
|
|
return `The supplied '${paramName}' parameter was an unsupported type. ` +
|
|
`Please check the docs for ${moduleName}.${className}.${funcName} for ` +
|
|
`valid input types.`;
|
|
},
|
|
'not-array-of-class': ({ value, expectedClass, moduleName, className, funcName, paramName }) => {
|
|
return `The supplied '${paramName}' parameter must be an array of ` +
|
|
`'${expectedClass}' objects. Received '${JSON.stringify(value)},'. ` +
|
|
`Please check the call to ${moduleName}.${className}.${funcName}() ` +
|
|
`to fix the issue.`;
|
|
},
|
|
'max-entries-or-age-required': ({ moduleName, className, funcName }) => {
|
|
return `You must define either config.maxEntries or config.maxAgeSeconds` +
|
|
`in ${moduleName}.${className}.${funcName}`;
|
|
},
|
|
'statuses-or-headers-required': ({ moduleName, className, funcName }) => {
|
|
return `You must define either config.statuses or config.headers` +
|
|
`in ${moduleName}.${className}.${funcName}`;
|
|
},
|
|
'invalid-string': ({ moduleName, funcName, paramName }) => {
|
|
if (!paramName || !moduleName || !funcName) {
|
|
throw new Error(`Unexpected input to 'invalid-string' error.`);
|
|
}
|
|
return `When using strings, the '${paramName}' parameter must start with ` +
|
|
`'http' (for cross-origin matches) or '/' (for same-origin matches). ` +
|
|
`Please see the docs for ${moduleName}.${funcName}() for ` +
|
|
`more info.`;
|
|
},
|
|
'channel-name-required': () => {
|
|
return `You must provide a channelName to construct a ` +
|
|
`BroadcastCacheUpdate instance.`;
|
|
},
|
|
'invalid-responses-are-same-args': () => {
|
|
return `The arguments passed into responsesAreSame() appear to be ` +
|
|
`invalid. Please ensure valid Responses are used.`;
|
|
},
|
|
'expire-custom-caches-only': () => {
|
|
return `You must provide a 'cacheName' property when using the ` +
|
|
`expiration plugin with a runtime caching strategy.`;
|
|
},
|
|
'unit-must-be-bytes': ({ normalizedRangeHeader }) => {
|
|
if (!normalizedRangeHeader) {
|
|
throw new Error(`Unexpected input to 'unit-must-be-bytes' error.`);
|
|
}
|
|
return `The 'unit' portion of the Range header must be set to 'bytes'. ` +
|
|
`The Range header provided was "${normalizedRangeHeader}"`;
|
|
},
|
|
'single-range-only': ({ normalizedRangeHeader }) => {
|
|
if (!normalizedRangeHeader) {
|
|
throw new Error(`Unexpected input to 'single-range-only' error.`);
|
|
}
|
|
return `Multiple ranges are not supported. Please use a single start ` +
|
|
`value, and optional end value. The Range header provided was ` +
|
|
`"${normalizedRangeHeader}"`;
|
|
},
|
|
'invalid-range-values': ({ normalizedRangeHeader }) => {
|
|
if (!normalizedRangeHeader) {
|
|
throw new Error(`Unexpected input to 'invalid-range-values' error.`);
|
|
}
|
|
return `The Range header is missing both start and end values. At least ` +
|
|
`one of those values is needed. The Range header provided was ` +
|
|
`"${normalizedRangeHeader}"`;
|
|
},
|
|
'no-range-header': () => {
|
|
return `No Range header was found in the Request provided.`;
|
|
},
|
|
'range-not-satisfiable': ({ size, start, end }) => {
|
|
return `The start (${start}) and end (${end}) values in the Range are ` +
|
|
`not satisfiable by the cached response, which is ${size} bytes.`;
|
|
},
|
|
'attempt-to-cache-non-get-request': ({ url, method }) => {
|
|
return `Unable to cache '${url}' because it is a '${method}' request and ` +
|
|
`only 'GET' requests can be cached.`;
|
|
},
|
|
'cache-put-with-no-response': ({ url }) => {
|
|
return `There was an attempt to cache '${url}' but the response was not ` +
|
|
`defined.`;
|
|
},
|
|
'no-response': ({ url, error }) => {
|
|
let message = `The strategy could not generate a response for '${url}'.`;
|
|
if (error) {
|
|
message += ` The underlying error is ${error}.`;
|
|
}
|
|
return message;
|
|
},
|
|
'bad-precaching-response': ({ url, status }) => {
|
|
return `The precaching request for '${url}' failed` +
|
|
(status ? ` with an HTTP status of ${status}.` : `.`);
|
|
},
|
|
'non-precached-url': ({ url }) => {
|
|
return `createHandlerBoundToURL('${url}') was called, but that URL is ` +
|
|
`not precached. Please pass in a URL that is precached instead.`;
|
|
},
|
|
'add-to-cache-list-conflicting-integrities': ({ url }) => {
|
|
return `Two of the entries passed to ` +
|
|
`'workbox-precaching.PrecacheController.addToCacheList()' had the URL ` +
|
|
`${url} with different integrity values. Please remove one of them.`;
|
|
},
|
|
'missing-precache-entry': ({ cacheName, url }) => {
|
|
return `Unable to find a precached response in ${cacheName} for ${url}.`;
|
|
},
|
|
'cross-origin-copy-response': ({ origin }) => {
|
|
return `workbox-core.copyResponse() can only be used with same-origin ` +
|
|
`responses. It was passed a response with origin ${origin}.`;
|
|
},
|
|
};
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/models/messages/messageGenerator.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
const fallback = (code, ...args) => {
|
|
let msg = code;
|
|
if (args.length > 0) {
|
|
msg += ` :: ${JSON.stringify(args)}`;
|
|
}
|
|
return msg;
|
|
};
|
|
const generatorFunction = (code, details = {}) => {
|
|
const message = messages[code];
|
|
if (!message) {
|
|
throw new Error(`Unable to find message for code '${code}'.`);
|
|
}
|
|
return message(details);
|
|
};
|
|
const messageGenerator = ( true) ?
|
|
fallback : undefined;
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/WorkboxError.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* Workbox errors should be thrown with this class.
|
|
* This allows use to ensure the type easily in tests,
|
|
* helps developers identify errors from workbox
|
|
* easily and allows use to optimise error
|
|
* messages correctly.
|
|
*
|
|
* @private
|
|
*/
|
|
class WorkboxError_WorkboxError extends Error {
|
|
/**
|
|
*
|
|
* @param {string} errorCode The error code that
|
|
* identifies this particular error.
|
|
* @param {Object=} details Any relevant arguments
|
|
* that will help developers identify issues should
|
|
* be added as a key on the context object.
|
|
*/
|
|
constructor(errorCode, details) {
|
|
const message = messageGenerator(errorCode, details);
|
|
super(message);
|
|
this.name = errorCode;
|
|
this.details = details;
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/assert.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/*
|
|
* This method throws if the supplied value is not an array.
|
|
* The destructed values are required to produce a meaningful error for users.
|
|
* The destructed and restructured object is so it's clear what is
|
|
* needed.
|
|
*/
|
|
const isArray = (value, details) => {
|
|
if (!Array.isArray(value)) {
|
|
throw new WorkboxError_WorkboxError('not-an-array', details);
|
|
}
|
|
};
|
|
const hasMethod = (object, expectedMethod, details) => {
|
|
const type = typeof object[expectedMethod];
|
|
if (type !== 'function') {
|
|
details['expectedMethod'] = expectedMethod;
|
|
throw new WorkboxError_WorkboxError('missing-a-method', details);
|
|
}
|
|
};
|
|
const isType = (object, expectedType, details) => {
|
|
if (typeof object !== expectedType) {
|
|
details['expectedType'] = expectedType;
|
|
throw new WorkboxError_WorkboxError('incorrect-type', details);
|
|
}
|
|
};
|
|
const isInstance = (object, expectedClass, details) => {
|
|
if (!(object instanceof expectedClass)) {
|
|
details['expectedClass'] = expectedClass;
|
|
throw new WorkboxError_WorkboxError('incorrect-class', details);
|
|
}
|
|
};
|
|
const isOneOf = (value, validValues, details) => {
|
|
if (!validValues.includes(value)) {
|
|
details['validValueDescription'] =
|
|
`Valid values are ${JSON.stringify(validValues)}.`;
|
|
throw new WorkboxError_WorkboxError('invalid-value', details);
|
|
}
|
|
};
|
|
const isArrayOfClass = (value, expectedClass, details) => {
|
|
const error = new WorkboxError_WorkboxError('not-array-of-class', details);
|
|
if (!Array.isArray(value)) {
|
|
throw error;
|
|
}
|
|
for (const item of value) {
|
|
if (!(item instanceof expectedClass)) {
|
|
throw error;
|
|
}
|
|
}
|
|
};
|
|
const finalAssertExports = true ? null : undefined;
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/cacheNames.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
const _cacheNameDetails = {
|
|
googleAnalytics: 'googleAnalytics',
|
|
precache: 'precache-v2',
|
|
prefix: 'workbox',
|
|
runtime: 'runtime',
|
|
suffix: typeof registration !== 'undefined' ? registration.scope : '',
|
|
};
|
|
const _createCacheName = (cacheName) => {
|
|
return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]
|
|
.filter((value) => value && value.length > 0)
|
|
.join('-');
|
|
};
|
|
const eachCacheNameDetail = (fn) => {
|
|
for (const key of Object.keys(_cacheNameDetails)) {
|
|
fn(key);
|
|
}
|
|
};
|
|
const cacheNames = {
|
|
updateDetails: (details) => {
|
|
eachCacheNameDetail((key) => {
|
|
if (typeof details[key] === 'string') {
|
|
_cacheNameDetails[key] = details[key];
|
|
}
|
|
});
|
|
},
|
|
getGoogleAnalyticsName: (userCacheName) => {
|
|
return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);
|
|
},
|
|
getPrecacheName: (userCacheName) => {
|
|
return userCacheName || _createCacheName(_cacheNameDetails.precache);
|
|
},
|
|
getPrefix: () => {
|
|
return _cacheNameDetails.prefix;
|
|
},
|
|
getRuntimeName: (userCacheName) => {
|
|
return userCacheName || _createCacheName(_cacheNameDetails.runtime);
|
|
},
|
|
getSuffix: () => {
|
|
return _cacheNameDetails.suffix;
|
|
},
|
|
};
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/logger.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
const logger = ( true ? null : undefined);
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/waitUntil.js
|
|
/*
|
|
Copyright 2020 Google LLC
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
/**
|
|
* A utility method that makes it easier to use `event.waitUntil` with
|
|
* async functions and return the result.
|
|
*
|
|
* @param {ExtendableEvent} event
|
|
* @param {Function} asyncFn
|
|
* @return {Function}
|
|
* @private
|
|
*/
|
|
function waitUntil(event, asyncFn) {
|
|
const returnPromise = asyncFn();
|
|
event.waitUntil(returnPromise);
|
|
return returnPromise;
|
|
}
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/workbox-precaching/_version.js
|
|
var workbox_precaching_version = __webpack_require__("c700");
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/utils/createCacheKey.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
// Name of the search parameter used to store revision info.
|
|
const REVISION_SEARCH_PARAM = '__WB_REVISION__';
|
|
/**
|
|
* Converts a manifest entry into a versioned URL suitable for precaching.
|
|
*
|
|
* @param {Object|string} entry
|
|
* @return {string} A URL with versioning info.
|
|
*
|
|
* @private
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function createCacheKey(entry) {
|
|
if (!entry) {
|
|
throw new WorkboxError_WorkboxError('add-to-cache-list-unexpected-type', { entry });
|
|
}
|
|
// If a precache manifest entry is a string, it's assumed to be a versioned
|
|
// URL, like '/app.abcd1234.js'. Return as-is.
|
|
if (typeof entry === 'string') {
|
|
const urlObject = new URL(entry, location.href);
|
|
return {
|
|
cacheKey: urlObject.href,
|
|
url: urlObject.href,
|
|
};
|
|
}
|
|
const { revision, url } = entry;
|
|
if (!url) {
|
|
throw new WorkboxError_WorkboxError('add-to-cache-list-unexpected-type', { entry });
|
|
}
|
|
// If there's just a URL and no revision, then it's also assumed to be a
|
|
// versioned URL.
|
|
if (!revision) {
|
|
const urlObject = new URL(url, location.href);
|
|
return {
|
|
cacheKey: urlObject.href,
|
|
url: urlObject.href,
|
|
};
|
|
}
|
|
// Otherwise, construct a properly versioned URL using the custom Workbox
|
|
// search parameter along with the revision info.
|
|
const cacheKeyURL = new URL(url, location.href);
|
|
const originalURL = new URL(url, location.href);
|
|
cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);
|
|
return {
|
|
cacheKey: cacheKeyURL.href,
|
|
url: originalURL.href,
|
|
};
|
|
}
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js
|
|
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
/**
|
|
* A plugin, designed to be used with PrecacheController, to determine the
|
|
* of assets that were updated (or not updated) during the install event.
|
|
*
|
|
* @private
|
|
*/
|
|
class PrecacheInstallReportPlugin {
|
|
constructor() {
|
|
this.updatedURLs = [];
|
|
this.notUpdatedURLs = [];
|
|
this.handlerWillStart = async ({ request, state, }) => {
|
|
// TODO: `state` should never be undefined...
|
|
if (state) {
|
|
state.originalRequest = request;
|
|
}
|
|
};
|
|
this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {
|
|
if (event.type === 'install') {
|
|
// TODO: `state` should never be undefined...
|
|
const url = state.originalRequest.url;
|
|
if (cachedResponse) {
|
|
this.notUpdatedURLs.push(url);
|
|
}
|
|
else {
|
|
this.updatedURLs.push(url);
|
|
}
|
|
}
|
|
return cachedResponse;
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js
|
|
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
/**
|
|
* A plugin, designed to be used with PrecacheController, to translate URLs into
|
|
* the corresponding cache key, based on the current revision info.
|
|
*
|
|
* @private
|
|
*/
|
|
class PrecacheCacheKeyPlugin {
|
|
constructor({ precacheController }) {
|
|
this.cacheKeyWillBeUsed = async ({ request, params, }) => {
|
|
const cacheKey = params && params.cacheKey ||
|
|
this._precacheController.getCacheKeyForURL(request.url);
|
|
return cacheKey ? new Request(cacheKey) : request;
|
|
};
|
|
this._precacheController = precacheController;
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/utils/printCleanupDetails.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* @param {string} groupTitle
|
|
* @param {Array<string>} deletedURLs
|
|
*
|
|
* @private
|
|
*/
|
|
const logGroup = (groupTitle, deletedURLs) => {
|
|
logger.groupCollapsed(groupTitle);
|
|
for (const url of deletedURLs) {
|
|
logger.log(url);
|
|
}
|
|
logger.groupEnd();
|
|
};
|
|
/**
|
|
* @param {Array<string>} deletedURLs
|
|
*
|
|
* @private
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function printCleanupDetails(deletedURLs) {
|
|
const deletionCount = deletedURLs.length;
|
|
if (deletionCount > 0) {
|
|
logger.groupCollapsed(`During precaching cleanup, ` +
|
|
`${deletionCount} cached ` +
|
|
`request${deletionCount === 1 ? ' was' : 's were'} deleted.`);
|
|
logGroup('Deleted Cache Requests', deletedURLs);
|
|
logger.groupEnd();
|
|
}
|
|
}
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/utils/printInstallDetails.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* @param {string} groupTitle
|
|
* @param {Array<string>} urls
|
|
*
|
|
* @private
|
|
*/
|
|
function _nestedGroup(groupTitle, urls) {
|
|
if (urls.length === 0) {
|
|
return;
|
|
}
|
|
logger.groupCollapsed(groupTitle);
|
|
for (const url of urls) {
|
|
logger.log(url);
|
|
}
|
|
logger.groupEnd();
|
|
}
|
|
/**
|
|
* @param {Array<string>} urlsToPrecache
|
|
* @param {Array<string>} urlsAlreadyPrecached
|
|
*
|
|
* @private
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function printInstallDetails(urlsToPrecache, urlsAlreadyPrecached) {
|
|
const precachedCount = urlsToPrecache.length;
|
|
const alreadyPrecachedCount = urlsAlreadyPrecached.length;
|
|
if (precachedCount || alreadyPrecachedCount) {
|
|
let message = `Precaching ${precachedCount} file${precachedCount === 1 ? '' : 's'}.`;
|
|
if (alreadyPrecachedCount > 0) {
|
|
message += ` ${alreadyPrecachedCount} ` +
|
|
`file${alreadyPrecachedCount === 1 ? ' is' : 's are'} already cached.`;
|
|
}
|
|
logger.groupCollapsed(message);
|
|
_nestedGroup(`View newly precached URLs.`, urlsToPrecache);
|
|
_nestedGroup(`View previously precached URLs.`, urlsAlreadyPrecached);
|
|
logger.groupEnd();
|
|
}
|
|
}
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
let supportStatus;
|
|
/**
|
|
* A utility function that determines whether the current browser supports
|
|
* constructing a new `Response` from a `response.body` stream.
|
|
*
|
|
* @return {boolean} `true`, if the current browser can successfully
|
|
* construct a `Response` from a `response.body` stream, `false` otherwise.
|
|
*
|
|
* @private
|
|
*/
|
|
function canConstructResponseFromBodyStream() {
|
|
if (supportStatus === undefined) {
|
|
const testResponse = new Response('');
|
|
if ('body' in testResponse) {
|
|
try {
|
|
new Response(testResponse.body);
|
|
supportStatus = true;
|
|
}
|
|
catch (error) {
|
|
supportStatus = false;
|
|
}
|
|
}
|
|
supportStatus = false;
|
|
}
|
|
return supportStatus;
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/copyResponse.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
* Allows developers to copy a response and modify its `headers`, `status`,
|
|
* or `statusText` values (the values settable via a
|
|
* [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}
|
|
* object in the constructor).
|
|
* To modify these values, pass a function as the second argument. That
|
|
* function will be invoked with a single object with the response properties
|
|
* `{headers, status, statusText}`. The return value of this function will
|
|
* be used as the `ResponseInit` for the new `Response`. To change the values
|
|
* either modify the passed parameter(s) and return it, or return a totally
|
|
* new object.
|
|
*
|
|
* This method is intentionally limited to same-origin responses, regardless of
|
|
* whether CORS was used or not.
|
|
*
|
|
* @param {Response} response
|
|
* @param {Function} modifier
|
|
* @memberof module:workbox-core
|
|
*/
|
|
async function copyResponse(response, modifier) {
|
|
let origin = null;
|
|
// If response.url isn't set, assume it's cross-origin and keep origin null.
|
|
if (response.url) {
|
|
const responseURL = new URL(response.url);
|
|
origin = responseURL.origin;
|
|
}
|
|
if (origin !== self.location.origin) {
|
|
throw new WorkboxError_WorkboxError('cross-origin-copy-response', { origin });
|
|
}
|
|
const clonedResponse = response.clone();
|
|
// Create a fresh `ResponseInit` object by cloning the headers.
|
|
const responseInit = {
|
|
headers: new Headers(clonedResponse.headers),
|
|
status: clonedResponse.status,
|
|
statusText: clonedResponse.statusText,
|
|
};
|
|
// Apply any user modifications.
|
|
const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;
|
|
// Create the new response from the body stream and `ResponseInit`
|
|
// modifications. Note: not all browsers support the Response.body stream,
|
|
// so fall back to reading the entire body into memory as a blob.
|
|
const body = canConstructResponseFromBodyStream() ?
|
|
clonedResponse.body : await clonedResponse.blob();
|
|
return new Response(body, modifiedResponseInit);
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/getFriendlyURL.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
const getFriendlyURL = (url) => {
|
|
const urlObj = new URL(String(url), location.href);
|
|
// See https://github.com/GoogleChrome/workbox/issues/2323
|
|
// We want to include everything, except for the origin if it's same-origin.
|
|
return urlObj.href.replace(new RegExp(`^${location.origin}`), '');
|
|
};
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/cacheMatchIgnoreParams.js
|
|
/*
|
|
Copyright 2020 Google LLC
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
function stripParams(fullURL, ignoreParams) {
|
|
const strippedURL = new URL(fullURL);
|
|
for (const param of ignoreParams) {
|
|
strippedURL.searchParams.delete(param);
|
|
}
|
|
return strippedURL.href;
|
|
}
|
|
/**
|
|
* Matches an item in the cache, ignoring specific URL params. This is similar
|
|
* to the `ignoreSearch` option, but it allows you to ignore just specific
|
|
* params (while continuing to match on the others).
|
|
*
|
|
* @private
|
|
* @param {Cache} cache
|
|
* @param {Request} request
|
|
* @param {Object} matchOptions
|
|
* @param {Array<string>} ignoreParams
|
|
* @return {Promise<Response|undefined>}
|
|
*/
|
|
async function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {
|
|
const strippedRequestURL = stripParams(request.url, ignoreParams);
|
|
// If the request doesn't include any ignored params, match as normal.
|
|
if (request.url === strippedRequestURL) {
|
|
return cache.match(request, matchOptions);
|
|
}
|
|
// Otherwise, match by comparing keys
|
|
const keysOptions = { ...matchOptions, ignoreSearch: true };
|
|
const cacheKeys = await cache.keys(request, keysOptions);
|
|
for (const cacheKey of cacheKeys) {
|
|
const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);
|
|
if (strippedRequestURL === strippedCacheKeyURL) {
|
|
return cache.match(cacheKey, matchOptions);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/Deferred.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
/**
|
|
* The Deferred class composes Promises in a way that allows for them to be
|
|
* resolved or rejected from outside the constructor. In most cases promises
|
|
* should be used directly, but Deferreds can be necessary when the logic to
|
|
* resolve a promise must be separate.
|
|
*
|
|
* @private
|
|
*/
|
|
class Deferred {
|
|
/**
|
|
* Creates a promise and exposes its resolve and reject functions as methods.
|
|
*/
|
|
constructor() {
|
|
this.promise = new Promise((resolve, reject) => {
|
|
this.resolve = resolve;
|
|
this.reject = reject;
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/models/quotaErrorCallbacks.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
// Callbacks to be executed whenever there's a quota error.
|
|
const quotaErrorCallbacks = new Set();
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
* Runs all of the callback functions, one at a time sequentially, in the order
|
|
* in which they were registered.
|
|
*
|
|
* @memberof module:workbox-core
|
|
* @private
|
|
*/
|
|
async function executeQuotaErrorCallbacks() {
|
|
if (false) {}
|
|
for (const callback of quotaErrorCallbacks) {
|
|
await callback();
|
|
if (false) {}
|
|
}
|
|
if (false) {}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/timeout.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
/**
|
|
* Returns a promise that resolves and the passed number of milliseconds.
|
|
* This utility is an async/await-friendly version of `setTimeout`.
|
|
*
|
|
* @param {number} ms
|
|
* @return {Promise}
|
|
* @private
|
|
*/
|
|
function timeout(ms) {
|
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
}
|
|
|
|
// EXTERNAL MODULE: ./node_modules/workbox-strategies/_version.js
|
|
var workbox_strategies_version = __webpack_require__("6aa8");
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/StrategyHandler.js
|
|
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toRequest(input) {
|
|
return (typeof input === 'string') ? new Request(input) : input;
|
|
}
|
|
/**
|
|
* A class created every time a Strategy instance instance calls
|
|
* [handle()]{@link module:workbox-strategies.Strategy~handle} or
|
|
* [handleAll()]{@link module:workbox-strategies.Strategy~handleAll} that wraps all fetch and
|
|
* cache actions around plugin callbacks and keeps track of when the strategy
|
|
* is "done" (i.e. all added `event.waitUntil()` promises have resolved).
|
|
*
|
|
* @memberof module:workbox-strategies
|
|
*/
|
|
class StrategyHandler_StrategyHandler {
|
|
/**
|
|
* Creates a new instance associated with the passed strategy and event
|
|
* that's handling the request.
|
|
*
|
|
* The constructor also initializes the state that will be passed to each of
|
|
* the plugins handling this request.
|
|
*
|
|
* @param {module:workbox-strategies.Strategy} strategy
|
|
* @param {Object} options
|
|
* @param {Request|string} options.request A request to run this strategy for.
|
|
* @param {ExtendableEvent} options.event The event associated with the
|
|
* request.
|
|
* @param {URL} [options.url]
|
|
* @param {*} [options.params]
|
|
* [match callback]{@link module:workbox-routing~matchCallback},
|
|
* (if applicable).
|
|
*/
|
|
constructor(strategy, options) {
|
|
this._cacheKeys = {};
|
|
/**
|
|
* The request the strategy is performing (passed to the strategy's
|
|
* `handle()` or `handleAll()` method).
|
|
* @name request
|
|
* @instance
|
|
* @type {Request}
|
|
* @memberof module:workbox-strategies.StrategyHandler
|
|
*/
|
|
/**
|
|
* The event associated with this request.
|
|
* @name event
|
|
* @instance
|
|
* @type {ExtendableEvent}
|
|
* @memberof module:workbox-strategies.StrategyHandler
|
|
*/
|
|
/**
|
|
* A `URL` instance of `request.url` (if passed to the strategy's
|
|
* `handle()` or `handleAll()` method).
|
|
* Note: the `url` param will be present if the strategy was invoked
|
|
* from a workbox `Route` object.
|
|
* @name url
|
|
* @instance
|
|
* @type {URL|undefined}
|
|
* @memberof module:workbox-strategies.StrategyHandler
|
|
*/
|
|
/**
|
|
* A `param` value (if passed to the strategy's
|
|
* `handle()` or `handleAll()` method).
|
|
* Note: the `param` param will be present if the strategy was invoked
|
|
* from a workbox `Route` object and the
|
|
* [match callback]{@link module:workbox-routing~matchCallback} returned
|
|
* a truthy value (it will be that value).
|
|
* @name params
|
|
* @instance
|
|
* @type {*|undefined}
|
|
* @memberof module:workbox-strategies.StrategyHandler
|
|
*/
|
|
if (false) {}
|
|
Object.assign(this, options);
|
|
this.event = options.event;
|
|
this._strategy = strategy;
|
|
this._handlerDeferred = new Deferred();
|
|
this._extendLifetimePromises = [];
|
|
// Copy the plugins list (since it's mutable on the strategy),
|
|
// so any mutations don't affect this handler instance.
|
|
this._plugins = [...strategy.plugins];
|
|
this._pluginStateMap = new Map();
|
|
for (const plugin of this._plugins) {
|
|
this._pluginStateMap.set(plugin, {});
|
|
}
|
|
this.event.waitUntil(this._handlerDeferred.promise);
|
|
}
|
|
/**
|
|
* Fetches a given request (and invokes any applicable plugin callback
|
|
* methods) using the `fetchOptions` (for non-navigation requests) and
|
|
* `plugins` defined on the `Strategy` object.
|
|
*
|
|
* The following plugin lifecycle methods are invoked when using this method:
|
|
* - `requestWillFetch()`
|
|
* - `fetchDidSucceed()`
|
|
* - `fetchDidFail()`
|
|
*
|
|
* @param {Request|string} input The URL or request to fetch.
|
|
* @return {Promise<Response>}
|
|
*/
|
|
async fetch(input) {
|
|
const { event } = this;
|
|
let request = toRequest(input);
|
|
if (request.mode === 'navigate' &&
|
|
event instanceof FetchEvent &&
|
|
event.preloadResponse) {
|
|
const possiblePreloadResponse = await event.preloadResponse;
|
|
if (possiblePreloadResponse) {
|
|
if (false) {}
|
|
return possiblePreloadResponse;
|
|
}
|
|
}
|
|
// If there is a fetchDidFail plugin, we need to save a clone of the
|
|
// original request before it's either modified by a requestWillFetch
|
|
// plugin or before the original request's body is consumed via fetch().
|
|
const originalRequest = this.hasCallback('fetchDidFail') ?
|
|
request.clone() : null;
|
|
try {
|
|
for (const cb of this.iterateCallbacks('requestWillFetch')) {
|
|
request = await cb({ request: request.clone(), event });
|
|
}
|
|
}
|
|
catch (err) {
|
|
throw new WorkboxError_WorkboxError('plugin-error-request-will-fetch', {
|
|
thrownError: err,
|
|
});
|
|
}
|
|
// The request can be altered by plugins with `requestWillFetch` making
|
|
// the original request (most likely from a `fetch` event) different
|
|
// from the Request we make. Pass both to `fetchDidFail` to aid debugging.
|
|
const pluginFilteredRequest = request.clone();
|
|
try {
|
|
let fetchResponse;
|
|
// See https://github.com/GoogleChrome/workbox/issues/1796
|
|
fetchResponse = await fetch(request, request.mode === 'navigate' ?
|
|
undefined : this._strategy.fetchOptions);
|
|
if (false) {}
|
|
for (const callback of this.iterateCallbacks('fetchDidSucceed')) {
|
|
fetchResponse = await callback({
|
|
event,
|
|
request: pluginFilteredRequest,
|
|
response: fetchResponse,
|
|
});
|
|
}
|
|
return fetchResponse;
|
|
}
|
|
catch (error) {
|
|
if (false) {}
|
|
// `originalRequest` will only exist if a `fetchDidFail` callback
|
|
// is being used (see above).
|
|
if (originalRequest) {
|
|
await this.runCallbacks('fetchDidFail', {
|
|
error,
|
|
event,
|
|
originalRequest: originalRequest.clone(),
|
|
request: pluginFilteredRequest.clone(),
|
|
});
|
|
}
|
|
throw error;
|
|
}
|
|
}
|
|
/**
|
|
* Calls `this.fetch()` and (in the background) runs `this.cachePut()` on
|
|
* the response generated by `this.fetch()`.
|
|
*
|
|
* The call to `this.cachePut()` automatically invokes `this.waitUntil()`,
|
|
* so you do not have to manually call `waitUntil()` on the event.
|
|
*
|
|
* @param {Request|string} input The request or URL to fetch and cache.
|
|
* @return {Promise<Response>}
|
|
*/
|
|
async fetchAndCachePut(input) {
|
|
const response = await this.fetch(input);
|
|
const responseClone = response.clone();
|
|
this.waitUntil(this.cachePut(input, responseClone));
|
|
return response;
|
|
}
|
|
/**
|
|
* Matches a request from the cache (and invokes any applicable plugin
|
|
* callback methods) using the `cacheName`, `matchOptions`, and `plugins`
|
|
* defined on the strategy object.
|
|
*
|
|
* The following plugin lifecycle methods are invoked when using this method:
|
|
* - cacheKeyWillByUsed()
|
|
* - cachedResponseWillByUsed()
|
|
*
|
|
* @param {Request|string} key The Request or URL to use as the cache key.
|
|
* @return {Promise<Response|undefined>} A matching response, if found.
|
|
*/
|
|
async cacheMatch(key) {
|
|
const request = toRequest(key);
|
|
let cachedResponse;
|
|
const { cacheName, matchOptions } = this._strategy;
|
|
const effectiveRequest = await this.getCacheKey(request, 'read');
|
|
const multiMatchOptions = { ...matchOptions, ...{ cacheName } };
|
|
cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);
|
|
if (false) {}
|
|
for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {
|
|
cachedResponse = (await callback({
|
|
cacheName,
|
|
matchOptions,
|
|
cachedResponse,
|
|
request: effectiveRequest,
|
|
event: this.event,
|
|
})) || undefined;
|
|
}
|
|
return cachedResponse;
|
|
}
|
|
/**
|
|
* Puts a request/response pair in the cache (and invokes any applicable
|
|
* plugin callback methods) using the `cacheName` and `plugins` defined on
|
|
* the strategy object.
|
|
*
|
|
* The following plugin lifecycle methods are invoked when using this method:
|
|
* - cacheKeyWillByUsed()
|
|
* - cacheWillUpdate()
|
|
* - cacheDidUpdate()
|
|
*
|
|
* @param {Request|string} key The request or URL to use as the cache key.
|
|
* @param {Response} response The response to cache.
|
|
* @return {Promise<boolean>} `false` if a cacheWillUpdate caused the response
|
|
* not be cached, and `true` otherwise.
|
|
*/
|
|
async cachePut(key, response) {
|
|
const request = toRequest(key);
|
|
// Run in the next task to avoid blocking other cache reads.
|
|
// https://github.com/w3c/ServiceWorker/issues/1397
|
|
await timeout(0);
|
|
const effectiveRequest = await this.getCacheKey(request, 'write');
|
|
if (false) {}
|
|
if (!response) {
|
|
if (false) {}
|
|
throw new WorkboxError_WorkboxError('cache-put-with-no-response', {
|
|
url: getFriendlyURL(effectiveRequest.url),
|
|
});
|
|
}
|
|
const responseToCache = await this._ensureResponseSafeToCache(response);
|
|
if (!responseToCache) {
|
|
if (false) {}
|
|
return false;
|
|
}
|
|
const { cacheName, matchOptions } = this._strategy;
|
|
const cache = await self.caches.open(cacheName);
|
|
const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');
|
|
const oldResponse = hasCacheUpdateCallback ? await cacheMatchIgnoreParams(
|
|
// TODO(philipwalton): the `__WB_REVISION__` param is a precaching
|
|
// feature. Consider into ways to only add this behavior if using
|
|
// precaching.
|
|
cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions) :
|
|
null;
|
|
if (false) {}
|
|
try {
|
|
await cache.put(effectiveRequest, hasCacheUpdateCallback ?
|
|
responseToCache.clone() : responseToCache);
|
|
}
|
|
catch (error) {
|
|
// See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError
|
|
if (error.name === 'QuotaExceededError') {
|
|
await executeQuotaErrorCallbacks();
|
|
}
|
|
throw error;
|
|
}
|
|
for (const callback of this.iterateCallbacks('cacheDidUpdate')) {
|
|
await callback({
|
|
cacheName,
|
|
oldResponse,
|
|
newResponse: responseToCache.clone(),
|
|
request: effectiveRequest,
|
|
event: this.event,
|
|
});
|
|
}
|
|
return true;
|
|
}
|
|
/**
|
|
* Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and
|
|
* executes any of those callbacks found in sequence. The final `Request`
|
|
* object returned by the last plugin is treated as the cache key for cache
|
|
* reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have
|
|
* been registered, the passed request is returned unmodified
|
|
*
|
|
* @param {Request} request
|
|
* @param {string} mode
|
|
* @return {Promise<Request>}
|
|
*/
|
|
async getCacheKey(request, mode) {
|
|
if (!this._cacheKeys[mode]) {
|
|
let effectiveRequest = request;
|
|
for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {
|
|
effectiveRequest = toRequest(await callback({
|
|
mode,
|
|
request: effectiveRequest,
|
|
event: this.event,
|
|
params: this.params,
|
|
}));
|
|
}
|
|
this._cacheKeys[mode] = effectiveRequest;
|
|
}
|
|
return this._cacheKeys[mode];
|
|
}
|
|
/**
|
|
* Returns true if the strategy has at least one plugin with the given
|
|
* callback.
|
|
*
|
|
* @param {string} name The name of the callback to check for.
|
|
* @return {boolean}
|
|
*/
|
|
hasCallback(name) {
|
|
for (const plugin of this._strategy.plugins) {
|
|
if (name in plugin) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
/**
|
|
* Runs all plugin callbacks matching the given name, in order, passing the
|
|
* given param object (merged ith the current plugin state) as the only
|
|
* argument.
|
|
*
|
|
* Note: since this method runs all plugins, it's not suitable for cases
|
|
* where the return value of a callback needs to be applied prior to calling
|
|
* the next callback. See
|
|
* [`iterateCallbacks()`]{@link module:workbox-strategies.StrategyHandler#iterateCallbacks}
|
|
* below for how to handle that case.
|
|
*
|
|
* @param {string} name The name of the callback to run within each plugin.
|
|
* @param {Object} param The object to pass as the first (and only) param
|
|
* when executing each callback. This object will be merged with the
|
|
* current plugin state prior to callback execution.
|
|
*/
|
|
async runCallbacks(name, param) {
|
|
for (const callback of this.iterateCallbacks(name)) {
|
|
// TODO(philipwalton): not sure why `any` is needed. It seems like
|
|
// this should work with `as WorkboxPluginCallbackParam[C]`.
|
|
await callback(param);
|
|
}
|
|
}
|
|
/**
|
|
* Accepts a callback and returns an iterable of matching plugin callbacks,
|
|
* where each callback is wrapped with the current handler state (i.e. when
|
|
* you call each callback, whatever object parameter you pass it will
|
|
* be merged with the plugin's current state).
|
|
*
|
|
* @param {string} name The name fo the callback to run
|
|
* @return {Array<Function>}
|
|
*/
|
|
*iterateCallbacks(name) {
|
|
for (const plugin of this._strategy.plugins) {
|
|
if (typeof plugin[name] === 'function') {
|
|
const state = this._pluginStateMap.get(plugin);
|
|
const statefulCallback = (param) => {
|
|
const statefulParam = { ...param, state };
|
|
// TODO(philipwalton): not sure why `any` is needed. It seems like
|
|
// this should work with `as WorkboxPluginCallbackParam[C]`.
|
|
return plugin[name](statefulParam);
|
|
};
|
|
yield statefulCallback;
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* Adds a promise to the
|
|
* [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}
|
|
* of the event event associated with the request being handled (usually a
|
|
* `FetchEvent`).
|
|
*
|
|
* Note: you can await
|
|
* [`doneWaiting()`]{@link module:workbox-strategies.StrategyHandler~doneWaiting}
|
|
* to know when all added promises have settled.
|
|
*
|
|
* @param {Promise} promise A promise to add to the extend lifetime promises
|
|
* of the event that triggered the request.
|
|
*/
|
|
waitUntil(promise) {
|
|
this._extendLifetimePromises.push(promise);
|
|
return promise;
|
|
}
|
|
/**
|
|
* Returns a promise that resolves once all promises passed to
|
|
* [`waitUntil()`]{@link module:workbox-strategies.StrategyHandler~waitUntil}
|
|
* have settled.
|
|
*
|
|
* Note: any work done after `doneWaiting()` settles should be manually
|
|
* passed to an event's `waitUntil()` method (not this handler's
|
|
* `waitUntil()` method), otherwise the service worker thread my be killed
|
|
* prior to your work completing.
|
|
*/
|
|
async doneWaiting() {
|
|
let promise;
|
|
while (promise = this._extendLifetimePromises.shift()) {
|
|
await promise;
|
|
}
|
|
}
|
|
/**
|
|
* Stops running the strategy and immediately resolves any pending
|
|
* `waitUntil()` promises.
|
|
*/
|
|
destroy() {
|
|
this._handlerDeferred.resolve();
|
|
}
|
|
/**
|
|
* This method will call cacheWillUpdate on the available plugins (or use
|
|
* status === 200) to determine if the Response is safe and valid to cache.
|
|
*
|
|
* @param {Request} options.request
|
|
* @param {Response} options.response
|
|
* @return {Promise<Response|undefined>}
|
|
*
|
|
* @private
|
|
*/
|
|
async _ensureResponseSafeToCache(response) {
|
|
let responseToCache = response;
|
|
let pluginsUsed = false;
|
|
for (const callback of this.iterateCallbacks('cacheWillUpdate')) {
|
|
responseToCache = (await callback({
|
|
request: this.request,
|
|
response: responseToCache,
|
|
event: this.event,
|
|
})) || undefined;
|
|
pluginsUsed = true;
|
|
if (!responseToCache) {
|
|
break;
|
|
}
|
|
}
|
|
if (!pluginsUsed) {
|
|
if (responseToCache && responseToCache.status !== 200) {
|
|
responseToCache = undefined;
|
|
}
|
|
if (false) {}
|
|
}
|
|
return responseToCache;
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/Strategy.js
|
|
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* An abstract base class that all other strategy classes must extend from:
|
|
*
|
|
* @memberof module:workbox-strategies
|
|
*/
|
|
class Strategy_Strategy {
|
|
/**
|
|
* Creates a new instance of the strategy and sets all documented option
|
|
* properties as public instance properties.
|
|
*
|
|
* Note: if a custom strategy class extends the base Strategy class and does
|
|
* not need more than these properties, it does not need to define its own
|
|
* constructor.
|
|
*
|
|
* @param {Object} [options]
|
|
* @param {string} [options.cacheName] Cache name to store and retrieve
|
|
* requests. Defaults to the cache names provided by
|
|
* [workbox-core]{@link module:workbox-core.cacheNames}.
|
|
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
|
|
* to use in conjunction with this caching strategy.
|
|
* @param {Object} [options.fetchOptions] Values passed along to the
|
|
* [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
|
|
* of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
|
|
* `fetch()` requests made by this strategy.
|
|
* @param {Object} [options.matchOptions] The
|
|
* [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
|
|
* for any `cache.match()` or `cache.put()` calls made by this strategy.
|
|
*/
|
|
constructor(options = {}) {
|
|
/**
|
|
* Cache name to store and retrieve
|
|
* requests. Defaults to the cache names provided by
|
|
* [workbox-core]{@link module:workbox-core.cacheNames}.
|
|
*
|
|
* @type {string}
|
|
*/
|
|
this.cacheName = cacheNames.getRuntimeName(options.cacheName);
|
|
/**
|
|
* The list
|
|
* [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
|
|
* used by this strategy.
|
|
*
|
|
* @type {Array<Object>}
|
|
*/
|
|
this.plugins = options.plugins || [];
|
|
/**
|
|
* Values passed along to the
|
|
* [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}
|
|
* of all fetch() requests made by this strategy.
|
|
*
|
|
* @type {Object}
|
|
*/
|
|
this.fetchOptions = options.fetchOptions;
|
|
/**
|
|
* The
|
|
* [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
|
|
* for any `cache.match()` or `cache.put()` calls made by this strategy.
|
|
*
|
|
* @type {Object}
|
|
*/
|
|
this.matchOptions = options.matchOptions;
|
|
}
|
|
/**
|
|
* Perform a request strategy and returns a `Promise` that will resolve with
|
|
* a `Response`, invoking all relevant plugin callbacks.
|
|
*
|
|
* When a strategy instance is registered with a Workbox
|
|
* [route]{@link module:workbox-routing.Route}, this method is automatically
|
|
* called when the route matches.
|
|
*
|
|
* Alternatively, this method can be used in a standalone `FetchEvent`
|
|
* listener by passing it to `event.respondWith()`.
|
|
*
|
|
* @param {FetchEvent|Object} options A `FetchEvent` or an object with the
|
|
* properties listed below.
|
|
* @param {Request|string} options.request A request to run this strategy for.
|
|
* @param {ExtendableEvent} options.event The event associated with the
|
|
* request.
|
|
* @param {URL} [options.url]
|
|
* @param {*} [options.params]
|
|
*/
|
|
handle(options) {
|
|
const [responseDone] = this.handleAll(options);
|
|
return responseDone;
|
|
}
|
|
/**
|
|
* Similar to [`handle()`]{@link module:workbox-strategies.Strategy~handle}, but
|
|
* instead of just returning a `Promise` that resolves to a `Response` it
|
|
* it will return an tuple of [response, done] promises, where the former
|
|
* (`response`) is equivalent to what `handle()` returns, and the latter is a
|
|
* Promise that will resolve once any promises that were added to
|
|
* `event.waitUntil()` as part of performing the strategy have completed.
|
|
*
|
|
* You can await the `done` promise to ensure any extra work performed by
|
|
* the strategy (usually caching responses) completes successfully.
|
|
*
|
|
* @param {FetchEvent|Object} options A `FetchEvent` or an object with the
|
|
* properties listed below.
|
|
* @param {Request|string} options.request A request to run this strategy for.
|
|
* @param {ExtendableEvent} options.event The event associated with the
|
|
* request.
|
|
* @param {URL} [options.url]
|
|
* @param {*} [options.params]
|
|
* @return {Array<Promise>} A tuple of [response, done]
|
|
* promises that can be used to determine when the response resolves as
|
|
* well as when the handler has completed all its work.
|
|
*/
|
|
handleAll(options) {
|
|
// Allow for flexible options to be passed.
|
|
if (options instanceof FetchEvent) {
|
|
options = {
|
|
event: options,
|
|
request: options.request,
|
|
};
|
|
}
|
|
const event = options.event;
|
|
const request = typeof options.request === 'string' ?
|
|
new Request(options.request) :
|
|
options.request;
|
|
const params = 'params' in options ? options.params : undefined;
|
|
const handler = new StrategyHandler_StrategyHandler(this, { event, request, params });
|
|
const responseDone = this._getResponse(handler, request, event);
|
|
const handlerDone = this._awaitComplete(responseDone, handler, request, event);
|
|
// Return an array of promises, suitable for use with Promise.all().
|
|
return [responseDone, handlerDone];
|
|
}
|
|
async _getResponse(handler, request, event) {
|
|
await handler.runCallbacks('handlerWillStart', { event, request });
|
|
let response = undefined;
|
|
try {
|
|
response = await this._handle(request, handler);
|
|
// The "official" Strategy subclasses all throw this error automatically,
|
|
// but in case a third-party Strategy doesn't, ensure that we have a
|
|
// consistent failure when there's no response or an error response.
|
|
if (!response || response.type === 'error') {
|
|
throw new WorkboxError_WorkboxError('no-response', { url: request.url });
|
|
}
|
|
}
|
|
catch (error) {
|
|
for (const callback of handler.iterateCallbacks('handlerDidError')) {
|
|
response = await callback({ error, event, request });
|
|
if (response) {
|
|
break;
|
|
}
|
|
}
|
|
if (!response) {
|
|
throw error;
|
|
}
|
|
else if (false) {}
|
|
}
|
|
for (const callback of handler.iterateCallbacks('handlerWillRespond')) {
|
|
response = await callback({ event, request, response });
|
|
}
|
|
return response;
|
|
}
|
|
async _awaitComplete(responseDone, handler, request, event) {
|
|
let response;
|
|
let error;
|
|
try {
|
|
response = await responseDone;
|
|
}
|
|
catch (error) {
|
|
// Ignore errors, as response errors should be caught via the `response`
|
|
// promise above. The `done` promise will only throw for errors in
|
|
// promises passed to `handler.waitUntil()`.
|
|
}
|
|
try {
|
|
await handler.runCallbacks('handlerDidRespond', {
|
|
event,
|
|
request,
|
|
response,
|
|
});
|
|
await handler.doneWaiting();
|
|
}
|
|
catch (waitUntilError) {
|
|
error = waitUntilError;
|
|
}
|
|
await handler.runCallbacks('handlerDidComplete', {
|
|
event,
|
|
request,
|
|
response,
|
|
error,
|
|
});
|
|
handler.destroy();
|
|
if (error) {
|
|
throw error;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Classes extending the `Strategy` based class should implement this method,
|
|
* and leverage the [`handler`]{@link module:workbox-strategies.StrategyHandler}
|
|
* arg to perform all fetching and cache logic, which will ensure all relevant
|
|
* cache, cache options, fetch options and plugins are used (per the current
|
|
* strategy instance).
|
|
*
|
|
* @name _handle
|
|
* @instance
|
|
* @abstract
|
|
* @function
|
|
* @param {Request} request
|
|
* @param {module:workbox-strategies.StrategyHandler} handler
|
|
* @return {Promise<Response>}
|
|
*
|
|
* @memberof module:workbox-strategies.Strategy
|
|
*/
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/PrecacheStrategy.js
|
|
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* A [Strategy]{@link module:workbox-strategies.Strategy} implementation
|
|
* specifically designed to work with
|
|
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
|
|
* to both cache and fetch precached assets.
|
|
*
|
|
* Note: an instance of this class is created automatically when creating a
|
|
* `PrecacheController`; it's generally not necessary to create this yourself.
|
|
*
|
|
* @extends module:workbox-strategies.Strategy
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
class PrecacheStrategy_PrecacheStrategy extends Strategy_Strategy {
|
|
/**
|
|
*
|
|
* @param {Object} [options]
|
|
* @param {string} [options.cacheName] Cache name to store and retrieve
|
|
* requests. Defaults to the cache names provided by
|
|
* [workbox-core]{@link module:workbox-core.cacheNames}.
|
|
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
|
|
* to use in conjunction with this caching strategy.
|
|
* @param {Object} [options.fetchOptions] Values passed along to the
|
|
* [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}
|
|
* of all fetch() requests made by this strategy.
|
|
* @param {Object} [options.matchOptions] The
|
|
* [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}
|
|
* for any `cache.match()` or `cache.put()` calls made by this strategy.
|
|
* @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to
|
|
* get the response from the network if there's a precache miss.
|
|
*/
|
|
constructor(options = {}) {
|
|
options.cacheName = cacheNames.getPrecacheName(options.cacheName);
|
|
super(options);
|
|
this._fallbackToNetwork = options.fallbackToNetwork === false ? false : true;
|
|
// Redirected responses cannot be used to satisfy a navigation request, so
|
|
// any redirected response must be "copied" rather than cloned, so the new
|
|
// response doesn't contain the `redirected` flag. See:
|
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1
|
|
this.plugins.push(PrecacheStrategy_PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);
|
|
}
|
|
/**
|
|
* @private
|
|
* @param {Request|string} request A request to run this strategy for.
|
|
* @param {module:workbox-strategies.StrategyHandler} handler The event that
|
|
* triggered the request.
|
|
* @return {Promise<Response>}
|
|
*/
|
|
async _handle(request, handler) {
|
|
const response = await handler.cacheMatch(request);
|
|
if (!response) {
|
|
// If this is an `install` event then populate the cache. If this is a
|
|
// `fetch` event (or any other event) then respond with the cached
|
|
// response.
|
|
if (handler.event && handler.event.type === 'install') {
|
|
return await this._handleInstall(request, handler);
|
|
}
|
|
return await this._handleFetch(request, handler);
|
|
}
|
|
return response;
|
|
}
|
|
async _handleFetch(request, handler) {
|
|
let response;
|
|
// Fall back to the network if we don't have a cached response
|
|
// (perhaps due to manual cache cleanup).
|
|
if (this._fallbackToNetwork) {
|
|
if (false) {}
|
|
response = await handler.fetch(request);
|
|
}
|
|
else {
|
|
// This shouldn't normally happen, but there are edge cases:
|
|
// https://github.com/GoogleChrome/workbox/issues/1441
|
|
throw new WorkboxError_WorkboxError('missing-precache-entry', {
|
|
cacheName: this.cacheName,
|
|
url: request.url,
|
|
});
|
|
}
|
|
if (false) {}
|
|
return response;
|
|
}
|
|
async _handleInstall(request, handler) {
|
|
this._useDefaultCacheabilityPluginIfNeeded();
|
|
const response = await handler.fetch(request);
|
|
// Make sure we defer cachePut() until after we know the response
|
|
// should be cached; see https://github.com/GoogleChrome/workbox/issues/2737
|
|
const wasCached = await handler.cachePut(request, response.clone());
|
|
if (!wasCached) {
|
|
// Throwing here will lead to the `install` handler failing, which
|
|
// we want to do if *any* of the responses aren't safe to cache.
|
|
throw new WorkboxError_WorkboxError('bad-precaching-response', {
|
|
url: request.url,
|
|
status: response.status,
|
|
});
|
|
}
|
|
return response;
|
|
}
|
|
/**
|
|
* This method is complex, as there a number of things to account for:
|
|
*
|
|
* The `plugins` array can be set at construction, and/or it might be added to
|
|
* to at any time before the strategy is used.
|
|
*
|
|
* At the time the strategy is used (i.e. during an `install` event), there
|
|
* needs to be at least one plugin that implements `cacheWillUpdate` in the
|
|
* array, other than `copyRedirectedCacheableResponsesPlugin`.
|
|
*
|
|
* - If this method is called and there are no suitable `cacheWillUpdate`
|
|
* plugins, we need to add `defaultPrecacheCacheabilityPlugin`.
|
|
*
|
|
* - If this method is called and there is exactly one `cacheWillUpdate`, then
|
|
* we don't have to do anything (this might be a previously added
|
|
* `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).
|
|
*
|
|
* - If this method is called and there is more than one `cacheWillUpdate`,
|
|
* then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,
|
|
* we need to remove it. (This situation is unlikely, but it could happen if
|
|
* the strategy is used multiple times, the first without a `cacheWillUpdate`,
|
|
* and then later on after manually adding a custom `cacheWillUpdate`.)
|
|
*
|
|
* See https://github.com/GoogleChrome/workbox/issues/2737 for more context.
|
|
*
|
|
* @private
|
|
*/
|
|
_useDefaultCacheabilityPluginIfNeeded() {
|
|
let defaultPluginIndex = null;
|
|
let cacheWillUpdatePluginCount = 0;
|
|
for (const [index, plugin] of this.plugins.entries()) {
|
|
// Ignore the copy redirected plugin when determining what to do.
|
|
if (plugin === PrecacheStrategy_PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {
|
|
continue;
|
|
}
|
|
// Save the default plugin's index, in case it needs to be removed.
|
|
if (plugin === PrecacheStrategy_PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {
|
|
defaultPluginIndex = index;
|
|
}
|
|
if (plugin.cacheWillUpdate) {
|
|
cacheWillUpdatePluginCount++;
|
|
}
|
|
}
|
|
if (cacheWillUpdatePluginCount === 0) {
|
|
this.plugins.push(PrecacheStrategy_PrecacheStrategy.defaultPrecacheCacheabilityPlugin);
|
|
}
|
|
else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {
|
|
// Only remove the default plugin; multiple custom plugins are allowed.
|
|
this.plugins.splice(defaultPluginIndex, 1);
|
|
}
|
|
// Nothing needs to be done if cacheWillUpdatePluginCount is 1
|
|
}
|
|
}
|
|
PrecacheStrategy_PrecacheStrategy.defaultPrecacheCacheabilityPlugin = {
|
|
async cacheWillUpdate({ response }) {
|
|
if (!response || response.status >= 400) {
|
|
return null;
|
|
}
|
|
return response;
|
|
}
|
|
};
|
|
PrecacheStrategy_PrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {
|
|
async cacheWillUpdate({ response }) {
|
|
return response.redirected ? await copyResponse(response) : response;
|
|
}
|
|
};
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/PrecacheController.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Performs efficient precaching of assets.
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
class PrecacheController_PrecacheController {
|
|
/**
|
|
* Create a new PrecacheController.
|
|
*
|
|
* @param {Object} [options]
|
|
* @param {string} [options.cacheName] The cache to use for precaching.
|
|
* @param {string} [options.plugins] Plugins to use when precaching as well
|
|
* as responding to fetch events for precached assets.
|
|
* @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to
|
|
* get the response from the network if there's a precache miss.
|
|
*/
|
|
constructor({ cacheName, plugins = [], fallbackToNetwork = true } = {}) {
|
|
this._urlsToCacheKeys = new Map();
|
|
this._urlsToCacheModes = new Map();
|
|
this._cacheKeysToIntegrities = new Map();
|
|
this._strategy = new PrecacheStrategy_PrecacheStrategy({
|
|
cacheName: cacheNames.getPrecacheName(cacheName),
|
|
plugins: [
|
|
...plugins,
|
|
new PrecacheCacheKeyPlugin({ precacheController: this }),
|
|
],
|
|
fallbackToNetwork,
|
|
});
|
|
// Bind the install and activate methods to the instance.
|
|
this.install = this.install.bind(this);
|
|
this.activate = this.activate.bind(this);
|
|
}
|
|
/**
|
|
* @type {module:workbox-precaching.PrecacheStrategy} The strategy created by this controller and
|
|
* used to cache assets and respond to fetch events.
|
|
*/
|
|
get strategy() {
|
|
return this._strategy;
|
|
}
|
|
/**
|
|
* Adds items to the precache list, removing any duplicates and
|
|
* stores the files in the
|
|
* ["precache cache"]{@link module:workbox-core.cacheNames} when the service
|
|
* worker installs.
|
|
*
|
|
* This method can be called multiple times.
|
|
*
|
|
* @param {Array<Object|string>} [entries=[]] Array of entries to precache.
|
|
*/
|
|
precache(entries) {
|
|
this.addToCacheList(entries);
|
|
if (!this._installAndActiveListenersAdded) {
|
|
self.addEventListener('install', this.install);
|
|
self.addEventListener('activate', this.activate);
|
|
this._installAndActiveListenersAdded = true;
|
|
}
|
|
}
|
|
/**
|
|
* This method will add items to the precache list, removing duplicates
|
|
* and ensuring the information is valid.
|
|
*
|
|
* @param {Array<module:workbox-precaching.PrecacheController.PrecacheEntry|string>} entries
|
|
* Array of entries to precache.
|
|
*/
|
|
addToCacheList(entries) {
|
|
if (false) {}
|
|
const urlsToWarnAbout = [];
|
|
for (const entry of entries) {
|
|
// See https://github.com/GoogleChrome/workbox/issues/2259
|
|
if (typeof entry === 'string') {
|
|
urlsToWarnAbout.push(entry);
|
|
}
|
|
else if (entry && entry.revision === undefined) {
|
|
urlsToWarnAbout.push(entry.url);
|
|
}
|
|
const { cacheKey, url } = createCacheKey(entry);
|
|
const cacheMode = (typeof entry !== 'string' && entry.revision) ?
|
|
'reload' : 'default';
|
|
if (this._urlsToCacheKeys.has(url) &&
|
|
this._urlsToCacheKeys.get(url) !== cacheKey) {
|
|
throw new WorkboxError_WorkboxError('add-to-cache-list-conflicting-entries', {
|
|
firstEntry: this._urlsToCacheKeys.get(url),
|
|
secondEntry: cacheKey,
|
|
});
|
|
}
|
|
if (typeof entry !== 'string' && entry.integrity) {
|
|
if (this._cacheKeysToIntegrities.has(cacheKey) &&
|
|
this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {
|
|
throw new WorkboxError_WorkboxError('add-to-cache-list-conflicting-integrities', {
|
|
url,
|
|
});
|
|
}
|
|
this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);
|
|
}
|
|
this._urlsToCacheKeys.set(url, cacheKey);
|
|
this._urlsToCacheModes.set(url, cacheMode);
|
|
if (urlsToWarnAbout.length > 0) {
|
|
const warningMessage = `Workbox is precaching URLs without revision ` +
|
|
`info: ${urlsToWarnAbout.join(', ')}\nThis is generally NOT safe. ` +
|
|
`Learn more at https://bit.ly/wb-precache`;
|
|
if (true) {
|
|
// Use console directly to display this warning without bloating
|
|
// bundle sizes by pulling in all of the logger codebase in prod.
|
|
console.warn(warningMessage);
|
|
}
|
|
else {}
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* Precaches new and updated assets. Call this method from the service worker
|
|
* install event.
|
|
*
|
|
* Note: this method calls `event.waitUntil()` for you, so you do not need
|
|
* to call it yourself in your event handlers.
|
|
*
|
|
* @param {ExtendableEvent} event
|
|
* @return {Promise<module:workbox-precaching.InstallResult>}
|
|
*/
|
|
install(event) {
|
|
return waitUntil(event, async () => {
|
|
const installReportPlugin = new PrecacheInstallReportPlugin();
|
|
this.strategy.plugins.push(installReportPlugin);
|
|
// Cache entries one at a time.
|
|
// See https://github.com/GoogleChrome/workbox/issues/2528
|
|
for (const [url, cacheKey] of this._urlsToCacheKeys) {
|
|
const integrity = this._cacheKeysToIntegrities.get(cacheKey);
|
|
const cacheMode = this._urlsToCacheModes.get(url);
|
|
const request = new Request(url, {
|
|
integrity,
|
|
cache: cacheMode,
|
|
credentials: 'same-origin',
|
|
});
|
|
await Promise.all(this.strategy.handleAll({
|
|
params: { cacheKey },
|
|
request,
|
|
event,
|
|
}));
|
|
}
|
|
const { updatedURLs, notUpdatedURLs } = installReportPlugin;
|
|
if (false) {}
|
|
return { updatedURLs, notUpdatedURLs };
|
|
});
|
|
}
|
|
/**
|
|
* Deletes assets that are no longer present in the current precache manifest.
|
|
* Call this method from the service worker activate event.
|
|
*
|
|
* Note: this method calls `event.waitUntil()` for you, so you do not need
|
|
* to call it yourself in your event handlers.
|
|
*
|
|
* @param {ExtendableEvent} event
|
|
* @return {Promise<module:workbox-precaching.CleanupResult>}
|
|
*/
|
|
activate(event) {
|
|
return waitUntil(event, async () => {
|
|
const cache = await self.caches.open(this.strategy.cacheName);
|
|
const currentlyCachedRequests = await cache.keys();
|
|
const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());
|
|
const deletedURLs = [];
|
|
for (const request of currentlyCachedRequests) {
|
|
if (!expectedCacheKeys.has(request.url)) {
|
|
await cache.delete(request);
|
|
deletedURLs.push(request.url);
|
|
}
|
|
}
|
|
if (false) {}
|
|
return { deletedURLs };
|
|
});
|
|
}
|
|
/**
|
|
* Returns a mapping of a precached URL to the corresponding cache key, taking
|
|
* into account the revision information for the URL.
|
|
*
|
|
* @return {Map<string, string>} A URL to cache key mapping.
|
|
*/
|
|
getURLsToCacheKeys() {
|
|
return this._urlsToCacheKeys;
|
|
}
|
|
/**
|
|
* Returns a list of all the URLs that have been precached by the current
|
|
* service worker.
|
|
*
|
|
* @return {Array<string>} The precached URLs.
|
|
*/
|
|
getCachedURLs() {
|
|
return [...this._urlsToCacheKeys.keys()];
|
|
}
|
|
/**
|
|
* Returns the cache key used for storing a given URL. If that URL is
|
|
* unversioned, like `/index.html', then the cache key will be the original
|
|
* URL with a search parameter appended to it.
|
|
*
|
|
* @param {string} url A URL whose cache key you want to look up.
|
|
* @return {string} The versioned URL that corresponds to a cache key
|
|
* for the original URL, or undefined if that URL isn't precached.
|
|
*/
|
|
getCacheKeyForURL(url) {
|
|
const urlObject = new URL(url, location.href);
|
|
return this._urlsToCacheKeys.get(urlObject.href);
|
|
}
|
|
/**
|
|
* This acts as a drop-in replacement for
|
|
* [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)
|
|
* with the following differences:
|
|
*
|
|
* - It knows what the name of the precache is, and only checks in that cache.
|
|
* - It allows you to pass in an "original" URL without versioning parameters,
|
|
* and it will automatically look up the correct cache key for the currently
|
|
* active revision of that URL.
|
|
*
|
|
* E.g., `matchPrecache('index.html')` will find the correct precached
|
|
* response for the currently active service worker, even if the actual cache
|
|
* key is `'/index.html?__WB_REVISION__=1234abcd'`.
|
|
*
|
|
* @param {string|Request} request The key (without revisioning parameters)
|
|
* to look up in the precache.
|
|
* @return {Promise<Response|undefined>}
|
|
*/
|
|
async matchPrecache(request) {
|
|
const url = request instanceof Request ? request.url : request;
|
|
const cacheKey = this.getCacheKeyForURL(url);
|
|
if (cacheKey) {
|
|
const cache = await self.caches.open(this.strategy.cacheName);
|
|
return cache.match(cacheKey);
|
|
}
|
|
return undefined;
|
|
}
|
|
/**
|
|
* Returns a function that looks up `url` in the precache (taking into
|
|
* account revision information), and returns the corresponding `Response`.
|
|
*
|
|
* @param {string} url The precached URL which will be used to lookup the
|
|
* `Response`.
|
|
* @return {module:workbox-routing~handlerCallback}
|
|
*/
|
|
createHandlerBoundToURL(url) {
|
|
const cacheKey = this.getCacheKeyForURL(url);
|
|
if (!cacheKey) {
|
|
throw new WorkboxError_WorkboxError('non-precached-url', { url });
|
|
}
|
|
return (options) => {
|
|
options.request = new Request(url);
|
|
options.params = { cacheKey, ...options.params };
|
|
return this.strategy.handle(options);
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
let getOrCreatePrecacheController_precacheController;
|
|
/**
|
|
* @return {PrecacheController}
|
|
* @private
|
|
*/
|
|
const getOrCreatePrecacheController = () => {
|
|
if (!getOrCreatePrecacheController_precacheController) {
|
|
getOrCreatePrecacheController_precacheController = new PrecacheController_PrecacheController();
|
|
}
|
|
return getOrCreatePrecacheController_precacheController;
|
|
};
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/addPlugins.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* Adds plugins to the precaching strategy.
|
|
*
|
|
* @param {Array<Object>} plugins
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function addPlugins(plugins) {
|
|
const precacheController = getOrCreatePrecacheController();
|
|
precacheController.strategy.plugins.push(...plugins);
|
|
}
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/workbox-routing/_version.js
|
|
var workbox_routing_version = __webpack_require__("e6d2");
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/utils/constants.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
/**
|
|
* The default HTTP method, 'GET', used when there's no specific method
|
|
* configured for a route.
|
|
*
|
|
* @type {string}
|
|
*
|
|
* @private
|
|
*/
|
|
const defaultMethod = 'GET';
|
|
/**
|
|
* The list of valid HTTP methods associated with requests that could be routed.
|
|
*
|
|
* @type {Array<string>}
|
|
*
|
|
* @private
|
|
*/
|
|
const validMethods = [
|
|
'DELETE',
|
|
'GET',
|
|
'HEAD',
|
|
'PATCH',
|
|
'POST',
|
|
'PUT',
|
|
];
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/utils/normalizeHandler.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* @param {function()|Object} handler Either a function, or an object with a
|
|
* 'handle' method.
|
|
* @return {Object} An object with a handle method.
|
|
*
|
|
* @private
|
|
*/
|
|
const normalizeHandler = (handler) => {
|
|
if (handler && typeof handler === 'object') {
|
|
if (false) {}
|
|
return handler;
|
|
}
|
|
else {
|
|
if (false) {}
|
|
return { handle: handler };
|
|
}
|
|
};
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/Route.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
* A `Route` consists of a pair of callback functions, "match" and "handler".
|
|
* The "match" callback determine if a route should be used to "handle" a
|
|
* request by returning a non-falsy value if it can. The "handler" callback
|
|
* is called when there is a match and should return a Promise that resolves
|
|
* to a `Response`.
|
|
*
|
|
* @memberof module:workbox-routing
|
|
*/
|
|
class Route_Route {
|
|
/**
|
|
* Constructor for Route class.
|
|
*
|
|
* @param {module:workbox-routing~matchCallback} match
|
|
* A callback function that determines whether the route matches a given
|
|
* `fetch` event by returning a non-falsy value.
|
|
* @param {module:workbox-routing~handlerCallback} handler A callback
|
|
* function that returns a Promise resolving to a Response.
|
|
* @param {string} [method='GET'] The HTTP method to match the Route
|
|
* against.
|
|
*/
|
|
constructor(match, handler, method = defaultMethod) {
|
|
if (false) {}
|
|
// These values are referenced directly by Router so cannot be
|
|
// altered by minificaton.
|
|
this.handler = normalizeHandler(handler);
|
|
this.match = match;
|
|
this.method = method;
|
|
}
|
|
/**
|
|
*
|
|
* @param {module:workbox-routing-handlerCallback} handler A callback
|
|
* function that returns a Promise resolving to a Response
|
|
*/
|
|
setCatchHandler(handler) {
|
|
this.catchHandler = normalizeHandler(handler);
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/RegExpRoute.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
* RegExpRoute makes it easy to create a regular expression based
|
|
* [Route]{@link module:workbox-routing.Route}.
|
|
*
|
|
* For same-origin requests the RegExp only needs to match part of the URL. For
|
|
* requests against third-party servers, you must define a RegExp that matches
|
|
* the start of the URL.
|
|
*
|
|
* [See the module docs for info.]{@link https://developers.google.com/web/tools/workbox/modules/workbox-routing}
|
|
*
|
|
* @memberof module:workbox-routing
|
|
* @extends module:workbox-routing.Route
|
|
*/
|
|
class RegExpRoute_RegExpRoute extends Route_Route {
|
|
/**
|
|
* If the regular expression contains
|
|
* [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},
|
|
* the captured values will be passed to the
|
|
* [handler's]{@link module:workbox-routing~handlerCallback} `params`
|
|
* argument.
|
|
*
|
|
* @param {RegExp} regExp The regular expression to match against URLs.
|
|
* @param {module:workbox-routing~handlerCallback} handler A callback
|
|
* function that returns a Promise resulting in a Response.
|
|
* @param {string} [method='GET'] The HTTP method to match the Route
|
|
* against.
|
|
*/
|
|
constructor(regExp, handler, method) {
|
|
if (false) {}
|
|
const match = ({ url }) => {
|
|
const result = regExp.exec(url.href);
|
|
// Return immediately if there's no match.
|
|
if (!result) {
|
|
return;
|
|
}
|
|
// Require that the match start at the first character in the URL string
|
|
// if it's a cross-origin request.
|
|
// See https://github.com/GoogleChrome/workbox/issues/281 for the context
|
|
// behind this behavior.
|
|
if ((url.origin !== location.origin) && (result.index !== 0)) {
|
|
if (false) {}
|
|
return;
|
|
}
|
|
// If the route matches, but there aren't any capture groups defined, then
|
|
// this will return [], which is truthy and therefore sufficient to
|
|
// indicate a match.
|
|
// If there are capture groups, then it will return their values.
|
|
return result.slice(1);
|
|
};
|
|
super(match, handler, method);
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/Router.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* The Router can be used to process a FetchEvent through one or more
|
|
* [Routes]{@link module:workbox-routing.Route} responding with a Request if
|
|
* a matching route exists.
|
|
*
|
|
* If no route matches a given a request, the Router will use a "default"
|
|
* handler if one is defined.
|
|
*
|
|
* Should the matching Route throw an error, the Router will use a "catch"
|
|
* handler if one is defined to gracefully deal with issues and respond with a
|
|
* Request.
|
|
*
|
|
* If a request matches multiple routes, the **earliest** registered route will
|
|
* be used to respond to the request.
|
|
*
|
|
* @memberof module:workbox-routing
|
|
*/
|
|
class Router_Router {
|
|
/**
|
|
* Initializes a new Router.
|
|
*/
|
|
constructor() {
|
|
this._routes = new Map();
|
|
this._defaultHandlerMap = new Map();
|
|
}
|
|
/**
|
|
* @return {Map<string, Array<module:workbox-routing.Route>>} routes A `Map` of HTTP
|
|
* method name ('GET', etc.) to an array of all the corresponding `Route`
|
|
* instances that are registered.
|
|
*/
|
|
get routes() {
|
|
return this._routes;
|
|
}
|
|
/**
|
|
* Adds a fetch event listener to respond to events when a route matches
|
|
* the event's request.
|
|
*/
|
|
addFetchListener() {
|
|
// See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
|
|
self.addEventListener('fetch', ((event) => {
|
|
const { request } = event;
|
|
const responsePromise = this.handleRequest({ request, event });
|
|
if (responsePromise) {
|
|
event.respondWith(responsePromise);
|
|
}
|
|
}));
|
|
}
|
|
/**
|
|
* Adds a message event listener for URLs to cache from the window.
|
|
* This is useful to cache resources loaded on the page prior to when the
|
|
* service worker started controlling it.
|
|
*
|
|
* The format of the message data sent from the window should be as follows.
|
|
* Where the `urlsToCache` array may consist of URL strings or an array of
|
|
* URL string + `requestInit` object (the same as you'd pass to `fetch()`).
|
|
*
|
|
* ```
|
|
* {
|
|
* type: 'CACHE_URLS',
|
|
* payload: {
|
|
* urlsToCache: [
|
|
* './script1.js',
|
|
* './script2.js',
|
|
* ['./script3.js', {mode: 'no-cors'}],
|
|
* ],
|
|
* },
|
|
* }
|
|
* ```
|
|
*/
|
|
addCacheListener() {
|
|
// See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
|
|
self.addEventListener('message', ((event) => {
|
|
if (event.data && event.data.type === 'CACHE_URLS') {
|
|
const { payload } = event.data;
|
|
if (false) {}
|
|
const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {
|
|
if (typeof entry === 'string') {
|
|
entry = [entry];
|
|
}
|
|
const request = new Request(...entry);
|
|
return this.handleRequest({ request, event });
|
|
// TODO(philipwalton): TypeScript errors without this typecast for
|
|
// some reason (probably a bug). The real type here should work but
|
|
// doesn't: `Array<Promise<Response> | undefined>`.
|
|
})); // TypeScript
|
|
event.waitUntil(requestPromises);
|
|
// If a MessageChannel was used, reply to the message on success.
|
|
if (event.ports && event.ports[0]) {
|
|
requestPromises.then(() => event.ports[0].postMessage(true));
|
|
}
|
|
}
|
|
}));
|
|
}
|
|
/**
|
|
* Apply the routing rules to a FetchEvent object to get a Response from an
|
|
* appropriate Route's handler.
|
|
*
|
|
* @param {Object} options
|
|
* @param {Request} options.request The request to handle.
|
|
* @param {ExtendableEvent} options.event The event that triggered the
|
|
* request.
|
|
* @return {Promise<Response>|undefined} A promise is returned if a
|
|
* registered route can handle the request. If there is no matching
|
|
* route and there's no `defaultHandler`, `undefined` is returned.
|
|
*/
|
|
handleRequest({ request, event }) {
|
|
if (false) {}
|
|
const url = new URL(request.url, location.href);
|
|
if (!url.protocol.startsWith('http')) {
|
|
if (false) {}
|
|
return;
|
|
}
|
|
const sameOrigin = url.origin === location.origin;
|
|
const { params, route } = this.findMatchingRoute({
|
|
event,
|
|
request,
|
|
sameOrigin,
|
|
url,
|
|
});
|
|
let handler = route && route.handler;
|
|
const debugMessages = [];
|
|
if (false) {}
|
|
// If we don't have a handler because there was no matching route, then
|
|
// fall back to defaultHandler if that's defined.
|
|
const method = request.method;
|
|
if (!handler && this._defaultHandlerMap.has(method)) {
|
|
if (false) {}
|
|
handler = this._defaultHandlerMap.get(method);
|
|
}
|
|
if (!handler) {
|
|
if (false) {}
|
|
return;
|
|
}
|
|
if (false) {}
|
|
// Wrap in try and catch in case the handle method throws a synchronous
|
|
// error. It should still callback to the catch handler.
|
|
let responsePromise;
|
|
try {
|
|
responsePromise = handler.handle({ url, request, event, params });
|
|
}
|
|
catch (err) {
|
|
responsePromise = Promise.reject(err);
|
|
}
|
|
// Get route's catch handler, if it exists
|
|
const catchHandler = route && route.catchHandler;
|
|
if (responsePromise instanceof Promise && (this._catchHandler || catchHandler)) {
|
|
responsePromise = responsePromise.catch(async (err) => {
|
|
// If there's a route catch handler, process that first
|
|
if (catchHandler) {
|
|
if (false) {}
|
|
try {
|
|
return await catchHandler.handle({ url, request, event, params });
|
|
}
|
|
catch (catchErr) {
|
|
err = catchErr;
|
|
}
|
|
}
|
|
if (this._catchHandler) {
|
|
if (false) {}
|
|
return this._catchHandler.handle({ url, request, event });
|
|
}
|
|
throw err;
|
|
});
|
|
}
|
|
return responsePromise;
|
|
}
|
|
/**
|
|
* Checks a request and URL (and optionally an event) against the list of
|
|
* registered routes, and if there's a match, returns the corresponding
|
|
* route along with any params generated by the match.
|
|
*
|
|
* @param {Object} options
|
|
* @param {URL} options.url
|
|
* @param {boolean} options.sameOrigin The result of comparing `url.origin`
|
|
* against the current origin.
|
|
* @param {Request} options.request The request to match.
|
|
* @param {Event} options.event The corresponding event.
|
|
* @return {Object} An object with `route` and `params` properties.
|
|
* They are populated if a matching route was found or `undefined`
|
|
* otherwise.
|
|
*/
|
|
findMatchingRoute({ url, sameOrigin, request, event }) {
|
|
const routes = this._routes.get(request.method) || [];
|
|
for (const route of routes) {
|
|
let params;
|
|
const matchResult = route.match({ url, sameOrigin, request, event });
|
|
if (matchResult) {
|
|
if (false) {}
|
|
// See https://github.com/GoogleChrome/workbox/issues/2079
|
|
params = matchResult;
|
|
if (Array.isArray(matchResult) && matchResult.length === 0) {
|
|
// Instead of passing an empty array in as params, use undefined.
|
|
params = undefined;
|
|
}
|
|
else if ((matchResult.constructor === Object &&
|
|
Object.keys(matchResult).length === 0)) {
|
|
// Instead of passing an empty object in as params, use undefined.
|
|
params = undefined;
|
|
}
|
|
else if (typeof matchResult === 'boolean') {
|
|
// For the boolean value true (rather than just something truth-y),
|
|
// don't set params.
|
|
// See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353
|
|
params = undefined;
|
|
}
|
|
// Return early if have a match.
|
|
return { route, params };
|
|
}
|
|
}
|
|
// If no match was found above, return and empty object.
|
|
return {};
|
|
}
|
|
/**
|
|
* Define a default `handler` that's called when no routes explicitly
|
|
* match the incoming request.
|
|
*
|
|
* Each HTTP method ('GET', 'POST', etc.) gets its own default handler.
|
|
*
|
|
* Without a default handler, unmatched requests will go against the
|
|
* network as if there were no service worker present.
|
|
*
|
|
* @param {module:workbox-routing~handlerCallback} handler A callback
|
|
* function that returns a Promise resulting in a Response.
|
|
* @param {string} [method='GET'] The HTTP method to associate with this
|
|
* default handler. Each method has its own default.
|
|
*/
|
|
setDefaultHandler(handler, method = defaultMethod) {
|
|
this._defaultHandlerMap.set(method, normalizeHandler(handler));
|
|
}
|
|
/**
|
|
* If a Route throws an error while handling a request, this `handler`
|
|
* will be called and given a chance to provide a response.
|
|
*
|
|
* @param {module:workbox-routing~handlerCallback} handler A callback
|
|
* function that returns a Promise resulting in a Response.
|
|
*/
|
|
setCatchHandler(handler) {
|
|
this._catchHandler = normalizeHandler(handler);
|
|
}
|
|
/**
|
|
* Registers a route with the router.
|
|
*
|
|
* @param {module:workbox-routing.Route} route The route to register.
|
|
*/
|
|
registerRoute(route) {
|
|
if (false) {}
|
|
if (!this._routes.has(route.method)) {
|
|
this._routes.set(route.method, []);
|
|
}
|
|
// Give precedence to all of the earlier routes by adding this additional
|
|
// route to the end of the array.
|
|
this._routes.get(route.method).push(route);
|
|
}
|
|
/**
|
|
* Unregisters a route with the router.
|
|
*
|
|
* @param {module:workbox-routing.Route} route The route to unregister.
|
|
*/
|
|
unregisterRoute(route) {
|
|
if (!this._routes.has(route.method)) {
|
|
throw new WorkboxError_WorkboxError('unregister-route-but-not-found-with-method', {
|
|
method: route.method,
|
|
});
|
|
}
|
|
const routeIndex = this._routes.get(route.method).indexOf(route);
|
|
if (routeIndex > -1) {
|
|
this._routes.get(route.method).splice(routeIndex, 1);
|
|
}
|
|
else {
|
|
throw new WorkboxError_WorkboxError('unregister-route-route-not-registered');
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
let getOrCreateDefaultRouter_defaultRouter;
|
|
/**
|
|
* Creates a new, singleton Router instance if one does not exist. If one
|
|
* does already exist, that instance is returned.
|
|
*
|
|
* @private
|
|
* @return {Router}
|
|
*/
|
|
const getOrCreateDefaultRouter = () => {
|
|
if (!getOrCreateDefaultRouter_defaultRouter) {
|
|
getOrCreateDefaultRouter_defaultRouter = new Router_Router();
|
|
// The helpers that use the default Router assume these listeners exist.
|
|
getOrCreateDefaultRouter_defaultRouter.addFetchListener();
|
|
getOrCreateDefaultRouter_defaultRouter.addCacheListener();
|
|
}
|
|
return getOrCreateDefaultRouter_defaultRouter;
|
|
};
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/registerRoute.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Easily register a RegExp, string, or function with a caching
|
|
* strategy to a singleton Router instance.
|
|
*
|
|
* This method will generate a Route for you if needed and
|
|
* call [registerRoute()]{@link module:workbox-routing.Router#registerRoute}.
|
|
*
|
|
* @param {RegExp|string|module:workbox-routing.Route~matchCallback|module:workbox-routing.Route} capture
|
|
* If the capture param is a `Route`, all other arguments will be ignored.
|
|
* @param {module:workbox-routing~handlerCallback} [handler] A callback
|
|
* function that returns a Promise resulting in a Response. This parameter
|
|
* is required if `capture` is not a `Route` object.
|
|
* @param {string} [method='GET'] The HTTP method to match the Route
|
|
* against.
|
|
* @return {module:workbox-routing.Route} The generated `Route`(Useful for
|
|
* unregistering).
|
|
*
|
|
* @memberof module:workbox-routing
|
|
*/
|
|
function registerRoute(capture, handler, method) {
|
|
let route;
|
|
if (typeof capture === 'string') {
|
|
const captureUrl = new URL(capture, location.href);
|
|
if (false) {}
|
|
const matchCallback = ({ url }) => {
|
|
if (false) {}
|
|
return url.href === captureUrl.href;
|
|
};
|
|
// If `capture` is a string then `handler` and `method` must be present.
|
|
route = new Route_Route(matchCallback, handler, method);
|
|
}
|
|
else if (capture instanceof RegExp) {
|
|
// If `capture` is a `RegExp` then `handler` and `method` must be present.
|
|
route = new RegExpRoute_RegExpRoute(capture, handler, method);
|
|
}
|
|
else if (typeof capture === 'function') {
|
|
// If `capture` is a function then `handler` and `method` must be present.
|
|
route = new Route_Route(capture, handler, method);
|
|
}
|
|
else if (capture instanceof Route_Route) {
|
|
route = capture;
|
|
}
|
|
else {
|
|
throw new WorkboxError_WorkboxError('unsupported-route-type', {
|
|
moduleName: 'workbox-routing',
|
|
funcName: 'registerRoute',
|
|
paramName: 'capture',
|
|
});
|
|
}
|
|
const defaultRouter = getOrCreateDefaultRouter();
|
|
defaultRouter.registerRoute(route);
|
|
return route;
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
/**
|
|
* Removes any URL search parameters that should be ignored.
|
|
*
|
|
* @param {URL} urlObject The original URL.
|
|
* @param {Array<RegExp>} ignoreURLParametersMatching RegExps to test against
|
|
* each search parameter name. Matches mean that the search parameter should be
|
|
* ignored.
|
|
* @return {URL} The URL with any ignored search parameters removed.
|
|
*
|
|
* @private
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {
|
|
// Convert the iterable into an array at the start of the loop to make sure
|
|
// deletion doesn't mess up iteration.
|
|
for (const paramName of [...urlObject.searchParams.keys()]) {
|
|
if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {
|
|
urlObject.searchParams.delete(paramName);
|
|
}
|
|
}
|
|
return urlObject;
|
|
}
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/utils/generateURLVariations.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* Generator function that yields possible variations on the original URL to
|
|
* check, one at a time.
|
|
*
|
|
* @param {string} url
|
|
* @param {Object} options
|
|
*
|
|
* @private
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {
|
|
const urlObject = new URL(url, location.href);
|
|
urlObject.hash = '';
|
|
yield urlObject.href;
|
|
const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);
|
|
yield urlWithoutIgnoredParams.href;
|
|
if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {
|
|
const directoryURL = new URL(urlWithoutIgnoredParams.href);
|
|
directoryURL.pathname += directoryIndex;
|
|
yield directoryURL.href;
|
|
}
|
|
if (cleanURLs) {
|
|
const cleanURL = new URL(urlWithoutIgnoredParams.href);
|
|
cleanURL.pathname += '.html';
|
|
yield cleanURL.href;
|
|
}
|
|
if (urlManipulation) {
|
|
const additionalURLs = urlManipulation({ url: urlObject });
|
|
for (const urlToAttempt of additionalURLs) {
|
|
yield urlToAttempt.href;
|
|
}
|
|
}
|
|
}
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/PrecacheRoute.js
|
|
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* A subclass of [Route]{@link module:workbox-routing.Route} that takes a
|
|
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
|
|
* instance and uses it to match incoming requests and handle fetching
|
|
* responses from the precache.
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
* @extends module:workbox-routing.Route
|
|
*/
|
|
class PrecacheRoute_PrecacheRoute extends Route_Route {
|
|
/**
|
|
* @param {PrecacheController} precacheController A `PrecacheController`
|
|
* instance used to both match requests and respond to fetch events.
|
|
* @param {Object} [options] Options to control how requests are matched
|
|
* against the list of precached URLs.
|
|
* @param {string} [options.directoryIndex=index.html] The `directoryIndex` will
|
|
* check cache entries for a URLs ending with '/' to see if there is a hit when
|
|
* appending the `directoryIndex` value.
|
|
* @param {Array<RegExp>} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An
|
|
* array of regex's to remove search params when looking for a cache match.
|
|
* @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will
|
|
* check the cache for the URL with a `.html` added to the end of the end.
|
|
* @param {module:workbox-precaching~urlManipulation} [options.urlManipulation]
|
|
* This is a function that should take a URL and return an array of
|
|
* alternative URLs that should be checked for precache matches.
|
|
*/
|
|
constructor(precacheController, options) {
|
|
const match = ({ request }) => {
|
|
const urlsToCacheKeys = precacheController.getURLsToCacheKeys();
|
|
for (const possibleURL of generateURLVariations(request.url, options)) {
|
|
const cacheKey = urlsToCacheKeys.get(possibleURL);
|
|
if (cacheKey) {
|
|
return { cacheKey };
|
|
}
|
|
}
|
|
if (false) {}
|
|
return;
|
|
};
|
|
super(match, precacheController.strategy);
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/addRoute.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Add a `fetch` listener to the service worker that will
|
|
* respond to
|
|
* [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}
|
|
* with precached assets.
|
|
*
|
|
* Requests for assets that aren't precached, the `FetchEvent` will not be
|
|
* responded to, allowing the event to fall through to other `fetch` event
|
|
* listeners.
|
|
*
|
|
* @param {Object} [options] See
|
|
* [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function addRoute(options) {
|
|
const precacheController = getOrCreatePrecacheController();
|
|
const precacheRoute = new PrecacheRoute_PrecacheRoute(precacheController, options);
|
|
registerRoute(precacheRoute);
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/utils/deleteOutdatedCaches.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
const SUBSTRING_TO_FIND = '-precache-';
|
|
/**
|
|
* Cleans up incompatible precaches that were created by older versions of
|
|
* Workbox, by a service worker registered under the current scope.
|
|
*
|
|
* This is meant to be called as part of the `activate` event.
|
|
*
|
|
* This should be safe to use as long as you don't include `substringToFind`
|
|
* (defaulting to `-precache-`) in your non-precache cache names.
|
|
*
|
|
* @param {string} currentPrecacheName The cache name currently in use for
|
|
* precaching. This cache won't be deleted.
|
|
* @param {string} [substringToFind='-precache-'] Cache names which include this
|
|
* substring will be deleted (excluding `currentPrecacheName`).
|
|
* @return {Array<string>} A list of all the cache names that were deleted.
|
|
*
|
|
* @private
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
const deleteOutdatedCaches = async (currentPrecacheName, substringToFind = SUBSTRING_TO_FIND) => {
|
|
const cacheNames = await self.caches.keys();
|
|
const cacheNamesToDelete = cacheNames.filter((cacheName) => {
|
|
return cacheName.includes(substringToFind) &&
|
|
cacheName.includes(self.registration.scope) &&
|
|
cacheName !== currentPrecacheName;
|
|
});
|
|
await Promise.all(cacheNamesToDelete.map((cacheName) => self.caches.delete(cacheName)));
|
|
return cacheNamesToDelete;
|
|
};
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/cleanupOutdatedCaches.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Adds an `activate` event listener which will clean up incompatible
|
|
* precaches that were created by older versions of Workbox.
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function cleanupOutdatedCaches() {
|
|
// See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705
|
|
self.addEventListener('activate', ((event) => {
|
|
const cacheName = cacheNames.getPrecacheName();
|
|
event.waitUntil(deleteOutdatedCaches(cacheName).then((cachesDeleted) => {
|
|
if (false) {}
|
|
}));
|
|
}));
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/createHandlerBoundToURL.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* Helper function that calls
|
|
* {@link PrecacheController#createHandlerBoundToURL} on the default
|
|
* {@link PrecacheController} instance.
|
|
*
|
|
* If you are creating your own {@link PrecacheController}, then call the
|
|
* {@link PrecacheController#createHandlerBoundToURL} on that instance,
|
|
* instead of using this function.
|
|
*
|
|
* @param {string} url The precached URL which will be used to lookup the
|
|
* `Response`.
|
|
* @param {boolean} [fallbackToNetwork=true] Whether to attempt to get the
|
|
* response from the network if there's a precache miss.
|
|
* @return {module:workbox-routing~handlerCallback}
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function createHandlerBoundToURL(url) {
|
|
const precacheController = getOrCreatePrecacheController();
|
|
return precacheController.createHandlerBoundToURL(url);
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/getCacheKeyForURL.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* Takes in a URL, and returns the corresponding URL that could be used to
|
|
* lookup the entry in the precache.
|
|
*
|
|
* If a relative URL is provided, the location of the service worker file will
|
|
* be used as the base.
|
|
*
|
|
* For precached entries without revision information, the cache key will be the
|
|
* same as the original URL.
|
|
*
|
|
* For precached entries with revision information, the cache key will be the
|
|
* original URL with the addition of a query parameter used for keeping track of
|
|
* the revision info.
|
|
*
|
|
* @param {string} url The URL whose cache key to look up.
|
|
* @return {string} The cache key that corresponds to that URL.
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function getCacheKeyForURL(url) {
|
|
const precacheController = getOrCreatePrecacheController();
|
|
return precacheController.getCacheKeyForURL(url);
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/matchPrecache.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* Helper function that calls
|
|
* {@link PrecacheController#matchPrecache} on the default
|
|
* {@link PrecacheController} instance.
|
|
*
|
|
* If you are creating your own {@link PrecacheController}, then call
|
|
* {@link PrecacheController#matchPrecache} on that instance,
|
|
* instead of using this function.
|
|
*
|
|
* @param {string|Request} request The key (without revisioning parameters)
|
|
* to look up in the precache.
|
|
* @return {Promise<Response|undefined>}
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function matchPrecache(request) {
|
|
const precacheController = getOrCreatePrecacheController();
|
|
return precacheController.matchPrecache(request);
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/precache.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* Adds items to the precache list, removing any duplicates and
|
|
* stores the files in the
|
|
* ["precache cache"]{@link module:workbox-core.cacheNames} when the service
|
|
* worker installs.
|
|
*
|
|
* This method can be called multiple times.
|
|
*
|
|
* Please note: This method **will not** serve any of the cached files for you.
|
|
* It only precaches files. To respond to a network request you call
|
|
* [addRoute()]{@link module:workbox-precaching.addRoute}.
|
|
*
|
|
* If you have a single array of files to precache, you can just call
|
|
* [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}.
|
|
*
|
|
* @param {Array<Object|string>} [entries=[]] Array of entries to precache.
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function precache(entries) {
|
|
const precacheController = getOrCreatePrecacheController();
|
|
precacheController.precache(entries);
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/precacheAndRoute.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
* This method will add entries to the precache list and add a route to
|
|
* respond to fetch events.
|
|
*
|
|
* This is a convenience method that will call
|
|
* [precache()]{@link module:workbox-precaching.precache} and
|
|
* [addRoute()]{@link module:workbox-precaching.addRoute} in a single call.
|
|
*
|
|
* @param {Array<Object|string>} entries Array of entries to precache.
|
|
* @param {Object} [options] See
|
|
* [PrecacheRoute options]{@link module:workbox-precaching.PrecacheRoute}.
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
function precacheAndRoute(entries, options) {
|
|
precache(entries);
|
|
addRoute(options);
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/PrecacheFallbackPlugin.js
|
|
/*
|
|
Copyright 2020 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* `PrecacheFallbackPlugin` allows you to specify an "offline fallback"
|
|
* response to be used when a given strategy is unable to generate a response.
|
|
*
|
|
* It does this by intercepting the `handlerDidError` plugin callback
|
|
* and returning a precached response, taking the expected revision parameter
|
|
* into account automatically.
|
|
*
|
|
* Unless you explicitly pass in a `PrecacheController` instance to the
|
|
* constructor, the default instance will be used. Generally speaking, most
|
|
* developers will end up using the default.
|
|
*
|
|
* @memberof module:workbox-precaching
|
|
*/
|
|
class PrecacheFallbackPlugin_PrecacheFallbackPlugin {
|
|
/**
|
|
* Constructs a new PrecacheFallbackPlugin with the associated fallbackURL.
|
|
*
|
|
* @param {Object} config
|
|
* @param {string} config.fallbackURL A precached URL to use as the fallback
|
|
* if the associated strategy can't generate a response.
|
|
* @param {PrecacheController} [config.precacheController] An optional
|
|
* PrecacheController instance. If not provided, the default
|
|
* PrecacheController will be used.
|
|
*/
|
|
constructor({ fallbackURL, precacheController }) {
|
|
/**
|
|
* @return {Promise<Response>} The precache response for the fallback URL.
|
|
*
|
|
* @private
|
|
*/
|
|
this.handlerDidError = () => this._precacheController.matchPrecache(this._fallbackURL);
|
|
this._fallbackURL = fallbackURL;
|
|
this._precacheController = precacheController ||
|
|
getOrCreatePrecacheController();
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/index.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Most consumers of this module will want to use the
|
|
* [precacheAndRoute()]{@link module:workbox-precaching.precacheAndRoute}
|
|
* method to add assets to the cache and respond to network requests with these
|
|
* cached assets.
|
|
*
|
|
* If you require more control over caching and routing, you can use the
|
|
* [PrecacheController]{@link module:workbox-precaching.PrecacheController}
|
|
* interface.
|
|
*
|
|
* @module workbox-precaching
|
|
*/
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-precaching/index.mjs
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/NavigationRoute.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
* NavigationRoute makes it easy to create a
|
|
* [Route]{@link module:workbox-routing.Route} that matches for browser
|
|
* [navigation requests]{@link https://developers.google.com/web/fundamentals/primers/service-workers/high-performance-loading#first_what_are_navigation_requests}.
|
|
*
|
|
* It will only match incoming Requests whose
|
|
* [`mode`]{@link https://fetch.spec.whatwg.org/#concept-request-mode}
|
|
* is set to `navigate`.
|
|
*
|
|
* You can optionally only apply this route to a subset of navigation requests
|
|
* by using one or both of the `denylist` and `allowlist` parameters.
|
|
*
|
|
* @memberof module:workbox-routing
|
|
* @extends module:workbox-routing.Route
|
|
*/
|
|
class NavigationRoute_NavigationRoute extends Route_Route {
|
|
/**
|
|
* If both `denylist` and `allowlist` are provided, the `denylist` will
|
|
* take precedence and the request will not match this route.
|
|
*
|
|
* The regular expressions in `allowlist` and `denylist`
|
|
* are matched against the concatenated
|
|
* [`pathname`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/pathname}
|
|
* and [`search`]{@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search}
|
|
* portions of the requested URL.
|
|
*
|
|
* @param {module:workbox-routing~handlerCallback} handler A callback
|
|
* function that returns a Promise resulting in a Response.
|
|
* @param {Object} options
|
|
* @param {Array<RegExp>} [options.denylist] If any of these patterns match,
|
|
* the route will not handle the request (even if a allowlist RegExp matches).
|
|
* @param {Array<RegExp>} [options.allowlist=[/./]] If any of these patterns
|
|
* match the URL's pathname and search parameter, the route will handle the
|
|
* request (assuming the denylist doesn't match).
|
|
*/
|
|
constructor(handler, { allowlist = [/./], denylist = [] } = {}) {
|
|
if (false) {}
|
|
super((options) => this._match(options), handler);
|
|
this._allowlist = allowlist;
|
|
this._denylist = denylist;
|
|
}
|
|
/**
|
|
* Routes match handler.
|
|
*
|
|
* @param {Object} options
|
|
* @param {URL} options.url
|
|
* @param {Request} options.request
|
|
* @return {boolean}
|
|
*
|
|
* @private
|
|
*/
|
|
_match({ url, request }) {
|
|
if (request && request.mode !== 'navigate') {
|
|
return false;
|
|
}
|
|
const pathnameAndSearch = url.pathname + url.search;
|
|
for (const regExp of this._denylist) {
|
|
if (regExp.test(pathnameAndSearch)) {
|
|
if (false) {}
|
|
return false;
|
|
}
|
|
}
|
|
if (this._allowlist.some((regExp) => regExp.test(pathnameAndSearch))) {
|
|
if (false) {}
|
|
return true;
|
|
}
|
|
if (false) {}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/setCatchHandler.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* If a Route throws an error while handling a request, this `handler`
|
|
* will be called and given a chance to provide a response.
|
|
*
|
|
* @param {module:workbox-routing~handlerCallback} handler A callback
|
|
* function that returns a Promise resulting in a Response.
|
|
*
|
|
* @memberof module:workbox-routing
|
|
*/
|
|
function setCatchHandler(handler) {
|
|
const defaultRouter = getOrCreateDefaultRouter();
|
|
defaultRouter.setCatchHandler(handler);
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/setDefaultHandler.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
/**
|
|
* Define a default `handler` that's called when no routes explicitly
|
|
* match the incoming request.
|
|
*
|
|
* Without a default handler, unmatched requests will go against the
|
|
* network as if there were no service worker present.
|
|
*
|
|
* @param {module:workbox-routing~handlerCallback} handler A callback
|
|
* function that returns a Promise resulting in a Response.
|
|
*
|
|
* @memberof module:workbox-routing
|
|
*/
|
|
function setDefaultHandler(handler) {
|
|
const defaultRouter = getOrCreateDefaultRouter();
|
|
defaultRouter.setDefaultHandler(handler);
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/index.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* @module workbox-routing
|
|
*/
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-routing/index.mjs
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/utils/messages.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
const messages_messages = {
|
|
strategyStart: (strategyName, request) => `Using ${strategyName} to respond to '${getFriendlyURL(request.url)}'`,
|
|
printFinalResponse: (response) => {
|
|
if (response) {
|
|
logger.groupCollapsed(`View the final response here.`);
|
|
logger.log(response || '[No response returned]');
|
|
logger.groupEnd();
|
|
}
|
|
},
|
|
};
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/CacheFirst.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* An implementation of a [cache-first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-falling-back-to-network}
|
|
* request strategy.
|
|
*
|
|
* A cache first strategy is useful for assets that have been revisioned,
|
|
* such as URLs like `/styles/example.a8f5f1.css`, since they
|
|
* can be cached for long periods of time.
|
|
*
|
|
* If the network request fails, and there is no cache match, this will throw
|
|
* a `WorkboxError` exception.
|
|
*
|
|
* @extends module:workbox-strategies.Strategy
|
|
* @memberof module:workbox-strategies
|
|
*/
|
|
class CacheFirst_CacheFirst extends Strategy_Strategy {
|
|
/**
|
|
* @private
|
|
* @param {Request|string} request A request to run this strategy for.
|
|
* @param {module:workbox-strategies.StrategyHandler} handler The event that
|
|
* triggered the request.
|
|
* @return {Promise<Response>}
|
|
*/
|
|
async _handle(request, handler) {
|
|
const logs = [];
|
|
if (false) {}
|
|
let response = await handler.cacheMatch(request);
|
|
let error;
|
|
if (!response) {
|
|
if (false) {}
|
|
try {
|
|
response = await handler.fetchAndCachePut(request);
|
|
}
|
|
catch (err) {
|
|
error = err;
|
|
}
|
|
if (false) {}
|
|
}
|
|
else {
|
|
if (false) {}
|
|
}
|
|
if (false) {}
|
|
if (!response) {
|
|
throw new WorkboxError_WorkboxError('no-response', { url: request.url, error });
|
|
}
|
|
return response;
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/CacheOnly.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* An implementation of a
|
|
* [cache-only]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-only}
|
|
* request strategy.
|
|
*
|
|
* This class is useful if you want to take advantage of any
|
|
* [Workbox plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}.
|
|
*
|
|
* If there is no cache match, this will throw a `WorkboxError` exception.
|
|
*
|
|
* @extends module:workbox-strategies.Strategy
|
|
* @memberof module:workbox-strategies
|
|
*/
|
|
class CacheOnly_CacheOnly extends Strategy_Strategy {
|
|
/**
|
|
* @private
|
|
* @param {Request|string} request A request to run this strategy for.
|
|
* @param {module:workbox-strategies.StrategyHandler} handler The event that
|
|
* triggered the request.
|
|
* @return {Promise<Response>}
|
|
*/
|
|
async _handle(request, handler) {
|
|
if (false) {}
|
|
const response = await handler.cacheMatch(request);
|
|
if (false) {}
|
|
if (!response) {
|
|
throw new WorkboxError_WorkboxError('no-response', { url: request.url });
|
|
}
|
|
return response;
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
const cacheOkAndOpaquePlugin = {
|
|
/**
|
|
* Returns a valid response (to allow caching) if the status is 200 (OK) or
|
|
* 0 (opaque).
|
|
*
|
|
* @param {Object} options
|
|
* @param {Response} options.response
|
|
* @return {Response|null}
|
|
*
|
|
* @private
|
|
*/
|
|
cacheWillUpdate: async ({ response }) => {
|
|
if (response.status === 200 || response.status === 0) {
|
|
return response;
|
|
}
|
|
return null;
|
|
},
|
|
};
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/NetworkFirst.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* An implementation of a
|
|
* [network first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#network-falling-back-to-cache}
|
|
* request strategy.
|
|
*
|
|
* By default, this strategy will cache responses with a 200 status code as
|
|
* well as [opaque responses]{@link https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests}.
|
|
* Opaque responses are are cross-origin requests where the response doesn't
|
|
* support [CORS]{@link https://enable-cors.org/}.
|
|
*
|
|
* If the network request fails, and there is no cache match, this will throw
|
|
* a `WorkboxError` exception.
|
|
*
|
|
* @extends module:workbox-strategies.Strategy
|
|
* @memberof module:workbox-strategies
|
|
*/
|
|
class NetworkFirst_NetworkFirst extends Strategy_Strategy {
|
|
/**
|
|
* @param {Object} [options]
|
|
* @param {string} [options.cacheName] Cache name to store and retrieve
|
|
* requests. Defaults to cache names provided by
|
|
* [workbox-core]{@link module:workbox-core.cacheNames}.
|
|
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
|
|
* to use in conjunction with this caching strategy.
|
|
* @param {Object} [options.fetchOptions] Values passed along to the
|
|
* [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
|
|
* of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
|
|
* `fetch()` requests made by this strategy.
|
|
* @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
|
|
* @param {number} [options.networkTimeoutSeconds] If set, any network requests
|
|
* that fail to respond within the timeout will fallback to the cache.
|
|
*
|
|
* This option can be used to combat
|
|
* "[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}"
|
|
* scenarios.
|
|
*/
|
|
constructor(options = {}) {
|
|
super(options);
|
|
// If this instance contains no plugins with a 'cacheWillUpdate' callback,
|
|
// prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.
|
|
if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {
|
|
this.plugins.unshift(cacheOkAndOpaquePlugin);
|
|
}
|
|
this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;
|
|
if (false) {}
|
|
}
|
|
/**
|
|
* @private
|
|
* @param {Request|string} request A request to run this strategy for.
|
|
* @param {module:workbox-strategies.StrategyHandler} handler The event that
|
|
* triggered the request.
|
|
* @return {Promise<Response>}
|
|
*/
|
|
async _handle(request, handler) {
|
|
const logs = [];
|
|
if (false) {}
|
|
const promises = [];
|
|
let timeoutId;
|
|
if (this._networkTimeoutSeconds) {
|
|
const { id, promise } = this._getTimeoutPromise({ request, logs, handler });
|
|
timeoutId = id;
|
|
promises.push(promise);
|
|
}
|
|
const networkPromise = this._getNetworkPromise({ timeoutId, request, logs, handler });
|
|
promises.push(networkPromise);
|
|
const response = await handler.waitUntil((async () => {
|
|
// Promise.race() will resolve as soon as the first promise resolves.
|
|
return await handler.waitUntil(Promise.race(promises)) ||
|
|
// If Promise.race() resolved with null, it might be due to a network
|
|
// timeout + a cache miss. If that were to happen, we'd rather wait until
|
|
// the networkPromise resolves instead of returning null.
|
|
// Note that it's fine to await an already-resolved promise, so we don't
|
|
// have to check to see if it's still "in flight".
|
|
await networkPromise;
|
|
})());
|
|
if (false) {}
|
|
if (!response) {
|
|
throw new WorkboxError_WorkboxError('no-response', { url: request.url });
|
|
}
|
|
return response;
|
|
}
|
|
/**
|
|
* @param {Object} options
|
|
* @param {Request} options.request
|
|
* @param {Array} options.logs A reference to the logs array
|
|
* @param {Event} options.event
|
|
* @return {Promise<Response>}
|
|
*
|
|
* @private
|
|
*/
|
|
_getTimeoutPromise({ request, logs, handler }) {
|
|
let timeoutId;
|
|
const timeoutPromise = new Promise((resolve) => {
|
|
const onNetworkTimeout = async () => {
|
|
if (false) {}
|
|
resolve(await handler.cacheMatch(request));
|
|
};
|
|
timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);
|
|
});
|
|
return {
|
|
promise: timeoutPromise,
|
|
id: timeoutId,
|
|
};
|
|
}
|
|
/**
|
|
* @param {Object} options
|
|
* @param {number|undefined} options.timeoutId
|
|
* @param {Request} options.request
|
|
* @param {Array} options.logs A reference to the logs Array.
|
|
* @param {Event} options.event
|
|
* @return {Promise<Response>}
|
|
*
|
|
* @private
|
|
*/
|
|
async _getNetworkPromise({ timeoutId, request, logs, handler }) {
|
|
let error;
|
|
let response;
|
|
try {
|
|
response = await handler.fetchAndCachePut(request);
|
|
}
|
|
catch (fetchError) {
|
|
error = fetchError;
|
|
}
|
|
if (timeoutId) {
|
|
clearTimeout(timeoutId);
|
|
}
|
|
if (false) {}
|
|
if (error || !response) {
|
|
response = await handler.cacheMatch(request);
|
|
if (false) {}
|
|
}
|
|
return response;
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/NetworkOnly.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* An implementation of a
|
|
* [network-only]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#network-only}
|
|
* request strategy.
|
|
*
|
|
* This class is useful if you want to take advantage of any
|
|
* [Workbox plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}.
|
|
*
|
|
* If the network request fails, this will throw a `WorkboxError` exception.
|
|
*
|
|
* @extends module:workbox-strategies.Strategy
|
|
* @memberof module:workbox-strategies
|
|
*/
|
|
class NetworkOnly_NetworkOnly extends Strategy_Strategy {
|
|
/**
|
|
* @param {Object} [options]
|
|
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
|
|
* to use in conjunction with this caching strategy.
|
|
* @param {Object} [options.fetchOptions] Values passed along to the
|
|
* [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
|
|
* of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
|
|
* `fetch()` requests made by this strategy.
|
|
* @param {number} [options.networkTimeoutSeconds] If set, any network requests
|
|
* that fail to respond within the timeout will result in a network error.
|
|
*/
|
|
constructor(options = {}) {
|
|
super(options);
|
|
this._networkTimeoutSeconds = options.networkTimeoutSeconds || 0;
|
|
}
|
|
/**
|
|
* @private
|
|
* @param {Request|string} request A request to run this strategy for.
|
|
* @param {module:workbox-strategies.StrategyHandler} handler The event that
|
|
* triggered the request.
|
|
* @return {Promise<Response>}
|
|
*/
|
|
async _handle(request, handler) {
|
|
if (false) {}
|
|
let error = undefined;
|
|
let response;
|
|
try {
|
|
const promises = [handler.fetch(request)];
|
|
if (this._networkTimeoutSeconds) {
|
|
const timeoutPromise = timeout(this._networkTimeoutSeconds * 1000);
|
|
promises.push(timeoutPromise);
|
|
}
|
|
response = await Promise.race(promises);
|
|
if (!response) {
|
|
throw new Error(`Timed out the network response after ` +
|
|
`${this._networkTimeoutSeconds} seconds.`);
|
|
}
|
|
}
|
|
catch (err) {
|
|
error = err;
|
|
}
|
|
if (false) {}
|
|
if (!response) {
|
|
throw new WorkboxError_WorkboxError('no-response', { url: request.url, error });
|
|
}
|
|
return response;
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/StaleWhileRevalidate.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* An implementation of a
|
|
* [stale-while-revalidate]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#stale-while-revalidate}
|
|
* request strategy.
|
|
*
|
|
* Resources are requested from both the cache and the network in parallel.
|
|
* The strategy will respond with the cached version if available, otherwise
|
|
* wait for the network response. The cache is updated with the network response
|
|
* with each successful request.
|
|
*
|
|
* By default, this strategy will cache responses with a 200 status code as
|
|
* well as [opaque responses]{@link https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests}.
|
|
* Opaque responses are cross-origin requests where the response doesn't
|
|
* support [CORS]{@link https://enable-cors.org/}.
|
|
*
|
|
* If the network request fails, and there is no cache match, this will throw
|
|
* a `WorkboxError` exception.
|
|
*
|
|
* @extends module:workbox-strategies.Strategy
|
|
* @memberof module:workbox-strategies
|
|
*/
|
|
class StaleWhileRevalidate_StaleWhileRevalidate extends Strategy_Strategy {
|
|
/**
|
|
* @param {Object} [options]
|
|
* @param {string} [options.cacheName] Cache name to store and retrieve
|
|
* requests. Defaults to cache names provided by
|
|
* [workbox-core]{@link module:workbox-core.cacheNames}.
|
|
* @param {Array<Object>} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}
|
|
* to use in conjunction with this caching strategy.
|
|
* @param {Object} [options.fetchOptions] Values passed along to the
|
|
* [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)
|
|
* of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)
|
|
* `fetch()` requests made by this strategy.
|
|
* @param {Object} [options.matchOptions] [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)
|
|
*/
|
|
constructor(options) {
|
|
super(options);
|
|
// If this instance contains no plugins with a 'cacheWillUpdate' callback,
|
|
// prepend the `cacheOkAndOpaquePlugin` plugin to the plugins list.
|
|
if (!this.plugins.some((p) => 'cacheWillUpdate' in p)) {
|
|
this.plugins.unshift(cacheOkAndOpaquePlugin);
|
|
}
|
|
}
|
|
/**
|
|
* @private
|
|
* @param {Request|string} request A request to run this strategy for.
|
|
* @param {module:workbox-strategies.StrategyHandler} handler The event that
|
|
* triggered the request.
|
|
* @return {Promise<Response>}
|
|
*/
|
|
async _handle(request, handler) {
|
|
const logs = [];
|
|
if (false) {}
|
|
const fetchAndCachePromise = handler
|
|
.fetchAndCachePut(request)
|
|
.catch(() => {
|
|
// Swallow this error because a 'no-response' error will be thrown in
|
|
// main handler return flow. This will be in the `waitUntil()` flow.
|
|
});
|
|
let response = await handler.cacheMatch(request);
|
|
let error;
|
|
if (response) {
|
|
if (false) {}
|
|
}
|
|
else {
|
|
if (false) {}
|
|
try {
|
|
// NOTE(philipwalton): Really annoying that we have to type cast here.
|
|
// https://github.com/microsoft/TypeScript/issues/20006
|
|
response = await fetchAndCachePromise;
|
|
}
|
|
catch (err) {
|
|
error = err;
|
|
}
|
|
}
|
|
if (false) {}
|
|
if (!response) {
|
|
throw new WorkboxError_WorkboxError('no-response', { url: request.url, error });
|
|
}
|
|
return response;
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/index.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* There are common caching strategies that most service workers will need
|
|
* and use. This module provides simple implementations of these strategies.
|
|
*
|
|
* @module workbox-strategies
|
|
*/
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-strategies/index.mjs
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/dontWaitFor.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
/**
|
|
* A helper function that prevents a promise from being flagged as unused.
|
|
*
|
|
* @private
|
|
**/
|
|
function dontWaitFor(promise) {
|
|
// Effective no-op.
|
|
promise.then(() => { });
|
|
}
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/DBWrapper.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
/**
|
|
* A class that wraps common IndexedDB functionality in a promise-based API.
|
|
* It exposes all the underlying power and functionality of IndexedDB, but
|
|
* wraps the most commonly used features in a way that's much simpler to use.
|
|
*
|
|
* @private
|
|
*/
|
|
class DBWrapper {
|
|
/**
|
|
* @param {string} name
|
|
* @param {number} version
|
|
* @param {Object=} [callback]
|
|
* @param {!Function} [callbacks.onupgradeneeded]
|
|
* @param {!Function} [callbacks.onversionchange] Defaults to
|
|
* DBWrapper.prototype._onversionchange when not specified.
|
|
* @private
|
|
*/
|
|
constructor(name, version, { onupgradeneeded, onversionchange, } = {}) {
|
|
this._db = null;
|
|
this._name = name;
|
|
this._version = version;
|
|
this._onupgradeneeded = onupgradeneeded;
|
|
this._onversionchange = onversionchange || (() => this.close());
|
|
}
|
|
/**
|
|
* Returns the IDBDatabase instance (not normally needed).
|
|
* @return {IDBDatabase|undefined}
|
|
*
|
|
* @private
|
|
*/
|
|
get db() {
|
|
return this._db;
|
|
}
|
|
/**
|
|
* Opens a connected to an IDBDatabase, invokes any onupgradedneeded
|
|
* callback, and added an onversionchange callback to the database.
|
|
*
|
|
* @return {IDBDatabase}
|
|
* @private
|
|
*/
|
|
async open() {
|
|
if (this._db)
|
|
return;
|
|
this._db = await new Promise((resolve, reject) => {
|
|
// This flag is flipped to true if the timeout callback runs prior
|
|
// to the request failing or succeeding. Note: we use a timeout instead
|
|
// of an onblocked handler since there are cases where onblocked will
|
|
// never never run. A timeout better handles all possible scenarios:
|
|
// https://github.com/w3c/IndexedDB/issues/223
|
|
let openRequestTimedOut = false;
|
|
setTimeout(() => {
|
|
openRequestTimedOut = true;
|
|
reject(new Error('The open request was blocked and timed out'));
|
|
}, this.OPEN_TIMEOUT);
|
|
const openRequest = indexedDB.open(this._name, this._version);
|
|
openRequest.onerror = () => reject(openRequest.error);
|
|
openRequest.onupgradeneeded = (evt) => {
|
|
if (openRequestTimedOut) {
|
|
openRequest.transaction.abort();
|
|
openRequest.result.close();
|
|
}
|
|
else if (typeof this._onupgradeneeded === 'function') {
|
|
this._onupgradeneeded(evt);
|
|
}
|
|
};
|
|
openRequest.onsuccess = () => {
|
|
const db = openRequest.result;
|
|
if (openRequestTimedOut) {
|
|
db.close();
|
|
}
|
|
else {
|
|
db.onversionchange = this._onversionchange.bind(this);
|
|
resolve(db);
|
|
}
|
|
};
|
|
});
|
|
return this;
|
|
}
|
|
/**
|
|
* Polyfills the native `getKey()` method. Note, this is overridden at
|
|
* runtime if the browser supports the native method.
|
|
*
|
|
* @param {string} storeName
|
|
* @param {*} query
|
|
* @return {Array}
|
|
* @private
|
|
*/
|
|
async getKey(storeName, query) {
|
|
return (await this.getAllKeys(storeName, query, 1))[0];
|
|
}
|
|
/**
|
|
* Polyfills the native `getAll()` method. Note, this is overridden at
|
|
* runtime if the browser supports the native method.
|
|
*
|
|
* @param {string} storeName
|
|
* @param {*} query
|
|
* @param {number} count
|
|
* @return {Array}
|
|
* @private
|
|
*/
|
|
async getAll(storeName, query, count) {
|
|
return await this.getAllMatching(storeName, { query, count });
|
|
}
|
|
/**
|
|
* Polyfills the native `getAllKeys()` method. Note, this is overridden at
|
|
* runtime if the browser supports the native method.
|
|
*
|
|
* @param {string} storeName
|
|
* @param {*} query
|
|
* @param {number} count
|
|
* @return {Array}
|
|
* @private
|
|
*/
|
|
async getAllKeys(storeName, query, count) {
|
|
const entries = await this.getAllMatching(storeName, { query, count, includeKeys: true });
|
|
return entries.map((entry) => entry.key);
|
|
}
|
|
/**
|
|
* Supports flexible lookup in an object store by specifying an index,
|
|
* query, direction, and count. This method returns an array of objects
|
|
* with the signature .
|
|
*
|
|
* @param {string} storeName
|
|
* @param {Object} [opts]
|
|
* @param {string} [opts.index] The index to use (if specified).
|
|
* @param {*} [opts.query]
|
|
* @param {IDBCursorDirection} [opts.direction]
|
|
* @param {number} [opts.count] The max number of results to return.
|
|
* @param {boolean} [opts.includeKeys] When true, the structure of the
|
|
* returned objects is changed from an array of values to an array of
|
|
* objects in the form {key, primaryKey, value}.
|
|
* @return {Array}
|
|
* @private
|
|
*/
|
|
async getAllMatching(storeName, { index, query = null, // IE/Edge errors if query === `undefined`.
|
|
direction = 'next', count, includeKeys = false, } = {}) {
|
|
return await this.transaction([storeName], 'readonly', (txn, done) => {
|
|
const store = txn.objectStore(storeName);
|
|
const target = index ? store.index(index) : store;
|
|
const results = [];
|
|
const request = target.openCursor(query, direction);
|
|
request.onsuccess = () => {
|
|
const cursor = request.result;
|
|
if (cursor) {
|
|
results.push(includeKeys ? cursor : cursor.value);
|
|
if (count && results.length >= count) {
|
|
done(results);
|
|
}
|
|
else {
|
|
cursor.continue();
|
|
}
|
|
}
|
|
else {
|
|
done(results);
|
|
}
|
|
};
|
|
});
|
|
}
|
|
/**
|
|
* Accepts a list of stores, a transaction type, and a callback and
|
|
* performs a transaction. A promise is returned that resolves to whatever
|
|
* value the callback chooses. The callback holds all the transaction logic
|
|
* and is invoked with two arguments:
|
|
* 1. The IDBTransaction object
|
|
* 2. A `done` function, that's used to resolve the promise when
|
|
* when the transaction is done, if passed a value, the promise is
|
|
* resolved to that value.
|
|
*
|
|
* @param {Array<string>} storeNames An array of object store names
|
|
* involved in the transaction.
|
|
* @param {string} type Can be `readonly` or `readwrite`.
|
|
* @param {!Function} callback
|
|
* @return {*} The result of the transaction ran by the callback.
|
|
* @private
|
|
*/
|
|
async transaction(storeNames, type, callback) {
|
|
await this.open();
|
|
return await new Promise((resolve, reject) => {
|
|
const txn = this._db.transaction(storeNames, type);
|
|
txn.onabort = () => reject(txn.error);
|
|
txn.oncomplete = () => resolve();
|
|
callback(txn, (value) => resolve(value));
|
|
});
|
|
}
|
|
/**
|
|
* Delegates async to a native IDBObjectStore method.
|
|
*
|
|
* @param {string} method The method name.
|
|
* @param {string} storeName The object store name.
|
|
* @param {string} type Can be `readonly` or `readwrite`.
|
|
* @param {...*} args The list of args to pass to the native method.
|
|
* @return {*} The result of the transaction.
|
|
* @private
|
|
*/
|
|
async _call(method, storeName, type, ...args) {
|
|
const callback = (txn, done) => {
|
|
const objStore = txn.objectStore(storeName);
|
|
// TODO(philipwalton): Fix this underlying TS2684 error.
|
|
// @ts-ignore
|
|
const request = objStore[method].apply(objStore, args);
|
|
request.onsuccess = () => done(request.result);
|
|
};
|
|
return await this.transaction([storeName], type, callback);
|
|
}
|
|
/**
|
|
* Closes the connection opened by `DBWrapper.open()`. Generally this method
|
|
* doesn't need to be called since:
|
|
* 1. It's usually better to keep a connection open since opening
|
|
* a new connection is somewhat slow.
|
|
* 2. Connections are automatically closed when the reference is
|
|
* garbage collected.
|
|
* The primary use case for needing to close a connection is when another
|
|
* reference (typically in another tab) needs to upgrade it and would be
|
|
* blocked by the current, open connection.
|
|
*
|
|
* @private
|
|
*/
|
|
close() {
|
|
if (this._db) {
|
|
this._db.close();
|
|
this._db = null;
|
|
}
|
|
}
|
|
}
|
|
// Exposed on the prototype to let users modify the default timeout on a
|
|
// per-instance or global basis.
|
|
DBWrapper.prototype.OPEN_TIMEOUT = 2000;
|
|
// Wrap native IDBObjectStore methods according to their mode.
|
|
const methodsToWrap = {
|
|
readonly: ['get', 'count', 'getKey', 'getAll', 'getAllKeys'],
|
|
readwrite: ['add', 'put', 'clear', 'delete'],
|
|
};
|
|
for (const [mode, methods] of Object.entries(methodsToWrap)) {
|
|
for (const method of methods) {
|
|
if (method in IDBObjectStore.prototype) {
|
|
// Don't use arrow functions here since we're outside of the class.
|
|
DBWrapper.prototype[method] =
|
|
async function (storeName, ...args) {
|
|
return await this._call(method, storeName, mode, ...args);
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/_private/deleteDatabase.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
/**
|
|
* Deletes the database.
|
|
* Note: this is exported separately from the DBWrapper module because most
|
|
* usages of IndexedDB in workbox dont need deleting, and this way it can be
|
|
* reused in tests to delete databases without creating DBWrapper instances.
|
|
*
|
|
* @param {string} name The database name.
|
|
* @private
|
|
*/
|
|
const deleteDatabase = async (name) => {
|
|
await new Promise((resolve, reject) => {
|
|
const request = indexedDB.deleteDatabase(name);
|
|
request.onerror = () => {
|
|
reject(request.error);
|
|
};
|
|
request.onblocked = () => {
|
|
reject(new Error('Delete blocked'));
|
|
};
|
|
request.onsuccess = () => {
|
|
resolve();
|
|
};
|
|
});
|
|
};
|
|
|
|
// EXTERNAL MODULE: ./node_modules/workbox-expiration/_version.js
|
|
var workbox_expiration_version = __webpack_require__("d8a5");
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-expiration/models/CacheTimestampsModel.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
const DB_NAME = 'workbox-expiration';
|
|
const OBJECT_STORE_NAME = 'cache-entries';
|
|
const normalizeURL = (unNormalizedUrl) => {
|
|
const url = new URL(unNormalizedUrl, location.href);
|
|
url.hash = '';
|
|
return url.href;
|
|
};
|
|
/**
|
|
* Returns the timestamp model.
|
|
*
|
|
* @private
|
|
*/
|
|
class CacheTimestampsModel_CacheTimestampsModel {
|
|
/**
|
|
*
|
|
* @param {string} cacheName
|
|
*
|
|
* @private
|
|
*/
|
|
constructor(cacheName) {
|
|
this._cacheName = cacheName;
|
|
this._db = new DBWrapper(DB_NAME, 1, {
|
|
onupgradeneeded: (event) => this._handleUpgrade(event),
|
|
});
|
|
}
|
|
/**
|
|
* Should perform an upgrade of indexedDB.
|
|
*
|
|
* @param {Event} event
|
|
*
|
|
* @private
|
|
*/
|
|
_handleUpgrade(event) {
|
|
const db = event.target.result;
|
|
// TODO(philipwalton): EdgeHTML doesn't support arrays as a keyPath, so we
|
|
// have to use the `id` keyPath here and create our own values (a
|
|
// concatenation of `url + cacheName`) instead of simply using
|
|
// `keyPath: ['url', 'cacheName']`, which is supported in other browsers.
|
|
const objStore = db.createObjectStore(OBJECT_STORE_NAME, { keyPath: 'id' });
|
|
// TODO(philipwalton): once we don't have to support EdgeHTML, we can
|
|
// create a single index with the keyPath `['cacheName', 'timestamp']`
|
|
// instead of doing both these indexes.
|
|
objStore.createIndex('cacheName', 'cacheName', { unique: false });
|
|
objStore.createIndex('timestamp', 'timestamp', { unique: false });
|
|
// Previous versions of `workbox-expiration` used `this._cacheName`
|
|
// as the IDBDatabase name.
|
|
deleteDatabase(this._cacheName);
|
|
}
|
|
/**
|
|
* @param {string} url
|
|
* @param {number} timestamp
|
|
*
|
|
* @private
|
|
*/
|
|
async setTimestamp(url, timestamp) {
|
|
url = normalizeURL(url);
|
|
const entry = {
|
|
url,
|
|
timestamp,
|
|
cacheName: this._cacheName,
|
|
// Creating an ID from the URL and cache name won't be necessary once
|
|
// Edge switches to Chromium and all browsers we support work with
|
|
// array keyPaths.
|
|
id: this._getId(url),
|
|
};
|
|
await this._db.put(OBJECT_STORE_NAME, entry);
|
|
}
|
|
/**
|
|
* Returns the timestamp stored for a given URL.
|
|
*
|
|
* @param {string} url
|
|
* @return {number}
|
|
*
|
|
* @private
|
|
*/
|
|
async getTimestamp(url) {
|
|
const entry = await this._db.get(OBJECT_STORE_NAME, this._getId(url));
|
|
return entry.timestamp;
|
|
}
|
|
/**
|
|
* Iterates through all the entries in the object store (from newest to
|
|
* oldest) and removes entries once either `maxCount` is reached or the
|
|
* entry's timestamp is less than `minTimestamp`.
|
|
*
|
|
* @param {number} minTimestamp
|
|
* @param {number} maxCount
|
|
* @return {Array<string>}
|
|
*
|
|
* @private
|
|
*/
|
|
async expireEntries(minTimestamp, maxCount) {
|
|
const entriesToDelete = await this._db.transaction(OBJECT_STORE_NAME, 'readwrite', (txn, done) => {
|
|
const store = txn.objectStore(OBJECT_STORE_NAME);
|
|
const request = store.index('timestamp').openCursor(null, 'prev');
|
|
const entriesToDelete = [];
|
|
let entriesNotDeletedCount = 0;
|
|
request.onsuccess = () => {
|
|
const cursor = request.result;
|
|
if (cursor) {
|
|
const result = cursor.value;
|
|
// TODO(philipwalton): once we can use a multi-key index, we
|
|
// won't have to check `cacheName` here.
|
|
if (result.cacheName === this._cacheName) {
|
|
// Delete an entry if it's older than the max age or
|
|
// if we already have the max number allowed.
|
|
if ((minTimestamp && result.timestamp < minTimestamp) ||
|
|
(maxCount && entriesNotDeletedCount >= maxCount)) {
|
|
// TODO(philipwalton): we should be able to delete the
|
|
// entry right here, but doing so causes an iteration
|
|
// bug in Safari stable (fixed in TP). Instead we can
|
|
// store the keys of the entries to delete, and then
|
|
// delete the separate transactions.
|
|
// https://github.com/GoogleChrome/workbox/issues/1978
|
|
// cursor.delete();
|
|
// We only need to return the URL, not the whole entry.
|
|
entriesToDelete.push(cursor.value);
|
|
}
|
|
else {
|
|
entriesNotDeletedCount++;
|
|
}
|
|
}
|
|
cursor.continue();
|
|
}
|
|
else {
|
|
done(entriesToDelete);
|
|
}
|
|
};
|
|
});
|
|
// TODO(philipwalton): once the Safari bug in the following issue is fixed,
|
|
// we should be able to remove this loop and do the entry deletion in the
|
|
// cursor loop above:
|
|
// https://github.com/GoogleChrome/workbox/issues/1978
|
|
const urlsDeleted = [];
|
|
for (const entry of entriesToDelete) {
|
|
await this._db.delete(OBJECT_STORE_NAME, entry.id);
|
|
urlsDeleted.push(entry.url);
|
|
}
|
|
return urlsDeleted;
|
|
}
|
|
/**
|
|
* Takes a URL and returns an ID that will be unique in the object store.
|
|
*
|
|
* @param {string} url
|
|
* @return {string}
|
|
*
|
|
* @private
|
|
*/
|
|
_getId(url) {
|
|
// Creating an ID from the URL and cache name won't be necessary once
|
|
// Edge switches to Chromium and all browsers we support work with
|
|
// array keyPaths.
|
|
return this._cacheName + '|' + normalizeURL(url);
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-expiration/CacheExpiration.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* The `CacheExpiration` class allows you define an expiration and / or
|
|
* limit on the number of responses stored in a
|
|
* [`Cache`](https://developer.mozilla.org/en-US/docs/Web/API/Cache).
|
|
*
|
|
* @memberof module:workbox-expiration
|
|
*/
|
|
class CacheExpiration_CacheExpiration {
|
|
/**
|
|
* To construct a new CacheExpiration instance you must provide at least
|
|
* one of the `config` properties.
|
|
*
|
|
* @param {string} cacheName Name of the cache to apply restrictions to.
|
|
* @param {Object} config
|
|
* @param {number} [config.maxEntries] The maximum number of entries to cache.
|
|
* Entries used the least will be removed as the maximum is reached.
|
|
* @param {number} [config.maxAgeSeconds] The maximum age of an entry before
|
|
* it's treated as stale and removed.
|
|
* @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)
|
|
* that will be used when calling `delete()` on the cache.
|
|
*/
|
|
constructor(cacheName, config = {}) {
|
|
this._isRunning = false;
|
|
this._rerunRequested = false;
|
|
if (false) {}
|
|
this._maxEntries = config.maxEntries;
|
|
this._maxAgeSeconds = config.maxAgeSeconds;
|
|
this._matchOptions = config.matchOptions;
|
|
this._cacheName = cacheName;
|
|
this._timestampModel = new CacheTimestampsModel_CacheTimestampsModel(cacheName);
|
|
}
|
|
/**
|
|
* Expires entries for the given cache and given criteria.
|
|
*/
|
|
async expireEntries() {
|
|
if (this._isRunning) {
|
|
this._rerunRequested = true;
|
|
return;
|
|
}
|
|
this._isRunning = true;
|
|
const minTimestamp = this._maxAgeSeconds ?
|
|
Date.now() - (this._maxAgeSeconds * 1000) : 0;
|
|
const urlsExpired = await this._timestampModel.expireEntries(minTimestamp, this._maxEntries);
|
|
// Delete URLs from the cache
|
|
const cache = await self.caches.open(this._cacheName);
|
|
for (const url of urlsExpired) {
|
|
await cache.delete(url, this._matchOptions);
|
|
}
|
|
if (false) {}
|
|
this._isRunning = false;
|
|
if (this._rerunRequested) {
|
|
this._rerunRequested = false;
|
|
dontWaitFor(this.expireEntries());
|
|
}
|
|
}
|
|
/**
|
|
* Update the timestamp for the given URL. This ensures the when
|
|
* removing entries based on maximum entries, most recently used
|
|
* is accurate or when expiring, the timestamp is up-to-date.
|
|
*
|
|
* @param {string} url
|
|
*/
|
|
async updateTimestamp(url) {
|
|
if (false) {}
|
|
await this._timestampModel.setTimestamp(url, Date.now());
|
|
}
|
|
/**
|
|
* Can be used to check if a URL has expired or not before it's used.
|
|
*
|
|
* This requires a look up from IndexedDB, so can be slow.
|
|
*
|
|
* Note: This method will not remove the cached entry, call
|
|
* `expireEntries()` to remove indexedDB and Cache entries.
|
|
*
|
|
* @param {string} url
|
|
* @return {boolean}
|
|
*/
|
|
async isURLExpired(url) {
|
|
if (!this._maxAgeSeconds) {
|
|
if (false) {}
|
|
return false;
|
|
}
|
|
else {
|
|
const timestamp = await this._timestampModel.getTimestamp(url);
|
|
const expireOlderThan = Date.now() - (this._maxAgeSeconds * 1000);
|
|
return (timestamp < expireOlderThan);
|
|
}
|
|
}
|
|
/**
|
|
* Removes the IndexedDB object store used to keep track of cache expiration
|
|
* metadata.
|
|
*/
|
|
async delete() {
|
|
// Make sure we don't attempt another rerun if we're called in the middle of
|
|
// a cache expiration.
|
|
this._rerunRequested = false;
|
|
await this._timestampModel.expireEntries(Infinity); // Expires all.
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-core/registerQuotaErrorCallback.js
|
|
/*
|
|
Copyright 2019 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
* Adds a function to the set of quotaErrorCallbacks that will be executed if
|
|
* there's a quota error.
|
|
*
|
|
* @param {Function} callback
|
|
* @memberof module:workbox-core
|
|
*/
|
|
function registerQuotaErrorCallback(callback) {
|
|
if (false) {}
|
|
quotaErrorCallbacks.add(callback);
|
|
if (false) {}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-expiration/ExpirationPlugin.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* This plugin can be used in a `workbox-strategy` to regularly enforce a
|
|
* limit on the age and / or the number of cached requests.
|
|
*
|
|
* It can only be used with `workbox-strategy` instances that have a
|
|
* [custom `cacheName` property set](/web/tools/workbox/guides/configure-workbox#custom_cache_names_in_strategies).
|
|
* In other words, it can't be used to expire entries in strategy that uses the
|
|
* default runtime cache name.
|
|
*
|
|
* Whenever a cached request is used or updated, this plugin will look
|
|
* at the associated cache and remove any old or extra requests.
|
|
*
|
|
* When using `maxAgeSeconds`, requests may be used *once* after expiring
|
|
* because the expiration clean up will not have occurred until *after* the
|
|
* cached request has been used. If the request has a "Date" header, then
|
|
* a light weight expiration check is performed and the request will not be
|
|
* used immediately.
|
|
*
|
|
* When using `maxEntries`, the entry least-recently requested will be removed
|
|
* from the cache first.
|
|
*
|
|
* @memberof module:workbox-expiration
|
|
*/
|
|
class ExpirationPlugin_ExpirationPlugin {
|
|
/**
|
|
* @param {Object} config
|
|
* @param {number} [config.maxEntries] The maximum number of entries to cache.
|
|
* Entries used the least will be removed as the maximum is reached.
|
|
* @param {number} [config.maxAgeSeconds] The maximum age of an entry before
|
|
* it's treated as stale and removed.
|
|
* @param {Object} [config.matchOptions] The [`CacheQueryOptions`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/delete#Parameters)
|
|
* that will be used when calling `delete()` on the cache.
|
|
* @param {boolean} [config.purgeOnQuotaError] Whether to opt this cache in to
|
|
* automatic deletion if the available storage quota has been exceeded.
|
|
*/
|
|
constructor(config = {}) {
|
|
/**
|
|
* A "lifecycle" callback that will be triggered automatically by the
|
|
* `workbox-strategies` handlers when a `Response` is about to be returned
|
|
* from a [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache) to
|
|
* the handler. It allows the `Response` to be inspected for freshness and
|
|
* prevents it from being used if the `Response`'s `Date` header value is
|
|
* older than the configured `maxAgeSeconds`.
|
|
*
|
|
* @param {Object} options
|
|
* @param {string} options.cacheName Name of the cache the response is in.
|
|
* @param {Response} options.cachedResponse The `Response` object that's been
|
|
* read from a cache and whose freshness should be checked.
|
|
* @return {Response} Either the `cachedResponse`, if it's
|
|
* fresh, or `null` if the `Response` is older than `maxAgeSeconds`.
|
|
*
|
|
* @private
|
|
*/
|
|
this.cachedResponseWillBeUsed = async ({ event, request, cacheName, cachedResponse }) => {
|
|
if (!cachedResponse) {
|
|
return null;
|
|
}
|
|
const isFresh = this._isResponseDateFresh(cachedResponse);
|
|
// Expire entries to ensure that even if the expiration date has
|
|
// expired, it'll only be used once.
|
|
const cacheExpiration = this._getCacheExpiration(cacheName);
|
|
dontWaitFor(cacheExpiration.expireEntries());
|
|
// Update the metadata for the request URL to the current timestamp,
|
|
// but don't `await` it as we don't want to block the response.
|
|
const updateTimestampDone = cacheExpiration.updateTimestamp(request.url);
|
|
if (event) {
|
|
try {
|
|
event.waitUntil(updateTimestampDone);
|
|
}
|
|
catch (error) {
|
|
if (false) {}
|
|
}
|
|
}
|
|
return isFresh ? cachedResponse : null;
|
|
};
|
|
/**
|
|
* A "lifecycle" callback that will be triggered automatically by the
|
|
* `workbox-strategies` handlers when an entry is added to a cache.
|
|
*
|
|
* @param {Object} options
|
|
* @param {string} options.cacheName Name of the cache that was updated.
|
|
* @param {string} options.request The Request for the cached entry.
|
|
*
|
|
* @private
|
|
*/
|
|
this.cacheDidUpdate = async ({ cacheName, request }) => {
|
|
if (false) {}
|
|
const cacheExpiration = this._getCacheExpiration(cacheName);
|
|
await cacheExpiration.updateTimestamp(request.url);
|
|
await cacheExpiration.expireEntries();
|
|
};
|
|
if (false) {}
|
|
this._config = config;
|
|
this._maxAgeSeconds = config.maxAgeSeconds;
|
|
this._cacheExpirations = new Map();
|
|
if (config.purgeOnQuotaError) {
|
|
registerQuotaErrorCallback(() => this.deleteCacheAndMetadata());
|
|
}
|
|
}
|
|
/**
|
|
* A simple helper method to return a CacheExpiration instance for a given
|
|
* cache name.
|
|
*
|
|
* @param {string} cacheName
|
|
* @return {CacheExpiration}
|
|
*
|
|
* @private
|
|
*/
|
|
_getCacheExpiration(cacheName) {
|
|
if (cacheName === cacheNames.getRuntimeName()) {
|
|
throw new WorkboxError_WorkboxError('expire-custom-caches-only');
|
|
}
|
|
let cacheExpiration = this._cacheExpirations.get(cacheName);
|
|
if (!cacheExpiration) {
|
|
cacheExpiration = new CacheExpiration_CacheExpiration(cacheName, this._config);
|
|
this._cacheExpirations.set(cacheName, cacheExpiration);
|
|
}
|
|
return cacheExpiration;
|
|
}
|
|
/**
|
|
* @param {Response} cachedResponse
|
|
* @return {boolean}
|
|
*
|
|
* @private
|
|
*/
|
|
_isResponseDateFresh(cachedResponse) {
|
|
if (!this._maxAgeSeconds) {
|
|
// We aren't expiring by age, so return true, it's fresh
|
|
return true;
|
|
}
|
|
// Check if the 'date' header will suffice a quick expiration check.
|
|
// See https://github.com/GoogleChromeLabs/sw-toolbox/issues/164 for
|
|
// discussion.
|
|
const dateHeaderTimestamp = this._getDateHeaderTimestamp(cachedResponse);
|
|
if (dateHeaderTimestamp === null) {
|
|
// Unable to parse date, so assume it's fresh.
|
|
return true;
|
|
}
|
|
// If we have a valid headerTime, then our response is fresh iff the
|
|
// headerTime plus maxAgeSeconds is greater than the current time.
|
|
const now = Date.now();
|
|
return dateHeaderTimestamp >= now - (this._maxAgeSeconds * 1000);
|
|
}
|
|
/**
|
|
* This method will extract the data header and parse it into a useful
|
|
* value.
|
|
*
|
|
* @param {Response} cachedResponse
|
|
* @return {number|null}
|
|
*
|
|
* @private
|
|
*/
|
|
_getDateHeaderTimestamp(cachedResponse) {
|
|
if (!cachedResponse.headers.has('date')) {
|
|
return null;
|
|
}
|
|
const dateHeader = cachedResponse.headers.get('date');
|
|
const parsedDate = new Date(dateHeader);
|
|
const headerTime = parsedDate.getTime();
|
|
// If the Date header was invalid for some reason, parsedDate.getTime()
|
|
// will return NaN.
|
|
if (isNaN(headerTime)) {
|
|
return null;
|
|
}
|
|
return headerTime;
|
|
}
|
|
/**
|
|
* This is a helper method that performs two operations:
|
|
*
|
|
* - Deletes *all* the underlying Cache instances associated with this plugin
|
|
* instance, by calling caches.delete() on your behalf.
|
|
* - Deletes the metadata from IndexedDB used to keep track of expiration
|
|
* details for each Cache instance.
|
|
*
|
|
* When using cache expiration, calling this method is preferable to calling
|
|
* `caches.delete()` directly, since this will ensure that the IndexedDB
|
|
* metadata is also cleanly removed and open IndexedDB instances are deleted.
|
|
*
|
|
* Note that if you're *not* using cache expiration for a given cache, calling
|
|
* `caches.delete()` and passing in the cache's name should be sufficient.
|
|
* There is no Workbox-specific method needed for cleanup in that case.
|
|
*/
|
|
async deleteCacheAndMetadata() {
|
|
// Do this one at a time instead of all at once via `Promise.all()` to
|
|
// reduce the chance of inconsistency if a promise rejects.
|
|
for (const [cacheName, cacheExpiration] of this._cacheExpirations) {
|
|
await self.caches.delete(cacheName);
|
|
await cacheExpiration.delete();
|
|
}
|
|
// Reset this._cacheExpirations to its initial state.
|
|
this._cacheExpirations = new Map();
|
|
}
|
|
}
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-expiration/index.js
|
|
/*
|
|
Copyright 2018 Google LLC
|
|
|
|
Use of this source code is governed by an MIT-style
|
|
license that can be found in the LICENSE file or at
|
|
https://opensource.org/licenses/MIT.
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
* @module workbox-expiration
|
|
*/
|
|
|
|
|
|
// CONCATENATED MODULE: ./node_modules/workbox-expiration/index.mjs
|
|
|
|
// CONCATENATED MODULE: ./src/sw.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// These JavaScript module imports need to be bundled:
|
|
|
|
|
|
|
|
|
|
var OFFLINE_CACHE_NAME = 'offline-html';
|
|
var script_name = typeof window !== 'undefined' ? localStorage.getItem('SCRIPT_NAME') : '/';
|
|
var OFFLINE_PAGE_URL = script_name + 'offline/';
|
|
self.addEventListener('install', /*#__PURE__*/function () {
|
|
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(event) {
|
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
while (1) {
|
|
switch (_context.prev = _context.next) {
|
|
case 0:
|
|
event.waitUntil(caches.open(OFFLINE_CACHE_NAME).then(function (cache) {
|
|
return cache.add(new Request(OFFLINE_PAGE_URL, {
|
|
cache: "reload"
|
|
}));
|
|
}));
|
|
|
|
case 1:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}
|
|
}, _callee);
|
|
}));
|
|
|
|
return function (_x) {
|
|
return _ref.apply(this, arguments);
|
|
};
|
|
}()); // since the mode is inject manifest this needs to be present but because
|
|
// precacheAndRoute is cache first and i currently dont really know how to
|
|
// do versioning i will not use it
|
|
|
|
[{'url':'static/vue/cookbook_view.html'},{'url':'static/vue/css/chunk-vendors.css'},{'url':'static/vue/css/cookbook_view.css'},{'url':'static/vue/css/model_list_view.css'},{'url':'static/vue/css/recipe_search_view.css'},{'url':'static/vue/css/recipe_view.css'},{'url':'static/vue/import_response_view.html'},{'url':'static/vue/js/cookbook_view.js'},{'url':'static/vue/js/import_response_view.js'},{'url':'static/vue/js/model_list_view.js'},{'url':'static/vue/js/offline_view.js'},{'url':'static/vue/js/recipe_search_view.js'},{'url':'static/vue/js/recipe_view.js'},{'url':'static/vue/js/supermarket_view.js'},{'url':'static/vue/js/user_file_view.js'},{'url':'static/vue/manifest.json'},{'url':'static/vue/model_list_view.html'},{'url':'static/vue/offline_view.html'},{'url':'static/vue/recipe_search_view.html'},{'url':'static/vue/recipe_view.html'},{'url':'static/vue/supermarket_view.html'},{'url':'static/vue/user_file_view.html'}]; // default handler if everything else fails
|
|
|
|
setCatchHandler(function (_ref2) {
|
|
var event = _ref2.event;
|
|
|
|
switch (event.request.destination) {
|
|
case 'document':
|
|
console.log('Triggered fallback HTML');
|
|
return caches.open(OFFLINE_CACHE_NAME).then(function (cache) {
|
|
return cache.match(OFFLINE_PAGE_URL);
|
|
});
|
|
|
|
default:
|
|
console.log('Triggered response ERROR');
|
|
return Response.error();
|
|
}
|
|
});
|
|
registerRoute(function (_ref3) {
|
|
var request = _ref3.request;
|
|
return request.destination === 'image';
|
|
}, new CacheFirst_CacheFirst({
|
|
cacheName: 'images',
|
|
plugins: [new ExpirationPlugin_ExpirationPlugin({
|
|
maxEntries: 20
|
|
})]
|
|
}));
|
|
registerRoute(function (_ref4) {
|
|
var request = _ref4.request;
|
|
return request.destination === 'script' || request.destination === 'style';
|
|
}, new StaleWhileRevalidate_StaleWhileRevalidate({
|
|
cacheName: 'assets'
|
|
}));
|
|
registerRoute(new RegExp('jsreverse'), new StaleWhileRevalidate_StaleWhileRevalidate({
|
|
cacheName: 'assets'
|
|
}));
|
|
registerRoute(new RegExp('jsi18n'), new StaleWhileRevalidate_StaleWhileRevalidate({
|
|
cacheName: 'assets'
|
|
}));
|
|
registerRoute(new RegExp('api/recipe/([0-9]+)'), new NetworkFirst_NetworkFirst({
|
|
cacheName: 'api-recipe',
|
|
plugins: [new ExpirationPlugin_ExpirationPlugin({
|
|
maxEntries: 50
|
|
})]
|
|
}));
|
|
registerRoute(new RegExp('api/*'), new NetworkFirst_NetworkFirst({
|
|
cacheName: 'api',
|
|
plugins: [new ExpirationPlugin_ExpirationPlugin({
|
|
maxEntries: 50
|
|
})]
|
|
}));
|
|
registerRoute(function (_ref5) {
|
|
var request = _ref5.request;
|
|
return request.destination === 'document';
|
|
}, new NetworkFirst_NetworkFirst({
|
|
cacheName: 'html',
|
|
plugins: [new ExpirationPlugin_ExpirationPlugin({
|
|
maxAgeSeconds: 60 * 60 * 24 * 30,
|
|
maxEntries: 50
|
|
})]
|
|
}));
|
|
|
|
/***/ }),
|
|
|
|
/***/ "25f0":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
var redefine = __webpack_require__("6eeb");
|
|
var anObject = __webpack_require__("825a");
|
|
var fails = __webpack_require__("d039");
|
|
var flags = __webpack_require__("ad6d");
|
|
|
|
var TO_STRING = 'toString';
|
|
var RegExpPrototype = RegExp.prototype;
|
|
var nativeToString = RegExpPrototype[TO_STRING];
|
|
|
|
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
|
// FF44- RegExp#toString has a wrong name
|
|
var INCORRECT_NAME = nativeToString.name != TO_STRING;
|
|
|
|
// `RegExp.prototype.toString` method
|
|
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
|
|
if (NOT_GENERIC || INCORRECT_NAME) {
|
|
redefine(RegExp.prototype, TO_STRING, function toString() {
|
|
var R = anObject(this);
|
|
var p = String(R.source);
|
|
var rf = R.flags;
|
|
var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
|
|
return '/' + p + '/' + f;
|
|
}, { unsafe: true });
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "2626":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
var getBuiltIn = __webpack_require__("d066");
|
|
var definePropertyModule = __webpack_require__("9bf2");
|
|
var wellKnownSymbol = __webpack_require__("b622");
|
|
var DESCRIPTORS = __webpack_require__("83ab");
|
|
|
|
var SPECIES = wellKnownSymbol('species');
|
|
|
|
module.exports = function (CONSTRUCTOR_NAME) {
|
|
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
|
var defineProperty = definePropertyModule.f;
|
|
|
|
if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
|
|
defineProperty(Constructor, SPECIES, {
|
|
configurable: true,
|
|
get: function () { return this; }
|
|
});
|
|
}
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "2d00":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var global = __webpack_require__("da84");
|
|
var userAgent = __webpack_require__("342f");
|
|
|
|
var process = global.process;
|
|
var versions = process && process.versions;
|
|
var v8 = versions && versions.v8;
|
|
var match, version;
|
|
|
|
if (v8) {
|
|
match = v8.split('.');
|
|
version = match[0] < 4 ? 1 : match[0] + match[1];
|
|
} else if (userAgent) {
|
|
match = userAgent.match(/Edge\/(\d+)/);
|
|
if (!match || match[1] >= 74) {
|
|
match = userAgent.match(/Chrome\/(\d+)/);
|
|
if (match) version = match[1];
|
|
}
|
|
}
|
|
|
|
module.exports = version && +version;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "342f":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var getBuiltIn = __webpack_require__("d066");
|
|
|
|
module.exports = getBuiltIn('navigator', 'userAgent') || '';
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "3bbe":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var isObject = __webpack_require__("861d");
|
|
|
|
module.exports = function (it) {
|
|
if (!isObject(it) && it !== null) {
|
|
throw TypeError("Can't set " + String(it) + ' as a prototype');
|
|
} return it;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "428f":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var global = __webpack_require__("da84");
|
|
|
|
module.exports = global;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "44ad":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var fails = __webpack_require__("d039");
|
|
var classof = __webpack_require__("c6b6");
|
|
|
|
var split = ''.split;
|
|
|
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
module.exports = fails(function () {
|
|
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
|
|
// eslint-disable-next-line no-prototype-builtins -- safe
|
|
return !Object('z').propertyIsEnumerable(0);
|
|
}) ? function (it) {
|
|
return classof(it) == 'String' ? split.call(it, '') : Object(it);
|
|
} : Object;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "44e7":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var isObject = __webpack_require__("861d");
|
|
var classof = __webpack_require__("c6b6");
|
|
var wellKnownSymbol = __webpack_require__("b622");
|
|
|
|
var MATCH = wellKnownSymbol('match');
|
|
|
|
// `IsRegExp` abstract operation
|
|
// https://tc39.es/ecma262/#sec-isregexp
|
|
module.exports = function (it) {
|
|
var isRegExp;
|
|
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "466d":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
|
|
var anObject = __webpack_require__("825a");
|
|
var toLength = __webpack_require__("50c4");
|
|
var requireObjectCoercible = __webpack_require__("1d80");
|
|
var advanceStringIndex = __webpack_require__("8aa5");
|
|
var regExpExec = __webpack_require__("14c3");
|
|
|
|
// @@match logic
|
|
fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
|
|
return [
|
|
// `String.prototype.match` method
|
|
// https://tc39.es/ecma262/#sec-string.prototype.match
|
|
function match(regexp) {
|
|
var O = requireObjectCoercible(this);
|
|
var matcher = regexp == undefined ? undefined : regexp[MATCH];
|
|
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
|
|
},
|
|
// `RegExp.prototype[@@match]` method
|
|
// https://tc39.es/ecma262/#sec-regexp.prototype-@@match
|
|
function (regexp) {
|
|
var res = maybeCallNative(nativeMatch, regexp, this);
|
|
if (res.done) return res.value;
|
|
|
|
var rx = anObject(regexp);
|
|
var S = String(this);
|
|
|
|
if (!rx.global) return regExpExec(rx, S);
|
|
|
|
var fullUnicode = rx.unicode;
|
|
rx.lastIndex = 0;
|
|
var A = [];
|
|
var n = 0;
|
|
var result;
|
|
while ((result = regExpExec(rx, S)) !== null) {
|
|
var matchStr = String(result[0]);
|
|
A[n] = matchStr;
|
|
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
|
n++;
|
|
}
|
|
return n === 0 ? null : A;
|
|
}
|
|
];
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "4930":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
var V8_VERSION = __webpack_require__("2d00");
|
|
var fails = __webpack_require__("d039");
|
|
|
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
|
var symbol = Symbol();
|
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "4d63":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var DESCRIPTORS = __webpack_require__("83ab");
|
|
var global = __webpack_require__("da84");
|
|
var isForced = __webpack_require__("94ca");
|
|
var inheritIfRequired = __webpack_require__("7156");
|
|
var defineProperty = __webpack_require__("9bf2").f;
|
|
var getOwnPropertyNames = __webpack_require__("241c").f;
|
|
var isRegExp = __webpack_require__("44e7");
|
|
var getFlags = __webpack_require__("ad6d");
|
|
var stickyHelpers = __webpack_require__("9f7f");
|
|
var redefine = __webpack_require__("6eeb");
|
|
var fails = __webpack_require__("d039");
|
|
var enforceInternalState = __webpack_require__("69f3").enforce;
|
|
var setSpecies = __webpack_require__("2626");
|
|
var wellKnownSymbol = __webpack_require__("b622");
|
|
|
|
var MATCH = wellKnownSymbol('match');
|
|
var NativeRegExp = global.RegExp;
|
|
var RegExpPrototype = NativeRegExp.prototype;
|
|
var re1 = /a/g;
|
|
var re2 = /a/g;
|
|
|
|
// "new" should create a new object, old webkit bug
|
|
var CORRECT_NEW = new NativeRegExp(re1) !== re1;
|
|
|
|
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
|
|
|
|
var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () {
|
|
re2[MATCH] = false;
|
|
// RegExp constructor can alter flags and IsRegExp works correct with @@match
|
|
return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
|
|
})));
|
|
|
|
// `RegExp` constructor
|
|
// https://tc39.es/ecma262/#sec-regexp-constructor
|
|
if (FORCED) {
|
|
var RegExpWrapper = function RegExp(pattern, flags) {
|
|
var thisIsRegExp = this instanceof RegExpWrapper;
|
|
var patternIsRegExp = isRegExp(pattern);
|
|
var flagsAreUndefined = flags === undefined;
|
|
var sticky;
|
|
|
|
if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
|
|
return pattern;
|
|
}
|
|
|
|
if (CORRECT_NEW) {
|
|
if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
|
|
} else if (pattern instanceof RegExpWrapper) {
|
|
if (flagsAreUndefined) flags = getFlags.call(pattern);
|
|
pattern = pattern.source;
|
|
}
|
|
|
|
if (UNSUPPORTED_Y) {
|
|
sticky = !!flags && flags.indexOf('y') > -1;
|
|
if (sticky) flags = flags.replace(/y/g, '');
|
|
}
|
|
|
|
var result = inheritIfRequired(
|
|
CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
|
|
thisIsRegExp ? this : RegExpPrototype,
|
|
RegExpWrapper
|
|
);
|
|
|
|
if (UNSUPPORTED_Y && sticky) {
|
|
var state = enforceInternalState(result);
|
|
state.sticky = true;
|
|
}
|
|
|
|
return result;
|
|
};
|
|
var proxy = function (key) {
|
|
key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
|
|
configurable: true,
|
|
get: function () { return NativeRegExp[key]; },
|
|
set: function (it) { NativeRegExp[key] = it; }
|
|
});
|
|
};
|
|
var keys = getOwnPropertyNames(NativeRegExp);
|
|
var index = 0;
|
|
while (keys.length > index) proxy(keys[index++]);
|
|
RegExpPrototype.constructor = RegExpWrapper;
|
|
RegExpWrapper.prototype = RegExpPrototype;
|
|
redefine(global, 'RegExp', RegExpWrapper);
|
|
}
|
|
|
|
// https://tc39.es/ecma262/#sec-get-regexp-@@species
|
|
setSpecies('RegExp');
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "4d64":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var toIndexedObject = __webpack_require__("fc6a");
|
|
var toLength = __webpack_require__("50c4");
|
|
var toAbsoluteIndex = __webpack_require__("23cb");
|
|
|
|
// `Array.prototype.{ indexOf, includes }` methods implementation
|
|
var createMethod = function (IS_INCLUDES) {
|
|
return function ($this, el, fromIndex) {
|
|
var O = toIndexedObject($this);
|
|
var length = toLength(O.length);
|
|
var index = toAbsoluteIndex(fromIndex, length);
|
|
var value;
|
|
// Array#includes uses SameValueZero equality algorithm
|
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
if (IS_INCLUDES && el != el) while (length > index) {
|
|
value = O[index++];
|
|
// eslint-disable-next-line no-self-compare -- NaN check
|
|
if (value != value) return true;
|
|
// Array#indexOf ignores holes, Array#includes - not
|
|
} else for (;length > index; index++) {
|
|
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
|
} return !IS_INCLUDES && -1;
|
|
};
|
|
};
|
|
|
|
module.exports = {
|
|
// `Array.prototype.includes` method
|
|
// https://tc39.es/ecma262/#sec-array.prototype.includes
|
|
includes: createMethod(true),
|
|
// `Array.prototype.indexOf` method
|
|
// https://tc39.es/ecma262/#sec-array.prototype.indexof
|
|
indexOf: createMethod(false)
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "50c4":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var toInteger = __webpack_require__("a691");
|
|
|
|
var min = Math.min;
|
|
|
|
// `ToLength` abstract operation
|
|
// https://tc39.es/ecma262/#sec-tolength
|
|
module.exports = function (argument) {
|
|
return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "5135":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var toObject = __webpack_require__("7b0b");
|
|
|
|
var hasOwnProperty = {}.hasOwnProperty;
|
|
|
|
module.exports = Object.hasOwn || function hasOwn(it, key) {
|
|
return hasOwnProperty.call(toObject(it), key);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "5692":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var IS_PURE = __webpack_require__("c430");
|
|
var store = __webpack_require__("c6cd");
|
|
|
|
(module.exports = function (key, value) {
|
|
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
})('versions', []).push({
|
|
version: '3.14.0',
|
|
mode: IS_PURE ? 'pure' : 'global',
|
|
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "56ef":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var getBuiltIn = __webpack_require__("d066");
|
|
var getOwnPropertyNamesModule = __webpack_require__("241c");
|
|
var getOwnPropertySymbolsModule = __webpack_require__("7418");
|
|
var anObject = __webpack_require__("825a");
|
|
|
|
// all object keys, includes non-enumerable and symbols
|
|
module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
var keys = getOwnPropertyNamesModule.f(anObject(it));
|
|
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
|
return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "5c6c":
|
|
/***/ (function(module, exports) {
|
|
|
|
module.exports = function (bitmap, value) {
|
|
return {
|
|
enumerable: !(bitmap & 1),
|
|
configurable: !(bitmap & 2),
|
|
writable: !(bitmap & 4),
|
|
value: value
|
|
};
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "6547":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var toInteger = __webpack_require__("a691");
|
|
var requireObjectCoercible = __webpack_require__("1d80");
|
|
|
|
// `String.prototype.{ codePointAt, at }` methods implementation
|
|
var createMethod = function (CONVERT_TO_STRING) {
|
|
return function ($this, pos) {
|
|
var S = String(requireObjectCoercible($this));
|
|
var position = toInteger(pos);
|
|
var size = S.length;
|
|
var first, second;
|
|
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
|
first = S.charCodeAt(position);
|
|
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
|
|| (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
|
? CONVERT_TO_STRING ? S.charAt(position) : first
|
|
: CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
|
};
|
|
};
|
|
|
|
module.exports = {
|
|
// `String.prototype.codePointAt` method
|
|
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
|
codeAt: createMethod(false),
|
|
// `String.prototype.at` method
|
|
// https://github.com/mathiasbynens/String.prototype.at
|
|
charAt: createMethod(true)
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "69f3":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
|
|
var global = __webpack_require__("da84");
|
|
var isObject = __webpack_require__("861d");
|
|
var createNonEnumerableProperty = __webpack_require__("9112");
|
|
var objectHas = __webpack_require__("5135");
|
|
var shared = __webpack_require__("c6cd");
|
|
var sharedKey = __webpack_require__("f772");
|
|
var hiddenKeys = __webpack_require__("d012");
|
|
|
|
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
var WeakMap = global.WeakMap;
|
|
var set, get, has;
|
|
|
|
var enforce = function (it) {
|
|
return has(it) ? get(it) : set(it, {});
|
|
};
|
|
|
|
var getterFor = function (TYPE) {
|
|
return function (it) {
|
|
var state;
|
|
if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
|
throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
|
} return state;
|
|
};
|
|
};
|
|
|
|
if (NATIVE_WEAK_MAP || shared.state) {
|
|
var store = shared.state || (shared.state = new WeakMap());
|
|
var wmget = store.get;
|
|
var wmhas = store.has;
|
|
var wmset = store.set;
|
|
set = function (it, metadata) {
|
|
if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
metadata.facade = it;
|
|
wmset.call(store, it, metadata);
|
|
return metadata;
|
|
};
|
|
get = function (it) {
|
|
return wmget.call(store, it) || {};
|
|
};
|
|
has = function (it) {
|
|
return wmhas.call(store, it);
|
|
};
|
|
} else {
|
|
var STATE = sharedKey('state');
|
|
hiddenKeys[STATE] = true;
|
|
set = function (it, metadata) {
|
|
if (objectHas(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
|
metadata.facade = it;
|
|
createNonEnumerableProperty(it, STATE, metadata);
|
|
return metadata;
|
|
};
|
|
get = function (it) {
|
|
return objectHas(it, STATE) ? it[STATE] : {};
|
|
};
|
|
has = function (it) {
|
|
return objectHas(it, STATE);
|
|
};
|
|
}
|
|
|
|
module.exports = {
|
|
set: set,
|
|
get: get,
|
|
has: has,
|
|
enforce: enforce,
|
|
getterFor: getterFor
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "6aa8":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// @ts-ignore
|
|
try {
|
|
self['workbox:strategies:6.1.5'] && _();
|
|
}
|
|
catch (e) { }
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "6eeb":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var global = __webpack_require__("da84");
|
|
var createNonEnumerableProperty = __webpack_require__("9112");
|
|
var has = __webpack_require__("5135");
|
|
var setGlobal = __webpack_require__("ce4e");
|
|
var inspectSource = __webpack_require__("8925");
|
|
var InternalStateModule = __webpack_require__("69f3");
|
|
|
|
var getInternalState = InternalStateModule.get;
|
|
var enforceInternalState = InternalStateModule.enforce;
|
|
var TEMPLATE = String(String).split('String');
|
|
|
|
(module.exports = function (O, key, value, options) {
|
|
var unsafe = options ? !!options.unsafe : false;
|
|
var simple = options ? !!options.enumerable : false;
|
|
var noTargetGet = options ? !!options.noTargetGet : false;
|
|
var state;
|
|
if (typeof value == 'function') {
|
|
if (typeof key == 'string' && !has(value, 'name')) {
|
|
createNonEnumerableProperty(value, 'name', key);
|
|
}
|
|
state = enforceInternalState(value);
|
|
if (!state.source) {
|
|
state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
|
}
|
|
}
|
|
if (O === global) {
|
|
if (simple) O[key] = value;
|
|
else setGlobal(key, value);
|
|
return;
|
|
} else if (!unsafe) {
|
|
delete O[key];
|
|
} else if (!noTargetGet && O[key]) {
|
|
simple = true;
|
|
}
|
|
if (simple) O[key] = value;
|
|
else createNonEnumerableProperty(O, key, value);
|
|
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
|
|
})(Function.prototype, 'toString', function toString() {
|
|
return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "7156":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var isObject = __webpack_require__("861d");
|
|
var setPrototypeOf = __webpack_require__("d2bb");
|
|
|
|
// makes subclassing work correct for wrapped built-ins
|
|
module.exports = function ($this, dummy, Wrapper) {
|
|
var NewTarget, NewTargetPrototype;
|
|
if (
|
|
// it can work only with native `setPrototypeOf`
|
|
setPrototypeOf &&
|
|
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
|
|
typeof (NewTarget = dummy.constructor) == 'function' &&
|
|
NewTarget !== Wrapper &&
|
|
isObject(NewTargetPrototype = NewTarget.prototype) &&
|
|
NewTargetPrototype !== Wrapper.prototype
|
|
) setPrototypeOf($this, NewTargetPrototype);
|
|
return $this;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "7418":
|
|
/***/ (function(module, exports) {
|
|
|
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
|
|
exports.f = Object.getOwnPropertySymbols;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "7839":
|
|
/***/ (function(module, exports) {
|
|
|
|
// IE8- don't enum bug keys
|
|
module.exports = [
|
|
'constructor',
|
|
'hasOwnProperty',
|
|
'isPrototypeOf',
|
|
'propertyIsEnumerable',
|
|
'toLocaleString',
|
|
'toString',
|
|
'valueOf'
|
|
];
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "7b0b":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var requireObjectCoercible = __webpack_require__("1d80");
|
|
|
|
// `ToObject` abstract operation
|
|
// https://tc39.es/ecma262/#sec-toobject
|
|
module.exports = function (argument) {
|
|
return Object(requireObjectCoercible(argument));
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "7f9a":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var global = __webpack_require__("da84");
|
|
var inspectSource = __webpack_require__("8925");
|
|
|
|
var WeakMap = global.WeakMap;
|
|
|
|
module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "825a":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var isObject = __webpack_require__("861d");
|
|
|
|
module.exports = function (it) {
|
|
if (!isObject(it)) {
|
|
throw TypeError(String(it) + ' is not an object');
|
|
} return it;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "83ab":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var fails = __webpack_require__("d039");
|
|
|
|
// Detect IE8's incomplete defineProperty implementation
|
|
module.exports = !fails(function () {
|
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "861d":
|
|
/***/ (function(module, exports) {
|
|
|
|
module.exports = function (it) {
|
|
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "8925":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var store = __webpack_require__("c6cd");
|
|
|
|
var functionToString = Function.toString;
|
|
|
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
if (typeof store.inspectSource != 'function') {
|
|
store.inspectSource = function (it) {
|
|
return functionToString.call(it);
|
|
};
|
|
}
|
|
|
|
module.exports = store.inspectSource;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "8aa5":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
var charAt = __webpack_require__("6547").charAt;
|
|
|
|
// `AdvanceStringIndex` abstract operation
|
|
// https://tc39.es/ecma262/#sec-advancestringindex
|
|
module.exports = function (S, index, unicode) {
|
|
return index + (unicode ? charAt(S, index).length : 1);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "90e3":
|
|
/***/ (function(module, exports) {
|
|
|
|
var id = 0;
|
|
var postfix = Math.random();
|
|
|
|
module.exports = function (key) {
|
|
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "9112":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var DESCRIPTORS = __webpack_require__("83ab");
|
|
var definePropertyModule = __webpack_require__("9bf2");
|
|
var createPropertyDescriptor = __webpack_require__("5c6c");
|
|
|
|
module.exports = DESCRIPTORS ? function (object, key, value) {
|
|
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
|
} : function (object, key, value) {
|
|
object[key] = value;
|
|
return object;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "9263":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
/* eslint-disable regexp/no-assertion-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
|
|
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
var regexpFlags = __webpack_require__("ad6d");
|
|
var stickyHelpers = __webpack_require__("9f7f");
|
|
var shared = __webpack_require__("5692");
|
|
|
|
var nativeExec = RegExp.prototype.exec;
|
|
var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
|
|
|
var patchedExec = nativeExec;
|
|
|
|
var UPDATES_LAST_INDEX_WRONG = (function () {
|
|
var re1 = /a/;
|
|
var re2 = /b*/g;
|
|
nativeExec.call(re1, 'a');
|
|
nativeExec.call(re2, 'a');
|
|
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
|
})();
|
|
|
|
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
|
|
|
|
// nonparticipating capturing group, copied from es5-shim's String#split patch.
|
|
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
|
|
|
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
|
|
|
|
if (PATCH) {
|
|
patchedExec = function exec(str) {
|
|
var re = this;
|
|
var lastIndex, reCopy, match, i;
|
|
var sticky = UNSUPPORTED_Y && re.sticky;
|
|
var flags = regexpFlags.call(re);
|
|
var source = re.source;
|
|
var charsAdded = 0;
|
|
var strCopy = str;
|
|
|
|
if (sticky) {
|
|
flags = flags.replace('y', '');
|
|
if (flags.indexOf('g') === -1) {
|
|
flags += 'g';
|
|
}
|
|
|
|
strCopy = String(str).slice(re.lastIndex);
|
|
// Support anchored sticky behavior.
|
|
if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
|
|
source = '(?: ' + source + ')';
|
|
strCopy = ' ' + strCopy;
|
|
charsAdded++;
|
|
}
|
|
// ^(? + rx + ) is needed, in combination with some str slicing, to
|
|
// simulate the 'y' flag.
|
|
reCopy = new RegExp('^(?:' + source + ')', flags);
|
|
}
|
|
|
|
if (NPCG_INCLUDED) {
|
|
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
|
}
|
|
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
|
|
|
match = nativeExec.call(sticky ? reCopy : re, strCopy);
|
|
|
|
if (sticky) {
|
|
if (match) {
|
|
match.input = match.input.slice(charsAdded);
|
|
match[0] = match[0].slice(charsAdded);
|
|
match.index = re.lastIndex;
|
|
re.lastIndex += match[0].length;
|
|
} else re.lastIndex = 0;
|
|
} else if (UPDATES_LAST_INDEX_WRONG && match) {
|
|
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
|
}
|
|
if (NPCG_INCLUDED && match && match.length > 1) {
|
|
// Fix browsers whose `exec` methods don't consistently return `undefined`
|
|
// for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
|
|
nativeReplace.call(match[0], reCopy, function () {
|
|
for (i = 1; i < arguments.length - 2; i++) {
|
|
if (arguments[i] === undefined) match[i] = undefined;
|
|
}
|
|
});
|
|
}
|
|
|
|
return match;
|
|
};
|
|
}
|
|
|
|
module.exports = patchedExec;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "94ca":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var fails = __webpack_require__("d039");
|
|
|
|
var replacement = /#|\.prototype\./;
|
|
|
|
var isForced = function (feature, detection) {
|
|
var value = data[normalize(feature)];
|
|
return value == POLYFILL ? true
|
|
: value == NATIVE ? false
|
|
: typeof detection == 'function' ? fails(detection)
|
|
: !!detection;
|
|
};
|
|
|
|
var normalize = isForced.normalize = function (string) {
|
|
return String(string).replace(replacement, '.').toLowerCase();
|
|
};
|
|
|
|
var data = isForced.data = {};
|
|
var NATIVE = isForced.NATIVE = 'N';
|
|
var POLYFILL = isForced.POLYFILL = 'P';
|
|
|
|
module.exports = isForced;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "96cf":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
/**
|
|
* 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 define(obj, key, value) {
|
|
Object.defineProperty(obj, key, {
|
|
value: value,
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true
|
|
});
|
|
return obj[key];
|
|
}
|
|
try {
|
|
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
define({}, "");
|
|
} catch (err) {
|
|
define = function(obj, key, value) {
|
|
return obj[key] = value;
|
|
};
|
|
}
|
|
|
|
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;
|
|
GeneratorFunction.displayName = define(
|
|
GeneratorFunctionPrototype,
|
|
toStringTagSymbol,
|
|
"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) {
|
|
define(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;
|
|
define(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, PromiseImpl) {
|
|
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 PromiseImpl.resolve(value.__await).then(function(value) {
|
|
invoke("next", value, resolve, reject);
|
|
}, function(err) {
|
|
invoke("throw", err, resolve, reject);
|
|
});
|
|
}
|
|
|
|
return PromiseImpl.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 PromiseImpl(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, PromiseImpl) {
|
|
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
|
|
var iter = new AsyncIterator(
|
|
wrap(innerFn, outerFn, self, tryLocsList),
|
|
PromiseImpl
|
|
);
|
|
|
|
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);
|
|
|
|
define(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.
|
|
true ? module.exports : undefined
|
|
));
|
|
|
|
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);
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "9bf2":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var DESCRIPTORS = __webpack_require__("83ab");
|
|
var IE8_DOM_DEFINE = __webpack_require__("0cfb");
|
|
var anObject = __webpack_require__("825a");
|
|
var toPrimitive = __webpack_require__("c04e");
|
|
|
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
var $defineProperty = Object.defineProperty;
|
|
|
|
// `Object.defineProperty` method
|
|
// https://tc39.es/ecma262/#sec-object.defineproperty
|
|
exports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) {
|
|
anObject(O);
|
|
P = toPrimitive(P, true);
|
|
anObject(Attributes);
|
|
if (IE8_DOM_DEFINE) try {
|
|
return $defineProperty(O, P, Attributes);
|
|
} catch (error) { /* empty */ }
|
|
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
|
if ('value' in Attributes) O[P] = Attributes.value;
|
|
return O;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "9f7f":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
|
|
var fails = __webpack_require__("d039");
|
|
|
|
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,
|
|
// so we use an intermediate function.
|
|
function RE(s, f) {
|
|
return RegExp(s, f);
|
|
}
|
|
|
|
exports.UNSUPPORTED_Y = fails(function () {
|
|
// babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
var re = RE('a', 'y');
|
|
re.lastIndex = 2;
|
|
return re.exec('abcd') != null;
|
|
});
|
|
|
|
exports.BROKEN_CARET = fails(function () {
|
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
|
|
var re = RE('^r', 'gy');
|
|
re.lastIndex = 2;
|
|
return re.exec('str') != null;
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "a691":
|
|
/***/ (function(module, exports) {
|
|
|
|
var ceil = Math.ceil;
|
|
var floor = Math.floor;
|
|
|
|
// `ToInteger` abstract operation
|
|
// https://tc39.es/ecma262/#sec-tointeger
|
|
module.exports = function (argument) {
|
|
return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "ac1f":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
var $ = __webpack_require__("23e7");
|
|
var exec = __webpack_require__("9263");
|
|
|
|
// `RegExp.prototype.exec` method
|
|
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
|
|
$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
|
exec: exec
|
|
});
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "ad6d":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
var anObject = __webpack_require__("825a");
|
|
|
|
// `RegExp.prototype.flags` getter implementation
|
|
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
module.exports = function () {
|
|
var that = anObject(this);
|
|
var result = '';
|
|
if (that.global) result += 'g';
|
|
if (that.ignoreCase) result += 'i';
|
|
if (that.multiline) result += 'm';
|
|
if (that.dotAll) result += 's';
|
|
if (that.unicode) result += 'u';
|
|
if (that.sticky) result += 'y';
|
|
return result;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "b041":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
|
|
var classof = __webpack_require__("f5df");
|
|
|
|
// `Object.prototype.toString` method implementation
|
|
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
|
|
return '[object ' + classof(this) + ']';
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "b622":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var global = __webpack_require__("da84");
|
|
var shared = __webpack_require__("5692");
|
|
var has = __webpack_require__("5135");
|
|
var uid = __webpack_require__("90e3");
|
|
var NATIVE_SYMBOL = __webpack_require__("4930");
|
|
var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
|
|
|
|
var WellKnownSymbolsStore = shared('wks');
|
|
var Symbol = global.Symbol;
|
|
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
|
|
|
|
module.exports = function (name) {
|
|
if (!has(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
|
|
if (NATIVE_SYMBOL && has(Symbol, name)) {
|
|
WellKnownSymbolsStore[name] = Symbol[name];
|
|
} else {
|
|
WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
|
}
|
|
} return WellKnownSymbolsStore[name];
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "c04e":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var isObject = __webpack_require__("861d");
|
|
|
|
// `ToPrimitive` abstract operation
|
|
// https://tc39.es/ecma262/#sec-toprimitive
|
|
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
|
|
// and the second argument - flag - preferred type is a string
|
|
module.exports = function (input, PREFERRED_STRING) {
|
|
if (!isObject(input)) return input;
|
|
var fn, val;
|
|
if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
|
if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
|
if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
|
throw TypeError("Can't convert object to primitive value");
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "c430":
|
|
/***/ (function(module, exports) {
|
|
|
|
module.exports = false;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "c6b6":
|
|
/***/ (function(module, exports) {
|
|
|
|
var toString = {}.toString;
|
|
|
|
module.exports = function (it) {
|
|
return toString.call(it).slice(8, -1);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "c6cd":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var global = __webpack_require__("da84");
|
|
var setGlobal = __webpack_require__("ce4e");
|
|
|
|
var SHARED = '__core-js_shared__';
|
|
var store = global[SHARED] || setGlobal(SHARED, {});
|
|
|
|
module.exports = store;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "c700":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// @ts-ignore
|
|
try {
|
|
self['workbox:precaching:6.1.5'] && _();
|
|
}
|
|
catch (e) { }
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "c8ba":
|
|
/***/ (function(module, exports) {
|
|
|
|
var g;
|
|
|
|
// This works in non-strict mode
|
|
g = (function() {
|
|
return this;
|
|
})();
|
|
|
|
try {
|
|
// This works if eval is allowed (see CSP)
|
|
g = g || new Function("return this")();
|
|
} catch (e) {
|
|
// This works if the window reference is available
|
|
if (typeof window === "object") g = window;
|
|
}
|
|
|
|
// g can still be undefined, but nothing to do about it...
|
|
// We return undefined, instead of nothing here, so it's
|
|
// easier to handle this case. if(!global) { ...}
|
|
|
|
module.exports = g;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "ca84":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var has = __webpack_require__("5135");
|
|
var toIndexedObject = __webpack_require__("fc6a");
|
|
var indexOf = __webpack_require__("4d64").indexOf;
|
|
var hiddenKeys = __webpack_require__("d012");
|
|
|
|
module.exports = function (object, names) {
|
|
var O = toIndexedObject(object);
|
|
var i = 0;
|
|
var result = [];
|
|
var key;
|
|
for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
|
// Don't enum bug & hidden keys
|
|
while (names.length > i) if (has(O, key = names[i++])) {
|
|
~indexOf(result, key) || result.push(key);
|
|
}
|
|
return result;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "cc12":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var global = __webpack_require__("da84");
|
|
var isObject = __webpack_require__("861d");
|
|
|
|
var document = global.document;
|
|
// typeof document.createElement is 'object' in old IE
|
|
var EXISTS = isObject(document) && isObject(document.createElement);
|
|
|
|
module.exports = function (it) {
|
|
return EXISTS ? document.createElement(it) : {};
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "ce4e":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var global = __webpack_require__("da84");
|
|
var createNonEnumerableProperty = __webpack_require__("9112");
|
|
|
|
module.exports = function (key, value) {
|
|
try {
|
|
createNonEnumerableProperty(global, key, value);
|
|
} catch (error) {
|
|
global[key] = value;
|
|
} return value;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "d012":
|
|
/***/ (function(module, exports) {
|
|
|
|
module.exports = {};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "d039":
|
|
/***/ (function(module, exports) {
|
|
|
|
module.exports = function (exec) {
|
|
try {
|
|
return !!exec();
|
|
} catch (error) {
|
|
return true;
|
|
}
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "d066":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var path = __webpack_require__("428f");
|
|
var global = __webpack_require__("da84");
|
|
|
|
var aFunction = function (variable) {
|
|
return typeof variable == 'function' ? variable : undefined;
|
|
};
|
|
|
|
module.exports = function (namespace, method) {
|
|
return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
|
|
: path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "d1e7":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
|
|
// Nashorn ~ JDK8 bug
|
|
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
|
|
|
// `Object.prototype.propertyIsEnumerable` method implementation
|
|
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
|
|
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
var descriptor = getOwnPropertyDescriptor(this, V);
|
|
return !!descriptor && descriptor.enumerable;
|
|
} : $propertyIsEnumerable;
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "d2bb":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
/* eslint-disable no-proto -- safe */
|
|
var anObject = __webpack_require__("825a");
|
|
var aPossiblePrototype = __webpack_require__("3bbe");
|
|
|
|
// `Object.setPrototypeOf` method
|
|
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
var CORRECT_SETTER = false;
|
|
var test = {};
|
|
var setter;
|
|
try {
|
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
|
setter.call(test, []);
|
|
CORRECT_SETTER = test instanceof Array;
|
|
} catch (error) { /* empty */ }
|
|
return function setPrototypeOf(O, proto) {
|
|
anObject(O);
|
|
aPossiblePrototype(proto);
|
|
if (CORRECT_SETTER) setter.call(O, proto);
|
|
else O.__proto__ = proto;
|
|
return O;
|
|
};
|
|
}() : undefined);
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "d3b7":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
|
|
var redefine = __webpack_require__("6eeb");
|
|
var toString = __webpack_require__("b041");
|
|
|
|
// `Object.prototype.toString` method
|
|
// https://tc39.es/ecma262/#sec-object.prototype.tostring
|
|
if (!TO_STRING_TAG_SUPPORT) {
|
|
redefine(Object.prototype, 'toString', toString, { unsafe: true });
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "d784":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// TODO: Remove from `core-js@4` since it's moved to entry points
|
|
__webpack_require__("ac1f");
|
|
var redefine = __webpack_require__("6eeb");
|
|
var regexpExec = __webpack_require__("9263");
|
|
var fails = __webpack_require__("d039");
|
|
var wellKnownSymbol = __webpack_require__("b622");
|
|
var createNonEnumerableProperty = __webpack_require__("9112");
|
|
|
|
var SPECIES = wellKnownSymbol('species');
|
|
var RegExpPrototype = RegExp.prototype;
|
|
|
|
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
|
// #replace needs built-in support for named groups.
|
|
// #match works fine because it just return the exec results, even if it has
|
|
// a "grops" property.
|
|
var re = /./;
|
|
re.exec = function () {
|
|
var result = [];
|
|
result.groups = { a: '7' };
|
|
return result;
|
|
};
|
|
return ''.replace(re, '$<a>') !== '7';
|
|
});
|
|
|
|
// IE <= 11 replaces $0 with the whole match, as if it was $&
|
|
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
|
|
var REPLACE_KEEPS_$0 = (function () {
|
|
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
|
|
return 'a'.replace(/./, '$0') === '$0';
|
|
})();
|
|
|
|
var REPLACE = wellKnownSymbol('replace');
|
|
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
|
|
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
|
if (/./[REPLACE]) {
|
|
return /./[REPLACE]('a', '$0') === '';
|
|
}
|
|
return false;
|
|
})();
|
|
|
|
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
|
|
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
|
|
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
|
// eslint-disable-next-line regexp/no-empty-group -- required for testing
|
|
var re = /(?:)/;
|
|
var originalExec = re.exec;
|
|
re.exec = function () { return originalExec.apply(this, arguments); };
|
|
var result = 'ab'.split(re);
|
|
return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
|
});
|
|
|
|
module.exports = function (KEY, length, exec, sham) {
|
|
var SYMBOL = wellKnownSymbol(KEY);
|
|
|
|
var DELEGATES_TO_SYMBOL = !fails(function () {
|
|
// String methods call symbol-named RegEp methods
|
|
var O = {};
|
|
O[SYMBOL] = function () { return 7; };
|
|
return ''[KEY](O) != 7;
|
|
});
|
|
|
|
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
|
// Symbol-named RegExp methods call .exec
|
|
var execCalled = false;
|
|
var re = /a/;
|
|
|
|
if (KEY === 'split') {
|
|
// We can't use real regex here since it causes deoptimization
|
|
// and serious performance degradation in V8
|
|
// https://github.com/zloirock/core-js/issues/306
|
|
re = {};
|
|
// RegExp[@@split] doesn't call the regex's exec method, but first creates
|
|
// a new one. We need to return the patched regex when creating the new one.
|
|
re.constructor = {};
|
|
re.constructor[SPECIES] = function () { return re; };
|
|
re.flags = '';
|
|
re[SYMBOL] = /./[SYMBOL];
|
|
}
|
|
|
|
re.exec = function () { execCalled = true; return null; };
|
|
|
|
re[SYMBOL]('');
|
|
return !execCalled;
|
|
});
|
|
|
|
if (
|
|
!DELEGATES_TO_SYMBOL ||
|
|
!DELEGATES_TO_EXEC ||
|
|
(KEY === 'replace' && !(
|
|
REPLACE_SUPPORTS_NAMED_GROUPS &&
|
|
REPLACE_KEEPS_$0 &&
|
|
!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
|
|
)) ||
|
|
(KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
|
) {
|
|
var nativeRegExpMethod = /./[SYMBOL];
|
|
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
|
var $exec = regexp.exec;
|
|
if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
|
|
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
|
// The native String method already delegates to @@method (this
|
|
// polyfilled function), leasing to infinite recursion.
|
|
// We avoid it by directly calling the native @@method method.
|
|
return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
|
|
}
|
|
return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
|
}
|
|
return { done: false };
|
|
}, {
|
|
REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
|
|
REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
|
|
});
|
|
var stringMethod = methods[0];
|
|
var regexMethod = methods[1];
|
|
|
|
redefine(String.prototype, KEY, stringMethod);
|
|
redefine(RegExpPrototype, SYMBOL, length == 2
|
|
// 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
|
|
// 21.2.5.11 RegExp.prototype[@@split](string, limit)
|
|
? function (string, arg) { return regexMethod.call(string, this, arg); }
|
|
// 21.2.5.6 RegExp.prototype[@@match](string)
|
|
// 21.2.5.9 RegExp.prototype[@@search](string)
|
|
: function (string) { return regexMethod.call(string, this); }
|
|
);
|
|
}
|
|
|
|
if (sham) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "d8a5":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// @ts-ignore
|
|
try {
|
|
self['workbox:expiration:6.1.5'] && _();
|
|
}
|
|
catch (e) { }
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "da84":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
/* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
|
|
return it && it.Math == Math && it;
|
|
};
|
|
|
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
module.exports =
|
|
// eslint-disable-next-line es/no-global-this -- safe
|
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
check(typeof window == 'object' && window) ||
|
|
// eslint-disable-next-line no-restricted-globals -- safe
|
|
check(typeof self == 'object' && self) ||
|
|
check(typeof global == 'object' && global) ||
|
|
// eslint-disable-next-line no-new-func -- fallback
|
|
(function () { return this; })() || Function('return this')();
|
|
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
|
|
|
|
/***/ }),
|
|
|
|
/***/ "e6d2":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
|
|
// @ts-ignore
|
|
try {
|
|
self['workbox:routing:6.1.5'] && _();
|
|
}
|
|
catch (e) { }
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "e893":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var has = __webpack_require__("5135");
|
|
var ownKeys = __webpack_require__("56ef");
|
|
var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
|
|
var definePropertyModule = __webpack_require__("9bf2");
|
|
|
|
module.exports = function (target, source) {
|
|
var keys = ownKeys(source);
|
|
var defineProperty = definePropertyModule.f;
|
|
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
|
for (var i = 0; i < keys.length; i++) {
|
|
var key = keys[i];
|
|
if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
|
}
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "f5df":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
|
|
var classofRaw = __webpack_require__("c6b6");
|
|
var wellKnownSymbol = __webpack_require__("b622");
|
|
|
|
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
// ES3 wrong here
|
|
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
|
|
|
// fallback for IE11 Script Access Denied error
|
|
var tryGet = function (it, key) {
|
|
try {
|
|
return it[key];
|
|
} catch (error) { /* empty */ }
|
|
};
|
|
|
|
// getting tag from ES6+ `Object.prototype.toString`
|
|
module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
var O, tag, result;
|
|
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
// @@toStringTag case
|
|
: typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
// builtinTag case
|
|
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
// ES3 arguments fallback
|
|
: (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "f772":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
var shared = __webpack_require__("5692");
|
|
var uid = __webpack_require__("90e3");
|
|
|
|
var keys = shared('keys');
|
|
|
|
module.exports = function (key) {
|
|
return keys[key] || (keys[key] = uid(key));
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "fc6a":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
// toObject with fallback for non-array-like ES3 strings
|
|
var IndexedObject = __webpack_require__("44ad");
|
|
var requireObjectCoercible = __webpack_require__("1d80");
|
|
|
|
module.exports = function (it) {
|
|
return IndexedObject(requireObjectCoercible(it));
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ "fdbf":
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
var NATIVE_SYMBOL = __webpack_require__("4930");
|
|
|
|
module.exports = NATIVE_SYMBOL
|
|
&& !Symbol.sham
|
|
&& typeof Symbol.iterator == 'symbol';
|
|
|
|
|
|
/***/ })
|
|
|
|
/******/ });
|
|
=======
|
|
(function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="249e")})({"00ee":function(t,e,n){var r=n("b622"),o=r("toStringTag"),i={};i[o]="z",t.exports="[object z]"===String(i)},"06cf":function(t,e,n){var r=n("83ab"),o=n("d1e7"),i=n("5c6c"),a=n("fc6a"),c=n("c04e"),s=n("5135"),u=n("0cfb"),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=a(t),e=c(e,!0),u)try{return l(t,e)}catch(n){}if(s(t,e))return i(!o.f.call(t,e),t[e])}},"0719":function(t,e,n){"use strict";try{self["workbox:core:6.1.5"]&&_()}catch(r){}},"0cfb":function(t,e,n){var r=n("83ab"),o=n("d039"),i=n("cc12");t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},"14c3":function(t,e,n){var r=n("c6b6"),o=n("9263");t.exports=function(t,e){var n=t.exec;if("function"===typeof n){var i=n.call(t,e);if("object"!==typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},"1d80":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"23cb":function(t,e,n){var r=n("a691"),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},"23e7":function(t,e,n){var r=n("da84"),o=n("06cf").f,i=n("9112"),a=n("6eeb"),c=n("ce4e"),s=n("e893"),u=n("94ca");t.exports=function(t,e){var n,l,h,f,p,d,g=t.target,y=t.global,m=t.stat;if(l=y?r:m?r[g]||c(g,{}):(r[g]||{}).prototype,l)for(h in e){if(p=e[h],t.noTargetGet?(d=o(l,h),f=d&&d.value):f=l[h],n=u(y?h:g+(m?".":"#")+h,t.forced),!n&&void 0!==f){if(typeof p===typeof f)continue;s(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),a(l,h,p,t)}}},"241c":function(t,e,n){var r=n("ca84"),o=n("7839"),i=o.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},"249e":function(t,e,n){"use strict";n.r(e);n("d3b7");function r(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(u){return void n(u)}c.done?e(s):Promise.resolve(s).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,s,"next",t)}function s(t){r(a,o,i,c,s,"throw",t)}c(void 0)}))}}n("ac1f"),n("466d"),n("4d63"),n("25f0"),n("96cf"),n("0719");const i=(t,...e)=>{let n=t;return e.length>0&&(n+=" :: "+JSON.stringify(e)),n},a=i;class c extends Error{constructor(t,e){const n=a(t,e);super(n),this.name=t,this.details=e}}const s={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!==typeof registration?registration.scope:""},u=t=>[s.prefix,t,s.suffix].filter(t=>t&&t.length>0).join("-"),l=t=>{for(const e of Object.keys(s))t(e)},h={updateDetails:t=>{l(e=>{"string"===typeof t[e]&&(s[e]=t[e])})},getGoogleAnalyticsName:t=>t||u(s.googleAnalytics),getPrecacheName:t=>t||u(s.precache),getPrefix:()=>s.prefix,getRuntimeName:t=>t||u(s.runtime),getSuffix:()=>s.suffix};n("c700");let f;function p(){if(void 0===f){const e=new Response("");if("body"in e)try{new Response(e.body),f=!0}catch(t){f=!1}f=!1}return f}async function d(t,e){let n=null;if(t.url){const e=new URL(t.url);n=e.origin}if(n!==self.location.origin)throw new c("cross-origin-copy-response",{origin:n});const r=t.clone(),o={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},i=e?e(o):o,a=p()?r.body:await r.blob();return new Response(a,i)}const g=t=>{const e=new URL(String(t),location.href);return e.href.replace(new RegExp("^"+location.origin),"")};function y(t,e){const n=new URL(t);for(const r of e)n.searchParams.delete(r);return n.href}async function m(t,e,n,r){const o=y(e.url,n);if(e.url===o)return t.match(e,r);const i={...r,ignoreSearch:!0},a=await t.keys(e,i);for(const c of a){const e=y(c.url,n);if(o===e)return t.match(c,r)}}class v{constructor(){this.promise=new Promise((t,e)=>{this.resolve=t,this.reject=e})}}const w=new Set;async function b(){for(const t of w)await t()}function x(t){return new Promise(e=>setTimeout(e,t))}n("6aa8");function _(t){return"string"===typeof t?new Request(t):t}class E{constructor(t,e){this._cacheKeys={},Object.assign(this,e),this.event=e.event,this._strategy=t,this._handlerDeferred=new v,this._extendLifetimePromises=[],this._plugins=[...t.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(t){const{event:e}=this;let n=_(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const r=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(i){throw new c("plugin-error-request-will-fetch",{thrownError:i})}const o=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this._strategy.fetchOptions);for(const n of this.iterateCallbacks("fetchDidSucceed"))t=await n({event:e,request:o,response:t});return t}catch(a){throw r&&await this.runCallbacks("fetchDidFail",{error:a,event:e,originalRequest:r.clone(),request:o.clone()}),a}}async fetchAndCachePut(t){const e=await this.fetch(t),n=e.clone();return this.waitUntil(this.cachePut(t,n)),e}async cacheMatch(t){const e=_(t);let n;const{cacheName:r,matchOptions:o}=this._strategy,i=await this.getCacheKey(e,"read"),a={...o,cacheName:r};n=await caches.match(i,a);for(const c of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await c({cacheName:r,matchOptions:o,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(t,e){const n=_(t);await x(0);const r=await this.getCacheKey(n,"write");if(!e)throw new c("cache-put-with-no-response",{url:g(r.url)});const o=await this._ensureResponseSafeToCache(e);if(!o)return!1;const{cacheName:i,matchOptions:a}=this._strategy,s=await self.caches.open(i),u=this.hasCallback("cacheDidUpdate"),l=u?await m(s,r.clone(),["__WB_REVISION__"],a):null;try{await s.put(r,u?o.clone():o)}catch(h){throw"QuotaExceededError"===h.name&&await b(),h}for(const c of this.iterateCallbacks("cacheDidUpdate"))await c({cacheName:i,oldResponse:l,newResponse:o.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){if(!this._cacheKeys[e]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=_(await t({mode:e,request:n,event:this.event,params:this.params}));this._cacheKeys[e]=n}return this._cacheKeys[e]}hasCallback(t){for(const e of this._strategy.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const n of this.iterateCallbacks(t))await n(e)}*iterateCallbacks(t){for(const e of this._strategy.plugins)if("function"===typeof e[t]){const n=this._pluginStateMap.get(e),r=r=>{const o={...r,state:n};return e[t](o)};yield r}}waitUntil(t){return this._extendLifetimePromises.push(t),t}async doneWaiting(){let t;while(t=this._extendLifetimePromises.shift())await t}destroy(){this._handlerDeferred.resolve()}async _ensureResponseSafeToCache(t){let e=t,n=!1;for(const r of this.iterateCallbacks("cacheWillUpdate"))if(e=await r({request:this.request,response:e,event:this.event})||void 0,n=!0,!e)break;return n||e&&200!==e.status&&(e=void 0),e}}class R{constructor(t={}){this.cacheName=h.getRuntimeName(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,n="string"===typeof t.request?new Request(t.request):t.request,r="params"in t?t.params:void 0,o=new E(this,{event:e,request:n,params:r}),i=this._getResponse(o,n,e),a=this._awaitComplete(i,o,n,e);return[i,a]}async _getResponse(t,e,n){await t.runCallbacks("handlerWillStart",{event:n,request:e});let r=void 0;try{if(r=await this._handle(e,t),!r||"error"===r.type)throw new c("no-response",{url:e.url})}catch(o){for(const i of t.iterateCallbacks("handlerDidError"))if(r=await i({error:o,event:n,request:e}),r)break;if(!r)throw o}for(const i of t.iterateCallbacks("handlerWillRespond"))r=await i({event:n,request:e,response:r});return r}async _awaitComplete(t,e,n,r){let o,i;try{o=await t}catch(i){}try{await e.runCallbacks("handlerDidRespond",{event:r,request:n,response:o}),await e.doneWaiting()}catch(a){i=a}if(await e.runCallbacks("handlerDidComplete",{event:r,request:n,response:o,error:i}),e.destroy(),i)throw i}}class S extends R{constructor(t={}){t.cacheName=h.getPrecacheName(t.cacheName),super(t),this._fallbackToNetwork=!1!==t.fallbackToNetwork,this.plugins.push(S.copyRedirectedCacheableResponsesPlugin)}async _handle(t,e){const n=await e.cacheMatch(t);return n||(e.event&&"install"===e.event.type?await this._handleInstall(t,e):await this._handleFetch(t,e))}async _handleFetch(t,e){let n;if(!this._fallbackToNetwork)throw new c("missing-precache-entry",{cacheName:this.cacheName,url:t.url});return n=await e.fetch(t),n}async _handleInstall(t,e){this._useDefaultCacheabilityPluginIfNeeded();const n=await e.fetch(t),r=await e.cachePut(t,n.clone());if(!r)throw new c("bad-precaching-response",{url:t.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let t=null,e=0;for(const[n,r]of this.plugins.entries())r!==S.copyRedirectedCacheableResponsesPlugin&&(r===S.defaultPrecacheCacheabilityPlugin&&(t=n),r.cacheWillUpdate&&e++);0===e?this.plugins.push(S.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}S.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:t}){return!t||t.status>=400?null:t}},S.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:t}){return t.redirected?await d(t):t}};n("e6d2");const O="GET",P=t=>t&&"object"===typeof t?t:{handle:t};class N{constructor(t,e,n=O){this.handler=P(e),this.match=t,this.method=n}setCatchHandler(t){this.catchHandler=P(t)}}class T extends N{constructor(t,e,n){const r=({url:e})=>{const n=t.exec(e.href);if(n&&(e.origin===location.origin||0===n.index))return n.slice(1)};super(r,e,n)}}class j{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",t=>{const{request:e}=t,n=this.handleRequest({request:e,event:t});n&&t.respondWith(n)})}addCacheListener(){self.addEventListener("message",t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data;0;const n=Promise.all(e.urlsToCache.map(e=>{"string"===typeof e&&(e=[e]);const n=new Request(...e);return this.handleRequest({request:n,event:t})}));t.waitUntil(n),t.ports&&t.ports[0]&&n.then(()=>t.ports[0].postMessage(!0))}})}handleRequest({request:t,event:e}){const n=new URL(t.url,location.href);if(!n.protocol.startsWith("http"))return void 0;const r=n.origin===location.origin,{params:o,route:i}=this.findMatchingRoute({event:e,request:t,sameOrigin:r,url:n});let a=i&&i.handler;const c=t.method;if(!a&&this._defaultHandlerMap.has(c)&&(a=this._defaultHandlerMap.get(c)),!a)return void 0;let s;try{s=a.handle({url:n,request:t,event:e,params:o})}catch(l){s=Promise.reject(l)}const u=i&&i.catchHandler;return s instanceof Promise&&(this._catchHandler||u)&&(s=s.catch(async r=>{if(u){0;try{return await u.handle({url:n,request:t,event:e,params:o})}catch(i){r=i}}if(this._catchHandler)return this._catchHandler.handle({url:n,request:t,event:e});throw r})),s}findMatchingRoute({url:t,sameOrigin:e,request:n,event:r}){const o=this._routes.get(n.method)||[];for(const i of o){let o;const a=i.match({url:t,sameOrigin:e,request:n,event:r});if(a)return o=a,(Array.isArray(a)&&0===a.length||a.constructor===Object&&0===Object.keys(a).length||"boolean"===typeof a)&&(o=void 0),{route:i,params:o}}return{}}setDefaultHandler(t,e=O){this._defaultHandlerMap.set(e,P(t))}setCatchHandler(t){this._catchHandler=P(t)}registerRoute(t){this._routes.has(t.method)||this._routes.set(t.method,[]),this._routes.get(t.method).push(t)}unregisterRoute(t){if(!this._routes.has(t.method))throw new c("unregister-route-but-not-found-with-method",{method:t.method});const e=this._routes.get(t.method).indexOf(t);if(!(e>-1))throw new c("unregister-route-route-not-registered");this._routes.get(t.method).splice(e,1)}}let k;const C=()=>(k||(k=new j,k.addFetchListener(),k.addCacheListener()),k);function q(t,e,n){let r;if("string"===typeof t){const o=new URL(t,location.href);0;const i=({url:t})=>t.href===o.href;r=new N(i,e,n)}else if(t instanceof RegExp)r=new T(t,e,n);else if("function"===typeof t)r=new N(t,e,n);else{if(!(t instanceof N))throw new c("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});r=t}const o=C();return o.registerRoute(r),r}function A(t){const e=C();e.setCatchHandler(t)}class L extends R{async _handle(t,e){let n,r=await e.cacheMatch(t);if(r)0;else{0;try{r=await e.fetchAndCachePut(t)}catch(o){n=o}0}if(!r)throw new c("no-response",{url:t.url,error:n});return r}}const M={cacheWillUpdate:async({response:t})=>200===t.status||0===t.status?t:null};class I extends R{constructor(t={}){super(t),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(M),this._networkTimeoutSeconds=t.networkTimeoutSeconds||0}async _handle(t,e){const n=[];const r=[];let o;if(this._networkTimeoutSeconds){const{id:i,promise:a}=this._getTimeoutPromise({request:t,logs:n,handler:e});o=i,r.push(a)}const i=this._getNetworkPromise({timeoutId:o,request:t,logs:n,handler:e});r.push(i);const a=await e.waitUntil((async()=>await e.waitUntil(Promise.race(r))||await i)());if(!a)throw new c("no-response",{url:t.url});return a}_getTimeoutPromise({request:t,logs:e,handler:n}){let r;const o=new Promise(e=>{const o=async()=>{e(await n.cacheMatch(t))};r=setTimeout(o,1e3*this._networkTimeoutSeconds)});return{promise:o,id:r}}async _getNetworkPromise({timeoutId:t,request:e,logs:n,handler:r}){let o,i;try{i=await r.fetchAndCachePut(e)}catch(a){o=a}return t&&clearTimeout(t),!o&&i||(i=await r.cacheMatch(e)),i}}class U extends R{constructor(t){super(t),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(M)}async _handle(t,e){const n=e.fetchAndCachePut(t).catch(()=>{});let r,o=await e.cacheMatch(t);if(o)0;else{0;try{o=await n}catch(i){r=i}}if(!o)throw new c("no-response",{url:t.url,error:r});return o}}function D(t){t.then(()=>{})}class F{constructor(t,e,{onupgradeneeded:n,onversionchange:r}={}){this._db=null,this._name=t,this._version=e,this._onupgradeneeded=n,this._onversionchange=r||(()=>this.close())}get db(){return this._db}async open(){if(!this._db)return this._db=await new Promise((t,e)=>{let n=!1;setTimeout(()=>{n=!0,e(new Error("The open request was blocked and timed out"))},this.OPEN_TIMEOUT);const r=indexedDB.open(this._name,this._version);r.onerror=()=>e(r.error),r.onupgradeneeded=t=>{n?(r.transaction.abort(),r.result.close()):"function"===typeof this._onupgradeneeded&&this._onupgradeneeded(t)},r.onsuccess=()=>{const e=r.result;n?e.close():(e.onversionchange=this._onversionchange.bind(this),t(e))}}),this}async getKey(t,e){return(await this.getAllKeys(t,e,1))[0]}async getAll(t,e,n){return await this.getAllMatching(t,{query:e,count:n})}async getAllKeys(t,e,n){const r=await this.getAllMatching(t,{query:e,count:n,includeKeys:!0});return r.map(t=>t.key)}async getAllMatching(t,{index:e,query:n=null,direction:r="next",count:o,includeKeys:i=!1}={}){return await this.transaction([t],"readonly",(a,c)=>{const s=a.objectStore(t),u=e?s.index(e):s,l=[],h=u.openCursor(n,r);h.onsuccess=()=>{const t=h.result;t?(l.push(i?t:t.value),o&&l.length>=o?c(l):t.continue()):c(l)}})}async transaction(t,e,n){return await this.open(),await new Promise((r,o)=>{const i=this._db.transaction(t,e);i.onabort=()=>o(i.error),i.oncomplete=()=>r(),n(i,t=>r(t))})}async _call(t,e,n,...r){const o=(n,o)=>{const i=n.objectStore(e),a=i[t].apply(i,r);a.onsuccess=()=>o(a.result)};return await this.transaction([e],n,o)}close(){this._db&&(this._db.close(),this._db=null)}}F.prototype.OPEN_TIMEOUT=2e3;const W={readonly:["get","count","getKey","getAll","getAllKeys"],readwrite:["add","put","clear","delete"]};for(const[Z,tt]of Object.entries(W))for(const t of tt)t in IDBObjectStore.prototype&&(F.prototype[t]=async function(e,...n){return await this._call(t,e,Z,...n)});const H=async t=>{await new Promise((e,n)=>{const r=indexedDB.deleteDatabase(t);r.onerror=()=>{n(r.error)},r.onblocked=()=>{n(new Error("Delete blocked"))},r.onsuccess=()=>{e()}})};n("d8a5");const K="workbox-expiration",G="cache-entries",B=t=>{const e=new URL(t,location.href);return e.hash="",e.href};class z{constructor(t){this._cacheName=t,this._db=new F(K,1,{onupgradeneeded:t=>this._handleUpgrade(t)})}_handleUpgrade(t){const e=t.target.result,n=e.createObjectStore(G,{keyPath:"id"});n.createIndex("cacheName","cacheName",{unique:!1}),n.createIndex("timestamp","timestamp",{unique:!1}),H(this._cacheName)}async setTimestamp(t,e){t=B(t);const n={url:t,timestamp:e,cacheName:this._cacheName,id:this._getId(t)};await this._db.put(G,n)}async getTimestamp(t){const e=await this._db.get(G,this._getId(t));return e.timestamp}async expireEntries(t,e){const n=await this._db.transaction(G,"readwrite",(n,r)=>{const o=n.objectStore(G),i=o.index("timestamp").openCursor(null,"prev"),a=[];let c=0;i.onsuccess=()=>{const n=i.result;if(n){const r=n.value;r.cacheName===this._cacheName&&(t&&r.timestamp<t||e&&c>=e?a.push(n.value):c++),n.continue()}else r(a)}}),r=[];for(const o of n)await this._db.delete(G,o.id),r.push(o.url);return r}_getId(t){return this._cacheName+"|"+B(t)}}class Y{constructor(t,e={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=e.maxEntries,this._maxAgeSeconds=e.maxAgeSeconds,this._matchOptions=e.matchOptions,this._cacheName=t,this._timestampModel=new z(t)}async expireEntries(){if(this._isRunning)return void(this._rerunRequested=!0);this._isRunning=!0;const t=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,e=await this._timestampModel.expireEntries(t,this._maxEntries),n=await self.caches.open(this._cacheName);for(const r of e)await n.delete(r,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,D(this.expireEntries()))}async updateTimestamp(t){await this._timestampModel.setTimestamp(t,Date.now())}async isURLExpired(t){if(this._maxAgeSeconds){const e=await this._timestampModel.getTimestamp(t),n=Date.now()-1e3*this._maxAgeSeconds;return e<n}return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}function $(t){w.add(t)}class Q{constructor(t={}){this.cachedResponseWillBeUsed=async({event:t,request:e,cacheName:n,cachedResponse:r})=>{if(!r)return null;const o=this._isResponseDateFresh(r),i=this._getCacheExpiration(n);D(i.expireEntries());const a=i.updateTimestamp(e.url);if(t)try{t.waitUntil(a)}catch(c){0}return o?r:null},this.cacheDidUpdate=async({cacheName:t,request:e})=>{const n=this._getCacheExpiration(t);await n.updateTimestamp(e.url),await n.expireEntries()},this._config=t,this._maxAgeSeconds=t.maxAgeSeconds,this._cacheExpirations=new Map,t.purgeOnQuotaError&&$(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(t){if(t===h.getRuntimeName())throw new c("expire-custom-caches-only");let e=this._cacheExpirations.get(t);return e||(e=new Y(t,this._config),this._cacheExpirations.set(t,e)),e}_isResponseDateFresh(t){if(!this._maxAgeSeconds)return!0;const e=this._getDateHeaderTimestamp(t);if(null===e)return!0;const n=Date.now();return e>=n-1e3*this._maxAgeSeconds}_getDateHeaderTimestamp(t){if(!t.headers.has("date"))return null;const e=t.headers.get("date"),n=new Date(e),r=n.getTime();return isNaN(r)?null:r}async deleteCacheAndMetadata(){for(const[t,e]of this._cacheExpirations)await self.caches.delete(t),await e.delete();this._cacheExpirations=new Map}}var V="offline-html",J="undefined"!==typeof window?localStorage.getItem("SCRIPT_NAME"):"/",X=J+"offline/";self.addEventListener("install",function(){var t=o(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.waitUntil(caches.open(V).then((function(t){return t.add(new Request(X,{cache:"reload"}))})));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),[{'url':'static/vue/cookbook_view.html'},{'url':'static/vue/css/chunk-vendors.css'},{'url':'static/vue/css/cookbook_view.css'},{'url':'static/vue/css/model_list_view.css'},{'url':'static/vue/css/recipe_search_view.css'},{'url':'static/vue/css/recipe_view.css'},{'url':'static/vue/import_response_view.html'},{'url':'static/vue/js/chunk-vendors.js'},{'url':'static/vue/js/cookbook_view.js'},{'url':'static/vue/js/import_response_view.js'},{'url':'static/vue/js/model_list_view.js'},{'url':'static/vue/js/offline_view.js'},{'url':'static/vue/js/recipe_search_view.js'},{'url':'static/vue/js/recipe_view.js'},{'url':'static/vue/js/supermarket_view.js'},{'url':'static/vue/js/user_file_view.js'},{'url':'static/vue/manifest.json'},{'url':'static/vue/model_list_view.html'},{'url':'static/vue/offline_view.html'},{'url':'static/vue/recipe_search_view.html'},{'url':'static/vue/recipe_view.html'},{'url':'static/vue/supermarket_view.html'},{'url':'static/vue/user_file_view.html'}],A((function(t){var e=t.event;switch(e.request.destination){case"document":return console.log("Triggered fallback HTML"),caches.open(V).then((function(t){return t.match(X)}));default:return console.log("Triggered response ERROR"),Response.error()}})),q((function(t){var e=t.request;return"image"===e.destination}),new L({cacheName:"images",plugins:[new Q({maxEntries:20})]})),q((function(t){var e=t.request;return"script"===e.destination||"style"===e.destination}),new U({cacheName:"assets"})),q(new RegExp("jsreverse"),new U({cacheName:"assets"})),q(new RegExp("jsi18n"),new U({cacheName:"assets"})),q(new RegExp("api/recipe/([0-9]+)"),new I({cacheName:"api-recipe",plugins:[new Q({maxEntries:50})]})),q(new RegExp("api/*"),new I({cacheName:"api",plugins:[new Q({maxEntries:50})]})),q((function(t){var e=t.request;return"document"===e.destination}),new I({cacheName:"html",plugins:[new Q({maxAgeSeconds:2592e3,maxEntries:50})]}))},"25f0":function(t,e,n){"use strict";var r=n("6eeb"),o=n("825a"),i=n("d039"),a=n("ad6d"),c="toString",s=RegExp.prototype,u=s[c],l=i((function(){return"/a/b"!=u.call({source:"a",flags:"b"})})),h=u.name!=c;(l||h)&&r(RegExp.prototype,c,(function(){var t=o(this),e=String(t.source),n=t.flags,r=String(void 0===n&&t instanceof RegExp&&!("flags"in s)?a.call(t):n);return"/"+e+"/"+r}),{unsafe:!0})},2626:function(t,e,n){"use strict";var r=n("d066"),o=n("9bf2"),i=n("b622"),a=n("83ab"),c=i("species");t.exports=function(t){var e=r(t),n=o.f;a&&e&&!e[c]&&n(e,c,{configurable:!0,get:function(){return this}})}},"2d00":function(t,e,n){var r,o,i=n("da84"),a=n("342f"),c=i.process,s=c&&c.versions,u=s&&s.v8;u?(r=u.split("."),o=r[0]<4?1:r[0]+r[1]):a&&(r=a.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/),r&&(o=r[1]))),t.exports=o&&+o},"342f":function(t,e,n){var r=n("d066");t.exports=r("navigator","userAgent")||""},"3bbe":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"428f":function(t,e,n){var r=n("da84");t.exports=r},"44ad":function(t,e,n){var r=n("d039"),o=n("c6b6"),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},"44e7":function(t,e,n){var r=n("861d"),o=n("c6b6"),i=n("b622"),a=i("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[a])?!!e:"RegExp"==o(t))}},"466d":function(t,e,n){"use strict";var r=n("d784"),o=n("825a"),i=n("50c4"),a=n("1d80"),c=n("8aa5"),s=n("14c3");r("match",1,(function(t,e,n){return[function(e){var n=a(this),r=void 0==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var a=o(t),u=String(this);if(!a.global)return s(a,u);var l=a.unicode;a.lastIndex=0;var h,f=[],p=0;while(null!==(h=s(a,u))){var d=String(h[0]);f[p]=d,""===d&&(a.lastIndex=c(u,i(a.lastIndex),l)),p++}return 0===p?null:f}]}))},4930:function(t,e,n){var r=n("2d00"),o=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},"4d63":function(t,e,n){var r=n("83ab"),o=n("da84"),i=n("94ca"),a=n("7156"),c=n("9bf2").f,s=n("241c").f,u=n("44e7"),l=n("ad6d"),h=n("9f7f"),f=n("6eeb"),p=n("d039"),d=n("69f3").enforce,g=n("2626"),y=n("b622"),m=y("match"),v=o.RegExp,w=v.prototype,b=/a/g,x=/a/g,_=new v(b)!==b,E=h.UNSUPPORTED_Y,R=r&&i("RegExp",!_||E||p((function(){return x[m]=!1,v(b)!=b||v(x)==x||"/a/i"!=v(b,"i")})));if(R){var S=function(t,e){var n,r=this instanceof S,o=u(t),i=void 0===e;if(!r&&o&&t.constructor===S&&i)return t;_?o&&!i&&(t=t.source):t instanceof S&&(i&&(e=l.call(t)),t=t.source),E&&(n=!!e&&e.indexOf("y")>-1,n&&(e=e.replace(/y/g,"")));var c=a(_?new v(t,e):v(t,e),r?this:w,S);if(E&&n){var s=d(c);s.sticky=!0}return c},O=function(t){t in S||c(S,t,{configurable:!0,get:function(){return v[t]},set:function(e){v[t]=e}})},P=s(v),N=0;while(P.length>N)O(P[N++]);w.constructor=S,S.prototype=w,f(o,"RegExp",S)}g("RegExp")},"4d64":function(t,e,n){var r=n("fc6a"),o=n("50c4"),i=n("23cb"),a=function(t){return function(e,n,a){var c,s=r(e),u=o(s.length),l=i(a,u);if(t&&n!=n){while(u>l)if(c=s[l++],c!=c)return!0}else for(;u>l;l++)if((t||l in s)&&s[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},"50c4":function(t,e,n){var r=n("a691"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},5135:function(t,e,n){var r=n("7b0b"),o={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return o.call(r(t),e)}},5692:function(t,e,n){var r=n("c430"),o=n("c6cd");(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.14.0",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,n){var r=n("d066"),o=n("241c"),i=n("7418"),a=n("825a");t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(a(t)),n=i.f;return n?e.concat(n(t)):e}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6547:function(t,e,n){var r=n("a691"),o=n("1d80"),i=function(t){return function(e,n){var i,a,c=String(o(e)),s=r(n),u=c.length;return s<0||s>=u?t?"":void 0:(i=c.charCodeAt(s),i<55296||i>56319||s+1===u||(a=c.charCodeAt(s+1))<56320||a>57343?t?c.charAt(s):i:t?c.slice(s,s+2):a-56320+(i-55296<<10)+65536)}};t.exports={codeAt:i(!1),charAt:i(!0)}},"69f3":function(t,e,n){var r,o,i,a=n("7f9a"),c=n("da84"),s=n("861d"),u=n("9112"),l=n("5135"),h=n("c6cd"),f=n("f772"),p=n("d012"),d="Object already initialized",g=c.WeakMap,y=function(t){return i(t)?o(t):r(t,{})},m=function(t){return function(e){var n;if(!s(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}};if(a||h.state){var v=h.state||(h.state=new g),w=v.get,b=v.has,x=v.set;r=function(t,e){if(b.call(v,t))throw new TypeError(d);return e.facade=t,x.call(v,t,e),e},o=function(t){return w.call(v,t)||{}},i=function(t){return b.call(v,t)}}else{var _=f("state");p[_]=!0,r=function(t,e){if(l(t,_))throw new TypeError(d);return e.facade=t,u(t,_,e),e},o=function(t){return l(t,_)?t[_]:{}},i=function(t){return l(t,_)}}t.exports={set:r,get:o,has:i,enforce:y,getterFor:m}},"6aa8":function(t,e,n){"use strict";try{self["workbox:strategies:6.1.5"]&&_()}catch(r){}},"6eeb":function(t,e,n){var r=n("da84"),o=n("9112"),i=n("5135"),a=n("ce4e"),c=n("8925"),s=n("69f3"),u=s.get,l=s.enforce,h=String(String).split("String");(t.exports=function(t,e,n,c){var s,u=!!c&&!!c.unsafe,f=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),s=l(n),s.source||(s.source=h.join("string"==typeof e?e:""))),t!==r?(u?!p&&t[e]&&(f=!0):delete t[e],f?t[e]=n:o(t,e,n)):f?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||c(this)}))},7156:function(t,e,n){var r=n("861d"),o=n("d2bb");t.exports=function(t,e,n){var i,a;return o&&"function"==typeof(i=e.constructor)&&i!==n&&r(a=i.prototype)&&a!==n.prototype&&o(t,a),t}},7418:function(t,e){e.f=Object.getOwnPropertySymbols},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,n){var r=n("1d80");t.exports=function(t){return Object(r(t))}},"7f9a":function(t,e,n){var r=n("da84"),o=n("8925"),i=r.WeakMap;t.exports="function"===typeof i&&/native code/.test(o(i))},"825a":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,e,n){var r=n("d039");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"861d":function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},8925:function(t,e,n){var r=n("c6cd"),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return o.call(t)}),t.exports=r.inspectSource},"8aa5":function(t,e,n){"use strict";var r=n("6547").charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},"90e3":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+r).toString(36)}},9112:function(t,e,n){var r=n("83ab"),o=n("9bf2"),i=n("5c6c");t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9263:function(t,e,n){"use strict";var r=n("ad6d"),o=n("9f7f"),i=n("5692"),a=RegExp.prototype.exec,c=i("native-string-replace",String.prototype.replace),s=a,u=function(){var t=/a/,e=/b*/g;return a.call(t,"a"),a.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),l=o.UNSUPPORTED_Y||o.BROKEN_CARET,h=void 0!==/()??/.exec("")[1],f=u||h||l;f&&(s=function(t){var e,n,o,i,s=this,f=l&&s.sticky,p=r.call(s),d=s.source,g=0,y=t;return f&&(p=p.replace("y",""),-1===p.indexOf("g")&&(p+="g"),y=String(t).slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==t[s.lastIndex-1])&&(d="(?: "+d+")",y=" "+y,g++),n=new RegExp("^(?:"+d+")",p)),h&&(n=new RegExp("^"+d+"$(?!\\s)",p)),u&&(e=s.lastIndex),o=a.call(f?n:s,y),f?o?(o.input=o.input.slice(g),o[0]=o[0].slice(g),o.index=s.lastIndex,s.lastIndex+=o[0].length):s.lastIndex=0:u&&o&&(s.lastIndex=s.global?o.index+o[0].length:e),h&&o&&o.length>1&&c.call(o[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o}),t.exports=s},"94ca":function(t,e,n){var r=n("d039"),o=/#|\.prototype\./,i=function(t,e){var n=c[a(t)];return n==u||n!=s&&("function"==typeof e?r(e):!!e)},a=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=i.data={},s=i.NATIVE="N",u=i.POLYFILL="P";t.exports=i},"96cf":function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(C){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new T(r||[]);return i._invoke=S(t,n,a),i}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(C){return{type:"throw",arg:C}}}t.wrap=u;var h="suspendedStart",f="suspendedYield",p="executing",d="completed",g={};function y(){}function m(){}function v(){}var w={};w[i]=function(){return this};var b=Object.getPrototypeOf,x=b&&b(b(j([])));x&&x!==n&&r.call(x,i)&&(w=x);var _=v.prototype=y.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function n(o,i,a,c){var s=l(t[o],t,i);if("throw"!==s.type){var u=s.arg,h=u.value;return h&&"object"===typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,c)}))}c(s.arg)}var o;function i(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}this._invoke=i}function S(t,e,n){var r=h;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===d){if("throw"===o)throw i;return k()}n.method=o,n.arg=i;while(1){var a=n.delegate;if(a){var c=O(a,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var s=l(t,e,n);if("normal"===s.type){if(r=n.done?d:f,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=d,n.method="throw",n.arg=s.arg)}}}function O(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator["return"]&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var o=l(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function j(t){if(t){var n=t[i];if(n)return n.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){while(++o<t.length)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:k}}function k(){return{value:e,done:!0}}return m.prototype=_.constructor=v,v.constructor=m,m.displayName=s(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,c,"GeneratorFunction")),t.prototype=Object.create(_),t},t.awrap=function(t){return{__await:t}},E(R.prototype),R.prototype[a]=function(){return this},t.AsyncIterator=R,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new R(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(_),s(_,c,"Generator"),_[i]=function(){return this},_.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){while(e.length){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=j,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),N(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}(t.exports);try{regeneratorRuntime=r}catch(o){Function("r","regeneratorRuntime = r")(r)}},"9bf2":function(t,e,n){var r=n("83ab"),o=n("0cfb"),i=n("825a"),a=n("c04e"),c=Object.defineProperty;e.f=r?c:function(t,e,n){if(i(t),e=a(e,!0),i(n),o)try{return c(t,e,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},"9f7f":function(t,e,n){"use strict";var r=n("d039");function o(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=r((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=r((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},a691:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},ac1f:function(t,e,n){"use strict";var r=n("23e7"),o=n("9263");r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},ad6d:function(t,e,n){"use strict";var r=n("825a");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},b041:function(t,e,n){"use strict";var r=n("00ee"),o=n("f5df");t.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},b622:function(t,e,n){var r=n("da84"),o=n("5692"),i=n("5135"),a=n("90e3"),c=n("4930"),s=n("fdbf"),u=o("wks"),l=r.Symbol,h=s?l:l&&l.withoutSetter||a;t.exports=function(t){return i(u,t)&&(c||"string"==typeof u[t])||(c&&i(l,t)?u[t]=l[t]:u[t]=h("Symbol."+t)),u[t]}},c04e:function(t,e,n){var r=n("861d");t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},c430:function(t,e){t.exports=!1},c6b6:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},c6cd:function(t,e,n){var r=n("da84"),o=n("ce4e"),i="__core-js_shared__",a=r[i]||o(i,{});t.exports=a},c700:function(t,e,n){"use strict";try{self["workbox:precaching:6.1.5"]&&_()}catch(r){}},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},ca84:function(t,e,n){var r=n("5135"),o=n("fc6a"),i=n("4d64").indexOf,a=n("d012");t.exports=function(t,e){var n,c=o(t),s=0,u=[];for(n in c)!r(a,n)&&r(c,n)&&u.push(n);while(e.length>s)r(c,n=e[s++])&&(~i(u,n)||u.push(n));return u}},cc12:function(t,e,n){var r=n("da84"),o=n("861d"),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},ce4e:function(t,e,n){var r=n("da84"),o=n("9112");t.exports=function(t,e){try{o(r,t,e)}catch(n){r[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var r=n("428f"),o=n("da84"),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},d1e7:function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},d2bb:function(t,e,n){var r=n("825a"),o=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(n,[]),e=n instanceof Array}catch(i){}return function(n,i){return r(n),o(i),e?t.call(n,i):n.__proto__=i,n}}():void 0)},d3b7:function(t,e,n){var r=n("00ee"),o=n("6eeb"),i=n("b041");r||o(Object.prototype,"toString",i,{unsafe:!0})},d784:function(t,e,n){"use strict";n("ac1f");var r=n("6eeb"),o=n("9263"),i=n("d039"),a=n("b622"),c=n("9112"),s=a("species"),u=RegExp.prototype,l=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),h=function(){return"$0"==="a".replace(/./,"$0")}(),f=a("replace"),p=function(){return!!/./[f]&&""===/./[f]("a","$0")}(),d=!i((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));t.exports=function(t,e,n,f){var g=a(t),y=!i((function(){var e={};return e[g]=function(){return 7},7!=""[t](e)})),m=y&&!i((function(){var e=!1,n=/a/;return"split"===t&&(n={},n.constructor={},n.constructor[s]=function(){return n},n.flags="",n[g]=/./[g]),n.exec=function(){return e=!0,null},n[g](""),!e}));if(!y||!m||"replace"===t&&(!l||!h||p)||"split"===t&&!d){var v=/./[g],w=n(g,""[t],(function(t,e,n,r,i){var a=e.exec;return a===o||a===u.exec?y&&!i?{done:!0,value:v.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),{REPLACE_KEEPS_$0:h,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),b=w[0],x=w[1];r(String.prototype,t,b),r(u,g,2==e?function(t,e){return x.call(t,this,e)}:function(t){return x.call(t,this)})}f&&c(u[g],"sham",!0)}},d8a5:function(t,e,n){"use strict";try{self["workbox:expiration:6.1.5"]&&_()}catch(r){}},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},e6d2:function(t,e,n){"use strict";try{self["workbox:routing:6.1.5"]&&_()}catch(r){}},e893:function(t,e,n){var r=n("5135"),o=n("56ef"),i=n("06cf"),a=n("9bf2");t.exports=function(t,e){for(var n=o(e),c=a.f,s=i.f,u=0;u<n.length;u++){var l=n[u];r(t,l)||c(t,l,s(e,l))}}},f5df:function(t,e,n){var r=n("00ee"),o=n("c6b6"),i=n("b622"),a=i("toStringTag"),c="Arguments"==o(function(){return arguments}()),s=function(t,e){try{return t[e]}catch(n){}};t.exports=r?o:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=s(e=Object(t),a))?n:c?o(e):"Object"==(r=o(e))&&"function"==typeof e.callee?"Arguments":r}},f772:function(t,e,n){var r=n("5692"),o=n("90e3"),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},fc6a:function(t,e,n){var r=n("44ad"),o=n("1d80");t.exports=function(t){return r(o(t))}},fdbf:function(t,e,n){var r=n("4930");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}});
|
|
>>>>>>> draggable
|