"use strict"; (self.webpackChunk_N_E = self.webpackChunk_N_E || []).push([ [8905], { 55349: (e, t, l) => { l.d(t, { X: () => u }); var i = l(25771), n = l(85151), a = l(34438), r = l(30008), s = l(20622), o = l(51529), d = l(10407); let c = { position: "absolute", inset: 0, zIndex: 0, borderRadius: 9999, padding: 1, boxSizing: "border-box", background: "linear-gradient(90deg, #FFA052 0%, #E046A4 45.38%, #6851EB 100%)", WebkitMask: "linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)", WebkitMaskComposite: "xor", maskImage: "linear-gradient(#fff 0 0), linear-gradient(#fff 0 0)", maskComposite: "exclude", pointerEvents: "none" }, u = e => { let { fixed: t = !1 } = e, { t: l } = (0, n.Bd)(), { active: u } = r.Z.useDress(); if (!u) return null; let { avatar: m, name: p, thumbnailUrl: h, imageUrl: x } = u, b = (0, d.f_)(m, { size: "small" }), f = (0, d.f_)(h.trim() || x.trim(), { size: "small" }); return (0, i.jsxs)(a.P.div, { layout: "size", transition: { layout: { duration: .22, ease: [.25, .1, .25, 1] } }, className: (0, o.cn)("relative inline-flex items-center rounded-full border border-transparent bg-black/22 backdrop-blur-md", t ? "h-10 px-2.5" : "h-12 px-3"), children: [(0, i.jsx)("div", { "aria-hidden": !0, className: "absolute inset-0 rounded-full", style: c }), (0, i.jsxs)("div", { className: (0, o.cn)("relative z-1 flex items-center", t ? "gap-2" : "gap-3"), children: [(0, i.jsx)(s.e, { src: b, size: t ? 20 : 24, alt: p, className: "shrink-0" }), (0, i.jsx)("span", { className: (0, o.cn)("text-white", t ? "text-xs" : "text-sm"), children: l("components.liveShare.nowActive") }), (0, i.jsx)("div", { className: (0, o.cn)("w-px bg-white/20", t ? "h-2.5" : "h-3"), "aria-hidden": !0 }), (0, i.jsxs)("span", { className: (0, o.cn)("max-w-25 min-w-0 truncate font-medium text-white/65", t ? "text-xs" : "text-sm"), children: ["@", p] }), f ? (0, i.jsx)("img", { src: f, alt: "", width: 32, height: 32, className: (0, o.cn)("shrink-0 rounded-[4px] border border-white/20 object-cover", t ? "size-7" : "size-8"), loading: "lazy", decoding: "async" }) : (0, i.jsx)("div", { className: (0, o.cn)("shrink-0 rounded-[4px] border border-white/20 bg-white/10", t ? "size-7" : "size-8"), "aria-hidden": !0 })] })] }) } }, 88905: (e, t, l) => { l.r(t), l.d(t, { DressLive: () => eH }); var i = l(25771), n = l(87163), a = l(85151), r = l(73860), s = l(58885), o = l(88355), d = l(31164), c = l(34438), u = l(95113), m = l(41377), p = l(35104), h = l(30008), x = l(15913), b = l(53215), f = l(28858), v = l(2471), g = l(29112), w = l(10407), y = l(89232), j = l(49855), k = l(39502); function N() { var e, t, l, i; let { liveInfo: a } = h.Z.useOptions(), { active: r } = h.Z.useDress(), s = null != (l = null != r ? r : null == a || null == (e = a.extra) ? void 0 : e.nowActive) ? l : null, o = (null == s ? void 0 : s.thumbnailUrl) || (null == s ? void 0 : s.imageUrl) || "", d = null != (i = null == s ? void 0 : s.source) ? i : "", c = null == a || null == (t = a.preset_info) ? void 0 : t.preset_id, u = null == a ? void 0 : a.db_session_id; return (0, n.useCallback)(e => { let { shareType: t, shareChannel: l, shareText: i, imageUrl: n } = e; (0, k.u4)({ key: k.yW.REALTIME_CLICK_SHARE_BUTTON, params: { [k.pX.SHARE_TYPE]: t, [k.pX.SHARE_CHANNEL]: l, [k.pX.SHARE_TEXT]: i, [k.pX.PRESET_ID]: null == c ? "" : String(c), [k.pX.SESSION_ID]: null == u ? "" : String(u), [k.pX.IMAGE_URL]: function(e) { let t = null == e ? void 0 : e.trim(); return t ? t.startsWith("data:") || t.startsWith("blob:") ? t : (0, w.f_)(t, { size: "small" }) : "" }(n || o), [k.pX.REALTIME_MODEL]: "V", [k.pX.QUEUE_SOURCE]: d } }) }, [o, c, d, u]) } var _ = l(51732), C = l(28906), S = l(43143), T = l(65319), E = l(22811), I = l(45502), z = l(42348), A = l(39651), U = l(75844), L = l(51529), M = l(55349), P = l(5587); let D = e => { let { fixed: t = !1 } = e, l = (0, g.a)(), { queue: n } = h.Z.useDress(), a = (null == n ? void 0 : n.length) ? (0, i.jsx)("div", { className: (0, L.cn)("w-full overflow-hidden", t ? "pt-4 pb-1" : "pt-7 pb-2"), children: (0, i.jsx)(U.A, { speed: 36, children: n.map((e, l) => (0, i.jsx)("div", { className: t ? "mx-1" : "mx-1.5", children: (0, i.jsx)(P.x, { ...e, fixed: t }) }, "".concat(e.name, "-").concat(l))) }) }) : null; return (0, i.jsxs)("div", { className: (0, L.cn)("fixed top-0 right-0 left-0 z-1 flex w-full flex-col items-center overflow-hidden", t ? "py-1" : "py-2", (0, o.A)({ "top-header": l })), children: [(0, i.jsx)(M.X, { fixed: t }), a] }) }; var R = l(61086), O = l(90317), F = l(25038), q = l(69638), H = l(39270), X = l(8640), G = l(85237), B = l(75300), V = l(654), W = l(89984); let Z = ["shareCopyTemplate1", "shareCopyTemplate2", "shareCopyTemplate3", "shareCopyTemplate4", "shareCopyTemplate5", "shareCopyTemplate6", "shareCopyTemplate7", "shareCopyTemplate8"], K = ["worldCupShareCopyTemplate1", "worldCupShareCopyTemplate3", "worldCupShareCopyTemplate4", "worldCupShareCopyTemplate6", "worldCupShareCopyTemplate8"], Y = ["worldCupShareCopyTemplate2", "worldCupShareCopyTemplate5", "worldCupShareCopyTemplate7", "worldCupShareCopyTemplate9", "worldCupShareCopyTemplate10"], Q = [{ key: "instagram", labelKey: "sharePlatformInstagram", url: "https://www.instagram.com/", icon: (0, i.jsx)(G.J, { className: "text-lg" }), iconClassName: "bg-[linear-gradient(135deg,#7f4bff_0%,#ff3f8f_48%,#ffb13f_100%)]", shareMention: "@pixverse_official" }, { key: "tiktok", labelKey: "sharePlatformTiktok", url: "https://www.tiktok.com/", icon: (0, i.jsx)(function(e) { let t = "M19.589 6.686a4.793 4.793 0 0 1-3.77-4.245V2h-3.445v13.672a2.896 2.896 0 0 1-5.201 1.743 2.895 2.895 0 0 1 3.183-4.51v-3.5a6.329 6.329 0 0 0-5.394 10.692 6.33 6.33 0 0 0 10.857-4.424V8.687a8.182 8.182 0 0 0 4.773 1.526V6.79a4.831 4.831 0 0 1-1.003-.104z"; return (0, i.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": !0, ...e, children: [(0, i.jsx)("path", { d: t, fill: "#25f4ee", transform: "translate(-0.9 0.7)" }), (0, i.jsx)("path", { d: t, fill: "#fe2c55", transform: "translate(0.75 -0.45)" }), (0, i.jsx)("path", { d: t, fill: "white" })] }) }, { className: "size-5" }), iconClassName: "bg-black", shareMention: "@pixverse" }, { key: "x", labelKey: "sharePlatformX", url: "https://x.com/", icon: (0, i.jsx)(B.m, { className: "text-lg" }), iconClassName: "bg-black", shareMention: "@PixVerse_" }, { key: "facebook", labelKey: "sharePlatformFacebook", url: "https://www.facebook.com/", icon: (0, i.jsx)(function(e) { return (0, i.jsx)("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": !0, ...e, children: (0, i.jsx)("path", { fill: "white", d: "M13.453 23.691v-7.98H16.7l.673-3.667h-3.92v-1.297c0-1.938.761-2.683 2.728-2.683.611 0 1.103.015 1.386.045V4.784c-.536-.149-1.848-.298-2.608-.298-4.01 0-5.858 1.893-5.858 5.978v1.58H6.627v3.667h2.474v7.98h4.352z" }) }) }, { className: "size-5" }), iconClassName: "bg-[#1877f2]", shareMention: "@PixVerse" }]; function J(e, t) { return e ? e.startsWith("data:") || e.startsWith("blob:") ? e : (0, w.f_)(e, { size: t, otherDomainSkipOssProcess: !1 }) : "" } function $(e) { var t; return (t = e.videoUri) ? t.startsWith("data:") || t.startsWith("blob:") ? t : (0, w.f_)(t, { otherDomainSkipOssProcess: !0 }) : "" } function ee(e) { var t, l; return (null == e || null == (t = e.country_name) ? void 0 : t.trim()) || (null == e || null == (l = e.countryName) ? void 0 : l.trim()) || "" } function et(e) { let { state: t } = e, { t: l } = (0, a.Bd)(); return (0, i.jsxs)("div", { className: "relative h-full w-full overflow-hidden bg-black", children: [(0, i.jsx)("img", { src: W.dI, alt: "", className: "absolute inset-0 h-full w-full object-cover opacity-70", loading: "eager", decoding: "async" }), (0, i.jsx)("div", { className: "absolute inset-0 bg-black/38", "aria-hidden": !0 }), (0, i.jsxs)("div", { className: "absolute inset-0 flex flex-col items-center justify-center px-6 text-center", children: ["loading" === t || "idle" === t ? (0, i.jsx)("div", { className: "mb-4 size-8 animate-spin rounded-full border-2 border-white/18 border-t-white", "aria-hidden": !0 }) : null, (0, i.jsx)("p", { className: "text-sm leading-5 font-semibold text-white", children: l("components.liveShare.".concat("error" === t ? "businessErrorTitle" : "empty" === t ? "emptyHighlightTitle" : "loadingHighlight")) })] })] }) } function el(e) { var t, l, r, s, o, d, m, p, x; let { open: b, requestKey: v, queueId: w, backdropSrc: j, onOpenChange: k } = e, { t: _ } = (0, a.Bd)(), C = (0, g.a)(), { liveInfo: S } = h.Z.useOptions(), { userNumber: T } = h.Z.useData(), { active: E } = h.Z.useDress(), { getLiveHighlightShareUrl: I } = (0, f.nV)(), { recordShare: z } = (0, y.r)(), A = N(), U = (0, n.useRef)(null), M = (0, n.useRef)(0), P = (0, n.useRef)(""), D = (0, n.useRef)(""), G = j || W.dI, B = J(null == S || null == (t = S.preset_info) ? void 0 : t.character_image_url, "large"), el = null != (m = null != E ? E : null == S || null == (l = S.extra) ? void 0 : l.nowActive) ? m : null, [ei, en] = (0, n.useState)([]), [ea, er] = (0, n.useState)("live"), [es, eo] = (0, n.useState)(""), ed = function(e) { let { activeItems: t, fallbackImageSrc: l, characterImageSrc: i } = e, { t: r } = (0, a.Bd)(); return (0, n.useMemo)(() => t.map((e, n) => { var a; let s = J(e.imageUrl || e.thumbnailUrl, "large") || l, o = $(e); return { id: e.queueId, headline: r("components.liveShare.sharePreviewHeadline"), imageSrc: s, videoSrc: o, comparisonImages: { originalSrc: i, tryOnSrc: s }, queueItem: (a = t.length, { ...e, queueId: e.queueId, uid: e.uid, avatar: J(e.avatar, "small"), name: e.name, thumbnailUrl: J(e.thumbnailUrl, "small"), imageUrl: J(e.imageUrl, "small"), country_name: ee(e), timestamp: e.timestamp, outfitId: e.outfitId, isDefault: !0, status: e.status, revision: e.revision, videoUri: $(e), linePosition: n, queueTotal: a }) } }), [t, i, l, r]) }({ activeItems: ei, fallbackImageSrc: G, characterImageSrc: B }), ec = (0, n.useMemo)(() => ed.map(e => e.id).join("\x1f"), [ed]), eu = (0, n.useMemo)(() => { var e, t, l, i; let n = null != (i = null != T ? T : null == S ? void 0 : S.online_count) ? i : 0; return { title: (null == S || null == (e = S.preset_info) ? void 0 : e.title) || _("components.liveShare.roomTitle"), stats: _("components.liveShare.onlineStats", { onlineCount: (0, W.XU)(n) }), avatarSrc: null == S || null == (l = S.preset_info) || null == (t = l.creator) ? void 0 : t.avatar } }, [null == S ? void 0 : S.online_count, null == S || null == (s = S.preset_info) || null == (r = s.creator) ? void 0 : r.avatar, null == S || null == (o = S.preset_info) ? void 0 : o.title, _, T]), [em, ep] = (0, n.useState)(0), eh = ed.length > 0 ? Math.min(em, ed.length - 1) : 0, ex = ed[eh], eb = null == ex ? void 0 : ex.id, ef = !!(null == ex ? void 0 : ex.videoSrc), ev = eb ? "".concat(eb, "-").concat(v) : "", eg = eh > 0, ew = eh < ed.length - 1, ey = (null == ex ? void 0 : ex.queueItem.thumbnailUrl) || (null == ex ? void 0 : ex.queueItem.imageUrl) || (null == ex ? void 0 : ex.imageSrc) || "", ej = !!(null != (x = null == S ? void 0 : S.worldcupLeaderboard) ? x : null == S || null == (p = S.extra) ? void 0 : p.worldcupLeaderboard), ek = (0, n.useCallback)(() => { var e; return (null == ex ? void 0 : ex.id) ? I({ sessionId: null == S ? void 0 : S.db_session_id, presetId: null == S || null == (e = S.preset_info) ? void 0 : e.preset_id, queueId: ex.id, from: "landing_page" }) : "" }, [I, null == S ? void 0 : S.db_session_id, null == S || null == (d = S.preset_info) ? void 0 : d.preset_id, null == ex ? void 0 : ex.id]), eN = (0, n.useCallback)(() => { k(!1) }, [k]), e_ = (0, n.useCallback)(e => { var t, l; let i = ek(), n = ee(null == ex ? void 0 : ex.queueItem), a = null != (l = (t = ej ? n ? K : Y : Z)[Math.floor(Math.random() * t.length)]) ? l : t[0], r = [_("components.liveShare.".concat(a), { country: n }), null == e ? void 0 : e.shareMention, "⚽️\uD83D\uDD25", "#pixverselive"].filter(Boolean).join(" "); return { text: r, url: i, copyText: i ? "".concat(r, "\n").concat(i) : r } }, [ej, null == ex ? void 0 : ex.queueItem, ek, _]), eC = (0, n.useCallback)(async () => { let e = ek(); if (e) { if (A({ shareType: "share_highlight", shareChannel: "link", shareText: e, imageUrl: ey }), C && "undefined" != typeof navigator && "function" == typeof navigator.share) try { await navigator.share({ title: _("components.liveShare.shareHighlightTitle"), url: e }), z(); return } catch (e) { if (e instanceof DOMException && "AbortError" === e.name) return } await (0, V.Dk)(e), z(), H.o.success(_("components.discover.worldItemDetail.shareSuccess")) } }, [C, z, A, ey, ek, _]), eS = (0, n.useCallback)(async e => { let t = e_(e); A({ shareType: "share_highlight", shareChannel: e.key, shareText: t.copyText, imageUrl: ey }), await (0, V.Dk)(t.copyText), z(), H.o.success(_("components.discover.worldItemDetail.shareSuccess")), null != U.current && window.clearTimeout(U.current), U.current = window.setTimeout(() => { window.open(e.url, "_blank", "noopener,noreferrer"), U.current = null }, 1e3) }, [e_, z, A, ey, _]), eT = (0, n.useCallback)(() => { eg && ep(eh - 1) }, [eg, eh]), eE = (0, n.useCallback)(() => { ew && ep(eh + 1) }, [ew, eh]); (0, n.useEffect)(() => { en([]) }, [null == S ? void 0 : S.db_session_id]), (0, n.useEffect)(() => { (null == el ? void 0 : el.queueId) && en(e => { let t = e.findIndex(e => e.queueId === el.queueId); if (t >= 0) { let l = [...e]; return l[t] = { ...l[t], ...el }, l } return [...e, el].slice(-10) }) }, [el]), (0, n.useEffect)(() => { if (!b || 0 === v || M.current === v) return; if (0 === ed.length) return void ep(0); let e = w ? ed.findIndex(e => e.id === w) : -1; if (w && e < 0) return void ep(ed.length - 1); ep(e >= 0 ? e : ed.length - 1), M.current = v }, [ed, b, w, v]), (0, n.useEffect)(() => { var e, t; if (!b) { P.current = null != eb ? eb : "", D.current = ec; return } if (D.current === ec) { P.current = null != eb ? eb : ""; return } if (D.current = ec, 0 === ed.length) { P.current = "", ep(0); return } let l = P.current; if (!l) { P.current = eb || (null == (t = ed[ed.length - 1]) ? void 0 : t.id) || ""; return } let i = ed.findIndex(e => e.id === l); if (i >= 0) { P.current = l, i !== eh && ep(i); return } let n = ed.length - 1; P.current = (null == (e = ed[n]) ? void 0 : e.id) || "", eh !== n && ep(n) }, [ec, ed, b, eh, eb]), (0, n.useEffect)(() => { if (!b || !eb) { er("live"), eo(""); return } er("splash"), eo(""); let e = 0, t = window.requestAnimationFrame(() => { e = window.requestAnimationFrame(() => eo(ev)) }); if (!ef) return () => { window.cancelAnimationFrame(t), window.cancelAnimationFrame(e) }; let l = window.setTimeout(() => er("live"), W.gP); return () => { window.cancelAnimationFrame(t), window.cancelAnimationFrame(e), window.clearTimeout(l) } }, [b, ef, eb, ev]), (0, n.useEffect)(() => () => { null != U.current && window.clearTimeout(U.current) }, []), (0, n.useEffect)(() => { if (!b) return; let e = e => { if ("Escape" === e.key) { e.preventDefault(), eN(); return } if ("ArrowLeft" === e.key) { e.preventDefault(), eT(); return } "ArrowRight" === e.key && (e.preventDefault(), eE()) }; return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e) }, [eN, eE, eT, b]); let eI = ex ? "loaded" : "empty"; return (0, i.jsx)(u.N, { children: b ? (0, i.jsxs)(c.P.div, { className: "pointer-events-none fixed inset-0 z-50", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: .18, ease: [.25, .1, .25, 1] }, children: [(0, i.jsx)(c.P.button, { type: "button", className: "pointer-events-auto absolute inset-0 bg-black/10 max-sm:bg-black/70", "aria-label": _("components.liveShare.closeShareHighlight"), onClick: eN, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 } }), (0, i.jsxs)(c.P.aside, { className: "pointer-events-auto fixed top-4 right-4 flex max-h-[calc(100dvh-2rem)] w-[344px] max-w-[calc(100vw-2rem)] flex-col overflow-y-auto rounded-[22px] border border-white/10 bg-black/92 p-4 text-white shadow-[0_24px_80px_rgba(0,0,0,0.46)] max-sm:top-auto max-sm:right-0 max-sm:bottom-0 max-sm:left-0 max-sm:max-h-[92dvh] max-sm:w-full max-sm:max-w-none max-sm:rounded-t-[22px] max-sm:rounded-b-none max-sm:border-x-0 max-sm:border-b-0 max-sm:p-4 max-sm:pt-3", role: "dialog", "aria-modal": "true", "aria-label": _("components.liveShare.shareHighlightTitle"), initial: { opacity: 0, x: 18 * !C, y: 28 * !!C, scale: C ? 1 : .98 }, animate: { opacity: 1, x: 0, y: 0, scale: 1 }, exit: { opacity: 0, x: 18 * !C, y: 28 * !!C, scale: C ? 1 : .98 }, transition: { duration: .22, ease: [.25, .1, .25, 1] }, children: [(0, i.jsxs)("div", { className: "relative flex h-8 shrink-0 items-center justify-center px-10", children: [(0, i.jsx)("h2", { className: "min-w-0 truncate text-center text-xl leading-7 font-semibold text-white", children: _("components.liveShare.shareHighlightTitle") }), (0, i.jsx)("button", { type: "button", className: "absolute top-0 right-0 flex size-8 shrink-0 items-center justify-center rounded-full bg-white/10 text-white/80 transition hover:bg-white/16 hover:text-white", "aria-label": _("components.liveShare.closeShareHighlight"), onClick: eN, children: (0, i.jsx)(R.A, { className: "size-4" }) })] }), (0, i.jsxs)("div", { className: "relative mt-5 flex shrink-0 items-center justify-center max-sm:mt-4", children: [(0, i.jsx)("button", { type: "button", className: "absolute left-0 z-10 flex size-8 items-center justify-center rounded-full bg-white/12 text-white/80 transition hover:bg-white/18 hover:text-white disabled:cursor-not-allowed disabled:opacity-35", "aria-label": _("components.liveShare.previousHighlight"), disabled: !eg, onClick: eT, children: (0, i.jsx)(O.A, { className: "size-5" }) }), (0, i.jsx)("div", { className: "aspect-9/16 w-[216px] rounded-[18px] bg-[linear-gradient(135deg,#ff915f_0%,#ec4cbc_48%,#7057ff_100%)] p-[2px] max-sm:w-[198px] max-sm:max-w-[calc(100vw-7rem)]", children: (0, i.jsx)("div", { className: "h-full overflow-hidden rounded-[16px] bg-black", children: ex ? (0, i.jsxs)(W.v3, { phase: ea, scaleMode: "fit-width", splashBackgroundSrc: W.dI, liveMedia: ex.videoSrc ? (0, i.jsx)(W.w3, { active: b && "live" === ea, src: ex.videoSrc, preload: "auto" }, ex.id) : (0, i.jsx)("img", { src: ex.imageSrc, alt: "", className: "h-full w-full object-cover", loading: "eager", decoding: "async" }), children: ["splash" === ea ? (0, i.jsxs)(i.Fragment, { children: [(0, i.jsx)(W.P2, { images: ex.comparisonImages }), (0, i.jsx)(W.nR, { queueItem: ex.queueItem }), (0, i.jsx)(W.Y9, { started: es === ev }, ev)] }) : null, (0, i.jsx)(W.W8, { phase: ea, room: eu }), (0, i.jsx)(W.FM, { phase: ea, headline: ex.headline })] }) : (0, i.jsx)(et, { state: eI }) }) }), (0, i.jsx)("button", { type: "button", className: "absolute right-0 z-10 flex size-8 items-center justify-center rounded-full bg-white/12 text-white/80 transition hover:bg-white/18 hover:text-white disabled:cursor-not-allowed disabled:opacity-35", "aria-label": _("components.liveShare.nextHighlight"), disabled: !ew, onClick: eE, children: (0, i.jsx)(F.A, { className: "size-5" }) })] }), C ? null : (0, i.jsxs)("div", { className: "mt-5 rounded-2xl border border-white/10 bg-white/8 p-4", children: [(0, i.jsxs)("div", { className: "flex items-center gap-3", children: [(0, i.jsx)("div", { className: "h-px flex-1 bg-white/10", "aria-hidden": !0 }), (0, i.jsx)("p", { className: "shrink-0 text-xs leading-4 text-white/72", children: _("components.liveShare.shareTo") }), (0, i.jsx)("div", { className: "h-px flex-1 bg-white/10", "aria-hidden": !0 })] }), (0, i.jsx)("div", { className: "mt-4 grid grid-cols-4 gap-3", children: Q.map(e => (0, i.jsxs)("button", { type: "button", className: "flex min-w-0 flex-col items-center gap-2 text-white/72 transition hover:text-white disabled:cursor-not-allowed disabled:opacity-35", "aria-label": _("components.liveShare.".concat(e.labelKey)), disabled: !ex, onClick: () => { eS(e) }, children: [(0, i.jsx)("span", { className: (0, L.cn)("flex size-9 items-center justify-center rounded-full", e.iconClassName), children: e.icon }), (0, i.jsx)("span", { className: "max-w-full truncate text-[10px] leading-3", children: _("components.liveShare.".concat(e.labelKey)) })] }, e.key)) })] }), (0, i.jsx)("div", { className: "mt-5 flex shrink-0 flex-col gap-3 pb-1 max-sm:mt-4 max-sm:pb-[calc(env(safe-area-inset-bottom)+0.25rem)]", children: (0, i.jsx)(X.$, { type: "secondary", size: "middle", shape: "round", icon: (0, i.jsx)(q.A, { className: "size-4" }), iconOpacity: !1, disabled: !ex, className: "h-10 w-full !border-0 !bg-white/8 px-4 text-sm font-semibold !text-white hover:!bg-white/12", onClick: eC, children: _("components.liveShare.copyLink") }) })] })] }, "share-highlight-panel") : null }) } var ei = l(98081), en = l(72564), ea = l(67036), er = l(50110), es = l(37468), eo = l(52766), ed = l(42696), ec = l(37203); let eu = "oss://", em = ["session", "preset"]; function ep(e) { return (null == e ? void 0 : e.trim()) || void 0 } function eh(e) { var t; return null != (t = ep(null == e ? void 0 : e.countryCode)) ? t : ep(null == e ? void 0 : e.country_code) } function ex(e) { var t; return null != (t = ep(null == e ? void 0 : e.countryName)) ? t : ep(null == e ? void 0 : e.country_name) } function eb(e) { var t; return null != (t = ep(null == e ? void 0 : e.flagUri)) ? t : ep(null == e ? void 0 : e.flag_uri) } function ef(e) { var t; return null != (t = ep(null == e ? void 0 : e.flagEmoji)) ? t : ep(null == e ? void 0 : e.flag_emoji) } function ev(e) { if ("number" == typeof e) return Number.isFinite(e) ? e : void 0; if ("string" == typeof e) { let t = e.trim(); if (!t) return; let l = Number(t); return Number.isFinite(l) ? l : void 0 } } function eg(e) { var t; return null != (t = ev(null == e ? void 0 : e.outfitId)) ? t : ev(null == e ? void 0 : e.outfit_id) } function ew(e) { return ey(e) } function ey(e, t) { var l, i, n, a, r, s, o, d, c, u; let m = null != (l = eh(e)) ? l : eh(t), p = null != (a = null != (n = null != (i = ex(e)) ? i : ex(t)) ? n : m) ? a : e.countryName, h = null != (r = eb(e)) ? r : eb(t), x = null != (s = ef(e)) ? s : ef(t), b = eg(e), f = eg(t), v = null != b ? b : f; return { ...e, ...m ? { countryCode: m } : {}, ...p ? { countryName: p } : {}, ...h ? { flagUri: h } : {}, ...x ? { flagEmoji: x } : {}, imageUrl: null != (o = e.imageUrl) ? o : null == t ? void 0 : t.imageUrl, thumbnailUrl: null != (d = e.thumbnailUrl) ? d : null == t ? void 0 : t.thumbnailUrl, sourceType: null != (c = e.sourceType) ? c : null == t ? void 0 : t.sourceType, ...null == v ? {} : { outfitId: v }, outfit_id: null != (u = e.outfit_id) ? u : null == t ? void 0 : t.outfit_id } } function ej(e) { var t, l, i; return null != (i = null != (l = null == e ? void 0 : e.worldcupLeaderboard) ? l : null == e || null == (t = e.extra) ? void 0 : t.worldcupLeaderboard) ? i : {} } function ek(e) { return e.map(ew).sort((e, t) => e.rank !== t.rank ? e.rank - t.rank : t.score - e.score) } function eN(e) { var t; if (e) return { ...e, items: ek(null != (t = e.items) ? t : []) } } function e_(e) { return { preset: eN(null == e ? void 0 : e.preset), session: eN(null == e ? void 0 : e.session) } } function eC(e) { let { rank: t } = e; if (t <= 3) { let e = 1 === t ? eo.A : 2 === t ? ed.W : ec.V; return (0, i.jsx)("span", { className: "mr-1 flex size-6 shrink-0 items-center justify-center", "aria-hidden": !0, children: (0, i.jsx)(e, { className: "text-2xl" }) }) } return (0, i.jsx)("span", { className: "mr-1 flex size-7 shrink-0 items-center justify-center text-base font-bold text-white/58", children: t }) } function eS() { return (0, i.jsx)("img", { src: "https://world-media.pixverse.ai/realtime/ranking3.png?x-oss-process=style/cover-webp", alt: "", className: "size-[60px] object-contain", "aria-hidden": !0, decoding: "async" }) } function eT(e) { var t; let { item: l } = e, n = function(e) { var t; let l = null != (t = null == e ? void 0 : e.trim()) ? t : ""; return l ? (0, w.f_)(l.startsWith(eu) ? l.slice(eu.length).replace(/^\/+/, "") : l, { size: "small" }) : "" }(l.flagUri), a = (null == (t = l.countryCode) ? void 0 : t.slice(0, 2)) || "--"; return n ? (0, i.jsx)("img", { src: n, alt: "", className: "mr-0.5 h-5 w-7 shrink-0 rounded", decoding: "async" }) : (0, i.jsx)("span", { className: "mr-0.5 flex h-5 w-7 shrink-0 items-center justify-center rounded bg-white/12 text-[10px] font-bold text-white", children: a }) } function eE(e) { var t, l, n; let { item: a, maxScore: r, scoreText: s, supportLabel: o, supportDisabled: d, supportLoading: c, onSupport: u } = e, m = a.rank <= 3, p = r > 0 ? Math.max(8, Math.min(100, a.score / r * 100)) : 8; return (0, i.jsxs)("li", { className: (0, L.cn)("flex h-[60px] items-center gap-2 rounded-[14px] border px-2.5", 1 === (n = a.rank) ? "border-white/[0.06] bg-[linear-gradient(110deg,rgba(255,142,42,0.18),rgba(255,255,255,0.055)_42%,rgba(255,255,255,0.025))] shadow-[inset_1px_0_0_rgba(255,142,42,0.16)]" : 2 === n ? "border-white/[0.06] bg-[linear-gradient(110deg,rgba(207,216,232,0.20),rgba(255,255,255,0.07)_42%,rgba(255,255,255,0.025))] shadow-[inset_1px_0_0_rgba(207,216,232,0.16)]" : 3 === n ? "border-white/[0.06] bg-[linear-gradient(110deg,rgba(116,28,55,0.34),rgba(76,16,38,0.18)_45%,rgba(255,255,255,0.025))] shadow-[inset_1px_0_0_rgba(116,28,55,0.24)]" : "border-white/10 bg-white/[0.035]"), children: [(0, i.jsx)(eC, { rank: a.rank }), (0, i.jsx)(eT, { item: a }), (0, i.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, i.jsx)("p", { className: "truncate text-sm leading-4 font-semibold text-white", children: null != (l = null != (t = a.countryName) ? t : a.countryCode) ? l : "--" }), (0, i.jsxs)("div", { className: "mt-0.5 flex items-center gap-1 text-xs leading-4 text-white/62", children: [(0, i.jsx)(ei.A, { className: (0, L.cn)("size-3.5", m ? "fill-orange-500 text-orange-500" : "") }), (0, i.jsx)("span", { children: s })] }), (0, i.jsx)("div", { className: "mt-0.5 h-0.5 w-[82%] max-w-[118px] rounded-full bg-white/8", children: (0, i.jsx)("div", { className: "h-full rounded-full bg-[linear-gradient(90deg,#ff8b2d_0%,#ffe85a_100%)]", style: { width: "".concat(p, "%") } }) })] }), (0, i.jsx)("button", { type: "button", className: (0, L.cn)("h-7 w-[72px] shrink-0 rounded-full border px-0 text-xs font-bold transition active:scale-95 disabled:cursor-not-allowed disabled:opacity-55 disabled:active:scale-100", m ? "border-emerald-400/80 bg-emerald-500/18 text-emerald-100 hover:bg-emerald-500/28" : "border-white/24 bg-white/8 text-white hover:bg-white/14"), disabled: d, "aria-busy": c, "aria-label": o, onClick: () => u(a), children: c ? (0, i.jsx)(en.A, { className: "mx-auto size-3.5 animate-spin", "aria-hidden": !0 }) : o })] }) } function eI(e) { var t, l; let { fixed: r, leaderboard: s, activeScope: o, onActiveScopeChange: d, activeSupportCountryCode: u, supportDisabled: m, supportLoading: p, onSupport: h, onClose: x } = e, { t: b } = (0, a.Bd)(), f = (0, n.useMemo)(() => new Intl.NumberFormat, []), v = ek(null != (l = null == (t = s[o]) ? void 0 : t.items) ? l : []), g = Math.max(0, ...v.map(e => e.score)); return (0, i.jsxs)(c.P.section, { role: r ? "dialog" : "complementary", "aria-modal": r, "aria-label": b("components.liveShare.worldCupLeaderboardTitle"), className: (0, L.cn)("pointer-events-auto relative overflow-visible text-white select-none", "max-h-[calc(100dvh-2rem)] w-[340px] max-w-[calc(100vw-2rem)]"), initial: r ? { opacity: 0, y: 26, scale: .9023999999999999 } : { opacity: 0, y: 18, scale: .9023999999999999 }, animate: { opacity: 1, y: 0, scale: .94 }, exit: r ? { opacity: 0, y: 18, scale: .9023999999999999 } : { opacity: 0, y: 14, scale: .9023999999999999 }, style: { transformOrigin: r ? "center" : "right bottom" }, transition: { duration: .22, ease: [.25, .1, .25, 1] }, children: [(0, i.jsxs)("div", { className: "relative overflow-hidden rounded-[20px] border border-white/12 bg-[#0f1012] shadow-[0_24px_80px_rgba(0,0,0,0.5)]", children: [(0, i.jsx)("img", { src: "https://world-media.pixverse.ai/realtime/world-cup-bg2.png?x-oss-process=style/cover-webp", alt: "", className: "pointer-events-none absolute -bottom-1 -left-1 z-0 block h-auto w-[calc(100%+8px)] max-w-none opacity-80", decoding: "async" }), (0, i.jsxs)("div", { className: "relative z-1 h-[76px] overflow-hidden rounded-t-[20px]", children: [(0, i.jsx)("img", { src: "https://world-media.pixverse.ai/realtime/world-cup-bg1.png?x-oss-process=style/cover-webp", alt: "", className: "h-full w-full object-cover", decoding: "async" }), (0, i.jsx)("div", { className: "absolute inset-0 bg-black/12" }), (0, i.jsx)("button", { type: "button", className: "absolute top-3 right-3 flex size-9 items-center justify-center rounded-full bg-black/50 text-white backdrop-blur-md transition hover:bg-black/68 active:scale-95", "aria-label": r ? b("components.liveShare.worldCupLeaderboardClose") : b("components.liveShare.worldCupLeaderboardCollapse"), onClick: x, children: r ? (0, i.jsx)(R.A, { className: "size-[18px]" }) : (0, i.jsx)(ea.A, { className: "size-[18px]" }) })] }), (0, i.jsx)("div", { className: "relative z-3 px-3 pt-0 pb-4", children: (0, i.jsxs)("div", { className: "relative z-3", children: [(0, i.jsx)("div", { className: "grid grid-cols-2 rounded-full bg-white/10 p-1", children: em.map(e => (0, i.jsx)("button", { type: "button", className: (0, L.cn)("h-8 rounded-full text-sm font-bold transition", o === e ? "bg-[linear-gradient(180deg,#18a85a_0%,#0b5b31_100%)] text-white" : "text-white/78 hover:bg-white/8"), onClick: () => d(e), children: b("session" === e ? "components.liveShare.worldCupLeaderboardToday" : "components.liveShare.worldCupLeaderboardAllTime") }, e)) }), (0, i.jsx)("div", { className: "mt-3 h-[400px] max-h-[calc(100dvh-220px)] overflow-y-auto [scrollbar-color:rgba(255,255,255,0.28)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-white/24 hover:[&::-webkit-scrollbar-thumb]:bg-amber-200/55 [&::-webkit-scrollbar-track]:rounded-full [&::-webkit-scrollbar-track]:bg-white/[0.04]", children: v.length ? (0, i.jsx)("ul", { className: "flex flex-col gap-2", children: v.map(e => { var t, l, n; return (0, i.jsx)(eE, { item: e, maxScore: g, scoreText: b("components.liveShare.worldCupLeaderboardHeat", { score: f.format(e.score) }), supportLabel: b("components.liveShare.worldCupLeaderboardSupport"), supportDisabled: m, supportLoading: p && u === e.countryCode, onSupport: h }, null != (n = null != (t = e.countryCode) ? t : eg(e)) ? n : "".concat(e.rank, "-").concat(null != (l = e.countryName) ? l : "")) }) }) : (0, i.jsxs)("div", { className: "flex min-h-40 flex-col items-center justify-center rounded-[14px] border border-white/10 bg-white/[0.035] px-5 text-center", children: [(0, i.jsx)(er.A, { className: "size-7 text-white/54" }), (0, i.jsx)("p", { className: "mt-3 text-xs leading-4 text-white/60", children: b("components.liveShare.worldCupLeaderboardEmpty") })] }) })] }) }), (0, i.jsx)("div", { className: "pointer-events-none relative z-1 aspect-[344/38] w-full" })] }), (0, i.jsx)("img", { src: "https://world-media.pixverse.ai/realtime/world-cup-football.png?x-oss-process=style/cover-webp", alt: "", className: "pointer-events-none absolute -right-3 -bottom-3 z-2 size-14 select-none", decoding: "async" })] }) } function ez(e) { var t, l, r; let { active: s, fixed: o, hidden: d = !1 } = e, { t: m } = (0, a.Bd)(), { liveInfo: p } = h.Z.useOptions(), { on: x, off: b } = h.Z.useEvents(), { activeCountryCode: f, handleSend: v, loading: g, sendDisabled: y, source: j } = (0, T.FM)(), [k, N] = (0, n.useState)(() => e_(ej(p))), [_, C] = (0, n.useState)("session"), [S, E] = (0, n.useState)(!0), [I, z] = (0, n.useState)(!1), A = null == p ? void 0 : p.db_session_id, U = null != (r = null == p ? void 0 : p.worldcupLeaderboard) ? r : null == p || null == (t = p.extra) ? void 0 : t.worldcupLeaderboard, L = (0, n.useMemo)(() => { var e, t = null == p || null == (e = p.extra) ? void 0 : e.defaultImages; let l = new Map; return null == t || t.forEach(e => { var t; let i = null != (t = ev(e.outfitId)) ? t : ev(e.outfit_id); null == i || l.has(i) || l.set(i, e) }), l }, [null == p || null == (l = p.extra) ? void 0 : l.defaultImages]), M = (0, n.useMemo)(() => e_(U), [U]), P = g && "worldcup-ranking" === j, D = P ? f : void 0, R = m("components.liveShare.worldCupLeaderboardMissingSupportInfo"); (0, n.useEffect)(() => { N(M), C("session"), z(!1), o || E(!0) }, [o, M, A]), (0, n.useEffect)(() => { if (!s || d || !A) return; let e = !1, t = !1, l = async () => { if (!t) { t = !0; try { let t = await (0, es.gf)({ sessionId: A }); e || N(e_(ej(t))) } catch (e) { return } finally { t = !1 } } }, i = window.setInterval(() => { l() }, 2e4); return () => { e = !0, window.clearInterval(i) } }, [s, d, A]), (0, n.useEffect)(() => { if (!s || d) return; let e = e => { N(t => (function(e, t) { var l, i; let n = t.scope; if (!em.includes(n)) return e; let a = eh(t); if (!a) return e; let r = e[n]; if ((null == r ? void 0 : r.revision) != null && t.revision < r.revision) return e; let s = null != (l = null == r ? void 0 : r.items) ? l : [], o = s.findIndex(e => eh(e) === a), d = -1 === o ? void 0 : s[o], c = null != (i = eg(t)) ? i : eg(d), u = ey({ countryCode: a, countryName: ex(t), flagUri: eb(t), flagEmoji: ef(t), score: t.score, rank: t.rank, ...null == c ? {} : { outfitId: c }, outfit_id: t.outfit_id, imageUrl: t.imageUrl, thumbnailUrl: t.thumbnailUrl, sourceType: t.sourceType }, d), m = -1 === o ? [...s, u] : s.map((e, t) => t === o ? u : e); return { ...e, [n]: { revision: t.revision, items: ek(m) } } })(t, e)) }; return x("worldcup_leaderboard_delta", e), () => { b("worldcup_leaderboard_delta", e) } }, [s, d, b, x]); let O = e => { let t = eg(e); if (null == t) return void H.o.error(R); o && z(!1); let l = L.get(t), { imageUrl: i, thumbnailUrl: n } = function(e) { var t, l, i, n; let a = null != (i = null == (t = e.imageUrl) ? void 0 : t.trim()) ? i : "", r = null != (n = null == (l = e.thumbnailUrl) ? void 0 : l.trim()) ? n : "", s = r ? (0, w.f_)(r) : "", o = a ? (0, w.f_)(a) : s; return { imageUrl: o, thumbnailUrl: s || o } }(null != l ? l : e); v({ outfitId: t, imageUrl: i, thumbnailUrl: n, source: "worldcup-ranking", countryCode: e.countryCode, countryName: e.countryName }) }; return !s || d ? null : o ? (0, i.jsxs)(i.Fragment, { children: [(0, i.jsx)("button", { type: "button", className: "flex size-[60px] items-center justify-center p-0 transition duration-200 ease-out hover:scale-105 active:scale-95", "aria-label": m("components.liveShare.worldCupLeaderboardOpen"), onClick: () => z(!0), children: (0, i.jsx)(eS, {}) }), (0, i.jsx)(u.N, { children: I ? (0, i.jsx)(c.P.div, { className: "fixed inset-0 z-40 flex items-center justify-center bg-black/62 px-4 py-4", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: .18 }, children: (0, i.jsx)(eI, { fixed: !0, leaderboard: k, activeScope: _, onActiveScopeChange: C, activeSupportCountryCode: D, supportDisabled: y, supportLoading: P, onSupport: O, onClose: () => z(!1) }) }) : null })] }) : (0, i.jsxs)(i.Fragment, { children: [(0, i.jsx)(u.N, { children: S ? (0, i.jsx)("div", { className: "fixed right-4 bottom-4 z-20", children: (0, i.jsx)(eI, { fixed: !1, leaderboard: k, activeScope: _, onActiveScopeChange: C, activeSupportCountryCode: D, supportDisabled: y, supportLoading: P, onSupport: O, onClose: () => E(!1) }) }) : null }), S ? null : (0, i.jsx)("button", { type: "button", className: "flex size-[60px] items-center justify-center rounded-full p-0 transition duration-200 ease-out hover:scale-105 active:scale-95", "aria-label": m("components.liveShare.worldCupLeaderboardOpen"), onClick: () => E(!0), children: (0, i.jsx)(eS, {}) })] }) } var eA = l(11866), eU = l(89997); let eL = "realtime_web_world_cup_share_guide_dismissed", eM = (0, w.f_)("/realtime/world-cup-bg-1.png"); function eP(e) { let { fixed: t, onClose: l, onGenerate: r } = e, { t: s } = (0, a.Bd)(), o = (0, n.useMemo)(() => [{ title: s("components.liveShare.worldCupShareGuideStep1Title"), description: s("components.liveShare.worldCupShareGuideStep1Description") }, { title: s("components.liveShare.worldCupShareGuideStep2Title"), description: s("components.liveShare.worldCupShareGuideStep2Description") }, { title: s("components.liveShare.worldCupShareGuideStep3Title"), description: s("components.liveShare.worldCupShareGuideStep3Description") }], [s]); return (0, i.jsxs)(c.P.section, { role: "dialog", "aria-modal": t, "aria-label": s("components.liveShare.worldCupShareGuideTitle"), className: (0, L.cn)("pointer-events-auto relative max-h-[calc(100dvh-1.5rem)] w-full overflow-y-auto border border-white/14 bg-[#0f1012] text-white shadow-[0_24px_80px_rgba(0,0,0,0.48)]", "rounded-[20px]", t ? "max-w-[340px]" : "w-[410px]"), initial: t ? { opacity: 0, y: 26, scale: .9023999999999999 } : { opacity: 0, x: -10, y: 12, scale: .592 }, animate: { opacity: 1, x: 0, y: 0, scale: t ? .94 : .8 }, exit: t ? { opacity: 0, y: 18, scale: .9023999999999999 } : { opacity: 0, x: -8, y: 18, scale: .288 }, style: { transformOrigin: t ? "center" : "right bottom" }, transition: { duration: .22, ease: [.25, .1, .25, 1] }, children: [(0, i.jsxs)("div", { className: "relative aspect-[552/143] overflow-hidden rounded-t-[20px]", children: [(0, i.jsx)("img", { src: eM, alt: "", className: "h-full w-full", decoding: "async" }), (0, i.jsx)("button", { type: "button", className: (0, L.cn)("absolute z-2 flex items-center justify-center rounded-full bg-white text-black shadow-[0_10px_24px_rgba(0,0,0,0.28)] transition hover:scale-105 active:scale-95", t ? "top-2.5 right-2.5 size-8" : "top-2 right-2 size-7"), "aria-label": s("components.liveShare.worldCupShareGuideClose"), onClick: l, children: (0, i.jsx)(R.A, { className: t ? "size-4" : "size-3.5" }) })] }), (0, i.jsxs)("div", { className: (0, L.cn)("text-center", t ? "px-4 pt-4 pb-4" : "px-4 pt-3.5 pb-4"), children: [(0, i.jsx)("h2", { className: (0, L.cn)("font-bold", t ? "text-xl leading-6" : "text-2xl leading-8"), children: s("components.liveShare.worldCupShareGuideTitle") }), (0, i.jsx)("p", { className: (0, L.cn)("text-white/60", t ? "mt-2 text-sm leading-5" : "mt-1 text-sm leading-5 whitespace-nowrap"), children: s("components.liveShare.worldCupShareGuideDescription") }), (0, i.jsx)("div", { className: (0, L.cn)("flex flex-col text-left", t ? "mt-4 gap-2" : "mt-3 gap-1.5"), children: o.map((e, l) => (0, i.jsxs)("div", { className: (0, L.cn)("flex items-center border border-white/10 bg-white/[0.055]", t ? "gap-2.5 rounded-xl px-2.5 py-2" : "gap-2 rounded-xl px-2 py-1.5"), children: [(0, i.jsx)("span", { className: (0, L.cn)("flex shrink-0 items-center justify-center rounded-full border border-white/10 bg-white/8 font-bold text-white", t ? "size-6 text-xs" : "size-5 text-xs"), children: l + 1 }), (0, i.jsxs)("span", { className: "min-w-0", children: [(0, i.jsx)("span", { className: (0, L.cn)("block text-white", t ? "text-sm leading-5" : "text-xs leading-4"), children: e.title }), (0, i.jsx)("span", { className: (0, L.cn)("mt-0.5 block text-white/50", "text-xs leading-4"), children: 2 === l ? (0, i.jsx)("a", { href: "https://x.com/PixVerse_", target: "_blank", rel: "noreferrer", className: "inline-block bg-[linear-gradient(90deg,#ff9a63_0%,#d152ff_56%,#6c6cff_100%)] bg-clip-text text-transparent underline decoration-[#7b6cff] underline-offset-2 transition hover:brightness-110", children: e.description }) : e.description })] })] }, e.title)) }), (0, i.jsx)("button", { type: "button", className: (0, L.cn)("flex w-full items-center justify-center rounded-full bg-white px-5 leading-6 font-bold text-black transition hover:bg-white/90 active:scale-[0.98]", t ? "mt-4 h-10 text-sm" : "mt-3 h-8 text-xs"), onClick: r, children: s("components.liveShare.worldCupShareGuideCta") }), (0, i.jsx)("p", { className: (0, L.cn)("text-left text-white/45", "mt-3 text-xs leading-4"), children: s("components.liveShare.worldCupShareGuideFootnote") })] })] }) } function eD(e) { let { active: t, fixed: l, buttonVisible: r, hoverOpen: s = !1, panelAnchorRef: o, buttonClassName: d, panelClassName: m, onHoverEnter: p, onHoverLeave: h, onHoverClose: x, onHoverPanelClose: b, onGenerate: f } = e, { t: v } = (0, a.Bd)(), [g, w] = (0, n.useState)(!1), [y, j] = (0, n.useState)(null), k = t && (g || s), N = !l && !!o; (0, n.useEffect)(() => { if (!t) return void w(!1); l || "1" === window.localStorage.getItem(eL) || w(!0) }, [t, l]); let _ = (0, n.useCallback)(function() { let e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; w(!1), !l && (window.localStorage.setItem(eL, "1"), null == x || x(), e && (null == b || b())) }, [l, x, b]), C = (0, n.useCallback)(() => { _(!0) }, [_]), S = (0, n.useCallback)(() => { _(), f() }, [_, f]); if ((0, n.useEffect)(() => { if (!N || !k) return void j(null); let e = 0, t = () => { e = 0; let t = null == o ? void 0 : o.current; if (!t) return void j(null); j(function(e) { let t = e.getBoundingClientRect(), l = window.innerWidth, i = window.innerHeight, n = Math.min(l - 8, Math.max(336, t.left - 12)); return { right: Math.max(8, l - n), bottom: Math.max(8, i - t.bottom) } }(t)) }, l = () => { e || (e = window.requestAnimationFrame(t)) }; return t(), window.addEventListener("resize", l), window.addEventListener("scroll", l, !0), () => { e && window.cancelAnimationFrame(e), window.removeEventListener("resize", l), window.removeEventListener("scroll", l, !0) } }, [o, k, N]), !t) return null; let T = k && !l && (!N || y) ? (0, i.jsxs)(c.P.div, { className: (0, L.cn)(N ? "fixed z-[100]" : "absolute z-40", !N && m), style: N && null != y ? y : void 0, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: .18 }, onMouseEnter: p, onMouseLeave: h, children: [N ? (0, i.jsx)("span", { className: "pointer-events-auto absolute top-0 h-full", style: { right: -12, width: 12 }, "aria-hidden": !0 }) : null, (0, i.jsx)(eP, { fixed: !1, onClose: C, onGenerate: S })] }, "world-cup-share-guide-desktop") : null, E = T && N && "undefined" != typeof document ? (0, eA.createPortal)((0, i.jsx)(u.N, { children: T }), document.body) : T; return (0, i.jsxs)(i.Fragment, { children: [r ? (0, i.jsx)(c.P.button, { type: "button", className: (0, L.cn)("flex items-center justify-center border text-white shadow-[0_10px_28px_rgba(0,0,0,0.36)] backdrop-blur-md transition active:scale-95", l ? "h-6 min-w-[46px] rounded-l-full rounded-r-none border-r-0 border-white/30 bg-black/42 px-1.5 text-[11px] leading-3 font-medium hover:bg-black/56" : "size-10 rounded-full border-white/16 bg-black/72 hover:bg-black/84", d), "aria-label": v("components.liveShare.worldCupShareGuideInfo"), onClick: () => w(!0), initial: { opacity: 0, y: 8, scale: .92 }, animate: { opacity: 1, y: 0, scale: 1 }, exit: { opacity: 0, y: 8, scale: .92 }, transition: { duration: .18, ease: [.25, .1, .25, 1] }, children: l ? (0, i.jsx)("span", { children: v("components.liveShare.worldCupShareGuideRulesLabel") }) : (0, i.jsx)(eU.A, { className: "size-5" }) }) : null, (0, i.jsxs)(u.N, { children: [k && l ? (0, i.jsx)(c.P.div, { className: "fixed inset-0 z-40 flex items-center justify-center bg-black/62 px-4 py-4", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: .18 }, children: (0, i.jsx)(eP, { fixed: !0, onClose: C, onGenerate: S }) }, "world-cup-share-guide-mobile") : null, N || l ? null : E] }), N && !l ? E : null] }) } let eR = e => { let { className: t, label: l } = e; return (0, i.jsx)("img", { src: "https://world-media.pixverse.ai/realtime/eran2.png?x-oss-process=style/cover-webp", alt: l, className: (0, L.cn)("translate-y-1 object-contain", t), decoding: "async", draggable: !1 }) }, eO = { duration: .18, ease: [.25, .1, .25, 1] }, eF = (0, m.default)(() => l.e(4643).then(l.bind(l, 54643)).then(e => e.ForLiveDressLive), { loadableGenerated: { webpack: () => [54643] }, ssr: !1 }); function eq(e) { var t, l, m, p, U, L; let { detailAudioMuted: M } = e, { t: P } = (0, a.Bd)(), R = (0, g.a)(), O = (0, r.A)(document.body), { sessionState: F } = h.Z.useData(), { liveInfo: q } = h.Z.useOptions(), { active: H } = h.Z.useDress(), { shareLiveItem: X } = (0, f.nV)(), { recordShare: G } = (0, y.r)(), B = N(), V = function() { var e, t, l, i, a; let { liveInfo: r } = h.Z.useOptions(), { active: s } = h.Z.useDress(), o = null != (i = null != s ? s : null == r || null == (e = r.extra) ? void 0 : e.nowActive) ? i : null, d = null == r || null == (t = r.preset_info) ? void 0 : t.preset_id, c = null == r ? void 0 : r.db_session_id, u = !!(null == o ? void 0 : o.isDefault), m = null != (a = null == o ? void 0 : o.source) ? a : ""; return (0, n.useCallback)(() => { var e, t, l; (0, k.u4)({ key: k.yW.REALTIME_CLICK_SHARE_BUTTON_START, params: { [k.pX.PRESET_ID]: null == d ? "" : String(d), [k.pX.SESSION_ID]: null == c ? "" : String(c), [k.pX.REALTIME_MODEL]: (null == r || null == (e = r.extra) ? void 0 : e.extraType) === j.fW.dress ? "V" : "R", [k.pX.OUTFIT_IMAGE_URI]: null != (t = null == o ? void 0 : o.imageUrl) ? t : "", [k.pX.OUTFIT_THUMBNAIL_URI]: null != (l = null == o ? void 0 : o.thumbnailUrl) ? l : "", [k.pX.OUTFIT_IS_DEFAULT]: +!!u, [k.pX.OUTFIT_DEFAULT_ID]: u && (null == o ? void 0 : o.outfitId) != null ? o.outfitId : "", [k.pX.QUEUE_SOURCE]: m } }) }, [null == o ? void 0 : o.imageUrl, null == o ? void 0 : o.outfitId, null == o ? void 0 : o.thumbnailUrl, u, null == r || null == (l = r.extra) ? void 0 : l.extraType, d, m, c]) }(), W = !!((null == O ? void 0 : O.width) && (null == O ? void 0 : O.width) < 980), [Z, { set: K }] = (0, s.A)(), Y = (0, I.I)(), { closePicker: Q, tap: J, tapQuickEmoji: $, togglePicker: ee } = Y, et = (0, n.useRef)(null), ei = (0, n.useRef)(null), en = (0, n.useRef)(null), ea = (0, n.useRef)(null), er = (0, n.useRef)(null), es = (0, n.useRef)(null), eo = (0, n.useRef)(null), [ed, ec] = (0, n.useState)(null), [eu, em] = (0, n.useState)(!1), [ep, eh] = (0, n.useState)(!1), [ex, eb] = (0, n.useState)(!1), [ef, ev] = (0, n.useState)(""), [eg, ew] = (0, n.useState)(0), [ey, ej] = (0, n.useState)(!1), [ek, eN] = (0, n.useState)(!1), [e_, eC] = (0, n.useState)(!1), eS = (0, d.E)(), eT = (0, r.A)(ei), eE = !!(null == O ? void 0 : O.width), eI = !!(W && (null == O ? void 0 : O.width) && O.width < 375), eA = !!(W && (null == O ? void 0 : O.height) && O.height < 700), eU = !!(W && (eu || Y.pickerOpen)), eL = !eU, eM = !W || !e_, eP = !!(null != (L = null == q ? void 0 : q.worldcupLeaderboard) ? L : null == q || null == (U = q.extra) ? void 0 : U.worldcupLeaderboard), eF = eP && eE, eq = W && (eU || eA) ? 1 : 2, eH = W && eI ? Y.quickEmojis.slice(0, 2) : Y.quickEmojis, eX = (null == eT ? void 0 : eT.width) ? -(eT.width - 40) : 0; (0, n.useEffect)(() => { ec(null) }, [null == q ? void 0 : q.db_session_id]), (0, n.useEffect)(() => { W || (eC(!1), es.current = null, er.current = null) }, [W]), (0, n.useEffect)(() => { eC(!1), es.current = null, er.current = null }, [null == q ? void 0 : q.db_session_id]); let eG = (0, n.useCallback)(e => { ec(t => null != t ? t : e) }, []), eB = (0, n.useCallback)(e => { em(e), e && eh(!1) }, []), eV = (0, n.useCallback)(() => { K(!1), em(!1), eh(!0), Q() }, [Q, K]), eW = (0, n.useCallback)(() => { K(!0), eh(!1) }, [K]), eZ = (0, n.useCallback)(e => { ev(e), ew(e => e + 1), eb(!0) }, []); (0, n.useEffect)(() => { var e, t, l; let i = null == q ? void 0 : q.db_session_id; eE && !W && null != i && eo.current !== i && (eo.current = i, eZ(null != (l = null == q || null == (t = q.extra) || null == (e = t.nowActive) ? void 0 : e.queueId) ? l : "")) }, [W, eE, null == q ? void 0 : q.db_session_id, null == q || null == (l = q.extra) || null == (t = l.nowActive) ? void 0 : t.queueId, eZ]); let eK = (0, n.useCallback)(async () => { var e; await (0, w.Zm)() && (V(), eZ(null != (e = null == H ? void 0 : H.queueId) ? e : "")) }, [null == H ? void 0 : H.queueId, eZ, V]), eY = (0, n.useCallback)(() => { null != ea.current && (window.clearTimeout(ea.current), ea.current = null) }, []); (0, n.useEffect)(() => () => { eY() }, [eY]); let eQ = (0, n.useCallback)(() => { eY(), ej(!1), eN(!0), eK() }, [eY, eK]), eJ = (0, n.useCallback)(() => { eY(), ej(!1), eN(!0), eK() }, [eY, eK]), e$ = (0, n.useCallback)(() => { eY(), eN(!1), ej(!0) }, [eY]), e0 = (0, n.useCallback)(() => { eY(), ea.current = window.setTimeout(() => { ej(!1), eN(!1), ea.current = null }, 260) }, [eY]), e1 = (0, n.useCallback)(() => { eY(), ej(!1), eN(!0) }, [eY]), e2 = (0, n.useCallback)(() => { eS.start({ scale: [1, 1.08, 1], filter: ["brightness(1)", "brightness(1.18)", "brightness(1)"], transition: { duration: .34, ease: [.25, .1, .25, 1] } }) }, [eS]), e5 = (0, n.useCallback)(() => { var e, t, l, i; B({ shareType: "share_room", shareChannel: "link", shareText: (0, f.VS)({ sessionId: null == q ? void 0 : q.db_session_id, liveType: null == q || null == (e = q.extra) ? void 0 : e.extraType, presetId: null == q || null == (t = q.preset_info) ? void 0 : t.preset_id, from: "share" }) }), G(), X({ sessionId: null == q ? void 0 : q.db_session_id, liveType: null == q || null == (l = q.extra) ? void 0 : l.extraType, presetId: null == q || null == (i = q.preset_info) ? void 0 : i.preset_id, from: "share" }) }, [null == q ? void 0 : q.db_session_id, null == q || null == (m = q.extra) ? void 0 : m.extraType, null == q || null == (p = q.preset_info) ? void 0 : p.preset_id, G, B, X]), e4 = (0, n.useCallback)(() => { eh(!1), ee() }, [ee]), e8 = (0, n.useCallback)(e => { eh(!1), J(e) }, [J]), e9 = (0, n.useCallback)(e => { eh(!1), $(e) }, [$]), e3 = (0, n.useCallback)(e => { es.current = e, eC(!0), K(!1), em(!1), Q() }, [Q, K]), e6 = (0, n.useCallback)(() => { es.current = null, eC(!1) }, []), e7 = (0, n.useCallback)(e => { W && ("mouse" !== e.pointerType || 1 === e.buttons) && (er.current = { pointerId: e.pointerId, startX: e.clientX, startY: e.clientY }) }, [W]), te = (0, n.useCallback)(e => { if (!W) return; let t = er.current; if (!t || t.pointerId !== e.pointerId) return; er.current = null; let l = e.clientX - t.startX, i = e.clientY - t.startY, n = Math.abs(l), a = Math.abs(i); if (n < 64 || n < 1.35 * a) return; let r = l < 0 ? "left" : "right"; if (!e_) return void e3(r); es.current !== r && e6() }, [W, e3, e_, e6]), tt = (0, n.useCallback)(() => { er.current = null }, []); (0, v.N)({ publisherUid: null == q ? void 0 : q.server_uid, active: "playing" === F, onCapture: eG }); let tl = (0, i.jsx)(_.V, { ref: et, fixed: !W, open: Z, onOpenChange: K, onFocusChange: eB, quickEmojis: eH, emojiDisabled: Y.disabled, pickerOpen: Y.pickerOpen, collapsed: !W && ep, onCollapse: eV, onExpand: eW, onPickerToggle: e4, onQuickEmojiTap: e9 }), ti = (0, i.jsx)(E.n, { emojis: Y.fullEmojis, recentEmojis: Y.recentEmojis, comboEntry: Y.activeSelfEntry, open: Y.pickerOpen, disabled: Y.disabled, animationEnabled: Y.animationEnabled, anchorRef: et, onSelect: e8, onClose: Y.closePicker }), tn = eP ? (0, i.jsx)(eR, { className: (0, o.A)("relative z-1 block", W ? "size-[60px]" : "size-16"), label: P("components.liveShare.worldCupShareIconLabel") }) : (0, i.jsx)("span", { className: "relative z-1 flex size-[21px] items-center justify-center leading-none", children: (0, i.jsx)(x.L, { className: "flex translate-x-px translate-y-[0.5px] text-[21px] leading-none text-white" }) }), ta = (0, i.jsx)(c.P.span, { className: "pointer-events-none absolute top-[-20%] bottom-[-20%] left-0 w-3 bg-white/70 blur-[1px]", "aria-hidden": !0, initial: { x: -24, rotate: 18, opacity: 0 }, animate: { x: [-24, 58], opacity: [0, .72, 0] }, transition: { duration: .8, ease: [.22, 1, .36, 1], repeat: 1 / 0, repeatDelay: 4.2 } }), tr = eP ? tn : (0, i.jsxs)(i.Fragment, { children: [ta, tn] }), ts = eP ? (0, o.A)("flex items-center justify-center overflow-visible bg-transparent text-white drop-shadow-[0_12px_26px_rgba(255,168,0,0.42)] transition duration-200 ease-out hover:scale-105 active:scale-95", "size-[60px] rounded-full") : "flex size-9 items-center justify-center overflow-hidden rounded-full bg-[linear-gradient(135deg,#ff8b57_0%,#eb4abf_52%,#7655f2_100%)] text-[21px] text-white shadow-[0_12px_30px_rgba(224,70,164,0.36)] transition duration-200 ease-out hover:scale-110 hover:brightness-110 active:scale-95", to = P(eP ? "components.liveShare.worldCupShareHighlightTitle" : "components.liveShare.shareHighlightTitle"); return (0, i.jsxs)(T.xN, { children: [(0, i.jsx)("div", { className: "pointer-events-none fixed inset-0 overflow-hidden", "aria-hidden": !0, children: ed ? (0, i.jsxs)(i.Fragment, { children: [(0, i.jsx)("img", { src: ed, alt: "", className: "absolute inset-0 h-full w-full scale-110 object-cover opacity-65", decoding: "async" }), (0, i.jsx)("div", { className: "absolute inset-0 bg-black/50 backdrop-blur-[96px]" }), (0, i.jsx)("div", { className: "bg-dress-live-backdrop-overlay absolute inset-0" })] }) : (0, i.jsx)("div", { className: "absolute inset-0 bg-black" }) }), (0, i.jsxs)("div", { className: (0, o.A)("relative h-dvh max-h-dvh overflow-hidden", W && "touch-pan-y"), onPointerDownCapture: e7, onPointerUpCapture: te, onPointerCancelCapture: tt, children: [W ? (0, i.jsx)(u.N, { initial: !1, children: eM ? (0, i.jsx)(c.P.div, { className: "pointer-events-none fixed inset-x-0 top-0 z-1", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: eO, children: (0, i.jsx)(D, { fixed: !0 }) }, "mobile-queue") : null }) : (0, i.jsx)(D, { fixed: !1 }), (0, i.jsxs)(c.P.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, className: "relative flex h-dvh max-h-dvh flex-col overflow-hidden", children: [W ? (0, i.jsx)(u.N, { initial: !1, children: eM ? (0, i.jsx)(c.P.div, { className: "fixed top-0 right-0 left-0 z-10", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: eO, children: (0, i.jsx)(z.W, { onShareClick: e5 }) }, "mobile-live-header") : null }) : (0, i.jsx)(z.W, { className: (0, o.A)(R ? "fixed top-0 right-0 left-0 z-10" : "shrink-0"), onShareClick: e5 }), (0, i.jsxs)("div", { className: (0, o.A)("relative z-0 mx-auto aspect-9/16 min-h-0 w-auto max-w-full overflow-hidden bg-transparent", W ? "absolute inset-x-0 top-2 h-[calc(100%-0.5rem)]" : "mt-2 h-full flex-1 self-center"), children: [(0, i.jsx)(A.B, { detailAudioMuted: M, fillScreen: W }), W ? null : eP ? (0, i.jsxs)("div", { className: "absolute right-4 bottom-4 z-20 flex flex-col items-center gap-2", children: [(0, i.jsx)(ez, { active: eF, fixed: !1, hidden: ex }), (0, i.jsxs)("div", { ref: en, className: "relative flex flex-col items-center gap-2", onMouseEnter: e$, onMouseLeave: e0, children: [(0, i.jsx)(eD, { active: eF, fixed: !1, buttonVisible: !1, hoverOpen: ey && !ek, panelAnchorRef: en, onHoverEnter: e$, onHoverLeave: e0, onHoverClose: e1, onHoverPanelClose: e2, onGenerate: eQ }), (0, i.jsx)(c.P.button, { type: "button", className: ts, "aria-label": to, animate: eS, onClick: eJ, children: tr })] })] }) : (0, i.jsx)(b.m, { content: to, side: "right", sideOffset: 4, contentClassName: "whitespace-nowrap font-medium", children: (0, i.jsx)("button", { type: "button", className: (0, o.A)("absolute z-20", ts, "right-4 bottom-4"), "aria-label": to, onClick: eK, children: tr }) })] }), W ? null : (0, i.jsx)("div", { className: "mx-auto shrink-0", children: (0, i.jsx)(S.Yq, { fixed: !1 }) }), W ? (0, i.jsx)(u.N, { initial: !1, children: eM ? (0, i.jsxs)(c.P.div, { className: "fixed right-0 bottom-0 left-0 z-10", initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: eO, children: [(0, i.jsx)(C.a, { open: Z, fixed: !1, emojiEntries: Y.visibleEntries, emojiAnimationEnabled: Y.animationEnabled, overlayVisibleCount: eq, compact: W }), (0, i.jsxs)("div", { className: "bg-background-third/80 relative rounded-t-[20px] border border-white/10 p-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] backdrop-blur-3xl", children: [(0, i.jsx)(u.N, { initial: !1, children: eL ? (0, i.jsx)(c.P.div, { className: "overflow-hidden", initial: { height: 0, opacity: 0 }, animate: { height: "auto", opacity: 1 }, exit: { height: 0, opacity: 0 }, transition: { duration: .2, ease: [.25, .1, .25, 1] }, children: (0, i.jsx)(S.Yq, { fixed: W, showInputTip: !eA }) }, "dress-layout") : null }), tl, ti] })] }, "mobile-bottom-controls") : null }) : (0, i.jsxs)(i.Fragment, { children: [(0, i.jsxs)(c.P.div, { ref: ei, className: "pointer-events-auto fixed bottom-2 left-2 z-30 flex min-h-0 flex-col items-start", animate: { x: ep ? eX : 0 }, transition: { duration: .22, ease: [.25, .1, .25, 1] }, children: [(0, i.jsx)(C.a, { open: Z, fixed: !0, emojiEntries: Y.visibleEntries, emojiAnimationEnabled: Y.animationEnabled, overlayVisibleCount: eq }), tl] }), ti] }), W && eM ? eP ? (0, i.jsxs)("div", { className: "fixed right-2 bottom-[calc(13.5rem+env(safe-area-inset-bottom))] z-30 flex flex-col items-end gap-1.5", children: [(0, i.jsx)(eD, { active: eF, fixed: !0, buttonVisible: !0, buttonClassName: "-mr-2", onGenerate: eQ }), (0, i.jsx)(ez, { active: eF, fixed: !0, hidden: ex }), (0, i.jsx)("button", { type: "button", className: ts, "aria-label": to, onClick: eJ, children: tr })] }) : (0, i.jsx)(b.m, { content: to, side: "right", sideOffset: 4, contentClassName: "whitespace-nowrap font-medium", children: (0, i.jsx)("button", { type: "button", className: (0, o.A)("fixed right-4 bottom-[calc(13.5rem+env(safe-area-inset-bottom))] z-30", ts), "aria-label": to, onClick: eK, children: tr }) }) : null] }), (0, i.jsx)(el, { open: ex, requestKey: eg, queueId: ef, backdropSrc: ed, onOpenChange: eb })] })] }) } function eH(e) { let { detailAudioMuted: t } = e; return (0, p.useSearchParams)().has("forlive") ? (0, i.jsx)(eF, { detailAudioMuted: t }) : (0, i.jsx)(eq, { detailAudioMuted: t }) } } } ]);