diff --git "a/src/backend/gradio_videoslider/templates/component/index.js" "b/src/backend/gradio_videoslider/templates/component/index.js" --- "a/src/backend/gradio_videoslider/templates/component/index.js" +++ "b/src/backend/gradio_videoslider/templates/component/index.js" @@ -1,90 +1,90 @@ -var E1 = Object.defineProperty; -var sm = (n) => { +var M1 = Object.defineProperty; +var Em = (n) => { throw TypeError(n); }; -var b1 = (n, e, t) => e in n ? E1(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t; -var de = (n, e, t) => b1(n, typeof e != "symbol" ? e + "" : e, t), Ru = (n, e, t) => e.has(n) || sm("Cannot " + t); -var ue = (n, e, t) => (Ru(n, e, "read from private field"), t ? t.call(n) : e.get(n)), Mi = (n, e, t) => e.has(n) ? sm("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), $s = (n, e, t, i) => (Ru(n, e, "write to private field"), i ? i.call(n, t) : e.set(n, t), t), mo = (n, e, t) => (Ru(n, e, "access private method"), t); +var $1 = (n, e, t) => e in n ? M1(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t; +var de = (n, e, t) => $1(n, typeof e != "symbol" ? e + "" : e, t), Zu = (n, e, t) => e.has(n) || Em("Cannot " + t); +var ce = (n, e, t) => (Zu(n, e, "read from private field"), t ? t.call(n) : e.get(n)), Gi = (n, e, t) => e.has(n) ? Em("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), Ws = (n, e, t, i) => (Zu(n, e, "write to private field"), i ? i.call(n, t) : e.set(n, t), t), Co = (n, e, t) => (Zu(n, e, "access private method"), t); const { - SvelteComponent: T1, - append_hydration: Hh, - assign: S1, - attr: _t, - binding_callbacks: A1, - children: ba, - claim_element: G_, - claim_space: H_, - claim_svg_element: Cu, - create_slot: x1, - detach: Wi, - element: V_, - empty: rm, - get_all_dirty_from_scope: D1, - get_slot_changes: w1, - get_spread_update: L1, - init: I1, - insert_hydration: Ca, - listen: k1, - noop: R1, - safe_not_equal: C1, - set_dynamic_element_data: am, - set_style: xe, - space: q_, - svg_element: Fu, - toggle_class: et, - transition_in: K_, - transition_out: j_, - update_slot_base: F1 + SvelteComponent: B1, + append_hydration: ud, + assign: N1, + attr: Tt, + binding_callbacks: U1, + children: Ca, + claim_element: nv, + claim_space: sv, + claim_svg_element: Ju, + create_slot: G1, + detach: Qi, + element: rv, + empty: bm, + get_all_dirty_from_scope: H1, + get_slot_changes: V1, + get_spread_update: q1, + init: K1, + insert_hydration: qa, + listen: j1, + noop: z1, + safe_not_equal: W1, + set_dynamic_element_data: Tm, + set_style: De, + space: av, + svg_element: ec, + toggle_class: at, + transition_in: ov, + transition_out: lv, + update_slot_base: Y1 } = window.__gradio__svelte__internal; -function om(n) { +function Sm(n) { let e, t, i, s, r; return { c() { - e = Fu("svg"), t = Fu("line"), i = Fu("line"), this.h(); + e = ec("svg"), t = ec("line"), i = ec("line"), this.h(); }, l(a) { - e = Cu(a, "svg", { class: !0, xmlns: !0, viewBox: !0 }); - var o = ba(e); - t = Cu(o, "line", { + e = Ju(a, "svg", { class: !0, xmlns: !0, viewBox: !0 }); + var o = Ca(e); + t = Ju(o, "line", { x1: !0, y1: !0, x2: !0, y2: !0, stroke: !0, "stroke-width": !0 - }), ba(t).forEach(Wi), i = Cu(o, "line", { + }), Ca(t).forEach(Qi), i = Ju(o, "line", { x1: !0, y1: !0, x2: !0, y2: !0, stroke: !0, "stroke-width": !0 - }), ba(i).forEach(Wi), o.forEach(Wi), this.h(); + }), Ca(i).forEach(Qi), o.forEach(Qi), this.h(); }, h() { - _t(t, "x1", "1"), _t(t, "y1", "9"), _t(t, "x2", "9"), _t(t, "y2", "1"), _t(t, "stroke", "gray"), _t(t, "stroke-width", "0.5"), _t(i, "x1", "5"), _t(i, "y1", "9"), _t(i, "x2", "9"), _t(i, "y2", "5"), _t(i, "stroke", "gray"), _t(i, "stroke-width", "0.5"), _t(e, "class", "resize-handle svelte-239wnu"), _t(e, "xmlns", "http://www.w3.org/2000/svg"), _t(e, "viewBox", "0 0 10 10"); + Tt(t, "x1", "1"), Tt(t, "y1", "9"), Tt(t, "x2", "9"), Tt(t, "y2", "1"), Tt(t, "stroke", "gray"), Tt(t, "stroke-width", "0.5"), Tt(i, "x1", "5"), Tt(i, "y1", "9"), Tt(i, "x2", "9"), Tt(i, "y2", "5"), Tt(i, "stroke", "gray"), Tt(i, "stroke-width", "0.5"), Tt(e, "class", "resize-handle svelte-239wnu"), Tt(e, "xmlns", "http://www.w3.org/2000/svg"), Tt(e, "viewBox", "0 0 10 10"); }, m(a, o) { - Ca(a, e, o), Hh(e, t), Hh(e, i), s || (r = k1( + qa(a, e, o), ud(e, t), ud(e, i), s || (r = j1( e, "mousedown", /*resize*/ n[27] ), s = !0); }, - p: R1, + p: z1, d(a) { - a && Wi(e), s = !1, r(); + a && Qi(e), s = !1, r(); } }; } -function P1(n) { +function X1(n) { var h; let e, t, i, s, r; const a = ( /*#slots*/ n[31].default - ), o = x1( + ), o = G1( a, n, /*$$scope*/ @@ -93,7 +93,7 @@ function P1(n) { ); let u = ( /*resizable*/ - n[19] && om(n) + n[19] && Sm(n) ), l = [ { "data-testid": ( /*test_id*/ @@ -113,16 +113,16 @@ function P1(n) { } ], c = {}; for (let d = 0; d < l.length; d += 1) - c = S1(c, l[d]); + c = N1(c, l[d]); return { c() { - e = V_( + e = rv( /*tag*/ n[25] - ), o && o.c(), t = q_(), u && u.c(), this.h(); + ), o && o.c(), t = av(), u && u.c(), this.h(); }, l(d) { - e = G_( + e = nv( d, /*tag*/ (n[25] || "null").toUpperCase(), @@ -133,57 +133,57 @@ function P1(n) { dir: !0 } ); - var f = ba(e); - o && o.l(f), t = H_(f), u && u.l(f), f.forEach(Wi), this.h(); + var f = Ca(e); + o && o.l(f), t = sv(f), u && u.l(f), f.forEach(Qi), this.h(); }, h() { - am( + Tm( /*tag*/ n[25] - )(e, c), et( + )(e, c), at( e, "hidden", /*visible*/ n[14] === !1 - ), et( + ), at( e, "padded", /*padding*/ n[10] - ), et( + ), at( e, "flex", /*flex*/ n[1] - ), et( + ), at( e, "border_focus", /*border_mode*/ n[9] === "focus" - ), et( + ), at( e, "border_contrast", /*border_mode*/ n[9] === "contrast" - ), et(e, "hide-container", !/*explicit_call*/ + ), at(e, "hide-container", !/*explicit_call*/ n[12] && !/*container*/ - n[13]), et( + n[13]), at( e, "fullscreen", /*fullscreen*/ n[0] - ), et( + ), at( e, "animating", /*fullscreen*/ n[0] && /*preexpansionBoundingRect*/ n[24] !== null - ), et( + ), at( e, "auto-margin", /*scale*/ n[17] === null - ), xe( + ), De( e, "height", /*fullscreen*/ @@ -194,7 +194,7 @@ function P1(n) { n[2] ) ) - ), xe( + ), De( e, "min-height", /*fullscreen*/ @@ -205,7 +205,7 @@ function P1(n) { n[3] ) ) - ), xe( + ), De( e, "max-height", /*fullscreen*/ @@ -216,31 +216,31 @@ function P1(n) { n[4] ) ) - ), xe( + ), De( e, "--start-top", /*preexpansionBoundingRect*/ n[24] ? `${/*preexpansionBoundingRect*/ n[24].top}px` : "0px" - ), xe( + ), De( e, "--start-left", /*preexpansionBoundingRect*/ n[24] ? `${/*preexpansionBoundingRect*/ n[24].left}px` : "0px" - ), xe( + ), De( e, "--start-width", /*preexpansionBoundingRect*/ n[24] ? `${/*preexpansionBoundingRect*/ n[24].width}px` : "0px" - ), xe( + ), De( e, "--start-height", /*preexpansionBoundingRect*/ n[24] ? `${/*preexpansionBoundingRect*/ n[24].height}px` : "0px" - ), xe( + ), De( e, "width", /*fullscreen*/ @@ -253,12 +253,12 @@ function P1(n) { n[5] ) ) - ), xe( + ), De( e, "border-style", /*variant*/ n[8] - ), xe( + ), De( e, "overflow", /*allow_overflow*/ @@ -266,42 +266,42 @@ function P1(n) { /*overflow_behavior*/ n[16] ) : "hidden" - ), xe( + ), De( e, "flex-grow", /*scale*/ n[17] - ), xe(e, "min-width", `calc(min(${/*min_width*/ - n[18]}px, 100%))`), xe(e, "border-width", "var(--block-border-width)"); + ), De(e, "min-width", `calc(min(${/*min_width*/ + n[18]}px, 100%))`), De(e, "border-width", "var(--block-border-width)"); }, m(d, f) { - Ca(d, e, f), o && o.m(e, null), Hh(e, t), u && u.m(e, null), n[32](e), r = !0; + qa(d, e, f), o && o.m(e, null), ud(e, t), u && u.m(e, null), n[32](e), r = !0; }, p(d, f) { var m; o && o.p && (!r || f[0] & /*$$scope*/ - 1073741824) && F1( + 1073741824) && Y1( o, a, d, /*$$scope*/ d[30], - r ? w1( + r ? V1( a, /*$$scope*/ d[30], f, null - ) : D1( + ) : H1( /*$$scope*/ d[30] ), null ), /*resizable*/ - d[19] ? u ? u.p(d, f) : (u = om(d), u.c(), u.m(e, null)) : u && (u.d(1), u = null), am( + d[19] ? u ? u.p(d, f) : (u = Sm(d), u.c(), u.m(e, null)) : u && (u.d(1), u = null), Tm( /*tag*/ d[25] - )(e, c = L1(l, [ + )(e, c = q1(l, [ (!r || f[0] & /*test_id*/ 2048) && { "data-testid": ( /*test_id*/ @@ -318,51 +318,51 @@ function P1(n) { (!r || f[0] & /*rtl*/ 1048576 && s !== (s = /*rtl*/ d[20] ? "rtl" : "ltr")) && { dir: s } - ])), et( + ])), at( e, "hidden", /*visible*/ d[14] === !1 - ), et( + ), at( e, "padded", /*padding*/ d[10] - ), et( + ), at( e, "flex", /*flex*/ d[1] - ), et( + ), at( e, "border_focus", /*border_mode*/ d[9] === "focus" - ), et( + ), at( e, "border_contrast", /*border_mode*/ d[9] === "contrast" - ), et(e, "hide-container", !/*explicit_call*/ + ), at(e, "hide-container", !/*explicit_call*/ d[12] && !/*container*/ - d[13]), et( + d[13]), at( e, "fullscreen", /*fullscreen*/ d[0] - ), et( + ), at( e, "animating", /*fullscreen*/ d[0] && /*preexpansionBoundingRect*/ d[24] !== null - ), et( + ), at( e, "auto-margin", /*scale*/ d[17] === null ), f[0] & /*fullscreen, height*/ - 5 && xe( + 5 && De( e, "height", /*fullscreen*/ @@ -374,7 +374,7 @@ function P1(n) { ) ) ), f[0] & /*fullscreen, min_height*/ - 9 && xe( + 9 && De( e, "min-height", /*fullscreen*/ @@ -386,7 +386,7 @@ function P1(n) { ) ) ), f[0] & /*fullscreen, max_height*/ - 17 && xe( + 17 && De( e, "max-height", /*fullscreen*/ @@ -398,35 +398,35 @@ function P1(n) { ) ) ), f[0] & /*preexpansionBoundingRect*/ - 16777216 && xe( + 16777216 && De( e, "--start-top", /*preexpansionBoundingRect*/ d[24] ? `${/*preexpansionBoundingRect*/ d[24].top}px` : "0px" ), f[0] & /*preexpansionBoundingRect*/ - 16777216 && xe( + 16777216 && De( e, "--start-left", /*preexpansionBoundingRect*/ d[24] ? `${/*preexpansionBoundingRect*/ d[24].left}px` : "0px" ), f[0] & /*preexpansionBoundingRect*/ - 16777216 && xe( + 16777216 && De( e, "--start-width", /*preexpansionBoundingRect*/ d[24] ? `${/*preexpansionBoundingRect*/ d[24].width}px` : "0px" ), f[0] & /*preexpansionBoundingRect*/ - 16777216 && xe( + 16777216 && De( e, "--start-height", /*preexpansionBoundingRect*/ d[24] ? `${/*preexpansionBoundingRect*/ d[24].height}px` : "0px" ), f[0] & /*fullscreen, width*/ - 33 && xe( + 33 && De( e, "width", /*fullscreen*/ @@ -440,13 +440,13 @@ function P1(n) { ) ) ), f[0] & /*variant*/ - 256 && xe( + 256 && De( e, "border-style", /*variant*/ d[8] ), f[0] & /*allow_overflow, overflow_behavior*/ - 98304 && xe( + 98304 && De( e, "overflow", /*allow_overflow*/ @@ -455,42 +455,42 @@ function P1(n) { d[16] ) : "hidden" ), f[0] & /*scale*/ - 131072 && xe( + 131072 && De( e, "flex-grow", /*scale*/ d[17] ), f[0] & /*min_width*/ - 262144 && xe(e, "min-width", `calc(min(${/*min_width*/ + 262144 && De(e, "min-width", `calc(min(${/*min_width*/ d[18]}px, 100%))`); }, i(d) { - r || (K_(o, d), r = !0); + r || (ov(o, d), r = !0); }, o(d) { - j_(o, d), r = !1; + lv(o, d), r = !1; }, d(d) { - d && Wi(e), o && o.d(d), u && u.d(), n[32](null); + d && Qi(e), o && o.d(d), u && u.d(), n[32](null); } }; } -function lm(n) { +function Am(n) { let e; return { c() { - e = V_("div"), this.h(); + e = rv("div"), this.h(); }, l(t) { - e = G_(t, "DIV", { class: !0 }), ba(e).forEach(Wi), this.h(); + e = nv(t, "DIV", { class: !0 }), Ca(e).forEach(Qi), this.h(); }, h() { - _t(e, "class", "placeholder svelte-239wnu"), xe( + Tt(e, "class", "placeholder svelte-239wnu"), De( e, "height", /*placeholder_height*/ n[22] + "px" - ), xe( + ), De( e, "width", /*placeholder_width*/ @@ -498,17 +498,17 @@ function lm(n) { ); }, m(t, i) { - Ca(t, e, i); + qa(t, e, i); }, p(t, i) { i[0] & /*placeholder_height*/ - 4194304 && xe( + 4194304 && De( e, "height", /*placeholder_height*/ t[22] + "px" ), i[0] & /*placeholder_width*/ - 8388608 && xe( + 8388608 && De( e, "width", /*placeholder_width*/ @@ -516,76 +516,76 @@ function lm(n) { ); }, d(t) { - t && Wi(e); + t && Qi(e); } }; } -function O1(n) { +function Q1(n) { let e, t, i, s = ( /*tag*/ - n[25] && P1(n) + n[25] && X1(n) ), r = ( /*fullscreen*/ - n[0] && lm(n) + n[0] && Am(n) ); return { c() { - s && s.c(), e = q_(), r && r.c(), t = rm(); + s && s.c(), e = av(), r && r.c(), t = bm(); }, l(a) { - s && s.l(a), e = H_(a), r && r.l(a), t = rm(); + s && s.l(a), e = sv(a), r && r.l(a), t = bm(); }, m(a, o) { - s && s.m(a, o), Ca(a, e, o), r && r.m(a, o), Ca(a, t, o), i = !0; + s && s.m(a, o), qa(a, e, o), r && r.m(a, o), qa(a, t, o), i = !0; }, p(a, o) { /*tag*/ a[25] && s.p(a, o), /*fullscreen*/ - a[0] ? r ? r.p(a, o) : (r = lm(a), r.c(), r.m(t.parentNode, t)) : r && (r.d(1), r = null); + a[0] ? r ? r.p(a, o) : (r = Am(a), r.c(), r.m(t.parentNode, t)) : r && (r.d(1), r = null); }, i(a) { - i || (K_(s, a), i = !0); + i || (ov(s, a), i = !0); }, o(a) { - j_(s, a), i = !1; + lv(s, a), i = !1; }, d(a) { - a && (Wi(e), Wi(t)), s && s.d(a), r && r.d(a); + a && (Qi(e), Qi(t)), s && s.d(a), r && r.d(a); } }; } -function M1(n, e, t) { - let { $$slots: i = {}, $$scope: s } = e, { height: r = void 0 } = e, { min_height: a = void 0 } = e, { max_height: o = void 0 } = e, { width: u = void 0 } = e, { elem_id: l = "" } = e, { elem_classes: c = [] } = e, { variant: h = "solid" } = e, { border_mode: d = "base" } = e, { padding: f = !0 } = e, { type: m = "normal" } = e, { test_id: g = void 0 } = e, { explicit_call: p = !1 } = e, { container: y = !0 } = e, { visible: v = !0 } = e, { allow_overflow: _ = !0 } = e, { overflow_behavior: E = "auto" } = e, { scale: T = null } = e, { min_width: A = 0 } = e, { flex: S = !1 } = e, { resizable: D = !1 } = e, { rtl: x = !1 } = e, { fullscreen: w = !1 } = e, I = w, R, M = m === "fieldset" ? "fieldset" : "div", P = 0, K = 0, q = null; - function W(L) { +function Z1(n, e, t) { + let { $$slots: i = {}, $$scope: s } = e, { height: r = void 0 } = e, { min_height: a = void 0 } = e, { max_height: o = void 0 } = e, { width: u = void 0 } = e, { elem_id: l = "" } = e, { elem_classes: c = [] } = e, { variant: h = "solid" } = e, { border_mode: d = "base" } = e, { padding: f = !0 } = e, { type: m = "normal" } = e, { test_id: g = void 0 } = e, { explicit_call: p = !1 } = e, { container: y = !0 } = e, { visible: v = !0 } = e, { allow_overflow: _ = !0 } = e, { overflow_behavior: E = "auto" } = e, { scale: T = null } = e, { min_width: x = 0 } = e, { flex: S = !1 } = e, { resizable: D = !1 } = e, { rtl: A = !1 } = e, { fullscreen: w = !1 } = e, I = w, M, k = m === "fieldset" ? "fieldset" : "div", q = 0, K = 0, H = null; + function Y(L) { w && L.key === "Escape" && t(0, w = !1); } - const U = (L) => { + const B = (L) => { if (L !== void 0) { if (typeof L == "number") return L + "px"; if (typeof L == "string") return L; } - }, j = (L) => { - let H = L.clientY; - const Q = (C) => { - const B = C.clientY - H; - H = C.clientY, t(21, R.style.height = `${R.offsetHeight + B}px`, R); - }, X = () => { - window.removeEventListener("mousemove", Q), window.removeEventListener("mouseup", X); + }, z = (L) => { + let $ = L.clientY; + const Q = (O) => { + const N = O.clientY - $; + $ = O.clientY, t(21, M.style.height = `${M.offsetHeight + N}px`, M); + }, C = () => { + window.removeEventListener("mousemove", Q), window.removeEventListener("mouseup", C); }; - window.addEventListener("mousemove", Q), window.addEventListener("mouseup", X); + window.addEventListener("mousemove", Q), window.addEventListener("mouseup", C); }; - function $(L) { - A1[L ? "unshift" : "push"](() => { - R = L, t(21, R); + function W(L) { + U1[L ? "unshift" : "push"](() => { + M = L, t(21, M); }); } return n.$$set = (L) => { - "height" in L && t(2, r = L.height), "min_height" in L && t(3, a = L.min_height), "max_height" in L && t(4, o = L.max_height), "width" in L && t(5, u = L.width), "elem_id" in L && t(6, l = L.elem_id), "elem_classes" in L && t(7, c = L.elem_classes), "variant" in L && t(8, h = L.variant), "border_mode" in L && t(9, d = L.border_mode), "padding" in L && t(10, f = L.padding), "type" in L && t(28, m = L.type), "test_id" in L && t(11, g = L.test_id), "explicit_call" in L && t(12, p = L.explicit_call), "container" in L && t(13, y = L.container), "visible" in L && t(14, v = L.visible), "allow_overflow" in L && t(15, _ = L.allow_overflow), "overflow_behavior" in L && t(16, E = L.overflow_behavior), "scale" in L && t(17, T = L.scale), "min_width" in L && t(18, A = L.min_width), "flex" in L && t(1, S = L.flex), "resizable" in L && t(19, D = L.resizable), "rtl" in L && t(20, x = L.rtl), "fullscreen" in L && t(0, w = L.fullscreen), "$$scope" in L && t(30, s = L.$$scope); + "height" in L && t(2, r = L.height), "min_height" in L && t(3, a = L.min_height), "max_height" in L && t(4, o = L.max_height), "width" in L && t(5, u = L.width), "elem_id" in L && t(6, l = L.elem_id), "elem_classes" in L && t(7, c = L.elem_classes), "variant" in L && t(8, h = L.variant), "border_mode" in L && t(9, d = L.border_mode), "padding" in L && t(10, f = L.padding), "type" in L && t(28, m = L.type), "test_id" in L && t(11, g = L.test_id), "explicit_call" in L && t(12, p = L.explicit_call), "container" in L && t(13, y = L.container), "visible" in L && t(14, v = L.visible), "allow_overflow" in L && t(15, _ = L.allow_overflow), "overflow_behavior" in L && t(16, E = L.overflow_behavior), "scale" in L && t(17, T = L.scale), "min_width" in L && t(18, x = L.min_width), "flex" in L && t(1, S = L.flex), "resizable" in L && t(19, D = L.resizable), "rtl" in L && t(20, A = L.rtl), "fullscreen" in L && t(0, w = L.fullscreen), "$$scope" in L && t(30, s = L.$$scope); }, n.$$.update = () => { n.$$.dirty[0] & /*fullscreen, old_fullscreen, element*/ - 538968065 && w !== I && (t(29, I = w), w ? (t(24, q = R.getBoundingClientRect()), t(22, P = R.offsetHeight), t(23, K = R.offsetWidth), window.addEventListener("keydown", W)) : (t(24, q = null), window.removeEventListener("keydown", W))), n.$$.dirty[0] & /*visible*/ + 538968065 && w !== I && (t(29, I = w), w ? (t(24, H = M.getBoundingClientRect()), t(22, q = M.offsetHeight), t(23, K = M.offsetWidth), window.addEventListener("keydown", Y)) : (t(24, H = null), window.removeEventListener("keydown", Y))), n.$$.dirty[0] & /*visible*/ 16384 && (v || t(1, S = !1)); }, [ w, @@ -606,31 +606,31 @@ function M1(n, e, t) { _, E, T, - A, - D, x, - R, - P, - K, - q, + D, + A, M, - U, - j, + q, + K, + H, + k, + B, + z, m, I, s, i, - $ + W ]; } -class z_ extends T1 { +class uv extends B1 { constructor(e) { - super(), I1( + super(), K1( this, e, - M1, - O1, - C1, + Z1, + Q1, + W1, { height: 2, min_height: 3, @@ -660,7 +660,7 @@ class z_ extends T1 { ); } } -function Kd() { +function ff() { return { async: !1, breaks: !1, @@ -674,43 +674,43 @@ function Kd() { walkTokens: null }; } -let ks = Kd(); -function W_(n) { - ks = n; +let Gs = ff(); +function cv(n) { + Gs = n; } -const Y_ = /[&<>"']/, $1 = new RegExp(Y_.source, "g"), X_ = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, B1 = new RegExp(X_.source, "g"), N1 = { +const hv = /[&<>"']/, J1 = new RegExp(hv.source, "g"), dv = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, eb = new RegExp(dv.source, "g"), tb = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" -}, um = (n) => N1[n]; -function Gt(n, e) { +}, xm = (n) => tb[n]; +function zt(n, e) { if (e) { - if (Y_.test(n)) - return n.replace($1, um); - } else if (X_.test(n)) - return n.replace(B1, um); + if (hv.test(n)) + return n.replace(J1, xm); + } else if (dv.test(n)) + return n.replace(eb, xm); return n; } -const U1 = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; -function G1(n) { - return n.replace(U1, (e, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : "")); +const ib = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; +function nb(n) { + return n.replace(ib, (e, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : "")); } -const H1 = /(^|[^\[])\^/g; +const sb = /(^|[^\[])\^/g; function Ce(n, e) { let t = typeof n == "string" ? n : n.source; e = e || ""; const i = { replace: (s, r) => { let a = typeof r == "string" ? r : r.source; - return a = a.replace(H1, "$1"), t = t.replace(s, a), i; + return a = a.replace(sb, "$1"), t = t.replace(s, a), i; }, getRegex: () => new RegExp(t, e) }; return i; } -function cm(n) { +function Dm(n) { try { n = encodeURI(n).replace(/%25/g, "%"); } catch { @@ -718,8 +718,8 @@ function cm(n) { } return n; } -const Ta = { exec: () => null }; -function hm(n, e) { +const Fa = { exec: () => null }; +function wm(n, e) { const t = n.replace(/\|/g, (r, a, o) => { let u = !1, l = a; for (; --l >= 0 && o[l] === "\\"; ) @@ -737,7 +737,7 @@ function hm(n, e) { i[s] = i[s].trim().replace(/\\\|/g, "|"); return i; } -function go(n, e, t) { +function Fo(n, e, t) { const i = n.length; if (i === 0) return ""; @@ -746,7 +746,7 @@ function go(n, e, t) { s++; return n.slice(0, i - s); } -function V1(n, e) { +function rb(n, e) { if (n.indexOf(e[1]) === -1) return -1; let t = 0; @@ -759,8 +759,8 @@ function V1(n, e) { return i; return -1; } -function dm(n, e, t, i) { - const s = e.href, r = e.title ? Gt(e.title) : null, a = n[1].replace(/\\([\[\]])/g, "$1"); +function Lm(n, e, t, i) { + const s = e.href, r = e.title ? zt(e.title) : null, a = n[1].replace(/\\([\[\]])/g, "$1"); if (n[0].charAt(0) !== "!") { i.state.inLink = !0; const o = { @@ -778,10 +778,10 @@ function dm(n, e, t, i) { raw: t, href: s, title: r, - text: Gt(a) + text: zt(a) }; } -function q1(n, e) { +function ab(n, e) { const t = n.match(/^(\s+)(?:```)/); if (t === null) return e; @@ -796,14 +796,14 @@ function q1(n, e) { }).join(` `); } -class Dl { +class ql { // set by the lexer constructor(e) { de(this, "options"); de(this, "rules"); // set by the lexer de(this, "lexer"); - this.options = e || ks; + this.options = e || Gs; } space(e) { const t = this.rules.block.newline.exec(e); @@ -821,7 +821,7 @@ class Dl { type: "code", raw: t[0], codeBlockStyle: "indented", - text: this.options.pedantic ? i : go(i, ` + text: this.options.pedantic ? i : Fo(i, ` `) }; } @@ -829,7 +829,7 @@ class Dl { fences(e) { const t = this.rules.block.fences.exec(e); if (t) { - const i = t[0], s = q1(i, t[3] || ""); + const i = t[0], s = ab(i, t[3] || ""); return { type: "code", raw: i, @@ -843,7 +843,7 @@ class Dl { if (t) { let i = t[2].trim(); if (/#$/.test(i)) { - const s = go(i, "#"); + const s = Fo(i, "#"); (this.options.pedantic || !s || / $/.test(s)) && (i = s.trim()); } return { @@ -868,7 +868,7 @@ class Dl { if (t) { let i = t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, ` $1`); - i = go(i.replace(/^ *>[ \t]?/gm, ""), ` + i = Fo(i.replace(/^ *>[ \t]?/gm, ""), ` `); const s = this.lexer.state.top; this.lexer.state.top = !0; @@ -979,7 +979,7 @@ class Dl { const t = this.rules.block.table.exec(e); if (!t || !/[:|]/.test(t[2])) return; - const i = hm(t[1]), s = t[2].replace(/^\||\| *$/g, "").split("|"), r = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(` + const i = wm(t[1]), s = t[2].replace(/^\||\| *$/g, "").split("|"), r = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(` `) : [], a = { type: "table", raw: t[0], @@ -996,7 +996,7 @@ class Dl { tokens: this.lexer.inline(o) }); for (const o of r) - a.rows.push(hm(o, a.header.length).map((u) => ({ + a.rows.push(wm(o, a.header.length).map((u) => ({ text: u, tokens: this.lexer.inline(u) }))); @@ -1043,7 +1043,7 @@ class Dl { return { type: "escape", raw: t[0], - text: Gt(t[1]) + text: zt(t[1]) }; } tag(e) { @@ -1065,11 +1065,11 @@ class Dl { if (!this.options.pedantic && /^$/.test(i)) return; - const a = go(i.slice(0, -1), "\\"); + const a = Fo(i.slice(0, -1), "\\"); if ((i.length - a.length) % 2 === 0) return; } else { - const a = V1(t[2], "()"); + const a = rb(t[2], "()"); if (a > -1) { const u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + a; t[2] = t[2].substring(0, a), t[0] = t[0].substring(0, u).trim(), t[3] = ""; @@ -1081,7 +1081,7 @@ class Dl { a && (s = a[1], r = a[3]); } else r = t[3] ? t[3].slice(1, -1) : ""; - return s = s.trim(), /^$/.test(i) ? s = s.slice(1) : s = s.slice(1, -1)), dm(t, { + return s = s.trim(), /^$/.test(i) ? s = s.slice(1) : s = s.slice(1, -1)), Lm(t, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: r && r.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer); @@ -1099,7 +1099,7 @@ class Dl { text: a }; } - return dm(i, r, i[0], this.lexer); + return Lm(i, r, i[0], this.lexer); } } emStrong(e, t, i = "") { @@ -1148,7 +1148,7 @@ class Dl { if (t) { let i = t[2].replace(/\n/g, " "); const s = /[^ ]/.test(i), r = /^ /.test(i) && / $/.test(i); - return s && r && (i = i.substring(1, i.length - 1)), i = Gt(i, !0), { + return s && r && (i = i.substring(1, i.length - 1)), i = zt(i, !0), { type: "codespan", raw: t[0], text: i @@ -1177,7 +1177,7 @@ class Dl { const t = this.rules.inline.autolink.exec(e); if (t) { let i, s; - return t[2] === "@" ? (i = Gt(t[1]), s = "mailto:" + i) : (i = Gt(t[1]), s = i), { + return t[2] === "@" ? (i = zt(t[1]), s = "mailto:" + i) : (i = zt(t[1]), s = i), { type: "link", raw: t[0], text: i, @@ -1198,13 +1198,13 @@ class Dl { if (t = this.rules.inline.url.exec(e)) { let s, r; if (t[2] === "@") - s = Gt(t[0]), r = "mailto:" + s; + s = zt(t[0]), r = "mailto:" + s; else { let a; do a = t[0], t[0] = ((i = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : i[0]) ?? ""; while (a !== t[0]); - s = Gt(t[0]), t[1] === "www." ? r = "http://" + t[0] : r = t[0]; + s = zt(t[0]), t[1] === "www." ? r = "http://" + t[0] : r = t[0]; } return { type: "link", @@ -1225,7 +1225,7 @@ class Dl { const t = this.rules.inline.text.exec(e); if (t) { let i; - return this.lexer.state.inRawBlock ? i = t[0] : i = Gt(t[0]), { + return this.lexer.state.inRawBlock ? i = t[0] : i = zt(t[0]), { type: "text", raw: t[0], text: i @@ -1233,118 +1233,118 @@ class Dl { } } } -const K1 = /^(?: *(?:\n|$))+/, j1 = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, z1 = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Qa = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, W1 = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Q_ = /(?:[*+-]|\d{1,9}[.)])/, Z_ = Ce(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, Q_).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), jd = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Y1 = /^[^\n]+/, zd = /(?!\s*\])(?:\\.|[^\[\]\\])+/, X1 = Ce(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", zd).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Q1 = Ce(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q_).getRegex(), ru = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Wd = /|$))/, Z1 = Ce("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", Wd).replace("tag", ru).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), J_ = Ce(jd).replace("hr", Qa).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", ru).getRegex(), J1 = Ce(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", J_).getRegex(), Yd = { - blockquote: J1, - code: j1, - def: X1, - fences: z1, - heading: W1, - hr: Qa, - html: Z1, - lheading: Z_, - list: Q1, - newline: K1, - paragraph: J_, - table: Ta, - text: Y1 -}, fm = Ce("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Qa).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", ru).getRegex(), eb = { - ...Yd, - table: fm, - paragraph: Ce(jd).replace("hr", Qa).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", fm).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", ru).getRegex() -}, tb = { - ...Yd, - html: Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Wd).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), +const ob = /^(?: *(?:\n|$))+/, lb = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, ub = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ho = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, cb = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, fv = /(?:[*+-]|\d{1,9}[.)])/, mv = Ce(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, fv).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), mf = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, hb = /^[^\n]+/, gf = /(?!\s*\])(?:\\.|[^\[\]\\])+/, db = Ce(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", gf).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), fb = Ce(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, fv).getRegex(), Du = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", pf = /|$))/, mb = Ce("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", pf).replace("tag", Du).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), gv = Ce(mf).replace("hr", ho).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", Du).getRegex(), gb = Ce(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", gv).getRegex(), _f = { + blockquote: gb, + code: lb, + def: db, + fences: ub, + heading: cb, + hr: ho, + html: mb, + lheading: mv, + list: fb, + newline: ob, + paragraph: gv, + table: Fa, + text: hb +}, Im = Ce("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ho).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", Du).getRegex(), pb = { + ..._f, + table: Im, + paragraph: Ce(mf).replace("hr", ho).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Im).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", ")|<(?:script|pre|style|textarea|!--)").replace("tag", Du).getRegex() +}, _b = { + ..._f, + html: Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", pf).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, - fences: Ta, + fences: Fa, // fences not supported lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, - paragraph: Ce(jd).replace("hr", Qa).replace("heading", ` *#{1,6} *[^ -]`).replace("lheading", Z_).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() -}, ev = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ib = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, tv = /^( {2,}|\\)\n(?!\s*$)/, nb = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g, ab = Ce(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, Za).getRegex(), ob = Ce("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, Za).getRegex(), lb = Ce("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, Za).getRegex(), ub = Ce(/\\([punct])/, "gu").replace(/punct/g, Za).getRegex(), cb = Ce(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), hb = Ce(Wd).replace("(?:-->|$)", "-->").getRegex(), db = Ce("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment", hb).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), wl = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, fb = Ce(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", wl).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), iv = Ce(/^!?\[(label)\]\[(ref)\]/).replace("label", wl).replace("ref", zd).getRegex(), nv = Ce(/^!?\[(ref)\](?:\[\])?/).replace("ref", zd).getRegex(), mb = Ce("reflink|nolink(?!\\()", "g").replace("reflink", iv).replace("nolink", nv).getRegex(), Xd = { - _backpedal: Ta, + paragraph: Ce(mf).replace("hr", ho).replace("heading", ` *#{1,6} *[^ +]`).replace("lheading", mv).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() +}, pv = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, vb = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, _v = /^( {2,}|\\)\n(?!\s*$)/, yb = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g, Tb = Ce(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, fo).getRegex(), Sb = Ce("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, fo).getRegex(), Ab = Ce("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, fo).getRegex(), xb = Ce(/\\([punct])/, "gu").replace(/punct/g, fo).getRegex(), Db = Ce(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), wb = Ce(pf).replace("(?:-->|$)", "-->").getRegex(), Lb = Ce("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment", wb).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Kl = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Ib = Ce(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", Kl).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), vv = Ce(/^!?\[(label)\]\[(ref)\]/).replace("label", Kl).replace("ref", gf).getRegex(), yv = Ce(/^!?\[(ref)\](?:\[\])?/).replace("ref", gf).getRegex(), kb = Ce("reflink|nolink(?!\\()", "g").replace("reflink", vv).replace("nolink", yv).getRegex(), vf = { + _backpedal: Fa, // only used for GFM url - anyPunctuation: ub, - autolink: cb, - blockSkip: rb, - br: tv, - code: ib, - del: Ta, - emStrongLDelim: ab, - emStrongRDelimAst: ob, - emStrongRDelimUnd: lb, - escape: ev, - link: fb, - nolink: nv, - punctuation: sb, - reflink: iv, - reflinkSearch: mb, - tag: db, - text: nb, - url: Ta -}, gb = { - ...Xd, - link: Ce(/^!?\[(label)\]\((.*?)\)/).replace("label", wl).getRegex(), - reflink: Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", wl).getRegex() -}, Vh = { - ...Xd, - escape: Ce(ev).replace("])", "~|])").getRegex(), + anyPunctuation: xb, + autolink: Db, + blockSkip: bb, + br: _v, + code: vb, + del: Fa, + emStrongLDelim: Tb, + emStrongRDelimAst: Sb, + emStrongRDelimUnd: Ab, + escape: pv, + link: Ib, + nolink: yv, + punctuation: Eb, + reflink: vv, + reflinkSearch: kb, + tag: Lb, + text: yb, + url: Fa +}, Rb = { + ...vf, + link: Ce(/^!?\[(label)\]\((.*?)\)/).replace("label", Kl).getRegex(), + reflink: Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Kl).getRegex() +}, cd = { + ...vf, + escape: Ce(pv).replace("])", "~|])").getRegex(), url: Ce(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/, text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\' + (i ? e : Gt(e, !0)) + ` -` : "
" + (i ? e : Gt(e, !0)) + `
+`, s ? '
' + (i ? e : zt(e, !0)) + `
+` : "
" + (i ? e : zt(e, !0)) + `
`; } blockquote(e) { @@ -1612,7 +1612,7 @@ ${e} return `${e}`; } link(e, t, i) { - const s = cm(e); + const s = Dm(e); if (s === null) return i; e = s; @@ -1620,7 +1620,7 @@ ${e} return t && (r += ' title="' + t + '"'), r += ">" + i + "", r; } image(e, t, i) { - const s = cm(e); + const s = Dm(e); if (s === null) return i; e = s; @@ -1631,7 +1631,7 @@ ${e} return e; } } -class Qd { +class yf { // no need for block level renderers strong(e) { return e; @@ -1661,24 +1661,24 @@ class Qd { return ""; } } -class Xi { +class Ji { constructor(e) { de(this, "options"); de(this, "renderer"); de(this, "textRenderer"); - this.options = e || ks, this.options.renderer = this.options.renderer || new Ll(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new Qd(); + this.options = e || Gs, this.options.renderer = this.options.renderer || new jl(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new yf(); } /** * Static Parse Method */ static parse(e, t) { - return new Xi(t).parse(e); + return new Ji(t).parse(e); } /** * Static Parse Inline Method */ static parseInline(e, t) { - return new Xi(t).parseInline(e); + return new Ji(t).parseInline(e); } /** * Parse Loop @@ -1703,7 +1703,7 @@ class Xi { } case "heading": { const a = r; - i += this.renderer.heading(this.parseInline(a.tokens), a.depth, G1(this.parseInline(a.tokens, this.textRenderer))); + i += this.renderer.heading(this.parseInline(a.tokens), a.depth, nb(this.parseInline(a.tokens, this.textRenderer))); continue; } case "code": { @@ -1855,10 +1855,10 @@ class Xi { return i; } } -class Sa { +class Pa { constructor(e) { de(this, "options"); - this.options = e || ks; + this.options = e || Gs; } /** * Process markdown before marked @@ -1879,25 +1879,25 @@ class Sa { return e; } } -de(Sa, "passThroughHooks", /* @__PURE__ */ new Set([ +de(Pa, "passThroughHooks", /* @__PURE__ */ new Set([ "preprocess", "postprocess", "processAllTokens" ])); -var Is, qh, sv; -class _b { +var Us, hd, Ev; +class Fb { constructor(...e) { - Mi(this, Is); - de(this, "defaults", Kd()); + Gi(this, Us); + de(this, "defaults", ff()); de(this, "options", this.setOptions); - de(this, "parse", mo(this, Is, qh).call(this, Yi.lex, Xi.parse)); - de(this, "parseInline", mo(this, Is, qh).call(this, Yi.lexInline, Xi.parseInline)); - de(this, "Parser", Xi); - de(this, "Renderer", Ll); - de(this, "TextRenderer", Qd); - de(this, "Lexer", Yi); - de(this, "Tokenizer", Dl); - de(this, "Hooks", Sa); + de(this, "parse", Co(this, Us, hd).call(this, Zi.lex, Ji.parse)); + de(this, "parseInline", Co(this, Us, hd).call(this, Zi.lexInline, Ji.parseInline)); + de(this, "Parser", Ji); + de(this, "Renderer", jl); + de(this, "TextRenderer", yf); + de(this, "Lexer", Zi); + de(this, "Tokenizer", ql); + de(this, "Hooks", Pa); this.use(...e); } /** @@ -1954,7 +1954,7 @@ class _b { } "childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens); }), s.extensions = t), i.renderer) { - const r = this.defaults.renderer || new Ll(this.defaults); + const r = this.defaults.renderer || new jl(this.defaults); for (const a in i.renderer) { if (!(a in r)) throw new Error(`renderer '${a}' does not exist`); @@ -1969,7 +1969,7 @@ class _b { s.renderer = r; } if (i.tokenizer) { - const r = this.defaults.tokenizer || new Dl(this.defaults); + const r = this.defaults.tokenizer || new ql(this.defaults); for (const a in i.tokenizer) { if (!(a in r)) throw new Error(`tokenizer '${a}' does not exist`); @@ -1984,14 +1984,14 @@ class _b { s.tokenizer = r; } if (i.hooks) { - const r = this.defaults.hooks || new Sa(); + const r = this.defaults.hooks || new Pa(); for (const a in i.hooks) { if (!(a in r)) throw new Error(`hook '${a}' does not exist`); if (a === "options") continue; const o = a, u = i.hooks[o], l = r[o]; - Sa.passThroughHooks.has(a) ? r[o] = (c) => { + Pa.passThroughHooks.has(a) ? r[o] = (c) => { if (this.defaults.async) return Promise.resolve(u.call(r, c)).then((d) => l.call(r, d)); const h = u.call(r, c); @@ -2017,17 +2017,17 @@ class _b { return this.defaults = { ...this.defaults, ...e }, this; } lexer(e, t) { - return Yi.lex(e, t ?? this.defaults); + return Zi.lex(e, t ?? this.defaults); } parser(e, t) { - return Xi.parse(e, t ?? this.defaults); + return Ji.parse(e, t ?? this.defaults); } } -Is = new WeakSet(), qh = function(e, t) { +Us = new WeakSet(), hd = function(e, t) { return (i, s) => { const r = { ...s }, a = { ...this.defaults, ...r }; this.defaults.async === !0 && r.async === !1 && (a.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), a.async = !0); - const o = mo(this, Is, sv).call(this, !!a.silent, !!a.async); + const o = Co(this, Us, Ev).call(this, !!a.silent, !!a.async); if (typeof i > "u" || i === null) return o(new Error("marked(): input parameter is undefined or null")); if (typeof i != "string") @@ -2044,11 +2044,11 @@ Is = new WeakSet(), qh = function(e, t) { return o(u); } }; -}, sv = function(e, t) { +}, Ev = function(e, t) { return (i) => { if (i.message += ` Please report this to https://github.com/markedjs/marked.`, e) { - const s = "

An error occurred:

" + Gt(i.message + "", !0) + "
"; + const s = "

An error occurred:

" + zt(i.message + "", !0) + "
"; return t ? Promise.resolve(s) : s; } if (t) @@ -2056,40 +2056,40 @@ Please report this to https://github.com/markedjs/marked.`, e) { throw i; }; }; -const As = new _b(); +const Os = new Fb(); function ke(n, e) { - return As.parse(n, e); + return Os.parse(n, e); } ke.options = ke.setOptions = function(n) { - return As.setOptions(n), ke.defaults = As.defaults, W_(ke.defaults), ke; + return Os.setOptions(n), ke.defaults = Os.defaults, cv(ke.defaults), ke; }; -ke.getDefaults = Kd; -ke.defaults = ks; +ke.getDefaults = ff; +ke.defaults = Gs; ke.use = function(...n) { - return As.use(...n), ke.defaults = As.defaults, W_(ke.defaults), ke; + return Os.use(...n), ke.defaults = Os.defaults, cv(ke.defaults), ke; }; ke.walkTokens = function(n, e) { - return As.walkTokens(n, e); + return Os.walkTokens(n, e); }; -ke.parseInline = As.parseInline; -ke.Parser = Xi; -ke.parser = Xi.parse; -ke.Renderer = Ll; -ke.TextRenderer = Qd; -ke.Lexer = Yi; -ke.lexer = Yi.lex; -ke.Tokenizer = Dl; -ke.Hooks = Sa; +ke.parseInline = Os.parseInline; +ke.Parser = Ji; +ke.parser = Ji.parse; +ke.Renderer = jl; +ke.TextRenderer = yf; +ke.Lexer = Zi; +ke.lexer = Zi.lex; +ke.Tokenizer = ql; +ke.Hooks = Pa; ke.parse = ke; ke.options; ke.setOptions; ke.use; ke.walkTokens; ke.parseInline; -Xi.parse; -Yi.lex; -const vb = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g, yb = Object.hasOwnProperty; -class rv { +Ji.parse; +Zi.lex; +const Pb = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g, Ob = Object.hasOwnProperty; +class bv { /** * Create a new slug class. */ @@ -2112,9 +2112,9 @@ class rv { */ slug(e, t) { const i = this; - let s = Eb(e, t === !0); + let s = Mb(e, t === !0); const r = s; - for (; yb.call(i.occurrences, s); ) + for (; Ob.call(i.occurrences, s); ) i.occurrences[r]++, s = r + "-" + i.occurrences[r]; return i.occurrences[s] = 0, s; } @@ -2127,11 +2127,11 @@ class rv { this.occurrences = /* @__PURE__ */ Object.create(null); } } -function Eb(n, e) { - return typeof n != "string" ? "" : (e || (n = n.toLowerCase()), n.replace(vb, "").replace(/ /g, "-")); +function Mb(n, e) { + return typeof n != "string" ? "" : (e || (n = n.toLowerCase()), n.replace(Pb, "").replace(/ /g, "-")); } -new rv(); -var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, bb = { exports: {} }; +new bv(); +var km = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, $b = { exports: {} }; (function(n) { var e = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {}; /** @@ -2241,13 +2241,13 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t */ clone: function v(_, E) { E = E || {}; - var T, A; + var T, x; switch (o.util.type(_)) { case "Object": - if (A = o.util.objId(_), E[A]) - return E[A]; + if (x = o.util.objId(_), E[x]) + return E[x]; T = /** @type {Record} */ - {}, E[A] = T; + {}, E[x] = T; for (var S in _) _.hasOwnProperty(S) && (T[S] = v(_[S], E)); return ( @@ -2255,10 +2255,10 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t T ); case "Array": - return A = o.util.objId(_), E[A] ? E[A] : (T = [], E[A] = T, /** @type {Array} */ + return x = o.util.objId(_), E[x] ? E[x] : (T = [], E[x] = T, /** @type {Array} */ /** @type {any} */ - _.forEach(function(D, x) { - T[x] = v(D, E); + _.forEach(function(D, A) { + T[A] = v(D, E); }), /** @type {any} */ T); default: @@ -2341,10 +2341,10 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t */ isActive: function(v, _, E) { for (var T = "no-" + _; v; ) { - var A = v.classList; - if (A.contains(_)) + var x = v.classList; + if (x.contains(_)) return !0; - if (A.contains(T)) + if (x.contains(T)) return !1; v = v.parentElement; } @@ -2478,28 +2478,28 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t insertBefore: function(v, _, E, T) { T = T || /** @type {any} */ o.languages; - var A = T[v], S = {}; - for (var D in A) - if (A.hasOwnProperty(D)) { + var x = T[v], S = {}; + for (var D in x) + if (x.hasOwnProperty(D)) { if (D == _) - for (var x in E) - E.hasOwnProperty(x) && (S[x] = E[x]); - E.hasOwnProperty(D) || (S[D] = A[D]); + for (var A in E) + E.hasOwnProperty(A) && (S[A] = E[A]); + E.hasOwnProperty(D) || (S[D] = x[D]); } var w = T[v]; - return T[v] = S, o.languages.DFS(o.languages, function(I, R) { - R === w && I != v && (this[I] = S); + return T[v] = S, o.languages.DFS(o.languages, function(I, M) { + M === w && I != v && (this[I] = S); }), S; }, // Traverse a language definition with Depth First Search - DFS: function v(_, E, T, A) { - A = A || {}; + DFS: function v(_, E, T, x) { + x = x || {}; var S = o.util.objId; for (var D in _) if (_.hasOwnProperty(D)) { E.call(_, D, _[D], T || D); - var x = _[D], w = o.util.type(x); - w === "Object" && !A[S(x)] ? (A[S(x)] = !0, v(x, E, null, A)) : w === "Array" && !A[S(x)] && (A[S(x)] = !0, v(x, E, D, A)); + var A = _[D], w = o.util.type(A); + w === "Object" && !x[S(A)] ? (x[S(A)] = !0, v(A, E, null, x)) : w === "Array" && !x[S(A)] && (x[S(A)] = !0, v(A, E, D, x)); } } }, @@ -2541,7 +2541,7 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' }; o.hooks.run("before-highlightall", T), T.elements = Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)), o.hooks.run("before-all-elements-highlight", T); - for (var A = 0, S; S = T.elements[A++]; ) + for (var x = 0, S; S = T.elements[x++]; ) o.highlightElement(S, _ === !0, T.callback); }, /** @@ -2573,38 +2573,38 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t * @public */ highlightElement: function(v, _, E) { - var T = o.util.getLanguage(v), A = o.languages[T]; + var T = o.util.getLanguage(v), x = o.languages[T]; o.util.setLanguage(v, T); var S = v.parentElement; S && S.nodeName.toLowerCase() === "pre" && o.util.setLanguage(S, T); - var D = v.textContent, x = { + var D = v.textContent, A = { element: v, language: T, - grammar: A, + grammar: x, code: D }; - function w(R) { - x.highlightedCode = R, o.hooks.run("before-insert", x), x.element.innerHTML = x.highlightedCode, o.hooks.run("after-highlight", x), o.hooks.run("complete", x), E && E.call(x.element); + function w(M) { + A.highlightedCode = M, o.hooks.run("before-insert", A), A.element.innerHTML = A.highlightedCode, o.hooks.run("after-highlight", A), o.hooks.run("complete", A), E && E.call(A.element); } - if (o.hooks.run("before-sanity-check", x), S = x.element.parentElement, S && S.nodeName.toLowerCase() === "pre" && !S.hasAttribute("tabindex") && S.setAttribute("tabindex", "0"), !x.code) { - o.hooks.run("complete", x), E && E.call(x.element); + if (o.hooks.run("before-sanity-check", A), S = A.element.parentElement, S && S.nodeName.toLowerCase() === "pre" && !S.hasAttribute("tabindex") && S.setAttribute("tabindex", "0"), !A.code) { + o.hooks.run("complete", A), E && E.call(A.element); return; } - if (o.hooks.run("before-highlight", x), !x.grammar) { - w(o.util.encode(x.code)); + if (o.hooks.run("before-highlight", A), !A.grammar) { + w(o.util.encode(A.code)); return; } if (_ && i.Worker) { var I = new Worker(o.filename); - I.onmessage = function(R) { - w(R.data); + I.onmessage = function(M) { + w(M.data); }, I.postMessage(JSON.stringify({ - language: x.language, - code: x.code, + language: A.language, + code: A.code, immediateClose: !0 })); } else - w(o.highlight(x.code, x.grammar, x.language)); + w(o.highlight(A.code, A.grammar, A.language)); }, /** * Low-level function, only use if you know what you’re doing. It accepts a string of text as input @@ -2667,8 +2667,8 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t _[T] = E[T]; delete _.rest; } - var A = new h(); - return d(A, A.head, v), c(v, A, _, A.head, 0), m(A); + var x = new h(); + return d(x, x.head, v), c(v, x, _, x.head, 0), m(x); }, /** * @namespace @@ -2705,8 +2705,8 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t run: function(v, _) { var E = o.hooks.all[v]; if (!(!E || !E.length)) - for (var T = 0, A; A = E[T++]; ) - A(_); + for (var T = 0, x; x = E[T++]; ) + x(_); } }, Token: u @@ -2724,7 +2724,7 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t T += v(w, E); }), T; } - var A = { + var x = { type: _.type, content: v(_.content, E), tag: "span", @@ -2732,64 +2732,64 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t attributes: {}, language: E }, S = _.alias; - S && (Array.isArray(S) ? Array.prototype.push.apply(A.classes, S) : A.classes.push(S)), o.hooks.run("wrap", A); + S && (Array.isArray(S) ? Array.prototype.push.apply(x.classes, S) : x.classes.push(S)), o.hooks.run("wrap", x); var D = ""; - for (var x in A.attributes) - D += " " + x + '="' + (A.attributes[x] || "").replace(/"/g, """) + '"'; - return "<" + A.tag + ' class="' + A.classes.join(" ") + '"' + D + ">" + A.content + ""; + for (var A in x.attributes) + D += " " + A + '="' + (x.attributes[A] || "").replace(/"/g, """) + '"'; + return "<" + x.tag + ' class="' + x.classes.join(" ") + '"' + D + ">" + x.content + ""; }; function l(v, _, E, T) { v.lastIndex = _; - var A = v.exec(E); - if (A && T && A[1]) { - var S = A[1].length; - A.index += S, A[0] = A[0].slice(S); + var x = v.exec(E); + if (x && T && x[1]) { + var S = x[1].length; + x.index += S, x[0] = x[0].slice(S); } - return A; + return x; } - function c(v, _, E, T, A, S) { + function c(v, _, E, T, x, S) { for (var D in E) if (!(!E.hasOwnProperty(D) || !E[D])) { - var x = E[D]; - x = Array.isArray(x) ? x : [x]; - for (var w = 0; w < x.length; ++w) { + var A = E[D]; + A = Array.isArray(A) ? A : [A]; + for (var w = 0; w < A.length; ++w) { if (S && S.cause == D + "," + w) return; - var I = x[w], R = I.inside, M = !!I.lookbehind, P = !!I.greedy, K = I.alias; - if (P && !I.pattern.global) { - var q = I.pattern.toString().match(/[imsuy]*$/)[0]; - I.pattern = RegExp(I.pattern.source, q + "g"); + var I = A[w], M = I.inside, k = !!I.lookbehind, q = !!I.greedy, K = I.alias; + if (q && !I.pattern.global) { + var H = I.pattern.toString().match(/[imsuy]*$/)[0]; + I.pattern = RegExp(I.pattern.source, H + "g"); } - for (var W = I.pattern || I, U = T.next, j = A; U !== _.tail && !(S && j >= S.reach); j += U.value.length, U = U.next) { - var $ = U.value; + for (var Y = I.pattern || I, B = T.next, z = x; B !== _.tail && !(S && z >= S.reach); z += B.value.length, B = B.next) { + var W = B.value; if (_.length > v.length) return; - if (!($ instanceof u)) { - var L = 1, H; - if (P) { - if (H = l(W, j, v, M), !H || H.index >= v.length) + if (!(W instanceof u)) { + var L = 1, $; + if (q) { + if ($ = l(Y, z, v, k), !$ || $.index >= v.length) break; - var B = H.index, Q = H.index + H[0].length, X = j; - for (X += U.value.length; B >= X; ) - U = U.next, X += U.value.length; - if (X -= U.value.length, j = X, U.value instanceof u) + var N = $.index, Q = $.index + $[0].length, C = z; + for (C += B.value.length; N >= C; ) + B = B.next, C += B.value.length; + if (C -= B.value.length, z = C, B.value instanceof u) continue; - for (var C = U; C !== _.tail && (X < Q || typeof C.value == "string"); C = C.next) - L++, X += C.value.length; - L--, $ = v.slice(j, X), H.index -= j; - } else if (H = l(W, 0, $, M), !H) + for (var O = B; O !== _.tail && (C < Q || typeof O.value == "string"); O = O.next) + L++, C += O.value.length; + L--, W = v.slice(z, C), $.index -= z; + } else if ($ = l(Y, 0, W, k), !$) continue; - var B = H.index, N = H[0], G = $.slice(0, B), Y = $.slice(B + N.length), ee = j + $.length; - S && ee > S.reach && (S.reach = ee); - var se = U.prev; - G && (se = d(_, se, G), j += G.length), f(_, se, L); - var ye = new u(D, R ? o.tokenize(N, R) : N, K, N); - if (U = d(_, se, ye), Y && d(_, U, Y), L > 1) { - var Pe = { + var N = $.index, ee = $[0], G = W.slice(0, N), Z = W.slice(N + ee.length), U = z + W.length; + S && U > S.reach && (S.reach = U); + var re = B.prev; + G && (re = d(_, re, G), z += G.length), f(_, re, L); + var j = new u(D, M ? o.tokenize(ee, M) : ee, K, ee); + if (B = d(_, re, j), Z && d(_, B, Z), L > 1) { + var Ee = { cause: D + "," + w, - reach: ee + reach: U }; - c(v, _, E, U.prev, j, Pe), S && Pe.reach > S.reach && (S.reach = Pe.reach); + c(v, _, E, B.prev, z, Ee), S && Ee.reach > S.reach && (S.reach = Ee.reach); } } } @@ -2801,13 +2801,13 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t v.next = _, this.head = v, this.tail = _, this.length = 0; } function d(v, _, E) { - var T = _.next, A = { value: E, prev: _, next: T }; - return _.next = A, T.prev = A, v.length++, A; + var T = _.next, x = { value: E, prev: _, next: T }; + return _.next = x, T.prev = x, v.length++, x; } function f(v, _, E) { - for (var T = _.next, A = 0; A < E && T !== v.tail; A++) + for (var T = _.next, x = 0; x < E && T !== v.tail; x++) T = T.next; - _.next = T, T.prev = _, v.length -= A; + _.next = T, T.prev = _, v.length -= x; } function m(v) { for (var _ = [], E = v.head.next; E !== v.tail; ) @@ -2816,8 +2816,8 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t } if (!i.document) return i.addEventListener && (o.disableWorkerMessageHandler || i.addEventListener("message", function(v) { - var _ = JSON.parse(v.data), E = _.language, T = _.code, A = _.immediateClose; - i.postMessage(o.highlight(T, o.languages[E], E)), A && i.close(); + var _ = JSON.parse(v.data), E = _.language, T = _.code, x = _.immediateClose; + i.postMessage(o.highlight(T, o.languages[E], E)), x && i.close(); }, !1)), o; var g = o.util.currentScript(); g && (o.filename = g.src, g.hasAttribute("data-manual") && (o.manual = !0)); @@ -2830,7 +2830,7 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t } return o; }(e); - n.exports && (n.exports = t), typeof mm < "u" && (mm.Prism = t), t.languages.markup = { + n.exports && (n.exports = t), typeof km < "u" && (km.Prism = t), t.languages.markup = { comment: { pattern: //, greedy: !0 @@ -3254,18 +3254,18 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t var T = t.plugins.autoloader; T && T.loadLanguages(_), d( v, - function(A) { + function(x) { p.setAttribute(o, l); var S = f(p.getAttribute("data-range")); if (S) { - var D = A.split(/\r\n?|\n/g), x = S[0], w = S[1] == null ? D.length : S[1]; - x < 0 && (x += D.length), x = Math.max(0, Math.min(x - 1, D.length)), w < 0 && (w += D.length), w = Math.max(0, Math.min(w, D.length)), A = D.slice(x, w).join(` -`), p.hasAttribute("data-start") || p.setAttribute("data-start", String(x + 1)); + var D = x.split(/\r\n?|\n/g), A = S[0], w = S[1] == null ? D.length : S[1]; + A < 0 && (A += D.length), A = Math.max(0, Math.min(A - 1, D.length)), w < 0 && (w += D.length), w = Math.max(0, Math.min(w, D.length)), x = D.slice(A, w).join(` +`), p.hasAttribute("data-start") || p.setAttribute("data-start", String(A + 1)); } - y.textContent = A, t.highlightElement(y); + y.textContent = x, t.highlightElement(y); }, - function(A) { - p.setAttribute(o, c), y.textContent = A; + function(x) { + p.setAttribute(o, c), y.textContent = x; } ); } @@ -3287,7 +3287,7 @@ var mm = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t m || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), m = !0), t.plugins.fileHighlight.highlight.apply(this, arguments); }; }(); -})(bb); +})($b); Prism.languages.python = { comment: { pattern: /(^|[^\\])#.*/, @@ -3629,8 +3629,8 @@ Prism.languages.py = Prism.languages.python; r[s[a]] = n.languages.bash[s[a]]; n.languages.sh = n.languages.bash, n.languages.shell = n.languages.bash; })(Prism); -new rv(); -const Tb = (n) => { +new bv(); +const Bb = (n) => { const e = {}; for (let t = 0, i = n.length; t < i; t++) { const s = n[t]; @@ -3638,7 +3638,7 @@ const Tb = (n) => { e[r] ? e[r] = e[r].concat(s[r]) : e[r] = s[r]; } return e; -}, Sb = [ +}, Nb = [ "abbr", "accept", "accept-charset", @@ -3847,7 +3847,7 @@ const Tb = (n) => { "webkitdirectory", "width", "wrap" -], Ab = [ +], Ub = [ "accent-height", "accumulate", "additive", @@ -4031,7 +4031,7 @@ const Tb = (n) => { "y2", "z", "zoomandpan" -], xb = [ +], Gb = [ "accent", "accentunder", "align", @@ -4086,128 +4086,128 @@ const Tb = (n) => { "width", "xmlns" ]; -Tb([ - Object.fromEntries(Sb.map((n) => [n, ["*"]])), - Object.fromEntries(Ab.map((n) => [n, ["svg:*"]])), - Object.fromEntries(xb.map((n) => [n, ["math:*"]])) +Bb([ + Object.fromEntries(Nb.map((n) => [n, ["*"]])), + Object.fromEntries(Ub.map((n) => [n, ["svg:*"]])), + Object.fromEntries(Gb.map((n) => [n, ["math:*"]])) ]); const { - HtmlTagHydration: VB, - SvelteComponent: qB, - attr: KB, - binding_callbacks: jB, - children: zB, - claim_element: WB, - claim_html_tag: YB, - detach: XB, - element: QB, - init: ZB, - insert_hydration: JB, - noop: eN, - safe_not_equal: tN, - toggle_class: iN -} = window.__gradio__svelte__internal, { afterUpdate: nN, tick: sN, onMount: rN } = window.__gradio__svelte__internal, { - SvelteComponent: aN, - attr: oN, - children: lN, - claim_component: uN, - claim_element: cN, - create_component: hN, - destroy_component: dN, - detach: fN, - element: mN, - init: gN, - insert_hydration: pN, - mount_component: _N, - safe_not_equal: vN, - transition_in: yN, - transition_out: EN + HtmlTagHydration: pN, + SvelteComponent: _N, + attr: vN, + binding_callbacks: yN, + children: EN, + claim_element: bN, + claim_html_tag: TN, + detach: SN, + element: AN, + init: xN, + insert_hydration: DN, + noop: wN, + safe_not_equal: LN, + toggle_class: IN +} = window.__gradio__svelte__internal, { afterUpdate: kN, tick: RN, onMount: CN } = window.__gradio__svelte__internal, { + SvelteComponent: FN, + attr: PN, + children: ON, + claim_component: MN, + claim_element: $N, + create_component: BN, + destroy_component: NN, + detach: UN, + element: GN, + init: HN, + insert_hydration: VN, + mount_component: qN, + safe_not_equal: KN, + transition_in: jN, + transition_out: zN } = window.__gradio__svelte__internal, { - SvelteComponent: bN, - attr: TN, - check_outros: SN, - children: AN, - claim_component: xN, - claim_element: DN, - claim_space: wN, - create_component: LN, - create_slot: IN, - destroy_component: kN, - detach: RN, - element: CN, - empty: FN, - get_all_dirty_from_scope: PN, - get_slot_changes: ON, - group_outros: MN, - init: $N, - insert_hydration: BN, - mount_component: NN, - safe_not_equal: UN, - space: GN, - toggle_class: HN, - transition_in: VN, - transition_out: qN, - update_slot_base: KN + SvelteComponent: WN, + attr: YN, + check_outros: XN, + children: QN, + claim_component: ZN, + claim_element: JN, + claim_space: e3, + create_component: t3, + create_slot: i3, + destroy_component: n3, + detach: s3, + element: r3, + empty: a3, + get_all_dirty_from_scope: o3, + get_slot_changes: l3, + group_outros: u3, + init: c3, + insert_hydration: h3, + mount_component: d3, + safe_not_equal: f3, + space: m3, + toggle_class: g3, + transition_in: p3, + transition_out: _3, + update_slot_base: v3 } = window.__gradio__svelte__internal, { - SvelteComponent: Db, - append_hydration: Pu, - attr: Bs, - children: gm, - claim_component: wb, - claim_element: pm, - claim_space: Lb, - claim_text: Ib, - create_component: kb, - destroy_component: Rb, - detach: Ou, - element: _m, - init: Cb, - insert_hydration: Fb, - mount_component: Pb, - safe_not_equal: Ob, - set_data: Mb, - space: $b, - text: Bb, - toggle_class: In, - transition_in: Nb, - transition_out: Ub + SvelteComponent: Hb, + append_hydration: tc, + attr: Ys, + children: Rm, + claim_component: Vb, + claim_element: Cm, + claim_space: qb, + claim_text: Kb, + create_component: jb, + destroy_component: zb, + detach: ic, + element: Fm, + init: Wb, + insert_hydration: Yb, + mount_component: Xb, + safe_not_equal: Qb, + set_data: Zb, + space: Jb, + text: eT, + toggle_class: Fn, + transition_in: tT, + transition_out: iT } = window.__gradio__svelte__internal; -function Gb(n) { +function nT(n) { let e, t, i, s, r, a, o; return i = new /*Icon*/ n[1]({}), { c() { - e = _m("label"), t = _m("span"), kb(i.$$.fragment), s = $b(), r = Bb( + e = Fm("label"), t = Fm("span"), jb(i.$$.fragment), s = Jb(), r = eT( /*label*/ n[0] ), this.h(); }, l(u) { - e = pm(u, "LABEL", { + e = Cm(u, "LABEL", { for: !0, "data-testid": !0, dir: !0, class: !0 }); - var l = gm(e); - t = pm(l, "SPAN", { class: !0 }); - var c = gm(t); - wb(i.$$.fragment, c), c.forEach(Ou), s = Lb(l), r = Ib( + var l = Rm(e); + t = Cm(l, "SPAN", { class: !0 }); + var c = Rm(t); + Vb(i.$$.fragment, c), c.forEach(ic), s = qb(l), r = Kb( l, /*label*/ n[0] - ), l.forEach(Ou), this.h(); + ), l.forEach(ic), this.h(); }, h() { - Bs(t, "class", "svelte-13ao5pu"), Bs(e, "for", ""), Bs(e, "data-testid", "block-label"), Bs(e, "dir", a = /*rtl*/ - n[5] ? "rtl" : "ltr"), Bs(e, "class", "svelte-13ao5pu"), In(e, "hide", !/*show_label*/ - n[2]), In(e, "sr-only", !/*show_label*/ - n[2]), In( + Ys(t, "class", "svelte-13ao5pu"), Ys(e, "for", ""), Ys(e, "data-testid", "block-label"), Ys(e, "dir", a = /*rtl*/ + n[5] ? "rtl" : "ltr"), Ys(e, "class", "svelte-13ao5pu"), Fn(e, "hide", !/*show_label*/ + n[2]), Fn(e, "sr-only", !/*show_label*/ + n[2]), Fn( e, "float", /*float*/ n[4] - ), In( + ), Fn( e, "hide-label", /*disable*/ @@ -4215,28 +4215,28 @@ function Gb(n) { ); }, m(u, l) { - Fb(u, e, l), Pu(e, t), Pb(i, t, null), Pu(e, s), Pu(e, r), o = !0; + Yb(u, e, l), tc(e, t), Xb(i, t, null), tc(e, s), tc(e, r), o = !0; }, p(u, [l]) { (!o || l & /*label*/ - 1) && Mb( + 1) && Zb( r, /*label*/ u[0] ), (!o || l & /*rtl*/ 32 && a !== (a = /*rtl*/ - u[5] ? "rtl" : "ltr")) && Bs(e, "dir", a), (!o || l & /*show_label*/ - 4) && In(e, "hide", !/*show_label*/ + u[5] ? "rtl" : "ltr")) && Ys(e, "dir", a), (!o || l & /*show_label*/ + 4) && Fn(e, "hide", !/*show_label*/ u[2]), (!o || l & /*show_label*/ - 4) && In(e, "sr-only", !/*show_label*/ + 4) && Fn(e, "sr-only", !/*show_label*/ u[2]), (!o || l & /*float*/ - 16) && In( + 16) && Fn( e, "float", /*float*/ u[4] ), (!o || l & /*disable*/ - 8) && In( + 8) && Fn( e, "hide-label", /*disable*/ @@ -4244,25 +4244,25 @@ function Gb(n) { ); }, i(u) { - o || (Nb(i.$$.fragment, u), o = !0); + o || (tT(i.$$.fragment, u), o = !0); }, o(u) { - Ub(i.$$.fragment, u), o = !1; + iT(i.$$.fragment, u), o = !1; }, d(u) { - u && Ou(e), Rb(i); + u && ic(e), zb(i); } }; } -function Hb(n, e, t) { +function sT(n, e, t) { let { label: i = null } = e, { Icon: s } = e, { show_label: r = !0 } = e, { disable: a = !1 } = e, { float: o = !0 } = e, { rtl: u = !1 } = e; return n.$$set = (l) => { "label" in l && t(0, i = l.label), "Icon" in l && t(1, s = l.Icon), "show_label" in l && t(2, r = l.show_label), "disable" in l && t(3, a = l.disable), "float" in l && t(4, o = l.float), "rtl" in l && t(5, u = l.rtl); }, [i, s, r, a, o, u]; } -class Zd extends Db { +class Ef extends Hb { constructor(e) { - super(), Cb(this, e, Hb, Gb, Ob, { + super(), Wb(this, e, sT, nT, Qb, { label: 0, Icon: 1, show_label: 2, @@ -4273,80 +4273,80 @@ class Zd extends Db { } } const { - SvelteComponent: Vb, - append_hydration: dl, - attr: _n, - bubble: qb, - check_outros: Kb, - children: Kh, - claim_component: jb, - claim_element: jh, - claim_space: vm, - claim_text: zb, - construct_svelte_component: ym, - create_component: Em, - create_slot: Wb, - destroy_component: bm, - detach: Aa, - element: zh, - get_all_dirty_from_scope: Yb, - get_slot_changes: Xb, - group_outros: Qb, - init: Zb, - insert_hydration: av, - listen: Jb, - mount_component: Tm, - safe_not_equal: eT, - set_data: tT, - set_style: _o, - space: Sm, - text: iT, - toggle_class: gt, - transition_in: Mu, - transition_out: $u, - update_slot_base: nT + SvelteComponent: rT, + append_hydration: Rl, + attr: En, + bubble: aT, + check_outros: oT, + children: dd, + claim_component: lT, + claim_element: fd, + claim_space: Pm, + claim_text: uT, + construct_svelte_component: Om, + create_component: Mm, + create_slot: cT, + destroy_component: $m, + detach: Oa, + element: md, + get_all_dirty_from_scope: hT, + get_slot_changes: dT, + group_outros: fT, + init: mT, + insert_hydration: Tv, + listen: gT, + mount_component: Bm, + safe_not_equal: pT, + set_data: _T, + set_style: Oo, + space: Nm, + text: vT, + toggle_class: Et, + transition_in: nc, + transition_out: sc, + update_slot_base: yT } = window.__gradio__svelte__internal; -function Am(n) { +function Um(n) { let e, t; return { c() { - e = zh("span"), t = iT( + e = md("span"), t = vT( /*label*/ n[1] ), this.h(); }, l(i) { - e = jh(i, "SPAN", { class: !0 }); - var s = Kh(e); - t = zb( + e = fd(i, "SPAN", { class: !0 }); + var s = dd(e); + t = uT( s, /*label*/ n[1] - ), s.forEach(Aa), this.h(); + ), s.forEach(Oa), this.h(); }, h() { - _n(e, "class", "svelte-qgco6m"); + En(e, "class", "svelte-qgco6m"); }, m(i, s) { - av(i, e, s), dl(e, t); + Tv(i, e, s), Rl(e, t); }, p(i, s) { s & /*label*/ - 2 && tT( + 2 && _T( t, /*label*/ i[1] ); }, d(i) { - i && Aa(e); + i && Oa(e); } }; } -function sT(n) { +function ET(n) { let e, t, i, s, r, a, o, u, l = ( /*show_label*/ - n[2] && Am(n) + n[2] && Um(n) ); var c = ( /*Icon*/ @@ -4355,11 +4355,11 @@ function sT(n) { function h(m, g) { return {}; } - c && (s = ym(c, h())); + c && (s = Om(c, h())); const d = ( /*#slots*/ n[14].default - ), f = Wb( + ), f = cT( d, n, /*$$scope*/ @@ -4368,90 +4368,90 @@ function sT(n) { ); return { c() { - e = zh("button"), l && l.c(), t = Sm(), i = zh("div"), s && Em(s.$$.fragment), r = Sm(), f && f.c(), this.h(); + e = md("button"), l && l.c(), t = Nm(), i = md("div"), s && Mm(s.$$.fragment), r = Nm(), f && f.c(), this.h(); }, l(m) { - e = jh(m, "BUTTON", { + e = fd(m, "BUTTON", { "aria-label": !0, "aria-haspopup": !0, title: !0, class: !0 }); - var g = Kh(e); - l && l.l(g), t = vm(g), i = jh(g, "DIV", { class: !0 }); - var p = Kh(i); - s && jb(s.$$.fragment, p), r = vm(p), f && f.l(p), p.forEach(Aa), g.forEach(Aa), this.h(); + var g = dd(e); + l && l.l(g), t = Pm(g), i = fd(g, "DIV", { class: !0 }); + var p = dd(i); + s && lT(s.$$.fragment, p), r = Pm(p), f && f.l(p), p.forEach(Oa), g.forEach(Oa), this.h(); }, h() { - _n(i, "class", "svelte-qgco6m"), gt( + En(i, "class", "svelte-qgco6m"), Et( i, "x-small", /*size*/ n[4] === "x-small" - ), gt( + ), Et( i, "small", /*size*/ n[4] === "small" - ), gt( + ), Et( i, "large", /*size*/ n[4] === "large" - ), gt( + ), Et( i, "medium", /*size*/ n[4] === "medium" ), e.disabled = /*disabled*/ - n[7], _n( + n[7], En( e, "aria-label", /*label*/ n[1] - ), _n( + ), En( e, "aria-haspopup", /*hasPopup*/ n[8] - ), _n( + ), En( e, "title", /*label*/ n[1] - ), _n(e, "class", "svelte-qgco6m"), gt( + ), En(e, "class", "svelte-qgco6m"), Et( e, "pending", /*pending*/ n[3] - ), gt( + ), Et( e, "padded", /*padded*/ n[5] - ), gt( + ), Et( e, "highlight", /*highlight*/ n[6] - ), gt( + ), Et( e, "transparent", /*transparent*/ n[9] - ), _o(e, "color", !/*disabled*/ + ), Oo(e, "color", !/*disabled*/ n[7] && /*_color*/ n[11] ? ( /*_color*/ n[11] - ) : "var(--block-label-text-color)"), _o(e, "--bg-color", /*disabled*/ + ) : "var(--block-label-text-color)"), Oo(e, "--bg-color", /*disabled*/ n[7] ? "auto" : ( /*background*/ n[10] )); }, m(m, g) { - av(m, e, g), l && l.m(e, null), dl(e, t), dl(e, i), s && Tm(s, i, null), dl(i, r), f && f.m(i, null), a = !0, o || (u = Jb( + Tv(m, e, g), l && l.m(e, null), Rl(e, t), Rl(e, i), s && Bm(s, i, null), Rl(i, r), f && f.m(i, null), a = !0, o || (u = gT( e, "click", /*click_handler*/ @@ -4460,56 +4460,56 @@ function sT(n) { }, p(m, [g]) { if (/*show_label*/ - m[2] ? l ? l.p(m, g) : (l = Am(m), l.c(), l.m(e, t)) : l && (l.d(1), l = null), g & /*Icon*/ + m[2] ? l ? l.p(m, g) : (l = Um(m), l.c(), l.m(e, t)) : l && (l.d(1), l = null), g & /*Icon*/ 1 && c !== (c = /*Icon*/ m[0])) { if (s) { - Qb(); + fT(); const p = s; - $u(p.$$.fragment, 1, 0, () => { - bm(p, 1); - }), Kb(); + sc(p.$$.fragment, 1, 0, () => { + $m(p, 1); + }), oT(); } - c ? (s = ym(c, h()), Em(s.$$.fragment), Mu(s.$$.fragment, 1), Tm(s, i, r)) : s = null; + c ? (s = Om(c, h()), Mm(s.$$.fragment), nc(s.$$.fragment, 1), Bm(s, i, r)) : s = null; } f && f.p && (!a || g & /*$$scope*/ - 8192) && nT( + 8192) && yT( f, d, m, /*$$scope*/ m[13], - a ? Xb( + a ? dT( d, /*$$scope*/ m[13], g, null - ) : Yb( + ) : hT( /*$$scope*/ m[13] ), null ), (!a || g & /*size*/ - 16) && gt( + 16) && Et( i, "x-small", /*size*/ m[4] === "x-small" ), (!a || g & /*size*/ - 16) && gt( + 16) && Et( i, "small", /*size*/ m[4] === "small" ), (!a || g & /*size*/ - 16) && gt( + 16) && Et( i, "large", /*size*/ m[4] === "large" ), (!a || g & /*size*/ - 16) && gt( + 16) && Et( i, "medium", /*size*/ @@ -4517,75 +4517,75 @@ function sT(n) { ), (!a || g & /*disabled*/ 128) && (e.disabled = /*disabled*/ m[7]), (!a || g & /*label*/ - 2) && _n( + 2) && En( e, "aria-label", /*label*/ m[1] ), (!a || g & /*hasPopup*/ - 256) && _n( + 256) && En( e, "aria-haspopup", /*hasPopup*/ m[8] ), (!a || g & /*label*/ - 2) && _n( + 2) && En( e, "title", /*label*/ m[1] ), (!a || g & /*pending*/ - 8) && gt( + 8) && Et( e, "pending", /*pending*/ m[3] ), (!a || g & /*padded*/ - 32) && gt( + 32) && Et( e, "padded", /*padded*/ m[5] ), (!a || g & /*highlight*/ - 64) && gt( + 64) && Et( e, "highlight", /*highlight*/ m[6] ), (!a || g & /*transparent*/ - 512) && gt( + 512) && Et( e, "transparent", /*transparent*/ m[9] ), g & /*disabled, _color*/ - 2176 && _o(e, "color", !/*disabled*/ + 2176 && Oo(e, "color", !/*disabled*/ m[7] && /*_color*/ m[11] ? ( /*_color*/ m[11] ) : "var(--block-label-text-color)"), g & /*disabled, background*/ - 1152 && _o(e, "--bg-color", /*disabled*/ + 1152 && Oo(e, "--bg-color", /*disabled*/ m[7] ? "auto" : ( /*background*/ m[10] )); }, i(m) { - a || (s && Mu(s.$$.fragment, m), Mu(f, m), a = !0); + a || (s && nc(s.$$.fragment, m), nc(f, m), a = !0); }, o(m) { - s && $u(s.$$.fragment, m), $u(f, m), a = !1; + s && sc(s.$$.fragment, m), sc(f, m), a = !1; }, d(m) { - m && Aa(e), l && l.d(), s && bm(s), f && f.d(m), o = !1, u(); + m && Oa(e), l && l.d(), s && $m(s), f && f.d(m), o = !1, u(); } }; } -function rT(n, e, t) { +function bT(n, e, t) { let i, { $$slots: s = {}, $$scope: r } = e, { Icon: a } = e, { label: o = "" } = e, { show_label: u = !1 } = e, { pending: l = !1 } = e, { size: c = "small" } = e, { padded: h = !0 } = e, { highlight: d = !1 } = e, { disabled: f = !1 } = e, { hasPopup: m = !1 } = e, { color: g = "var(--block-label-text-color)" } = e, { transparent: p = !1 } = e, { background: y = "var(--block-background-fill)" } = e; function v(_) { - qb.call(this, n, _); + aT.call(this, n, _); } return n.$$set = (_) => { "Icon" in _ && t(0, a = _.Icon), "label" in _ && t(1, o = _.label), "show_label" in _ && t(2, u = _.show_label), "pending" in _ && t(3, l = _.pending), "size" in _ && t(4, c = _.size), "padded" in _ && t(5, h = _.padded), "highlight" in _ && t(6, d = _.highlight), "disabled" in _ && t(7, f = _.disabled), "hasPopup" in _ && t(8, m = _.hasPopup), "color" in _ && t(12, g = _.color), "transparent" in _ && t(9, p = _.transparent), "background" in _ && t(10, y = _.background), "$$scope" in _ && t(13, r = _.$$scope); @@ -4611,9 +4611,9 @@ function rT(n, e, t) { v ]; } -class Ci extends Vb { +class vi extends rT { constructor(e) { - super(), Zb(this, e, rT, sT, eT, { + super(), mT(this, e, bT, ET, pT, { Icon: 0, label: 1, show_label: 2, @@ -4630,31 +4630,31 @@ class Ci extends Vb { } } const { - SvelteComponent: aT, - append_hydration: oT, - attr: Bu, - binding_callbacks: lT, - children: xm, - claim_element: Dm, - create_slot: uT, - detach: Nu, - element: wm, - get_all_dirty_from_scope: cT, - get_slot_changes: hT, - init: dT, - insert_hydration: fT, - safe_not_equal: mT, - toggle_class: kn, - transition_in: gT, - transition_out: pT, - update_slot_base: _T + SvelteComponent: TT, + append_hydration: ST, + attr: rc, + binding_callbacks: AT, + children: Gm, + claim_element: Hm, + create_slot: xT, + detach: ac, + element: Vm, + get_all_dirty_from_scope: DT, + get_slot_changes: wT, + init: LT, + insert_hydration: IT, + safe_not_equal: kT, + toggle_class: Pn, + transition_in: RT, + transition_out: CT, + update_slot_base: FT } = window.__gradio__svelte__internal; -function vT(n) { +function PT(n) { let e, t, i; const s = ( /*#slots*/ n[5].default - ), r = uT( + ), r = xT( s, n, /*$$scope*/ @@ -4663,32 +4663,32 @@ function vT(n) { ); return { c() { - e = wm("div"), t = wm("div"), r && r.c(), this.h(); + e = Vm("div"), t = Vm("div"), r && r.c(), this.h(); }, l(a) { - e = Dm(a, "DIV", { class: !0, "aria-label": !0 }); - var o = xm(e); - t = Dm(o, "DIV", { class: !0 }); - var u = xm(t); - r && r.l(u), u.forEach(Nu), o.forEach(Nu), this.h(); + e = Hm(a, "DIV", { class: !0, "aria-label": !0 }); + var o = Gm(e); + t = Hm(o, "DIV", { class: !0 }); + var u = Gm(t); + r && r.l(u), u.forEach(ac), o.forEach(ac), this.h(); }, h() { - Bu(t, "class", "icon svelte-3w3rth"), Bu(e, "class", "empty svelte-3w3rth"), Bu(e, "aria-label", "Empty value"), kn( + rc(t, "class", "icon svelte-3w3rth"), rc(e, "class", "empty svelte-3w3rth"), rc(e, "aria-label", "Empty value"), Pn( e, "small", /*size*/ n[0] === "small" - ), kn( + ), Pn( e, "large", /*size*/ n[0] === "large" - ), kn( + ), Pn( e, "unpadded_box", /*unpadded_box*/ n[1] - ), kn( + ), Pn( e, "small_parent", /*parent_height*/ @@ -4696,47 +4696,47 @@ function vT(n) { ); }, m(a, o) { - fT(a, e, o), oT(e, t), r && r.m(t, null), n[6](e), i = !0; + IT(a, e, o), ST(e, t), r && r.m(t, null), n[6](e), i = !0; }, p(a, [o]) { r && r.p && (!i || o & /*$$scope*/ - 16) && _T( + 16) && FT( r, s, a, /*$$scope*/ a[4], - i ? hT( + i ? wT( s, /*$$scope*/ a[4], o, null - ) : cT( + ) : DT( /*$$scope*/ a[4] ), null ), (!i || o & /*size*/ - 1) && kn( + 1) && Pn( e, "small", /*size*/ a[0] === "small" ), (!i || o & /*size*/ - 1) && kn( + 1) && Pn( e, "large", /*size*/ a[0] === "large" ), (!i || o & /*unpadded_box*/ - 2) && kn( + 2) && Pn( e, "unpadded_box", /*unpadded_box*/ a[1] ), (!i || o & /*parent_height*/ - 8) && kn( + 8) && Pn( e, "small_parent", /*parent_height*/ @@ -4744,17 +4744,17 @@ function vT(n) { ); }, i(a) { - i || (gT(r, a), i = !0); + i || (RT(r, a), i = !0); }, o(a) { - pT(r, a), i = !1; + CT(r, a), i = !1; }, d(a) { - a && Nu(e), r && r.d(a), n[6](null); + a && ac(e), r && r.d(a), n[6](null); } }; } -function yT(n, e, t) { +function OT(n, e, t) { let i, { $$slots: s = {}, $$scope: r } = e, { size: a = "small" } = e, { unpadded_box: o = !1 } = e, u; function l(h) { var d; @@ -4763,7 +4763,7 @@ function yT(n, e, t) { return f > m + 2; } function c(h) { - lT[h ? "unshift" : "push"](() => { + AT[h ? "unshift" : "push"](() => { u = h, t(2, u); }); } @@ -4774,116 +4774,116 @@ function yT(n, e, t) { 4 && t(3, i = l(u)); }, [a, o, u, i, r, s, c]; } -class ET extends aT { +class MT extends TT { constructor(e) { - super(), dT(this, e, yT, vT, mT, { size: 0, unpadded_box: 1 }); + super(), LT(this, e, OT, PT, kT, { size: 0, unpadded_box: 1 }); } } const { - SvelteComponent: jN, - append_hydration: zN, - attr: WN, - children: YN, - claim_svg_element: XN, - detach: QN, - init: ZN, - insert_hydration: JN, - noop: e3, - safe_not_equal: t3, - svg_element: i3 + SvelteComponent: y3, + append_hydration: E3, + attr: b3, + children: T3, + claim_svg_element: S3, + detach: A3, + init: x3, + insert_hydration: D3, + noop: w3, + safe_not_equal: L3, + svg_element: I3 } = window.__gradio__svelte__internal, { - SvelteComponent: n3, - append_hydration: s3, - attr: r3, - children: a3, - claim_svg_element: o3, - detach: l3, - init: u3, - insert_hydration: c3, - noop: h3, - safe_not_equal: d3, - svg_element: f3 + SvelteComponent: k3, + append_hydration: R3, + attr: C3, + children: F3, + claim_svg_element: P3, + detach: O3, + init: M3, + insert_hydration: $3, + noop: B3, + safe_not_equal: N3, + svg_element: U3 } = window.__gradio__svelte__internal, { - SvelteComponent: m3, - append_hydration: g3, - attr: p3, - children: _3, - claim_svg_element: v3, - detach: y3, - init: E3, - insert_hydration: b3, - noop: T3, - safe_not_equal: S3, - svg_element: A3 + SvelteComponent: G3, + append_hydration: H3, + attr: V3, + children: q3, + claim_svg_element: K3, + detach: j3, + init: z3, + insert_hydration: W3, + noop: Y3, + safe_not_equal: X3, + svg_element: Q3 } = window.__gradio__svelte__internal, { - SvelteComponent: x3, - append_hydration: D3, - attr: w3, - children: L3, - claim_svg_element: I3, - detach: k3, - init: R3, - insert_hydration: C3, - noop: F3, - safe_not_equal: P3, - svg_element: O3 + SvelteComponent: Z3, + append_hydration: J3, + attr: eU, + children: tU, + claim_svg_element: iU, + detach: nU, + init: sU, + insert_hydration: rU, + noop: aU, + safe_not_equal: oU, + svg_element: lU } = window.__gradio__svelte__internal, { - SvelteComponent: M3, - append_hydration: $3, - attr: B3, - children: N3, - claim_svg_element: U3, - detach: G3, - init: H3, - insert_hydration: V3, - noop: q3, - safe_not_equal: K3, - svg_element: j3 + SvelteComponent: uU, + append_hydration: cU, + attr: hU, + children: dU, + claim_svg_element: fU, + detach: mU, + init: gU, + insert_hydration: pU, + noop: _U, + safe_not_equal: vU, + svg_element: yU } = window.__gradio__svelte__internal, { - SvelteComponent: z3, - append_hydration: W3, - attr: Y3, - children: X3, - claim_svg_element: Q3, - detach: Z3, - init: J3, - insert_hydration: eU, - noop: tU, - safe_not_equal: iU, - svg_element: nU + SvelteComponent: EU, + append_hydration: bU, + attr: TU, + children: SU, + claim_svg_element: AU, + detach: xU, + init: DU, + insert_hydration: wU, + noop: LU, + safe_not_equal: IU, + svg_element: kU } = window.__gradio__svelte__internal, { - SvelteComponent: sU, - append_hydration: rU, - attr: aU, - children: oU, - claim_svg_element: lU, - detach: uU, - init: cU, - insert_hydration: hU, - noop: dU, - safe_not_equal: fU, - svg_element: mU + SvelteComponent: RU, + append_hydration: CU, + attr: FU, + children: PU, + claim_svg_element: OU, + detach: MU, + init: $U, + insert_hydration: BU, + noop: NU, + safe_not_equal: UU, + svg_element: GU } = window.__gradio__svelte__internal, { - SvelteComponent: bT, - append_hydration: Lm, - attr: kt, - children: Uu, - claim_svg_element: Gu, - detach: vo, - init: TT, - insert_hydration: ST, - noop: Hu, - safe_not_equal: AT, - svg_element: Vu + SvelteComponent: $T, + append_hydration: qm, + attr: Ot, + children: oc, + claim_svg_element: lc, + detach: Mo, + init: BT, + insert_hydration: NT, + noop: uc, + safe_not_equal: UT, + svg_element: cc } = window.__gradio__svelte__internal; -function xT(n) { +function GT(n) { let e, t, i; return { c() { - e = Vu("svg"), t = Vu("path"), i = Vu("circle"), this.h(); + e = cc("svg"), t = cc("path"), i = cc("circle"), this.h(); }, l(s) { - e = Gu(s, "svg", { + e = lc(s, "svg", { xmlns: !0, width: !0, height: !0, @@ -4895,85 +4895,85 @@ function xT(n) { "stroke-linejoin": !0, class: !0 }); - var r = Uu(e); - t = Gu(r, "path", { d: !0 }), Uu(t).forEach(vo), i = Gu(r, "circle", { cx: !0, cy: !0, r: !0 }), Uu(i).forEach(vo), r.forEach(vo), this.h(); + var r = oc(e); + t = lc(r, "path", { d: !0 }), oc(t).forEach(Mo), i = lc(r, "circle", { cx: !0, cy: !0, r: !0 }), oc(i).forEach(Mo), r.forEach(Mo), this.h(); }, h() { - kt(t, "d", "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"), kt(i, "cx", "12"), kt(i, "cy", "13"), kt(i, "r", "4"), kt(e, "xmlns", "http://www.w3.org/2000/svg"), kt(e, "width", "100%"), kt(e, "height", "100%"), kt(e, "viewBox", "0 0 24 24"), kt(e, "fill", "none"), kt(e, "stroke", "currentColor"), kt(e, "stroke-width", "1.5"), kt(e, "stroke-linecap", "round"), kt(e, "stroke-linejoin", "round"), kt(e, "class", "feather feather-camera"); + Ot(t, "d", "M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"), Ot(i, "cx", "12"), Ot(i, "cy", "13"), Ot(i, "r", "4"), Ot(e, "xmlns", "http://www.w3.org/2000/svg"), Ot(e, "width", "100%"), Ot(e, "height", "100%"), Ot(e, "viewBox", "0 0 24 24"), Ot(e, "fill", "none"), Ot(e, "stroke", "currentColor"), Ot(e, "stroke-width", "1.5"), Ot(e, "stroke-linecap", "round"), Ot(e, "stroke-linejoin", "round"), Ot(e, "class", "feather feather-camera"); }, m(s, r) { - ST(s, e, r), Lm(e, t), Lm(e, i); + NT(s, e, r), qm(e, t), qm(e, i); }, - p: Hu, - i: Hu, - o: Hu, + p: uc, + i: uc, + o: uc, d(s) { - s && vo(e); + s && Mo(e); } }; } -class DT extends bT { +class HT extends $T { constructor(e) { - super(), TT(this, e, null, xT, AT, {}); + super(), BT(this, e, null, GT, UT, {}); } } const { - SvelteComponent: gU, - append_hydration: pU, - attr: _U, - children: vU, - claim_svg_element: yU, - detach: EU, - init: bU, - insert_hydration: TU, - noop: SU, - safe_not_equal: AU, - svg_element: xU + SvelteComponent: HU, + append_hydration: VU, + attr: qU, + children: KU, + claim_svg_element: jU, + detach: zU, + init: WU, + insert_hydration: YU, + noop: XU, + safe_not_equal: QU, + svg_element: ZU } = window.__gradio__svelte__internal, { - SvelteComponent: DU, - append_hydration: wU, - attr: LU, - children: IU, - claim_svg_element: kU, - detach: RU, - init: CU, - insert_hydration: FU, - noop: PU, - safe_not_equal: OU, - svg_element: MU + SvelteComponent: JU, + append_hydration: e4, + attr: t4, + children: i4, + claim_svg_element: n4, + detach: s4, + init: r4, + insert_hydration: a4, + noop: o4, + safe_not_equal: l4, + svg_element: u4 } = window.__gradio__svelte__internal, { - SvelteComponent: $U, - append_hydration: BU, - attr: NU, - children: UU, - claim_svg_element: GU, - detach: HU, - init: VU, - insert_hydration: qU, - noop: KU, - safe_not_equal: jU, - svg_element: zU + SvelteComponent: c4, + append_hydration: h4, + attr: d4, + children: f4, + claim_svg_element: m4, + detach: g4, + init: p4, + insert_hydration: _4, + noop: v4, + safe_not_equal: y4, + svg_element: E4 } = window.__gradio__svelte__internal, { - SvelteComponent: wT, - append_hydration: LT, - attr: ui, - children: Im, - claim_svg_element: km, - detach: qu, - init: IT, - insert_hydration: kT, - noop: Ku, - safe_not_equal: RT, - svg_element: Rm + SvelteComponent: VT, + append_hydration: qT, + attr: yi, + children: Km, + claim_svg_element: jm, + detach: hc, + init: KT, + insert_hydration: jT, + noop: dc, + safe_not_equal: zT, + svg_element: zm } = window.__gradio__svelte__internal; -function CT(n) { +function WT(n) { let e, t; return { c() { - e = Rm("svg"), t = Rm("circle"), this.h(); + e = zm("svg"), t = zm("circle"), this.h(); }, l(i) { - e = km(i, "svg", { + e = jm(i, "svg", { xmlns: !0, width: !0, height: !0, @@ -4983,50 +4983,50 @@ function CT(n) { "stroke-linejoin": !0, class: !0 }); - var s = Im(e); - t = km(s, "circle", { cx: !0, cy: !0, r: !0 }), Im(t).forEach(qu), s.forEach(qu), this.h(); + var s = Km(e); + t = jm(s, "circle", { cx: !0, cy: !0, r: !0 }), Km(t).forEach(hc), s.forEach(hc), this.h(); }, h() { - ui(t, "cx", "12"), ui(t, "cy", "12"), ui(t, "r", "10"), ui(e, "xmlns", "http://www.w3.org/2000/svg"), ui(e, "width", "100%"), ui(e, "height", "100%"), ui(e, "viewBox", "0 0 24 24"), ui(e, "stroke-width", "1.5"), ui(e, "stroke-linecap", "round"), ui(e, "stroke-linejoin", "round"), ui(e, "class", "feather feather-circle"); + yi(t, "cx", "12"), yi(t, "cy", "12"), yi(t, "r", "10"), yi(e, "xmlns", "http://www.w3.org/2000/svg"), yi(e, "width", "100%"), yi(e, "height", "100%"), yi(e, "viewBox", "0 0 24 24"), yi(e, "stroke-width", "1.5"), yi(e, "stroke-linecap", "round"), yi(e, "stroke-linejoin", "round"), yi(e, "class", "feather feather-circle"); }, m(i, s) { - kT(i, e, s), LT(e, t); + jT(i, e, s), qT(e, t); }, - p: Ku, - i: Ku, - o: Ku, + p: dc, + i: dc, + o: dc, d(i) { - i && qu(e); + i && hc(e); } }; } -class FT extends wT { +class YT extends VT { constructor(e) { - super(), IT(this, e, null, CT, RT, {}); + super(), KT(this, e, null, WT, zT, {}); } } const { - SvelteComponent: PT, - append_hydration: ju, - attr: ci, - children: yo, - claim_svg_element: Eo, - detach: Zr, - init: OT, - insert_hydration: MT, - noop: zu, - safe_not_equal: $T, - set_style: $i, - svg_element: bo + SvelteComponent: XT, + append_hydration: fc, + attr: Ei, + children: $o, + claim_svg_element: Bo, + detach: ra, + init: QT, + insert_hydration: ZT, + noop: mc, + safe_not_equal: JT, + set_style: Hi, + svg_element: No } = window.__gradio__svelte__internal; -function BT(n) { +function eS(n) { let e, t, i, s; return { c() { - e = bo("svg"), t = bo("g"), i = bo("path"), s = bo("path"), this.h(); + e = No("svg"), t = No("g"), i = No("path"), s = No("path"), this.h(); }, l(r) { - e = Eo(r, "svg", { + e = Bo(r, "svg", { width: !0, height: !0, viewBox: !0, @@ -5037,232 +5037,232 @@ function BT(n) { stroke: !0, style: !0 }); - var a = yo(e); - t = Eo(a, "g", { transform: !0 }); - var o = yo(t); - i = Eo(o, "path", { d: !0, style: !0 }), yo(i).forEach(Zr), o.forEach(Zr), s = Eo(a, "path", { d: !0, style: !0 }), yo(s).forEach(Zr), a.forEach(Zr), this.h(); + var a = $o(e); + t = Bo(a, "g", { transform: !0 }); + var o = $o(t); + i = Bo(o, "path", { d: !0, style: !0 }), $o(i).forEach(ra), o.forEach(ra), s = Bo(a, "path", { d: !0, style: !0 }), $o(s).forEach(ra), a.forEach(ra), this.h(); }, h() { - ci(i, "d", "M18,6L6.087,17.913"), $i(i, "fill", "none"), $i(i, "fill-rule", "nonzero"), $i(i, "stroke-width", "2px"), ci(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), ci(s, "d", "M4.364,4.364L19.636,19.636"), $i(s, "fill", "none"), $i(s, "fill-rule", "nonzero"), $i(s, "stroke-width", "2px"), ci(e, "width", "100%"), ci(e, "height", "100%"), ci(e, "viewBox", "0 0 24 24"), ci(e, "version", "1.1"), ci(e, "xmlns", "http://www.w3.org/2000/svg"), ci(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), ci(e, "xml:space", "preserve"), ci(e, "stroke", "currentColor"), $i(e, "fill-rule", "evenodd"), $i(e, "clip-rule", "evenodd"), $i(e, "stroke-linecap", "round"), $i(e, "stroke-linejoin", "round"); + Ei(i, "d", "M18,6L6.087,17.913"), Hi(i, "fill", "none"), Hi(i, "fill-rule", "nonzero"), Hi(i, "stroke-width", "2px"), Ei(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), Ei(s, "d", "M4.364,4.364L19.636,19.636"), Hi(s, "fill", "none"), Hi(s, "fill-rule", "nonzero"), Hi(s, "stroke-width", "2px"), Ei(e, "width", "100%"), Ei(e, "height", "100%"), Ei(e, "viewBox", "0 0 24 24"), Ei(e, "version", "1.1"), Ei(e, "xmlns", "http://www.w3.org/2000/svg"), Ei(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Ei(e, "xml:space", "preserve"), Ei(e, "stroke", "currentColor"), Hi(e, "fill-rule", "evenodd"), Hi(e, "clip-rule", "evenodd"), Hi(e, "stroke-linecap", "round"), Hi(e, "stroke-linejoin", "round"); }, m(r, a) { - MT(r, e, a), ju(e, t), ju(t, i), ju(e, s); + ZT(r, e, a), fc(e, t), fc(t, i), fc(e, s); }, - p: zu, - i: zu, - o: zu, + p: mc, + i: mc, + o: mc, d(r) { - r && Zr(e); + r && ra(e); } }; } -class Jd extends PT { +class bf extends XT { constructor(e) { - super(), OT(this, e, null, BT, $T, {}); + super(), QT(this, e, null, eS, JT, {}); } } const { - SvelteComponent: WU, - append_hydration: YU, - attr: XU, - children: QU, - claim_svg_element: ZU, - detach: JU, - init: e4, - insert_hydration: t4, - noop: i4, - safe_not_equal: n4, - svg_element: s4 + SvelteComponent: b4, + append_hydration: T4, + attr: S4, + children: A4, + claim_svg_element: x4, + detach: D4, + init: w4, + insert_hydration: L4, + noop: I4, + safe_not_equal: k4, + svg_element: R4 } = window.__gradio__svelte__internal, { - SvelteComponent: r4, - append_hydration: a4, - attr: o4, - children: l4, - claim_svg_element: u4, - detach: c4, - init: h4, - insert_hydration: d4, - noop: f4, - safe_not_equal: m4, - svg_element: g4 + SvelteComponent: C4, + append_hydration: F4, + attr: P4, + children: O4, + claim_svg_element: M4, + detach: $4, + init: B4, + insert_hydration: N4, + noop: U4, + safe_not_equal: G4, + svg_element: H4 } = window.__gradio__svelte__internal, { - SvelteComponent: p4, - append_hydration: _4, - attr: v4, - children: y4, - claim_svg_element: E4, - detach: b4, - init: T4, - insert_hydration: S4, - noop: A4, - safe_not_equal: x4, - svg_element: D4 + SvelteComponent: V4, + append_hydration: q4, + attr: K4, + children: j4, + claim_svg_element: z4, + detach: W4, + init: Y4, + insert_hydration: X4, + noop: Q4, + safe_not_equal: Z4, + svg_element: J4 } = window.__gradio__svelte__internal, { - SvelteComponent: w4, - append_hydration: L4, - attr: I4, - children: k4, - claim_svg_element: R4, - detach: C4, - init: F4, - insert_hydration: P4, - noop: O4, - safe_not_equal: M4, - svg_element: $4 + SvelteComponent: e8, + append_hydration: t8, + attr: i8, + children: n8, + claim_svg_element: s8, + detach: r8, + init: a8, + insert_hydration: o8, + noop: l8, + safe_not_equal: u8, + svg_element: c8 } = window.__gradio__svelte__internal, { - SvelteComponent: B4, - append_hydration: N4, - attr: U4, - children: G4, - claim_svg_element: H4, - detach: V4, - init: q4, - insert_hydration: K4, - noop: j4, - safe_not_equal: z4, - svg_element: W4 + SvelteComponent: h8, + append_hydration: d8, + attr: f8, + children: m8, + claim_svg_element: g8, + detach: p8, + init: _8, + insert_hydration: v8, + noop: y8, + safe_not_equal: E8, + svg_element: b8 } = window.__gradio__svelte__internal, { - SvelteComponent: Y4, - append_hydration: X4, - attr: Q4, - children: Z4, - claim_svg_element: J4, - detach: e8, - init: t8, - insert_hydration: i8, - noop: n8, - safe_not_equal: s8, - svg_element: r8 + SvelteComponent: T8, + append_hydration: S8, + attr: A8, + children: x8, + claim_svg_element: D8, + detach: w8, + init: L8, + insert_hydration: I8, + noop: k8, + safe_not_equal: R8, + svg_element: C8 } = window.__gradio__svelte__internal, { - SvelteComponent: NT, - append_hydration: UT, - attr: Ns, - children: Cm, - claim_svg_element: Fm, - detach: Wu, - init: GT, - insert_hydration: HT, - noop: Yu, - safe_not_equal: VT, - svg_element: Pm + SvelteComponent: tS, + append_hydration: iS, + attr: Xs, + children: Wm, + claim_svg_element: Ym, + detach: gc, + init: nS, + insert_hydration: sS, + noop: pc, + safe_not_equal: rS, + svg_element: Xm } = window.__gradio__svelte__internal; -function qT(n) { +function aS(n) { let e, t; return { c() { - e = Pm("svg"), t = Pm("path"), this.h(); + e = Xm("svg"), t = Xm("path"), this.h(); }, l(i) { - e = Fm(i, "svg", { + e = Ym(i, "svg", { xmlns: !0, width: !0, height: !0, viewBox: !0 }); - var s = Cm(e); - t = Fm(s, "path", { fill: !0, d: !0 }), Cm(t).forEach(Wu), s.forEach(Wu), this.h(); + var s = Wm(e); + t = Ym(s, "path", { fill: !0, d: !0 }), Wm(t).forEach(gc), s.forEach(gc), this.h(); }, h() { - Ns(t, "fill", "currentColor"), Ns(t, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), Ns(e, "xmlns", "http://www.w3.org/2000/svg"), Ns(e, "width", "100%"), Ns(e, "height", "100%"), Ns(e, "viewBox", "0 0 32 32"); + Xs(t, "fill", "currentColor"), Xs(t, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), Xs(e, "xmlns", "http://www.w3.org/2000/svg"), Xs(e, "width", "100%"), Xs(e, "height", "100%"), Xs(e, "viewBox", "0 0 32 32"); }, m(i, s) { - HT(i, e, s), UT(e, t); + sS(i, e, s), iS(e, t); }, - p: Yu, - i: Yu, - o: Yu, + p: pc, + i: pc, + o: pc, d(i) { - i && Wu(e); + i && gc(e); } }; } -class ov extends NT { +class Sv extends tS { constructor(e) { - super(), GT(this, e, null, qT, VT, {}); + super(), nS(this, e, null, aS, rS, {}); } } const { - SvelteComponent: KT, - append_hydration: jT, - attr: Us, - children: Om, - claim_svg_element: Mm, - detach: Xu, - init: zT, - insert_hydration: WT, - noop: Qu, - safe_not_equal: YT, - svg_element: $m + SvelteComponent: oS, + append_hydration: lS, + attr: Qs, + children: Qm, + claim_svg_element: Zm, + detach: _c, + init: uS, + insert_hydration: cS, + noop: vc, + safe_not_equal: hS, + svg_element: Jm } = window.__gradio__svelte__internal; -function XT(n) { +function dS(n) { let e, t; return { c() { - e = $m("svg"), t = $m("path"), this.h(); + e = Jm("svg"), t = Jm("path"), this.h(); }, l(i) { - e = Mm(i, "svg", { + e = Zm(i, "svg", { class: !0, xmlns: !0, width: !0, height: !0, viewBox: !0 }); - var s = Om(e); - t = Mm(s, "path", { d: !0 }), Om(t).forEach(Xu), s.forEach(Xu), this.h(); + var s = Qm(e); + t = Zm(s, "path", { d: !0 }), Qm(t).forEach(_c), s.forEach(_c), this.h(); }, h() { - Us(t, "d", "M5 8l4 4 4-4z"), Us(e, "class", "dropdown-arrow svelte-145leq6"), Us(e, "xmlns", "http://www.w3.org/2000/svg"), Us(e, "width", "100%"), Us(e, "height", "100%"), Us(e, "viewBox", "0 0 18 18"); + Qs(t, "d", "M5 8l4 4 4-4z"), Qs(e, "class", "dropdown-arrow svelte-145leq6"), Qs(e, "xmlns", "http://www.w3.org/2000/svg"), Qs(e, "width", "100%"), Qs(e, "height", "100%"), Qs(e, "viewBox", "0 0 18 18"); }, m(i, s) { - WT(i, e, s), jT(e, t); + cS(i, e, s), lS(e, t); }, - p: Qu, - i: Qu, - o: Qu, + p: vc, + i: vc, + o: vc, d(i) { - i && Xu(e); + i && _c(e); } }; } -class lv extends KT { +class Av extends oS { constructor(e) { - super(), zT(this, e, null, XT, YT, {}); + super(), uS(this, e, null, dS, hS, {}); } } const { - SvelteComponent: a8, - append_hydration: o8, - attr: l8, - children: u8, - claim_svg_element: c8, - detach: h8, - init: d8, - insert_hydration: f8, - noop: m8, - safe_not_equal: g8, - svg_element: p8 + SvelteComponent: F8, + append_hydration: P8, + attr: O8, + children: M8, + claim_svg_element: $8, + detach: B8, + init: N8, + insert_hydration: U8, + noop: G8, + safe_not_equal: H8, + svg_element: V8 } = window.__gradio__svelte__internal, { - SvelteComponent: QT, - append_hydration: ZT, - attr: hi, - children: Bm, - claim_svg_element: Nm, - detach: Zu, - init: JT, - insert_hydration: eS, - noop: Ju, - safe_not_equal: tS, - svg_element: Um + SvelteComponent: fS, + append_hydration: mS, + attr: bi, + children: eg, + claim_svg_element: tg, + detach: yc, + init: gS, + insert_hydration: pS, + noop: Ec, + safe_not_equal: _S, + svg_element: ig } = window.__gradio__svelte__internal; -function iS(n) { +function vS(n) { let e, t; return { c() { - e = Um("svg"), t = Um("path"), this.h(); + e = ig("svg"), t = ig("path"), this.h(); }, l(i) { - e = Nm(i, "svg", { + e = tg(i, "svg", { xmlns: !0, width: !0, height: !0, @@ -5274,85 +5274,85 @@ function iS(n) { "stroke-linejoin": !0, class: !0 }); - var s = Bm(e); - t = Nm(s, "path", { d: !0 }), Bm(t).forEach(Zu), s.forEach(Zu), this.h(); + var s = eg(e); + t = tg(s, "path", { d: !0 }), eg(t).forEach(yc), s.forEach(yc), this.h(); }, h() { - hi(t, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), hi(e, "xmlns", "http://www.w3.org/2000/svg"), hi(e, "width", "100%"), hi(e, "height", "100%"), hi(e, "viewBox", "0 0 24 24"), hi(e, "fill", "none"), hi(e, "stroke", "currentColor"), hi(e, "stroke-width", "1.5"), hi(e, "stroke-linecap", "round"), hi(e, "stroke-linejoin", "round"), hi(e, "class", "feather feather-edit-2"); + bi(t, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), bi(e, "xmlns", "http://www.w3.org/2000/svg"), bi(e, "width", "100%"), bi(e, "height", "100%"), bi(e, "viewBox", "0 0 24 24"), bi(e, "fill", "none"), bi(e, "stroke", "currentColor"), bi(e, "stroke-width", "1.5"), bi(e, "stroke-linecap", "round"), bi(e, "stroke-linejoin", "round"), bi(e, "class", "feather feather-edit-2"); }, m(i, s) { - eS(i, e, s), ZT(e, t); + pS(i, e, s), mS(e, t); }, - p: Ju, - i: Ju, - o: Ju, + p: Ec, + i: Ec, + o: Ec, d(i) { - i && Zu(e); + i && yc(e); } }; } -class nS extends QT { +class yS extends fS { constructor(e) { - super(), JT(this, e, null, iS, tS, {}); + super(), gS(this, e, null, vS, _S, {}); } } const { - SvelteComponent: _8, - append_hydration: v8, - attr: y8, - children: E8, - claim_svg_element: b8, - detach: T8, - init: S8, - insert_hydration: A8, - noop: x8, - safe_not_equal: D8, - svg_element: w8 + SvelteComponent: q8, + append_hydration: K8, + attr: j8, + children: z8, + claim_svg_element: W8, + detach: Y8, + init: X8, + insert_hydration: Q8, + noop: Z8, + safe_not_equal: J8, + svg_element: e5 } = window.__gradio__svelte__internal, { - SvelteComponent: L8, - append_hydration: I8, - attr: k8, - children: R8, - claim_svg_element: C8, - detach: F8, - init: P8, - insert_hydration: O8, - noop: M8, - safe_not_equal: $8, - svg_element: B8 + SvelteComponent: t5, + append_hydration: i5, + attr: n5, + children: s5, + claim_svg_element: r5, + detach: a5, + init: o5, + insert_hydration: l5, + noop: u5, + safe_not_equal: c5, + svg_element: h5 } = window.__gradio__svelte__internal, { - SvelteComponent: N8, - append_hydration: U8, - attr: G8, - children: H8, - claim_svg_element: V8, - detach: q8, - init: K8, - insert_hydration: j8, - noop: z8, - safe_not_equal: W8, - svg_element: Y8 + SvelteComponent: d5, + append_hydration: f5, + attr: m5, + children: g5, + claim_svg_element: p5, + detach: _5, + init: v5, + insert_hydration: y5, + noop: E5, + safe_not_equal: b5, + svg_element: T5 } = window.__gradio__svelte__internal, { - SvelteComponent: sS, - append_hydration: rS, - attr: di, - children: Gm, - claim_svg_element: Hm, - detach: ec, - init: aS, - insert_hydration: oS, - noop: tc, - safe_not_equal: lS, - svg_element: Vm + SvelteComponent: ES, + append_hydration: bS, + attr: Ti, + children: ng, + claim_svg_element: sg, + detach: bc, + init: TS, + insert_hydration: SS, + noop: Tc, + safe_not_equal: AS, + svg_element: rg } = window.__gradio__svelte__internal; -function uS(n) { +function xS(n) { let e, t; return { c() { - e = Vm("svg"), t = Vm("path"), this.h(); + e = rg("svg"), t = rg("path"), this.h(); }, l(i) { - e = Hm(i, "svg", { + e = sg(i, "svg", { xmlns: !0, viewBox: !0, fill: !0, @@ -5364,248 +5364,207 @@ function uS(n) { width: !0, height: !0 }); - var s = Gm(e); - t = Hm(s, "path", { d: !0 }); - var r = Gm(t); - r.forEach(ec), s.forEach(ec), this.h(); + var s = ng(e); + t = sg(s, "path", { d: !0 }); + var r = ng(t); + r.forEach(bc), s.forEach(bc), this.h(); }, h() { - di(t, "d", "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"), di(e, "xmlns", "http://www.w3.org/2000/svg"), di(e, "viewBox", "0 0 24 24"), di(e, "fill", "none"), di(e, "stroke", "currentColor"), di(e, "stroke-width", "2"), di(e, "stroke-linecap", "round"), di(e, "stroke-linejoin", "round"), di(e, "class", "feather feather-maximize"), di(e, "width", "100%"), di(e, "height", "100%"); + Ti(t, "d", "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"), Ti(e, "xmlns", "http://www.w3.org/2000/svg"), Ti(e, "viewBox", "0 0 24 24"), Ti(e, "fill", "none"), Ti(e, "stroke", "currentColor"), Ti(e, "stroke-width", "2"), Ti(e, "stroke-linecap", "round"), Ti(e, "stroke-linejoin", "round"), Ti(e, "class", "feather feather-maximize"), Ti(e, "width", "100%"), Ti(e, "height", "100%"); }, m(i, s) { - oS(i, e, s), rS(e, t); + SS(i, e, s), bS(e, t); }, - p: tc, - i: tc, - o: tc, + p: Tc, + i: Tc, + o: Tc, d(i) { - i && ec(e); + i && bc(e); } }; } -class cS extends sS { +class DS extends ES { constructor(e) { - super(), aS(this, e, null, uS, lS, {}); + super(), TS(this, e, null, xS, AS, {}); } } const { - SvelteComponent: X8, - append_hydration: Q8, - attr: Z8, - children: J8, - claim_svg_element: e5, - detach: t5, - init: i5, - insert_hydration: n5, - noop: s5, - safe_not_equal: r5, - svg_element: a5 + SvelteComponent: S5, + append_hydration: A5, + attr: x5, + children: D5, + claim_svg_element: w5, + detach: L5, + init: I5, + insert_hydration: k5, + noop: R5, + safe_not_equal: C5, + svg_element: F5 } = window.__gradio__svelte__internal, { - SvelteComponent: o5, - append_hydration: l5, - attr: u5, - children: c5, - claim_svg_element: h5, - detach: d5, - init: f5, - insert_hydration: m5, - noop: g5, - safe_not_equal: p5, - svg_element: _5 + SvelteComponent: P5, + append_hydration: O5, + attr: M5, + children: $5, + claim_svg_element: B5, + detach: N5, + init: U5, + insert_hydration: G5, + noop: H5, + safe_not_equal: V5, + svg_element: q5 } = window.__gradio__svelte__internal, { - SvelteComponent: v5, - append_hydration: y5, - attr: E5, - children: b5, - claim_svg_element: T5, - detach: S5, - init: A5, - insert_hydration: x5, - noop: D5, - safe_not_equal: w5, - svg_element: L5 + SvelteComponent: K5, + append_hydration: j5, + attr: z5, + children: W5, + claim_svg_element: Y5, + detach: X5, + init: Q5, + insert_hydration: Z5, + noop: J5, + safe_not_equal: e6, + svg_element: t6 } = window.__gradio__svelte__internal, { - SvelteComponent: I5, - append_hydration: k5, - attr: R5, - children: C5, - claim_svg_element: F5, - detach: P5, - init: O5, - insert_hydration: M5, - noop: $5, - safe_not_equal: B5, - svg_element: N5 + SvelteComponent: i6, + append_hydration: n6, + attr: s6, + children: r6, + claim_svg_element: a6, + detach: o6, + init: l6, + insert_hydration: u6, + noop: c6, + safe_not_equal: h6, + svg_element: d6 } = window.__gradio__svelte__internal, { - SvelteComponent: U5, - append_hydration: G5, - attr: H5, - children: V5, - claim_svg_element: q5, - detach: K5, - init: j5, - insert_hydration: z5, - noop: W5, - safe_not_equal: Y5, - svg_element: X5 + SvelteComponent: f6, + append_hydration: m6, + attr: g6, + children: p6, + claim_svg_element: _6, + detach: v6, + init: y6, + insert_hydration: E6, + noop: b6, + safe_not_equal: T6, + svg_element: S6 } = window.__gradio__svelte__internal, { - SvelteComponent: hS, - append_hydration: dS, - attr: Gs, - children: qm, - claim_svg_element: Km, - detach: ic, - init: fS, - insert_hydration: mS, - noop: nc, - safe_not_equal: gS, - svg_element: jm + SvelteComponent: wS, + append_hydration: LS, + attr: Zs, + children: ag, + claim_svg_element: og, + detach: Sc, + init: IS, + insert_hydration: kS, + noop: Ac, + safe_not_equal: RS, + svg_element: lg } = window.__gradio__svelte__internal; -function pS(n) { +function CS(n) { let e, t; return { c() { - e = jm("svg"), t = jm("path"), this.h(); + e = lg("svg"), t = lg("path"), this.h(); }, l(i) { - e = Km(i, "svg", { + e = og(i, "svg", { xmlns: !0, width: !0, height: !0, viewBox: !0 }); - var s = qm(e); - t = Km(s, "path", { fill: !0, d: !0 }), qm(t).forEach(ic), s.forEach(ic), this.h(); + var s = ag(e); + t = og(s, "path", { fill: !0, d: !0 }), ag(t).forEach(Sc), s.forEach(Sc), this.h(); }, h() { - Gs(t, "fill", "currentColor"), Gs(t, "d", "M200 32h-36.26a47.92 47.92 0 0 0-71.48 0H56a16 16 0 0 0-16 16v168a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16m-72 0a32 32 0 0 1 32 32H96a32 32 0 0 1 32-32m72 184H56V48h26.75A47.9 47.9 0 0 0 80 64v8a8 8 0 0 0 8 8h80a8 8 0 0 0 8-8v-8a47.9 47.9 0 0 0-2.75-16H200Z"), Gs(e, "xmlns", "http://www.w3.org/2000/svg"), Gs(e, "width", "100%"), Gs(e, "height", "100%"), Gs(e, "viewBox", "0 0 256 256"); + Zs(t, "fill", "currentColor"), Zs(t, "d", "M200 32h-36.26a47.92 47.92 0 0 0-71.48 0H56a16 16 0 0 0-16 16v168a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16m-72 0a32 32 0 0 1 32 32H96a32 32 0 0 1 32-32m72 184H56V48h26.75A47.9 47.9 0 0 0 80 64v8a8 8 0 0 0 8 8h80a8 8 0 0 0 8-8v-8a47.9 47.9 0 0 0-2.75-16H200Z"), Zs(e, "xmlns", "http://www.w3.org/2000/svg"), Zs(e, "width", "100%"), Zs(e, "height", "100%"), Zs(e, "viewBox", "0 0 256 256"); }, m(i, s) { - mS(i, e, s), dS(e, t); + kS(i, e, s), LS(e, t); }, - p: nc, - i: nc, - o: nc, + p: Ac, + i: Ac, + o: Ac, d(i) { - i && ic(e); + i && Sc(e); } }; } -class _S extends hS { +class FS extends wS { constructor(e) { - super(), fS(this, e, null, pS, gS, {}); + super(), IS(this, e, null, CS, RS, {}); } } const { - SvelteComponent: Q5, - append_hydration: Z5, - attr: J5, - children: e6, - claim_svg_element: t6, - detach: i6, - init: n6, - insert_hydration: s6, - noop: r6, - safe_not_equal: a6, - svg_element: o6 + SvelteComponent: A6, + append_hydration: x6, + attr: D6, + children: w6, + claim_svg_element: L6, + detach: I6, + init: k6, + insert_hydration: R6, + noop: C6, + safe_not_equal: F6, + svg_element: P6 } = window.__gradio__svelte__internal, { - SvelteComponent: l6, - append_hydration: u6, - attr: c6, - children: h6, - claim_svg_element: d6, - detach: f6, - init: m6, - insert_hydration: g6, - noop: p6, - safe_not_equal: _6, - svg_element: v6 + SvelteComponent: O6, + append_hydration: M6, + attr: $6, + children: B6, + claim_svg_element: N6, + detach: U6, + init: G6, + insert_hydration: H6, + noop: V6, + safe_not_equal: q6, + svg_element: K6 } = window.__gradio__svelte__internal, { - SvelteComponent: y6, - append_hydration: E6, - attr: b6, - children: T6, - claim_svg_element: S6, - detach: A6, - init: x6, - insert_hydration: D6, - noop: w6, - safe_not_equal: L6, - svg_element: I6 + SvelteComponent: j6, + append_hydration: z6, + attr: W6, + children: Y6, + claim_svg_element: X6, + detach: Q6, + init: Z6, + insert_hydration: J6, + noop: e9, + safe_not_equal: t9, + svg_element: i9 } = window.__gradio__svelte__internal, { - SvelteComponent: vS, - append_hydration: yS, - attr: Bi, - children: zm, - claim_svg_element: Wm, - detach: sc, - init: ES, - insert_hydration: bS, - noop: rc, - safe_not_equal: TS, - svg_element: Ym -} = window.__gradio__svelte__internal; -function SS(n) { - let e, t; - return { - c() { - e = Ym("svg"), t = Ym("path"), this.h(); - }, - l(i) { - e = Wm(i, "svg", { - xmlns: !0, - width: !0, - height: !0, - viewBox: !0, - fill: !0, - stroke: !0, - "stroke-width": !0, - "stroke-linecap": !0, - "stroke-linejoin": !0 - }); - var s = zm(e); - t = Wm(s, "path", { d: !0 }), zm(t).forEach(sc), s.forEach(sc), this.h(); - }, - h() { - Bi(t, "d", "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"), Bi(e, "xmlns", "http://www.w3.org/2000/svg"), Bi(e, "width", "100%"), Bi(e, "height", "100%"), Bi(e, "viewBox", "0 0 24 24"), Bi(e, "fill", "none"), Bi(e, "stroke", "currentColor"), Bi(e, "stroke-width", "1.5"), Bi(e, "stroke-linecap", "round"), Bi(e, "stroke-linejoin", "round"); - }, - m(i, s) { - bS(i, e, s), yS(e, t); - }, - p: rc, - i: rc, - o: rc, - d(i) { - i && sc(e); - } - }; -} -class AS extends vS { - constructor(e) { - super(), ES(this, e, null, SS, TS, {}); - } -} -const { - SvelteComponent: xS, - append_hydration: To, - attr: je, - children: Jr, - claim_svg_element: ea, - detach: Hs, - init: DS, - insert_hydration: wS, - noop: ac, - safe_not_equal: LS, - svg_element: ta + SvelteComponent: n9, + append_hydration: s9, + attr: r9, + children: a9, + claim_svg_element: o9, + detach: l9, + init: u9, + insert_hydration: c9, + noop: h9, + safe_not_equal: d9, + svg_element: f9 +} = window.__gradio__svelte__internal, { + SvelteComponent: PS, + append_hydration: Uo, + attr: Xe, + children: aa, + claim_svg_element: oa, + detach: Js, + init: OS, + insert_hydration: MS, + noop: xc, + safe_not_equal: $S, + svg_element: la } = window.__gradio__svelte__internal; -function IS(n) { +function BS(n) { let e, t, i, s, r; return { c() { - e = ta("svg"), t = ta("path"), i = ta("path"), s = ta("line"), r = ta("line"), this.h(); + e = la("svg"), t = la("path"), i = la("path"), s = la("line"), r = la("line"), this.h(); }, l(a) { - e = ea(a, "svg", { + e = oa(a, "svg", { xmlns: !0, width: !0, height: !0, @@ -5617,49 +5576,49 @@ function IS(n) { "stroke-linejoin": !0, class: !0 }); - var o = Jr(e); - t = ea(o, "path", { d: !0 }), Jr(t).forEach(Hs), i = ea(o, "path", { d: !0 }), Jr(i).forEach(Hs), s = ea(o, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), Jr(s).forEach(Hs), r = ea(o, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), Jr(r).forEach(Hs), o.forEach(Hs), this.h(); + var o = aa(e); + t = oa(o, "path", { d: !0 }), aa(t).forEach(Js), i = oa(o, "path", { d: !0 }), aa(i).forEach(Js), s = oa(o, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), aa(s).forEach(Js), r = oa(o, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), aa(r).forEach(Js), o.forEach(Js), this.h(); }, h() { - je(t, "d", "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"), je(i, "d", "M19 10v2a7 7 0 0 1-14 0v-2"), je(s, "x1", "12"), je(s, "y1", "19"), je(s, "x2", "12"), je(s, "y2", "23"), je(r, "x1", "8"), je(r, "y1", "23"), je(r, "x2", "16"), je(r, "y2", "23"), je(e, "xmlns", "http://www.w3.org/2000/svg"), je(e, "width", "100%"), je(e, "height", "100%"), je(e, "viewBox", "0 0 24 24"), je(e, "fill", "none"), je(e, "stroke", "currentColor"), je(e, "stroke-width", "2"), je(e, "stroke-linecap", "round"), je(e, "stroke-linejoin", "round"), je(e, "class", "feather feather-mic"); + Xe(t, "d", "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"), Xe(i, "d", "M19 10v2a7 7 0 0 1-14 0v-2"), Xe(s, "x1", "12"), Xe(s, "y1", "19"), Xe(s, "x2", "12"), Xe(s, "y2", "23"), Xe(r, "x1", "8"), Xe(r, "y1", "23"), Xe(r, "x2", "16"), Xe(r, "y2", "23"), Xe(e, "xmlns", "http://www.w3.org/2000/svg"), Xe(e, "width", "100%"), Xe(e, "height", "100%"), Xe(e, "viewBox", "0 0 24 24"), Xe(e, "fill", "none"), Xe(e, "stroke", "currentColor"), Xe(e, "stroke-width", "2"), Xe(e, "stroke-linecap", "round"), Xe(e, "stroke-linejoin", "round"), Xe(e, "class", "feather feather-mic"); }, m(a, o) { - wS(a, e, o), To(e, t), To(e, i), To(e, s), To(e, r); + MS(a, e, o), Uo(e, t), Uo(e, i), Uo(e, s), Uo(e, r); }, - p: ac, - i: ac, - o: ac, + p: xc, + i: xc, + o: xc, d(a) { - a && Hs(e); + a && Js(e); } }; } -class kS extends xS { +class NS extends PS { constructor(e) { - super(), DS(this, e, null, IS, LS, {}); + super(), OS(this, e, null, BS, $S, {}); } } const { - SvelteComponent: RS, - append_hydration: CS, - attr: fi, - children: Xm, - claim_svg_element: Qm, - detach: oc, - init: FS, - insert_hydration: PS, - noop: lc, - safe_not_equal: OS, - svg_element: Zm + SvelteComponent: US, + append_hydration: GS, + attr: Si, + children: ug, + claim_svg_element: cg, + detach: Dc, + init: HS, + insert_hydration: VS, + noop: wc, + safe_not_equal: qS, + svg_element: hg } = window.__gradio__svelte__internal; -function MS(n) { +function KS(n) { let e, t; return { c() { - e = Zm("svg"), t = Zm("path"), this.h(); + e = hg("svg"), t = hg("path"), this.h(); }, l(i) { - e = Qm(i, "svg", { + e = cg(i, "svg", { xmlns: !0, viewBox: !0, fill: !0, @@ -5671,97 +5630,97 @@ function MS(n) { width: !0, height: !0 }); - var s = Xm(e); - t = Qm(s, "path", { d: !0 }), Xm(t).forEach(oc), s.forEach(oc), this.h(); + var s = ug(e); + t = cg(s, "path", { d: !0 }), ug(t).forEach(Dc), s.forEach(Dc), this.h(); }, h() { - fi(t, "d", "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"), fi(e, "xmlns", "http://www.w3.org/2000/svg"), fi(e, "viewBox", "0 0 24 24"), fi(e, "fill", "none"), fi(e, "stroke", "currentColor"), fi(e, "stroke-width", "2"), fi(e, "stroke-linecap", "round"), fi(e, "stroke-linejoin", "round"), fi(e, "class", "feather feather-minimize"), fi(e, "width", "100%"), fi(e, "height", "100%"); + Si(t, "d", "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"), Si(e, "xmlns", "http://www.w3.org/2000/svg"), Si(e, "viewBox", "0 0 24 24"), Si(e, "fill", "none"), Si(e, "stroke", "currentColor"), Si(e, "stroke-width", "2"), Si(e, "stroke-linecap", "round"), Si(e, "stroke-linejoin", "round"), Si(e, "class", "feather feather-minimize"), Si(e, "width", "100%"), Si(e, "height", "100%"); }, m(i, s) { - PS(i, e, s), CS(e, t); + VS(i, e, s), GS(e, t); }, - p: lc, - i: lc, - o: lc, + p: wc, + i: wc, + o: wc, d(i) { - i && oc(e); + i && Dc(e); } }; } -class $S extends RS { +class jS extends US { constructor(e) { - super(), FS(this, e, null, MS, OS, {}); + super(), HS(this, e, null, KS, qS, {}); } } const { - SvelteComponent: k6, - append_hydration: R6, - attr: C6, - children: F6, - claim_svg_element: P6, - detach: O6, - init: M6, - insert_hydration: $6, - noop: B6, - safe_not_equal: N6, - svg_element: U6 + SvelteComponent: m9, + append_hydration: g9, + attr: p9, + children: _9, + claim_svg_element: v9, + detach: y9, + init: E9, + insert_hydration: b9, + noop: T9, + safe_not_equal: S9, + svg_element: A9 } = window.__gradio__svelte__internal, { - SvelteComponent: G6, - append_hydration: H6, - attr: V6, - children: q6, - claim_svg_element: K6, - detach: j6, - init: z6, - insert_hydration: W6, - noop: Y6, - safe_not_equal: X6, - svg_element: Q6 + SvelteComponent: x9, + append_hydration: D9, + attr: w9, + children: L9, + claim_svg_element: I9, + detach: k9, + init: R9, + insert_hydration: C9, + noop: F9, + safe_not_equal: P9, + svg_element: O9 } = window.__gradio__svelte__internal, { - SvelteComponent: Z6, - append_hydration: J6, - attr: eG, - children: tG, - claim_svg_element: iG, - detach: nG, - init: sG, - insert_hydration: rG, - noop: aG, - safe_not_equal: oG, - svg_element: lG + SvelteComponent: M9, + append_hydration: $9, + attr: B9, + children: N9, + claim_svg_element: U9, + detach: G9, + init: H9, + insert_hydration: V9, + noop: q9, + safe_not_equal: K9, + svg_element: j9 } = window.__gradio__svelte__internal, { - SvelteComponent: uG, - append_hydration: cG, - attr: hG, - children: dG, - claim_svg_element: fG, - detach: mG, - init: gG, - insert_hydration: pG, - noop: _G, - safe_not_equal: vG, - svg_element: yG + SvelteComponent: z9, + append_hydration: W9, + attr: Y9, + children: X9, + claim_svg_element: Q9, + detach: Z9, + init: J9, + insert_hydration: eG, + noop: tG, + safe_not_equal: iG, + svg_element: nG } = window.__gradio__svelte__internal, { - SvelteComponent: BS, - append_hydration: Jm, - attr: lt, - children: uc, - claim_svg_element: cc, - detach: So, - init: NS, - insert_hydration: US, - noop: hc, - safe_not_equal: GS, - svg_element: dc + SvelteComponent: zS, + append_hydration: dg, + attr: gt, + children: Lc, + claim_svg_element: Ic, + detach: Go, + init: WS, + insert_hydration: YS, + noop: kc, + safe_not_equal: XS, + svg_element: Rc } = window.__gradio__svelte__internal; -function HS(n) { +function QS(n) { let e, t, i; return { c() { - e = dc("svg"), t = dc("rect"), i = dc("rect"), this.h(); + e = Rc("svg"), t = Rc("rect"), i = Rc("rect"), this.h(); }, l(s) { - e = cc(s, "svg", { + e = Ic(s, "svg", { xmlns: !0, width: !0, height: !0, @@ -5772,59 +5731,59 @@ function HS(n) { "stroke-linecap": !0, "stroke-linejoin": !0 }); - var r = uc(e); - t = cc(r, "rect", { + var r = Lc(e); + t = Ic(r, "rect", { x: !0, y: !0, width: !0, height: !0 - }), uc(t).forEach(So), i = cc(r, "rect", { + }), Lc(t).forEach(Go), i = Ic(r, "rect", { x: !0, y: !0, width: !0, height: !0 - }), uc(i).forEach(So), r.forEach(So), this.h(); + }), Lc(i).forEach(Go), r.forEach(Go), this.h(); }, h() { - lt(t, "x", "6"), lt(t, "y", "4"), lt(t, "width", "4"), lt(t, "height", "16"), lt(i, "x", "14"), lt(i, "y", "4"), lt(i, "width", "4"), lt(i, "height", "16"), lt(e, "xmlns", "http://www.w3.org/2000/svg"), lt(e, "width", "100%"), lt(e, "height", "100%"), lt(e, "viewBox", "0 0 24 24"), lt(e, "fill", "currentColor"), lt(e, "stroke", "currentColor"), lt(e, "stroke-width", "1.5"), lt(e, "stroke-linecap", "round"), lt(e, "stroke-linejoin", "round"); + gt(t, "x", "6"), gt(t, "y", "4"), gt(t, "width", "4"), gt(t, "height", "16"), gt(i, "x", "14"), gt(i, "y", "4"), gt(i, "width", "4"), gt(i, "height", "16"), gt(e, "xmlns", "http://www.w3.org/2000/svg"), gt(e, "width", "100%"), gt(e, "height", "100%"), gt(e, "viewBox", "0 0 24 24"), gt(e, "fill", "currentColor"), gt(e, "stroke", "currentColor"), gt(e, "stroke-width", "1.5"), gt(e, "stroke-linecap", "round"), gt(e, "stroke-linejoin", "round"); }, m(s, r) { - US(s, e, r), Jm(e, t), Jm(e, i); + YS(s, e, r), dg(e, t), dg(e, i); }, - p: hc, - i: hc, - o: hc, + p: kc, + i: kc, + o: kc, d(s) { - s && So(e); + s && Go(e); } }; } -class VS extends BS { +class ZS extends zS { constructor(e) { - super(), NS(this, e, null, HS, GS, {}); + super(), WS(this, e, null, QS, XS, {}); } } const { - SvelteComponent: qS, - append_hydration: KS, - attr: Ni, - children: eg, - claim_svg_element: tg, - detach: fc, - init: jS, - insert_hydration: zS, - noop: mc, - safe_not_equal: WS, - svg_element: ig + SvelteComponent: JS, + append_hydration: eA, + attr: Vi, + children: fg, + claim_svg_element: mg, + detach: Cc, + init: tA, + insert_hydration: iA, + noop: Fc, + safe_not_equal: nA, + svg_element: gg } = window.__gradio__svelte__internal; -function YS(n) { +function sA(n) { let e, t; return { c() { - e = ig("svg"), t = ig("polygon"), this.h(); + e = gg("svg"), t = gg("polygon"), this.h(); }, l(i) { - e = tg(i, "svg", { + e = mg(i, "svg", { xmlns: !0, width: !0, height: !0, @@ -5835,146 +5794,146 @@ function YS(n) { "stroke-linecap": !0, "stroke-linejoin": !0 }); - var s = eg(e); - t = tg(s, "polygon", { points: !0 }), eg(t).forEach(fc), s.forEach(fc), this.h(); + var s = fg(e); + t = mg(s, "polygon", { points: !0 }), fg(t).forEach(Cc), s.forEach(Cc), this.h(); }, h() { - Ni(t, "points", "5 3 19 12 5 21 5 3"), Ni(e, "xmlns", "http://www.w3.org/2000/svg"), Ni(e, "width", "100%"), Ni(e, "height", "100%"), Ni(e, "viewBox", "0 0 24 24"), Ni(e, "fill", "currentColor"), Ni(e, "stroke", "currentColor"), Ni(e, "stroke-width", "1.5"), Ni(e, "stroke-linecap", "round"), Ni(e, "stroke-linejoin", "round"); + Vi(t, "points", "5 3 19 12 5 21 5 3"), Vi(e, "xmlns", "http://www.w3.org/2000/svg"), Vi(e, "width", "100%"), Vi(e, "height", "100%"), Vi(e, "viewBox", "0 0 24 24"), Vi(e, "fill", "currentColor"), Vi(e, "stroke", "currentColor"), Vi(e, "stroke-width", "1.5"), Vi(e, "stroke-linecap", "round"), Vi(e, "stroke-linejoin", "round"); }, m(i, s) { - zS(i, e, s), KS(e, t); + iA(i, e, s), eA(e, t); }, - p: mc, - i: mc, - o: mc, + p: Fc, + i: Fc, + o: Fc, d(i) { - i && fc(e); + i && Cc(e); } }; } -class XS extends qS { +class rA extends JS { constructor(e) { - super(), jS(this, e, null, YS, WS, {}); + super(), tA(this, e, null, sA, nA, {}); } } const { - SvelteComponent: EG, - append_hydration: bG, - attr: TG, - children: SG, - claim_svg_element: AG, - detach: xG, - init: DG, - insert_hydration: wG, - noop: LG, - safe_not_equal: IG, - svg_element: kG + SvelteComponent: sG, + append_hydration: rG, + attr: aG, + children: oG, + claim_svg_element: lG, + detach: uG, + init: cG, + insert_hydration: hG, + noop: dG, + safe_not_equal: fG, + svg_element: mG } = window.__gradio__svelte__internal, { - SvelteComponent: RG, - append_hydration: CG, - attr: FG, - children: PG, - claim_svg_element: OG, - detach: MG, - init: $G, - insert_hydration: BG, - noop: NG, - safe_not_equal: UG, - svg_element: GG + SvelteComponent: gG, + append_hydration: pG, + attr: _G, + children: vG, + claim_svg_element: yG, + detach: EG, + init: bG, + insert_hydration: TG, + noop: SG, + safe_not_equal: AG, + svg_element: xG } = window.__gradio__svelte__internal, { - SvelteComponent: HG, - append_hydration: VG, - attr: qG, - children: KG, - claim_svg_element: jG, - detach: zG, - init: WG, - insert_hydration: YG, - noop: XG, - safe_not_equal: QG, - set_style: ZG, - svg_element: JG + SvelteComponent: DG, + append_hydration: wG, + attr: LG, + children: IG, + claim_svg_element: kG, + detach: RG, + init: CG, + insert_hydration: FG, + noop: PG, + safe_not_equal: OG, + set_style: MG, + svg_element: $G } = window.__gradio__svelte__internal, { - SvelteComponent: e9, - append_hydration: t9, - attr: i9, - children: n9, - claim_svg_element: s9, - detach: r9, - init: a9, - insert_hydration: o9, - noop: l9, - safe_not_equal: u9, - svg_element: c9 + SvelteComponent: BG, + append_hydration: NG, + attr: UG, + children: GG, + claim_svg_element: HG, + detach: VG, + init: qG, + insert_hydration: KG, + noop: jG, + safe_not_equal: zG, + svg_element: WG } = window.__gradio__svelte__internal, { - SvelteComponent: h9, - append_hydration: d9, - attr: f9, - children: m9, - claim_svg_element: g9, - detach: p9, - init: _9, - insert_hydration: v9, - noop: y9, - safe_not_equal: E9, - svg_element: b9 + SvelteComponent: YG, + append_hydration: XG, + attr: QG, + children: ZG, + claim_svg_element: JG, + detach: e7, + init: t7, + insert_hydration: i7, + noop: n7, + safe_not_equal: s7, + svg_element: r7 } = window.__gradio__svelte__internal, { - SvelteComponent: T9, - append_hydration: S9, - attr: A9, - children: x9, - claim_svg_element: D9, - detach: w9, - init: L9, - insert_hydration: I9, - noop: k9, - safe_not_equal: R9, - svg_element: C9 + SvelteComponent: a7, + append_hydration: o7, + attr: l7, + children: u7, + claim_svg_element: c7, + detach: h7, + init: d7, + insert_hydration: f7, + noop: m7, + safe_not_equal: g7, + svg_element: p7 } = window.__gradio__svelte__internal, { - SvelteComponent: F9, - append_hydration: P9, - attr: O9, - children: M9, - claim_svg_element: $9, - detach: B9, - init: N9, - insert_hydration: U9, - noop: G9, - safe_not_equal: H9, - svg_element: V9 + SvelteComponent: _7, + append_hydration: v7, + attr: y7, + children: E7, + claim_svg_element: b7, + detach: T7, + init: S7, + insert_hydration: A7, + noop: x7, + safe_not_equal: D7, + svg_element: w7 } = window.__gradio__svelte__internal, { - SvelteComponent: q9, - append_hydration: K9, - attr: j9, - children: z9, - claim_svg_element: W9, - detach: Y9, - init: X9, - insert_hydration: Q9, - noop: Z9, - safe_not_equal: J9, - svg_element: e7 + SvelteComponent: L7, + append_hydration: I7, + attr: k7, + children: R7, + claim_svg_element: C7, + detach: F7, + init: P7, + insert_hydration: O7, + noop: M7, + safe_not_equal: $7, + svg_element: B7 } = window.__gradio__svelte__internal, { - SvelteComponent: QS, - append_hydration: ZS, - attr: tt, - children: ng, - claim_svg_element: sg, - detach: gc, - init: JS, - insert_hydration: eA, - noop: rg, - safe_not_equal: tA, - svg_element: ag + SvelteComponent: aA, + append_hydration: oA, + attr: ot, + children: pg, + claim_svg_element: _g, + detach: Pc, + init: lA, + insert_hydration: uA, + noop: vg, + safe_not_equal: cA, + svg_element: yg } = window.__gradio__svelte__internal; -function iA(n) { +function hA(n) { let e, t, i; return { c() { - e = ag("svg"), t = ag("rect"), this.h(); + e = yg("svg"), t = yg("rect"), this.h(); }, l(s) { - e = sg(s, "svg", { + e = _g(s, "svg", { xmlns: !0, width: !0, height: !0, @@ -5986,128 +5945,128 @@ function iA(n) { "stroke-linejoin": !0, class: !0 }); - var r = ng(e); - t = sg(r, "rect", { + var r = pg(e); + t = _g(r, "rect", { x: !0, y: !0, width: !0, height: !0, rx: !0, ry: !0 - }), ng(t).forEach(gc), r.forEach(gc), this.h(); + }), pg(t).forEach(Pc), r.forEach(Pc), this.h(); }, h() { - tt(t, "x", "3"), tt(t, "y", "3"), tt(t, "width", "18"), tt(t, "height", "18"), tt(t, "rx", "2"), tt(t, "ry", "2"), tt(e, "xmlns", "http://www.w3.org/2000/svg"), tt(e, "width", "100%"), tt(e, "height", "100%"), tt(e, "viewBox", "0 0 24 24"), tt( + ot(t, "x", "3"), ot(t, "y", "3"), ot(t, "width", "18"), ot(t, "height", "18"), ot(t, "rx", "2"), ot(t, "ry", "2"), ot(e, "xmlns", "http://www.w3.org/2000/svg"), ot(e, "width", "100%"), ot(e, "height", "100%"), ot(e, "viewBox", "0 0 24 24"), ot( e, "fill", /*fill*/ n[0] - ), tt(e, "stroke", "currentColor"), tt(e, "stroke-width", i = `${/*stroke_width*/ - n[1]}`), tt(e, "stroke-linecap", "round"), tt(e, "stroke-linejoin", "round"), tt(e, "class", "feather feather-square"); + ), ot(e, "stroke", "currentColor"), ot(e, "stroke-width", i = `${/*stroke_width*/ + n[1]}`), ot(e, "stroke-linecap", "round"), ot(e, "stroke-linejoin", "round"), ot(e, "class", "feather feather-square"); }, m(s, r) { - eA(s, e, r), ZS(e, t); + uA(s, e, r), oA(e, t); }, p(s, [r]) { r & /*fill*/ - 1 && tt( + 1 && ot( e, "fill", /*fill*/ s[0] ), r & /*stroke_width*/ 2 && i !== (i = `${/*stroke_width*/ - s[1]}`) && tt(e, "stroke-width", i); + s[1]}`) && ot(e, "stroke-width", i); }, - i: rg, - o: rg, + i: vg, + o: vg, d(s) { - s && gc(e); + s && Pc(e); } }; } -function nA(n, e, t) { +function dA(n, e, t) { let { fill: i = "currentColor" } = e, { stroke_width: s = 1.5 } = e; return n.$$set = (r) => { "fill" in r && t(0, i = r.fill), "stroke_width" in r && t(1, s = r.stroke_width); }, [i, s]; } -class sA extends QS { +class fA extends aA { constructor(e) { - super(), JS(this, e, nA, iA, tA, { fill: 0, stroke_width: 1 }); + super(), lA(this, e, dA, hA, cA, { fill: 0, stroke_width: 1 }); } } const { - SvelteComponent: t7, - append_hydration: i7, - attr: n7, - children: s7, - claim_svg_element: r7, - detach: a7, - init: o7, - insert_hydration: l7, - noop: u7, - safe_not_equal: c7, - svg_element: h7 + SvelteComponent: N7, + append_hydration: U7, + attr: G7, + children: H7, + claim_svg_element: V7, + detach: q7, + init: K7, + insert_hydration: j7, + noop: z7, + safe_not_equal: W7, + svg_element: Y7 } = window.__gradio__svelte__internal, { - SvelteComponent: d7, - append_hydration: f7, - attr: m7, - children: g7, - claim_svg_element: p7, - detach: _7, - init: v7, - insert_hydration: y7, - noop: E7, - safe_not_equal: b7, - svg_element: T7 + SvelteComponent: X7, + append_hydration: Q7, + attr: Z7, + children: J7, + claim_svg_element: eH, + detach: tH, + init: iH, + insert_hydration: nH, + noop: sH, + safe_not_equal: rH, + svg_element: aH } = window.__gradio__svelte__internal, { - SvelteComponent: S7, - append_hydration: A7, - attr: x7, - children: D7, - claim_svg_element: w7, - claim_text: L7, - detach: I7, - init: k7, - insert_hydration: R7, - noop: C7, - safe_not_equal: F7, - svg_element: P7, - text: O7 + SvelteComponent: oH, + append_hydration: lH, + attr: uH, + children: cH, + claim_svg_element: hH, + claim_text: dH, + detach: fH, + init: mH, + insert_hydration: gH, + noop: pH, + safe_not_equal: _H, + svg_element: vH, + text: yH } = window.__gradio__svelte__internal, { - SvelteComponent: M7, - append_hydration: $7, - attr: B7, - children: N7, - claim_svg_element: U7, - detach: G7, - init: H7, - insert_hydration: V7, - noop: q7, - safe_not_equal: K7, - svg_element: j7 + SvelteComponent: EH, + append_hydration: bH, + attr: TH, + children: SH, + claim_svg_element: AH, + detach: xH, + init: DH, + insert_hydration: wH, + noop: LH, + safe_not_equal: IH, + svg_element: kH } = window.__gradio__svelte__internal, { - SvelteComponent: rA, - append_hydration: ia, - attr: we, - children: Vs, - claim_svg_element: qs, - detach: rs, - init: aA, - insert_hydration: oA, - noop: pc, - safe_not_equal: lA, - svg_element: Ks + SvelteComponent: mA, + append_hydration: ua, + attr: Le, + children: er, + claim_svg_element: tr, + detach: hs, + init: gA, + insert_hydration: pA, + noop: Oc, + safe_not_equal: _A, + svg_element: ir } = window.__gradio__svelte__internal; -function uA(n) { +function vA(n) { let e, t, i, s, r, a; return { c() { - e = Ks("svg"), t = Ks("circle"), i = Ks("circle"), s = Ks("line"), r = Ks("line"), a = Ks("line"), this.h(); + e = ir("svg"), t = ir("circle"), i = ir("circle"), s = ir("line"), r = ir("line"), a = ir("line"), this.h(); }, l(o) { - e = qs(o, "svg", { + e = tr(o, "svg", { xmlns: !0, width: !0, height: !0, @@ -6119,49 +6078,49 @@ function uA(n) { "stroke-linejoin": !0, class: !0 }); - var u = Vs(e); - t = qs(u, "circle", { cx: !0, cy: !0, r: !0 }), Vs(t).forEach(rs), i = qs(u, "circle", { cx: !0, cy: !0, r: !0 }), Vs(i).forEach(rs), s = qs(u, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), Vs(s).forEach(rs), r = qs(u, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), Vs(r).forEach(rs), a = qs(u, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), Vs(a).forEach(rs), u.forEach(rs), this.h(); + var u = er(e); + t = tr(u, "circle", { cx: !0, cy: !0, r: !0 }), er(t).forEach(hs), i = tr(u, "circle", { cx: !0, cy: !0, r: !0 }), er(i).forEach(hs), s = tr(u, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), er(s).forEach(hs), r = tr(u, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), er(r).forEach(hs), a = tr(u, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), er(a).forEach(hs), u.forEach(hs), this.h(); }, h() { - we(t, "cx", "6"), we(t, "cy", "6"), we(t, "r", "3"), we(i, "cx", "6"), we(i, "cy", "18"), we(i, "r", "3"), we(s, "x1", "20"), we(s, "y1", "4"), we(s, "x2", "8.12"), we(s, "y2", "15.88"), we(r, "x1", "14.47"), we(r, "y1", "14.48"), we(r, "x2", "20"), we(r, "y2", "20"), we(a, "x1", "8.12"), we(a, "y1", "8.12"), we(a, "x2", "12"), we(a, "y2", "12"), we(e, "xmlns", "http://www.w3.org/2000/svg"), we(e, "width", "100%"), we(e, "height", "100%"), we(e, "viewBox", "0 0 24 24"), we(e, "fill", "none"), we(e, "stroke", "currentColor"), we(e, "stroke-width", "2"), we(e, "stroke-linecap", "round"), we(e, "stroke-linejoin", "round"), we(e, "class", "feather feather-scissors"); + Le(t, "cx", "6"), Le(t, "cy", "6"), Le(t, "r", "3"), Le(i, "cx", "6"), Le(i, "cy", "18"), Le(i, "r", "3"), Le(s, "x1", "20"), Le(s, "y1", "4"), Le(s, "x2", "8.12"), Le(s, "y2", "15.88"), Le(r, "x1", "14.47"), Le(r, "y1", "14.48"), Le(r, "x2", "20"), Le(r, "y2", "20"), Le(a, "x1", "8.12"), Le(a, "y1", "8.12"), Le(a, "x2", "12"), Le(a, "y2", "12"), Le(e, "xmlns", "http://www.w3.org/2000/svg"), Le(e, "width", "100%"), Le(e, "height", "100%"), Le(e, "viewBox", "0 0 24 24"), Le(e, "fill", "none"), Le(e, "stroke", "currentColor"), Le(e, "stroke-width", "2"), Le(e, "stroke-linecap", "round"), Le(e, "stroke-linejoin", "round"), Le(e, "class", "feather feather-scissors"); }, m(o, u) { - oA(o, e, u), ia(e, t), ia(e, i), ia(e, s), ia(e, r), ia(e, a); + pA(o, e, u), ua(e, t), ua(e, i), ua(e, s), ua(e, r), ua(e, a); }, - p: pc, - i: pc, - o: pc, + p: Oc, + i: Oc, + o: Oc, d(o) { - o && rs(e); + o && hs(e); } }; } -class cA extends rA { +class yA extends mA { constructor(e) { - super(), aA(this, e, null, uA, lA, {}); + super(), gA(this, e, null, vA, _A, {}); } } const { - SvelteComponent: hA, - append_hydration: og, - attr: Mt, - children: _c, - claim_svg_element: vc, - detach: Ao, - init: dA, - insert_hydration: fA, - noop: yc, - safe_not_equal: mA, - svg_element: Ec + SvelteComponent: EA, + append_hydration: Eg, + attr: Ht, + children: Mc, + claim_svg_element: $c, + detach: Ho, + init: bA, + insert_hydration: TA, + noop: Bc, + safe_not_equal: SA, + svg_element: Nc } = window.__gradio__svelte__internal; -function gA(n) { +function AA(n) { let e, t, i; return { c() { - e = Ec("svg"), t = Ec("polyline"), i = Ec("path"), this.h(); + e = Nc("svg"), t = Nc("polyline"), i = Nc("path"), this.h(); }, l(s) { - e = vc(s, "svg", { + e = $c(s, "svg", { "aria-label": !0, xmlns: !0, width: !0, @@ -6174,49 +6133,49 @@ function gA(n) { "stroke-linejoin": !0, class: !0 }); - var r = _c(e); - t = vc(r, "polyline", { points: !0 }), _c(t).forEach(Ao), i = vc(r, "path", { d: !0 }), _c(i).forEach(Ao), r.forEach(Ao), this.h(); + var r = Mc(e); + t = $c(r, "polyline", { points: !0 }), Mc(t).forEach(Ho), i = $c(r, "path", { d: !0 }), Mc(i).forEach(Ho), r.forEach(Ho), this.h(); }, h() { - Mt(t, "points", "1 4 1 10 7 10"), Mt(i, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Mt(e, "aria-label", "undo"), Mt(e, "xmlns", "http://www.w3.org/2000/svg"), Mt(e, "width", "100%"), Mt(e, "height", "100%"), Mt(e, "viewBox", "0 0 24 24"), Mt(e, "fill", "none"), Mt(e, "stroke", "currentColor"), Mt(e, "stroke-width", "1.5"), Mt(e, "stroke-linecap", "round"), Mt(e, "stroke-linejoin", "round"), Mt(e, "class", "feather feather-rotate-ccw"); + Ht(t, "points", "1 4 1 10 7 10"), Ht(i, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Ht(e, "aria-label", "undo"), Ht(e, "xmlns", "http://www.w3.org/2000/svg"), Ht(e, "width", "100%"), Ht(e, "height", "100%"), Ht(e, "viewBox", "0 0 24 24"), Ht(e, "fill", "none"), Ht(e, "stroke", "currentColor"), Ht(e, "stroke-width", "1.5"), Ht(e, "stroke-linecap", "round"), Ht(e, "stroke-linejoin", "round"), Ht(e, "class", "feather feather-rotate-ccw"); }, m(s, r) { - fA(s, e, r), og(e, t), og(e, i); + TA(s, e, r), Eg(e, t), Eg(e, i); }, - p: yc, - i: yc, - o: yc, + p: Bc, + i: Bc, + o: Bc, d(s) { - s && Ao(e); + s && Ho(e); } }; } -class ef extends hA { +class Tf extends EA { constructor(e) { - super(), dA(this, e, null, gA, mA, {}); + super(), bA(this, e, null, AA, SA, {}); } } const { - SvelteComponent: pA, - append_hydration: bc, - attr: pt, - children: xo, - claim_svg_element: Do, - detach: na, - init: _A, - insert_hydration: vA, - noop: Tc, - safe_not_equal: yA, - svg_element: wo + SvelteComponent: xA, + append_hydration: Uc, + attr: bt, + children: Vo, + claim_svg_element: qo, + detach: ca, + init: DA, + insert_hydration: wA, + noop: Gc, + safe_not_equal: LA, + svg_element: Ko } = window.__gradio__svelte__internal; -function EA(n) { +function IA(n) { let e, t, i, s; return { c() { - e = wo("svg"), t = wo("path"), i = wo("polyline"), s = wo("line"), this.h(); + e = Ko("svg"), t = Ko("path"), i = Ko("polyline"), s = Ko("line"), this.h(); }, l(r) { - e = Do(r, "svg", { + e = qo(r, "svg", { xmlns: !0, width: !0, height: !0, @@ -6228,49 +6187,49 @@ function EA(n) { "stroke-linejoin": !0, class: !0 }); - var a = xo(e); - t = Do(a, "path", { d: !0 }), xo(t).forEach(na), i = Do(a, "polyline", { points: !0 }), xo(i).forEach(na), s = Do(a, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), xo(s).forEach(na), a.forEach(na), this.h(); + var a = Vo(e); + t = qo(a, "path", { d: !0 }), Vo(t).forEach(ca), i = qo(a, "polyline", { points: !0 }), Vo(i).forEach(ca), s = qo(a, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), Vo(s).forEach(ca), a.forEach(ca), this.h(); }, h() { - pt(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), pt(i, "points", "17 8 12 3 7 8"), pt(s, "x1", "12"), pt(s, "y1", "3"), pt(s, "x2", "12"), pt(s, "y2", "15"), pt(e, "xmlns", "http://www.w3.org/2000/svg"), pt(e, "width", "90%"), pt(e, "height", "90%"), pt(e, "viewBox", "0 0 24 24"), pt(e, "fill", "none"), pt(e, "stroke", "currentColor"), pt(e, "stroke-width", "2"), pt(e, "stroke-linecap", "round"), pt(e, "stroke-linejoin", "round"), pt(e, "class", "feather feather-upload"); + bt(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), bt(i, "points", "17 8 12 3 7 8"), bt(s, "x1", "12"), bt(s, "y1", "3"), bt(s, "x2", "12"), bt(s, "y2", "15"), bt(e, "xmlns", "http://www.w3.org/2000/svg"), bt(e, "width", "90%"), bt(e, "height", "90%"), bt(e, "viewBox", "0 0 24 24"), bt(e, "fill", "none"), bt(e, "stroke", "currentColor"), bt(e, "stroke-width", "2"), bt(e, "stroke-linecap", "round"), bt(e, "stroke-linejoin", "round"), bt(e, "class", "feather feather-upload"); }, m(r, a) { - vA(r, e, a), bc(e, t), bc(e, i), bc(e, s); + wA(r, e, a), Uc(e, t), Uc(e, i), Uc(e, s); }, - p: Tc, - i: Tc, - o: Tc, + p: Gc, + i: Gc, + o: Gc, d(r) { - r && na(e); + r && ca(e); } }; } -let bA = class extends pA { +let kA = class extends xA { constructor(e) { - super(), _A(this, e, null, EA, yA, {}); + super(), DA(this, e, null, IA, LA, {}); } }; const { - SvelteComponent: TA, - append_hydration: lg, - attr: ut, - children: Sc, - claim_svg_element: Ac, - detach: Lo, - init: SA, - insert_hydration: AA, - noop: xc, - safe_not_equal: xA, - svg_element: Dc + SvelteComponent: RA, + append_hydration: bg, + attr: pt, + children: Hc, + claim_svg_element: Vc, + detach: jo, + init: CA, + insert_hydration: FA, + noop: qc, + safe_not_equal: PA, + svg_element: Kc } = window.__gradio__svelte__internal; -function DA(n) { +function OA(n) { let e, t, i; return { c() { - e = Dc("svg"), t = Dc("polygon"), i = Dc("rect"), this.h(); + e = Kc("svg"), t = Kc("polygon"), i = Kc("rect"), this.h(); }, l(s) { - e = Ac(s, "svg", { + e = Vc(s, "svg", { xmlns: !0, width: !0, height: !0, @@ -6282,190 +6241,295 @@ function DA(n) { "stroke-linejoin": !0, class: !0 }); - var r = Sc(e); - t = Ac(r, "polygon", { points: !0 }), Sc(t).forEach(Lo), i = Ac(r, "rect", { + var r = Hc(e); + t = Vc(r, "polygon", { points: !0 }), Hc(t).forEach(jo), i = Vc(r, "rect", { x: !0, y: !0, width: !0, height: !0, rx: !0, ry: !0 - }), Sc(i).forEach(Lo), r.forEach(Lo), this.h(); + }), Hc(i).forEach(jo), r.forEach(jo), this.h(); }, h() { - ut(t, "points", "23 7 16 12 23 17 23 7"), ut(i, "x", "1"), ut(i, "y", "5"), ut(i, "width", "15"), ut(i, "height", "14"), ut(i, "rx", "2"), ut(i, "ry", "2"), ut(e, "xmlns", "http://www.w3.org/2000/svg"), ut(e, "width", "100%"), ut(e, "height", "100%"), ut(e, "viewBox", "0 0 24 24"), ut(e, "fill", "none"), ut(e, "stroke", "currentColor"), ut(e, "stroke-width", "1.5"), ut(e, "stroke-linecap", "round"), ut(e, "stroke-linejoin", "round"), ut(e, "class", "feather feather-video"); + pt(t, "points", "23 7 16 12 23 17 23 7"), pt(i, "x", "1"), pt(i, "y", "5"), pt(i, "width", "15"), pt(i, "height", "14"), pt(i, "rx", "2"), pt(i, "ry", "2"), pt(e, "xmlns", "http://www.w3.org/2000/svg"), pt(e, "width", "100%"), pt(e, "height", "100%"), pt(e, "viewBox", "0 0 24 24"), pt(e, "fill", "none"), pt(e, "stroke", "currentColor"), pt(e, "stroke-width", "1.5"), pt(e, "stroke-linecap", "round"), pt(e, "stroke-linejoin", "round"), pt(e, "class", "feather feather-video"); }, m(s, r) { - AA(s, e, r), lg(e, t), lg(e, i); + FA(s, e, r), bg(e, t), bg(e, i); }, - p: xc, - i: xc, - o: xc, + p: qc, + i: qc, + o: qc, d(s) { - s && Lo(e); + s && jo(e); } }; } -let au = class extends TA { +let wu = class extends RA { constructor(e) { - super(), SA(this, e, null, DA, xA, {}); + super(), CA(this, e, null, OA, PA, {}); } }; const { - SvelteComponent: Y7, - append_hydration: X7, - attr: Q7, - children: Z7, - claim_svg_element: J7, - detach: eH, - init: tH, - insert_hydration: iH, - noop: nH, - safe_not_equal: sH, - svg_element: rH -} = window.__gradio__svelte__internal, { - SvelteComponent: aH, - append_hydration: oH, - attr: lH, - children: uH, - claim_svg_element: cH, - detach: hH, - init: dH, - insert_hydration: fH, - noop: mH, - safe_not_equal: gH, - svg_element: pH + SvelteComponent: FH, + append_hydration: PH, + attr: OH, + children: MH, + claim_svg_element: $H, + detach: BH, + init: NH, + insert_hydration: UH, + noop: GH, + safe_not_equal: HH, + svg_element: VH } = window.__gradio__svelte__internal, { - SvelteComponent: _H, - append_hydration: vH, - attr: yH, - children: EH, - claim_svg_element: bH, - claim_text: TH, - detach: SH, - init: AH, - insert_hydration: xH, - noop: DH, - safe_not_equal: wH, - svg_element: LH, - text: IH -} = window.__gradio__svelte__internal, { - SvelteComponent: kH, - append_hydration: RH, - attr: CH, - children: FH, - claim_svg_element: PH, - claim_text: OH, - detach: MH, - init: $H, - insert_hydration: BH, - noop: NH, - safe_not_equal: UH, - svg_element: GH, - text: HH -} = window.__gradio__svelte__internal, { - SvelteComponent: VH, - append_hydration: qH, - attr: KH, - children: jH, - claim_svg_element: zH, - claim_text: WH, + SvelteComponent: qH, + append_hydration: KH, + attr: jH, + children: zH, + claim_svg_element: WH, detach: YH, init: XH, insert_hydration: QH, noop: ZH, safe_not_equal: JH, - svg_element: eV, - text: tV + svg_element: eV } = window.__gradio__svelte__internal, { - SvelteComponent: iV, - append_hydration: nV, - attr: sV, - children: rV, - claim_svg_element: aV, + SvelteComponent: tV, + append_hydration: iV, + attr: nV, + children: sV, + claim_svg_element: rV, + claim_text: aV, detach: oV, init: lV, insert_hydration: uV, noop: cV, safe_not_equal: hV, - svg_element: dV + svg_element: dV, + text: fV +} = window.__gradio__svelte__internal, { + SvelteComponent: MA, + append_hydration: ha, + attr: lt, + children: da, + claim_svg_element: fa, + claim_text: $A, + detach: nr, + init: BA, + insert_hydration: NA, + noop: jc, + safe_not_equal: UA, + svg_element: ma, + text: GA +} = window.__gradio__svelte__internal; +function HA(n) { + let e, t, i, s, r, a; + return { + c() { + e = ma("svg"), t = ma("title"), i = GA("High volume"), s = ma("path"), r = ma("path"), a = ma("path"), this.h(); + }, + l(o) { + e = fa(o, "svg", { + width: !0, + height: !0, + viewBox: !0, + "stroke-width": !0, + fill: !0, + stroke: !0, + xmlns: !0, + color: !0 + }); + var u = da(e); + t = fa(u, "title", {}); + var l = da(t); + i = $A(l, "High volume"), l.forEach(nr), s = fa(u, "path", { d: !0, "stroke-width": !0 }), da(s).forEach(nr), r = fa(u, "path", { + d: !0, + "stroke-width": !0, + "stroke-linecap": !0, + "stroke-linejoin": !0 + }), da(r).forEach(nr), a = fa(u, "path", { + d: !0, + "stroke-width": !0, + "stroke-linecap": !0, + "stroke-linejoin": !0 + }), da(a).forEach(nr), u.forEach(nr), this.h(); + }, + h() { + lt(s, "d", "M1 13.8571V10.1429C1 9.03829 1.89543 8.14286 3 8.14286H5.9C6.09569 8.14286 6.28708 8.08544 6.45046 7.97772L12.4495 4.02228C13.1144 3.5839 14 4.06075 14 4.85714V19.1429C14 19.9392 13.1144 20.4161 12.4495 19.9777L6.45046 16.0223C6.28708 15.9146 6.09569 15.8571 5.9 15.8571H3C1.89543 15.8571 1 14.9617 1 13.8571Z"), lt(s, "stroke-width", "1.5"), lt(r, "d", "M17.5 7.5C17.5 7.5 19 9 19 11.5C19 14 17.5 15.5 17.5 15.5"), lt(r, "stroke-width", "1.5"), lt(r, "stroke-linecap", "round"), lt(r, "stroke-linejoin", "round"), lt(a, "d", "M20.5 4.5C20.5 4.5 23 7 23 11.5C23 16 20.5 18.5 20.5 18.5"), lt(a, "stroke-width", "1.5"), lt(a, "stroke-linecap", "round"), lt(a, "stroke-linejoin", "round"), lt(e, "width", "100%"), lt(e, "height", "100%"), lt(e, "viewBox", "0 0 24 24"), lt(e, "stroke-width", "1.5"), lt(e, "fill", "none"), lt(e, "stroke", "currentColor"), lt(e, "xmlns", "http://www.w3.org/2000/svg"), lt(e, "color", "currentColor"); + }, + m(o, u) { + NA(o, e, u), ha(e, t), ha(t, i), ha(e, s), ha(e, r), ha(e, a); + }, + p: jc, + i: jc, + o: jc, + d(o) { + o && nr(e); + } + }; +} +class Tg extends MA { + constructor(e) { + super(), BA(this, e, null, HA, UA, {}); + } +} +const { + SvelteComponent: VA, + append_hydration: On, + attr: et, + children: Mn, + claim_svg_element: $n, + claim_text: qA, + detach: _n, + init: KA, + insert_hydration: jA, + noop: zc, + safe_not_equal: zA, + svg_element: Bn, + text: WA +} = window.__gradio__svelte__internal; +function YA(n) { + let e, t, i, s, r, a, o, u, l; + return { + c() { + e = Bn("svg"), t = Bn("title"), i = WA("Muted volume"), s = Bn("g"), r = Bn("path"), a = Bn("path"), o = Bn("defs"), u = Bn("clipPath"), l = Bn("rect"), this.h(); + }, + l(c) { + e = $n(c, "svg", { + width: !0, + height: !0, + viewBox: !0, + "stroke-width": !0, + fill: !0, + xmlns: !0, + stroke: !0, + color: !0 + }); + var h = Mn(e); + t = $n(h, "title", {}); + var d = Mn(t); + i = qA(d, "Muted volume"), d.forEach(_n), s = $n(h, "g", { "clip-path": !0 }); + var f = Mn(s); + r = $n(f, "path", { + d: !0, + "stroke-width": !0, + "stroke-linecap": !0, + "stroke-linejoin": !0 + }), Mn(r).forEach(_n), a = $n(f, "path", { d: !0, "stroke-width": !0 }), Mn(a).forEach(_n), f.forEach(_n), o = $n(h, "defs", {}); + var m = Mn(o); + u = $n(m, "clipPath", { id: !0 }); + var g = Mn(u); + l = $n(g, "rect", { width: !0, height: !0, fill: !0 }), Mn(l).forEach(_n), g.forEach(_n), m.forEach(_n), h.forEach(_n), this.h(); + }, + h() { + et(r, "d", "M18 14L20.0005 12M22 10L20.0005 12M20.0005 12L18 10M20.0005 12L22 14"), et(r, "stroke-width", "1.5"), et(r, "stroke-linecap", "round"), et(r, "stroke-linejoin", "round"), et(a, "d", "M2 13.8571V10.1429C2 9.03829 2.89543 8.14286 4 8.14286H6.9C7.09569 8.14286 7.28708 8.08544 7.45046 7.97772L13.4495 4.02228C14.1144 3.5839 15 4.06075 15 4.85714V19.1429C15 19.9392 14.1144 20.4161 13.4495 19.9777L7.45046 16.0223C7.28708 15.9146 7.09569 15.8571 6.9 15.8571H4C2.89543 15.8571 2 14.9617 2 13.8571Z"), et(a, "stroke-width", "1.5"), et(s, "clip-path", "url(#clip0_3173_16686)"), et(l, "width", "24"), et(l, "height", "24"), et(l, "fill", "white"), et(u, "id", "clip0_3173_16686"), et(e, "width", "100%"), et(e, "height", "100%"), et(e, "viewBox", "0 0 24 24"), et(e, "stroke-width", "1.5"), et(e, "fill", "none"), et(e, "xmlns", "http://www.w3.org/2000/svg"), et(e, "stroke", "currentColor"), et(e, "color", "currentColor"); + }, + m(c, h) { + jA(c, e, h), On(e, t), On(t, i), On(e, s), On(s, r), On(s, a), On(e, o), On(o, u), On(u, l); + }, + p: zc, + i: zc, + o: zc, + d(c) { + c && _n(e); + } + }; +} +class Sg extends VA { + constructor(e) { + super(), KA(this, e, null, YA, zA, {}); + } +} +const { + SvelteComponent: mV, + append_hydration: gV, + attr: pV, + children: _V, + claim_svg_element: vV, + detach: yV, + init: EV, + insert_hydration: bV, + noop: TV, + safe_not_equal: SV, + svg_element: AV } = window.__gradio__svelte__internal, { - SvelteComponent: wA, - append_hydration: ug, - attr: Rn, - children: wc, - claim_svg_element: Lc, - detach: Io, - init: LA, - insert_hydration: IA, - noop: Ic, - safe_not_equal: kA, - svg_element: kc + SvelteComponent: XA, + append_hydration: Ag, + attr: Nn, + children: Wc, + claim_svg_element: Yc, + detach: zo, + init: QA, + insert_hydration: ZA, + noop: Xc, + safe_not_equal: JA, + svg_element: Qc } = window.__gradio__svelte__internal; -function RA(n) { +function ex(n) { let e, t, i; return { c() { - e = kc("svg"), t = kc("path"), i = kc("path"), this.h(); + e = Qc("svg"), t = Qc("path"), i = Qc("path"), this.h(); }, l(s) { - e = Lc(s, "svg", { + e = Yc(s, "svg", { xmlns: !0, width: !0, height: !0, viewBox: !0 }); - var r = wc(e); - t = Lc(r, "path", { fill: !0, d: !0 }), wc(t).forEach(Io), i = Lc(r, "path", { fill: !0, d: !0 }), wc(i).forEach(Io), r.forEach(Io), this.h(); + var r = Wc(e); + t = Yc(r, "path", { fill: !0, d: !0 }), Wc(t).forEach(zo), i = Yc(r, "path", { fill: !0, d: !0 }), Wc(i).forEach(zo), r.forEach(zo), this.h(); }, h() { - Rn(t, "fill", "currentColor"), Rn(t, "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"), Rn(i, "fill", "currentColor"), Rn(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"), Rn(e, "xmlns", "http://www.w3.org/2000/svg"), Rn(e, "width", "100%"), Rn(e, "height", "100%"), Rn(e, "viewBox", "0 0 24 24"); + Nn(t, "fill", "currentColor"), Nn(t, "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"), Nn(i, "fill", "currentColor"), Nn(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"), Nn(e, "xmlns", "http://www.w3.org/2000/svg"), Nn(e, "width", "100%"), Nn(e, "height", "100%"), Nn(e, "viewBox", "0 0 24 24"); }, m(s, r) { - IA(s, e, r), ug(e, t), ug(e, i); + ZA(s, e, r), Ag(e, t), Ag(e, i); }, - p: Ic, - i: Ic, - o: Ic, + p: Xc, + i: Xc, + o: Xc, d(s) { - s && Io(e); + s && zo(e); } }; } -let uv = class extends wA { +let xv = class extends XA { constructor(e) { - super(), LA(this, e, null, RA, kA, {}); + super(), QA(this, e, null, ex, JA, {}); } }; const { - SvelteComponent: CA, - append_hydration: cg, - attr: it, - children: Rc, - claim_svg_element: Cc, - detach: ko, - init: FA, - insert_hydration: PA, - noop: Fc, - safe_not_equal: OA, - svg_element: Pc + SvelteComponent: tx, + append_hydration: xg, + attr: ut, + children: Zc, + claim_svg_element: Jc, + detach: Wo, + init: ix, + insert_hydration: nx, + noop: eh, + safe_not_equal: sx, + svg_element: th } = window.__gradio__svelte__internal; -function MA(n) { +function rx(n) { let e, t, i; return { c() { - e = Pc("svg"), t = Pc("circle"), i = Pc("animateTransform"), this.h(); + e = th("svg"), t = th("circle"), i = th("animateTransform"), this.h(); }, l(s) { - e = Cc(s, "svg", { + e = Jc(s, "svg", { xmlns: !0, width: !0, height: !0, viewBox: !0, class: !0 }); - var r = Rc(e); - t = Cc(r, "circle", { + var r = Zc(e); + t = Jc(r, "circle", { cx: !0, cy: !0, r: !0, @@ -6475,95 +6539,95 @@ function MA(n) { "stroke-dasharray": !0, "stroke-dashoffset": !0 }); - var a = Rc(t); - i = Cc(a, "animateTransform", { + var a = Zc(t); + i = Jc(a, "animateTransform", { attributeName: !0, type: !0, from: !0, to: !0, repeatCount: !0 - }), Rc(i).forEach(ko), a.forEach(ko), r.forEach(ko), this.h(); + }), Zc(i).forEach(Wo), a.forEach(Wo), r.forEach(Wo), this.h(); }, h() { - it(i, "attributeName", "transform"), it(i, "type", "rotate"), it(i, "from", "0 25 25"), it(i, "to", "360 25 25"), it(i, "repeatCount", "indefinite"), it(t, "cx", "25"), it(t, "cy", "25"), it(t, "r", "20"), it(t, "fill", "none"), it(t, "stroke-width", "3.0"), it(t, "stroke-linecap", "round"), it(t, "stroke-dasharray", "94.2477796076938 94.2477796076938"), it(t, "stroke-dashoffset", "0"), it(e, "xmlns", "http://www.w3.org/2000/svg"), it(e, "width", "100%"), it(e, "height", "100%"), it(e, "viewBox", "0 0 50 50"), it(e, "class", "svelte-pb9pol"); + ut(i, "attributeName", "transform"), ut(i, "type", "rotate"), ut(i, "from", "0 25 25"), ut(i, "to", "360 25 25"), ut(i, "repeatCount", "indefinite"), ut(t, "cx", "25"), ut(t, "cy", "25"), ut(t, "r", "20"), ut(t, "fill", "none"), ut(t, "stroke-width", "3.0"), ut(t, "stroke-linecap", "round"), ut(t, "stroke-dasharray", "94.2477796076938 94.2477796076938"), ut(t, "stroke-dashoffset", "0"), ut(e, "xmlns", "http://www.w3.org/2000/svg"), ut(e, "width", "100%"), ut(e, "height", "100%"), ut(e, "viewBox", "0 0 50 50"), ut(e, "class", "svelte-pb9pol"); }, m(s, r) { - PA(s, e, r), cg(e, t), cg(t, i); + nx(s, e, r), xg(e, t), xg(t, i); }, - p: Fc, - i: Fc, - o: Fc, + p: eh, + i: eh, + o: eh, d(s) { - s && ko(e); + s && Wo(e); } }; } -class $A extends CA { +class ax extends tx { constructor(e) { - super(), FA(this, e, null, MA, OA, {}); + super(), ix(this, e, null, rx, sx, {}); } } const { - SvelteComponent: mV, - append_hydration: gV, - attr: pV, - children: _V, - claim_svg_element: vV, - detach: yV, - init: EV, - insert_hydration: bV, - noop: TV, - safe_not_equal: SV, - svg_element: AV + SvelteComponent: DV, + append_hydration: wV, + attr: LV, + children: IV, + claim_svg_element: kV, + detach: RV, + init: CV, + insert_hydration: FV, + noop: PV, + safe_not_equal: OV, + svg_element: MV } = window.__gradio__svelte__internal, { - SvelteComponent: xV, - append_hydration: DV, - attr: wV, - children: LV, - claim_svg_element: IV, - detach: kV, - init: RV, - insert_hydration: CV, - noop: FV, - safe_not_equal: PV, - svg_element: OV + SvelteComponent: $V, + append_hydration: BV, + attr: NV, + children: UV, + claim_svg_element: GV, + detach: HV, + init: VV, + insert_hydration: qV, + noop: KV, + safe_not_equal: jV, + svg_element: zV } = window.__gradio__svelte__internal, { - SvelteComponent: MV, - append_hydration: $V, - attr: BV, - children: NV, - claim_svg_element: UV, - detach: GV, - init: HV, - insert_hydration: VV, - noop: qV, - safe_not_equal: KV, - svg_element: jV + SvelteComponent: WV, + append_hydration: YV, + attr: XV, + children: QV, + claim_svg_element: ZV, + detach: JV, + init: eq, + insert_hydration: tq, + noop: iq, + safe_not_equal: nq, + svg_element: sq } = window.__gradio__svelte__internal, { - SvelteComponent: zV, - append_hydration: WV, - attr: YV, - children: XV, - claim_svg_element: QV, - detach: ZV, - init: JV, - insert_hydration: eq, - noop: tq, - safe_not_equal: iq, - svg_element: nq + SvelteComponent: rq, + append_hydration: aq, + attr: oq, + children: lq, + claim_svg_element: uq, + detach: cq, + init: hq, + insert_hydration: dq, + noop: fq, + safe_not_equal: mq, + svg_element: gq } = window.__gradio__svelte__internal, { - SvelteComponent: sq, - append_hydration: rq, - attr: aq, - children: oq, - claim_svg_element: lq, - detach: uq, - init: cq, - insert_hydration: hq, - noop: dq, - safe_not_equal: fq, - svg_element: mq -} = window.__gradio__svelte__internal, BA = [ + SvelteComponent: pq, + append_hydration: _q, + attr: vq, + children: yq, + claim_svg_element: Eq, + detach: bq, + init: Tq, + insert_hydration: Sq, + noop: Aq, + safe_not_equal: xq, + svg_element: Dq +} = window.__gradio__svelte__internal, ox = [ { color: "red", primary: 600, secondary: 100 }, { color: "green", primary: 600, secondary: 100 }, { color: "blue", primary: 600, secondary: 100 }, @@ -6574,7 +6638,7 @@ const { { color: "cyan", primary: 600, secondary: 100 }, { color: "lime", primary: 500, secondary: 100 }, { color: "pink", primary: 600, secondary: 100 } -], hg = { +], Dg = { inherit: "inherit", current: "currentColor", transparent: "transparent", @@ -6867,98 +6931,98 @@ const { 950: "#4c0519" } }; -BA.reduce( +ox.reduce( (n, { color: e, primary: t, secondary: i }) => ({ ...n, [e]: { - primary: hg[e][t], - secondary: hg[e][i] + primary: Dg[e][t], + secondary: Dg[e][i] } }), {} ); -const sr = (n) => { +const pr = (n) => { const e = Math.floor(n / 3600), t = Math.floor(n % 3600 / 60), i = Math.round(n) % 60, s = `${t < 10 ? "0" : ""}${t}`, r = `${i < 10 ? "0" : ""}${i}`; return e > 0 ? `${e}:${s}:${r}` : `${t}:${r}`; }, { - SvelteComponent: gq, - claim_component: pq, - create_component: _q, - destroy_component: vq, - init: yq, - mount_component: Eq, - safe_not_equal: bq, - transition_in: Tq, - transition_out: Sq -} = window.__gradio__svelte__internal, { createEventDispatcher: Aq } = window.__gradio__svelte__internal, { - SvelteComponent: xq, - append_hydration: Dq, - attr: wq, - check_outros: Lq, - children: Iq, - claim_component: kq, - claim_element: Rq, - claim_space: Cq, - claim_text: Fq, - create_component: Pq, - destroy_component: Oq, - detach: Mq, - element: $q, - empty: Bq, - group_outros: Nq, - init: Uq, - insert_hydration: Gq, - mount_component: Hq, - safe_not_equal: Vq, - set_data: qq, - space: Kq, - text: jq, - toggle_class: zq, - transition_in: Wq, - transition_out: Yq + SvelteComponent: wq, + claim_component: Lq, + create_component: Iq, + destroy_component: kq, + init: Rq, + mount_component: Cq, + safe_not_equal: Fq, + transition_in: Pq, + transition_out: Oq +} = window.__gradio__svelte__internal, { createEventDispatcher: Mq } = window.__gradio__svelte__internal, { + SvelteComponent: $q, + append_hydration: Bq, + attr: Nq, + check_outros: Uq, + children: Gq, + claim_component: Hq, + claim_element: Vq, + claim_space: qq, + claim_text: Kq, + create_component: jq, + destroy_component: zq, + detach: Wq, + element: Yq, + empty: Xq, + group_outros: Qq, + init: Zq, + insert_hydration: Jq, + mount_component: eK, + safe_not_equal: tK, + set_data: iK, + space: nK, + text: sK, + toggle_class: rK, + transition_in: aK, + transition_out: oK } = window.__gradio__svelte__internal, { - SvelteComponent: Xq, - attr: Qq, - children: Zq, - claim_element: Jq, - create_slot: eK, - detach: tK, - element: iK, - get_all_dirty_from_scope: nK, - get_slot_changes: sK, - init: rK, - insert_hydration: aK, - safe_not_equal: oK, - toggle_class: lK, - transition_in: uK, - transition_out: cK, - update_slot_base: hK + SvelteComponent: lK, + attr: uK, + children: cK, + claim_element: hK, + create_slot: dK, + detach: fK, + element: mK, + get_all_dirty_from_scope: gK, + get_slot_changes: pK, + init: _K, + insert_hydration: vK, + safe_not_equal: yK, + toggle_class: EK, + transition_in: bK, + transition_out: TK, + update_slot_base: SK } = window.__gradio__svelte__internal, { - SvelteComponent: NA, - append_hydration: Oc, - attr: on, - check_outros: fa, - children: Ja, - claim_component: ou, - claim_element: eo, - claim_space: Mc, - create_component: lu, - destroy_component: uu, - detach: wi, - element: to, - empty: dg, - group_outros: ma, - init: UA, - insert_hydration: Ur, - listen: cu, - mount_component: hu, - safe_not_equal: GA, - space: $c, - toggle_class: Xn, - transition_in: Qe, - transition_out: Ft + SvelteComponent: lx, + append_hydration: ih, + attr: cn, + check_outros: Aa, + children: mo, + claim_component: Lu, + claim_element: go, + claim_space: nh, + create_component: Iu, + destroy_component: ku, + detach: $i, + element: po, + empty: wg, + group_outros: xa, + init: ux, + insert_hydration: zr, + listen: Ru, + mount_component: Cu, + safe_not_equal: cx, + space: sh, + toggle_class: is, + transition_in: it, + transition_out: $t } = window.__gradio__svelte__internal; -function fg(n) { +function Lg(n) { let e, t = ( /*sources*/ n[1].includes("upload") @@ -6971,69 +7035,69 @@ function fg(n) { ), o, u = ( /*sources*/ n[1].includes("clipboard") - ), l, c = t && mg(n), h = s && gg(n), d = a && pg(n), f = u && _g(n); + ), l, c = t && Ig(n), h = s && kg(n), d = a && Rg(n), f = u && Cg(n); return { c() { - e = to("span"), c && c.c(), i = $c(), h && h.c(), r = $c(), d && d.c(), o = $c(), f && f.c(), this.h(); + e = po("span"), c && c.c(), i = sh(), h && h.c(), r = sh(), d && d.c(), o = sh(), f && f.c(), this.h(); }, l(m) { - e = eo(m, "SPAN", { class: !0, "data-testid": !0 }); - var g = Ja(e); - c && c.l(g), i = Mc(g), h && h.l(g), r = Mc(g), d && d.l(g), o = Mc(g), f && f.l(g), g.forEach(wi), this.h(); + e = go(m, "SPAN", { class: !0, "data-testid": !0 }); + var g = mo(e); + c && c.l(g), i = nh(g), h && h.l(g), r = nh(g), d && d.l(g), o = nh(g), f && f.l(g), g.forEach($i), this.h(); }, h() { - on(e, "class", "source-selection svelte-15ls1gu"), on(e, "data-testid", "source-select"); + cn(e, "class", "source-selection svelte-15ls1gu"), cn(e, "data-testid", "source-select"); }, m(m, g) { - Ur(m, e, g), c && c.m(e, null), Oc(e, i), h && h.m(e, null), Oc(e, r), d && d.m(e, null), Oc(e, o), f && f.m(e, null), l = !0; + zr(m, e, g), c && c.m(e, null), ih(e, i), h && h.m(e, null), ih(e, r), d && d.m(e, null), ih(e, o), f && f.m(e, null), l = !0; }, p(m, g) { g & /*sources*/ 2 && (t = /*sources*/ m[1].includes("upload")), t ? c ? (c.p(m, g), g & /*sources*/ - 2 && Qe(c, 1)) : (c = mg(m), c.c(), Qe(c, 1), c.m(e, i)) : c && (ma(), Ft(c, 1, 1, () => { + 2 && it(c, 1)) : (c = Ig(m), c.c(), it(c, 1), c.m(e, i)) : c && (xa(), $t(c, 1, 1, () => { c = null; - }), fa()), g & /*sources*/ + }), Aa()), g & /*sources*/ 2 && (s = /*sources*/ m[1].includes("microphone")), s ? h ? (h.p(m, g), g & /*sources*/ - 2 && Qe(h, 1)) : (h = gg(m), h.c(), Qe(h, 1), h.m(e, r)) : h && (ma(), Ft(h, 1, 1, () => { + 2 && it(h, 1)) : (h = kg(m), h.c(), it(h, 1), h.m(e, r)) : h && (xa(), $t(h, 1, 1, () => { h = null; - }), fa()), g & /*sources*/ + }), Aa()), g & /*sources*/ 2 && (a = /*sources*/ m[1].includes("webcam")), a ? d ? (d.p(m, g), g & /*sources*/ - 2 && Qe(d, 1)) : (d = pg(m), d.c(), Qe(d, 1), d.m(e, o)) : d && (ma(), Ft(d, 1, 1, () => { + 2 && it(d, 1)) : (d = Rg(m), d.c(), it(d, 1), d.m(e, o)) : d && (xa(), $t(d, 1, 1, () => { d = null; - }), fa()), g & /*sources*/ + }), Aa()), g & /*sources*/ 2 && (u = /*sources*/ m[1].includes("clipboard")), u ? f ? (f.p(m, g), g & /*sources*/ - 2 && Qe(f, 1)) : (f = _g(m), f.c(), Qe(f, 1), f.m(e, null)) : f && (ma(), Ft(f, 1, 1, () => { + 2 && it(f, 1)) : (f = Cg(m), f.c(), it(f, 1), f.m(e, null)) : f && (xa(), $t(f, 1, 1, () => { f = null; - }), fa()); + }), Aa()); }, i(m) { - l || (Qe(c), Qe(h), Qe(d), Qe(f), l = !0); + l || (it(c), it(h), it(d), it(f), l = !0); }, o(m) { - Ft(c), Ft(h), Ft(d), Ft(f), l = !1; + $t(c), $t(h), $t(d), $t(f), l = !1; }, d(m) { - m && wi(e), c && c.d(), h && h.d(), d && d.d(), f && f.d(); + m && $i(e), c && c.d(), h && h.d(), d && d.d(), f && f.d(); } }; } -function mg(n) { +function Ig(n) { let e, t, i, s, r; - return t = new bA({}), { + return t = new kA({}), { c() { - e = to("button"), lu(t.$$.fragment), this.h(); + e = po("button"), Iu(t.$$.fragment), this.h(); }, l(a) { - e = eo(a, "BUTTON", { class: !0, "aria-label": !0 }); - var o = Ja(e); - ou(t.$$.fragment, o), o.forEach(wi), this.h(); + e = go(a, "BUTTON", { class: !0, "aria-label": !0 }); + var o = mo(e); + Lu(t.$$.fragment, o), o.forEach($i), this.h(); }, h() { - on(e, "class", "icon svelte-15ls1gu"), on(e, "aria-label", "Upload file"), Xn( + cn(e, "class", "icon svelte-15ls1gu"), cn(e, "aria-label", "Upload file"), is( e, "selected", /*active_source*/ @@ -7042,7 +7106,7 @@ function mg(n) { ); }, m(a, o) { - Ur(a, e, o), hu(t, e, null), i = !0, s || (r = cu( + zr(a, e, o), Cu(t, e, null), i = !0, s || (r = Ru( e, "click", /*click_handler*/ @@ -7051,7 +7115,7 @@ function mg(n) { }, p(a, o) { (!i || o & /*active_source*/ - 1) && Xn( + 1) && is( e, "selected", /*active_source*/ @@ -7060,29 +7124,29 @@ function mg(n) { ); }, i(a) { - i || (Qe(t.$$.fragment, a), i = !0); + i || (it(t.$$.fragment, a), i = !0); }, o(a) { - Ft(t.$$.fragment, a), i = !1; + $t(t.$$.fragment, a), i = !1; }, d(a) { - a && wi(e), uu(t), s = !1, r(); + a && $i(e), ku(t), s = !1, r(); } }; } -function gg(n) { +function kg(n) { let e, t, i, s, r; - return t = new kS({}), { + return t = new NS({}), { c() { - e = to("button"), lu(t.$$.fragment), this.h(); + e = po("button"), Iu(t.$$.fragment), this.h(); }, l(a) { - e = eo(a, "BUTTON", { class: !0, "aria-label": !0 }); - var o = Ja(e); - ou(t.$$.fragment, o), o.forEach(wi), this.h(); + e = go(a, "BUTTON", { class: !0, "aria-label": !0 }); + var o = mo(e); + Lu(t.$$.fragment, o), o.forEach($i), this.h(); }, h() { - on(e, "class", "icon svelte-15ls1gu"), on(e, "aria-label", "Record audio"), Xn( + cn(e, "class", "icon svelte-15ls1gu"), cn(e, "aria-label", "Record audio"), is( e, "selected", /*active_source*/ @@ -7090,7 +7154,7 @@ function gg(n) { ); }, m(a, o) { - Ur(a, e, o), hu(t, e, null), i = !0, s || (r = cu( + zr(a, e, o), Cu(t, e, null), i = !0, s || (r = Ru( e, "click", /*click_handler_1*/ @@ -7099,7 +7163,7 @@ function gg(n) { }, p(a, o) { (!i || o & /*active_source*/ - 1) && Xn( + 1) && is( e, "selected", /*active_source*/ @@ -7107,29 +7171,29 @@ function gg(n) { ); }, i(a) { - i || (Qe(t.$$.fragment, a), i = !0); + i || (it(t.$$.fragment, a), i = !0); }, o(a) { - Ft(t.$$.fragment, a), i = !1; + $t(t.$$.fragment, a), i = !1; }, d(a) { - a && wi(e), uu(t), s = !1, r(); + a && $i(e), ku(t), s = !1, r(); } }; } -function pg(n) { +function Rg(n) { let e, t, i, s, r; - return t = new uv({}), { + return t = new xv({}), { c() { - e = to("button"), lu(t.$$.fragment), this.h(); + e = po("button"), Iu(t.$$.fragment), this.h(); }, l(a) { - e = eo(a, "BUTTON", { class: !0, "aria-label": !0 }); - var o = Ja(e); - ou(t.$$.fragment, o), o.forEach(wi), this.h(); + e = go(a, "BUTTON", { class: !0, "aria-label": !0 }); + var o = mo(e); + Lu(t.$$.fragment, o), o.forEach($i), this.h(); }, h() { - on(e, "class", "icon svelte-15ls1gu"), on(e, "aria-label", "Capture from camera"), Xn( + cn(e, "class", "icon svelte-15ls1gu"), cn(e, "aria-label", "Capture from camera"), is( e, "selected", /*active_source*/ @@ -7137,7 +7201,7 @@ function pg(n) { ); }, m(a, o) { - Ur(a, e, o), hu(t, e, null), i = !0, s || (r = cu( + zr(a, e, o), Cu(t, e, null), i = !0, s || (r = Ru( e, "click", /*click_handler_2*/ @@ -7146,7 +7210,7 @@ function pg(n) { }, p(a, o) { (!i || o & /*active_source*/ - 1) && Xn( + 1) && is( e, "selected", /*active_source*/ @@ -7154,29 +7218,29 @@ function pg(n) { ); }, i(a) { - i || (Qe(t.$$.fragment, a), i = !0); + i || (it(t.$$.fragment, a), i = !0); }, o(a) { - Ft(t.$$.fragment, a), i = !1; + $t(t.$$.fragment, a), i = !1; }, d(a) { - a && wi(e), uu(t), s = !1, r(); + a && $i(e), ku(t), s = !1, r(); } }; } -function _g(n) { +function Cg(n) { let e, t, i, s, r; - return t = new _S({}), { + return t = new FS({}), { c() { - e = to("button"), lu(t.$$.fragment), this.h(); + e = po("button"), Iu(t.$$.fragment), this.h(); }, l(a) { - e = eo(a, "BUTTON", { class: !0, "aria-label": !0 }); - var o = Ja(e); - ou(t.$$.fragment, o), o.forEach(wi), this.h(); + e = go(a, "BUTTON", { class: !0, "aria-label": !0 }); + var o = mo(e); + Lu(t.$$.fragment, o), o.forEach($i), this.h(); }, h() { - on(e, "class", "icon svelte-15ls1gu"), on(e, "aria-label", "Paste from clipboard"), Xn( + cn(e, "class", "icon svelte-15ls1gu"), cn(e, "aria-label", "Paste from clipboard"), is( e, "selected", /*active_source*/ @@ -7184,7 +7248,7 @@ function _g(n) { ); }, m(a, o) { - Ur(a, e, o), hu(t, e, null), i = !0, s || (r = cu( + zr(a, e, o), Cu(t, e, null), i = !0, s || (r = Ru( e, "click", /*click_handler_3*/ @@ -7193,7 +7257,7 @@ function _g(n) { }, p(a, o) { (!i || o & /*active_source*/ - 1) && Xn( + 1) && is( e, "selected", /*active_source*/ @@ -7201,50 +7265,50 @@ function _g(n) { ); }, i(a) { - i || (Qe(t.$$.fragment, a), i = !0); + i || (it(t.$$.fragment, a), i = !0); }, o(a) { - Ft(t.$$.fragment, a), i = !1; + $t(t.$$.fragment, a), i = !1; }, d(a) { - a && wi(e), uu(t), s = !1, r(); + a && $i(e), ku(t), s = !1, r(); } }; } -function HA(n) { +function hx(n) { let e, t, i = ( /*unique_sources*/ - n[2].length > 1 && fg(n) + n[2].length > 1 && Lg(n) ); return { c() { - i && i.c(), e = dg(); + i && i.c(), e = wg(); }, l(s) { - i && i.l(s), e = dg(); + i && i.l(s), e = wg(); }, m(s, r) { - i && i.m(s, r), Ur(s, e, r), t = !0; + i && i.m(s, r), zr(s, e, r), t = !0; }, p(s, [r]) { /*unique_sources*/ s[2].length > 1 ? i ? (i.p(s, r), r & /*unique_sources*/ - 4 && Qe(i, 1)) : (i = fg(s), i.c(), Qe(i, 1), i.m(e.parentNode, e)) : i && (ma(), Ft(i, 1, 1, () => { + 4 && it(i, 1)) : (i = Lg(s), i.c(), it(i, 1), i.m(e.parentNode, e)) : i && (xa(), $t(i, 1, 1, () => { i = null; - }), fa()); + }), Aa()); }, i(s) { - t || (Qe(i), t = !0); + t || (it(i), t = !0); }, o(s) { - Ft(i), t = !1; + $t(i), t = !1; }, d(s) { - s && wi(e), i && i.d(s); + s && $i(e), i && i.d(s); } }; } -function VA(n, e, t) { +function dx(n, e, t) { let i; var s = this && this.__awaiter || function(m, g, p, y) { function v(_) { @@ -7256,19 +7320,19 @@ function VA(n, e, t) { function T(D) { try { S(y.next(D)); - } catch (x) { - E(x); + } catch (A) { + E(A); } } - function A(D) { + function x(D) { try { S(y.throw(D)); - } catch (x) { - E(x); + } catch (A) { + E(A); } } function S(D) { - D.done ? _(D.value) : v(D.value).then(T, A); + D.done ? _(D.value) : v(D.value).then(T, x); } S((y = y.apply(m, g || [])).next()); }); @@ -7300,9 +7364,9 @@ function VA(n, e, t) { f ]; } -class qA extends NA { +class fx extends lx { constructor(e) { - super(), UA(this, e, VA, HA, GA, { + super(), ux(this, e, dx, hx, cx, { sources: 1, active_source: 0, handle_clear: 4, @@ -7311,29 +7375,29 @@ class qA extends NA { } } const { - SvelteComponent: KA, - attr: vg, - children: jA, - claim_element: zA, - create_slot: WA, - detach: yg, - element: YA, - get_all_dirty_from_scope: XA, - get_slot_changes: QA, - init: ZA, - insert_hydration: JA, - null_to_empty: Eg, - safe_not_equal: ex, - transition_in: tx, - transition_out: ix, - update_slot_base: nx + SvelteComponent: mx, + attr: Fg, + children: gx, + claim_element: px, + create_slot: _x, + detach: Pg, + element: vx, + get_all_dirty_from_scope: yx, + get_slot_changes: Ex, + init: bx, + insert_hydration: Tx, + null_to_empty: Og, + safe_not_equal: Sx, + transition_in: Ax, + transition_out: xx, + update_slot_base: Dx } = window.__gradio__svelte__internal; -function sx(n) { +function wx(n) { let e, t, i; const s = ( /*#slots*/ n[3].default - ), r = WA( + ), r = _x( s, n, /*$$scope*/ @@ -7342,119 +7406,119 @@ function sx(n) { ); return { c() { - e = YA("div"), r && r.c(), this.h(); + e = vx("div"), r && r.c(), this.h(); }, l(a) { - e = zA(a, "DIV", { class: !0 }); - var o = jA(e); - r && r.l(o), o.forEach(yg), this.h(); + e = px(a, "DIV", { class: !0 }); + var o = gx(e); + r && r.l(o), o.forEach(Pg), this.h(); }, h() { - vg(e, "class", t = Eg(`icon-button-wrapper ${/*top_panel*/ + Fg(e, "class", t = Og(`icon-button-wrapper ${/*top_panel*/ n[0] ? "top-panel" : ""} ${/*display_top_corner*/ n[1] ? "display-top-corner" : "hide-top-corner"}`) + " svelte-109se4"); }, m(a, o) { - JA(a, e, o), r && r.m(e, null), i = !0; + Tx(a, e, o), r && r.m(e, null), i = !0; }, p(a, [o]) { r && r.p && (!i || o & /*$$scope*/ - 4) && nx( + 4) && Dx( r, s, a, /*$$scope*/ a[2], - i ? QA( + i ? Ex( s, /*$$scope*/ a[2], o, null - ) : XA( + ) : yx( /*$$scope*/ a[2] ), null ), (!i || o & /*top_panel, display_top_corner*/ - 3 && t !== (t = Eg(`icon-button-wrapper ${/*top_panel*/ + 3 && t !== (t = Og(`icon-button-wrapper ${/*top_panel*/ a[0] ? "top-panel" : ""} ${/*display_top_corner*/ - a[1] ? "display-top-corner" : "hide-top-corner"}`) + " svelte-109se4")) && vg(e, "class", t); + a[1] ? "display-top-corner" : "hide-top-corner"}`) + " svelte-109se4")) && Fg(e, "class", t); }, i(a) { - i || (tx(r, a), i = !0); + i || (Ax(r, a), i = !0); }, o(a) { - ix(r, a), i = !1; + xx(r, a), i = !1; }, d(a) { - a && yg(e), r && r.d(a); + a && Pg(e), r && r.d(a); } }; } -function rx(n, e, t) { +function Lx(n, e, t) { let { $$slots: i = {}, $$scope: s } = e, { top_panel: r = !0 } = e, { display_top_corner: a = !1 } = e; return n.$$set = (o) => { "top_panel" in o && t(0, r = o.top_panel), "display_top_corner" in o && t(1, a = o.display_top_corner), "$$scope" in o && t(2, s = o.$$scope); }, [r, a, s, i]; } -class cv extends KA { +class Dv extends mx { constructor(e) { - super(), ZA(this, e, rx, sx, ex, { top_panel: 0, display_top_corner: 1 }); + super(), bx(this, e, Lx, wx, Sx, { top_panel: 0, display_top_corner: 1 }); } } const { - SvelteComponent: ax, - check_outros: ox, - claim_component: hv, - create_component: dv, - destroy_component: fv, - detach: lx, - empty: bg, - group_outros: ux, - init: cx, - insert_hydration: hx, - mount_component: mv, - noop: gv, - safe_not_equal: dx, - transition_in: Il, - transition_out: kl -} = window.__gradio__svelte__internal, { createEventDispatcher: fx } = window.__gradio__svelte__internal; -function mx(n) { + SvelteComponent: Ix, + check_outros: kx, + claim_component: wv, + create_component: Lv, + destroy_component: Iv, + detach: Rx, + empty: Mg, + group_outros: Cx, + init: Fx, + insert_hydration: Px, + mount_component: kv, + noop: Rv, + safe_not_equal: Ox, + transition_in: zl, + transition_out: Wl +} = window.__gradio__svelte__internal, { createEventDispatcher: Mx } = window.__gradio__svelte__internal; +function $x(n) { let e, t; - return e = new Ci({ - props: { Icon: cS, label: "Fullscreen" } + return e = new vi({ + props: { Icon: DS, label: "Fullscreen" } }), e.$on( "click", /*click_handler_1*/ n[3] ), { c() { - dv(e.$$.fragment); + Lv(e.$$.fragment); }, l(i) { - hv(e.$$.fragment, i); + wv(e.$$.fragment, i); }, m(i, s) { - mv(e, i, s), t = !0; + kv(e, i, s), t = !0; }, - p: gv, + p: Rv, i(i) { - t || (Il(e.$$.fragment, i), t = !0); + t || (zl(e.$$.fragment, i), t = !0); }, o(i) { - kl(e.$$.fragment, i), t = !1; + Wl(e.$$.fragment, i), t = !1; }, d(i) { - fv(e, i); + Iv(e, i); } }; } -function gx(n) { +function Bx(n) { let e, t; - return e = new Ci({ + return e = new vi({ props: { - Icon: $S, + Icon: jS, label: "Exit fullscreen mode" } }), e.$on( @@ -7463,29 +7527,29 @@ function gx(n) { n[2] ), { c() { - dv(e.$$.fragment); + Lv(e.$$.fragment); }, l(i) { - hv(e.$$.fragment, i); + wv(e.$$.fragment, i); }, m(i, s) { - mv(e, i, s), t = !0; + kv(e, i, s), t = !0; }, - p: gv, + p: Rv, i(i) { - t || (Il(e.$$.fragment, i), t = !0); + t || (zl(e.$$.fragment, i), t = !0); }, o(i) { - kl(e.$$.fragment, i), t = !1; + Wl(e.$$.fragment, i), t = !1; }, d(i) { - fv(e, i); + Iv(e, i); } }; } -function px(n) { +function Nx(n) { let e, t, i, s; - const r = [gx, mx], a = []; + const r = [Bx, $x], a = []; function o(u, l) { return ( /*fullscreen*/ @@ -7494,102 +7558,102 @@ function px(n) { } return e = o(n), t = a[e] = r[e](n), { c() { - t.c(), i = bg(); + t.c(), i = Mg(); }, l(u) { - t.l(u), i = bg(); + t.l(u), i = Mg(); }, m(u, l) { - a[e].m(u, l), hx(u, i, l), s = !0; + a[e].m(u, l), Px(u, i, l), s = !0; }, p(u, [l]) { let c = e; - e = o(u), e === c ? a[e].p(u, l) : (ux(), kl(a[c], 1, 1, () => { + e = o(u), e === c ? a[e].p(u, l) : (Cx(), Wl(a[c], 1, 1, () => { a[c] = null; - }), ox(), t = a[e], t ? t.p(u, l) : (t = a[e] = r[e](u), t.c()), Il(t, 1), t.m(i.parentNode, i)); + }), kx(), t = a[e], t ? t.p(u, l) : (t = a[e] = r[e](u), t.c()), zl(t, 1), t.m(i.parentNode, i)); }, i(u) { - s || (Il(t), s = !0); + s || (zl(t), s = !0); }, o(u) { - kl(t), s = !1; + Wl(t), s = !1; }, d(u) { - u && lx(i), a[e].d(u); + u && Rx(i), a[e].d(u); } }; } -function _x(n, e, t) { - const i = fx(); +function Ux(n, e, t) { + const i = Mx(); let { fullscreen: s } = e; const r = () => i("fullscreen", !1), a = () => i("fullscreen", !0); return n.$$set = (o) => { "fullscreen" in o && t(0, s = o.fullscreen); }, [s, i, r, a]; } -class vx extends ax { +class Gx extends Ix { constructor(e) { - super(), cx(this, e, _x, px, dx, { fullscreen: 0 }); + super(), Fx(this, e, Ux, Nx, Ox, { fullscreen: 0 }); } } -function rr(n) { +function _r(n) { let e = ["", "k", "M", "G", "T", "P", "E", "Z"], t = 0; for (; n > 1e3 && t < e.length - 1; ) n /= 1e3, t++; let i = e[t]; return (Number.isInteger(n) ? n : n.toFixed(1)) + i; } -function bs() { +function Ls() { } -const yx = (n) => n; -function Ex(n) { +const Hx = (n) => n; +function Vx(n) { return n(); } -function bx(n) { +function qx(n) { return typeof n == "function"; } -function Tx(n, ...e) { +function Kx(n, ...e) { if (n == null) { for (const i of e) i(void 0); - return bs; + return Ls; } const t = n.subscribe(...e); return t.unsubscribe ? () => t.unsubscribe() : t; } -const pv = typeof window < "u"; -let Tg = pv ? () => window.performance.now() : () => Date.now(), _v = pv ? (n) => requestAnimationFrame(n) : bs; -const hr = /* @__PURE__ */ new Set(); -function vv(n) { - hr.forEach((e) => { - e.c(n) || (hr.delete(e), e.f()); - }), hr.size !== 0 && _v(vv); +const Cv = typeof window < "u"; +let $g = Cv ? () => window.performance.now() : () => Date.now(), Fv = Cv ? (n) => requestAnimationFrame(n) : Ls; +const Sr = /* @__PURE__ */ new Set(); +function Pv(n) { + Sr.forEach((e) => { + e.c(n) || (Sr.delete(e), e.f()); + }), Sr.size !== 0 && Fv(Pv); } -function Sx(n) { +function jx(n) { let e; - return hr.size === 0 && _v(vv), { promise: new Promise((t) => { - hr.add(e = { c: n, f: t }); + return Sr.size === 0 && Fv(Pv), { promise: new Promise((t) => { + Sr.add(e = { c: n, f: t }); }), abort() { - hr.delete(e); + Sr.delete(e); } }; } -function Ax(n, { delay: e = 0, duration: t = 400, easing: i = yx } = {}) { +function zx(n, { delay: e = 0, duration: t = 400, easing: i = Hx } = {}) { const s = +getComputedStyle(n).opacity; return { delay: e, duration: t, easing: i, css: (r) => "opacity: " + r * s }; } -const js = []; -function xx(n, e) { - return { subscribe: io(n, e).subscribe }; +const sr = []; +function Wx(n, e) { + return { subscribe: _o(n, e).subscribe }; } -function io(n, e = bs) { +function _o(n, e = Ls) { let t; const i = /* @__PURE__ */ new Set(); function s(a) { if (u = a, ((o = n) != o ? u == u : o !== u || o && typeof o == "object" || typeof o == "function") && (n = a, t)) { - const l = !js.length; - for (const c of i) c[1](), js.push(c, n); + const l = !sr.length; + for (const c of i) c[1](), sr.push(c, n); if (l) { - for (let c = 0; c < js.length; c += 2) js[c][0](js[c + 1]); - js.length = 0; + for (let c = 0; c < sr.length; c += 2) sr[c][0](sr[c + 1]); + sr.length = 0; } } var o, u; @@ -7597,62 +7661,62 @@ function io(n, e = bs) { function r(a) { s(a(n)); } - return { set: s, update: r, subscribe: function(a, o = bs) { + return { set: s, update: r, subscribe: function(a, o = Ls) { const u = [a, o]; - return i.add(u), i.size === 1 && (t = e(s, r) || bs), a(n), () => { + return i.add(u), i.size === 1 && (t = e(s, r) || Ls), a(n), () => { i.delete(u), i.size === 0 && t && (t(), t = null); }; } }; } -function Gr(n, e, t) { +function Wr(n, e, t) { const i = !Array.isArray(n), s = i ? [n] : n; if (!s.every(Boolean)) throw new Error("derived() expects stores as input, got a falsy value"); const r = e.length < 2; - return xx(t, (a, o) => { + return Wx(t, (a, o) => { let u = !1; const l = []; - let c = 0, h = bs; + let c = 0, h = Ls; const d = () => { if (c) return; h(); const m = e(i ? l[0] : l, a, o); - r ? a(m) : h = bx(m) ? m : bs; - }, f = s.map((m, g) => Tx(m, (p) => { + r ? a(m) : h = qx(m) ? m : Ls; + }, f = s.map((m, g) => Kx(m, (p) => { l[g] = p, c &= ~(1 << g), u && d(); }, () => { c |= 1 << g; })); return u = !0, d(), function() { - f.forEach(Ex), h(), u = !1; + f.forEach(Vx), h(), u = !1; }; }); } -function Sg(n) { +function Bg(n) { return Object.prototype.toString.call(n) === "[object Date]"; } -function Wh(n, e, t, i) { - if (typeof t == "number" || Sg(t)) { +function gd(n, e, t, i) { + if (typeof t == "number" || Bg(t)) { const s = i - t, r = (t - e) / (n.dt || 1 / 60), a = (r + (n.opts.stiffness * s - n.opts.damping * r) * n.inv_mass) * n.dt; - return Math.abs(a) < n.opts.precision && Math.abs(s) < n.opts.precision ? i : (n.settled = !1, Sg(t) ? new Date(t.getTime() + a) : t + a); + return Math.abs(a) < n.opts.precision && Math.abs(s) < n.opts.precision ? i : (n.settled = !1, Bg(t) ? new Date(t.getTime() + a) : t + a); } - if (Array.isArray(t)) return t.map((s, r) => Wh(n, e[r], t[r], i[r])); + if (Array.isArray(t)) return t.map((s, r) => gd(n, e[r], t[r], i[r])); if (typeof t == "object") { const s = {}; - for (const r in t) s[r] = Wh(n, e[r], t[r], i[r]); + for (const r in t) s[r] = gd(n, e[r], t[r], i[r]); return s; } throw new Error(`Cannot spring ${typeof t} values`); } -function Ag(n, e = {}) { - const t = io(n), { stiffness: i = 0.15, damping: s = 0.8, precision: r = 0.01 } = e; +function Ng(n, e = {}) { + const t = _o(n), { stiffness: i = 0.15, damping: s = 0.8, precision: r = 0.01 } = e; let a, o, u, l = n, c = n, h = 1, d = 0, f = !1; function m(p, y = {}) { c = p; const v = u = {}; - return n == null || y.hard || g.stiffness >= 1 && g.damping >= 1 ? (f = !0, a = Tg(), l = p, t.set(n = c), Promise.resolve()) : (y.soft && (d = 1 / (60 * (y.soft === !0 ? 0.5 : +y.soft)), h = 0), o || (a = Tg(), f = !1, o = Sx((_) => { + return n == null || y.hard || g.stiffness >= 1 && g.damping >= 1 ? (f = !0, a = $g(), l = p, t.set(n = c), Promise.resolve()) : (y.soft && (d = 1 / (60 * (y.soft === !0 ? 0.5 : +y.soft)), h = 0), o || (a = $g(), f = !1, o = jx((_) => { if (f) return f = !1, o = null, !1; h = Math.min(h + d, 1); - const E = { inv_mass: h, opts: g, settled: !0, dt: 60 * (_ - a) / 1e3 }, T = Wh(E, l, n, c); + const E = { inv_mass: h, opts: g, settled: !0, dt: 60 * (_ - a) / 1e3 }, T = gd(E, l, n, c); return a = _, l = n, t.set(n = T), E.settled && (o = null), !E.settled; })), new Promise((_) => { o.promise.then(() => { @@ -7664,71 +7728,71 @@ function Ag(n, e = {}) { return g; } const { - SvelteComponent: Dx, - append_hydration: mi, - attr: ve, - children: Wt, - claim_element: wx, - claim_svg_element: gi, - component_subscribe: xg, - detach: $t, - element: Lx, - init: Ix, - insert_hydration: kx, - noop: Dg, - safe_not_equal: Rx, - set_style: Ro, - svg_element: pi, - toggle_class: wg -} = window.__gradio__svelte__internal, { onMount: Cx } = window.__gradio__svelte__internal; -function Fx(n) { + SvelteComponent: Yx, + append_hydration: Ai, + attr: ye, + children: Jt, + claim_element: Xx, + claim_svg_element: xi, + component_subscribe: Ug, + detach: Vt, + element: Qx, + init: Zx, + insert_hydration: Jx, + noop: Gg, + safe_not_equal: eD, + set_style: Yo, + svg_element: Di, + toggle_class: Hg +} = window.__gradio__svelte__internal, { onMount: tD } = window.__gradio__svelte__internal; +function iD(n) { let e, t, i, s, r, a, o, u, l, c, h, d; return { c() { - e = Lx("div"), t = pi("svg"), i = pi("g"), s = pi("path"), r = pi("path"), a = pi("path"), o = pi("path"), u = pi("g"), l = pi("path"), c = pi("path"), h = pi("path"), d = pi("path"), this.h(); + e = Qx("div"), t = Di("svg"), i = Di("g"), s = Di("path"), r = Di("path"), a = Di("path"), o = Di("path"), u = Di("g"), l = Di("path"), c = Di("path"), h = Di("path"), d = Di("path"), this.h(); }, l(f) { - e = wx(f, "DIV", { class: !0 }); - var m = Wt(e); - t = gi(m, "svg", { + e = Xx(f, "DIV", { class: !0 }); + var m = Jt(e); + t = xi(m, "svg", { viewBox: !0, fill: !0, xmlns: !0, class: !0 }); - var g = Wt(t); - i = gi(g, "g", { style: !0 }); - var p = Wt(i); - s = gi(p, "path", { + var g = Jt(t); + i = xi(g, "g", { style: !0 }); + var p = Jt(i); + s = xi(p, "path", { d: !0, fill: !0, "fill-opacity": !0, class: !0 - }), Wt(s).forEach($t), r = gi(p, "path", { d: !0, fill: !0, class: !0 }), Wt(r).forEach($t), a = gi(p, "path", { + }), Jt(s).forEach(Vt), r = xi(p, "path", { d: !0, fill: !0, class: !0 }), Jt(r).forEach(Vt), a = xi(p, "path", { d: !0, fill: !0, "fill-opacity": !0, class: !0 - }), Wt(a).forEach($t), o = gi(p, "path", { d: !0, fill: !0, class: !0 }), Wt(o).forEach($t), p.forEach($t), u = gi(g, "g", { style: !0 }); - var y = Wt(u); - l = gi(y, "path", { + }), Jt(a).forEach(Vt), o = xi(p, "path", { d: !0, fill: !0, class: !0 }), Jt(o).forEach(Vt), p.forEach(Vt), u = xi(g, "g", { style: !0 }); + var y = Jt(u); + l = xi(y, "path", { d: !0, fill: !0, "fill-opacity": !0, class: !0 - }), Wt(l).forEach($t), c = gi(y, "path", { d: !0, fill: !0, class: !0 }), Wt(c).forEach($t), h = gi(y, "path", { + }), Jt(l).forEach(Vt), c = xi(y, "path", { d: !0, fill: !0, class: !0 }), Jt(c).forEach(Vt), h = xi(y, "path", { d: !0, fill: !0, "fill-opacity": !0, class: !0 - }), Wt(h).forEach($t), d = gi(y, "path", { d: !0, fill: !0, class: !0 }), Wt(d).forEach($t), y.forEach($t), g.forEach($t), m.forEach($t), this.h(); + }), Jt(h).forEach(Vt), d = xi(y, "path", { d: !0, fill: !0, class: !0 }), Jt(d).forEach(Vt), y.forEach(Vt), g.forEach(Vt), m.forEach(Vt), this.h(); }, h() { - ve(s, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), ve(s, "fill", "#FF7C00"), ve(s, "fill-opacity", "0.4"), ve(s, "class", "svelte-43sxxs"), ve(r, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), ve(r, "fill", "#FF7C00"), ve(r, "class", "svelte-43sxxs"), ve(a, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), ve(a, "fill", "#FF7C00"), ve(a, "fill-opacity", "0.4"), ve(a, "class", "svelte-43sxxs"), ve(o, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), ve(o, "fill", "#FF7C00"), ve(o, "class", "svelte-43sxxs"), Ro(i, "transform", "translate(" + /*$top*/ + ye(s, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), ye(s, "fill", "#FF7C00"), ye(s, "fill-opacity", "0.4"), ye(s, "class", "svelte-43sxxs"), ye(r, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), ye(r, "fill", "#FF7C00"), ye(r, "class", "svelte-43sxxs"), ye(a, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), ye(a, "fill", "#FF7C00"), ye(a, "fill-opacity", "0.4"), ye(a, "class", "svelte-43sxxs"), ye(o, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), ye(o, "fill", "#FF7C00"), ye(o, "class", "svelte-43sxxs"), Yo(i, "transform", "translate(" + /*$top*/ n[1][0] + "px, " + /*$top*/ - n[1][1] + "px)"), ve(l, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), ve(l, "fill", "#FF7C00"), ve(l, "fill-opacity", "0.4"), ve(l, "class", "svelte-43sxxs"), ve(c, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), ve(c, "fill", "#FF7C00"), ve(c, "class", "svelte-43sxxs"), ve(h, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), ve(h, "fill", "#FF7C00"), ve(h, "fill-opacity", "0.4"), ve(h, "class", "svelte-43sxxs"), ve(d, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), ve(d, "fill", "#FF7C00"), ve(d, "class", "svelte-43sxxs"), Ro(u, "transform", "translate(" + /*$bottom*/ + n[1][1] + "px)"), ye(l, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), ye(l, "fill", "#FF7C00"), ye(l, "fill-opacity", "0.4"), ye(l, "class", "svelte-43sxxs"), ye(c, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), ye(c, "fill", "#FF7C00"), ye(c, "class", "svelte-43sxxs"), ye(h, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), ye(h, "fill", "#FF7C00"), ye(h, "fill-opacity", "0.4"), ye(h, "class", "svelte-43sxxs"), ye(d, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), ye(d, "fill", "#FF7C00"), ye(d, "class", "svelte-43sxxs"), Yo(u, "transform", "translate(" + /*$bottom*/ n[2][0] + "px, " + /*$bottom*/ - n[2][1] + "px)"), ve(t, "viewBox", "-1200 -1200 3000 3000"), ve(t, "fill", "none"), ve(t, "xmlns", "http://www.w3.org/2000/svg"), ve(t, "class", "svelte-43sxxs"), ve(e, "class", "svelte-43sxxs"), wg( + n[2][1] + "px)"), ye(t, "viewBox", "-1200 -1200 3000 3000"), ye(t, "fill", "none"), ye(t, "xmlns", "http://www.w3.org/2000/svg"), ye(t, "class", "svelte-43sxxs"), ye(e, "class", "svelte-43sxxs"), Hg( e, "margin", /*margin*/ @@ -7736,31 +7800,31 @@ function Fx(n) { ); }, m(f, m) { - kx(f, e, m), mi(e, t), mi(t, i), mi(i, s), mi(i, r), mi(i, a), mi(i, o), mi(t, u), mi(u, l), mi(u, c), mi(u, h), mi(u, d); + Jx(f, e, m), Ai(e, t), Ai(t, i), Ai(i, s), Ai(i, r), Ai(i, a), Ai(i, o), Ai(t, u), Ai(u, l), Ai(u, c), Ai(u, h), Ai(u, d); }, p(f, [m]) { m & /*$top*/ - 2 && Ro(i, "transform", "translate(" + /*$top*/ + 2 && Yo(i, "transform", "translate(" + /*$top*/ f[1][0] + "px, " + /*$top*/ f[1][1] + "px)"), m & /*$bottom*/ - 4 && Ro(u, "transform", "translate(" + /*$bottom*/ + 4 && Yo(u, "transform", "translate(" + /*$bottom*/ f[2][0] + "px, " + /*$bottom*/ f[2][1] + "px)"), m & /*margin*/ - 1 && wg( + 1 && Hg( e, "margin", /*margin*/ f[0] ); }, - i: Dg, - o: Dg, + i: Gg, + o: Gg, d(f) { - f && $t(e); + f && Vt(e); } }; } -function Px(n, e, t) { +function nD(n, e, t) { let i, s; var r = this && this.__awaiter || function(f, m, g, p) { function y(v) { @@ -7771,29 +7835,29 @@ function Px(n, e, t) { return new (g || (g = Promise))(function(v, _) { function E(S) { try { - A(p.next(S)); + x(p.next(S)); } catch (D) { _(D); } } function T(S) { try { - A(p.throw(S)); + x(p.throw(S)); } catch (D) { _(D); } } - function A(S) { + function x(S) { S.done ? v(S.value) : y(S.value).then(E, T); } - A((p = p.apply(f, m || [])).next()); + x((p = p.apply(f, m || [])).next()); }); }; let { margin: a = !0 } = e; - const o = Ag([0, 0]); - xg(n, o, (f) => t(1, i = f)); - const u = Ag([0, 0]); - xg(n, u, (f) => t(2, s = f)); + const o = Ng([0, 0]); + Ug(n, o, (f) => t(1, i = f)); + const u = Ng([0, 0]); + Ug(n, u, (f) => t(2, s = f)); let l; function c() { return r(this, void 0, void 0, function* () { @@ -7810,67 +7874,67 @@ function Px(n, e, t) { yield Promise.all([o.set([125, 0]), u.set([-125, 0])]), h(); }); } - return Cx(() => (d(), () => l = !0)), n.$$set = (f) => { + return tD(() => (d(), () => l = !0)), n.$$set = (f) => { "margin" in f && t(0, a = f.margin); }, [a, i, s, o, u]; } -class Ox extends Dx { +class sD extends Yx { constructor(e) { - super(), Ix(this, e, Px, Fx, Rx, { margin: 0 }); + super(), Zx(this, e, nD, iD, eD, { margin: 0 }); } } const { - SvelteComponent: Mx, - append_hydration: ps, - attr: xi, - binding_callbacks: Lg, - check_outros: Yh, - children: Qi, - claim_component: yv, - claim_element: Zi, - claim_space: Jt, - claim_text: Ue, - create_component: Ev, - create_slot: bv, - destroy_component: Tv, - destroy_each: Sv, - detach: re, - element: Ji, - empty: si, - ensure_array_like: Rl, - get_all_dirty_from_scope: Av, - get_slot_changes: xv, - group_outros: Xh, - init: $x, - insert_hydration: ce, - mount_component: Dv, - noop: Qh, - safe_not_equal: Bx, - set_data: ri, - set_style: Kn, - space: ei, - text: Ge, - toggle_class: Qt, - transition_in: Si, - transition_out: en, - update_slot_base: wv -} = window.__gradio__svelte__internal, { tick: Nx } = window.__gradio__svelte__internal, { onDestroy: Ux } = window.__gradio__svelte__internal, { createEventDispatcher: Gx } = window.__gradio__svelte__internal, Hx = (n) => ({}), Ig = (n) => ({}), Vx = (n) => ({}), kg = (n) => ({}); -function Rg(n, e, t) { + SvelteComponent: rD, + append_hydration: bs, + attr: Oi, + binding_callbacks: Vg, + check_outros: pd, + children: en, + claim_component: Ov, + claim_element: tn, + claim_space: ni, + claim_text: Ge, + create_component: Mv, + create_slot: $v, + destroy_component: Bv, + destroy_each: Nv, + detach: oe, + element: nn, + empty: ui, + ensure_array_like: Yl, + get_all_dirty_from_scope: Uv, + get_slot_changes: Gv, + group_outros: _d, + init: aD, + insert_hydration: he, + mount_component: Hv, + noop: vd, + safe_not_equal: oD, + set_data: ci, + set_style: Qn, + space: si, + text: He, + toggle_class: ti, + transition_in: Fi, + transition_out: sn, + update_slot_base: Vv +} = window.__gradio__svelte__internal, { tick: lD } = window.__gradio__svelte__internal, { onDestroy: uD } = window.__gradio__svelte__internal, { createEventDispatcher: cD } = window.__gradio__svelte__internal, hD = (n) => ({}), qg = (n) => ({}), dD = (n) => ({}), Kg = (n) => ({}); +function jg(n, e, t) { const i = n.slice(); return i[40] = e[t], i[42] = t, i; } -function Cg(n, e, t) { +function zg(n, e, t) { const i = n.slice(); return i[40] = e[t], i; } -function qx(n) { +function fD(n) { let e, t, i, s, r = ( /*i18n*/ n[1]("common.error") + "" ), a, o, u; - t = new Ci({ + t = new vi({ props: { - Icon: Jd, + Icon: bf, label: ( /*i18n*/ n[1]("common.clear") @@ -7885,29 +7949,29 @@ function qx(n) { const l = ( /*#slots*/ n[30].error - ), c = bv( + ), c = $v( l, n, /*$$scope*/ n[29], - Ig + qg ); return { c() { - e = Ji("div"), Ev(t.$$.fragment), i = ei(), s = Ji("span"), a = Ge(r), o = ei(), c && c.c(), this.h(); + e = nn("div"), Mv(t.$$.fragment), i = si(), s = nn("span"), a = He(r), o = si(), c && c.c(), this.h(); }, l(h) { - e = Zi(h, "DIV", { class: !0 }); - var d = Qi(e); - yv(t.$$.fragment, d), d.forEach(re), i = Jt(h), s = Zi(h, "SPAN", { class: !0 }); - var f = Qi(s); - a = Ue(f, r), f.forEach(re), o = Jt(h), c && c.l(h), this.h(); + e = tn(h, "DIV", { class: !0 }); + var d = en(e); + Ov(t.$$.fragment, d), d.forEach(oe), i = ni(h), s = tn(h, "SPAN", { class: !0 }); + var f = en(s); + a = Ge(f, r), f.forEach(oe), o = ni(h), c && c.l(h), this.h(); }, h() { - xi(e, "class", "clear-status svelte-17v219f"), xi(s, "class", "error svelte-17v219f"); + Oi(e, "class", "clear-status svelte-17v219f"), Oi(s, "class", "error svelte-17v219f"); }, m(h, d) { - ce(h, e, d), Dv(t, e, null), ce(h, i, d), ce(h, s, d), ps(s, a), ce(h, o, d), c && c.m(h, d), u = !0; + he(h, e, d), Hv(t, e, null), he(h, i, d), he(h, s, d), bs(s, a), he(h, o, d), c && c.m(h, d), u = !0; }, p(h, d) { const f = {}; @@ -7915,65 +7979,65 @@ function qx(n) { 2 && (f.label = /*i18n*/ h[1]("common.clear")), t.$set(f), (!u || d[0] & /*i18n*/ 2) && r !== (r = /*i18n*/ - h[1]("common.error") + "") && ri(a, r), c && c.p && (!u || d[0] & /*$$scope*/ - 536870912) && wv( + h[1]("common.error") + "") && ci(a, r), c && c.p && (!u || d[0] & /*$$scope*/ + 536870912) && Vv( c, l, h, /*$$scope*/ h[29], - u ? xv( + u ? Gv( l, /*$$scope*/ h[29], d, - Hx - ) : Av( + hD + ) : Uv( /*$$scope*/ h[29] ), - Ig + qg ); }, i(h) { - u || (Si(t.$$.fragment, h), Si(c, h), u = !0); + u || (Fi(t.$$.fragment, h), Fi(c, h), u = !0); }, o(h) { - en(t.$$.fragment, h), en(c, h), u = !1; + sn(t.$$.fragment, h), sn(c, h), u = !1; }, d(h) { - h && (re(e), re(i), re(s), re(o)), Tv(t), c && c.d(h); + h && (oe(e), oe(i), oe(s), oe(o)), Bv(t), c && c.d(h); } }; } -function Kx(n) { +function mD(n) { let e, t, i, s, r, a, o, u, l, c = ( /*variant*/ n[8] === "default" && /*show_eta_bar*/ n[18] && /*show_progress*/ - n[6] === "full" && Fg(n) + n[6] === "full" && Wg(n) ); function h(_, E) { if ( /*progress*/ _[7] - ) return Wx; + ) return _D; if ( /*queue_position*/ _[2] !== null && /*queue_size*/ _[3] !== void 0 && /*queue_position*/ _[2] >= 0 - ) return zx; + ) return pD; if ( /*queue_position*/ _[2] === 0 - ) return jx; + ) return gD; } let d = h(n), f = d && d(n), m = ( /*timer*/ - n[5] && Mg(n) + n[5] && Qg(n) ); - const g = [Zx, Qx], p = []; + const g = [bD, ED], p = []; function y(_, E) { return ( /*last_progress_level*/ @@ -7985,23 +8049,23 @@ function Kx(n) { } ~(r = y(n)) && (a = p[r] = g[r](n)); let v = !/*timer*/ - n[5] && Vg(n); + n[5] && sp(n); return { c() { - c && c.c(), e = ei(), t = Ji("div"), f && f.c(), i = ei(), m && m.c(), s = ei(), a && a.c(), o = ei(), v && v.c(), u = si(), this.h(); + c && c.c(), e = si(), t = nn("div"), f && f.c(), i = si(), m && m.c(), s = si(), a && a.c(), o = si(), v && v.c(), u = ui(), this.h(); }, l(_) { - c && c.l(_), e = Jt(_), t = Zi(_, "DIV", { class: !0 }); - var E = Qi(t); - f && f.l(E), i = Jt(E), m && m.l(E), E.forEach(re), s = Jt(_), a && a.l(_), o = Jt(_), v && v.l(_), u = si(), this.h(); + c && c.l(_), e = ni(_), t = tn(_, "DIV", { class: !0 }); + var E = en(t); + f && f.l(E), i = ni(E), m && m.l(E), E.forEach(oe), s = ni(_), a && a.l(_), o = ni(_), v && v.l(_), u = ui(), this.h(); }, h() { - xi(t, "class", "progress-text svelte-17v219f"), Qt( + Oi(t, "class", "progress-text svelte-17v219f"), ti( t, "meta-text-center", /*variant*/ n[8] === "center" - ), Qt( + ), ti( t, "meta-text", /*variant*/ @@ -8009,161 +8073,161 @@ function Kx(n) { ); }, m(_, E) { - c && c.m(_, E), ce(_, e, E), ce(_, t, E), f && f.m(t, null), ps(t, i), m && m.m(t, null), ce(_, s, E), ~r && p[r].m(_, E), ce(_, o, E), v && v.m(_, E), ce(_, u, E), l = !0; + c && c.m(_, E), he(_, e, E), he(_, t, E), f && f.m(t, null), bs(t, i), m && m.m(t, null), he(_, s, E), ~r && p[r].m(_, E), he(_, o, E), v && v.m(_, E), he(_, u, E), l = !0; }, p(_, E) { /*variant*/ _[8] === "default" && /*show_eta_bar*/ _[18] && /*show_progress*/ - _[6] === "full" ? c ? c.p(_, E) : (c = Fg(_), c.c(), c.m(e.parentNode, e)) : c && (c.d(1), c = null), d === (d = h(_)) && f ? f.p(_, E) : (f && f.d(1), f = d && d(_), f && (f.c(), f.m(t, i))), /*timer*/ - _[5] ? m ? m.p(_, E) : (m = Mg(_), m.c(), m.m(t, null)) : m && (m.d(1), m = null), (!l || E[0] & /*variant*/ - 256) && Qt( + _[6] === "full" ? c ? c.p(_, E) : (c = Wg(_), c.c(), c.m(e.parentNode, e)) : c && (c.d(1), c = null), d === (d = h(_)) && f ? f.p(_, E) : (f && f.d(1), f = d && d(_), f && (f.c(), f.m(t, i))), /*timer*/ + _[5] ? m ? m.p(_, E) : (m = Qg(_), m.c(), m.m(t, null)) : m && (m.d(1), m = null), (!l || E[0] & /*variant*/ + 256) && ti( t, "meta-text-center", /*variant*/ _[8] === "center" ), (!l || E[0] & /*variant*/ - 256) && Qt( + 256) && ti( t, "meta-text", /*variant*/ _[8] === "default" ); let T = r; - r = y(_), r === T ? ~r && p[r].p(_, E) : (a && (Xh(), en(p[T], 1, 1, () => { + r = y(_), r === T ? ~r && p[r].p(_, E) : (a && (_d(), sn(p[T], 1, 1, () => { p[T] = null; - }), Yh()), ~r ? (a = p[r], a ? a.p(_, E) : (a = p[r] = g[r](_), a.c()), Si(a, 1), a.m(o.parentNode, o)) : a = null), /*timer*/ - _[5] ? v && (Xh(), en(v, 1, 1, () => { + }), pd()), ~r ? (a = p[r], a ? a.p(_, E) : (a = p[r] = g[r](_), a.c()), Fi(a, 1), a.m(o.parentNode, o)) : a = null), /*timer*/ + _[5] ? v && (_d(), sn(v, 1, 1, () => { v = null; - }), Yh()) : v ? (v.p(_, E), E[0] & /*timer*/ - 32 && Si(v, 1)) : (v = Vg(_), v.c(), Si(v, 1), v.m(u.parentNode, u)); + }), pd()) : v ? (v.p(_, E), E[0] & /*timer*/ + 32 && Fi(v, 1)) : (v = sp(_), v.c(), Fi(v, 1), v.m(u.parentNode, u)); }, i(_) { - l || (Si(a), Si(v), l = !0); + l || (Fi(a), Fi(v), l = !0); }, o(_) { - en(a), en(v), l = !1; + sn(a), sn(v), l = !1; }, d(_) { - _ && (re(e), re(t), re(s), re(o), re(u)), c && c.d(_), f && f.d(), m && m.d(), ~r && p[r].d(_), v && v.d(_); + _ && (oe(e), oe(t), oe(s), oe(o), oe(u)), c && c.d(_), f && f.d(), m && m.d(), ~r && p[r].d(_), v && v.d(_); } }; } -function Fg(n) { +function Wg(n) { let e, t = `translateX(${/*eta_level*/ (n[17] || 0) * 100 - 100}%)`; return { c() { - e = Ji("div"), this.h(); + e = nn("div"), this.h(); }, l(i) { - e = Zi(i, "DIV", { class: !0 }), Qi(e).forEach(re), this.h(); + e = tn(i, "DIV", { class: !0 }), en(e).forEach(oe), this.h(); }, h() { - xi(e, "class", "eta-bar svelte-17v219f"), Kn(e, "transform", t); + Oi(e, "class", "eta-bar svelte-17v219f"), Qn(e, "transform", t); }, m(i, s) { - ce(i, e, s); + he(i, e, s); }, p(i, s) { s[0] & /*eta_level*/ 131072 && t !== (t = `translateX(${/*eta_level*/ - (i[17] || 0) * 100 - 100}%)`) && Kn(e, "transform", t); + (i[17] || 0) * 100 - 100}%)`) && Qn(e, "transform", t); }, d(i) { - i && re(e); + i && oe(e); } }; } -function jx(n) { +function gD(n) { let e; return { c() { - e = Ge("processing |"); + e = He("processing |"); }, l(t) { - e = Ue(t, "processing |"); + e = Ge(t, "processing |"); }, m(t, i) { - ce(t, e, i); + he(t, e, i); }, - p: Qh, + p: vd, d(t) { - t && re(e); + t && oe(e); } }; } -function zx(n) { +function pD(n) { let e, t = ( /*queue_position*/ n[2] + 1 + "" ), i, s, r, a; return { c() { - e = Ge("queue: "), i = Ge(t), s = Ge("/"), r = Ge( + e = He("queue: "), i = He(t), s = He("/"), r = He( /*queue_size*/ n[3] - ), a = Ge(" |"); + ), a = He(" |"); }, l(o) { - e = Ue(o, "queue: "), i = Ue(o, t), s = Ue(o, "/"), r = Ue( + e = Ge(o, "queue: "), i = Ge(o, t), s = Ge(o, "/"), r = Ge( o, /*queue_size*/ n[3] - ), a = Ue(o, " |"); + ), a = Ge(o, " |"); }, m(o, u) { - ce(o, e, u), ce(o, i, u), ce(o, s, u), ce(o, r, u), ce(o, a, u); + he(o, e, u), he(o, i, u), he(o, s, u), he(o, r, u), he(o, a, u); }, p(o, u) { u[0] & /*queue_position*/ 4 && t !== (t = /*queue_position*/ - o[2] + 1 + "") && ri(i, t), u[0] & /*queue_size*/ - 8 && ri( + o[2] + 1 + "") && ci(i, t), u[0] & /*queue_size*/ + 8 && ci( r, /*queue_size*/ o[3] ); }, d(o) { - o && (re(e), re(i), re(s), re(r), re(a)); + o && (oe(e), oe(i), oe(s), oe(r), oe(a)); } }; } -function Wx(n) { - let e, t = Rl( +function _D(n) { + let e, t = Yl( /*progress*/ n[7] ), i = []; for (let s = 0; s < t.length; s += 1) - i[s] = Og(Cg(n, t, s)); + i[s] = Xg(zg(n, t, s)); return { c() { for (let s = 0; s < i.length; s += 1) i[s].c(); - e = si(); + e = ui(); }, l(s) { for (let r = 0; r < i.length; r += 1) i[r].l(s); - e = si(); + e = ui(); }, m(s, r) { for (let a = 0; a < i.length; a += 1) i[a] && i[a].m(s, r); - ce(s, e, r); + he(s, e, r); }, p(s, r) { if (r[0] & /*progress*/ 128) { - t = Rl( + t = Yl( /*progress*/ s[7] ); let a; for (a = 0; a < t.length; a += 1) { - const o = Cg(s, t, a); - i[a] ? i[a].p(o, r) : (i[a] = Og(o), i[a].c(), i[a].m(e.parentNode, e)); + const o = zg(s, t, a); + i[a] ? i[a].p(o, r) : (i[a] = Xg(o), i[a].c(), i[a].m(e.parentNode, e)); } for (; a < i.length; a += 1) i[a].d(1); @@ -8171,11 +8235,11 @@ function Wx(n) { } }, d(s) { - s && re(e), Sv(i, s); + s && oe(e), Nv(i, s); } }; } -function Pg(n) { +function Yg(n) { let e, t = ( /*p*/ n[40].unit + "" @@ -8183,116 +8247,116 @@ function Pg(n) { function o(c, h) { return ( /*p*/ - c[40].length != null ? Xx : Yx + c[40].length != null ? yD : vD ); } let u = o(n), l = u(n); return { c() { - l.c(), e = ei(), i = Ge(t), s = Ge(" | "), a = Ge(r); + l.c(), e = si(), i = He(t), s = He(" | "), a = He(r); }, l(c) { - l.l(c), e = Jt(c), i = Ue(c, t), s = Ue(c, " | "), a = Ue(c, r); + l.l(c), e = ni(c), i = Ge(c, t), s = Ge(c, " | "), a = Ge(c, r); }, m(c, h) { - l.m(c, h), ce(c, e, h), ce(c, i, h), ce(c, s, h), ce(c, a, h); + l.m(c, h), he(c, e, h), he(c, i, h), he(c, s, h), he(c, a, h); }, p(c, h) { u === (u = o(c)) && l ? l.p(c, h) : (l.d(1), l = u(c), l && (l.c(), l.m(e.parentNode, e))), h[0] & /*progress*/ 128 && t !== (t = /*p*/ - c[40].unit + "") && ri(i, t); + c[40].unit + "") && ci(i, t); }, d(c) { - c && (re(e), re(i), re(s), re(a)), l.d(c); + c && (oe(e), oe(i), oe(s), oe(a)), l.d(c); } }; } -function Yx(n) { - let e = rr( +function vD(n) { + let e = _r( /*p*/ n[40].index || 0 ) + "", t; return { c() { - t = Ge(e); + t = He(e); }, l(i) { - t = Ue(i, e); + t = Ge(i, e); }, m(i, s) { - ce(i, t, s); + he(i, t, s); }, p(i, s) { s[0] & /*progress*/ - 128 && e !== (e = rr( + 128 && e !== (e = _r( /*p*/ i[40].index || 0 - ) + "") && ri(t, e); + ) + "") && ci(t, e); }, d(i) { - i && re(t); + i && oe(t); } }; } -function Xx(n) { - let e = rr( +function yD(n) { + let e = _r( /*p*/ n[40].index || 0 - ) + "", t, i, s = rr( + ) + "", t, i, s = _r( /*p*/ n[40].length ) + "", r; return { c() { - t = Ge(e), i = Ge("/"), r = Ge(s); + t = He(e), i = He("/"), r = He(s); }, l(a) { - t = Ue(a, e), i = Ue(a, "/"), r = Ue(a, s); + t = Ge(a, e), i = Ge(a, "/"), r = Ge(a, s); }, m(a, o) { - ce(a, t, o), ce(a, i, o), ce(a, r, o); + he(a, t, o), he(a, i, o), he(a, r, o); }, p(a, o) { o[0] & /*progress*/ - 128 && e !== (e = rr( + 128 && e !== (e = _r( /*p*/ a[40].index || 0 - ) + "") && ri(t, e), o[0] & /*progress*/ - 128 && s !== (s = rr( + ) + "") && ci(t, e), o[0] & /*progress*/ + 128 && s !== (s = _r( /*p*/ a[40].length - ) + "") && ri(r, s); + ) + "") && ci(r, s); }, d(a) { - a && (re(t), re(i), re(r)); + a && (oe(t), oe(i), oe(r)); } }; } -function Og(n) { +function Xg(n) { let e, t = ( /*p*/ - n[40].index != null && Pg(n) + n[40].index != null && Yg(n) ); return { c() { - t && t.c(), e = si(); + t && t.c(), e = ui(); }, l(i) { - t && t.l(i), e = si(); + t && t.l(i), e = ui(); }, m(i, s) { - t && t.m(i, s), ce(i, e, s); + t && t.m(i, s), he(i, e, s); }, p(i, s) { /*p*/ - i[40].index != null ? t ? t.p(i, s) : (t = Pg(i), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + i[40].index != null ? t ? t.p(i, s) : (t = Yg(i), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, d(i) { - i && re(e), t && t.d(i); + i && oe(e), t && t.d(i); } }; } -function Mg(n) { +function Qg(n) { let e, t = ( /*eta*/ n[0] ? `/${/*formatted_eta*/ @@ -8300,53 +8364,53 @@ function Mg(n) { ), i, s; return { c() { - e = Ge( + e = He( /*formatted_timer*/ n[20] - ), i = Ge(t), s = Ge("s"); + ), i = He(t), s = He("s"); }, l(r) { - e = Ue( + e = Ge( r, /*formatted_timer*/ n[20] - ), i = Ue(r, t), s = Ue(r, "s"); + ), i = Ge(r, t), s = Ge(r, "s"); }, m(r, a) { - ce(r, e, a), ce(r, i, a), ce(r, s, a); + he(r, e, a), he(r, i, a), he(r, s, a); }, p(r, a) { a[0] & /*formatted_timer*/ - 1048576 && ri( + 1048576 && ci( e, /*formatted_timer*/ r[20] ), a[0] & /*eta, formatted_eta*/ 524289 && t !== (t = /*eta*/ r[0] ? `/${/*formatted_eta*/ - r[19]}` : "") && ri(i, t); + r[19]}` : "") && ci(i, t); }, d(r) { - r && (re(e), re(i), re(s)); + r && (oe(e), oe(i), oe(s)); } }; } -function Qx(n) { +function ED(n) { let e, t; - return e = new Ox({ + return e = new sD({ props: { margin: ( /*variant*/ n[8] === "default" ) } }), { c() { - Ev(e.$$.fragment); + Mv(e.$$.fragment); }, l(i) { - yv(e.$$.fragment, i); + Ov(e.$$.fragment, i); }, m(i, s) { - Dv(e, i, s), t = !0; + Hv(e, i, s), t = !0; }, p(i, s) { const r = {}; @@ -8355,88 +8419,88 @@ function Qx(n) { i[8] === "default"), e.$set(r); }, i(i) { - t || (Si(e.$$.fragment, i), t = !0); + t || (Fi(e.$$.fragment, i), t = !0); }, o(i) { - en(e.$$.fragment, i), t = !1; + sn(e.$$.fragment, i), t = !1; }, d(i) { - Tv(e, i); + Bv(e, i); } }; } -function Zx(n) { +function bD(n) { let e, t, i, s, r, a = `${/*last_progress_level*/ n[15] * 100}%`, o = ( /*progress*/ - n[7] != null && $g(n) + n[7] != null && Zg(n) ); return { c() { - e = Ji("div"), t = Ji("div"), o && o.c(), i = ei(), s = Ji("div"), r = Ji("div"), this.h(); + e = nn("div"), t = nn("div"), o && o.c(), i = si(), s = nn("div"), r = nn("div"), this.h(); }, l(u) { - e = Zi(u, "DIV", { class: !0 }); - var l = Qi(e); - t = Zi(l, "DIV", { class: !0 }); - var c = Qi(t); - o && o.l(c), c.forEach(re), i = Jt(l), s = Zi(l, "DIV", { class: !0 }); - var h = Qi(s); - r = Zi(h, "DIV", { class: !0 }), Qi(r).forEach(re), h.forEach(re), l.forEach(re), this.h(); + e = tn(u, "DIV", { class: !0 }); + var l = en(e); + t = tn(l, "DIV", { class: !0 }); + var c = en(t); + o && o.l(c), c.forEach(oe), i = ni(l), s = tn(l, "DIV", { class: !0 }); + var h = en(s); + r = tn(h, "DIV", { class: !0 }), en(r).forEach(oe), h.forEach(oe), l.forEach(oe), this.h(); }, h() { - xi(t, "class", "progress-level-inner svelte-17v219f"), xi(r, "class", "progress-bar svelte-17v219f"), Kn(r, "width", a), xi(s, "class", "progress-bar-wrap svelte-17v219f"), xi(e, "class", "progress-level svelte-17v219f"); + Oi(t, "class", "progress-level-inner svelte-17v219f"), Oi(r, "class", "progress-bar svelte-17v219f"), Qn(r, "width", a), Oi(s, "class", "progress-bar-wrap svelte-17v219f"), Oi(e, "class", "progress-level svelte-17v219f"); }, m(u, l) { - ce(u, e, l), ps(e, t), o && o.m(t, null), ps(e, i), ps(e, s), ps(s, r), n[31](r); + he(u, e, l), bs(e, t), o && o.m(t, null), bs(e, i), bs(e, s), bs(s, r), n[31](r); }, p(u, l) { /*progress*/ - u[7] != null ? o ? o.p(u, l) : (o = $g(u), o.c(), o.m(t, null)) : o && (o.d(1), o = null), l[0] & /*last_progress_level*/ + u[7] != null ? o ? o.p(u, l) : (o = Zg(u), o.c(), o.m(t, null)) : o && (o.d(1), o = null), l[0] & /*last_progress_level*/ 32768 && a !== (a = `${/*last_progress_level*/ - u[15] * 100}%`) && Kn(r, "width", a); + u[15] * 100}%`) && Qn(r, "width", a); }, - i: Qh, - o: Qh, + i: vd, + o: vd, d(u) { - u && re(e), o && o.d(), n[31](null); + u && oe(e), o && o.d(), n[31](null); } }; } -function $g(n) { - let e, t = Rl( +function Zg(n) { + let e, t = Yl( /*progress*/ n[7] ), i = []; for (let s = 0; s < t.length; s += 1) - i[s] = Hg(Rg(n, t, s)); + i[s] = np(jg(n, t, s)); return { c() { for (let s = 0; s < i.length; s += 1) i[s].c(); - e = si(); + e = ui(); }, l(s) { for (let r = 0; r < i.length; r += 1) i[r].l(s); - e = si(); + e = ui(); }, m(s, r) { for (let a = 0; a < i.length; a += 1) i[a] && i[a].m(s, r); - ce(s, e, r); + he(s, e, r); }, p(s, r) { if (r[0] & /*progress_level, progress*/ 16512) { - t = Rl( + t = Yl( /*progress*/ s[7] ); let a; for (a = 0; a < t.length; a += 1) { - const o = Rg(s, t, a); - i[a] ? i[a].p(o, r) : (i[a] = Hg(o), i[a].c(), i[a].m(e.parentNode, e)); + const o = jg(s, t, a); + i[a] ? i[a].p(o, r) : (i[a] = np(o), i[a].c(), i[a].m(e.parentNode, e)); } for (; a < i.length; a += 1) i[a].d(1); @@ -8444,17 +8508,17 @@ function $g(n) { } }, d(s) { - s && re(e), Sv(i, s); + s && oe(e), Nv(i, s); } }; } -function Bg(n) { +function Jg(n) { let e, t, i, s, r = ( /*i*/ - n[42] !== 0 && Jx() + n[42] !== 0 && TD() ), a = ( /*p*/ - n[40].desc != null && Ng(n) + n[40].desc != null && ep(n) ), o = ( /*p*/ n[40].desc != null && /*progress_level*/ @@ -8462,97 +8526,97 @@ function Bg(n) { n[14][ /*i*/ n[42] - ] != null && Ug() + ] != null && tp() ), u = ( /*progress_level*/ - n[14] != null && Gg(n) + n[14] != null && ip(n) ); return { c() { - r && r.c(), e = ei(), a && a.c(), t = ei(), o && o.c(), i = ei(), u && u.c(), s = si(); + r && r.c(), e = si(), a && a.c(), t = si(), o && o.c(), i = si(), u && u.c(), s = ui(); }, l(l) { - r && r.l(l), e = Jt(l), a && a.l(l), t = Jt(l), o && o.l(l), i = Jt(l), u && u.l(l), s = si(); + r && r.l(l), e = ni(l), a && a.l(l), t = ni(l), o && o.l(l), i = ni(l), u && u.l(l), s = ui(); }, m(l, c) { - r && r.m(l, c), ce(l, e, c), a && a.m(l, c), ce(l, t, c), o && o.m(l, c), ce(l, i, c), u && u.m(l, c), ce(l, s, c); + r && r.m(l, c), he(l, e, c), a && a.m(l, c), he(l, t, c), o && o.m(l, c), he(l, i, c), u && u.m(l, c), he(l, s, c); }, p(l, c) { /*p*/ - l[40].desc != null ? a ? a.p(l, c) : (a = Ng(l), a.c(), a.m(t.parentNode, t)) : a && (a.d(1), a = null), /*p*/ + l[40].desc != null ? a ? a.p(l, c) : (a = ep(l), a.c(), a.m(t.parentNode, t)) : a && (a.d(1), a = null), /*p*/ l[40].desc != null && /*progress_level*/ l[14] && /*progress_level*/ l[14][ /*i*/ l[42] - ] != null ? o || (o = Ug(), o.c(), o.m(i.parentNode, i)) : o && (o.d(1), o = null), /*progress_level*/ - l[14] != null ? u ? u.p(l, c) : (u = Gg(l), u.c(), u.m(s.parentNode, s)) : u && (u.d(1), u = null); + ] != null ? o || (o = tp(), o.c(), o.m(i.parentNode, i)) : o && (o.d(1), o = null), /*progress_level*/ + l[14] != null ? u ? u.p(l, c) : (u = ip(l), u.c(), u.m(s.parentNode, s)) : u && (u.d(1), u = null); }, d(l) { - l && (re(e), re(t), re(i), re(s)), r && r.d(l), a && a.d(l), o && o.d(l), u && u.d(l); + l && (oe(e), oe(t), oe(i), oe(s)), r && r.d(l), a && a.d(l), o && o.d(l), u && u.d(l); } }; } -function Jx(n) { +function TD(n) { let e; return { c() { - e = Ge(" /"); + e = He(" /"); }, l(t) { - e = Ue(t, " /"); + e = Ge(t, " /"); }, m(t, i) { - ce(t, e, i); + he(t, e, i); }, d(t) { - t && re(e); + t && oe(e); } }; } -function Ng(n) { +function ep(n) { let e = ( /*p*/ n[40].desc + "" ), t; return { c() { - t = Ge(e); + t = He(e); }, l(i) { - t = Ue(i, e); + t = Ge(i, e); }, m(i, s) { - ce(i, t, s); + he(i, t, s); }, p(i, s) { s[0] & /*progress*/ 128 && e !== (e = /*p*/ - i[40].desc + "") && ri(t, e); + i[40].desc + "") && ci(t, e); }, d(i) { - i && re(t); + i && oe(t); } }; } -function Ug(n) { +function tp(n) { let e; return { c() { - e = Ge("-"); + e = He("-"); }, l(t) { - e = Ue(t, "-"); + e = Ge(t, "-"); }, m(t, i) { - ce(t, e, i); + he(t, e, i); }, d(t) { - t && re(e); + t && oe(e); } }; } -function Gg(n) { +function ip(n) { let e = (100 * /*progress_level*/ (n[14][ /*i*/ @@ -8560,13 +8624,13 @@ function Gg(n) { ] || 0)).toFixed(1) + "", t, i; return { c() { - t = Ge(e), i = Ge("%"); + t = He(e), i = He("%"); }, l(s) { - t = Ue(s, e), i = Ue(s, "%"); + t = Ge(s, e), i = Ge(s, "%"); }, m(s, r) { - ce(s, t, r), ce(s, i, r); + he(s, t, r), he(s, i, r); }, p(s, r) { r[0] & /*progress_level*/ @@ -8574,14 +8638,14 @@ function Gg(n) { (s[14][ /*i*/ s[42] - ] || 0)).toFixed(1) + "") && ri(t, e); + ] || 0)).toFixed(1) + "") && ci(t, e); }, d(s) { - s && (re(t), re(i)); + s && (oe(t), oe(i)); } }; } -function Hg(n) { +function np(n) { let e, t = ( /*p*/ (n[40].desc != null || /*progress_level*/ @@ -8589,17 +8653,17 @@ function Hg(n) { n[14][ /*i*/ n[42] - ] != null) && Bg(n) + ] != null) && Jg(n) ); return { c() { - t && t.c(), e = si(); + t && t.c(), e = ui(); }, l(i) { - t && t.l(i), e = si(); + t && t.l(i), e = ui(); }, m(i, s) { - t && t.m(i, s), ce(i, e, s); + t && t.m(i, s), he(i, e, s); }, p(i, s) { /*p*/ @@ -8608,87 +8672,87 @@ function Hg(n) { i[14][ /*i*/ i[42] - ] != null ? t ? t.p(i, s) : (t = Bg(i), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + ] != null ? t ? t.p(i, s) : (t = Jg(i), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, d(i) { - i && re(e), t && t.d(i); + i && oe(e), t && t.d(i); } }; } -function Vg(n) { +function sp(n) { let e, t, i, s; const r = ( /*#slots*/ n[30]["additional-loading-text"] - ), a = bv( + ), a = $v( r, n, /*$$scope*/ n[29], - kg + Kg ); return { c() { - e = Ji("p"), t = Ge( + e = nn("p"), t = He( /*loading_text*/ n[9] - ), i = ei(), a && a.c(), this.h(); + ), i = si(), a && a.c(), this.h(); }, l(o) { - e = Zi(o, "P", { class: !0 }); - var u = Qi(e); - t = Ue( + e = tn(o, "P", { class: !0 }); + var u = en(e); + t = Ge( u, /*loading_text*/ n[9] - ), u.forEach(re), i = Jt(o), a && a.l(o), this.h(); + ), u.forEach(oe), i = ni(o), a && a.l(o), this.h(); }, h() { - xi(e, "class", "loading svelte-17v219f"); + Oi(e, "class", "loading svelte-17v219f"); }, m(o, u) { - ce(o, e, u), ps(e, t), ce(o, i, u), a && a.m(o, u), s = !0; + he(o, e, u), bs(e, t), he(o, i, u), a && a.m(o, u), s = !0; }, p(o, u) { (!s || u[0] & /*loading_text*/ - 512) && ri( + 512) && ci( t, /*loading_text*/ o[9] ), a && a.p && (!s || u[0] & /*$$scope*/ - 536870912) && wv( + 536870912) && Vv( a, r, o, /*$$scope*/ o[29], - s ? xv( + s ? Gv( r, /*$$scope*/ o[29], u, - Vx - ) : Av( + dD + ) : Uv( /*$$scope*/ o[29] ), - kg + Kg ); }, i(o) { - s || (Si(a, o), s = !0); + s || (Fi(a, o), s = !0); }, o(o) { - en(a, o), s = !1; + sn(a, o), s = !1; }, d(o) { - o && (re(e), re(i)), a && a.d(o); + o && (oe(e), oe(i)), a && a.d(o); } }; } -function eD(n) { +function SD(n) { let e, t, i, s, r; - const a = [Kx, qx], o = []; + const a = [mD, fD], o = []; function u(l, c) { return ( /*status*/ @@ -8700,21 +8764,21 @@ function eD(n) { } return ~(t = u(n)) && (i = o[t] = a[t](n)), { c() { - e = Ji("div"), i && i.c(), this.h(); + e = nn("div"), i && i.c(), this.h(); }, l(l) { - e = Zi(l, "DIV", { class: !0 }); - var c = Qi(e); - i && i.l(c), c.forEach(re), this.h(); + e = tn(l, "DIV", { class: !0 }); + var c = en(e); + i && i.l(c), c.forEach(oe), this.h(); }, h() { - xi(e, "class", s = "wrap " + /*variant*/ + Oi(e, "class", s = "wrap " + /*variant*/ n[8] + " " + /*show_progress*/ - n[6] + " svelte-17v219f"), Qt(e, "hide", !/*status*/ + n[6] + " svelte-17v219f"), ti(e, "hide", !/*status*/ n[4] || /*status*/ n[4] === "complete" || /*show_progress*/ n[6] === "hidden" || /*status*/ - n[4] == "streaming"), Qt( + n[4] == "streaming"), ti( e, "translucent", /*variant*/ @@ -8723,23 +8787,23 @@ function eD(n) { n[4] === "error") || /*translucent*/ n[11] || /*show_progress*/ n[6] === "minimal" - ), Qt( + ), ti( e, "generating", /*status*/ n[4] === "generating" && /*show_progress*/ n[6] === "full" - ), Qt( + ), ti( e, "border", /*border*/ n[12] - ), Kn( + ), Qn( e, "position", /*absolute*/ n[10] ? "absolute" : "static" - ), Kn( + ), Qn( e, "padding", /*absolute*/ @@ -8747,22 +8811,22 @@ function eD(n) { ); }, m(l, c) { - ce(l, e, c), ~t && o[t].m(e, null), n[33](e), r = !0; + he(l, e, c), ~t && o[t].m(e, null), n[33](e), r = !0; }, p(l, c) { let h = t; - t = u(l), t === h ? ~t && o[t].p(l, c) : (i && (Xh(), en(o[h], 1, 1, () => { + t = u(l), t === h ? ~t && o[t].p(l, c) : (i && (_d(), sn(o[h], 1, 1, () => { o[h] = null; - }), Yh()), ~t ? (i = o[t], i ? i.p(l, c) : (i = o[t] = a[t](l), i.c()), Si(i, 1), i.m(e, null)) : i = null), (!r || c[0] & /*variant, show_progress*/ + }), pd()), ~t ? (i = o[t], i ? i.p(l, c) : (i = o[t] = a[t](l), i.c()), Fi(i, 1), i.m(e, null)) : i = null), (!r || c[0] & /*variant, show_progress*/ 320 && s !== (s = "wrap " + /*variant*/ l[8] + " " + /*show_progress*/ - l[6] + " svelte-17v219f")) && xi(e, "class", s), (!r || c[0] & /*variant, show_progress, status, show_progress*/ - 336) && Qt(e, "hide", !/*status*/ + l[6] + " svelte-17v219f")) && Oi(e, "class", s), (!r || c[0] & /*variant, show_progress, status, show_progress*/ + 336) && ti(e, "hide", !/*status*/ l[4] || /*status*/ l[4] === "complete" || /*show_progress*/ l[6] === "hidden" || /*status*/ l[4] == "streaming"), (!r || c[0] & /*variant, show_progress, variant, status, translucent, show_progress*/ - 2384) && Qt( + 2384) && ti( e, "translucent", /*variant*/ @@ -8772,26 +8836,26 @@ function eD(n) { l[11] || /*show_progress*/ l[6] === "minimal" ), (!r || c[0] & /*variant, show_progress, status, show_progress*/ - 336) && Qt( + 336) && ti( e, "generating", /*status*/ l[4] === "generating" && /*show_progress*/ l[6] === "full" ), (!r || c[0] & /*variant, show_progress, border*/ - 4416) && Qt( + 4416) && ti( e, "border", /*border*/ l[12] ), c[0] & /*absolute*/ - 1024 && Kn( + 1024 && Qn( e, "position", /*absolute*/ l[10] ? "absolute" : "static" ), c[0] & /*absolute*/ - 1024 && Kn( + 1024 && Qn( e, "padding", /*absolute*/ @@ -8799,17 +8863,17 @@ function eD(n) { ); }, i(l) { - r || (Si(i), r = !0); + r || (Fi(i), r = !0); }, o(l) { - en(i), r = !1; + sn(i), r = !1; }, d(l) { - l && re(e), ~t && o[t].d(), n[33](null); + l && oe(e), ~t && o[t].d(), n[33](null); } }; } -var tD = function(n, e, t, i) { +var AD = function(n, e, t, i) { function s(r) { return r instanceof t ? r : new t(function(a) { a(r); @@ -8836,72 +8900,72 @@ var tD = function(n, e, t, i) { l((i = i.apply(n, e || [])).next()); }); }; -let Co = [], Bc = !1; -const iD = typeof window < "u", Lv = iD ? window.requestAnimationFrame : (n) => { +let Xo = [], rh = !1; +const xD = typeof window < "u", qv = xD ? window.requestAnimationFrame : (n) => { }; -function nD(n) { - return tD(this, arguments, void 0, function* (e, t = !0) { +function DD(n) { + return AD(this, arguments, void 0, function* (e, t = !0) { if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) { - if (Co.push(e), !Bc) Bc = !0; + if (Xo.push(e), !rh) rh = !0; else return; - yield Nx(), Lv(() => { + yield lD(), qv(() => { let i = [0, 0]; - for (let s = 0; s < Co.length; s++) { - const a = Co[s].getBoundingClientRect(); + for (let s = 0; s < Xo.length; s++) { + const a = Xo[s].getBoundingClientRect(); (s === 0 || a.top + window.scrollY <= i[0]) && (i[0] = a.top + window.scrollY, i[1] = s); } - window.scrollTo({ top: i[0] - 20, behavior: "smooth" }), Bc = !1, Co = []; + window.scrollTo({ top: i[0] - 20, behavior: "smooth" }), rh = !1, Xo = []; }); } }); } -function sD(n, e, t) { +function wD(n, e, t) { let i, { $$slots: s = {}, $$scope: r } = e; - const a = Gx(); - let { i18n: o } = e, { eta: u = null } = e, { queue_position: l } = e, { queue_size: c } = e, { status: h } = e, { scroll_to_output: d = !1 } = e, { timer: f = !0 } = e, { show_progress: m = "full" } = e, { message: g = null } = e, { progress: p = null } = e, { variant: y = "default" } = e, { loading_text: v = "Loading..." } = e, { absolute: _ = !0 } = e, { translucent: E = !1 } = e, { border: T = !1 } = e, { autoscroll: A } = e, S, D = !1, x = 0, w = 0, I = null, R = null, M = 0, P = null, K, q = null, W = !0; - const U = () => { - t(0, u = t(27, I = t(19, L = null))), t(25, x = performance.now()), t(26, w = 0), D = !0, j(); + const a = cD(); + let { i18n: o } = e, { eta: u = null } = e, { queue_position: l } = e, { queue_size: c } = e, { status: h } = e, { scroll_to_output: d = !1 } = e, { timer: f = !0 } = e, { show_progress: m = "full" } = e, { message: g = null } = e, { progress: p = null } = e, { variant: y = "default" } = e, { loading_text: v = "Loading..." } = e, { absolute: _ = !0 } = e, { translucent: E = !1 } = e, { border: T = !1 } = e, { autoscroll: x } = e, S, D = !1, A = 0, w = 0, I = null, M = null, k = 0, q = null, K, H = null, Y = !0; + const B = () => { + t(0, u = t(27, I = t(19, L = null))), t(25, A = performance.now()), t(26, w = 0), D = !0, z(); }; - function j() { - Lv(() => { - t(26, w = (performance.now() - x) / 1e3), D && j(); + function z() { + qv(() => { + t(26, w = (performance.now() - A) / 1e3), D && z(); }); } - function $() { + function W() { t(26, w = 0), t(0, u = t(27, I = t(19, L = null))), D && (D = !1); } - Ux(() => { - D && $(); + uD(() => { + D && W(); }); let L = null; - function H(C) { - Lg[C ? "unshift" : "push"](() => { - q = C, t(16, q), t(7, p), t(14, P), t(15, K); + function $(O) { + Vg[O ? "unshift" : "push"](() => { + H = O, t(16, H), t(7, p), t(14, q), t(15, K); }); } const Q = () => { a("clear_status"); }; - function X(C) { - Lg[C ? "unshift" : "push"](() => { - S = C, t(13, S); + function C(O) { + Vg[O ? "unshift" : "push"](() => { + S = O, t(13, S); }); } - return n.$$set = (C) => { - "i18n" in C && t(1, o = C.i18n), "eta" in C && t(0, u = C.eta), "queue_position" in C && t(2, l = C.queue_position), "queue_size" in C && t(3, c = C.queue_size), "status" in C && t(4, h = C.status), "scroll_to_output" in C && t(22, d = C.scroll_to_output), "timer" in C && t(5, f = C.timer), "show_progress" in C && t(6, m = C.show_progress), "message" in C && t(23, g = C.message), "progress" in C && t(7, p = C.progress), "variant" in C && t(8, y = C.variant), "loading_text" in C && t(9, v = C.loading_text), "absolute" in C && t(10, _ = C.absolute), "translucent" in C && t(11, E = C.translucent), "border" in C && t(12, T = C.border), "autoscroll" in C && t(24, A = C.autoscroll), "$$scope" in C && t(29, r = C.$$scope); + return n.$$set = (O) => { + "i18n" in O && t(1, o = O.i18n), "eta" in O && t(0, u = O.eta), "queue_position" in O && t(2, l = O.queue_position), "queue_size" in O && t(3, c = O.queue_size), "status" in O && t(4, h = O.status), "scroll_to_output" in O && t(22, d = O.scroll_to_output), "timer" in O && t(5, f = O.timer), "show_progress" in O && t(6, m = O.show_progress), "message" in O && t(23, g = O.message), "progress" in O && t(7, p = O.progress), "variant" in O && t(8, y = O.variant), "loading_text" in O && t(9, v = O.loading_text), "absolute" in O && t(10, _ = O.absolute), "translucent" in O && t(11, E = O.translucent), "border" in O && t(12, T = O.border), "autoscroll" in O && t(24, x = O.autoscroll), "$$scope" in O && t(29, r = O.$$scope); }, n.$$.update = () => { n.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/ - 436207617 && (u === null && t(0, u = I), u != null && I !== u && (t(28, R = (performance.now() - x) / 1e3 + u), t(19, L = R.toFixed(1)), t(27, I = u))), n.$$.dirty[0] & /*eta_from_start, timer_diff*/ - 335544320 && t(17, M = R === null || R <= 0 || !w ? null : Math.min(w / R, 1)), n.$$.dirty[0] & /*progress*/ - 128 && p != null && t(18, W = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ - 114816 && (p != null ? t(14, P = p.map((C) => { - if (C.index != null && C.length != null) - return C.index / C.length; - if (C.progress != null) - return C.progress; - })) : t(14, P = null), P ? (t(15, K = P[P.length - 1]), q && (K === 0 ? t(16, q.style.transition = "0", q) : t(16, q.style.transition = "150ms", q))) : t(15, K = void 0)), n.$$.dirty[0] & /*status*/ - 16 && (h === "pending" ? U() : $()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ - 20979728 && S && d && (h === "pending" || h === "complete") && nD(S, A), n.$$.dirty[0] & /*status, message*/ + 436207617 && (u === null && t(0, u = I), u != null && I !== u && (t(28, M = (performance.now() - A) / 1e3 + u), t(19, L = M.toFixed(1)), t(27, I = u))), n.$$.dirty[0] & /*eta_from_start, timer_diff*/ + 335544320 && t(17, k = M === null || M <= 0 || !w ? null : Math.min(w / M, 1)), n.$$.dirty[0] & /*progress*/ + 128 && p != null && t(18, Y = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/ + 114816 && (p != null ? t(14, q = p.map((O) => { + if (O.index != null && O.length != null) + return O.index / O.length; + if (O.progress != null) + return O.progress; + })) : t(14, q = null), q ? (t(15, K = q[q.length - 1]), H && (K === 0 ? t(16, H.style.transition = "0", H) : t(16, H.style.transition = "150ms", H))) : t(15, K = void 0)), n.$$.dirty[0] & /*status*/ + 16 && (h === "pending" ? B() : W()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/ + 20979728 && S && d && (h === "pending" || h === "complete") && DD(S, x), n.$$.dirty[0] & /*status, message*/ 8388624, n.$$.dirty[0] & /*timer_diff*/ 67108864 && t(20, i = w.toFixed(1)); }, [ @@ -8919,36 +8983,36 @@ function sD(n, e, t) { E, T, S, - P, - K, q, - M, - W, + K, + H, + k, + Y, L, i, a, d, g, - A, x, + A, w, I, - R, + M, r, s, - H, + $, Q, - X + C ]; } -class Iv extends Mx { +class Kv extends rD { constructor(e) { - super(), $x( + super(), aD( this, e, - sD, - eD, - Bx, + wD, + SD, + oD, { i18n: 1, eta: 0, @@ -8974,119 +9038,119 @@ class Iv extends Mx { } /*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */ const { - entries: kv, - setPrototypeOf: qg, - isFrozen: rD, - getPrototypeOf: aD, - getOwnPropertyDescriptor: oD + entries: jv, + setPrototypeOf: rp, + isFrozen: LD, + getPrototypeOf: ID, + getOwnPropertyDescriptor: kD } = Object; let { - freeze: Dt, - seal: ai, - create: Rv + freeze: Ct, + seal: hi, + create: zv } = Object, { - apply: Zh, - construct: Jh + apply: yd, + construct: Ed } = typeof Reflect < "u" && Reflect; -Dt || (Dt = function(e) { +Ct || (Ct = function(e) { return e; }); -ai || (ai = function(e) { +hi || (hi = function(e) { return e; }); -Zh || (Zh = function(e, t, i) { +yd || (yd = function(e, t, i) { return e.apply(t, i); }); -Jh || (Jh = function(e, t) { +Ed || (Ed = function(e, t) { return new e(...t); }); -const Fo = wt(Array.prototype.forEach), lD = wt(Array.prototype.lastIndexOf), Kg = wt(Array.prototype.pop), sa = wt(Array.prototype.push), uD = wt(Array.prototype.splice), fl = wt(String.prototype.toLowerCase), Nc = wt(String.prototype.toString), jg = wt(String.prototype.match), ra = wt(String.prototype.replace), cD = wt(String.prototype.indexOf), hD = wt(String.prototype.trim), vi = wt(Object.prototype.hasOwnProperty), Et = wt(RegExp.prototype.test), aa = dD(TypeError); -function wt(n) { +const Qo = Ft(Array.prototype.forEach), RD = Ft(Array.prototype.lastIndexOf), ap = Ft(Array.prototype.pop), ga = Ft(Array.prototype.push), CD = Ft(Array.prototype.splice), Cl = Ft(String.prototype.toLowerCase), ah = Ft(String.prototype.toString), op = Ft(String.prototype.match), pa = Ft(String.prototype.replace), FD = Ft(String.prototype.indexOf), PD = Ft(String.prototype.trim), Li = Ft(Object.prototype.hasOwnProperty), xt = Ft(RegExp.prototype.test), _a = OD(TypeError); +function Ft(n) { return function(e) { e instanceof RegExp && (e.lastIndex = 0); for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++) i[s - 1] = arguments[s]; - return Zh(n, e, i); + return yd(n, e, i); }; } -function dD(n) { +function OD(n) { return function() { for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]; - return Jh(n, t); + return Ed(n, t); }; } function ge(n, e) { - let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : fl; - qg && qg(n, null); + let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Cl; + rp && rp(n, null); let i = e.length; for (; i--; ) { let s = e[i]; if (typeof s == "string") { const r = t(s); - r !== s && (rD(e) || (e[i] = r), s = r); + r !== s && (LD(e) || (e[i] = r), s = r); } n[s] = !0; } return n; } -function fD(n) { +function MD(n) { for (let e = 0; e < n.length; e++) - vi(n, e) || (n[e] = null); + Li(n, e) || (n[e] = null); return n; } -function vn(n) { - const e = Rv(null); - for (const [t, i] of kv(n)) - vi(n, t) && (Array.isArray(i) ? e[t] = fD(i) : i && typeof i == "object" && i.constructor === Object ? e[t] = vn(i) : e[t] = i); +function bn(n) { + const e = zv(null); + for (const [t, i] of jv(n)) + Li(n, t) && (Array.isArray(i) ? e[t] = MD(i) : i && typeof i == "object" && i.constructor === Object ? e[t] = bn(i) : e[t] = i); return e; } -function oa(n, e) { +function va(n, e) { for (; n !== null; ) { - const i = oD(n, e); + const i = kD(n, e); if (i) { if (i.get) - return wt(i.get); + return Ft(i.get); if (typeof i.value == "function") - return wt(i.value); + return Ft(i.value); } - n = aD(n); + n = ID(n); } function t() { return null; } return t; } -const zg = Dt(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Uc = Dt(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Gc = Dt(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), mD = Dt(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Hc = Dt(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), gD = Dt(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Wg = Dt(["#text"]), Yg = Dt(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), Vc = Dt(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Xg = Dt(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Po = Dt(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pD = ai(/\{\{[\w\W]*|[\w\W]*\}\}/gm), _D = ai(/<%[\w\W]*|[\w\W]*%>/gm), vD = ai(/\$\{[\w\W]*/gm), yD = ai(/^data-[\-\w.\u00B7-\uFFFF]+$/), ED = ai(/^aria-[\-\w]+$/), Cv = ai( +const lp = Ct(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), oh = Ct(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), lh = Ct(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), $D = Ct(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), uh = Ct(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), BD = Ct(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), up = Ct(["#text"]), cp = Ct(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), ch = Ct(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), hp = Ct(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), Zo = Ct(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), ND = hi(/\{\{[\w\W]*|[\w\W]*\}\}/gm), UD = hi(/<%[\w\W]*|[\w\W]*%>/gm), GD = hi(/\$\{[\w\W]*/gm), HD = hi(/^data-[\-\w.\u00B7-\uFFFF]+$/), VD = hi(/^aria-[\-\w]+$/), Wv = hi( /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape -), bD = ai(/^(?:\w+script|data):/i), TD = ai( +), qD = hi(/^(?:\w+script|data):/i), KD = hi( /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex -), Fv = ai(/^html$/i), SD = ai(/^[a-z][.\w]*(-[.\w]+)+$/i); -var Qg = /* @__PURE__ */ Object.freeze({ +), Yv = hi(/^html$/i), jD = hi(/^[a-z][.\w]*(-[.\w]+)+$/i); +var dp = /* @__PURE__ */ Object.freeze({ __proto__: null, - ARIA_ATTR: ED, - ATTR_WHITESPACE: TD, - CUSTOM_ELEMENT: SD, - DATA_ATTR: yD, - DOCTYPE_NAME: Fv, - ERB_EXPR: _D, - IS_ALLOWED_URI: Cv, - IS_SCRIPT_OR_DATA: bD, - MUSTACHE_EXPR: pD, - TMPLIT_EXPR: vD + ARIA_ATTR: VD, + ATTR_WHITESPACE: KD, + CUSTOM_ELEMENT: jD, + DATA_ATTR: HD, + DOCTYPE_NAME: Yv, + ERB_EXPR: UD, + IS_ALLOWED_URI: Wv, + IS_SCRIPT_OR_DATA: qD, + MUSTACHE_EXPR: ND, + TMPLIT_EXPR: GD }); -const la = { +const ya = { element: 1, text: 3, // Deprecated progressingInstruction: 7, comment: 8, document: 9 -}, AD = function() { +}, zD = function() { return typeof window > "u" ? null : window; -}, xD = function(e, t) { +}, WD = function(e, t) { if (typeof e != "object" || typeof e.createPolicy != "function") return null; let i = null; @@ -9105,7 +9169,7 @@ const la = { } catch { return console.warn("TrustedTypes policy " + r + " could not be created."), null; } -}, Zg = function() { +}, fp = function() { return { afterSanitizeAttributes: [], afterSanitizeElements: [], @@ -9118,10 +9182,10 @@ const la = { uponSanitizeShadowNode: [] }; }; -function Pv() { - let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : AD(); - const e = (ne) => Pv(ne); - if (e.version = "3.2.6", e.removed = [], !n || !n.document || n.document.nodeType !== la.document || !n.Element) +function Xv() { + let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : zD(); + const e = (ae) => Xv(ae); + if (e.version = "3.2.6", e.removed = [], !n || !n.document || n.document.nodeType !== ya.document || !n.Element) return e.isSupported = !1, e; let { document: t @@ -9136,39 +9200,39 @@ function Pv() { HTMLFormElement: h, DOMParser: d, trustedTypes: f - } = n, m = u.prototype, g = oa(m, "cloneNode"), p = oa(m, "remove"), y = oa(m, "nextSibling"), v = oa(m, "childNodes"), _ = oa(m, "parentNode"); + } = n, m = u.prototype, g = va(m, "cloneNode"), p = va(m, "remove"), y = va(m, "nextSibling"), v = va(m, "childNodes"), _ = va(m, "parentNode"); if (typeof a == "function") { - const ne = t.createElement("template"); - ne.content && ne.content.ownerDocument && (t = ne.content.ownerDocument); + const ae = t.createElement("template"); + ae.content && ae.content.ownerDocument && (t = ae.content.ownerDocument); } let E, T = ""; const { - implementation: A, + implementation: x, createNodeIterator: S, createDocumentFragment: D, - getElementsByTagName: x + getElementsByTagName: A } = t, { importNode: w } = i; - let I = Zg(); - e.isSupported = typeof kv == "function" && typeof _ == "function" && A && A.createHTMLDocument !== void 0; + let I = fp(); + e.isSupported = typeof jv == "function" && typeof _ == "function" && x && x.createHTMLDocument !== void 0; const { - MUSTACHE_EXPR: R, - ERB_EXPR: M, - TMPLIT_EXPR: P, + MUSTACHE_EXPR: M, + ERB_EXPR: k, + TMPLIT_EXPR: q, DATA_ATTR: K, - ARIA_ATTR: q, - IS_SCRIPT_OR_DATA: W, - ATTR_WHITESPACE: U, - CUSTOM_ELEMENT: j - } = Qg; + ARIA_ATTR: H, + IS_SCRIPT_OR_DATA: Y, + ATTR_WHITESPACE: B, + CUSTOM_ELEMENT: z + } = dp; let { - IS_ALLOWED_URI: $ - } = Qg, L = null; - const H = ge({}, [...zg, ...Uc, ...Gc, ...Hc, ...Wg]); + IS_ALLOWED_URI: W + } = dp, L = null; + const $ = ge({}, [...lp, ...oh, ...lh, ...uh, ...up]); let Q = null; - const X = ge({}, [...Yg, ...Vc, ...Xg, ...Po]); - let C = Object.seal(Rv(null, { + const C = ge({}, [...cp, ...ch, ...hp, ...Zo]); + let O = Object.seal(zv(null, { tagNameCheck: { writable: !0, configurable: !1, @@ -9187,168 +9251,168 @@ function Pv() { enumerable: !0, value: !1 } - })), B = null, N = null, G = !0, Y = !0, ee = !1, se = !0, ye = !1, Pe = !0, Ke = !1, jt = !1, ae = !1, he = !1, Se = !1, dt = !1, Lt = !0, un = !1; - const cn = "user-content-"; - let Cs = !0, Pi = !1, hn = {}, zt = null; - const zr = ge({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]); - let lo = null; - const Wr = ge({}, ["audio", "video", "img", "source", "image", "track"]); - let Fs = null; - const Ln = ge({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), uo = "http://www.w3.org/1998/Math/MathML", co = "http://www.w3.org/2000/svg", dn = "http://www.w3.org/1999/xhtml"; - let Ps = dn, Du = !1, wu = null; - const f1 = ge({}, [uo, co, dn], Nc); - let ho = ge({}, ["mi", "mo", "mn", "ms", "mtext"]), fo = ge({}, ["annotation-xml"]); - const m1 = ge({}, ["title", "style", "font", "a", "script"]); - let Yr = null; - const g1 = ["application/xhtml+xml", "text/html"], p1 = "text/html"; - let Je = null, Os = null; - const _1 = t.createElement("form"), jf = function(k) { - return k instanceof RegExp || k instanceof Function; - }, Lu = function() { - let k = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - if (!(Os && Os === k)) { - if ((!k || typeof k != "object") && (k = {}), k = vn(k), Yr = // eslint-disable-next-line unicorn/prefer-includes - g1.indexOf(k.PARSER_MEDIA_TYPE) === -1 ? p1 : k.PARSER_MEDIA_TYPE, Je = Yr === "application/xhtml+xml" ? Nc : fl, L = vi(k, "ALLOWED_TAGS") ? ge({}, k.ALLOWED_TAGS, Je) : H, Q = vi(k, "ALLOWED_ATTR") ? ge({}, k.ALLOWED_ATTR, Je) : X, wu = vi(k, "ALLOWED_NAMESPACES") ? ge({}, k.ALLOWED_NAMESPACES, Nc) : f1, Fs = vi(k, "ADD_URI_SAFE_ATTR") ? ge(vn(Ln), k.ADD_URI_SAFE_ATTR, Je) : Ln, lo = vi(k, "ADD_DATA_URI_TAGS") ? ge(vn(Wr), k.ADD_DATA_URI_TAGS, Je) : Wr, zt = vi(k, "FORBID_CONTENTS") ? ge({}, k.FORBID_CONTENTS, Je) : zr, B = vi(k, "FORBID_TAGS") ? ge({}, k.FORBID_TAGS, Je) : vn({}), N = vi(k, "FORBID_ATTR") ? ge({}, k.FORBID_ATTR, Je) : vn({}), hn = vi(k, "USE_PROFILES") ? k.USE_PROFILES : !1, G = k.ALLOW_ARIA_ATTR !== !1, Y = k.ALLOW_DATA_ATTR !== !1, ee = k.ALLOW_UNKNOWN_PROTOCOLS || !1, se = k.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ye = k.SAFE_FOR_TEMPLATES || !1, Pe = k.SAFE_FOR_XML !== !1, Ke = k.WHOLE_DOCUMENT || !1, he = k.RETURN_DOM || !1, Se = k.RETURN_DOM_FRAGMENT || !1, dt = k.RETURN_TRUSTED_TYPE || !1, ae = k.FORCE_BODY || !1, Lt = k.SANITIZE_DOM !== !1, un = k.SANITIZE_NAMED_PROPS || !1, Cs = k.KEEP_CONTENT !== !1, Pi = k.IN_PLACE || !1, $ = k.ALLOWED_URI_REGEXP || Cv, Ps = k.NAMESPACE || dn, ho = k.MATHML_TEXT_INTEGRATION_POINTS || ho, fo = k.HTML_INTEGRATION_POINTS || fo, C = k.CUSTOM_ELEMENT_HANDLING || {}, k.CUSTOM_ELEMENT_HANDLING && jf(k.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (C.tagNameCheck = k.CUSTOM_ELEMENT_HANDLING.tagNameCheck), k.CUSTOM_ELEMENT_HANDLING && jf(k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (C.attributeNameCheck = k.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), k.CUSTOM_ELEMENT_HANDLING && typeof k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (C.allowCustomizedBuiltInElements = k.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), ye && (Y = !1), Se && (he = !0), hn && (L = ge({}, Wg), Q = [], hn.html === !0 && (ge(L, zg), ge(Q, Yg)), hn.svg === !0 && (ge(L, Uc), ge(Q, Vc), ge(Q, Po)), hn.svgFilters === !0 && (ge(L, Gc), ge(Q, Vc), ge(Q, Po)), hn.mathMl === !0 && (ge(L, Hc), ge(Q, Xg), ge(Q, Po))), k.ADD_TAGS && (L === H && (L = vn(L)), ge(L, k.ADD_TAGS, Je)), k.ADD_ATTR && (Q === X && (Q = vn(Q)), ge(Q, k.ADD_ATTR, Je)), k.ADD_URI_SAFE_ATTR && ge(Fs, k.ADD_URI_SAFE_ATTR, Je), k.FORBID_CONTENTS && (zt === zr && (zt = vn(zt)), ge(zt, k.FORBID_CONTENTS, Je)), Cs && (L["#text"] = !0), Ke && ge(L, ["html", "head", "body"]), L.table && (ge(L, ["tbody"]), delete B.tbody), k.TRUSTED_TYPES_POLICY) { - if (typeof k.TRUSTED_TYPES_POLICY.createHTML != "function") - throw aa('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); - if (typeof k.TRUSTED_TYPES_POLICY.createScriptURL != "function") - throw aa('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); - E = k.TRUSTED_TYPES_POLICY, T = E.createHTML(""); + })), N = null, ee = null, G = !0, Z = !0, U = !1, re = !0, j = !1, Ee = !0, Oe = !1, je = !1, se = !1, ve = !1, Fe = !1, Ye = !1, Ve = !0, Gt = !1; + const dn = "user-content-"; + let Vs = !0, Ni = !1, fn = {}, Zt = null; + const ea = ge({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]); + let wo = null; + const ta = ge({}, ["audio", "video", "img", "source", "image", "track"]); + let qs = null; + const Cn = ge({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Lo = "http://www.w3.org/1998/Math/MathML", Io = "http://www.w3.org/2000/svg", mn = "http://www.w3.org/1999/xhtml"; + let Ks = mn, zu = !1, Wu = null; + const I1 = ge({}, [Lo, Io, mn], ah); + let ko = ge({}, ["mi", "mo", "mn", "ms", "mtext"]), Ro = ge({}, ["annotation-xml"]); + const k1 = ge({}, ["title", "style", "font", "a", "script"]); + let ia = null; + const R1 = ["application/xhtml+xml", "text/html"], C1 = "text/html"; + let rt = null, js = null; + const F1 = t.createElement("form"), lm = function(R) { + return R instanceof RegExp || R instanceof Function; + }, Yu = function() { + let R = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + if (!(js && js === R)) { + if ((!R || typeof R != "object") && (R = {}), R = bn(R), ia = // eslint-disable-next-line unicorn/prefer-includes + R1.indexOf(R.PARSER_MEDIA_TYPE) === -1 ? C1 : R.PARSER_MEDIA_TYPE, rt = ia === "application/xhtml+xml" ? ah : Cl, L = Li(R, "ALLOWED_TAGS") ? ge({}, R.ALLOWED_TAGS, rt) : $, Q = Li(R, "ALLOWED_ATTR") ? ge({}, R.ALLOWED_ATTR, rt) : C, Wu = Li(R, "ALLOWED_NAMESPACES") ? ge({}, R.ALLOWED_NAMESPACES, ah) : I1, qs = Li(R, "ADD_URI_SAFE_ATTR") ? ge(bn(Cn), R.ADD_URI_SAFE_ATTR, rt) : Cn, wo = Li(R, "ADD_DATA_URI_TAGS") ? ge(bn(ta), R.ADD_DATA_URI_TAGS, rt) : ta, Zt = Li(R, "FORBID_CONTENTS") ? ge({}, R.FORBID_CONTENTS, rt) : ea, N = Li(R, "FORBID_TAGS") ? ge({}, R.FORBID_TAGS, rt) : bn({}), ee = Li(R, "FORBID_ATTR") ? ge({}, R.FORBID_ATTR, rt) : bn({}), fn = Li(R, "USE_PROFILES") ? R.USE_PROFILES : !1, G = R.ALLOW_ARIA_ATTR !== !1, Z = R.ALLOW_DATA_ATTR !== !1, U = R.ALLOW_UNKNOWN_PROTOCOLS || !1, re = R.ALLOW_SELF_CLOSE_IN_ATTR !== !1, j = R.SAFE_FOR_TEMPLATES || !1, Ee = R.SAFE_FOR_XML !== !1, Oe = R.WHOLE_DOCUMENT || !1, ve = R.RETURN_DOM || !1, Fe = R.RETURN_DOM_FRAGMENT || !1, Ye = R.RETURN_TRUSTED_TYPE || !1, se = R.FORCE_BODY || !1, Ve = R.SANITIZE_DOM !== !1, Gt = R.SANITIZE_NAMED_PROPS || !1, Vs = R.KEEP_CONTENT !== !1, Ni = R.IN_PLACE || !1, W = R.ALLOWED_URI_REGEXP || Wv, Ks = R.NAMESPACE || mn, ko = R.MATHML_TEXT_INTEGRATION_POINTS || ko, Ro = R.HTML_INTEGRATION_POINTS || Ro, O = R.CUSTOM_ELEMENT_HANDLING || {}, R.CUSTOM_ELEMENT_HANDLING && lm(R.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (O.tagNameCheck = R.CUSTOM_ELEMENT_HANDLING.tagNameCheck), R.CUSTOM_ELEMENT_HANDLING && lm(R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (O.attributeNameCheck = R.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), R.CUSTOM_ELEMENT_HANDLING && typeof R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (O.allowCustomizedBuiltInElements = R.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), j && (Z = !1), Fe && (ve = !0), fn && (L = ge({}, up), Q = [], fn.html === !0 && (ge(L, lp), ge(Q, cp)), fn.svg === !0 && (ge(L, oh), ge(Q, ch), ge(Q, Zo)), fn.svgFilters === !0 && (ge(L, lh), ge(Q, ch), ge(Q, Zo)), fn.mathMl === !0 && (ge(L, uh), ge(Q, hp), ge(Q, Zo))), R.ADD_TAGS && (L === $ && (L = bn(L)), ge(L, R.ADD_TAGS, rt)), R.ADD_ATTR && (Q === C && (Q = bn(Q)), ge(Q, R.ADD_ATTR, rt)), R.ADD_URI_SAFE_ATTR && ge(qs, R.ADD_URI_SAFE_ATTR, rt), R.FORBID_CONTENTS && (Zt === ea && (Zt = bn(Zt)), ge(Zt, R.FORBID_CONTENTS, rt)), Vs && (L["#text"] = !0), Oe && ge(L, ["html", "head", "body"]), L.table && (ge(L, ["tbody"]), delete N.tbody), R.TRUSTED_TYPES_POLICY) { + if (typeof R.TRUSTED_TYPES_POLICY.createHTML != "function") + throw _a('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.'); + if (typeof R.TRUSTED_TYPES_POLICY.createScriptURL != "function") + throw _a('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.'); + E = R.TRUSTED_TYPES_POLICY, T = E.createHTML(""); } else - E === void 0 && (E = xD(f, s)), E !== null && typeof T == "string" && (T = E.createHTML("")); - Dt && Dt(k), Os = k; + E === void 0 && (E = WD(f, s)), E !== null && typeof T == "string" && (T = E.createHTML("")); + Ct && Ct(R), js = R; } - }, zf = ge({}, [...Uc, ...Gc, ...mD]), Wf = ge({}, [...Hc, ...gD]), v1 = function(k) { - let z = _(k); - (!z || !z.tagName) && (z = { - namespaceURI: Ps, + }, um = ge({}, [...oh, ...lh, ...$D]), cm = ge({}, [...uh, ...BD]), P1 = function(R) { + let X = _(R); + (!X || !X.tagName) && (X = { + namespaceURI: Ks, tagName: "template" }); - const te = fl(k.tagName), Me = fl(z.tagName); - return wu[k.namespaceURI] ? k.namespaceURI === co ? z.namespaceURI === dn ? te === "svg" : z.namespaceURI === uo ? te === "svg" && (Me === "annotation-xml" || ho[Me]) : !!zf[te] : k.namespaceURI === uo ? z.namespaceURI === dn ? te === "math" : z.namespaceURI === co ? te === "math" && fo[Me] : !!Wf[te] : k.namespaceURI === dn ? z.namespaceURI === co && !fo[Me] || z.namespaceURI === uo && !ho[Me] ? !1 : !Wf[te] && (m1[te] || !zf[te]) : !!(Yr === "application/xhtml+xml" && wu[k.namespaceURI]) : !1; - }, Oi = function(k) { - sa(e.removed, { - element: k + const ie = Cl(R.tagName), Be = Cl(X.tagName); + return Wu[R.namespaceURI] ? R.namespaceURI === Io ? X.namespaceURI === mn ? ie === "svg" : X.namespaceURI === Lo ? ie === "svg" && (Be === "annotation-xml" || ko[Be]) : !!um[ie] : R.namespaceURI === Lo ? X.namespaceURI === mn ? ie === "math" : X.namespaceURI === Io ? ie === "math" && Ro[Be] : !!cm[ie] : R.namespaceURI === mn ? X.namespaceURI === Io && !Ro[Be] || X.namespaceURI === Lo && !ko[Be] ? !1 : !cm[ie] && (k1[ie] || !um[ie]) : !!(ia === "application/xhtml+xml" && Wu[R.namespaceURI]) : !1; + }, Ui = function(R) { + ga(e.removed, { + element: R }); try { - _(k).removeChild(k); + _(R).removeChild(R); } catch { - p(k); + p(R); } - }, Ms = function(k, z) { + }, zs = function(R, X) { try { - sa(e.removed, { - attribute: z.getAttributeNode(k), - from: z + ga(e.removed, { + attribute: X.getAttributeNode(R), + from: X }); } catch { - sa(e.removed, { + ga(e.removed, { attribute: null, - from: z + from: X }); } - if (z.removeAttribute(k), k === "is") - if (he || Se) + if (X.removeAttribute(R), R === "is") + if (ve || Fe) try { - Oi(z); + Ui(X); } catch { } else try { - z.setAttribute(k, ""); + X.setAttribute(R, ""); } catch { } - }, Yf = function(k) { - let z = null, te = null; - if (ae) - k = "" + k; + }, hm = function(R) { + let X = null, ie = null; + if (se) + R = "" + R; else { - const Xe = jg(k, /^[\r\n\t ]+/); - te = Xe && Xe[0]; + const Je = op(R, /^[\r\n\t ]+/); + ie = Je && Je[0]; } - Yr === "application/xhtml+xml" && Ps === dn && (k = '' + k + ""); - const Me = E ? E.createHTML(k) : k; - if (Ps === dn) + ia === "application/xhtml+xml" && Ks === mn && (R = '' + R + ""); + const Be = E ? E.createHTML(R) : R; + if (Ks === mn) try { - z = new d().parseFromString(Me, Yr); + X = new d().parseFromString(Be, ia); } catch { } - if (!z || !z.documentElement) { - z = A.createDocument(Ps, "template", null); + if (!X || !X.documentElement) { + X = x.createDocument(Ks, "template", null); try { - z.documentElement.innerHTML = Du ? T : Me; + X.documentElement.innerHTML = zu ? T : Be; } catch { } } - const ft = z.body || z.documentElement; - return k && te && ft.insertBefore(t.createTextNode(te), ft.childNodes[0] || null), Ps === dn ? x.call(z, Ke ? "html" : "body")[0] : Ke ? z.documentElement : ft; - }, Xf = function(k) { + const vt = X.body || X.documentElement; + return R && ie && vt.insertBefore(t.createTextNode(ie), vt.childNodes[0] || null), Ks === mn ? A.call(X, Oe ? "html" : "body")[0] : Oe ? X.documentElement : vt; + }, dm = function(R) { return S.call( - k.ownerDocument || k, - k, + R.ownerDocument || R, + R, // eslint-disable-next-line no-bitwise l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION, null ); - }, Iu = function(k) { - return k instanceof h && (typeof k.nodeName != "string" || typeof k.textContent != "string" || typeof k.removeChild != "function" || !(k.attributes instanceof c) || typeof k.removeAttribute != "function" || typeof k.setAttribute != "function" || typeof k.namespaceURI != "string" || typeof k.insertBefore != "function" || typeof k.hasChildNodes != "function"); - }, Qf = function(k) { - return typeof o == "function" && k instanceof o; + }, Xu = function(R) { + return R instanceof h && (typeof R.nodeName != "string" || typeof R.textContent != "string" || typeof R.removeChild != "function" || !(R.attributes instanceof c) || typeof R.removeAttribute != "function" || typeof R.setAttribute != "function" || typeof R.namespaceURI != "string" || typeof R.insertBefore != "function" || typeof R.hasChildNodes != "function"); + }, fm = function(R) { + return typeof o == "function" && R instanceof o; }; - function fn(ne, k, z) { - Fo(ne, (te) => { - te.call(e, k, z, Os); + function gn(ae, R, X) { + Qo(ae, (ie) => { + ie.call(e, R, X, js); }); } - const Zf = function(k) { - let z = null; - if (fn(I.beforeSanitizeElements, k, null), Iu(k)) - return Oi(k), !0; - const te = Je(k.nodeName); - if (fn(I.uponSanitizeElement, k, { - tagName: te, + const mm = function(R) { + let X = null; + if (gn(I.beforeSanitizeElements, R, null), Xu(R)) + return Ui(R), !0; + const ie = rt(R.nodeName); + if (gn(I.uponSanitizeElement, R, { + tagName: ie, allowedTags: L - }), Pe && k.hasChildNodes() && !Qf(k.firstElementChild) && Et(/<[/\w!]/g, k.innerHTML) && Et(/<[/\w!]/g, k.textContent) || k.nodeType === la.progressingInstruction || Pe && k.nodeType === la.comment && Et(/<[/\w]/g, k.data)) - return Oi(k), !0; - if (!L[te] || B[te]) { - if (!B[te] && em(te) && (C.tagNameCheck instanceof RegExp && Et(C.tagNameCheck, te) || C.tagNameCheck instanceof Function && C.tagNameCheck(te))) + }), Ee && R.hasChildNodes() && !fm(R.firstElementChild) && xt(/<[/\w!]/g, R.innerHTML) && xt(/<[/\w!]/g, R.textContent) || R.nodeType === ya.progressingInstruction || Ee && R.nodeType === ya.comment && xt(/<[/\w]/g, R.data)) + return Ui(R), !0; + if (!L[ie] || N[ie]) { + if (!N[ie] && pm(ie) && (O.tagNameCheck instanceof RegExp && xt(O.tagNameCheck, ie) || O.tagNameCheck instanceof Function && O.tagNameCheck(ie))) return !1; - if (Cs && !zt[te]) { - const Me = _(k) || k.parentNode, ft = v(k) || k.childNodes; - if (ft && Me) { - const Xe = ft.length; - for (let It = Xe - 1; It >= 0; --It) { - const mn = g(ft[It], !0); - mn.__removalCount = (k.__removalCount || 0) + 1, Me.insertBefore(mn, y(k)); + if (Vs && !Zt[ie]) { + const Be = _(R) || R.parentNode, vt = v(R) || R.childNodes; + if (vt && Be) { + const Je = vt.length; + for (let Pt = Je - 1; Pt >= 0; --Pt) { + const pn = g(vt[Pt], !0); + pn.__removalCount = (R.__removalCount || 0) + 1, Be.insertBefore(pn, y(R)); } } } - return Oi(k), !0; + return Ui(R), !0; } - return k instanceof u && !v1(k) || (te === "noscript" || te === "noembed" || te === "noframes") && Et(/<\/no(script|embed|frames)/i, k.innerHTML) ? (Oi(k), !0) : (ye && k.nodeType === la.text && (z = k.textContent, Fo([R, M, P], (Me) => { - z = ra(z, Me, " "); - }), k.textContent !== z && (sa(e.removed, { - element: k.cloneNode() - }), k.textContent = z)), fn(I.afterSanitizeElements, k, null), !1); - }, Jf = function(k, z, te) { - if (Lt && (z === "id" || z === "name") && (te in t || te in _1)) + return R instanceof u && !P1(R) || (ie === "noscript" || ie === "noembed" || ie === "noframes") && xt(/<\/no(script|embed|frames)/i, R.innerHTML) ? (Ui(R), !0) : (j && R.nodeType === ya.text && (X = R.textContent, Qo([M, k, q], (Be) => { + X = pa(X, Be, " "); + }), R.textContent !== X && (ga(e.removed, { + element: R.cloneNode() + }), R.textContent = X)), gn(I.afterSanitizeElements, R, null), !1); + }, gm = function(R, X, ie) { + if (Ve && (X === "id" || X === "name") && (ie in t || ie in F1)) return !1; - if (!(Y && !N[z] && Et(K, z))) { - if (!(G && Et(q, z))) { - if (!Q[z] || N[z]) { + if (!(Z && !ee[X] && xt(K, X))) { + if (!(G && xt(H, X))) { + if (!Q[X] || ee[X]) { if ( // First condition does a very basic check if a) it's basically a valid custom element tagname AND // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck - !(em(k) && (C.tagNameCheck instanceof RegExp && Et(C.tagNameCheck, k) || C.tagNameCheck instanceof Function && C.tagNameCheck(k)) && (C.attributeNameCheck instanceof RegExp && Et(C.attributeNameCheck, z) || C.attributeNameCheck instanceof Function && C.attributeNameCheck(z)) || // Alternative, second condition checks if it's an `is`-attribute, AND + !(pm(R) && (O.tagNameCheck instanceof RegExp && xt(O.tagNameCheck, R) || O.tagNameCheck instanceof Function && O.tagNameCheck(R)) && (O.attributeNameCheck instanceof RegExp && xt(O.attributeNameCheck, X) || O.attributeNameCheck instanceof Function && O.attributeNameCheck(X)) || // Alternative, second condition checks if it's an `is`-attribute, AND // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck - z === "is" && C.allowCustomizedBuiltInElements && (C.tagNameCheck instanceof RegExp && Et(C.tagNameCheck, te) || C.tagNameCheck instanceof Function && C.tagNameCheck(te))) + X === "is" && O.allowCustomizedBuiltInElements && (O.tagNameCheck instanceof RegExp && xt(O.tagNameCheck, ie) || O.tagNameCheck instanceof Function && O.tagNameCheck(ie))) ) return !1; - } else if (!Fs[z]) { - if (!Et($, ra(te, U, ""))) { - if (!((z === "src" || z === "xlink:href" || z === "href") && k !== "script" && cD(te, "data:") === 0 && lo[k])) { - if (!(ee && !Et(W, ra(te, U, "")))) { - if (te) + } else if (!qs[X]) { + if (!xt(W, pa(ie, B, ""))) { + if (!((X === "src" || X === "xlink:href" || X === "href") && R !== "script" && FD(ie, "data:") === 0 && wo[R])) { + if (!(U && !xt(Y, pa(ie, B, "")))) { + if (ie) return !1; } } @@ -9357,324 +9421,324 @@ function Pv() { } } return !0; - }, em = function(k) { - return k !== "annotation-xml" && jg(k, j); - }, tm = function(k) { - fn(I.beforeSanitizeAttributes, k, null); + }, pm = function(R) { + return R !== "annotation-xml" && op(R, z); + }, _m = function(R) { + gn(I.beforeSanitizeAttributes, R, null); const { - attributes: z - } = k; - if (!z || Iu(k)) + attributes: X + } = R; + if (!X || Xu(R)) return; - const te = { + const ie = { attrName: "", attrValue: "", keepAttr: !0, allowedAttributes: Q, forceKeepAttr: void 0 }; - let Me = z.length; - for (; Me--; ) { - const ft = z[Me], { - name: Xe, - namespaceURI: It, - value: mn - } = ft, Xr = Je(Xe), ku = mn; - let mt = Xe === "value" ? ku : hD(ku); - if (te.attrName = Xr, te.attrValue = mt, te.keepAttr = !0, te.forceKeepAttr = void 0, fn(I.uponSanitizeAttribute, k, te), mt = te.attrValue, un && (Xr === "id" || Xr === "name") && (Ms(Xe, k), mt = cn + mt), Pe && Et(/((--!?|])>)|<\/(style|title)/i, mt)) { - Ms(Xe, k); + let Be = X.length; + for (; Be--; ) { + const vt = X[Be], { + name: Je, + namespaceURI: Pt, + value: pn + } = vt, na = rt(Je), Qu = pn; + let yt = Je === "value" ? Qu : PD(Qu); + if (ie.attrName = na, ie.attrValue = yt, ie.keepAttr = !0, ie.forceKeepAttr = void 0, gn(I.uponSanitizeAttribute, R, ie), yt = ie.attrValue, Gt && (na === "id" || na === "name") && (zs(Je, R), yt = dn + yt), Ee && xt(/((--!?|])>)|<\/(style|title)/i, yt)) { + zs(Je, R); continue; } - if (te.forceKeepAttr) + if (ie.forceKeepAttr) continue; - if (!te.keepAttr) { - Ms(Xe, k); + if (!ie.keepAttr) { + zs(Je, R); continue; } - if (!se && Et(/\/>/i, mt)) { - Ms(Xe, k); + if (!re && xt(/\/>/i, yt)) { + zs(Je, R); continue; } - ye && Fo([R, M, P], (nm) => { - mt = ra(mt, nm, " "); + j && Qo([M, k, q], (ym) => { + yt = pa(yt, ym, " "); }); - const im = Je(k.nodeName); - if (!Jf(im, Xr, mt)) { - Ms(Xe, k); + const vm = rt(R.nodeName); + if (!gm(vm, na, yt)) { + zs(Je, R); continue; } - if (E && typeof f == "object" && typeof f.getAttributeType == "function" && !It) - switch (f.getAttributeType(im, Xr)) { + if (E && typeof f == "object" && typeof f.getAttributeType == "function" && !Pt) + switch (f.getAttributeType(vm, na)) { case "TrustedHTML": { - mt = E.createHTML(mt); + yt = E.createHTML(yt); break; } case "TrustedScriptURL": { - mt = E.createScriptURL(mt); + yt = E.createScriptURL(yt); break; } } - if (mt !== ku) + if (yt !== Qu) try { - It ? k.setAttributeNS(It, Xe, mt) : k.setAttribute(Xe, mt), Iu(k) ? Oi(k) : Kg(e.removed); + Pt ? R.setAttributeNS(Pt, Je, yt) : R.setAttribute(Je, yt), Xu(R) ? Ui(R) : ap(e.removed); } catch { - Ms(Xe, k); + zs(Je, R); } } - fn(I.afterSanitizeAttributes, k, null); - }, y1 = function ne(k) { - let z = null; - const te = Xf(k); - for (fn(I.beforeSanitizeShadowDOM, k, null); z = te.nextNode(); ) - fn(I.uponSanitizeShadowNode, z, null), Zf(z), tm(z), z.content instanceof r && ne(z.content); - fn(I.afterSanitizeShadowDOM, k, null); + gn(I.afterSanitizeAttributes, R, null); + }, O1 = function ae(R) { + let X = null; + const ie = dm(R); + for (gn(I.beforeSanitizeShadowDOM, R, null); X = ie.nextNode(); ) + gn(I.uponSanitizeShadowNode, X, null), mm(X), _m(X), X.content instanceof r && ae(X.content); + gn(I.afterSanitizeShadowDOM, R, null); }; - return e.sanitize = function(ne) { - let k = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, z = null, te = null, Me = null, ft = null; - if (Du = !ne, Du && (ne = ""), typeof ne != "string" && !Qf(ne)) - if (typeof ne.toString == "function") { - if (ne = ne.toString(), typeof ne != "string") - throw aa("dirty is not a string, aborting"); + return e.sanitize = function(ae) { + let R = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, X = null, ie = null, Be = null, vt = null; + if (zu = !ae, zu && (ae = ""), typeof ae != "string" && !fm(ae)) + if (typeof ae.toString == "function") { + if (ae = ae.toString(), typeof ae != "string") + throw _a("dirty is not a string, aborting"); } else - throw aa("toString is not a function"); + throw _a("toString is not a function"); if (!e.isSupported) - return ne; - if (jt || Lu(k), e.removed = [], typeof ne == "string" && (Pi = !1), Pi) { - if (ne.nodeName) { - const mn = Je(ne.nodeName); - if (!L[mn] || B[mn]) - throw aa("root node is forbidden and cannot be sanitized in-place"); - } - } else if (ne instanceof o) - z = Yf(""), te = z.ownerDocument.importNode(ne, !0), te.nodeType === la.element && te.nodeName === "BODY" || te.nodeName === "HTML" ? z = te : z.appendChild(te); + return ae; + if (je || Yu(R), e.removed = [], typeof ae == "string" && (Ni = !1), Ni) { + if (ae.nodeName) { + const pn = rt(ae.nodeName); + if (!L[pn] || N[pn]) + throw _a("root node is forbidden and cannot be sanitized in-place"); + } + } else if (ae instanceof o) + X = hm(""), ie = X.ownerDocument.importNode(ae, !0), ie.nodeType === ya.element && ie.nodeName === "BODY" || ie.nodeName === "HTML" ? X = ie : X.appendChild(ie); else { - if (!he && !ye && !Ke && // eslint-disable-next-line unicorn/prefer-includes - ne.indexOf("<") === -1) - return E && dt ? E.createHTML(ne) : ne; - if (z = Yf(ne), !z) - return he ? null : dt ? T : ""; - } - z && ae && Oi(z.firstChild); - const Xe = Xf(Pi ? ne : z); - for (; Me = Xe.nextNode(); ) - Zf(Me), tm(Me), Me.content instanceof r && y1(Me.content); - if (Pi) - return ne; - if (he) { - if (Se) - for (ft = D.call(z.ownerDocument); z.firstChild; ) - ft.appendChild(z.firstChild); + if (!ve && !j && !Oe && // eslint-disable-next-line unicorn/prefer-includes + ae.indexOf("<") === -1) + return E && Ye ? E.createHTML(ae) : ae; + if (X = hm(ae), !X) + return ve ? null : Ye ? T : ""; + } + X && se && Ui(X.firstChild); + const Je = dm(Ni ? ae : X); + for (; Be = Je.nextNode(); ) + mm(Be), _m(Be), Be.content instanceof r && O1(Be.content); + if (Ni) + return ae; + if (ve) { + if (Fe) + for (vt = D.call(X.ownerDocument); X.firstChild; ) + vt.appendChild(X.firstChild); else - ft = z; - return (Q.shadowroot || Q.shadowrootmode) && (ft = w.call(i, ft, !0)), ft; - } - let It = Ke ? z.outerHTML : z.innerHTML; - return Ke && L["!doctype"] && z.ownerDocument && z.ownerDocument.doctype && z.ownerDocument.doctype.name && Et(Fv, z.ownerDocument.doctype.name) && (It = " -` + It), ye && Fo([R, M, P], (mn) => { - It = ra(It, mn, " "); - }), E && dt ? E.createHTML(It) : It; + vt = X; + return (Q.shadowroot || Q.shadowrootmode) && (vt = w.call(i, vt, !0)), vt; + } + let Pt = Oe ? X.outerHTML : X.innerHTML; + return Oe && L["!doctype"] && X.ownerDocument && X.ownerDocument.doctype && X.ownerDocument.doctype.name && xt(Yv, X.ownerDocument.doctype.name) && (Pt = " +` + Pt), j && Qo([M, k, q], (pn) => { + Pt = pa(Pt, pn, " "); + }), E && Ye ? E.createHTML(Pt) : Pt; }, e.setConfig = function() { - let ne = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - Lu(ne), jt = !0; + let ae = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; + Yu(ae), je = !0; }, e.clearConfig = function() { - Os = null, jt = !1; - }, e.isValidAttribute = function(ne, k, z) { - Os || Lu({}); - const te = Je(ne), Me = Je(k); - return Jf(te, Me, z); - }, e.addHook = function(ne, k) { - typeof k == "function" && sa(I[ne], k); - }, e.removeHook = function(ne, k) { - if (k !== void 0) { - const z = lD(I[ne], k); - return z === -1 ? void 0 : uD(I[ne], z, 1)[0]; - } - return Kg(I[ne]); - }, e.removeHooks = function(ne) { - I[ne] = []; + js = null, je = !1; + }, e.isValidAttribute = function(ae, R, X) { + js || Yu({}); + const ie = rt(ae), Be = rt(R); + return gm(ie, Be, X); + }, e.addHook = function(ae, R) { + typeof R == "function" && ga(I[ae], R); + }, e.removeHook = function(ae, R) { + if (R !== void 0) { + const X = RD(I[ae], R); + return X === -1 ? void 0 : CD(I[ae], X, 1)[0]; + } + return ap(I[ae]); + }, e.removeHooks = function(ae) { + I[ae] = []; }, e.removeAllHooks = function() { - I = Zg(); + I = fp(); }, e; } -Pv(); +Xv(); const { - HtmlTagHydration: dK, - SvelteComponent: fK, - add_render_callback: mK, - append_hydration: gK, - attr: pK, - bubble: _K, - check_outros: vK, - children: yK, - claim_component: EK, - claim_element: bK, - claim_html_tag: TK, - claim_space: SK, - claim_text: AK, - create_component: xK, - create_in_transition: DK, - create_out_transition: wK, - destroy_component: LK, - detach: IK, - element: kK, - get_svelte_dataset: RK, - group_outros: CK, - init: FK, - insert_hydration: PK, - listen: OK, - mount_component: MK, - run_all: $K, - safe_not_equal: BK, - set_data: NK, - space: UK, - stop_propagation: GK, - text: HK, - toggle_class: VK, - transition_in: qK, - transition_out: KK -} = window.__gradio__svelte__internal, { createEventDispatcher: jK, onMount: zK } = window.__gradio__svelte__internal, { - SvelteComponent: WK, - append_hydration: YK, - attr: XK, - bubble: QK, - check_outros: ZK, - children: JK, - claim_component: ej, - claim_element: tj, - claim_space: ij, - create_animation: nj, - create_component: sj, - destroy_component: rj, - detach: aj, - element: oj, - ensure_array_like: lj, - fix_and_outro_and_destroy_block: uj, - fix_position: cj, - group_outros: hj, - init: dj, - insert_hydration: fj, - mount_component: mj, - noop: gj, - safe_not_equal: pj, - set_style: _j, - space: vj, - transition_in: yj, - transition_out: Ej, - update_keyed_each: bj + HtmlTagHydration: AK, + SvelteComponent: xK, + add_render_callback: DK, + append_hydration: wK, + attr: LK, + bubble: IK, + check_outros: kK, + children: RK, + claim_component: CK, + claim_element: FK, + claim_html_tag: PK, + claim_space: OK, + claim_text: MK, + create_component: $K, + create_in_transition: BK, + create_out_transition: NK, + destroy_component: UK, + detach: GK, + element: HK, + get_svelte_dataset: VK, + group_outros: qK, + init: KK, + insert_hydration: jK, + listen: zK, + mount_component: WK, + run_all: YK, + safe_not_equal: XK, + set_data: QK, + space: ZK, + stop_propagation: JK, + text: ej, + toggle_class: tj, + transition_in: ij, + transition_out: nj +} = window.__gradio__svelte__internal, { createEventDispatcher: sj, onMount: rj } = window.__gradio__svelte__internal, { + SvelteComponent: aj, + append_hydration: oj, + attr: lj, + bubble: uj, + check_outros: cj, + children: hj, + claim_component: dj, + claim_element: fj, + claim_space: mj, + create_animation: gj, + create_component: pj, + destroy_component: _j, + detach: vj, + element: yj, + ensure_array_like: Ej, + fix_and_outro_and_destroy_block: bj, + fix_position: Tj, + group_outros: Sj, + init: Aj, + insert_hydration: xj, + mount_component: Dj, + noop: wj, + safe_not_equal: Lj, + set_style: Ij, + space: kj, + transition_in: Rj, + transition_out: Cj, + update_keyed_each: Fj } = window.__gradio__svelte__internal, { - SvelteComponent: DD, - attr: wD, - children: LD, - claim_element: ID, - detach: ed, - element: kD, - empty: Jg, - init: RD, - insert_hydration: Ov, - noop: ep, - safe_not_equal: CD, - set_style: tp + SvelteComponent: YD, + attr: XD, + children: QD, + claim_element: ZD, + detach: bd, + element: JD, + empty: mp, + init: ew, + insert_hydration: Qv, + noop: gp, + safe_not_equal: tw, + set_style: pp } = window.__gradio__svelte__internal; -function ip(n) { +function _p(n) { let e, t = `${/*time_limit*/ n[0]}s`; return { c() { - e = kD("div"), this.h(); + e = JD("div"), this.h(); }, l(i) { - e = ID(i, "DIV", { class: !0 }), LD(e).forEach(ed), this.h(); + e = ZD(i, "DIV", { class: !0 }), QD(e).forEach(bd), this.h(); }, h() { - wD(e, "class", "streaming-bar svelte-ga0jj6"), tp(e, "animation-duration", t); + XD(e, "class", "streaming-bar svelte-ga0jj6"), pp(e, "animation-duration", t); }, m(i, s) { - Ov(i, e, s); + Qv(i, e, s); }, p(i, s) { s & /*time_limit*/ 1 && t !== (t = `${/*time_limit*/ - i[0]}s`) && tp(e, "animation-duration", t); + i[0]}s`) && pp(e, "animation-duration", t); }, d(i) { - i && ed(e); + i && bd(e); } }; } -function FD(n) { +function iw(n) { let e, t = ( /*time_limit*/ - n[0] && ip(n) + n[0] && _p(n) ); return { c() { - t && t.c(), e = Jg(); + t && t.c(), e = mp(); }, l(i) { - t && t.l(i), e = Jg(); + t && t.l(i), e = mp(); }, m(i, s) { - t && t.m(i, s), Ov(i, e, s); + t && t.m(i, s), Qv(i, e, s); }, p(i, [s]) { /*time_limit*/ - i[0] ? t ? t.p(i, s) : (t = ip(i), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); + i[0] ? t ? t.p(i, s) : (t = _p(i), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null); }, - i: ep, - o: ep, + i: gp, + o: gp, d(i) { - i && ed(e), t && t.d(i); + i && bd(e), t && t.d(i); } }; } -function PD(n, e, t) { +function nw(n, e, t) { let { time_limit: i } = e; return n.$$set = (s) => { "time_limit" in s && t(0, i = s.time_limit); }, [i]; } -class OD extends DD { +class sw extends YD { constructor(e) { - super(), RD(this, e, PD, FD, CD, { time_limit: 0 }); + super(), ew(this, e, nw, iw, tw, { time_limit: 0 }); } } -var MD = { value: () => { +var rw = { value: () => { } }; -function Mv() { +function Zv() { for (var n = 0, e = arguments.length, t = {}, i; n < e; ++n) { if (!(i = arguments[n] + "") || i in t || /[\s.]/.test(i)) throw new Error("illegal type: " + i); t[i] = []; } - return new ml(t); + return new Fl(t); } -function ml(n) { +function Fl(n) { this._ = n; } -function $D(n, e) { +function aw(n, e) { return n.trim().split(/^|\s+/).map(function(t) { var i = "", s = t.indexOf("."); if (s >= 0 && (i = t.slice(s + 1), t = t.slice(0, s)), t && !e.hasOwnProperty(t)) throw new Error("unknown type: " + t); return { type: t, name: i }; }); } -ml.prototype = Mv.prototype = { - constructor: ml, +Fl.prototype = Zv.prototype = { + constructor: Fl, on: function(n, e) { - var t = this._, i = $D(n + "", t), s, r = -1, a = i.length; + var t = this._, i = aw(n + "", t), s, r = -1, a = i.length; if (arguments.length < 2) { - for (; ++r < a; ) if ((s = (n = i[r]).type) && (s = BD(t[s], n.name))) return s; + for (; ++r < a; ) if ((s = (n = i[r]).type) && (s = ow(t[s], n.name))) return s; return; } if (e != null && typeof e != "function") throw new Error("invalid callback: " + e); for (; ++r < a; ) - if (s = (n = i[r]).type) t[s] = np(t[s], n.name, e); - else if (e == null) for (s in t) t[s] = np(t[s], n.name, null); + if (s = (n = i[r]).type) t[s] = vp(t[s], n.name, e); + else if (e == null) for (s in t) t[s] = vp(t[s], n.name, null); return this; }, copy: function() { var n = {}, e = this._; for (var t in e) n[t] = e[t].slice(); - return new ml(n); + return new Fl(n); }, call: function(n, e) { if ((s = arguments.length - 2) > 0) for (var t = new Array(s), i = 0, s, r; i < s; ++i) t[i] = arguments[i + 2]; @@ -9686,135 +9750,135 @@ ml.prototype = Mv.prototype = { for (var i = this._[n], s = 0, r = i.length; s < r; ++s) i[s].value.apply(e, t); } }; -function BD(n, e) { +function ow(n, e) { for (var t = 0, i = n.length, s; t < i; ++t) if ((s = n[t]).name === e) return s.value; } -function np(n, e, t) { +function vp(n, e, t) { for (var i = 0, s = n.length; i < s; ++i) if (n[i].name === e) { - n[i] = MD, n = n.slice(0, i).concat(n.slice(i + 1)); + n[i] = rw, n = n.slice(0, i).concat(n.slice(i + 1)); break; } return t != null && n.push({ name: e, value: t }), n; } -var td = "http://www.w3.org/1999/xhtml"; -const sp = { +var Td = "http://www.w3.org/1999/xhtml"; +const yp = { svg: "http://www.w3.org/2000/svg", - xhtml: td, + xhtml: Td, xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/" }; -function $v(n) { +function Jv(n) { var e = n += "", t = e.indexOf(":"); - return t >= 0 && (e = n.slice(0, t)) !== "xmlns" && (n = n.slice(t + 1)), sp.hasOwnProperty(e) ? { space: sp[e], local: n } : n; + return t >= 0 && (e = n.slice(0, t)) !== "xmlns" && (n = n.slice(t + 1)), yp.hasOwnProperty(e) ? { space: yp[e], local: n } : n; } -function ND(n) { +function lw(n) { return function() { var e = this.ownerDocument, t = this.namespaceURI; - return t === td && e.documentElement.namespaceURI === td ? e.createElement(n) : e.createElementNS(t, n); + return t === Td && e.documentElement.namespaceURI === Td ? e.createElement(n) : e.createElementNS(t, n); }; } -function UD(n) { +function uw(n) { return function() { return this.ownerDocument.createElementNS(n.space, n.local); }; } -function Bv(n) { - var e = $v(n); - return (e.local ? UD : ND)(e); +function ey(n) { + var e = Jv(n); + return (e.local ? uw : lw)(e); } -function GD() { +function cw() { } -function Nv(n) { - return n == null ? GD : function() { +function ty(n) { + return n == null ? cw : function() { return this.querySelector(n); }; } -function HD(n) { - typeof n != "function" && (n = Nv(n)); +function hw(n) { + typeof n != "function" && (n = ty(n)); for (var e = this._groups, t = e.length, i = new Array(t), s = 0; s < t; ++s) for (var r = e[s], a = r.length, o = i[s] = new Array(a), u, l, c = 0; c < a; ++c) (u = r[c]) && (l = n.call(u, u.__data__, c, r)) && ("__data__" in u && (l.__data__ = u.__data__), o[c] = l); - return new oi(i, this._parents); + return new di(i, this._parents); } -function VD(n) { +function dw(n) { return n == null ? [] : Array.isArray(n) ? n : Array.from(n); } -function qD() { +function fw() { return []; } -function KD(n) { - return n == null ? qD : function() { +function mw(n) { + return n == null ? fw : function() { return this.querySelectorAll(n); }; } -function jD(n) { +function gw(n) { return function() { - return VD(n.apply(this, arguments)); + return dw(n.apply(this, arguments)); }; } -function zD(n) { - typeof n == "function" ? n = jD(n) : n = KD(n); +function pw(n) { + typeof n == "function" ? n = gw(n) : n = mw(n); for (var e = this._groups, t = e.length, i = [], s = [], r = 0; r < t; ++r) for (var a = e[r], o = a.length, u, l = 0; l < o; ++l) (u = a[l]) && (i.push(n.call(u, u.__data__, l, a)), s.push(u)); - return new oi(i, s); + return new di(i, s); } -function WD(n) { +function _w(n) { return function() { return this.matches(n); }; } -function Uv(n) { +function iy(n) { return function(e) { return e.matches(n); }; } -var YD = Array.prototype.find; -function XD(n) { +var vw = Array.prototype.find; +function yw(n) { return function() { - return YD.call(this.children, n); + return vw.call(this.children, n); }; } -function QD() { +function Ew() { return this.firstElementChild; } -function ZD(n) { - return this.select(n == null ? QD : XD(typeof n == "function" ? n : Uv(n))); +function bw(n) { + return this.select(n == null ? Ew : yw(typeof n == "function" ? n : iy(n))); } -var JD = Array.prototype.filter; -function ew() { +var Tw = Array.prototype.filter; +function Sw() { return Array.from(this.children); } -function tw(n) { +function Aw(n) { return function() { - return JD.call(this.children, n); + return Tw.call(this.children, n); }; } -function iw(n) { - return this.selectAll(n == null ? ew : tw(typeof n == "function" ? n : Uv(n))); +function xw(n) { + return this.selectAll(n == null ? Sw : Aw(typeof n == "function" ? n : iy(n))); } -function nw(n) { - typeof n != "function" && (n = WD(n)); +function Dw(n) { + typeof n != "function" && (n = _w(n)); for (var e = this._groups, t = e.length, i = new Array(t), s = 0; s < t; ++s) for (var r = e[s], a = r.length, o = i[s] = [], u, l = 0; l < a; ++l) (u = r[l]) && n.call(u, u.__data__, l, r) && o.push(u); - return new oi(i, this._parents); + return new di(i, this._parents); } -function Gv(n) { +function ny(n) { return new Array(n.length); } -function sw() { - return new oi(this._enter || this._groups.map(Gv), this._parents); +function ww() { + return new di(this._enter || this._groups.map(ny), this._parents); } -function Cl(n, e) { +function Xl(n, e) { this.ownerDocument = n.ownerDocument, this.namespaceURI = n.namespaceURI, this._next = null, this._parent = n, this.__data__ = e; } -Cl.prototype = { - constructor: Cl, +Xl.prototype = { + constructor: Xl, appendChild: function(n) { return this._parent.insertBefore(n, this._next); }, @@ -9828,35 +9892,35 @@ Cl.prototype = { return this._parent.querySelectorAll(n); } }; -function rw(n) { +function Lw(n) { return function() { return n; }; } -function aw(n, e, t, i, s, r) { +function Iw(n, e, t, i, s, r) { for (var a = 0, o, u = e.length, l = r.length; a < l; ++a) - (o = e[a]) ? (o.__data__ = r[a], i[a] = o) : t[a] = new Cl(n, r[a]); + (o = e[a]) ? (o.__data__ = r[a], i[a] = o) : t[a] = new Xl(n, r[a]); for (; a < u; ++a) (o = e[a]) && (s[a] = o); } -function ow(n, e, t, i, s, r, a) { +function kw(n, e, t, i, s, r, a) { var o, u, l = /* @__PURE__ */ new Map(), c = e.length, h = r.length, d = new Array(c), f; for (o = 0; o < c; ++o) (u = e[o]) && (d[o] = f = a.call(u, u.__data__, o, e) + "", l.has(f) ? s[o] = u : l.set(f, u)); for (o = 0; o < h; ++o) - f = a.call(n, r[o], o, r) + "", (u = l.get(f)) ? (i[o] = u, u.__data__ = r[o], l.delete(f)) : t[o] = new Cl(n, r[o]); + f = a.call(n, r[o], o, r) + "", (u = l.get(f)) ? (i[o] = u, u.__data__ = r[o], l.delete(f)) : t[o] = new Xl(n, r[o]); for (o = 0; o < c; ++o) (u = e[o]) && l.get(d[o]) === u && (s[o] = u); } -function lw(n) { +function Rw(n) { return n.__data__; } -function uw(n, e) { - if (!arguments.length) return Array.from(this, lw); - var t = e ? ow : aw, i = this._parents, s = this._groups; - typeof n != "function" && (n = rw(n)); +function Cw(n, e) { + if (!arguments.length) return Array.from(this, Rw); + var t = e ? kw : Iw, i = this._parents, s = this._groups; + typeof n != "function" && (n = Lw(n)); for (var r = s.length, a = new Array(r), o = new Array(r), u = new Array(r), l = 0; l < r; ++l) { - var c = i[l], h = s[l], d = h.length, f = cw(n.call(c, c && c.__data__, l, i)), m = f.length, g = o[l] = new Array(m), p = a[l] = new Array(m), y = u[l] = new Array(d); + var c = i[l], h = s[l], d = h.length, f = Fw(n.call(c, c && c.__data__, l, i)), m = f.length, g = o[l] = new Array(m), p = a[l] = new Array(m), y = u[l] = new Array(d); t(c, h, g, p, y, f, e); for (var v = 0, _ = 0, E, T; v < m; ++v) if (E = g[v]) { @@ -9864,34 +9928,34 @@ function uw(n, e) { E._next = T || null; } } - return a = new oi(a, i), a._enter = o, a._exit = u, a; + return a = new di(a, i), a._enter = o, a._exit = u, a; } -function cw(n) { +function Fw(n) { return typeof n == "object" && "length" in n ? n : Array.from(n); } -function hw() { - return new oi(this._exit || this._groups.map(Gv), this._parents); +function Pw() { + return new di(this._exit || this._groups.map(ny), this._parents); } -function dw(n, e, t) { +function Ow(n, e, t) { var i = this.enter(), s = this, r = this.exit(); return typeof n == "function" ? (i = n(i), i && (i = i.selection())) : i = i.append(n + ""), e != null && (s = e(s), s && (s = s.selection())), t == null ? r.remove() : t(r), i && s ? i.merge(s).order() : s; } -function fw(n) { +function Mw(n) { for (var e = n.selection ? n.selection() : n, t = this._groups, i = e._groups, s = t.length, r = i.length, a = Math.min(s, r), o = new Array(s), u = 0; u < a; ++u) for (var l = t[u], c = i[u], h = l.length, d = o[u] = new Array(h), f, m = 0; m < h; ++m) (f = l[m] || c[m]) && (d[m] = f); for (; u < s; ++u) o[u] = t[u]; - return new oi(o, this._parents); + return new di(o, this._parents); } -function mw() { +function $w() { for (var n = this._groups, e = -1, t = n.length; ++e < t; ) for (var i = n[e], s = i.length - 1, r = i[s], a; --s >= 0; ) (a = i[s]) && (r && a.compareDocumentPosition(r) ^ 4 && r.parentNode.insertBefore(a, r), r = a); return this; } -function gw(n) { - n || (n = pw); +function Bw(n) { + n || (n = Nw); function e(h, d) { return h && d ? n(h.__data__, d.__data__) : !h - !d; } @@ -9900,19 +9964,19 @@ function gw(n) { (l = a[c]) && (u[c] = l); u.sort(e); } - return new oi(s, this._parents).order(); + return new di(s, this._parents).order(); } -function pw(n, e) { +function Nw(n, e) { return n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN; } -function _w() { +function Uw() { var n = arguments[0]; return arguments[0] = this, n.apply(null, arguments), this; } -function vw() { +function Gw() { return Array.from(this); } -function yw() { +function Hw() { for (var n = this._groups, e = 0, t = n.length; e < t; ++e) for (var i = n[e], s = 0, r = i.length; s < r; ++s) { var a = i[s]; @@ -9920,114 +9984,114 @@ function yw() { } return null; } -function Ew() { +function Vw() { let n = 0; for (const e of this) ++n; return n; } -function bw() { +function qw() { return !this.node(); } -function Tw(n) { +function Kw(n) { for (var e = this._groups, t = 0, i = e.length; t < i; ++t) for (var s = e[t], r = 0, a = s.length, o; r < a; ++r) (o = s[r]) && n.call(o, o.__data__, r, s); return this; } -function Sw(n) { +function jw(n) { return function() { this.removeAttribute(n); }; } -function Aw(n) { +function zw(n) { return function() { this.removeAttributeNS(n.space, n.local); }; } -function xw(n, e) { +function Ww(n, e) { return function() { this.setAttribute(n, e); }; } -function Dw(n, e) { +function Yw(n, e) { return function() { this.setAttributeNS(n.space, n.local, e); }; } -function ww(n, e) { +function Xw(n, e) { return function() { var t = e.apply(this, arguments); t == null ? this.removeAttribute(n) : this.setAttribute(n, t); }; } -function Lw(n, e) { +function Qw(n, e) { return function() { var t = e.apply(this, arguments); t == null ? this.removeAttributeNS(n.space, n.local) : this.setAttributeNS(n.space, n.local, t); }; } -function Iw(n, e) { - var t = $v(n); +function Zw(n, e) { + var t = Jv(n); if (arguments.length < 2) { var i = this.node(); return t.local ? i.getAttributeNS(t.space, t.local) : i.getAttribute(t); } - return this.each((e == null ? t.local ? Aw : Sw : typeof e == "function" ? t.local ? Lw : ww : t.local ? Dw : xw)(t, e)); + return this.each((e == null ? t.local ? zw : jw : typeof e == "function" ? t.local ? Qw : Xw : t.local ? Yw : Ww)(t, e)); } -function Hv(n) { +function sy(n) { return n.ownerDocument && n.ownerDocument.defaultView || n.document && n || n.defaultView; } -function kw(n) { +function Jw(n) { return function() { this.style.removeProperty(n); }; } -function Rw(n, e, t) { +function eL(n, e, t) { return function() { this.style.setProperty(n, e, t); }; } -function Cw(n, e, t) { +function tL(n, e, t) { return function() { var i = e.apply(this, arguments); i == null ? this.style.removeProperty(n) : this.style.setProperty(n, i, t); }; } -function Fw(n, e, t) { - return arguments.length > 1 ? this.each((e == null ? kw : typeof e == "function" ? Cw : Rw)(n, e, t ?? "")) : Pw(this.node(), n); +function iL(n, e, t) { + return arguments.length > 1 ? this.each((e == null ? Jw : typeof e == "function" ? tL : eL)(n, e, t ?? "")) : nL(this.node(), n); } -function Pw(n, e) { - return n.style.getPropertyValue(e) || Hv(n).getComputedStyle(n, null).getPropertyValue(e); +function nL(n, e) { + return n.style.getPropertyValue(e) || sy(n).getComputedStyle(n, null).getPropertyValue(e); } -function Ow(n) { +function sL(n) { return function() { delete this[n]; }; } -function Mw(n, e) { +function rL(n, e) { return function() { this[n] = e; }; } -function $w(n, e) { +function aL(n, e) { return function() { var t = e.apply(this, arguments); t == null ? delete this[n] : this[n] = t; }; } -function Bw(n, e) { - return arguments.length > 1 ? this.each((e == null ? Ow : typeof e == "function" ? $w : Mw)(n, e)) : this.node()[n]; +function oL(n, e) { + return arguments.length > 1 ? this.each((e == null ? sL : typeof e == "function" ? aL : rL)(n, e)) : this.node()[n]; } -function Vv(n) { +function ry(n) { return n.trim().split(/^|\s+/); } -function tf(n) { - return n.classList || new qv(n); +function Sf(n) { + return n.classList || new ay(n); } -function qv(n) { - this._node = n, this._names = Vv(n.getAttribute("class") || ""); +function ay(n) { + this._node = n, this._names = ry(n.getAttribute("class") || ""); } -qv.prototype = { +ay.prototype = { add: function(n) { var e = this._names.indexOf(n); e < 0 && (this._names.push(n), this._node.setAttribute("class", this._names.join(" "))); @@ -10040,129 +10104,129 @@ qv.prototype = { return this._names.indexOf(n) >= 0; } }; -function Kv(n, e) { - for (var t = tf(n), i = -1, s = e.length; ++i < s; ) t.add(e[i]); +function oy(n, e) { + for (var t = Sf(n), i = -1, s = e.length; ++i < s; ) t.add(e[i]); } -function jv(n, e) { - for (var t = tf(n), i = -1, s = e.length; ++i < s; ) t.remove(e[i]); +function ly(n, e) { + for (var t = Sf(n), i = -1, s = e.length; ++i < s; ) t.remove(e[i]); } -function Nw(n) { +function lL(n) { return function() { - Kv(this, n); + oy(this, n); }; } -function Uw(n) { +function uL(n) { return function() { - jv(this, n); + ly(this, n); }; } -function Gw(n, e) { +function cL(n, e) { return function() { - (e.apply(this, arguments) ? Kv : jv)(this, n); + (e.apply(this, arguments) ? oy : ly)(this, n); }; } -function Hw(n, e) { - var t = Vv(n + ""); +function hL(n, e) { + var t = ry(n + ""); if (arguments.length < 2) { - for (var i = tf(this.node()), s = -1, r = t.length; ++s < r; ) if (!i.contains(t[s])) return !1; + for (var i = Sf(this.node()), s = -1, r = t.length; ++s < r; ) if (!i.contains(t[s])) return !1; return !0; } - return this.each((typeof e == "function" ? Gw : e ? Nw : Uw)(t, e)); + return this.each((typeof e == "function" ? cL : e ? lL : uL)(t, e)); } -function Vw() { +function dL() { this.textContent = ""; } -function qw(n) { +function fL(n) { return function() { this.textContent = n; }; } -function Kw(n) { +function mL(n) { return function() { var e = n.apply(this, arguments); this.textContent = e ?? ""; }; } -function jw(n) { - return arguments.length ? this.each(n == null ? Vw : (typeof n == "function" ? Kw : qw)(n)) : this.node().textContent; +function gL(n) { + return arguments.length ? this.each(n == null ? dL : (typeof n == "function" ? mL : fL)(n)) : this.node().textContent; } -function zw() { +function pL() { this.innerHTML = ""; } -function Ww(n) { +function _L(n) { return function() { this.innerHTML = n; }; } -function Yw(n) { +function vL(n) { return function() { var e = n.apply(this, arguments); this.innerHTML = e ?? ""; }; } -function Xw(n) { - return arguments.length ? this.each(n == null ? zw : (typeof n == "function" ? Yw : Ww)(n)) : this.node().innerHTML; +function yL(n) { + return arguments.length ? this.each(n == null ? pL : (typeof n == "function" ? vL : _L)(n)) : this.node().innerHTML; } -function Qw() { +function EL() { this.nextSibling && this.parentNode.appendChild(this); } -function Zw() { - return this.each(Qw); +function bL() { + return this.each(EL); } -function Jw() { +function TL() { this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild); } -function eL() { - return this.each(Jw); +function SL() { + return this.each(TL); } -function tL(n) { - var e = typeof n == "function" ? n : Bv(n); +function AL(n) { + var e = typeof n == "function" ? n : ey(n); return this.select(function() { return this.appendChild(e.apply(this, arguments)); }); } -function iL() { +function xL() { return null; } -function nL(n, e) { - var t = typeof n == "function" ? n : Bv(n), i = e == null ? iL : typeof e == "function" ? e : Nv(e); +function DL(n, e) { + var t = typeof n == "function" ? n : ey(n), i = e == null ? xL : typeof e == "function" ? e : ty(e); return this.select(function() { return this.insertBefore(t.apply(this, arguments), i.apply(this, arguments) || null); }); } -function sL() { +function wL() { var n = this.parentNode; n && n.removeChild(this); } -function rL() { - return this.each(sL); +function LL() { + return this.each(wL); } -function aL() { +function IL() { var n = this.cloneNode(!1), e = this.parentNode; return e ? e.insertBefore(n, this.nextSibling) : n; } -function oL() { +function kL() { var n = this.cloneNode(!0), e = this.parentNode; return e ? e.insertBefore(n, this.nextSibling) : n; } -function lL(n) { - return this.select(n ? oL : aL); +function RL(n) { + return this.select(n ? kL : IL); } -function uL(n) { +function CL(n) { return arguments.length ? this.property("__data__", n) : this.node().__data__; } -function cL(n) { +function FL(n) { return function(e) { n.call(this, e, this.__data__); }; } -function hL(n) { +function PL(n) { return n.trim().split(/^|\s+/).map(function(e) { var t = "", i = e.indexOf("."); return i >= 0 && (t = e.slice(i + 1), e = e.slice(0, i)), { type: e, name: t }; }); } -function dL(n) { +function OL(n) { return function() { var e = this.__on; if (e) { @@ -10172,9 +10236,9 @@ function dL(n) { } }; } -function fL(n, e, t) { +function ML(n, e, t) { return function() { - var i = this.__on, s, r = cL(e); + var i = this.__on, s, r = FL(e); if (i) { for (var a = 0, o = i.length; a < o; ++a) if ((s = i[a]).type === n.type && s.name === n.name) { @@ -10185,8 +10249,8 @@ function fL(n, e, t) { this.addEventListener(n.type, r, t), s = { type: n.type, name: n.name, value: e, listener: r, options: t }, i ? i.push(s) : this.__on = [s]; }; } -function mL(n, e, t) { - var i = hL(n + ""), s, r = i.length, a; +function $L(n, e, t) { + var i = PL(n + ""), s, r = i.length, a; if (arguments.length < 2) { var o = this.node().__on; if (o) { @@ -10197,86 +10261,86 @@ function mL(n, e, t) { } return; } - for (o = e ? fL : dL, s = 0; s < r; ++s) this.each(o(i[s], e, t)); + for (o = e ? ML : OL, s = 0; s < r; ++s) this.each(o(i[s], e, t)); return this; } -function zv(n, e, t) { - var i = Hv(n), s = i.CustomEvent; +function uy(n, e, t) { + var i = sy(n), s = i.CustomEvent; typeof s == "function" ? s = new s(e, t) : (s = i.document.createEvent("Event"), t ? (s.initEvent(e, t.bubbles, t.cancelable), s.detail = t.detail) : s.initEvent(e, !1, !1)), n.dispatchEvent(s); } -function gL(n, e) { +function BL(n, e) { return function() { - return zv(this, n, e); + return uy(this, n, e); }; } -function pL(n, e) { +function NL(n, e) { return function() { - return zv(this, n, e.apply(this, arguments)); + return uy(this, n, e.apply(this, arguments)); }; } -function _L(n, e) { - return this.each((typeof e == "function" ? pL : gL)(n, e)); +function UL(n, e) { + return this.each((typeof e == "function" ? NL : BL)(n, e)); } -function* vL() { +function* GL() { for (var n = this._groups, e = 0, t = n.length; e < t; ++e) for (var i = n[e], s = 0, r = i.length, a; s < r; ++s) (a = i[s]) && (yield a); } -var yL = [null]; -function oi(n, e) { +var HL = [null]; +function di(n, e) { this._groups = n, this._parents = e; } -function EL() { +function VL() { return this; } -oi.prototype = { - constructor: oi, - select: HD, - selectAll: zD, - selectChild: ZD, - selectChildren: iw, - filter: nw, - data: uw, - enter: sw, - exit: hw, - join: dw, - merge: fw, - selection: EL, - order: mw, - sort: gw, - call: _w, - nodes: vw, - node: yw, - size: Ew, - empty: bw, - each: Tw, - attr: Iw, - style: Fw, - property: Bw, - classed: Hw, - text: jw, - html: Xw, - raise: Zw, - lower: eL, - append: tL, - insert: nL, - remove: rL, - clone: lL, - datum: uL, - on: mL, - dispatch: _L, - [Symbol.iterator]: vL +di.prototype = { + constructor: di, + select: hw, + selectAll: pw, + selectChild: bw, + selectChildren: xw, + filter: Dw, + data: Cw, + enter: ww, + exit: Pw, + join: Ow, + merge: Mw, + selection: VL, + order: $w, + sort: Bw, + call: Uw, + nodes: Gw, + node: Hw, + size: Vw, + empty: qw, + each: Kw, + attr: Zw, + style: iL, + property: oL, + classed: hL, + text: gL, + html: yL, + raise: bL, + lower: SL, + append: AL, + insert: DL, + remove: LL, + clone: RL, + datum: CL, + on: $L, + dispatch: UL, + [Symbol.iterator]: GL }; -function Fa(n) { - return typeof n == "string" ? new oi([[document.querySelector(n)]], [document.documentElement]) : new oi([[n]], yL); +function Ka(n) { + return typeof n == "string" ? new di([[document.querySelector(n)]], [document.documentElement]) : new di([[n]], HL); } -function bL(n) { +function qL(n) { let e; for (; e = n.sourceEvent; ) n = e; return n; } -function rp(n, e) { - if (n = bL(n), e === void 0 && (e = n.currentTarget), e) { +function Ep(n, e) { + if (n = qL(n), e === void 0 && (e = n.currentTarget), e) { var t = e.ownerSVGElement || e; if (t.createSVGPoint) { var i = t.createSVGPoint(); @@ -10289,25 +10353,25 @@ function rp(n, e) { } return [n.pageX, n.pageY]; } -const TL = { passive: !1 }, Pa = { capture: !0, passive: !1 }; -function qc(n) { +const KL = { passive: !1 }, ja = { capture: !0, passive: !1 }; +function hh(n) { n.stopImmediatePropagation(); } -function dr(n) { +function Ar(n) { n.preventDefault(), n.stopImmediatePropagation(); } -function SL(n) { - var e = n.document.documentElement, t = Fa(n).on("dragstart.drag", dr, Pa); - "onselectstart" in e ? t.on("selectstart.drag", dr, Pa) : (e.__noselect = e.style.MozUserSelect, e.style.MozUserSelect = "none"); +function jL(n) { + var e = n.document.documentElement, t = Ka(n).on("dragstart.drag", Ar, ja); + "onselectstart" in e ? t.on("selectstart.drag", Ar, ja) : (e.__noselect = e.style.MozUserSelect, e.style.MozUserSelect = "none"); } -function AL(n, e) { - var t = n.document.documentElement, i = Fa(n).on("dragstart.drag", null); - e && (i.on("click.drag", dr, Pa), setTimeout(function() { +function zL(n, e) { + var t = n.document.documentElement, i = Ka(n).on("dragstart.drag", null); + e && (i.on("click.drag", Ar, ja), setTimeout(function() { i.on("click.drag", null); }, 0)), "onselectstart" in t ? i.on("selectstart.drag", null) : (t.style.MozUserSelect = t.__noselect, delete t.__noselect); } -const Oo = (n) => () => n; -function id(n, { +const Jo = (n) => () => n; +function Sd(n, { sourceEvent: e, subject: t, target: i, @@ -10333,66 +10397,66 @@ function id(n, { _: { value: c } }); } -id.prototype.on = function() { +Sd.prototype.on = function() { var n = this._.on.apply(this._, arguments); return n === this._ ? this : n; }; -function xL(n) { +function WL(n) { return !n.ctrlKey && !n.button; } -function DL() { +function YL() { return this.parentNode; } -function wL(n, e) { +function XL(n, e) { return e ?? { x: n.x, y: n.y }; } -function LL() { +function QL() { return navigator.maxTouchPoints || "ontouchstart" in this; } -function IL() { - var n = xL, e = DL, t = wL, i = LL, s = {}, r = Mv("start", "drag", "end"), a = 0, o, u, l, c, h = 0; +function ZL() { + var n = WL, e = YL, t = XL, i = QL, s = {}, r = Zv("start", "drag", "end"), a = 0, o, u, l, c, h = 0; function d(E) { - E.on("mousedown.drag", f).filter(i).on("touchstart.drag", p).on("touchmove.drag", y, TL).on("touchend.drag touchcancel.drag", v).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); + E.on("mousedown.drag", f).filter(i).on("touchstart.drag", p).on("touchmove.drag", y, KL).on("touchend.drag touchcancel.drag", v).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)"); } function f(E, T) { if (!(c || !n.call(this, E, T))) { - var A = _(this, e.call(this, E, T), E, T, "mouse"); - A && (Fa(E.view).on("mousemove.drag", m, Pa).on("mouseup.drag", g, Pa), SL(E.view), qc(E), l = !1, o = E.clientX, u = E.clientY, A("start", E)); + var x = _(this, e.call(this, E, T), E, T, "mouse"); + x && (Ka(E.view).on("mousemove.drag", m, ja).on("mouseup.drag", g, ja), jL(E.view), hh(E), l = !1, o = E.clientX, u = E.clientY, x("start", E)); } } function m(E) { - if (dr(E), !l) { - var T = E.clientX - o, A = E.clientY - u; - l = T * T + A * A > h; + if (Ar(E), !l) { + var T = E.clientX - o, x = E.clientY - u; + l = T * T + x * x > h; } s.mouse("drag", E); } function g(E) { - Fa(E.view).on("mousemove.drag mouseup.drag", null), AL(E.view, l), dr(E), s.mouse("end", E); + Ka(E.view).on("mousemove.drag mouseup.drag", null), zL(E.view, l), Ar(E), s.mouse("end", E); } function p(E, T) { if (n.call(this, E, T)) { - var A = E.changedTouches, S = e.call(this, E, T), D = A.length, x, w; - for (x = 0; x < D; ++x) - (w = _(this, S, E, T, A[x].identifier, A[x])) && (qc(E), w("start", E, A[x])); + var x = E.changedTouches, S = e.call(this, E, T), D = x.length, A, w; + for (A = 0; A < D; ++A) + (w = _(this, S, E, T, x[A].identifier, x[A])) && (hh(E), w("start", E, x[A])); } } function y(E) { - var T = E.changedTouches, A = T.length, S, D; - for (S = 0; S < A; ++S) - (D = s[T[S].identifier]) && (dr(E), D("drag", E, T[S])); + var T = E.changedTouches, x = T.length, S, D; + for (S = 0; S < x; ++S) + (D = s[T[S].identifier]) && (Ar(E), D("drag", E, T[S])); } function v(E) { - var T = E.changedTouches, A = T.length, S, D; + var T = E.changedTouches, x = T.length, S, D; for (c && clearTimeout(c), c = setTimeout(function() { c = null; - }, 500), S = 0; S < A; ++S) - (D = s[T[S].identifier]) && (qc(E), D("end", E, T[S])); + }, 500), S = 0; S < x; ++S) + (D = s[T[S].identifier]) && (hh(E), D("end", E, T[S])); } - function _(E, T, A, S, D, x) { - var w = r.copy(), I = rp(x || A, T), R, M, P; - if ((P = t.call(E, new id("beforestart", { - sourceEvent: A, + function _(E, T, x, S, D, A) { + var w = r.copy(), I = Ep(A || x, T), M, k, q; + if ((q = t.call(E, new Sd("beforestart", { + sourceEvent: x, target: d, identifier: D, active: a, @@ -10402,31 +10466,31 @@ function IL() { dy: 0, dispatch: w }), S)) != null) - return R = P.x - I[0] || 0, M = P.y - I[1] || 0, function K(q, W, U) { - var j = I, $; - switch (q) { + return M = q.x - I[0] || 0, k = q.y - I[1] || 0, function K(H, Y, B) { + var z = I, W; + switch (H) { case "start": - s[D] = K, $ = a++; + s[D] = K, W = a++; break; case "end": delete s[D], --a; case "drag": - I = rp(U || W, T), $ = a; + I = Ep(B || Y, T), W = a; break; } w.call( - q, + H, E, - new id(q, { - sourceEvent: W, - subject: P, + new Sd(H, { + sourceEvent: Y, + subject: q, target: d, identifier: D, - active: $, - x: I[0] + R, - y: I[1] + M, - dx: I[0] - j[0], - dy: I[1] - j[1], + active: W, + x: I[0] + M, + y: I[1] + k, + dx: I[0] - z[0], + dy: I[1] - z[1], dispatch: w }), S @@ -10434,13 +10498,13 @@ function IL() { }; } return d.filter = function(E) { - return arguments.length ? (n = typeof E == "function" ? E : Oo(!!E), d) : n; + return arguments.length ? (n = typeof E == "function" ? E : Jo(!!E), d) : n; }, d.container = function(E) { - return arguments.length ? (e = typeof E == "function" ? E : Oo(E), d) : e; + return arguments.length ? (e = typeof E == "function" ? E : Jo(E), d) : e; }, d.subject = function(E) { - return arguments.length ? (t = typeof E == "function" ? E : Oo(E), d) : t; + return arguments.length ? (t = typeof E == "function" ? E : Jo(E), d) : t; }, d.touchable = function(E) { - return arguments.length ? (i = typeof E == "function" ? E : Oo(!!E), d) : i; + return arguments.length ? (i = typeof E == "function" ? E : Jo(!!E), d) : i; }, d.on = function() { var E = r.on.apply(r, arguments); return E === r ? d : E; @@ -10449,37 +10513,39 @@ function IL() { }, d; } const { - SvelteComponent: kL, - append_hydration: _i, - attr: Ui, - binding_callbacks: Kc, - children: zs, - claim_element: Cn, - claim_space: Mo, - create_slot: RL, - detach: as, - element: Fn, - get_all_dirty_from_scope: CL, - get_slot_changes: FL, - get_svelte_dataset: ap, - init: PL, - insert_hydration: OL, - listen: op, - run_all: ML, - safe_not_equal: $L, - set_style: Ws, - space: $o, - toggle_class: Pn, - transition_in: BL, - transition_out: NL, - update_slot_base: UL -} = window.__gradio__svelte__internal, { onMount: GL, createEventDispatcher: HL } = window.__gradio__svelte__internal; -function VL(n) { + SvelteComponent: JL, + append_hydration: wi, + attr: qi, + binding_callbacks: dh, + bubble: eI, + children: rr, + claim_element: Un, + claim_space: el, + create_slot: tI, + detach: ds, + element: Gn, + get_all_dirty_from_scope: iI, + get_slot_changes: nI, + get_svelte_dataset: bp, + init: sI, + insert_hydration: rI, + listen: Tp, + run_all: aI, + safe_not_equal: oI, + set_style: tl, + space: il, + stop_propagation: lI, + toggle_class: Hn, + transition_in: uI, + transition_out: cI, + update_slot_base: hI +} = window.__gradio__svelte__internal, { onMount: dI, tick: Sp } = window.__gradio__svelte__internal; +function fI(n) { let e, t, i, s, r, a, o = "◢", u, l, c, h, d = "◢", f, m, g, p, y; const v = ( /*#slots*/ n[11].default - ), _ = RL( + ), _ = tI( v, n, /*$$scope*/ @@ -10488,241 +10554,243 @@ function VL(n) { ); return { c() { - e = Fn("div"), t = Fn("div"), _ && _.c(), i = $o(), s = Fn("div"), r = Fn("span"), a = Fn("span"), a.textContent = o, u = $o(), l = Fn("span"), c = $o(), h = Fn("span"), h.textContent = d, f = $o(), m = Fn("div"), this.h(); + e = Gn("div"), t = Gn("div"), _ && _.c(), i = il(), s = Gn("div"), r = Gn("span"), a = Gn("span"), a.textContent = o, u = il(), l = Gn("span"), c = il(), h = Gn("span"), h.textContent = d, f = il(), m = Gn("div"), this.h(); }, l(E) { - e = Cn(E, "DIV", { class: !0, role: !0 }); - var T = zs(e); - t = Cn(T, "DIV", { class: !0 }); - var A = zs(t); - _ && _.l(A), A.forEach(as), i = Mo(T), s = Cn(T, "DIV", { class: !0, role: !0, style: !0 }); - var S = zs(s); - r = Cn(S, "SPAN", { class: !0 }); - var D = zs(r); - a = Cn(D, "SPAN", { class: !0, "data-svelte-h": !0 }), ap(a) !== "svelte-9lsvah" && (a.textContent = o), u = Mo(D), l = Cn(D, "SPAN", { class: !0 }), zs(l).forEach(as), c = Mo(D), h = Cn(D, "SPAN", { class: !0, "data-svelte-h": !0 }), ap(h) !== "svelte-1lu38by" && (h.textContent = d), D.forEach(as), f = Mo(S), m = Cn(S, "DIV", { class: !0 }), zs(m).forEach(as), S.forEach(as), T.forEach(as), this.h(); + e = Un(E, "DIV", { class: !0, role: !0 }); + var T = rr(e); + t = Un(T, "DIV", { class: !0 }); + var x = rr(t); + _ && _.l(x), x.forEach(ds), i = el(T), s = Un(T, "DIV", { class: !0, role: !0 }); + var S = rr(s); + r = Un(S, "SPAN", { class: !0 }); + var D = rr(r); + a = Un(D, "SPAN", { class: !0, "data-svelte-h": !0 }), bp(a) !== "svelte-9lsvah" && (a.textContent = o), u = el(D), l = Un(D, "SPAN", { class: !0 }), rr(l).forEach(ds), c = el(D), h = Un(D, "SPAN", { class: !0, "data-svelte-h": !0 }), bp(h) !== "svelte-1lu38by" && (h.textContent = d), D.forEach(ds), f = el(S), m = Un(S, "DIV", { class: !0 }), rr(m).forEach(ds), S.forEach(ds), T.forEach(ds), this.h(); }, h() { - Ui(t, "class", "content svelte-12ucyq4"), Ui(a, "class", "icon left svelte-12ucyq4"), Ui(l, "class", "icon center svelte-12ucyq4"), Ws( + qi(t, "class", "content svelte-14nlqs6"), qi(a, "class", "icon left svelte-14nlqs6"), qi(l, "class", "icon center svelte-14nlqs6"), tl( l, "--color", /*slider_color*/ - n[4] - ), Ui(h, "class", "icon right svelte-12ucyq4"), Ui(r, "class", "icon-wrap svelte-12ucyq4"), Pn( + n[3] + ), qi(h, "class", "icon right svelte-14nlqs6"), qi(r, "class", "icon-wrap svelte-14nlqs6"), Hn( r, "active", /*active*/ - n[7] - ), Pn( + n[5] + ), Hn( r, "disabled", /*disabled*/ - n[3] - ), Ui(m, "class", "inner svelte-12ucyq4"), Ws( + n[2] + ), qi(m, "class", "inner svelte-14nlqs6"), tl( m, "--color", /*slider_color*/ - n[4] - ), Ui(s, "class", "outer svelte-12ucyq4"), Ui(s, "role", "none"), Ws(s, "transform", "translateX(" + /*px*/ - n[6] + "px)"), Pn( + n[3] + ), qi(s, "class", "outer svelte-14nlqs6"), qi(s, "role", "none"), Hn( s, "disabled", /*disabled*/ - n[3] - ), Pn( + n[2] + ), Hn( s, "grab", /*active*/ - n[7] - ), Ui(e, "class", "wrap svelte-12ucyq4"), Ui(e, "role", "none"); + n[5] + ), qi(e, "class", "wrap svelte-14nlqs6"), qi(e, "role", "none"); }, m(E, T) { - OL(E, e, T), _i(e, t), _ && _.m(t, null), n[13](t), _i(e, i), _i(e, s), _i(s, r), _i(r, a), _i(r, u), _i(r, l), _i(r, c), _i(r, h), _i(s, f), _i(s, m), n[14](s), n[15](e), g = !0, p || (y = [ - op( + rI(E, e, T), wi(e, t), _ && _.m(t, null), n[14](t), wi(e, i), wi(e, s), wi(s, r), wi(r, a), wi(r, u), wi(r, l), wi(r, c), wi(r, h), wi(s, f), wi(s, m), n[15](s), n[16](e), g = !0, p || (y = [ + Tp( window, "resize", /*resize_handler*/ - n[12] + n[13] ), - op(s, "click", KL) + Tp(s, "click", lI( + /*click_handler*/ + n[12] + )) ], p = !0); }, p(E, [T]) { _ && _.p && (!g || T & /*$$scope*/ - 1024) && UL( + 1024) && hI( _, v, E, /*$$scope*/ E[10], - g ? FL( + g ? nI( v, /*$$scope*/ E[10], T, null - ) : CL( + ) : iI( /*$$scope*/ E[10] ), null ), T & /*slider_color*/ - 16 && Ws( + 8 && tl( l, "--color", /*slider_color*/ - E[4] + E[3] ), (!g || T & /*active*/ - 128) && Pn( + 32) && Hn( r, "active", /*active*/ - E[7] + E[5] ), (!g || T & /*disabled*/ - 8) && Pn( + 4) && Hn( r, "disabled", /*disabled*/ - E[3] + E[2] ), T & /*slider_color*/ - 16 && Ws( + 8 && tl( m, "--color", /*slider_color*/ - E[4] - ), (!g || T & /*px*/ - 64) && Ws(s, "transform", "translateX(" + /*px*/ - E[6] + "px)"), (!g || T & /*disabled*/ - 8) && Pn( + E[3] + ), (!g || T & /*disabled*/ + 4) && Hn( s, "disabled", /*disabled*/ - E[3] + E[2] ), (!g || T & /*active*/ - 128) && Pn( + 32) && Hn( s, "grab", /*active*/ - E[7] + E[5] ); }, i(E) { - g || (BL(_, E), g = !0); + g || (uI(_, E), g = !0); }, o(E) { - NL(_, E), g = !1; + cI(_, E), g = !1; }, d(E) { - E && as(e), _ && _.d(E), n[13](null), n[14](null), n[15](null), p = !1, ML(y); + E && ds(e), _ && _.d(E), n[14](null), n[15](null), n[16](null), p = !1, aI(y); } }; } -function jc(n, e, t) { +function Ap(n, e, t) { return Math.min(Math.max(n, e), t); } -function qL(n, e) { +function mI(n, e) { const t = Math.pow(10, e); return Math.round((n + Number.EPSILON) * t) / t; } -const KL = (n) => n.stopPropagation(); -function jL(n, e, t) { - let { $$slots: i = {}, $$scope: s } = e, { position: r = 0.5 } = e, { disabled: a = !1 } = e, { slider_color: o = "var(--border-color-primary)" } = e, { image_size: u = { top: 0, left: 0, width: 0, height: 0 } } = e, { el: l = void 0 } = e, { parent_el: c = void 0 } = e; - const h = HL(); - let d, f = 0, m = !1, g = 0, p, y = !1; - function v(R) { - g = (c == null ? void 0 : c.getBoundingClientRect().width) || 0, R === 0 && t( - 0, - u.width = (l == null ? void 0 : l.getBoundingClientRect().width) || 0, - u - ), t(6, f = jc(u.width * r + u.left, 0, g)); +function gI(n, e, t) { + let { $$slots: i = {}, $$scope: s } = e, { position: r = 0.5 } = e, { disabled: a = !1 } = e, { slider_color: o = "var(--border-color-primary)" } = e, { image_size: u } = e, { el: l = void 0 } = e, { parent_el: c = void 0 } = e, h, d = 0, f = !1, m = 0; + function g() { + if (!c) return; + m = c.getBoundingClientRect().width, t(9, d = Ap(m * r, 0, m)); } - function _(R) { - t(6, f = jc(R, 0, g)), t(9, r = qL((R - u.left) / u.width, 5)); + function p(A) { + !c || !(u != null && u.width) || (m = c.getBoundingClientRect().width, t(9, d = Ap(A, 0, m)), t(7, r = mI((d - u.left) / u.width, 5))); } - function E(R) { - a || (t(7, m = !0), _(R.x), p = R.x, y = !1); + function y(A) { + a || (t(5, f = !0), p(A.x)); } - function T(R) { - a || (_(R.x), Math.abs(R.x - p) > 3 && (y = !0)); + function v(A) { + a || p(A.x); } - function A(R) { - a || (t(7, m = !1), y || h("click", R.sourceEvent)); + function _() { + a || t(5, f = !1); } - function S(R) { - t(6, f = jc(u.width * R + u.left, 0, g)); - } - GL(() => { - v(u.width); - const R = IL().on("start", E).on("drag", T).on("end", A); - Fa(d).call(R); + dI(() => { + if (!h) return; + const A = ZL().on("start", y).on("drag", v).on("end", _).touchable(() => !0); + Ka(h).call(A); + const w = new ResizeObserver(() => { + Sp().then(() => g()); + }); + return c && w.observe(c), () => { + w.disconnect(); + }; }); - const D = () => v(u.width); - function x(R) { - Kc[R ? "unshift" : "push"](() => { - l = R, t(1, l); + function E(A) { + eI.call(this, n, A); + } + const T = () => { + Sp().then(() => g()); + }; + function x(A) { + dh[A ? "unshift" : "push"](() => { + l = A, t(0, l); }); } - function w(R) { - Kc[R ? "unshift" : "push"](() => { - d = R, t(5, d); + function S(A) { + dh[A ? "unshift" : "push"](() => { + h = A, t(4, h), t(9, d); }); } - function I(R) { - Kc[R ? "unshift" : "push"](() => { - c = R, t(2, c); + function D(A) { + dh[A ? "unshift" : "push"](() => { + c = A, t(1, c); }); } - return n.$$set = (R) => { - "position" in R && t(9, r = R.position), "disabled" in R && t(3, a = R.disabled), "slider_color" in R && t(4, o = R.slider_color), "image_size" in R && t(0, u = R.image_size), "el" in R && t(1, l = R.el), "parent_el" in R && t(2, c = R.parent_el), "$$scope" in R && t(10, s = R.$$scope); + return n.$$set = (A) => { + "position" in A && t(7, r = A.position), "disabled" in A && t(2, a = A.disabled), "slider_color" in A && t(3, o = A.slider_color), "image_size" in A && t(8, u = A.image_size), "el" in A && t(0, l = A.el), "parent_el" in A && t(1, c = A.parent_el), "$$scope" in A && t(10, s = A.$$scope); }, n.$$.update = () => { - n.$$.dirty & /*image_size*/ - 1 && v(u.width), n.$$.dirty & /*position*/ - 512 && S(r); - }, [ - u, + n.$$.dirty & /*inner, px*/ + 528 && h && t(4, h.style.transform = `translateX(${d}px)`, h); + }, g(), [ l, c, a, o, - d, + h, f, - m, - v, + g, r, + u, + d, s, i, - D, + E, + T, x, - w, - I + S, + D ]; } -class zL extends kL { +class pI extends JL { constructor(e) { - super(), PL(this, e, jL, VL, $L, { - position: 9, - disabled: 3, - slider_color: 4, - image_size: 0, - el: 1, - parent_el: 2 + super(), sI(this, e, gI, fI, oI, { + position: 7, + disabled: 2, + slider_color: 3, + image_size: 8, + el: 0, + parent_el: 1 }); } } -const WL = new Error("failed to get response body reader"), YL = new Error("failed to complete download"), XL = "Content-Length", QL = async (n, e) => { +const _I = new Error("failed to get response body reader"), vI = new Error("failed to complete download"), yI = "Content-Length", EI = async (n, e) => { var s; const t = await fetch(n); let i; try { - const r = parseInt(t.headers.get(XL) || "-1"), a = (s = t.body) == null ? void 0 : s.getReader(); + const r = parseInt(t.headers.get(yI) || "-1"), a = (s = t.body) == null ? void 0 : s.getReader(); if (!a) - throw WL; + throw _I; const o = []; let u = 0; for (; ; ) { const { done: h, value: d } = await a.read(), f = d ? d.length : 0; if (h) { if (r != -1 && r !== u) - throw YL; + throw vI; e && e({ url: n, total: r, received: u, delta: f, done: h }); break; } @@ -10737,75 +10805,75 @@ const WL = new Error("failed to get response body reader"), YL = new Error("fail console.log("failed to send download progress event: ", r), i = await t.arrayBuffer(); } return i; -}, nd = async (n, e, t = !1, i) => { - const s = t ? await QL(n, i) : await (await fetch(n)).arrayBuffer(), r = new Blob([s], { type: e }); +}, Ad = async (n, e, t = !1, i) => { + const s = t ? await EI(n, i) : await (await fetch(n)).arrayBuffer(), r = new Blob([s], { type: e }); return URL.createObjectURL(r); }; -var Ae; +var xe; (function(n) { n.LOAD = "LOAD", n.EXEC = "EXEC", n.FFPROBE = "FFPROBE", n.WRITE_FILE = "WRITE_FILE", n.READ_FILE = "READ_FILE", n.DELETE_FILE = "DELETE_FILE", n.RENAME = "RENAME", n.CREATE_DIR = "CREATE_DIR", n.LIST_DIR = "LIST_DIR", n.DELETE_DIR = "DELETE_DIR", n.ERROR = "ERROR", n.DOWNLOAD = "DOWNLOAD", n.PROGRESS = "PROGRESS", n.LOG = "LOG", n.MOUNT = "MOUNT", n.UNMOUNT = "UNMOUNT"; -})(Ae || (Ae = {})); -const ZL = /* @__PURE__ */ (() => { +})(xe || (xe = {})); +const bI = /* @__PURE__ */ (() => { let n = 0; return () => n++; -})(), JL = new Error("ffmpeg is not loaded, call `await ffmpeg.load()` first"), eI = new Error("called FFmpeg.terminate()"); -var Nt, qn, An, ys, Es, su, bt; -class tI { +})(), TI = new Error("ffmpeg is not loaded, call `await ffmpeg.load()` first"), SI = new Error("called FFmpeg.terminate()"); +var Kt, Xn, wn, Ds, ws, xu, wt; +class AI { constructor() { - Mi(this, Nt, null); + Gi(this, Kt, null); /** * #resolves and #rejects tracks Promise resolves and rejects to * be called when we receive message from web worker. */ - Mi(this, qn, {}); - Mi(this, An, {}); - Mi(this, ys, []); - Mi(this, Es, []); + Gi(this, Xn, {}); + Gi(this, wn, {}); + Gi(this, Ds, []); + Gi(this, ws, []); de(this, "loaded", !1); /** * register worker message event handlers. */ - Mi(this, su, () => { - ue(this, Nt) && (ue(this, Nt).onmessage = ({ data: { id: e, type: t, data: i } }) => { + Gi(this, xu, () => { + ce(this, Kt) && (ce(this, Kt).onmessage = ({ data: { id: e, type: t, data: i } }) => { switch (t) { - case Ae.LOAD: - this.loaded = !0, ue(this, qn)[e](i); + case xe.LOAD: + this.loaded = !0, ce(this, Xn)[e](i); break; - case Ae.MOUNT: - case Ae.UNMOUNT: - case Ae.EXEC: - case Ae.FFPROBE: - case Ae.WRITE_FILE: - case Ae.READ_FILE: - case Ae.DELETE_FILE: - case Ae.RENAME: - case Ae.CREATE_DIR: - case Ae.LIST_DIR: - case Ae.DELETE_DIR: - ue(this, qn)[e](i); + case xe.MOUNT: + case xe.UNMOUNT: + case xe.EXEC: + case xe.FFPROBE: + case xe.WRITE_FILE: + case xe.READ_FILE: + case xe.DELETE_FILE: + case xe.RENAME: + case xe.CREATE_DIR: + case xe.LIST_DIR: + case xe.DELETE_DIR: + ce(this, Xn)[e](i); break; - case Ae.LOG: - ue(this, ys).forEach((s) => s(i)); + case xe.LOG: + ce(this, Ds).forEach((s) => s(i)); break; - case Ae.PROGRESS: - ue(this, Es).forEach((s) => s(i)); + case xe.PROGRESS: + ce(this, ws).forEach((s) => s(i)); break; - case Ae.ERROR: - ue(this, An)[e](i); + case xe.ERROR: + ce(this, wn)[e](i); break; } - delete ue(this, qn)[e], delete ue(this, An)[e]; + delete ce(this, Xn)[e], delete ce(this, wn)[e]; }); }); /** * Generic function to send messages to web worker. */ - Mi(this, bt, ({ type: e, data: t }, i = [], s) => ue(this, Nt) ? new Promise((r, a) => { - const o = ZL(); - ue(this, Nt) && ue(this, Nt).postMessage({ id: o, type: e, data: t }, i), ue(this, qn)[o] = r, ue(this, An)[o] = a, s == null || s.addEventListener("abort", () => { + Gi(this, wt, ({ type: e, data: t }, i = [], s) => ce(this, Kt) ? new Promise((r, a) => { + const o = bI(); + ce(this, Kt) && ce(this, Kt).postMessage({ id: o, type: e, data: t }, i), ce(this, Xn)[o] = r, ce(this, wn)[o] = a, s == null || s.addEventListener("abort", () => { a(new DOMException(`Message # ${o} was aborted`, "AbortError")); }, { once: !0 }); - }) : Promise.reject(JL)); + }) : Promise.reject(TI)); /** * Loads ffmpeg-core inside web worker. It is required to call this method first * as it initializes WebAssembly and other essential variables. @@ -10813,7 +10881,7 @@ class tI { * @category FFmpeg * @returns `true` if ffmpeg core is loaded for the first time. */ - de(this, "load", ({ classWorkerURL: e, ...t } = {}, { signal: i } = {}) => (ue(this, Nt) || ($s(this, Nt, e ? new Worker(new URL(e, import.meta.url), { + de(this, "load", ({ classWorkerURL: e, ...t } = {}, { signal: i } = {}) => (ce(this, Kt) || (Ws(this, Kt, e ? new Worker(new URL(e, import.meta.url), { type: "module" }) : ( // We need to duplicated the code here to enable webpack @@ -10825,8 +10893,8 @@ class tI { ), { type: "module" }) - )), ue(this, su).call(this)), ue(this, bt).call(this, { - type: Ae.LOAD, + )), ce(this, xu).call(this)), ce(this, wt).call(this, { + type: xe.LOAD, data: t }, void 0, i))); /** @@ -10849,8 +10917,8 @@ class tI { * @returns `0` if no error, `!= 0` if timeout (1) or error. * @category FFmpeg */ - de(this, "exec", (e, t = -1, { signal: i } = {}) => ue(this, bt).call(this, { - type: Ae.EXEC, + de(this, "exec", (e, t = -1, { signal: i } = {}) => ce(this, wt).call(this, { + type: xe.EXEC, data: { args: e, timeout: t } }, void 0, i)); /** @@ -10869,8 +10937,8 @@ class tI { * @returns `0` if no error, `!= 0` if timeout (1) or error. * @category FFmpeg */ - de(this, "ffprobe", (e, t = -1, { signal: i } = {}) => ue(this, bt).call(this, { - type: Ae.FFPROBE, + de(this, "ffprobe", (e, t = -1, { signal: i } = {}) => ce(this, wt).call(this, { + type: xe.FFPROBE, data: { args: e, timeout: t } }, void 0, i)); /** @@ -10880,10 +10948,10 @@ class tI { * @category FFmpeg */ de(this, "terminate", () => { - const e = Object.keys(ue(this, An)); + const e = Object.keys(ce(this, wn)); for (const t of e) - ue(this, An)[t](eI), delete ue(this, An)[t], delete ue(this, qn)[t]; - ue(this, Nt) && (ue(this, Nt).terminate(), $s(this, Nt, null), this.loaded = !1); + ce(this, wn)[t](SI), delete ce(this, wn)[t], delete ce(this, Xn)[t]; + ce(this, Kt) && (ce(this, Kt).terminate(), Ws(this, Kt, null), this.loaded = !1); }); /** * Write data to ffmpeg.wasm. @@ -10900,22 +10968,22 @@ class tI { */ de(this, "writeFile", (e, t, { signal: i } = {}) => { const s = []; - return t instanceof Uint8Array && s.push(t.buffer), ue(this, bt).call(this, { - type: Ae.WRITE_FILE, + return t instanceof Uint8Array && s.push(t.buffer), ce(this, wt).call(this, { + type: xe.WRITE_FILE, data: { path: e, data: t } }, s, i); }); de(this, "mount", (e, t, i) => { const s = []; - return ue(this, bt).call(this, { - type: Ae.MOUNT, + return ce(this, wt).call(this, { + type: xe.MOUNT, data: { fsType: e, options: t, mountPoint: i } }, s); }); de(this, "unmount", (e) => { const t = []; - return ue(this, bt).call(this, { - type: Ae.UNMOUNT, + return ce(this, wt).call(this, { + type: xe.UNMOUNT, data: { mountPoint: e } }, t); }); @@ -10931,8 +10999,8 @@ class tI { * * @category File System */ - de(this, "readFile", (e, t = "binary", { signal: i } = {}) => ue(this, bt).call(this, { - type: Ae.READ_FILE, + de(this, "readFile", (e, t = "binary", { signal: i } = {}) => ce(this, wt).call(this, { + type: xe.READ_FILE, data: { path: e, encoding: t } }, void 0, i)); /** @@ -10940,8 +11008,8 @@ class tI { * * @category File System */ - de(this, "deleteFile", (e, { signal: t } = {}) => ue(this, bt).call(this, { - type: Ae.DELETE_FILE, + de(this, "deleteFile", (e, { signal: t } = {}) => ce(this, wt).call(this, { + type: xe.DELETE_FILE, data: { path: e } }, void 0, t)); /** @@ -10949,8 +11017,8 @@ class tI { * * @category File System */ - de(this, "rename", (e, t, { signal: i } = {}) => ue(this, bt).call(this, { - type: Ae.RENAME, + de(this, "rename", (e, t, { signal: i } = {}) => ce(this, wt).call(this, { + type: xe.RENAME, data: { oldPath: e, newPath: t } }, void 0, i)); /** @@ -10958,8 +11026,8 @@ class tI { * * @category File System */ - de(this, "createDir", (e, { signal: t } = {}) => ue(this, bt).call(this, { - type: Ae.CREATE_DIR, + de(this, "createDir", (e, { signal: t } = {}) => ce(this, wt).call(this, { + type: xe.CREATE_DIR, data: { path: e } }, void 0, t)); /** @@ -10967,8 +11035,8 @@ class tI { * * @category File System */ - de(this, "listDir", (e, { signal: t } = {}) => ue(this, bt).call(this, { - type: Ae.LIST_DIR, + de(this, "listDir", (e, { signal: t } = {}) => ce(this, wt).call(this, { + type: xe.LIST_DIR, data: { path: e } }, void 0, t)); /** @@ -10976,24 +11044,24 @@ class tI { * * @category File System */ - de(this, "deleteDir", (e, { signal: t } = {}) => ue(this, bt).call(this, { - type: Ae.DELETE_DIR, + de(this, "deleteDir", (e, { signal: t } = {}) => ce(this, wt).call(this, { + type: xe.DELETE_DIR, data: { path: e } }, void 0, t)); } on(e, t) { - e === "log" ? ue(this, ys).push(t) : e === "progress" && ue(this, Es).push(t); + e === "log" ? ce(this, Ds).push(t) : e === "progress" && ce(this, ws).push(t); } off(e, t) { - e === "log" ? $s(this, ys, ue(this, ys).filter((i) => i !== t)) : e === "progress" && $s(this, Es, ue(this, Es).filter((i) => i !== t)); + e === "log" ? Ws(this, Ds, ce(this, Ds).filter((i) => i !== t)) : e === "progress" && Ws(this, ws, ce(this, ws).filter((i) => i !== t)); } } -Nt = new WeakMap(), qn = new WeakMap(), An = new WeakMap(), ys = new WeakMap(), Es = new WeakMap(), su = new WeakMap(), bt = new WeakMap(); -var lp; +Kt = new WeakMap(), Xn = new WeakMap(), wn = new WeakMap(), Ds = new WeakMap(), ws = new WeakMap(), xu = new WeakMap(), wt = new WeakMap(); +var xp; (function(n) { n.MEMFS = "MEMFS", n.NODEFS = "NODEFS", n.NODERAWFS = "NODERAWFS", n.IDBFS = "IDBFS", n.WORKERFS = "WORKERFS", n.PROXYFS = "PROXYFS"; -})(lp || (lp = {})); -const iI = { +})(xp || (xp = {})); +const xI = { "3g2": "video/3gpp2", "3gp": "video/3gpp", "3gpp": "video/3gpp", @@ -11433,18 +11501,18 @@ const iI = { yml: "text/yaml", zip: "application/zip" }; -function nI(n) { +function DI(n) { let e = ("" + n).trim().toLowerCase(), t = e.lastIndexOf("."); - return iI[~t ? e.substring(++t) : e]; + return xI[~t ? e.substring(++t) : e]; } -const up = (n) => { +const Dp = (n) => { let e = ["B", "KB", "MB", "GB", "PB"], t = 0; for (; n > 1024; ) n /= 1024, t++; let i = e[t]; return n.toFixed(1) + " " + i; }; -function sI(n, { autoplay: e }) { +function wI(n, { autoplay: e }) { async function t() { e && await n.play(); } @@ -11454,15 +11522,15 @@ function sI(n, { autoplay: e }) { } }; } -async function rI() { - const n = new tI(), e = "https://unpkg.com/@ffmpeg/core@0.12.4/dist/esm"; +async function LI() { + const n = new AI(), e = "https://unpkg.com/@ffmpeg/core@0.12.4/dist/esm"; return await n.load({ - coreURL: await nd(`${e}/ffmpeg-core.js`, "text/javascript"), - wasmURL: await nd(`${e}/ffmpeg-core.wasm`, "application/wasm") + coreURL: await Ad(`${e}/ffmpeg-core.js`, "text/javascript"), + wasmURL: await Ad(`${e}/ffmpeg-core.wasm`, "application/wasm") }), n; } -async function aI(n, e, t, i) { - const s = i.src, r = nI(i.src) || "video/mp4", a = await nd(s, r), u = await (await fetch(a)).blob(), l = oI(r) || "mp4", c = `input.${l}`, h = `output.${l}`; +async function II(n, e, t, i) { + const s = i.src, r = DI(i.src) || "video/mp4", a = await Ad(s, r), u = await (await fetch(a)).blob(), l = kI(r) || "mp4", c = `input.${l}`, h = `output.${l}`; try { if (e === 0 && t === 0) return u; @@ -11488,7 +11556,7 @@ async function aI(n, e, t, i) { return console.error("Error initializing FFmpeg:", d), u; } } -const oI = (n) => ({ +const kI = (n) => ({ "video/mp4": "mp4", "video/webm": "webm", "video/ogg": "ogv", @@ -11519,43 +11587,43 @@ const oI = (n) => ({ "video/x-ms-wvx": "wvx", "video/x-sgi-movie": "movie", "video/x-smv": "smv" -})[n] || null, { setContext: Tj, getContext: lI } = window.__gradio__svelte__internal, uI = "WORKER_PROXY_CONTEXT_KEY"; -function Wv() { - return lI(uI); +})[n] || null, { setContext: Pj, getContext: RI } = window.__gradio__svelte__internal, CI = "WORKER_PROXY_CONTEXT_KEY"; +function cy() { + return RI(CI); } -const cI = "lite.local"; -function hI(n) { +const FI = "lite.local"; +function PI(n) { return n.host === window.location.host || n.host === "localhost:7860" || n.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194 - n.host === cI; + n.host === FI; } -function Yv(n, e) { +function hy(n, e) { const t = e.toLowerCase(); for (const [i, s] of Object.entries(n)) if (i.toLowerCase() === t) return s; } -function Xv(n) { +function dy(n) { const e = typeof window < "u"; if (n == null || !e) return !1; const t = new URL(n, window.location.href); - return !(!hI(t) || t.protocol !== "http:" && t.protocol !== "https:"); + return !(!PI(t) || t.protocol !== "http:" && t.protocol !== "https:"); } -let Bo; -async function dI(n) { +let nl; +async function OI(n) { const e = typeof window < "u"; - if (n == null || !e || !Xv(n)) + if (n == null || !e || !dy(n)) return n; - if (Bo == null) + if (nl == null) try { - Bo = Wv(); + nl = cy(); } catch { return n; } - if (Bo == null) + if (nl == null) return n; const i = new URL(n, window.location.href).pathname; - return Bo.httpRequest({ + return nl.httpRequest({ method: "GET", path: i, headers: {}, @@ -11564,45 +11632,45 @@ async function dI(n) { if (s.status !== 200) throw new Error(`Failed to get file ${i} from the Wasm worker.`); const r = new Blob([s.body], { - type: Yv(s.headers, "content-type") + type: hy(s.headers, "content-type") }); return URL.createObjectURL(r); }); } const { - SvelteComponent: fI, - assign: Fl, - check_outros: Qv, - children: Zv, - claim_element: Jv, - compute_rest_props: cp, - create_slot: nf, - detach: br, - element: ey, - empty: Pl, - exclude_internal_props: mI, - get_all_dirty_from_scope: sf, - get_slot_changes: rf, - get_spread_update: ty, - group_outros: iy, - init: gI, - insert_hydration: du, - listen: ny, - prevent_default: pI, - safe_not_equal: _I, - set_attributes: Ol, - set_style: hp, - toggle_class: Ml, - transition_in: xs, - transition_out: Ds, - update_slot_base: af -} = window.__gradio__svelte__internal, { createEventDispatcher: vI, onMount: Sj } = window.__gradio__svelte__internal; -function yI(n) { + SvelteComponent: MI, + assign: Ql, + check_outros: fy, + children: my, + claim_element: gy, + compute_rest_props: wp, + create_slot: Af, + detach: kr, + element: py, + empty: Zl, + exclude_internal_props: $I, + get_all_dirty_from_scope: xf, + get_slot_changes: Df, + get_spread_update: _y, + group_outros: vy, + init: BI, + insert_hydration: Fu, + listen: yy, + prevent_default: NI, + safe_not_equal: UI, + set_attributes: Jl, + set_style: Lp, + toggle_class: eu, + transition_in: Ms, + transition_out: $s, + update_slot_base: wf +} = window.__gradio__svelte__internal, { createEventDispatcher: GI, onMount: Oj } = window.__gradio__svelte__internal; +function HI(n) { let e, t, i, s, r; const a = ( /*#slots*/ n[8].default - ), o = nf( + ), o = Af( a, n, /*$$scope*/ @@ -11627,27 +11695,27 @@ function yI(n) { n[6] ], l = {}; for (let c = 0; c < u.length; c += 1) - l = Fl(l, u[c]); + l = Ql(l, u[c]); return { c() { - e = ey("a"), o && o.c(), this.h(); + e = py("a"), o && o.c(), this.h(); }, l(c) { - e = Jv(c, "A", { + e = gy(c, "A", { class: !0, href: !0, target: !0, rel: !0, download: !0 }); - var h = Zv(e); - o && o.l(h), h.forEach(br), this.h(); + var h = my(e); + o && o.l(h), h.forEach(kr), this.h(); }, h() { - Ol(e, l), hp(e, "position", "relative"), Ml(e, "svelte-151nsdd", !0); + Jl(e, l), Lp(e, "position", "relative"), eu(e, "svelte-151nsdd", !0); }, m(c, h) { - du(c, e, h), o && o.m(e, null), i = !0, s || (r = ny( + Fu(c, e, h), o && o.m(e, null), i = !0, s || (r = yy( e, "click", /*dispatch*/ @@ -11656,24 +11724,24 @@ function yI(n) { }, p(c, h) { o && o.p && (!i || h & /*$$scope*/ - 128) && af( + 128) && wf( o, a, c, /*$$scope*/ c[7], - i ? rf( + i ? Df( a, /*$$scope*/ c[7], h, null - ) : sf( + ) : xf( /*$$scope*/ c[7] ), null - ), Ol(e, l = ty(u, [ + ), Jl(e, l = _y(u, [ { class: "download-link" }, (!i || h & /*href*/ 1) && { href: ( @@ -11690,22 +11758,22 @@ function yI(n) { h & /*$$restProps*/ 64 && /*$$restProps*/ c[6] - ])), hp(e, "position", "relative"), Ml(e, "svelte-151nsdd", !0); + ])), Lp(e, "position", "relative"), eu(e, "svelte-151nsdd", !0); }, i(c) { - i || (xs(o, c), i = !0); + i || (Ms(o, c), i = !0); }, o(c) { - Ds(o, c), i = !1; + $s(o, c), i = !1; }, d(c) { - c && br(e), o && o.d(c), s = !1, r(); + c && kr(e), o && o.d(c), s = !1, r(); } }; } -function EI(n) { +function VI(n) { let e, t, i, s; - const r = [TI, bI], a = []; + const r = [KI, qI], a = []; function o(u, l) { return ( /*is_downloading*/ @@ -11714,37 +11782,37 @@ function EI(n) { } return e = o(n), t = a[e] = r[e](n), { c() { - t.c(), i = Pl(); + t.c(), i = Zl(); }, l(u) { - t.l(u), i = Pl(); + t.l(u), i = Zl(); }, m(u, l) { - a[e].m(u, l), du(u, i, l), s = !0; + a[e].m(u, l), Fu(u, i, l), s = !0; }, p(u, l) { let c = e; - e = o(u), e === c ? a[e].p(u, l) : (iy(), Ds(a[c], 1, 1, () => { + e = o(u), e === c ? a[e].p(u, l) : (vy(), $s(a[c], 1, 1, () => { a[c] = null; - }), Qv(), t = a[e], t ? t.p(u, l) : (t = a[e] = r[e](u), t.c()), xs(t, 1), t.m(i.parentNode, i)); + }), fy(), t = a[e], t ? t.p(u, l) : (t = a[e] = r[e](u), t.c()), Ms(t, 1), t.m(i.parentNode, i)); }, i(u) { - s || (xs(t), s = !0); + s || (Ms(t), s = !0); }, o(u) { - Ds(t), s = !1; + $s(t), s = !1; }, d(u) { - u && br(i), a[e].d(u); + u && kr(i), a[e].d(u); } }; } -function bI(n) { +function qI(n) { let e, t, i, s; const r = ( /*#slots*/ n[8].default - ), a = nf( + ), a = Af( r, n, /*$$scope*/ @@ -11760,45 +11828,45 @@ function bI(n) { ) } ], u = {}; for (let l = 0; l < o.length; l += 1) - u = Fl(u, o[l]); + u = Ql(u, o[l]); return { c() { - e = ey("a"), a && a.c(), this.h(); + e = py("a"), a && a.c(), this.h(); }, l(l) { - e = Jv(l, "A", { href: !0 }); - var c = Zv(e); - a && a.l(c), c.forEach(br), this.h(); + e = gy(l, "A", { href: !0 }); + var c = my(e); + a && a.l(c), c.forEach(kr), this.h(); }, h() { - Ol(e, u), Ml(e, "svelte-151nsdd", !0); + Jl(e, u), eu(e, "svelte-151nsdd", !0); }, m(l, c) { - du(l, e, c), a && a.m(e, null), t = !0, i || (s = ny(e, "click", pI( + Fu(l, e, c), a && a.m(e, null), t = !0, i || (s = yy(e, "click", NI( /*wasm_click_handler*/ n[5] )), i = !0); }, p(l, c) { a && a.p && (!t || c & /*$$scope*/ - 128) && af( + 128) && wf( a, r, l, /*$$scope*/ l[7], - t ? rf( + t ? Df( r, /*$$scope*/ l[7], c, null - ) : sf( + ) : xf( /*$$scope*/ l[7] ), null - ), Ol(e, u = ty(o, [ + ), Jl(e, u = _y(o, [ c & /*$$restProps*/ 64 && /*$$restProps*/ l[6], @@ -11807,25 +11875,25 @@ function bI(n) { /*href*/ l[0] ) } - ])), Ml(e, "svelte-151nsdd", !0); + ])), eu(e, "svelte-151nsdd", !0); }, i(l) { - t || (xs(a, l), t = !0); + t || (Ms(a, l), t = !0); }, o(l) { - Ds(a, l), t = !1; + $s(a, l), t = !1; }, d(l) { - l && br(e), a && a.d(l), i = !1, s(); + l && kr(e), a && a.d(l), i = !1, s(); } }; } -function TI(n) { +function KI(n) { let e; const t = ( /*#slots*/ n[8].default - ), i = nf( + ), i = Af( t, n, /*$$scope*/ @@ -11844,19 +11912,19 @@ function TI(n) { }, p(s, r) { i && i.p && (!e || r & /*$$scope*/ - 128) && af( + 128) && wf( i, t, s, /*$$scope*/ s[7], - e ? rf( + e ? Df( t, /*$$scope*/ s[7], r, null - ) : sf( + ) : xf( /*$$scope*/ s[7] ), @@ -11864,57 +11932,57 @@ function TI(n) { ); }, i(s) { - e || (xs(i, s), e = !0); + e || (Ms(i, s), e = !0); }, o(s) { - Ds(i, s), e = !1; + $s(i, s), e = !1; }, d(s) { i && i.d(s); } }; } -function SI(n) { +function jI(n) { let e, t, i, s, r; - const a = [EI, yI], o = []; + const a = [VI, HI], o = []; function u(l, c) { return c & /*href*/ 1 && (e = null), e == null && (e = !!/*worker_proxy*/ - (l[4] && Xv( + (l[4] && dy( /*href*/ l[0] ))), e ? 0 : 1; } return t = u(n, -1), i = o[t] = a[t](n), { c() { - i.c(), s = Pl(); + i.c(), s = Zl(); }, l(l) { - i.l(l), s = Pl(); + i.l(l), s = Zl(); }, m(l, c) { - o[t].m(l, c), du(l, s, c), r = !0; + o[t].m(l, c), Fu(l, s, c), r = !0; }, p(l, [c]) { let h = t; - t = u(l, c), t === h ? o[t].p(l, c) : (iy(), Ds(o[h], 1, 1, () => { + t = u(l, c), t === h ? o[t].p(l, c) : (vy(), $s(o[h], 1, 1, () => { o[h] = null; - }), Qv(), i = o[t], i ? i.p(l, c) : (i = o[t] = a[t](l), i.c()), xs(i, 1), i.m(s.parentNode, s)); + }), fy(), i = o[t], i ? i.p(l, c) : (i = o[t] = a[t](l), i.c()), Ms(i, 1), i.m(s.parentNode, s)); }, i(l) { - r || (xs(i), r = !0); + r || (Ms(i), r = !0); }, o(l) { - Ds(i), r = !1; + $s(i), r = !1; }, d(l) { - l && br(s), o[t].d(l); + l && kr(s), o[t].d(l); } }; } -function AI(n, e, t) { +function zI(n, e, t) { const i = ["href", "download"]; - let s = cp(e, i), { $$slots: r = {}, $$scope: a } = e; + let s = wp(e, i), { $$slots: r = {}, $$scope: a } = e; var o = this && this.__awaiter || function(m, g, p, y) { function v(_) { return _ instanceof p ? _ : new p(function(E) { @@ -11925,27 +11993,27 @@ function AI(n, e, t) { function T(D) { try { S(y.next(D)); - } catch (x) { - E(x); + } catch (A) { + E(A); } } - function A(D) { + function x(D) { try { S(y.throw(D)); - } catch (x) { - E(x); + } catch (A) { + E(A); } } function S(D) { - D.done ? _(D.value) : v(D.value).then(T, A); + D.done ? _(D.value) : v(D.value).then(T, x); } S((y = y.apply(m, g || [])).next()); }); }; let { href: u = void 0 } = e, { download: l } = e; - const c = vI(); + const c = GI(); let h = !1; - const d = Wv(); + const d = cy(); function f() { return o(this, void 0, void 0, function* () { if (h) @@ -11966,7 +12034,7 @@ function AI(n, e, t) { const y = new Blob( [p.body], { - type: Yv(p.headers, "content-type") + type: hy(p.headers, "content-type") } ), v = URL.createObjectURL(y), _ = document.createElement("a"); _.href = v, _.download = l, _.click(), URL.revokeObjectURL(v); @@ -11976,7 +12044,7 @@ function AI(n, e, t) { }); } return n.$$set = (m) => { - e = Fl(Fl({}, e), mI(m)), t(6, s = cp(e, i)), "href" in m && t(0, u = m.href), "download" in m && t(1, l = m.download), "$$scope" in m && t(7, a = m.$$scope); + e = Ql(Ql({}, e), $I(m)), t(6, s = wp(e, i)), "href" in m && t(0, u = m.href), "download" in m && t(1, l = m.download), "$$scope" in m && t(7, a = m.$$scope); }, [ u, l, @@ -11989,19 +12057,19 @@ function AI(n, e, t) { r ]; } -class sy extends fI { +class Ey extends MI { constructor(e) { - super(), gI(this, e, AI, SI, _I, { href: 0, download: 1 }); + super(), BI(this, e, zI, jI, UI, { href: 0, download: 1 }); } } -const Z = Number.isFinite || function(n) { +const J = Number.isFinite || function(n) { return typeof n == "number" && isFinite(n); -}, xI = Number.isSafeInteger || function(n) { - return typeof n == "number" && Math.abs(n) <= DI; -}, DI = Number.MAX_SAFE_INTEGER || 9007199254740991; -let ie = /* @__PURE__ */ function(n) { +}, WI = Number.isSafeInteger || function(n) { + return typeof n == "number" && Math.abs(n) <= YI; +}, YI = Number.MAX_SAFE_INTEGER || 9007199254740991; +let ne = /* @__PURE__ */ function(n) { return n.NETWORK_ERROR = "networkError", n.MEDIA_ERROR = "mediaError", n.KEY_SYSTEM_ERROR = "keySystemError", n.MUX_ERROR = "muxError", n.OTHER_ERROR = "otherError", n; -}({}), O = /* @__PURE__ */ function(n) { +}({}), P = /* @__PURE__ */ function(n) { return n.KEY_SYSTEM_NO_KEYS = "keySystemNoKeys", n.KEY_SYSTEM_NO_ACCESS = "keySystemNoAccess", n.KEY_SYSTEM_NO_SESSION = "keySystemNoSession", n.KEY_SYSTEM_NO_CONFIGURED_LICENSE = "keySystemNoConfiguredLicense", n.KEY_SYSTEM_LICENSE_REQUEST_FAILED = "keySystemLicenseRequestFailed", n.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED = "keySystemServerCertificateRequestFailed", n.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED = "keySystemServerCertificateUpdateFailed", n.KEY_SYSTEM_SESSION_UPDATE_FAILED = "keySystemSessionUpdateFailed", n.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED = "keySystemStatusOutputRestricted", n.KEY_SYSTEM_STATUS_INTERNAL_ERROR = "keySystemStatusInternalError", n.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR = "keySystemDestroyMediaKeysError", n.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR = "keySystemDestroyCloseSessionError", n.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR = "keySystemDestroyRemoveSessionError", n.MANIFEST_LOAD_ERROR = "manifestLoadError", n.MANIFEST_LOAD_TIMEOUT = "manifestLoadTimeOut", n.MANIFEST_PARSING_ERROR = "manifestParsingError", n.MANIFEST_INCOMPATIBLE_CODECS_ERROR = "manifestIncompatibleCodecsError", n.LEVEL_EMPTY_ERROR = "levelEmptyError", n.LEVEL_LOAD_ERROR = "levelLoadError", n.LEVEL_LOAD_TIMEOUT = "levelLoadTimeOut", n.LEVEL_PARSING_ERROR = "levelParsingError", n.LEVEL_SWITCH_ERROR = "levelSwitchError", n.AUDIO_TRACK_LOAD_ERROR = "audioTrackLoadError", n.AUDIO_TRACK_LOAD_TIMEOUT = "audioTrackLoadTimeOut", n.SUBTITLE_LOAD_ERROR = "subtitleTrackLoadError", n.SUBTITLE_TRACK_LOAD_TIMEOUT = "subtitleTrackLoadTimeOut", n.FRAG_LOAD_ERROR = "fragLoadError", n.FRAG_LOAD_TIMEOUT = "fragLoadTimeOut", n.FRAG_DECRYPT_ERROR = "fragDecryptError", n.FRAG_PARSING_ERROR = "fragParsingError", n.FRAG_GAP = "fragGap", n.REMUX_ALLOC_ERROR = "remuxAllocError", n.KEY_LOAD_ERROR = "keyLoadError", n.KEY_LOAD_TIMEOUT = "keyLoadTimeOut", n.BUFFER_ADD_CODEC_ERROR = "bufferAddCodecError", n.BUFFER_INCOMPATIBLE_CODECS_ERROR = "bufferIncompatibleCodecsError", n.BUFFER_APPEND_ERROR = "bufferAppendError", n.BUFFER_APPENDING_ERROR = "bufferAppendingError", n.BUFFER_STALLED_ERROR = "bufferStalledError", n.BUFFER_FULL_ERROR = "bufferFullError", n.BUFFER_SEEK_OVER_HOLE = "bufferSeekOverHole", n.BUFFER_NUDGE_ON_STALL = "bufferNudgeOnStall", n.ASSET_LIST_LOAD_ERROR = "assetListLoadError", n.ASSET_LIST_LOAD_TIMEOUT = "assetListLoadTimeout", n.ASSET_LIST_PARSING_ERROR = "assetListParsingError", n.INTERSTITIAL_ASSET_ITEM_ERROR = "interstitialAssetItemError", n.INTERNAL_EXCEPTION = "internalException", n.INTERNAL_ABORTED = "aborted", n.ATTACH_MEDIA_ERROR = "attachMediaError", n.UNKNOWN = "unknown", n; }({}), b = /* @__PURE__ */ function(n) { return n.MEDIA_ATTACHING = "hlsMediaAttaching", n.MEDIA_ATTACHED = "hlsMediaAttached", n.MEDIA_DETACHING = "hlsMediaDetaching", n.MEDIA_DETACHED = "hlsMediaDetached", n.MEDIA_ENDED = "hlsMediaEnded", n.STALL_RESOLVED = "hlsStallResolved", n.BUFFER_RESET = "hlsBufferReset", n.BUFFER_CODECS = "hlsBufferCodecs", n.BUFFER_CREATED = "hlsBufferCreated", n.BUFFER_APPENDING = "hlsBufferAppending", n.BUFFER_APPENDED = "hlsBufferAppended", n.BUFFER_EOS = "hlsBufferEos", n.BUFFERED_TO_END = "hlsBufferedToEnd", n.BUFFER_FLUSHING = "hlsBufferFlushing", n.BUFFER_FLUSHED = "hlsBufferFlushed", n.MANIFEST_LOADING = "hlsManifestLoading", n.MANIFEST_LOADED = "hlsManifestLoaded", n.MANIFEST_PARSED = "hlsManifestParsed", n.LEVEL_SWITCHING = "hlsLevelSwitching", n.LEVEL_SWITCHED = "hlsLevelSwitched", n.LEVEL_LOADING = "hlsLevelLoading", n.LEVEL_LOADED = "hlsLevelLoaded", n.LEVEL_UPDATED = "hlsLevelUpdated", n.LEVEL_PTS_UPDATED = "hlsLevelPtsUpdated", n.LEVELS_UPDATED = "hlsLevelsUpdated", n.AUDIO_TRACKS_UPDATED = "hlsAudioTracksUpdated", n.AUDIO_TRACK_SWITCHING = "hlsAudioTrackSwitching", n.AUDIO_TRACK_SWITCHED = "hlsAudioTrackSwitched", n.AUDIO_TRACK_LOADING = "hlsAudioTrackLoading", n.AUDIO_TRACK_LOADED = "hlsAudioTrackLoaded", n.AUDIO_TRACK_UPDATED = "hlsAudioTrackUpdated", n.SUBTITLE_TRACKS_UPDATED = "hlsSubtitleTracksUpdated", n.SUBTITLE_TRACKS_CLEARED = "hlsSubtitleTracksCleared", n.SUBTITLE_TRACK_SWITCH = "hlsSubtitleTrackSwitch", n.SUBTITLE_TRACK_LOADING = "hlsSubtitleTrackLoading", n.SUBTITLE_TRACK_LOADED = "hlsSubtitleTrackLoaded", n.SUBTITLE_TRACK_UPDATED = "hlsSubtitleTrackUpdated", n.SUBTITLE_FRAG_PROCESSED = "hlsSubtitleFragProcessed", n.CUES_PARSED = "hlsCuesParsed", n.NON_NATIVE_TEXT_TRACKS_FOUND = "hlsNonNativeTextTracksFound", n.INIT_PTS_FOUND = "hlsInitPtsFound", n.FRAG_LOADING = "hlsFragLoading", n.FRAG_LOAD_EMERGENCY_ABORTED = "hlsFragLoadEmergencyAborted", n.FRAG_LOADED = "hlsFragLoaded", n.FRAG_DECRYPTED = "hlsFragDecrypted", n.FRAG_PARSING_INIT_SEGMENT = "hlsFragParsingInitSegment", n.FRAG_PARSING_USERDATA = "hlsFragParsingUserdata", n.FRAG_PARSING_METADATA = "hlsFragParsingMetadata", n.FRAG_PARSED = "hlsFragParsed", n.FRAG_BUFFERED = "hlsFragBuffered", n.FRAG_CHANGED = "hlsFragChanged", n.FPS_DROP = "hlsFpsDrop", n.FPS_DROP_LEVEL_CAPPING = "hlsFpsDropLevelCapping", n.MAX_AUTO_LEVEL_UPDATED = "hlsMaxAutoLevelUpdated", n.ERROR = "hlsError", n.DESTROYING = "hlsDestroying", n.KEY_LOADING = "hlsKeyLoading", n.KEY_LOADED = "hlsKeyLoaded", n.LIVE_BACK_BUFFER_REACHED = "hlsLiveBackBufferReached", n.BACK_BUFFER_REACHED = "hlsBackBufferReached", n.STEERING_MANIFEST_LOADED = "hlsSteeringManifestLoaded", n.ASSET_LIST_LOADING = "hlsAssetListLoading", n.ASSET_LIST_LOADED = "hlsAssetListLoaded", n.INTERSTITIALS_UPDATED = "hlsInterstitialsUpdated", n.INTERSTITIALS_BUFFERED_TO_BOUNDARY = "hlsInterstitialsBufferedToBoundary", n.INTERSTITIAL_ASSET_PLAYER_CREATED = "hlsInterstitialAssetPlayerCreated", n.INTERSTITIAL_STARTED = "hlsInterstitialStarted", n.INTERSTITIAL_ASSET_STARTED = "hlsInterstitialAssetStarted", n.INTERSTITIAL_ASSET_ENDED = "hlsInterstitialAssetEnded", n.INTERSTITIAL_ASSET_ERROR = "hlsInterstitialAssetError", n.INTERSTITIAL_ENDED = "hlsInterstitialEnded", n.INTERSTITIALS_PRIMARY_RESUMED = "hlsInterstitialsPrimaryResumed", n.PLAYOUT_LIMIT_REACHED = "hlsPlayoutLimitReached", n.EVENT_CUE_ENTER = "hlsEventCueEnter", n; @@ -12011,12 +12079,12 @@ var me = { LEVEL: "level", AUDIO_TRACK: "audioTrack", SUBTITLE_TRACK: "subtitleTrack" -}, J = { +}, te = { MAIN: "main", AUDIO: "audio", SUBTITLE: "subtitle" }; -class Ys { +class ar { // About half of the estimated value will be from the last |halfLife| samples by weight. constructor(e, t = 0, i = 0) { this.halfLife = void 0, this.alpha_ = void 0, this.estimate_ = void 0, this.totalWeight_ = void 0, this.halfLife = e, this.alpha_ = e ? Math.exp(Math.log(0.5) / e) : 0, this.estimate_ = t, this.totalWeight_ = i; @@ -12037,9 +12105,9 @@ class Ys { return this.estimate_; } } -class wI { +class XI { constructor(e, t, i, s = 100) { - this.defaultEstimate_ = void 0, this.minWeight_ = void 0, this.minDelayMs_ = void 0, this.slow_ = void 0, this.fast_ = void 0, this.defaultTTFB_ = void 0, this.ttfb_ = void 0, this.defaultEstimate_ = i, this.minWeight_ = 1e-3, this.minDelayMs_ = 50, this.slow_ = new Ys(e), this.fast_ = new Ys(t), this.defaultTTFB_ = s, this.ttfb_ = new Ys(e); + this.defaultEstimate_ = void 0, this.minWeight_ = void 0, this.minDelayMs_ = void 0, this.slow_ = void 0, this.fast_ = void 0, this.defaultTTFB_ = void 0, this.ttfb_ = void 0, this.defaultEstimate_ = i, this.minWeight_ = 1e-3, this.minDelayMs_ = 50, this.slow_ = new ar(e), this.fast_ = new ar(t), this.defaultTTFB_ = s, this.ttfb_ = new ar(e); } update(e, t) { const { @@ -12047,7 +12115,7 @@ class wI { fast_: s, ttfb_: r } = this; - i.halfLife !== e && (this.slow_ = new Ys(e, i.getEstimate(), i.getTotalWeight())), s.halfLife !== t && (this.fast_ = new Ys(t, s.getEstimate(), s.getTotalWeight())), r.halfLife !== e && (this.ttfb_ = new Ys(e, r.getEstimate(), r.getTotalWeight())); + i.halfLife !== e && (this.slow_ = new ar(e, i.getEstimate(), i.getTotalWeight())), s.halfLife !== t && (this.fast_ = new ar(t, s.getEstimate(), s.getTotalWeight())), r.halfLife !== e && (this.ttfb_ = new ar(e, r.getEstimate(), r.getTotalWeight())); } sample(e, t) { e = Math.max(e, this.minDelayMs_); @@ -12073,24 +12141,24 @@ class wI { destroy() { } } -function LI(n, e, t) { - return (e = kI(e)) in n ? Object.defineProperty(n, e, { +function QI(n, e, t) { + return (e = JI(e)) in n ? Object.defineProperty(n, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : n[e] = t, n; } -function De() { - return De = Object.assign ? Object.assign.bind() : function(n) { +function we() { + return we = Object.assign ? Object.assign.bind() : function(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var i in t) ({}).hasOwnProperty.call(t, i) && (n[i] = t[i]); } return n; - }, De.apply(null, arguments); + }, we.apply(null, arguments); } -function dp(n, e) { +function Ip(n, e) { var t = Object.keys(n); if (Object.getOwnPropertySymbols) { var i = Object.getOwnPropertySymbols(n); @@ -12100,18 +12168,18 @@ function dp(n, e) { } return t; } -function Le(n) { +function Ie(n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e] != null ? arguments[e] : {}; - e % 2 ? dp(Object(t), !0).forEach(function(i) { - LI(n, i, t[i]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : dp(Object(t)).forEach(function(i) { + e % 2 ? Ip(Object(t), !0).forEach(function(i) { + QI(n, i, t[i]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : Ip(Object(t)).forEach(function(i) { Object.defineProperty(n, i, Object.getOwnPropertyDescriptor(t, i)); }); } return n; } -function II(n, e) { +function ZI(n, e) { if (typeof n != "object" || !n) return n; var t = n[Symbol.toPrimitive]; if (t !== void 0) { @@ -12121,39 +12189,39 @@ function II(n, e) { } return (e === "string" ? String : Number)(n); } -function kI(n) { - var e = II(n, "string"); +function JI(n) { + var e = ZI(n, "string"); return typeof e == "symbol" ? e : e + ""; } -class Fi { +class Bi { constructor(e, t) { this.trace = void 0, this.debug = void 0, this.log = void 0, this.warn = void 0, this.info = void 0, this.error = void 0; const i = `[${e}]:`; - this.trace = Gn, this.debug = t.debug.bind(null, i), this.log = t.log.bind(null, i), this.warn = t.warn.bind(null, i), this.info = t.info.bind(null, i), this.error = t.error.bind(null, i); + this.trace = zn, this.debug = t.debug.bind(null, i), this.log = t.log.bind(null, i), this.warn = t.warn.bind(null, i), this.info = t.info.bind(null, i), this.error = t.error.bind(null, i); } } -const Gn = function() { -}, RI = { - trace: Gn, - debug: Gn, - log: Gn, - warn: Gn, - info: Gn, - error: Gn +const zn = function() { +}, ek = { + trace: zn, + debug: zn, + log: zn, + warn: zn, + info: zn, + error: zn }; -function sd() { - return De({}, RI); +function xd() { + return we({}, ek); } -function CI(n, e) { +function tk(n, e) { const t = self.console[n]; - return t ? t.bind(self.console, `${e ? "[" + e + "] " : ""}[${n}] >`) : Gn; + return t ? t.bind(self.console, `${e ? "[" + e + "] " : ""}[${n}] >`) : zn; } -function fp(n, e, t) { - return e[n] ? e[n].bind(e) : CI(n, t); +function kp(n, e, t) { + return e[n] ? e[n].bind(e) : tk(n, t); } -const rd = sd(); -function FI(n, e, t) { - const i = sd(); +const Dd = xd(); +function ik(n, e, t) { + const i = xd(); if (typeof console == "object" && n === !0 || typeof n == "object") { const s = [ // Remove out from list here to hard-disable a log-level @@ -12165,32 +12233,32 @@ function FI(n, e, t) { "error" ]; s.forEach((r) => { - i[r] = fp(r, n, t); + i[r] = kp(r, n, t); }); try { i.log(`Debug logs enabled for "${e}" in hls.js version 1.6.7`); } catch { - return sd(); + return xd(); } s.forEach((r) => { - rd[r] = fp(r, n); + Dd[r] = kp(r, n); }); } else - De(rd, i); + we(Dd, i); return i; } -const Ee = rd; -function Qn(n = !0) { +const Te = Dd; +function ns(n = !0) { return typeof self > "u" ? void 0 : (n || !self.MediaSource) && self.ManagedMediaSource || self.MediaSource || self.WebKitMediaSource; } -function PI(n) { +function nk(n) { return typeof self < "u" && n === self.ManagedMediaSource; } -function ry(n, e) { +function by(n, e) { const t = Object.keys(n), i = Object.keys(e), s = t.length, r = i.length; return !s || !r || s === r && !t.some((a) => i.indexOf(a) === -1); } -function Kt(n, e = !1) { +function Qt(n, e = !1) { if (typeof TextDecoder < "u") { const l = new TextDecoder("utf-8").decode(n); if (e) { @@ -12228,7 +12296,7 @@ function Kt(n, e = !1) { } return a; } -const cs = { +const gs = { hexDump: function(n) { let e = ""; for (let t = 0; t < n.length; t++) { @@ -12238,15 +12306,15 @@ const cs = { return e; } }; -function ay(n) { +function Ty(n) { return Uint8Array.from(n.replace(/^0x/, "").replace(/([\da-fA-F]{2}) ?/g, "0x$1 ").replace(/ +$/, "").split(" ")).buffer; } -function OI(n) { +function sk(n) { return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n; } -var zc = { exports: {} }, mp; -function MI() { - return mp || (mp = 1, function(n, e) { +var fh = { exports: {} }, Rp; +function rk() { + return Rp || (Rp = 1, function(n, e) { (function(t) { var i = /^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/, s = /^(?=([^\/?#]*))\1([^]*)$/, r = /(?:\/|^)\.(?=\/)/g, a = /(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g, o = { // If opts.alwaysNormalize is true then the path will always be normalized even when it starts with / or // @@ -12320,10 +12388,10 @@ function MI() { }; n.exports = o; })(); - }(zc)), zc.exports; + }(fh)), fh.exports; } -var of = MI(); -class lf { +var Lf = rk(); +class If { constructor() { this.aborted = !1, this.loaded = 0, this.retry = 0, this.total = 0, this.chunkCount = 0, this.bwEstimate = 0, this.loading = { start: 0, @@ -12339,16 +12407,16 @@ class lf { }; } } -var Fe = { +var Pe = { AUDIO: "audio", VIDEO: "video", AUDIOVIDEO: "audiovideo" }; -class oy { +class Sy { constructor(e) { this._byteRange = null, this._url = null, this._stats = null, this._streams = null, this.base = void 0, this.relurl = void 0, typeof e == "string" && (e = { url: e - }), this.base = e, BI(this, "stats"); + }), this.base = e, ok(this, "stats"); } // setByteRange converts a EXT-X-BYTERANGE attribute into a two element array setByteRange(e, t) { @@ -12370,9 +12438,9 @@ class oy { } get elementaryStreams() { return this._streams === null && (this._streams = { - [Fe.AUDIO]: null, - [Fe.VIDEO]: null, - [Fe.AUDIOVIDEO]: null + [Pe.AUDIO]: null, + [Pe.VIDEO]: null, + [Pe.AUDIOVIDEO]: null }), this._streams; } set elementaryStreams(e) { @@ -12385,13 +12453,13 @@ class oy { return this._streams !== null; } get stats() { - return this._stats === null && (this._stats = new lf()), this._stats; + return this._stats === null && (this._stats = new If()), this._stats; } set stats(e) { this._stats = e; } get url() { - return !this._url && this.baseurl && this.relurl && (this._url = of.buildAbsoluteURL(this.baseurl, this.relurl, { + return !this._url && this.baseurl && this.relurl && (this._url = Lf.buildAbsoluteURL(this.baseurl, this.relurl, { alwaysNormalize: !0 })), this._url || ""; } @@ -12402,13 +12470,13 @@ class oy { const { elementaryStreams: e } = this; - e[Fe.AUDIO] = null, e[Fe.VIDEO] = null, e[Fe.AUDIOVIDEO] = null; + e[Pe.AUDIO] = null, e[Pe.VIDEO] = null, e[Pe.AUDIOVIDEO] = null; } } -function Ye(n) { +function Ze(n) { return n.sn !== "initSegment"; } -class Wc extends oy { +class mh extends Sy { constructor(e, t) { super(t), this._decryptdata = null, this._programDateTime = null, this._ref = null, this._bitrate = void 0, this.rawProgramDateTime = null, this.tagList = [], this.duration = 0, this.sn = 0, this.levelkeys = void 0, this.type = void 0, this.loader = null, this.keyLoader = null, this.level = -1, this.cc = 0, this.startPTS = void 0, this.endPTS = void 0, this.startDTS = void 0, this.endDTS = void 0, this.start = 0, this.playlistOffset = 0, this.deltaPTS = void 0, this.maxStartPTS = void 0, this.minEndPTS = void 0, this.data = void 0, this.bitrateTest = !1, this.title = null, this.initSegment = null, this.endList = void 0, this.gap = void 0, this.urlId = 0, this.type = e; } @@ -12420,7 +12488,7 @@ class Wc extends oy { } if (this.byteRange) { const e = this.byteRange[0], t = this.byteRange[1]; - if (Z(e) && Z(t)) + if (J(e) && J(t)) return t - e; } return null; @@ -12455,7 +12523,7 @@ class Wc extends oy { get endProgramDateTime() { if (this.programDateTime === null) return null; - const e = Z(this.duration) ? this.duration : 0; + const e = J(this.duration) ? this.duration : 0; return this.programDateTime + e * 1e3; } get encrypted() { @@ -12473,14 +12541,14 @@ class Wc extends oy { return this._programDateTime === null && this.rawProgramDateTime && (this.programDateTime = Date.parse(this.rawProgramDateTime)), this._programDateTime; } set programDateTime(e) { - if (!Z(e)) { + if (!J(e)) { this._programDateTime = this.rawProgramDateTime = null; return; } this._programDateTime = e; } get ref() { - return Ye(this) ? (this._ref || (this._ref = { + return Ze(this) ? (this._ref || (this._ref = { base: this.base, start: this.start, duration: this.duration, @@ -12524,7 +12592,7 @@ class Wc extends oy { u.startPTS = Math.min(u.startPTS, t), u.endPTS = Math.max(u.endPTS, i), u.startDTS = Math.min(u.startDTS, s), u.endDTS = Math.max(u.endDTS, r); } } -class $I extends oy { +class ak extends Sy { constructor(e, t, i, s, r) { super(i), this.fragOffset = 0, this.duration = 0, this.gap = !1, this.independent = !1, this.relurl = void 0, this.fragment = void 0, this.index = void 0, this.duration = e.decimalFloatingPoint("DURATION"), this.gap = e.bool("GAP"), this.independent = e.bool("INDEPENDENT"), this.relurl = e.enumeratedString("URI"), this.fragment = t, this.index = s; const a = e.enumeratedString("BYTERANGE"); @@ -12543,45 +12611,45 @@ class $I extends oy { return !!(e.audio || e.video || e.audiovideo); } } -function ly(n, e) { +function Ay(n, e) { const t = Object.getPrototypeOf(n); if (t) { const i = Object.getOwnPropertyDescriptor(t, e); - return i || ly(t, e); + return i || Ay(t, e); } } -function BI(n, e) { - const t = ly(n, e); +function ok(n, e) { + const t = Ay(n, e); t && (t.enumerable = !0, Object.defineProperty(n, e, t)); } -const gp = Math.pow(2, 32) - 1, NI = [].push, uy = { +const Cp = Math.pow(2, 32) - 1, lk = [].push, xy = { video: 1, audio: 2, id3: 3, text: 4 }; -function st(n) { +function ht(n) { return String.fromCharCode.apply(null, n); } -function cy(n, e) { +function Dy(n, e) { const t = n[e] << 8 | n[e + 1]; return t < 0 ? 65536 + t : t; } -function oe(n, e) { - const t = hy(n, e); +function le(n, e) { + const t = wy(n, e); return t < 0 ? 4294967296 + t : t; } -function pp(n, e) { - let t = oe(n, e); - return t *= Math.pow(2, 32), t += oe(n, e + 4), t; +function Fp(n, e) { + let t = le(n, e); + return t *= Math.pow(2, 32), t += le(n, e + 4), t; } -function hy(n, e) { +function wy(n, e) { return n[e] << 24 | n[e + 1] << 16 | n[e + 2] << 8 | n[e + 3]; } -function UI(n) { +function uk(n) { const e = n.byteLength; for (let t = 0; t < e; ) { - const i = oe(n, t); + const i = le(n, t); if (i > 8 && n[t + 4] === 109 && n[t + 5] === 111 && n[t + 6] === 111 && n[t + 7] === 102) return !0; t = i > 1 ? t + i : e; @@ -12594,36 +12662,36 @@ function fe(n, e) { return t; const i = n.byteLength; for (let s = 0; s < i; ) { - const r = oe(n, s), a = st(n.subarray(s + 4, s + 8)), o = r > 1 ? s + r : i; + const r = le(n, s), a = ht(n.subarray(s + 4, s + 8)), o = r > 1 ? s + r : i; if (a === e[0]) if (e.length === 1) t.push(n.subarray(s + 8, o)); else { const u = fe(n.subarray(s + 8, o), e.slice(1)); - u.length && NI.apply(t, u); + u.length && lk.apply(t, u); } s = o; } return t; } -function GI(n) { +function ck(n) { const e = [], t = n[0]; let i = 8; - const s = oe(n, i); + const s = le(n, i); i += 4; let r = 0, a = 0; - t === 0 ? (r = oe(n, i), a = oe(n, i + 4), i += 8) : (r = pp(n, i), a = pp(n, i + 8), i += 16), i += 2; + t === 0 ? (r = le(n, i), a = le(n, i + 4), i += 8) : (r = Fp(n, i), a = Fp(n, i + 8), i += 16), i += 2; let o = n.length + a; - const u = cy(n, i); + const u = Dy(n, i); i += 2; for (let l = 0; l < u; l++) { let c = i; - const h = oe(n, c); + const h = le(n, c); c += 4; const d = h & 2147483647; if ((h & 2147483648) >>> 31 === 1) - return Ee.warn("SIDX has hierarchical references (not supported)"), null; - const m = oe(n, c); + return Te.warn("SIDX has hierarchical references (not supported)"), null; + const m = le(n, c); c += 4, e.push({ referenceSize: d, subsegmentDuration: m, @@ -12643,26 +12711,26 @@ function GI(n) { references: e }; } -function dy(n) { +function Ly(n) { const e = [], t = fe(n, ["moov", "trak"]); for (let s = 0; s < t.length; s++) { const r = t[s], a = fe(r, ["tkhd"])[0]; if (a) { let o = a[0]; - const u = oe(a, o === 0 ? 12 : 20), l = fe(r, ["mdia", "mdhd"])[0]; + const u = le(a, o === 0 ? 12 : 20), l = fe(r, ["mdia", "mdhd"])[0]; if (l) { o = l[0]; - const c = oe(l, o === 0 ? 12 : 20), h = fe(r, ["mdia", "hdlr"])[0]; + const c = le(l, o === 0 ? 12 : 20), h = fe(r, ["mdia", "hdlr"])[0]; if (h) { - const d = st(h.subarray(8, 12)), f = { - soun: Fe.AUDIO, - vide: Fe.VIDEO - }[d], m = fe(r, ["mdia", "minf", "stbl", "stsd"])[0], g = HI(m); + const d = ht(h.subarray(8, 12)), f = { + soun: Pe.AUDIO, + vide: Pe.VIDEO + }[d], m = fe(r, ["mdia", "minf", "stbl", "stsd"])[0], g = hk(m); f ? (e[u] = { timescale: c, type: f, stsd: g - }, e[f] = Le({ + }, e[f] = Ie({ timescale: c, id: u }, g)) : e[u] = { @@ -12675,15 +12743,15 @@ function dy(n) { } } return fe(n, ["moov", "mvex", "trex"]).forEach((s) => { - const r = oe(s, 4), a = e[r]; + const r = le(s, 4), a = e[r]; a && (a.default = { - duration: oe(s, 12), - flags: oe(s, 20) + duration: le(s, 12), + flags: le(s, 20) }); }), e; } -function HI(n) { - const e = n.subarray(8), t = e.subarray(86), i = st(e.subarray(4, 8)); +function hk(n) { + const e = n.subarray(8), t = e.subarray(86), i = ht(e.subarray(4, 8)); let s = i, r; const a = i === "enca" || i === "encv"; if (a) { @@ -12691,10 +12759,10 @@ function HI(n) { fe(l, ["sinf"]).forEach((h) => { const d = fe(h, ["schm"])[0]; if (d) { - const f = st(d.subarray(4, 8)); + const f = ht(d.subarray(4, 8)); if (f === "cbcs" || f === "cenc") { const m = fe(h, ["frma"])[0]; - m && (s = st(m)); + m && (s = ht(m)); } } }); @@ -12706,7 +12774,7 @@ function HI(n) { case "avc3": case "avc4": { const u = fe(t, ["avcC"])[0]; - u && u.length > 3 && (s += "." + Uo(u[1]) + Uo(u[2]) + Uo(u[3]), r = No(o === "avc1" ? "dva1" : "dvav", t)); + u && u.length > 3 && (s += "." + rl(u[1]) + rl(u[2]) + rl(u[3]), r = sl(o === "avc1" ? "dva1" : "dvav", t)); break; } case "mp4a": { @@ -12715,19 +12783,19 @@ function HI(n) { let c = 4; if (l[c++] !== 3) break; - c = Yc(l, c), c += 2; + c = gh(l, c), c += 2; const h = l[c++]; if (h & 128 && (c += 2), h & 64 && (c += l[c++]), l[c++] !== 4) break; - c = Yc(l, c); + c = gh(l, c); const d = l[c++]; if (d === 64) - s += "." + Uo(d); + s += "." + rl(d); else break; if (c += 12, l[c++] !== 5) break; - c = Yc(l, c); + c = gh(l, c); const f = l[c++]; let m = (f & 248) >> 3; m === 31 && (m += 1 + ((f & 7) << 3) + ((l[c] & 224) >> 5)), s += "." + m; @@ -12738,8 +12806,8 @@ function HI(n) { case "hev1": { const u = fe(t, ["hvcC"])[0]; if (u && u.length > 12) { - const l = u[1], c = ["", "A", "B", "C"][l >> 6], h = l & 31, d = oe(u, 2), f = (l & 32) >> 5 ? "H" : "L", m = u[12], g = u.subarray(6, 12); - s += "." + c + h, s += "." + VI(d).toString(16).toUpperCase(), s += "." + f + m; + const l = u[1], c = ["", "A", "B", "C"][l >> 6], h = l & 31, d = le(u, 2), f = (l & 32) >> 5 ? "H" : "L", m = u[12], g = u.subarray(6, 12); + s += "." + c + h, s += "." + dk(d).toString(16).toUpperCase(), s += "." + f + m; let p = ""; for (let y = g.length; y--; ) { const v = g[y]; @@ -12747,7 +12815,7 @@ function HI(n) { } s += p; } - r = No(o == "hev1" ? "dvhe" : "dvh1", t); + r = sl(o == "hev1" ? "dvhe" : "dvh1", t); break; } case "dvh1": @@ -12755,14 +12823,14 @@ function HI(n) { case "dvav": case "dva1": case "dav1": { - s = No(s, t) || s; + s = sl(s, t) || s; break; } case "vp09": { const u = fe(t, ["vpcC"])[0]; if (u && u.length > 6) { const l = u[4], c = u[5], h = u[6] >> 4 & 15; - s += "." + Vi(l) + "." + Vi(c) + "." + Vi(h); + s += "." + zi(l) + "." + zi(c) + "." + zi(h); } break; } @@ -12770,7 +12838,7 @@ function HI(n) { const u = fe(t, ["av1C"])[0]; if (u && u.length > 2) { const l = u[1] >>> 5, c = u[1] & 31, h = u[2] >>> 7 ? "H" : "M", d = (u[2] & 64) >> 6, f = (u[2] & 32) >> 5, m = l === 2 && d ? f ? 12 : 10 : d ? 10 : 8, g = (u[2] & 16) >> 4, p = (u[2] & 8) >> 3, y = (u[2] & 4) >> 2, v = u[2] & 3; - s += "." + l + "." + Vi(c) + h + "." + Vi(m) + "." + g + "." + p + y + v + "." + Vi(1) + "." + Vi(1) + "." + Vi(1) + "." + 0, r = No("dav1", t); + s += "." + l + "." + zi(c) + h + "." + zi(m) + "." + g + "." + p + y + v + "." + zi(1) + "." + zi(1) + "." + zi(1) + "." + 0, r = sl("dav1", t); } break; } @@ -12781,32 +12849,32 @@ function HI(n) { supplemental: r }; } -function No(n, e) { +function sl(n, e) { const t = fe(e, ["dvvC"]), i = t.length ? t[0] : fe(e, ["dvcC"])[0]; if (i) { const s = i[2] >> 1 & 127, r = i[2] << 5 & 32 | i[3] >> 3 & 31; - return n + "." + Vi(s) + "." + Vi(r); + return n + "." + zi(s) + "." + zi(r); } } -function VI(n) { +function dk(n) { let e = 0; for (let t = 0; t < 32; t++) e |= (n >> t & 1) << 31 - t; return e >>> 0; } -function Yc(n, e) { +function gh(n, e) { const t = e + 5; for (; n[e++] & 128 && e < t; ) ; return e; } -function Uo(n) { +function rl(n) { return ("0" + n.toString(16).toUpperCase()).slice(-2); } -function Vi(n) { +function zi(n) { return (n < 10 ? "0" : "") + n; } -function qI(n, e) { +function fk(n, e) { if (!n || !e) return n; const t = e.keyId; @@ -12817,28 +12885,28 @@ function qI(n, e) { u || (o = fe(a, ["encv"])), o.forEach((l) => { const c = u ? l.subarray(28) : l.subarray(78); fe(c, ["sinf"]).forEach((d) => { - const f = KI(d); + const f = mk(d); if (f) { const m = f.subarray(8, 24); - m.some((g) => g !== 0) || (Ee.log(`[eme] Patching keyId in 'enc${u ? "a" : "v"}>sinf>>tenc' box: ${cs.hexDump(m)} -> ${cs.hexDump(t)}`), f.set(t, 8)); + m.some((g) => g !== 0) || (Te.log(`[eme] Patching keyId in 'enc${u ? "a" : "v"}>sinf>>tenc' box: ${gs.hexDump(m)} -> ${gs.hexDump(t)}`), f.set(t, 8)); } }); }); }), n; } -function KI(n) { +function mk(n) { const e = fe(n, ["schm"])[0]; if (e) { - const t = st(e.subarray(4, 8)); + const t = ht(e.subarray(4, 8)); if (t === "cbcs" || t === "cenc") return fe(n, ["schi", "tenc"])[0]; } return null; } -function jI(n, e, t) { +function gk(n, e, t) { const i = {}, s = fe(n, ["moof", "traf"]); for (let r = 0; r < s.length; r++) { - const a = s[r], o = fe(a, ["tfhd"])[0], u = oe(o, 4), l = e[u]; + const a = s[r], o = fe(a, ["tfhd"])[0], u = le(o, 4), l = e[u]; if (!l) continue; const c = i[u] || (i[u] = { @@ -12850,21 +12918,21 @@ function jI(n, e, t) { }), h = fe(a, ["tfdt"])[0]; if (h) { const _ = h[0]; - let E = oe(h, 4); - _ === 1 && (E === gp ? t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time") : (E *= gp + 1, E += oe(h, 8))), Z(E) && (!Z(c.start) || E < c.start) && (c.start = E); + let E = le(h, 4); + _ === 1 && (E === Cp ? t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time") : (E *= Cp + 1, E += le(h, 8))), J(E) && (!J(c.start) || E < c.start) && (c.start = E); } - const d = l.default, f = oe(o, 0) | (d == null ? void 0 : d.flags); + const d = l.default, f = le(o, 0) | (d == null ? void 0 : d.flags); let m = (d == null ? void 0 : d.duration) || 0; - f & 8 && (f & 2 ? m = oe(o, 12) : m = oe(o, 8)); + f & 8 && (f & 2 ? m = le(o, 12) : m = le(o, 8)); const g = fe(a, ["trun"]); let p = c.start || 0, y = 0, v = m; for (let _ = 0; _ < g.length; _++) { - const E = g[_], T = oe(E, 4), A = c.sampleCount; + const E = g[_], T = le(E, 4), x = c.sampleCount; c.sampleCount += T; - const S = E[3] & 1, D = E[3] & 4, x = E[2] & 1, w = E[2] & 2, I = E[2] & 4, R = E[2] & 8; - let M = 8, P = T; - for (S && (M += 4), D && T && (!(E[M + 1] & 1) && c.keyFrameIndex === void 0 && (c.keyFrameIndex = A), M += 4, x ? (v = oe(E, M), M += 4) : v = m, w && (M += 4), R && (M += 4), p += v, y += v, P--); P--; ) - x ? (v = oe(E, M), M += 4) : v = m, w && (M += 4), I && (E[M + 1] & 1 || c.keyFrameIndex === void 0 && (c.keyFrameIndex = c.sampleCount - (P + 1), c.keyFrameStart = p), M += 4), R && (M += 4), p += v, y += v; + const S = E[3] & 1, D = E[3] & 4, A = E[2] & 1, w = E[2] & 2, I = E[2] & 4, M = E[2] & 8; + let k = 8, q = T; + for (S && (k += 4), D && T && (!(E[k + 1] & 1) && c.keyFrameIndex === void 0 && (c.keyFrameIndex = x), k += 4, A ? (v = le(E, k), k += 4) : v = m, w && (k += 4), M && (k += 4), p += v, y += v, q--); q--; ) + A ? (v = le(E, k), k += 4) : v = m, w && (k += 4), I && (E[k + 1] & 1 || c.keyFrameIndex === void 0 && (c.keyFrameIndex = c.sampleCount - (q + 1), c.keyFrameStart = p), k += 4), M && (k += 4), p += v, y += v; !y && m && (y += m * T); } c.duration += y; @@ -12873,20 +12941,20 @@ function jI(n, e, t) { let r = 1 / 0, a = 0; const o = fe(n, ["sidx"]); for (let u = 0; u < o.length; u++) { - const l = GI(o[u]); + const l = ck(o[u]); if (l != null && l.references) { r = Math.min(r, l.earliestPresentationTime / l.timescale); const c = l.references.reduce((h, d) => h + d.info.duration || 0, 0); a = Math.max(a, c + l.earliestPresentationTime / l.timescale); } } - a && Z(a) && Object.keys(i).forEach((u) => { + a && J(a) && Object.keys(i).forEach((u) => { i[u].duration || (i[u].duration = a * i[u].timescale - i[u].start); }); } return i; } -function zI(n) { +function pk(n) { const e = { valid: null, remainder: null @@ -12896,11 +12964,11 @@ function zI(n) { const i = t[t.length - 1]; return e.valid = n.slice(0, i.byteOffset - 8), e.remainder = n.slice(i.byteOffset - 8), e; } -function li(n, e) { +function fi(n, e) { const t = new Uint8Array(n.length + e.length); return t.set(n), t.set(e, n.length), t; } -function _p(n, e) { +function Pp(n, e) { const t = [], i = e.samples, s = e.timescale, r = e.id; let a = !1; return fe(i, ["moof"]).map((u) => { @@ -12908,39 +12976,39 @@ function _p(n, e) { fe(u, ["traf"]).map((h) => { const d = fe(h, ["tfdt"]).map((f) => { const m = f[0]; - let g = oe(f, 4); - return m === 1 && (g *= Math.pow(2, 32), g += oe(f, 8)), g / s; + let g = le(f, 4); + return m === 1 && (g *= Math.pow(2, 32), g += le(f, 8)), g / s; })[0]; return d !== void 0 && (n = d), fe(h, ["tfhd"]).map((f) => { - const m = oe(f, 4), g = oe(f, 0) & 16777215, p = (g & 1) !== 0, y = (g & 2) !== 0, v = (g & 8) !== 0; + const m = le(f, 4), g = le(f, 0) & 16777215, p = (g & 1) !== 0, y = (g & 2) !== 0, v = (g & 8) !== 0; let _ = 0; const E = (g & 16) !== 0; let T = 0; - const A = (g & 32) !== 0; + const x = (g & 32) !== 0; let S = 8; - m === r && (p && (S += 8), y && (S += 4), v && (_ = oe(f, S), S += 4), E && (T = oe(f, S), S += 4), A && (S += 4), e.type === "video" && (a = fu(e.codec)), fe(h, ["trun"]).map((D) => { - const x = D[0], w = oe(D, 0) & 16777215, I = (w & 1) !== 0; - let R = 0; - const M = (w & 4) !== 0, P = (w & 256) !== 0; + m === r && (p && (S += 8), y && (S += 4), v && (_ = le(f, S), S += 4), E && (T = le(f, S), S += 4), x && (S += 4), e.type === "video" && (a = Pu(e.codec)), fe(h, ["trun"]).map((D) => { + const A = D[0], w = le(D, 0) & 16777215, I = (w & 1) !== 0; + let M = 0; + const k = (w & 4) !== 0, q = (w & 256) !== 0; let K = 0; - const q = (w & 512) !== 0; + const H = (w & 512) !== 0; + let Y = 0; + const B = (w & 1024) !== 0, z = (w & 2048) !== 0; let W = 0; - const U = (w & 1024) !== 0, j = (w & 2048) !== 0; - let $ = 0; - const L = oe(D, 4); - let H = 8; - I && (R = oe(D, H), H += 4), M && (H += 4); - let Q = R + l; - for (let X = 0; X < L; X++) { - if (P ? (K = oe(D, H), H += 4) : K = _, q ? (W = oe(D, H), H += 4) : W = T, U && (H += 4), j && (x === 0 ? $ = oe(D, H) : $ = hy(D, H), H += 4), e.type === Fe.VIDEO) { - let C = 0; - for (; C < W; ) { - const B = oe(i, Q); - if (Q += 4, WI(a, i[Q])) { - const N = i.subarray(Q, Q + B); - uf(N, a ? 2 : 1, n + $ / s, t); + const L = le(D, 4); + let $ = 8; + I && (M = le(D, $), $ += 4), k && ($ += 4); + let Q = M + l; + for (let C = 0; C < L; C++) { + if (q ? (K = le(D, $), $ += 4) : K = _, H ? (Y = le(D, $), $ += 4) : Y = T, B && ($ += 4), z && (A === 0 ? W = le(D, $) : W = wy(D, $), $ += 4), e.type === Pe.VIDEO) { + let O = 0; + for (; O < Y; ) { + const N = le(i, Q); + if (Q += 4, _k(a, i[Q])) { + const ee = i.subarray(Q, Q + N); + kf(ee, a ? 2 : 1, n + W / s, t); } - Q += B, C += B + 4; + Q += N, O += N + 4; } } n += K / s; @@ -12950,22 +13018,22 @@ function _p(n, e) { }); }), t; } -function fu(n) { +function Pu(n) { if (!n) return !1; const e = n.substring(0, 4); return e === "hvc1" || e === "hev1" || // Dolby Vision e === "dvh1" || e === "dvhe"; } -function WI(n, e) { +function _k(n, e) { if (n) { const t = e >> 1 & 63; return t === 39 || t === 40; } else return (e & 31) === 6; } -function uf(n, e, t, i) { - const s = fy(n); +function kf(n, e, t, i) { + const s = Iy(n); let r = 0; r += e; let a = 0, o = 0, u = 0; @@ -12987,14 +13055,14 @@ function uf(n, e, t, i) { if (o < l) r += o; else if (o > l) { - Ee.error(`Malformed SEI payload. ${o} is too small, only ${l} bytes left to parse.`); + Te.error(`Malformed SEI payload. ${o} is too small, only ${l} bytes left to parse.`); break; } if (a === 4) { if (s[c++] === 181) { - const d = cy(s, c); + const d = Dy(s, c); if (c += 2, d === 49) { - const f = oe(s, c); + const f = le(s, c); if (c += 4, f === 1195456820) { const m = s[c++]; if (m === 3) { @@ -13027,13 +13095,13 @@ function uf(n, e, t, i) { payloadType: a, pts: t, uuid: h.join(""), - userData: Kt(f), + userData: Qt(f), userDataBytes: f }); } } } -function fy(n) { +function Iy(n) { const e = n.byteLength, t = []; let i = 1; for (; i < e - 2; ) @@ -13046,25 +13114,25 @@ function fy(n) { a === t[0] && (a++, t.shift()), r[i] = n[a]; return r; } -function YI(n) { +function vk(n) { const e = n[0]; let t = "", i = "", s = 0, r = 0, a = 0, o = 0, u = 0, l = 0; if (e === 0) { - for (; st(n.subarray(l, l + 1)) !== "\0"; ) - t += st(n.subarray(l, l + 1)), l += 1; - for (t += st(n.subarray(l, l + 1)), l += 1; st(n.subarray(l, l + 1)) !== "\0"; ) - i += st(n.subarray(l, l + 1)), l += 1; - i += st(n.subarray(l, l + 1)), l += 1, s = oe(n, 12), r = oe(n, 16), o = oe(n, 20), u = oe(n, 24), l = 28; + for (; ht(n.subarray(l, l + 1)) !== "\0"; ) + t += ht(n.subarray(l, l + 1)), l += 1; + for (t += ht(n.subarray(l, l + 1)), l += 1; ht(n.subarray(l, l + 1)) !== "\0"; ) + i += ht(n.subarray(l, l + 1)), l += 1; + i += ht(n.subarray(l, l + 1)), l += 1, s = le(n, 12), r = le(n, 16), o = le(n, 20), u = le(n, 24), l = 28; } else if (e === 1) { - l += 4, s = oe(n, l), l += 4; - const h = oe(n, l); + l += 4, s = le(n, l), l += 4; + const h = le(n, l); l += 4; - const d = oe(n, l); - for (l += 4, a = 2 ** 32 * h + d, xI(a) || (a = Number.MAX_SAFE_INTEGER, Ee.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")), o = oe(n, l), l += 4, u = oe(n, l), l += 4; st(n.subarray(l, l + 1)) !== "\0"; ) - t += st(n.subarray(l, l + 1)), l += 1; - for (t += st(n.subarray(l, l + 1)), l += 1; st(n.subarray(l, l + 1)) !== "\0"; ) - i += st(n.subarray(l, l + 1)), l += 1; - i += st(n.subarray(l, l + 1)), l += 1; + const d = le(n, l); + for (l += 4, a = 2 ** 32 * h + d, WI(a) || (a = Number.MAX_SAFE_INTEGER, Te.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")), o = le(n, l), l += 4, u = le(n, l), l += 4; ht(n.subarray(l, l + 1)) !== "\0"; ) + t += ht(n.subarray(l, l + 1)), l += 1; + for (t += ht(n.subarray(l, l + 1)), l += 1; ht(n.subarray(l, l + 1)) !== "\0"; ) + i += ht(n.subarray(l, l + 1)), l += 1; + i += ht(n.subarray(l, l + 1)), l += 1; } const c = n.subarray(l, n.byteLength); return { @@ -13078,7 +13146,7 @@ function YI(n) { payload: c }; } -function XI(n, ...e) { +function yk(n, ...e) { const t = e.length; let i = 8, s = t; for (; s--; ) @@ -13088,7 +13156,7 @@ function XI(n, ...e) { r.set(e[s], i), i += e[s].byteLength; return r; } -function QI(n, e, t) { +function Ek(n, e, t) { if (n.byteLength !== 16) throw new RangeError("Invalid system id"); let i, s; @@ -13096,7 +13164,7 @@ function QI(n, e, t) { let r; i > 0 ? (r = new Uint8Array(4), e.length > 0 && new DataView(r.buffer).setUint32(0, e.length, !1)) : r = new Uint8Array(); const a = new Uint8Array(4); - return t && t.byteLength > 0 && new DataView(a.buffer).setUint32(0, t.byteLength, !1), XI( + return t && t.byteLength > 0 && new DataView(a.buffer).setUint32(0, t.byteLength, !1), yk( [112, 115, 115, 104], new Uint8Array([ i, @@ -13113,7 +13181,7 @@ function QI(n, e, t) { t || new Uint8Array() ); } -const my = () => /\(Windows.+Firefox\//i.test(navigator.userAgent), Tr = { +const ky = () => /\(Windows.+Firefox\//i.test(navigator.userAgent), Rr = { audio: { a3ds: 1, "ac-3": 0.95, @@ -13192,39 +13260,39 @@ const my = () => /\(Windows.+Firefox\//i.test(navigator.userAgent), Tr = { wvtt: 1 } }; -function cf(n, e) { - const t = Tr[e]; +function Rf(n, e) { + const t = Rr[e]; return !!t && !!t[n.slice(0, 4)]; } -function ad(n, e, t = !0) { - return !n.split(",").some((i) => !hf(i, e, t)); +function wd(n, e, t = !0) { + return !n.split(",").some((i) => !Cf(i, e, t)); } -function hf(n, e, t = !0) { +function Cf(n, e, t = !0) { var i; - const s = Qn(t); - return (i = s == null ? void 0 : s.isTypeSupported(Oa(n, e))) != null ? i : !1; + const s = ns(t); + return (i = s == null ? void 0 : s.isTypeSupported(za(n, e))) != null ? i : !1; } -function Oa(n, e) { +function za(n, e) { return `${e}/mp4;codecs=${n}`; } -function vp(n) { +function Op(n) { if (n) { const e = n.substring(0, 4); - return Tr.video[e]; + return Rr.video[e]; } return 2; } -function $l(n) { - const e = my(); +function tu(n) { + const e = ky(); return n.split(",").reduce((t, i) => { - const r = e && fu(i) ? 9 : Tr.video[i]; - return r ? (r * 2 + t) / (t ? 3 : 2) : (Tr.audio[i] + t) / (t ? 2 : 1); + const r = e && Pu(i) ? 9 : Rr.video[i]; + return r ? (r * 2 + t) / (t ? 3 : 2) : (Rr.audio[i] + t) / (t ? 2 : 1); }, 0); } -const Xc = {}; -function ZI(n, e = !0) { - if (Xc[n]) - return Xc[n]; +const ph = {}; +function bk(n, e = !0) { + if (ph[n]) + return ph[n]; const t = { // Idealy fLaC and Opus would be first (spec-compliant) but // some browsers will report that fLaC is supported then fail. @@ -13237,28 +13305,28 @@ function ZI(n, e = !0) { }[n]; for (let s = 0; s < t.length; s++) { var i; - if (hf(t[s], "audio", e)) - return Xc[n] = t[s], t[s]; - if (t[s] === "mp3" && (i = Qn(e)) != null && i.isTypeSupported("audio/mpeg")) + if (Cf(t[s], "audio", e)) + return ph[n] = t[s], t[s]; + if (t[s] === "mp3" && (i = ns(e)) != null && i.isTypeSupported("audio/mpeg")) return ""; } return n; } -const JI = /flac|opus|mp4a\.40\.34/i; -function Bl(n, e = !0) { - return n.replace(JI, (t) => ZI(t.toLowerCase(), e)); +const Tk = /flac|opus|mp4a\.40\.34/i; +function iu(n, e = !0) { + return n.replace(Tk, (t) => bk(t.toLowerCase(), e)); } -function ek(n, e) { +function Sk(n, e) { const t = []; if (n) { const i = n.split(","); for (let s = 0; s < i.length; s++) - cf(i[s], "video") || t.push(i[s]); + Rf(i[s], "video") || t.push(i[s]); } return e && t.push(e), t.join(","); } -function gl(n, e) { - if (n && (n.length > 4 || ["ac-3", "ec-3", "alac", "fLaC", "Opus"].indexOf(n) !== -1) && (yp(n, "audio") || yp(n, "video"))) +function Pl(n, e) { + if (n && (n.length > 4 || ["ac-3", "ec-3", "alac", "fLaC", "Opus"].indexOf(n) !== -1) && (Mp(n, "audio") || Mp(n, "video"))) return n; if (e) { const t = e.split(","); @@ -13273,10 +13341,10 @@ function gl(n, e) { } return e || n; } -function yp(n, e) { - return cf(n, e) && hf(n, e); +function Mp(n, e) { + return Rf(n, e) && Cf(n, e); } -function tk(n) { +function Ak(n) { const e = n.split(","); for (let t = 0; t < e.length; t++) { const i = e[t].split("."); @@ -13284,7 +13352,7 @@ function tk(n) { } return e.join(","); } -function ik(n) { +function xk(n) { if (n.startsWith("av01.")) { const e = n.split("."), t = ["0", "111", "01", "01", "01", "0"]; for (let i = e.length; i > 4 && i < 10; i++) @@ -13293,8 +13361,8 @@ function ik(n) { } return n; } -function Ep(n) { - const e = Qn(n) || { +function $p(n) { + const e = ns(n) || { isTypeSupported: () => !1 }; return { @@ -13303,10 +13371,10 @@ function Ep(n) { ac3: e.isTypeSupported('audio/mp4; codecs="ac-3"') }; } -function od(n) { +function Ld(n) { return n.replace(/^.+codecs=["']?([^"']+).*$/, "$1"); } -const gy = { +const Ry = { supported: !0, configurations: [], decodingInfoResults: [{ @@ -13315,7 +13383,7 @@ const gy = { smooth: !0 }] }; -function py(n, e) { +function Cy(n, e) { return { supported: !1, configurations: e, @@ -13327,7 +13395,7 @@ function py(n, e) { error: n }; } -function nk(n, e, t, i, s, r) { +function Dk(n, e, t, i, s, r) { const a = n.videoCodec, o = n.audioCodec ? n.audioGroups : null, u = r == null ? void 0 : r.audioCodec, l = r == null ? void 0 : r.channels, c = l ? parseInt(l) : u ? 1 / 0 : 2; let h = null; if (o != null && o.length) @@ -13349,13 +13417,13 @@ function nk(n, e, t, i, s, r) { return !0; } return a !== void 0 && // Force media capabilities check for HEVC to avoid failure on Windows - (a.split(",").some((d) => fu(d)) || n.width > 1920 && n.height > 1088 || n.height > 1920 && n.width > 1088 || n.frameRate > Math.max(i, 30) || n.videoRange !== "SDR" && n.videoRange !== t || n.bitrate > Math.max(s, 8e6)) || !!h && Z(c) && Object.keys(h).some((d) => parseInt(d) > c); + (a.split(",").some((d) => Pu(d)) || n.width > 1920 && n.height > 1088 || n.height > 1920 && n.width > 1088 || n.frameRate > Math.max(i, 30) || n.videoRange !== "SDR" && n.videoRange !== t || n.bitrate > Math.max(s, 8e6)) || !!h && J(c) && Object.keys(h).some((d) => parseInt(d) > c); } -function _y(n, e, t, i = {}) { +function Fy(n, e, t, i = {}) { const s = n.videoCodec; if (!s && !n.audioCodec || !t) - return Promise.resolve(gy); - const r = [], a = sk(n), o = a.length, u = rk(n, e, o > 0), l = u.length; + return Promise.resolve(Ry); + const r = [], a = wk(n), o = a.length, u = Lk(n, e, o > 0), l = u.length; for (let c = o || 1 * l || 1; c--; ) { const h = { type: "media-source" @@ -13369,11 +13437,11 @@ function _y(n, e, t, i = {}) { } if (s) { const c = navigator.userAgent; - if (s.split(",").some((h) => fu(h)) && my()) - return Promise.resolve(py(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${c})`), r)); + if (s.split(",").some((h) => Pu(h)) && ky()) + return Promise.resolve(Cy(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${c})`), r)); } return Promise.all(r.map((c) => { - const h = ok(c); + const h = kk(c); return i[h] || (i[h] = t.decodingInfo(c)); })).then((c) => ({ supported: !c.some((h) => !h.supported), @@ -13386,12 +13454,12 @@ function _y(n, e, t, i = {}) { error: c })); } -function sk(n) { +function wk(n) { var e; - const t = (e = n.videoCodec) == null ? void 0 : e.split(","), i = vy(n), s = n.width || 640, r = n.height || 480, a = n.frameRate || 30, o = n.videoRange.toLowerCase(); + const t = (e = n.videoCodec) == null ? void 0 : e.split(","), i = Py(n), s = n.width || 640, r = n.height || 480, a = n.frameRate || 30, o = n.videoRange.toLowerCase(); return t ? t.map((u) => { const l = { - contentType: Oa(ik(u), "video"), + contentType: za(xk(u), "video"), width: s, height: r, bitrate: i, @@ -13400,9 +13468,9 @@ function sk(n) { return o !== "sdr" && (l.transferFunction = o), l; }) : []; } -function rk(n, e, t) { +function Lk(n, e, t) { var i; - const s = (i = n.audioCodec) == null ? void 0 : i.split(","), r = vy(n); + const s = (i = n.audioCodec) == null ? void 0 : i.split(","), r = Py(n); return s && n.audioGroups ? n.audioGroups.reduce((a, o) => { var u; const l = o ? (u = e.groups[o]) == null ? void 0 : u.tracks : null; @@ -13411,8 +13479,8 @@ function rk(n, e, t) { const d = parseFloat(h.channels || ""); s.forEach((f) => { const m = { - contentType: Oa(f, "audio"), - bitrate: t ? ak(f, r) : r + contentType: za(f, "audio"), + bitrate: t ? Ik(f, r) : r }; d && (m.channels = "" + d), c.push(m); }); @@ -13421,53 +13489,53 @@ function rk(n, e, t) { }, a) : a; }, []) : []; } -function ak(n, e) { +function Ik(n, e) { if (e <= 1) return 1; let t = 128e3; return n === "ec-3" ? t = 768e3 : n === "ac-3" && (t = 64e4), Math.min(e / 2, t); } -function vy(n) { +function Py(n) { return Math.ceil(Math.max(n.bitrate * 0.9, n.averageBitrate) / 1e3) * 1e3 || 1; } -function ok(n) { +function kk(n) { let e = ""; const { audio: t, video: i } = n; if (i) { - const s = od(i.contentType); + const s = Ld(i.contentType); e += `${s}_r${i.height}x${i.width}f${Math.ceil(i.framerate)}${i.transferFunction || "sd"}_${Math.ceil(i.bitrate / 1e5)}`; } if (t) { - const s = od(t.contentType); + const s = Ld(t.contentType); e += `${i ? "_" : ""}${s}_c${t.channels}`; } return e; } -const ld = ["NONE", "TYPE-0", "TYPE-1", null]; -function lk(n) { - return ld.indexOf(n) > -1; +const Id = ["NONE", "TYPE-0", "TYPE-1", null]; +function Rk(n) { + return Id.indexOf(n) > -1; } -const Nl = ["SDR", "PQ", "HLG"]; -function uk(n) { - return !!n && Nl.indexOf(n) > -1; +const nu = ["SDR", "PQ", "HLG"]; +function Ck(n) { + return !!n && nu.indexOf(n) > -1; } -var pl = { +var Ol = { No: "", Yes: "YES", v2: "v2" }; -function bp(n) { +function Bp(n) { const { canSkipUntil: e, canSkipDateRanges: t, age: i } = n, s = i < e / 2; - return e && s ? t ? pl.v2 : pl.Yes : pl.No; + return e && s ? t ? Ol.v2 : Ol.Yes : Ol.No; } -class Tp { +class Np { constructor(e, t, i) { this.msn = void 0, this.part = void 0, this.skip = void 0, this.msn = e, this.part = t, this.skip = i; } @@ -13476,7 +13544,7 @@ class Tp { return this.msn !== void 0 && t.searchParams.set("_HLS_msn", this.msn.toString()), this.part !== void 0 && t.searchParams.set("_HLS_part", this.part.toString()), this.skip && t.searchParams.set("_HLS_skip", this.skip), t.href; } } -class Ma { +class Wa { constructor(e) { if (this._attrs = void 0, this.audioCodec = void 0, this.bitrate = void 0, this.codecSet = void 0, this.url = void 0, this.frameRate = void 0, this.height = void 0, this.id = void 0, this.name = void 0, this.supplemental = void 0, this.videoCodec = void 0, this.width = void 0, this.details = void 0, this.fragmentError = 0, this.loadError = 0, this.loaded = void 0, this.realBitrate = 0, this.supportedPromise = void 0, this.supportedResult = void 0, this._avgBitrate = 0, this._audioGroups = void 0, this._subtitleGroups = void 0, this._urlId = 0, this.url = [e.url], this._attrs = [e.attrs], this.bitrate = e.bitrate, e.details && (this.details = e.details), this.id = e.id || 0, this.name = e.name, this.width = e.width || 0, this.height = e.height || 0, this.frameRate = e.attrs.optionalFloat("FRAME-RATE", 0), this._avgBitrate = e.attrs.decimalInteger("AVERAGE-BANDWIDTH"), this.audioCodec = e.audioCodec, this.videoCodec = e.videoCodec, this.codecSet = [e.videoCodec, e.audioCodec].filter((i) => !!i).map((i) => i.substring(0, 4)).join(","), "supplemental" in e) { var t; @@ -13511,10 +13579,10 @@ class Ma { return this.url[0] || ""; } hasAudioGroup(e) { - return Sp(this._audioGroups, e); + return Up(this._audioGroups, e); } hasSubtitleGroup(e) { - return Sp(this._subtitleGroups, e); + return Up(this._subtitleGroups, e); } get audioGroups() { return this._audioGroups; @@ -13556,10 +13624,10 @@ class Ma { addFallback() { } } -function Sp(n, e) { +function Up(n, e) { return !e || !n ? !1 : n.indexOf(e) !== -1; } -function ck() { +function Fk() { if (typeof matchMedia == "function") { const n = matchMedia("(dynamic-range: high)"), e = matchMedia("bad query"); if (n.media !== e.media) @@ -13567,19 +13635,19 @@ function ck() { } return !1; } -function hk(n, e) { +function Pk(n, e) { let t = !1, i = []; if (n && (t = n !== "SDR", i = [n]), e) { - i = e.allowedVideoRanges || Nl.slice(0); + i = e.allowedVideoRanges || nu.slice(0); const s = i.join("") !== "SDR" && !e.videoCodec; - t = e.preferHDR !== void 0 ? e.preferHDR : s && ck(), t || (i = ["SDR"]); + t = e.preferHDR !== void 0 ? e.preferHDR : s && Fk(), t || (i = ["SDR"]); } return { preferHDR: t, allowedVideoRanges: i }; } -const dk = (n) => { +const Ok = (n) => { const e = /* @__PURE__ */ new WeakSet(); return (t, i) => { if (n && (i = n(t, i)), typeof i == "object" && i !== null) { @@ -13589,51 +13657,51 @@ const dk = (n) => { } return i; }; -}, Oe = (n, e) => JSON.stringify(n, dk(e)); -function fk(n, e, t, i, s) { +}, $e = (n, e) => JSON.stringify(n, Ok(e)); +function Mk(n, e, t, i, s) { const r = Object.keys(n), a = i == null ? void 0 : i.channels, o = i == null ? void 0 : i.audioCodec, u = s == null ? void 0 : s.videoCodec, l = a && parseInt(a) === 2; let c = !1, h = !1, d = 1 / 0, f = 1 / 0, m = 1 / 0, g = 1 / 0, p = 0, y = []; const { preferHDR: v, allowedVideoRanges: _ - } = hk(e, s); + } = Pk(e, s); for (let D = r.length; D--; ) { - const x = n[r[D]]; - c || (c = x.channels[2] > 0), d = Math.min(d, x.minHeight), f = Math.min(f, x.minFramerate), m = Math.min(m, x.minBitrate), _.filter((I) => x.videoRanges[I] > 0).length > 0 && (h = !0); + const A = n[r[D]]; + c || (c = A.channels[2] > 0), d = Math.min(d, A.minHeight), f = Math.min(f, A.minFramerate), m = Math.min(m, A.minBitrate), _.filter((I) => A.videoRanges[I] > 0).length > 0 && (h = !0); } - d = Z(d) ? d : 0, f = Z(f) ? f : 0; + d = J(d) ? d : 0, f = J(f) ? f : 0; const E = Math.max(1080, d), T = Math.max(30, f); - m = Z(m) ? m : t, t = Math.max(m, t), h || (e = void 0); - const A = r.length > 1; + m = J(m) ? m : t, t = Math.max(m, t), h || (e = void 0); + const x = r.length > 1; return { - codecSet: r.reduce((D, x) => { - const w = n[x]; - if (x === D) + codecSet: r.reduce((D, A) => { + const w = n[A]; + if (A === D) return D; - if (y = h ? _.filter((I) => w.videoRanges[I] > 0) : [], A) { + if (y = h ? _.filter((I) => w.videoRanges[I] > 0) : [], x) { if (w.minBitrate > t) - return Gi(x, `min bitrate of ${w.minBitrate} > current estimate of ${t}`), D; + return Ki(A, `min bitrate of ${w.minBitrate} > current estimate of ${t}`), D; if (!w.hasDefaultAudio) - return Gi(x, "no renditions with default or auto-select sound found"), D; - if (o && x.indexOf(o.substring(0, 4)) % 5 !== 0) - return Gi(x, `audio codec preference "${o}" not found`), D; + return Ki(A, "no renditions with default or auto-select sound found"), D; + if (o && A.indexOf(o.substring(0, 4)) % 5 !== 0) + return Ki(A, `audio codec preference "${o}" not found`), D; if (a && !l) { if (!w.channels[a]) - return Gi(x, `no renditions with ${a} channel sound found (channels options: ${Object.keys(w.channels)})`), D; + return Ki(A, `no renditions with ${a} channel sound found (channels options: ${Object.keys(w.channels)})`), D; } else if ((!o || l) && c && w.channels[2] === 0) - return Gi(x, "no renditions with stereo sound found"), D; + return Ki(A, "no renditions with stereo sound found"), D; if (w.minHeight > E) - return Gi(x, `min resolution of ${w.minHeight} > maximum of ${E}`), D; + return Ki(A, `min resolution of ${w.minHeight} > maximum of ${E}`), D; if (w.minFramerate > T) - return Gi(x, `min framerate of ${w.minFramerate} > maximum of ${T}`), D; + return Ki(A, `min framerate of ${w.minFramerate} > maximum of ${T}`), D; if (!y.some((I) => w.videoRanges[I] > 0)) - return Gi(x, `no variants with VIDEO-RANGE of ${Oe(y)} found`), D; - if (u && x.indexOf(u.substring(0, 4)) % 5 !== 0) - return Gi(x, `video codec preference "${u}" not found`), D; + return Ki(A, `no variants with VIDEO-RANGE of ${$e(y)} found`), D; + if (u && A.indexOf(u.substring(0, 4)) % 5 !== 0) + return Ki(A, `video codec preference "${u}" not found`), D; if (w.maxScore < p) - return Gi(x, `max score of ${w.maxScore} < selected max of ${p}`), D; + return Ki(A, `max score of ${w.maxScore} < selected max of ${p}`), D; } - return D && ($l(x) >= $l(D) || w.fragmentError > n[D].fragmentError) ? D : (g = w.minIndex, p = w.maxScore, x); + return D && (tu(A) >= tu(D) || w.fragmentError > n[D].fragmentError) ? D : (g = w.minIndex, p = w.maxScore, A); }, void 0), videoRanges: y, preferHDR: v, @@ -13642,10 +13710,10 @@ function fk(n, e, t, i, s) { minIndex: g }; } -function Gi(n, e) { - Ee.log(`[abr] start candidates with "${n}" ignored because ${e}`); +function Ki(n, e) { + Te.log(`[abr] start candidates with "${n}" ignored because ${e}`); } -function yy(n) { +function Oy(n) { return n.reduce((e, t) => { let i = e.groups[t.groupId]; i || (i = e.groups[t.groupId] = { @@ -13664,7 +13732,7 @@ function yy(n) { groups: {} }); } -function mk(n, e, t, i) { +function $k(n, e, t, i) { return n.slice(t, i + 1).reduce((s, r, a) => { if (!r.codecSet) return s; @@ -13696,7 +13764,7 @@ function mk(n, e, t, i) { }), s; }, {}); } -function Ap(n) { +function Gp(n) { if (!n) return n; const { @@ -13714,7 +13782,7 @@ function Ap(n) { audioCodec: r }; } -function tn(n, e, t) { +function rn(n, e, t) { if ("attrs" in n) { const i = e.indexOf(n); if (i !== -1) @@ -13722,12 +13790,12 @@ function tn(n, e, t) { } for (let i = 0; i < e.length; i++) { const s = e[i]; - if (Ts(n, s, t)) + if (Is(n, s, t)) return i; } return -1; } -function Ts(n, e, t) { +function Is(n, e, t) { const { groupId: i, name: s, @@ -13735,40 +13803,40 @@ function Ts(n, e, t) { assocLang: a, default: o } = n, u = n.forced; - return (i === void 0 || e.groupId === i) && (s === void 0 || e.name === s) && (r === void 0 || gk(r, e.lang)) && (r === void 0 || e.assocLang === a) && (o === void 0 || e.default === o) && (u === void 0 || e.forced === u) && (!("characteristics" in n) || pk(n.characteristics || "", e.characteristics)) && (t === void 0 || t(n, e)); + return (i === void 0 || e.groupId === i) && (s === void 0 || e.name === s) && (r === void 0 || Bk(r, e.lang)) && (r === void 0 || e.assocLang === a) && (o === void 0 || e.default === o) && (u === void 0 || e.forced === u) && (!("characteristics" in n) || Nk(n.characteristics || "", e.characteristics)) && (t === void 0 || t(n, e)); } -function gk(n, e = "--") { +function Bk(n, e = "--") { return n.length === e.length ? n === e : n.startsWith(e) || e.startsWith(n); } -function pk(n, e = "") { +function Nk(n, e = "") { const t = n.split(","), i = e.split(","); return t.length === i.length && !t.some((s) => i.indexOf(s) === -1); } -function us(n, e) { +function ms(n, e) { const { audioCodec: t, channels: i } = n; return (t === void 0 || (e.audioCodec || "").substring(0, 4) === t.substring(0, 4)) && (i === void 0 || i === (e.channels || "2")); } -function _k(n, e, t, i, s) { +function Uk(n, e, t, i, s) { const r = e[i], o = e.reduce((d, f, m) => { const g = f.uri; return (d[g] || (d[g] = [])).push(m), d; }, {})[r.uri]; o.length > 1 && (i = Math.max.apply(Math, o)); - const u = r.videoRange, l = r.frameRate, c = r.codecSet.substring(0, 4), h = xp(e, i, (d) => { + const u = r.videoRange, l = r.frameRate, c = r.codecSet.substring(0, 4), h = Hp(e, i, (d) => { if (d.videoRange !== u || d.frameRate !== l || d.codecSet.substring(0, 4) !== c) return !1; const f = d.audioGroups, m = t.filter((g) => !f || f.indexOf(g.groupId) !== -1); - return tn(n, m, s) > -1; + return rn(n, m, s) > -1; }); - return h > -1 ? h : xp(e, i, (d) => { + return h > -1 ? h : Hp(e, i, (d) => { const f = d.audioGroups, m = t.filter((g) => !f || f.indexOf(g.groupId) !== -1); - return tn(n, m, s) > -1; + return rn(n, m, s) > -1; }); } -function xp(n, e, t) { +function Hp(n, e, t) { for (let i = e; i > -1; i--) if (t(n[i])) return i; @@ -13777,11 +13845,11 @@ function xp(n, e, t) { return i; return -1; } -function Ul(n, e) { +function su(n, e) { var t; return !!n && n !== ((t = e.loadLevelObj) == null ? void 0 : t.uri); } -class vk extends Fi { +class Gk extends Bi { constructor(e) { super("abr", e.logger), this.hls = void 0, this.lastLevelLoadSec = 0, this.lastLoadedFragLevel = -1, this.firstSelection = -1, this._nextAutoLevel = -1, this.nextAutoLevelKey = "", this.audioTracksByGroup = null, this.codecTiers = null, this.timer = -1, this.fragCurrent = null, this.partCurrent = null, this.bitrateTestDelay = 0, this.rebufferNotice = -1, this.supportedCache = {}, this.bwEstimator = void 0, this._abandonRulesCheck = (t) => { var i; @@ -13811,46 +13879,46 @@ class vk extends Fi { const _ = this.bwEstimator.getEstimateTTFB(), E = Math.abs(u.playbackRate); if (d <= Math.max(_, 1e3 * (h / (E * 2)))) return; - const T = v ? v.len / E : 0, A = c.loading.first ? c.loading.first - c.loading.start : -1, S = c.loaded && A > -1, D = this.getBwEstimate(), x = a.levels, w = x[m], I = Math.max(c.loaded, Math.round(h * (s.bitrate || w.averageBitrate) / 8)); - let R = S ? d - A : d; - R < 1 && S && (R = Math.min(d, c.loaded * 8 / D)); - const M = S ? c.loaded * 1e3 / R : 0, P = _ / 1e3, K = M ? (I - c.loaded) / M : I * 8 / D + P; + const T = v ? v.len / E : 0, x = c.loading.first ? c.loading.first - c.loading.start : -1, S = c.loaded && x > -1, D = this.getBwEstimate(), A = a.levels, w = A[m], I = Math.max(c.loaded, Math.round(h * (s.bitrate || w.averageBitrate) / 8)); + let M = S ? d - x : d; + M < 1 && S && (M = Math.min(d, c.loaded * 8 / D)); + const k = S ? c.loaded * 1e3 / M : 0, q = _ / 1e3, K = k ? (I - c.loaded) / k : I * 8 / D + q; if (K <= T) return; - const q = M ? M * 8 : D, W = ((i = (t == null ? void 0 : t.details) || this.hls.latestLevelDetails) == null ? void 0 : i.live) === !0, U = this.hls.config.abrBandWidthUpFactor; - let j = Number.POSITIVE_INFINITY, $; - for ($ = m - 1; $ > f; $--) { - const X = x[$].maxBitrate, C = !x[$].details || W; - if (j = this.getTimeToLoadFrag(P, q, h * X, C), j < Math.min(T, h + P)) + const H = k ? k * 8 : D, Y = ((i = (t == null ? void 0 : t.details) || this.hls.latestLevelDetails) == null ? void 0 : i.live) === !0, B = this.hls.config.abrBandWidthUpFactor; + let z = Number.POSITIVE_INFINITY, W; + for (W = m - 1; W > f; W--) { + const C = A[W].maxBitrate, O = !A[W].details || Y; + if (z = this.getTimeToLoadFrag(q, H, h * C, O), z < Math.min(T, h + q)) break; } - if (j >= K || j > h * 10) + if (z >= K || z > h * 10) return; - S ? this.bwEstimator.sample(d - Math.min(_, A), c.loaded) : this.bwEstimator.sampleTTFB(d); - const L = x[$].maxBitrate; - this.getBwEstimate() * U > L && this.resetEstimator(L); - const H = this.findBestLevel(L, f, $, 0, T, 1, 1); - H > -1 && ($ = H), this.warn(`Fragment ${s.sn}${r ? " part " + r.index : ""} of level ${m} is loading too slowly; + S ? this.bwEstimator.sample(d - Math.min(_, x), c.loaded) : this.bwEstimator.sampleTTFB(d); + const L = A[W].maxBitrate; + this.getBwEstimate() * B > L && this.resetEstimator(L); + const $ = this.findBestLevel(L, f, W, 0, T, 1, 1); + $ > -1 && (W = $), this.warn(`Fragment ${s.sn}${r ? " part " + r.index : ""} of level ${m} is loading too slowly; Fragment duration: ${s.duration.toFixed(3)} Time to underbuffer: ${T.toFixed(3)} s Estimated load time for current fragment: ${K.toFixed(3)} s - Estimated load time for down switch fragment: ${j.toFixed(3)} s - TTFB estimate: ${A | 0} ms - Current BW estimate: ${Z(D) ? D | 0 : "Unknown"} bps + Estimated load time for down switch fragment: ${z.toFixed(3)} s + TTFB estimate: ${x | 0} ms + Current BW estimate: ${J(D) ? D | 0 : "Unknown"} bps New BW estimate: ${this.getBwEstimate() | 0} bps - Switching to level ${$} @ ${L | 0} bps`), a.nextLoadLevel = a.nextAutoLevel = $, this.clearTimer(); + Switching to level ${W} @ ${L | 0} bps`), a.nextLoadLevel = a.nextAutoLevel = W, this.clearTimer(); const Q = () => { - if (this.clearTimer(), this.fragCurrent === s && this.hls.loadLevel === $ && $ > 0) { - const X = this.getStarvationDelay(); - if (this.warn(`Aborting inflight request ${$ > 0 ? "and switching down" : ""} + if (this.clearTimer(), this.fragCurrent === s && this.hls.loadLevel === W && W > 0) { + const C = this.getStarvationDelay(); + if (this.warn(`Aborting inflight request ${W > 0 ? "and switching down" : ""} Fragment duration: ${s.duration.toFixed(3)} s - Time to underbuffer: ${X.toFixed(3)} s`), s.abortRequests(), this.fragCurrent = this.partCurrent = null, $ > f) { - let C = this.findBestLevel(this.hls.levels[f].bitrate, f, $, 0, X, 1, 1); - C === -1 && (C = f), this.hls.nextLoadLevel = this.hls.nextAutoLevel = C, this.resetEstimator(this.hls.levels[C].bitrate); + Time to underbuffer: ${C.toFixed(3)} s`), s.abortRequests(), this.fragCurrent = this.partCurrent = null, W > f) { + let O = this.findBestLevel(this.hls.levels[f].bitrate, f, W, 0, C, 1, 1); + O === -1 && (O = f), this.hls.nextLoadLevel = this.hls.nextAutoLevel = O, this.resetEstimator(this.hls.levels[O].bitrate); } } }; - p || K > j * 2 ? Q() : this.timer = self.setInterval(Q, j * 1e3), a.trigger(b.FRAG_LOAD_EMERGENCY_ABORTED, { + p || K > z * 2 ? Q() : this.timer = self.setInterval(Q, z * 1e3), a.trigger(b.FRAG_LOAD_EMERGENCY_ABORTED, { frag: s, part: r, stats: c @@ -13862,7 +13930,7 @@ class vk extends Fi { } initEstimator() { const e = this.hls.config; - return new wI(e.abrEwmaSlowVoD, e.abrEwmaFastVoD, e.abrEwmaDefaultEstimate); + return new XI(e.abrEwmaSlowVoD, e.abrEwmaFastVoD, e.abrEwmaDefaultEstimate); } registerListeners() { const { @@ -13904,11 +13972,11 @@ class vk extends Fi { onError(e, t) { if (!t.fatal) switch (t.details) { - case O.BUFFER_ADD_CODEC_ERROR: - case O.BUFFER_APPEND_ERROR: + case P.BUFFER_ADD_CODEC_ERROR: + case P.BUFFER_APPEND_ERROR: this.lastLoadedFragLevel = -1, this.firstSelection = -1; break; - case O.FRAG_LOAD_TIMEOUT: { + case P.FRAG_LOAD_TIMEOUT: { const i = t.frag, { fragCurrent: s, partCurrent: r @@ -13933,14 +14001,14 @@ class vk extends Fi { const i = this.hls.config, { loading: s } = t.stats, r = s.end - s.first; - Z(r) && (this.lastLevelLoadSec = r / 1e3), t.details.live ? this.bwEstimator.update(i.abrEwmaSlowLive, i.abrEwmaFastLive) : this.bwEstimator.update(i.abrEwmaSlowVoD, i.abrEwmaFastVoD), this.timer > -1 && this._abandonRulesCheck(t.levelInfo); + J(r) && (this.lastLevelLoadSec = r / 1e3), t.details.live ? this.bwEstimator.update(i.abrEwmaSlowLive, i.abrEwmaFastLive) : this.bwEstimator.update(i.abrEwmaSlowVoD, i.abrEwmaFastVoD), this.timer > -1 && this._abandonRulesCheck(t.levelInfo); } onFragLoaded(e, { frag: t, part: i }) { const s = i ? i.stats : t.stats; - if (t.type === J.MAIN && this.bwEstimator.sampleTTFB(s.loading.first - s.loading.start), !this.ignoreFragment(t)) { + if (t.type === te.MAIN && this.bwEstimator.sampleTTFB(s.loading.first - s.loading.start), !this.ignoreFragment(t)) { if (this.clearTimer(), t.level === this._nextAutoLevel && (this._nextAutoLevel = -1), this.firstSelection = -1, this.hls.config.abrMaxWithRealBitrate) { const r = i ? i.duration : t.duration, a = this.hls.levels[t.level], o = (a.loaded ? a.loaded.bytes : 0) + s.loaded, u = (a.loaded ? a.loaded.duration : 0) + r; a.loaded = { @@ -13971,7 +14039,7 @@ class vk extends Fi { this.bwEstimator.sample(a, r.loaded), r.bwEstimate = this.getBwEstimate(), i.bitrateTest ? this.bitrateTestDelay = a / 1e3 : this.bitrateTestDelay = 0; } ignoreFragment(e) { - return e.type !== J.MAIN || e.sn === "initSegment"; + return e.type !== te.MAIN || e.sn === "initSegment"; } clearTimer() { this.timer > -1 && (self.clearInterval(this.timer), this.timer = -1); @@ -14059,60 +14127,60 @@ class vk extends Fi { if (m.length === 1) return 0; const v = m[h], _ = !!((u = this.hls.latestLevelDetails) != null && u.live), E = p === -1 || c === -1; - let T, A = "SDR", S = (v == null ? void 0 : v.frameRate) || 0; + let T, x = "SDR", S = (v == null ? void 0 : v.frameRate) || 0; const { audioPreference: D, - videoPreference: x - } = y, w = this.audioTracksByGroup || (this.audioTracksByGroup = yy(g)); + videoPreference: A + } = y, w = this.audioTracksByGroup || (this.audioTracksByGroup = Oy(g)); let I = -1; if (E) { if (this.firstSelection !== -1) return this.firstSelection; - const W = this.codecTiers || (this.codecTiers = mk(m, w, t, i)), U = fk(W, A, e, D, x), { - codecSet: j, - videoRanges: $, + const Y = this.codecTiers || (this.codecTiers = $k(m, w, t, i)), B = Mk(Y, x, e, D, A), { + codecSet: z, + videoRanges: W, minFramerate: L, - minBitrate: H, + minBitrate: $, minIndex: Q, - preferHDR: X - } = U; - I = Q, T = j, A = X ? $[$.length - 1] : $[0], S = L, e = Math.max(e, H), this.log(`picked start tier ${Oe(U)}`); + preferHDR: C + } = B; + I = Q, T = z, x = C ? W[W.length - 1] : W[0], S = L, e = Math.max(e, $), this.log(`picked start tier ${$e(B)}`); } else - T = v == null ? void 0 : v.codecSet, A = v == null ? void 0 : v.videoRange; - const R = f ? f.duration : d ? d.duration : 0, M = this.bwEstimator.getEstimateTTFB() / 1e3, P = []; - for (let W = i; W >= t; W--) { - var K, q; - const U = m[W], j = W > h; - if (!U) + T = v == null ? void 0 : v.codecSet, x = v == null ? void 0 : v.videoRange; + const M = f ? f.duration : d ? d.duration : 0, k = this.bwEstimator.getEstimateTTFB() / 1e3, q = []; + for (let Y = i; Y >= t; Y--) { + var K, H; + const B = m[Y], z = Y > h; + if (!B) continue; - if (y.useMediaCapabilities && !U.supportedResult && !U.supportedPromise) { - const B = navigator.mediaCapabilities; - typeof (B == null ? void 0 : B.decodingInfo) == "function" && nk(U, w, A, S, e, D) ? (U.supportedPromise = _y(U, w, B, this.supportedCache), U.supportedPromise.then((N) => { + if (y.useMediaCapabilities && !B.supportedResult && !B.supportedPromise) { + const N = navigator.mediaCapabilities; + typeof (N == null ? void 0 : N.decodingInfo) == "function" && Dk(B, w, x, S, e, D) ? (B.supportedPromise = Fy(B, w, N, this.supportedCache), B.supportedPromise.then((ee) => { if (!this.hls) return; - U.supportedResult = N; - const G = this.hls.levels, Y = G.indexOf(U); - N.error ? this.warn(`MediaCapabilities decodingInfo error: "${N.error}" for level ${Y} ${Oe(N)}`) : N.supported ? N.decodingInfoResults.some((ee) => ee.smooth === !1 || ee.powerEfficient === !1) && this.log(`MediaCapabilities decodingInfo for level ${Y} not smooth or powerEfficient: ${Oe(N)}`) : (this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Y} ${Oe(N)}`), Y > -1 && G.length > 1 && (this.log(`Removing unsupported level ${Y}`), this.hls.removeLevel(Y), this.hls.loadLevel === -1 && (this.hls.nextLoadLevel = 0))); - })) : U.supportedResult = gy; + B.supportedResult = ee; + const G = this.hls.levels, Z = G.indexOf(B); + ee.error ? this.warn(`MediaCapabilities decodingInfo error: "${ee.error}" for level ${Z} ${$e(ee)}`) : ee.supported ? ee.decodingInfoResults.some((U) => U.smooth === !1 || U.powerEfficient === !1) && this.log(`MediaCapabilities decodingInfo for level ${Z} not smooth or powerEfficient: ${$e(ee)}`) : (this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Z} ${$e(ee)}`), Z > -1 && G.length > 1 && (this.log(`Removing unsupported level ${Z}`), this.hls.removeLevel(Z), this.hls.loadLevel === -1 && (this.hls.nextLoadLevel = 0))); + })) : B.supportedResult = Ry; } - if ((T && U.codecSet !== T || A && U.videoRange !== A || j && S > U.frameRate || !j && S > 0 && S < U.frameRate || (K = U.supportedResult) != null && (q = K.decodingInfoResults) != null && q.some((B) => B.smooth === !1)) && (!E || W !== I)) { - P.push(W); + if ((T && B.codecSet !== T || x && B.videoRange !== x || z && S > B.frameRate || !z && S > 0 && S < B.frameRate || (K = B.supportedResult) != null && (H = K.decodingInfoResults) != null && H.some((N) => N.smooth === !1)) && (!E || Y !== I)) { + q.push(Y); continue; } - const $ = U.details, L = (f ? $ == null ? void 0 : $.partTarget : $ == null ? void 0 : $.averagetargetduration) || R; - let H; - j ? H = o * e : H = a * e; - const Q = R && s >= R * 2 && r === 0 ? U.averageBitrate : U.maxBitrate, X = this.getTimeToLoadFrag(M, H, Q * L, $ === void 0); + const W = B.details, L = (f ? W == null ? void 0 : W.partTarget : W == null ? void 0 : W.averagetargetduration) || M; + let $; + z ? $ = o * e : $ = a * e; + const Q = M && s >= M * 2 && r === 0 ? B.averageBitrate : B.maxBitrate, C = this.getTimeToLoadFrag(k, $, Q * L, W === void 0); if ( // if adjusted bw is greater than level bitrate AND - H >= Q && // no level change, or new level has no error history - (W === c || U.loadError === 0 && U.fragmentError === 0) && // fragment fetchDuration unknown OR live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches + $ >= Q && // no level change, or new level has no error history + (Y === c || B.loadError === 0 && B.fragmentError === 0) && // fragment fetchDuration unknown OR live stream OR fragment fetchDuration less than max allowed fetch duration, then this level matches // we don't account for max Fetch Duration for live streams, this is to avoid switching down when near the edge of live sliding window ... // special case to support startLevel = -1 (bitrateTest) on live streams : in that case we should not exit loop so that findBestLevel will return -1 - (X <= M || !Z(X) || _ && !this.bitrateTestDelay || X < l) + (C <= k || !J(C) || _ && !this.bitrateTestDelay || C < l) ) { - const B = this.forcedAutoLevel; - return W !== p && (B === -1 || B !== p) && (P.length && this.trace(`Skipped level(s) ${P.join(",")} of ${i} max with CODECS and VIDEO-RANGE:"${m[P[0]].codecs}" ${m[P[0]].videoRange}; not compatible with "${T}" ${A}`), this.info(`switch candidate:${h}->${W} adjustedbw(${Math.round(H)})-bitrate=${Math.round(H - Q)} ttfb:${M.toFixed(1)} avgDuration:${L.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${X.toFixed(1)} firstSelection:${E} codecSet:${U.codecSet} videoRange:${U.videoRange} hls.loadLevel:${p}`)), E && (this.firstSelection = W), W; + const N = this.forcedAutoLevel; + return Y !== p && (N === -1 || N !== p) && (q.length && this.trace(`Skipped level(s) ${q.join(",")} of ${i} max with CODECS and VIDEO-RANGE:"${m[q[0]].codecs}" ${m[q[0]].videoRange}; not compatible with "${T}" ${x}`), this.info(`switch candidate:${h}->${Y} adjustedbw(${Math.round($)})-bitrate=${Math.round($ - Q)} ttfb:${k.toFixed(1)} avgDuration:${L.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${C.toFixed(1)} firstSelection:${E} codecSet:${B.codecSet} videoRange:${B.videoRange} hls.loadLevel:${p}`)), E && (this.firstSelection = Y), Y; } } return -1; @@ -14129,7 +14197,7 @@ class vk extends Fi { return Math.min(Math.max(e, i), t); } } -const Ey = { +const My = { /** * Searches for an item in an array which matches a certain condition. * This requires the condition to only match one item in the array, @@ -14160,8 +14228,8 @@ const Ey = { return null; } }; -function yk(n, e, t) { - if (e === null || !Array.isArray(n) || !n.length || !Z(e)) +function Hk(n, e, t) { + if (e === null || !Array.isArray(n) || !n.length || !J(e)) return null; const i = n[0].programDateTime; if (e < (i || 0)) @@ -14171,41 +14239,41 @@ function yk(n, e, t) { return null; for (let r = 0; r < n.length; ++r) { const a = n[r]; - if (bk(e, t, a)) + if (qk(e, t, a)) return a; } return null; } -function ws(n, e, t = 0, i = 0, s = 5e-3) { +function Bs(n, e, t = 0, i = 0, s = 5e-3) { let r = null; if (n) { r = e[1 + n.sn - e[0].sn] || null; const o = n.endDTS - t; o > 0 && o < 15e-7 && (t += 15e-7), r && n.level !== r.level && r.end <= n.end && (r = e[2 + n.sn - e[0].sn] || null); } else t === 0 && e[0].start === 0 && (r = e[0]); - if (r && ((!n || n.level === r.level) && Dp(t, i, r) === 0 || Ek(r, n, Math.min(s, i)))) + if (r && ((!n || n.level === r.level) && Vp(t, i, r) === 0 || Vk(r, n, Math.min(s, i)))) return r; - const a = Ey.search(e, Dp.bind(null, t, i)); + const a = My.search(e, Vp.bind(null, t, i)); return a && (a !== n || !r) ? a : r; } -function Ek(n, e, t) { +function Vk(n, e, t) { if (e && e.start === 0 && e.level < n.level && (e.endPTS || 0) > 0) { const i = e.tagList.reduce((s, r) => (r[0] === "INF" && (s += parseFloat(r[1])), s), t); return n.start <= i; } return !1; } -function Dp(n = 0, e = 0, t) { +function Vp(n = 0, e = 0, t) { if (t.start <= n && t.start + t.duration > n) return 0; const i = Math.min(e, t.duration + (t.deltaPTS ? t.deltaPTS : 0)); return t.start + t.duration - i <= n ? 1 : t.start - i > n && t.start ? -1 : 0; } -function bk(n, e, t) { +function qk(n, e, t) { const i = Math.min(e, t.duration + (t.deltaPTS ? t.deltaPTS : 0)) * 1e3; return (t.endProgramDateTime || 0) - i > n; } -function by(n, e, t) { +function $y(n, e, t) { if (n && n.startCC <= e && n.endCC >= e) { let i = n.fragments; const { @@ -14213,54 +14281,54 @@ function by(n, e, t) { } = n; s && (i = i.concat(s)); let r; - return Ey.search(i, (a) => a.cc < e ? 1 : a.cc > e ? -1 : (r = a, a.end <= t ? 1 : a.start > t ? -1 : 0)), r || null; + return My.search(i, (a) => a.cc < e ? 1 : a.cc > e ? -1 : (r = a, a.end <= t ? 1 : a.start > t ? -1 : 0)), r || null; } return null; } -function Gl(n) { +function ru(n) { switch (n.details) { - case O.FRAG_LOAD_TIMEOUT: - case O.KEY_LOAD_TIMEOUT: - case O.LEVEL_LOAD_TIMEOUT: - case O.MANIFEST_LOAD_TIMEOUT: + case P.FRAG_LOAD_TIMEOUT: + case P.KEY_LOAD_TIMEOUT: + case P.LEVEL_LOAD_TIMEOUT: + case P.MANIFEST_LOAD_TIMEOUT: return !0; } return !1; } -function wp(n, e) { - const t = Gl(e); +function qp(n, e) { + const t = ru(e); return n.default[`${t ? "timeout" : "error"}Retry`]; } -function df(n, e) { +function Ff(n, e) { const t = n.backoff === "linear" ? 1 : Math.pow(2, e); return Math.min(t * n.retryDelayMs, n.maxRetryDelayMs); } -function Lp(n) { - return Le(Le({}, n), { +function Kp(n) { + return Ie(Ie({}, n), { errorRetry: null, timeoutRetry: null }); } -function Hl(n, e, t, i) { +function au(n, e, t, i) { if (!n) return !1; - const s = i == null ? void 0 : i.code, r = e < n.maxNumRetry && (Tk(s) || !!t); + const s = i == null ? void 0 : i.code, r = e < n.maxNumRetry && (Kk(s) || !!t); return n.shouldRetry ? n.shouldRetry(n, e, t, i, r) : r; } -function Tk(n) { +function Kk(n) { return n === 0 && navigator.onLine === !1 || !!n && (n < 400 || n > 499); } -var yt = { +var At = { DoNothing: 0, SendAlternateToPenaltyBox: 2, RemoveAlternatePermanently: 3, RetryRequest: 5 -}, Ei = { +}, Ri = { None: 0, MoveAllAlternatesMatchingHost: 1, MoveAllAlternatesMatchingHDCP: 2 }; -class Sk extends Fi { +class jk extends Bi { constructor(e) { super("error-controller", e.logger), this.hls = void 0, this.playlistError = 0, this.penalizedRenditions = {}, this.hls = e, this.registerListeners(); } @@ -14281,7 +14349,7 @@ class Sk extends Fi { this.playlistError = 0; } getVariantLevelIndex(e) { - return (e == null ? void 0 : e.type) === J.MAIN ? e.level : this.hls.loadLevel; + return (e == null ? void 0 : e.type) === te.MAIN ? e.level : this.hls.loadLevel; } onManifestLoading() { this.playlistError = 0, this.penalizedRenditions = {}; @@ -14295,86 +14363,86 @@ class Sk extends Fi { return; const s = this.hls, r = t.context; switch (t.details) { - case O.FRAG_LOAD_ERROR: - case O.FRAG_LOAD_TIMEOUT: - case O.KEY_LOAD_ERROR: - case O.KEY_LOAD_TIMEOUT: + case P.FRAG_LOAD_ERROR: + case P.FRAG_LOAD_TIMEOUT: + case P.KEY_LOAD_ERROR: + case P.KEY_LOAD_TIMEOUT: t.errorAction = this.getFragRetryOrSwitchAction(t); return; - case O.FRAG_PARSING_ERROR: + case P.FRAG_PARSING_ERROR: if ((i = t.frag) != null && i.gap) { - t.errorAction = $a(); + t.errorAction = Ya(); return; } - case O.FRAG_GAP: - case O.FRAG_DECRYPT_ERROR: { - t.errorAction = this.getFragRetryOrSwitchAction(t), t.errorAction.action = yt.SendAlternateToPenaltyBox; + case P.FRAG_GAP: + case P.FRAG_DECRYPT_ERROR: { + t.errorAction = this.getFragRetryOrSwitchAction(t), t.errorAction.action = At.SendAlternateToPenaltyBox; return; } - case O.LEVEL_EMPTY_ERROR: - case O.LEVEL_PARSING_ERROR: + case P.LEVEL_EMPTY_ERROR: + case P.LEVEL_PARSING_ERROR: { var a, o; - const l = t.parent === J.MAIN ? t.level : s.loadLevel; - t.details === O.LEVEL_EMPTY_ERROR && ((a = t.context) != null && (o = a.levelDetails) != null && o.live) ? t.errorAction = this.getPlaylistRetryOrSwitchAction(t, l) : (t.levelRetry = !1, t.errorAction = this.getLevelSwitchAction(t, l)); + const l = t.parent === te.MAIN ? t.level : s.loadLevel; + t.details === P.LEVEL_EMPTY_ERROR && ((a = t.context) != null && (o = a.levelDetails) != null && o.live) ? t.errorAction = this.getPlaylistRetryOrSwitchAction(t, l) : (t.levelRetry = !1, t.errorAction = this.getLevelSwitchAction(t, l)); } return; - case O.LEVEL_LOAD_ERROR: - case O.LEVEL_LOAD_TIMEOUT: + case P.LEVEL_LOAD_ERROR: + case P.LEVEL_LOAD_TIMEOUT: typeof (r == null ? void 0 : r.level) == "number" && (t.errorAction = this.getPlaylistRetryOrSwitchAction(t, r.level)); return; - case O.AUDIO_TRACK_LOAD_ERROR: - case O.AUDIO_TRACK_LOAD_TIMEOUT: - case O.SUBTITLE_LOAD_ERROR: - case O.SUBTITLE_TRACK_LOAD_TIMEOUT: + case P.AUDIO_TRACK_LOAD_ERROR: + case P.AUDIO_TRACK_LOAD_TIMEOUT: + case P.SUBTITLE_LOAD_ERROR: + case P.SUBTITLE_TRACK_LOAD_TIMEOUT: if (r) { const l = s.loadLevelObj; if (l && (r.type === me.AUDIO_TRACK && l.hasAudioGroup(r.groupId) || r.type === me.SUBTITLE_TRACK && l.hasSubtitleGroup(r.groupId))) { - t.errorAction = this.getPlaylistRetryOrSwitchAction(t, s.loadLevel), t.errorAction.action = yt.SendAlternateToPenaltyBox, t.errorAction.flags = Ei.MoveAllAlternatesMatchingHost; + t.errorAction = this.getPlaylistRetryOrSwitchAction(t, s.loadLevel), t.errorAction.action = At.SendAlternateToPenaltyBox, t.errorAction.flags = Ri.MoveAllAlternatesMatchingHost; return; } } return; - case O.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED: + case P.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED: { const l = s.loadLevelObj, c = l == null ? void 0 : l.attrs["HDCP-LEVEL"]; c ? t.errorAction = { - action: yt.SendAlternateToPenaltyBox, - flags: Ei.MoveAllAlternatesMatchingHDCP, + action: At.SendAlternateToPenaltyBox, + flags: Ri.MoveAllAlternatesMatchingHDCP, hdcpLevel: c } : this.keySystemError(t); } return; - case O.BUFFER_ADD_CODEC_ERROR: - case O.REMUX_ALLOC_ERROR: - case O.BUFFER_APPEND_ERROR: + case P.BUFFER_ADD_CODEC_ERROR: + case P.REMUX_ALLOC_ERROR: + case P.BUFFER_APPEND_ERROR: if (!t.errorAction) { var u; t.errorAction = this.getLevelSwitchAction(t, (u = t.level) != null ? u : s.loadLevel); } return; - case O.INTERNAL_EXCEPTION: - case O.BUFFER_APPENDING_ERROR: - case O.BUFFER_FULL_ERROR: - case O.LEVEL_SWITCH_ERROR: - case O.BUFFER_STALLED_ERROR: - case O.BUFFER_SEEK_OVER_HOLE: - case O.BUFFER_NUDGE_ON_STALL: - t.errorAction = $a(); + case P.INTERNAL_EXCEPTION: + case P.BUFFER_APPENDING_ERROR: + case P.BUFFER_FULL_ERROR: + case P.LEVEL_SWITCH_ERROR: + case P.BUFFER_STALLED_ERROR: + case P.BUFFER_SEEK_OVER_HOLE: + case P.BUFFER_NUDGE_ON_STALL: + t.errorAction = Ya(); return; } - t.type === ie.KEY_SYSTEM_ERROR && this.keySystemError(t); + t.type === ne.KEY_SYSTEM_ERROR && this.keySystemError(t); } keySystemError(e) { const t = this.getVariantLevelIndex(e.frag); e.levelRetry = !1, e.errorAction = this.getLevelSwitchAction(e, t); } getPlaylistRetryOrSwitchAction(e, t) { - const i = this.hls, s = wp(i.config.playlistLoadPolicy, e), r = this.playlistError++; - if (Hl(s, r, Gl(e), e.response)) + const i = this.hls, s = qp(i.config.playlistLoadPolicy, e), r = this.playlistError++; + if (au(s, r, ru(e), e.response)) return { - action: yt.RetryRequest, - flags: Ei.None, + action: At.RetryRequest, + flags: Ri.None, retryConfig: s, retryCount: r }; @@ -14385,11 +14453,11 @@ class Sk extends Fi { const t = this.hls, i = this.getVariantLevelIndex(e.frag), s = t.levels[i], { fragLoadPolicy: r, keyLoadPolicy: a - } = t.config, o = wp(e.details.startsWith("key") ? a : r, e), u = t.levels.reduce((c, h) => c + h.fragmentError, 0); - if (s && (e.details !== O.FRAG_GAP && s.fragmentError++, Hl(o, u, Gl(e), e.response))) + } = t.config, o = qp(e.details.startsWith("key") ? a : r, e), u = t.levels.reduce((c, h) => c + h.fragmentError, 0); + if (s && (e.details !== P.FRAG_GAP && s.fragmentError++, au(o, u, ru(e), e.response))) return { - action: yt.RetryRequest, - flags: Ei.None, + action: At.RetryRequest, + flags: Ri.None, retryConfig: o, retryCount: u }; @@ -14403,7 +14471,7 @@ class Sk extends Fi { if (s) { var r, a; const l = e.details; - s.loadError++, l === O.BUFFER_APPEND_ERROR && s.fragmentError++; + s.loadError++, l === P.BUFFER_APPEND_ERROR && s.fragmentError++; let c = -1; const { levels: h, @@ -14412,31 +14480,31 @@ class Sk extends Fi { maxAutoLevel: m } = i; !i.autoLevelEnabled && !i.config.preserveManualLevelOnError && (i.loadLevel = -1); - const g = (r = e.frag) == null ? void 0 : r.type, y = (g === J.AUDIO && l === O.FRAG_PARSING_ERROR || e.sourceBufferName === "audio" && (l === O.BUFFER_ADD_CODEC_ERROR || l === O.BUFFER_APPEND_ERROR)) && h.some(({ - audioCodec: A - }) => s.audioCodec !== A), _ = e.sourceBufferName === "video" && (l === O.BUFFER_ADD_CODEC_ERROR || l === O.BUFFER_APPEND_ERROR) && h.some(({ - codecSet: A, + const g = (r = e.frag) == null ? void 0 : r.type, y = (g === te.AUDIO && l === P.FRAG_PARSING_ERROR || e.sourceBufferName === "audio" && (l === P.BUFFER_ADD_CODEC_ERROR || l === P.BUFFER_APPEND_ERROR)) && h.some(({ + audioCodec: x + }) => s.audioCodec !== x), _ = e.sourceBufferName === "video" && (l === P.BUFFER_ADD_CODEC_ERROR || l === P.BUFFER_APPEND_ERROR) && h.some(({ + codecSet: x, audioCodec: S - }) => s.codecSet !== A && s.audioCodec === S), { + }) => s.codecSet !== x && s.audioCodec === S), { type: E, groupId: T } = (a = e.context) != null ? a : {}; - for (let A = h.length; A--; ) { - const S = (A + d) % h.length; + for (let x = h.length; x--; ) { + const S = (x + d) % h.length; if (S !== d && S >= f && S <= m && h[S].loadError === 0) { var o, u; const D = h[S]; - if (l === O.FRAG_GAP && g === J.MAIN && e.frag) { - const x = h[S].details; - if (x) { - const w = ws(e.frag, x.fragments, e.frag.start); + if (l === P.FRAG_GAP && g === te.MAIN && e.frag) { + const A = h[S].details; + if (A) { + const w = Bs(e.frag, A.fragments, e.frag.start); if (w != null && w.gap) continue; } } else { if (E === me.AUDIO_TRACK && D.hasAudioGroup(T) || E === me.SUBTITLE_TRACK && D.hasSubtitleGroup(T)) continue; - if (g === J.AUDIO && (o = s.audioGroups) != null && o.some((x) => D.hasAudioGroup(x)) || g === J.SUBTITLE && (u = s.subtitleGroups) != null && u.some((x) => D.hasSubtitleGroup(x)) || y && s.audioCodec === D.audioCodec || !y && s.audioCodec !== D.audioCodec || _ && s.codecSet === D.codecSet) + if (g === te.AUDIO && (o = s.audioGroups) != null && o.some((A) => D.hasAudioGroup(A)) || g === te.SUBTITLE && (u = s.subtitleGroups) != null && u.some((A) => D.hasSubtitleGroup(A)) || y && s.audioCodec === D.audioCodec || !y && s.audioCodec !== D.audioCodec || _ && s.codecSet === D.codecSet) continue; } c = S; @@ -14445,23 +14513,23 @@ class Sk extends Fi { } if (c > -1 && i.loadLevel !== c) return e.levelRetry = !0, this.playlistError = 0, { - action: yt.SendAlternateToPenaltyBox, - flags: Ei.None, + action: At.SendAlternateToPenaltyBox, + flags: Ri.None, nextAutoLevel: c }; } return { - action: yt.SendAlternateToPenaltyBox, - flags: Ei.MoveAllAlternatesMatchingHost + action: At.SendAlternateToPenaltyBox, + flags: Ri.MoveAllAlternatesMatchingHost }; } onErrorOut(e, t) { var i; switch ((i = t.errorAction) == null ? void 0 : i.action) { - case yt.DoNothing: + case At.DoNothing: break; - case yt.SendAlternateToPenaltyBox: - this.sendAlternateToPenaltyBox(t), !t.errorAction.resolved && t.details !== O.FRAG_GAP ? t.fatal = !0 : /MediaSource readyState: ended/.test(t.error.message) && (this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`), this.hls.recoverMediaError()); + case At.SendAlternateToPenaltyBox: + this.sendAlternateToPenaltyBox(t), !t.errorAction.resolved && t.details !== P.FRAG_GAP ? t.fatal = !0 : /MediaSource readyState: ended/.test(t.error.message) && (this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`), this.hls.recoverMediaError()); break; } if (t.fatal) { @@ -14479,37 +14547,37 @@ class Sk extends Fi { nextAutoLevel: a } = i; switch (s) { - case Ei.None: + case Ri.None: this.switchLevel(e, a); break; - case Ei.MoveAllAlternatesMatchingHDCP: - r && (t.maxHdcpLevel = ld[ld.indexOf(r) - 1], i.resolved = !0), this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`); + case Ri.MoveAllAlternatesMatchingHDCP: + r && (t.maxHdcpLevel = Id[Id.indexOf(r) - 1], i.resolved = !0), this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`); break; } i.resolved || this.switchLevel(e, a); } switchLevel(e, t) { - if (t !== void 0 && e.errorAction && (this.warn(`switching to level ${t} after ${e.details}`), this.hls.nextAutoLevel = t, e.errorAction.resolved = !0, this.hls.nextLoadLevel = this.hls.nextAutoLevel, e.details === O.BUFFER_ADD_CODEC_ERROR && e.mimeType && e.sourceBufferName !== "audiovideo")) { - const i = od(e.mimeType), s = this.hls.levels; + if (t !== void 0 && e.errorAction && (this.warn(`switching to level ${t} after ${e.details}`), this.hls.nextAutoLevel = t, e.errorAction.resolved = !0, this.hls.nextLoadLevel = this.hls.nextAutoLevel, e.details === P.BUFFER_ADD_CODEC_ERROR && e.mimeType && e.sourceBufferName !== "audiovideo")) { + const i = Ld(e.mimeType), s = this.hls.levels; for (let r = s.length; r--; ) s[r][`${e.sourceBufferName}Codec`] === i && this.hls.removeLevel(r); } } } -function $a(n) { +function Ya(n) { const e = { - action: yt.DoNothing, - flags: Ei.None + action: At.DoNothing, + flags: Ri.None }; return n && (e.resolved = !0), e; } -var Ze = { +var nt = { NOT_LOADED: "NOT_LOADED", APPENDING: "APPENDING", PARTIAL: "PARTIAL", OK: "OK" }; -class Ak { +class zk { constructor(e) { this.activePartLists = /* @__PURE__ */ Object.create(null), this.endListFragments = /* @__PURE__ */ Object.create(null), this.fragments = /* @__PURE__ */ Object.create(null), this.timeRanges = /* @__PURE__ */ Object.create(null), this.bufferPadding = 0.2, this.hls = void 0, this.hasGaps = !1, this.hls = e, this._registerListeners(); } @@ -14606,7 +14674,7 @@ class Ak { const t = this.timeRanges; if (!t || e.frag.sn === "initSegment") return; - const i = e.frag, s = Xs(i), r = this.fragments[s]; + const i = e.frag, s = or(i), r = this.fragments[s]; if (!r || r.buffered && i.gap) return; const a = !i.relurl; @@ -14616,14 +14684,14 @@ class Ak { return; const l = t[o], c = a || u.partial === !0; r.range[o] = this.getBufferedTimes(i, e.part, c, l); - }), r.loaded = null, Object.keys(r.range).length ? (r.buffered = !0, (r.body.endList = i.endList || r.body.endList) && (this.endListFragments[r.body.type] = r), Go(r) || this.removeParts(i.sn - 1, i.type)) : this.removeFragment(r.body); + }), r.loaded = null, Object.keys(r.range).length ? (r.buffered = !0, (r.body.endList = i.endList || r.body.endList) && (this.endListFragments[r.body.type] = r), al(r) || this.removeParts(i.sn - 1, i.type)) : this.removeFragment(r.body); } removeParts(e, t) { const i = this.activePartLists[t]; - i && (this.activePartLists[t] = Ip(i, (s) => s.fragment.sn >= e)); + i && (this.activePartLists[t] = jp(i, (s) => s.fragment.sn >= e)); } fragBuffered(e, t) { - const i = Xs(e); + const i = or(e); let s = this.fragments[i]; !s && t && (s = this.fragments[i] = { body: e, @@ -14668,16 +14736,16 @@ class Ak { } = this; return Object.keys(u).forEach((l) => { const c = u[l]; - c && Go(c) && (s = c.body.start - o, r = c.body.end + o, e >= s && e <= r && (i = Math.min(e - s, r - e), a <= i && (t = c.body, a = i))); + c && al(c) && (s = c.body.start - o, r = c.body.end + o, e >= s && e <= r && (i = Math.min(e - s, r - e), a <= i && (t = c.body, a = i))); }), t; } isEndListAppended(e) { const t = this.endListFragments[e]; - return t !== void 0 && (t.buffered || Go(t)); + return t !== void 0 && (t.buffered || al(t)); } getState(e) { - const t = Xs(e), i = this.fragments[t]; - return i ? i.buffered ? Go(i) ? Ze.PARTIAL : Ze.OK : Ze.APPENDING : Ze.NOT_LOADED; + const t = or(e), i = this.fragments[t]; + return i ? i.buffered ? al(i) ? nt.PARTIAL : nt.OK : nt.APPENDING : nt.NOT_LOADED; } isTimeBuffered(e, t, i) { let s, r; @@ -14695,7 +14763,7 @@ class Ak { onFragLoaded(e, t) { if (t.frag.sn === "initSegment" || t.frag.bitrateTest) return; - const i = t.frag, s = t.part ? null : t, r = Xs(i); + const i = t.frag, s = t.part ? null : t, r = or(i); this.fragments[r] = { body: i, appendedPTS: null, @@ -14726,7 +14794,7 @@ class Ak { this.detectPartialFragments(t); } hasFragment(e) { - const t = Xs(e); + const t = or(e); return !!this.fragments[t]; } hasFragments(e) { @@ -14756,12 +14824,12 @@ class Ak { }); } removeFragment(e) { - const t = Xs(e); + const t = or(e); e.clearElementaryStreamInfo(); const i = this.activePartLists[e.type]; if (i) { const s = e.sn; - this.activePartLists[e.type] = Ip(i, (r) => r.fragment.sn !== s); + this.activePartLists[e.type] = jp(i, (r) => r.fragment.sn !== s); } delete this.fragments[t], e.endList && delete this.endListFragments[e.type]; } @@ -14772,35 +14840,35 @@ class Ak { i && i.forEach((s) => s.clearElementaryStreamInfo()); } } -function Go(n) { +function al(n) { var e, t, i; return n.buffered && (n.body.gap || ((e = n.range.video) == null ? void 0 : e.partial) || ((t = n.range.audio) == null ? void 0 : t.partial) || ((i = n.range.audiovideo) == null ? void 0 : i.partial)); } -function Xs(n) { +function or(n) { return `${n.type}_${n.level}_${n.sn}`; } -function Ip(n, e) { +function jp(n, e) { return n.filter((t) => { const i = e(t); return i || t.clearElementaryStreamInfo(), i; }); } -var Zn = { +var ss = { cbc: 0, ctr: 1 }; -class xk { +class Wk { constructor(e, t, i) { this.subtle = void 0, this.aesIV = void 0, this.aesMode = void 0, this.subtle = e, this.aesIV = t, this.aesMode = i; } decrypt(e, t) { switch (this.aesMode) { - case Zn.cbc: + case ss.cbc: return this.subtle.decrypt({ name: "AES-CBC", iv: this.aesIV }, t, e); - case Zn.ctr: + case ss.ctr: return this.subtle.decrypt( { name: "AES-CTR", @@ -14816,11 +14884,11 @@ class xk { } } } -function Dk(n) { +function Yk(n) { const e = n.byteLength, t = e && new DataView(n.buffer).getUint8(e - 1); return t ? n.slice(0, e - t) : n; } -class wk { +class Xk { constructor() { this.rcon = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], this.subMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)], this.invSubMix = [new Uint32Array(256), new Uint32Array(256), new Uint32Array(256), new Uint32Array(256)], this.sBox = new Uint32Array(256), this.invSBox = new Uint32Array(256), this.key = new Uint32Array(0), this.ksRows = 0, this.keySize = 0, this.keySchedule = void 0, this.invKeySchedule = void 0, this.initTable(); } @@ -14877,39 +14945,39 @@ class wk { const s = this.keySize + 6, r = this.invKeySchedule, a = this.invSBox, o = this.invSubMix, u = o[0], l = o[1], c = o[2], h = o[3], d = this.uint8ArrayToUint32Array_(i); let f = d[0], m = d[1], g = d[2], p = d[3]; const y = new Int32Array(e), v = new Int32Array(y.length); - let _, E, T, A, S, D, x, w, I, R, M, P, K, q; - const W = this.networkToHostOrderSwap; + let _, E, T, x, S, D, A, w, I, M, k, q, K, H; + const Y = this.networkToHostOrderSwap; for (; t < y.length; ) { - for (I = W(y[t]), R = W(y[t + 1]), M = W(y[t + 2]), P = W(y[t + 3]), S = I ^ r[0], D = P ^ r[1], x = M ^ r[2], w = R ^ r[3], K = 4, q = 1; q < s; q++) - _ = u[S >>> 24] ^ l[D >> 16 & 255] ^ c[x >> 8 & 255] ^ h[w & 255] ^ r[K], E = u[D >>> 24] ^ l[x >> 16 & 255] ^ c[w >> 8 & 255] ^ h[S & 255] ^ r[K + 1], T = u[x >>> 24] ^ l[w >> 16 & 255] ^ c[S >> 8 & 255] ^ h[D & 255] ^ r[K + 2], A = u[w >>> 24] ^ l[S >> 16 & 255] ^ c[D >> 8 & 255] ^ h[x & 255] ^ r[K + 3], S = _, D = E, x = T, w = A, K = K + 4; - _ = a[S >>> 24] << 24 ^ a[D >> 16 & 255] << 16 ^ a[x >> 8 & 255] << 8 ^ a[w & 255] ^ r[K], E = a[D >>> 24] << 24 ^ a[x >> 16 & 255] << 16 ^ a[w >> 8 & 255] << 8 ^ a[S & 255] ^ r[K + 1], T = a[x >>> 24] << 24 ^ a[w >> 16 & 255] << 16 ^ a[S >> 8 & 255] << 8 ^ a[D & 255] ^ r[K + 2], A = a[w >>> 24] << 24 ^ a[S >> 16 & 255] << 16 ^ a[D >> 8 & 255] << 8 ^ a[x & 255] ^ r[K + 3], v[t] = W(_ ^ f), v[t + 1] = W(A ^ m), v[t + 2] = W(T ^ g), v[t + 3] = W(E ^ p), f = I, m = R, g = M, p = P, t = t + 4; + for (I = Y(y[t]), M = Y(y[t + 1]), k = Y(y[t + 2]), q = Y(y[t + 3]), S = I ^ r[0], D = q ^ r[1], A = k ^ r[2], w = M ^ r[3], K = 4, H = 1; H < s; H++) + _ = u[S >>> 24] ^ l[D >> 16 & 255] ^ c[A >> 8 & 255] ^ h[w & 255] ^ r[K], E = u[D >>> 24] ^ l[A >> 16 & 255] ^ c[w >> 8 & 255] ^ h[S & 255] ^ r[K + 1], T = u[A >>> 24] ^ l[w >> 16 & 255] ^ c[S >> 8 & 255] ^ h[D & 255] ^ r[K + 2], x = u[w >>> 24] ^ l[S >> 16 & 255] ^ c[D >> 8 & 255] ^ h[A & 255] ^ r[K + 3], S = _, D = E, A = T, w = x, K = K + 4; + _ = a[S >>> 24] << 24 ^ a[D >> 16 & 255] << 16 ^ a[A >> 8 & 255] << 8 ^ a[w & 255] ^ r[K], E = a[D >>> 24] << 24 ^ a[A >> 16 & 255] << 16 ^ a[w >> 8 & 255] << 8 ^ a[S & 255] ^ r[K + 1], T = a[A >>> 24] << 24 ^ a[w >> 16 & 255] << 16 ^ a[S >> 8 & 255] << 8 ^ a[D & 255] ^ r[K + 2], x = a[w >>> 24] << 24 ^ a[S >> 16 & 255] << 16 ^ a[D >> 8 & 255] << 8 ^ a[A & 255] ^ r[K + 3], v[t] = Y(_ ^ f), v[t + 1] = Y(x ^ m), v[t + 2] = Y(T ^ g), v[t + 3] = Y(E ^ p), f = I, m = M, g = k, p = q, t = t + 4; } return v.buffer; } } -class Lk { +class Qk { constructor(e, t, i) { this.subtle = void 0, this.key = void 0, this.aesMode = void 0, this.subtle = e, this.key = t, this.aesMode = i; } expandKey() { - const e = Ik(this.aesMode); + const e = Zk(this.aesMode); return this.subtle.importKey("raw", this.key, { name: e }, !1, ["encrypt", "decrypt"]); } } -function Ik(n) { +function Zk(n) { switch (n) { - case Zn.cbc: + case ss.cbc: return "AES-CBC"; - case Zn.ctr: + case ss.ctr: return "AES-CTR"; default: throw new Error(`[FastAESKey] invalid aes mode ${n}`); } } -const kk = 16; -class ff { +const Jk = 16; +class Pf { constructor(e, { removePKCS7Padding: t = !0 } = {}) { @@ -14935,7 +15003,7 @@ class ff { if (!e || t) return this.reset(), null; const i = new Uint8Array(e); - return this.reset(), this.removePKCS7Padding ? Dk(i) : i; + return this.reset(), this.removePKCS7Padding ? Yk(i) : i; } reset() { this.currentResult = null, this.currentIV = null, this.remainderData = null, this.softwareDecrypter && (this.softwareDecrypter = null); @@ -14956,15 +15024,15 @@ class ff { currentResult: a, remainderData: o } = this; - if (s !== Zn.cbc || t.byteLength !== 16) - return Ee.warn("SoftwareDecrypt: can only handle AES-128-CBC"), null; - this.logOnce("JS AES decrypt"), o && (e = li(o, e), this.remainderData = null); + if (s !== ss.cbc || t.byteLength !== 16) + return Te.warn("SoftwareDecrypt: can only handle AES-128-CBC"), null; + this.logOnce("JS AES decrypt"), o && (e = fi(o, e), this.remainderData = null); const u = this.getValidChunk(e); if (!u.length) return null; r && (i = r); let l = this.softwareDecrypter; - l || (l = this.softwareDecrypter = new wk()), l.expandKey(t); + l || (l = this.softwareDecrypter = new Xk()), l.expandKey(t); const c = a; return this.currentResult = l.decrypt(u.buffer, 0, i), this.currentIV = u.slice(-16).buffer, c || null; } @@ -14972,9 +15040,9 @@ class ff { if (this.key !== t || !this.fastAesKey) { if (!this.subtle) return Promise.resolve(this.onWebCryptoError(e, t, i, s)); - this.key = t, this.fastAesKey = new Lk(this.subtle, t, s); + this.key = t, this.fastAesKey = new Qk(this.subtle, t, s); } - return this.fastAesKey.expandKey().then((r) => this.subtle ? (this.logOnce("WebCrypto AES decrypt"), new xk(this.subtle, new Uint8Array(i), s).decrypt(e.buffer, r)) : Promise.reject(new Error("web crypto not initialized"))).catch((r) => (Ee.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`), this.onWebCryptoError(e, t, i, s))); + return this.fastAesKey.expandKey().then((r) => this.subtle ? (this.logOnce("WebCrypto AES decrypt"), new Wk(this.subtle, new Uint8Array(i), s).decrypt(e.buffer, r)) : Promise.reject(new Error("web crypto not initialized"))).catch((r) => (Te.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`), this.onWebCryptoError(e, t, i, s))); } onWebCryptoError(e, t, i, s) { const r = this.enableSoftwareAES; @@ -14988,15 +15056,15 @@ class ff { } getValidChunk(e) { let t = e; - const i = e.length - e.length % kk; + const i = e.length - e.length % Jk; return i !== e.length && (t = e.slice(0, i), this.remainderData = e.slice(i)), t; } logOnce(e) { - this.logEnabled && (Ee.log(`[decrypter]: ${e}`), this.logEnabled = !1); + this.logEnabled && (Te.log(`[decrypter]: ${e}`), this.logEnabled = !1); } } -const kp = Math.pow(2, 17); -class Rk { +const zp = Math.pow(2, 17); +class eR { constructor(e) { this.config = void 0, this.loader = null, this.partLoadTimeout = -1, this.config = e; } @@ -15009,9 +15077,9 @@ class Rk { load(e, t) { const i = e.url; if (!i) - return Promise.reject(new bn({ - type: ie.NETWORK_ERROR, - details: O.FRAG_LOAD_ERROR, + return Promise.reject(new Tn({ + type: ne.NETWORK_ERROR, + details: P.FRAG_LOAD_ERROR, fatal: !1, frag: e, error: new Error(`Fragment does not have a ${i ? "part list" : "url"}`), @@ -15022,19 +15090,19 @@ class Rk { return new Promise((o, u) => { if (this.loader && this.loader.destroy(), e.gap) if (e.tagList.some((m) => m[0] === "GAP")) { - u(Cp(e)); + u(Yp(e)); return; } else e.gap = !1; - const l = this.loader = r ? new r(s) : new a(s), c = Rp(e); + const l = this.loader = r ? new r(s) : new a(s), c = Wp(e); e.loader = l; - const h = Lp(s.fragLoadPolicy.default), d = { + const h = Kp(s.fragLoadPolicy.default), d = { loadPolicy: h, timeout: h.maxLoadTimeMs, maxRetry: 0, retryDelay: 0, maxRetryDelay: 0, - highWaterMark: e.sn === "initSegment" ? 1 / 0 : kp + highWaterMark: e.sn === "initSegment" ? 1 / 0 : zp }; e.stats = l.stats; const f = { @@ -15049,12 +15117,12 @@ class Rk { }); }, onError: (m, g, p, y) => { - this.resetLoader(e, l), u(new bn({ - type: ie.NETWORK_ERROR, - details: O.FRAG_LOAD_ERROR, + this.resetLoader(e, l), u(new Tn({ + type: ne.NETWORK_ERROR, + details: P.FRAG_LOAD_ERROR, fatal: !1, frag: e, - response: Le({ + response: Ie({ url: i, data: void 0 }, m), @@ -15064,9 +15132,9 @@ class Rk { })); }, onAbort: (m, g, p) => { - this.resetLoader(e, l), u(new bn({ - type: ie.NETWORK_ERROR, - details: O.INTERNAL_ABORTED, + this.resetLoader(e, l), u(new Tn({ + type: ne.NETWORK_ERROR, + details: P.INTERNAL_ABORTED, fatal: !1, frag: e, error: new Error("Aborted"), @@ -15075,9 +15143,9 @@ class Rk { })); }, onTimeout: (m, g, p) => { - this.resetLoader(e, l), u(new bn({ - type: ie.NETWORK_ERROR, - details: O.FRAG_LOAD_TIMEOUT, + this.resetLoader(e, l), u(new Tn({ + type: ne.NETWORK_ERROR, + details: P.FRAG_LOAD_TIMEOUT, fatal: !1, frag: e, error: new Error(`Timeout after ${d.timeout}ms`), @@ -15099,18 +15167,18 @@ class Rk { const s = this.config, r = s.fLoader, a = s.loader; return new Promise((o, u) => { if (this.loader && this.loader.destroy(), e.gap || t.gap) { - u(Cp(e, t)); + u(Yp(e, t)); return; } - const l = this.loader = r ? new r(s) : new a(s), c = Rp(e, t); + const l = this.loader = r ? new r(s) : new a(s), c = Wp(e, t); e.loader = l; - const h = Lp(s.fragLoadPolicy.default), d = { + const h = Kp(s.fragLoadPolicy.default), d = { loadPolicy: h, timeout: h.maxLoadTimeMs, maxRetry: 0, retryDelay: 0, maxRetryDelay: 0, - highWaterMark: kp + highWaterMark: zp }; t.stats = l.stats, l.load(c, d, { onSuccess: (f, m, g, p) => { @@ -15124,13 +15192,13 @@ class Rk { i(y), o(y); }, onError: (f, m, g, p) => { - this.resetLoader(e, l), u(new bn({ - type: ie.NETWORK_ERROR, - details: O.FRAG_LOAD_ERROR, + this.resetLoader(e, l), u(new Tn({ + type: ne.NETWORK_ERROR, + details: P.FRAG_LOAD_ERROR, fatal: !1, frag: e, part: t, - response: Le({ + response: Ie({ url: c.url, data: void 0 }, f), @@ -15140,9 +15208,9 @@ class Rk { })); }, onAbort: (f, m, g) => { - e.stats.aborted = t.stats.aborted, this.resetLoader(e, l), u(new bn({ - type: ie.NETWORK_ERROR, - details: O.INTERNAL_ABORTED, + e.stats.aborted = t.stats.aborted, this.resetLoader(e, l), u(new Tn({ + type: ne.NETWORK_ERROR, + details: P.INTERNAL_ABORTED, fatal: !1, frag: e, part: t, @@ -15152,9 +15220,9 @@ class Rk { })); }, onTimeout: (f, m, g) => { - this.resetLoader(e, l), u(new bn({ - type: ie.NETWORK_ERROR, - details: O.FRAG_LOAD_TIMEOUT, + this.resetLoader(e, l), u(new Tn({ + type: ne.NETWORK_ERROR, + details: P.FRAG_LOAD_TIMEOUT, fatal: !1, frag: e, part: t, @@ -15180,7 +15248,7 @@ class Rk { e.loader = null, this.loader === t && (self.clearTimeout(this.partLoadTimeout), this.loader = null), t.destroy(); } } -function Rp(n, e = null) { +function Wp(n, e = null) { const t = e || n, i = { frag: n, part: e, @@ -15190,10 +15258,10 @@ function Rp(n, e = null) { rangeStart: 0, rangeEnd: 0 }, s = t.byteRangeStartOffset, r = t.byteRangeEndOffset; - if (Z(s) && Z(r)) { + if (J(s) && J(r)) { var a; let o = s, u = r; - if (n.sn === "initSegment" && Ck((a = n.decryptdata) == null ? void 0 : a.method)) { + if (n.sn === "initSegment" && tR((a = n.decryptdata) == null ? void 0 : a.method)) { const l = r - s; l % 16 && (u = r + (16 - l % 16)), s !== 0 && (i.resetIV = !0, o = s - 16); } @@ -15201,26 +15269,26 @@ function Rp(n, e = null) { } return i; } -function Cp(n, e) { +function Yp(n, e) { const t = new Error(`GAP ${n.gap ? "tag" : "attribute"} found`), i = { - type: ie.MEDIA_ERROR, - details: O.FRAG_GAP, + type: ne.MEDIA_ERROR, + details: P.FRAG_GAP, fatal: !1, frag: n, error: t, networkDetails: null }; - return e && (i.part = e), (e || n).stats.aborted = !0, new bn(i); + return e && (i.part = e), (e || n).stats.aborted = !0, new Tn(i); } -function Ck(n) { +function tR(n) { return n === "AES-128" || n === "AES-256"; } -class bn extends Error { +class Tn extends Error { constructor(e) { super(e.error.message), this.data = void 0, this.data = e; } } -class Ty extends Fi { +class By extends Bi { constructor(e, t) { super(e, t), this._boundTick = void 0, this._tickTimer = null, this._tickInterval = null, this._tickCallCount = 0, this._boundTick = this.tick.bind(this); } @@ -15275,16 +15343,16 @@ class Ty extends Fi { doTick() { } } -class mf { +class Of { constructor(e, t, i, s = 0, r = -1, a = !1) { - this.level = void 0, this.sn = void 0, this.part = void 0, this.id = void 0, this.size = void 0, this.partial = void 0, this.transmuxing = Ho(), this.buffering = { - audio: Ho(), - video: Ho(), - audiovideo: Ho() + this.level = void 0, this.sn = void 0, this.part = void 0, this.id = void 0, this.size = void 0, this.partial = void 0, this.transmuxing = ol(), this.buffering = { + audio: ol(), + video: ol(), + audiovideo: ol() }, this.level = e, this.sn = t, this.id = i, this.size = s, this.part = r, this.partial = a; } } -function Ho() { +function ol() { return { start: 0, executeStart: 0, @@ -15292,18 +15360,18 @@ function Ho() { end: 0 }; } -const Fp = { +const Xp = { length: 0, start: () => 0, end: () => 0 }; -class le { +class ue { /** * Return true if `media`'s buffered include `position` */ static isBuffered(e, t) { if (e) { - const i = le.getBuffered(e); + const i = ue.getBuffered(e); for (let s = i.length; s--; ) if (t >= i.start(s) && t <= i.end(s)) return !0; @@ -15312,8 +15380,8 @@ class le { } static bufferedRanges(e) { if (e) { - const t = le.getBuffered(e); - return le.timeRangesToArray(t); + const t = ue.getBuffered(e); + return ue.timeRangesToArray(t); } return []; } @@ -15328,9 +15396,9 @@ class le { } static bufferInfo(e, t, i) { if (e) { - const s = le.bufferedRanges(e); + const s = ue.bufferedRanges(e); if (s.length) - return le.bufferedInfo(s, t, i); + return ue.bufferedInfo(s, t, i); } return { len: 0, @@ -15379,27 +15447,27 @@ class le { */ static getBuffered(e) { try { - return e.buffered || Fp; + return e.buffered || Xp; } catch (t) { - return Ee.log("failed to get media.buffered", t), Fp; + return Te.log("failed to get media.buffered", t), Xp; } } } -const Sy = /\{\$([a-zA-Z0-9-_]+)\}/g; -function Pp(n) { - return Sy.test(n); +const Ny = /\{\$([a-zA-Z0-9-_]+)\}/g; +function Qp(n) { + return Ny.test(n); } -function ud(n, e) { +function kd(n, e) { if (n.variableList !== null || n.hasVariableRefs) { const t = n.variableList; - return e.replace(Sy, (i) => { + return e.replace(Ny, (i) => { const s = i.substring(2, i.length - 1), r = t == null ? void 0 : t[s]; return r === void 0 ? (n.playlistParsingError || (n.playlistParsingError = new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${s}"`)), i) : r; }); } return e; } -function Op(n, e, t) { +function Zp(n, e, t) { let i = n.variableList; i || (n.variableList = i = {}); let s, r; @@ -15418,7 +15486,7 @@ function Op(n, e, t) { s = e.NAME, r = e.VALUE; s in i ? n.playlistParsingError || (n.playlistParsingError = new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${s}"`)) : i[s] = r || ""; } -function Fk(n, e, t) { +function iR(n, e, t) { const i = e.IMPORT; if (t && i in t) { let s = n.variableList; @@ -15426,10 +15494,10 @@ function Fk(n, e, t) { } else n.playlistParsingError || (n.playlistParsingError = new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`)); } -const Pk = /^(\d+)x(\d+)$/, Mp = /(.+?)=(".*?"|.*?)(?:,|$)/g; -class Be { +const nR = /^(\d+)x(\d+)$/, Jp = /(.+?)=(".*?"|.*?)(?:,|$)/g; +class Ue { constructor(e, t) { - typeof e == "string" && (e = Be.parseAttrList(e, t)), De(this, e); + typeof e == "string" && (e = Ue.parseAttrList(e, t)), we(this, e); } get clientAttrs() { return Object.keys(this).filter((e) => e.substring(0, 2) === "X-"); @@ -15471,7 +15539,7 @@ class Be { return this[e] === "YES"; } decimalResolution(e) { - const t = Pk.exec(this[e]); + const t = nR.exec(this[e]); if (t !== null) return { width: parseInt(t[1], 10), @@ -15481,7 +15549,7 @@ class Be { static parseAttrList(e, t) { let i; const s = {}, r = '"'; - for (Mp.lastIndex = 0; (i = Mp.exec(e)) !== null; ) { + for (Jp.lastIndex = 0; (i = Jp.exec(e)) !== null; ) { const a = i[1].trim(); let o = i[2]; const u = o.indexOf(r) === 0 && o.lastIndexOf(r) === o.length - 1; @@ -15497,7 +15565,7 @@ class Be { l = !0; } if (t && (u || l)) - o = ud(t, o); + o = kd(t, o); else if (!l && !u) switch (a) { case "CLOSED-CAPTIONS": @@ -15535,35 +15603,35 @@ class Be { case "VIDEO": case "X-ASSET-LIST": case "X-ASSET-URI": - Ee.warn(`${e}: attribute ${a} is missing quotes`); + Te.warn(`${e}: attribute ${a} is missing quotes`); } s[a] = o; } return s; } } -const Ok = "com.apple.hls.interstitial"; -function Mk(n) { +const sR = "com.apple.hls.interstitial"; +function rR(n) { return n !== "ID" && n !== "CLASS" && n !== "CUE" && n !== "START-DATE" && n !== "DURATION" && n !== "END-DATE" && n !== "END-ON-NEXT"; } -function $k(n) { +function aR(n) { return n === "SCTE35-OUT" || n === "SCTE35-IN" || n === "SCTE35-CMD"; } -class Ay { +class Uy { constructor(e, t, i = 0) { var s; if (this.attr = void 0, this.tagAnchor = void 0, this.tagOrder = void 0, this._startDate = void 0, this._endDate = void 0, this._dateAtEnd = void 0, this._cue = void 0, this._badValueForSameId = void 0, this.tagAnchor = (t == null ? void 0 : t.tagAnchor) || null, this.tagOrder = (s = t == null ? void 0 : t.tagOrder) != null ? s : i, t) { const r = t.attr; for (const a in r) if (Object.prototype.hasOwnProperty.call(e, a) && e[a] !== r[a]) { - Ee.warn(`DATERANGE tag attribute: "${a}" does not match for tags with ID: "${e.ID}"`), this._badValueForSameId = a; + Te.warn(`DATERANGE tag attribute: "${a}" does not match for tags with ID: "${e.ID}"`), this._badValueForSameId = a; break; } - e = De(new Be({}), r, e); + e = we(new Ue({}), r, e); } if (this.attr = e, t ? (this._startDate = t._startDate, this._cue = t._cue, this._endDate = t._endDate, this._dateAtEnd = t._dateAtEnd) : this._startDate = new Date(e["START-DATE"]), "END-DATE" in this.attr) { const r = (t == null ? void 0 : t.endDate) || new Date(this.attr["END-DATE"]); - Z(r.getTime()) && (this._endDate = r); + J(r.getTime()) && (this._endDate = r); } } get id() { @@ -15584,7 +15652,7 @@ class Ay { const { tagAnchor: e } = this; - return e === null || e.programDateTime === null ? (Ee.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`), NaN) : e.start + (this.startDate.getTime() - e.programDateTime) / 1e3; + return e === null || e.programDateTime === null ? (Te.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`), NaN) : e.start + (this.startDate.getTime() - e.programDateTime) / 1e3; } get startDate() { return this._startDate; @@ -15599,7 +15667,7 @@ class Ay { get duration() { if ("DURATION" in this.attr) { const e = this.attr.decimalFloatingPoint("DURATION"); - if (Z(e)) + if (J(e)) return e; } else if (this._endDate) return (this._endDate.getTime() - this._startDate.getTime()) / 1e3; @@ -15612,14 +15680,14 @@ class Ay { return this.attr.bool("END-ON-NEXT"); } get isInterstitial() { - return this.class === Ok; + return this.class === sR; } get isValid() { - return !!this.id && !this._badValueForSameId && Z(this.startDate.getTime()) && (this.duration === null || this.duration >= 0) && (!this.endOnNext || !!this.class) && (!this.attr.CUE || !this.cue.pre && !this.cue.post || this.cue.pre !== this.cue.post) && (!this.isInterstitial || "X-ASSET-URI" in this.attr || "X-ASSET-LIST" in this.attr); + return !!this.id && !this._badValueForSameId && J(this.startDate.getTime()) && (this.duration === null || this.duration >= 0) && (!this.endOnNext || !!this.class) && (!this.attr.CUE || !this.cue.pre && !this.cue.post || this.cue.pre !== this.cue.post) && (!this.isInterstitial || "X-ASSET-URI" in this.attr || "X-ASSET-LIST" in this.attr); } } -const Bk = 10; -class Nk { +const oR = 10; +class lR { constructor(e) { this.PTSKnown = !1, this.alignedSliding = !1, this.averagetargetduration = void 0, this.endCC = 0, this.endSN = 0, this.fragments = void 0, this.fragmentHint = void 0, this.partList = null, this.dateRanges = void 0, this.dateRangeTagCount = 0, this.live = !0, this.requestScheduled = -1, this.ageHeader = 0, this.advancedDateTime = void 0, this.updated = !0, this.advanced = !0, this.misses = 0, this.startCC = 0, this.startSN = 0, this.startTimeOffset = null, this.targetduration = 0, this.totalduration = 0, this.type = null, this.url = void 0, this.m3u8 = "", this.version = null, this.canBlockReload = !1, this.canSkipUntil = 0, this.canSkipDateRanges = !1, this.skippedSegments = 0, this.recentlyRemovedDateranges = void 0, this.partHoldBack = 0, this.holdBack = 0, this.partTarget = 0, this.preloadHint = void 0, this.renditionReports = void 0, this.tuneInGoal = 0, this.deltaUpdateFailed = void 0, this.driftStartTime = 0, this.driftEndTime = 0, this.driftStart = 0, this.driftEnd = 0, this.encryptedFragments = void 0, this.playlistParsingError = null, this.variableList = null, this.hasVariableRefs = !1, this.appliedTimelineOffset = void 0, this.fragments = [], this.encryptedFragments = [], this.dateRanges = {}, this.url = e; } @@ -15632,10 +15700,10 @@ class Nk { this.updated = this.endSN !== e.endSN || !!i || !!t || !this.live, this.advanced = this.endSN > e.endSN || t > 0 || t === 0 && i > 0, this.updated || this.advanced ? this.misses = Math.floor(e.misses * 0.6) : this.misses = e.misses + 1; } get hasProgramDateTime() { - return this.fragments.length ? Z(this.fragments[this.fragments.length - 1].programDateTime) : !1; + return this.fragments.length ? J(this.fragments[this.fragments.length - 1].programDateTime) : !1; } get levelTargetDuration() { - return this.averagetargetduration || this.targetduration || Bk; + return this.averagetargetduration || this.targetduration || oR; } get drift() { const e = this.driftEndTime - this.driftStartTime; @@ -15688,114 +15756,114 @@ class Nk { return !1; } } -function fr(n) { +function xr(n) { return n === "AES-128" || n === "AES-256" || n === "AES-256-CTR"; } -function gf(n) { +function Mf(n) { switch (n) { case "AES-128": case "AES-256": - return Zn.cbc; + return ss.cbc; case "AES-256-CTR": - return Zn.ctr; + return ss.ctr; default: throw new Error(`invalid full segment method ${n}`); } } -function xy(n) { +function Gy(n) { return Uint8Array.from(atob(n), (e) => e.charCodeAt(0)); } -function cd(n) { +function Rd(n) { return Uint8Array.from(unescape(encodeURIComponent(n)), (e) => e.charCodeAt(0)); } -function Uk(n) { - const e = cd(n).subarray(0, 16), t = new Uint8Array(16); +function uR(n) { + const e = Rd(n).subarray(0, 16), t = new Uint8Array(16); return t.set(e, 16 - e.length), t; } -function Gk(n) { +function cR(n) { const e = function(i, s, r) { const a = i[s]; i[s] = i[r], i[r] = a; }; e(n, 0, 3), e(n, 1, 2), e(n, 4, 5), e(n, 6, 7); } -function Hk(n) { +function hR(n) { const e = n.split(":"); let t = null; if (e[0] === "data" && e.length === 2) { const i = e[1].split(";"), s = i[i.length - 1].split(","); if (s.length === 2) { const r = s[0] === "base64", a = s[1]; - r ? (i.splice(-1, 1), t = xy(a)) : t = Uk(a); + r ? (i.splice(-1, 1), t = Gy(a)) : t = uR(a); } } return t; } -const Vl = typeof self < "u" ? self : void 0; -var Ve = { +const ou = typeof self < "u" ? self : void 0; +var ze = { CLEARKEY: "org.w3.clearkey", FAIRPLAY: "com.apple.fps", PLAYREADY: "com.microsoft.playready", WIDEVINE: "com.widevine.alpha" -}, Ot = { +}, Nt = { CLEARKEY: "org.w3.clearkey", FAIRPLAY: "com.apple.streamingkeydelivery", PLAYREADY: "com.microsoft.playready", WIDEVINE: "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" }; -function hd(n) { +function Cd(n) { switch (n) { - case Ot.FAIRPLAY: - return Ve.FAIRPLAY; - case Ot.PLAYREADY: - return Ve.PLAYREADY; - case Ot.WIDEVINE: - return Ve.WIDEVINE; - case Ot.CLEARKEY: - return Ve.CLEARKEY; + case Nt.FAIRPLAY: + return ze.FAIRPLAY; + case Nt.PLAYREADY: + return ze.PLAYREADY; + case Nt.WIDEVINE: + return ze.WIDEVINE; + case Nt.CLEARKEY: + return ze.CLEARKEY; } } -function $p(n) { +function e0(n) { switch (n) { - case Ve.FAIRPLAY: - return Ot.FAIRPLAY; - case Ve.PLAYREADY: - return Ot.PLAYREADY; - case Ve.WIDEVINE: - return Ot.WIDEVINE; - case Ve.CLEARKEY: - return Ot.CLEARKEY; + case ze.FAIRPLAY: + return Nt.FAIRPLAY; + case ze.PLAYREADY: + return Nt.PLAYREADY; + case ze.WIDEVINE: + return Nt.WIDEVINE; + case ze.CLEARKEY: + return Nt.CLEARKEY; } } -function _l(n) { +function Ml(n) { const { drmSystems: e, widevineLicenseUrl: t - } = n, i = e ? [Ve.FAIRPLAY, Ve.WIDEVINE, Ve.PLAYREADY, Ve.CLEARKEY].filter((s) => !!e[s]) : []; - return !i[Ve.WIDEVINE] && t && i.push(Ve.WIDEVINE), i; + } = n, i = e ? [ze.FAIRPLAY, ze.WIDEVINE, ze.PLAYREADY, ze.CLEARKEY].filter((s) => !!e[s]) : []; + return !i[ze.WIDEVINE] && t && i.push(ze.WIDEVINE), i; } -const Dy = function(n) { - return Vl != null && (n = Vl.navigator) != null && n.requestMediaKeySystemAccess ? self.navigator.requestMediaKeySystemAccess.bind(self.navigator) : null; +const Hy = function(n) { + return ou != null && (n = ou.navigator) != null && n.requestMediaKeySystemAccess ? self.navigator.requestMediaKeySystemAccess.bind(self.navigator) : null; }(); -function Vk(n, e, t, i) { +function dR(n, e, t, i) { let s; switch (n) { - case Ve.FAIRPLAY: + case ze.FAIRPLAY: s = ["cenc", "sinf"]; break; - case Ve.WIDEVINE: - case Ve.PLAYREADY: + case ze.WIDEVINE: + case ze.PLAYREADY: s = ["cenc"]; break; - case Ve.CLEARKEY: + case ze.CLEARKEY: s = ["cenc", "keyids"]; break; default: throw new Error(`Unknown key-system: ${n}`); } - return qk(s, e, t, i); + return fR(s, e, t, i); } -function qk(n, e, t, i) { +function fR(n, e, t, i) { return [{ initDataTypes: n, persistentState: i.persistentState || "optional", @@ -15813,28 +15881,28 @@ function qk(n, e, t, i) { })) }]; } -function Kk(n) { +function mR(n) { var e; return n.sessionType === "persistent-license" || !!((e = n.sessionTypes) != null && e.some((t) => t === "persistent-license")); } -function jk(n) { +function gR(n) { const e = new Uint16Array(n.buffer, n.byteOffset, n.byteLength / 2), t = String.fromCharCode.apply(null, Array.from(e)), i = t.substring(t.indexOf("<"), t.length), a = new DOMParser().parseFromString(i, "text/xml").getElementsByTagName("KID")[0]; if (a) { const o = a.childNodes[0] ? a.childNodes[0].nodeValue : a.getAttribute("VALUE"); if (o) { - const u = xy(o).subarray(0, 16); - return Gk(u), u; + const u = Gy(o).subarray(0, 16); + return cR(u), u; } } return null; } -let Vo = {}; -class mu { +let ll = {}; +class Ou { static clearKeyUriToKeyIdMap() { - Vo = {}; + ll = {}; } constructor(e, t, i, s = [1], r = null, a) { - this.uri = void 0, this.method = void 0, this.keyFormat = void 0, this.keyFormatVersions = void 0, this.encrypted = void 0, this.isCommonEncryption = void 0, this.iv = null, this.key = null, this.keyId = null, this.pssh = null, this.method = e, this.uri = t, this.keyFormat = i, this.keyFormatVersions = s, this.iv = r, this.encrypted = e ? e !== "NONE" : !1, this.isCommonEncryption = this.encrypted && !fr(e), a != null && a.startsWith("0x") && (this.keyId = new Uint8Array(ay(a))); + this.uri = void 0, this.method = void 0, this.keyFormat = void 0, this.keyFormatVersions = void 0, this.encrypted = void 0, this.isCommonEncryption = void 0, this.iv = null, this.key = null, this.keyId = null, this.pssh = null, this.method = e, this.uri = t, this.keyFormat = i, this.keyFormatVersions = s, this.iv = r, this.encrypted = e ? e !== "NONE" : !1, this.isCommonEncryption = this.encrypted && !xr(e), a != null && a.startsWith("0x") && (this.keyId = new Uint8Array(Ty(a))); } matches(e) { var t, i; @@ -15842,15 +15910,15 @@ class mu { } isSupported() { if (this.method) { - if (fr(this.method) || this.method === "NONE") + if (xr(this.method) || this.method === "NONE") return !0; if (this.keyFormat === "identity") return this.method === "SAMPLE-AES"; switch (this.keyFormat) { - case Ot.FAIRPLAY: - case Ot.WIDEVINE: - case Ot.PLAYREADY: - case Ot.CLEARKEY: + case Nt.FAIRPLAY: + case Nt.WIDEVINE: + case Nt.PLAYREADY: + case Nt.CLEARKEY: return ["ISO-23001-7", "SAMPLE-AES", "SAMPLE-AES-CENC", "SAMPLE-AES-CTR"].indexOf(this.method) !== -1; } } @@ -15859,25 +15927,25 @@ class mu { getDecryptData(e) { if (!this.encrypted || !this.uri) return null; - if (fr(this.method) && this.uri && !this.iv) { - typeof e != "number" && (Ee.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`), e = 0); - const i = zk(e); - return new mu(this.method, this.uri, "identity", this.keyFormatVersions, i); + if (xr(this.method) && this.uri && !this.iv) { + typeof e != "number" && (Te.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`), e = 0); + const i = pR(e); + return new Ou(this.method, this.uri, "identity", this.keyFormatVersions, i); } if (this.pssh && this.keyId) return this; - const t = Hk(this.uri); + const t = hR(this.uri); if (t) switch (this.keyFormat) { - case Ot.WIDEVINE: + case Nt.WIDEVINE: if (this.pssh = t, !this.keyId && t.length >= 22) { const i = t.length - 22; this.keyId = t.subarray(i, i + 16); } break; - case Ot.PLAYREADY: { + case Nt.PLAYREADY: { const i = new Uint8Array([154, 4, 240, 121, 152, 64, 66, 134, 171, 146, 230, 91, 224, 136, 95, 149]); - this.pssh = QI(i, null, t), this.keyId = jk(t); + this.pssh = Ek(i, null, t), this.keyId = gR(t); break; } default: { @@ -15891,31 +15959,31 @@ class mu { } } if (!this.keyId || this.keyId.byteLength !== 16) { - let i = Vo[this.uri]; + let i = ll[this.uri]; if (!i) { - const s = Object.keys(Vo).length % Number.MAX_SAFE_INTEGER; - i = new Uint8Array(16), new DataView(i.buffer, 12, 4).setUint32(0, s), Vo[this.uri] = i; + const s = Object.keys(ll).length % Number.MAX_SAFE_INTEGER; + i = new Uint8Array(16), new DataView(i.buffer, 12, 4).setUint32(0, s), ll[this.uri] = i; } this.keyId = i; } return this; } } -function zk(n) { +function pR(n) { const e = new Uint8Array(16); for (let t = 12; t < 16; t++) e[t] = n >> 8 * (15 - t) & 255; return e; } -const Bp = /#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g, Np = /#EXT-X-MEDIA:(.*)/g, Wk = /^#EXT(?:INF|-X-TARGETDURATION):/m, Qc = new RegExp([ +const t0 = /#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g, i0 = /#EXT-X-MEDIA:(.*)/g, _R = /^#EXT(?:INF|-X-TARGETDURATION):/m, _h = new RegExp([ /#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source, // duration (#EXTINF:,), group 1 => duration, group 2 => title /(?!#) *(\S[^\r\n]*)/.source, // segment URI, group 3 => the URI (note newline is not eaten) /#.*/.source // All other non-segment oriented tags will match with all groups empty -].join("|"), "g"), Yk = new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source, /#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source, /#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source, /(#)([^:]*):(.*)/.source, /(#)(.*)(?:.*)\r?\n?/.source].join("|")); -class nn { +].join("|"), "g"), vR = new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source, /#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source, /#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source, /(#)([^:]*):(.*)/.source, /(#)(.*)(?:.*)\r?\n?/.source].join("|")); +class an { static findGroup(e, t) { for (let i = 0; i < e.length; i++) { const s = e[i]; @@ -15924,15 +15992,15 @@ class nn { } } static resolve(e, t) { - return of.buildAbsoluteURL(t, e, { + return Lf.buildAbsoluteURL(t, e, { alwaysNormalize: !0 }); } static isMediaPlaylist(e) { - return Wk.test(e); + return _R.test(e); } static parseMasterPlaylist(e, t) { - const i = Pp(e), s = { + const i = Qp(e), s = { contentSteering: null, levels: [], playlistParsingError: null, @@ -15942,50 +16010,50 @@ class nn { variableList: null, hasVariableRefs: i }, r = []; - Bp.lastIndex = 0; + t0.lastIndex = 0; let a; - for (; (a = Bp.exec(e)) != null; ) + for (; (a = t0.exec(e)) != null; ) if (a[1]) { var o; - const l = new Be(a[1], s), c = ud(s, a[2]), h = { + const l = new Ue(a[1], s), c = kd(s, a[2]), h = { attrs: l, bitrate: l.decimalInteger("BANDWIDTH") || l.decimalInteger("AVERAGE-BANDWIDTH"), name: l.NAME, - url: nn.resolve(c, t) + url: an.resolve(c, t) }, d = l.decimalResolution("RESOLUTION"); - d && (h.width = d.width, h.height = d.height), Hp(l.CODECS, h); + d && (h.width = d.width, h.height = d.height), r0(l.CODECS, h); const f = l["SUPPLEMENTAL-CODECS"]; - f && (h.supplemental = {}, Hp(f, h.supplemental)), (o = h.unknownCodecs) != null && o.length || r.push(h), s.levels.push(h); + f && (h.supplemental = {}, r0(f, h.supplemental)), (o = h.unknownCodecs) != null && o.length || r.push(h), s.levels.push(h); } else if (a[3]) { const l = a[3], c = a[4]; switch (l) { case "SESSION-DATA": { - const h = new Be(c, s), d = h["DATA-ID"]; + const h = new Ue(c, s), d = h["DATA-ID"]; d && (s.sessionData === null && (s.sessionData = {}), s.sessionData[d] = h); break; } case "SESSION-KEY": { - const h = Up(c, t, s); - h.encrypted && h.isSupported() ? (s.sessionKeys === null && (s.sessionKeys = []), s.sessionKeys.push(h)) : Ee.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${c}"`); + const h = n0(c, t, s); + h.encrypted && h.isSupported() ? (s.sessionKeys === null && (s.sessionKeys = []), s.sessionKeys.push(h)) : Te.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${c}"`); break; } case "DEFINE": { { - const h = new Be(c, s); - Op(s, h, t); + const h = new Ue(c, s); + Zp(s, h, t); } break; } case "CONTENT-STEERING": { - const h = new Be(c, s); + const h = new Ue(c, s); s.contentSteering = { - uri: nn.resolve(h["SERVER-URI"], t), + uri: an.resolve(h["SERVER-URI"], t), pathwayId: h["PATHWAY-ID"] || "." }; break; } case "START": { - s.startTimeOffset = Gp(c); + s.startTimeOffset = s0(c); break; } } @@ -16007,8 +16075,8 @@ class nn { "CLOSED-CAPTIONS": [] }; let u = 0; - for (Np.lastIndex = 0; (s = Np.exec(e)) !== null; ) { - const l = new Be(s[1], i), c = l.TYPE; + for (i0.lastIndex = 0; (s = i0.exec(e)) !== null; ) { + const l = new Ue(s[1], i), c = l.TYPE; if (c) { const h = o[c], d = r[c] || []; r[c] = d; @@ -16023,11 +16091,11 @@ class nn { autoselect: l.bool("AUTOSELECT"), forced: l.bool("FORCED"), lang: f, - url: l.URI ? nn.resolve(l.URI, t) : "" + url: l.URI ? an.resolve(l.URI, t) : "" }; if (m && (v.assocLang = m), g && (v.channels = g), p && (v.characteristics = p), y && (v.instreamId = y), h != null && h.length) { - const _ = nn.findGroup(h, v.groupId) || h[0]; - Vp(v, _, "audioCodec"), Vp(v, _, "textCodec"); + const _ = an.findGroup(h, v.groupId) || h[0]; + a0(v, _, "audioCodec"), a0(v, _, "textCodec"); } d.push(v); } @@ -16038,70 +16106,70 @@ class nn { var o; const u = { url: t - }, l = new Nk(t), c = l.fragments, h = []; - let d = null, f = 0, m = 0, g = 0, p = 0, y = 0, v = null, _ = new Wc(s, u), E, T, A, S = -1, D = !1, x = null, w; - if (Qc.lastIndex = 0, l.m3u8 = e, l.hasVariableRefs = Pp(e), ((o = Qc.exec(e)) == null ? void 0 : o[0]) !== "#EXTM3U") + }, l = new lR(t), c = l.fragments, h = []; + let d = null, f = 0, m = 0, g = 0, p = 0, y = 0, v = null, _ = new mh(s, u), E, T, x, S = -1, D = !1, A = null, w; + if (_h.lastIndex = 0, l.m3u8 = e, l.hasVariableRefs = Qp(e), ((o = _h.exec(e)) == null ? void 0 : o[0]) !== "#EXTM3U") return l.playlistParsingError = new Error("Missing format identifier #EXTM3U"), l; - for (; (E = Qc.exec(e)) !== null; ) { - D && (D = !1, _ = new Wc(s, u), _.playlistOffset = g, _.start = g, _.sn = f, _.cc = p, y && (_.bitrate = y), _.level = i, d && (_.initSegment = d, d.rawProgramDateTime && (_.rawProgramDateTime = d.rawProgramDateTime, d.rawProgramDateTime = null), x && (_.setByteRange(x), x = null))); - const P = E[1]; - if (P) { - _.duration = parseFloat(P); + for (; (E = _h.exec(e)) !== null; ) { + D && (D = !1, _ = new mh(s, u), _.playlistOffset = g, _.start = g, _.sn = f, _.cc = p, y && (_.bitrate = y), _.level = i, d && (_.initSegment = d, d.rawProgramDateTime && (_.rawProgramDateTime = d.rawProgramDateTime, d.rawProgramDateTime = null), A && (_.setByteRange(A), A = null))); + const q = E[1]; + if (q) { + _.duration = parseFloat(q); const K = (" " + E[2]).slice(1); - _.title = K || null, _.tagList.push(K ? ["INF", P, K] : ["INF", P]); + _.title = K || null, _.tagList.push(K ? ["INF", q, K] : ["INF", q]); } else if (E[3]) { - if (Z(_.duration)) { - _.playlistOffset = g, _.start = g, A && Kp(_, A, l), _.sn = f, _.level = i, _.cc = p, c.push(_); + if (J(_.duration)) { + _.playlistOffset = g, _.start = g, x && l0(_, x, l), _.sn = f, _.level = i, _.cc = p, c.push(_); const K = (" " + E[3]).slice(1); - _.relurl = ud(l, K), dd(_, v, h), v = _, g += _.duration, f++, m = 0, D = !0; + _.relurl = kd(l, K), Fd(_, v, h), v = _, g += _.duration, f++, m = 0, D = !0; } } else { - if (E = E[0].match(Yk), !E) { - Ee.warn("No matches on slow regex match for level playlist!"); + if (E = E[0].match(vR), !E) { + Te.warn("No matches on slow regex match for level playlist!"); continue; } for (T = 1; T < E.length && E[T] === void 0; T++) ; - const K = (" " + E[T]).slice(1), q = (" " + E[T + 1]).slice(1), W = E[T + 2] ? (" " + E[T + 2]).slice(1) : null; + const K = (" " + E[T]).slice(1), H = (" " + E[T + 1]).slice(1), Y = E[T + 2] ? (" " + E[T + 2]).slice(1) : null; switch (K) { case "BYTERANGE": - v ? _.setByteRange(q, v) : _.setByteRange(q); + v ? _.setByteRange(H, v) : _.setByteRange(H); break; case "PROGRAM-DATE-TIME": - _.rawProgramDateTime = q, _.tagList.push(["PROGRAM-DATE-TIME", q]), S === -1 && (S = c.length); + _.rawProgramDateTime = H, _.tagList.push(["PROGRAM-DATE-TIME", H]), S === -1 && (S = c.length); break; case "PLAYLIST-TYPE": - l.type && gn(l, K, E), l.type = q.toUpperCase(); + l.type && vn(l, K, E), l.type = H.toUpperCase(); break; case "MEDIA-SEQUENCE": - l.startSN !== 0 ? gn(l, K, E) : c.length > 0 && jp(l, K, E), f = l.startSN = parseInt(q); + l.startSN !== 0 ? vn(l, K, E) : c.length > 0 && u0(l, K, E), f = l.startSN = parseInt(H); break; case "SKIP": { - l.skippedSegments && gn(l, K, E); - const U = new Be(q, l), j = U.decimalInteger("SKIPPED-SEGMENTS"); - if (Z(j)) { - l.skippedSegments += j; - for (let L = j; L--; ) + l.skippedSegments && vn(l, K, E); + const B = new Ue(H, l), z = B.decimalInteger("SKIPPED-SEGMENTS"); + if (J(z)) { + l.skippedSegments += z; + for (let L = z; L--; ) c.push(null); - f += j; + f += z; } - const $ = U.enumeratedString("RECENTLY-REMOVED-DATERANGES"); - $ && (l.recentlyRemovedDateranges = (l.recentlyRemovedDateranges || []).concat($.split(" "))); + const W = B.enumeratedString("RECENTLY-REMOVED-DATERANGES"); + W && (l.recentlyRemovedDateranges = (l.recentlyRemovedDateranges || []).concat(W.split(" "))); break; } case "TARGETDURATION": - l.targetduration !== 0 && gn(l, K, E), l.targetduration = Math.max(parseInt(q), 1); + l.targetduration !== 0 && vn(l, K, E), l.targetduration = Math.max(parseInt(H), 1); break; case "VERSION": - l.version !== null && gn(l, K, E), l.version = parseInt(q); + l.version !== null && vn(l, K, E), l.version = parseInt(H); break; case "INDEPENDENT-SEGMENTS": break; case "ENDLIST": - l.live || gn(l, K, E), l.live = !1; + l.live || vn(l, K, E), l.live = !1; break; case "#": - (q || W) && _.tagList.push(W ? [q, W] : [q]); + (H || Y) && _.tagList.push(Y ? [H, Y] : [H]); break; case "DISCONTINUITY": p++, _.tagList.push(["DIS"]); @@ -16110,102 +16178,102 @@ class nn { _.gap = !0, _.tagList.push([K]); break; case "BITRATE": - _.tagList.push([K, q]), y = parseInt(q) * 1e3, Z(y) ? _.bitrate = y : y = 0; + _.tagList.push([K, H]), y = parseInt(H) * 1e3, J(y) ? _.bitrate = y : y = 0; break; case "DATERANGE": { - const U = new Be(q, l), j = new Ay(U, l.dateRanges[U.ID], l.dateRangeTagCount); - l.dateRangeTagCount++, j.isValid || l.skippedSegments ? l.dateRanges[j.id] = j : Ee.warn(`Ignoring invalid DATERANGE tag: "${q}"`), _.tagList.push(["EXT-X-DATERANGE", q]); + const B = new Ue(H, l), z = new Uy(B, l.dateRanges[B.ID], l.dateRangeTagCount); + l.dateRangeTagCount++, z.isValid || l.skippedSegments ? l.dateRanges[z.id] = z : Te.warn(`Ignoring invalid DATERANGE tag: "${H}"`), _.tagList.push(["EXT-X-DATERANGE", H]); break; } case "DEFINE": { { - const U = new Be(q, l); - "IMPORT" in U ? Fk(l, U, a) : Op(l, U, t); + const B = new Ue(H, l); + "IMPORT" in B ? iR(l, B, a) : Zp(l, B, t); } break; } case "DISCONTINUITY-SEQUENCE": - l.startCC !== 0 ? gn(l, K, E) : c.length > 0 && jp(l, K, E), l.startCC = p = parseInt(q); + l.startCC !== 0 ? vn(l, K, E) : c.length > 0 && u0(l, K, E), l.startCC = p = parseInt(H); break; case "KEY": { - const U = Up(q, t, l); - if (U.isSupported()) { - if (U.method === "NONE") { - A = void 0; + const B = n0(H, t, l); + if (B.isSupported()) { + if (B.method === "NONE") { + x = void 0; break; } - A || (A = {}); - const j = A[U.keyFormat]; - j != null && j.matches(U) || (j && (A = De({}, A)), A[U.keyFormat] = U); + x || (x = {}); + const z = x[B.keyFormat]; + z != null && z.matches(B) || (z && (x = we({}, x)), x[B.keyFormat] = B); } else - Ee.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${q}"`); + Te.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${H}"`); break; } case "START": - l.startTimeOffset = Gp(q); + l.startTimeOffset = s0(H); break; case "MAP": { - const U = new Be(q, l); + const B = new Ue(H, l); if (_.duration) { - const j = new Wc(s, u); - qp(j, U, i, A), d = j, _.initSegment = d, d.rawProgramDateTime && !_.rawProgramDateTime && (_.rawProgramDateTime = d.rawProgramDateTime); + const z = new mh(s, u); + o0(z, B, i, x), d = z, _.initSegment = d, d.rawProgramDateTime && !_.rawProgramDateTime && (_.rawProgramDateTime = d.rawProgramDateTime); } else { - const j = _.byteRangeEndOffset; - if (j) { - const $ = _.byteRangeStartOffset; - x = `${j - $}@${$}`; + const z = _.byteRangeEndOffset; + if (z) { + const W = _.byteRangeStartOffset; + A = `${z - W}@${W}`; } else - x = null; - qp(_, U, i, A), d = _, D = !0; + A = null; + o0(_, B, i, x), d = _, D = !0; } d.cc = p; break; } case "SERVER-CONTROL": { - w && gn(l, K, E), w = new Be(q), l.canBlockReload = w.bool("CAN-BLOCK-RELOAD"), l.canSkipUntil = w.optionalFloat("CAN-SKIP-UNTIL", 0), l.canSkipDateRanges = l.canSkipUntil > 0 && w.bool("CAN-SKIP-DATERANGES"), l.partHoldBack = w.optionalFloat("PART-HOLD-BACK", 0), l.holdBack = w.optionalFloat("HOLD-BACK", 0); + w && vn(l, K, E), w = new Ue(H), l.canBlockReload = w.bool("CAN-BLOCK-RELOAD"), l.canSkipUntil = w.optionalFloat("CAN-SKIP-UNTIL", 0), l.canSkipDateRanges = l.canSkipUntil > 0 && w.bool("CAN-SKIP-DATERANGES"), l.partHoldBack = w.optionalFloat("PART-HOLD-BACK", 0), l.holdBack = w.optionalFloat("HOLD-BACK", 0); break; } case "PART-INF": { - l.partTarget && gn(l, K, E); - const U = new Be(q); - l.partTarget = U.decimalFloatingPoint("PART-TARGET"); + l.partTarget && vn(l, K, E); + const B = new Ue(H); + l.partTarget = B.decimalFloatingPoint("PART-TARGET"); break; } case "PART": { - let U = l.partList; - U || (U = l.partList = []); - const j = m > 0 ? U[U.length - 1] : void 0, $ = m++, L = new Be(q, l), H = new $I(L, _, u, $, j); - U.push(H), _.duration += H.duration; + let B = l.partList; + B || (B = l.partList = []); + const z = m > 0 ? B[B.length - 1] : void 0, W = m++, L = new Ue(H, l), $ = new ak(L, _, u, W, z); + B.push($), _.duration += $.duration; break; } case "PRELOAD-HINT": { - const U = new Be(q, l); - l.preloadHint = U; + const B = new Ue(H, l); + l.preloadHint = B; break; } case "RENDITION-REPORT": { - const U = new Be(q, l); - l.renditionReports = l.renditionReports || [], l.renditionReports.push(U); + const B = new Ue(H, l); + l.renditionReports = l.renditionReports || [], l.renditionReports.push(B); break; } default: - Ee.warn(`line parsed but not handled: ${E}`); + Te.warn(`line parsed but not handled: ${E}`); break; } } } - v && !v.relurl ? (c.pop(), g -= v.duration, l.partList && (l.fragmentHint = v)) : l.partList && (dd(_, v, h), _.cc = p, l.fragmentHint = _, A && Kp(_, A, l)), l.targetduration || (l.playlistParsingError = new Error("#EXT-X-TARGETDURATION is required")); - const I = c.length, R = c[0], M = c[I - 1]; - if (g += l.skippedSegments * l.targetduration, g > 0 && I && M) { + v && !v.relurl ? (c.pop(), g -= v.duration, l.partList && (l.fragmentHint = v)) : l.partList && (Fd(_, v, h), _.cc = p, l.fragmentHint = _, x && l0(_, x, l)), l.targetduration || (l.playlistParsingError = new Error("#EXT-X-TARGETDURATION is required")); + const I = c.length, M = c[0], k = c[I - 1]; + if (g += l.skippedSegments * l.targetduration, g > 0 && I && k) { l.averagetargetduration = g / I; - const P = M.sn; - l.endSN = P !== "initSegment" ? P : 0, l.live || (M.endList = !0), R && l.startCC === void 0 && (l.startCC = R.cc), S > 0 && (Qk(c, S), R && h.unshift(R)); + const q = k.sn; + l.endSN = q !== "initSegment" ? q : 0, l.live || (k.endList = !0), M && l.startCC === void 0 && (l.startCC = M.cc), S > 0 && (ER(c, S), M && h.unshift(M)); } else l.endSN = 0, l.startCC = 0; - return l.fragmentHint && (g += l.fragmentHint.duration), l.totalduration = g, h.length && l.dateRangeTagCount && R && wy(h, l), l.endCC = p, l; + return l.fragmentHint && (g += l.fragmentHint.duration), l.totalduration = g, h.length && l.dateRangeTagCount && M && Vy(h, l), l.endCC = p, l; } } -function wy(n, e) { +function Vy(n, e) { const t = n.length; if (!t) return; @@ -16214,7 +16282,7 @@ function wy(n, e) { const o = e.dateRanges[r[a]], u = o.startDate.getTime(); o.tagAnchor = i.ref; for (let l = t; l--; ) { - const c = Xk(e, u, n, l, s); + const c = yR(e, u, n, l, s); if (c !== -1) { o.tagAnchor = e.fragments[c].ref; break; @@ -16222,7 +16290,7 @@ function wy(n, e) { } } } -function Xk(n, e, t, i, s) { +function yR(n, e, t, i, s) { const r = t[i]; if (r) { const o = r.programDateTime; @@ -16245,29 +16313,29 @@ function Xk(n, e, t, i, s) { } return -1; } -function Up(n, e, t) { +function n0(n, e, t) { var i, s; - const r = new Be(n, t), a = (i = r.METHOD) != null ? i : "", o = r.URI, u = r.hexadecimalInteger("IV"), l = r.KEYFORMATVERSIONS, c = (s = r.KEYFORMAT) != null ? s : "identity"; - o && r.IV && !u && Ee.error(`Invalid IV: ${r.IV}`); - const h = o ? nn.resolve(o, e) : "", d = (l || "1").split("/").map(Number).filter(Number.isFinite); - return new mu(a, h, c, d, u, r.KEYID); + const r = new Ue(n, t), a = (i = r.METHOD) != null ? i : "", o = r.URI, u = r.hexadecimalInteger("IV"), l = r.KEYFORMATVERSIONS, c = (s = r.KEYFORMAT) != null ? s : "identity"; + o && r.IV && !u && Te.error(`Invalid IV: ${r.IV}`); + const h = o ? an.resolve(o, e) : "", d = (l || "1").split("/").map(Number).filter(Number.isFinite); + return new Ou(a, h, c, d, u, r.KEYID); } -function Gp(n) { - const t = new Be(n).decimalFloatingPoint("TIME-OFFSET"); - return Z(t) ? t : null; +function s0(n) { + const t = new Ue(n).decimalFloatingPoint("TIME-OFFSET"); + return J(t) ? t : null; } -function Hp(n, e) { +function r0(n, e) { let t = (n || "").split(/[ ,]+/).filter((i) => i); ["video", "audio", "text"].forEach((i) => { - const s = t.filter((r) => cf(r, i)); + const s = t.filter((r) => Rf(r, i)); s.length && (e[`${i}Codec`] = s.map((r) => r.split("/")[0]).join(","), t = t.filter((r) => s.indexOf(r) === -1)); }), e.unknownCodecs = t; } -function Vp(n, e, t) { +function a0(n, e, t) { const i = e[t]; i && (n[t] = i); } -function Qk(n, e) { +function ER(n, e) { let t = n[e]; for (let i = e; i--; ) { const s = n[i]; @@ -16276,39 +16344,39 @@ function Qk(n, e) { s.programDateTime = t.programDateTime - s.duration * 1e3, t = s; } } -function dd(n, e, t) { +function Fd(n, e, t) { n.rawProgramDateTime ? t.push(n) : e != null && e.programDateTime && (n.programDateTime = e.endProgramDateTime); } -function qp(n, e, t, i) { +function o0(n, e, t, i) { n.relurl = e.URI, e.BYTERANGE && n.setByteRange(e.BYTERANGE), n.level = t, n.sn = "initSegment", i && (n.levelkeys = i), n.initSegment = null; } -function Kp(n, e, t) { +function l0(n, e, t) { n.levelkeys = e; const { encryptedFragments: i } = t; (!i.length || i[i.length - 1].levelkeys !== e) && Object.keys(e).some((s) => e[s].isCommonEncryption) && i.push(n); } -function gn(n, e, t) { +function vn(n, e, t) { n.playlistParsingError = new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`); } -function jp(n, e, t) { +function u0(n, e, t) { n.playlistParsingError = new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`); } -function Zc(n, e) { +function vh(n, e) { const t = e.startPTS; - if (Z(t)) { + if (J(t)) { let i = 0, s; e.sn > n.sn ? (i = t - n.start, s = n) : (i = n.start - t, s = e), s.duration !== i && s.setDuration(i); } else e.sn > n.sn ? n.cc === e.cc && n.minEndPTS ? e.setStart(n.start + (n.minEndPTS - n.start)) : e.setStart(n.start + n.duration) : e.setStart(Math.max(n.start - e.duration, 0)); } -function Ly(n, e, t, i, s, r) { - i - t <= 0 && (Ee.warn("Fragment should have a positive duration", e), i = t + e.duration, r = s + e.duration); +function qy(n, e, t, i, s, r) { + i - t <= 0 && (Te.warn("Fragment should have a positive duration", e), i = t + e.duration, r = s + e.duration); let o = t, u = i; const l = e.startPTS, c = e.endPTS; - if (Z(l)) { + if (J(l)) { const p = Math.abs(l - t); - Z(e.deltaPTS) ? e.deltaPTS = Math.max(p, e.deltaPTS) : e.deltaPTS = p, o = Math.max(t, l), t = Math.min(t, l), s = Math.min(s, e.startDTS), u = Math.min(i, c), i = Math.max(i, c), r = Math.max(r, e.endDTS); + J(e.deltaPTS) ? e.deltaPTS = Math.max(p, e.deltaPTS) : e.deltaPTS = p, o = Math.max(t, l), t = Math.min(t, l), s = Math.min(s, e.startDTS), u = Math.min(i, c), i = Math.max(i, c), r = Math.max(r, e.endDTS); } const h = t - e.start; e.start !== 0 && e.setStart(t), e.setDuration(i - e.start), e.startPTS = t, e.maxStartPTS = o, e.startDTS = s, e.endPTS = i, e.minEndPTS = u, e.endDTS = r; @@ -16318,12 +16386,12 @@ function Ly(n, e, t, i, s, r) { let f; const m = d - n.startSN, g = n.fragments; for (g[m] = e, f = m; f > 0; f--) - Zc(g[f], g[f - 1]); + vh(g[f], g[f - 1]); for (f = m; f < g.length - 1; f++) - Zc(g[f], g[f + 1]); - return n.fragmentHint && Zc(g[g.length - 1], n.fragmentHint), n.PTSKnown = n.alignedSliding = !0, h; + vh(g[f], g[f + 1]); + return n.fragmentHint && vh(g[g.length - 1], n.fragmentHint), n.PTSKnown = n.alignedSliding = !0, h; } -function Zk(n, e) { +function bR(n, e) { if (n === e) return; let t = null; @@ -16337,14 +16405,14 @@ function Zk(n, e) { } n.fragmentHint && delete n.fragmentHint.endPTS; let s; - tR(n, e, (l, c, h, d) => { + AR(n, e, (l, c, h, d) => { if ((!e.startCC || e.skippedSegments) && c.cc !== l.cc) { const f = l.cc - c.cc; for (let m = h; m < d.length; m++) d[m].cc += f; e.endCC = d[d.length - 1].cc; } - Z(l.startPTS) && Z(l.endPTS) && (c.setStart(c.startPTS = l.startPTS), c.startDTS = l.startDTS, c.maxStartPTS = l.maxStartPTS, c.endPTS = l.endPTS, c.endDTS = l.endDTS, c.minEndPTS = l.minEndPTS, c.setDuration(l.endPTS - l.startPTS), c.duration && (s = c), e.PTSKnown = e.alignedSliding = !0), l.hasStreams && (c.elementaryStreams = l.elementaryStreams), c.loader = l.loader, l.hasStats && (c.stats = l.stats), l.initSegment && (c.initSegment = l.initSegment, t = l.initSegment); + J(l.startPTS) && J(l.endPTS) && (c.setStart(c.startPTS = l.startPTS), c.startDTS = l.startDTS, c.maxStartPTS = l.maxStartPTS, c.endPTS = l.endPTS, c.endDTS = l.endDTS, c.minEndPTS = l.minEndPTS, c.setDuration(l.endPTS - l.startPTS), c.duration && (s = c), e.PTSKnown = e.alignedSliding = !0), l.hasStreams && (c.elementaryStreams = l.elementaryStreams), c.loader = l.loader, l.hasStats && (c.stats = l.stats), l.initSegment && (c.initSegment = l.initSegment, t = l.initSegment); }); const r = e.fragments, a = e.fragmentHint ? r.concat(e.fragmentHint) : r; if (t && a.forEach((l) => { @@ -16352,28 +16420,28 @@ function Zk(n, e) { l && (!l.initSegment || l.initSegment.relurl === ((c = t) == null ? void 0 : c.relurl)) && (l.initSegment = t); }), e.skippedSegments) { if (e.deltaUpdateFailed = r.some((l) => !l), e.deltaUpdateFailed) { - Ee.warn("[level-helper] Previous playlist missing segments skipped in delta playlist"); + Te.warn("[level-helper] Previous playlist missing segments skipped in delta playlist"); for (let l = e.skippedSegments; l--; ) r.shift(); e.startSN = r[0].sn; } else { - e.canSkipDateRanges && (e.dateRanges = Jk(n.dateRanges, e)); + e.canSkipDateRanges && (e.dateRanges = TR(n.dateRanges, e)); const l = n.fragments.filter((c) => c.rawProgramDateTime); if (n.hasProgramDateTime && !e.hasProgramDateTime) for (let c = 1; c < a.length; c++) - a[c].programDateTime === null && dd(a[c], a[c - 1], l); - wy(l, e); + a[c].programDateTime === null && Fd(a[c], a[c - 1], l); + Vy(l, e); } e.endCC = r[r.length - 1].cc; } if (!e.startCC) { var o; - const l = Ry(n, e.startSN - 1); + const l = zy(n, e.startSN - 1); e.startCC = (o = l == null ? void 0 : l.cc) != null ? o : r[0].cc; } - eR(n.partList, e.partList, (l, c) => { + SR(n.partList, e.partList, (l, c) => { c.elementaryStreams = l.elementaryStreams, c.stats = l.stats; - }), s ? Ly(e, s, s.startPTS, s.endPTS, s.startDTS, s.endDTS) : Iy(n, e), r.length && (e.totalduration = e.edge - r[0].start), e.driftStartTime = n.driftStartTime, e.driftStart = n.driftStart; + }), s ? qy(e, s, s.startPTS, s.endPTS, s.startDTS, s.endDTS) : Ky(n, e), r.length && (e.totalduration = e.edge - r[0].start), e.driftStartTime = n.driftStartTime, e.driftStart = n.driftStart; const u = e.advancedDateTime; if (e.advanced && u) { const l = e.edge; @@ -16382,21 +16450,21 @@ function Zk(n, e) { e.driftEndTime = n.driftEndTime, e.driftEnd = n.driftEnd, e.advancedDateTime = n.advancedDateTime; e.requestScheduled === -1 && (e.requestScheduled = n.requestScheduled); } -function Jk(n, e) { +function TR(n, e) { const { dateRanges: t, recentlyRemovedDateranges: i - } = e, s = De({}, n); + } = e, s = we({}, n); i && i.forEach((o) => { delete s[o]; }); const a = Object.keys(s).length; return a && Object.keys(t).forEach((o) => { - const u = s[o], l = new Ay(t[o].attr, u); - l.isValid ? (s[o] = l, u || (l.tagOrder += a)) : Ee.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Oe(t[o].attr)}"`); + const u = s[o], l = new Uy(t[o].attr, u); + l.isValid ? (s[o] = l, u || (l.tagOrder += a)) : Te.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${$e(t[o].attr)}"`); }), s; } -function eR(n, e, t) { +function SR(n, e, t) { if (n && e) { let i = 0; for (let s = 0, r = n.length; s <= r; s++) { @@ -16405,23 +16473,23 @@ function eR(n, e, t) { } } } -function tR(n, e, t) { +function AR(n, e, t) { const i = e.skippedSegments, s = Math.max(n.startSN, e.startSN) - e.startSN, r = (n.fragmentHint ? 1 : 0) + (i ? e.endSN : Math.min(n.endSN, e.endSN)) - e.startSN, a = e.startSN - n.startSN, o = e.fragmentHint ? e.fragments.concat(e.fragmentHint) : e.fragments, u = n.fragmentHint ? n.fragments.concat(n.fragmentHint) : n.fragments; for (let l = s; l <= r; l++) { const c = u[a + l]; let h = o[l]; if (i && !h && c && (h = e.fragments[l] = c), c && h) { if (t(c, h, l, o), c.url && c.url !== h.url) { - e.playlistParsingError = zp(`media sequence mismatch ${h.sn}:`, n, e, c, h); + e.playlistParsingError = c0(`media sequence mismatch ${h.sn}:`, n, e, c, h); return; } else if (c.cc !== h.cc) { - e.playlistParsingError = zp(`discontinuity sequence mismatch (${c.cc}!=${h.cc})`, n, e, c, h); + e.playlistParsingError = c0(`discontinuity sequence mismatch (${c.cc}!=${h.cc})`, n, e, c, h); return; } } } } -function zp(n, e, t, i, s) { +function c0(n, e, t, i, s) { return new Error(`${n} ${s.url} Playlist starting @${e.startSN} ${e.m3u8} @@ -16429,7 +16497,7 @@ ${e.m3u8} Playlist starting @${t.startSN} ${t.m3u8}`); } -function Iy(n, e, t = !0) { +function Ky(n, e, t = !0) { const i = e.startSN + e.skippedSegments - n.startSN, s = n.fragments, r = i >= 0; let a = 0; if (r && i < s.length) @@ -16442,9 +16510,9 @@ function Iy(n, e, t = !0) { a = n.fragmentStart; else return; - fd(e, a); + Pd(e, a); } -function fd(n, e) { +function Pd(n, e) { if (e) { const t = n.fragments; for (let i = n.skippedSegments; i < t.length; i++) @@ -16452,7 +16520,7 @@ function fd(n, e) { n.fragmentHint && n.fragmentHint.addStart(e); } } -function ky(n, e = 1 / 0) { +function jy(n, e = 1 / 0) { let t = 1e3 * n.targetduration; if (n.updated) { const i = n.fragments; @@ -16464,16 +16532,16 @@ function ky(n, e = 1 / 0) { t /= 2; return Math.round(t); } -function Ry(n, e, t) { +function zy(n, e, t) { if (!n) return null; let i = n.fragments[e - n.startSN]; return i || (i = n.fragmentHint, i && i.sn === e) ? i : e < n.startSN && t && t.sn === e ? t : null; } -function Wp(n, e, t) { - return n ? Cy(n.partList, e, t) : null; +function h0(n, e, t) { + return n ? Wy(n.partList, e, t) : null; } -function Cy(n, e, t) { +function Wy(n, e, t) { if (n) for (let i = n.length; i--; ) { const s = n[i]; @@ -16482,7 +16550,7 @@ function Cy(n, e, t) { } return null; } -function Fy(n) { +function Yy(n) { n.forEach((e, t) => { var i; (i = e.details) == null || i.fragments.forEach((s) => { @@ -16490,7 +16558,7 @@ function Fy(n) { }); }); } -function xa(n, e) { +function Ma(n, e) { for (let i = 0, s = n.length; i < s; i++) { var t; if (((t = n[i]) == null ? void 0 : t.cc) === e) @@ -16498,35 +16566,35 @@ function xa(n, e) { } return null; } -function iR(n, e) { +function xR(n, e) { return !!(n && e.startCC < n.endCC && e.endCC > n.startCC); } -function Yp(n, e) { +function d0(n, e) { if (n) { const t = n.start + e; n.start = n.startPTS = t, n.endPTS = t + n.duration; } } -function Py(n, e) { +function Xy(n, e) { const t = e.fragments; for (let i = 0, s = t.length; i < s; i++) - Yp(t[i], n); - e.fragmentHint && Yp(e.fragmentHint, n), e.alignedSliding = !0; + d0(t[i], n); + e.fragmentHint && d0(e.fragmentHint, n), e.alignedSliding = !0; } -function nR(n, e) { - n && (Oy(e, n), !e.alignedSliding && n && ql(e, n), !e.alignedSliding && n && !e.skippedSegments && Iy(n, e, !1)); +function DR(n, e) { + n && (Qy(e, n), !e.alignedSliding && n && lu(e, n), !e.alignedSliding && n && !e.skippedSegments && Ky(n, e, !1)); } -function Oy(n, e) { - if (!iR(e, n)) +function Qy(n, e) { + if (!xR(e, n)) return; - const t = Math.min(e.endCC, n.endCC), i = xa(e.fragments, t), s = xa(n.fragments, t); + const t = Math.min(e.endCC, n.endCC), i = Ma(e.fragments, t), s = Ma(n.fragments, t); if (!i || !s) return; - Ee.log(`Aligning playlist at start of dicontinuity sequence ${t}`); + Te.log(`Aligning playlist at start of dicontinuity sequence ${t}`); const r = i.start - s.start; - Py(r, n); + Xy(r, n); } -function ql(n, e) { +function lu(n, e) { if (!n.hasProgramDateTime || !e.hasProgramDateTime) return; const t = n.fragments, i = e.fragments; @@ -16534,14 +16602,14 @@ function ql(n, e) { return; let s, r; const a = Math.min(e.endCC, n.endCC); - e.startCC < a && n.startCC < a && (s = xa(i, a), r = xa(t, a)), (!s || !r) && (s = i[Math.floor(i.length / 2)], r = xa(t, s.cc) || t[Math.floor(t.length / 2)]); + e.startCC < a && n.startCC < a && (s = Ma(i, a), r = Ma(t, a)), (!s || !r) && (s = i[Math.floor(i.length / 2)], r = Ma(t, s.cc) || t[Math.floor(t.length / 2)]); const o = s.programDateTime, u = r.programDateTime; if (!o || !u) return; const l = (u - o) / 1e3 - (r.start - s.start); - Py(l, n); + Xy(l, n); } -const sR = { +const wR = { toString: function(n) { let e = ""; const t = n.length; @@ -16563,7 +16631,7 @@ const sR = { WAITING_INIT_PTS: "WAITING_INIT_PTS", WAITING_LEVEL: "WAITING_LEVEL" }; -class pf extends Ty { +class $f extends By { constructor(e, t, i, s, r) { super(s, e.logger), this.hls = void 0, this.fragPrevious = null, this.fragCurrent = null, this.fragmentTracker = void 0, this.transmuxer = null, this._state = V.STOPPED, this.playlistType = void 0, this.media = null, this.mediaBuffer = null, this.config = void 0, this.bitrateTest = !1, this.lastCurrentTime = 0, this.nextLoadPosition = 0, this.startPosition = 0, this.startTimeOffset = null, this.retryDate = 0, this.levels = null, this.fragmentLoader = void 0, this.keyLoader = void 0, this.levelLastLoaded = null, this.startFragRequested = !1, this.decrypter = void 0, this.initPTS = [], this.buffering = !0, this.loadingParts = !1, this.loopSn = void 0, this.onMediaSeeking = () => { const { @@ -16572,8 +16640,8 @@ class pf extends Ty { media: u, mediaBuffer: l, state: c - } = this, h = u ? u.currentTime : 0, d = le.bufferInfo(l || u, h, a.maxBufferHole), f = !d.len; - if (this.log(`Media seeking to ${Z(h) ? h.toFixed(3) : h}, state: ${c}, ${f ? "out of" : "in"} buffer`), this.state === V.ENDED) + } = this, h = u ? u.currentTime : 0, d = ue.bufferInfo(l || u, h, a.maxBufferHole), f = !d.len; + if (this.log(`Media seeking to ${J(h) ? h.toFixed(3) : h}, state: ${c}, ${f ? "out of" : "in"} buffer`), this.state === V.ENDED) this.resetLoadingState(); else if (o) { const m = a.maxFragLookUpTolerance, g = o.start - m, p = o.start + o.duration + m; @@ -16593,7 +16661,7 @@ class pf extends Ty { this.hls.hasEnoughToStart || (this.log(`Setting ${f ? "startPosition" : "nextLoadPosition"} to ${h} for seek without enough to start`), this.nextLoadPosition = h, f && (this.startPosition = h)), this.tickImmediate(); }, this.onMediaEnded = () => { this.log("setting startPosition to 0 because media ended"), this.startPosition = this.lastCurrentTime = 0; - }, this.playlistType = r, this.hls = e, this.fragmentLoader = new Rk(e.config), this.keyLoader = i, this.fragmentTracker = t, this.config = e.config, this.decrypter = new ff(e.config); + }, this.playlistType = r, this.hls = e, this.fragmentLoader = new eR(e.config), this.keyLoader = i, this.fragmentTracker = t, this.config = e.config, this.decrypter = new Pf(e.config); } registerListeners() { const { @@ -16650,14 +16718,14 @@ class pf extends Ty { if (i <= s) return !1; const r = e.buffered; - this.config.maxBufferHole && r && r.length > 1 && (e = le.bufferedInfo(r, e.start, 0)); + this.config.maxBufferHole && r && r.length > 1 && (e = ue.bufferedInfo(r, e.start, 0)); const a = e.nextStart; if (a && a > s && a < t.edge || this.media.currentTime < e.start) return !1; const u = t.partList; if (u != null && u.length) { const c = u[u.length - 1]; - return le.isBuffered(this.media, c.start + c.duration / 2); + return ue.isBuffered(this.media, c.start + c.duration / 2); } const l = t.fragments[t.fragments.length - 1].type; return this.fragmentTracker.isEndListAppended(l); @@ -16736,7 +16804,7 @@ class pf extends Ty { const { fragmentTracker: i } = this; - if (i.getState(e) === Ze.APPENDING) { + if (i.getState(e) === nt.APPENDING) { const r = e.type, a = this.getFwdBufferInfo(this.mediaBuffer, r), o = Math.max(e.duration, a ? a.len : this.config.maxBufferLength), u = this.backtrackFragment; ((u ? e.sn - u.sn : 0) === 1 || this.reduceMaxBufferLength(o, e.duration)) && i.removeFragment(e); } else ((t = this.mediaBuffer) == null ? void 0 : t.buffered.length) === 0 ? i.removeAllFragments() : i.hasParts(e.type) && (i.detectPartialFragments({ @@ -16744,7 +16812,7 @@ class pf extends Ty { part: null, stats: e.stats, id: e.type - }), i.getState(e) === Ze.PARTIAL && i.removeFragment(e)); + }), i.getState(e) === nt.PARTIAL && i.removeFragment(e)); } checkLiveUpdate(e) { if (e.updated && !e.live) { @@ -16785,12 +16853,12 @@ class pf extends Ty { frag: r, payload: a } = i, o = r.decryptdata; - if (a && a.byteLength > 0 && o != null && o.key && o.iv && fr(o.method)) { + if (a && a.byteLength > 0 && o != null && o.key && o.iv && xr(o.method)) { const u = self.performance.now(); - return this.decrypter.decrypt(new Uint8Array(a), o.key.buffer, o.iv.buffer, gf(o.method)).catch((l) => { + return this.decrypter.decrypt(new Uint8Array(a), o.key.buffer, o.iv.buffer, Mf(o.method)).catch((l) => { throw s.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.FRAG_DECRYPT_ERROR, + type: ne.MEDIA_ERROR, + details: P.FRAG_DECRYPT_ERROR, fatal: !1, error: l, reason: l.message, @@ -16830,9 +16898,9 @@ class pf extends Ty { } fragBufferedComplete(e, t) { const i = this.mediaBuffer ? this.mediaBuffer : this.media; - if (this.log(`Buffered ${e.type} sn: ${e.sn}${t ? " part: " + t.index : ""} of ${this.fragInfo(e, !1, t)} > buffer:${i ? sR.toString(le.getBuffered(i)) : "(detached)"})`), Ye(e)) { + if (this.log(`Buffered ${e.type} sn: ${e.sn}${t ? " part: " + t.index : ""} of ${this.fragInfo(e, !1, t)} > buffer:${i ? wR.toString(ue.getBuffered(i)) : "(detached)"})`), Ze(e)) { var s; - if (e.type !== J.SUBTITLE) { + if (e.type !== te.SUBTITLE) { const a = e.elementaryStreams; if (!Object.keys(a).some((o) => !!a[o])) { this.state = V.IDLE; @@ -16854,7 +16922,7 @@ class pf extends Ty { frag: i, part: s, partsLoaded: r - } = e, a = !r || r.length === 0 || r.some((u) => !u), o = new mf(i.level, i.sn, i.stats.chunkCount + 1, 0, s ? s.index : -1, !a); + } = e, a = !r || r.length === 0 || r.some((u) => !u), o = new Of(i.level, i.sn, i.stats.chunkCount + 1, 0, s ? s.index : -1, !a); t.flush(o); } _handleFragmentLoadProgress(e) { @@ -16873,11 +16941,11 @@ class pf extends Ty { frag: e }), this.fragCurrent === null && (o = Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))) : e.encrypted || (o = this.keyLoader.loadClear(e, a.encryptedFragments, this.startFragRequested), o && this.log("[eme] blocking frag load until media-keys acquired")); const u = this.fragPrevious; - if (Ye(e) && (!u || e.sn !== u.sn)) { + if (Ze(e) && (!u || e.sn !== u.sn)) { const h = this.shouldLoadParts(t.details, e.end); h !== this.loadingParts && (this.log(`LL-Part loading ${h ? "ON" : "OFF"} loading sn ${u == null ? void 0 : u.sn}->${e.sn}`), this.loadingParts = h); } - if (i = Math.max(e.start, i || 0), this.loadingParts && Ye(e)) { + if (i = Math.max(e.start, i || 0), this.loadingParts && Ze(e)) { const h = a.partList; if (h && s) { i > e.end && a.fragmentHint && (e = a.fragmentHint); @@ -16895,11 +16963,11 @@ class pf extends Ty { return Promise.resolve(null); } } - if (Ye(e) && this.loadingParts) + if (Ze(e) && this.loadingParts) this.log(`LL-Part loading OFF after next part miss @${i.toFixed(2)}`), this.loadingParts = !1; else if (!e.url) return Promise.resolve(null); - this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e, !1)}) cc: ${e.cc} ${a ? "[" + a.startSN + "-" + a.endSN + "]" : ""}, target: ${parseFloat(i.toFixed(3))}`), Z(e.sn) && !this.bitrateTest && (this.nextLoadPosition = e.start + e.duration), this.state = V.FRAG_LOADING; + this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e, !1)}) cc: ${e.cc} ${a ? "[" + a.startSN + "-" + a.endSN + "]" : ""}, target: ${parseFloat(i.toFixed(3))}`), J(e.sn) && !this.bitrateTest && (this.nextLoadPosition = e.start + e.duration), this.state = V.FRAG_LOADING; const l = this.config.progressive; let c; return l && o ? c = o.then((h) => !h || this.fragContextChanged(h == null ? void 0 : h.frag) ? null : this.fragmentLoader.load(e, s)).catch((h) => this.handleFragLoadError(h)) : c = Promise.all([this.fragmentLoader.load(e, l ? s : void 0), o]).then(([h]) => (!l && h && s && s(h), h)).catch((h) => this.handleFragLoadError(h)), this.hls.trigger(b.FRAG_LOADING, { @@ -16915,7 +16983,7 @@ class pf extends Ty { u[h.index] = d; const f = d.part; this.hls.trigger(b.FRAG_LOADED, d); - const m = Wp(i.details, e.sn, h.index + 1) || Cy(l, e.sn, h.index + 1); + const m = h0(i.details, e.sn, h.index + 1) || Wy(l, e.sn, h.index + 1); if (m) c(m); else @@ -16932,11 +17000,11 @@ class pf extends Ty { handleFragLoadError(e) { if ("data" in e) { const t = e.data; - e.data && t.details === O.INTERNAL_ABORTED ? this.handleFragLoadAborted(t.frag, t.part) : this.hls.trigger(b.ERROR, t); + e.data && t.details === P.INTERNAL_ABORTED ? this.handleFragLoadAborted(t.frag, t.part) : this.hls.trigger(b.ERROR, t); } else this.hls.trigger(b.ERROR, { - type: ie.OTHER_ERROR, - details: O.INTERNAL_EXCEPTION, + type: ne.OTHER_ERROR, + details: P.INTERNAL_EXCEPTION, err: e, error: e, fatal: !0 @@ -16985,7 +17053,7 @@ class pf extends Ty { } = e; if (!(t != null && t[s])) return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${s}. The current chunk will not be buffered.`), null; - const o = t[s], u = o.details, l = a > -1 ? Wp(u, r, a) : null, c = l ? l.fragment : Ry(u, r, i); + const o = t[s], u = o.details, l = a > -1 ? h0(u, r, a) : null, c = l ? l.fragment : zy(u, r, i); return c ? (i && i !== c && (c.stats = i.stats), { frag: c, part: l, @@ -17001,7 +17069,7 @@ class pf extends Ty { data2: u } = e; let l = o; - if (o && u && (l = li(o, u)), !((a = l) != null && a.length)) + if (o && u && (l = fi(o, u)), !((a = l) != null && a.length)) return; const c = this.initPTS[t.cc], h = c ? -c.baseTime / c.timescale : void 0, d = { type: e.type, @@ -17022,28 +17090,28 @@ class pf extends Ty { const t = this.media; if (!t) return; - if (!le.isBuffered(t, t.currentTime)) { + if (!ue.isBuffered(t, t.currentTime)) { this.flushMainBuffer(0, e.start); return; } - const i = t.currentTime, s = le.bufferInfo(t, i, 0), r = e.duration, a = Math.min(this.config.maxFragLookUpTolerance * 2, r * 0.25), o = Math.max(Math.min(e.start - a, s.end - a), i + a); + const i = t.currentTime, s = ue.bufferInfo(t, i, 0), r = e.duration, a = Math.min(this.config.maxFragLookUpTolerance * 2, r * 0.25), o = Math.max(Math.min(e.start - a, s.end - a), i + a); e.start - o > a && this.flushMainBuffer(o, e.start); } getFwdBufferInfo(e, t) { var i; const s = this.getLoadPosition(); - if (!Z(s)) + if (!J(s)) return null; const a = this.lastCurrentTime > s || (i = this.media) != null && i.paused ? 0 : this.config.maxBufferHole; return this.getFwdBufferInfoAtPos(e, s, t, a); } getFwdBufferInfoAtPos(e, t, i, s) { - const r = le.bufferInfo(e, t, s); + const r = ue.bufferInfo(e, t, s); if (r.len === 0 && r.nextStart !== void 0) { const a = this.fragmentTracker.getBufferedFrag(t, i); if (a && (r.nextStart <= a.end || a.gap)) { const o = Math.max(Math.min(r.nextStart, a.end) - t, s); - return le.bufferInfo(e, t, o); + return ue.bufferInfo(e, t, o); } } return r; @@ -17059,7 +17127,7 @@ class pf extends Ty { const i = this.config, s = Math.max(Math.min(e - t, i.maxBufferLength), t), r = Math.max(e - t * 3, i.maxMaxBufferLength / 2, s); return r >= s ? (i.maxMaxBufferLength = r, this.warn(`Reduce max buffer length to ${r}s`), !0) : !1; } - getAppendedFrag(e, t = J.MAIN) { + getAppendedFrag(e, t = te.MAIN) { var i; const s = (i = this.fragmentTracker) == null ? void 0 : i.getAppendedFrag(e, t); return s && "fragment" in s ? s.fragment : s; @@ -17096,7 +17164,7 @@ class pf extends Ty { } isLoopLoading(e, t) { const i = this.fragmentTracker.getState(e); - return (i === Ze.OK || i === Ze.PARTIAL && !!e.gap) && this.nextLoadPosition > t; + return (i === nt.OK || i === nt.PARTIAL && !!e.gap) && this.nextLoadPosition > t; } getNextFragmentLoopLoading(e, t, i, s, r) { let a = null; @@ -17110,7 +17178,7 @@ class pf extends Ty { return this.loopSn = void 0, a; } get primaryPrefetch() { - if (Xp(this.hls.config)) { + if (f0(this.hls.config)) { var e, t; if ((e = this.hls.interstitialsManager) == null || (t = e.playingItem) == null ? void 0 : t.event) return !0; @@ -17120,7 +17188,7 @@ class pf extends Ty { filterReplacedPrimary(e, t) { if (!e) return e; - if (Xp(this.hls.config) && e.type !== J.SUBTITLE) { + if (f0(this.hls.config) && e.type !== te.SUBTITLE) { const i = this.hls.interstitialsManager, s = i == null ? void 0 : i.bufferingItem; if (s) { const a = s.event; @@ -17167,13 +17235,13 @@ class pf extends Ty { const t = e.fragments, i = this.fragPrevious; let s = null; if (i) { - if (e.hasProgramDateTime && (this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`), s = yk(t, i.endProgramDateTime, this.config.maxFragLookUpTolerance)), !s) { + if (e.hasProgramDateTime && (this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`), s = Hk(t, i.endProgramDateTime, this.config.maxFragLookUpTolerance)), !s) { const r = i.sn + 1; if (r >= e.startSN && r <= e.endSN) { const a = t[r - e.startSN]; i.cc === a.cc && (s = a, this.log(`Live playlist, switching playlist, load frag with next SN: ${s.sn}`)); } - s || (s = by(e, i.cc, i.end), s && this.log(`Live playlist, switching playlist, load frag with same CC: ${s.sn}`)); + s || (s = $y(e, i.cc, i.end), s && this.log(`Live playlist, switching playlist, load frag with same CC: ${s.sn}`)); } } else { const r = this.hls.liveSyncPosition; @@ -17204,14 +17272,14 @@ class pf extends Ty { if (e < t) { var f; const g = e < this.lastCurrentTime || e > t - l || (f = this.media) != null && f.paused || !this.startFragRequested ? 0 : l; - d = ws(r, a, e, g); + d = Bs(r, a, e, g); } else d = a[a.length - 1]; if (d) { const m = d.sn - i.startSN, g = this.fragmentTracker.getState(d); - if ((g === Ze.OK || g === Ze.PARTIAL && d.gap) && (r = d), r && d.sn === r.sn && (!h || c[0].fragment.sn > d.sn || !i.live && !h) && r && d.level === r.level) { + if ((g === nt.OK || g === nt.PARTIAL && d.gap) && (r = d), r && d.sn === r.sn && (!h || c[0].fragment.sn > d.sn || !i.live && !h) && r && d.level === r.level) { const y = a[m + 1]; - d.sn < o && this.fragmentTracker.getState(y) !== Ze.OK ? d = y : d = null; + d.sn < o && this.fragmentTracker.getState(y) !== nt.OK ? d = y : d = null; } } return d; @@ -17220,9 +17288,9 @@ class pf extends Ty { const s = e.fragments.length; if (!s) return this.warn("No fragments in live playlist"), 0; - const r = e.fragmentStart, a = !t, o = e.alignedSliding && Z(r); + const r = e.fragmentStart, a = !t, o = e.alignedSliding && J(r); if (a || !o && !r) { - nR(i, e); + DR(i, e); const u = e.fragmentStart; return this.log(`Live playlist sliding: ${u.toFixed(2)} start-sn: ${t ? t.startSN : "na"}->${e.startSN} fragments: ${s}`), u; } @@ -17237,7 +17305,7 @@ class pf extends Ty { const s = this.timelineOffset; if (i === -1) { const r = this.startTimeOffset !== null, a = r ? this.startTimeOffset : e.startTimeOffset; - a !== null && Z(a) ? (i = t + a, a < 0 && (i += e.edge), i = Math.min(Math.max(t, i), t + e.totalduration), this.log(`Setting startPosition to ${i} for start time offset ${a} found in ${r ? "multivariant" : "media"} playlist`), this.startPosition = i) : e.live ? (i = this.hls.liveSyncPosition || t, this.log(`Setting startPosition to -1 to start at live edge ${i}`), this.startPosition = -1) : (this.log("setting startPosition to 0 by default"), this.startPosition = i = 0), this.lastCurrentTime = i + s; + a !== null && J(a) ? (i = t + a, a < 0 && (i += e.edge), i = Math.min(Math.max(t, i), t + e.totalduration), this.log(`Setting startPosition to ${i} for start time offset ${a} found in ${r ? "multivariant" : "media"} playlist`), this.startPosition = i) : e.live ? (i = this.hls.liveSyncPosition || t, this.log(`Setting startPosition to -1 to start at live edge ${i}`), this.startPosition = -1) : (this.log("setting startPosition to 0 by default"), this.startPosition = i = 0), this.lastCurrentTime = i + s; } this.nextLoadPosition = i + s; } @@ -17250,7 +17318,7 @@ class pf extends Ty { return (e = this.hls) != null && e.hasEnoughToStart && t ? i = t.currentTime : this.nextLoadPosition >= 0 && (i = this.nextLoadPosition), i; } handleFragLoadAborted(e, t) { - this.transmuxer && e.type === this.playlistType && Ye(e) && e.stats.aborted && (this.log(`Fragment ${e.sn}${t ? " part " + t.index : ""} of ${this.playlistLabel()} ${e.level} was aborted`), this.resetFragmentLoading(e)); + this.transmuxer && e.type === this.playlistType && Ze(e) && e.stats.aborted && (this.log(`Fragment ${e.sn}${t ? " part " + t.index : ""} of ${this.playlistLabel()} ${e.level} was aborted`), this.resetFragmentLoading(e)); } resetFragmentLoading(e) { (!this.fragCurrent || !this.fragContextChanged(e) && this.state !== V.FRAG_LOADING_WAITING_RETRY) && (this.state = V.IDLE); @@ -17268,28 +17336,28 @@ class pf extends Ty { this.warn(`Frag load error must match current frag to retry ${i.url} > ${(s = this.fragCurrent) == null ? void 0 : s.url}`); return; } - const r = t.details === O.FRAG_GAP; + const r = t.details === P.FRAG_GAP; r && this.fragmentTracker.fragBuffered(i, !0); const a = t.errorAction, { action: o, flags: u, retryCount: l = 0, retryConfig: c - } = a || {}, h = !!a && !!c, d = h && o === yt.RetryRequest, f = h && !a.resolved && u === Ei.MoveAllAlternatesMatchingHost; - if (!d && f && Ye(i) && !i.endList) + } = a || {}, h = !!a && !!c, d = h && o === At.RetryRequest, f = h && !a.resolved && u === Ri.MoveAllAlternatesMatchingHost; + if (!d && f && Ze(i) && !i.endList) this.resetFragmentErrors(e), this.treatAsGap(i), a.resolved = !0; else if ((d || f) && l < c.maxNumRetry) { this.resetStartWhenNotLoaded(this.levelLastLoaded); - const m = df(c, l); + const m = Ff(c, l); this.warn(`Fragment ${i.sn} of ${e} ${i.level} errored with ${t.details}, retrying loading ${l + 1}/${c.maxNumRetry} in ${m}ms`), a.resolved = !0, this.retryDate = self.performance.now() + m, this.state = V.FRAG_LOADING_WAITING_RETRY; } else if (c && a) if (this.resetFragmentErrors(e), l < c.maxNumRetry) - !r && o !== yt.RemoveAlternatePermanently && (a.resolved = !0); + !r && o !== At.RemoveAlternatePermanently && (a.resolved = !0); else { this.warn(`${t.details} reached or exceeded max retry (${l})`); return; } - else o === yt.SendAlternateToPenaltyBox ? this.state = V.WAITING_LEVEL : this.state = V.ERROR; + else o === At.SendAlternateToPenaltyBox ? this.state = V.WAITING_LEVEL : this.state = V.ERROR; this.tickImmediate(); } reduceLengthAndFlushBuffer(e) { @@ -17302,12 +17370,12 @@ class pf extends Ty { return !1; } resetFragmentErrors(e) { - e === J.AUDIO && (this.fragCurrent = null), this.hls.hasEnoughToStart || (this.startFragRequested = !1), this.state !== V.STOPPED && (this.state = V.IDLE); + e === te.AUDIO && (this.fragCurrent = null), this.hls.hasEnoughToStart || (this.startFragRequested = !1), this.state !== V.STOPPED && (this.state = V.IDLE); } afterBufferFlushed(e, t, i) { if (!e) return; - const s = le.getBuffered(e); + const s = ue.getBuffered(e); this.fragmentTracker.detectEvictedFragments(t, s, i), this.state === V.ENDED && this.resetLoadingState(); } resetLoadingState() { @@ -17338,7 +17406,7 @@ class pf extends Ty { const h = c.endPTS - c.startPTS; if (h <= 0) return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${h})`), u || !1; - const d = s ? 0 : Ly(r, e, c.startPTS, c.endPTS, c.startDTS, c.endDTS); + const d = s ? 0 : qy(r, e, c.startPTS, c.endPTS, c.startDTS, c.endDTS); return this.hls.trigger(b.LEVEL_PTS_UPDATED, { details: r, level: i, @@ -17355,8 +17423,8 @@ class pf extends Ty { if (i.fragmentError === 0 && this.treatAsGap(e, i), ((o = this.transmuxer) == null ? void 0 : o.error) === null) { const u = new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`); if (this.warn(u.message), this.hls.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.FRAG_PARSING_ERROR, + type: ne.MEDIA_ERROR, + details: P.FRAG_PARSING_ERROR, fatal: !1, error: u, frag: e, @@ -17372,7 +17440,7 @@ class pf extends Ty { }); } playlistLabel() { - return this.playlistType === J.MAIN ? "level" : "track"; + return this.playlistType === te.MAIN ? "level" : "track"; } fragInfo(e, t = !0, i) { var s, r; @@ -17396,10 +17464,10 @@ class pf extends Ty { return this._state; } } -function Xp(n) { +function f0(n) { return !!n.interstitialsController && n.enableInterstitialPlayback !== !1; } -class My { +class Zy { constructor() { this.chunks = [], this.dataLength = 0; } @@ -17413,7 +17481,7 @@ class My { } = this; let i; if (e.length) - e.length === 1 ? i = e[0] : i = rR(e, t); + e.length === 1 ? i = e[0] : i = LR(e, t); else return new Uint8Array(0); return this.reset(), i; } @@ -17421,7 +17489,7 @@ class My { this.chunks.length = 0, this.dataLength = 0; } } -function rR(n, e) { +function LR(n, e) { const t = new Uint8Array(e); let i = 0; for (let s = 0; s < n.length; s++) { @@ -17430,9 +17498,9 @@ function rR(n, e) { } return t; } -var Jc = { exports: {} }, Qp; -function aR() { - return Qp || (Qp = 1, function(n) { +var yh = { exports: {} }, m0; +function IR() { + return m0 || (m0 = 1, function(n) { var e = Object.prototype.hasOwnProperty, t = "~"; function i() { } @@ -17535,15 +17603,15 @@ function aR() { var c; return l ? (c = t ? t + l : l, this._events[c] && a(this, c)) : (this._events = new i(), this._eventsCount = 0), this; }, o.prototype.off = o.prototype.removeListener, o.prototype.addListener = o.prototype.on, o.prefixed = t, o.EventEmitter = o, n.exports = o; - }(Jc)), Jc.exports; + }(yh)), yh.exports; } -var oR = aR(), _f = /* @__PURE__ */ OI(oR); -const Ba = "1.6.7", Sr = {}; -function lR() { +var kR = IR(), Bf = /* @__PURE__ */ sk(kR); +const Xa = "1.6.7", Cr = {}; +function RR() { return typeof __HLS_WORKER_BUNDLE__ == "function"; } -function uR() { - const n = Sr[Ba]; +function CR() { + const n = Cr[Xa]; if (n) return n.clientCount++, n; const e = new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`], { @@ -17553,10 +17621,10 @@ function uR() { objectURL: t, clientCount: 1 }; - return Sr[Ba] = s, s; + return Cr[Xa] = s, s; } -function cR(n) { - const e = Sr[n]; +function FR(n) { + const e = Cr[n]; if (e) return e.clientCount++, e; const t = new self.URL(n, self.location.href).href, s = { @@ -17564,46 +17632,46 @@ function cR(n) { scriptURL: t, clientCount: 1 }; - return Sr[n] = s, s; + return Cr[n] = s, s; } -function hR(n) { - const e = Sr[n || Ba]; +function PR(n) { + const e = Cr[n || Xa]; if (e && e.clientCount-- === 1) { const { worker: i, objectURL: s } = e; - delete Sr[n || Ba], s && self.URL.revokeObjectURL(s), i.terminate(); + delete Cr[n || Xa], s && self.URL.revokeObjectURL(s), i.terminate(); } } -function $y(n, e) { +function Jy(n, e) { return e + 10 <= n.length && n[e] === 51 && n[e + 1] === 68 && n[e + 2] === 73 && n[e + 3] < 255 && n[e + 4] < 255 && n[e + 6] < 128 && n[e + 7] < 128 && n[e + 8] < 128 && n[e + 9] < 128; } -function vf(n, e) { +function Nf(n, e) { return e + 10 <= n.length && n[e] === 73 && n[e + 1] === 68 && n[e + 2] === 51 && n[e + 3] < 255 && n[e + 4] < 255 && n[e + 6] < 128 && n[e + 7] < 128 && n[e + 8] < 128 && n[e + 9] < 128; } -function gu(n, e) { +function Mu(n, e) { let t = 0; return t = (n[e] & 127) << 21, t |= (n[e + 1] & 127) << 14, t |= (n[e + 2] & 127) << 7, t |= n[e + 3] & 127, t; } -function Na(n, e) { +function Qa(n, e) { const t = e; let i = 0; - for (; vf(n, e); ) { + for (; Nf(n, e); ) { i += 10; - const s = gu(n, e + 6); - i += s, $y(n, e + 10) && (i += 10), e += i; + const s = Mu(n, e + 6); + i += s, Jy(n, e + 10) && (i += 10), e += i; } if (i > 0) return n.subarray(t, t + i); } -function dR(n, e, t, i) { +function OR(n, e, t, i) { const s = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350], r = e[t + 2], a = r >> 2 & 15; if (a > 12) { const f = new Error(`invalid ADTS sampling index:${a}`); n.emit(b.ERROR, b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.FRAG_PARSING_ERROR, + type: ne.MEDIA_ERROR, + details: P.FRAG_PARSING_ERROR, fatal: !0, error: f, reason: f.message @@ -17614,7 +17682,7 @@ function dR(n, e, t, i) { let h = a; (o === 5 || o === 29) && (h -= 3); const d = [o << 3 | (h & 14) >> 1, (h & 1) << 7 | u << 3]; - return Ee.log(`manifest codec:${i}, parsed codec:${l}, channels:${u}, rate:${c} (ADTS object type:${o} sampling index:${a})`), { + return Te.log(`manifest codec:${i}, parsed codec:${l}, channels:${u}, rate:${c} (ADTS object type:${o} sampling index:${a})`), { config: d, samplerate: c, channelCount: u, @@ -17623,52 +17691,52 @@ function dR(n, e, t, i) { manifestCodec: i }; } -function By(n, e) { +function eE(n, e) { return n[e] === 255 && (n[e + 1] & 246) === 240; } -function Ny(n, e) { +function tE(n, e) { return n[e + 1] & 1 ? 7 : 9; } -function yf(n, e) { +function Uf(n, e) { return (n[e + 3] & 3) << 11 | n[e + 4] << 3 | (n[e + 5] & 224) >>> 5; } -function fR(n, e) { +function MR(n, e) { return e + 5 < n.length; } -function Kl(n, e) { - return e + 1 < n.length && By(n, e); +function uu(n, e) { + return e + 1 < n.length && eE(n, e); } -function mR(n, e) { - return fR(n, e) && By(n, e) && yf(n, e) <= n.length - e; +function $R(n, e) { + return MR(n, e) && eE(n, e) && Uf(n, e) <= n.length - e; } -function gR(n, e) { - if (Kl(n, e)) { - const t = Ny(n, e); +function BR(n, e) { + if (uu(n, e)) { + const t = tE(n, e); if (e + t >= n.length) return !1; - const i = yf(n, e); + const i = Uf(n, e); if (i <= t) return !1; const s = e + i; - return s === n.length || Kl(n, s); + return s === n.length || uu(n, s); } return !1; } -function Uy(n, e, t, i, s) { +function iE(n, e, t, i, s) { if (!n.samplerate) { - const r = dR(e, t, i, s); + const r = OR(e, t, i, s); if (!r) return; - De(n, r); + we(n, r); } } -function Gy(n) { +function nE(n) { return 1024 * 9e4 / n; } -function pR(n, e) { - const t = Ny(n, e); +function NR(n, e) { + const t = tE(n, e); if (e + t <= n.length) { - const i = yf(n, e) - t; + const i = Uf(n, e) - t; if (i > 0) return { headerLength: t, @@ -17676,8 +17744,8 @@ function pR(n, e) { }; } } -function Hy(n, e, t, i, s) { - const r = Gy(n.samplerate), a = i + s * r, o = pR(e, t); +function sE(n, e, t, i, s) { + const r = nE(n.samplerate), a = i + s * r, o = NR(e, t); let u; if (o) { const { @@ -17705,29 +17773,29 @@ function Hy(n, e, t, i, s) { missing: -1 }; } -function _R(n, e) { - return vf(n, e) && gu(n, e + 6) + 10 <= n.length - e; +function UR(n, e) { + return Nf(n, e) && Mu(n, e + 6) + 10 <= n.length - e; } -function vR(n) { +function GR(n) { return n instanceof ArrayBuffer ? n : n.byteOffset == 0 && n.byteLength == n.buffer.byteLength ? n.buffer : new Uint8Array(n).buffer; } -function eh(n, e = 0, t = 1 / 0) { - return yR(n, e, t, Uint8Array); +function Eh(n, e = 0, t = 1 / 0) { + return HR(n, e, t, Uint8Array); } -function yR(n, e, t, i) { - const s = ER(n); +function HR(n, e, t, i) { + const s = VR(n); let r = 1; "BYTES_PER_ELEMENT" in i && (r = i.BYTES_PER_ELEMENT); - const a = bR(n) ? n.byteOffset : 0, o = (a + n.byteLength) / r, u = (a + e) / r, l = Math.floor(Math.max(0, Math.min(u, o))), c = Math.floor(Math.min(l + Math.max(t, 0), o)); + const a = qR(n) ? n.byteOffset : 0, o = (a + n.byteLength) / r, u = (a + e) / r, l = Math.floor(Math.max(0, Math.min(u, o))), c = Math.floor(Math.min(l + Math.max(t, 0), o)); return new i(s, l, c - l); } -function ER(n) { +function VR(n) { return n instanceof ArrayBuffer ? n : n.buffer; } -function bR(n) { +function qR(n) { return n && n.buffer instanceof ArrayBuffer && n.byteLength !== void 0 && n.byteOffset !== void 0; } -function TR(n) { +function KR(n) { const e = { key: n.type, description: "", @@ -17744,114 +17812,114 @@ function TR(n) { const i = n.data.subarray(1).indexOf(0); if (i === -1) return; - const s = Kt(eh(n.data, 1, i)), r = n.data[2 + i], a = n.data.subarray(3 + i).indexOf(0); + const s = Qt(Eh(n.data, 1, i)), r = n.data[2 + i], a = n.data.subarray(3 + i).indexOf(0); if (a === -1) return; - const o = Kt(eh(n.data, 3 + i, a)); + const o = Qt(Eh(n.data, 3 + i, a)); let u; - return s === "-->" ? u = Kt(eh(n.data, 4 + i + a)) : u = vR(n.data.subarray(4 + i + a)), e.mimeType = s, e.pictureType = r, e.description = o, e.data = u, e; + return s === "-->" ? u = Qt(Eh(n.data, 4 + i + a)) : u = GR(n.data.subarray(4 + i + a)), e.mimeType = s, e.pictureType = r, e.description = o, e.data = u, e; } -function SR(n) { +function jR(n) { if (n.size < 2) return; - const e = Kt(n.data, !0), t = new Uint8Array(n.data.subarray(e.length + 1)); + const e = Qt(n.data, !0), t = new Uint8Array(n.data.subarray(e.length + 1)); return { key: n.type, info: e, data: t.buffer }; } -function AR(n) { +function zR(n) { if (n.size < 2) return; if (n.type === "TXXX") { let t = 1; - const i = Kt(n.data.subarray(t), !0); + const i = Qt(n.data.subarray(t), !0); t += i.length + 1; - const s = Kt(n.data.subarray(t)); + const s = Qt(n.data.subarray(t)); return { key: n.type, info: i, data: s }; } - const e = Kt(n.data.subarray(1)); + const e = Qt(n.data.subarray(1)); return { key: n.type, info: "", data: e }; } -function xR(n) { +function WR(n) { if (n.type === "WXXX") { if (n.size < 2) return; let t = 1; - const i = Kt(n.data.subarray(t), !0); + const i = Qt(n.data.subarray(t), !0); t += i.length + 1; - const s = Kt(n.data.subarray(t)); + const s = Qt(n.data.subarray(t)); return { key: n.type, info: i, data: s }; } - const e = Kt(n.data); + const e = Qt(n.data); return { key: n.type, info: "", data: e }; } -function DR(n) { - return n.type === "PRIV" ? SR(n) : n.type[0] === "W" ? xR(n) : n.type === "APIC" ? TR(n) : AR(n); +function YR(n) { + return n.type === "PRIV" ? jR(n) : n.type[0] === "W" ? WR(n) : n.type === "APIC" ? KR(n) : zR(n); } -function wR(n) { - const e = String.fromCharCode(n[0], n[1], n[2], n[3]), t = gu(n, 4), i = 10; +function XR(n) { + const e = String.fromCharCode(n[0], n[1], n[2], n[3]), t = Mu(n, 4), i = 10; return { type: e, size: t, data: n.subarray(i, i + t) }; } -const qo = 10, LR = 10; -function Vy(n) { +const ul = 10, QR = 10; +function rE(n) { let e = 0; const t = []; - for (; vf(n, e); ) { - const i = gu(n, e + 6); - n[e + 5] >> 6 & 1 && (e += qo), e += qo; + for (; Nf(n, e); ) { + const i = Mu(n, e + 6); + n[e + 5] >> 6 & 1 && (e += ul), e += ul; const s = e + i; - for (; e + LR < s; ) { - const r = wR(n.subarray(e)), a = DR(r); - a && t.push(a), e += r.size + qo; + for (; e + QR < s; ) { + const r = XR(n.subarray(e)), a = YR(r); + a && t.push(a), e += r.size + ul; } - $y(n, e) && (e += qo); + Jy(n, e) && (e += ul); } return t; } -function qy(n) { +function aE(n) { return n && n.key === "PRIV" && n.info === "com.apple.streaming.transportStreamTimestamp"; } -function IR(n) { +function ZR(n) { if (n.data.byteLength === 8) { const e = new Uint8Array(n.data), t = e[3] & 1; let i = (e[4] << 23) + (e[5] << 15) + (e[6] << 7) + e[7]; return i /= 45, t && (i += 4772185884e-2), Math.round(i); } } -function Ef(n) { - const e = Vy(n); +function Gf(n) { + const e = rE(n); for (let t = 0; t < e.length; t++) { const i = e[t]; - if (qy(i)) - return IR(i); + if (aE(i)) + return ZR(i); } } -let Ht = /* @__PURE__ */ function(n) { +let Wt = /* @__PURE__ */ function(n) { return n.audioId3 = "org.id3", n.dateRange = "com.apple.quicktime.HLS", n.emsg = "https://aomedia.org/emsg/ID3", n.misbklv = "urn:misb:KLV:bin:1910.1", n; }({}); -function qi(n = "", e = 9e4) { +function Wi(n = "", e = 9e4) { return { type: n, id: -1, @@ -17862,7 +17930,7 @@ function qi(n = "", e = 9e4) { dropped: 0 }; } -class bf { +class Hf { constructor() { this._audioTrack = void 0, this._id3Track = void 0, this.frameIndex = 0, this.cachedData = null, this.basePTS = null, this.initPTS = null, this.lastPTS = null; } @@ -17890,36 +17958,36 @@ class bf { } // feed incoming data to the front of the parsing pipeline demux(e, t) { - this.cachedData && (e = li(this.cachedData, e), this.cachedData = null); - let i = Na(e, 0), s = i ? i.length : 0, r; - const a = this._audioTrack, o = this._id3Track, u = i ? Ef(i) : void 0, l = e.length; - for ((this.basePTS === null || this.frameIndex === 0 && Z(u)) && (this.basePTS = kR(u, t, this.initPTS), this.lastPTS = this.basePTS), this.lastPTS === null && (this.lastPTS = this.basePTS), i && i.length > 0 && o.samples.push({ + this.cachedData && (e = fi(this.cachedData, e), this.cachedData = null); + let i = Qa(e, 0), s = i ? i.length : 0, r; + const a = this._audioTrack, o = this._id3Track, u = i ? Gf(i) : void 0, l = e.length; + for ((this.basePTS === null || this.frameIndex === 0 && J(u)) && (this.basePTS = JR(u, t, this.initPTS), this.lastPTS = this.basePTS), this.lastPTS === null && (this.lastPTS = this.basePTS), i && i.length > 0 && o.samples.push({ pts: this.lastPTS, dts: this.lastPTS, data: i, - type: Ht.audioId3, + type: Wt.audioId3, duration: Number.POSITIVE_INFINITY }); s < l; ) { if (this.canParse(e, s)) { const c = this.appendFrame(a, e, s); c ? (this.frameIndex++, this.lastPTS = c.sample.pts, s += c.length, r = s) : s = l; - } else _R(e, s) ? (i = Na(e, s), o.samples.push({ + } else UR(e, s) ? (i = Qa(e, s), o.samples.push({ pts: this.lastPTS, dts: this.lastPTS, data: i, - type: Ht.audioId3, + type: Wt.audioId3, duration: Number.POSITIVE_INFINITY }), s += i.length, r = s) : s++; if (s === l && r !== l) { const c = e.slice(r); - this.cachedData ? this.cachedData = li(this.cachedData, c) : this.cachedData = c; + this.cachedData ? this.cachedData = fi(this.cachedData, c) : this.cachedData = c; } } return { audioTrack: a, - videoTrack: qi(), + videoTrack: Wi(), id3Track: o, - textTrack: qi() + textTrack: Wi() }; } demuxSampleAes(e, t, i) { @@ -17929,23 +17997,23 @@ class bf { const t = this.cachedData; return t && (this.cachedData = null, this.demux(t, 0)), { audioTrack: this._audioTrack, - videoTrack: qi(), + videoTrack: Wi(), id3Track: this._id3Track, - textTrack: qi() + textTrack: Wi() }; } destroy() { this.cachedData = null, this._audioTrack = this._id3Track = void 0; } } -const kR = (n, e, t) => { - if (Z(n)) +const JR = (n, e, t) => { + if (J(n)) return n * 90; const i = t ? t.baseTime * 9e4 / t.timescale : 0; return e * 9e4 + i; }; -let Ko = null; -const RR = [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160], CR = [44100, 48e3, 32e3, 22050, 24e3, 16e3, 11025, 12e3, 8e3], FR = [ +let cl = null; +const eC = [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160], tC = [44100, 48e3, 32e3, 22050, 24e3, 16e3, 11025, 12e3, 8e3], iC = [ // MPEG 2.5 [ 0, @@ -17990,7 +18058,7 @@ const RR = [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 3 12 // Layer1 ] -], PR = [ +], nC = [ 0, // Reserved 1, @@ -18000,10 +18068,10 @@ const RR = [32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 3 4 // Layer1 ]; -function Ky(n, e, t, i, s) { +function oE(n, e, t, i, s) { if (t + 24 > e.length) return; - const r = jy(e, t); + const r = lE(e, t); if (r && t + r.frameLength <= e.length) { const a = r.samplesPerFrame * 9e4 / r.sampleRate, o = i + s * a, u = { unit: e.subarray(t, t + r.frameLength), @@ -18017,15 +18085,15 @@ function Ky(n, e, t, i, s) { }; } } -function jy(n, e) { +function lE(n, e) { const t = n[e + 1] >> 3 & 3, i = n[e + 1] >> 1 & 3, s = n[e + 2] >> 4 & 15, r = n[e + 2] >> 2 & 3; if (t !== 1 && s !== 0 && s !== 15 && r !== 3) { - const a = n[e + 2] >> 1 & 1, o = n[e + 3] >> 6, u = t === 3 ? 3 - i : i === 3 ? 3 : 4, l = RR[u * 14 + s - 1] * 1e3, h = CR[(t === 3 ? 0 : t === 2 ? 1 : 2) * 3 + r], d = o === 3 ? 1 : 2, f = FR[t][i], m = PR[i], g = f * 8 * m, p = Math.floor(f * l / h + a) * m; - if (Ko === null) { + const a = n[e + 2] >> 1 & 1, o = n[e + 3] >> 6, u = t === 3 ? 3 - i : i === 3 ? 3 : 4, l = eC[u * 14 + s - 1] * 1e3, h = tC[(t === 3 ? 0 : t === 2 ? 1 : 2) * 3 + r], d = o === 3 ? 1 : 2, f = iC[t][i], m = nC[i], g = f * 8 * m, p = Math.floor(f * l / h + a) * m; + if (cl === null) { const _ = (navigator.userAgent || "").match(/Chrome\/(\d+)/i); - Ko = _ ? parseInt(_[1]) : 0; + cl = _ ? parseInt(_[1]) : 0; } - return !!Ko && Ko <= 87 && i === 2 && l >= 224e3 && o === 0 && (n[e + 3] = n[e + 3] | 128), { + return !!cl && cl <= 87 && i === 2 && l >= 224e3 && o === 0 && (n[e + 3] = n[e + 3] | 128), { sampleRate: h, channelCount: d, frameLength: p, @@ -18033,26 +18101,26 @@ function jy(n, e) { }; } } -function Tf(n, e) { +function Vf(n, e) { return n[e] === 255 && (n[e + 1] & 224) === 224 && (n[e + 1] & 6) !== 0; } -function zy(n, e) { - return e + 1 < n.length && Tf(n, e); +function uE(n, e) { + return e + 1 < n.length && Vf(n, e); } -function OR(n, e) { - return Tf(n, e) && 4 <= n.length - e; +function sC(n, e) { + return Vf(n, e) && 4 <= n.length - e; } -function Wy(n, e) { - if (e + 1 < n.length && Tf(n, e)) { - const i = jy(n, e); +function cE(n, e) { + if (e + 1 < n.length && Vf(n, e)) { + const i = lE(n, e); let s = 4; i != null && i.frameLength && (s = i.frameLength); const r = e + s; - return r === n.length || zy(n, r); + return r === n.length || uE(n, r); } return !1; } -class MR extends bf { +class rC extends Hf { constructor(e, t) { super(), this.observer = void 0, this.config = void 0, this.observer = e, this.config = t; } @@ -18075,26 +18143,26 @@ class MR extends bf { static probe(e, t) { if (!e) return !1; - const i = Na(e, 0); + const i = Qa(e, 0); let s = (i == null ? void 0 : i.length) || 0; - if (Wy(e, s)) + if (cE(e, s)) return !1; for (let r = e.length; s < r; s++) - if (gR(e, s)) + if (BR(e, s)) return t.log("ADTS sync word found !"), !0; return !1; } canParse(e, t) { - return mR(e, t); + return $R(e, t); } appendFrame(e, t, i) { - Uy(e, this.observer, t, i, e.manifestCodec); - const s = Hy(e, t, i, this.basePTS, this.frameIndex); + iE(e, this.observer, t, i, e.manifestCodec); + const s = sE(e, t, i, this.basePTS, this.frameIndex); if (s && s.missing === 0) return s; } } -const Yy = (n, e) => { +const hE = (n, e) => { let t = 0, i = 5; e += i; const s = new Uint32Array(1), r = new Uint32Array(1), a = new Uint8Array(1); @@ -18105,7 +18173,7 @@ const Yy = (n, e) => { } return t; }; -class $R extends bf { +class aC extends Hf { constructor(e) { super(), this.observer = void 0, this.observer = e; } @@ -18128,7 +18196,7 @@ class $R extends bf { return t + 64 < e.length; } appendFrame(e, t, i) { - const s = Xy(e, t, i, this.basePTS, this.frameIndex); + const s = dE(e, t, i, this.basePTS, this.frameIndex); if (s !== -1) return { sample: e.samples[e.samples.length - 1], @@ -18139,15 +18207,15 @@ class $R extends bf { static probe(e) { if (!e) return !1; - const t = Na(e, 0); + const t = Qa(e, 0); if (!t) return !1; const i = t.length; - return e[i] === 11 && e[i + 1] === 119 && Ef(t) !== void 0 && // check the bsid to confirm ac-3 - Yy(e, i) < 16; + return e[i] === 11 && e[i + 1] === 119 && Gf(t) !== void 0 && // check the bsid to confirm ac-3 + hE(e, i) < 16; } } -function Xy(n, e, t, i, s) { +function dE(n, e, t, i, s) { if (t + 8 > e.length || e[t] !== 11 || e[t + 1] !== 119) return -1; const r = e[t + 4] >> 6; @@ -18165,7 +18233,7 @@ function Xy(n, e, t, i, s) { pts: E }), c; } -class BR extends bf { +class oC extends Hf { resetInitSegment(e, t, i, s) { super.resetInitSegment(e, t, i, s), this._audioTrack = { container: "audio/mpeg", @@ -18184,36 +18252,36 @@ class BR extends bf { static probe(e) { if (!e) return !1; - const t = Na(e, 0); + const t = Qa(e, 0); let i = (t == null ? void 0 : t.length) || 0; - if (t && e[i] === 11 && e[i + 1] === 119 && Ef(t) !== void 0 && // check the bsid to confirm ac-3 or ec-3 (not mp3) - Yy(e, i) <= 16) + if (t && e[i] === 11 && e[i + 1] === 119 && Gf(t) !== void 0 && // check the bsid to confirm ac-3 or ec-3 (not mp3) + hE(e, i) <= 16) return !1; for (let s = e.length; i < s; i++) - if (Wy(e, i)) - return Ee.log("MPEG Audio sync word found !"), !0; + if (cE(e, i)) + return Te.log("MPEG Audio sync word found !"), !0; return !1; } canParse(e, t) { - return OR(e, t); + return sC(e, t); } appendFrame(e, t, i) { if (this.basePTS !== null) - return Ky(e, t, i, this.basePTS, this.frameIndex); + return oE(e, t, i, this.basePTS, this.frameIndex); } } -const NR = /\/emsg[-/]ID3/i; -class UR { +const lC = /\/emsg[-/]ID3/i; +class uC { constructor(e, t) { this.remainderData = null, this.timeOffset = 0, this.config = void 0, this.videoTrack = void 0, this.audioTrack = void 0, this.id3Track = void 0, this.txtTrack = void 0, this.config = t; } resetTimeStamp() { } resetInitSegment(e, t, i, s) { - const r = this.videoTrack = qi("video", 1), a = this.audioTrack = qi("audio", 1), o = this.txtTrack = qi("text", 1); - if (this.id3Track = qi("id3", 1), this.timeOffset = 0, !(e != null && e.byteLength)) + const r = this.videoTrack = Wi("video", 1), a = this.audioTrack = Wi("audio", 1), o = this.txtTrack = Wi("text", 1); + if (this.id3Track = Wi("id3", 1), this.timeOffset = 0, !(e != null && e.byteLength)) return; - const u = dy(e); + const u = Ly(e); if (u.video) { const { id: l, @@ -18231,26 +18299,26 @@ class UR { } = u.audio; a.id = l, a.timescale = c, a.codec = h; } - o.id = uy.text, r.sampleDuration = 0, r.duration = a.duration = s; + o.id = xy.text, r.sampleDuration = 0, r.duration = a.duration = s; } resetContiguity() { this.remainderData = null; } static probe(e) { - return UI(e); + return uk(e); } demux(e, t) { this.timeOffset = t; let i = e; const s = this.videoTrack, r = this.txtTrack; if (this.config.progressive) { - this.remainderData && (i = li(this.remainderData, e)); - const o = zI(i); + this.remainderData && (i = fi(this.remainderData, e)); + const o = pk(i); this.remainderData = o.remainder, s.samples = o.valid || new Uint8Array(); } else s.samples = i; const a = this.extractID3Track(s, t); - return r.samples = _p(t, s), { + return r.samples = Pp(t, s), { videoTrack: s, audioTrack: this.audioTrack, id3Track: a, @@ -18261,11 +18329,11 @@ class UR { const e = this.timeOffset, t = this.videoTrack, i = this.txtTrack; t.samples = this.remainderData || new Uint8Array(), this.remainderData = null; const s = this.extractID3Track(t, this.timeOffset); - return i.samples = _p(e, t), { + return i.samples = Pp(e, t), { videoTrack: t, - audioTrack: qi(), + audioTrack: Wi(), id3Track: s, - textTrack: qi() + textTrack: Wi() }; } extractID3Track(e, t) { @@ -18273,9 +18341,9 @@ class UR { if (e.samples.length) { const s = fe(e.samples, ["emsg"]); s && s.forEach((r) => { - const a = YI(r); - if (NR.test(a.schemeIdUri)) { - const o = Zp(a, t); + const a = vk(r); + if (lC.test(a.schemeIdUri)) { + const o = g0(a, t); let u = a.eventDuration === 4294967295 ? Number.POSITIVE_INFINITY : a.eventDuration / a.timeScale; u <= 1e-3 && (u = Number.POSITIVE_INFINITY); const l = a.payload; @@ -18284,17 +18352,17 @@ class UR { len: l.byteLength, dts: o, pts: o, - type: Ht.emsg, + type: Wt.emsg, duration: u }); } else if (this.config.enableEmsgKLVMetadata && a.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")) { - const o = Zp(a, t); + const o = g0(a, t); i.samples.push({ data: a.payload, len: a.payload.byteLength, dts: o, pts: o, - type: Ht.misbklv, + type: Wt.misbklv, duration: Number.POSITIVE_INFINITY }); } @@ -18309,17 +18377,17 @@ class UR { this.config = null, this.remainderData = null, this.videoTrack = this.audioTrack = this.id3Track = this.txtTrack = void 0; } } -function Zp(n, e) { - return Z(n.presentationTime) ? n.presentationTime / n.timeScale : e + n.presentationTimeDelta / n.timeScale; +function g0(n, e) { + return J(n.presentationTime) ? n.presentationTime / n.timeScale : e + n.presentationTimeDelta / n.timeScale; } -class GR { +class cC { constructor(e, t, i) { - this.keyData = void 0, this.decrypter = void 0, this.keyData = i, this.decrypter = new ff(t, { + this.keyData = void 0, this.decrypter = void 0, this.keyData = i, this.decrypter = new Pf(t, { removePKCS7Padding: !1 }); } decryptBuffer(e) { - return this.decrypter.decrypt(e, this.keyData.key.buffer, this.keyData.iv.buffer, Zn.cbc); + return this.decrypter.decrypt(e, this.keyData.key.buffer, this.keyData.iv.buffer, ss.cbc); } // AAC - encrypt all full 16 bytes blocks starting from offset 16 decryptAacSample(e, t, i) { @@ -18358,7 +18426,7 @@ class GR { return e; } decryptAvcSample(e, t, i, s, r) { - const a = fy(r.data), o = this.getAvcEncryptedData(a); + const a = Iy(r.data), o = this.getAvcEncryptedData(a); this.decryptBuffer(o.buffer).then((u) => { r.data = this.getAvcDecryptedUnit(a, u), this.decrypter.isSync() || this.decryptAvcSamples(e, t, i + 1, s); }); @@ -18380,7 +18448,7 @@ class GR { } } } -class Qy { +class fE { constructor() { this.VideoSample = null; } @@ -18443,7 +18511,7 @@ class Qy { o.push(m); } else { const m = this.getLastNalUnit(e.samples); - m && (a && u <= 4 - a && m.state && (m.data = m.data.subarray(0, m.data.byteLength - a)), c > 0 && (m.data = li(m.data, t.subarray(0, c)), m.state = 0)); + m && (a && u <= 4 - a && m.state && (m.data = m.data.subarray(0, m.data.byteLength - a)), c > 0 && (m.data = fi(m.data, t.subarray(0, c)), m.state = 0)); } u < s ? (h = this.getNALuType(t, u), d = u, f = h, r = 0) : r = -1; } else @@ -18459,12 +18527,12 @@ class Qy { } if (o.length === 0) { const m = this.getLastNalUnit(e.samples); - m && (m.data = li(m.data, t)); + m && (m.data = fi(m.data, t)); } return e.naluState = r, o; } } -class Da { +class $a { constructor(e) { this.data = void 0, this.bytesAvailable = void 0, this.word = void 0, this.bitsAvailable = void 0, this.data = e, this.bytesAvailable = e.byteLength, this.word = 0, this.bitsAvailable = 0; } @@ -18484,7 +18552,7 @@ class Da { readBits(e) { let t = Math.min(this.bitsAvailable, e); const i = this.word >>> 32 - t; - if (e > 32 && Ee.error("Cannot read more than 32 bits at a time"), this.bitsAvailable -= t, this.bitsAvailable > 0) + if (e > 32 && Te.error("Cannot read more than 32 bits at a time"), this.bitsAvailable -= t, this.bitsAvailable > 0) this.word <<= t; else if (this.bytesAvailable > 0) this.loadWord(); @@ -18536,7 +18604,7 @@ class Da { return this.readBits(32); } } -class Jp extends Qy { +class p0 extends fE { parsePES(e, t, i, s) { const r = this.parseNALu(e, i.data, s); let a = this.VideoSample, o, u = !1; @@ -18562,7 +18630,7 @@ class Jp extends Qy { o = !0, (c = a) != null && c.frame && !a.key && (this.pushAccessUnit(a, e), a = this.VideoSample = null), a || (a = this.VideoSample = this.createVideoSample(!0, i.pts, i.dts)), a.key = !0, a.frame = !0; break; case 6: { - o = !0, uf(l.data, 1, i.pts, t.samples); + o = !0, kf(l.data, 1, i.pts, t.samples); break; } case 7: { @@ -18601,7 +18669,7 @@ class Jp extends Qy { return e[t] & 31; } readSliceType(e) { - const t = new Da(e); + const t = new $a(e); return t.readUByte(), t.readUEG(), t.readUEG(); } /** @@ -18624,7 +18692,7 @@ class Jp extends Qy { * associated video frames. */ readSPS(e) { - const t = new Da(e); + const t = new $a(e); let i = 0, s = 0, r = 0, a = 0, o, u, l; const c = t.readUByte.bind(t), h = t.readBits.bind(t), d = t.readUEG.bind(t), f = t.readBoolean.bind(t), m = t.skipBits.bind(t), g = t.skipEG.bind(t), p = t.skipUEG.bind(t), y = this.skipScalingList.bind(this); c(); @@ -18643,8 +18711,8 @@ class Jp extends Qy { for (m(1), g(), g(), o = d(), l = 0; l < o; l++) g(); p(), m(1); - const E = d(), T = d(), A = h(1); - A === 0 && m(1), m(1), f() && (i = d(), s = d(), r = d(), a = d()); + const E = d(), T = d(), x = h(1); + x === 0 && m(1), m(1), f() && (i = d(), s = d(), r = d(), a = d()); let S = [1, 1]; if (f() && f()) switch (c()) { @@ -18703,12 +18771,12 @@ class Jp extends Qy { } return { width: Math.ceil((E + 1) * 16 - i * 2 - s * 2), - height: (2 - A) * (T + 1) * 16 - (A ? 2 : 4) * (r + a), + height: (2 - x) * (T + 1) * 16 - (x ? 2 : 4) * (r + a), pixelRatio: S }; } } -class e0 extends Qy { +class _0 extends fE { constructor(...e) { super(...e), this.initVPS = null; } @@ -18745,7 +18813,7 @@ class e0 extends Qy { o = !0, (c = a) != null && c.frame && !a.key && (this.pushAccessUnit(a, e), a = this.VideoSample = null), a || (a = this.VideoSample = this.createVideoSample(!0, i.pts, i.dts)), a.key = !0, a.frame = !0; break; case 39: - o = !0, uf( + o = !0, kf( l.data, 2, // NALu header size @@ -18754,7 +18822,7 @@ class e0 extends Qy { ); break; case 32: - o = !0, e.vps || (typeof e.params != "object" && (e.params = {}), e.params = De(e.params, this.readVPS(l.data)), this.initVPS = l.data), e.vps = [l.data]; + o = !0, e.vps || (typeof e.params != "object" && (e.params = {}), e.params = we(e.params, this.readVPS(l.data)), this.initVPS = l.data), e.vps = [l.data]; break; case 33: if (o = !0, u = !0, e.vps !== void 0 && e.vps[0] !== this.initVPS && e.sps !== void 0 && !this.matchSPS(e.sps[0], l.data) && (this.initVPS = e.vps[0], e.sps = e.pps = void 0), !e.sps) { @@ -18803,7 +18871,7 @@ class e0 extends Qy { super.pushAccessUnit(e, t), this.initVPS && (this.initVPS = null); } readVPS(e) { - const t = new Da(e); + const t = new $a(e); t.readUByte(), t.readUByte(), t.readBits(4), t.skipBits(2), t.readBits(6); const i = t.readBits(3), s = t.readBoolean(); return { @@ -18812,109 +18880,109 @@ class e0 extends Qy { }; } readSPS(e) { - const t = new Da(this.ebsp2rbsp(e)); + const t = new $a(this.ebsp2rbsp(e)); t.readUByte(), t.readUByte(), t.readBits(4); const i = t.readBits(3); t.readBoolean(); const s = t.readBits(2), r = t.readBoolean(), a = t.readBits(5), o = t.readUByte(), u = t.readUByte(), l = t.readUByte(), c = t.readUByte(), h = t.readUByte(), d = t.readUByte(), f = t.readUByte(), m = t.readUByte(), g = t.readUByte(), p = t.readUByte(), y = t.readUByte(), v = [], _ = []; - for (let ae = 0; ae < i; ae++) + for (let se = 0; se < i; se++) v.push(t.readBoolean()), _.push(t.readBoolean()); if (i > 0) - for (let ae = i; ae < 8; ae++) + for (let se = i; se < 8; se++) t.readBits(2); - for (let ae = 0; ae < i; ae++) - v[ae] && (t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte()), _[ae] && t.readUByte(); + for (let se = 0; se < i; se++) + v[se] && (t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte(), t.readUByte()), _[se] && t.readUByte(); t.readUEG(); const E = t.readUEG(); E == 3 && t.skipBits(1); - const T = t.readUEG(), A = t.readUEG(), S = t.readBoolean(); - let D = 0, x = 0, w = 0, I = 0; - S && (D += t.readUEG(), x += t.readUEG(), w += t.readUEG(), I += t.readUEG()); - const R = t.readUEG(), M = t.readUEG(), P = t.readUEG(), K = t.readBoolean(); - for (let ae = K ? 0 : i; ae <= i; ae++) + const T = t.readUEG(), x = t.readUEG(), S = t.readBoolean(); + let D = 0, A = 0, w = 0, I = 0; + S && (D += t.readUEG(), A += t.readUEG(), w += t.readUEG(), I += t.readUEG()); + const M = t.readUEG(), k = t.readUEG(), q = t.readUEG(), K = t.readBoolean(); + for (let se = K ? 0 : i; se <= i; se++) t.skipUEG(), t.skipUEG(), t.skipUEG(); if (t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG(), t.skipUEG(), t.readBoolean() && t.readBoolean()) - for (let he = 0; he < 4; he++) - for (let Se = 0; Se < (he === 3 ? 2 : 6); Se++) + for (let ve = 0; ve < 4; ve++) + for (let Fe = 0; Fe < (ve === 3 ? 2 : 6); Fe++) if (!t.readBoolean()) t.readUEG(); else { - const Lt = Math.min(64, 1 << 4 + (he << 1)); - he > 1 && t.readEG(); - for (let un = 0; un < Lt; un++) + const Ve = Math.min(64, 1 << 4 + (ve << 1)); + ve > 1 && t.readEG(); + for (let Gt = 0; Gt < Ve; Gt++) t.readEG(); } t.readBoolean(), t.readBoolean(), t.readBoolean() && (t.readUByte(), t.skipUEG(), t.skipUEG(), t.readBoolean()); - const U = t.readUEG(); - let j = 0; - for (let ae = 0; ae < U; ae++) { - let he = !1; - if (ae !== 0 && (he = t.readBoolean()), he) { - ae === U && t.readUEG(), t.readBoolean(), t.readUEG(); - let Se = 0; - for (let dt = 0; dt <= j; dt++) { - const Lt = t.readBoolean(); - let un = !1; - Lt || (un = t.readBoolean()), (Lt || un) && Se++; - } - j = Se; + const B = t.readUEG(); + let z = 0; + for (let se = 0; se < B; se++) { + let ve = !1; + if (se !== 0 && (ve = t.readBoolean()), ve) { + se === B && t.readUEG(), t.readBoolean(), t.readUEG(); + let Fe = 0; + for (let Ye = 0; Ye <= z; Ye++) { + const Ve = t.readBoolean(); + let Gt = !1; + Ve || (Gt = t.readBoolean()), (Ve || Gt) && Fe++; + } + z = Fe; } else { - const Se = t.readUEG(), dt = t.readUEG(); - j = Se + dt; - for (let Lt = 0; Lt < Se; Lt++) + const Fe = t.readUEG(), Ye = t.readUEG(); + z = Fe + Ye; + for (let Ve = 0; Ve < Fe; Ve++) t.readUEG(), t.readBoolean(); - for (let Lt = 0; Lt < dt; Lt++) + for (let Ve = 0; Ve < Ye; Ve++) t.readUEG(), t.readBoolean(); } } if (t.readBoolean()) { - const ae = t.readUEG(); - for (let he = 0; he < ae; he++) { - for (let Se = 0; Se < P + 4; Se++) + const se = t.readUEG(); + for (let ve = 0; ve < se; ve++) { + for (let Fe = 0; Fe < q + 4; Fe++) t.readBits(1); t.readBits(1); } } - let L = 0, H = 1, Q = 1, X = !0, C = 1, B = 0; + let L = 0, $ = 1, Q = 1, C = !0, O = 1, N = 0; t.readBoolean(), t.readBoolean(); - let N = !1; + let ee = !1; if (t.readBoolean()) { if (t.readBoolean()) { - const cn = t.readUByte(), Cs = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2], Pi = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1]; - cn > 0 && cn < 16 ? (H = Cs[cn - 1], Q = Pi[cn - 1]) : cn === 255 && (H = t.readBits(16), Q = t.readBits(16)); - } - if (t.readBoolean() && t.readBoolean(), t.readBoolean() && (t.readBits(3), t.readBoolean(), t.readBoolean() && (t.readUByte(), t.readUByte(), t.readUByte())), t.readBoolean() && (t.readUEG(), t.readUEG()), t.readBoolean(), t.readBoolean(), t.readBoolean(), N = t.readBoolean(), N && (D += t.readUEG(), x += t.readUEG(), w += t.readUEG(), I += t.readUEG()), t.readBoolean() && (C = t.readBits(32), B = t.readBits(32), t.readBoolean() && t.readUEG(), t.readBoolean())) { - const Pi = t.readBoolean(), hn = t.readBoolean(); - let zt = !1; - (Pi || hn) && (zt = t.readBoolean(), zt && (t.readUByte(), t.readBits(5), t.readBoolean(), t.readBits(5)), t.readBits(4), t.readBits(4), zt && t.readBits(4), t.readBits(5), t.readBits(5), t.readBits(5)); - for (let zr = 0; zr <= i; zr++) { - X = t.readBoolean(); - const lo = X || t.readBoolean(); - let Wr = !1; - lo ? t.readEG() : Wr = t.readBoolean(); - const Fs = Wr ? 1 : t.readUEG() + 1; - if (Pi) - for (let Ln = 0; Ln < Fs; Ln++) - t.readUEG(), t.readUEG(), zt && (t.readUEG(), t.readUEG()), t.skipBits(1); - if (hn) - for (let Ln = 0; Ln < Fs; Ln++) - t.readUEG(), t.readUEG(), zt && (t.readUEG(), t.readUEG()), t.skipBits(1); + const dn = t.readUByte(), Vs = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2], Ni = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1]; + dn > 0 && dn < 16 ? ($ = Vs[dn - 1], Q = Ni[dn - 1]) : dn === 255 && ($ = t.readBits(16), Q = t.readBits(16)); + } + if (t.readBoolean() && t.readBoolean(), t.readBoolean() && (t.readBits(3), t.readBoolean(), t.readBoolean() && (t.readUByte(), t.readUByte(), t.readUByte())), t.readBoolean() && (t.readUEG(), t.readUEG()), t.readBoolean(), t.readBoolean(), t.readBoolean(), ee = t.readBoolean(), ee && (D += t.readUEG(), A += t.readUEG(), w += t.readUEG(), I += t.readUEG()), t.readBoolean() && (O = t.readBits(32), N = t.readBits(32), t.readBoolean() && t.readUEG(), t.readBoolean())) { + const Ni = t.readBoolean(), fn = t.readBoolean(); + let Zt = !1; + (Ni || fn) && (Zt = t.readBoolean(), Zt && (t.readUByte(), t.readBits(5), t.readBoolean(), t.readBits(5)), t.readBits(4), t.readBits(4), Zt && t.readBits(4), t.readBits(5), t.readBits(5), t.readBits(5)); + for (let ea = 0; ea <= i; ea++) { + C = t.readBoolean(); + const wo = C || t.readBoolean(); + let ta = !1; + wo ? t.readEG() : ta = t.readBoolean(); + const qs = ta ? 1 : t.readUEG() + 1; + if (Ni) + for (let Cn = 0; Cn < qs; Cn++) + t.readUEG(), t.readUEG(), Zt && (t.readUEG(), t.readUEG()), t.skipBits(1); + if (fn) + for (let Cn = 0; Cn < qs; Cn++) + t.readUEG(), t.readUEG(), Zt && (t.readUEG(), t.readUEG()), t.skipBits(1); } } t.readBoolean() && (t.readBoolean(), t.readBoolean(), t.readBoolean(), L = t.readUEG()); } - let Y = T, ee = A; - if (S || N) { - let ae = 1, he = 1; - E === 1 ? ae = he = 2 : E == 2 && (ae = 2), Y = T - ae * x - ae * D, ee = A - he * I - he * w; - } - const se = s ? ["A", "B", "C"][s] : "", ye = o << 24 | u << 16 | l << 8 | c; - let Pe = 0; - for (let ae = 0; ae < 32; ae++) - Pe = (Pe | (ye >> ae & 1) << 31 - ae) >>> 0; - let Ke = Pe.toString(16); - return a === 1 && Ke === "2" && (Ke = "6"), { - codecString: `hvc1.${se}${a}.${Ke}.${r ? "H" : "L"}${y}.B0`, + let Z = T, U = x; + if (S || ee) { + let se = 1, ve = 1; + E === 1 ? se = ve = 2 : E == 2 && (se = 2), Z = T - se * A - se * D, U = x - ve * I - ve * w; + } + const re = s ? ["A", "B", "C"][s] : "", j = o << 24 | u << 16 | l << 8 | c; + let Ee = 0; + for (let se = 0; se < 32; se++) + Ee = (Ee | (j >> se & 1) << 31 - se) >>> 0; + let Oe = Ee.toString(16); + return a === 1 && Oe === "2" && (Oe = "6"), { + codecString: `hvc1.${re}${a}.${Oe}.${r ? "H" : "L"}${y}.B0`, params: { general_tier_flag: r, general_profile_idc: a, @@ -18922,23 +18990,23 @@ class e0 extends Qy { general_profile_compatibility_flags: [o, u, l, c], general_constraint_indicator_flags: [h, d, f, m, g, p], general_level_idc: y, - bit_depth: R + 8, - bit_depth_luma_minus8: R, - bit_depth_chroma_minus8: M, + bit_depth: M + 8, + bit_depth_luma_minus8: M, + bit_depth_chroma_minus8: k, min_spatial_segmentation_idc: L, chroma_format_idc: E, frame_rate: { - fixed: X, - fps: B / C + fixed: C, + fps: N / O } }, - width: Y, - height: ee, - pixelRatio: [H, Q] + width: Z, + height: U, + pixelRatio: [$, Q] }; } readPPS(e) { - const t = new Da(this.ebsp2rbsp(e)); + const t = new $a(this.ebsp2rbsp(e)); t.readUByte(), t.readUByte(), t.skipUEG(), t.skipUEG(), t.skipBits(2), t.skipBits(3), t.skipBits(2), t.skipUEG(), t.skipUEG(), t.skipEG(), t.skipBits(2), t.readBoolean() && t.skipUEG(), t.skipEG(), t.skipEG(), t.skipBits(4); const s = t.readBoolean(), r = t.readBoolean(); let a = 1; @@ -18950,23 +19018,23 @@ class e0 extends Qy { return String.fromCharCode.apply(null, e).substr(3) === String.fromCharCode.apply(null, t).substr(3); } } -const nt = 188; -class Hn { +const ct = 188; +class Wn { constructor(e, t, i, s) { this.logger = void 0, this.observer = void 0, this.config = void 0, this.typeSupported = void 0, this.sampleAes = null, this.pmtParsed = !1, this.audioCodec = void 0, this.videoCodec = void 0, this._pmtId = -1, this._videoTrack = void 0, this._audioTrack = void 0, this._id3Track = void 0, this._txtTrack = void 0, this.aacOverFlow = null, this.remainderData = null, this.videoParser = void 0, this.observer = e, this.config = t, this.typeSupported = i, this.logger = s, this.videoParser = null; } static probe(e, t) { - const i = Hn.syncOffset(e); + const i = Wn.syncOffset(e); return i > 0 && t.warn(`MPEG2-TS detected but first sync word found @ offset ${i}`), i !== -1; } static syncOffset(e) { const t = e.length; - let i = Math.min(nt * 5, t - nt) + 1, s = 0; + let i = Math.min(ct * 5, t - ct) + 1, s = 0; for (; s < i; ) { let r = !1, a = -1, o = 0; - for (let u = s; u < t; u += nt) - if (e[u] === 71 && (t - u === nt || e[u + nt] === 71)) { - if (o++, a === -1 && (a = u, a !== 0 && (i = Math.min(a + nt * 99, e.length - nt) + 1)), r || (r = md(e, u) === 0), r && o > 1 && (a === 0 && o > 2 || u + nt > i)) + for (let u = s; u < t; u += ct) + if (e[u] === 71 && (t - u === ct || e[u + ct] === 71)) { + if (o++, a === -1 && (a = u, a !== 0 && (i = Math.min(a + ct * 99, e.length - ct) + 1)), r || (r = Od(e, u) === 0), r && o > 1 && (a === 0 && o > 2 || u + ct > i)) return a; } else { if (o) @@ -18984,7 +19052,7 @@ class Hn { return { container: e === "video" || e === "audio" ? "video/mp2t" : void 0, type: e, - id: uy[e], + id: xy[e], pid: -1, inputTimeScale: 9e4, sequenceNumber: 0, @@ -18998,7 +19066,7 @@ class Hn { * Resets all internal track instances of the demuxer. */ resetInitSegment(e, t, i, s) { - this.pmtParsed = !1, this._pmtId = -1, this._videoTrack = Hn.createTrack("video"), this._videoTrack.duration = s, this._audioTrack = Hn.createTrack("audio", s), this._id3Track = Hn.createTrack("id3"), this._txtTrack = Hn.createTrack("text"), this._audioTrack.segmentCodec = "aac", this.aacOverFlow = null, this.remainderData = null, this.audioCodec = t, this.videoCodec = i; + this.pmtParsed = !1, this._pmtId = -1, this._videoTrack = Wn.createTrack("video"), this._videoTrack.duration = s, this._audioTrack = Wn.createTrack("audio", s), this._id3Track = Wn.createTrack("id3"), this._txtTrack = Wn.createTrack("text"), this._audioTrack.segmentCodec = "aac", this.aacOverFlow = null, this.remainderData = null, this.audioCodec = t, this.videoCodec = i; } resetTimeStamp() { } @@ -19015,36 +19083,36 @@ class Hn { let r; const a = this._videoTrack, o = this._audioTrack, u = this._id3Track, l = this._txtTrack; let c = a.pid, h = a.pesData, d = o.pid, f = u.pid, m = o.pesData, g = u.pesData, p = null, y = this.pmtParsed, v = this._pmtId, _ = e.length; - if (this.remainderData && (e = li(this.remainderData, e), _ = e.length, this.remainderData = null), _ < nt && !s) + if (this.remainderData && (e = fi(this.remainderData, e), _ = e.length, this.remainderData = null), _ < ct && !s) return this.remainderData = e, { audioTrack: o, videoTrack: a, id3Track: u, textTrack: l }; - const E = Math.max(0, Hn.syncOffset(e)); - _ -= (_ - E) % nt, _ < e.byteLength && !s && (this.remainderData = new Uint8Array(e.buffer, _, e.buffer.byteLength - _)); + const E = Math.max(0, Wn.syncOffset(e)); + _ -= (_ - E) % ct, _ < e.byteLength && !s && (this.remainderData = new Uint8Array(e.buffer, _, e.buffer.byteLength - _)); let T = 0; - for (let S = E; S < _; S += nt) + for (let S = E; S < _; S += ct) if (e[S] === 71) { - const D = !!(e[S + 1] & 64), x = md(e, S), w = (e[S + 3] & 48) >> 4; + const D = !!(e[S + 1] & 64), A = Od(e, S), w = (e[S + 3] & 48) >> 4; let I; if (w > 1) { - if (I = S + 5 + e[S + 4], I === S + nt) + if (I = S + 5 + e[S + 4], I === S + ct) continue; } else I = S + 4; - switch (x) { + switch (A) { case c: if (D) { - if (h && (r = Qs(h, this.logger))) { + if (h && (r = lr(h, this.logger))) { if (this.videoParser === null) switch (a.segmentCodec) { case "avc": - this.videoParser = new Jp(); + this.videoParser = new p0(); break; case "hevc": - this.videoParser = new e0(); + this.videoParser = new _0(); break; } this.videoParser !== null && this.videoParser.parsePES(a, l, r, !1); @@ -19054,11 +19122,11 @@ class Hn { size: 0 }; } - h && (h.data.push(e.subarray(I, S + nt)), h.size += S + nt - I); + h && (h.data.push(e.subarray(I, S + ct)), h.size += S + ct - I); break; case d: if (D) { - if (m && (r = Qs(m, this.logger))) + if (m && (r = lr(m, this.logger))) switch (o.segmentCodec) { case "aac": this.parseAACPES(o, r); @@ -19075,40 +19143,40 @@ class Hn { size: 0 }; } - m && (m.data.push(e.subarray(I, S + nt)), m.size += S + nt - I); + m && (m.data.push(e.subarray(I, S + ct)), m.size += S + ct - I); break; case f: - D && (g && (r = Qs(g, this.logger)) && this.parseID3PES(u, r), g = { + D && (g && (r = lr(g, this.logger)) && this.parseID3PES(u, r), g = { data: [], size: 0 - }), g && (g.data.push(e.subarray(I, S + nt)), g.size += S + nt - I); + }), g && (g.data.push(e.subarray(I, S + ct)), g.size += S + ct - I); break; case 0: - D && (I += e[I] + 1), v = this._pmtId = HR(e, I); + D && (I += e[I] + 1), v = this._pmtId = hC(e, I); break; case v: { D && (I += e[I] + 1); - const R = VR(e, I, this.typeSupported, i, this.observer, this.logger); - c = R.videoPid, c > 0 && (a.pid = c, a.segmentCodec = R.segmentVideoCodec), d = R.audioPid, d > 0 && (o.pid = d, o.segmentCodec = R.segmentAudioCodec), f = R.id3Pid, f > 0 && (u.pid = f), p !== null && !y && (this.logger.warn(`MPEG-TS PMT found at ${S} after unknown PID '${p}'. Backtracking to sync byte @${E} to parse all TS packets.`), p = null, S = E - 188), y = this.pmtParsed = !0; + const M = dC(e, I, this.typeSupported, i, this.observer, this.logger); + c = M.videoPid, c > 0 && (a.pid = c, a.segmentCodec = M.segmentVideoCodec), d = M.audioPid, d > 0 && (o.pid = d, o.segmentCodec = M.segmentAudioCodec), f = M.id3Pid, f > 0 && (u.pid = f), p !== null && !y && (this.logger.warn(`MPEG-TS PMT found at ${S} after unknown PID '${p}'. Backtracking to sync byte @${E} to parse all TS packets.`), p = null, S = E - 188), y = this.pmtParsed = !0; break; } case 17: case 8191: break; default: - p = x; + p = A; break; } } else T++; - T > 0 && gd(this.observer, new Error(`Found ${T} TS packet/s that do not start with 0x47`), void 0, this.logger), a.pesData = h, o.pesData = m, u.pesData = g; - const A = { + T > 0 && Md(this.observer, new Error(`Found ${T} TS packet/s that do not start with 0x47`), void 0, this.logger), a.pesData = h, o.pesData = m, u.pesData = g; + const x = { audioTrack: o, videoTrack: a, id3Track: u, textTrack: l }; - return s && this.extractRemainingSamples(A), A; + return s && this.extractRemainingSamples(x), x; } flush() { const { @@ -19131,20 +19199,20 @@ class Hn { textTrack: r } = e, a = i.pesData, o = t.pesData, u = s.pesData; let l; - if (a && (l = Qs(a, this.logger))) { + if (a && (l = lr(a, this.logger))) { if (this.videoParser === null) switch (i.segmentCodec) { case "avc": - this.videoParser = new Jp(); + this.videoParser = new p0(); break; case "hevc": - this.videoParser = new e0(); + this.videoParser = new _0(); break; } this.videoParser !== null && (this.videoParser.parsePES(i, r, l, !0), i.pesData = null); } else i.pesData = a; - if (o && (l = Qs(o, this.logger))) { + if (o && (l = lr(o, this.logger))) { switch (t.segmentCodec) { case "aac": this.parseAACPES(t, l); @@ -19159,10 +19227,10 @@ class Hn { t.pesData = null; } else o != null && o.size && this.logger.log("last AAC PES packet truncated,might overlap between fragments"), t.pesData = o; - u && (l = Qs(u, this.logger)) ? (this.parseID3PES(s, l), s.pesData = null) : s.pesData = u; + u && (l = lr(u, this.logger)) ? (this.parseID3PES(s, l), s.pesData = null) : s.pesData = u; } demuxSampleAes(e, t, i) { - const s = this.demux(e, i, !0, !this.config.progressive), r = this.sampleAes = new GR(this.observer, this.config, t); + const s = this.demux(e, i, !0, !this.config.progressive), r = this.sampleAes = new cC(this.observer, this.config, t); return this.decrypt(s, r); } decrypt(e, t) { @@ -19191,27 +19259,27 @@ class Hn { this.aacOverFlow = null; const h = s.missing, d = s.sample.unit.byteLength; if (h === -1) - r = li(s.sample.unit, r); + r = fi(s.sample.unit, r); else { const f = d - h; s.sample.unit.set(r.subarray(0, h), f), e.samples.push(s.sample), i = s.missing; } } let a, o; - for (a = i, o = r.length; a < o - 1 && !Kl(r, a); a++) + for (a = i, o = r.length; a < o - 1 && !uu(r, a); a++) ; if (a !== i) { let h; const d = a < o - 1; - if (d ? h = `AAC PES did not start with ADTS header,offset:${a}` : h = "No ADTS header found in AAC PES", gd(this.observer, new Error(h), d, this.logger), !d) + if (d ? h = `AAC PES did not start with ADTS header,offset:${a}` : h = "No ADTS header found in AAC PES", Md(this.observer, new Error(h), d, this.logger), !d) return; } - Uy(e, this.observer, r, a, this.audioCodec); + iE(e, this.observer, r, a, this.audioCodec); let u; if (t.pts !== void 0) u = t.pts; else if (s) { - const h = Gy(e.samplerate); + const h = nE(e.samplerate); u = s.sample.pts + h; } else { this.logger.warn("[tsdemuxer]: AAC PES unknown PTS"); @@ -19219,11 +19287,11 @@ class Hn { } let l = 0, c; for (; a < o; ) - if (c = Hy(e, r, a, u, l), a += c.length, c.missing) { + if (c = sE(e, r, a, u, l), a += c.length, c.missing) { this.aacOverFlow = c; break; } else - for (l++; a < o - 1 && !Kl(r, a); a++) + for (l++; a < o - 1 && !uu(r, a); a++) ; } parseMPEGPES(e, t) { @@ -19235,8 +19303,8 @@ class Hn { return; } for (; a < s; ) - if (zy(i, a)) { - const u = Ky(e, i, a, o, r); + if (uE(i, a)) { + const u = oE(e, i, a, o, r); if (u) a += u.length, r++; else @@ -19253,7 +19321,7 @@ class Hn { } const r = i.length; let a = 0, o = 0, u; - for (; o < r && (u = Xy(e, i, o, s, a++)) > 0; ) + for (; o < r && (u = dE(e, i, o, s, a++)) > 0; ) o += u; } } @@ -19262,20 +19330,20 @@ class Hn { this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS"); return; } - const i = De({}, t, { - type: this._videoTrack ? Ht.emsg : Ht.audioId3, + const i = we({}, t, { + type: this._videoTrack ? Wt.emsg : Wt.audioId3, duration: Number.POSITIVE_INFINITY }); e.samples.push(i); } } -function md(n, e) { +function Od(n, e) { return ((n[e + 1] & 31) << 8) + n[e + 2]; } -function HR(n, e) { +function hC(n, e) { return (n[e + 10] & 31) << 8 | n[e + 11]; } -function VR(n, e, t, i, s, r) { +function dC(n, e, t, i, s, r) { const a = { audioPid: -1, videoPid: -1, @@ -19284,11 +19352,11 @@ function VR(n, e, t, i, s, r) { segmentAudioCodec: "aac" }, o = (n[e + 1] & 15) << 8 | n[e + 2], u = e + 3 + o - 4, l = (n[e + 10] & 15) << 8 | n[e + 11]; for (e += 12 + l; e < u; ) { - const c = md(n, e), h = (n[e + 3] & 15) << 8 | n[e + 4]; + const c = Od(n, e), h = (n[e + 3] & 15) << 8 | n[e + 4]; switch (n[e]) { case 207: if (!i) { - th("ADTS AAC", r); + bh("ADTS AAC", r); break; } case 15: @@ -19299,7 +19367,7 @@ function VR(n, e, t, i, s, r) { break; case 219: if (!i) { - th("H.264", r); + bh("H.264", r); break; } case 27: @@ -19311,7 +19379,7 @@ function VR(n, e, t, i, s, r) { break; case 193: if (!i) { - th("AC-3", r); + bh("AC-3", r); break; } case 129: @@ -19333,7 +19401,7 @@ function VR(n, e, t, i, s, r) { break; case 194: case 135: - return gd(s, new Error("Unsupported EC-3 in M2TS found"), void 0, r), a; + return Md(s, new Error("Unsupported EC-3 in M2TS found"), void 0, r), a; case 36: a.videoPid === -1 && (a.videoPid = c, a.segmentVideoCodec = "hevc", r.log("HEVC in M2TS found")); break; @@ -19342,26 +19410,26 @@ function VR(n, e, t, i, s, r) { } return a; } -function gd(n, e, t, i) { +function Md(n, e, t, i) { i.warn(`parsing error: ${e.message}`), n.emit(b.ERROR, b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.FRAG_PARSING_ERROR, + type: ne.MEDIA_ERROR, + details: P.FRAG_PARSING_ERROR, fatal: !1, levelRetry: t, error: e, reason: e.message }); } -function th(n, e) { +function bh(n, e) { e.log(`${n} with AES-128-CBC encryption found in unencrypted stream`); } -function Qs(n, e) { +function lr(n, e) { let t = 0, i, s, r, a, o; const u = n.data; if (!n || n.size === 0) return null; for (; u[0].length < 19 && u.length > 1; ) - u[0] = li(u[0], u[1]), u.splice(1, 1); + u[0] = fi(u[0], u[1]), u.splice(1, 1); if (i = u[0], (i[0] << 16) + (i[1] << 8) + i[2] === 1) { if (s = (i[4] << 8) + i[5], s && s > n.size - 6) return null; @@ -19400,7 +19468,7 @@ function Qs(n, e) { } return null; } -class qR { +class fC { static getSilentFrame(e, t) { switch (e) { case "mp4a.40.2": @@ -19428,7 +19496,7 @@ class qR { } } } -const On = Math.pow(2, 32) - 1; +const Vn = Math.pow(2, 32) - 1; class F { static init() { F.types = { @@ -19695,7 +19763,7 @@ class F { } static mdhd(e, t) { t *= e; - const i = Math.floor(t / (On + 1)), s = Math.floor(t % (On + 1)); + const i = Math.floor(t / (Vn + 1)), s = Math.floor(t % (Vn + 1)); return F.box(F.types.mdhd, new Uint8Array([ 1, // version 1 @@ -19780,7 +19848,7 @@ class F { } static mvhd(e, t) { t *= e; - const i = Math.floor(t / (On + 1)), s = Math.floor(t % (On + 1)), r = new Uint8Array([ + const i = Math.floor(t / (Vn + 1)), s = Math.floor(t % (Vn + 1)), r = new Uint8Array([ 1, // version 1 0, @@ -20194,7 +20262,7 @@ class F { throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`); } static tkhd(e) { - const t = e.id, i = (e.duration || 0) * (e.timescale || 0), s = e.width || 0, r = e.height || 0, a = Math.floor(i / (On + 1)), o = Math.floor(i % (On + 1)); + const t = e.id, i = (e.duration || 0) * (e.timescale || 0), s = e.width || 0, r = e.height || 0, a = Math.floor(i / (Vn + 1)), o = Math.floor(i % (Vn + 1)); return F.box(F.types.tkhd, new Uint8Array([ 1, // version 1 @@ -20309,7 +20377,7 @@ class F { ])); } static traf(e, t) { - const i = F.sdtp(e), s = e.id, r = Math.floor(t / (On + 1)), a = Math.floor(t % (On + 1)); + const i = F.sdtp(e), s = e.id, r = Math.floor(t / (Vn + 1)), a = Math.floor(t % (Vn + 1)); return F.box( F.types.traf, F.box(F.types.tfhd, new Uint8Array([ @@ -20442,7 +20510,7 @@ class F { static initSegment(e) { F.types || F.init(); const t = F.moov(e); - return li(F.FTYP, t); + return fi(F.FTYP, t); } static hvc1(e) { const t = e.params, i = [e.vps, e.sps, e.pps], s = 4, r = new Uint8Array([1, t.general_profile_space << 6 | (t.general_tier_flag ? 32 : 0) | t.general_profile_idc, t.general_profile_compatibility_flags[0], t.general_profile_compatibility_flags[1], t.general_profile_compatibility_flags[2], t.general_profile_compatibility_flags[3], t.general_constraint_indicator_flags[0], t.general_constraint_indicator_flags[1], t.general_constraint_indicator_flags[2], t.general_constraint_indicator_flags[3], t.general_constraint_indicator_flags[4], t.general_constraint_indicator_flags[5], t.general_level_idc, 240 | t.min_spatial_segmentation_idc >> 8, 255 & t.min_spatial_segmentation_idc, 252 | t.parallelismType, 252 | t.chroma_format_idc, 248 | t.bit_depth_luma_minus8, 248 | t.bit_depth_chroma_minus8, 0, parseInt(t.frame_rate.fps), s - 1 | t.temporal_id_nested << 2 | t.num_temporal_layers << 3 | (t.frame_rate.fixed ? 64 : 0), i.length]); @@ -20603,23 +20671,23 @@ F.SMHD = void 0; F.STSD = void 0; F.FTYP = void 0; F.DINF = void 0; -const Zy = 9e4; -function Sf(n, e, t = 1, i = !1) { +const mE = 9e4; +function qf(n, e, t = 1, i = !1) { const s = n * e * t; return i ? Math.round(s) : s; } -function KR(n, e, t = 1, i = !1) { - return Sf(n, e, 1 / t, i); +function mC(n, e, t = 1, i = !1) { + return qf(n, e, 1 / t, i); } -function ua(n, e = !1) { - return Sf(n, 1e3, 1 / Zy, e); +function Ea(n, e = !1) { + return qf(n, 1e3, 1 / mE, e); } -function jR(n, e = 1) { - return Sf(n, Zy, 1 / e); +function gC(n, e = 1) { + return qf(n, mE, 1 / e); } -const zR = 10 * 1e3, WR = 1024, YR = 1152, XR = 1536; -let Zs = null, ih = null; -function t0(n, e, t, i) { +const pC = 10 * 1e3, _C = 1024, vC = 1152, yC = 1536; +let ur = null, Th = null; +function v0(n, e, t, i) { return { duration: e, size: t, @@ -20634,15 +20702,15 @@ function t0(n, e, t, i) { } }; } -class vl extends Fi { +class $l extends Bi { constructor(e, t, i, s) { - if (super("mp4-remuxer", s), this.observer = void 0, this.config = void 0, this.typeSupported = void 0, this.ISGenerated = !1, this._initPTS = null, this._initDTS = null, this.nextVideoTs = null, this.nextAudioTs = null, this.videoSampleDuration = null, this.isAudioContiguous = !1, this.isVideoContiguous = !1, this.videoTrackConfig = void 0, this.observer = e, this.config = t, this.typeSupported = i, this.ISGenerated = !1, Zs === null) { + if (super("mp4-remuxer", s), this.observer = void 0, this.config = void 0, this.typeSupported = void 0, this.ISGenerated = !1, this._initPTS = null, this._initDTS = null, this.nextVideoTs = null, this.nextAudioTs = null, this.videoSampleDuration = null, this.isAudioContiguous = !1, this.isVideoContiguous = !1, this.videoTrackConfig = void 0, this.observer = e, this.config = t, this.typeSupported = i, this.ISGenerated = !1, ur === null) { const a = (navigator.userAgent || "").match(/Chrome\/(\d+)/i); - Zs = a ? parseInt(a[1]) : 0; + ur = a ? parseInt(a[1]) : 0; } - if (ih === null) { + if (Th === null) { const r = navigator.userAgent.match(/Safari\/(\d+)/i); - ih = r ? parseInt(r[1]) : 0; + Th = r ? parseInt(r[1]) : 0; } } destroy() { @@ -20661,7 +20729,7 @@ class vl extends Fi { let t = !1; const i = e[0].pts, s = e.reduce((r, a) => { let o = a.pts, u = o - r; - return u < -4294967296 && (t = !0, o = Zt(o, i), u = o - r), u > 0 ? r : o; + return u < -4294967296 && (t = !0, o = ii(o, i), u = o - r), u > 0 ? r : o; }, i); return t && this.debug("PTS rollover detected"), s; } @@ -20670,34 +20738,34 @@ class vl extends Fi { const y = e.pid > -1, v = t.pid > -1, _ = t.samples.length, E = e.samples.length > 0, T = o && _ > 0 || _ > 1; if ((!y || E) && (!v || T) || this.ISGenerated || o) { if (this.ISGenerated) { - var S, D, x, w; - const P = this.videoTrackConfig; - (P && (t.width !== P.width || t.height !== P.height || ((S = t.pixelRatio) == null ? void 0 : S[0]) !== ((D = P.pixelRatio) == null ? void 0 : D[0]) || ((x = t.pixelRatio) == null ? void 0 : x[1]) !== ((w = P.pixelRatio) == null ? void 0 : w[1])) || !P && T || this.nextAudioTs === null && E) && this.resetInitSegment(); + var S, D, A, w; + const q = this.videoTrackConfig; + (q && (t.width !== q.width || t.height !== q.height || ((S = t.pixelRatio) == null ? void 0 : S[0]) !== ((D = q.pixelRatio) == null ? void 0 : D[0]) || ((A = t.pixelRatio) == null ? void 0 : A[1]) !== ((w = q.pixelRatio) == null ? void 0 : w[1])) || !q && T || this.nextAudioTs === null && E) && this.resetInitSegment(); } this.ISGenerated || (h = this.generateIS(e, t, r, a)); const I = this.isVideoContiguous; - let R = -1, M; - if (T && (R = QR(t.samples), !I && this.config.forceKeyFrameOnDiscontinuity)) - if (m = !0, R > 0) { - this.warn(`Dropped ${R} out of ${_} video samples due to a missing keyframe`); - const P = this.getVideoStartPts(t.samples); - t.samples = t.samples.slice(R), t.dropped += R, p += (t.samples[0].pts - P) / t.inputTimeScale, M = p; - } else R === -1 && (this.warn(`No keyframe found out of ${_} video samples`), m = !1); + let M = -1, k; + if (T && (M = EC(t.samples), !I && this.config.forceKeyFrameOnDiscontinuity)) + if (m = !0, M > 0) { + this.warn(`Dropped ${M} out of ${_} video samples due to a missing keyframe`); + const q = this.getVideoStartPts(t.samples); + t.samples = t.samples.slice(M), t.dropped += M, p += (t.samples[0].pts - q) / t.inputTimeScale, k = p; + } else M === -1 && (this.warn(`No keyframe found out of ${_} video samples`), m = !1); if (this.ISGenerated) { if (E && T) { - const P = this.getVideoStartPts(t.samples), q = (Zt(e.samples[0].pts, P) - P) / t.inputTimeScale; - g += Math.max(0, q), p += Math.max(0, -q); + const q = this.getVideoStartPts(t.samples), H = (ii(e.samples[0].pts, q) - q) / t.inputTimeScale; + g += Math.max(0, H), p += Math.max(0, -H); } if (E) { - if (e.samplerate || (this.warn("regenerate InitSegment as audio detected"), h = this.generateIS(e, t, r, a)), c = this.remuxAudio(e, g, this.isAudioContiguous, a, v || T || u === J.AUDIO ? p : void 0), T) { - const P = c ? c.endPTS - c.startPTS : 0; - t.inputTimeScale || (this.warn("regenerate InitSegment as video detected"), h = this.generateIS(e, t, r, a)), l = this.remuxVideo(t, p, I, P); + if (e.samplerate || (this.warn("regenerate InitSegment as audio detected"), h = this.generateIS(e, t, r, a)), c = this.remuxAudio(e, g, this.isAudioContiguous, a, v || T || u === te.AUDIO ? p : void 0), T) { + const q = c ? c.endPTS - c.startPTS : 0; + t.inputTimeScale || (this.warn("regenerate InitSegment as video detected"), h = this.generateIS(e, t, r, a)), l = this.remuxVideo(t, p, I, q); } } else T && (l = this.remuxVideo(t, p, I, 0)); - l && (l.firstKeyFrame = R, l.independent = R !== -1, l.firstKeyFramePTS = M); + l && (l.firstKeyFrame = M, l.independent = M !== -1, l.firstKeyFramePTS = k); } } - return this.ISGenerated && this._initPTS && this._initDTS && (i.samples.length && (f = Jy(i, r, this._initPTS, this._initDTS)), s.samples.length && (d = eE(s, r, this._initPTS))), { + return this.ISGenerated && this._initPTS && this._initDTS && (i.samples.length && (f = gE(i, r, this._initPTS, this._initDTS)), s.samples.length && (d = pE(s, r, this._initPTS))), { audio: c, video: l, initSegment: h, @@ -20741,7 +20809,7 @@ class vl extends Fi { }, c) if (g = t.id, m = t.inputTimeScale, !l || m !== l.timescale) { const p = this.getVideoStartPts(a), y = Math.round(m * i); - f = Math.min(f, Zt(a[0].dts, p) - y), d = Math.min(d, p - y); + f = Math.min(f, ii(a[0].dts, p) - y), d = Math.min(d, p - y); } else c = !1; this.videoTrackConfig = { @@ -20768,113 +20836,113 @@ class vl extends Fi { const r = e.inputTimeScale, a = e.samples, o = [], u = a.length, l = this._initPTS, c = l.baseTime * r / l.timescale; let h = this.nextVideoTs, d = 8, f = this.videoSampleDuration, m, g, p = Number.POSITIVE_INFINITY, y = Number.NEGATIVE_INFINITY, v = !1; if (!i || h === null) { - const L = c + t * r, H = a[0].pts - Zt(a[0].dts, a[0].pts); - Zs && h !== null && Math.abs(L - H - (h + c)) < 15e3 ? i = !0 : h = L - H - c; + const L = c + t * r, $ = a[0].pts - ii(a[0].dts, a[0].pts); + ur && h !== null && Math.abs(L - $ - (h + c)) < 15e3 ? i = !0 : h = L - $ - c; } const _ = h + c; for (let L = 0; L < u; L++) { - const H = a[L]; - H.pts = Zt(H.pts, _), H.dts = Zt(H.dts, _), H.dts < a[L > 0 ? L - 1 : L].dts && (v = !0); + const $ = a[L]; + $.pts = ii($.pts, _), $.dts = ii($.dts, _), $.dts < a[L > 0 ? L - 1 : L].dts && (v = !0); } - v && a.sort(function(L, H) { - const Q = L.dts - H.dts, X = L.pts - H.pts; - return Q || X; + v && a.sort(function(L, $) { + const Q = L.dts - $.dts, C = L.pts - $.pts; + return Q || C; }), m = a[0].dts, g = a[a.length - 1].dts; const E = g - m, T = E ? Math.round(E / (u - 1)) : f || e.inputTimeScale / 30; if (i) { - const L = m - _, H = L > T, Q = L < -1; - if ((H || Q) && (H ? this.warn(`${(e.segmentCodec || "").toUpperCase()}: ${ua(L, !0)} ms (${L}dts) hole between fragments detected at ${t.toFixed(3)}`) : this.warn(`${(e.segmentCodec || "").toUpperCase()}: ${ua(-L, !0)} ms (${L}dts) overlapping between fragments detected at ${t.toFixed(3)}`), !Q || _ >= a[0].pts || Zs)) { + const L = m - _, $ = L > T, Q = L < -1; + if (($ || Q) && ($ ? this.warn(`${(e.segmentCodec || "").toUpperCase()}: ${Ea(L, !0)} ms (${L}dts) hole between fragments detected at ${t.toFixed(3)}`) : this.warn(`${(e.segmentCodec || "").toUpperCase()}: ${Ea(-L, !0)} ms (${L}dts) overlapping between fragments detected at ${t.toFixed(3)}`), !Q || _ >= a[0].pts || ur)) { m = _; - const X = a[0].pts - L; - if (H) - a[0].dts = m, a[0].pts = X; + const C = a[0].pts - L; + if ($) + a[0].dts = m, a[0].pts = C; else { - let C = !0; - for (let B = 0; B < a.length && !(a[B].dts > X && C); B++) { - const N = a[B].pts; - if (a[B].dts -= L, a[B].pts -= L, B < a.length - 1) { - const G = a[B + 1].pts, Y = a[B].pts, ee = G <= Y, se = G <= N; - C = ee == se; + let O = !0; + for (let N = 0; N < a.length && !(a[N].dts > C && O); N++) { + const ee = a[N].pts; + if (a[N].dts -= L, a[N].pts -= L, N < a.length - 1) { + const G = a[N + 1].pts, Z = a[N].pts, U = G <= Z, re = G <= ee; + O = U == re; } } } - this.log(`Video: Initial PTS/DTS adjusted: ${ua(X, !0)}/${ua(m, !0)}, delta: ${ua(L, !0)} ms`); + this.log(`Video: Initial PTS/DTS adjusted: ${Ea(C, !0)}/${Ea(m, !0)}, delta: ${Ea(L, !0)} ms`); } } m = Math.max(0, m); - let A = 0, S = 0, D = m; + let x = 0, S = 0, D = m; for (let L = 0; L < u; L++) { - const H = a[L], Q = H.units, X = Q.length; - let C = 0; - for (let B = 0; B < X; B++) - C += Q[B].data.length; - S += C, A += X, H.length = C, H.dts < D ? (H.dts = D, D += T / 4 | 0 || 1) : D = H.dts, p = Math.min(H.pts, p), y = Math.max(H.pts, y); + const $ = a[L], Q = $.units, C = Q.length; + let O = 0; + for (let N = 0; N < C; N++) + O += Q[N].data.length; + S += O, x += C, $.length = O, $.dts < D ? ($.dts = D, D += T / 4 | 0 || 1) : D = $.dts, p = Math.min($.pts, p), y = Math.max($.pts, y); } g = a[u - 1].dts; - const x = S + 4 * A + 8; + const A = S + 4 * x + 8; let w; try { - w = new Uint8Array(x); + w = new Uint8Array(A); } catch (L) { this.observer.emit(b.ERROR, b.ERROR, { - type: ie.MUX_ERROR, - details: O.REMUX_ALLOC_ERROR, + type: ne.MUX_ERROR, + details: P.REMUX_ALLOC_ERROR, fatal: !1, error: L, - bytes: x, - reason: `fail allocating video mdat ${x}` + bytes: A, + reason: `fail allocating video mdat ${A}` }); return; } const I = new DataView(w.buffer); - I.setUint32(0, x), w.set(F.types.mdat, 4); - let R = !1, M = Number.POSITIVE_INFINITY, P = Number.POSITIVE_INFINITY, K = Number.NEGATIVE_INFINITY, q = Number.NEGATIVE_INFINITY; + I.setUint32(0, A), w.set(F.types.mdat, 4); + let M = !1, k = Number.POSITIVE_INFINITY, q = Number.POSITIVE_INFINITY, K = Number.NEGATIVE_INFINITY, H = Number.NEGATIVE_INFINITY; for (let L = 0; L < u; L++) { - const H = a[L], Q = H.units; - let X = 0; - for (let N = 0, G = Q.length; N < G; N++) { - const Y = Q[N], ee = Y.data, se = Y.data.byteLength; - I.setUint32(d, se), d += 4, w.set(ee, d), d += se, X += 4 + se; + const $ = a[L], Q = $.units; + let C = 0; + for (let ee = 0, G = Q.length; ee < G; ee++) { + const Z = Q[ee], U = Z.data, re = Z.data.byteLength; + I.setUint32(d, re), d += 4, w.set(U, d), d += re, C += 4 + re; } - let C; + let O; if (L < u - 1) - f = a[L + 1].dts - H.dts, C = a[L + 1].pts - H.pts; + f = a[L + 1].dts - $.dts, O = a[L + 1].pts - $.pts; else { - const N = this.config, G = L > 0 ? H.dts - a[L - 1].dts : T; - if (C = L > 0 ? H.pts - a[L - 1].pts : T, N.stretchShortVideoTrack && this.nextAudioTs !== null) { - const Y = Math.floor(N.maxBufferHole * r), ee = (s ? p + s * r : this.nextAudioTs + c) - H.pts; - ee > Y ? (f = ee - G, f < 0 ? f = G : R = !0, this.log(`It is approximately ${ee / 90} ms to the next segment; using duration ${f / 90} ms for the last video frame.`)) : f = G; + const ee = this.config, G = L > 0 ? $.dts - a[L - 1].dts : T; + if (O = L > 0 ? $.pts - a[L - 1].pts : T, ee.stretchShortVideoTrack && this.nextAudioTs !== null) { + const Z = Math.floor(ee.maxBufferHole * r), U = (s ? p + s * r : this.nextAudioTs + c) - $.pts; + U > Z ? (f = U - G, f < 0 ? f = G : M = !0, this.log(`It is approximately ${U / 90} ms to the next segment; using duration ${f / 90} ms for the last video frame.`)) : f = G; } else f = G; } - const B = Math.round(H.pts - H.dts); - M = Math.min(M, f), K = Math.max(K, f), P = Math.min(P, C), q = Math.max(q, C), o.push(t0(H.key, f, X, B)); + const N = Math.round($.pts - $.dts); + k = Math.min(k, f), K = Math.max(K, f), q = Math.min(q, O), H = Math.max(H, O), o.push(v0($.key, f, C, N)); } if (o.length) { - if (Zs) { - if (Zs < 70) { + if (ur) { + if (ur < 70) { const L = o[0].flags; L.dependsOn = 2, L.isNonSync = 0; } - } else if (ih && q - P < K - M && T / K < 0.025 && o[0].cts === 0) { + } else if (Th && H - q < K - k && T / K < 0.025 && o[0].cts === 0) { this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration."); let L = m; - for (let H = 0, Q = o.length; H < Q; H++) { - const X = L + o[H].duration, C = L + o[H].cts; - if (H < Q - 1) { - const B = X + o[H + 1].cts; - o[H].duration = B - C; + for (let $ = 0, Q = o.length; $ < Q; $++) { + const C = L + o[$].duration, O = L + o[$].cts; + if ($ < Q - 1) { + const N = C + o[$ + 1].cts; + o[$].duration = N - O; } else - o[H].duration = H ? o[H - 1].duration : T; - o[H].cts = 0, L = X; + o[$].duration = $ ? o[$ - 1].duration : T; + o[$].cts = 0, L = C; } } } - f = R || !f ? T : f; - const W = g + f; - this.nextVideoTs = h = W - c, this.videoSampleDuration = f, this.isVideoContiguous = !0; - const $ = { - data1: F.moof(e.sequenceNumber++, m, De(e, { + f = M || !f ? T : f; + const Y = g + f; + this.nextVideoTs = h = Y - c, this.videoSampleDuration = f, this.isVideoContiguous = !0; + const W = { + data1: F.moof(e.sequenceNumber++, m, we(e, { samples: o })), data2: w, @@ -20888,107 +20956,107 @@ class vl extends Fi { nb: o.length, dropped: e.dropped }; - return e.samples = [], e.dropped = 0, $; + return e.samples = [], e.dropped = 0, W; } getSamplesPerFrame(e) { switch (e.segmentCodec) { case "mp3": - return YR; + return vC; case "ac3": - return XR; + return yC; default: - return WR; + return _C; } } remuxAudio(e, t, i, s, r) { const a = e.inputTimeScale, o = e.samplerate ? e.samplerate : a, u = a / o, l = this.getSamplesPerFrame(e), c = l * u, h = this._initPTS, d = e.segmentCodec === "mp3" && this.typeSupported.mpeg, f = [], m = r !== void 0; let g = e.samples, p = d ? 0 : 8, y = this.nextAudioTs || -1; const v = h.baseTime * a / h.timescale, _ = v + t * a; - if (this.isAudioContiguous = i = i || g.length && y > 0 && (s && Math.abs(_ - (y + v)) < 9e3 || Math.abs(Zt(g[0].pts, _) - (y + v)) < 20 * c), g.forEach(function(q) { - q.pts = Zt(q.pts, _); + if (this.isAudioContiguous = i = i || g.length && y > 0 && (s && Math.abs(_ - (y + v)) < 9e3 || Math.abs(ii(g[0].pts, _) - (y + v)) < 20 * c), g.forEach(function(H) { + H.pts = ii(H.pts, _); }), !i || y < 0) { - if (g = g.filter((q) => q.pts >= 0), !g.length) + if (g = g.filter((H) => H.pts >= 0), !g.length) return; r === 0 ? y = 0 : s && !m ? y = Math.max(0, _ - v) : y = g[0].pts - v; } if (e.segmentCodec === "aac") { - const q = this.config.maxAudioFramesDrift; - for (let W = 0, U = y + v; W < g.length; W++) { - const j = g[W], $ = j.pts, L = $ - U, H = Math.abs(1e3 * L / a); - if (L <= -q * c && m) - W === 0 && (this.warn(`Audio frame @ ${($ / a).toFixed(3)}s overlaps marker by ${Math.round(1e3 * L / a)} ms.`), this.nextAudioTs = y = $ - v, U = $); - else if (L >= q * c && H < zR && m) { + const H = this.config.maxAudioFramesDrift; + for (let Y = 0, B = y + v; Y < g.length; Y++) { + const z = g[Y], W = z.pts, L = W - B, $ = Math.abs(1e3 * L / a); + if (L <= -H * c && m) + Y === 0 && (this.warn(`Audio frame @ ${(W / a).toFixed(3)}s overlaps marker by ${Math.round(1e3 * L / a)} ms.`), this.nextAudioTs = y = W - v, B = W); + else if (L >= H * c && $ < pC && m) { let Q = Math.round(L / c); - for (U = $ - Q * c; U < 0 && Q && c; ) - Q--, U += c; - W === 0 && (this.nextAudioTs = y = U - v), this.warn(`Injecting ${Q} audio frames @ ${((U - v) / a).toFixed(3)}s due to ${Math.round(1e3 * L / a)} ms gap.`); - for (let X = 0; X < Q; X++) { - let C = qR.getSilentFrame(e.parsedCodec || e.manifestCodec || e.codec, e.channelCount); - C || (this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."), C = j.unit.subarray()), g.splice(W, 0, { - unit: C, - pts: U - }), U += c, W++; + for (B = W - Q * c; B < 0 && Q && c; ) + Q--, B += c; + Y === 0 && (this.nextAudioTs = y = B - v), this.warn(`Injecting ${Q} audio frames @ ${((B - v) / a).toFixed(3)}s due to ${Math.round(1e3 * L / a)} ms gap.`); + for (let C = 0; C < Q; C++) { + let O = fC.getSilentFrame(e.parsedCodec || e.manifestCodec || e.codec, e.channelCount); + O || (this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."), O = z.unit.subarray()), g.splice(Y, 0, { + unit: O, + pts: B + }), B += c, Y++; } } - j.pts = U, U += c; + z.pts = B, B += c; } } - let E = null, T = null, A, S = 0, D = g.length; + let E = null, T = null, x, S = 0, D = g.length; for (; D--; ) S += g[D].unit.byteLength; - for (let q = 0, W = g.length; q < W; q++) { - const U = g[q], j = U.unit; - let $ = U.pts; + for (let H = 0, Y = g.length; H < Y; H++) { + const B = g[H], z = B.unit; + let W = B.pts; if (T !== null) { - const H = f[q - 1]; - H.duration = Math.round(($ - T) / u); - } else if (i && e.segmentCodec === "aac" && ($ = y + v), E = $, S > 0) { + const $ = f[H - 1]; + $.duration = Math.round((W - T) / u); + } else if (i && e.segmentCodec === "aac" && (W = y + v), E = W, S > 0) { S += p; try { - A = new Uint8Array(S); - } catch (H) { + x = new Uint8Array(S); + } catch ($) { this.observer.emit(b.ERROR, b.ERROR, { - type: ie.MUX_ERROR, - details: O.REMUX_ALLOC_ERROR, + type: ne.MUX_ERROR, + details: P.REMUX_ALLOC_ERROR, fatal: !1, - error: H, + error: $, bytes: S, reason: `fail allocating audio mdat ${S}` }); return; } - d || (new DataView(A.buffer).setUint32(0, S), A.set(F.types.mdat, 4)); + d || (new DataView(x.buffer).setUint32(0, S), x.set(F.types.mdat, 4)); } else return; - A.set(j, p); - const L = j.byteLength; - p += L, f.push(t0(!0, l, L, 0)), T = $; + x.set(z, p); + const L = z.byteLength; + p += L, f.push(v0(!0, l, L, 0)), T = W; } - const x = f.length; - if (!x) + const A = f.length; + if (!A) return; const w = f[f.length - 1]; y = T - v, this.nextAudioTs = y + u * w.duration; - const I = d ? new Uint8Array(0) : F.moof(e.sequenceNumber++, E / u, De({}, e, { + const I = d ? new Uint8Array(0) : F.moof(e.sequenceNumber++, E / u, we({}, e, { samples: f })); e.samples = []; - const R = (E - v) / a, M = y / a, K = { + const M = (E - v) / a, k = y / a, K = { data1: I, - data2: A, - startPTS: R, - endPTS: M, - startDTS: R, - endDTS: M, + data2: x, + startPTS: M, + endPTS: k, + startDTS: M, + endDTS: k, type: "audio", hasAudio: !0, hasVideo: !1, - nb: x + nb: A }; return this.isAudioContiguous = !0, K; } } -function Zt(n, e) { +function ii(n, e) { let t; if (e === null) return n; @@ -20996,34 +21064,34 @@ function Zt(n, e) { n += t; return n; } -function QR(n) { +function EC(n) { for (let e = 0; e < n.length; e++) if (n[e].key) return e; return -1; } -function Jy(n, e, t, i) { +function gE(n, e, t, i) { const s = n.samples.length; if (!s) return; const r = n.inputTimeScale; for (let o = 0; o < s; o++) { const u = n.samples[o]; - u.pts = Zt(u.pts - t.baseTime * r / t.timescale, e * r) / r, u.dts = Zt(u.dts - i.baseTime * r / i.timescale, e * r) / r; + u.pts = ii(u.pts - t.baseTime * r / t.timescale, e * r) / r, u.dts = ii(u.dts - i.baseTime * r / i.timescale, e * r) / r; } const a = n.samples; return n.samples = [], { samples: a }; } -function eE(n, e, t) { +function pE(n, e, t) { const i = n.samples.length; if (!i) return; const s = n.inputTimeScale; for (let a = 0; a < i; a++) { const o = n.samples[a]; - o.pts = Zt(o.pts - t.baseTime * s / t.timescale, e * s) / s; + o.pts = ii(o.pts - t.baseTime * s / t.timescale, e * s) / s; } n.samples.sort((a, o) => a.pts - o.pts); const r = n.samples; @@ -21031,7 +21099,7 @@ function eE(n, e, t) { samples: r }; } -class ZR extends Fi { +class bC extends Bi { constructor(e, t, i, s) { super("passthrough-remuxer", s), this.emitInitSegment = !1, this.audioCodec = void 0, this.videoCodec = void 0, this.initData = void 0, this.initPTS = null, this.initTracks = void 0, this.lastEndTime = null, this.isVideoContiguous = !1; } @@ -21046,7 +21114,7 @@ class ZR extends Fi { this.isVideoContiguous = !1, this.lastEndTime = null; } resetInitSegment(e, t, i, s) { - this.audioCodec = t, this.videoCodec = i, this.generateInitSegment(qI(e, s)), this.emitInitSegment = !0; + this.audioCodec = t, this.videoCodec = i, this.generateInitSegment(fk(e, s)), this.emitInitSegment = !0; } generateInitSegment(e) { let { @@ -21057,8 +21125,8 @@ class ZR extends Fi { this.initTracks = void 0, this.initData = void 0; return; } - const s = this.initData = dy(e); - s.audio && (t = i0(s.audio, Fe.AUDIO, this)), s.video && (i = i0(s.video, Fe.VIDEO, this)); + const s = this.initData = Ly(e); + s.audio && (t = y0(s.audio, Pe.AUDIO, this)), s.video && (i = y0(s.video, Pe.VIDEO, this)); const r = {}; s.audio && s.video ? r.audiovideo = { container: "video/mp4", @@ -21092,7 +21160,7 @@ class ZR extends Fi { id3: i, initSegment: void 0 }; - Z(c) || (c = this.lastEndTime = r || 0); + J(c) || (c = this.lastEndTime = r || 0); const d = t.samples; if (!(d != null && d.length)) return h; @@ -21105,83 +21173,83 @@ class ZR extends Fi { if ((o = m) != null && o.length || (this.generateInitSegment(d), m = this.initData), !((u = m) != null && u.length)) return this.warn("Failed to generate initSegment."), h; this.emitInitSegment && (f.tracks = this.initTracks, this.emitInitSegment = !1); - const g = jI(d, m, this), p = m.audio ? g[m.audio.id] : null, y = m.video ? g[m.video.id] : null, v = jo(y, 1 / 0), _ = jo(p, 1 / 0), E = jo(y, 0, !0), T = jo(p, 0, !0); - let A, S = r, D = 0; - if (p && (!y || !l && _ < v || l && l.trackId === m.audio.id) ? (f.trackId = m.audio.id, A = p, D = T - _) : y && (f.trackId = m.video.id, A = y, D = E - v), A) { - const q = A.timescale; - S = A.start / q, f.initPTS = A.start - r * q, f.timescale = q, l || (this.initPTS = l = { + const g = gk(d, m, this), p = m.audio ? g[m.audio.id] : null, y = m.video ? g[m.video.id] : null, v = hl(y, 1 / 0), _ = hl(p, 1 / 0), E = hl(y, 0, !0), T = hl(p, 0, !0); + let x, S = r, D = 0; + if (p && (!y || !l && _ < v || l && l.trackId === m.audio.id) ? (f.trackId = m.audio.id, x = p, D = T - _) : y && (f.trackId = m.video.id, x = y, D = E - v), x) { + const H = x.timescale; + S = x.start / H, f.initPTS = x.start - r * H, f.timescale = H, l || (this.initPTS = l = { baseTime: f.initPTS, - timescale: q, + timescale: H, trackId: f.trackId }); } - (a || !l) && (JR(l, S, r, D) || f.timescale !== l.timescale) && (f.initPTS = S - r, f.timescale = 1, l && l.timescale === 1 && this.warn(`Adjusting initPTS @${r} from ${l.baseTime / l.timescale} to ${f.initPTS}`), this.initPTS = l = { + (a || !l) && (TC(l, S, r, D) || f.timescale !== l.timescale) && (f.initPTS = S - r, f.timescale = 1, l && l.timescale === 1 && this.warn(`Adjusting initPTS @${r} from ${l.baseTime / l.timescale} to ${f.initPTS}`), this.initPTS = l = { baseTime: f.initPTS, timescale: 1 }); - const x = e ? S - l.baseTime / l.timescale : c, w = x + D; + const A = e ? S - l.baseTime / l.timescale : c, w = A + D; D > 0 ? this.lastEndTime = w : (this.warn("Duration parsed from mp4 should be greater than zero"), this.resetNextTimestamp()); - const I = !!m.audio, R = !!m.video; - let M = ""; - I && (M += "audio"), R && (M += "video"); - const P = { + const I = !!m.audio, M = !!m.video; + let k = ""; + I && (k += "audio"), M && (k += "video"); + const q = { data1: d, - startPTS: x, - startDTS: x, + startPTS: A, + startDTS: A, endPTS: w, endDTS: w, - type: M, + type: k, hasAudio: I, - hasVideo: R, + hasVideo: M, nb: 1, dropped: 0 }; - h.audio = I && !R ? P : void 0, h.video = R ? P : void 0; + h.audio = I && !M ? q : void 0, h.video = M ? q : void 0; const K = y == null ? void 0 : y.sampleCount; if (K) { - const q = y.keyFrameIndex, W = q !== -1; - P.nb = K, P.dropped = q === 0 || this.isVideoContiguous ? 0 : W ? q : K, P.independent = W, P.firstKeyFrame = q, W && y.keyFrameStart && (P.firstKeyFramePTS = (y.keyFrameStart - l.baseTime) / l.timescale), this.isVideoContiguous || (h.independent = W), this.isVideoContiguous || (this.isVideoContiguous = W), P.dropped && this.warn(`fmp4 does not start with IDR: firstIDR ${q}/${K} dropped: ${P.dropped} start: ${P.firstKeyFramePTS || "NA"}`); + const H = y.keyFrameIndex, Y = H !== -1; + q.nb = K, q.dropped = H === 0 || this.isVideoContiguous ? 0 : Y ? H : K, q.independent = Y, q.firstKeyFrame = H, Y && y.keyFrameStart && (q.firstKeyFramePTS = (y.keyFrameStart - l.baseTime) / l.timescale), this.isVideoContiguous || (h.independent = Y), this.isVideoContiguous || (this.isVideoContiguous = Y), q.dropped && this.warn(`fmp4 does not start with IDR: firstIDR ${H}/${K} dropped: ${q.dropped} start: ${q.firstKeyFramePTS || "NA"}`); } - return h.initSegment = f, h.id3 = Jy(i, r, l, l), s.samples.length && (h.text = eE(s, r, l)), h; + return h.initSegment = f, h.id3 = gE(i, r, l, l), s.samples.length && (h.text = pE(s, r, l)), h; } } -function jo(n, e, t = !1) { +function hl(n, e, t = !1) { return (n == null ? void 0 : n.start) !== void 0 ? (n.start + (t ? n.duration : 0)) / n.timescale : e; } -function JR(n, e, t, i) { +function TC(n, e, t, i) { if (n === null) return !0; const s = Math.max(i, 1), r = e - n.baseTime / n.timescale; return Math.abs(r - t) > s; } -function i0(n, e, t) { +function y0(n, e, t) { const i = n == null ? void 0 : n.codec; - return i && i.length > 4 ? i : e === Fe.AUDIO ? i === "ec-3" || i === "ac-3" || i === "alac" ? i : i === "fLaC" || i === "Opus" ? Bl(i, !1) : (t.warn(`Unhandled audio codec "${i}" in mp4 MAP`), i || "mp4a") : (t.warn(`Unhandled video codec "${i}" in mp4 MAP`), i || "avc1"); + return i && i.length > 4 ? i : e === Pe.AUDIO ? i === "ec-3" || i === "ac-3" || i === "alac" ? i : i === "fLaC" || i === "Opus" ? iu(i, !1) : (t.warn(`Unhandled audio codec "${i}" in mp4 MAP`), i || "mp4a") : (t.warn(`Unhandled video codec "${i}" in mp4 MAP`), i || "avc1"); } -let Tn; +let Sn; try { - Tn = self.performance.now.bind(self.performance); + Sn = self.performance.now.bind(self.performance); } catch { - Tn = Date.now; + Sn = Date.now; } -const yl = [{ - demux: UR, - remux: ZR +const Bl = [{ + demux: uC, + remux: bC }, { - demux: Hn, - remux: vl + demux: Wn, + remux: $l }, { - demux: MR, - remux: vl + demux: rC, + remux: $l }, { - demux: BR, - remux: vl + demux: oC, + remux: $l }]; -yl.splice(2, 0, { - demux: $R, - remux: vl +Bl.splice(2, 0, { + demux: aC, + remux: $l }); -class n0 { +class E0 { constructor(e, t, i, s, r, a) { this.asyncResult = !1, this.logger = void 0, this.observer = void 0, this.typeSupported = void 0, this.config = void 0, this.id = void 0, this.demuxer = void 0, this.remuxer = void 0, this.decrypter = void 0, this.probe = void 0, this.decryptionPromise = null, this.transmuxConfig = void 0, this.currentTransmuxState = void 0, this.observer = e, this.typeSupported = t, this.config = i, this.id = r, this.logger = a; } @@ -21190,7 +21258,7 @@ class n0 { } push(e, t, i, s) { const r = i.transmuxing; - r.executeStart = Tn(); + r.executeStart = Sn(); let a = new Uint8Array(e); const { currentTransmuxState: o, @@ -21210,20 +21278,20 @@ class n0 { defaultInitPts: y, duration: v, initSegmentData: _ - } = u, E = eC(a, t); - if (E && fr(E.method)) { - const D = this.getDecrypter(), x = gf(E.method); + } = u, E = SC(a, t); + if (E && xr(E.method)) { + const D = this.getDecrypter(), A = Mf(E.method); if (D.isSync()) { - let w = D.softwareDecrypt(a, E.key.buffer, E.iv.buffer, x); + let w = D.softwareDecrypt(a, E.key.buffer, E.iv.buffer, A); if (i.part > -1) { - const R = D.flush(); - w = R && R.buffer; + const M = D.flush(); + w = M && M.buffer; } if (!w) - return r.executeEnd = Tn(), nh(i); + return r.executeEnd = Sn(), Sh(i); a = new Uint8Array(w); } else - return this.asyncResult = !0, this.decryptionPromise = D.webCryptoDecrypt(a, E.key.buffer, E.iv.buffer, x).then((w) => { + return this.asyncResult = !0, this.decryptionPromise = D.webCryptoDecrypt(a, E.key.buffer, E.iv.buffer, A).then((w) => { const I = this.push(w, null, i); return this.decryptionPromise = null, I; }), this.decryptionPromise; @@ -21233,23 +21301,23 @@ class n0 { const D = this.configureTransmuxer(a); if (D) return this.logger.warn(`[transmuxer] ${D.message}`), this.observer.emit(b.ERROR, b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.FRAG_PARSING_ERROR, + type: ne.MEDIA_ERROR, + details: P.FRAG_PARSING_ERROR, fatal: !1, error: D, reason: D.message - }), r.executeEnd = Tn(), nh(i); + }), r.executeEnd = Sn(), Sh(i); } (c || h || m || T) && this.resetInitSegment(_, g, p, v, t), (c || m || T) && this.resetInitialTimestamp(y), l || this.resetContiguity(); - const A = this.transmux(a, E, f, d, i); - this.asyncResult = Ua(A); + const x = this.transmux(a, E, f, d, i); + this.asyncResult = Za(x); const S = this.currentTransmuxState; - return S.contiguous = !0, S.discontinuity = !1, S.trackSwitch = !1, r.executeEnd = Tn(), A; + return S.contiguous = !0, S.discontinuity = !1, S.trackSwitch = !1, r.executeEnd = Sn(), x; } // Due to data caching, flush calls can produce more than one TransmuxerResult (hence the Array type) flush(e) { const t = e.transmuxing; - t.executeStart = Tn(); + t.executeStart = Sn(); const { decrypter: i, currentTransmuxState: s, @@ -21269,12 +21337,12 @@ class n0 { remuxer: l } = this; if (!u || !l) { - t.executeEnd = Tn(); - const h = [nh(e)]; + t.executeEnd = Sn(); + const h = [Sh(e)]; return this.asyncResult ? Promise.resolve(h) : h; } const c = u.flush(o); - return Ua(c) ? (this.asyncResult = !0, c.then((h) => (this.flushRemux(a, h, e), a))) : (this.flushRemux(a, c, e), this.asyncResult ? Promise.resolve(a) : a); + return Za(c) ? (this.asyncResult = !0, c.then((h) => (this.flushRemux(a, h, e), a))) : (this.flushRemux(a, c, e), this.asyncResult ? Promise.resolve(a) : a); } flushRemux(e, t, i) { const { @@ -21286,12 +21354,12 @@ class n0 { accurateTimeOffset: u, timeOffset: l } = this.currentTransmuxState; - this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${i.sn}${i.part > -1 ? " part: " + i.part : ""} of ${this.id === J.MAIN ? "level" : "track"} ${i.level}`); + this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${i.sn}${i.part > -1 ? " part: " + i.part : ""} of ${this.id === te.MAIN ? "level" : "track"} ${i.level}`); const c = this.remuxer.remux(s, r, a, o, l, u, !0, this.id); e.push({ remuxResult: c, chunkMeta: i - }), i.transmuxing.executeEnd = Tn(); + }), i.transmuxing.executeEnd = Sn(); } resetInitialTimestamp(e) { const { @@ -21346,10 +21414,10 @@ class n0 { typeSupported: s } = this; let r; - for (let h = 0, d = yl.length; h < d; h++) { + for (let h = 0, d = Bl.length; h < d; h++) { var a; - if ((a = yl[h].demux) != null && a.probe(e, this.logger)) { - r = yl[h]; + if ((a = Bl[h].demux) != null && a.probe(e, this.logger)) { + r = Bl[h]; break; } } @@ -21363,34 +21431,34 @@ class n0 { } getDecrypter() { let e = this.decrypter; - return e || (e = this.decrypter = new ff(this.config)), e; + return e || (e = this.decrypter = new Pf(this.config)), e; } } -function eC(n, e) { +function SC(n, e) { let t = null; return n.byteLength > 0 && (e == null ? void 0 : e.key) != null && e.iv !== null && e.method != null && (t = e), t; } -const nh = (n) => ({ +const Sh = (n) => ({ remuxResult: {}, chunkMeta: n }); -function Ua(n) { +function Za(n) { return "then" in n && n.then instanceof Function; } -class tC { +class AC { constructor(e, t, i, s, r) { this.audioCodec = void 0, this.videoCodec = void 0, this.initSegmentData = void 0, this.duration = void 0, this.defaultInitPts = void 0, this.audioCodec = e, this.videoCodec = t, this.initSegmentData = i, this.duration = s, this.defaultInitPts = r || null; } } -class iC { +class xC { constructor(e, t, i, s, r, a) { this.discontinuity = void 0, this.contiguous = void 0, this.accurateTimeOffset = void 0, this.trackSwitch = void 0, this.timeOffset = void 0, this.initSegmentChange = void 0, this.discontinuity = e, this.contiguous = t, this.accurateTimeOffset = i, this.trackSwitch = s, this.timeOffset = r, this.initSegmentChange = a; } } -let s0 = 0; -class tE { +let b0 = 0; +class _E { constructor(e, t, i, s) { - this.error = null, this.hls = void 0, this.id = void 0, this.instanceNo = s0++, this.observer = void 0, this.frag = null, this.part = null, this.useWorker = void 0, this.workerContext = null, this.transmuxer = null, this.onTransmuxComplete = void 0, this.onFlush = void 0, this.onWorkerMessage = (u) => { + this.error = null, this.hls = void 0, this.id = void 0, this.instanceNo = b0++, this.observer = void 0, this.frag = null, this.part = null, this.useWorker = void 0, this.workerContext = null, this.transmuxer = null, this.onTransmuxComplete = void 0, this.onFlush = void 0, this.onWorkerMessage = (u) => { const l = u.data, c = this.hls; if (!(!c || !(l != null && l.event) || l.instanceNo !== this.instanceNo)) switch (l.event) { @@ -21422,8 +21490,8 @@ class tE { return; const l = new Error(`${u.message} (${u.filename}:${u.lineno})`); this.hls.config.enableWorker = !1, this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`), this.hls.trigger(b.ERROR, { - type: ie.OTHER_ERROR, - details: O.INTERNAL_EXCEPTION, + type: ne.OTHER_ERROR, + details: P.INTERNAL_EXCEPTION, fatal: !1, event: "demuxerWorker", error: l @@ -21434,13 +21502,13 @@ class tE { const a = (u, l) => { l = l || {}, l.frag = this.frag || void 0, u === b.ERROR && (l = l, l.parent = this.id, l.part = this.part, this.error = l.error), this.hls.trigger(u, l); }; - this.observer = new _f(), this.observer.on(b.FRAG_DECRYPTED, a), this.observer.on(b.ERROR, a); - const o = Ep(r.preferManagedMediaSource); + this.observer = new Bf(), this.observer.on(b.FRAG_DECRYPTED, a), this.observer.on(b.ERROR, a); + const o = $p(r.preferManagedMediaSource); if (this.useWorker && typeof Worker < "u") { const u = this.hls.logger; - if (r.workerPath || lR()) { + if (r.workerPath || RR()) { try { - r.workerPath ? (u.log(`loading Web Worker ${r.workerPath} for "${t}"`), this.workerContext = cR(r.workerPath)) : (u.log(`injecting Web Worker for "${t}"`), this.workerContext = uR()); + r.workerPath ? (u.log(`loading Web Worker ${r.workerPath} for "${t}"`), this.workerContext = FR(r.workerPath)) : (u.log(`injecting Web Worker for "${t}"`), this.workerContext = CR()); const { worker: c } = this.workerContext; @@ -21449,28 +21517,28 @@ class tE { cmd: "init", typeSupported: o, id: t, - config: Oe(r) + config: $e(r) }); } catch (c) { - u.warn(`Error setting up "${t}" Web Worker, fallback to inline`, c), this.terminateWorker(), this.error = null, this.transmuxer = new n0(this.observer, o, r, "", t, e.logger); + u.warn(`Error setting up "${t}" Web Worker, fallback to inline`, c), this.terminateWorker(), this.error = null, this.transmuxer = new E0(this.observer, o, r, "", t, e.logger); } return; } } - this.transmuxer = new n0(this.observer, o, r, "", t, e.logger); + this.transmuxer = new E0(this.observer, o, r, "", t, e.logger); } reset() { if (this.frag = null, this.part = null, this.workerContext) { const e = this.instanceNo; - this.instanceNo = s0++; - const t = this.hls.config, i = Ep(t.preferManagedMediaSource); + this.instanceNo = b0++; + const t = this.hls.config, i = $p(t.preferManagedMediaSource); this.workerContext.worker.postMessage({ instanceNo: this.instanceNo, cmd: "reset", resetNo: e, typeSupported: i, id: this.id, - config: Oe(t) + config: $e(t) }); } } @@ -21479,7 +21547,7 @@ class tE { const { worker: e } = this.workerContext; - this.workerContext = null, e.removeEventListener("message", this.onWorkerMessage), e.removeEventListener("error", this.onWorkerError), hR(this.hls.config.workerPath); + this.workerContext = null, e.removeEventListener("message", this.onWorkerMessage), e.removeEventListener("error", this.onWorkerError), PR(this.hls.config.workerPath); } } destroy() { @@ -21498,18 +21566,18 @@ class tE { const { instanceNo: f, transmuxer: m - } = this, g = a ? a.start : r.start, p = r.decryptdata, y = this.frag, v = !(y && r.cc === y.cc), _ = !(y && l.level === y.level), E = y ? l.sn - y.sn : -1, T = this.part ? l.part - this.part.index : -1, A = E === 0 && l.id > 1 && l.id === (y == null ? void 0 : y.stats.chunkCount), S = !_ && (E === 1 || E === 0 && (T === 1 || A && T <= 0)), D = self.performance.now(); + } = this, g = a ? a.start : r.start, p = r.decryptdata, y = this.frag, v = !(y && r.cc === y.cc), _ = !(y && l.level === y.level), E = y ? l.sn - y.sn : -1, T = this.part ? l.part - this.part.index : -1, x = E === 0 && l.id > 1 && l.id === (y == null ? void 0 : y.stats.chunkCount), S = !_ && (E === 1 || E === 0 && (T === 1 || x && T <= 0)), D = self.performance.now(); (_ || E || r.stats.parsing.start === 0) && (r.stats.parsing.start = D), a && (T || !S) && (a.stats.parsing.start = D); - const x = !(y && ((h = r.initSegment) == null ? void 0 : h.url) === ((d = y.initSegment) == null ? void 0 : d.url)), w = new iC(v, S, u, _, g, x); - if (!S || v || x) { - this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part > -1 ? " part: " + l.part : ""} ${this.id === J.MAIN ? "level" : "track"}: ${l.level} id: ${l.id} + const A = !(y && ((h = r.initSegment) == null ? void 0 : h.url) === ((d = y.initSegment) == null ? void 0 : d.url)), w = new xC(v, S, u, _, g, A); + if (!S || v || A) { + this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part > -1 ? " part: " + l.part : ""} ${this.id === te.MAIN ? "level" : "track"}: ${l.level} id: ${l.id} discontinuity: ${v} trackSwitch: ${_} contiguous: ${S} accurateTimeOffset: ${u} timeOffset: ${g} - initSegmentChange: ${x}`); - const I = new tC(i, s, t, o, c); + initSegmentChange: ${A}`); + const I = new AC(i, s, t, o, c); this.configureTransmuxer(I); } if (this.frag = r, this.part = a, this.workerContext) @@ -21523,10 +21591,10 @@ class tE { }, e instanceof ArrayBuffer ? [e] : []); else if (m) { const I = m.push(e, p, l, w); - Ua(I) ? I.then((R) => { - this.handleTransmuxComplete(R); - }).catch((R) => { - this.transmuxerError(R, l, "transmuxer-interface push error"); + Za(I) ? I.then((M) => { + this.handleTransmuxComplete(M); + }).catch((M) => { + this.transmuxerError(M, l, "transmuxer-interface push error"); }) : this.handleTransmuxComplete(I); } } @@ -21544,7 +21612,7 @@ class tE { }); else if (i) { const s = i.flush(e); - Ua(s) ? s.then((r) => { + Za(s) ? s.then((r) => { this.handleFlushResult(r, e); }).catch((r) => { this.transmuxerError(r, e, "transmuxer-interface flush error"); @@ -21553,8 +21621,8 @@ class tE { } transmuxerError(e, t, i) { this.hls && (this.error = e, this.hls.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.FRAG_PARSING_ERROR, + type: ne.MEDIA_ERROR, + details: P.FRAG_PARSING_ERROR, chunkMeta: t, frag: this.frag || void 0, part: this.part || void 0, @@ -21584,10 +21652,10 @@ class tE { e.chunkMeta.transmuxing.end = self.performance.now(), this.onTransmuxComplete(e); } } -const r0 = 100; -class nC extends pf { +const T0 = 100; +class DC extends $f { constructor(e, t, i) { - super(e, t, i, "audio-stream-controller", J.AUDIO), this.mainAnchor = null, this.mainFragLoading = null, this.audioOnly = !1, this.bufferedTrack = null, this.switchingTrack = null, this.trackId = -1, this.waitingData = null, this.mainDetails = null, this.flushing = !1, this.bufferFlushed = !1, this.cachedTrackLoadedData = null, this.registerListeners(); + super(e, t, i, "audio-stream-controller", te.AUDIO), this.mainAnchor = null, this.mainFragLoading = null, this.audioOnly = !1, this.bufferedTrack = null, this.switchingTrack = null, this.trackId = -1, this.waitingData = null, this.mainDetails = null, this.flushing = !1, this.bufferFlushed = !1, this.cachedTrackLoadedData = null, this.registerListeners(); } onHandlerDestroying() { this.unregisterListeners(), super.onHandlerDestroying(), this.resetItem(); @@ -21615,7 +21683,7 @@ class nC extends pf { initPTS: s, timescale: r }) { - if (i === J.MAIN) { + if (i === te.MAIN) { const a = t.cc, o = this.fragCurrent; if (this.initPTS[a] = { baseTime: s, @@ -21634,7 +21702,7 @@ class nC extends pf { const s = ((i = this.mainFragLoading) == null ? void 0 : i.frag) || null; if (t && (s == null ? void 0 : s.cc) === t.cc) return; - const r = (s || e).cc, a = this.getLevelDetails(), o = this.getLoadPosition(), u = by(a, r, o); + const r = (s || e).cc, a = this.getLevelDetails(), o = this.getLoadPosition(), u = $y(a, r, o); u && (this.log(`Syncing with main frag at ${u.start} cc ${u.cc}`), this.startFragRequested = !1, this.nextLoadPosition = u.start, this.resetLoadingState(), this.state === V.IDLE && this.doTickIdle()); } startLoad(e, t) { @@ -21643,7 +21711,7 @@ class nC extends pf { return; } const i = this.lastCurrentTime; - this.stopLoad(), this.setInterval(r0), i > 0 && e === -1 ? (this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`), e = i, this.state = V.IDLE) : this.state = V.WAITING_TRACK, this.nextLoadPosition = this.lastCurrentTime = e + this.timelineOffset, this.startPosition = t ? -1 : e, this.tick(); + this.stopLoad(), this.setInterval(T0), i > 0 && e === -1 ? (this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`), e = i, this.state = V.IDLE) : this.state = V.WAITING_TRACK, this.nextLoadPosition = this.lastCurrentTime = e + this.timelineOffset, this.startPosition = t ? -1 : e, this.tick(); } doTick() { switch (this.state) { @@ -21725,8 +21793,8 @@ class nC extends pf { return; } const l = this.mediaBuffer ? this.mediaBuffer : this.media; - this.bufferFlushed && l && (this.bufferFlushed = !1, this.afterBufferFlushed(l, Fe.AUDIO, J.AUDIO)); - const c = this.getFwdBufferInfo(l, J.AUDIO); + this.bufferFlushed && l && (this.bufferFlushed = !1, this.afterBufferFlushed(l, Pe.AUDIO, te.AUDIO)); + const c = this.getFwdBufferInfo(l, te.AUDIO); if (c === null) return; if (!this.switchingTrack && this._streamEnded(c, u)) { @@ -21743,14 +21811,14 @@ class nC extends pf { if (h >= d && !this.switchingTrack && p < f[f.length - 1].start) return; let y = this.getNextFragment(p, u); - if (y && this.isLoopLoading(y, p) && (y = this.getNextFragmentLoopLoading(y, u, c, J.MAIN, d)), !y) { + if (y && this.isLoopLoading(y, p) && (y = this.getNextFragmentLoopLoading(y, u, c, te.MAIN, d)), !y) { this.bufferFlushed = !0; return; } let v = ((e = this.mainFragLoading) == null ? void 0 : e.frag) || null; - if (!this.audioOnly && this.startFragRequested && v && Ye(y) && !y.endList && (!u.live || !this.loadingParts && p < this.hls.liveSyncPosition) && (this.fragmentTracker.getState(v) === Ze.OK && (this.mainFragLoading = v = null), v && Ye(v))) { + if (!this.audioOnly && this.startFragRequested && v && Ze(y) && !y.endList && (!u.live || !this.loadingParts && p < this.hls.liveSyncPosition) && (this.fragmentTracker.getState(v) === nt.OK && (this.mainFragLoading = v = null), v && Ze(v))) { if (y.start > v.end) { - const E = this.fragmentTracker.getFragAtPos(p, J.MAIN); + const E = this.fragmentTracker.getFragAtPos(p, te.MAIN); E && E.end > v.end && (v = E, this.mainFragLoading = { frag: E, targetBufferTime: null @@ -21767,7 +21835,7 @@ class nC extends pf { onAudioTracksUpdated(e, { audioTracks: t }) { - this.resetTransmuxer(), this.levels = t.map((i) => new Ma(i)); + this.resetTransmuxer(), this.levels = t.map((i) => new Wa(i)); } onAudioTrackSwitching(e, t) { const i = !!t.url; @@ -21775,7 +21843,7 @@ class nC extends pf { const { fragCurrent: s } = this; - s && (s.abortRequests(), this.removeUnbufferedFrags(s.start)), this.resetLoadingState(), i ? (this.switchingTrack = t, this.flushAudioIfNeeded(t), this.state !== V.STOPPED && (this.setInterval(r0), this.state = V.IDLE, this.tick())) : (this.resetTransmuxer(), this.switchingTrack = null, this.bufferedTrack = t, this.clearInterval()); + s && (s.abortRequests(), this.removeUnbufferedFrags(s.start)), this.resetLoadingState(), i ? (this.switchingTrack = t, this.flushAudioIfNeeded(t), this.state !== V.STOPPED && (this.setInterval(T0), this.state = V.IDLE, this.tick())) : (this.resetTransmuxer(), this.switchingTrack = null, this.bufferedTrack = t, this.clearInterval()); } onManifestLoading() { super.onManifestLoading(), this.bufferFlushed = this.flushing = this.audioOnly = !1, this.resetItem(), this.trackId = -1; @@ -21814,7 +21882,7 @@ class nC extends pf { var d; h = this.alignPlaylists(r, c.details, (d = this.levelLastLoaded) == null ? void 0 : d.details); } - r.alignedSliding || (Oy(r, l), r.alignedSliding || ql(r, l), h = r.fragmentStart); + r.alignedSliding || (Qy(r, l), r.alignedSliding || lu(r, l), h = r.fragmentStart); } c.details = r, this.levelLastLoaded = c, this.startFragRequested || this.setStartPosition(l, h), this.hls.trigger(b.AUDIO_TRACK_UPDATED, { details: r, @@ -21848,10 +21916,10 @@ class nC extends pf { } const h = a.defaultAudioCodec || l.audioCodec || "mp4a.40.2"; let d = this.transmuxer; - d || (d = this.transmuxer = new tE(this.hls, J.AUDIO, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this))); + d || (d = this.transmuxer = new _E(this.hls, te.AUDIO, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this))); const f = this.initPTS[i.cc], m = (t = i.initSegment) == null ? void 0 : t.data; if (f !== void 0) { - const p = s ? s.index : -1, y = p !== -1, v = new mf(i.level, i.sn, i.stats.chunkCount, r.byteLength, p, y); + const p = s ? s.index : -1, y = p !== -1, v = new Of(i.level, i.sn, i.stats.chunkCount, r.byteLength, p, y); d.push(r, m, h, "", i, s, c.totalduration, !1, v, f); } else { this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${c.startSN} ,${c.endSN}],track ${o}`); @@ -21860,7 +21928,7 @@ class nC extends pf { } = this.waitingData = this.waitingData || { frag: i, part: s, - cache: new My(), + cache: new Zy(), complete: !1 }; g.push(new Uint8Array(r)), this.state !== V.STOPPED && (this.state = V.WAITING_INIT_PTS); @@ -21882,25 +21950,25 @@ class nC extends pf { i && (this.mediaBuffer = i.buffer || null); } onFragLoading(e, t) { - !this.audioOnly && t.frag.type === J.MAIN && Ye(t.frag) && (this.mainFragLoading = t, this.state === V.IDLE && this.tick()); + !this.audioOnly && t.frag.type === te.MAIN && Ze(t.frag) && (this.mainFragLoading = t, this.state === V.IDLE && this.tick()); } onFragBuffered(e, t) { const { frag: i, part: s } = t; - if (i.type !== J.AUDIO) { - !this.audioOnly && i.type === J.MAIN && !i.elementaryStreams.video && !i.elementaryStreams.audiovideo && (this.audioOnly = !0, this.mainFragLoading = null); + if (i.type !== te.AUDIO) { + !this.audioOnly && i.type === te.MAIN && !i.elementaryStreams.video && !i.elementaryStreams.audiovideo && (this.audioOnly = !0, this.mainFragLoading = null); return; } if (this.fragContextChanged(i)) { this.warn(`Fragment ${i.sn}${s ? " p: " + s.index : ""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack ? this.switchingTrack.name : "false"}`); return; } - if (Ye(i)) { + if (Ze(i)) { this.fragPrevious = i; const r = this.switchingTrack; - r && (this.bufferedTrack = r, this.switchingTrack = null, this.hls.trigger(b.AUDIO_TRACK_SWITCHED, Le({}, r))); + r && (this.bufferedTrack = r, this.switchingTrack = null, this.hls.trigger(b.AUDIO_TRACK_SWITCHED, Ie({}, r))); } this.fragBufferedComplete(i, s), this.media && this.tick(); } @@ -21911,32 +21979,32 @@ class nC extends pf { return; } switch (t.details) { - case O.FRAG_GAP: - case O.FRAG_PARSING_ERROR: - case O.FRAG_DECRYPT_ERROR: - case O.FRAG_LOAD_ERROR: - case O.FRAG_LOAD_TIMEOUT: - case O.KEY_LOAD_ERROR: - case O.KEY_LOAD_TIMEOUT: - this.onFragmentOrKeyLoadError(J.AUDIO, t); + case P.FRAG_GAP: + case P.FRAG_PARSING_ERROR: + case P.FRAG_DECRYPT_ERROR: + case P.FRAG_LOAD_ERROR: + case P.FRAG_LOAD_TIMEOUT: + case P.KEY_LOAD_ERROR: + case P.KEY_LOAD_TIMEOUT: + this.onFragmentOrKeyLoadError(te.AUDIO, t); break; - case O.AUDIO_TRACK_LOAD_ERROR: - case O.AUDIO_TRACK_LOAD_TIMEOUT: - case O.LEVEL_PARSING_ERROR: + case P.AUDIO_TRACK_LOAD_ERROR: + case P.AUDIO_TRACK_LOAD_TIMEOUT: + case P.LEVEL_PARSING_ERROR: !t.levelRetry && this.state === V.WAITING_TRACK && ((i = t.context) == null ? void 0 : i.type) === me.AUDIO_TRACK && (this.state = V.IDLE); break; - case O.BUFFER_ADD_CODEC_ERROR: - case O.BUFFER_APPEND_ERROR: + case P.BUFFER_ADD_CODEC_ERROR: + case P.BUFFER_APPEND_ERROR: if (t.parent !== "audio") return; this.reduceLengthAndFlushBuffer(t) || this.resetLoadingState(); break; - case O.BUFFER_FULL_ERROR: + case P.BUFFER_FULL_ERROR: if (t.parent !== "audio") return; this.reduceLengthAndFlushBuffer(t) && (this.bufferedTrack = null, super.flushMainBuffer(0, Number.POSITIVE_INFINITY, "audio")); break; - case O.INTERNAL_EXCEPTION: + case P.INTERNAL_EXCEPTION: this.recoverWorkerError(t); break; } @@ -21944,15 +22012,15 @@ class nC extends pf { onBufferFlushing(e, { type: t }) { - t !== Fe.VIDEO && (this.flushing = !0); + t !== Pe.VIDEO && (this.flushing = !0); } onBufferFlushed(e, { type: t }) { - if (t !== Fe.VIDEO) { + if (t !== Pe.VIDEO) { this.flushing = !1, this.bufferFlushed = !0, this.state === V.ENDED && (this.state = V.IDLE); const i = this.mediaBuffer || this.media; - i && (this.afterBufferFlushed(i, t, J.AUDIO), this.tick()); + i && (this.afterBufferFlushed(i, t, te.AUDIO), this.tick()); } } _handleTransmuxComplete(e) { @@ -21998,15 +22066,15 @@ class nC extends pf { startDTS: v, endDTS: _ } = d; - l && (l.elementaryStreams[Fe.AUDIO] = { + l && (l.elementaryStreams[Pe.AUDIO] = { startPTS: p, endPTS: y, startDTS: v, endDTS: _ - }), u.setElementaryStreamInfo(Fe.AUDIO, p, y, v, _), this.bufferFragmentData(d, u, l, a); + }), u.setElementaryStreamInfo(Pe.AUDIO, p, y, v, _), this.bufferFragmentData(d, u, l, a); } if (m != null && (t = m.samples) != null && t.length) { - const p = De({ + const p = we({ id: i, frag: u, details: h @@ -22014,7 +22082,7 @@ class nC extends pf { s.trigger(b.FRAG_PARSING_METADATA, p); } if (f) { - const p = De({ + const p = we({ id: i, frag: u, details: h @@ -22026,7 +22094,7 @@ class nC extends pf { if (this.state !== V.PARSING || (t.video && delete t.video, t.audiovideo && delete t.audiovideo, !t.audio)) return; const r = t.audio; - r.id = J.AUDIO; + r.id = te.AUDIO; const a = e.audioCodec; this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${a}/${r.codec}]`), a && a.split(",").length === 1 && (r.levelCodec = a), this.hls.trigger(b.BUFFER_CODECS, t); const o = r.initSegment; @@ -22045,14 +22113,14 @@ class nC extends pf { } loadFragment(e, t, i) { const s = this.fragmentTracker.getState(e); - if (this.switchingTrack || s === Ze.NOT_LOADED || s === Ze.PARTIAL) { + if (this.switchingTrack || s === nt.NOT_LOADED || s === nt.PARTIAL) { var r; - if (!Ye(e)) + if (!Ze(e)) this._loadInitSegment(e, t); else if ((r = t.details) != null && r.live && !this.initPTS[e.cc]) { this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`), this.state = V.WAITING_INIT_PTS; const a = this.mainDetails; - a && a.fragmentStart !== t.details.fragmentStart && ql(t.details, a); + a && a.fragmentStart !== t.details.fragmentStart && lu(t.details, a); } else super.loadFragment(e, t, i); } else @@ -22068,24 +22136,24 @@ class nC extends pf { audioCodec: a, channels: o } = this.bufferedTrack; - Ts({ + Is({ name: t, lang: i, assocLang: s, characteristics: r, audioCodec: a, channels: o - }, e, us) || (Ul(e.url, this.hls) ? (this.log("Switching audio track : flushing all audio"), super.flushMainBuffer(0, Number.POSITIVE_INFINITY, "audio"), this.bufferedTrack = null) : this.bufferedTrack = e); + }, e, ms) || (su(e.url, this.hls) ? (this.log("Switching audio track : flushing all audio"), super.flushMainBuffer(0, Number.POSITIVE_INFINITY, "audio"), this.bufferedTrack = null) : this.bufferedTrack = e); } } completeAudioSwitch(e) { const { hls: t } = this; - this.flushAudioIfNeeded(e), this.bufferedTrack = e, this.switchingTrack = null, t.trigger(b.AUDIO_TRACK_SWITCHED, Le({}, e)); + this.flushAudioIfNeeded(e), this.bufferedTrack = e, this.switchingTrack = null, t.trigger(b.AUDIO_TRACK_SWITCHED, Ie({}, e)); } } -class Af extends Fi { +class Kf extends Bi { constructor(e, t) { super(t, e.logger), this.hls = void 0, this.canLoad = !1, this.timer = -1, this.hls = e; } @@ -22125,8 +22193,8 @@ class Af extends Fi { const c = Math.min(t.age - t.partTarget, t.targetduration); u >= 0 && c > t.partTarget && (u += 1); } - const l = i && bp(i); - return new Tp(o, u >= 0 ? u : void 0, l); + const l = i && Bp(i); + return new Np(o, u >= 0 ? u : void 0, l); } } } @@ -22164,7 +22232,7 @@ class Af extends Fi { if (s.live || i != null && i.live) { const c = "levelInfo" in t ? t.levelInfo : t.track; if (s.reloaded(i), i && s.fragments.length > 0) { - Zk(i, s); + bR(i, s); const v = s.playlistParsingError; if (v) { this.warn(v); @@ -22175,8 +22243,8 @@ class Af extends Fi { networkDetails: E } = t; _.trigger(b.ERROR, { - type: ie.NETWORK_ERROR, - details: O.LEVEL_PARSING_ERROR, + type: ne.NETWORK_ERROR, + details: P.LEVEL_PARSING_ERROR, fatal: !1, url: s.url, error: v, @@ -22192,25 +22260,25 @@ class Af extends Fi { } } s.requestScheduled === -1 && (s.requestScheduled = r.loading.start); - const h = this.hls.mainForwardBufferInfo, d = h ? h.end - h.len : 0, f = (s.edge - d) * 1e3, m = ky(s, f); + const h = this.hls.mainForwardBufferInfo, d = h ? h.end - h.len : 0, f = (s.edge - d) * 1e3, m = jy(s, f); if (s.requestScheduled + m < a ? s.requestScheduled = a : s.requestScheduled += m, this.log(`live playlist ${e} ${s.advanced ? "REFRESHED " + s.lastPartSn + "-" + s.lastPartIndex : s.updated ? "UPDATED" : "MISSED"}`), !this.canLoad || !s.live) return; let g, p, y; if (s.canBlockReload && s.endSN && s.advanced) { - const v = this.hls.config.lowLatencyMode, _ = s.lastPartSn, E = s.endSN, T = s.lastPartIndex, A = T !== -1, S = _ === E; - A ? S ? (p = E + 1, y = v ? 0 : T) : (p = _, y = v ? T + 1 : s.maxPartIndex) : p = E + 1; - const D = s.age, x = D + s.ageHeader; - let w = Math.min(x - s.partTarget, s.targetduration * 1.5); + const v = this.hls.config.lowLatencyMode, _ = s.lastPartSn, E = s.endSN, T = s.lastPartIndex, x = T !== -1, S = _ === E; + x ? S ? (p = E + 1, y = v ? 0 : T) : (p = _, y = v ? T + 1 : s.maxPartIndex) : p = E + 1; + const D = s.age, A = D + s.ageHeader; + let w = Math.min(A - s.partTarget, s.targetduration * 1.5); if (w > 0) { - if (x > s.targetduration * 3) + if (A > s.targetduration * 3) this.log(`Playlist last advanced ${D.toFixed(2)}s ago. Omitting segment and part directives.`), p = void 0, y = void 0; - else if (i != null && i.tuneInGoal && x - s.partTarget > i.tuneInGoal) + else if (i != null && i.tuneInGoal && A - s.partTarget > i.tuneInGoal) this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${w} with playlist age: ${s.age}`), w = 0; else { const I = Math.floor(w / s.targetduration); if (p += I, y !== void 0) { - const R = Math.round(w % s.targetduration / s.partTarget); - y += R; + const M = Math.round(w % s.targetduration / s.partTarget); + y += M; } this.log(`CDN Tune-in age: ${s.ageHeader}s last advanced ${D.toFixed(2)}s goal: ${w} skip sn ${I} to part ${y}`); } @@ -22240,15 +22308,15 @@ class Af extends Fi { this.log(`reload live playlist ${e.name || e.bitrate + "bps"} in ${Math.round(o)} ms`), this.clearTimer(), this.timer = self.setTimeout(() => this.loadingPlaylist(e, t), o); } getDeliveryDirectives(e, t, i, s) { - let r = bp(e); - return t != null && t.skip && e.deltaUpdateFailed && (i = t.msn, s = t.part, r = pl.No), new Tp(i, s, r); + let r = Bp(e); + return t != null && t.skip && e.deltaUpdateFailed && (i = t.msn, s = t.part, r = Ol.No), new Np(i, s, r); } checkRetry(e) { - const t = e.details, i = Gl(e), s = e.errorAction, { + const t = e.details, i = ru(e), s = e.errorAction, { action: r, retryCount: a = 0, retryConfig: o - } = s || {}, u = !!s && !!o && (r === yt.RetryRequest || !s.resolved && r === yt.SendAlternateToPenaltyBox); + } = s || {}, u = !!s && !!o && (r === At.RetryRequest || !s.resolved && r === At.SendAlternateToPenaltyBox); if (u) { var l; if (a >= o.maxNumRetry) @@ -22256,7 +22324,7 @@ class Af extends Fi { if (i && (l = e.context) != null && l.deliveryDirectives) this.warn(`Retrying playlist loading ${a + 1}/${o.maxNumRetry} after "${t}" without delivery-directives`), this.loadPlaylist(); else { - const c = df(o, a); + const c = Ff(o, a); this.clearTimer(), this.timer = self.setTimeout(() => this.loadPlaylist(), c), this.warn(`Retrying playlist loading ${a + 1}/${o.maxNumRetry} after "${t}" in ${c}ms`); } e.levelRetry = !0, s.resolved = !0; @@ -22264,22 +22332,22 @@ class Af extends Fi { return u; } } -function iE(n, e) { +function vE(n, e) { if (n.length !== e.length) return !1; for (let t = 0; t < n.length; t++) - if (!Ga(n[t].attrs, e[t].attrs)) + if (!Ja(n[t].attrs, e[t].attrs)) return !1; return !0; } -function Ga(n, e, t) { +function Ja(n, e, t) { const i = n["STABLE-RENDITION-ID"]; return i && !t ? i === e["STABLE-RENDITION-ID"] : !(t || ["LANGUAGE", "NAME", "CHARACTERISTICS", "AUTOSELECT", "DEFAULT", "FORCED", "ASSOC-LANGUAGE"]).some((s) => n[s] !== e[s]); } -function pd(n, e) { +function $d(n, e) { return e.label.toLowerCase() === n.name.toLowerCase() && (!e.language || e.language.toLowerCase() === (n.lang || "").toLowerCase()); } -class sC extends Af { +class wC extends Kf { constructor(e) { super(e, "audio-track-controller"), this.tracks = [], this.groupIds = null, this.tracksInGroup = [], this.trackId = -1, this.currentTrack = null, this.selectDefaultTrack = !0, this.registerListeners(); } @@ -22341,11 +22409,11 @@ class sC extends Af { this.tracksInGroup = o; const u = this.hls.config.audioPreference; if (!r && u) { - const d = tn(u, o, us); + const d = rn(u, o, ms); if (d > -1) r = o[d]; else { - const f = tn(u, this.tracks); + const f = rn(u, this.tracks); r = this.tracks[f]; } } @@ -22362,8 +22430,8 @@ class sC extends Af { var a; const d = new Error(`No audio track selected for current audio group-ID(s): ${(a = this.groupIds) == null ? void 0 : a.join(",")} track count: ${o.length}`); this.warn(d.message), this.hls.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.AUDIO_TRACK_LOAD_ERROR, + type: ne.MEDIA_ERROR, + details: P.AUDIO_TRACK_LOAD_ERROR, fatal: !0, error: d }); @@ -22391,22 +22459,22 @@ class sC extends Af { const i = this.allAudioTracks; if (this.selectDefaultTrack = !1, i.length) { const s = this.currentTrack; - if (s && Ts(e, s, us)) + if (s && Is(e, s, ms)) return s; - const r = tn(e, this.tracksInGroup, us); + const r = rn(e, this.tracksInGroup, ms); if (r > -1) { const a = this.tracksInGroup[r]; return this.setAudioTrack(r), a; } else if (s) { let a = t.loadLevel; a === -1 && (a = t.firstAutoLevel); - const o = _k(e, t.levels, i, a, us); + const o = Uk(e, t.levels, i, a, ms); if (o === -1) return null; t.nextLoadLevel = o; } if (e.channels || e.audioCodec) { - const a = tn(e, i); + const a = rn(e, i); if (a > -1) return i[a]; } @@ -22422,7 +22490,7 @@ class sC extends Af { } this.selectDefaultTrack = !1; const i = this.currentTrack, s = t[e], r = s.details && !s.details.live; - if (e === this.trackId && s === i && r || (this.log(`Switching to audio-track ${e} "${s.name}" lang:${s.lang} group:${s.groupId} channels:${s.channels}`), this.trackId = e, this.currentTrack = s, this.hls.trigger(b.AUDIO_TRACK_SWITCHING, Le({}, s)), r)) + if (e === this.trackId && s === i && r || (this.log(`Switching to audio-track ${e} "${s.name}" lang:${s.lang} group:${s.groupId} channels:${s.channels}`), this.trackId = e, this.currentTrack = s, this.hls.trigger(b.AUDIO_TRACK_SWITCHING, Ie({}, s)), r)) return; const a = this.switchParams(s.url, i == null ? void 0 : i.details, s.details); this.loadPlaylist(a); @@ -22431,7 +22499,7 @@ class sC extends Af { const t = this.tracksInGroup; for (let i = 0; i < t.length; i++) { const s = t[i]; - if (!(this.selectDefaultTrack && !s.default) && (!e || Ts(e, s, us))) + if (!(this.selectDefaultTrack && !s.default) && (!e || Is(e, s, ms))) return i; } if (e) { @@ -22445,24 +22513,24 @@ class sC extends Af { } = e; for (let l = 0; l < t.length; l++) { const c = t[l]; - if (Ts({ + if (Is({ name: i, lang: s, assocLang: r, characteristics: a, audioCodec: o, channels: u - }, c, us)) + }, c, ms)) return l; } for (let l = 0; l < t.length; l++) { const c = t[l]; - if (Ga(e.attrs, c.attrs, ["LANGUAGE", "ASSOC-LANGUAGE", "CHARACTERISTICS"])) + if (Ja(e.attrs, c.attrs, ["LANGUAGE", "ASSOC-LANGUAGE", "CHARACTERISTICS"])) return l; } for (let l = 0; l < t.length; l++) { const c = t[l]; - if (Ga(e.attrs, c.attrs, ["LANGUAGE"])) + if (Ja(e.attrs, c.attrs, ["LANGUAGE"])) return l; } } @@ -22471,7 +22539,7 @@ class sC extends Af { loadPlaylist(e) { super.loadPlaylist(); const t = this.currentTrack; - this.shouldLoadPlaylist(t) && Ul(t.url, this.hls) && this.scheduleLoading(t, e); + this.shouldLoadPlaylist(t) && su(t.url, this.hls) && this.scheduleLoading(t, e); } loadingPlaylist(e, t) { super.loadingPlaylist(e, t); @@ -22485,7 +22553,7 @@ class sC extends Af { }); } } -class rC { +class LC { constructor(e) { this.tracks = void 0, this.queues = { video: [], @@ -22594,13 +22662,13 @@ ${this.list("audiovideo")}}`; return ((t = this.queues) == null ? void 0 : t[e].map((i) => i.label).join(", ")) || ""; } } -const a0 = /(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/, nE = "HlsJsTrackRemovedError"; -class aC extends Error { +const S0 = /(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/, yE = "HlsJsTrackRemovedError"; +class IC extends Error { constructor(e) { - super(e), this.name = nE; + super(e), this.name = yE; } } -class oC extends Fi { +class kC extends Bi { constructor(e, t) { super("buffer-controller", e.logger), this.hls = void 0, this.fragmentTracker = void 0, this.details = null, this._objectUrl = null, this.operationQueue = null, this.bufferCodecEventsTotal = 0, this.media = null, this.mediaSource = null, this.lastMpegAudioChunk = null, this.blockedAudioAppend = null, this.lastVideoAppendEnd = 0, this.appendSource = void 0, this.transferData = void 0, this.overrides = void 0, this.appendErrors = { audio: 0, @@ -22630,7 +22698,7 @@ class oC extends Fi { _objectUrl: s } = this; i !== s && this.error(`Media element src was set while attaching MediaSource (${s} > ${i})`); - }, this.hls = e, this.fragmentTracker = t, this.appendSource = PI(Qn(e.config.preferManagedMediaSource)), this.initTracks(), this.registerListeners(); + }, this.hls = e, this.fragmentTracker = t, this.appendSource = nk(ns(e.config.preferManagedMediaSource)), this.initTracks(), this.registerListeners(); } hasSourceTypes() { return Object.keys(this.tracks).length > 0; @@ -22665,9 +22733,9 @@ class oC extends Fi { (r || a) && this.warn(`Transfering MediaSource with${a ? " operations in queue" : ""}${r ? " updating SourceBuffer(s)" : ""} ${this.operationQueue}`), this.operationQueue.destroy(); } const s = this.transferData; - return !this.sourceBufferCount && s && s.mediaSource === t ? De(i, s.tracks) : this.sourceBuffers.forEach((r) => { + return !this.sourceBufferCount && s && s.mediaSource === t ? we(i, s.tracks) : this.sourceBuffers.forEach((r) => { const [a] = r; - a && (i[a] = De({}, this.tracks[a]), this.removeBuffer(a)), r[0] = r[1] = null; + a && (i[a] = we({}, this.tracks[a]), this.removeBuffer(a)), r[0] = r[1] = null; }), { media: e, mediaSource: t, @@ -22687,7 +22755,7 @@ class oC extends Fi { (t.audio && !t.video || !t.altAudio) && (s = 1), this.bufferCodecEventsTotal = s, this.log(`${s} bufferCodec event(s) expected.`), (i = this.transferData) != null && i.mediaSource && this.sourceBufferCount && s && this.bufferCreated(); } onMediaAttaching(e, t) { - const i = this.media = t.media, s = Qn(this.appendSource); + const i = this.media = t.media, s = ns(this.appendSource); if (this.transferData = this.overrides = void 0, i && s) { const r = !!t.mediaSource; (r || t.overrides) && (this.transferData = t, this.overrides = t.overrides); @@ -22700,7 +22768,7 @@ class oC extends Fi { try { i.removeAttribute("src"); const u = self.ManagedMediaSource; - i.disableRemotePlayback = i.disableRemotePlayback || u && a instanceof u, o0(i), lC(i, o), i.load(); + i.disableRemotePlayback = i.disableRemotePlayback || u && a instanceof u, A0(i), RC(i, o), i.load(); } catch { i.src = o; } @@ -22727,8 +22795,8 @@ class oC extends Fi { return; } if (this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal}) -required tracks: ${Oe(i, (u, l) => u === "initSegment" ? void 0 : l)}; -transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, i)) { +required tracks: ${$e(i, (u, l) => u === "initSegment" ? void 0 : l)}; +transfer tracks: ${$e(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !by(s, i)) { t.mediaSource = null, t.tracks = void 0; const u = e.currentTime, l = this.details, c = Math.max(u, (l == null ? void 0 : l.fragments[0].start) || 0); if (c - u > 1) { @@ -22745,10 +22813,10 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, if (h) { const d = this.fragmentTracker, f = c.id; if (d.hasFragments(f) || d.hasParts(f)) { - const p = le.getBuffered(h); + const p = ue.getBuffered(h); d.detectEvictedFragments(l, p, f, null, !0); } - const m = sh(l), g = [l, h]; + const m = Ah(l), g = [l, h]; this.sourceBuffers[m] = g, h.updating && this.operationQueue && this.operationQueue.prependBlocker(l), this.trackSourceBuffer(l, c); } } @@ -22790,7 +22858,7 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, } r.removeEventListener("sourceopen", this._onMediaSourceOpen), r.removeEventListener("sourceended", this._onMediaSourceEnded), r.removeEventListener("sourceclose", this._onMediaSourceClose), this.appendSource && (r.removeEventListener("startstreaming", this._onStartStreaming), r.removeEventListener("endstreaming", this._onEndStreaming)), this.mediaSource = null, this._objectUrl = null; } - s && (s.removeEventListener("emptied", this._onMediaEmptied), i || (a && self.URL.revokeObjectURL(a), this.mediaSrc === a ? (s.removeAttribute("src"), this.appendSource && o0(s), s.load()) : this.warn("media|source.src was changed by a third party - skip cleanup")), this.media = null), this.hls.trigger(b.MEDIA_DETACHED, t); + s && (s.removeEventListener("emptied", this._onMediaEmptied), i || (a && self.URL.revokeObjectURL(a), this.mediaSrc === a ? (s.removeAttribute("src"), this.appendSource && A0(s), s.load()) : this.warn("media|source.src was changed by a third party - skip cleanup")), this.media = null), this.hls.trigger(b.MEDIA_DETACHED, t); } onBufferReset() { this.sourceBuffers.forEach(([e]) => { @@ -22810,12 +22878,12 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, delete this.tracks[e]; } removeBuffer(e) { - this.removeBufferListeners(e), this.sourceBuffers[sh(e)] = [null, null]; + this.removeBufferListeners(e), this.sourceBuffers[Ah(e)] = [null, null]; const t = this.tracks[e]; t && (t.buffer = void 0); } resetQueue() { - this.operationQueue && this.operationQueue.destroy(), this.operationQueue = new rC(this.tracks); + this.operationQueue && this.operationQueue.destroy(), this.operationQueue = new LC(this.tracks); } onBufferCodecs(e, t) { const i = this.tracks, s = Object.keys(t); @@ -22836,7 +22904,7 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, supplemental: y } = h; let v = i[o]; - const _ = (u = this.transferData) == null || (l = u.tracks) == null ? void 0 : l[o], E = _ != null && _.buffer ? _ : v, T = (E == null ? void 0 : E.pendingCodec) || (E == null ? void 0 : E.codec), A = E == null ? void 0 : E.levelCodec; + const _ = (u = this.transferData) == null || (l = u.tracks) == null ? void 0 : l[o], E = _ != null && _.buffer ? _ : v, T = (E == null ? void 0 : E.pendingCodec) || (E == null ? void 0 : E.codec), x = E == null ? void 0 : E.levelCodec; v || (v = i[o] = { buffer: void 0, listeners: [], @@ -22847,10 +22915,10 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, metadata: p, id: d }); - const S = gl(T, A), D = S == null ? void 0 : S.replace(a0, "$1"); - let x = gl(f, m); - const w = (c = x) == null ? void 0 : c.replace(a0, "$1"); - x && S && D !== w && (o.slice(0, 5) === "audio" && (x = Bl(x, this.appendSource)), this.log(`switching codec ${T} to ${x}`), x !== (v.pendingCodec || v.codec) && (v.pendingCodec = x), v.container = g, this.appendChangeType(o, g, x)); + const S = Pl(T, x), D = S == null ? void 0 : S.replace(S0, "$1"); + let A = Pl(f, m); + const w = (c = A) == null ? void 0 : c.replace(S0, "$1"); + A && S && D !== w && (o.slice(0, 5) === "audio" && (A = iu(A, this.appendSource)), this.log(`switching codec ${T} to ${A}`), A !== (v.pendingCodec || v.codec) && (v.pendingCodec = A), v.container = g, this.appendChangeType(o, g, A)); }), (this.tracksReady || this.sourceBufferCount) && (t.tracks = this.sourceBufferTracks), !this.sourceBufferCount && this.mediaSourceOpenOrEnded && this.checkPendingTracks(); } get sourceBufferTracks() { @@ -22888,14 +22956,14 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, blockAudio(e) { var t; const i = e.start, s = i + e.duration * 0.05; - if (((t = this.fragmentTracker.getAppendedFrag(i, J.MAIN)) == null ? void 0 : t.gap) === !0) + if (((t = this.fragmentTracker.getAppendedFrag(i, te.MAIN)) == null ? void 0 : t.gap) === !0) return; const a = { label: "block-audio", execute: () => { var o; const u = this.tracks.video; - (this.lastVideoAppendEnd > s || u != null && u.buffer && le.isBuffered(u.buffer, s) || ((o = this.fragmentTracker.getAppendedFrag(s, J.MAIN)) == null ? void 0 : o.gap) === !0) && (this.blockedAudioAppend = null, this.shiftAndExecuteNext("audio")); + (this.lastVideoAppendEnd > s || u != null && u.buffer && ue.isBuffered(u.buffer, s) || ((o = this.fragmentTracker.getAppendedFrag(s, te.MAIN)) == null ? void 0 : o.gap) === !0) && (this.blockedAudioAppend = null, this.shiftAndExecuteNext("audio")); }, onStart: () => { }, @@ -22942,24 +23010,24 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, if (E && d !== "initSegment") { const S = u || o, D = this.blockedAudioAppend; if (r === "audio" && a !== "main" && !this.blockedAudioAppend) { - const w = S.start + S.duration * 0.05, I = E.buffered, R = this.currentOp("video"); - !I.length && !R ? this.blockAudio(S) : !R && !le.isBuffered(E, w) && this.lastVideoAppendEnd < w && this.blockAudio(S); + const w = S.start + S.duration * 0.05, I = E.buffered, M = this.currentOp("video"); + !I.length && !M ? this.blockAudio(S) : !M && !ue.isBuffered(E, w) && this.lastVideoAppendEnd < w && this.blockAudio(S); } else if (r === "video") { - const x = S.end; + const A = S.end; if (D) { const w = D.frag.start; - (x > w || x < this.lastVideoAppendEnd || le.isBuffered(E, w)) && this.unblockAudio(); + (A > w || A < this.lastVideoAppendEnd || ue.isBuffered(E, w)) && this.unblockAudio(); } - this.lastVideoAppendEnd = x; + this.lastVideoAppendEnd = A; } } - const T = (u || o).start, A = { + const T = (u || o).start, x = { label: `append-${r}`, execute: () => { var S; h.executeStart = self.performance.now(); const D = (S = this.tracks[r]) == null ? void 0 : S.buffer; - D && (v ? this.updateTimestampOffset(D, T, 0.1, r, d, f) : c !== void 0 && Z(c) && this.updateTimestampOffset(D, c, 1e-6, r, d, f)), this.appendExecutor(s, r); + D && (v ? this.updateTimestampOffset(D, T, 0.1, r, d, f) : c !== void 0 && J(c) && this.updateTimestampOffset(D, c, 1e-6, r, d, f)), this.appendExecutor(s, r); }, onStart: () => { }, @@ -22967,8 +23035,8 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, const S = self.performance.now(); h.executeEnd = h.end = S, g.first === 0 && (g.first = S), p && p.first === 0 && (p.first = S); const D = {}; - this.sourceBuffers.forEach(([x, w]) => { - x && (D[x] = le.getBuffered(w)); + this.sourceBuffers.forEach(([A, w]) => { + A && (D[A] = ue.getBuffered(w)); }), this.appendErrors[r] = 0, r === "audio" || r === "video" ? this.appendErrors.audiovideo = 0 : (this.appendErrors.audio = 0, this.appendErrors.video = 0), this.hls.trigger(b.BUFFER_APPENDED, { type: r, frag: o, @@ -22980,10 +23048,10 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, }, onError: (S) => { var D; - const x = { - type: ie.MEDIA_ERROR, + const A = { + type: ne.MEDIA_ERROR, parent: o.type, - details: O.BUFFER_APPEND_ERROR, + details: P.BUFFER_APPEND_ERROR, sourceBufferName: r, frag: o, part: u, @@ -22993,19 +23061,19 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, fatal: !1 }, w = (D = this.media) == null ? void 0 : D.error; if (S.code === DOMException.QUOTA_EXCEEDED_ERR || S.name == "QuotaExceededError" || "quota" in S) - x.details = O.BUFFER_FULL_ERROR; + A.details = P.BUFFER_FULL_ERROR; else if (S.code === DOMException.INVALID_STATE_ERR && this.mediaSourceOpenOrEnded && !w) - x.errorAction = $a(!0); - else if (S.name === nE && this.sourceBufferCount === 0) - x.errorAction = $a(!0); + A.errorAction = Ya(!0); + else if (S.name === yE && this.sourceBufferCount === 0) + A.errorAction = Ya(!0); else { const I = ++this.appendErrors[r]; - this.warn(`Failed ${I}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${w || "no media error"})`), (I >= this.hls.config.appendErrorMaxRetry || w) && (x.fatal = !0); + this.warn(`Failed ${I}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${w || "no media error"})`), (I >= this.hls.config.appendErrorMaxRetry || w) && (A.fatal = !0); } - this.hls.trigger(b.ERROR, x); + this.hls.trigger(b.ERROR, A); } }; - this.append(A, r, this.isPending(this.tracks[r])); + this.append(x, r, this.isPending(this.tracks[r])); } getFlushOp(e, t, i) { return this.log(`queuing "${e}" remove ${t}-${i}`), { @@ -23040,7 +23108,7 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, frag: i, part: s } = t, r = [], a = s ? s.elementaryStreams : i.elementaryStreams; - a[Fe.AUDIOVIDEO] ? r.push("audiovideo") : (a[Fe.AUDIO] && r.push("audio"), a[Fe.VIDEO] && r.push("video")); + a[Pe.AUDIOVIDEO] ? r.push("audiovideo") : (a[Pe.AUDIO] && r.push("audio"), a[Pe.VIDEO] && r.push("video")); const o = () => { const u = self.performance.now(); i.stats.buffering.end = u, s && (s.stats.buffering.end = u); @@ -23111,10 +23179,10 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, }); } onError(e, t) { - if (t.details === O.BUFFER_APPEND_ERROR && t.frag) { + if (t.details === P.BUFFER_APPEND_ERROR && t.frag) { var i; const s = (i = t.errorAction) == null ? void 0 : i.nextAutoLevel; - Z(s) && s !== t.frag.level && this.resetAppendErrors(); + J(s) && s !== t.frag.level && this.resetAppendErrors(); } } resetAppendErrors() { @@ -23133,11 +23201,11 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, if (!i || t === null || !this.sourceBufferCount) return; const s = e.config, r = i.currentTime, a = t.levelTargetDuration, o = t.live && s.liveBackBufferLength !== null ? s.liveBackBufferLength : s.backBufferLength; - if (Z(o) && o >= 0) { + if (J(o) && o >= 0) { const u = Math.max(o, a), l = Math.floor(r / a) * a - u; this.flushBackBuffer(r, a, l); } - if (Z(s.frontBufferFlushThreshold) && s.frontBufferFlushThreshold > 0) { + if (J(s.frontBufferFlushThreshold) && s.frontBufferFlushThreshold > 0) { const u = Math.max(s.maxBufferLength, s.frontBufferFlushThreshold), l = Math.max(u, a), c = Math.floor(r / a) * a + l; this.flushFrontBuffer(r, a, c); } @@ -23145,7 +23213,7 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, flushBackBuffer(e, t, i) { this.sourceBuffers.forEach(([s, r]) => { if (r) { - const o = le.getBuffered(r); + const o = ue.getBuffered(r); if (o.length > 0 && i > o.start(0)) { var a; this.hls.trigger(b.BACK_BUFFER_REACHED, { @@ -23172,7 +23240,7 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, flushFrontBuffer(e, t, i) { this.sourceBuffers.forEach(([s, r]) => { if (r) { - const a = le.getBuffered(r), o = a.length; + const a = ue.getBuffered(r), o = a.length; if (o < 2) return; const u = a.start(o - 1), l = a.end(o - 1); @@ -23215,11 +23283,11 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, } const r = (e = this.overrides) == null ? void 0 : e.duration; if (r) - return Z(r) ? { + return J(r) ? { duration: r } : null; - const a = this.media.duration, o = Z(i.duration) ? i.duration : 0; - return s > o && s > a || !Z(a) ? { + const a = this.media.duration, o = J(i.duration) ? i.duration : 0; + return s > o && s > a || !J(a) ? { duration: s } : null; } @@ -23229,7 +23297,7 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, end: i }) { const s = this.mediaSource; - !this.media || !s || s.readyState !== "open" || (s.duration !== e && (Z(e) && this.log(`Updating MediaSource duration to ${e.toFixed(3)}`), s.duration = e), t !== void 0 && i !== void 0 && (this.log(`MediaSource duration is set to ${s.duration}. Setting seekable range to ${t}-${i}.`), s.setLiveSeekableRange(t, i))); + !this.media || !s || s.readyState !== "open" || (s.duration !== e && (J(e) && this.log(`Updating MediaSource duration to ${e.toFixed(3)}`), s.duration = e), t !== void 0 && i !== void 0 && (this.log(`MediaSource duration is set to ${s.duration}. Setting seekable range to ${t}-${i}.`), s.setLiveSeekableRange(t, i))); } get tracksReady() { const e = this.pendingTrackCount; @@ -23241,7 +23309,7 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, pendingTrackCount: t, tracks: i } = this; - if (this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${Oe(i)}`), this.tracksReady) { + if (this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${$e(i)}`), this.tracksReady) { var s; const r = (s = this.transferData) == null ? void 0 : s.tracks; r && Object.keys(r).length ? this.attachTransferred() : this.createSourceBuffers(); @@ -23271,8 +23339,8 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, } else { const e = new Error("could not create source buffer for media codec(s)"); this.hls.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.BUFFER_INCOMPATIBLE_CODECS_ERROR, + type: ne.MEDIA_ERROR, + details: P.BUFFER_INCOMPATIBLE_CODECS_ERROR, fatal: !0, error: e, reason: e.message @@ -23291,15 +23359,15 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, const a = r, o = e[a]; if (this.isPending(o)) { const u = this.getTrackCodec(o, a), l = `${o.container};codecs=${u}`; - o.codec = u, this.log(`creating sourceBuffer(${l})${this.currentOp(a) ? " Queued" : ""} ${Oe(o)}`); + o.codec = u, this.log(`creating sourceBuffer(${l})${this.currentOp(a) ? " Queued" : ""} ${$e(o)}`); try { - const c = i.addSourceBuffer(l), h = sh(a), d = [a, c]; + const c = i.addSourceBuffer(l), h = Ah(a), d = [a, c]; t[h] = d, o.buffer = c; } catch (c) { var s; this.error(`error while trying to add sourceBuffer: ${c.message}`), this.shiftAndExecuteNext(a), (s = this.operationQueue) == null || s.removeBlockers(), delete this.tracks[a], this.hls.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.BUFFER_ADD_CODEC_ERROR, + type: ne.MEDIA_ERROR, + details: P.BUFFER_ADD_CODEC_ERROR, fatal: !1, error: c, sourceBufferName: a, @@ -23316,9 +23384,9 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, getTrackCodec(e, t) { const i = e.supplemental; let s = e.codec; - i && (t === "video" || t === "audiovideo") && ad(i, "video") && (s = ek(s, i)); - const r = gl(s, e.levelCodec); - return r ? t.slice(0, 5) === "audio" ? Bl(r, this.appendSource) : r : ""; + i && (t === "video" || t === "audiovideo") && wd(i, "video") && (s = Sk(s, i)); + const r = Pl(s, e.levelCodec); + return r ? t.slice(0, 5) === "audio" ? iu(r, this.appendSource) : r : ""; } trackSourceBuffer(e, t) { const i = t.buffer; @@ -23363,8 +23431,8 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, var i; const s = new Error(`${e} SourceBuffer error. MediaSource readyState: ${(i = this.mediaSource) == null ? void 0 : i.readyState}`); this.error(`${s}`, t), this.hls.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.BUFFER_APPENDING_ERROR, + type: ne.MEDIA_ERROR, + details: P.BUFFER_APPENDING_ERROR, sourceBufferName: e, error: s, fatal: !1 @@ -23386,14 +23454,14 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`), this.shiftAndExecuteNext(e); return; } - const u = Z(s.duration) ? s.duration : 1 / 0, l = Z(r.duration) ? r.duration : 1 / 0, c = Math.max(0, t), h = Math.min(i, u, l); + const u = J(s.duration) ? s.duration : 1 / 0, l = J(r.duration) ? r.duration : 1 / 0, c = Math.max(0, t), h = Math.min(i, u, l); h > c && (!a.ending || a.ended) ? (a.ended = !1, this.log(`Removing [${c},${h}] from the ${e} SourceBuffer`), o.remove(c, h)) : this.shiftAndExecuteNext(e); } // This method must result in an updateend event; if append is not called, onSBUpdateEnd must be called manually appendExecutor(e, t) { const i = this.tracks[t], s = i == null ? void 0 : i.buffer; if (!s) - throw new aC(`Attempting to append to the ${t} SourceBuffer, but it does not exist`); + throw new IC(`Attempting to append to the ${t} SourceBuffer, but it does not exist`); i.ending = !1, i.ended = !1, s.appendBuffer(e); } blockUntilOpen(e) { @@ -23485,20 +23553,20 @@ transfer tracks: ${Oe(s, (u, l) => u === "initSegment" ? void 0 : l)}}`), !ry(s, }), t.listeners.length = 0); } } -function o0(n) { +function A0(n) { const e = n.querySelectorAll("source"); [].slice.call(e).forEach((t) => { n.removeChild(t); }); } -function lC(n, e) { +function RC(n, e) { const t = self.document.createElement("source"); t.type = "video/mp4", t.src = e, n.appendChild(t); } -function sh(n) { +function Ah(n) { return n === "audio" ? 1 : 0; } -class xf { +class jf { constructor(e) { this.hls = void 0, this.autoLevelCapping = void 0, this.firstLevel = void 0, this.media = void 0, this.restrictedLevels = void 0, this.timer = void 0, this.clientRect = void 0, this.streamController = void 0, this.hls = e, this.autoLevelCapping = Number.POSITIVE_INFINITY, this.firstLevel = -1, this.media = null, this.restrictedLevels = [], this.timer = void 0, this.clientRect = null, this.registerListeners(); } @@ -23536,7 +23604,7 @@ class xf { this.restrictedLevels = [], this.firstLevel = t.firstLevel, i.config.capLevelToPlayerSize && t.video && this.startCapping(); } onLevelsUpdated(e, t) { - this.timer && Z(this.autoLevelCapping) && this.detectPlayerSize(); + this.timer && J(this.autoLevelCapping) && this.detectPlayerSize(); } // Only activate capping when playing a video stream; otherwise, multi-bitrate audio-only streams will be restricted // to the first level @@ -23567,7 +23635,7 @@ class xf { if (!t.length) return -1; const i = t.filter((s, r) => this.isLevelAllowed(s) && r <= e); - return this.clientRect = null, xf.getMaxLevelByMediaSize(i, this.mediaWidth, this.mediaHeight); + return this.clientRect = null, jf.getMaxLevelByMediaSize(i, this.mediaWidth, this.mediaHeight); } startCapping() { this.timer || (this.autoLevelCapping = Number.POSITIVE_INFINITY, self.clearInterval(this.timer), this.timer = self.setInterval(this.detectPlayerSize.bind(this), 1e3), this.detectPlayerSize()); @@ -23622,7 +23690,7 @@ class xf { return r; } } -const uC = { +const CC = { /** * text file, such as a manifest or playlist */ @@ -23659,86 +23727,86 @@ const uC = { * other */ OTHER: "o" -}, Rt = uC, cC = { +}, Mt = CC, FC = { /** * HTTP Live Streaming (HLS) */ HLS: "h" -}, hC = cC, dC = "CMCD-Object", fC = "CMCD-Request", mC = "CMCD-Session", gC = "CMCD-Status", ga = { +}, PC = FC, OC = "CMCD-Object", MC = "CMCD-Request", $C = "CMCD-Session", BC = "CMCD-Status", Da = { /** * keys whose values vary with the object being requested. */ - OBJECT: dC, + OBJECT: OC, /** * keys whose values vary with each request. */ - REQUEST: fC, + REQUEST: MC, /** * keys whose values are expected to be invariant over the life of the session. */ - SESSION: mC, + SESSION: $C, /** * keys whose values do not vary with every request or object. */ - STATUS: gC -}, pC = { - [ga.OBJECT]: ["br", "ab", "d", "ot", "tb", "tpb", "lb", "tab", "lab", "url"], - [ga.REQUEST]: ["pb", "bl", "tbl", "dl", "ltc", "mtp", "nor", "nrr", "rc", "sn", "sta", "su", "ttfb", "ttfbb", "ttlb", "cmsdd", "cmsds", "smrt", "df", "cs"], - [ga.SESSION]: ["cid", "pr", "sf", "sid", "st", "v", "msd"], - [ga.STATUS]: ["bs", "bsd", "cdn", "rtp", "bg", "pt", "ec", "e"] + STATUS: BC +}, NC = { + [Da.OBJECT]: ["br", "ab", "d", "ot", "tb", "tpb", "lb", "tab", "lab", "url"], + [Da.REQUEST]: ["pb", "bl", "tbl", "dl", "ltc", "mtp", "nor", "nrr", "rc", "sn", "sta", "su", "ttfb", "ttfbb", "ttlb", "cmsdd", "cmsds", "smrt", "df", "cs"], + [Da.SESSION]: ["cid", "pr", "sf", "sid", "st", "v", "msd"], + [Da.STATUS]: ["bs", "bsd", "cdn", "rtp", "bg", "pt", "ec", "e"] }; -class Ar { +class Fr { constructor(e, t) { - Array.isArray(e) && (e = e.map((i) => i instanceof Ar ? i : new Ar(i))), this.value = e, this.params = t; + Array.isArray(e) && (e = e.map((i) => i instanceof Fr ? i : new Fr(i))), this.value = e, this.params = t; } } -const _C = "Dict"; -function vC(n) { +const UC = "Dict"; +function GC(n) { return Array.isArray(n) ? JSON.stringify(n) : n instanceof Map ? "Map{}" : n instanceof Set ? "Set{}" : typeof n == "object" ? JSON.stringify(n) : String(n); } -function yC(n, e, t, i) { - return new Error(`failed to ${n} "${vC(e)}" as ${t}`, { +function HC(n, e, t, i) { + return new Error(`failed to ${n} "${GC(e)}" as ${t}`, { cause: i }); } -function ln(n, e, t) { - return yC("serialize", n, e, t); +function hn(n, e, t) { + return HC("serialize", n, e, t); } -class sE { +class EE { constructor(e) { this.description = e; } } -const l0 = "Bare Item", EC = "Boolean"; -function bC(n) { +const x0 = "Bare Item", VC = "Boolean"; +function qC(n) { if (typeof n != "boolean") - throw ln(n, EC); + throw hn(n, VC); return n ? "?1" : "?0"; } -function TC(n) { +function KC(n) { return btoa(String.fromCharCode(...n)); } -const SC = "Byte Sequence"; -function AC(n) { +const jC = "Byte Sequence"; +function zC(n) { if (ArrayBuffer.isView(n) === !1) - throw ln(n, SC); - return `:${TC(n)}:`; + throw hn(n, jC); + return `:${KC(n)}:`; } -const xC = "Integer"; -function DC(n) { +const WC = "Integer"; +function YC(n) { return n < -999999999999999 || 999999999999999 < n; } -function rE(n) { - if (DC(n)) - throw ln(n, xC); +function bE(n) { + if (YC(n)) + throw hn(n, WC); return n.toString(); } -function wC(n) { - return `@${rE(n.getTime() / 1e3)}`; +function XC(n) { + return `@${bE(n.getTime() / 1e3)}`; } -function aE(n, e) { +function TE(n, e) { if (n < 0) - return -aE(-n, e); + return -TE(-n, e); const t = Math.pow(10, e); if (Math.abs(n * t % 1 - 0.5) < Number.EPSILON) { const s = Math.floor(n * t); @@ -23746,90 +23814,90 @@ function aE(n, e) { } else return Math.round(n * t) / t; } -const LC = "Decimal"; -function IC(n) { - const e = aE(n, 3); +const QC = "Decimal"; +function ZC(n) { + const e = TE(n, 3); if (Math.floor(Math.abs(e)).toString().length > 12) - throw ln(n, LC); + throw hn(n, QC); const t = e.toString(); return t.includes(".") ? t : `${t}.0`; } -const kC = "String", RC = /[\x00-\x1f\x7f]+/; -function CC(n) { - if (RC.test(n)) - throw ln(n, kC); +const JC = "String", e2 = /[\x00-\x1f\x7f]+/; +function t2(n) { + if (e2.test(n)) + throw hn(n, JC); return `"${n.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`; } -function FC(n) { +function i2(n) { return n.description || n.toString().slice(7, -1); } -const PC = "Token"; -function u0(n) { - const e = FC(n); +const n2 = "Token"; +function D0(n) { + const e = i2(n); if (/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e) === !1) - throw ln(e, PC); + throw hn(e, n2); return e; } -function _d(n) { +function Bd(n) { switch (typeof n) { case "number": - if (!Z(n)) - throw ln(n, l0); - return Number.isInteger(n) ? rE(n) : IC(n); + if (!J(n)) + throw hn(n, x0); + return Number.isInteger(n) ? bE(n) : ZC(n); case "string": - return CC(n); + return t2(n); case "symbol": - return u0(n); + return D0(n); case "boolean": - return bC(n); + return qC(n); case "object": if (n instanceof Date) - return wC(n); + return XC(n); if (n instanceof Uint8Array) - return AC(n); - if (n instanceof sE) - return u0(n); + return zC(n); + if (n instanceof EE) + return D0(n); default: - throw ln(n, l0); + throw hn(n, x0); } } -const OC = "Key"; -function vd(n) { +const s2 = "Key"; +function Nd(n) { if (/^[a-z*][a-z0-9\-_.*]*$/.test(n) === !1) - throw ln(n, OC); + throw hn(n, s2); return n; } -function Df(n) { - return n == null ? "" : Object.entries(n).map(([e, t]) => t === !0 ? `;${vd(e)}` : `;${vd(e)}=${_d(t)}`).join(""); +function zf(n) { + return n == null ? "" : Object.entries(n).map(([e, t]) => t === !0 ? `;${Nd(e)}` : `;${Nd(e)}=${Bd(t)}`).join(""); } -function oE(n) { - return n instanceof Ar ? `${_d(n.value)}${Df(n.params)}` : _d(n); +function SE(n) { + return n instanceof Fr ? `${Bd(n.value)}${zf(n.params)}` : Bd(n); } -function MC(n) { - return `(${n.value.map(oE).join(" ")})${Df(n.params)}`; +function r2(n) { + return `(${n.value.map(SE).join(" ")})${zf(n.params)}`; } -function $C(n, e = { +function a2(n, e = { whitespace: !0 }) { if (typeof n != "object") - throw ln(n, _C); + throw hn(n, UC); const t = n instanceof Map ? n.entries() : Object.entries(n), i = e != null && e.whitespace ? " " : ""; return Array.from(t).map(([s, r]) => { - r instanceof Ar || (r = new Ar(r)); - let a = vd(s); - return r.value === !0 ? a += Df(r.params) : (a += "=", Array.isArray(r.value) ? a += MC(r) : a += oE(r)), a; + r instanceof Fr || (r = new Fr(r)); + let a = Nd(s); + return r.value === !0 ? a += zf(r.params) : (a += "=", Array.isArray(r.value) ? a += r2(r) : a += SE(r)), a; }).join(`,${i}`); } -function BC(n, e) { - return $C(n, e); +function o2(n, e) { + return a2(n, e); } -function NC(n) { +function l2(n) { return ["ot", "sf", "st", "e", "sta"].includes(n); } -function UC(n) { - return typeof n == "number" ? Z(n) : n != null && n !== "" && n !== !1; +function u2(n) { + return typeof n == "number" ? J(n) : n != null && n !== "" && n !== !1; } -function GC(n, e) { +function c2(n, e) { const t = new URL(n), i = new URL(e); if (t.origin !== i.origin) return n; @@ -23840,90 +23908,90 @@ function GC(n, e) { r.shift(), s.unshift(".."); return s.join("/"); } -const El = (n) => Math.round(n), HC = (n, e) => (e != null && e.baseUrl && (n = GC(n, e.baseUrl)), encodeURIComponent(n)), zo = (n) => El(n / 100) * 100, VC = { +const Nl = (n) => Math.round(n), h2 = (n, e) => (e != null && e.baseUrl && (n = c2(n, e.baseUrl)), encodeURIComponent(n)), dl = (n) => Nl(n / 100) * 100, d2 = { /** * Bitrate (kbps) rounded integer */ - br: El, + br: Nl, /** * Duration (milliseconds) rounded integer */ - d: El, + d: Nl, /** * Buffer Length (milliseconds) rounded nearest 100ms */ - bl: zo, + bl: dl, /** * Deadline (milliseconds) rounded nearest 100ms */ - dl: zo, + dl, /** * Measured Throughput (kbps) rounded nearest 100kbps */ - mtp: zo, + mtp: dl, /** * Next Object Request URL encoded */ - nor: HC, + nor: h2, /** * Requested maximum throughput (kbps) rounded nearest 100kbps */ - rtp: zo, + rtp: dl, /** * Top Bitrate (kbps) rounded integer */ - tb: El + tb: Nl }; -function qC(n, e) { +function f2(n, e) { const t = {}; if (n == null || typeof n != "object") return t; - const i = Object.keys(n).sort(), s = De({}, VC, e == null ? void 0 : e.formatters), r = e == null ? void 0 : e.filter; + const i = Object.keys(n).sort(), s = we({}, d2, e == null ? void 0 : e.formatters), r = e == null ? void 0 : e.filter; return i.forEach((a) => { if ((r == null ? void 0 : r(a)) === !1) return; let o = n[a]; const u = s[a]; - u && (o = u(o, e)), !(a === "v" && o === 1) && (a == "pr" && o === 1 || UC(o) && (NC(a) && typeof o == "string" && (o = new sE(o)), t[a] = o)); + u && (o = u(o, e)), !(a === "v" && o === 1) && (a == "pr" && o === 1 || u2(o) && (l2(a) && typeof o == "string" && (o = new EE(o)), t[a] = o)); }), t; } -function lE(n, e = {}) { - return n ? BC(qC(n, e), De({ +function AE(n, e = {}) { + return n ? o2(f2(n, e), we({ whitespace: !1 }, e)) : ""; } -function KC(n, e = {}) { +function m2(n, e = {}) { const t = {}; if (!n) return t; - const i = Object.entries(n), s = Object.entries(pC).concat(Object.entries((e == null ? void 0 : e.customHeaderMap) || {})), r = i.reduce((a, o) => { + const i = Object.entries(n), s = Object.entries(NC).concat(Object.entries((e == null ? void 0 : e.customHeaderMap) || {})), r = i.reduce((a, o) => { var u, l; - const [c, h] = o, d = ((u = s.find((f) => f[1].includes(c))) === null || u === void 0 ? void 0 : u[0]) || ga.REQUEST; + const [c, h] = o, d = ((u = s.find((f) => f[1].includes(c))) === null || u === void 0 ? void 0 : u[0]) || Da.REQUEST; return (l = a[d]) !== null && l !== void 0 || (a[d] = {}), a[d][c] = h, a; }, {}); - return Object.entries(r).reduce((a, [o, u]) => (a[o] = lE(u, e), a), t); + return Object.entries(r).reduce((a, [o, u]) => (a[o] = AE(u, e), a), t); } -function jC(n, e, t) { - return De(n, KC(e, t)); +function g2(n, e, t) { + return we(n, m2(e, t)); } -const zC = "CMCD"; -function WC(n, e = {}) { +const p2 = "CMCD"; +function _2(n, e = {}) { if (!n) return ""; - const t = lE(n, e); - return `${zC}=${encodeURIComponent(t)}`; + const t = AE(n, e); + return `${p2}=${encodeURIComponent(t)}`; } -const c0 = /CMCD=[^&#]+/; -function YC(n, e, t) { - const i = WC(e, t); +const w0 = /CMCD=[^&#]+/; +function v2(n, e, t) { + const i = _2(e, t); if (!i) return n; - if (c0.test(n)) - return n.replace(c0, i); + if (w0.test(n)) + return n.replace(w0, i); const s = n.includes("?") ? "&" : "?"; return `${n}${s}${i}`; } -class XC { +class y2 { constructor(e) { this.hls = void 0, this.config = void 0, this.media = void 0, this.sid = void 0, this.cid = void 0, this.useHeaders = !1, this.includeKeys = void 0, this.initialized = !1, this.starved = !1, this.buffering = !0, this.audioBuffer = void 0, this.videoBuffer = void 0, this.onWaiting = () => { this.initialized && (this.starved = !0), this.buffering = !0; @@ -23932,7 +24000,7 @@ class XC { }, this.applyPlaylistData = (s) => { try { this.apply(s, { - ot: Rt.MANIFEST, + ot: Mt.MANIFEST, su: !this.initialized }); } catch (r) { @@ -23947,7 +24015,7 @@ class XC { d: (a || r).duration * 1e3, ot: u }; - (u === Rt.VIDEO || u === Rt.AUDIO || u == Rt.MUXED) && (l.br = o.bitrate / 1e3, l.tb = this.getTopBandwidth(u) / 1e3, l.bl = this.getBufferLength(u)); + (u === Mt.VIDEO || u === Mt.AUDIO || u == Mt.MUXED) && (l.br = o.bitrate / 1e3, l.tb = this.getTopBandwidth(u) / 1e3, l.bl = this.getBufferLength(u)); const c = a ? this.getNextPart(a) : this.getNextFrag(r); c != null && c.url && c.url !== r.url && (l.nor = c.url), this.apply(s, l); } catch (r) { @@ -23987,7 +24055,7 @@ class XC { var e; return { v: 1, - sf: hC.HLS, + sf: PC.HLS, sid: this.sid, cid: this.cid, pr: (e = this.media) == null ? void 0 : e.playbackRate, @@ -23998,8 +24066,8 @@ class XC { * Apply CMCD data to a request. */ apply(e, t = {}) { - De(t, this.createData()); - const i = t.ot === Rt.INIT || t.ot === Rt.VIDEO || t.ot === Rt.MUXED; + we(t, this.createData()); + const i = t.ot === Mt.INIT || t.ot === Mt.VIDEO || t.ot === Mt.MUXED; this.starved && i && (t.bs = !0, t.su = !0, this.starved = !1), t.su == null && (t.su = this.buffering); const { includeKeys: s @@ -24008,7 +24076,7 @@ class XC { const r = { baseUrl: e.url }; - this.useHeaders ? (e.headers || (e.headers = {}), jC(e.headers, t, r)) : e.url = YC(e.url, t, r); + this.useHeaders ? (e.headers || (e.headers = {}), g2(e.headers, t, r)) : e.url = v2(e.url, t, r); } getNextFrag(e) { var t; @@ -24043,13 +24111,13 @@ class XC { type: t } = e; if (t === "subtitle") - return Rt.TIMED_TEXT; + return Mt.TIMED_TEXT; if (e.sn === "initSegment") - return Rt.INIT; + return Mt.INIT; if (t === "audio") - return Rt.AUDIO; + return Mt.AUDIO; if (t === "main") - return this.hls.audioTracks.length ? Rt.VIDEO : Rt.MUXED; + return this.hls.audioTracks.length ? Mt.VIDEO : Mt.MUXED; } /** * Get the highest bitrate. @@ -24057,7 +24125,7 @@ class XC { getTopBandwidth(e) { let t = 0, i; const s = this.hls; - if (e === Rt.AUDIO) + if (e === Mt.AUDIO) i = s.audioTracks; else { const r = s.maxAutoLevel, a = r > -1 ? r + 1 : s.levels.length; @@ -24071,8 +24139,8 @@ class XC { * Get the buffer length for a media type in milliseconds */ getBufferLength(e) { - const t = this.media, i = e === Rt.AUDIO ? this.audioBuffer : this.videoBuffer; - return !i || !t ? NaN : le.bufferInfo(i, t.currentTime, this.config.maxBufferHole).len * 1e3; + const t = this.media, i = e === Mt.AUDIO ? this.audioBuffer : this.videoBuffer; + return !i || !t ? NaN : ue.bufferInfo(i, t.currentTime, this.config.maxBufferHole).len * 1e3; } /** * Create a playlist loader @@ -24131,8 +24199,8 @@ class XC { }; } } -const QC = 3e5; -class ZC extends Fi { +const E2 = 3e5; +class b2 extends Bi { constructor(e) { super("content-steering", e.logger), this.hls = void 0, this.loader = null, this.uri = null, this.pathwayId = ".", this._pathwayPriority = null, this.timeToLoad = 300, this.reloadTimer = -1, this.updated = 0, this.started = !1, this.enabled = !0, this.levels = null, this.audioTracks = null, this.subtitleTracks = null, this.penalizedPathways = {}, this.hls = e, this.registerListeners(); } @@ -24194,7 +24262,7 @@ class ZC extends Fi { const { errorAction: i } = t; - if ((i == null ? void 0 : i.action) === yt.SendAlternateToPenaltyBox && i.flags === Ei.MoveAllAlternatesMatchingHost) { + if ((i == null ? void 0 : i.action) === At.SendAlternateToPenaltyBox && i.flags === Ri.MoveAllAlternatesMatchingHost) { const s = this.levels; let r = this._pathwayPriority, a = this.pathwayId; if (t.context) { @@ -24205,7 +24273,7 @@ class ZC extends Fi { } = t.context; o && s ? a = this.getPathwayForGroupId(o, l, a) : u && (a = u); } - a in this.penalizedPathways || (this.penalizedPathways[a] = performance.now()), !r && s && (r = this.pathways()), r && r.length > 1 && (this.updatePathwayPriority(r), i.resolved = this.pathwayId !== a), t.details === O.BUFFER_APPEND_ERROR && !t.fatal ? i.resolved = !0 : i.resolved || this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${a} levels: ${s && s.length} priorities: ${Oe(r)} penalized: ${Oe(this.penalizedPathways)}`); + a in this.penalizedPathways || (this.penalizedPathways[a] = performance.now()), !r && s && (r = this.pathways()), r && r.length > 1 && (this.updatePathwayPriority(r), i.resolved = this.pathwayId !== a), t.details === P.BUFFER_APPEND_ERROR && !t.fatal ? i.resolved = !0 : i.resolved || this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${a} levels: ${s && s.length} priorities: ${$e(r)} penalized: ${$e(this.penalizedPathways)}`); } } filterParsedLevels(e) { @@ -24225,7 +24293,7 @@ class ZC extends Fi { let t; const i = this.penalizedPathways, s = performance.now(); Object.keys(i).forEach((r) => { - s - i[r] > QC && delete i[r]; + s - i[r] > E2 && delete i[r]; }); for (let r = 0; r < e.length; r++) { const a = e[r]; @@ -24235,7 +24303,7 @@ class ZC extends Fi { return; const o = this.hls.nextLoadLevel, u = this.hls.levels[o]; if (t = this.getLevelsForPathway(a), t.length > 0) { - this.log(`Setting Pathway to "${a}"`), this.pathwayId = a, Fy(t), this.hls.trigger(b.LEVELS_UPDATED, { + this.log(`Setting Pathway to "${a}"`), this.pathwayId = a, Yy(t), this.hls.trigger(b.LEVELS_UPDATED, { levels: t }); const l = this.hls.levels[o]; @@ -24265,11 +24333,11 @@ class ZC extends Fi { if (t.some((c) => c.pathwayId === a)) return; const l = this.getLevelsForPathway(o).map((c) => { - const h = new Be(c.attrs); + const h = new Ue(c.attrs); h["PATHWAY-ID"] = a; const d = h.AUDIO && `${h.AUDIO}_clone_${a}`, f = h.SUBTITLES && `${h.SUBTITLES}_clone_${a}`; d && (i[h.AUDIO] = d, h.AUDIO = d), f && (s[h.SUBTITLES] = f, h.SUBTITLES = f); - const m = uE(c.uri, h["STABLE-VARIANT-ID"], "PER-VARIANT-URIS", u), g = new Ma({ + const m = xE(c.uri, h["STABLE-VARIANT-ID"], "PER-VARIANT-URIS", u), g = new Wa({ attrs: h, audioCodec: c.audioCodec, bitrate: c.bitrate, @@ -24287,7 +24355,7 @@ class ZC extends Fi { g.addGroupId("text", `${c.subtitleGroups[p]}_clone_${a}`); return g; }); - t.push(...l), h0(this.audioTracks, i, u, a), h0(this.subtitleTracks, s, u, a); + t.push(...l), L0(this.audioTracks, i, u, a), L0(this.subtitleTracks, s, u, a); }); } loadSteeringManifest(e) { @@ -24376,16 +24444,16 @@ class ZC extends Fi { }, t); } } -function h0(n, e, t, i) { +function L0(n, e, t, i) { n && Object.keys(e).forEach((s) => { const r = n.filter((a) => a.groupId === s).map((a) => { - const o = De({}, a); - return o.details = void 0, o.attrs = new Be(o.attrs), o.url = o.attrs.URI = uE(a.url, a.attrs["STABLE-RENDITION-ID"], "PER-RENDITION-URIS", t), o.groupId = o.attrs["GROUP-ID"] = e[s], o.attrs["PATHWAY-ID"] = i, o; + const o = we({}, a); + return o.details = void 0, o.attrs = new Ue(o.attrs), o.url = o.attrs.URI = xE(a.url, a.attrs["STABLE-RENDITION-ID"], "PER-RENDITION-URIS", t), o.groupId = o.attrs["GROUP-ID"] = e[s], o.attrs["PATHWAY-ID"] = i, o; }); n.push(...r); }); } -function uE(n, e, t, i) { +function xE(n, e, t, i) { const { HOST: s, PARAMS: r, @@ -24398,15 +24466,15 @@ function uE(n, e, t, i) { l && u.searchParams.set(l, r[l]); }), u.href; } -function ti(n, e, t) { - Di(n, e, t), n.addEventListener(e, t); +function ri(n, e, t) { + Mi(n, e, t), n.addEventListener(e, t); } -function Di(n, e, t) { +function Mi(n, e, t) { n.removeEventListener(e, t); } -class mr extends Fi { +class Dr extends Bi { constructor(e) { - super("eme", e.logger), this.hls = void 0, this.config = void 0, this.media = null, this.keyFormatPromise = null, this.keySystemAccessPromises = {}, this._requestLicenseFailureCount = 0, this.mediaKeySessions = [], this.keyIdToKeySessionPromise = {}, this.mediaKeys = null, this.setMediaKeysQueue = mr.CDMCleanupPromise ? [mr.CDMCleanupPromise] : [], this.onWaitingForKey = (t) => { + super("eme", e.logger), this.hls = void 0, this.config = void 0, this.media = null, this.keyFormatPromise = null, this.keySystemAccessPromises = {}, this._requestLicenseFailureCount = 0, this.mediaKeySessions = [], this.keyIdToKeySessionPromise = {}, this.mediaKeys = null, this.setMediaKeysQueue = Dr.CDMCleanupPromise ? [Dr.CDMCleanupPromise] : [], this.onWaitingForKey = (t) => { this.log(`"${t.type}" event`); }, this.hls = e, this.config = e.config, this.registerListeners(); } @@ -24428,7 +24496,7 @@ class mr extends Fi { } = this.config, s = t[e]; if (s) return s.licenseUrl; - if (e === Ve.WIDEVINE && i) + if (e === ze.WIDEVINE && i) return i; } getLicenseServerUrlOrThrow(e) { @@ -24454,9 +24522,9 @@ class mr extends Fi { keySystem: c, mediaKeys: h })).catch((h) => { - l.length ? u(l) : h instanceof Yt ? o(h) : o(new Yt({ - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_NO_ACCESS, + l.length ? u(l) : h instanceof ei ? o(h) : o(new ei({ + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_NO_ACCESS, error: h, fatal: !0 }, h.message)); @@ -24471,15 +24539,15 @@ class mr extends Fi { } = this.config; if (typeof i != "function") { let s = `Configured requestMediaKeySystemAccess is not a function ${i}`; - return Dy === null && self.location.protocol === "http:" && (s = `navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`), Promise.reject(new Error(s)); + return Hy === null && self.location.protocol === "http:" && (s = `navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`), Promise.reject(new Error(s)); } return i(e, t); } getMediaKeysPromise(e, t, i) { - const s = Vk(e, t, i, this.config.drmSystemOptions), r = this.keySystemAccessPromises[e]; + const s = dR(e, t, i, this.config.drmSystemOptions), r = this.keySystemAccessPromises[e]; let a = r == null ? void 0 : r.keySystemAccess; if (!a) { - this.log(`Requesting encrypted media "${e}" key-system access with config: ${Oe(s)}`), a = this.requestMediaKeySystemAccess(e, s); + this.log(`Requesting encrypted media "${e}" key-system access with config: ${$e(s)}`), a = this.requestMediaKeySystemAccess(e, s); const o = this.keySystemAccessPromises[e] = { keySystemAccess: a }; @@ -24500,7 +24568,7 @@ class mr extends Fi { keySystem: t, mediaKeys: i }) { - this.log(`Creating key-system session "${t}" keyId: ${cs.hexDump(e.keyId || [])}`); + this.log(`Creating key-system session "${t}" keyId: ${gs.hexDump(e.keyId || [])}`); const s = i.createSession(), r = { decryptdata: e, keySystem: t, @@ -24524,12 +24592,12 @@ class mr extends Fi { throw new Error("Could not read keyId of undefined decryptdata"); if (e.keyId === null) throw new Error("keyId is null"); - return cs.hexDump(e.keyId); + return gs.hexDump(e.keyId); } updateKeySession(e, t) { var i; const s = e.mediaKeysSession; - return this.log(`Updating key-session "${s.sessionId}" for keyID ${cs.hexDump(((i = e.decryptdata) == null ? void 0 : i.keyId) || [])} + return this.log(`Updating key-session "${s.sessionId}" for keyID ${gs.hexDump(((i = e.decryptdata) == null ? void 0 : i.keyId) || [])} } (data length: ${t && t.byteLength})`), s.update(t); } getSelectedKeySystemFormats() { @@ -24540,7 +24608,7 @@ class mr extends Fi { hasMediaKeys: e }) => !!e).map(({ keySystem: e - }) => $p(e)).filter((e) => !!e); + }) => e0(e)).filter((e) => !!e); } getKeySystemAccess(e) { return this.getKeySystemSelectionPromise(e).then(({ @@ -24552,7 +24620,7 @@ class mr extends Fi { return new Promise((t, i) => this.getKeySystemSelectionPromise(e).then(({ keySystem: s }) => { - const r = $p(s); + const r = e0(s); r ? t(r) : i(new Error(`Unable to find format for key-system "${s}"`)); }).catch(i)); } @@ -24561,7 +24629,7 @@ class mr extends Fi { return this.keyFormatPromise || (this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`), this.keyFormatPromise = this.getKeyFormatPromise(t)), this.keyFormatPromise; } getKeyFormatPromise(e) { - const t = _l(this.config), i = e.map(hd).filter((s) => !!s && t.indexOf(s) !== -1); + const t = Ml(this.config), i = e.map(Cd).filter((s) => !!s && t.indexOf(s) !== -1); return this.selectKeySystem(i); } loadKey(e) { @@ -24585,9 +24653,9 @@ class mr extends Fi { throw new Error("invalid state"); } handleError(e) { - this.hls && (this.error(e.message), e instanceof Yt ? this.hls.trigger(b.ERROR, e.data) : this.hls.trigger(b.ERROR, { - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_NO_KEYS, + this.hls && (this.error(e.message), e instanceof ei ? this.hls.trigger(b.ERROR, e.data) : this.hls.trigger(b.ERROR, { + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_NO_KEYS, error: e, fatal: !0 })); @@ -24595,18 +24663,18 @@ class mr extends Fi { getKeySystemForKeyPromise(e) { const t = this.getKeyIdString(e), i = this.keyIdToKeySessionPromise[t]; if (!i) { - const s = hd(e.keyFormat), r = s ? [s] : _l(this.config); + const s = Cd(e.keyFormat), r = s ? [s] : Ml(this.config); return this.attemptKeySystemAccess(r); } return i; } getKeySystemSelectionPromise(e) { - if (e.length || (e = _l(this.config)), e.length === 0) - throw new Yt({ - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_NO_CONFIGURED_LICENSE, + if (e.length || (e = Ml(this.config)), e.length === 0) + throw new ei({ + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_NO_CONFIGURED_LICENSE, fatal: !0 - }, `Missing key-system license configuration options ${Oe({ + }, `Missing key-system license configuration options ${$e({ drmSystems: this.config.drmSystems })}`); return this.attemptKeySystemAccess(e); @@ -24643,7 +24711,7 @@ class mr extends Fi { return this.log(`Skipping key-session request for "${s}" (no initData)`), Promise.resolve(e); const l = this.getKeyIdString(e.decryptdata); this.log(`Generating key-session request for "${s}": ${l} (init data type: ${t} length: ${i ? i.byteLength : null})`); - const c = new _f(), h = e._onmessage = (m) => { + const c = new Bf(), h = e._onmessage = (m) => { const g = e.mediaKeysSession; if (!g) { c.emit("error", new Error("invalid state")); @@ -24655,7 +24723,7 @@ class mr extends Fi { } = m; this.log(`"${p}" message event for session "${g.sessionId}" message size: ${y.byteLength}`), p === "license-request" || p === "license-renewal" ? this.renewLicense(e, y).catch((v) => { c.eventNames().length ? c.emit("error", v) : this.handleError(v); - }) : p === "license-release" ? e.keySystem === Ve.FAIRPLAY && (this.updateKeySession(e, cd("acknowledged")), this.removeSession(e)) : this.warn(`unhandled media key message type "${p}"`); + }) : p === "license-release" ? e.keySystem === ze.FAIRPLAY && (this.updateKeySession(e, Rd("acknowledged")), this.removeSession(e)) : this.warn(`unhandled media key message type "${p}"`); }, d = e._onkeystatuseschange = (m) => { if (!e.mediaKeysSession) { c.emit("error", new Error("invalid state")); @@ -24665,16 +24733,16 @@ class mr extends Fi { const p = e.keyStatus; c.emit("keyStatus", p), p === "expired" && (this.warn(`${e.keySystem} expired for key ${l}`), this.renewKeySession(e)); }; - ti(e.mediaKeysSession, "message", h), ti(e.mediaKeysSession, "keystatuseschange", d); + ri(e.mediaKeysSession, "message", h), ri(e.mediaKeysSession, "keystatuseschange", d); const f = new Promise((m, g) => { c.on("error", g), c.on("keyStatus", (p) => { - p.startsWith("usable") ? m() : p === "output-restricted" ? g(new Yt({ - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED, + p.startsWith("usable") ? m() : p === "output-restricted" ? g(new ei({ + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED, fatal: !1 - }, "HDCP level output restricted")) : p === "internal-error" ? g(new Yt({ - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_STATUS_INTERNAL_ERROR, + }, "HDCP level output restricted")) : p === "internal-error" ? g(new ei({ + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_STATUS_INTERNAL_ERROR, fatal: !0 }, `key status changed to "${p}"`)) : p === "expired" ? g(new Error("key expired while generating request")) : this.warn(`unhandled key status change "${p}"`); }); @@ -24683,9 +24751,9 @@ class mr extends Fi { var m; this.log(`Request generated for key-session "${(m = e.mediaKeysSession) == null ? void 0 : m.sessionId}" keyId: ${l}`); }).catch((m) => { - throw new Yt({ - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_NO_SESSION, + throw new ei({ + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_NO_SESSION, error: m, fatal: !1 }, `Error generating key-session request: ${m}`); @@ -24699,7 +24767,7 @@ class mr extends Fi { const s = i; i = t, t = s; } - this.log(`key status change "${t}" for keyStatuses keyId: ${cs.hexDump("buffer" in i ? new Uint8Array(i.buffer, i.byteOffset, i.byteLength) : new Uint8Array(i))} session keyId: ${cs.hexDump(new Uint8Array(e.decryptdata.keyId || []))} uri: ${e.decryptdata.uri}`), e.keyStatus = t; + this.log(`key status change "${t}" for keyStatuses keyId: ${gs.hexDump("buffer" in i ? new Uint8Array(i.buffer, i.byteOffset, i.byteLength) : new Uint8Array(i))} session keyId: ${gs.hexDump(new Uint8Array(e.decryptdata.keyId || []))} uri: ${e.decryptdata.uri}`), e.keyStatus = t; }); } fetchServerCertificate(e) { @@ -24719,21 +24787,21 @@ class mr extends Fi { a(d.data); }, onError: (d, f, m, g) => { - o(new Yt({ - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED, + o(new ei({ + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED, fatal: !0, networkDetails: m, - response: Le({ + response: Ie({ url: u.url, data: void 0 }, d) }, `"${e}" certificate request failed (${r}). Status: ${d.code} (${d.text})`)); }, onTimeout: (d, f, m) => { - o(new Yt({ - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED, + o(new ei({ + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED, fatal: !0, networkDetails: m, response: { @@ -24754,9 +24822,9 @@ class mr extends Fi { e.setServerCertificate(i).then((a) => { this.log(`setServerCertificate ${a ? "success" : "not supported by CDM"} (${i == null ? void 0 : i.byteLength}) on "${t}"`), s(e); }).catch((a) => { - r(new Yt({ - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED, + r(new ei({ + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED, error: a, fatal: !0 }, a.message)); @@ -24765,9 +24833,9 @@ class mr extends Fi { } renewLicense(e, t) { return this.requestLicense(e, new Uint8Array(t)).then((i) => this.updateKeySession(e, new Uint8Array(i)).catch((s) => { - throw new Yt({ - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_SESSION_UPDATE_FAILED, + throw new ei({ + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_SESSION_UPDATE_FAILED, error: s, fatal: !0 }, s.message); @@ -24790,7 +24858,7 @@ class mr extends Fi { const u = s.querySelector("Challenge"), l = u == null ? void 0 : u.textContent; if (!l) throw new Error("Cannot find <Challenge> in key message"); - return cd(atob(l)); + return Rd(atob(l)); } setupLicenseXHR(e, t, i, s) { const r = this.config.licenseXhrSetup; @@ -24835,9 +24903,9 @@ class mr extends Fi { } else { const u = i.errorRetry, l = u ? u.maxNumRetry : 0; if (this._requestLicenseFailureCount++, this._requestLicenseFailureCount > l || o.status >= 400 && o.status < 500) - r(new Yt({ - type: ie.KEY_SYSTEM_ERROR, - details: O.KEY_SYSTEM_LICENSE_REQUEST_FAILED, + r(new ei({ + type: ne.KEY_SYSTEM_ERROR, + details: P.KEY_SYSTEM_LICENSE_REQUEST_FAILED, fatal: !0, networkDetails: o, response: { @@ -24856,7 +24924,7 @@ class mr extends Fi { xhr: u, licenseChallenge: l }) => { - e.keySystem == Ve.PLAYREADY && (l = this.unpackPlayReadyKeyMessage(u, l)), u.send(l); + e.keySystem == ze.PLAYREADY && (l = this.unpackPlayReadyKeyMessage(u, l)), u.send(l); }); }); } @@ -24867,32 +24935,32 @@ class mr extends Fi { if (!this.config.emeEnabled) return; const i = t.media; - this.media = i, ti(i, "waitingforkey", this.onWaitingForKey); + this.media = i, ri(i, "waitingforkey", this.onWaitingForKey); } onMediaDetached() { const e = this.media; - e && (Di(e, "waitingforkey", this.onWaitingForKey), this.media = null, this.mediaKeys = null); + e && (Mi(e, "waitingforkey", this.onWaitingForKey), this.media = null, this.mediaKeys = null); } _clear() { var e; if (this._requestLicenseFailureCount = 0, this.keyIdToKeySessionPromise = {}, !this.mediaKeys && !this.mediaKeySessions.length) return; const t = this.media, i = this.mediaKeySessions.slice(); - this.mediaKeySessions = [], this.mediaKeys = null, mu.clearKeyUriToKeyIdMap(); + this.mediaKeySessions = [], this.mediaKeys = null, Ou.clearKeyUriToKeyIdMap(); const s = i.length; - mr.CDMCleanupPromise = Promise.all(i.map((r) => this.removeSession(r)).concat(t == null || (e = t.setMediaKeys(null)) == null ? void 0 : e.catch((r) => { + Dr.CDMCleanupPromise = Promise.all(i.map((r) => this.removeSession(r)).concat(t == null || (e = t.setMediaKeys(null)) == null ? void 0 : e.catch((r) => { var a; this.log(`Could not clear media keys: ${r}`), (a = this.hls) == null || a.trigger(b.ERROR, { - type: ie.OTHER_ERROR, - details: O.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR, + type: ne.OTHER_ERROR, + details: P.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR, fatal: !1, error: new Error(`Could not clear media keys: ${r}`) }); }))).catch((r) => { var a; this.log(`Could not close sessions and clear media keys: ${r}`), (a = this.hls) == null || a.trigger(b.ERROR, { - type: ie.OTHER_ERROR, - details: O.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR, + type: ne.OTHER_ERROR, + details: P.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR, fatal: !1, error: new Error(`Could not close sessions and clear media keys: ${r}`) }); @@ -24923,21 +24991,21 @@ class mr extends Fi { const { drmSystemOptions: r } = this.config; - return (Kk(r) ? new Promise((o, u) => { + return (mR(r) ? new Promise((o, u) => { self.setTimeout(() => u(new Error("MediaKeySession.remove() timeout")), 8e3), t.remove().then(o); }) : Promise.resolve()).catch((o) => { var u; this.log(`Could not remove session: ${o}`), (u = this.hls) == null || u.trigger(b.ERROR, { - type: ie.OTHER_ERROR, - details: O.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR, + type: ne.OTHER_ERROR, + details: P.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR, fatal: !1, error: new Error(`Could not remove session: ${o}`) }); }).then(() => t.close()).catch((o) => { var u; this.log(`Could not close session: ${o}`), (u = this.hls) == null || u.trigger(b.ERROR, { - type: ie.OTHER_ERROR, - details: O.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR, + type: ne.OTHER_ERROR, + details: P.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR, fatal: !1, error: new Error(`Could not close session: ${o}`) }); @@ -24945,13 +25013,13 @@ class mr extends Fi { } } } -mr.CDMCleanupPromise = void 0; -class Yt extends Error { +Dr.CDMCleanupPromise = void 0; +class ei extends Error { constructor(e, t) { super(t), this.data = void 0, e.error || (e.error = new Error(t)), this.data = e, e.err = e.error; } } -class JC { +class T2 { constructor(e) { this.hls = void 0, this.isVideoPlaybackQualityAvailable = !1, this.timer = void 0, this.media = null, this.lastTime = void 0, this.lastDroppedFrames = 0, this.lastDecodedFrames = 0, this.streamController = void 0, this.hls = e, this.registerListeners(); } @@ -25007,7 +25075,7 @@ class JC { this.checkFPS(e, e.webkitDecodedFrameCount, e.webkitDroppedFrameCount); } } -function cE(n, e) { +function DE(n, e) { let t; try { t = new Event("addtrack"); @@ -25016,40 +25084,40 @@ function cE(n, e) { } t.track = n, e.dispatchEvent(t); } -function hE(n, e) { +function wE(n, e) { const t = n.mode; if (t === "disabled" && (n.mode = "hidden"), n.cues && !n.cues.getCueById(e.id)) try { if (n.addCue(e), !n.cues.getCueById(e.id)) throw new Error(`addCue is failed for: ${e}`); } catch (i) { - Ee.debug(`[texttrack-utils]: ${i}`); + Te.debug(`[texttrack-utils]: ${i}`); try { const s = new self.TextTrackCue(e.startTime, e.endTime, e.text); s.id = e.id, n.addCue(s); } catch (s) { - Ee.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${s}`); + Te.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${s}`); } } t === "disabled" && (n.mode = t); } -function ar(n, e) { +function vr(n, e) { const t = n.mode; if (t === "disabled" && (n.mode = "hidden"), n.cues) for (let i = n.cues.length; i--; ) e && n.cues[i].removeEventListener("enter", e), n.removeCue(n.cues[i]); t === "disabled" && (n.mode = t); } -function yd(n, e, t, i) { +function Ud(n, e, t, i) { const s = n.mode; if (s === "disabled" && (n.mode = "hidden"), n.cues && n.cues.length > 0) { - const r = t2(n.cues, e, t); + const r = A2(n.cues, e, t); for (let a = 0; a < r.length; a++) (!i || i(r[a])) && n.removeCue(r[a]); } s === "disabled" && (n.mode = s); } -function e2(n, e) { +function S2(n, e) { if (e <= n[0].startTime) return 0; const t = n.length - 1; @@ -25065,8 +25133,8 @@ function e2(n, e) { return r; return n[i].startTime - e < e - n[s].startTime ? i : s; } -function t2(n, e, t) { - const i = [], s = e2(n, e); +function A2(n, e, t) { + const i = [], s = S2(n, e); if (s > -1) for (let r = s, a = n.length; r < a; r++) { const o = n[r]; @@ -25077,7 +25145,7 @@ function t2(n, e, t) { } return i; } -function bl(n) { +function Ul(n) { const e = []; for (let t = 0; t < n.length; t++) { const i = n[t]; @@ -25085,13 +25153,13 @@ function bl(n) { } return e; } -class i2 extends Af { +class x2 extends Kf { constructor(e) { super(e, "subtitle-track-controller"), this.media = null, this.tracks = [], this.groupIds = null, this.tracksInGroup = [], this.trackId = -1, this.currentTrack = null, this.selectDefaultTrack = !0, this.queuedDefaultTrack = -1, this.useTextTrackPolling = !1, this.subtitlePollingInterval = -1, this._subtitleDisplay = !0, this.asyncPollTrackChange = () => this.pollTrackChange(0), this.onTextTracksChanged = () => { if (this.useTextTrackPolling || self.clearInterval(this.subtitlePollingInterval), !this.media || !this.hls.config.renderTextTracksNatively) return; let t = null; - const i = bl(this.media.textTracks); + const i = Ul(this.media.textTracks); for (let r = 0; r < i.length; r++) if (i[r].mode === "hidden") t = i[r]; @@ -25138,8 +25206,8 @@ class i2 extends Af { const s = !!t.transferMedia; if (self.clearInterval(this.subtitlePollingInterval), this.useTextTrackPolling || i.textTracks.removeEventListener("change", this.asyncPollTrackChange), this.trackId > -1 && (this.queuedDefaultTrack = this.trackId), this.subtitleTrack = -1, this.media = null, s) return; - bl(i.textTracks).forEach((a) => { - ar(a); + Ul(i.textTracks).forEach((a) => { + vr(a); }); } onManifestLoading() { @@ -25187,11 +25255,11 @@ class i2 extends Af { const o = this.hls.config.subtitlePreference; if (!r && o) { this.selectDefaultTrack = !1; - const c = tn(o, a); + const c = rn(o, a); if (c > -1) r = a[c]; else { - const h = tn(o, this.tracks); + const h = rn(o, this.tracks); r = this.tracks[h]; } } @@ -25207,18 +25275,18 @@ class i2 extends Af { const t = this.tracksInGroup, i = this.selectDefaultTrack; for (let s = 0; s < t.length; s++) { const r = t[s]; - if (!(i && !r.default || !i && !e) && (!e || Ts(r, e))) + if (!(i && !r.default || !i && !e) && (!e || Is(r, e))) return s; } if (e) { for (let s = 0; s < t.length; s++) { const r = t[s]; - if (Ga(e.attrs, r.attrs, ["LANGUAGE", "ASSOC-LANGUAGE", "CHARACTERISTICS"])) + if (Ja(e.attrs, r.attrs, ["LANGUAGE", "ASSOC-LANGUAGE", "CHARACTERISTICS"])) return s; } for (let s = 0; s < t.length; s++) { const r = t[s]; - if (Ga(e.attrs, r.attrs, ["LANGUAGE"])) + if (Ja(e.attrs, r.attrs, ["LANGUAGE"])) return s; } } @@ -25229,7 +25297,7 @@ class i2 extends Af { const t = this.tracksInGroup; for (let i = 0; i < t.length; i++) { const s = t[i]; - if (pd(s, e)) + if ($d(s, e)) return i; } } @@ -25259,9 +25327,9 @@ class i2 extends Af { const t = this.allSubtitleTracks; if (this.selectDefaultTrack = !1, t.length) { const i = this.currentTrack; - if (i && Ts(e, i)) + if (i && Is(e, i)) return i; - const s = tn(e, this.tracksInGroup); + const s = rn(e, this.tracksInGroup); if (s > -1) { const r = this.tracksInGroup[s]; return this.setSubtitleTrack(s), r; @@ -25269,7 +25337,7 @@ class i2 extends Af { if (i) return null; { - const r = tn(e, t); + const r = rn(e, t); if (r > -1) return t[r]; } @@ -25303,9 +25371,9 @@ class i2 extends Af { } = this; if (!e) return; - const t = bl(e.textTracks), i = this.currentTrack; + const t = Ul(e.textTracks), i = this.currentTrack; let s; - if (i && (s = t.filter((r) => pd(i, r))[0], s || this.warn(`Unable to find subtitle TextTrack with name "${i.name}" and language "${i.lang}"`)), [].slice.call(t).forEach((r) => { + if (i && (s = t.filter((r) => $d(i, r))[0], s || this.warn(`Unable to find subtitle TextTrack with name "${i.name}" and language "${i.lang}"`)), [].slice.call(t).forEach((r) => { r.mode !== "disabled" && r !== s && (r.mode = "disabled"); }), s) { const r = this.subtitleDisplay ? "showing" : "hidden"; @@ -25322,7 +25390,7 @@ class i2 extends Af { this.queuedDefaultTrack = e; return; } - if (e < -1 || e >= t.length || !Z(e)) { + if (e < -1 || e >= t.length || !J(e)) { this.warn(`Invalid subtitle track id: ${e}`); return; } @@ -25356,7 +25424,7 @@ class i2 extends Af { this.loadPlaylist(h); } } -function n2() { +function D2() { try { return crypto.randomUUID(); } catch { @@ -25372,20 +25440,20 @@ function n2() { } } } -function wa(n) { +function Ba(n) { let e = 5381, t = n.length; for (; t; ) e = e * 33 ^ n.charCodeAt(--t); return (e >>> 0).toString(); } -const gr = 0.025; -let jl = /* @__PURE__ */ function(n) { +const wr = 0.025; +let cu = /* @__PURE__ */ function(n) { return n[n.Point = 0] = "Point", n[n.Range = 1] = "Range", n; }({}); -function s2(n, e, t) { - return `${n.identifier}-${t + 1}-${wa(e)}`; +function w2(n, e, t) { + return `${n.identifier}-${t + 1}-${Ba(e)}`; } -class r2 { +class L2 { constructor(e, t) { this.base = void 0, this._duration = null, this._timelineStart = null, this.appendInPlaceDisabled = void 0, this.appendInPlaceStarted = void 0, this.dateRange = void 0, this.hasPlayed = !1, this.cumulativeDuration = 0, this.resumeOffset = NaN, this.playoutLimit = NaN, this.restrictions = { skip: !1, @@ -25423,7 +25491,7 @@ class r2 { if (this.snapOptions.out) { const t = this.dateRange.tagAnchor; if (t) - return rh(e, t); + return xh(e, t); } return e; } @@ -25435,13 +25503,13 @@ class r2 { return !0; const e = this.dateRange.tagAnchor; if (e) { - const t = this.dateRange.startTime, i = rh(t, e); + const t = this.dateRange.startTime, i = xh(t, e); return t - i < 0.1; } return !1; } get resumptionOffset() { - const e = this.resumeOffset, t = Z(e) ? e : this.duration; + const e = this.resumeOffset, t = J(e) ? e : this.duration; return this.cumulativeDuration + t; } get resumeTime() { @@ -25449,13 +25517,13 @@ class r2 { if (this.snapOptions.in) { const t = this.resumeAnchor; if (t) - return rh(e, t); + return xh(e, t); } return e; } get appendInPlace() { return this.appendInPlaceStarted ? !0 : this.appendInPlaceDisabled ? !1 : !!(!this.cue.once && !this.cue.pre && // preroll starts at startPosition before startPosition is known (live) - this.startIsAligned && (isNaN(this.playoutLimit) && isNaN(this.resumeOffset) || this.resumeOffset && this.duration && Math.abs(this.resumeOffset - this.duration) < gr)); + this.startIsAligned && (isNaN(this.playoutLimit) && isNaN(this.resumeOffset) || this.resumeOffset && this.duration && Math.abs(this.resumeOffset - this.duration) < wr)); } set appendInPlace(e) { if (this.appendInPlaceStarted) { @@ -25483,7 +25551,7 @@ class r2 { return this.dateRange.cue; } get timelineOccupancy() { - return this.dateRange.attr["X-TIMELINE-OCCUPIES"] === "RANGE" ? jl.Range : jl.Point; + return this.dateRange.attr["X-TIMELINE-OCCUPIES"] === "RANGE" ? cu.Range : cu.Point; } get supplementsPrimary() { return this.dateRange.attr["X-TIMELINE-STYLE"] === "PRIMARY"; @@ -25504,29 +25572,29 @@ class r2 { return this.assetList.length > 0 || this.assetListResponse !== null; } toString() { - return a2(this); + return I2(this); } } -function rh(n, e) { - return n - e.start < e.duration / 2 && !(Math.abs(n - (e.start + e.duration)) < gr) ? e.start : e.start + e.duration; +function xh(n, e) { + return n - e.start < e.duration / 2 && !(Math.abs(n - (e.start + e.duration)) < wr) ? e.start : e.start + e.duration; } -function dE(n, e, t) { +function LE(n, e, t) { const i = new self.URL(n, t); return i.protocol !== "data:" && i.searchParams.set("_HLS_primary_id", e), i; } -function ah(n, e) { +function Dh(n, e) { for (; (t = n.assetList[++e]) != null && t.error; ) var t; return e; } -function a2(n) { +function I2(n) { return `["${n.identifier}" ${n.cue.pre ? "<pre>" : n.cue.post ? "<post>" : ""}${n.timelineStart.toFixed(2)}-${n.resumeTime.toFixed(2)}]`; } -function nr(n) { +function gr(n) { const e = n.timelineStart, t = n.duration || 0; return `["${n.identifier}" ${e.toFixed(2)}-${(e + t).toFixed(2)}]`; } -class o2 { +class k2 { constructor(e, t, i, s) { this.hls = void 0, this.interstitial = void 0, this.assetItem = void 0, this.tracks = null, this.hasDetails = !1, this.mediaAttached = null, this._currentTime = void 0, this._bufferedEosTime = void 0, this.checkPlayout = () => { this.reachedPlayout(this.currentTime) && this.hls.trigger(b.PLAYOUT_LIMIT_REACHED, {}); @@ -25535,7 +25603,7 @@ class o2 { this.interstitial = i, this.assetItem = s; let a = s.uri; try { - a = dE(a, t.primarySessionId).href; + a = LE(a, t.primarySessionId).href; } catch { } r.loadSource(a); @@ -25563,7 +25631,7 @@ class o2 { return !0; if (!e || !this._bufferedEosTime) return !1; - const i = this.timelineOffset, s = le.bufferInfo(e, i, 0); + const i = this.timelineOffset, s = ue.bufferInfo(e, i, 0); return this.getAssetTime(s.end) >= this._bufferedEosTime - 0.02; } reachedPlayout(e) { @@ -25588,7 +25656,7 @@ class o2 { const e = this.media || this.mediaAttached; if (!e) return this._bufferedEosTime ? this._bufferedEosTime : this.currentTime; - const t = le.bufferInfo(e, e.currentTime, 1e-3); + const t = ue.bufferInfo(e, e.currentTime, 1e-3); return this.getAssetTime(t.end); } get currentTime() { @@ -25672,11 +25740,11 @@ class o2 { } toString() { var e; - return `HlsAssetPlayer: ${nr(this.assetItem)} ${(e = this.hls) == null ? void 0 : e.sessionId} ${this.appendInPlace ? "append-in-place" : ""}`; + return `HlsAssetPlayer: ${gr(this.assetItem)} ${(e = this.hls) == null ? void 0 : e.sessionId} ${this.appendInPlace ? "append-in-place" : ""}`; } } -const d0 = 0.033; -class l2 extends Fi { +const I0 = 0.033; +class R2 extends Bi { constructor(e, t) { super("interstitials-sched", t), this.onScheduleUpdate = void 0, this.eventMap = {}, this.events = null, this.items = null, this.durations = { primary: 0, @@ -25809,7 +25877,7 @@ class l2 extends Fi { const o = r[a], u = e[o]; if (u.isInterstitial) { let l = this.eventMap[o]; - l ? l.setDateRange(u) : (l = new r2(u, t), this.eventMap[o] = l, i === !1 && (l.appendInPlace = i)), s.push(l); + l ? l.setDateRange(u) : (l = new L2(u, t), this.eventMap[o] = l, i === !1 && (l.appendInPlace = i)), s.push(l); } } return s; @@ -25821,18 +25889,18 @@ class l2 extends Fi { this.resolveOffsets(e, t); let u = 0, l = 0; if (e.forEach((c, h) => { - const d = c.cue.pre, f = c.cue.post, m = e[h - 1] || null, g = c.appendInPlace, p = f ? r : c.startOffset, y = c.duration, v = c.timelineOccupancy === jl.Range ? y : 0, _ = c.resumptionOffset, E = (m == null ? void 0 : m.startTime) === p, T = p + c.cumulativeDuration; - let A = g ? T + y : p + _; + const d = c.cue.pre, f = c.cue.post, m = e[h - 1] || null, g = c.appendInPlace, p = f ? r : c.startOffset, y = c.duration, v = c.timelineOccupancy === cu.Range ? y : 0, _ = c.resumptionOffset, E = (m == null ? void 0 : m.startTime) === p, T = p + c.cumulativeDuration; + let x = g ? T + y : p + _; if (d || !f && p <= 0) { const D = l; l += v, c.timelineStart = T; - const x = a; + const A = a; a += y, i.push({ event: c, start: T, - end: A, + end: x, playout: { - start: x, + start: A, end: a }, integrated: { @@ -25843,38 +25911,38 @@ class l2 extends Fi { } else if (p <= r) { if (!E) { const w = p - u; - if (w > d0) { - const I = u, R = l; + if (w > I0) { + const I = u, M = l; l += w; - const M = a; + const k = a; a += w; - const P = { + const q = { previousEvent: e[h - 1] || null, nextEvent: c, start: I, end: I + w, playout: { - start: M, + start: k, end: a }, integrated: { - start: R, + start: M, end: l } }; - i.push(P); + i.push(q); } else w > 0 && m && (m.cumulativeDuration += w, i[i.length - 1].end = p); } - f && (A = T), c.timelineStart = T; + f && (x = T), c.timelineStart = T; const D = l; l += v; - const x = a; + const A = a; a += y, i.push({ event: c, start: T, - end: A, + end: x, playout: { - start: x, + start: A, end: a }, integrated: { @@ -25936,22 +26004,22 @@ class l2 extends Fi { let r = 0, a = -1; e.forEach((o, u) => { const l = o.cue.pre, c = o.cue.post, h = l ? 0 : c ? s : o.startTime; - this.updateAssetDurations(o), a === h ? o.cumulativeDuration = r : (r = 0, a = h), !c && o.snapOptions.in && (o.resumeAnchor = ws(null, i.fragments, o.startOffset + o.resumptionOffset, 0, 0) || void 0), o.appendInPlace && !o.appendInPlaceStarted && (this.primaryCanResumeInPlaceAt(o, t) || (o.appendInPlace = !1)), !o.appendInPlace && u + 1 < e.length && e[u + 1].startTime - e[u].resumeTime < d0 && (e[u + 1].appendInPlace = !1, e[u + 1].appendInPlace && this.warn(`Could not change append strategy for abutting event ${o}`)); - const f = Z(o.resumeOffset) ? o.resumeOffset : o.duration; + this.updateAssetDurations(o), a === h ? o.cumulativeDuration = r : (r = 0, a = h), !c && o.snapOptions.in && (o.resumeAnchor = Bs(null, i.fragments, o.startOffset + o.resumptionOffset, 0, 0) || void 0), o.appendInPlace && !o.appendInPlaceStarted && (this.primaryCanResumeInPlaceAt(o, t) || (o.appendInPlace = !1)), !o.appendInPlace && u + 1 < e.length && e[u + 1].startTime - e[u].resumeTime < I0 && (e[u + 1].appendInPlace = !1, e[u + 1].appendInPlace && this.warn(`Could not change append strategy for abutting event ${o}`)); + const f = J(o.resumeOffset) ? o.resumeOffset : o.duration; r += f; }); } primaryCanResumeInPlaceAt(e, t) { const i = e.resumeTime, s = e.startTime + e.resumptionOffset; - return Math.abs(i - s) > gr ? (this.log(`"${e.identifier}" resumption ${i} not aligned with estimated timeline end ${s}`), !1) : t ? !Object.keys(t).some((a) => { + return Math.abs(i - s) > wr ? (this.log(`"${e.identifier}" resumption ${i} not aligned with estimated timeline end ${s}`), !1) : t ? !Object.keys(t).some((a) => { const o = t[a].details, u = o.edge; if (i >= u) return this.log(`"${e.identifier}" resumption ${i} past ${a} playlist end ${u}`), !1; - const l = ws(null, o.fragments, i); + const l = Bs(null, o.fragments, i); if (!l) return this.log(`"${e.identifier}" resumption ${i} does not align with any fragments in ${a} playlist (${o.fragStart}-${o.fragmentEnd})`), !0; const c = a === "audio" ? 0.175 : 0; - return Math.abs(l.start - i) < gr + c || Math.abs(l.end - i) < gr + c ? !1 : (this.log(`"${e.identifier}" resumption ${i} not aligned with ${a} fragment bounds (${l.start}-${l.end} sn: ${l.sn} cc: ${l.cc})`), !0); + return Math.abs(l.start - i) < wr + c || Math.abs(l.end - i) < wr + c ? !1 : (this.log(`"${e.identifier}" resumption ${i} not aligned with ${a} fragment bounds (${l.start}-${l.end} sn: ${l.sn} cc: ${l.cc})`), !0); }) : (this.log(`"${e.identifier}" resumption ${i} can not be aligned with media (none selected)`), !1); } updateAssetDurations(e) { @@ -25970,10 +26038,10 @@ class l2 extends Fi { e.reset(), delete this.eventMap[e.identifier]; } } -function Mn(n) { +function qn(n) { return `[${n.event ? '"' + n.event.identifier + '"' : "primary"}: ${n.start.toFixed(2)}-${n.end.toFixed(2)}]`; } -class u2 { +class C2 { constructor(e) { this.hls = void 0, this.hls = e; } @@ -25984,9 +26052,9 @@ class u2 { const i = e.assetListUrl; let s; try { - s = dE(i, this.hls.sessionId, e.baseUrl); + s = LE(i, this.hls.sessionId, e.baseUrl); } catch (d) { - const f = this.assignAssetListError(e, O.ASSET_LIST_LOAD_ERROR, d, i); + const f = this.assignAssetListError(e, P.ASSET_LIST_LOAD_ERROR, d, i); this.hls.trigger(b.ERROR, f); return; } @@ -26004,7 +26072,7 @@ class u2 { onSuccess: (d, f, m, g) => { const p = d.data, y = p == null ? void 0 : p.ASSETS; if (!Array.isArray(y)) { - const v = this.assignAssetListError(e, O.ASSET_LIST_PARSING_ERROR, new Error("Invalid interstitial asset list"), m.url, f, g); + const v = this.assignAssetListError(e, P.ASSET_LIST_PARSING_ERROR, new Error("Invalid interstitial asset list"), m.url, f, g); this.hls.trigger(b.ERROR, v); return; } @@ -26015,11 +26083,11 @@ class u2 { }); }, onError: (d, f, m, g) => { - const p = this.assignAssetListError(e, O.ASSET_LIST_LOAD_ERROR, new Error(`Error loading X-ASSET-LIST: HTTP status ${d.code} ${d.text} (${f.url})`), f.url, g, m); + const p = this.assignAssetListError(e, P.ASSET_LIST_LOAD_ERROR, new Error(`Error loading X-ASSET-LIST: HTTP status ${d.code} ${d.text} (${f.url})`), f.url, g, m); this.hls.trigger(b.ERROR, p); }, onTimeout: (d, f, m) => { - const g = this.assignAssetListError(e, O.ASSET_LIST_LOAD_TIMEOUT, new Error(`Timeout loading X-ASSET-LIST (${f.url})`), f.url, d, m); + const g = this.assignAssetListError(e, P.ASSET_LIST_LOAD_TIMEOUT, new Error(`Timeout loading X-ASSET-LIST (${f.url})`), f.url, d, m); this.hls.trigger(b.ERROR, g); } }; @@ -26029,7 +26097,7 @@ class u2 { } assignAssetListError(e, t, i, s, r, a) { return e.error = i, { - type: ie.NETWORK_ERROR, + type: ne.NETWORK_ERROR, details: t, fatal: !1, interstitial: e, @@ -26040,11 +26108,11 @@ class u2 { }; } } -function f0(n) { +function k0(n) { n == null || n.play().catch(() => { }); } -class c2 extends Fi { +class F2 extends Bi { constructor(e, t) { super("interstitials", e.logger), this.HlsPlayerClass = void 0, this.hls = void 0, this.assetListLoader = void 0, this.mediaSelection = null, this.altSelection = null, this.media = null, this.detachedData = null, this.requiredTracks = null, this.manager = null, this.playerQueue = [], this.bufferedPos = -1, this.timelinePos = -1, this.schedule = void 0, this.playingItem = null, this.bufferingItem = null, this.waitingItem = null, this.endedItem = null, this.playingAsset = null, this.endedAsset = null, this.bufferingAsset = null, this.shouldPlay = !1, this.onPlay = () => { this.shouldPlay = !0; @@ -26114,14 +26182,14 @@ class c2 extends Fi { }, this.onScheduleUpdate = (i, s) => { const r = this.schedule, a = this.playingItem, o = r.events || [], u = r.items || [], l = r.durations, c = i.map((m) => m.identifier), h = !!(o.length || c.length); (h || s) && this.log(`INTERSTITIALS_UPDATED (${o.length}): ${o} -Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.log(`Removed events ${c}`), this.playerQueue.forEach((m) => { +Schedule: ${u.map((m) => qn(m))} pos: ${this.timelinePos}`), c.length && this.log(`Removed events ${c}`), this.playerQueue.forEach((m) => { if (m.interstitial.appendInPlace) { const g = m.assetItem.timelineStart, p = m.timelineOffset - g; if (p) try { m.timelineOffset = g; } catch (y) { - Math.abs(p) > gr && this.warn(`${y} ("${m.assetId}" ${m.timelineOffset}->${g})`); + Math.abs(p) > wr && this.warn(`${y} ("${m.assetId}" ${m.timelineOffset}->${g})`); } } }); @@ -26152,7 +26220,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo } d && d(), this.checkBuffer(); } - }, this.hls = e, this.HlsPlayerClass = t, this.assetListLoader = new u2(e), this.schedule = new l2(this.onScheduleUpdate, e.logger), this.registerListeners(); + }, this.hls = e, this.HlsPlayerClass = t, this.assetListLoader = new C2(e), this.schedule = new R2(this.onScheduleUpdate, e.logger), this.registerListeners(); } registerListeners() { const e = this.hls; @@ -26184,11 +26252,11 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo e && this.removeMediaListeners(e); } removeMediaListeners(e) { - Di(e, "play", this.onPlay), Di(e, "pause", this.onPause), Di(e, "seeking", this.onSeeking), Di(e, "timeupdate", this.onTimeupdate); + Mi(e, "play", this.onPlay), Mi(e, "pause", this.onPause), Mi(e, "seeking", this.onSeeking), Mi(e, "timeupdate", this.onTimeupdate); } onMediaAttaching(e, t) { const i = this.media = t.media; - ti(i, "seeking", this.onSeeking), ti(i, "timeupdate", this.onTimeupdate), ti(i, "play", this.onPlay), ti(i, "pause", this.onPause); + ri(i, "seeking", this.onSeeking), ri(i, "timeupdate", this.onTimeupdate), ri(i, "play", this.onPlay), ri(i, "pause", this.onPause); } onMediaAttached(e, t) { const i = this.effectivePlayingItem, s = this.detachedData; @@ -26219,7 +26287,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo let p = h[d].start; const y = h.event; if (y) { - if (d === "playout" || y.timelineOccupancy !== jl.Point) { + if (d === "playout" || y.timelineOccupancy !== cu.Point) { const v = i(f); (v == null ? void 0 : v.interstitial) === y && (p += v.assetItem.startOffset + v[g]); } @@ -26252,13 +26320,13 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo if (g != null && (f = g.event) != null && f.restrictions.skip) return; e.log(`seek to ${h} "${d}"`); - const p = e.effectivePlayingItem, y = e.schedule.findItemIndexAtTime(h, d), v = (m = e.schedule.items) == null ? void 0 : m[y], _ = e.getBufferingPlayer(), E = _ == null ? void 0 : _.interstitial, T = E == null ? void 0 : E.appendInPlace, A = p && e.itemsMatch(p, v); - if (p && (T || A)) { - const D = i(e.playingAsset), x = (D == null ? void 0 : D.media) || e.primaryMedia; - if (x) { - const w = d === "primary" ? x.currentTime : s(p, d, e.playingAsset, "timelinePos", "currentTime"), I = h - w, R = (T ? w : x.currentTime) + I; - if (R >= 0 && (!D || T || R <= D.duration)) { - x.currentTime = R; + const p = e.effectivePlayingItem, y = e.schedule.findItemIndexAtTime(h, d), v = (m = e.schedule.items) == null ? void 0 : m[y], _ = e.getBufferingPlayer(), E = _ == null ? void 0 : _.interstitial, T = E == null ? void 0 : E.appendInPlace, x = p && e.itemsMatch(p, v); + if (p && (T || x)) { + const D = i(e.playingAsset), A = (D == null ? void 0 : D.media) || e.primaryMedia; + if (A) { + const w = d === "primary" ? A.currentTime : s(p, d, e.playingAsset, "timelinePos", "currentTime"), I = h - w, M = (T ? w : A.currentTime) + I; + if (M >= 0 && (!D || T || M <= D.duration)) { + A.currentTime = M; return; } } @@ -26269,31 +26337,31 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo const w = v[d].start, I = h - w; D = v.start + I; } - const x = !e.isInterstitial(v); - if ((!e.isInterstitial(p) || p.event.appendInPlace) && (x || v.event.appendInPlace)) { + const A = !e.isInterstitial(v); + if ((!e.isInterstitial(p) || p.event.appendInPlace) && (A || v.event.appendInPlace)) { const w = e.media || (T ? _ == null ? void 0 : _.media : null); w && (w.currentTime = D); } else if (p) { const w = e.findItemIndex(p); if (y > w) { - const R = e.schedule.findJumpRestrictedIndex(w + 1, y); - if (R > w) { - e.setSchedulePosition(R); + const M = e.schedule.findJumpRestrictedIndex(w + 1, y); + if (M > w) { + e.setSchedulePosition(M); return; } } let I = 0; - if (x) + if (A) e.timelinePos = D, e.checkBuffer(); else { var S; - const R = v == null || (S = v.event) == null ? void 0 : S.assetList; - if (R) { - const M = h - (v[d] || v).start; - for (let P = R.length; P--; ) { - const K = R[P]; - if (K.duration && M >= K.startOffset && M < K.startOffset + K.duration) { - I = P; + const M = v == null || (S = v.event) == null ? void 0 : S.assetList; + if (M) { + const k = h - (v[d] || v).start; + for (let q = M.length; q--; ) { + const K = M[q]; + if (K.duration && k >= K.startOffset && k < K.startOffset + K.duration) { + I = q; break; } } @@ -26448,7 +26516,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo let r = this.media; !r && (e = this.bufferingItem) != null && (t = e.event) != null && t.appendInPlace && (r = this.primaryMedia); const a = (i = r) == null ? void 0 : i.currentTime; - if (!(a === void 0 || !Z(a))) + if (!(a === void 0 || !J(a))) return a; } get primaryMedia() { @@ -26472,7 +26540,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo return; } const r = e.transferMedia(); - this.log(`transfer MediaSource from ${e} ${Oe(r)}`), this.detachedData = r; + this.log(`transfer MediaSource from ${e} ${$e(r)}`), this.detachedData = r; } else t && s && (this.shouldPlay || (this.shouldPlay = !s.paused)); } transferMediaTo(e, t) { @@ -26491,7 +26559,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo c = "detached media"; if (!r) { if (l) - r = this.detachedData, this.log(`using detachedData: MediaSource ${Oe(r)}`); + r = this.detachedData, this.log(`using detachedData: MediaSource ${$e(r)}`); else if (!this.detachedData || a.media === t) { const f = this.playerQueue; f.length > 1 && f.forEach((m) => { @@ -26540,7 +26608,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo } } advanceAfterAssetEnded(e, t, i) { - const s = ah(e, i); + const s = Dh(e, i); if (!e.isAssetPastPlayoutLimit(s)) this.setSchedulePosition(t, s); else { @@ -26575,7 +26643,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo if (d && h && (!this.eventItemsMatch(r, s) || t !== void 0 && h !== ((o = l.assetList) == null ? void 0 : o[t].identifier))) { var u; const f = l.findAssetIndex(c); - if (this.log(`INTERSTITIAL_ASSET_ENDED ${f + 1}/${l.assetList.length} ${nr(c)}`), this.endedAsset = c, this.playingAsset = null, this.hls.trigger(b.INTERSTITIAL_ASSET_ENDED, { + if (this.log(`INTERSTITIAL_ASSET_ENDED ${f + 1}/${l.assetList.length} ${gr(c)}`), this.endedAsset = c, this.playingAsset = null, this.hls.trigger(b.INTERSTITIAL_ASSET_ENDED, { asset: c, assetListIndex: f, event: l, @@ -26588,7 +26656,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo } this.retreiveMediaSource(h, s), d.media && !((u = this.detachedData) != null && u.mediaSource) && d.detachMedia(); } - if (!this.eventItemsMatch(r, s) && (this.endedItem = r, this.playingItem = null, this.log(`INTERSTITIAL_ENDED ${l} ${Mn(r)}`), l.hasPlayed = !0, this.hls.trigger(b.INTERSTITIAL_ENDED, { + if (!this.eventItemsMatch(r, s) && (this.endedItem = r, this.playingItem = null, this.log(`INTERSTITIAL_ENDED ${l} ${qn(r)}`), l.hasPlayed = !0, this.hls.trigger(b.INTERSTITIAL_ENDED, { event: l, schedule: i.slice(0), scheduleIndex: e @@ -26614,7 +26682,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo const l = a.event; if (i === void 0) { i = this.schedule.findAssetIndex(l, this.timelinePos); - const f = ah(l, i - 1); + const f = Dh(l, i - 1); if (l.isAssetPastPlayoutLimit(f)) { this.advanceAfterAssetEnded(l, e, i); return; @@ -26624,7 +26692,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo const c = this.waitingItem; this.assetsBuffered(a, o) || this.setBufferingItem(a); let h = this.preloadAssets(l, i); - if (this.eventItemsMatch(a, c || s) || (this.waitingItem = a, this.log(`INTERSTITIAL_STARTED ${Mn(a)} ${l.appendInPlace ? "append in place" : ""}`), this.hls.trigger(b.INTERSTITIAL_STARTED, { + if (this.eventItemsMatch(a, c || s) || (this.waitingItem = a, this.log(`INTERSTITIAL_STARTED ${qn(a)} ${l.appendInPlace ? "append in place" : ""}`), this.hls.trigger(b.INTERSTITIAL_STARTED, { event: l, schedule: t.slice(0), scheduleIndex: e @@ -26649,8 +26717,8 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo } if (!this.eventItemsMatch(a, this.bufferingItem) && l.appendInPlace && this.isAssetBuffered(d)) return; - this.startAssetPlayer(h, i, t, e, o), this.shouldPlay && f0(h.media); - } else a !== null ? (this.resumePrimary(a, e, s), this.shouldPlay && f0(this.hls.media)) : r && this.isInterstitial(s) && (this.endedItem = null, this.playingItem = s, s.event.appendInPlace || this.attachPrimary(this.schedule.durations.primary, null)); + this.startAssetPlayer(h, i, t, e, o), this.shouldPlay && k0(h.media); + } else a !== null ? (this.resumePrimary(a, e, s), this.shouldPlay && k0(this.hls.media)) : r && this.isInterstitial(s) && (this.endedItem = null, this.playingItem = s, s.event.appendInPlace || this.attachPrimary(this.schedule.durations.primary, null)); } get playbackDisabled() { return this.hls.config.enableInterstitialPlayback === !1; @@ -26665,14 +26733,14 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo } resumePrimary(e, t, i) { var s; - if (this.playingItem = e, this.playingAsset = this.endedAsset = null, this.waitingItem = this.endedItem = null, this.bufferedToItem(e), this.log(`resuming ${Mn(e)}`), !((s = this.detachedData) != null && s.mediaSource)) { + if (this.playingItem = e, this.playingAsset = this.endedAsset = null, this.waitingItem = this.endedItem = null, this.bufferedToItem(e), this.log(`resuming ${qn(e)}`), !((s = this.detachedData) != null && s.mediaSource)) { let a = this.timelinePos; (a < e.start || a >= e.end) && (a = this.getPrimaryResumption(e, t), this.timelinePos = a), this.attachPrimary(a, e); } if (!i) return; const r = this.schedule.items; - r && (this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Mn(e)}`), this.hls.trigger(b.INTERSTITIALS_PRIMARY_RESUMED, { + r && (this.log(`INTERSTITIALS_PRIMARY_RESUMED ${qn(e)}`), this.hls.trigger(b.INTERSTITIALS_PRIMARY_RESUMED, { schedule: r.slice(0), scheduleIndex: t }), this.checkBuffer()); @@ -26690,7 +26758,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo } isAssetBuffered(e) { const t = this.getAssetPlayer(e.identifier); - return t != null && t.hls ? t.hls.bufferedToEnd : le.bufferInfo(this.primaryMedia, this.timelinePos, 0).end + 1 >= e.timelineStart + (e.duration || 0); + return t != null && t.hls ? t.hls.bufferedToEnd : ue.bufferInfo(this.primaryMedia, this.timelinePos, 0).end + 1 >= e.timelineStart + (e.duration || 0); } attachPrimary(e, t, i) { t ? this.setBufferingItem(t) : this.bufferingItem = this.playingItem, this.bufferingAsset = null; @@ -26712,7 +26780,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo onLevelUpdated(e, t) { if (t.level === -1) return; - const i = this.hls.levels[t.level], s = Le(Le({}, this.mediaSelection || this.altSelection), {}, { + const i = this.hls.levels[t.level], s = Ie(Ie({}, this.mediaSelection || this.altSelection), {}, { main: i }); this.mediaSelection = s, this.schedule.parseInterstitialDateRanges(s, this.hls.config.interstitialAppendInPlace), !this.effectivePlayingItem && this.schedule.items && this.checkStart(); @@ -26720,12 +26788,12 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo onAudioTrackUpdated(e, t) { const i = this.hls.audioTracks[t.id], s = this.mediaSelection; if (!s) { - this.altSelection = Le(Le({}, this.altSelection), {}, { + this.altSelection = Ie(Ie({}, this.altSelection), {}, { audio: i }); return; } - const r = Le(Le({}, s), {}, { + const r = Ie(Ie({}, s), {}, { audio: i }); this.mediaSelection = r; @@ -26733,22 +26801,22 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo onSubtitleTrackUpdated(e, t) { const i = this.hls.subtitleTracks[t.id], s = this.mediaSelection; if (!s) { - this.altSelection = Le(Le({}, this.altSelection), {}, { + this.altSelection = Ie(Ie({}, this.altSelection), {}, { subtitles: i }); return; } - const r = Le(Le({}, s), {}, { + const r = Ie(Ie({}, s), {}, { subtitles: i }); this.mediaSelection = r; } onAudioTrackSwitching(e, t) { - const i = Ap(t); + const i = Gp(t); this.playerQueue.forEach((s) => s.hls.setAudioOption(t) || s.hls.setAudioOption(i)); } onSubtitleTrackSwitch(e, t) { - const i = Ap(t); + const i = Gp(t); this.playerQueue.forEach((s) => s.hls.setSubtitleOption(t) || t.id !== -1 && s.hls.setSubtitleOption(i)); } onBufferCodecs(e, t) { @@ -26801,7 +26869,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo e.event.assetList.forEach((r, a) => { e.event.isAssetPastPlayoutLimit(a) && this.clearAssetPlayer(r.identifier, null); }); - const i = e.end + 0.25, s = le.bufferInfo(this.primaryMedia, i, 0); + const i = e.end + 0.25, s = ue.bufferInfo(this.primaryMedia, i, 0); (s.end > i || (s.nextStart || 0) > i) && (this.attachPrimary(i, null), this.flushFrontBuffer(i)); } } @@ -26824,7 +26892,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo const t = this.schedule.items; if (!t) return; - const i = le.bufferInfo(this.primaryMedia, this.timelinePos, 0); + const i = ue.bufferInfo(this.primaryMedia, this.timelinePos, 0); e && (this.bufferedPos = this.timelinePos), e || (e = i.len < 1), this.updateBufferedPos(i.end, t, e); } updateBufferedPos(e, t, i) { @@ -26870,7 +26938,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo const a = this.isInterstitial(e), o = this.getBufferingPlayer(); this.bufferingItem = e, this.bufferedPos = Math.max(e.start, Math.min(e.end, this.timelinePos)); const u = o ? o.remaining : t ? t.end - this.timelinePos : 0; - this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Mn(e)}` + (t ? ` (${u.toFixed(2)} remaining)` : "")), this.playbackDisabled || (a ? e.event.assetList.forEach((l) => { + this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${qn(e)}` + (t ? ` (${u.toFixed(2)} remaining)` : "")), this.playbackDisabled || (a ? e.event.assetList.forEach((l) => { const c = this.getAssetPlayer(l.identifier); c && c.resumeBuffering(); }) : (this.hls.resumeBuffering(), this.playerQueue.forEach((l) => l.pauseBuffering()))), this.hls.trigger(b.INTERSTITIALS_BUFFERED_TO_BOUNDARY, { @@ -26974,7 +27042,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo createAsset(e, t, i, s, r, a) { const o = { parentIdentifier: e.identifier, - identifier: s2(e, a, t), + identifier: w2(e, a, t), duration: r, startOffset: i, timelineStart: s, @@ -26986,7 +27054,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo const s = this.hls, r = s.userConfig; let a = r.videoPreference; const o = s.loadLevelObj || s.levels[s.currentLevel]; - (a || o) && (a = De({}, a), o.videoCodec && (a.videoCodec = o.videoCodec), o.videoRange && (a.allowedVideoRanges = [o.videoRange])); + (a || o) && (a = we({}, a), o.videoCodec && (a.videoCodec = o.videoCodec), o.videoRange && (a.allowedVideoRanges = [o.videoRange])); const u = s.audioTracks[s.audioTrack], l = s.subtitleTracks[s.subtitleTrack]; let c = 0; if (this.primaryLive || e.appendInPlace) { @@ -26996,7 +27064,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo E && _ < E && (c = _); } } - const h = t.identifier, d = Le(Le({}, r), {}, { + const h = t.identifier, d = Ie(Ie({}, r), {}, { autoStartLoad: !0, startFragPrefetch: !0, primarySessionId: s.sessionId, @@ -27012,20 +27080,20 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo }); e.appendInPlace && (e.appendInPlaceStarted = !0, t.timelineStart && (d.timelineOffset = t.timelineStart)); const f = d.cmcd; - f != null && f.sessionId && f.contentId && (d.cmcd = De({}, f, { - contentId: wa(t.uri) + f != null && f.sessionId && f.contentId && (d.cmcd = we({}, f, { + contentId: Ba(t.uri) })), this.getAssetPlayer(h) && this.warn(`Duplicate date range identifier ${e} and asset ${h}`); - const m = new o2(this.HlsPlayerClass, d, e, t); + const m = new k2(this.HlsPlayerClass, d, e, t); this.playerQueue.push(m), e.assetList[i] = t; const g = (_) => { if (_.live) { - const A = new Error(`Interstitials MUST be VOD assets ${e}`), S = { + const x = new Error(`Interstitials MUST be VOD assets ${e}`), S = { fatal: !0, - type: ie.OTHER_ERROR, - details: O.INTERSTITIAL_ASSET_ITEM_ERROR, - error: A + type: ne.OTHER_ERROR, + details: P.INTERSTITIAL_ASSET_ITEM_ERROR, + error: x }; - this.handleAssetItemError(S, e, this.schedule.findEventIndex(e.identifier), i, A.message); + this.handleAssetItemError(S, e, this.schedule.findEventIndex(e.identifier), i, x.message); return; } const E = _.edge - _.fragmentStart, T = t.duration; @@ -27040,8 +27108,8 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo const T = this.getAssetPlayer(h); if (T && E.tracks) { T.off(b.BUFFER_CODECS, p), T.tracks = E.tracks; - const A = this.primaryMedia; - this.bufferingAsset === T.assetItem && A && !T.media && this.bufferAssetPlayer(T, A); + const x = this.primaryMedia; + this.bufferingAsset === T.assetItem && x && !T.media && this.bufferAssetPlayer(T, x); } }; m.on(b.BUFFER_CODECS, p); @@ -27050,11 +27118,11 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo const E = this.getAssetPlayer(h); if (this.log(`buffered to end of asset ${E}`), !E) return; - const T = this.schedule.findEventIndex(e.identifier), A = (_ = this.schedule.items) == null ? void 0 : _[T]; - if (this.isInterstitial(A)) { - const D = e.findAssetIndex(t), x = ah(e, D); - if (!e.isAssetPastPlayoutLimit(x)) - this.bufferedToItem(A, x); + const T = this.schedule.findEventIndex(e.identifier), x = (_ = this.schedule.items) == null ? void 0 : _[T]; + if (this.isInterstitial(x)) { + const D = e.findAssetIndex(t), A = Dh(e, D); + if (!e.isAssetPastPlayoutLimit(A)) + this.bufferedToItem(x, A); else { var S; const w = (S = this.schedule.items) == null ? void 0 : S[T + 1]; @@ -27072,10 +27140,10 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo }; return m.once(b.MEDIA_ENDED, v(i)), m.once(b.PLAYOUT_LIMIT_REACHED, v(1 / 0)), m.on(b.ERROR, (_, E) => { const T = this.getAssetPlayer(h); - if (E.details === O.BUFFER_STALLED_ERROR) { + if (E.details === P.BUFFER_STALLED_ERROR) { if (T != null && T.media) { - const A = T.currentTime, S = T.duration - A; - A && e.appendInPlace && S / T.media.playbackRate < 0.5 ? (this.log(`Advancing buffer past end of asset ${h} ${e} at ${T.media.currentTime}`), y()) : (this.warn(`Stalled at ${A} of ${A + S} in asset ${h} ${e}`), this.onTimeupdate(), this.checkBuffer(!0)); + const x = T.currentTime, S = T.duration - x; + x && e.appendInPlace && S / T.media.playbackRate < 0.5 ? (this.log(`Advancing buffer past end of asset ${h} ${e} at ${T.media.currentTime}`), y()) : (this.warn(`Stalled at ${x} of ${x + S} in asset ${h} ${e}`), this.onTimeupdate(), this.checkBuffer(!0)); } return; } @@ -27085,12 +27153,12 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo return; const E = new Error(`Asset player destroyed unexpectedly ${h}`), T = { fatal: !0, - type: ie.OTHER_ERROR, - details: O.INTERSTITIAL_ASSET_ITEM_ERROR, + type: ne.OTHER_ERROR, + details: P.INTERSTITIAL_ASSET_ITEM_ERROR, error: E }; this.handleAssetItemError(T, e, this.schedule.findEventIndex(e.identifier), i, E.message); - }), this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${nr(t)}`), this.hls.trigger(b.INTERSTITIAL_ASSET_PLAYER_CREATED, { + }), this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${gr(t)}`), this.hls.trigger(b.INTERSTITIAL_ASSET_PLAYER_CREATED, { asset: t, assetListIndex: i, event: e, @@ -27113,7 +27181,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo clearAssetPlayer(e, t) { const i = this.getAssetPlayerQueueIndex(e); if (i !== -1) { - this.log(`clear asset player "${e}" toSegment: ${t && Mn(t)}`); + this.log(`clear asset player "${e}" toSegment: ${t && qn(t)}`); const s = this.playerQueue[i]; this.transferMediaFromPlayer(s, t), this.playerQueue.splice(i, 1), s.destroy(); } @@ -27130,7 +27198,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo assetItem: o, assetId: u } = e, l = a.assetList.length, c = this.playingAsset; - this.endedAsset = null, this.playingAsset = o, (!c || c.identifier !== u) && (c && (this.clearAssetPlayer(c.identifier, i[s]), delete c.error), this.log(`INTERSTITIAL_ASSET_STARTED ${t + 1}/${l} ${nr(o)}`), this.hls.trigger(b.INTERSTITIAL_ASSET_STARTED, { + this.endedAsset = null, this.playingAsset = o, (!c || c.identifier !== u) && (c && (this.clearAssetPlayer(c.identifier, i[s]), delete c.error), this.log(`INTERSTITIAL_ASSET_STARTED ${t + 1}/${l} ${gr(o)}`), this.hls.trigger(b.INTERSTITIAL_ASSET_STARTED, { asset: o, assetListIndex: t, event: a, @@ -27158,11 +27226,11 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo if (c && a !== this.playingAsset) { if (!e.tracks) return; - if (h && !ry(h, e.tracks)) { - const d = new Error(`Asset ${nr(a)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(h)}')`), f = { + if (h && !by(h, e.tracks)) { + const d = new Error(`Asset ${gr(a)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(h)}')`), f = { fatal: !0, - type: ie.OTHER_ERROR, - details: O.INTERSTITIAL_ASSET_ITEM_ERROR, + type: ne.OTHER_ERROR, + details: P.INTERSTITIAL_ASSET_ITEM_ERROR, error: d }, m = r.findAssetIndex(a); this.handleAssetItemError(f, r, o, m, d.message); @@ -27172,13 +27240,13 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo this.transferMediaTo(e, t); } handleAssetItemError(e, t, i, s, r) { - if (e.details === O.BUFFER_STALLED_ERROR) + if (e.details === P.BUFFER_STALLED_ERROR) return; const a = t.assetList[s]; - this.warn(`INTERSTITIAL_ASSET_ERROR ${a && nr(a)} ${e.error}`); - const o = a == null ? void 0 : a.identifier, u = this.getAssetPlayerQueueIndex(o), l = this.playerQueue[u] || null, c = this.schedule.items, h = De({}, e, { + this.warn(`INTERSTITIAL_ASSET_ERROR ${a && gr(a)} ${e.error}`); + const o = a == null ? void 0 : a.identifier, u = this.getAssetPlayerQueueIndex(o), l = this.playerQueue[u] || null, c = this.schedule.items, h = we({}, e, { fatal: !1, - errorAction: $a(!0), + errorAction: Ya(!0), asset: a, assetListIndex: s, event: t, @@ -27201,7 +27269,7 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo primaryFallback(e) { const t = e.timelineStart, i = this.effectivePlayingItem; if (this.updateSchedule(), i) { - this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${i ? Mn(i) : "<none>"} error: ${e.error}`); + this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${i ? qn(i) : "<none>"} error: ${e.error}`); let s = this.timelinePos; s === -1 && (s = this.hls.startPosition); const r = this.updateItem(i, s); @@ -27244,24 +27312,24 @@ Schedule: ${u.map((m) => Mn(m))} pos: ${this.timelinePos}`), c.length && this.lo } onError(e, t) { switch (t.details) { - case O.ASSET_LIST_PARSING_ERROR: - case O.ASSET_LIST_LOAD_ERROR: - case O.ASSET_LIST_LOAD_TIMEOUT: { + case P.ASSET_LIST_PARSING_ERROR: + case P.ASSET_LIST_LOAD_ERROR: + case P.ASSET_LIST_LOAD_TIMEOUT: { const i = t.interstitial; i && this.primaryFallback(i); break; } - case O.BUFFER_STALLED_ERROR: { + case P.BUFFER_STALLED_ERROR: { this.onTimeupdate(), this.checkBuffer(!0); break; } } } } -const m0 = 500; -class h2 extends pf { +const R0 = 500; +class P2 extends $f { constructor(e, t, i) { - super(e, t, i, "subtitle-stream-controller", J.SUBTITLE), this.currentTrackId = -1, this.tracksBuffered = [], this.mainDetails = null, this.registerListeners(); + super(e, t, i, "subtitle-stream-controller", te.SUBTITLE), this.currentTrackId = -1, this.tracksBuffered = [], this.mainDetails = null, this.registerListeners(); } onHandlerDestroying() { this.unregisterListeners(), super.onHandlerDestroying(), this.mainDetails = null; @@ -27281,7 +27349,7 @@ class h2 extends pf { e.off(b.LEVEL_LOADED, this.onLevelLoaded, this), e.off(b.SUBTITLE_TRACKS_UPDATED, this.onSubtitleTracksUpdated, this), e.off(b.SUBTITLE_TRACK_SWITCH, this.onSubtitleTrackSwitch, this), e.off(b.SUBTITLE_TRACK_LOADED, this.onSubtitleTrackLoaded, this), e.off(b.SUBTITLE_FRAG_PROCESSED, this.onSubtitleFragProcessed, this), e.off(b.BUFFER_FLUSHING, this.onBufferFlushing, this); } startLoad(e, t) { - this.stopLoad(), this.state = V.IDLE, this.setInterval(m0), this.nextLoadPosition = this.lastCurrentTime = e + this.timelineOffset, this.startPosition = t ? -1 : e, this.tick(); + this.stopLoad(), this.state = V.IDLE, this.setInterval(R0), this.nextLoadPosition = this.lastCurrentTime = e + this.timelineOffset, this.startPosition = t ? -1 : e, this.tick(); } onManifestLoading() { super.onManifestLoading(), this.mainDetails = null; @@ -27297,7 +27365,7 @@ class h2 extends pf { frag: i, success: s } = t; - if (this.fragContextChanged(i) || (Ye(i) && (this.fragPrevious = i), this.state = V.IDLE), !s) + if (this.fragContextChanged(i) || (Ze(i) && (this.fragPrevious = i), this.state = V.IDLE), !s) return; const r = this.tracksBuffered[this.currentTrackId]; if (!r) @@ -27335,26 +27403,26 @@ class h2 extends pf { break; o++; } - }), this.fragmentTracker.removeFragmentsInRange(i, r, J.SUBTITLE); + }), this.fragmentTracker.removeFragmentsInRange(i, r, te.SUBTITLE); } } // If something goes wrong, proceed to next frag, if we were processing one. onError(e, t) { const i = t.frag; - (i == null ? void 0 : i.type) === J.SUBTITLE && (t.details === O.FRAG_GAP && this.fragmentTracker.fragBuffered(i, !0), this.fragCurrent && this.fragCurrent.abortRequests(), this.state !== V.STOPPED && (this.state = V.IDLE)); + (i == null ? void 0 : i.type) === te.SUBTITLE && (t.details === P.FRAG_GAP && this.fragmentTracker.fragBuffered(i, !0), this.fragCurrent && this.fragCurrent.abortRequests(), this.state !== V.STOPPED && (this.state = V.IDLE)); } // Got all new subtitle levels. onSubtitleTracksUpdated(e, { subtitleTracks: t }) { - if (this.levels && iE(this.levels, t)) { - this.levels = t.map((i) => new Ma(i)); + if (this.levels && vE(this.levels, t)) { + this.levels = t.map((i) => new Wa(i)); return; } this.tracksBuffered = [], this.levels = t.map((i) => { - const s = new Ma(i); + const s = new Wa(i); return this.tracksBuffered[s.id] = [], s; - }), this.fragmentTracker.removeFragmentsInRange(0, Number.POSITIVE_INFINITY, J.SUBTITLE), this.fragPrevious = null, this.mediaBuffer = null; + }), this.fragmentTracker.removeFragmentsInRange(0, Number.POSITIVE_INFINITY, te.SUBTITLE), this.fragPrevious = null, this.mediaBuffer = null; } onSubtitleTrackSwitch(e, t) { var i; @@ -27363,7 +27431,7 @@ class h2 extends pf { return; } const s = this.levels[this.currentTrackId]; - s != null && s.details ? this.mediaBuffer = this.mediaBufferTimeRanges : this.mediaBuffer = null, s && this.state !== V.STOPPED && this.setInterval(m0); + s != null && s.details ? this.mediaBuffer = this.mediaBufferTimeRanges : this.mediaBuffer = null, s && this.state !== V.STOPPED && this.setInterval(R0); } // Got a new set of subtitle fragments. onSubtitleTrackLoaded(e, t) { @@ -27394,10 +27462,10 @@ class h2 extends pf { } const d = h.fragments[0]; if (!u.details) - a.hasProgramDateTime && h.hasProgramDateTime ? (ql(a, h), l = a.fragmentStart) : d && (l = d.start, fd(a, l)); + a.hasProgramDateTime && h.hasProgramDateTime ? (lu(a, h), l = a.fragmentStart) : d && (l = d.start, Pd(a, l)); else { var c; - l = this.alignPlaylists(a, u.details, (c = this.levelLastLoaded) == null ? void 0 : c.details), l === 0 && d && (l = d.start, fd(a, l)); + l = this.alignPlaylists(a, u.details, (c = this.levelLastLoaded) == null ? void 0 : c.details), l === 0 && d && (l = d.start, Pd(a, l)); } h && !this.startFragRequested && this.setStartPosition(h, l); } @@ -27405,19 +27473,19 @@ class h2 extends pf { details: a, id: o, groupId: t.groupId - }), this.tick(), a.live && !this.fragCurrent && this.media && this.state === V.IDLE && (ws(null, a.fragments, this.media.currentTime, 0) || (this.warn("Subtitle playlist not aligned with playback"), u.details = void 0))); + }), this.tick(), a.live && !this.fragCurrent && this.media && this.state === V.IDLE && (Bs(null, a.fragments, this.media.currentTime, 0) || (this.warn("Subtitle playlist not aligned with playback"), u.details = void 0))); } _handleFragmentLoadComplete(e) { const { frag: t, payload: i } = e, s = t.decryptdata, r = this.hls; - if (!this.fragContextChanged(t) && i && i.byteLength > 0 && s != null && s.key && s.iv && fr(s.method)) { + if (!this.fragContextChanged(t) && i && i.byteLength > 0 && s != null && s.key && s.iv && xr(s.method)) { const a = performance.now(); - this.decrypter.decrypt(new Uint8Array(i), s.key.buffer, s.iv.buffer, gf(s.method)).catch((o) => { + this.decrypter.decrypt(new Uint8Array(i), s.key.buffer, s.iv.buffer, Mf(s.method)).catch((o) => { throw r.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.FRAG_DECRYPT_ERROR, + type: ne.MEDIA_ERROR, + details: P.FRAG_DECRYPT_ERROR, fatal: !1, error: o, reason: o.message, @@ -27452,7 +27520,7 @@ class h2 extends pf { return; const { config: s - } = this, r = this.getLoadPosition(), a = le.bufferedInfo(this.tracksBuffered[this.currentTrackId] || [], r, s.maxBufferHole), { + } = this, r = this.getLoadPosition(), a = ue.bufferedInfo(this.tracksBuffered[this.currentTrackId] || [], r, s.maxBufferHole), { end: o, len: u } = a, l = i.details, c = this.hls.maxBufferLength + l.levelTargetDuration; @@ -27463,26 +27531,26 @@ class h2 extends pf { const g = this.fragPrevious; if (o < f) { const v = s.maxFragLookUpTolerance, _ = o > f - v ? 0 : v; - m = ws(g, h, Math.max(h[0].start, o), _), !m && g && g.start < h[0].start && (m = h[0]); + m = Bs(g, h, Math.max(h[0].start, o), _), !m && g && g.start < h[0].start && (m = h[0]); } else m = h[d - 1]; if (m = this.filterReplacedPrimary(m, i.details), !m) return; const p = m.sn - l.startSN, y = h[p - 1]; - if (y && y.cc === m.cc && this.fragmentTracker.getState(y) === Ze.NOT_LOADED && (m = y), this.fragmentTracker.getState(m) === Ze.NOT_LOADED) { + if (y && y.cc === m.cc && this.fragmentTracker.getState(y) === nt.NOT_LOADED && (m = y), this.fragmentTracker.getState(m) === nt.NOT_LOADED) { const v = this.mapToInitFragWhenRequired(m); v && this.loadFragment(v, i, o); } } } loadFragment(e, t, i) { - Ye(e) ? super.loadFragment(e, t, i) : this._loadInitSegment(e, t); + Ze(e) ? super.loadFragment(e, t, i) : this._loadInitSegment(e, t); } get mediaBufferTimeRanges() { - return new d2(this.tracksBuffered[this.currentTrackId] || []); + return new O2(this.tracksBuffered[this.currentTrackId] || []); } } -class d2 { +class O2 { constructor(e) { this.buffered = void 0; const t = (i, s, r) => { @@ -27503,7 +27571,7 @@ class d2 { }; } } -const f2 = { +const M2 = { 42: 225, // lowercase a, acute accent 92: 233, @@ -27691,7 +27759,7 @@ const f2 = { // Box drawings heavy up and right 207: 9499 // Box drawings heavy up and left -}, fE = (n) => String.fromCharCode(f2[n] || n), yi = 15, pn = 100, m2 = { +}, IE = (n) => String.fromCharCode(M2[n] || n), Ii = 15, yn = 100, $2 = { 17: 1, 18: 3, 21: 5, @@ -27700,7 +27768,7 @@ const f2 = { 16: 11, 19: 12, 20: 14 -}, g2 = { +}, B2 = { 17: 2, 18: 4, 21: 6, @@ -27708,7 +27776,7 @@ const f2 = { 23: 10, 19: 13, 20: 15 -}, p2 = { +}, N2 = { 25: 1, 26: 3, 29: 5, @@ -27717,7 +27785,7 @@ const f2 = { 24: 11, 27: 12, 28: 14 -}, _2 = { +}, U2 = { 25: 2, 26: 4, 29: 6, @@ -27725,25 +27793,25 @@ const f2 = { 31: 10, 27: 13, 28: 15 -}, v2 = ["white", "green", "blue", "cyan", "red", "yellow", "magenta", "black", "transparent"]; -class y2 { +}, G2 = ["white", "green", "blue", "cyan", "red", "yellow", "magenta", "black", "transparent"]; +class H2 { constructor() { this.time = null, this.verboseLevel = 0; } log(e, t) { if (this.verboseLevel >= e) { const i = typeof t == "function" ? t() : t; - Ee.log(`${this.time} [${e}] ${i}`); + Te.log(`${this.time} [${e}] ${i}`); } } } -const os = function(e) { +const fs = function(e) { const t = []; for (let i = 0; i < e.length; i++) t.push(e[i].toString(16)); return t; }; -class mE { +class kE { constructor() { this.foreground = "white", this.underline = !1, this.italics = !1, this.background = "black", this.flash = !1; } @@ -27770,9 +27838,9 @@ class mE { return "color=" + this.foreground + ", underline=" + this.underline + ", italics=" + this.italics + ", background=" + this.background + ", flash=" + this.flash; } } -class E2 { +class V2 { constructor() { - this.uchar = " ", this.penState = new mE(); + this.uchar = " ", this.penState = new kE(); } reset() { this.uchar = " ", this.penState.reset(); @@ -27793,26 +27861,26 @@ class E2 { return this.uchar === " " && this.penState.isDefault(); } } -class b2 { +class q2 { constructor(e) { - this.chars = [], this.pos = 0, this.currPenState = new mE(), this.cueStartTime = null, this.logger = void 0; - for (let t = 0; t < pn; t++) - this.chars.push(new E2()); + this.chars = [], this.pos = 0, this.currPenState = new kE(), this.cueStartTime = null, this.logger = void 0; + for (let t = 0; t < yn; t++) + this.chars.push(new V2()); this.logger = e; } equals(e) { - for (let t = 0; t < pn; t++) + for (let t = 0; t < yn; t++) if (!this.chars[t].equals(e.chars[t])) return !1; return !0; } copy(e) { - for (let t = 0; t < pn; t++) + for (let t = 0; t < yn; t++) this.chars[t].copy(e.chars[t]); } isEmpty() { let e = !0; - for (let t = 0; t < pn; t++) + for (let t = 0; t < yn; t++) if (!this.chars[t].isEmpty()) { e = !1; break; @@ -27823,7 +27891,7 @@ class b2 { * Set the cursor to a valid column. */ setCursor(e) { - this.pos !== e && (this.pos = e), this.pos < 0 ? (this.logger.log(3, "Negative cursor position " + this.pos), this.pos = 0) : this.pos > pn && (this.logger.log(3, "Too large cursor position " + this.pos), this.pos = pn); + this.pos !== e && (this.pos = e), this.pos < 0 ? (this.logger.log(3, "Negative cursor position " + this.pos), this.pos = 0) : this.pos > yn && (this.logger.log(3, "Too large cursor position " + this.pos), this.pos = yn); } /** * Move the cursor relative to current position. @@ -27843,8 +27911,8 @@ class b2 { } insertChar(e) { e >= 144 && this.backSpace(); - const t = fE(e); - if (this.pos >= pn) { + const t = IE(e); + if (this.pos >= yn) { this.logger.log(0, () => "Cannot insert " + e.toString(16) + " (" + t + ") at position " + this.pos + ". Skipping it!"); return; } @@ -27852,7 +27920,7 @@ class b2 { } clearFromPos(e) { let t; - for (t = e; t < pn; t++) + for (t = e; t < yn; t++) this.chars[t].reset(); } clear() { @@ -27864,7 +27932,7 @@ class b2 { getTextString() { const e = []; let t = !0; - for (let i = 0; i < pn; i++) { + for (let i = 0; i < yn; i++) { const s = this.chars[i].uchar; s !== " " && (t = !1), e.push(s); } @@ -27874,21 +27942,21 @@ class b2 { this.currPenState.setStyles(e), this.chars[this.pos].setPenState(this.currPenState); } } -class oh { +class wh { constructor(e) { - this.rows = [], this.currRow = yi - 1, this.nrRollUpRows = null, this.lastOutputScreen = null, this.logger = void 0; - for (let t = 0; t < yi; t++) - this.rows.push(new b2(e)); + this.rows = [], this.currRow = Ii - 1, this.nrRollUpRows = null, this.lastOutputScreen = null, this.logger = void 0; + for (let t = 0; t < Ii; t++) + this.rows.push(new q2(e)); this.logger = e; } reset() { - for (let e = 0; e < yi; e++) + for (let e = 0; e < Ii; e++) this.rows[e].clear(); - this.currRow = yi - 1; + this.currRow = Ii - 1; } equals(e) { let t = !0; - for (let i = 0; i < yi; i++) + for (let i = 0; i < Ii; i++) if (!this.rows[i].equals(e.rows[i])) { t = !1; break; @@ -27896,12 +27964,12 @@ class oh { return t; } copy(e) { - for (let t = 0; t < yi; t++) + for (let t = 0; t < Ii; t++) this.rows[t].copy(e.rows[t]); } isEmpty() { let e = !0; - for (let t = 0; t < yi; t++) + for (let t = 0; t < Ii; t++) if (!this.rows[t].isEmpty()) { e = !1; break; @@ -27930,10 +27998,10 @@ class oh { this.logger.log(2, "setCursor: " + e), this.rows[this.currRow].setCursor(e); } setPAC(e) { - this.logger.log(2, () => "pacData = " + Oe(e)); + this.logger.log(2, () => "pacData = " + $e(e)); let t = e.row - 1; if (this.nrRollUpRows && t < this.nrRollUpRows - 1 && (t = this.nrRollUpRows - 1), this.nrRollUpRows && this.currRow !== t) { - for (let o = 0; o < yi; o++) + for (let o = 0; o < Ii; o++) this.rows[o].clear(); const r = this.currRow + 1 - this.nrRollUpRows, a = this.lastOutputScreen; if (a) { @@ -27962,7 +28030,7 @@ class oh { * Set background/extra foreground, but first do back_space, and then insert space (backwards compatibility). */ setBkgData(e) { - this.logger.log(2, () => "bkgData = " + Oe(e)), this.backSpace(), this.setPen(e), this.insertChar(32); + this.logger.log(2, () => "bkgData = " + $e(e)), this.backSpace(), this.setPen(e), this.insertChar(32); } setRollUpRows(e) { this.nrRollUpRows = e; @@ -27983,7 +28051,7 @@ class oh { e = e || !1; const t = []; let i = "", s = -1; - for (let r = 0; r < yi; r++) { + for (let r = 0; r < Ii; r++) { const a = this.rows[r].getTextString(); a && (s = r + 1, e ? t.push("Row " + s + ": '" + a + "'") : t.push(a.trim())); } @@ -27994,12 +28062,12 @@ class oh { return this.rows; } } -class g0 { +class C0 { constructor(e, t, i) { - this.chNr = void 0, this.outputFilter = void 0, this.mode = void 0, this.verbose = void 0, this.displayedMemory = void 0, this.nonDisplayedMemory = void 0, this.lastOutputScreen = void 0, this.currRollUpRow = void 0, this.writeScreen = void 0, this.cueStartTime = void 0, this.logger = void 0, this.chNr = e, this.outputFilter = t, this.mode = null, this.verbose = 0, this.displayedMemory = new oh(i), this.nonDisplayedMemory = new oh(i), this.lastOutputScreen = new oh(i), this.currRollUpRow = this.displayedMemory.rows[yi - 1], this.writeScreen = this.displayedMemory, this.mode = null, this.cueStartTime = null, this.logger = i; + this.chNr = void 0, this.outputFilter = void 0, this.mode = void 0, this.verbose = void 0, this.displayedMemory = void 0, this.nonDisplayedMemory = void 0, this.lastOutputScreen = void 0, this.currRollUpRow = void 0, this.writeScreen = void 0, this.cueStartTime = void 0, this.logger = void 0, this.chNr = e, this.outputFilter = t, this.mode = null, this.verbose = 0, this.displayedMemory = new wh(i), this.nonDisplayedMemory = new wh(i), this.lastOutputScreen = new wh(i), this.currRollUpRow = this.displayedMemory.rows[Ii - 1], this.writeScreen = this.displayedMemory, this.mode = null, this.cueStartTime = null, this.logger = i; } reset() { - this.mode = null, this.displayedMemory.reset(), this.nonDisplayedMemory.reset(), this.lastOutputScreen.reset(), this.outputFilter.reset(), this.currRollUpRow = this.displayedMemory.rows[yi - 1], this.writeScreen = this.displayedMemory, this.mode = null, this.cueStartTime = null; + this.mode = null, this.displayedMemory.reset(), this.nonDisplayedMemory.reset(), this.lastOutputScreen.reset(), this.outputFilter.reset(), this.currRollUpRow = this.displayedMemory.rows[Ii - 1], this.writeScreen = this.displayedMemory, this.mode = null, this.cueStartTime = null; } getHandler() { return this.outputFilter; @@ -28081,7 +28149,7 @@ class g0 { const i = Math.floor(e / 2) - 16, s = ["white", "green", "blue", "cyan", "red", "yellow", "magenta"]; t.foreground = s[i]; } - this.logger.log(2, "MIDROW: " + Oe(t)), this.writeScreen.setPen(t); + this.logger.log(2, "MIDROW: " + $e(t)), this.writeScreen.setPen(t); } outputDataUpdate(e = !1) { const t = this.logger.time; @@ -28091,11 +28159,11 @@ class g0 { this.outputFilter && (this.displayedMemory.isEmpty() || (this.outputFilter.newCue && this.outputFilter.newCue(this.cueStartTime, e, this.displayedMemory), this.cueStartTime = e)); } } -class p0 { +class F0 { constructor(e, t, i) { - this.channels = void 0, this.currentChannel = 0, this.cmdHistory = S2(), this.logger = void 0; - const s = this.logger = new y2(); - this.channels = [null, new g0(e, t, s), new g0(e + 1, i, s)]; + this.channels = void 0, this.currentChannel = 0, this.cmdHistory = j2(), this.logger = void 0; + const s = this.logger = new H2(); + this.channels = [null, new C0(e, t, s), new C0(e + 1, i, s)]; } getHandler(e) { return this.channels[e].getHandler(); @@ -28113,21 +28181,21 @@ class p0 { let a = !1, o = null; if (s === 0 && r === 0) continue; - this.logger.log(3, () => "[" + os([t[i], t[i + 1]]) + "] -> (" + os([s, r]) + ")"); + this.logger.log(3, () => "[" + fs([t[i], t[i + 1]]) + "] -> (" + fs([s, r]) + ")"); const u = this.cmdHistory; if (s >= 16 && s <= 31) { - if (T2(s, r, u)) { - Wo(null, null, u), this.logger.log(3, () => "Repeated command (" + os([s, r]) + ") is dropped"); + if (K2(s, r, u)) { + fl(null, null, u), this.logger.log(3, () => "Repeated command (" + fs([s, r]) + ") is dropped"); continue; } - Wo(s, r, this.cmdHistory), a = this.parseCmd(s, r), a || (a = this.parseMidrow(s, r)), a || (a = this.parsePAC(s, r)), a || (a = this.parseBackgroundAttributes(s, r)); + fl(s, r, this.cmdHistory), a = this.parseCmd(s, r), a || (a = this.parseMidrow(s, r)), a || (a = this.parsePAC(s, r)), a || (a = this.parseBackgroundAttributes(s, r)); } else - Wo(null, null, u); + fl(null, null, u); if (!a && (o = this.parseChars(s, r), o)) { const c = this.currentChannel; c && c > 0 ? this.channels[c].insertChars(o) : this.logger.log(2, "No channel found yet. TEXT-MODE?"); } - !a && !o && this.logger.log(2, () => "Couldn't parse cleaned data " + os([s, r]) + " orig: " + os([t[i], t[i + 1]])); + !a && !o && this.logger.log(2, () => "Couldn't parse cleaned data " + fs([s, r]) + " orig: " + fs([t[i], t[i + 1]])); } } /** @@ -28150,7 +28218,7 @@ class p0 { if (e === 17 ? i = 1 : i = 2, i !== this.currentChannel) return this.logger.log(0, "Mismatch channel in midrow parsing"), !1; const s = this.channels[i]; - return s ? (s.ccMIDROW(t), this.logger.log(3, () => "MIDROW (" + os([e, t]) + ")"), !0) : !1; + return s ? (s.ccMIDROW(t), this.logger.log(3, () => "MIDROW (" + fs([e, t]) + ")"), !0) : !1; } return !1; } @@ -28164,7 +28232,7 @@ class p0 { if (!(s || r)) return !1; const a = e <= 23 ? 1 : 2; - t >= 64 && t <= 95 ? i = a === 1 ? m2[e] : p2[e] : i = a === 1 ? g2[e] : _2[e]; + t >= 64 && t <= 95 ? i = a === 1 ? $2[e] : N2[e] : i = a === 1 ? B2[e] : U2[e]; const o = this.channels[a]; return o ? (o.setPAC(this.interpretPAC(i, t)), this.currentChannel = a, !0) : !1; } @@ -28191,9 +28259,9 @@ class p0 { let i, s = null, r = null; if (e >= 25 ? (i = 2, r = e - 8) : (i = 1, r = e), r >= 17 && r <= 19) { let a; - r === 17 ? a = t + 80 : r === 18 ? a = t + 112 : a = t + 144, this.logger.log(2, () => "Special char '" + fE(a) + "' in channel " + i), s = [a]; + r === 17 ? a = t + 80 : r === 18 ? a = t + 112 : a = t + 144, this.logger.log(2, () => "Special char '" + IE(a) + "' in channel " + i), s = [a]; } else e >= 32 && e <= 127 && (s = t === 0 ? [e] : [e, t]); - return s && this.logger.log(3, () => "Char codes = " + os(s).join(",")), s; + return s && this.logger.log(3, () => "Char codes = " + fs(s).join(",")), s; } /** * Parse extended background attributes as well as new foreground color black. @@ -28205,7 +28273,7 @@ class p0 { return !1; let r; const a = {}; - e === 16 || e === 24 ? (r = Math.floor((t - 32) / 2), a.background = v2[r], t % 2 === 1 && (a.background = a.background + "_semi")) : t === 45 ? a.background = "transparent" : (a.foreground = "black", t === 47 && (a.underline = !0)); + e === 16 || e === 24 ? (r = Math.floor((t - 32) / 2), a.background = G2[r], t % 2 === 1 && (a.background = a.background + "_semi")) : t === 45 ? a.background = "transparent" : (a.foreground = "black", t === 47 && (a.underline = !0)); const o = e <= 23 ? 1 : 2; return this.channels[o].setBkgData(a), !0; } @@ -28217,7 +28285,7 @@ class p0 { const t = this.channels[e]; t && t.reset(); } - Wo(null, null, this.cmdHistory); + fl(null, null, this.cmdHistory); } /** * Trigger the generation of a cue, and the start of a new one if displayScreens are not empty. @@ -28229,20 +28297,20 @@ class p0 { } } } -function Wo(n, e, t) { +function fl(n, e, t) { t.a = n, t.b = e; } -function T2(n, e, t) { +function K2(n, e, t) { return t.a === n && t.b === e; } -function S2() { +function j2() { return { a: null, b: null }; } -var wf = function() { - if (Vl != null && Vl.VTTCue) +var Wf = function() { + if (ou != null && ou.VTTCue) return self.VTTCue; const n = ["", "lr", "rl"], e = ["start", "middle", "end", "left", "right"]; function t(o, u) { @@ -28271,7 +28339,7 @@ var wf = function() { enumerable: !0 }; c.hasBeenReset = !1; - let d = "", f = !1, m = o, g = u, p = l, y = null, v = "", _ = !0, E = "auto", T = "start", A = 50, S = "middle", D = 50, x = "middle"; + let d = "", f = !1, m = o, g = u, p = l, y = null, v = "", _ = !0, E = "auto", T = "start", x = 50, S = "middle", D = 50, A = "middle"; Object.defineProperty(c, "id", r({}, h, { get: function() { return d; @@ -28356,12 +28424,12 @@ var wf = function() { } })), Object.defineProperty(c, "position", r({}, h, { get: function() { - return A; + return x; }, set: function(w) { if (w < 0 || w > 100) throw new Error("Position must be between 0 and 100."); - A = w, this.hasBeenReset = !0; + x = w, this.hasBeenReset = !0; } })), Object.defineProperty(c, "positionAlign", r({}, h, { get: function() { @@ -28384,13 +28452,13 @@ var wf = function() { } })), Object.defineProperty(c, "align", r({}, h, { get: function() { - return x; + return A; }, set: function(w) { const I = s(w); if (!I) throw new SyntaxError("An invalid or illegal string was specified."); - x = I, this.hasBeenReset = !0; + A = I, this.hasBeenReset = !0; } })), c.displayState = void 0; } @@ -28398,7 +28466,7 @@ var wf = function() { return self.WebVTT.convertCueToDOMTree(self, this.text); }, a; }(); -class A2 { +class z2 { decode(e, t) { if (!e) return ""; @@ -28407,14 +28475,14 @@ class A2 { return decodeURIComponent(encodeURIComponent(e)); } } -function gE(n) { +function RE(n) { function e(i, s, r, a) { return (i | 0) * 3600 + (s | 0) * 60 + (r | 0) + parseFloat(a || 0); } const t = n.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/); return t ? parseFloat(t[2]) > 59 ? e(t[2], t[3], 0, t[4]) : e(t[1], t[2], t[3], t[4]) : null; } -class x2 { +class W2 { constructor() { this.values = /* @__PURE__ */ Object.create(null); } @@ -28456,7 +28524,7 @@ class x2 { return !1; } } -function pE(n, e, t, i) { +function CE(n, e, t, i) { const s = i ? n.split(i) : [n]; for (const r in s) { if (typeof s[r] != "string") @@ -28468,18 +28536,18 @@ function pE(n, e, t, i) { e(o, u); } } -const Ed = new wf(0, 0, ""), Yo = Ed.align === "middle" ? "middle" : "center"; -function D2(n, e, t) { +const Gd = new Wf(0, 0, ""), ml = Gd.align === "middle" ? "middle" : "center"; +function Y2(n, e, t) { const i = n; function s() { - const o = gE(n); + const o = RE(n); if (o === null) throw new Error("Malformed timestamp: " + i); return n = n.replace(/^[^\sa-zA-Z-]+/, ""), o; } function r(o, u) { - const l = new x2(); - pE(o, function(d, f) { + const l = new W2(); + CE(o, function(d, f) { let m; switch (d) { case "region": @@ -28493,23 +28561,23 @@ function D2(n, e, t) { l.alt(d, f, ["rl", "lr"]); break; case "line": - m = f.split(","), l.integer(d, m[0]), l.percent(d, m[0]) && l.set("snapToLines", !1), l.alt(d, m[0], ["auto"]), m.length === 2 && l.alt("lineAlign", m[1], ["start", Yo, "end"]); + m = f.split(","), l.integer(d, m[0]), l.percent(d, m[0]) && l.set("snapToLines", !1), l.alt(d, m[0], ["auto"]), m.length === 2 && l.alt("lineAlign", m[1], ["start", ml, "end"]); break; case "position": - m = f.split(","), l.percent(d, m[0]), m.length === 2 && l.alt("positionAlign", m[1], ["start", Yo, "end", "line-left", "line-right", "auto"]); + m = f.split(","), l.percent(d, m[0]), m.length === 2 && l.alt("positionAlign", m[1], ["start", ml, "end", "line-left", "line-right", "auto"]); break; case "size": l.percent(d, f); break; case "align": - l.alt(d, f, ["start", Yo, "end", "left", "right"]); + l.alt(d, f, ["start", ml, "end", "left", "right"]); break; } }, /:/, /\s/), u.region = l.get("region", null), u.vertical = l.get("vertical", ""); let c = l.get("line", "auto"); - c === "auto" && Ed.line === -1 && (c = -1), u.line = c, u.lineAlign = l.get("lineAlign", "start"), u.snapToLines = l.get("snapToLines", !0), u.size = l.get("size", 100), u.align = l.get("align", Yo); + c === "auto" && Gd.line === -1 && (c = -1), u.line = c, u.lineAlign = l.get("lineAlign", "start"), u.snapToLines = l.get("snapToLines", !0), u.size = l.get("size", 100), u.align = l.get("align", ml); let h = l.get("position", "auto"); - h === "auto" && Ed.position === 50 && (h = u.align === "start" || u.align === "left" ? 0 : u.align === "end" || u.align === "right" ? 100 : 50), u.position = h; + h === "auto" && Gd.position === 50 && (h = u.align === "start" || u.align === "left" ? 0 : u.align === "end" || u.align === "right" ? 100 : 50), u.position = h; } function a() { n = n.replace(/^\s+/, ""); @@ -28518,13 +28586,13 @@ function D2(n, e, t) { throw new Error("Malformed time stamp (time stamps must be separated by '-->'): " + i); n = n.slice(3), a(), e.endTime = s(), a(), r(n, e); } -function _E(n) { +function FE(n) { return n.replace(/<br(?: \/)?>/gi, ` `); } -class w2 { +class X2 { constructor() { - this.state = "INITIAL", this.buffer = "", this.decoder = new A2(), this.regionList = [], this.cue = null, this.oncue = void 0, this.onparsingerror = void 0, this.onflush = void 0; + this.state = "INITIAL", this.buffer = "", this.decoder = new z2(), this.regionList = [], this.cue = null, this.oncue = void 0, this.onparsingerror = void 0, this.onflush = void 0; } parse(e) { const t = this; @@ -28533,7 +28601,7 @@ class w2 { })); function i() { let r = t.buffer, a = 0; - for (r = _E(r); a < r.length && r[a] !== "\r" && r[a] !== ` + for (r = FE(r); a < r.length && r[a] !== "\r" && r[a] !== ` `; ) ++a; const o = r.slice(0, a); @@ -28541,7 +28609,7 @@ class w2 { ` && ++a, t.buffer = r.slice(a), o; } function s(r) { - pE(r, function(a, o) { + CE(r, function(a, o) { }, /:/); } try { @@ -28573,7 +28641,7 @@ class w2 { } if (!r) continue; - if (t.cue = new wf(0, 0, ""), t.state = "CUE", r.indexOf("-->") === -1) { + if (t.cue = new Wf(0, 0, ""), t.state = "CUE", r.indexOf("-->") === -1) { t.cue.id = r; continue; } @@ -28583,7 +28651,7 @@ class w2 { continue; } try { - D2(r, t.cue, t.regionList); + Y2(r, t.cue, t.regionList); } catch { t.cue = null, t.state = "BADCUE"; continue; @@ -28625,19 +28693,19 @@ class w2 { return e.onflush && e.onflush(), this; } } -const L2 = /\r\n|\n\r|\n|\r/g, lh = function(e, t, i = 0) { +const Q2 = /\r\n|\n\r|\n|\r/g, Lh = function(e, t, i = 0) { return e.slice(i, i + t.length) === t; -}, I2 = function(e) { +}, Z2 = function(e) { let t = parseInt(e.slice(-3)); const i = parseInt(e.slice(-6, -4)), s = parseInt(e.slice(-9, -7)), r = e.length > 9 ? parseInt(e.substring(0, e.indexOf(":"))) : 0; - if (!Z(t) || !Z(i) || !Z(s) || !Z(r)) + if (!J(t) || !J(i) || !J(s) || !J(r)) throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`); return t += 1e3 * i, t += 60 * 1e3 * s, t += 60 * 60 * 1e3 * r, t; }; -function Lf(n, e, t) { - return wa(n.toString()) + wa(e.toString()) + wa(t); +function Yf(n, e, t) { + return Ba(n.toString()) + Ba(e.toString()) + Ba(t); } -const k2 = function(e, t, i) { +const J2 = function(e, t, i) { let s = e[t], r = e[s.prevCC]; if (!r || !r.new && s.new) { e.ccOffset = e.presentationOffset = s.start, s.new = !1; @@ -28649,26 +28717,26 @@ const k2 = function(e, t, i) { } e.presentationOffset = i; }; -function R2(n, e, t, i, s, r, a) { - const o = new w2(), u = Kt(new Uint8Array(n)).trim().replace(L2, ` +function eF(n, e, t, i, s, r, a) { + const o = new X2(), u = Qt(new Uint8Array(n)).trim().replace(Q2, ` `).split(` -`), l = [], c = e ? jR(e.baseTime, e.timescale) : 0; +`), l = [], c = e ? gC(e.baseTime, e.timescale) : 0; let h = "00:00.000", d = 0, f = 0, m, g = !0; o.oncue = function(p) { const y = t[i]; let v = t.ccOffset; const _ = (d - c) / 9e4; - if (y != null && y.new && (f !== void 0 ? v = t.ccOffset = y.start : k2(t, i, _)), _) { + if (y != null && y.new && (f !== void 0 ? v = t.ccOffset = y.start : J2(t, i, _)), _) { if (!e) { m = new Error("Missing initPTS for VTT MPEGTS"); return; } v = _ - t.presentationOffset; } - const E = p.endTime - p.startTime, T = Zt((p.startTime + v - f) * 9e4, s * 9e4) / 9e4; + const E = p.endTime - p.startTime, T = ii((p.startTime + v - f) * 9e4, s * 9e4) / 9e4; p.startTime = Math.max(T, 0), p.endTime = Math.max(T + E, 0); - const A = p.text.trim(); - p.text = decodeURIComponent(encodeURIComponent(A)), p.id || (p.id = Lf(p.startTime, p.endTime, A)), p.endTime > 0 && l.push(p); + const x = p.text.trim(); + p.text = decodeURIComponent(encodeURIComponent(x)), p.id || (p.id = Yf(p.startTime, p.endTime, x)), p.endTime > 0 && l.push(p); }, o.onparsingerror = function(p) { m = p; }, o.onflush = function() { @@ -28679,12 +28747,12 @@ function R2(n, e, t, i, s, r, a) { r(l); }, u.forEach((p) => { if (g) - if (lh(p, "X-TIMESTAMP-MAP=")) { + if (Lh(p, "X-TIMESTAMP-MAP=")) { g = !1, p.slice(16).split(",").forEach((y) => { - lh(y, "LOCAL:") ? h = y.slice(6) : lh(y, "MPEGTS:") && (d = parseInt(y.slice(7))); + Lh(y, "LOCAL:") ? h = y.slice(6) : Lh(y, "MPEGTS:") && (d = parseInt(y.slice(7))); }); try { - f = I2(h) / 1e3; + f = Z2(h) / 1e3; } catch (y) { m = y; } @@ -28694,27 +28762,27 @@ function R2(n, e, t, i, s, r, a) { `); }), o.flush(); } -const uh = "stpp.ttml.im1t", vE = /^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/, yE = /^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/, C2 = { +const Ih = "stpp.ttml.im1t", PE = /^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/, OE = /^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/, tF = { left: "start", center: "center", right: "end", start: "start", end: "end" }; -function _0(n, e, t, i) { +function P0(n, e, t, i) { const s = fe(new Uint8Array(n), ["mdat"]); if (s.length === 0) { i(new Error("Could not parse IMSC1 mdat")); return; } - const r = s.map((o) => Kt(o)), a = KR(e.baseTime, 1, e.timescale); + const r = s.map((o) => Qt(o)), a = mC(e.baseTime, 1, e.timescale); try { - r.forEach((o) => t(F2(o, a))); + r.forEach((o) => t(iF(o, a))); } catch (o) { i(o); } } -function F2(n, e) { +function iF(n, e) { const s = new DOMParser().parseFromString(n, "text/xml").getElementsByTagName("tt")[0]; if (!s) throw new Error("Invalid ttml"); @@ -28723,50 +28791,50 @@ function F2(n, e) { subFrameRate: 1, frameRateMultiplier: 0, tickRate: 0 - }, a = Object.keys(r).reduce((h, d) => (h[d] = s.getAttribute(`ttp:${d}`) || r[d], h), {}), o = s.getAttribute("xml:space") !== "preserve", u = v0(ch(s, "styling", "style")), l = v0(ch(s, "layout", "region")), c = ch(s, "body", "[begin]"); + }, a = Object.keys(r).reduce((h, d) => (h[d] = s.getAttribute(`ttp:${d}`) || r[d], h), {}), o = s.getAttribute("xml:space") !== "preserve", u = O0(kh(s, "styling", "style")), l = O0(kh(s, "layout", "region")), c = kh(s, "body", "[begin]"); return [].map.call(c, (h) => { - const d = EE(h, o); + const d = ME(h, o); if (!d || !h.hasAttribute("begin")) return null; - const f = dh(h.getAttribute("begin"), a), m = dh(h.getAttribute("dur"), a); - let g = dh(h.getAttribute("end"), a); + const f = Ch(h.getAttribute("begin"), a), m = Ch(h.getAttribute("dur"), a); + let g = Ch(h.getAttribute("end"), a); if (f === null) - throw y0(h); + throw M0(h); if (g === null) { if (m === null) - throw y0(h); + throw M0(h); g = f + m; } - const p = new wf(f - e, g - e, d); - p.id = Lf(p.startTime, p.endTime, p.text); - const y = l[h.getAttribute("region")], v = u[h.getAttribute("style")], _ = P2(y, v, u), { + const p = new Wf(f - e, g - e, d); + p.id = Yf(p.startTime, p.endTime, p.text); + const y = l[h.getAttribute("region")], v = u[h.getAttribute("style")], _ = nF(y, v, u), { textAlign: E } = _; if (E) { - const T = C2[E]; + const T = tF[E]; T && (p.lineAlign = T), p.align = E; } - return De(p, _), p; + return we(p, _), p; }).filter((h) => h !== null); } -function ch(n, e, t) { +function kh(n, e, t) { const i = n.getElementsByTagName(e)[0]; return i ? [].slice.call(i.querySelectorAll(t)) : []; } -function v0(n) { +function O0(n) { return n.reduce((e, t) => { const i = t.getAttribute("xml:id"); return i && (e[i] = t), e; }, {}); } -function EE(n, e) { +function ME(n, e) { return [].slice.call(n.childNodes).reduce((t, i, s) => { var r; return i.nodeName === "br" && s ? t + ` -` : (r = i.childNodes) != null && r.length ? EE(i, e) : e ? t + i.textContent.trim().replace(/\s+/g, " ") : t + i.textContent; +` : (r = i.childNodes) != null && r.length ? ME(i, e) : e ? t + i.textContent.trim().replace(/\s+/g, " ") : t + i.textContent; }, ""); } -function P2(n, e, t) { +function nF(n, e, t) { const i = "http://www.w3.org/ns/ttml#styling"; let s = null; const r = [ @@ -28784,28 +28852,28 @@ function P2(n, e, t) { // 'writingMode' ], a = n != null && n.hasAttribute("style") ? n.getAttribute("style") : null; return a && t.hasOwnProperty(a) && (s = t[a]), r.reduce((o, u) => { - const l = hh(e, i, u) || hh(n, i, u) || hh(s, i, u); + const l = Rh(e, i, u) || Rh(n, i, u) || Rh(s, i, u); return l && (o[u] = l), o; }, {}); } -function hh(n, e, t) { +function Rh(n, e, t) { return n && n.hasAttributeNS(e, t) ? n.getAttributeNS(e, t) : null; } -function y0(n) { +function M0(n) { return new Error(`Could not parse ttml timestamp ${n}`); } -function dh(n, e) { +function Ch(n, e) { if (!n) return null; - let t = gE(n); - return t === null && (vE.test(n) ? t = O2(n, e) : yE.test(n) && (t = M2(n, e))), t; + let t = RE(n); + return t === null && (PE.test(n) ? t = sF(n, e) : OE.test(n) && (t = rF(n, e))), t; } -function O2(n, e) { - const t = vE.exec(n), i = (t[4] | 0) + (t[5] | 0) / e.subFrameRate; +function sF(n, e) { + const t = PE.exec(n), i = (t[4] | 0) + (t[5] | 0) / e.subFrameRate; return (t[1] | 0) * 3600 + (t[2] | 0) * 60 + (t[3] | 0) + i / e.frameRate; } -function M2(n, e) { - const t = yE.exec(n), i = Number(t[1]); +function rF(n, e) { + const t = OE.exec(n), i = Number(t[1]); switch (t[2]) { case "h": return i * 3600; @@ -28820,7 +28888,7 @@ function M2(n, e) { } return i; } -class Xo { +class gl { constructor(e, t) { this.timelineController = void 0, this.cueRanges = [], this.trackName = void 0, this.startTime = null, this.endTime = null, this.screen = null, this.timelineController = e, this.trackName = t; } @@ -28834,9 +28902,9 @@ class Xo { this.cueRanges = [], this.startTime = null; } } -class $2 { +class aF { constructor(e) { - this.hls = void 0, this.media = null, this.config = void 0, this.enabled = !0, this.Cues = void 0, this.textTracks = [], this.tracks = [], this.initPTS = [], this.unparsedVttFrags = [], this.captionsTracks = {}, this.nonNativeCaptionsTracks = {}, this.cea608Parser1 = void 0, this.cea608Parser2 = void 0, this.lastCc = -1, this.lastSn = -1, this.lastPartIndex = -1, this.prevCC = -1, this.vttCCs = b0(), this.captionsProperties = void 0, this.hls = e, this.config = e.config, this.Cues = e.config.cueHandler, this.captionsProperties = { + this.hls = void 0, this.media = null, this.config = void 0, this.enabled = !0, this.Cues = void 0, this.textTracks = [], this.tracks = [], this.initPTS = [], this.unparsedVttFrags = [], this.captionsTracks = {}, this.nonNativeCaptionsTracks = {}, this.cea608Parser1 = void 0, this.cea608Parser2 = void 0, this.lastCc = -1, this.lastSn = -1, this.lastPartIndex = -1, this.prevCC = -1, this.vttCCs = B0(), this.captionsProperties = void 0, this.hls = e, this.config = e.config, this.Cues = e.config.cueHandler, this.captionsProperties = { textTrack1: { label: this.config.captionsTextTrack1Label, languageCode: this.config.captionsTextTrack1LanguageCode @@ -28862,13 +28930,13 @@ class $2 { e.off(b.MEDIA_ATTACHING, this.onMediaAttaching, this), e.off(b.MEDIA_DETACHING, this.onMediaDetaching, this), e.off(b.MANIFEST_LOADING, this.onManifestLoading, this), e.off(b.MANIFEST_LOADED, this.onManifestLoaded, this), e.off(b.SUBTITLE_TRACKS_UPDATED, this.onSubtitleTracksUpdated, this), e.off(b.FRAG_LOADING, this.onFragLoading, this), e.off(b.FRAG_LOADED, this.onFragLoaded, this), e.off(b.FRAG_PARSING_USERDATA, this.onFragParsingUserdata, this), e.off(b.FRAG_DECRYPTED, this.onFragDecrypted, this), e.off(b.INIT_PTS_FOUND, this.onInitPtsFound, this), e.off(b.SUBTITLE_TRACKS_CLEARED, this.onSubtitleTracksCleared, this), e.off(b.BUFFER_FLUSHING, this.onBufferFlushing, this), this.hls = this.config = this.media = null, this.cea608Parser1 = this.cea608Parser2 = void 0; } initCea608Parsers() { - const e = new Xo(this, "textTrack1"), t = new Xo(this, "textTrack2"), i = new Xo(this, "textTrack3"), s = new Xo(this, "textTrack4"); - this.cea608Parser1 = new p0(1, e, t), this.cea608Parser2 = new p0(3, i, s); + const e = new gl(this, "textTrack1"), t = new gl(this, "textTrack2"), i = new gl(this, "textTrack3"), s = new gl(this, "textTrack4"); + this.cea608Parser1 = new F0(1, e, t), this.cea608Parser2 = new F0(3, i, s); } addCues(e, t, i, s, r) { let a = !1; for (let o = r.length; o--; ) { - const u = r[o], l = B2(u[0], u[1], t, i); + const u = r[o], l = oF(u[0], u[1], t, i); if (l >= 0 && (u[0] = Math.min(u[0], t), u[1] = Math.max(u[1], i), a = !0, l / (i - t) > 0.5)) return; } @@ -28894,7 +28962,7 @@ class $2 { const { unparsedVttFrags: a } = this; - i === J.MAIN && (this.initPTS[t.cc] = { + i === te.MAIN && (this.initPTS[t.cc] = { baseTime: s, timescale: r }), a.length && (this.unparsedVttFrags = [], a.forEach((o) => { @@ -28912,7 +28980,7 @@ class $2 { if (i) for (let s = 0; s < i.textTracks.length; s++) { const r = i.textTracks[s]; - if (E0(r, { + if ($0(r, { name: e, lang: t, characteristics: "transcribes-spoken-dialog,describes-music-and-sound" @@ -28936,7 +29004,7 @@ class $2 { languageCode: a } = t[e], o = this.getExistingTrack(r, a); if (o) - i[e] = o, ar(i[e]), cE(i[e], s); + i[e] = o, vr(i[e]), DE(i[e], s); else { const u = this.createTextTrack("captions", r, a); u && (u[e] = !0, i[e] = u); @@ -28975,11 +29043,11 @@ class $2 { captionsTracks: s } = this; Object.keys(s).forEach((r) => { - ar(s[r]), delete s[r]; + vr(s[r]), delete s[r]; }), this.nonNativeCaptionsTracks = {}; } onManifestLoading() { - this.lastCc = -1, this.lastSn = -1, this.lastPartIndex = -1, this.prevCC = -1, this.vttCCs = b0(), this._cleanTracks(), this.tracks = [], this.captionsTracks = {}, this.nonNativeCaptionsTracks = {}, this.textTracks = [], this.unparsedVttFrags = [], this.initPTS = [], this.cea608Parser1 && this.cea608Parser2 && (this.cea608Parser1.reset(), this.cea608Parser2.reset()); + this.lastCc = -1, this.lastSn = -1, this.lastPartIndex = -1, this.prevCC = -1, this.vttCCs = B0(), this._cleanTracks(), this.tracks = [], this.captionsTracks = {}, this.nonNativeCaptionsTracks = {}, this.textTracks = [], this.unparsedVttFrags = [], this.initPTS = [], this.cea608Parser1 && this.cea608Parser2 && (this.cea608Parser1.reset(), this.cea608Parser2.reset()); } _cleanTracks() { const { @@ -28990,32 +29058,32 @@ class $2 { const t = e.textTracks; if (t) for (let i = 0; i < t.length; i++) - ar(t[i]); + vr(t[i]); } onSubtitleTracksUpdated(e, t) { - const i = t.subtitleTracks || [], s = i.some((r) => r.textCodec === uh); + const i = t.subtitleTracks || [], s = i.some((r) => r.textCodec === Ih); if (this.config.enableWebVTT || s && this.config.enableIMSC1) { - if (iE(this.tracks, i)) { + if (vE(this.tracks, i)) { this.tracks = i; return; } if (this.textTracks = [], this.tracks = i, this.config.renderTextTracksNatively) { - const a = this.media, o = a ? bl(a.textTracks) : null; + const a = this.media, o = a ? Ul(a.textTracks) : null; if (this.tracks.forEach((u, l) => { let c; if (o) { let h = null; for (let d = 0; d < o.length; d++) - if (o[d] && E0(o[d], u)) { + if (o[d] && $0(o[d], u)) { h = o[d], o[d] = null; break; } h && (c = h); } if (c) - ar(c); + vr(c); else { - const h = bE(u); + const h = $E(u); c = this.createTextTrack(h, u.name, u.lang), c && (c.mode = "disabled"); } c && this.textTracks.push(c); @@ -29050,7 +29118,7 @@ class $2 { return t == null ? void 0 : t.attrs["CLOSED-CAPTIONS"]; } onFragLoading(e, t) { - if (this.enabled && t.frag.type === J.MAIN) { + if (this.enabled && t.frag.type === te.MAIN) { var i, s; const { cea608Parser1: r, @@ -29068,7 +29136,7 @@ class $2 { frag: i, payload: s } = t; - if (i.type === J.SUBTITLE) + if (i.type === te.SUBTITLE) if (s.byteLength) { const r = i.decryptdata, a = "stats" in t; if (r == null || !r.encrypted || a) { @@ -29077,7 +29145,7 @@ class $2 { start: i.start, prevCC: this.prevCC, new: !0 - }, this.prevCC = i.cc), o && o.textCodec === uh ? this._parseIMSC1(i, s) : this._parseVTTs(t); + }, this.prevCC = i.cc), o && o.textCodec === Ih ? this._parseIMSC1(i, s) : this._parseVTTs(t); } } else this.hls.trigger(b.SUBTITLE_FRAG_PROCESSED, { @@ -29088,7 +29156,7 @@ class $2 { } _parseIMSC1(e, t) { const i = this.hls; - _0(t, this.initPTS[e.cc], (s) => { + P0(t, this.initPTS[e.cc], (s) => { this._appendCues(s, e.level), i.trigger(b.SUBTITLE_FRAG_PROCESSED, { success: !0, frag: e @@ -29114,8 +29182,8 @@ class $2 { a.push(e); return; } - const u = this.hls, l = (t = i.initSegment) != null && t.data ? li(i.initSegment.data, new Uint8Array(s)).buffer : s; - R2(l, this.initPTS[i.cc], this.vttCCs, i.cc, i.start, (c) => { + const u = this.hls, l = (t = i.initSegment) != null && t.data ? fi(i.initSegment.data, new Uint8Array(s)).buffer : s; + eF(l, this.initPTS[i.cc], this.vttCCs, i.cc, i.start, (c) => { this._appendCues(c, i.level), u.trigger(b.SUBTITLE_FRAG_PROCESSED, { success: !0, frag: i @@ -29131,8 +29199,8 @@ class $2 { } _fallbackToIMSC1(e, t) { const i = this.tracks[e.level]; - i.textCodec || _0(t, this.initPTS[e.cc], () => { - i.textCodec = uh, this._parseIMSC1(e, t); + i.textCodec || P0(t, this.initPTS[e.cc], () => { + i.textCodec = Ih, this._parseIMSC1(e, t); }, () => { i.textCodec = "wvtt"; }); @@ -29143,7 +29211,7 @@ class $2 { const s = this.textTracks[t]; if (!s || s.mode === "disabled") return; - e.forEach((r) => hE(s, r)); + e.forEach((r) => wE(s, r)); } else { const s = this.tracks[t]; if (!s) @@ -29160,7 +29228,7 @@ class $2 { const { frag: i } = t; - i.type === J.SUBTITLE && this.onFragLoaded(b.FRAG_LOADED, t); + i.type === te.SUBTITLE && this.onFragLoaded(b.FRAG_LOADED, t); } onSubtitleTracksCleared() { this.tracks = [], this.captionsTracks = {}; @@ -29172,7 +29240,7 @@ class $2 { frag: i, samples: s } = t; - if (!(i.type === J.MAIN && this.closedCaptionsForLevel(i) === "NONE")) + if (!(i.type === te.MAIN && this.closedCaptionsForLevel(i) === "NONE")) for (let r = 0; r < s.length; r++) { const a = s[r].bytes; if (a) { @@ -29196,13 +29264,13 @@ class $2 { const { captionsTracks: o } = this; - Object.keys(o).forEach((u) => yd(o[u], t, i)); + Object.keys(o).forEach((u) => Ud(o[u], t, i)); } if (this.config.renderTextTracksNatively && t === 0 && s !== void 0) { const { textTracks: o } = this; - Object.keys(o).forEach((u) => yd(o[u], t, s)); + Object.keys(o).forEach((u) => Ud(o[u], t, s)); } } } @@ -29221,16 +29289,16 @@ class $2 { return t; } } -function bE(n) { +function $E(n) { return n.characteristics && /transcribes-spoken-dialog/gi.test(n.characteristics) && /describes-music-and-sound/gi.test(n.characteristics) ? "captions" : "subtitles"; } -function E0(n, e) { - return !!n && n.kind === bE(e) && pd(e, n); +function $0(n, e) { + return !!n && n.kind === $E(e) && $d(e, n); } -function B2(n, e, t, i) { +function oF(n, e, t, i) { return Math.min(e, i) - Math.max(n, t); } -function b0() { +function B0() { return { ccOffset: 0, presentationOffset: 0, @@ -29241,7 +29309,7 @@ function b0() { } }; } -const N2 = /\s/, U2 = { +const lF = /\s/, uF = { newCue(n, e, t, i) { const s = []; let r, a, o, u, l; @@ -29250,15 +29318,15 @@ const N2 = /\s/, U2 = { if (r = i.rows[d], o = !0, u = 0, l = "", !r.isEmpty()) { var h; for (let g = 0; g < r.chars.length; g++) - N2.test(r.chars[g].uchar) && o ? u++ : (l += r.chars[g].uchar, o = !1); + lF.test(r.chars[g].uchar) && o ? u++ : (l += r.chars[g].uchar, o = !1); r.cueStartTime = e, e === t && (t += 1e-4), u >= 16 ? u-- : u++; - const f = _E(l.trim()), m = Lf(e, t, f); + const f = FE(l.trim()), m = Yf(e, t, f); n != null && (h = n.cues) != null && h.getCueById(m) || (a = new c(e, t, f), a.id = m, a.line = d + 1, a.align = "left", a.position = 10 + Math.min(80, Math.floor(u * 8 / 32) * 10), s.push(a)); } - return n && s.length && (s.sort((d, f) => d.line === "auto" || f.line === "auto" ? 0 : d.line > 8 && f.line > 8 ? f.line - d.line : d.line - f.line), s.forEach((d) => hE(n, d))), s; + return n && s.length && (s.sort((d, f) => d.line === "auto" || f.line === "auto" ? 0 : d.line > 8 && f.line > 8 ? f.line - d.line : d.line - f.line), s.forEach((d) => wE(n, d))), s; } }; -function G2() { +function cF() { if ( // @ts-ignore self.fetch && self.AbortController && self.ReadableStream && self.Request @@ -29269,10 +29337,10 @@ function G2() { } return !1; } -const H2 = /(\d+)-(\d+)\/(\d+)/; -class T0 { +const hF = /(\d+)-(\d+)\/(\d+)/; +class N0 { constructor(e) { - this.fetchSetup = void 0, this.requestTimeout = void 0, this.request = null, this.response = null, this.controller = void 0, this.context = null, this.config = null, this.callbacks = null, this.stats = void 0, this.loader = null, this.fetchSetup = e.fetchSetup || j2, this.controller = new self.AbortController(), this.stats = new lf(); + this.fetchSetup = void 0, this.requestTimeout = void 0, this.request = null, this.response = null, this.controller = void 0, this.context = null, this.config = null, this.callbacks = null, this.stats = void 0, this.loader = null, this.fetchSetup = e.fetchSetup || gF, this.controller = new self.AbortController(), this.stats = new If(); } destroy() { this.loader = this.callbacks = this.context = this.config = this.request = null, this.abortInternal(), this.response = null, this.fetchSetup = this.controller = this.stats = null; @@ -29289,13 +29357,13 @@ class T0 { if (s.loading.start) throw new Error("Loader can only be used once."); s.loading.start = self.performance.now(); - const r = V2(e, this.controller.signal), a = e.responseType === "arraybuffer", o = a ? "byteLength" : "length", { + const r = dF(e, this.controller.signal), a = e.responseType === "arraybuffer", o = a ? "byteLength" : "length", { maxTimeToFirstByteMs: u, maxLoadTimeMs: l } = t.loadPolicy; - this.context = e, this.config = t, this.callbacks = i, this.request = this.fetchSetup(e, r), self.clearTimeout(this.requestTimeout), t.timeout = u && Z(u) ? u : l, this.requestTimeout = self.setTimeout(() => { + this.context = e, this.config = t, this.callbacks = i, this.request = this.fetchSetup(e, r), self.clearTimeout(this.requestTimeout), t.timeout = u && J(u) ? u : l, this.requestTimeout = self.setTimeout(() => { this.callbacks && (this.abortInternal(), this.callbacks.onTimeout(s, e, this.response)); - }, t.timeout), (Ua(this.request) ? this.request.then(self.fetch) : self.fetch(this.request)).then((h) => { + }, t.timeout), (Za(this.request) ? this.request.then(self.fetch) : self.fetch(this.request)).then((h) => { var d; this.response = this.loader = h; const f = Math.max(self.performance.now(), s.loading.start); @@ -29306,11 +29374,11 @@ class T0 { status: g, statusText: p } = h; - throw new z2(p || "fetch, bad network response", g, h); + throw new pF(p || "fetch, bad network response", g, h); } - s.loading.first = f, s.total = K2(h.headers) || s.total; + s.loading.first = f, s.total = mF(h.headers) || s.total; const m = (d = this.callbacks) == null ? void 0 : d.onProgress; - return m && Z(t.highWaterMark) ? this.loadProgressively(h, s, e, t.highWaterMark, m) : a ? h.arrayBuffer() : e.responseType === "json" ? h.json() : h.text(); + return m && J(t.highWaterMark) ? this.loadProgressively(h, s, e, t.highWaterMark, m) : a ? h.arrayBuffer() : e.responseType === "json" ? h.json() : h.text(); }).then((h) => { var d, f; const m = this.response; @@ -29324,7 +29392,7 @@ class T0 { data: h, code: m.status }, y = (d = this.callbacks) == null ? void 0 : d.onProgress; - y && !Z(t.highWaterMark) && y(s, e, h, m), (f = this.callbacks) == null || f.onSuccess(p, s, e, m); + y && !J(t.highWaterMark) && y(s, e, h, m), (f = this.callbacks) == null || f.onSuccess(p, s, e, m); }).catch((h) => { var d; if (self.clearTimeout(this.requestTimeout), s.aborted) @@ -29348,7 +29416,7 @@ class T0 { return this.response ? this.response.headers.get(e) : null; } loadProgressively(e, t, i, s = 0, r) { - const a = new My(), o = e.body.getReader(), u = () => o.read().then((l) => { + const a = new Zy(), o = e.body.getReader(), u = () => o.read().then((l) => { if (l.done) return a.dataLength && r(t, i, a.flush().buffer, e), Promise.resolve(new ArrayBuffer(0)); const c = l.value, h = c.length; @@ -29357,44 +29425,44 @@ class T0 { return u(); } } -function V2(n, e) { +function dF(n, e) { const t = { method: "GET", mode: "cors", credentials: "same-origin", signal: e, - headers: new self.Headers(De({}, n.headers)) + headers: new self.Headers(we({}, n.headers)) }; return n.rangeEnd && t.headers.set("Range", "bytes=" + n.rangeStart + "-" + String(n.rangeEnd - 1)), t; } -function q2(n) { - const e = H2.exec(n); +function fF(n) { + const e = hF.exec(n); if (e) return parseInt(e[2]) - parseInt(e[1]) + 1; } -function K2(n) { +function mF(n) { const e = n.get("Content-Range"); if (e) { - const i = q2(e); - if (Z(i)) + const i = fF(e); + if (J(i)) return i; } const t = n.get("Content-Length"); if (t) return parseInt(t); } -function j2(n, e) { +function gF(n, e) { return new self.Request(n.url, e); } -class z2 extends Error { +class pF extends Error { constructor(e, t, i) { super(e), this.code = void 0, this.details = void 0, this.code = t, this.details = i; } } -const W2 = /^age:\s*[\d.]+\s*$/im; -class TE { +const _F = /^age:\s*[\d.]+\s*$/im; +class BE { constructor(e) { - this.xhrSetup = void 0, this.requestTimeout = void 0, this.retryTimeout = void 0, this.retryDelay = void 0, this.config = null, this.callbacks = null, this.context = null, this.loader = null, this.stats = void 0, this.xhrSetup = e && e.xhrSetup || null, this.stats = new lf(), this.retryDelay = 0; + this.xhrSetup = void 0, this.requestTimeout = void 0, this.retryTimeout = void 0, this.retryDelay = void 0, this.config = null, this.callbacks = null, this.context = null, this.loader = null, this.stats = void 0, this.xhrSetup = e && e.xhrSetup || null, this.stats = new If(), this.retryDelay = 0; } destroy() { this.callbacks = null, this.abortInternal(), this.loader = null, this.config = null, this.context = null, this.xhrSetup = null; @@ -29447,7 +29515,7 @@ class TE { if (s) for (const o in s) e.setRequestHeader(o, s[o]); - t.rangeEnd && e.setRequestHeader("Range", "bytes=" + t.rangeStart + "-" + (t.rangeEnd - 1)), e.onreadystatechange = this.readystatechange.bind(this), e.onprogress = this.loadprogress.bind(this), e.responseType = t.responseType, self.clearTimeout(this.requestTimeout), i.timeout = r && Z(r) ? r : a, this.requestTimeout = self.setTimeout(this.loadtimeout.bind(this), i.timeout), e.send(); + t.rangeEnd && e.setRequestHeader("Range", "bytes=" + t.rangeStart + "-" + (t.rangeEnd - 1)), e.onreadystatechange = this.readystatechange.bind(this), e.onprogress = this.loadprogress.bind(this), e.responseType = t.responseType, self.clearTimeout(this.requestTimeout), i.timeout = r && J(r) ? r : a, this.requestTimeout = self.setTimeout(this.loadtimeout.bind(this), i.timeout), e.send(); } readystatechange() { const { @@ -29484,11 +29552,11 @@ class TE { data: void 0, code: l }; - if (Hl(h, d, !1, f)) + if (au(h, d, !1, f)) this.retry(h); else { var u; - Ee.error(`${l} while loading ${e.url}`), (u = this.callbacks) == null || u.onError({ + Te.error(`${l} while loading ${e.url}`), (u = this.callbacks) == null || u.onError({ code: l, text: t.statusText }, e, t, i); @@ -29498,11 +29566,11 @@ class TE { loadtimeout() { if (!this.config) return; const e = this.config.loadPolicy.timeoutRetry, t = this.stats.retry; - if (Hl(e, t, !0)) + if (au(e, t, !0)) this.retry(e); else { var i; - Ee.warn(`timeout while loading ${(i = this.context) == null ? void 0 : i.url}`); + Te.warn(`timeout while loading ${(i = this.context) == null ? void 0 : i.url}`); const s = this.callbacks; s && (this.abortInternal(), s.onTimeout(this.stats, this.context, this.loader)); } @@ -29512,7 +29580,7 @@ class TE { context: t, stats: i } = this; - this.retryDelay = df(e, i.retry), i.retry++, Ee.warn(`${status ? "HTTP Status " + status : "Timeout"} while loading ${t == null ? void 0 : t.url}, retrying ${i.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`), this.abortInternal(), this.loader = null, self.clearTimeout(this.retryTimeout), this.retryTimeout = self.setTimeout(this.loadInternal.bind(this), this.retryDelay); + this.retryDelay = Ff(e, i.retry), i.retry++, Te.warn(`${status ? "HTTP Status " + status : "Timeout"} while loading ${t == null ? void 0 : t.url}, retrying ${i.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`), this.abortInternal(), this.loader = null, self.clearTimeout(this.retryTimeout), this.retryTimeout = self.setTimeout(this.loadInternal.bind(this), this.retryDelay); } loadprogress(e) { const t = this.stats; @@ -29520,7 +29588,7 @@ class TE { } getCacheAge() { let e = null; - if (this.loader && W2.test(this.loader.getAllResponseHeaders())) { + if (this.loader && _F.test(this.loader.getAllResponseHeaders())) { const t = this.loader.getResponseHeader("age"); e = t ? parseFloat(t) : null; } @@ -29530,12 +29598,12 @@ class TE { return this.loader && new RegExp(`^${e}:\\s*[\\d.]+\\s*$`, "im").test(this.loader.getAllResponseHeaders()) ? this.loader.getResponseHeader(e) : null; } } -const Y2 = { +const vF = { maxTimeToFirstByteMs: 8e3, maxLoadTimeMs: 2e4, timeoutRetry: null, errorRetry: null -}, X2 = Le(Le({ +}, yF = Ie(Ie({ autoStartLoad: !0, // used by stream-controller startPosition: -1, @@ -29618,7 +29686,7 @@ const Y2 = { appendErrorMaxRetry: 3, // used by buffer-controller ignorePlaylistParsingErrors: !1, - loader: TE, + loader: BE, // loader: FetchLoader, fLoader: void 0, // used by fragment-loader @@ -29630,11 +29698,11 @@ const Y2 = { // used by eme-controller licenseResponseCallback: void 0, // used by eme-controller - abrController: vk, - bufferController: oC, - capLevelController: xf, - errorController: Sk, - fpsController: JC, + abrController: Gk, + bufferController: kC, + capLevelController: jf, + errorController: jk, + fpsController: T2, stretchShortVideoTrack: !1, // used by mp4-remuxer maxAudioFramesDrift: 1, @@ -29673,7 +29741,7 @@ const Y2 = { // used by eme-controller drmSystemOptions: {}, // used by eme-controller - requestMediaKeySystemAccessFunc: Dy, + requestMediaKeySystemAccessFunc: Hy, // used by eme-controller requireKeySystemAccessOnStart: !1, // used by eme-controller @@ -29691,7 +29759,7 @@ const Y2 = { useMediaCapabilities: !0, preserveManualLevelOnError: !1, certLoadPolicy: { - default: Y2 + default: vF }, keyLoadPolicy: { default: { @@ -29805,20 +29873,20 @@ const Y2 = { fragLoadingMaxRetry: 6, fragLoadingRetryDelay: 1e3, fragLoadingMaxRetryTimeout: 64e3 -}, Q2()), {}, { - subtitleStreamController: h2, - subtitleTrackController: i2, - timelineController: $2, - audioStreamController: nC, - audioTrackController: sC, - emeController: mr, - cmcdController: XC, - contentSteeringController: ZC, - interstitialsController: c2 +}, EF()), {}, { + subtitleStreamController: P2, + subtitleTrackController: x2, + timelineController: aF, + audioStreamController: DC, + audioTrackController: wC, + emeController: Dr, + cmcdController: y2, + contentSteeringController: b2, + interstitialsController: F2 }); -function Q2() { +function EF() { return { - cueHandler: U2, + cueHandler: uF, // used by timeline-controller enableWebVTT: !0, // used by timeline-controller @@ -29845,14 +29913,14 @@ function Q2() { renderTextTracksNatively: !0 }; } -function Z2(n, e, t) { +function bF(n, e, t) { if ((e.liveSyncDurationCount || e.liveMaxLatencyDurationCount) && (e.liveSyncDuration || e.liveMaxLatencyDuration)) throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration"); if (e.liveMaxLatencyDurationCount !== void 0 && (e.liveSyncDurationCount === void 0 || e.liveMaxLatencyDurationCount <= e.liveSyncDurationCount)) throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"'); if (e.liveMaxLatencyDuration !== void 0 && (e.liveSyncDuration === void 0 || e.liveMaxLatencyDuration <= e.liveSyncDuration)) throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"'); - const i = bd(n), s = ["manifest", "level", "frag"], r = ["TimeOut", "MaxRetry", "RetryDelay", "MaxRetryTimeout"]; + const i = Hd(n), s = ["manifest", "level", "frag"], r = ["TimeOut", "MaxRetry", "RetryDelay", "MaxRetryTimeout"]; return s.forEach((a) => { const o = `${a === "level" ? "playlist" : a}LoadPolicy`, u = e[o] === void 0, l = []; r.forEach((c) => { @@ -29877,18 +29945,18 @@ function Z2(n, e, t) { break; } } - }), l.length && t.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${o}": ${Oe(e[o])}`); - }), Le(Le({}, i), e); + }), l.length && t.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${o}": ${$e(e[o])}`); + }), Ie(Ie({}, i), e); } -function bd(n) { - return n && typeof n == "object" ? Array.isArray(n) ? n.map(bd) : Object.keys(n).reduce((e, t) => (e[t] = bd(n[t]), e), {}) : n; +function Hd(n) { + return n && typeof n == "object" ? Array.isArray(n) ? n.map(Hd) : Object.keys(n).reduce((e, t) => (e[t] = Hd(n[t]), e), {}) : n; } -function J2(n, e) { +function TF(n, e) { const t = n.loader; - t !== T0 && t !== TE ? (e.log("[config]: Custom loader detected, cannot enable progressive streaming"), n.progressive = !1) : G2() && (n.loader = T0, n.progressive = !0, n.enableSoftwareAES = !0, e.log("[config]: Progressive streaming enabled, using FetchLoader")); + t !== N0 && t !== BE ? (e.log("[config]: Custom loader detected, cannot enable progressive streaming"), n.progressive = !1) : cF() && (n.loader = N0, n.progressive = !0, n.enableSoftwareAES = !0, e.log("[config]: Progressive streaming enabled, using FetchLoader")); } -const Tl = 2, eF = 0.1, tF = 0.05, iF = 100; -class nF extends Ty { +const Gl = 2, SF = 0.1, AF = 0.05, xF = 100; +class DF extends By { constructor(e, t) { super("gap-controller", e.logger), this.hls = null, this.fragmentTracker = null, this.media = null, this.mediaSource = void 0, this.nudgeRetry = 0, this.stallReported = !1, this.stalled = null, this.moved = !1, this.seeking = !1, this.buffered = {}, this.lastCurrentTime = 0, this.ended = 0, this.waiting = 0, this.onMediaPlaying = () => { this.ended = 0, this.waiting = 0; @@ -29920,16 +29988,16 @@ class nF extends Ty { super.destroy(), this.unregisterListeners(), this.media = this.hls = this.fragmentTracker = null, this.mediaSource = void 0; } onMediaAttached(e, t) { - this.setInterval(iF), this.mediaSource = t.mediaSource; + this.setInterval(xF), this.mediaSource = t.mediaSource; const i = this.media = t.media; - ti(i, "playing", this.onMediaPlaying), ti(i, "waiting", this.onMediaWaiting), ti(i, "ended", this.onMediaEnded); + ri(i, "playing", this.onMediaPlaying), ri(i, "waiting", this.onMediaWaiting), ri(i, "ended", this.onMediaEnded); } onMediaDetaching(e, t) { this.clearInterval(); const { media: i } = this; - i && (Di(i, "playing", this.onMediaPlaying), Di(i, "waiting", this.onMediaWaiting), Di(i, "ended", this.onMediaEnded), this.media = null), this.mediaSource = void 0; + i && (Mi(i, "playing", this.onMediaPlaying), Mi(i, "waiting", this.onMediaWaiting), Mi(i, "ended", this.onMediaEnded), this.media = null), this.mediaSource = void 0; } onBufferAppended(e, t) { this.buffered = t.timeRanges; @@ -29975,13 +30043,13 @@ class nF extends Ty { })); return; } - if (!le.getBuffered(a).length) { + if (!ue.getBuffered(a).length) { this.nudgeRetry = 0; return; } - const h = le.bufferInfo(a, e, 0), d = h.nextStart || 0, f = this.fragmentTracker; + const h = ue.bufferInfo(a, e, 0), d = h.nextStart || 0, f = this.fragmentTracker; if (o && f && this.hls) { - const A = S0(this.hls.inFlightFragments, e), S = h.len > Tl, D = !d || A || d - e > Tl && !f.getPartialFragment(e); + const x = U0(this.hls.inFlightFragments, e), S = h.len > Gl, D = !d || x || d - e > Gl && !f.getPartialFragment(e); if (S || D) return; this.moved = !1; @@ -29990,8 +30058,8 @@ class nF extends Ty { if (!this.moved && this.stalled !== null && f) { if (!(h.len > 0) && !d) return; - const S = Math.max(d, h.start || 0) - e, x = !!(m != null && m.live) ? m.targetduration * 2 : Tl, w = f.getPartialFragment(e); - if (S > 0 && (S <= x || w)) { + const S = Math.max(d, h.start || 0) - e, A = !!(m != null && m.live) ? m.targetduration * 2 : Gl, w = f.getPartialFragment(e); + if (S > 0 && (S <= A || w)) { a.paused || this._trySkipBufferHole(w); return; } @@ -30019,7 +30087,7 @@ class nF extends Ty { if (this._reportStall(h), !this.media || !this.hls) return; } - const T = le.bufferInfo(a, e, r.maxBufferHole); + const T = ue.bufferInfo(a, e, r.maxBufferHole); this._tryFixBufferStall(T, _, e); } stallResolved(e) { @@ -30033,19 +30101,19 @@ class nF extends Ty { var i; const s = this.buffered.video; if (this.hls && this.media && this.fragmentTracker && (i = this.buffered.audio) != null && i.length && s && s.length > 1 && e > s.end(0)) { - const r = le.bufferedInfo(le.timeRangesToArray(this.buffered.audio), e, 0); + const r = ue.bufferedInfo(ue.timeRangesToArray(this.buffered.audio), e, 0); if (r.len > 1 && t >= r.start) { - const a = le.timeRangesToArray(s), o = le.bufferedInfo(a, t, 0).bufferedIndex; + const a = ue.timeRangesToArray(s), o = ue.bufferedInfo(a, t, 0).bufferedIndex; if (o > -1 && o < a.length - 1) { - const u = le.bufferedInfo(a, e, 0).bufferedIndex, l = a[o].end, c = a[o + 1].start; + const u = ue.bufferedInfo(a, e, 0).bufferedIndex, l = a[o].end, c = a[o + 1].start; if ((u === -1 || u > o) && c - l < 1 && // `maxBufferHole` may be too small and setting it to 0 should not disable this feature e - l < 2) { const h = new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${l} -> ${c} buffered index: ${u}`); this.warn(h.message), this.media.currentTime += 1e-6; - const d = this.fragmentTracker.getPartialFragment(e) || void 0, f = le.bufferInfo(this.media, e, 0); + const d = this.fragmentTracker.getPartialFragment(e) || void 0, f = ue.bufferInfo(this.media, e, 0); this.hls.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.BUFFER_SEEK_OVER_HOLE, + type: ne.MEDIA_ERROR, + details: P.BUFFER_SEEK_OVER_HOLE, fatal: !1, error: h, reason: h.message, @@ -30081,7 +30149,7 @@ class nF extends Ty { adjacentTraversal(e, t) { const i = this.fragmentTracker, s = e.nextStart; if (i && s) { - const r = i.getFragAtPos(t, J.MAIN), a = i.getFragAtPos(s, J.MAIN); + const r = i.getFragAtPos(t, te.MAIN), a = i.getFragAtPos(s, te.MAIN); if (r && a) return a.sn - r.sn < 2; } @@ -30101,10 +30169,10 @@ class nF extends Ty { } = this; if (!s && r !== null && i && t) { this.stallReported = !0; - const a = new Error(`Playback stalling at @${i.currentTime} due to low buffer (${Oe(e)})`); + const a = new Error(`Playback stalling at @${i.currentTime} due to low buffer (${$e(e)})`); this.warn(a.message), t.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.BUFFER_STALLED_ERROR, + type: ne.MEDIA_ERROR, + details: P.BUFFER_STALLED_ERROR, fatal: !1, error: a, buffer: e.len, @@ -30128,25 +30196,25 @@ class nF extends Ty { } = this, r = (t = this.hls) == null ? void 0 : t.config; if (!s || !i || !r) return 0; - const a = s.currentTime, o = le.bufferInfo(s, a, 0), u = a < o.start ? o.start : o.nextStart; + const a = s.currentTime, o = ue.bufferInfo(s, a, 0), u = a < o.start ? o.start : o.nextStart; if (u && this.hls) { const c = o.len <= r.maxBufferHole, h = o.len > 0 && o.len < 1 && s.readyState < 3, d = u - a; if (d > 0 && (c || h)) { if (d > r.maxBufferHole) { let m = !1; if (a === 0) { - const g = i.getAppendedFrag(0, J.MAIN); + const g = i.getAppendedFrag(0, te.MAIN); g && u < g.end && (m = !0); } if (!m) { - const g = e || i.getAppendedFrag(a, J.MAIN); + const g = e || i.getAppendedFrag(a, te.MAIN); if (g) { var l; - if (!((l = this.hls.loadLevelObj) != null && l.details) || S0(this.hls.inFlightFragments, u)) + if (!((l = this.hls.loadLevelObj) != null && l.details) || U0(this.hls.inFlightFragments, u)) return 0; let y = !1, v = g.end; for (; v < u; ) { - const _ = i.getAppendedFrag(v, J.MAIN) || i.getPartialFragment(v); + const _ = i.getAppendedFrag(v, te.MAIN) || i.getPartialFragment(v); if (_) v += _.duration; else { @@ -30159,12 +30227,12 @@ class nF extends Ty { } } } - const f = Math.max(u + tF, a + eF); + const f = Math.max(u + AF, a + SF); if (this.warn(`skipping hole, adjusting currentTime from ${a} to ${f}`), this.moved = !0, s.currentTime = f, !(e != null && e.gap)) { const m = new Error(`fragment loaded with buffer holes, seeking from ${a} to ${f}`); this.hls.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.BUFFER_SEEK_OVER_HOLE, + type: ne.MEDIA_ERROR, + details: P.BUFFER_SEEK_OVER_HOLE, fatal: !1, error: m, reason: m.message, @@ -30194,8 +30262,8 @@ class nF extends Ty { if (this.nudgeRetry++, s < r.nudgeMaxRetry) { const o = a + (s + 1) * r.nudgeOffset, u = new Error(`Nudging 'currentTime' from ${a} to ${o}`); this.warn(u.message), i.currentTime = o, t.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.BUFFER_NUDGE_ON_STALL, + type: ne.MEDIA_ERROR, + details: P.BUFFER_NUDGE_ON_STALL, error: u, fatal: !1, buffer: e.len, @@ -30204,8 +30272,8 @@ class nF extends Ty { } else { const o = new Error(`Playhead still not moving while enough data buffered @${a} after ${r.nudgeMaxRetry} nudges`); this.error(o.message), t.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.BUFFER_STALLED_ERROR, + type: ne.MEDIA_ERROR, + details: P.BUFFER_STALLED_ERROR, error: o, fatal: !0, buffer: e.len, @@ -30214,14 +30282,14 @@ class nF extends Ty { } } } -function S0(n, e) { - const t = A0(n.main); +function U0(n, e) { + const t = G0(n.main); if (t && t.start <= e) return t; - const i = A0(n.audio); + const i = G0(n.audio); return i && i.start <= e ? i : null; } -function A0(n) { +function G0(n) { if (!n) return null; switch (n.state) { @@ -30233,24 +30301,24 @@ function A0(n) { } return n.frag; } -const sF = 0.25; -function Td() { +const wF = 0.25; +function Vd() { if (!(typeof self > "u")) return self.VTTCue || self.TextTrackCue; } -function x0(n, e, t, i, s) { +function H0(n, e, t, i, s) { let r = new n(e, t, ""); try { r.value = i, s && (r.type = s); } catch { - r = new n(e, t, Oe(s ? Le({ + r = new n(e, t, $e(s ? Ie({ type: s }, i) : i)); } return r; } -const Qo = (() => { - const n = Td(); +const pl = (() => { + const n = Vd(); try { n && new n(0, Number.POSITIVE_INFINITY, ""); } catch { @@ -30258,7 +30326,7 @@ const Qo = (() => { } return Number.POSITIVE_INFINITY; })(); -class rF { +class LF { constructor(e) { this.hls = void 0, this.id3Track = null, this.media = null, this.dateRangeCuesAppended = {}, this.removeCues = !0, this.onEventCueEnter = () => { this.hls && this.hls.trigger(b.EVENT_CUE_ENTER, {}); @@ -30289,7 +30357,7 @@ class rF { e && this.updateDateRangeCues(e); } onMediaDetaching(e, t) { - this.media = null, !t.transferMedia && (this.id3Track && (this.removeCues && ar(this.id3Track, this.onEventCueEnter), this.id3Track = null), this.dateRangeCuesAppended = {}); + this.media = null, !t.transferMedia && (this.id3Track && (this.removeCues && vr(this.id3Track, this.onEventCueEnter), this.id3Track = null), this.dateRangeCuesAppended = {}); } onManifestLoading() { this.dateRangeCuesAppended = {}; @@ -30303,7 +30371,7 @@ class rF { for (let t = 0; t < e.length; t++) { const i = e[t]; if (i.kind === "metadata" && i.label === "id3") - return cE(i, this.media), i; + return DE(i, this.media), i; } return this.media.addTextTrack("metadata", "id3"); } @@ -30325,22 +30393,22 @@ class rF { samples: r } = t; this.id3Track || (this.id3Track = this.createTrack(this.media)); - const a = Td(); + const a = Vd(); if (a) for (let o = 0; o < r.length; o++) { const u = r[o].type; - if (u === Ht.emsg && !i || !s) + if (u === Wt.emsg && !i || !s) continue; - const l = Vy(r[o].data); + const l = rE(r[o].data); if (l) { const c = r[o].pts; let h = c + r[o].duration; - h > Qo && (h = Qo), h - c <= 0 && (h = c + sF); + h > pl && (h = pl), h - c <= 0 && (h = c + wF); for (let f = 0; f < l.length; f++) { const m = l[f]; - if (!qy(m)) { + if (!aE(m)) { this.updateId3CueEnds(c, u); - const g = x0(a, c, h, m, u); + const g = H0(a, c, h, m, u); g && this.id3Track.addCue(g); } } @@ -30353,7 +30421,7 @@ class rF { if (s) for (let r = s.length; r--; ) { const a = s[r]; - a.type === t && a.startTime < e && a.endTime === Qo && (a.endTime = e); + a.type === t && a.startTime < e && a.endTime === pl && (a.endTime = e); } } onBufferFlushing(e, { @@ -30375,7 +30443,7 @@ class rF { } = a; if (r && (o || u)) { let l; - s === "audio" ? l = (c) => c.type === Ht.audioId3 && u : s === "video" ? l = (c) => c.type === Ht.emsg && o : l = (c) => c.type === Ht.audioId3 && u || c.type === Ht.emsg && o, yd(r, t, i, l); + s === "audio" ? l = (c) => c.type === Wt.audioId3 && u : s === "video" ? l = (c) => c.type === Wt.emsg && o : l = (c) => c.type === Wt.audioId3 && u || c.type === Wt.emsg && o, Ud(r, t, i, l); } } onLevelUpdated(e, { @@ -30413,13 +30481,13 @@ class rF { a = this.dateRangeCuesAppended = {}; } const u = e.fragments[e.fragments.length - 1]; - if (r.length === 0 || !Z(u == null ? void 0 : u.programDateTime)) + if (r.length === 0 || !J(u == null ? void 0 : u.programDateTime)) return; this.id3Track || (this.id3Track = this.createTrack(this.media)); - const l = Td(); + const l = Vd(); for (let c = 0; c < r.length; c++) { const h = r[c], d = s[h], f = d.startTime, m = a[h], g = (m == null ? void 0 : m.cues) || {}; - let p = (m == null ? void 0 : m.durationKnown) || !1, y = Qo; + let p = (m == null ? void 0 : m.durationKnown) || !1, y = pl; const { duration: v, endDate: _ @@ -30427,32 +30495,32 @@ class rF { if (_ && v !== null) y = f + v, p = !0; else if (d.endOnNext && !p) { - const T = r.reduce((A, S) => { + const T = r.reduce((x, S) => { if (S !== d.id) { const D = s[S]; - if (D.class === d.class && D.startDate > d.startDate && (!A || d.startDate < A.startDate)) + if (D.class === d.class && D.startDate > d.startDate && (!x || d.startDate < x.startDate)) return D; } - return A; + return x; }, null); T && (y = T.startTime, p = !0); } const E = Object.keys(d.attr); for (let T = 0; T < E.length; T++) { - const A = E[T]; - if (!Mk(A)) + const x = E[T]; + if (!rR(x)) continue; - const S = g[A]; + const S = g[x]; if (S) p && !m.durationKnown ? S.endTime = y : Math.abs(S.startTime - f) > 0.01 && (S.startTime = f, S.endTime = y); else if (l) { - let D = d.attr[A]; - $k(A) && (D = ay(D)); - const w = x0(l, f, y, { - key: A, + let D = d.attr[x]; + aR(x) && (D = Ty(D)); + const w = H0(l, f, y, { + key: x, data: D - }, Ht.dateRange); - w && (w.id = h, this.id3Track.addCue(w), g[A] = w, this.hls.config.interstitialsController && (A === "X-ASSET-LIST" || A === "X-ASSET-URL") && w.addEventListener("enter", this.onEventCueEnter)); + }, Wt.dateRange); + w && (w.id = h, this.id3Track.addCue(w), g[x] = w, this.hls.config.interstitialsController && (x === "X-ASSET-LIST" || x === "X-ASSET-URL") && w.addEventListener("enter", this.onEventCueEnter)); } } a[h] = { @@ -30463,7 +30531,7 @@ class rF { } } } -class aF { +class IF { constructor(e) { this.hls = void 0, this.config = void 0, this.media = null, this.currentTime = 0, this.stallCount = 0, this._latency = null, this._targetLatencyUpdated = !1, this.onTimeupdate = () => { const { @@ -30590,7 +30658,7 @@ class aF { } onError(e, t) { var i; - t.details === O.BUFFER_STALLED_ERROR && (this.stallCount++, this.hls && (i = this.levelDetails) != null && i.live && this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency")); + t.details === P.BUFFER_STALLED_ERROR && (this.stallCount++, this.hls && (i = this.levelDetails) != null && i.live && this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency")); } changeMediaPlaybackRate(e, t) { var i, s; @@ -30605,7 +30673,7 @@ class aF { return e === null ? null : e - this.currentTime; } } -class oF extends Af { +class kF extends Kf { constructor(e, t) { super(e, "level-controller"), this._levels = [], this._firstLevel = -1, this._maxAutoLevel = -1, this._startLevel = void 0, this.currentLevel = null, this.currentLevelIndex = -1, this.manualLevelIndex = -1, this.steering = void 0, this.onParsedComplete = void 0, this.steering = t, this._registerListeners(); } @@ -30644,7 +30712,7 @@ class oF extends Af { audioCodec: d, videoCodec: f } = c; - d && (c.audioCodec = d = Bl(d, i) || void 0), f && (f = c.videoCodec = tk(f)); + d && (c.audioCodec = d = iu(d, i) || void 0), f && (f = c.videoCodec = Ak(f)); const { width: m, height: g, @@ -30654,7 +30722,7 @@ class oF extends Af { if (p) for (let w = y; w--; ) { const I = p[w]; - this.isAudioSupported(I) ? (c.audioCodec = d = d ? `${d},${I}` : I, y--, Tr.audio[d.substring(0, 4)] = 2) : this.isVideoSupported(I) && (c.videoCodec = f = f ? `${f},${I}` : I, y--, Tr.video[f.substring(0, 4)] = 2); + this.isAudioSupported(I) ? (c.audioCodec = d = d ? `${d},${I}` : I, y--, Rr.audio[d.substring(0, 4)] = 2) : this.isVideoSupported(I) && (c.videoCodec = f = f ? `${f},${I}` : I, y--, Rr.video[f.substring(0, 4)] = 2); } if (o || (o = !!(m && g)), u || (u = !!f), l || (l = !!d), y || d && !this.isAudioSupported(d) || f && !this.isVideoSupported(f)) { this.log(`Some or all CODECS not supported "${h.CODECS}"`); @@ -30665,36 +30733,36 @@ class oF extends Af { "FRAME-RATE": _, "HDCP-LEVEL": E, "PATHWAY-ID": T, - RESOLUTION: A, + RESOLUTION: x, "VIDEO-RANGE": S - } = h, x = `${`${T || "."}-`}${c.bitrate}-${A}-${_}-${v}-${S}-${E}`; - if (r[x]) - if (r[x].uri !== c.url && !c.attrs["PATHWAY-ID"]) { - const w = a[x] += 1; + } = h, A = `${`${T || "."}-`}${c.bitrate}-${x}-${_}-${v}-${S}-${E}`; + if (r[A]) + if (r[A].uri !== c.url && !c.attrs["PATHWAY-ID"]) { + const w = a[A] += 1; c.attrs["PATHWAY-ID"] = new Array(w + 1).join("."); const I = this.createLevel(c); - r[x] = I, s.push(I); + r[A] = I, s.push(I); } else - r[x].addGroupId("audio", h.AUDIO), r[x].addGroupId("text", h.SUBTITLES); + r[A].addGroupId("audio", h.AUDIO), r[A].addGroupId("text", h.SUBTITLES); else { const w = this.createLevel(c); - r[x] = w, a[x] = 1, s.push(w); + r[A] = w, a[A] = 1, s.push(w); } }), this.filterAndSortMediaOptions(s, t, o, u, l); } createLevel(e) { - const t = new Ma(e), i = e.supplemental; + const t = new Wa(e), i = e.supplemental; if (i != null && i.videoCodec && !this.isVideoSupported(i.videoCodec)) { const s = new Error(`SUPPLEMENTAL-CODECS not supported "${i.videoCodec}"`); - this.log(s.message), t.supportedResult = py(s, []); + this.log(s.message), t.supportedResult = Cy(s, []); } return t; } isAudioSupported(e) { - return ad(e, "audio", this.hls.config.preferManagedMediaSource); + return wd(e, "audio", this.hls.config.preferManagedMediaSource); } isVideoSupported(e) { - return ad(e, "video", this.hls.config.preferManagedMediaSource); + return wd(e, "video", this.hls.config.preferManagedMediaSource); } filterAndSortMediaOptions(e, t, i, s, r) { let a = [], o = [], u = e; @@ -30703,15 +30771,15 @@ class oF extends Af { videoRange: y, width: v, height: _ - }) => (!!p || !!(v && _)) && uk(y))), u.length === 0) { + }) => (!!p || !!(v && _)) && Ck(y))), u.length === 0) { Promise.resolve().then(() => { if (this.hls) { let p = "no level with compatible codecs found in manifest", y = p; - t.levels.length && (y = `one or more CODECS in variant not supported: ${Oe(t.levels.map((_) => _.attrs.CODECS).filter((_, E, T) => T.indexOf(_) === E))}`, this.warn(y), p += ` (${y})`); + t.levels.length && (y = `one or more CODECS in variant not supported: ${$e(t.levels.map((_) => _.attrs.CODECS).filter((_, E, T) => T.indexOf(_) === E))}`, this.warn(y), p += ` (${y})`); const v = new Error(p); this.hls.trigger(b.ERROR, { - type: ie.MEDIA_ERROR, - details: O.MANIFEST_INCOMPATIBLE_CODECS_ERROR, + type: ne.MEDIA_ERROR, + details: P.MANIFEST_INCOMPATIBLE_CODECS_ERROR, fatal: !0, url: t.url, error: v, @@ -30721,7 +30789,7 @@ class oF extends Af { }); return; } - t.audioTracks && (a = t.audioTracks.filter((p) => !p.audioCodec || this.isAudioSupported(p.audioCodec)), D0(a)), t.subtitles && (o = t.subtitles, D0(o)); + t.audioTracks && (a = t.audioTracks.filter((p) => !p.audioCodec || this.isAudioSupported(p.audioCodec)), V0(a)), t.subtitles && (o = t.subtitles, V0(o)); const l = u.slice(0); u.sort((p, y) => { if (p.attrs["HDCP-LEVEL"] !== y.attrs["HDCP-LEVEL"]) @@ -30731,14 +30799,14 @@ class oF extends Af { if (p.frameRate !== y.frameRate) return p.frameRate - y.frameRate; if (p.videoRange !== y.videoRange) - return Nl.indexOf(p.videoRange) - Nl.indexOf(y.videoRange); + return nu.indexOf(p.videoRange) - nu.indexOf(y.videoRange); if (p.videoCodec !== y.videoCodec) { - const v = vp(p.videoCodec), _ = vp(y.videoCodec); + const v = Op(p.videoCodec), _ = Op(y.videoCodec); if (v !== _) return _ - v; } if (p.uri === y.uri && p.codecSet !== y.codecSet) { - const v = $l(p.codecSet), _ = $l(y.codecSet); + const v = tu(p.codecSet), _ = tu(y.codecSet); if (v !== _) return _ - v; } @@ -30794,8 +30862,8 @@ class oF extends Af { if (e < 0 || e >= t.length) { const c = new Error("invalid level idx"), h = e < 0; if (this.hls.trigger(b.ERROR, { - type: ie.OTHER_ERROR, - details: O.LEVEL_SWITCH_ERROR, + type: ne.OTHER_ERROR, + details: P.LEVEL_SWITCH_ERROR, level: e, fatal: h, error: c, @@ -30886,7 +30954,7 @@ class oF extends Af { onFragBuffered(e, { frag: t }) { - if (t !== void 0 && t.type === J.MAIN) { + if (t !== void 0 && t.type === te.MAIN) { const i = t.elementaryStreams; if (!Object.keys(i).some((r) => !!i[r])) return; @@ -30938,7 +31006,7 @@ class oF extends Af { if (this._levels.length === 1) return; const i = this._levels.filter((r, a) => a !== e ? !0 : (this.steering && this.steering.removeLevel(r), r === this.currentLevel && (this.currentLevel = null, this.currentLevelIndex = -1, r.details && r.details.fragments.forEach((o) => o.level = -1)), !1)); - Fy(i), this._levels = i, this.currentLevelIndex > -1 && (t = this.currentLevel) != null && t.details && (this.currentLevelIndex = this.currentLevel.details.fragments[0].level), this.manualLevelIndex > -1 && (this.manualLevelIndex = this.currentLevelIndex); + Yy(i), this._levels = i, this.currentLevelIndex > -1 && (t = this.currentLevel) != null && t.details && (this.currentLevelIndex = this.currentLevel.details.fragments[0].level), this.manualLevelIndex > -1 && (this.manualLevelIndex = this.currentLevelIndex); const s = i.length - 1; this._firstLevel = Math.min(this._firstLevel, s), this._startLevel && (this._startLevel = Math.min(this._startLevel, s)), this.hls.trigger(b.LEVELS_UPDATED, { levels: i @@ -30964,43 +31032,43 @@ class oF extends Af { })); } } -function D0(n) { +function V0(n) { const e = {}; n.forEach((t) => { const i = t.groupId || ""; t.id = e[i] = e[i] || 0, e[i]++; }); } -function SE() { +function NE() { return self.SourceBuffer || self.WebKitSourceBuffer; } -function AE() { - if (!Qn()) +function UE() { + if (!ns()) return !1; - const e = SE(); + const e = NE(); return !e || e.prototype && typeof e.prototype.appendBuffer == "function" && typeof e.prototype.remove == "function"; } -function lF() { - if (!AE()) +function RF() { + if (!UE()) return !1; - const n = Qn(); - return typeof (n == null ? void 0 : n.isTypeSupported) == "function" && (["avc1.42E01E,mp4a.40.2", "av01.0.01M.08", "vp09.00.50.08"].some((e) => n.isTypeSupported(Oa(e, "video"))) || ["mp4a.40.2", "fLaC"].some((e) => n.isTypeSupported(Oa(e, "audio")))); + const n = ns(); + return typeof (n == null ? void 0 : n.isTypeSupported) == "function" && (["avc1.42E01E,mp4a.40.2", "av01.0.01M.08", "vp09.00.50.08"].some((e) => n.isTypeSupported(za(e, "video"))) || ["mp4a.40.2", "fLaC"].some((e) => n.isTypeSupported(za(e, "audio")))); } -function uF() { +function CF() { var n; - const e = SE(); + const e = NE(); return typeof (e == null || (n = e.prototype) == null ? void 0 : n.changeType) == "function"; } -const cF = 100; -class hF extends pf { +const FF = 100; +class PF extends $f { constructor(e, t, i) { - super(e, t, i, "stream-controller", J.MAIN), this.audioCodecSwap = !1, this.level = -1, this._forceStartLoad = !1, this._hasEnoughToStart = !1, this.altAudio = 0, this.audioOnly = !1, this.fragPlaying = null, this.fragLastKbps = 0, this.couldBacktrack = !1, this.backtrackFragment = null, this.audioCodecSwitch = !1, this.videoBuffer = null, this.onMediaPlaying = () => { + super(e, t, i, "stream-controller", te.MAIN), this.audioCodecSwap = !1, this.level = -1, this._forceStartLoad = !1, this._hasEnoughToStart = !1, this.altAudio = 0, this.audioOnly = !1, this.fragPlaying = null, this.fragLastKbps = 0, this.couldBacktrack = !1, this.backtrackFragment = null, this.audioCodecSwitch = !1, this.videoBuffer = null, this.onMediaPlaying = () => { this.tick(); }, this.onMediaSeeked = () => { const s = this.media, r = s ? s.currentTime : null; - if (r === null || !Z(r) || (this.log(`Media seeked to ${r.toFixed(3)}`), !this.getBufferedFrag(r))) + if (r === null || !J(r) || (this.log(`Media seeked to ${r.toFixed(3)}`), !this.getBufferedFrag(r))) return; - const a = this.getFwdBufferInfoAtPos(s, r, J.MAIN, 0); + const a = this.getFwdBufferInfoAtPos(s, r, te.MAIN, 0); if (a === null || a.len === 0) { this.warn(`Main forward buffer length at ${r} on "seeked" event ${a ? a.len : "empty"})`); return; @@ -31031,7 +31099,7 @@ class hF extends pf { lastCurrentTime: i, hls: s } = this; - if (this.stopLoad(), this.setInterval(cF), this.level = -1, !this.startFragRequested) { + if (this.stopLoad(), this.setInterval(FF), this.level = -1, !this.startFragRequested) { let r = s.startLevel; r === -1 && (s.config.testBandwidth && this.levels.length > 1 ? (r = 0, this.bitrateTest = !0) : r = s.firstAutoLevel), s.nextLoadLevel = r, this.level = s.loadLevel, this._hasEnoughToStart = !!t; } @@ -31115,26 +31183,26 @@ class hF extends pf { this.backtrackFragment && this.backtrackFragment.start > o.end && (this.backtrackFragment = null); const d = this.backtrackFragment ? this.backtrackFragment.start : o.end; let f = this.getNextFragment(d, l); - if (this.couldBacktrack && !this.fragPrevious && f && Ye(f) && this.fragmentTracker.getState(f) !== Ze.OK) { + if (this.couldBacktrack && !this.fragPrevious && f && Ze(f) && this.fragmentTracker.getState(f) !== nt.OK) { var m; const p = ((m = this.backtrackFragment) != null ? m : f).sn - l.startSN, y = l.fragments[p - 1]; y && f.cc === y.cc && (f = y, this.fragmentTracker.removeFragment(y)); } else this.backtrackFragment && o.len && (this.backtrackFragment = null); if (f && this.isLoopLoading(f, d)) { if (!f.gap) { - const p = this.audioOnly && !this.altAudio ? Fe.AUDIO : Fe.VIDEO, y = (p === Fe.VIDEO ? this.videoBuffer : this.mediaBuffer) || this.media; - y && this.afterBufferFlushed(y, p, J.MAIN); + const p = this.audioOnly && !this.altAudio ? Pe.AUDIO : Pe.VIDEO, y = (p === Pe.VIDEO ? this.videoBuffer : this.mediaBuffer) || this.media; + y && this.afterBufferFlushed(y, p, te.MAIN); } - f = this.getNextFragmentLoopLoading(f, l, o, J.MAIN, h); + f = this.getNextFragmentLoopLoading(f, l, o, te.MAIN, h); } f && (f.initSegment && !f.initSegment.data && !this.bitrateTest && (f = f.initSegment), this.loadFragment(f, a, d)); } loadFragment(e, t, i) { const s = this.fragmentTracker.getState(e); - s === Ze.NOT_LOADED || s === Ze.PARTIAL ? Ye(e) ? this.bitrateTest ? (this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`), this._loadBitrateTestFrag(e, t)) : super.loadFragment(e, t, i) : this._loadInitSegment(e, t) : this.clearTrackerIfNeeded(e); + s === nt.NOT_LOADED || s === nt.PARTIAL ? Ze(e) ? this.bitrateTest ? (this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`), this._loadBitrateTestFrag(e, t)) : super.loadFragment(e, t, i) : this._loadInitSegment(e, t) : this.clearTrackerIfNeeded(e); } getBufferedFrag(e) { - return this.fragmentTracker.getBufferedFrag(e, J.MAIN); + return this.fragmentTracker.getBufferedFrag(e, te.MAIN); } followingBufferedFrag(e) { return e ? this.getBufferedFrag(e.end + 0.5) : null; @@ -31204,13 +31272,13 @@ class hF extends pf { onMediaAttached(e, t) { super.onMediaAttached(e, t); const i = t.media; - ti(i, "playing", this.onMediaPlaying), ti(i, "seeked", this.onMediaSeeked); + ri(i, "playing", this.onMediaPlaying), ri(i, "seeked", this.onMediaSeeked); } onMediaDetaching(e, t) { const { media: i } = this; - i && (Di(i, "playing", this.onMediaPlaying), Di(i, "seeked", this.onMediaSeeked)), this.videoBuffer = null, this.fragPlaying = null, super.onMediaDetaching(e, t), !t.transferMedia && (this._hasEnoughToStart = !1); + i && (Mi(i, "playing", this.onMediaPlaying), Mi(i, "seeked", this.onMediaSeeked)), this.videoBuffer = null, this.fragPlaying = null, super.onMediaDetaching(e, t), !t.transferMedia && (this._hasEnoughToStart = !1); } onManifestLoading() { super.onManifestLoading(), this.log("Trigger BUFFER_RESET"), this.hls.trigger(b.BUFFER_RESET, void 0), this.couldBacktrack = !1, this.fragLastKbps = 0, this.fragPlaying = this.backtrackFragment = null, this.altAudio = 0, this.audioOnly = !1; @@ -31220,7 +31288,7 @@ class hF extends pf { t.levels.forEach((r) => { const a = r.audioCodec; a && (i = i || a.indexOf("mp4a.40.2") !== -1, s = s || a.indexOf("mp4a.40.5") !== -1); - }), this.audioCodecSwitch = i && s && !uF(), this.audioCodecSwitch && this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"), this.levels = t.levels, this.startFragRequested = !1; + }), this.audioCodecSwitch = i && s && !CF(), this.audioCodecSwitch && this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"), this.levels = t.levels, this.startFragRequested = !1; } onLevelLoading(e, t) { const { @@ -31274,7 +31342,7 @@ class hF extends pf { if ((!u && i.readyState < 4 || r < o - c) && (this._hasEnoughToStart || (this.nextLoadPosition = s), i.readyState)) if (this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${o}, reset currentTime to : ${s.toFixed(3)}`), this.config.liveSyncMode === "buffered") { var l; - const h = le.bufferInfo(i, s, 0); + const h = ue.bufferInfo(i, s, 0); if (!(h != null && (l = h.buffered) != null && l.length)) { i.currentTime = s; return; @@ -31285,7 +31353,7 @@ class hF extends pf { } const { nextStart: f - } = le.bufferedInfo(h.buffered, r, 0); + } = ue.bufferedInfo(h.buffered, r, 0); f && (i.currentTime = f); } else i.currentTime = s; @@ -31313,12 +31381,12 @@ class hF extends pf { this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`), this.fragmentTracker.removeFragment(i); return; } - const l = o.videoCodec, c = u.PTSKnown || !u.live, h = (t = i.initSegment) == null ? void 0 : t.data, d = this._getAudioCodec(o), f = this.transmuxer = this.transmuxer || new tE(this.hls, J.MAIN, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this)), m = s ? s.index : -1, g = m !== -1, p = new mf(i.level, i.sn, i.stats.chunkCount, r.byteLength, m, g), y = this.initPTS[i.cc]; + const l = o.videoCodec, c = u.PTSKnown || !u.live, h = (t = i.initSegment) == null ? void 0 : t.data, d = this._getAudioCodec(o), f = this.transmuxer = this.transmuxer || new _E(this.hls, te.MAIN, this._handleTransmuxComplete.bind(this), this._handleTransmuxerFlush.bind(this)), m = s ? s.index : -1, g = m !== -1, p = new Of(i.level, i.sn, i.stats.chunkCount, r.byteLength, m, g), y = this.initPTS[i.cc]; f.push(r, h, d, l, i, s, u.totalduration, c, p, y); } onAudioTrackSwitching(e, t) { const i = this.hls, s = this.altAudio === 2; - if (Ul(t.url, i)) + if (su(t.url, i)) this.altAudio = 1; else { if (this.mediaBuffer !== this.media) { @@ -31341,7 +31409,7 @@ class hF extends pf { } } onAudioTrackSwitched(e, t) { - const i = Ul(t.url, this.hls); + const i = su(t.url, this.hls); if (i) { const s = this.videoBuffer; s && this.mediaBuffer !== s && (this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"), this.mediaBuffer = s); @@ -31367,17 +31435,17 @@ class hF extends pf { const { frag: i, part: s - } = t, r = i.type === J.MAIN; + } = t, r = i.type === te.MAIN; if (r) { if (this.fragContextChanged(i)) { this.warn(`Fragment ${i.sn}${s ? " p: " + s.index : ""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`), this.state === V.PARSED && (this.state = V.IDLE); return; } const o = s ? s.stats : i.stats; - this.fragLastKbps = Math.round(8 * o.total / (o.buffering.end - o.loading.first)), Ye(i) && (this.fragPrevious = i), this.fragBufferedComplete(i, s); + this.fragLastKbps = Math.round(8 * o.total / (o.buffering.end - o.loading.first)), Ze(i) && (this.fragPrevious = i), this.fragBufferedComplete(i, s); } const a = this.media; - a && (!this._hasEnoughToStart && le.getBuffered(a).length && (this._hasEnoughToStart = !0, this.seekToStartPos()), r && this.tick()); + a && (!this._hasEnoughToStart && ue.getBuffered(a).length && (this._hasEnoughToStart = !0, this.seekToStartPos()), r && this.tick()); } get hasEnoughToStart() { return this._hasEnoughToStart; @@ -31389,32 +31457,32 @@ class hF extends pf { return; } switch (t.details) { - case O.FRAG_GAP: - case O.FRAG_PARSING_ERROR: - case O.FRAG_DECRYPT_ERROR: - case O.FRAG_LOAD_ERROR: - case O.FRAG_LOAD_TIMEOUT: - case O.KEY_LOAD_ERROR: - case O.KEY_LOAD_TIMEOUT: - this.onFragmentOrKeyLoadError(J.MAIN, t); + case P.FRAG_GAP: + case P.FRAG_PARSING_ERROR: + case P.FRAG_DECRYPT_ERROR: + case P.FRAG_LOAD_ERROR: + case P.FRAG_LOAD_TIMEOUT: + case P.KEY_LOAD_ERROR: + case P.KEY_LOAD_TIMEOUT: + this.onFragmentOrKeyLoadError(te.MAIN, t); break; - case O.LEVEL_LOAD_ERROR: - case O.LEVEL_LOAD_TIMEOUT: - case O.LEVEL_PARSING_ERROR: + case P.LEVEL_LOAD_ERROR: + case P.LEVEL_LOAD_TIMEOUT: + case P.LEVEL_PARSING_ERROR: !t.levelRetry && this.state === V.WAITING_LEVEL && ((i = t.context) == null ? void 0 : i.type) === me.LEVEL && (this.state = V.IDLE); break; - case O.BUFFER_ADD_CODEC_ERROR: - case O.BUFFER_APPEND_ERROR: + case P.BUFFER_ADD_CODEC_ERROR: + case P.BUFFER_APPEND_ERROR: if (t.parent !== "main") return; this.reduceLengthAndFlushBuffer(t) && this.resetLoadingState(); break; - case O.BUFFER_FULL_ERROR: + case P.BUFFER_FULL_ERROR: if (t.parent !== "main") return; this.reduceLengthAndFlushBuffer(t) && this.flushMainBuffer(0, Number.POSITIVE_INFINITY); break; - case O.INTERNAL_EXCEPTION: + case P.INTERNAL_EXCEPTION: this.recoverWorkerError(t); break; } @@ -31425,9 +31493,9 @@ class hF extends pf { onBufferFlushed(e, { type: t }) { - if (t !== Fe.AUDIO || !this.altAudio) { - const i = (t === Fe.VIDEO ? this.videoBuffer : this.mediaBuffer) || this.media; - i && (this.afterBufferFlushed(i, t, J.MAIN), this.tick()); + if (t !== Pe.AUDIO || !this.altAudio) { + const i = (t === Pe.VIDEO ? this.videoBuffer : this.mediaBuffer) || this.media; + i && (this.afterBufferFlushed(i, t, te.MAIN), this.tick()); } } onLevelsUpdated(e, t) { @@ -31454,7 +31522,7 @@ class hF extends pf { } const s = this.timelineOffset; s && i && (i += s); - const r = this.getLevelDetails(), a = le.getBuffered(e), o = a.length ? a.start(0) : 0, u = o - i, l = Math.max(this.config.maxBufferHole, this.config.maxFragLookUpTolerance); + const r = this.getLevelDetails(), a = ue.getBuffered(e), o = a.length ? a.start(0) : 0, u = o - i, l = Math.max(this.config.maxBufferHole, this.config.maxFragLookUpTolerance); (this.config.startOnSegmentBoundary || u > 0 && (u < l || this.loadingParts && u < 2 * ((r == null ? void 0 : r.partTarget) || 0))) && (this.log(`adjusting start position by ${u} to match buffer start`), i += u, this.startPosition = i), t < i && (this.log(`seek to target start position ${i} from current time ${t} buffer start ${o}`), e.currentTime = i); } } @@ -31512,7 +31580,7 @@ class hF extends pf { }); } const y = m.initPTS, v = m.timescale, _ = this.initPTS[u.cc]; - Z(y) && (!_ || _.baseTime !== y || _.timescale !== v) && (this.initPTS[u.cc] = { + J(y) && (!_ || _.baseTime !== y || _.timescale !== v) && (this.initPTS[u.cc] = { baseTime: y, timescale: v }, s.trigger(b.INIT_PTS_FOUND, { @@ -31529,25 +31597,25 @@ class hF extends pf { const { startPTS: E, endPTS: T, - startDTS: A, + startDTS: x, endDTS: S } = h; if (l) l.elementaryStreams[h.type] = { startPTS: E, endPTS: T, - startDTS: A, + startDTS: x, endDTS: S }; else if (h.firstKeyFrame && h.independent && a.id === 1 && !_ && (this.couldBacktrack = !0), h.dropped && h.independent) { - const D = this.getMainFwdBufferInfo(), x = (D ? D.end : this.getLoadPosition()) + this.config.maxBufferHole, w = h.firstKeyFramePTS ? h.firstKeyFramePTS : E; - if (!v && x < w - this.config.maxBufferHole && !_) { + const D = this.getMainFwdBufferInfo(), A = (D ? D.end : this.getLoadPosition()) + this.config.maxBufferHole, w = h.firstKeyFramePTS ? h.firstKeyFramePTS : E; + if (!v && A < w - this.config.maxBufferHole && !_) { this.backtrack(u); return; } else _ && (u.gap = !0); u.setElementaryStreamInfo(h.type, u.start, T, u.start, S, !0); - } else v && E - (g.appliedTimelineOffset || 0) > Tl && (u.gap = !0); - u.setElementaryStreamInfo(h.type, E, T, A, S), this.backtrackFragment && (this.backtrackFragment = u), this.bufferFragmentData(h, u, l, a, v || _); + } else v && E - (g.appliedTimelineOffset || 0) > Gl && (u.gap = !0); + u.setElementaryStreamInfo(h.type, E, T, x, S), this.backtrackFragment && (this.backtrackFragment = u), this.bufferFragmentData(h, u, l, a, v || _); } else if (v || _) u.gap = !0; else { @@ -31562,12 +31630,12 @@ class hF extends pf { startDTS: _, endDTS: E } = p; - l && (l.elementaryStreams[Fe.AUDIO] = { + l && (l.elementaryStreams[Pe.AUDIO] = { startPTS: y, endPTS: v, startDTS: _, endDTS: E - }), u.setElementaryStreamInfo(Fe.AUDIO, y, v, _, E), this.bufferFragmentData(p, u, l, a); + }), u.setElementaryStreamInfo(Pe.AUDIO, y, v, _, E), this.bufferFragmentData(p, u, l, a); } if (g && f != null && (t = f.samples) != null && t.length) { const y = { @@ -31589,7 +31657,7 @@ class hF extends pf { } } logMuxedErr(e) { - this.warn(`${Ye(e) ? "Media" : "Init"} segment with muxed audiovideo where only video expected: ${e.url}`); + this.warn(`${Ze(e) ? "Media" : "Init"} segment with muxed audiovideo where only video expected: ${e.url}`); } _bufferInitSegment(e, t, i, s) { if (this.state !== V.PARSING) @@ -31602,7 +31670,7 @@ class hF extends pf { } = t; if (r) { const l = e.audioCodec; - let c = gl(r.codec, l); + let c = Pl(r.codec, l); c === "mp4a" && (c = "mp4a.40.5"); const h = navigator.userAgent.toLowerCase(); if (this.audioCodecSwitch) { @@ -31610,10 +31678,10 @@ class hF extends pf { const d = r.metadata; d && "channelCount" in d && (d.channelCount || 1) !== 1 && h.indexOf("firefox") === -1 && (c = "mp4a.40.5"); } - c && c.indexOf("mp4a.40.5") !== -1 && h.indexOf("android") !== -1 && r.container !== "audio/mpeg" && (c = "mp4a.40.2", this.log(`Android: force audio codec to ${c}`)), l && l !== c && this.log(`Swapping manifest audio codec "${l}" for "${c}"`), r.levelCodec = c, r.id = J.MAIN, this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${c || ""}/${l || ""}/${r.codec}]`), delete t.audiovideo; + c && c.indexOf("mp4a.40.5") !== -1 && h.indexOf("android") !== -1 && r.container !== "audio/mpeg" && (c = "mp4a.40.2", this.log(`Android: force audio codec to ${c}`)), l && l !== c && this.log(`Swapping manifest audio codec "${l}" for "${c}"`), r.levelCodec = c, r.id = te.MAIN, this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${c || ""}/${l || ""}/${r.codec}]`), delete t.audiovideo; } if (a) { - a.levelCodec = e.videoCodec, a.id = J.MAIN; + a.levelCodec = e.videoCodec, a.id = te.MAIN; const l = a.codec; if ((l == null ? void 0 : l.length) === 4) switch (l) { @@ -31651,7 +31719,7 @@ class hF extends pf { } getMainFwdBufferInfo() { const e = this.mediaBuffer && this.altAudio === 2 ? this.mediaBuffer : this.media; - return this.getFwdBufferInfo(e, J.MAIN); + return this.getFwdBufferInfo(e, te.MAIN); } get maxBufferLength() { const { @@ -31668,7 +31736,7 @@ class hF extends pf { let t = null; if (e && e.readyState > 1 && e.seeking === !1) { const i = e.currentTime; - if (le.isBuffered(e, i) ? t = this.getAppendedFrag(i) : le.isBuffered(e, i + 0.1) && (t = this.getAppendedFrag(i + 0.1)), t) { + if (ue.isBuffered(e, i) ? t = this.getAppendedFrag(i) : ue.isBuffered(e, i + 0.1) && (t = this.getAppendedFrag(i + 0.1)), t) { this.backtrackFragment = null; const s = this.fragPlaying, r = t.level; (!s || t.sn !== s.sn || s.level !== r) && (this.fragPlaying = t, this.hls.trigger(b.FRAG_CHANGED, { @@ -31688,13 +31756,13 @@ class hF extends pf { if (this.fragPlaying) return this.fragPlaying; const t = ((e = this.media) == null ? void 0 : e.currentTime) || this.lastCurrentTime; - return Z(t) ? this.getAppendedFrag(t) : null; + return J(t) ? this.getAppendedFrag(t) : null; } get currentProgramDateTime() { var e; const t = ((e = this.media) == null ? void 0 : e.currentTime) || this.lastCurrentTime; - if (Z(t)) { - const i = this.getLevelDetails(), s = this.currentFrag || (i ? ws(null, i.fragments, t) : null); + if (J(t)) { + const i = this.getLevelDetails(), s = this.currentFrag || (i ? Bs(null, i.fragments, t) : null); if (s) { const r = s.programDateTime; if (r !== null) { @@ -31717,7 +31785,7 @@ class hF extends pf { return this._forceStartLoad; } } -class dF { +class OF { constructor(e) { this.config = void 0, this.keyUriToKeyInfo = {}, this.emeController = null, this.config = e; } @@ -31746,9 +31814,9 @@ class dF { } this.keyUriToKeyInfo = {}; } - createKeyLoadError(e, t = O.KEY_LOAD_ERROR, i, s, r) { - return new bn({ - type: ie.NETWORK_ERROR, + createKeyLoadError(e, t = P.KEY_LOAD_ERROR, i, s, r) { + return new Tn({ + type: ne.NETWORK_ERROR, details: t, fatal: !1, frag: e, @@ -31762,18 +31830,18 @@ class dF { if (t.length) for (let s = 0, r = t.length; s < r; s++) { const a = t[s]; - if (e.cc <= a.cc && (!Ye(e) || !Ye(a) || e.sn < a.sn) || !i && s == r - 1) + if (e.cc <= a.cc && (!Ze(e) || !Ze(a) || e.sn < a.sn) || !i && s == r - 1) return this.emeController.selectKeySystemFormat(a).then((o) => { if (!this.emeController) return; a.setKeyFormat(o); - const u = hd(o); + const u = Cd(o); if (u) return this.emeController.getKeySystemAccess([u]); }); } if (this.config.requireKeySystemAccessOnStart) { - const s = _l(this.config); + const s = Ml(this.config); if (s.length) return this.emeController.getKeySystemAccess(s); } @@ -31789,11 +31857,11 @@ class dF { const r = e.decryptdata; if (!r) { const l = new Error(t ? `Expected frag.decryptdata to be defined after setting format ${t}` : "Missing decryption data on fragment in onKeyLoading"); - return Promise.reject(this.createKeyLoadError(e, O.KEY_LOAD_ERROR, l)); + return Promise.reject(this.createKeyLoadError(e, P.KEY_LOAD_ERROR, l)); } const a = r.uri; if (!a) - return Promise.reject(this.createKeyLoadError(e, O.KEY_LOAD_ERROR, new Error(`Invalid key URI: "${a}"`))); + return Promise.reject(this.createKeyLoadError(e, P.KEY_LOAD_ERROR, new Error(`Invalid key URI: "${a}"`))); let o = this.keyUriToKeyInfo[a]; if ((i = o) != null && i.decryptdata.key) return r.key = o.decryptdata.key, Promise.resolve({ @@ -31829,7 +31897,7 @@ class dF { case "AES-256-CTR": return this.loadKeyHTTP(o, e); default: - return Promise.reject(this.createKeyLoadError(e, O.KEY_LOAD_ERROR, new Error(`Key supplied with unsupported METHOD: "${r.method}"`))); + return Promise.reject(this.createKeyLoadError(e, P.KEY_LOAD_ERROR, new Error(`Key supplied with unsupported METHOD: "${r.method}"`))); } } loadKeyEME(e, t) { @@ -31868,23 +31936,23 @@ class dF { url: v } = m; if (!p.decryptdata || y !== this.keyUriToKeyInfo[v]) - return o(this.createKeyLoadError(p, O.KEY_LOAD_ERROR, new Error("after key load, decryptdata unset or changed"), g)); + return o(this.createKeyLoadError(p, P.KEY_LOAD_ERROR, new Error("after key load, decryptdata unset or changed"), g)); y.decryptdata.key = p.decryptdata.key = new Uint8Array(d.data), p.keyLoader = null, y.loader = null, a({ frag: p, keyInfo: y }); }, onError: (d, f, m, g) => { - this.resetLoader(f), o(this.createKeyLoadError(t, O.KEY_LOAD_ERROR, new Error(`HTTP Error ${d.code} loading key ${d.text}`), m, Le({ + this.resetLoader(f), o(this.createKeyLoadError(t, P.KEY_LOAD_ERROR, new Error(`HTTP Error ${d.code} loading key ${d.text}`), m, Ie({ url: u.url, data: void 0 }, d))); }, onTimeout: (d, f, m) => { - this.resetLoader(f), o(this.createKeyLoadError(t, O.KEY_LOAD_TIMEOUT, new Error("key loading timed out"), m)); + this.resetLoader(f), o(this.createKeyLoadError(t, P.KEY_LOAD_TIMEOUT, new Error("key loading timed out"), m)); }, onAbort: (d, f, m) => { - this.resetLoader(f), o(this.createKeyLoadError(t, O.INTERNAL_ABORTED, new Error("key loading aborted"), m)); + this.resetLoader(f), o(this.createKeyLoadError(t, P.INTERNAL_ABORTED, new Error("key loading aborted"), m)); } }; r.load(u, c, h); @@ -31899,24 +31967,24 @@ class dF { t.keyLoader === r && (t.keyLoader = null, i.loader = null), delete this.keyUriToKeyInfo[s], r && r.destroy(); } } -function w0(n) { +function q0(n) { const { type: e } = n; switch (e) { case me.AUDIO_TRACK: - return J.AUDIO; + return te.AUDIO; case me.SUBTITLE_TRACK: - return J.SUBTITLE; + return te.SUBTITLE; default: - return J.MAIN; + return te.MAIN; } } -function fh(n, e) { +function Fh(n, e) { let t = n.url; return (t === void 0 || t.indexOf("data:") === 0) && (t = e.url), t; } -class fF { +class MF { constructor(e) { this.hls = void 0, this.loaders = /* @__PURE__ */ Object.create(null), this.variableList = null, this.onManifestLoaded = this.checkAutostartLoad, this.hls = e, this.registerListeners(); } @@ -32054,16 +32122,16 @@ class fF { l.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`), s.abort(); } let r; - if (e.type === me.MANIFEST ? r = i.manifestLoadPolicy.default : r = De({}, i.playlistLoadPolicy.default, { + if (e.type === me.MANIFEST ? r = i.manifestLoadPolicy.default : r = we({}, i.playlistLoadPolicy.default, { timeoutRetry: null, errorRetry: null - }), s = this.createInternalLoader(e), Z((t = e.deliveryDirectives) == null ? void 0 : t.part)) { + }), s = this.createInternalLoader(e), J((t = e.deliveryDirectives) == null ? void 0 : t.part)) { let l; if (e.type === me.LEVEL && e.level !== null ? l = this.hls.levels[e.level].details : e.type === me.AUDIO_TRACK && e.id !== null ? l = this.hls.audioTracks[e.id].details : e.type === me.SUBTITLE_TRACK && e.id !== null && (l = this.hls.subtitleTracks[e.id].details), l) { const c = l.partTarget, h = l.targetduration; if (c && h) { const d = Math.max(c * 3, h * 0.8) * 1e3; - r = De({}, r, { + r = we({}, r, { maxTimeToFirstByteMs: Math.min(d, r.maxTimeToFirstByteMs), maxLoadTimeMs: Math.min(d, r.maxTimeToFirstByteMs) }); @@ -32085,7 +32153,7 @@ class fF { this.handleManifestParsingError(l, h, new Error("no EXTM3U delimiter"), d || null, c); return; } - c.parsing.start = performance.now(), nn.isMediaPlaylist(m) || h.type !== me.MANIFEST ? this.handleTrackOrLevelPlaylist(l, c, h, d || null, f) : this.handleMasterPlaylist(l, c, h, d); + c.parsing.start = performance.now(), an.isMediaPlaylist(m) || h.type !== me.MANIFEST ? this.handleTrackOrLevelPlaylist(l, c, h, d || null, f) : this.handleMasterPlaylist(l, c, h, d); }, onError: (l, c, h, d) => { this.handleNetworkError(c, h, !1, l, d); @@ -32109,7 +32177,7 @@ class fF { (e || i) && (this.hls.logger.log(`${e ? "auto" : "force"} startLoad with configured startPosition ${t}`), this.hls.startLoad(t)); } handleMasterPlaylist(e, t, i, s) { - const r = this.hls, a = e.data, o = fh(e, i), u = nn.parseMasterPlaylist(a, o); + const r = this.hls, a = e.data, o = Fh(e, i), u = an.parseMasterPlaylist(a, o); if (u.playlistParsingError) { this.handleManifestParsingError(e, i, u.playlistParsingError, s, t); return; @@ -32127,7 +32195,7 @@ class fF { AUDIO: g = [], SUBTITLES: p, "CLOSED-CAPTIONS": y - } = nn.parseMasterPlaylistMedia(a, o, u); + } = an.parseMasterPlaylistMedia(a, o, u); g.length && !g.some((_) => !_.url) && c[0].audioCodec && !c[0].attrs.AUDIO && (this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"), g.unshift({ type: "main", name: "main", @@ -32136,7 +32204,7 @@ class fF { autoselect: !1, forced: !1, id: -1, - attrs: new Be({}), + attrs: new Ue({}), bitrate: 0, url: "" })), r.trigger(b.MANIFEST_LOADED, { @@ -32159,16 +32227,16 @@ class fF { id: o, level: u, type: l - } = i, c = fh(e, i), h = Z(u) ? u : Z(o) ? o : 0, d = w0(i), f = nn.parseLevelPlaylist(e.data, c, h, d, 0, this.variableList); + } = i, c = Fh(e, i), h = J(u) ? u : J(o) ? o : 0, d = q0(i), f = an.parseLevelPlaylist(e.data, c, h, d, 0, this.variableList); if (l === me.MANIFEST) { const m = { - attrs: new Be({}), + attrs: new Ue({}), bitrate: 0, details: f, name: "", url: c }; - f.requestScheduled = t.loading.start + ky(f, 0), a.trigger(b.MANIFEST_LOADED, { + f.requestScheduled = t.loading.start + jy(f, 0), a.trigger(b.MANIFEST_LOADED, { levels: [m], audioTracks: [], url: c, @@ -32185,8 +32253,8 @@ class fF { } handleManifestParsingError(e, t, i, s, r) { this.hls.trigger(b.ERROR, { - type: ie.NETWORK_ERROR, - details: O.MANIFEST_PARSING_ERROR, + type: ne.NETWORK_ERROR, + details: P.MANIFEST_PARSING_ERROR, fatal: t.type === me.MANIFEST, url: e.url, err: i, @@ -32203,25 +32271,25 @@ class fF { e.type === me.LEVEL ? a += `: ${e.level} id: ${e.id}` : (e.type === me.AUDIO_TRACK || e.type === me.SUBTITLE_TRACK) && (a += ` id: ${e.id} group-id: "${e.groupId}"`); const o = new Error(a); this.hls.logger.warn(`[playlist-loader]: ${a}`); - let u = O.UNKNOWN, l = !1; + let u = P.UNKNOWN, l = !1; const c = this.getInternalLoader(e); switch (e.type) { case me.MANIFEST: - u = i ? O.MANIFEST_LOAD_TIMEOUT : O.MANIFEST_LOAD_ERROR, l = !0; + u = i ? P.MANIFEST_LOAD_TIMEOUT : P.MANIFEST_LOAD_ERROR, l = !0; break; case me.LEVEL: - u = i ? O.LEVEL_LOAD_TIMEOUT : O.LEVEL_LOAD_ERROR, l = !1; + u = i ? P.LEVEL_LOAD_TIMEOUT : P.LEVEL_LOAD_ERROR, l = !1; break; case me.AUDIO_TRACK: - u = i ? O.AUDIO_TRACK_LOAD_TIMEOUT : O.AUDIO_TRACK_LOAD_ERROR, l = !1; + u = i ? P.AUDIO_TRACK_LOAD_TIMEOUT : P.AUDIO_TRACK_LOAD_ERROR, l = !1; break; case me.SUBTITLE_TRACK: - u = i ? O.SUBTITLE_TRACK_LOAD_TIMEOUT : O.SUBTITLE_LOAD_ERROR, l = !1; + u = i ? P.SUBTITLE_TRACK_LOAD_TIMEOUT : P.SUBTITLE_LOAD_ERROR, l = !1; break; } c && this.resetInternalLoader(e.type); const h = { - type: ie.NETWORK_ERROR, + type: ne.NETWORK_ERROR, details: u, fatal: l, url: e.url, @@ -32233,7 +32301,7 @@ class fF { }; if (s) { const d = (t == null ? void 0 : t.url) || e.url; - h.response = Le({ + h.response = Ie({ url: d, data: void 0 }, s); @@ -32247,12 +32315,12 @@ class fF { id: c, groupId: h, deliveryDirectives: d - } = s, f = fh(t, s), m = w0(s), g = typeof s.level == "number" && m === J.MAIN ? l : void 0; + } = s, f = Fh(t, s), m = q0(s), g = typeof s.level == "number" && m === te.MAIN ? l : void 0; if (!e.fragments.length) { const y = e.playlistParsingError = new Error("No Segments found in Playlist"); o.trigger(b.ERROR, { - type: ie.NETWORK_ERROR, - details: O.LEVEL_EMPTY_ERROR, + type: ne.NETWORK_ERROR, + details: P.LEVEL_EMPTY_ERROR, fatal: !1, url: f, error: y, @@ -32271,8 +32339,8 @@ class fF { if (p) { if (this.hls.logger.warn(p), !o.config.ignorePlaylistParsingErrors) { o.trigger(b.ERROR, { - type: ie.NETWORK_ERROR, - details: O.LEVEL_PARSING_ERROR, + type: ne.NETWORK_ERROR, + details: P.LEVEL_PARSING_ERROR, fatal: !1, url: f, error: p, @@ -32327,81 +32395,81 @@ class fF { } } } -class Vt { +class Yt { /** * Get the video-dev/hls.js package version. */ static get version() { - return Ba; + return Xa; } /** * Check if the required MediaSource Extensions are available. */ static isMSESupported() { - return AE(); + return UE(); } /** * Check if MediaSource Extensions are available and isTypeSupported checks pass for any baseline codecs. */ static isSupported() { - return lF(); + return RF(); } /** * Get the MediaSource global used for MSE playback (ManagedMediaSource, MediaSource, or WebKitMediaSource). */ static getMediaSource() { - return Qn(); + return ns(); } static get Events() { return b; } static get MetadataSchema() { - return Ht; + return Wt; } static get ErrorTypes() { - return ie; + return ne; } static get ErrorDetails() { - return O; + return P; } /** * Get the default configuration applied to new instances. */ static get DefaultConfig() { - return Vt.defaultConfig ? Vt.defaultConfig : X2; + return Yt.defaultConfig ? Yt.defaultConfig : yF; } /** * Replace the default configuration applied to new instances. */ static set DefaultConfig(e) { - Vt.defaultConfig = e; + Yt.defaultConfig = e; } /** * Creates an instance of an HLS client that can attach to exactly one `HTMLMediaElement`. * @param userConfig - Configuration options applied over `Hls.DefaultConfig` */ constructor(e = {}) { - this.config = void 0, this.userConfig = void 0, this.logger = void 0, this.coreComponents = void 0, this.networkControllers = void 0, this._emitter = new _f(), this._autoLevelCapping = -1, this._maxHdcpLevel = null, this.abrController = void 0, this.bufferController = void 0, this.capLevelController = void 0, this.latencyController = void 0, this.levelController = void 0, this.streamController = void 0, this.audioStreamController = void 0, this.subtititleStreamController = void 0, this.audioTrackController = void 0, this.subtitleTrackController = void 0, this.interstitialsController = void 0, this.gapController = void 0, this.emeController = void 0, this.cmcdController = void 0, this._media = null, this._url = null, this._sessionId = void 0, this.triggeringException = void 0, this.started = !1; - const t = this.logger = FI(e.debug || !1, "Hls instance", e.assetPlayerId), i = this.config = Z2(Vt.DefaultConfig, e, t); - this.userConfig = e, i.progressive && J2(i, t); + this.config = void 0, this.userConfig = void 0, this.logger = void 0, this.coreComponents = void 0, this.networkControllers = void 0, this._emitter = new Bf(), this._autoLevelCapping = -1, this._maxHdcpLevel = null, this.abrController = void 0, this.bufferController = void 0, this.capLevelController = void 0, this.latencyController = void 0, this.levelController = void 0, this.streamController = void 0, this.audioStreamController = void 0, this.subtititleStreamController = void 0, this.audioTrackController = void 0, this.subtitleTrackController = void 0, this.interstitialsController = void 0, this.gapController = void 0, this.emeController = void 0, this.cmcdController = void 0, this._media = null, this._url = null, this._sessionId = void 0, this.triggeringException = void 0, this.started = !1; + const t = this.logger = ik(e.debug || !1, "Hls instance", e.assetPlayerId), i = this.config = bF(Yt.DefaultConfig, e, t); + this.userConfig = e, i.progressive && TF(i, t); const { abrController: s, bufferController: r, capLevelController: a, errorController: o, fpsController: u - } = i, l = new o(this), c = this.abrController = new s(this), h = new Ak(this), d = i.interstitialsController, f = d ? this.interstitialsController = new d(this, Vt) : null, m = this.bufferController = new r(this, h), g = this.capLevelController = new a(this), p = new u(this), y = new fF(this), v = i.contentSteeringController, _ = v ? new v(this) : null, E = this.levelController = new oF(this, _), T = new rF(this), A = new dF(this.config), S = this.streamController = new hF(this, h, A), D = this.gapController = new nF(this, h); + } = i, l = new o(this), c = this.abrController = new s(this), h = new zk(this), d = i.interstitialsController, f = d ? this.interstitialsController = new d(this, Yt) : null, m = this.bufferController = new r(this, h), g = this.capLevelController = new a(this), p = new u(this), y = new MF(this), v = i.contentSteeringController, _ = v ? new v(this) : null, E = this.levelController = new kF(this, _), T = new LF(this), x = new OF(this.config), S = this.streamController = new PF(this, h, x), D = this.gapController = new DF(this, h); g.setStreamController(S), p.setStreamController(S); - const x = [y, E, S]; - f && x.splice(1, 0, f), _ && x.splice(1, 0, _), this.networkControllers = x; + const A = [y, E, S]; + f && A.splice(1, 0, f), _ && A.splice(1, 0, _), this.networkControllers = A; const w = [c, m, D, g, p, T, h]; - this.audioTrackController = this.createController(i.audioTrackController, x); + this.audioTrackController = this.createController(i.audioTrackController, A); const I = i.audioStreamController; - I && x.push(this.audioStreamController = new I(this, h, A)), this.subtitleTrackController = this.createController(i.subtitleTrackController, x); - const R = i.subtitleStreamController; - R && x.push(this.subtititleStreamController = new R(this, h, A)), this.createController(i.timelineController, w), A.emeController = this.emeController = this.createController(i.emeController, w), this.cmcdController = this.createController(i.cmcdController, w), this.latencyController = this.createController(aF, w), this.coreComponents = w, x.push(l); - const M = l.onErrorOut; - typeof M == "function" && this.on(b.ERROR, M, l), this.on(b.MANIFEST_LOADED, y.onManifestLoaded, y); + I && A.push(this.audioStreamController = new I(this, h, x)), this.subtitleTrackController = this.createController(i.subtitleTrackController, A); + const M = i.subtitleStreamController; + M && A.push(this.subtititleStreamController = new M(this, h, x)), this.createController(i.timelineController, w), x.emeController = this.emeController = this.createController(i.emeController, w), this.cmcdController = this.createController(i.cmcdController, w), this.latencyController = this.createController(IF, w), this.coreComponents = w, A.push(l); + const k = l.onErrorOut; + typeof k == "function" && this.on(b.ERROR, k, l), this.on(b.MANIFEST_LOADED, y.onManifestLoaded, y); } createController(e, t) { if (e) { @@ -32439,8 +32507,8 @@ class Vt { this.triggeringException = !0; const s = e === b.ERROR; this.trigger(b.ERROR, { - type: ie.OTHER_ERROR, - details: O.INTERNAL_EXCEPTION, + type: ne.OTHER_ERROR, + details: P.INTERNAL_EXCEPTION, fatal: s, event: e, error: i @@ -32467,8 +32535,8 @@ class Vt { if (!e || "media" in e && !e.media) { const r = new Error(`attachMedia failed: invalid argument (${e})`); this.trigger(b.ERROR, { - type: ie.OTHER_ERROR, - details: O.ATTACH_MEDIA_ERROR, + type: ne.OTHER_ERROR, + details: P.ATTACH_MEDIA_ERROR, fatal: !0, error: r }); @@ -32501,7 +32569,7 @@ class Vt { */ loadSource(e) { this.stopLoad(); - const t = this.media, i = this._url, s = this._url = of.buildAbsoluteURL(self.location.href, e, { + const t = this.media, i = this._url, s = this._url = Lf.buildAbsoluteURL(self.location.href, e, { alwaysNormalize: !0 }); this._autoLevelCapping = -1, this._maxHdcpLevel = null, this.logger.log(`loadSource:${s}`), t && i && (i !== s || this.bufferController.hasSourceTypes()) && (this.detachMedia(), this.attachMedia(t)), this.trigger(b.MANIFEST_LOADING, { @@ -32577,9 +32645,9 @@ class Vt { } get inFlightFragments() { const e = { - [J.MAIN]: this.streamController.inFlightFrag + [te.MAIN]: this.streamController.inFlightFrag }; - return this.audioStreamController && (e[J.AUDIO] = this.audioStreamController.inFlightFrag), this.subtititleStreamController && (e[J.SUBTITLE] = this.subtititleStreamController.inFlightFrag), e; + return this.audioStreamController && (e[te.AUDIO] = this.audioStreamController.inFlightFrag), this.subtititleStreamController && (e[te.SUBTITLE] = this.subtititleStreamController.inFlightFrag), e; } /** * Swap through possible audio codecs in the stream (for example to switch from stereo to 5.1) @@ -32606,7 +32674,7 @@ class Vt { */ get sessionId() { let e = this._sessionId; - return e || (e = this._sessionId = n2()), e; + return e || (e = this._sessionId = D2()), e; } /** * @returns an array of levels (variants) sorted by HDCP-LEVEL, RESOLUTION (height), FRAME-RATE, CODECS, VIDEO-RANGE, and BANDWIDTH @@ -32772,7 +32840,7 @@ class Vt { return this._maxHdcpLevel; } set maxHdcpLevel(e) { - lk(e) && this._maxHdcpLevel !== e && (this._maxHdcpLevel = e, this.levelController.checkMaxAutoUpdated()); + Rk(e) && this._maxHdcpLevel !== e && (this._maxHdcpLevel = e, this.levelController.checkMaxAutoUpdated()); } /** * True when automatic level selection enabled @@ -33029,78 +33097,78 @@ class Vt { * returns mediaCapabilities.decodingInfo for a variant/rendition */ getMediaDecodingInfo(e, t = this.allAudioTracks) { - const i = yy(t); - return _y(e, i, navigator.mediaCapabilities); + const i = Oy(t); + return Fy(e, i, navigator.mediaCapabilities); } } -Vt.defaultConfig = void 0; +Yt.defaultConfig = void 0; const { - SvelteComponent: mF, - action_destroyer: gF, - add_render_callback: pF, - assign: L0, - attr: $n, - binding_callbacks: _F, - children: vF, - claim_element: I0, - claim_space: yF, - create_slot: EF, - detach: Zo, - element: k0, - exclude_internal_props: R0, - flush: Bt, - get_all_dirty_from_scope: bF, - get_slot_changes: TF, - get_svelte_dataset: SF, - init: AF, - insert_hydration: mh, - is_function: xF, - listen: Hi, - raf: DF, - run_all: wF, - safe_not_equal: LF, - space: IF, - src_url_equal: C0, - toggle_class: F0, - transition_in: kF, - transition_out: RF, - update_slot_base: CF -} = window.__gradio__svelte__internal, { createEventDispatcher: FF } = window.__gradio__svelte__internal; -function PF(n) { - let e, t = '<span class="load-wrap svelte-1pwzuub"><span class="loader svelte-1pwzuub"></span></span>', i, s, r, a, o = !1, u, l = !0, c, h, d, f; + SvelteComponent: $F, + action_destroyer: BF, + add_render_callback: NF, + assign: K0, + attr: Kn, + binding_callbacks: UF, + children: GF, + claim_element: j0, + claim_space: HF, + create_slot: VF, + detach: _l, + element: z0, + exclude_internal_props: W0, + flush: Dt, + get_all_dirty_from_scope: qF, + get_slot_changes: KF, + get_svelte_dataset: jF, + init: zF, + insert_hydration: Ph, + is_function: WF, + listen: ji, + raf: YF, + run_all: XF, + safe_not_equal: QF, + space: ZF, + src_url_equal: Y0, + toggle_class: cr, + transition_in: JF, + transition_out: eP, + update_slot_base: tP +} = window.__gradio__svelte__internal, { createEventDispatcher: iP } = window.__gradio__svelte__internal; +function nP(n) { + let e, t = '<span class="load-wrap svelte-1p2o6nz"><span class="loader svelte-1p2o6nz"></span></span>', i, s, r, a, o = !1, u, l = !0, c, h, d, f; const m = ( /*#slots*/ - n[18].default - ), g = EF( + n[20].default + ), g = VF( m, n, /*$$scope*/ - n[17], + n[19], null ); function p() { - cancelAnimationFrame(u), s.paused || (u = DF(p), o = !0), n[19].call(s); + cancelAnimationFrame(u), s.paused || (u = YF(p), o = !0), n[21].call(s); } return { c() { - e = k0("div"), e.innerHTML = t, i = IF(), s = k0("video"), g && g.c(), this.h(); + e = z0("div"), e.innerHTML = t, i = ZF(), s = z0("video"), g && g.c(), this.h(); }, l(y) { - e = I0(y, "DIV", { class: !0, "data-svelte-h": !0 }), SF(e) !== "svelte-mez4j5" && (e.innerHTML = t), i = yF(y), s = I0(y, "VIDEO", { + e = j0(y, "DIV", { class: !0, "data-svelte-h": !0 }), jF(e) !== "svelte-mez4j5" && (e.innerHTML = t), i = HF(y), s = j0(y, "VIDEO", { src: !0, preload: !0, "data-testid": !0, crossorigin: !0 }); - var v = vF(s); - g && g.l(v), v.forEach(Zo), this.h(); + var v = GF(s); + g && g.l(v), v.forEach(_l), this.h(); }, h() { - $n(e, "class", "overlay svelte-1pwzuub"), F0(e, "hidden", !/*processingVideo*/ - n[10]), C0(s.src, r = /*resolved_src*/ - n[11]) || $n(s, "src", r), s.muted = /*muted*/ + Kn(e, "class", "overlay svelte-1p2o6nz"), cr(e, "hidden", !/*processingVideo*/ + n[12]), Y0(s.src, r = /*resolved_src*/ + n[13]) || Kn(s, "src", r), s.muted = /*muted*/ n[4], s.playsInline = /*playsinline*/ - n[5], $n( + n[5], Kn( s, "preload", /*preload*/ @@ -33108,71 +33176,81 @@ function PF(n) { ), s.autoplay = /*autoplay*/ n[7], s.controls = /*controls*/ n[8], s.loop = /*loop*/ - n[9], $n(s, "data-testid", a = /*$$props*/ - n[13]["data-testid"]), $n(s, "crossorigin", "anonymous"), /*duration*/ - n[2] === void 0 && pF(() => ( + n[9], Kn(s, "data-testid", a = /*$$props*/ + n[15]["data-testid"]), Kn(s, "crossorigin", "anonymous"), /*duration*/ + n[2] === void 0 && NF(() => ( /*video_durationchange_handler*/ - n[20].call(s) - )); + n[22].call(s) + )), cr( + s, + "fullscreen", + /*fullscreen*/ + n[10] + ), cr( + s, + "small", + /*small*/ + n[11] + ); }, m(y, v) { - mh(y, e, v), mh(y, i, v), mh(y, s, v), g && g.m(s, null), n[22](s), h = !0, d || (f = [ - Hi( + Ph(y, e, v), Ph(y, i, v), Ph(y, s, v), g && g.m(s, null), n[24](s), h = !0, d || (f = [ + ji( s, "loadeddata", /*dispatch*/ - n[12].bind(null, "loadeddata") + n[14].bind(null, "loadeddata") ), - Hi( + ji( s, "click", /*dispatch*/ - n[12].bind(null, "click") + n[14].bind(null, "click") ), - Hi( + ji( s, "play", /*dispatch*/ - n[12].bind(null, "play") + n[14].bind(null, "play") ), - Hi( + ji( s, "pause", /*dispatch*/ - n[12].bind(null, "pause") + n[14].bind(null, "pause") ), - Hi( + ji( s, "ended", /*dispatch*/ - n[12].bind(null, "ended") + n[14].bind(null, "ended") ), - Hi( + ji( s, "error", /*dispatch*/ - n[12].bind(null, "error", "Video not playable") + n[14].bind(null, "error", "Video not playable") ), - Hi(s, "timeupdate", p), - Hi( + ji(s, "timeupdate", p), + ji( s, "durationchange", /*video_durationchange_handler*/ - n[20] + n[22] ), - Hi( + ji( s, "play", /*video_play_pause_handler*/ - n[21] + n[23] ), - Hi( + ji( s, "pause", /*video_play_pause_handler*/ - n[21] + n[23] ), - gF(c = sI.call(null, s, { autoplay: ( + BF(c = wI.call(null, s, { autoplay: ( /*autoplay*/ n[7] ?? !1 ) })) @@ -33180,33 +33258,33 @@ function PF(n) { }, p(y, [v]) { (!h || v & /*processingVideo*/ - 1024) && F0(e, "hidden", !/*processingVideo*/ - y[10]), g && g.p && (!h || v & /*$$scope*/ - 131072) && CF( + 4096) && cr(e, "hidden", !/*processingVideo*/ + y[12]), g && g.p && (!h || v & /*$$scope*/ + 524288) && tP( g, m, y, /*$$scope*/ - y[17], - h ? TF( + y[19], + h ? KF( m, /*$$scope*/ - y[17], + y[19], v, null - ) : bF( + ) : qF( /*$$scope*/ - y[17] + y[19] ), null ), (!h || v & /*resolved_src*/ - 2048 && !C0(s.src, r = /*resolved_src*/ - y[11])) && $n(s, "src", r), (!h || v & /*muted*/ + 8192 && !Y0(s.src, r = /*resolved_src*/ + y[13])) && Kn(s, "src", r), (!h || v & /*muted*/ 16) && (s.muted = /*muted*/ y[4]), (!h || v & /*playsinline*/ 32) && (s.playsInline = /*playsinline*/ y[5]), (!h || v & /*preload*/ - 64) && $n( + 64) && Kn( s, "preload", /*preload*/ @@ -33218,240 +33296,265 @@ function PF(n) { y[8]), (!h || v & /*loop*/ 512) && (s.loop = /*loop*/ y[9]), (!h || v & /*$$props*/ - 8192 && a !== (a = /*$$props*/ - y[13]["data-testid"])) && $n(s, "data-testid", a), !o && v & /*currentTime*/ + 32768 && a !== (a = /*$$props*/ + y[15]["data-testid"])) && Kn(s, "data-testid", a), !o && v & /*currentTime*/ 2 && !isNaN( /*currentTime*/ y[1] ) && (s.currentTime = /*currentTime*/ y[1]), o = !1, v & /*paused*/ 8 && l !== (l = /*paused*/ - y[3]) && s[l ? "pause" : "play"](), c && xF(c.update) && v & /*autoplay*/ + y[3]) && s[l ? "pause" : "play"](), c && WF(c.update) && v & /*autoplay*/ 128 && c.update.call(null, { autoplay: ( /*autoplay*/ y[7] ?? !1 - ) }); + ) }), (!h || v & /*fullscreen*/ + 1024) && cr( + s, + "fullscreen", + /*fullscreen*/ + y[10] + ), (!h || v & /*small*/ + 2048) && cr( + s, + "small", + /*small*/ + y[11] + ); }, i(y) { - h || (kF(g, y), h = !0); + h || (JF(g, y), h = !0); }, o(y) { - RF(g, y), h = !1; + eP(g, y), h = !1; }, d(y) { - y && (Zo(e), Zo(i), Zo(s)), g && g.d(y), n[22](null), d = !1, wF(f); + y && (_l(e), _l(i), _l(s)), g && g.d(y), n[24](null), d = !1, XF(f); } }; } -function OF(n, e, t) { - let { $$slots: i = {}, $$scope: s } = e, { src: r = void 0 } = e, { muted: a = void 0 } = e, { playsinline: o = void 0 } = e, { preload: u = void 0 } = e, { autoplay: l = void 0 } = e, { controls: c = void 0 } = e, { loop: h } = e, { currentTime: d = void 0 } = e, { duration: f = void 0 } = e, { paused: m = void 0 } = e, { node: g = void 0 } = e, { is_stream: p } = e, { processingVideo: y = !1 } = e, v, _ = !1, E; - const T = FF(); - function A(I, R, M) { - if (!(!I || !R) && Vt.isSupported() && !_) { - const P = new Vt({ - // Low-latency configuration +function sP(n, e, t) { + let { $$slots: i = {}, $$scope: s } = e, { src: r = void 0 } = e, { muted: a = void 0 } = e, { playsinline: o = void 0 } = e, { preload: u = void 0 } = e, { autoplay: l = void 0 } = e, { controls: c = void 0 } = e, { loop: h } = e, { fullscreen: d = !1 } = e, { small: f = !1 } = e, { node: m = void 0 } = e, { is_stream: g } = e, { processingVideo: p = !1 } = e, { currentTime: y = void 0 } = e, { duration: v = void 0 } = e, { paused: _ = void 0 } = e, E, T = !1, x; + const S = iP(); + function D(k, q, K) { + if (!(!k || !q) && Yt.isSupported() && !T) { + const H = new Yt({ maxBufferLength: 1, maxMaxBufferLength: 1, lowLatencyMode: !0 }); - P.loadSource(I), P.attachMedia(M), P.on(Vt.Events.MANIFEST_PARSED, function() { - M.play(); - }), P.on(Vt.Events.ERROR, function(K, q) { - if (q.fatal) - switch (q.type) { - case Vt.ErrorTypes.NETWORK_ERROR: - P.startLoad(); + H.loadSource(k), H.attachMedia(K), H.on(Yt.Events.MANIFEST_PARSED, () => K.play()), H.on(Yt.Events.ERROR, (Y, B) => { + if (B.fatal) + switch (B.type) { + case Yt.ErrorTypes.NETWORK_ERROR: + H.startLoad(); break; - case Vt.ErrorTypes.MEDIA_ERROR: - P.recoverMediaError(); + case Yt.ErrorTypes.MEDIA_ERROR: + H.recoverMediaError(); break; default: - P.destroy(); + H.destroy(); break; } - }), _ = !0; + }), T = !0; } } - function S() { - d = this.currentTime, t(1, d); + function A() { + y = this.currentTime, t(1, y); } - function D() { - f = this.duration, t(2, f); + function w() { + v = this.duration, t(2, v); } - function x() { - m = this.paused, t(3, m); + function I() { + _ = this.paused, t(3, _); } - function w(I) { - _F[I ? "unshift" : "push"](() => { - g = I, t(0, g); + function M(k) { + UF[k ? "unshift" : "push"](() => { + m = k, t(0, m); }); } - return n.$$set = (I) => { - t(13, e = L0(L0({}, e), R0(I))), "src" in I && t(14, r = I.src), "muted" in I && t(4, a = I.muted), "playsinline" in I && t(5, o = I.playsinline), "preload" in I && t(6, u = I.preload), "autoplay" in I && t(7, l = I.autoplay), "controls" in I && t(8, c = I.controls), "loop" in I && t(9, h = I.loop), "currentTime" in I && t(1, d = I.currentTime), "duration" in I && t(2, f = I.duration), "paused" in I && t(3, m = I.paused), "node" in I && t(0, g = I.node), "is_stream" in I && t(15, p = I.is_stream), "processingVideo" in I && t(10, y = I.processingVideo), "$$scope" in I && t(17, s = I.$$scope); + return n.$$set = (k) => { + t(15, e = K0(K0({}, e), W0(k))), "src" in k && t(16, r = k.src), "muted" in k && t(4, a = k.muted), "playsinline" in k && t(5, o = k.playsinline), "preload" in k && t(6, u = k.preload), "autoplay" in k && t(7, l = k.autoplay), "controls" in k && t(8, c = k.controls), "loop" in k && t(9, h = k.loop), "fullscreen" in k && t(10, d = k.fullscreen), "small" in k && t(11, f = k.small), "node" in k && t(0, m = k.node), "is_stream" in k && t(17, g = k.is_stream), "processingVideo" in k && t(12, p = k.processingVideo), "currentTime" in k && t(1, y = k.currentTime), "duration" in k && t(2, v = k.duration), "paused" in k && t(3, _ = k.paused), "$$scope" in k && t(19, s = k.$$scope); }, n.$$.update = () => { if (n.$$.dirty & /*src, latest_src*/ - 81920) { - t(11, v = r), t(16, E = r); - const I = r; - dI(I).then((R) => { - E === I && t(11, v = R); + 327680) { + t(13, E = r), t(18, x = r); + const k = r; + OI(k).then((q) => { + x === k && t(13, E = q); }); } n.$$.dirty & /*src*/ - 16384 && (_ = !1), n.$$.dirty & /*node, src, is_stream*/ - 49153 && g && r && p && A(r, p, g); - }, e = R0(e), [ - g, - d, - f, + 65536 && (T = !1), n.$$.dirty & /*node, src, is_stream*/ + 196609 && m && r && g && D(r, g, m); + }, e = W0(e), [ m, + y, + v, + _, a, o, u, l, c, h, - y, - v, - T, - e, - r, + d, + f, p, E, - s, - i, S, - D, + e, + r, + g, x, - w + s, + i, + A, + w, + I, + M ]; } -class MF extends mF { +class rP extends $F { constructor(e) { - super(), AF(this, e, OF, PF, LF, { - src: 14, + super(), zF(this, e, sP, nP, QF, { + src: 16, muted: 4, playsinline: 5, preload: 6, autoplay: 7, controls: 8, loop: 9, + fullscreen: 10, + small: 11, + node: 0, + is_stream: 17, + processingVideo: 12, currentTime: 1, duration: 2, - paused: 3, - node: 0, - is_stream: 15, - processingVideo: 10 + paused: 3 }); } get src() { - return this.$$.ctx[14]; + return this.$$.ctx[16]; } set src(e) { - this.$$set({ src: e }), Bt(); + this.$$set({ src: e }), Dt(); } get muted() { return this.$$.ctx[4]; } set muted(e) { - this.$$set({ muted: e }), Bt(); + this.$$set({ muted: e }), Dt(); } get playsinline() { return this.$$.ctx[5]; } set playsinline(e) { - this.$$set({ playsinline: e }), Bt(); + this.$$set({ playsinline: e }), Dt(); } get preload() { return this.$$.ctx[6]; } set preload(e) { - this.$$set({ preload: e }), Bt(); + this.$$set({ preload: e }), Dt(); } get autoplay() { return this.$$.ctx[7]; } set autoplay(e) { - this.$$set({ autoplay: e }), Bt(); + this.$$set({ autoplay: e }), Dt(); } get controls() { return this.$$.ctx[8]; } set controls(e) { - this.$$set({ controls: e }), Bt(); + this.$$set({ controls: e }), Dt(); } get loop() { return this.$$.ctx[9]; } set loop(e) { - this.$$set({ loop: e }), Bt(); - } - get currentTime() { - return this.$$.ctx[1]; + this.$$set({ loop: e }), Dt(); } - set currentTime(e) { - this.$$set({ currentTime: e }), Bt(); - } - get duration() { - return this.$$.ctx[2]; + get fullscreen() { + return this.$$.ctx[10]; } - set duration(e) { - this.$$set({ duration: e }), Bt(); + set fullscreen(e) { + this.$$set({ fullscreen: e }), Dt(); } - get paused() { - return this.$$.ctx[3]; + get small() { + return this.$$.ctx[11]; } - set paused(e) { - this.$$set({ paused: e }), Bt(); + set small(e) { + this.$$set({ small: e }), Dt(); } get node() { return this.$$.ctx[0]; } set node(e) { - this.$$set({ node: e }), Bt(); + this.$$set({ node: e }), Dt(); } get is_stream() { - return this.$$.ctx[15]; + return this.$$.ctx[17]; } set is_stream(e) { - this.$$set({ is_stream: e }), Bt(); + this.$$set({ is_stream: e }), Dt(); } get processingVideo() { - return this.$$.ctx[10]; + return this.$$.ctx[12]; } set processingVideo(e) { - this.$$set({ processingVideo: e }), Bt(); + this.$$set({ processingVideo: e }), Dt(); + } + get currentTime() { + return this.$$.ctx[1]; + } + set currentTime(e) { + this.$$set({ currentTime: e }), Dt(); + } + get duration() { + return this.$$.ctx[2]; + } + set duration(e) { + this.$$set({ duration: e }), Dt(); + } + get paused() { + return this.$$.ctx[3]; + } + set paused(e) { + this.$$set({ paused: e }), Dt(); } } const { - SvelteComponent: $F, - append_hydration: Js, - attr: St, - children: pa, - claim_element: _s, - claim_space: gh, - destroy_block: BF, - detach: Dn, - element: vs, - ensure_array_like: P0, - get_svelte_dataset: NF, - init: UF, - insert_hydration: pu, - listen: er, - noop: Sd, - run_all: GF, - safe_not_equal: HF, - set_style: Bn, - space: ph, - src_url_equal: O0, - update_keyed_each: VF -} = window.__gradio__svelte__internal, { onMount: qF, onDestroy: KF } = window.__gradio__svelte__internal; -function M0(n, e, t) { + SvelteComponent: aP, + append_hydration: hr, + attr: It, + children: wa, + claim_element: Ts, + claim_space: Oh, + destroy_block: oP, + detach: In, + element: Ss, + ensure_array_like: X0, + get_svelte_dataset: lP, + init: uP, + insert_hydration: $u, + listen: dr, + noop: qd, + run_all: cP, + safe_not_equal: hP, + set_style: jn, + space: Mh, + src_url_equal: Q0, + update_keyed_each: dP +} = window.__gradio__svelte__internal, { onMount: fP, onDestroy: mP } = window.__gradio__svelte__internal; +function Z0(n, e, t) { const i = n.slice(); return i[19] = e[t], i[21] = t, i; } -function jF(n) { - let e, t, i, s, r, a = [], o = /* @__PURE__ */ new Map(), u, l, c, h, d = P0( +function gP(n) { + let e, t, i, s, r, a = [], o = /* @__PURE__ */ new Map(), u, l, c, h, d = X0( /*thumbnails*/ n[1] ); @@ -33460,87 +33563,87 @@ function jF(n) { m[21] ); for (let m = 0; m < d.length; m += 1) { - let g = M0(n, d, m), p = f(g); - o.set(p, a[m] = $0(p, g)); + let g = Z0(n, d, m), p = f(g); + o.set(p, a[m] = J0(p, g)); } return { c() { - e = vs("div"), t = vs("button"), i = ph(), s = vs("div"), r = ph(); + e = Ss("div"), t = Ss("button"), i = Mh(), s = Ss("div"), r = Mh(); for (let m = 0; m < a.length; m += 1) a[m].c(); - u = ph(), l = vs("button"), this.h(); + u = Mh(), l = Ss("button"), this.h(); }, l(m) { - e = _s(m, "DIV", { id: !0, class: !0 }); - var g = pa(e); - t = _s(g, "BUTTON", { + e = Ts(m, "DIV", { id: !0, class: !0 }); + var g = wa(e); + t = Ts(g, "BUTTON", { "aria-label": !0, class: !0, style: !0 - }), pa(t).forEach(Dn), i = gh(g), s = _s(g, "DIV", { class: !0, style: !0 }), pa(s).forEach(Dn), r = gh(g); + }), wa(t).forEach(In), i = Oh(g), s = Ts(g, "DIV", { class: !0, style: !0 }), wa(s).forEach(In), r = Oh(g); for (let p = 0; p < a.length; p += 1) a[p].l(g); - u = gh(g), l = _s(g, "BUTTON", { + u = Oh(g), l = Ts(g, "BUTTON", { "aria-label": !0, class: !0, style: !0 - }), pa(l).forEach(Dn), g.forEach(Dn), this.h(); + }), wa(l).forEach(In), g.forEach(In), this.h(); }, h() { - St(t, "aria-label", "start drag handle for trimming video"), St(t, "class", "handle left svelte-kn3uji"), Bn( + It(t, "aria-label", "start drag handle for trimming video"), It(t, "class", "handle left svelte-kn3uji"), jn( t, "left", /*leftHandlePosition*/ n[2] + "%" - ), St(s, "class", "opaque-layer svelte-kn3uji"), Bn( + ), It(s, "class", "opaque-layer svelte-kn3uji"), jn( s, "left", /*leftHandlePosition*/ n[2] + "%" - ), Bn(s, "right", 100 - /*rightHandlePosition*/ - n[3] + "%"), St(l, "aria-label", "end drag handle for trimming video"), St(l, "class", "handle right svelte-kn3uji"), Bn( + ), jn(s, "right", 100 - /*rightHandlePosition*/ + n[3] + "%"), It(l, "aria-label", "end drag handle for trimming video"), It(l, "class", "handle right svelte-kn3uji"), jn( l, "left", /*rightHandlePosition*/ n[3] + "%" - ), St(e, "id", "timeline"), St(e, "class", "thumbnail-wrapper svelte-kn3uji"); + ), It(e, "id", "timeline"), It(e, "class", "thumbnail-wrapper svelte-kn3uji"); }, m(m, g) { - pu(m, e, g), Js(e, t), Js(e, i), Js(e, s), Js(e, r); + $u(m, e, g), hr(e, t), hr(e, i), hr(e, s), hr(e, r); for (let p = 0; p < a.length; p += 1) a[p] && a[p].m(e, null); - Js(e, u), Js(e, l), c || (h = [ - er( + hr(e, u), hr(e, l), c || (h = [ + dr( t, "mousedown", /*mousedown_handler*/ n[10] ), - er( + dr( t, "blur", /*stopDragging*/ n[5] ), - er( + dr( t, "keydown", /*keydown_handler*/ n[11] ), - er( + dr( l, "mousedown", /*mousedown_handler_1*/ n[12] ), - er( + dr( l, "blur", /*stopDragging*/ n[5] ), - er( + dr( l, "keydown", /*keydown_handler_1*/ @@ -33550,25 +33653,25 @@ function jF(n) { }, p(m, g) { g & /*leftHandlePosition*/ - 4 && Bn( + 4 && jn( t, "left", /*leftHandlePosition*/ m[2] + "%" ), g & /*leftHandlePosition*/ - 4 && Bn( + 4 && jn( s, "left", /*leftHandlePosition*/ m[2] + "%" ), g & /*rightHandlePosition*/ - 8 && Bn(s, "right", 100 - /*rightHandlePosition*/ + 8 && jn(s, "right", 100 - /*rightHandlePosition*/ m[3] + "%"), g & /*thumbnails*/ - 2 && (d = P0( + 2 && (d = X0( /*thumbnails*/ m[1] - ), a = VF(a, g, f, 1, m, d, o, e, BF, $0, u, M0)), g & /*rightHandlePosition*/ - 8 && Bn( + ), a = dP(a, g, f, 1, m, d, o, e, oP, J0, u, Z0)), g & /*rightHandlePosition*/ + 8 && jn( l, "left", /*rightHandlePosition*/ @@ -33576,44 +33679,44 @@ function jF(n) { ); }, d(m) { - m && Dn(e); + m && In(e); for (let g = 0; g < a.length; g += 1) a[g].d(); - c = !1, GF(h); + c = !1, cP(h); } }; } -function zF(n) { +function pP(n) { let e, t = '<span aria-label="loading timeline" class="loader svelte-kn3uji"></span>'; return { c() { - e = vs("div"), e.innerHTML = t, this.h(); + e = Ss("div"), e.innerHTML = t, this.h(); }, l(i) { - e = _s(i, "DIV", { class: !0, "data-svelte-h": !0 }), NF(e) !== "svelte-13yzice" && (e.innerHTML = t), this.h(); + e = Ts(i, "DIV", { class: !0, "data-svelte-h": !0 }), lP(e) !== "svelte-13yzice" && (e.innerHTML = t), this.h(); }, h() { - St(e, "class", "load-wrap svelte-kn3uji"); + It(e, "class", "load-wrap svelte-kn3uji"); }, m(i, s) { - pu(i, e, s); + $u(i, e, s); }, - p: Sd, + p: qd, d(i) { - i && Dn(e); + i && In(e); } }; } -function $0(n, e) { +function J0(n, e) { let t, i, s; return { key: n, first: null, c() { - t = vs("img"), this.h(); + t = Ss("img"), this.h(); }, l(r) { - t = _s(r, "IMG", { + t = Ts(r, "IMG", { src: !0, alt: !0, draggable: !0, @@ -33621,120 +33724,120 @@ function $0(n, e) { }), this.h(); }, h() { - O0(t.src, i = /*thumbnail*/ - e[19]) || St(t, "src", i), St(t, "alt", s = `frame-${/*i*/ - e[21]}`), St(t, "draggable", "false"), St(t, "class", "svelte-kn3uji"), this.first = t; + Q0(t.src, i = /*thumbnail*/ + e[19]) || It(t, "src", i), It(t, "alt", s = `frame-${/*i*/ + e[21]}`), It(t, "draggable", "false"), It(t, "class", "svelte-kn3uji"), this.first = t; }, m(r, a) { - pu(r, t, a); + $u(r, t, a); }, p(r, a) { e = r, a & /*thumbnails*/ - 2 && !O0(t.src, i = /*thumbnail*/ - e[19]) && St(t, "src", i), a & /*thumbnails*/ + 2 && !Q0(t.src, i = /*thumbnail*/ + e[19]) && It(t, "src", i), a & /*thumbnails*/ 2 && s !== (s = `frame-${/*i*/ - e[21]}`) && St(t, "alt", s); + e[21]}`) && It(t, "alt", s); }, d(r) { - r && Dn(t); + r && In(t); } }; } -function WF(n) { +function _P(n) { let e; function t(r, a) { return ( /*loadingTimeline*/ - r[0] ? zF : jF + r[0] ? pP : gP ); } let i = t(n), s = i(n); return { c() { - e = vs("div"), s.c(), this.h(); + e = Ss("div"), s.c(), this.h(); }, l(r) { - e = _s(r, "DIV", { class: !0 }); - var a = pa(e); - s.l(a), a.forEach(Dn), this.h(); + e = Ts(r, "DIV", { class: !0 }); + var a = wa(e); + s.l(a), a.forEach(In), this.h(); }, h() { - St(e, "class", "container svelte-kn3uji"); + It(e, "class", "container svelte-kn3uji"); }, m(r, a) { - pu(r, e, a), s.m(e, null); + $u(r, e, a), s.m(e, null); }, p(r, [a]) { i === (i = t(r)) && s ? s.p(r, a) : (s.d(1), s = i(r), s && (s.c(), s.m(e, null))); }, - i: Sd, - o: Sd, + i: qd, + o: qd, d(r) { - r && Dn(e), s.d(); + r && In(e), s.d(); } }; } -let _h = 10; -function YF(n, e, t) { +let $h = 10; +function vP(n, e, t) { let { videoElement: i } = e, { trimmedDuration: s } = e, { dragStart: r } = e, { dragEnd: a } = e, { loadingTimeline: o } = e, u = [], l, c = 0, h = 100, d = null; - const f = (A) => { - d = A; + const f = (x) => { + d = x; }, m = () => { d = null; - }, g = (A, S) => { + }, g = (x, S) => { if (d) { const D = document.getElementById("timeline"); if (!D) return; - const x = D.getBoundingClientRect(); + const A = D.getBoundingClientRect(); let w; - if (S ? w = d === "left" ? c + S : h + S : w = (A.clientX - x.left) / x.width * 100, w = Math.max(0, Math.min(w, 100)), d === "left") { + if (S ? w = d === "left" ? c + S : h + S : w = (x.clientX - A.left) / A.width * 100, w = Math.max(0, Math.min(w, 100)), d === "left") { t(2, c = Math.min(w, h)); - const M = c / 100 * l; - t(6, i.currentTime = M, i), t(8, r = M); + const k = c / 100 * l; + t(6, i.currentTime = k, i), t(8, r = k); } else if (d === "right") { t(3, h = Math.max(w, c)); - const M = h / 100 * l; - t(6, i.currentTime = M, i), t(9, a = M); + const k = h / 100 * l; + t(6, i.currentTime = k, i), t(9, a = k); } - const I = c / 100 * l, R = h / 100 * l; - t(7, s = R - I); + const I = c / 100 * l, M = h / 100 * l; + t(7, s = M - I); } - }, p = (A) => { + }, p = (x) => { if (d) { const S = 1 / l * 100; - A.key === "ArrowLeft" ? g({ clientX: 0 }, -S) : A.key === "ArrowRight" && g({ clientX: 0 }, S); + x.key === "ArrowLeft" ? g({ clientX: 0 }, -S) : x.key === "ArrowRight" && g({ clientX: 0 }, S); } }, y = () => { - const A = document.createElement("canvas"), S = A.getContext("2d"); + const x = document.createElement("canvas"), S = x.getContext("2d"); if (!S) return; - A.width = i.videoWidth, A.height = i.videoHeight, S.drawImage(i, 0, 0, A.width, A.height); - const D = A.toDataURL("image/jpeg", 0.7); + x.width = i.videoWidth, x.height = i.videoHeight, S.drawImage(i, 0, 0, x.width, x.height); + const D = x.toDataURL("image/jpeg", 0.7); t(1, u = [...u, D]); }; - qF(() => { - const A = () => { + fP(() => { + const x = () => { l = i.duration, t(9, a = l); - const S = l / _h; + const S = l / $h; let D = 0; - const x = () => { - y(), D++, D < _h ? t(6, i.currentTime += S, i) : i.removeEventListener("seeked", x); + const A = () => { + y(), D++, D < $h ? t(6, i.currentTime += S, i) : i.removeEventListener("seeked", A); }; - i.addEventListener("seeked", x), t(6, i.currentTime = 0, i); + i.addEventListener("seeked", A), t(6, i.currentTime = 0, i); }; - i.readyState >= 1 ? A() : i.addEventListener("loadedmetadata", A), window.addEventListener("mousemove", g), window.addEventListener("mouseup", m), window.addEventListener("keydown", p); - }), KF(() => { + i.readyState >= 1 ? x() : i.addEventListener("loadedmetadata", x), window.addEventListener("mousemove", g), window.addEventListener("mouseup", m), window.addEventListener("keydown", p); + }), mP(() => { window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", m), window.removeEventListener("keydown", p); }); - const v = () => f("left"), _ = (A) => { - (A.key === "ArrowLeft" || A.key == "ArrowRight") && f("left"); - }, E = () => f("right"), T = (A) => { - (A.key === "ArrowLeft" || A.key == "ArrowRight") && f("right"); + const v = () => f("left"), _ = (x) => { + (x.key === "ArrowLeft" || x.key == "ArrowRight") && f("left"); + }, E = () => f("right"), T = (x) => { + (x.key === "ArrowLeft" || x.key == "ArrowRight") && f("right"); }; - return n.$$set = (A) => { - "videoElement" in A && t(6, i = A.videoElement), "trimmedDuration" in A && t(7, s = A.trimmedDuration), "dragStart" in A && t(8, r = A.dragStart), "dragEnd" in A && t(9, a = A.dragEnd), "loadingTimeline" in A && t(0, o = A.loadingTimeline); + return n.$$set = (x) => { + "videoElement" in x && t(6, i = x.videoElement), "trimmedDuration" in x && t(7, s = x.trimmedDuration), "dragStart" in x && t(8, r = x.dragStart), "dragEnd" in x && t(9, a = x.dragEnd), "loadingTimeline" in x && t(0, o = x.loadingTimeline); }, n.$$.update = () => { n.$$.dirty & /*thumbnails*/ - 2 && t(0, o = u.length !== _h); + 2 && t(0, o = u.length !== $h); }, [ o, u, @@ -33752,9 +33855,9 @@ function YF(n, e, t) { T ]; } -class XF extends $F { +class yP extends aP { constructor(e) { - super(), UF(this, e, YF, WF, HF, { + super(), uP(this, e, vP, _P, hP, { videoElement: 6, trimmedDuration: 7, dragStart: 8, @@ -33764,9 +33867,9 @@ class XF extends $F { } } new Intl.Collator(0, { numeric: 1 }).compare; -async function If(n, e) { +async function Xf(n, e) { return n.map( - (t) => new QF({ + (t) => new EP({ path: t.name, orig_name: t.name, blob: t, @@ -33776,7 +33879,7 @@ async function If(n, e) { }) ); } -class QF { +class EP { constructor({ path: e, url: t, @@ -33792,13 +33895,13 @@ class QF { } } typeof process < "u" && process.versions && process.versions.node; -var xn; -class Dj extends TransformStream { +var Ln; +class Bj extends TransformStream { /** Constructs a new instance. */ constructor(t = { allowCR: !1 }) { super({ transform: (i, s) => { - for (i = ue(this, xn) + i; ; ) { + for (i = ce(this, Ln) + i; ; ) { const r = i.indexOf(` `), a = t.allowCR ? i.indexOf("\r") : -1; if (a !== -1 && a !== i.length - 1 && (r === -1 || r - 1 > a)) { @@ -33810,115 +33913,115 @@ class Dj extends TransformStream { const o = i[r - 1] === "\r" ? r - 1 : r; s.enqueue(i.slice(0, o)), i = i.slice(r + 1); } - $s(this, xn, i); + Ws(this, Ln, i); }, flush: (i) => { - if (ue(this, xn) === "") + if (ce(this, Ln) === "") return; - const s = t.allowCR && ue(this, xn).endsWith("\r") ? ue(this, xn).slice(0, -1) : ue(this, xn); + const s = t.allowCR && ce(this, Ln).endsWith("\r") ? ce(this, Ln).slice(0, -1) : ce(this, Ln); i.enqueue(s); } }); - Mi(this, xn, ""); + Gi(this, Ln, ""); } } -xn = new WeakMap(); -function ZF(n) { - return JF(n) && !eP(n); +Ln = new WeakMap(); +function bP(n) { + return TP(n) && !SP(n); } -function JF(n) { +function TP(n) { return !!n && typeof n == "object"; } -function eP(n) { +function SP(n) { var e = Object.prototype.toString.call(n); - return e === "[object RegExp]" || e === "[object Date]" || nP(n); + return e === "[object RegExp]" || e === "[object Date]" || DP(n); } -var tP = typeof Symbol == "function" && Symbol.for, iP = tP ? Symbol.for("react.element") : 60103; -function nP(n) { - return n.$$typeof === iP; +var AP = typeof Symbol == "function" && Symbol.for, xP = AP ? Symbol.for("react.element") : 60103; +function DP(n) { + return n.$$typeof === xP; } -var sP = ZF; -function rP(n) { +var wP = bP; +function LP(n) { return Array.isArray(n) ? [] : {}; } -function Ha(n, e) { - return e.clone !== !1 && e.isMergeableObject(n) ? xr(rP(n), n, e) : n; +function eo(n, e) { + return e.clone !== !1 && e.isMergeableObject(n) ? Pr(LP(n), n, e) : n; } -function aP(n, e, t) { +function IP(n, e, t) { return n.concat(e).map(function(i) { - return Ha(i, t); + return eo(i, t); }); } -function oP(n, e) { +function kP(n, e) { if (!e.customMerge) - return xr; + return Pr; var t = e.customMerge(n); - return typeof t == "function" ? t : xr; + return typeof t == "function" ? t : Pr; } -function lP(n) { +function RP(n) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(n).filter(function(e) { return Object.propertyIsEnumerable.call(n, e); }) : []; } -function B0(n) { - return Object.keys(n).concat(lP(n)); +function e_(n) { + return Object.keys(n).concat(RP(n)); } -function xE(n, e) { +function GE(n, e) { try { return e in n; } catch { return !1; } } -function uP(n, e) { - return xE(n, e) && !(Object.hasOwnProperty.call(n, e) && Object.propertyIsEnumerable.call(n, e)); +function CP(n, e) { + return GE(n, e) && !(Object.hasOwnProperty.call(n, e) && Object.propertyIsEnumerable.call(n, e)); } -function cP(n, e, t) { +function FP(n, e, t) { var i = {}; - return t.isMergeableObject(n) && B0(n).forEach(function(s) { - i[s] = Ha(n[s], t); - }), B0(e).forEach(function(s) { - uP(n, s) || (xE(n, s) && t.isMergeableObject(e[s]) ? i[s] = oP(s, t)(n[s], e[s], t) : i[s] = Ha(e[s], t)); + return t.isMergeableObject(n) && e_(n).forEach(function(s) { + i[s] = eo(n[s], t); + }), e_(e).forEach(function(s) { + CP(n, s) || (GE(n, s) && t.isMergeableObject(e[s]) ? i[s] = kP(s, t)(n[s], e[s], t) : i[s] = eo(e[s], t)); }), i; } -function xr(n, e, t) { - t = t || {}, t.arrayMerge = t.arrayMerge || aP, t.isMergeableObject = t.isMergeableObject || sP, t.cloneUnlessOtherwiseSpecified = Ha; +function Pr(n, e, t) { + t = t || {}, t.arrayMerge = t.arrayMerge || IP, t.isMergeableObject = t.isMergeableObject || wP, t.cloneUnlessOtherwiseSpecified = eo; var i = Array.isArray(e), s = Array.isArray(n), r = i === s; - return r ? i ? t.arrayMerge(n, e, t) : cP(n, e, t) : Ha(e, t); + return r ? i ? t.arrayMerge(n, e, t) : FP(n, e, t) : eo(e, t); } -xr.all = function(e, t) { +Pr.all = function(e, t) { if (!Array.isArray(e)) throw new Error("first argument should be an array"); return e.reduce(function(i, s) { - return xr(i, s, t); + return Pr(i, s, t); }, {}); }; -var Ad = function(n, e) { - return Ad = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) { +var Kd = function(n, e) { + return Kd = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) { t.__proto__ = i; } || function(t, i) { for (var s in i) Object.prototype.hasOwnProperty.call(i, s) && (t[s] = i[s]); - }, Ad(n, e); + }, Kd(n, e); }; -function _u(n, e) { +function Bu(n, e) { if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null"); - Ad(n, e); + Kd(n, e); function t() { this.constructor = n; } n.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t()); } -var Te = function() { - return Te = Object.assign || function(e) { +var Ae = function() { + return Ae = Object.assign || function(e) { for (var t, i = 1, s = arguments.length; i < s; i++) { t = arguments[i]; for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]); } return e; - }, Te.apply(this, arguments); + }, Ae.apply(this, arguments); }; -function vh(n, e, t) { +function Bh(n, e, t) { if (t || arguments.length === 2) for (var i = 0, s = e.length, r; i < s; i++) (r || !(i in e)) && (r || (r = Array.prototype.slice.call(e, 0, i)), r[i] = e[i]); return n.concat(r || Array.prototype.slice.call(e)); @@ -33927,51 +34030,51 @@ var pe; (function(n) { n[n.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", n[n.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", n[n.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", n[n.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", n[n.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", n[n.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", n[n.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", n[n.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", n[n.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", n[n.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", n[n.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", n[n.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", n[n.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", n[n.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", n[n.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", n[n.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", n[n.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", n[n.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", n[n.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", n[n.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", n[n.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", n[n.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", n[n.INVALID_TAG = 23] = "INVALID_TAG", n[n.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", n[n.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", n[n.UNCLOSED_TAG = 27] = "UNCLOSED_TAG"; })(pe || (pe = {})); -var $e; +var Ne; (function(n) { n[n.literal = 0] = "literal", n[n.argument = 1] = "argument", n[n.number = 2] = "number", n[n.date = 3] = "date", n[n.time = 4] = "time", n[n.select = 5] = "select", n[n.plural = 6] = "plural", n[n.pound = 7] = "pound", n[n.tag = 8] = "tag"; -})($e || ($e = {})); -var Dr; +})(Ne || (Ne = {})); +var Or; (function(n) { n[n.number = 0] = "number", n[n.dateTime = 1] = "dateTime"; -})(Dr || (Dr = {})); -function N0(n) { - return n.type === $e.literal; +})(Or || (Or = {})); +function t_(n) { + return n.type === Ne.literal; } -function hP(n) { - return n.type === $e.argument; +function PP(n) { + return n.type === Ne.argument; } -function DE(n) { - return n.type === $e.number; +function HE(n) { + return n.type === Ne.number; } -function wE(n) { - return n.type === $e.date; +function VE(n) { + return n.type === Ne.date; } -function LE(n) { - return n.type === $e.time; +function qE(n) { + return n.type === Ne.time; } -function IE(n) { - return n.type === $e.select; +function KE(n) { + return n.type === Ne.select; } -function kE(n) { - return n.type === $e.plural; +function jE(n) { + return n.type === Ne.plural; } -function dP(n) { - return n.type === $e.pound; +function OP(n) { + return n.type === Ne.pound; } -function RE(n) { - return n.type === $e.tag; +function zE(n) { + return n.type === Ne.tag; } -function CE(n) { - return !!(n && typeof n == "object" && n.type === Dr.number); +function WE(n) { + return !!(n && typeof n == "object" && n.type === Or.number); } -function xd(n) { - return !!(n && typeof n == "object" && n.type === Dr.dateTime); +function jd(n) { + return !!(n && typeof n == "object" && n.type === Or.dateTime); } -var FE = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, fP = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; -function mP(n) { +var YE = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, MP = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; +function $P(n) { var e = {}; - return n.replace(fP, function(t) { + return n.replace(MP, function(t) { var i = t.length; switch (t[0]) { case "G": @@ -34060,11 +34163,11 @@ function mP(n) { return ""; }), e; } -var gP = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; -function pP(n) { +var BP = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; +function NP(n) { if (n.length === 0) throw new Error("Number skeleton cannot be empty"); - for (var e = n.split(gP).filter(function(d) { + for (var e = n.split(BP).filter(function(d) { return d.length > 0; }), t = [], i = 0, s = e; i < s.length; i++) { var r = s[i], a = r.split("/"); @@ -34079,17 +34182,17 @@ function pP(n) { } return t; } -function _P(n) { +function UP(n) { return n.replace(/^(.*?)-/, ""); } -var U0 = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, PE = /^(@+)?(\+|#+)?[rs]?$/g, vP = /(\*)(0+)|(#+)(0+)|(0+)/g, OE = /^(0+)$/; -function G0(n) { +var i_ = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, XE = /^(@+)?(\+|#+)?[rs]?$/g, GP = /(\*)(0+)|(#+)(0+)|(0+)/g, QE = /^(0+)$/; +function n_(n) { var e = {}; - return n[n.length - 1] === "r" ? e.roundingPriority = "morePrecision" : n[n.length - 1] === "s" && (e.roundingPriority = "lessPrecision"), n.replace(PE, function(t, i, s) { + return n[n.length - 1] === "r" ? e.roundingPriority = "morePrecision" : n[n.length - 1] === "s" && (e.roundingPriority = "lessPrecision"), n.replace(XE, function(t, i, s) { return typeof s != "string" ? (e.minimumSignificantDigits = i.length, e.maximumSignificantDigits = i.length) : s === "+" ? e.minimumSignificantDigits = i.length : i[0] === "#" ? e.maximumSignificantDigits = i.length : (e.minimumSignificantDigits = i.length, e.maximumSignificantDigits = i.length + (typeof s == "string" ? s.length : 0)), ""; }), e; } -function ME(n) { +function ZE(n) { switch (n) { case "sign-auto": return { @@ -34129,7 +34232,7 @@ function ME(n) { }; } } -function yP(n) { +function HP(n) { var e; if (n[0] === "E" && n[1] === "E" ? (e = { notation: "engineering" @@ -34137,17 +34240,17 @@ function yP(n) { notation: "scientific" }, n = n.slice(1)), e) { var t = n.slice(0, 2); - if (t === "+!" ? (e.signDisplay = "always", n = n.slice(2)) : t === "+?" && (e.signDisplay = "exceptZero", n = n.slice(2)), !OE.test(n)) + if (t === "+!" ? (e.signDisplay = "always", n = n.slice(2)) : t === "+?" && (e.signDisplay = "exceptZero", n = n.slice(2)), !QE.test(n)) throw new Error("Malformed concise eng/scientific notation"); e.minimumIntegerDigits = n.length; } return e; } -function H0(n) { - var e = {}, t = ME(n); +function s_(n) { + var e = {}, t = ZE(n); return t || e; } -function EP(n) { +function VP(n) { for (var e = {}, t = 0, i = n; t < i.length; t++) { var s = i[t]; switch (s.stem) { @@ -34171,7 +34274,7 @@ function EP(n) { continue; case "measure-unit": case "unit": - e.style = "unit", e.unit = _P(s.options[0]); + e.style = "unit", e.unit = UP(s.options[0]); continue; case "compact-short": case "K": @@ -34182,13 +34285,13 @@ function EP(n) { e.notation = "compact", e.compactDisplay = "long"; continue; case "scientific": - e = Te(Te(Te({}, e), { notation: "scientific" }), s.options.reduce(function(u, l) { - return Te(Te({}, u), H0(l)); + e = Ae(Ae(Ae({}, e), { notation: "scientific" }), s.options.reduce(function(u, l) { + return Ae(Ae({}, u), s_(l)); }, {})); continue; case "engineering": - e = Te(Te(Te({}, e), { notation: "engineering" }), s.options.reduce(function(u, l) { - return Te(Te({}, u), H0(l)); + e = Ae(Ae(Ae({}, e), { notation: "engineering" }), s.options.reduce(function(u, l) { + return Ae(Ae({}, u), s_(l)); }, {})); continue; case "notation-simple": @@ -34212,7 +34315,7 @@ function EP(n) { case "integer-width": if (s.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); - s.options[0].replace(vP, function(u, l, c, h, d, f) { + s.options[0].replace(GP, function(u, l, c, h, d, f) { if (l) e.minimumIntegerDigits = c.length; else { @@ -34225,32 +34328,32 @@ function EP(n) { }); continue; } - if (OE.test(s.stem)) { + if (QE.test(s.stem)) { e.minimumIntegerDigits = s.stem.length; continue; } - if (U0.test(s.stem)) { + if (i_.test(s.stem)) { if (s.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); - s.stem.replace(U0, function(u, l, c, h, d, f) { + s.stem.replace(i_, function(u, l, c, h, d, f) { return c === "*" ? e.minimumFractionDigits = l.length : h && h[0] === "#" ? e.maximumFractionDigits = h.length : d && f ? (e.minimumFractionDigits = d.length, e.maximumFractionDigits = d.length + f.length) : (e.minimumFractionDigits = l.length, e.maximumFractionDigits = l.length), ""; }); var r = s.options[0]; - r === "w" ? e = Te(Te({}, e), { trailingZeroDisplay: "stripIfInteger" }) : r && (e = Te(Te({}, e), G0(r))); + r === "w" ? e = Ae(Ae({}, e), { trailingZeroDisplay: "stripIfInteger" }) : r && (e = Ae(Ae({}, e), n_(r))); continue; } - if (PE.test(s.stem)) { - e = Te(Te({}, e), G0(s.stem)); + if (XE.test(s.stem)) { + e = Ae(Ae({}, e), n_(s.stem)); continue; } - var a = ME(s.stem); - a && (e = Te(Te({}, e), a)); - var o = yP(s.stem); - o && (e = Te(Te({}, e), o)); + var a = ZE(s.stem); + a && (e = Ae(Ae({}, e), a)); + var o = HP(s.stem); + o && (e = Ae(Ae({}, e), o)); } return e; } -var Jo = { +var vl = { AX: [ "H" ], @@ -35587,13 +35690,13 @@ var Jo = { "h" ] }; -function bP(n, e) { +function qP(n, e) { for (var t = "", i = 0; i < n.length; i++) { var s = n.charAt(i); if (s === "j") { for (var r = 0; i + 1 < n.length && n.charAt(i + 1) === s; ) r++, i++; - var a = 1 + (r & 1), o = r < 2 ? 1 : 3 + (r >> 1), u = "a", l = TP(e); + var a = 1 + (r & 1), o = r < 2 ? 1 : 3 + (r >> 1), u = "a", l = KP(e); for ((l == "H" || l == "k") && (o = 0); o-- > 0; ) t += u; for (; a-- > 0; ) @@ -35602,7 +35705,7 @@ function bP(n, e) { } return t; } -function TP(n) { +function KP(n) { var e = n.hourCycle; if (e === void 0 && // @ts-ignore hourCycle(s) is not identified yet n.hourCycles && // @ts-ignore @@ -35621,23 +35724,23 @@ function TP(n) { } var t = n.language, i; t !== "root" && (i = n.maximize().region); - var s = Jo[i || ""] || Jo[t || ""] || Jo["".concat(t, "-001")] || Jo["001"]; + var s = vl[i || ""] || vl[t || ""] || vl["".concat(t, "-001")] || vl["001"]; return s[0]; } -var yh, SP = new RegExp("^".concat(FE.source, "*")), AP = new RegExp("".concat(FE.source, "*$")); +var Nh, jP = new RegExp("^".concat(YE.source, "*")), zP = new RegExp("".concat(YE.source, "*$")); function _e(n, e) { return { start: n, end: e }; } -var xP = !!String.prototype.startsWith, DP = !!String.fromCodePoint, wP = !!Object.fromEntries, LP = !!String.prototype.codePointAt, IP = !!String.prototype.trimStart, kP = !!String.prototype.trimEnd, RP = !!Number.isSafeInteger, CP = RP ? Number.isSafeInteger : function(n) { +var WP = !!String.prototype.startsWith, YP = !!String.fromCodePoint, XP = !!Object.fromEntries, QP = !!String.prototype.codePointAt, ZP = !!String.prototype.trimStart, JP = !!String.prototype.trimEnd, eO = !!Number.isSafeInteger, tO = eO ? Number.isSafeInteger : function(n) { return typeof n == "number" && isFinite(n) && Math.floor(n) === n && Math.abs(n) <= 9007199254740991; -}, Dd = !0; +}, zd = !0; try { - var FP = BE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - Dd = ((yh = FP.exec("a")) === null || yh === void 0 ? void 0 : yh[0]) === "a"; + var iO = e1("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + zd = ((Nh = iO.exec("a")) === null || Nh === void 0 ? void 0 : Nh[0]) === "a"; } catch { - Dd = !1; + zd = !1; } -var V0 = xP ? ( +var r_ = WP ? ( // Native function(e, t, i) { return e.startsWith(t, i); @@ -35647,7 +35750,7 @@ var V0 = xP ? ( function(e, t, i) { return e.slice(i, i + t.length) === t; } -), wd = DP ? String.fromCodePoint : ( +), Wd = YP ? String.fromCodePoint : ( // IE11 function() { for (var e = [], t = 0; t < arguments.length; t++) @@ -35659,9 +35762,9 @@ var V0 = xP ? ( } return i; } -), q0 = ( +), a_ = ( // native - wP ? Object.fromEntries : ( + XP ? Object.fromEntries : ( // Ponyfill function(e) { for (var t = {}, i = 0, s = e; i < s.length; i++) { @@ -35671,7 +35774,7 @@ var V0 = xP ? ( return t; } ) -), $E = LP ? ( +), JE = QP ? ( // Native function(e, t) { return e.codePointAt(t); @@ -35685,7 +35788,7 @@ var V0 = xP ? ( return s < 55296 || s > 56319 || t + 1 === i || (r = e.charCodeAt(t + 1)) < 56320 || r > 57343 ? s : (s - 55296 << 10) + (r - 56320) + 65536; } } -), PP = IP ? ( +), nO = ZP ? ( // Native function(e) { return e.trimStart(); @@ -35693,9 +35796,9 @@ var V0 = xP ? ( ) : ( // Ponyfill function(e) { - return e.replace(SP, ""); + return e.replace(jP, ""); } -), OP = kP ? ( +), sO = JP ? ( // Native function(e) { return e.trimEnd(); @@ -35703,32 +35806,32 @@ var V0 = xP ? ( ) : ( // Ponyfill function(e) { - return e.replace(AP, ""); + return e.replace(zP, ""); } ); -function BE(n, e) { +function e1(n, e) { return new RegExp(n, e); } -var Ld; -if (Dd) { - var K0 = BE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); - Ld = function(e, t) { +var Yd; +if (zd) { + var o_ = e1("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); + Yd = function(e, t) { var i; - K0.lastIndex = t; - var s = K0.exec(e); + o_.lastIndex = t; + var s = o_.exec(e); return (i = s[1]) !== null && i !== void 0 ? i : ""; }; } else - Ld = function(e, t) { + Yd = function(e, t) { for (var i = []; ; ) { - var s = $E(e, t); - if (s === void 0 || NE(s) || NP(s)) + var s = JE(e, t); + if (s === void 0 || t1(s) || lO(s)) break; i.push(s), t += s >= 65536 ? 2 : 1; } - return wd.apply(void 0, i); + return Wd.apply(void 0, i); }; -var MP = ( +var rO = ( /** @class */ function() { function n(e, t) { @@ -35752,14 +35855,14 @@ var MP = ( if (r === 35 && (t === "plural" || t === "selectordinal")) { var o = this.clonePosition(); this.bump(), s.push({ - type: $e.pound, + type: Ne.pound, location: _e(o, this.clonePosition()) }); } else if (r === 60 && !this.ignoreTag && this.peek() === 47) { if (i) break; return this.error(pe.UNMATCHED_CLOSING_TAG, _e(this.clonePosition(), this.clonePosition())); - } else if (r === 60 && !this.ignoreTag && Id(this.peek() || 0)) { + } else if (r === 60 && !this.ignoreTag && Xd(this.peek() || 0)) { var a = this.parseTag(e, t); if (a.err) return a; @@ -35780,7 +35883,7 @@ var MP = ( if (this.bumpSpace(), this.bumpIf("/>")) return { val: { - type: $e.literal, + type: Ne.literal, value: "<".concat(s, "/>"), location: _e(i, this.clonePosition()) }, @@ -35792,12 +35895,12 @@ var MP = ( return r; var a = r.val, o = this.clonePosition(); if (this.bumpIf("</")) { - if (this.isEOF() || !Id(this.char())) + if (this.isEOF() || !Xd(this.char())) return this.error(pe.INVALID_TAG, _e(o, this.clonePosition())); var u = this.clonePosition(), l = this.parseTagName(); return s !== l ? this.error(pe.UNMATCHED_CLOSING_TAG, _e(u, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? { val: { - type: $e.tag, + type: Ne.tag, value: s, children: a, location: _e(i, this.clonePosition()) @@ -35810,7 +35913,7 @@ var MP = ( return this.error(pe.INVALID_TAG, _e(i, this.clonePosition())); }, n.prototype.parseTagName = function() { var e = this.offset(); - for (this.bump(); !this.isEOF() && BP(this.char()); ) + for (this.bump(); !this.isEOF() && oO(this.char()); ) this.bump(); return this.message.slice(e, this.offset()); }, n.prototype.parseLiteral = function(e, t) { @@ -35834,12 +35937,12 @@ var MP = ( } var u = _e(i, this.clonePosition()); return { - val: { type: $e.literal, value: s, location: u }, + val: { type: Ne.literal, value: s, location: u }, err: null }; }, n.prototype.tryParseLeftAngleBracket = function() { return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail. - !$P(this.peek() || 0)) ? (this.bump(), "<") : null; + !aO(this.peek() || 0)) ? (this.bump(), "<") : null; }, n.prototype.tryParseQuote = function(e) { if (this.isEOF() || this.char() !== 39) return null; @@ -35873,12 +35976,12 @@ var MP = ( t.push(i); this.bump(); } - return wd.apply(void 0, t); + return Wd.apply(void 0, t); }, n.prototype.tryParseUnquoted = function(e, t) { if (this.isEOF()) return null; var i = this.char(); - return i === 60 || i === 123 || i === 35 && (t === "plural" || t === "selectordinal") || i === 125 && e > 0 ? null : (this.bump(), wd(i)); + return i === 60 || i === 123 || i === 35 && (t === "plural" || t === "selectordinal") || i === 125 && e > 0 ? null : (this.bump(), Wd(i)); }, n.prototype.parseArgument = function(e, t) { var i = this.clonePosition(); if (this.bump(), this.bumpSpace(), this.isEOF()) @@ -35894,7 +35997,7 @@ var MP = ( case 125: return this.bump(), { val: { - type: $e.argument, + type: Ne.argument, // value does not include the opening and closing braces. value: s, location: _e(i, this.clonePosition()) @@ -35907,7 +36010,7 @@ var MP = ( return this.error(pe.MALFORMED_ARGUMENT, _e(i, this.clonePosition())); } }, n.prototype.parseIdentifierIfPossible = function() { - var e = this.clonePosition(), t = this.offset(), i = Ld(this.message, t), s = t + i.length; + var e = this.clonePosition(), t = this.offset(), i = Yd(this.message, t), s = t + i.length; this.bumpTo(s); var r = this.clonePosition(), a = _e(e, r); return { value: i, location: a }; @@ -35926,7 +36029,7 @@ var MP = ( var c = this.clonePosition(), h = this.parseSimpleArgStyleIfPossible(); if (h.err) return h; - var d = OP(h.val); + var d = sO(h.val); if (d.length === 0) return this.error(pe.EXPECT_ARGUMENT_STYLE, _e(this.clonePosition(), this.clonePosition())); var f = _e(c, this.clonePosition()); @@ -35936,25 +36039,25 @@ var MP = ( if (m.err) return m; var g = _e(s, this.clonePosition()); - if (l && V0(l == null ? void 0 : l.style, "::", 0)) { - var p = PP(l.style.slice(2)); + if (l && r_(l == null ? void 0 : l.style, "::", 0)) { + var p = nO(l.style.slice(2)); if (o === "number") { var h = this.parseNumberSkeletonFromString(p, l.styleLocation); return h.err ? h : { - val: { type: $e.number, value: i, location: g, style: h.val }, + val: { type: Ne.number, value: i, location: g, style: h.val }, err: null }; } else { if (p.length === 0) return this.error(pe.EXPECT_DATE_TIME_SKELETON, g); var y = p; - this.locale && (y = bP(p, this.locale)); + this.locale && (y = qP(p, this.locale)); var d = { - type: Dr.dateTime, + type: Or.dateTime, pattern: y, location: l.styleLocation, - parsedOptions: this.shouldParseSkeletons ? mP(y) : {} - }, v = o === "date" ? $e.date : $e.time; + parsedOptions: this.shouldParseSkeletons ? $P(y) : {} + }, v = o === "date" ? Ne.date : Ne.time; return { val: { type: v, value: i, location: g, style: d }, err: null @@ -35963,7 +36066,7 @@ var MP = ( } return { val: { - type: o === "number" ? $e.number : o === "date" ? $e.date : $e.time, + type: o === "number" ? Ne.number : o === "date" ? Ne.date : Ne.time, value: i, location: g, style: (r = l == null ? void 0 : l.style) !== null && r !== void 0 ? r : null @@ -35976,7 +36079,7 @@ var MP = ( case "select": { var _ = this.clonePosition(); if (this.bumpSpace(), !this.bumpIf(",")) - return this.error(pe.EXPECT_SELECT_ARGUMENT_OPTIONS, _e(_, Te({}, _))); + return this.error(pe.EXPECT_SELECT_ARGUMENT_OPTIONS, _e(_, Ae({}, _))); this.bumpSpace(); var E = this.parseIdentifierIfPossible(), T = 0; if (o !== "select" && E.value === "offset") { @@ -35988,26 +36091,26 @@ var MP = ( return h; this.bumpSpace(), E = this.parseIdentifierIfPossible(), T = h.val; } - var A = this.tryParsePluralOrSelectOptions(e, o, t, E); - if (A.err) - return A; + var x = this.tryParsePluralOrSelectOptions(e, o, t, E); + if (x.err) + return x; var m = this.tryParseArgumentClose(s); if (m.err) return m; var S = _e(s, this.clonePosition()); return o === "select" ? { val: { - type: $e.select, + type: Ne.select, value: i, - options: q0(A.val), + options: a_(x.val), location: S }, err: null } : { val: { - type: $e.plural, + type: Ne.plural, value: i, - options: q0(A.val), + options: a_(x.val), offset: T, pluralType: o === "plural" ? "cardinal" : "ordinal", location: S @@ -36058,16 +36161,16 @@ var MP = ( }, n.prototype.parseNumberSkeletonFromString = function(e, t) { var i = []; try { - i = pP(e); + i = NP(e); } catch { return this.error(pe.INVALID_NUMBER_SKELETON, t); } return { val: { - type: Dr.number, + type: Or.number, tokens: i, location: t, - parsedOptions: this.shouldParseSkeletons ? EP(i) : {} + parsedOptions: this.shouldParseSkeletons ? VP(i) : {} }, err: null }; @@ -36115,7 +36218,7 @@ var MP = ( break; } var u = _e(s, this.clonePosition()); - return r ? (a *= i, CP(a) ? { val: a, err: null } : this.error(t, u)) : this.error(e, u); + return r ? (a *= i, tO(a) ? { val: a, err: null } : this.error(t, u)) : this.error(e, u); }, n.prototype.offset = function() { return this.position.offset; }, n.prototype.isEOF = function() { @@ -36130,7 +36233,7 @@ var MP = ( var e = this.position.offset; if (e >= this.message.length) throw Error("out of bound"); - var t = $E(this.message, e); + var t = JE(this.message, e); if (t === void 0) throw Error("Offset ".concat(e, " is at invalid UTF-16 code unit boundary")); return t; @@ -36149,7 +36252,7 @@ var MP = ( e === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += e < 65536 ? 1 : 2); } }, n.prototype.bumpIf = function(e) { - if (V0(this.message, e, this.offset())) { + if (r_(this.message, e, this.offset())) { for (var t = 0; t < e.length; t++) this.bump(); return !0; @@ -36171,7 +36274,7 @@ var MP = ( break; } }, n.prototype.bumpSpace = function() { - for (; !this.isEOF() && NE(this.char()); ) + for (; !this.isEOF() && t1(this.char()); ) this.bump(); }, n.prototype.peek = function() { if (this.isEOF()) @@ -36181,92 +36284,92 @@ var MP = ( }, n; }() ); -function Id(n) { +function Xd(n) { return n >= 97 && n <= 122 || n >= 65 && n <= 90; } -function $P(n) { - return Id(n) || n === 47; +function aO(n) { + return Xd(n) || n === 47; } -function BP(n) { +function oO(n) { return n === 45 || n === 46 || n >= 48 && n <= 57 || n === 95 || n >= 97 && n <= 122 || n >= 65 && n <= 90 || n == 183 || n >= 192 && n <= 214 || n >= 216 && n <= 246 || n >= 248 && n <= 893 || n >= 895 && n <= 8191 || n >= 8204 && n <= 8205 || n >= 8255 && n <= 8256 || n >= 8304 && n <= 8591 || n >= 11264 && n <= 12271 || n >= 12289 && n <= 55295 || n >= 63744 && n <= 64975 || n >= 65008 && n <= 65533 || n >= 65536 && n <= 983039; } -function NE(n) { +function t1(n) { return n >= 9 && n <= 13 || n === 32 || n === 133 || n >= 8206 && n <= 8207 || n === 8232 || n === 8233; } -function NP(n) { +function lO(n) { return n >= 33 && n <= 35 || n === 36 || n >= 37 && n <= 39 || n === 40 || n === 41 || n === 42 || n === 43 || n === 44 || n === 45 || n >= 46 && n <= 47 || n >= 58 && n <= 59 || n >= 60 && n <= 62 || n >= 63 && n <= 64 || n === 91 || n === 92 || n === 93 || n === 94 || n === 96 || n === 123 || n === 124 || n === 125 || n === 126 || n === 161 || n >= 162 && n <= 165 || n === 166 || n === 167 || n === 169 || n === 171 || n === 172 || n === 174 || n === 176 || n === 177 || n === 182 || n === 187 || n === 191 || n === 215 || n === 247 || n >= 8208 && n <= 8213 || n >= 8214 && n <= 8215 || n === 8216 || n === 8217 || n === 8218 || n >= 8219 && n <= 8220 || n === 8221 || n === 8222 || n === 8223 || n >= 8224 && n <= 8231 || n >= 8240 && n <= 8248 || n === 8249 || n === 8250 || n >= 8251 && n <= 8254 || n >= 8257 && n <= 8259 || n === 8260 || n === 8261 || n === 8262 || n >= 8263 && n <= 8273 || n === 8274 || n === 8275 || n >= 8277 && n <= 8286 || n >= 8592 && n <= 8596 || n >= 8597 && n <= 8601 || n >= 8602 && n <= 8603 || n >= 8604 && n <= 8607 || n === 8608 || n >= 8609 && n <= 8610 || n === 8611 || n >= 8612 && n <= 8613 || n === 8614 || n >= 8615 && n <= 8621 || n === 8622 || n >= 8623 && n <= 8653 || n >= 8654 && n <= 8655 || n >= 8656 && n <= 8657 || n === 8658 || n === 8659 || n === 8660 || n >= 8661 && n <= 8691 || n >= 8692 && n <= 8959 || n >= 8960 && n <= 8967 || n === 8968 || n === 8969 || n === 8970 || n === 8971 || n >= 8972 && n <= 8991 || n >= 8992 && n <= 8993 || n >= 8994 && n <= 9e3 || n === 9001 || n === 9002 || n >= 9003 && n <= 9083 || n === 9084 || n >= 9085 && n <= 9114 || n >= 9115 && n <= 9139 || n >= 9140 && n <= 9179 || n >= 9180 && n <= 9185 || n >= 9186 && n <= 9254 || n >= 9255 && n <= 9279 || n >= 9280 && n <= 9290 || n >= 9291 && n <= 9311 || n >= 9472 && n <= 9654 || n === 9655 || n >= 9656 && n <= 9664 || n === 9665 || n >= 9666 && n <= 9719 || n >= 9720 && n <= 9727 || n >= 9728 && n <= 9838 || n === 9839 || n >= 9840 && n <= 10087 || n === 10088 || n === 10089 || n === 10090 || n === 10091 || n === 10092 || n === 10093 || n === 10094 || n === 10095 || n === 10096 || n === 10097 || n === 10098 || n === 10099 || n === 10100 || n === 10101 || n >= 10132 && n <= 10175 || n >= 10176 && n <= 10180 || n === 10181 || n === 10182 || n >= 10183 && n <= 10213 || n === 10214 || n === 10215 || n === 10216 || n === 10217 || n === 10218 || n === 10219 || n === 10220 || n === 10221 || n === 10222 || n === 10223 || n >= 10224 && n <= 10239 || n >= 10240 && n <= 10495 || n >= 10496 && n <= 10626 || n === 10627 || n === 10628 || n === 10629 || n === 10630 || n === 10631 || n === 10632 || n === 10633 || n === 10634 || n === 10635 || n === 10636 || n === 10637 || n === 10638 || n === 10639 || n === 10640 || n === 10641 || n === 10642 || n === 10643 || n === 10644 || n === 10645 || n === 10646 || n === 10647 || n === 10648 || n >= 10649 && n <= 10711 || n === 10712 || n === 10713 || n === 10714 || n === 10715 || n >= 10716 && n <= 10747 || n === 10748 || n === 10749 || n >= 10750 && n <= 11007 || n >= 11008 && n <= 11055 || n >= 11056 && n <= 11076 || n >= 11077 && n <= 11078 || n >= 11079 && n <= 11084 || n >= 11085 && n <= 11123 || n >= 11124 && n <= 11125 || n >= 11126 && n <= 11157 || n === 11158 || n >= 11159 && n <= 11263 || n >= 11776 && n <= 11777 || n === 11778 || n === 11779 || n === 11780 || n === 11781 || n >= 11782 && n <= 11784 || n === 11785 || n === 11786 || n === 11787 || n === 11788 || n === 11789 || n >= 11790 && n <= 11798 || n === 11799 || n >= 11800 && n <= 11801 || n === 11802 || n === 11803 || n === 11804 || n === 11805 || n >= 11806 && n <= 11807 || n === 11808 || n === 11809 || n === 11810 || n === 11811 || n === 11812 || n === 11813 || n === 11814 || n === 11815 || n === 11816 || n === 11817 || n >= 11818 && n <= 11822 || n === 11823 || n >= 11824 && n <= 11833 || n >= 11834 && n <= 11835 || n >= 11836 && n <= 11839 || n === 11840 || n === 11841 || n === 11842 || n >= 11843 && n <= 11855 || n >= 11856 && n <= 11857 || n === 11858 || n >= 11859 && n <= 11903 || n >= 12289 && n <= 12291 || n === 12296 || n === 12297 || n === 12298 || n === 12299 || n === 12300 || n === 12301 || n === 12302 || n === 12303 || n === 12304 || n === 12305 || n >= 12306 && n <= 12307 || n === 12308 || n === 12309 || n === 12310 || n === 12311 || n === 12312 || n === 12313 || n === 12314 || n === 12315 || n === 12316 || n === 12317 || n >= 12318 && n <= 12319 || n === 12320 || n === 12336 || n === 64830 || n === 64831 || n >= 65093 && n <= 65094; } -function kd(n) { +function Qd(n) { n.forEach(function(e) { - if (delete e.location, IE(e) || kE(e)) + if (delete e.location, KE(e) || jE(e)) for (var t in e.options) - delete e.options[t].location, kd(e.options[t].value); - else DE(e) && CE(e.style) || (wE(e) || LE(e)) && xd(e.style) ? delete e.style.location : RE(e) && kd(e.children); + delete e.options[t].location, Qd(e.options[t].value); + else HE(e) && WE(e.style) || (VE(e) || qE(e)) && jd(e.style) ? delete e.style.location : zE(e) && Qd(e.children); }); } -function UP(n, e) { - e === void 0 && (e = {}), e = Te({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, e); - var t = new MP(n, e).parse(); +function uO(n, e) { + e === void 0 && (e = {}), e = Ae({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, e); + var t = new rO(n, e).parse(); if (t.err) { var i = SyntaxError(pe[t.err.kind]); throw i.location = t.err.location, i.originalMessage = t.err.message, i; } - return e != null && e.captureLocation || kd(t.val), t.val; + return e != null && e.captureLocation || Qd(t.val), t.val; } -function Eh(n, e) { - var t = e && e.cache ? e.cache : jP, i = e && e.serializer ? e.serializer : KP, s = e && e.strategy ? e.strategy : VP; +function Uh(n, e) { + var t = e && e.cache ? e.cache : gO, i = e && e.serializer ? e.serializer : mO, s = e && e.strategy ? e.strategy : dO; return s(n, { cache: t, serializer: i }); } -function GP(n) { +function cO(n) { return n == null || typeof n == "number" || typeof n == "boolean"; } -function HP(n, e, t, i) { - var s = GP(i) ? i : t(i), r = e.get(s); +function hO(n, e, t, i) { + var s = cO(i) ? i : t(i), r = e.get(s); return typeof r > "u" && (r = n.call(this, i), e.set(s, r)), r; } -function UE(n, e, t) { +function i1(n, e, t) { var i = Array.prototype.slice.call(arguments, 3), s = t(i), r = e.get(s); return typeof r > "u" && (r = n.apply(this, i), e.set(s, r)), r; } -function GE(n, e, t, i, s) { +function n1(n, e, t, i, s) { return t.bind(e, n, i, s); } -function VP(n, e) { - var t = n.length === 1 ? HP : UE; - return GE(n, this, t, e.cache.create(), e.serializer); +function dO(n, e) { + var t = n.length === 1 ? hO : i1; + return n1(n, this, t, e.cache.create(), e.serializer); } -function qP(n, e) { - return GE(n, this, UE, e.cache.create(), e.serializer); +function fO(n, e) { + return n1(n, this, i1, e.cache.create(), e.serializer); } -var KP = function() { +var mO = function() { return JSON.stringify(arguments); }; -function kf() { +function Qf() { this.cache = /* @__PURE__ */ Object.create(null); } -kf.prototype.get = function(n) { +Qf.prototype.get = function(n) { return this.cache[n]; }; -kf.prototype.set = function(n, e) { +Qf.prototype.set = function(n, e) { this.cache[n] = e; }; -var jP = { +var gO = { create: function() { - return new kf(); + return new Qf(); } -}, bh = { - variadic: qP -}, wr; +}, Gh = { + variadic: fO +}, Mr; (function(n) { n.MISSING_VALUE = "MISSING_VALUE", n.INVALID_VALUE = "INVALID_VALUE", n.MISSING_INTL_API = "MISSING_INTL_API"; -})(wr || (wr = {})); -var vu = ( +})(Mr || (Mr = {})); +var Nu = ( /** @class */ function(n) { - _u(e, n); + Bu(e, n); function e(t, i, s) { var r = n.call(this, t) || this; return r.code = i, r.originalMessage = s, r; @@ -36275,155 +36378,155 @@ var vu = ( return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); }, e; }(Error) -), j0 = ( +), l_ = ( /** @class */ function(n) { - _u(e, n); + Bu(e, n); function e(t, i, s, r) { - return n.call(this, 'Invalid values for "'.concat(t, '": "').concat(i, '". Options are "').concat(Object.keys(s).join('", "'), '"'), wr.INVALID_VALUE, r) || this; + return n.call(this, 'Invalid values for "'.concat(t, '": "').concat(i, '". Options are "').concat(Object.keys(s).join('", "'), '"'), Mr.INVALID_VALUE, r) || this; } return e; - }(vu) -), zP = ( + }(Nu) +), pO = ( /** @class */ function(n) { - _u(e, n); + Bu(e, n); function e(t, i, s) { - return n.call(this, 'Value for "'.concat(t, '" must be of type ').concat(i), wr.INVALID_VALUE, s) || this; + return n.call(this, 'Value for "'.concat(t, '" must be of type ').concat(i), Mr.INVALID_VALUE, s) || this; } return e; - }(vu) -), WP = ( + }(Nu) +), _O = ( /** @class */ function(n) { - _u(e, n); + Bu(e, n); function e(t, i) { - return n.call(this, 'The intl string context variable "'.concat(t, '" was not provided to the string "').concat(i, '"'), wr.MISSING_VALUE, i) || this; + return n.call(this, 'The intl string context variable "'.concat(t, '" was not provided to the string "').concat(i, '"'), Mr.MISSING_VALUE, i) || this; } return e; - }(vu) -), Tt; + }(Nu) +), Lt; (function(n) { n[n.literal = 0] = "literal", n[n.object = 1] = "object"; -})(Tt || (Tt = {})); -function YP(n) { +})(Lt || (Lt = {})); +function vO(n) { return n.length < 2 ? n : n.reduce(function(e, t) { var i = e[e.length - 1]; - return !i || i.type !== Tt.literal || t.type !== Tt.literal ? e.push(t) : i.value += t.value, e; + return !i || i.type !== Lt.literal || t.type !== Lt.literal ? e.push(t) : i.value += t.value, e; }, []); } -function XP(n) { +function yO(n) { return typeof n == "function"; } -function Sl(n, e, t, i, s, r, a) { - if (n.length === 1 && N0(n[0])) +function Hl(n, e, t, i, s, r, a) { + if (n.length === 1 && t_(n[0])) return [ { - type: Tt.literal, + type: Lt.literal, value: n[0].value } ]; for (var o = [], u = 0, l = n; u < l.length; u++) { var c = l[u]; - if (N0(c)) { + if (t_(c)) { o.push({ - type: Tt.literal, + type: Lt.literal, value: c.value }); continue; } - if (dP(c)) { + if (OP(c)) { typeof r == "number" && o.push({ - type: Tt.literal, + type: Lt.literal, value: t.getNumberFormat(e).format(r) }); continue; } var h = c.value; if (!(s && h in s)) - throw new WP(h, a); + throw new _O(h, a); var d = s[h]; - if (hP(c)) { + if (PP(c)) { (!d || typeof d == "string" || typeof d == "number") && (d = typeof d == "string" || typeof d == "number" ? String(d) : ""), o.push({ - type: typeof d == "string" ? Tt.literal : Tt.object, + type: typeof d == "string" ? Lt.literal : Lt.object, value: d }); continue; } - if (wE(c)) { - var f = typeof c.style == "string" ? i.date[c.style] : xd(c.style) ? c.style.parsedOptions : void 0; + if (VE(c)) { + var f = typeof c.style == "string" ? i.date[c.style] : jd(c.style) ? c.style.parsedOptions : void 0; o.push({ - type: Tt.literal, + type: Lt.literal, value: t.getDateTimeFormat(e, f).format(d) }); continue; } - if (LE(c)) { - var f = typeof c.style == "string" ? i.time[c.style] : xd(c.style) ? c.style.parsedOptions : i.time.medium; + if (qE(c)) { + var f = typeof c.style == "string" ? i.time[c.style] : jd(c.style) ? c.style.parsedOptions : i.time.medium; o.push({ - type: Tt.literal, + type: Lt.literal, value: t.getDateTimeFormat(e, f).format(d) }); continue; } - if (DE(c)) { - var f = typeof c.style == "string" ? i.number[c.style] : CE(c.style) ? c.style.parsedOptions : void 0; + if (HE(c)) { + var f = typeof c.style == "string" ? i.number[c.style] : WE(c.style) ? c.style.parsedOptions : void 0; f && f.scale && (d = d * (f.scale || 1)), o.push({ - type: Tt.literal, + type: Lt.literal, value: t.getNumberFormat(e, f).format(d) }); continue; } - if (RE(c)) { + if (zE(c)) { var m = c.children, g = c.value, p = s[g]; - if (!XP(p)) - throw new zP(g, "function", a); - var y = Sl(m, e, t, i, s, r), v = p(y.map(function(T) { + if (!yO(p)) + throw new pO(g, "function", a); + var y = Hl(m, e, t, i, s, r), v = p(y.map(function(T) { return T.value; })); Array.isArray(v) || (v = [v]), o.push.apply(o, v.map(function(T) { return { - type: typeof T == "string" ? Tt.literal : Tt.object, + type: typeof T == "string" ? Lt.literal : Lt.object, value: T }; })); } - if (IE(c)) { + if (KE(c)) { var _ = c.options[d] || c.options.other; if (!_) - throw new j0(c.value, d, Object.keys(c.options), a); - o.push.apply(o, Sl(_.value, e, t, i, s)); + throw new l_(c.value, d, Object.keys(c.options), a); + o.push.apply(o, Hl(_.value, e, t, i, s)); continue; } - if (kE(c)) { + if (jE(c)) { var _ = c.options["=".concat(d)]; if (!_) { if (!Intl.PluralRules) - throw new vu(`Intl.PluralRules is not available in this environment. + throw new Nu(`Intl.PluralRules is not available in this environment. Try polyfilling it using "@formatjs/intl-pluralrules" -`, wr.MISSING_INTL_API, a); +`, Mr.MISSING_INTL_API, a); var E = t.getPluralRules(e, { type: c.pluralType }).select(d - (c.offset || 0)); _ = c.options[E] || c.options.other; } if (!_) - throw new j0(c.value, d, Object.keys(c.options), a); - o.push.apply(o, Sl(_.value, e, t, i, s, d - (c.offset || 0))); + throw new l_(c.value, d, Object.keys(c.options), a); + o.push.apply(o, Hl(_.value, e, t, i, s, d - (c.offset || 0))); continue; } } - return YP(o); + return vO(o); } -function QP(n, e) { - return e ? Te(Te(Te({}, n || {}), e || {}), Object.keys(n).reduce(function(t, i) { - return t[i] = Te(Te({}, n[i]), e[i] || {}), t; +function EO(n, e) { + return e ? Ae(Ae(Ae({}, n || {}), e || {}), Object.keys(n).reduce(function(t, i) { + return t[i] = Ae(Ae({}, n[i]), e[i] || {}), t; }, {})) : n; } -function ZP(n, e) { +function bO(n, e) { return e ? Object.keys(n).reduce(function(t, i) { - return t[i] = QP(n[i], e[i]), t; - }, Te({}, n)) : n; + return t[i] = EO(n[i], e[i]), t; + }, Ae({}, n)) : n; } -function Th(n) { +function Hh(n) { return { create: function() { return { @@ -36437,39 +36540,39 @@ function Th(n) { } }; } -function JP(n) { +function TO(n) { return n === void 0 && (n = { number: {}, dateTime: {}, pluralRules: {} }), { - getNumberFormat: Eh(function() { + getNumberFormat: Uh(function() { for (var e, t = [], i = 0; i < arguments.length; i++) t[i] = arguments[i]; - return new ((e = Intl.NumberFormat).bind.apply(e, vh([void 0], t, !1)))(); + return new ((e = Intl.NumberFormat).bind.apply(e, Bh([void 0], t, !1)))(); }, { - cache: Th(n.number), - strategy: bh.variadic + cache: Hh(n.number), + strategy: Gh.variadic }), - getDateTimeFormat: Eh(function() { + getDateTimeFormat: Uh(function() { for (var e, t = [], i = 0; i < arguments.length; i++) t[i] = arguments[i]; - return new ((e = Intl.DateTimeFormat).bind.apply(e, vh([void 0], t, !1)))(); + return new ((e = Intl.DateTimeFormat).bind.apply(e, Bh([void 0], t, !1)))(); }, { - cache: Th(n.dateTime), - strategy: bh.variadic + cache: Hh(n.dateTime), + strategy: Gh.variadic }), - getPluralRules: Eh(function() { + getPluralRules: Uh(function() { for (var e, t = [], i = 0; i < arguments.length; i++) t[i] = arguments[i]; - return new ((e = Intl.PluralRules).bind.apply(e, vh([void 0], t, !1)))(); + return new ((e = Intl.PluralRules).bind.apply(e, Bh([void 0], t, !1)))(); }, { - cache: Th(n.pluralRules), - strategy: bh.variadic + cache: Hh(n.pluralRules), + strategy: Gh.variadic }) }; } -var eO = ( +var SO = ( /** @class */ function() { function n(e, t, i, s) { @@ -36483,11 +36586,11 @@ var eO = ( if (o.length === 1) return o[0].value; var u = o.reduce(function(l, c) { - return !l.length || c.type !== Tt.literal || typeof l[l.length - 1] != "string" ? l.push(c.value) : l[l.length - 1] += c.value, l; + return !l.length || c.type !== Lt.literal || typeof l[l.length - 1] != "string" ? l.push(c.value) : l[l.length - 1] += c.value, l; }, []); return u.length <= 1 ? u[0] || "" : u; }, this.formatToParts = function(a) { - return Sl(r.ast, r.locales, r.formatters, r.formats, a, void 0, r.message); + return Hl(r.ast, r.locales, r.formatters, r.formats, a, void 0, r.message); }, this.resolvedOptions = function() { return { locale: r.resolvedLocale.toString() @@ -36505,7 +36608,7 @@ var eO = ( this.ast = e; if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); - this.formats = ZP(n.formats, i), this.formatters = s && s.formatters || JP(this.formatterCache); + this.formats = bO(n.formats, i), this.formatters = s && s.formatters || TO(this.formatterCache); } return Object.defineProperty(n, "defaultLocale", { get: function() { @@ -36516,7 +36619,7 @@ var eO = ( }), n.memoizedDefaultLocale = null, n.resolveLocale = function(e) { var t = Intl.NumberFormat.supportedLocalesOf(e); return t.length > 0 ? new Intl.Locale(t[0]) : new Intl.Locale(typeof e == "string" ? e : e[0]); - }, n.__parse = UP, n.formats = { + }, n.__parse = uO, n.formats = { number: { integer: { maximumFractionDigits: 0 @@ -36577,7 +36680,7 @@ var eO = ( }, n; }() ); -function tO(n, e) { +function AO(n, e) { if (e == null) return; if (e in n) @@ -36598,92 +36701,92 @@ function tO(n, e) { i = void 0; return i; } -const jn = {}, iO = (n, e, t) => t && (e in jn || (jn[e] = {}), n in jn[e] || (jn[e][n] = t), t), HE = (n, e) => { +const Zn = {}, xO = (n, e, t) => t && (e in Zn || (Zn[e] = {}), n in Zn[e] || (Zn[e][n] = t), t), s1 = (n, e) => { if (e == null) return; - if (e in jn && n in jn[e]) - return jn[e][n]; - const t = yu(e); + if (e in Zn && n in Zn[e]) + return Zn[e][n]; + const t = Uu(e); for (let i = 0; i < t.length; i++) { - const s = t[i], r = sO(s, n); + const s = t[i], r = wO(s, n); if (r) - return iO(n, e, r); + return xO(n, e, r); } }; -let Rf; -const no = io({}); -function nO(n) { - return Rf[n] || null; +let Zf; +const vo = _o({}); +function DO(n) { + return Zf[n] || null; } -function VE(n) { - return n in Rf; +function r1(n) { + return n in Zf; } -function sO(n, e) { - if (!VE(n)) +function wO(n, e) { + if (!r1(n)) return null; - const t = nO(n); - return tO(t, e); + const t = DO(n); + return AO(t, e); } -function rO(n) { +function LO(n) { if (n == null) return; - const e = yu(n); + const e = Uu(n); for (let t = 0; t < e.length; t++) { const i = e[t]; - if (VE(i)) + if (r1(i)) return i; } } -function aO(n, ...e) { - delete jn[n], no.update((t) => (t[n] = xr.all([t[n] || {}, ...e]), t)); +function IO(n, ...e) { + delete Zn[n], vo.update((t) => (t[n] = Pr.all([t[n] || {}, ...e]), t)); } -Gr( - [no], +Wr( + [vo], ([n]) => Object.keys(n) ); -no.subscribe((n) => Rf = n); -const Al = {}; -function oO(n, e) { - Al[n].delete(e), Al[n].size === 0 && delete Al[n]; +vo.subscribe((n) => Zf = n); +const Vl = {}; +function kO(n, e) { + Vl[n].delete(e), Vl[n].size === 0 && delete Vl[n]; } -function qE(n) { - return Al[n]; +function a1(n) { + return Vl[n]; } -function lO(n) { - return yu(n).map((e) => { - const t = qE(e); +function RO(n) { + return Uu(n).map((e) => { + const t = a1(e); return [e, t ? [...t] : []]; }).filter(([, e]) => e.length > 0); } -function Rd(n) { - return n == null ? !1 : yu(n).some( +function Zd(n) { + return n == null ? !1 : Uu(n).some( (e) => { var t; - return (t = qE(e)) == null ? void 0 : t.size; + return (t = a1(e)) == null ? void 0 : t.size; } ); } -function uO(n, e) { +function CO(n, e) { return Promise.all( - e.map((i) => (oO(n, i), i().then((s) => s.default || s))) - ).then((i) => aO(n, ...i)); -} -const ca = {}; -function KE(n) { - if (!Rd(n)) - return n in ca ? ca[n] : Promise.resolve(); - const e = lO(n); - return ca[n] = Promise.all( + e.map((i) => (kO(n, i), i().then((s) => s.default || s))) + ).then((i) => IO(n, ...i)); +} +const ba = {}; +function o1(n) { + if (!Zd(n)) + return n in ba ? ba[n] : Promise.resolve(); + const e = RO(n); + return ba[n] = Promise.all( e.map( - ([t, i]) => uO(t, i) + ([t, i]) => CO(t, i) ) ).then(() => { - if (Rd(n)) - return KE(n); - delete ca[n]; - }), ca[n]; + if (Zd(n)) + return o1(n); + delete ba[n]; + }), ba[n]; } -const cO = { +const FO = { number: { scientific: { notation: "scientific" }, engineering: { notation: "engineering" }, @@ -36712,150 +36815,150 @@ const cO = { timeZoneName: "short" } } -}, hO = { +}, PO = { fallbackLocale: null, loadingDelay: 200, - formats: cO, + formats: FO, warnOnMissingMessages: !0, handleMissingMessage: void 0, ignoreTag: !0 -}, dO = hO; -function Lr() { - return dO; +}, OO = PO; +function $r() { + return OO; } -const Sh = io(!1); -var fO = Object.defineProperty, mO = Object.defineProperties, gO = Object.getOwnPropertyDescriptors, z0 = Object.getOwnPropertySymbols, pO = Object.prototype.hasOwnProperty, _O = Object.prototype.propertyIsEnumerable, W0 = (n, e, t) => e in n ? fO(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, vO = (n, e) => { +const Vh = _o(!1); +var MO = Object.defineProperty, $O = Object.defineProperties, BO = Object.getOwnPropertyDescriptors, u_ = Object.getOwnPropertySymbols, NO = Object.prototype.hasOwnProperty, UO = Object.prototype.propertyIsEnumerable, c_ = (n, e, t) => e in n ? MO(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, GO = (n, e) => { for (var t in e || (e = {})) - pO.call(e, t) && W0(n, t, e[t]); - if (z0) - for (var t of z0(e)) - _O.call(e, t) && W0(n, t, e[t]); + NO.call(e, t) && c_(n, t, e[t]); + if (u_) + for (var t of u_(e)) + UO.call(e, t) && c_(n, t, e[t]); return n; -}, yO = (n, e) => mO(n, gO(e)); -let Cd; -const zl = io(null); -function Y0(n) { +}, HO = (n, e) => $O(n, BO(e)); +let Jd; +const hu = _o(null); +function h_(n) { return n.split("-").map((e, t, i) => i.slice(0, t + 1).join("-")).reverse(); } -function yu(n, e = Lr().fallbackLocale) { - const t = Y0(n); - return e ? [.../* @__PURE__ */ new Set([...t, ...Y0(e)])] : t; +function Uu(n, e = $r().fallbackLocale) { + const t = h_(n); + return e ? [.../* @__PURE__ */ new Set([...t, ...h_(e)])] : t; } -function Rs() { - return Cd ?? void 0; +function Hs() { + return Jd ?? void 0; } -zl.subscribe((n) => { - Cd = n ?? void 0, typeof window < "u" && n != null && document.documentElement.setAttribute("lang", n); +hu.subscribe((n) => { + Jd = n ?? void 0, typeof window < "u" && n != null && document.documentElement.setAttribute("lang", n); }); -const EO = (n) => { - if (n && rO(n) && Rd(n)) { - const { loadingDelay: e } = Lr(); +const VO = (n) => { + if (n && LO(n) && Zd(n)) { + const { loadingDelay: e } = $r(); let t; - return typeof window < "u" && Rs() != null && e ? t = window.setTimeout( - () => Sh.set(!0), + return typeof window < "u" && Hs() != null && e ? t = window.setTimeout( + () => Vh.set(!0), e - ) : Sh.set(!0), KE(n).then(() => { - zl.set(n); + ) : Vh.set(!0), o1(n).then(() => { + hu.set(n); }).finally(() => { - clearTimeout(t), Sh.set(!1); + clearTimeout(t), Vh.set(!1); }); } - return zl.set(n); -}, so = yO(vO({}, zl), { - set: EO -}), Eu = (n) => { + return hu.set(n); +}, yo = HO(GO({}, hu), { + set: VO +}), Gu = (n) => { const e = /* @__PURE__ */ Object.create(null); return (i) => { const s = JSON.stringify(i); return s in e ? e[s] : e[s] = n(i); }; }; -var bO = Object.defineProperty, Wl = Object.getOwnPropertySymbols, jE = Object.prototype.hasOwnProperty, zE = Object.prototype.propertyIsEnumerable, X0 = (n, e, t) => e in n ? bO(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Cf = (n, e) => { +var qO = Object.defineProperty, du = Object.getOwnPropertySymbols, l1 = Object.prototype.hasOwnProperty, u1 = Object.prototype.propertyIsEnumerable, d_ = (n, e, t) => e in n ? qO(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Jf = (n, e) => { for (var t in e || (e = {})) - jE.call(e, t) && X0(n, t, e[t]); - if (Wl) - for (var t of Wl(e)) - zE.call(e, t) && X0(n, t, e[t]); + l1.call(e, t) && d_(n, t, e[t]); + if (du) + for (var t of du(e)) + u1.call(e, t) && d_(n, t, e[t]); return n; -}, Hr = (n, e) => { +}, Yr = (n, e) => { var t = {}; for (var i in n) - jE.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]); - if (n != null && Wl) - for (var i of Wl(n)) - e.indexOf(i) < 0 && zE.call(n, i) && (t[i] = n[i]); + l1.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]); + if (n != null && du) + for (var i of du(n)) + e.indexOf(i) < 0 && u1.call(n, i) && (t[i] = n[i]); return t; }; -const Va = (n, e) => { - const { formats: t } = Lr(); +const to = (n, e) => { + const { formats: t } = $r(); if (n in t && e in t[n]) return t[n][e]; throw new Error(`[svelte-i18n] Unknown "${e}" ${n} format.`); -}, TO = Eu( +}, KO = Gu( (n) => { - var e = n, { locale: t, format: i } = e, s = Hr(e, ["locale", "format"]); + var e = n, { locale: t, format: i } = e, s = Yr(e, ["locale", "format"]); if (t == null) throw new Error('[svelte-i18n] A "locale" must be set to format numbers'); - return i && (s = Va("number", i)), new Intl.NumberFormat(t, s); + return i && (s = to("number", i)), new Intl.NumberFormat(t, s); } -), SO = Eu( +), jO = Gu( (n) => { - var e = n, { locale: t, format: i } = e, s = Hr(e, ["locale", "format"]); + var e = n, { locale: t, format: i } = e, s = Yr(e, ["locale", "format"]); if (t == null) throw new Error('[svelte-i18n] A "locale" must be set to format dates'); - return i ? s = Va("date", i) : Object.keys(s).length === 0 && (s = Va("date", "short")), new Intl.DateTimeFormat(t, s); + return i ? s = to("date", i) : Object.keys(s).length === 0 && (s = to("date", "short")), new Intl.DateTimeFormat(t, s); } -), AO = Eu( +), zO = Gu( (n) => { - var e = n, { locale: t, format: i } = e, s = Hr(e, ["locale", "format"]); + var e = n, { locale: t, format: i } = e, s = Yr(e, ["locale", "format"]); if (t == null) throw new Error( '[svelte-i18n] A "locale" must be set to format time values' ); - return i ? s = Va("time", i) : Object.keys(s).length === 0 && (s = Va("time", "short")), new Intl.DateTimeFormat(t, s); + return i ? s = to("time", i) : Object.keys(s).length === 0 && (s = to("time", "short")), new Intl.DateTimeFormat(t, s); } -), xO = (n = {}) => { +), WO = (n = {}) => { var e = n, { - locale: t = Rs() - } = e, i = Hr(e, [ + locale: t = Hs() + } = e, i = Yr(e, [ "locale" ]); - return TO(Cf({ locale: t }, i)); -}, DO = (n = {}) => { + return KO(Jf({ locale: t }, i)); +}, YO = (n = {}) => { var e = n, { - locale: t = Rs() - } = e, i = Hr(e, [ + locale: t = Hs() + } = e, i = Yr(e, [ "locale" ]); - return SO(Cf({ locale: t }, i)); -}, wO = (n = {}) => { + return jO(Jf({ locale: t }, i)); +}, XO = (n = {}) => { var e = n, { - locale: t = Rs() - } = e, i = Hr(e, [ + locale: t = Hs() + } = e, i = Yr(e, [ "locale" ]); - return AO(Cf({ locale: t }, i)); -}, LO = Eu( + return zO(Jf({ locale: t }, i)); +}, QO = Gu( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - (n, e = Rs()) => new eO(n, e, Lr().formats, { - ignoreTag: Lr().ignoreTag + (n, e = Hs()) => new SO(n, e, $r().formats, { + ignoreTag: $r().ignoreTag }) -), IO = (n, e = {}) => { +), ZO = (n, e = {}) => { var t, i, s, r; let a = e; typeof n == "object" && (a = n, n = a.id); const { values: o, - locale: u = Rs(), + locale: u = Hs(), default: l } = a; if (u == null) throw new Error( "[svelte-i18n] Cannot format a message without first setting the initial locale." ); - let c = HE(n, u); + let c = s1(n, u); if (!c) - c = (r = (s = (i = (t = Lr()).handleMissingMessage) == null ? void 0 : i.call(t, { locale: u, id: n, defaultValue: l })) != null ? s : l) != null ? r : n; + c = (r = (s = (i = (t = $r()).handleMissingMessage) == null ? void 0 : i.call(t, { locale: u, id: n, defaultValue: l })) != null ? s : l) != null ? r : n; else if (typeof c != "string") return console.warn( `[svelte-i18n] Message with id "${n}" must be of type "string", found: "${typeof c}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.` @@ -36864,7 +36967,7 @@ const Va = (n, e) => { return c; let h = c; try { - h = LO(c, u).format(o); + h = QO(c, u).format(o); } catch (d) { d instanceof Error && console.warn( `[svelte-i18n] Message "${n}" has syntax error:`, @@ -36872,34 +36975,34 @@ const Va = (n, e) => { ); } return h; -}, kO = (n, e) => wO(e).format(n), RO = (n, e) => DO(e).format(n), CO = (n, e) => xO(e).format(n), FO = (n, e = Rs()) => HE(n, e); -Gr([so, no], () => IO); -Gr([so], () => kO); -Gr([so], () => RO); -Gr([so], () => CO); -Gr([so, no], () => FO); +}, JO = (n, e) => XO(e).format(n), eM = (n, e) => YO(e).format(n), tM = (n, e) => WO(e).format(n), iM = (n, e = Hs()) => s1(n, e); +Wr([yo, vo], () => ZO); +Wr([yo], () => JO); +Wr([yo], () => eM); +Wr([yo], () => tM); +Wr([yo, vo], () => iM); const { - SvelteComponent: PO, - append_hydration: Pt, - attr: hs, - children: ds, - claim_element: fs, - claim_space: Fd, - claim_text: or, - detach: Sn, - element: ms, - init: OO, - insert_hydration: WE, - noop: Q0, - safe_not_equal: MO, - set_data: Yl, - set_style: Ah, - space: Pd, - text: lr, - toggle_class: Z0 -} = window.__gradio__svelte__internal, { onMount: $O, createEventDispatcher: BO, onDestroy: NO } = window.__gradio__svelte__internal; -function J0(n) { - let e, t, i, s, r = _a( + SvelteComponent: nM, + append_hydration: Bt, + attr: ps, + children: _s, + claim_element: vs, + claim_space: ef, + claim_text: yr, + detach: Dn, + element: ys, + init: sM, + insert_hydration: c1, + noop: f_, + safe_not_equal: rM, + set_data: fu, + set_style: qh, + space: tf, + text: Er, + toggle_class: m_ +} = window.__gradio__svelte__internal, { onMount: aM, createEventDispatcher: oM, onDestroy: lM } = window.__gradio__svelte__internal; +function g_(n) { + let e, t, i, s, r = La( /*file_to_display*/ n[2] ) + "", a, o, u, l, c = ( @@ -36908,49 +37011,49 @@ function J0(n) { ), h; return { c() { - e = ms("div"), t = ms("span"), i = ms("div"), s = ms("progress"), a = lr(r), u = Pd(), l = ms("span"), h = lr(c), this.h(); + e = ys("div"), t = ys("span"), i = ys("div"), s = ys("progress"), a = Er(r), u = tf(), l = ys("span"), h = Er(c), this.h(); }, l(d) { - e = fs(d, "DIV", { class: !0 }); - var f = ds(e); - t = fs(f, "SPAN", {}); - var m = ds(t); - i = fs(m, "DIV", { class: !0 }); - var g = ds(i); - s = fs(g, "PROGRESS", { style: !0, max: !0, class: !0 }); - var p = ds(s); - a = or(p, r), p.forEach(Sn), g.forEach(Sn), m.forEach(Sn), u = Fd(f), l = fs(f, "SPAN", { class: !0 }); - var y = ds(l); - h = or(y, c), y.forEach(Sn), f.forEach(Sn), this.h(); + e = vs(d, "DIV", { class: !0 }); + var f = _s(e); + t = vs(f, "SPAN", {}); + var m = _s(t); + i = vs(m, "DIV", { class: !0 }); + var g = _s(i); + s = vs(g, "PROGRESS", { style: !0, max: !0, class: !0 }); + var p = _s(s); + a = yr(p, r), p.forEach(Dn), g.forEach(Dn), m.forEach(Dn), u = ef(f), l = vs(f, "SPAN", { class: !0 }); + var y = _s(l); + h = yr(y, c), y.forEach(Dn), f.forEach(Dn), this.h(); }, h() { - Ah(s, "visibility", "hidden"), Ah(s, "height", "0"), Ah(s, "width", "0"), s.value = o = _a( + qh(s, "visibility", "hidden"), qh(s, "height", "0"), qh(s, "width", "0"), s.value = o = La( /*file_to_display*/ n[2] - ), hs(s, "max", "100"), hs(s, "class", "svelte-cr2edf"), hs(i, "class", "progress-bar svelte-cr2edf"), hs(l, "class", "file-name svelte-cr2edf"), hs(e, "class", "file svelte-cr2edf"); + ), ps(s, "max", "100"), ps(s, "class", "svelte-cr2edf"), ps(i, "class", "progress-bar svelte-cr2edf"), ps(l, "class", "file-name svelte-cr2edf"), ps(e, "class", "file svelte-cr2edf"); }, m(d, f) { - WE(d, e, f), Pt(e, t), Pt(t, i), Pt(i, s), Pt(s, a), Pt(e, u), Pt(e, l), Pt(l, h); + c1(d, e, f), Bt(e, t), Bt(t, i), Bt(i, s), Bt(s, a), Bt(e, u), Bt(e, l), Bt(l, h); }, p(d, f) { f & /*file_to_display*/ - 4 && r !== (r = _a( + 4 && r !== (r = La( /*file_to_display*/ d[2] - ) + "") && Yl(a, r), f & /*file_to_display*/ - 4 && o !== (o = _a( + ) + "") && fu(a, r), f & /*file_to_display*/ + 4 && o !== (o = La( /*file_to_display*/ d[2] )) && (s.value = o), f & /*file_to_display*/ 4 && c !== (c = /*file_to_display*/ - d[2].orig_name + "") && Yl(h, c); + d[2].orig_name + "") && fu(h, c); }, d(d) { - d && Sn(e); + d && Dn(e); } }; } -function UO(n) { +function uM(n) { let e, t, i, s = ( /*files_with_progress*/ n[0].length + "" @@ -36959,21 +37062,21 @@ function UO(n) { n[0].length > 1 ? "files" : "file" ), u, l, c, h = ( /*file_to_display*/ - n[2] && J0(n) + n[2] && g_(n) ); return { c() { - e = ms("div"), t = ms("span"), i = lr("Uploading "), r = lr(s), a = Pd(), u = lr(o), l = lr("..."), c = Pd(), h && h.c(), this.h(); + e = ys("div"), t = ys("span"), i = Er("Uploading "), r = Er(s), a = tf(), u = Er(o), l = Er("..."), c = tf(), h && h.c(), this.h(); }, l(d) { - e = fs(d, "DIV", { class: !0 }); - var f = ds(e); - t = fs(f, "SPAN", { class: !0 }); - var m = ds(t); - i = or(m, "Uploading "), r = or(m, s), a = Fd(m), u = or(m, o), l = or(m, "..."), m.forEach(Sn), c = Fd(f), h && h.l(f), f.forEach(Sn), this.h(); + e = vs(d, "DIV", { class: !0 }); + var f = _s(e); + t = vs(f, "SPAN", { class: !0 }); + var m = _s(t); + i = yr(m, "Uploading "), r = yr(m, s), a = ef(m), u = yr(m, o), l = yr(m, "..."), m.forEach(Dn), c = ef(f), h && h.l(f), f.forEach(Dn), this.h(); }, h() { - hs(t, "class", "uploading svelte-cr2edf"), hs(e, "class", "wrap svelte-cr2edf"), Z0( + ps(t, "class", "uploading svelte-cr2edf"), ps(e, "class", "wrap svelte-cr2edf"), m_( e, "progress", /*progress*/ @@ -36981,39 +37084,39 @@ function UO(n) { ); }, m(d, f) { - WE(d, e, f), Pt(e, t), Pt(t, i), Pt(t, r), Pt(t, a), Pt(t, u), Pt(t, l), Pt(e, c), h && h.m(e, null); + c1(d, e, f), Bt(e, t), Bt(t, i), Bt(t, r), Bt(t, a), Bt(t, u), Bt(t, l), Bt(e, c), h && h.m(e, null); }, p(d, [f]) { f & /*files_with_progress*/ 1 && s !== (s = /*files_with_progress*/ - d[0].length + "") && Yl(r, s), f & /*files_with_progress*/ + d[0].length + "") && fu(r, s), f & /*files_with_progress*/ 1 && o !== (o = /*files_with_progress*/ - d[0].length > 1 ? "files" : "file") && Yl(u, o), /*file_to_display*/ - d[2] ? h ? h.p(d, f) : (h = J0(d), h.c(), h.m(e, null)) : h && (h.d(1), h = null), f & /*progress*/ - 2 && Z0( + d[0].length > 1 ? "files" : "file") && fu(u, o), /*file_to_display*/ + d[2] ? h ? h.p(d, f) : (h = g_(d), h.c(), h.m(e, null)) : h && (h.d(1), h = null), f & /*progress*/ + 2 && m_( e, "progress", /*progress*/ d[1] ); }, - i: Q0, - o: Q0, + i: f_, + o: f_, d(d) { - d && Sn(e), h && h.d(); + d && Dn(e), h && h.d(); } }; } -function _a(n) { +function La(n) { return n.progress * 100 / (n.size || 0) || 0; } -function GO(n) { +function cM(n) { let e = 0; return n.forEach((t) => { - e += _a(t); + e += La(t); }), document.documentElement.style.setProperty("--upload-progress-width", (e / n.length).toFixed(2) + "%"), e / n.length; } -function HO(n, e, t) { +function hM(n, e, t) { var i = this && this.__awaiter || function(g, p, y, v) { function _(E) { return E instanceof y ? E : new y(function(T) { @@ -37021,32 +37124,32 @@ function HO(n, e, t) { }); } return new (y || (y = Promise))(function(E, T) { - function A(x) { + function x(A) { try { - D(v.next(x)); + D(v.next(A)); } catch (w) { T(w); } } - function S(x) { + function S(A) { try { - D(v.throw(x)); + D(v.throw(A)); } catch (w) { T(w); } } - function D(x) { - x.done ? E(x.value) : _(x.value).then(A, S); + function D(A) { + A.done ? E(A.value) : _(A.value).then(x, S); } D((v = v.apply(g, p || [])).next()); }); }; let { upload_id: s } = e, { root: r } = e, { files: a } = e, { stream_handler: o } = e, u, l = !1, c, h, d = a.map((g) => Object.assign(Object.assign({}, g), { progress: 0 })); - const f = BO(); + const f = oM(); function m(g, p) { t(0, d = d.map((y) => (y.orig_name === g && (y.progress += p), y))); } - return $O(() => i(void 0, void 0, void 0, function* () { + return aM(() => i(void 0, void 0, void 0, function* () { if (u = yield o(new URL(`${r}/gradio_api/upload_progress?upload_id=${s}`)), u == null) throw new Error("Event source is not defined"); u.onmessage = function(g) { @@ -37055,13 +37158,13 @@ function HO(n, e, t) { l || t(1, l = !0), p.msg === "done" ? (u == null || u.close(), f("done")) : (t(7, c = p), m(p.orig_name, p.chunk_size)); }); }; - })), NO(() => { + })), lM(() => { (u != null || u != null) && u.close(); }), n.$$set = (g) => { "upload_id" in g && t(3, s = g.upload_id), "root" in g && t(4, r = g.root), "files" in g && t(5, a = g.files), "stream_handler" in g && t(6, o = g.stream_handler); }, n.$$.update = () => { n.$$.dirty & /*files_with_progress*/ - 1 && GO(d), n.$$.dirty & /*current_file_upload, files_with_progress*/ + 1 && cM(d), n.$$.dirty & /*current_file_upload, files_with_progress*/ 129 && t(2, h = c || d[0]); }, [ d, @@ -37074,9 +37177,9 @@ function HO(n, e, t) { c ]; } -class VO extends PO { +class dM extends nM { constructor(e) { - super(), OO(this, e, HO, UO, MO, { + super(), sM(this, e, hM, uM, rM, { upload_id: 3, root: 4, files: 5, @@ -37084,7 +37187,7 @@ class VO extends PO { }); } } -function qO() { +function fM() { let n, e; return { drag(t, i = {}) { @@ -37137,40 +37240,40 @@ function qO() { }; } const { - SvelteComponent: KO, - action_destroyer: jO, - attr: Ti, - check_outros: YE, - children: XE, - claim_component: zO, - claim_element: QE, - create_component: WO, - create_slot: ZE, - destroy_component: YO, - detach: Ir, - element: JE, - empty: Xl, - get_all_dirty_from_scope: e1, - get_slot_changes: t1, - group_outros: i1, - init: XO, - insert_hydration: bu, - is_function: QO, - listen: ZO, - mount_component: JO, - safe_not_equal: eM, - set_style: Ql, - toggle_class: He, - transition_in: Yn, - transition_out: Ls, - update_slot_base: n1 -} = window.__gradio__svelte__internal, { createEventDispatcher: tM, tick: iM, getContext: wj } = window.__gradio__svelte__internal; -function nM(n) { + SvelteComponent: mM, + action_destroyer: gM, + attr: Ci, + check_outros: h1, + children: d1, + claim_component: pM, + claim_element: f1, + create_component: _M, + create_slot: m1, + destroy_component: vM, + detach: Br, + element: g1, + empty: mu, + get_all_dirty_from_scope: p1, + get_slot_changes: _1, + group_outros: v1, + init: yM, + insert_hydration: Hu, + is_function: EM, + listen: bM, + mount_component: TM, + safe_not_equal: SM, + set_style: gu, + toggle_class: Ke, + transition_in: ts, + transition_out: Ns, + update_slot_base: y1 +} = window.__gradio__svelte__internal, { createEventDispatcher: AM, tick: xM, getContext: Nj } = window.__gradio__svelte__internal; +function DM(n) { let e, t, i, s, r, a, o; const u = ( /*#slots*/ n[30].default - ), l = ZE( + ), l = m1( u, n, /*$$scope*/ @@ -37179,52 +37282,52 @@ function nM(n) { ); return { c() { - e = JE("button"), l && l.c(), this.h(); + e = g1("button"), l && l.c(), this.h(); }, l(c) { - e = QE(c, "BUTTON", { + e = f1(c, "BUTTON", { tabindex: !0, "aria-label": !0, "aria-dropeffect": !0, class: !0 }); - var h = XE(e); - l && l.l(h), h.forEach(Ir), this.h(); + var h = d1(e); + l && l.l(h), h.forEach(Br), this.h(); }, h() { - Ti(e, "tabindex", t = /*hidden*/ - n[9] ? -1 : 0), Ti(e, "aria-label", i = /*aria_label*/ - n[14] || "Click to upload or drop files"), Ti(e, "aria-dropeffect", "copy"), Ti(e, "class", "svelte-1o7nwih"), He( + Ci(e, "tabindex", t = /*hidden*/ + n[9] ? -1 : 0), Ci(e, "aria-label", i = /*aria_label*/ + n[14] || "Click to upload or drop files"), Ci(e, "aria-dropeffect", "copy"), Ci(e, "class", "svelte-1o7nwih"), Ke( e, "hidden", /*hidden*/ n[9] - ), He( + ), Ke( e, "center", /*center*/ n[4] - ), He( + ), Ke( e, "boundedheight", /*boundedheight*/ n[3] - ), He( + ), Ke( e, "flex", /*flex*/ n[5] - ), He( + ), Ke( e, "disable_click", /*disable_click*/ n[7] - ), He( + ), Ke( e, "icon-mode", /*icon_upload*/ n[12] - ), Ql( + ), gu( e, "height", /*icon_upload*/ @@ -37242,9 +37345,9 @@ function nM(n) { ); }, m(c, h) { - bu(c, e, h), l && l.m(e, null), r = !0, a || (o = jO(s = /*drag*/ + Hu(c, e, h), l && l.m(e, null), r = !0, a || (o = gM(s = /*drag*/ n[19].call(null, e, { - on_drag_change: t_, + on_drag_change: __, on_files: ( /*drag_function_1*/ n[31] @@ -37265,30 +37368,30 @@ function nM(n) { }, p(c, h) { l && l.p && (!r || h[0] & /*$$scope*/ - 536870912) && n1( + 536870912) && y1( l, u, c, /*$$scope*/ c[29], - r ? t1( + r ? _1( u, /*$$scope*/ c[29], h, null - ) : e1( + ) : p1( /*$$scope*/ c[29] ), null ), (!r || h[0] & /*hidden*/ 512 && t !== (t = /*hidden*/ - c[9] ? -1 : 0)) && Ti(e, "tabindex", t), (!r || h[0] & /*aria_label*/ + c[9] ? -1 : 0)) && Ci(e, "tabindex", t), (!r || h[0] & /*aria_label*/ 16384 && i !== (i = /*aria_label*/ - c[14] || "Click to upload or drop files")) && Ti(e, "aria-label", i), s && QO(s.update) && h[0] & /*accept_file_types, file_count, disable_click*/ + c[14] || "Click to upload or drop files")) && Ci(e, "aria-label", i), s && EM(s.update) && h[0] & /*accept_file_types, file_count, disable_click*/ 262336 && s.update.call(null, { - on_drag_change: t_, + on_drag_change: __, on_files: ( /*drag_function_1*/ c[31] @@ -37306,43 +37409,43 @@ function nM(n) { c[7] ) }), (!r || h[0] & /*hidden*/ - 512) && He( + 512) && Ke( e, "hidden", /*hidden*/ c[9] ), (!r || h[0] & /*center*/ - 16) && He( + 16) && Ke( e, "center", /*center*/ c[4] ), (!r || h[0] & /*boundedheight*/ - 8) && He( + 8) && Ke( e, "boundedheight", /*boundedheight*/ c[3] ), (!r || h[0] & /*flex*/ - 32) && He( + 32) && Ke( e, "flex", /*flex*/ c[5] ), (!r || h[0] & /*disable_click*/ - 128) && He( + 128) && Ke( e, "disable_click", /*disable_click*/ c[7] ), (!r || h[0] & /*icon_upload*/ - 4096) && He( + 4096) && Ke( e, "icon-mode", /*icon_upload*/ c[12] ), h[0] & /*icon_upload, height*/ - 12288 && Ql( + 12288 && gu( e, "height", /*icon_upload*/ @@ -37360,53 +37463,53 @@ function nM(n) { ); }, i(c) { - r || (Yn(l, c), r = !0); + r || (ts(l, c), r = !0); }, o(c) { - Ls(l, c), r = !1; + Ns(l, c), r = !1; }, d(c) { - c && Ir(e), l && l.d(c), a = !1, o(); + c && Br(e), l && l.d(c), a = !1, o(); } }; } -function sM(n) { +function wM(n) { let e, t, i = !/*hidden*/ - n[9] && e_(n); + n[9] && p_(n); return { c() { - i && i.c(), e = Xl(); + i && i.c(), e = mu(); }, l(s) { - i && i.l(s), e = Xl(); + i && i.l(s), e = mu(); }, m(s, r) { - i && i.m(s, r), bu(s, e, r), t = !0; + i && i.m(s, r), Hu(s, e, r), t = !0; }, p(s, r) { /*hidden*/ - s[9] ? i && (i1(), Ls(i, 1, 1, () => { + s[9] ? i && (v1(), Ns(i, 1, 1, () => { i = null; - }), YE()) : i ? (i.p(s, r), r[0] & /*hidden*/ - 512 && Yn(i, 1)) : (i = e_(s), i.c(), Yn(i, 1), i.m(e.parentNode, e)); + }), h1()) : i ? (i.p(s, r), r[0] & /*hidden*/ + 512 && ts(i, 1)) : (i = p_(s), i.c(), ts(i, 1), i.m(e.parentNode, e)); }, i(s) { - t || (Yn(i), t = !0); + t || (ts(i), t = !0); }, o(s) { - Ls(i), t = !1; + Ns(i), t = !1; }, d(s) { - s && Ir(e), i && i.d(s); + s && Br(e), i && i.d(s); } }; } -function rM(n) { +function LM(n) { let e, t, i, s, r, a; const o = ( /*#slots*/ n[30].default - ), u = ZE( + ), u = m1( o, n, /*$$scope*/ @@ -37415,46 +37518,46 @@ function rM(n) { ); return { c() { - e = JE("button"), u && u.c(), this.h(); + e = g1("button"), u && u.c(), this.h(); }, l(l) { - e = QE(l, "BUTTON", { + e = f1(l, "BUTTON", { tabindex: !0, "aria-label": !0, class: !0 }); - var c = XE(e); - u && u.l(c), c.forEach(Ir), this.h(); + var c = d1(e); + u && u.l(c), c.forEach(Br), this.h(); }, h() { - Ti(e, "tabindex", t = /*hidden*/ - n[9] ? -1 : 0), Ti(e, "aria-label", i = /*aria_label*/ - n[14] || "Paste from clipboard"), Ti(e, "class", "svelte-1o7nwih"), He( + Ci(e, "tabindex", t = /*hidden*/ + n[9] ? -1 : 0), Ci(e, "aria-label", i = /*aria_label*/ + n[14] || "Paste from clipboard"), Ci(e, "class", "svelte-1o7nwih"), Ke( e, "hidden", /*hidden*/ n[9] - ), He( + ), Ke( e, "center", /*center*/ n[4] - ), He( + ), Ke( e, "boundedheight", /*boundedheight*/ n[3] - ), He( + ), Ke( e, "flex", /*flex*/ n[5] - ), He( + ), Ke( e, "icon-mode", /*icon_upload*/ n[12] - ), Ql( + ), gu( e, "height", /*icon_upload*/ @@ -37472,7 +37575,7 @@ function rM(n) { ); }, m(l, c) { - bu(l, e, c), u && u.m(e, null), s = !0, r || (a = ZO( + Hu(l, e, c), u && u.m(e, null), s = !0, r || (a = bM( e, "click", /*paste_clipboard*/ @@ -37481,59 +37584,59 @@ function rM(n) { }, p(l, c) { u && u.p && (!s || c[0] & /*$$scope*/ - 536870912) && n1( + 536870912) && y1( u, o, l, /*$$scope*/ l[29], - s ? t1( + s ? _1( o, /*$$scope*/ l[29], c, null - ) : e1( + ) : p1( /*$$scope*/ l[29] ), null ), (!s || c[0] & /*hidden*/ 512 && t !== (t = /*hidden*/ - l[9] ? -1 : 0)) && Ti(e, "tabindex", t), (!s || c[0] & /*aria_label*/ + l[9] ? -1 : 0)) && Ci(e, "tabindex", t), (!s || c[0] & /*aria_label*/ 16384 && i !== (i = /*aria_label*/ - l[14] || "Paste from clipboard")) && Ti(e, "aria-label", i), (!s || c[0] & /*hidden*/ - 512) && He( + l[14] || "Paste from clipboard")) && Ci(e, "aria-label", i), (!s || c[0] & /*hidden*/ + 512) && Ke( e, "hidden", /*hidden*/ l[9] ), (!s || c[0] & /*center*/ - 16) && He( + 16) && Ke( e, "center", /*center*/ l[4] ), (!s || c[0] & /*boundedheight*/ - 8) && He( + 8) && Ke( e, "boundedheight", /*boundedheight*/ l[3] ), (!s || c[0] & /*flex*/ - 32) && He( + 32) && Ke( e, "flex", /*flex*/ l[5] ), (!s || c[0] & /*icon_upload*/ - 4096) && He( + 4096) && Ke( e, "icon-mode", /*icon_upload*/ l[12] ), c[0] & /*icon_upload, height*/ - 12288 && Ql( + 12288 && gu( e, "height", /*icon_upload*/ @@ -37551,19 +37654,19 @@ function rM(n) { ); }, i(l) { - s || (Yn(u, l), s = !0); + s || (ts(u, l), s = !0); }, o(l) { - Ls(u, l), s = !1; + Ns(u, l), s = !1; }, d(l) { - l && Ir(e), u && u.d(l), r = !1, a(); + l && Br(e), u && u.d(l), r = !1, a(); } }; } -function e_(n) { +function p_(n) { let e, t; - return e = new VO({ + return e = new dM({ props: { root: ( /*root*/ @@ -37584,13 +37687,13 @@ function e_(n) { } }), { c() { - WO(e.$$.fragment); + _M(e.$$.fragment); }, l(i) { - zO(e.$$.fragment, i); + pM(e.$$.fragment, i); }, m(i, s) { - JO(e, i, s), t = !0; + TM(e, i, s), t = !0; }, p(i, s) { const r = {}; @@ -37605,19 +37708,19 @@ function e_(n) { i[11]), e.$set(r); }, i(i) { - t || (Yn(e.$$.fragment, i), t = !0); + t || (ts(e.$$.fragment, i), t = !0); }, o(i) { - Ls(e.$$.fragment, i), t = !1; + Ns(e.$$.fragment, i), t = !1; }, d(i) { - YO(e, i); + vM(e, i); } }; } -function aM(n) { +function IM(n) { let e, t, i, s; - const r = [rM, sM, nM], a = []; + const r = [LM, wM, DM], a = []; function o(u, l) { return ( /*filetype*/ @@ -37630,32 +37733,32 @@ function aM(n) { } return e = o(n), t = a[e] = r[e](n), { c() { - t.c(), i = Xl(); + t.c(), i = mu(); }, l(u) { - t.l(u), i = Xl(); + t.l(u), i = mu(); }, m(u, l) { - a[e].m(u, l), bu(u, i, l), s = !0; + a[e].m(u, l), Hu(u, i, l), s = !0; }, p(u, l) { let c = e; - e = o(u), e === c ? a[e].p(u, l) : (i1(), Ls(a[c], 1, 1, () => { + e = o(u), e === c ? a[e].p(u, l) : (v1(), Ns(a[c], 1, 1, () => { a[c] = null; - }), YE(), t = a[e], t ? t.p(u, l) : (t = a[e] = r[e](u), t.c()), Yn(t, 1), t.m(i.parentNode, i)); + }), h1(), t = a[e], t ? t.p(u, l) : (t = a[e] = r[e](u), t.c()), ts(t, 1), t.m(i.parentNode, i)); }, i(u) { - s || (Yn(t), s = !0); + s || (ts(t), s = !0); }, o(u) { - Ls(t), s = !1; + Ns(t), s = !1; }, d(u) { - u && Ir(i), a[e].d(u); + u && Br(i), a[e].d(u); } }; } -function oM(n, e, t) { +function kM(n, e, t) { if (!n || n === "*" || n === "file/*" || Array.isArray(n) && n.some((s) => s === "*" || s === "file/*")) return !0; let i; @@ -37670,57 +37773,57 @@ function oM(n, e, t) { return s.endsWith("/*") && t.startsWith(r + "/"); }); } -const t_ = (n) => n = n; -function lM(n, e, t) { +const __ = (n) => n = n; +function RM(n, e, t) { let i, { $$slots: s = {}, $$scope: r } = e; - var a = this && this.__awaiter || function(G, Y, ee, se) { - function ye(Pe) { - return Pe instanceof ee ? Pe : new ee(function(Ke) { - Ke(Pe); + var a = this && this.__awaiter || function(G, Z, U, re) { + function j(Ee) { + return Ee instanceof U ? Ee : new U(function(Oe) { + Oe(Ee); }); } - return new (ee || (ee = Promise))(function(Pe, Ke) { - function jt(Se) { + return new (U || (U = Promise))(function(Ee, Oe) { + function je(Fe) { try { - he(se.next(Se)); - } catch (dt) { - Ke(dt); + ve(re.next(Fe)); + } catch (Ye) { + Oe(Ye); } } - function ae(Se) { + function se(Fe) { try { - he(se.throw(Se)); - } catch (dt) { - Ke(dt); + ve(re.throw(Fe)); + } catch (Ye) { + Oe(Ye); } } - function he(Se) { - Se.done ? Pe(Se.value) : ye(Se.value).then(jt, ae); + function ve(Fe) { + Fe.done ? Ee(Fe.value) : j(Fe.value).then(je, se); } - he((se = se.apply(G, Y || [])).next()); + ve((re = re.apply(G, Z || [])).next()); }); }; - const { drag: o, open_file_upload: u } = qO(); - let { filetype: l = null } = e, { dragging: c = !1 } = e, { boundedheight: h = !0 } = e, { center: d = !0 } = e, { flex: f = !0 } = e, { file_count: m = "single" } = e, { disable_click: g = !1 } = e, { root: p } = e, { hidden: y = !1 } = e, { format: v = "file" } = e, { uploading: _ = !1 } = e, { show_progress: E = !0 } = e, { max_file_size: T = null } = e, { upload: A } = e, { stream_handler: S } = e, { icon_upload: D = !1 } = e, { height: x = void 0 } = e, { aria_label: w = void 0 } = e; + const { drag: o, open_file_upload: u } = fM(); + let { filetype: l = null } = e, { dragging: c = !1 } = e, { boundedheight: h = !0 } = e, { center: d = !0 } = e, { flex: f = !0 } = e, { file_count: m = "single" } = e, { disable_click: g = !1 } = e, { root: p } = e, { hidden: y = !1 } = e, { format: v = "file" } = e, { uploading: _ = !1 } = e, { show_progress: E = !0 } = e, { max_file_size: T = null } = e, { upload: x } = e, { stream_handler: S } = e, { icon_upload: D = !1 } = e, { height: A = void 0 } = e, { aria_label: w = void 0 } = e; function I() { u(); } - let R, M, P, K = null; - const q = () => { + let M, k, q, K = null; + const H = () => { if (typeof navigator < "u") { const G = navigator.userAgent.toLowerCase(); return G.indexOf("iphone") > -1 || G.indexOf("ipad") > -1; } return !1; - }, W = tM(), U = ["image", "video", "audio", "text", "file"], j = (G) => i && G.startsWith(".") ? (K = !0, G) : i && G.includes("file/*") ? "*" : G.startsWith(".") || G.endsWith("/*") ? G : U.includes(G) ? G + "/*" : "." + G; - function $() { + }, Y = AM(), B = ["image", "video", "audio", "text", "file"], z = (G) => i && G.startsWith(".") ? (K = !0, G) : i && G.includes("file/*") ? "*" : G.startsWith(".") || G.endsWith("/*") ? G : B.includes(G) ? G + "/*" : "." + G; + function W() { navigator.clipboard.read().then((G) => a(this, void 0, void 0, function* () { - for (let Y = 0; Y < G.length; Y++) { - const ee = G[Y].types.find((se) => se.startsWith("image/")); - if (ee) { - G[Y].getType(ee).then((se) => a(this, void 0, void 0, function* () { - const ye = new File([se], `clipboard.${ee.replace("image/", "")}`); - yield Q([ye]); + for (let Z = 0; Z < G.length; Z++) { + const U = G[Z].types.find((re) => re.startsWith("image/")); + if (U) { + G[Z].getType(U).then((re) => a(this, void 0, void 0, function* () { + const j = new File([re], `clipboard.${U.replace("image/", "")}`); + yield Q([j]); })); break; } @@ -37730,14 +37833,14 @@ function lM(n, e, t) { function L() { u(); } - function H(G) { + function $(G) { return a(this, void 0, void 0, function* () { - yield iM(), t(16, R = Math.random().toString(36).substring(2, 15)), t(2, _ = !0); + yield xM(), t(16, M = Math.random().toString(36).substring(2, 15)), t(2, _ = !0); try { - const Y = yield A(G, p, R, T ?? 1 / 0); - return W("load", m === "single" ? Y == null ? void 0 : Y[0] : Y), t(2, _ = !1), Y || []; - } catch (Y) { - return W("error", Y.message), t(2, _ = !1), []; + const Z = yield x(G, p, M, T ?? 1 / 0); + return Y("load", m === "single" ? Z == null ? void 0 : Z[0] : Z), t(2, _ = !1), Z || []; + } catch (Z) { + return Y("error", Z.message), t(2, _ = !1), []; } }); } @@ -37745,64 +37848,64 @@ function lM(n, e, t) { return a(this, void 0, void 0, function* () { if (!G.length) return; - let Y = G.map((ee) => new File([ee], ee instanceof File ? ee.name : "file", { type: ee.type })); - return i && K && (Y = Y.filter((ee) => X(ee) ? !0 : (W("error", `Invalid file type: ${ee.name}. Only ${l} allowed.`), !1)), Y.length === 0) ? [] : (t(17, M = yield If(Y)), yield H(M)); + let Z = G.map((U) => new File([U], U instanceof File ? U.name : "file", { type: U.type })); + return i && K && (Z = Z.filter((U) => C(U) ? !0 : (Y("error", `Invalid file type: ${U.name}. Only ${l} allowed.`), !1)), Z.length === 0) ? [] : (t(17, k = yield Xf(Z)), yield $(k)); }); } - function X(G) { - return l ? (Array.isArray(l) ? l : [l]).some((ee) => { - const se = j(ee); - if (se.startsWith(".")) - return G.name.toLowerCase().endsWith(se.toLowerCase()); - if (se === "*") + function C(G) { + return l ? (Array.isArray(l) ? l : [l]).some((U) => { + const re = z(U); + if (re.startsWith(".")) + return G.name.toLowerCase().endsWith(re.toLowerCase()); + if (re === "*") return !0; - if (se.endsWith("/*")) { - const [ye] = se.split("/"); - return G.type.startsWith(ye + "/"); + if (re.endsWith("/*")) { + const [j] = re.split("/"); + return G.type.startsWith(j + "/"); } - return G.type === se; + return G.type === re; }) : !0; } - function C(G) { + function O(G) { return a(this, void 0, void 0, function* () { - const Y = G.filter((ee) => { - const se = "." + ee.name.split(".").pop(); - return se && oM(P, se, ee.type) || (se && Array.isArray(l) ? l.includes(se) : se === l) ? !0 : (W("error", `Invalid file type only ${l} allowed.`), !1); + const Z = G.filter((U) => { + const re = "." + U.name.split(".").pop(); + return re && kM(q, re, U.type) || (re && Array.isArray(l) ? l.includes(re) : re === l) ? !0 : (Y("error", `Invalid file type only ${l} allowed.`), !1); }); if (v != "blob") - yield Q(Y); + yield Q(Z); else { if (m === "single") { - W("load", Y[0]); + Y("load", Z[0]); return; } - W("load", Y); + Y("load", Z); } }); } - function B(G) { + function N(G) { return a(this, void 0, void 0, function* () { - var Y; - if (t(1, c = !1), !(!((Y = G.dataTransfer) === null || Y === void 0) && Y.files)) return; - const ee = Array.from(G.dataTransfer.files).filter(X); + var Z; + if (t(1, c = !1), !(!((Z = G.dataTransfer) === null || Z === void 0) && Z.files)) return; + const U = Array.from(G.dataTransfer.files).filter(C); if (v != "blob") - yield Q(ee); + yield Q(U); else { if (m === "single") { - W("load", ee[0]); + Y("load", U[0]); return; } - W("load", ee); + Y("load", U); } }); } - const N = (G) => C(G); + const ee = (G) => O(G); return n.$$set = (G) => { - "filetype" in G && t(0, l = G.filetype), "dragging" in G && t(1, c = G.dragging), "boundedheight" in G && t(3, h = G.boundedheight), "center" in G && t(4, d = G.center), "flex" in G && t(5, f = G.flex), "file_count" in G && t(6, m = G.file_count), "disable_click" in G && t(7, g = G.disable_click), "root" in G && t(8, p = G.root), "hidden" in G && t(9, y = G.hidden), "format" in G && t(21, v = G.format), "uploading" in G && t(2, _ = G.uploading), "show_progress" in G && t(10, E = G.show_progress), "max_file_size" in G && t(22, T = G.max_file_size), "upload" in G && t(23, A = G.upload), "stream_handler" in G && t(11, S = G.stream_handler), "icon_upload" in G && t(12, D = G.icon_upload), "height" in G && t(13, x = G.height), "aria_label" in G && t(14, w = G.aria_label), "$$scope" in G && t(29, r = G.$$scope); + "filetype" in G && t(0, l = G.filetype), "dragging" in G && t(1, c = G.dragging), "boundedheight" in G && t(3, h = G.boundedheight), "center" in G && t(4, d = G.center), "flex" in G && t(5, f = G.flex), "file_count" in G && t(6, m = G.file_count), "disable_click" in G && t(7, g = G.disable_click), "root" in G && t(8, p = G.root), "hidden" in G && t(9, y = G.hidden), "format" in G && t(21, v = G.format), "uploading" in G && t(2, _ = G.uploading), "show_progress" in G && t(10, E = G.show_progress), "max_file_size" in G && t(22, T = G.max_file_size), "upload" in G && t(23, x = G.upload), "stream_handler" in G && t(11, S = G.stream_handler), "icon_upload" in G && t(12, D = G.icon_upload), "height" in G && t(13, A = G.height), "aria_label" in G && t(14, w = G.aria_label), "$$scope" in G && t(29, r = G.$$scope); }, n.$$.update = () => { n.$$.dirty[0] & /*filetype, ios*/ - 268435457 && (l == null ? t(18, P = null) : typeof l == "string" ? t(18, P = j(l)) : i && l.includes("file/*") ? t(18, P = "*") : (t(0, l = l.map(j)), t(18, P = l.join(", ")))); - }, t(28, i = q()), [ + 268435457 && (l == null ? t(18, q = null) : typeof l == "string" ? t(18, q = z(l)) : i && l.includes("file/*") ? t(18, q = "*") : (t(0, l = l.map(z)), t(18, q = l.join(", ")))); + }, t(28, i = H()), [ l, c, _, @@ -37816,35 +37919,35 @@ function lM(n, e, t) { E, S, D, - x, + A, w, - $, - R, + W, M, - P, + k, + q, o, - C, + O, v, T, - A, + x, I, L, Q, - B, + N, i, r, s, - N + ee ]; } -class uM extends KO { +class CM extends mM { constructor(e) { - super(), XO( + super(), yM( this, e, - lM, - aM, - eM, + RM, + IM, + SM, { filetype: 0, dragging: 1, @@ -37891,31 +37994,31 @@ class uM extends KO { } } const { - SvelteComponent: cM, - check_outros: xh, - claim_component: Vr, - claim_space: el, - create_component: qr, - create_slot: hM, - destroy_component: Kr, - detach: tl, - get_all_dirty_from_scope: dM, - get_slot_changes: fM, - group_outros: Dh, - init: mM, - insert_hydration: il, - mount_component: jr, - safe_not_equal: gM, - space: nl, - transition_in: vt, - transition_out: Ut, - update_slot_base: pM -} = window.__gradio__svelte__internal, { createEventDispatcher: _M } = window.__gradio__svelte__internal; -function i_(n) { + SvelteComponent: FM, + check_outros: Kh, + claim_component: Xr, + claim_space: yl, + create_component: Qr, + create_slot: PM, + destroy_component: Zr, + detach: El, + get_all_dirty_from_scope: OM, + get_slot_changes: MM, + group_outros: jh, + init: $M, + insert_hydration: bl, + mount_component: Jr, + safe_not_equal: BM, + space: Tl, + transition_in: St, + transition_out: jt, + update_slot_base: NM +} = window.__gradio__svelte__internal, { createEventDispatcher: UM } = window.__gradio__svelte__internal; +function v_(n) { let e, t; - return e = new Ci({ + return e = new vi({ props: { - Icon: nS, + Icon: yS, label: ( /*i18n*/ n[3]("common.edit") @@ -37927,13 +38030,13 @@ function i_(n) { n[6] ), { c() { - qr(e.$$.fragment); + Qr(e.$$.fragment); }, l(i) { - Vr(e.$$.fragment, i); + Xr(e.$$.fragment, i); }, m(i, s) { - jr(e, i, s), t = !0; + Jr(e, i, s), t = !0; }, p(i, s) { const r = {}; @@ -37942,21 +38045,21 @@ function i_(n) { i[3]("common.edit")), e.$set(r); }, i(i) { - t || (vt(e.$$.fragment, i), t = !0); + t || (St(e.$$.fragment, i), t = !0); }, o(i) { - Ut(e.$$.fragment, i), t = !1; + jt(e.$$.fragment, i), t = !1; }, d(i) { - Kr(e, i); + Zr(e, i); } }; } -function n_(n) { +function y_(n) { let e, t; - return e = new Ci({ + return e = new vi({ props: { - Icon: ef, + Icon: Tf, label: ( /*i18n*/ n[3]("common.undo") @@ -37968,13 +38071,13 @@ function n_(n) { n[7] ), { c() { - qr(e.$$.fragment); + Qr(e.$$.fragment); }, l(i) { - Vr(e.$$.fragment, i); + Xr(e.$$.fragment, i); }, m(i, s) { - jr(e, i, s), t = !0; + Jr(e, i, s), t = !0; }, p(i, s) { const r = {}; @@ -37983,37 +38086,37 @@ function n_(n) { i[3]("common.undo")), e.$set(r); }, i(i) { - t || (vt(e.$$.fragment, i), t = !0); + t || (St(e.$$.fragment, i), t = !0); }, o(i) { - Ut(e.$$.fragment, i), t = !1; + jt(e.$$.fragment, i), t = !1; }, d(i) { - Kr(e, i); + Zr(e, i); } }; } -function s_(n) { +function E_(n) { let e, t; - return e = new sy({ + return e = new Ey({ props: { href: ( /*download*/ n[2] ), download: !0, - $$slots: { default: [vM] }, + $$slots: { default: [GM] }, $$scope: { ctx: n } } }), { c() { - qr(e.$$.fragment); + Qr(e.$$.fragment); }, l(i) { - Vr(e.$$.fragment, i); + Xr(e.$$.fragment, i); }, m(i, s) { - jr(e, i, s), t = !0; + Jr(e, i, s), t = !0; }, p(i, s) { const r = {}; @@ -38023,21 +38126,21 @@ function s_(n) { 520 && (r.$$scope = { dirty: s, ctx: i }), e.$set(r); }, i(i) { - t || (vt(e.$$.fragment, i), t = !0); + t || (St(e.$$.fragment, i), t = !0); }, o(i) { - Ut(e.$$.fragment, i), t = !1; + jt(e.$$.fragment, i), t = !1; }, d(i) { - Kr(e, i); + Zr(e, i); } }; } -function vM(n) { +function GM(n) { let e, t; - return e = new Ci({ + return e = new vi({ props: { - Icon: ov, + Icon: Sv, label: ( /*i18n*/ n[3]("common.download") @@ -38045,13 +38148,13 @@ function vM(n) { } }), { c() { - qr(e.$$.fragment); + Qr(e.$$.fragment); }, l(i) { - Vr(e.$$.fragment, i); + Xr(e.$$.fragment, i); }, m(i, s) { - jr(e, i, s), t = !0; + Jr(e, i, s), t = !0; }, p(i, s) { const r = {}; @@ -38060,40 +38163,40 @@ function vM(n) { i[3]("common.download")), e.$set(r); }, i(i) { - t || (vt(e.$$.fragment, i), t = !0); + t || (St(e.$$.fragment, i), t = !0); }, o(i) { - Ut(e.$$.fragment, i), t = !1; + jt(e.$$.fragment, i), t = !1; }, d(i) { - Kr(e, i); + Zr(e, i); } }; } -function yM(n) { +function HM(n) { let e, t, i, s, r, a, o = ( /*editable*/ - n[0] && i_(n) + n[0] && v_(n) ), u = ( /*undoable*/ - n[1] && n_(n) + n[1] && y_(n) ), l = ( /*download*/ - n[2] && s_(n) + n[2] && E_(n) ); const c = ( /*#slots*/ n[5].default - ), h = hM( + ), h = PM( c, n, /*$$scope*/ n[9], null ); - return r = new Ci({ + return r = new vi({ props: { - Icon: Jd, + Icon: bf, label: ( /*i18n*/ n[3]("common.clear") @@ -38105,41 +38208,41 @@ function yM(n) { n[8] ), { c() { - o && o.c(), e = nl(), u && u.c(), t = nl(), l && l.c(), i = nl(), h && h.c(), s = nl(), qr(r.$$.fragment); + o && o.c(), e = Tl(), u && u.c(), t = Tl(), l && l.c(), i = Tl(), h && h.c(), s = Tl(), Qr(r.$$.fragment); }, l(d) { - o && o.l(d), e = el(d), u && u.l(d), t = el(d), l && l.l(d), i = el(d), h && h.l(d), s = el(d), Vr(r.$$.fragment, d); + o && o.l(d), e = yl(d), u && u.l(d), t = yl(d), l && l.l(d), i = yl(d), h && h.l(d), s = yl(d), Xr(r.$$.fragment, d); }, m(d, f) { - o && o.m(d, f), il(d, e, f), u && u.m(d, f), il(d, t, f), l && l.m(d, f), il(d, i, f), h && h.m(d, f), il(d, s, f), jr(r, d, f), a = !0; + o && o.m(d, f), bl(d, e, f), u && u.m(d, f), bl(d, t, f), l && l.m(d, f), bl(d, i, f), h && h.m(d, f), bl(d, s, f), Jr(r, d, f), a = !0; }, p(d, f) { /*editable*/ d[0] ? o ? (o.p(d, f), f & /*editable*/ - 1 && vt(o, 1)) : (o = i_(d), o.c(), vt(o, 1), o.m(e.parentNode, e)) : o && (Dh(), Ut(o, 1, 1, () => { + 1 && St(o, 1)) : (o = v_(d), o.c(), St(o, 1), o.m(e.parentNode, e)) : o && (jh(), jt(o, 1, 1, () => { o = null; - }), xh()), /*undoable*/ + }), Kh()), /*undoable*/ d[1] ? u ? (u.p(d, f), f & /*undoable*/ - 2 && vt(u, 1)) : (u = n_(d), u.c(), vt(u, 1), u.m(t.parentNode, t)) : u && (Dh(), Ut(u, 1, 1, () => { + 2 && St(u, 1)) : (u = y_(d), u.c(), St(u, 1), u.m(t.parentNode, t)) : u && (jh(), jt(u, 1, 1, () => { u = null; - }), xh()), /*download*/ + }), Kh()), /*download*/ d[2] ? l ? (l.p(d, f), f & /*download*/ - 4 && vt(l, 1)) : (l = s_(d), l.c(), vt(l, 1), l.m(i.parentNode, i)) : l && (Dh(), Ut(l, 1, 1, () => { + 4 && St(l, 1)) : (l = E_(d), l.c(), St(l, 1), l.m(i.parentNode, i)) : l && (jh(), jt(l, 1, 1, () => { l = null; - }), xh()), h && h.p && (!a || f & /*$$scope*/ - 512) && pM( + }), Kh()), h && h.p && (!a || f & /*$$scope*/ + 512) && NM( h, c, d, /*$$scope*/ d[9], - a ? fM( + a ? MM( c, /*$$scope*/ d[9], f, null - ) : dM( + ) : OM( /*$$scope*/ d[9] ), @@ -38151,32 +38254,32 @@ function yM(n) { d[3]("common.clear")), r.$set(m); }, i(d) { - a || (vt(o), vt(u), vt(l), vt(h, d), vt(r.$$.fragment, d), a = !0); + a || (St(o), St(u), St(l), St(h, d), St(r.$$.fragment, d), a = !0); }, o(d) { - Ut(o), Ut(u), Ut(l), Ut(h, d), Ut(r.$$.fragment, d), a = !1; + jt(o), jt(u), jt(l), jt(h, d), jt(r.$$.fragment, d), a = !1; }, d(d) { - d && (tl(e), tl(t), tl(i), tl(s)), o && o.d(d), u && u.d(d), l && l.d(d), h && h.d(d), Kr(r, d); + d && (El(e), El(t), El(i), El(s)), o && o.d(d), u && u.d(d), l && l.d(d), h && h.d(d), Zr(r, d); } }; } -function EM(n) { +function VM(n) { let e, t; - return e = new cv({ + return e = new Dv({ props: { - $$slots: { default: [yM] }, + $$slots: { default: [HM] }, $$scope: { ctx: n } } }), { c() { - qr(e.$$.fragment); + Qr(e.$$.fragment); }, l(i) { - Vr(e.$$.fragment, i); + Xr(e.$$.fragment, i); }, m(i, s) { - jr(e, i, s), t = !0; + Jr(e, i, s), t = !0; }, p(i, [s]) { const r = {}; @@ -38184,19 +38287,19 @@ function EM(n) { 527 && (r.$$scope = { dirty: s, ctx: i }), e.$set(r); }, i(i) { - t || (vt(e.$$.fragment, i), t = !0); + t || (St(e.$$.fragment, i), t = !0); }, o(i) { - Ut(e.$$.fragment, i), t = !1; + jt(e.$$.fragment, i), t = !1; }, d(i) { - Kr(e, i); + Zr(e, i); } }; } -function bM(n, e, t) { +function qM(n, e, t) { let { $$slots: i = {}, $$scope: s } = e, { editable: r = !1 } = e, { undoable: a = !1 } = e, { download: o = null } = e, { i18n: u } = e; - const l = _M(), c = () => l("edit"), h = () => l("undo"), d = (f) => { + const l = UM(), c = () => l("edit"), h = () => l("undo"), d = (f) => { l("clear"), f.stopPropagation(); }; return n.$$set = (f) => { @@ -38214,9 +38317,9 @@ function bM(n, e, t) { s ]; } -class TM extends cM { +class KM extends FM { constructor(e) { - super(), mM(this, e, bM, EM, gM, { + super(), $M(this, e, qM, VM, BM, { editable: 0, undoable: 1, download: 2, @@ -38225,40 +38328,40 @@ class TM extends cM { } } const { - SvelteComponent: SM, - add_flush_callback: sl, - append_hydration: ur, - attr: ji, - bind: rl, - binding_callbacks: al, - check_outros: Od, - children: kr, - claim_component: Tu, - claim_element: zn, - claim_space: qa, - claim_text: AM, - create_component: Su, - destroy_component: Au, - detach: At, - element: Wn, - empty: r_, - get_svelte_dataset: a_, - group_outros: Md, - init: xM, - insert_hydration: wn, - listen: o_, - mount_component: xu, - noop: DM, - run_all: wM, - safe_not_equal: LM, - set_data: IM, - space: Ka, - text: kM, - toggle_class: Vn, - transition_in: qt, - transition_out: sn -} = window.__gradio__svelte__internal, { onMount: RM } = window.__gradio__svelte__internal; -function l_(n) { + SvelteComponent: jM, + add_flush_callback: Sl, + append_hydration: br, + attr: Xi, + bind: Al, + binding_callbacks: xl, + check_outros: nf, + children: Nr, + claim_component: Vu, + claim_element: Jn, + claim_space: io, + claim_text: zM, + create_component: qu, + destroy_component: Ku, + detach: kt, + element: es, + empty: b_, + get_svelte_dataset: T_, + group_outros: sf, + init: WM, + insert_hydration: Rn, + listen: S_, + mount_component: ju, + noop: YM, + run_all: XM, + safe_not_equal: QM, + set_data: ZM, + space: no, + text: JM, + toggle_class: Yn, + transition_in: Xt, + transition_out: on +} = window.__gradio__svelte__internal, { onMount: e$ } = window.__gradio__svelte__internal; +function A_(n) { let e, t, i, s, r, a, o; function u(f) { n[18](f); @@ -38285,20 +38388,20 @@ function l_(n) { n[12] !== void 0 && (d.trimmedDuration = /*trimmedDuration*/ n[12]), /*loadingTimeline*/ n[16] !== void 0 && (d.loadingTimeline = /*loadingTimeline*/ - n[16]), t = new XF({ props: d }), al.push(() => rl(t, "dragStart", u)), al.push(() => rl(t, "dragEnd", l)), al.push(() => rl(t, "trimmedDuration", c)), al.push(() => rl(t, "loadingTimeline", h)), { + n[16]), t = new yP({ props: d }), xl.push(() => Al(t, "dragStart", u)), xl.push(() => Al(t, "dragEnd", l)), xl.push(() => Al(t, "trimmedDuration", c)), xl.push(() => Al(t, "loadingTimeline", h)), { c() { - e = Wn("div"), Su(t.$$.fragment), this.h(); + e = es("div"), qu(t.$$.fragment), this.h(); }, l(f) { - e = zn(f, "DIV", { class: !0 }); - var m = kr(e); - Tu(t.$$.fragment, m), m.forEach(At), this.h(); + e = Jn(f, "DIV", { class: !0 }); + var m = Nr(e); + Vu(t.$$.fragment, m), m.forEach(kt), this.h(); }, h() { - ji(e, "class", "timeline-wrapper svelte-uu53fr"); + Xi(e, "class", "timeline-wrapper svelte-uu53fr"); }, m(f, m) { - wn(f, e, m), xu(t, e, null), o = !0; + Rn(f, e, m), ju(t, e, null), o = !0; }, p(f, m) { const g = {}; @@ -38306,90 +38409,90 @@ function l_(n) { 4 && (g.videoElement = /*videoElement*/ f[2]), !i && m & /*dragStart*/ 16384 && (i = !0, g.dragStart = /*dragStart*/ - f[14], sl(() => i = !1)), !s && m & /*dragEnd*/ + f[14], Sl(() => i = !1)), !s && m & /*dragEnd*/ 32768 && (s = !0, g.dragEnd = /*dragEnd*/ - f[15], sl(() => s = !1)), !r && m & /*trimmedDuration*/ + f[15], Sl(() => s = !1)), !r && m & /*trimmedDuration*/ 4096 && (r = !0, g.trimmedDuration = /*trimmedDuration*/ - f[12], sl(() => r = !1)), !a && m & /*loadingTimeline*/ + f[12], Sl(() => r = !1)), !a && m & /*loadingTimeline*/ 65536 && (a = !0, g.loadingTimeline = /*loadingTimeline*/ - f[16], sl(() => a = !1)), t.$set(g); + f[16], Sl(() => a = !1)), t.$set(g); }, i(f) { - o || (qt(t.$$.fragment, f), o = !0); + o || (Xt(t.$$.fragment, f), o = !0); }, o(f) { - sn(t.$$.fragment, f), o = !1; + on(t.$$.fragment, f), o = !1; }, d(f) { - f && At(e), Au(t); + f && kt(e), Ku(t); } } ); } -function CM(n) { +function t$(n) { let e; return { c() { - e = Wn("div"), this.h(); + e = es("div"), this.h(); }, l(t) { - e = zn(t, "DIV", { class: !0 }), kr(e).forEach(At), this.h(); + e = Jn(t, "DIV", { class: !0 }), Nr(e).forEach(kt), this.h(); }, h() { - ji(e, "class", "svelte-uu53fr"); + Xi(e, "class", "svelte-uu53fr"); }, m(t, i) { - wn(t, e, i); + Rn(t, e, i); }, - p: DM, + p: YM, d(t) { - t && At(e); + t && kt(e); } }; } -function FM(n) { - let e, t = sr( +function i$(n) { + let e, t = pr( /*trimmedDuration*/ n[12] ) + "", i, s, r, a, o = "Trim", u, l, c = "Cancel", h, d; return { c() { - e = Wn("time"), i = kM(t), s = Ka(), r = Wn("div"), a = Wn("button"), a.textContent = o, u = Ka(), l = Wn("button"), l.textContent = c, this.h(); + e = es("time"), i = JM(t), s = no(), r = es("div"), a = es("button"), a.textContent = o, u = no(), l = es("button"), l.textContent = c, this.h(); }, l(f) { - e = zn(f, "TIME", { "aria-label": !0, class: !0 }); - var m = kr(e); - i = AM(m, t), m.forEach(At), s = qa(f), r = zn(f, "DIV", { class: !0 }); - var g = kr(r); - a = zn(g, "BUTTON", { class: !0, "data-svelte-h": !0 }), a_(a) !== "svelte-18nzick" && (a.textContent = o), u = qa(g), l = zn(g, "BUTTON", { class: !0, "data-svelte-h": !0 }), a_(l) !== "svelte-1mj98i4" && (l.textContent = c), g.forEach(At), this.h(); + e = Jn(f, "TIME", { "aria-label": !0, class: !0 }); + var m = Nr(e); + i = zM(m, t), m.forEach(kt), s = io(f), r = Jn(f, "DIV", { class: !0 }); + var g = Nr(r); + a = Jn(g, "BUTTON", { class: !0, "data-svelte-h": !0 }), T_(a) !== "svelte-18nzick" && (a.textContent = o), u = io(g), l = Jn(g, "BUTTON", { class: !0, "data-svelte-h": !0 }), T_(l) !== "svelte-1mj98i4" && (l.textContent = c), g.forEach(kt), this.h(); }, h() { - ji(e, "aria-label", "duration of selected region in seconds"), ji(e, "class", "svelte-uu53fr"), Vn( + Xi(e, "aria-label", "duration of selected region in seconds"), Xi(e, "class", "svelte-uu53fr"), Yn( e, "hidden", /*loadingTimeline*/ n[16] - ), ji(a, "class", "text-button svelte-uu53fr"), Vn( + ), Xi(a, "class", "text-button svelte-uu53fr"), Yn( a, "hidden", /*loadingTimeline*/ n[16] - ), ji(l, "class", "text-button svelte-uu53fr"), Vn( + ), Xi(l, "class", "text-button svelte-uu53fr"), Yn( l, "hidden", /*loadingTimeline*/ n[16] - ), ji(r, "class", "edit-buttons svelte-uu53fr"); + ), Xi(r, "class", "edit-buttons svelte-uu53fr"); }, m(f, m) { - wn(f, e, m), ur(e, i), wn(f, s, m), wn(f, r, m), ur(r, a), ur(r, u), ur(r, l), h || (d = [ - o_( + Rn(f, e, m), br(e, i), Rn(f, s, m), Rn(f, r, m), br(r, a), br(r, u), br(r, l), h || (d = [ + S_( a, "click", /*click_handler*/ n[22] ), - o_( + S_( l, "click", /*toggleTrimmingMode*/ @@ -38399,23 +38502,23 @@ function FM(n) { }, p(f, m) { m & /*trimmedDuration*/ - 4096 && t !== (t = sr( + 4096 && t !== (t = pr( /*trimmedDuration*/ f[12] - ) + "") && IM(i, t), m & /*loadingTimeline*/ - 65536 && Vn( + ) + "") && ZM(i, t), m & /*loadingTimeline*/ + 65536 && Yn( e, "hidden", /*loadingTimeline*/ f[16] ), m & /*loadingTimeline*/ - 65536 && Vn( + 65536 && Yn( a, "hidden", /*loadingTimeline*/ f[16] ), m & /*loadingTimeline*/ - 65536 && Vn( + 65536 && Yn( l, "hidden", /*loadingTimeline*/ @@ -38423,15 +38526,15 @@ function FM(n) { ); }, d(f) { - f && (At(e), At(s), At(r)), h = !1, wM(d); + f && (kt(e), kt(s), kt(r)), h = !1, XM(d); } }; } -function u_(n) { +function x_(n) { let e, t; - return e = new Ci({ + return e = new vi({ props: { - Icon: ef, + Icon: Tf, label: "Reset video to initial value", disabled: ( /*processingVideo*/ @@ -38445,13 +38548,13 @@ function u_(n) { n[23] ), { c() { - Su(e.$$.fragment); + qu(e.$$.fragment); }, l(i) { - Tu(e.$$.fragment, i); + Vu(e.$$.fragment, i); }, m(i, s) { - xu(e, i, s), t = !0; + ju(e, i, s), t = !0; }, p(i, s) { const r = {}; @@ -38461,21 +38564,21 @@ function u_(n) { i[11]), e.$set(r); }, i(i) { - t || (qt(e.$$.fragment, i), t = !0); + t || (Xt(e.$$.fragment, i), t = !0); }, o(i) { - sn(e.$$.fragment, i), t = !1; + on(e.$$.fragment, i), t = !1; }, d(i) { - Au(e, i); + Ku(e, i); } }; } -function c_(n) { +function D_(n) { let e, t; - return e = new Ci({ + return e = new vi({ props: { - Icon: cA, + Icon: yA, label: "Trim video to selection", disabled: ( /*processingVideo*/ @@ -38488,13 +38591,13 @@ function c_(n) { n[17] ), { c() { - Su(e.$$.fragment); + qu(e.$$.fragment); }, l(i) { - Tu(e.$$.fragment, i); + Vu(e.$$.fragment, i); }, m(i, s) { - xu(e, i, s), t = !0; + ju(e, i, s), t = !0; }, p(i, s) { const r = {}; @@ -38503,75 +38606,75 @@ function c_(n) { i[1]), e.$set(r); }, i(i) { - t || (qt(e.$$.fragment, i), t = !0); + t || (Xt(e.$$.fragment, i), t = !0); }, o(i) { - sn(e.$$.fragment, i), t = !1; + on(e.$$.fragment, i), t = !1; }, d(i) { - Au(e, i); + Ku(e, i); } }; } -function PM(n) { +function n$(n) { let e, t, i, s = ( /*showRedo*/ n[3] && /*mode*/ - n[0] === "" && u_(n) + n[0] === "" && x_(n) ), r = ( /*interactive*/ n[4] && /*mode*/ - n[0] === "" && c_(n) + n[0] === "" && D_(n) ); return { c() { - s && s.c(), e = Ka(), r && r.c(), t = r_(); + s && s.c(), e = no(), r && r.c(), t = b_(); }, l(a) { - s && s.l(a), e = qa(a), r && r.l(a), t = r_(); + s && s.l(a), e = io(a), r && r.l(a), t = b_(); }, m(a, o) { - s && s.m(a, o), wn(a, e, o), r && r.m(a, o), wn(a, t, o), i = !0; + s && s.m(a, o), Rn(a, e, o), r && r.m(a, o), Rn(a, t, o), i = !0; }, p(a, o) { /*showRedo*/ a[3] && /*mode*/ a[0] === "" ? s ? (s.p(a, o), o & /*showRedo, mode*/ - 9 && qt(s, 1)) : (s = u_(a), s.c(), qt(s, 1), s.m(e.parentNode, e)) : s && (Md(), sn(s, 1, 1, () => { + 9 && Xt(s, 1)) : (s = x_(a), s.c(), Xt(s, 1), s.m(e.parentNode, e)) : s && (sf(), on(s, 1, 1, () => { s = null; - }), Od()), /*interactive*/ + }), nf()), /*interactive*/ a[4] && /*mode*/ a[0] === "" ? r ? (r.p(a, o), o & /*interactive, mode*/ - 17 && qt(r, 1)) : (r = c_(a), r.c(), qt(r, 1), r.m(t.parentNode, t)) : r && (Md(), sn(r, 1, 1, () => { + 17 && Xt(r, 1)) : (r = D_(a), r.c(), Xt(r, 1), r.m(t.parentNode, t)) : r && (sf(), on(r, 1, 1, () => { r = null; - }), Od()); + }), nf()); }, i(a) { - i || (qt(s), qt(r), i = !0); + i || (Xt(s), Xt(r), i = !0); }, o(a) { - sn(s), sn(r), i = !1; + on(s), on(r), i = !1; }, d(a) { - a && (At(e), At(t)), s && s.d(a), r && r.d(a); + a && (kt(e), kt(t)), s && s.d(a), r && r.d(a); } }; } -function OM(n) { +function s$(n) { var h; let e, t, i, s, r, a, o = ( /*mode*/ - n[0] === "edit" && l_(n) + n[0] === "edit" && A_(n) ); function u(d, f) { return ( /*mode*/ d[0] === "edit" && /*trimmedDuration*/ - d[12] !== null ? FM : CM + d[12] !== null ? i$ : t$ ); } let l = u(n), c = l(n); - return r = new TM({ + return r = new KM({ props: { i18n: ( /*i18n*/ @@ -38584,7 +38687,7 @@ function OM(n) { (h = n[8]) == null ? void 0 : h.url ) : null ), - $$slots: { default: [PM] }, + $$slots: { default: [n$] }, $$scope: { ctx: n } } }), r.$on( @@ -38593,17 +38696,17 @@ function OM(n) { n[24] ), { c() { - e = Wn("div"), o && o.c(), t = Ka(), i = Wn("div"), c.c(), s = Ka(), Su(r.$$.fragment), this.h(); + e = es("div"), o && o.c(), t = no(), i = es("div"), c.c(), s = no(), qu(r.$$.fragment), this.h(); }, l(d) { - e = zn(d, "DIV", { class: !0 }); - var f = kr(e); - o && o.l(f), t = qa(f), i = zn(f, "DIV", { class: !0, "data-testid": !0 }); - var m = kr(i); - c.l(m), m.forEach(At), f.forEach(At), s = qa(d), Tu(r.$$.fragment, d), this.h(); + e = Jn(d, "DIV", { class: !0 }); + var f = Nr(e); + o && o.l(f), t = io(f), i = Jn(f, "DIV", { class: !0, "data-testid": !0 }); + var m = Nr(i); + c.l(m), m.forEach(kt), f.forEach(kt), s = io(d), Vu(r.$$.fragment, d), this.h(); }, h() { - ji(i, "class", "controls svelte-uu53fr"), ji(i, "data-testid", "waveform-controls"), ji(e, "class", "container svelte-uu53fr"), Vn( + Xi(i, "class", "controls svelte-uu53fr"), Xi(i, "data-testid", "waveform-controls"), Xi(e, "class", "container svelte-uu53fr"), Yn( e, "hidden", /*mode*/ @@ -38611,16 +38714,16 @@ function OM(n) { ); }, m(d, f) { - wn(d, e, f), o && o.m(e, null), ur(e, t), ur(e, i), c.m(i, null), wn(d, s, f), xu(r, d, f), a = !0; + Rn(d, e, f), o && o.m(e, null), br(e, t), br(e, i), c.m(i, null), Rn(d, s, f), ju(r, d, f), a = !0; }, p(d, [f]) { var g; /*mode*/ d[0] === "edit" ? o ? (o.p(d, f), f & /*mode*/ - 1 && qt(o, 1)) : (o = l_(d), o.c(), qt(o, 1), o.m(e, t)) : o && (Md(), sn(o, 1, 1, () => { + 1 && Xt(o, 1)) : (o = A_(d), o.c(), Xt(o, 1), o.m(e, t)) : o && (sf(), on(o, 1, 1, () => { o = null; - }), Od()), l === (l = u(d)) && c ? c.p(d, f) : (c.d(1), c = l(d), c && (c.c(), c.m(i, null))), (!a || f & /*mode*/ - 1) && Vn( + }), nf()), l === (l = u(d)) && c ? c.p(d, f) : (c.d(1), c = l(d), c && (c.c(), c.m(i, null))), (!a || f & /*mode*/ + 1) && Yn( e, "hidden", /*mode*/ @@ -38638,75 +38741,75 @@ function OM(n) { 67110971 && (m.$$scope = { dirty: f, ctx: d }), r.$set(m); }, i(d) { - a || (qt(o), qt(r.$$.fragment, d), a = !0); + a || (Xt(o), Xt(r.$$.fragment, d), a = !0); }, o(d) { - sn(o), sn(r.$$.fragment, d), a = !1; + on(o), on(r.$$.fragment, d), a = !1; }, d(d) { - d && (At(e), At(s)), o && o.d(), c.d(), Au(r, d); + d && (kt(e), kt(s)), o && o.d(), c.d(), Ku(r, d); } }; } -function MM(n, e, t) { - var i = this && this.__awaiter || function(M, P, K, q) { - function W(U) { - return U instanceof K ? U : new K(function(j) { - j(U); +function r$(n, e, t) { + var i = this && this.__awaiter || function(k, q, K, H) { + function Y(B) { + return B instanceof K ? B : new K(function(z) { + z(B); }); } - return new (K || (K = Promise))(function(U, j) { - function $(Q) { + return new (K || (K = Promise))(function(B, z) { + function W(Q) { try { - H(q.next(Q)); - } catch (X) { - j(X); + $(H.next(Q)); + } catch (C) { + z(C); } } function L(Q) { try { - H(q.throw(Q)); - } catch (X) { - j(X); + $(H.throw(Q)); + } catch (C) { + z(C); } } - function H(Q) { - Q.done ? U(Q.value) : W(Q.value).then($, L); + function $(Q) { + Q.done ? B(Q.value) : Y(Q.value).then(W, L); } - H((q = q.apply(M, P || [])).next()); + $((H = H.apply(k, q || [])).next()); }); }; let { videoElement: s } = e, { showRedo: r = !1 } = e, { interactive: a = !0 } = e, { mode: o = "" } = e, { handle_reset_value: u } = e, { handle_trim_video: l } = e, { processingVideo: c = !1 } = e, { i18n: h } = e, { value: d = null } = e, { show_download_button: f = !1 } = e, { handle_clear: m = () => { } } = e, { has_change_history: g = !1 } = e, p, y = null, v = 0, _ = 0, E = !1; - RM(() => i(void 0, void 0, void 0, function* () { - t(13, p = yield rI()); + e$(() => i(void 0, void 0, void 0, function* () { + t(13, p = yield LI()); })); const T = () => { o === "edit" ? (t(0, o = ""), t(12, y = s.duration)) : t(0, o = "edit"); }; - function A(M) { - v = M, t(14, v); + function x(k) { + v = k, t(14, v); } - function S(M) { - _ = M, t(15, _); + function S(k) { + _ = k, t(15, _); } - function D(M) { - y = M, t(12, y), t(0, o), t(2, s); + function D(k) { + y = k, t(12, y), t(0, o), t(2, s); } - function x(M) { - E = M, t(16, E); + function A(k) { + E = k, t(16, E); } const w = () => { - t(0, o = ""), t(1, c = !0), aI(p, v, _, s).then((M) => { - l(M); + t(0, o = ""), t(1, c = !0), II(p, v, _, s).then((k) => { + l(k); }).then(() => { t(1, c = !1); }); }, I = () => { u(), t(0, o = ""); - }, R = () => m(); - return n.$$set = (M) => { - "videoElement" in M && t(2, s = M.videoElement), "showRedo" in M && t(3, r = M.showRedo), "interactive" in M && t(4, a = M.interactive), "mode" in M && t(0, o = M.mode), "handle_reset_value" in M && t(5, u = M.handle_reset_value), "handle_trim_video" in M && t(6, l = M.handle_trim_video), "processingVideo" in M && t(1, c = M.processingVideo), "i18n" in M && t(7, h = M.i18n), "value" in M && t(8, d = M.value), "show_download_button" in M && t(9, f = M.show_download_button), "handle_clear" in M && t(10, m = M.handle_clear), "has_change_history" in M && t(11, g = M.has_change_history); + }, M = () => m(); + return n.$$set = (k) => { + "videoElement" in k && t(2, s = k.videoElement), "showRedo" in k && t(3, r = k.showRedo), "interactive" in k && t(4, a = k.interactive), "mode" in k && t(0, o = k.mode), "handle_reset_value" in k && t(5, u = k.handle_reset_value), "handle_trim_video" in k && t(6, l = k.handle_trim_video), "processingVideo" in k && t(1, c = k.processingVideo), "i18n" in k && t(7, h = k.i18n), "value" in k && t(8, d = k.value), "show_download_button" in k && t(9, f = k.show_download_button), "handle_clear" in k && t(10, m = k.handle_clear), "has_change_history" in k && t(11, g = k.has_change_history); }, n.$$.update = () => { n.$$.dirty & /*mode, trimmedDuration, videoElement*/ 4101 && o === "edit" && y === null && s && t(12, y = s.duration); @@ -38729,18 +38832,18 @@ function MM(n, e, t) { _, E, T, - A, + x, S, D, - x, + A, w, I, - R + M ]; } -class $M extends SM { +class a$ extends jM { constructor(e) { - super(), xM(this, e, MM, OM, LM, { + super(), WM(this, e, r$, s$, QM, { videoElement: 2, showRedo: 3, interactive: 4, @@ -38757,150 +38860,168 @@ class $M extends SM { } } const { - SvelteComponent: BM, - add_flush_callback: va, - append_hydration: Ct, - attr: ct, - bind: ya, - binding_callbacks: Ea, - bubble: NM, - check_outros: h_, - children: Nn, - claim_component: Rr, - claim_element: yn, - claim_space: ha, - claim_text: wh, - create_component: Cr, - destroy_component: Fr, - detach: Xt, - element: En, - empty: d_, - group_outros: f_, - init: UM, - insert_hydration: xl, - listen: ls, - mount_component: Pr, - prevent_default: m_, - run_all: GM, - safe_not_equal: HM, - set_data: g_, - space: da, - src_url_equal: p_, - stop_propagation: VM, - text: Lh, - toggle_class: __, - transition_in: bi, - transition_out: Ki -} = window.__gradio__svelte__internal, { createEventDispatcher: qM } = window.__gradio__svelte__internal; -function KM(n) { + SvelteComponent: o$, + add_flush_callback: Ia, + append_hydration: qt, + attr: tt, + bind: ka, + binding_callbacks: Ra, + check_outros: w_, + children: fr, + claim_component: Eo, + claim_element: An, + claim_space: Ta, + claim_text: zh, + create_component: bo, + destroy_component: To, + detach: ki, + element: xn, + empty: L_, + get_svelte_dataset: l$, + group_outros: I_, + init: u$, + insert_hydration: Na, + listen: Dl, + mount_component: So, + run_all: c$, + safe_not_equal: h$, + set_data: k_, + space: Sa, + src_url_equal: R_, + text: Wh, + toggle_class: C_, + transition_in: Yi, + transition_out: kn +} = window.__gradio__svelte__internal, { createEventDispatcher: d$, onMount: f$, tick: m$ } = window.__gradio__svelte__internal; +function F_(n) { + let e, t = "Loading video..."; + return { + c() { + e = xn("div"), e.textContent = t, this.h(); + }, + l(i) { + e = An(i, "DIV", { class: !0, "data-svelte-h": !0 }), l$(e) !== "svelte-d8rgjs" && (e.textContent = t), this.h(); + }, + h() { + tt(e, "class", "loading-spinner svelte-bmp2ea"); + }, + m(i, s) { + Na(i, e, s); + }, + d(i) { + i && ki(e); + } + }; +} +function g$(n) { let e, t; return { c() { - e = En("track"), this.h(); + e = xn("track"), this.h(); }, l(i) { - e = yn(i, "TRACK", { kind: !0, src: !0 }), this.h(); + e = An(i, "TRACK", { kind: !0, src: !0 }), this.h(); }, h() { - ct(e, "kind", "captions"), p_(e.src, t = /*subtitle*/ - n[1]) || ct(e, "src", t), e.default = !0; + tt(e, "kind", "captions"), R_(e.src, t = /*subtitle*/ + n[1]) || tt(e, "src", t), e.default = !0; }, m(i, s) { - xl(i, e, s); + Na(i, e, s); }, p(i, s) { s[0] & /*subtitle*/ - 2 && !p_(e.src, t = /*subtitle*/ - i[1]) && ct(e, "src", t); + 2 && !R_(e.src, t = /*subtitle*/ + i[1]) && tt(e, "src", t); }, d(i) { - i && Xt(e); + i && ki(e); } }; } -function jM(n) { +function p$(n) { let e, t; - return e = new VS({}), { + return e = new ZS({}), { c() { - Cr(e.$$.fragment); + bo(e.$$.fragment); }, l(i) { - Rr(e.$$.fragment, i); + Eo(e.$$.fragment, i); }, m(i, s) { - Pr(e, i, s), t = !0; + So(e, i, s), t = !0; }, i(i) { - t || (bi(e.$$.fragment, i), t = !0); + t || (Yi(e.$$.fragment, i), t = !0); }, o(i) { - Ki(e.$$.fragment, i), t = !1; + kn(e.$$.fragment, i), t = !1; }, d(i) { - Fr(e, i); + To(e, i); } }; } -function zM(n) { +function _$(n) { let e, t; - return e = new XS({}), { + return e = new rA({}), { c() { - Cr(e.$$.fragment); + bo(e.$$.fragment); }, l(i) { - Rr(e.$$.fragment, i); + Eo(e.$$.fragment, i); }, m(i, s) { - Pr(e, i, s), t = !0; + So(e, i, s), t = !0; }, i(i) { - t || (bi(e.$$.fragment, i), t = !0); + t || (Yi(e.$$.fragment, i), t = !0); }, o(i) { - Ki(e.$$.fragment, i), t = !1; + kn(e.$$.fragment, i), t = !1; }, d(i) { - Fr(e, i); + To(e, i); } }; } -function WM(n) { +function v$(n) { let e, t; - return e = new ef({}), { + return e = new Tf({}), { c() { - Cr(e.$$.fragment); + bo(e.$$.fragment); }, l(i) { - Rr(e.$$.fragment, i); + Eo(e.$$.fragment, i); }, m(i, s) { - Pr(e, i, s), t = !0; + So(e, i, s), t = !0; }, i(i) { - t || (bi(e.$$.fragment, i), t = !0); + t || (Yi(e.$$.fragment, i), t = !0); }, o(i) { - Ki(e.$$.fragment, i), t = !1; + kn(e.$$.fragment, i), t = !1; }, d(i) { - Fr(e, i); + To(e, i); } }; } -function v_(n) { +function P_(n) { let e, t, i; function s(a) { - n[38](a); + n[41](a); } let r = { videoElement: ( /*video*/ - n[16] + n[17] ), showRedo: !0, handle_trim_video: ( /*handle_trim_video*/ - n[24] + n[26] ), handle_reset_value: ( /*handle_reset_value*/ @@ -38929,22 +39050,22 @@ function v_(n) { }; return ( /*processingVideo*/ - n[18] !== void 0 && (r.processingVideo = /*processingVideo*/ - n[18]), e = new $M({ props: r }), Ea.push(() => ya(e, "processingVideo", s)), { + n[19] !== void 0 && (r.processingVideo = /*processingVideo*/ + n[19]), e = new a$({ props: r }), Ra.push(() => ka(e, "processingVideo", s)), { c() { - Cr(e.$$.fragment); + bo(e.$$.fragment); }, l(a) { - Rr(e.$$.fragment, a); + Eo(e.$$.fragment, a); }, m(a, o) { - Pr(e, a, o), i = !0; + So(e, a, o), i = !0; }, p(a, o) { const u = {}; o[0] & /*video*/ - 65536 && (u.videoElement = /*video*/ - a[16]), o[0] & /*handle_reset_value*/ + 131072 && (u.videoElement = /*video*/ + a[17]), o[0] & /*handle_reset_value*/ 128 && (u.handle_reset_value = /*handle_reset_value*/ a[7]), o[0] & /*value*/ 2048 && (u.value = /*value*/ @@ -38957,42 +39078,44 @@ function v_(n) { a[12]), o[0] & /*has_change_history*/ 8192 && (u.has_change_history = /*has_change_history*/ a[13]), !t && o[0] & /*processingVideo*/ - 262144 && (t = !0, u.processingVideo = /*processingVideo*/ - a[18], va(() => t = !1)), e.$set(u); + 524288 && (t = !0, u.processingVideo = /*processingVideo*/ + a[19], Ia(() => t = !1)), e.$set(u); }, i(a) { - i || (bi(e.$$.fragment, a), i = !0); + i || (Yi(e.$$.fragment, a), i = !0); }, o(a) { - Ki(e.$$.fragment, a), i = !1; + kn(e.$$.fragment, a), i = !1; }, d(a) { - Fr(e, a); + To(e, a); } } ); } -function YM(n) { - let e, t, i, s, r, a, o, u, l, c, h, d, f, m, g, p = sr( +function y$(n) { + var Q; + let e, t, i, s, r, a, o, u, l, c, h, d, f, m, g, p, y = pr( /*time*/ - n[14] - ) + "", y, v, _ = sr( - /*duration*/ n[15] - ) + "", E, T, A, S, D, x, w, I, R, M, P, K; + ) + "", v, _, E = pr( + /*duration*/ + n[16] + ) + "", T, x, S, D, A, w, I, M, k = !/*video*/ + ((Q = n[17]) != null && Q.videoWidth) && F_(); function q(C) { - n[30](C); - } - function W(C) { n[31](C); } - function U(C) { + function K(C) { n[32](C); } - function j(C) { + function H(C) { n[33](C); } - let $ = { + function Y(C) { + n[34](C); + } + let B = { src: ( /*src*/ n[0] @@ -39014,349 +39137,369 @@ function YM(n) { n[5]}-player`, processingVideo: ( /*processingVideo*/ - n[18] + n[19] + ), + fullscreen: ( + /*fullscreen*/ + n[14] ), - $$slots: { default: [KM] }, + $$slots: { default: [g$] }, $$scope: { ctx: n } }; /*time*/ - n[14] !== void 0 && ($.currentTime = /*time*/ - n[14]), /*duration*/ - n[15] !== void 0 && ($.duration = /*duration*/ - n[15]), /*paused*/ - n[17] !== void 0 && ($.paused = /*paused*/ - n[17]), /*video*/ - n[16] !== void 0 && ($.node = /*video*/ - n[16]), i = new MF({ props: $ }), Ea.push(() => ya(i, "currentTime", q)), Ea.push(() => ya(i, "duration", W)), Ea.push(() => ya(i, "paused", U)), Ea.push(() => ya(i, "node", j)), i.$on( + n[15] !== void 0 && (B.currentTime = /*time*/ + n[15]), /*duration*/ + n[16] !== void 0 && (B.duration = /*duration*/ + n[16]), /*paused*/ + n[18] !== void 0 && (B.paused = /*paused*/ + n[18]), /*video*/ + n[17] !== void 0 && (B.node = /*video*/ + n[17]), s = new rP({ props: B }), Ra.push(() => ka(s, "currentTime", q)), Ra.push(() => ka(s, "duration", K)), Ra.push(() => ka(s, "paused", H)), Ra.push(() => ka(s, "node", Y)), s.$on( "click", /*play_pause*/ - n[21] - ), i.$on( + n[24] + ), s.$on( "play", /*play_handler*/ - n[34] - ), i.$on( + n[35] + ), s.$on( "pause", /*pause_handler*/ - n[35] - ), i.$on( + n[36] + ), s.$on( "loadeddata", /*loadeddata_handler*/ - n[36] - ), i.$on( + n[37] + ), s.$on( + "loadedmetadata", + /*loadedmetadata_handler*/ + n[38] + ), s.$on( "error", /*error_handler*/ - n[37] - ), i.$on( + n[39] + ), s.$on( "ended", /*handle_end*/ - n[23] + n[25] ); - const L = [WM, zM, jM], H = []; - function Q(C, B) { + const z = [v$, _$, p$], W = []; + function L(C, O) { return ( /*time*/ - C[14] === /*duration*/ - C[15] ? 0 : ( + C[15] === /*duration*/ + C[16] ? 0 : ( /*paused*/ - C[17] ? 1 : 2 + C[18] ? 1 : 2 ) ); } - d = Q(n), f = H[d] = L[d](n), w = new AS({}); - let X = ( + f = L(n), m = W[f] = z[f](n); + let $ = ( /*interactive*/ - n[6] && v_(n) + n[6] && P_(n) ); return { c() { - e = En("div"), t = En("div"), Cr(i.$$.fragment), u = da(), l = En("div"), c = En("div"), h = En("span"), f.c(), m = da(), g = En("span"), y = Lh(p), v = Lh(" / "), E = Lh(_), T = da(), A = En("progress"), D = da(), x = En("div"), Cr(w.$$.fragment), I = da(), X && X.c(), R = d_(), this.h(); + e = xn("div"), k && k.c(), t = Sa(), i = xn("div"), bo(s.$$.fragment), l = Sa(), c = xn("div"), h = xn("div"), d = xn("span"), m.c(), g = Sa(), p = xn("span"), v = Wh(y), _ = Wh(" / "), T = Wh(E), x = Sa(), S = xn("input"), D = Sa(), $ && $.c(), A = L_(), this.h(); }, l(C) { - e = yn(C, "DIV", { class: !0 }); - var B = Nn(e); - t = yn(B, "DIV", { class: !0 }); - var N = Nn(t); - Rr(i.$$.fragment, N), N.forEach(Xt), u = ha(B), l = yn(B, "DIV", { class: !0 }); - var G = Nn(l); - c = yn(G, "DIV", { class: !0 }); - var Y = Nn(c); - h = yn(Y, "SPAN", { + e = An(C, "DIV", { class: !0 }); + var O = fr(e); + k && k.l(O), t = Ta(O), i = An(O, "DIV", { class: !0 }); + var N = fr(i); + Eo(s.$$.fragment, N), N.forEach(ki), l = Ta(O), c = An(O, "DIV", { class: !0 }); + var ee = fr(c); + h = An(ee, "DIV", { class: !0 }); + var G = fr(h); + d = An(G, "SPAN", { role: !0, tabindex: !0, class: !0, "aria-label": !0 }); - var ee = Nn(h); - f.l(ee), ee.forEach(Xt), m = ha(Y), g = yn(Y, "SPAN", { class: !0 }); - var se = Nn(g); - y = wh(se, p), v = wh(se, " / "), E = wh(se, _), se.forEach(Xt), T = ha(Y), A = yn(Y, "PROGRESS", { class: !0 }), Nn(A).forEach(Xt), D = ha(Y), x = yn(Y, "DIV", { - role: !0, - tabindex: !0, - class: !0, - "aria-label": !0 - }); - var ye = Nn(x); - Rr(w.$$.fragment, ye), ye.forEach(Xt), Y.forEach(Xt), G.forEach(Xt), B.forEach(Xt), I = ha(C), X && X.l(C), R = d_(), this.h(); + var Z = fr(d); + m.l(Z), Z.forEach(ki), g = Ta(G), p = An(G, "SPAN", { class: !0 }); + var U = fr(p); + v = zh(U, y), _ = zh(U, " / "), T = zh(U, E), U.forEach(ki), x = Ta(G), S = An(G, "INPUT", { + type: !0, + min: !0, + max: !0, + step: !0, + "aria-label": !0, + class: !0 + }), G.forEach(ki), ee.forEach(ki), O.forEach(ki), D = Ta(C), $ && $.l(C), A = L_(), this.h(); }, h() { - ct(t, "class", "mirror-wrap svelte-yzke89"), __( - t, + tt(i, "class", "mirror-wrap svelte-bmp2ea"), C_( + i, "mirror", /*mirror*/ n[2] - ), ct(h, "role", "button"), ct(h, "tabindex", "0"), ct(h, "class", "icon svelte-yzke89"), ct(h, "aria-label", "play-pause-replay-button"), ct(g, "class", "time svelte-yzke89"), A.value = S = /*time*/ - n[14] / /*duration*/ - n[15] || 0, ct(A, "class", "svelte-yzke89"), ct(x, "role", "button"), ct(x, "tabindex", "0"), ct(x, "class", "icon svelte-yzke89"), ct(x, "aria-label", "full-screen"), ct(c, "class", "inner svelte-yzke89"), ct(l, "class", "controls svelte-yzke89"), ct(e, "class", "wrap svelte-yzke89"); + ), tt(d, "role", "button"), tt(d, "tabindex", "0"), tt(d, "class", "icon svelte-bmp2ea"), tt(d, "aria-label", "play-pause-replay-button"), tt(p, "class", "time svelte-bmp2ea"), tt(S, "type", "range"), tt(S, "min", "0"), tt(S, "max", "100"), tt(S, "step", "0.1"), S.value = /*progressValue*/ + n[20], tt(S, "aria-label", "Video progress"), tt(S, "class", "svelte-bmp2ea"), tt(h, "class", "inner svelte-bmp2ea"), tt(c, "class", "controls svelte-bmp2ea"), tt(e, "class", "wrap svelte-bmp2ea"); }, - m(C, B) { - xl(C, e, B), Ct(e, t), Pr(i, t, null), Ct(e, u), Ct(e, l), Ct(l, c), Ct(c, h), H[d].m(h, null), Ct(c, m), Ct(c, g), Ct(g, y), Ct(g, v), Ct(g, E), Ct(c, T), Ct(c, A), Ct(c, D), Ct(c, x), Pr(w, x, null), xl(C, I, B), X && X.m(C, B), xl(C, R, B), M = !0, P || (K = [ - ls( - h, + m(C, O) { + Na(C, e, O), k && k.m(e, null), qt(e, t), qt(e, i), So(s, i, null), qt(e, l), qt(e, c), qt(c, h), qt(h, d), W[f].m(d, null), qt(h, g), qt(h, p), qt(p, v), qt(p, _), qt(p, T), qt(h, x), qt(h, S), Na(C, D, O), $ && $.m(C, O), Na(C, A, O), w = !0, I || (M = [ + Dl( + d, "click", /*play_pause*/ - n[21] + n[24] ), - ls( - h, + Dl( + d, "keydown", - /*play_pause*/ - n[21] - ), - ls( - A, - "mousemove", - /*handleMove*/ - n[20] + /*keydown_handler*/ + n[40] ), - ls(A, "touchmove", m_( + Dl( + S, + "input", /*handleMove*/ - n[20] - )), - ls(A, "click", VM(m_( - /*handle_click*/ n[22] - ))), - ls( - x, - "click", - /*open_full_screen*/ - n[25] ), - ls( - x, - "keypress", - /*open_full_screen*/ - n[25] + Dl( + S, + "keydown", + /*handleKeydown*/ + n[23] ) - ], P = !0); + ], I = !0); }, - p(C, B) { + p(C, O) { + var G; + /*video*/ + (G = C[17]) != null && G.videoWidth ? k && (k.d(1), k = null) : k || (k = F_(), k.c(), k.m(e, t)); const N = {}; - B[0] & /*src*/ + O[0] & /*src*/ 1 && (N.src = /*src*/ - C[0]), B[0] & /*loop*/ + C[0]), O[0] & /*loop*/ 8 && (N.loop = /*loop*/ - C[3]), B[0] & /*muted*/ + C[3]), O[0] & /*muted*/ 16 && (N.muted = /*muted*/ - C[4]), B[0] & /*is_stream*/ + C[4]), O[0] & /*is_stream*/ 256 && (N.is_stream = /*is_stream*/ - C[8]), B[0] & /*label*/ + C[8]), O[0] & /*label*/ 32 && (N["data-testid"] = `${/*label*/ - C[5]}-player`), B[0] & /*processingVideo*/ - 262144 && (N.processingVideo = /*processingVideo*/ - C[18]), B[0] & /*subtitle*/ - 2 | B[1] & /*$$scope*/ - 512 && (N.$$scope = { dirty: B, ctx: C }), !s && B[0] & /*time*/ - 16384 && (s = !0, N.currentTime = /*time*/ - C[14], va(() => s = !1)), !r && B[0] & /*duration*/ - 32768 && (r = !0, N.duration = /*duration*/ - C[15], va(() => r = !1)), !a && B[0] & /*paused*/ - 131072 && (a = !0, N.paused = /*paused*/ - C[17], va(() => a = !1)), !o && B[0] & /*video*/ - 65536 && (o = !0, N.node = /*video*/ - C[16], va(() => o = !1)), i.$set(N), (!M || B[0] & /*mirror*/ - 4) && __( - t, + C[5]}-player`), O[0] & /*processingVideo*/ + 524288 && (N.processingVideo = /*processingVideo*/ + C[19]), O[0] & /*fullscreen*/ + 16384 && (N.fullscreen = /*fullscreen*/ + C[14]), O[0] & /*subtitle*/ + 2 | O[1] & /*$$scope*/ + 4096 && (N.$$scope = { dirty: O, ctx: C }), !r && O[0] & /*time*/ + 32768 && (r = !0, N.currentTime = /*time*/ + C[15], Ia(() => r = !1)), !a && O[0] & /*duration*/ + 65536 && (a = !0, N.duration = /*duration*/ + C[16], Ia(() => a = !1)), !o && O[0] & /*paused*/ + 262144 && (o = !0, N.paused = /*paused*/ + C[18], Ia(() => o = !1)), !u && O[0] & /*video*/ + 131072 && (u = !0, N.node = /*video*/ + C[17], Ia(() => u = !1)), s.$set(N), (!w || O[0] & /*mirror*/ + 4) && C_( + i, "mirror", /*mirror*/ C[2] ); - let G = d; - d = Q(C), d !== G && (f_(), Ki(H[G], 1, 1, () => { - H[G] = null; - }), h_(), f = H[d], f || (f = H[d] = L[d](C), f.c()), bi(f, 1), f.m(h, null)), (!M || B[0] & /*time*/ - 16384) && p !== (p = sr( + let ee = f; + f = L(C), f !== ee && (I_(), kn(W[ee], 1, 1, () => { + W[ee] = null; + }), w_(), m = W[f], m || (m = W[f] = z[f](C), m.c()), Yi(m, 1), m.m(d, null)), (!w || O[0] & /*time*/ + 32768) && y !== (y = pr( /*time*/ - C[14] - ) + "") && g_(y, p), (!M || B[0] & /*duration*/ - 32768) && _ !== (_ = sr( - /*duration*/ C[15] - ) + "") && g_(E, _), (!M || B[0] & /*time, duration*/ - 49152 && S !== (S = /*time*/ - C[14] / /*duration*/ - C[15] || 0)) && (A.value = S), /*interactive*/ - C[6] ? X ? (X.p(C, B), B[0] & /*interactive*/ - 64 && bi(X, 1)) : (X = v_(C), X.c(), bi(X, 1), X.m(R.parentNode, R)) : X && (f_(), Ki(X, 1, 1, () => { - X = null; - }), h_()); + ) + "") && k_(v, y), (!w || O[0] & /*duration*/ + 65536) && E !== (E = pr( + /*duration*/ + C[16] + ) + "") && k_(T, E), (!w || O[0] & /*progressValue*/ + 1048576) && (S.value = /*progressValue*/ + C[20]), /*interactive*/ + C[6] ? $ ? ($.p(C, O), O[0] & /*interactive*/ + 64 && Yi($, 1)) : ($ = P_(C), $.c(), Yi($, 1), $.m(A.parentNode, A)) : $ && (I_(), kn($, 1, 1, () => { + $ = null; + }), w_()); }, i(C) { - M || (bi(i.$$.fragment, C), bi(f), bi(w.$$.fragment, C), bi(X), M = !0); + w || (Yi(s.$$.fragment, C), Yi(m), Yi($), w = !0); }, o(C) { - Ki(i.$$.fragment, C), Ki(f), Ki(w.$$.fragment, C), Ki(X), M = !1; + kn(s.$$.fragment, C), kn(m), kn($), w = !1; }, d(C) { - C && (Xt(e), Xt(I), Xt(R)), Fr(i), H[d].d(), Fr(w), X && X.d(C), P = !1, GM(K); + C && (ki(e), ki(D), ki(A)), k && k.d(), To(s), W[f].d(), $ && $.d(C), I = !1, c$(M); } }; } -function XM(n, e, t) { - var i = this && this.__awaiter || function(N, G, Y, ee) { - function se(ye) { - return ye instanceof Y ? ye : new Y(function(Pe) { - Pe(ye); +function wl(n) { + var e, t; + if (!n) { + const r = ((e = n == null ? void 0 : n.parentElement) === null || e === void 0 ? void 0 : e.getBoundingClientRect()) || { width: 640, height: 360 }; + return { + top: 0, + left: 0, + width: r.width, + height: r.height + }; + } + const i = n.getBoundingClientRect(), s = ((t = n.parentElement) === null || t === void 0 ? void 0 : t.getBoundingClientRect()) || i; + return { + top: i.top - s.top, + left: i.left - s.left, + width: i.width, + height: i.height + }; +} +function E$(n, e, t) { + let i; + var s = this && this.__awaiter || function(U, re, j, Ee) { + function Oe(je) { + return je instanceof j ? je : new j(function(se) { + se(je); }); } - return new (Y || (Y = Promise))(function(ye, Pe) { - function Ke(he) { + return new (j || (j = Promise))(function(je, se) { + function ve(Ve) { try { - ae(ee.next(he)); - } catch (Se) { - Pe(Se); + Ye(Ee.next(Ve)); + } catch (Gt) { + se(Gt); } } - function jt(he) { + function Fe(Ve) { try { - ae(ee.throw(he)); - } catch (Se) { - Pe(Se); + Ye(Ee.throw(Ve)); + } catch (Gt) { + se(Gt); } } - function ae(he) { - he.done ? ye(he.value) : se(he.value).then(Ke, jt); + function Ye(Ve) { + Ve.done ? je(Ve.value) : Oe(Ve.value).then(ve, Fe); } - ae((ee = ee.apply(N, G || [])).next()); + Ye((Ee = Ee.apply(U, re || [])).next()); }); }; - let { root: s = "" } = e, { src: r } = e, { subtitle: a = null } = e, { mirror: o } = e, { loop: u } = e, { muted: l = !1 } = e, { label: c = "test" } = e, { interactive: h = !1 } = e, { handle_change: d = () => { - } } = e, { handle_reset_value: f = () => { - } } = e, { upload: m } = e, { is_stream: g } = e, { i18n: p } = e, { show_download_button: y = !1 } = e, { value: v = null } = e, { handle_clear: _ = () => { - } } = e, { has_change_history: E = !1 } = e; - const T = qM(); - let A = 0, S, D = !0, x, { video_el: w } = e, I = !1; - function R(N) { - if (!S) return; - if (N.type === "click") { - P(N); - return; - } - if (N.type !== "touchmove" && !(N.buttons & 1)) return; - const G = N.type === "touchmove" ? N.touches[0].clientX : N.clientX, { left: Y, right: ee } = N.currentTarget.getBoundingClientRect(); - t(14, A = S * (G - Y) / (ee - Y)); - } - function M() { - return i(this, void 0, void 0, function* () { - document.fullscreenElement != x && (x.currentTime > 0 && !x.paused && !x.ended && x.readyState > x.HAVE_CURRENT_DATA ? x.pause() : yield x.play()); + let { root: r = "" } = e, { src: a } = e, { subtitle: o = null } = e, { mirror: u } = e, { loop: l } = e, { muted: c = !1 } = e, { label: h = "test" } = e, { interactive: d = !1 } = e, { handle_change: f = () => { + } } = e, { handle_reset_value: m = () => { + } } = e, { upload: g } = e, { is_stream: p } = e, { i18n: y } = e, { show_download_button: v = !1 } = e, { value: _ = null } = e, { handle_clear: E = () => { + } } = e, { has_change_history: T = !1 } = e, { fullscreen: x = !1 } = e; + const S = d$(); + let D = 0, A, w = !0, I, { video_el: M } = e, k = !1; + function q(U) { + if (!A) return; + const re = U.currentTarget; + t(15, D = A * (parseFloat(re.value) / 100)); + } + function K(U) { + A && (U.key === "ArrowLeft" ? t(15, D = Math.max(0, D - 5)) : U.key === "ArrowRight" && t(15, D = Math.min(A, D + 5))); + } + function H() { + return s(this, void 0, void 0, function* () { + I.currentTime > 0 && !I.paused && !I.ended && I.readyState > I.HAVE_CURRENT_DATA ? I.pause() : yield I.play(); }); } - function P(N) { - const { left: G, right: Y } = N.currentTarget.getBoundingClientRect(); - t(14, A = S * (N.clientX - G) / (Y - G)); - } - function K() { - T("stop"), T("end"); + function Y() { + S("stop"), S("end"); } - const q = (N) => i(void 0, void 0, void 0, function* () { - var G; - let Y = new File([N], "video.mp4"); - const ee = yield If([Y]); - let se = ((G = yield m(ee, s)) === null || G === void 0 ? void 0 : G.filter(Boolean))[0]; - d(se); + const B = (U) => s(void 0, void 0, void 0, function* () { + var re; + let j = new File([U], "video.mp4"); + const Ee = yield Xf([j]); + let Oe = ((re = yield g(Ee, r)) === null || re === void 0 ? void 0 : re.filter(Boolean))[0]; + f(Oe); }); - function W() { - x.requestFullscreen(); - } - function U(N) { - A = N, t(14, A); - } - function j(N) { - S = N, t(15, S); + f$(() => { + const U = new ResizeObserver(() => s(void 0, void 0, void 0, function* () { + yield m$(), S("load", wl(I)); + })); + return I && U.observe(I), () => { + U.disconnect(); + }; + }); + function z(U) { + D = U, t(15, D); } - function $(N) { - D = N, t(17, D); + function W(U) { + A = U, t(16, A); } - function L(N) { - x = N, t(16, x); + function L(U) { + w = U, t(18, w); } - const H = () => T("play"), Q = () => T("pause"), X = () => T("loadeddata"); - function C(N) { - NM.call(this, n, N); + function $(U) { + I = U, t(17, I); } - function B(N) { - I = N, t(18, I); + const Q = () => S("play"), C = () => S("pause"), O = () => S("load", wl(I)), N = () => S("load", wl(I)), ee = (U) => S("error", U), G = (U) => { + (U.key === "Enter" || U.key === " ") && H(); + }; + function Z(U) { + k = U, t(19, k); } - return n.$$set = (N) => { - "root" in N && t(27, s = N.root), "src" in N && t(0, r = N.src), "subtitle" in N && t(1, a = N.subtitle), "mirror" in N && t(2, o = N.mirror), "loop" in N && t(3, u = N.loop), "muted" in N && t(4, l = N.muted), "label" in N && t(5, c = N.label), "interactive" in N && t(6, h = N.interactive), "handle_change" in N && t(28, d = N.handle_change), "handle_reset_value" in N && t(7, f = N.handle_reset_value), "upload" in N && t(29, m = N.upload), "is_stream" in N && t(8, g = N.is_stream), "i18n" in N && t(9, p = N.i18n), "show_download_button" in N && t(10, y = N.show_download_button), "value" in N && t(11, v = N.value), "handle_clear" in N && t(12, _ = N.handle_clear), "has_change_history" in N && t(13, E = N.has_change_history), "video_el" in N && t(26, w = N.video_el); + return n.$$set = (U) => { + "root" in U && t(28, r = U.root), "src" in U && t(0, a = U.src), "subtitle" in U && t(1, o = U.subtitle), "mirror" in U && t(2, u = U.mirror), "loop" in U && t(3, l = U.loop), "muted" in U && t(4, c = U.muted), "label" in U && t(5, h = U.label), "interactive" in U && t(6, d = U.interactive), "handle_change" in U && t(29, f = U.handle_change), "handle_reset_value" in U && t(7, m = U.handle_reset_value), "upload" in U && t(30, g = U.upload), "is_stream" in U && t(8, p = U.is_stream), "i18n" in U && t(9, y = U.i18n), "show_download_button" in U && t(10, v = U.show_download_button), "value" in U && t(11, _ = U.value), "handle_clear" in U && t(12, E = U.handle_clear), "has_change_history" in U && t(13, T = U.has_change_history), "fullscreen" in U && t(14, x = U.fullscreen), "video_el" in U && t(27, M = U.video_el); }, n.$$.update = () => { n.$$.dirty[0] & /*time*/ - 16384 && t(14, A = A || 0), n.$$.dirty[0] & /*duration*/ - 32768 && t(15, S = S || 0), n.$$.dirty[0] & /*video*/ - 65536 && t(26, w = x); + 32768 && t(15, D = D || 0), n.$$.dirty[0] & /*duration*/ + 65536 && t(16, A = A || 0), n.$$.dirty[0] & /*video*/ + 131072 && t(27, M = I), n.$$.dirty[0] & /*duration, time*/ + 98304 && t(20, i = A ? D / A * 100 : 0), n.$$.dirty[0] & /*video*/ + 131072 && I && S("load", wl(I)); }, [ - r, a, o, u, l, c, h, - f, - g, + d, + m, p, y, v, _, E, - A, - S, + T, x, D, + A, I, - T, - R, - M, - P, - K, + w, + k, + i, + S, q, + K, + H, + Y, + B, + M, + r, + f, + g, + z, W, - w, - s, - d, - m, - U, - j, - $, L, - H, + $, Q, - X, C, - B + O, + N, + ee, + G, + Z ]; } -class Ff extends BM { +class em extends o$ { constructor(e) { - super(), UM( + super(), u$( this, e, - XM, - YM, - HM, + E$, + y$, + h$, { - root: 27, + root: 28, src: 0, subtitle: 1, mirror: 2, @@ -39364,16 +39507,17 @@ class Ff extends BM { muted: 4, label: 5, interactive: 6, - handle_change: 28, + handle_change: 29, handle_reset_value: 7, - upload: 29, + upload: 30, is_stream: 8, i18n: 9, show_download_button: 10, value: 11, handle_clear: 12, has_change_history: 13, - video_el: 26 + fullscreen: 14, + video_el: 27 }, null, [-1, -1] @@ -39381,379 +39525,483 @@ class Ff extends BM { } } const { - SvelteComponent: QM, - add_flush_callback: Pf, - append_hydration: tr, - attr: Un, - bind: Of, - binding_callbacks: Mf, - bubble: ZM, - check_outros: pr, - children: ol, - claim_component: Li, - claim_element: ll, - claim_space: _r, - create_component: Ii, - destroy_component: ki, - detach: zi, - element: ul, - empty: Zl, - group_outros: vr, - init: JM, - insert_hydration: yr, - listen: y_, - mount_component: Ri, - noop: e$, - run_all: t$, - safe_not_equal: i$, - space: Er, - transition_in: Ie, - transition_out: Ne -} = window.__gradio__svelte__internal, { createEventDispatcher: n$ } = window.__gradio__svelte__internal; -function s$(n) { - let e, t, i, s, r, a, o, u, l, c, h, d, f; - t = new cv({ + SvelteComponent: b$, + add_flush_callback: so, + append_hydration: Yh, + attr: Ut, + bind: ro, + binding_callbacks: Ur, + bubble: Ll, + check_outros: As, + children: ks, + claim_component: mi, + claim_element: Rs, + claim_space: Lr, + create_component: gi, + destroy_component: pi, + detach: st, + element: Cs, + empty: pu, + group_outros: xs, + init: T$, + insert_hydration: ai, + listen: Fs, + mount_component: _i, + noop: S$, + run_all: tm, + safe_not_equal: A$, + space: Ir, + stop_propagation: Gr, + transition_in: be, + transition_out: Me +} = window.__gradio__svelte__internal, { createEventDispatcher: x$, onMount: D$, onDestroy: Uj, tick: Gj } = window.__gradio__svelte__internal; +function w$(n) { + let e, t, i, s, r, a, o, u, l, c, h; + i = new Dv({ props: { - $$slots: { default: [o$] }, + $$slots: { default: [k$] }, $$scope: { ctx: n } } }); - let m = ( - /*value*/ - n[1][0] && S_(n) - ), g = ( - /*value*/ - n[1][1] && A_(n) - ); - function p(v) { - n[25](v); + function d(g) { + n[38](g); } - let y = { slider_color: ( - /*slider_color*/ - n[6] - ) }; + function f(g) { + n[39](g); + } + let m = { + slider_color: ( + /*slider_color*/ + n[7] + ), + image_size: ( + /*image_size*/ + n[16] + ), + disabled: ( + /*isInteractingWithButtons*/ + n[18] + ), + $$slots: { default: [R$] }, + $$scope: { ctx: n } + }; return ( /*position*/ - n[0] !== void 0 && (y.position = /*position*/ - n[0]), l = new zL({ props: y }), Mf.push(() => Of(l, "position", p)), { + n[0] !== void 0 && (m.position = /*position*/ + n[0]), /*main_wrapper_el*/ + n[15] !== void 0 && (m.parent_el = /*main_wrapper_el*/ + n[15]), a = new pI({ props: m }), Ur.push(() => ro(a, "position", d)), Ur.push(() => ro(a, "parent_el", f)), { c() { - e = ul("div"), Ii(t.$$.fragment), i = Er(), s = ul("div"), r = ul("div"), m && m.c(), a = Er(), o = ul("div"), g && g.c(), u = Er(), Ii(l.$$.fragment), this.h(); + e = Cs("div"), t = Cs("div"), gi(i.$$.fragment), s = Ir(), r = Cs("div"), gi(a.$$.fragment), this.h(); }, - l(v) { - e = ll(v, "DIV", { class: !0 }); - var _ = ol(e); - Li(t.$$.fragment, _), i = _r(_), s = ll(_, "DIV", { class: !0, role: !0, tabindex: !0 }); - var E = ol(s); - r = ll(E, "DIV", { class: !0 }); - var T = ol(r); - m && m.l(T), T.forEach(zi), a = _r(E), o = ll(E, "DIV", { class: !0, style: !0 }); - var A = ol(o); - g && g.l(A), A.forEach(zi), u = _r(E), Li(l.$$.fragment, E), E.forEach(zi), _.forEach(zi), this.h(); + l(g) { + e = Rs(g, "DIV", { class: !0 }); + var p = ks(e); + t = Rs(p, "DIV", { class: !0, role: !0 }); + var y = ks(t); + mi(i.$$.fragment, y), y.forEach(st), s = Lr(p), r = Rs(p, "DIV", { class: !0, role: !0, tabindex: !0 }); + var v = ks(r); + mi(a.$$.fragment, v), v.forEach(st), p.forEach(st), this.h(); }, h() { - Un(r, "class", "player-wrapper svelte-4wejaf"), Un(o, "class", "player-wrapper fixed svelte-4wejaf"), Un( - o, - "style", - /*style*/ - n[14] - ), Un(s, "class", "main-wrapper svelte-4wejaf"), Un(s, "role", "button"), Un(s, "tabindex", "0"), Un(e, "class", "video-container svelte-4wejaf"); + Ut(t, "class", "icon-button-wrapper svelte-40zsic"), Ut(t, "role", "group"), Ut(r, "class", "main-wrapper svelte-40zsic"), Ut(r, "role", "button"), Ut(r, "tabindex", "0"), Ut(e, "class", "video-container svelte-40zsic"); }, - m(v, _) { - yr(v, e, _), Ri(t, e, null), tr(e, i), tr(e, s), tr(s, r), m && m.m(r, null), tr(s, a), tr(s, o), g && g.m(o, null), tr(s, u), Ri(l, s, null), h = !0, d || (f = [ - y_( - s, - "click", + m(g, p) { + ai(g, e, p), Yh(e, t), _i(i, t, null), Yh(e, s), Yh(e, r), _i(a, r, null), n[40](r), l = !0, c || (h = [ + Fs(r, "mousedown", Gr( /*toggle_playback*/ - n[17] - ), - y_( - s, + n[22] + )), + Fs(r, "touchstart", Gr( + /*toggle_playback*/ + n[22] + )), + Fs( + r, "keydown", - /*keydown_handler*/ - n[26] + /*keydown_handler_2*/ + n[41] ) - ], d = !0); + ], c = !0); }, - p(v, _) { - const E = {}; - _ & /*$$scope, value, interactive, i18n, show_download_button, fullscreen, show_fullscreen_button*/ - 134218666 && (E.$$scope = { dirty: _, ctx: v }), t.$set(E), /*value*/ - v[1][0] ? m ? (m.p(v, _), _ & /*value*/ - 2 && Ie(m, 1)) : (m = S_(v), m.c(), Ie(m, 1), m.m(r, null)) : m && (vr(), Ne(m, 1, 1, () => { - m = null; - }), pr()), /*value*/ - v[1][1] ? g ? (g.p(v, _), _ & /*value*/ - 2 && Ie(g, 1)) : (g = A_(v), g.c(), Ie(g, 1), g.m(o, null)) : g && (vr(), Ne(g, 1, 1, () => { - g = null; - }), pr()), (!h || _ & /*style*/ - 16384) && Un( - o, - "style", - /*style*/ - v[14] - ); - const T = {}; - _ & /*slider_color*/ - 64 && (T.slider_color = /*slider_color*/ - v[6]), !c && _ & /*position*/ - 1 && (c = !0, T.position = /*position*/ - v[0], Pf(() => c = !1)), l.$set(T); + p(g, p) { + const y = {}; + p[0] & /*interactive, isMuted, i18n, show_mute_button, value, show_download_button, fullscreen, show_fullscreen_button*/ + 132950 | p[1] & /*$$scope*/ + 16384 && (y.$$scope = { dirty: p, ctx: g }), i.$set(y); + const v = {}; + p[0] & /*slider_color*/ + 128 && (v.slider_color = /*slider_color*/ + g[7]), p[0] & /*image_size*/ + 65536 && (v.image_size = /*image_size*/ + g[16]), p[0] & /*isInteractingWithButtons*/ + 262144 && (v.disabled = /*isInteractingWithButtons*/ + g[18]), p[0] & /*style, value, loop, isMuted, i18n, upload, fullscreen, video2_el, video1_el*/ + 686150 | p[1] & /*$$scope*/ + 16384 && (v.$$scope = { dirty: p, ctx: g }), !o && p[0] & /*position*/ + 1 && (o = !0, v.position = /*position*/ + g[0], so(() => o = !1)), !u && p[0] & /*main_wrapper_el*/ + 32768 && (u = !0, v.parent_el = /*main_wrapper_el*/ + g[15], so(() => u = !1)), a.$set(v); }, - i(v) { - h || (Ie(t.$$.fragment, v), Ie(m), Ie(g), Ie(l.$$.fragment, v), h = !0); + i(g) { + l || (be(i.$$.fragment, g), be(a.$$.fragment, g), l = !0); }, - o(v) { - Ne(t.$$.fragment, v), Ne(m), Ne(g), Ne(l.$$.fragment, v), h = !1; + o(g) { + Me(i.$$.fragment, g), Me(a.$$.fragment, g), l = !1; }, - d(v) { - v && zi(e), ki(t), m && m.d(), g && g.d(), ki(l), d = !1, t$(f); + d(g) { + g && st(e), pi(i), pi(a), n[40](null), c = !1, tm(h); } } ); } -function r$(n) { +function L$(n) { let e, t; - return e = new ET({ + return e = new MT({ props: { unpadded_box: !0, size: "large", - $$slots: { default: [l$] }, + $$slots: { default: [C$] }, $$scope: { ctx: n } } }), { c() { - Ii(e.$$.fragment); + gi(e.$$.fragment); }, l(i) { - Li(e.$$.fragment, i); + mi(e.$$.fragment, i); }, m(i, s) { - Ri(e, i, s), t = !0; + _i(e, i, s), t = !0; }, p(i, s) { const r = {}; - s & /*$$scope*/ - 134217728 && (r.$$scope = { dirty: s, ctx: i }), e.$set(r); + s[1] & /*$$scope*/ + 16384 && (r.$$scope = { dirty: s, ctx: i }), e.$set(r); }, i(i) { - t || (Ie(e.$$.fragment, i), t = !0); + t || (be(e.$$.fragment, i), t = !0); }, o(i) { - Ne(e.$$.fragment, i), t = !1; + Me(e.$$.fragment, i), t = !1; }, d(i) { - ki(e, i); + pi(e, i); } }; } -function E_(n) { - let e, t; - return e = new vx({ - props: { fullscreen: ( - /*fullscreen*/ - n[8] - ) } - }), e.$on( - "fullscreen", - /*fullscreen_handler*/ - n[21] - ), { - c() { - Ii(e.$$.fragment); - }, - l(i) { - Li(e.$$.fragment, i); - }, - m(i, s) { - Ri(e, i, s), t = !0; - }, - p(i, s) { - const r = {}; - s & /*fullscreen*/ - 256 && (r.fullscreen = /*fullscreen*/ - i[8]), e.$set(r); - }, - i(i) { - t || (Ie(e.$$.fragment, i), t = !0); - }, - o(i) { - Ne(e.$$.fragment, i), t = !1; - }, - d(i) { - ki(e, i); +function O_(n) { + let e, t, i; + function s(a) { + n[33](a); + } + let r = {}; + return ( + /*fullscreen*/ + n[2] !== void 0 && (r.fullscreen = /*fullscreen*/ + n[2]), e = new Gx({ props: r }), Ur.push(() => ro(e, "fullscreen", s)), e.$on( + "fullscreen", + /*handle_fullscreen_toggle*/ + n[23] + ), { + c() { + gi(e.$$.fragment); + }, + l(a) { + mi(e.$$.fragment, a); + }, + m(a, o) { + _i(e, a, o), i = !0; + }, + p(a, o) { + const u = {}; + !t && o[0] & /*fullscreen*/ + 4 && (t = !0, u.fullscreen = /*fullscreen*/ + a[2], so(() => t = !1)), e.$set(u); + }, + i(a) { + i || (be(e.$$.fragment, a), i = !0); + }, + o(a) { + Me(e.$$.fragment, a), i = !1; + }, + d(a) { + pi(e, a); + } } - }; + ); } -function b_(n) { - var i; +function M_(n) { + var i, s; let e, t; - return e = new sy({ + return e = new Ey({ props: { href: ( /*value*/ - ((i = n[1][1].meta) == null ? void 0 : i._base64) || /*value*/ - n[1][1].url + (i = n[1][1]) == null ? void 0 : i.url ), download: ( /*value*/ - n[1][1].orig_name || "video" + ((s = n[1][1]) == null ? void 0 : s.orig_name) || "video" ), - $$slots: { default: [a$] }, + $$slots: { default: [I$] }, $$scope: { ctx: n } } }), { c() { - Ii(e.$$.fragment); + gi(e.$$.fragment); }, - l(s) { - Li(e.$$.fragment, s); + l(r) { + mi(e.$$.fragment, r); }, - m(s, r) { - Ri(e, s, r), t = !0; + m(r, a) { + _i(e, r, a), t = !0; }, - p(s, r) { - var o; - const a = {}; - r & /*value*/ - 2 && (a.href = /*value*/ - ((o = s[1][1].meta) == null ? void 0 : o._base64) || /*value*/ - s[1][1].url), r & /*value*/ - 2 && (a.download = /*value*/ - s[1][1].orig_name || "video"), r & /*$$scope, i18n*/ - 134217760 && (a.$$scope = { dirty: r, ctx: s }), e.$set(a); + p(r, a) { + var u, l; + const o = {}; + a[0] & /*value*/ + 2 && (o.href = /*value*/ + (u = r[1][1]) == null ? void 0 : u.url), a[0] & /*value*/ + 2 && (o.download = /*value*/ + ((l = r[1][1]) == null ? void 0 : l.orig_name) || "video"), a[0] & /*i18n*/ + 64 | a[1] & /*$$scope*/ + 16384 && (o.$$scope = { dirty: a, ctx: r }), e.$set(o); }, - i(s) { - t || (Ie(e.$$.fragment, s), t = !0); + i(r) { + t || (be(e.$$.fragment, r), t = !0); }, - o(s) { - Ne(e.$$.fragment, s), t = !1; + o(r) { + Me(e.$$.fragment, r), t = !1; }, - d(s) { - ki(e, s); + d(r) { + pi(e, r); } }; } -function a$(n) { +function I$(n) { let e, t; - return e = new Ci({ + return e = new vi({ props: { - Icon: ov, + Icon: Sv, label: ( /*i18n*/ - n[5]("common.download") + n[6]("common.download") ) } }), { c() { - Ii(e.$$.fragment); + gi(e.$$.fragment); }, l(i) { - Li(e.$$.fragment, i); + mi(e.$$.fragment, i); }, m(i, s) { - Ri(e, i, s), t = !0; + _i(e, i, s), t = !0; }, p(i, s) { const r = {}; - s & /*i18n*/ - 32 && (r.label = /*i18n*/ - i[5]("common.download")), e.$set(r); + s[0] & /*i18n*/ + 64 && (r.label = /*i18n*/ + i[6]("common.download")), e.$set(r); }, i(i) { - t || (Ie(e.$$.fragment, i), t = !0); + t || (be(e.$$.fragment, i), t = !0); }, o(i) { - Ne(e.$$.fragment, i), t = !1; + Me(e.$$.fragment, i), t = !1; }, d(i) { - ki(e, i); + pi(e, i); } }; } -function T_(n) { - let e, t; - return e = new Ci({ - props: { Icon: Jd, label: "Remove Videos" } - }), e.$on( +function $_(n) { + let e, t, i, s, r; + return t = new vi({ + props: { + Icon: ( + /*isMuted*/ + n[17] ? Sg : Tg + ), + label: ( + /*isMuted*/ + n[17] ? ( + /*i18n*/ + n[6]("common.unmute") + ) : ( + /*i18n*/ + n[6]("common.mute") + ) + ) + } + }), t.$on( "click", - /*click_handler*/ - n[22] + /*toggleMute*/ + n[20] + ), t.$on( + "keydown", + /*keydown_handler*/ + n[34] ), { c() { - Ii(e.$$.fragment); + e = Cs("div"), gi(t.$$.fragment), this.h(); }, - l(i) { - Li(e.$$.fragment, i); + l(a) { + e = Rs(a, "DIV", { role: !0, tabindex: !0 }); + var o = ks(e); + mi(t.$$.fragment, o), o.forEach(st), this.h(); }, - m(i, s) { - Ri(e, i, s), t = !0; + h() { + Ut(e, "role", "button"), Ut(e, "tabindex", "0"); }, - p: e$, - i(i) { - t || (Ie(e.$$.fragment, i), t = !0); + m(a, o) { + ai(a, e, o), _i(t, e, null), i = !0, s || (r = [ + Fs(e, "mousedown", Gr( + /*mousedown_handler*/ + n[31] + )), + Fs(e, "touchstart", Gr( + /*touchstart_handler*/ + n[32] + )) + ], s = !0); }, - o(i) { - Ne(e.$$.fragment, i), t = !1; + p(a, o) { + const u = {}; + o[0] & /*isMuted*/ + 131072 && (u.Icon = /*isMuted*/ + a[17] ? Sg : Tg), o[0] & /*isMuted, i18n*/ + 131136 && (u.label = /*isMuted*/ + a[17] ? ( + /*i18n*/ + a[6]("common.unmute") + ) : ( + /*i18n*/ + a[6]("common.mute") + )), t.$set(u); }, - d(i) { - ki(e, i); + i(a) { + i || (be(t.$$.fragment, a), i = !0); + }, + o(a) { + Me(t.$$.fragment, a), i = !1; + }, + d(a) { + a && st(e), pi(t), s = !1, tm(r); } }; } -function o$(n) { - let e, t, i, s, r = ( +function B_(n) { + let e, t, i, s, r; + return t = new vi({ + props: { Icon: bf, label: "Remove Videos" } + }), t.$on( + "click", + /*removeVideos*/ + n[21] + ), t.$on( + "keydown", + /*keydown_handler_1*/ + n[35] + ), { + c() { + e = Cs("div"), gi(t.$$.fragment), this.h(); + }, + l(a) { + e = Rs(a, "DIV", { role: !0, tabindex: !0 }); + var o = ks(e); + mi(t.$$.fragment, o), o.forEach(st), this.h(); + }, + h() { + Ut(e, "role", "button"), Ut(e, "tabindex", "0"); + }, + m(a, o) { + ai(a, e, o), _i(t, e, null), i = !0, s || (r = [ + Fs(e, "mousedown", Gr( + /*mousedown_handler_1*/ + n[29] + )), + Fs(e, "touchstart", Gr( + /*touchstart_handler_1*/ + n[30] + )) + ], s = !0); + }, + p: S$, + i(a) { + i || (be(t.$$.fragment, a), i = !0); + }, + o(a) { + Me(t.$$.fragment, a), i = !1; + }, + d(a) { + a && st(e), pi(t), s = !1, tm(r); + } + }; +} +function k$(n) { + let e, t, i, s, r, a = ( /*show_fullscreen_button*/ - n[7] && E_(n) - ), a = ( - /*show_download_button*/ - n[3] && /*value*/ - n[1][1] && b_(n) + n[8] && O_(n) ), o = ( + /*show_download_button*/ + n[4] && /*value*/ + n[1][1] && M_(n) + ), u = ( + /*show_mute_button*/ + n[9] && $_(n) + ), l = ( /*interactive*/ - n[9] && T_(n) + n[10] && B_(n) ); return { c() { - r && r.c(), e = Er(), a && a.c(), t = Er(), o && o.c(), i = Zl(); + a && a.c(), e = Ir(), o && o.c(), t = Ir(), u && u.c(), i = Ir(), l && l.c(), s = pu(); }, - l(u) { - r && r.l(u), e = _r(u), a && a.l(u), t = _r(u), o && o.l(u), i = Zl(); + l(c) { + a && a.l(c), e = Lr(c), o && o.l(c), t = Lr(c), u && u.l(c), i = Lr(c), l && l.l(c), s = pu(); }, - m(u, l) { - r && r.m(u, l), yr(u, e, l), a && a.m(u, l), yr(u, t, l), o && o.m(u, l), yr(u, i, l), s = !0; + m(c, h) { + a && a.m(c, h), ai(c, e, h), o && o.m(c, h), ai(c, t, h), u && u.m(c, h), ai(c, i, h), l && l.m(c, h), ai(c, s, h), r = !0; }, - p(u, l) { + p(c, h) { /*show_fullscreen_button*/ - u[7] ? r ? (r.p(u, l), l & /*show_fullscreen_button*/ - 128 && Ie(r, 1)) : (r = E_(u), r.c(), Ie(r, 1), r.m(e.parentNode, e)) : r && (vr(), Ne(r, 1, 1, () => { - r = null; - }), pr()), /*show_download_button*/ - u[3] && /*value*/ - u[1][1] ? a ? (a.p(u, l), l & /*show_download_button, value*/ - 10 && Ie(a, 1)) : (a = b_(u), a.c(), Ie(a, 1), a.m(t.parentNode, t)) : a && (vr(), Ne(a, 1, 1, () => { + c[8] ? a ? (a.p(c, h), h[0] & /*show_fullscreen_button*/ + 256 && be(a, 1)) : (a = O_(c), a.c(), be(a, 1), a.m(e.parentNode, e)) : a && (xs(), Me(a, 1, 1, () => { a = null; - }), pr()), /*interactive*/ - u[9] ? o ? (o.p(u, l), l & /*interactive*/ - 512 && Ie(o, 1)) : (o = T_(u), o.c(), Ie(o, 1), o.m(i.parentNode, i)) : o && (vr(), Ne(o, 1, 1, () => { + }), As()), /*show_download_button*/ + c[4] && /*value*/ + c[1][1] ? o ? (o.p(c, h), h[0] & /*show_download_button, value*/ + 18 && be(o, 1)) : (o = M_(c), o.c(), be(o, 1), o.m(t.parentNode, t)) : o && (xs(), Me(o, 1, 1, () => { o = null; - }), pr()); + }), As()), /*show_mute_button*/ + c[9] ? u ? (u.p(c, h), h[0] & /*show_mute_button*/ + 512 && be(u, 1)) : (u = $_(c), u.c(), be(u, 1), u.m(i.parentNode, i)) : u && (xs(), Me(u, 1, 1, () => { + u = null; + }), As()), /*interactive*/ + c[10] ? l ? (l.p(c, h), h[0] & /*interactive*/ + 1024 && be(l, 1)) : (l = B_(c), l.c(), be(l, 1), l.m(s.parentNode, s)) : l && (xs(), Me(l, 1, 1, () => { + l = null; + }), As()); }, - i(u) { - s || (Ie(r), Ie(a), Ie(o), s = !0); + i(c) { + r || (be(a), be(o), be(u), be(l), r = !0); }, - o(u) { - Ne(r), Ne(a), Ne(o), s = !1; + o(c) { + Me(a), Me(o), Me(u), Me(l), r = !1; }, - d(u) { - u && (zi(e), zi(t), zi(i)), r && r.d(u), a && a.d(u), o && o.d(u); + d(c) { + c && (st(e), st(t), st(i), st(s)), a && a.d(c), o && o.d(c), u && u.d(c), l && l.d(c); } }; } -function S_(n) { +function N_(n) { var a; let e, t, i; function s(o) { - n[23](o); + n[36](o); } let r = { src: ( @@ -39763,76 +40011,87 @@ function S_(n) { ), loop: ( /*loop*/ - n[10] + n[11] + ), + muted: ( + /*isMuted*/ + n[17] ), - muted: !0, i18n: ( /*i18n*/ - n[5] + n[6] ), upload: ( /*upload*/ - n[11] + n[12] ), mirror: !1, is_stream: ( /*value*/ n[1][0].is_stream ), - interactive: !1 + interactive: !1, + fullscreen: ( + /*fullscreen*/ + n[2] + ) }; return ( /*video1_el*/ - n[12] !== void 0 && (r.video_el = /*video1_el*/ - n[12]), e = new Ff({ props: r }), Mf.push(() => Of(e, "video_el", s)), e.$on( - "loadeddata", - /*handle_video_ready*/ - n[16] + n[13] !== void 0 && (r.video_el = /*video1_el*/ + n[13]), e = new em({ props: r }), Ur.push(() => ro(e, "video_el", s)), e.$on( + "load", + /*handle_video_load*/ + n[24] ), { c() { - Ii(e.$$.fragment); + gi(e.$$.fragment); }, l(o) { - Li(e.$$.fragment, o); + mi(e.$$.fragment, o); }, m(o, u) { - Ri(e, o, u), i = !0; + _i(e, o, u), i = !0; }, p(o, u) { var c; const l = {}; - u & /*value*/ + u[0] & /*value*/ 2 && (l.src = /*value*/ ((c = o[1][0].meta) == null ? void 0 : c._base64) || /*value*/ - o[1][0].url), u & /*loop*/ - 1024 && (l.loop = /*loop*/ - o[10]), u & /*i18n*/ - 32 && (l.i18n = /*i18n*/ - o[5]), u & /*upload*/ - 2048 && (l.upload = /*upload*/ - o[11]), u & /*value*/ + o[1][0].url), u[0] & /*loop*/ + 2048 && (l.loop = /*loop*/ + o[11]), u[0] & /*isMuted*/ + 131072 && (l.muted = /*isMuted*/ + o[17]), u[0] & /*i18n*/ + 64 && (l.i18n = /*i18n*/ + o[6]), u[0] & /*upload*/ + 4096 && (l.upload = /*upload*/ + o[12]), u[0] & /*value*/ 2 && (l.is_stream = /*value*/ - o[1][0].is_stream), !t && u & /*video1_el*/ - 4096 && (t = !0, l.video_el = /*video1_el*/ - o[12], Pf(() => t = !1)), e.$set(l); + o[1][0].is_stream), u[0] & /*fullscreen*/ + 4 && (l.fullscreen = /*fullscreen*/ + o[2]), !t && u[0] & /*video1_el*/ + 8192 && (t = !0, l.video_el = /*video1_el*/ + o[13], so(() => t = !1)), e.$set(l); }, i(o) { - i || (Ie(e.$$.fragment, o), i = !0); + i || (be(e.$$.fragment, o), i = !0); }, o(o) { - Ne(e.$$.fragment, o), i = !1; + Me(e.$$.fragment, o), i = !1; }, d(o) { - ki(e, o); + pi(e, o); } } ); } -function A_(n) { +function U_(n) { var a; let e, t, i; function s(o) { - n[24](o); + n[37](o); } let r = { src: ( @@ -39842,106 +40101,175 @@ function A_(n) { ), loop: ( /*loop*/ - n[10] + n[11] + ), + muted: ( + /*isMuted*/ + n[17] ), - muted: !0, i18n: ( /*i18n*/ - n[5] + n[6] ), upload: ( /*upload*/ - n[11] + n[12] ), mirror: !1, is_stream: ( /*value*/ n[1][1].is_stream ), - interactive: !1 + interactive: !1, + fullscreen: ( + /*fullscreen*/ + n[2] + ) }; return ( /*video2_el*/ - n[13] !== void 0 && (r.video_el = /*video2_el*/ - n[13]), e = new Ff({ props: r }), Mf.push(() => Of(e, "video_el", s)), { + n[14] !== void 0 && (r.video_el = /*video2_el*/ + n[14]), e = new em({ props: r }), Ur.push(() => ro(e, "video_el", s)), { c() { - Ii(e.$$.fragment); + gi(e.$$.fragment); }, l(o) { - Li(e.$$.fragment, o); + mi(e.$$.fragment, o); }, m(o, u) { - Ri(e, o, u), i = !0; + _i(e, o, u), i = !0; }, p(o, u) { var c; const l = {}; - u & /*value*/ + u[0] & /*value*/ 2 && (l.src = /*value*/ ((c = o[1][1].meta) == null ? void 0 : c._base64) || /*value*/ - o[1][1].url), u & /*loop*/ - 1024 && (l.loop = /*loop*/ - o[10]), u & /*i18n*/ - 32 && (l.i18n = /*i18n*/ - o[5]), u & /*upload*/ - 2048 && (l.upload = /*upload*/ - o[11]), u & /*value*/ + o[1][1].url), u[0] & /*loop*/ + 2048 && (l.loop = /*loop*/ + o[11]), u[0] & /*isMuted*/ + 131072 && (l.muted = /*isMuted*/ + o[17]), u[0] & /*i18n*/ + 64 && (l.i18n = /*i18n*/ + o[6]), u[0] & /*upload*/ + 4096 && (l.upload = /*upload*/ + o[12]), u[0] & /*value*/ 2 && (l.is_stream = /*value*/ - o[1][1].is_stream), !t && u & /*video2_el*/ - 8192 && (t = !0, l.video_el = /*video2_el*/ - o[13], Pf(() => t = !1)), e.$set(l); + o[1][1].is_stream), u[0] & /*fullscreen*/ + 4 && (l.fullscreen = /*fullscreen*/ + o[2]), !t && u[0] & /*video2_el*/ + 16384 && (t = !0, l.video_el = /*video2_el*/ + o[14], so(() => t = !1)), e.$set(l); }, i(o) { - i || (Ie(e.$$.fragment, o), i = !0); + i || (be(e.$$.fragment, o), i = !0); }, o(o) { - Ne(e.$$.fragment, o), i = !1; + Me(e.$$.fragment, o), i = !1; }, d(o) { - ki(e, o); + pi(e, o); } } ); } -function l$(n) { +function R$(n) { + let e, t, i, s, r = ( + /*value*/ + n[1][0] && N_(n) + ), a = ( + /*value*/ + n[1][1] && U_(n) + ); + return { + c() { + e = Cs("div"), r && r.c(), t = Ir(), i = Cs("div"), a && a.c(), this.h(); + }, + l(o) { + e = Rs(o, "DIV", { class: !0 }); + var u = ks(e); + r && r.l(u), u.forEach(st), t = Lr(o), i = Rs(o, "DIV", { class: !0, style: !0 }); + var l = ks(i); + a && a.l(l), l.forEach(st), this.h(); + }, + h() { + Ut(e, "class", "player-wrapper svelte-40zsic"), Ut(i, "class", "player-wrapper fixed svelte-40zsic"), Ut( + i, + "style", + /*style*/ + n[19] + ); + }, + m(o, u) { + ai(o, e, u), r && r.m(e, null), ai(o, t, u), ai(o, i, u), a && a.m(i, null), s = !0; + }, + p(o, u) { + /*value*/ + o[1][0] ? r ? (r.p(o, u), u[0] & /*value*/ + 2 && be(r, 1)) : (r = N_(o), r.c(), be(r, 1), r.m(e, null)) : r && (xs(), Me(r, 1, 1, () => { + r = null; + }), As()), /*value*/ + o[1][1] ? a ? (a.p(o, u), u[0] & /*value*/ + 2 && be(a, 1)) : (a = U_(o), a.c(), be(a, 1), a.m(i, null)) : a && (xs(), Me(a, 1, 1, () => { + a = null; + }), As()), (!s || u[0] & /*style*/ + 524288) && Ut( + i, + "style", + /*style*/ + o[19] + ); + }, + i(o) { + s || (be(r), be(a), s = !0); + }, + o(o) { + Me(r), Me(a), s = !1; + }, + d(o) { + o && (st(e), st(t), st(i)), r && r.d(), a && a.d(); + } + }; +} +function C$(n) { let e, t; - return e = new au({}), { + return e = new wu({}), { c() { - Ii(e.$$.fragment); + gi(e.$$.fragment); }, l(i) { - Li(e.$$.fragment, i); + mi(e.$$.fragment, i); }, m(i, s) { - Ri(e, i, s), t = !0; + _i(e, i, s), t = !0; }, i(i) { - t || (Ie(e.$$.fragment, i), t = !0); + t || (be(e.$$.fragment, i), t = !0); }, o(i) { - Ne(e.$$.fragment, i), t = !1; + Me(e.$$.fragment, i), t = !1; }, d(i) { - ki(e, i); + pi(e, i); } }; } -function u$(n) { +function F$(n) { let e, t, i, s, r, a; - e = new Zd({ + e = new Ef({ props: { show_label: ( /*show_label*/ - n[4] + n[5] ), - Icon: au, + Icon: wu, label: ( /*label*/ - n[2] || "Video Slider" + n[3] || "Video Slider" ) } }); - const o = [r$, s$], u = []; + const o = [L$, w$], u = []; function l(c, h) { return ( /*value*/ @@ -39952,249 +40280,332 @@ function u$(n) { } return i = l(n), s = u[i] = o[i](n), { c() { - Ii(e.$$.fragment), t = Er(), s.c(), r = Zl(); + gi(e.$$.fragment), t = Ir(), s.c(), r = pu(); }, l(c) { - Li(e.$$.fragment, c), t = _r(c), s.l(c), r = Zl(); + mi(e.$$.fragment, c), t = Lr(c), s.l(c), r = pu(); }, m(c, h) { - Ri(e, c, h), yr(c, t, h), u[i].m(c, h), yr(c, r, h), a = !0; + _i(e, c, h), ai(c, t, h), u[i].m(c, h), ai(c, r, h), a = !0; }, - p(c, [h]) { + p(c, h) { const d = {}; - h & /*show_label*/ - 16 && (d.show_label = /*show_label*/ - c[4]), h & /*label*/ - 4 && (d.label = /*label*/ - c[2] || "Video Slider"), e.$set(d); + h[0] & /*show_label*/ + 32 && (d.show_label = /*show_label*/ + c[5]), h[0] & /*label*/ + 8 && (d.label = /*label*/ + c[3] || "Video Slider"), e.$set(d); let f = i; - i = l(c), i === f ? u[i].p(c, h) : (vr(), Ne(u[f], 1, 1, () => { + i = l(c), i === f ? u[i].p(c, h) : (xs(), Me(u[f], 1, 1, () => { u[f] = null; - }), pr(), s = u[i], s ? s.p(c, h) : (s = u[i] = o[i](c), s.c()), Ie(s, 1), s.m(r.parentNode, r)); + }), As(), s = u[i], s ? s.p(c, h) : (s = u[i] = o[i](c), s.c()), be(s, 1), s.m(r.parentNode, r)); }, i(c) { - a || (Ie(e.$$.fragment, c), Ie(s), a = !0); + a || (be(e.$$.fragment, c), be(s), a = !0); }, o(c) { - Ne(e.$$.fragment, c), Ne(s), a = !1; + Me(e.$$.fragment, c), Me(s), a = !1; }, d(c) { - c && (zi(t), zi(r)), ki(e, c), u[i].d(c); + c && (st(t), st(r)), pi(e, c), u[i].d(c); } }; } -function c$(n, e, t) { - let i, { value: s = [null, null] } = e, { label: r = void 0 } = e, { show_download_button: a = !0 } = e, { show_label: o } = e, { i18n: u } = e, { position: l } = e, { slider_color: c } = e, { show_fullscreen_button: h = !0 } = e, { fullscreen: d = !1 } = e, { interactive: f = !0 } = e, { autoplay: m = !1 } = e, { loop: g = !1 } = e, { upload: p } = e; - const y = n$(); - let v, _, E = !1, T = !1; - function A() { - t(19, E = !0); +function P$(n, e, t) { + return Math.min(Math.max(n, e), t); +} +function O$(n, e, t, i) { + const a = (n * t + i) / e; + return P$(a, 0, 1); +} +function M$(n, e, t) { + let i, s, { value: r = [null, null] } = e, { label: a = void 0 } = e, { show_download_button: o = !0 } = e, { show_label: u } = e, { i18n: l } = e, { position: c = 0.5 } = e, { slider_color: h } = e, { show_fullscreen_button: d = !0 } = e, { show_mute_button: f = !0 } = e, { fullscreen: m = !1 } = e, { interactive: g = !0 } = e, { autoplay: p = !1 } = e, { loop: y = !1 } = e, { upload: v } = e; + const _ = x$(); + let E, T, x, S = { top: 0, left: 0, width: 0, height: 0 }, D = 0, A, w = !0, I = !1, M = !1; + function k(j) { + j.stopPropagation(), t(18, I = !0), E && T && (t(17, w = !w), t(13, E.muted = w, E), t(14, T.muted = w, T)), setTimeout(() => t(18, I = !1), 0); + } + function q(j) { + j.stopPropagation(), t(18, I = !0), t(1, r = [null, null]), t(0, c = 0.5), _("clear"), setTimeout(() => t(18, I = !1), 0); + } + function K(j) { + if (j.stopPropagation(), !E || !T) return; + E.paused ? (E.play().catch(() => { + }), T.play().catch(() => { + })) : (E.pause(), T.pause()); + } + function H(j) { + t(0, c = 0.5), _("fullscreen", j.detail); + } + function Y(j) { + t(16, S = j.detail), x && t(26, D = x.getBoundingClientRect().width), t(0, c = 0.5), _("load", S); + } + function B(j, Ee) { + if (!j || !Ee) return; + A == null || A.disconnect(); + const Oe = () => { + const je = j.getBoundingClientRect(), se = Ee.getBoundingClientRect(); + t(16, S = { + top: je.top - se.top, + left: je.left - se.left, + width: je.width || se.width, + height: je.height || se.height + }), t(26, D = se.width), _("load", S); + }; + A = new ResizeObserver(() => { + Oe(), t(0, c = 0.5); + }), j.addEventListener("loadedmetadata", Oe), A.observe(Ee), A.observe(j), Oe(); } - function S() { - if (!v || !_) - return; - v.paused ? (v.play().catch(() => { - }), _.play().catch(() => { - })) : (v.pause(), _.pause()); + D$(() => (t(0, c = 0.5), E && t(13, E.muted = !0, E), T && t(14, T.muted = !0, T), () => { + A == null || A.disconnect(); + })); + function z(j) { + Ll.call(this, n, j); + } + function W(j) { + Ll.call(this, n, j); + } + function L(j) { + Ll.call(this, n, j); + } + function $(j) { + Ll.call(this, n, j); } - function D(P) { - ZM.call(this, n, P); + function Q(j) { + m = j, t(2, m); } - const x = (P) => { - t(1, s = [null, null]), y("clear"), P.stopPropagation(); + const C = (j) => { + (j.key === "Enter" || j.key === " ") && k(j); + }, O = (j) => { + (j.key === "Enter" || j.key === " ") && q(j); }; - function w(P) { - v = P, t(12, v); + function N(j) { + E = j, t(13, E); } - function I(P) { - _ = P, t(13, _), t(12, v), t(19, E), t(18, m), t(20, T); + function ee(j) { + T = j, t(14, T), t(13, E), t(25, p); } - function R(P) { - l = P, t(0, l); + function G(j) { + c = j, t(0, c); } - const M = (P) => { - (P.key === "Enter" || P.key === " ") && S(); + function Z(j) { + x = j, t(15, x); + } + function U(j) { + Ur[j ? "unshift" : "push"](() => { + x = j, t(15, x); + }); + } + const re = (j) => { + (j.key === "Enter" || j.key === " ") && K(j); }; - return n.$$set = (P) => { - "value" in P && t(1, s = P.value), "label" in P && t(2, r = P.label), "show_download_button" in P && t(3, a = P.show_download_button), "show_label" in P && t(4, o = P.show_label), "i18n" in P && t(5, u = P.i18n), "position" in P && t(0, l = P.position), "slider_color" in P && t(6, c = P.slider_color), "show_fullscreen_button" in P && t(7, h = P.show_fullscreen_button), "fullscreen" in P && t(8, d = P.fullscreen), "interactive" in P && t(9, f = P.interactive), "autoplay" in P && t(18, m = P.autoplay), "loop" in P && t(10, g = P.loop), "upload" in P && t(11, p = P.upload); + return n.$$set = (j) => { + "value" in j && t(1, r = j.value), "label" in j && t(3, a = j.label), "show_download_button" in j && t(4, o = j.show_download_button), "show_label" in j && t(5, u = j.show_label), "i18n" in j && t(6, l = j.i18n), "position" in j && t(0, c = j.position), "slider_color" in j && t(7, h = j.slider_color), "show_fullscreen_button" in j && t(8, d = j.show_fullscreen_button), "show_mute_button" in j && t(9, f = j.show_mute_button), "fullscreen" in j && t(2, m = j.fullscreen), "interactive" in j && t(10, g = j.interactive), "autoplay" in j && t(25, p = j.autoplay), "loop" in j && t(11, y = j.loop), "upload" in j && t(12, v = j.upload); }, n.$$.update = () => { - n.$$.dirty & /*position*/ - 1 && t(14, i = `clip-path: inset(0 0 0 ${l * 100}%)`), n.$$.dirty & /*video1_el, video_is_ready, autoplay, initial_autoplay_done, video2_el*/ - 1847296 && (v && E && m && !T && (v.play().catch(() => { - }), t(20, T = !0)), v && _ && (Math.abs(v.currentTime - _.currentTime) > 0.1 && t(13, _.currentTime = v.currentTime, _), v.paused !== _.paused && (v.paused ? _.pause() : _.play().catch(() => { + n.$$.dirty[0] & /*position, viewport_width, image_size*/ + 67174401 && t(28, i = O$(c, D || 640, S.width || D || 640, S.left || 0)), n.$$.dirty[0] & /*coords_at_viewport*/ + 268435456 && t(19, s = `clip-path: inset(0 0 0 ${i * 100}%)`), n.$$.dirty[0] & /*main_wrapper_el, video1_el, is_initialized*/ + 134258688 && x && E && !M && (B(E, x), t(27, M = !0)), n.$$.dirty[0] & /*video1_el, autoplay, video2_el*/ + 33579008 && (E && p && !E.played.length && E.play().catch(() => { + }), E && T && (Math.abs(E.currentTime - T.currentTime) > 0.1 && t(14, T.currentTime = E.currentTime, T), E.paused !== T.paused && (E.paused ? T.pause() : T.play().catch(() => { })))); }, [ - l, - s, + c, r, + m, a, o, u, - c, + l, h, d, f, g, - p, - v, - _, - i, y, - A, - S, - m, + v, E, T, - D, x, + S, w, I, - R, - M + s, + k, + q, + K, + H, + Y, + p, + D, + M, + i, + z, + W, + L, + $, + Q, + C, + O, + N, + ee, + G, + Z, + U, + re ]; } -class h$ extends QM { +class $$ extends b$ { constructor(e) { - super(), JM(this, e, c$, u$, i$, { - value: 1, - label: 2, - show_download_button: 3, - show_label: 4, - i18n: 5, - position: 0, - slider_color: 6, - show_fullscreen_button: 7, - fullscreen: 8, - interactive: 9, - autoplay: 18, - loop: 10, - upload: 11 - }); + super(), T$( + this, + e, + M$, + F$, + A$, + { + value: 1, + label: 3, + show_download_button: 4, + show_label: 5, + i18n: 6, + position: 0, + slider_color: 7, + show_fullscreen_button: 8, + show_mute_button: 9, + fullscreen: 2, + interactive: 10, + autoplay: 25, + loop: 11, + upload: 12 + }, + null, + [-1, -1] + ); } } const { - SvelteComponent: Lj, - assign: Ij, - bubble: kj, - claim_element: Rj, - compute_rest_props: Cj, - detach: Fj, - element: Pj, - exclude_internal_props: Oj, - get_spread_update: Mj, - init: $j, - insert_hydration: Bj, - listen: Nj, - noop: Uj, - safe_not_equal: Gj, - set_attributes: Hj, - src_url_equal: Vj, - toggle_class: qj + SvelteComponent: Hj, + assign: Vj, + bubble: qj, + claim_element: Kj, + compute_rest_props: jj, + detach: zj, + element: Wj, + exclude_internal_props: Yj, + get_spread_update: Xj, + init: Qj, + insert_hydration: Zj, + listen: Jj, + noop: ez, + safe_not_equal: tz, + set_attributes: iz, + src_url_equal: nz, + toggle_class: sz } = window.__gradio__svelte__internal, { - SvelteComponent: Kj, - append_hydration: jj, - attr: zj, - binding_callbacks: Wj, - bubble: Yj, - check_outros: Xj, - children: Qj, - claim_component: Zj, - claim_element: Jj, - claim_space: ez, - create_component: tz, - destroy_component: iz, - detach: nz, - element: sz, - empty: rz, - group_outros: az, - init: oz, - insert_hydration: lz, - listen: uz, - mount_component: cz, - safe_not_equal: hz, - space: dz, - toggle_class: fz, - transition_in: mz, - transition_out: gz -} = window.__gradio__svelte__internal, { createEventDispatcher: pz, onMount: _z } = window.__gradio__svelte__internal, { - SvelteComponent: d$, - append_hydration: cl, - attr: Ih, - children: kh, - claim_component: f$, - claim_element: Rh, - claim_space: m$, - claim_text: g$, - create_component: p$, - destroy_component: _$, - detach: hl, - element: Ch, - init: v$, - insert_hydration: y$, - listen: E$, - mount_component: b$, - noop: T$, - safe_not_equal: S$, - set_style: A$, - space: x$, - text: D$, - transition_in: w$, - transition_out: L$ -} = window.__gradio__svelte__internal, { createEventDispatcher: I$ } = window.__gradio__svelte__internal; -function k$(n) { + SvelteComponent: rz, + append_hydration: az, + attr: oz, + binding_callbacks: lz, + bubble: uz, + check_outros: cz, + children: hz, + claim_component: dz, + claim_element: fz, + claim_space: mz, + create_component: gz, + destroy_component: pz, + detach: _z, + element: vz, + empty: yz, + group_outros: Ez, + init: bz, + insert_hydration: Tz, + listen: Sz, + mount_component: Az, + safe_not_equal: xz, + space: Dz, + toggle_class: wz, + transition_in: Lz, + transition_out: Iz +} = window.__gradio__svelte__internal, { createEventDispatcher: kz, onMount: Rz } = window.__gradio__svelte__internal, { + SvelteComponent: B$, + append_hydration: Il, + attr: Xh, + children: Qh, + claim_component: N$, + claim_element: Zh, + claim_space: U$, + claim_text: G$, + create_component: H$, + destroy_component: V$, + detach: kl, + element: Jh, + init: q$, + insert_hydration: K$, + listen: j$, + mount_component: z$, + noop: W$, + safe_not_equal: Y$, + set_style: X$, + space: Q$, + text: Z$, + transition_in: J$, + transition_out: eB +} = window.__gradio__svelte__internal, { createEventDispatcher: tB } = window.__gradio__svelte__internal; +function iB(n) { let e, t, i, s, r, a = "Click to Access Webcam", o, u, l, c; - return s = new uv({}), { + return s = new xv({}), { c() { - e = Ch("button"), t = Ch("div"), i = Ch("span"), p$(s.$$.fragment), r = x$(), o = D$(a), this.h(); + e = Jh("button"), t = Jh("div"), i = Jh("span"), H$(s.$$.fragment), r = Q$(), o = Z$(a), this.h(); }, l(h) { - e = Rh(h, "BUTTON", { class: !0 }); - var d = kh(e); - t = Rh(d, "DIV", { class: !0 }); - var f = kh(t); - i = Rh(f, "SPAN", { class: !0 }); - var m = kh(i); - f$(s.$$.fragment, m), m.forEach(hl), r = m$(f), o = g$(f, a), f.forEach(hl), d.forEach(hl), this.h(); + e = Zh(h, "BUTTON", { class: !0 }); + var d = Qh(e); + t = Zh(d, "DIV", { class: !0 }); + var f = Qh(t); + i = Zh(f, "SPAN", { class: !0 }); + var m = Qh(i); + N$(s.$$.fragment, m), m.forEach(kl), r = U$(f), o = G$(f, a), f.forEach(kl), d.forEach(kl), this.h(); }, h() { - Ih(i, "class", "icon-wrap svelte-fjcd9c"), Ih(t, "class", "wrap svelte-fjcd9c"), Ih(e, "class", "svelte-fjcd9c"), A$(e, "height", "100%"); + Xh(i, "class", "icon-wrap svelte-fjcd9c"), Xh(t, "class", "wrap svelte-fjcd9c"), Xh(e, "class", "svelte-fjcd9c"), X$(e, "height", "100%"); }, m(h, d) { - y$(h, e, d), cl(e, t), cl(t, i), b$(s, i, null), cl(t, r), cl(t, o), u = !0, l || (c = E$( + K$(h, e, d), Il(e, t), Il(t, i), z$(s, i, null), Il(t, r), Il(t, o), u = !0, l || (c = j$( e, "click", /*click_handler*/ n[1] ), l = !0); }, - p: T$, + p: W$, i(h) { - u || (w$(s.$$.fragment, h), u = !0); + u || (J$(s.$$.fragment, h), u = !0); }, o(h) { - L$(s.$$.fragment, h), u = !1; + eB(s.$$.fragment, h), u = !1; }, d(h) { - h && hl(e), _$(s), l = !1, c(); + h && kl(e), V$(s), l = !1, c(); } }; } -function R$(n) { - const e = I$(); +function nB(n) { + const e = tB(); return [e, () => e("click")]; } -class C$ extends d$ { +class sB extends B$ { constructor(e) { - super(), v$(this, e, R$, k$, S$, {}); + super(), q$(this, e, nB, iB, Y$, {}); } } -function F$() { +function rB() { return navigator.mediaDevices.enumerateDevices(); } -function P$(n, e) { +function aB(n, e) { e.srcObject = n, e.muted = !0, e.play(); } -async function x_(n, e, t, i) { +async function G_(n, e, t, i) { const s = { video: i ? { deviceId: { exact: i }, ...t == null ? void 0 : t.video } : (t == null ? void 0 : t.video) || { width: { ideal: 1920 }, @@ -40203,60 +40614,60 @@ async function x_(n, e, t, i) { audio: n && ((t == null ? void 0 : t.audio) ?? !0) // Defaults to true if not specified }; - return navigator.mediaDevices.getUserMedia(s).then((r) => (P$(r, e), r)); + return navigator.mediaDevices.getUserMedia(s).then((r) => (aB(r, e), r)); } -function O$(n) { +function oB(n) { return n.filter( (t) => t.kind === "videoinput" ); } const { - SvelteComponent: M$, - action_destroyer: $$, - add_render_callback: B$, - append_hydration: qe, + SvelteComponent: lB, + action_destroyer: uB, + add_render_callback: cB, + append_hydration: We, attr: Re, - binding_callbacks: N$, - check_outros: La, - children: ht, - claim_component: ts, - claim_element: at, - claim_space: rn, - claim_text: ro, - create_component: is, - create_in_transition: U$, - destroy_component: ns, - destroy_each: G$, - detach: be, - element: ot, - empty: Or, - ensure_array_like: D_, - group_outros: Ia, - init: H$, - insert_hydration: xt, - listen: Jl, - mount_component: ss, - noop: $f, - run_all: V$, - safe_not_equal: q$, - set_data: ao, - set_input_value: $d, - set_style: s1, - space: an, - src_url_equal: w_, - stop_propagation: K$, - text: oo, - toggle_class: ir, - transition_in: We, - transition_out: rt -} = window.__gradio__svelte__internal, { createEventDispatcher: j$, onDestroy: z$, onMount: W$ } = window.__gradio__svelte__internal; -function L_(n, e, t) { + binding_callbacks: hB, + check_outros: Ua, + children: _t, + claim_component: os, + claim_element: ft, + claim_space: ln, + claim_text: Ao, + create_component: ls, + create_in_transition: dB, + destroy_component: us, + destroy_each: fB, + detach: Se, + element: mt, + empty: Hr, + ensure_array_like: H_, + group_outros: Ga, + init: mB, + insert_hydration: Rt, + listen: _u, + mount_component: cs, + noop: im, + run_all: gB, + safe_not_equal: pB, + set_data: xo, + set_input_value: rf, + set_style: E1, + space: un, + src_url_equal: V_, + stop_propagation: _B, + text: Do, + toggle_class: mr, + transition_in: Qe, + transition_out: dt +} = window.__gradio__svelte__internal, { createEventDispatcher: vB, onDestroy: yB, onMount: EB } = window.__gradio__svelte__internal; +function q_(n, e, t) { const i = n.slice(); return i[40] = e[t], i; } -function Y$(n) { +function bB(n) { let e, t, i, s, r, a, o, u, l, c, h; - const d = [Z$, Q$], f = []; + const d = [AB, SB], f = []; function m(y, v) { return ( /*mode*/ @@ -40266,28 +40677,28 @@ function Y$(n) { } i = m(n), s = f[i] = d[i](n); let g = !/*recording*/ - n[11] && I_(n), p = ( + n[11] && K_(n), p = ( /*options_open*/ n[13] && /*selected_device*/ - n[8] && k_(n) + n[8] && j_(n) ); return { c() { - e = ot("div"), t = ot("button"), s.c(), a = an(), g && g.c(), o = an(), p && p.c(), u = Or(), this.h(); + e = mt("div"), t = mt("button"), s.c(), a = un(), g && g.c(), o = un(), p && p.c(), u = Hr(), this.h(); }, l(y) { - e = at(y, "DIV", { class: !0 }); - var v = ht(e); - t = at(v, "BUTTON", { "aria-label": !0, class: !0 }); - var _ = ht(t); - s.l(_), _.forEach(be), a = rn(v), g && g.l(v), v.forEach(be), o = rn(y), p && p.l(y), u = Or(), this.h(); + e = ft(y, "DIV", { class: !0 }); + var v = _t(e); + t = ft(v, "BUTTON", { "aria-label": !0, class: !0 }); + var _ = _t(t); + s.l(_), _.forEach(Se), a = ln(v), g && g.l(v), v.forEach(Se), o = ln(y), p && p.l(y), u = Hr(), this.h(); }, h() { Re(t, "aria-label", r = /*mode*/ n[2] === "image" ? "capture photo" : "start recording"), Re(t, "class", "svelte-1tdan5a"), Re(e, "class", "button-wrap svelte-1tdan5a"); }, m(y, v) { - xt(y, e, v), qe(e, t), f[i].m(t, null), qe(e, a), g && g.m(e, null), xt(y, o, v), p && p.m(y, v), xt(y, u, v), l = !0, c || (h = Jl( + Rt(y, e, v), We(e, t), f[i].m(t, null), We(e, a), g && g.m(e, null), Rt(y, o, v), p && p.m(y, v), Rt(y, u, v), l = !0, c || (h = _u( t, "click", /*click_handler_1*/ @@ -40296,99 +40707,99 @@ function Y$(n) { }, p(y, v) { let _ = i; - i = m(y), i === _ ? f[i].p(y, v) : (Ia(), rt(f[_], 1, 1, () => { + i = m(y), i === _ ? f[i].p(y, v) : (Ga(), dt(f[_], 1, 1, () => { f[_] = null; - }), La(), s = f[i], s ? s.p(y, v) : (s = f[i] = d[i](y), s.c()), We(s, 1), s.m(t, null)), (!l || v[0] & /*mode*/ + }), Ua(), s = f[i], s ? s.p(y, v) : (s = f[i] = d[i](y), s.c()), Qe(s, 1), s.m(t, null)), (!l || v[0] & /*mode*/ 4 && r !== (r = /*mode*/ y[2] === "image" ? "capture photo" : "start recording")) && Re(t, "aria-label", r), /*recording*/ - y[11] ? g && (Ia(), rt(g, 1, 1, () => { + y[11] ? g && (Ga(), dt(g, 1, 1, () => { g = null; - }), La()) : g ? (g.p(y, v), v[0] & /*recording*/ - 2048 && We(g, 1)) : (g = I_(y), g.c(), We(g, 1), g.m(e, null)), /*options_open*/ + }), Ua()) : g ? (g.p(y, v), v[0] & /*recording*/ + 2048 && Qe(g, 1)) : (g = K_(y), g.c(), Qe(g, 1), g.m(e, null)), /*options_open*/ y[13] && /*selected_device*/ y[8] ? p ? (p.p(y, v), v[0] & /*options_open, selected_device*/ - 8448 && We(p, 1)) : (p = k_(y), p.c(), We(p, 1), p.m(u.parentNode, u)) : p && (Ia(), rt(p, 1, 1, () => { + 8448 && Qe(p, 1)) : (p = j_(y), p.c(), Qe(p, 1), p.m(u.parentNode, u)) : p && (Ga(), dt(p, 1, 1, () => { p = null; - }), La()); + }), Ua()); }, i(y) { - l || (We(s), We(g), We(p), l = !0); + l || (Qe(s), Qe(g), Qe(p), l = !0); }, o(y) { - rt(s), rt(g), rt(p), l = !1; + dt(s), dt(g), dt(p), l = !1; }, d(y) { - y && (be(e), be(o), be(u)), f[i].d(), g && g.d(), p && p.d(y), c = !1, h(); + y && (Se(e), Se(o), Se(u)), f[i].d(), g && g.d(), p && p.d(y), c = !1, h(); } }; } -function X$(n) { +function TB(n) { let e, t, i, s; - return t = new C$({}), t.$on( + return t = new sB({}), t.$on( "click", /*click_handler*/ n[27] ), { c() { - e = ot("div"), is(t.$$.fragment), this.h(); + e = mt("div"), ls(t.$$.fragment), this.h(); }, l(r) { - e = at(r, "DIV", { title: !0, style: !0 }); - var a = ht(e); - ts(t.$$.fragment, a), a.forEach(be), this.h(); + e = ft(r, "DIV", { title: !0, style: !0 }); + var a = _t(e); + os(t.$$.fragment, a), a.forEach(Se), this.h(); }, h() { - Re(e, "title", "grant webcam access"), s1(e, "height", "100%"); + Re(e, "title", "grant webcam access"), E1(e, "height", "100%"); }, m(r, a) { - xt(r, e, a), ss(t, e, null), s = !0; + Rt(r, e, a), cs(t, e, null), s = !0; }, - p: $f, + p: im, i(r) { - s || (We(t.$$.fragment, r), r && (i || B$(() => { - i = U$(e, Ax, { delay: 100, duration: 200 }), i.start(); + s || (Qe(t.$$.fragment, r), r && (i || cB(() => { + i = dB(e, zx, { delay: 100, duration: 200 }), i.start(); })), s = !0); }, o(r) { - rt(t.$$.fragment, r), s = !1; + dt(t.$$.fragment, r), s = !1; }, d(r) { - r && be(e), ns(t); + r && Se(e), us(t); } }; } -function Q$(n) { +function SB(n) { let e, t, i; - return t = new DT({}), { + return t = new HT({}), { c() { - e = ot("div"), is(t.$$.fragment), this.h(); + e = mt("div"), ls(t.$$.fragment), this.h(); }, l(s) { - e = at(s, "DIV", { class: !0, title: !0 }); - var r = ht(e); - ts(t.$$.fragment, r), r.forEach(be), this.h(); + e = ft(s, "DIV", { class: !0, title: !0 }); + var r = _t(e); + os(t.$$.fragment, r), r.forEach(Se), this.h(); }, h() { Re(e, "class", "icon svelte-1tdan5a"), Re(e, "title", "capture photo"); }, m(s, r) { - xt(s, e, r), ss(t, e, null), i = !0; + Rt(s, e, r), cs(t, e, null), i = !0; }, - p: $f, + p: im, i(s) { - i || (We(t.$$.fragment, s), i = !0); + i || (Qe(t.$$.fragment, s), i = !0); }, o(s) { - rt(t.$$.fragment, s), i = !1; + dt(t.$$.fragment, s), i = !1; }, d(s) { - s && be(e), ns(t); + s && Se(e), us(t); } }; } -function Z$(n) { +function AB(n) { let e, t, i, s; - const r = [tB, eB, J$], a = []; + const r = [wB, DB, xB], a = []; function o(u, l) { return ( /*streaming*/ @@ -40404,216 +40815,216 @@ function Z$(n) { } return e = o(n), t = a[e] = r[e](n), { c() { - t.c(), i = Or(); + t.c(), i = Hr(); }, l(u) { - t.l(u), i = Or(); + t.l(u), i = Hr(); }, m(u, l) { - a[e].m(u, l), xt(u, i, l), s = !0; + a[e].m(u, l), Rt(u, i, l), s = !0; }, p(u, l) { let c = e; - e = o(u), e === c ? a[e].p(u, l) : (Ia(), rt(a[c], 1, 1, () => { + e = o(u), e === c ? a[e].p(u, l) : (Ga(), dt(a[c], 1, 1, () => { a[c] = null; - }), La(), t = a[e], t ? t.p(u, l) : (t = a[e] = r[e](u), t.c()), We(t, 1), t.m(i.parentNode, i)); + }), Ua(), t = a[e], t ? t.p(u, l) : (t = a[e] = r[e](u), t.c()), Qe(t, 1), t.m(i.parentNode, i)); }, i(u) { - s || (We(t), s = !0); + s || (Qe(t), s = !0); }, o(u) { - rt(t), s = !1; + dt(t), s = !1; }, d(u) { - u && be(i), a[e].d(u); + u && Se(i), a[e].d(u); } }; } -function J$(n) { +function xB(n) { let e, t, i, s, r = ( /*i18n*/ n[4]("audio.record") + "" ), a, o; - return i = new FT({}), { + return i = new YT({}), { c() { - e = ot("div"), t = ot("div"), is(i.$$.fragment), s = an(), a = oo(r), this.h(); + e = mt("div"), t = mt("div"), ls(i.$$.fragment), s = un(), a = Do(r), this.h(); }, l(u) { - e = at(u, "DIV", { class: !0 }); - var l = ht(e); - t = at(l, "DIV", { class: !0, title: !0 }); - var c = ht(t); - ts(i.$$.fragment, c), c.forEach(be), s = rn(l), a = ro(l, r), l.forEach(be), this.h(); + e = ft(u, "DIV", { class: !0 }); + var l = _t(e); + t = ft(l, "DIV", { class: !0, title: !0 }); + var c = _t(t); + os(i.$$.fragment, c), c.forEach(Se), s = ln(l), a = Ao(l, r), l.forEach(Se), this.h(); }, h() { Re(t, "class", "icon color-primary svelte-1tdan5a"), Re(t, "title", "start recording"), Re(e, "class", "icon-with-text svelte-1tdan5a"); }, m(u, l) { - xt(u, e, l), qe(e, t), ss(i, t, null), qe(e, s), qe(e, a), o = !0; + Rt(u, e, l), We(e, t), cs(i, t, null), We(e, s), We(e, a), o = !0; }, p(u, l) { (!o || l[0] & /*i18n*/ 16) && r !== (r = /*i18n*/ - u[4]("audio.record") + "") && ao(a, r); + u[4]("audio.record") + "") && xo(a, r); }, i(u) { - o || (We(i.$$.fragment, u), o = !0); + o || (Qe(i.$$.fragment, u), o = !0); }, o(u) { - rt(i.$$.fragment, u), o = !1; + dt(i.$$.fragment, u), o = !1; }, d(u) { - u && be(e), ns(i); + u && Se(e), us(i); } }; } -function eB(n) { +function DB(n) { let e, t, i, s, r = ( /*i18n*/ n[4]("audio.stop") + "" ), a, o; - return i = new sA({}), { + return i = new fA({}), { c() { - e = ot("div"), t = ot("div"), is(i.$$.fragment), s = an(), a = oo(r), this.h(); + e = mt("div"), t = mt("div"), ls(i.$$.fragment), s = un(), a = Do(r), this.h(); }, l(u) { - e = at(u, "DIV", { class: !0 }); - var l = ht(e); - t = at(l, "DIV", { class: !0, title: !0 }); - var c = ht(t); - ts(i.$$.fragment, c), c.forEach(be), s = rn(l), a = ro(l, r), l.forEach(be), this.h(); + e = ft(u, "DIV", { class: !0 }); + var l = _t(e); + t = ft(l, "DIV", { class: !0, title: !0 }); + var c = _t(t); + os(i.$$.fragment, c), c.forEach(Se), s = ln(l), a = Ao(l, r), l.forEach(Se), this.h(); }, h() { Re(t, "class", "icon color-primary svelte-1tdan5a"), Re(t, "title", "stop recording"), Re(e, "class", "icon-with-text svelte-1tdan5a"); }, m(u, l) { - xt(u, e, l), qe(e, t), ss(i, t, null), qe(e, s), qe(e, a), o = !0; + Rt(u, e, l), We(e, t), cs(i, t, null), We(e, s), We(e, a), o = !0; }, p(u, l) { (!o || l[0] & /*i18n*/ 16) && r !== (r = /*i18n*/ - u[4]("audio.stop") + "") && ao(a, r); + u[4]("audio.stop") + "") && xo(a, r); }, i(u) { - o || (We(i.$$.fragment, u), o = !0); + o || (Qe(i.$$.fragment, u), o = !0); }, o(u) { - rt(i.$$.fragment, u), o = !1; + dt(i.$$.fragment, u), o = !1; }, d(u) { - u && be(e), ns(i); + u && Se(e), us(i); } }; } -function tB(n) { +function wB(n) { let e, t, i, s, r = ( /*i18n*/ n[4]("audio.waiting") + "" ), a, o; - return i = new $A({}), { + return i = new ax({}), { c() { - e = ot("div"), t = ot("div"), is(i.$$.fragment), s = an(), a = oo(r), this.h(); + e = mt("div"), t = mt("div"), ls(i.$$.fragment), s = un(), a = Do(r), this.h(); }, l(u) { - e = at(u, "DIV", { class: !0, style: !0 }); - var l = ht(e); - t = at(l, "DIV", { class: !0, title: !0 }); - var c = ht(t); - ts(i.$$.fragment, c), c.forEach(be), s = rn(l), a = ro(l, r), l.forEach(be), this.h(); + e = ft(u, "DIV", { class: !0, style: !0 }); + var l = _t(e); + t = ft(l, "DIV", { class: !0, title: !0 }); + var c = _t(t); + os(i.$$.fragment, c), c.forEach(Se), s = ln(l), a = Ao(l, r), l.forEach(Se), this.h(); }, h() { - Re(t, "class", "icon color-primary svelte-1tdan5a"), Re(t, "title", "spinner"), Re(e, "class", "icon-with-text svelte-1tdan5a"), s1(e, "width", "var(--size-24)"); + Re(t, "class", "icon color-primary svelte-1tdan5a"), Re(t, "title", "spinner"), Re(e, "class", "icon-with-text svelte-1tdan5a"), E1(e, "width", "var(--size-24)"); }, m(u, l) { - xt(u, e, l), qe(e, t), ss(i, t, null), qe(e, s), qe(e, a), o = !0; + Rt(u, e, l), We(e, t), cs(i, t, null), We(e, s), We(e, a), o = !0; }, p(u, l) { (!o || l[0] & /*i18n*/ 16) && r !== (r = /*i18n*/ - u[4]("audio.waiting") + "") && ao(a, r); + u[4]("audio.waiting") + "") && xo(a, r); }, i(u) { - o || (We(i.$$.fragment, u), o = !0); + o || (Qe(i.$$.fragment, u), o = !0); }, o(u) { - rt(i.$$.fragment, u), o = !1; + dt(i.$$.fragment, u), o = !1; }, d(u) { - u && be(e), ns(i); + u && Se(e), us(i); } }; } -function I_(n) { +function K_(n) { let e, t, i, s, r; - return t = new lv({}), { + return t = new Av({}), { c() { - e = ot("button"), is(t.$$.fragment), this.h(); + e = mt("button"), ls(t.$$.fragment), this.h(); }, l(a) { - e = at(a, "BUTTON", { class: !0, "aria-label": !0 }); - var o = ht(e); - ts(t.$$.fragment, o), o.forEach(be), this.h(); + e = ft(a, "BUTTON", { class: !0, "aria-label": !0 }); + var o = _t(e); + os(t.$$.fragment, o), o.forEach(Se), this.h(); }, h() { Re(e, "class", "icon svelte-1tdan5a"), Re(e, "aria-label", "select input source"); }, m(a, o) { - xt(a, e, o), ss(t, e, null), i = !0, s || (r = Jl( + Rt(a, e, o), cs(t, e, null), i = !0, s || (r = _u( e, "click", /*click_handler_2*/ n[29] ), s = !0); }, - p: $f, + p: im, i(a) { - i || (We(t.$$.fragment, a), i = !0); + i || (Qe(t.$$.fragment, a), i = !0); }, o(a) { - rt(t.$$.fragment, a), i = !1; + dt(t.$$.fragment, a), i = !1; }, d(a) { - a && be(e), ns(t), s = !1, r(); + a && Se(e), us(t), s = !1, r(); } }; } -function k_(n) { +function j_(n) { let e, t, i, s, r, a, o; - i = new lv({}); + i = new Av({}); function u(h, d) { return ( /*available_video_devices*/ - h[7].length === 0 ? nB : iB + h[7].length === 0 ? IB : LB ); } let l = u(n), c = l(n); return { c() { - e = ot("select"), t = ot("button"), is(i.$$.fragment), s = an(), c.c(), this.h(); + e = mt("select"), t = mt("button"), ls(i.$$.fragment), s = un(), c.c(), this.h(); }, l(h) { - e = at(h, "SELECT", { class: !0, "aria-label": !0 }); - var d = ht(e); - t = at(d, "BUTTON", { class: !0 }); - var f = ht(t); - ts(i.$$.fragment, f), s = rn(f), f.forEach(be), c.l(d), d.forEach(be), this.h(); + e = ft(h, "SELECT", { class: !0, "aria-label": !0 }); + var d = _t(e); + t = ft(d, "BUTTON", { class: !0 }); + var f = _t(t); + os(i.$$.fragment, f), s = ln(f), f.forEach(Se), c.l(d), d.forEach(Se), this.h(); }, h() { Re(t, "class", "inset-icon svelte-1tdan5a"), Re(e, "class", "select-wrap svelte-1tdan5a"), Re(e, "aria-label", "select source"); }, m(h, d) { - xt(h, e, d), qe(e, t), ss(i, t, null), qe(t, s), c.m(e, null), r = !0, a || (o = [ - Jl(t, "click", K$( + Rt(h, e, d), We(e, t), cs(i, t, null), We(t, s), c.m(e, null), r = !0, a || (o = [ + _u(t, "click", _B( /*click_handler_3*/ n[30] )), - $$(Bf.call( + uB(nm.call( null, e, /*handle_click_outside*/ n[17] )), - Jl( + _u( e, "change", /*handle_device_change*/ @@ -40625,50 +41036,50 @@ function k_(n) { l === (l = u(h)) && c ? c.p(h, d) : (c.d(1), c = l(h), c && (c.c(), c.m(e, null))); }, i(h) { - r || (We(i.$$.fragment, h), r = !0); + r || (Qe(i.$$.fragment, h), r = !0); }, o(h) { - rt(i.$$.fragment, h), r = !1; + dt(i.$$.fragment, h), r = !1; }, d(h) { - h && be(e), ns(i), c.d(), a = !1, V$(o); + h && Se(e), us(i), c.d(), a = !1, gB(o); } }; } -function iB(n) { - let e, t = D_( +function LB(n) { + let e, t = H_( /*available_video_devices*/ n[7] ), i = []; for (let s = 0; s < t.length; s += 1) - i[s] = R_(L_(n, t, s)); + i[s] = z_(q_(n, t, s)); return { c() { for (let s = 0; s < i.length; s += 1) i[s].c(); - e = Or(); + e = Hr(); }, l(s) { for (let r = 0; r < i.length; r += 1) i[r].l(s); - e = Or(); + e = Hr(); }, m(s, r) { for (let a = 0; a < i.length; a += 1) i[a] && i[a].m(s, r); - xt(s, e, r); + Rt(s, e, r); }, p(s, r) { if (r[0] & /*available_video_devices, selected_device*/ 384) { - t = D_( + t = H_( /*available_video_devices*/ s[7] ); let a; for (a = 0; a < t.length; a += 1) { - const o = L_(s, t, a); - i[a] ? i[a].p(o, r) : (i[a] = R_(o), i[a].c(), i[a].m(e.parentNode, e)); + const o = q_(s, t, a); + i[a] ? i[a].p(o, r) : (i[a] = z_(o), i[a].c(), i[a].m(e.parentNode, e)); } for (; a < i.length; a += 1) i[a].d(1); @@ -40676,87 +41087,87 @@ function iB(n) { } }, d(s) { - s && be(e), G$(i, s); + s && Se(e), fB(i, s); } }; } -function nB(n) { +function IB(n) { let e, t = ( /*i18n*/ n[4]("common.no_devices") + "" ), i; return { c() { - e = ot("option"), i = oo(t), this.h(); + e = mt("option"), i = Do(t), this.h(); }, l(s) { - e = at(s, "OPTION", { class: !0 }); - var r = ht(e); - i = ro(r, t), r.forEach(be), this.h(); + e = ft(s, "OPTION", { class: !0 }); + var r = _t(e); + i = Ao(r, t), r.forEach(Se), this.h(); }, h() { - e.__value = "", $d(e, e.__value), Re(e, "class", "svelte-1tdan5a"); + e.__value = "", rf(e, e.__value), Re(e, "class", "svelte-1tdan5a"); }, m(s, r) { - xt(s, e, r), qe(e, i); + Rt(s, e, r), We(e, i); }, p(s, r) { r[0] & /*i18n*/ 16 && t !== (t = /*i18n*/ - s[4]("common.no_devices") + "") && ao(i, t); + s[4]("common.no_devices") + "") && xo(i, t); }, d(s) { - s && be(e); + s && Se(e); } }; } -function R_(n) { +function z_(n) { let e, t = ( /*device*/ n[40].label + "" ), i, s, r, a; return { c() { - e = ot("option"), i = oo(t), s = an(), this.h(); + e = mt("option"), i = Do(t), s = un(), this.h(); }, l(o) { - e = at(o, "OPTION", { class: !0 }); - var u = ht(e); - i = ro(u, t), s = rn(u), u.forEach(be), this.h(); + e = ft(o, "OPTION", { class: !0 }); + var u = _t(e); + i = Ao(u, t), s = ln(u), u.forEach(Se), this.h(); }, h() { e.__value = r = /*device*/ - n[40].deviceId, $d(e, e.__value), e.selected = a = /*selected_device*/ + n[40].deviceId, rf(e, e.__value), e.selected = a = /*selected_device*/ n[8].deviceId === /*device*/ n[40].deviceId, Re(e, "class", "svelte-1tdan5a"); }, m(o, u) { - xt(o, e, u), qe(e, i), qe(e, s); + Rt(o, e, u), We(e, i), We(e, s); }, p(o, u) { u[0] & /*available_video_devices*/ 128 && t !== (t = /*device*/ - o[40].label + "") && ao(i, t), u[0] & /*available_video_devices*/ + o[40].label + "") && xo(i, t), u[0] & /*available_video_devices*/ 128 && r !== (r = /*device*/ - o[40].deviceId) && (e.__value = r, $d(e, e.__value)), u[0] & /*selected_device, available_video_devices*/ + o[40].deviceId) && (e.__value = r, rf(e, e.__value)), u[0] & /*selected_device, available_video_devices*/ 384 && a !== (a = /*selected_device*/ o[8].deviceId === /*device*/ o[40].deviceId) && (e.selected = a); }, d(o) { - o && be(e); + o && Se(e); } }; } -function sB(n) { +function kB(n) { let e, t, i, s, r, a, o, u, l, c, h; - t = new OD({ + t = new sw({ props: { time_limit: ( /*time_limit*/ n[9] ) } }); - const d = [X$, Y$], f = []; + const d = [TB, bB], f = []; function m(g, p) { return ( /*webcam_accessed*/ @@ -40765,31 +41176,31 @@ function sB(n) { } return l = m(n), c = f[l] = d[l](n), { c() { - e = ot("div"), is(t.$$.fragment), i = an(), s = ot("video"), r = an(), a = ot("img"), u = an(), c.c(), this.h(); + e = mt("div"), ls(t.$$.fragment), i = un(), s = mt("video"), r = un(), a = mt("img"), u = un(), c.c(), this.h(); }, l(g) { - e = at(g, "DIV", { class: !0 }); - var p = ht(e); - ts(t.$$.fragment, p), i = rn(p), s = at(p, "VIDEO", { class: !0 }), ht(s).forEach(be), r = rn(p), a = at(p, "IMG", { src: !0, class: !0 }), u = rn(p), c.l(p), p.forEach(be), this.h(); + e = ft(g, "DIV", { class: !0 }); + var p = _t(e); + os(t.$$.fragment, p), i = ln(p), s = ft(p, "VIDEO", { class: !0 }), _t(s).forEach(Se), r = ln(p), a = ft(p, "IMG", { src: !0, class: !0 }), u = ln(p), c.l(p), p.forEach(Se), this.h(); }, h() { var g; - Re(s, "class", "svelte-1tdan5a"), ir( + Re(s, "class", "svelte-1tdan5a"), mr( s, "flip", /*mirror_webcam*/ n[3] - ), ir(s, "hide", !/*webcam_accessed*/ + ), mr(s, "hide", !/*webcam_accessed*/ n[12] || /*webcam_accessed*/ n[12] && !!/*value*/ - n[0]), w_(a.src, o = /*value*/ - (g = n[0]) == null ? void 0 : g.url) || Re(a, "src", o), Re(a, "class", "svelte-1tdan5a"), ir(a, "hide", !/*webcam_accessed*/ + n[0]), V_(a.src, o = /*value*/ + (g = n[0]) == null ? void 0 : g.url) || Re(a, "src", o), Re(a, "class", "svelte-1tdan5a"), mr(a, "hide", !/*webcam_accessed*/ n[12] || /*webcam_accessed*/ n[12] && !/*value*/ n[0]), Re(e, "class", "wrap svelte-1tdan5a"); }, m(g, p) { - xt(g, e, p), ss(t, e, null), qe(e, i), qe(e, s), n[26](s), qe(e, r), qe(e, a), qe(e, u), f[l].m(e, null), h = !0; + Rt(g, e, p), cs(t, e, null), We(e, i), We(e, s), n[26](s), We(e, r), We(e, a), We(e, u), f[l].m(e, null), h = !0; }, p(g, p) { var _; @@ -40797,39 +41208,39 @@ function sB(n) { p[0] & /*time_limit*/ 512 && (y.time_limit = /*time_limit*/ g[9]), t.$set(y), (!h || p[0] & /*mirror_webcam*/ - 8) && ir( + 8) && mr( s, "flip", /*mirror_webcam*/ g[3] ), (!h || p[0] & /*webcam_accessed, value*/ - 4097) && ir(s, "hide", !/*webcam_accessed*/ + 4097) && mr(s, "hide", !/*webcam_accessed*/ g[12] || /*webcam_accessed*/ g[12] && !!/*value*/ g[0]), (!h || p[0] & /*value*/ - 1 && !w_(a.src, o = /*value*/ + 1 && !V_(a.src, o = /*value*/ (_ = g[0]) == null ? void 0 : _.url)) && Re(a, "src", o), (!h || p[0] & /*webcam_accessed, value*/ - 4097) && ir(a, "hide", !/*webcam_accessed*/ + 4097) && mr(a, "hide", !/*webcam_accessed*/ g[12] || /*webcam_accessed*/ g[12] && !/*value*/ g[0]); let v = l; - l = m(g), l === v ? f[l].p(g, p) : (Ia(), rt(f[v], 1, 1, () => { + l = m(g), l === v ? f[l].p(g, p) : (Ga(), dt(f[v], 1, 1, () => { f[v] = null; - }), La(), c = f[l], c ? c.p(g, p) : (c = f[l] = d[l](g), c.c()), We(c, 1), c.m(e, null)); + }), Ua(), c = f[l], c ? c.p(g, p) : (c = f[l] = d[l](g), c.c()), Qe(c, 1), c.m(e, null)); }, i(g) { - h || (We(t.$$.fragment, g), We(c), h = !0); + h || (Qe(t.$$.fragment, g), Qe(c), h = !0); }, o(g) { - rt(t.$$.fragment, g), rt(c), h = !1; + dt(t.$$.fragment, g), dt(c), h = !1; }, d(g) { - g && be(e), ns(t), n[26](null), f[l].d(); + g && Se(e), us(t), n[26](null), f[l].d(); } }; } -function Bf(n, e) { +function nm(n, e) { const t = (i) => { n && !n.contains(i.target) && !i.defaultPrevented && e(i); }; @@ -40839,43 +41250,43 @@ function Bf(n, e) { } }; } -function rB(n, e, t) { - var i = this && this.__awaiter || function(B, N, G, Y) { - function ee(se) { - return se instanceof G ? se : new G(function(ye) { - ye(se); +function RB(n, e, t) { + var i = this && this.__awaiter || function(N, ee, G, Z) { + function U(re) { + return re instanceof G ? re : new G(function(j) { + j(re); }); } - return new (G || (G = Promise))(function(se, ye) { - function Pe(ae) { + return new (G || (G = Promise))(function(re, j) { + function Ee(se) { try { - jt(Y.next(ae)); - } catch (he) { - ye(he); + je(Z.next(se)); + } catch (ve) { + j(ve); } } - function Ke(ae) { + function Oe(se) { try { - jt(Y.throw(ae)); - } catch (he) { - ye(he); + je(Z.throw(se)); + } catch (ve) { + j(ve); } } - function jt(ae) { - ae.done ? se(ae.value) : ee(ae.value).then(Pe, Ke); + function je(se) { + se.done ? re(se.value) : U(se.value).then(Ee, Oe); } - jt((Y = Y.apply(B, N || [])).next()); + je((Z = Z.apply(N, ee || [])).next()); }); }; let s, r = [], a = null, o = null, u = "closed"; - const l = (B) => { - B === "closed" ? (t(9, o = null), t(10, u = "closed"), t(0, A = null)) : B === "waiting" ? t(10, u = "waiting") : t(10, u = "open"); - }, c = (B) => { - I && t(9, o = B); + const l = (N) => { + N === "closed" ? (t(9, o = null), t(10, u = "closed"), t(0, x = null)) : N === "waiting" ? t(10, u = "waiting") : t(10, u = "open"); + }, c = (N) => { + I && t(9, o = N); }; - let h, { streaming: d = !1 } = e, { pending: f = !1 } = e, { root: m = "" } = e, { stream_every: g = 1 } = e, { mode: p = "image" } = e, { mirror_webcam: y } = e, { include_audio: v } = e, { webcam_constraints: _ = null } = e, { i18n: E } = e, { upload: T } = e, { value: A = null } = e; - const S = j$(); - W$(() => { + let h, { streaming: d = !1 } = e, { pending: f = !1 } = e, { root: m = "" } = e, { stream_every: g = 1 } = e, { mode: p = "image" } = e, { mirror_webcam: y } = e, { include_audio: v } = e, { webcam_constraints: _ = null } = e, { i18n: E } = e, { upload: T } = e, { value: x = null } = e; + const S = vB(); + EB(() => { h = document.createElement("canvas"), d && p === "image" && window.setInterval( () => { s && !f && w(); @@ -40883,129 +41294,129 @@ function rB(n, e, t) { g * 1e3 ); }); - const D = (B) => i(void 0, void 0, void 0, function* () { - const G = B.target.value; - yield x_(v, s, _, G).then((Y) => i(void 0, void 0, void 0, function* () { - M = Y, t(8, a = r.find((ee) => ee.deviceId === G) || null), t(13, j = !1); + const D = (N) => i(void 0, void 0, void 0, function* () { + const G = N.target.value; + yield G_(v, s, _, G).then((Z) => i(void 0, void 0, void 0, function* () { + k = Z, t(8, a = r.find((U) => U.deviceId === G) || null), t(13, z = !1); })); }); - function x() { + function A() { return i(this, void 0, void 0, function* () { try { - x_(v, s, _).then((B) => i(this, void 0, void 0, function* () { - t(12, W = !0), t(7, r = yield F$()), M = B; - })).then(() => O$(r)).then((B) => { - t(7, r = B); - const N = M.getTracks().map((G) => { - var Y; - return (Y = G.getSettings()) === null || Y === void 0 ? void 0 : Y.deviceId; + G_(v, s, _).then((N) => i(this, void 0, void 0, function* () { + t(12, Y = !0), t(7, r = yield rB()), k = N; + })).then(() => oB(r)).then((N) => { + t(7, r = N); + const ee = k.getTracks().map((G) => { + var Z; + return (Z = G.getSettings()) === null || Z === void 0 ? void 0 : Z.deviceId; })[0]; - t(8, a = N && B.find((G) => G.deviceId === N) || r[0]); + t(8, a = ee && N.find((G) => G.deviceId === ee) || r[0]); }), (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) && S("error", E("image.no_webcam_support")); - } catch (B) { - if (B instanceof DOMException && B.name == "NotAllowedError") + } catch (N) { + if (N instanceof DOMException && N.name == "NotAllowedError") S("error", E("image.allow_webcam_access")); else - throw B; + throw N; } }); } function w() { - var B = h.getContext("2d"); + var N = h.getContext("2d"); if ((!d || d && I) && s.videoWidth && s.videoHeight) { - if (h.width = s.videoWidth, h.height = s.videoHeight, B.drawImage(s, 0, 0, s.videoWidth, s.videoHeight), y && (B.scale(-1, 1), B.drawImage(s, -s.videoWidth, 0)), d && (!I || u === "waiting")) + if (h.width = s.videoWidth, h.height = s.videoHeight, N.drawImage(s, 0, 0, s.videoWidth, s.videoHeight), y && (N.scale(-1, 1), N.drawImage(s, -s.videoWidth, 0)), d && (!I || u === "waiting")) return; if (d) { - const N = h.toDataURL("image/jpeg"); - S("stream", N); + const ee = h.toDataURL("image/jpeg"); + S("stream", ee); return; } h.toBlob( - (N) => { - S(d ? "stream" : "capture", N); + (ee) => { + S(d ? "stream" : "capture", ee); }, `image/${d ? "jpeg" : "png"}`, 0.8 ); } } - let I = !1, R = [], M, P, K; - function q() { + let I = !1, M = [], k, q, K; + function H() { if (I) { K.stop(); - let B = new Blob(R, { type: P }), N = new FileReader(); - N.onload = function(G) { + let N = new Blob(M, { type: q }), ee = new FileReader(); + ee.onload = function(G) { return i(this, void 0, void 0, function* () { - var Y; + var Z; if (G.target) { - let ee = new File([B], "sample." + P.substring(6)); - const se = yield If([ee]); - let ye = ((Y = yield T(se, m)) === null || Y === void 0 ? void 0 : Y.filter(Boolean))[0]; - S("capture", ye), S("stop_recording"); + let U = new File([N], "sample." + q.substring(6)); + const re = yield Xf([U]); + let j = ((Z = yield T(re, m)) === null || Z === void 0 ? void 0 : Z.filter(Boolean))[0]; + S("capture", j), S("stop_recording"); } }); - }, N.readAsDataURL(B); + }, ee.readAsDataURL(N); } else if (typeof MediaRecorder < "u") { - S("start_recording"), R = []; - let B = ["video/webm", "video/mp4"]; - for (let N of B) - if (MediaRecorder.isTypeSupported(N)) { - P = N; + S("start_recording"), M = []; + let N = ["video/webm", "video/mp4"]; + for (let ee of N) + if (MediaRecorder.isTypeSupported(ee)) { + q = ee; break; } - if (P === null) { + if (q === null) { console.error("No supported MediaRecorder mimeType"); return; } - K = new MediaRecorder(M, { mimeType: P }), K.addEventListener("dataavailable", function(N) { - R.push(N.data); + K = new MediaRecorder(k, { mimeType: q }), K.addEventListener("dataavailable", function(ee) { + M.push(ee.data); }), K.start(200); } t(11, I = !I); } - let W = !1; - function U({ destroy: B } = {}) { - p === "image" && d && t(11, I = !I), B || (p === "image" ? w() : q()), !I && M && (S("close_stream"), M.getTracks().forEach((N) => N.stop()), t(6, s.srcObject = null, s), t(12, W = !1), window.setTimeout( + let Y = !1; + function B({ destroy: N } = {}) { + p === "image" && d && t(11, I = !I), N || (p === "image" ? w() : H()), !I && k && (S("close_stream"), k.getTracks().forEach((ee) => ee.stop()), t(6, s.srcObject = null, s), t(12, Y = !1), window.setTimeout( () => { - t(0, A = null); + t(0, x = null); }, 500 - ), t(0, A = null)); + ), t(0, x = null)); } - let j = !1; - function $(B) { - B.preventDefault(), B.stopPropagation(), t(13, j = !1); + let z = !1; + function W(N) { + N.preventDefault(), N.stopPropagation(), t(13, z = !1); } - z$(() => { - typeof window > "u" || (U({ destroy: !0 }), M == null || M.getTracks().forEach((B) => B.stop())); + yB(() => { + typeof window > "u" || (B({ destroy: !0 }), k == null || k.getTracks().forEach((N) => N.stop())); }); - function L(B) { - N$[B ? "unshift" : "push"](() => { - s = B, t(6, s); + function L(N) { + hB[N ? "unshift" : "push"](() => { + s = N, t(6, s); }); } - const H = async () => x(), Q = () => U(), X = () => t(13, j = !0), C = () => t(13, j = !1); - return n.$$set = (B) => { - "streaming" in B && t(1, d = B.streaming), "pending" in B && t(20, f = B.pending), "root" in B && t(21, m = B.root), "stream_every" in B && t(22, g = B.stream_every), "mode" in B && t(2, p = B.mode), "mirror_webcam" in B && t(3, y = B.mirror_webcam), "include_audio" in B && t(23, v = B.include_audio), "webcam_constraints" in B && t(24, _ = B.webcam_constraints), "i18n" in B && t(4, E = B.i18n), "upload" in B && t(25, T = B.upload), "value" in B && t(0, A = B.value); + const $ = async () => A(), Q = () => B(), C = () => t(13, z = !0), O = () => t(13, z = !1); + return n.$$set = (N) => { + "streaming" in N && t(1, d = N.streaming), "pending" in N && t(20, f = N.pending), "root" in N && t(21, m = N.root), "stream_every" in N && t(22, g = N.stream_every), "mode" in N && t(2, p = N.mode), "mirror_webcam" in N && t(3, y = N.mirror_webcam), "include_audio" in N && t(23, v = N.include_audio), "webcam_constraints" in N && t(24, _ = N.webcam_constraints), "i18n" in N && t(4, E = N.i18n), "upload" in N && t(25, T = N.upload), "value" in N && t(0, x = N.value); }, [ - A, + x, d, p, y, E, - Bf, + nm, s, r, a, o, u, I, - W, - j, + Y, + z, D, - x, - U, - $, + A, + B, + W, l, c, f, @@ -41015,20 +41426,20 @@ function rB(n, e, t) { _, T, L, - H, + $, Q, - X, - C + C, + O ]; } -class aB extends M$ { +class CB extends lB { constructor(e) { - super(), H$( + super(), mB( this, e, - rB, - sB, - q$, + RB, + kB, + pB, { modify_stream: 18, set_time_limit: 19, @@ -41056,200 +41467,200 @@ class aB extends M$ { return this.$$.ctx[19]; } get click_outside() { - return Bf; + return nm; } } const { - SvelteComponent: vz, - add_flush_callback: yz, - append_hydration: Ez, - attr: bz, - bind: Tz, - binding_callbacks: Sz, - bubble: Az, - check_outros: xz, - children: Dz, - claim_component: wz, - claim_element: Lz, - claim_space: Iz, - create_component: kz, - create_slot: Rz, - destroy_component: Cz, - detach: Fz, - element: Pz, - empty: Oz, - get_all_dirty_from_scope: Mz, - get_slot_changes: $z, - group_outros: Bz, - init: Nz, - insert_hydration: Uz, - listen: Gz, - mount_component: Hz, - run_all: Vz, - safe_not_equal: qz, - set_style: Kz, - space: jz, - toggle_class: zz, - transition_in: Wz, - transition_out: Yz, - update_slot_base: Xz -} = window.__gradio__svelte__internal, { createEventDispatcher: Qz, tick: Zz } = window.__gradio__svelte__internal, { - SvelteComponent: Jz, - attr: eW, - check_outros: tW, - children: iW, - claim_component: nW, - claim_element: sW, - create_component: rW, - destroy_component: aW, - detach: oW, - element: lW, - group_outros: uW, - init: cW, - insert_hydration: hW, - mount_component: dW, - safe_not_equal: fW, - toggle_class: mW, - transition_in: gW, - transition_out: pW + SvelteComponent: Cz, + add_flush_callback: Fz, + append_hydration: Pz, + attr: Oz, + bind: Mz, + binding_callbacks: $z, + bubble: Bz, + check_outros: Nz, + children: Uz, + claim_component: Gz, + claim_element: Hz, + claim_space: Vz, + create_component: qz, + create_slot: Kz, + destroy_component: jz, + detach: zz, + element: Wz, + empty: Yz, + get_all_dirty_from_scope: Xz, + get_slot_changes: Qz, + group_outros: Zz, + init: Jz, + insert_hydration: eW, + listen: tW, + mount_component: iW, + run_all: nW, + safe_not_equal: sW, + set_style: rW, + space: aW, + toggle_class: oW, + transition_in: lW, + transition_out: uW, + update_slot_base: cW +} = window.__gradio__svelte__internal, { createEventDispatcher: hW, tick: dW } = window.__gradio__svelte__internal, { + SvelteComponent: fW, + attr: mW, + check_outros: gW, + children: pW, + claim_component: _W, + claim_element: vW, + create_component: yW, + destroy_component: EW, + detach: bW, + element: TW, + group_outros: SW, + init: AW, + insert_hydration: xW, + mount_component: DW, + safe_not_equal: wW, + toggle_class: LW, + transition_in: IW, + transition_out: kW } = window.__gradio__svelte__internal, { - SvelteComponent: _W, - add_flush_callback: vW, - assign: yW, - bind: EW, - binding_callbacks: bW, - check_outros: TW, - claim_component: SW, - claim_space: AW, - create_component: xW, - destroy_component: DW, - detach: wW, - empty: LW, - flush: IW, - get_spread_object: kW, - get_spread_update: RW, - group_outros: CW, - init: FW, - insert_hydration: PW, - mount_component: OW, - safe_not_equal: MW, - space: $W, - transition_in: BW, - transition_out: NW -} = window.__gradio__svelte__internal, { afterUpdate: UW } = window.__gradio__svelte__internal, { - SvelteComponent: oB, - add_flush_callback: Bd, - append_hydration: Nd, - attr: ja, - bind: Ud, - binding_callbacks: Gd, - bubble: Fh, - check_outros: Nf, - children: eu, - claim_component: za, - claim_element: tu, - claim_space: Hd, - claim_text: C_, - create_component: Wa, - create_slot: lB, - destroy_component: Ya, - detach: Ai, - element: iu, - empty: F_, - get_all_dirty_from_scope: uB, - get_slot_changes: cB, - group_outros: Uf, - init: hB, - insert_hydration: Ss, - mount_component: Xa, - noop: Vd, - safe_not_equal: r1, - set_data: P_, - space: qd, - text: O_, - transition_in: ii, - transition_out: ni, - update_slot_base: dB -} = window.__gradio__svelte__internal, { createEventDispatcher: fB } = window.__gradio__svelte__internal; -function mB(n) { + SvelteComponent: RW, + add_flush_callback: CW, + assign: FW, + bind: PW, + binding_callbacks: OW, + check_outros: MW, + claim_component: $W, + claim_space: BW, + create_component: NW, + destroy_component: UW, + detach: GW, + empty: HW, + flush: VW, + get_spread_object: qW, + get_spread_update: KW, + group_outros: jW, + init: zW, + insert_hydration: WW, + mount_component: YW, + safe_not_equal: XW, + space: QW, + transition_in: ZW, + transition_out: JW +} = window.__gradio__svelte__internal, { afterUpdate: eY } = window.__gradio__svelte__internal, { + SvelteComponent: FB, + add_flush_callback: af, + append_hydration: of, + attr: ao, + bind: lf, + binding_callbacks: uf, + bubble: ed, + check_outros: sm, + children: vu, + claim_component: oo, + claim_element: yu, + claim_space: cf, + claim_text: W_, + create_component: lo, + create_slot: PB, + destroy_component: uo, + detach: Pi, + element: Eu, + empty: Y_, + get_all_dirty_from_scope: OB, + get_slot_changes: MB, + group_outros: rm, + init: $B, + insert_hydration: Ps, + mount_component: co, + noop: hf, + safe_not_equal: b1, + set_data: X_, + space: df, + text: Q_, + transition_in: oi, + transition_out: li, + update_slot_base: BB +} = window.__gradio__svelte__internal, { createEventDispatcher: NB } = window.__gradio__svelte__internal; +function UB(n) { let e, t = ( /*value*/ (n[0].orig_name || /*value*/ n[0].url) + "" - ), i, s, r, a = up( + ), i, s, r, a = Dp( /*value*/ n[0].size ) + "", o; return { c() { - e = iu("div"), i = O_(t), s = qd(), r = iu("div"), o = O_(a), this.h(); + e = Eu("div"), i = Q_(t), s = df(), r = Eu("div"), o = Q_(a), this.h(); }, l(u) { - e = tu(u, "DIV", { class: !0 }); - var l = eu(e); - i = C_(l, t), l.forEach(Ai), s = Hd(u), r = tu(u, "DIV", { class: !0 }); - var c = eu(r); - o = C_(c, a), c.forEach(Ai), this.h(); + e = yu(u, "DIV", { class: !0 }); + var l = vu(e); + i = W_(l, t), l.forEach(Pi), s = cf(u), r = yu(u, "DIV", { class: !0 }); + var c = vu(r); + o = W_(c, a), c.forEach(Pi), this.h(); }, h() { - ja(e, "class", "file-name svelte-1kyjvp4"), ja(r, "class", "file-size svelte-1kyjvp4"); + ao(e, "class", "file-name svelte-1kyjvp4"), ao(r, "class", "file-size svelte-1kyjvp4"); }, m(u, l) { - Ss(u, e, l), Nd(e, i), Ss(u, s, l), Ss(u, r, l), Nd(r, o); + Ps(u, e, l), of(e, i), Ps(u, s, l), Ps(u, r, l), of(r, o); }, p(u, l) { l[0] & /*value*/ 1 && t !== (t = /*value*/ (u[0].orig_name || /*value*/ - u[0].url) + "") && P_(i, t), l[0] & /*value*/ - 1 && a !== (a = up( + u[0].url) + "") && X_(i, t), l[0] & /*value*/ + 1 && a !== (a = Dp( /*value*/ u[0].size - ) + "") && P_(o, a); + ) + "") && X_(o, a); }, - i: Vd, - o: Vd, + i: hf, + o: hf, d(u) { - u && (Ai(e), Ai(s), Ai(r)); + u && (Pi(e), Pi(s), Pi(r)); } }; } -function gB(n) { +function GB(n) { var r; let e = ( /*value*/ (r = n[0]) == null ? void 0 : r.url - ), t, i, s = M_(n); + ), t, i, s = Z_(n); return { c() { - s.c(), t = F_(); + s.c(), t = Y_(); }, l(a) { - s.l(a), t = F_(); + s.l(a), t = Y_(); }, m(a, o) { - s.m(a, o), Ss(a, t, o), i = !0; + s.m(a, o), Ps(a, t, o), i = !0; }, p(a, o) { var u; o[0] & /*value*/ - 1 && r1(e, e = /*value*/ - (u = a[0]) == null ? void 0 : u.url) ? (Uf(), ni(s, 1, 1, Vd), Nf(), s = M_(a), s.c(), ii(s, 1), s.m(t.parentNode, t)) : s.p(a, o); + 1 && b1(e, e = /*value*/ + (u = a[0]) == null ? void 0 : u.url) ? (rm(), li(s, 1, 1, hf), sm(), s = Z_(a), s.c(), oi(s, 1), s.m(t.parentNode, t)) : s.p(a, o); }, i(a) { - i || (ii(s), i = !0); + i || (oi(s), i = !0); }, o(a) { - ni(s), i = !1; + li(s), i = !1; }, d(a) { - a && Ai(t), s.d(a); + a && Pi(t), s.d(a); } }; } -function pB(n) { +function HB(n) { let e, t, i, s; - const r = [vB, _B], a = []; + const r = [qB, VB], a = []; function o(u, l) { return ( /*active_source*/ @@ -41261,40 +41672,40 @@ function pB(n) { } return ~(t = o(n)) && (i = a[t] = r[t](n)), { c() { - e = iu("div"), i && i.c(), this.h(); + e = Eu("div"), i && i.c(), this.h(); }, l(u) { - e = tu(u, "DIV", { class: !0 }); - var l = eu(e); - i && i.l(l), l.forEach(Ai), this.h(); + e = yu(u, "DIV", { class: !0 }); + var l = vu(e); + i && i.l(l), l.forEach(Pi), this.h(); }, h() { - ja(e, "class", "upload-container svelte-1kyjvp4"); + ao(e, "class", "upload-container svelte-1kyjvp4"); }, m(u, l) { - Ss(u, e, l), ~t && a[t].m(e, null), s = !0; + Ps(u, e, l), ~t && a[t].m(e, null), s = !0; }, p(u, l) { let c = t; - t = o(u), t === c ? ~t && a[t].p(u, l) : (i && (Uf(), ni(a[c], 1, 1, () => { + t = o(u), t === c ? ~t && a[t].p(u, l) : (i && (rm(), li(a[c], 1, 1, () => { a[c] = null; - }), Nf()), ~t ? (i = a[t], i ? i.p(u, l) : (i = a[t] = r[t](u), i.c()), ii(i, 1), i.m(e, null)) : i = null); + }), sm()), ~t ? (i = a[t], i ? i.p(u, l) : (i = a[t] = r[t](u), i.c()), oi(i, 1), i.m(e, null)) : i = null); }, i(u) { - s || (ii(i), s = !0); + s || (oi(i), s = !0); }, o(u) { - ni(i), s = !1; + li(i), s = !1; }, d(u) { - u && Ai(e), ~t && a[t].d(); + u && Pi(e), ~t && a[t].d(); } }; } -function M_(n) { +function Z_(n) { var i; let e, t; - return e = new Ff({ + return e = new em({ props: { upload: ( /*upload*/ @@ -41358,13 +41769,13 @@ function M_(n) { } }), { c() { - Wa(e.$$.fragment); + lo(e.$$.fragment); }, l(s) { - za(e.$$.fragment, s); + oo(e.$$.fragment, s); }, m(s, r) { - Xa(e, s, r), t = !0; + co(e, s, r), t = !0; }, p(s, r) { var o; @@ -41397,19 +41808,19 @@ function M_(n) { s[18]), e.$set(a); }, i(s) { - t || (ii(e.$$.fragment, s), t = !0); + t || (oi(e.$$.fragment, s), t = !0); }, o(s) { - ni(e.$$.fragment, s), t = !1; + li(e.$$.fragment, s), t = !1; }, d(s) { - Ya(e, s); + uo(e, s); } }; } -function _B(n) { +function VB(n) { let e, t; - return e = new aB({ + return e = new CB({ props: { root: ( /*root*/ @@ -41456,13 +41867,13 @@ function _B(n) { n[31] ), { c() { - Wa(e.$$.fragment); + lo(e.$$.fragment); }, l(i) { - za(e.$$.fragment, i); + oo(e.$$.fragment, i); }, m(i, s) { - Xa(e, i, s), t = !0; + co(e, i, s), t = !0; }, p(i, s) { const r = {}; @@ -41481,17 +41892,17 @@ function _B(n) { i[14]), e.$set(r); }, i(i) { - t || (ii(e.$$.fragment, i), t = !0); + t || (oi(e.$$.fragment, i), t = !0); }, o(i) { - ni(e.$$.fragment, i), t = !1; + li(e.$$.fragment, i), t = !1; }, d(i) { - Ya(e, i); + uo(e, i); } }; } -function vB(n) { +function qB(n) { let e, t, i, s; function r(u) { n[26](u); @@ -41521,7 +41932,7 @@ function vB(n) { /*i18n*/ n[11]("video.drop_to_upload") ), - $$slots: { default: [yB] }, + $$slots: { default: [KB] }, $$scope: { ctx: n } }; return ( @@ -41529,7 +41940,7 @@ function vB(n) { n[17] !== void 0 && (o.dragging = /*dragging*/ n[17]), /*uploading*/ n[2] !== void 0 && (o.uploading = /*uploading*/ - n[2]), e = new uM({ props: o }), Gd.push(() => Ud(e, "dragging", r)), Gd.push(() => Ud(e, "uploading", a)), e.$on( + n[2]), e = new CM({ props: o }), uf.push(() => lf(e, "dragging", r)), uf.push(() => lf(e, "uploading", a)), e.$on( "load", /*handle_load*/ n[20] @@ -41539,13 +41950,13 @@ function vB(n) { n[28] ), { c() { - Wa(e.$$.fragment); + lo(e.$$.fragment); }, l(u) { - za(e.$$.fragment, u); + oo(e.$$.fragment, u); }, m(u, l) { - Xa(e, u, l), s = !0; + co(e, u, l), s = !0; }, p(u, l) { const c = {}; @@ -41562,28 +41973,28 @@ function vB(n) { u[11]("video.drop_to_upload")), l[1] & /*$$scope*/ 4 && (c.$$scope = { dirty: l, ctx: u }), !t && l[0] & /*dragging*/ 131072 && (t = !0, c.dragging = /*dragging*/ - u[17], Bd(() => t = !1)), !i && l[0] & /*uploading*/ + u[17], af(() => t = !1)), !i && l[0] & /*uploading*/ 4 && (i = !0, c.uploading = /*uploading*/ - u[2], Bd(() => i = !1)), e.$set(c); + u[2], af(() => i = !1)), e.$set(c); }, i(u) { - s || (ii(e.$$.fragment, u), s = !0); + s || (oi(e.$$.fragment, u), s = !0); }, o(u) { - ni(e.$$.fragment, u), s = !1; + li(e.$$.fragment, u), s = !1; }, d(u) { - Ya(e, u); + uo(e, u); } } ); } -function yB(n) { +function KB(n) { let e; const t = ( /*#slots*/ n[25].default - ), i = lB( + ), i = PB( t, n, /*$$scope*/ @@ -41602,19 +42013,19 @@ function yB(n) { }, p(s, r) { i && i.p && (!e || r[1] & /*$$scope*/ - 4) && dB( + 4) && BB( i, t, s, /*$$scope*/ s[33], - e ? cB( + e ? MB( t, /*$$scope*/ s[33], r, null - ) : uB( + ) : OB( /*$$scope*/ s[33] ), @@ -41622,32 +42033,32 @@ function yB(n) { ); }, i(s) { - e || (ii(i, s), e = !0); + e || (oi(i, s), e = !0); }, o(s) { - ni(i, s), e = !1; + li(i, s), e = !1; }, d(s) { i && i.d(s); } }; } -function EB(n) { +function jB(n) { let e, t, i, s, r, a, o, u, l; - e = new Zd({ + e = new Ef({ props: { show_label: ( /*show_label*/ n[7] ), - Icon: au, + Icon: wu, label: ( /*label*/ n[5] || "Video" ) } }); - const c = [pB, gB, mB], h = []; + const c = [HB, GB, UB], h = []; function d(g, p) { var y; return ( @@ -41679,20 +42090,20 @@ function EB(n) { return ( /*active_source*/ n[1] !== void 0 && (m.active_source = /*active_source*/ - n[1]), o = new qA({ props: m }), Gd.push(() => Ud(o, "active_source", f)), { + n[1]), o = new fx({ props: m }), uf.push(() => lf(o, "active_source", f)), { c() { - Wa(e.$$.fragment), t = qd(), i = iu("div"), r && r.c(), a = qd(), Wa(o.$$.fragment), this.h(); + lo(e.$$.fragment), t = df(), i = Eu("div"), r && r.c(), a = df(), lo(o.$$.fragment), this.h(); }, l(g) { - za(e.$$.fragment, g), t = Hd(g), i = tu(g, "DIV", { "data-testid": !0, class: !0 }); - var p = eu(i); - r && r.l(p), a = Hd(p), za(o.$$.fragment, p), p.forEach(Ai), this.h(); + oo(e.$$.fragment, g), t = cf(g), i = yu(g, "DIV", { "data-testid": !0, class: !0 }); + var p = vu(i); + r && r.l(p), a = cf(p), oo(o.$$.fragment, p), p.forEach(Pi), this.h(); }, h() { - ja(i, "data-testid", "video"), ja(i, "class", "video-container svelte-1kyjvp4"); + ao(i, "data-testid", "video"), ao(i, "class", "video-container svelte-1kyjvp4"); }, m(g, p) { - Xa(e, g, p), Ss(g, t, p), Ss(g, i, p), ~s && h[s].m(i, null), Nd(i, a), Xa(o, i, null), l = !0; + co(e, g, p), Ps(g, t, p), Ps(g, i, p), ~s && h[s].m(i, null), of(i, a), co(o, i, null), l = !0; }, p(g, p) { const y = {}; @@ -41702,72 +42113,74 @@ function EB(n) { 32 && (y.label = /*label*/ g[5] || "Video"), e.$set(y); let v = s; - s = d(g), s === v ? ~s && h[s].p(g, p) : (r && (Uf(), ni(h[v], 1, 1, () => { + s = d(g), s === v ? ~s && h[s].p(g, p) : (r && (rm(), li(h[v], 1, 1, () => { h[v] = null; - }), Nf()), ~s ? (r = h[s], r ? r.p(g, p) : (r = h[s] = c[s](g), r.c()), ii(r, 1), r.m(i, a)) : r = null); + }), sm()), ~s ? (r = h[s], r ? r.p(g, p) : (r = h[s] = c[s](g), r.c()), oi(r, 1), r.m(i, a)) : r = null); const _ = {}; p[0] & /*sources*/ 16 && (_.sources = /*sources*/ g[4]), !u && p[0] & /*active_source*/ 2 && (u = !0, _.active_source = /*active_source*/ - g[1], Bd(() => u = !1)), o.$set(_); + g[1], af(() => u = !1)), o.$set(_); }, i(g) { - l || (ii(e.$$.fragment, g), ii(r), ii(o.$$.fragment, g), l = !0); + l || (oi(e.$$.fragment, g), oi(r), oi(o.$$.fragment, g), l = !0); }, o(g) { - ni(e.$$.fragment, g), ni(r), ni(o.$$.fragment, g), l = !1; + li(e.$$.fragment, g), li(r), li(o.$$.fragment, g), l = !1; }, d(g) { - g && (Ai(t), Ai(i)), Ya(e, g), ~s && h[s].d(), Ya(o); + g && (Pi(t), Pi(i)), uo(e, g), ~s && h[s].d(), uo(o); } } ); } -function bB(n, e, t) { - let { $$slots: i = {}, $$scope: s } = e, { value: r = null } = e, { subtitle: a = null } = e, { sources: o = ["webcam", "upload"] } = e, { label: u = void 0 } = e, { show_download_button: l = !1 } = e, { show_label: c = !0 } = e, { webcam_options: h } = e, { include_audio: d } = e, { autoplay: f } = e, { root: m } = e, { i18n: g } = e, { active_source: p = "webcam" } = e, { handle_reset_value: y = () => { - } } = e, { max_file_size: v = null } = e, { upload: _ } = e, { stream_handler: E } = e, { loop: T } = e, { uploading: A = !1 } = e, S = !1, D = !1; - const x = fB(); +function zB(n, e, t) { + let { $$slots: i = {}, $$scope: s } = e, { value: r = null } = e, { subtitle: a = null } = e, { sources: o = ["webcam", "upload"] } = e, { label: u = void 0 } = e, { show_download_button: l = !1 } = e, { show_label: c = !0 } = e, { webcam_options: h } = e, { include_audio: d } = e; + const f = void 0; + let { root: m } = e, { i18n: g } = e, { active_source: p = "webcam" } = e, { handle_reset_value: y = () => { + } } = e, { max_file_size: v = null } = e, { upload: _ } = e, { stream_handler: E } = e, { loop: T } = e, { uploading: x = !1 } = e, S = !1, D = !1; + const A = NB(); function w({ detail: L }) { - t(0, r = L), x("change", L), x("upload", L); + t(0, r = L), A("change", L), A("upload", L); } function I() { - t(0, r = null), x("change", null); + t(0, r = null), A("change", null); } - function R(L) { - t(18, S = !0), x("change", L); + function M(L) { + t(18, S = !0), A("change", L); } - function M({ detail: L }) { - x("change", L); + function k({ detail: L }) { + A("change", L); } - function P(L) { + function q(L) { D = L, t(17, D); } function K(L) { - A = L, t(2, A); + x = L, t(2, x); } - const q = ({ detail: L }) => x("error", L); - function W(L) { - Fh.call(this, n, L); + const H = ({ detail: L }) => A("error", L); + function Y(L) { + ed.call(this, n, L); } - function U(L) { - Fh.call(this, n, L); + function B(L) { + ed.call(this, n, L); } - function j(L) { - Fh.call(this, n, L); + function z(L) { + ed.call(this, n, L); } - function $(L) { + function W(L) { p = L, t(1, p); } return n.$$set = (L) => { - "value" in L && t(0, r = L.value), "subtitle" in L && t(3, a = L.subtitle), "sources" in L && t(4, o = L.sources), "label" in L && t(5, u = L.label), "show_download_button" in L && t(6, l = L.show_download_button), "show_label" in L && t(7, c = L.show_label), "webcam_options" in L && t(8, h = L.webcam_options), "include_audio" in L && t(9, d = L.include_audio), "autoplay" in L && t(24, f = L.autoplay), "root" in L && t(10, m = L.root), "i18n" in L && t(11, g = L.i18n), "active_source" in L && t(1, p = L.active_source), "handle_reset_value" in L && t(12, y = L.handle_reset_value), "max_file_size" in L && t(13, v = L.max_file_size), "upload" in L && t(14, _ = L.upload), "stream_handler" in L && t(15, E = L.stream_handler), "loop" in L && t(16, T = L.loop), "uploading" in L && t(2, A = L.uploading), "$$scope" in L && t(33, s = L.$$scope); + "value" in L && t(0, r = L.value), "subtitle" in L && t(3, a = L.subtitle), "sources" in L && t(4, o = L.sources), "label" in L && t(5, u = L.label), "show_download_button" in L && t(6, l = L.show_download_button), "show_label" in L && t(7, c = L.show_label), "webcam_options" in L && t(8, h = L.webcam_options), "include_audio" in L && t(9, d = L.include_audio), "root" in L && t(10, m = L.root), "i18n" in L && t(11, g = L.i18n), "active_source" in L && t(1, p = L.active_source), "handle_reset_value" in L && t(12, y = L.handle_reset_value), "max_file_size" in L && t(13, v = L.max_file_size), "upload" in L && t(14, _ = L.upload), "stream_handler" in L && t(15, E = L.stream_handler), "loop" in L && t(16, T = L.loop), "uploading" in L && t(2, x = L.uploading), "$$scope" in L && t(33, s = L.$$scope); }, n.$$.update = () => { n.$$.dirty[0] & /*dragging*/ - 131072 && x("drag", D); + 131072 && A("drag", D); }, [ r, p, - A, + x, a, o, u, @@ -41784,31 +42197,31 @@ function bB(n, e, t) { T, D, S, - x, + A, w, I, - R, M, + k, f, i, - P, - K, q, + K, + H, + Y, + B, + z, W, - U, - j, - $, s ]; } -class $_ extends oB { +class J_ extends FB { constructor(e) { - super(), hB( + super(), $B( this, e, - bB, - EB, - r1, + zB, + jB, + b1, { value: 0, subtitle: 3, @@ -41833,86 +42246,89 @@ class $_ extends oB { [-1, -1] ); } + get autoplay() { + return this.$$.ctx[24]; + } } const { - SvelteComponent: TB, - append_hydration: Ph, - attr: cr, - children: Oh, - claim_component: Mh, - claim_element: ka, - claim_space: B_, - create_component: $h, - destroy_component: Bh, - detach: gs, - element: Ra, - get_svelte_dataset: a1, - init: SB, - insert_hydration: nu, - mount_component: Nh, - noop: o1, - safe_not_equal: AB, - space: N_, - transition_in: Uh, - transition_out: Gh -} = window.__gradio__svelte__internal, { createEventDispatcher: xB } = window.__gradio__svelte__internal; -function DB(n) { + SvelteComponent: WB, + append_hydration: td, + attr: Tr, + children: id, + claim_component: nd, + claim_element: Ha, + claim_space: ev, + create_component: sd, + destroy_component: rd, + detach: Es, + element: Va, + get_svelte_dataset: T1, + init: YB, + insert_hydration: bu, + mount_component: ad, + noop: S1, + safe_not_equal: XB, + space: tv, + transition_in: od, + transition_out: ld +} = window.__gradio__svelte__internal, { createEventDispatcher: QB } = window.__gradio__svelte__internal; +function ZB(n) { let e, t = "Upload Video 1"; return { c() { - e = Ra("p"), e.textContent = t, this.h(); + e = Va("p"), e.textContent = t, this.h(); }, l(i) { - e = ka(i, "P", { class: !0, "data-svelte-h": !0 }), a1(e) !== "svelte-u1h0lb" && (e.textContent = t), this.h(); + e = Ha(i, "P", { class: !0, "data-svelte-h": !0 }), T1(e) !== "svelte-u1h0lb" && (e.textContent = t), this.h(); }, h() { - cr(e, "class", "upload-text"); + Tr(e, "class", "upload-text"); }, m(i, s) { - nu(i, e, s); + bu(i, e, s); }, - p: o1, + p: S1, d(i) { - i && gs(e); + i && Es(e); } }; } -function wB(n) { +function JB(n) { let e, t = "Upload Video 2"; return { c() { - e = Ra("p"), e.textContent = t, this.h(); + e = Va("p"), e.textContent = t, this.h(); }, l(i) { - e = ka(i, "P", { class: !0, "data-svelte-h": !0 }), a1(e) !== "svelte-1pqcvhk" && (e.textContent = t), this.h(); + e = Ha(i, "P", { class: !0, "data-svelte-h": !0 }), T1(e) !== "svelte-1pqcvhk" && (e.textContent = t), this.h(); }, h() { - cr(e, "class", "upload-text"); + Tr(e, "class", "upload-text"); }, m(i, s) { - nu(i, e, s); + bu(i, e, s); }, - p: o1, + p: S1, d(i) { - i && gs(e); + i && Es(e); } }; } -function LB(n) { +function eN(n) { let e, t, i, s, r, a, o, u, l; - return e = new Zd({ + return e = new Ef({ props: { show_label: ( /*show_label*/ n[2] ), - Icon: au, + Icon: wu, label: ( /*label*/ n[1] || "Video Slider" ) } - }), r = new $_({ + }), r = new J_({ props: { value: ( /*value*/ @@ -41954,14 +42370,14 @@ function LB(n) { n[9] ), include_audio: !0, - $$slots: { default: [DB] }, + $$slots: { default: [ZB] }, $$scope: { ctx: n } } }), r.$on( "change", /*change_handler*/ n[12] - ), u = new $_({ + ), u = new J_({ props: { value: ( /*value*/ @@ -42003,7 +42419,7 @@ function LB(n) { n[9] ), include_audio: !0, - $$slots: { default: [wB] }, + $$slots: { default: [JB] }, $$scope: { ctx: n } } }), u.$on( @@ -42012,22 +42428,22 @@ function LB(n) { n[13] ), { c() { - $h(e.$$.fragment), t = N_(), i = Ra("div"), s = Ra("div"), $h(r.$$.fragment), a = N_(), o = Ra("div"), $h(u.$$.fragment), this.h(); + sd(e.$$.fragment), t = tv(), i = Va("div"), s = Va("div"), sd(r.$$.fragment), a = tv(), o = Va("div"), sd(u.$$.fragment), this.h(); }, l(c) { - Mh(e.$$.fragment, c), t = B_(c), i = ka(c, "DIV", { class: !0, "data-testid": !0 }); - var h = Oh(i); - s = ka(h, "DIV", { class: !0 }); - var d = Oh(s); - Mh(r.$$.fragment, d), d.forEach(gs), a = B_(h), o = ka(h, "DIV", { class: !0 }); - var f = Oh(o); - Mh(u.$$.fragment, f), f.forEach(gs), h.forEach(gs), this.h(); + nd(e.$$.fragment, c), t = ev(c), i = Ha(c, "DIV", { class: !0, "data-testid": !0 }); + var h = id(i); + s = Ha(h, "DIV", { class: !0 }); + var d = id(s); + nd(r.$$.fragment, d), d.forEach(Es), a = ev(h), o = Ha(h, "DIV", { class: !0 }); + var f = id(o); + nd(u.$$.fragment, f), f.forEach(Es), h.forEach(Es), this.h(); }, h() { - cr(s, "class", "video-slot svelte-9k2sta"), cr(o, "class", "video-slot svelte-9k2sta"), cr(i, "class", "container svelte-9k2sta"), cr(i, "data-testid", "video-slider-input"); + Tr(s, "class", "video-slot svelte-9k2sta"), Tr(o, "class", "video-slot svelte-9k2sta"), Tr(i, "class", "container svelte-9k2sta"), Tr(i, "data-testid", "video-slider-input"); }, m(c, h) { - Nh(e, c, h), nu(c, t, h), nu(c, i, h), Ph(i, s), Nh(r, s, null), Ph(i, a), Ph(i, o), Nh(u, o, null), l = !0; + ad(e, c, h), bu(c, t, h), bu(c, i, h), td(i, s), ad(r, s, null), td(i, a), td(i, o), ad(u, o, null), l = !0; }, p(c, [h]) { const d = {}; @@ -42076,19 +42492,19 @@ function LB(n) { 32768 && (m.$$scope = { dirty: h, ctx: c }), u.$set(m); }, i(c) { - l || (Uh(e.$$.fragment, c), Uh(r.$$.fragment, c), Uh(u.$$.fragment, c), l = !0); + l || (od(e.$$.fragment, c), od(r.$$.fragment, c), od(u.$$.fragment, c), l = !0); }, o(c) { - Gh(e.$$.fragment, c), Gh(r.$$.fragment, c), Gh(u.$$.fragment, c), l = !1; + ld(e.$$.fragment, c), ld(r.$$.fragment, c), ld(u.$$.fragment, c), l = !1; }, d(c) { - c && (gs(t), gs(i)), Bh(e, c), Bh(r), Bh(u); + c && (Es(t), Es(i)), rd(e, c), rd(r), rd(u); } }; } -function IB(n, e, t) { +function tN(n, e, t) { let { value: i = [null, null] } = e, { label: s = void 0 } = e, { show_label: r } = e, { root: a } = e, { i18n: o } = e, { max_file_size: u = null } = e, { upload: l } = e, { stream_handler: c } = e, { autoplay: h } = e, { loop: d } = e; - const f = xB(), m = { mirror: !0, constraints: {} }; + const f = QB(), m = { mirror: !0, constraints: {} }; function g(v, _) { const E = [...i]; E[_] = v, t(0, i = E), i[0] === null && i[1] === null ? f("clear") : f("upload", E); @@ -42113,9 +42529,9 @@ function IB(n, e, t) { y ]; } -class kB extends TB { +class iN extends WB { constructor(e) { - super(), SB(this, e, IB, LB, AB, { + super(), YB(this, e, tN, eN, XB, { value: 0, label: 1, show_label: 2, @@ -42130,33 +42546,33 @@ class kB extends TB { } } const { - SvelteComponent: RB, - add_flush_callback: Gf, - assign: l1, - bind: Hf, - binding_callbacks: Vf, - check_outros: CB, - claim_component: Mr, - claim_space: u1, - create_component: $r, - destroy_component: Br, - detach: qf, - empty: U_, - flush: ze, - get_spread_object: c1, - get_spread_update: h1, - group_outros: FB, - init: PB, - insert_hydration: Kf, - mount_component: Nr, - safe_not_equal: OB, - space: d1, - transition_in: Jn, - transition_out: es -} = window.__gradio__svelte__internal; -function MB(n) { + SvelteComponent: nN, + add_flush_callback: Tu, + assign: A1, + bind: Su, + binding_callbacks: Au, + check_outros: sN, + claim_component: Vr, + claim_space: x1, + create_component: qr, + destroy_component: Kr, + detach: am, + empty: iv, + flush: qe, + get_spread_object: D1, + get_spread_update: w1, + group_outros: rN, + init: aN, + insert_hydration: om, + mount_component: jr, + safe_not_equal: oN, + space: L1, + transition_in: rs, + transition_out: as +} = window.__gradio__svelte__internal, { tick: lN } = window.__gradio__svelte__internal; +function uN(n) { let e, t; - return e = new z_({ + return e = new uv({ props: { visible: ( /*visible*/ @@ -42194,18 +42610,18 @@ function MB(n) { n[11] ), allow_overflow: !1, - $$slots: { default: [BB] }, + $$slots: { default: [hN] }, $$scope: { ctx: n } } }), { c() { - $r(e.$$.fragment); + qr(e.$$.fragment); }, l(i) { - Mr(e.$$.fragment, i); + Vr(e.$$.fragment, i); }, m(i, s) { - Nr(e, i, s), t = !0; + jr(e, i, s), t = !0; }, p(i, s) { const r = {}; @@ -42226,24 +42642,24 @@ function MB(n) { i[10]), s[0] & /*min_width*/ 2048 && (r.min_width = /*min_width*/ i[11]), s[0] & /*root, label, show_label, gradio, autoplay, loop, value, loading_status*/ - 462961 | s[1] & /*$$scope*/ - 4 && (r.$$scope = { dirty: s, ctx: i }), e.$set(r); + 1839217 | s[1] & /*$$scope*/ + 64 && (r.$$scope = { dirty: s, ctx: i }), e.$set(r); }, i(i) { - t || (Jn(e.$$.fragment, i), t = !0); + t || (rs(e.$$.fragment, i), t = !0); }, o(i) { - es(e.$$.fragment, i), t = !1; + as(e.$$.fragment, i), t = !1; }, d(i) { - Br(e, i); + Kr(e, i); } }; } -function $B(n) { +function cN(n) { let e, t, i; function s(a) { - n[27](a); + n[31](a); } let r = { visible: ( @@ -42251,6 +42667,7 @@ function $B(n) { n[3] ), variant: "solid", + border_mode: "base", padding: !1, elem_id: ( /*elem_id*/ @@ -42281,21 +42698,21 @@ function $B(n) { n[11] ), allow_overflow: !1, - $$slots: { default: [NB] }, + $$slots: { default: [dN] }, $$scope: { ctx: n } }; return ( /*fullscreen*/ - n[19] !== void 0 && (r.fullscreen = /*fullscreen*/ - n[19]), e = new z_({ props: r }), Vf.push(() => Hf(e, "fullscreen", s)), { + n[21] !== void 0 && (r.fullscreen = /*fullscreen*/ + n[21]), e = new uv({ props: r }), Au.push(() => Su(e, "fullscreen", s)), { c() { - $r(e.$$.fragment); + qr(e.$$.fragment); }, l(a) { - Mr(e.$$.fragment, a); + Vr(e.$$.fragment, a); }, m(a, o) { - Nr(e, a, o), i = !0; + jr(e, a, o), i = !0; }, p(a, o) { const u = {}; @@ -42315,47 +42732,47 @@ function $B(n) { 1024 && (u.scale = /*scale*/ a[10]), o[0] & /*min_width*/ 2048 && (u.min_width = /*min_width*/ - a[11]), o[0] & /*interactive, label, show_label, show_download_button, show_fullscreen_button, gradio, normalised_slider_position, autoplay, loop, value, fullscreen, loading_status*/ - 2093105 | o[1] & /*$$scope*/ - 4 && (u.$$scope = { dirty: o, ctx: a }), !t && o[0] & /*fullscreen*/ - 524288 && (t = !0, u.fullscreen = /*fullscreen*/ - a[19], Gf(() => t = !1)), e.$set(u); + a[11]), o[0] & /*interactive, fullscreen, label, show_label, show_download_button, show_fullscreen_button, show_mute_button, gradio, autoplay, loop, value, normalised_slider_position, loading_status*/ + 8253489 | o[1] & /*$$scope*/ + 64 && (u.$$scope = { dirty: o, ctx: a }), !t && o[0] & /*fullscreen*/ + 2097152 && (t = !0, u.fullscreen = /*fullscreen*/ + a[21], Tu(() => t = !1)), e.$set(u); }, i(a) { - i || (Jn(e.$$.fragment, a), i = !0); + i || (rs(e.$$.fragment, a), i = !0); }, o(a) { - es(e.$$.fragment, a), i = !1; + as(e.$$.fragment, a), i = !1; }, d(a) { - Br(e, a); + Kr(e, a); } } ); } -function BB(n) { +function hN(n) { var c; let e, t, i, s, r; const a = [ { autoscroll: ( /*gradio*/ - n[18].autoscroll + n[20].autoscroll ) }, { i18n: ( /*gradio*/ - n[18].i18n + n[20].i18n ) }, /*loading_status*/ n[12] ]; let o = {}; for (let h = 0; h < a.length; h += 1) - o = l1(o, a[h]); - e = new Iv({ props: o }); + o = A1(o, a[h]); + e = new Kv({ props: o }); function u(h) { - n[29](h); + n[33](h); } let l = { root: ( @@ -42372,72 +42789,72 @@ function BB(n) { ), max_file_size: ( /*gradio*/ - n[18].max_file_size + n[20].max_file_size ), i18n: ( /*gradio*/ - n[18].i18n + n[20].i18n ), upload: ( /*func_1*/ - n[28] + n[32] ), stream_handler: ( /*gradio*/ - (c = n[18].client) == null ? void 0 : c.stream + (c = n[20].client) == null ? void 0 : c.stream ), autoplay: ( /*autoplay*/ - n[16] + n[18] ), loop: ( /*loop*/ - n[17] + n[19] ) }; return ( /*value*/ n[0] !== void 0 && (l.value = /*value*/ - n[0]), i = new kB({ props: l }), Vf.push(() => Hf(i, "value", u)), i.$on( + n[0]), i = new iN({ props: l }), Au.push(() => Su(i, "value", u)), i.$on( "upload", /*upload_handler*/ - n[30] + n[34] ), i.$on( "clear", /*clear_handler_1*/ - n[31] + n[35] ), i.$on( "error", /*error_handler*/ - n[32] + n[36] ), { c() { - $r(e.$$.fragment), t = d1(), $r(i.$$.fragment); + qr(e.$$.fragment), t = L1(), qr(i.$$.fragment); }, l(h) { - Mr(e.$$.fragment, h), t = u1(h), Mr(i.$$.fragment, h); + Vr(e.$$.fragment, h), t = x1(h), Vr(i.$$.fragment, h); }, m(h, d) { - Nr(e, h, d), Kf(h, t, d), Nr(i, h, d), r = !0; + jr(e, h, d), om(h, t, d), jr(i, h, d), r = !0; }, p(h, d) { var g; const f = d[0] & /*gradio, loading_status*/ - 266240 ? h1(a, [ + 1052672 ? w1(a, [ d[0] & /*gradio*/ - 262144 && { + 1048576 && { autoscroll: ( /*gradio*/ - h[18].autoscroll + h[20].autoscroll ) }, d[0] & /*gradio*/ - 262144 && { i18n: ( + 1048576 && { i18n: ( /*gradio*/ - h[18].i18n + h[20].i18n ) }, d[0] & /*loading_status*/ - 4096 && c1( + 4096 && D1( /*loading_status*/ h[12] ) @@ -42451,61 +42868,68 @@ function BB(n) { h[4]), d[0] & /*show_label*/ 32 && (m.show_label = /*show_label*/ h[5]), d[0] & /*gradio*/ - 262144 && (m.max_file_size = /*gradio*/ - h[18].max_file_size), d[0] & /*gradio*/ - 262144 && (m.i18n = /*gradio*/ - h[18].i18n), d[0] & /*gradio*/ - 262144 && (m.upload = /*func_1*/ - h[28]), d[0] & /*gradio*/ - 262144 && (m.stream_handler = /*gradio*/ - (g = h[18].client) == null ? void 0 : g.stream), d[0] & /*autoplay*/ - 65536 && (m.autoplay = /*autoplay*/ - h[16]), d[0] & /*loop*/ - 131072 && (m.loop = /*loop*/ - h[17]), !s && d[0] & /*value*/ + 1048576 && (m.max_file_size = /*gradio*/ + h[20].max_file_size), d[0] & /*gradio*/ + 1048576 && (m.i18n = /*gradio*/ + h[20].i18n), d[0] & /*gradio*/ + 1048576 && (m.upload = /*func_1*/ + h[32]), d[0] & /*gradio*/ + 1048576 && (m.stream_handler = /*gradio*/ + (g = h[20].client) == null ? void 0 : g.stream), d[0] & /*autoplay*/ + 262144 && (m.autoplay = /*autoplay*/ + h[18]), d[0] & /*loop*/ + 524288 && (m.loop = /*loop*/ + h[19]), !s && d[0] & /*value*/ 1 && (s = !0, m.value = /*value*/ - h[0], Gf(() => s = !1)), i.$set(m); + h[0], Tu(() => s = !1)), i.$set(m); }, i(h) { - r || (Jn(e.$$.fragment, h), Jn(i.$$.fragment, h), r = !0); + r || (rs(e.$$.fragment, h), rs(i.$$.fragment, h), r = !0); }, o(h) { - es(e.$$.fragment, h), es(i.$$.fragment, h), r = !1; + as(e.$$.fragment, h), as(i.$$.fragment, h), r = !1; }, d(h) { - h && qf(t), Br(e, h), Br(i, h); + h && am(t), Kr(e, h), Kr(i, h); } } ); } -function NB(n) { - let e, t, i, s, r; - const a = [ +function dN(n) { + let e, t, i, s, r, a; + const o = [ { autoscroll: ( /*gradio*/ - n[18].autoscroll + n[20].autoscroll ) }, { i18n: ( /*gradio*/ - n[18].i18n + n[20].i18n ) }, /*loading_status*/ n[12] ]; - let o = {}; - for (let c = 0; c < a.length; c += 1) - o = l1(o, a[c]); - e = new Iv({ props: o }); - function u(c) { - n[24](c); + let u = {}; + for (let d = 0; d < o.length; d += 1) + u = A1(u, o[d]); + e = new Kv({ props: u }); + function l(d) { + n[27](d); } - let l = { + function c(d) { + n[28](d); + } + let h = { interactive: ( /*interactive*/ n[13] ), + fullscreen: ( + /*fullscreen*/ + n[21] + ), label: ( /*label*/ n[4] @@ -42522,167 +42946,177 @@ function NB(n) { /*show_fullscreen_button*/ n[15] ), + show_mute_button: ( + /*show_mute_button*/ + n[16] + ), i18n: ( /*gradio*/ - n[18].i18n - ), - position: ( - /*normalised_slider_position*/ - n[20] + n[20].i18n ), slider_color: "var(--border-color-primary)", autoplay: ( /*autoplay*/ - n[16] + n[18] ), loop: ( /*loop*/ - n[17] + n[19] ), upload: ( /*func*/ - n[23] + n[26] ) }; return ( /*value*/ - n[0] !== void 0 && (l.value = /*value*/ - n[0]), i = new h$({ props: l }), Vf.push(() => Hf(i, "value", u)), i.$on( + n[0] !== void 0 && (h.value = /*value*/ + n[0]), /*normalised_slider_position*/ + n[22] !== void 0 && (h.position = /*normalised_slider_position*/ + n[22]), i = new $$({ props: h }), Au.push(() => Su(i, "value", l)), Au.push(() => Su(i, "position", c)), i.$on( "clear", /*clear_handler*/ - n[25] + n[29] ), i.$on( "fullscreen", /*fullscreen_handler*/ - n[26] + n[30] ), { c() { - $r(e.$$.fragment), t = d1(), $r(i.$$.fragment); + qr(e.$$.fragment), t = L1(), qr(i.$$.fragment); }, - l(c) { - Mr(e.$$.fragment, c), t = u1(c), Mr(i.$$.fragment, c); + l(d) { + Vr(e.$$.fragment, d), t = x1(d), Vr(i.$$.fragment, d); }, - m(c, h) { - Nr(e, c, h), Kf(c, t, h), Nr(i, c, h), r = !0; + m(d, f) { + jr(e, d, f), om(d, t, f), jr(i, d, f), a = !0; }, - p(c, h) { - const d = h[0] & /*gradio, loading_status*/ - 266240 ? h1(a, [ - h[0] & /*gradio*/ - 262144 && { + p(d, f) { + const m = f[0] & /*gradio, loading_status*/ + 1052672 ? w1(o, [ + f[0] & /*gradio*/ + 1048576 && { autoscroll: ( /*gradio*/ - c[18].autoscroll + d[20].autoscroll ) }, - h[0] & /*gradio*/ - 262144 && { i18n: ( + f[0] & /*gradio*/ + 1048576 && { i18n: ( /*gradio*/ - c[18].i18n + d[20].i18n ) }, - h[0] & /*loading_status*/ - 4096 && c1( + f[0] & /*loading_status*/ + 4096 && D1( /*loading_status*/ - c[12] + d[12] ) ]) : {}; - e.$set(d); - const f = {}; - h[0] & /*interactive*/ - 8192 && (f.interactive = /*interactive*/ - c[13]), h[0] & /*label*/ - 16 && (f.label = /*label*/ - c[4]), h[0] & /*show_label*/ - 32 && (f.show_label = /*show_label*/ - c[5]), h[0] & /*show_download_button*/ - 16384 && (f.show_download_button = /*show_download_button*/ - c[14]), h[0] & /*show_fullscreen_button*/ - 32768 && (f.show_fullscreen_button = /*show_fullscreen_button*/ - c[15]), h[0] & /*gradio*/ - 262144 && (f.i18n = /*gradio*/ - c[18].i18n), h[0] & /*normalised_slider_position*/ - 1048576 && (f.position = /*normalised_slider_position*/ - c[20]), h[0] & /*autoplay*/ - 65536 && (f.autoplay = /*autoplay*/ - c[16]), h[0] & /*loop*/ - 131072 && (f.loop = /*loop*/ - c[17]), h[0] & /*gradio*/ - 262144 && (f.upload = /*func*/ - c[23]), !s && h[0] & /*value*/ - 1 && (s = !0, f.value = /*value*/ - c[0], Gf(() => s = !1)), i.$set(f); + e.$set(m); + const g = {}; + f[0] & /*interactive*/ + 8192 && (g.interactive = /*interactive*/ + d[13]), f[0] & /*fullscreen*/ + 2097152 && (g.fullscreen = /*fullscreen*/ + d[21]), f[0] & /*label*/ + 16 && (g.label = /*label*/ + d[4]), f[0] & /*show_label*/ + 32 && (g.show_label = /*show_label*/ + d[5]), f[0] & /*show_download_button*/ + 16384 && (g.show_download_button = /*show_download_button*/ + d[14]), f[0] & /*show_fullscreen_button*/ + 32768 && (g.show_fullscreen_button = /*show_fullscreen_button*/ + d[15]), f[0] & /*show_mute_button*/ + 65536 && (g.show_mute_button = /*show_mute_button*/ + d[16]), f[0] & /*gradio*/ + 1048576 && (g.i18n = /*gradio*/ + d[20].i18n), f[0] & /*autoplay*/ + 262144 && (g.autoplay = /*autoplay*/ + d[18]), f[0] & /*loop*/ + 524288 && (g.loop = /*loop*/ + d[19]), f[0] & /*gradio*/ + 1048576 && (g.upload = /*func*/ + d[26]), !s && f[0] & /*value*/ + 1 && (s = !0, g.value = /*value*/ + d[0], Tu(() => s = !1)), !r && f[0] & /*normalised_slider_position*/ + 4194304 && (r = !0, g.position = /*normalised_slider_position*/ + d[22], Tu(() => r = !1)), i.$set(g); }, - i(c) { - r || (Jn(e.$$.fragment, c), Jn(i.$$.fragment, c), r = !0); + i(d) { + a || (rs(e.$$.fragment, d), rs(i.$$.fragment, d), a = !0); }, - o(c) { - es(e.$$.fragment, c), es(i.$$.fragment, c), r = !1; + o(d) { + as(e.$$.fragment, d), as(i.$$.fragment, d), a = !1; }, - d(c) { - c && qf(t), Br(e, c), Br(i, c); + d(d) { + d && am(t), Kr(e, d), Kr(i, d); } } ); } -function UB(n) { +function fN(n) { let e, t, i, s; - const r = [$B, MB], a = []; + const r = [cN, uN], a = []; function o(u, l) { return ( - /*interactive*/ - u[13] ? 1 : 0 + /*video_mode*/ + u[17] == "preview" ? 0 : 1 ); } return e = o(n), t = a[e] = r[e](n), { c() { - t.c(), i = U_(); + t.c(), i = iv(); }, l(u) { - t.l(u), i = U_(); + t.l(u), i = iv(); }, m(u, l) { - a[e].m(u, l), Kf(u, i, l), s = !0; + a[e].m(u, l), om(u, i, l), s = !0; }, p(u, l) { let c = e; - e = o(u), e === c ? a[e].p(u, l) : (FB(), es(a[c], 1, 1, () => { + e = o(u), e === c ? a[e].p(u, l) : (rN(), as(a[c], 1, 1, () => { a[c] = null; - }), CB(), t = a[e], t ? t.p(u, l) : (t = a[e] = r[e](u), t.c()), Jn(t, 1), t.m(i.parentNode, i)); + }), sN(), t = a[e], t ? t.p(u, l) : (t = a[e] = r[e](u), t.c()), rs(t, 1), t.m(i.parentNode, i)); }, i(u) { - s || (Jn(t), s = !0); + s || (rs(t), s = !0); }, o(u) { - es(t), s = !1; + as(t), s = !1; }, d(u) { - u && qf(i), a[e].d(u); + u && am(i), a[e].d(u); } }; } -function GB(n, e, t) { - let i, { elem_id: s = "" } = e, { elem_classes: r = [] } = e, { visible: a = !0 } = e, { value: o = [null, null] } = e, { label: u } = e, { show_label: l } = e, { root: c } = e, { height: h } = e, { width: d } = e, { container: f = !0 } = e, { scale: m = null } = e, { min_width: g = void 0 } = e, { loading_status: p } = e, { interactive: y } = e, { show_download_button: v } = e, { show_fullscreen_button: _ } = e, { position: E } = e, { autoplay: T } = e, { loop: A } = e, { gradio: S } = e, D = !1, x = [null, null]; - const w = (...$) => S.client.upload(...$); - function I($) { - o = $, t(0, o); +function mN(n, e, t) { + let i, { elem_id: s = "" } = e, { elem_classes: r = [] } = e, { visible: a = !0 } = e, { value: o = [null, null] } = e, { label: u } = e, { show_label: l } = e, { root: c } = e, { height: h } = e, { width: d } = e, { container: f = !0 } = e, { scale: m = null } = e, { min_width: g = void 0 } = e, { loading_status: p } = e, { interactive: y } = e, { show_download_button: v } = e, { show_fullscreen_button: _ } = e, { show_mute_button: E } = e, { video_mode: T = "preview" } = e, { position: x } = e, { autoplay: S } = e, { loop: D } = e, { gradio: A } = e, w = !1, I = [null, null]; + function M(C) { + t(21, w = C), t(24, x = 50), lN().then(() => A.dispatch("change")); } - const R = () => S.dispatch("clear"), M = ({ detail: $ }) => { - t(19, D = $); - }; - function P($) { - D = $, t(19, D); + const k = (...C) => A.client.upload(...C); + function q(C) { + o = C, t(0, o); } - const K = (...$) => S.client.upload(...$); - function q($) { - o = $, t(0, o); + function K(C) { + i = C, t(22, i), t(24, x); } - const W = () => S.dispatch("upload"), U = () => S.dispatch("clear"), j = ({ detail: $ }) => S.dispatch("error", $); - return n.$$set = ($) => { - "elem_id" in $ && t(1, s = $.elem_id), "elem_classes" in $ && t(2, r = $.elem_classes), "visible" in $ && t(3, a = $.visible), "value" in $ && t(0, o = $.value), "label" in $ && t(4, u = $.label), "show_label" in $ && t(5, l = $.show_label), "root" in $ && t(6, c = $.root), "height" in $ && t(7, h = $.height), "width" in $ && t(8, d = $.width), "container" in $ && t(9, f = $.container), "scale" in $ && t(10, m = $.scale), "min_width" in $ && t(11, g = $.min_width), "loading_status" in $ && t(12, p = $.loading_status), "interactive" in $ && t(13, y = $.interactive), "show_download_button" in $ && t(14, v = $.show_download_button), "show_fullscreen_button" in $ && t(15, _ = $.show_fullscreen_button), "position" in $ && t(21, E = $.position), "autoplay" in $ && t(16, T = $.autoplay), "loop" in $ && t(17, A = $.loop), "gradio" in $ && t(18, S = $.gradio); + const H = () => A.dispatch("clear"), Y = ({ detail: C }) => M(C); + function B(C) { + w = C, t(21, w); + } + const z = (...C) => A.client.upload(...C); + function W(C) { + o = C, t(0, o); + } + const L = () => A.dispatch("upload"), $ = () => A.dispatch("clear"), Q = ({ detail: C }) => A.dispatch("error", C); + return n.$$set = (C) => { + "elem_id" in C && t(1, s = C.elem_id), "elem_classes" in C && t(2, r = C.elem_classes), "visible" in C && t(3, a = C.visible), "value" in C && t(0, o = C.value), "label" in C && t(4, u = C.label), "show_label" in C && t(5, l = C.show_label), "root" in C && t(6, c = C.root), "height" in C && t(7, h = C.height), "width" in C && t(8, d = C.width), "container" in C && t(9, f = C.container), "scale" in C && t(10, m = C.scale), "min_width" in C && t(11, g = C.min_width), "loading_status" in C && t(12, p = C.loading_status), "interactive" in C && t(13, y = C.interactive), "show_download_button" in C && t(14, v = C.show_download_button), "show_fullscreen_button" in C && t(15, _ = C.show_fullscreen_button), "show_mute_button" in C && t(16, E = C.show_mute_button), "video_mode" in C && t(17, T = C.video_mode), "position" in C && t(24, x = C.position), "autoplay" in C && t(18, S = C.autoplay), "loop" in C && t(19, D = C.loop), "gradio" in C && t(20, A = C.gradio); }, n.$$.update = () => { n.$$.dirty[0] & /*position*/ - 2097152 && t(20, i = Math.max(0, Math.min(100, E)) / 100), n.$$.dirty[0] & /*value, old_value, gradio*/ - 4456449 && JSON.stringify(o) !== JSON.stringify(x) && (t(22, x = o), S.dispatch("change")); + 16777216 && t(22, i = Math.max(0, Math.min(100, x)) / 100), n.$$.dirty[0] & /*value, old_value, gradio*/ + 34603009 && JSON.stringify(o) !== JSON.stringify(I) && (t(25, I = o), A.dispatch("change")); }, [ o, s, @@ -42700,33 +43134,37 @@ function GB(n, e, t) { y, v, _, + E, T, - A, S, D, + A, + w, i, - E, + M, x, - w, I, - R, - M, - P, - K, + k, q, + K, + H, + Y, + B, + z, W, - U, - j + L, + $, + Q ]; } -class GW extends RB { +class tY extends nN { constructor(e) { - super(), PB( + super(), aN( this, e, - GB, - UB, - OB, + mN, + fN, + oN, { elem_id: 1, elem_classes: 2, @@ -42744,10 +43182,12 @@ class GW extends RB { interactive: 13, show_download_button: 14, show_fullscreen_button: 15, - position: 21, - autoplay: 16, - loop: 17, - gradio: 18 + show_mute_button: 16, + video_mode: 17, + position: 24, + autoplay: 18, + loop: 19, + gradio: 20 }, null, [-1, -1] @@ -42757,123 +43197,135 @@ class GW extends RB { return this.$$.ctx[1]; } set elem_id(e) { - this.$$set({ elem_id: e }), ze(); + this.$$set({ elem_id: e }), qe(); } get elem_classes() { return this.$$.ctx[2]; } set elem_classes(e) { - this.$$set({ elem_classes: e }), ze(); + this.$$set({ elem_classes: e }), qe(); } get visible() { return this.$$.ctx[3]; } set visible(e) { - this.$$set({ visible: e }), ze(); + this.$$set({ visible: e }), qe(); } get value() { return this.$$.ctx[0]; } set value(e) { - this.$$set({ value: e }), ze(); + this.$$set({ value: e }), qe(); } get label() { return this.$$.ctx[4]; } set label(e) { - this.$$set({ label: e }), ze(); + this.$$set({ label: e }), qe(); } get show_label() { return this.$$.ctx[5]; } set show_label(e) { - this.$$set({ show_label: e }), ze(); + this.$$set({ show_label: e }), qe(); } get root() { return this.$$.ctx[6]; } set root(e) { - this.$$set({ root: e }), ze(); + this.$$set({ root: e }), qe(); } get height() { return this.$$.ctx[7]; } set height(e) { - this.$$set({ height: e }), ze(); + this.$$set({ height: e }), qe(); } get width() { return this.$$.ctx[8]; } set width(e) { - this.$$set({ width: e }), ze(); + this.$$set({ width: e }), qe(); } get container() { return this.$$.ctx[9]; } set container(e) { - this.$$set({ container: e }), ze(); + this.$$set({ container: e }), qe(); } get scale() { return this.$$.ctx[10]; } set scale(e) { - this.$$set({ scale: e }), ze(); + this.$$set({ scale: e }), qe(); } get min_width() { return this.$$.ctx[11]; } set min_width(e) { - this.$$set({ min_width: e }), ze(); + this.$$set({ min_width: e }), qe(); } get loading_status() { return this.$$.ctx[12]; } set loading_status(e) { - this.$$set({ loading_status: e }), ze(); + this.$$set({ loading_status: e }), qe(); } get interactive() { return this.$$.ctx[13]; } set interactive(e) { - this.$$set({ interactive: e }), ze(); + this.$$set({ interactive: e }), qe(); } get show_download_button() { return this.$$.ctx[14]; } set show_download_button(e) { - this.$$set({ show_download_button: e }), ze(); + this.$$set({ show_download_button: e }), qe(); } get show_fullscreen_button() { return this.$$.ctx[15]; } set show_fullscreen_button(e) { - this.$$set({ show_fullscreen_button: e }), ze(); + this.$$set({ show_fullscreen_button: e }), qe(); + } + get show_mute_button() { + return this.$$.ctx[16]; + } + set show_mute_button(e) { + this.$$set({ show_mute_button: e }), qe(); + } + get video_mode() { + return this.$$.ctx[17]; + } + set video_mode(e) { + this.$$set({ video_mode: e }), qe(); } get position() { - return this.$$.ctx[21]; + return this.$$.ctx[24]; } set position(e) { - this.$$set({ position: e }), ze(); + this.$$set({ position: e }), qe(); } get autoplay() { - return this.$$.ctx[16]; + return this.$$.ctx[18]; } set autoplay(e) { - this.$$set({ autoplay: e }), ze(); + this.$$set({ autoplay: e }), qe(); } get loop() { - return this.$$.ctx[17]; + return this.$$.ctx[19]; } set loop(e) { - this.$$set({ loop: e }), ze(); + this.$$set({ loop: e }), qe(); } get gradio() { - return this.$$.ctx[18]; + return this.$$.ctx[20]; } set gradio(e) { - this.$$set({ gradio: e }), ze(); + this.$$set({ gradio: e }), qe(); } } export { - GW as default + tY as default };