jekyll-pwa-plugin 2.0.1 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll-pwa-plugin.rb +2 -2
  3. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-background-sync.dev.js +1 -1
  4. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-background-sync.dev.js.map +1 -1
  5. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-background-sync.prod.js +1 -1
  6. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-background-sync.prod.js.map +1 -1
  7. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-broadcast-cache-update.dev.js +1 -1
  8. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-broadcast-cache-update.dev.js.map +1 -1
  9. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-broadcast-cache-update.prod.js +1 -1
  10. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-broadcast-cache-update.prod.js.map +1 -1
  11. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-cache-expiration.dev.js +1 -1
  12. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-cache-expiration.dev.js.map +1 -1
  13. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-cache-expiration.prod.js +1 -1
  14. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-cache-expiration.prod.js.map +1 -1
  15. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-cacheable-response.dev.js +1 -1
  16. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-cacheable-response.dev.js.map +1 -1
  17. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-cacheable-response.prod.js +1 -1
  18. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-cacheable-response.prod.js.map +1 -1
  19. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-core.dev.js +25 -6
  20. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-core.dev.js.map +1 -1
  21. data/lib/vendor/workbox-v3.4.1/workbox-core.prod.js +3 -0
  22. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-core.prod.js.map +1 -1
  23. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-google-analytics.dev.js +1 -1
  24. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-google-analytics.dev.js.map +1 -1
  25. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-google-analytics.prod.js +1 -1
  26. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-google-analytics.prod.js.map +1 -1
  27. data/lib/vendor/workbox-v3.4.1/workbox-navigation-preload.dev.js +121 -0
  28. data/lib/vendor/workbox-v3.4.1/workbox-navigation-preload.dev.js.map +1 -0
  29. data/lib/vendor/workbox-v3.4.1/workbox-navigation-preload.prod.js +3 -0
  30. data/lib/vendor/workbox-v3.4.1/workbox-navigation-preload.prod.js.map +1 -0
  31. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-precaching.dev.js +1 -1
  32. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-precaching.dev.js.map +1 -1
  33. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-precaching.prod.js +1 -1
  34. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-precaching.prod.js.map +1 -1
  35. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-range-requests.dev.js +1 -1
  36. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-range-requests.dev.js.map +1 -1
  37. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-range-requests.prod.js +1 -1
  38. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-range-requests.prod.js.map +1 -1
  39. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-routing.dev.js +1 -1
  40. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-routing.dev.js.map +1 -1
  41. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-routing.prod.js +1 -1
  42. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-routing.prod.js.map +1 -1
  43. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-strategies.dev.js +17 -9
  44. data/lib/vendor/workbox-v3.4.1/workbox-strategies.dev.js.map +1 -0
  45. data/lib/vendor/workbox-v3.4.1/workbox-strategies.prod.js +3 -0
  46. data/lib/vendor/workbox-v3.4.1/workbox-strategies.prod.js.map +1 -0
  47. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-streams.dev.js +1 -1
  48. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-streams.dev.js.map +1 -1
  49. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-streams.prod.js +1 -1
  50. data/lib/vendor/{workbox-v3.3.1 → workbox-v3.4.1}/workbox-streams.prod.js.map +1 -1
  51. data/lib/vendor/workbox-v3.4.1/workbox-sw.js +3 -0
  52. data/lib/vendor/workbox-v3.4.1/workbox-sw.js.map +1 -0
  53. metadata +52 -48
  54. data/lib/vendor/workbox-v3.3.1/workbox-core.prod.js +0 -3
  55. data/lib/vendor/workbox-v3.3.1/workbox-strategies.dev.js.map +0 -1
  56. data/lib/vendor/workbox-v3.3.1/workbox-strategies.prod.js +0 -3
  57. data/lib/vendor/workbox-v3.3.1/workbox-strategies.prod.js.map +0 -1
  58. data/lib/vendor/workbox-v3.3.1/workbox-sw.js +0 -3
  59. data/lib/vendor/workbox-v3.3.1/workbox-sw.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"mappings":"","sources":["packages/workbox-strategies/browser.mjs"],"sourcesContent":["this.workbox = this.workbox || {};\nthis.workbox.strategies = (function (logger_mjs,assert_mjs,cacheNames_mjs,cacheWrapper_mjs,fetchWrapper_mjs,getFriendlyURL_mjs) {\n 'use strict';\n\n try {\n self.workbox.v['workbox:strategies:3.4.1'] = 1;\n } catch (e) {} // eslint-disable-line\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n const getFriendlyURL = url => {\n const urlObj = new URL(url, location);\n if (urlObj.origin === location.origin) {\n return urlObj.pathname;\n }\n return urlObj.href;\n };\n\n var messages = {\n strategyStart: (strategyName, request) => `Using ${strategyName} to ` + `respond to '${getFriendlyURL(request.url)}'`,\n printFinalResponse: response => {\n if (response) {\n logger_mjs.logger.groupCollapsed(`View the final response here.`);\n logger_mjs.logger.unprefixed.log(response);\n logger_mjs.logger.groupEnd();\n }\n }\n };\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * An implementation of a [cache-first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-falling-back-to-network}\n * request strategy.\n *\n * A cache first strategy is useful for assets that have been revisioned,\n * such as URLs like `/styles/example.a8f5f1.css`, since they\n * can be cached for long periods of time.\n *\n * @memberof workbox.strategies\n */\n class CacheFirst {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link workbox.core.cacheNames}.\n * @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n * @param {Object} options.matchOptions [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n */\n constructor(options = {}) {\n this._cacheName = cacheNames_mjs.cacheNames.getRuntimeName(options.cacheName);\n this._plugins = options.plugins || [];\n this._fetchOptions = options.fetchOptions || null;\n this._matchOptions = options.matchOptions || null;\n }\n\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link workbox.routing.Router}.\n *\n * @param {Object} input\n * @param {FetchEvent} input.event The fetch event to run this strategy\n * against.\n * @return {Promise<Response>}\n */\n handle({ event }) {\n var _this = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n {\n assert_mjs.assert.isInstance(event, FetchEvent, {\n moduleName: 'workbox-strategies',\n className: 'CacheFirst',\n funcName: 'handle',\n paramName: 'event'\n });\n }\n\n return _this.makeRequest({\n event,\n request: event.request\n });\n })();\n }\n\n /**\n * This method can be used to perform a make a standalone request outside the\n * context of the [Workbox Router]{@link workbox.routing.Router}.\n *\n * See \"[Advanced Recipes](https://developers.google.com/web/tools/workbox/guides/advanced-recipes#make-requests)\"\n * for more usage information.\n *\n * @param {Object} input\n * @param {Request|string} input.request Either a\n * [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request}\n * object, or a string URL, corresponding to the request to be made.\n * @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be\n * called automatically to extend the service worker's lifetime.\n * @return {Promise<Response>}\n */\n makeRequest({ event, request }) {\n var _this2 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n const logs = [];\n\n if (typeof request === 'string') {\n request = new Request(request);\n }\n\n {\n assert_mjs.assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'CacheFirst',\n funcName: 'makeRequest',\n paramName: 'request'\n });\n }\n\n let response = yield cacheWrapper_mjs.cacheWrapper.match(_this2._cacheName, request, _this2._matchOptions, _this2._plugins);\n\n let error;\n if (!response) {\n {\n logs.push(`No response found in the '${_this2._cacheName}' cache. ` + `Will respond with a network request.`);\n }\n try {\n response = yield _this2._getFromNetwork(request, event);\n } catch (err) {\n error = err;\n }\n\n {\n if (response) {\n logs.push(`Got response from network.`);\n } else {\n logs.push(`Unable to get a response from the network.`);\n }\n }\n } else {\n {\n logs.push(`Found a cached response in the '${_this2._cacheName}' cache.`);\n }\n }\n\n {\n logger_mjs.logger.groupCollapsed(messages.strategyStart('CacheFirst', request));\n for (let log of logs) {\n logger_mjs.logger.log(log);\n }\n messages.printFinalResponse(response);\n logger_mjs.logger.groupEnd();\n }\n\n if (error) {\n // Don't swallow error as we'll want it to throw and enable catch\n // handlers in router.\n throw error;\n }\n\n return response;\n })();\n }\n\n /**\n * Handles the network and cache part of CacheFirst.\n *\n * @param {Request} request\n * @param {FetchEvent} [event]\n * @return {Promise<Response>}\n *\n * @private\n */\n _getFromNetwork(request, event) {\n var _this3 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n const response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this3._fetchOptions, _this3._plugins, event ? event.preloadResponse : undefined);\n\n // Keep the service worker while we put the request to the cache\n const responseClone = response.clone();\n const cachePutPromise = cacheWrapper_mjs.cacheWrapper.put(_this3._cacheName, request, responseClone, _this3._plugins);\n\n if (event) {\n try {\n event.waitUntil(cachePutPromise);\n } catch (error) {\n {\n logger_mjs.logger.warn(`Unable to ensure service worker stays alive when ` + `updating cache for '${getFriendlyURL_mjs.getFriendlyURL(event.request.url)}'.`);\n }\n }\n }\n\n return response;\n })();\n }\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * An implementation of a\n * [cache-only]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-only}\n * request strategy.\n *\n * 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}.\n *\n * @memberof workbox.strategies\n */\n class CacheOnly {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link workbox.core.cacheNames}.\n * @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.matchOptions [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n */\n constructor(options = {}) {\n this._cacheName = cacheNames_mjs.cacheNames.getRuntimeName(options.cacheName);\n this._plugins = options.plugins || [];\n this._matchOptions = options.matchOptions || null;\n }\n\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link workbox.routing.Router}.\n *\n * @param {Object} input\n * @param {FetchEvent} input.event The fetch event to run this strategy\n * against.\n * @return {Promise<Response>}\n */\n handle({ event }) {\n var _this = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n {\n assert_mjs.assert.isInstance(event, FetchEvent, {\n moduleName: 'workbox-strategies',\n className: 'CacheOnly',\n funcName: 'handle',\n paramName: 'event'\n });\n }\n\n return _this.makeRequest({\n event,\n request: event.request\n });\n })();\n }\n\n /**\n * This method can be used to perform a make a standalone request outside the\n * context of the [Workbox Router]{@link workbox.routing.Router}.\n *\n * See \"[Advanced Recipes](https://developers.google.com/web/tools/workbox/guides/advanced-recipes#make-requests)\"\n * for more usage information.\n *\n * @param {Object} input\n * @param {Request|string} input.request Either a\n * [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request}\n * object, or a string URL, corresponding to the request to be made.\n * @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be\n * called automatically to extend the service worker's lifetime.\n * @return {Promise<Response>}\n */\n makeRequest({ event, request }) {\n var _this2 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n if (typeof request === 'string') {\n request = new Request(request);\n }\n\n {\n assert_mjs.assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'CacheOnly',\n funcName: 'makeRequest',\n paramName: 'request'\n });\n }\n\n const response = yield cacheWrapper_mjs.cacheWrapper.match(_this2._cacheName, request, _this2._matchOptions, _this2._plugins);\n\n {\n logger_mjs.logger.groupCollapsed(messages.strategyStart('CacheOnly', request));\n if (response) {\n logger_mjs.logger.log(`Found a cached response in the '${_this2._cacheName}'` + ` cache.`);\n messages.printFinalResponse(response);\n } else {\n logger_mjs.logger.log(`No response found in the '${_this2._cacheName}' cache.`);\n }\n logger_mjs.logger.groupEnd();\n }\n\n return response;\n })();\n }\n }\n\n /*\n Copyright 2016 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n var cacheOkAndOpaquePlugin = {\n /**\n * Return return a response (i.e. allow caching) if the\n * response is ok (i.e. 200) or is opaque.\n *\n * @param {Object} input\n * @param {Response} input.response\n * @return {Response|null}\n *\n * @private\n */\n cacheWillUpdate: ({ response }) => {\n if (response.ok || response.status === 0) {\n return response;\n }\n return null;\n }\n };\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * An implementation of a\n * [network first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#network-falling-back-to-cache}\n * request strategy.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses]{@link https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests}.\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS]{@link https://enable-cors.org/}.\n *\n * @memberof workbox.strategies\n */\n class NetworkFirst {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link workbox.core.cacheNames}.\n * @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n * @param {Object} options.matchOptions [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n * @param {number} options.networkTimeoutSeconds If set, any network requests\n * that fail to respond within the timeout will fallback to the cache.\n *\n * This option can be used to combat\n * \"[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}\"\n * scenarios.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames_mjs.cacheNames.getRuntimeName(options.cacheName);\n\n if (options.plugins) {\n let isUsingCacheWillUpdate = options.plugins.some(plugin => !!plugin.cacheWillUpdate);\n this._plugins = isUsingCacheWillUpdate ? options.plugins : [cacheOkAndOpaquePlugin, ...options.plugins];\n } else {\n // No plugins passed in, use the default plugin.\n this._plugins = [cacheOkAndOpaquePlugin];\n }\n\n this._networkTimeoutSeconds = options.networkTimeoutSeconds;\n {\n if (this._networkTimeoutSeconds) {\n assert_mjs.assert.isType(this._networkTimeoutSeconds, 'number', {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'constructor',\n paramName: 'networkTimeoutSeconds'\n });\n }\n }\n\n this._fetchOptions = options.fetchOptions || null;\n this._matchOptions = options.matchOptions || null;\n }\n\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link workbox.routing.Router}.\n *\n * @param {Object} input\n * @param {FetchEvent} input.event The fetch event to run this strategy\n * against.\n * @return {Promise<Response>}\n */\n handle({ event }) {\n var _this = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n {\n assert_mjs.assert.isInstance(event, FetchEvent, {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'handle',\n paramName: 'event'\n });\n }\n\n return _this.makeRequest({\n event,\n request: event.request\n });\n })();\n }\n\n /**\n * This method can be used to perform a make a standalone request outside the\n * context of the [Workbox Router]{@link workbox.routing.Router}.\n *\n * See \"[Advanced Recipes](https://developers.google.com/web/tools/workbox/guides/advanced-recipes#make-requests)\"\n * for more usage information.\n *\n * @param {Object} input\n * @param {Request|string} input.request Either a\n * [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request}\n * object, or a string URL, corresponding to the request to be made.\n * @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be\n * called automatically to extend the service worker's lifetime.\n * @return {Promise<Response>}\n */\n makeRequest({ event, request }) {\n var _this2 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n const logs = [];\n\n if (typeof request === 'string') {\n request = new Request(request);\n }\n\n {\n assert_mjs.assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'handle',\n paramName: 'makeRequest'\n });\n }\n\n const promises = [];\n let timeoutId;\n\n if (_this2._networkTimeoutSeconds) {\n const { id, promise } = _this2._getTimeoutPromise(request, logs);\n timeoutId = id;\n promises.push(promise);\n }\n\n const networkPromise = _this2._getNetworkPromise(timeoutId, event, request, logs);\n promises.push(networkPromise);\n\n // Promise.race() will resolve as soon as the first promise resolves.\n let response = yield Promise.race(promises);\n // If Promise.race() resolved with null, it might be due to a network\n // timeout + a cache miss. If that were to happen, we'd rather wait until\n // the networkPromise resolves instead of returning null.\n // Note that it's fine to await an already-resolved promise, so we don't\n // have to check to see if it's still \"in flight\".\n if (!response) {\n response = yield networkPromise;\n }\n\n {\n logger_mjs.logger.groupCollapsed(messages.strategyStart('NetworkFirst', request));\n for (let log of logs) {\n logger_mjs.logger.log(log);\n }\n messages.printFinalResponse(response);\n logger_mjs.logger.groupEnd();\n }\n\n return response;\n })();\n }\n\n /**\n * @param {Request} request\n * @param {Array} logs A reference to the logs array\n * @return {Promise<Response>}\n *\n * @private\n */\n _getTimeoutPromise(request, logs) {\n var _this3 = this;\n\n let timeoutId;\n const timeoutPromise = new Promise(resolve => {\n const onNetworkTimeout = (() => {\n var _ref = babelHelpers.asyncToGenerator(function* () {\n {\n logs.push(`Timing out the network response at ` + `${_this3._networkTimeoutSeconds} seconds.`);\n }\n\n resolve((yield _this3._respondFromCache(request)));\n });\n\n return function onNetworkTimeout() {\n return _ref.apply(this, arguments);\n };\n })();\n\n timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);\n });\n\n return {\n promise: timeoutPromise,\n id: timeoutId\n };\n }\n\n /**\n * @param {number} timeoutId\n * @param {FetchEvent|null} event\n * @param {Request} request\n * @param {Array} logs A reference to the logs Array.\n * @return {Promise<Response>}\n *\n * @private\n */\n _getNetworkPromise(timeoutId, event, request, logs) {\n var _this4 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n let error;\n let response;\n try {\n response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this4._fetchOptions, _this4._plugins, event ? event.preloadResponse : undefined);\n } catch (err) {\n error = err;\n }\n\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n\n {\n if (response) {\n logs.push(`Got response from network.`);\n } else {\n logs.push(`Unable to get a response from the network. Will respond ` + `with a cached response.`);\n }\n }\n\n if (error || !response) {\n response = yield _this4._respondFromCache(request);\n {\n if (response) {\n logs.push(`Found a cached response in the '${_this4._cacheName}'` + ` cache.`);\n } else {\n logs.push(`No response found in the '${_this4._cacheName}' cache.`);\n }\n }\n } else {\n // Keep the service worker alive while we put the request in the cache\n const responseClone = response.clone();\n const cachePut = cacheWrapper_mjs.cacheWrapper.put(_this4._cacheName, request, responseClone, _this4._plugins);\n\n if (event) {\n try {\n // The event has been responded to so we can keep the SW alive to\n // respond to the request\n event.waitUntil(cachePut);\n } catch (err) {\n {\n logger_mjs.logger.warn(`Unable to ensure service worker stays alive when ` + `updating cache for '${getFriendlyURL_mjs.getFriendlyURL(event.request.url)}'.`);\n }\n }\n }\n }\n\n return response;\n })();\n }\n\n /**\n * Used if the network timeouts or fails to make the request.\n *\n * @param {Request} request The fetchEvent request to match in the cache\n * @return {Promise<Object>}\n *\n * @private\n */\n _respondFromCache(request) {\n return cacheWrapper_mjs.cacheWrapper.match(this._cacheName, request, this._matchOptions, this._plugins);\n }\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * An implementation of a\n * [network-only]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#network-only}\n * request strategy.\n *\n * 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}.\n *\n * @memberof workbox.strategies\n */\n class NetworkOnly {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link workbox.core.cacheNames}.\n * @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames_mjs.cacheNames.getRuntimeName(options.cacheName);\n this._plugins = options.plugins || [];\n this._fetchOptions = options.fetchOptions || null;\n }\n\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link workbox.routing.Router}.\n *\n * @param {Object} input\n * @param {FetchEvent} input.event The fetch event to run this strategy\n * against.\n * @return {Promise<Response>}\n */\n handle({ event }) {\n var _this = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n {\n assert_mjs.assert.isInstance(event, FetchEvent, {\n moduleName: 'workbox-strategies',\n className: 'NetworkOnly',\n funcName: 'handle',\n paramName: 'event'\n });\n }\n\n return _this.makeRequest({\n event,\n request: event.request\n });\n })();\n }\n\n /**\n * This method can be used to perform a make a standalone request outside the\n * context of the [Workbox Router]{@link workbox.routing.Router}.\n *\n * See \"[Advanced Recipes](https://developers.google.com/web/tools/workbox/guides/advanced-recipes#make-requests)\"\n * for more usage information.\n *\n * @param {Object} input\n * @param {Request|string} input.request Either a\n * [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request}\n * object, or a string URL, corresponding to the request to be made.\n * @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be\n * called automatically to extend the service worker's lifetime.\n * @return {Promise<Response>}\n */\n makeRequest({ event, request }) {\n var _this2 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n if (typeof request === 'string') {\n request = new Request(request);\n }\n\n {\n assert_mjs.assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'NetworkOnly',\n funcName: 'handle',\n paramName: 'request'\n });\n }\n\n let error;\n let response;\n try {\n response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this2._fetchOptions, _this2._plugins, event ? event.preloadResponse : undefined);\n } catch (err) {\n error = err;\n }\n\n {\n logger_mjs.logger.groupCollapsed(messages.strategyStart('NetworkOnly', request));\n if (response) {\n logger_mjs.logger.log(`Got response from network.`);\n } else {\n logger_mjs.logger.log(`Unable to get a response from the network.`);\n }\n messages.printFinalResponse(response);\n logger_mjs.logger.groupEnd();\n }\n\n // If there was an error thrown, re-throw it to ensure the Routers\n // catch handler is triggered.\n if (error) {\n throw error;\n }\n\n return response;\n })();\n }\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * An implementation of a\n * [stale-while-revalidate]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#stale-while-revalidate}\n * request strategy.\n *\n * Resources are requested from both the cache and the network in parallel.\n * The strategy will respond with the cached version if available, otherwise\n * wait for the network response. The cache is updated with the network response\n * with each successful request.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses]{@link https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests}.\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS]{@link https://enable-cors.org/}.\n *\n * @memberof workbox.strategies\n */\n class StaleWhileRevalidate {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link workbox.core.cacheNames}.\n * @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n * @param {Object} options.matchOptions [`CacheQueryOptions`](https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions)\n */\n constructor(options = {}) {\n this._cacheName = cacheNames_mjs.cacheNames.getRuntimeName(options.cacheName);\n this._plugins = options.plugins || [];\n\n if (options.plugins) {\n let isUsingCacheWillUpdate = options.plugins.some(plugin => !!plugin.cacheWillUpdate);\n this._plugins = isUsingCacheWillUpdate ? options.plugins : [cacheOkAndOpaquePlugin, ...options.plugins];\n } else {\n // No plugins passed in, use the default plugin.\n this._plugins = [cacheOkAndOpaquePlugin];\n }\n\n this._fetchOptions = options.fetchOptions || null;\n this._matchOptions = options.matchOptions || null;\n }\n\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link workbox.routing.Router}.\n *\n * @param {Object} input\n * @param {FetchEvent} input.event The fetch event to run this strategy\n * against.\n * @return {Promise<Response>}\n */\n handle({ event }) {\n var _this = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n {\n assert_mjs.assert.isInstance(event, FetchEvent, {\n moduleName: 'workbox-strategies',\n className: 'StaleWhileRevalidate',\n funcName: 'handle',\n paramName: 'event'\n });\n }\n\n return _this.makeRequest({\n event,\n request: event.request\n });\n })();\n }\n\n /**\n * This method can be used to perform a make a standalone request outside the\n * context of the [Workbox Router]{@link workbox.routing.Router}.\n *\n * See \"[Advanced Recipes](https://developers.google.com/web/tools/workbox/guides/advanced-recipes#make-requests)\"\n * for more usage information.\n *\n * @param {Object} input\n * @param {Request|string} input.request Either a\n * [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request}\n * object, or a string URL, corresponding to the request to be made.\n * @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be\n * called automatically to extend the service worker's lifetime.\n * @return {Promise<Response>}\n */\n makeRequest({ event, request }) {\n var _this2 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n const logs = [];\n\n if (typeof request === 'string') {\n request = new Request(request);\n }\n\n {\n assert_mjs.assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'StaleWhileRevalidate',\n funcName: 'handle',\n paramName: 'request'\n });\n }\n\n const fetchAndCachePromise = _this2._getFromNetwork(request, event);\n\n let response = yield cacheWrapper_mjs.cacheWrapper.match(_this2._cacheName, request, _this2._matchOptions, _this2._plugins);\n\n if (response) {\n {\n logs.push(`Found a cached response in the '${_this2._cacheName}'` + ` cache. Will update with the network response in the background.`);\n }\n\n if (event) {\n try {\n event.waitUntil(fetchAndCachePromise);\n } catch (error) {\n {\n logger_mjs.logger.warn(`Unable to ensure service worker stays alive when ` + `updating cache for '${getFriendlyURL_mjs.getFriendlyURL(event.request.url)}'.`);\n }\n }\n }\n } else {\n {\n logs.push(`No response found in the '${_this2._cacheName}' cache. ` + `Will wait for the network response.`);\n }\n response = yield fetchAndCachePromise;\n }\n\n {\n logger_mjs.logger.groupCollapsed(messages.strategyStart('StaleWhileRevalidate', request));\n for (let log of logs) {\n logger_mjs.logger.log(log);\n }\n messages.printFinalResponse(response);\n logger_mjs.logger.groupEnd();\n }\n\n return response;\n })();\n }\n\n /**\n * @param {Request} request\n * @param {FetchEvent} [event]\n * @return {Promise<Response>}\n *\n * @private\n */\n _getFromNetwork(request, event) {\n var _this3 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n const response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this3._fetchOptions, _this3._plugins, event ? event.preloadResponse : undefined);\n\n const cachePutPromise = cacheWrapper_mjs.cacheWrapper.put(_this3._cacheName, request, response.clone(), _this3._plugins);\n\n if (event) {\n try {\n event.waitUntil(cachePutPromise);\n } catch (error) {\n {\n logger_mjs.logger.warn(`Unable to ensure service worker stays alive when ` + `updating cache for '${getFriendlyURL_mjs.getFriendlyURL(event.request.url)}'.`);\n }\n }\n }\n\n return response;\n })();\n }\n }\n\n /*\n Copyright 2017 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n var publicAPI = /*#__PURE__*/Object.freeze({\n CacheFirst: CacheFirst,\n CacheOnly: CacheOnly,\n NetworkFirst: NetworkFirst,\n NetworkOnly: NetworkOnly,\n StaleWhileRevalidate: StaleWhileRevalidate\n });\n\n /*\n Copyright 2016 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * @function workbox.strategies.cacheFirst\n * @param {workbox.strategies.StrategyOptions} options\n */\n\n /**\n * @function workbox.strategies.cacheOnly\n * @param {workbox.strategies.StrategyOptions} options\n */\n\n /**\n * @function workbox.strategies.networkFirst\n * @param {workbox.strategies.StrategyOptions} options\n */\n\n /**\n * @function workbox.strategies.networkOnly\n * @param {workbox.strategies.StrategyOptions} options\n */\n\n /**\n * @function workbox.strategies.staleWhileRevalidate\n * @param {workbox.strategies.StrategyOptions} options\n */\n\n const mapping = {\n cacheFirst: CacheFirst,\n cacheOnly: CacheOnly,\n networkFirst: NetworkFirst,\n networkOnly: NetworkOnly,\n staleWhileRevalidate: StaleWhileRevalidate\n };\n\n const defaultExport = {};\n Object.keys(mapping).forEach(keyName => {\n defaultExport[keyName] = (options = {}) => {\n const StrategyClass = mapping[keyName];\n return new StrategyClass(Object.assign(options));\n };\n });\n\n /*\n Copyright 2017 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n const finalExport = Object.assign(defaultExport, publicAPI);\n\n return finalExport;\n\n}(workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private));\n"],"file":"workbox-strategies.dev.js"}
@@ -0,0 +1,3 @@
1
+ this.workbox=this.workbox||{},this.workbox.strategies=function(e,t,r){"use strict";try{self.workbox.v["workbox:strategies:3.4.1"]=1}catch(e){}class s{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.fetchOptions||null,this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var s=this;return babelHelpers.asyncToGenerator(function*(){"string"==typeof r&&(r=new Request(r));let n,i=yield t.cacheWrapper.match(s.e,r,s.s,s.t);if(!i)try{i=yield s.n(r,e)}catch(e){n=e}if(n)throw n;return i})()}n(e,s){var n=this;return babelHelpers.asyncToGenerator(function*(){const i=yield r.fetchWrapper.fetch(e,n.r,n.t,s?s.preloadResponse:void 0),l=i.clone(),u=t.cacheWrapper.put(n.e,e,l,n.t);if(s)try{s.waitUntil(u)}catch(e){}return i})()}}class n{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var s=this;return babelHelpers.asyncToGenerator(function*(){return"string"==typeof r&&(r=new Request(r)),yield t.cacheWrapper.match(s.e,r,s.s,s.t)})()}}var i={cacheWillUpdate:({response:e})=>e.ok||0===e.status?e:null};class l{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.i=t.networkTimeoutSeconds,this.r=t.fetchOptions||null,this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var r=this;return babelHelpers.asyncToGenerator(function*(){const s=[];"string"==typeof t&&(t=new Request(t));const n=[];let i;if(r.i){const{id:e,promise:l}=r.l(t,s);i=e,n.push(l)}const l=r.u(i,e,t,s);n.push(l);let u=yield Promise.race(n);return u||(u=yield l),u})()}l(e,t){var r=this;let s;var n;return{promise:new Promise(t=>{const i=(n=babelHelpers.asyncToGenerator(function*(){t(yield r.o(e))}),function(){return n.apply(this,arguments)});s=setTimeout(i,1e3*this.i)}),id:s}}u(e,s,n,i){var l=this;return babelHelpers.asyncToGenerator(function*(){let i,u;try{u=yield r.fetchWrapper.fetch(n,l.r,l.t,s?s.preloadResponse:void 0)}catch(e){i=e}if(e&&clearTimeout(e),i||!u)u=yield l.o(n);else{const e=u.clone(),r=t.cacheWrapper.put(l.e,n,e,l.t);if(s)try{s.waitUntil(r)}catch(e){}}return u})()}o(e){return t.cacheWrapper.match(this.e,e,this.s,this.t)}}class u{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var s=this;return babelHelpers.asyncToGenerator(function*(){let n,i;"string"==typeof t&&(t=new Request(t));try{i=yield r.fetchWrapper.fetch(t,s.r,s.t,e?e.preloadResponse:void 0)}catch(e){n=e}if(n)throw n;return i})()}}class o{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.r=t.fetchOptions||null,this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var s=this;return babelHelpers.asyncToGenerator(function*(){"string"==typeof r&&(r=new Request(r));const n=s.n(r,e);let i=yield t.cacheWrapper.match(s.e,r,s.s,s.t);if(i){if(e)try{e.waitUntil(n)}catch(e){}}else i=yield n;return i})()}n(e,s){var n=this;return babelHelpers.asyncToGenerator(function*(){const i=yield r.fetchWrapper.fetch(e,n.r,n.t,s?s.preloadResponse:void 0),l=t.cacheWrapper.put(n.e,e,i.clone(),n.t);if(s)try{s.waitUntil(l)}catch(e){}return i})()}}var c=Object.freeze({CacheFirst:s,CacheOnly:n,NetworkFirst:l,NetworkOnly:u,StaleWhileRevalidate:o});const a={cacheFirst:s,cacheOnly:n,networkFirst:l,networkOnly:u,staleWhileRevalidate:o},h={};return Object.keys(a).forEach(e=>{h[e]=((t={})=>{return new(0,a[e])(Object.assign(t))})}),Object.assign(h,c)}(workbox.core._private,workbox.core._private,workbox.core._private);
2
+
3
+ //# sourceMappingURL=workbox-strategies.prod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"mappings":"","sources":["packages/workbox-strategies/browser.mjs"],"sourcesContent":["this.workbox=this.workbox||{},this.workbox.strategies=function(e,t,r){\"use strict\";try{self.workbox.v[\"workbox:strategies:3.4.1\"]=1}catch(e){}class s{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.fetchOptions||null,this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var s=this;return babelHelpers.asyncToGenerator(function*(){\"string\"==typeof r&&(r=new Request(r));let n,i=yield t.cacheWrapper.match(s.e,r,s.s,s.t);if(!i)try{i=yield s.n(r,e)}catch(e){n=e}if(n)throw n;return i})()}n(e,s){var n=this;return babelHelpers.asyncToGenerator(function*(){const i=yield r.fetchWrapper.fetch(e,n.r,n.t,s?s.preloadResponse:void 0),l=i.clone(),u=t.cacheWrapper.put(n.e,e,l,n.t);if(s)try{s.waitUntil(u)}catch(e){}return i})()}}class n{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var s=this;return babelHelpers.asyncToGenerator(function*(){return\"string\"==typeof r&&(r=new Request(r)),yield t.cacheWrapper.match(s.e,r,s.s,s.t)})()}}var i={cacheWillUpdate:({response:e})=>e.ok||0===e.status?e:null};class l{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.i=t.networkTimeoutSeconds,this.r=t.fetchOptions||null,this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var r=this;return babelHelpers.asyncToGenerator(function*(){const s=[];\"string\"==typeof t&&(t=new Request(t));const n=[];let i;if(r.i){const{id:e,promise:l}=r.l(t,s);i=e,n.push(l)}const l=r.u(i,e,t,s);n.push(l);let u=yield Promise.race(n);return u||(u=yield l),u})()}l(e,t){var r=this;let s;var n;return{promise:new Promise(t=>{const i=(n=babelHelpers.asyncToGenerator(function*(){t(yield r.o(e))}),function(){return n.apply(this,arguments)});s=setTimeout(i,1e3*this.i)}),id:s}}u(e,s,n,i){var l=this;return babelHelpers.asyncToGenerator(function*(){let i,u;try{u=yield r.fetchWrapper.fetch(n,l.r,l.t,s?s.preloadResponse:void 0)}catch(e){i=e}if(e&&clearTimeout(e),i||!u)u=yield l.o(n);else{const e=u.clone(),r=t.cacheWrapper.put(l.e,n,e,l.t);if(s)try{s.waitUntil(r)}catch(e){}}return u})()}o(e){return t.cacheWrapper.match(this.e,e,this.s,this.t)}}class u{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var s=this;return babelHelpers.asyncToGenerator(function*(){let n,i;\"string\"==typeof t&&(t=new Request(t));try{i=yield r.fetchWrapper.fetch(t,s.r,s.t,e?e.preloadResponse:void 0)}catch(e){n=e}if(n)throw n;return i})()}}class o{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.r=t.fetchOptions||null,this.s=t.matchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var s=this;return babelHelpers.asyncToGenerator(function*(){\"string\"==typeof r&&(r=new Request(r));const n=s.n(r,e);let i=yield t.cacheWrapper.match(s.e,r,s.s,s.t);if(i){if(e)try{e.waitUntil(n)}catch(e){}}else i=yield n;return i})()}n(e,s){var n=this;return babelHelpers.asyncToGenerator(function*(){const i=yield r.fetchWrapper.fetch(e,n.r,n.t,s?s.preloadResponse:void 0),l=t.cacheWrapper.put(n.e,e,i.clone(),n.t);if(s)try{s.waitUntil(l)}catch(e){}return i})()}}var c=Object.freeze({CacheFirst:s,CacheOnly:n,NetworkFirst:l,NetworkOnly:u,StaleWhileRevalidate:o});const a={cacheFirst:s,cacheOnly:n,networkFirst:l,networkOnly:u,staleWhileRevalidate:o},h={};return Object.keys(a).forEach(e=>{h[e]=((t={})=>{return new(0,a[e])(Object.assign(t))})}),Object.assign(h,c)}(workbox.core._private,workbox.core._private,workbox.core._private);\n"],"file":"workbox-strategies.prod.js"}
@@ -3,7 +3,7 @@ this.workbox.streams = (function (logger_mjs,assert_mjs) {
3
3
  'use strict';
4
4
 
5
5
  try {
6
- self.workbox.v['workbox:streams:3.3.1'] = 1;
6
+ self.workbox.v['workbox:streams:3.4.1'] = 1;
7
7
  } catch (e) {} // eslint-disable-line
8
8
 
9
9
  /*
@@ -1 +1 @@
1
- {"version":3,"names":[],"mappings":"","sources":["packages/workbox-streams/browser.mjs"],"sourcesContent":["this.workbox = this.workbox || {};\nthis.workbox.streams = (function (logger_mjs,assert_mjs) {\n 'use strict';\n\n try {\n self.workbox.v['workbox:streams:3.3.1'] = 1;\n } catch (e) {} // eslint-disable-line\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * Takes either a Response, a ReadableStream, or a\n * [BodyInit](https://fetch.spec.whatwg.org/#bodyinit) and returns the\n * ReadableStreamReader object associated with it.\n *\n * @param {workbox.streams.StreamSource} source\n * @return {ReadableStreamReader}\n * @private\n */\n function _getReaderFromSource(source) {\n if (source.body && source.body.getReader) {\n return source.body.getReader();\n }\n\n if (source.getReader) {\n return source.getReader();\n }\n\n // TODO: This should be possible to do by constructing a ReadableStream, but\n // I can't get it to work. As a hack, construct a new Response, and use the\n // reader associated with its body.\n return new Response(source).body.getReader();\n }\n\n /**\n * Takes multiple source Promises, each of which could resolve to a Response, a\n * ReadableStream, or a [BodyInit](https://fetch.spec.whatwg.org/#bodyinit).\n *\n * Returns an object exposing a ReadableStream with each individual stream's\n * data returned in sequence, along with a Promise which signals when the\n * stream is finished (useful for passing to a FetchEvent's waitUntil()).\n *\n * @param {Array<Promise<workbox.streams.StreamSource>>} sourcePromises\n * @return {Object<{done: Promise, stream: ReadableStream}>}\n *\n * @memberof workbox.streams\n */\n function concatenate(sourcePromises) {\n {\n assert_mjs.assert.isArray(sourcePromises, {\n moduleName: 'workbox-streams',\n funcName: 'concatenate',\n paramName: 'sourcePromises'\n });\n }\n\n const readerPromises = sourcePromises.map(sourcePromise => {\n return Promise.resolve(sourcePromise).then(source => {\n return _getReaderFromSource(source);\n });\n });\n\n let fullyStreamedResolve;\n let fullyStreamedReject;\n const done = new Promise((resolve, reject) => {\n fullyStreamedResolve = resolve;\n fullyStreamedReject = reject;\n });\n\n let i = 0;\n const logMessages = [];\n const stream = new ReadableStream({\n pull(controller) {\n return readerPromises[i].then(reader => reader.read()).then(result => {\n if (result.done) {\n {\n logMessages.push(['Reached the end of source:', sourcePromises[i]]);\n }\n\n i++;\n if (i >= readerPromises.length) {\n // Log all the messages in the group at once in a single group.\n {\n logger_mjs.logger.groupCollapsed(`Concatenating ${readerPromises.length} sources.`);\n for (const message of logMessages) {\n if (Array.isArray(message)) {\n logger_mjs.logger.log(...message);\n } else {\n logger_mjs.logger.log(message);\n }\n }\n logger_mjs.logger.log('Finished reading all sources.');\n logger_mjs.logger.groupEnd();\n }\n\n controller.close();\n fullyStreamedResolve();\n return;\n }\n\n return this.pull(controller);\n } else {\n controller.enqueue(result.value);\n }\n }).catch(error => {\n {\n logger_mjs.logger.error('An error occurred:', error);\n }\n fullyStreamedReject(error);\n throw error;\n });\n },\n\n cancel() {\n {\n logger_mjs.logger.warn('The ReadableStream was cancelled.');\n }\n\n fullyStreamedResolve();\n }\n });\n\n return { done, stream };\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * This is a utility method that determines whether the current browser supports\n * the features required to create streamed responses. Currently, it checks if\n * [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)\n * is available.\n *\n * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,\n * `'text/html'` will be used by default.\n * @return {boolean} `true`, if the current browser meets the requirements for\n * streaming responses, and `false` otherwise.\n *\n * @memberof workbox.streams\n */\n function createHeaders(headersInit = {}) {\n // See https://github.com/GoogleChrome/workbox/issues/1461\n const headers = new Headers(headersInit);\n if (!headers.has('content-type')) {\n headers.set('content-type', 'text/html');\n }\n return headers;\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * Takes multiple source Promises, each of which could resolve to a Response, a\n * ReadableStream, or a [BodyInit](https://fetch.spec.whatwg.org/#bodyinit),\n * along with a\n * [HeadersInit](https://fetch.spec.whatwg.org/#typedefdef-headersinit).\n *\n * Returns an object exposing a Response whose body consists of each individual\n * stream's data returned in sequence, along with a Promise which signals when\n * the stream is finished (useful for passing to a FetchEvent's waitUntil()).\n *\n * @param {Array<Promise<workbox.streams.StreamSource>>} sourcePromises\n * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,\n * `'text/html'` will be used by default.\n * @return {Object<{done: Promise, response: Response}>}\n *\n * @memberof workbox.streams\n */\n function concatenateToResponse(sourcePromises, headersInit) {\n const { done, stream } = concatenate(sourcePromises);\n\n const headers = createHeaders(headersInit);\n const response = new Response(stream, { headers });\n\n return { done, response };\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n let cachedIsSupported = undefined;\n\n /**\n * This is a utility method that determines whether the current browser supports\n * the features required to create streamed responses. Currently, it checks if\n * [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)\n * can be created.\n *\n * @return {boolean} `true`, if the current browser meets the requirements for\n * streaming responses, and `false` otherwise.\n *\n * @memberof workbox.streams\n */\n function isSupported() {\n if (cachedIsSupported === undefined) {\n // See https://github.com/GoogleChrome/workbox/issues/1473\n try {\n new ReadableStream({ start() {} });\n cachedIsSupported = true;\n } catch (error) {\n cachedIsSupported = false;\n }\n }\n\n return cachedIsSupported;\n }\n\n /*\n Copyright 2018 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n var publicAPI = /*#__PURE__*/Object.freeze({\n concatenate: concatenate,\n concatenateToResponse: concatenateToResponse,\n isSupported: isSupported\n });\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * A shortcut to create a strategy that could be dropped-in to Workbox's router.\n *\n * On browsers that do not support constructing new `ReadableStream`s, this\n * strategy will automatically wait for all the `sourceFunctions` to complete,\n * and create a final response that concatenates their values together.\n *\n * @param {\n * Array<function(workbox.routing.Route~handlerCallback)>} sourceFunctions\n * Each function should return a {@link workbox.streams.StreamSource} (or a\n * Promise which resolves to one).\n * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,\n * `'text/html'` will be used by default.\n * @return {workbox.routing.Route~handlerCallback}\n *\n * @memberof workbox.streams\n */\n function strategy(sourceFunctions, headersInit) {\n return (() => {\n var _ref = babelHelpers.asyncToGenerator(function* ({ event, url, params }) {\n if (isSupported()) {\n const { done, response } = concatenateToResponse(sourceFunctions.map(function (sourceFunction) {\n return sourceFunction({ event, url, params });\n }), headersInit);\n event.waitUntil(done);\n return response;\n }\n\n {\n logger_mjs.logger.log(`The current browser doesn't support creating response ` + `streams. Falling back to non-streaming response instead.`);\n }\n\n // Fallback to waiting for everything to finish, and concatenating the\n // responses.\n const parts = yield Promise.all(sourceFunctions.map(function (sourceFunction) {\n return sourceFunction({ event, url, params });\n }).map((() => {\n var _ref2 = babelHelpers.asyncToGenerator(function* (responsePromise) {\n const response = yield responsePromise;\n if (response instanceof Response) {\n return response.blob();\n }\n\n // Otherwise, assume it's something like a string which can be used\n // as-is when constructing the final composite blob.\n return response;\n });\n\n return function (_x2) {\n return _ref2.apply(this, arguments);\n };\n })()));\n\n const headers = createHeaders(headersInit);\n // Constructing a new Response from a Blob source is well-supported.\n // So is constructing a new Blob from multiple source Blobs or strings.\n return new Response(new Blob(parts), { headers });\n });\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n })();\n }\n\n var defaultExport = {\n concatenate,\n concatenateToResponse,\n isSupported,\n strategy\n };\n\n /*\n Copyright 2018 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n const finalExport = Object.assign(defaultExport, publicAPI);\n\n return finalExport;\n\n}(workbox.core._private,workbox.core._private));\n"],"file":"workbox-streams.dev.js"}
1
+ {"version":3,"names":[],"mappings":"","sources":["packages/workbox-streams/browser.mjs"],"sourcesContent":["this.workbox = this.workbox || {};\nthis.workbox.streams = (function (logger_mjs,assert_mjs) {\n 'use strict';\n\n try {\n self.workbox.v['workbox:streams:3.4.1'] = 1;\n } catch (e) {} // eslint-disable-line\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * Takes either a Response, a ReadableStream, or a\n * [BodyInit](https://fetch.spec.whatwg.org/#bodyinit) and returns the\n * ReadableStreamReader object associated with it.\n *\n * @param {workbox.streams.StreamSource} source\n * @return {ReadableStreamReader}\n * @private\n */\n function _getReaderFromSource(source) {\n if (source.body && source.body.getReader) {\n return source.body.getReader();\n }\n\n if (source.getReader) {\n return source.getReader();\n }\n\n // TODO: This should be possible to do by constructing a ReadableStream, but\n // I can't get it to work. As a hack, construct a new Response, and use the\n // reader associated with its body.\n return new Response(source).body.getReader();\n }\n\n /**\n * Takes multiple source Promises, each of which could resolve to a Response, a\n * ReadableStream, or a [BodyInit](https://fetch.spec.whatwg.org/#bodyinit).\n *\n * Returns an object exposing a ReadableStream with each individual stream's\n * data returned in sequence, along with a Promise which signals when the\n * stream is finished (useful for passing to a FetchEvent's waitUntil()).\n *\n * @param {Array<Promise<workbox.streams.StreamSource>>} sourcePromises\n * @return {Object<{done: Promise, stream: ReadableStream}>}\n *\n * @memberof workbox.streams\n */\n function concatenate(sourcePromises) {\n {\n assert_mjs.assert.isArray(sourcePromises, {\n moduleName: 'workbox-streams',\n funcName: 'concatenate',\n paramName: 'sourcePromises'\n });\n }\n\n const readerPromises = sourcePromises.map(sourcePromise => {\n return Promise.resolve(sourcePromise).then(source => {\n return _getReaderFromSource(source);\n });\n });\n\n let fullyStreamedResolve;\n let fullyStreamedReject;\n const done = new Promise((resolve, reject) => {\n fullyStreamedResolve = resolve;\n fullyStreamedReject = reject;\n });\n\n let i = 0;\n const logMessages = [];\n const stream = new ReadableStream({\n pull(controller) {\n return readerPromises[i].then(reader => reader.read()).then(result => {\n if (result.done) {\n {\n logMessages.push(['Reached the end of source:', sourcePromises[i]]);\n }\n\n i++;\n if (i >= readerPromises.length) {\n // Log all the messages in the group at once in a single group.\n {\n logger_mjs.logger.groupCollapsed(`Concatenating ${readerPromises.length} sources.`);\n for (const message of logMessages) {\n if (Array.isArray(message)) {\n logger_mjs.logger.log(...message);\n } else {\n logger_mjs.logger.log(message);\n }\n }\n logger_mjs.logger.log('Finished reading all sources.');\n logger_mjs.logger.groupEnd();\n }\n\n controller.close();\n fullyStreamedResolve();\n return;\n }\n\n return this.pull(controller);\n } else {\n controller.enqueue(result.value);\n }\n }).catch(error => {\n {\n logger_mjs.logger.error('An error occurred:', error);\n }\n fullyStreamedReject(error);\n throw error;\n });\n },\n\n cancel() {\n {\n logger_mjs.logger.warn('The ReadableStream was cancelled.');\n }\n\n fullyStreamedResolve();\n }\n });\n\n return { done, stream };\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * This is a utility method that determines whether the current browser supports\n * the features required to create streamed responses. Currently, it checks if\n * [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)\n * is available.\n *\n * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,\n * `'text/html'` will be used by default.\n * @return {boolean} `true`, if the current browser meets the requirements for\n * streaming responses, and `false` otherwise.\n *\n * @memberof workbox.streams\n */\n function createHeaders(headersInit = {}) {\n // See https://github.com/GoogleChrome/workbox/issues/1461\n const headers = new Headers(headersInit);\n if (!headers.has('content-type')) {\n headers.set('content-type', 'text/html');\n }\n return headers;\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * Takes multiple source Promises, each of which could resolve to a Response, a\n * ReadableStream, or a [BodyInit](https://fetch.spec.whatwg.org/#bodyinit),\n * along with a\n * [HeadersInit](https://fetch.spec.whatwg.org/#typedefdef-headersinit).\n *\n * Returns an object exposing a Response whose body consists of each individual\n * stream's data returned in sequence, along with a Promise which signals when\n * the stream is finished (useful for passing to a FetchEvent's waitUntil()).\n *\n * @param {Array<Promise<workbox.streams.StreamSource>>} sourcePromises\n * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,\n * `'text/html'` will be used by default.\n * @return {Object<{done: Promise, response: Response}>}\n *\n * @memberof workbox.streams\n */\n function concatenateToResponse(sourcePromises, headersInit) {\n const { done, stream } = concatenate(sourcePromises);\n\n const headers = createHeaders(headersInit);\n const response = new Response(stream, { headers });\n\n return { done, response };\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n let cachedIsSupported = undefined;\n\n /**\n * This is a utility method that determines whether the current browser supports\n * the features required to create streamed responses. Currently, it checks if\n * [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)\n * can be created.\n *\n * @return {boolean} `true`, if the current browser meets the requirements for\n * streaming responses, and `false` otherwise.\n *\n * @memberof workbox.streams\n */\n function isSupported() {\n if (cachedIsSupported === undefined) {\n // See https://github.com/GoogleChrome/workbox/issues/1473\n try {\n new ReadableStream({ start() {} });\n cachedIsSupported = true;\n } catch (error) {\n cachedIsSupported = false;\n }\n }\n\n return cachedIsSupported;\n }\n\n /*\n Copyright 2018 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n var publicAPI = /*#__PURE__*/Object.freeze({\n concatenate: concatenate,\n concatenateToResponse: concatenateToResponse,\n isSupported: isSupported\n });\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * A shortcut to create a strategy that could be dropped-in to Workbox's router.\n *\n * On browsers that do not support constructing new `ReadableStream`s, this\n * strategy will automatically wait for all the `sourceFunctions` to complete,\n * and create a final response that concatenates their values together.\n *\n * @param {\n * Array<function(workbox.routing.Route~handlerCallback)>} sourceFunctions\n * Each function should return a {@link workbox.streams.StreamSource} (or a\n * Promise which resolves to one).\n * @param {HeadersInit} [headersInit] If there's no `Content-Type` specified,\n * `'text/html'` will be used by default.\n * @return {workbox.routing.Route~handlerCallback}\n *\n * @memberof workbox.streams\n */\n function strategy(sourceFunctions, headersInit) {\n return (() => {\n var _ref = babelHelpers.asyncToGenerator(function* ({ event, url, params }) {\n if (isSupported()) {\n const { done, response } = concatenateToResponse(sourceFunctions.map(function (sourceFunction) {\n return sourceFunction({ event, url, params });\n }), headersInit);\n event.waitUntil(done);\n return response;\n }\n\n {\n logger_mjs.logger.log(`The current browser doesn't support creating response ` + `streams. Falling back to non-streaming response instead.`);\n }\n\n // Fallback to waiting for everything to finish, and concatenating the\n // responses.\n const parts = yield Promise.all(sourceFunctions.map(function (sourceFunction) {\n return sourceFunction({ event, url, params });\n }).map((() => {\n var _ref2 = babelHelpers.asyncToGenerator(function* (responsePromise) {\n const response = yield responsePromise;\n if (response instanceof Response) {\n return response.blob();\n }\n\n // Otherwise, assume it's something like a string which can be used\n // as-is when constructing the final composite blob.\n return response;\n });\n\n return function (_x2) {\n return _ref2.apply(this, arguments);\n };\n })()));\n\n const headers = createHeaders(headersInit);\n // Constructing a new Response from a Blob source is well-supported.\n // So is constructing a new Blob from multiple source Blobs or strings.\n return new Response(new Blob(parts), { headers });\n });\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n })();\n }\n\n var defaultExport = {\n concatenate,\n concatenateToResponse,\n isSupported,\n strategy\n };\n\n /*\n Copyright 2018 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n const finalExport = Object.assign(defaultExport, publicAPI);\n\n return finalExport;\n\n}(workbox.core._private,workbox.core._private));\n"],"file":"workbox-streams.dev.js"}
@@ -1,3 +1,3 @@
1
- this.workbox=this.workbox||{},this.workbox.streams=function(){"use strict";try{self.workbox.v["workbox:streams:3.3.1"]=1}catch(e){}function e(e){const n=e.map(e=>Promise.resolve(e).then(e=>(e=e).body&&e.body.getReader?e.body.getReader():e.getReader?e.getReader():new Response(e).body.getReader()));var t;let r,o;let s=0;return{done:new Promise((e,n)=>{r=e,o=n}),stream:new ReadableStream({pull(e){return n[s].then(e=>e.read()).then(t=>{if(t.done)return++s>=n.length?(e.close(),void r()):this.pull(e);e.enqueue(t.value)}).catch(e=>{throw o(e),e})},cancel(){r()}})}}function n(e={}){const n=new Headers(e);return n.has("content-type")||n.set("content-type","text/html"),n}function t(t,r){const{done:o,stream:s}=e(t),c=n(r);return{done:o,response:new Response(s,{headers:c})}}let r=void 0;function o(){if(void 0===r)try{new ReadableStream({start(){}}),r=!0}catch(e){r=!1}return r}var s=Object.freeze({concatenate:e,concatenateToResponse:t,isSupported:o});var c={concatenate:e,concatenateToResponse:t,isSupported:o,strategy:function(e,r){return s=babelHelpers.asyncToGenerator(function*({event:s,url:c,params:a}){if(o()){const{done:n,response:o}=t(e.map(function(e){return e({event:s,url:c,params:a})}),r);return s.waitUntil(n),o}const u=yield Promise.all(e.map(function(e){return e({event:s,url:c,params:a})}).map((i=babelHelpers.asyncToGenerator(function*(e){const n=yield e;return n instanceof Response?n.blob():n}),function(e){return i.apply(this,arguments)})));var i;const l=n(r);return new Response(new Blob(u),{headers:l})}),function(e){return s.apply(this,arguments)};var s}};return Object.assign(c,s)}();
1
+ this.workbox=this.workbox||{},this.workbox.streams=function(){"use strict";try{self.workbox.v["workbox:streams:3.4.1"]=1}catch(e){}function e(e){const n=e.map(e=>Promise.resolve(e).then(e=>(e=e).body&&e.body.getReader?e.body.getReader():e.getReader?e.getReader():new Response(e).body.getReader()));var t;let r,o;let s=0;return{done:new Promise((e,n)=>{r=e,o=n}),stream:new ReadableStream({pull(e){return n[s].then(e=>e.read()).then(t=>{if(t.done)return++s>=n.length?(e.close(),void r()):this.pull(e);e.enqueue(t.value)}).catch(e=>{throw o(e),e})},cancel(){r()}})}}function n(e={}){const n=new Headers(e);return n.has("content-type")||n.set("content-type","text/html"),n}function t(t,r){const{done:o,stream:s}=e(t),c=n(r);return{done:o,response:new Response(s,{headers:c})}}let r=void 0;function o(){if(void 0===r)try{new ReadableStream({start(){}}),r=!0}catch(e){r=!1}return r}var s=Object.freeze({concatenate:e,concatenateToResponse:t,isSupported:o});var c={concatenate:e,concatenateToResponse:t,isSupported:o,strategy:function(e,r){return s=babelHelpers.asyncToGenerator(function*({event:s,url:c,params:a}){if(o()){const{done:n,response:o}=t(e.map(function(e){return e({event:s,url:c,params:a})}),r);return s.waitUntil(n),o}const u=yield Promise.all(e.map(function(e){return e({event:s,url:c,params:a})}).map((i=babelHelpers.asyncToGenerator(function*(e){const n=yield e;return n instanceof Response?n.blob():n}),function(e){return i.apply(this,arguments)})));var i;const l=n(r);return new Response(new Blob(u),{headers:l})}),function(e){return s.apply(this,arguments)};var s}};return Object.assign(c,s)}();
2
2
 
3
3
  //# sourceMappingURL=workbox-streams.prod.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"mappings":"","sources":["packages/workbox-streams/browser.mjs"],"sourcesContent":["this.workbox=this.workbox||{},this.workbox.streams=function(){\"use strict\";try{self.workbox.v[\"workbox:streams:3.3.1\"]=1}catch(e){}function e(e){const n=e.map(e=>Promise.resolve(e).then(e=>(e=e).body&&e.body.getReader?e.body.getReader():e.getReader?e.getReader():new Response(e).body.getReader()));var t;let r,o;let s=0;return{done:new Promise((e,n)=>{r=e,o=n}),stream:new ReadableStream({pull(e){return n[s].then(e=>e.read()).then(t=>{if(t.done)return++s>=n.length?(e.close(),void r()):this.pull(e);e.enqueue(t.value)}).catch(e=>{throw o(e),e})},cancel(){r()}})}}function n(e={}){const n=new Headers(e);return n.has(\"content-type\")||n.set(\"content-type\",\"text/html\"),n}function t(t,r){const{done:o,stream:s}=e(t),c=n(r);return{done:o,response:new Response(s,{headers:c})}}let r=void 0;function o(){if(void 0===r)try{new ReadableStream({start(){}}),r=!0}catch(e){r=!1}return r}var s=Object.freeze({concatenate:e,concatenateToResponse:t,isSupported:o});var c={concatenate:e,concatenateToResponse:t,isSupported:o,strategy:function(e,r){return s=babelHelpers.asyncToGenerator(function*({event:s,url:c,params:a}){if(o()){const{done:n,response:o}=t(e.map(function(e){return e({event:s,url:c,params:a})}),r);return s.waitUntil(n),o}const u=yield Promise.all(e.map(function(e){return e({event:s,url:c,params:a})}).map((i=babelHelpers.asyncToGenerator(function*(e){const n=yield e;return n instanceof Response?n.blob():n}),function(e){return i.apply(this,arguments)})));var i;const l=n(r);return new Response(new Blob(u),{headers:l})}),function(e){return s.apply(this,arguments)};var s}};return Object.assign(c,s)}();\n"],"file":"workbox-streams.prod.js"}
1
+ {"version":3,"names":[],"mappings":"","sources":["packages/workbox-streams/browser.mjs"],"sourcesContent":["this.workbox=this.workbox||{},this.workbox.streams=function(){\"use strict\";try{self.workbox.v[\"workbox:streams:3.4.1\"]=1}catch(e){}function e(e){const n=e.map(e=>Promise.resolve(e).then(e=>(e=e).body&&e.body.getReader?e.body.getReader():e.getReader?e.getReader():new Response(e).body.getReader()));var t;let r,o;let s=0;return{done:new Promise((e,n)=>{r=e,o=n}),stream:new ReadableStream({pull(e){return n[s].then(e=>e.read()).then(t=>{if(t.done)return++s>=n.length?(e.close(),void r()):this.pull(e);e.enqueue(t.value)}).catch(e=>{throw o(e),e})},cancel(){r()}})}}function n(e={}){const n=new Headers(e);return n.has(\"content-type\")||n.set(\"content-type\",\"text/html\"),n}function t(t,r){const{done:o,stream:s}=e(t),c=n(r);return{done:o,response:new Response(s,{headers:c})}}let r=void 0;function o(){if(void 0===r)try{new ReadableStream({start(){}}),r=!0}catch(e){r=!1}return r}var s=Object.freeze({concatenate:e,concatenateToResponse:t,isSupported:o});var c={concatenate:e,concatenateToResponse:t,isSupported:o,strategy:function(e,r){return s=babelHelpers.asyncToGenerator(function*({event:s,url:c,params:a}){if(o()){const{done:n,response:o}=t(e.map(function(e){return e({event:s,url:c,params:a})}),r);return s.waitUntil(n),o}const u=yield Promise.all(e.map(function(e){return e({event:s,url:c,params:a})}).map((i=babelHelpers.asyncToGenerator(function*(e){const n=yield e;return n instanceof Response?n.blob():n}),function(e){return i.apply(this,arguments)})));var i;const l=n(r);return new Response(new Blob(u),{headers:l})}),function(e){return s.apply(this,arguments)};var s}};return Object.assign(c,s)}();\n"],"file":"workbox-streams.prod.js"}
@@ -0,0 +1,3 @@
1
+ var workbox=function(){"use strict";try{self.workbox.v["workbox:sw:3.4.1"]=1}catch(t){}const t="https://storage.googleapis.com/workbox-cdn/releases/3.4.1",e={backgroundSync:"background-sync",broadcastUpdate:"broadcast-cache-update",cacheableResponse:"cacheable-response",core:"core",expiration:"cache-expiration",googleAnalytics:"google-analytics",navigationPreload:"navigation-preload",precaching:"precaching",rangeRequests:"range-requests",routing:"routing",strategies:"strategies",streams:"streams"};return new class{constructor(){return this.v={},this.t={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?"dev":"prod",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.t,t),this.e=this.t.debug?"dev":"prod"}skipWaiting(){self.addEventListener("install",()=>self.skipWaiting())}clientsClaim(){self.addEventListener("activate",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&""===(s=r.split("/"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join("/")}}}();
2
+
3
+ //# sourceMappingURL=workbox-sw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"mappings":"","sources":["packages/workbox-sw/browser.mjs"],"sourcesContent":["var workbox=function(){\"use strict\";try{self.workbox.v[\"workbox:sw:3.4.1\"]=1}catch(t){}const t=\"https://storage.googleapis.com/workbox-cdn/releases/3.4.1\",e={backgroundSync:\"background-sync\",broadcastUpdate:\"broadcast-cache-update\",cacheableResponse:\"cacheable-response\",core:\"core\",expiration:\"cache-expiration\",googleAnalytics:\"google-analytics\",navigationPreload:\"navigation-preload\",precaching:\"precaching\",rangeRequests:\"range-requests\",routing:\"routing\",strategies:\"strategies\",streams:\"streams\"};return new class{constructor(){return this.v={},this.t={debug:\"localhost\"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?\"dev\":\"prod\",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error(\"Config must be set before accessing workbox.* modules\");Object.assign(this.t,t),this.e=this.t.debug?\"dev\":\"prod\"}skipWaiting(){self.addEventListener(\"install\",()=>self.skipWaiting())}clientsClaim(){self.addEventListener(\"activate\",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&\"\"===(s=r.split(\"/\"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join(\"/\")}}}();\n"],"file":"workbox-sw.js"}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-pwa-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pan Yuqi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-06 00:00:00.000000000 Z
11
+ date: 2018-09-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This plugin provides PWA support for Jekyll. Generate a service worker
14
14
  and provides precache with Google Workbox.
@@ -18,52 +18,56 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - lib/jekyll-pwa-plugin.rb
21
- - lib/vendor/workbox-v3.3.1/workbox-background-sync.dev.js
22
- - lib/vendor/workbox-v3.3.1/workbox-background-sync.dev.js.map
23
- - lib/vendor/workbox-v3.3.1/workbox-background-sync.prod.js
24
- - lib/vendor/workbox-v3.3.1/workbox-background-sync.prod.js.map
25
- - lib/vendor/workbox-v3.3.1/workbox-broadcast-cache-update.dev.js
26
- - lib/vendor/workbox-v3.3.1/workbox-broadcast-cache-update.dev.js.map
27
- - lib/vendor/workbox-v3.3.1/workbox-broadcast-cache-update.prod.js
28
- - lib/vendor/workbox-v3.3.1/workbox-broadcast-cache-update.prod.js.map
29
- - lib/vendor/workbox-v3.3.1/workbox-cache-expiration.dev.js
30
- - lib/vendor/workbox-v3.3.1/workbox-cache-expiration.dev.js.map
31
- - lib/vendor/workbox-v3.3.1/workbox-cache-expiration.prod.js
32
- - lib/vendor/workbox-v3.3.1/workbox-cache-expiration.prod.js.map
33
- - lib/vendor/workbox-v3.3.1/workbox-cacheable-response.dev.js
34
- - lib/vendor/workbox-v3.3.1/workbox-cacheable-response.dev.js.map
35
- - lib/vendor/workbox-v3.3.1/workbox-cacheable-response.prod.js
36
- - lib/vendor/workbox-v3.3.1/workbox-cacheable-response.prod.js.map
37
- - lib/vendor/workbox-v3.3.1/workbox-core.dev.js
38
- - lib/vendor/workbox-v3.3.1/workbox-core.dev.js.map
39
- - lib/vendor/workbox-v3.3.1/workbox-core.prod.js
40
- - lib/vendor/workbox-v3.3.1/workbox-core.prod.js.map
41
- - lib/vendor/workbox-v3.3.1/workbox-google-analytics.dev.js
42
- - lib/vendor/workbox-v3.3.1/workbox-google-analytics.dev.js.map
43
- - lib/vendor/workbox-v3.3.1/workbox-google-analytics.prod.js
44
- - lib/vendor/workbox-v3.3.1/workbox-google-analytics.prod.js.map
45
- - lib/vendor/workbox-v3.3.1/workbox-precaching.dev.js
46
- - lib/vendor/workbox-v3.3.1/workbox-precaching.dev.js.map
47
- - lib/vendor/workbox-v3.3.1/workbox-precaching.prod.js
48
- - lib/vendor/workbox-v3.3.1/workbox-precaching.prod.js.map
49
- - lib/vendor/workbox-v3.3.1/workbox-range-requests.dev.js
50
- - lib/vendor/workbox-v3.3.1/workbox-range-requests.dev.js.map
51
- - lib/vendor/workbox-v3.3.1/workbox-range-requests.prod.js
52
- - lib/vendor/workbox-v3.3.1/workbox-range-requests.prod.js.map
53
- - lib/vendor/workbox-v3.3.1/workbox-routing.dev.js
54
- - lib/vendor/workbox-v3.3.1/workbox-routing.dev.js.map
55
- - lib/vendor/workbox-v3.3.1/workbox-routing.prod.js
56
- - lib/vendor/workbox-v3.3.1/workbox-routing.prod.js.map
57
- - lib/vendor/workbox-v3.3.1/workbox-strategies.dev.js
58
- - lib/vendor/workbox-v3.3.1/workbox-strategies.dev.js.map
59
- - lib/vendor/workbox-v3.3.1/workbox-strategies.prod.js
60
- - lib/vendor/workbox-v3.3.1/workbox-strategies.prod.js.map
61
- - lib/vendor/workbox-v3.3.1/workbox-streams.dev.js
62
- - lib/vendor/workbox-v3.3.1/workbox-streams.dev.js.map
63
- - lib/vendor/workbox-v3.3.1/workbox-streams.prod.js
64
- - lib/vendor/workbox-v3.3.1/workbox-streams.prod.js.map
65
- - lib/vendor/workbox-v3.3.1/workbox-sw.js
66
- - lib/vendor/workbox-v3.3.1/workbox-sw.js.map
21
+ - lib/vendor/workbox-v3.4.1/workbox-background-sync.dev.js
22
+ - lib/vendor/workbox-v3.4.1/workbox-background-sync.dev.js.map
23
+ - lib/vendor/workbox-v3.4.1/workbox-background-sync.prod.js
24
+ - lib/vendor/workbox-v3.4.1/workbox-background-sync.prod.js.map
25
+ - lib/vendor/workbox-v3.4.1/workbox-broadcast-cache-update.dev.js
26
+ - lib/vendor/workbox-v3.4.1/workbox-broadcast-cache-update.dev.js.map
27
+ - lib/vendor/workbox-v3.4.1/workbox-broadcast-cache-update.prod.js
28
+ - lib/vendor/workbox-v3.4.1/workbox-broadcast-cache-update.prod.js.map
29
+ - lib/vendor/workbox-v3.4.1/workbox-cache-expiration.dev.js
30
+ - lib/vendor/workbox-v3.4.1/workbox-cache-expiration.dev.js.map
31
+ - lib/vendor/workbox-v3.4.1/workbox-cache-expiration.prod.js
32
+ - lib/vendor/workbox-v3.4.1/workbox-cache-expiration.prod.js.map
33
+ - lib/vendor/workbox-v3.4.1/workbox-cacheable-response.dev.js
34
+ - lib/vendor/workbox-v3.4.1/workbox-cacheable-response.dev.js.map
35
+ - lib/vendor/workbox-v3.4.1/workbox-cacheable-response.prod.js
36
+ - lib/vendor/workbox-v3.4.1/workbox-cacheable-response.prod.js.map
37
+ - lib/vendor/workbox-v3.4.1/workbox-core.dev.js
38
+ - lib/vendor/workbox-v3.4.1/workbox-core.dev.js.map
39
+ - lib/vendor/workbox-v3.4.1/workbox-core.prod.js
40
+ - lib/vendor/workbox-v3.4.1/workbox-core.prod.js.map
41
+ - lib/vendor/workbox-v3.4.1/workbox-google-analytics.dev.js
42
+ - lib/vendor/workbox-v3.4.1/workbox-google-analytics.dev.js.map
43
+ - lib/vendor/workbox-v3.4.1/workbox-google-analytics.prod.js
44
+ - lib/vendor/workbox-v3.4.1/workbox-google-analytics.prod.js.map
45
+ - lib/vendor/workbox-v3.4.1/workbox-navigation-preload.dev.js
46
+ - lib/vendor/workbox-v3.4.1/workbox-navigation-preload.dev.js.map
47
+ - lib/vendor/workbox-v3.4.1/workbox-navigation-preload.prod.js
48
+ - lib/vendor/workbox-v3.4.1/workbox-navigation-preload.prod.js.map
49
+ - lib/vendor/workbox-v3.4.1/workbox-precaching.dev.js
50
+ - lib/vendor/workbox-v3.4.1/workbox-precaching.dev.js.map
51
+ - lib/vendor/workbox-v3.4.1/workbox-precaching.prod.js
52
+ - lib/vendor/workbox-v3.4.1/workbox-precaching.prod.js.map
53
+ - lib/vendor/workbox-v3.4.1/workbox-range-requests.dev.js
54
+ - lib/vendor/workbox-v3.4.1/workbox-range-requests.dev.js.map
55
+ - lib/vendor/workbox-v3.4.1/workbox-range-requests.prod.js
56
+ - lib/vendor/workbox-v3.4.1/workbox-range-requests.prod.js.map
57
+ - lib/vendor/workbox-v3.4.1/workbox-routing.dev.js
58
+ - lib/vendor/workbox-v3.4.1/workbox-routing.dev.js.map
59
+ - lib/vendor/workbox-v3.4.1/workbox-routing.prod.js
60
+ - lib/vendor/workbox-v3.4.1/workbox-routing.prod.js.map
61
+ - lib/vendor/workbox-v3.4.1/workbox-strategies.dev.js
62
+ - lib/vendor/workbox-v3.4.1/workbox-strategies.dev.js.map
63
+ - lib/vendor/workbox-v3.4.1/workbox-strategies.prod.js
64
+ - lib/vendor/workbox-v3.4.1/workbox-strategies.prod.js.map
65
+ - lib/vendor/workbox-v3.4.1/workbox-streams.dev.js
66
+ - lib/vendor/workbox-v3.4.1/workbox-streams.dev.js.map
67
+ - lib/vendor/workbox-v3.4.1/workbox-streams.prod.js
68
+ - lib/vendor/workbox-v3.4.1/workbox-streams.prod.js.map
69
+ - lib/vendor/workbox-v3.4.1/workbox-sw.js
70
+ - lib/vendor/workbox-v3.4.1/workbox-sw.js.map
67
71
  homepage: https://github.com/lavas-project/jekyll-pwa
68
72
  licenses:
69
73
  - MIT
@@ -1,3 +0,0 @@
1
- self.babelHelpers={asyncToGenerator:function(e){return function(){var r=e.apply(this,arguments);return new Promise(function(e,t){return function n(o,i){try{var c=r[o](i),l=c.value}catch(e){return void t(e)}if(!c.done)return Promise.resolve(l).then(function(e){n("next",e)},function(e){n("throw",e)});e(l)}("next")})}}},this.workbox=this.workbox||{},this.workbox.core=function(){"use strict";try{self.workbox.v["workbox:core:3.3.1"]=1}catch(e){}var e={debug:0,log:1,warn:2,error:3,silent:4};const r=(e,...r)=>{let t=e;return r.length>0&&(t+=` :: ${JSON.stringify(r)}`),t};class t extends Error{constructor(e,t){super(r(e,t)),this.name=e,this.details=t}}const n={prefix:"workbox",suffix:self.registration.scope,googleAnalytics:"googleAnalytics",precache:"precache",runtime:"runtime"},o=e=>[n.prefix,e,n.suffix].filter(e=>e.length>0).join("-"),i={updateDetails:e=>{Object.keys(n).forEach(r=>{void 0!==e[r]&&(n[r]=e[r])})},getGoogleAnalyticsName:e=>e||o(n.googleAnalytics),getPrecacheName:e=>e||o(n.precache),getRuntimeName:e=>e||o(n.runtime)},c=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);let l=(()=>e.warn)();const u=e=>l<=e,s=e=>l=e,a=()=>l,f=e.error,d=function(r,t,n){const o=0===r.indexOf("group")?f:e[r];if(!u(o))return;if(!n||"groupCollapsed"===r&&c)return void console[r](...t);const i=["%cworkbox",`background: ${n}; color: white; padding: 2px 0.5em; `+"border-radius: 0.5em;"];console[r](...i,...t)},h=()=>{u(f)&&console.groupEnd()},p={groupEnd:h,unprefixed:{groupEnd:h}},b={debug:"#7f8c8d",log:"#2ecc71",warn:"#f39c12",error:"#c0392b",groupCollapsed:"#3498db"};var y,g;Object.keys(b).forEach(e=>(e=e,g=b[e],p[e]=((...r)=>d(e,r,g)),void(p.unprefixed[e]=((...r)=>d(e,r)))));var v=new class{constructor(){try{self.workbox.v=self.workbox.v||{}}catch(e){}}get cacheNames(){return{googleAnalytics:i.getGoogleAnalyticsName(),precache:i.getPrecacheName(),runtime:i.getRuntimeName()}}setCacheNameDetails(e){i.updateDetails(e)}get logLevel(){return a()}setLogLevel(r){if(r>e.silent||r<e.debug)throw new t("invalid-value",{paramName:"logLevel",validValueDescription:"Please use a value from LOG_LEVELS, i.e 'logLevel = workbox.core.LOG_LEVELS.debug'.",value:r});s(r)}};class w{constructor(e,r,{onupgradeneeded:t,onversionchange:n=this.e}={}){this.r=e,this.t=r,this.n=t,this.e=n,this.o=null}open(){var e=this;return babelHelpers.asyncToGenerator(function*(){if(!e.o)return e.o=yield new Promise(function(r,t){let n=!1;setTimeout(function(){n=!0,t(new Error("The open request was blocked and timed out"))},e.OPEN_TIMEOUT);const o=indexedDB.open(e.r,e.t);o.onerror=function(e){return t(o.error)},o.onupgradeneeded=function(r){n?(o.transaction.abort(),r.target.result.close()):e.n&&e.n(r)},o.onsuccess=function(t){const o=t.target.result;n?o.close():(o.onversionchange=e.e,r(o))}}),e})()}get(e,...r){var t=this;return babelHelpers.asyncToGenerator(function*(){return yield t.i("get",e,"readonly",...r)})()}add(e,...r){var t=this;return babelHelpers.asyncToGenerator(function*(){return yield t.i("add",e,"readwrite",...r)})()}put(e,...r){var t=this;return babelHelpers.asyncToGenerator(function*(){return yield t.i("put",e,"readwrite",...r)})()}delete(e,...r){var t=this;return babelHelpers.asyncToGenerator(function*(){yield t.i("delete",e,"readwrite",...r)})()}deleteDatabase(){var e=this;return babelHelpers.asyncToGenerator(function*(){e.close(),e.o=null,yield new Promise(function(r,t){const n=indexedDB.deleteDatabase(e.r);n.onerror=function(e){return t(e.target.error)},n.onblocked=function(){return t(new Error("Deletion was blocked."))},n.onsuccess=function(){return r()}})})()}getAll(e,r,t){var n=this;return babelHelpers.asyncToGenerator(function*(){return"getAll"in IDBObjectStore.prototype?yield n.i("getAll",e,"readonly",r,t):yield n.getAllMatching(e,{query:r,count:t})})()}getAllMatching(e,r={}){var t=this;return babelHelpers.asyncToGenerator(function*(){return yield t.transaction([e],"readonly",function(t,n){const o=t[e],i=[];(r.index?o.index(r.index):o).openCursor(r.query,r.direction).onsuccess=function(e){const t=e.target.result;if(t){const{primaryKey:e,key:o,value:c}=t;i.push(r.includeKeys?{primaryKey:e,key:o,value:c}:c),r.count&&i.length>=r.count?n(i):t.continue()}else n(i)}})})()}transaction(e,r,t){var n=this;return babelHelpers.asyncToGenerator(function*(){return yield n.open(),yield new Promise(function(o,i){const c=n.o.transaction(e,r);c.onerror=function(e){return i(e.target.error)},c.onabort=function(e){return i(e.target.error)},c.oncomplete=function(){return o()};const l={};for(const r of e)l[r]=c.objectStore(r);t(l,function(e){return o(e)},function(){i(new Error("The transaction was manually aborted")),c.abort()})})})()}i(e,r,t,...n){var o=this;return babelHelpers.asyncToGenerator(function*(){yield o.open();return yield o.transaction([r],t,function(t,o){t[r][e](...n).onsuccess=function(e){o(e.target.result)}})})()}e(e){this.close()}close(){this.o&&this.o.close()}}w.prototype.OPEN_TIMEOUT=2e3;var m="cacheDidUpdate",E="cacheWillUpdate",L="cachedResponseWillBeUsed",H="fetchDidFail",x="requestWillFetch",k=(e,r)=>e.filter(e=>r in e);let q=(D=babelHelpers.asyncToGenerator(function*(){for(const e of N)yield e()}),function(){return D.apply(this,arguments)});var D;const N=new Set;const O=e=>{const r=new URL(e,location);return r.origin===location.origin?r.pathname:r.href},R=(()=>{var e=babelHelpers.asyncToGenerator(function*(e,r,n,o=[]){if(!n)throw new t("cache-put-with-no-response",{url:O(r.url)});let i=yield W(r,n,o);if(!i)return;const c=yield caches.open(e),l=k(o,m);let u=l.length>0?yield A(e,r):null;try{yield c.put(r,i)}catch(e){throw"QuotaExceededError"===e.name&&(yield q()),e}for(let t of l)yield t[m].call(t,{cacheName:e,request:r,oldResponse:u,newResponse:i})});return function(r,t,n){return e.apply(this,arguments)}})(),A=(P=babelHelpers.asyncToGenerator(function*(e,r,t,n=[]){let o=yield(yield caches.open(e)).match(r,t);for(let i of n)L in i&&(o=yield i[L].call(i,{cacheName:e,request:r,matchOptions:t,cachedResponse:o}));return o}),function(e,r,t){return P.apply(this,arguments)});var P;const W=(S=babelHelpers.asyncToGenerator(function*(e,r,t){let n=r,o=!1;for(let r of t)if(E in r&&(o=!0,!(n=yield r[E].call(r,{request:e,response:n}))))break;return o||(n=n.ok?n:null),n||null}),function(e,r,t){return S.apply(this,arguments)});var S;const _={put:R,match:A},j={fetch:(()=>{var e=babelHelpers.asyncToGenerator(function*(e,r,n=[]){"string"==typeof e&&(e=new Request(e));const o=k(n,H),i=o.length>0?e.clone():null;try{for(let r of n)x in r&&(e=yield r[x].call(r,{request:e.clone()}))}catch(e){throw new t("plugin-error-request-will-fetch",{thrownError:e})}const c=e.clone();try{return yield fetch(e,r)}catch(e){for(let r of o)yield r[H].call(r,{error:e,originalRequest:i.clone(),request:c.clone()});throw e}});return function(r,t){return e.apply(this,arguments)}})()};var B=Object.freeze({DBWrapper:w,WorkboxError:t,assert:null,cacheNames:i,cacheWrapper:_,fetchWrapper:j,getFriendlyURL:O,logger:p,registerQuotaErrorCallback:function(e){N.add(e)}});return Object.assign(v,{LOG_LEVELS:e,_private:B})}();
2
-
3
- //# sourceMappingURL=workbox-core.prod.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"mappings":"","sources":["packages/workbox-strategies/browser.mjs"],"sourcesContent":["this.workbox = this.workbox || {};\nthis.workbox.strategies = (function (logger_mjs,assert_mjs,cacheNames_mjs,cacheWrapper_mjs,fetchWrapper_mjs,getFriendlyURL_mjs) {\n 'use strict';\n\n try {\n self.workbox.v['workbox:strategies:3.3.1'] = 1;\n } catch (e) {} // eslint-disable-line\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n const getFriendlyURL = url => {\n const urlObj = new URL(url, location);\n if (urlObj.origin === location.origin) {\n return urlObj.pathname;\n }\n return urlObj.href;\n };\n\n var messages = {\n strategyStart: (strategyName, request) => `Using ${strategyName} to ` + `respond to '${getFriendlyURL(request.url)}'`,\n printFinalResponse: response => {\n if (response) {\n logger_mjs.logger.groupCollapsed(`View the final response here.`);\n logger_mjs.logger.unprefixed.log(response);\n logger_mjs.logger.groupEnd();\n }\n }\n };\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * An implementation of a [cache-first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-falling-back-to-network}\n * request strategy.\n *\n * A cache first strategy is useful for assets that have been revisioned,\n * such as URLs like `/styles/example.a8f5f1.css`, since they\n * can be cached for long periods of time.\n *\n * @memberof workbox.strategies\n */\n class CacheFirst {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link workbox.core.cacheNames}.\n * @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames_mjs.cacheNames.getRuntimeName(options.cacheName);\n this._plugins = options.plugins || [];\n this._fetchOptions = options.fetchOptions || null;\n }\n\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link workbox.routing.Router}.\n *\n * @param {Object} input\n * @param {FetchEvent} input.event The fetch event to run this strategy\n * against.\n * @return {Promise<Response>}\n */\n handle({ event }) {\n var _this = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n {\n assert_mjs.assert.isInstance(event, FetchEvent, {\n moduleName: 'workbox-strategies',\n className: 'CacheFirst',\n funcName: 'handle',\n paramName: 'event'\n });\n }\n\n return _this.makeRequest({\n event,\n request: event.request\n });\n })();\n }\n\n /**\n * This method can be used to perform a make a standalone request outside the\n * context of the [Workbox Router]{@link workbox.routing.Router}.\n *\n * See \"[Advanced Recipes](https://developers.google.com/web/tools/workbox/guides/advanced-recipes#make-requests)\"\n * for more usage information.\n *\n * @param {Object} input\n * @param {Request|string} input.request Either a\n * [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request}\n * object, or a string URL, corresponding to the request to be made.\n * @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be\n * called automatically to extend the service worker's lifetime.\n * @return {Promise<Response>}\n */\n makeRequest({ event, request }) {\n var _this2 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n const logs = [];\n\n if (typeof request === 'string') {\n request = new Request(request);\n }\n\n {\n assert_mjs.assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'CacheFirst',\n funcName: 'makeRequest',\n paramName: 'request'\n });\n }\n\n let response = yield cacheWrapper_mjs.cacheWrapper.match(_this2._cacheName, request, null, _this2._plugins);\n\n let error;\n if (!response) {\n {\n logs.push(`No response found in the '${_this2._cacheName}' cache. ` + `Will respond with a network request.`);\n }\n try {\n response = yield _this2._getFromNetwork(request, event);\n } catch (err) {\n error = err;\n }\n\n {\n if (response) {\n logs.push(`Got response from network.`);\n } else {\n logs.push(`Unable to get a response from the network.`);\n }\n }\n } else {\n {\n logs.push(`Found a cached response in the '${_this2._cacheName}' cache.`);\n }\n }\n\n {\n logger_mjs.logger.groupCollapsed(messages.strategyStart('CacheFirst', request));\n for (let log of logs) {\n logger_mjs.logger.log(log);\n }\n messages.printFinalResponse(response);\n logger_mjs.logger.groupEnd();\n }\n\n if (error) {\n // Don't swallow error as we'll want it to throw and enable catch\n // handlers in router.\n throw error;\n }\n\n return response;\n })();\n }\n\n /**\n * Handles the network and cache part of CacheFirst.\n *\n * @param {Request} request\n * @param {FetchEvent} [event]\n * @return {Promise<Response>}\n *\n * @private\n */\n _getFromNetwork(request, event) {\n var _this3 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n const response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this3._fetchOptions, _this3._plugins);\n\n // Keep the service worker while we put the request to the cache\n const responseClone = response.clone();\n const cachePutPromise = cacheWrapper_mjs.cacheWrapper.put(_this3._cacheName, request, responseClone, _this3._plugins);\n\n if (event) {\n try {\n event.waitUntil(cachePutPromise);\n } catch (error) {\n {\n logger_mjs.logger.warn(`Unable to ensure service worker stays alive when ` + `updating cache for '${getFriendlyURL_mjs.getFriendlyURL(event.request.url)}'.`);\n }\n }\n }\n\n return response;\n })();\n }\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * An implementation of a\n * [cache-only]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-only}\n * request strategy.\n *\n * 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}.\n *\n * @memberof workbox.strategies\n */\n class CacheOnly {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link workbox.core.cacheNames}.\n * @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames_mjs.cacheNames.getRuntimeName(options.cacheName);\n this._plugins = options.plugins || [];\n }\n\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link workbox.routing.Router}.\n *\n * @param {Object} input\n * @param {FetchEvent} input.event The fetch event to run this strategy\n * against.\n * @return {Promise<Response>}\n */\n handle({ event }) {\n var _this = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n {\n assert_mjs.assert.isInstance(event, FetchEvent, {\n moduleName: 'workbox-strategies',\n className: 'CacheOnly',\n funcName: 'handle',\n paramName: 'event'\n });\n }\n\n return _this.makeRequest({\n event,\n request: event.request\n });\n })();\n }\n\n /**\n * This method can be used to perform a make a standalone request outside the\n * context of the [Workbox Router]{@link workbox.routing.Router}.\n *\n * See \"[Advanced Recipes](https://developers.google.com/web/tools/workbox/guides/advanced-recipes#make-requests)\"\n * for more usage information.\n *\n * @param {Object} input\n * @param {Request|string} input.request Either a\n * [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request}\n * object, or a string URL, corresponding to the request to be made.\n * @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be\n * called automatically to extend the service worker's lifetime.\n * @return {Promise<Response>}\n */\n makeRequest({ event, request }) {\n var _this2 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n if (typeof request === 'string') {\n request = new Request(request);\n }\n\n {\n assert_mjs.assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'CacheOnly',\n funcName: 'makeRequest',\n paramName: 'request'\n });\n }\n\n const response = yield cacheWrapper_mjs.cacheWrapper.match(_this2._cacheName, request, null, _this2._plugins);\n\n {\n logger_mjs.logger.groupCollapsed(messages.strategyStart('CacheOnly', request));\n if (response) {\n logger_mjs.logger.log(`Found a cached response in the '${_this2._cacheName}'` + ` cache.`);\n messages.printFinalResponse(response);\n } else {\n logger_mjs.logger.log(`No response found in the '${_this2._cacheName}' cache.`);\n }\n logger_mjs.logger.groupEnd();\n }\n\n return response;\n })();\n }\n }\n\n /*\n Copyright 2016 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n var cacheOkAndOpaquePlugin = {\n /**\n * Return return a response (i.e. allow caching) if the\n * response is ok (i.e. 200) or is opaque.\n *\n * @param {Object} input\n * @param {Response} input.response\n * @return {Response|null}\n *\n * @private\n */\n cacheWillUpdate: ({ response }) => {\n if (response.ok || response.status === 0) {\n return response;\n }\n return null;\n }\n };\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * An implementation of a\n * [network first]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#network-falling-back-to-cache}\n * request strategy.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses]{@link https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests}.\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS]{@link https://enable-cors.org/}.\n *\n * @memberof workbox.strategies\n */\n class NetworkFirst {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link workbox.core.cacheNames}.\n * @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n * @param {number} options.networkTimeoutSeconds If set, any network requests\n * that fail to respond within the timeout will fallback to the cache.\n *\n * This option can be used to combat\n * \"[lie-fi]{@link https://developers.google.com/web/fundamentals/performance/poor-connectivity/#lie-fi}\"\n * scenarios.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames_mjs.cacheNames.getRuntimeName(options.cacheName);\n\n if (options.plugins) {\n let isUsingCacheWillUpdate = options.plugins.some(plugin => !!plugin.cacheWillUpdate);\n this._plugins = isUsingCacheWillUpdate ? options.plugins : [cacheOkAndOpaquePlugin, ...options.plugins];\n } else {\n // No plugins passed in, use the default plugin.\n this._plugins = [cacheOkAndOpaquePlugin];\n }\n\n this._networkTimeoutSeconds = options.networkTimeoutSeconds;\n {\n if (this._networkTimeoutSeconds) {\n assert_mjs.assert.isType(this._networkTimeoutSeconds, 'number', {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'constructor',\n paramName: 'networkTimeoutSeconds'\n });\n }\n }\n\n this._fetchOptions = options.fetchOptions || null;\n }\n\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link workbox.routing.Router}.\n *\n * @param {Object} input\n * @param {FetchEvent} input.event The fetch event to run this strategy\n * against.\n * @return {Promise<Response>}\n */\n handle({ event }) {\n var _this = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n {\n assert_mjs.assert.isInstance(event, FetchEvent, {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'handle',\n paramName: 'event'\n });\n }\n\n return _this.makeRequest({\n event,\n request: event.request\n });\n })();\n }\n\n /**\n * This method can be used to perform a make a standalone request outside the\n * context of the [Workbox Router]{@link workbox.routing.Router}.\n *\n * See \"[Advanced Recipes](https://developers.google.com/web/tools/workbox/guides/advanced-recipes#make-requests)\"\n * for more usage information.\n *\n * @param {Object} input\n * @param {Request|string} input.request Either a\n * [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request}\n * object, or a string URL, corresponding to the request to be made.\n * @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be\n * called automatically to extend the service worker's lifetime.\n * @return {Promise<Response>}\n */\n makeRequest({ event, request }) {\n var _this2 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n const logs = [];\n\n if (typeof request === 'string') {\n request = new Request(request);\n }\n\n {\n assert_mjs.assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'NetworkFirst',\n funcName: 'handle',\n paramName: 'makeRequest'\n });\n }\n\n const promises = [];\n let timeoutId;\n\n if (_this2._networkTimeoutSeconds) {\n const { id, promise } = _this2._getTimeoutPromise(request, logs);\n timeoutId = id;\n promises.push(promise);\n }\n\n const networkPromise = _this2._getNetworkPromise(timeoutId, event, request, logs);\n promises.push(networkPromise);\n\n // Promise.race() will resolve as soon as the first promise resolves.\n let response = yield Promise.race(promises);\n // If Promise.race() resolved with null, it might be due to a network\n // timeout + a cache miss. If that were to happen, we'd rather wait until\n // the networkPromise resolves instead of returning null.\n // Note that it's fine to await an already-resolved promise, so we don't\n // have to check to see if it's still \"in flight\".\n if (!response) {\n response = yield networkPromise;\n }\n\n {\n logger_mjs.logger.groupCollapsed(messages.strategyStart('NetworkFirst', request));\n for (let log of logs) {\n logger_mjs.logger.log(log);\n }\n messages.printFinalResponse(response);\n logger_mjs.logger.groupEnd();\n }\n\n return response;\n })();\n }\n\n /**\n * @param {Request} request\n * @param {Array} logs A reference to the logs array\n * @return {Promise<Response>}\n *\n * @private\n */\n _getTimeoutPromise(request, logs) {\n var _this3 = this;\n\n let timeoutId;\n const timeoutPromise = new Promise(resolve => {\n const onNetworkTimeout = (() => {\n var _ref = babelHelpers.asyncToGenerator(function* () {\n {\n logs.push(`Timing out the network response at ` + `${_this3._networkTimeoutSeconds} seconds.`);\n }\n\n resolve((yield _this3._respondFromCache(request)));\n });\n\n return function onNetworkTimeout() {\n return _ref.apply(this, arguments);\n };\n })();\n\n timeoutId = setTimeout(onNetworkTimeout, this._networkTimeoutSeconds * 1000);\n });\n\n return {\n promise: timeoutPromise,\n id: timeoutId\n };\n }\n\n /**\n * @param {number} timeoutId\n * @param {FetchEvent|null} event\n * @param {Request} request\n * @param {Array} logs A reference to the logs Array.\n * @return {Promise<Response>}\n *\n * @private\n */\n _getNetworkPromise(timeoutId, event, request, logs) {\n var _this4 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n let error;\n let response;\n try {\n response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this4._fetchOptions, _this4._plugins);\n } catch (err) {\n error = err;\n }\n\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n\n {\n if (response) {\n logs.push(`Got response from network.`);\n } else {\n logs.push(`Unable to get a response from the network. Will respond ` + `with a cached response.`);\n }\n }\n\n if (error || !response) {\n response = yield _this4._respondFromCache(request);\n {\n if (response) {\n logs.push(`Found a cached response in the '${_this4._cacheName}'` + ` cache.`);\n } else {\n logs.push(`No response found in the '${_this4._cacheName}' cache.`);\n }\n }\n } else {\n // Keep the service worker alive while we put the request in the cache\n const responseClone = response.clone();\n const cachePut = cacheWrapper_mjs.cacheWrapper.put(_this4._cacheName, request, responseClone, _this4._plugins);\n\n if (event) {\n try {\n // The event has been responded to so we can keep the SW alive to\n // respond to the request\n event.waitUntil(cachePut);\n } catch (err) {\n {\n logger_mjs.logger.warn(`Unable to ensure service worker stays alive when ` + `updating cache for '${getFriendlyURL_mjs.getFriendlyURL(event.request.url)}'.`);\n }\n }\n }\n }\n\n return response;\n })();\n }\n\n /**\n * Used if the network timeouts or fails to make the request.\n *\n * @param {Request} request The fetchEvent request to match in the cache\n * @return {Promise<Object>}\n *\n * @private\n */\n _respondFromCache(request) {\n return cacheWrapper_mjs.cacheWrapper.match(this._cacheName, request, null, this._plugins);\n }\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * An implementation of a\n * [network-only]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#network-only}\n * request strategy.\n *\n * 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}.\n *\n * @memberof workbox.strategies\n */\n class NetworkOnly {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link workbox.core.cacheNames}.\n * @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames_mjs.cacheNames.getRuntimeName(options.cacheName);\n this._plugins = options.plugins || [];\n this._fetchOptions = options.fetchOptions || null;\n }\n\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link workbox.routing.Router}.\n *\n * @param {Object} input\n * @param {FetchEvent} input.event The fetch event to run this strategy\n * against.\n * @return {Promise<Response>}\n */\n handle({ event }) {\n var _this = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n {\n assert_mjs.assert.isInstance(event, FetchEvent, {\n moduleName: 'workbox-strategies',\n className: 'NetworkOnly',\n funcName: 'handle',\n paramName: 'event'\n });\n }\n\n return _this.makeRequest({\n event,\n request: event.request\n });\n })();\n }\n\n /**\n * This method can be used to perform a make a standalone request outside the\n * context of the [Workbox Router]{@link workbox.routing.Router}.\n *\n * See \"[Advanced Recipes](https://developers.google.com/web/tools/workbox/guides/advanced-recipes#make-requests)\"\n * for more usage information.\n *\n * @param {Object} input\n * @param {Request|string} input.request Either a\n * [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request}\n * object, or a string URL, corresponding to the request to be made.\n * @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be\n * called automatically to extend the service worker's lifetime.\n * @return {Promise<Response>}\n */\n makeRequest({ event, request }) {\n var _this2 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n if (typeof request === 'string') {\n request = new Request(request);\n }\n\n {\n assert_mjs.assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'NetworkOnly',\n funcName: 'handle',\n paramName: 'request'\n });\n }\n\n let error;\n let response;\n try {\n response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this2._fetchOptions, _this2._plugins);\n } catch (err) {\n error = err;\n }\n\n {\n logger_mjs.logger.groupCollapsed(messages.strategyStart('NetworkOnly', request));\n if (response) {\n logger_mjs.logger.log(`Got response from network.`);\n } else {\n logger_mjs.logger.log(`Unable to get a response from the network.`);\n }\n messages.printFinalResponse(response);\n logger_mjs.logger.groupEnd();\n }\n\n // If there was an error thrown, re-throw it to ensure the Routers\n // catch handler is triggered.\n if (error) {\n throw error;\n }\n\n return response;\n })();\n }\n }\n\n /*\n Copyright 2018 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * An implementation of a\n * [stale-while-revalidate]{@link https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#stale-while-revalidate}\n * request strategy.\n *\n * Resources are requested from both the cache and the network in parallel.\n * The strategy will respond with the cached version if available, otherwise\n * wait for the network response. The cache is updated with the network response\n * with each successful request.\n *\n * By default, this strategy will cache responses with a 200 status code as\n * well as [opaque responses]{@link https://developers.google.com/web/tools/workbox/guides/handle-third-party-requests}.\n * Opaque responses are are cross-origin requests where the response doesn't\n * support [CORS]{@link https://enable-cors.org/}.\n *\n * @memberof workbox.strategies\n */\n class StaleWhileRevalidate {\n /**\n * @param {Object} options\n * @param {string} options.cacheName Cache name to store and retrieve\n * requests. Defaults to cache names provided by\n * [workbox-core]{@link workbox.core.cacheNames}.\n * @param {Array<Object>} options.plugins [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} options.fetchOptions Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of all fetch() requests made by this strategy.\n */\n constructor(options = {}) {\n this._cacheName = cacheNames_mjs.cacheNames.getRuntimeName(options.cacheName);\n this._plugins = options.plugins || [];\n\n if (options.plugins) {\n let isUsingCacheWillUpdate = options.plugins.some(plugin => !!plugin.cacheWillUpdate);\n this._plugins = isUsingCacheWillUpdate ? options.plugins : [cacheOkAndOpaquePlugin, ...options.plugins];\n } else {\n // No plugins passed in, use the default plugin.\n this._plugins = [cacheOkAndOpaquePlugin];\n }\n\n this._fetchOptions = options.fetchOptions || null;\n }\n\n /**\n * This method will perform a request strategy and follows an API that\n * will work with the\n * [Workbox Router]{@link workbox.routing.Router}.\n *\n * @param {Object} input\n * @param {FetchEvent} input.event The fetch event to run this strategy\n * against.\n * @return {Promise<Response>}\n */\n handle({ event }) {\n var _this = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n {\n assert_mjs.assert.isInstance(event, FetchEvent, {\n moduleName: 'workbox-strategies',\n className: 'StaleWhileRevalidate',\n funcName: 'handle',\n paramName: 'event'\n });\n }\n\n return _this.makeRequest({\n event,\n request: event.request\n });\n })();\n }\n\n /**\n * This method can be used to perform a make a standalone request outside the\n * context of the [Workbox Router]{@link workbox.routing.Router}.\n *\n * See \"[Advanced Recipes](https://developers.google.com/web/tools/workbox/guides/advanced-recipes#make-requests)\"\n * for more usage information.\n *\n * @param {Object} input\n * @param {Request|string} input.request Either a\n * [`Request`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Request}\n * object, or a string URL, corresponding to the request to be made.\n * @param {FetchEvent} [input.event] If provided, `event.waitUntil()` will be\n * called automatically to extend the service worker's lifetime.\n * @return {Promise<Response>}\n */\n makeRequest({ event, request }) {\n var _this2 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n const logs = [];\n\n if (typeof request === 'string') {\n request = new Request(request);\n }\n\n {\n assert_mjs.assert.isInstance(request, Request, {\n moduleName: 'workbox-strategies',\n className: 'StaleWhileRevalidate',\n funcName: 'handle',\n paramName: 'request'\n });\n }\n\n const fetchAndCachePromise = _this2._getFromNetwork(request, event);\n\n let response = yield cacheWrapper_mjs.cacheWrapper.match(_this2._cacheName, request, null, _this2._plugins);\n\n if (response) {\n {\n logs.push(`Found a cached response in the '${_this2._cacheName}'` + ` cache. Will update with the network response in the background.`);\n }\n\n if (event) {\n try {\n event.waitUntil(fetchAndCachePromise);\n } catch (error) {\n {\n logger_mjs.logger.warn(`Unable to ensure service worker stays alive when ` + `updating cache for '${getFriendlyURL_mjs.getFriendlyURL(event.request.url)}'.`);\n }\n }\n }\n } else {\n {\n logs.push(`No response found in the '${_this2._cacheName}' cache. ` + `Will wait for the network response.`);\n }\n response = yield fetchAndCachePromise;\n }\n\n {\n logger_mjs.logger.groupCollapsed(messages.strategyStart('StaleWhileRevalidate', request));\n for (let log of logs) {\n logger_mjs.logger.log(log);\n }\n messages.printFinalResponse(response);\n logger_mjs.logger.groupEnd();\n }\n\n return response;\n })();\n }\n\n /**\n * @param {Request} request\n * @param {FetchEvent} [event]\n * @return {Promise<Response>}\n *\n * @private\n */\n _getFromNetwork(request, event) {\n var _this3 = this;\n\n return babelHelpers.asyncToGenerator(function* () {\n const response = yield fetchWrapper_mjs.fetchWrapper.fetch(request, _this3._fetchOptions, _this3._plugins);\n\n const cachePutPromise = cacheWrapper_mjs.cacheWrapper.put(_this3._cacheName, request, response.clone(), _this3._plugins);\n\n if (event) {\n try {\n event.waitUntil(cachePutPromise);\n } catch (error) {\n {\n logger_mjs.logger.warn(`Unable to ensure service worker stays alive when ` + `updating cache for '${getFriendlyURL_mjs.getFriendlyURL(event.request.url)}'.`);\n }\n }\n }\n\n return response;\n })();\n }\n }\n\n /*\n Copyright 2017 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n var publicAPI = /*#__PURE__*/Object.freeze({\n CacheFirst: CacheFirst,\n CacheOnly: CacheOnly,\n NetworkFirst: NetworkFirst,\n NetworkOnly: NetworkOnly,\n StaleWhileRevalidate: StaleWhileRevalidate\n });\n\n /*\n Copyright 2016 Google Inc. All Rights Reserved.\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n /**\n * @function workbox.strategies.cacheFirst\n * @param {workbox.strategies.StrategyOptions} options\n */\n\n /**\n * @function workbox.strategies.cacheOnly\n * @param {workbox.strategies.StrategyOptions} options\n */\n\n /**\n * @function workbox.strategies.networkFirst\n * @param {workbox.strategies.StrategyOptions} options\n */\n\n /**\n * @function workbox.strategies.networkOnly\n * @param {workbox.strategies.StrategyOptions} options\n */\n\n /**\n * @function workbox.strategies.staleWhileRevalidate\n * @param {workbox.strategies.StrategyOptions} options\n */\n\n const mapping = {\n cacheFirst: CacheFirst,\n cacheOnly: CacheOnly,\n networkFirst: NetworkFirst,\n networkOnly: NetworkOnly,\n staleWhileRevalidate: StaleWhileRevalidate\n };\n\n const defaultExport = {};\n Object.keys(mapping).forEach(keyName => {\n defaultExport[keyName] = (options = {}) => {\n const StrategyClass = mapping[keyName];\n return new StrategyClass(Object.assign(options));\n };\n });\n\n /*\n Copyright 2017 Google Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n https://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n const finalExport = Object.assign(defaultExport, publicAPI);\n\n return finalExport;\n\n}(workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private,workbox.core._private));\n"],"file":"workbox-strategies.dev.js"}
@@ -1,3 +0,0 @@
1
- this.workbox=this.workbox||{},this.workbox.strategies=function(e,t,r){"use strict";try{self.workbox.v["workbox:strategies:3.3.1"]=1}catch(e){}class n{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var n=this;return babelHelpers.asyncToGenerator(function*(){"string"==typeof r&&(r=new Request(r));let s,i=yield t.cacheWrapper.match(n.e,r,null,n.t);if(!i)try{i=yield n.n(r,e)}catch(e){s=e}if(s)throw s;return i})()}n(e,n){var s=this;return babelHelpers.asyncToGenerator(function*(){const i=yield r.fetchWrapper.fetch(e,s.r,s.t),l=i.clone(),u=t.cacheWrapper.put(s.e,e,l,s.t);if(n)try{n.waitUntil(u)}catch(e){}return i})()}}class s{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[]}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var n=this;return babelHelpers.asyncToGenerator(function*(){return"string"==typeof r&&(r=new Request(r)),yield t.cacheWrapper.match(n.e,r,null,n.t)})()}}var i={cacheWillUpdate:({response:e})=>e.ok||0===e.status?e:null};class l{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.s=t.networkTimeoutSeconds,this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var r=this;return babelHelpers.asyncToGenerator(function*(){const n=[];"string"==typeof t&&(t=new Request(t));const s=[];let i;if(r.s){const{id:e,promise:l}=r.i(t,n);i=e,s.push(l)}const l=r.l(i,e,t,n);s.push(l);let u=yield Promise.race(s);return u||(u=yield l),u})()}i(e,t){var r=this;let n;var s;return{promise:new Promise(t=>{const i=(s=babelHelpers.asyncToGenerator(function*(){t(yield r.u(e))}),function(){return s.apply(this,arguments)});n=setTimeout(i,1e3*this.s)}),id:n}}l(e,n,s,i){var l=this;return babelHelpers.asyncToGenerator(function*(){let i,u;try{u=yield r.fetchWrapper.fetch(s,l.r,l.t)}catch(e){i=e}if(e&&clearTimeout(e),i||!u)u=yield l.u(s);else{const e=u.clone(),r=t.cacheWrapper.put(l.e,s,e,l.t);if(n)try{n.waitUntil(r)}catch(e){}}return u})()}u(e){return t.cacheWrapper.match(this.e,e,null,this.t)}}class u{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var n=this;return babelHelpers.asyncToGenerator(function*(){let e,s;"string"==typeof t&&(t=new Request(t));try{s=yield r.fetchWrapper.fetch(t,n.r,n.t)}catch(t){e=t}if(e)throw e;return s})()}}class c{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var n=this;return babelHelpers.asyncToGenerator(function*(){"string"==typeof r&&(r=new Request(r));const s=n.n(r,e);let i=yield t.cacheWrapper.match(n.e,r,null,n.t);if(i){if(e)try{e.waitUntil(s)}catch(e){}}else i=yield s;return i})()}n(e,n){var s=this;return babelHelpers.asyncToGenerator(function*(){const i=yield r.fetchWrapper.fetch(e,s.r,s.t),l=t.cacheWrapper.put(s.e,e,i.clone(),s.t);if(n)try{n.waitUntil(l)}catch(e){}return i})()}}var o=Object.freeze({CacheFirst:n,CacheOnly:s,NetworkFirst:l,NetworkOnly:u,StaleWhileRevalidate:c});const a={cacheFirst:n,cacheOnly:s,networkFirst:l,networkOnly:u,staleWhileRevalidate:c},h={};return Object.keys(a).forEach(e=>{h[e]=((t={})=>{return new(0,a[e])(Object.assign(t))})}),Object.assign(h,o)}(workbox.core._private,workbox.core._private,workbox.core._private);
2
-
3
- //# sourceMappingURL=workbox-strategies.prod.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"mappings":"","sources":["packages/workbox-strategies/browser.mjs"],"sourcesContent":["this.workbox=this.workbox||{},this.workbox.strategies=function(e,t,r){\"use strict\";try{self.workbox.v[\"workbox:strategies:3.3.1\"]=1}catch(e){}class n{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var n=this;return babelHelpers.asyncToGenerator(function*(){\"string\"==typeof r&&(r=new Request(r));let s,i=yield t.cacheWrapper.match(n.e,r,null,n.t);if(!i)try{i=yield n.n(r,e)}catch(e){s=e}if(s)throw s;return i})()}n(e,n){var s=this;return babelHelpers.asyncToGenerator(function*(){const i=yield r.fetchWrapper.fetch(e,s.r,s.t),l=i.clone(),u=t.cacheWrapper.put(s.e,e,l,s.t);if(n)try{n.waitUntil(u)}catch(e){}return i})()}}class s{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[]}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var n=this;return babelHelpers.asyncToGenerator(function*(){return\"string\"==typeof r&&(r=new Request(r)),yield t.cacheWrapper.match(n.e,r,null,n.t)})()}}var i={cacheWillUpdate:({response:e})=>e.ok||0===e.status?e:null};class l{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.s=t.networkTimeoutSeconds,this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var r=this;return babelHelpers.asyncToGenerator(function*(){const n=[];\"string\"==typeof t&&(t=new Request(t));const s=[];let i;if(r.s){const{id:e,promise:l}=r.i(t,n);i=e,s.push(l)}const l=r.l(i,e,t,n);s.push(l);let u=yield Promise.race(s);return u||(u=yield l),u})()}i(e,t){var r=this;let n;var s;return{promise:new Promise(t=>{const i=(s=babelHelpers.asyncToGenerator(function*(){t(yield r.u(e))}),function(){return s.apply(this,arguments)});n=setTimeout(i,1e3*this.s)}),id:n}}l(e,n,s,i){var l=this;return babelHelpers.asyncToGenerator(function*(){let i,u;try{u=yield r.fetchWrapper.fetch(s,l.r,l.t)}catch(e){i=e}if(e&&clearTimeout(e),i||!u)u=yield l.u(s);else{const e=u.clone(),r=t.cacheWrapper.put(l.e,s,e,l.t);if(n)try{n.waitUntil(r)}catch(e){}}return u})()}u(e){return t.cacheWrapper.match(this.e,e,null,this.t)}}class u{constructor(t={}){this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:t}){var n=this;return babelHelpers.asyncToGenerator(function*(){let e,s;\"string\"==typeof t&&(t=new Request(t));try{s=yield r.fetchWrapper.fetch(t,n.r,n.t)}catch(t){e=t}if(e)throw e;return s})()}}class c{constructor(t={}){if(this.e=e.cacheNames.getRuntimeName(t.cacheName),this.t=t.plugins||[],t.plugins){let e=t.plugins.some(e=>!!e.cacheWillUpdate);this.t=e?t.plugins:[i,...t.plugins]}else this.t=[i];this.r=t.fetchOptions||null}handle({event:e}){var t=this;return babelHelpers.asyncToGenerator(function*(){return t.makeRequest({event:e,request:e.request})})()}makeRequest({event:e,request:r}){var n=this;return babelHelpers.asyncToGenerator(function*(){\"string\"==typeof r&&(r=new Request(r));const s=n.n(r,e);let i=yield t.cacheWrapper.match(n.e,r,null,n.t);if(i){if(e)try{e.waitUntil(s)}catch(e){}}else i=yield s;return i})()}n(e,n){var s=this;return babelHelpers.asyncToGenerator(function*(){const i=yield r.fetchWrapper.fetch(e,s.r,s.t),l=t.cacheWrapper.put(s.e,e,i.clone(),s.t);if(n)try{n.waitUntil(l)}catch(e){}return i})()}}var o=Object.freeze({CacheFirst:n,CacheOnly:s,NetworkFirst:l,NetworkOnly:u,StaleWhileRevalidate:c});const a={cacheFirst:n,cacheOnly:s,networkFirst:l,networkOnly:u,staleWhileRevalidate:c},h={};return Object.keys(a).forEach(e=>{h[e]=((t={})=>{return new(0,a[e])(Object.assign(t))})}),Object.assign(h,o)}(workbox.core._private,workbox.core._private,workbox.core._private);\n"],"file":"workbox-strategies.prod.js"}
@@ -1,3 +0,0 @@
1
- var workbox=function(){"use strict";try{self.workbox.v["workbox:sw:3.3.1"]=1}catch(t){}const t="https://storage.googleapis.com/workbox-cdn/releases/3.3.1",e={backgroundSync:"background-sync",broadcastUpdate:"broadcast-cache-update",cacheableResponse:"cacheable-response",core:"core",expiration:"cache-expiration",googleAnalytics:"google-analytics",precaching:"precaching",rangeRequests:"range-requests",routing:"routing",strategies:"strategies",streams:"streams"};return new class{constructor(){return this.v={},this.t={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?"dev":"prod",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.t,t),this.e=this.t.debug?"dev":"prod"}skipWaiting(){self.addEventListener("install",()=>self.skipWaiting())}clientsClaim(){self.addEventListener("activate",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&""===(s=r.split("/"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join("/")}}}();
2
-
3
- //# sourceMappingURL=workbox-sw.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"mappings":"","sources":["packages/workbox-sw/browser.mjs"],"sourcesContent":["var workbox=function(){\"use strict\";try{self.workbox.v[\"workbox:sw:3.3.1\"]=1}catch(t){}const t=\"https://storage.googleapis.com/workbox-cdn/releases/3.3.1\",e={backgroundSync:\"background-sync\",broadcastUpdate:\"broadcast-cache-update\",cacheableResponse:\"cacheable-response\",core:\"core\",expiration:\"cache-expiration\",googleAnalytics:\"google-analytics\",precaching:\"precaching\",rangeRequests:\"range-requests\",routing:\"routing\",strategies:\"strategies\",streams:\"streams\"};return new class{constructor(){return this.v={},this.t={debug:\"localhost\"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?\"dev\":\"prod\",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error(\"Config must be set before accessing workbox.* modules\");Object.assign(this.t,t),this.e=this.t.debug?\"dev\":\"prod\"}skipWaiting(){self.addEventListener(\"install\",()=>self.skipWaiting())}clientsClaim(){self.addEventListener(\"activate\",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&\"\"===(s=r.split(\"/\"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join(\"/\")}}}();\n"],"file":"workbox-sw.js"}