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AA0B,QACzD,OAAO,QAAU,QAAiB","file":"/npm/@yesmeck/offline-plugin@5.0.5/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@yesmeck/offline-plugin@5.0.5/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', {\n  value: true\n});\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar _appCache = require('./app-cache');\n\nvar _appCache2 = _interopRequireDefault(_appCache);\n\nvar _serviceWorker = require('./service-worker');\n\nvar _serviceWorker2 = _interopRequireDefault(_serviceWorker);\n\nvar _defaultOptions = require('./default-options');\n\nvar _defaultOptions2 = _interopRequireDefault(_defaultOptions);\n\nvar _miscUtils = require('./misc/utils');\n\nvar _path2 = require('path');\n\nvar _path3 = _interopRequireDefault(_path2);\n\nvar _url = require('url');\n\nvar _url2 = _interopRequireDefault(_url);\n\nvar _deepExtend = require('deep-extend');\n\nvar _deepExtend2 = _interopRequireDefault(_deepExtend);\n\nvar _minimatch = require('minimatch');\n\nvar _minimatch2 = _interopRequireDefault(_minimatch);\n\nvar _loaderUtils = require('loader-utils');\n\nvar _loaderUtils2 = _interopRequireDefault(_loaderUtils);\n\nvar _slash = require('slash');\n\nvar _slash2 = _interopRequireDefault(_slash);\n\nvar _require = require('../package.json');\n\nvar pluginVersion = _require.version;\n\nvar hasOwn = ({}).hasOwnProperty;\nvar updateStrategies = ['all', 'hash', 'changed'];\n\nvar OfflinePlugin = (function () {\n  function OfflinePlugin(options) {\n    var _this = this;\n\n    _classCallCheck(this, OfflinePlugin);\n\n    var AppCacheOptions = options ? options.AppCache : void 0;\n\n    this.options = (0, _deepExtend2['default'])({}, _defaultOptions2['default'], options, {\n      AppCache: false\n    });\n\n    this.hash = null;\n    this.assets = null;\n    this.hashesMap = null;\n    this.externals = null;\n    this.publicPath = this.options.publicPath;\n    this.strategy = this.options.updateStrategy;\n    this.responseStrategy = this.options.responseStrategy;\n    this.relativePaths = this.options.relativePaths;\n    this.pluginVersion = pluginVersion;\n    this.warnings = [];\n    this.errors = [];\n\n    this.__tests = this.options.__tests;\n    this.flags = {};\n\n    var appCacheEnabled = !!(AppCacheOptions || this.__tests.appCacheEnabled);\n\n    if (appCacheEnabled) {\n      this.options.AppCache = (0, _deepExtend2['default'])({}, _defaultOptions.AppCacheOptions, AppCacheOptions);\n    }\n\n    if (this.__tests.pluginVersion) {\n      this.pluginVersion = this.__tests.pluginVersion;\n    }\n\n    var autoUpdate = this.options.autoUpdate;\n\n    if (autoUpdate === true) {\n      this.autoUpdate = _defaultOptions.DEFAULT_AUTO_UPDATE_INTERVAL;\n    } else if (typeof autoUpdate === 'number' && autoUpdate) {\n      this.autoUpdate = autoUpdate;\n    }\n\n    if (this.options.responseStrategy !== \"cache-first\" && this.options.responseStrategy !== \"network-first\") {\n      throw new Error('OfflinePlugin: `responseStrategy` option must use ' + '`cache-first` or `network-first` (or be undefined).');\n    }\n\n    if (typeof this.publicPath !== 'string') {\n      this.publicPath = null;\n    }\n\n    if (updateStrategies.indexOf(this.strategy) === -1) {\n      throw new Error('Update strategy must be one of [' + updateStrategies + ']');\n    } else if (this.strategy === 'hash') {\n      this.warnings.push(new Error('OfflinePlugin: `hash` update strategy is deprecated, use `all` strategy and { version: \"[hash]\" } instead'));\n\n      this.strategy = 'all';\n      this.options.version = '[hash]';\n    }\n\n    if (!Array.isArray(this.options.externals)) {\n      this.options.externals = [];\n    }\n\n    var rewrites = this.options.rewrites || _defaultOptions2['default'].rewrites;\n\n    if (typeof rewrites === 'function') {\n      this.rewrite = function (asset) {\n        if (asset.indexOf(_this.entryPrefix) === 0) {\n          return '';\n        }\n\n        return rewrites(asset);\n      };\n    } else {\n      this.rewrite = function (asset) {\n        if (asset.indexOf(_this.entryPrefix) === 0) {\n          return '';\n        }\n\n        if (!hasOwn.call(rewrites, asset)) {\n          return asset;\n        }\n\n        return rewrites[asset];\n      };\n    }\n\n    if (this.options.appShell && typeof this.options.appShell === 'string') {\n      this.appShell = this.options.appShell;\n    }\n\n    var cacheMaps = this.options.cacheMaps;\n\n    if (this.appShell) {\n      // Make appShell the latest in the chain so it could be overridden\n      cacheMaps = (cacheMaps || []).concat({\n        match: 'function(url) {\\n          if (url.pathname === location.pathname) {\\n            return;\\n          }\\n\\n          return new URL(' + JSON.stringify(this.appShell) + ', location);\\n        }',\n        requestTypes: ['navigate']\n      });\n    }\n\n    this.cacheMaps = this.stringifyCacheMaps(cacheMaps);\n\n    this.REST_KEY = ':rest:';\n    this.EXTERNALS_KEY = ':externals:';\n    this.entryPrefix = '__offline_';\n    this.tools = {};\n\n    this.addTool(_serviceWorker2['default'], 'ServiceWorker');\n    this.addTool(_appCache2['default'], 'AppCache');\n\n    if (!Object.keys(this.tools).length) {\n      throw new Error('You should have at least one cache service to be specified');\n    }\n  }\n\n  _createClass(OfflinePlugin, [{\n    key: 'apply',\n    value: function apply(compiler) {\n      var _this2 = this;\n\n      var runtimePath = _path3['default'].resolve(__dirname, '../runtime.js');\n      var compilerOptions = compiler.options;\n\n      if (this.relativePaths === true) {\n        this.publicPath = null;\n      }\n\n      if (typeof this.publicPath !== 'string' && compilerOptions && compilerOptions.output && compilerOptions.output.publicPath && this.relativePaths !== true) {\n        this.publicPath = compilerOptions.output.publicPath;\n        this.relativePaths = false;\n      }\n\n      if (this.publicPath) {\n        this.publicPath = this.publicPath.replace(/\\/$/, '') + '/';\n      }\n\n      if (this.relativePaths === true && this.publicPath) {\n        this.errors.push(new Error('OfflinePlugin: `publicPath` is used in conjunction with `relativePaths`,\\n' + 'choose one of it'));\n\n        this.relativePaths = false;\n      }\n\n      if (this.relativePaths === _defaultOptions2['default'].relativePaths) {\n        this.relativePaths = !this.publicPath;\n      }\n\n      this.useTools(function (tool, key) {\n        _this2.resolveToolPaths(tool, key, compiler);\n      });\n\n      var afterResolveFn = function afterResolveFn(result, callback) {\n        var resource = _path3['default'].resolve(compiler.context, result.resource);\n\n        if (resource !== runtimePath) {\n          callback(null, result);\n          return;\n        }\n\n        var data = {\n          autoUpdate: _this2.autoUpdate\n        };\n\n        _this2.useTools(function (tool, key) {\n          data[key] = tool.getConfig(_this2);\n        });\n\n        result.loaders.push({\n          loader: _path3['default'].join(__dirname, 'misc/runtime-loader.js'),\n          options: JSON.stringify(data)\n        });\n\n        callback(null, result);\n      };\n\n      var makeFn = function makeFn(compilation, callback) {\n        if (_this2.warnings.length) {\n          [].push.apply(compilation.warnings, _this2.warnings);\n        }\n\n        if (_this2.errors.length) {\n          [].push.apply(compilation.errors, _this2.errors);\n        }\n\n        _this2.useTools(function (tool) {\n          return tool.addEntry(_this2, compilation, compiler);\n        }).then(function () {\n          callback();\n        })['catch'](function (e) {\n          throw e || new Error('Something went wrong');\n        });\n      };\n\n      var emitFn = function emitFn(compilation, callback) {\n        var runtimeTemplatePath = _path3['default'].resolve(__dirname, '../tpls/runtime-template.js');\n        var hasRuntime = true;\n\n        if (compilation.fileDependencies.indexOf) {\n          hasRuntime = compilation.fileDependencies.indexOf(runtimeTemplatePath) !== -1;\n        } else if (compilation.fileDependencies.has) {\n          hasRuntime = compilation.fileDependencies.has(runtimeTemplatePath);\n        }\n\n        if (!hasRuntime && !_this2.__tests.ignoreRuntime) {\n          compilation.errors.push(new Error('OfflinePlugin: Plugin\\'s runtime wasn\\'t added to one of your bundle entries. See this https://goo.gl/YwewYp for details.'));\n          callback();\n          return;\n        }\n\n        var stats = compilation.getStats().toJson();\n\n        // By some reason errors raised here are not fatal,\n        // so we need manually try..catch and exit with error\n        try {\n          _this2.setAssets(compilation);\n          _this2.setHashesMap(compilation);\n\n          // Generate bundle hash manually (from what we have)\n          _this2.hash = _loaderUtils2['default'].getHashDigest(Object.keys(_this2.hashesMap).join(''), 'sha1');\n\n          // Not used yet\n          // this.setNetworkOptions();\n        } catch (e) {\n          callback(e);\n          return;\n        }\n\n        _this2.useTools(function (tool) {\n          return tool.apply(_this2, compilation, compiler);\n        }).then(function () {\n          callback();\n        }, function () {\n          callback(new Error('Something went wrong'));\n        });\n      };\n\n      if (compiler.hooks) {\n        (function () {\n          var plugin = { name: 'OfflinePlugin' };\n\n          compiler.hooks.normalModuleFactory.tap(plugin, function (nmf) {\n            nmf.hooks.afterResolve.tapAsync(plugin, afterResolveFn);\n          });\n\n          compiler.hooks.make.tapAsync(plugin, makeFn);\n          compiler.hooks.emit.tapAsync(plugin, emitFn);\n        })();\n      } else {\n        compiler.plugin('normal-module-factory', function (nmf) {\n          nmf.plugin('after-resolve', afterResolveFn);\n        });\n\n        compiler.plugin('make', makeFn);\n        compiler.plugin('emit', emitFn);\n      }\n    }\n  }, {\n    key: 'setAssets',\n    value: function setAssets(compilation) {\n      var _this3 = this;\n\n      var caches = this.options.caches || _defaultOptions2['default'].caches;\n\n      if (this.options.safeToUseOptionalCaches !== true && (caches.additional && caches.additional.length || caches.optional && caches.optional.length)) {\n        compilation.warnings.push(new Error('OfflinePlugin: Cache sections `additional` and `optional` could be used ' + 'only when each asset passed to it has unique name (e.g. hash or version in it) and ' + 'is permanently available for given URL. If you think that it\\'s your case, ' + 'set `safeToUseOptionalCaches` option to `true`, to remove this warning.'));\n      }\n\n      var excludes = this.options.excludes;\n      var assets = Object.keys(compilation.assets);\n      var externals = this.options.externals;\n\n      if (Array.isArray(excludes) && excludes.length) {\n        assets = assets.filter(function (asset) {\n          if (excludes.some(function (glob) {\n            if ((0, _minimatch2['default'])(asset, glob)) {\n              return true;\n            }\n          })) {\n            return false;\n          }\n\n          return true;\n        });\n      }\n\n      this.externals = this.validatePaths(externals);\n\n      if (caches === 'all') {\n        this.assets = this.validatePaths(assets).concat(this.externals);\n        this.caches = {\n          main: this.assets.concat()\n        };\n      } else {\n        (function () {\n          var restSection = undefined;\n          var externalsSection = undefined;\n\n          var handledCaches = ['main', 'additional', 'optional'].reduce(function (result, key) {\n            var cache = Array.isArray(caches[key]) ? caches[key] : [];\n\n            if (!cache.length) {\n              result[key] = cache;\n              return result;\n            }\n\n            var cacheResult = [];\n\n            cache.some(function (cacheKey) {\n              if (cacheKey === _this3.REST_KEY) {\n                if (restSection) {\n                  throw new Error('The ' + _this3.REST_KEY + ' keyword can be used only once');\n                }\n\n                restSection = key;\n                return;\n              }\n\n              if (cacheKey === _this3.EXTERNALS_KEY) {\n                if (externalsSection) {\n                  throw new Error('The ' + _this3.EXTERNALS_KEY + ' keyword can be used only once');\n                }\n\n                externalsSection = key;\n                return;\n              }\n\n              var magic = undefined;\n\n              if (typeof cacheKey === 'string') {\n                magic = !(0, _miscUtils.isAbsoluteURL)(cacheKey) && cacheKey[0] !== '/' && cacheKey.indexOf('./') !== 0 && (0, _miscUtils.hasMagic)(cacheKey);\n              } else if (cacheKey instanceof RegExp) {\n                magic = (0, _miscUtils.hasMagic)(cacheKey);\n              } else {\n                // Ignore non-string and non-RegExp keys\n                return;\n              }\n\n              if (magic) {\n                var matched = undefined;\n\n                for (var i = 0, len = assets.length; i < len; i++) {\n                  if (!magic.match(assets[i])) continue;\n\n                  matched = true;\n                  cacheResult.push(assets[i]);\n                  assets.splice(i, 1);\n                  i--, len--;\n                }\n\n                if (!matched) {\n                  compilation.warnings.push(new Error('OfflinePlugin: Cache pattern [' + cacheKey + '] did not match any assets'));\n                }\n\n                return;\n              }\n\n              var index = assets.indexOf(cacheKey);\n\n              __EXTERNALS_CHECK: if (index === -1) {\n                var externalsIndex = externals.indexOf(cacheKey);\n\n                if (externalsIndex !== -1) {\n                  externals.splice(externalsIndex, 1);\n                  break __EXTERNALS_CHECK;\n                }\n\n                compilation.warnings.push(new Error('OfflinePlugin: Cache asset [' + cacheKey + '] is not found in the output assets, ' + 'if the asset is not processed by webpack, move it to the |externals| option to remove this warning.'));\n              } else {\n                assets.splice(index, 1);\n              }\n\n              cacheResult.push(cacheKey);\n            });\n\n            result[key] = _this3.validatePaths(cacheResult);\n\n            return result;\n          }, {});\n\n          if (restSection && assets.length) {\n            handledCaches[restSection] = handledCaches[restSection].concat(_this3.validatePaths(assets));\n          }\n\n          if (externalsSection && externals.length) {\n            handledCaches[externalsSection] = handledCaches[externalsSection].concat(_this3.validatePaths(externals));\n          }\n\n          _this3.caches = handledCaches;\n          _this3.assets = [].concat(_this3.caches.main, _this3.caches.additional, _this3.caches.optional);\n        })();\n      }\n    }\n  }, {\n    key: 'setHashesMap',\n    value: function setHashesMap(compilation) {\n      var _this4 = this;\n\n      this.hashesMap = {};\n\n      Object.keys(compilation.assets).forEach(function (key) {\n        var validatedPath = _this4.validatePaths([key])[0];\n\n        if (typeof validatedPath !== 'string' || _this4.assets.indexOf(validatedPath) === -1) return;\n\n        var hash = _loaderUtils2['default'].getHashDigest(compilation.assets[key].source(), 'sha1');\n\n        _this4.hashesMap[hash] = validatedPath;\n      });\n    }\n  }, {\n    key: 'setNetworkOptions',\n    value: function setNetworkOptions() {\n      var alwaysRevalidate = this.options.alwaysRevalidate;\n      var preferOnline = this.options.preferOnline;\n      var ignoreSearch = this.options.ignoreSearch;\n\n      var assets = this.assets;\n\n      // Disable temporarily\n      if (Array.isArray(alwaysRevalidate) && alwaysRevalidate.length) {\n        alwaysRevalidate = assets.filter(function (asset) {\n          if (alwaysRevalidate.some(function (glob) {\n            if ((0, _minimatch2['default'])(asset, glob)) {\n              return true;\n            }\n          })) {\n            return true;\n          }\n\n          return false;\n        });\n\n        if (alwaysRevalidate.length) {\n          this.alwaysRevalidate = alwaysRevalidate;\n        }\n      }\n\n      if (Array.isArray(ignoreSearch) && ignoreSearch.length) {\n        ignoreSearch = assets.filter(function (asset) {\n          if (ignoreSearch.some(function (glob) {\n            if ((0, _minimatch2['default'])(asset, glob)) {\n              return true;\n            }\n          })) {\n            return true;\n          }\n\n          return false;\n        });\n\n        if (ignoreSearch.length) {\n          this.ignoreSearch = ignoreSearch;\n        }\n      }\n\n      if (Array.isArray(preferOnline) && preferOnline.length) {\n        preferOnline = assets.filter(function (asset) {\n          if (preferOnline.some(function (glob) {\n            if ((0, _minimatch2['default'])(asset, glob)) {\n              return true;\n            }\n          })) {\n            return true;\n          }\n\n          return false;\n        });\n\n        if (preferOnline.length) {\n          this.preferOnline = preferOnline;\n        }\n      }\n    }\n  }, {\n    key: 'stringifyCacheMaps',\n    value: function stringifyCacheMaps(cacheMaps) {\n      if (!cacheMaps) {\n        return [];\n      }\n\n      return cacheMaps.map(function (map) {\n        if (map.to != null && typeof map.to !== 'string' && typeof map.to !== 'function') {\n          throw new Error('cacheMaps `to` property must either string, function, undefined or null');\n        }\n\n        if (map.requestTypes != null) {\n          if (Array.isArray(map.requestTypes)) {\n            var types = map.requestTypes.filter(function (item) {\n              if (item === 'navigate' || item === 'same-origin' || item === 'cross-origin') {\n                return false;\n              }\n\n              return true;\n            });\n\n            if (types.length) {\n              throw new Error(\"cacheMaps `requestTypes` array values could be only: 'navigate', 'same-origin' or 'cross-origin'\");\n            }\n          } else {\n            throw new Error('cacheMaps `requestTypes` property must either array, undefined or null');\n          }\n        }\n\n        var to = undefined;\n        var match = undefined;\n\n        if (typeof map.to === 'function') {\n          to = (0, _miscUtils.functionToString)(map.to);\n        } else {\n          to = map.to ? JSON.stringify(map.to) : null;\n        }\n\n        if (typeof map.match === 'function') {\n          match = (0, _miscUtils.functionToString)(map.match);\n        } else {\n          match = map.match + '';\n        }\n\n        return {\n          match: match,\n          to: to,\n          requestTypes: map.requestTypes || null\n        };\n      });\n    }\n  }, {\n    key: 'resolveToolPaths',\n    value: function resolveToolPaths(tool, key, compiler) {\n      // Tool much implement:\n      //\n      // tool.output\n      // tool.publicPath\n      // tool.basePath\n      // tool.location\n      // tool.pathRewrite\n\n      if (!this.relativePaths && !this.publicPath) {\n        throw new Error('OfflinePlugin: Cannot generate base path for ' + key);\n      }\n\n      var isDirectory = tool.output[tool.output.length - 1] === '/';\n\n      if (this.relativePaths) {\n        var compilerOutput = (compiler.options.output || { path: process.cwd() }).path;\n        var absoluteOutput = _path3['default'].resolve(compilerOutput, tool.output);\n\n        var relativeBase = undefined;\n\n        if (isDirectory) {\n          relativeBase = _path3['default'].relative(absoluteOutput, compilerOutput);\n        } else {\n          relativeBase = _path3['default'].relative(_path3['default'].dirname(absoluteOutput), compilerOutput);\n        }\n\n        relativeBase = (0, _slash2['default'])(relativeBase);\n        relativeBase = relativeBase.replace(/\\/$/, '');\n\n        if (relativeBase) {\n          relativeBase = relativeBase + '/';\n        }\n\n        tool.basePath = relativeBase[0] === '.' ? relativeBase : './' + relativeBase;\n      } else if (this.publicPath) {\n        tool.basePath = this.publicPath.replace(/\\/$/, '') + '/';\n      }\n\n      if (this.relativePaths) {\n        tool.location = tool.output;\n      } else if (this.publicPath && tool.publicPath) {\n        tool.location = tool.publicPath;\n      } else if (this.publicPath) {\n        var publicUrl = _url2['default'].parse(this.publicPath);\n        var publicPath = publicUrl.pathname;\n\n        publicUrl.pathname = _path3['default'].join(publicPath, tool.output);\n        var outerPathname = _path3['default'].join('/outer/', publicPath, tool.output);\n\n        if (outerPathname.indexOf('/outer/') !== 0) {\n          new Error('OfflinePlugin: Wrong ' + key + '.output value. Final ' + key + '.location URL path bounds are outside of publicPath');\n        }\n\n        tool.location = _url2['default'].format(publicUrl);\n      }\n\n      if (this.relativePaths) {\n        tool.pathRewrite = function (_path) {\n          if ((0, _miscUtils.isAbsoluteURL)(_path) || _path[0] === '/') {\n            return _path;\n          }\n\n          return tool.basePath + _path;\n        };\n      } else {\n        tool.pathRewrite = function (path) {\n          return path;\n        };\n      }\n    }\n  }, {\n    key: 'validatePaths',\n    value: function validatePaths(assets) {\n      var _this5 = this;\n\n      return assets.map(this.rewrite).filter(function (asset) {\n        return !!asset;\n      }).map(function (key) {\n        // If absolute url, use it as is\n        if ((0, _miscUtils.isAbsoluteURL)(key)) {\n          return key;\n        }\n\n        if (_this5.relativePaths) {\n          return key.replace(/^\\.\\//, '');\n        }\n\n        // Absolute path, use it as is\n        if (key[0] === '/') {\n          return key;\n        }\n\n        return _this5.publicPath + key.replace(/^\\.?\\//, '');\n      });\n    }\n  }, {\n    key: 'useTools',\n    value: function useTools(fn) {\n      var _this6 = this;\n\n      var tools = Object.keys(this.tools).map(function (tool) {\n        return fn(_this6.tools[tool], tool);\n      });\n\n      return Promise.all(tools);\n    }\n  }, {\n    key: 'addTool',\n    value: function addTool(Tool, name) {\n      var options = this.options[name];\n\n      if (options === null || options === false) {\n        // tool is not needed\n        return;\n      }\n\n      this.tools[name] = new Tool(options);\n    }\n  }, {\n    key: 'version',\n    get: function get() {\n      var version = this.options.version;\n      var hash = this.hash;\n\n      if (version == null) {\n        return new Date().toLocaleString();\n      }\n\n      if (typeof version === 'function') {\n        return version(this);\n      }\n\n      return (0, _miscUtils.interpolateString)(version, { hash: hash });\n    }\n  }]);\n\n  return OfflinePlugin;\n})();\n\nexports['default'] = OfflinePlugin;\n\nOfflinePlugin.defaultOptions = _defaultOptions2['default'];\nmodule.exports = exports['default'];"]}