/**
 * @license @lucide/icons v1.0.1 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */

import buildLucideSvg from './buildLucideSvg.mjs';

function buildLucideDataUri(icon, params = {}) {
  const svg = buildLucideSvg(icon, params);
  if (typeof btoa === "function") {
    const utf8Bytes = new TextEncoder().encode(svg);
    let binary = "";
    for (const element of utf8Bytes) binary += String.fromCodePoint(element);
    return `data:image/svg+xml;base64,${btoa(binary)}`;
  }
  if (typeof Buffer !== "undefined") {
    return `data:image/svg+xml;base64,${Buffer.from(svg, "utf8").toString("base64")}`;
  }
  throw new Error("No base64 encoder available in this environment.");
}

export { buildLucideDataUri as default };
//# sourceMappingURL=buildLucideDataUri.mjs.map
