{"version":3,"sources":["jsdelivr-header.js","/npm/@npmcli/agent@4.0.0/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,MAAM,SAAE,UAAa,QAAQ,cACvB,iBAAE,iBAAgB,aAAE,cAAiB,QAAQ,cAC7C,SAAE,SAAQ,WAAE,YAAe,QAAQ,cACnC,IAAM,QAAQ,YACd,MAAQ,QAAQ,eAEhB,WAAa,IAAI,SAAS,CAAE,IAAK,KAEjC,SAAW,CAAC,GAAO,QAAO,QAAO,aAAY,GAAY,CAAC,KAE9D,GAAa,MAAT,EACF,OAAO,EAGT,EAAM,IAAI,IAAI,GAEd,MAAM,EAAc,SAAS,EAAK,CAAE,QAAO,YACrC,EAAoB,IACrB,iBAAiB,GACpB,MAAO,GAGH,EAAW,aAAa,IACzB,EACH,eAAiC,WAAjB,EAAI,WAGtB,GAAI,WAAW,IAAI,GACjB,OAAO,WAAW,IAAI,GAGxB,MAAM,EAAW,IAAI,MAAM,GAG3B,OAFA,WAAW,IAAI,EAAU,GAElB,GAGT,OAAO,QAAU,CACf,kBACA,YAEA,UAAW,MACX,WAAY,MACZ,MAAO,CACL,MAAO,WACP,MAAO,WACP,IAAK,IAAI,MACT,MAAO,KACL,WAAW,QACX,WAAW,QACX,IAAI,MAAM,OAAM","file":"/npm/@npmcli/agent@4.0.0/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@npmcli/agent@4.0.0/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\nconst { LRUCache } = require('lru-cache')\nconst { normalizeOptions, cacheOptions } = require('./options')\nconst { getProxy, proxyCache } = require('./proxy.js')\nconst dns = require('./dns.js')\nconst Agent = require('./agents.js')\n\nconst agentCache = new LRUCache({ max: 20 })\n\nconst getAgent = (url, { agent, proxy, noProxy, ...options } = {}) => {\n  // false has meaning so this can't be a simple truthiness check\n  if (agent != null) {\n    return agent\n  }\n\n  url = new URL(url)\n\n  const proxyForUrl = getProxy(url, { proxy, noProxy })\n  const normalizedOptions = {\n    ...normalizeOptions(options),\n    proxy: proxyForUrl,\n  }\n\n  const cacheKey = cacheOptions({\n    ...normalizedOptions,\n    secureEndpoint: url.protocol === 'https:',\n  })\n\n  if (agentCache.has(cacheKey)) {\n    return agentCache.get(cacheKey)\n  }\n\n  const newAgent = new Agent(normalizedOptions)\n  agentCache.set(cacheKey, newAgent)\n\n  return newAgent\n}\n\nmodule.exports = {\n  getAgent,\n  Agent,\n  // these are exported for backwards compatability\n  HttpAgent: Agent,\n  HttpsAgent: Agent,\n  cache: {\n    proxy: proxyCache,\n    agent: agentCache,\n    dns: dns.cache,\n    clear: () => {\n      proxyCache.clear()\n      agentCache.clear()\n      dns.cache.clear()\n    },\n  },\n}\n"]}