diff --git "a/src/backend/gradio_image_annotation/templates/example/index.js" "b/src/backend/gradio_image_annotation/templates/example/index.js" --- "a/src/backend/gradio_image_annotation/templates/example/index.js" +++ "b/src/backend/gradio_image_annotation/templates/example/index.js" @@ -1,27 +1,27 @@ -const { setContext: yu, getContext: er } = window.__gradio__svelte__internal, tr = "WORKER_PROXY_CONTEXT_KEY"; -function nr() { - return er(tr); +const { setContext: Su, getContext: rr } = window.__gradio__svelte__internal, sr = "WORKER_PROXY_CONTEXT_KEY"; +function or() { + return rr(sr); } -function ir(e) { +function ar(e) { return e.host === window.location.host || e.host === "localhost:7860" || e.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194 e.host === "lite.local"; } -function rr(e, t) { +function lr(e, t) { const n = t.toLowerCase(); for (const [i, r] of Object.entries(e)) if (i.toLowerCase() === n) return r; } -function sr(e) { +function ur(e) { if (e == null) return !1; const t = new URL(e); - return !(!ir(t) || t.protocol !== "http:" && t.protocol !== "https:"); + return !(!ar(t) || t.protocol !== "http:" && t.protocol !== "https:"); } -async function or(e) { - if (e == null || !sr(e)) +async function fr(e) { + if (e == null || !ur(e)) return e; - const t = nr(); + const t = or(); if (t == null) return e; const i = new URL(e).pathname; @@ -34,166 +34,166 @@ async function or(e) { if (r.status !== 200) throw new Error(`Failed to get file ${i} from the Wasm worker.`); const s = new Blob([r.body], { - type: rr(r.headers, "content-type") + type: lr(r.headers, "content-type") }); return URL.createObjectURL(s); }); } const { - SvelteComponent: ar, + SvelteComponent: hr, append: Tt, attr: X, - detach: lr, - init: ur, - insert: fr, - noop: Ct, - safe_not_equal: hr, + detach: cr, + init: mr, + insert: _r, + noop: Pt, + safe_not_equal: dr, set_style: Z, - svg_element: Ze + svg_element: Je } = window.__gradio__svelte__internal; -function cr(e) { +function br(e) { let t, n, i, r; return { c() { - t = Ze("svg"), n = Ze("g"), i = Ze("path"), r = Ze("path"), X(i, "d", "M18,6L6.087,17.913"), Z(i, "fill", "none"), Z(i, "fill-rule", "nonzero"), Z(i, "stroke-width", "2px"), X(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), X(r, "d", "M4.364,4.364L19.636,19.636"), Z(r, "fill", "none"), Z(r, "fill-rule", "nonzero"), Z(r, "stroke-width", "2px"), X(t, "width", "100%"), X(t, "height", "100%"), X(t, "viewBox", "0 0 24 24"), X(t, "version", "1.1"), X(t, "xmlns", "http://www.w3.org/2000/svg"), X(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), X(t, "xml:space", "preserve"), X(t, "stroke", "currentColor"), Z(t, "fill-rule", "evenodd"), Z(t, "clip-rule", "evenodd"), Z(t, "stroke-linecap", "round"), Z(t, "stroke-linejoin", "round"); + t = Je("svg"), n = Je("g"), i = Je("path"), r = Je("path"), X(i, "d", "M18,6L6.087,17.913"), Z(i, "fill", "none"), Z(i, "fill-rule", "nonzero"), Z(i, "stroke-width", "2px"), X(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), X(r, "d", "M4.364,4.364L19.636,19.636"), Z(r, "fill", "none"), Z(r, "fill-rule", "nonzero"), Z(r, "stroke-width", "2px"), X(t, "width", "100%"), X(t, "height", "100%"), X(t, "viewBox", "0 0 24 24"), X(t, "version", "1.1"), X(t, "xmlns", "http://www.w3.org/2000/svg"), X(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), X(t, "xml:space", "preserve"), X(t, "stroke", "currentColor"), Z(t, "fill-rule", "evenodd"), Z(t, "clip-rule", "evenodd"), Z(t, "stroke-linecap", "round"), Z(t, "stroke-linejoin", "round"); }, m(s, u) { - fr(s, t, u), Tt(t, n), Tt(n, i), Tt(t, r); + _r(s, t, u), Tt(t, n), Tt(n, i), Tt(t, r); }, - p: Ct, - i: Ct, - o: Ct, + p: Pt, + i: Pt, + o: Pt, d(s) { - s && lr(t); + s && cr(t); } }; } -class mr extends ar { +class gr extends hr { constructor(t) { - super(), ur(this, t, null, cr, hr, {}); + super(), mr(this, t, null, br, dr, {}); } } const { - SvelteComponent: _r, - append: dr, - attr: fe, - detach: br, - init: gr, - insert: pr, - noop: Pt, - safe_not_equal: vr, + SvelteComponent: pr, + append: vr, + attr: he, + detach: yr, + init: Er, + insert: wr, + noop: It, + safe_not_equal: xr, svg_element: En } = window.__gradio__svelte__internal; -function yr(e) { +function Sr(e) { let t, n; return { c() { - t = En("svg"), n = En("path"), fe(n, "d", "M5 8l4 4 4-4z"), fe(t, "class", "dropdown-arrow svelte-145leq6"), fe(t, "xmlns", "http://www.w3.org/2000/svg"), fe(t, "width", "100%"), fe(t, "height", "100%"), fe(t, "viewBox", "0 0 18 18"); + t = En("svg"), n = En("path"), he(n, "d", "M5 8l4 4 4-4z"), he(t, "class", "dropdown-arrow svelte-145leq6"), he(t, "xmlns", "http://www.w3.org/2000/svg"), he(t, "width", "100%"), he(t, "height", "100%"), he(t, "viewBox", "0 0 18 18"); }, m(i, r) { - pr(i, t, r), dr(t, n); + wr(i, t, r), vr(t, n); }, - p: Pt, - i: Pt, - o: Pt, + p: It, + i: It, + o: It, d(i) { - i && br(t); + i && yr(t); } }; } -class Er extends _r { +class Hr extends pr { constructor(t) { - super(), gr(this, t, null, yr, vr, {}); + super(), Er(this, t, null, Sr, xr, {}); } } const { - SvelteComponent: wr, - append: xr, + SvelteComponent: Ar, + append: Br, attr: V, - detach: Sr, - init: Hr, - insert: Ar, - noop: It, - safe_not_equal: Br, + detach: Cr, + init: Tr, + insert: Pr, + noop: Nt, + safe_not_equal: Ir, svg_element: wn } = window.__gradio__svelte__internal; -function Tr(e) { +function Nr(e) { let t, n; return { c() { t = wn("svg"), n = wn("path"), V(n, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), V(t, "xmlns", "http://www.w3.org/2000/svg"), V(t, "width", "100%"), V(t, "height", "100%"), V(t, "viewBox", "0 0 24 24"), V(t, "fill", "none"), V(t, "stroke", "currentColor"), V(t, "stroke-width", "1.5"), V(t, "stroke-linecap", "round"), V(t, "stroke-linejoin", "round"), V(t, "class", "feather feather-edit-2"); }, m(i, r) { - Ar(i, t, r), xr(t, n); + Pr(i, t, r), Br(t, n); }, - p: It, - i: It, - o: It, + p: Nt, + i: Nt, + o: Nt, d(i) { - i && Sr(t); + i && Cr(t); } }; } -class Cr extends wr { +class Or extends Ar { constructor(t) { - super(), Hr(this, t, null, Tr, Br, {}); + super(), Tr(this, t, null, Nr, Ir, {}); } } const { - SvelteComponent: Pr, + SvelteComponent: Lr, append: xn, attr: D, - detach: Ir, - init: Nr, - insert: Or, - noop: Nt, - safe_not_equal: Mr, + detach: Mr, + init: Rr, + insert: kr, + noop: Ot, + safe_not_equal: Dr, set_style: ne, - svg_element: Ot + svg_element: Lt } = window.__gradio__svelte__internal; -function Lr(e) { +function Ur(e) { let t, n, i; return { c() { - t = Ot("svg"), n = Ot("line"), i = Ot("line"), D(n, "x1", "4"), D(n, "y1", "12"), D(n, "x2", "20"), D(n, "y2", "12"), ne(n, "fill", "none"), ne(n, "stroke-width", "2px"), D(i, "x1", "12"), D(i, "y1", "4"), D(i, "x2", "12"), D(i, "y2", "20"), ne(i, "fill", "none"), ne(i, "stroke-width", "2px"), D(t, "width", "100%"), D(t, "height", "100%"), D(t, "viewBox", "0 0 24 24"), D(t, "version", "1.1"), D(t, "xmlns", "http://www.w3.org/2000/svg"), D(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), D(t, "xml:space", "preserve"), D(t, "stroke", "currentColor"), ne(t, "fill-rule", "evenodd"), ne(t, "clip-rule", "evenodd"), ne(t, "stroke-linecap", "round"), ne(t, "stroke-linejoin", "round"); + t = Lt("svg"), n = Lt("line"), i = Lt("line"), D(n, "x1", "4"), D(n, "y1", "12"), D(n, "x2", "20"), D(n, "y2", "12"), ne(n, "fill", "none"), ne(n, "stroke-width", "2px"), D(i, "x1", "12"), D(i, "y1", "4"), D(i, "x2", "12"), D(i, "y2", "20"), ne(i, "fill", "none"), ne(i, "stroke-width", "2px"), D(t, "width", "100%"), D(t, "height", "100%"), D(t, "viewBox", "0 0 24 24"), D(t, "version", "1.1"), D(t, "xmlns", "http://www.w3.org/2000/svg"), D(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), D(t, "xml:space", "preserve"), D(t, "stroke", "currentColor"), ne(t, "fill-rule", "evenodd"), ne(t, "clip-rule", "evenodd"), ne(t, "stroke-linecap", "round"), ne(t, "stroke-linejoin", "round"); }, m(r, s) { - Or(r, t, s), xn(t, n), xn(t, i); + kr(r, t, s), xn(t, n), xn(t, i); }, - p: Nt, - i: Nt, - o: Nt, + p: Ot, + i: Ot, + o: Ot, d(r) { - r && Ir(t); + r && Mr(t); } }; } -class Rr extends Pr { +class Gr extends Lr { constructor(t) { - super(), Nr(this, t, null, Lr, Mr, {}); + super(), Rr(this, t, null, Ur, Dr, {}); } } const { - SvelteComponent: kr, - attr: Dr, - create_slot: Ur, - detach: Gr, - element: Fr, - get_all_dirty_from_scope: zr, - get_slot_changes: jr, - init: Xr, - insert: Vr, - safe_not_equal: qr, - transition_in: Wr, - transition_out: Yr, - update_slot_base: Zr + SvelteComponent: Fr, + attr: zr, + create_slot: jr, + detach: Xr, + element: Vr, + get_all_dirty_from_scope: qr, + get_slot_changes: Wr, + init: Yr, + insert: Zr, + safe_not_equal: Qr, + transition_in: Jr, + transition_out: Kr, + update_slot_base: $r } = window.__gradio__svelte__internal; -function Qr(e) { +function es(e) { let t, n; const i = ( /*#slots*/ e[1].default - ), r = Ur( + ), r = jr( i, e, /*$$scope*/ @@ -202,26 +202,26 @@ function Qr(e) { ); return { c() { - t = Fr("div"), r && r.c(), Dr(t, "class", "svelte-1hnfib2"); + t = Vr("div"), r && r.c(), zr(t, "class", "svelte-1hnfib2"); }, m(s, u) { - Vr(s, t, u), r && r.m(t, null), n = !0; + Zr(s, t, u), r && r.m(t, null), n = !0; }, p(s, [u]) { r && r.p && (!n || u & /*$$scope*/ - 1) && Zr( + 1) && $r( r, i, s, /*$$scope*/ s[0], - n ? jr( + n ? Wr( i, /*$$scope*/ s[0], u, null - ) : zr( + ) : qr( /*$$scope*/ s[0] ), @@ -229,65 +229,65 @@ function Qr(e) { ); }, i(s) { - n || (Wr(r, s), n = !0); + n || (Jr(r, s), n = !0); }, o(s) { - Yr(r, s), n = !1; + Kr(r, s), n = !1; }, d(s) { - s && Gr(t), r && r.d(s); + s && Xr(t), r && r.d(s); } }; } -function Jr(e, t, n) { +function ts(e, t, n) { let { $$slots: i = {}, $$scope: r } = t; return e.$$set = (s) => { "$$scope" in s && n(0, r = s.$$scope); }, [r, i]; } -class Kr extends kr { +class ns extends Fr { constructor(t) { - super(), Xr(this, t, Jr, Qr, qr, {}); + super(), Yr(this, t, ts, es, Qr, {}); } } const { - SvelteComponent: $r, + SvelteComponent: is, attr: Sn, - check_outros: es, - create_component: ts, - create_slot: ns, - destroy_component: is, - detach: ot, - element: rs, - empty: ss, - get_all_dirty_from_scope: os, - get_slot_changes: as, - group_outros: ls, - init: us, - insert: at, - mount_component: fs, - safe_not_equal: hs, - set_data: cs, - space: ms, - text: _s, - toggle_class: he, - transition_in: Me, - transition_out: lt, - update_slot_base: ds + check_outros: rs, + create_component: ss, + create_slot: os, + destroy_component: as, + detach: lt, + element: ls, + empty: us, + get_all_dirty_from_scope: fs, + get_slot_changes: hs, + group_outros: cs, + init: ms, + insert: ut, + mount_component: _s, + safe_not_equal: ds, + set_data: bs, + space: gs, + text: ps, + toggle_class: ce, + transition_in: Le, + transition_out: ft, + update_slot_base: vs } = window.__gradio__svelte__internal; function Hn(e) { let t, n; - return t = new Kr({ + return t = new ns({ props: { - $$slots: { default: [bs] }, + $$slots: { default: [ys] }, $$scope: { ctx: e } } }), { c() { - ts(t.$$.fragment); + ss(t.$$.fragment); }, m(i, r) { - fs(t, i, r), n = !0; + _s(t, i, r), n = !0; }, p(i, r) { const s = {}; @@ -295,47 +295,47 @@ function Hn(e) { 10 && (s.$$scope = { dirty: r, ctx: i }), t.$set(s); }, i(i) { - n || (Me(t.$$.fragment, i), n = !0); + n || (Le(t.$$.fragment, i), n = !0); }, o(i) { - lt(t.$$.fragment, i), n = !1; + ft(t.$$.fragment, i), n = !1; }, d(i) { - is(t, i); + as(t, i); } }; } -function bs(e) { +function ys(e) { let t; return { c() { - t = _s( + t = ps( /*info*/ e[1] ); }, m(n, i) { - at(n, t, i); + ut(n, t, i); }, p(n, i) { i & /*info*/ - 2 && cs( + 2 && bs( t, /*info*/ n[1] ); }, d(n) { - n && ot(t); + n && lt(t); } }; } -function gs(e) { +function Es(e) { let t, n, i, r; const s = ( /*#slots*/ e[2].default - ), u = ns( + ), u = os( s, e, /*$$scope*/ @@ -348,9 +348,9 @@ function gs(e) { ); return { c() { - t = rs("span"), u && u.c(), n = ms(), o && o.c(), i = ss(), Sn(t, "data-testid", "block-info"), Sn(t, "class", "svelte-22c38v"), he(t, "sr-only", !/*show_label*/ - e[0]), he(t, "hide", !/*show_label*/ - e[0]), he( + t = ls("span"), u && u.c(), n = gs(), o && o.c(), i = us(), Sn(t, "data-testid", "block-info"), Sn(t, "class", "svelte-22c38v"), ce(t, "sr-only", !/*show_label*/ + e[0]), ce(t, "hide", !/*show_label*/ + e[0]), ce( t, "has-info", /*info*/ @@ -358,66 +358,66 @@ function gs(e) { ); }, m(a, f) { - at(a, t, f), u && u.m(t, null), at(a, n, f), o && o.m(a, f), at(a, i, f), r = !0; + ut(a, t, f), u && u.m(t, null), ut(a, n, f), o && o.m(a, f), ut(a, i, f), r = !0; }, p(a, [f]) { u && u.p && (!r || f & /*$$scope*/ - 8) && ds( + 8) && vs( u, s, a, /*$$scope*/ a[3], - r ? as( + r ? hs( s, /*$$scope*/ a[3], f, null - ) : os( + ) : fs( /*$$scope*/ a[3] ), null ), (!r || f & /*show_label*/ - 1) && he(t, "sr-only", !/*show_label*/ + 1) && ce(t, "sr-only", !/*show_label*/ a[0]), (!r || f & /*show_label*/ - 1) && he(t, "hide", !/*show_label*/ + 1) && ce(t, "hide", !/*show_label*/ a[0]), (!r || f & /*info*/ - 2) && he( + 2) && ce( t, "has-info", /*info*/ a[1] != null ), /*info*/ a[1] ? o ? (o.p(a, f), f & /*info*/ - 2 && Me(o, 1)) : (o = Hn(a), o.c(), Me(o, 1), o.m(i.parentNode, i)) : o && (ls(), lt(o, 1, 1, () => { + 2 && Le(o, 1)) : (o = Hn(a), o.c(), Le(o, 1), o.m(i.parentNode, i)) : o && (cs(), ft(o, 1, 1, () => { o = null; - }), es()); + }), rs()); }, i(a) { - r || (Me(u, a), Me(o), r = !0); + r || (Le(u, a), Le(o), r = !0); }, o(a) { - lt(u, a), lt(o), r = !1; + ft(u, a), ft(o), r = !1; }, d(a) { - a && (ot(t), ot(n), ot(i)), u && u.d(a), o && o.d(a); + a && (lt(t), lt(n), lt(i)), u && u.d(a), o && o.d(a); } }; } -function ps(e, t, n) { +function ws(e, t, n) { let { $$slots: i = {}, $$scope: r } = t, { show_label: s = !0 } = t, { info: u = void 0 } = t; return e.$$set = (o) => { "show_label" in o && n(0, s = o.show_label), "info" in o && n(1, u = o.info), "$$scope" in o && n(3, r = o.$$scope); }, [s, u, i, r]; } -class hi extends $r { +class hi extends is { constructor(t) { - super(), us(this, t, ps, gs, hs, { show_label: 0, info: 1 }); + super(), ms(this, t, ws, Es, ds, { show_label: 0, info: 1 }); } } -const vs = [ +const xs = [ { color: "red", primary: 600, secondary: 100 }, { color: "green", primary: 600, secondary: 100 }, { color: "blue", primary: 600, secondary: 100 }, @@ -721,7 +721,7 @@ const vs = [ 950: "#4c0519" } }; -vs.reduce( +xs.reduce( (e, { color: t, primary: n, secondary: i }) => ({ ...e, [t]: { @@ -732,32 +732,32 @@ vs.reduce( {} ); const { - SvelteComponent: ys, + SvelteComponent: Ss, append: Bn, attr: Mt, - bubble: Tn, - create_component: Es, - destroy_component: ws, + bubble: Cn, + create_component: Hs, + destroy_component: As, detach: ci, - element: Cn, - init: xs, + element: Tn, + init: Bs, insert: mi, - listen: Lt, - mount_component: Ss, - run_all: Hs, - safe_not_equal: As, - set_data: Bs, + listen: Rt, + mount_component: Cs, + run_all: Ts, + safe_not_equal: Ps, + set_data: Is, set_input_value: Pn, - space: Ts, - text: Cs, - transition_in: Ps, - transition_out: Is -} = window.__gradio__svelte__internal, { createEventDispatcher: Ns, afterUpdate: Os } = window.__gradio__svelte__internal; -function Ms(e) { + space: Ns, + text: Os, + transition_in: Ls, + transition_out: Ms +} = window.__gradio__svelte__internal, { createEventDispatcher: Rs, afterUpdate: ks } = window.__gradio__svelte__internal; +function Ds(e) { let t; return { c() { - t = Cs( + t = Os( /*label*/ e[1] ); @@ -767,7 +767,7 @@ function Ms(e) { }, p(n, i) { i & /*label*/ - 2 && Bs( + 2 && Is( t, /*label*/ n[1] @@ -778,7 +778,7 @@ function Ms(e) { } }; } -function Ls(e) { +function Us(e) { let t, n, i, r, s, u, o; return n = new hi({ props: { @@ -790,33 +790,33 @@ function Ls(e) { /*info*/ e[2] ), - $$slots: { default: [Ms] }, + $$slots: { default: [Ds] }, $$scope: { ctx: e } } }), { c() { - t = Cn("label"), Es(n.$$.fragment), i = Ts(), r = Cn("input"), Mt(r, "type", "color"), r.disabled = /*disabled*/ + t = Tn("label"), Hs(n.$$.fragment), i = Ns(), r = Tn("input"), Mt(r, "type", "color"), r.disabled = /*disabled*/ e[3], Mt(r, "class", "svelte-16l8u73"), Mt(t, "class", "block"); }, m(a, f) { - mi(a, t, f), Ss(n, t, null), Bn(t, i), Bn(t, r), Pn( + mi(a, t, f), Cs(n, t, null), Bn(t, i), Bn(t, r), Pn( r, /*value*/ e[0] ), s = !0, u || (o = [ - Lt( + Rt( r, "input", /*input_input_handler*/ e[8] ), - Lt( + Rt( r, "focus", /*focus_handler*/ e[6] ), - Lt( + Rt( r, "blur", /*blur_handler*/ @@ -841,36 +841,36 @@ function Ls(e) { ); }, i(a) { - s || (Ps(n.$$.fragment, a), s = !0); + s || (Ls(n.$$.fragment, a), s = !0); }, o(a) { - Is(n.$$.fragment, a), s = !1; + Ms(n.$$.fragment, a), s = !1; }, d(a) { - a && ci(t), ws(n), u = !1, Hs(o); + a && ci(t), As(n), u = !1, Ts(o); } }; } -function Rs(e, t, n) { +function Gs(e, t, n) { let { value: i = "#000000" } = t, { value_is_output: r = !1 } = t, { label: s } = t, { info: u = void 0 } = t, { disabled: o = !1 } = t, { show_label: a = !0 } = t; - const f = Ns(); + const f = Rs(); function l() { f("change", i), r || f("input"); } - Os(() => { + ks(() => { n(5, r = !1); }); - function h(g) { - Tn.call(this, e, g); + function h(b) { + Cn.call(this, e, b); } - function c(g) { - Tn.call(this, e, g); + function m(b) { + Cn.call(this, e, b); } function _() { i = this.value, n(0, i); } - return e.$$set = (g) => { - "value" in g && n(0, i = g.value), "value_is_output" in g && n(5, r = g.value_is_output), "label" in g && n(1, s = g.label), "info" in g && n(2, u = g.info), "disabled" in g && n(3, o = g.disabled), "show_label" in g && n(4, a = g.show_label); + return e.$$set = (b) => { + "value" in b && n(0, i = b.value), "value_is_output" in b && n(5, r = b.value_is_output), "label" in b && n(1, s = b.label), "info" in b && n(2, u = b.info), "disabled" in b && n(3, o = b.disabled), "show_label" in b && n(4, a = b.show_label); }, e.$$.update = () => { e.$$.dirty & /*value*/ 1 && l(); @@ -882,13 +882,13 @@ function Rs(e, t, n) { a, r, h, - c, + m, _ ]; } -class ks extends ys { +class Fs extends Ss { constructor(t) { - super(), xs(this, t, Rs, Ls, As, { + super(), Bs(this, t, Gs, Us, Ps, { value: 0, value_is_output: 5, label: 1, @@ -898,25 +898,25 @@ class ks extends ys { }); } } -function we() { +function xe() { } -function Ds(e) { +function zs(e) { return e(); } -function Us(e) { - e.forEach(Ds); +function js(e) { + e.forEach(zs); } -function Gs(e) { +function Xs(e) { return typeof e == "function"; } -function Fs(e, t) { +function Vs(e, t) { return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function"; } -function zs(e, ...t) { +function qs(e, ...t) { if (e == null) { for (const i of t) i(void 0); - return we; + return xe; } const n = e.subscribe(...t); return n.unsubscribe ? () => n.unsubscribe() : n; @@ -929,111 +929,111 @@ function In(e) { "px" ]; } -function js(e) { +function Ws(e) { const t = e - 1; return t * t * t + 1; } -function Nn(e, { delay: t = 0, duration: n = 400, easing: i = js, x: r = 0, y: s = 0, opacity: u = 0 } = {}) { - const o = getComputedStyle(e), a = +o.opacity, f = o.transform === "none" ? "" : o.transform, l = a * (1 - u), [h, c] = In(r), [_, g] = In(s); +function Nn(e, { delay: t = 0, duration: n = 400, easing: i = Ws, x: r = 0, y: s = 0, opacity: u = 0 } = {}) { + const o = getComputedStyle(e), a = +o.opacity, f = o.transform === "none" ? "" : o.transform, l = a * (1 - u), [h, m] = In(r), [_, b] = In(s); return { delay: t, duration: n, easing: i, - css: (m, d) => ` - transform: ${f} translate(${(1 - m) * h}${c}, ${(1 - m) * _}${g}); + css: (g, d) => ` + transform: ${f} translate(${(1 - g) * h}${m}, ${(1 - g) * _}${b}); opacity: ${a - l * d}` }; } -const ce = []; -function Xs(e, t) { +const me = []; +function Ys(e, t) { return { - subscribe: pt(e, t).subscribe + subscribe: yt(e, t).subscribe }; } -function pt(e, t = we) { +function yt(e, t = xe) { let n; const i = /* @__PURE__ */ new Set(); function r(o) { - if (Fs(e, o) && (e = o, n)) { - const a = !ce.length; + if (Vs(e, o) && (e = o, n)) { + const a = !me.length; for (const f of i) - f[1](), ce.push(f, e); + f[1](), me.push(f, e); if (a) { - for (let f = 0; f < ce.length; f += 2) - ce[f][0](ce[f + 1]); - ce.length = 0; + for (let f = 0; f < me.length; f += 2) + me[f][0](me[f + 1]); + me.length = 0; } } } function s(o) { r(o(e)); } - function u(o, a = we) { + function u(o, a = xe) { const f = [o, a]; - return i.add(f), i.size === 1 && (n = t(r, s) || we), o(e), () => { + return i.add(f), i.size === 1 && (n = t(r, s) || xe), o(e), () => { i.delete(f), i.size === 0 && n && (n(), n = null); }; } return { set: r, update: s, subscribe: u }; } -function Be(e, t, n) { +function Ce(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 s = t.length < 2; - return Xs(n, (u, o) => { + return Ys(n, (u, o) => { let a = !1; const f = []; - let l = 0, h = we; - const c = () => { + let l = 0, h = xe; + const m = () => { if (l) return; h(); - const g = t(i ? f[0] : f, u, o); - s ? u(g) : h = Gs(g) ? g : we; + const b = t(i ? f[0] : f, u, o); + s ? u(b) : h = Xs(b) ? b : xe; }, _ = r.map( - (g, m) => zs( - g, + (b, g) => qs( + b, (d) => { - f[m] = d, l &= ~(1 << m), a && c(); + f[g] = d, l &= ~(1 << g), a && m(); }, () => { - l |= 1 << m; + l |= 1 << g; } ) ); - return a = !0, c(), function() { - Us(_), h(), a = !1; + return a = !0, m(), function() { + js(_), h(), a = !1; }; }); } new Intl.Collator(0, { numeric: 1 }).compare; const { - SvelteComponent: Vs, + SvelteComponent: Zs, append: _i, attr: N, - bubble: qs, - check_outros: Ws, + bubble: Qs, + check_outros: Js, create_slot: di, detach: Ve, - element: vt, - empty: Ys, + element: Et, + empty: Ks, get_all_dirty_from_scope: bi, get_slot_changes: gi, - group_outros: Zs, - init: Qs, + group_outros: $s, + init: eo, insert: qe, - listen: Js, - safe_not_equal: Ks, + listen: to, + safe_not_equal: no, set_style: F, space: pi, - src_url_equal: ct, - toggle_class: ye, - transition_in: mt, - transition_out: _t, + src_url_equal: _t, + toggle_class: Ee, + transition_in: dt, + transition_out: bt, update_slot_base: vi } = window.__gradio__svelte__internal; -function $s(e) { +function io(e) { let t, n, i, r, s, u, o = ( /*icon*/ e[7] && On(e) @@ -1050,7 +1050,7 @@ function $s(e) { ); return { c() { - t = vt("button"), o && o.c(), n = pi(), f && f.c(), N(t, "class", i = /*size*/ + t = Et("button"), o && o.c(), n = pi(), f && f.c(), N(t, "class", i = /*size*/ e[4] + " " + /*variant*/ e[3] + " " + /*elem_classes*/ e[1].join(" ") + " svelte-8huxfn"), N( @@ -1059,7 +1059,7 @@ function $s(e) { /*elem_id*/ e[0] ), t.disabled = /*disabled*/ - e[8], ye(t, "hidden", !/*visible*/ + e[8], Ee(t, "hidden", !/*visible*/ e[2]), F( t, "flex-grow", @@ -1075,7 +1075,7 @@ function $s(e) { e[10]}px, 100%))` : null); }, m(l, h) { - qe(l, t, h), o && o.m(t, null), _i(t, n), f && f.m(t, null), r = !0, s || (u = Js( + qe(l, t, h), o && o.m(t, null), _i(t, n), f && f.m(t, null), r = !0, s || (u = to( t, "click", /*click_handler*/ @@ -1115,7 +1115,7 @@ function $s(e) { ), (!r || h & /*disabled*/ 256) && (t.disabled = /*disabled*/ l[8]), (!r || h & /*size, variant, elem_classes, visible*/ - 30) && ye(t, "hidden", !/*visible*/ + 30) && Ee(t, "hidden", !/*visible*/ l[2]), h & /*scale*/ 512 && F( t, @@ -1134,20 +1134,20 @@ function $s(e) { l[10]}px, 100%))` : null); }, i(l) { - r || (mt(f, l), r = !0); + r || (dt(f, l), r = !0); }, o(l) { - _t(f, l), r = !1; + bt(f, l), r = !1; }, d(l) { l && Ve(t), o && o.d(), f && f.d(l), s = !1, u(); } }; } -function eo(e) { +function ro(e) { let t, n, i, r, s = ( /*icon*/ - e[7] && Mn(e) + e[7] && Ln(e) ); const u = ( /*#slots*/ @@ -1161,7 +1161,7 @@ function eo(e) { ); return { c() { - t = vt("a"), s && s.c(), n = pi(), o && o.c(), N( + t = Et("a"), s && s.c(), n = pi(), o && o.c(), N( t, "href", /*link*/ @@ -1179,8 +1179,8 @@ function eo(e) { "id", /*elem_id*/ e[0] - ), ye(t, "hidden", !/*visible*/ - e[2]), ye( + ), Ee(t, "hidden", !/*visible*/ + e[2]), Ee( t, "disabled", /*disabled*/ @@ -1209,7 +1209,7 @@ function eo(e) { }, p(a, f) { /*icon*/ - a[7] ? s ? s.p(a, f) : (s = Mn(a), s.c(), s.m(t, n)) : s && (s.d(1), s = null), o && o.p && (!r || f & /*$$scope*/ + a[7] ? s ? s.p(a, f) : (s = Ln(a), s.c(), s.m(t, n)) : s && (s.d(1), s = null), o && o.p && (!r || f & /*$$scope*/ 2048) && vi( o, u, @@ -1250,9 +1250,9 @@ function eo(e) { /*elem_id*/ a[0] ), (!r || f & /*size, variant, elem_classes, visible*/ - 30) && ye(t, "hidden", !/*visible*/ + 30) && Ee(t, "hidden", !/*visible*/ a[2]), (!r || f & /*size, variant, elem_classes, disabled*/ - 282) && ye( + 282) && Ee( t, "disabled", /*disabled*/ @@ -1281,10 +1281,10 @@ function eo(e) { a[10]}px, 100%))` : null); }, i(a) { - r || (mt(o, a), r = !0); + r || (dt(o, a), r = !0); }, o(a) { - _t(o, a), r = !1; + bt(o, a), r = !1; }, d(a) { a && Ve(t), s && s.d(), o && o.d(a); @@ -1295,7 +1295,7 @@ function On(e) { let t, n, i; return { c() { - t = vt("img"), N(t, "class", "button-icon svelte-8huxfn"), ct(t.src, n = /*icon*/ + t = Et("img"), N(t, "class", "button-icon svelte-8huxfn"), _t(t.src, n = /*icon*/ e[7].url) || N(t, "src", n), N(t, "alt", i = `${/*value*/ e[5]} icon`); }, @@ -1304,7 +1304,7 @@ function On(e) { }, p(r, s) { s & /*icon*/ - 128 && !ct(t.src, n = /*icon*/ + 128 && !_t(t.src, n = /*icon*/ r[7].url) && N(t, "src", n), s & /*value*/ 32 && i !== (i = `${/*value*/ r[5]} icon`) && N(t, "alt", i); @@ -1314,11 +1314,11 @@ function On(e) { } }; } -function Mn(e) { +function Ln(e) { let t, n, i; return { c() { - t = vt("img"), N(t, "class", "button-icon svelte-8huxfn"), ct(t.src, n = /*icon*/ + t = Et("img"), N(t, "class", "button-icon svelte-8huxfn"), _t(t.src, n = /*icon*/ e[7].url) || N(t, "src", n), N(t, "alt", i = `${/*value*/ e[5]} icon`); }, @@ -1327,7 +1327,7 @@ function Mn(e) { }, p(r, s) { s & /*icon*/ - 128 && !ct(t.src, n = /*icon*/ + 128 && !_t(t.src, n = /*icon*/ r[7].url) && N(t, "src", n), s & /*value*/ 32 && i !== (i = `${/*value*/ r[5]} icon`) && N(t, "alt", i); @@ -1337,9 +1337,9 @@ function Mn(e) { } }; } -function to(e) { +function so(e) { let t, n, i, r; - const s = [eo, $s], u = []; + const s = [ro, io], u = []; function o(a, f) { return ( /*link*/ @@ -1349,35 +1349,35 @@ function to(e) { } return t = o(e), n = u[t] = s[t](e), { c() { - n.c(), i = Ys(); + n.c(), i = Ks(); }, m(a, f) { u[t].m(a, f), qe(a, i, f), r = !0; }, p(a, [f]) { let l = t; - t = o(a), t === l ? u[t].p(a, f) : (Zs(), _t(u[l], 1, 1, () => { + t = o(a), t === l ? u[t].p(a, f) : ($s(), bt(u[l], 1, 1, () => { u[l] = null; - }), Ws(), n = u[t], n ? n.p(a, f) : (n = u[t] = s[t](a), n.c()), mt(n, 1), n.m(i.parentNode, i)); + }), Js(), n = u[t], n ? n.p(a, f) : (n = u[t] = s[t](a), n.c()), dt(n, 1), n.m(i.parentNode, i)); }, i(a) { - r || (mt(n), r = !0); + r || (dt(n), r = !0); }, o(a) { - _t(n), r = !1; + bt(n), r = !1; }, d(a) { a && Ve(i), u[t].d(a); } }; } -function no(e, t, n) { - let { $$slots: i = {}, $$scope: r } = t, { elem_id: s = "" } = t, { elem_classes: u = [] } = t, { visible: o = !0 } = t, { variant: a = "secondary" } = t, { size: f = "lg" } = t, { value: l = null } = t, { link: h = null } = t, { icon: c = null } = t, { disabled: _ = !1 } = t, { scale: g = null } = t, { min_width: m = void 0 } = t; - function d(b) { - qs.call(this, e, b); +function oo(e, t, n) { + let { $$slots: i = {}, $$scope: r } = t, { elem_id: s = "" } = t, { elem_classes: u = [] } = t, { visible: o = !0 } = t, { variant: a = "secondary" } = t, { size: f = "lg" } = t, { value: l = null } = t, { link: h = null } = t, { icon: m = null } = t, { disabled: _ = !1 } = t, { scale: b = null } = t, { min_width: g = void 0 } = t; + function d(c) { + Qs.call(this, e, c); } - return e.$$set = (b) => { - "elem_id" in b && n(0, s = b.elem_id), "elem_classes" in b && n(1, u = b.elem_classes), "visible" in b && n(2, o = b.visible), "variant" in b && n(3, a = b.variant), "size" in b && n(4, f = b.size), "value" in b && n(5, l = b.value), "link" in b && n(6, h = b.link), "icon" in b && n(7, c = b.icon), "disabled" in b && n(8, _ = b.disabled), "scale" in b && n(9, g = b.scale), "min_width" in b && n(10, m = b.min_width), "$$scope" in b && n(11, r = b.$$scope); + return e.$$set = (c) => { + "elem_id" in c && n(0, s = c.elem_id), "elem_classes" in c && n(1, u = c.elem_classes), "visible" in c && n(2, o = c.visible), "variant" in c && n(3, a = c.variant), "size" in c && n(4, f = c.size), "value" in c && n(5, l = c.value), "link" in c && n(6, h = c.link), "icon" in c && n(7, m = c.icon), "disabled" in c && n(8, _ = c.disabled), "scale" in c && n(9, b = c.scale), "min_width" in c && n(10, g = c.min_width), "$$scope" in c && n(11, r = c.$$scope); }, [ s, u, @@ -1386,18 +1386,18 @@ function no(e, t, n) { f, l, h, - c, + m, _, + b, g, - m, r, i, d ]; } -class Ln extends Vs { +class Mn extends Zs { constructor(t) { - super(), Qs(this, t, no, to, Ks, { + super(), eo(this, t, oo, so, no, { elem_id: 0, elem_classes: 1, visible: 2, @@ -1412,47 +1412,47 @@ class Ln extends Vs { }); } } -function io(e) { +function ao(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var ro = function(t) { - return so(t) && !oo(t); +var lo = function(t) { + return uo(t) && !fo(t); }; -function so(e) { +function uo(e) { return !!e && typeof e == "object"; } -function oo(e) { +function fo(e) { var t = Object.prototype.toString.call(e); - return t === "[object RegExp]" || t === "[object Date]" || uo(e); + return t === "[object RegExp]" || t === "[object Date]" || mo(e); } -var ao = typeof Symbol == "function" && Symbol.for, lo = ao ? Symbol.for("react.element") : 60103; -function uo(e) { - return e.$$typeof === lo; +var ho = typeof Symbol == "function" && Symbol.for, co = ho ? Symbol.for("react.element") : 60103; +function mo(e) { + return e.$$typeof === co; } -function fo(e) { +function _o(e) { return Array.isArray(e) ? [] : {}; } function ze(e, t) { - return t.clone !== !1 && t.isMergeableObject(e) ? xe(fo(e), e, t) : e; + return t.clone !== !1 && t.isMergeableObject(e) ? Se(_o(e), e, t) : e; } -function ho(e, t, n) { +function bo(e, t, n) { return e.concat(t).map(function(i) { return ze(i, n); }); } -function co(e, t) { +function go(e, t) { if (!t.customMerge) - return xe; + return Se; var n = t.customMerge(e); - return typeof n == "function" ? n : xe; + return typeof n == "function" ? n : Se; } -function mo(e) { +function po(e) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) { return Object.propertyIsEnumerable.call(e, t); }) : []; } function Rn(e) { - return Object.keys(e).concat(mo(e)); + return Object.keys(e).concat(po(e)); } function yi(e, t) { try { @@ -1461,43 +1461,43 @@ function yi(e, t) { return !1; } } -function _o(e, t) { +function vo(e, t) { return yi(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t)); } -function bo(e, t, n) { +function yo(e, t, n) { var i = {}; return n.isMergeableObject(e) && Rn(e).forEach(function(r) { i[r] = ze(e[r], n); }), Rn(t).forEach(function(r) { - _o(e, r) || (yi(e, r) && n.isMergeableObject(t[r]) ? i[r] = co(r, n)(e[r], t[r], n) : i[r] = ze(t[r], n)); + vo(e, r) || (yi(e, r) && n.isMergeableObject(t[r]) ? i[r] = go(r, n)(e[r], t[r], n) : i[r] = ze(t[r], n)); }), i; } -function xe(e, t, n) { - n = n || {}, n.arrayMerge = n.arrayMerge || ho, n.isMergeableObject = n.isMergeableObject || ro, n.cloneUnlessOtherwiseSpecified = ze; +function Se(e, t, n) { + n = n || {}, n.arrayMerge = n.arrayMerge || bo, n.isMergeableObject = n.isMergeableObject || lo, n.cloneUnlessOtherwiseSpecified = ze; var i = Array.isArray(t), r = Array.isArray(e), s = i === r; - return s ? i ? n.arrayMerge(e, t, n) : bo(e, t, n) : ze(t, n); + return s ? i ? n.arrayMerge(e, t, n) : yo(e, t, n) : ze(t, n); } -xe.all = function(t, n) { +Se.all = function(t, n) { if (!Array.isArray(t)) throw new Error("first argument should be an array"); return t.reduce(function(i, r) { - return xe(i, r, n); + return Se(i, r, n); }, {}); }; -var go = xe, po = go; -const vo = /* @__PURE__ */ io(po); -var Zt = function(e, t) { - return Zt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) { +var Eo = Se, wo = Eo; +const xo = /* @__PURE__ */ ao(wo); +var Qt = function(e, t) { + return Qt = 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]); - }, Zt(e, t); + }, Qt(e, t); }; -function yt(e, t) { +function wt(e, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); - Zt(e, t); + Qt(e, t); function n() { this.constructor = e; } @@ -1513,7 +1513,7 @@ var A = function() { return t; }, A.apply(this, arguments); }; -function Rt(e, t, n) { +function kt(e, t, n) { if (n || arguments.length === 2) for (var i = 0, r = t.length, s; i < r; i++) (s || !(i in t)) && (s || (s = Array.prototype.slice.call(t, 0, i)), s[i] = t[i]); @@ -1527,14 +1527,14 @@ var I; (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"; })(I || (I = {})); -var Se; +var He; (function(e) { e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime"; -})(Se || (Se = {})); +})(He || (He = {})); function kn(e) { return e.type === I.literal; } -function yo(e) { +function So(e) { return e.type === I.argument; } function Ei(e) { @@ -1552,22 +1552,22 @@ function Si(e) { function Hi(e) { return e.type === I.plural; } -function Eo(e) { +function Ho(e) { return e.type === I.pound; } function Ai(e) { return e.type === I.tag; } function Bi(e) { - return !!(e && typeof e == "object" && e.type === Se.number); + return !!(e && typeof e == "object" && e.type === He.number); } -function Qt(e) { - return !!(e && typeof e == "object" && e.type === Se.dateTime); +function Jt(e) { + return !!(e && typeof e == "object" && e.type === He.dateTime); } -var Ti = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, wo = /(?:[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 xo(e) { +var Ci = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, Ao = /(?:[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 Bo(e) { var t = {}; - return e.replace(wo, function(n) { + return e.replace(Ao, function(n) { var i = n.length; switch (n[0]) { case "G": @@ -1656,12 +1656,12 @@ function xo(e) { return ""; }), t; } -var So = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; -function Ho(e) { +var Co = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; +function To(e) { if (e.length === 0) throw new Error("Number skeleton cannot be empty"); - for (var t = e.split(So).filter(function(c) { - return c.length > 0; + for (var t = e.split(Co).filter(function(m) { + return m.length > 0; }), n = [], i = 0, r = t; i < r.length; i++) { var s = r[i], u = s.split("/"); if (u.length === 0) @@ -1675,13 +1675,13 @@ function Ho(e) { } return n; } -function Ao(e) { +function Po(e) { return e.replace(/^(.*?)-/, ""); } -var Dn = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Ci = /^(@+)?(\+|#+)?[rs]?$/g, Bo = /(\*)(0+)|(#+)(0+)|(0+)/g, Pi = /^(0+)$/; +var Dn = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Ti = /^(@+)?(\+|#+)?[rs]?$/g, Io = /(\*)(0+)|(#+)(0+)|(0+)/g, Pi = /^(0+)$/; function Un(e) { var t = {}; - return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Ci, function(n, i, r) { + return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Ti, 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; } @@ -1725,7 +1725,7 @@ function Ii(e) { }; } } -function To(e) { +function No(e) { var t; if (e[0] === "E" && e[1] === "E" ? (t = { notation: "engineering" @@ -1743,7 +1743,7 @@ function Gn(e) { var t = {}, n = Ii(e); return n || t; } -function Co(e) { +function Oo(e) { for (var t = {}, n = 0, i = e; n < i.length; n++) { var r = i[n]; switch (r.stem) { @@ -1767,7 +1767,7 @@ function Co(e) { continue; case "measure-unit": case "unit": - t.style = "unit", t.unit = Ao(r.options[0]); + t.style = "unit", t.unit = Po(r.options[0]); continue; case "compact-short": case "K": @@ -1808,11 +1808,11 @@ function Co(e) { case "integer-width": if (r.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); - r.options[0].replace(Bo, function(a, f, l, h, c, _) { + r.options[0].replace(Io, function(a, f, l, h, m, _) { if (f) t.minimumIntegerDigits = l.length; else { - if (h && c) + if (h && m) throw new Error("We currently do not support maximum integer digits"); if (_) throw new Error("We currently do not support exact integer digits"); @@ -1828,25 +1828,25 @@ function Co(e) { if (Dn.test(r.stem)) { if (r.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); - r.stem.replace(Dn, function(a, f, l, h, c, _) { - return l === "*" ? t.minimumFractionDigits = f.length : h && h[0] === "#" ? t.maximumFractionDigits = h.length : c && _ ? (t.minimumFractionDigits = c.length, t.maximumFractionDigits = c.length + _.length) : (t.minimumFractionDigits = f.length, t.maximumFractionDigits = f.length), ""; + r.stem.replace(Dn, function(a, f, l, h, m, _) { + return l === "*" ? t.minimumFractionDigits = f.length : h && h[0] === "#" ? t.maximumFractionDigits = h.length : m && _ ? (t.minimumFractionDigits = m.length, t.maximumFractionDigits = m.length + _.length) : (t.minimumFractionDigits = f.length, t.maximumFractionDigits = f.length), ""; }); var s = r.options[0]; s === "w" ? t = A(A({}, t), { trailingZeroDisplay: "stripIfInteger" }) : s && (t = A(A({}, t), Un(s))); continue; } - if (Ci.test(r.stem)) { + if (Ti.test(r.stem)) { t = A(A({}, t), Un(r.stem)); continue; } var u = Ii(r.stem); u && (t = A(A({}, t), u)); - var o = To(r.stem); + var o = No(r.stem); o && (t = A(A({}, t), o)); } return t; } -var Qe = { +var Ke = { AX: [ "H" ], @@ -3183,13 +3183,13 @@ var Qe = { "h" ] }; -function Po(e, t) { +function Lo(e, t) { for (var n = "", i = 0; i < e.length; i++) { var r = e.charAt(i); if (r === "j") { for (var s = 0; i + 1 < e.length && e.charAt(i + 1) === r; ) s++, i++; - var u = 1 + (s & 1), o = s < 2 ? 1 : 3 + (s >> 1), a = "a", f = Io(t); + var u = 1 + (s & 1), o = s < 2 ? 1 : 3 + (s >> 1), a = "a", f = Mo(t); for ((f == "H" || f == "k") && (o = 0); o-- > 0; ) n += a; for (; u-- > 0; ) @@ -3199,7 +3199,7 @@ function Po(e, t) { } return n; } -function Io(e) { +function Mo(e) { var t = e.hourCycle; if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet e.hourCycles && // @ts-ignore @@ -3218,23 +3218,23 @@ function Io(e) { } var n = e.language, i; n !== "root" && (i = e.maximize().region); - var r = Qe[i || ""] || Qe[n || ""] || Qe["".concat(n, "-001")] || Qe["001"]; + var r = Ke[i || ""] || Ke[n || ""] || Ke["".concat(n, "-001")] || Ke["001"]; return r[0]; } -var kt, No = new RegExp("^".concat(Ti.source, "*")), Oo = new RegExp("".concat(Ti.source, "*$")); +var Dt, Ro = new RegExp("^".concat(Ci.source, "*")), ko = new RegExp("".concat(Ci.source, "*$")); function H(e, t) { return { start: e, end: t }; } -var Mo = !!String.prototype.startsWith, Lo = !!String.fromCodePoint, Ro = !!Object.fromEntries, ko = !!String.prototype.codePointAt, Do = !!String.prototype.trimStart, Uo = !!String.prototype.trimEnd, Go = !!Number.isSafeInteger, Fo = Go ? Number.isSafeInteger : function(e) { +var Do = !!String.prototype.startsWith, Uo = !!String.fromCodePoint, Go = !!Object.fromEntries, Fo = !!String.prototype.codePointAt, zo = !!String.prototype.trimStart, jo = !!String.prototype.trimEnd, Xo = !!Number.isSafeInteger, Vo = Xo ? Number.isSafeInteger : function(e) { return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991; -}, Jt = !0; +}, Kt = !0; try { - var zo = Oi("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - Jt = ((kt = zo.exec("a")) === null || kt === void 0 ? void 0 : kt[0]) === "a"; + var qo = Oi("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + Kt = ((Dt = qo.exec("a")) === null || Dt === void 0 ? void 0 : Dt[0]) === "a"; } catch { - Jt = !1; + Kt = !1; } -var Fn = Mo ? ( +var Fn = Do ? ( // Native function(t, n, i) { return t.startsWith(n, i); @@ -3244,7 +3244,7 @@ var Fn = Mo ? ( function(t, n, i) { return t.slice(i, i + n.length) === n; } -), Kt = Lo ? String.fromCodePoint : ( +), $t = Uo ? String.fromCodePoint : ( // IE11 function() { for (var t = [], n = 0; n < arguments.length; n++) @@ -3258,7 +3258,7 @@ var Fn = Mo ? ( } ), zn = ( // native - Ro ? Object.fromEntries : ( + Go ? Object.fromEntries : ( // Ponyfill function(t) { for (var n = {}, i = 0, r = t; i < r.length; i++) { @@ -3268,7 +3268,7 @@ var Fn = Mo ? ( return n; } ) -), Ni = ko ? ( +), Ni = Fo ? ( // Native function(t, n) { return t.codePointAt(n); @@ -3282,7 +3282,7 @@ var Fn = Mo ? ( return r < 55296 || r > 56319 || n + 1 === i || (s = t.charCodeAt(n + 1)) < 56320 || s > 57343 ? r : (r - 55296 << 10) + (s - 56320) + 65536; } } -), jo = Do ? ( +), Wo = zo ? ( // Native function(t) { return t.trimStart(); @@ -3290,9 +3290,9 @@ var Fn = Mo ? ( ) : ( // Ponyfill function(t) { - return t.replace(No, ""); + return t.replace(Ro, ""); } -), Xo = Uo ? ( +), Yo = jo ? ( // Native function(t) { return t.trimEnd(); @@ -3300,32 +3300,32 @@ var Fn = Mo ? ( ) : ( // Ponyfill function(t) { - return t.replace(Oo, ""); + return t.replace(ko, ""); } ); function Oi(e, t) { return new RegExp(e, t); } -var $t; -if (Jt) { +var en; +if (Kt) { var jn = Oi("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - $t = function(t, n) { + en = function(t, n) { var i; jn.lastIndex = n; var r = jn.exec(t); return (i = r[1]) !== null && i !== void 0 ? i : ""; }; } else - $t = function(t, n) { + en = function(t, n) { for (var i = []; ; ) { var r = Ni(t, n); - if (r === void 0 || Mi(r) || Yo(r)) + if (r === void 0 || Li(r) || Ko(r)) break; i.push(r), n += r >= 65536 ? 2 : 1; } - return Kt.apply(void 0, i); + return $t.apply(void 0, i); }; -var Vo = ( +var Zo = ( /** @class */ function() { function e(t, n) { @@ -3356,7 +3356,7 @@ var Vo = ( if (i) break; return this.error(S.UNMATCHED_CLOSING_TAG, H(this.clonePosition(), this.clonePosition())); - } else if (s === 60 && !this.ignoreTag && en(this.peek() || 0)) { + } else if (s === 60 && !this.ignoreTag && tn(this.peek() || 0)) { var u = this.parseTag(t, n); if (u.err) return u; @@ -3389,7 +3389,7 @@ var Vo = ( return s; var u = s.val, o = this.clonePosition(); if (this.bumpIf("") ? { @@ -3407,7 +3407,7 @@ var Vo = ( return this.error(S.INVALID_TAG, H(i, this.clonePosition())); }, e.prototype.parseTagName = function() { var t = this.offset(); - for (this.bump(); !this.isEOF() && Wo(this.char()); ) + for (this.bump(); !this.isEOF() && Jo(this.char()); ) this.bump(); return this.message.slice(t, this.offset()); }, e.prototype.parseLiteral = function(t, n) { @@ -3436,7 +3436,7 @@ var Vo = ( }; }, e.prototype.tryParseLeftAngleBracket = function() { return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail. - !qo(this.peek() || 0)) ? (this.bump(), "<") : null; + !Qo(this.peek() || 0)) ? (this.bump(), "<") : null; }, e.prototype.tryParseQuote = function(t) { if (this.isEOF() || this.char() !== 39) return null; @@ -3470,12 +3470,12 @@ var Vo = ( n.push(i); this.bump(); } - return Kt.apply(void 0, n); + return $t.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(), Kt(i)); + return i === 60 || i === 123 || i === 35 && (n === "plural" || n === "selectordinal") || i === 125 && t > 0 ? null : (this.bump(), $t(i)); }, e.prototype.parseArgument = function(t, n) { var i = this.clonePosition(); if (this.bump(), this.bumpSpace(), this.isEOF()) @@ -3504,7 +3504,7 @@ var Vo = ( return this.error(S.MALFORMED_ARGUMENT, H(i, this.clonePosition())); } }, e.prototype.parseIdentifierIfPossible = function() { - var t = this.clonePosition(), n = this.offset(), i = $t(this.message, n), r = n + i.length; + var t = this.clonePosition(), n = this.offset(), i = en(this.message, n), r = n + i.length; this.bumpTo(r); var s = this.clonePosition(), u = H(t, s); return { value: i, location: u }; @@ -3523,37 +3523,37 @@ var Vo = ( var l = this.clonePosition(), h = this.parseSimpleArgStyleIfPossible(); if (h.err) return h; - var c = Xo(h.val); - if (c.length === 0) + var m = Yo(h.val); + if (m.length === 0) return this.error(S.EXPECT_ARGUMENT_STYLE, H(this.clonePosition(), this.clonePosition())); var _ = H(l, this.clonePosition()); - f = { style: c, styleLocation: _ }; + f = { style: m, styleLocation: _ }; } - var g = this.tryParseArgumentClose(r); - if (g.err) - return g; - var m = H(r, this.clonePosition()); + var b = this.tryParseArgumentClose(r); + if (b.err) + return b; + var g = H(r, this.clonePosition()); if (f && Fn(f == null ? void 0 : f.style, "::", 0)) { - var d = jo(f.style.slice(2)); + var d = Wo(f.style.slice(2)); if (o === "number") { var h = this.parseNumberSkeletonFromString(d, f.styleLocation); return h.err ? h : { - val: { type: I.number, value: i, location: m, style: h.val }, + val: { type: I.number, value: i, location: g, style: h.val }, err: null }; } else { if (d.length === 0) - return this.error(S.EXPECT_DATE_TIME_SKELETON, m); - var b = d; - this.locale && (b = Po(d, this.locale)); - var c = { - type: Se.dateTime, - pattern: b, + return this.error(S.EXPECT_DATE_TIME_SKELETON, g); + var c = d; + this.locale && (c = Lo(d, this.locale)); + var m = { + type: He.dateTime, + pattern: c, location: f.styleLocation, - parsedOptions: this.shouldParseSkeletons ? xo(b) : {} + parsedOptions: this.shouldParseSkeletons ? Bo(c) : {} }, y = o === "date" ? I.date : I.time; return { - val: { type: y, value: i, location: m, style: c }, + val: { type: y, value: i, location: g, style: m }, err: null }; } @@ -3562,7 +3562,7 @@ var Vo = ( val: { type: o === "number" ? I.number : o === "date" ? I.date : I.time, value: i, - location: m, + location: g, style: (s = f == null ? void 0 : f.style) !== null && s !== void 0 ? s : null }, err: null @@ -3575,7 +3575,7 @@ var Vo = ( if (this.bumpSpace(), !this.bumpIf(",")) return this.error(S.EXPECT_SELECT_ARGUMENT_OPTIONS, H(p, A({}, p))); this.bumpSpace(); - var B = this.parseIdentifierIfPossible(), T = 0; + var B = this.parseIdentifierIfPossible(), C = 0; if (o !== "select" && B.value === "offset") { if (!this.bumpIf(":")) return this.error(S.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, H(this.clonePosition(), this.clonePosition())); @@ -3583,21 +3583,21 @@ var Vo = ( var h = this.tryParseDecimalInteger(S.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, S.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE); if (h.err) return h; - this.bumpSpace(), B = this.parseIdentifierIfPossible(), T = h.val; + this.bumpSpace(), B = this.parseIdentifierIfPossible(), C = h.val; } var O = this.tryParsePluralOrSelectOptions(t, o, n, B); if (O.err) return O; - var g = this.tryParseArgumentClose(r); - if (g.err) - return g; - var C = H(r, this.clonePosition()); + var b = this.tryParseArgumentClose(r); + if (b.err) + return b; + var T = H(r, this.clonePosition()); return o === "select" ? { val: { type: I.select, value: i, options: zn(O.val), - location: C + location: T }, err: null } : { @@ -3605,9 +3605,9 @@ var Vo = ( type: I.plural, value: i, options: zn(O.val), - offset: T, + offset: C, pluralType: o === "plural" ? "cardinal" : "ordinal", - location: C + location: T }, err: null }; @@ -3655,16 +3655,16 @@ var Vo = ( }, e.prototype.parseNumberSkeletonFromString = function(t, n) { var i = []; try { - i = Ho(t); + i = To(t); } catch { return this.error(S.INVALID_NUMBER_SKELETON, n); } return { val: { - type: Se.number, + type: He.number, tokens: i, location: n, - parsedOptions: this.shouldParseSkeletons ? Co(i) : {} + parsedOptions: this.shouldParseSkeletons ? Oo(i) : {} }, err: null }; @@ -3673,9 +3673,9 @@ var Vo = ( if (f.length === 0) { var h = this.clonePosition(); if (n !== "select" && this.bumpIf("=")) { - var c = this.tryParseDecimalInteger(S.EXPECT_PLURAL_ARGUMENT_SELECTOR, S.INVALID_PLURAL_ARGUMENT_SELECTOR); - if (c.err) - return c; + var m = this.tryParseDecimalInteger(S.EXPECT_PLURAL_ARGUMENT_SELECTOR, S.INVALID_PLURAL_ARGUMENT_SELECTOR); + if (m.err) + return m; l = H(h, this.clonePosition()), f = this.message.slice(h.offset, this.offset()); } else break; @@ -3686,16 +3686,16 @@ var Vo = ( var _ = this.clonePosition(); if (!this.bumpIf("{")) return this.error(n === "select" ? S.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : S.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, H(this.clonePosition(), this.clonePosition())); - var g = this.parseMessage(t + 1, n, i); + var b = this.parseMessage(t + 1, n, i); + if (b.err) + return b; + var g = this.tryParseArgumentClose(_); if (g.err) return g; - var m = this.tryParseArgumentClose(_); - if (m.err) - return m; o.push([ f, { - value: g.val, + value: b.val, location: H(_, this.clonePosition()) } ]), a.add(f), this.bumpSpace(), s = this.parseIdentifierIfPossible(), f = s.value, l = s.location; @@ -3712,7 +3712,7 @@ var Vo = ( break; } var a = H(r, this.clonePosition()); - return s ? (u *= i, Fo(u) ? { val: u, err: null } : this.error(n, a)) : this.error(t, a); + return s ? (u *= i, Vo(u) ? { val: u, err: null } : this.error(n, a)) : this.error(t, a); }, e.prototype.offset = function() { return this.position.offset; }, e.prototype.isEOF = function() { @@ -3768,7 +3768,7 @@ var Vo = ( break; } }, e.prototype.bumpSpace = function() { - for (; !this.isEOF() && Mi(this.char()); ) + for (; !this.isEOF() && Li(this.char()); ) this.bump(); }, e.prototype.peek = function() { if (this.isEOF()) @@ -3778,97 +3778,97 @@ var Vo = ( }, e; }() ); -function en(e) { +function tn(e) { return e >= 97 && e <= 122 || e >= 65 && e <= 90; } -function qo(e) { - return en(e) || e === 47; +function Qo(e) { + return tn(e) || e === 47; } -function Wo(e) { +function Jo(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 Mi(e) { +function Li(e) { return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233; } -function Yo(e) { +function Ko(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 tn(e) { +function nn(e) { e.forEach(function(t) { if (delete t.location, Si(t) || Hi(t)) for (var n in t.options) - delete t.options[n].location, tn(t.options[n].value); + delete t.options[n].location, nn(t.options[n].value); else - Ei(t) && Bi(t.style) || (wi(t) || xi(t)) && Qt(t.style) ? delete t.style.location : Ai(t) && tn(t.children); + Ei(t) && Bi(t.style) || (wi(t) || xi(t)) && Jt(t.style) ? delete t.style.location : Ai(t) && nn(t.children); }); } -function Zo(e, t) { +function $o(e, t) { t === void 0 && (t = {}), t = A({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t); - var n = new Vo(e, t).parse(); + var n = new Zo(e, t).parse(); if (n.err) { var i = SyntaxError(S[n.err.kind]); throw i.location = n.err.location, i.originalMessage = n.err.message, i; } - return t != null && t.captureLocation || tn(n.val), n.val; + return t != null && t.captureLocation || nn(n.val), n.val; } -function Dt(e, t) { - var n = t && t.cache ? t.cache : ta, i = t && t.serializer ? t.serializer : ea, r = t && t.strategy ? t.strategy : Jo; +function Ut(e, t) { + var n = t && t.cache ? t.cache : sa, i = t && t.serializer ? t.serializer : ra, r = t && t.strategy ? t.strategy : ta; return r(e, { cache: n, serializer: i }); } -function Qo(e) { +function ea(e) { return e == null || typeof e == "number" || typeof e == "boolean"; } -function Li(e, t, n, i) { - var r = Qo(i) ? i : n(i), s = t.get(r); +function Mi(e, t, n, i) { + var r = ea(i) ? i : n(i), s = t.get(r); return typeof s > "u" && (s = e.call(this, i), t.set(r, s)), s; } function Ri(e, t, n) { var i = Array.prototype.slice.call(arguments, 3), r = n(i), s = t.get(r); return typeof s > "u" && (s = e.apply(this, i), t.set(r, s)), s; } -function hn(e, t, n, i, r) { +function cn(e, t, n, i, r) { return n.bind(t, e, i, r); } -function Jo(e, t) { - var n = e.length === 1 ? Li : Ri; - return hn(e, this, n, t.cache.create(), t.serializer); +function ta(e, t) { + var n = e.length === 1 ? Mi : Ri; + return cn(e, this, n, t.cache.create(), t.serializer); } -function Ko(e, t) { - return hn(e, this, Ri, t.cache.create(), t.serializer); +function na(e, t) { + return cn(e, this, Ri, t.cache.create(), t.serializer); } -function $o(e, t) { - return hn(e, this, Li, t.cache.create(), t.serializer); +function ia(e, t) { + return cn(e, this, Mi, t.cache.create(), t.serializer); } -var ea = function() { +var ra = function() { return JSON.stringify(arguments); }; -function cn() { +function mn() { this.cache = /* @__PURE__ */ Object.create(null); } -cn.prototype.get = function(e) { +mn.prototype.get = function(e) { return this.cache[e]; }; -cn.prototype.set = function(e, t) { +mn.prototype.set = function(e, t) { this.cache[e] = t; }; -var ta = { +var sa = { create: function() { - return new cn(); + return new mn(); } -}, Ut = { - variadic: Ko, - monadic: $o -}, He; +}, Gt = { + variadic: na, + monadic: ia +}, Ae; (function(e) { e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API"; -})(He || (He = {})); -var Et = ( +})(Ae || (Ae = {})); +var xt = ( /** @class */ function(e) { - yt(t, e); + wt(t, e); function t(n, i, r) { var s = e.call(this, n) || this; return s.code = i, s.originalMessage = r, s; @@ -3880,44 +3880,44 @@ var Et = ( ), Xn = ( /** @class */ function(e) { - yt(t, e); + wt(t, e); function t(n, i, r, s) { - return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(i, '". Options are "').concat(Object.keys(r).join('", "'), '"'), He.INVALID_VALUE, s) || this; + return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(i, '". Options are "').concat(Object.keys(r).join('", "'), '"'), Ae.INVALID_VALUE, s) || this; } return t; - }(Et) -), na = ( + }(xt) +), oa = ( /** @class */ function(e) { - yt(t, e); + wt(t, e); function t(n, i, r) { - return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(i), He.INVALID_VALUE, r) || this; + return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(i), Ae.INVALID_VALUE, r) || this; } return t; - }(Et) -), ia = ( + }(xt) +), aa = ( /** @class */ function(e) { - yt(t, e); + wt(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, '"'), He.MISSING_VALUE, i) || this; + return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(i, '"'), Ae.MISSING_VALUE, i) || this; } return t; - }(Et) + }(xt) ), U; (function(e) { e[e.literal = 0] = "literal", e[e.object = 1] = "object"; })(U || (U = {})); -function ra(e) { +function la(e) { return e.length < 2 ? e : e.reduce(function(t, n) { var i = t[t.length - 1]; return !i || i.type !== U.literal || n.type !== U.literal ? t.push(n) : i.value += n.value, t; }, []); } -function sa(e) { +function ua(e) { return typeof e == "function"; } -function ut(e, t, n, i, r, s, u) { +function ht(e, t, n, i, r, s, u) { if (e.length === 1 && kn(e[0])) return [ { @@ -3934,7 +3934,7 @@ function ut(e, t, n, i, r, s, u) { }); continue; } - if (Eo(l)) { + if (Ho(l)) { typeof s == "number" && o.push({ type: U.literal, value: n.getNumberFormat(t).format(s) @@ -3943,89 +3943,89 @@ function ut(e, t, n, i, r, s, u) { } var h = l.value; if (!(r && h in r)) - throw new ia(h, u); - var c = r[h]; - if (yo(l)) { - (!c || typeof c == "string" || typeof c == "number") && (c = typeof c == "string" || typeof c == "number" ? String(c) : ""), o.push({ - type: typeof c == "string" ? U.literal : U.object, - value: c + throw new aa(h, u); + var m = r[h]; + if (So(l)) { + (!m || typeof m == "string" || typeof m == "number") && (m = typeof m == "string" || typeof m == "number" ? String(m) : ""), o.push({ + type: typeof m == "string" ? U.literal : U.object, + value: m }); continue; } if (wi(l)) { - var _ = typeof l.style == "string" ? i.date[l.style] : Qt(l.style) ? l.style.parsedOptions : void 0; + var _ = typeof l.style == "string" ? i.date[l.style] : Jt(l.style) ? l.style.parsedOptions : void 0; o.push({ type: U.literal, - value: n.getDateTimeFormat(t, _).format(c) + value: n.getDateTimeFormat(t, _).format(m) }); continue; } if (xi(l)) { - var _ = typeof l.style == "string" ? i.time[l.style] : Qt(l.style) ? l.style.parsedOptions : i.time.medium; + var _ = typeof l.style == "string" ? i.time[l.style] : Jt(l.style) ? l.style.parsedOptions : i.time.medium; o.push({ type: U.literal, - value: n.getDateTimeFormat(t, _).format(c) + value: n.getDateTimeFormat(t, _).format(m) }); continue; } if (Ei(l)) { var _ = typeof l.style == "string" ? i.number[l.style] : Bi(l.style) ? l.style.parsedOptions : void 0; - _ && _.scale && (c = c * (_.scale || 1)), o.push({ + _ && _.scale && (m = m * (_.scale || 1)), o.push({ type: U.literal, - value: n.getNumberFormat(t, _).format(c) + value: n.getNumberFormat(t, _).format(m) }); continue; } if (Ai(l)) { - var g = l.children, m = l.value, d = r[m]; - if (!sa(d)) - throw new na(m, "function", u); - var b = ut(g, t, n, i, r, s), y = d(b.map(function(T) { - return T.value; + var b = l.children, g = l.value, d = r[g]; + if (!ua(d)) + throw new oa(g, "function", u); + var c = ht(b, t, n, i, r, s), y = d(c.map(function(C) { + return C.value; })); - Array.isArray(y) || (y = [y]), o.push.apply(o, y.map(function(T) { + Array.isArray(y) || (y = [y]), o.push.apply(o, y.map(function(C) { return { - type: typeof T == "string" ? U.literal : U.object, - value: T + type: typeof C == "string" ? U.literal : U.object, + value: C }; })); } if (Si(l)) { - var p = l.options[c] || l.options.other; + var p = l.options[m] || l.options.other; if (!p) - throw new Xn(l.value, c, Object.keys(l.options), u); - o.push.apply(o, ut(p.value, t, n, i, r)); + throw new Xn(l.value, m, Object.keys(l.options), u); + o.push.apply(o, ht(p.value, t, n, i, r)); continue; } if (Hi(l)) { - var p = l.options["=".concat(c)]; + var p = l.options["=".concat(m)]; if (!p) { if (!Intl.PluralRules) - throw new Et(`Intl.PluralRules is not available in this environment. + throw new xt(`Intl.PluralRules is not available in this environment. Try polyfilling it using "@formatjs/intl-pluralrules" -`, He.MISSING_INTL_API, u); - var B = n.getPluralRules(t, { type: l.pluralType }).select(c - (l.offset || 0)); +`, Ae.MISSING_INTL_API, u); + var B = n.getPluralRules(t, { type: l.pluralType }).select(m - (l.offset || 0)); p = l.options[B] || l.options.other; } if (!p) - throw new Xn(l.value, c, Object.keys(l.options), u); - o.push.apply(o, ut(p.value, t, n, i, r, c - (l.offset || 0))); + throw new Xn(l.value, m, Object.keys(l.options), u); + o.push.apply(o, ht(p.value, t, n, i, r, m - (l.offset || 0))); continue; } } - return ra(o); + return la(o); } -function oa(e, t) { +function fa(e, t) { return t ? A(A(A({}, e || {}), t || {}), Object.keys(e).reduce(function(n, i) { return n[i] = A(A({}, e[i]), t[i] || {}), n; }, {})) : e; } -function aa(e, t) { +function ha(e, t) { return t ? Object.keys(e).reduce(function(n, i) { - return n[i] = oa(e[i], t[i]), n; + return n[i] = fa(e[i], t[i]), n; }, A({}, e)) : e; } -function Gt(e) { +function Ft(e) { return { create: function() { return { @@ -4039,39 +4039,39 @@ function Gt(e) { } }; } -function la(e) { +function ca(e) { return e === void 0 && (e = { number: {}, dateTime: {}, pluralRules: {} }), { - getNumberFormat: Dt(function() { + getNumberFormat: Ut(function() { for (var t, n = [], i = 0; i < arguments.length; i++) n[i] = arguments[i]; - return new ((t = Intl.NumberFormat).bind.apply(t, Rt([void 0], n, !1)))(); + return new ((t = Intl.NumberFormat).bind.apply(t, kt([void 0], n, !1)))(); }, { - cache: Gt(e.number), - strategy: Ut.variadic + cache: Ft(e.number), + strategy: Gt.variadic }), - getDateTimeFormat: Dt(function() { + getDateTimeFormat: Ut(function() { for (var t, n = [], i = 0; i < arguments.length; i++) n[i] = arguments[i]; - return new ((t = Intl.DateTimeFormat).bind.apply(t, Rt([void 0], n, !1)))(); + return new ((t = Intl.DateTimeFormat).bind.apply(t, kt([void 0], n, !1)))(); }, { - cache: Gt(e.dateTime), - strategy: Ut.variadic + cache: Ft(e.dateTime), + strategy: Gt.variadic }), - getPluralRules: Dt(function() { + getPluralRules: Ut(function() { for (var t, n = [], i = 0; i < arguments.length; i++) n[i] = arguments[i]; - return new ((t = Intl.PluralRules).bind.apply(t, Rt([void 0], n, !1)))(); + return new ((t = Intl.PluralRules).bind.apply(t, kt([void 0], n, !1)))(); }, { - cache: Gt(e.pluralRules), - strategy: Ut.variadic + cache: Ft(e.pluralRules), + strategy: Gt.variadic }) }; } -var ua = ( +var ma = ( /** @class */ function() { function e(t, n, i, r) { @@ -4089,7 +4089,7 @@ var ua = ( }, []); return a.length <= 1 ? a[0] || "" : a; }, this.formatToParts = function(u) { - return ut(s.ast, s.locales, s.formatters, s.formats, u, void 0, s.message); + return ht(s.ast, s.locales, s.formatters, s.formats, u, void 0, s.message); }, this.resolvedOptions = function() { return { locale: s.resolvedLocale.toString() @@ -4107,7 +4107,7 @@ var ua = ( this.ast = t; if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); - this.formats = aa(e.formats, i), this.formatters = r && r.formatters || la(this.formatterCache); + this.formats = ha(e.formats, i), this.formatters = r && r.formatters || ca(this.formatterCache); } return Object.defineProperty(e, "defaultLocale", { get: function() { @@ -4118,7 +4118,7 @@ var ua = ( }), 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 = Zo, e.formats = { + }, e.__parse = $o, e.formats = { number: { integer: { maximumFractionDigits: 0 @@ -4179,7 +4179,7 @@ var ua = ( }, e; }() ); -function fa(e, t) { +function _a(e, t) { if (t == null) return; if (t in e) @@ -4200,92 +4200,92 @@ function fa(e, t) { i = void 0; return i; } -const se = {}, ha = (e, t, n) => n && (t in se || (se[t] = {}), e in se[t] || (se[t][e] = n), n), ki = (e, t) => { +const se = {}, da = (e, t, n) => n && (t in se || (se[t] = {}), e in se[t] || (se[t][e] = n), n), ki = (e, t) => { if (t == null) return; if (t in se && e in se[t]) return se[t][e]; - const n = wt(t); + const n = St(t); for (let i = 0; i < n.length; i++) { - const r = n[i], s = ma(r, e); + const r = n[i], s = ga(r, e); if (s) - return ha(e, t, s); + return da(e, t, s); } }; -let mn; -const We = pt({}); -function ca(e) { - return mn[e] || null; +let _n; +const We = yt({}); +function ba(e) { + return _n[e] || null; } function Di(e) { - return e in mn; + return e in _n; } -function ma(e, t) { +function ga(e, t) { if (!Di(e)) return null; - const n = ca(e); - return fa(n, t); + const n = ba(e); + return _a(n, t); } -function _a(e) { +function pa(e) { if (e == null) return; - const t = wt(e); + const t = St(e); for (let n = 0; n < t.length; n++) { const i = t[n]; if (Di(i)) return i; } } -function da(e, ...t) { - delete se[e], We.update((n) => (n[e] = vo.all([n[e] || {}, ...t]), n)); +function va(e, ...t) { + delete se[e], We.update((n) => (n[e] = xo.all([n[e] || {}, ...t]), n)); } -Be( +Ce( [We], ([e]) => Object.keys(e) ); -We.subscribe((e) => mn = e); -const ft = {}; -function ba(e, t) { - ft[e].delete(t), ft[e].size === 0 && delete ft[e]; +We.subscribe((e) => _n = e); +const ct = {}; +function ya(e, t) { + ct[e].delete(t), ct[e].size === 0 && delete ct[e]; } function Ui(e) { - return ft[e]; + return ct[e]; } -function ga(e) { - return wt(e).map((t) => { +function Ea(e) { + return St(e).map((t) => { const n = Ui(t); return [t, n ? [...n] : []]; }).filter(([, t]) => t.length > 0); } -function nn(e) { - return e == null ? !1 : wt(e).some( +function rn(e) { + return e == null ? !1 : St(e).some( (t) => { var n; return (n = Ui(t)) == null ? void 0 : n.size; } ); } -function pa(e, t) { +function wa(e, t) { return Promise.all( - t.map((i) => (ba(e, i), i().then((r) => r.default || r))) - ).then((i) => da(e, ...i)); + t.map((i) => (ya(e, i), i().then((r) => r.default || r))) + ).then((i) => va(e, ...i)); } const Ne = {}; function Gi(e) { - if (!nn(e)) + if (!rn(e)) return e in Ne ? Ne[e] : Promise.resolve(); - const t = ga(e); + const t = Ea(e); return Ne[e] = Promise.all( t.map( - ([n, i]) => pa(n, i) + ([n, i]) => wa(n, i) ) ).then(() => { - if (nn(e)) + if (rn(e)) return Gi(e); delete Ne[e]; }), Ne[e]; } -const va = { +const xa = { number: { scientific: { notation: "scientific" }, engineering: { notation: "engineering" }, @@ -4314,100 +4314,100 @@ const va = { timeZoneName: "short" } } -}, ya = { +}, Sa = { fallbackLocale: null, loadingDelay: 200, - formats: va, + formats: xa, warnOnMissingMessages: !0, handleMissingMessage: void 0, ignoreTag: !0 -}, Ea = ya; -function Ae() { - return Ea; +}, Ha = Sa; +function Be() { + return Ha; } -const Ft = pt(!1); -var wa = Object.defineProperty, xa = Object.defineProperties, Sa = Object.getOwnPropertyDescriptors, Vn = Object.getOwnPropertySymbols, Ha = Object.prototype.hasOwnProperty, Aa = Object.prototype.propertyIsEnumerable, qn = (e, t, n) => t in e ? wa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ba = (e, t) => { +const zt = yt(!1); +var Aa = Object.defineProperty, Ba = Object.defineProperties, Ca = Object.getOwnPropertyDescriptors, Vn = Object.getOwnPropertySymbols, Ta = Object.prototype.hasOwnProperty, Pa = Object.prototype.propertyIsEnumerable, qn = (e, t, n) => t in e ? Aa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ia = (e, t) => { for (var n in t || (t = {})) - Ha.call(t, n) && qn(e, n, t[n]); + Ta.call(t, n) && qn(e, n, t[n]); if (Vn) for (var n of Vn(t)) - Aa.call(t, n) && qn(e, n, t[n]); + Pa.call(t, n) && qn(e, n, t[n]); return e; -}, Ta = (e, t) => xa(e, Sa(t)); -let rn; -const dt = pt(null); +}, Na = (e, t) => Ba(e, Ca(t)); +let sn; +const gt = yt(null); function Wn(e) { return e.split("-").map((t, n, i) => i.slice(0, n + 1).join("-")).reverse(); } -function wt(e, t = Ae().fallbackLocale) { +function St(e, t = Be().fallbackLocale) { const n = Wn(e); return t ? [.../* @__PURE__ */ new Set([...n, ...Wn(t)])] : n; } function ue() { - return rn ?? void 0; + return sn ?? void 0; } -dt.subscribe((e) => { - rn = e ?? void 0, typeof window < "u" && e != null && document.documentElement.setAttribute("lang", e); +gt.subscribe((e) => { + sn = e ?? void 0, typeof window < "u" && e != null && document.documentElement.setAttribute("lang", e); }); -const Ca = (e) => { - if (e && _a(e) && nn(e)) { - const { loadingDelay: t } = Ae(); +const Oa = (e) => { + if (e && pa(e) && rn(e)) { + const { loadingDelay: t } = Be(); let n; return typeof window < "u" && ue() != null && t ? n = window.setTimeout( - () => Ft.set(!0), + () => zt.set(!0), t - ) : Ft.set(!0), Gi(e).then(() => { - dt.set(e); + ) : zt.set(!0), Gi(e).then(() => { + gt.set(e); }).finally(() => { - clearTimeout(n), Ft.set(!1); + clearTimeout(n), zt.set(!1); }); } - return dt.set(e); -}, Ye = Ta(Ba({}, dt), { - set: Ca -}), xt = (e) => { + return gt.set(e); +}, Ye = Na(Ia({}, gt), { + set: Oa +}), Ht = (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 Pa = Object.defineProperty, bt = Object.getOwnPropertySymbols, Fi = Object.prototype.hasOwnProperty, zi = Object.prototype.propertyIsEnumerable, Yn = (e, t, n) => t in e ? Pa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, _n = (e, t) => { +var La = Object.defineProperty, pt = Object.getOwnPropertySymbols, Fi = Object.prototype.hasOwnProperty, zi = Object.prototype.propertyIsEnumerable, Yn = (e, t, n) => t in e ? La(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, dn = (e, t) => { for (var n in t || (t = {})) Fi.call(t, n) && Yn(e, n, t[n]); - if (bt) - for (var n of bt(t)) + if (pt) + for (var n of pt(t)) zi.call(t, n) && Yn(e, n, t[n]); return e; }, Te = (e, t) => { var n = {}; for (var i in e) Fi.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]); - if (e != null && bt) - for (var i of bt(e)) + if (e != null && pt) + for (var i of pt(e)) t.indexOf(i) < 0 && zi.call(e, i) && (n[i] = e[i]); return n; }; const je = (e, t) => { - const { formats: n } = Ae(); + const { formats: n } = Be(); if (e in n && t in n[e]) return n[e][t]; throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`); -}, Ia = xt( +}, Ma = Ht( (e) => { var t = e, { locale: n, format: i } = t, r = Te(t, ["locale", "format"]); if (n == null) throw new Error('[svelte-i18n] A "locale" must be set to format numbers'); return i && (r = je("number", i)), new Intl.NumberFormat(n, r); } -), Na = xt( +), Ra = Ht( (e) => { var t = e, { locale: n, format: i } = t, r = Te(t, ["locale", "format"]); if (n == null) throw new Error('[svelte-i18n] A "locale" must be set to format dates'); return i ? r = je("date", i) : Object.keys(r).length === 0 && (r = je("date", "short")), new Intl.DateTimeFormat(n, r); } -), Oa = xt( +), ka = Ht( (e) => { var t = e, { locale: n, format: i } = t, r = Te(t, ["locale", "format"]); if (n == null) @@ -4416,33 +4416,33 @@ const je = (e, t) => { ); return i ? r = je("time", i) : Object.keys(r).length === 0 && (r = je("time", "short")), new Intl.DateTimeFormat(n, r); } -), Ma = (e = {}) => { +), Da = (e = {}) => { var t = e, { locale: n = ue() } = t, i = Te(t, [ "locale" ]); - return Ia(_n({ locale: n }, i)); -}, La = (e = {}) => { + return Ma(dn({ locale: n }, i)); +}, Ua = (e = {}) => { var t = e, { locale: n = ue() } = t, i = Te(t, [ "locale" ]); - return Na(_n({ locale: n }, i)); -}, Ra = (e = {}) => { + return Ra(dn({ locale: n }, i)); +}, Ga = (e = {}) => { var t = e, { locale: n = ue() } = t, i = Te(t, [ "locale" ]); - return Oa(_n({ locale: n }, i)); -}, ka = xt( + return ka(dn({ locale: n }, i)); +}, Fa = Ht( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - (e, t = ue()) => new ua(e, t, Ae().formats, { - ignoreTag: Ae().ignoreTag + (e, t = ue()) => new ma(e, t, Be().formats, { + ignoreTag: Be().ignoreTag }) -), Da = (e, t = {}) => { +), za = (e, t = {}) => { var n, i, r, s; let u = t; typeof e == "object" && (u = e, e = u.id); @@ -4457,7 +4457,7 @@ const je = (e, t) => { ); let l = ki(e, a); if (!l) - l = (s = (r = (i = (n = Ae()).handleMissingMessage) == null ? void 0 : i.call(n, { locale: a, id: e, defaultValue: f })) != null ? r : f) != null ? s : e; + l = (s = (r = (i = (n = Be()).handleMissingMessage) == null ? void 0 : i.call(n, { locale: a, id: e, defaultValue: f })) != null ? r : f) != null ? s : e; else if (typeof l != "string") return console.warn( `[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof l}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.` @@ -4466,48 +4466,48 @@ const je = (e, t) => { return l; let h = l; try { - h = ka(l, a).format(o); - } catch (c) { - c instanceof Error && console.warn( + h = Fa(l, a).format(o); + } catch (m) { + m instanceof Error && console.warn( `[svelte-i18n] Message "${e}" has syntax error:`, - c.message + m.message ); } return h; -}, Ua = (e, t) => Ra(t).format(e), Ga = (e, t) => La(t).format(e), Fa = (e, t) => Ma(t).format(e), za = (e, t = ue()) => ki(e, t); -Be([Ye, We], () => Da); -Be([Ye], () => Ua); -Be([Ye], () => Ga); -Be([Ye], () => Fa); -Be([Ye, We], () => za); +}, ja = (e, t) => Ga(t).format(e), Xa = (e, t) => Ua(t).format(e), Va = (e, t) => Da(t).format(e), qa = (e, t = ue()) => ki(e, t); +Ce([Ye, We], () => za); +Ce([Ye], () => ja); +Ce([Ye], () => Xa); +Ce([Ye], () => Va); +Ce([Ye, We], () => qa); const { - SvelteComponent: ja, + SvelteComponent: Wa, add_render_callback: ji, - append: Je, + append: $e, attr: j, binding_callbacks: Zn, - check_outros: Xa, + check_outros: Ya, create_bidirectional_transition: Qn, - destroy_each: Va, + destroy_each: Za, detach: Re, - element: gt, - empty: qa, + element: vt, + empty: Qa, ensure_array_like: Jn, - group_outros: Wa, - init: Ya, + group_outros: Ja, + init: Ka, insert: ke, - listen: sn, - prevent_default: Za, - run_all: Qa, - safe_not_equal: Ja, - set_data: Ka, - set_style: me, - space: on, - text: $a, + listen: on, + prevent_default: $a, + run_all: el, + safe_not_equal: tl, + set_data: nl, + set_style: _e, + space: an, + text: il, toggle_class: Q, - transition_in: zt, + transition_in: jt, transition_out: Kn -} = window.__gradio__svelte__internal, { createEventDispatcher: el } = window.__gradio__svelte__internal; +} = window.__gradio__svelte__internal, { createEventDispatcher: rl } = window.__gradio__svelte__internal; function $n(e, t, n) { const i = e.slice(); return i[24] = t[n], i; @@ -4521,16 +4521,16 @@ function ei(e) { o[a] = ti($n(e, u, a)); return { c() { - t = gt("ul"); + t = vt("ul"); for (let a = 0; a < o.length; a += 1) o[a].c(); - j(t, "class", "options svelte-yuohum"), j(t, "role", "listbox"), me( + j(t, "class", "options svelte-yuohum"), j(t, "role", "listbox"), _e( t, "bottom", /*bottom*/ e[9] - ), me(t, "max-height", `calc(${/*max_height*/ - e[10]}px - var(--window-padding))`), me( + ), _e(t, "max-height", `calc(${/*max_height*/ + e[10]}px - var(--window-padding))`), _e( t, "width", /*input_width*/ @@ -4541,7 +4541,7 @@ function ei(e) { ke(a, t, f); for (let l = 0; l < o.length; l += 1) o[l] && o[l].m(t, null); - e[20](t), i = !0, r || (s = sn(t, "mousedown", Za( + e[20](t), i = !0, r || (s = on(t, "mousedown", $a( /*mousedown_handler*/ e[19] )), r = !0); @@ -4563,15 +4563,15 @@ function ei(e) { o.length = u.length; } f & /*bottom*/ - 512 && me( + 512 && _e( t, "bottom", /*bottom*/ a[9] ), f & /*max_height*/ - 1024 && me(t, "max-height", `calc(${/*max_height*/ + 1024 && _e(t, "max-height", `calc(${/*max_height*/ a[10]}px - var(--window-padding))`), f & /*input_width*/ - 256 && me( + 256 && _e( t, "width", /*input_width*/ @@ -4587,7 +4587,7 @@ function ei(e) { a && (n || (n = Qn(t, Nn, { duration: 200, y: 5 }, !1)), n.run(0)), i = !1; }, d(a) { - a && Re(t), Va(o, a), e[20](null), a && n && n.end(), r = !1, s(); + a && Re(t), Za(o, a), e[20](null), a && n && n.end(), r = !1, s(); } }; } @@ -4601,7 +4601,7 @@ function ti(e) { ), s, u, o, a, f; return { c() { - t = gt("li"), n = gt("span"), n.textContent = "✓", i = on(), s = $a(r), u = on(), j(n, "class", "inner-item svelte-yuohum"), Q(n, "hide", !/*selected_indices*/ + t = vt("li"), n = vt("span"), n.textContent = "✓", i = an(), s = il(r), u = an(), j(n, "class", "inner-item svelte-yuohum"), Q(n, "hide", !/*selected_indices*/ e[4].includes( /*index*/ e[24] @@ -4643,7 +4643,7 @@ function ti(e) { ); }, m(l, h) { - ke(l, t, h), Je(t, n), Je(t, i), Je(t, s), Je(t, u); + ke(l, t, h), $e(t, n), $e(t, i), $e(t, s), $e(t, u); }, p(l, h) { h & /*selected_indices, filtered_indices*/ @@ -4656,7 +4656,7 @@ function ti(e) { l[0][ /*index*/ l[24] - ][0] + "") && Ka(s, r), h & /*filtered_indices*/ + ][0] + "") && nl(s, r), h & /*filtered_indices*/ 2 && o !== (o = /*index*/ l[24]) && j(t, "data-index", o), h & /*choices, filtered_indices*/ 3 && a !== (a = /*choices*/ @@ -4705,7 +4705,7 @@ function ti(e) { } }; } -function tl(e) { +function sl(e) { let t, n, i, r, s; ji( /*onwindowresize*/ @@ -4718,17 +4718,17 @@ function tl(e) { ); return { c() { - t = gt("div"), n = on(), u && u.c(), i = qa(), j(t, "class", "reference"); + t = vt("div"), n = an(), u && u.c(), i = Qa(), j(t, "class", "reference"); }, m(o, a) { ke(o, t, a), e[18](t), ke(o, n, a), u && u.m(o, a), ke(o, i, a), r || (s = [ - sn( + on( window, "scroll", /*scroll_listener*/ e[12] ), - sn( + on( window, "resize", /*onwindowresize*/ @@ -4740,22 +4740,22 @@ function tl(e) { /*show_options*/ o[2] && !/*disabled*/ o[3] ? u ? (u.p(o, a), a & /*show_options, disabled*/ - 12 && zt(u, 1)) : (u = ei(o), u.c(), zt(u, 1), u.m(i.parentNode, i)) : u && (Wa(), Kn(u, 1, 1, () => { + 12 && jt(u, 1)) : (u = ei(o), u.c(), jt(u, 1), u.m(i.parentNode, i)) : u && (Ja(), Kn(u, 1, 1, () => { u = null; - }), Xa()); + }), Ya()); }, i(o) { - zt(u); + jt(u); }, o(o) { Kn(u); }, d(o) { - o && (Re(t), Re(n), Re(i)), e[18](null), u && u.d(o), r = !1, Qa(s); + o && (Re(t), Re(n), Re(i)), e[18](null), u && u.d(o), r = !1, el(s); } }; } -function Ke(e) { +function et(e) { let t, n = e[0], i = 1; for (; i < e.length; ) { const r = e[i], s = e[i + 1]; @@ -4765,11 +4765,11 @@ function Ke(e) { } return n; } -function nl(e, t, n) { - let { choices: i } = t, { filtered_indices: r } = t, { show_options: s = !1 } = t, { disabled: u = !1 } = t, { selected_indices: o = [] } = t, { active_index: a = null } = t, f, l, h, c, _, g, m, d, b; +function ol(e, t, n) { + let { choices: i } = t, { filtered_indices: r } = t, { show_options: s = !1 } = t, { disabled: u = !1 } = t, { selected_indices: o = [] } = t, { active_index: a = null } = t, f, l, h, m, _, b, g, d, c; function y() { - const { top: x, bottom: L } = _.getBoundingClientRect(); - n(14, f = x), n(15, l = b - L); + const { top: x, bottom: M } = _.getBoundingClientRect(); + n(14, f = x), n(15, l = c - M); } let p = null; function B() { @@ -4780,19 +4780,19 @@ function nl(e, t, n) { 10 )); } - const T = el(); + const C = rl(); function O() { - n(11, b = window.innerHeight); + n(11, c = window.innerHeight); } - function C(x) { + function T(x) { Zn[x ? "unshift" : "push"](() => { _ = x, n(6, _); }); } - const w = (x) => T("change", x); + const E = (x) => C("change", x); function k(x) { Zn[x ? "unshift" : "push"](() => { - g = x, n(7, g); + b = x, n(7, b); }); } return e.$$set = (x) => { @@ -4801,12 +4801,12 @@ function nl(e, t, n) { if (e.$$.dirty & /*show_options, refElement, listElement, selected_indices, distance_from_bottom, distance_from_top, input_height*/ 114900) { if (s && _) { - if (g && o.length > 0) { - let L = g.querySelectorAll("li"); - for (const W of Array.from(L)) + if (b && o.length > 0) { + let M = b.querySelectorAll("li"); + for (const W of Array.from(M)) if (W.getAttribute("data-index") === o[0].toString()) { - Ke([ - g, + et([ + b, "optionalAccess", (ee) => ee.scrollTo, "optionalCall", @@ -4816,18 +4816,18 @@ function nl(e, t, n) { } } y(); - const x = Ke([ + const x = et([ _, "access", - (L) => L.parentElement, + (M) => M.parentElement, "optionalAccess", - (L) => L.getBoundingClientRect, + (M) => M.getBoundingClientRect, "call", - (L) => L() + (M) => M() ]); - n(16, h = Ke([x, "optionalAccess", (L) => L.height]) || 0), n(8, c = Ke([x, "optionalAccess", (L) => L.width]) || 0); + n(16, h = et([x, "optionalAccess", (M) => M.height]) || 0), n(8, m = et([x, "optionalAccess", (M) => M.width]) || 0); } - l > f ? (n(10, d = l), n(9, m = null)) : (n(9, m = `${l + h}px`), n(10, d = f - h)); + l > f ? (n(10, d = l), n(9, g = null)) : (n(9, g = `${l + h}px`), n(10, d = f - h)); } }, [ i, @@ -4837,25 +4837,25 @@ function nl(e, t, n) { o, a, _, - g, - c, + b, m, + g, d, - b, + c, B, - T, + C, f, l, h, O, - C, - w, + T, + E, k ]; } -class il extends ja { +class al extends Wa { constructor(t) { - super(), Ya(this, t, nl, tl, Ja, { + super(), Ka(this, t, ol, sl, tl, { choices: 0, filtered_indices: 1, show_options: 2, @@ -4865,16 +4865,16 @@ class il extends ja { }); } } -function rl(e, t) { +function ll(e, t) { return (e % t + t) % t; } function ni(e, t) { return e.reduce((n, i, r) => ((!t || i[0].toLowerCase().includes(t.toLowerCase())) && n.push(r), n), []); } -function sl(e, t, n) { +function ul(e, t, n) { e("change", t), n || e("input"); } -function ol(e, t, n) { +function fl(e, t, n) { if (e.key === "Escape") return [!1, t]; if ((e.key === "ArrowDown" || e.key === "ArrowUp") && n.length >= 0) @@ -4882,82 +4882,82 @@ function ol(e, t, n) { t = e.key === "ArrowDown" ? n[0] : n[n.length - 1]; else { const i = n.indexOf(t), r = e.key === "ArrowUp" ? -1 : 1; - t = n[rl(i + r, n.length)]; + t = n[ll(i + r, n.length)]; } return [!0, t]; } const { - SvelteComponent: al, + SvelteComponent: hl, append: oe, attr: z, - binding_callbacks: ll, - check_outros: ul, - create_component: an, - destroy_component: ln, - detach: dn, - element: de, - group_outros: fl, - init: hl, - insert: bn, + binding_callbacks: cl, + check_outros: ml, + create_component: ln, + destroy_component: un, + detach: bn, + element: be, + group_outros: _l, + init: dl, + insert: gn, listen: Oe, - mount_component: un, - run_all: cl, - safe_not_equal: ml, - set_data: _l, + mount_component: fn, + run_all: bl, + safe_not_equal: gl, + set_data: pl, set_input_value: ii, - space: jt, - text: dl, - toggle_class: _e, - transition_in: be, - transition_out: Le -} = window.__gradio__svelte__internal, { onMount: bl } = window.__gradio__svelte__internal, { createEventDispatcher: gl, afterUpdate: pl } = window.__gradio__svelte__internal; -function vl(e) { + space: Xt, + text: vl, + toggle_class: de, + transition_in: ge, + transition_out: Me +} = window.__gradio__svelte__internal, { onMount: yl } = window.__gradio__svelte__internal, { createEventDispatcher: El, afterUpdate: wl } = window.__gradio__svelte__internal; +function xl(e) { let t; return { c() { - t = dl( + t = vl( /*label*/ e[0] ); }, m(n, i) { - bn(n, t, i); + gn(n, t, i); }, p(n, i) { i[0] & /*label*/ - 1 && _l( + 1 && pl( t, /*label*/ n[0] ); }, d(n) { - n && dn(t); + n && bn(t); } }; } function ri(e) { let t, n, i; - return n = new Er({}), { + return n = new Hr({}), { c() { - t = de("div"), an(n.$$.fragment), z(t, "class", "icon-wrap svelte-1m1zvyj"); + t = be("div"), ln(n.$$.fragment), z(t, "class", "icon-wrap svelte-1m1zvyj"); }, m(r, s) { - bn(r, t, s), un(n, t, null), i = !0; + gn(r, t, s), fn(n, t, null), i = !0; }, i(r) { - i || (be(n.$$.fragment, r), i = !0); + i || (ge(n.$$.fragment, r), i = !0); }, o(r) { - Le(n.$$.fragment, r), i = !1; + Me(n.$$.fragment, r), i = !1; }, d(r) { - r && dn(t), ln(n); + r && bn(t), un(n); } }; } -function yl(e) { - let t, n, i, r, s, u, o, a, f, l, h, c, _, g; +function Sl(e) { + let t, n, i, r, s, u, o, a, f, l, h, m, _, b; n = new hi({ props: { show_label: ( @@ -4968,13 +4968,13 @@ function yl(e) { /*info*/ e[1] ), - $$slots: { default: [vl] }, + $$slots: { default: [xl] }, $$scope: { ctx: e } } }); - let m = !/*disabled*/ + let g = !/*disabled*/ e[3] && ri(); - return h = new il({ + return h = new al({ props: { show_options: ( /*show_options*/ @@ -5010,7 +5010,7 @@ function yl(e) { e[16] ), { c() { - t = de("div"), an(n.$$.fragment), i = jt(), r = de("div"), s = de("div"), u = de("div"), o = de("input"), f = jt(), m && m.c(), l = jt(), an(h.$$.fragment), z(o, "role", "listbox"), z(o, "aria-controls", "dropdown-options"), z( + t = be("div"), ln(n.$$.fragment), i = Xt(), r = be("div"), s = be("div"), u = be("div"), o = be("input"), f = Xt(), g && g.c(), l = Xt(), ln(h.$$.fragment), z(o, "role", "listbox"), z(o, "aria-controls", "dropdown-options"), z( o, "aria-expanded", /*show_options*/ @@ -5022,29 +5022,29 @@ function yl(e) { e[0] ), z(o, "class", "border-none svelte-1m1zvyj"), o.disabled = /*disabled*/ e[3], z(o, "autocomplete", "off"), o.readOnly = a = !/*filterable*/ - e[7], _e(o, "subdued", !/*choices_names*/ + e[7], de(o, "subdued", !/*choices_names*/ e[13].includes( /*input_text*/ e[9] ) && !/*allow_custom_value*/ - e[6]), z(u, "class", "secondary-wrap svelte-1m1zvyj"), z(s, "class", "wrap-inner svelte-1m1zvyj"), _e( + e[6]), z(u, "class", "secondary-wrap svelte-1m1zvyj"), z(s, "class", "wrap-inner svelte-1m1zvyj"), de( s, "show_options", /*show_options*/ e[12] - ), z(r, "class", "wrap svelte-1m1zvyj"), z(t, "class", "svelte-1m1zvyj"), _e( + ), z(r, "class", "wrap svelte-1m1zvyj"), z(t, "class", "svelte-1m1zvyj"), de( t, "container", /*container*/ e[5] ); }, - m(d, b) { - bn(d, t, b), un(n, t, null), oe(t, i), oe(t, r), oe(r, s), oe(s, u), oe(u, o), ii( + m(d, c) { + gn(d, t, c), fn(n, t, null), oe(t, i), oe(t, r), oe(r, s), oe(s, u), oe(u, o), ii( o, /*input_text*/ e[9] - ), e[29](o), oe(u, f), m && m.m(u, null), oe(r, l), un(h, r, null), c = !0, _ || (g = [ + ), e[29](o), oe(u, f), g && g.m(u, null), oe(r, l), fn(h, r, null), m = !0, _ || (b = [ Oe( o, "input", @@ -5077,71 +5077,71 @@ function yl(e) { ) ], _ = !0); }, - p(d, b) { + p(d, c) { const y = {}; - b[0] & /*show_label*/ + c[0] & /*show_label*/ 16 && (y.show_label = /*show_label*/ - d[4]), b[0] & /*info*/ + d[4]), c[0] & /*info*/ 2 && (y.info = /*info*/ - d[1]), b[0] & /*label*/ - 1 | b[1] & /*$$scope*/ - 4 && (y.$$scope = { dirty: b, ctx: d }), n.$set(y), (!c || b[0] & /*show_options*/ + d[1]), c[0] & /*label*/ + 1 | c[1] & /*$$scope*/ + 4 && (y.$$scope = { dirty: c, ctx: d }), n.$set(y), (!m || c[0] & /*show_options*/ 4096) && z( o, "aria-expanded", /*show_options*/ d[12] - ), (!c || b[0] & /*label*/ + ), (!m || c[0] & /*label*/ 1) && z( o, "aria-label", /*label*/ d[0] - ), (!c || b[0] & /*disabled*/ + ), (!m || c[0] & /*disabled*/ 8) && (o.disabled = /*disabled*/ - d[3]), (!c || b[0] & /*filterable*/ + d[3]), (!m || c[0] & /*filterable*/ 128 && a !== (a = !/*filterable*/ - d[7])) && (o.readOnly = a), b[0] & /*input_text*/ + d[7])) && (o.readOnly = a), c[0] & /*input_text*/ 512 && o.value !== /*input_text*/ d[9] && ii( o, /*input_text*/ d[9] - ), (!c || b[0] & /*choices_names, input_text, allow_custom_value*/ - 8768) && _e(o, "subdued", !/*choices_names*/ + ), (!m || c[0] & /*choices_names, input_text, allow_custom_value*/ + 8768) && de(o, "subdued", !/*choices_names*/ d[13].includes( /*input_text*/ d[9] ) && !/*allow_custom_value*/ d[6]), /*disabled*/ - d[3] ? m && (fl(), Le(m, 1, 1, () => { - m = null; - }), ul()) : m ? b[0] & /*disabled*/ - 8 && be(m, 1) : (m = ri(), m.c(), be(m, 1), m.m(u, null)), (!c || b[0] & /*show_options*/ - 4096) && _e( + d[3] ? g && (_l(), Me(g, 1, 1, () => { + g = null; + }), ml()) : g ? c[0] & /*disabled*/ + 8 && ge(g, 1) : (g = ri(), g.c(), ge(g, 1), g.m(u, null)), (!m || c[0] & /*show_options*/ + 4096) && de( s, "show_options", /*show_options*/ d[12] ); const p = {}; - b[0] & /*show_options*/ + c[0] & /*show_options*/ 4096 && (p.show_options = /*show_options*/ - d[12]), b[0] & /*choices*/ + d[12]), c[0] & /*choices*/ 4 && (p.choices = /*choices*/ - d[2]), b[0] & /*filtered_indices*/ + d[2]), c[0] & /*filtered_indices*/ 1024 && (p.filtered_indices = /*filtered_indices*/ - d[10]), b[0] & /*disabled*/ + d[10]), c[0] & /*disabled*/ 8 && (p.disabled = /*disabled*/ - d[3]), b[0] & /*selected_index*/ + d[3]), c[0] & /*selected_index*/ 2048 && (p.selected_indices = /*selected_index*/ d[11] === null ? [] : [ /*selected_index*/ d[11] - ]), b[0] & /*active_index*/ + ]), c[0] & /*active_index*/ 16384 && (p.active_index = /*active_index*/ - d[14]), h.$set(p), (!c || b[0] & /*container*/ - 32) && _e( + d[14]), h.$set(p), (!m || c[0] & /*container*/ + 32) && de( t, "container", /*container*/ @@ -5149,111 +5149,111 @@ function yl(e) { ); }, i(d) { - c || (be(n.$$.fragment, d), be(m), be(h.$$.fragment, d), c = !0); + m || (ge(n.$$.fragment, d), ge(g), ge(h.$$.fragment, d), m = !0); }, o(d) { - Le(n.$$.fragment, d), Le(m), Le(h.$$.fragment, d), c = !1; + Me(n.$$.fragment, d), Me(g), Me(h.$$.fragment, d), m = !1; }, d(d) { - d && dn(t), ln(n), e[29](null), m && m.d(), ln(h), _ = !1, cl(g); + d && bn(t), un(n), e[29](null), g && g.d(), un(h), _ = !1, bl(b); } }; } -function El(e, t, n) { - let { label: i } = t, { info: r = void 0 } = t, { value: s = [] } = t, u = [], { value_is_output: o = !1 } = t, { choices: a } = t, f, { disabled: l = !1 } = t, { show_label: h } = t, { container: c = !0 } = t, { allow_custom_value: _ = !1 } = t, { filterable: g = !0 } = t, m, d = !1, b, y, p = "", B = "", T = !1, O = [], C = null, w = null, k; - const x = gl(); - s ? (k = a.map((E) => E[1]).indexOf(s), w = k, w === -1 ? (u = s, w = null) : ([p, u] = a[w], B = p), W()) : a.length > 0 && (k = 0, w = 0, [p, s] = a[w], u = s, B = p); - function L() { - n(13, b = a.map((E) => E[0])), n(24, y = a.map((E) => E[1])); +function Hl(e, t, n) { + let { label: i } = t, { info: r = void 0 } = t, { value: s = [] } = t, u = [], { value_is_output: o = !1 } = t, { choices: a } = t, f, { disabled: l = !1 } = t, { show_label: h } = t, { container: m = !0 } = t, { allow_custom_value: _ = !1 } = t, { filterable: b = !0 } = t, g, d = !1, c, y, p = "", B = "", C = !1, O = [], T = null, E = null, k; + const x = El(); + s ? (k = a.map((w) => w[1]).indexOf(s), E = k, E === -1 ? (u = s, E = null) : ([p, u] = a[E], B = p), W()) : a.length > 0 && (k = 0, E = 0, [p, s] = a[E], u = s, B = p); + function M() { + n(13, c = a.map((w) => w[0])), n(24, y = a.map((w) => w[1])); } function W() { - L(), s === void 0 || Array.isArray(s) && s.length === 0 ? (n(9, p = ""), n(11, w = null)) : y.includes(s) ? (n(9, p = b[y.indexOf(s)]), n(11, w = y.indexOf(s))) : _ ? (n(9, p = s), n(11, w = null)) : (n(9, p = ""), n(11, w = null)), n(27, k = w); + M(), s === void 0 || Array.isArray(s) && s.length === 0 ? (n(9, p = ""), n(11, E = null)) : y.includes(s) ? (n(9, p = c[y.indexOf(s)]), n(11, E = y.indexOf(s))) : _ ? (n(9, p = s), n(11, E = null)) : (n(9, p = ""), n(11, E = null)), n(27, k = E); } - function ee(E) { - if (n(11, w = parseInt(E.detail.target.dataset.index)), isNaN(w)) { - n(11, w = null); + function ee(w) { + if (n(11, E = parseInt(w.detail.target.dataset.index)), isNaN(E)) { + n(11, E = null); return; } - n(12, d = !1), n(14, C = null), m.blur(); + n(12, d = !1), n(14, T = null), g.blur(); } - function St(E) { - n(10, O = a.map((vn, Bt) => Bt)), n(12, d = !0), x("focus"); + function At(w) { + n(10, O = a.map((yn, Ze) => Ze)), n(12, d = !0), x("focus"); } - function Ce() { - _ ? n(20, s = p) : n(9, p = b[y.indexOf(s)]), n(12, d = !1), n(14, C = null), x("blur"); + function Pe() { + _ ? n(20, s = p) : n(9, p = c[y.indexOf(s)]), n(12, d = !1), n(14, T = null), x("blur"); } - function Ht(E) { - n(12, [d, C] = ol(E, C, O), d, (n(14, C), n(2, a), n(23, f), n(6, _), n(9, p), n(10, O), n(8, m), n(25, B), n(11, w), n(27, k), n(26, T), n(24, y))), E.key === "Enter" && (C !== null ? (n(11, w = C), n(12, d = !1), m.blur(), n(14, C = null)) : b.includes(p) ? (n(11, w = b.indexOf(p)), n(12, d = !1), n(14, C = null), m.blur()) : _ && (n(20, s = p), n(11, w = null), n(12, d = !1), n(14, C = null), m.blur()), x("enter", s)); + function Bt(w) { + n(12, [d, T] = fl(w, T, O), d, (n(14, T), n(2, a), n(23, f), n(6, _), n(9, p), n(10, O), n(8, g), n(25, B), n(11, E), n(27, k), n(26, C), n(24, y))), w.key === "Enter" && (T !== null ? (n(11, E = T), n(12, d = !1), g.blur(), n(14, T = null)) : c.includes(p) ? (n(11, E = c.indexOf(p)), n(12, d = !1), n(14, T = null), g.blur()) : _ && (n(20, s = p), n(11, E = null), n(12, d = !1), n(14, T = null), g.blur()), x("enter", s)); } - pl(() => { - n(21, o = !1), n(26, T = !0); - }), bl(() => { - m.focus(); + wl(() => { + n(21, o = !1), n(26, C = !0); + }), yl(() => { + g.focus(); }); - function At() { - p = this.value, n(9, p), n(11, w), n(27, k), n(26, T), n(2, a), n(24, y); + function Ct() { + p = this.value, n(9, p), n(11, E), n(27, k), n(26, C), n(2, a), n(24, y); } - function Pe(E) { - ll[E ? "unshift" : "push"](() => { - m = E, n(8, m); + function Ie(w) { + cl[w ? "unshift" : "push"](() => { + g = w, n(8, g); }); } - const Ie = (E) => x("key_up", { key: E.key, input_value: p }); - return e.$$set = (E) => { - "label" in E && n(0, i = E.label), "info" in E && n(1, r = E.info), "value" in E && n(20, s = E.value), "value_is_output" in E && n(21, o = E.value_is_output), "choices" in E && n(2, a = E.choices), "disabled" in E && n(3, l = E.disabled), "show_label" in E && n(4, h = E.show_label), "container" in E && n(5, c = E.container), "allow_custom_value" in E && n(6, _ = E.allow_custom_value), "filterable" in E && n(7, g = E.filterable); + const fe = (w) => x("key_up", { key: w.key, input_value: p }); + return e.$$set = (w) => { + "label" in w && n(0, i = w.label), "info" in w && n(1, r = w.info), "value" in w && n(20, s = w.value), "value_is_output" in w && n(21, o = w.value_is_output), "choices" in w && n(2, a = w.choices), "disabled" in w && n(3, l = w.disabled), "show_label" in w && n(4, h = w.show_label), "container" in w && n(5, m = w.container), "allow_custom_value" in w && n(6, _ = w.allow_custom_value), "filterable" in w && n(7, b = w.filterable); }, e.$$.update = () => { e.$$.dirty[0] & /*selected_index, old_selected_index, initialized, choices, choices_values*/ - 218105860 && w !== k && w !== null && T && (n(9, [p, s] = a[w], p, (n(20, s), n(11, w), n(27, k), n(26, T), n(2, a), n(24, y))), n(27, k = w), x("select", { - index: w, - value: y[w], + 218105860 && E !== k && E !== null && C && (n(9, [p, s] = a[E], p, (n(20, s), n(11, E), n(27, k), n(26, C), n(2, a), n(24, y))), n(27, k = E), x("select", { + index: E, + value: y[E], selected: !0 })), e.$$.dirty[0] & /*value, old_value, value_is_output*/ - 7340032 && s != u && (W(), sl(x, s, o), n(22, u = s)), e.$$.dirty[0] & /*choices*/ - 4 && L(), e.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/ - 8390468 && a !== f && (_ || W(), n(23, f = a), n(10, O = ni(a, p)), !_ && O.length > 0 && n(14, C = O[0]), m == document.activeElement && n(12, d = !0)), e.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/ - 33556036 && p !== B && (n(10, O = ni(a, p)), n(25, B = p), !_ && O.length > 0 && n(14, C = O[0])); + 7340032 && s != u && (W(), ul(x, s, o), n(22, u = s)), e.$$.dirty[0] & /*choices*/ + 4 && M(), e.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/ + 8390468 && a !== f && (_ || W(), n(23, f = a), n(10, O = ni(a, p)), !_ && O.length > 0 && n(14, T = O[0]), g == document.activeElement && n(12, d = !0)), e.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/ + 33556036 && p !== B && (n(10, O = ni(a, p)), n(25, B = p), !_ && O.length > 0 && n(14, T = O[0])); }, [ i, r, a, l, h, - c, + m, _, + b, g, - m, p, O, - w, + E, d, - b, - C, + c, + T, x, ee, - St, - Ce, - Ht, + At, + Pe, + Bt, s, o, u, f, y, B, - T, + C, k, - At, - Pe, - Ie + Ct, + Ie, + fe ]; } -class wl extends al { +class Al extends hl { constructor(t) { - super(), hl( + super(), dl( this, t, - El, - yl, - ml, + Hl, + Sl, + gl, { label: 0, info: 1, @@ -5272,57 +5272,57 @@ class wl extends al { } } const { - SvelteComponent: xl, + SvelteComponent: Bl, append: $, - attr: $e, - create_component: et, - destroy_component: tt, - detach: gn, + attr: tt, + create_component: nt, + destroy_component: it, + detach: pn, element: ae, - init: Sl, - insert: pn, - mount_component: nt, - safe_not_equal: Hl, - set_style: it, - space: Xt, + init: Cl, + insert: vn, + mount_component: rt, + safe_not_equal: Tl, + set_style: st, + space: Vt, text: Xi, - transition_in: rt, - transition_out: st -} = window.__gradio__svelte__internal, { createEventDispatcher: Al } = window.__gradio__svelte__internal, { onMount: Bl, onDestroy: Tl } = window.__gradio__svelte__internal; -function Cl(e) { + transition_in: ot, + transition_out: at +} = window.__gradio__svelte__internal, { createEventDispatcher: Pl } = window.__gradio__svelte__internal, { onMount: Il, onDestroy: Nl } = window.__gradio__svelte__internal; +function Ol(e) { let t; return { c() { t = Xi("Cancel"); }, m(n, i) { - pn(n, t, i); + vn(n, t, i); }, d(n) { - n && gn(t); + n && pn(t); } }; } -function Pl(e) { +function Ll(e) { let t; return { c() { t = Xi("OK"); }, m(n, i) { - pn(n, t, i); + vn(n, t, i); }, d(n) { - n && gn(t); + n && pn(t); } }; } -function Il(e) { - let t, n, i, r, s, u, o, a, f, l, h, c, _, g, m; - return s = new wl({ +function Ml(e) { + let t, n, i, r, s, u, o, a, f, l, h, m, _, b, g; + return s = new Al({ props: { value: ( - /*label*/ + /*currentLabel*/ e[0] ), label: "Label", @@ -5341,10 +5341,10 @@ function Il(e) { "enter", /*onDropDownEnter*/ e[6] - ), a = new ks({ + ), a = new Fs({ props: { value: ( - /*color*/ + /*currentColor*/ e[1] ), label: "Color", @@ -5354,119 +5354,127 @@ function Il(e) { "change", /*onColorChange*/ e[5] - ), h = new Ln({ + ), h = new Mn({ props: { - $$slots: { default: [Cl] }, + $$slots: { default: [Ol] }, $$scope: { ctx: e } } }), h.$on( "click", /*click_handler*/ - e[8] - ), g = new Ln({ + e[10] + ), b = new Mn({ props: { variant: "primary", - $$slots: { default: [Pl] }, + $$slots: { default: [Ll] }, $$scope: { ctx: e } } - }), g.$on( + }), b.$on( "click", /*click_handler_1*/ - e[9] + e[11] ), { c() { - t = ae("div"), n = ae("div"), i = ae("span"), r = ae("div"), et(s.$$.fragment), u = Xt(), o = ae("div"), et(a.$$.fragment), f = Xt(), l = ae("div"), et(h.$$.fragment), c = Xt(), _ = ae("div"), et(g.$$.fragment), it(r, "margin-right", "10px"), it(o, "margin-right", "40px"), it(o, "margin-bottom", "8px"), it(l, "margin-right", "8px"), $e(i, "class", "model-content svelte-hkn2q1"), $e(n, "class", "modal-container svelte-hkn2q1"), $e(t, "class", "modal svelte-hkn2q1"), $e(t, "id", "model-box-edit"); + t = ae("div"), n = ae("div"), i = ae("span"), r = ae("div"), nt(s.$$.fragment), u = Vt(), o = ae("div"), nt(a.$$.fragment), f = Vt(), l = ae("div"), nt(h.$$.fragment), m = Vt(), _ = ae("div"), nt(b.$$.fragment), st(r, "margin-right", "10px"), st(o, "margin-right", "40px"), st(o, "margin-bottom", "8px"), st(l, "margin-right", "8px"), tt(i, "class", "model-content svelte-hkn2q1"), tt(n, "class", "modal-container svelte-hkn2q1"), tt(t, "class", "modal svelte-hkn2q1"), tt(t, "id", "model-box-edit"); }, - m(d, b) { - pn(d, t, b), $(t, n), $(n, i), $(i, r), nt(s, r, null), $(i, u), $(i, o), nt(a, o, null), $(i, f), $(i, l), nt(h, l, null), $(i, c), $(i, _), nt(g, _, null), m = !0; + m(d, c) { + vn(d, t, c), $(t, n), $(n, i), $(i, r), rt(s, r, null), $(i, u), $(i, o), rt(a, o, null), $(i, f), $(i, l), rt(h, l, null), $(i, m), $(i, _), rt(b, _, null), g = !0; }, - p(d, [b]) { + p(d, [c]) { const y = {}; - b & /*label*/ - 1 && (y.value = /*label*/ - d[0]), b & /*choices*/ + c & /*currentLabel*/ + 1 && (y.value = /*currentLabel*/ + d[0]), c & /*choices*/ 4 && (y.choices = /*choices*/ d[2]), s.$set(y); const p = {}; - b & /*color*/ - 2 && (p.value = /*color*/ + c & /*currentColor*/ + 2 && (p.value = /*currentColor*/ d[1]), a.$set(p); const B = {}; - b & /*$$scope*/ - 4096 && (B.$$scope = { dirty: b, ctx: d }), h.$set(B); - const T = {}; - b & /*$$scope*/ - 4096 && (T.$$scope = { dirty: b, ctx: d }), g.$set(T); + c & /*$$scope*/ + 16384 && (B.$$scope = { dirty: c, ctx: d }), h.$set(B); + const C = {}; + c & /*$$scope*/ + 16384 && (C.$$scope = { dirty: c, ctx: d }), b.$set(C); }, i(d) { - m || (rt(s.$$.fragment, d), rt(a.$$.fragment, d), rt(h.$$.fragment, d), rt(g.$$.fragment, d), m = !0); + g || (ot(s.$$.fragment, d), ot(a.$$.fragment, d), ot(h.$$.fragment, d), ot(b.$$.fragment, d), g = !0); }, o(d) { - st(s.$$.fragment, d), st(a.$$.fragment, d), st(h.$$.fragment, d), st(g.$$.fragment, d), m = !1; + at(s.$$.fragment, d), at(a.$$.fragment, d), at(h.$$.fragment, d), at(b.$$.fragment, d), g = !1; }, d(d) { - d && gn(t), tt(s), tt(a), tt(h), tt(g); + d && pn(t), it(s), it(a), it(h), it(b); } }; } -function Nl(e, t, n) { - let { label: i = "" } = t, { choices: r = [] } = t, { choicesColors: s = [] } = t, { color: u = "" } = t; - const o = Al(); - function a(m) { - o("change", { label: i, color: u, ok: m }); +function Rl(e, t, n) { + let { label: i = "" } = t, { currentLabel: r = "" } = t, { choices: s = [] } = t, { choicesColors: u = [] } = t, { color: o = "" } = t, { currentColor: a = "" } = t; + const f = Pl(); + function l(c) { + f("change", { + label: r, + color: a, + ok: c + }); } - function f(m) { - const { detail: d } = m; - let b = d; - Number.isInteger(b) ? (Array.isArray(s) && b < s.length && n(1, u = s[b]), Array.isArray(r) && b < r.length && n(0, i = r[b][0])) : n(0, i = b); + function h(c) { + const { detail: y } = c; + let p = y; + Number.isInteger(p) ? (Array.isArray(u) && p < u.length && n(1, a = u[p]), Array.isArray(s) && p < s.length && n(0, r = s[p][0])) : n(0, r = p); } - function l(m) { - const { detail: d } = m; - n(1, u = d); + function m(c) { + const { detail: y } = c; + n(1, a = y); } - function h(m) { - f(m), a(!0); + function _(c) { + h(c), l(!0); } - function c(m) { - switch (m.key) { + function b(c) { + switch (c.key) { case "Enter": - a(!0); + l(!0); break; } } - Bl(() => { - document.addEventListener("keydown", c); - }), Tl(() => { - document.removeEventListener("keydown", c); + Il(() => { + document.addEventListener("keydown", b), n(0, r = i), n(1, a = o); + }), Nl(() => { + document.removeEventListener("keydown", b); }); - const _ = () => a(!1), g = () => a(!0); - return e.$$set = (m) => { - "label" in m && n(0, i = m.label), "choices" in m && n(2, r = m.choices), "choicesColors" in m && n(7, s = m.choicesColors), "color" in m && n(1, u = m.color); + const g = () => l(!1), d = () => l(!0); + return e.$$set = (c) => { + "label" in c && n(7, i = c.label), "currentLabel" in c && n(0, r = c.currentLabel), "choices" in c && n(2, s = c.choices), "choicesColors" in c && n(8, u = c.choicesColors), "color" in c && n(9, o = c.color), "currentColor" in c && n(1, a = c.currentColor); }, [ - i, - u, r, a, - f, + s, l, h, - s, + m, _, - g + i, + u, + o, + g, + d ]; } -class Vi extends xl { +class Vi extends Bl { constructor(t) { - super(), Sl(this, t, Nl, Il, Hl, { - label: 0, + super(), Cl(this, t, Rl, Ml, Tl, { + label: 7, + currentLabel: 0, choices: 2, - choicesColors: 7, - color: 1 + choicesColors: 8, + color: 9, + currentColor: 1 }); } } const J = (e, t, n) => Math.min(Math.max(e, t), n); -function Vt(e, t) { +function qt(e, t) { if (e.startsWith("rgba")) return e.replace(/[\d.]+$/, t.toString()); const n = e.match(/\d+/g); @@ -5475,19 +5483,19 @@ function Vt(e, t) { const [i, r, s] = n; return `rgba(${i}, ${r}, ${s}, ${t})`; } -class qt { - constructor(t, n, i, r, s, u, o, a, f, l, h = "rgb(255, 255, 255)", c = 0.5, _ = 25, g = 1) { +class Wt { + constructor(t, n, i, r, s, u, o, a, f, l, h = "rgb(255, 255, 255)", m = 0.5, _ = 25, b = 1) { this.stopDrag = () => { this.isDragging = !1, document.removeEventListener("mousemove", this.handleDrag), document.removeEventListener("mouseup", this.stopDrag); - }, this.handleDrag = (m) => { + }, this.handleDrag = (g) => { if (this.isDragging) { - let d = m.clientX - this.offsetMouseX - this.xmin, b = m.clientY - this.offsetMouseY - this.ymin; + let d = g.clientX - this.offsetMouseX - this.xmin, c = g.clientY - this.offsetMouseY - this.ymin; const y = this.canvasXmax - this.canvasXmin, p = this.canvasYmax - this.canvasYmin; - d = J(d, -this.xmin, y - this.xmax), b = J(b, -this.ymin, p - this.ymax), this.xmin += d, this.ymin += b, this.xmax += d, this.ymax += b, this.updateHandles(), this.renderCallBack(); + d = J(d, -this.xmin, y - this.xmax), c = J(c, -this.ymin, p - this.ymax), this.xmin += d, this.ymin += c, this.xmax += d, this.ymax += c, this.updateHandles(), this.renderCallBack(); } - }, this.handleResize = (m) => { + }, this.handleResize = (g) => { if (this.isResizing) { - const d = m.clientX, b = m.clientY, y = d - this.resizeHandles[this.resizingHandleIndex].xmin - this.offsetMouseX, p = b - this.resizeHandles[this.resizingHandleIndex].ymin - this.offsetMouseY, B = this.canvasXmax - this.canvasXmin, T = this.canvasYmax - this.canvasYmin; + const d = g.clientX, c = g.clientY, y = d - this.resizeHandles[this.resizingHandleIndex].xmin - this.offsetMouseX, p = c - this.resizeHandles[this.resizingHandleIndex].ymin - this.offsetMouseY, B = this.canvasXmax - this.canvasXmin, C = this.canvasYmax - this.canvasYmin; switch (this.resizingHandleIndex) { case 0: this.xmin += y, this.ymin += p, this.xmin = J(this.xmin, 0, this.xmax - this.minSize), this.ymin = J(this.ymin, 0, this.ymax - this.minSize); @@ -5496,17 +5504,17 @@ class qt { this.xmax += y, this.ymin += p, this.xmax = J(this.xmax, this.xmin + this.minSize, B), this.ymin = J(this.ymin, 0, this.ymax - this.minSize); break; case 2: - this.xmax += y, this.ymax += p, this.xmax = J(this.xmax, this.xmin + this.minSize, B), this.ymax = J(this.ymax, this.ymin + this.minSize, T); + this.xmax += y, this.ymax += p, this.xmax = J(this.xmax, this.xmin + this.minSize, B), this.ymax = J(this.ymax, this.ymin + this.minSize, C); break; case 3: - this.xmin += y, this.ymax += p, this.xmin = J(this.xmin, 0, this.xmax - this.minSize), this.ymax = J(this.ymax, this.ymin + this.minSize, T); + this.xmin += y, this.ymax += p, this.xmin = J(this.xmin, 0, this.xmax - this.minSize), this.ymax = J(this.ymax, this.ymin + this.minSize, C); break; } this.updateHandles(), this.renderCallBack(); } }, this.stopResize = () => { this.isResizing = !1, document.removeEventListener("mousemove", this.handleResize), document.removeEventListener("mouseup", this.stopResize); - }, this.renderCallBack = t, this.canvasXmin = n, this.canvasYmin = i, this.canvasXmax = r, this.canvasYmax = s, this.scaleFactor = g, this.label = u, this.isDragging = !1, [this.xmin, this.ymin] = this.toBoxCoordinates(o, a), [this.xmax, this.ymax] = this.toBoxCoordinates(f, l), this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = 8, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = _, this.color = h, this.alpha = c; + }, this.renderCallBack = t, this.canvasXmin = n, this.canvasYmin = i, this.canvasXmax = r, this.canvasYmax = s, this.scaleFactor = b, this.label = u, this.isDragging = !1, [this.xmin, this.ymin] = this.toBoxCoordinates(o, a), [this.xmax, this.ymax] = this.toBoxCoordinates(f, l), this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = 8, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = _, this.color = h, this.alpha = m; } toJSON() { return { @@ -5569,13 +5577,13 @@ class qt { } render(t) { let n, i; - if (t.beginPath(), [n, i] = this.toCanvasCoordinates(this.xmin, this.ymin), t.rect(n, i, this.getWidth(), this.getHeight()), t.fillStyle = Vt(this.color, this.alpha), t.fill(), this.isSelected ? t.lineWidth = 4 : t.lineWidth = 2, t.strokeStyle = Vt(this.color, 1), t.stroke(), t.closePath(), this.label !== null && this.label.trim() !== "") { + if (t.beginPath(), [n, i] = this.toCanvasCoordinates(this.xmin, this.ymin), t.rect(n, i, this.getWidth(), this.getHeight()), t.fillStyle = qt(this.color, this.alpha), t.fill(), this.isSelected ? t.lineWidth = 4 : t.lineWidth = 2, t.strokeStyle = qt(this.color, 1), t.stroke(), t.closePath(), this.label !== null && this.label.trim() !== "") { this.isSelected ? t.font = "bold 14px Arial" : t.font = "12px Arial"; const r = t.measureText(this.label).width + 10, s = 20; let u = this.xmin, o = this.ymin - s; t.fillStyle = "white", [u, o] = this.toCanvasCoordinates(u, o), t.fillRect(u, o, r, s), t.lineWidth = 1, t.strokeStyle = "black", t.strokeRect(u, o, r, s), t.fillStyle = "black", t.fillText(this.label, u + 5, o + 15); } - t.fillStyle = Vt(this.color, 1); + t.fillStyle = qt(this.color, 1); for (const r of this.resizeHandles) [n, i] = this.toCanvasCoordinates(r.xmin, r.ymin), t.fillRect( n, @@ -5619,37 +5627,37 @@ const K = [ "rgb(255, 250, 138)" ]; const { - SvelteComponent: Ol, - append: ge, + SvelteComponent: kl, + append: pe, attr: le, - binding_callbacks: Ml, + binding_callbacks: Dl, bubble: si, - check_outros: Wt, + check_outros: Yt, create_component: De, destroy_component: Ue, - detach: pe, - element: Ee, - empty: Ll, - group_outros: Yt, - init: Rl, - insert: ve, + detach: ve, + element: we, + empty: Ul, + group_outros: Zt, + init: Gl, + insert: ye, listen: re, mount_component: Ge, - noop: kl, + noop: Fl, run_all: qi, - safe_not_equal: Dl, + safe_not_equal: zl, space: Fe, transition_in: G, transition_out: q -} = window.__gradio__svelte__internal, { onMount: Ul, onDestroy: Gl, createEventDispatcher: Fl } = window.__gradio__svelte__internal; +} = window.__gradio__svelte__internal, { onMount: jl, onDestroy: Xl, createEventDispatcher: Vl } = window.__gradio__svelte__internal; function oi(e) { - let t, n, i, r, s, u, o, a, f, l, h, c; - return i = new Rr({}), u = new Cr({}), f = new mr({}), { + let t, n, i, r, s, u, o, a, f, l, h, m; + return i = new Gr({}), u = new Or({}), f = new gr({}), { c() { - t = Ee("span"), n = Ee("button"), De(i.$$.fragment), r = Fe(), s = Ee("button"), De(u.$$.fragment), o = Fe(), a = Ee("button"), De(f.$$.fragment), le(n, "class", "icon svelte-182gnnj"), le(s, "class", "icon svelte-182gnnj"), le(a, "class", "icon svelte-182gnnj"), le(t, "class", "canvas-control svelte-182gnnj"); + t = we("span"), n = we("button"), De(i.$$.fragment), r = Fe(), s = we("button"), De(u.$$.fragment), o = Fe(), a = we("button"), De(f.$$.fragment), le(n, "class", "icon svelte-182gnnj"), le(s, "class", "icon svelte-182gnnj"), le(a, "class", "icon svelte-182gnnj"), le(t, "class", "canvas-control svelte-182gnnj"); }, - m(_, g) { - ve(_, t, g), ge(t, n), Ge(i, n, null), ge(t, r), ge(t, s), Ge(u, s, null), ge(t, o), ge(t, a), Ge(f, a, null), l = !0, h || (c = [ + m(_, b) { + ye(_, t, b), pe(t, n), Ge(i, n, null), pe(t, r), pe(t, s), Ge(u, s, null), pe(t, o), pe(t, a), Ge(f, a, null), l = !0, h || (m = [ re( n, "click", @@ -5670,7 +5678,7 @@ function oi(e) { ) ], h = !0); }, - p: kl, + p: Fl, i(_) { l || (G(i.$$.fragment, _), G(u.$$.fragment, _), G(f.$$.fragment, _), l = !0); }, @@ -5678,7 +5686,7 @@ function oi(e) { q(i.$$.fragment, _), q(u.$$.fragment, _), q(f.$$.fragment, _), l = !1; }, d(_) { - _ && pe(t), Ue(i), Ue(u), Ue(f), h = !1, qi(c); + _ && ve(t), Ue(i), Ue(u), Ue(f), h = !1, qi(m); } }; } @@ -5842,23 +5850,23 @@ function li(e) { } }; } -function zl(e) { +function ql(e) { let t, n, i, r, s, u, o, a, f, l = ( /*interactive*/ e[1] && oi(e) ), h = ( /*editModalVisible*/ e[6] && ai(e) - ), c = ( + ), m = ( /*newModalVisible*/ e[7] && li(e) ); return { c() { - t = Ee("div"), n = Ee("canvas"), i = Fe(), l && l.c(), r = Fe(), h && h.c(), s = Fe(), c && c.c(), u = Ll(), le(n, "class", "canvas-annotator svelte-182gnnj"), le(t, "class", "canvas-container svelte-182gnnj"), le(t, "tabindex", "-1"); + t = we("div"), n = we("canvas"), i = Fe(), l && l.c(), r = Fe(), h && h.c(), s = Fe(), m && m.c(), u = Ul(), le(n, "class", "canvas-annotator svelte-182gnnj"), le(t, "class", "canvas-container svelte-182gnnj"), le(t, "tabindex", "-1"); }, - m(_, g) { - ve(_, t, g), ge(t, n), e[21](n), ve(_, i, g), l && l.m(_, g), ve(_, r, g), h && h.m(_, g), ve(_, s, g), c && c.m(_, g), ve(_, u, g), o = !0, a || (f = [ + m(_, b) { + ye(_, t, b), pe(t, n), e[21](n), ye(_, i, b), l && l.m(_, b), ye(_, r, b), h && h.m(_, b), ye(_, s, b), m && m.m(_, b), ye(_, u, b), o = !0, a || (f = [ re( n, "mousedown", @@ -5891,29 +5899,29 @@ function zl(e) { ) ], a = !0); }, - p(_, g) { + p(_, b) { /*interactive*/ - _[1] ? l ? (l.p(_, g), g[0] & /*interactive*/ - 2 && G(l, 1)) : (l = oi(_), l.c(), G(l, 1), l.m(r.parentNode, r)) : l && (Yt(), q(l, 1, 1, () => { + _[1] ? l ? (l.p(_, b), b[0] & /*interactive*/ + 2 && G(l, 1)) : (l = oi(_), l.c(), G(l, 1), l.m(r.parentNode, r)) : l && (Zt(), q(l, 1, 1, () => { l = null; - }), Wt()), /*editModalVisible*/ - _[6] ? h ? (h.p(_, g), g[0] & /*editModalVisible*/ - 64 && G(h, 1)) : (h = ai(_), h.c(), G(h, 1), h.m(s.parentNode, s)) : h && (Yt(), q(h, 1, 1, () => { + }), Yt()), /*editModalVisible*/ + _[6] ? h ? (h.p(_, b), b[0] & /*editModalVisible*/ + 64 && G(h, 1)) : (h = ai(_), h.c(), G(h, 1), h.m(s.parentNode, s)) : h && (Zt(), q(h, 1, 1, () => { h = null; - }), Wt()), /*newModalVisible*/ - _[7] ? c ? (c.p(_, g), g[0] & /*newModalVisible*/ - 128 && G(c, 1)) : (c = li(_), c.c(), G(c, 1), c.m(u.parentNode, u)) : c && (Yt(), q(c, 1, 1, () => { - c = null; - }), Wt()); + }), Yt()), /*newModalVisible*/ + _[7] ? m ? (m.p(_, b), b[0] & /*newModalVisible*/ + 128 && G(m, 1)) : (m = li(_), m.c(), G(m, 1), m.m(u.parentNode, u)) : m && (Zt(), q(m, 1, 1, () => { + m = null; + }), Yt()); }, i(_) { - o || (G(l), G(h), G(c), o = !0); + o || (G(l), G(h), G(m), o = !0); }, o(_) { - q(l), q(h), q(c), o = !1; + q(l), q(h), q(m), o = !1; }, d(_) { - _ && (pe(t), pe(i), pe(r), pe(s), pe(u)), e[21](null), l && l.d(_), h && h.d(_), c && c.d(_), a = !1, qi(f); + _ && (ve(t), ve(i), ve(r), ve(s), ve(u)), e[21](null), l && l.d(_), h && h.d(_), m && m.d(_), a = !1, qi(f); } }; } @@ -5925,12 +5933,12 @@ function Xe(e) { const t = e.match(/(\d+(\.\d+)?)/g), n = parseInt(t[0]), i = parseInt(t[1]), r = parseInt(t[2]); return "#" + (1 << 24 | n << 16 | i << 8 | r).toString(16).slice(1); } -function jl(e, t, n) { - let { imageUrl: i = null } = t, { interactive: r } = t, { boxAlpha: s = 0.5 } = t, { boxMinSize: u = 25 } = t, { value: o } = t, { choices: a = [] } = t, { choicesColors: f = [] } = t, l, h, c = null, _ = -1, g = 0, m = 0, d = 0, b = 0, y = 1, p = 0, B = 0, T = !1, O = !1; - const C = Fl(); - function w() { +function Wl(e, t, n) { + let { imageUrl: i = null } = t, { interactive: r } = t, { boxAlpha: s = 0.5 } = t, { boxMinSize: u = 25 } = t, { value: o } = t, { choices: a = [] } = t, { choicesColors: f = [] } = t, l, h, m = null, _ = -1, b = 0, g = 0, d = 0, c = 0, y = 1, p = 0, B = 0, C = !1, O = !1; + const T = Vl(); + function E() { if (h) { - h.clearRect(0, 0, l.width, l.height), c !== null && h.drawImage(c, g, m, p, B); + h.clearRect(0, 0, l.width, l.height), m !== null && h.drawImage(m, b, g, p, B); for (const v of o.boxes.slice().reverse()) v.render(h); } @@ -5938,135 +5946,138 @@ function jl(e, t, n) { function k(v) { n(5, _ = v), o.boxes.forEach((P) => { P.setSelected(!1); - }), v >= 0 && v < o.boxes.length && o.boxes[v].setSelected(!0), w(); + }), v >= 0 && v < o.boxes.length && o.boxes[v].setSelected(!0), E(); } function x(v) { if (!r) return; - const P = l.getBoundingClientRect(), R = v.clientX - P.left, M = v.clientY - P.top; + const P = l.getBoundingClientRect(), R = v.clientX - P.left, L = v.clientY - P.top; for (const [te, Y] of o.boxes.entries()) { - const yn = Y.indexOfPointInsideHandle(R, M); - if (yn >= 0) { - k(te), Y.startResize(yn, v); + const Qe = Y.indexOfPointInsideHandle(R, L); + if (Qe >= 0) { + k(te), Y.startResize(Qe, v); return; } } for (const [te, Y] of o.boxes.entries()) - if (Y.isPointInsideBox(R, M)) { + if (Y.isPointInsideBox(R, L)) { k(te), Y.startDrag(v); return; } k(-1); } - function L(v) { - C("change"); + function M(v) { + T("change"); } function W(v) { if (r) switch (v.key) { case "Delete": - Pe(); + Ie(); break; } } function ee() { n(7, O = !0); } - function St(v) { + function At(v) { n(7, O = !1); const { detail: P } = v; - let R = P.label, M = P.color; + let R = P.label, L = P.color; if (P.ok) { - M === null || M === "" ? M = K[o.boxes.length % K.length] : M = ui(M); - let Y = new qt(w, g, m, d, b, R, Math.round(l.width / 3), Math.round(l.height / 3), Math.round(2 * l.width / 3), Math.round(2 * l.height / 3), M, s, u, y); - n(0, o.boxes = [Y, ...o.boxes], o), w(), C("change"); + L === null || L === "" ? L = K[o.boxes.length % K.length] : L = ui(L); + let Y = b + (d - b) / 3, Qe = d - (d - b) / 3, tr = g + (c - g) / 3, nr = c - (c - g) / 3, ir = new Wt(E, b, g, d, c, R, Math.round(Y), Math.round(tr), Math.round(Qe), Math.round(nr), L, s, u, y); + n(0, o.boxes = [ir, ...o.boxes], o), E(), T("change"); } } - function Ce() { - _ >= 0 && _ < o.boxes.length && n(6, T = !0); + function Pe() { + _ >= 0 && _ < o.boxes.length && n(6, C = !0); } - function Ht(v) { - r && Ce(); + function Bt(v) { + r && Pe(); } - function At(v) { - n(6, T = !1); + function Ct(v) { + n(6, C = !1); const { detail: P } = v; - let R = P.label, M = P.color; + let R = P.label, L = P.color; if (P.ok && _ >= 0 && _ < o.boxes.length) { let Y = o.boxes[_]; - Y.label = R, Y.color = ui(M), w(), C("change"); + Y.label = R, Y.color = ui(L), E(), T("change"); } } - function Pe() { - _ >= 0 && _ < o.boxes.length && (o.boxes.splice(_, 1), k(-1), C("change")); - } function Ie() { + _ >= 0 && _ < o.boxes.length && (o.boxes.splice(_, 1), k(-1), T("change")); + } + function fe() { if (l) { - if (y = 1, n(4, l.width = l.clientWidth, l), c !== null) - if (c.width > l.width) - y = l.width / c.width, p = c.width * y, B = c.height * y, g = 0, m = 0, d = p, b = B, n(4, l.height = B, l); + if (y = 1, n(4, l.width = l.clientWidth, l), m !== null) + if (m.width > l.width) + y = l.width / m.width, p = m.width * y, B = m.height * y, b = 0, g = 0, d = p, c = B, n(4, l.height = B, l); else { - p = c.width, B = c.height; + p = m.width, B = m.height; var v = (l.width - p) / 2; - g = v, m = 0, d = v + p, b = c.height, n(4, l.height = B, l); + b = v, g = 0, d = v + p, c = m.height, n(4, l.height = B, l); } else - g = 0, m = 0, d = l.width, b = l.height, n(4, l.height = l.clientHeight, l); - if (d > 0 && b > 0) + b = 0, g = 0, d = l.width, c = l.height, n(4, l.height = l.clientHeight, l); + if (d > 0 && c > 0) for (const P of o.boxes) - P.canvasXmin = g, P.canvasYmin = m, P.canvasXmax = d, P.canvasYmax = b, P.setScaleFactor(y); - w(), C("change"); + P.canvasXmin = b, P.canvasYmin = g, P.canvasXmax = d, P.canvasYmax = c, P.setScaleFactor(y); + E(), T("change"); } } - const E = new ResizeObserver(Ie); - function vn() { + const w = new ResizeObserver(fe); + function yn() { let v = []; for (let P = 0; P < o.boxes.length; P++) { let R = o.boxes[P]; - if (!(R instanceof qt)) { - let M = "", te = ""; - R.hasOwnProperty("color") ? (M = R.color, Array.isArray(M) && M.length === 3 && (M = `rgb(${M[0]}, ${M[1]}, ${M[2]})`)) : M = K[v.length % K.length], R.hasOwnProperty("label") && (te = R.label), R = new qt(w, g, m, d, b, te, R.xmin, R.ymin, R.xmax, R.ymax, M, s, u, y); + if (!(R instanceof Wt)) { + let L = "", te = ""; + R.hasOwnProperty("color") ? (L = R.color, Array.isArray(L) && L.length === 3 && (L = `rgb(${L[0]}, ${L[1]}, ${L[2]})`)) : L = K[v.length % K.length], R.hasOwnProperty("label") && (te = R.label), R = new Wt(E, b, g, d, c, te, R.xmin, R.ymin, R.xmax, R.ymax, L, s, u, y); } v.push(R); } n(0, o.boxes = v, o); } - Ul(() => { + function Ze() { + i !== null && (m === null || m.src != i) && (m = new Image(), m.src = i, m.onload = function() { + fe(), E(); + }); + } + jl(() => { if (Array.isArray(a) && a.length > 0 && (!Array.isArray(f) || f.length == 0)) for (let v = 0; v < a.length; v++) { let P = K[v % K.length]; f.push(Xe(P)); } - h = l.getContext("2d"), E.observe(l), i !== null && (c = new Image(), c.src = i, c.onload = function() { - Ie(), w(); - }), Ie(), w(); + h = l.getContext("2d"), w.observe(l), Ze(), fe(), E(); }); - function Bt() { + function Wi() { document.addEventListener("keydown", W); } - function Wi() { + function Yi() { document.removeEventListener("keydown", W); } - Gl(() => { + Xl(() => { document.removeEventListener("keydown", W); }); - function Yi(v) { - Ml[v ? "unshift" : "push"](() => { + function Zi(v) { + Dl[v ? "unshift" : "push"](() => { l = v, n(4, l); }); } - const Zi = () => ee(), Qi = () => Ce(), Ji = () => Pe(); - function Ki(v) { + const Qi = () => ee(), Ji = () => Pe(), Ki = () => Ie(); + function $i(v) { si.call(this, e, v); } - function $i(v) { + function er(v) { si.call(this, e, v); } return e.$$set = (v) => { "imageUrl" in v && n(18, i = v.imageUrl), "interactive" in v && n(1, r = v.interactive), "boxAlpha" in v && n(19, s = v.boxAlpha), "boxMinSize" in v && n(20, u = v.boxMinSize), "value" in v && n(0, o = v.value), "choices" in v && n(2, a = v.choices), "choicesColors" in v && n(3, f = v.choicesColors); }, e.$$.update = () => { e.$$.dirty[0] & /*value*/ - 1 && vn(); + 1 && (Ze(), yn(), fe(), E()); }, [ o, r, @@ -6074,37 +6085,37 @@ function jl(e, t, n) { f, l, _, - T, + C, O, x, - L, + M, ee, - St, - Ce, - Ht, At, Pe, Bt, + Ct, + Ie, Wi, + Yi, i, s, u, - Yi, Zi, Qi, Ji, Ki, - $i + $i, + er ]; } -class Xl extends Ol { +class Yl extends kl { constructor(t) { - super(), Rl( + super(), Gl( this, t, - jl, + Wl, + ql, zl, - Dl, { imageUrl: 18, interactive: 1, @@ -6120,19 +6131,19 @@ class Xl extends Ol { } } const { - SvelteComponent: Vl, - add_flush_callback: ql, - bind: Wl, - binding_callbacks: Yl, - create_component: Zl, - destroy_component: Ql, - init: Jl, - mount_component: Kl, - safe_not_equal: $l, - transition_in: eu, - transition_out: tu -} = window.__gradio__svelte__internal, { createEventDispatcher: nu } = window.__gradio__svelte__internal; -function iu(e) { + SvelteComponent: Zl, + add_flush_callback: Ql, + bind: Jl, + binding_callbacks: Kl, + create_component: $l, + destroy_component: eu, + init: tu, + mount_component: nu, + safe_not_equal: iu, + transition_in: ru, + transition_out: su +} = window.__gradio__svelte__internal, { createEventDispatcher: ou } = window.__gradio__svelte__internal; +function au(e) { let t, n, i; function r(u) { e[10](u); @@ -6166,16 +6177,16 @@ function iu(e) { return ( /*value*/ e[0] !== void 0 && (s.value = /*value*/ - e[0]), t = new Xl({ props: s }), Yl.push(() => Wl(t, "value", r)), t.$on( + e[0]), t = new Yl({ props: s }), Kl.push(() => Jl(t, "value", r)), t.$on( "change", /*change_handler*/ e[11] ), { c() { - Zl(t.$$.fragment); + $l(t.$$.fragment); }, m(u, o) { - Kl(t, u, o), i = !0; + nu(t, u, o), i = !0; }, p(u, [o]) { const a = {}; @@ -6193,36 +6204,36 @@ function iu(e) { 64 && (a.imageUrl = /*resolved_src*/ u[6]), !n && o & /*value*/ 1 && (n = !0, a.value = /*value*/ - u[0], ql(() => n = !1)), t.$set(a); + u[0], Ql(() => n = !1)), t.$set(a); }, i(u) { - i || (eu(t.$$.fragment, u), i = !0); + i || (ru(t.$$.fragment, u), i = !0); }, o(u) { - tu(t.$$.fragment, u), i = !1; + su(t.$$.fragment, u), i = !1; }, d(u) { - Ql(t, u); + eu(t, u); } } ); } -function ru(e, t, n) { +function lu(e, t, n) { let { src: i = void 0 } = t, { interactive: r } = t, { boxesAlpha: s } = t, { labelList: u } = t, { labelColors: o } = t, { boxMinSize: a } = t, { value: f } = t, l, h; - const c = nu(); - function _(m) { - f = m, n(0, f); + const m = ou(); + function _(g) { + f = g, n(0, f); } - const g = () => c("change"); - return e.$$set = (m) => { - "src" in m && n(8, i = m.src), "interactive" in m && n(1, r = m.interactive), "boxesAlpha" in m && n(2, s = m.boxesAlpha), "labelList" in m && n(3, u = m.labelList), "labelColors" in m && n(4, o = m.labelColors), "boxMinSize" in m && n(5, a = m.boxMinSize), "value" in m && n(0, f = m.value); + const b = () => m("change"); + return e.$$set = (g) => { + "src" in g && n(8, i = g.src), "interactive" in g && n(1, r = g.interactive), "boxesAlpha" in g && n(2, s = g.boxesAlpha), "labelList" in g && n(3, u = g.labelList), "labelColors" in g && n(4, o = g.labelColors), "boxMinSize" in g && n(5, a = g.boxMinSize), "value" in g && n(0, f = g.value); }, e.$$.update = () => { if (e.$$.dirty & /*src, latest_src*/ 768) { n(6, l = i), n(9, h = i); - const m = i; - or(m).then((d) => { - h === m && n(6, l = d); + const g = i; + fr(g).then((d) => { + h === g && n(6, l = d); }); } }, [ @@ -6233,16 +6244,16 @@ function ru(e, t, n) { o, a, l, - c, + m, i, h, _, - g + b ]; } -class su extends Vl { +class uu extends Zl { constructor(t) { - super(), Jl(this, t, ru, iu, $l, { + super(), tu(this, t, lu, au, iu, { src: 8, interactive: 1, boxesAlpha: 2, @@ -6254,25 +6265,25 @@ class su extends Vl { } } const { - SvelteComponent: ou, - attr: au, - check_outros: lu, - create_component: uu, - destroy_component: fu, - detach: hu, - element: cu, - group_outros: mu, - init: _u, - insert: du, - mount_component: bu, - safe_not_equal: gu, + SvelteComponent: fu, + attr: hu, + check_outros: cu, + create_component: mu, + destroy_component: _u, + detach: du, + element: bu, + group_outros: gu, + init: pu, + insert: vu, + mount_component: yu, + safe_not_equal: Eu, toggle_class: ie, - transition_in: ht, - transition_out: fn + transition_in: mt, + transition_out: hn } = window.__gradio__svelte__internal; function fi(e) { let t, n; - return t = new su({ + return t = new uu({ props: { src: ( /*samples_dir*/ @@ -6283,10 +6294,10 @@ function fi(e) { } }), { c() { - uu(t.$$.fragment); + mu(t.$$.fragment); }, m(i, r) { - bu(t, i, r), n = !0; + yu(t, i, r), n = !0; }, p(i, r) { const s = {}; @@ -6296,24 +6307,24 @@ function fi(e) { i[0].path), t.$set(s); }, i(i) { - n || (ht(t.$$.fragment, i), n = !0); + n || (mt(t.$$.fragment, i), n = !0); }, o(i) { - fn(t.$$.fragment, i), n = !1; + hn(t.$$.fragment, i), n = !1; }, d(i) { - fu(t, i); + _u(t, i); } }; } -function pu(e) { +function wu(e) { let t, n, i = ( /*value*/ e[0] && fi(e) ); return { c() { - t = cu("div"), i && i.c(), au(t, "class", "container svelte-1sgcyba"), ie( + t = bu("div"), i && i.c(), hu(t, "class", "container svelte-1sgcyba"), ie( t, "table", /*type*/ @@ -6336,14 +6347,14 @@ function pu(e) { ); }, m(r, s) { - du(r, t, s), i && i.m(t, null), n = !0; + vu(r, t, s), i && i.m(t, null), n = !0; }, p(r, [s]) { /*value*/ r[0] ? i ? (i.p(r, s), s & /*value*/ - 1 && ht(i, 1)) : (i = fi(r), i.c(), ht(i, 1), i.m(t, null)) : i && (mu(), fn(i, 1, 1, () => { + 1 && mt(i, 1)) : (i = fi(r), i.c(), mt(i, 1), i.m(t, null)) : i && (gu(), hn(i, 1, 1, () => { i = null; - }), lu()), (!n || s & /*type*/ + }), cu()), (!n || s & /*type*/ 4) && ie( t, "table", @@ -6370,25 +6381,25 @@ function pu(e) { ); }, i(r) { - n || (ht(i), n = !0); + n || (mt(i), n = !0); }, o(r) { - fn(i), n = !1; + hn(i), n = !1; }, d(r) { - r && hu(t), i && i.d(); + r && du(t), i && i.d(); } }; } -function vu(e, t, n) { +function xu(e, t, n) { let { value: i } = t, { samples_dir: r } = t, { type: s } = t, { selected: u = !1 } = t; return e.$$set = (o) => { "value" in o && n(0, i = o.value), "samples_dir" in o && n(1, r = o.samples_dir), "type" in o && n(2, s = o.type), "selected" in o && n(3, u = o.selected); }, [i, r, s, u]; } -class Eu extends ou { +class Hu extends fu { constructor(t) { - super(), _u(this, t, vu, pu, gu, { + super(), pu(this, t, xu, wu, Eu, { value: 0, samples_dir: 1, type: 2, @@ -6397,5 +6408,5 @@ class Eu extends ou { } } export { - Eu as default + Hu as default };