@divkitframework/divkit
Version:
DivKit for the web
1,280 lines • 372 kB
JavaScript
var Hl = Object.defineProperty;
var Wl = (r, t, e) => t in r ? Hl(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
var kr = (r, t, e) => Wl(r, typeof t != "symbol" ? t + "" : t, e);
/*!
DivKit v31.12.0
https://github.com/divkit/divkit
@licence Apache-2.0
*/
function A() {
}
const Ul = (r) => r;
function Gl(r) {
return r();
}
function ql() {
return /* @__PURE__ */ Object.create(null);
}
function vs(r) {
r.forEach(Gl);
}
function Jl(r) {
return typeof r == "function";
}
function Yl(r, t) {
return r != r ? t == t : r !== t || r && typeof r == "object" || typeof r == "function";
}
function m(r, ...t) {
if (r == null) {
for (const i of t)
i(void 0);
return A;
}
const e = r.subscribe(...t);
return e.unsubscribe ? () => e.unsubscribe() : e;
}
function Kl(r) {
let t;
return m(r, (e) => t = e)(), t;
}
function Xl(r, t, { bubbles: e = !1, cancelable: i = !1 } = {}) {
return new CustomEvent(r, { detail: t, bubbles: e, cancelable: i });
}
let In;
function Vn(r) {
In = r;
}
function ko() {
if (!In) throw new Error("Function called outside component initialization");
return In;
}
function Nr(r) {
ko().$$.on_destroy.push(r);
}
function Zl() {
const r = ko();
return (t, e, { cancelable: i = !1 } = {}) => {
const n = r.$$.callbacks[t];
if (n) {
const s = Xl(
/** @type {string} */
t,
e,
{ cancelable: i }
);
return n.slice().forEach((l) => {
l.call(r, s);
}), !s.defaultPrevented;
}
return !0;
};
}
function Ji(r, t) {
return ko().$$.context.set(r, t), t;
}
function vr(r) {
return ko().$$.context.get(r);
}
const kn = [], Gs = [];
let Qn = [];
const qs = [], Za = /* @__PURE__ */ Promise.resolve();
let Ko = !1;
function Ql() {
Ko || (Ko = !0, Za.then(tc));
}
function ki() {
return Ql(), Za;
}
function ec(r) {
Qn.push(r);
}
const zo = /* @__PURE__ */ new Set();
let nn = 0;
function tc() {
if (nn !== 0)
return;
const r = In;
do {
try {
for (; nn < kn.length; ) {
const t = kn[nn];
nn++, Vn(t), rc(t.$$);
}
} catch (t) {
throw kn.length = 0, nn = 0, t;
}
for (Vn(null), kn.length = 0, nn = 0; Gs.length; ) Gs.pop()();
for (let t = 0; t < Qn.length; t += 1) {
const e = Qn[t];
zo.has(e) || (zo.add(e), e());
}
Qn.length = 0;
} while (kn.length);
for (; qs.length; )
qs.pop()();
Ko = !1, zo.clear(), Vn(r);
}
function rc(r) {
if (r.fragment !== null) {
r.update(), vs(r.before_update);
const t = r.dirty;
r.dirty = [-1], r.fragment && r.fragment.p(r.ctx, t), r.after_update.forEach(ec);
}
}
function ic(r) {
return (r == null ? void 0 : r.length) !== void 0 ? r : Array.from(r);
}
const nc = (
/** @type {const} */
[
"allowfullscreen",
"allowpaymentrequest",
"async",
"autofocus",
"autoplay",
"checked",
"controls",
"default",
"defer",
"disabled",
"formnovalidate",
"hidden",
"inert",
"ismap",
"loop",
"multiple",
"muted",
"nomodule",
"novalidate",
"open",
"playsinline",
"readonly",
"required",
"reversed",
"selected"
]
), oc = /* @__PURE__ */ new Set([...nc]), sc = /[&"<]/g, ac = /[&<]/g;
function et(r, t = !1) {
const e = String(r), i = t ? sc : ac;
i.lastIndex = 0;
let n = "", s = 0;
for (; i.test(e); ) {
const l = i.lastIndex - 1, c = e[l];
n += e.substring(s, l) + (c === "&" ? "&" : c === '"' ? """ : "<"), s = l + 1;
}
return n + e.substring(s);
}
const lc = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;
function Js(r) {
return lc.test(r) || r.toLowerCase() === "!doctype";
}
const cc = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
function fn(r, t) {
const e = Object.assign({}, ...r);
if (t) {
const n = t.classes, s = t.styles;
n && (e.class == null ? e.class = n : e.class += " " + n), s && (e.style == null ? e.style = Xo(s) : e.style = Xo(
uc(e.style, s)
));
}
let i = "";
return Object.keys(e).forEach((n) => {
if (cc.test(n)) return;
const s = e[n];
s === !0 ? i += " " + n : oc.has(n.toLowerCase()) ? s && (i += " " + n) : s != null && (i += ` ${n}="${s}"`);
}), i;
}
function uc(r, t) {
const e = {};
for (const i of r.split(";")) {
const n = i.indexOf(":"), s = i.slice(0, n).trim(), l = i.slice(n + 1).trim();
s && (e[s] = l);
}
for (const i in t) {
const n = t[i];
n ? e[i] = n : delete e[i];
}
return e;
}
function Hr(r) {
return typeof r == "string" || r && typeof r == "object" ? et(r, !0) : r;
}
function gn(r) {
const t = {};
for (const e in r)
t[e] = Hr(r[e]);
return t;
}
function Cr(r, t) {
r = ic(r);
let e = "";
for (let i = 0; i < r.length; i += 1)
e += t(r[i], i);
return e;
}
const dc = {
$$render: () => ""
};
function Lt(r, t) {
if (!r || !r.$$render)
throw t === "svelte:component" && (t += " this={...}"), new Error(
`<${t}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${t}>.`
);
return r;
}
let No;
function yr(r) {
function t(e, i, n, s, l) {
const c = In, g = {
on_destroy: No,
context: new Map(l || (c ? c.$$.context : [])),
// these will be immediately discarded
on_mount: [],
before_update: [],
after_update: [],
callbacks: ql()
};
Vn({ $$: g });
const f = r(e, i, n, s);
return Vn(c), f;
}
return {
render: (e = {}, { $$slots: i = {}, context: n = /* @__PURE__ */ new Map() } = {}) => {
No = [];
const s = { title: "", head: "", css: /* @__PURE__ */ new Set() }, l = t(s, e, {}, i, n);
return vs(No), {
html: l,
css: {
code: Array.from(s.css).map((c) => c.code).join(`
`),
map: null
// TODO
},
head: s.title + s.head
};
},
$$render: t
};
}
function $(r, t, e) {
if (t == null || e) return "";
const i = `="${et(t, !0)}"`;
return ` ${r}${i}`;
}
function Xo(r) {
return Object.keys(r).filter((t) => r[t] != null && r[t] !== "").map((t) => `${t}: ${Hr(r[t])};`).join(" ");
}
function Dr(r) {
const t = Xo(r);
return t ? ` style="${t}"` : "";
}
const on = [];
function fc(r, t) {
return {
subscribe: Di(r, t).subscribe
};
}
function Di(r, t = A) {
let e;
const i = /* @__PURE__ */ new Set();
function n(c) {
if (Yl(r, c) && (r = c, e)) {
const g = !on.length;
for (const f of i)
f[1](), on.push(f, r);
if (g) {
for (let f = 0; f < on.length; f += 2)
on[f][0](on[f + 1]);
on.length = 0;
}
}
}
function s(c) {
n(c(r));
}
function l(c, g = A) {
const f = [c, g];
return i.add(f), i.size === 1 && (e = t(n, s) || A), c(r), () => {
i.delete(f), i.size === 0 && e && (e(), e = null);
};
}
return { set: n, update: s, subscribe: l };
}
function Ki(r, t, e) {
const i = !Array.isArray(r), n = i ? [r] : r;
if (!n.every(Boolean))
throw new Error("derived() expects stores as input, got a falsy value");
const s = t.length < 2;
return fc(e, (l, c) => {
let g = !1;
const f = [];
let p = 0, C = A;
const O = () => {
if (p)
return;
C();
const M = t(i ? f[0] : f, l, c);
s ? l(M) : C = Jl(M) ? M : A;
}, P = n.map(
(M, J) => m(
M,
(R) => {
f[J] = R, p &= ~(1 << J), g && O();
},
() => {
p |= 1 << J;
}
)
);
return g = !0, O(), function() {
vs(P), C(), g = !1;
};
});
}
const gc = "divkit-6d515", hc = "divkit-27458", vc = "divkit-82db1", pc = "divkit-be734", _c = "divkit-9a652", Ir = {
root_platform_desktop: gc,
root__clickable: hc,
"root__clickable-no-transition": "divkit-3bb57",
"root__any-actions": "divkit-ba614",
root: vc,
root__selectable: pc,
root__unselectable: _c,
"root__only-desktop": "divkit-316e7",
"root_restrict-scroll": "divkit-0a135",
"root_disabled-context-menu": "divkit-f5cb3"
}, Mr = Symbol("root");
function S(r, t = {}) {
const e = r;
return e.level = t.level || "error", t.additional && (e.additional = t.additional), e;
}
const mc = "divkit-bf0ea", bc = "divkit-27458", yc = "divkit-05991", wc = "divkit-80cac", $c = "divkit-90c49", jc = "divkit-b33bc", Ac = "divkit-f6ff9", Zo = {
outer: mc,
root__clickable: bc,
"root__clickable-no-transition": "divkit-3bb57",
"outer_hide-on-transition-in": "divkit-c5f24",
"outer_halign-self_start": "divkit-002ec",
"outer_halign-self_center": "divkit-204f8",
"outer_halign-self_end": "divkit-bd7ba",
"outer_halign-self_stretch": "divkit-02d12",
"outer_valign-self_start": "divkit-fd8aa",
"outer_valign-self_center": "divkit-62df2",
"outer_valign-self_end": "divkit-819a0",
"outer_valign-self_stretch": "divkit-8a331",
"outer_parent-flex_vertical": "divkit-46b27",
"outer_parent-flex_horizontal": "divkit-be075",
"outer_valign-self_baseline": "divkit-2b876",
outer_width_content: yc,
outer_height_content: wc,
"outer_width-constrained": "divkit-5bdb7",
"outer_parent-grid": "divkit-47ef2",
"outer_height-constrained": "divkit-351c8",
"outer_parent-overlap": "divkit-747b0",
"outer_scroll-snap_start": "divkit-91fd4",
"outer_scroll-snap_center": "divkit-c525d",
"outer_scroll-snap_end": "divkit-67470",
outer__border: $c,
outer_visibility_invisible: jc,
outer_visibility_gone: Ac,
"outer_has-action-animation": "divkit-4d4f3",
"outer_has-custom-focus": "divkit-b630e"
};
function dr(r) {
if (!r)
return;
let t = "";
for (const e in r)
if (r.hasOwnProperty(e)) {
if (!r[e] && r[e] !== 0)
continue;
t && (t += ";"), t += e + ":" + String(r[e]);
}
return t || void 0;
}
function me(r) {
if (typeof r != "number" && typeof r != "string" || !r)
return "0";
const t = Number(r);
return Number.isNaN(t) ? "0" : Math.ceil(t * 1e3) / 1e4 + "em";
}
function zr(r) {
let t = me(r);
return t === "0" && (t += "em"), t;
}
function Qa(r, t) {
for (; r.length < t; )
r = "0" + r;
return r;
}
function or(r, t = 1, e = "transparent") {
if (r = (typeof r == "string" && r || "").toLowerCase(), r.charAt(0) !== "#")
return e;
const i = xi(r);
return i ? (i.a *= t, ps(i)) : e;
}
function kc(r, t, e = "transparent") {
if (r = (typeof r == "string" && r || "").toLowerCase(), r.charAt(0) !== "#")
return e;
const i = xi(r);
return i ? (i.a = t, ps(i)) : e;
}
function ps(r) {
return r.a === 255 ? `#${[r.r, r.g, r.b].map((t) => Qa(Math.round(t).toString(16), 2)).join("")}` : `rgba(${r.r},${r.g},${r.b},${(r.a / 255).toFixed(2)})`;
}
function xi(r) {
const t = (
// #AARRGGBB
r.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i) || // #ARGB
r.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i) || // #RRGGBB
r.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i) || // #RGB
r.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i)
);
if (t) {
if (t.length === 5) {
const [f, p, C, O, P] = t, M = C.length === 2 ? C : C + C, J = O.length === 2 ? O : O + O, R = P.length === 2 ? P : P + P, V = p.length === 2 ? p : p + p;
return {
a: parseInt(V, 16),
r: parseInt(M, 16),
g: parseInt(J, 16),
b: parseInt(R, 16)
};
}
const [e, i, n, s] = t, l = i.length === 2 ? i : i + i, c = n.length === 2 ? n : n + n, g = s.length === 2 ? s : s + s;
return {
a: 255,
r: parseInt(l, 16),
g: parseInt(c, 16),
b: parseInt(g, 16)
};
}
return null;
}
function Qo(r) {
let t = String(r);
return t.indexOf("&") > -1 && (t = t.replace(/&/g, "&")), t.indexOf("<") > -1 && (t = t.replace(/</g, "<")), t.indexOf(">") > -1 && (t = t.replace(/>/g, ">")), t.indexOf('"') > -1 && (t = t.replace(/"/g, """)), t;
}
const Ci = Boolean;
function xo(r) {
if (r.length === 1 && r[0].type === "solid")
return Ec({
bg: r[0]
});
const t = r.map((e) => {
if (e.type === "solid")
return xc({
bg: e
});
if (e.type === "gradient")
return Cc({
bg: e
});
if (e.type === "image")
return Vc({
bg: e
});
if (e.type === "radial_gradient")
return Fc({
bg: e
});
}).filter(Ci).reverse().reduce(function(e, i) {
return e.image.push(i.image), e.size.push(i.size || "auto"), e.position.push(i.pos || "50% 50%"), e;
}, {
image: [],
size: [],
position: []
});
return {
image: t.image.join(","),
size: t.size.join(","),
position: t.position.join(",")
};
}
function xc(r) {
const t = or(r.bg.color || "transparent");
return {
size: void 0,
pos: void 0,
image: `linear-gradient(to bottom,${t},${t})`
};
}
function Ec(r) {
return {
color: or(r.bg.color || "transparent"),
size: "auto",
position: "50% 50%"
};
}
function el(r) {
return r.every((i) => i.color && typeof i.position == "number" && i.position >= 0 && i.position <= 1) ? r.sort((i, n) => Math.abs(i.position - n.position) < 1e-6 ? 0 : i.position - n.position).map((i) => `${or(i.color)} ${(i.position * 100).toFixed(2)}%`).join(",") : void 0;
}
function Cc(r) {
var i, n, s, l;
if (!Array.isArray((i = r.bg) == null ? void 0 : i.colors) && !Array.isArray((n = r.bg) == null ? void 0 : n.color_map))
return;
const t = (s = r.bg.colors) == null ? void 0 : s.filter(Ci);
if (!(t != null && t.length) && !((l = r.bg) != null && l.color_map))
return;
let e;
if (r.bg.color_map) {
const c = el(r.bg.color_map);
if (!c)
return;
e = "linear-gradient(" + (90 - Number(r.bg.angle || 0) + "deg") + "," + c + ")";
} else {
if (!t)
return;
e = "linear-gradient(" + (90 - Number(r.bg.angle || 0) + "deg") + "," + t.map((c) => or(c)).join(",") + ")";
}
return {
size: void 0,
pos: void 0,
image: e
};
}
const Sc = {
nearest_corner: "closest-corner",
farthest_corner: "farthest-corner",
nearest_side: "closest-side",
farthest_side: "farthest-side"
};
function Ys(r) {
if (r && typeof r == "object" && "type" in r && r.value !== void 0) {
if (r.type === "fixed")
return zr(r.value);
if (r.type === "relative")
return `${Number(r.value) * 100}%`;
}
return "50%";
}
function Fc(r) {
var c, g, f, p;
if (!Array.isArray((c = r.bg) == null ? void 0 : c.colors) && !Array.isArray((g = r.bg) == null ? void 0 : g.color_map))
return;
const t = (f = r.bg.colors) == null ? void 0 : f.filter(Ci);
if (!(t != null && t.length) && !((p = r.bg) != null && p.color_map))
return;
let e;
if (r.bg.color_map ? e = el(r.bg.color_map) : t && (e = t.map((C) => or(C)).join(",")), !e)
return;
const i = r.bg.radius;
let n;
i && typeof i == "object" && "type" in i && i.value !== void 0 && (i.type === "fixed" ? n = zr(i.value) : i.type === "relative" && (n = Sc[i.value]));
const s = Ys(r.bg.center_x), l = Ys(r.bg.center_y);
return {
size: void 0,
pos: void 0,
image: `radial-gradient(circle ${n || "farthest-corner"} at ${s} ${l},` + e + ")"
};
}
function Vc(r) {
var e;
const t = (e = r.bg) == null ? void 0 : e.image_url;
if (t)
return {
size: tl(r.bg.scale),
pos: rl(r.bg),
image: 'url("' + Qo(t) + '")'
};
}
function tl(r) {
return r === "fit" ? "contain" : r === "stretch" ? "fill" : r === "no_scale" ? "none" : "cover";
}
function rl(r) {
let t, e;
return r.content_alignment_horizontal === "left" ? t = "0%" : r.content_alignment_horizontal === "right" ? t = "100%" : t = "50%", r.content_alignment_vertical === "top" ? e = "0%" : r.content_alignment_vertical === "bottom" ? e = "100%" : e = "50%", t + " " + e;
}
function Er(r, t) {
const e = Number(r);
return Number.isNaN(e) || e < 0 ? t : e;
}
function Ks(r, t, e) {
return typeof t == "number" && (r && t > 0 && t <= 100 || !r && t >= 0 && t < 100) ? t : e;
}
function Ic(r) {
return r.is_enabled !== 0 && r.is_enabled !== !1 && r.index !== void 0;
}
function Dc(r, {
visibilityActions: t,
disappearActions: e,
rootCtx: i,
componentContext: n
}) {
const s = [];
t && t.forEach((P) => {
s.push({
type: "visibility",
index: s.length,
action: P,
visible: !1,
count: 0,
finished: !1
});
}), e && e.forEach((P) => {
s.push({
type: "disappear",
index: s.length,
action: P,
// false, so disappear only works after the element becomes visible
visible: !1,
count: 0,
finished: !1
});
});
const l = s.map((P, M) => {
const J = P.type === "visibility";
return n.getDerivedFromVars({
index: M,
visibility_percentage: P.action.visibility_percentage,
visibility_duration: J ? P.action.visibility_duration : P.action.disappear_duration,
log_limit: P.action.log_limit,
is_enabled: P.action.is_enabled
}, void 0, !0);
});
let c;
const g = () => {
c && c.disconnect(), s.forEach((P) => {
P.timer && clearTimeout(P.timer);
});
}, f = Ki(l, (P) => P);
let p;
const C = (P) => {
const M = P.type === "visibility", J = n.getJsonWithVars(P.action);
n.execAnyActions([J], {
logType: M ? "visible" : "disappear",
node: r,
processUrls: !1
});
}, O = f.subscribe((P) => {
p = P.filter(Ic);
const M = {};
p.forEach((V) => {
M[V.index] = V;
}), g();
const J = [...new Set(p.map((V) => {
const Q = s[V.index].type === "visibility";
return Ks(
Q,
V.visibility_percentage,
Q ? 50 : 0
) / 100;
}))];
if (!J.length)
return;
const R = (V) => {
V.forEach((Q) => {
p.forEach((L) => {
const Y = s[L.index], ue = Y.type === "visibility", le = Ks(
ue,
L.visibility_percentage,
ue ? 50 : 0
);
let ae;
le === 0 ? ae = Q.intersectionRatio >= 1e-12 : ae = Q.intersectionRatio >= le / 100, (ue ? !Y.visible && ae : Y.visible && !ae) ? Y.finished || (Y.timer = setTimeout(() => {
++Y.count;
const te = L.log_limit === 0 ? 1 / 0 : L.log_limit || 1;
Y.count >= te && (Y.finished = !0), C(Y);
}, Er(L.visibility_duration, 800))) : (ue ? !ae : ae) && Y.timer && clearTimeout(Y.timer), Y.visible = ae;
});
});
};
c = new IntersectionObserver(R, {
threshold: J
}), c.observe(r);
});
return {
destroy() {
p == null || p.forEach((P) => {
const M = s[P.index];
!M || M.type !== "disappear" || !M.visible || M.finished || i.registerTimeout(window.setTimeout(() => {
C(M);
}, P.visibility_duration));
}), g(), O();
}
};
}
function Xs(r, t) {
t && r.push(t);
}
function Zt(r, t, e) {
const i = [];
Xs(i, t[r]);
for (const n in e)
if (e.hasOwnProperty(n)) {
const s = e[n];
if (s) {
const l = `${r}_${n}` + (typeof s == "string" ? `_${s}` : "");
Xs(i, t[l]);
}
}
return i.join(" ");
}
const _s = Symbol("state");
function Ei(r, t) {
var l, c;
const e = r.top || 0, i = ((l = t === "ltr" ? r.end : r.start) != null ? l : r.right) || 0, n = r.bottom || 0, s = ((c = t === "ltr" ? r.start : r.end) != null ? c : r.left) || 0;
return e === 0 && i === 0 && n === 0 && s === 0 ? "" : me(e) + " " + me(i) + " " + me(n) + " " + me(s);
}
function Eo(r) {
if (typeof r != "number" && typeof r != "string")
return !1;
const t = Number(r);
return !Number.isNaN(t);
}
function Qr(r) {
return Eo(r) && r >= 0;
}
function bo(r, t, e) {
var n, s;
if (!r)
return e;
const i = [
r.top,
(n = t === "ltr" ? r.end : r.start) != null ? n : r.right,
r.bottom,
(s = t === "ltr" ? r.start : r.end) != null ? s : r.left
];
for (let l = 0; l < i.length; ++l)
if (i[l] && !Qr(i[l]))
return e;
return Ei(r, t);
}
function Tc(r, t) {
return !Qr(r) || r === void 0 || r > 1 ? t : Number(r);
}
const Mc = Object.prototype.hasOwnProperty;
function ms(r, t) {
if (Object.is(r, t))
return !0;
if (typeof r != "object" || r === null || typeof t != "object" || t === null)
return Object.is(r, t);
const e = Object.keys(r), i = Object.keys(t);
if (e.length !== i.length)
return !1;
for (let n = 0; n < e.length; n++) {
const s = e[n];
if (!Mc.call(t, s) || !ms(r[s], t[s]))
return !1;
}
return !0;
}
function Oi(r, t) {
return ms(r, t) ? t : r;
}
function Pc(r, t) {
return r === "visible" || r === "invisible" || r === "gone" ? r : t;
}
function il(r, t) {
return r === "linear" || r === "ease" || r === "ease_in_out" || r === "ease_in" || r === "ease_out" ? r : t;
}
function dn(r, t) {
const e = Number(r);
return Number.isNaN(e) ? t : e;
}
function nl(r) {
const t = [];
return r.name === "set" ? (r.items || []).forEach((e) => {
t.push(...nl(e));
}) : t.push(r), t;
}
function _n(r, t) {
if (!r || typeof r != "object")
return t;
const e = [
"top",
"right",
"bottom",
"left"
];
for (let i = 0; i < e.length; ++i)
if (r[e[i]] && !Qr(r[e[i]]))
return t;
return r;
}
function Oc(r, t) {
if (!r && !t)
return {};
if (!t)
return r;
if (!r)
return t;
const e = {};
return [
"top",
"right",
"bottom",
"left",
"start",
"end"
].forEach((i) => {
const n = r[i];
n && (e[i] = n);
const s = t[i];
s && (e[i] = (e[i] || 0) + s);
}), e;
}
function zc(r, t) {
const e = [
r["top-left"],
r["top-right"],
r["bottom-right"],
r["bottom-left"]
];
for (let i = 0; i < e.length; ++i)
if (e[i] && !Qr(e[i]))
return t;
return r;
}
function eo(r, t = 0, e = 10) {
return [
r["top-left"],
r["top-right"],
r["bottom-right"],
r["bottom-left"]
].map((i) => me((i || t) / e * 10)).join(" ");
}
function Nc(r) {
var t, e, i, n, s, l;
return me(((e = (t = r.offset) == null ? void 0 : t.x) == null ? void 0 : e.value) || 0) + " " + me(((n = (i = r.offset) == null ? void 0 : i.y) == null ? void 0 : n.value) || 0) + " " + me((s = r.blur) != null ? s : 2) + " " + or(r.color || "#000000", (l = r.alpha) != null ? l : 0.19);
}
function Rc(r, t) {
var e, i, n, s, l, c;
return "drop-shadow(" + or(r.color || "#000000", (e = r.alpha) != null ? e : 0.19) + " " + me((((n = (i = r.offset) == null ? void 0 : i.x) == null ? void 0 : n.value) || 0) * 10 / t) + " " + me((((l = (s = r.offset) == null ? void 0 : s.y) == null ? void 0 : l.value) || 0) * 10 / t) + " " + me(((c = r.blur) != null ? c : 2) * 10 / t) + ")";
}
function vi(r) {
return r.is_enabled !== 0 && r.is_enabled !== !1;
}
let Ro;
function Bc() {
return typeof matchMedia > "u" ? !1 : (Ro || (Ro = window.matchMedia("(prefers-reduced-motion)")), Ro.matches);
}
const Lc = 8, Hc = (r, t, e, i) => {
let n;
return (e || i) && typeof ResizeObserver < "u" && (n = new ResizeObserver(async () => {
let s = 0;
const l = {}, c = (f, p) => {
if (f) {
const C = t.getVariable(f, "integer");
if (C) {
if (p = Math.round(p), l[f] || (l[f] = /* @__PURE__ */ new Set()), !l[f].has(p))
return C.setValue(p), l[f].add(p), !0;
} else {
const O = new Error("Missing variable");
O.level = "error", O.additional = {
variableName: f
}, t.logError(O);
}
}
return !1;
}, g = () => {
if (!r)
return !1;
const f = r.getBoundingClientRect(), p = c(e, f.width), C = c(i, f.height);
return p || C;
};
for (; g(); ) {
if (++s > Lc) {
const f = new Error("Recursive layout in size_provider");
f.level = "warn", f.additional = {
widthVariableName: e,
heightVariableName: i
}, t.logError(f);
break;
}
await ki();
}
}), n.observe(r)), n;
}, bs = Symbol("enabled");
function Zr(r, t) {
return r === 1 || r === 0 || r === !1 || r === !0 ? !!r : t;
}
function hn(r) {
return [
r.state_description,
r.description,
r.hint
].filter(Boolean).join(", ");
}
const Wc = "divkit-ee5cc", Uc = {
actionable__button: Wc
};
function Gc() {
}
const Xi = Symbol("action");
function ol(r) {
if (r.startsWith("tel:"))
return "tel";
const t = /^([^/]+):\/\//.exec(r);
return t && t[1] || "";
}
function sl(r, t) {
return t.has(r);
}
const qc = /* @__PURE__ */ new Set(["button", "image", "checkbox", "radio", "header"]), Co = yr((r, t, e, i) => {
let { componentContext: n } = t, { id: s = "" } = t, { actions: l = void 0 } = t, { doubleTapActions: c = void 0 } = t, { longTapActions: g = void 0 } = t, { pressStartActions: f = void 0 } = t, { pressEndActions: p = void 0 } = t, { hoverStartActions: C = void 0 } = t, { hoverEndActions: O = void 0 } = t, { cls: P = "" } = t, { style: M = null } = t, { attrs: J = void 0 } = t, { use: R = Gc } = t, { customAction: V = null } = t, { isNativeActionAnimation: Q = !0 } = t, { hasInnerFocusable: L = !1 } = t, { customAccessibility: Y = void 0 } = t, { captureFocusOnAction: ue = !0 } = t;
const le = vr(Mr), ae = vr(Xi);
Ji(Xi, {
hasAction() {
return !!(ae.hasAction() || l != null && l.length || (Y == null ? void 0 : Y.mode) === "exclude");
}
});
let Ee, G = "", te, oe = null, ce = !1, we, Oe, Ve = !1;
function We(ge) {
}
function Xe(ge) {
ae.hasAction();
}
Nr(() => {
typeof window < "u" && (window.removeEventListener("pointermove", We), window.removeEventListener("pointerup", Xe), window.removeEventListener("pointercancel", Xe)), s && !L && le.unregisterFocusable(s);
}), t.componentContext === void 0 && e.componentContext && n !== void 0 && e.componentContext(n), t.id === void 0 && e.id && s !== void 0 && e.id(s), t.actions === void 0 && e.actions && l !== void 0 && e.actions(l), t.doubleTapActions === void 0 && e.doubleTapActions && c !== void 0 && e.doubleTapActions(c), t.longTapActions === void 0 && e.longTapActions && g !== void 0 && e.longTapActions(g), t.pressStartActions === void 0 && e.pressStartActions && f !== void 0 && e.pressStartActions(f), t.pressEndActions === void 0 && e.pressEndActions && p !== void 0 && e.pressEndActions(p), t.hoverStartActions === void 0 && e.hoverStartActions && C !== void 0 && e.hoverStartActions(C), t.hoverEndActions === void 0 && e.hoverEndActions && O !== void 0 && e.hoverEndActions(O), t.cls === void 0 && e.cls && P !== void 0 && e.cls(P), t.style === void 0 && e.style && M !== void 0 && e.style(M), t.attrs === void 0 && e.attrs && J !== void 0 && e.attrs(J), t.use === void 0 && e.use && R !== void 0 && e.use(R), t.customAction === void 0 && e.customAction && V !== void 0 && e.customAction(V), t.isNativeActionAnimation === void 0 && e.isNativeActionAnimation && Q !== void 0 && e.isNativeActionAnimation(Q), t.hasInnerFocusable === void 0 && e.hasInnerFocusable && L !== void 0 && e.hasInnerFocusable(L), t.customAccessibility === void 0 && e.customAccessibility && Y !== void 0 && e.customAccessibility(Y), t.captureFocusOnAction === void 0 && e.captureFocusOnAction && ue !== void 0 && e.captureFocusOnAction(ue), Ve = (Y == null ? void 0 : Y.mode) === "exclude";
{
if (Array.isArray(l) && (l != null && l.length))
for (let ge = 0; ge < l.length; ++ge) {
const Be = l[ge].url;
if (Be) {
G = Be, te = l[ge].target || void 0;
break;
}
}
ce = !!V, (G || Array.isArray(l) && (l != null && l.length)) && (ae.hasAction() || Ve) ? (G = "", n.logError(S(new Error("Actionable element is forbidden inside other actionable element or inside accessibility mode=exlucde"), { level: "warn", additional: { actions: l } }))) : G && !sl(ol(G), le.getBuiltinProtocols()) ? (G = "", ce = !0) : !G && Array.isArray(l) && (l != null && l.length) && (ce = !0, l.some((ge) => ge.url || ge.typed || ge.menu_items) || n.logError(S(new Error("The component has a list of actions, but does not have a real action"), { level: "warn", additional: { actions: l } })));
}
return Y != null && Y.type && qc.has(Y.type) ? Y.type === "header" ? we = "heading" : we = Y.type : G ? we = void 0 : ce && (we = "button"), (we === "checkbox" || we === "radio") && typeof (Y == null ? void 0 : Y.is_checked) == "boolean" ? Oe = Y.is_checked : Oe = void 0, `${G ? `<a${fn(
[
{ href: Hr(G) },
{ target: Hr(te) },
{ style: Hr(M) },
{ role: Hr(we) },
{
"aria-checked": Hr(Oe)
},
{
class: et(P, !0) + " " + et(Ir["root__any-actions"], !0) + " " + et(
Q ? Ir.root__clickable : Ir["root__clickable-no-transition"],
!0
) + " " + et(
g != null && g.length ? Ir["root_disabled-context-menu"] : "",
!0
)
},
gn(J)
],
{}
)}${$("this", Ee, 0)}>${i.default ? i.default({}) : ""}</a>` : `${ce ? `<button${fn(
[
{
class: et(P, !0) + " " + et(Uc.actionable__button, !0) + " " + et(Ir["root__any-actions"], !0) + et(
` ${Q ? Ir.root__clickable : Ir["root__clickable-no-transition"]} ${Ir.root__unselectable}`,
!0
) + " " + et(
g != null && g.length ? Ir["root_disabled-context-menu"] : "",
!0
)
},
{ style: Hr(M) },
{ role: Hr(we) },
{
"aria-checked": Hr(Oe)
},
{ type: "button" },
gn(J)
],
{}
)}${$("this", Ee, 0)}>${i.default ? i.default({}) : ""}</button>` : `<span${fn(
[
{
class: et(P, !0) + " " + et(
g != null && g.length ? Ir["root_disabled-context-menu"] : "",
!0
) + " " + et("", !0)
},
{ style: Hr(M) },
{ role: Hr(we) },
{
"aria-checked": Hr(Oe)
},
{
"aria-hidden": Hr(Ve || void 0)
},
gn(J)
],
{}
)}${$("this", Ee, 0)}>${i.default ? i.default({}) : ""}</span>`}`}`;
}), On = {
"outer-background": "divkit-7b038",
"outer-background_clip": "divkit-8fdbd",
"outer-background__item": "divkit-f9881",
"outer-background__item_hidden": "divkit-ea047"
};
function ni(r) {
return Eo(r) && r > 0;
}
function al(r, t) {
return r.map((e) => {
if (!e) {
t(S(new Error("Incorrect filter"), {
level: "warn"
}));
return;
}
if (e.type === "blur") {
if (ni(e.radius))
return `blur(${zr(e.radius / 2)})`;
} else {
if (e.type === "rtl_mirror")
return;
t(S(new Error("Unknown filter"), {
level: "warn",
additional: {
filter: e.type
}
}));
}
}).filter(Boolean).join(" ");
}
const Jc = yr((r, t, e, i) => {
let n, { direction: s } = t, { componentContext: l } = t, { background: c = [] } = t, { radius: g = "" } = t;
return t.direction === void 0 && e.direction && s !== void 0 && e.direction(s), t.componentContext === void 0 && e.componentContext && l !== void 0 && e.componentContext(l), t.background === void 0 && e.background && c !== void 0 && e.background(c), t.radius === void 0 && e.radius && g !== void 0 && e.radius(g), n = c.map((f) => {
const p = {}, C = { style: p };
if (f.type === "nine_patch_image" && f.insets)
p["border-image"] = `url("${f.image_url}") ${f.insets.top || 0} ${f.insets.right || 0} ${f.insets.bottom || 0} ${f.insets.left || 0} fill`, p["border-image-width"] = "auto";
else {
const O = xo([f]);
f.type === "solid" && (p["background-color"] = O.color), f.type === "gradient" && (p["background-image"] = O.image), f.type === "image" && (p.opacity = Number(f.alpha), C.image_url = f.image_url, p["object-fit"] = O.size, p["object-position"] = O.position, Array.isArray(f.filters) && f.filters.length && (p.filter = al(f.filters, l.logError), s === "rtl" && f.filters.some((P) => P.type === "rtl_mirror") && (p.transform = "scale(-1,1)")));
}
return C;
}), `<span${$("class", On["outer-background"] + (g ? " " + On["outer-background_clip"] : ""), 0)}${Dr({ "border-radius": g })}>${Cr(n, (f) => `${f.image_url ? `<img${$("src", f.image_url, 0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${$("class", On["outer-background__item"], 0)}${$("style", dr(f.style), 0)}>` : `<span${$("class", On["outer-background__item"], 0)}${$("style", dr(f.style), 0)}></span>`}`)}</span>`;
}), Yc = {
left: "start",
center: "center",
right: "end",
start: "start",
end: "end"
}, Kc = {
left: "end",
center: "center",
right: "start",
start: "start",
end: "end"
}, Xc = {
top: "start",
center: "center",
bottom: "end",
baseline: "baseline"
}, Bo = (r) => `The component id with the "${r}" property for state change is missing. Either specify the id, or specify the "transition_trigger" property without "state_change" value.`;
function Zc(r) {
return r.some((t) => t.name === "native");
}
const ei = yr((r, t, e, i) => {
var Os, zs, Ns, Rs, Bs, Ls, Hs, Ws, Us;
let n, s, l, c, g, f, p, C, O, P, M, J, R, V, Q, L, Y, ue, le, ae, Ee, G, te, oe, ce, we, Oe, Ve, We, Xe, ge, Be = A, I = () => (Be(), Be = m(te, (H) => ge = H), te), de, $e = A, je = () => ($e(), $e = m(G, (H) => de = H), G), Z, mt = A, at = () => (mt(), mt = m(oe, (H) => Z = H), oe), nt, ze = A, Ie = () => (ze(), ze = m(Ee, (H) => nt = H), Ee), Re, Tt = A, Ae = () => (Tt(), Tt = m(ae, (H) => Re = H), ae), Fe, Ct = A, ie = () => (Ct(), Ct = m(le, (H) => Fe = H), le), Ce, Ze = A, ne = () => (Ze(), Ze = m(ue, (H) => Ce = H), ue), Mt, kt = A, ht = () => (kt(), kt = m(Y, (H) => Mt = H), Y), Me, lt = A, Ne = () => (lt(), lt = m(s, (H) => Me = H), s), ct, N = A, fe = () => (N(), N = m(L, (H) => ct = H), L), tt, Pe = A, bt = () => (Pe(), Pe = m(Q, (H) => tt = H), Q), At, Le = A, Ut = () => (Le(), Le = m(R, (H) => At = H), R), $t, Qe = A, ot = () => (Qe(), Qe = m(V, (H) => $t = H), V), U, Je = A, St = () => (Je(), Je = m(J, (H) => U = H), J), he, yt = A, pe = () => (yt(), yt = m(M, (H) => he = H), M), Ht, Bt = A, ke = () => (Bt(), Bt = m(P, (H) => Ht = H), P), Te, Pt = A, sr = () => (Pt(), Pt = m(O, (H) => Te = H), O), Vt, Wt = A, Yt = () => (Wt(), Wt = m(C, (H) => Vt = H), C), B, rt = A, vt = () => (rt(), rt = m(g, (H) => B = H), g), ut, qt, Nt, Jt = A, jt = () => (Jt(), Jt = m(p, (H) => Nt = H), p), W, Ue = A, dt = () => (Ue(), Ue = m(f, (H) => W = H), f), ft, tr = A, Qt = () => (tr(), tr = m(c, (H) => ft = H), c), se, Xt = A, ur = () => (Xt(), Xt = m(l, (H) => se = H), l), De, z, { componentContext: v } = t, { cls: It = "" } = t, { style: wt = void 0 } = t, { layoutParams: k = {} } = t, { customDescription: be = !1 } = t, { customPaddings: st = !1 } = t, { customActions: X = "" } = t, { additionalPaddings: Ft = null } = t, { heightByAspect: ve = !1 } = t, { parentOf: Rt = void 0 } = t, { parentOfSimpleMode: Se = void 0 } = t, { replaceItems: Vr = void 0 } = t, { hasInnerFocusable: Lr = !1 } = t;
const o = vr(Mr), pt = vr(_s), { isEnabled: Ar } = vr(bs);
z = m(Ar, (H) => De = H);
const rr = o.direction;
qt = m(rr, (H) => ut = H);
let Et, E, ar = null, ir = [], _t = {}, pr = {}, Sr = !1, Pr = 1, _r = "transparent", wr = 0, Fr = {
"top-left": 0,
"top-right": 0,
"bottom-right": 0,
"bottom-left": 0
}, T = "", Wr = null, d = "", u = {}, w, x, j, q = 0, xe = 0, it = 0, re = !1, He = !1, Ge = {}, gt, er, Rr, Jr = 0, oi = 0, di = 0, Si = !1, yi = !1, si = 1, _e, Yr, ri, Br, qe = [], a = !1, h = !1, y, _, D, F = [], Ye = [], Ke = [], mr = [], lr = [], fr = [], Fi = [], wi = [], Vi = [], fi = [], Io = "", Vs, Is, Ds, Ts, Pn = !1, Hi = "visible", wn = 0, $n = 0, Do, To, Wi, rn = !1, Mo = !0, Po, ai, jn, Ui;
function Ol() {
Wr = null, d = "", si = 1, Pn = !1, Hi = "visible", wn = 0, $n = 0, Do = void 0, To = void 0, Mo = !0, qe = v.fakeElement ? [] : v.json.transition_triggers || ["state_change", "visibility_change"], a = qe.indexOf("state_change") !== -1, h = qe.indexOf("visibility_change") !== -1, Et && Ps(Et), ai == null || ai(), De && (ai = o.processVariableTriggers(v, v.json.variable_triggers));
}
function zl(H, xt) {
if (!Array.isArray(Rt) || !Vr || Se && (Array.isArray(xt) ? xt.length : 0) !== 1)
return;
const Gt = Rt.findIndex((Dt) => (Dt == null ? void 0 : Dt.id) === H), cr = Rt.slice();
cr.splice(Gt, 1, ...(xt || []).map((Dt) => ({ json: Dt, id: Dt == null ? void 0 : Dt.id }))), Rt = cr, Vr(cr.map((Dt) => Dt == null ? void 0 : Dt.json));
}
function Nl(H) {
const xt = dn(H.start_value, 1), Gt = dn(H.end_value, 1), cr = Er(H.start_delay, 0), Dt = Bc() ? 0 : Er(H.duration, 300), gr = il(H.interpolator, "ease_in_out").replace(/_/g, "-");
switch (H.name) {
case "fade":
return Vs = xt, Is = Gt, `opacity ${Dt}ms ${gr} ${cr}ms`;
case "scale":
return Ds = xt, Ts = Gt, `transform ${Dt}ms ${gr} ${cr}ms`;
case "native":
case "no_animation":
return "";
default:
return v.logError(S(new Error("Unknown action_animation name"), {
additional: { animation: H.name }
})), "";
}
}
async function Rl(H) {
Hi = H;
const xt = H === "visible" ? "in" : "out", Gt = xt === "in" ? v.json.transition_in : v.json.transition_out;
if (h && Gt) {
let cr;
H === "gone" && (cr = Et.getBoundingClientRect()), await ki(), xt === "in" && (_ = !0), pt.runVisibilityTransition(
{
...v.json,
visibility: "visible"
},
v,
Gt,
Et,
xt,
cr
).then(() => {
xt === "in" && (_ = !1);
}).catch((Dt) => {
throw xt === "in" && (_ = !1), Dt;
});
}
}
function Ms() {
if (ar && Et) {
const H = o.getExtensionContext(v);
ar.forEach((xt) => {
var Gt;
(Gt = xt.unmountView) == null || Gt.call(xt, Et, H);
}), ar = null;
}
}
function Ps(H) {
var gr, Ur, _i;
jn == null || jn.destroy(), Et = H, a && v.json.transition_in && (v.id ? pt.registerChildWithTransitionIn(v.json, v, v.json.transition_in, H).then(() => {
y = !1;
}).catch((ii) => {
throw y = !1, ii;
}) : v.logError(S(new Error(Bo("transition_in")), { level: "warn" }))), a && v.json.transition_out && (v.id ? pt.registerChildWithTransitionOut(v.json, v, v.json.transition_out, H) : v.logError(S(new Error(Bo("transition_out")), { level: "warn" }))), v.fakeElement || (v.json.transition_change && !v.id && v.logError(S(new Error(Bo("transition_change")), { level: "warn" })), pt.registerChildWithTransitionChange(v.json, v, v.json.transition_change, H).then(() => {
D = !1;
}).catch((ii) => {
throw D = !1, ii;
}));
const xt = v.fakeElement ? [] : v.json.visibility_actions || v.json.visibility_action && [v.json.visibility_action], Gt = v.fakeElement ? [] : v.json.disappear_actions;
let cr;
(Array.isArray(xt) && xt.length || Array.isArray(Gt) && Gt.length) && (cr = Dc(H, {
visibilityActions: xt,
disappearActions: Gt,
rootCtx: o,
componentContext: v
}));
const Dt = v.id;
return Dt && (Ui == null || Ui(), Ui = o.registerId(Dt, {
context: () => v,
node: () => Et
}), pt.registerChild(Dt)), (gr = v.json.tooltips) == null || gr.forEach((ii) => {
o.registerTooltip(H, ii);
}), Wi && (Wi.disconnect(), Wi = void 0), Wi = Hc(Et, v, (Ur = v.json.layout_provider) == null ? void 0 : Ur.width_variable_name, (_i = v.json.layout_provider) == null ? void 0 : _i.height_variable_name), jn = {
destroy() {
Ui && (Ui(), Ui = void 0), Dt && pt.unregisterChild(Dt), cr && cr.destroy();
}
}, jn;
}
function Bl() {
v.json.focus && (Kl(o.isPointerFocus) || (rn = !0), v.execAnyActions(mr));
}
function Ll() {
v.json.focus && (rn = !1, v.execAnyActions(lr));
}
Nr(() => {
var H;
ir.forEach((xt) => {
o.unregisterParentOf(xt);
}), ir = [], Wi && (Wi.disconnect(), Wi = void 0), (H = v.json.tooltips) == null || H.forEach((xt) => {
o.unregisterTooltip(xt);
}), ai == null || ai(), Ms();
}), t.componentContext === void 0 && e.componentContext && v !== void 0 && e.componentContext(v), t.cls === void 0 && e.cls && It !== void 0 && e.cls(It), t.style === void 0 && e.style && wt !== void 0 && e.style(wt), t.layoutParams === void 0 && e.layoutParams && k !== void 0 && e.layoutParams(k), t.customDescription === void 0 && e.customDescription && be !== void 0 && e.customDescription(be), t.customPaddings === void 0 && e.customPaddings && st !== void 0 && e.customPaddings(st), t.customActions === void 0 && e.customActions && X !== void 0 && e.customActions(X), t.additionalPaddings === void 0 && e.additionalPaddings && Ft !== void 0 && e.additionalPaddings(Ft), t.heightByAspect === void 0 && e.heightByAspect && ve !== void 0 && e.heightByAspect(ve), t.parentOf === void 0 && e.parentOf && Rt !== void 0 && e.parentOf(Rt), t.parentOfSimpleMode === void 0 && e.parentOfSimpleMode && Se !== void 0 && e.parentOfSimpleMode(Se), t.replaceItems === void 0 && e.replaceItems && Vr !== void 0 && e.replaceItems(Vr), t.hasInnerFocusable === void 0 && e.hasInnerFocusable && Lr !== void 0 && e.hasInnerFocusable(Lr), n = v.origJson, n && Ol(), De ? (ai == null || ai(), ai = o.processVariableTriggers(v, v.json.variable_triggers)) : ai == null || ai(), Ne(s = v.getDerivedFromVars(v.json.focus)), ur(l = v.getDerivedFromVars(v.json.border)), Qt(c = v.getDerivedFromVars(v.json.paddings)), vt(g = v.getDerivedFromVars(v.json.margins)), dt(f = v.getDerivedFromVars(v.json.width)), jt(p = v.getDerivedFromVars(v.json.alignment_horizontal)), Yt(C = v.getDerivedFromVars(v.json.height)), sr(O = v.getDerivedFromVars(v.json.alignment_vertical)), ke(P = v.getDerivedFromVars(v.json.alpha)), pe(M = v.getDerivedFromVars(v.json.accessibility)), St(J = v.getDerivedFromVars(v.json.background)), Ut(R = v.getDerivedFromVars(v.json.action, void 0, !0)), ot(V = v.getDerivedFromVars(v.json.actions, void 0, !0)), bt(Q = v.getDerivedFromVars(v.json.doubletap_actions, void 0, !0)), fe(L = v.getDerivedFromVars(v.json.longtap_actions, void 0, !0)), ht(Y = v.getDerivedFromVars(v.json.press_start_actions, void 0, !0)), ne(ue = v.getDerivedFromVars(v.json.press_end_actions, void 0, !0)), ie(le = v.getDerivedFromVars(v.json.hover_start_actions, void 0, !0)), Ae(ae = v.getDerivedFromVars(v.json.hover_end_actions, void 0, !0)), Ie(Ee = v.getDerivedFromVars(v.json.action_animation)), je(G = v.getDerivedFromVars(v.json.visibility)), I(te = v.getDerivedFromVars(v.json.transform)), at(oe = v.getDerivedFromVars(v.json.capture_focus_on_action)), ir.forEach((H) => {
o.unregisterParentOf(H);
}), ir = [], Rt && Rt.forEach((H) => {
H != null && H.id && (ir.push(H.id), o.registerParentOf(H.id, {
replaceWith: zl,
isSingleMode: !!Se
}));
});
{
const H = rn && (Me != null && Me.border) ? Me.border : se;
let xt = {}, Gt = {}, cr = !1, Dt = "";
if (H) {
if (Zr(H.has_shadow, !1)) {
const gr = H.shadow;
gr ? xt["box-shadow"] = Nc(gr) : xt["box-shadow"] = "0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)";
}
if (H.stroke) {
cr = !0, Pr = Er(H.stroke.width, Pr), _r = or(H.stroke.color, 1, _r);
const gr = ((Os = H.stroke.style) == null ? void 0 : Os.type) === "dashed" ? "dashed" : "solid";
Gt["--divkit-border"] = `${me(Pr + 1)} ${gr} ${_r}`;
}
if (H.corners_radius && typeof H.corners_radius == "object") {
Fr = zc(H.corners_radius, Fr), xt["border-radius"] = eo(Fr);
const gr = {};
["top-left", "top-right", "bottom-right", "bottom-left"].forEach((Ur) => {
gr[Ur] = (Fr[Ur] || 0) + 1;
}), Gt["--divkit-border-radius"] = eo(gr);
} else H.corner_radius && (wr = Er(H.corner_radius, wr), Fr = {
"top-left": wr,
"top-right": wr,
"bottom-right": wr,
"bottom-left": wr
}, xt["border-radius"] = me(wr), Gt["--divkit-border-radius"] = me(wr + 1));
if (cr && Pr && (H.corners_radius || H.corner_radius)) {
let gr = { ...Fr };
["top-left", "top-right", "bottom-right", "bottom-left"].forEach((Ur) => {
gr[Ur] = (gr[Ur] || 0) + Pr / 2;
}), Dt = eo(gr);
}
}
_t = Oi(xt, _t), pr = Oi(Gt, pr), Sr = cr, T = Dt;
}
Wr = _n(
ft && !st ? ft : void 0,
Wr
), ce = Ei(Oc(Wr, Ft), ut), d = bo(B, ut, d);
{
let H, xt, Gt, cr, Dt = {}, gr = 0, Ur = 0, _i = !1, ii = !1;
const Gr = (zs = v.json.width) == null ? void 0 : zs.type;
if (Gr === "fixed")
q = Er(W == null ? void 0 : W.value, q), xt = me(q);
else if (Gr === "wrap_content" || (Gr === "match_parent" || !Gr) && k.parentHorizontalWrapContent) {
if (H = "content", (Gr === "wrap_content" && (W != null && W.constrained) || (Gr === "match_parent" || !Gr) && k.parentHorizontalWrapContent) && (Dt["width-constrained"] = !0, k.parentContainerOrientation === "horizontal" && (Ur = 1)), Gr === "wrap_content") {
const nr = W;
nr.min_size && Qr(nr.min_size.value) && (Gt = me(nr.min_size.value)), nr.max_size && Qr(nr.max_size.value) && (cr = me(nr.max_size.value));
}
(Gr === "match_parent" || !Gr) && v.logError(S(new Error("Incorrect child size. Container with wrap_content size contains child with match_parent size along the main axis"), { level: "warn" }));
} else if (H = "parent", k.parentContainerOrientation === "vertical" && k.parentContainerWrap && (ii = !0, v.logError(S(new Error("Cannot place a match_parent items on the cross-axis of wrap"), { level: "error" }))), k.parentLayoutOrientation === "vertical" || k.stretchWidth) {
const nr = (Rs = (Ns = ut === "ltr" ? B == null ? void 0 : B.start : B == null ? void 0 : B.end) != null ? Ns : B == null ? void 0 : B.left) != null ? Rs : 0, Oo = (Ls = (Bs = ut === "ltr" ? B == null ? void 0 : B.end : B == null ? void 0 : B.start) != null ? Bs : B == null ? void 0 : B.right) != null ? Ls : 0, An = `calc(100% - ${zr(nr + Oo)})`;
k.stretchWidth ? (xt = "0", Gt = An) : xt = An;
} else k.parentContainerOrientation === "horizontal" && (gr = W && "weight" in W && W.weight || 1, k.parentContainerWrap && (_i = !0));
if (H === "parent")
Dt["halign-self"] = "stretch";
else {
const nr = Nt;
nr === "left" || nr === "center" || nr === "right" || nr === "start" || nr === "end" ? Dt["halign-self"] = (ut === "ltr" ? Yc : Kc)[nr] : Dt["halign-self"] = k.parentHAlign || "start";
}
H && (Dt.width = H), w = xt, x = Gt, j = cr, xe = gr, it = Ur, u = Oi(Dt, u), re = _i, He = ii;
}
{
let H, xt, Gt, cr, Dt = {}, gr = 0, Ur = 0, _i = !1, ii = !1;
const Gr = (Hs = v.json.height) == null ? void 0 : Hs.type;
if (!ve) if (Gr === "fixed")
Jr = Er(Vt == null ? void 0 : Vt.value, Jr), xt = me(Jr);
else if (Gr === "match_parent" && !k.parentVerticalWrapContent)
if (H = "parent", k.parentContainerOrientation === "horizontal" && k.parentContainerWrap && (ii = !0, v.logError(S(new Error("Cannot place a match_parent items on the cross-axis of wrap"), { level: "error" }))), k.parentLayoutOrientation === "horizontal" || k.stretchHeight) {
const nr = (Ws = B == null ? void 0 : B.top) != null ? Ws : 0, Oo = (Us = B == null ? void 0 : B.bottom) != null ? Us : 0, An = `calc(100% - ${zr(nr + Oo)})`;
k.stretchHeight ? (xt = "0", Gt = An) : xt = An;
} else k.parentContainerOrientation === "vertical" && (gr = (Vt == null ? void 0 : Vt.weight) || 1, k.parentContainerWrap && (_i = !0));
else {
if (H = "content", (Gr === "wrap_content" && (Vt != null && Vt.constrained) || Gr === "match_parent" && k.parentVerticalWrapContent) && (Dt["height-constrained"] = !0, k.parentContainerOrientation === "vertical" && (Ur = 1)), Gr === "wrap_content") {
const nr = Vt;
nr != null && nr.min_size && Qr(nr.min_size.value) && (Gt = me(nr.min_size.value)), nr != null && nr.max_size && Qr(nr.max_size.value) && (cr = me(nr.max_size.value));
}
Gr === "match_parent" && v.logError(S(new Error("Incorrect child size. Container with wrap_content size contains child with match_parent size along the main axis"), { level: "warn" }));
}
if (H === "parent")
Dt["valign-self"] = "stretch";
else {
const nr = Te;
nr === "top" || nr === "center" || nr === "bottom" || nr === "baseline" && k.parentContainerOrientation === "horizontal" ? Dt["valign-self"] = Xc[nr] : Dt["valign-self"] = k.parentVAlign || "start";
}
H && (Dt.height = H), gt = xt, er = Gt, Rr = cr, oi = gr, di = Ur, Ge = Oi(Dt, Ge), Si = _i, yi = ii;
}
if (we = k.overlapParent ? !0 : void 0, Oe = k.gridArea ? `${k.gridArea.y + 1}/${k.gridArea.x + 1}/span ${k.gridArea.rowSpan}/span ${k.gridArea.colSpan}` : void 0, si = Tc(Ht, si), _e = si === 1 ? void 0 : si, E = void 0, he && !be) {
const H = hn(he);
H && (E = {}, E["aria-label"] = H);
}
if (Yr = rn && (Me != null && Me.background) ? Me.background : U, ri = {}, Br = !1, Array.isArray(Yr) && (Br = Yr.some((H) => H.type === "image" || H.type === "nine_patch_image") || !!T, !Br)) {
const H = xo(Yr);
ri["background-color"] = H.color, ri["background-image"] = H.image, ri["background-size"] = H.size, ri["background-position"] = H.position, ri["background-repeat"] = "no-repeat";
}
y = void 0, a && v.id && v.json.transition_in && o.isRunning("stateChange") && (y = !0), D = void 0, a && v.id && o.isRunning("stateChange") && pt.hasTransition