(self.webpackChunk_N_E = self.webpackChunk_N_E || []).push([ [729, 1831, 1964, 9116], { 8640: (e, t, r) => { "use strict"; r.d(t, { $: () => o }); var a = r(25771), n = r(87163), i = r(88355), l = r(37703), s = r(51529); let o = (0, n.forwardRef)((e, t) => { var r, n; let { className: o, style: d, children: c, type: u = "primary", size: h = "middle", shape: p = "default", icon: g, iconPosition: m = "start", iconOpacity: f = !0, loading: x, disabled: b, stopPropagation: v = !0, onClick: w, href: y, target: k, ring: _ = !1, ...j } = e; return (0, a.jsxs)("button", { ...j, ref: t, type: "button", className: (0, s.cn)("group/button relative flex items-center justify-center border-0 font-medium text-nowrap outline-none select-none", "gradient" === u ? "bg-create text-text-white-primary" : "secondary" === u ? "bg-button-secondary-normal text-text-white-secondary border-border-secondary border-t border-solid backdrop-blur-[32px]" : "bg-button-primary-normal text-text-grey-dark-primary", x || b ? "" : "secondary" === u ? "hover:bg-button-secondary-hover hover:text-text-white-primary" : "primary" === u ? "hover:bg-button-primary-hover" : "", "small" === h ? "h-8 gap-1.5 text-xs" : "large" === h ? "h-12 gap-3 text-base" : "h-10 gap-2.5 text-sm", c ? "small" === h ? "px-2" : "large" === h ? "px-6" : "px-4" : "aspect-square", "round" === p ? "rounded-full" : "small" === h ? "rounded-[8px]" : "large" === h ? "rounded-lg" : "rounded-[10px]", "start" === m ? "flex-row" : "flex-row-reverse", x || b ? "cursor-not-allowed opacity-50" : "cursor-pointer", o), style: d, onClick: e => { if (v && e.stopPropagation(), !x && !b) { if (y) return "_blank" === k ? void window.open(y, k) : void(window.location.href = y); null == w || w(e) } }, children: [_ ? (0, a.jsx)("span", { "aria-hidden": !0, className: "pointer-events-none", style: { position: "absolute", inset: 0, zIndex: 0, borderRadius: (r = p, n = h, "round" === r ? 9999 : "small" === n ? 8 : "large" === n ? 12 : 10), padding: .95, boxSizing: "border-box", background: "linear-gradient(133.79deg, rgba(255, 255, 255, 0.9) -7.85%, rgba(255, 255, 255, 0.358468) 9.73%, rgba(255, 255, 255, 0) 84.96%, rgba(255, 255, 255, 0.9) 100.63%)", 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" } }) : null, g || x ? (0, a.jsx)("span", { className: (0, i.A)("relative z-10 shrink-0", !(x || b) && f && "secondary" === u ? "opacity-60 group-hover/button:opacity-100" : "", "small" === h ? "text-lg" : "large" === h ? "text-2xl" : "text-xl"), children: x ? (0, a.jsx)(l.z, { className: "animate-spin" }) : g }) : null, c ? (0, a.jsx)("div", { className: "relative z-10 flex h-full shrink-0 items-center justify-center", children: c }) : null] }) }) }, 9116: (e, t, r) => { "use strict"; r.d(t, { P5: () => c, Pp: () => d, oh: () => u }); var a = r(31964); let n = null, i = null, l = new Set, s = new Set, o = e => { let { targetRoute: t, trigger: r, kind: n, status: i, cacheHit: l } = e, o = "".concat(r, ":").concat(t, ":").concat(n, ":").concat(i); s.has(o) || (s.add(o), (0, a.Yc)("realtime_entry_prefetch", { prefetch_trigger: r, prefetch_kind: n, prefetch_status: i, prefetch_cache_hit: l, target_route: t, target_module: (e => e.startsWith("/world-play") ? "WorldPlayRealtime" : e.startsWith("/preset-config") ? "RealtimeVideo" : "")(t) })) }, d = function(e) { let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "unknown"; if (!e) return Promise.resolve(); if (e.startsWith("/world-play")) { let a = !!n; return (o({ targetRoute: e, trigger: t, kind: "module", status: a ? "hit" : "started", cacheHit: a }), a) ? n || Promise.resolve() : (!n && (n = Promise.all([r.e(5390), r.e(6953), r.e(2699), r.e(3), r.e(1573), r.e(980), r.e(7173), r.e(5833), r.e(2728), r.e(5588), r.e(4611), r.e(1981), r.e(109), r.e(4617), r.e(445), r.e(4397), r.e(4233), r.e(7027), r.e(3474), r.e(1298), r.e(2321), r.e(7956), r.e(8917), r.e(1459), r.e(824), r.e(5278), r.e(7328), r.e(3809), r.e(4823), r.e(8948), r.e(314), r.e(3144), r.e(2241), r.e(5094), r.e(8858), r.e(4732), r.e(2245), r.e(1831)]).then(r.bind(r, 22245))), n).then(() => { o({ targetRoute: e, trigger: t, kind: "module", status: "success", cacheHit: !1 }) }).catch(r => { throw n = null, o({ targetRoute: e, trigger: t, kind: "module", status: "error", cacheHit: !1 }), r }) } if (e.startsWith("/preset-config")) { let a = !!i; return (o({ targetRoute: e, trigger: t, kind: "module", status: a ? "hit" : "started", cacheHit: a }), a) ? i || Promise.resolve() : (!i && (i = Promise.all([r.e(5390), r.e(6953), r.e(2699), r.e(3), r.e(1573), r.e(980), r.e(7173), r.e(5833), r.e(2728), r.e(5588), r.e(4611), r.e(1981), r.e(109), r.e(4617), r.e(445), r.e(4397), r.e(4233), r.e(7027), r.e(3474), r.e(1298), r.e(2321), r.e(7956), r.e(8917), r.e(1459), r.e(824), r.e(5278), r.e(7328), r.e(3809), r.e(4823), r.e(8948), r.e(314), r.e(3144), r.e(2241), r.e(5094), r.e(8858), r.e(4732), r.e(5929), r.e(1503), r.e(8329), r.e(2957), r.e(6422), r.e(5577), r.e(984), r.e(6733), r.e(4644)]).then(r.bind(r, 22957))), i).then(() => { o({ targetRoute: e, trigger: t, kind: "module", status: "success", cacheHit: !1 }) }).catch(r => { throw i = null, o({ targetRoute: e, trigger: t, kind: "module", status: "error", cacheHit: !1 }), r }) } return Promise.resolve() }, c = function(e, t) { let r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "unknown"; if (!t) return; let a = l.has(t); try { a || (l.add(t), e.prefetch(t)), o({ targetRoute: t, trigger: r, kind: "route_module", status: a ? "hit" : "started", cacheHit: a }) } catch (e) {} d(t, r).catch(() => {}) }, u = function(e) { let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "desktop_idle"; return (e => { let t = window; if ("function" == typeof t.requestIdleCallback) { let r = t.requestIdleCallback(e, { timeout: 1200 }); return () => { var e; return null == (e = t.cancelIdleCallback) ? void 0 : e.call(t, r) } } let r = globalThis.setTimeout(e, 0); return () => globalThis.clearTimeout(r) })(() => { d(e, t).catch(() => {}) }) } }, 10915: (e, t, r) => { "use strict"; r.d(t, { Bc: () => l, ZI: () => d, k$: () => o, m_: () => s }); var a = r(25771); r(87163); var n = r(43423), i = r(51529); function l(e) { let { delayDuration: t = 0, ...r } = e; return (0, a.jsx)(n.Kq, { "data-slot": "tooltip-provider", delayDuration: t, ...r }) } function s(e) { let { ...t } = e; return (0, a.jsx)(l, { children: (0, a.jsx)(n.bL, { "data-slot": "tooltip", ...t }) }) } function o(e) { let { ...t } = e; return (0, a.jsx)(n.l9, { "data-slot": "tooltip-trigger", ...t }) } function d(e) { let { className: t, sideOffset: r = 0, children: l, ...s } = e; return (0, a.jsx)(n.ZL, { children: (0, a.jsxs)(n.UC, { "data-slot": "tooltip-content", sideOffset: r, className: (0, i.cn)("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) px-3 py-1.5", "bg-background-alpha-primary rounded-[8px] border border-white/10 text-xs text-wrap text-white backdrop-blur-[400px]", "shadow-[0px_8px_12px_0px_rgba(0,0,0,0.4)]", t), ...s, children: [l, (0, a.jsx)(n.i3, { className: (0, i.cn)("z-50 size-2.5 translate-y-[calc(-50%)] rotate-45", "bg-background-alpha-primary fill-background-alpha-primary text-background-alpha-primary", "invisible") })] }) }) } }, 15266: (e, t, r) => { "use strict"; function a(e) { if (!e) return "***"; let t = String(e); if (t.length <= 8) return "***"; let r = t.substring(0, 4), a = t.substring(t.length - 4); return "".concat(r, "***").concat(a) } r.d(t, { Y: () => a }) }, 15388: (e, t, r) => { "use strict"; r.d(t, { Pn: () => a, Uk: () => n }); let a = 640, n = () => window.innerWidth <= a }, 21831: (e, t, r) => { "use strict"; r.d(t, { Iz: () => l, PN: () => s, YH: () => o, f1: () => i }); let a = "world_play_preset_cache", n = "world_play_ended_preset_id", i = e => { try { let t = window.sessionStorage.getItem(a), r = t ? JSON.parse(t) : {}; r[String(e.id)] = { cachedAt: Date.now(), preset: e }, window.sessionStorage.setItem(a, JSON.stringify(r)) } catch (e) {} }, l = e => { try { let t = window.sessionStorage.getItem(a); if (!t) return null; let r = JSON.parse(t)[String(e)]; if (!r || Date.now() - r.cachedAt > 3e5) return null; return r.preset } catch (e) { return null } }, s = e => { if (e) try { window.sessionStorage.setItem(n, String(e)) } catch (e) {} }, o = e => { if (!e) return !1; try { return window.sessionStorage.getItem(n) === String(e) } catch (e) { return !1 } } }, 29112: (e, t, r) => { "use strict"; r.d(t, { a: () => i }); var a = r(87163), n = r(15388); let i = () => { let [e, t] = (0, a.useState)(n.Uk); return (0, a.useEffect)(() => { let e = window.matchMedia("(max-width: ".concat(n.Pn, "px)")), r = e => t(e.matches); return t(e.matches), e.addEventListener("change", r), () => { e.removeEventListener("change", r) } }, []), e } }, 31153: (e, t, r) => { "use strict"; r.d(t, { F: () => l }); var a = r(25771), n = r(57425); let i = { body: '', viewBox: { left: 0, top: 0, width: 24, height: 24 }, left: 0, top: 0, width: 24, height: 24 }, l = e => (0, a.jsx)(n.In, { ...e, icon: i }) }, 31964: (e, t, r) => { "use strict"; r.d(t, { $S: () => c, Yc: () => p, c4: () => u, k4: () => g, re: () => h }); var a = r(15266), n = r(22199); let i = "realtime_launch_trace", l = () => { var e; return (null == (e = window.crypto) ? void 0 : e.randomUUID) ? window.crypto.randomUUID() : "".concat(Date.now().toString(36), "-").concat(Math.random().toString(36).slice(2, 10)) }, s = e => ({ ...e, launchMode: e.launchMode || "unknown", entrySource: e.entrySource || "unknown" }), o = () => { try { let e = window.sessionStorage.getItem(i); if (!e) return null; let t = JSON.parse(e); if (!t.launchTraceId || !t.startedAt) return null; if (Date.now() - t.startedAt > 18e5) return window.sessionStorage.removeItem(i), null; return s(t) } catch (e) { return null } }, d = e => { try { window.sessionStorage.setItem(i, JSON.stringify(s(e))) } catch (e) {} }, c = e => { let t = o(); if (!t) return null; let r = s({ ...t, ...e }); return d(r), r }, u = function() { var e; let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, r = o(); if (r) return c(t) || r; let a = s({ launchTraceId: l(), startedAt: Date.now(), launchMode: t.launchMode || "unknown", entrySource: t.entrySource || "unknown", targetRoute: t.targetRoute, pipeline: t.pipeline, presetId: t.presetId, reservationId: t.reservationId }); return d(a), p("realtime_entry_click", { pipeline: a.pipeline || "default", preset_id: null != (e = a.presetId) ? e : "", fallback_entry: !0 }), a }, h = () => (e => { var t; return e ? { launch_trace_id: e.launchTraceId, launch_mode: e.launchMode, entry_source: e.entrySource, target_route: e.targetRoute || "", launch_pipeline: e.pipeline || "", launch_preset_id: null != (t = e.presetId) ? t : "", launch_reservation_id: e.reservationId ? (0, a.Y)(e.reservationId) : "", launch_elapsed_ms: Date.now() - e.startedAt } : { launch_trace_id: "", launch_mode: "unknown", entry_source: "unknown", target_route: "", launch_pipeline: "", launch_preset_id: "", launch_reservation_id: "", launch_elapsed_ms: null } })(o()), p = function(e) { let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = arguments.length > 2 ? arguments[2] : void 0; (0, n.Zp)(e, { ...h(), ...t }, r) }, g = function() { var e; let t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, r = s({ launchTraceId: l(), startedAt: Date.now(), launchMode: t.launchMode || "unknown", entrySource: t.entrySource || "unknown", targetRoute: t.targetRoute, pipeline: t.pipeline, presetId: t.presetId, reservationId: t.reservationId }); return d(r), p("realtime_entry_click", { pipeline: r.pipeline || "default", preset_id: null != (e = r.presetId) ? e : "" }), r } }, 37703: (e, t, r) => { "use strict"; r.d(t, { z: () => l }); var a = r(25771); r(87163); var n = r(57425); let i = { body: '', viewBox: { left: 0, top: 0, width: 24, height: 24 }, left: 0, top: 0, width: 24, height: 24 }, l = e => { let { className: t = "", ...r } = e; return (0, a.jsx)("div", { className: t, style: { height: "1em", aspectRatio: 1 }, children: (0, a.jsx)(n.In, { ...r, icon: i, height: "1em" }) }) } }, 49999: e => { e.exports = { trigger: "SidebarLanguageSwitcher_trigger__XpTHq", menu: "SidebarLanguageSwitcher_menu__6JYHd", "sidebar-language-menu-enter": "SidebarLanguageSwitcher_sidebar-language-menu-enter__b0_Oz", menuHeader: "SidebarLanguageSwitcher_menuHeader__WKQVt", menuHeaderIcon: "SidebarLanguageSwitcher_menuHeaderIcon__EBnRd", menuHeaderCopy: "SidebarLanguageSwitcher_menuHeaderCopy__yFjCA", option: "SidebarLanguageSwitcher_option__bucAj", optionSelected: "SidebarLanguageSwitcher_optionSelected__ZSp3B", optionCode: "SidebarLanguageSwitcher_optionCode__qq6al" } }, 53215: (e, t, r) => { "use strict"; r.d(t, { m: () => l }); var a = r(25771), n = r(88355), i = r(10915); let l = e => { let { children: t, content: r, contentClassName: l, side: s, sideOffset: o } = e; return (0, a.jsxs)(i.m_, { children: [(0, a.jsx)(i.k$, { asChild: !0, children: t }), (0, a.jsx)(i.ZI, { className: (0, n.$)(l), side: s, sideOffset: o, children: r })] }) } }, 60876: (e, t, r) => { "use strict"; r.r(t), r.d(t, { AppNavigationShell: () => q }); var a = r(25771), n = r(88355), i = r(35104), l = r(29112), s = r(87163), o = r(85151), d = r(57425), c = r(51529); let u = { body: '', viewBox: { left: 0, top: 0, width: 24, height: 24 }, left: 0, top: 0, width: 24, height: 24 }, h = { body: '', viewBox: { left: 0, top: 0, width: 24, height: 24 }, left: 0, top: 0, width: 24, height: 24 }, p = { body: '\n\n\n', viewBox: { left: 0, top: 0, width: 24, height: 24 }, left: 0, top: 0, width: 24, height: 24 }; var g = r(69214), m = r(71146), f = r(25781); let x = [{ key: "gallery", labelKey: "navigation.gallery", icon: (0, a.jsx)(e => { let { className: t = "", ...r } = e; return (0, a.jsx)("div", { className: (0, c.cn)(t), style: { height: "1em", aspectRatio: 1 }, children: (0, a.jsx)(d.In, { ...r, icon: h, height: "1em" }) }) }, { className: "text-3xl" }), path: "/discover/gallery", handleClick: (e, t) => { t.push("/discover/gallery") }, isActive: e => e.startsWith("/discover/gallery") }, { key: "generate", labelKey: "navigation.create", icon: (0, a.jsx)(e => { let { className: t = "", ...r } = e; return (0, a.jsx)("div", { className: (0, c.cn)(t), style: { height: "1em", aspectRatio: 1 }, children: (0, a.jsx)(d.In, { ...r, icon: p, height: "1em" }) }) }, { className: "text-3xl" }), path: "/generate/", handleClick: (e, t) => { t.push("/generate/") }, isActive: e => e.startsWith("/generate") }, { key: "history", labelKey: "navigation.mine", icon: (0, a.jsx)(e => { let { className: t = "", ...r } = e; return (0, a.jsx)("div", { className: (0, c.cn)(t), style: { height: "1em", aspectRatio: 1 }, children: (0, a.jsx)(d.In, { ...r, icon: u, height: "1em" }) }) }, { className: "text-3xl" }), path: "/discover/history/worlds", pathMatch: e => e.startsWith("/discover/history"), handleClick: (e, t) => { let r = f.kH.getState().userInfo; if (!r.loading) return r.accountId ? t.push("/discover/history/worlds") : void(0, m.jL)("/generate/") }, isActive: e => e.startsWith("/discover/history") }], b = () => { let { t: e } = (0, o.Bd)(), { userInfo: t } = (0, f.kH)(), r = (0, g.kE)(), a = (0, i.usePathname)(), n = (0, s.useMemo)(() => x.map(t => ({ ...t, label: e(t.labelKey), badgeLabel: t.badgeLabelKey ? e(t.badgeLabelKey) : void 0 })), [e]), l = (0, s.useMemo)(() => n.filter(e => "invite" !== e.key), [n]), d = (0, s.useCallback)(e => { if (!(e.pathMatch && e.pathMatch(window.location.pathname))) e.path !== window.location.pathname && e.handleClick(t, r) }, [r, t]), c = (0, s.useMemo)(() => n.find(e => e.isActive(a)), [n, a]); return { options: n, mobileOptions: l, handleOptionClick: d, activeOption: c } }; var v = r(34438); let w = { duration: .32, ease: [.4, 0, .2, 1] }, y = e => { let { icon: t, label: r, isActive: i, badge: l, variant: s = "sidebar", onClick: o } = e, d = "sidebar" === s; return (0, a.jsxs)("button", { type: "button", "aria-current": i ? "page" : void 0, className: (0, n.$)("font-inherit relative flex cursor-pointer appearance-none flex-col items-center justify-center gap-[2px] border-0 bg-transparent p-0 text-inherit transition-colors hover:text-white", d ? "h-[68px] w-[90px]" : "min-w-14 px-1 py-0", i ? "text-white" : "text-text-white-secondary"), onClick: o, children: [d ? (0, a.jsx)(v.P.span, { "aria-hidden": !0, className: "pointer-events-none absolute right-0 bottom-0 left-0 h-px origin-center", style: { backgroundImage: "linear-gradient(270deg, #000000 0%, #F9F9F9 49.44%, #000000 100%)" }, initial: !1, animate: { opacity: +!!i, scaleX: +!!i }, transition: w }) : null, (0, a.jsx)("span", { className: "flex size-6 items-center justify-center text-2xl leading-none *:text-2xl! *:leading-none!", children: t }), l, (0, a.jsx)("span", { className: "text-[14px] leading-[18px] font-normal", children: r })] }) }, k = e => { let { label: t = "New", className: r } = e; return (0, a.jsxs)("span", { "aria-hidden": !0, className: (0, n.$)("pointer-events-none absolute flex h-[17px] w-7 items-center justify-center overflow-visible rounded-[5px] bg-[linear-gradient(108deg,#ff6a58_0%,#f055c8_48%,#7657ff_100%)] shadow-[0_2px_6px_rgba(224,70,164,0.35)]", r), children: [(0, a.jsx)("span", { "aria-hidden": !0, className: "absolute bottom-[-2px] left-[4px] h-1 w-1.5 bg-[#ff6a58] [clip-path:polygon(0_0,100%_0,0_100%)]" }), (0, a.jsx)("span", { className: "relative z-10 text-[9px] leading-none font-black text-white italic", children: t })] }) }, _ = ["/discover", "/generate"], j = e => _.some(t => e.startsWith(t)), C = () => { let e = (0, i.usePathname)(), t = (0, l.a)(), { mobileOptions: r, handleOptionClick: s } = b(), o = j(e); return t && o ? (0, a.jsxs)(a.Fragment, { children: [(0, a.jsx)("div", { className: (0, n.$)("fixed right-0 bottom-0 left-0 z-1001 flex items-center justify-around bg-black/60 py-2 text-xs text-white backdrop-blur-md", "pb-[env(safe-area-inset-bottom)]"), children: r.map(t => { let r = t.isActive(e); return (0, a.jsx)(y, { variant: "footer", icon: t.icon, label: t.label, isActive: r, badge: t.badgeLabel ? (0, a.jsx)(k, { label: t.badgeLabel, className: "-top-1 left-[calc(50%+8px)]" }) : void 0, onClick: () => s(t) }, t.key || t.label) }) }), (0, a.jsx)("div", { "aria-hidden": !0, className: "mt-auto h-[calc(58px+env(safe-area-inset-bottom))] shrink-0" })] }) : null }; var L = r(96187), N = r(53215), S = r(49855), I = r(11866), M = r(31153), H = r(44412), E = r(45413), R = r(21912), P = r(49999), W = r.n(P); let z = { cn: { label: "简体中文", shortLabel: "CN" }, en: { label: "English", shortLabel: "EN" }, hi: { label: "हिन्दी", shortLabel: "HI" }, pt: { label: "Portugu\xeas", shortLabel: "PT" }, id: { label: "Bahasa Indonesia", shortLabel: "ID" }, vi: { label: "Tiếng Việt", shortLabel: "VI" }, ru: { label: "Русский", shortLabel: "RU" }, ja: { label: "日本語", shortLabel: "JA" }, de: { label: "Deutsch", shortLabel: "DE" }, tr: { label: "T\xfcrk\xe7e", shortLabel: "TR" }, es: { label: "Espa\xf1ol", shortLabel: "ES" }, fr: { label: "Fran\xe7ais", shortLabel: "FR" }, th: { label: "ไทย", shortLabel: "TH" }, ko: { label: "한국어", shortLabel: "KO" } }, A = E.Q ? ["cn"] : [...R.Hg], K = e => "cn" === e ? "zh-CN" : "pt" === e ? "pt-BR" : e, B = () => { let { i18n: e, t } = (0, o.Bd)(), r = (0, f.kH)(e => { let { userInfo: t } = e; return !t.loading && !t.error && t.isHomeWhitelist }), [i, l] = (0, s.useState)(!1), [d, c] = (0, s.useState)(!1), [u, h] = (0, s.useState)({ bottom: 12, left: 104, maxHeight: 480 }), p = (0, s.useRef)(null), g = (0, s.useRef)(null), m = A.includes(e.resolvedLanguage) ? e.resolvedLanguage : E.Q ? "cn" : "en"; (0, s.useEffect)(() => { if (!i) return; let e = e => { var t, r; let a = e.target; (null == (t = p.current) ? void 0 : t.contains(a)) || (null == (r = g.current) ? void 0 : r.contains(a)) || l(!1) }, t = e => { "Escape" === e.key && l(!1) }; return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => { document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t) } }, [i]); let x = (0, s.useCallback)(() => { let e = p.current; if (!e) return; let t = e.getBoundingClientRect(), r = Math.min(window.innerHeight - 12, t.bottom); h({ bottom: window.innerHeight - r, left: Math.min(t.right + 12, window.innerWidth - 208 - 12), maxHeight: Math.min(420, Math.max(180, r - 12)) }) }, []); (0, s.useLayoutEffect)(() => { if (i) return x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x) }, [i, x]), (0, s.useEffect)(() => { let e = g.current; if (!i || !e) return; let t = t => { t.stopPropagation(); let r = e.scrollTop <= 0, a = e.scrollTop + e.clientHeight >= e.scrollHeight - 1; (t.deltaY < 0 && r || t.deltaY > 0 && a) && t.preventDefault() }; return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t) }, [i]); let b = (0, s.useCallback)(async t => { if (l(!1), t !== m && !E.Q) { c(!0); try { if ("en" !== t && "cn" !== t && !e.hasResourceBundle(t, "translation")) { let r = await (0, H.W)(t); e.addResourceBundle(t, "translation", r) } try { window.localStorage.setItem(R.NK, t) } catch (e) {} await e.changeLanguage(t), document.documentElement.lang = K(t) } finally { c(!1) } } }, [e, m]), v = i ? (0, a.jsxs)("div", { "aria-label": t("home.nav.language"), className: W().menu, id: "sidebar-language-menu", ref: g, role: "listbox", style: u, children: [(0, a.jsxs)("div", { className: W().menuHeader, role: "presentation", children: [(0, a.jsx)("span", { className: W().menuHeaderIcon, "aria-hidden": "true", children: (0, a.jsx)(M.F, {}) }), (0, a.jsxs)("span", { className: W().menuHeaderCopy, children: [(0, a.jsx)("strong", { children: t("home.nav.language") }), (0, a.jsx)("span", { children: t("home.nav.selectLanguage") })] })] }), A.map(e => { let t = e === m; return (0, a.jsxs)("button", { "aria-selected": t, className: (0, n.$)(W().option, t && W().optionSelected), lang: K(e), onClick: () => void b(e), role: "option", type: "button", children: [(0, a.jsx)("span", { children: z[e].label }), (0, a.jsx)("span", { className: W().optionCode, children: z[e].shortLabel })] }, e) })] }) : null; return r ? (0, a.jsxs)(a.Fragment, { children: [(0, a.jsx)(N.m, { content: t("home.nav.selectLanguage"), contentClassName: "z-1000", side: "right", sideOffset: 10, children: (0, a.jsx)("button", { "aria-controls": "sidebar-language-menu", "aria-expanded": i, "aria-haspopup": "listbox", "aria-label": t("home.nav.selectLanguage"), className: (0, n.$)("group flex h-[30px] w-11 cursor-pointer items-center justify-center rounded-sm border", W().trigger), disabled: d, onClick: () => l(e => !e), ref: p, type: "button", children: (0, a.jsx)(M.F, { "aria-hidden": "true", className: "h-5 w-5 opacity-60 transition-opacity group-hover:opacity-100" }) }) }), v && "undefined" != typeof document ? (0, I.createPortal)(v, document.body) : null] }) : null }; var D = r(99966), T = r.n(D); let $ = (0, L.F)(["fixed left-0 z-998", "bottom-0", "w-sidebar", "flex flex-col items-center justify-between"], { variants: { background: { default: "bg-background-primary", discover: "bg-black/50 backdrop-blur-xl" }, topPosition: { default: "top-header", generate: "top-0 pt-header" } }, defaultVariants: { background: "default" } }), F = () => { let { t: e } = (0, o.Bd)(), t = (0, i.usePathname)(), r = (0, g.kE)(), { options: d, handleOptionClick: c } = b(), u = (0, l.a)(), h = (0, s.useMemo)(() => t.startsWith("/discover") ? "discover" : "default", [t]), p = (0, s.useMemo)(() => j(t), [t]), m = (0, s.useMemo)(() => t.startsWith("/generate") ? "generate" : "default", [t]), f = { duration: .22, ease: [.4, 0, .2, 1] }; return u ? null : (0, a.jsxs)(a.Fragment, { children: [(0, a.jsxs)(v.P.aside, { "aria-hidden": !p, className: (0, n.$)($({ background: h, topPosition: m }), !p && "pointer-events-none"), initial: !1, animate: p ? { opacity: 1, x: 0 } : { opacity: 0, x: "-100%" }, transition: f, children: [(0, a.jsx)("div", { className: (0, n.$)("flex flex-col items-center gap-6 pt-6", T().primarySection), children: d.map(e => { let r = e.isActive(t), n = e.key || e.label; return (0, a.jsx)(y, { icon: e.icon, label: e.label, isActive: r, badge: e.badgeLabel ? (0, a.jsx)(k, { label: e.badgeLabel, className: "top-[15px] left-16" }) : void 0, onClick: () => c(e) }, n) }) }), (0, a.jsx)("div", { className: (0, n.$)("flex flex-col items-center", T().utilitySection), children: (0, a.jsxs)("div", { className: (0, n.$)("flex flex-col items-center gap-4", T().externalLinks), children: [(0, a.jsx)(B, {}), S.VQ.map(t => (0, a.jsx)(N.m, { contentClassName: "z-1000", content: e(t.labelKey, t.text), children: (0, a.jsx)("div", { className: "group flex h-[30px] w-11 cursor-pointer items-center justify-center rounded-sm border", onClick: () => (e => { var t; if (null == (t = e.url) ? void 0 : t.startsWith("http")) return void window.open(e.url, "_blank"); r.push(e.url) })(t), children: (0, a.jsx)("span", { className: "opacity-60 transition-opacity group-hover:opacity-100", children: t.icon }) }) }, t.labelKey))] }) })] }), (0, a.jsx)(v.P.div, { "aria-hidden": !0, className: "shrink-0 overflow-hidden", initial: !1, animate: p ? { width: "var(--spacing-sidebar)" } : { width: 0 }, transition: f })] }) }; var O = r(8640), V = r(28858), U = r(64672); let Z = (0, L.F)(["fixed top-0 right-0 left-0 z-999", "w-full h-header", " px-4", "flex items-center"], { variants: { background: { default: "", discover: "bg-background" } }, defaultVariants: { background: "default" } }), Y = () => { let { t: e } = (0, o.Bd)(), t = (0, i.usePathname)(), r = (0, V.kE)(), d = (0, l.a)(), c = (0, s.useMemo)(() => t.startsWith("/discover") || d ? "discover" : "default", [t, d]), u = (0, s.useMemo)(() => j(t), [t]), h = { duration: .22, ease: [.4, 0, .2, 1] }; return (0, a.jsxs)(a.Fragment, { children: [(0, a.jsxs)(v.P.header, { "aria-hidden": !u, className: (0, n.$)(Z({ background: c }), !u && "pointer-events-none", "flex items-center justify-between"), initial: !1, animate: u ? { opacity: 1, y: 0 } : { opacity: 0, y: "-100%" }, transition: h, children: [(0, a.jsx)(U.O, { redirect: !1, gradientPrefix: "home", className: "mr-5", height: 22 }), d && (0, a.jsx)("div", { className: "mr-2 flex items-center gap-2", children: S.VQ.map(t => (0, a.jsx)(O.$, { "aria-label": e(t.labelKey, t.text), onClick: () => (e => { var t; if (null == (t = e.url) ? void 0 : t.startsWith("http")) return void window.open(e.url, "_blank"); r.push(e.url) })(t), type: "secondary", shape: "round", className: (0, n.$)("flex cursor-pointer items-center justify-center rounded-full px-2 text-sm font-medium"), icon: t.icon }, t.labelKey)) })] }), (0, a.jsx)(v.P.div, { "aria-hidden": !0, className: "overflow-hidden", initial: !1, animate: u ? { height: "var(--spacing-header)" } : { height: 0 }, transition: h })] }) }, q = e => { let { children: t } = e; return (0, a.jsxs)("div", { className: "flex min-h-screen w-full flex-col", children: [(0, a.jsx)(Y, {}), (0, a.jsxs)("div", { className: "flex w-full flex-1", children: [(0, a.jsx)(F, {}), (0, a.jsx)("main", { className: "w-0 flex-1", children: t })] }), (0, a.jsx)(C, {})] }) } }, 64672: (e, t, r) => { "use strict"; r.d(t, { O: () => c }); var a = r(25771), n = r(34587), i = r(51529), l = r(45413); let s = { src: "/_next/static/media/logo1.fb030383.svg", height: 157, width: 1108, blurWidth: 0, blurHeight: 0 }, o = { src: "/_next/static/media/logo2.292e06a1.svg", height: 157, width: 845, blurWidth: 0, blurHeight: 0 }, d = { sm: "text-[20px]", md: "text-[24px]", lg: "text-[28px]" }; function c(e) { let { className: t, size: r = "md", redirect: c = !0, smallLogo: u, height: h = 28 } = e, p = d[r], g = (0, n.rx)(), m = "string" == typeof s ? s : s.src, f = "string" == typeof o ? o : o.src, x = (0, a.jsx)("div", { className: (0, i.cn)(p, t, "flex items-center"), children: (0, a.jsx)("img", { src: u ? f : m, alt: "", style: { height: h } }) }), b = (0, a.jsx)("div", { className: (0, i.cn)(p, t, "flex items-center"), children: (0, a.jsx)("img", { src: u ? m : f, alt: "", style: { height: h } }) }), v = l.Q ? b : x; return g && c ? (0, a.jsx)("a", { href: g, target: "_blank", rel: "noopener noreferrer", className: "inline-block cursor-pointer", children: v }) : v } }, 69214: (e, t, r) => { "use strict"; r.d(t, { kE: () => i, Cj: () => s, Lx: () => l, Uc: () => o }); var a = r(87163), n = r(13672); function i() { return (0, n.useRouterContext)() } function l(e) { let { registerBeforeNavigate: t } = (0, n.useNavigationController)(), r = (0, a.useRef)(e); r.current = e, (0, a.useEffect)(() => t(e => r.current(e)), [t]) } function s(e) { let { registerSyncNavigationBlocker: t } = (0, n.useNavigationController)(), r = (0, a.useRef)(e); r.current = e, (0, a.useEffect)(() => t(() => r.current()), [t]) } function o(e, t) { let { forcePageReload: r } = (0, n.useNavigationController)(), i = (0, a.useRef)(e); i.current = e; let l = (0, a.useRef)(r); l.current = r; let s = null != e && (null == t ? void 0 : t.enabled) !== !1; (0, a.useEffect)(() => { if (!s) return; let e = e => { if (!(!e.repeat && ("F5" === e.code || "KeyR" === e.code && (e.ctrlKey || e.metaKey) && !e.altKey))) return; let t = i.current; t && (e.preventDefault(), e.stopPropagation(), t({ event: e, forceReload: () => l.current() })) }; return window.addEventListener("keydown", e, { capture: !0 }), () => { window.removeEventListener("keydown", e, { capture: !0 }) } }, [s]) } }, 99966: e => { e.exports = { utilitySection: "Sidebar_utilitySection__dyy2i", primarySection: "Sidebar_primarySection__3jCEK", externalLinks: "Sidebar_externalLinks__b8mN7" } } } ]);