const {
  SvelteComponent: hs,
  assign: _s,
  create_slot: ds,
  detach: ms,
  element: gs,
  get_all_dirty_from_scope: ps,
  get_slot_changes: bs,
  get_spread_update: vs,
  init: ys,
  insert: ws,
  safe_not_equal: Es,
  set_dynamic_element_data: Di,
  set_style: ue,
  toggle_class: He,
  transition_in: al,
  transition_out: ul,
  update_slot_base: Ss
} = window.__gradio__svelte__internal;
function ks(e) {
  let t, n, i;
  const r = (
    /*#slots*/
    e[18].default
  ), l = ds(
    r,
    e,
    /*$$scope*/
    e[17],
    null
  );
  let s = [
    { "data-testid": (
      /*test_id*/
      e[7]
    ) },
    { id: (
      /*elem_id*/
      e[2]
    ) },
    {
      class: n = "block " + /*elem_classes*/
      e[3].join(" ") + " svelte-nl1om8"
    }
  ], u = {};
  for (let o = 0; o < s.length; o += 1)
    u = _s(u, s[o]);
  return {
    c() {
      t = gs(
        /*tag*/
        e[14]
      ), l && l.c(), Di(
        /*tag*/
        e[14]
      )(t, u), He(
        t,
        "hidden",
        /*visible*/
        e[10] === !1
      ), He(
        t,
        "padded",
        /*padding*/
        e[6]
      ), He(
        t,
        "border_focus",
        /*border_mode*/
        e[5] === "focus"
      ), He(
        t,
        "border_contrast",
        /*border_mode*/
        e[5] === "contrast"
      ), He(t, "hide-container", !/*explicit_call*/
      e[8] && !/*container*/
      e[9]), ue(
        t,
        "height",
        /*get_dimension*/
        e[15](
          /*height*/
          e[0]
        )
      ), ue(t, "width", typeof /*width*/
      e[1] == "number" ? `calc(min(${/*width*/
      e[1]}px, 100%))` : (
        /*get_dimension*/
        e[15](
          /*width*/
          e[1]
        )
      )), ue(
        t,
        "border-style",
        /*variant*/
        e[4]
      ), ue(
        t,
        "overflow",
        /*allow_overflow*/
        e[11] ? "visible" : "hidden"
      ), ue(
        t,
        "flex-grow",
        /*scale*/
        e[12]
      ), ue(t, "min-width", `calc(min(${/*min_width*/
      e[13]}px, 100%))`), ue(t, "border-width", "var(--block-border-width)");
    },
    m(o, a) {
      ws(o, t, a), l && l.m(t, null), i = !0;
    },
    p(o, a) {
      l && l.p && (!i || a & /*$$scope*/
      131072) && Ss(
        l,
        r,
        o,
        /*$$scope*/
        o[17],
        i ? bs(
          r,
          /*$$scope*/
          o[17],
          a,
          null
        ) : ps(
          /*$$scope*/
          o[17]
        ),
        null
      ), Di(
        /*tag*/
        o[14]
      )(t, u = vs(s, [
        (!i || a & /*test_id*/
        128) && { "data-testid": (
          /*test_id*/
          o[7]
        ) },
        (!i || a & /*elem_id*/
        4) && { id: (
          /*elem_id*/
          o[2]
        ) },
        (!i || a & /*elem_classes*/
        8 && n !== (n = "block " + /*elem_classes*/
        o[3].join(" ") + " svelte-nl1om8")) && { class: n }
      ])), He(
        t,
        "hidden",
        /*visible*/
        o[10] === !1
      ), He(
        t,
        "padded",
        /*padding*/
        o[6]
      ), He(
        t,
        "border_focus",
        /*border_mode*/
        o[5] === "focus"
      ), He(
        t,
        "border_contrast",
        /*border_mode*/
        o[5] === "contrast"
      ), He(t, "hide-container", !/*explicit_call*/
      o[8] && !/*container*/
      o[9]), a & /*height*/
      1 && ue(
        t,
        "height",
        /*get_dimension*/
        o[15](
          /*height*/
          o[0]
        )
      ), a & /*width*/
      2 && ue(t, "width", typeof /*width*/
      o[1] == "number" ? `calc(min(${/*width*/
      o[1]}px, 100%))` : (
        /*get_dimension*/
        o[15](
          /*width*/
          o[1]
        )
      )), a & /*variant*/
      16 && ue(
        t,
        "border-style",
        /*variant*/
        o[4]
      ), a & /*allow_overflow*/
      2048 && ue(
        t,
        "overflow",
        /*allow_overflow*/
        o[11] ? "visible" : "hidden"
      ), a & /*scale*/
      4096 && ue(
        t,
        "flex-grow",
        /*scale*/
        o[12]
      ), a & /*min_width*/
      8192 && ue(t, "min-width", `calc(min(${/*min_width*/
      o[13]}px, 100%))`);
    },
    i(o) {
      i || (al(l, o), i = !0);
    },
    o(o) {
      ul(l, o), i = !1;
    },
    d(o) {
      o && ms(t), l && l.d(o);
    }
  };
}
function Ts(e) {
  let t, n = (
    /*tag*/
    e[14] && ks(e)
  );
  return {
    c() {
      n && n.c();
    },
    m(i, r) {
      n && n.m(i, r), t = !0;
    },
    p(i, [r]) {
      /*tag*/
      i[14] && n.p(i, r);
    },
    i(i) {
      t || (al(n, i), t = !0);
    },
    o(i) {
      ul(n, i), t = !1;
    },
    d(i) {
      n && n.d(i);
    }
  };
}
function Bs(e, t, n) {
  let { $$slots: i = {}, $$scope: r } = t, { height: l = void 0 } = t, { width: s = void 0 } = t, { elem_id: u = "" } = t, { elem_classes: o = [] } = t, { variant: a = "solid" } = t, { border_mode: f = "base" } = t, { padding: c = !0 } = t, { type: _ = "normal" } = t, { test_id: h = void 0 } = t, { explicit_call: d = !1 } = t, { container: w = !0 } = t, { visible: y = !0 } = t, { allow_overflow: v = !0 } = t, { scale: p = null } = t, { min_width: g = 0 } = t, T = _ === "fieldset" ? "fieldset" : "div";
  const E = (S) => {
    if (S !== void 0) {
      if (typeof S == "number")
        return S + "px";
      if (typeof S == "string")
        return S;
    }
  };
  return e.$$set = (S) => {
    "height" in S && n(0, l = S.height), "width" in S && n(1, s = S.width), "elem_id" in S && n(2, u = S.elem_id), "elem_classes" in S && n(3, o = S.elem_classes), "variant" in S && n(4, a = S.variant), "border_mode" in S && n(5, f = S.border_mode), "padding" in S && n(6, c = S.padding), "type" in S && n(16, _ = S.type), "test_id" in S && n(7, h = S.test_id), "explicit_call" in S && n(8, d = S.explicit_call), "container" in S && n(9, w = S.container), "visible" in S && n(10, y = S.visible), "allow_overflow" in S && n(11, v = S.allow_overflow), "scale" in S && n(12, p = S.scale), "min_width" in S && n(13, g = S.min_width), "$$scope" in S && n(17, r = S.$$scope);
  }, [
    l,
    s,
    u,
    o,
    a,
    f,
    c,
    h,
    d,
    w,
    y,
    v,
    p,
    g,
    T,
    E,
    _,
    r,
    i
  ];
}
class As extends hs {
  constructor(t) {
    super(), ys(this, t, Bs, Ts, Es, {
      height: 0,
      width: 1,
      elem_id: 2,
      elem_classes: 3,
      variant: 4,
      border_mode: 5,
      padding: 6,
      type: 16,
      test_id: 7,
      explicit_call: 8,
      container: 9,
      visible: 10,
      allow_overflow: 11,
      scale: 12,
      min_width: 13
    });
  }
}
const {
  SvelteComponent: Hs,
  append: In,
  attr: Qt,
  create_component: Cs,
  destroy_component: Ps,
  detach: Ns,
  element: Ri,
  init: Is,
  insert: Os,
  mount_component: Ls,
  safe_not_equal: Ms,
  set_data: Ds,
  space: Rs,
  text: Us,
  toggle_class: xe,
  transition_in: Fs,
  transition_out: Gs
} = window.__gradio__svelte__internal;
function qs(e) {
  let t, n, i, r, l, s;
  return i = new /*Icon*/
  e[1]({}), {
    c() {
      t = Ri("label"), n = Ri("span"), Cs(i.$$.fragment), r = Rs(), l = Us(
        /*label*/
        e[0]
      ), Qt(n, "class", "svelte-9gxdi0"), Qt(t, "for", ""), Qt(t, "data-testid", "block-label"), Qt(t, "class", "svelte-9gxdi0"), xe(t, "hide", !/*show_label*/
      e[2]), xe(t, "sr-only", !/*show_label*/
      e[2]), xe(
        t,
        "float",
        /*float*/
        e[4]
      ), xe(
        t,
        "hide-label",
        /*disable*/
        e[3]
      );
    },
    m(u, o) {
      Os(u, t, o), In(t, n), Ls(i, n, null), In(t, r), In(t, l), s = !0;
    },
    p(u, [o]) {
      (!s || o & /*label*/
      1) && Ds(
        l,
        /*label*/
        u[0]
      ), (!s || o & /*show_label*/
      4) && xe(t, "hide", !/*show_label*/
      u[2]), (!s || o & /*show_label*/
      4) && xe(t, "sr-only", !/*show_label*/
      u[2]), (!s || o & /*float*/
      16) && xe(
        t,
        "float",
        /*float*/
        u[4]
      ), (!s || o & /*disable*/
      8) && xe(
        t,
        "hide-label",
        /*disable*/
        u[3]
      );
    },
    i(u) {
      s || (Fs(i.$$.fragment, u), s = !0);
    },
    o(u) {
      Gs(i.$$.fragment, u), s = !1;
    },
    d(u) {
      u && Ns(t), Ps(i);
    }
  };
}
function xs(e, t, n) {
  let { label: i = null } = t, { Icon: r } = t, { show_label: l = !0 } = t, { disable: s = !1 } = t, { float: u = !0 } = t;
  return e.$$set = (o) => {
    "label" in o && n(0, i = o.label), "Icon" in o && n(1, r = o.Icon), "show_label" in o && n(2, l = o.show_label), "disable" in o && n(3, s = o.disable), "float" in o && n(4, u = o.float);
  }, [i, r, l, s, u];
}
class fl extends Hs {
  constructor(t) {
    super(), Is(this, t, xs, qs, Ms, {
      label: 0,
      Icon: 1,
      show_label: 2,
      disable: 3,
      float: 4
    });
  }
}
const {
  SvelteComponent: js,
  append: ni,
  attr: Le,
  bubble: zs,
  create_component: Vs,
  destroy_component: Xs,
  detach: cl,
  element: ii,
  init: Ws,
  insert: hl,
  listen: Zs,
  mount_component: Js,
  safe_not_equal: Qs,
  set_data: Ys,
  set_style: _t,
  space: Ks,
  text: $s,
  toggle_class: se,
  transition_in: eo,
  transition_out: to
} = window.__gradio__svelte__internal;
function Ui(e) {
  let t, n;
  return {
    c() {
      t = ii("span"), n = $s(
        /*label*/
        e[1]
      ), Le(t, "class", "svelte-1lrphxw");
    },
    m(i, r) {
      hl(i, t, r), ni(t, n);
    },
    p(i, r) {
      r & /*label*/
      2 && Ys(
        n,
        /*label*/
        i[1]
      );
    },
    d(i) {
      i && cl(t);
    }
  };
}
function no(e) {
  let t, n, i, r, l, s, u, o = (
    /*show_label*/
    e[2] && Ui(e)
  );
  return r = new /*Icon*/
  e[0]({}), {
    c() {
      t = ii("button"), o && o.c(), n = Ks(), i = ii("div"), Vs(r.$$.fragment), Le(i, "class", "svelte-1lrphxw"), se(
        i,
        "small",
        /*size*/
        e[4] === "small"
      ), se(
        i,
        "large",
        /*size*/
        e[4] === "large"
      ), se(
        i,
        "medium",
        /*size*/
        e[4] === "medium"
      ), t.disabled = /*disabled*/
      e[7], Le(
        t,
        "aria-label",
        /*label*/
        e[1]
      ), Le(
        t,
        "aria-haspopup",
        /*hasPopup*/
        e[8]
      ), Le(
        t,
        "title",
        /*label*/
        e[1]
      ), Le(t, "class", "svelte-1lrphxw"), se(
        t,
        "pending",
        /*pending*/
        e[3]
      ), se(
        t,
        "padded",
        /*padded*/
        e[5]
      ), se(
        t,
        "highlight",
        /*highlight*/
        e[6]
      ), se(
        t,
        "transparent",
        /*transparent*/
        e[9]
      ), _t(t, "color", !/*disabled*/
      e[7] && /*_color*/
      e[12] ? (
        /*_color*/
        e[12]
      ) : "var(--block-label-text-color)"), _t(t, "--bg-color", /*disabled*/
      e[7] ? "auto" : (
        /*background*/
        e[10]
      )), _t(
        t,
        "margin-left",
        /*offset*/
        e[11] + "px"
      );
    },
    m(a, f) {
      hl(a, t, f), o && o.m(t, null), ni(t, n), ni(t, i), Js(r, i, null), l = !0, s || (u = Zs(
        t,
        "click",
        /*click_handler*/
        e[14]
      ), s = !0);
    },
    p(a, [f]) {
      /*show_label*/
      a[2] ? o ? o.p(a, f) : (o = Ui(a), o.c(), o.m(t, n)) : o && (o.d(1), o = null), (!l || f & /*size*/
      16) && se(
        i,
        "small",
        /*size*/
        a[4] === "small"
      ), (!l || f & /*size*/
      16) && se(
        i,
        "large",
        /*size*/
        a[4] === "large"
      ), (!l || f & /*size*/
      16) && se(
        i,
        "medium",
        /*size*/
        a[4] === "medium"
      ), (!l || f & /*disabled*/
      128) && (t.disabled = /*disabled*/
      a[7]), (!l || f & /*label*/
      2) && Le(
        t,
        "aria-label",
        /*label*/
        a[1]
      ), (!l || f & /*hasPopup*/
      256) && Le(
        t,
        "aria-haspopup",
        /*hasPopup*/
        a[8]
      ), (!l || f & /*label*/
      2) && Le(
        t,
        "title",
        /*label*/
        a[1]
      ), (!l || f & /*pending*/
      8) && se(
        t,
        "pending",
        /*pending*/
        a[3]
      ), (!l || f & /*padded*/
      32) && se(
        t,
        "padded",
        /*padded*/
        a[5]
      ), (!l || f & /*highlight*/
      64) && se(
        t,
        "highlight",
        /*highlight*/
        a[6]
      ), (!l || f & /*transparent*/
      512) && se(
        t,
        "transparent",
        /*transparent*/
        a[9]
      ), f & /*disabled, _color*/
      4224 && _t(t, "color", !/*disabled*/
      a[7] && /*_color*/
      a[12] ? (
        /*_color*/
        a[12]
      ) : "var(--block-label-text-color)"), f & /*disabled, background*/
      1152 && _t(t, "--bg-color", /*disabled*/
      a[7] ? "auto" : (
        /*background*/
        a[10]
      )), f & /*offset*/
      2048 && _t(
        t,
        "margin-left",
        /*offset*/
        a[11] + "px"
      );
    },
    i(a) {
      l || (eo(r.$$.fragment, a), l = !0);
    },
    o(a) {
      to(r.$$.fragment, a), l = !1;
    },
    d(a) {
      a && cl(t), o && o.d(), Xs(r), s = !1, u();
    }
  };
}
function io(e, t, n) {
  let i, { Icon: r } = t, { label: l = "" } = t, { show_label: s = !1 } = t, { pending: u = !1 } = t, { size: o = "small" } = t, { padded: a = !0 } = t, { highlight: f = !1 } = t, { disabled: c = !1 } = t, { hasPopup: _ = !1 } = t, { color: h = "var(--block-label-text-color)" } = t, { transparent: d = !1 } = t, { background: w = "var(--background-fill-primary)" } = t, { offset: y = 0 } = t;
  function v(p) {
    zs.call(this, e, p);
  }
  return e.$$set = (p) => {
    "Icon" in p && n(0, r = p.Icon), "label" in p && n(1, l = p.label), "show_label" in p && n(2, s = p.show_label), "pending" in p && n(3, u = p.pending), "size" in p && n(4, o = p.size), "padded" in p && n(5, a = p.padded), "highlight" in p && n(6, f = p.highlight), "disabled" in p && n(7, c = p.disabled), "hasPopup" in p && n(8, _ = p.hasPopup), "color" in p && n(13, h = p.color), "transparent" in p && n(9, d = p.transparent), "background" in p && n(10, w = p.background), "offset" in p && n(11, y = p.offset);
  }, e.$$.update = () => {
    e.$$.dirty & /*highlight, color*/
    8256 && n(12, i = f ? "var(--color-accent)" : h);
  }, [
    r,
    l,
    s,
    u,
    o,
    a,
    f,
    c,
    _,
    d,
    w,
    y,
    i,
    h,
    v
  ];
}
let ro = class extends js {
  constructor(t) {
    super(), Ws(this, t, io, no, Qs, {
      Icon: 0,
      label: 1,
      show_label: 2,
      pending: 3,
      size: 4,
      padded: 5,
      highlight: 6,
      disabled: 7,
      hasPopup: 8,
      color: 13,
      transparent: 9,
      background: 10,
      offset: 11
    });
  }
};
const {
  SvelteComponent: lo,
  append: so,
  attr: On,
  binding_callbacks: oo,
  create_slot: ao,
  detach: uo,
  element: Fi,
  get_all_dirty_from_scope: fo,
  get_slot_changes: co,
  init: ho,
  insert: _o,
  safe_not_equal: mo,
  toggle_class: je,
  transition_in: go,
  transition_out: po,
  update_slot_base: bo
} = window.__gradio__svelte__internal;
function vo(e) {
  let t, n, i;
  const r = (
    /*#slots*/
    e[5].default
  ), l = ao(
    r,
    e,
    /*$$scope*/
    e[4],
    null
  );
  return {
    c() {
      t = Fi("div"), n = Fi("div"), l && l.c(), On(n, "class", "icon svelte-3w3rth"), On(t, "class", "empty svelte-3w3rth"), On(t, "aria-label", "Empty value"), je(
        t,
        "small",
        /*size*/
        e[0] === "small"
      ), je(
        t,
        "large",
        /*size*/
        e[0] === "large"
      ), je(
        t,
        "unpadded_box",
        /*unpadded_box*/
        e[1]
      ), je(
        t,
        "small_parent",
        /*parent_height*/
        e[3]
      );
    },
    m(s, u) {
      _o(s, t, u), so(t, n), l && l.m(n, null), e[6](t), i = !0;
    },
    p(s, [u]) {
      l && l.p && (!i || u & /*$$scope*/
      16) && bo(
        l,
        r,
        s,
        /*$$scope*/
        s[4],
        i ? co(
          r,
          /*$$scope*/
          s[4],
          u,
          null
        ) : fo(
          /*$$scope*/
          s[4]
        ),
        null
      ), (!i || u & /*size*/
      1) && je(
        t,
        "small",
        /*size*/
        s[0] === "small"
      ), (!i || u & /*size*/
      1) && je(
        t,
        "large",
        /*size*/
        s[0] === "large"
      ), (!i || u & /*unpadded_box*/
      2) && je(
        t,
        "unpadded_box",
        /*unpadded_box*/
        s[1]
      ), (!i || u & /*parent_height*/
      8) && je(
        t,
        "small_parent",
        /*parent_height*/
        s[3]
      );
    },
    i(s) {
      i || (go(l, s), i = !0);
    },
    o(s) {
      po(l, s), i = !1;
    },
    d(s) {
      s && uo(t), l && l.d(s), e[6](null);
    }
  };
}
function yo(e) {
  let t, n = e[0], i = 1;
  for (; i < e.length; ) {
    const r = e[i], l = e[i + 1];
    if (i += 2, (r === "optionalAccess" || r === "optionalCall") && n == null)
      return;
    r === "access" || r === "optionalAccess" ? (t = n, n = l(n)) : (r === "call" || r === "optionalCall") && (n = l((...s) => n.call(t, ...s)), t = void 0);
  }
  return n;
}
function wo(e, t, n) {
  let i, { $$slots: r = {}, $$scope: l } = t, { size: s = "small" } = t, { unpadded_box: u = !1 } = t, o;
  function a(c) {
    if (!c)
      return !1;
    const { height: _ } = c.getBoundingClientRect(), { height: h } = yo([
      c,
      "access",
      (d) => d.parentElement,
      "optionalAccess",
      (d) => d.getBoundingClientRect,
      "call",
      (d) => d()
    ]) || { height: _ };
    return _ > h + 2;
  }
  function f(c) {
    oo[c ? "unshift" : "push"](() => {
      o = c, n(2, o);
    });
  }
  return e.$$set = (c) => {
    "size" in c && n(0, s = c.size), "unpadded_box" in c && n(1, u = c.unpadded_box), "$$scope" in c && n(4, l = c.$$scope);
  }, e.$$.update = () => {
    e.$$.dirty & /*el*/
    4 && n(3, i = a(o));
  }, [s, u, o, i, l, r, f];
}
class Eo extends lo {
  constructor(t) {
    super(), ho(this, t, wo, vo, mo, { size: 0, unpadded_box: 1 });
  }
}
const {
  SvelteComponent: So,
  append: ko,
  attr: Yt,
  detach: To,
  init: Bo,
  insert: Ao,
  noop: Ln,
  safe_not_equal: Ho,
  svg_element: Gi
} = window.__gradio__svelte__internal;
function Co(e) {
  let t, n;
  return {
    c() {
      t = Gi("svg"), n = Gi("path"), Yt(n, "fill", "currentColor"), Yt(n, "d", "M13.75 2a2.25 2.25 0 0 1 2.236 2.002V4h1.764A2.25 2.25 0 0 1 20 6.25V11h-1.5V6.25a.75.75 0 0 0-.75-.75h-2.129c-.404.603-1.091 1-1.871 1h-3.5c-.78 0-1.467-.397-1.871-1H6.25a.75.75 0 0 0-.75.75v13.5c0 .414.336.75.75.75h4.78a4 4 0 0 0 .505 1.5H6.25A2.25 2.25 0 0 1 4 19.75V6.25A2.25 2.25 0 0 1 6.25 4h1.764a2.25 2.25 0 0 1 2.236-2zm2.245 2.096L16 4.25q0-.078-.005-.154M13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5M15 12a3 3 0 0 0-3 3v5c0 .556.151 1.077.415 1.524l3.494-3.494a2.25 2.25 0 0 1 3.182 0l3.494 3.494c.264-.447.415-.968.415-1.524v-5a3 3 0 0 0-3-3zm0 11a3 3 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A3 3 0 0 1 20 23zm5-7a1 1 0 1 1 0-2 1 1 0 0 1 0 2"), Yt(t, "xmlns", "http://www.w3.org/2000/svg"), Yt(t, "viewBox", "0 0 24 24");
    },
    m(i, r) {
      Ao(i, t, r), ko(t, n);
    },
    p: Ln,
    i: Ln,
    o: Ln,
    d(i) {
      i && To(t);
    }
  };
}
class Po extends So {
  constructor(t) {
    super(), Bo(this, t, null, Co, Ho, {});
  }
}
const {
  SvelteComponent: No,
  append: Mn,
  attr: te,
  detach: Io,
  init: Oo,
  insert: Lo,
  noop: Dn,
  safe_not_equal: Mo,
  svg_element: Kt
} = window.__gradio__svelte__internal;
function Do(e) {
  let t, n, i, r;
  return {
    c() {
      t = Kt("svg"), n = Kt("path"), i = Kt("polyline"), r = Kt("line"), te(n, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), te(i, "points", "17 8 12 3 7 8"), te(r, "x1", "12"), te(r, "y1", "3"), te(r, "x2", "12"), te(r, "y2", "15"), te(t, "xmlns", "http://www.w3.org/2000/svg"), te(t, "width", "90%"), te(t, "height", "90%"), te(t, "viewBox", "0 0 24 24"), te(t, "fill", "none"), te(t, "stroke", "currentColor"), te(t, "stroke-width", "2"), te(t, "stroke-linecap", "round"), te(t, "stroke-linejoin", "round"), te(t, "class", "feather feather-upload");
    },
    m(l, s) {
      Lo(l, t, s), Mn(t, n), Mn(t, i), Mn(t, r);
    },
    p: Dn,
    i: Dn,
    o: Dn,
    d(l) {
      l && Io(t);
    }
  };
}
let Ro = class extends No {
  constructor(t) {
    super(), Oo(this, t, null, Do, Mo, {});
  }
};
const Uo = [
  { color: "red", primary: 600, secondary: 100 },
  { color: "green", primary: 600, secondary: 100 },
  { color: "blue", primary: 600, secondary: 100 },
  { color: "yellow", primary: 500, secondary: 100 },
  { color: "purple", primary: 600, secondary: 100 },
  { color: "teal", primary: 600, secondary: 100 },
  { color: "orange", primary: 600, secondary: 100 },
  { color: "cyan", primary: 600, secondary: 100 },
  { color: "lime", primary: 500, secondary: 100 },
  { color: "pink", primary: 600, secondary: 100 }
], qi = {
  inherit: "inherit",
  current: "currentColor",
  transparent: "transparent",
  black: "#000",
  white: "#fff",
  slate: {
    50: "#f8fafc",
    100: "#f1f5f9",
    200: "#e2e8f0",
    300: "#cbd5e1",
    400: "#94a3b8",
    500: "#64748b",
    600: "#475569",
    700: "#334155",
    800: "#1e293b",
    900: "#0f172a",
    950: "#020617"
  },
  gray: {
    50: "#f9fafb",
    100: "#f3f4f6",
    200: "#e5e7eb",
    300: "#d1d5db",
    400: "#9ca3af",
    500: "#6b7280",
    600: "#4b5563",
    700: "#374151",
    800: "#1f2937",
    900: "#111827",
    950: "#030712"
  },
  zinc: {
    50: "#fafafa",
    100: "#f4f4f5",
    200: "#e4e4e7",
    300: "#d4d4d8",
    400: "#a1a1aa",
    500: "#71717a",
    600: "#52525b",
    700: "#3f3f46",
    800: "#27272a",
    900: "#18181b",
    950: "#09090b"
  },
  neutral: {
    50: "#fafafa",
    100: "#f5f5f5",
    200: "#e5e5e5",
    300: "#d4d4d4",
    400: "#a3a3a3",
    500: "#737373",
    600: "#525252",
    700: "#404040",
    800: "#262626",
    900: "#171717",
    950: "#0a0a0a"
  },
  stone: {
    50: "#fafaf9",
    100: "#f5f5f4",
    200: "#e7e5e4",
    300: "#d6d3d1",
    400: "#a8a29e",
    500: "#78716c",
    600: "#57534e",
    700: "#44403c",
    800: "#292524",
    900: "#1c1917",
    950: "#0c0a09"
  },
  red: {
    50: "#fef2f2",
    100: "#fee2e2",
    200: "#fecaca",
    300: "#fca5a5",
    400: "#f87171",
    500: "#ef4444",
    600: "#dc2626",
    700: "#b91c1c",
    800: "#991b1b",
    900: "#7f1d1d",
    950: "#450a0a"
  },
  orange: {
    50: "#fff7ed",
    100: "#ffedd5",
    200: "#fed7aa",
    300: "#fdba74",
    400: "#fb923c",
    500: "#f97316",
    600: "#ea580c",
    700: "#c2410c",
    800: "#9a3412",
    900: "#7c2d12",
    950: "#431407"
  },
  amber: {
    50: "#fffbeb",
    100: "#fef3c7",
    200: "#fde68a",
    300: "#fcd34d",
    400: "#fbbf24",
    500: "#f59e0b",
    600: "#d97706",
    700: "#b45309",
    800: "#92400e",
    900: "#78350f",
    950: "#451a03"
  },
  yellow: {
    50: "#fefce8",
    100: "#fef9c3",
    200: "#fef08a",
    300: "#fde047",
    400: "#facc15",
    500: "#eab308",
    600: "#ca8a04",
    700: "#a16207",
    800: "#854d0e",
    900: "#713f12",
    950: "#422006"
  },
  lime: {
    50: "#f7fee7",
    100: "#ecfccb",
    200: "#d9f99d",
    300: "#bef264",
    400: "#a3e635",
    500: "#84cc16",
    600: "#65a30d",
    700: "#4d7c0f",
    800: "#3f6212",
    900: "#365314",
    950: "#1a2e05"
  },
  green: {
    50: "#f0fdf4",
    100: "#dcfce7",
    200: "#bbf7d0",
    300: "#86efac",
    400: "#4ade80",
    500: "#22c55e",
    600: "#16a34a",
    700: "#15803d",
    800: "#166534",
    900: "#14532d",
    950: "#052e16"
  },
  emerald: {
    50: "#ecfdf5",
    100: "#d1fae5",
    200: "#a7f3d0",
    300: "#6ee7b7",
    400: "#34d399",
    500: "#10b981",
    600: "#059669",
    700: "#047857",
    800: "#065f46",
    900: "#064e3b",
    950: "#022c22"
  },
  teal: {
    50: "#f0fdfa",
    100: "#ccfbf1",
    200: "#99f6e4",
    300: "#5eead4",
    400: "#2dd4bf",
    500: "#14b8a6",
    600: "#0d9488",
    700: "#0f766e",
    800: "#115e59",
    900: "#134e4a",
    950: "#042f2e"
  },
  cyan: {
    50: "#ecfeff",
    100: "#cffafe",
    200: "#a5f3fc",
    300: "#67e8f9",
    400: "#22d3ee",
    500: "#06b6d4",
    600: "#0891b2",
    700: "#0e7490",
    800: "#155e75",
    900: "#164e63",
    950: "#083344"
  },
  sky: {
    50: "#f0f9ff",
    100: "#e0f2fe",
    200: "#bae6fd",
    300: "#7dd3fc",
    400: "#38bdf8",
    500: "#0ea5e9",
    600: "#0284c7",
    700: "#0369a1",
    800: "#075985",
    900: "#0c4a6e",
    950: "#082f49"
  },
  blue: {
    50: "#eff6ff",
    100: "#dbeafe",
    200: "#bfdbfe",
    300: "#93c5fd",
    400: "#60a5fa",
    500: "#3b82f6",
    600: "#2563eb",
    700: "#1d4ed8",
    800: "#1e40af",
    900: "#1e3a8a",
    950: "#172554"
  },
  indigo: {
    50: "#eef2ff",
    100: "#e0e7ff",
    200: "#c7d2fe",
    300: "#a5b4fc",
    400: "#818cf8",
    500: "#6366f1",
    600: "#4f46e5",
    700: "#4338ca",
    800: "#3730a3",
    900: "#312e81",
    950: "#1e1b4b"
  },
  violet: {
    50: "#f5f3ff",
    100: "#ede9fe",
    200: "#ddd6fe",
    300: "#c4b5fd",
    400: "#a78bfa",
    500: "#8b5cf6",
    600: "#7c3aed",
    700: "#6d28d9",
    800: "#5b21b6",
    900: "#4c1d95",
    950: "#2e1065"
  },
  purple: {
    50: "#faf5ff",
    100: "#f3e8ff",
    200: "#e9d5ff",
    300: "#d8b4fe",
    400: "#c084fc",
    500: "#a855f7",
    600: "#9333ea",
    700: "#7e22ce",
    800: "#6b21a8",
    900: "#581c87",
    950: "#3b0764"
  },
  fuchsia: {
    50: "#fdf4ff",
    100: "#fae8ff",
    200: "#f5d0fe",
    300: "#f0abfc",
    400: "#e879f9",
    500: "#d946ef",
    600: "#c026d3",
    700: "#a21caf",
    800: "#86198f",
    900: "#701a75",
    950: "#4a044e"
  },
  pink: {
    50: "#fdf2f8",
    100: "#fce7f3",
    200: "#fbcfe8",
    300: "#f9a8d4",
    400: "#f472b6",
    500: "#ec4899",
    600: "#db2777",
    700: "#be185d",
    800: "#9d174d",
    900: "#831843",
    950: "#500724"
  },
  rose: {
    50: "#fff1f2",
    100: "#ffe4e6",
    200: "#fecdd3",
    300: "#fda4af",
    400: "#fb7185",
    500: "#f43f5e",
    600: "#e11d48",
    700: "#be123c",
    800: "#9f1239",
    900: "#881337",
    950: "#4c0519"
  }
};
Uo.reduce(
  (e, { color: t, primary: n, secondary: i }) => ({
    ...e,
    [t]: {
      primary: qi[t][n],
      secondary: qi[t][i]
    }
  }),
  {}
);
const {
  SvelteComponent: Fo,
  append: tt,
  attr: ri,
  check_outros: Go,
  create_component: _l,
  destroy_component: dl,
  detach: sn,
  element: li,
  group_outros: qo,
  init: xo,
  insert: on,
  mount_component: ml,
  safe_not_equal: jo,
  set_data: si,
  space: oi,
  text: Dt,
  toggle_class: xi,
  transition_in: fn,
  transition_out: cn
} = window.__gradio__svelte__internal;
function zo(e) {
  let t, n;
  return t = new Ro({}), {
    c() {
      _l(t.$$.fragment);
    },
    m(i, r) {
      ml(t, i, r), n = !0;
    },
    i(i) {
      n || (fn(t.$$.fragment, i), n = !0);
    },
    o(i) {
      cn(t.$$.fragment, i), n = !1;
    },
    d(i) {
      dl(t, i);
    }
  };
}
function Vo(e) {
  let t, n;
  return t = new Po({}), {
    c() {
      _l(t.$$.fragment);
    },
    m(i, r) {
      ml(t, i, r), n = !0;
    },
    i(i) {
      n || (fn(t.$$.fragment, i), n = !0);
    },
    o(i) {
      cn(t.$$.fragment, i), n = !1;
    },
    d(i) {
      dl(t, i);
    }
  };
}
function ji(e) {
  let t, n, i = (
    /*i18n*/
    e[1]("common.or") + ""
  ), r, l, s, u = (
    /*message*/
    (e[2] || /*i18n*/
    e[1]("upload_text.click_to_upload")) + ""
  ), o;
  return {
    c() {
      t = li("span"), n = Dt("- "), r = Dt(i), l = Dt(" -"), s = oi(), o = Dt(u), ri(t, "class", "or svelte-kzcjhc");
    },
    m(a, f) {
      on(a, t, f), tt(t, n), tt(t, r), tt(t, l), on(a, s, f), on(a, o, f);
    },
    p(a, f) {
      f & /*i18n*/
      2 && i !== (i = /*i18n*/
      a[1]("common.or") + "") && si(r, i), f & /*message, i18n*/
      6 && u !== (u = /*message*/
      (a[2] || /*i18n*/
      a[1]("upload_text.click_to_upload")) + "") && si(o, u);
    },
    d(a) {
      a && (sn(t), sn(s), sn(o));
    }
  };
}
function Xo(e) {
  let t, n, i, r, l, s = (
    /*i18n*/
    e[1](
      /*defs*/
      e[5][
        /*type*/
        e[0]
      ] || /*defs*/
      e[5].file
    ) + ""
  ), u, o, a;
  const f = [Vo, zo], c = [];
  function _(d, w) {
    return (
      /*type*/
      d[0] === "clipboard" ? 0 : 1
    );
  }
  i = _(e), r = c[i] = f[i](e);
  let h = (
    /*mode*/
    e[3] !== "short" && ji(e)
  );
  return {
    c() {
      t = li("div"), n = li("span"), r.c(), l = oi(), u = Dt(s), o = oi(), h && h.c(), ri(n, "class", "icon-wrap svelte-kzcjhc"), xi(
        n,
        "hovered",
        /*hovered*/
        e[4]
      ), ri(t, "class", "wrap svelte-kzcjhc");
    },
    m(d, w) {
      on(d, t, w), tt(t, n), c[i].m(n, null), tt(t, l), tt(t, u), tt(t, o), h && h.m(t, null), a = !0;
    },
    p(d, [w]) {
      let y = i;
      i = _(d), i !== y && (qo(), cn(c[y], 1, 1, () => {
        c[y] = null;
      }), Go(), r = c[i], r || (r = c[i] = f[i](d), r.c()), fn(r, 1), r.m(n, null)), (!a || w & /*hovered*/
      16) && xi(
        n,
        "hovered",
        /*hovered*/
        d[4]
      ), (!a || w & /*i18n, type*/
      3) && s !== (s = /*i18n*/
      d[1](
        /*defs*/
        d[5][
          /*type*/
          d[0]
        ] || /*defs*/
        d[5].file
      ) + "") && si(u, s), /*mode*/
      d[3] !== "short" ? h ? h.p(d, w) : (h = ji(d), h.c(), h.m(t, null)) : h && (h.d(1), h = null);
    },
    i(d) {
      a || (fn(r), a = !0);
    },
    o(d) {
      cn(r), a = !1;
    },
    d(d) {
      d && sn(t), c[i].d(), h && h.d();
    }
  };
}
function Wo(e, t, n) {
  let { type: i = "file" } = t, { i18n: r } = t, { message: l = void 0 } = t, { mode: s = "full" } = t, { hovered: u = !1 } = t;
  const o = {
    image: "upload_text.drop_image",
    video: "upload_text.drop_video",
    audio: "upload_text.drop_audio",
    file: "upload_text.drop_file",
    csv: "upload_text.drop_csv",
    gallery: "upload_text.drop_gallery",
    clipboard: "upload_text.paste_clipboard"
  };
  return e.$$set = (a) => {
    "type" in a && n(0, i = a.type), "i18n" in a && n(1, r = a.i18n), "message" in a && n(2, l = a.message), "mode" in a && n(3, s = a.mode), "hovered" in a && n(4, u = a.hovered);
  }, [i, r, l, s, u, o];
}
class Zo extends Fo {
  constructor(t) {
    super(), xo(this, t, Wo, Xo, jo, {
      type: 0,
      i18n: 1,
      message: 2,
      mode: 3,
      hovered: 4
    });
  }
}
const {
  SvelteComponent: Jo,
  append: Rn,
  attr: ke,
  detach: Qo,
  init: Yo,
  insert: Ko,
  noop: Un,
  safe_not_equal: $o,
  set_style: Ce,
  svg_element: $t
} = window.__gradio__svelte__internal;
function ea(e) {
  let t, n, i, r;
  return {
    c() {
      t = $t("svg"), n = $t("g"), i = $t("path"), r = $t("path"), ke(i, "d", "M18,6L6.087,17.913"), Ce(i, "fill", "none"), Ce(i, "fill-rule", "nonzero"), Ce(i, "stroke-width", "2px"), ke(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), ke(r, "d", "M4.364,4.364L19.636,19.636"), Ce(r, "fill", "none"), Ce(r, "fill-rule", "nonzero"), Ce(r, "stroke-width", "2px"), ke(t, "width", "100%"), ke(t, "height", "100%"), ke(t, "viewBox", "0 0 24 24"), ke(t, "version", "1.1"), ke(t, "xmlns", "http://www.w3.org/2000/svg"), ke(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), ke(t, "xml:space", "preserve"), ke(t, "stroke", "currentColor"), Ce(t, "fill-rule", "evenodd"), Ce(t, "clip-rule", "evenodd"), Ce(t, "stroke-linecap", "round"), Ce(t, "stroke-linejoin", "round");
    },
    m(l, s) {
      Ko(l, t, s), Rn(t, n), Rn(n, i), Rn(t, r);
    },
    p: Un,
    i: Un,
    o: Un,
    d(l) {
      l && Qo(t);
    }
  };
}
class ta extends Jo {
  constructor(t) {
    super(), Yo(this, t, null, ea, $o, {});
  }
}
const {
  SvelteComponent: na,
  append: ia,
  attr: dt,
  detach: ra,
  init: la,
  insert: sa,
  noop: Fn,
  safe_not_equal: oa,
  svg_element: zi
} = window.__gradio__svelte__internal;
function aa(e) {
  let t, n;
  return {
    c() {
      t = zi("svg"), n = zi("path"), dt(n, "fill", "currentColor"), dt(n, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), dt(t, "xmlns", "http://www.w3.org/2000/svg"), dt(t, "width", "100%"), dt(t, "height", "100%"), dt(t, "viewBox", "0 0 32 32");
    },
    m(i, r) {
      sa(i, t, r), ia(t, n);
    },
    p: Fn,
    i: Fn,
    o: Fn,
    d(i) {
      i && ra(t);
    }
  };
}
class ua extends na {
  constructor(t) {
    super(), la(this, t, null, aa, oa, {});
  }
}
const {
  SvelteComponent: fa,
  append: ca,
  attr: Te,
  detach: ha,
  init: _a,
  insert: da,
  noop: Gn,
  safe_not_equal: ma,
  svg_element: Vi
} = window.__gradio__svelte__internal;
function ga(e) {
  let t, n;
  return {
    c() {
      t = Vi("svg"), n = Vi("path"), Te(n, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), Te(t, "xmlns", "http://www.w3.org/2000/svg"), Te(t, "width", "100%"), Te(t, "height", "100%"), Te(t, "viewBox", "0 0 24 24"), Te(t, "fill", "none"), Te(t, "stroke", "currentColor"), Te(t, "stroke-width", "1.5"), Te(t, "stroke-linecap", "round"), Te(t, "stroke-linejoin", "round"), Te(t, "class", "feather feather-edit-2");
    },
    m(i, r) {
      da(i, t, r), ca(t, n);
    },
    p: Gn,
    i: Gn,
    o: Gn,
    d(i) {
      i && ha(t);
    }
  };
}
class pa extends fa {
  constructor(t) {
    super(), _a(this, t, null, ga, ma, {});
  }
}
const {
  SvelteComponent: ba,
  append: Xi,
  attr: ge,
  detach: va,
  init: ya,
  insert: wa,
  noop: qn,
  safe_not_equal: Ea,
  svg_element: xn
} = window.__gradio__svelte__internal;
function Sa(e) {
  let t, n, i;
  return {
    c() {
      t = xn("svg"), n = xn("path"), i = xn("polyline"), ge(n, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), ge(i, "points", "13 2 13 9 20 9"), ge(t, "xmlns", "http://www.w3.org/2000/svg"), ge(t, "width", "100%"), ge(t, "height", "100%"), ge(t, "viewBox", "0 0 24 24"), ge(t, "fill", "none"), ge(t, "stroke", "currentColor"), ge(t, "stroke-width", "1.5"), ge(t, "stroke-linecap", "round"), ge(t, "stroke-linejoin", "round"), ge(t, "class", "feather feather-file");
    },
    m(r, l) {
      wa(r, t, l), Xi(t, n), Xi(t, i);
    },
    p: qn,
    i: qn,
    o: qn,
    d(r) {
      r && va(t);
    }
  };
}
let Ai = class extends ba {
  constructor(t) {
    super(), ya(this, t, null, Sa, Ea, {});
  }
};
const {
  SvelteComponent: ka,
  append: Wi,
  attr: pe,
  detach: Ta,
  init: Ba,
  insert: Aa,
  noop: jn,
  safe_not_equal: Ha,
  svg_element: zn
} = window.__gradio__svelte__internal;
function Ca(e) {
  let t, n, i;
  return {
    c() {
      t = zn("svg"), n = zn("polyline"), i = zn("path"), pe(n, "points", "1 4 1 10 7 10"), pe(i, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), pe(t, "xmlns", "http://www.w3.org/2000/svg"), pe(t, "width", "100%"), pe(t, "height", "100%"), pe(t, "viewBox", "0 0 24 24"), pe(t, "fill", "none"), pe(t, "stroke", "currentColor"), pe(t, "stroke-width", "2"), pe(t, "stroke-linecap", "round"), pe(t, "stroke-linejoin", "round"), pe(t, "class", "feather feather-rotate-ccw");
    },
    m(r, l) {
      Aa(r, t, l), Wi(t, n), Wi(t, i);
    },
    p: jn,
    i: jn,
    o: jn,
    d(r) {
      r && Ta(t);
    }
  };
}
class Pa extends ka {
  constructor(t) {
    super(), Ba(this, t, null, Ca, Ha, {});
  }
}
const {
  SvelteComponent: Na,
  append: ce,
  attr: $,
  check_outros: gl,
  create_component: Ia,
  destroy_component: Oa,
  destroy_each: La,
  detach: Ue,
  element: ye,
  ensure_array_like: Zi,
  group_outros: pl,
  init: Ma,
  insert: Fe,
  listen: Da,
  mount_component: Ra,
  noop: Ji,
  safe_not_equal: Ua,
  set_data: hn,
  set_style: Qi,
  space: Rt,
  text: Ft,
  toggle_class: Yi,
  transition_in: vt,
  transition_out: Gt
} = window.__gradio__svelte__internal, { createEventDispatcher: Fa } = window.__gradio__svelte__internal;
function Ki(e, t, n) {
  const i = e.slice();
  return i[7] = t[n], i[9] = n, i;
}
function Ga(e) {
  let t = (
    /*i18n*/
    e[2]("file.uploading") + ""
  ), n;
  return {
    c() {
      n = Ft(t);
    },
    m(i, r) {
      Fe(i, n, r);
    },
    p(i, r) {
      r & /*i18n*/
      4 && t !== (t = /*i18n*/
      i[2]("file.uploading") + "") && hn(n, t);
    },
    i: Ji,
    o: Ji,
    d(i) {
      i && Ue(n);
    }
  };
}
function qa(e) {
  let t, n, i, r, l, s;
  return i = new ro({ props: { Icon: ua } }), {
    c() {
      t = ye("button"), n = ye("a"), Ia(i.$$.fragment), $(n, "href", r = /*file*/
      e[7].url), $(n, "target", "_blank"), $(n, "download", l = /*file*/
      e[7].orig_name);
    },
    m(u, o) {
      Fe(u, t, o), ce(t, n), Ra(i, n, null), s = !0;
    },
    p(u, o) {
      (!s || o & /*normalized_files*/
      8 && r !== (r = /*file*/
      u[7].url)) && $(n, "href", r), (!s || o & /*normalized_files*/
      8 && l !== (l = /*file*/
      u[7].orig_name)) && $(n, "download", l);
    },
    i(u) {
      s || (vt(i.$$.fragment, u), s = !0);
    },
    o(u) {
      Gt(i.$$.fragment, u), s = !1;
    },
    d(u) {
      u && Ue(t), Oa(i);
    }
  };
}
function $i(e) {
  let t = console.log("Passing here") + "", n, i, r = tr(
    /*file*/
    e[7].url,
    "file-content-" + /*i*/
    e[9].toString()
  ) + "", l;
  return {
    c() {
      n = Ft(t), i = Rt(), l = Ft(r);
    },
    m(s, u) {
      Fe(s, n, u), Fe(s, i, u), Fe(s, l, u);
    },
    p(s, u) {
      u & /*normalized_files*/
      8 && r !== (r = tr(
        /*file*/
        s[7].url,
        "file-content-" + /*i*/
        s[9].toString()
      ) + "") && hn(l, r);
    },
    d(s) {
      s && (Ue(n), Ue(i), Ue(l));
    }
  };
}
function er(e) {
  let t, n, i, r = (
    /*file*/
    e[7].filename_stem + ""
  ), l, s, u, o = (
    /*file*/
    e[7].filename_ext + ""
  ), a, f, c, _, h, d, w, y, v, p, g, T, E;
  const S = [qa, Ga], D = [];
  function re(x, X) {
    return (
      /*file*/
      x[7].url ? 0 : 1
    );
  }
  h = re(e), d = D[h] = S[h](e);
  function A() {
    return (
      /*click_handler*/
      e[6](
        /*file*/
        e[7],
        /*i*/
        e[9]
      )
    );
  }
  let L = (
    /*file*/
    e[7].url && $i(e)
  );
  return {
    c() {
      t = ye("tr"), n = ye("td"), i = ye("span"), l = Ft(r), s = Rt(), u = ye("span"), a = Ft(o), c = Rt(), _ = ye("td"), d.c(), w = Rt(), y = ye("tr"), v = ye("td"), L && L.c(), p = Rt(), $(i, "class", "stem svelte-a45z3z"), $(u, "class", "ext svelte-a45z3z"), $(n, "class", "filename svelte-a45z3z"), $(n, "aria-label", f = /*file*/
      e[7].orig_name), $(_, "class", "download svelte-a45z3z"), $(t, "class", "file svelte-a45z3z"), Yi(
        t,
        "selectable",
        /*selectable*/
        e[0]
      ), $(y, "class", "file-content svelte-a45z3z"), $(y, "id", "file-content-" + /*i*/
      e[9]);
    },
    m(x, X) {
      Fe(x, t, X), ce(t, n), ce(n, i), ce(i, l), ce(n, s), ce(n, u), ce(u, a), ce(t, c), ce(t, _), D[h].m(_, null), Fe(x, w, X), Fe(x, y, X), ce(y, v), L && L.m(v, null), ce(y, p), g = !0, T || (E = Da(t, "click", A), T = !0);
    },
    p(x, X) {
      e = x, (!g || X & /*normalized_files*/
      8) && r !== (r = /*file*/
      e[7].filename_stem + "") && hn(l, r), (!g || X & /*normalized_files*/
      8) && o !== (o = /*file*/
      e[7].filename_ext + "") && hn(a, o), (!g || X & /*normalized_files*/
      8 && f !== (f = /*file*/
      e[7].orig_name)) && $(n, "aria-label", f);
      let Z = h;
      h = re(e), h === Z ? D[h].p(e, X) : (pl(), Gt(D[Z], 1, 1, () => {
        D[Z] = null;
      }), gl(), d = D[h], d ? d.p(e, X) : (d = D[h] = S[h](e), d.c()), vt(d, 1), d.m(_, null)), (!g || X & /*selectable*/
      1) && Yi(
        t,
        "selectable",
        /*selectable*/
        e[0]
      ), /*file*/
      e[7].url ? L ? L.p(e, X) : (L = $i(e), L.c(), L.m(v, null)) : L && (L.d(1), L = null);
    },
    i(x) {
      g || (vt(d), g = !0);
    },
    o(x) {
      Gt(d), g = !1;
    },
    d(x) {
      x && (Ue(t), Ue(w), Ue(y)), D[h].d(), L && L.d(), T = !1, E();
    }
  };
}
function xa(e) {
  let t, n, i, r, l = Zi(
    /*normalized_files*/
    e[3]
  ), s = [];
  for (let o = 0; o < l.length; o += 1)
    s[o] = er(Ki(e, l, o));
  const u = (o) => Gt(s[o], 1, 1, () => {
    s[o] = null;
  });
  return {
    c() {
      t = ye("div"), n = ye("table"), i = ye("tbody");
      for (let o = 0; o < s.length; o += 1)
        s[o].c();
      $(i, "class", "svelte-a45z3z"), $(n, "class", "file-preview svelte-a45z3z"), $(t, "class", "file-preview-holder"), Qi(t, "max-height", typeof /*height*/
      e[1] === void 0 ? "auto" : (
        /*height*/
        e[1] + "px"
      ));
    },
    m(o, a) {
      Fe(o, t, a), ce(t, n), ce(n, i);
      for (let f = 0; f < s.length; f += 1)
        s[f] && s[f].m(i, null);
      r = !0;
    },
    p(o, [a]) {
      if (a & /*getFileContent, normalized_files, console, selectable, dispatch, i18n*/
      29) {
        l = Zi(
          /*normalized_files*/
          o[3]
        );
        let f;
        for (f = 0; f < l.length; f += 1) {
          const c = Ki(o, l, f);
          s[f] ? (s[f].p(c, a), vt(s[f], 1)) : (s[f] = er(c), s[f].c(), vt(s[f], 1), s[f].m(i, null));
        }
        for (pl(), f = l.length; f < s.length; f += 1)
          u(f);
        gl();
      }
      (!r || a & /*height*/
      2) && Qi(t, "max-height", typeof /*height*/
      o[1] === void 0 ? "auto" : (
        /*height*/
        o[1] + "px"
      ));
    },
    i(o) {
      if (!r) {
        for (let a = 0; a < l.length; a += 1)
          vt(s[a]);
        r = !0;
      }
    },
    o(o) {
      s = s.filter(Boolean);
      for (let a = 0; a < s.length; a += 1)
        Gt(s[a]);
      r = !1;
    },
    d(o) {
      o && Ue(t), La(s, o);
    }
  };
}
function ja(e, t) {
  return e ?? t();
}
function za(e) {
  const t = e.lastIndexOf(".");
  return t === -1 ? [e, ""] : [e.slice(0, t), e.slice(t)];
}
function tr(e, t) {
  fetch(e).then((n) => n.text()).then((n) => {
    document.getElementById(t).innerText = n;
  }).catch((n) => console.error("Error while fetching file:", n));
}
function Va(e, t, n) {
  let i;
  const r = Fa();
  let { value: l } = t, { selectable: s = !1 } = t, { height: u = void 0 } = t, { i18n: o } = t;
  const a = (f, c) => r("select", { value: f.orig_name, index: c });
  return e.$$set = (f) => {
    "value" in f && n(5, l = f.value), "selectable" in f && n(0, s = f.selectable), "height" in f && n(1, u = f.height), "i18n" in f && n(2, o = f.i18n);
  }, e.$$.update = () => {
    e.$$.dirty & /*value*/
    32 && n(3, i = (Array.isArray(l) ? l : [l]).map((f) => {
      const [c, _] = za(ja(f.orig_name, () => ""));
      return { ...f, filename_stem: c, filename_ext: _ };
    }));
  }, [s, u, o, i, r, l, a];
}
class bl extends Na {
  constructor(t) {
    super(), Ma(this, t, Va, xa, Ua, {
      value: 5,
      selectable: 0,
      height: 1,
      i18n: 2
    });
  }
}
const {
  SvelteComponent: Xa,
  bubble: Wa,
  check_outros: Za,
  create_component: yn,
  destroy_component: wn,
  detach: nr,
  empty: Ja,
  group_outros: Qa,
  init: Ya,
  insert: ir,
  mount_component: En,
  safe_not_equal: Ka,
  space: $a,
  transition_in: yt,
  transition_out: wt
} = window.__gradio__svelte__internal;
function eu(e) {
  let t, n;
  return t = new Eo({
    props: {
      unpadded_box: !0,
      size: "large",
      $$slots: { default: [nu] },
      $$scope: { ctx: e }
    }
  }), {
    c() {
      yn(t.$$.fragment);
    },
    m(i, r) {
      En(t, i, r), n = !0;
    },
    p(i, r) {
      const l = {};
      r & /*$$scope*/
      128 && (l.$$scope = { dirty: r, ctx: i }), t.$set(l);
    },
    i(i) {
      n || (yt(t.$$.fragment, i), n = !0);
    },
    o(i) {
      wt(t.$$.fragment, i), n = !1;
    },
    d(i) {
      wn(t, i);
    }
  };
}
function tu(e) {
  let t, n;
  return t = new bl({
    props: {
      i18n: (
        /*i18n*/
        e[5]
      ),
      selectable: (
        /*selectable*/
        e[3]
      ),
      value: (
        /*value*/
        e[0]
      ),
      height: (
        /*height*/
        e[4]
      )
    }
  }), t.$on(
    "select",
    /*select_handler*/
    e[6]
  ), {
    c() {
      yn(t.$$.fragment);
    },
    m(i, r) {
      En(t, i, r), n = !0;
    },
    p(i, r) {
      const l = {};
      r & /*i18n*/
      32 && (l.i18n = /*i18n*/
      i[5]), r & /*selectable*/
      8 && (l.selectable = /*selectable*/
      i[3]), r & /*value*/
      1 && (l.value = /*value*/
      i[0]), r & /*height*/
      16 && (l.height = /*height*/
      i[4]), t.$set(l);
    },
    i(i) {
      n || (yt(t.$$.fragment, i), n = !0);
    },
    o(i) {
      wt(t.$$.fragment, i), n = !1;
    },
    d(i) {
      wn(t, i);
    }
  };
}
function nu(e) {
  let t, n;
  return t = new Ai({}), {
    c() {
      yn(t.$$.fragment);
    },
    m(i, r) {
      En(t, i, r), n = !0;
    },
    i(i) {
      n || (yt(t.$$.fragment, i), n = !0);
    },
    o(i) {
      wt(t.$$.fragment, i), n = !1;
    },
    d(i) {
      wn(t, i);
    }
  };
}
function iu(e) {
  let t, n, i, r, l, s, u;
  t = new fl({
    props: {
      show_label: (
        /*show_label*/
        e[2]
      ),
      float: (
        /*value*/
        e[0] === null
      ),
      Icon: Ai,
      label: (
        /*label*/
        e[1] || "File"
      )
    }
  });
  const o = [tu, eu], a = [];
  function f(c, _) {
    return _ & /*value*/
    1 && (i = null), i == null && (i = !!/*value*/
    (c[0] && (!Array.isArray(
      /*value*/
      c[0]
    ) || /*value*/
    c[0].length > 0))), i ? 0 : 1;
  }
  return r = f(e, -1), l = a[r] = o[r](e), {
    c() {
      yn(t.$$.fragment), n = $a(), l.c(), s = Ja();
    },
    m(c, _) {
      En(t, c, _), ir(c, n, _), a[r].m(c, _), ir(c, s, _), u = !0;
    },
    p(c, [_]) {
      const h = {};
      _ & /*show_label*/
      4 && (h.show_label = /*show_label*/
      c[2]), _ & /*value*/
      1 && (h.float = /*value*/
      c[0] === null), _ & /*label*/
      2 && (h.label = /*label*/
      c[1] || "File"), t.$set(h);
      let d = r;
      r = f(c, _), r === d ? a[r].p(c, _) : (Qa(), wt(a[d], 1, 1, () => {
        a[d] = null;
      }), Za(), l = a[r], l ? l.p(c, _) : (l = a[r] = o[r](c), l.c()), yt(l, 1), l.m(s.parentNode, s));
    },
    i(c) {
      u || (yt(t.$$.fragment, c), yt(l), u = !0);
    },
    o(c) {
      wt(t.$$.fragment, c), wt(l), u = !1;
    },
    d(c) {
      c && (nr(n), nr(s)), wn(t, c), a[r].d(c);
    }
  };
}
function ru(e, t, n) {
  let { value: i = null } = t, { label: r } = t, { show_label: l = !0 } = t, { selectable: s = !1 } = t, { height: u = void 0 } = t, { i18n: o } = t;
  function a(f) {
    Wa.call(this, e, f);
  }
  return e.$$set = (f) => {
    "value" in f && n(0, i = f.value), "label" in f && n(1, r = f.label), "show_label" in f && n(2, l = f.show_label), "selectable" in f && n(3, s = f.selectable), "height" in f && n(4, u = f.height), "i18n" in f && n(5, o = f.i18n);
  }, [i, r, l, s, u, o, a];
}
class lu extends Xa {
  constructor(t) {
    super(), Ya(this, t, ru, iu, Ka, {
      value: 0,
      label: 1,
      show_label: 2,
      selectable: 3,
      height: 4,
      i18n: 5
    });
  }
}
var Vn = new Intl.Collator(0, { numeric: 1 }).compare;
function rr(e, t, n) {
  return e = e.split("."), t = t.split("."), Vn(e[0], t[0]) || Vn(e[1], t[1]) || (t[2] = t.slice(2).join("."), n = /[.-]/.test(e[2] = e.slice(2).join(".")), n == /[.-]/.test(t[2]) ? Vn(e[2], t[2]) : n ? -1 : 1);
}
function vl(e, t, n) {
  return t.startsWith("http://") || t.startsWith("https://") ? n ? e : t : e + t;
}
function Xn(e) {
  if (e.startsWith("http")) {
    const { protocol: t, host: n } = new URL(e);
    return n.endsWith("hf.space") ? {
      ws_protocol: "wss",
      host: n,
      http_protocol: t
    } : {
      ws_protocol: t === "https:" ? "wss" : "ws",
      http_protocol: t,
      host: n
    };
  } else if (e.startsWith("file:"))
    return {
      ws_protocol: "ws",
      http_protocol: "http:",
      host: "lite.local"
      // Special fake hostname only used for this case. This matches the hostname allowed in `is_self_host()` in `js/wasm/network/host.ts`.
    };
  return {
    ws_protocol: "wss",
    http_protocol: "https:",
    host: e
  };
}
const yl = /^[^\/]*\/[^\/]*$/, su = /.*hf\.space\/{0,1}$/;
async function ou(e, t) {
  const n = {};
  t && (n.Authorization = `Bearer ${t}`);
  const i = e.trim();
  if (yl.test(i))
    try {
      const r = await fetch(
        `https://huggingface.co/api/spaces/${i}/host`,
        { headers: n }
      );
      if (r.status !== 200)
        throw new Error("Space metadata could not be loaded.");
      const l = (await r.json()).host;
      return {
        space_id: e,
        ...Xn(l)
      };
    } catch (r) {
      throw new Error("Space metadata could not be loaded." + r.message);
    }
  if (su.test(i)) {
    const { ws_protocol: r, http_protocol: l, host: s } = Xn(i);
    return {
      space_id: s.replace(".hf.space", ""),
      ws_protocol: r,
      http_protocol: l,
      host: s
    };
  }
  return {
    space_id: !1,
    ...Xn(i)
  };
}
function au(e) {
  let t = {};
  return e.forEach(({ api_name: n }, i) => {
    n && (t[n] = i);
  }), t;
}
const uu = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;
async function lr(e) {
  try {
    const n = (await fetch(
      `https://huggingface.co/api/spaces/${e}/discussions`,
      {
        method: "HEAD"
      }
    )).headers.get("x-error-message");
    return !(n && uu.test(n));
  } catch {
    return !1;
  }
}
function nt(e, t, n) {
  if (e == null)
    return null;
  if (Array.isArray(e)) {
    const i = [];
    for (const r of e)
      r == null ? i.push(null) : i.push(nt(r, t, n));
    return i;
  }
  return e.is_stream ? n == null ? new Et({
    ...e,
    url: t + "/stream/" + e.path
  }) : new Et({
    ...e,
    url: "/proxy=" + n + "stream/" + e.path
  }) : new Et({
    ...e,
    url: cu(e.path, t, n)
  });
}
function fu(e) {
  try {
    const t = new URL(e);
    return t.protocol === "http:" || t.protocol === "https:";
  } catch {
    return !1;
  }
}
function cu(e, t, n) {
  return e == null ? n ? `/proxy=${n}file=` : `${t}/file=` : fu(e) ? e : n ? `/proxy=${n}file=${e}` : `${t}/file=${e}`;
}
async function hu(e, t, n, i = mu) {
  let r = (Array.isArray(e) ? e : [e]).map(
    (l) => l.blob
  );
  return await Promise.all(
    await i(t, r, void 0, n).then(
      async (l) => {
        if (l.error)
          throw new Error(l.error);
        return l.files ? l.files.map((s, u) => {
          const o = new Et({ ...e[u], path: s });
          return nt(o, t, null);
        }) : [];
      }
    )
  );
}
async function _u(e, t) {
  return e.map(
    (n, i) => new Et({
      path: n.name,
      orig_name: n.name,
      blob: n,
      size: n.size,
      mime_type: n.type,
      is_stream: t
    })
  );
}
class Et {
  constructor({
    path: t,
    url: n,
    orig_name: i,
    size: r,
    blob: l,
    is_stream: s,
    mime_type: u,
    alt_text: o
  }) {
    this.path = t, this.url = n, this.orig_name = i, this.size = r, this.blob = n ? void 0 : l, this.is_stream = s, this.mime_type = u, this.alt_text = o;
  }
}
const wl = "This application is too busy. Keep trying!", Ze = "Connection errored out.";
let El;
function du(e, t) {
  return { post_data: n, upload_files: i, client: r, handle_blob: l };
  async function n(s, u, o) {
    const a = { "Content-Type": "application/json" };
    o && (a.Authorization = `Bearer ${o}`);
    try {
      var f = await e(s, {
        method: "POST",
        body: JSON.stringify(u),
        headers: a
      });
    } catch {
      return [{ error: Ze }, 500];
    }
    let c, _;
    try {
      c = await f.json(), _ = f.status;
    } catch (h) {
      c = { error: `Could not parse server response: ${h}` }, _ = 500;
    }
    return [c, _];
  }
  async function i(s, u, o, a) {
    const f = {};
    o && (f.Authorization = `Bearer ${o}`);
    const c = 1e3, _ = [];
    for (let d = 0; d < u.length; d += c) {
      const w = u.slice(d, d + c), y = new FormData();
      w.forEach((p) => {
        y.append("files", p);
      });
      try {
        const p = a ? `${s}/upload?upload_id=${a}` : `${s}/upload`;
        var h = await e(p, {
          method: "POST",
          body: y,
          headers: f
        });
      } catch {
        return { error: Ze };
      }
      const v = await h.json();
      _.push(...v);
    }
    return { files: _ };
  }
  async function r(s, u = { normalise_files: !0 }) {
    return new Promise(async (o) => {
      const { status_callback: a, hf_token: f, normalise_files: c } = u, _ = {
        predict: he,
        submit: We,
        view_api: Ie,
        component_server: ct
      }, h = c ?? !0;
      if ((typeof window > "u" || !("WebSocket" in window)) && !global.Websocket) {
        const m = await import("./wrapper-6f348d45-19fa94bf.js");
        El = (await import("./__vite-browser-external-2447137e.js")).Blob, global.WebSocket = m.WebSocket;
      }
      const { ws_protocol: d, http_protocol: w, host: y, space_id: v } = await ou(s, f), p = Math.random().toString(36).substring(2), g = {};
      let T = !1, E = {}, S = null;
      const D = {}, re = /* @__PURE__ */ new Set();
      let A, L = {}, x = !1;
      f && v && (x = await pu(v, f));
      async function X(m) {
        if (A = m, L = au((m == null ? void 0 : m.dependencies) || []), A.auth_required)
          return {
            config: A,
            ..._
          };
        try {
          Z = await Ie(A);
        } catch (N) {
          console.error(`Could not get api details: ${N.message}`);
        }
        return {
          config: A,
          ..._
        };
      }
      let Z;
      async function B(m) {
        if (a && a(m), m.status === "running")
          try {
            A = await ur(
              e,
              `${w}//${y}`,
              f
            );
            const N = await X(A);
            o(N);
          } catch (N) {
            console.error(N), a && a({
              status: "error",
              message: "Could not load this space.",
              load_status: "error",
              detail: "NOT_FOUND"
            });
          }
      }
      try {
        A = await ur(
          e,
          `${w}//${y}`,
          f
        );
        const m = await X(A);
        o(m);
      } catch (m) {
        console.error(m), v ? ui(
          v,
          yl.test(v) ? "space_name" : "subdomain",
          B
        ) : a && a({
          status: "error",
          message: "Could not load this space.",
          load_status: "error",
          detail: "NOT_FOUND"
        });
      }
      function he(m, N, b) {
        let R = !1, k = !1, Q;
        if (typeof m == "number")
          Q = A.dependencies[m];
        else {
          const W = m.replace(/^\//, "");
          Q = A.dependencies[L[W]];
        }
        if (Q.types.continuous)
          throw new Error(
            "Cannot call predict on this function as it may run forever. Use submit instead"
          );
        return new Promise((W, _e) => {
          const Oe = We(m, N, b);
          let P;
          Oe.on("data", (de) => {
            k && (Oe.destroy(), W(de)), R = !0, P = de;
          }).on("status", (de) => {
            de.stage === "error" && _e(de), de.stage === "complete" && (k = !0, R && (Oe.destroy(), W(P)));
          });
        });
      }
      function We(m, N, b, R = null) {
        let k, Q;
        if (typeof m == "number")
          k = m, Q = Z.unnamed_endpoints[k];
        else {
          const Y = m.replace(/^\//, "");
          k = L[Y], Q = Z.named_endpoints[m.trim()];
        }
        if (typeof k != "number")
          throw new Error(
            "There is no endpoint matching that name of fn_index matching that number."
          );
        let W, _e, Oe = A.protocol ?? "ws";
        const P = typeof m == "number" ? "/predict" : m;
        let de, Ee = null, ae = !1;
        const Lt = {};
        let qe = "";
        typeof window < "u" && (qe = new URLSearchParams(window.location.search).toString()), l(`${A.root}`, N, Q, f).then(
          (Y) => {
            if (de = {
              data: Y || [],
              event_data: b,
              fn_index: k,
              trigger_id: R
            }, bu(k, A))
              U({
                type: "status",
                endpoint: P,
                stage: "pending",
                queue: !1,
                fn_index: k,
                time: /* @__PURE__ */ new Date()
              }), n(
                `${A.root}/run${P.startsWith("/") ? P : `/${P}`}${qe ? "?" + qe : ""}`,
                {
                  ...de,
                  session_hash: p
                },
                f
              ).then(([z, J]) => {
                const Se = h ? en(
                  z.data,
                  Q,
                  A.root,
                  A.root_url
                ) : z.data;
                J == 200 ? (U({
                  type: "data",
                  endpoint: P,
                  fn_index: k,
                  data: Se,
                  time: /* @__PURE__ */ new Date()
                }), U({
                  type: "status",
                  endpoint: P,
                  fn_index: k,
                  stage: "complete",
                  eta: z.average_duration,
                  queue: !1,
                  time: /* @__PURE__ */ new Date()
                })) : U({
                  type: "status",
                  stage: "error",
                  endpoint: P,
                  fn_index: k,
                  message: z.error,
                  queue: !1,
                  time: /* @__PURE__ */ new Date()
                });
              }).catch((z) => {
                U({
                  type: "status",
                  stage: "error",
                  message: z.message,
                  endpoint: P,
                  fn_index: k,
                  queue: !1,
                  time: /* @__PURE__ */ new Date()
                });
              });
            else if (Oe == "ws") {
              U({
                type: "status",
                stage: "pending",
                queue: !0,
                endpoint: P,
                fn_index: k,
                time: /* @__PURE__ */ new Date()
              });
              let z = new URL(`${d}://${vl(
                y,
                A.path,
                !0
              )}
							/queue/join${qe ? "?" + qe : ""}`);
              x && z.searchParams.set("__sign", x), W = new WebSocket(z), W.onclose = (J) => {
                J.wasClean || U({
                  type: "status",
                  stage: "error",
                  broken: !0,
                  message: Ze,
                  queue: !0,
                  endpoint: P,
                  fn_index: k,
                  time: /* @__PURE__ */ new Date()
                });
              }, W.onmessage = function(J) {
                const Se = JSON.parse(J.data), { type: ee, status: G, data: q } = Wn(
                  Se,
                  g[k]
                );
                if (ee === "update" && G && !ae)
                  U({
                    type: "status",
                    endpoint: P,
                    fn_index: k,
                    time: /* @__PURE__ */ new Date(),
                    ...G
                  }), G.stage === "error" && W.close();
                else if (ee === "hash") {
                  W.send(JSON.stringify({ fn_index: k, session_hash: p }));
                  return;
                } else
                  ee === "data" ? W.send(JSON.stringify({ ...de, session_hash: p })) : ee === "complete" ? ae = G : ee === "log" ? U({
                    type: "log",
                    log: q.log,
                    level: q.level,
                    endpoint: P,
                    fn_index: k
                  }) : ee === "generating" && U({
                    type: "status",
                    time: /* @__PURE__ */ new Date(),
                    ...G,
                    stage: G == null ? void 0 : G.stage,
                    queue: !0,
                    endpoint: P,
                    fn_index: k
                  });
                q && (U({
                  type: "data",
                  time: /* @__PURE__ */ new Date(),
                  data: h ? en(
                    q.data,
                    Q,
                    A.root,
                    A.root_url
                  ) : q.data,
                  endpoint: P,
                  fn_index: k
                }), ae && (U({
                  type: "status",
                  time: /* @__PURE__ */ new Date(),
                  ...ae,
                  stage: G == null ? void 0 : G.stage,
                  queue: !0,
                  endpoint: P,
                  fn_index: k
                }), W.close()));
              }, rr(A.version || "2.0.0", "3.6") < 0 && addEventListener(
                "open",
                () => W.send(JSON.stringify({ hash: p }))
              );
            } else if (Oe == "sse") {
              U({
                type: "status",
                stage: "pending",
                queue: !0,
                endpoint: P,
                fn_index: k,
                time: /* @__PURE__ */ new Date()
              });
              var me = new URLSearchParams({
                fn_index: k.toString(),
                session_hash: p
              }).toString();
              let z = new URL(
                `${A.root}/queue/join?${qe ? qe + "&" : ""}${me}`
              );
              _e = t(z), _e.onmessage = async function(J) {
                const Se = JSON.parse(J.data), { type: ee, status: G, data: q } = Wn(
                  Se,
                  g[k]
                );
                if (ee === "update" && G && !ae)
                  U({
                    type: "status",
                    endpoint: P,
                    fn_index: k,
                    time: /* @__PURE__ */ new Date(),
                    ...G
                  }), G.stage === "error" && _e.close();
                else if (ee === "data") {
                  Ee = Se.event_id;
                  let [ht, cs] = await n(
                    `${A.root}/queue/data`,
                    {
                      ...de,
                      session_hash: p,
                      event_id: Ee
                    },
                    f
                  );
                  cs !== 200 && (U({
                    type: "status",
                    stage: "error",
                    message: Ze,
                    queue: !0,
                    endpoint: P,
                    fn_index: k,
                    time: /* @__PURE__ */ new Date()
                  }), _e.close());
                } else
                  ee === "complete" ? ae = G : ee === "log" ? U({
                    type: "log",
                    log: q.log,
                    level: q.level,
                    endpoint: P,
                    fn_index: k
                  }) : ee === "generating" && U({
                    type: "status",
                    time: /* @__PURE__ */ new Date(),
                    ...G,
                    stage: G == null ? void 0 : G.stage,
                    queue: !0,
                    endpoint: P,
                    fn_index: k
                  });
                q && (U({
                  type: "data",
                  time: /* @__PURE__ */ new Date(),
                  data: h ? en(
                    q.data,
                    Q,
                    A.root,
                    A.root_url
                  ) : q.data,
                  endpoint: P,
                  fn_index: k
                }), ae && (U({
                  type: "status",
                  time: /* @__PURE__ */ new Date(),
                  ...ae,
                  stage: G == null ? void 0 : G.stage,
                  queue: !0,
                  endpoint: P,
                  fn_index: k
                }), _e.close()));
              };
            } else
              Oe == "sse_v1" && (U({
                type: "status",
                stage: "pending",
                queue: !0,
                endpoint: P,
                fn_index: k,
                time: /* @__PURE__ */ new Date()
              }), n(
                `${A.root}/queue/join?${qe}`,
                {
                  ...de,
                  session_hash: p
                },
                f
              ).then(([z, J]) => {
                if (J === 503)
                  U({
                    type: "status",
                    stage: "error",
                    message: wl,
                    queue: !0,
                    endpoint: P,
                    fn_index: k,
                    time: /* @__PURE__ */ new Date()
                  });
                else if (J !== 200)
                  U({
                    type: "status",
                    stage: "error",
                    message: Ze,
                    queue: !0,
                    endpoint: P,
                    fn_index: k,
                    time: /* @__PURE__ */ new Date()
                  });
                else {
                  Ee = z.event_id;
                  let Se = async function(ee) {
                    try {
                      const { type: G, status: q, data: ht } = Wn(
                        ee,
                        g[k]
                      );
                      if (G == "heartbeat")
                        return;
                      if (G === "update" && q && !ae)
                        U({
                          type: "status",
                          endpoint: P,
                          fn_index: k,
                          time: /* @__PURE__ */ new Date(),
                          ...q
                        });
                      else if (G === "complete")
                        ae = q;
                      else if (G == "unexpected_error")
                        console.error("Unexpected error", q == null ? void 0 : q.message), U({
                          type: "status",
                          stage: "error",
                          message: (q == null ? void 0 : q.message) || "An Unexpected Error Occurred!",
                          queue: !0,
                          endpoint: P,
                          fn_index: k,
                          time: /* @__PURE__ */ new Date()
                        });
                      else if (G === "log") {
                        U({
                          type: "log",
                          log: ht.log,
                          level: ht.level,
                          endpoint: P,
                          fn_index: k
                        });
                        return;
                      } else
                        G === "generating" && U({
                          type: "status",
                          time: /* @__PURE__ */ new Date(),
                          ...q,
                          stage: q == null ? void 0 : q.stage,
                          queue: !0,
                          endpoint: P,
                          fn_index: k
                        });
                      ht && (U({
                        type: "data",
                        time: /* @__PURE__ */ new Date(),
                        data: h ? en(
                          ht.data,
                          Q,
                          A.root,
                          A.root_url
                        ) : ht.data,
                        endpoint: P,
                        fn_index: k
                      }), ae && U({
                        type: "status",
                        time: /* @__PURE__ */ new Date(),
                        ...ae,
                        stage: q == null ? void 0 : q.stage,
                        queue: !0,
                        endpoint: P,
                        fn_index: k
                      })), ((q == null ? void 0 : q.stage) === "complete" || (q == null ? void 0 : q.stage) === "error") && D[Ee] && delete D[Ee];
                    } catch (G) {
                      console.error("Unexpected client exception", G), U({
                        type: "status",
                        stage: "error",
                        message: "An Unexpected Error Occurred!",
                        queue: !0,
                        endpoint: P,
                        fn_index: k,
                        time: /* @__PURE__ */ new Date()
                      }), Ge();
                    }
                  };
                  Ee in E && (E[Ee].forEach(
                    (ee) => Se(ee)
                  ), delete E[Ee]), D[Ee] = Se, re.add(Ee), T || Ot();
                }
              }));
          }
        );
        function U(Y) {
          const z = Lt[Y.type] || [];
          z == null || z.forEach((J) => J(Y));
        }
        function Cn(Y, me) {
          const z = Lt, J = z[Y] || [];
          return z[Y] = J, J == null || J.push(me), { on: Cn, off: Jt, cancel: Pn, destroy: Nn };
        }
        function Jt(Y, me) {
          const z = Lt;
          let J = z[Y] || [];
          return J = J == null ? void 0 : J.filter((Se) => Se !== me), z[Y] = J, { on: Cn, off: Jt, cancel: Pn, destroy: Nn };
        }
        async function Pn() {
          const Y = {
            stage: "complete",
            queue: !1,
            time: /* @__PURE__ */ new Date()
          };
          ae = Y, U({
            ...Y,
            type: "status",
            endpoint: P,
            fn_index: k
          });
          let me = {};
          Oe === "ws" ? (W && W.readyState === 0 ? W.addEventListener("open", () => {
            W.close();
          }) : W.close(), me = { fn_index: k, session_hash: p }) : (_e.close(), me = { event_id: Ee });
          try {
            await e(`${A.root}/reset`, {
              headers: { "Content-Type": "application/json" },
              method: "POST",
              body: JSON.stringify(me)
            });
          } catch {
            console.warn(
              "The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable."
            );
          }
        }
        function Nn() {
          for (const Y in Lt)
            Lt[Y].forEach((me) => {
              Jt(Y, me);
            });
        }
        return {
          on: Cn,
          off: Jt,
          cancel: Pn,
          destroy: Nn
        };
      }
      function Ot() {
        T = !0;
        let m = new URLSearchParams({
          session_hash: p
        }).toString(), N = new URL(`${A.root}/queue/data?${m}`);
        S = t(N), S.onmessage = async function(b) {
          let R = JSON.parse(b.data);
          const k = R.event_id;
          if (!k)
            await Promise.all(
              Object.keys(D).map(
                (Q) => D[Q](R)
              )
            );
          else if (D[k]) {
            R.msg === "process_completed" && (re.delete(k), re.size === 0 && Ge());
            let Q = D[k];
            window.setTimeout(Q, 0, R);
          } else
            E[k] || (E[k] = []), E[k].push(R);
        }, S.onerror = async function(b) {
          await Promise.all(
            Object.keys(D).map(
              (R) => D[R]({
                msg: "unexpected_error",
                message: Ze
              })
            )
          ), Ge();
        };
      }
      function Ge() {
        T = !1, S == null || S.close();
      }
      async function ct(m, N, b) {
        var R;
        const k = { "Content-Type": "application/json" };
        f && (k.Authorization = `Bearer ${f}`);
        let Q, W = A.components.find(
          (P) => P.id === m
        );
        (R = W == null ? void 0 : W.props) != null && R.root_url ? Q = W.props.root_url : Q = A.root;
        const _e = await e(
          `${Q}/component_server/`,
          {
            method: "POST",
            body: JSON.stringify({
              data: b,
              component_id: m,
              fn_name: N,
              session_hash: p
            }),
            headers: k
          }
        );
        if (!_e.ok)
          throw new Error(
            "Could not connect to component server: " + _e.statusText
          );
        return await _e.json();
      }
      async function Ie(m) {
        if (Z)
          return Z;
        const N = { "Content-Type": "application/json" };
        f && (N.Authorization = `Bearer ${f}`);
        let b;
        if (rr(m.version || "2.0.0", "3.30") < 0 ? b = await e(
          "https://gradio-space-api-fetcher-v2.hf.space/api",
          {
            method: "POST",
            body: JSON.stringify({
              serialize: !1,
              config: JSON.stringify(m)
            }),
            headers: N
          }
        ) : b = await e(`${m.root}/info`, {
          headers: N
        }), !b.ok)
          throw new Error(Ze);
        let R = await b.json();
        return "api" in R && (R = R.api), R.named_endpoints["/predict"] && !R.unnamed_endpoints[0] && (R.unnamed_endpoints[0] = R.named_endpoints["/predict"]), gu(R, m, L);
      }
    });
  }
  async function l(s, u, o, a) {
    const f = await ai(
      u,
      void 0,
      [],
      !0,
      o
    );
    return Promise.all(
      f.map(async ({ path: c, blob: _, type: h }) => {
        if (_) {
          const d = (await i(s, [_], a)).files[0];
          return { path: c, file_url: d, type: h, name: _ == null ? void 0 : _.name };
        }
        return { path: c, type: h };
      })
    ).then((c) => (c.forEach(({ path: _, file_url: h, type: d, name: w }) => {
      if (d === "Gallery")
        ar(u, h, _);
      else if (h) {
        const y = new Et({ path: h, orig_name: w });
        ar(u, y, _);
      }
    }), u));
  }
}
const { post_data: Jh, upload_files: mu, client: Qh, handle_blob: Yh } = du(
  fetch,
  (...e) => new EventSource(...e)
);
function en(e, t, n, i) {
  return e.map((r, l) => {
    var s, u, o, a;
    return ((u = (s = t == null ? void 0 : t.returns) == null ? void 0 : s[l]) == null ? void 0 : u.component) === "File" ? nt(r, n, i) : ((a = (o = t == null ? void 0 : t.returns) == null ? void 0 : o[l]) == null ? void 0 : a.component) === "Gallery" ? r.map((f) => Array.isArray(f) ? [nt(f[0], n, i), f[1]] : [nt(f, n, i), null]) : typeof r == "object" && r.path ? nt(r, n, i) : r;
  });
}
function sr(e, t, n, i) {
  switch (e.type) {
    case "string":
      return "string";
    case "boolean":
      return "boolean";
    case "number":
      return "number";
  }
  if (n === "JSONSerializable" || n === "StringSerializable")
    return "any";
  if (n === "ListStringSerializable")
    return "string[]";
  if (t === "Image")
    return i === "parameter" ? "Blob | File | Buffer" : "string";
  if (n === "FileSerializable")
    return (e == null ? void 0 : e.type) === "array" ? i === "parameter" ? "(Blob | File | Buffer)[]" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]" : i === "parameter" ? "Blob | File | Buffer" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}";
  if (n === "GallerySerializable")
    return i === "parameter" ? "[(Blob | File | Buffer), (string | null)][]" : "[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]";
}
function or(e, t) {
  return t === "GallerySerializable" ? "array of [file, label] tuples" : t === "ListStringSerializable" ? "array of strings" : t === "FileSerializable" ? "array of files or single file" : e.description;
}
function gu(e, t, n) {
  const i = {
    named_endpoints: {},
    unnamed_endpoints: {}
  };
  for (const r in e) {
    const l = e[r];
    for (const s in l) {
      const u = t.dependencies[s] ? s : n[s.replace("/", "")], o = l[s];
      i[r][s] = {}, i[r][s].parameters = {}, i[r][s].returns = {}, i[r][s].type = t.dependencies[u].types, i[r][s].parameters = o.parameters.map(
        ({ label: a, component: f, type: c, serializer: _ }) => ({
          label: a,
          component: f,
          type: sr(c, f, _, "parameter"),
          description: or(c, _)
        })
      ), i[r][s].returns = o.returns.map(
        ({ label: a, component: f, type: c, serializer: _ }) => ({
          label: a,
          component: f,
          type: sr(c, f, _, "return"),
          description: or(c, _)
        })
      );
    }
  }
  return i;
}
async function pu(e, t) {
  try {
    return (await (await fetch(`https://huggingface.co/api/spaces/${e}/jwt`, {
      headers: {
        Authorization: `Bearer ${t}`
      }
    })).json()).token || !1;
  } catch (n) {
    return console.error(n), !1;
  }
}
function ar(e, t, n) {
  for (; n.length > 1; )
    e = e[n.shift()];
  e[n.shift()] = t;
}
async function ai(e, t = void 0, n = [], i = !1, r = void 0) {
  if (Array.isArray(e)) {
    let l = [];
    return await Promise.all(
      e.map(async (s, u) => {
        var o;
        let a = n.slice();
        a.push(u);
        const f = await ai(
          e[u],
          i ? ((o = r == null ? void 0 : r.parameters[u]) == null ? void 0 : o.component) || void 0 : t,
          a,
          !1,
          r
        );
        l = l.concat(f);
      })
    ), l;
  } else {
    if (globalThis.Buffer && e instanceof globalThis.Buffer)
      return [
        {
          path: n,
          blob: t === "Image" ? !1 : new El([e]),
          type: t
        }
      ];
    if (typeof e == "object") {
      let l = [];
      for (let s in e)
        if (e.hasOwnProperty(s)) {
          let u = n.slice();
          u.push(s), l = l.concat(
            await ai(
              e[s],
              void 0,
              u,
              !1,
              r
            )
          );
        }
      return l;
    }
  }
  return [];
}
function bu(e, t) {
  var n, i, r, l;
  return !(((i = (n = t == null ? void 0 : t.dependencies) == null ? void 0 : n[e]) == null ? void 0 : i.queue) === null ? t.enable_queue : (l = (r = t == null ? void 0 : t.dependencies) == null ? void 0 : r[e]) != null && l.queue) || !1;
}
async function ur(e, t, n) {
  const i = {};
  if (n && (i.Authorization = `Bearer ${n}`), typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876" && !window.gradio_config.dev_mode) {
    const r = window.gradio_config.root, l = window.gradio_config;
    return l.root = vl(t, l.root, !1), { ...l, path: r };
  } else if (t) {
    let r = await e(`${t}/config`, {
      headers: i
    });
    if (r.status === 200) {
      const l = await r.json();
      return l.path = l.path ?? "", l.root = t, l;
    }
    throw new Error("Could not get config.");
  }
  throw new Error("No config or app endpoint found");
}
async function ui(e, t, n) {
  let i = t === "subdomain" ? `https://huggingface.co/api/spaces/by-subdomain/${e}` : `https://huggingface.co/api/spaces/${e}`, r, l;
  try {
    if (r = await fetch(i), l = r.status, l !== 200)
      throw new Error();
    r = await r.json();
  } catch {
    n({
      status: "error",
      load_status: "error",
      message: "Could not get space status",
      detail: "NOT_FOUND"
    });
    return;
  }
  if (!r || l !== 200)
    return;
  const {
    runtime: { stage: s },
    id: u
  } = r;
  switch (s) {
    case "STOPPED":
    case "SLEEPING":
      n({
        status: "sleeping",
        load_status: "pending",
        message: "Space is asleep. Waking it up...",
        detail: s
      }), setTimeout(() => {
        ui(e, t, n);
      }, 1e3);
      break;
    case "PAUSED":
      n({
        status: "paused",
        load_status: "error",
        message: "This space has been paused by the author. If you would like to try this demo, consider duplicating the space.",
        detail: s,
        discussions_enabled: await lr(u)
      });
      break;
    case "RUNNING":
    case "RUNNING_BUILDING":
      n({
        status: "running",
        load_status: "complete",
        message: "",
        detail: s
      });
      break;
    case "BUILDING":
      n({
        status: "building",
        load_status: "pending",
        message: "Space is building...",
        detail: s
      }), setTimeout(() => {
        ui(e, t, n);
      }, 1e3);
      break;
    default:
      n({
        status: "space_error",
        load_status: "error",
        message: "This space is experiencing an issue.",
        detail: s,
        discussions_enabled: await lr(u)
      });
      break;
  }
}
function Wn(e, t) {
  switch (e.msg) {
    case "send_data":
      return { type: "data" };
    case "send_hash":
      return { type: "hash" };
    case "queue_full":
      return {
        type: "update",
        status: {
          queue: !0,
          message: wl,
          stage: "error",
          code: e.code,
          success: e.success
        }
      };
    case "heartbeat":
      return {
        type: "heartbeat"
      };
    case "unexpected_error":
      return {
        type: "unexpected_error",
        status: {
          queue: !0,
          message: e.message,
          stage: "error",
          success: !1
        }
      };
    case "estimation":
      return {
        type: "update",
        status: {
          queue: !0,
          stage: t || "pending",
          code: e.code,
          size: e.queue_size,
          position: e.rank,
          eta: e.rank_eta,
          success: e.success
        }
      };
    case "progress":
      return {
        type: "update",
        status: {
          queue: !0,
          stage: "pending",
          code: e.code,
          progress_data: e.progress_data,
          success: e.success
        }
      };
    case "log":
      return { type: "log", data: e };
    case "process_generating":
      return {
        type: "generating",
        status: {
          queue: !0,
          message: e.success ? null : e.output.error,
          stage: e.success ? "generating" : "error",
          code: e.code,
          progress_data: e.progress_data,
          eta: e.average_duration
        },
        data: e.success ? e.output : null
      };
    case "process_completed":
      return "error" in e.output ? {
        type: "update",
        status: {
          queue: !0,
          message: e.output.error,
          stage: "error",
          code: e.code,
          success: e.success
        }
      } : {
        type: "complete",
        status: {
          queue: !0,
          message: e.success ? void 0 : e.output.error,
          stage: e.success ? "complete" : "error",
          code: e.code,
          progress_data: e.progress_data
        },
        data: e.success ? e.output : null
      };
    case "process_starts":
      return {
        type: "update",
        status: {
          queue: !0,
          stage: "pending",
          code: e.code,
          size: e.rank,
          position: 0,
          success: e.success,
          eta: e.eta
        }
      };
  }
  return { type: "none", status: { stage: "error", queue: !0 } };
}
function rt() {
}
function vu(e) {
  return e();
}
function yu(e) {
  e.forEach(vu);
}
function wu(e) {
  return typeof e == "function";
}
function Eu(e, t) {
  return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
}
function Su(e, ...t) {
  if (e == null) {
    for (const i of t)
      i(void 0);
    return rt;
  }
  const n = e.subscribe(...t);
  return n.unsubscribe ? () => n.unsubscribe() : n;
}
const Sl = typeof window < "u";
let fr = Sl ? () => window.performance.now() : () => Date.now(), kl = Sl ? (e) => requestAnimationFrame(e) : rt;
const St = /* @__PURE__ */ new Set();
function Tl(e) {
  St.forEach((t) => {
    t.c(e) || (St.delete(t), t.f());
  }), St.size !== 0 && kl(Tl);
}
function ku(e) {
  let t;
  return St.size === 0 && kl(Tl), {
    promise: new Promise((n) => {
      St.add(t = { c: e, f: n });
    }),
    abort() {
      St.delete(t);
    }
  };
}
const mt = [];
function Tu(e, t) {
  return {
    subscribe: jt(e, t).subscribe
  };
}
function jt(e, t = rt) {
  let n;
  const i = /* @__PURE__ */ new Set();
  function r(u) {
    if (Eu(e, u) && (e = u, n)) {
      const o = !mt.length;
      for (const a of i)
        a[1](), mt.push(a, e);
      if (o) {
        for (let a = 0; a < mt.length; a += 2)
          mt[a][0](mt[a + 1]);
        mt.length = 0;
      }
    }
  }
  function l(u) {
    r(u(e));
  }
  function s(u, o = rt) {
    const a = [u, o];
    return i.add(a), i.size === 1 && (n = t(r, l) || rt), u(e), () => {
      i.delete(a), i.size === 0 && n && (n(), n = null);
    };
  }
  return { set: r, update: l, subscribe: s };
}
function Pt(e, t, n) {
  const i = !Array.isArray(e), r = i ? [e] : e;
  if (!r.every(Boolean))
    throw new Error("derived() expects stores as input, got a falsy value");
  const l = t.length < 2;
  return Tu(n, (s, u) => {
    let o = !1;
    const a = [];
    let f = 0, c = rt;
    const _ = () => {
      if (f)
        return;
      c();
      const d = t(i ? a[0] : a, s, u);
      l ? s(d) : c = wu(d) ? d : rt;
    }, h = r.map(
      (d, w) => Su(
        d,
        (y) => {
          a[w] = y, f &= ~(1 << w), o && _();
        },
        () => {
          f |= 1 << w;
        }
      )
    );
    return o = !0, _(), function() {
      yu(h), c(), o = !1;
    };
  });
}
function cr(e) {
  return Object.prototype.toString.call(e) === "[object Date]";
}
function fi(e, t, n, i) {
  if (typeof n == "number" || cr(n)) {
    const r = i - n, l = (n - t) / (e.dt || 1 / 60), s = e.opts.stiffness * r, u = e.opts.damping * l, o = (s - u) * e.inv_mass, a = (l + o) * e.dt;
    return Math.abs(a) < e.opts.precision && Math.abs(r) < e.opts.precision ? i : (e.settled = !1, cr(n) ? new Date(n.getTime() + a) : n + a);
  } else {
    if (Array.isArray(n))
      return n.map(
        (r, l) => fi(e, t[l], n[l], i[l])
      );
    if (typeof n == "object") {
      const r = {};
      for (const l in n)
        r[l] = fi(e, t[l], n[l], i[l]);
      return r;
    } else
      throw new Error(`Cannot spring ${typeof n} values`);
  }
}
function hr(e, t = {}) {
  const n = jt(e), { stiffness: i = 0.15, damping: r = 0.8, precision: l = 0.01 } = t;
  let s, u, o, a = e, f = e, c = 1, _ = 0, h = !1;
  function d(y, v = {}) {
    f = y;
    const p = o = {};
    return e == null || v.hard || w.stiffness >= 1 && w.damping >= 1 ? (h = !0, s = fr(), a = y, n.set(e = f), Promise.resolve()) : (v.soft && (_ = 1 / ((v.soft === !0 ? 0.5 : +v.soft) * 60), c = 0), u || (s = fr(), h = !1, u = ku((g) => {
      if (h)
        return h = !1, u = null, !1;
      c = Math.min(c + _, 1);
      const T = {
        inv_mass: c,
        opts: w,
        settled: !0,
        dt: (g - s) * 60 / 1e3
      }, E = fi(T, a, e, f);
      return s = g, a = e, n.set(e = E), T.settled && (u = null), !T.settled;
    })), new Promise((g) => {
      u.promise.then(() => {
        p === o && g();
      });
    }));
  }
  const w = {
    set: d,
    update: (y, v) => d(y(f, e), v),
    subscribe: n.subscribe,
    stiffness: i,
    damping: r,
    precision: l
  };
  return w;
}
function Bu(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var Au = function(t) {
  return Hu(t) && !Cu(t);
};
function Hu(e) {
  return !!e && typeof e == "object";
}
function Cu(e) {
  var t = Object.prototype.toString.call(e);
  return t === "[object RegExp]" || t === "[object Date]" || Iu(e);
}
var Pu = typeof Symbol == "function" && Symbol.for, Nu = Pu ? Symbol.for("react.element") : 60103;
function Iu(e) {
  return e.$$typeof === Nu;
}
function Ou(e) {
  return Array.isArray(e) ? [] : {};
}
function qt(e, t) {
  return t.clone !== !1 && t.isMergeableObject(e) ? kt(Ou(e), e, t) : e;
}
function Lu(e, t, n) {
  return e.concat(t).map(function(i) {
    return qt(i, n);
  });
}
function Mu(e, t) {
  if (!t.customMerge)
    return kt;
  var n = t.customMerge(e);
  return typeof n == "function" ? n : kt;
}
function Du(e) {
  return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
    return Object.propertyIsEnumerable.call(e, t);
  }) : [];
}
function _r(e) {
  return Object.keys(e).concat(Du(e));
}
function Bl(e, t) {
  try {
    return t in e;
  } catch {
    return !1;
  }
}
function Ru(e, t) {
  return Bl(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));
}
function Uu(e, t, n) {
  var i = {};
  return n.isMergeableObject(e) && _r(e).forEach(function(r) {
    i[r] = qt(e[r], n);
  }), _r(t).forEach(function(r) {
    Ru(e, r) || (Bl(e, r) && n.isMergeableObject(t[r]) ? i[r] = Mu(r, n)(e[r], t[r], n) : i[r] = qt(t[r], n));
  }), i;
}
function kt(e, t, n) {
  n = n || {}, n.arrayMerge = n.arrayMerge || Lu, n.isMergeableObject = n.isMergeableObject || Au, n.cloneUnlessOtherwiseSpecified = qt;
  var i = Array.isArray(t), r = Array.isArray(e), l = i === r;
  return l ? i ? n.arrayMerge(e, t, n) : Uu(e, t, n) : qt(t, n);
}
kt.all = function(t, n) {
  if (!Array.isArray(t))
    throw new Error("first argument should be an array");
  return t.reduce(function(i, r) {
    return kt(i, r, n);
  }, {});
};
var Fu = kt, Gu = Fu;
const qu = /* @__PURE__ */ Bu(Gu);
var ci = function(e, t) {
  return ci = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
    n.__proto__ = i;
  } || function(n, i) {
    for (var r in i)
      Object.prototype.hasOwnProperty.call(i, r) && (n[r] = i[r]);
  }, ci(e, t);
};
function Sn(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
  ci(e, t);
  function n() {
    this.constructor = e;
  }
  e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
}
var F = function() {
  return F = Object.assign || function(t) {
    for (var n, i = 1, r = arguments.length; i < r; i++) {
      n = arguments[i];
      for (var l in n)
        Object.prototype.hasOwnProperty.call(n, l) && (t[l] = n[l]);
    }
    return t;
  }, F.apply(this, arguments);
};
function Zn(e, t, n) {
  if (n || arguments.length === 2)
    for (var i = 0, r = t.length, l; i < r; i++)
      (l || !(i in t)) && (l || (l = Array.prototype.slice.call(t, 0, i)), l[i] = t[i]);
  return e.concat(l || Array.prototype.slice.call(t));
}
var I;
(function(e) {
  e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", e[e.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", e[e.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", e[e.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", e[e.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", e[e.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", e[e.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", e[e.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", e[e.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", e[e.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", e[e.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", e[e.INVALID_TAG = 23] = "INVALID_TAG", e[e.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", e[e.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", e[e.UNCLOSED_TAG = 27] = "UNCLOSED_TAG";
})(I || (I = {}));
var j;
(function(e) {
  e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag";
})(j || (j = {}));
var Tt;
(function(e) {
  e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime";
})(Tt || (Tt = {}));
function dr(e) {
  return e.type === j.literal;
}
function xu(e) {
  return e.type === j.argument;
}
function Al(e) {
  return e.type === j.number;
}
function Hl(e) {
  return e.type === j.date;
}
function Cl(e) {
  return e.type === j.time;
}
function Pl(e) {
  return e.type === j.select;
}
function Nl(e) {
  return e.type === j.plural;
}
function ju(e) {
  return e.type === j.pound;
}
function Il(e) {
  return e.type === j.tag;
}
function Ol(e) {
  return !!(e && typeof e == "object" && e.type === Tt.number);
}
function hi(e) {
  return !!(e && typeof e == "object" && e.type === Tt.dateTime);
}
var Ll = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, zu = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
function Vu(e) {
  var t = {};
  return e.replace(zu, function(n) {
    var i = n.length;
    switch (n[0]) {
      case "G":
        t.era = i === 4 ? "long" : i === 5 ? "narrow" : "short";
        break;
      case "y":
        t.year = i === 2 ? "2-digit" : "numeric";
        break;
      case "Y":
      case "u":
      case "U":
      case "r":
        throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
      case "q":
      case "Q":
        throw new RangeError("`q/Q` (quarter) patterns are not supported");
      case "M":
      case "L":
        t.month = ["numeric", "2-digit", "short", "long", "narrow"][i - 1];
        break;
      case "w":
      case "W":
        throw new RangeError("`w/W` (week) patterns are not supported");
      case "d":
        t.day = ["numeric", "2-digit"][i - 1];
        break;
      case "D":
      case "F":
      case "g":
        throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
      case "E":
        t.weekday = i === 4 ? "short" : i === 5 ? "narrow" : "short";
        break;
      case "e":
        if (i < 4)
          throw new RangeError("`e..eee` (weekday) patterns are not supported");
        t.weekday = ["short", "long", "narrow", "short"][i - 4];
        break;
      case "c":
        if (i < 4)
          throw new RangeError("`c..ccc` (weekday) patterns are not supported");
        t.weekday = ["short", "long", "narrow", "short"][i - 4];
        break;
      case "a":
        t.hour12 = !0;
        break;
      case "b":
      case "B":
        throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
      case "h":
        t.hourCycle = "h12", t.hour = ["numeric", "2-digit"][i - 1];
        break;
      case "H":
        t.hourCycle = "h23", t.hour = ["numeric", "2-digit"][i - 1];
        break;
      case "K":
        t.hourCycle = "h11", t.hour = ["numeric", "2-digit"][i - 1];
        break;
      case "k":
        t.hourCycle = "h24", t.hour = ["numeric", "2-digit"][i - 1];
        break;
      case "j":
      case "J":
      case "C":
        throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
      case "m":
        t.minute = ["numeric", "2-digit"][i - 1];
        break;
      case "s":
        t.second = ["numeric", "2-digit"][i - 1];
        break;
      case "S":
      case "A":
        throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
      case "z":
        t.timeZoneName = i < 4 ? "short" : "long";
        break;
      case "Z":
      case "O":
      case "v":
      case "V":
      case "X":
      case "x":
        throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
    }
    return "";
  }), t;
}
var Xu = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
function Wu(e) {
  if (e.length === 0)
    throw new Error("Number skeleton cannot be empty");
  for (var t = e.split(Xu).filter(function(_) {
    return _.length > 0;
  }), n = [], i = 0, r = t; i < r.length; i++) {
    var l = r[i], s = l.split("/");
    if (s.length === 0)
      throw new Error("Invalid number skeleton");
    for (var u = s[0], o = s.slice(1), a = 0, f = o; a < f.length; a++) {
      var c = f[a];
      if (c.length === 0)
        throw new Error("Invalid number skeleton");
    }
    n.push({ stem: u, options: o });
  }
  return n;
}
function Zu(e) {
  return e.replace(/^(.*?)-/, "");
}
var mr = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Ml = /^(@+)?(\+|#+)?[rs]?$/g, Ju = /(\*)(0+)|(#+)(0+)|(0+)/g, Dl = /^(0+)$/;
function gr(e) {
  var t = {};
  return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Ml, function(n, i, r) {
    return typeof r != "string" ? (t.minimumSignificantDigits = i.length, t.maximumSignificantDigits = i.length) : r === "+" ? t.minimumSignificantDigits = i.length : i[0] === "#" ? t.maximumSignificantDigits = i.length : (t.minimumSignificantDigits = i.length, t.maximumSignificantDigits = i.length + (typeof r == "string" ? r.length : 0)), "";
  }), t;
}
function Rl(e) {
  switch (e) {
    case "sign-auto":
      return {
        signDisplay: "auto"
      };
    case "sign-accounting":
    case "()":
      return {
        currencySign: "accounting"
      };
    case "sign-always":
    case "+!":
      return {
        signDisplay: "always"
      };
    case "sign-accounting-always":
    case "()!":
      return {
        signDisplay: "always",
        currencySign: "accounting"
      };
    case "sign-except-zero":
    case "+?":
      return {
        signDisplay: "exceptZero"
      };
    case "sign-accounting-except-zero":
    case "()?":
      return {
        signDisplay: "exceptZero",
        currencySign: "accounting"
      };
    case "sign-never":
    case "+_":
      return {
        signDisplay: "never"
      };
  }
}
function Qu(e) {
  var t;
  if (e[0] === "E" && e[1] === "E" ? (t = {
    notation: "engineering"
  }, e = e.slice(2)) : e[0] === "E" && (t = {
    notation: "scientific"
  }, e = e.slice(1)), t) {
    var n = e.slice(0, 2);
    if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !Dl.test(e))
      throw new Error("Malformed concise eng/scientific notation");
    t.minimumIntegerDigits = e.length;
  }
  return t;
}
function pr(e) {
  var t = {}, n = Rl(e);
  return n || t;
}
function Yu(e) {
  for (var t = {}, n = 0, i = e; n < i.length; n++) {
    var r = i[n];
    switch (r.stem) {
      case "percent":
      case "%":
        t.style = "percent";
        continue;
      case "%x100":
        t.style = "percent", t.scale = 100;
        continue;
      case "currency":
        t.style = "currency", t.currency = r.options[0];
        continue;
      case "group-off":
      case ",_":
        t.useGrouping = !1;
        continue;
      case "precision-integer":
      case ".":
        t.maximumFractionDigits = 0;
        continue;
      case "measure-unit":
      case "unit":
        t.style = "unit", t.unit = Zu(r.options[0]);
        continue;
      case "compact-short":
      case "K":
        t.notation = "compact", t.compactDisplay = "short";
        continue;
      case "compact-long":
      case "KK":
        t.notation = "compact", t.compactDisplay = "long";
        continue;
      case "scientific":
        t = F(F(F({}, t), { notation: "scientific" }), r.options.reduce(function(o, a) {
          return F(F({}, o), pr(a));
        }, {}));
        continue;
      case "engineering":
        t = F(F(F({}, t), { notation: "engineering" }), r.options.reduce(function(o, a) {
          return F(F({}, o), pr(a));
        }, {}));
        continue;
      case "notation-simple":
        t.notation = "standard";
        continue;
      case "unit-width-narrow":
        t.currencyDisplay = "narrowSymbol", t.unitDisplay = "narrow";
        continue;
      case "unit-width-short":
        t.currencyDisplay = "code", t.unitDisplay = "short";
        continue;
      case "unit-width-full-name":
        t.currencyDisplay = "name", t.unitDisplay = "long";
        continue;
      case "unit-width-iso-code":
        t.currencyDisplay = "symbol";
        continue;
      case "scale":
        t.scale = parseFloat(r.options[0]);
        continue;
      case "integer-width":
        if (r.options.length > 1)
          throw new RangeError("integer-width stems only accept a single optional option");
        r.options[0].replace(Ju, function(o, a, f, c, _, h) {
          if (a)
            t.minimumIntegerDigits = f.length;
          else {
            if (c && _)
              throw new Error("We currently do not support maximum integer digits");
            if (h)
              throw new Error("We currently do not support exact integer digits");
          }
          return "";
        });
        continue;
    }
    if (Dl.test(r.stem)) {
      t.minimumIntegerDigits = r.stem.length;
      continue;
    }
    if (mr.test(r.stem)) {
      if (r.options.length > 1)
        throw new RangeError("Fraction-precision stems only accept a single optional option");
      r.stem.replace(mr, function(o, a, f, c, _, h) {
        return f === "*" ? t.minimumFractionDigits = a.length : c && c[0] === "#" ? t.maximumFractionDigits = c.length : _ && h ? (t.minimumFractionDigits = _.length, t.maximumFractionDigits = _.length + h.length) : (t.minimumFractionDigits = a.length, t.maximumFractionDigits = a.length), "";
      });
      var l = r.options[0];
      l === "w" ? t = F(F({}, t), { trailingZeroDisplay: "stripIfInteger" }) : l && (t = F(F({}, t), gr(l)));
      continue;
    }
    if (Ml.test(r.stem)) {
      t = F(F({}, t), gr(r.stem));
      continue;
    }
    var s = Rl(r.stem);
    s && (t = F(F({}, t), s));
    var u = Qu(r.stem);
    u && (t = F(F({}, t), u));
  }
  return t;
}
var tn = {
  AX: [
    "H"
  ],
  BQ: [
    "H"
  ],
  CP: [
    "H"
  ],
  CZ: [
    "H"
  ],
  DK: [
    "H"
  ],
  FI: [
    "H"
  ],
  ID: [
    "H"
  ],
  IS: [
    "H"
  ],
  ML: [
    "H"
  ],
  NE: [
    "H"
  ],
  RU: [
    "H"
  ],
  SE: [
    "H"
  ],
  SJ: [
    "H"
  ],
  SK: [
    "H"
  ],
  AS: [
    "h",
    "H"
  ],
  BT: [
    "h",
    "H"
  ],
  DJ: [
    "h",
    "H"
  ],
  ER: [
    "h",
    "H"
  ],
  GH: [
    "h",
    "H"
  ],
  IN: [
    "h",
    "H"
  ],
  LS: [
    "h",
    "H"
  ],
  PG: [
    "h",
    "H"
  ],
  PW: [
    "h",
    "H"
  ],
  SO: [
    "h",
    "H"
  ],
  TO: [
    "h",
    "H"
  ],
  VU: [
    "h",
    "H"
  ],
  WS: [
    "h",
    "H"
  ],
  "001": [
    "H",
    "h"
  ],
  AL: [
    "h",
    "H",
    "hB"
  ],
  TD: [
    "h",
    "H",
    "hB"
  ],
  "ca-ES": [
    "H",
    "h",
    "hB"
  ],
  CF: [
    "H",
    "h",
    "hB"
  ],
  CM: [
    "H",
    "h",
    "hB"
  ],
  "fr-CA": [
    "H",
    "h",
    "hB"
  ],
  "gl-ES": [
    "H",
    "h",
    "hB"
  ],
  "it-CH": [
    "H",
    "h",
    "hB"
  ],
  "it-IT": [
    "H",
    "h",
    "hB"
  ],
  LU: [
    "H",
    "h",
    "hB"
  ],
  NP: [
    "H",
    "h",
    "hB"
  ],
  PF: [
    "H",
    "h",
    "hB"
  ],
  SC: [
    "H",
    "h",
    "hB"
  ],
  SM: [
    "H",
    "h",
    "hB"
  ],
  SN: [
    "H",
    "h",
    "hB"
  ],
  TF: [
    "H",
    "h",
    "hB"
  ],
  VA: [
    "H",
    "h",
    "hB"
  ],
  CY: [
    "h",
    "H",
    "hb",
    "hB"
  ],
  GR: [
    "h",
    "H",
    "hb",
    "hB"
  ],
  CO: [
    "h",
    "H",
    "hB",
    "hb"
  ],
  DO: [
    "h",
    "H",
    "hB",
    "hb"
  ],
  KP: [
    "h",
    "H",
    "hB",
    "hb"
  ],
  KR: [
    "h",
    "H",
    "hB",
    "hb"
  ],
  NA: [
    "h",
    "H",
    "hB",
    "hb"
  ],
  PA: [
    "h",
    "H",
    "hB",
    "hb"
  ],
  PR: [
    "h",
    "H",
    "hB",
    "hb"
  ],
  VE: [
    "h",
    "H",
    "hB",
    "hb"
  ],
  AC: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  AI: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  BW: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  BZ: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  CC: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  CK: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  CX: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  DG: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  FK: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  GB: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  GG: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  GI: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  IE: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  IM: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  IO: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  JE: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  LT: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  MK: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  MN: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  MS: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  NF: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  NG: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  NR: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  NU: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  PN: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  SH: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  SX: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  TA: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  ZA: [
    "H",
    "h",
    "hb",
    "hB"
  ],
  "af-ZA": [
    "H",
    "h",
    "hB",
    "hb"
  ],
  AR: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  CL: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  CR: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  CU: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  EA: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  "es-BO": [
    "H",
    "h",
    "hB",
    "hb"
  ],
  "es-BR": [
    "H",
    "h",
    "hB",
    "hb"
  ],
  "es-EC": [
    "H",
    "h",
    "hB",
    "hb"
  ],
  "es-ES": [
    "H",
    "h",
    "hB",
    "hb"
  ],
  "es-GQ": [
    "H",
    "h",
    "hB",
    "hb"
  ],
  "es-PE": [
    "H",
    "h",
    "hB",
    "hb"
  ],
  GT: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  HN: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  IC: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  KG: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  KM: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  LK: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  MA: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  MX: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  NI: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  PY: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  SV: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  UY: [
    "H",
    "h",
    "hB",
    "hb"
  ],
  JP: [
    "H",
    "h",
    "K"
  ],
  AD: [
    "H",
    "hB"
  ],
  AM: [
    "H",
    "hB"
  ],
  AO: [
    "H",
    "hB"
  ],
  AT: [
    "H",
    "hB"
  ],
  AW: [
    "H",
    "hB"
  ],
  BE: [
    "H",
    "hB"
  ],
  BF: [
    "H",
    "hB"
  ],
  BJ: [
    "H",
    "hB"
  ],
  BL: [
    "H",
    "hB"
  ],
  BR: [
    "H",
    "hB"
  ],
  CG: [
    "H",
    "hB"
  ],
  CI: [
    "H",
    "hB"
  ],
  CV: [
    "H",
    "hB"
  ],
  DE: [
    "H",
    "hB"
  ],
  EE: [
    "H",
    "hB"
  ],
  FR: [
    "H",
    "hB"
  ],
  GA: [
    "H",
    "hB"
  ],
  GF: [
    "H",
    "hB"
  ],
  GN: [
    "H",
    "hB"
  ],
  GP: [
    "H",
    "hB"
  ],
  GW: [
    "H",
    "hB"
  ],
  HR: [
    "H",
    "hB"
  ],
  IL: [
    "H",
    "hB"
  ],
  IT: [
    "H",
    "hB"
  ],
  KZ: [
    "H",
    "hB"
  ],
  MC: [
    "H",
    "hB"
  ],
  MD: [
    "H",
    "hB"
  ],
  MF: [
    "H",
    "hB"
  ],
  MQ: [
    "H",
    "hB"
  ],
  MZ: [
    "H",
    "hB"
  ],
  NC: [
    "H",
    "hB"
  ],
  NL: [
    "H",
    "hB"
  ],
  PM: [
    "H",
    "hB"
  ],
  PT: [
    "H",
    "hB"
  ],
  RE: [
    "H",
    "hB"
  ],
  RO: [
    "H",
    "hB"
  ],
  SI: [
    "H",
    "hB"
  ],
  SR: [
    "H",
    "hB"
  ],
  ST: [
    "H",
    "hB"
  ],
  TG: [
    "H",
    "hB"
  ],
  TR: [
    "H",
    "hB"
  ],
  WF: [
    "H",
    "hB"
  ],
  YT: [
    "H",
    "hB"
  ],
  BD: [
    "h",
    "hB",
    "H"
  ],
  PK: [
    "h",
    "hB",
    "H"
  ],
  AZ: [
    "H",
    "hB",
    "h"
  ],
  BA: [
    "H",
    "hB",
    "h"
  ],
  BG: [
    "H",
    "hB",
    "h"
  ],
  CH: [
    "H",
    "hB",
    "h"
  ],
  GE: [
    "H",
    "hB",
    "h"
  ],
  LI: [
    "H",
    "hB",
    "h"
  ],
  ME: [
    "H",
    "hB",
    "h"
  ],
  RS: [
    "H",
    "hB",
    "h"
  ],
  UA: [
    "H",
    "hB",
    "h"
  ],
  UZ: [
    "H",
    "hB",
    "h"
  ],
  XK: [
    "H",
    "hB",
    "h"
  ],
  AG: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  AU: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  BB: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  BM: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  BS: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  CA: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  DM: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  "en-001": [
    "h",
    "hb",
    "H",
    "hB"
  ],
  FJ: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  FM: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  GD: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  GM: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  GU: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  GY: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  JM: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  KI: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  KN: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  KY: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  LC: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  LR: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  MH: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  MP: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  MW: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  NZ: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  SB: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  SG: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  SL: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  SS: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  SZ: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  TC: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  TT: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  UM: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  US: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  VC: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  VG: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  VI: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  ZM: [
    "h",
    "hb",
    "H",
    "hB"
  ],
  BO: [
    "H",
    "hB",
    "h",
    "hb"
  ],
  EC: [
    "H",
    "hB",
    "h",
    "hb"
  ],
  ES: [
    "H",
    "hB",
    "h",
    "hb"
  ],
  GQ: [
    "H",
    "hB",
    "h",
    "hb"
  ],
  PE: [
    "H",
    "hB",
    "h",
    "hb"
  ],
  AE: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  "ar-001": [
    "h",
    "hB",
    "hb",
    "H"
  ],
  BH: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  DZ: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  EG: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  EH: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  HK: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  IQ: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  JO: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  KW: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  LB: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  LY: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  MO: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  MR: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  OM: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  PH: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  PS: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  QA: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  SA: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  SD: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  SY: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  TN: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  YE: [
    "h",
    "hB",
    "hb",
    "H"
  ],
  AF: [
    "H",
    "hb",
    "hB",
    "h"
  ],
  LA: [
    "H",
    "hb",
    "hB",
    "h"
  ],
  CN: [
    "H",
    "hB",
    "hb",
    "h"
  ],
  LV: [
    "H",
    "hB",
    "hb",
    "h"
  ],
  TL: [
    "H",
    "hB",
    "hb",
    "h"
  ],
  "zu-ZA": [
    "H",
    "hB",
    "hb",
    "h"
  ],
  CD: [
    "hB",
    "H"
  ],
  IR: [
    "hB",
    "H"
  ],
  "hi-IN": [
    "hB",
    "h",
    "H"
  ],
  "kn-IN": [
    "hB",
    "h",
    "H"
  ],
  "ml-IN": [
    "hB",
    "h",
    "H"
  ],
  "te-IN": [
    "hB",
    "h",
    "H"
  ],
  KH: [
    "hB",
    "h",
    "H",
    "hb"
  ],
  "ta-IN": [
    "hB",
    "h",
    "hb",
    "H"
  ],
  BN: [
    "hb",
    "hB",
    "h",
    "H"
  ],
  MY: [
    "hb",
    "hB",
    "h",
    "H"
  ],
  ET: [
    "hB",
    "hb",
    "h",
    "H"
  ],
  "gu-IN": [
    "hB",
    "hb",
    "h",
    "H"
  ],
  "mr-IN": [
    "hB",
    "hb",
    "h",
    "H"
  ],
  "pa-IN": [
    "hB",
    "hb",
    "h",
    "H"
  ],
  TW: [
    "hB",
    "hb",
    "h",
    "H"
  ],
  KE: [
    "hB",
    "hb",
    "H",
    "h"
  ],
  MM: [
    "hB",
    "hb",
    "H",
    "h"
  ],
  TZ: [
    "hB",
    "hb",
    "H",
    "h"
  ],
  UG: [
    "hB",
    "hb",
    "H",
    "h"
  ]
};
function Ku(e, t) {
  for (var n = "", i = 0; i < e.length; i++) {
    var r = e.charAt(i);
    if (r === "j") {
      for (var l = 0; i + 1 < e.length && e.charAt(i + 1) === r; )
        l++, i++;
      var s = 1 + (l & 1), u = l < 2 ? 1 : 3 + (l >> 1), o = "a", a = $u(t);
      for ((a == "H" || a == "k") && (u = 0); u-- > 0; )
        n += o;
      for (; s-- > 0; )
        n = a + n;
    } else
      r === "J" ? n += "H" : n += r;
  }
  return n;
}
function $u(e) {
  var t = e.hourCycle;
  if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet
  e.hourCycles && // @ts-ignore
  e.hourCycles.length && (t = e.hourCycles[0]), t)
    switch (t) {
      case "h24":
        return "k";
      case "h23":
        return "H";
      case "h12":
        return "h";
      case "h11":
        return "K";
      default:
        throw new Error("Invalid hourCycle");
    }
  var n = e.language, i;
  n !== "root" && (i = e.maximize().region);
  var r = tn[i || ""] || tn[n || ""] || tn["".concat(n, "-001")] || tn["001"];
  return r[0];
}
var Jn, ef = new RegExp("^".concat(Ll.source, "*")), tf = new RegExp("".concat(Ll.source, "*$"));
function O(e, t) {
  return { start: e, end: t };
}
var nf = !!String.prototype.startsWith, rf = !!String.fromCodePoint, lf = !!Object.fromEntries, sf = !!String.prototype.codePointAt, of = !!String.prototype.trimStart, af = !!String.prototype.trimEnd, uf = !!Number.isSafeInteger, ff = uf ? Number.isSafeInteger : function(e) {
  return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;
}, _i = !0;
try {
  var cf = Fl("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
  _i = ((Jn = cf.exec("a")) === null || Jn === void 0 ? void 0 : Jn[0]) === "a";
} catch {
  _i = !1;
}
var br = nf ? (
  // Native
  function(t, n, i) {
    return t.startsWith(n, i);
  }
) : (
  // For IE11
  function(t, n, i) {
    return t.slice(i, i + n.length) === n;
  }
), di = rf ? String.fromCodePoint : (
  // IE11
  function() {
    for (var t = [], n = 0; n < arguments.length; n++)
      t[n] = arguments[n];
    for (var i = "", r = t.length, l = 0, s; r > l; ) {
      if (s = t[l++], s > 1114111)
        throw RangeError(s + " is not a valid code point");
      i += s < 65536 ? String.fromCharCode(s) : String.fromCharCode(((s -= 65536) >> 10) + 55296, s % 1024 + 56320);
    }
    return i;
  }
), vr = (
  // native
  lf ? Object.fromEntries : (
    // Ponyfill
    function(t) {
      for (var n = {}, i = 0, r = t; i < r.length; i++) {
        var l = r[i], s = l[0], u = l[1];
        n[s] = u;
      }
      return n;
    }
  )
), Ul = sf ? (
  // Native
  function(t, n) {
    return t.codePointAt(n);
  }
) : (
  // IE 11
  function(t, n) {
    var i = t.length;
    if (!(n < 0 || n >= i)) {
      var r = t.charCodeAt(n), l;
      return r < 55296 || r > 56319 || n + 1 === i || (l = t.charCodeAt(n + 1)) < 56320 || l > 57343 ? r : (r - 55296 << 10) + (l - 56320) + 65536;
    }
  }
), hf = of ? (
  // Native
  function(t) {
    return t.trimStart();
  }
) : (
  // Ponyfill
  function(t) {
    return t.replace(ef, "");
  }
), _f = af ? (
  // Native
  function(t) {
    return t.trimEnd();
  }
) : (
  // Ponyfill
  function(t) {
    return t.replace(tf, "");
  }
);
function Fl(e, t) {
  return new RegExp(e, t);
}
var mi;
if (_i) {
  var yr = Fl("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
  mi = function(t, n) {
    var i;
    yr.lastIndex = n;
    var r = yr.exec(t);
    return (i = r[1]) !== null && i !== void 0 ? i : "";
  };
} else
  mi = function(t, n) {
    for (var i = []; ; ) {
      var r = Ul(t, n);
      if (r === void 0 || Gl(r) || pf(r))
        break;
      i.push(r), n += r >= 65536 ? 2 : 1;
    }
    return di.apply(void 0, i);
  };
var df = (
  /** @class */
  function() {
    function e(t, n) {
      n === void 0 && (n = {}), this.message = t, this.position = { offset: 0, line: 1, column: 1 }, this.ignoreTag = !!n.ignoreTag, this.locale = n.locale, this.requiresOtherClause = !!n.requiresOtherClause, this.shouldParseSkeletons = !!n.shouldParseSkeletons;
    }
    return e.prototype.parse = function() {
      if (this.offset() !== 0)
        throw Error("parser can only be used once");
      return this.parseMessage(0, "", !1);
    }, e.prototype.parseMessage = function(t, n, i) {
      for (var r = []; !this.isEOF(); ) {
        var l = this.char();
        if (l === 123) {
          var s = this.parseArgument(t, i);
          if (s.err)
            return s;
          r.push(s.val);
        } else {
          if (l === 125 && t > 0)
            break;
          if (l === 35 && (n === "plural" || n === "selectordinal")) {
            var u = this.clonePosition();
            this.bump(), r.push({
              type: j.pound,
              location: O(u, this.clonePosition())
            });
          } else if (l === 60 && !this.ignoreTag && this.peek() === 47) {
            if (i)
              break;
            return this.error(I.UNMATCHED_CLOSING_TAG, O(this.clonePosition(), this.clonePosition()));
          } else if (l === 60 && !this.ignoreTag && gi(this.peek() || 0)) {
            var s = this.parseTag(t, n);
            if (s.err)
              return s;
            r.push(s.val);
          } else {
            var s = this.parseLiteral(t, n);
            if (s.err)
              return s;
            r.push(s.val);
          }
        }
      }
      return { val: r, err: null };
    }, e.prototype.parseTag = function(t, n) {
      var i = this.clonePosition();
      this.bump();
      var r = this.parseTagName();
      if (this.bumpSpace(), this.bumpIf("/>"))
        return {
          val: {
            type: j.literal,
            value: "<".concat(r, "/>"),
            location: O(i, this.clonePosition())
          },
          err: null
        };
      if (this.bumpIf(">")) {
        var l = this.parseMessage(t + 1, n, !0);
        if (l.err)
          return l;
        var s = l.val, u = this.clonePosition();
        if (this.bumpIf("</")) {
          if (this.isEOF() || !gi(this.char()))
            return this.error(I.INVALID_TAG, O(u, this.clonePosition()));
          var o = this.clonePosition(), a = this.parseTagName();
          return r !== a ? this.error(I.UNMATCHED_CLOSING_TAG, O(o, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? {
            val: {
              type: j.tag,
              value: r,
              children: s,
              location: O(i, this.clonePosition())
            },
            err: null
          } : this.error(I.INVALID_TAG, O(u, this.clonePosition())));
        } else
          return this.error(I.UNCLOSED_TAG, O(i, this.clonePosition()));
      } else
        return this.error(I.INVALID_TAG, O(i, this.clonePosition()));
    }, e.prototype.parseTagName = function() {
      var t = this.offset();
      for (this.bump(); !this.isEOF() && gf(this.char()); )
        this.bump();
      return this.message.slice(t, this.offset());
    }, e.prototype.parseLiteral = function(t, n) {
      for (var i = this.clonePosition(), r = ""; ; ) {
        var l = this.tryParseQuote(n);
        if (l) {
          r += l;
          continue;
        }
        var s = this.tryParseUnquoted(t, n);
        if (s) {
          r += s;
          continue;
        }
        var u = this.tryParseLeftAngleBracket();
        if (u) {
          r += u;
          continue;
        }
        break;
      }
      var o = O(i, this.clonePosition());
      return {
        val: { type: j.literal, value: r, location: o },
        err: null
      };
    }, e.prototype.tryParseLeftAngleBracket = function() {
      return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail.
      !mf(this.peek() || 0)) ? (this.bump(), "<") : null;
    }, e.prototype.tryParseQuote = function(t) {
      if (this.isEOF() || this.char() !== 39)
        return null;
      switch (this.peek()) {
        case 39:
          return this.bump(), this.bump(), "'";
        case 123:
        case 60:
        case 62:
        case 125:
          break;
        case 35:
          if (t === "plural" || t === "selectordinal")
            break;
          return null;
        default:
          return null;
      }
      this.bump();
      var n = [this.char()];
      for (this.bump(); !this.isEOF(); ) {
        var i = this.char();
        if (i === 39)
          if (this.peek() === 39)
            n.push(39), this.bump();
          else {
            this.bump();
            break;
          }
        else
          n.push(i);
        this.bump();
      }
      return di.apply(void 0, n);
    }, e.prototype.tryParseUnquoted = function(t, n) {
      if (this.isEOF())
        return null;
      var i = this.char();
      return i === 60 || i === 123 || i === 35 && (n === "plural" || n === "selectordinal") || i === 125 && t > 0 ? null : (this.bump(), di(i));
    }, e.prototype.parseArgument = function(t, n) {
      var i = this.clonePosition();
      if (this.bump(), this.bumpSpace(), this.isEOF())
        return this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE, O(i, this.clonePosition()));
      if (this.char() === 125)
        return this.bump(), this.error(I.EMPTY_ARGUMENT, O(i, this.clonePosition()));
      var r = this.parseIdentifierIfPossible().value;
      if (!r)
        return this.error(I.MALFORMED_ARGUMENT, O(i, this.clonePosition()));
      if (this.bumpSpace(), this.isEOF())
        return this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE, O(i, this.clonePosition()));
      switch (this.char()) {
        case 125:
          return this.bump(), {
            val: {
              type: j.argument,
              // value does not include the opening and closing braces.
              value: r,
              location: O(i, this.clonePosition())
            },
            err: null
          };
        case 44:
          return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE, O(i, this.clonePosition())) : this.parseArgumentOptions(t, n, r, i);
        default:
          return this.error(I.MALFORMED_ARGUMENT, O(i, this.clonePosition()));
      }
    }, e.prototype.parseIdentifierIfPossible = function() {
      var t = this.clonePosition(), n = this.offset(), i = mi(this.message, n), r = n + i.length;
      this.bumpTo(r);
      var l = this.clonePosition(), s = O(t, l);
      return { value: i, location: s };
    }, e.prototype.parseArgumentOptions = function(t, n, i, r) {
      var l, s = this.clonePosition(), u = this.parseIdentifierIfPossible().value, o = this.clonePosition();
      switch (u) {
        case "":
          return this.error(I.EXPECT_ARGUMENT_TYPE, O(s, o));
        case "number":
        case "date":
        case "time": {
          this.bumpSpace();
          var a = null;
          if (this.bumpIf(",")) {
            this.bumpSpace();
            var f = this.clonePosition(), c = this.parseSimpleArgStyleIfPossible();
            if (c.err)
              return c;
            var _ = _f(c.val);
            if (_.length === 0)
              return this.error(I.EXPECT_ARGUMENT_STYLE, O(this.clonePosition(), this.clonePosition()));
            var h = O(f, this.clonePosition());
            a = { style: _, styleLocation: h };
          }
          var d = this.tryParseArgumentClose(r);
          if (d.err)
            return d;
          var w = O(r, this.clonePosition());
          if (a && br(a == null ? void 0 : a.style, "::", 0)) {
            var y = hf(a.style.slice(2));
            if (u === "number") {
              var c = this.parseNumberSkeletonFromString(y, a.styleLocation);
              return c.err ? c : {
                val: { type: j.number, value: i, location: w, style: c.val },
                err: null
              };
            } else {
              if (y.length === 0)
                return this.error(I.EXPECT_DATE_TIME_SKELETON, w);
              var v = y;
              this.locale && (v = Ku(y, this.locale));
              var _ = {
                type: Tt.dateTime,
                pattern: v,
                location: a.styleLocation,
                parsedOptions: this.shouldParseSkeletons ? Vu(v) : {}
              }, p = u === "date" ? j.date : j.time;
              return {
                val: { type: p, value: i, location: w, style: _ },
                err: null
              };
            }
          }
          return {
            val: {
              type: u === "number" ? j.number : u === "date" ? j.date : j.time,
              value: i,
              location: w,
              style: (l = a == null ? void 0 : a.style) !== null && l !== void 0 ? l : null
            },
            err: null
          };
        }
        case "plural":
        case "selectordinal":
        case "select": {
          var g = this.clonePosition();
          if (this.bumpSpace(), !this.bumpIf(","))
            return this.error(I.EXPECT_SELECT_ARGUMENT_OPTIONS, O(g, F({}, g)));
          this.bumpSpace();
          var T = this.parseIdentifierIfPossible(), E = 0;
          if (u !== "select" && T.value === "offset") {
            if (!this.bumpIf(":"))
              return this.error(I.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, O(this.clonePosition(), this.clonePosition()));
            this.bumpSpace();
            var c = this.tryParseDecimalInteger(I.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, I.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
            if (c.err)
              return c;
            this.bumpSpace(), T = this.parseIdentifierIfPossible(), E = c.val;
          }
          var S = this.tryParsePluralOrSelectOptions(t, u, n, T);
          if (S.err)
            return S;
          var d = this.tryParseArgumentClose(r);
          if (d.err)
            return d;
          var D = O(r, this.clonePosition());
          return u === "select" ? {
            val: {
              type: j.select,
              value: i,
              options: vr(S.val),
              location: D
            },
            err: null
          } : {
            val: {
              type: j.plural,
              value: i,
              options: vr(S.val),
              offset: E,
              pluralType: u === "plural" ? "cardinal" : "ordinal",
              location: D
            },
            err: null
          };
        }
        default:
          return this.error(I.INVALID_ARGUMENT_TYPE, O(s, o));
      }
    }, e.prototype.tryParseArgumentClose = function(t) {
      return this.isEOF() || this.char() !== 125 ? this.error(I.EXPECT_ARGUMENT_CLOSING_BRACE, O(t, this.clonePosition())) : (this.bump(), { val: !0, err: null });
    }, e.prototype.parseSimpleArgStyleIfPossible = function() {
      for (var t = 0, n = this.clonePosition(); !this.isEOF(); ) {
        var i = this.char();
        switch (i) {
          case 39: {
            this.bump();
            var r = this.clonePosition();
            if (!this.bumpUntil("'"))
              return this.error(I.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, O(r, this.clonePosition()));
            this.bump();
            break;
          }
          case 123: {
            t += 1, this.bump();
            break;
          }
          case 125: {
            if (t > 0)
              t -= 1;
            else
              return {
                val: this.message.slice(n.offset, this.offset()),
                err: null
              };
            break;
          }
          default:
            this.bump();
            break;
        }
      }
      return {
        val: this.message.slice(n.offset, this.offset()),
        err: null
      };
    }, e.prototype.parseNumberSkeletonFromString = function(t, n) {
      var i = [];
      try {
        i = Wu(t);
      } catch {
        return this.error(I.INVALID_NUMBER_SKELETON, n);
      }
      return {
        val: {
          type: Tt.number,
          tokens: i,
          location: n,
          parsedOptions: this.shouldParseSkeletons ? Yu(i) : {}
        },
        err: null
      };
    }, e.prototype.tryParsePluralOrSelectOptions = function(t, n, i, r) {
      for (var l, s = !1, u = [], o = /* @__PURE__ */ new Set(), a = r.value, f = r.location; ; ) {
        if (a.length === 0) {
          var c = this.clonePosition();
          if (n !== "select" && this.bumpIf("=")) {
            var _ = this.tryParseDecimalInteger(I.EXPECT_PLURAL_ARGUMENT_SELECTOR, I.INVALID_PLURAL_ARGUMENT_SELECTOR);
            if (_.err)
              return _;
            f = O(c, this.clonePosition()), a = this.message.slice(c.offset, this.offset());
          } else
            break;
        }
        if (o.has(a))
          return this.error(n === "select" ? I.DUPLICATE_SELECT_ARGUMENT_SELECTOR : I.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, f);
        a === "other" && (s = !0), this.bumpSpace();
        var h = this.clonePosition();
        if (!this.bumpIf("{"))
          return this.error(n === "select" ? I.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : I.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, O(this.clonePosition(), this.clonePosition()));
        var d = this.parseMessage(t + 1, n, i);
        if (d.err)
          return d;
        var w = this.tryParseArgumentClose(h);
        if (w.err)
          return w;
        u.push([
          a,
          {
            value: d.val,
            location: O(h, this.clonePosition())
          }
        ]), o.add(a), this.bumpSpace(), l = this.parseIdentifierIfPossible(), a = l.value, f = l.location;
      }
      return u.length === 0 ? this.error(n === "select" ? I.EXPECT_SELECT_ARGUMENT_SELECTOR : I.EXPECT_PLURAL_ARGUMENT_SELECTOR, O(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !s ? this.error(I.MISSING_OTHER_CLAUSE, O(this.clonePosition(), this.clonePosition())) : { val: u, err: null };
    }, e.prototype.tryParseDecimalInteger = function(t, n) {
      var i = 1, r = this.clonePosition();
      this.bumpIf("+") || this.bumpIf("-") && (i = -1);
      for (var l = !1, s = 0; !this.isEOF(); ) {
        var u = this.char();
        if (u >= 48 && u <= 57)
          l = !0, s = s * 10 + (u - 48), this.bump();
        else
          break;
      }
      var o = O(r, this.clonePosition());
      return l ? (s *= i, ff(s) ? { val: s, err: null } : this.error(n, o)) : this.error(t, o);
    }, e.prototype.offset = function() {
      return this.position.offset;
    }, e.prototype.isEOF = function() {
      return this.offset() === this.message.length;
    }, e.prototype.clonePosition = function() {
      return {
        offset: this.position.offset,
        line: this.position.line,
        column: this.position.column
      };
    }, e.prototype.char = function() {
      var t = this.position.offset;
      if (t >= this.message.length)
        throw Error("out of bound");
      var n = Ul(this.message, t);
      if (n === void 0)
        throw Error("Offset ".concat(t, " is at invalid UTF-16 code unit boundary"));
      return n;
    }, e.prototype.error = function(t, n) {
      return {
        val: null,
        err: {
          kind: t,
          message: this.message,
          location: n
        }
      };
    }, e.prototype.bump = function() {
      if (!this.isEOF()) {
        var t = this.char();
        t === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += t < 65536 ? 1 : 2);
      }
    }, e.prototype.bumpIf = function(t) {
      if (br(this.message, t, this.offset())) {
        for (var n = 0; n < t.length; n++)
          this.bump();
        return !0;
      }
      return !1;
    }, e.prototype.bumpUntil = function(t) {
      var n = this.offset(), i = this.message.indexOf(t, n);
      return i >= 0 ? (this.bumpTo(i), !0) : (this.bumpTo(this.message.length), !1);
    }, e.prototype.bumpTo = function(t) {
      if (this.offset() > t)
        throw Error("targetOffset ".concat(t, " must be greater than or equal to the current offset ").concat(this.offset()));
      for (t = Math.min(t, this.message.length); ; ) {
        var n = this.offset();
        if (n === t)
          break;
        if (n > t)
          throw Error("targetOffset ".concat(t, " is at invalid UTF-16 code unit boundary"));
        if (this.bump(), this.isEOF())
          break;
      }
    }, e.prototype.bumpSpace = function() {
      for (; !this.isEOF() && Gl(this.char()); )
        this.bump();
    }, e.prototype.peek = function() {
      if (this.isEOF())
        return null;
      var t = this.char(), n = this.offset(), i = this.message.charCodeAt(n + (t >= 65536 ? 2 : 1));
      return i ?? null;
    }, e;
  }()
);
function gi(e) {
  return e >= 97 && e <= 122 || e >= 65 && e <= 90;
}
function mf(e) {
  return gi(e) || e === 47;
}
function gf(e) {
  return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
}
function Gl(e) {
  return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;
}
function pf(e) {
  return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094;
}
function pi(e) {
  e.forEach(function(t) {
    if (delete t.location, Pl(t) || Nl(t))
      for (var n in t.options)
        delete t.options[n].location, pi(t.options[n].value);
    else
      Al(t) && Ol(t.style) || (Hl(t) || Cl(t)) && hi(t.style) ? delete t.style.location : Il(t) && pi(t.children);
  });
}
function bf(e, t) {
  t === void 0 && (t = {}), t = F({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t);
  var n = new df(e, t).parse();
  if (n.err) {
    var i = SyntaxError(I[n.err.kind]);
    throw i.location = n.err.location, i.originalMessage = n.err.message, i;
  }
  return t != null && t.captureLocation || pi(n.val), n.val;
}
function Qn(e, t) {
  var n = t && t.cache ? t.cache : kf, i = t && t.serializer ? t.serializer : Sf, r = t && t.strategy ? t.strategy : yf;
  return r(e, {
    cache: n,
    serializer: i
  });
}
function vf(e) {
  return e == null || typeof e == "number" || typeof e == "boolean";
}
function ql(e, t, n, i) {
  var r = vf(i) ? i : n(i), l = t.get(r);
  return typeof l > "u" && (l = e.call(this, i), t.set(r, l)), l;
}
function xl(e, t, n) {
  var i = Array.prototype.slice.call(arguments, 3), r = n(i), l = t.get(r);
  return typeof l > "u" && (l = e.apply(this, i), t.set(r, l)), l;
}
function Hi(e, t, n, i, r) {
  return n.bind(t, e, i, r);
}
function yf(e, t) {
  var n = e.length === 1 ? ql : xl;
  return Hi(e, this, n, t.cache.create(), t.serializer);
}
function wf(e, t) {
  return Hi(e, this, xl, t.cache.create(), t.serializer);
}
function Ef(e, t) {
  return Hi(e, this, ql, t.cache.create(), t.serializer);
}
var Sf = function() {
  return JSON.stringify(arguments);
};
function Ci() {
  this.cache = /* @__PURE__ */ Object.create(null);
}
Ci.prototype.get = function(e) {
  return this.cache[e];
};
Ci.prototype.set = function(e, t) {
  this.cache[e] = t;
};
var kf = {
  create: function() {
    return new Ci();
  }
}, Yn = {
  variadic: wf,
  monadic: Ef
}, Bt;
(function(e) {
  e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API";
})(Bt || (Bt = {}));
var kn = (
  /** @class */
  function(e) {
    Sn(t, e);
    function t(n, i, r) {
      var l = e.call(this, n) || this;
      return l.code = i, l.originalMessage = r, l;
    }
    return t.prototype.toString = function() {
      return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
    }, t;
  }(Error)
), wr = (
  /** @class */
  function(e) {
    Sn(t, e);
    function t(n, i, r, l) {
      return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(i, '". Options are "').concat(Object.keys(r).join('", "'), '"'), Bt.INVALID_VALUE, l) || this;
    }
    return t;
  }(kn)
), Tf = (
  /** @class */
  function(e) {
    Sn(t, e);
    function t(n, i, r) {
      return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(i), Bt.INVALID_VALUE, r) || this;
    }
    return t;
  }(kn)
), Bf = (
  /** @class */
  function(e) {
    Sn(t, e);
    function t(n, i) {
      return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(i, '"'), Bt.MISSING_VALUE, i) || this;
    }
    return t;
  }(kn)
), le;
(function(e) {
  e[e.literal = 0] = "literal", e[e.object = 1] = "object";
})(le || (le = {}));
function Af(e) {
  return e.length < 2 ? e : e.reduce(function(t, n) {
    var i = t[t.length - 1];
    return !i || i.type !== le.literal || n.type !== le.literal ? t.push(n) : i.value += n.value, t;
  }, []);
}
function Hf(e) {
  return typeof e == "function";
}
function an(e, t, n, i, r, l, s) {
  if (e.length === 1 && dr(e[0]))
    return [
      {
        type: le.literal,
        value: e[0].value
      }
    ];
  for (var u = [], o = 0, a = e; o < a.length; o++) {
    var f = a[o];
    if (dr(f)) {
      u.push({
        type: le.literal,
        value: f.value
      });
      continue;
    }
    if (ju(f)) {
      typeof l == "number" && u.push({
        type: le.literal,
        value: n.getNumberFormat(t).format(l)
      });
      continue;
    }
    var c = f.value;
    if (!(r && c in r))
      throw new Bf(c, s);
    var _ = r[c];
    if (xu(f)) {
      (!_ || typeof _ == "string" || typeof _ == "number") && (_ = typeof _ == "string" || typeof _ == "number" ? String(_) : ""), u.push({
        type: typeof _ == "string" ? le.literal : le.object,
        value: _
      });
      continue;
    }
    if (Hl(f)) {
      var h = typeof f.style == "string" ? i.date[f.style] : hi(f.style) ? f.style.parsedOptions : void 0;
      u.push({
        type: le.literal,
        value: n.getDateTimeFormat(t, h).format(_)
      });
      continue;
    }
    if (Cl(f)) {
      var h = typeof f.style == "string" ? i.time[f.style] : hi(f.style) ? f.style.parsedOptions : i.time.medium;
      u.push({
        type: le.literal,
        value: n.getDateTimeFormat(t, h).format(_)
      });
      continue;
    }
    if (Al(f)) {
      var h = typeof f.style == "string" ? i.number[f.style] : Ol(f.style) ? f.style.parsedOptions : void 0;
      h && h.scale && (_ = _ * (h.scale || 1)), u.push({
        type: le.literal,
        value: n.getNumberFormat(t, h).format(_)
      });
      continue;
    }
    if (Il(f)) {
      var d = f.children, w = f.value, y = r[w];
      if (!Hf(y))
        throw new Tf(w, "function", s);
      var v = an(d, t, n, i, r, l), p = y(v.map(function(E) {
        return E.value;
      }));
      Array.isArray(p) || (p = [p]), u.push.apply(u, p.map(function(E) {
        return {
          type: typeof E == "string" ? le.literal : le.object,
          value: E
        };
      }));
    }
    if (Pl(f)) {
      var g = f.options[_] || f.options.other;
      if (!g)
        throw new wr(f.value, _, Object.keys(f.options), s);
      u.push.apply(u, an(g.value, t, n, i, r));
      continue;
    }
    if (Nl(f)) {
      var g = f.options["=".concat(_)];
      if (!g) {
        if (!Intl.PluralRules)
          throw new kn(`Intl.PluralRules is not available in this environment.
Try polyfilling it using "@formatjs/intl-pluralrules"
`, Bt.MISSING_INTL_API, s);
        var T = n.getPluralRules(t, { type: f.pluralType }).select(_ - (f.offset || 0));
        g = f.options[T] || f.options.other;
      }
      if (!g)
        throw new wr(f.value, _, Object.keys(f.options), s);
      u.push.apply(u, an(g.value, t, n, i, r, _ - (f.offset || 0)));
      continue;
    }
  }
  return Af(u);
}
function Cf(e, t) {
  return t ? F(F(F({}, e || {}), t || {}), Object.keys(e).reduce(function(n, i) {
    return n[i] = F(F({}, e[i]), t[i] || {}), n;
  }, {})) : e;
}
function Pf(e, t) {
  return t ? Object.keys(e).reduce(function(n, i) {
    return n[i] = Cf(e[i], t[i]), n;
  }, F({}, e)) : e;
}
function Kn(e) {
  return {
    create: function() {
      return {
        get: function(t) {
          return e[t];
        },
        set: function(t, n) {
          e[t] = n;
        }
      };
    }
  };
}
function Nf(e) {
  return e === void 0 && (e = {
    number: {},
    dateTime: {},
    pluralRules: {}
  }), {
    getNumberFormat: Qn(function() {
      for (var t, n = [], i = 0; i < arguments.length; i++)
        n[i] = arguments[i];
      return new ((t = Intl.NumberFormat).bind.apply(t, Zn([void 0], n, !1)))();
    }, {
      cache: Kn(e.number),
      strategy: Yn.variadic
    }),
    getDateTimeFormat: Qn(function() {
      for (var t, n = [], i = 0; i < arguments.length; i++)
        n[i] = arguments[i];
      return new ((t = Intl.DateTimeFormat).bind.apply(t, Zn([void 0], n, !1)))();
    }, {
      cache: Kn(e.dateTime),
      strategy: Yn.variadic
    }),
    getPluralRules: Qn(function() {
      for (var t, n = [], i = 0; i < arguments.length; i++)
        n[i] = arguments[i];
      return new ((t = Intl.PluralRules).bind.apply(t, Zn([void 0], n, !1)))();
    }, {
      cache: Kn(e.pluralRules),
      strategy: Yn.variadic
    })
  };
}
var If = (
  /** @class */
  function() {
    function e(t, n, i, r) {
      var l = this;
      if (n === void 0 && (n = e.defaultLocale), this.formatterCache = {
        number: {},
        dateTime: {},
        pluralRules: {}
      }, this.format = function(s) {
        var u = l.formatToParts(s);
        if (u.length === 1)
          return u[0].value;
        var o = u.reduce(function(a, f) {
          return !a.length || f.type !== le.literal || typeof a[a.length - 1] != "string" ? a.push(f.value) : a[a.length - 1] += f.value, a;
        }, []);
        return o.length <= 1 ? o[0] || "" : o;
      }, this.formatToParts = function(s) {
        return an(l.ast, l.locales, l.formatters, l.formats, s, void 0, l.message);
      }, this.resolvedOptions = function() {
        return {
          locale: l.resolvedLocale.toString()
        };
      }, this.getAst = function() {
        return l.ast;
      }, this.locales = n, this.resolvedLocale = e.resolveLocale(n), typeof t == "string") {
        if (this.message = t, !e.__parse)
          throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
        this.ast = e.__parse(t, {
          ignoreTag: r == null ? void 0 : r.ignoreTag,
          locale: this.resolvedLocale
        });
      } else
        this.ast = t;
      if (!Array.isArray(this.ast))
        throw new TypeError("A message must be provided as a String or AST.");
      this.formats = Pf(e.formats, i), this.formatters = r && r.formatters || Nf(this.formatterCache);
    }
    return Object.defineProperty(e, "defaultLocale", {
      get: function() {
        return e.memoizedDefaultLocale || (e.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale), e.memoizedDefaultLocale;
      },
      enumerable: !1,
      configurable: !0
    }), e.memoizedDefaultLocale = null, e.resolveLocale = function(t) {
      var n = Intl.NumberFormat.supportedLocalesOf(t);
      return n.length > 0 ? new Intl.Locale(n[0]) : new Intl.Locale(typeof t == "string" ? t : t[0]);
    }, e.__parse = bf, e.formats = {
      number: {
        integer: {
          maximumFractionDigits: 0
        },
        currency: {
          style: "currency"
        },
        percent: {
          style: "percent"
        }
      },
      date: {
        short: {
          month: "numeric",
          day: "numeric",
          year: "2-digit"
        },
        medium: {
          month: "short",
          day: "numeric",
          year: "numeric"
        },
        long: {
          month: "long",
          day: "numeric",
          year: "numeric"
        },
        full: {
          weekday: "long",
          month: "long",
          day: "numeric",
          year: "numeric"
        }
      },
      time: {
        short: {
          hour: "numeric",
          minute: "numeric"
        },
        medium: {
          hour: "numeric",
          minute: "numeric",
          second: "numeric"
        },
        long: {
          hour: "numeric",
          minute: "numeric",
          second: "numeric",
          timeZoneName: "short"
        },
        full: {
          hour: "numeric",
          minute: "numeric",
          second: "numeric",
          timeZoneName: "short"
        }
      }
    }, e;
  }()
);
function Of(e, t) {
  if (t == null)
    return;
  if (t in e)
    return e[t];
  const n = t.split(".");
  let i = e;
  for (let r = 0; r < n.length; r++)
    if (typeof i == "object") {
      if (r > 0) {
        const l = n.slice(r, n.length).join(".");
        if (l in i) {
          i = i[l];
          break;
        }
      }
      i = i[n[r]];
    } else
      i = void 0;
  return i;
}
const ze = {}, Lf = (e, t, n) => n && (t in ze || (ze[t] = {}), e in ze[t] || (ze[t][e] = n), n), jl = (e, t) => {
  if (t == null)
    return;
  if (t in ze && e in ze[t])
    return ze[t][e];
  const n = Tn(t);
  for (let i = 0; i < n.length; i++) {
    const r = n[i], l = Df(r, e);
    if (l)
      return Lf(e, t, l);
  }
};
let Pi;
const zt = jt({});
function Mf(e) {
  return Pi[e] || null;
}
function zl(e) {
  return e in Pi;
}
function Df(e, t) {
  if (!zl(e))
    return null;
  const n = Mf(e);
  return Of(n, t);
}
function Rf(e) {
  if (e == null)
    return;
  const t = Tn(e);
  for (let n = 0; n < t.length; n++) {
    const i = t[n];
    if (zl(i))
      return i;
  }
}
function Uf(e, ...t) {
  delete ze[e], zt.update((n) => (n[e] = qu.all([n[e] || {}, ...t]), n));
}
Pt(
  [zt],
  ([e]) => Object.keys(e)
);
zt.subscribe((e) => Pi = e);
const un = {};
function Ff(e, t) {
  un[e].delete(t), un[e].size === 0 && delete un[e];
}
function Vl(e) {
  return un[e];
}
function Gf(e) {
  return Tn(e).map((t) => {
    const n = Vl(t);
    return [t, n ? [...n] : []];
  }).filter(([, t]) => t.length > 0);
}
function bi(e) {
  return e == null ? !1 : Tn(e).some(
    (t) => {
      var n;
      return (n = Vl(t)) == null ? void 0 : n.size;
    }
  );
}
function qf(e, t) {
  return Promise.all(
    t.map((i) => (Ff(e, i), i().then((r) => r.default || r)))
  ).then((i) => Uf(e, ...i));
}
const Mt = {};
function Xl(e) {
  if (!bi(e))
    return e in Mt ? Mt[e] : Promise.resolve();
  const t = Gf(e);
  return Mt[e] = Promise.all(
    t.map(
      ([n, i]) => qf(n, i)
    )
  ).then(() => {
    if (bi(e))
      return Xl(e);
    delete Mt[e];
  }), Mt[e];
}
const xf = {
  number: {
    scientific: { notation: "scientific" },
    engineering: { notation: "engineering" },
    compactLong: { notation: "compact", compactDisplay: "long" },
    compactShort: { notation: "compact", compactDisplay: "short" }
  },
  date: {
    short: { month: "numeric", day: "numeric", year: "2-digit" },
    medium: { month: "short", day: "numeric", year: "numeric" },
    long: { month: "long", day: "numeric", year: "numeric" },
    full: { weekday: "long", month: "long", day: "numeric", year: "numeric" }
  },
  time: {
    short: { hour: "numeric", minute: "numeric" },
    medium: { hour: "numeric", minute: "numeric", second: "numeric" },
    long: {
      hour: "numeric",
      minute: "numeric",
      second: "numeric",
      timeZoneName: "short"
    },
    full: {
      hour: "numeric",
      minute: "numeric",
      second: "numeric",
      timeZoneName: "short"
    }
  }
}, jf = {
  fallbackLocale: null,
  loadingDelay: 200,
  formats: xf,
  warnOnMissingMessages: !0,
  handleMissingMessage: void 0,
  ignoreTag: !0
}, zf = jf;
function At() {
  return zf;
}
const $n = jt(!1);
var Vf = Object.defineProperty, Xf = Object.defineProperties, Wf = Object.getOwnPropertyDescriptors, Er = Object.getOwnPropertySymbols, Zf = Object.prototype.hasOwnProperty, Jf = Object.prototype.propertyIsEnumerable, Sr = (e, t, n) => t in e ? Vf(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Qf = (e, t) => {
  for (var n in t || (t = {}))
    Zf.call(t, n) && Sr(e, n, t[n]);
  if (Er)
    for (var n of Er(t))
      Jf.call(t, n) && Sr(e, n, t[n]);
  return e;
}, Yf = (e, t) => Xf(e, Wf(t));
let vi;
const _n = jt(null);
function kr(e) {
  return e.split("-").map((t, n, i) => i.slice(0, n + 1).join("-")).reverse();
}
function Tn(e, t = At().fallbackLocale) {
  const n = kr(e);
  return t ? [.../* @__PURE__ */ new Set([...n, ...kr(t)])] : n;
}
function ft() {
  return vi ?? void 0;
}
_n.subscribe((e) => {
  vi = e ?? void 0, typeof window < "u" && e != null && document.documentElement.setAttribute("lang", e);
});
const Kf = (e) => {
  if (e && Rf(e) && bi(e)) {
    const { loadingDelay: t } = At();
    let n;
    return typeof window < "u" && ft() != null && t ? n = window.setTimeout(
      () => $n.set(!0),
      t
    ) : $n.set(!0), Xl(e).then(() => {
      _n.set(e);
    }).finally(() => {
      clearTimeout(n), $n.set(!1);
    });
  }
  return _n.set(e);
}, Vt = Yf(Qf({}, _n), {
  set: Kf
}), Bn = (e) => {
  const t = /* @__PURE__ */ Object.create(null);
  return (i) => {
    const r = JSON.stringify(i);
    return r in t ? t[r] : t[r] = e(i);
  };
};
var $f = Object.defineProperty, dn = Object.getOwnPropertySymbols, Wl = Object.prototype.hasOwnProperty, Zl = Object.prototype.propertyIsEnumerable, Tr = (e, t, n) => t in e ? $f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ni = (e, t) => {
  for (var n in t || (t = {}))
    Wl.call(t, n) && Tr(e, n, t[n]);
  if (dn)
    for (var n of dn(t))
      Zl.call(t, n) && Tr(e, n, t[n]);
  return e;
}, Nt = (e, t) => {
  var n = {};
  for (var i in e)
    Wl.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
  if (e != null && dn)
    for (var i of dn(e))
      t.indexOf(i) < 0 && Zl.call(e, i) && (n[i] = e[i]);
  return n;
};
const xt = (e, t) => {
  const { formats: n } = At();
  if (e in n && t in n[e])
    return n[e][t];
  throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`);
}, ec = Bn(
  (e) => {
    var t = e, { locale: n, format: i } = t, r = Nt(t, ["locale", "format"]);
    if (n == null)
      throw new Error('[svelte-i18n] A "locale" must be set to format numbers');
    return i && (r = xt("number", i)), new Intl.NumberFormat(n, r);
  }
), tc = Bn(
  (e) => {
    var t = e, { locale: n, format: i } = t, r = Nt(t, ["locale", "format"]);
    if (n == null)
      throw new Error('[svelte-i18n] A "locale" must be set to format dates');
    return i ? r = xt("date", i) : Object.keys(r).length === 0 && (r = xt("date", "short")), new Intl.DateTimeFormat(n, r);
  }
), nc = Bn(
  (e) => {
    var t = e, { locale: n, format: i } = t, r = Nt(t, ["locale", "format"]);
    if (n == null)
      throw new Error(
        '[svelte-i18n] A "locale" must be set to format time values'
      );
    return i ? r = xt("time", i) : Object.keys(r).length === 0 && (r = xt("time", "short")), new Intl.DateTimeFormat(n, r);
  }
), ic = (e = {}) => {
  var t = e, {
    locale: n = ft()
  } = t, i = Nt(t, [
    "locale"
  ]);
  return ec(Ni({ locale: n }, i));
}, rc = (e = {}) => {
  var t = e, {
    locale: n = ft()
  } = t, i = Nt(t, [
    "locale"
  ]);
  return tc(Ni({ locale: n }, i));
}, lc = (e = {}) => {
  var t = e, {
    locale: n = ft()
  } = t, i = Nt(t, [
    "locale"
  ]);
  return nc(Ni({ locale: n }, i));
}, sc = Bn(
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
  (e, t = ft()) => new If(e, t, At().formats, {
    ignoreTag: At().ignoreTag
  })
), oc = (e, t = {}) => {
  var n, i, r, l;
  let s = t;
  typeof e == "object" && (s = e, e = s.id);
  const {
    values: u,
    locale: o = ft(),
    default: a
  } = s;
  if (o == null)
    throw new Error(
      "[svelte-i18n] Cannot format a message without first setting the initial locale."
    );
  let f = jl(e, o);
  if (!f)
    f = (l = (r = (i = (n = At()).handleMissingMessage) == null ? void 0 : i.call(n, { locale: o, id: e, defaultValue: a })) != null ? r : a) != null ? l : e;
  else if (typeof f != "string")
    return console.warn(
      `[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`
    ), f;
  if (!u)
    return f;
  let c = f;
  try {
    c = sc(f, o).format(u);
  } catch (_) {
    _ instanceof Error && console.warn(
      `[svelte-i18n] Message "${e}" has syntax error:`,
      _.message
    );
  }
  return c;
}, ac = (e, t) => lc(t).format(e), uc = (e, t) => rc(t).format(e), fc = (e, t) => ic(t).format(e), cc = (e, t = ft()) => jl(e, t);
Pt([Vt, zt], () => oc);
Pt([Vt], () => ac);
Pt([Vt], () => uc);
Pt([Vt], () => fc);
Pt([Vt, zt], () => cc);
const {
  SvelteComponent: hc,
  append: oe,
  attr: Ke,
  detach: Jl,
  element: $e,
  init: _c,
  insert: Ql,
  noop: Br,
  safe_not_equal: dc,
  set_data: mn,
  set_style: ei,
  space: yi,
  text: pt,
  toggle_class: Ar
} = window.__gradio__svelte__internal, { onMount: mc, createEventDispatcher: gc, getContext: pc } = window.__gradio__svelte__internal;
function Hr(e) {
  let t, n, i, r, l = Ut(
    /*file_to_display*/
    e[2]
  ) + "", s, u, o, a, f = (
    /*file_to_display*/
    e[2].orig_name + ""
  ), c;
  return {
    c() {
      t = $e("div"), n = $e("span"), i = $e("div"), r = $e("progress"), s = pt(l), o = yi(), a = $e("span"), c = pt(f), ei(r, "visibility", "hidden"), ei(r, "height", "0"), ei(r, "width", "0"), r.value = u = Ut(
        /*file_to_display*/
        e[2]
      ), Ke(r, "max", "100"), Ke(r, "class", "svelte-12ckl9l"), Ke(i, "class", "progress-bar svelte-12ckl9l"), Ke(a, "class", "file-name svelte-12ckl9l"), Ke(t, "class", "file svelte-12ckl9l");
    },
    m(_, h) {
      Ql(_, t, h), oe(t, n), oe(n, i), oe(i, r), oe(r, s), oe(t, o), oe(t, a), oe(a, c);
    },
    p(_, h) {
      h & /*file_to_display*/
      4 && l !== (l = Ut(
        /*file_to_display*/
        _[2]
      ) + "") && mn(s, l), h & /*file_to_display*/
      4 && u !== (u = Ut(
        /*file_to_display*/
        _[2]
      )) && (r.value = u), h & /*file_to_display*/
      4 && f !== (f = /*file_to_display*/
      _[2].orig_name + "") && mn(c, f);
    },
    d(_) {
      _ && Jl(t);
    }
  };
}
function bc(e) {
  let t, n, i, r = (
    /*files_with_progress*/
    e[0].length + ""
  ), l, s, u = (
    /*files_with_progress*/
    e[0].length > 1 ? "files" : "file"
  ), o, a, f, c = (
    /*file_to_display*/
    e[2] && Hr(e)
  );
  return {
    c() {
      t = $e("div"), n = $e("span"), i = pt("Uploading "), l = pt(r), s = yi(), o = pt(u), a = pt("..."), f = yi(), c && c.c(), Ke(n, "class", "uploading svelte-12ckl9l"), Ke(t, "class", "wrap svelte-12ckl9l"), Ar(
        t,
        "progress",
        /*progress*/
        e[1]
      );
    },
    m(_, h) {
      Ql(_, t, h), oe(t, n), oe(n, i), oe(n, l), oe(n, s), oe(n, o), oe(n, a), oe(t, f), c && c.m(t, null);
    },
    p(_, [h]) {
      h & /*files_with_progress*/
      1 && r !== (r = /*files_with_progress*/
      _[0].length + "") && mn(l, r), h & /*files_with_progress*/
      1 && u !== (u = /*files_with_progress*/
      _[0].length > 1 ? "files" : "file") && mn(o, u), /*file_to_display*/
      _[2] ? c ? c.p(_, h) : (c = Hr(_), c.c(), c.m(t, null)) : c && (c.d(1), c = null), h & /*progress*/
      2 && Ar(
        t,
        "progress",
        /*progress*/
        _[1]
      );
    },
    i: Br,
    o: Br,
    d(_) {
      _ && Jl(t), c && c.d();
    }
  };
}
function Ut(e) {
  return e.progress * 100 / (e.size || 0) || 0;
}
function vc(e) {
  let t = 0;
  return e.forEach((n) => {
    t += Ut(n);
  }), document.documentElement.style.setProperty("--upload-progress-width", (t / e.length).toFixed(2) + "%"), t / e.length;
}
function yc(e, t, n) {
  let { upload_id: i } = t, { root: r } = t, { files: l } = t, s, u = !1, o, a, f = l.map((d) => ({ ...d, progress: 0 }));
  const c = gc();
  function _(d, w) {
    n(0, f = f.map((y) => (y.orig_name === d && (y.progress += w), y)));
  }
  const h = pc("EventSource_factory");
  return mc(() => {
    s = h(new URL(`${r}/upload_progress?upload_id=${i}`)), s.onmessage = async function(d) {
      const w = JSON.parse(d.data);
      u || n(1, u = !0), w.msg === "done" ? (s.close(), c("done")) : (n(6, o = w), _(w.orig_name, w.chunk_size));
    };
  }), e.$$set = (d) => {
    "upload_id" in d && n(3, i = d.upload_id), "root" in d && n(4, r = d.root), "files" in d && n(5, l = d.files);
  }, e.$$.update = () => {
    e.$$.dirty & /*files_with_progress*/
    1 && vc(f), e.$$.dirty & /*current_file_upload, files_with_progress*/
    65 && n(2, a = o || f[0]);
  }, [
    f,
    u,
    a,
    i,
    r,
    l,
    o
  ];
}
class wc extends hc {
  constructor(t) {
    super(), _c(this, t, yc, bc, dc, { upload_id: 3, root: 4, files: 5 });
  }
}
const {
  SvelteComponent: Ec,
  append: Cr,
  attr: ne,
  binding_callbacks: Sc,
  bubble: Je,
  check_outros: Yl,
  create_component: kc,
  create_slot: Kl,
  destroy_component: Tc,
  detach: An,
  element: wi,
  empty: $l,
  get_all_dirty_from_scope: es,
  get_slot_changes: ts,
  group_outros: ns,
  init: Bc,
  insert: Hn,
  listen: fe,
  mount_component: Ac,
  prevent_default: Qe,
  run_all: Hc,
  safe_not_equal: Cc,
  set_style: is,
  space: Pc,
  stop_propagation: Ye,
  toggle_class: ie,
  transition_in: Xe,
  transition_out: ut,
  update_slot_base: rs
} = window.__gradio__svelte__internal, { createEventDispatcher: Nc, tick: Ic, getContext: Oc } = window.__gradio__svelte__internal;
function Lc(e) {
  let t, n, i, r, l, s, u, o, a, f;
  const c = (
    /*#slots*/
    e[22].default
  ), _ = Kl(
    c,
    e,
    /*$$scope*/
    e[21],
    null
  );
  return {
    c() {
      t = wi("button"), _ && _.c(), n = Pc(), i = wi("input"), ne(i, "aria-label", "file upload"), ne(i, "data-testid", "file-upload"), ne(i, "type", "file"), ne(
        i,
        "accept",
        /*accept_file_types*/
        e[12]
      ), i.multiple = r = /*file_count*/
      e[5] === "multiple" || void 0, ne(i, "webkitdirectory", l = /*file_count*/
      e[5] === "directory" || void 0), ne(i, "mozdirectory", s = /*file_count*/
      e[5] === "directory" || void 0), ne(i, "class", "svelte-1aq8tno"), ne(t, "tabindex", u = /*hidden*/
      e[7] ? -1 : 0), ne(t, "class", "svelte-1aq8tno"), ie(
        t,
        "hidden",
        /*hidden*/
        e[7]
      ), ie(
        t,
        "center",
        /*center*/
        e[3]
      ), ie(
        t,
        "boundedheight",
        /*boundedheight*/
        e[2]
      ), ie(
        t,
        "flex",
        /*flex*/
        e[4]
      ), is(t, "height", "100%");
    },
    m(h, d) {
      Hn(h, t, d), _ && _.m(t, null), Cr(t, n), Cr(t, i), e[30](i), o = !0, a || (f = [
        fe(
          i,
          "change",
          /*load_files_from_upload*/
          e[15]
        ),
        fe(t, "drag", Ye(Qe(
          /*drag_handler*/
          e[23]
        ))),
        fe(t, "dragstart", Ye(Qe(
          /*dragstart_handler*/
          e[24]
        ))),
        fe(t, "dragend", Ye(Qe(
          /*dragend_handler*/
          e[25]
        ))),
        fe(t, "dragover", Ye(Qe(
          /*dragover_handler*/
          e[26]
        ))),
        fe(t, "dragenter", Ye(Qe(
          /*dragenter_handler*/
          e[27]
        ))),
        fe(t, "dragleave", Ye(Qe(
          /*dragleave_handler*/
          e[28]
        ))),
        fe(t, "drop", Ye(Qe(
          /*drop_handler*/
          e[29]
        ))),
        fe(
          t,
          "click",
          /*open_file_upload*/
          e[9]
        ),
        fe(
          t,
          "drop",
          /*loadFilesFromDrop*/
          e[16]
        ),
        fe(
          t,
          "dragenter",
          /*updateDragging*/
          e[14]
        ),
        fe(
          t,
          "dragleave",
          /*updateDragging*/
          e[14]
        )
      ], a = !0);
    },
    p(h, d) {
      _ && _.p && (!o || d[0] & /*$$scope*/
      2097152) && rs(
        _,
        c,
        h,
        /*$$scope*/
        h[21],
        o ? ts(
          c,
          /*$$scope*/
          h[21],
          d,
          null
        ) : es(
          /*$$scope*/
          h[21]
        ),
        null
      ), (!o || d[0] & /*accept_file_types*/
      4096) && ne(
        i,
        "accept",
        /*accept_file_types*/
        h[12]
      ), (!o || d[0] & /*file_count*/
      32 && r !== (r = /*file_count*/
      h[5] === "multiple" || void 0)) && (i.multiple = r), (!o || d[0] & /*file_count*/
      32 && l !== (l = /*file_count*/
      h[5] === "directory" || void 0)) && ne(i, "webkitdirectory", l), (!o || d[0] & /*file_count*/
      32 && s !== (s = /*file_count*/
      h[5] === "directory" || void 0)) && ne(i, "mozdirectory", s), (!o || d[0] & /*hidden*/
      128 && u !== (u = /*hidden*/
      h[7] ? -1 : 0)) && ne(t, "tabindex", u), (!o || d[0] & /*hidden*/
      128) && ie(
        t,
        "hidden",
        /*hidden*/
        h[7]
      ), (!o || d[0] & /*center*/
      8) && ie(
        t,
        "center",
        /*center*/
        h[3]
      ), (!o || d[0] & /*boundedheight*/
      4) && ie(
        t,
        "boundedheight",
        /*boundedheight*/
        h[2]
      ), (!o || d[0] & /*flex*/
      16) && ie(
        t,
        "flex",
        /*flex*/
        h[4]
      );
    },
    i(h) {
      o || (Xe(_, h), o = !0);
    },
    o(h) {
      ut(_, h), o = !1;
    },
    d(h) {
      h && An(t), _ && _.d(h), e[30](null), a = !1, Hc(f);
    }
  };
}
function Mc(e) {
  let t, n, i = !/*hidden*/
  e[7] && Pr(e);
  return {
    c() {
      i && i.c(), t = $l();
    },
    m(r, l) {
      i && i.m(r, l), Hn(r, t, l), n = !0;
    },
    p(r, l) {
      /*hidden*/
      r[7] ? i && (ns(), ut(i, 1, 1, () => {
        i = null;
      }), Yl()) : i ? (i.p(r, l), l[0] & /*hidden*/
      128 && Xe(i, 1)) : (i = Pr(r), i.c(), Xe(i, 1), i.m(t.parentNode, t));
    },
    i(r) {
      n || (Xe(i), n = !0);
    },
    o(r) {
      ut(i), n = !1;
    },
    d(r) {
      r && An(t), i && i.d(r);
    }
  };
}
function Dc(e) {
  let t, n, i, r, l;
  const s = (
    /*#slots*/
    e[22].default
  ), u = Kl(
    s,
    e,
    /*$$scope*/
    e[21],
    null
  );
  return {
    c() {
      t = wi("button"), u && u.c(), ne(t, "tabindex", n = /*hidden*/
      e[7] ? -1 : 0), ne(t, "class", "svelte-1aq8tno"), ie(
        t,
        "hidden",
        /*hidden*/
        e[7]
      ), ie(
        t,
        "center",
        /*center*/
        e[3]
      ), ie(
        t,
        "boundedheight",
        /*boundedheight*/
        e[2]
      ), ie(
        t,
        "flex",
        /*flex*/
        e[4]
      ), is(t, "height", "100%");
    },
    m(o, a) {
      Hn(o, t, a), u && u.m(t, null), i = !0, r || (l = fe(
        t,
        "click",
        /*paste_clipboard*/
        e[8]
      ), r = !0);
    },
    p(o, a) {
      u && u.p && (!i || a[0] & /*$$scope*/
      2097152) && rs(
        u,
        s,
        o,
        /*$$scope*/
        o[21],
        i ? ts(
          s,
          /*$$scope*/
          o[21],
          a,
          null
        ) : es(
          /*$$scope*/
          o[21]
        ),
        null
      ), (!i || a[0] & /*hidden*/
      128 && n !== (n = /*hidden*/
      o[7] ? -1 : 0)) && ne(t, "tabindex", n), (!i || a[0] & /*hidden*/
      128) && ie(
        t,
        "hidden",
        /*hidden*/
        o[7]
      ), (!i || a[0] & /*center*/
      8) && ie(
        t,
        "center",
        /*center*/
        o[3]
      ), (!i || a[0] & /*boundedheight*/
      4) && ie(
        t,
        "boundedheight",
        /*boundedheight*/
        o[2]
      ), (!i || a[0] & /*flex*/
      16) && ie(
        t,
        "flex",
        /*flex*/
        o[4]
      );
    },
    i(o) {
      i || (Xe(u, o), i = !0);
    },
    o(o) {
      ut(u, o), i = !1;
    },
    d(o) {
      o && An(t), u && u.d(o), r = !1, l();
    }
  };
}
function Pr(e) {
  let t, n;
  return t = new wc({
    props: {
      root: (
        /*root*/
        e[6]
      ),
      upload_id: (
        /*upload_id*/
        e[10]
      ),
      files: (
        /*file_data*/
        e[11]
      )
    }
  }), {
    c() {
      kc(t.$$.fragment);
    },
    m(i, r) {
      Ac(t, i, r), n = !0;
    },
    p(i, r) {
      const l = {};
      r[0] & /*root*/
      64 && (l.root = /*root*/
      i[6]), r[0] & /*upload_id*/
      1024 && (l.upload_id = /*upload_id*/
      i[10]), r[0] & /*file_data*/
      2048 && (l.files = /*file_data*/
      i[11]), t.$set(l);
    },
    i(i) {
      n || (Xe(t.$$.fragment, i), n = !0);
    },
    o(i) {
      ut(t.$$.fragment, i), n = !1;
    },
    d(i) {
      Tc(t, i);
    }
  };
}
function Rc(e) {
  let t, n, i, r;
  const l = [Dc, Mc, Lc], s = [];
  function u(o, a) {
    return (
      /*filetype*/
      o[0] === "clipboard" ? 0 : (
        /*uploading*/
        o[1] ? 1 : 2
      )
    );
  }
  return t = u(e), n = s[t] = l[t](e), {
    c() {
      n.c(), i = $l();
    },
    m(o, a) {
      s[t].m(o, a), Hn(o, i, a), r = !0;
    },
    p(o, a) {
      let f = t;
      t = u(o), t === f ? s[t].p(o, a) : (ns(), ut(s[f], 1, 1, () => {
        s[f] = null;
      }), Yl(), n = s[t], n ? n.p(o, a) : (n = s[t] = l[t](o), n.c()), Xe(n, 1), n.m(i.parentNode, i));
    },
    i(o) {
      r || (Xe(n), r = !0);
    },
    o(o) {
      ut(n), r = !1;
    },
    d(o) {
      o && An(i), s[t].d(o);
    }
  };
}
function Nr(e) {
  let t, n = e[0], i = 1;
  for (; i < e.length; ) {
    const r = e[i], l = e[i + 1];
    if (i += 2, (r === "optionalAccess" || r === "optionalCall") && n == null)
      return;
    r === "access" || r === "optionalAccess" ? (t = n, n = l(n)) : (r === "call" || r === "optionalCall") && (n = l((...s) => n.call(t, ...s)), t = void 0);
  }
  return n;
}
function Uc(e, t) {
  return !e || e === "*" || e === "file/*" ? !0 : (typeof e == "string" && e.endsWith("/*") && (e = e.split(",")), Array.isArray(e) ? e.includes(t) || e.some((n) => {
    const [i] = n.split("/");
    return n.endsWith("/*") && t.startsWith(i + "/");
  }) : e === t);
}
function Fc(e, t, n) {
  let { $$slots: i = {}, $$scope: r } = t, { filetype: l = null } = t, { dragging: s = !1 } = t, { boundedheight: u = !0 } = t, { center: o = !0 } = t, { flex: a = !0 } = t, { file_count: f = "single" } = t, { disable_click: c = !1 } = t, { root: _ } = t, { hidden: h = !1 } = t, { format: d = "file" } = t, { uploading: w = !1 } = t, y, v, p;
  const g = Oc("upload_files");
  let T;
  const E = Nc();
  function S() {
    n(17, s = !s);
  }
  function D() {
    navigator.clipboard.read().then(async (m) => {
      for (let N = 0; N < m.length; N++) {
        const b = m[N].types.find((R) => R.startsWith("image/"));
        if (b) {
          m[N].getType(b).then(async (R) => {
            const k = new File([R], `clipboard.${b.replace("image/", "")}`);
            await L([k]);
          });
          break;
        }
      }
    });
  }
  function re() {
    c || (n(13, T.value = "", T), T.click());
  }
  async function A(m) {
    await Ic(), n(10, y = Math.random().toString(36).substring(2, 15)), n(1, w = !0);
    const N = await hu(m, _, y, g);
    return E("load", f === "single" ? Nr([N, "optionalAccess", (b) => b[0]]) : N), n(1, w = !1), N || [];
  }
  async function L(m) {
    if (!m.length)
      return;
    let N = m.map((b) => new File([b], b.name));
    return n(11, v = await _u(N)), await A(v);
  }
  async function x(m) {
    const N = m.target;
    if (N.files)
      if (d != "blob")
        await L(Array.from(N.files));
      else {
        if (f === "single") {
          E("load", N.files[0]);
          return;
        }
        E("load", N.files);
      }
  }
  async function X(m) {
    if (n(17, s = !1), !Nr([m, "access", (b) => b.dataTransfer, "optionalAccess", (b) => b.files]))
      return;
    const N = Array.from(m.dataTransfer.files).filter((b) => {
      const R = "." + b.name.split(".").pop();
      return b.type && Uc(l, b.type) || (R && Array.isArray(l) ? l.includes(R) : R === l) ? !0 : (E("error", `Invalid file type only ${l} allowed.`), !1);
    });
    await L(N);
  }
  function Z(m) {
    Je.call(this, e, m);
  }
  function B(m) {
    Je.call(this, e, m);
  }
  function he(m) {
    Je.call(this, e, m);
  }
  function We(m) {
    Je.call(this, e, m);
  }
  function Ot(m) {
    Je.call(this, e, m);
  }
  function Ge(m) {
    Je.call(this, e, m);
  }
  function ct(m) {
    Je.call(this, e, m);
  }
  function Ie(m) {
    Sc[m ? "unshift" : "push"](() => {
      T = m, n(13, T);
    });
  }
  return e.$$set = (m) => {
    "filetype" in m && n(0, l = m.filetype), "dragging" in m && n(17, s = m.dragging), "boundedheight" in m && n(2, u = m.boundedheight), "center" in m && n(3, o = m.center), "flex" in m && n(4, a = m.flex), "file_count" in m && n(5, f = m.file_count), "disable_click" in m && n(18, c = m.disable_click), "root" in m && n(6, _ = m.root), "hidden" in m && n(7, h = m.hidden), "format" in m && n(19, d = m.format), "uploading" in m && n(1, w = m.uploading), "$$scope" in m && n(21, r = m.$$scope);
  }, e.$$.update = () => {
    e.$$.dirty[0] & /*filetype*/
    1 && (l == null || typeof l == "string" ? n(12, p = l) : (n(0, l = l.map((m) => m.startsWith(".") ? m : m + "/*")), n(12, p = l.join(", "))));
  }, [
    l,
    w,
    u,
    o,
    a,
    f,
    _,
    h,
    D,
    re,
    y,
    v,
    p,
    T,
    S,
    x,
    X,
    s,
    c,
    d,
    L,
    r,
    i,
    Z,
    B,
    he,
    We,
    Ot,
    Ge,
    ct,
    Ie
  ];
}
class Gc extends Ec {
  constructor(t) {
    super(), Bc(
      this,
      t,
      Fc,
      Rc,
      Cc,
      {
        filetype: 0,
        dragging: 17,
        boundedheight: 2,
        center: 3,
        flex: 4,
        file_count: 5,
        disable_click: 18,
        root: 6,
        hidden: 7,
        format: 19,
        uploading: 1,
        paste_clipboard: 8,
        open_file_upload: 9,
        load_files: 20
      },
      null,
      [-1, -1]
    );
  }
  get paste_clipboard() {
    return this.$$.ctx[8];
  }
  get open_file_upload() {
    return this.$$.ctx[9];
  }
  get load_files() {
    return this.$$.ctx[20];
  }
}
const {
  SvelteComponent: qc,
  append: Ei,
  attr: Me,
  bubble: xc,
  create_component: jc,
  destroy_component: zc,
  detach: ls,
  element: Si,
  init: Vc,
  insert: ss,
  listen: Xc,
  mount_component: Wc,
  safe_not_equal: Zc,
  set_data: Jc,
  set_style: nn,
  space: Qc,
  text: Yc,
  toggle_class: be,
  transition_in: Kc,
  transition_out: $c
} = window.__gradio__svelte__internal;
function Ir(e) {
  let t, n;
  return {
    c() {
      t = Si("span"), n = Yc(
        /*label*/
        e[1]
      ), Me(t, "class", "svelte-lpi64a");
    },
    m(i, r) {
      ss(i, t, r), Ei(t, n);
    },
    p(i, r) {
      r & /*label*/
      2 && Jc(
        n,
        /*label*/
        i[1]
      );
    },
    d(i) {
      i && ls(t);
    }
  };
}
function e0(e) {
  let t, n, i, r, l, s, u, o = (
    /*show_label*/
    e[2] && Ir(e)
  );
  return r = new /*Icon*/
  e[0]({}), {
    c() {
      t = Si("button"), o && o.c(), n = Qc(), i = Si("div"), jc(r.$$.fragment), Me(i, "class", "svelte-lpi64a"), be(
        i,
        "small",
        /*size*/
        e[4] === "small"
      ), be(
        i,
        "large",
        /*size*/
        e[4] === "large"
      ), t.disabled = /*disabled*/
      e[7], Me(
        t,
        "aria-label",
        /*label*/
        e[1]
      ), Me(
        t,
        "aria-haspopup",
        /*hasPopup*/
        e[8]
      ), Me(
        t,
        "title",
        /*label*/
        e[1]
      ), Me(t, "class", "svelte-lpi64a"), be(
        t,
        "pending",
        /*pending*/
        e[3]
      ), be(
        t,
        "padded",
        /*padded*/
        e[5]
      ), be(
        t,
        "highlight",
        /*highlight*/
        e[6]
      ), be(
        t,
        "transparent",
        /*transparent*/
        e[9]
      ), nn(t, "color", !/*disabled*/
      e[7] && /*_color*/
      e[11] ? (
        /*_color*/
        e[11]
      ) : "var(--block-label-text-color)"), nn(t, "--bg-color", /*disabled*/
      e[7] ? "auto" : (
        /*background*/
        e[10]
      ));
    },
    m(a, f) {
      ss(a, t, f), o && o.m(t, null), Ei(t, n), Ei(t, i), Wc(r, i, null), l = !0, s || (u = Xc(
        t,
        "click",
        /*click_handler*/
        e[13]
      ), s = !0);
    },
    p(a, [f]) {
      /*show_label*/
      a[2] ? o ? o.p(a, f) : (o = Ir(a), o.c(), o.m(t, n)) : o && (o.d(1), o = null), (!l || f & /*size*/
      16) && be(
        i,
        "small",
        /*size*/
        a[4] === "small"
      ), (!l || f & /*size*/
      16) && be(
        i,
        "large",
        /*size*/
        a[4] === "large"
      ), (!l || f & /*disabled*/
      128) && (t.disabled = /*disabled*/
      a[7]), (!l || f & /*label*/
      2) && Me(
        t,
        "aria-label",
        /*label*/
        a[1]
      ), (!l || f & /*hasPopup*/
      256) && Me(
        t,
        "aria-haspopup",
        /*hasPopup*/
        a[8]
      ), (!l || f & /*label*/
      2) && Me(
        t,
        "title",
        /*label*/
        a[1]
      ), (!l || f & /*pending*/
      8) && be(
        t,
        "pending",
        /*pending*/
        a[3]
      ), (!l || f & /*padded*/
      32) && be(
        t,
        "padded",
        /*padded*/
        a[5]
      ), (!l || f & /*highlight*/
      64) && be(
        t,
        "highlight",
        /*highlight*/
        a[6]
      ), (!l || f & /*transparent*/
      512) && be(
        t,
        "transparent",
        /*transparent*/
        a[9]
      ), f & /*disabled, _color*/
      2176 && nn(t, "color", !/*disabled*/
      a[7] && /*_color*/
      a[11] ? (
        /*_color*/
        a[11]
      ) : "var(--block-label-text-color)"), f & /*disabled, background*/
      1152 && nn(t, "--bg-color", /*disabled*/
      a[7] ? "auto" : (
        /*background*/
        a[10]
      ));
    },
    i(a) {
      l || (Kc(r.$$.fragment, a), l = !0);
    },
    o(a) {
      $c(r.$$.fragment, a), l = !1;
    },
    d(a) {
      a && ls(t), o && o.d(), zc(r), s = !1, u();
    }
  };
}
function t0(e, t, n) {
  let i, { Icon: r } = t, { label: l = "" } = t, { show_label: s = !1 } = t, { pending: u = !1 } = t, { size: o = "small" } = t, { padded: a = !0 } = t, { highlight: f = !1 } = t, { disabled: c = !1 } = t, { hasPopup: _ = !1 } = t, { color: h = "var(--block-label-text-color)" } = t, { transparent: d = !1 } = t, { background: w = "var(--background-fill-primary)" } = t;
  function y(v) {
    xc.call(this, e, v);
  }
  return e.$$set = (v) => {
    "Icon" in v && n(0, r = v.Icon), "label" in v && n(1, l = v.label), "show_label" in v && n(2, s = v.show_label), "pending" in v && n(3, u = v.pending), "size" in v && n(4, o = v.size), "padded" in v && n(5, a = v.padded), "highlight" in v && n(6, f = v.highlight), "disabled" in v && n(7, c = v.disabled), "hasPopup" in v && n(8, _ = v.hasPopup), "color" in v && n(12, h = v.color), "transparent" in v && n(9, d = v.transparent), "background" in v && n(10, w = v.background);
  }, e.$$.update = () => {
    e.$$.dirty & /*highlight, color*/
    4160 && n(11, i = f ? "var(--color-accent)" : h);
  }, [
    r,
    l,
    s,
    u,
    o,
    a,
    f,
    c,
    _,
    d,
    w,
    i,
    h,
    y
  ];
}
class Ii extends qc {
  constructor(t) {
    super(), Vc(this, t, t0, e0, Zc, {
      Icon: 0,
      label: 1,
      show_label: 2,
      pending: 3,
      size: 4,
      padded: 5,
      highlight: 6,
      disabled: 7,
      hasPopup: 8,
      color: 12,
      transparent: 9,
      background: 10
    });
  }
}
const {
  SvelteComponent: n0,
  append: Or,
  attr: i0,
  check_outros: Lr,
  create_component: Oi,
  destroy_component: Li,
  detach: r0,
  element: l0,
  group_outros: Mr,
  init: s0,
  insert: o0,
  mount_component: Mi,
  safe_not_equal: a0,
  set_style: Dr,
  space: Rr,
  toggle_class: Ur,
  transition_in: De,
  transition_out: et
} = window.__gradio__svelte__internal, { createEventDispatcher: u0 } = window.__gradio__svelte__internal;
function Fr(e) {
  let t, n;
  return t = new Ii({
    props: {
      Icon: pa,
      label: (
        /*i18n*/
        e[3]("common.edit")
      )
    }
  }), t.$on(
    "click",
    /*click_handler*/
    e[5]
  ), {
    c() {
      Oi(t.$$.fragment);
    },
    m(i, r) {
      Mi(t, i, r), n = !0;
    },
    p(i, r) {
      const l = {};
      r & /*i18n*/
      8 && (l.label = /*i18n*/
      i[3]("common.edit")), t.$set(l);
    },
    i(i) {
      n || (De(t.$$.fragment, i), n = !0);
    },
    o(i) {
      et(t.$$.fragment, i), n = !1;
    },
    d(i) {
      Li(t, i);
    }
  };
}
function Gr(e) {
  let t, n;
  return t = new Ii({
    props: {
      Icon: Pa,
      label: (
        /*i18n*/
        e[3]("common.undo")
      )
    }
  }), t.$on(
    "click",
    /*click_handler_1*/
    e[6]
  ), {
    c() {
      Oi(t.$$.fragment);
    },
    m(i, r) {
      Mi(t, i, r), n = !0;
    },
    p(i, r) {
      const l = {};
      r & /*i18n*/
      8 && (l.label = /*i18n*/
      i[3]("common.undo")), t.$set(l);
    },
    i(i) {
      n || (De(t.$$.fragment, i), n = !0);
    },
    o(i) {
      et(t.$$.fragment, i), n = !1;
    },
    d(i) {
      Li(t, i);
    }
  };
}
function f0(e) {
  let t, n, i, r, l, s = (
    /*editable*/
    e[0] && Fr(e)
  ), u = (
    /*undoable*/
    e[1] && Gr(e)
  );
  return r = new Ii({
    props: {
      Icon: ta,
      label: (
        /*i18n*/
        e[3]("common.clear")
      )
    }
  }), r.$on(
    "click",
    /*click_handler_2*/
    e[7]
  ), {
    c() {
      t = l0("div"), s && s.c(), n = Rr(), u && u.c(), i = Rr(), Oi(r.$$.fragment), i0(t, "class", "svelte-1wj0ocy"), Ur(t, "not-absolute", !/*absolute*/
      e[2]), Dr(
        t,
        "position",
        /*absolute*/
        e[2] ? "absolute" : "static"
      );
    },
    m(o, a) {
      o0(o, t, a), s && s.m(t, null), Or(t, n), u && u.m(t, null), Or(t, i), Mi(r, t, null), l = !0;
    },
    p(o, [a]) {
      /*editable*/
      o[0] ? s ? (s.p(o, a), a & /*editable*/
      1 && De(s, 1)) : (s = Fr(o), s.c(), De(s, 1), s.m(t, n)) : s && (Mr(), et(s, 1, 1, () => {
        s = null;
      }), Lr()), /*undoable*/
      o[1] ? u ? (u.p(o, a), a & /*undoable*/
      2 && De(u, 1)) : (u = Gr(o), u.c(), De(u, 1), u.m(t, i)) : u && (Mr(), et(u, 1, 1, () => {
        u = null;
      }), Lr());
      const f = {};
      a & /*i18n*/
      8 && (f.label = /*i18n*/
      o[3]("common.clear")), r.$set(f), (!l || a & /*absolute*/
      4) && Ur(t, "not-absolute", !/*absolute*/
      o[2]), a & /*absolute*/
      4 && Dr(
        t,
        "position",
        /*absolute*/
        o[2] ? "absolute" : "static"
      );
    },
    i(o) {
      l || (De(s), De(u), De(r.$$.fragment, o), l = !0);
    },
    o(o) {
      et(s), et(u), et(r.$$.fragment, o), l = !1;
    },
    d(o) {
      o && r0(t), s && s.d(), u && u.d(), Li(r);
    }
  };
}
function c0(e, t, n) {
  let { editable: i = !1 } = t, { undoable: r = !1 } = t, { absolute: l = !0 } = t, { i18n: s } = t;
  const u = u0(), o = () => u("edit"), a = () => u("undo"), f = (c) => {
    u("clear"), c.stopPropagation();
  };
  return e.$$set = (c) => {
    "editable" in c && n(0, i = c.editable), "undoable" in c && n(1, r = c.undoable), "absolute" in c && n(2, l = c.absolute), "i18n" in c && n(3, s = c.i18n);
  }, [
    i,
    r,
    l,
    s,
    u,
    o,
    a,
    f
  ];
}
class h0 extends n0 {
  constructor(t) {
    super(), s0(this, t, c0, f0, a0, {
      editable: 0,
      undoable: 1,
      absolute: 2,
      i18n: 3
    });
  }
}
const {
  SvelteComponent: _0,
  add_flush_callback: d0,
  bind: m0,
  binding_callbacks: g0,
  bubble: p0,
  check_outros: b0,
  create_component: gn,
  create_slot: v0,
  destroy_component: pn,
  detach: ki,
  empty: y0,
  get_all_dirty_from_scope: w0,
  get_slot_changes: E0,
  group_outros: S0,
  init: k0,
  insert: Ti,
  mount_component: bn,
  safe_not_equal: T0,
  space: os,
  transition_in: lt,
  transition_out: st,
  update_slot_base: B0
} = window.__gradio__svelte__internal, { createEventDispatcher: A0, tick: H0 } = window.__gradio__svelte__internal;
function C0(e) {
  let t, n, i;
  function r(s) {
    e[15](s);
  }
  let l = {
    filetype: (
      /*accept_file_types*/
      e[9]
    ),
    file_count: (
      /*file_count*/
      e[3]
    ),
    root: (
      /*root*/
      e[5]
    ),
    $$slots: { default: [N0] },
    $$scope: { ctx: e }
  };
  return (
    /*dragging*/
    e[8] !== void 0 && (l.dragging = /*dragging*/
    e[8]), t = new Gc({ props: l }), g0.push(() => m0(t, "dragging", r)), t.$on(
      "load",
      /*handle_upload*/
      e[10]
    ), {
      c() {
        gn(t.$$.fragment);
      },
      m(s, u) {
        bn(t, s, u), i = !0;
      },
      p(s, u) {
        const o = {};
        u & /*accept_file_types*/
        512 && (o.filetype = /*accept_file_types*/
        s[9]), u & /*file_count*/
        8 && (o.file_count = /*file_count*/
        s[3]), u & /*root*/
        32 && (o.root = /*root*/
        s[5]), u & /*$$scope*/
        65536 && (o.$$scope = { dirty: u, ctx: s }), !n && u & /*dragging*/
        256 && (n = !0, o.dragging = /*dragging*/
        s[8], d0(() => n = !1)), t.$set(o);
      },
      i(s) {
        i || (lt(t.$$.fragment, s), i = !0);
      },
      o(s) {
        st(t.$$.fragment, s), i = !1;
      },
      d(s) {
        pn(t, s);
      }
    }
  );
}
function P0(e) {
  let t, n, i, r;
  return t = new h0({
    props: { i18n: (
      /*i18n*/
      e[7]
    ), absolute: !0 }
  }), t.$on(
    "clear",
    /*handle_clear*/
    e[11]
  ), i = new bl({
    props: {
      i18n: (
        /*i18n*/
        e[7]
      ),
      selectable: (
        /*selectable*/
        e[4]
      ),
      value: (
        /*value*/
        e[0]
      ),
      height: (
        /*height*/
        e[6]
      )
    }
  }), i.$on(
    "select",
    /*select_handler*/
    e[14]
  ), {
    c() {
      gn(t.$$.fragment), n = os(), gn(i.$$.fragment);
    },
    m(l, s) {
      bn(t, l, s), Ti(l, n, s), bn(i, l, s), r = !0;
    },
    p(l, s) {
      const u = {};
      s & /*i18n*/
      128 && (u.i18n = /*i18n*/
      l[7]), t.$set(u);
      const o = {};
      s & /*i18n*/
      128 && (o.i18n = /*i18n*/
      l[7]), s & /*selectable*/
      16 && (o.selectable = /*selectable*/
      l[4]), s & /*value*/
      1 && (o.value = /*value*/
      l[0]), s & /*height*/
      64 && (o.height = /*height*/
      l[6]), i.$set(o);
    },
    i(l) {
      r || (lt(t.$$.fragment, l), lt(i.$$.fragment, l), r = !0);
    },
    o(l) {
      st(t.$$.fragment, l), st(i.$$.fragment, l), r = !1;
    },
    d(l) {
      l && ki(n), pn(t, l), pn(i, l);
    }
  };
}
function N0(e) {
  let t;
  const n = (
    /*#slots*/
    e[13].default
  ), i = v0(
    n,
    e,
    /*$$scope*/
    e[16],
    null
  );
  return {
    c() {
      i && i.c();
    },
    m(r, l) {
      i && i.m(r, l), t = !0;
    },
    p(r, l) {
      i && i.p && (!t || l & /*$$scope*/
      65536) && B0(
        i,
        n,
        r,
        /*$$scope*/
        r[16],
        t ? E0(
          n,
          /*$$scope*/
          r[16],
          l,
          null
        ) : w0(
          /*$$scope*/
          r[16]
        ),
        null
      );
    },
    i(r) {
      t || (lt(i, r), t = !0);
    },
    o(r) {
      st(i, r), t = !1;
    },
    d(r) {
      i && i.d(r);
    }
  };
}
function I0(e) {
  let t, n, i, r, l, s, u;
  t = new fl({
    props: {
      show_label: (
        /*show_label*/
        e[2]
      ),
      Icon: Ai,
      float: (
        /*value*/
        e[0] === null
      ),
      label: (
        /*label*/
        e[1] || "File"
      )
    }
  });
  const o = [P0, C0], a = [];
  function f(c, _) {
    return _ & /*value*/
    1 && (i = null), i == null && (i = !!/*value*/
    (c[0] && (Array.isArray(
      /*value*/
      c[0]
    ) && /*value*/
    c[0].length > 0))), i ? 0 : 1;
  }
  return r = f(e, -1), l = a[r] = o[r](e), {
    c() {
      gn(t.$$.fragment), n = os(), l.c(), s = y0();
    },
    m(c, _) {
      bn(t, c, _), Ti(c, n, _), a[r].m(c, _), Ti(c, s, _), u = !0;
    },
    p(c, [_]) {
      const h = {};
      _ & /*show_label*/
      4 && (h.show_label = /*show_label*/
      c[2]), _ & /*value*/
      1 && (h.float = /*value*/
      c[0] === null), _ & /*label*/
      2 && (h.label = /*label*/
      c[1] || "File"), t.$set(h);
      let d = r;
      r = f(c, _), r === d ? a[r].p(c, _) : (S0(), st(a[d], 1, 1, () => {
        a[d] = null;
      }), b0(), l = a[r], l ? l.p(c, _) : (l = a[r] = o[r](c), l.c()), lt(l, 1), l.m(s.parentNode, s));
    },
    i(c) {
      u || (lt(t.$$.fragment, c), lt(l), u = !0);
    },
    o(c) {
      st(t.$$.fragment, c), st(l), u = !1;
    },
    d(c) {
      c && (ki(n), ki(s)), pn(t, c), a[r].d(c);
    }
  };
}
function O0(e, t, n) {
  let { $$slots: i = {}, $$scope: r } = t, { value: l } = t, { label: s } = t, { show_label: u = !0 } = t, { file_count: o = "single" } = t, { file_types: a = null } = t, { selectable: f = !1 } = t, { root: c } = t, { height: _ = void 0 } = t, { i18n: h } = t;
  async function d({ detail: E }) {
    n(0, l = E), await H0(), y("change", l), y("upload", E);
  }
  function w() {
    n(0, l = null), y("change", null), y("clear");
  }
  const y = A0();
  let v;
  a == null ? v = null : (a = a.map((E) => E.startsWith(".") ? E : E + "/*"), v = a.join(", "));
  let p = !1;
  function g(E) {
    p0.call(this, e, E);
  }
  function T(E) {
    p = E, n(8, p);
  }
  return e.$$set = (E) => {
    "value" in E && n(0, l = E.value), "label" in E && n(1, s = E.label), "show_label" in E && n(2, u = E.show_label), "file_count" in E && n(3, o = E.file_count), "file_types" in E && n(12, a = E.file_types), "selectable" in E && n(4, f = E.selectable), "root" in E && n(5, c = E.root), "height" in E && n(6, _ = E.height), "i18n" in E && n(7, h = E.i18n), "$$scope" in E && n(16, r = E.$$scope);
  }, e.$$.update = () => {
    e.$$.dirty & /*dragging*/
    256 && y("drag", p);
  }, [
    l,
    s,
    u,
    o,
    f,
    c,
    _,
    h,
    p,
    v,
    d,
    w,
    a,
    i,
    g,
    T,
    r
  ];
}
class L0 extends _0 {
  constructor(t) {
    super(), k0(this, t, O0, I0, T0, {
      value: 0,
      label: 1,
      show_label: 2,
      file_count: 3,
      file_types: 12,
      selectable: 4,
      root: 5,
      height: 6,
      i18n: 7
    });
  }
}
function bt(e) {
  let t = ["", "k", "M", "G", "T", "P", "E", "Z"], n = 0;
  for (; e > 1e3 && n < t.length - 1; )
    e /= 1e3, n++;
  let i = t[n];
  return (Number.isInteger(e) ? e : e.toFixed(1)) + i;
}
const {
  SvelteComponent: M0,
  append: Be,
  attr: M,
  component_subscribe: qr,
  detach: D0,
  element: R0,
  init: U0,
  insert: F0,
  noop: xr,
  safe_not_equal: G0,
  set_style: rn,
  svg_element: Ae,
  toggle_class: jr
} = window.__gradio__svelte__internal, { onMount: q0 } = window.__gradio__svelte__internal;
function x0(e) {
  let t, n, i, r, l, s, u, o, a, f, c, _;
  return {
    c() {
      t = R0("div"), n = Ae("svg"), i = Ae("g"), r = Ae("path"), l = Ae("path"), s = Ae("path"), u = Ae("path"), o = Ae("g"), a = Ae("path"), f = Ae("path"), c = Ae("path"), _ = Ae("path"), M(r, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), M(r, "fill", "#FF7C00"), M(r, "fill-opacity", "0.4"), M(r, "class", "svelte-43sxxs"), M(l, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), M(l, "fill", "#FF7C00"), M(l, "class", "svelte-43sxxs"), M(s, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), M(s, "fill", "#FF7C00"), M(s, "fill-opacity", "0.4"), M(s, "class", "svelte-43sxxs"), M(u, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), M(u, "fill", "#FF7C00"), M(u, "class", "svelte-43sxxs"), rn(i, "transform", "translate(" + /*$top*/
      e[1][0] + "px, " + /*$top*/
      e[1][1] + "px)"), M(a, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), M(a, "fill", "#FF7C00"), M(a, "fill-opacity", "0.4"), M(a, "class", "svelte-43sxxs"), M(f, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), M(f, "fill", "#FF7C00"), M(f, "class", "svelte-43sxxs"), M(c, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), M(c, "fill", "#FF7C00"), M(c, "fill-opacity", "0.4"), M(c, "class", "svelte-43sxxs"), M(_, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), M(_, "fill", "#FF7C00"), M(_, "class", "svelte-43sxxs"), rn(o, "transform", "translate(" + /*$bottom*/
      e[2][0] + "px, " + /*$bottom*/
      e[2][1] + "px)"), M(n, "viewBox", "-1200 -1200 3000 3000"), M(n, "fill", "none"), M(n, "xmlns", "http://www.w3.org/2000/svg"), M(n, "class", "svelte-43sxxs"), M(t, "class", "svelte-43sxxs"), jr(
        t,
        "margin",
        /*margin*/
        e[0]
      );
    },
    m(h, d) {
      F0(h, t, d), Be(t, n), Be(n, i), Be(i, r), Be(i, l), Be(i, s), Be(i, u), Be(n, o), Be(o, a), Be(o, f), Be(o, c), Be(o, _);
    },
    p(h, [d]) {
      d & /*$top*/
      2 && rn(i, "transform", "translate(" + /*$top*/
      h[1][0] + "px, " + /*$top*/
      h[1][1] + "px)"), d & /*$bottom*/
      4 && rn(o, "transform", "translate(" + /*$bottom*/
      h[2][0] + "px, " + /*$bottom*/
      h[2][1] + "px)"), d & /*margin*/
      1 && jr(
        t,
        "margin",
        /*margin*/
        h[0]
      );
    },
    i: xr,
    o: xr,
    d(h) {
      h && D0(t);
    }
  };
}
function j0(e, t, n) {
  let i, r, { margin: l = !0 } = t;
  const s = hr([0, 0]);
  qr(e, s, (_) => n(1, i = _));
  const u = hr([0, 0]);
  qr(e, u, (_) => n(2, r = _));
  let o;
  async function a() {
    await Promise.all([s.set([125, 140]), u.set([-125, -140])]), await Promise.all([s.set([-125, 140]), u.set([125, -140])]), await Promise.all([s.set([-125, 0]), u.set([125, -0])]), await Promise.all([s.set([125, 0]), u.set([-125, 0])]);
  }
  async function f() {
    await a(), o || f();
  }
  async function c() {
    await Promise.all([s.set([125, 0]), u.set([-125, 0])]), f();
  }
  return q0(() => (c(), () => o = !0)), e.$$set = (_) => {
    "margin" in _ && n(0, l = _.margin);
  }, [l, i, r, s, u];
}
class z0 extends M0 {
  constructor(t) {
    super(), U0(this, t, j0, x0, G0, { margin: 0 });
  }
}
const {
  SvelteComponent: V0,
  append: it,
  attr: Pe,
  binding_callbacks: zr,
  check_outros: as,
  create_component: X0,
  create_slot: W0,
  destroy_component: Z0,
  destroy_each: us,
  detach: H,
  element: Re,
  empty: It,
  ensure_array_like: vn,
  get_all_dirty_from_scope: J0,
  get_slot_changes: Q0,
  group_outros: fs,
  init: Y0,
  insert: C,
  mount_component: K0,
  noop: Bi,
  safe_not_equal: $0,
  set_data: we,
  set_style: Ve,
  space: Ne,
  text: V,
  toggle_class: ve,
  transition_in: Ht,
  transition_out: Ct,
  update_slot_base: eh
} = window.__gradio__svelte__internal, { tick: th } = window.__gradio__svelte__internal, { onDestroy: nh } = window.__gradio__svelte__internal, ih = (e) => ({}), Vr = (e) => ({});
function Xr(e, t, n) {
  const i = e.slice();
  return i[38] = t[n], i[40] = n, i;
}
function Wr(e, t, n) {
  const i = e.slice();
  return i[38] = t[n], i;
}
function rh(e) {
  let t, n = (
    /*i18n*/
    e[1]("common.error") + ""
  ), i, r, l;
  const s = (
    /*#slots*/
    e[29].error
  ), u = W0(
    s,
    e,
    /*$$scope*/
    e[28],
    Vr
  );
  return {
    c() {
      t = Re("span"), i = V(n), r = Ne(), u && u.c(), Pe(t, "class", "error svelte-1txqlrd");
    },
    m(o, a) {
      C(o, t, a), it(t, i), C(o, r, a), u && u.m(o, a), l = !0;
    },
    p(o, a) {
      (!l || a[0] & /*i18n*/
      2) && n !== (n = /*i18n*/
      o[1]("common.error") + "") && we(i, n), u && u.p && (!l || a[0] & /*$$scope*/
      268435456) && eh(
        u,
        s,
        o,
        /*$$scope*/
        o[28],
        l ? Q0(
          s,
          /*$$scope*/
          o[28],
          a,
          ih
        ) : J0(
          /*$$scope*/
          o[28]
        ),
        Vr
      );
    },
    i(o) {
      l || (Ht(u, o), l = !0);
    },
    o(o) {
      Ct(u, o), l = !1;
    },
    d(o) {
      o && (H(t), H(r)), u && u.d(o);
    }
  };
}
function lh(e) {
  let t, n, i, r, l, s, u, o, a, f = (
    /*variant*/
    e[8] === "default" && /*show_eta_bar*/
    e[18] && /*show_progress*/
    e[6] === "full" && Zr(e)
  );
  function c(g, T) {
    if (
      /*progress*/
      g[7]
    )
      return ah;
    if (
      /*queue_position*/
      g[2] !== null && /*queue_size*/
      g[3] !== void 0 && /*queue_position*/
      g[2] >= 0
    )
      return oh;
    if (
      /*queue_position*/
      g[2] === 0
    )
      return sh;
  }
  let _ = c(e), h = _ && _(e), d = (
    /*timer*/
    e[5] && Yr(e)
  );
  const w = [hh, ch], y = [];
  function v(g, T) {
    return (
      /*last_progress_level*/
      g[15] != null ? 0 : (
        /*show_progress*/
        g[6] === "full" ? 1 : -1
      )
    );
  }
  ~(l = v(e)) && (s = y[l] = w[l](e));
  let p = !/*timer*/
  e[5] && rl(e);
  return {
    c() {
      f && f.c(), t = Ne(), n = Re("div"), h && h.c(), i = Ne(), d && d.c(), r = Ne(), s && s.c(), u = Ne(), p && p.c(), o = It(), Pe(n, "class", "progress-text svelte-1txqlrd"), ve(
        n,
        "meta-text-center",
        /*variant*/
        e[8] === "center"
      ), ve(
        n,
        "meta-text",
        /*variant*/
        e[8] === "default"
      );
    },
    m(g, T) {
      f && f.m(g, T), C(g, t, T), C(g, n, T), h && h.m(n, null), it(n, i), d && d.m(n, null), C(g, r, T), ~l && y[l].m(g, T), C(g, u, T), p && p.m(g, T), C(g, o, T), a = !0;
    },
    p(g, T) {
      /*variant*/
      g[8] === "default" && /*show_eta_bar*/
      g[18] && /*show_progress*/
      g[6] === "full" ? f ? f.p(g, T) : (f = Zr(g), f.c(), f.m(t.parentNode, t)) : f && (f.d(1), f = null), _ === (_ = c(g)) && h ? h.p(g, T) : (h && h.d(1), h = _ && _(g), h && (h.c(), h.m(n, i))), /*timer*/
      g[5] ? d ? d.p(g, T) : (d = Yr(g), d.c(), d.m(n, null)) : d && (d.d(1), d = null), (!a || T[0] & /*variant*/
      256) && ve(
        n,
        "meta-text-center",
        /*variant*/
        g[8] === "center"
      ), (!a || T[0] & /*variant*/
      256) && ve(
        n,
        "meta-text",
        /*variant*/
        g[8] === "default"
      );
      let E = l;
      l = v(g), l === E ? ~l && y[l].p(g, T) : (s && (fs(), Ct(y[E], 1, 1, () => {
        y[E] = null;
      }), as()), ~l ? (s = y[l], s ? s.p(g, T) : (s = y[l] = w[l](g), s.c()), Ht(s, 1), s.m(u.parentNode, u)) : s = null), /*timer*/
      g[5] ? p && (p.d(1), p = null) : p ? p.p(g, T) : (p = rl(g), p.c(), p.m(o.parentNode, o));
    },
    i(g) {
      a || (Ht(s), a = !0);
    },
    o(g) {
      Ct(s), a = !1;
    },
    d(g) {
      g && (H(t), H(n), H(r), H(u), H(o)), f && f.d(g), h && h.d(), d && d.d(), ~l && y[l].d(g), p && p.d(g);
    }
  };
}
function Zr(e) {
  let t, n = `translateX(${/*eta_level*/
  (e[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      t = Re("div"), Pe(t, "class", "eta-bar svelte-1txqlrd"), Ve(t, "transform", n);
    },
    m(i, r) {
      C(i, t, r);
    },
    p(i, r) {
      r[0] & /*eta_level*/
      131072 && n !== (n = `translateX(${/*eta_level*/
      (i[17] || 0) * 100 - 100}%)`) && Ve(t, "transform", n);
    },
    d(i) {
      i && H(t);
    }
  };
}
function sh(e) {
  let t;
  return {
    c() {
      t = V("processing |");
    },
    m(n, i) {
      C(n, t, i);
    },
    p: Bi,
    d(n) {
      n && H(t);
    }
  };
}
function oh(e) {
  let t, n = (
    /*queue_position*/
    e[2] + 1 + ""
  ), i, r, l, s;
  return {
    c() {
      t = V("queue: "), i = V(n), r = V("/"), l = V(
        /*queue_size*/
        e[3]
      ), s = V(" |");
    },
    m(u, o) {
      C(u, t, o), C(u, i, o), C(u, r, o), C(u, l, o), C(u, s, o);
    },
    p(u, o) {
      o[0] & /*queue_position*/
      4 && n !== (n = /*queue_position*/
      u[2] + 1 + "") && we(i, n), o[0] & /*queue_size*/
      8 && we(
        l,
        /*queue_size*/
        u[3]
      );
    },
    d(u) {
      u && (H(t), H(i), H(r), H(l), H(s));
    }
  };
}
function ah(e) {
  let t, n = vn(
    /*progress*/
    e[7]
  ), i = [];
  for (let r = 0; r < n.length; r += 1)
    i[r] = Qr(Wr(e, n, r));
  return {
    c() {
      for (let r = 0; r < i.length; r += 1)
        i[r].c();
      t = It();
    },
    m(r, l) {
      for (let s = 0; s < i.length; s += 1)
        i[s] && i[s].m(r, l);
      C(r, t, l);
    },
    p(r, l) {
      if (l[0] & /*progress*/
      128) {
        n = vn(
          /*progress*/
          r[7]
        );
        let s;
        for (s = 0; s < n.length; s += 1) {
          const u = Wr(r, n, s);
          i[s] ? i[s].p(u, l) : (i[s] = Qr(u), i[s].c(), i[s].m(t.parentNode, t));
        }
        for (; s < i.length; s += 1)
          i[s].d(1);
        i.length = n.length;
      }
    },
    d(r) {
      r && H(t), us(i, r);
    }
  };
}
function Jr(e) {
  let t, n = (
    /*p*/
    e[38].unit + ""
  ), i, r, l = " ", s;
  function u(f, c) {
    return (
      /*p*/
      f[38].length != null ? fh : uh
    );
  }
  let o = u(e), a = o(e);
  return {
    c() {
      a.c(), t = Ne(), i = V(n), r = V(" | "), s = V(l);
    },
    m(f, c) {
      a.m(f, c), C(f, t, c), C(f, i, c), C(f, r, c), C(f, s, c);
    },
    p(f, c) {
      o === (o = u(f)) && a ? a.p(f, c) : (a.d(1), a = o(f), a && (a.c(), a.m(t.parentNode, t))), c[0] & /*progress*/
      128 && n !== (n = /*p*/
      f[38].unit + "") && we(i, n);
    },
    d(f) {
      f && (H(t), H(i), H(r), H(s)), a.d(f);
    }
  };
}
function uh(e) {
  let t = bt(
    /*p*/
    e[38].index || 0
  ) + "", n;
  return {
    c() {
      n = V(t);
    },
    m(i, r) {
      C(i, n, r);
    },
    p(i, r) {
      r[0] & /*progress*/
      128 && t !== (t = bt(
        /*p*/
        i[38].index || 0
      ) + "") && we(n, t);
    },
    d(i) {
      i && H(n);
    }
  };
}
function fh(e) {
  let t = bt(
    /*p*/
    e[38].index || 0
  ) + "", n, i, r = bt(
    /*p*/
    e[38].length
  ) + "", l;
  return {
    c() {
      n = V(t), i = V("/"), l = V(r);
    },
    m(s, u) {
      C(s, n, u), C(s, i, u), C(s, l, u);
    },
    p(s, u) {
      u[0] & /*progress*/
      128 && t !== (t = bt(
        /*p*/
        s[38].index || 0
      ) + "") && we(n, t), u[0] & /*progress*/
      128 && r !== (r = bt(
        /*p*/
        s[38].length
      ) + "") && we(l, r);
    },
    d(s) {
      s && (H(n), H(i), H(l));
    }
  };
}
function Qr(e) {
  let t, n = (
    /*p*/
    e[38].index != null && Jr(e)
  );
  return {
    c() {
      n && n.c(), t = It();
    },
    m(i, r) {
      n && n.m(i, r), C(i, t, r);
    },
    p(i, r) {
      /*p*/
      i[38].index != null ? n ? n.p(i, r) : (n = Jr(i), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
    },
    d(i) {
      i && H(t), n && n.d(i);
    }
  };
}
function Yr(e) {
  let t, n = (
    /*eta*/
    e[0] ? `/${/*formatted_eta*/
    e[19]}` : ""
  ), i, r;
  return {
    c() {
      t = V(
        /*formatted_timer*/
        e[20]
      ), i = V(n), r = V("s");
    },
    m(l, s) {
      C(l, t, s), C(l, i, s), C(l, r, s);
    },
    p(l, s) {
      s[0] & /*formatted_timer*/
      1048576 && we(
        t,
        /*formatted_timer*/
        l[20]
      ), s[0] & /*eta, formatted_eta*/
      524289 && n !== (n = /*eta*/
      l[0] ? `/${/*formatted_eta*/
      l[19]}` : "") && we(i, n);
    },
    d(l) {
      l && (H(t), H(i), H(r));
    }
  };
}
function ch(e) {
  let t, n;
  return t = new z0({
    props: { margin: (
      /*variant*/
      e[8] === "default"
    ) }
  }), {
    c() {
      X0(t.$$.fragment);
    },
    m(i, r) {
      K0(t, i, r), n = !0;
    },
    p(i, r) {
      const l = {};
      r[0] & /*variant*/
      256 && (l.margin = /*variant*/
      i[8] === "default"), t.$set(l);
    },
    i(i) {
      n || (Ht(t.$$.fragment, i), n = !0);
    },
    o(i) {
      Ct(t.$$.fragment, i), n = !1;
    },
    d(i) {
      Z0(t, i);
    }
  };
}
function hh(e) {
  let t, n, i, r, l, s = `${/*last_progress_level*/
  e[15] * 100}%`, u = (
    /*progress*/
    e[7] != null && Kr(e)
  );
  return {
    c() {
      t = Re("div"), n = Re("div"), u && u.c(), i = Ne(), r = Re("div"), l = Re("div"), Pe(n, "class", "progress-level-inner svelte-1txqlrd"), Pe(l, "class", "progress-bar svelte-1txqlrd"), Ve(l, "width", s), Pe(r, "class", "progress-bar-wrap svelte-1txqlrd"), Pe(t, "class", "progress-level svelte-1txqlrd");
    },
    m(o, a) {
      C(o, t, a), it(t, n), u && u.m(n, null), it(t, i), it(t, r), it(r, l), e[30](l);
    },
    p(o, a) {
      /*progress*/
      o[7] != null ? u ? u.p(o, a) : (u = Kr(o), u.c(), u.m(n, null)) : u && (u.d(1), u = null), a[0] & /*last_progress_level*/
      32768 && s !== (s = `${/*last_progress_level*/
      o[15] * 100}%`) && Ve(l, "width", s);
    },
    i: Bi,
    o: Bi,
    d(o) {
      o && H(t), u && u.d(), e[30](null);
    }
  };
}
function Kr(e) {
  let t, n = vn(
    /*progress*/
    e[7]
  ), i = [];
  for (let r = 0; r < n.length; r += 1)
    i[r] = il(Xr(e, n, r));
  return {
    c() {
      for (let r = 0; r < i.length; r += 1)
        i[r].c();
      t = It();
    },
    m(r, l) {
      for (let s = 0; s < i.length; s += 1)
        i[s] && i[s].m(r, l);
      C(r, t, l);
    },
    p(r, l) {
      if (l[0] & /*progress_level, progress*/
      16512) {
        n = vn(
          /*progress*/
          r[7]
        );
        let s;
        for (s = 0; s < n.length; s += 1) {
          const u = Xr(r, n, s);
          i[s] ? i[s].p(u, l) : (i[s] = il(u), i[s].c(), i[s].m(t.parentNode, t));
        }
        for (; s < i.length; s += 1)
          i[s].d(1);
        i.length = n.length;
      }
    },
    d(r) {
      r && H(t), us(i, r);
    }
  };
}
function $r(e) {
  let t, n, i, r, l = (
    /*i*/
    e[40] !== 0 && _h()
  ), s = (
    /*p*/
    e[38].desc != null && el(e)
  ), u = (
    /*p*/
    e[38].desc != null && /*progress_level*/
    e[14] && /*progress_level*/
    e[14][
      /*i*/
      e[40]
    ] != null && tl()
  ), o = (
    /*progress_level*/
    e[14] != null && nl(e)
  );
  return {
    c() {
      l && l.c(), t = Ne(), s && s.c(), n = Ne(), u && u.c(), i = Ne(), o && o.c(), r = It();
    },
    m(a, f) {
      l && l.m(a, f), C(a, t, f), s && s.m(a, f), C(a, n, f), u && u.m(a, f), C(a, i, f), o && o.m(a, f), C(a, r, f);
    },
    p(a, f) {
      /*p*/
      a[38].desc != null ? s ? s.p(a, f) : (s = el(a), s.c(), s.m(n.parentNode, n)) : s && (s.d(1), s = null), /*p*/
      a[38].desc != null && /*progress_level*/
      a[14] && /*progress_level*/
      a[14][
        /*i*/
        a[40]
      ] != null ? u || (u = tl(), u.c(), u.m(i.parentNode, i)) : u && (u.d(1), u = null), /*progress_level*/
      a[14] != null ? o ? o.p(a, f) : (o = nl(a), o.c(), o.m(r.parentNode, r)) : o && (o.d(1), o = null);
    },
    d(a) {
      a && (H(t), H(n), H(i), H(r)), l && l.d(a), s && s.d(a), u && u.d(a), o && o.d(a);
    }
  };
}
function _h(e) {
  let t;
  return {
    c() {
      t = V(" /");
    },
    m(n, i) {
      C(n, t, i);
    },
    d(n) {
      n && H(t);
    }
  };
}
function el(e) {
  let t = (
    /*p*/
    e[38].desc + ""
  ), n;
  return {
    c() {
      n = V(t);
    },
    m(i, r) {
      C(i, n, r);
    },
    p(i, r) {
      r[0] & /*progress*/
      128 && t !== (t = /*p*/
      i[38].desc + "") && we(n, t);
    },
    d(i) {
      i && H(n);
    }
  };
}
function tl(e) {
  let t;
  return {
    c() {
      t = V("-");
    },
    m(n, i) {
      C(n, t, i);
    },
    d(n) {
      n && H(t);
    }
  };
}
function nl(e) {
  let t = (100 * /*progress_level*/
  (e[14][
    /*i*/
    e[40]
  ] || 0)).toFixed(1) + "", n, i;
  return {
    c() {
      n = V(t), i = V("%");
    },
    m(r, l) {
      C(r, n, l), C(r, i, l);
    },
    p(r, l) {
      l[0] & /*progress_level*/
      16384 && t !== (t = (100 * /*progress_level*/
      (r[14][
        /*i*/
        r[40]
      ] || 0)).toFixed(1) + "") && we(n, t);
    },
    d(r) {
      r && (H(n), H(i));
    }
  };
}
function il(e) {
  let t, n = (
    /*p*/
    (e[38].desc != null || /*progress_level*/
    e[14] && /*progress_level*/
    e[14][
      /*i*/
      e[40]
    ] != null) && $r(e)
  );
  return {
    c() {
      n && n.c(), t = It();
    },
    m(i, r) {
      n && n.m(i, r), C(i, t, r);
    },
    p(i, r) {
      /*p*/
      i[38].desc != null || /*progress_level*/
      i[14] && /*progress_level*/
      i[14][
        /*i*/
        i[40]
      ] != null ? n ? n.p(i, r) : (n = $r(i), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
    },
    d(i) {
      i && H(t), n && n.d(i);
    }
  };
}
function rl(e) {
  let t, n;
  return {
    c() {
      t = Re("p"), n = V(
        /*loading_text*/
        e[9]
      ), Pe(t, "class", "loading svelte-1txqlrd");
    },
    m(i, r) {
      C(i, t, r), it(t, n);
    },
    p(i, r) {
      r[0] & /*loading_text*/
      512 && we(
        n,
        /*loading_text*/
        i[9]
      );
    },
    d(i) {
      i && H(t);
    }
  };
}
function dh(e) {
  let t, n, i, r, l;
  const s = [lh, rh], u = [];
  function o(a, f) {
    return (
      /*status*/
      a[4] === "pending" ? 0 : (
        /*status*/
        a[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(n = o(e)) && (i = u[n] = s[n](e)), {
    c() {
      t = Re("div"), i && i.c(), Pe(t, "class", r = "wrap " + /*variant*/
      e[8] + " " + /*show_progress*/
      e[6] + " svelte-1txqlrd"), ve(t, "hide", !/*status*/
      e[4] || /*status*/
      e[4] === "complete" || /*show_progress*/
      e[6] === "hidden"), ve(
        t,
        "translucent",
        /*variant*/
        e[8] === "center" && /*status*/
        (e[4] === "pending" || /*status*/
        e[4] === "error") || /*translucent*/
        e[11] || /*show_progress*/
        e[6] === "minimal"
      ), ve(
        t,
        "generating",
        /*status*/
        e[4] === "generating"
      ), ve(
        t,
        "border",
        /*border*/
        e[12]
      ), Ve(
        t,
        "position",
        /*absolute*/
        e[10] ? "absolute" : "static"
      ), Ve(
        t,
        "padding",
        /*absolute*/
        e[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(a, f) {
      C(a, t, f), ~n && u[n].m(t, null), e[31](t), l = !0;
    },
    p(a, f) {
      let c = n;
      n = o(a), n === c ? ~n && u[n].p(a, f) : (i && (fs(), Ct(u[c], 1, 1, () => {
        u[c] = null;
      }), as()), ~n ? (i = u[n], i ? i.p(a, f) : (i = u[n] = s[n](a), i.c()), Ht(i, 1), i.m(t, null)) : i = null), (!l || f[0] & /*variant, show_progress*/
      320 && r !== (r = "wrap " + /*variant*/
      a[8] + " " + /*show_progress*/
      a[6] + " svelte-1txqlrd")) && Pe(t, "class", r), (!l || f[0] & /*variant, show_progress, status, show_progress*/
      336) && ve(t, "hide", !/*status*/
      a[4] || /*status*/
      a[4] === "complete" || /*show_progress*/
      a[6] === "hidden"), (!l || f[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && ve(
        t,
        "translucent",
        /*variant*/
        a[8] === "center" && /*status*/
        (a[4] === "pending" || /*status*/
        a[4] === "error") || /*translucent*/
        a[11] || /*show_progress*/
        a[6] === "minimal"
      ), (!l || f[0] & /*variant, show_progress, status*/
      336) && ve(
        t,
        "generating",
        /*status*/
        a[4] === "generating"
      ), (!l || f[0] & /*variant, show_progress, border*/
      4416) && ve(
        t,
        "border",
        /*border*/
        a[12]
      ), f[0] & /*absolute*/
      1024 && Ve(
        t,
        "position",
        /*absolute*/
        a[10] ? "absolute" : "static"
      ), f[0] & /*absolute*/
      1024 && Ve(
        t,
        "padding",
        /*absolute*/
        a[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(a) {
      l || (Ht(i), l = !0);
    },
    o(a) {
      Ct(i), l = !1;
    },
    d(a) {
      a && H(t), ~n && u[n].d(), e[31](null);
    }
  };
}
let ln = [], ti = !1;
async function mh(e, t = !0) {
  if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
    if (ln.push(e), !ti)
      ti = !0;
    else
      return;
    await th(), requestAnimationFrame(() => {
      let n = [0, 0];
      for (let i = 0; i < ln.length; i++) {
        const l = ln[i].getBoundingClientRect();
        (i === 0 || l.top + window.scrollY <= n[0]) && (n[0] = l.top + window.scrollY, n[1] = i);
      }
      window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), ti = !1, ln = [];
    });
  }
}
function gh(e, t, n) {
  let i, { $$slots: r = {}, $$scope: l } = t, { i18n: s } = t, { eta: u = null } = t, { queue_position: o } = t, { queue_size: a } = t, { status: f } = t, { scroll_to_output: c = !1 } = t, { timer: _ = !0 } = t, { show_progress: h = "full" } = t, { message: d = null } = t, { progress: w = null } = t, { variant: y = "default" } = t, { loading_text: v = "Loading..." } = t, { absolute: p = !0 } = t, { translucent: g = !1 } = t, { border: T = !1 } = t, { autoscroll: E } = t, S, D = !1, re = 0, A = 0, L = null, x = null, X = 0, Z = null, B, he = null, We = !0;
  const Ot = () => {
    n(0, u = n(26, L = n(19, Ie = null))), n(24, re = performance.now()), n(25, A = 0), D = !0, Ge();
  };
  function Ge() {
    requestAnimationFrame(() => {
      n(25, A = (performance.now() - re) / 1e3), D && Ge();
    });
  }
  function ct() {
    n(25, A = 0), n(0, u = n(26, L = n(19, Ie = null))), D && (D = !1);
  }
  nh(() => {
    D && ct();
  });
  let Ie = null;
  function m(b) {
    zr[b ? "unshift" : "push"](() => {
      he = b, n(16, he), n(7, w), n(14, Z), n(15, B);
    });
  }
  function N(b) {
    zr[b ? "unshift" : "push"](() => {
      S = b, n(13, S);
    });
  }
  return e.$$set = (b) => {
    "i18n" in b && n(1, s = b.i18n), "eta" in b && n(0, u = b.eta), "queue_position" in b && n(2, o = b.queue_position), "queue_size" in b && n(3, a = b.queue_size), "status" in b && n(4, f = b.status), "scroll_to_output" in b && n(21, c = b.scroll_to_output), "timer" in b && n(5, _ = b.timer), "show_progress" in b && n(6, h = b.show_progress), "message" in b && n(22, d = b.message), "progress" in b && n(7, w = b.progress), "variant" in b && n(8, y = b.variant), "loading_text" in b && n(9, v = b.loading_text), "absolute" in b && n(10, p = b.absolute), "translucent" in b && n(11, g = b.translucent), "border" in b && n(12, T = b.border), "autoscroll" in b && n(23, E = b.autoscroll), "$$scope" in b && n(28, l = b.$$scope);
  }, e.$$.update = () => {
    e.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
    218103809 && (u === null && n(0, u = L), u != null && L !== u && (n(27, x = (performance.now() - re) / 1e3 + u), n(19, Ie = x.toFixed(1)), n(26, L = u))), e.$$.dirty[0] & /*eta_from_start, timer_diff*/
    167772160 && n(17, X = x === null || x <= 0 || !A ? null : Math.min(A / x, 1)), e.$$.dirty[0] & /*progress*/
    128 && w != null && n(18, We = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (w != null ? n(14, Z = w.map((b) => {
      if (b.index != null && b.length != null)
        return b.index / b.length;
      if (b.progress != null)
        return b.progress;
    })) : n(14, Z = null), Z ? (n(15, B = Z[Z.length - 1]), he && (B === 0 ? n(16, he.style.transition = "0", he) : n(16, he.style.transition = "150ms", he))) : n(15, B = void 0)), e.$$.dirty[0] & /*status*/
    16 && (f === "pending" ? Ot() : ct()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    10493968 && S && c && (f === "pending" || f === "complete") && mh(S, E), e.$$.dirty[0] & /*status, message*/
    4194320, e.$$.dirty[0] & /*timer_diff*/
    33554432 && n(20, i = A.toFixed(1));
  }, [
    u,
    s,
    o,
    a,
    f,
    _,
    h,
    w,
    y,
    v,
    p,
    g,
    T,
    S,
    Z,
    B,
    he,
    X,
    We,
    Ie,
    i,
    c,
    d,
    E,
    re,
    A,
    L,
    x,
    l,
    r,
    m,
    N
  ];
}
class ph extends V0 {
  constructor(t) {
    super(), Y0(
      this,
      t,
      gh,
      dh,
      $0,
      {
        i18n: 1,
        eta: 0,
        queue_position: 2,
        queue_size: 3,
        status: 4,
        scroll_to_output: 21,
        timer: 5,
        show_progress: 6,
        message: 22,
        progress: 7,
        variant: 8,
        loading_text: 9,
        absolute: 10,
        translucent: 11,
        border: 12,
        autoscroll: 23
      },
      null,
      [-1, -1]
    );
  }
}
const {
  SvelteComponent: bh,
  append: vh,
  attr: yh,
  detach: wh,
  element: Eh,
  init: Sh,
  insert: kh,
  noop: ll,
  safe_not_equal: Th,
  set_data: Bh,
  text: Ah,
  toggle_class: gt
} = window.__gradio__svelte__internal;
function Hh(e) {
  let t, n = (Array.isArray(
    /*value*/
    e[0]
  ) ? (
    /*value*/
    e[0].join(", ")
  ) : (
    /*value*/
    e[0]
  )) + "", i;
  return {
    c() {
      t = Eh("div"), i = Ah(n), yh(t, "class", "svelte-1hgn91n"), gt(
        t,
        "table",
        /*type*/
        e[1] === "table"
      ), gt(
        t,
        "gallery",
        /*type*/
        e[1] === "gallery"
      ), gt(
        t,
        "selected",
        /*selected*/
        e[2]
      );
    },
    m(r, l) {
      kh(r, t, l), vh(t, i);
    },
    p(r, [l]) {
      l & /*value*/
      1 && n !== (n = (Array.isArray(
        /*value*/
        r[0]
      ) ? (
        /*value*/
        r[0].join(", ")
      ) : (
        /*value*/
        r[0]
      )) + "") && Bh(i, n), l & /*type*/
      2 && gt(
        t,
        "table",
        /*type*/
        r[1] === "table"
      ), l & /*type*/
      2 && gt(
        t,
        "gallery",
        /*type*/
        r[1] === "gallery"
      ), l & /*selected*/
      4 && gt(
        t,
        "selected",
        /*selected*/
        r[2]
      );
    },
    i: ll,
    o: ll,
    d(r) {
      r && wh(t);
    }
  };
}
function Ch(e, t, n) {
  let { value: i } = t, { type: r } = t, { selected: l = !1 } = t;
  return e.$$set = (s) => {
    "value" in s && n(0, i = s.value), "type" in s && n(1, r = s.type), "selected" in s && n(2, l = s.selected);
  }, [i, r, l];
}
class Kh extends bh {
  constructor(t) {
    super(), Sh(this, t, Ch, Hh, Th, { value: 0, type: 1, selected: 2 });
  }
}
const {
  SvelteComponent: Ph,
  assign: Nh,
  check_outros: Ih,
  create_component: Xt,
  destroy_component: Wt,
  detach: sl,
  empty: Oh,
  flush: K,
  get_spread_object: Lh,
  get_spread_update: Mh,
  group_outros: Dh,
  init: Rh,
  insert: ol,
  mount_component: Zt,
  safe_not_equal: Uh,
  space: Fh,
  transition_in: ot,
  transition_out: at
} = window.__gradio__svelte__internal;
function Gh(e) {
  let t, n;
  return t = new L0({
    props: {
      label: (
        /*label*/
        e[6]
      ),
      show_label: (
        /*show_label*/
        e[7]
      ),
      value: (
        /*_value*/
        e[17]
      ),
      file_count: (
        /*file_count*/
        e[15]
      ),
      file_types: (
        /*file_types*/
        e[16]
      ),
      selectable: (
        /*_selectable*/
        e[9]
      ),
      root: (
        /*root*/
        e[5]
      ),
      height: (
        /*height*/
        e[8]
      ),
      i18n: (
        /*gradio*/
        e[14].i18n
      ),
      $$slots: { default: [xh] },
      $$scope: { ctx: e }
    }
  }), t.$on(
    "change",
    /*change_handler*/
    e[22]
  ), t.$on(
    "drag",
    /*drag_handler*/
    e[23]
  ), t.$on(
    "clear",
    /*clear_handler*/
    e[24]
  ), t.$on(
    "select",
    /*select_handler_1*/
    e[25]
  ), t.$on(
    "upload",
    /*upload_handler*/
    e[26]
  ), {
    c() {
      Xt(t.$$.fragment);
    },
    m(i, r) {
      Zt(t, i, r), n = !0;
    },
    p(i, r) {
      const l = {};
      r & /*label*/
      64 && (l.label = /*label*/
      i[6]), r & /*show_label*/
      128 && (l.show_label = /*show_label*/
      i[7]), r & /*_value*/
      131072 && (l.value = /*_value*/
      i[17]), r & /*file_count*/
      32768 && (l.file_count = /*file_count*/
      i[15]), r & /*file_types*/
      65536 && (l.file_types = /*file_types*/
      i[16]), r & /*_selectable*/
      512 && (l.selectable = /*_selectable*/
      i[9]), r & /*root*/
      32 && (l.root = /*root*/
      i[5]), r & /*height*/
      256 && (l.height = /*height*/
      i[8]), r & /*gradio*/
      16384 && (l.i18n = /*gradio*/
      i[14].i18n), r & /*$$scope, gradio*/
      134234112 && (l.$$scope = { dirty: r, ctx: i }), t.$set(l);
    },
    i(i) {
      n || (ot(t.$$.fragment, i), n = !0);
    },
    o(i) {
      at(t.$$.fragment, i), n = !1;
    },
    d(i) {
      Wt(t, i);
    }
  };
}
function qh(e) {
  let t, n;
  return t = new lu({
    props: {
      selectable: (
        /*_selectable*/
        e[9]
      ),
      value: (
        /*_value*/
        e[17]
      ),
      label: (
        /*label*/
        e[6]
      ),
      show_label: (
        /*show_label*/
        e[7]
      ),
      height: (
        /*height*/
        e[8]
      ),
      i18n: (
        /*gradio*/
        e[14].i18n
      )
    }
  }), t.$on(
    "select",
    /*select_handler*/
    e[21]
  ), {
    c() {
      Xt(t.$$.fragment);
    },
    m(i, r) {
      Zt(t, i, r), n = !0;
    },
    p(i, r) {
      const l = {};
      r & /*_selectable*/
      512 && (l.selectable = /*_selectable*/
      i[9]), r & /*_value*/
      131072 && (l.value = /*_value*/
      i[17]), r & /*label*/
      64 && (l.label = /*label*/
      i[6]), r & /*show_label*/
      128 && (l.show_label = /*show_label*/
      i[7]), r & /*height*/
      256 && (l.height = /*height*/
      i[8]), r & /*gradio*/
      16384 && (l.i18n = /*gradio*/
      i[14].i18n), t.$set(l);
    },
    i(i) {
      n || (ot(t.$$.fragment, i), n = !0);
    },
    o(i) {
      at(t.$$.fragment, i), n = !1;
    },
    d(i) {
      Wt(t, i);
    }
  };
}
function xh(e) {
  let t, n;
  return t = new Zo({
    props: {
      i18n: (
        /*gradio*/
        e[14].i18n
      ),
      type: "file"
    }
  }), {
    c() {
      Xt(t.$$.fragment);
    },
    m(i, r) {
      Zt(t, i, r), n = !0;
    },
    p(i, r) {
      const l = {};
      r & /*gradio*/
      16384 && (l.i18n = /*gradio*/
      i[14].i18n), t.$set(l);
    },
    i(i) {
      n || (ot(t.$$.fragment, i), n = !0);
    },
    o(i) {
      at(t.$$.fragment, i), n = !1;
    },
    d(i) {
      Wt(t, i);
    }
  };
}
function jh(e) {
  var _;
  let t, n, i, r, l, s;
  const u = [
    {
      autoscroll: (
        /*gradio*/
        e[14].autoscroll
      )
    },
    { i18n: (
      /*gradio*/
      e[14].i18n
    ) },
    /*loading_status*/
    e[10],
    {
      status: (
        /*loading_status*/
        ((_ = e[10]) == null ? void 0 : _.status) || "complete"
      )
    }
  ];
  let o = {};
  for (let h = 0; h < u.length; h += 1)
    o = Nh(o, u[h]);
  t = new ph({ props: o });
  const a = [qh, Gh], f = [];
  function c(h, d) {
    return (
      /*interactive*/
      h[4] ? 1 : 0
    );
  }
  return i = c(e), r = f[i] = a[i](e), {
    c() {
      Xt(t.$$.fragment), n = Fh(), r.c(), l = Oh();
    },
    m(h, d) {
      Zt(t, h, d), ol(h, n, d), f[i].m(h, d), ol(h, l, d), s = !0;
    },
    p(h, d) {
      var v;
      const w = d & /*gradio, loading_status, pending_upload*/
      17408 ? Mh(u, [
        d & /*gradio*/
        16384 && {
          autoscroll: (
            /*gradio*/
            h[14].autoscroll
          )
        },
        d & /*gradio*/
        16384 && { i18n: (
          /*gradio*/
          h[14].i18n
        ) },
        d & /*loading_status*/
        1024 && Lh(
          /*loading_status*/
          h[10]
        ),
        d & /*pending_upload, loading_status*/
        1024 && {
          status: (
            /*loading_status*/
            ((v = h[10]) == null ? void 0 : v.status) || "complete"
          )
        }
      ]) : {};
      t.$set(w);
      let y = i;
      i = c(h), i === y ? f[i].p(h, d) : (Dh(), at(f[y], 1, 1, () => {
        f[y] = null;
      }), Ih(), r = f[i], r ? r.p(h, d) : (r = f[i] = a[i](h), r.c()), ot(r, 1), r.m(l.parentNode, l));
    },
    i(h) {
      s || (ot(t.$$.fragment, h), ot(r), s = !0);
    },
    o(h) {
      at(t.$$.fragment, h), at(r), s = !1;
    },
    d(h) {
      h && (sl(n), sl(l)), Wt(t, h), f[i].d(h);
    }
  };
}
function zh(e) {
  let t, n;
  return t = new As({
    props: {
      visible: (
        /*visible*/
        e[3]
      ),
      variant: (
        /*value*/
        e[0] === null ? "dashed" : "solid"
      ),
      border_mode: (
        /*dragging*/
        e[18] ? "focus" : "base"
      ),
      padding: !1,
      elem_id: (
        /*elem_id*/
        e[1]
      ),
      elem_classes: (
        /*elem_classes*/
        e[2]
      ),
      container: (
        /*container*/
        e[11]
      ),
      scale: (
        /*scale*/
        e[12]
      ),
      min_width: (
        /*min_width*/
        e[13]
      ),
      allow_overflow: !1,
      $$slots: { default: [jh] },
      $$scope: { ctx: e }
    }
  }), {
    c() {
      Xt(t.$$.fragment);
    },
    m(i, r) {
      Zt(t, i, r), n = !0;
    },
    p(i, [r]) {
      const l = {};
      r & /*visible*/
      8 && (l.visible = /*visible*/
      i[3]), r & /*value*/
      1 && (l.variant = /*value*/
      i[0] === null ? "dashed" : "solid"), r & /*dragging*/
      262144 && (l.border_mode = /*dragging*/
      i[18] ? "focus" : "base"), r & /*elem_id*/
      2 && (l.elem_id = /*elem_id*/
      i[1]), r & /*elem_classes*/
      4 && (l.elem_classes = /*elem_classes*/
      i[2]), r & /*container*/
      2048 && (l.container = /*container*/
      i[11]), r & /*scale*/
      4096 && (l.scale = /*scale*/
      i[12]), r & /*min_width*/
      8192 && (l.min_width = /*min_width*/
      i[13]), r & /*$$scope, _selectable, _value, label, show_label, height, gradio, interactive, file_count, file_types, root, value, dragging, loading_status*/
      134727665 && (l.$$scope = { dirty: r, ctx: i }), t.$set(l);
    },
    i(i) {
      n || (ot(t.$$.fragment, i), n = !0);
    },
    o(i) {
      at(t.$$.fragment, i), n = !1;
    },
    d(i) {
      Wt(t, i);
    }
  };
}
function Vh(e, t, n) {
  let i, { elem_id: r = "" } = t, { elem_classes: l = [] } = t, { visible: s = !0 } = t, { value: u } = t, { interactive: o } = t, { root: a } = t, { label: f } = t, { show_label: c } = t, { height: _ = void 0 } = t, { proxy_url: h } = t, { _selectable: d = !1 } = t, { loading_status: w } = t, { container: y = !0 } = t, { scale: v = null } = t, { min_width: p = void 0 } = t, { gradio: g } = t, { file_count: T } = t, { file_types: E = ["file"] } = t, S = i, D = !1;
  const re = ({ detail: B }) => g.dispatch("select", B), A = ({ detail: B }) => {
    n(0, u = B);
  }, L = ({ detail: B }) => n(18, D = B), x = () => g.dispatch("clear"), X = ({ detail: B }) => g.dispatch("select", B), Z = () => g.dispatch("upload");
  return e.$$set = (B) => {
    "elem_id" in B && n(1, r = B.elem_id), "elem_classes" in B && n(2, l = B.elem_classes), "visible" in B && n(3, s = B.visible), "value" in B && n(0, u = B.value), "interactive" in B && n(4, o = B.interactive), "root" in B && n(5, a = B.root), "label" in B && n(6, f = B.label), "show_label" in B && n(7, c = B.show_label), "height" in B && n(8, _ = B.height), "proxy_url" in B && n(19, h = B.proxy_url), "_selectable" in B && n(9, d = B._selectable), "loading_status" in B && n(10, w = B.loading_status), "container" in B && n(11, y = B.container), "scale" in B && n(12, v = B.scale), "min_width" in B && n(13, p = B.min_width), "gradio" in B && n(14, g = B.gradio), "file_count" in B && n(15, T = B.file_count), "file_types" in B && n(16, E = B.file_types);
  }, e.$$.update = () => {
    e.$$.dirty & /*value, root, proxy_url*/
    524321 && n(17, i = nt(u, a, h)), e.$$.dirty & /*old_value, _value, gradio*/
    1196032 && JSON.stringify(S) !== JSON.stringify(i) && (g.dispatch("change"), n(20, S = i));
  }, [
    u,
    r,
    l,
    s,
    o,
    a,
    f,
    c,
    _,
    d,
    w,
    y,
    v,
    p,
    g,
    T,
    E,
    i,
    D,
    h,
    S,
    re,
    A,
    L,
    x,
    X,
    Z
  ];
}
class $h extends Ph {
  constructor(t) {
    super(), Rh(this, t, Vh, zh, Uh, {
      elem_id: 1,
      elem_classes: 2,
      visible: 3,
      value: 0,
      interactive: 4,
      root: 5,
      label: 6,
      show_label: 7,
      height: 8,
      proxy_url: 19,
      _selectable: 9,
      loading_status: 10,
      container: 11,
      scale: 12,
      min_width: 13,
      gradio: 14,
      file_count: 15,
      file_types: 16
    });
  }
  get elem_id() {
    return this.$$.ctx[1];
  }
  set elem_id(t) {
    this.$$set({ elem_id: t }), K();
  }
  get elem_classes() {
    return this.$$.ctx[2];
  }
  set elem_classes(t) {
    this.$$set({ elem_classes: t }), K();
  }
  get visible() {
    return this.$$.ctx[3];
  }
  set visible(t) {
    this.$$set({ visible: t }), K();
  }
  get value() {
    return this.$$.ctx[0];
  }
  set value(t) {
    this.$$set({ value: t }), K();
  }
  get interactive() {
    return this.$$.ctx[4];
  }
  set interactive(t) {
    this.$$set({ interactive: t }), K();
  }
  get root() {
    return this.$$.ctx[5];
  }
  set root(t) {
    this.$$set({ root: t }), K();
  }
  get label() {
    return this.$$.ctx[6];
  }
  set label(t) {
    this.$$set({ label: t }), K();
  }
  get show_label() {
    return this.$$.ctx[7];
  }
  set show_label(t) {
    this.$$set({ show_label: t }), K();
  }
  get height() {
    return this.$$.ctx[8];
  }
  set height(t) {
    this.$$set({ height: t }), K();
  }
  get proxy_url() {
    return this.$$.ctx[19];
  }
  set proxy_url(t) {
    this.$$set({ proxy_url: t }), K();
  }
  get _selectable() {
    return this.$$.ctx[9];
  }
  set _selectable(t) {
    this.$$set({ _selectable: t }), K();
  }
  get loading_status() {
    return this.$$.ctx[10];
  }
  set loading_status(t) {
    this.$$set({ loading_status: t }), K();
  }
  get container() {
    return this.$$.ctx[11];
  }
  set container(t) {
    this.$$set({ container: t }), K();
  }
  get scale() {
    return this.$$.ctx[12];
  }
  set scale(t) {
    this.$$set({ scale: t }), K();
  }
  get min_width() {
    return this.$$.ctx[13];
  }
  set min_width(t) {
    this.$$set({ min_width: t }), K();
  }
  get gradio() {
    return this.$$.ctx[14];
  }
  set gradio(t) {
    this.$$set({ gradio: t }), K();
  }
  get file_count() {
    return this.$$.ctx[15];
  }
  set file_count(t) {
    this.$$set({ file_count: t }), K();
  }
  get file_types() {
    return this.$$.ctx[16];
  }
  set file_types(t) {
    this.$$set({ file_types: t }), K();
  }
}
export {
  Kh as BaseExample,
  lu as BaseFile,
  L0 as BaseFileUpload,
  bl as FilePreview,
  $h as default
};
