diff --git "a/src/backend/gradio_videogallery/templates/component/index.js" "b/src/backend/gradio_videogallery/templates/component/index.js" --- "a/src/backend/gradio_videogallery/templates/component/index.js" +++ "b/src/backend/gradio_videogallery/templates/component/index.js" @@ -1,28 +1,28 @@ const { - SvelteComponent: Pr, - assign: Ir, - create_slot: kr, - detach: Lr, - element: Nr, - get_all_dirty_from_scope: Or, - get_slot_changes: Mr, - get_spread_update: Rr, - init: Dr, - insert: Ur, - safe_not_equal: Gr, - set_dynamic_element_data: Tn, - set_style: X, - toggle_class: de, - transition_in: Oi, - transition_out: Mi, - update_slot_base: Fr + SvelteComponent: Mr, + assign: Rr, + create_slot: Dr, + detach: Ur, + element: Gr, + get_all_dirty_from_scope: xr, + get_slot_changes: Fr, + get_spread_update: jr, + init: Vr, + insert: qr, + safe_not_equal: zr, + set_dynamic_element_data: Hn, + set_style: Q, + toggle_class: be, + transition_in: Ui, + transition_out: Gi, + update_slot_base: Xr } = window.__gradio__svelte__internal; -function xr(e) { +function Zr(e) { let t, n, i; const r = ( /*#slots*/ e[17].default - ), l = kr( + ), l = Dr( r, e, /*$$scope*/ @@ -44,82 +44,82 @@ function xr(e) { } ], a = {}; for (let s = 0; s < o.length; s += 1) - a = Ir(a, o[s]); + a = Rr(a, o[s]); return { c() { - t = Nr( + t = Gr( /*tag*/ e[14] - ), l && l.c(), Tn( + ), l && l.c(), Hn( /*tag*/ e[14] - )(t, a), de( + )(t, a), be( t, "hidden", /*visible*/ e[10] === !1 - ), de( + ), be( t, "padded", /*padding*/ e[6] - ), de( + ), be( t, "border_focus", /*border_mode*/ e[5] === "focus" - ), de(t, "hide-container", !/*explicit_call*/ + ), be(t, "hide-container", !/*explicit_call*/ e[8] && !/*container*/ - e[9]), X(t, "height", typeof /*height*/ + e[9]), Q(t, "height", typeof /*height*/ e[0] == "number" ? ( /*height*/ e[0] + "px" - ) : void 0), X(t, "width", typeof /*width*/ + ) : void 0), Q(t, "width", typeof /*width*/ e[1] == "number" ? `calc(min(${/*width*/ - e[1]}px, 100%))` : void 0), X( + e[1]}px, 100%))` : void 0), Q( t, "border-style", /*variant*/ e[4] - ), X( + ), Q( t, "overflow", /*allow_overflow*/ e[11] ? "visible" : "hidden" - ), X( + ), Q( t, "flex-grow", /*scale*/ e[12] - ), X(t, "min-width", `calc(min(${/*min_width*/ - e[13]}px, 100%))`), X(t, "border-width", "var(--block-border-width)"); + ), Q(t, "min-width", `calc(min(${/*min_width*/ + e[13]}px, 100%))`), Q(t, "border-width", "var(--block-border-width)"); }, m(s, u) { - Ur(s, t, u), l && l.m(t, null), i = !0; + qr(s, t, u), l && l.m(t, null), i = !0; }, p(s, u) { l && l.p && (!i || u & /*$$scope*/ - 65536) && Fr( + 65536) && Xr( l, r, s, /*$$scope*/ s[16], - i ? Mr( + i ? Fr( r, /*$$scope*/ s[16], u, null - ) : Or( + ) : xr( /*$$scope*/ s[16] ), null - ), Tn( + ), Hn( /*tag*/ s[14] - )(t, a = Rr(o, [ + )(t, a = jr(o, [ (!i || u & /*test_id*/ 128) && { "data-testid": ( /*test_id*/ @@ -133,68 +133,68 @@ function xr(e) { (!i || u & /*elem_classes*/ 8 && n !== (n = "block " + /*elem_classes*/ s[3].join(" ") + " svelte-1t38q2d")) && { class: n } - ])), de( + ])), be( t, "hidden", /*visible*/ s[10] === !1 - ), de( + ), be( t, "padded", /*padding*/ s[6] - ), de( + ), be( t, "border_focus", /*border_mode*/ s[5] === "focus" - ), de(t, "hide-container", !/*explicit_call*/ + ), be(t, "hide-container", !/*explicit_call*/ s[8] && !/*container*/ s[9]), u & /*height*/ - 1 && X(t, "height", typeof /*height*/ + 1 && Q(t, "height", typeof /*height*/ s[0] == "number" ? ( /*height*/ s[0] + "px" ) : void 0), u & /*width*/ - 2 && X(t, "width", typeof /*width*/ + 2 && Q(t, "width", typeof /*width*/ s[1] == "number" ? `calc(min(${/*width*/ s[1]}px, 100%))` : void 0), u & /*variant*/ - 16 && X( + 16 && Q( t, "border-style", /*variant*/ s[4] ), u & /*allow_overflow*/ - 2048 && X( + 2048 && Q( t, "overflow", /*allow_overflow*/ s[11] ? "visible" : "hidden" ), u & /*scale*/ - 4096 && X( + 4096 && Q( t, "flex-grow", /*scale*/ s[12] ), u & /*min_width*/ - 8192 && X(t, "min-width", `calc(min(${/*min_width*/ + 8192 && Q(t, "min-width", `calc(min(${/*min_width*/ s[13]}px, 100%))`); }, i(s) { - i || (Oi(l, s), i = !0); + i || (Ui(l, s), i = !0); }, o(s) { - Mi(l, s), i = !1; + Gi(l, s), i = !1; }, d(s) { - s && Lr(t), l && l.d(s); + s && Ur(t), l && l.d(s); } }; } -function jr(e) { +function Wr(e) { let t, n = ( /*tag*/ - e[14] && xr(e) + e[14] && Zr(e) ); return { c() { @@ -208,20 +208,20 @@ function jr(e) { i[14] && n.p(i, r); }, i(i) { - t || (Oi(n, i), t = !0); + t || (Ui(n, i), t = !0); }, o(i) { - Mi(n, i), t = !1; + Gi(n, i), t = !1; }, d(i) { n && n.d(i); } }; } -function Vr(e, t, n) { - let { $$slots: i = {}, $$scope: r } = t, { height: l = void 0 } = t, { width: o = void 0 } = t, { elem_id: a = "" } = t, { elem_classes: s = [] } = t, { variant: u = "solid" } = t, { border_mode: f = "base" } = t, { padding: c = !0 } = t, { type: h = "normal" } = t, { test_id: _ = void 0 } = t, { explicit_call: b = !1 } = t, { container: T = !0 } = t, { visible: y = !0 } = t, { allow_overflow: C = !0 } = t, { scale: E = null } = t, { min_width: m = 0 } = t, g = h === "fieldset" ? "fieldset" : "div"; - return e.$$set = (p) => { - "height" in p && n(0, l = p.height), "width" in p && n(1, o = p.width), "elem_id" in p && n(2, a = p.elem_id), "elem_classes" in p && n(3, s = p.elem_classes), "variant" in p && n(4, u = p.variant), "border_mode" in p && n(5, f = p.border_mode), "padding" in p && n(6, c = p.padding), "type" in p && n(15, h = p.type), "test_id" in p && n(7, _ = p.test_id), "explicit_call" in p && n(8, b = p.explicit_call), "container" in p && n(9, T = p.container), "visible" in p && n(10, y = p.visible), "allow_overflow" in p && n(11, C = p.allow_overflow), "scale" in p && n(12, E = p.scale), "min_width" in p && n(13, m = p.min_width), "$$scope" in p && n(16, r = p.$$scope); +function Qr(e, t, n) { + let { $$slots: i = {}, $$scope: r } = t, { height: l = void 0 } = t, { width: o = void 0 } = t, { elem_id: a = "" } = t, { elem_classes: s = [] } = t, { variant: u = "solid" } = t, { border_mode: f = "base" } = t, { padding: c = !0 } = t, { type: h = "normal" } = t, { test_id: _ = void 0 } = t, { explicit_call: g = !1 } = t, { container: S = !0 } = t, { visible: v = !0 } = t, { allow_overflow: A = !0 } = t, { scale: y = null } = t, { min_width: d = 0 } = t, T = h === "fieldset" ? "fieldset" : "div"; + return e.$$set = (b) => { + "height" in b && n(0, l = b.height), "width" in b && n(1, o = b.width), "elem_id" in b && n(2, a = b.elem_id), "elem_classes" in b && n(3, s = b.elem_classes), "variant" in b && n(4, u = b.variant), "border_mode" in b && n(5, f = b.border_mode), "padding" in b && n(6, c = b.padding), "type" in b && n(15, h = b.type), "test_id" in b && n(7, _ = b.test_id), "explicit_call" in b && n(8, g = b.explicit_call), "container" in b && n(9, S = b.container), "visible" in b && n(10, v = b.visible), "allow_overflow" in b && n(11, A = b.allow_overflow), "scale" in b && n(12, y = b.scale), "min_width" in b && n(13, d = b.min_width), "$$scope" in b && n(16, r = b.$$scope); }, [ l, o, @@ -231,21 +231,21 @@ function Vr(e, t, n) { f, c, _, - b, - T, - y, - C, - E, - m, g, + S, + v, + A, + y, + d, + T, h, r, i ]; } -class zr extends Pr { +class Jr extends Mr { constructor(t) { - super(), Dr(this, t, Vr, jr, Gr, { + super(), Vr(this, t, Qr, Wr, zr, { height: 0, width: 1, elem_id: 2, @@ -265,40 +265,40 @@ class zr extends Pr { } } const { - SvelteComponent: qr, + SvelteComponent: Yr, append: It, - attr: at, - create_component: Xr, - destroy_component: Zr, - detach: Wr, - element: An, - init: Qr, - insert: Jr, - mount_component: Yr, - safe_not_equal: Kr, - set_data: $r, - space: el, - text: tl, - toggle_class: be, - transition_in: nl, - transition_out: il + attr: ct, + create_component: Kr, + destroy_component: $r, + detach: el, + element: Bn, + init: tl, + insert: nl, + mount_component: il, + safe_not_equal: rl, + set_data: ll, + space: ol, + text: sl, + toggle_class: ge, + transition_in: al, + transition_out: ul } = window.__gradio__svelte__internal; -function rl(e) { +function fl(e) { let t, n, i, r, l, o; return i = new /*Icon*/ e[1]({}), { c() { - t = An("label"), n = An("span"), Xr(i.$$.fragment), r = el(), l = tl( + t = Bn("label"), n = Bn("span"), Kr(i.$$.fragment), r = ol(), l = sl( /*label*/ e[0] - ), at(n, "class", "svelte-9gxdi0"), at(t, "for", ""), at(t, "data-testid", "block-label"), at(t, "class", "svelte-9gxdi0"), be(t, "hide", !/*show_label*/ - e[2]), be(t, "sr-only", !/*show_label*/ - e[2]), be( + ), ct(n, "class", "svelte-9gxdi0"), ct(t, "for", ""), ct(t, "data-testid", "block-label"), ct(t, "class", "svelte-9gxdi0"), ge(t, "hide", !/*show_label*/ + e[2]), ge(t, "sr-only", !/*show_label*/ + e[2]), ge( t, "float", /*float*/ e[4] - ), be( + ), ge( t, "hide-label", /*disable*/ @@ -306,26 +306,26 @@ function rl(e) { ); }, m(a, s) { - Jr(a, t, s), It(t, n), Yr(i, n, null), It(t, r), It(t, l), o = !0; + nl(a, t, s), It(t, n), il(i, n, null), It(t, r), It(t, l), o = !0; }, p(a, [s]) { (!o || s & /*label*/ - 1) && $r( + 1) && ll( l, /*label*/ a[0] ), (!o || s & /*show_label*/ - 4) && be(t, "hide", !/*show_label*/ + 4) && ge(t, "hide", !/*show_label*/ a[2]), (!o || s & /*show_label*/ - 4) && be(t, "sr-only", !/*show_label*/ + 4) && ge(t, "sr-only", !/*show_label*/ a[2]), (!o || s & /*float*/ - 16) && be( + 16) && ge( t, "float", /*float*/ a[4] ), (!o || s & /*disable*/ - 8) && be( + 8) && ge( t, "hide-label", /*disable*/ @@ -333,25 +333,25 @@ function rl(e) { ); }, i(a) { - o || (nl(i.$$.fragment, a), o = !0); + o || (al(i.$$.fragment, a), o = !0); }, o(a) { - il(i.$$.fragment, a), o = !1; + ul(i.$$.fragment, a), o = !1; }, d(a) { - a && Wr(t), Zr(i); + a && el(t), $r(i); } }; } -function ll(e, t, n) { +function cl(e, t, n) { let { label: i = null } = t, { Icon: r } = t, { show_label: l = !0 } = t, { disable: o = !1 } = t, { float: a = !0 } = t; return e.$$set = (s) => { "label" in s && n(0, i = s.label), "Icon" in s && n(1, r = s.Icon), "show_label" in s && n(2, l = s.show_label), "disable" in s && n(3, o = s.disable), "float" in s && n(4, a = s.float); }, [i, r, l, o, a]; } -class ol extends qr { +class hl extends Yr { constructor(t) { - super(), Qr(this, t, ll, rl, Kr, { + super(), tl(this, t, cl, fl, rl, { label: 0, Icon: 1, show_label: 2, @@ -361,85 +361,85 @@ class ol extends qr { } } const { - SvelteComponent: sl, - append: Qt, - attr: Se, - bubble: al, - create_component: ul, - destroy_component: fl, - detach: Ri, - element: Jt, - init: cl, - insert: Di, - listen: hl, - mount_component: _l, - safe_not_equal: ml, - set_data: dl, - space: bl, - text: gl, - toggle_class: ge, - transition_in: pl, - transition_out: vl + SvelteComponent: _l, + append: Yt, + attr: Te, + bubble: ml, + create_component: dl, + destroy_component: bl, + detach: xi, + element: Kt, + init: gl, + insert: Fi, + listen: pl, + mount_component: vl, + safe_not_equal: wl, + set_data: yl, + space: El, + text: Sl, + toggle_class: pe, + transition_in: Tl, + transition_out: Al } = window.__gradio__svelte__internal; -function Hn(e) { +function kn(e) { let t, n; return { c() { - t = Jt("span"), n = gl( + t = Kt("span"), n = Sl( /*label*/ e[1] - ), Se(t, "class", "svelte-xtz2g8"); + ), Te(t, "class", "svelte-xtz2g8"); }, m(i, r) { - Di(i, t, r), Qt(t, n); + Fi(i, t, r), Yt(t, n); }, p(i, r) { r & /*label*/ - 2 && dl( + 2 && yl( n, /*label*/ i[1] ); }, d(i) { - i && Ri(t); + i && xi(t); } }; } -function wl(e) { +function Hl(e) { let t, n, i, r, l, o, a, s = ( /*show_label*/ - e[2] && Hn(e) + e[2] && kn(e) ); return r = new /*Icon*/ e[0]({}), { c() { - t = Jt("button"), s && s.c(), n = bl(), i = Jt("div"), ul(r.$$.fragment), Se(i, "class", "svelte-xtz2g8"), ge( + t = Kt("button"), s && s.c(), n = El(), i = Kt("div"), dl(r.$$.fragment), Te(i, "class", "svelte-xtz2g8"), pe( i, "small", /*size*/ e[4] === "small" - ), ge( + ), pe( i, "large", /*size*/ e[4] === "large" - ), Se( + ), Te( t, "aria-label", /*label*/ e[1] - ), Se( + ), Te( t, "title", /*label*/ e[1] - ), Se(t, "class", "svelte-xtz2g8"), ge( + ), Te(t, "class", "svelte-xtz2g8"), pe( t, "pending", /*pending*/ e[3] - ), ge( + ), pe( t, "padded", /*padded*/ @@ -447,7 +447,7 @@ function wl(e) { ); }, m(u, f) { - Di(u, t, f), s && s.m(t, null), Qt(t, n), Qt(t, i), _l(r, i, null), l = !0, o || (a = hl( + Fi(u, t, f), s && s.m(t, null), Yt(t, n), Yt(t, i), vl(r, i, null), l = !0, o || (a = pl( t, "click", /*click_handler*/ @@ -456,38 +456,38 @@ function wl(e) { }, p(u, [f]) { /*show_label*/ - u[2] ? s ? s.p(u, f) : (s = Hn(u), s.c(), s.m(t, n)) : s && (s.d(1), s = null), (!l || f & /*size*/ - 16) && ge( + u[2] ? s ? s.p(u, f) : (s = kn(u), s.c(), s.m(t, n)) : s && (s.d(1), s = null), (!l || f & /*size*/ + 16) && pe( i, "small", /*size*/ u[4] === "small" ), (!l || f & /*size*/ - 16) && ge( + 16) && pe( i, "large", /*size*/ u[4] === "large" ), (!l || f & /*label*/ - 2) && Se( + 2) && Te( t, "aria-label", /*label*/ u[1] ), (!l || f & /*label*/ - 2) && Se( + 2) && Te( t, "title", /*label*/ u[1] ), (!l || f & /*pending*/ - 8) && ge( + 8) && pe( t, "pending", /*pending*/ u[3] ), (!l || f & /*padded*/ - 32) && ge( + 32) && pe( t, "padded", /*padded*/ @@ -495,28 +495,28 @@ function wl(e) { ); }, i(u) { - l || (pl(r.$$.fragment, u), l = !0); + l || (Tl(r.$$.fragment, u), l = !0); }, o(u) { - vl(r.$$.fragment, u), l = !1; + Al(r.$$.fragment, u), l = !1; }, d(u) { - u && Ri(t), s && s.d(), fl(r), o = !1, a(); + u && xi(t), s && s.d(), bl(r), o = !1, a(); } }; } -function yl(e, t, n) { +function Bl(e, t, n) { let { Icon: i } = t, { label: r = "" } = t, { show_label: l = !1 } = t, { pending: o = !1 } = t, { size: a = "small" } = t, { padded: s = !0 } = t; function u(f) { - al.call(this, e, f); + ml.call(this, e, f); } return e.$$set = (f) => { "Icon" in f && n(0, i = f.Icon), "label" in f && n(1, r = f.label), "show_label" in f && n(2, l = f.show_label), "pending" in f && n(3, o = f.pending), "size" in f && n(4, a = f.size), "padded" in f && n(5, s = f.padded); }, [i, r, l, o, a, s, u]; } -class et extends sl { +class nt extends _l { constructor(t) { - super(), cl(this, t, yl, wl, ml, { + super(), gl(this, t, Bl, Hl, wl, { Icon: 0, label: 1, show_label: 2, @@ -527,29 +527,29 @@ class et extends sl { } } const { - SvelteComponent: El, - append: Sl, - attr: kt, - binding_callbacks: Tl, - create_slot: Al, - detach: Hl, - element: Bn, - get_all_dirty_from_scope: Bl, - get_slot_changes: Cl, - init: Pl, - insert: Il, - safe_not_equal: kl, - toggle_class: pe, - transition_in: Ll, - transition_out: Nl, - update_slot_base: Ol + SvelteComponent: kl, + append: Cl, + attr: Lt, + binding_callbacks: Pl, + create_slot: Il, + detach: Ll, + element: Cn, + get_all_dirty_from_scope: Nl, + get_slot_changes: Ol, + init: Ml, + insert: Rl, + safe_not_equal: Dl, + toggle_class: ve, + transition_in: Ul, + transition_out: Gl, + update_slot_base: xl } = window.__gradio__svelte__internal; -function Ml(e) { +function Fl(e) { let t, n, i; const r = ( /*#slots*/ e[5].default - ), l = Al( + ), l = Il( r, e, /*$$scope*/ @@ -558,22 +558,22 @@ function Ml(e) { ); return { c() { - t = Bn("div"), n = Bn("div"), l && l.c(), kt(n, "class", "icon svelte-3w3rth"), kt(t, "class", "empty svelte-3w3rth"), kt(t, "aria-label", "Empty value"), pe( + t = Cn("div"), n = Cn("div"), l && l.c(), Lt(n, "class", "icon svelte-3w3rth"), Lt(t, "class", "empty svelte-3w3rth"), Lt(t, "aria-label", "Empty value"), ve( t, "small", /*size*/ e[0] === "small" - ), pe( + ), ve( t, "large", /*size*/ e[0] === "large" - ), pe( + ), ve( t, "unpadded_box", /*unpadded_box*/ e[1] - ), pe( + ), ve( t, "small_parent", /*parent_height*/ @@ -581,47 +581,47 @@ function Ml(e) { ); }, m(o, a) { - Il(o, t, a), Sl(t, n), l && l.m(n, null), e[6](t), i = !0; + Rl(o, t, a), Cl(t, n), l && l.m(n, null), e[6](t), i = !0; }, p(o, [a]) { l && l.p && (!i || a & /*$$scope*/ - 16) && Ol( + 16) && xl( l, r, o, /*$$scope*/ o[4], - i ? Cl( + i ? Ol( r, /*$$scope*/ o[4], a, null - ) : Bl( + ) : Nl( /*$$scope*/ o[4] ), null ), (!i || a & /*size*/ - 1) && pe( + 1) && ve( t, "small", /*size*/ o[0] === "small" ), (!i || a & /*size*/ - 1) && pe( + 1) && ve( t, "large", /*size*/ o[0] === "large" ), (!i || a & /*unpadded_box*/ - 2) && pe( + 2) && ve( t, "unpadded_box", /*unpadded_box*/ o[1] ), (!i || a & /*parent_height*/ - 8) && pe( + 8) && ve( t, "small_parent", /*parent_height*/ @@ -629,17 +629,17 @@ function Ml(e) { ); }, i(o) { - i || (Ll(l, o), i = !0); + i || (Ul(l, o), i = !0); }, o(o) { - Nl(l, o), i = !1; + Gl(l, o), i = !1; }, d(o) { - o && Hl(t), l && l.d(o), e[6](null); + o && Ll(t), l && l.d(o), e[6](null); } }; } -function Rl(e) { +function jl(e) { let t, n = e[0], i = 1; for (; i < e.length; ) { const r = e[i], l = e[i + 1]; @@ -649,24 +649,24 @@ function Rl(e) { } return n; } -function Dl(e, t, n) { +function Vl(e, t, n) { let i, { $$slots: r = {}, $$scope: l } = t, { size: o = "small" } = t, { unpadded_box: a = !1 } = t, s; function u(c) { if (!c) return !1; - const { height: h } = c.getBoundingClientRect(), { height: _ } = Rl([ + const { height: h } = c.getBoundingClientRect(), { height: _ } = jl([ c, "access", - (b) => b.parentElement, + (g) => g.parentElement, "optionalAccess", - (b) => b.getBoundingClientRect, + (g) => g.getBoundingClientRect, "call", - (b) => b() + (g) => g() ]) || { height: h }; return h > _ + 2; } function f(c) { - Tl[c ? "unshift" : "push"](() => { + Pl[c ? "unshift" : "push"](() => { s = c, n(2, s); }); } @@ -677,211 +677,244 @@ function Dl(e, t, n) { 4 && n(3, i = u(s)); }, [o, a, s, i, l, r, f]; } -class Ul extends El { +class ql extends kl { constructor(t) { - super(), Pl(this, t, Dl, Ml, kl, { size: 0, unpadded_box: 1 }); + super(), Ml(this, t, Vl, Fl, Dl, { size: 0, unpadded_box: 1 }); } } const { - SvelteComponent: Gl, - append: Lt, - attr: te, - detach: Fl, - init: xl, - insert: jl, - noop: Nt, - safe_not_equal: Vl, + SvelteComponent: zl, + append: Nt, + attr: ee, + detach: Xl, + init: Zl, + insert: Wl, + noop: Ot, + safe_not_equal: Ql, set_style: oe, - svg_element: ut + svg_element: ht } = window.__gradio__svelte__internal; -function zl(e) { +function Jl(e) { let t, n, i, r; return { c() { - t = ut("svg"), n = ut("g"), i = ut("path"), r = ut("path"), te(i, "d", "M18,6L6.087,17.913"), oe(i, "fill", "none"), oe(i, "fill-rule", "nonzero"), oe(i, "stroke-width", "2px"), te(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), te(r, "d", "M4.364,4.364L19.636,19.636"), oe(r, "fill", "none"), oe(r, "fill-rule", "nonzero"), oe(r, "stroke-width", "2px"), te(t, "width", "100%"), te(t, "height", "100%"), te(t, "viewBox", "0 0 24 24"), te(t, "version", "1.1"), te(t, "xmlns", "http://www.w3.org/2000/svg"), te(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), te(t, "xml:space", "preserve"), te(t, "stroke", "currentColor"), oe(t, "fill-rule", "evenodd"), oe(t, "clip-rule", "evenodd"), oe(t, "stroke-linecap", "round"), oe(t, "stroke-linejoin", "round"); + t = ht("svg"), n = ht("g"), i = ht("path"), r = ht("path"), ee(i, "d", "M18,6L6.087,17.913"), oe(i, "fill", "none"), oe(i, "fill-rule", "nonzero"), oe(i, "stroke-width", "2px"), ee(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), ee(r, "d", "M4.364,4.364L19.636,19.636"), oe(r, "fill", "none"), oe(r, "fill-rule", "nonzero"), oe(r, "stroke-width", "2px"), ee(t, "width", "100%"), ee(t, "height", "100%"), ee(t, "viewBox", "0 0 24 24"), ee(t, "version", "1.1"), ee(t, "xmlns", "http://www.w3.org/2000/svg"), ee(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), ee(t, "xml:space", "preserve"), ee(t, "stroke", "currentColor"), oe(t, "fill-rule", "evenodd"), oe(t, "clip-rule", "evenodd"), oe(t, "stroke-linecap", "round"), oe(t, "stroke-linejoin", "round"); }, m(l, o) { - jl(l, t, o), Lt(t, n), Lt(n, i), Lt(t, r); - }, - p: Nt, - i: Nt, - o: Nt, - d(l) { - l && Fl(t); - } - }; -} -class ql extends Gl { - constructor(t) { - super(), xl(this, t, null, zl, Vl, {}); - } -} -const { - SvelteComponent: Xl, - append: Zl, - attr: Xe, - detach: Wl, - init: Ql, - insert: Jl, - noop: Ot, - safe_not_equal: Yl, - svg_element: Cn -} = window.__gradio__svelte__internal; -function Kl(e) { - let t, n; - return { - c() { - t = Cn("svg"), n = Cn("path"), Xe(n, "d", "M23,20a5,5,0,0,0-3.89,1.89L11.8,17.32a4.46,4.46,0,0,0,0-2.64l7.31-4.57A5,5,0,1,0,18,7a4.79,4.79,0,0,0,.2,1.32l-7.31,4.57a5,5,0,1,0,0,6.22l7.31,4.57A4.79,4.79,0,0,0,18,25a5,5,0,1,0,5-5ZM23,4a3,3,0,1,1-3,3A3,3,0,0,1,23,4ZM7,19a3,3,0,1,1,3-3A3,3,0,0,1,7,19Zm16,9a3,3,0,1,1,3-3A3,3,0,0,1,23,28Z"), Xe(n, "fill", "currentColor"), Xe(t, "id", "icon"), Xe(t, "xmlns", "http://www.w3.org/2000/svg"), Xe(t, "viewBox", "0 0 32 32"); - }, - m(i, r) { - Jl(i, t, r), Zl(t, n); + Wl(l, t, o), Nt(t, n), Nt(n, i), Nt(t, r); }, p: Ot, i: Ot, o: Ot, - d(i) { - i && Wl(t); + d(l) { + l && Xl(t); } }; } -class $l extends Xl { +class Yl extends zl { constructor(t) { - super(), Ql(this, t, null, Kl, Yl, {}); + super(), Zl(this, t, null, Jl, Ql, {}); } } const { - SvelteComponent: eo, - append: to, - attr: Ce, - detach: no, - init: io, - insert: ro, + SvelteComponent: Kl, + append: $l, + attr: Je, + detach: eo, + init: to, + insert: no, noop: Mt, - safe_not_equal: lo, + safe_not_equal: io, svg_element: Pn } = window.__gradio__svelte__internal; -function oo(e) { +function ro(e) { let t, n; return { c() { - t = Pn("svg"), n = Pn("path"), Ce(n, "fill", "currentColor"), Ce(n, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), Ce(t, "xmlns", "http://www.w3.org/2000/svg"), Ce(t, "width", "100%"), Ce(t, "height", "100%"), Ce(t, "viewBox", "0 0 32 32"); + t = Pn("svg"), n = Pn("path"), Je(n, "d", "M23,20a5,5,0,0,0-3.89,1.89L11.8,17.32a4.46,4.46,0,0,0,0-2.64l7.31-4.57A5,5,0,1,0,18,7a4.79,4.79,0,0,0,.2,1.32l-7.31,4.57a5,5,0,1,0,0,6.22l7.31,4.57A4.79,4.79,0,0,0,18,25a5,5,0,1,0,5-5ZM23,4a3,3,0,1,1-3,3A3,3,0,0,1,23,4ZM7,19a3,3,0,1,1,3-3A3,3,0,0,1,7,19Zm16,9a3,3,0,1,1,3-3A3,3,0,0,1,23,28Z"), Je(n, "fill", "currentColor"), Je(t, "id", "icon"), Je(t, "xmlns", "http://www.w3.org/2000/svg"), Je(t, "viewBox", "0 0 32 32"); }, m(i, r) { - ro(i, t, r), to(t, n); + no(i, t, r), $l(t, n); }, p: Mt, i: Mt, o: Mt, d(i) { - i && no(t); + i && eo(t); } }; } -class so extends eo { +class lo extends Kl { constructor(t) { - super(), io(this, t, null, oo, lo, {}); + super(), to(this, t, null, ro, io, {}); } } const { - SvelteComponent: ao, - append: uo, - attr: ne, - detach: fo, - init: co, - insert: ho, + SvelteComponent: oo, + append: so, + attr: Re, + detach: ao, + init: uo, + insert: fo, noop: Rt, - safe_not_equal: _o, + safe_not_equal: co, svg_element: In } = window.__gradio__svelte__internal; -function mo(e) { +function ho(e) { let t, n; return { c() { - t = In("svg"), n = In("path"), ne(n, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), ne(t, "xmlns", "http://www.w3.org/2000/svg"), ne(t, "width", "100%"), ne(t, "height", "100%"), ne(t, "viewBox", "0 0 24 24"), ne(t, "fill", "none"), ne(t, "stroke", "currentColor"), ne(t, "stroke-width", "1.5"), ne(t, "stroke-linecap", "round"), ne(t, "stroke-linejoin", "round"), ne(t, "class", "feather feather-edit-2"); + t = In("svg"), n = In("path"), Re(n, "fill", "currentColor"), Re(n, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), Re(t, "xmlns", "http://www.w3.org/2000/svg"), Re(t, "width", "100%"), Re(t, "height", "100%"), Re(t, "viewBox", "0 0 32 32"); }, m(i, r) { - ho(i, t, r), uo(t, n); + fo(i, t, r), so(t, n); }, p: Rt, i: Rt, o: Rt, d(i) { - i && fo(t); + i && ao(t); } }; } -class bo extends ao { +class _o extends oo { constructor(t) { - super(), co(this, t, null, mo, _o, {}); + super(), uo(this, t, null, ho, co, {}); } } const { - SvelteComponent: go, - append: Dt, - attr: R, - detach: po, - init: vo, - insert: wo, - noop: Ut, - safe_not_equal: yo, - svg_element: ft + SvelteComponent: mo, + append: bo, + attr: te, + detach: go, + init: po, + insert: vo, + noop: Dt, + safe_not_equal: wo, + svg_element: Ln } = window.__gradio__svelte__internal; -function Eo(e) { - let t, n, i, r; +function yo(e) { + let t, n; return { c() { - t = ft("svg"), n = ft("rect"), i = ft("circle"), r = ft("polyline"), R(n, "x", "3"), R(n, "y", "3"), R(n, "width", "18"), R(n, "height", "18"), R(n, "rx", "2"), R(n, "ry", "2"), R(i, "cx", "8.5"), R(i, "cy", "8.5"), R(i, "r", "1.5"), R(r, "points", "21 15 16 10 5 21"), R(t, "xmlns", "http://www.w3.org/2000/svg"), R(t, "width", "100%"), R(t, "height", "100%"), R(t, "viewBox", "0 0 24 24"), R(t, "fill", "none"), R(t, "stroke", "currentColor"), R(t, "stroke-width", "1.5"), R(t, "stroke-linecap", "round"), R(t, "stroke-linejoin", "round"), R(t, "class", "feather feather-image"); + t = Ln("svg"), n = Ln("path"), te(n, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), te(t, "xmlns", "http://www.w3.org/2000/svg"), te(t, "width", "100%"), te(t, "height", "100%"), te(t, "viewBox", "0 0 24 24"), te(t, "fill", "none"), te(t, "stroke", "currentColor"), te(t, "stroke-width", "1.5"), te(t, "stroke-linecap", "round"), te(t, "stroke-linejoin", "round"), te(t, "class", "feather feather-edit-2"); }, - m(l, o) { - wo(l, t, o), Dt(t, n), Dt(t, i), Dt(t, r); + m(i, r) { + vo(i, t, r), bo(t, n); }, - p: Ut, - i: Ut, - o: Ut, - d(l) { - l && po(t); + p: Dt, + i: Dt, + o: Dt, + d(i) { + i && go(t); } }; } -class Ui extends go { +class Eo extends mo { constructor(t) { - super(), vo(this, t, null, Eo, yo, {}); + super(), po(this, t, null, yo, wo, {}); } } const { SvelteComponent: So, - append: kn, - attr: Q, + append: Ut, + attr: x, detach: To, init: Ao, insert: Ho, noop: Gt, safe_not_equal: Bo, - svg_element: Ft + svg_element: _t } = window.__gradio__svelte__internal; -function Co(e) { - let t, n, i; +function ko(e) { + let t, n, i, r; return { c() { - t = Ft("svg"), n = Ft("polyline"), i = Ft("path"), Q(n, "points", "1 4 1 10 7 10"), Q(i, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Q(t, "xmlns", "http://www.w3.org/2000/svg"), Q(t, "width", "100%"), Q(t, "height", "100%"), Q(t, "viewBox", "0 0 24 24"), Q(t, "fill", "none"), Q(t, "stroke", "currentColor"), Q(t, "stroke-width", "2"), Q(t, "stroke-linecap", "round"), Q(t, "stroke-linejoin", "round"), Q(t, "class", "feather feather-rotate-ccw"); + t = _t("svg"), n = _t("rect"), i = _t("circle"), r = _t("polyline"), x(n, "x", "3"), x(n, "y", "3"), x(n, "width", "18"), x(n, "height", "18"), x(n, "rx", "2"), x(n, "ry", "2"), x(i, "cx", "8.5"), x(i, "cy", "8.5"), x(i, "r", "1.5"), x(r, "points", "21 15 16 10 5 21"), x(t, "xmlns", "http://www.w3.org/2000/svg"), x(t, "width", "100%"), x(t, "height", "100%"), x(t, "viewBox", "0 0 24 24"), x(t, "fill", "none"), x(t, "stroke", "currentColor"), x(t, "stroke-width", "1.5"), x(t, "stroke-linecap", "round"), x(t, "stroke-linejoin", "round"), x(t, "class", "feather feather-image"); }, - m(r, l) { - Ho(r, t, l), kn(t, n), kn(t, i); + m(l, o) { + Ho(l, t, o), Ut(t, n), Ut(t, i), Ut(t, r); }, p: Gt, i: Gt, o: Gt, + d(l) { + l && To(t); + } + }; +} +class ji extends So { + constructor(t) { + super(), Ao(this, t, null, ko, Bo, {}); + } +} +const { + SvelteComponent: Co, + append: Po, + attr: se, + detach: Io, + init: Lo, + insert: No, + noop: xt, + safe_not_equal: Oo, + svg_element: Nn +} = window.__gradio__svelte__internal; +function Mo(e) { + let t, n; + return { + c() { + t = Nn("svg"), n = Nn("polygon"), se(n, "points", "5 3 19 12 5 21 5 3"), se(t, "xmlns", "http://www.w3.org/2000/svg"), se(t, "width", "100%"), se(t, "height", "100%"), se(t, "viewBox", "0 0 24 24"), se(t, "fill", "currentColor"), se(t, "stroke", "currentColor"), se(t, "stroke-width", "1.5"), se(t, "stroke-linecap", "round"), se(t, "stroke-linejoin", "round"); + }, + m(i, r) { + No(i, t, r), Po(t, n); + }, + p: xt, + i: xt, + o: xt, + d(i) { + i && Io(t); + } + }; +} +class Ro extends Co { + constructor(t) { + super(), Lo(this, t, null, Mo, Oo, {}); + } +} +const { + SvelteComponent: Do, + append: On, + attr: Y, + detach: Uo, + init: Go, + insert: xo, + noop: Ft, + safe_not_equal: Fo, + svg_element: jt +} = window.__gradio__svelte__internal; +function jo(e) { + let t, n, i; + return { + c() { + t = jt("svg"), n = jt("polyline"), i = jt("path"), Y(n, "points", "1 4 1 10 7 10"), Y(i, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Y(t, "xmlns", "http://www.w3.org/2000/svg"), Y(t, "width", "100%"), Y(t, "height", "100%"), Y(t, "viewBox", "0 0 24 24"), Y(t, "fill", "none"), Y(t, "stroke", "currentColor"), Y(t, "stroke-width", "2"), Y(t, "stroke-linecap", "round"), Y(t, "stroke-linejoin", "round"), Y(t, "class", "feather feather-rotate-ccw"); + }, + m(r, l) { + xo(r, t, l), On(t, n), On(t, i); + }, + p: Ft, + i: Ft, + o: Ft, d(r) { - r && To(t); + r && Uo(t); } }; } -class Po extends So { +class Vo extends Do { constructor(t) { - super(), Ao(this, t, null, Co, Bo, {}); + super(), Go(this, t, null, jo, Fo, {}); } } -const Io = [ +const qo = [ { color: "red", primary: 600, secondary: 100 }, { color: "green", primary: 600, secondary: 100 }, { color: "blue", primary: 600, secondary: 100 }, @@ -892,7 +925,7 @@ const Io = [ { color: "cyan", primary: 600, secondary: 100 }, { color: "lime", primary: 500, secondary: 100 }, { color: "pink", primary: 600, secondary: 100 } -], Ln = { +], Mn = { inherit: "inherit", current: "currentColor", transparent: "transparent", @@ -1185,17 +1218,17 @@ const Io = [ 950: "#4c0519" } }; -Io.reduce( +qo.reduce( (e, { color: t, primary: n, secondary: i }) => ({ ...e, [t]: { - primary: Ln[t][n], - secondary: Ln[t][i] + primary: Mn[t][n], + secondary: Mn[t][i] } }), {} ); -function ko(e) { +function zo(e) { let t, n = e[0], i = 1; for (; i < e.length; ) { const r = e[i], l = e[i + 1]; @@ -1205,20 +1238,20 @@ function ko(e) { } return n; } -class mt extends Error { +class gt extends Error { constructor(t) { super(t), this.name = "ShareError"; } } -async function Lo(e, t) { +async function Xo(e, t) { if (window.__gradio_space__ == null) - throw new mt("Must be on Spaces to share."); + throw new gt("Must be on Spaces to share."); let n, i, r; if (t === "url") { const s = await fetch(e); n = await s.blob(), i = s.headers.get("content-type") || "", r = s.headers.get("content-disposition") || ""; } else - n = No(e), i = e.split(";")[0].split(":")[1], r = "file" + i.split("/")[1]; + n = Zo(e), i = e.split(";")[0].split(":")[1], r = "file" + i.split("/")[1]; const l = new File([n], r, { type: i }), o = await fetch("https://huggingface.co/uploads", { method: "POST", body: l, @@ -1228,34 +1261,34 @@ async function Lo(e, t) { } }); if (!o.ok) { - if (ko([o, "access", (s) => s.headers, "access", (s) => s.get, "call", (s) => s("content-type"), "optionalAccess", (s) => s.includes, "call", (s) => s("application/json")])) { + if (zo([o, "access", (s) => s.headers, "access", (s) => s.get, "call", (s) => s("content-type"), "optionalAccess", (s) => s.includes, "call", (s) => s("application/json")])) { const s = await o.json(); - throw new mt(`Upload failed: ${s.error}`); + throw new gt(`Upload failed: ${s.error}`); } - throw new mt("Upload failed."); + throw new gt("Upload failed."); } return await o.text(); } -function No(e) { +function Zo(e) { for (var t = e.split(","), n = t[0].match(/:(.*?);/)[1], i = atob(t[1]), r = i.length, l = new Uint8Array(r); r--; ) l[r] = i.charCodeAt(r); return new Blob([l], { type: n }); } const { - SvelteComponent: Oo, - create_component: Mo, - destroy_component: Ro, - init: Do, - mount_component: Uo, - safe_not_equal: Go, - transition_in: Fo, - transition_out: xo -} = window.__gradio__svelte__internal, { createEventDispatcher: jo } = window.__gradio__svelte__internal; -function Vo(e) { + SvelteComponent: Wo, + create_component: Qo, + destroy_component: Jo, + init: Yo, + mount_component: Ko, + safe_not_equal: $o, + transition_in: es, + transition_out: ts +} = window.__gradio__svelte__internal, { createEventDispatcher: ns } = window.__gradio__svelte__internal; +function is(e) { let t, n; - return t = new et({ + return t = new nt({ props: { - Icon: $l, + Icon: lo, label: ( /*i18n*/ e[2]("common.share") @@ -1271,10 +1304,10 @@ function Vo(e) { e[5] ), { c() { - Mo(t.$$.fragment); + Qo(t.$$.fragment); }, m(i, r) { - Uo(t, i, r), n = !0; + Ko(t, i, r), n = !0; }, p(i, [r]) { const l = {}; @@ -1285,18 +1318,18 @@ function Vo(e) { i[3]), t.$set(l); }, i(i) { - n || (Fo(t.$$.fragment, i), n = !0); + n || (es(t.$$.fragment, i), n = !0); }, o(i) { - xo(t.$$.fragment, i), n = !1; + ts(t.$$.fragment, i), n = !1; }, d(i) { - Ro(t, i); + Jo(t, i); } }; } -function zo(e, t, n) { - const i = jo(); +function rs(e, t, n) { + const i = ns(); let { formatter: r } = t, { value: l } = t, { i18n: o } = t, a = !1; const s = async () => { try { @@ -1305,7 +1338,7 @@ function zo(e, t, n) { i("share", { description: u }); } catch (u) { console.error(u); - let f = u instanceof mt ? u.message : "Share failed."; + let f = u instanceof gt ? u.message : "Share failed."; i("error", f); } finally { n(3, a = !1); @@ -1315,33 +1348,33 @@ function zo(e, t, n) { "formatter" in u && n(0, r = u.formatter), "value" in u && n(1, l = u.value), "i18n" in u && n(2, o = u.i18n); }, [r, l, o, a, i, s]; } -class qo extends Oo { +class ls extends Wo { constructor(t) { - super(), Do(this, t, zo, Vo, Go, { formatter: 0, value: 1, i18n: 2 }); + super(), Yo(this, t, rs, is, $o, { formatter: 0, value: 1, i18n: 2 }); } } new Intl.Collator(0, { numeric: 1 }).compare; -function Gi(e, t, n) { +function Vi(e, t, n) { if (e == null) return null; if (Array.isArray(e)) { const i = []; for (const r of e) - r == null ? i.push(null) : i.push(Gi(r, t, n)); + r == null ? i.push(null) : i.push(Vi(r, t, n)); return i; } - return e.is_stream ? n == null ? new xt({ + return e.is_stream ? n == null ? new Vt({ ...e, url: t + "/stream/" + e.path - }) : new xt({ + }) : new Vt({ ...e, url: "/proxy=" + n + "stream/" + e.path - }) : new xt({ + }) : new Vt({ ...e, - url: Zo(e.path, t, n) + url: ss(e.path, t, n) }); } -function Xo(e) { +function os(e) { try { const t = new URL(e); return t.protocol === "http:" || t.protocol === "https:"; @@ -1349,10 +1382,10 @@ function Xo(e) { return !1; } } -function Zo(e, t, n) { - return e == null ? n ? `/proxy=${n}file=` : `${t}/file=` : Xo(e) ? e : n ? `/proxy=${n}file=${e}` : `${t}/file=${e}`; +function ss(e, t, n) { + return e == null ? n ? `/proxy=${n}file=` : `${t}/file=` : os(e) ? e : n ? `/proxy=${n}file=${e}` : `${t}/file=${e}`; } -class xt { +class Vt { constructor({ path: t, url: n, @@ -1366,321 +1399,321 @@ class xt { this.path = t, this.url = n, this.orig_name = i, this.size = r, this.blob = n ? void 0 : l, this.is_stream = o, this.mime_type = a, this.alt_text = s; } } -function He() { +function Be() { } -function Wo(e) { +function as(e) { return e(); } -function Qo(e) { - e.forEach(Wo); +function us(e) { + e.forEach(as); } -function Jo(e) { +function fs(e) { return typeof e == "function"; } -function Yo(e, t) { +function cs(e, t) { return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function"; } -function Ko(e, ...t) { +function hs(e, ...t) { if (e == null) { for (const i of t) i(void 0); - return He; + return Be; } const n = e.subscribe(...t); return n.unsubscribe ? () => n.unsubscribe() : n; } -const Fi = typeof window < "u"; -let Nn = Fi ? () => window.performance.now() : () => Date.now(), xi = Fi ? (e) => requestAnimationFrame(e) : He; -const ke = /* @__PURE__ */ new Set(); -function ji(e) { - ke.forEach((t) => { - t.c(e) || (ke.delete(t), t.f()); - }), ke.size !== 0 && xi(ji); +const qi = typeof window < "u"; +let Rn = qi ? () => window.performance.now() : () => Date.now(), zi = qi ? (e) => requestAnimationFrame(e) : Be; +const Ge = /* @__PURE__ */ new Set(); +function Xi(e) { + Ge.forEach((t) => { + t.c(e) || (Ge.delete(t), t.f()); + }), Ge.size !== 0 && zi(Xi); } -function $o(e) { +function _s(e) { let t; - return ke.size === 0 && xi(ji), { + return Ge.size === 0 && zi(Xi), { promise: new Promise((n) => { - ke.add(t = { c: e, f: n }); + Ge.add(t = { c: e, f: n }); }), abort() { - ke.delete(t); + Ge.delete(t); } }; } -const Pe = []; -function es(e, t) { +const De = []; +function ms(e, t) { return { - subscribe: tt(e, t).subscribe + subscribe: it(e, t).subscribe }; } -function tt(e, t = He) { +function it(e, t = Be) { let n; const i = /* @__PURE__ */ new Set(); function r(a) { - if (Yo(e, a) && (e = a, n)) { - const s = !Pe.length; + if (cs(e, a) && (e = a, n)) { + const s = !De.length; for (const u of i) - u[1](), Pe.push(u, e); + u[1](), De.push(u, e); if (s) { - for (let u = 0; u < Pe.length; u += 2) - Pe[u][0](Pe[u + 1]); - Pe.length = 0; + for (let u = 0; u < De.length; u += 2) + De[u][0](De[u + 1]); + De.length = 0; } } } function l(a) { r(a(e)); } - function o(a, s = He) { + function o(a, s = Be) { const u = [a, s]; - return i.add(u), i.size === 1 && (n = t(r, l) || He), a(e), () => { + return i.add(u), i.size === 1 && (n = t(r, l) || Be), a(e), () => { i.delete(u), i.size === 0 && n && (n(), n = null); }; } return { set: r, update: l, subscribe: o }; } -function Ue(e, t, n) { +function Xe(e, t, n) { const i = !Array.isArray(e), r = i ? [e] : e; if (!r.every(Boolean)) throw new Error("derived() expects stores as input, got a falsy value"); const l = t.length < 2; - return es(n, (o, a) => { + return ms(n, (o, a) => { let s = !1; const u = []; - let f = 0, c = He; + let f = 0, c = Be; const h = () => { if (f) return; c(); - const b = t(i ? u[0] : u, o, a); - l ? o(b) : c = Jo(b) ? b : He; + const g = t(i ? u[0] : u, o, a); + l ? o(g) : c = fs(g) ? g : Be; }, _ = r.map( - (b, T) => Ko( - b, - (y) => { - u[T] = y, f &= ~(1 << T), s && h(); + (g, S) => hs( + g, + (v) => { + u[S] = v, f &= ~(1 << S), s && h(); }, () => { - f |= 1 << T; + f |= 1 << S; } ) ); return s = !0, h(), function() { - Qo(_), c(), s = !1; + us(_), c(), s = !1; }; }); } -function On(e) { +function Dn(e) { return Object.prototype.toString.call(e) === "[object Date]"; } -function Yt(e, t, n, i) { - if (typeof n == "number" || On(n)) { +function $t(e, t, n, i) { + if (typeof n == "number" || Dn(n)) { const r = i - n, l = (n - t) / (e.dt || 1 / 60), o = e.opts.stiffness * r, a = e.opts.damping * l, s = (o - a) * e.inv_mass, u = (l + s) * e.dt; - return Math.abs(u) < e.opts.precision && Math.abs(r) < e.opts.precision ? i : (e.settled = !1, On(n) ? new Date(n.getTime() + u) : n + u); + return Math.abs(u) < e.opts.precision && Math.abs(r) < e.opts.precision ? i : (e.settled = !1, Dn(n) ? new Date(n.getTime() + u) : n + u); } else { if (Array.isArray(n)) return n.map( - (r, l) => Yt(e, t[l], n[l], i[l]) + (r, l) => $t(e, t[l], n[l], i[l]) ); if (typeof n == "object") { const r = {}; for (const l in n) - r[l] = Yt(e, t[l], n[l], i[l]); + r[l] = $t(e, t[l], n[l], i[l]); return r; } else throw new Error(`Cannot spring ${typeof n} values`); } } -function Mn(e, t = {}) { - const n = tt(e), { stiffness: i = 0.15, damping: r = 0.8, precision: l = 0.01 } = t; +function Un(e, t = {}) { + const n = it(e), { stiffness: i = 0.15, damping: r = 0.8, precision: l = 0.01 } = t; let o, a, s, u = e, f = e, c = 1, h = 0, _ = !1; - function b(y, C = {}) { - f = y; - const E = s = {}; - return e == null || C.hard || T.stiffness >= 1 && T.damping >= 1 ? (_ = !0, o = Nn(), u = y, n.set(e = f), Promise.resolve()) : (C.soft && (h = 1 / ((C.soft === !0 ? 0.5 : +C.soft) * 60), c = 0), a || (o = Nn(), _ = !1, a = $o((m) => { + function g(v, A = {}) { + f = v; + const y = s = {}; + return e == null || A.hard || S.stiffness >= 1 && S.damping >= 1 ? (_ = !0, o = Rn(), u = v, n.set(e = f), Promise.resolve()) : (A.soft && (h = 1 / ((A.soft === !0 ? 0.5 : +A.soft) * 60), c = 0), a || (o = Rn(), _ = !1, a = _s((d) => { if (_) return _ = !1, a = null, !1; c = Math.min(c + h, 1); - const g = { + const T = { inv_mass: c, - opts: T, + opts: S, settled: !0, - dt: (m - o) * 60 / 1e3 - }, p = Yt(g, u, e, f); - return o = m, u = e, n.set(e = p), g.settled && (a = null), !g.settled; - })), new Promise((m) => { + dt: (d - o) * 60 / 1e3 + }, b = $t(T, u, e, f); + return o = d, u = e, n.set(e = b), T.settled && (a = null), !T.settled; + })), new Promise((d) => { a.promise.then(() => { - E === s && m(); + y === s && d(); }); })); } - const T = { - set: b, - update: (y, C) => b(y(f, e), C), + const S = { + set: g, + update: (v, A) => g(v(f, e), A), subscribe: n.subscribe, stiffness: i, damping: r, precision: l }; - return T; + return S; } -function ts(e) { +function ds(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } -var ns = function(t) { - return is(t) && !rs(t); +var bs = function(t) { + return gs(t) && !ps(t); }; -function is(e) { +function gs(e) { return !!e && typeof e == "object"; } -function rs(e) { +function ps(e) { var t = Object.prototype.toString.call(e); - return t === "[object RegExp]" || t === "[object Date]" || ss(e); + return t === "[object RegExp]" || t === "[object Date]" || ys(e); } -var ls = typeof Symbol == "function" && Symbol.for, os = ls ? Symbol.for("react.element") : 60103; -function ss(e) { - return e.$$typeof === os; +var vs = typeof Symbol == "function" && Symbol.for, ws = vs ? Symbol.for("react.element") : 60103; +function ys(e) { + return e.$$typeof === ws; } -function as(e) { +function Es(e) { return Array.isArray(e) ? [] : {}; } -function Je(e, t) { - return t.clone !== !1 && t.isMergeableObject(e) ? Le(as(e), e, t) : e; +function et(e, t) { + return t.clone !== !1 && t.isMergeableObject(e) ? xe(Es(e), e, t) : e; } -function us(e, t, n) { +function Ss(e, t, n) { return e.concat(t).map(function(i) { - return Je(i, n); + return et(i, n); }); } -function fs(e, t) { +function Ts(e, t) { if (!t.customMerge) - return Le; + return xe; var n = t.customMerge(e); - return typeof n == "function" ? n : Le; + return typeof n == "function" ? n : xe; } -function cs(e) { +function As(e) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) { return Object.propertyIsEnumerable.call(e, t); }) : []; } -function Rn(e) { - return Object.keys(e).concat(cs(e)); +function Gn(e) { + return Object.keys(e).concat(As(e)); } -function Vi(e, t) { +function Zi(e, t) { try { return t in e; } catch { return !1; } } -function hs(e, t) { - return Vi(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t)); +function Hs(e, t) { + return Zi(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t)); } -function _s(e, t, n) { +function Bs(e, t, n) { var i = {}; - return n.isMergeableObject(e) && Rn(e).forEach(function(r) { - i[r] = Je(e[r], n); - }), Rn(t).forEach(function(r) { - hs(e, r) || (Vi(e, r) && n.isMergeableObject(t[r]) ? i[r] = fs(r, n)(e[r], t[r], n) : i[r] = Je(t[r], n)); + return n.isMergeableObject(e) && Gn(e).forEach(function(r) { + i[r] = et(e[r], n); + }), Gn(t).forEach(function(r) { + Hs(e, r) || (Zi(e, r) && n.isMergeableObject(t[r]) ? i[r] = Ts(r, n)(e[r], t[r], n) : i[r] = et(t[r], n)); }), i; } -function Le(e, t, n) { - n = n || {}, n.arrayMerge = n.arrayMerge || us, n.isMergeableObject = n.isMergeableObject || ns, n.cloneUnlessOtherwiseSpecified = Je; +function xe(e, t, n) { + n = n || {}, n.arrayMerge = n.arrayMerge || Ss, n.isMergeableObject = n.isMergeableObject || bs, n.cloneUnlessOtherwiseSpecified = et; var i = Array.isArray(t), r = Array.isArray(e), l = i === r; - return l ? i ? n.arrayMerge(e, t, n) : _s(e, t, n) : Je(t, n); + return l ? i ? n.arrayMerge(e, t, n) : Bs(e, t, n) : et(t, n); } -Le.all = function(t, n) { +xe.all = function(t, n) { if (!Array.isArray(t)) throw new Error("first argument should be an array"); return t.reduce(function(i, r) { - return Le(i, r, n); + return xe(i, r, n); }, {}); }; -var ms = Le, ds = ms; -const bs = /* @__PURE__ */ ts(ds); -var Kt = function(e, t) { - return Kt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) { +var ks = xe, Cs = ks; +const Ps = /* @__PURE__ */ ds(Cs); +var en = function(e, t) { + return en = 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]); - }, Kt(e, t); + }, en(e, t); }; -function yt(e, t) { +function Tt(e, t) { if (typeof t != "function" && t !== null) throw new TypeError("Class extends value " + String(t) + " is not a constructor or null"); - Kt(e, t); + en(e, t); function n() { this.constructor = e; } e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n()); } -var k = function() { - return k = Object.assign || function(t) { +var L = function() { + return L = Object.assign || function(t) { for (var n, i = 1, r = arguments.length; i < r; i++) { n = arguments[i]; for (var l in n) Object.prototype.hasOwnProperty.call(n, l) && (t[l] = n[l]); } return t; - }, k.apply(this, arguments); + }, L.apply(this, arguments); }; -function jt(e, t, n) { +function qt(e, t, n) { if (n || arguments.length === 2) for (var i = 0, r = t.length, l; i < r; i++) (l || !(i in t)) && (l || (l = Array.prototype.slice.call(t, 0, i)), l[i] = t[i]); return e.concat(l || Array.prototype.slice.call(t)); } -var B; +var k; (function(e) { e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", e[e.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", e[e.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", e[e.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", e[e.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", e[e.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", e[e.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", e[e.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", e[e.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", e[e.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", e[e.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", e[e.INVALID_TAG = 23] = "INVALID_TAG", e[e.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", e[e.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", e[e.UNCLOSED_TAG = 27] = "UNCLOSED_TAG"; -})(B || (B = {})); -var O; +})(k || (k = {})); +var R; (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"; -})(O || (O = {})); -var Ne; +})(R || (R = {})); +var Fe; (function(e) { e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime"; -})(Ne || (Ne = {})); -function Dn(e) { - return e.type === O.literal; +})(Fe || (Fe = {})); +function xn(e) { + return e.type === R.literal; } -function gs(e) { - return e.type === O.argument; +function Is(e) { + return e.type === R.argument; } -function zi(e) { - return e.type === O.number; +function Wi(e) { + return e.type === R.number; } -function qi(e) { - return e.type === O.date; +function Qi(e) { + return e.type === R.date; } -function Xi(e) { - return e.type === O.time; +function Ji(e) { + return e.type === R.time; } -function Zi(e) { - return e.type === O.select; +function Yi(e) { + return e.type === R.select; } -function Wi(e) { - return e.type === O.plural; +function Ki(e) { + return e.type === R.plural; } -function ps(e) { - return e.type === O.pound; +function Ls(e) { + return e.type === R.pound; } -function Qi(e) { - return e.type === O.tag; +function $i(e) { + return e.type === R.tag; } -function Ji(e) { - return !!(e && typeof e == "object" && e.type === Ne.number); +function er(e) { + return !!(e && typeof e == "object" && e.type === Fe.number); } -function $t(e) { - return !!(e && typeof e == "object" && e.type === Ne.dateTime); +function tn(e) { + return !!(e && typeof e == "object" && e.type === Fe.dateTime); } -var Yi = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, vs = /(?:[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 ws(e) { +var tr = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, Ns = /(?:[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 Os(e) { var t = {}; - return e.replace(vs, function(n) { + return e.replace(Ns, function(n) { var i = n.length; switch (n[0]) { case "G": @@ -1769,11 +1802,11 @@ function ws(e) { return ""; }), t; } -var ys = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; -function Es(e) { +var Ms = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; +function Rs(e) { if (e.length === 0) throw new Error("Number skeleton cannot be empty"); - for (var t = e.split(ys).filter(function(h) { + for (var t = e.split(Ms).filter(function(h) { return h.length > 0; }), n = [], i = 0, r = t; i < r.length; i++) { var l = r[i], o = l.split("/"); @@ -1788,17 +1821,17 @@ function Es(e) { } return n; } -function Ss(e) { +function Ds(e) { return e.replace(/^(.*?)-/, ""); } -var Un = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Ki = /^(@+)?(\+|#+)?[rs]?$/g, Ts = /(\*)(0+)|(#+)(0+)|(0+)/g, $i = /^(0+)$/; -function Gn(e) { +var Fn = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, nr = /^(@+)?(\+|#+)?[rs]?$/g, Us = /(\*)(0+)|(#+)(0+)|(0+)/g, ir = /^(0+)$/; +function jn(e) { var t = {}; - return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Ki, function(n, i, r) { + return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(nr, function(n, i, r) { return typeof r != "string" ? (t.minimumSignificantDigits = i.length, t.maximumSignificantDigits = i.length) : r === "+" ? t.minimumSignificantDigits = i.length : i[0] === "#" ? t.maximumSignificantDigits = i.length : (t.minimumSignificantDigits = i.length, t.maximumSignificantDigits = i.length + (typeof r == "string" ? r.length : 0)), ""; }), t; } -function er(e) { +function rr(e) { switch (e) { case "sign-auto": return { @@ -1838,7 +1871,7 @@ function er(e) { }; } } -function As(e) { +function Gs(e) { var t; if (e[0] === "E" && e[1] === "E" ? (t = { notation: "engineering" @@ -1846,17 +1879,17 @@ function As(e) { notation: "scientific" }, e = e.slice(1)), t) { var n = e.slice(0, 2); - if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !$i.test(e)) + if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !ir.test(e)) throw new Error("Malformed concise eng/scientific notation"); t.minimumIntegerDigits = e.length; } return t; } -function Fn(e) { - var t = {}, n = er(e); +function Vn(e) { + var t = {}, n = rr(e); return n || t; } -function Hs(e) { +function xs(e) { for (var t = {}, n = 0, i = e; n < i.length; n++) { var r = i[n]; switch (r.stem) { @@ -1880,7 +1913,7 @@ function Hs(e) { continue; case "measure-unit": case "unit": - t.style = "unit", t.unit = Ss(r.options[0]); + t.style = "unit", t.unit = Ds(r.options[0]); continue; case "compact-short": case "K": @@ -1891,13 +1924,13 @@ function Hs(e) { t.notation = "compact", t.compactDisplay = "long"; continue; case "scientific": - t = k(k(k({}, t), { notation: "scientific" }), r.options.reduce(function(s, u) { - return k(k({}, s), Fn(u)); + t = L(L(L({}, t), { notation: "scientific" }), r.options.reduce(function(s, u) { + return L(L({}, s), Vn(u)); }, {})); continue; case "engineering": - t = k(k(k({}, t), { notation: "engineering" }), r.options.reduce(function(s, u) { - return k(k({}, s), Fn(u)); + t = L(L(L({}, t), { notation: "engineering" }), r.options.reduce(function(s, u) { + return L(L({}, s), Vn(u)); }, {})); continue; case "notation-simple": @@ -1921,7 +1954,7 @@ function Hs(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(Ts, function(s, u, f, c, h, _) { + r.options[0].replace(Us, function(s, u, f, c, h, _) { if (u) t.minimumIntegerDigits = f.length; else { @@ -1934,32 +1967,32 @@ function Hs(e) { }); continue; } - if ($i.test(r.stem)) { + if (ir.test(r.stem)) { t.minimumIntegerDigits = r.stem.length; continue; } - if (Un.test(r.stem)) { + if (Fn.test(r.stem)) { if (r.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); - r.stem.replace(Un, function(s, u, f, c, h, _) { + r.stem.replace(Fn, function(s, u, f, c, h, _) { return f === "*" ? t.minimumFractionDigits = u.length : c && c[0] === "#" ? t.maximumFractionDigits = c.length : h && _ ? (t.minimumFractionDigits = h.length, t.maximumFractionDigits = h.length + _.length) : (t.minimumFractionDigits = u.length, t.maximumFractionDigits = u.length), ""; }); var l = r.options[0]; - l === "w" ? t = k(k({}, t), { trailingZeroDisplay: "stripIfInteger" }) : l && (t = k(k({}, t), Gn(l))); + l === "w" ? t = L(L({}, t), { trailingZeroDisplay: "stripIfInteger" }) : l && (t = L(L({}, t), jn(l))); continue; } - if (Ki.test(r.stem)) { - t = k(k({}, t), Gn(r.stem)); + if (nr.test(r.stem)) { + t = L(L({}, t), jn(r.stem)); continue; } - var o = er(r.stem); - o && (t = k(k({}, t), o)); - var a = As(r.stem); - a && (t = k(k({}, t), a)); + var o = rr(r.stem); + o && (t = L(L({}, t), o)); + var a = Gs(r.stem); + a && (t = L(L({}, t), a)); } return t; } -var ct = { +var mt = { AX: [ "H" ], @@ -3296,13 +3329,13 @@ var ct = { "h" ] }; -function Bs(e, t) { +function Fs(e, t) { for (var n = "", i = 0; i < e.length; i++) { var r = e.charAt(i); if (r === "j") { for (var l = 0; i + 1 < e.length && e.charAt(i + 1) === r; ) l++, i++; - var o = 1 + (l & 1), a = l < 2 ? 1 : 3 + (l >> 1), s = "a", u = Cs(t); + var o = 1 + (l & 1), a = l < 2 ? 1 : 3 + (l >> 1), s = "a", u = js(t); for ((u == "H" || u == "k") && (a = 0); a-- > 0; ) n += s; for (; o-- > 0; ) @@ -3312,7 +3345,7 @@ function Bs(e, t) { } return n; } -function Cs(e) { +function js(e) { var t = e.hourCycle; if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet e.hourCycles && // @ts-ignore @@ -3331,23 +3364,23 @@ function Cs(e) { } var n = e.language, i; n !== "root" && (i = e.maximize().region); - var r = ct[i || ""] || ct[n || ""] || ct["".concat(n, "-001")] || ct["001"]; + var r = mt[i || ""] || mt[n || ""] || mt["".concat(n, "-001")] || mt["001"]; return r[0]; } -var Vt, Ps = new RegExp("^".concat(Yi.source, "*")), Is = new RegExp("".concat(Yi.source, "*$")); -function P(e, t) { +var zt, Vs = new RegExp("^".concat(tr.source, "*")), qs = new RegExp("".concat(tr.source, "*$")); +function C(e, t) { return { start: e, end: t }; } -var ks = !!String.prototype.startsWith, Ls = !!String.fromCodePoint, Ns = !!Object.fromEntries, Os = !!String.prototype.codePointAt, Ms = !!String.prototype.trimStart, Rs = !!String.prototype.trimEnd, Ds = !!Number.isSafeInteger, Us = Ds ? Number.isSafeInteger : function(e) { +var zs = !!String.prototype.startsWith, Xs = !!String.fromCodePoint, Zs = !!Object.fromEntries, Ws = !!String.prototype.codePointAt, Qs = !!String.prototype.trimStart, Js = !!String.prototype.trimEnd, Ys = !!Number.isSafeInteger, Ks = Ys ? Number.isSafeInteger : function(e) { return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991; -}, en = !0; +}, nn = !0; try { - var Gs = nr("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - en = ((Vt = Gs.exec("a")) === null || Vt === void 0 ? void 0 : Vt[0]) === "a"; + var $s = or("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + nn = ((zt = $s.exec("a")) === null || zt === void 0 ? void 0 : zt[0]) === "a"; } catch { - en = !1; + nn = !1; } -var xn = ks ? ( +var qn = zs ? ( // Native function(t, n, i) { return t.startsWith(n, i); @@ -3357,7 +3390,7 @@ var xn = ks ? ( function(t, n, i) { return t.slice(i, i + n.length) === n; } -), tn = Ls ? String.fromCodePoint : ( +), rn = Xs ? String.fromCodePoint : ( // IE11 function() { for (var t = [], n = 0; n < arguments.length; n++) @@ -3369,9 +3402,9 @@ var xn = ks ? ( } return i; } -), jn = ( +), zn = ( // native - Ns ? Object.fromEntries : ( + Zs ? Object.fromEntries : ( // Ponyfill function(t) { for (var n = {}, i = 0, r = t; i < r.length; i++) { @@ -3381,7 +3414,7 @@ var xn = ks ? ( return n; } ) -), tr = Os ? ( +), lr = Ws ? ( // Native function(t, n) { return t.codePointAt(n); @@ -3395,7 +3428,7 @@ var xn = ks ? ( return r < 55296 || r > 56319 || n + 1 === i || (l = t.charCodeAt(n + 1)) < 56320 || l > 57343 ? r : (r - 55296 << 10) + (l - 56320) + 65536; } } -), Fs = Ms ? ( +), ea = Qs ? ( // Native function(t) { return t.trimStart(); @@ -3403,9 +3436,9 @@ var xn = ks ? ( ) : ( // Ponyfill function(t) { - return t.replace(Ps, ""); + return t.replace(Vs, ""); } -), xs = Rs ? ( +), ta = Js ? ( // Native function(t) { return t.trimEnd(); @@ -3413,32 +3446,32 @@ var xn = ks ? ( ) : ( // Ponyfill function(t) { - return t.replace(Is, ""); + return t.replace(qs, ""); } ); -function nr(e, t) { +function or(e, t) { return new RegExp(e, t); } -var nn; -if (en) { - var Vn = nr("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - nn = function(t, n) { +var ln; +if (nn) { + var Xn = or("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + ln = function(t, n) { var i; - Vn.lastIndex = n; - var r = Vn.exec(t); + Xn.lastIndex = n; + var r = Xn.exec(t); return (i = r[1]) !== null && i !== void 0 ? i : ""; }; } else - nn = function(t, n) { + ln = function(t, n) { for (var i = []; ; ) { - var r = tr(t, n); - if (r === void 0 || ir(r) || qs(r)) + var r = lr(t, n); + if (r === void 0 || sr(r) || la(r)) break; i.push(r), n += r >= 65536 ? 2 : 1; } - return tn.apply(void 0, i); + return rn.apply(void 0, i); }; -var js = ( +var na = ( /** @class */ function() { function e(t, n) { @@ -3462,14 +3495,14 @@ var js = ( if (l === 35 && (n === "plural" || n === "selectordinal")) { var a = this.clonePosition(); this.bump(), r.push({ - type: O.pound, - location: P(a, this.clonePosition()) + type: R.pound, + location: C(a, this.clonePosition()) }); } else if (l === 60 && !this.ignoreTag && this.peek() === 47) { if (i) break; - return this.error(B.UNMATCHED_CLOSING_TAG, P(this.clonePosition(), this.clonePosition())); - } else if (l === 60 && !this.ignoreTag && rn(this.peek() || 0)) { + return this.error(k.UNMATCHED_CLOSING_TAG, C(this.clonePosition(), this.clonePosition())); + } else if (l === 60 && !this.ignoreTag && on(this.peek() || 0)) { var o = this.parseTag(t, n); if (o.err) return o; @@ -3490,9 +3523,9 @@ var js = ( if (this.bumpSpace(), this.bumpIf("/>")) return { val: { - type: O.literal, + type: R.literal, value: "<".concat(r, "/>"), - location: P(i, this.clonePosition()) + location: C(i, this.clonePosition()) }, err: null }; @@ -3502,25 +3535,25 @@ var js = ( return l; var o = l.val, a = this.clonePosition(); if (this.bumpIf("") ? { + return r !== u ? this.error(k.UNMATCHED_CLOSING_TAG, C(s, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? { val: { - type: O.tag, + type: R.tag, value: r, children: o, - location: P(i, this.clonePosition()) + location: C(i, this.clonePosition()) }, err: null - } : this.error(B.INVALID_TAG, P(a, this.clonePosition()))); + } : this.error(k.INVALID_TAG, C(a, this.clonePosition()))); } else - return this.error(B.UNCLOSED_TAG, P(i, this.clonePosition())); + return this.error(k.UNCLOSED_TAG, C(i, this.clonePosition())); } else - return this.error(B.INVALID_TAG, P(i, this.clonePosition())); + return this.error(k.INVALID_TAG, C(i, this.clonePosition())); }, e.prototype.parseTagName = function() { var t = this.offset(); - for (this.bump(); !this.isEOF() && zs(this.char()); ) + for (this.bump(); !this.isEOF() && ra(this.char()); ) this.bump(); return this.message.slice(t, this.offset()); }, e.prototype.parseLiteral = function(t, n) { @@ -3542,14 +3575,14 @@ var js = ( } break; } - var s = P(i, this.clonePosition()); + var s = C(i, this.clonePosition()); return { - val: { type: O.literal, value: r, location: s }, + val: { type: R.literal, value: r, location: s }, err: null }; }, e.prototype.tryParseLeftAngleBracket = function() { return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail. - !Vs(this.peek() || 0)) ? (this.bump(), "<") : null; + !ia(this.peek() || 0)) ? (this.bump(), "<") : null; }, e.prototype.tryParseQuote = function(t) { if (this.isEOF() || this.char() !== 39) return null; @@ -3583,49 +3616,49 @@ var js = ( n.push(i); this.bump(); } - return tn.apply(void 0, n); + return rn.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(), tn(i)); + return i === 60 || i === 123 || i === 35 && (n === "plural" || n === "selectordinal") || i === 125 && t > 0 ? null : (this.bump(), rn(i)); }, e.prototype.parseArgument = function(t, n) { var i = this.clonePosition(); if (this.bump(), this.bumpSpace(), this.isEOF()) - return this.error(B.EXPECT_ARGUMENT_CLOSING_BRACE, P(i, this.clonePosition())); + return this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE, C(i, this.clonePosition())); if (this.char() === 125) - return this.bump(), this.error(B.EMPTY_ARGUMENT, P(i, this.clonePosition())); + return this.bump(), this.error(k.EMPTY_ARGUMENT, C(i, this.clonePosition())); var r = this.parseIdentifierIfPossible().value; if (!r) - return this.error(B.MALFORMED_ARGUMENT, P(i, this.clonePosition())); + return this.error(k.MALFORMED_ARGUMENT, C(i, this.clonePosition())); if (this.bumpSpace(), this.isEOF()) - return this.error(B.EXPECT_ARGUMENT_CLOSING_BRACE, P(i, this.clonePosition())); + return this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE, C(i, this.clonePosition())); switch (this.char()) { case 125: return this.bump(), { val: { - type: O.argument, + type: R.argument, // value does not include the opening and closing braces. value: r, - location: P(i, this.clonePosition()) + location: C(i, this.clonePosition()) }, err: null }; case 44: - return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(B.EXPECT_ARGUMENT_CLOSING_BRACE, P(i, this.clonePosition())) : this.parseArgumentOptions(t, n, r, i); + return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE, C(i, this.clonePosition())) : this.parseArgumentOptions(t, n, r, i); default: - return this.error(B.MALFORMED_ARGUMENT, P(i, this.clonePosition())); + return this.error(k.MALFORMED_ARGUMENT, C(i, this.clonePosition())); } }, e.prototype.parseIdentifierIfPossible = function() { - var t = this.clonePosition(), n = this.offset(), i = nn(this.message, n), r = n + i.length; + var t = this.clonePosition(), n = this.offset(), i = ln(this.message, n), r = n + i.length; this.bumpTo(r); - var l = this.clonePosition(), o = P(t, l); + var l = this.clonePosition(), o = C(t, l); return { value: i, location: o }; }, e.prototype.parseArgumentOptions = function(t, n, i, r) { var l, o = this.clonePosition(), a = this.parseIdentifierIfPossible().value, s = this.clonePosition(); switch (a) { case "": - return this.error(B.EXPECT_ARGUMENT_TYPE, P(o, s)); + return this.error(k.EXPECT_ARGUMENT_TYPE, C(o, s)); case "number": case "date": case "time": { @@ -3636,46 +3669,46 @@ var js = ( var f = this.clonePosition(), c = this.parseSimpleArgStyleIfPossible(); if (c.err) return c; - var h = xs(c.val); + var h = ta(c.val); if (h.length === 0) - return this.error(B.EXPECT_ARGUMENT_STYLE, P(this.clonePosition(), this.clonePosition())); - var _ = P(f, this.clonePosition()); + return this.error(k.EXPECT_ARGUMENT_STYLE, C(this.clonePosition(), this.clonePosition())); + var _ = C(f, this.clonePosition()); u = { style: h, styleLocation: _ }; } - var b = this.tryParseArgumentClose(r); - if (b.err) - return b; - var T = P(r, this.clonePosition()); - if (u && xn(u == null ? void 0 : u.style, "::", 0)) { - var y = Fs(u.style.slice(2)); + var g = this.tryParseArgumentClose(r); + if (g.err) + return g; + var S = C(r, this.clonePosition()); + if (u && qn(u == null ? void 0 : u.style, "::", 0)) { + var v = ea(u.style.slice(2)); if (a === "number") { - var c = this.parseNumberSkeletonFromString(y, u.styleLocation); + var c = this.parseNumberSkeletonFromString(v, u.styleLocation); return c.err ? c : { - val: { type: O.number, value: i, location: T, style: c.val }, + val: { type: R.number, value: i, location: S, style: c.val }, err: null }; } else { - if (y.length === 0) - return this.error(B.EXPECT_DATE_TIME_SKELETON, T); - var C = y; - this.locale && (C = Bs(y, this.locale)); + if (v.length === 0) + return this.error(k.EXPECT_DATE_TIME_SKELETON, S); + var A = v; + this.locale && (A = Fs(v, this.locale)); var h = { - type: Ne.dateTime, - pattern: C, + type: Fe.dateTime, + pattern: A, location: u.styleLocation, - parsedOptions: this.shouldParseSkeletons ? ws(C) : {} - }, E = a === "date" ? O.date : O.time; + parsedOptions: this.shouldParseSkeletons ? Os(A) : {} + }, y = a === "date" ? R.date : R.time; return { - val: { type: E, value: i, location: T, style: h }, + val: { type: y, value: i, location: S, style: h }, err: null }; } } return { val: { - type: a === "number" ? O.number : a === "date" ? O.date : O.time, + type: a === "number" ? R.number : a === "date" ? R.date : R.time, value: i, - location: T, + location: S, style: (l = u == null ? void 0 : u.style) !== null && l !== void 0 ? l : null }, err: null @@ -3684,52 +3717,52 @@ var js = ( case "plural": case "selectordinal": case "select": { - var m = this.clonePosition(); + var d = this.clonePosition(); if (this.bumpSpace(), !this.bumpIf(",")) - return this.error(B.EXPECT_SELECT_ARGUMENT_OPTIONS, P(m, k({}, m))); + return this.error(k.EXPECT_SELECT_ARGUMENT_OPTIONS, C(d, L({}, d))); this.bumpSpace(); - var g = this.parseIdentifierIfPossible(), p = 0; - if (a !== "select" && g.value === "offset") { + var T = this.parseIdentifierIfPossible(), b = 0; + if (a !== "select" && T.value === "offset") { if (!this.bumpIf(":")) - return this.error(B.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, P(this.clonePosition(), this.clonePosition())); + return this.error(k.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, C(this.clonePosition(), this.clonePosition())); this.bumpSpace(); - var c = this.tryParseDecimalInteger(B.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, B.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE); + var c = this.tryParseDecimalInteger(k.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, k.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE); if (c.err) return c; - this.bumpSpace(), g = this.parseIdentifierIfPossible(), p = c.val; + this.bumpSpace(), T = this.parseIdentifierIfPossible(), b = c.val; } - var N = this.tryParsePluralOrSelectOptions(t, a, n, g); - if (N.err) - return N; - var b = this.tryParseArgumentClose(r); - if (b.err) - return b; - var G = P(r, this.clonePosition()); + var I = this.tryParsePluralOrSelectOptions(t, a, n, T); + if (I.err) + return I; + var g = this.tryParseArgumentClose(r); + if (g.err) + return g; + var M = C(r, this.clonePosition()); return a === "select" ? { val: { - type: O.select, + type: R.select, value: i, - options: jn(N.val), - location: G + options: zn(I.val), + location: M }, err: null } : { val: { - type: O.plural, + type: R.plural, value: i, - options: jn(N.val), - offset: p, + options: zn(I.val), + offset: b, pluralType: a === "plural" ? "cardinal" : "ordinal", - location: G + location: M }, err: null }; } default: - return this.error(B.INVALID_ARGUMENT_TYPE, P(o, s)); + return this.error(k.INVALID_ARGUMENT_TYPE, C(o, s)); } }, e.prototype.tryParseArgumentClose = function(t) { - return this.isEOF() || this.char() !== 125 ? this.error(B.EXPECT_ARGUMENT_CLOSING_BRACE, P(t, this.clonePosition())) : (this.bump(), { val: !0, err: null }); + return this.isEOF() || this.char() !== 125 ? this.error(k.EXPECT_ARGUMENT_CLOSING_BRACE, C(t, this.clonePosition())) : (this.bump(), { val: !0, err: null }); }, e.prototype.parseSimpleArgStyleIfPossible = function() { for (var t = 0, n = this.clonePosition(); !this.isEOF(); ) { var i = this.char(); @@ -3738,7 +3771,7 @@ var js = ( this.bump(); var r = this.clonePosition(); if (!this.bumpUntil("'")) - return this.error(B.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, P(r, this.clonePosition())); + return this.error(k.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, C(r, this.clonePosition())); this.bump(); break; } @@ -3768,16 +3801,16 @@ var js = ( }, e.prototype.parseNumberSkeletonFromString = function(t, n) { var i = []; try { - i = Es(t); + i = Rs(t); } catch { - return this.error(B.INVALID_NUMBER_SKELETON, n); + return this.error(k.INVALID_NUMBER_SKELETON, n); } return { val: { - type: Ne.number, + type: Fe.number, tokens: i, location: n, - parsedOptions: this.shouldParseSkeletons ? Hs(i) : {} + parsedOptions: this.shouldParseSkeletons ? xs(i) : {} }, err: null }; @@ -3786,34 +3819,34 @@ var js = ( if (u.length === 0) { var c = this.clonePosition(); if (n !== "select" && this.bumpIf("=")) { - var h = this.tryParseDecimalInteger(B.EXPECT_PLURAL_ARGUMENT_SELECTOR, B.INVALID_PLURAL_ARGUMENT_SELECTOR); + var h = this.tryParseDecimalInteger(k.EXPECT_PLURAL_ARGUMENT_SELECTOR, k.INVALID_PLURAL_ARGUMENT_SELECTOR); if (h.err) return h; - f = P(c, this.clonePosition()), u = this.message.slice(c.offset, this.offset()); + f = C(c, this.clonePosition()), u = this.message.slice(c.offset, this.offset()); } else break; } if (s.has(u)) - return this.error(n === "select" ? B.DUPLICATE_SELECT_ARGUMENT_SELECTOR : B.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, f); + return this.error(n === "select" ? k.DUPLICATE_SELECT_ARGUMENT_SELECTOR : k.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, f); u === "other" && (o = !0), this.bumpSpace(); var _ = this.clonePosition(); if (!this.bumpIf("{")) - return this.error(n === "select" ? B.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : B.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, P(this.clonePosition(), this.clonePosition())); - var b = this.parseMessage(t + 1, n, i); - if (b.err) - return b; - var T = this.tryParseArgumentClose(_); - if (T.err) - return T; + return this.error(n === "select" ? k.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : k.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, C(this.clonePosition(), this.clonePosition())); + var g = this.parseMessage(t + 1, n, i); + if (g.err) + return g; + var S = this.tryParseArgumentClose(_); + if (S.err) + return S; a.push([ u, { - value: b.val, - location: P(_, this.clonePosition()) + value: g.val, + location: C(_, this.clonePosition()) } ]), s.add(u), this.bumpSpace(), l = this.parseIdentifierIfPossible(), u = l.value, f = l.location; } - return a.length === 0 ? this.error(n === "select" ? B.EXPECT_SELECT_ARGUMENT_SELECTOR : B.EXPECT_PLURAL_ARGUMENT_SELECTOR, P(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !o ? this.error(B.MISSING_OTHER_CLAUSE, P(this.clonePosition(), this.clonePosition())) : { val: a, err: null }; + return a.length === 0 ? this.error(n === "select" ? k.EXPECT_SELECT_ARGUMENT_SELECTOR : k.EXPECT_PLURAL_ARGUMENT_SELECTOR, C(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !o ? this.error(k.MISSING_OTHER_CLAUSE, C(this.clonePosition(), this.clonePosition())) : { val: a, err: null }; }, e.prototype.tryParseDecimalInteger = function(t, n) { var i = 1, r = this.clonePosition(); this.bumpIf("+") || this.bumpIf("-") && (i = -1); @@ -3824,8 +3857,8 @@ var js = ( else break; } - var s = P(r, this.clonePosition()); - return l ? (o *= i, Us(o) ? { val: o, err: null } : this.error(n, s)) : this.error(t, s); + var s = C(r, this.clonePosition()); + return l ? (o *= i, Ks(o) ? { val: o, err: null } : this.error(n, s)) : this.error(t, s); }, e.prototype.offset = function() { return this.position.offset; }, e.prototype.isEOF = function() { @@ -3840,7 +3873,7 @@ var js = ( var t = this.position.offset; if (t >= this.message.length) throw Error("out of bound"); - var n = tr(this.message, t); + var n = lr(this.message, t); if (n === void 0) throw Error("Offset ".concat(t, " is at invalid UTF-16 code unit boundary")); return n; @@ -3859,7 +3892,7 @@ var js = ( t === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += t < 65536 ? 1 : 2); } }, e.prototype.bumpIf = function(t) { - if (xn(this.message, t, this.offset())) { + if (qn(this.message, t, this.offset())) { for (var n = 0; n < t.length; n++) this.bump(); return !0; @@ -3881,7 +3914,7 @@ var js = ( break; } }, e.prototype.bumpSpace = function() { - for (; !this.isEOF() && ir(this.char()); ) + for (; !this.isEOF() && sr(this.char()); ) this.bump(); }, e.prototype.peek = function() { if (this.isEOF()) @@ -3891,97 +3924,97 @@ var js = ( }, e; }() ); -function rn(e) { +function on(e) { return e >= 97 && e <= 122 || e >= 65 && e <= 90; } -function Vs(e) { - return rn(e) || e === 47; +function ia(e) { + return on(e) || e === 47; } -function zs(e) { +function ra(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 ir(e) { +function sr(e) { return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233; } -function qs(e) { +function la(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 ln(e) { +function sn(e) { e.forEach(function(t) { - if (delete t.location, Zi(t) || Wi(t)) + if (delete t.location, Yi(t) || Ki(t)) for (var n in t.options) - delete t.options[n].location, ln(t.options[n].value); + delete t.options[n].location, sn(t.options[n].value); else - zi(t) && Ji(t.style) || (qi(t) || Xi(t)) && $t(t.style) ? delete t.style.location : Qi(t) && ln(t.children); + Wi(t) && er(t.style) || (Qi(t) || Ji(t)) && tn(t.style) ? delete t.style.location : $i(t) && sn(t.children); }); } -function Xs(e, t) { - t === void 0 && (t = {}), t = k({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t); - var n = new js(e, t).parse(); +function oa(e, t) { + t === void 0 && (t = {}), t = L({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t); + var n = new na(e, t).parse(); if (n.err) { - var i = SyntaxError(B[n.err.kind]); + var i = SyntaxError(k[n.err.kind]); throw i.location = n.err.location, i.originalMessage = n.err.message, i; } - return t != null && t.captureLocation || ln(n.val), n.val; + return t != null && t.captureLocation || sn(n.val), n.val; } -function zt(e, t) { - var n = t && t.cache ? t.cache : Ks, i = t && t.serializer ? t.serializer : Ys, r = t && t.strategy ? t.strategy : Ws; +function Xt(e, t) { + var n = t && t.cache ? t.cache : ha, i = t && t.serializer ? t.serializer : ca, r = t && t.strategy ? t.strategy : aa; return r(e, { cache: n, serializer: i }); } -function Zs(e) { +function sa(e) { return e == null || typeof e == "number" || typeof e == "boolean"; } -function rr(e, t, n, i) { - var r = Zs(i) ? i : n(i), l = t.get(r); +function ar(e, t, n, i) { + var r = sa(i) ? i : n(i), l = t.get(r); return typeof l > "u" && (l = e.call(this, i), t.set(r, l)), l; } -function lr(e, t, n) { +function ur(e, t, n) { var i = Array.prototype.slice.call(arguments, 3), r = n(i), l = t.get(r); return typeof l > "u" && (l = e.apply(this, i), t.set(r, l)), l; } -function dn(e, t, n, i, r) { +function gn(e, t, n, i, r) { return n.bind(t, e, i, r); } -function Ws(e, t) { - var n = e.length === 1 ? rr : lr; - return dn(e, this, n, t.cache.create(), t.serializer); +function aa(e, t) { + var n = e.length === 1 ? ar : ur; + return gn(e, this, n, t.cache.create(), t.serializer); } -function Qs(e, t) { - return dn(e, this, lr, t.cache.create(), t.serializer); +function ua(e, t) { + return gn(e, this, ur, t.cache.create(), t.serializer); } -function Js(e, t) { - return dn(e, this, rr, t.cache.create(), t.serializer); +function fa(e, t) { + return gn(e, this, ar, t.cache.create(), t.serializer); } -var Ys = function() { +var ca = function() { return JSON.stringify(arguments); }; -function bn() { +function pn() { this.cache = /* @__PURE__ */ Object.create(null); } -bn.prototype.get = function(e) { +pn.prototype.get = function(e) { return this.cache[e]; }; -bn.prototype.set = function(e, t) { +pn.prototype.set = function(e, t) { this.cache[e] = t; }; -var Ks = { +var ha = { create: function() { - return new bn(); + return new pn(); } -}, qt = { - variadic: Qs, - monadic: Js -}, Oe; +}, Zt = { + variadic: ua, + monadic: fa +}, je; (function(e) { e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API"; -})(Oe || (Oe = {})); -var Et = ( +})(je || (je = {})); +var At = ( /** @class */ function(e) { - yt(t, e); + Tt(t, e); function t(n, i, r) { var l = e.call(this, n) || this; return l.code = i, l.originalMessage = r, l; @@ -3990,155 +4023,155 @@ var Et = ( return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); }, t; }(Error) -), zn = ( +), Zn = ( /** @class */ function(e) { - yt(t, e); + Tt(t, e); function t(n, i, r, l) { - return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(i, '". Options are "').concat(Object.keys(r).join('", "'), '"'), Oe.INVALID_VALUE, l) || this; + return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(i, '". Options are "').concat(Object.keys(r).join('", "'), '"'), je.INVALID_VALUE, l) || this; } return t; - }(Et) -), $s = ( + }(At) +), _a = ( /** @class */ function(e) { - yt(t, e); + Tt(t, e); function t(n, i, r) { - return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(i), Oe.INVALID_VALUE, r) || this; + return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(i), je.INVALID_VALUE, r) || this; } return t; - }(Et) -), ea = ( + }(At) +), ma = ( /** @class */ function(e) { - yt(t, e); + Tt(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, '"'), Oe.MISSING_VALUE, i) || this; + return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(i, '"'), je.MISSING_VALUE, i) || this; } return t; - }(Et) -), j; + }(At) +), W; (function(e) { e[e.literal = 0] = "literal", e[e.object = 1] = "object"; -})(j || (j = {})); -function ta(e) { +})(W || (W = {})); +function da(e) { return e.length < 2 ? e : e.reduce(function(t, n) { var i = t[t.length - 1]; - return !i || i.type !== j.literal || n.type !== j.literal ? t.push(n) : i.value += n.value, t; + return !i || i.type !== W.literal || n.type !== W.literal ? t.push(n) : i.value += n.value, t; }, []); } -function na(e) { +function ba(e) { return typeof e == "function"; } -function dt(e, t, n, i, r, l, o) { - if (e.length === 1 && Dn(e[0])) +function pt(e, t, n, i, r, l, o) { + if (e.length === 1 && xn(e[0])) return [ { - type: j.literal, + type: W.literal, value: e[0].value } ]; for (var a = [], s = 0, u = e; s < u.length; s++) { var f = u[s]; - if (Dn(f)) { + if (xn(f)) { a.push({ - type: j.literal, + type: W.literal, value: f.value }); continue; } - if (ps(f)) { + if (Ls(f)) { typeof l == "number" && a.push({ - type: j.literal, + type: W.literal, value: n.getNumberFormat(t).format(l) }); continue; } var c = f.value; if (!(r && c in r)) - throw new ea(c, o); + throw new ma(c, o); var h = r[c]; - if (gs(f)) { + if (Is(f)) { (!h || typeof h == "string" || typeof h == "number") && (h = typeof h == "string" || typeof h == "number" ? String(h) : ""), a.push({ - type: typeof h == "string" ? j.literal : j.object, + type: typeof h == "string" ? W.literal : W.object, value: h }); continue; } - if (qi(f)) { - var _ = typeof f.style == "string" ? i.date[f.style] : $t(f.style) ? f.style.parsedOptions : void 0; + if (Qi(f)) { + var _ = typeof f.style == "string" ? i.date[f.style] : tn(f.style) ? f.style.parsedOptions : void 0; a.push({ - type: j.literal, + type: W.literal, value: n.getDateTimeFormat(t, _).format(h) }); continue; } - if (Xi(f)) { - var _ = typeof f.style == "string" ? i.time[f.style] : $t(f.style) ? f.style.parsedOptions : i.time.medium; + if (Ji(f)) { + var _ = typeof f.style == "string" ? i.time[f.style] : tn(f.style) ? f.style.parsedOptions : i.time.medium; a.push({ - type: j.literal, + type: W.literal, value: n.getDateTimeFormat(t, _).format(h) }); continue; } - if (zi(f)) { - var _ = typeof f.style == "string" ? i.number[f.style] : Ji(f.style) ? f.style.parsedOptions : void 0; + if (Wi(f)) { + var _ = typeof f.style == "string" ? i.number[f.style] : er(f.style) ? f.style.parsedOptions : void 0; _ && _.scale && (h = h * (_.scale || 1)), a.push({ - type: j.literal, + type: W.literal, value: n.getNumberFormat(t, _).format(h) }); continue; } - if (Qi(f)) { - var b = f.children, T = f.value, y = r[T]; - if (!na(y)) - throw new $s(T, "function", o); - var C = dt(b, t, n, i, r, l), E = y(C.map(function(p) { - return p.value; + if ($i(f)) { + var g = f.children, S = f.value, v = r[S]; + if (!ba(v)) + throw new _a(S, "function", o); + var A = pt(g, t, n, i, r, l), y = v(A.map(function(b) { + return b.value; })); - Array.isArray(E) || (E = [E]), a.push.apply(a, E.map(function(p) { + Array.isArray(y) || (y = [y]), a.push.apply(a, y.map(function(b) { return { - type: typeof p == "string" ? j.literal : j.object, - value: p + type: typeof b == "string" ? W.literal : W.object, + value: b }; })); } - if (Zi(f)) { - var m = f.options[h] || f.options.other; - if (!m) - throw new zn(f.value, h, Object.keys(f.options), o); - a.push.apply(a, dt(m.value, t, n, i, r)); + if (Yi(f)) { + var d = f.options[h] || f.options.other; + if (!d) + throw new Zn(f.value, h, Object.keys(f.options), o); + a.push.apply(a, pt(d.value, t, n, i, r)); continue; } - if (Wi(f)) { - var m = f.options["=".concat(h)]; - if (!m) { + if (Ki(f)) { + var d = f.options["=".concat(h)]; + if (!d) { if (!Intl.PluralRules) - throw new Et(`Intl.PluralRules is not available in this environment. + throw new At(`Intl.PluralRules is not available in this environment. Try polyfilling it using "@formatjs/intl-pluralrules" -`, Oe.MISSING_INTL_API, o); - var g = n.getPluralRules(t, { type: f.pluralType }).select(h - (f.offset || 0)); - m = f.options[g] || f.options.other; +`, je.MISSING_INTL_API, o); + var T = n.getPluralRules(t, { type: f.pluralType }).select(h - (f.offset || 0)); + d = f.options[T] || f.options.other; } - if (!m) - throw new zn(f.value, h, Object.keys(f.options), o); - a.push.apply(a, dt(m.value, t, n, i, r, h - (f.offset || 0))); + if (!d) + throw new Zn(f.value, h, Object.keys(f.options), o); + a.push.apply(a, pt(d.value, t, n, i, r, h - (f.offset || 0))); continue; } } - return ta(a); + return da(a); } -function ia(e, t) { - return t ? k(k(k({}, e || {}), t || {}), Object.keys(e).reduce(function(n, i) { - return n[i] = k(k({}, e[i]), t[i] || {}), n; +function ga(e, t) { + return t ? L(L(L({}, e || {}), t || {}), Object.keys(e).reduce(function(n, i) { + return n[i] = L(L({}, e[i]), t[i] || {}), n; }, {})) : e; } -function ra(e, t) { +function pa(e, t) { return t ? Object.keys(e).reduce(function(n, i) { - return n[i] = ia(e[i], t[i]), n; - }, k({}, e)) : e; + return n[i] = ga(e[i], t[i]), n; + }, L({}, e)) : e; } -function Xt(e) { +function Wt(e) { return { create: function() { return { @@ -4152,39 +4185,39 @@ function Xt(e) { } }; } -function la(e) { +function va(e) { return e === void 0 && (e = { number: {}, dateTime: {}, pluralRules: {} }), { - getNumberFormat: zt(function() { + getNumberFormat: Xt(function() { for (var t, n = [], i = 0; i < arguments.length; i++) n[i] = arguments[i]; - return new ((t = Intl.NumberFormat).bind.apply(t, jt([void 0], n, !1)))(); + return new ((t = Intl.NumberFormat).bind.apply(t, qt([void 0], n, !1)))(); }, { - cache: Xt(e.number), - strategy: qt.variadic + cache: Wt(e.number), + strategy: Zt.variadic }), - getDateTimeFormat: zt(function() { + getDateTimeFormat: Xt(function() { for (var t, n = [], i = 0; i < arguments.length; i++) n[i] = arguments[i]; - return new ((t = Intl.DateTimeFormat).bind.apply(t, jt([void 0], n, !1)))(); + return new ((t = Intl.DateTimeFormat).bind.apply(t, qt([void 0], n, !1)))(); }, { - cache: Xt(e.dateTime), - strategy: qt.variadic + cache: Wt(e.dateTime), + strategy: Zt.variadic }), - getPluralRules: zt(function() { + getPluralRules: Xt(function() { for (var t, n = [], i = 0; i < arguments.length; i++) n[i] = arguments[i]; - return new ((t = Intl.PluralRules).bind.apply(t, jt([void 0], n, !1)))(); + return new ((t = Intl.PluralRules).bind.apply(t, qt([void 0], n, !1)))(); }, { - cache: Xt(e.pluralRules), - strategy: qt.variadic + cache: Wt(e.pluralRules), + strategy: Zt.variadic }) }; } -var oa = ( +var wa = ( /** @class */ function() { function e(t, n, i, r) { @@ -4198,11 +4231,11 @@ var oa = ( if (a.length === 1) return a[0].value; var s = a.reduce(function(u, f) { - return !u.length || f.type !== j.literal || typeof u[u.length - 1] != "string" ? u.push(f.value) : u[u.length - 1] += f.value, u; + return !u.length || f.type !== W.literal || typeof u[u.length - 1] != "string" ? u.push(f.value) : u[u.length - 1] += f.value, u; }, []); return s.length <= 1 ? s[0] || "" : s; }, this.formatToParts = function(o) { - return dt(l.ast, l.locales, l.formatters, l.formats, o, void 0, l.message); + return pt(l.ast, l.locales, l.formatters, l.formats, o, void 0, l.message); }, this.resolvedOptions = function() { return { locale: l.resolvedLocale.toString() @@ -4220,7 +4253,7 @@ var oa = ( this.ast = t; if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); - this.formats = ra(e.formats, i), this.formatters = r && r.formatters || la(this.formatterCache); + this.formats = pa(e.formats, i), this.formatters = r && r.formatters || va(this.formatterCache); } return Object.defineProperty(e, "defaultLocale", { get: function() { @@ -4231,7 +4264,7 @@ var oa = ( }), 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 = Xs, e.formats = { + }, e.__parse = oa, e.formats = { number: { integer: { maximumFractionDigits: 0 @@ -4292,7 +4325,7 @@ var oa = ( }, e; }() ); -function sa(e, t) { +function ya(e, t) { if (t == null) return; if (t in e) @@ -4313,92 +4346,92 @@ function sa(e, t) { i = void 0; return i; } -const we = {}, aa = (e, t, n) => n && (t in we || (we[t] = {}), e in we[t] || (we[t][e] = n), n), or = (e, t) => { +const ye = {}, Ea = (e, t, n) => n && (t in ye || (ye[t] = {}), e in ye[t] || (ye[t][e] = n), n), fr = (e, t) => { if (t == null) return; - if (t in we && e in we[t]) - return we[t][e]; - const n = St(t); + if (t in ye && e in ye[t]) + return ye[t][e]; + const n = Ht(t); for (let i = 0; i < n.length; i++) { - const r = n[i], l = fa(r, e); + const r = n[i], l = Ta(r, e); if (l) - return aa(e, t, l); + return Ea(e, t, l); } }; -let gn; -const nt = tt({}); -function ua(e) { - return gn[e] || null; +let vn; +const rt = it({}); +function Sa(e) { + return vn[e] || null; } -function sr(e) { - return e in gn; +function cr(e) { + return e in vn; } -function fa(e, t) { - if (!sr(e)) +function Ta(e, t) { + if (!cr(e)) return null; - const n = ua(e); - return sa(n, t); + const n = Sa(e); + return ya(n, t); } -function ca(e) { +function Aa(e) { if (e == null) return; - const t = St(e); + const t = Ht(e); for (let n = 0; n < t.length; n++) { const i = t[n]; - if (sr(i)) + if (cr(i)) return i; } } -function ha(e, ...t) { - delete we[e], nt.update((n) => (n[e] = bs.all([n[e] || {}, ...t]), n)); +function Ha(e, ...t) { + delete ye[e], rt.update((n) => (n[e] = Ps.all([n[e] || {}, ...t]), n)); } -Ue( - [nt], +Xe( + [rt], ([e]) => Object.keys(e) ); -nt.subscribe((e) => gn = e); -const bt = {}; -function _a(e, t) { - bt[e].delete(t), bt[e].size === 0 && delete bt[e]; +rt.subscribe((e) => vn = e); +const vt = {}; +function Ba(e, t) { + vt[e].delete(t), vt[e].size === 0 && delete vt[e]; } -function ar(e) { - return bt[e]; +function hr(e) { + return vt[e]; } -function ma(e) { - return St(e).map((t) => { - const n = ar(t); +function ka(e) { + return Ht(e).map((t) => { + const n = hr(t); return [t, n ? [...n] : []]; }).filter(([, t]) => t.length > 0); } -function on(e) { - return e == null ? !1 : St(e).some( +function an(e) { + return e == null ? !1 : Ht(e).some( (t) => { var n; - return (n = ar(t)) == null ? void 0 : n.size; + return (n = hr(t)) == null ? void 0 : n.size; } ); } -function da(e, t) { +function Ca(e, t) { return Promise.all( - t.map((i) => (_a(e, i), i().then((r) => r.default || r))) - ).then((i) => ha(e, ...i)); -} -const Ze = {}; -function ur(e) { - if (!on(e)) - return e in Ze ? Ze[e] : Promise.resolve(); - const t = ma(e); - return Ze[e] = Promise.all( + t.map((i) => (Ba(e, i), i().then((r) => r.default || r))) + ).then((i) => Ha(e, ...i)); +} +const Ye = {}; +function _r(e) { + if (!an(e)) + return e in Ye ? Ye[e] : Promise.resolve(); + const t = ka(e); + return Ye[e] = Promise.all( t.map( - ([n, i]) => da(n, i) + ([n, i]) => Ca(n, i) ) ).then(() => { - if (on(e)) - return ur(e); - delete Ze[e]; - }), Ze[e]; + if (an(e)) + return _r(e); + delete Ye[e]; + }), Ye[e]; } -const ba = { +const Pa = { number: { scientific: { notation: "scientific" }, engineering: { notation: "engineering" }, @@ -4427,150 +4460,150 @@ const ba = { timeZoneName: "short" } } -}, ga = { +}, Ia = { fallbackLocale: null, loadingDelay: 200, - formats: ba, + formats: Pa, warnOnMissingMessages: !0, handleMissingMessage: void 0, ignoreTag: !0 -}, pa = ga; -function Me() { - return pa; +}, La = Ia; +function Ve() { + return La; } -const Zt = tt(!1); -var va = Object.defineProperty, wa = Object.defineProperties, ya = Object.getOwnPropertyDescriptors, qn = Object.getOwnPropertySymbols, Ea = Object.prototype.hasOwnProperty, Sa = Object.prototype.propertyIsEnumerable, Xn = (e, t, n) => t in e ? va(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ta = (e, t) => { +const Qt = it(!1); +var Na = Object.defineProperty, Oa = Object.defineProperties, Ma = Object.getOwnPropertyDescriptors, Wn = Object.getOwnPropertySymbols, Ra = Object.prototype.hasOwnProperty, Da = Object.prototype.propertyIsEnumerable, Qn = (e, t, n) => t in e ? Na(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Ua = (e, t) => { for (var n in t || (t = {})) - Ea.call(t, n) && Xn(e, n, t[n]); - if (qn) - for (var n of qn(t)) - Sa.call(t, n) && Xn(e, n, t[n]); + Ra.call(t, n) && Qn(e, n, t[n]); + if (Wn) + for (var n of Wn(t)) + Da.call(t, n) && Qn(e, n, t[n]); return e; -}, Aa = (e, t) => wa(e, ya(t)); -let sn; -const gt = tt(null); -function Zn(e) { +}, Ga = (e, t) => Oa(e, Ma(t)); +let un; +const wt = it(null); +function Jn(e) { return e.split("-").map((t, n, i) => i.slice(0, n + 1).join("-")).reverse(); } -function St(e, t = Me().fallbackLocale) { - const n = Zn(e); - return t ? [.../* @__PURE__ */ new Set([...n, ...Zn(t)])] : n; +function Ht(e, t = Ve().fallbackLocale) { + const n = Jn(e); + return t ? [.../* @__PURE__ */ new Set([...n, ...Jn(t)])] : n; } -function Be() { - return sn ?? void 0; +function Pe() { + return un ?? void 0; } -gt.subscribe((e) => { - sn = e ?? void 0, typeof window < "u" && e != null && document.documentElement.setAttribute("lang", e); +wt.subscribe((e) => { + un = e ?? void 0, typeof window < "u" && e != null && document.documentElement.setAttribute("lang", e); }); -const Ha = (e) => { - if (e && ca(e) && on(e)) { - const { loadingDelay: t } = Me(); +const xa = (e) => { + if (e && Aa(e) && an(e)) { + const { loadingDelay: t } = Ve(); let n; - return typeof window < "u" && Be() != null && t ? n = window.setTimeout( - () => Zt.set(!0), + return typeof window < "u" && Pe() != null && t ? n = window.setTimeout( + () => Qt.set(!0), t - ) : Zt.set(!0), ur(e).then(() => { - gt.set(e); + ) : Qt.set(!0), _r(e).then(() => { + wt.set(e); }).finally(() => { - clearTimeout(n), Zt.set(!1); + clearTimeout(n), Qt.set(!1); }); } - return gt.set(e); -}, it = Aa(Ta({}, gt), { - set: Ha -}), Tt = (e) => { + return wt.set(e); +}, lt = Ga(Ua({}, wt), { + set: xa +}), Bt = (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 Ba = Object.defineProperty, pt = Object.getOwnPropertySymbols, fr = Object.prototype.hasOwnProperty, cr = Object.prototype.propertyIsEnumerable, Wn = (e, t, n) => t in e ? Ba(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, pn = (e, t) => { +var Fa = Object.defineProperty, yt = Object.getOwnPropertySymbols, mr = Object.prototype.hasOwnProperty, dr = Object.prototype.propertyIsEnumerable, Yn = (e, t, n) => t in e ? Fa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, wn = (e, t) => { for (var n in t || (t = {})) - fr.call(t, n) && Wn(e, n, t[n]); - if (pt) - for (var n of pt(t)) - cr.call(t, n) && Wn(e, n, t[n]); + mr.call(t, n) && Yn(e, n, t[n]); + if (yt) + for (var n of yt(t)) + dr.call(t, n) && Yn(e, n, t[n]); return e; -}, Ge = (e, t) => { +}, Ze = (e, t) => { var n = {}; for (var i in e) - fr.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]); - if (e != null && pt) - for (var i of pt(e)) - t.indexOf(i) < 0 && cr.call(e, i) && (n[i] = e[i]); + mr.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]); + if (e != null && yt) + for (var i of yt(e)) + t.indexOf(i) < 0 && dr.call(e, i) && (n[i] = e[i]); return n; }; -const Ye = (e, t) => { - const { formats: n } = Me(); +const tt = (e, t) => { + const { formats: n } = Ve(); if (e in n && t in n[e]) return n[e][t]; throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`); -}, Ca = Tt( +}, ja = Bt( (e) => { - var t = e, { locale: n, format: i } = t, r = Ge(t, ["locale", "format"]); + var t = e, { locale: n, format: i } = t, r = Ze(t, ["locale", "format"]); if (n == null) throw new Error('[svelte-i18n] A "locale" must be set to format numbers'); - return i && (r = Ye("number", i)), new Intl.NumberFormat(n, r); + return i && (r = tt("number", i)), new Intl.NumberFormat(n, r); } -), Pa = Tt( +), Va = Bt( (e) => { - var t = e, { locale: n, format: i } = t, r = Ge(t, ["locale", "format"]); + var t = e, { locale: n, format: i } = t, r = Ze(t, ["locale", "format"]); if (n == null) throw new Error('[svelte-i18n] A "locale" must be set to format dates'); - return i ? r = Ye("date", i) : Object.keys(r).length === 0 && (r = Ye("date", "short")), new Intl.DateTimeFormat(n, r); + return i ? r = tt("date", i) : Object.keys(r).length === 0 && (r = tt("date", "short")), new Intl.DateTimeFormat(n, r); } -), Ia = Tt( +), qa = Bt( (e) => { - var t = e, { locale: n, format: i } = t, r = Ge(t, ["locale", "format"]); + var t = e, { locale: n, format: i } = t, r = Ze(t, ["locale", "format"]); if (n == null) throw new Error( '[svelte-i18n] A "locale" must be set to format time values' ); - return i ? r = Ye("time", i) : Object.keys(r).length === 0 && (r = Ye("time", "short")), new Intl.DateTimeFormat(n, r); + return i ? r = tt("time", i) : Object.keys(r).length === 0 && (r = tt("time", "short")), new Intl.DateTimeFormat(n, r); } -), ka = (e = {}) => { +), za = (e = {}) => { var t = e, { - locale: n = Be() - } = t, i = Ge(t, [ + locale: n = Pe() + } = t, i = Ze(t, [ "locale" ]); - return Ca(pn({ locale: n }, i)); -}, La = (e = {}) => { + return ja(wn({ locale: n }, i)); +}, Xa = (e = {}) => { var t = e, { - locale: n = Be() - } = t, i = Ge(t, [ + locale: n = Pe() + } = t, i = Ze(t, [ "locale" ]); - return Pa(pn({ locale: n }, i)); -}, Na = (e = {}) => { + return Va(wn({ locale: n }, i)); +}, Za = (e = {}) => { var t = e, { - locale: n = Be() - } = t, i = Ge(t, [ + locale: n = Pe() + } = t, i = Ze(t, [ "locale" ]); - return Ia(pn({ locale: n }, i)); -}, Oa = Tt( + return qa(wn({ locale: n }, i)); +}, Wa = Bt( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - (e, t = Be()) => new oa(e, t, Me().formats, { - ignoreTag: Me().ignoreTag + (e, t = Pe()) => new wa(e, t, Ve().formats, { + ignoreTag: Ve().ignoreTag }) -), Ma = (e, t = {}) => { +), Qa = (e, t = {}) => { var n, i, r, l; let o = t; typeof e == "object" && (o = e, e = o.id); const { values: a, - locale: s = Be(), + locale: s = Pe(), default: u } = o; if (s == null) throw new Error( "[svelte-i18n] Cannot format a message without first setting the initial locale." ); - let f = or(e, s); + let f = fr(e, s); if (!f) - f = (l = (r = (i = (n = Me()).handleMissingMessage) == null ? void 0 : i.call(n, { locale: s, id: e, defaultValue: u })) != null ? r : u) != null ? l : e; + f = (l = (r = (i = (n = Ve()).handleMissingMessage) == null ? void 0 : i.call(n, { locale: s, id: e, defaultValue: u })) != null ? r : u) != null ? l : e; else if (typeof f != "string") return console.warn( `[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.` @@ -4579,7 +4612,7 @@ const Ye = (e, t) => { return f; let c = f; try { - c = Oa(f, s).format(a); + c = Wa(f, s).format(a); } catch (h) { h instanceof Error && console.warn( `[svelte-i18n] Message "${e}" has syntax error:`, @@ -4587,37 +4620,37 @@ const Ye = (e, t) => { ); } return c; -}, Ra = (e, t) => Na(t).format(e), Da = (e, t) => La(t).format(e), Ua = (e, t) => ka(t).format(e), Ga = (e, t = Be()) => or(e, t); -Ue([it, nt], () => Ma); -Ue([it], () => Ra); -Ue([it], () => Da); -Ue([it], () => Ua); -Ue([it, nt], () => Ga); +}, Ja = (e, t) => Za(t).format(e), Ya = (e, t) => Xa(t).format(e), Ka = (e, t) => za(t).format(e), $a = (e, t = Pe()) => fr(e, t); +Xe([lt, rt], () => Qa); +Xe([lt], () => Ja); +Xe([lt], () => Ya); +Xe([lt], () => Ka); +Xe([lt, rt], () => $a); const { - SvelteComponent: Fa, - append: Qn, - attr: xa, - check_outros: Jn, - create_component: vn, - destroy_component: wn, - detach: ja, - element: Va, - group_outros: Yn, - init: za, - insert: qa, - mount_component: yn, - safe_not_equal: Xa, - set_style: Kn, - space: $n, - toggle_class: ei, + SvelteComponent: eu, + append: Kn, + attr: tu, + check_outros: $n, + create_component: yn, + destroy_component: En, + detach: nu, + element: iu, + group_outros: ei, + init: ru, + insert: lu, + mount_component: Sn, + safe_not_equal: ou, + set_style: ti, + space: ni, + toggle_class: ii, transition_in: _e, - transition_out: Te -} = window.__gradio__svelte__internal, { createEventDispatcher: Za } = window.__gradio__svelte__internal; -function ti(e) { + transition_out: Ae +} = window.__gradio__svelte__internal, { createEventDispatcher: su } = window.__gradio__svelte__internal; +function ri(e) { let t, n; - return t = new et({ + return t = new nt({ props: { - Icon: bo, + Icon: Eo, label: ( /*i18n*/ e[3]("common.edit") @@ -4629,10 +4662,10 @@ function ti(e) { e[5] ), { c() { - vn(t.$$.fragment); + yn(t.$$.fragment); }, m(i, r) { - yn(t, i, r), n = !0; + Sn(t, i, r), n = !0; }, p(i, r) { const l = {}; @@ -4644,18 +4677,18 @@ function ti(e) { n || (_e(t.$$.fragment, i), n = !0); }, o(i) { - Te(t.$$.fragment, i), n = !1; + Ae(t.$$.fragment, i), n = !1; }, d(i) { - wn(t, i); + En(t, i); } }; } -function ni(e) { +function li(e) { let t, n; - return t = new et({ + return t = new nt({ props: { - Icon: Po, + Icon: Vo, label: ( /*i18n*/ e[3]("common.undo") @@ -4667,10 +4700,10 @@ function ni(e) { e[6] ), { c() { - vn(t.$$.fragment); + yn(t.$$.fragment); }, m(i, r) { - yn(t, i, r), n = !0; + Sn(t, i, r), n = !0; }, p(i, r) { const l = {}; @@ -4682,24 +4715,24 @@ function ni(e) { n || (_e(t.$$.fragment, i), n = !0); }, o(i) { - Te(t.$$.fragment, i), n = !1; + Ae(t.$$.fragment, i), n = !1; }, d(i) { - wn(t, i); + En(t, i); } }; } -function Wa(e) { +function au(e) { let t, n, i, r, l, o = ( /*editable*/ - e[0] && ti(e) + e[0] && ri(e) ), a = ( /*undoable*/ - e[1] && ni(e) + e[1] && li(e) ); - return r = new et({ + return r = new nt({ props: { - Icon: ql, + Icon: Yl, label: ( /*i18n*/ e[3]("common.clear") @@ -4711,8 +4744,8 @@ function Wa(e) { e[7] ), { c() { - t = Va("div"), o && o.c(), n = $n(), a && a.c(), i = $n(), vn(r.$$.fragment), xa(t, "class", "svelte-1wj0ocy"), ei(t, "not-absolute", !/*absolute*/ - e[2]), Kn( + t = iu("div"), o && o.c(), n = ni(), a && a.c(), i = ni(), yn(r.$$.fragment), tu(t, "class", "svelte-1wj0ocy"), ii(t, "not-absolute", !/*absolute*/ + e[2]), ti( t, "position", /*absolute*/ @@ -4720,25 +4753,25 @@ function Wa(e) { ); }, m(s, u) { - qa(s, t, u), o && o.m(t, null), Qn(t, n), a && a.m(t, null), Qn(t, i), yn(r, t, null), l = !0; + lu(s, t, u), o && o.m(t, null), Kn(t, n), a && a.m(t, null), Kn(t, i), Sn(r, t, null), l = !0; }, p(s, [u]) { /*editable*/ s[0] ? o ? (o.p(s, u), u & /*editable*/ - 1 && _e(o, 1)) : (o = ti(s), o.c(), _e(o, 1), o.m(t, n)) : o && (Yn(), Te(o, 1, 1, () => { + 1 && _e(o, 1)) : (o = ri(s), o.c(), _e(o, 1), o.m(t, n)) : o && (ei(), Ae(o, 1, 1, () => { o = null; - }), Jn()), /*undoable*/ + }), $n()), /*undoable*/ s[1] ? a ? (a.p(s, u), u & /*undoable*/ - 2 && _e(a, 1)) : (a = ni(s), a.c(), _e(a, 1), a.m(t, i)) : a && (Yn(), Te(a, 1, 1, () => { + 2 && _e(a, 1)) : (a = li(s), a.c(), _e(a, 1), a.m(t, i)) : a && (ei(), Ae(a, 1, 1, () => { a = null; - }), Jn()); + }), $n()); const f = {}; u & /*i18n*/ 8 && (f.label = /*i18n*/ s[3]("common.clear")), r.$set(f), (!l || u & /*absolute*/ - 4) && ei(t, "not-absolute", !/*absolute*/ + 4) && ii(t, "not-absolute", !/*absolute*/ s[2]), u & /*absolute*/ - 4 && Kn( + 4 && ti( t, "position", /*absolute*/ @@ -4749,16 +4782,16 @@ function Wa(e) { l || (_e(o), _e(a), _e(r.$$.fragment, s), l = !0); }, o(s) { - Te(o), Te(a), Te(r.$$.fragment, s), l = !1; + Ae(o), Ae(a), Ae(r.$$.fragment, s), l = !1; }, d(s) { - s && ja(t), o && o.d(), a && a.d(), wn(r); + s && nu(t), o && o.d(), a && a.d(), En(r); } }; } -function Qa(e, t, n) { +function uu(e, t, n) { let { editable: i = !1 } = t, { undoable: r = !1 } = t, { absolute: l = !0 } = t, { i18n: o } = t; - const a = Za(), s = () => a("edit"), u = () => a("undo"), f = (c) => { + const a = su(), s = () => a("edit"), u = () => a("undo"), f = (c) => { a("clear"), c.stopPropagation(); }; return e.$$set = (c) => { @@ -4774,9 +4807,9 @@ function Qa(e, t, n) { f ]; } -class Ja extends Fa { +class fu extends eu { constructor(t) { - super(), za(this, t, Qa, Wa, Xa, { + super(), ru(this, t, uu, au, ou, { editable: 0, undoable: 1, absolute: 2, @@ -4784,13 +4817,13 @@ class Ja extends Fa { }); } } -var ii = Object.prototype.hasOwnProperty; -function ri(e, t, n) { +var oi = Object.prototype.hasOwnProperty; +function si(e, t, n) { for (n of e.keys()) - if (Qe(n, t)) + if ($e(n, t)) return n; } -function Qe(e, t) { +function $e(e, t) { var n, i, r; if (e === t) return !0; @@ -4801,7 +4834,7 @@ function Qe(e, t) { return e.toString() === t.toString(); if (n === Array) { if ((i = e.length) === t.length) - for (; i-- && Qe(e[i], t[i]); ) + for (; i-- && $e(e[i], t[i]); ) ; return i === -1; } @@ -4809,7 +4842,7 @@ function Qe(e, t) { if (e.size !== t.size) return !1; for (i of e) - if (r = i, r && typeof r == "object" && (r = ri(t, r), !r) || !t.has(r)) + if (r = i, r && typeof r == "object" && (r = si(t, r), !r) || !t.has(r)) return !1; return !0; } @@ -4817,7 +4850,7 @@ function Qe(e, t) { if (e.size !== t.size) return !1; for (i of e) - if (r = i[0], r && typeof r == "object" && (r = ri(t, r), !r) || !Qe(i[1], t.get(r))) + if (r = i[0], r && typeof r == "object" && (r = si(t, r), !r) || !$e(i[1], t.get(r))) return !1; return !0; } @@ -4838,68 +4871,68 @@ function Qe(e, t) { if (!n || typeof e == "object") { i = 0; for (n in e) - if (ii.call(e, n) && ++i && !ii.call(t, n) || !(n in t) || !Qe(e[n], t[n])) + if (oi.call(e, n) && ++i && !oi.call(t, n) || !(n in t) || !$e(e[n], t[n])) return !1; return Object.keys(t).length === i; } } return e !== e && t !== t; } -async function Ya(e) { +async function cu(e) { return e ? `
${(await Promise.all( - e.map(async ([n, i]) => n === null || !n.url ? "" : await Lo(n.url, "url")) + e.map(async ([n, i]) => n === null || !n.url ? "" : await Xo(n.url, "url")) )).map((n) => ``).join("")}
` : ""; } const { - SvelteComponent: Ka, - add_iframe_resize_listener: $a, - add_render_callback: hr, - append: F, + SvelteComponent: hu, + add_iframe_resize_listener: _u, + add_render_callback: br, + append: j, attr: w, - binding_callbacks: li, - bubble: ve, - check_outros: Ke, - create_component: Fe, - destroy_component: xe, - destroy_each: _r, - detach: V, - element: U, - empty: eu, - ensure_array_like: vt, - globals: tu, - group_outros: $e, - init: nu, - insert: z, + binding_callbacks: ai, + bubble: we, + check_outros: ke, + create_component: Ie, + destroy_component: Le, + destroy_each: gr, + detach: X, + element: F, + empty: mu, + ensure_array_like: Et, + globals: du, + group_outros: Ce, + init: bu, + insert: Z, listen: le, - mount_component: je, - run_all: mr, - safe_not_equal: iu, - set_data: dr, - set_style: se, - space: ae, + mount_component: Ne, + run_all: pr, + safe_not_equal: gu, + set_data: vr, + set_style: ae, + space: re, src_url_equal: he, - text: br, + text: wr, toggle_class: ue, - transition_in: D, - transition_out: x -} = window.__gradio__svelte__internal, { window: gr } = tu, { createEventDispatcher: ru } = window.__gradio__svelte__internal, { tick: lu } = window.__gradio__svelte__internal; -function oi(e, t, n) { + transition_in: N, + transition_out: G +} = window.__gradio__svelte__internal, { window: yr } = du, { createEventDispatcher: pu, onMount: vu } = window.__gradio__svelte__internal, { tick: wu } = window.__gradio__svelte__internal; +function ui(e, t, n) { const i = e.slice(); - return i[45] = t[n], i[47] = n, i; + return i[47] = t[n], i[49] = n, i; } -function si(e, t, n) { +function fi(e, t, n) { const i = e.slice(); - return i[48] = t[n], i[49] = t, i[47] = n, i; + return i[50] = t[n], i[51] = t, i[49] = n, i; } -function ai(e) { +function ci(e) { let t, n; - return t = new ol({ + return t = new hl({ props: { show_label: ( /*show_label*/ e[1] ), - Icon: Ui, + Icon: ji, label: ( /*label*/ e[2] || "Gallery" @@ -4907,10 +4940,10 @@ function ai(e) { } }), { c() { - Fe(t.$$.fragment); + Ie(t.$$.fragment); }, m(i, r) { - je(t, i, r), n = !0; + Ne(t, i, r), n = !0; }, p(i, r) { const l = {}; @@ -4921,51 +4954,51 @@ function ai(e) { i[2] || "Gallery"), t.$set(l); }, i(i) { - n || (D(t.$$.fragment, i), n = !0); + n || (N(t.$$.fragment, i), n = !0); }, o(i) { - x(t.$$.fragment, i), n = !1; + G(t.$$.fragment, i), n = !1; }, d(i) { - xe(t, i); + Le(t, i); } }; } -function ou(e) { +function yu(e) { let t, n, i, r, l, o, a = ( /*selected_index*/ e[0] !== null && /*allow_preview*/ - e[7] && ui(e) + e[7] && hi(e) ), s = ( /*show_share_button*/ - e[9] && _i(e) - ), u = vt( + e[9] && gi(e) + ), u = Et( /*_value*/ e[12] ), f = []; for (let c = 0; c < u.length; c += 1) - f[c] = di(oi(e, u, c)); + f[c] = vi(ui(e, u, c)); return { c() { - a && a.c(), t = ae(), n = U("div"), i = U("div"), s && s.c(), r = ae(); + a && a.c(), t = re(), n = F("div"), i = F("div"), s && s.c(), r = re(); for (let c = 0; c < f.length; c += 1) f[c].c(); - w(i, "class", "grid-container svelte-1wl86it"), se( + w(i, "class", "grid-container svelte-16l5kkn"), ae( i, "--grid-cols", /*columns*/ e[4] - ), se( + ), ae( i, "--grid-rows", /*rows*/ e[5] - ), se( + ), ae( i, "--object-fit", /*object_fit*/ e[8] - ), se( + ), ae( i, "height", /*height*/ @@ -4975,68 +5008,68 @@ function ou(e) { "pt-6", /*show_label*/ e[1] - ), w(n, "class", "grid-wrap svelte-1wl86it"), hr(() => ( + ), w(n, "class", "grid-wrap svelte-16l5kkn"), br(() => ( /*div1_elementresize_handler*/ - e[40].call(n) + e[41].call(n) )), ue(n, "fixed-height", !/*height*/ e[6] || /*height*/ e[6] == "auto"); }, m(c, h) { - a && a.m(c, h), z(c, t, h), z(c, n, h), F(n, i), s && s.m(i, null), F(i, r); + a && a.m(c, h), Z(c, t, h), Z(c, n, h), j(n, i), s && s.m(i, null), j(i, r); for (let _ = 0; _ < f.length; _ += 1) f[_] && f[_].m(i, null); - l = $a( + l = _u( n, /*div1_elementresize_handler*/ - e[40].bind(n) + e[41].bind(n) ), o = !0; }, p(c, h) { if (/*selected_index*/ c[0] !== null && /*allow_preview*/ c[7] ? a ? (a.p(c, h), h[0] & /*selected_index, allow_preview*/ - 129 && D(a, 1)) : (a = ui(c), a.c(), D(a, 1), a.m(t.parentNode, t)) : a && ($e(), x(a, 1, 1, () => { + 129 && N(a, 1)) : (a = hi(c), a.c(), N(a, 1), a.m(t.parentNode, t)) : a && (Ce(), G(a, 1, 1, () => { a = null; - }), Ke()), /*show_share_button*/ + }), ke()), /*show_share_button*/ c[9] ? s ? (s.p(c, h), h[0] & /*show_share_button*/ - 512 && D(s, 1)) : (s = _i(c), s.c(), D(s, 1), s.m(i, r)) : s && ($e(), x(s, 1, 1, () => { + 512 && N(s, 1)) : (s = gi(c), s.c(), N(s, 1), s.m(i, r)) : s && (Ce(), G(s, 1, 1, () => { s = null; - }), Ke()), h[0] & /*_value, selected_index*/ + }), ke()), h[0] & /*_value, selected_index*/ 4097) { - u = vt( + u = Et( /*_value*/ c[12] ); let _; for (_ = 0; _ < u.length; _ += 1) { - const b = oi(c, u, _); - f[_] ? f[_].p(b, h) : (f[_] = di(b), f[_].c(), f[_].m(i, null)); + const g = ui(c, u, _); + f[_] ? f[_].p(g, h) : (f[_] = vi(g), f[_].c(), f[_].m(i, null)); } for (; _ < f.length; _ += 1) f[_].d(1); f.length = u.length; } (!o || h[0] & /*columns*/ - 16) && se( + 16) && ae( i, "--grid-cols", /*columns*/ c[4] ), (!o || h[0] & /*rows*/ - 32) && se( + 32) && ae( i, "--grid-rows", /*rows*/ c[5] ), (!o || h[0] & /*object_fit*/ - 256) && se( + 256) && ae( i, "--object-fit", /*object_fit*/ c[8] ), (!o || h[0] & /*height*/ - 64) && se( + 64) && ae( i, "height", /*height*/ @@ -5053,55 +5086,55 @@ function ou(e) { c[6] == "auto"); }, i(c) { - o || (D(a), D(s), o = !0); + o || (N(a), N(s), o = !0); }, o(c) { - x(a), x(s), o = !1; + G(a), G(s), o = !1; }, d(c) { - c && (V(t), V(n)), a && a.d(c), s && s.d(), _r(f, c), l(); + c && (X(t), X(n)), a && a.d(c), s && s.d(), gr(f, c), l(); } }; } -function su(e) { +function Eu(e) { let t, n; - return t = new Ul({ + return t = new ql({ props: { unpadded_box: !0, size: "large", - $$slots: { default: [hu] }, + $$slots: { default: [Bu] }, $$scope: { ctx: e } } }), { c() { - Fe(t.$$.fragment); + Ie(t.$$.fragment); }, m(i, r) { - je(t, i, r), n = !0; + Ne(t, i, r), n = !0; }, p(i, r) { const l = {}; r[1] & /*$$scope*/ - 524288 && (l.$$scope = { dirty: r, ctx: i }), t.$set(l); + 2097152 && (l.$$scope = { dirty: r, ctx: i }), t.$set(l); }, i(i) { - n || (D(t.$$.fragment, i), n = !0); + n || (N(t.$$.fragment, i), n = !0); }, o(i) { - x(t.$$.fragment, i), n = !1; + G(t.$$.fragment, i), n = !1; }, d(i) { - xe(t, i); + Le(t, i); } }; } -function ui(e) { - var m; +function hi(e) { + var T; let t, n, i, r, l, o, a, s, u, f, c, h = ( /*show_download_button*/ - e[10] && fi(e) + e[10] && _i(e) ); - r = new Ja({ + r = new fu({ props: { i18n: ( /*i18n*/ e[11] @@ -5109,93 +5142,104 @@ function ui(e) { }), r.$on( "clear", /*clear_handler*/ - e[32] + e[33] ); - function _(g, p) { + function _(b, I) { return ( /*_value*/ - g[12][ + b[12][ /*selected_index*/ - g[0] - ].image.mime_type === "video/mp4" ? uu : au + b[0] + ].image.mime_type === "video/mp4" ? Tu : Su ); } - let b = _(e), T = b(e), y = ( + let g = _(e), S = g(e), v = ( /*_value*/ - ((m = e[12][ + ((T = e[12][ /*selected_index*/ e[0] - ]) == null ? void 0 : m.caption) && ci(e) - ), C = vt( + ]) == null ? void 0 : T.caption) && mi(e) + ), A = Et( /*_value*/ e[12] - ), E = []; - for (let g = 0; g < C.length; g += 1) - E[g] = hi(si(e, C, g)); + ), y = []; + for (let b = 0; b < A.length; b += 1) + y[b] = bi(fi(e, A, b)); + const d = (b) => G(y[b], 1, 1, () => { + y[b] = null; + }); return { c() { - t = U("button"), n = U("div"), h && h.c(), i = ae(), Fe(r.$$.fragment), l = ae(), T.c(), o = ae(), y && y.c(), a = ae(), s = U("div"); - for (let g = 0; g < E.length; g += 1) - E[g].c(); - w(n, "class", "icon-buttons svelte-1wl86it"), w(s, "class", "thumbnails scroll-hide svelte-1wl86it"), w(s, "data-testid", "container_el"), w(t, "class", "preview svelte-1wl86it"); - }, - m(g, p) { - z(g, t, p), F(t, n), h && h.m(n, null), F(n, i), je(r, n, null), F(t, l), T.m(t, null), F(t, o), y && y.m(t, null), F(t, a), F(t, s); - for (let N = 0; N < E.length; N += 1) - E[N] && E[N].m(s, null); - e[36](s), u = !0, f || (c = le( + t = F("button"), n = F("div"), h && h.c(), i = re(), Ie(r.$$.fragment), l = re(), S.c(), o = re(), v && v.c(), a = re(), s = F("div"); + for (let b = 0; b < y.length; b += 1) + y[b].c(); + w(n, "class", "icon-buttons svelte-16l5kkn"), w(s, "class", "thumbnails scroll-hide svelte-16l5kkn"), w(s, "data-testid", "container_el"), w(t, "class", "preview svelte-16l5kkn"); + }, + m(b, I) { + Z(b, t, I), j(t, n), h && h.m(n, null), j(n, i), Ne(r, n, null), j(t, l), S.m(t, null), j(t, o), v && v.m(t, null), j(t, a), j(t, s); + for (let M = 0; M < y.length; M += 1) + y[M] && y[M].m(s, null); + e[37](s), u = !0, f || (c = le( t, "keydown", /*on_keydown*/ - e[18] + e[19] ), f = !0); }, - p(g, p) { - var G; + p(b, I) { + var U; /*show_download_button*/ - g[10] ? h ? (h.p(g, p), p[0] & /*show_download_button*/ - 1024 && D(h, 1)) : (h = fi(g), h.c(), D(h, 1), h.m(n, i)) : h && ($e(), x(h, 1, 1, () => { + b[10] ? h ? (h.p(b, I), I[0] & /*show_download_button*/ + 1024 && N(h, 1)) : (h = _i(b), h.c(), N(h, 1), h.m(n, i)) : h && (Ce(), G(h, 1, 1, () => { h = null; - }), Ke()); - const N = {}; - if (p[0] & /*i18n*/ - 2048 && (N.i18n = /*i18n*/ - g[11]), r.$set(N), b === (b = _(g)) && T ? T.p(g, p) : (T.d(1), T = b(g), T && (T.c(), T.m(t, o))), /*_value*/ - (G = g[12][ + }), ke()); + const M = {}; + if (I[0] & /*i18n*/ + 2048 && (M.i18n = /*i18n*/ + b[11]), r.$set(M), g === (g = _(b)) && S ? S.p(b, I) : (S.d(1), S = g(b), S && (S.c(), S.m(t, o))), /*_value*/ + (U = b[12][ /*selected_index*/ - g[0] - ]) != null && G.caption ? y ? y.p(g, p) : (y = ci(g), y.c(), y.m(t, a)) : y && (y.d(1), y = null), p[0] & /*_value, el, selected_index*/ - 12289) { - C = vt( + b[0] + ]) != null && U.caption ? v ? v.p(b, I) : (v = mi(b), v.c(), v.m(t, a)) : v && (v.d(1), v = null), I[0] & /*_value, el, selected_index, thumbnailUrl*/ + 28673) { + A = Et( /*_value*/ - g[12] + b[12] ); - let L; - for (L = 0; L < C.length; L += 1) { - const Z = si(g, C, L); - E[L] ? E[L].p(Z, p) : (E[L] = hi(Z), E[L].c(), E[L].m(s, null)); + let O; + for (O = 0; O < A.length; O += 1) { + const V = fi(b, A, O); + y[O] ? (y[O].p(V, I), N(y[O], 1)) : (y[O] = bi(V), y[O].c(), N(y[O], 1), y[O].m(s, null)); } - for (; L < E.length; L += 1) - E[L].d(1); - E.length = C.length; + for (Ce(), O = A.length; O < y.length; O += 1) + d(O); + ke(); } }, - i(g) { - u || (D(h), D(r.$$.fragment, g), u = !0); + i(b) { + if (!u) { + N(h), N(r.$$.fragment, b); + for (let I = 0; I < A.length; I += 1) + N(y[I]); + u = !0; + } }, - o(g) { - x(h), x(r.$$.fragment, g), u = !1; + o(b) { + G(h), G(r.$$.fragment, b), y = y.filter(Boolean); + for (let I = 0; I < y.length; I += 1) + G(y[I]); + u = !1; }, - d(g) { - g && V(t), h && h.d(), xe(r), T.d(), y && y.d(), _r(E, g), e[36](null), f = !1, c(); + d(b) { + b && X(t), h && h.d(), Le(r), S.d(), v && v.d(), gr(y, b), e[37](null), f = !1, c(); } }; } -function fi(e) { +function _i(e) { let t, n, i, r; - return n = new et({ + return n = new nt({ props: { - Icon: so, + Icon: _o, label: ( /*i18n*/ e[11]("common.download") @@ -5203,23 +5247,23 @@ function fi(e) { } }), { c() { - t = U("a"), Fe(n.$$.fragment), w(t, "href", i = an( + t = F("a"), Ie(n.$$.fragment), w(t, "href", i = fn( /*value*/ e[3][ /*selected_index*/ e[0] ] - )), w(t, "target", window.__is_colab__ ? "_blank" : null), w(t, "download", "image"), w(t, "class", "svelte-1wl86it"); + )), w(t, "target", window.__is_colab__ ? "_blank" : null), w(t, "download", "image"), w(t, "class", "svelte-16l5kkn"); }, m(l, o) { - z(l, t, o), je(n, t, null), r = !0; + Z(l, t, o), Ne(n, t, null), r = !0; }, p(l, o) { const a = {}; o[0] & /*i18n*/ 2048 && (a.label = /*i18n*/ l[11]("common.download")), n.$set(a), (!r || o[0] & /*value, selected_index*/ - 9 && i !== (i = an( + 9 && i !== (i = fn( /*value*/ l[3][ /*selected_index*/ @@ -5228,21 +5272,21 @@ function fi(e) { ))) && w(t, "href", i); }, i(l) { - r || (D(n.$$.fragment, l), r = !0); + r || (N(n.$$.fragment, l), r = !0); }, o(l) { - x(n.$$.fragment, l), r = !1; + G(n.$$.fragment, l), r = !1; }, d(l) { - l && V(t), xe(n); + l && X(t), Le(n); } }; } -function au(e) { +function Su(e) { let t, n, i, r, l, o, a; return { c() { - t = U("button"), n = U("img"), w(n, "data-testid", "detailed-image"), he(n.src, i = /*_value*/ + t = F("button"), n = F("img"), w(n, "data-testid", "detailed-image"), he(n.src, i = /*_value*/ e[12][ /*selected_index*/ e[0] @@ -5254,22 +5298,22 @@ function au(e) { e[12][ /*selected_index*/ e[0] - ].caption || null), w(n, "loading", "lazy"), w(n, "class", "svelte-1wl86it"), ue(n, "with-caption", !!/*_value*/ + ].caption || null), w(n, "loading", "lazy"), w(n, "class", "svelte-16l5kkn"), ue(n, "with-caption", !!/*_value*/ e[12][ /*selected_index*/ e[0] - ].caption), w(t, "class", "image-button svelte-1wl86it"), se(t, "height", "calc(100% - " + /*_value*/ + ].caption), w(t, "class", "image-button svelte-16l5kkn"), ae(t, "height", "calc(100% - " + /*_value*/ (e[12][ /*selected_index*/ e[0] ].caption ? "80px" : "60px") + ")"), w(t, "aria-label", "detailed view of selected image"); }, m(s, u) { - z(s, t, u), F(t, n), o || (a = le( + Z(s, t, u), j(t, n), o || (a = le( t, "click", /*click_handler*/ - e[33] + e[34] ), o = !0); }, p(s, u) { @@ -5294,22 +5338,22 @@ function au(e) { /*selected_index*/ s[0] ].caption), u[0] & /*_value, selected_index*/ - 4097 && se(t, "height", "calc(100% - " + /*_value*/ + 4097 && ae(t, "height", "calc(100% - " + /*_value*/ (s[12][ /*selected_index*/ s[0] ].caption ? "80px" : "60px") + ")"); }, d(s) { - s && V(t), o = !1, a(); + s && X(t), o = !1, a(); } }; } -function uu(e) { +function Tu(e) { let t, n, i, r, l, o; return { c() { - t = U("video"), n = U("track"), w(n, "kind", "captions"), w(t, "class", "detailed-video svelte-1wl86it"), w(t, "data-testid", "detailed-video"), t.controls = !0, he(t.src, i = /*_value*/ + t = F("video"), n = F("track"), w(n, "kind", "captions"), w(t, "class", "detailed-video svelte-16l5kkn"), w(t, "data-testid", "detailed-video"), t.controls = !0, he(t.src, i = /*_value*/ e[12][ /*selected_index*/ e[0] @@ -5320,24 +5364,24 @@ function uu(e) { ].image.alt_text), w(t, "preload", "auto"); }, m(a, s) { - z(a, t, s), F(t, n), l || (o = [ + Z(a, t, s), j(t, n), l || (o = [ le( t, "play", /*play_handler*/ - e[28] + e[29] ), le( t, "pause", /*pause_handler*/ - e[29] + e[30] ), le( t, "ended", /*ended_handler*/ - e[30] + e[31] ) ], l = !0); }, @@ -5355,11 +5399,11 @@ function uu(e) { ].image.alt_text) && w(t, "title", r); }, d(a) { - a && V(t), l = !1, mr(o); + a && X(t), l = !1, pr(o); } }; } -function ci(e) { +function mi(e) { let t, n = ( /*_value*/ e[12][ @@ -5369,10 +5413,10 @@ function ci(e) { ), i; return { c() { - t = U("caption"), i = br(n), w(t, "class", "caption svelte-1wl86it"); + t = F("caption"), i = wr(n), w(t, "class", "caption svelte-16l5kkn"); }, m(r, l) { - z(r, t, l), F(t, i); + Z(r, t, l), j(t, i); }, p(r, l) { l[0] & /*_value, selected_index*/ @@ -5380,79 +5424,112 @@ function ci(e) { r[12][ /*selected_index*/ r[0] - ].caption + "") && dr(i, n); + ].caption + "") && vr(i, n); }, d(r) { - r && V(t); + r && X(t); } }; } -function hi(e) { - let t, n, i, r, l, o, a = ( +function di(e) { + let t, n, i; + return n = new Ro({}), { + c() { + t = F("div"), Ie(n.$$.fragment), w(t, "class", "thumbnail-play svelte-16l5kkn"); + }, + m(r, l) { + Z(r, t, l), Ne(n, t, null), i = !0; + }, + i(r) { + i || (N(n.$$.fragment, r), i = !0); + }, + o(r) { + G(n.$$.fragment, r), i = !1; + }, + d(r) { + r && X(t), Le(n); + } + }; +} +function bi(e) { + let t, n, i, r, l, o, a, s = ( /*i*/ - e[47] - ), s, u; - const f = () => ( + e[49] + ), u, f, c, h = ( + /*media*/ + e[50].image.mime_type === "video/mp4" && di() + ); + const _ = () => ( /*button_binding*/ - e[34](t, a) - ), c = () => ( + e[35](t, s) + ), g = () => ( /*button_binding*/ - e[34](null, a) + e[35](null, s) ); - function h() { + function S() { return ( /*click_handler_1*/ - e[35]( + e[36]( /*i*/ - e[47] + e[49] ) ); } return { c() { - t = U("button"), n = U("img"), l = ae(), he(n.src, i = /*media*/ - e[48].image.url) || w(n, "src", i), w(n, "title", r = /*media*/ - e[48].caption || null), w(n, "data-testid", "thumbnail " + /*i*/ - (e[47] + 1)), w(n, "alt", ""), w(n, "loading", "lazy"), w(n, "class", "svelte-1wl86it"), w(t, "class", "thumbnail-item thumbnail-small svelte-1wl86it"), w(t, "aria-label", o = "Thumbnail " + /*i*/ - (e[47] + 1) + " of " + /*_value*/ + t = F("button"), n = F("img"), l = re(), h && h.c(), o = re(), he(n.src, i = /*thumbnailUrl*/ + e[13]) || w(n, "src", i), w(n, "title", r = /*media*/ + e[50].caption || null), w(n, "data-testid", "thumbnail " + /*i*/ + (e[49] + 1)), w(n, "alt", ""), w(n, "loading", "lazy"), w(n, "class", "svelte-16l5kkn"), w(t, "class", "thumbnail-item thumbnail-small svelte-16l5kkn"), w(t, "aria-label", a = "Thumbnail " + /*i*/ + (e[49] + 1) + " of " + /*_value*/ e[12].length), ue( t, "selected", /*selected_index*/ e[0] === /*i*/ - e[47] + e[49] ); }, - m(_, b) { - z(_, t, b), F(t, n), F(t, l), f(), s || (u = le(t, "click", h), s = !0); + m(v, A) { + Z(v, t, A), j(t, n), j(t, l), h && h.m(t, null), j(t, o), _(), u = !0, f || (c = le(t, "click", S), f = !0); }, - p(_, b) { - e = _, b[0] & /*_value*/ - 4096 && !he(n.src, i = /*media*/ - e[48].image.url) && w(n, "src", i), b[0] & /*_value*/ + p(v, A) { + e = v, (!u || A[0] & /*thumbnailUrl*/ + 8192 && !he(n.src, i = /*thumbnailUrl*/ + e[13])) && w(n, "src", i), (!u || A[0] & /*_value*/ 4096 && r !== (r = /*media*/ - e[48].caption || null) && w(n, "title", r), b[0] & /*_value*/ - 4096 && o !== (o = "Thumbnail " + /*i*/ - (e[47] + 1) + " of " + /*_value*/ - e[12].length) && w(t, "aria-label", o), a !== /*i*/ - e[47] && (c(), a = /*i*/ - e[47], f()), b[0] & /*selected_index*/ - 1 && ue( + e[50].caption || null)) && w(n, "title", r), /*media*/ + e[50].image.mime_type === "video/mp4" ? h ? A[0] & /*_value*/ + 4096 && N(h, 1) : (h = di(), h.c(), N(h, 1), h.m(t, o)) : h && (Ce(), G(h, 1, 1, () => { + h = null; + }), ke()), (!u || A[0] & /*_value*/ + 4096 && a !== (a = "Thumbnail " + /*i*/ + (e[49] + 1) + " of " + /*_value*/ + e[12].length)) && w(t, "aria-label", a), s !== /*i*/ + e[49] && (g(), s = /*i*/ + e[49], _()), (!u || A[0] & /*selected_index*/ + 1) && ue( t, "selected", /*selected_index*/ e[0] === /*i*/ - e[47] + e[49] ); }, - d(_) { - _ && V(t), c(), s = !1, u(); + i(v) { + u || (N(h), u = !0); + }, + o(v) { + G(h), u = !1; + }, + d(v) { + v && X(t), h && h.d(), g(), f = !1, c(); } }; } -function _i(e) { +function gi(e) { let t, n, i; - return n = new qo({ + return n = new ls({ props: { i18n: ( /*i18n*/ @@ -5462,22 +5539,22 @@ function _i(e) { /*_value*/ e[12] ), - formatter: Ya + formatter: cu } }), n.$on( "share", /*share_handler*/ - e[37] + e[38] ), n.$on( "error", /*error_handler*/ - e[38] + e[39] ), { c() { - t = U("div"), Fe(n.$$.fragment), w(t, "class", "icon-button svelte-1wl86it"); + t = F("div"), Ie(n.$$.fragment), w(t, "class", "icon-button svelte-16l5kkn"); }, m(r, l) { - z(r, t, l), je(n, t, null), i = !0; + Z(r, t, l), Ne(n, t, null), i = !0; }, p(r, l) { const o = {}; @@ -5488,201 +5565,201 @@ function _i(e) { r[12]), n.$set(o); }, i(r) { - i || (D(n.$$.fragment, r), i = !0); + i || (N(n.$$.fragment, r), i = !0); }, o(r) { - x(n.$$.fragment, r), i = !1; + G(n.$$.fragment, r), i = !1; }, d(r) { - r && V(t), xe(n); + r && X(t), Le(n); } }; } -function fu(e) { +function Au(e) { let t, n, i; return { c() { - t = U("img"), w(t, "alt", n = /*entry*/ - e[45].caption || ""), he(t.src, i = typeof /*entry*/ - e[45].image == "string" ? ( + t = F("img"), w(t, "alt", n = /*entry*/ + e[47].caption || ""), he(t.src, i = typeof /*entry*/ + e[47].image == "string" ? ( /*entry*/ - e[45].image + e[47].image ) : ( /*entry*/ - e[45].image.url - )) || w(t, "src", i), w(t, "loading", "lazy"), w(t, "class", "svelte-1wl86it"); + e[47].image.url + )) || w(t, "src", i), w(t, "loading", "lazy"), w(t, "class", "svelte-16l5kkn"); }, m(r, l) { - z(r, t, l); + Z(r, t, l); }, p(r, l) { l[0] & /*_value*/ 4096 && n !== (n = /*entry*/ - r[45].caption || "") && w(t, "alt", n), l[0] & /*_value*/ + r[47].caption || "") && w(t, "alt", n), l[0] & /*_value*/ 4096 && !he(t.src, i = typeof /*entry*/ - r[45].image == "string" ? ( + r[47].image == "string" ? ( /*entry*/ - r[45].image + r[47].image ) : ( /*entry*/ - r[45].image.url + r[47].image.url )) && w(t, "src", i); }, d(r) { - r && V(t); + r && X(t); } }; } -function cu(e) { +function Hu(e) { let t, n, i, r, l, o; return { c() { - t = U("video"), n = U("track"), w(n, "kind", "captions"), w(t, "class", "detailed-video svelte-1wl86it"), w(t, "data-testid", "detailed-video"), t.controls = !0, he(t.src, i = /*entry*/ - e[45].image.path) || w(t, "src", i), w(t, "title", r = /*entry*/ - e[45].image.alt_text), w(t, "preload", "auto"); + t = F("video"), n = F("track"), w(n, "kind", "captions"), w(t, "class", "detailed-video svelte-16l5kkn"), w(t, "data-testid", "detailed-video"), t.controls = !0, he(t.src, i = /*entry*/ + e[47].image.path) || w(t, "src", i), w(t, "title", r = /*entry*/ + e[47].image.alt_text), w(t, "preload", "auto"); }, m(a, s) { - z(a, t, s), F(t, n), l || (o = [ + Z(a, t, s), j(t, n), l || (o = [ le( t, "play", /*play_handler_1*/ - e[25] + e[26] ), le( t, "pause", /*pause_handler_1*/ - e[26] + e[27] ), le( t, "ended", /*ended_handler_1*/ - e[27] + e[28] ) ], l = !0); }, p(a, s) { s[0] & /*_value*/ 4096 && !he(t.src, i = /*entry*/ - a[45].image.path) && w(t, "src", i), s[0] & /*_value*/ + a[47].image.path) && w(t, "src", i), s[0] & /*_value*/ 4096 && r !== (r = /*entry*/ - a[45].image.alt_text) && w(t, "title", r); + a[47].image.alt_text) && w(t, "title", r); }, d(a) { - a && V(t), l = !1, mr(o); + a && X(t), l = !1, pr(o); } }; } -function mi(e) { +function pi(e) { let t, n = ( /*entry*/ - e[45].caption + "" + e[47].caption + "" ), i; return { c() { - t = U("div"), i = br(n), w(t, "class", "caption-label svelte-1wl86it"); + t = F("div"), i = wr(n), w(t, "class", "caption-label svelte-16l5kkn"); }, m(r, l) { - z(r, t, l), F(t, i); + Z(r, t, l), j(t, i); }, p(r, l) { l[0] & /*_value*/ 4096 && n !== (n = /*entry*/ - r[45].caption + "") && dr(i, n); + r[47].caption + "") && vr(i, n); }, d(r) { - r && V(t); + r && X(t); } }; } -function di(e) { +function vi(e) { let t, n, i, r, l, o; function a(h, _) { return ( /*entry*/ - h[45].image.mime_type === "video/mp4" ? cu : fu + h[47].image.mime_type === "video/mp4" ? Hu : Au ); } let s = a(e), u = s(e), f = ( /*entry*/ - e[45].caption && mi(e) + e[47].caption && pi(e) ); function c() { return ( /*click_handler_2*/ - e[39]( + e[40]( /*i*/ - e[47] + e[49] ) ); } return { c() { - t = U("button"), u.c(), n = ae(), f && f.c(), i = ae(), w(t, "class", "thumbnail-item thumbnail-lg svelte-1wl86it"), w(t, "aria-label", r = "Thumbnail " + /*i*/ - (e[47] + 1) + " of " + /*_value*/ + t = F("button"), u.c(), n = re(), f && f.c(), i = re(), w(t, "class", "thumbnail-item thumbnail-lg svelte-16l5kkn"), w(t, "aria-label", r = "Thumbnail " + /*i*/ + (e[49] + 1) + " of " + /*_value*/ e[12].length), ue( t, "selected", /*selected_index*/ e[0] === /*i*/ - e[47] + e[49] ); }, m(h, _) { - z(h, t, _), u.m(t, null), F(t, n), f && f.m(t, null), F(t, i), l || (o = le(t, "click", c), l = !0); + Z(h, t, _), u.m(t, null), j(t, n), f && f.m(t, null), j(t, i), l || (o = le(t, "click", c), l = !0); }, p(h, _) { e = h, s === (s = a(e)) && u ? u.p(e, _) : (u.d(1), u = s(e), u && (u.c(), u.m(t, n))), /*entry*/ - e[45].caption ? f ? f.p(e, _) : (f = mi(e), f.c(), f.m(t, i)) : f && (f.d(1), f = null), _[0] & /*_value*/ + e[47].caption ? f ? f.p(e, _) : (f = pi(e), f.c(), f.m(t, i)) : f && (f.d(1), f = null), _[0] & /*_value*/ 4096 && r !== (r = "Thumbnail " + /*i*/ - (e[47] + 1) + " of " + /*_value*/ + (e[49] + 1) + " of " + /*_value*/ e[12].length) && w(t, "aria-label", r), _[0] & /*selected_index*/ 1 && ue( t, "selected", /*selected_index*/ e[0] === /*i*/ - e[47] + e[49] ); }, d(h) { - h && V(t), u.d(), f && f.d(), l = !1, o(); + h && X(t), u.d(), f && f.d(), l = !1, o(); } }; } -function hu(e) { +function Bu(e) { let t, n; - return t = new Ui({}), { + return t = new ji({}), { c() { - Fe(t.$$.fragment); + Ie(t.$$.fragment); }, m(i, r) { - je(t, i, r), n = !0; + Ne(t, i, r), n = !0; }, i(i) { - n || (D(t.$$.fragment, i), n = !0); + n || (N(t.$$.fragment, i), n = !0); }, o(i) { - x(t.$$.fragment, i), n = !1; + G(t.$$.fragment, i), n = !1; }, d(i) { - xe(t, i); + Le(t, i); } }; } -function _u(e) { +function ku(e) { let t, n, i, r, l, o, a; - hr( + br( /*onwindowresize*/ - e[31] + e[32] ); let s = ( /*show_label*/ - e[1] && ai(e) + e[1] && ci(e) ); - const u = [su, ou], f = []; + const u = [Eu, yu], f = []; function c(h, _) { return ( /*value*/ @@ -5693,42 +5770,42 @@ function _u(e) { } return n = c(e), i = f[n] = u[n](e), { c() { - s && s.c(), t = ae(), i.c(), r = eu(); + s && s.c(), t = re(), i.c(), r = mu(); }, m(h, _) { - s && s.m(h, _), z(h, t, _), f[n].m(h, _), z(h, r, _), l = !0, o || (a = le( - gr, + s && s.m(h, _), Z(h, t, _), f[n].m(h, _), Z(h, r, _), l = !0, o || (a = le( + yr, "resize", /*onwindowresize*/ - e[31] + e[32] ), o = !0); }, p(h, _) { /*show_label*/ h[1] ? s ? (s.p(h, _), _[0] & /*show_label*/ - 2 && D(s, 1)) : (s = ai(h), s.c(), D(s, 1), s.m(t.parentNode, t)) : s && ($e(), x(s, 1, 1, () => { + 2 && N(s, 1)) : (s = ci(h), s.c(), N(s, 1), s.m(t.parentNode, t)) : s && (Ce(), G(s, 1, 1, () => { s = null; - }), Ke()); - let b = n; - n = c(h), n === b ? f[n].p(h, _) : ($e(), x(f[b], 1, 1, () => { - f[b] = null; - }), Ke(), i = f[n], i ? i.p(h, _) : (i = f[n] = u[n](h), i.c()), D(i, 1), i.m(r.parentNode, r)); + }), ke()); + let g = n; + n = c(h), n === g ? f[n].p(h, _) : (Ce(), G(f[g], 1, 1, () => { + f[g] = null; + }), ke(), i = f[n], i ? i.p(h, _) : (i = f[n] = u[n](h), i.c()), N(i, 1), i.m(r.parentNode, r)); }, i(h) { - l || (D(s), D(i), l = !0); + l || (N(s), N(i), l = !0); }, o(h) { - x(s), x(i), l = !1; + G(s), G(i), l = !1; }, d(h) { - h && (V(t), V(r)), s && s.d(h), f[n].d(h), o = !1, a(); + h && (X(t), X(r)), s && s.d(h), f[n].d(h), o = !1, a(); } }; } -function We(e, t) { +function Ke(e, t) { return e ?? t(); } -function Ee(e) { +function Se(e) { let t, n = e[0], i = 1; for (; i < e.length; ) { const r = e[i], l = e[i + 1]; @@ -5738,180 +5815,193 @@ function Ee(e) { } return n; } -function mu(e) { +function Cu(e) { return typeof e == "object" && e !== null && "data" in e; } -function an(e) { - return mu(e) ? e.path : typeof e == "string" ? e : Array.isArray(e) ? an(e[0]) : ""; -} -function du(e, t, n) { - let i, r, { show_label: l = !0 } = t, { label: o } = t, { root: a = "" } = t, { proxy_url: s = null } = t, { value: u = null } = t, { columns: f = [2] } = t, { rows: c = void 0 } = t, { height: h = "auto" } = t, { preview: _ } = t, { allow_preview: b = !0 } = t, { object_fit: T = "cover" } = t, { show_share_button: y = !1 } = t, { show_download_button: C = !1 } = t, { i18n: E } = t, { selected_index: m = null } = t; - const g = ru(); - let p = !0, N = null, G = u; - m === null && _ && Ee([u, "optionalAccess", (d) => d.length]) && (m = 0); - let L = m; - function Z(d) { - const ze = d.target, Ct = d.clientX, Pt = ze.offsetWidth / 2; - Ct < Pt ? n(0, m = i) : n(0, m = r); +function fn(e) { + return Cu(e) ? e.path : typeof e == "string" ? e : Array.isArray(e) ? fn(e[0]) : ""; +} +function Pu(e, t, n) { + let i, r, { show_label: l = !0 } = t, { label: o } = t, { root: a = "" } = t, { proxy_url: s = null } = t, { value: u = null } = t, { columns: f = [2] } = t, { rows: c = void 0 } = t, { height: h = "auto" } = t, { preview: _ } = t, { allow_preview: g = !0 } = t, { object_fit: S = "cover" } = t, { show_share_button: v = !1 } = t, { show_download_button: A = !1 } = t, { i18n: y } = t, { selected_index: d = null } = t, T = ""; + const b = pu(); + vu(() => { + const m = document.createElement("video"); + m.style.position = "absolute", m.style.left = "-9999px", m.src = u[0].image.url, m.crossOrigin = "anonymous", m.muted = !0, m.addEventListener("loadedmetadata", () => { + m.currentTime = 0.1; + }), m.addEventListener("seeked", () => { + I(m); + }), document.body.appendChild(m), m.load(); + }); + function I(m) { + const J = document.createElement("canvas"); + J.width = m.videoWidth, J.height = m.videoHeight, J.getContext("2d").drawImage(m, 0, 0, J.width, J.height), n(13, T = J.toDataURL("image/jpeg")), document.body.removeChild(m); + } + let M = !0, U = null, O = u; + d === null && _ && Se([u, "optionalAccess", (m) => m.length]) && (d = 0); + let V = d; + function de(m) { + const J = m.target, ft = m.clientX, Pt = J.offsetWidth / 2; + ft < Pt ? n(0, d = i) : n(0, d = r); } - function K(d) { - switch (d.code) { + function Oe(m) { + switch (m.code) { case "Escape": - d.preventDefault(), n(0, m = null); + m.preventDefault(), n(0, d = null); break; case "ArrowLeft": - d.preventDefault(), n(0, m = i); + m.preventDefault(), n(0, d = i); break; case "ArrowRight": - d.preventDefault(), n(0, m = r); + m.preventDefault(), n(0, d = r); break; } } - let W = [], q; - async function $(d) { - if (typeof d != "number" || (await lu(), W[d] === void 0)) + let q = [], z; + async function p(m) { + if (typeof m != "number" || (await wu(), q[m] === void 0)) return; - Ee([ - W, + Se([ + q, "access", - (qe) => qe[d], + (Qe) => Qe[m], "optionalAccess", - (qe) => qe.focus, + (Qe) => Qe.focus, "call", - (qe) => qe() + (Qe) => Qe() ]); - const { left: ze, width: Ct } = q.getBoundingClientRect(), { left: En, width: Pt } = W[d].getBoundingClientRect(), Sn = En - ze + Pt / 2 - Ct / 2 + q.scrollLeft; - q && typeof q.scrollTo == "function" && q.scrollTo({ - left: Sn < 0 ? 0 : Sn, + const { left: J, width: ft } = z.getBoundingClientRect(), { left: Tn, width: Pt } = q[m].getBoundingClientRect(), An = Tn - J + Pt / 2 - ft / 2 + z.scrollLeft; + z && typeof z.scrollTo == "function" && z.scrollTo({ + left: An < 0 ? 0 : An, behavior: "smooth" }); } - let ee = 0, v = 0; - function rt(d) { - ve.call(this, e, d); + let Me = 0, ot = 0; + function st(m) { + we.call(this, e, m); } - function At(d) { - ve.call(this, e, d); + function at(m) { + we.call(this, e, m); } - function lt(d) { - ve.call(this, e, d); + function ut(m) { + we.call(this, e, m); } - function ot(d) { - ve.call(this, e, d); + function kt(m) { + we.call(this, e, m); } - function st(d) { - ve.call(this, e, d); + function Ct(m) { + we.call(this, e, m); } - function Ht(d) { - ve.call(this, e, d); + function E(m) { + we.call(this, e, m); } - function Bt() { - n(16, v = gr.innerHeight); + function Ar() { + n(17, ot = yr.innerHeight); } - const S = () => n(0, m = null), yr = (d) => Z(d); - function Er(d, ze) { - li[d ? "unshift" : "push"](() => { - W[ze] = d, n(13, W); + const Hr = () => n(0, d = null), Br = (m) => de(m); + function kr(m, J) { + ai[m ? "unshift" : "push"](() => { + q[J] = m, n(14, q); }); } - const Sr = (d) => n(0, m = d); - function Tr(d) { - li[d ? "unshift" : "push"](() => { - q = d, n(14, q); + const Cr = (m) => n(0, d = m); + function Pr(m) { + ai[m ? "unshift" : "push"](() => { + z = m, n(15, z); }); } - function Ar(d) { - ve.call(this, e, d); + function Ir(m) { + we.call(this, e, m); } - function Hr(d) { - ve.call(this, e, d); + function Lr(m) { + we.call(this, e, m); } - const Br = (d) => n(0, m = d); - function Cr() { - ee = this.clientHeight, n(15, ee); + const Nr = (m) => n(0, d = m); + function Or() { + Me = this.clientHeight, n(16, Me); } - return e.$$set = (d) => { - "show_label" in d && n(1, l = d.show_label), "label" in d && n(2, o = d.label), "root" in d && n(19, a = d.root), "proxy_url" in d && n(20, s = d.proxy_url), "value" in d && n(3, u = d.value), "columns" in d && n(4, f = d.columns), "rows" in d && n(5, c = d.rows), "height" in d && n(6, h = d.height), "preview" in d && n(21, _ = d.preview), "allow_preview" in d && n(7, b = d.allow_preview), "object_fit" in d && n(8, T = d.object_fit), "show_share_button" in d && n(9, y = d.show_share_button), "show_download_button" in d && n(10, C = d.show_download_button), "i18n" in d && n(11, E = d.i18n), "selected_index" in d && n(0, m = d.selected_index); + return e.$$set = (m) => { + "show_label" in m && n(1, l = m.show_label), "label" in m && n(2, o = m.label), "root" in m && n(20, a = m.root), "proxy_url" in m && n(21, s = m.proxy_url), "value" in m && n(3, u = m.value), "columns" in m && n(4, f = m.columns), "rows" in m && n(5, c = m.rows), "height" in m && n(6, h = m.height), "preview" in m && n(22, _ = m.preview), "allow_preview" in m && n(7, g = m.allow_preview), "object_fit" in m && n(8, S = m.object_fit), "show_share_button" in m && n(9, v = m.show_share_button), "show_download_button" in m && n(10, A = m.show_download_button), "i18n" in m && n(11, y = m.i18n), "selected_index" in m && n(0, d = m.selected_index); }, e.$$.update = () => { e.$$.dirty[0] & /*value, was_reset*/ - 4194312 && n(22, p = u == null || u.length == 0 ? !0 : p), e.$$.dirty[0] & /*value, root, proxy_url*/ - 1572872 && n(12, N = u === null ? null : u.map((d) => ({ - image: Gi(d.image, a, s), - caption: d.caption + 8388616 && n(23, M = u == null || u.length == 0 ? !0 : M), e.$$.dirty[0] & /*value, root, proxy_url*/ + 3145736 && n(12, U = u === null ? null : u.map((m) => ({ + image: Vi(m.image, a, s), + caption: m.caption }))), e.$$.dirty[0] & /*prevValue, value, was_reset, preview, selected_index*/ - 14680073 && (Qe(G, u) || (p ? (n(0, m = _ && Ee([u, "optionalAccess", (d) => d.length]) ? 0 : null), n(22, p = !1)) : n( + 29360137 && ($e(O, u) || (M ? (n(0, d = _ && Se([u, "optionalAccess", (m) => m.length]) ? 0 : null), n(23, M = !1)) : n( 0, - m = m !== null && u !== null && m < u.length ? m : null - ), g("change"), n(23, G = u))), e.$$.dirty[0] & /*selected_index, _value*/ - 4097 && (i = (We(m, () => 0) + We(Ee([N, "optionalAccess", (d) => d.length]), () => 0) - 1) % We(Ee([N, "optionalAccess", (d) => d.length]), () => 0)), e.$$.dirty[0] & /*selected_index, _value*/ - 4097 && (r = (We(m, () => 0) + 1) % We(Ee([N, "optionalAccess", (d) => d.length]), () => 0)), e.$$.dirty[0] & /*selected_index, old_selected_index, _value*/ - 16781313 && m !== L && (n(24, L = m), m !== null && g("select", { - index: m, - value: Ee([N, "optionalAccess", (d) => d[m]]) + d = d !== null && u !== null && d < u.length ? d : null + ), b("change"), n(24, O = u))), e.$$.dirty[0] & /*selected_index, _value*/ + 4097 && (i = (Ke(d, () => 0) + Ke(Se([U, "optionalAccess", (m) => m.length]), () => 0) - 1) % Ke(Se([U, "optionalAccess", (m) => m.length]), () => 0)), e.$$.dirty[0] & /*selected_index, _value*/ + 4097 && (r = (Ke(d, () => 0) + 1) % Ke(Se([U, "optionalAccess", (m) => m.length]), () => 0)), e.$$.dirty[0] & /*selected_index, old_selected_index, _value*/ + 33558529 && d !== V && (n(25, V = d), d !== null && b("select", { + index: d, + value: Se([U, "optionalAccess", (m) => m[d]]) })), e.$$.dirty[0] & /*allow_preview, selected_index*/ - 129 && b && $(m); + 129 && g && p(d); }, [ - m, + d, l, o, u, f, c, h, - b, - T, + g, + S, + v, + A, y, - C, - E, - N, - W, + U, + T, q, - ee, - v, - Z, - K, + z, + Me, + ot, + de, + Oe, a, s, _, - p, - G, - L, - rt, - At, - lt, - ot, + M, + O, + V, st, - Ht, - Bt, - S, - yr, - Er, - Sr, - Tr, + at, + ut, + kt, + Ct, + E, Ar, Hr, Br, - Cr + kr, + Cr, + Pr, + Ir, + Lr, + Nr, + Or ]; } -class bu extends Ka { +class Iu extends hu { constructor(t) { - super(), nu( + super(), bu( this, t, - du, - _u, - iu, + Pu, + ku, + gu, { show_label: 1, label: 2, - root: 19, - proxy_url: 20, + root: 20, + proxy_url: 21, value: 3, columns: 4, rows: 5, height: 6, - preview: 21, + preview: 22, allow_preview: 7, object_fit: 8, show_share_button: 9, @@ -5924,7 +6014,7 @@ class bu extends Ka { ); } } -function Ie(e) { +function Ue(e) { let t = ["", "k", "M", "G", "T", "P", "E", "Z"], n = 0; for (; e > 1e3 && n < t.length - 1; ) e /= 1e3, n++; @@ -5932,66 +6022,66 @@ function Ie(e) { return (Number.isInteger(e) ? e : e.toFixed(1)) + i; } const { - SvelteComponent: gu, - append: ie, - attr: I, - component_subscribe: bi, - detach: pu, - element: vu, - init: wu, - insert: yu, - noop: gi, - safe_not_equal: Eu, - set_style: ht, - svg_element: re, - toggle_class: pi -} = window.__gradio__svelte__internal, { onMount: Su } = window.__gradio__svelte__internal; -function Tu(e) { + SvelteComponent: Lu, + append: ne, + attr: P, + component_subscribe: wi, + detach: Nu, + element: Ou, + init: Mu, + insert: Ru, + noop: yi, + safe_not_equal: Du, + set_style: dt, + svg_element: ie, + toggle_class: Ei +} = window.__gradio__svelte__internal, { onMount: Uu } = window.__gradio__svelte__internal; +function Gu(e) { let t, n, i, r, l, o, a, s, u, f, c, h; return { c() { - t = vu("div"), n = re("svg"), i = re("g"), r = re("path"), l = re("path"), o = re("path"), a = re("path"), s = re("g"), u = re("path"), f = re("path"), c = re("path"), h = re("path"), I(r, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), I(r, "fill", "#FF7C00"), I(r, "fill-opacity", "0.4"), I(r, "class", "svelte-43sxxs"), I(l, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), I(l, "fill", "#FF7C00"), I(l, "class", "svelte-43sxxs"), I(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), I(o, "fill", "#FF7C00"), I(o, "fill-opacity", "0.4"), I(o, "class", "svelte-43sxxs"), I(a, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), I(a, "fill", "#FF7C00"), I(a, "class", "svelte-43sxxs"), ht(i, "transform", "translate(" + /*$top*/ + t = Ou("div"), n = ie("svg"), i = ie("g"), r = ie("path"), l = ie("path"), o = ie("path"), a = ie("path"), s = ie("g"), u = ie("path"), f = ie("path"), c = ie("path"), h = ie("path"), P(r, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), P(r, "fill", "#FF7C00"), P(r, "fill-opacity", "0.4"), P(r, "class", "svelte-43sxxs"), P(l, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), P(l, "fill", "#FF7C00"), P(l, "class", "svelte-43sxxs"), P(o, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), P(o, "fill", "#FF7C00"), P(o, "fill-opacity", "0.4"), P(o, "class", "svelte-43sxxs"), P(a, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), P(a, "fill", "#FF7C00"), P(a, "class", "svelte-43sxxs"), dt(i, "transform", "translate(" + /*$top*/ e[1][0] + "px, " + /*$top*/ - e[1][1] + "px)"), I(u, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), I(u, "fill", "#FF7C00"), I(u, "fill-opacity", "0.4"), I(u, "class", "svelte-43sxxs"), I(f, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), I(f, "fill", "#FF7C00"), I(f, "class", "svelte-43sxxs"), I(c, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), I(c, "fill", "#FF7C00"), I(c, "fill-opacity", "0.4"), I(c, "class", "svelte-43sxxs"), I(h, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), I(h, "fill", "#FF7C00"), I(h, "class", "svelte-43sxxs"), ht(s, "transform", "translate(" + /*$bottom*/ + e[1][1] + "px)"), P(u, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), P(u, "fill", "#FF7C00"), P(u, "fill-opacity", "0.4"), P(u, "class", "svelte-43sxxs"), P(f, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), P(f, "fill", "#FF7C00"), P(f, "class", "svelte-43sxxs"), P(c, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), P(c, "fill", "#FF7C00"), P(c, "fill-opacity", "0.4"), P(c, "class", "svelte-43sxxs"), P(h, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), P(h, "fill", "#FF7C00"), P(h, "class", "svelte-43sxxs"), dt(s, "transform", "translate(" + /*$bottom*/ e[2][0] + "px, " + /*$bottom*/ - e[2][1] + "px)"), I(n, "viewBox", "-1200 -1200 3000 3000"), I(n, "fill", "none"), I(n, "xmlns", "http://www.w3.org/2000/svg"), I(n, "class", "svelte-43sxxs"), I(t, "class", "svelte-43sxxs"), pi( + e[2][1] + "px)"), P(n, "viewBox", "-1200 -1200 3000 3000"), P(n, "fill", "none"), P(n, "xmlns", "http://www.w3.org/2000/svg"), P(n, "class", "svelte-43sxxs"), P(t, "class", "svelte-43sxxs"), Ei( t, "margin", /*margin*/ e[0] ); }, - m(_, b) { - yu(_, t, b), ie(t, n), ie(n, i), ie(i, r), ie(i, l), ie(i, o), ie(i, a), ie(n, s), ie(s, u), ie(s, f), ie(s, c), ie(s, h); + m(_, g) { + Ru(_, t, g), ne(t, n), ne(n, i), ne(i, r), ne(i, l), ne(i, o), ne(i, a), ne(n, s), ne(s, u), ne(s, f), ne(s, c), ne(s, h); }, - p(_, [b]) { - b & /*$top*/ - 2 && ht(i, "transform", "translate(" + /*$top*/ + p(_, [g]) { + g & /*$top*/ + 2 && dt(i, "transform", "translate(" + /*$top*/ _[1][0] + "px, " + /*$top*/ - _[1][1] + "px)"), b & /*$bottom*/ - 4 && ht(s, "transform", "translate(" + /*$bottom*/ + _[1][1] + "px)"), g & /*$bottom*/ + 4 && dt(s, "transform", "translate(" + /*$bottom*/ _[2][0] + "px, " + /*$bottom*/ - _[2][1] + "px)"), b & /*margin*/ - 1 && pi( + _[2][1] + "px)"), g & /*margin*/ + 1 && Ei( t, "margin", /*margin*/ _[0] ); }, - i: gi, - o: gi, + i: yi, + o: yi, d(_) { - _ && pu(t); + _ && Nu(t); } }; } -function Au(e, t, n) { +function xu(e, t, n) { let i, r, { margin: l = !0 } = t; - const o = Mn([0, 0]); - bi(e, o, (h) => n(1, i = h)); - const a = Mn([0, 0]); - bi(e, a, (h) => n(2, r = h)); + const o = Un([0, 0]); + wi(e, o, (h) => n(1, i = h)); + const a = Un([0, 0]); + wi(e, a, (h) => n(2, r = h)); let s; async function u() { await Promise.all([o.set([125, 140]), a.set([-125, -140])]), await Promise.all([o.set([-125, 140]), a.set([125, -140])]), await Promise.all([o.set([-125, 0]), a.set([125, -0])]), await Promise.all([o.set([125, 0]), a.set([-125, 0])]); @@ -6002,55 +6092,55 @@ function Au(e, t, n) { async function c() { await Promise.all([o.set([125, 0]), a.set([-125, 0])]), f(); } - return Su(() => (c(), () => s = !0)), e.$$set = (h) => { + return Uu(() => (c(), () => s = !0)), e.$$set = (h) => { "margin" in h && n(0, l = h.margin); }, [l, i, r, o, a]; } -class Hu extends gu { +class Fu extends Lu { constructor(t) { - super(), wu(this, t, Au, Tu, Eu, { margin: 0 }); + super(), Mu(this, t, xu, Gu, Du, { margin: 0 }); } } const { - SvelteComponent: Bu, - append: Ae, + SvelteComponent: ju, + append: He, attr: fe, - binding_callbacks: vi, - check_outros: pr, - create_component: Cu, - create_slot: Pu, - destroy_component: Iu, - destroy_each: vr, - detach: A, + binding_callbacks: Si, + check_outros: Er, + create_component: Vu, + create_slot: qu, + destroy_component: zu, + destroy_each: Sr, + detach: H, element: me, - empty: Ve, - ensure_array_like: wt, - get_all_dirty_from_scope: ku, - get_slot_changes: Lu, - group_outros: wr, - init: Nu, - insert: H, - mount_component: Ou, - noop: un, - safe_not_equal: Mu, - set_data: Y, - set_style: ye, + empty: We, + ensure_array_like: St, + get_all_dirty_from_scope: Xu, + get_slot_changes: Zu, + group_outros: Tr, + init: Wu, + insert: B, + mount_component: Qu, + noop: cn, + safe_not_equal: Ju, + set_data: $, + set_style: Ee, space: ce, - text: M, - toggle_class: J, - transition_in: Re, - transition_out: De, - update_slot_base: Ru -} = window.__gradio__svelte__internal, { tick: Du } = window.__gradio__svelte__internal, { onDestroy: Uu } = window.__gradio__svelte__internal, Gu = (e) => ({}), wi = (e) => ({}); -function yi(e, t, n) { + text: D, + toggle_class: K, + transition_in: qe, + transition_out: ze, + update_slot_base: Yu +} = window.__gradio__svelte__internal, { tick: Ku } = window.__gradio__svelte__internal, { onDestroy: $u } = window.__gradio__svelte__internal, ef = (e) => ({}), Ti = (e) => ({}); +function Ai(e, t, n) { const i = e.slice(); return i[38] = t[n], i[40] = n, i; } -function Ei(e, t, n) { +function Hi(e, t, n) { const i = e.slice(); return i[38] = t[n], i; } -function Fu(e) { +function tf(e) { let t, n = ( /*i18n*/ e[1]("common.error") + "" @@ -6058,243 +6148,243 @@ function Fu(e) { const o = ( /*#slots*/ e[29].error - ), a = Pu( + ), a = qu( o, e, /*$$scope*/ e[28], - wi + Ti ); return { c() { - t = me("span"), i = M(n), r = ce(), a && a.c(), fe(t, "class", "error svelte-14miwb5"); + t = me("span"), i = D(n), r = ce(), a && a.c(), fe(t, "class", "error svelte-14miwb5"); }, m(s, u) { - H(s, t, u), Ae(t, i), H(s, r, u), a && a.m(s, u), l = !0; + B(s, t, u), He(t, i), B(s, r, u), a && a.m(s, u), l = !0; }, p(s, u) { (!l || u[0] & /*i18n*/ 2) && n !== (n = /*i18n*/ - s[1]("common.error") + "") && Y(i, n), a && a.p && (!l || u[0] & /*$$scope*/ - 268435456) && Ru( + s[1]("common.error") + "") && $(i, n), a && a.p && (!l || u[0] & /*$$scope*/ + 268435456) && Yu( a, o, s, /*$$scope*/ s[28], - l ? Lu( + l ? Zu( o, /*$$scope*/ s[28], u, - Gu - ) : ku( + ef + ) : Xu( /*$$scope*/ s[28] ), - wi + Ti ); }, i(s) { - l || (Re(a, s), l = !0); + l || (qe(a, s), l = !0); }, o(s) { - De(a, s), l = !1; + ze(a, s), l = !1; }, d(s) { - s && (A(t), A(r)), a && a.d(s); + s && (H(t), H(r)), a && a.d(s); } }; } -function xu(e) { +function nf(e) { let t, n, i, r, l, o, a, s, u, f = ( /*variant*/ e[8] === "default" && /*show_eta_bar*/ e[18] && /*show_progress*/ - e[6] === "full" && Si(e) + e[6] === "full" && Bi(e) ); - function c(m, g) { + function c(d, T) { if ( /*progress*/ - m[7] + d[7] ) - return zu; + return of; if ( /*queue_position*/ - m[2] !== null && /*queue_size*/ - m[3] !== void 0 && /*queue_position*/ - m[2] >= 0 + d[2] !== null && /*queue_size*/ + d[3] !== void 0 && /*queue_position*/ + d[2] >= 0 ) - return Vu; + return lf; if ( /*queue_position*/ - m[2] === 0 + d[2] === 0 ) - return ju; + return rf; } - let h = c(e), _ = h && h(e), b = ( + let h = c(e), _ = h && h(e), g = ( /*timer*/ - e[5] && Hi(e) + e[5] && Pi(e) ); - const T = [Wu, Zu], y = []; - function C(m, g) { + const S = [ff, uf], v = []; + function A(d, T) { return ( /*last_progress_level*/ - m[15] != null ? 0 : ( + d[15] != null ? 0 : ( /*show_progress*/ - m[6] === "full" ? 1 : -1 + d[6] === "full" ? 1 : -1 ) ); } - ~(l = C(e)) && (o = y[l] = T[l](e)); - let E = !/*timer*/ - e[5] && Ni(e); + ~(l = A(e)) && (o = v[l] = S[l](e)); + let y = !/*timer*/ + e[5] && Di(e); return { c() { - f && f.c(), t = ce(), n = me("div"), _ && _.c(), i = ce(), b && b.c(), r = ce(), o && o.c(), a = ce(), E && E.c(), s = Ve(), fe(n, "class", "progress-text svelte-14miwb5"), J( + f && f.c(), t = ce(), n = me("div"), _ && _.c(), i = ce(), g && g.c(), r = ce(), o && o.c(), a = ce(), y && y.c(), s = We(), fe(n, "class", "progress-text svelte-14miwb5"), K( n, "meta-text-center", /*variant*/ e[8] === "center" - ), J( + ), K( n, "meta-text", /*variant*/ e[8] === "default" ); }, - m(m, g) { - f && f.m(m, g), H(m, t, g), H(m, n, g), _ && _.m(n, null), Ae(n, i), b && b.m(n, null), H(m, r, g), ~l && y[l].m(m, g), H(m, a, g), E && E.m(m, g), H(m, s, g), u = !0; + m(d, T) { + f && f.m(d, T), B(d, t, T), B(d, n, T), _ && _.m(n, null), He(n, i), g && g.m(n, null), B(d, r, T), ~l && v[l].m(d, T), B(d, a, T), y && y.m(d, T), B(d, s, T), u = !0; }, - p(m, g) { + p(d, T) { /*variant*/ - m[8] === "default" && /*show_eta_bar*/ - m[18] && /*show_progress*/ - m[6] === "full" ? f ? f.p(m, g) : (f = Si(m), f.c(), f.m(t.parentNode, t)) : f && (f.d(1), f = null), h === (h = c(m)) && _ ? _.p(m, g) : (_ && _.d(1), _ = h && h(m), _ && (_.c(), _.m(n, i))), /*timer*/ - m[5] ? b ? b.p(m, g) : (b = Hi(m), b.c(), b.m(n, null)) : b && (b.d(1), b = null), (!u || g[0] & /*variant*/ - 256) && J( + d[8] === "default" && /*show_eta_bar*/ + d[18] && /*show_progress*/ + d[6] === "full" ? f ? f.p(d, T) : (f = Bi(d), f.c(), f.m(t.parentNode, t)) : f && (f.d(1), f = null), h === (h = c(d)) && _ ? _.p(d, T) : (_ && _.d(1), _ = h && h(d), _ && (_.c(), _.m(n, i))), /*timer*/ + d[5] ? g ? g.p(d, T) : (g = Pi(d), g.c(), g.m(n, null)) : g && (g.d(1), g = null), (!u || T[0] & /*variant*/ + 256) && K( n, "meta-text-center", /*variant*/ - m[8] === "center" - ), (!u || g[0] & /*variant*/ - 256) && J( + d[8] === "center" + ), (!u || T[0] & /*variant*/ + 256) && K( n, "meta-text", /*variant*/ - m[8] === "default" + d[8] === "default" ); - let p = l; - l = C(m), l === p ? ~l && y[l].p(m, g) : (o && (wr(), De(y[p], 1, 1, () => { - y[p] = null; - }), pr()), ~l ? (o = y[l], o ? o.p(m, g) : (o = y[l] = T[l](m), o.c()), Re(o, 1), o.m(a.parentNode, a)) : o = null), /*timer*/ - m[5] ? E && (E.d(1), E = null) : E ? E.p(m, g) : (E = Ni(m), E.c(), E.m(s.parentNode, s)); + let b = l; + l = A(d), l === b ? ~l && v[l].p(d, T) : (o && (Tr(), ze(v[b], 1, 1, () => { + v[b] = null; + }), Er()), ~l ? (o = v[l], o ? o.p(d, T) : (o = v[l] = S[l](d), o.c()), qe(o, 1), o.m(a.parentNode, a)) : o = null), /*timer*/ + d[5] ? y && (y.d(1), y = null) : y ? y.p(d, T) : (y = Di(d), y.c(), y.m(s.parentNode, s)); }, - i(m) { - u || (Re(o), u = !0); + i(d) { + u || (qe(o), u = !0); }, - o(m) { - De(o), u = !1; + o(d) { + ze(o), u = !1; }, - d(m) { - m && (A(t), A(n), A(r), A(a), A(s)), f && f.d(m), _ && _.d(), b && b.d(), ~l && y[l].d(m), E && E.d(m); + d(d) { + d && (H(t), H(n), H(r), H(a), H(s)), f && f.d(d), _ && _.d(), g && g.d(), ~l && v[l].d(d), y && y.d(d); } }; } -function Si(e) { +function Bi(e) { let t, n = `translateX(${/*eta_level*/ (e[17] || 0) * 100 - 100}%)`; return { c() { - t = me("div"), fe(t, "class", "eta-bar svelte-14miwb5"), ye(t, "transform", n); + t = me("div"), fe(t, "class", "eta-bar svelte-14miwb5"), Ee(t, "transform", n); }, m(i, r) { - H(i, t, r); + B(i, t, r); }, p(i, r) { r[0] & /*eta_level*/ 131072 && n !== (n = `translateX(${/*eta_level*/ - (i[17] || 0) * 100 - 100}%)`) && ye(t, "transform", n); + (i[17] || 0) * 100 - 100}%)`) && Ee(t, "transform", n); }, d(i) { - i && A(t); + i && H(t); } }; } -function ju(e) { +function rf(e) { let t; return { c() { - t = M("processing |"); + t = D("processing |"); }, m(n, i) { - H(n, t, i); + B(n, t, i); }, - p: un, + p: cn, d(n) { - n && A(t); + n && H(t); } }; } -function Vu(e) { +function lf(e) { let t, n = ( /*queue_position*/ e[2] + 1 + "" ), i, r, l, o; return { c() { - t = M("queue: "), i = M(n), r = M("/"), l = M( + t = D("queue: "), i = D(n), r = D("/"), l = D( /*queue_size*/ e[3] - ), o = M(" |"); + ), o = D(" |"); }, m(a, s) { - H(a, t, s), H(a, i, s), H(a, r, s), H(a, l, s), H(a, o, s); + B(a, t, s), B(a, i, s), B(a, r, s), B(a, l, s), B(a, o, s); }, p(a, s) { s[0] & /*queue_position*/ 4 && n !== (n = /*queue_position*/ - a[2] + 1 + "") && Y(i, n), s[0] & /*queue_size*/ - 8 && Y( + a[2] + 1 + "") && $(i, n), s[0] & /*queue_size*/ + 8 && $( l, /*queue_size*/ a[3] ); }, d(a) { - a && (A(t), A(i), A(r), A(l), A(o)); + a && (H(t), H(i), H(r), H(l), H(o)); } }; } -function zu(e) { - let t, n = wt( +function of(e) { + let t, n = St( /*progress*/ e[7] ), i = []; for (let r = 0; r < n.length; r += 1) - i[r] = Ai(Ei(e, n, r)); + i[r] = Ci(Hi(e, n, r)); return { c() { for (let r = 0; r < i.length; r += 1) i[r].c(); - t = Ve(); + t = We(); }, m(r, l) { for (let o = 0; o < i.length; o += 1) i[o] && i[o].m(r, l); - H(r, t, l); + B(r, t, l); }, p(r, l) { if (l[0] & /*progress*/ 128) { - n = wt( + n = St( /*progress*/ r[7] ); let o; for (o = 0; o < n.length; o += 1) { - const a = Ei(r, n, o); - i[o] ? i[o].p(a, l) : (i[o] = Ai(a), i[o].c(), i[o].m(t.parentNode, t)); + const a = Hi(r, n, o); + i[o] ? i[o].p(a, l) : (i[o] = Ci(a), i[o].c(), i[o].m(t.parentNode, t)); } for (; o < i.length; o += 1) i[o].d(1); @@ -6302,11 +6392,11 @@ function zu(e) { } }, d(r) { - r && A(t), vr(i, r); + r && H(t), Sr(i, r); } }; } -function Ti(e) { +function ki(e) { let t, n = ( /*p*/ e[38].unit + "" @@ -6314,104 +6404,104 @@ function Ti(e) { function a(f, c) { return ( /*p*/ - f[38].length != null ? Xu : qu + f[38].length != null ? af : sf ); } let s = a(e), u = s(e); return { c() { - u.c(), t = ce(), i = M(n), r = M(" | "), o = M(l); + u.c(), t = ce(), i = D(n), r = D(" | "), o = D(l); }, m(f, c) { - u.m(f, c), H(f, t, c), H(f, i, c), H(f, r, c), H(f, o, c); + u.m(f, c), B(f, t, c), B(f, i, c), B(f, r, c), B(f, o, c); }, p(f, c) { s === (s = a(f)) && u ? u.p(f, c) : (u.d(1), u = s(f), u && (u.c(), u.m(t.parentNode, t))), c[0] & /*progress*/ 128 && n !== (n = /*p*/ - f[38].unit + "") && Y(i, n); + f[38].unit + "") && $(i, n); }, d(f) { - f && (A(t), A(i), A(r), A(o)), u.d(f); + f && (H(t), H(i), H(r), H(o)), u.d(f); } }; } -function qu(e) { - let t = Ie( +function sf(e) { + let t = Ue( /*p*/ e[38].index || 0 ) + "", n; return { c() { - n = M(t); + n = D(t); }, m(i, r) { - H(i, n, r); + B(i, n, r); }, p(i, r) { r[0] & /*progress*/ - 128 && t !== (t = Ie( + 128 && t !== (t = Ue( /*p*/ i[38].index || 0 - ) + "") && Y(n, t); + ) + "") && $(n, t); }, d(i) { - i && A(n); + i && H(n); } }; } -function Xu(e) { - let t = Ie( +function af(e) { + let t = Ue( /*p*/ e[38].index || 0 - ) + "", n, i, r = Ie( + ) + "", n, i, r = Ue( /*p*/ e[38].length ) + "", l; return { c() { - n = M(t), i = M("/"), l = M(r); + n = D(t), i = D("/"), l = D(r); }, m(o, a) { - H(o, n, a), H(o, i, a), H(o, l, a); + B(o, n, a), B(o, i, a), B(o, l, a); }, p(o, a) { a[0] & /*progress*/ - 128 && t !== (t = Ie( + 128 && t !== (t = Ue( /*p*/ o[38].index || 0 - ) + "") && Y(n, t), a[0] & /*progress*/ - 128 && r !== (r = Ie( + ) + "") && $(n, t), a[0] & /*progress*/ + 128 && r !== (r = Ue( /*p*/ o[38].length - ) + "") && Y(l, r); + ) + "") && $(l, r); }, d(o) { - o && (A(n), A(i), A(l)); + o && (H(n), H(i), H(l)); } }; } -function Ai(e) { +function Ci(e) { let t, n = ( /*p*/ - e[38].index != null && Ti(e) + e[38].index != null && ki(e) ); return { c() { - n && n.c(), t = Ve(); + n && n.c(), t = We(); }, m(i, r) { - n && n.m(i, r), H(i, t, r); + n && n.m(i, r), B(i, t, r); }, p(i, r) { /*p*/ - i[38].index != null ? n ? n.p(i, r) : (n = Ti(i), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null); + i[38].index != null ? n ? n.p(i, r) : (n = ki(i), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null); }, d(i) { - i && A(t), n && n.d(i); + i && H(t), n && n.d(i); } }; } -function Hi(e) { +function Pi(e) { let t, n = ( /*eta*/ e[0] ? `/${/*formatted_eta*/ @@ -6419,43 +6509,43 @@ function Hi(e) { ), i, r; return { c() { - t = M( + t = D( /*formatted_timer*/ e[20] - ), i = M(n), r = M("s"); + ), i = D(n), r = D("s"); }, m(l, o) { - H(l, t, o), H(l, i, o), H(l, r, o); + B(l, t, o), B(l, i, o), B(l, r, o); }, p(l, o) { o[0] & /*formatted_timer*/ - 1048576 && Y( + 1048576 && $( t, /*formatted_timer*/ l[20] ), o[0] & /*eta, formatted_eta*/ 524289 && n !== (n = /*eta*/ l[0] ? `/${/*formatted_eta*/ - l[19]}` : "") && Y(i, n); + l[19]}` : "") && $(i, n); }, d(l) { - l && (A(t), A(i), A(r)); + l && (H(t), H(i), H(r)); } }; } -function Zu(e) { +function uf(e) { let t, n; - return t = new Hu({ + return t = new Fu({ props: { margin: ( /*variant*/ e[8] === "default" ) } }), { c() { - Cu(t.$$.fragment); + Vu(t.$$.fragment); }, m(i, r) { - Ou(t, i, r), n = !0; + Qu(t, i, r), n = !0; }, p(i, r) { const l = {}; @@ -6464,71 +6554,71 @@ function Zu(e) { i[8] === "default"), t.$set(l); }, i(i) { - n || (Re(t.$$.fragment, i), n = !0); + n || (qe(t.$$.fragment, i), n = !0); }, o(i) { - De(t.$$.fragment, i), n = !1; + ze(t.$$.fragment, i), n = !1; }, d(i) { - Iu(t, i); + zu(t, i); } }; } -function Wu(e) { +function ff(e) { let t, n, i, r, l, o = `${/*last_progress_level*/ e[15] * 100}%`, a = ( /*progress*/ - e[7] != null && Bi(e) + e[7] != null && Ii(e) ); return { c() { - t = me("div"), n = me("div"), a && a.c(), i = ce(), r = me("div"), l = me("div"), fe(n, "class", "progress-level-inner svelte-14miwb5"), fe(l, "class", "progress-bar svelte-14miwb5"), ye(l, "width", o), fe(r, "class", "progress-bar-wrap svelte-14miwb5"), fe(t, "class", "progress-level svelte-14miwb5"); + t = me("div"), n = me("div"), a && a.c(), i = ce(), r = me("div"), l = me("div"), fe(n, "class", "progress-level-inner svelte-14miwb5"), fe(l, "class", "progress-bar svelte-14miwb5"), Ee(l, "width", o), fe(r, "class", "progress-bar-wrap svelte-14miwb5"), fe(t, "class", "progress-level svelte-14miwb5"); }, m(s, u) { - H(s, t, u), Ae(t, n), a && a.m(n, null), Ae(t, i), Ae(t, r), Ae(r, l), e[30](l); + B(s, t, u), He(t, n), a && a.m(n, null), He(t, i), He(t, r), He(r, l), e[30](l); }, p(s, u) { /*progress*/ - s[7] != null ? a ? a.p(s, u) : (a = Bi(s), a.c(), a.m(n, null)) : a && (a.d(1), a = null), u[0] & /*last_progress_level*/ + s[7] != null ? a ? a.p(s, u) : (a = Ii(s), a.c(), a.m(n, null)) : a && (a.d(1), a = null), u[0] & /*last_progress_level*/ 32768 && o !== (o = `${/*last_progress_level*/ - s[15] * 100}%`) && ye(l, "width", o); + s[15] * 100}%`) && Ee(l, "width", o); }, - i: un, - o: un, + i: cn, + o: cn, d(s) { - s && A(t), a && a.d(), e[30](null); + s && H(t), a && a.d(), e[30](null); } }; } -function Bi(e) { - let t, n = wt( +function Ii(e) { + let t, n = St( /*progress*/ e[7] ), i = []; for (let r = 0; r < n.length; r += 1) - i[r] = Li(yi(e, n, r)); + i[r] = Ri(Ai(e, n, r)); return { c() { for (let r = 0; r < i.length; r += 1) i[r].c(); - t = Ve(); + t = We(); }, m(r, l) { for (let o = 0; o < i.length; o += 1) i[o] && i[o].m(r, l); - H(r, t, l); + B(r, t, l); }, p(r, l) { if (l[0] & /*progress_level, progress*/ 16512) { - n = wt( + n = St( /*progress*/ r[7] ); let o; for (o = 0; o < n.length; o += 1) { - const a = yi(r, n, o); - i[o] ? i[o].p(a, l) : (i[o] = Li(a), i[o].c(), i[o].m(t.parentNode, t)); + const a = Ai(r, n, o); + i[o] ? i[o].p(a, l) : (i[o] = Ri(a), i[o].c(), i[o].m(t.parentNode, t)); } for (; o < i.length; o += 1) i[o].d(1); @@ -6536,17 +6626,17 @@ function Bi(e) { } }, d(r) { - r && A(t), vr(i, r); + r && H(t), Sr(i, r); } }; } -function Ci(e) { +function Li(e) { let t, n, i, r, l = ( /*i*/ - e[40] !== 0 && Qu() + e[40] !== 0 && cf() ), o = ( /*p*/ - e[38].desc != null && Pi(e) + e[38].desc != null && Ni(e) ), a = ( /*p*/ e[38].desc != null && /*progress_level*/ @@ -6554,85 +6644,85 @@ function Ci(e) { e[14][ /*i*/ e[40] - ] != null && Ii() + ] != null && Oi() ), s = ( /*progress_level*/ - e[14] != null && ki(e) + e[14] != null && Mi(e) ); return { c() { - l && l.c(), t = ce(), o && o.c(), n = ce(), a && a.c(), i = ce(), s && s.c(), r = Ve(); + l && l.c(), t = ce(), o && o.c(), n = ce(), a && a.c(), i = ce(), s && s.c(), r = We(); }, m(u, f) { - l && l.m(u, f), H(u, t, f), o && o.m(u, f), H(u, n, f), a && a.m(u, f), H(u, i, f), s && s.m(u, f), H(u, r, f); + l && l.m(u, f), B(u, t, f), o && o.m(u, f), B(u, n, f), a && a.m(u, f), B(u, i, f), s && s.m(u, f), B(u, r, f); }, p(u, f) { /*p*/ - u[38].desc != null ? o ? o.p(u, f) : (o = Pi(u), o.c(), o.m(n.parentNode, n)) : o && (o.d(1), o = null), /*p*/ + u[38].desc != null ? o ? o.p(u, f) : (o = Ni(u), o.c(), o.m(n.parentNode, n)) : o && (o.d(1), o = null), /*p*/ u[38].desc != null && /*progress_level*/ u[14] && /*progress_level*/ u[14][ /*i*/ u[40] - ] != null ? a || (a = Ii(), a.c(), a.m(i.parentNode, i)) : a && (a.d(1), a = null), /*progress_level*/ - u[14] != null ? s ? s.p(u, f) : (s = ki(u), s.c(), s.m(r.parentNode, r)) : s && (s.d(1), s = null); + ] != null ? a || (a = Oi(), a.c(), a.m(i.parentNode, i)) : a && (a.d(1), a = null), /*progress_level*/ + u[14] != null ? s ? s.p(u, f) : (s = Mi(u), s.c(), s.m(r.parentNode, r)) : s && (s.d(1), s = null); }, d(u) { - u && (A(t), A(n), A(i), A(r)), l && l.d(u), o && o.d(u), a && a.d(u), s && s.d(u); + u && (H(t), H(n), H(i), H(r)), l && l.d(u), o && o.d(u), a && a.d(u), s && s.d(u); } }; } -function Qu(e) { +function cf(e) { let t; return { c() { - t = M(" /"); + t = D(" /"); }, m(n, i) { - H(n, t, i); + B(n, t, i); }, d(n) { - n && A(t); + n && H(t); } }; } -function Pi(e) { +function Ni(e) { let t = ( /*p*/ e[38].desc + "" ), n; return { c() { - n = M(t); + n = D(t); }, m(i, r) { - H(i, n, r); + B(i, n, r); }, p(i, r) { r[0] & /*progress*/ 128 && t !== (t = /*p*/ - i[38].desc + "") && Y(n, t); + i[38].desc + "") && $(n, t); }, d(i) { - i && A(n); + i && H(n); } }; } -function Ii(e) { +function Oi(e) { let t; return { c() { - t = M("-"); + t = D("-"); }, m(n, i) { - H(n, t, i); + B(n, t, i); }, d(n) { - n && A(t); + n && H(t); } }; } -function ki(e) { +function Mi(e) { let t = (100 * /*progress_level*/ (e[14][ /*i*/ @@ -6640,10 +6730,10 @@ function ki(e) { ] || 0)).toFixed(1) + "", n, i; return { c() { - n = M(t), i = M("%"); + n = D(t), i = D("%"); }, m(r, l) { - H(r, n, l), H(r, i, l); + B(r, n, l), B(r, i, l); }, p(r, l) { l[0] & /*progress_level*/ @@ -6651,14 +6741,14 @@ function ki(e) { (r[14][ /*i*/ r[40] - ] || 0)).toFixed(1) + "") && Y(n, t); + ] || 0)).toFixed(1) + "") && $(n, t); }, d(r) { - r && (A(n), A(i)); + r && (H(n), H(i)); } }; } -function Li(e) { +function Ri(e) { let t, n = ( /*p*/ (e[38].desc != null || /*progress_level*/ @@ -6666,14 +6756,14 @@ function Li(e) { e[14][ /*i*/ e[40] - ] != null) && Ci(e) + ] != null) && Li(e) ); return { c() { - n && n.c(), t = Ve(); + n && n.c(), t = We(); }, m(i, r) { - n && n.m(i, r), H(i, t, r); + n && n.m(i, r), B(i, t, r); }, p(i, r) { /*p*/ @@ -6682,41 +6772,41 @@ function Li(e) { i[14][ /*i*/ i[40] - ] != null ? n ? n.p(i, r) : (n = Ci(i), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null); + ] != null ? n ? n.p(i, r) : (n = Li(i), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null); }, d(i) { - i && A(t), n && n.d(i); + i && H(t), n && n.d(i); } }; } -function Ni(e) { +function Di(e) { let t, n; return { c() { - t = me("p"), n = M( + t = me("p"), n = D( /*loading_text*/ e[9] ), fe(t, "class", "loading svelte-14miwb5"); }, m(i, r) { - H(i, t, r), Ae(t, n); + B(i, t, r), He(t, n); }, p(i, r) { r[0] & /*loading_text*/ - 512 && Y( + 512 && $( n, /*loading_text*/ i[9] ); }, d(i) { - i && A(t); + i && H(t); } }; } -function Ju(e) { +function hf(e) { let t, n, i, r, l; - const o = [xu, Fu], a = []; + const o = [nf, tf], a = []; function s(u, f) { return ( /*status*/ @@ -6730,10 +6820,10 @@ function Ju(e) { c() { t = me("div"), i && i.c(), fe(t, "class", r = "wrap " + /*variant*/ e[8] + " " + /*show_progress*/ - e[6] + " svelte-14miwb5"), J(t, "hide", !/*status*/ + e[6] + " svelte-14miwb5"), K(t, "hide", !/*status*/ e[4] || /*status*/ e[4] === "complete" || /*show_progress*/ - e[6] === "hidden"), J( + e[6] === "hidden"), K( t, "translucent", /*variant*/ @@ -6742,22 +6832,22 @@ function Ju(e) { e[4] === "error") || /*translucent*/ e[11] || /*show_progress*/ e[6] === "minimal" - ), J( + ), K( t, "generating", /*status*/ e[4] === "generating" - ), J( + ), K( t, "border", /*border*/ e[12] - ), ye( + ), Ee( t, "position", /*absolute*/ e[10] ? "absolute" : "static" - ), ye( + ), Ee( t, "padding", /*absolute*/ @@ -6765,21 +6855,21 @@ function Ju(e) { ); }, m(u, f) { - H(u, t, f), ~n && a[n].m(t, null), e[31](t), l = !0; + B(u, t, f), ~n && a[n].m(t, null), e[31](t), l = !0; }, p(u, f) { let c = n; - n = s(u), n === c ? ~n && a[n].p(u, f) : (i && (wr(), De(a[c], 1, 1, () => { + n = s(u), n === c ? ~n && a[n].p(u, f) : (i && (Tr(), ze(a[c], 1, 1, () => { a[c] = null; - }), pr()), ~n ? (i = a[n], i ? i.p(u, f) : (i = a[n] = o[n](u), i.c()), Re(i, 1), i.m(t, null)) : i = null), (!l || f[0] & /*variant, show_progress*/ + }), Er()), ~n ? (i = a[n], i ? i.p(u, f) : (i = a[n] = o[n](u), i.c()), qe(i, 1), i.m(t, null)) : i = null), (!l || f[0] & /*variant, show_progress*/ 320 && r !== (r = "wrap " + /*variant*/ u[8] + " " + /*show_progress*/ u[6] + " svelte-14miwb5")) && fe(t, "class", r), (!l || f[0] & /*variant, show_progress, status, show_progress*/ - 336) && J(t, "hide", !/*status*/ + 336) && K(t, "hide", !/*status*/ u[4] || /*status*/ u[4] === "complete" || /*show_progress*/ u[6] === "hidden"), (!l || f[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ - 2384) && J( + 2384) && K( t, "translucent", /*variant*/ @@ -6789,25 +6879,25 @@ function Ju(e) { u[11] || /*show_progress*/ u[6] === "minimal" ), (!l || f[0] & /*variant, show_progress, status*/ - 336) && J( + 336) && K( t, "generating", /*status*/ u[4] === "generating" ), (!l || f[0] & /*variant, show_progress, border*/ - 4416) && J( + 4416) && K( t, "border", /*border*/ u[12] ), f[0] & /*absolute*/ - 1024 && ye( + 1024 && Ee( t, "position", /*absolute*/ u[10] ? "absolute" : "static" ), f[0] & /*absolute*/ - 1024 && ye( + 1024 && Ee( t, "padding", /*absolute*/ @@ -6815,77 +6905,77 @@ function Ju(e) { ); }, i(u) { - l || (Re(i), l = !0); + l || (qe(i), l = !0); }, o(u) { - De(i), l = !1; + ze(i), l = !1; }, d(u) { - u && A(t), ~n && a[n].d(), e[31](null); + u && H(t), ~n && a[n].d(), e[31](null); } }; } -let _t = [], Wt = !1; -async function Yu(e, t = !0) { +let bt = [], Jt = !1; +async function _f(e, t = !0) { if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) { - if (_t.push(e), !Wt) - Wt = !0; + if (bt.push(e), !Jt) + Jt = !0; else return; - await Du(), requestAnimationFrame(() => { + await Ku(), requestAnimationFrame(() => { let n = [0, 0]; - for (let i = 0; i < _t.length; i++) { - const l = _t[i].getBoundingClientRect(); + for (let i = 0; i < bt.length; i++) { + const l = bt[i].getBoundingClientRect(); (i === 0 || l.top + window.scrollY <= n[0]) && (n[0] = l.top + window.scrollY, n[1] = i); } - window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), Wt = !1, _t = []; + window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), Jt = !1, bt = []; }); } } -function Ku(e, t, n) { - let i, { $$slots: r = {}, $$scope: l } = t, { i18n: o } = t, { eta: a = null } = t, { queue: s = !1 } = t, { queue_position: u } = t, { queue_size: f } = t, { status: c } = t, { scroll_to_output: h = !1 } = t, { timer: _ = !0 } = t, { show_progress: b = "full" } = t, { message: T = null } = t, { progress: y = null } = t, { variant: C = "default" } = t, { loading_text: E = "Loading..." } = t, { absolute: m = !0 } = t, { translucent: g = !1 } = t, { border: p = !1 } = t, { autoscroll: N } = t, G, L = !1, Z = 0, K = 0, W = null, q = 0, $ = null, ee, v = null, rt = !0; - const At = () => { - n(25, Z = performance.now()), n(26, K = 0), L = !0, lt(); +function mf(e, t, n) { + let i, { $$slots: r = {}, $$scope: l } = t, { i18n: o } = t, { eta: a = null } = t, { queue: s = !1 } = t, { queue_position: u } = t, { queue_size: f } = t, { status: c } = t, { scroll_to_output: h = !1 } = t, { timer: _ = !0 } = t, { show_progress: g = "full" } = t, { message: S = null } = t, { progress: v = null } = t, { variant: A = "default" } = t, { loading_text: y = "Loading..." } = t, { absolute: d = !0 } = t, { translucent: T = !1 } = t, { border: b = !1 } = t, { autoscroll: I } = t, M, U = !1, O = 0, V = 0, de = null, Oe = 0, q = null, z, p = null, Me = !0; + const ot = () => { + n(25, O = performance.now()), n(26, V = 0), U = !0, st(); }; - function lt() { + function st() { requestAnimationFrame(() => { - n(26, K = (performance.now() - Z) / 1e3), L && lt(); + n(26, V = (performance.now() - O) / 1e3), U && st(); }); } - function ot() { - n(26, K = 0), L && (L = !1); + function at() { + n(26, V = 0), U && (U = !1); } - Uu(() => { - L && ot(); + $u(() => { + U && at(); }); - let st = null; - function Ht(S) { - vi[S ? "unshift" : "push"](() => { - v = S, n(16, v), n(7, y), n(14, $), n(15, ee); + let ut = null; + function kt(E) { + Si[E ? "unshift" : "push"](() => { + p = E, n(16, p), n(7, v), n(14, q), n(15, z); }); } - function Bt(S) { - vi[S ? "unshift" : "push"](() => { - G = S, n(13, G); + function Ct(E) { + Si[E ? "unshift" : "push"](() => { + M = E, n(13, M); }); } - return e.$$set = (S) => { - "i18n" in S && n(1, o = S.i18n), "eta" in S && n(0, a = S.eta), "queue" in S && n(21, s = S.queue), "queue_position" in S && n(2, u = S.queue_position), "queue_size" in S && n(3, f = S.queue_size), "status" in S && n(4, c = S.status), "scroll_to_output" in S && n(22, h = S.scroll_to_output), "timer" in S && n(5, _ = S.timer), "show_progress" in S && n(6, b = S.show_progress), "message" in S && n(23, T = S.message), "progress" in S && n(7, y = S.progress), "variant" in S && n(8, C = S.variant), "loading_text" in S && n(9, E = S.loading_text), "absolute" in S && n(10, m = S.absolute), "translucent" in S && n(11, g = S.translucent), "border" in S && n(12, p = S.border), "autoscroll" in S && n(24, N = S.autoscroll), "$$scope" in S && n(28, l = S.$$scope); + return e.$$set = (E) => { + "i18n" in E && n(1, o = E.i18n), "eta" in E && n(0, a = E.eta), "queue" in E && n(21, s = E.queue), "queue_position" in E && n(2, u = E.queue_position), "queue_size" in E && n(3, f = E.queue_size), "status" in E && n(4, c = E.status), "scroll_to_output" in E && n(22, h = E.scroll_to_output), "timer" in E && n(5, _ = E.timer), "show_progress" in E && n(6, g = E.show_progress), "message" in E && n(23, S = E.message), "progress" in E && n(7, v = E.progress), "variant" in E && n(8, A = E.variant), "loading_text" in E && n(9, y = E.loading_text), "absolute" in E && n(10, d = E.absolute), "translucent" in E && n(11, T = E.translucent), "border" in E && n(12, b = E.border), "autoscroll" in E && n(24, I = E.autoscroll), "$$scope" in E && n(28, l = E.$$scope); }, e.$$.update = () => { e.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/ - 169869313 && (a === null ? n(0, a = W) : s && n(0, a = (performance.now() - Z) / 1e3 + a), a != null && (n(19, st = a.toFixed(1)), n(27, W = a))), e.$$.dirty[0] & /*eta, timer_diff*/ - 67108865 && n(17, q = a === null || a <= 0 || !K ? null : Math.min(K / a, 1)), e.$$.dirty[0] & /*progress*/ - 128 && y != null && n(18, rt = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ - 114816 && (y != null ? n(14, $ = y.map((S) => { - if (S.index != null && S.length != null) - return S.index / S.length; - if (S.progress != null) - return S.progress; - })) : n(14, $ = null), $ ? (n(15, ee = $[$.length - 1]), v && (ee === 0 ? n(16, v.style.transition = "0", v) : n(16, v.style.transition = "150ms", v))) : n(15, ee = void 0)), e.$$.dirty[0] & /*status*/ - 16 && (c === "pending" ? At() : ot()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ - 20979728 && G && h && (c === "pending" || c === "complete") && Yu(G, N), e.$$.dirty[0] & /*status, message*/ + 169869313 && (a === null ? n(0, a = de) : s && n(0, a = (performance.now() - O) / 1e3 + a), a != null && (n(19, ut = a.toFixed(1)), n(27, de = a))), e.$$.dirty[0] & /*eta, timer_diff*/ + 67108865 && n(17, Oe = a === null || a <= 0 || !V ? null : Math.min(V / a, 1)), e.$$.dirty[0] & /*progress*/ + 128 && v != null && n(18, Me = !1), e.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ + 114816 && (v != null ? n(14, q = v.map((E) => { + if (E.index != null && E.length != null) + return E.index / E.length; + if (E.progress != null) + return E.progress; + })) : n(14, q = null), q ? (n(15, z = q[q.length - 1]), p && (z === 0 ? n(16, p.style.transition = "0", p) : n(16, p.style.transition = "150ms", p))) : n(15, z = void 0)), e.$$.dirty[0] & /*status*/ + 16 && (c === "pending" ? ot() : at()), e.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ + 20979728 && M && h && (c === "pending" || c === "complete") && _f(M, I), e.$$.dirty[0] & /*status, message*/ 8388624, e.$$.dirty[0] & /*timer_diff*/ - 67108864 && n(20, i = K.toFixed(1)); + 67108864 && n(20, i = V.toFixed(1)); }, [ a, o, @@ -6893,42 +6983,42 @@ function Ku(e, t, n) { f, c, _, - b, - y, - C, - E, - m, g, - p, - G, - $, - ee, v, + A, + y, + d, + T, + b, + M, q, - rt, - st, + z, + p, + Oe, + Me, + ut, i, s, h, - T, - N, - Z, - K, - W, + S, + I, + O, + V, + de, l, r, - Ht, - Bt + kt, + Ct ]; } -class $u extends Bu { +class df extends ju { constructor(t) { - super(), Nu( + super(), Wu( this, t, - Ku, + mf, + hf, Ju, - Mu, { i18n: 1, eta: 0, @@ -6954,25 +7044,25 @@ class $u extends Bu { } } const { - SvelteComponent: ef, - add_flush_callback: tf, - assign: nf, - bind: rf, - binding_callbacks: lf, - create_component: fn, - destroy_component: cn, - detach: of, - get_spread_object: sf, - get_spread_update: af, - init: uf, - insert: ff, - mount_component: hn, - safe_not_equal: cf, - space: hf, - transition_in: _n, - transition_out: mn -} = window.__gradio__svelte__internal, { createEventDispatcher: _f } = window.__gradio__svelte__internal; -function mf(e) { + SvelteComponent: bf, + add_flush_callback: gf, + assign: pf, + bind: vf, + binding_callbacks: wf, + create_component: hn, + destroy_component: _n, + detach: yf, + get_spread_object: Ef, + get_spread_update: Sf, + init: Tf, + insert: Af, + mount_component: mn, + safe_not_equal: Hf, + space: Bf, + transition_in: dn, + transition_out: bn +} = window.__gradio__svelte__internal, { createEventDispatcher: kf } = window.__gradio__svelte__internal; +function Cf(e) { let t, n, i, r, l; const o = [ { @@ -6990,8 +7080,8 @@ function mf(e) { ]; let a = {}; for (let f = 0; f < o.length; f += 1) - a = nf(a, o[f]); - t = new $u({ props: a }); + a = pf(a, o[f]); + t = new df({ props: a }); function s(f) { e[22](f); } @@ -7056,7 +7146,7 @@ function mf(e) { return ( /*selected_index*/ e[0] !== void 0 && (u.selected_index = /*selected_index*/ - e[0]), i = new bu({ props: u }), lf.push(() => rf(i, "selected_index", s)), i.$on( + e[0]), i = new Iu({ props: u }), wf.push(() => vf(i, "selected_index", s)), i.$on( "change", /*change_handler*/ e[23] @@ -7074,14 +7164,14 @@ function mf(e) { e[26] ), { c() { - fn(t.$$.fragment), n = hf(), fn(i.$$.fragment); + hn(t.$$.fragment), n = Bf(), hn(i.$$.fragment); }, m(f, c) { - hn(t, f, c), ff(f, n, c), hn(i, f, c), l = !0; + mn(t, f, c), Af(f, n, c), mn(i, f, c), l = !0; }, p(f, c) { const h = c & /*gradio, loading_status*/ - 2097154 ? af(o, [ + 2097154 ? Sf(o, [ c & /*gradio*/ 2097152 && { autoscroll: ( @@ -7095,7 +7185,7 @@ function mf(e) { f[21].i18n ) }, c & /*loading_status*/ - 2 && sf( + 2 && Ef( /*loading_status*/ f[1] ) @@ -7132,23 +7222,23 @@ function mf(e) { 2097152 && (_.i18n = /*gradio*/ f[21].i18n), !r && c & /*selected_index*/ 1 && (r = !0, _.selected_index = /*selected_index*/ - f[0], tf(() => r = !1)), i.$set(_); + f[0], gf(() => r = !1)), i.$set(_); }, i(f) { - l || (_n(t.$$.fragment, f), _n(i.$$.fragment, f), l = !0); + l || (dn(t.$$.fragment, f), dn(i.$$.fragment, f), l = !0); }, o(f) { - mn(t.$$.fragment, f), mn(i.$$.fragment, f), l = !1; + bn(t.$$.fragment, f), bn(i.$$.fragment, f), l = !1; }, d(f) { - f && of(n), cn(t, f), cn(i, f); + f && yf(n), _n(t, f), _n(i, f); } } ); } -function df(e) { +function Pf(e) { let t, n; - return t = new zr({ + return t = new Jr({ props: { visible: ( /*visible*/ @@ -7182,15 +7272,15 @@ function df(e) { /*height*/ e[15] ) : void 0, - $$slots: { default: [mf] }, + $$slots: { default: [Cf] }, $$scope: { ctx: e } } }), { c() { - fn(t.$$.fragment); + hn(t.$$.fragment); }, m(i, r) { - hn(t, i, r), n = !0; + mn(t, i, r), n = !0; }, p(i, [r]) { const l = {}; @@ -7215,30 +7305,30 @@ function df(e) { 272622143 && (l.$$scope = { dirty: r, ctx: i }), t.$set(l); }, i(i) { - n || (_n(t.$$.fragment, i), n = !0); + n || (dn(t.$$.fragment, i), n = !0); }, o(i) { - mn(t.$$.fragment, i), n = !1; + bn(t.$$.fragment, i), n = !1; }, d(i) { - cn(t, i); + _n(t, i); } }; } -function bf(e, t, n) { - let { loading_status: i } = t, { show_label: r } = t, { label: l } = t, { root: o } = t, { proxy_url: a } = t, { elem_id: s = "" } = t, { elem_classes: u = [] } = t, { visible: f = !0 } = t, { value: c = null } = t, { container: h = !0 } = t, { scale: _ = null } = t, { min_width: b = void 0 } = t, { columns: T = [2] } = t, { rows: y = void 0 } = t, { height: C = "auto" } = t, { preview: E } = t, { allow_preview: m = !0 } = t, { selected_index: g = null } = t, { object_fit: p = "cover" } = t, { show_share_button: N = !1 } = t, { show_download_button: G = !1 } = t, { gradio: L } = t; - const Z = _f(); - function K(v) { - g = v, n(0, g); +function If(e, t, n) { + let { loading_status: i } = t, { show_label: r } = t, { label: l } = t, { root: o } = t, { proxy_url: a } = t, { elem_id: s = "" } = t, { elem_classes: u = [] } = t, { visible: f = !0 } = t, { value: c = null } = t, { container: h = !0 } = t, { scale: _ = null } = t, { min_width: g = void 0 } = t, { columns: S = [2] } = t, { rows: v = void 0 } = t, { height: A = "auto" } = t, { preview: y } = t, { allow_preview: d = !0 } = t, { selected_index: T = null } = t, { object_fit: b = "cover" } = t, { show_share_button: I = !1 } = t, { show_download_button: M = !1 } = t, { gradio: U } = t; + const O = kf(); + function V(p) { + T = p, n(0, T); } - const W = () => L.dispatch("change", c), q = (v) => L.dispatch("select", v.detail), $ = (v) => L.dispatch("share", v.detail), ee = (v) => L.dispatch("error", v.detail); - return e.$$set = (v) => { - "loading_status" in v && n(1, i = v.loading_status), "show_label" in v && n(2, r = v.show_label), "label" in v && n(3, l = v.label), "root" in v && n(4, o = v.root), "proxy_url" in v && n(5, a = v.proxy_url), "elem_id" in v && n(6, s = v.elem_id), "elem_classes" in v && n(7, u = v.elem_classes), "visible" in v && n(8, f = v.visible), "value" in v && n(9, c = v.value), "container" in v && n(10, h = v.container), "scale" in v && n(11, _ = v.scale), "min_width" in v && n(12, b = v.min_width), "columns" in v && n(13, T = v.columns), "rows" in v && n(14, y = v.rows), "height" in v && n(15, C = v.height), "preview" in v && n(16, E = v.preview), "allow_preview" in v && n(17, m = v.allow_preview), "selected_index" in v && n(0, g = v.selected_index), "object_fit" in v && n(18, p = v.object_fit), "show_share_button" in v && n(19, N = v.show_share_button), "show_download_button" in v && n(20, G = v.show_download_button), "gradio" in v && n(21, L = v.gradio); + const de = () => U.dispatch("change", c), Oe = (p) => U.dispatch("select", p.detail), q = (p) => U.dispatch("share", p.detail), z = (p) => U.dispatch("error", p.detail); + return e.$$set = (p) => { + "loading_status" in p && n(1, i = p.loading_status), "show_label" in p && n(2, r = p.show_label), "label" in p && n(3, l = p.label), "root" in p && n(4, o = p.root), "proxy_url" in p && n(5, a = p.proxy_url), "elem_id" in p && n(6, s = p.elem_id), "elem_classes" in p && n(7, u = p.elem_classes), "visible" in p && n(8, f = p.visible), "value" in p && n(9, c = p.value), "container" in p && n(10, h = p.container), "scale" in p && n(11, _ = p.scale), "min_width" in p && n(12, g = p.min_width), "columns" in p && n(13, S = p.columns), "rows" in p && n(14, v = p.rows), "height" in p && n(15, A = p.height), "preview" in p && n(16, y = p.preview), "allow_preview" in p && n(17, d = p.allow_preview), "selected_index" in p && n(0, T = p.selected_index), "object_fit" in p && n(18, b = p.object_fit), "show_share_button" in p && n(19, I = p.show_share_button), "show_download_button" in p && n(20, M = p.show_download_button), "gradio" in p && n(21, U = p.gradio); }, e.$$.update = () => { e.$$.dirty & /*selected_index*/ - 1 && Z("prop_change", { selected_index: g }); + 1 && O("prop_change", { selected_index: T }); }, [ - g, + T, i, r, l, @@ -7250,26 +7340,26 @@ function bf(e, t, n) { c, h, _, - b, - T, + g, + S, + v, + A, y, - C, - E, - m, - p, - N, - G, - L, - K, - W, + d, + b, + I, + M, + U, + V, + de, + Oe, q, - $, - ee + z ]; } -class pf extends ef { +class Nf extends bf { constructor(t) { - super(), uf(this, t, bf, df, cf, { + super(), Tf(this, t, If, Pf, Hf, { loading_status: 1, show_label: 2, label: 3, @@ -7296,6 +7386,6 @@ class pf extends ef { } } export { - bu as BaseGallery, - pf as default + Iu as BaseGallery, + Nf as default };