diff --git "a/src/backend/gradio_image_annotation/templates/component/index.js" "b/src/backend/gradio_image_annotation/templates/component/index.js" --- "a/src/backend/gradio_image_annotation/templates/component/index.js" +++ "b/src/backend/gradio_image_annotation/templates/component/index.js" @@ -12,7 +12,7 @@ const { safe_not_equal: tu, set_dynamic_element_data: Es, set_style: Pe, - toggle_class: nt, + toggle_class: tt, transition_in: pr, transition_out: wr, update_slot_base: nu @@ -53,22 +53,22 @@ function iu(t) { ), s && s.c(), Es( /*tag*/ t[14] - )(e, r), nt( + )(e, r), tt( e, "hidden", /*visible*/ t[10] === !1 - ), nt( + ), tt( e, "padded", /*padding*/ t[6] - ), nt( + ), tt( e, "border_focus", /*border_mode*/ t[5] === "focus" - ), nt(e, "hide-container", !/*explicit_call*/ + ), tt(e, "hide-container", !/*explicit_call*/ t[8] && !/*container*/ t[9]), Pe( e, @@ -143,22 +143,22 @@ function iu(t) { (!i || u & /*elem_classes*/ 8 && n !== (n = "block " + /*elem_classes*/ a[3].join(" ") + " svelte-1t38q2d")) && { class: n } - ])), nt( + ])), tt( e, "hidden", /*visible*/ a[10] === !1 - ), nt( + ), tt( e, "padded", /*padding*/ a[6] - ), nt( + ), tt( e, "border_focus", /*border_mode*/ a[5] === "focus" - ), nt(e, "hide-container", !/*explicit_call*/ + ), tt(e, "hide-container", !/*explicit_call*/ a[8] && !/*container*/ a[9]), u & /*height*/ 1 && Pe( @@ -552,7 +552,7 @@ const { set_data: Qu, space: Ku, text: $u, - toggle_class: it, + toggle_class: nt, transition_in: ef, transition_out: tf } = window.__gradio__svelte__internal; @@ -564,14 +564,14 @@ function nf(t) { e = Cs("label"), n = Cs("span"), xu(i.$$.fragment), l = Ku(), s = $u( /*label*/ t[0] - ), Zn(n, "class", "svelte-9gxdi0"), Zn(e, "for", ""), Zn(e, "data-testid", "block-label"), Zn(e, "class", "svelte-9gxdi0"), it(e, "hide", !/*show_label*/ - t[2]), it(e, "sr-only", !/*show_label*/ - t[2]), it( + ), Zn(n, "class", "svelte-9gxdi0"), Zn(e, "for", ""), Zn(e, "data-testid", "block-label"), Zn(e, "class", "svelte-9gxdi0"), nt(e, "hide", !/*show_label*/ + t[2]), nt(e, "sr-only", !/*show_label*/ + t[2]), nt( e, "float", /*float*/ t[4] - ), it( + ), nt( e, "hide-label", /*disable*/ @@ -588,17 +588,17 @@ function nf(t) { /*label*/ r[0] ), (!o || a & /*show_label*/ - 4) && it(e, "hide", !/*show_label*/ + 4) && nt(e, "hide", !/*show_label*/ r[2]), (!o || a & /*show_label*/ - 4) && it(e, "sr-only", !/*show_label*/ + 4) && nt(e, "sr-only", !/*show_label*/ r[2]), (!o || a & /*float*/ - 16) && it( + 16) && nt( e, "float", /*float*/ r[4] ), (!o || a & /*disable*/ - 8) && it( + 8) && nt( e, "hide-label", /*disable*/ @@ -636,7 +636,7 @@ class sf extends Gu { const { SvelteComponent: of, append: Ol, - attr: Qe, + attr: Je, bubble: rf, create_component: af, destroy_component: uf, @@ -662,7 +662,7 @@ function As(t) { e = Dl("span"), n = gf( /*label*/ t[1] - ), Qe(e, "class", "svelte-lpi64a"); + ), Je(e, "class", "svelte-lpi64a"); }, m(i, l) { Er(i, e, l), Ol(e, n); @@ -688,7 +688,7 @@ function wf(t) { return l = new /*Icon*/ t[0]({}), { c() { - e = Dl("button"), a && a.c(), n = mf(), i = Dl("div"), af(l.$$.fragment), Qe(i, "class", "svelte-lpi64a"), Me( + e = Dl("button"), a && a.c(), n = mf(), i = Dl("div"), af(l.$$.fragment), Je(i, "class", "svelte-lpi64a"), Me( i, "small", /*size*/ @@ -699,22 +699,22 @@ function wf(t) { /*size*/ t[4] === "large" ), e.disabled = /*disabled*/ - t[7], Qe( + t[7], Je( e, "aria-label", /*label*/ t[1] - ), Qe( + ), Je( e, "aria-haspopup", /*hasPopup*/ t[8] - ), Qe( + ), Je( e, "title", /*label*/ t[1] - ), Qe(e, "class", "svelte-lpi64a"), Me( + ), Je(e, "class", "svelte-lpi64a"), Me( e, "pending", /*pending*/ @@ -770,19 +770,19 @@ function wf(t) { ), (!s || f & /*disabled*/ 128) && (e.disabled = /*disabled*/ u[7]), (!s || f & /*label*/ - 2) && Qe( + 2) && Je( e, "aria-label", /*label*/ u[1] ), (!s || f & /*hasPopup*/ - 256) && Qe( + 256) && Je( e, "aria-haspopup", /*hasPopup*/ u[8] ), (!s || f & /*label*/ - 2) && Qe( + 2) && Je( e, "title", /*label*/ @@ -893,7 +893,7 @@ const { init: Tf, insert: Hf, safe_not_equal: Pf, - toggle_class: lt, + toggle_class: it, transition_in: Nf, transition_out: Lf, update_slot_base: If @@ -912,22 +912,22 @@ function Mf(t) { ); return { c() { - e = Bs("div"), n = Bs("div"), s && s.c(), Yi(n, "class", "icon svelte-3w3rth"), Yi(e, "class", "empty svelte-3w3rth"), Yi(e, "aria-label", "Empty value"), lt( + e = Bs("div"), n = Bs("div"), s && s.c(), Yi(n, "class", "icon svelte-3w3rth"), Yi(e, "class", "empty svelte-3w3rth"), Yi(e, "aria-label", "Empty value"), it( e, "small", /*size*/ t[0] === "small" - ), lt( + ), it( e, "large", /*size*/ t[0] === "large" - ), lt( + ), it( e, "unpadded_box", /*unpadded_box*/ t[1] - ), lt( + ), it( e, "small_parent", /*parent_height*/ @@ -957,25 +957,25 @@ function Mf(t) { ), null ), (!i || r & /*size*/ - 1) && lt( + 1) && it( e, "small", /*size*/ o[0] === "small" ), (!i || r & /*size*/ - 1) && lt( + 1) && it( e, "large", /*size*/ o[0] === "large" ), (!i || r & /*unpadded_box*/ - 2) && lt( + 2) && it( e, "unpadded_box", /*unpadded_box*/ o[1] ), (!i || r & /*parent_height*/ - 8) && lt( + 8) && it( e, "small_parent", /*parent_height*/ @@ -1045,14 +1045,14 @@ const { insert: zf, noop: Qi, safe_not_equal: jf, - set_style: Ge, + set_style: je, svg_element: Jn } = window.__gradio__svelte__internal; function Gf(t) { let e, n, i, l; return { c() { - e = Jn("svg"), n = Jn("g"), i = Jn("path"), l = Jn("path"), Re(i, "d", "M18,6L6.087,17.913"), Ge(i, "fill", "none"), Ge(i, "fill-rule", "nonzero"), Ge(i, "stroke-width", "2px"), Re(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), Re(l, "d", "M4.364,4.364L19.636,19.636"), Ge(l, "fill", "none"), Ge(l, "fill-rule", "nonzero"), Ge(l, "stroke-width", "2px"), Re(e, "width", "100%"), Re(e, "height", "100%"), Re(e, "viewBox", "0 0 24 24"), Re(e, "version", "1.1"), Re(e, "xmlns", "http://www.w3.org/2000/svg"), Re(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Re(e, "xml:space", "preserve"), Re(e, "stroke", "currentColor"), Ge(e, "fill-rule", "evenodd"), Ge(e, "clip-rule", "evenodd"), Ge(e, "stroke-linecap", "round"), Ge(e, "stroke-linejoin", "round"); + e = Jn("svg"), n = Jn("g"), i = Jn("path"), l = Jn("path"), Re(i, "d", "M18,6L6.087,17.913"), je(i, "fill", "none"), je(i, "fill-rule", "nonzero"), je(i, "stroke-width", "2px"), Re(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), Re(l, "d", "M4.364,4.364L19.636,19.636"), je(l, "fill", "none"), je(l, "fill-rule", "nonzero"), je(l, "stroke-width", "2px"), Re(e, "width", "100%"), Re(e, "height", "100%"), Re(e, "viewBox", "0 0 24 24"), Re(e, "version", "1.1"), Re(e, "xmlns", "http://www.w3.org/2000/svg"), Re(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Re(e, "xml:space", "preserve"), Re(e, "stroke", "currentColor"), je(e, "fill-rule", "evenodd"), je(e, "clip-rule", "evenodd"), je(e, "stroke-linecap", "round"), je(e, "stroke-linejoin", "round"); }, m(s, o) { zf(s, e, o), Ji(e, n), Ji(n, i), Ji(e, l); @@ -1337,7 +1337,7 @@ let Ar = class extends jc { const { SvelteComponent: Zc, append: Is, - attr: st, + attr: lt, detach: Yc, init: Jc, insert: Qc, @@ -1349,7 +1349,7 @@ function $c(t) { let e, n, i; return { c() { - e = ul("svg"), n = ul("path"), i = ul("path"), st(n, "fill", "currentColor"), st(n, "d", "M12 2c-4.963 0-9 4.038-9 9c0 3.328 1.82 6.232 4.513 7.79l-2.067 1.378A1 1 0 0 0 6 22h12a1 1 0 0 0 .555-1.832l-2.067-1.378C19.18 17.232 21 14.328 21 11c0-4.962-4.037-9-9-9zm0 16c-3.859 0-7-3.141-7-7c0-3.86 3.141-7 7-7s7 3.14 7 7c0 3.859-3.141 7-7 7z"), st(i, "fill", "currentColor"), st(i, "d", "M12 6c-2.757 0-5 2.243-5 5s2.243 5 5 5s5-2.243 5-5s-2.243-5-5-5zm0 8c-1.654 0-3-1.346-3-3s1.346-3 3-3s3 1.346 3 3s-1.346 3-3 3z"), st(e, "xmlns", "http://www.w3.org/2000/svg"), st(e, "width", "100%"), st(e, "height", "100%"), st(e, "viewBox", "0 0 24 24"); + e = ul("svg"), n = ul("path"), i = ul("path"), lt(n, "fill", "currentColor"), lt(n, "d", "M12 2c-4.963 0-9 4.038-9 9c0 3.328 1.82 6.232 4.513 7.79l-2.067 1.378A1 1 0 0 0 6 22h12a1 1 0 0 0 .555-1.832l-2.067-1.378C19.18 17.232 21 14.328 21 11c0-4.962-4.037-9-9-9zm0 16c-3.859 0-7-3.141-7-7c0-3.86 3.141-7 7-7s7 3.14 7 7c0 3.859-3.141 7-7 7z"), lt(i, "fill", "currentColor"), lt(i, "d", "M12 6c-2.757 0-5 2.243-5 5s2.243 5 5 5s5-2.243 5-5s-2.243-5-5-5zm0 8c-1.654 0-3-1.346-3-3s1.346-3 3-3s3 1.346 3 3s-1.346 3-3 3z"), lt(e, "xmlns", "http://www.w3.org/2000/svg"), lt(e, "width", "100%"), lt(e, "height", "100%"), lt(e, "viewBox", "0 0 24 24"); }, m(l, s) { Qc(l, e, s), Is(e, n), Is(e, i); @@ -1994,7 +1994,7 @@ class Pr extends b_ { const { SvelteComponent: A_, append: fl, - attr: Ye, + attr: Ze, check_outros: An, create_component: Oi, destroy_component: Di, @@ -2008,7 +2008,7 @@ const { mount_component: Ui, safe_not_equal: H_, space: cl, - toggle_class: _t, + toggle_class: ct, transition_in: fe, transition_out: Ae } = window.__gradio__svelte__internal; @@ -2028,7 +2028,7 @@ function Rs(t) { ), u, f = n && Us(t), _ = l && Fs(t), h = o && qs(t), c = a && zs(t); return { c() { - e = jn("span"), f && f.c(), i = cl(), _ && _.c(), s = cl(), h && h.c(), r = cl(), c && c.c(), Ye(e, "class", "source-selection svelte-1jp3vgd"), Ye(e, "data-testid", "source-select"); + e = jn("span"), f && f.c(), i = cl(), _ && _.c(), s = cl(), h && h.c(), r = cl(), c && c.c(), Ze(e, "class", "source-selection svelte-1jp3vgd"), Ze(e, "data-testid", "source-select"); }, m(d, b) { hn(d, e, b), f && f.m(e, null), fl(e, i), _ && _.m(e, null), fl(e, s), h && h.m(e, null), fl(e, r), c && c.m(e, null), u = !0; @@ -2071,7 +2071,7 @@ function Us(t) { let e, n, i, l, s; return n = new Ar({}), { c() { - e = jn("button"), Oi(n.$$.fragment), Ye(e, "class", "icon svelte-1jp3vgd"), Ye(e, "aria-label", "Upload file"), _t( + e = jn("button"), Oi(n.$$.fragment), Ze(e, "class", "icon svelte-1jp3vgd"), Ze(e, "aria-label", "Upload file"), ct( e, "selected", /*active_source*/ @@ -2089,7 +2089,7 @@ function Us(t) { }, p(o, r) { (!i || r & /*active_source*/ - 1) && _t( + 1) && ct( e, "selected", /*active_source*/ @@ -2112,7 +2112,7 @@ function Fs(t) { let e, n, i, l, s; return n = new zc({}), { c() { - e = jn("button"), Oi(n.$$.fragment), Ye(e, "class", "icon svelte-1jp3vgd"), Ye(e, "aria-label", "Record audio"), _t( + e = jn("button"), Oi(n.$$.fragment), Ze(e, "class", "icon svelte-1jp3vgd"), Ze(e, "aria-label", "Record audio"), ct( e, "selected", /*active_source*/ @@ -2129,7 +2129,7 @@ function Fs(t) { }, p(o, r) { (!i || r & /*active_source*/ - 1) && _t( + 1) && ct( e, "selected", /*active_source*/ @@ -2151,7 +2151,7 @@ function qs(t) { let e, n, i, l, s; return n = new e_({}), { c() { - e = jn("button"), Oi(n.$$.fragment), Ye(e, "class", "icon svelte-1jp3vgd"), Ye(e, "aria-label", "Capture from camera"), _t( + e = jn("button"), Oi(n.$$.fragment), Ze(e, "class", "icon svelte-1jp3vgd"), Ze(e, "aria-label", "Capture from camera"), ct( e, "selected", /*active_source*/ @@ -2168,7 +2168,7 @@ function qs(t) { }, p(o, r) { (!i || r & /*active_source*/ - 1) && _t( + 1) && ct( e, "selected", /*active_source*/ @@ -2190,7 +2190,7 @@ function zs(t) { let e, n, i, l, s; return n = new Cr({}), { c() { - e = jn("button"), Oi(n.$$.fragment), Ye(e, "class", "icon svelte-1jp3vgd"), Ye(e, "aria-label", "Paste from clipboard"), _t( + e = jn("button"), Oi(n.$$.fragment), Ze(e, "class", "icon svelte-1jp3vgd"), Ze(e, "aria-label", "Paste from clipboard"), ct( e, "selected", /*active_source*/ @@ -2207,7 +2207,7 @@ function zs(t) { }, p(o, r) { (!i || r & /*active_source*/ - 1) && _t( + 1) && ct( e, "selected", /*active_source*/ @@ -2563,29 +2563,29 @@ class J_ extends z_ { const { SvelteComponent: Q_, append: At, - attr: We, + attr: Xe, binding_callbacks: Js, check_outros: Mr, create_component: K_, create_slot: $_, destroy_component: eh, destroy_each: Or, - detach: O, - element: Ke, + detach: D, + element: Qe, empty: mn, ensure_array_like: ki, get_all_dirty_from_scope: th, get_slot_changes: nh, group_outros: Dr, init: ih, - insert: D, + insert: R, mount_component: lh, noop: jl, safe_not_equal: sh, set_data: De, - set_style: ut, - space: Ze, - text: le, + set_style: at, + space: We, + text: ie, toggle_class: Oe, transition_in: on, transition_out: rn, @@ -2616,10 +2616,10 @@ function fh(t) { ); return { c() { - e = Ke("span"), i = le(n), l = Ze(), r && r.c(), We(e, "class", "error svelte-1yserjw"); + e = Qe("span"), i = ie(n), l = We(), r && r.c(), Xe(e, "class", "error svelte-1yserjw"); }, m(a, u) { - D(a, e, u), At(e, i), D(a, l, u), r && r.m(a, u), s = !0; + R(a, e, u), At(e, i), R(a, l, u), r && r.m(a, u), s = !0; }, p(a, u) { (!s || u[0] & /*i18n*/ @@ -2651,7 +2651,7 @@ function fh(t) { rn(r, a), s = !1; }, d(a) { - a && (O(e), O(l)), r && r.d(a); + a && (D(e), D(l)), r && r.d(a); } }; } @@ -2700,7 +2700,7 @@ function ch(t) { t[5] && fo(t); return { c() { - f && f.c(), e = Ze(), n = Ke("div"), c && c.c(), i = Ze(), d && d.c(), l = Ze(), o && o.c(), r = Ze(), y && y.c(), a = mn(), We(n, "class", "progress-text svelte-1yserjw"), Oe( + f && f.c(), e = We(), n = Qe("div"), c && c.c(), i = We(), d && d.c(), l = We(), o && o.c(), r = We(), y && y.c(), a = mn(), Xe(n, "class", "progress-text svelte-1yserjw"), Oe( n, "meta-text-center", /*variant*/ @@ -2713,7 +2713,7 @@ function ch(t) { ); }, m(w, C) { - f && f.m(w, C), D(w, e, C), D(w, n, C), c && c.m(n, null), At(n, i), d && d.m(n, null), D(w, l, C), ~s && p[s].m(w, C), D(w, r, C), y && y.m(w, C), D(w, a, C), u = !0; + f && f.m(w, C), R(w, e, C), R(w, n, C), c && c.m(n, null), At(n, i), d && d.m(n, null), R(w, l, C), ~s && p[s].m(w, C), R(w, r, C), y && y.m(w, C), R(w, a, C), u = !0; }, p(w, C) { /*variant*/ @@ -2746,7 +2746,7 @@ function ch(t) { rn(o), u = !1; }, d(w) { - w && (O(e), O(n), O(l), O(r), O(a)), f && f.d(w), c && c.d(), d && d.d(), ~s && p[s].d(w), y && y.d(w); + w && (D(e), D(n), D(l), D(r), D(a)), f && f.d(w), c && c.d(), d && d.d(), ~s && p[s].d(w), y && y.d(w); } }; } @@ -2755,18 +2755,18 @@ function eo(t) { (t[17] || 0) * 100 - 100}%)`; return { c() { - e = Ke("div"), We(e, "class", "eta-bar svelte-1yserjw"), ut(e, "transform", n); + e = Qe("div"), Xe(e, "class", "eta-bar svelte-1yserjw"), at(e, "transform", n); }, m(i, l) { - D(i, e, l); + R(i, e, l); }, p(i, l) { l[0] & /*eta_level*/ 131072 && n !== (n = `translateX(${/*eta_level*/ - (i[17] || 0) * 100 - 100}%)`) && ut(e, "transform", n); + (i[17] || 0) * 100 - 100}%)`) && at(e, "transform", n); }, d(i) { - i && O(e); + i && D(e); } }; } @@ -2774,14 +2774,14 @@ function _h(t) { let e; return { c() { - e = le("processing |"); + e = ie("processing |"); }, m(n, i) { - D(n, e, i); + R(n, e, i); }, p: jl, d(n) { - n && O(e); + n && D(e); } }; } @@ -2792,13 +2792,13 @@ function hh(t) { ), i, l, s, o; return { c() { - e = le("queue: "), i = le(n), l = le("/"), s = le( + e = ie("queue: "), i = ie(n), l = ie("/"), s = ie( /*queue_size*/ t[3] - ), o = le(" |"); + ), o = ie(" |"); }, m(r, a) { - D(r, e, a), D(r, i, a), D(r, l, a), D(r, s, a), D(r, o, a); + R(r, e, a), R(r, i, a), R(r, l, a), R(r, s, a), R(r, o, a); }, p(r, a) { a[0] & /*queue_position*/ @@ -2811,7 +2811,7 @@ function hh(t) { ); }, d(r) { - r && (O(e), O(i), O(l), O(s), O(o)); + r && (D(e), D(i), D(l), D(s), D(o)); } }; } @@ -2831,7 +2831,7 @@ function dh(t) { m(l, s) { for (let o = 0; o < i.length; o += 1) i[o] && i[o].m(l, s); - D(l, e, s); + R(l, e, s); }, p(l, s) { if (s[0] & /*progress*/ @@ -2851,7 +2851,7 @@ function dh(t) { } }, d(l) { - l && O(e), Or(i, l); + l && D(e), Or(i, l); } }; } @@ -2869,10 +2869,10 @@ function to(t) { let a = r(t), u = a(t); return { c() { - u.c(), e = Ze(), i = le(n), l = le(" | "), o = le(s); + u.c(), e = We(), i = ie(n), l = ie(" | "), o = ie(s); }, m(f, _) { - u.m(f, _), D(f, e, _), D(f, i, _), D(f, l, _), D(f, o, _); + u.m(f, _), R(f, e, _), R(f, i, _), R(f, l, _), R(f, o, _); }, p(f, _) { a === (a = r(f)) && u ? u.p(f, _) : (u.d(1), u = a(f), u && (u.c(), u.m(e.parentNode, e))), _[0] & /*progress*/ @@ -2880,7 +2880,7 @@ function to(t) { f[38].unit + "") && De(i, n); }, d(f) { - f && (O(e), O(i), O(l), O(o)), u.d(f); + f && (D(e), D(i), D(l), D(o)), u.d(f); } }; } @@ -2891,10 +2891,10 @@ function mh(t) { ) + "", n; return { c() { - n = le(e); + n = ie(e); }, m(i, l) { - D(i, n, l); + R(i, n, l); }, p(i, l) { l[0] & /*progress*/ @@ -2904,7 +2904,7 @@ function mh(t) { ) + "") && De(n, e); }, d(i) { - i && O(n); + i && D(n); } }; } @@ -2918,10 +2918,10 @@ function gh(t) { ) + "", s; return { c() { - n = le(e), i = le("/"), s = le(l); + n = ie(e), i = ie("/"), s = ie(l); }, m(o, r) { - D(o, n, r), D(o, i, r), D(o, s, r); + R(o, n, r), R(o, i, r), R(o, s, r); }, p(o, r) { r[0] & /*progress*/ @@ -2935,7 +2935,7 @@ function gh(t) { ) + "") && De(s, l); }, d(o) { - o && (O(n), O(i), O(s)); + o && (D(n), D(i), D(s)); } }; } @@ -2949,14 +2949,14 @@ function no(t) { n && n.c(), e = mn(); }, m(i, l) { - n && n.m(i, l), D(i, e, l); + n && n.m(i, l), R(i, e, l); }, p(i, l) { /*p*/ i[38].index != null ? n ? n.p(i, l) : (n = to(i), n.c(), n.m(e.parentNode, e)) : n && (n.d(1), n = null); }, d(i) { - i && O(e), n && n.d(i); + i && D(e), n && n.d(i); } }; } @@ -2968,13 +2968,13 @@ function io(t) { ), i, l; return { c() { - e = le( + e = ie( /*formatted_timer*/ t[20] - ), i = le(n), l = le("s"); + ), i = ie(n), l = ie("s"); }, m(s, o) { - D(s, e, o), D(s, i, o), D(s, l, o); + R(s, e, o), R(s, i, o), R(s, l, o); }, p(s, o) { o[0] & /*formatted_timer*/ @@ -2988,7 +2988,7 @@ function io(t) { s[19]}` : "") && De(i, n); }, d(s) { - s && (O(e), O(i), O(l)); + s && (D(e), D(i), D(l)); } }; } @@ -3031,21 +3031,21 @@ function ph(t) { ); return { c() { - e = Ke("div"), n = Ke("div"), r && r.c(), i = Ze(), l = Ke("div"), s = Ke("div"), We(n, "class", "progress-level-inner svelte-1yserjw"), We(s, "class", "progress-bar svelte-1yserjw"), ut(s, "width", o), We(l, "class", "progress-bar-wrap svelte-1yserjw"), We(e, "class", "progress-level svelte-1yserjw"); + e = Qe("div"), n = Qe("div"), r && r.c(), i = We(), l = Qe("div"), s = Qe("div"), Xe(n, "class", "progress-level-inner svelte-1yserjw"), Xe(s, "class", "progress-bar svelte-1yserjw"), at(s, "width", o), Xe(l, "class", "progress-bar-wrap svelte-1yserjw"), Xe(e, "class", "progress-level svelte-1yserjw"); }, m(a, u) { - D(a, e, u), At(e, n), r && r.m(n, null), At(e, i), At(e, l), At(l, s), t[30](s); + R(a, e, u), At(e, n), r && r.m(n, null), At(e, i), At(e, l), At(l, s), t[30](s); }, p(a, u) { /*progress*/ a[7] != null ? r ? r.p(a, u) : (r = lo(a), r.c(), r.m(n, null)) : r && (r.d(1), r = null), u[0] & /*last_progress_level*/ 32768 && o !== (o = `${/*last_progress_level*/ - a[15] * 100}%`) && ut(s, "width", o); + a[15] * 100}%`) && at(s, "width", o); }, i: jl, o: jl, d(a) { - a && O(e), r && r.d(), t[30](null); + a && D(e), r && r.d(), t[30](null); } }; } @@ -3065,7 +3065,7 @@ function lo(t) { m(l, s) { for (let o = 0; o < i.length; o += 1) i[o] && i[o].m(l, s); - D(l, e, s); + R(l, e, s); }, p(l, s) { if (s[0] & /*progress_level, progress*/ @@ -3085,7 +3085,7 @@ function lo(t) { } }, d(l) { - l && O(e), Or(i, l); + l && D(e), Or(i, l); } }; } @@ -3110,10 +3110,10 @@ function so(t) { ); return { c() { - s && s.c(), e = Ze(), o && o.c(), n = Ze(), r && r.c(), i = Ze(), a && a.c(), l = mn(); + s && s.c(), e = We(), o && o.c(), n = We(), r && r.c(), i = We(), a && a.c(), l = mn(); }, m(u, f) { - s && s.m(u, f), D(u, e, f), o && o.m(u, f), D(u, n, f), r && r.m(u, f), D(u, i, f), a && a.m(u, f), D(u, l, f); + s && s.m(u, f), R(u, e, f), o && o.m(u, f), R(u, n, f), r && r.m(u, f), R(u, i, f), a && a.m(u, f), R(u, l, f); }, p(u, f) { /*p*/ @@ -3127,7 +3127,7 @@ function so(t) { u[14] != null ? a ? a.p(u, f) : (a = ao(u), a.c(), a.m(l.parentNode, l)) : a && (a.d(1), a = null); }, d(u) { - u && (O(e), O(n), O(i), O(l)), s && s.d(u), o && o.d(u), r && r.d(u), a && a.d(u); + u && (D(e), D(n), D(i), D(l)), s && s.d(u), o && o.d(u), r && r.d(u), a && a.d(u); } }; } @@ -3135,13 +3135,13 @@ function wh(t) { let e; return { c() { - e = le(" /"); + e = ie(" /"); }, m(n, i) { - D(n, e, i); + R(n, e, i); }, d(n) { - n && O(e); + n && D(e); } }; } @@ -3152,10 +3152,10 @@ function oo(t) { ), n; return { c() { - n = le(e); + n = ie(e); }, m(i, l) { - D(i, n, l); + R(i, n, l); }, p(i, l) { l[0] & /*progress*/ @@ -3163,7 +3163,7 @@ function oo(t) { i[38].desc + "") && De(n, e); }, d(i) { - i && O(n); + i && D(n); } }; } @@ -3171,13 +3171,13 @@ function ro(t) { let e; return { c() { - e = le("-"); + e = ie("-"); }, m(n, i) { - D(n, e, i); + R(n, e, i); }, d(n) { - n && O(e); + n && D(e); } }; } @@ -3189,10 +3189,10 @@ function ao(t) { ] || 0)).toFixed(1) + "", n, i; return { c() { - n = le(e), i = le("%"); + n = ie(e), i = ie("%"); }, m(l, s) { - D(l, n, s), D(l, i, s); + R(l, n, s), R(l, i, s); }, p(l, s) { s[0] & /*progress_level*/ @@ -3203,7 +3203,7 @@ function ao(t) { ] || 0)).toFixed(1) + "") && De(n, e); }, d(l) { - l && (O(n), O(i)); + l && (D(n), D(i)); } }; } @@ -3222,7 +3222,7 @@ function uo(t) { n && n.c(), e = mn(); }, m(i, l) { - n && n.m(i, l), D(i, e, l); + n && n.m(i, l), R(i, e, l); }, p(i, l) { /*p*/ @@ -3234,7 +3234,7 @@ function uo(t) { ] != null ? n ? n.p(i, l) : (n = so(i), n.c(), n.m(e.parentNode, e)) : n && (n.d(1), n = null); }, d(i) { - i && O(e), n && n.d(i); + i && D(e), n && n.d(i); } }; } @@ -3242,13 +3242,13 @@ function fo(t) { let e, n; return { c() { - e = Ke("p"), n = le( + e = Qe("p"), n = ie( /*loading_text*/ t[9] - ), We(e, "class", "loading svelte-1yserjw"); + ), Xe(e, "class", "loading svelte-1yserjw"); }, m(i, l) { - D(i, e, l), At(e, n); + R(i, e, l), At(e, n); }, p(i, l) { l[0] & /*loading_text*/ @@ -3259,7 +3259,7 @@ function fo(t) { ); }, d(i) { - i && O(e); + i && D(e); } }; } @@ -3277,7 +3277,7 @@ function vh(t) { } return ~(n = a(t)) && (i = r[n] = o[n](t)), { c() { - e = Ke("div"), i && i.c(), We(e, "class", l = "wrap " + /*variant*/ + e = Qe("div"), i && i.c(), Xe(e, "class", l = "wrap " + /*variant*/ t[8] + " " + /*show_progress*/ t[6] + " svelte-1yserjw"), Oe(e, "hide", !/*status*/ t[4] || /*status*/ @@ -3301,12 +3301,12 @@ function vh(t) { "border", /*border*/ t[12] - ), ut( + ), at( e, "position", /*absolute*/ t[10] ? "absolute" : "static" - ), ut( + ), at( e, "padding", /*absolute*/ @@ -3314,7 +3314,7 @@ function vh(t) { ); }, m(u, f) { - D(u, e, f), ~n && r[n].m(e, null), t[31](e), s = !0; + R(u, e, f), ~n && r[n].m(e, null), t[31](e), s = !0; }, p(u, f) { let _ = n; @@ -3323,7 +3323,7 @@ function vh(t) { }), Mr()), ~n ? (i = r[n], i ? i.p(u, f) : (i = r[n] = o[n](u), i.c()), on(i, 1), i.m(e, null)) : i = null), (!s || f[0] & /*variant, show_progress*/ 320 && l !== (l = "wrap " + /*variant*/ u[8] + " " + /*show_progress*/ - u[6] + " svelte-1yserjw")) && We(e, "class", l), (!s || f[0] & /*variant, show_progress, status, show_progress*/ + u[6] + " svelte-1yserjw")) && Xe(e, "class", l), (!s || f[0] & /*variant, show_progress, status, show_progress*/ 336) && Oe(e, "hide", !/*status*/ u[4] || /*status*/ u[4] === "complete" || /*show_progress*/ @@ -3350,13 +3350,13 @@ function vh(t) { /*border*/ u[12] ), f[0] & /*absolute*/ - 1024 && ut( + 1024 && at( e, "position", /*absolute*/ u[10] ? "absolute" : "static" ), f[0] & /*absolute*/ - 1024 && ut( + 1024 && at( e, "padding", /*absolute*/ @@ -3370,7 +3370,7 @@ function vh(t) { rn(i), s = !1; }, d(u) { - u && O(e), ~n && r[n].d(), t[31](null); + u && D(e), ~n && r[n].d(), t[31](null); } }; } @@ -3392,7 +3392,7 @@ async function yh(t, e = !0) { } } function Eh(t, e, n) { - let i, { $$slots: l = {}, $$scope: s } = e, { i18n: o } = e, { eta: r = null } = e, { queue_position: a } = e, { queue_size: u } = e, { status: f } = e, { scroll_to_output: _ = !1 } = e, { timer: h = !0 } = e, { show_progress: c = "full" } = e, { message: d = null } = e, { progress: b = null } = e, { variant: p = "default" } = e, { loading_text: g = "Loading..." } = e, { absolute: y = !0 } = e, { translucent: w = !1 } = e, { border: C = !1 } = e, { autoscroll: P } = e, E, N = !1, v = 0, A = 0, B = null, L = null, x = 0, Y = null, _e, te = null, Ee = !0; + let i, { $$slots: l = {}, $$scope: s } = e, { i18n: o } = e, { eta: r = null } = e, { queue_position: a } = e, { queue_size: u } = e, { status: f } = e, { scroll_to_output: _ = !1 } = e, { timer: h = !0 } = e, { show_progress: c = "full" } = e, { message: d = null } = e, { progress: b = null } = e, { variant: p = "default" } = e, { loading_text: g = "Loading..." } = e, { absolute: y = !0 } = e, { translucent: w = !1 } = e, { border: C = !1 } = e, { autoscroll: P } = e, E, N = !1, v = 0, A = 0, B = null, I = null, G = 0, Z = null, _e, $ = null, Ee = !0; const ve = () => { n(0, r = n(26, B = n(19, S = null))), n(24, v = performance.now()), n(25, A = 0), N = !0, de(); }; @@ -3410,10 +3410,10 @@ function Eh(t, e, n) { let S = null; function k(m) { Js[m ? "unshift" : "push"](() => { - te = m, n(16, te), n(7, b), n(14, Y), n(15, _e); + $ = m, n(16, $), n(7, b), n(14, Z), n(15, _e); }); } - function I(m) { + function M(m) { Js[m ? "unshift" : "push"](() => { E = m, n(13, E); }); @@ -3422,15 +3422,15 @@ function Eh(t, e, n) { "i18n" in m && n(1, o = m.i18n), "eta" in m && n(0, r = m.eta), "queue_position" in m && n(2, a = m.queue_position), "queue_size" in m && n(3, u = m.queue_size), "status" in m && n(4, f = m.status), "scroll_to_output" in m && n(21, _ = m.scroll_to_output), "timer" in m && n(5, h = m.timer), "show_progress" in m && n(6, c = m.show_progress), "message" in m && n(22, d = m.message), "progress" in m && n(7, b = m.progress), "variant" in m && n(8, p = m.variant), "loading_text" in m && n(9, g = m.loading_text), "absolute" in m && n(10, y = m.absolute), "translucent" in m && n(11, w = m.translucent), "border" in m && n(12, C = m.border), "autoscroll" in m && n(23, P = m.autoscroll), "$$scope" in m && n(28, s = m.$$scope); }, t.$$.update = () => { t.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ - 218103809 && (r === null && n(0, r = B), r != null && B !== r && (n(27, L = (performance.now() - v) / 1e3 + r), n(19, S = L.toFixed(1)), n(26, B = r))), t.$$.dirty[0] & /*eta_from_start, timer_diff*/ - 167772160 && n(17, x = L === null || L <= 0 || !A ? null : Math.min(A / L, 1)), t.$$.dirty[0] & /*progress*/ + 218103809 && (r === null && n(0, r = B), r != null && B !== r && (n(27, I = (performance.now() - v) / 1e3 + r), n(19, S = I.toFixed(1)), n(26, B = r))), t.$$.dirty[0] & /*eta_from_start, timer_diff*/ + 167772160 && n(17, G = I === null || I <= 0 || !A ? null : Math.min(A / I, 1)), t.$$.dirty[0] & /*progress*/ 128 && b != null && n(18, Ee = !1), t.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ - 114816 && (b != null ? n(14, Y = b.map((m) => { + 114816 && (b != null ? n(14, Z = b.map((m) => { if (m.index != null && m.length != null) return m.index / m.length; if (m.progress != null) return m.progress; - })) : n(14, Y = null), Y ? (n(15, _e = Y[Y.length - 1]), te && (_e === 0 ? n(16, te.style.transition = "0", te) : n(16, te.style.transition = "150ms", te))) : n(15, _e = void 0)), t.$$.dirty[0] & /*status*/ + })) : n(14, Z = null), Z ? (n(15, _e = Z[Z.length - 1]), $ && (_e === 0 ? n(16, $.style.transition = "0", $) : n(16, $.style.transition = "150ms", $))) : n(15, _e = void 0)), t.$$.dirty[0] & /*status*/ 16 && (f === "pending" ? ve() : ce()), t.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ 10493968 && E && _ && (f === "pending" || f === "complete") && yh(E, P), t.$$.dirty[0] & /*status, message*/ 4194320, t.$$.dirty[0] & /*timer_diff*/ @@ -3450,10 +3450,10 @@ function Eh(t, e, n) { w, C, E, - Y, + Z, _e, - te, - x, + $, + G, Ee, S, i, @@ -3463,11 +3463,11 @@ function Eh(t, e, n) { v, A, B, - L, + I, s, l, k, - I + M ]; } class kh extends Q_ { @@ -4123,7 +4123,7 @@ function Jh(t, e) { return new Promise(async (a) => { const { status_callback: u, hf_token: f } = r, _ = { predict: _e, - submit: te, + submit: $, view_api: ce, component_server: de }; @@ -4136,14 +4136,14 @@ function Jh(t, e) { const E = {}, N = /* @__PURE__ */ new Set(); let v, A = {}, B = !1; f && b && (B = await $h(b, f)); - async function L(S) { + async function I(S) { if (v = S, window.location.protocol === "https:" && (v.root = v.root.replace("http://", "https://")), A = xh((S == null ? void 0 : S.dependencies) || []), v.auth_required) return { config: v, ..._ }; try { - x = await ce(v); + G = await ce(v); } catch (k) { console.error(`Could not get api details: ${k.message}`); } @@ -4152,8 +4152,8 @@ function Jh(t, e) { ..._ }; } - let x; - async function Y(S) { + let G; + async function Z(S) { if (u && u(S), S.status === "running") try { v = await po( @@ -4161,7 +4161,7 @@ function Jh(t, e) { `${c}//${d}`, f ); - const k = await L(v); + const k = await I(v); a(k); } catch (k) { console.error(k), u && u({ @@ -4178,13 +4178,13 @@ function Jh(t, e) { `${c}//${d}`, f ); - const S = await L(v); + const S = await I(v); a(S); } catch (S) { console.error(S), b ? xl( b, Wr.test(b) ? "space_name" : "subdomain", - Y + Z ) : u && u({ status: "error", message: "Could not load this space.", @@ -4192,186 +4192,186 @@ function Jh(t, e) { detail: "NOT_FOUND" }); } - function _e(S, k, I) { + function _e(S, k, M) { let m = !1, T = !1, ae; if (typeof S == "number") ae = v.dependencies[S]; else { - const J = S.replace(/^\//, ""); - ae = v.dependencies[A[J]]; + const Y = S.replace(/^\//, ""); + ae = v.dependencies[A[Y]]; } if (ae.types.continuous) throw new Error( "Cannot call predict on this function as it may run forever. Use submit instead" ); - return new Promise((J, ke) => { - const He = te(S, k, I); - let R; + return new Promise((Y, ke) => { + const He = $(S, k, M); + let U; He.on("data", (Se) => { - T && (He.destroy(), J(Se)), m = !0, R = Se; + T && (He.destroy(), Y(Se)), m = !0, U = Se; }).on("status", (Se) => { - Se.stage === "error" && ke(Se), Se.stage === "complete" && (T = !0, m && (He.destroy(), J(R))); + Se.stage === "error" && ke(Se), Se.stage === "complete" && (T = !0, m && (He.destroy(), Y(U))); }); }); } - function te(S, k, I, m = null) { + function $(S, k, M, m = null) { let T, ae; if (typeof S == "number") - T = S, ae = x.unnamed_endpoints[T]; + T = S, ae = G.unnamed_endpoints[T]; else { - const K = S.replace(/^\//, ""); - T = A[K], ae = x.named_endpoints[S.trim()]; + const J = S.replace(/^\//, ""); + T = A[J], ae = G.named_endpoints[S.trim()]; } if (typeof T != "number") throw new Error( "There is no endpoint matching that name of fn_index matching that number." ); - let J, ke, He = v.protocol ?? "ws"; - const R = typeof S == "number" ? "/predict" : S; - let Se, H = null, U = !1; - const Q = {}; - let j = ""; - typeof window < "u" && (j = new URLSearchParams(window.location.search).toString()), s(`${v.root}`, k, ae, f).then( - (K) => { + let Y, ke, He = v.protocol ?? "ws"; + const U = typeof S == "number" ? "/predict" : S; + let Se, H = null, L = !1; + const le = {}; + let ee = ""; + typeof window < "u" && (ee = new URLSearchParams(window.location.search).toString()), s(`${v.root}`, k, ae, f).then( + (J) => { if (Se = { - data: K || [], - event_data: I, + data: J || [], + event_data: M, fn_index: T, trigger_id: m }, e0(T, v)) - M({ + O({ type: "status", - endpoint: R, + endpoint: U, stage: "pending", queue: !1, fn_index: T, time: /* @__PURE__ */ new Date() }), n( - `${v.root}/run${R.startsWith("/") ? R : `/${R}`}${j ? "?" + j : ""}`, + `${v.root}/run${U.startsWith("/") ? U : `/${U}`}${ee ? "?" + ee : ""}`, { ...Se, session_hash: p }, f - ).then(([ne, Z]) => { - const he = ne.data; - Z == 200 ? (M({ + ).then(([te, W]) => { + const he = te.data; + W == 200 ? (O({ type: "data", - endpoint: R, + endpoint: U, fn_index: T, data: he, time: /* @__PURE__ */ new Date() - }), M({ + }), O({ type: "status", - endpoint: R, + endpoint: U, fn_index: T, stage: "complete", - eta: ne.average_duration, + eta: te.average_duration, queue: !1, time: /* @__PURE__ */ new Date() - })) : M({ + })) : O({ type: "status", stage: "error", - endpoint: R, + endpoint: U, fn_index: T, - message: ne.error, + message: te.error, queue: !1, time: /* @__PURE__ */ new Date() }); - }).catch((ne) => { - M({ + }).catch((te) => { + O({ type: "status", stage: "error", - message: ne.message, - endpoint: R, + message: te.message, + endpoint: U, fn_index: T, queue: !1, time: /* @__PURE__ */ new Date() }); }); else if (He == "ws") { - M({ + O({ type: "status", stage: "pending", queue: !0, - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date() }); - let ne = new URL(`${h}://${Xr( + let te = new URL(`${h}://${Xr( d, v.path, !0 )} - /queue/join${j ? "?" + j : ""}`); - B && ne.searchParams.set("__sign", B), J = new WebSocket(ne), J.onclose = (Z) => { - Z.wasClean || M({ + /queue/join${ee ? "?" + ee : ""}`); + B && te.searchParams.set("__sign", B), Y = new WebSocket(te), Y.onclose = (W) => { + W.wasClean || O({ type: "status", stage: "error", broken: !0, message: bt, queue: !0, - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date() }); - }, J.onmessage = function(Z) { - const he = JSON.parse(Z.data), { type: ue, status: V, data: W } = ml( + }, Y.onmessage = function(W) { + const he = JSON.parse(W.data), { type: ue, status: x, data: X } = ml( he, g[T] ); - if (ue === "update" && V && !U) - M({ + if (ue === "update" && x && !L) + O({ type: "status", - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date(), - ...V - }), V.stage === "error" && J.close(); + ...x + }), x.stage === "error" && Y.close(); else if (ue === "hash") { - J.send(JSON.stringify({ fn_index: T, session_hash: p })); + Y.send(JSON.stringify({ fn_index: T, session_hash: p })); return; } else - ue === "data" ? J.send(JSON.stringify({ ...Se, session_hash: p })) : ue === "complete" ? U = V : ue === "log" ? M({ + ue === "data" ? Y.send(JSON.stringify({ ...Se, session_hash: p })) : ue === "complete" ? L = x : ue === "log" ? O({ type: "log", - log: W.log, - level: W.level, - endpoint: R, + log: X.log, + level: X.level, + endpoint: U, fn_index: T - }) : ue === "generating" && M({ + }) : ue === "generating" && O({ type: "status", time: /* @__PURE__ */ new Date(), - ...V, - stage: V == null ? void 0 : V.stage, + ...x, + stage: x == null ? void 0 : x.stage, queue: !0, - endpoint: R, + endpoint: U, fn_index: T }); - W && (M({ + X && (O({ type: "data", time: /* @__PURE__ */ new Date(), - data: W.data, - endpoint: R, + data: X.data, + endpoint: U, fn_index: T - }), U && (M({ + }), L && (O({ type: "status", time: /* @__PURE__ */ new Date(), - ...U, - stage: V == null ? void 0 : V.stage, + ...L, + stage: x == null ? void 0 : x.stage, queue: !0, - endpoint: R, + endpoint: U, fn_index: T - }), J.close())); + }), Y.close())); }, _o(v.version || "2.0.0", "3.6") < 0 && addEventListener( "open", - () => J.send(JSON.stringify({ hash: p })) + () => Y.send(JSON.stringify({ hash: p })) ); } else if (He == "sse") { - M({ + O({ type: "status", stage: "pending", queue: !0, - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date() }); @@ -4379,22 +4379,22 @@ function Jh(t, e) { fn_index: T.toString(), session_hash: p }).toString(); - let ne = new URL( - `${v.root}/queue/join?${j ? j + "&" : ""}${me}` + let te = new URL( + `${v.root}/queue/join?${ee ? ee + "&" : ""}${me}` ); - ke = e(ne), ke.onmessage = async function(Z) { - const he = JSON.parse(Z.data), { type: ue, status: V, data: W } = ml( + ke = e(te), ke.onmessage = async function(W) { + const he = JSON.parse(W.data), { type: ue, status: x, data: X } = ml( he, g[T] ); - if (ue === "update" && V && !U) - M({ + if (ue === "update" && x && !L) + O({ type: "status", - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date(), - ...V - }), V.stage === "error" && ke.close(); + ...x + }), x.stage === "error" && ke.close(); else if (ue === "data") { H = he.event_id; let [gt, xa] = await n( @@ -4406,154 +4406,154 @@ function Jh(t, e) { }, f ); - xa !== 200 && (M({ + xa !== 200 && (O({ type: "status", stage: "error", message: bt, queue: !0, - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date() }), ke.close()); } else - ue === "complete" ? U = V : ue === "log" ? M({ + ue === "complete" ? L = x : ue === "log" ? O({ type: "log", - log: W.log, - level: W.level, - endpoint: R, + log: X.log, + level: X.level, + endpoint: U, fn_index: T - }) : ue === "generating" && M({ + }) : ue === "generating" && O({ type: "status", time: /* @__PURE__ */ new Date(), - ...V, - stage: V == null ? void 0 : V.stage, + ...x, + stage: x == null ? void 0 : x.stage, queue: !0, - endpoint: R, + endpoint: U, fn_index: T }); - W && (M({ + X && (O({ type: "data", time: /* @__PURE__ */ new Date(), - data: W.data, - endpoint: R, + data: X.data, + endpoint: U, fn_index: T - }), U && (M({ + }), L && (O({ type: "status", time: /* @__PURE__ */ new Date(), - ...U, - stage: V == null ? void 0 : V.stage, + ...L, + stage: x == null ? void 0 : x.stage, queue: !0, - endpoint: R, + endpoint: U, fn_index: T }), ke.close())); }; } else - (He == "sse_v1" || He == "sse_v2") && (M({ + (He == "sse_v1" || He == "sse_v2") && (O({ type: "status", stage: "pending", queue: !0, - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date() }), n( - `${v.root}/queue/join?${j}`, + `${v.root}/queue/join?${ee}`, { ...Se, session_hash: p }, f - ).then(([ne, Z]) => { - if (Z === 503) - M({ + ).then(([te, W]) => { + if (W === 503) + O({ type: "status", stage: "error", message: Zr, queue: !0, - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date() }); - else if (Z !== 200) - M({ + else if (W !== 200) + O({ type: "status", stage: "error", message: bt, queue: !0, - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date() }); else { - H = ne.event_id; + H = te.event_id; let he = async function(ue) { try { - const { type: V, status: W, data: gt } = ml( + const { type: x, status: X, data: gt } = ml( ue, g[T] ); - if (V == "heartbeat") + if (x == "heartbeat") return; - if (V === "update" && W && !U) - M({ + if (x === "update" && X && !L) + O({ type: "status", - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date(), - ...W + ...X }); - else if (V === "complete") - U = W; - else if (V == "unexpected_error") - console.error("Unexpected error", W == null ? void 0 : W.message), M({ + else if (x === "complete") + L = X; + else if (x == "unexpected_error") + console.error("Unexpected error", X == null ? void 0 : X.message), O({ type: "status", stage: "error", - message: (W == null ? void 0 : W.message) || "An Unexpected Error Occurred!", + message: (X == null ? void 0 : X.message) || "An Unexpected Error Occurred!", queue: !0, - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date() }); - else if (V === "log") { - M({ + else if (x === "log") { + O({ type: "log", log: gt.log, level: gt.level, - endpoint: R, + endpoint: U, fn_index: T }); return; } else - V === "generating" && (M({ + x === "generating" && (O({ type: "status", time: /* @__PURE__ */ new Date(), - ...W, - stage: W == null ? void 0 : W.stage, + ...X, + stage: X == null ? void 0 : X.stage, queue: !0, - endpoint: R, + endpoint: U, fn_index: T - }), gt && He === "sse_v2" && je(H, gt)); - gt && (M({ + }), gt && He === "sse_v2" && mt(H, gt)); + gt && (O({ type: "data", time: /* @__PURE__ */ new Date(), data: gt.data, - endpoint: R, + endpoint: U, fn_index: T - }), U && M({ + }), L && O({ type: "status", time: /* @__PURE__ */ new Date(), - ...U, - stage: W == null ? void 0 : W.stage, + ...L, + stage: X == null ? void 0 : X.stage, queue: !0, - endpoint: R, + endpoint: U, fn_index: T - })), ((W == null ? void 0 : W.stage) === "complete" || (W == null ? void 0 : W.stage) === "error") && (E[H] && delete E[H], H in C && delete C[H]); - } catch (V) { - console.error("Unexpected client exception", V), M({ + })), ((X == null ? void 0 : X.stage) === "complete" || (X == null ? void 0 : X.stage) === "error") && (E[H] && delete E[H], H in C && delete C[H]); + } catch (x) { + console.error("Unexpected client exception", x), O({ type: "status", stage: "error", message: "An Unexpected Error Occurred!", queue: !0, - endpoint: R, + endpoint: U, fn_index: T, time: /* @__PURE__ */ new Date() }), ve(); @@ -4566,46 +4566,46 @@ function Jh(t, e) { })); } ); - function je(K, me) { - !C[K] ? (C[K] = [], me.data.forEach((Z, he) => { - C[K][he] = Z; - })) : me.data.forEach((Z, he) => { + function mt(J, me) { + !C[J] ? (C[J] = [], me.data.forEach((W, he) => { + C[J][he] = W; + })) : me.data.forEach((W, he) => { let ue = Wh( - C[K][he], - Z + C[J][he], + W ); - C[K][he] = ue, me.data[he] = ue; + C[J][he] = ue, me.data[he] = ue; }); } - function M(K) { - const ne = Q[K.type] || []; - ne == null || ne.forEach((Z) => Z(K)); + function O(J) { + const te = le[J.type] || []; + te == null || te.forEach((W) => W(J)); } - function tt(K, me) { - const ne = Q, Z = ne[K] || []; - return ne[K] = Z, Z == null || Z.push(me), { on: tt, off: Ut, cancel: bn, destroy: pn }; + function et(J, me) { + const te = le, W = te[J] || []; + return te[J] = W, W == null || W.push(me), { on: et, off: Ut, cancel: bn, destroy: pn }; } - function Ut(K, me) { - const ne = Q; - let Z = ne[K] || []; - return Z = Z == null ? void 0 : Z.filter((he) => he !== me), ne[K] = Z, { on: tt, off: Ut, cancel: bn, destroy: pn }; + function Ut(J, me) { + const te = le; + let W = te[J] || []; + return W = W == null ? void 0 : W.filter((he) => he !== me), te[J] = W, { on: et, off: Ut, cancel: bn, destroy: pn }; } async function bn() { - const K = { + const J = { stage: "complete", queue: !1, time: /* @__PURE__ */ new Date() }; - U = K, M({ - ...K, + L = J, O({ + ...J, type: "status", - endpoint: R, + endpoint: U, fn_index: T }); let me = {}; - He === "ws" ? (J && J.readyState === 0 ? J.addEventListener("open", () => { - J.close(); - }) : J.close(), me = { fn_index: T, session_hash: p }) : (ke.close(), me = { event_id: H }); + He === "ws" ? (Y && Y.readyState === 0 ? Y.addEventListener("open", () => { + Y.close(); + }) : Y.close(), me = { fn_index: T, session_hash: p }) : (ke.close(), me = { event_id: H }); try { await t(`${v.root}/reset`, { headers: { "Content-Type": "application/json" }, @@ -4619,13 +4619,13 @@ function Jh(t, e) { } } function pn() { - for (const K in Q) - Q[K].forEach((me) => { - Ut(K, me); + for (const J in le) + le[J].forEach((me) => { + Ut(J, me); }); } return { - on: tt, + on: et, off: Ut, cancel: bn, destroy: pn @@ -4636,8 +4636,8 @@ function Jh(t, e) { let S = new URLSearchParams({ session_hash: p }).toString(), k = new URL(`${v.root}/queue/data?${S}`); - P = e(k), P.onmessage = async function(I) { - let m = JSON.parse(I.data); + P = e(k), P.onmessage = async function(M) { + let m = JSON.parse(M.data); const T = m.event_id; if (!T) await Promise.all( @@ -4651,7 +4651,7 @@ function Jh(t, e) { window.setTimeout(ae, 0, m); } else w[T] || (w[T] = []), w[T].push(m); - }, P.onerror = async function(I) { + }, P.onerror = async function(M) { await Promise.all( Object.keys(E).map( (m) => E[m]({ @@ -4665,20 +4665,20 @@ function Jh(t, e) { function ve() { y = !1, P == null || P.close(); } - async function de(S, k, I) { + async function de(S, k, M) { var m; const T = { "Content-Type": "application/json" }; f && (T.Authorization = `Bearer ${f}`); - let ae, J = v.components.find( - (R) => R.id === S + let ae, Y = v.components.find( + (U) => U.id === S ); - (m = J == null ? void 0 : J.props) != null && m.root_url ? ae = J.props.root_url : ae = v.root; + (m = Y == null ? void 0 : Y.props) != null && m.root_url ? ae = Y.props.root_url : ae = v.root; const ke = await t( `${ae}/component_server/`, { method: "POST", body: JSON.stringify({ - data: I, + data: M, component_id: S, fn_name: k, session_hash: p @@ -4693,12 +4693,12 @@ function Jh(t, e) { return await ke.json(); } async function ce(S) { - if (x) - return x; + if (G) + return G; const k = { "Content-Type": "application/json" }; f && (k.Authorization = `Bearer ${f}`); - let I; - if (_o(S.version || "2.0.0", "3.30") < 0 ? I = await t( + let M; + if (_o(S.version || "2.0.0", "3.30") < 0 ? M = await t( "https://gradio-space-api-fetcher-v2.hf.space/api", { method: "POST", @@ -4708,11 +4708,11 @@ function Jh(t, e) { }), headers: k } - ) : I = await t(`${S.root}/info`, { + ) : M = await t(`${S.root}/info`, { headers: k - }), !I.ok) + }), !M.ok) throw new Error(bt); - let m = await I.json(); + let m = await M.json(); return "api" in m && (m = m.api), m.named_endpoints["/predict"] && !m.unnamed_endpoints[0] && (m.unnamed_endpoints[0] = m.named_endpoints["/predict"]), Kh(m, S, A); } }); @@ -5152,15 +5152,15 @@ function zi(t, e) { } t.prototype = e === null ? Object.create(e) : (n.prototype = e.prototype, new n()); } -var G = function() { - return G = Object.assign || function(e) { +var j = function() { + return j = Object.assign || function(e) { for (var n, i = 1, l = arguments.length; i < l; i++) { n = arguments[i]; for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (e[s] = n[s]); } return e; - }, G.apply(this, arguments); + }, j.apply(this, arguments); }; function gl(t, e, n) { if (n || arguments.length === 2) @@ -5172,40 +5172,40 @@ var F; (function(t) { t[t.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", t[t.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", t[t.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", t[t.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", t[t.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", t[t.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", t[t.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", t[t.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", t[t.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", t[t.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", t[t.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", t[t.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", t[t.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", t[t.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", t[t.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", t[t.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", t[t.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", t[t.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", t[t.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", t[t.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", t[t.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", t[t.INVALID_TAG = 23] = "INVALID_TAG", t[t.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", t[t.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", t[t.UNCLOSED_TAG = 27] = "UNCLOSED_TAG"; })(F || (F = {})); -var ee; +var K; (function(t) { t[t.literal = 0] = "literal", t[t.argument = 1] = "argument", t[t.number = 2] = "number", t[t.date = 3] = "date", t[t.time = 4] = "time", t[t.select = 5] = "select", t[t.plural = 6] = "plural", t[t.pound = 7] = "pound", t[t.tag = 8] = "tag"; -})(ee || (ee = {})); +})(K || (K = {})); var un; (function(t) { t[t.number = 0] = "number", t[t.dateTime = 1] = "dateTime"; })(un || (un = {})); function vo(t) { - return t.type === ee.literal; + return t.type === K.literal; } function b0(t) { - return t.type === ee.argument; + return t.type === K.argument; } function Qr(t) { - return t.type === ee.number; + return t.type === K.number; } function Kr(t) { - return t.type === ee.date; + return t.type === K.date; } function $r(t) { - return t.type === ee.time; + return t.type === K.time; } function ea(t) { - return t.type === ee.select; + return t.type === K.select; } function ta(t) { - return t.type === ee.plural; + return t.type === K.plural; } function p0(t) { - return t.type === ee.pound; + return t.type === K.pound; } function na(t) { - return t.type === ee.tag; + return t.type === K.tag; } function ia(t) { return !!(t && typeof t == "object" && t.type === un.number); @@ -5427,13 +5427,13 @@ function A0(t) { e.notation = "compact", e.compactDisplay = "long"; continue; case "scientific": - e = G(G(G({}, e), { notation: "scientific" }), l.options.reduce(function(a, u) { - return G(G({}, a), ko(u)); + e = j(j(j({}, e), { notation: "scientific" }), l.options.reduce(function(a, u) { + return j(j({}, a), ko(u)); }, {})); continue; case "engineering": - e = G(G(G({}, e), { notation: "engineering" }), l.options.reduce(function(a, u) { - return G(G({}, a), ko(u)); + e = j(j(j({}, e), { notation: "engineering" }), l.options.reduce(function(a, u) { + return j(j({}, a), ko(u)); }, {})); continue; case "notation-simple": @@ -5481,17 +5481,17 @@ function A0(t) { return f === "*" ? e.minimumFractionDigits = u.length : _ && _[0] === "#" ? e.maximumFractionDigits = _.length : h && c ? (e.minimumFractionDigits = h.length, e.maximumFractionDigits = h.length + c.length) : (e.minimumFractionDigits = u.length, e.maximumFractionDigits = u.length), ""; }); var s = l.options[0]; - s === "w" ? e = G(G({}, e), { trailingZeroDisplay: "stripIfInteger" }) : s && (e = G(G({}, e), Eo(s))); + s === "w" ? e = j(j({}, e), { trailingZeroDisplay: "stripIfInteger" }) : s && (e = j(j({}, e), Eo(s))); continue; } if (sa.test(l.stem)) { - e = G(G({}, e), Eo(l.stem)); + e = j(j({}, e), Eo(l.stem)); continue; } var o = ra(l.stem); - o && (e = G(G({}, e), o)); + o && (e = j(j({}, e), o)); var r = C0(l.stem); - r && (e = G(G({}, e), r)); + r && (e = j(j({}, e), r)); } return e; } @@ -6998,7 +6998,7 @@ var j0 = ( if (s === 35 && (n === "plural" || n === "selectordinal")) { var r = this.clonePosition(); this.bump(), l.push({ - type: ee.pound, + type: K.pound, location: q(r, this.clonePosition()) }); } else if (s === 60 && !this.ignoreTag && this.peek() === 47) { @@ -7026,7 +7026,7 @@ var j0 = ( if (this.bumpSpace(), this.bumpIf("/>")) return { val: { - type: ee.literal, + type: K.literal, value: "<".concat(l, "/>"), location: q(i, this.clonePosition()) }, @@ -7043,7 +7043,7 @@ var j0 = ( var a = this.clonePosition(), u = this.parseTagName(); return l !== u ? this.error(F.UNMATCHED_CLOSING_TAG, q(a, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? { val: { - type: ee.tag, + type: K.tag, value: l, children: o, location: q(i, this.clonePosition()) @@ -7080,7 +7080,7 @@ var j0 = ( } var a = q(i, this.clonePosition()); return { - val: { type: ee.literal, value: l, location: a }, + val: { type: K.literal, value: l, location: a }, err: null }; }, t.prototype.tryParseLeftAngleBracket = function() { @@ -7140,7 +7140,7 @@ var j0 = ( case 125: return this.bump(), { val: { - type: ee.argument, + type: K.argument, // value does not include the opening and closing braces. value: l, location: q(i, this.clonePosition()) @@ -7187,7 +7187,7 @@ var j0 = ( if (r === "number") { var _ = this.parseNumberSkeletonFromString(p, u.styleLocation); return _.err ? _ : { - val: { type: ee.number, value: i, location: b, style: _.val }, + val: { type: K.number, value: i, location: b, style: _.val }, err: null }; } else { @@ -7200,7 +7200,7 @@ var j0 = ( pattern: g, location: u.styleLocation, parsedOptions: this.shouldParseSkeletons ? v0(g) : {} - }, y = r === "date" ? ee.date : ee.time; + }, y = r === "date" ? K.date : K.time; return { val: { type: y, value: i, location: b, style: h }, err: null @@ -7209,7 +7209,7 @@ var j0 = ( } return { val: { - type: r === "number" ? ee.number : r === "date" ? ee.date : ee.time, + type: r === "number" ? K.number : r === "date" ? K.date : K.time, value: i, location: b, style: (s = u == null ? void 0 : u.style) !== null && s !== void 0 ? s : null @@ -7222,7 +7222,7 @@ var j0 = ( case "select": { var w = this.clonePosition(); if (this.bumpSpace(), !this.bumpIf(",")) - return this.error(F.EXPECT_SELECT_ARGUMENT_OPTIONS, q(w, G({}, w))); + return this.error(F.EXPECT_SELECT_ARGUMENT_OPTIONS, q(w, j({}, w))); this.bumpSpace(); var C = this.parseIdentifierIfPossible(), P = 0; if (r !== "select" && C.value === "offset") { @@ -7243,7 +7243,7 @@ var j0 = ( var N = q(l, this.clonePosition()); return r === "select" ? { val: { - type: ee.select, + type: K.select, value: i, options: Co(E.val), location: N @@ -7251,7 +7251,7 @@ var j0 = ( err: null } : { val: { - type: ee.plural, + type: K.plural, value: i, options: Co(E.val), offset: P, @@ -7452,7 +7452,7 @@ function Ql(t) { }); } function X0(t, e) { - e === void 0 && (e = {}), e = G({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, e); + e === void 0 && (e = {}), e = j({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, e); var n = new j0(t, e).parse(); if (n.err) { var i = SyntaxError(F[n.err.kind]); @@ -7665,14 +7665,14 @@ Try polyfilling it using "@formatjs/intl-pluralrules" return td(r); } function id(t, e) { - return e ? G(G(G({}, t || {}), e || {}), Object.keys(t).reduce(function(n, i) { - return n[i] = G(G({}, t[i]), e[i] || {}), n; + return e ? j(j(j({}, t || {}), e || {}), Object.keys(t).reduce(function(n, i) { + return n[i] = j(j({}, t[i]), e[i] || {}), n; }, {})) : t; } function ld(t, e) { return e ? Object.keys(t).reduce(function(n, i) { return n[i] = id(t[i], e[i]), n; - }, G({}, t)) : t; + }, j({}, t)) : t; } function vl(t) { return { @@ -7849,11 +7849,11 @@ function rd(t, e) { i = void 0; return i; } -const ft = {}, ad = (t, e, n) => n && (e in ft || (ft[e] = {}), t in ft[e] || (ft[e][t] = n), n), ha = (t, e) => { +const ut = {}, ad = (t, e, n) => n && (e in ut || (ut[e] = {}), t in ut[e] || (ut[e][t] = n), n), ha = (t, e) => { if (e == null) return; - if (e in ft && t in ft[e]) - return ft[e][t]; + if (e in ut && t in ut[e]) + return ut[e][t]; const n = Gi(e); for (let i = 0; i < n.length; i++) { const l = n[i], s = fd(l, t); @@ -7886,7 +7886,7 @@ function cd(t) { } } function _d(t, ...e) { - delete ft[t], xn.update((n) => (n[t] = g0.all([n[t] || {}, ...e]), n)); + delete ut[t], xn.update((n) => (n[t] = g0.all([n[t] || {}, ...e]), n)); } dn( [xn], @@ -8294,7 +8294,7 @@ const { space: lm, stop_propagation: vt, toggle_class: we, - transition_in: ct, + transition_in: ft, transition_out: It, update_slot_base: Ta } = window.__gradio__svelte__internal, { createEventDispatcher: sm, tick: om, getContext: rm } = window.__gradio__svelte__internal; @@ -8465,7 +8465,7 @@ function am(t) { ); }, i(c) { - a || (ct(h, c), a = !0); + a || (ft(h, c), a = !0); }, o(c) { It(h, c), a = !1; @@ -8490,10 +8490,10 @@ function um(t) { l[7] ? i && (Aa(), It(i, 1, 1, () => { i = null; }), ya()) : i ? (i.p(l, s), s[0] & /*hidden*/ - 128 && ct(i, 1)) : (i = Do(l), i.c(), ct(i, 1), i.m(e.parentNode, e)); + 128 && ft(i, 1)) : (i = Do(l), i.c(), ft(i, 1), i.m(e.parentNode, e)); }, i(l) { - n || (ct(i), n = !0); + n || (ft(i), n = !0); }, o(l) { It(i), n = !1; @@ -8596,7 +8596,7 @@ function fm(t) { ); }, i(a) { - i || (ct(r, a), i = !0); + i || (ft(r, a), i = !0); }, o(a) { It(r, a), i = !1; @@ -8641,7 +8641,7 @@ function Do(t) { i[11]), e.$set(s); }, i(i) { - n || (ct(e.$$.fragment, i), n = !0); + n || (ft(e.$$.fragment, i), n = !0); }, o(i) { It(e.$$.fragment, i), n = !1; @@ -8674,10 +8674,10 @@ function cm(t) { let f = e; e = r(a), e === f ? o[e].p(a, u) : (Aa(), It(o[f], 1, 1, () => { o[f] = null; - }), ya(), n = o[e], n ? n.p(a, u) : (n = o[e] = s[e](a), n.c()), ct(n, 1), n.m(i.parentNode, i)); + }), ya(), n = o[e], n ? n.p(a, u) : (n = o[e] = s[e](a), n.c()), ft(n, 1), n.m(i.parentNode, i)); }, i(a) { - l || (ct(n), l = !0); + l || (ft(n), l = !0); }, o(a) { It(n), l = !1; @@ -8722,10 +8722,10 @@ function hm(t, e, n) { } function N() { navigator.clipboard.read().then(async (k) => { - for (let I = 0; I < k.length; I++) { - const m = k[I].types.find((T) => T.startsWith("image/")); + for (let M = 0; M < k.length; M++) { + const m = k[M].types.find((T) => T.startsWith("image/")); if (m) { - k[I].getType(m).then(async (T) => { + k[M].getType(m).then(async (T) => { const ae = new File([T], `clipboard.${m.replace("image/", "")}`); await B([ae]); }); @@ -8739,44 +8739,44 @@ function hm(t, e, n) { } async function A(k) { await om(), n(10, p = Math.random().toString(36).substring(2, 15)), n(1, b = !0); - const I = await Zh(k, h, p, w); - return P("load", f === "single" ? Ro([I, "optionalAccess", (m) => m[0]]) : I), n(1, b = !1), I || []; + const M = await Zh(k, h, p, w); + return P("load", f === "single" ? Ro([M, "optionalAccess", (m) => m[0]]) : M), n(1, b = !1), M || []; } async function B(k) { if (!k.length) return; - let I = k.map((m) => new File([m], m.name)); - return n(11, g = await Yh(I)), await A(g); + let M = k.map((m) => new File([m], m.name)); + return n(11, g = await Yh(M)), await A(g); } - async function L(k) { - const I = k.target; - if (I.files) + async function I(k) { + const M = k.target; + if (M.files) if (d != "blob") - await B(Array.from(I.files)); + await B(Array.from(M.files)); else { if (f === "single") { - P("load", I.files[0]); + P("load", M.files[0]); return; } - P("load", I.files); + P("load", M.files); } } - async function x(k) { + async function G(k) { if (n(17, o = !1), !Ro([k, "access", (m) => m.dataTransfer, "optionalAccess", (m) => m.files])) return; - const I = Array.from(k.dataTransfer.files).filter((m) => { + const M = Array.from(k.dataTransfer.files).filter((m) => { const T = "." + m.name.split(".").pop(); return T && _m(s, T, m.type) || (T && Array.isArray(s) ? s.includes(T) : T === s) ? !0 : (P("error", `Invalid file type only ${s} allowed.`), !1); }); - await B(I); + await B(M); } - function Y(k) { + function Z(k) { pt.call(this, t, k); } function _e(k) { pt.call(this, t, k); } - function te(k) { + function $(k) { pt.call(this, t, k); } function Ee(k) { @@ -8817,17 +8817,17 @@ function hm(t, e, n) { y, C, E, - L, - x, + I, + G, o, _, d, B, l, i, - Y, + Z, _e, - te, + $, Ee, ve, de, @@ -8882,14 +8882,14 @@ const { insert: pm, noop: kl, safe_not_equal: wm, - set_style: ot, + set_style: st, svg_element: Sl } = window.__gradio__svelte__internal; function vm(t) { let e, n, i; return { c() { - e = Sl("svg"), n = Sl("line"), i = Sl("line"), be(n, "x1", "4"), be(n, "y1", "12"), be(n, "x2", "20"), be(n, "y2", "12"), ot(n, "fill", "none"), ot(n, "stroke-width", "2px"), be(i, "x1", "12"), be(i, "y1", "4"), be(i, "x2", "12"), be(i, "y2", "20"), ot(i, "fill", "none"), ot(i, "stroke-width", "2px"), be(e, "width", "100%"), be(e, "height", "100%"), be(e, "viewBox", "0 0 24 24"), be(e, "version", "1.1"), be(e, "xmlns", "http://www.w3.org/2000/svg"), be(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), be(e, "xml:space", "preserve"), be(e, "stroke", "currentColor"), ot(e, "fill-rule", "evenodd"), ot(e, "clip-rule", "evenodd"), ot(e, "stroke-linecap", "round"), ot(e, "stroke-linejoin", "round"); + e = Sl("svg"), n = Sl("line"), i = Sl("line"), be(n, "x1", "4"), be(n, "y1", "12"), be(n, "x2", "20"), be(n, "y2", "12"), st(n, "fill", "none"), st(n, "stroke-width", "2px"), be(i, "x1", "12"), be(i, "y1", "4"), be(i, "x2", "12"), be(i, "y2", "20"), st(i, "fill", "none"), st(i, "stroke-width", "2px"), be(e, "width", "100%"), be(e, "height", "100%"), be(e, "viewBox", "0 0 24 24"), be(e, "version", "1.1"), be(e, "xmlns", "http://www.w3.org/2000/svg"), be(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), be(e, "xml:space", "preserve"), be(e, "stroke", "currentColor"), st(e, "fill-rule", "evenodd"), st(e, "clip-rule", "evenodd"), st(e, "stroke-linecap", "round"), st(e, "stroke-linejoin", "round"); }, m(l, s) { pm(l, e, s), Uo(e, n), Uo(e, i); @@ -9078,7 +9078,7 @@ new Intl.Collator(0, { numeric: 1 }).compare; const { SvelteComponent: qm, append: Na, - attr: ie, + attr: ne, bubble: zm, check_outros: jm, create_slot: La, @@ -9117,10 +9117,10 @@ function Zm(t) { ); return { c() { - e = Wi("button"), r && r.c(), n = Oa(), u && u.c(), ie(e, "class", i = /*size*/ + e = Wi("button"), r && r.c(), n = Oa(), u && u.c(), ne(e, "class", i = /*size*/ t[4] + " " + /*variant*/ t[3] + " " + /*elem_classes*/ - t[1].join(" ") + " svelte-8huxfn"), ie( + t[1].join(" ") + " svelte-8huxfn"), ne( e, "id", /*elem_id*/ @@ -9173,8 +9173,8 @@ function Zm(t) { 26 && i !== (i = /*size*/ f[4] + " " + /*variant*/ f[3] + " " + /*elem_classes*/ - f[1].join(" ") + " svelte-8huxfn")) && ie(e, "class", i), (!l || _ & /*elem_id*/ - 1) && ie( + f[1].join(" ") + " svelte-8huxfn")) && ne(e, "class", i), (!l || _ & /*elem_id*/ + 1) && ne( e, "id", /*elem_id*/ @@ -9228,20 +9228,20 @@ function Ym(t) { ); return { c() { - e = Wi("a"), s && s.c(), n = Oa(), r && r.c(), ie( + e = Wi("a"), s && s.c(), n = Oa(), r && r.c(), ne( e, "href", /*link*/ t[6] - ), ie(e, "rel", "noopener noreferrer"), ie( + ), ne(e, "rel", "noopener noreferrer"), ne( e, "aria-disabled", /*disabled*/ t[8] - ), ie(e, "class", i = /*size*/ + ), ne(e, "class", i = /*size*/ t[4] + " " + /*variant*/ t[3] + " " + /*elem_classes*/ - t[1].join(" ") + " svelte-8huxfn"), ie( + t[1].join(" ") + " svelte-8huxfn"), ne( e, "id", /*elem_id*/ @@ -9295,13 +9295,13 @@ function Ym(t) { ), null ), (!l || u & /*link*/ - 64) && ie( + 64) && ne( e, "href", /*link*/ a[6] ), (!l || u & /*disabled*/ - 256) && ie( + 256) && ne( e, "aria-disabled", /*disabled*/ @@ -9310,8 +9310,8 @@ function Ym(t) { 26 && i !== (i = /*size*/ a[4] + " " + /*variant*/ a[3] + " " + /*elem_classes*/ - a[1].join(" ") + " svelte-8huxfn")) && ie(e, "class", i), (!l || u & /*elem_id*/ - 1) && ie( + a[1].join(" ") + " svelte-8huxfn")) && ne(e, "class", i), (!l || u & /*elem_id*/ + 1) && ne( e, "id", /*elem_id*/ @@ -9362,8 +9362,8 @@ function Go(t) { let e, n, i; return { c() { - e = Wi("img"), ie(e, "class", "button-icon svelte-8huxfn"), Hi(e.src, n = /*icon*/ - t[7].url) || ie(e, "src", n), ie(e, "alt", i = `${/*value*/ + e = Wi("img"), ne(e, "class", "button-icon svelte-8huxfn"), Hi(e.src, n = /*icon*/ + t[7].url) || ne(e, "src", n), ne(e, "alt", i = `${/*value*/ t[5]} icon`); }, m(l, s) { @@ -9372,9 +9372,9 @@ function Go(t) { p(l, s) { s & /*icon*/ 128 && !Hi(e.src, n = /*icon*/ - l[7].url) && ie(e, "src", n), s & /*value*/ + l[7].url) && ne(e, "src", n), s & /*value*/ 32 && i !== (i = `${/*value*/ - l[5]} icon`) && ie(e, "alt", i); + l[5]} icon`) && ne(e, "alt", i); }, d(l) { l && Xn(e); @@ -9385,8 +9385,8 @@ function xo(t) { let e, n, i; return { c() { - e = Wi("img"), ie(e, "class", "button-icon svelte-8huxfn"), Hi(e.src, n = /*icon*/ - t[7].url) || ie(e, "src", n), ie(e, "alt", i = `${/*value*/ + e = Wi("img"), ne(e, "class", "button-icon svelte-8huxfn"), Hi(e.src, n = /*icon*/ + t[7].url) || ne(e, "src", n), ne(e, "alt", i = `${/*value*/ t[5]} icon`); }, m(l, s) { @@ -9395,9 +9395,9 @@ function xo(t) { p(l, s) { s & /*icon*/ 128 && !Hi(e.src, n = /*icon*/ - l[7].url) && ie(e, "src", n), s & /*value*/ + l[7].url) && ne(e, "src", n), s & /*value*/ 32 && i !== (i = `${/*value*/ - l[5]} icon`) && ie(e, "alt", i); + l[5]} icon`) && ne(e, "alt", i); }, d(l) { l && Xn(e); @@ -9503,7 +9503,7 @@ const { set_style: xt, space: is, text: a1, - toggle_class: xe, + toggle_class: Ge, transition_in: Bl, transition_out: Yo } = window.__gradio__svelte__internal, { createEventDispatcher: u1 } = window.__gradio__svelte__internal; @@ -9600,7 +9600,7 @@ function Ko(t) { ), s, o, r, a, u; return { c() { - e = Li("li"), n = Li("span"), n.textContent = "✓", i = is(), s = a1(l), o = is(), Ie(n, "class", "inner-item svelte-yuohum"), xe(n, "hide", !/*selected_indices*/ + e = Li("li"), n = Li("span"), n.textContent = "✓", i = is(), s = a1(l), o = is(), Ie(n, "class", "inner-item svelte-yuohum"), Ge(n, "hide", !/*selected_indices*/ t[4].includes( /*index*/ t[24] @@ -9613,7 +9613,7 @@ function Ko(t) { t[4].includes( /*index*/ t[24] - )), xe( + )), Ge( e, "selected", /*selected_indices*/ @@ -9621,19 +9621,19 @@ function Ko(t) { /*index*/ t[24] ) - ), xe( + ), Ge( e, "active", /*index*/ t[24] === /*active_index*/ t[5] - ), xe( + ), Ge( e, "bg-gray-100", /*index*/ t[24] === /*active_index*/ t[5] - ), xe( + ), Ge( e, "dark:bg-gray-600", /*index*/ @@ -9646,7 +9646,7 @@ function Ko(t) { }, p(f, _) { _ & /*selected_indices, filtered_indices*/ - 18 && xe(n, "hide", !/*selected_indices*/ + 18 && Ge(n, "hide", !/*selected_indices*/ f[4].includes( /*index*/ f[24] @@ -9668,7 +9668,7 @@ function Ko(t) { /*index*/ f[24] )) && Ie(e, "aria-selected", u), _ & /*selected_indices, filtered_indices*/ - 18 && xe( + 18 && Ge( e, "selected", /*selected_indices*/ @@ -9677,21 +9677,21 @@ function Ko(t) { f[24] ) ), _ & /*filtered_indices, active_index*/ - 34 && xe( + 34 && Ge( e, "active", /*index*/ f[24] === /*active_index*/ f[5] ), _ & /*filtered_indices, active_index*/ - 34 && xe( + 34 && Ge( e, "bg-gray-100", /*index*/ f[24] === /*active_index*/ f[5] ), _ & /*filtered_indices, active_index*/ - 34 && xe( + 34 && Ge( e, "dark:bg-gray-600", /*index*/ @@ -9767,8 +9767,8 @@ function li(t) { function c1(t, e, n) { let { choices: i } = e, { filtered_indices: l } = e, { show_options: s = !1 } = e, { disabled: o = !1 } = e, { selected_indices: r = [] } = e, { active_index: a = null } = e, u, f, _, h, c, d, b, p, g; function y() { - const { top: B, bottom: L } = c.getBoundingClientRect(); - n(14, u = B), n(15, f = g - L); + const { top: B, bottom: I } = c.getBoundingClientRect(); + n(14, u = B), n(15, f = g - I); } let w = null; function C() { @@ -9801,15 +9801,15 @@ function c1(t, e, n) { 114900) { if (s && c) { if (d && r.length > 0) { - let L = d.querySelectorAll("li"); - for (const x of Array.from(L)) - if (x.getAttribute("data-index") === r[0].toString()) { + let I = d.querySelectorAll("li"); + for (const G of Array.from(I)) + if (G.getAttribute("data-index") === r[0].toString()) { li([ d, "optionalAccess", - (Y) => Y.scrollTo, + (Z) => Z.scrollTo, "optionalCall", - (Y) => Y(0, x.offsetTop) + (Z) => Z(0, G.offsetTop) ]); break; } @@ -9818,13 +9818,13 @@ function c1(t, e, n) { const B = li([ c, "access", - (L) => L.parentElement, + (I) => I.parentElement, "optionalAccess", - (L) => L.getBoundingClientRect, + (I) => I.getBoundingClientRect, "call", - (L) => L() + (I) => I() ]); - n(16, _ = li([B, "optionalAccess", (L) => L.height]) || 0), n(8, h = li([B, "optionalAccess", (L) => L.width]) || 0); + n(16, _ = li([B, "optionalAccess", (I) => I.height]) || 0), n(8, h = li([B, "optionalAccess", (I) => I.width]) || 0); } f > u ? (n(10, p = f), n(9, b = null)) : (n(9, b = `${f + _}px`), n(10, p = u - _)); } @@ -10161,14 +10161,14 @@ function H1(t) { function P1(t, e, n) { let { label: i } = e, { info: l = void 0 } = e, { value: s = [] } = e, o = [], { value_is_output: r = !1 } = e, { choices: a } = e, u, { disabled: f = !1 } = e, { show_label: _ } = e, { container: h = !0 } = e, { allow_custom_value: c = !1 } = e, { filterable: d = !0 } = e, b, p = !1, g, y, w = "", C = "", P = !1, E = [], N = null, v = null, A; const B = A1(); - s ? (A = a.map((S) => S[1]).indexOf(s), v = A, v === -1 ? (o = s, v = null) : ([w, o] = a[v], C = w), x()) : a.length > 0 && (A = 0, v = 0, [w, s] = a[v], o = s, C = w); - function L() { + s ? (A = a.map((S) => S[1]).indexOf(s), v = A, v === -1 ? (o = s, v = null) : ([w, o] = a[v], C = w), G()) : a.length > 0 && (A = 0, v = 0, [w, s] = a[v], o = s, C = w); + function I() { n(13, g = a.map((S) => S[0])), n(24, y = a.map((S) => S[1])); } - function x() { - L(), s === void 0 || Array.isArray(s) && s.length === 0 ? (n(9, w = ""), n(11, v = null)) : y.includes(s) ? (n(9, w = g[y.indexOf(s)]), n(11, v = y.indexOf(s))) : c ? (n(9, w = s), n(11, v = null)) : (n(9, w = ""), n(11, v = null)), n(27, A = v); + function G() { + I(), s === void 0 || Array.isArray(s) && s.length === 0 ? (n(9, w = ""), n(11, v = null)) : y.includes(s) ? (n(9, w = g[y.indexOf(s)]), n(11, v = y.indexOf(s))) : c ? (n(9, w = s), n(11, v = null)) : (n(9, w = ""), n(11, v = null)), n(27, A = v); } - function Y(S) { + function Z(S) { if (n(11, v = parseInt(S.detail.target.dataset.index)), isNaN(v)) { n(11, v = null); return; @@ -10176,9 +10176,9 @@ function P1(t, e, n) { n(12, p = !1), n(14, N = null), b.blur(); } function _e(S) { - n(10, E = a.map((k, I) => I)), n(12, p = !0), B("focus"); + n(10, E = a.map((k, M) => M)), n(12, p = !0), B("focus"); } - function te() { + function $() { c ? n(20, s = w) : n(9, w = g[y.indexOf(s)]), n(12, p = !1), n(14, N = null), B("blur"); } function Ee(S) { @@ -10207,9 +10207,9 @@ function P1(t, e, n) { value: y[v], selected: !0 })), t.$$.dirty[0] & /*value, old_value, value_is_output*/ - 7340032 && s != o && (x(), d1(B, s, r), n(22, o = s)), t.$$.dirty[0] & /*choices*/ - 4 && L(), t.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/ - 8390468 && a !== u && (c || x(), n(23, u = a), n(10, E = $o(a, w)), !c && E.length > 0 && n(14, N = E[0]), b == document.activeElement && n(12, p = !0)), t.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/ + 7340032 && s != o && (G(), d1(B, s, r), n(22, o = s)), t.$$.dirty[0] & /*choices*/ + 4 && I(), t.$$.dirty[0] & /*choices, old_choices, allow_custom_value, input_text, filtered_indices, filter_input*/ + 8390468 && a !== u && (c || G(), n(23, u = a), n(10, E = $o(a, w)), !c && E.length > 0 && n(14, N = E[0]), b == document.activeElement && n(12, p = !0)), t.$$.dirty[0] & /*input_text, old_input_text, choices, allow_custom_value, filtered_indices*/ 33556036 && w !== C && (n(10, E = $o(a, w)), n(25, C = w), !c && E.length > 0 && n(14, N = E[0])); }, [ i, @@ -10228,9 +10228,9 @@ function P1(t, e, n) { g, N, B, - Y, + Z, _e, - te, + $, Ee, s, r, @@ -10272,7 +10272,7 @@ class N1 extends g1 { } const { SvelteComponent: L1, - append: Je, + append: Ye, attr: si, create_component: oi, destroy_component: ri, @@ -10377,7 +10377,7 @@ function q1(t) { e = Et("div"), n = Et("div"), i = Et("span"), l = Et("div"), oi(s.$$.fragment), o = Hl(), r = Et("div"), oi(a.$$.fragment), u = Hl(), f = Et("div"), oi(_.$$.fragment), h = Hl(), c = Et("div"), oi(d.$$.fragment), ui(l, "margin-right", "10px"), ui(r, "margin-right", "40px"), ui(r, "margin-bottom", "8px"), ui(f, "margin-right", "8px"), si(i, "class", "model-content svelte-hkn2q1"), si(n, "class", "modal-container svelte-hkn2q1"), si(e, "class", "modal svelte-hkn2q1"), si(e, "id", "model-box-edit"); }, m(p, g) { - ys(p, e, g), Je(e, n), Je(n, i), Je(i, l), ai(s, l, null), Je(i, o), Je(i, r), ai(a, r, null), Je(i, u), Je(i, f), ai(_, f, null), Je(i, h), Je(i, c), ai(d, c, null), b = !0; + ys(p, e, g), Ye(e, n), Ye(n, i), Ye(i, l), ai(s, l, null), Ye(i, o), Ye(i, r), ai(a, r, null), Ye(i, u), Ye(i, f), ai(_, f, null), Ye(i, h), Ye(i, c), ai(d, c, null), b = !0; }, p(p, [g]) { const y = {}; @@ -10472,7 +10472,7 @@ class Fa extends L1 { }); } } -const Ve = (t, e, n) => Math.min(Math.max(t, e), n); +const xe = (t, e, n) => Math.min(Math.max(t, e), n); function Pl(t, e) { if (t.startsWith("rgba")) return t.replace(/[\d.]+$/, e.toString()); @@ -10490,30 +10490,30 @@ class Nl { if (this.isDragging) { let p = b.clientX - this.offsetMouseX - this.xmin, g = b.clientY - this.offsetMouseY - this.ymin; const y = this.canvasXmax - this.canvasXmin, w = this.canvasYmax - this.canvasYmin; - p = Ve(p, -this.xmin, y - this.xmax), g = Ve(g, -this.ymin, w - this.ymax), this.xmin += p, this.ymin += g, this.xmax += p, this.ymax += g, this.updateHandles(), this.renderCallBack(); + p = xe(p, -this.xmin, y - this.xmax), g = xe(g, -this.ymin, w - this.ymax), this.xmin += p, this.ymin += g, this.xmax += p, this.ymax += g, this.updateHandles(), this.renderCallBack(); } }, this.handleResize = (b) => { if (this.isResizing) { const p = b.clientX, g = b.clientY, y = p - this.resizeHandles[this.resizingHandleIndex].xmin - this.offsetMouseX, w = g - this.resizeHandles[this.resizingHandleIndex].ymin - this.offsetMouseY, C = this.canvasXmax - this.canvasXmin, P = this.canvasYmax - this.canvasYmin; switch (this.resizingHandleIndex) { case 0: - this.xmin += y, this.ymin += w, this.xmin = Ve(this.xmin, 0, this.xmax - this.minSize), this.ymin = Ve(this.ymin, 0, this.ymax - this.minSize); + this.xmin += y, this.ymin += w, this.xmin = xe(this.xmin, 0, this.xmax - this.minSize), this.ymin = xe(this.ymin, 0, this.ymax - this.minSize); break; case 1: - this.xmax += y, this.ymin += w, this.xmax = Ve(this.xmax, this.xmin + this.minSize, C), this.ymin = Ve(this.ymin, 0, this.ymax - this.minSize); + this.xmax += y, this.ymin += w, this.xmax = xe(this.xmax, this.xmin + this.minSize, C), this.ymin = xe(this.ymin, 0, this.ymax - this.minSize); break; case 2: - this.xmax += y, this.ymax += w, this.xmax = Ve(this.xmax, this.xmin + this.minSize, C), this.ymax = Ve(this.ymax, this.ymin + this.minSize, P); + this.xmax += y, this.ymax += w, this.xmax = xe(this.xmax, this.xmin + this.minSize, C), this.ymax = xe(this.ymax, this.ymin + this.minSize, P); break; case 3: - this.xmin += y, this.ymax += w, this.xmin = Ve(this.xmin, 0, this.xmax - this.minSize), this.ymax = Ve(this.ymax, this.ymin + this.minSize, P); + this.xmin += y, this.ymax += w, this.xmin = xe(this.xmin, 0, this.xmax - this.minSize), this.ymax = xe(this.ymax, this.ymin + this.minSize, P); break; } this.updateHandles(), this.renderCallBack(); } }, this.stopResize = () => { this.isResizing = !1, document.removeEventListener("mousemove", this.handleResize), document.removeEventListener("mouseup", this.stopResize); - }, this.renderCallBack = e, this.canvasXmin = n, this.canvasYmin = i, this.canvasXmax = l, this.canvasYmax = s, this.scaleFactor = d, this.label = o, this.isDragging = !1, [this.xmin, this.ymin] = this.toBoxCoordinates(r, a), [this.xmax, this.ymax] = this.toBoxCoordinates(u, f), this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = 8, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = c, this.color = _, this.alpha = h; + }, this.renderCallBack = e, this.canvasXmin = n, this.canvasYmin = i, this.canvasXmax = l, this.canvasYmax = s, this.scaleFactor = d, this.label = o, this.isDragging = !1, this.xmin = r, this.ymin = a, this.xmax = u, this.ymax = f, this.isResizing = !1, this.isSelected = !1, this.offsetMouseX = 0, this.offsetMouseY = 0, this.resizeHandleSize = 8, this.updateHandles(), this.resizingHandleIndex = -1, this.minSize = c, this.color = _, this.alpha = h; } toJSON() { return { @@ -10610,7 +10610,7 @@ class Nl { this.resizingHandleIndex = e, this.isResizing = !0, this.offsetMouseX = n.clientX - this.resizeHandles[e].xmin, this.offsetMouseY = n.clientY - this.resizeHandles[e].ymin, document.addEventListener("mousemove", this.handleResize), document.addEventListener("mouseup", this.stopResize); } } -const Xe = [ +const Ve = [ "rgb(255, 168, 77)", "rgb(92, 172, 238)", "rgb(255, 99, 71)", @@ -10640,7 +10640,7 @@ const { group_outros: Il, init: V1, insert: Qt, - listen: at, + listen: rt, mount_component: On, noop: X1, run_all: qa, @@ -10657,19 +10657,19 @@ function ir(t) { }, m(c, d) { Qt(c, e, d), Yt(e, n), On(i, n, null), Yt(e, l), Yt(e, s), On(o, s, null), Yt(e, r), Yt(e, a), On(u, a, null), f = !0, _ || (h = [ - at( + rt( n, "click", /*click_handler*/ t[22] ), - at( + rt( s, "click", /*click_handler_1*/ t[23] ), - at( + rt( a, "click", /*click_handler_2*/ @@ -10799,9 +10799,9 @@ function sr(t) { t[3].length > 0 ? ( /*choicesColors*/ t[3][0] - ) : qn(Xe[ + ) : qn(Ve[ /*value*/ - t[0].boxes.length % Xe.length + t[0].boxes.length % Ve.length ]) } }), e.$on( @@ -10833,9 +10833,9 @@ function sr(t) { i[3].length > 0 ? ( /*choicesColors*/ i[3][0] - ) : qn(Xe[ + ) : qn(Ve[ /*value*/ - i[0].boxes.length % Xe.length + i[0].boxes.length % Ve.length ])), e.$set(s); }, i(i) { @@ -10866,31 +10866,31 @@ function Q1(t) { }, m(c, d) { Qt(c, e, d), Yt(e, n), t[21](n), Qt(c, i, d), f && f.m(c, d), Qt(c, l, d), _ && _.m(c, d), Qt(c, s, d), h && h.m(c, d), Qt(c, o, d), r = !0, a || (u = [ - at( + rt( n, "mousedown", /*handleMouseDown*/ t[8] ), - at( + rt( n, "mouseup", /*handleMouseUp*/ t[9] ), - at( + rt( n, "dblclick", /*handleDoubleClick*/ t[13] ), - at( + rt( e, "focusin", /*handleCanvasFocus*/ t[16] ), - at( + rt( e, "focusout", /*handleCanvasBlur*/ @@ -10943,32 +10943,32 @@ function K1(t, e, n) { } } function A(H) { - n(5, c = H), r.boxes.forEach((U) => { - U.setSelected(!1); + n(5, c = H), r.boxes.forEach((L) => { + L.setSelected(!1); }), H >= 0 && H < r.boxes.length && r.boxes[H].setSelected(!0), v(); } function B(H) { if (!l) return; - const U = f.getBoundingClientRect(), Q = H.clientX - U.left, j = H.clientY - U.top; - for (const [je, M] of r.boxes.entries()) { - const tt = M.indexOfPointInsideHandle(Q, j); - if (tt >= 0) { - A(je), M.startResize(tt, H); + const L = f.getBoundingClientRect(), le = H.clientX - L.left, ee = H.clientY - L.top; + for (const [mt, O] of r.boxes.entries()) { + const et = O.indexOfPointInsideHandle(le, ee); + if (et >= 0) { + A(mt), O.startResize(et, H); return; } } - for (const [je, M] of r.boxes.entries()) - if (M.isPointInsideBox(Q, j)) { - A(je), M.startDrag(H); + for (const [mt, O] of r.boxes.entries()) + if (O.isPointInsideBox(le, ee)) { + A(mt), O.startDrag(H); return; } A(-1); } - function L(H) { + function I(H) { N("change"); } - function x(H) { + function G(H) { if (l) switch (H.key) { case "Delete": @@ -10976,32 +10976,32 @@ function K1(t, e, n) { break; } } - function Y() { + function Z() { n(7, E = !0); } function _e(H) { n(7, E = !1); - const { detail: U } = H; - let Q = U.label, j = U.color; - if (U.ok) { - j === null || j === "" ? j = Xe[r.boxes.length % Xe.length] : j = or(j); - let M = d + (p - d) / 3, tt = p - (p - d) / 3, Ut = b + (g - b) / 3, bn = g - (g - b) / 3, pn = new Nl(v, d, b, p, g, Q, Math.round(M), Math.round(Ut), Math.round(tt), Math.round(bn), j, s, o, y); + const { detail: L } = H; + let le = L.label, ee = L.color; + if (L.ok) { + ee === null || ee === "" ? ee = Ve[r.boxes.length % Ve.length] : ee = or(ee); + let O = w / 3 / y, et = w / 3 * 2 / y, Ut = C / 3 / y, bn = C / 3 * 2 / y, pn = new Nl(v, d, b, p, g, le, Math.round(O), Math.round(Ut), Math.round(et), Math.round(bn), ee, s, o); n(0, r.boxes = [pn, ...r.boxes], r), v(), N("change"); } } - function te() { + function $() { c >= 0 && c < r.boxes.length && n(6, P = !0); } function Ee(H) { - l && te(); + l && $(); } function ve(H) { n(6, P = !1); - const { detail: U } = H; - let Q = U.label, j = U.color; - if (U.ok && c >= 0 && c < r.boxes.length) { - let M = r.boxes[c]; - M.label = Q, M.color = or(j), v(), N("change"); + const { detail: L } = H; + let le = L.label, ee = L.color; + if (L.ok && c >= 0 && c < r.boxes.length) { + let O = r.boxes[c]; + O.label = le, O.color = or(ee), v(), N("change"); } } function de() { @@ -11020,25 +11020,22 @@ function K1(t, e, n) { else d = 0, b = 0, p = f.width, g = f.height, n(4, f.height = f.clientHeight, f); if (p > 0 && g > 0) - for (const U of r.boxes) - U.canvasXmin = d, U.canvasYmin = b, U.canvasXmax = p, U.canvasYmax = g, U.setScaleFactor(y); + for (const L of r.boxes) + L.canvasXmin = d, L.canvasYmin = b, L.canvasXmax = p, L.canvasYmax = g, L.setScaleFactor(y); v(), N("change"); } } const S = new ResizeObserver(ce); function k() { - let H = []; - for (let U = 0; U < r.boxes.length; U++) { - let Q = r.boxes[U]; - if (!(Q instanceof Nl)) { - let j = "", je = ""; - Q.hasOwnProperty("color") ? (j = Q.color, Array.isArray(j) && j.length === 3 && (j = `rgb(${j[0]}, ${j[1]}, ${j[2]})`)) : j = Xe[H.length % Xe.length], Q.hasOwnProperty("label") && (je = Q.label), Q = new Nl(v, d, b, p, g, je, Q.xmin, Q.ymin, Q.xmax, Q.ymax, j, s, o, y); + for (let H = 0; H < r.boxes.length; H++) { + let L = r.boxes[H]; + if (!(L instanceof Nl)) { + let le = "", ee = ""; + L.hasOwnProperty("color") ? (le = L.color, Array.isArray(le) && le.length === 3 && (le = `rgb(${le[0]}, ${le[1]}, ${le[2]})`)) : le = Ve[H % Ve.length], L.hasOwnProperty("label") && (ee = L.label), L = new Nl(v, d, b, p, g, ee, L.xmin, L.ymin, L.xmax, L.ymax, le, s, o), n(0, r.boxes[H] = L, r); } - H.push(Q); } - n(0, r.boxes = H, r); } - function I() { + function M() { i !== null && (h === null || h.src != i) && (h = new Image(), h.src = i, h.onload = function() { ce(), v(); }); @@ -11046,27 +11043,27 @@ function K1(t, e, n) { Z1(() => { if (Array.isArray(a) && a.length > 0 && (!Array.isArray(u) || u.length == 0)) for (let H = 0; H < a.length; H++) { - let U = Xe[H % Xe.length]; - u.push(qn(U)); + let L = Ve[H % Ve.length]; + u.push(qn(L)); } - _ = f.getContext("2d"), S.observe(f), I(), ce(), v(); + _ = f.getContext("2d"), S.observe(f), M(), ce(), v(); }); function m() { - document.addEventListener("keydown", x); + document.addEventListener("keydown", G); } function T() { - document.removeEventListener("keydown", x); + document.removeEventListener("keydown", G); } Y1(() => { - document.removeEventListener("keydown", x); + document.removeEventListener("keydown", G); }); function ae(H) { G1[H ? "unshift" : "push"](() => { f = H, n(4, f); }); } - const J = () => Y(), ke = () => te(), He = () => de(); - function R(H) { + const Y = () => Z(), ke = () => $(), He = () => de(); + function U(H) { nr.call(this, t, H); } function Se(H) { @@ -11076,7 +11073,7 @@ function K1(t, e, n) { "imageUrl" in H && n(18, i = H.imageUrl), "interactive" in H && n(1, l = H.interactive), "boxAlpha" in H && n(19, s = H.boxAlpha), "boxMinSize" in H && n(20, o = H.boxMinSize), "value" in H && n(0, r = H.value), "choices" in H && n(2, a = H.choices), "choicesColors" in H && n(3, u = H.choicesColors); }, t.$$.update = () => { t.$$.dirty[0] & /*value*/ - 1 && (I(), k(), ce(), v()); + 1 && (M(), k(), ce(), v()); }, [ r, l, @@ -11087,10 +11084,10 @@ function K1(t, e, n) { P, E, B, - L, - Y, + I, + Z, _e, - te, + $, Ee, ve, de, @@ -11100,10 +11097,10 @@ function K1(t, e, n) { s, o, ae, - J, + Y, ke, He, - R, + U, Se ]; } @@ -11272,9 +11269,9 @@ const { binding_callbacks: zn, bubble: Ml, check_outros: Kt, - create_component: ht, + create_component: _t, create_slot: mg, - destroy_component: dt, + destroy_component: ht, detach: Tt, element: Rn, empty: gg, @@ -11283,12 +11280,12 @@ const { group_outros: $t, init: wg, insert: Ht, - mount_component: mt, + mount_component: dt, noop: vg, safe_not_equal: yg, space: Xt, toggle_class: rr, - transition_in: X, + transition_in: V, transition_out: se, update_slot_base: Eg } = window.__gradio__svelte__internal, { createEventDispatcher: kg } = window.__gradio__svelte__internal; @@ -11309,10 +11306,10 @@ function ar(t) { } }), { c() { - ht(e.$$.fragment); + _t(e.$$.fragment); }, m(i, l) { - mt(e, i, l), n = !0; + dt(e, i, l), n = !0; }, p(i, l) { const s = {}; @@ -11325,13 +11322,13 @@ function ar(t) { 16 && (s.$$scope = { dirty: l, ctx: i }), e.$set(s); }, i(i) { - n || (X(e.$$.fragment, i), n = !0); + n || (V(e.$$.fragment, i), n = !0); }, o(i) { se(e.$$.fragment, i), n = !1; }, d(i) { - dt(e, i); + ht(e, i); } }; } @@ -11347,10 +11344,10 @@ function Sg(t) { } }), { c() { - ht(e.$$.fragment); + _t(e.$$.fragment); }, m(i, l) { - mt(e, i, l), n = !0; + dt(e, i, l), n = !0; }, p(i, l) { const s = {}; @@ -11359,13 +11356,13 @@ function Sg(t) { i[8]("common.download")), e.$set(s); }, i(i) { - n || (X(e.$$.fragment, i), n = !0); + n || (V(e.$$.fragment, i), n = !0); }, o(i) { se(e.$$.fragment, i), n = !1; }, d(i) { - dt(e, i); + ht(e, i); } }; } @@ -11396,10 +11393,10 @@ function ur(t) { t[27] ), { c() { - ht(e.$$.fragment); + _t(e.$$.fragment); }, m(i, l) { - mt(e, i, l), n = !0; + dt(e, i, l), n = !0; }, p(i, l) { const s = {}; @@ -11410,13 +11407,13 @@ function ur(t) { i[1]), e.$set(s); }, i(i) { - n || (X(e.$$.fragment, i), n = !0); + n || (V(e.$$.fragment, i), n = !0); }, o(i) { se(e.$$.fragment, i), n = !1; }, d(i) { - dt(e, i); + ht(e, i); } }; } @@ -11430,20 +11427,20 @@ function fr(t) { t[23] ), { c() { - e = Rn("div"), ht(n.$$.fragment); + e = Rn("div"), _t(n.$$.fragment); }, m(l, s) { - Ht(l, e, s), mt(n, e, null), i = !0; + Ht(l, e, s), dt(n, e, null), i = !0; }, p: vg, i(l) { - i || (X(n.$$.fragment, l), i = !0); + i || (V(n.$$.fragment, l), i = !0); }, o(l) { se(n.$$.fragment, l), i = !1; }, d(l) { - l && Tt(e), dt(n); + l && Tt(e), ht(n); } }; } @@ -11488,7 +11485,7 @@ function cr(t) { ); }, i(l) { - e || (X(i, l), e = !0); + e || (V(i, l), e = !0); }, o(l) { se(i, l), e = !1; @@ -11513,12 +11510,12 @@ function Cg(t) { p(l, s) { /*value*/ l[1] === null ? i ? (i.p(l, s), s[0] & /*value*/ - 2 && X(i, 1)) : (i = cr(l), i.c(), X(i, 1), i.m(e.parentNode, e)) : i && ($t(), se(i, 1, 1, () => { + 2 && V(i, 1)) : (i = cr(l), i.c(), V(i, 1), i.m(e.parentNode, e)) : i && ($t(), se(i, 1, 1, () => { i = null; }), Kt()); }, i(l) { - n || (X(i), n = !0); + n || (V(i), n = !0); }, o(l) { se(i), n = !1; @@ -11568,7 +11565,7 @@ function _r(t) { t[33] ), { c() { - e = Rn("div"), ht(n.$$.fragment), Pn(e, "class", "image-frame svelte-1gjdske"), rr( + e = Rn("div"), _t(n.$$.fragment), Pn(e, "class", "image-frame svelte-1gjdske"), rr( e, "selectable", /*selectable*/ @@ -11576,7 +11573,7 @@ function _r(t) { ); }, m(r, a) { - Ht(r, e, a), mt(n, e, null), l = !0; + Ht(r, e, a), dt(n, e, null), l = !0; }, p(r, a) { const u = {}; @@ -11603,13 +11600,13 @@ function _r(t) { ); }, i(r) { - l || (X(n.$$.fragment, r), l = !0); + l || (V(n.$$.fragment, r), l = !0); }, o(r) { se(n.$$.fragment, r), l = !1; }, d(r) { - r && Tt(e), dt(n); + r && Tt(e), ht(n); } } ); @@ -11638,10 +11635,10 @@ function hr(t) { t[0] !== void 0 && (s.active_source = /*active_source*/ t[0]), e = new L_({ props: s }), zn.push(() => Mi(e, "active_source", l)), { c() { - ht(e.$$.fragment); + _t(e.$$.fragment); }, m(o, r) { - mt(e, o, r), i = !0; + dt(e, o, r), i = !0; }, p(o, r) { const a = {}; @@ -11652,13 +11649,13 @@ function hr(t) { o[0], Ii(() => n = !1)), e.$set(a); }, i(o) { - i || (X(e.$$.fragment, o), i = !0); + i || (V(e.$$.fragment, o), i = !0); }, o(o) { se(e.$$.fragment, o), i = !1; }, d(o) { - dt(e, o); + ht(e, o); } } ); @@ -11741,10 +11738,10 @@ function Ag(t) { ), N = d && hr(t); return { c() { - ht(e.$$.fragment), n = Xt(), i = Rn("div"), p && p.c(), l = Xt(), g && g.c(), s = Xt(), y && y.c(), o = Xt(), r = Rn("div"), a = Rn("div"), ht(u.$$.fragment), h = Xt(), E && E.c(), c = Xt(), N && N.c(), Pn(i, "class", "icon-buttons svelte-1gjdske"), Pn(a, "class", "upload-container svelte-1gjdske"), Pn(r, "data-testid", "image"), Pn(r, "class", "image-container svelte-1gjdske"); + _t(e.$$.fragment), n = Xt(), i = Rn("div"), p && p.c(), l = Xt(), g && g.c(), s = Xt(), y && y.c(), o = Xt(), r = Rn("div"), a = Rn("div"), _t(u.$$.fragment), h = Xt(), E && E.c(), c = Xt(), N && N.c(), Pn(i, "class", "icon-buttons svelte-1gjdske"), Pn(a, "class", "upload-container svelte-1gjdske"), Pn(r, "data-testid", "image"), Pn(r, "class", "image-container svelte-1gjdske"); }, m(v, A) { - mt(e, v, A), Ht(v, n, A), Ht(v, i, A), p && p.m(i, null), kn(i, l), g && g.m(i, null), kn(i, s), y && y.m(i, null), Ht(v, o, A), Ht(v, r, A), kn(r, a), mt(u, a, null), kn(a, h), E && E.m(a, null), kn(r, c), N && N.m(r, null), b = !0; + dt(e, v, A), Ht(v, n, A), Ht(v, i, A), p && p.m(i, null), kn(i, l), g && g.m(i, null), kn(i, s), y && y.m(i, null), Ht(v, o, A), Ht(v, r, A), kn(r, a), dt(u, a, null), kn(a, h), E && E.m(a, null), kn(r, c), N && N.m(r, null), b = !0; }, p(v, A) { const B = {}; @@ -11755,38 +11752,38 @@ function Ag(t) { v[2] || "Image Annotator"), e.$set(B), /*showDownloadButton*/ v[10] && /*value*/ v[1] !== null ? p ? (p.p(v, A), A[0] & /*showDownloadButton, value*/ - 1026 && X(p, 1)) : (p = ar(v), p.c(), X(p, 1), p.m(i, l)) : p && ($t(), se(p, 1, 1, () => { + 1026 && V(p, 1)) : (p = ar(v), p.c(), V(p, 1), p.m(i, l)) : p && ($t(), se(p, 1, 1, () => { p = null; }), Kt()), /*showShareButton*/ v[9] && /*value*/ v[1] !== null ? g ? (g.p(v, A), A[0] & /*showShareButton, value*/ - 514 && X(g, 1)) : (g = ur(v), g.c(), X(g, 1), g.m(i, s)) : g && ($t(), se(g, 1, 1, () => { + 514 && V(g, 1)) : (g = ur(v), g.c(), V(g, 1), g.m(i, s)) : g && ($t(), se(g, 1, 1, () => { g = null; }), Kt()), /*showClearButton*/ v[11] && /*value*/ v[1] !== null && /*interactive*/ v[7] ? y ? (y.p(v, A), A[0] & /*showClearButton, value, interactive*/ - 2178 && X(y, 1)) : (y = fr(v), y.c(), X(y, 1), y.m(i, null)) : y && ($t(), se(y, 1, 1, () => { + 2178 && V(y, 1)) : (y = fr(v), y.c(), V(y, 1), y.m(i, null)) : y && ($t(), se(y, 1, 1, () => { y = null; }), Kt()); - const L = {}; + const I = {}; A[0] & /*value*/ - 2 && (L.hidden = /*value*/ + 2 && (I.hidden = /*value*/ v[1] !== null), A[0] & /*active_source*/ - 1 && (L.filetype = /*active_source*/ + 1 && (I.filetype = /*active_source*/ v[0] === "clipboard" ? "clipboard" : "image/*"), A[0] & /*root*/ - 64 && (L.root = /*root*/ + 64 && (I.root = /*root*/ v[6]), A[0] & /*sources*/ - 16 && (L.disable_click = !/*sources*/ + 16 && (I.disable_click = !/*sources*/ v[4].includes("upload")), A[0] & /*value*/ 2 | A[1] & /*$$scope*/ - 16 && (L.$$scope = { dirty: A, ctx: v }), !f && A[0] & /*uploading*/ - 65536 && (f = !0, L.uploading = /*uploading*/ + 16 && (I.$$scope = { dirty: A, ctx: v }), !f && A[0] & /*uploading*/ + 65536 && (f = !0, I.uploading = /*uploading*/ v[16], Ii(() => f = !1)), !_ && A[0] & /*dragging*/ - 131072 && (_ = !0, L.dragging = /*dragging*/ - v[17], Ii(() => _ = !1)), u.$set(L), /*value*/ + 131072 && (_ = !0, I.dragging = /*dragging*/ + v[17], Ii(() => _ = !1)), u.$set(I), /*value*/ v[1] !== null ? E ? (E.p(v, A), A[0] & /*value*/ - 2 && X(E, 1)) : (E = _r(v), E.c(), X(E, 1), E.m(a, null)) : E && ($t(), se(E, 1, 1, () => { + 2 && V(E, 1)) : (E = _r(v), E.c(), V(E, 1), E.m(a, null)) : E && ($t(), se(E, 1, 1, () => { E = null; }), Kt()), A[0] & /*sources, value, interactive*/ 146 && (d = /*sources*/ @@ -11794,18 +11791,18 @@ function Ag(t) { v[4].includes("clipboard")) && /*value*/ v[1] === null && /*interactive*/ v[7]), d ? N ? (N.p(v, A), A[0] & /*sources, value, interactive*/ - 146 && X(N, 1)) : (N = hr(v), N.c(), X(N, 1), N.m(r, null)) : N && ($t(), se(N, 1, 1, () => { + 146 && V(N, 1)) : (N = hr(v), N.c(), V(N, 1), N.m(r, null)) : N && ($t(), se(N, 1, 1, () => { N = null; }), Kt()); }, i(v) { - b || (X(e.$$.fragment, v), X(p), X(g), X(y), X(u.$$.fragment, v), X(E), X(N), b = !0); + b || (V(e.$$.fragment, v), V(p), V(g), V(y), V(u.$$.fragment, v), V(E), V(N), b = !0); }, o(v) { se(e.$$.fragment, v), se(p), se(g), se(y), se(u.$$.fragment, v), se(E), se(N), b = !1; }, d(v) { - v && (Tt(n), Tt(i), Tt(o), Tt(r)), dt(e, v), p && p.d(), g && g.d(), y && y.d(), t[28](null), dt(u), E && E.d(), N && N.d(); + v && (Tt(n), Tt(i), Tt(o), Tt(r)), ht(e, v), p && p.d(), g && g.d(), y && y.d(), t[28](null), ht(u), E && E.d(), N && N.d(); } }; } @@ -11815,25 +11812,25 @@ function Bg(t, e, n) { n(1, s = new Sh()), n(1, s.image = m, s), A("upload"); } function v() { - x(), A("clear"), A("change"); + G(), A("clear"), A("change"); } const A = kg(); let B = !1; - async function L(m) { + async function I(m) { switch (m) { case "clipboard": C.paste_clipboard(); break; } } - function x() { + function G() { n(1, s = null); } - const Y = async (m) => m === null ? "" : ``; + const Z = async (m) => m === null ? "" : ``; function _e(m) { Ml.call(this, t, m); } - function te(m) { + function $(m) { Ml.call(this, t, m); } function Ee(m) { @@ -11854,14 +11851,14 @@ function Bg(t, e, n) { s = m, n(1, s); } const k = () => A("change"); - function I(m) { + function M(m) { E = m, n(0, E), n(4, a); } return t.$$set = (m) => { "value" in m && n(1, s = m.value), "label" in m && n(2, o = m.label), "show_label" in m && n(3, r = m.show_label), "sources" in m && n(4, a = m.sources), "selectable" in m && n(5, u = m.selectable), "root" in m && n(6, f = m.root), "interactive" in m && n(7, _ = m.interactive), "i18n" in m && n(8, h = m.i18n), "showShareButton" in m && n(9, c = m.showShareButton), "showDownloadButton" in m && n(10, d = m.showDownloadButton), "showClearButton" in m && n(11, b = m.showClearButton), "boxesAlpha" in m && n(12, p = m.boxesAlpha), "labelList" in m && n(13, g = m.labelList), "labelColors" in m && n(14, y = m.labelColors), "boxMinSize" in m && n(15, w = m.boxMinSize), "active_source" in m && n(0, E = m.active_source), "$$scope" in m && n(35, l = m.$$scope); }, t.$$.update = () => { t.$$.dirty[0] & /*uploading*/ - 65536 && P && x(), t.$$.dirty[0] & /*dragging*/ + 65536 && P && G(), t.$$.dirty[0] & /*dragging*/ 131072 && A("drag", B), t.$$.dirty[0] & /*active_source, sources*/ 17 && !E && a && n(0, E = a[0]); }, [ @@ -11887,19 +11884,19 @@ function Bg(t, e, n) { N, v, A, - L, - x, + I, + G, i, - Y, + Z, _e, - te, + $, Ee, ve, de, ce, S, k, - I, + M, l ]; } @@ -11947,7 +11944,7 @@ const { insert: Ug, mount_component: Fg, safe_not_equal: qg, - toggle_class: rt, + toggle_class: ot, transition_in: vi, transition_out: rs } = window.__gradio__svelte__internal; @@ -11994,22 +11991,22 @@ function zg(t) { ); return { c() { - e = Og("div"), i && i.c(), Pg(e, "class", "container svelte-1sgcyba"), rt( + e = Og("div"), i && i.c(), Pg(e, "class", "container svelte-1sgcyba"), ot( e, "table", /*type*/ t[2] === "table" - ), rt( + ), ot( e, "gallery", /*type*/ t[2] === "gallery" - ), rt( + ), ot( e, "selected", /*selected*/ t[3] - ), rt( + ), ot( e, "border", /*value*/ @@ -12025,25 +12022,25 @@ function zg(t) { 1 && vi(i, 1)) : (i = dr(l), i.c(), vi(i, 1), i.m(e, null)) : i && (Dg(), rs(i, 1, 1, () => { i = null; }), Ng()), (!n || s & /*type*/ - 4) && rt( + 4) && ot( e, "table", /*type*/ l[2] === "table" ), (!n || s & /*type*/ - 4) && rt( + 4) && ot( e, "gallery", /*type*/ l[2] === "gallery" ), (!n || s & /*selected*/ - 8) && rt( + 8) && ot( e, "selected", /*selected*/ l[3] ), (!n || s & /*value*/ - 1) && rt( + 1) && ot( e, "border", /*value*/ @@ -12088,7 +12085,7 @@ const { destroy_component: Ot, detach: ja, empty: Xg, - flush: $, + flush: Q, get_spread_object: Wg, get_spread_update: Zg, group_outros: Yg, @@ -12097,8 +12094,8 @@ const { mount_component: Dt, safe_not_equal: Qg, space: Kg, - transition_in: $e, - transition_out: et + transition_in: Ke, + transition_out: $e } = window.__gradio__svelte__internal; function $g(t) { let e, n; @@ -12122,10 +12119,10 @@ function $g(t) { 32 && (s.$$scope = { dirty: l, ctx: i }), e.$set(s); }, i(i) { - n || ($e(e.$$.fragment, i), n = !0); + n || (Ke(e.$$.fragment, i), n = !0); }, o(i) { - et(e.$$.fragment, i), n = !1; + $e(e.$$.fragment, i), n = !1; }, d(i) { Ot(e, i); @@ -12157,10 +12154,10 @@ function eb(t) { i[23].i18n), e.$set(s); }, i(i) { - n || ($e(e.$$.fragment, i), n = !0); + n || (Ke(e.$$.fragment, i), n = !0); }, o(i) { - et(e.$$.fragment, i), n = !1; + $e(e.$$.fragment, i), n = !1; }, d(i) { Ot(e, i); @@ -12191,10 +12188,10 @@ function tb(t) { i[23].i18n), e.$set(s); }, i(i) { - n || ($e(e.$$.fragment, i), n = !0); + n || (Ke(e.$$.fragment, i), n = !0); }, o(i) { - et(e.$$.fragment, i), n = !1; + $e(e.$$.fragment, i), n = !1; }, d(i) { Ot(e, i); @@ -12211,10 +12208,10 @@ function nb(t) { Dt(e, i, l), n = !0; }, i(i) { - n || ($e(e.$$.fragment, i), n = !0); + n || (Ke(e.$$.fragment, i), n = !0); }, o(i) { - et(e.$$.fragment, i), n = !1; + $e(e.$$.fragment, i), n = !1; }, d(i) { Ot(e, i); @@ -12242,15 +12239,15 @@ function ib(t) { }, p(a, u) { let f = e; - e = r(a), e === f ? o[e].p(a, u) : (Yg(), et(o[f], 1, 1, () => { + e = r(a), e === f ? o[e].p(a, u) : (Yg(), $e(o[f], 1, 1, () => { o[f] = null; - }), Vg(), n = o[e], n ? n.p(a, u) : (n = o[e] = s[e](a), n.c()), $e(n, 1), n.m(i.parentNode, i)); + }), Vg(), n = o[e], n ? n.p(a, u) : (n = o[e] = s[e](a), n.c()), Ke(n, 1), n.m(i.parentNode, i)); }, i(a) { - l || ($e(n), l = !0); + l || (Ke(n), l = !0); }, o(a) { - et(n), l = !1; + $e(n), l = !1; }, d(a) { a && ja(i), o[e].d(a); @@ -12447,10 +12444,10 @@ function lb(t) { h[0], mr(() => s = !1)), i.$set(b); }, i(h) { - o || ($e(e.$$.fragment, h), $e(i.$$.fragment, h), o = !0); + o || (Ke(e.$$.fragment, h), Ke(i.$$.fragment, h), o = !0); }, o(h) { - et(e.$$.fragment, h), et(i.$$.fragment, h), o = !1; + $e(e.$$.fragment, h), $e(i.$$.fragment, h), o = !1; }, d(h) { h && ja(n), Ot(e, h), Ot(i, h); @@ -12536,10 +12533,10 @@ function sb(t) { 32 && (s.$$scope = { dirty: l, ctx: i }), e.$set(s); }, i(i) { - n || ($e(e.$$.fragment, i), n = !0); + n || (Ke(e.$$.fragment, i), n = !0); }, o(i) { - et(e.$$.fragment, i), n = !1; + $e(e.$$.fragment, i), n = !1; }, d(i) { Ot(e, i); @@ -12547,16 +12544,16 @@ function sb(t) { }; } function ob(t, e, n) { - let { elem_id: i = "" } = e, { elem_classes: l = [] } = e, { visible: s = !0 } = e, { value: o = null } = e, { label: r } = e, { show_label: a } = e, { root: u } = e, { height: f } = e, { width: _ } = e, { _selectable: h = !1 } = e, { container: c = !0 } = e, { scale: d = null } = e, { min_width: b = void 0 } = e, { loading_status: p } = e, { sources: g = ["upload", "clipboard"] } = e, { show_download_button: y } = e, { show_share_button: w } = e, { show_clear_button: C } = e, { interactive: P } = e, { boxes_alpha: E } = e, { label_list: N } = e, { label_colors: v } = e, { box_min_size: A } = e, { gradio: B } = e, L, x = null; - function Y(m) { - x = m, n(25, x); + let { elem_id: i = "" } = e, { elem_classes: l = [] } = e, { visible: s = !0 } = e, { value: o = null } = e, { label: r } = e, { show_label: a } = e, { root: u } = e, { height: f } = e, { width: _ } = e, { _selectable: h = !1 } = e, { container: c = !0 } = e, { scale: d = null } = e, { min_width: b = void 0 } = e, { loading_status: p } = e, { sources: g = ["upload", "clipboard"] } = e, { show_download_button: y } = e, { show_share_button: w } = e, { show_clear_button: C } = e, { interactive: P } = e, { boxes_alpha: E } = e, { label_list: N } = e, { label_colors: v } = e, { box_min_size: A } = e, { gradio: B } = e, I, G = null; + function Z(m) { + G = m, n(25, G); } function _e(m) { o = m, n(0, o); } - const te = () => B.dispatch("change"), Ee = () => B.dispatch("edit"), ve = () => { + const $ = () => B.dispatch("change"), Ee = () => B.dispatch("edit"), ve = () => { B.dispatch("clear"); - }, de = ({ detail: m }) => n(24, L = m), ce = () => B.dispatch("upload"), S = ({ detail: m }) => B.dispatch("select", m), k = ({ detail: m }) => B.dispatch("share", m), I = ({ detail: m }) => { + }, de = ({ detail: m }) => n(24, I = m), ce = () => B.dispatch("upload"), S = ({ detail: m }) => B.dispatch("select", m), k = ({ detail: m }) => B.dispatch("share", m), M = ({ detail: m }) => { n(1, p = p || {}), n(1, p.status = "error", p), B.dispatch("error", m); }; return t.$$set = (m) => { @@ -12586,18 +12583,18 @@ function ob(t, e, n) { v, A, B, - L, - x, - Y, + I, + G, + Z, _e, - te, + $, Ee, ve, de, ce, S, k, - I + M ]; } class db extends Gg { @@ -12642,145 +12639,145 @@ class db extends Gg { return this.$$.ctx[2]; } set elem_id(e) { - this.$$set({ elem_id: e }), $(); + this.$$set({ elem_id: e }), Q(); } get elem_classes() { return this.$$.ctx[3]; } set elem_classes(e) { - this.$$set({ elem_classes: e }), $(); + this.$$set({ elem_classes: e }), Q(); } get visible() { return this.$$.ctx[4]; } set visible(e) { - this.$$set({ visible: e }), $(); + this.$$set({ visible: e }), Q(); } get value() { return this.$$.ctx[0]; } set value(e) { - this.$$set({ value: e }), $(); + this.$$set({ value: e }), Q(); } get label() { return this.$$.ctx[5]; } set label(e) { - this.$$set({ label: e }), $(); + this.$$set({ label: e }), Q(); } get show_label() { return this.$$.ctx[6]; } set show_label(e) { - this.$$set({ show_label: e }), $(); + this.$$set({ show_label: e }), Q(); } get root() { return this.$$.ctx[7]; } set root(e) { - this.$$set({ root: e }), $(); + this.$$set({ root: e }), Q(); } get height() { return this.$$.ctx[8]; } set height(e) { - this.$$set({ height: e }), $(); + this.$$set({ height: e }), Q(); } get width() { return this.$$.ctx[9]; } set width(e) { - this.$$set({ width: e }), $(); + this.$$set({ width: e }), Q(); } get _selectable() { return this.$$.ctx[10]; } set _selectable(e) { - this.$$set({ _selectable: e }), $(); + this.$$set({ _selectable: e }), Q(); } get container() { return this.$$.ctx[11]; } set container(e) { - this.$$set({ container: e }), $(); + this.$$set({ container: e }), Q(); } get scale() { return this.$$.ctx[12]; } set scale(e) { - this.$$set({ scale: e }), $(); + this.$$set({ scale: e }), Q(); } get min_width() { return this.$$.ctx[13]; } set min_width(e) { - this.$$set({ min_width: e }), $(); + this.$$set({ min_width: e }), Q(); } get loading_status() { return this.$$.ctx[1]; } set loading_status(e) { - this.$$set({ loading_status: e }), $(); + this.$$set({ loading_status: e }), Q(); } get sources() { return this.$$.ctx[14]; } set sources(e) { - this.$$set({ sources: e }), $(); + this.$$set({ sources: e }), Q(); } get show_download_button() { return this.$$.ctx[15]; } set show_download_button(e) { - this.$$set({ show_download_button: e }), $(); + this.$$set({ show_download_button: e }), Q(); } get show_share_button() { return this.$$.ctx[16]; } set show_share_button(e) { - this.$$set({ show_share_button: e }), $(); + this.$$set({ show_share_button: e }), Q(); } get show_clear_button() { return this.$$.ctx[17]; } set show_clear_button(e) { - this.$$set({ show_clear_button: e }), $(); + this.$$set({ show_clear_button: e }), Q(); } get interactive() { return this.$$.ctx[18]; } set interactive(e) { - this.$$set({ interactive: e }), $(); + this.$$set({ interactive: e }), Q(); } get boxes_alpha() { return this.$$.ctx[19]; } set boxes_alpha(e) { - this.$$set({ boxes_alpha: e }), $(); + this.$$set({ boxes_alpha: e }), Q(); } get label_list() { return this.$$.ctx[20]; } set label_list(e) { - this.$$set({ label_list: e }), $(); + this.$$set({ label_list: e }), Q(); } get label_colors() { return this.$$.ctx[21]; } set label_colors(e) { - this.$$set({ label_colors: e }), $(); + this.$$set({ label_colors: e }), Q(); } get box_min_size() { return this.$$.ctx[22]; } set box_min_size(e) { - this.$$set({ box_min_size: e }), $(); + this.$$set({ box_min_size: e }), Q(); } get gradio() { return this.$$.ctx[23]; } set gradio(e) { - this.$$set({ gradio: e }), $(); + this.$$set({ gradio: e }), Q(); } } export {