const $e = "ui-image", ce = (
  /* ui-image */
  { hydratedSelectorName: "hydrated" }
);
var fe = Object.defineProperty, ue = (e, t) => {
  for (var n in t)
    fe(e, n, { get: t[n], enumerable: !0 });
}, U = /* @__PURE__ */ new WeakMap(), b = (e) => U.get(e), Ze = (e, t) => U.set(t.$lazyInstance$ = e, t), de = (e, t) => {
  const n = {
    $flags$: 0,
    $hostElement$: e,
    $cmpMeta$: t,
    $instanceValues$: /* @__PURE__ */ new Map()
  };
  return n.$onReadyPromise$ = new Promise((s) => n.$onReadyResolve$ = s), e["s-p"] = [], e["s-rc"] = [], U.set(e, n);
}, ve = (e, t) => t in e, E = (e, t) => (0, console.error)(e, t), _ = /* @__PURE__ */ new Map(), pe = (e, t, n) => {
  const s = e.$tagName$.replace(/-/g, "_"), r = e.$lazyBundleId$;
  if (!r)
    return;
  const l = _.get(r);
  if (l)
    return l[s];
  {
    const a = (i) => (_.set(r, i), i[s]);
    switch (r) {
      case "ui-image":
        return import(
          /* webpackMode: "lazy" */
          "./ui-image-BNrzgSpe.js"
        ).then(a, E);
    }
  }
  return import(
    /* @vite-ignore */
    /* webpackInclude: /\.entry\.js$/ */
    /* webpackExclude: /\.system\.entry\.js$/ */
    /* webpackMode: "lazy" */
    `./${r}.entry.js`
  ).then((a) => (_.set(r, a), a[s]), E);
}, x = /* @__PURE__ */ new Map(), ge = "{visibility:hidden}.hydrated{visibility:inherit}", J = "slot-fb{display:contents}slot-fb[hidden]{display:none}", B = typeof window < "u" ? window : {}, y = B.document || { head: {} }, g = {
  $flags$: 0,
  $resourcesUrl$: "",
  jmp: (e) => e(),
  raf: (e) => requestAnimationFrame(e),
  ael: (e, t, n, s) => e.addEventListener(t, n, s),
  rel: (e, t, n, s) => e.removeEventListener(t, n, s),
  ce: (e, t) => new CustomEvent(e, t)
}, he = (e) => Promise.resolve(e), me = /* @__PURE__ */ (() => {
  try {
    return new CSSStyleSheet(), typeof new CSSStyleSheet().replaceSync == "function";
  } catch {
  }
  return !1;
})(), j = !1, D = [], K = [], ye = (e, t) => (n) => {
  e.push(n), j || (j = !0, g.$flags$ & 4 ? z(O) : g.raf(O));
}, M = (e) => {
  for (let t = 0; t < e.length; t++)
    try {
      e[t](performance.now());
    } catch (n) {
      E(n);
    }
  e.length = 0;
}, O = () => {
  M(D), M(K), (j = D.length > 0) && g.raf(O);
}, z = (e) => he().then(e), Se = /* @__PURE__ */ ye(K), W = {}, q = (e) => (e = typeof e, e === "object" || e === "function");
function Q(e) {
  var t, n, s;
  return (s = (n = (t = e.head) == null ? void 0 : t.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : n.getAttribute("content")) != null ? s : void 0;
}
var be = {};
ue(be, {
  err: () => X,
  map: () => Ee,
  ok: () => I,
  unwrap: () => ke,
  unwrapErr: () => Pe
});
var I = (e) => ({
  isOk: !0,
  isErr: !1,
  value: e
}), X = (e) => ({
  isOk: !1,
  isErr: !0,
  value: e
});
function Ee(e, t) {
  if (e.isOk) {
    const n = t(e.value);
    return n instanceof Promise ? n.then((s) => I(s)) : I(n);
  }
  if (e.isErr) {
    const n = e.value;
    return X(n);
  }
  throw "should never get here";
}
var ke = (e) => {
  if (e.isOk)
    return e.value;
  throw e.value;
}, Pe = (e) => {
  if (e.isErr)
    return e.value;
  throw e.value;
}, S = (e, t = "") => () => {
}, Te = (e, t) => () => {
}, we = (e, t, ...n) => {
  let s = null, r = null, l = !1, a = !1;
  const i = [], o = ($) => {
    for (let f = 0; f < $.length; f++)
      s = $[f], Array.isArray(s) ? o(s) : s != null && typeof s != "boolean" && ((l = typeof e != "function" && !q(s)) && (s = String(s)), l && a ? i[i.length - 1].$text$ += s : i.push(l ? H(null, s) : s), a = l);
  };
  if (o(n), t) {
    t.key && (r = t.key);
    {
      const $ = t.className || t.class;
      $ && (t.class = typeof $ != "object" ? $ : Object.keys($).filter((f) => $[f]).join(" "));
    }
  }
  const c = H(e, null);
  return c.$attrs$ = t, i.length > 0 && (c.$children$ = i), c.$key$ = r, c;
}, H = (e, t) => {
  const n = {
    $flags$: 0,
    $tag$: e,
    $text$: t,
    $elm$: null,
    $children$: null
  };
  return n.$attrs$ = null, n.$key$ = null, n;
}, xe = {}, Ae = (e) => e && e.$tag$ === xe, Le = (e, t) => e != null && !q(e) && t & 1 ? String(e) : e, Re = (e) => b(e).$hostElement$, _e = (e, t, n) => {
  const s = g.ce(t, n);
  return e.dispatchEvent(s), s;
}, F = /* @__PURE__ */ new WeakMap(), je = (e, t, n) => {
  let s = x.get(e);
  me && n ? (s = s || new CSSStyleSheet(), typeof s == "string" ? s = t : s.replaceSync(t)) : s = t, x.set(e, s);
}, Oe = (e, t, n) => {
  var s;
  const r = Z(t), l = x.get(r);
  if (e = e.nodeType === 11 ? e : y, l)
    if (typeof l == "string") {
      e = e.head || e;
      let a = F.get(e), i;
      if (a || F.set(e, a = /* @__PURE__ */ new Set()), !a.has(r)) {
        {
          i = y.createElement("style"), i.innerHTML = l;
          const o = (s = g.$nonce$) != null ? s : Q(y);
          o != null && i.setAttribute("nonce", o), e.insertBefore(i, e.querySelector("link"));
        }
        t.$flags$ & 4 && (i.innerHTML += J), a && a.add(r);
      }
    } else
      e.adoptedStyleSheets.includes(l) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, l]);
  return r;
}, Ie = (e) => {
  const t = e.$cmpMeta$, n = e.$hostElement$, s = S("attachStyles", t.$tagName$);
  Oe(
    n.getRootNode(),
    t
  ), s();
}, Z = (e, t) => "sc-" + e.$tagName$, N = (e, t, n, s, r, l) => {
  if (n !== s) {
    let a = ve(e, t);
    if (t.toLowerCase(), t === "class") {
      const i = e.classList, o = Y(n), c = Y(s);
      i.remove(...o.filter(($) => $ && !c.includes($))), i.add(...c.filter(($) => $ && !o.includes($)));
    } else if (t === "style") {
      for (const i in n)
        (!s || s[i] == null) && (i.includes("-") ? e.style.removeProperty(i) : e.style[i] = "");
      for (const i in s)
        (!n || s[i] !== n[i]) && (i.includes("-") ? e.style.setProperty(i, s[i]) : e.style[i] = s[i]);
    } else if (t !== "key")
      if (t === "ref")
        s && s(e);
      else {
        const i = q(s);
        if (a || i && s !== null)
          try {
            if (e.tagName.includes("-"))
              e[t] = s;
            else {
              const o = s ?? "";
              t === "list" ? a = !1 : (n == null || e[t] != o) && (e[t] = o);
            }
          } catch {
          }
        s == null || s === !1 ? (s !== !1 || e.getAttribute(t) === "") && e.removeAttribute(t) : (!a || l & 4 || r) && !i && (s = s === !0 ? "" : s, e.setAttribute(t, s));
      }
  }
}, He = /\s/, Y = (e) => e ? e.split(He) : [], R = (e, t, n) => {
  const s = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, r = e && e.$attrs$ || W, l = t.$attrs$ || W;
  for (const a of G(Object.keys(r)))
    a in l || N(s, a, r[a], void 0, n, t.$flags$);
  for (const a of G(Object.keys(l)))
    N(s, a, r[a], l[a], n, t.$flags$);
};
function G(e) {
  return e.includes("ref") ? (
    // we need to sort these to ensure that `'ref'` is the last attr
    [...e.filter((t) => t !== "ref"), "ref"]
  ) : (
    // no need to sort, return the original array
    e
  );
}
var V, ee = !1, A = (e, t, n, s) => {
  const r = t.$children$[n];
  let l = 0, a, i;
  if (a = r.$elm$ = y.createElement(
    r.$tag$
  ), R(null, r, ee), r.$children$)
    for (l = 0; l < r.$children$.length; ++l)
      i = A(e, r, l), i && a.appendChild(i);
  return a["s-hn"] = V, a;
}, te = (e, t, n, s, r, l) => {
  let a = e, i;
  for (; r <= l; ++r)
    s[r] && (i = A(null, n, r), i && (s[r].$elm$ = i, w(a, i, t)));
}, se = (e, t, n) => {
  for (let s = t; s <= n; ++s) {
    const r = e[s];
    if (r) {
      const l = r.$elm$;
      ne(r), l && l.remove();
    }
  }
}, Ue = (e, t, n, s, r = !1) => {
  let l = 0, a = 0, i = 0, o = 0, c = t.length - 1, $ = t[0], f = t[c], u = s.length - 1, d = s[0], v = s[u], p, h;
  for (; l <= c && a <= u; )
    if ($ == null)
      $ = t[++l];
    else if (f == null)
      f = t[--c];
    else if (d == null)
      d = s[++a];
    else if (v == null)
      v = s[--u];
    else if (T($, d, r))
      k($, d, r), $ = t[++l], d = s[++a];
    else if (T(f, v, r))
      k(f, v, r), f = t[--c], v = s[--u];
    else if (T($, v, r))
      k($, v, r), w(e, $.$elm$, f.$elm$.nextSibling), $ = t[++l], v = s[--u];
    else if (T(f, d, r))
      k(f, d, r), w(e, f.$elm$, $.$elm$), f = t[--c], d = s[++a];
    else {
      for (i = -1, o = l; o <= c; ++o)
        if (t[o] && t[o].$key$ !== null && t[o].$key$ === d.$key$) {
          i = o;
          break;
        }
      i >= 0 ? (h = t[i], h.$tag$ !== d.$tag$ ? p = A(t && t[a], n, i) : (k(h, d, r), t[i] = void 0, p = h.$elm$), d = s[++a]) : (p = A(t && t[a], n, a), d = s[++a]), p && w($.$elm$.parentNode, p, $.$elm$);
    }
  l > c ? te(
    e,
    s[u + 1] == null ? null : s[u + 1].$elm$,
    n,
    s,
    a,
    u
  ) : a > u && se(t, l, c);
}, T = (e, t, n = !1) => e.$tag$ === t.$tag$ ? n ? !0 : e.$key$ === t.$key$ : !1, k = (e, t, n = !1) => {
  const s = t.$elm$ = e.$elm$, r = e.$children$, l = t.$children$;
  R(e, t, ee), r !== null && l !== null ? Ue(s, r, t, l, n) : l !== null ? te(s, null, t, l, 0, l.length - 1) : r !== null && se(r, 0, r.length - 1);
}, ne = (e) => {
  e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(ne);
}, w = (e, t, n) => e?.insertBefore(t, n), Be = (e, t, n = !1) => {
  const s = e.$hostElement$, r = e.$vnode$ || H(null, null), l = Ae(t) ? t : we(null, null, t);
  if (V = s.tagName, n && l.$attrs$)
    for (const a of Object.keys(l.$attrs$))
      s.hasAttribute(a) && !["key", "ref", "style", "class"].includes(a) && (l.$attrs$[a] = s[a]);
  l.$tag$ = null, l.$flags$ |= 4, e.$vnode$ = l, l.$elm$ = r.$elm$ = s, k(r, l, n);
}, re = (e, t) => {
  t && !e.$onRenderResolve$ && t["s-p"] && t["s-p"].push(new Promise((n) => e.$onRenderResolve$ = n));
}, C = (e, t) => {
  if (e.$flags$ |= 16, e.$flags$ & 4) {
    e.$flags$ |= 512;
    return;
  }
  return re(e, e.$ancestorComponent$), Se(() => ze(e, t));
}, ze = (e, t) => {
  const n = e.$hostElement$, s = S("scheduleUpdate", e.$cmpMeta$.$tagName$), r = e.$lazyInstance$;
  if (!r)
    throw new Error(
      `Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
    );
  let l;
  return s(), qe(l, () => De(e, r, t));
}, qe = (e, t) => Ce(e) ? e.then(t).catch((n) => {
  console.error(n), t();
}) : t(), Ce = (e) => e instanceof Promise || e && e.then && typeof e.then == "function", De = async (e, t, n) => {
  var s;
  const r = e.$hostElement$, l = S("update", e.$cmpMeta$.$tagName$), a = r["s-rc"];
  n && Ie(e);
  const i = S("render", e.$cmpMeta$.$tagName$);
  Me(e, t, r, n), a && (a.map((o) => o()), r["s-rc"] = void 0), i(), l();
  {
    const o = (s = r["s-p"]) != null ? s : [], c = () => We(e);
    o.length === 0 ? c() : (Promise.all(o).then(c), e.$flags$ |= 4, o.length = 0);
  }
}, Me = (e, t, n, s) => {
  try {
    t = t.render(), e.$flags$ &= -17, e.$flags$ |= 2, Be(e, t, s);
  } catch (r) {
    E(r, e.$hostElement$);
  }
  return null;
}, We = (e) => {
  const t = e.$cmpMeta$.$tagName$, n = e.$hostElement$, s = S("postUpdate", t), r = e.$lazyInstance$, l = e.$ancestorComponent$;
  e.$flags$ & 64 ? s() : (e.$flags$ |= 64, ae(n), Fe(r, "componentDidLoad"), s(), e.$onReadyResolve$(n), l || le()), e.$onRenderResolve$ && (e.$onRenderResolve$(), e.$onRenderResolve$ = void 0), e.$flags$ & 512 && z(() => C(e, !1)), e.$flags$ &= -517;
}, le = (e) => {
  ae(y.documentElement), z(() => _e(B, "appload", { detail: { namespace: $e } }));
}, Fe = (e, t, n) => {
  if (e && e[t])
    try {
      return e[t](n);
    } catch (s) {
      E(s);
    }
}, ae = (e) => {
  var t;
  return e.classList.add((t = ce.hydratedSelectorName) != null ? t : "hydrated");
}, Ne = (e, t) => b(e).$instanceValues$.get(t), Ye = (e, t, n, s) => {
  const r = b(e);
  if (!r)
    throw new Error(
      `Couldn't find host element for "${s.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`
    );
  const l = r.$hostElement$, a = r.$instanceValues$.get(t), i = r.$flags$, o = r.$lazyInstance$;
  n = Le(n, s.$members$[t][0]);
  const c = Number.isNaN(a) && Number.isNaN(n), $ = n !== a && !c;
  if ((!(i & 8) || a === void 0) && $ && (r.$instanceValues$.set(t, n), o)) {
    if (s.$watchers$ && i & 128) {
      const f = s.$watchers$[t];
      f && f.map((u) => {
        try {
          o[u](n, a, t);
        } catch (d) {
          E(d, l);
        }
      });
    }
    (i & 18) === 2 && C(r, !1);
  }
}, ie = (e, t, n) => {
  var s, r;
  const l = e.prototype;
  if (t.$members$ || t.$watchers$ || e.watchers) {
    e.watchers && !t.$watchers$ && (t.$watchers$ = e.watchers);
    const a = Object.entries((s = t.$members$) != null ? s : {});
    if (a.map(([i, [o]]) => {
      (o & 31 || n & 2 && o & 32) && Object.defineProperty(l, i, {
        get() {
          return Ne(this, i);
        },
        set(c) {
          Ye(this, i, c, t);
        },
        configurable: !0,
        enumerable: !0
      });
    }), n & 1) {
      const i = /* @__PURE__ */ new Map();
      l.attributeChangedCallback = function(o, c, $) {
        g.jmp(() => {
          var f;
          const u = i.get(o);
          if (this.hasOwnProperty(u))
            $ = this[u], delete this[u];
          else {
            if (l.hasOwnProperty(u) && typeof this[u] == "number" && this[u] == $)
              return;
            if (u == null) {
              const d = b(this), v = d?.$flags$;
              if (v && !(v & 8) && v & 128 && $ !== c) {
                const p = d.$lazyInstance$, h = (f = t.$watchers$) == null ? void 0 : f[o];
                h?.forEach((m) => {
                  p[m] != null && p[m].call(p, $, c, o);
                });
              }
              return;
            }
          }
          this[u] = $ === null && typeof this[u] == "boolean" ? !1 : $;
        });
      }, e.observedAttributes = Array.from(
        /* @__PURE__ */ new Set([
          ...Object.keys((r = t.$watchers$) != null ? r : {}),
          ...a.filter(
            ([o, c]) => c[0] & 15
            /* HasAttribute */
          ).map(([o, c]) => {
            const $ = c[1] || o;
            return i.set($, o), $;
          })
        ])
      );
    }
  }
  return e;
}, Ge = async (e, t, n, s) => {
  let r;
  if (!(t.$flags$ & 32)) {
    if (t.$flags$ |= 32, n.$lazyBundleId$) {
      const o = pe(n);
      if (o && "then" in o) {
        const $ = Te();
        r = await o, $();
      } else
        r = o;
      if (!r)
        throw new Error(`Constructor for "${n.$tagName$}#${t.$modeName$}" was not found`);
      r.isProxied || (n.$watchers$ = r.watchers, ie(
        r,
        n,
        2
        /* proxyState */
      ), r.isProxied = !0);
      const c = S("createInstance", n.$tagName$);
      t.$flags$ |= 8;
      try {
        new r(t);
      } catch ($) {
        E($);
      }
      t.$flags$ &= -9, t.$flags$ |= 128, c();
    } else {
      r = e.constructor;
      const o = e.localName;
      customElements.whenDefined(o).then(
        () => t.$flags$ |= 128
        /* isWatchReady */
      );
    }
    if (r && r.style) {
      let o;
      typeof r.style == "string" && (o = r.style);
      const c = Z(n);
      if (!x.has(c)) {
        const $ = S("registerStyles", n.$tagName$);
        je(c, o, !!(n.$flags$ & 1)), $();
      }
    }
  }
  const l = t.$ancestorComponent$, a = () => C(t, !0);
  l && l["s-rc"] ? l["s-rc"].push(a) : a();
}, Je = (e) => {
}, Ke = (e) => {
  if (!(g.$flags$ & 1)) {
    const t = b(e), n = t.$cmpMeta$, s = S("connectedCallback", n.$tagName$);
    if (t.$flags$ & 1)
      t?.$lazyInstance$ || t?.$onReadyPromise$ && t.$onReadyPromise$.then(() => Je());
    else {
      t.$flags$ |= 1;
      {
        let r = e;
        for (; r = r.parentNode || r.host; )
          if (r["s-p"]) {
            re(t, t.$ancestorComponent$ = r);
            break;
          }
      }
      n.$members$ && Object.entries(n.$members$).map(([r, [l]]) => {
        if (l & 31 && e.hasOwnProperty(r)) {
          const a = e[r];
          delete e[r], e[r] = a;
        }
      }), Ge(e, t, n);
    }
    s();
  }
}, Qe = (e) => {
}, Xe = async (e) => {
  if (!(g.$flags$ & 1)) {
    const t = b(e);
    t?.$lazyInstance$ || t?.$onReadyPromise$ && t.$onReadyPromise$.then(() => Qe());
  }
}, Ve = (e, t = {}) => {
  var n;
  const s = S(), r = [], l = t.exclude || [], a = B.customElements, i = y.head, o = /* @__PURE__ */ i.querySelector("meta[charset]"), c = /* @__PURE__ */ y.createElement("style"), $ = [];
  let f, u = !0;
  Object.assign(g, t), g.$resourcesUrl$ = new URL(t.resourcesUrl || "./", y.baseURI).href;
  let d = !1;
  if (e.map((v) => {
    v[1].map((p) => {
      var h;
      const m = {
        $flags$: p[0],
        $tagName$: p[1],
        $members$: p[2],
        $listeners$: p[3]
      };
      m.$flags$ & 4 && (d = !0), m.$members$ = p[2], m.$watchers$ = (h = p[4]) != null ? h : {};
      const P = m.$tagName$, oe = class extends HTMLElement {
        // StencilLazyHost
        constructor(L) {
          super(L), this.hasRegisteredEventListeners = !1, L = this, de(L, m);
        }
        connectedCallback() {
          b(this), this.hasRegisteredEventListeners || (this.hasRegisteredEventListeners = !0), f && (clearTimeout(f), f = null), u ? $.push(this) : g.jmp(() => Ke(this));
        }
        disconnectedCallback() {
          g.jmp(() => Xe(this));
        }
        componentOnReady() {
          return b(this).$onReadyPromise$;
        }
      };
      m.$lazyBundleId$ = v[0], !l.includes(P) && !a.get(P) && (r.push(P), a.define(
        P,
        ie(
          oe,
          m,
          1
          /* isElementConstructor */
        )
      ));
    });
  }), r.length > 0 && (d && (c.textContent += J), c.textContent += r.sort() + ge, c.innerHTML.length)) {
    c.setAttribute("data-styles", "");
    const v = (n = g.$nonce$) != null ? n : Q(y);
    v != null && c.setAttribute("nonce", v), i.insertBefore(c, o ? o.nextSibling : i.firstChild);
  }
  u = !1, $.length ? $.map((v) => v.connectedCallback()) : g.jmp(() => f = setTimeout(le, 30)), s();
};
export {
  Ve as b,
  Re as g,
  we as h,
  he as p,
  Ze as r
};
