You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.0KB

  1. /**
  2. * Copyright 2018 Google Inc. All Rights Reserved.
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. * http://www.apache.org/licenses/LICENSE-2.0
  7. * Unless required by applicable law or agreed to in writing, software
  8. * distributed under the License is distributed on an "AS IS" BASIS,
  9. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. * See the License for the specific language governing permissions and
  11. * limitations under the License.
  12. */
  13. // If the loader is already loaded, just stop.
  14. if (!self.define) {
  15. const singleRequire = name => {
  16. if (name !== 'require') {
  17. name = name + '.js';
  18. }
  19. let promise = Promise.resolve();
  20. if (!registry[name]) {
  21. promise = new Promise(async resolve => {
  22. if ("document" in self) {
  23. const script = document.createElement("script");
  24. script.src = name;
  25. document.head.appendChild(script);
  26. script.onload = resolve;
  27. } else {
  28. importScripts(name);
  29. resolve();
  30. }
  31. });
  32. }
  33. return promise.then(() => {
  34. if (!registry[name]) {
  35. throw new Error(`Module ${name} didn’t register its module`);
  36. }
  37. return registry[name];
  38. });
  39. };
  40. const require = (names, resolve) => {
  41. Promise.all(names.map(singleRequire))
  42. .then(modules => resolve(modules.length === 1 ? modules[0] : modules));
  43. };
  44. const registry = {
  45. require: Promise.resolve(require)
  46. };
  47. self.define = (moduleName, depsNames, factory) => {
  48. if (registry[moduleName]) {
  49. // Module is already loading or loaded.
  50. return;
  51. }
  52. registry[moduleName] = Promise.resolve().then(() => {
  53. let exports = {};
  54. const module = {
  55. uri: location.origin + moduleName.slice(1)
  56. };
  57. return Promise.all(
  58. depsNames.map(depName => {
  59. switch(depName) {
  60. case "exports":
  61. return exports;
  62. case "module":
  63. return module;
  64. default:
  65. return singleRequire(depName);
  66. }
  67. })
  68. ).then(deps => {
  69. const facValue = factory(...deps);
  70. if(!exports.default) {
  71. exports.default = facValue;
  72. }
  73. return exports;
  74. });
  75. });
  76. };
  77. }
  78. define("./sw.js",['./workbox-32092201'], function (workbox) { 'use strict';
  79. /**
  80. * Welcome to your Workbox-powered service worker!
  81. *
  82. * You'll need to register this file in your web app.
  83. * See https://goo.gl/nhQhGp
  84. *
  85. * The rest of the code is auto-generated. Please don't update this file
  86. * directly; instead, make changes to your Workbox build configuration
  87. * and re-run your build process.
  88. * See https://goo.gl/2aRDsh
  89. */
  90. importScripts();
  91. self.skipWaiting();
  92. workbox.clientsClaim();
  93. workbox.registerRoute(/.*/i, new workbox.NetworkOnly({
  94. "cacheName": "dev",
  95. plugins: []
  96. }), 'GET');
  97. });
  98. //# sourceMappingURL=sw.js.map