const cache = /* @__PURE__ */ new Map();
function faviconUrlFor(resultUrl) {
  let host;
  try {
    host = new URL(resultUrl).hostname.toLowerCase();
  } catch {
    return void 0;
  }
  if (!host) return void 0;
  const cached = cache.get(host);
  if (cached) return cached;
  const url = `https://www.google.com/s2/favicons?domain=${encodeURIComponent(host)}&sz=64`;
  cache.set(host, url);
  return url;
}
function _resetFaviconCacheForTest() {
  cache.clear();
}
export {
  _resetFaviconCacheForTest,
  faviconUrlFor
};
//# sourceMappingURL=favicon.js.map