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AW,iCAC1E,CAEA,SAAS,gBAAiB,EAAQ,GAChC,IAAI,EAAiB,oBACjB,EAAS,QAAQ,MAAM,IAAe,KAG1C,OAAO,KAAK,GAAO,SAAQ,SAAU,GACnC,IAAI,EAAW,QAAQ,EAAgB,GACvC,GAAmB,MAAf,EAAM,UACD,QAAQ,MAAM,OAChB,CACL,IAAI,EAAM,QAAQ,MAAM,GACpB,EAAM,IAAI,OAAO,EAAU,MAC/B,EAAI,SAAW,EACf,EAAI,QAAU,EAAM,GACpB,EAAI,QAAS,EACb,EAAI,OAAS,EAAM,EAAI,OAAS,EAChC,QAAQ,MAAM,GAAY,CAC5B,CACF,IAEA,IAAI,EAAa,QAAQ,EAAgB,GAKzC,cAFO,QAAQ,MAAM,GAEd,QAAQ,MAAM,GAAgB,QAAQ,EAC/C","file":"/npm/require-inject@1.4.4/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/require-inject@1.4.4/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'\nvar Module = require('module')\nvar path = require('path')\nvar caller = require('caller')\n\ntry {\n  require('readable-stream')\n} catch (_) {\n  // ignore error, just doing the require to work around weirdness in readable-stream\n}\n\nexports = module.exports = function (toLoad, mocks) {\n  return requireInject(toLoad, mocks)\n}\n\nexports.withEmptyCache = function (toLoad, mocks) {\n  return requireInject(toLoad, mocks, true)\n}\n\nexports.installGlobally = installGlobally\n\nexports.installGlobally.andClearCache = function (toLoad, mocks) {\n  var callerFilename = getCallerFilename()\n  Object.keys(require.cache).forEach(function (name) {\n    if (name !== callerFilename) delete require.cache[name]\n  })\n  return installGlobally(toLoad, mocks)\n}\n\nvar requireInject = function (toLoad, mocks, withEmptyCache) {\n  mocks = mocks || {}\n\n  // Copy the existing cache\n  var originalCache = {}\n  Object.keys(require.cache).forEach(function (name) {\n    originalCache[name] = require.cache[name]\n  })\n\n  var mocked = withEmptyCache\n    ? installGlobally.andClearCache(toLoad, mocks)\n    : installGlobally(toLoad, mocks)\n\n  // restore the cache, we can't just assign originalCache to require.cache as the require\n  // object is unique to each module, even though require.cache is shared\n  Object.keys(require.cache).forEach(function (name) { delete require.cache[name] })\n  Object.keys(originalCache).forEach(function (name) { require.cache[name] = originalCache[name] })\n\n  return mocked\n}\n\nfunction resolve (callerFilename, name) {\n  if (/^[.][.]?\\//.test(name)) {\n    name = path.resolve(path.dirname(callerFilename), name)\n  }\n  return require.resolve(name)\n}\n\nfunction getCallerFilename () {\n  var callerFilename\n  for (var ii = 1; ii <= 10; ++ii) {\n    callerFilename = caller(ii)\n    if (callerFilename !== module.filename) return callerFilename\n  }\n  throw new Error(\"Couldn't find caller that wasn't \" + module.filename + ' in most recent 10 stackframes')\n}\n\nfunction installGlobally (toLoad, mocks) {\n  var callerFilename = getCallerFilename()\n  var parent = require.cache[toLoadPath] || null\n\n  // Inject all of our mocks\n  Object.keys(mocks).forEach(function (name) {\n    var namePath = resolve(callerFilename, name)\n    if (mocks[name] == null) {\n      delete require.cache[namePath]\n    } else {\n      var old = require.cache[namePath]\n      var mod = new Module(namePath, null)\n      mod.filename = namePath\n      mod.exports = mocks[name]\n      mod.loaded = true\n      mod.parent = old ? old.parent : parent\n      require.cache[namePath] = mod\n    }\n  })\n\n  var toLoadPath = resolve(callerFilename, toLoad)\n\n  // remove any unmocked version previously loaded\n  delete require.cache[toLoadPath]\n  // load our new version using our mocks\n  return require.cache[callerFilename].require(toLoadPath)\n}\n"]}