var Rt = Object.defineProperty;
var Ft = (t, n, e) => n in t ? Rt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
var x = (t, n, e) => Ft(t, typeof n != "symbol" ? n + "" : n, e);
/**
* (c) Iconify
*
* For the full copyright and license information, please view the license.txt
* files at https://github.com/iconify/iconify
*
* Licensed under MIT.
*
* @license MIT
* @version 3.0.0
*/
const bt = Object.freeze(
  {
    left: 0,
    top: 0,
    width: 16,
    height: 16
  }
), N = Object.freeze({
  rotate: 0,
  vFlip: !1,
  hFlip: !1
}), L = Object.freeze({
  ...bt,
  ...N
}), G = Object.freeze({
  ...L,
  body: "",
  hidden: !1
}), Nt = Object.freeze({
  width: null,
  height: null
}), mt = Object.freeze({
  // Dimensions
  ...Nt,
  // Transformations
  ...N
});
function Mt(t, n = 0) {
  const e = t.replace(/^-?[0-9.]*/, "");
  function s(o) {
    for (; o < 0; )
      o += 4;
    return o % 4;
  }
  if (e === "") {
    const o = parseInt(t);
    return isNaN(o) ? 0 : s(o);
  } else if (e !== t) {
    let o = 0;
    switch (e) {
      case "%":
        o = 25;
        break;
      case "deg":
        o = 90;
    }
    if (o) {
      let i = parseFloat(t.slice(0, t.length - e.length));
      return isNaN(i) ? 0 : (i = i / o, i % 1 === 0 ? s(i) : 0);
    }
  }
  return n;
}
const $t = /[\s,]+/;
function Dt(t, n) {
  n.split($t).forEach((e) => {
    switch (e.trim()) {
      case "horizontal":
        t.hFlip = !0;
        break;
      case "vertical":
        t.vFlip = !0;
        break;
    }
  });
}
const yt = {
  ...mt,
  preserveAspectRatio: ""
};
function et(t) {
  const n = {
    ...yt
  }, e = (s, o) => t.getAttribute(s) || o;
  return n.width = e("width", null), n.height = e("height", null), n.rotate = Mt(e("rotate", "")), Dt(n, e("flip", "")), n.preserveAspectRatio = e("preserveAspectRatio", e("preserveaspectratio", "")), n;
}
function Qt(t, n) {
  for (const e in yt)
    if (t[e] !== n[e])
      return !0;
  return !1;
}
const It = /^[a-z0-9]+(-[a-z0-9]+)*$/, j = (t, n, e, s = "") => {
  const o = t.split(":");
  if (t.slice(0, 1) === "@") {
    if (o.length < 2 || o.length > 3)
      return null;
    s = o.shift().slice(1);
  }
  if (o.length > 3 || !o.length)
    return null;
  if (o.length > 1) {
    const u = o.pop(), c = o.pop(), l = {
      // Allow provider without '@': "provider:prefix:name"
      provider: o.length > 0 ? o[0] : s,
      prefix: c,
      name: u
    };
    return n && !R(l) ? null : l;
  }
  const i = o[0], r = i.split("-");
  if (r.length > 1) {
    const u = {
      provider: s,
      prefix: r.shift(),
      name: r.join("-")
    };
    return n && !R(u) ? null : u;
  }
  if (e && s === "") {
    const u = {
      provider: s,
      prefix: "",
      name: i
    };
    return n && !R(u, e) ? null : u;
  }
  return null;
}, R = (t, n) => t ? !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
// Check name: cannot be empty
((n && t.prefix === "" || t.prefix) && t.name) : !1;
function qt(t, n) {
  const e = {};
  !t.hFlip != !n.hFlip && (e.hFlip = !0), !t.vFlip != !n.vFlip && (e.vFlip = !0);
  const s = ((t.rotate || 0) + (n.rotate || 0)) % 4;
  return s && (e.rotate = s), e;
}
function nt(t, n) {
  const e = qt(t, n);
  for (const s in G)
    s in N ? s in t && !(s in e) && (e[s] = N[s]) : s in n ? e[s] = n[s] : s in t && (e[s] = t[s]);
  return e;
}
function Ht(t, n) {
  const e = t.icons, s = t.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
  function i(r) {
    if (e[r])
      return o[r] = [];
    if (!(r in o)) {
      o[r] = null;
      const u = s[r] && s[r].parent, c = u && i(u);
      c && (o[r] = [u].concat(c));
    }
    return o[r];
  }
  return Object.keys(e).concat(Object.keys(s)).forEach(i), o;
}
function Ut(t, n, e) {
  const s = t.icons, o = t.aliases || /* @__PURE__ */ Object.create(null);
  let i = {};
  function r(u) {
    i = nt(
      s[u] || o[u],
      i
    );
  }
  return r(n), e.forEach(r), nt(t, i);
}
function vt(t, n) {
  const e = [];
  if (typeof t != "object" || typeof t.icons != "object")
    return e;
  t.not_found instanceof Array && t.not_found.forEach((o) => {
    n(o, null), e.push(o);
  });
  const s = Ht(t);
  for (const o in s) {
    const i = s[o];
    i && (n(o, Ut(t, o, i)), e.push(o));
  }
  return e;
}
const zt = {
  provider: "",
  aliases: {},
  not_found: {},
  ...bt
};
function U(t, n) {
  for (const e in n)
    if (e in t && typeof t[e] != typeof n[e])
      return !1;
  return !0;
}
function xt(t) {
  if (typeof t != "object" || t === null)
    return null;
  const n = t;
  if (typeof n.prefix != "string" || !t.icons || typeof t.icons != "object" || !U(t, zt))
    return null;
  const e = n.icons;
  for (const o in e) {
    const i = e[o];
    if (
      // Name cannot be empty
      !o || // Must have body
      typeof i.body != "string" || // Check other props
      !U(
        i,
        G
      )
    )
      return null;
  }
  const s = n.aliases || /* @__PURE__ */ Object.create(null);
  for (const o in s) {
    const i = s[o], r = i.parent;
    if (
      // Name cannot be empty
      !o || // Parent must be set and point to existing icon
      typeof r != "string" || !e[r] && !s[r] || // Check other props
      !U(
        i,
        G
      )
    )
      return null;
  }
  return n;
}
const M = /* @__PURE__ */ Object.create(null);
function Vt(t, n) {
  return {
    provider: t,
    prefix: n,
    icons: /* @__PURE__ */ Object.create(null),
    missing: /* @__PURE__ */ new Set()
  };
}
function v(t, n) {
  const e = M[t] || (M[t] = /* @__PURE__ */ Object.create(null));
  return e[n] || (e[n] = Vt(t, n));
}
function wt(t, n) {
  return xt(n) ? vt(n, (e, s) => {
    s ? t.icons[e] = s : t.missing.add(e);
  }) : [];
}
function Gt(t, n, e) {
  try {
    if (typeof e.body == "string")
      return t.icons[n] = { ...e }, !0;
  } catch {
  }
  return !1;
}
function Bt(t, n) {
  let e = [];
  return (typeof t == "string" ? [t] : Object.keys(M)).forEach((o) => {
    (typeof o == "string" && typeof n == "string" ? [n] : Object.keys(M[o] || {})).forEach((r) => {
      const u = v(o, r);
      e = e.concat(
        Object.keys(u.icons).map(
          (c) => (o !== "" ? "@" + o + ":" : "") + r + ":" + c
        )
      );
    });
  }), e;
}
let P = !1;
function _t(t) {
  return typeof t == "boolean" && (P = t), P;
}
function O(t) {
  const n = typeof t == "string" ? j(t, !0, P) : t;
  if (n) {
    const e = v(n.provider, n.prefix), s = n.name;
    return e.icons[s] || (e.missing.has(s) ? null : void 0);
  }
}
function Ct(t, n) {
  const e = j(t, !0, P);
  if (!e)
    return !1;
  const s = v(e.provider, e.prefix);
  return n ? Gt(s, e.name, n) : (s.missing.add(e.name), !0);
}
function ot(t, n) {
  if (typeof t != "object")
    return !1;
  if (typeof n != "string" && (n = t.provider || ""), P && !n && !t.prefix) {
    let o = !1;
    return xt(t) && (t.prefix = "", vt(t, (i, r) => {
      Ct(i, r) && (o = !0);
    })), o;
  }
  const e = t.prefix;
  if (!R({
    prefix: e,
    name: "a"
  }))
    return !1;
  const s = v(n, e);
  return !!wt(s, t);
}
function Jt(t) {
  return !!O(t);
}
function Kt(t) {
  const n = O(t);
  return n && {
    ...L,
    ...n
  };
}
function Wt(t) {
  const n = {
    loaded: [],
    missing: [],
    pending: []
  }, e = /* @__PURE__ */ Object.create(null);
  t.sort((o, i) => o.provider !== i.provider ? o.provider.localeCompare(i.provider) : o.prefix !== i.prefix ? o.prefix.localeCompare(i.prefix) : o.name.localeCompare(i.name));
  let s = {
    provider: "",
    prefix: "",
    name: ""
  };
  return t.forEach((o) => {
    if (s.name === o.name && s.prefix === o.prefix && s.provider === o.provider)
      return;
    s = o;
    const i = o.provider, r = o.prefix, u = o.name, c = e[i] || (e[i] = /* @__PURE__ */ Object.create(null)), l = c[r] || (c[r] = v(i, r));
    let f;
    u in l.icons ? f = n.loaded : r === "" || l.missing.has(u) ? f = n.missing : f = n.pending;
    const a = {
      provider: i,
      prefix: r,
      name: u
    };
    f.push(a);
  }), n;
}
function At(t, n) {
  t.forEach((e) => {
    const s = e.loaderCallbacks;
    s && (e.loaderCallbacks = s.filter((o) => o.id !== n));
  });
}
function Xt(t) {
  t.pendingCallbacksFlag || (t.pendingCallbacksFlag = !0, setTimeout(() => {
    t.pendingCallbacksFlag = !1;
    const n = t.loaderCallbacks ? t.loaderCallbacks.slice(0) : [];
    if (!n.length)
      return;
    let e = !1;
    const s = t.provider, o = t.prefix;
    n.forEach((i) => {
      const r = i.icons, u = r.pending.length;
      r.pending = r.pending.filter((c) => {
        if (c.prefix !== o)
          return !0;
        const l = c.name;
        if (t.icons[l])
          r.loaded.push({
            provider: s,
            prefix: o,
            name: l
          });
        else if (t.missing.has(l))
          r.missing.push({
            provider: s,
            prefix: o,
            name: l
          });
        else
          return e = !0, !0;
        return !1;
      }), r.pending.length !== u && (e || At([t], i.id), i.callback(
        r.loaded.slice(0),
        r.missing.slice(0),
        r.pending.slice(0),
        i.abort
      ));
    });
  }));
}
let Yt = 0;
function Zt(t, n, e) {
  const s = Yt++, o = At.bind(null, e, s);
  if (!n.pending.length)
    return o;
  const i = {
    id: s,
    icons: n,
    callback: t,
    abort: o
  };
  return e.forEach((r) => {
    (r.loaderCallbacks || (r.loaderCallbacks = [])).push(i);
  }), o;
}
const B = /* @__PURE__ */ Object.create(null);
function st(t, n) {
  B[t] = n;
}
function J(t) {
  return B[t] || B[""];
}
function te(t, n = !0, e = !1) {
  const s = [];
  return t.forEach((o) => {
    const i = typeof o == "string" ? j(o, n, e) : o;
    i && s.push(i);
  }), s;
}
var ee = {
  resources: [],
  index: 0,
  timeout: 2e3,
  rotate: 750,
  random: !1,
  dataAfterTimeout: !1
};
function ne(t, n, e, s) {
  const o = t.resources.length, i = t.random ? Math.floor(Math.random() * o) : t.index;
  let r;
  if (t.random) {
    let h = t.resources.slice(0);
    for (r = []; h.length > 1; ) {
      const m = Math.floor(Math.random() * h.length);
      r.push(h[m]), h = h.slice(0, m).concat(h.slice(m + 1));
    }
    r = r.concat(h);
  } else
    r = t.resources.slice(i).concat(t.resources.slice(0, i));
  const u = Date.now();
  let c = "pending", l = 0, f, a = null, d = [], p = [];
  typeof s == "function" && p.push(s);
  function y() {
    a && (clearTimeout(a), a = null);
  }
  function w() {
    c === "pending" && (c = "aborted"), y(), d.forEach((h) => {
      h.status === "pending" && (h.status = "aborted");
    }), d = [];
  }
  function g(h, m) {
    m && (p = []), typeof h == "function" && p.push(h);
  }
  function q() {
    return {
      startTime: u,
      payload: n,
      status: c,
      queriesSent: l,
      queriesPending: d.length,
      subscribe: g,
      abort: w
    };
  }
  function _() {
    c = "failed", p.forEach((h) => {
      h(void 0, f);
    });
  }
  function I() {
    d.forEach((h) => {
      h.status === "pending" && (h.status = "aborted");
    }), d = [];
  }
  function b(h, m, A) {
    const E = m !== "success";
    switch (d = d.filter((C) => C !== h), c) {
      case "pending":
        break;
      case "failed":
        if (E || !t.dataAfterTimeout)
          return;
        break;
      default:
        return;
    }
    if (m === "abort") {
      f = A, _();
      return;
    }
    if (E) {
      f = A, d.length || (r.length ? H() : _());
      return;
    }
    if (y(), I(), !t.random) {
      const C = t.resources.indexOf(h.resource);
      C !== -1 && C !== t.index && (t.index = C);
    }
    c = "completed", p.forEach((C) => {
      C(A);
    });
  }
  function H() {
    if (c !== "pending")
      return;
    y();
    const h = r.shift();
    if (h === void 0) {
      if (d.length) {
        a = setTimeout(() => {
          y(), c === "pending" && (I(), _());
        }, t.timeout);
        return;
      }
      _();
      return;
    }
    const m = {
      status: "pending",
      resource: h,
      callback: (A, E) => {
        b(m, A, E);
      }
    };
    d.push(m), l++, a = setTimeout(H, t.rotate), e(h, n, m.callback);
  }
  return setTimeout(H), q;
}
function kt(t) {
  const n = {
    ...ee,
    ...t
  };
  let e = [];
  function s() {
    e = e.filter((u) => u().status === "pending");
  }
  function o(u, c, l) {
    const f = ne(
      n,
      u,
      c,
      (a, d) => {
        s(), l && l(a, d);
      }
    );
    return e.push(f), f;
  }
  function i(u) {
    return e.find((c) => u(c)) || null;
  }
  return {
    query: o,
    find: i,
    setIndex: (u) => {
      n.index = u;
    },
    getIndex: () => n.index,
    cleanup: s
  };
}
function Y(t) {
  let n;
  if (typeof t.resources == "string")
    n = [t.resources];
  else if (n = t.resources, !(n instanceof Array) || !n.length)
    return null;
  return {
    // API hosts
    resources: n,
    // Root path
    path: t.path || "/",
    // URL length limit
    maxURL: t.maxURL || 500,
    // Timeout before next host is used.
    rotate: t.rotate || 750,
    // Timeout before failing query.
    timeout: t.timeout || 5e3,
    // Randomise default API end point.
    random: t.random === !0,
    // Start index
    index: t.index || 0,
    // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
    dataAfterTimeout: t.dataAfterTimeout !== !1
  };
}
const D = /* @__PURE__ */ Object.create(null), k = [
  "https://api.simplesvg.com",
  "https://api.unisvg.com"
], F = [];
for (; k.length > 0; )
  k.length === 1 || Math.random() > 0.5 ? F.push(k.shift()) : F.push(k.pop());
D[""] = Y({
  resources: ["https://api.iconify.design"].concat(F)
});
function it(t, n) {
  const e = Y(n);
  return e === null ? !1 : (D[t] = e, !0);
}
function Q(t) {
  return D[t];
}
function oe() {
  return Object.keys(D);
}
function rt() {
}
const z = /* @__PURE__ */ Object.create(null);
function se(t) {
  if (!z[t]) {
    const n = Q(t);
    if (!n)
      return;
    const e = kt(n), s = {
      config: n,
      redundancy: e
    };
    z[t] = s;
  }
  return z[t];
}
function St(t, n, e) {
  let s, o;
  if (typeof t == "string") {
    const i = J(t);
    if (!i)
      return e(void 0, 424), rt;
    o = i.send;
    const r = se(t);
    r && (s = r.redundancy);
  } else {
    const i = Y(t);
    if (i) {
      s = kt(i);
      const r = t.resources ? t.resources[0] : "", u = J(r);
      u && (o = u.send);
    }
  }
  return !s || !o ? (e(void 0, 424), rt) : s.query(n, o, e)().abort;
}
function ct() {
}
function ie(t) {
  t.iconsLoaderFlag || (t.iconsLoaderFlag = !0, setTimeout(() => {
    t.iconsLoaderFlag = !1, Xt(t);
  }));
}
function re(t) {
  const n = [], e = [];
  return t.forEach((s) => {
    (s.match(It) ? n : e).push(s);
  }), {
    valid: n,
    invalid: e
  };
}
function S(t, n, e) {
  function s() {
    const o = t.pendingIcons;
    n.forEach((i) => {
      o && o.delete(i), t.icons[i] || t.missing.add(i);
    });
  }
  if (e && typeof e == "object")
    try {
      if (!wt(t, e).length) {
        s();
        return;
      }
    } catch (o) {
      console.error(o);
    }
  s(), ie(t);
}
function ut(t, n) {
  t instanceof Promise ? t.then((e) => {
    n(e);
  }).catch(() => {
    n(null);
  }) : n(t);
}
function ce(t, n) {
  t.iconsToLoad ? t.iconsToLoad = t.iconsToLoad.concat(n).sort() : t.iconsToLoad = n, t.iconsQueueFlag || (t.iconsQueueFlag = !0, setTimeout(() => {
    t.iconsQueueFlag = !1;
    const { provider: e, prefix: s } = t, o = t.iconsToLoad;
    if (delete t.iconsToLoad, !o || !o.length)
      return;
    const i = t.loadIcon;
    if (t.loadIcons && (o.length > 1 || !i)) {
      ut(
        t.loadIcons(o, s, e),
        (f) => {
          S(t, o, f);
        }
      );
      return;
    }
    if (i) {
      o.forEach((f) => {
        const a = i(f, s, e);
        ut(a, (d) => {
          const p = d ? {
            prefix: s,
            icons: {
              [f]: d
            }
          } : null;
          S(t, [f], p);
        });
      });
      return;
    }
    const { valid: r, invalid: u } = re(o);
    if (u.length && S(t, u, null), !r.length)
      return;
    const c = s.match(It) ? J(e) : null;
    if (!c) {
      S(t, r, null);
      return;
    }
    c.prepare(e, s, r).forEach((f) => {
      St(e, f, (a) => {
        S(t, f.icons, a);
      });
    });
  }));
}
const Z = (t, n) => {
  const e = te(t, !0, _t()), s = Wt(e);
  if (!s.pending.length) {
    let c = !0;
    return n && setTimeout(() => {
      c && n(
        s.loaded,
        s.missing,
        s.pending,
        ct
      );
    }), () => {
      c = !1;
    };
  }
  const o = /* @__PURE__ */ Object.create(null), i = [];
  let r, u;
  return s.pending.forEach((c) => {
    const { provider: l, prefix: f } = c;
    if (f === u && l === r)
      return;
    r = l, u = f, i.push(v(l, f));
    const a = o[l] || (o[l] = /* @__PURE__ */ Object.create(null));
    a[f] || (a[f] = []);
  }), s.pending.forEach((c) => {
    const { provider: l, prefix: f, name: a } = c, d = v(l, f), p = d.pendingIcons || (d.pendingIcons = /* @__PURE__ */ new Set());
    p.has(a) || (p.add(a), o[l][f].push(a));
  }), i.forEach((c) => {
    const l = o[c.provider][c.prefix];
    l.length && ce(c, l);
  }), n ? Zt(n, s, i) : ct;
}, ue = (t) => new Promise((n, e) => {
  const s = typeof t == "string" ? j(t, !0) : t;
  if (!s) {
    e(t);
    return;
  }
  Z([s || t], (o) => {
    if (o.length && s) {
      const i = O(s);
      if (i) {
        n({
          ...L,
          ...i
        });
        return;
      }
    }
    e(t);
  });
});
function lt(t) {
  try {
    const n = typeof t == "string" ? JSON.parse(t) : t;
    if (typeof n.body == "string")
      return {
        ...n
      };
  } catch {
  }
}
function le(t, n) {
  if (typeof t == "object")
    return {
      data: lt(t),
      value: t
    };
  if (typeof t != "string")
    return {
      value: t
    };
  if (t.includes("{")) {
    const i = lt(t);
    if (i)
      return {
        data: i,
        value: t
      };
  }
  const e = j(t, !0, !0);
  if (!e)
    return {
      value: t
    };
  const s = O(e);
  if (s !== void 0 || !e.prefix)
    return {
      value: t,
      name: e,
      data: s
      // could be 'null' -> icon is missing
    };
  const o = Z([e], () => n(t, e, O(e)));
  return {
    value: t,
    name: e,
    loading: o
  };
}
let Tt = !1;
try {
  Tt = navigator.vendor.indexOf("Apple") === 0;
} catch {
}
function fe(t, n) {
  switch (n) {
    // Force mode
    case "svg":
    case "bg":
    case "mask":
      return n;
  }
  return n !== "style" && (Tt || t.indexOf("<a") === -1) ? "svg" : t.indexOf("currentColor") === -1 ? "bg" : "mask";
}
const ae = /(-?[0-9.]*[0-9]+[0-9.]*)/g, de = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
function K(t, n, e) {
  if (n === 1)
    return t;
  if (e = e || 100, typeof t == "number")
    return Math.ceil(t * n * e) / e;
  if (typeof t != "string")
    return t;
  const s = t.split(ae);
  if (s === null || !s.length)
    return t;
  const o = [];
  let i = s.shift(), r = de.test(i);
  for (; ; ) {
    if (r) {
      const u = parseFloat(i);
      isNaN(u) ? o.push(i) : o.push(Math.ceil(u * n * e) / e);
    } else
      o.push(i);
    if (i = s.shift(), i === void 0)
      return o.join("");
    r = !r;
  }
}
function he(t, n = "defs") {
  let e = "";
  const s = t.indexOf("<" + n);
  for (; s >= 0; ) {
    const o = t.indexOf(">", s), i = t.indexOf("</" + n);
    if (o === -1 || i === -1)
      break;
    const r = t.indexOf(">", i);
    if (r === -1)
      break;
    e += t.slice(o + 1, i).trim(), t = t.slice(0, s).trim() + t.slice(r + 1);
  }
  return {
    defs: e,
    content: t
  };
}
function pe(t, n) {
  return t ? "<defs>" + t + "</defs>" + n : n;
}
function ge(t, n, e) {
  const s = he(t);
  return pe(s.defs, n + s.content + e);
}
const be = (t) => t === "unset" || t === "undefined" || t === "none";
function Pt(t, n) {
  const e = {
    ...L,
    ...t
  }, s = {
    ...mt,
    ...n
  }, o = {
    left: e.left,
    top: e.top,
    width: e.width,
    height: e.height
  };
  let i = e.body;
  [e, s].forEach((w) => {
    const g = [], q = w.hFlip, _ = w.vFlip;
    let I = w.rotate;
    q ? _ ? I += 2 : (g.push(
      "translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"
    ), g.push("scale(-1 1)"), o.top = o.left = 0) : _ && (g.push(
      "translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"
    ), g.push("scale(1 -1)"), o.top = o.left = 0);
    let b;
    switch (I < 0 && (I -= Math.floor(I / 4) * 4), I = I % 4, I) {
      case 1:
        b = o.height / 2 + o.top, g.unshift(
          "rotate(90 " + b.toString() + " " + b.toString() + ")"
        );
        break;
      case 2:
        g.unshift(
          "rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")"
        );
        break;
      case 3:
        b = o.width / 2 + o.left, g.unshift(
          "rotate(-90 " + b.toString() + " " + b.toString() + ")"
        );
        break;
    }
    I % 2 === 1 && (o.left !== o.top && (b = o.left, o.left = o.top, o.top = b), o.width !== o.height && (b = o.width, o.width = o.height, o.height = b)), g.length && (i = ge(
      i,
      '<g transform="' + g.join(" ") + '">',
      "</g>"
    ));
  });
  const r = s.width, u = s.height, c = o.width, l = o.height;
  let f, a;
  r === null ? (a = u === null ? "1em" : u === "auto" ? l : u, f = K(a, c / l)) : (f = r === "auto" ? c : r, a = u === null ? K(f, l / c) : u === "auto" ? l : u);
  const d = {}, p = (w, g) => {
    be(g) || (d[w] = g.toString());
  };
  p("width", f), p("height", a);
  const y = [o.left, o.top, c, l];
  return d.viewBox = y.join(" "), {
    attributes: d,
    viewBox: y,
    body: i
  };
}
function tt(t, n) {
  let e = t.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
  for (const s in n)
    e += " " + s + '="' + n[s] + '"';
  return '<svg xmlns="http://www.w3.org/2000/svg"' + e + ">" + t + "</svg>";
}
function me(t) {
  return t.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
}
function ye(t) {
  return "data:image/svg+xml," + me(t);
}
function Ot(t) {
  return 'url("' + ye(t) + '")';
}
const Ie = () => {
  let t;
  try {
    if (t = fetch, typeof t == "function")
      return t;
  } catch {
  }
};
let $ = Ie();
function ve(t) {
  $ = t;
}
function xe() {
  return $;
}
function we(t, n) {
  const e = Q(t);
  if (!e)
    return 0;
  let s;
  if (!e.maxURL)
    s = 0;
  else {
    let o = 0;
    e.resources.forEach((r) => {
      o = Math.max(o, r.length);
    });
    const i = n + ".json?icons=";
    s = e.maxURL - o - e.path.length - i.length;
  }
  return s;
}
function _e(t) {
  return t === 404;
}
const Ce = (t, n, e) => {
  const s = [], o = we(t, n), i = "icons";
  let r = {
    type: i,
    provider: t,
    prefix: n,
    icons: []
  }, u = 0;
  return e.forEach((c, l) => {
    u += c.length + 1, u >= o && l > 0 && (s.push(r), r = {
      type: i,
      provider: t,
      prefix: n,
      icons: []
    }, u = c.length), r.icons.push(c);
  }), s.push(r), s;
};
function Ae(t) {
  if (typeof t == "string") {
    const n = Q(t);
    if (n)
      return n.path;
  }
  return "/";
}
const ke = (t, n, e) => {
  if (!$) {
    e("abort", 424);
    return;
  }
  let s = Ae(n.provider);
  switch (n.type) {
    case "icons": {
      const i = n.prefix, u = n.icons.join(","), c = new URLSearchParams({
        icons: u
      });
      s += i + ".json?" + c.toString();
      break;
    }
    case "custom": {
      const i = n.uri;
      s += i.slice(0, 1) === "/" ? i.slice(1) : i;
      break;
    }
    default:
      e("abort", 400);
      return;
  }
  let o = 503;
  $(t + s).then((i) => {
    const r = i.status;
    if (r !== 200) {
      setTimeout(() => {
        e(_e(r) ? "abort" : "next", r);
      });
      return;
    }
    return o = 501, i.json();
  }).then((i) => {
    if (typeof i != "object" || i === null) {
      setTimeout(() => {
        i === 404 ? e("abort", i) : e("next", o);
      });
      return;
    }
    setTimeout(() => {
      e("success", i);
    });
  }).catch(() => {
    e("next", o);
  });
}, Se = {
  prepare: Ce,
  send: ke
};
function Te(t, n, e) {
  v(e || "", n).loadIcons = t;
}
function Pe(t, n, e) {
  v(e || "", n).loadIcon = t;
}
const V = "data-style";
let Lt = "";
function Oe(t) {
  Lt = t;
}
function ft(t, n) {
  let e = Array.from(t.childNodes).find((s) => s.hasAttribute && s.hasAttribute(V));
  e || (e = document.createElement("style"), e.setAttribute(V, V), t.appendChild(e)), e.textContent = ":host{display:inline-block;vertical-align:" + (n ? "-0.125em" : "0") + "}span,svg{display:block;margin:auto}" + Lt;
}
function jt() {
  st("", Se), _t(!0);
  let t;
  try {
    t = window;
  } catch {
  }
  if (t) {
    if (t.IconifyPreload !== void 0) {
      const e = t.IconifyPreload, s = "Invalid IconifyPreload syntax.";
      typeof e == "object" && e !== null && (e instanceof Array ? e : [e]).forEach((o) => {
        try {
          // Check if item is an object and not null/array
          (typeof o != "object" || o === null || o instanceof Array || // Check for 'icons' and 'prefix'
          typeof o.icons != "object" || typeof o.prefix != "string" || // Add icon set
          !ot(o)) && console.error(s);
        } catch {
          console.error(s);
        }
      });
    }
    if (t.IconifyProviders !== void 0) {
      const e = t.IconifyProviders;
      if (typeof e == "object" && e !== null)
        for (const s in e) {
          const o = "IconifyProviders[" + s + "] is invalid.";
          try {
            const i = e[s];
            if (typeof i != "object" || !i || i.resources === void 0)
              continue;
            it(s, i) || console.error(o);
          } catch {
            console.error(o);
          }
        }
    }
  }
  return {
    iconLoaded: Jt,
    getIcon: Kt,
    listIcons: Bt,
    addIcon: Ct,
    addCollection: ot,
    calculateSize: K,
    buildIcon: Pt,
    iconToHTML: tt,
    svgToURL: Ot,
    loadIcons: Z,
    loadIcon: ue,
    addAPIProvider: it,
    setCustomIconLoader: Pe,
    setCustomIconsLoader: Te,
    appendCustomStyle: Oe,
    _api: {
      getAPIConfig: Q,
      setAPIModule: st,
      sendAPIQuery: St,
      setFetch: ve,
      getFetch: xe,
      listAPIProviders: oe
    }
  };
}
const W = {
  "background-color": "currentColor"
}, Et = {
  "background-color": "transparent"
}, at = {
  image: "var(--svg)",
  repeat: "no-repeat",
  size: "100% 100%"
}, dt = {
  "-webkit-mask": W,
  mask: W,
  background: Et
};
for (const t in dt) {
  const n = dt[t];
  for (const e in at)
    n[t + "-" + e] = at[e];
}
function ht(t) {
  return t ? t + (t.match(/^[-0-9.]+$/) ? "px" : "") : "inherit";
}
function Le(t, n, e) {
  const s = document.createElement("span");
  let o = t.body;
  o.indexOf("<a") !== -1 && (o += "<!-- " + Date.now() + " -->");
  const i = t.attributes, r = tt(o, {
    ...i,
    width: n.width + "",
    height: n.height + ""
  }), u = Ot(r), c = s.style, l = {
    "--svg": u,
    width: ht(i.width),
    height: ht(i.height),
    ...e ? W : Et
  };
  for (const f in l)
    c.setProperty(f, l[f]);
  return s;
}
let T;
function je() {
  try {
    T = window.trustedTypes.createPolicy("iconify", {
      // eslint-disable-next-line @typescript-eslint/no-unsafe-return
      createHTML: (t) => t
    });
  } catch {
    T = null;
  }
}
function Ee(t) {
  return T === void 0 && je(), T ? T.createHTML(t) : t;
}
function Re(t) {
  const n = document.createElement("span"), e = t.attributes;
  let s = "";
  e.width || (s = "width: inherit;"), e.height || (s += "height: inherit;"), s && (e.style = s);
  const o = tt(t.body, e);
  return n.innerHTML = Ee(o), n.firstChild;
}
function X(t) {
  return Array.from(t.childNodes).find((n) => {
    const e = n.tagName && n.tagName.toUpperCase();
    return e === "SPAN" || e === "SVG";
  });
}
function pt(t, n) {
  const e = n.icon.data, s = n.customisations, o = Pt(e, s);
  s.preserveAspectRatio && (o.attributes.preserveAspectRatio = s.preserveAspectRatio);
  const i = n.renderedMode;
  let r;
  switch (i) {
    case "svg":
      r = Re(o);
      break;
    default:
      r = Le(o, {
        ...L,
        ...e
      }, i === "mask");
  }
  const u = X(t);
  u ? r.tagName === "SPAN" && u.tagName === r.tagName ? u.setAttribute("style", r.getAttribute("style")) : t.replaceChild(r, u) : t.appendChild(r);
}
function gt(t, n, e) {
  const s = e && (e.rendered ? e : e.lastRender);
  return {
    rendered: !1,
    inline: n,
    icon: t,
    lastRender: s
  };
}
function Fe(t = "iconify-icon") {
  let n, e;
  try {
    n = window.customElements, e = window.HTMLElement;
  } catch {
    return;
  }
  if (!n || !e)
    return;
  const s = n.get(t);
  if (s)
    return s;
  const o = [
    // Icon
    "icon",
    // Mode
    "mode",
    "inline",
    "noobserver",
    // Customisations
    "width",
    "height",
    "rotate",
    "flip"
  ], i = class extends e {
    /**
     * Constructor
     */
    constructor() {
      super();
      // Root
      x(this, "_shadowRoot");
      // Initialised
      x(this, "_initialised", !1);
      // Icon state
      x(this, "_state");
      // Attributes check queued
      x(this, "_checkQueued", !1);
      // Connected
      x(this, "_connected", !1);
      // Observer
      x(this, "_observer", null);
      x(this, "_visible", !0);
      const c = this._shadowRoot = this.attachShadow({
        mode: "open"
      }), l = this.hasAttribute("inline");
      ft(c, l), this._state = gt({
        value: ""
      }, l), this._queueCheck();
    }
    /**
     * Connected to DOM
     */
    connectedCallback() {
      this._connected = !0, this.startObserver();
    }
    /**
     * Disconnected from DOM
     */
    disconnectedCallback() {
      this._connected = !1, this.stopObserver();
    }
    /**
     * Observed attributes
     */
    static get observedAttributes() {
      return o.slice(0);
    }
    /**
     * Observed properties that are different from attributes
     *
     * Experimental! Need to test with various frameworks that support it
     */
    /*
    static get properties() {
        return {
            inline: {
                type: Boolean,
                reflect: true,
            },
            // Not listing other attributes because they are strings or combination
            // of string and another type. Cannot have multiple types
        };
    }
    */
    /**
     * Attribute has changed
     */
    attributeChangedCallback(c) {
      switch (c) {
        case "inline": {
          const l = this.hasAttribute("inline"), f = this._state;
          l !== f.inline && (f.inline = l, ft(this._shadowRoot, l));
          break;
        }
        case "noobserver": {
          this.hasAttribute("noobserver") ? this.startObserver() : this.stopObserver();
          break;
        }
        default:
          this._queueCheck();
      }
    }
    /**
     * Get/set icon
     */
    get icon() {
      const c = this.getAttribute("icon");
      if (c && c.slice(0, 1) === "{")
        try {
          return JSON.parse(c);
        } catch {
        }
      return c;
    }
    set icon(c) {
      typeof c == "object" && (c = JSON.stringify(c)), this.setAttribute("icon", c);
    }
    /**
     * Get/set inline
     */
    get inline() {
      return this.hasAttribute("inline");
    }
    set inline(c) {
      c ? this.setAttribute("inline", "true") : this.removeAttribute("inline");
    }
    /**
     * Get/set observer
     */
    get observer() {
      return this.hasAttribute("observer");
    }
    set observer(c) {
      c ? this.setAttribute("observer", "true") : this.removeAttribute("observer");
    }
    /**
     * Restart animation
     */
    restartAnimation() {
      const c = this._state;
      if (c.rendered) {
        const l = this._shadowRoot;
        if (c.renderedMode === "svg")
          try {
            l.lastChild.setCurrentTime(0);
            return;
          } catch {
          }
        pt(l, c);
      }
    }
    /**
     * Get status
     */
    get status() {
      const c = this._state;
      return c.rendered ? "rendered" : c.icon.data === null ? "failed" : "loading";
    }
    /**
     * Queue attributes re-check
     */
    _queueCheck() {
      this._checkQueued || (this._checkQueued = !0, setTimeout(() => {
        this._check();
      }));
    }
    /**
     * Check for changes
     */
    _check() {
      if (!this._checkQueued)
        return;
      this._checkQueued = !1;
      const c = this._state, l = this.getAttribute("icon");
      if (l !== c.icon.value) {
        this._iconChanged(l);
        return;
      }
      if (!c.rendered || !this._visible)
        return;
      const f = this.getAttribute("mode"), a = et(this);
      (c.attrMode !== f || Qt(c.customisations, a) || !X(this._shadowRoot)) && this._renderIcon(c.icon, a, f);
    }
    /**
     * Icon value has changed
     */
    _iconChanged(c) {
      const l = le(c, (f, a, d) => {
        const p = this._state;
        if (p.rendered || this.getAttribute("icon") !== f)
          return;
        const y = {
          value: f,
          name: a,
          data: d
        };
        y.data ? this._gotIconData(y) : p.icon = y;
      });
      l.data ? this._gotIconData(l) : this._state = gt(l, this._state.inline, this._state);
    }
    /**
     * Force render icon on state change
     */
    _forceRender() {
      if (!this._visible) {
        const c = X(this._shadowRoot);
        c && this._shadowRoot.removeChild(c);
        return;
      }
      this._queueCheck();
    }
    /**
     * Got new icon data, icon is ready to (re)render
     */
    _gotIconData(c) {
      this._checkQueued = !1, this._renderIcon(c, et(this), this.getAttribute("mode"));
    }
    /**
     * Re-render based on icon data
     */
    _renderIcon(c, l, f) {
      const a = fe(c.data.body, f), d = this._state.inline;
      pt(this._shadowRoot, this._state = {
        rendered: !0,
        icon: c,
        inline: d,
        customisations: l,
        attrMode: f,
        renderedMode: a
      });
    }
    /**
     * Start observer
     */
    startObserver() {
      if (!this._observer && !this.hasAttribute("noobserver"))
        try {
          this._observer = new IntersectionObserver((c) => {
            const l = c.some((f) => f.isIntersecting);
            l !== this._visible && (this._visible = l, this._forceRender());
          }), this._observer.observe(this);
        } catch {
          if (this._observer) {
            try {
              this._observer.disconnect();
            } catch {
            }
            this._observer = null;
          }
        }
    }
    /**
     * Stop observer
     */
    stopObserver() {
      this._observer && (this._observer.disconnect(), this._observer = null, this._visible = !0, this._connected && this._forceRender());
    }
  };
  o.forEach((u) => {
    u in i.prototype || Object.defineProperty(i.prototype, u, {
      get: function() {
        return this.getAttribute(u);
      },
      set: function(c) {
        c !== null ? this.setAttribute(u, c) : this.removeAttribute(u);
      }
    });
  });
  const r = jt();
  for (const u in r)
    i[u] = i.prototype[u] = r[u];
  return n.define(t, i), i;
}
const Ne = Fe() || jt(), { iconLoaded: $e, getIcon: De, listIcons: Qe, addIcon: qe, addCollection: He, calculateSize: Ue, buildIcon: ze, iconToHTML: Ve, svgToURL: Ge, loadIcons: Be, loadIcon: Je, setCustomIconLoader: Ke, setCustomIconsLoader: We, addAPIProvider: Xe, _api: Ye } = Ne;
export {
  Ne as IconifyIconComponent,
  Ye as _api,
  Xe as addAPIProvider,
  He as addCollection,
  qe as addIcon,
  Oe as appendCustomStyle,
  ze as buildIcon,
  Ue as calculateSize,
  De as getIcon,
  $e as iconLoaded,
  Ve as iconToHTML,
  Qe as listIcons,
  Je as loadIcon,
  Be as loadIcons,
  Ke as setCustomIconLoader,
  We as setCustomIconsLoader,
  Ge as svgToURL
};
//# sourceMappingURL=iconify-icon.js.map
