import { u as e } from "./jsxRuntime.module.92xvPm7T.js"; import { w as y, G as k, t as w, y as f, x as C, H as E, e as I, U as N, Z as g, I as L, J as T, _ } from "./index.B_XvPxIW.js"; import "./Color.CfIv_TFH.js"; import { h as $ } from "./util.CprCgOrI.js"; import { t as d } from "./tokens.CKbL8mrq.js"; import { w as z, b as A } from "./colors.5zuHvbyn.js"; import { j as H, m as M, e as O } from "./goober-should-forward-prop.modern.BENVY72G.js"; import { _ as R, e as u } from "./en.Ct9u9Eaq.js"; import { u as j } from "./language.DS95o8hG.js"; const S = () => { const o = j((a) => a.lang), [i, n] = y(u), r = k(async (a) => { const [c, s] = await w(() => R(/* @__PURE__ */ Object.assign({ "../../locales/translations/ar.ts": () => import("./ar.qSaSVIYg.js"), "../../locales/translations/az.ts": () => import("./az.lyVyyiPn.js"), "../../locales/translations/bg.ts": () => import("./bg.C6Zyjmk0.js"), "../../locales/translations/bn.ts": () => import("./bn.BiAtKWbF.js"), "../../locales/translations/ca.ts": () => import("./ca.DVvjd5pN.js"), "../../locales/translations/ceb.ts": () => import("./ceb.CdEfJHcn.js"), "../../locales/translations/cs.ts": () => import("./cs.0YQASKgc.js"), "../../locales/translations/da.ts": () => import("./da.DBALG-EB.js"), "../../locales/translations/de.ts": () => import("./de.DddQXM9u.js"), "../../locales/translations/el.ts": () => import("./el.BSgPow80.js"), "../../locales/translations/en.ts": () => import("./en.Ct9u9Eaq.js").then((t) => t.a), "../../locales/translations/es.ts": () => import("./es.BAxCb1hz.js"), "../../locales/translations/eu.ts": () => import("./eu.BZnhzL0Z.js"), "../../locales/translations/fa.ts": () => import("./fa.BIuj8ouC.js"), "../../locales/translations/fi.ts": () => import("./fi.D-yzMDI-.js"), "../../locales/translations/fr.ts": () => import("./fr.ktL8QGJ6.js"), "../../locales/translations/gl.ts": () => import("./gl.DkayJriZ.js"), "../../locales/translations/gu.ts": () => import("./gu.D4Txx2ck.js"), "../../locales/translations/he.ts": () => import("./he.DggJpX7F.js"), "../../locales/translations/hi.ts": () => import("./hi.2DAnYJFZ.js"), "../../locales/translations/hr.ts": () => import("./hr.G6zrrx1Z.js"), "../../locales/translations/ht.ts": () => import("./ht.Crqh5nuJ.js"), "../../locales/translations/hu.ts": () => import("./hu.Cxm1Db28.js"), "../../locales/translations/id.ts": () => import("./id.F8MqLFYR.js"), "../../locales/translations/it.ts": () => import("./it.bq6I1uZB.js"), "../../locales/translations/ja.ts": () => import("./ja.B9q8NGyb.js"), "../../locales/translations/jv.ts": () => import("./jv.CEIp4x12.js"), "../../locales/translations/ka.ts": () => import("./ka.C6Z6anrv.js"), "../../locales/translations/km.ts": () => import("./km.CsfnPgZO.js"), "../../locales/translations/kn.ts": () => import("./kn.xBrwjjUS.js"), "../../locales/translations/ko.ts": () => import("./ko.DmhVmW24.js"), "../../locales/translations/lt.ts": () => import("./lt.D5fb8dNf.js"), "../../locales/translations/lv.ts": () => import("./lv.DTJk9t9K.js"), "../../locales/translations/ml.ts": () => import("./ml.C6D5lEUC.js"), "../../locales/translations/mn.ts": () => import("./mn.Dl31024x.js"), "../../locales/translations/mr.ts": () => import("./mr.CfXhHS7O.js"), "../../locales/translations/ms.ts": () => import("./ms.dZLOsUf9.js"), "../../locales/translations/my.ts": () => import("./my.CBcAU1Vb.js"), "../../locales/translations/ne.ts": () => import("./ne.H6zctopA.js"), "../../locales/translations/nl.ts": () => import("./nl.DjvIT7ow.js"), "../../locales/translations/no.ts": () => import("./no.CtBs6ual.js"), "../../locales/translations/pa.ts": () => import("./pa.rIxaPJ3r.js"), "../../locales/translations/pl.ts": () => import("./pl.dvu_hMce.js"), "../../locales/translations/pt.ts": () => import("./pt.BJ1vmnyr.js"), "../../locales/translations/ro.ts": () => import("./ro.FvrIE9PA.js"), "../../locales/translations/ru.ts": () => import("./ru.DDXT-oUM.js"), "../../locales/translations/si.ts": () => import("./si.BJ9xiymP.js"), "../../locales/translations/sk.ts": () => import("./sk.CeFGSG9C.js"), "../../locales/translations/sl.ts": () => import("./sl.CN90eN6B.js"), "../../locales/translations/sr.ts": () => import("./sr.BnYLHnIU.js"), "../../locales/translations/su.ts": () => import("./su.C2CwJ1VW.js"), "../../locales/translations/sv.ts": () => import("./sv.DoFIwOwG.js"), "../../locales/translations/sw.ts": () => import("./sw.o3iDSv-i.js"), "../../locales/translations/ta.ts": () => import("./ta.Cvi7FX4r.js"), "../../locales/translations/te.ts": () => import("./te.L5l4iOYN.js"), "../../locales/translations/th.ts": () => import("./th.B6W-ZkH8.js"), "../../locales/translations/tl.ts": () => import("./tl.CeqR_oLr.js"), "../../locales/translations/tr.ts": () => import("./tr.R4mN0MPh.js"), "../../locales/translations/uk.ts": () => import("./uk.WV7h7ULh.js"), "../../locales/translations/ur.ts": () => import("./ur.D9H6FBBT.js"), "../../locales/translations/uz.ts": () => import("./uz.RG55CRXn.js"), "../../locales/translations/vi.ts": () => import("./vi.BEy258uz.js"), "../../locales/translations/zh.ts": () => import("./zh.1PCsxroW.js"), "../../locales/translations/zh_TW.ts": () => import("./zh_TW.w2_Hb8C4.js") }), `../../locales/translations/${a}.ts`, 5))(); if (c) { console.log("error", c), n(u); return; } n(s == null ? void 0 : s[a]); }, []); return f(() => { r(o); }, [o, r]), (a) => i[a] || a; }; M( _, void 0, void 0, O((o) => o[0] !== "$") ); const l = document.createElement("aside"); l.id = T; l.style.display = "block"; l.style.position = "fixed"; l.style.zIndex = g.NAVIGATOR.toString(); document.body.prepend(l); const b = l.attachShadow({ mode: "open" }), v = H.bind({ target: b }), B = v("div", L)` color-scheme: normal; transition: background 0.1s ease; background: 0 0; z-index: ${g.NAVIGATOR}; position: fixed; &:focus-within { width: 100%; background: rgba(0, 0, 0, 0.25); position: fixed; left: 0; right: 0; top: 0; bottom: 0; } `, h = v("button")` display: flex; width: 100%; max-width: 300px; max-height: 80px; font-size: 16px; position: fixed; background: ${z}; color: ${A}; border-radius: 8px; left: 40px; top: -100px; opacity: 0; transition: top 0.2s, opacity 0.2s; align-items: center; justify-content: center; border: 3px solid ${({ $color: o }) => o}; padding: 16px; box-shadow: 0 0 0 2px ${({ $color: o }) => $(o, 0.3)}; &:focus { top: 40px; opacity: 1; outline: 1px solid rgba(255, 255, 255, 0); } `, D = () => document.querySelector('main, [role="main"], h1'), G = ({ color: o }) => { const i = S(), n = E(null); f(() => { const s = (x) => { x.key === "Escape" && I(document.activeElement) && document.activeElement.blur(); }, t = n.current, p = () => { document.addEventListener("keydown", s); }, m = () => { document.removeEventListener("keydown", s); }; return t == null || t.addEventListener("focusin", p), t == null || t.addEventListener("focusout", m), () => { t == null || t.removeEventListener("focusin", p), t == null || t.removeEventListener("focusout", m), document.removeEventListener("keydown", s); }; }, []); const r = (s) => { s.stopPropagation(); const t = D(); if (t instanceof HTMLElement) { t.scrollIntoView({ behavior: "smooth" }), t.tabIndex = -1, t.focus(); return; } }, a = (s) => { s.stopPropagation(), N.openPanel(); }; return /* @__PURE__ */ e( B, { tabIndex: -1, onClick: () => { var s; (s = n.current) == null || s.blur(); }, ref: n, children: [ /* @__PURE__ */ e( h, { onClick: r, "aria-haspopup": "dialog", $color: o, children: i(d.common.skipMainContents) } ), /* @__PURE__ */ e( h, { onClick: a, "aria-haspopup": "dialog", $color: o, children: i(d.common.openAccessibilityMenu) } ) ] } ); }, K = (o) => { C(/* @__PURE__ */ e(G, { color: o }), b); }; export { K as initialize };