import { jsxs as Y, jsx as x } from "react/jsx-runtime"; import * as F from "react"; import { useState as P, useRef as te, useEffect as L, useCallback as j, createContext as Je, useMemo as fe, useContext as He, forwardRef as Kr } from "react"; import { HStack as W, IconButton as J, Button as Te, Input as _e, Text as q, extendTheme as Yr, withDefaultColorScheme as Vr, ChakraProvider as Wr, Spinner as qr } from "@chakra-ui/react"; import { IoChevronForwardOutline as $e, IoChevronBackOutline as Re } from "react-icons/io5"; import jr from "keycloak-js"; import { useQuery as Ur, QueryClient as Gr, QueryClientProvider as Jr } from "@tanstack/react-query"; import Hr from "axios"; const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => String(e).replace(/\d/g, (r) => "۰۱۲۳۴۵۶۷۸۹"[Number(r)]), U = (e) => String(e).replace(/[۰-۹]/g, (t) => String("۰۱۲۳۴۵۶۷۸۹".indexOf(t))), Sn = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { const [i, o] = P(_(e)), [s, a] = P(!1), [u, c] = P(null), d = te(null), y = [.../* @__PURE__ */ new Set([1, e, r])].filter( (f) => f >= 1 && f <= r ); L(() => { if (u !== null) { e === u && (c(null), a(!1), o(_(e))); return; } s || o(_(e)); }, [e, s, u]), L(() => { if (!s || !i || u !== null) return; const f = parseInt(U(i), 10); if (isNaN(f)) return; const m = setTimeout(() => { var b; const h = Math.min(Math.max(f, 1), r); h !== e ? (c(h), o(_(h)), n(h)) : (a(!1), o(_(e))), (b = d.current) == null || b.blur(); }, 1e3); return () => clearTimeout(m); }, [ i, s, u, r, e, n ]); const $ = () => { var h, b; const f = parseInt(U(i), 10); if (isNaN(f)) { o(_(e)), a(!1), c(null), (h = d.current) == null || h.blur(); return; } const m = Math.min(Math.max(f, 1), r); m !== e ? (c(m), o(_(m)), n(m)) : (o(_(e)), a(!1), c(null)), (b = d.current) == null || b.blur(); }; return r === 0 || !t ? null : /* @__PURE__ */ Y( W, { justifyContent: "space-around", backgroundColor: "white", py: "10px", px: "16px", rounded: "lg", border: "1px", borderColor: "blue.200", w: "100%", children: [ /* @__PURE__ */ Y(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ /* @__PURE__ */ x( J, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => n(e - 1), isDisabled: e === 1, icon: /* @__PURE__ */ x($e, {}), "aria-label": "صفحه قبلی" } ), y.map((f) => /* @__PURE__ */ x( Te, { size: "md", px: 2, bg: e === f ? "#4B49AC" : "#e6e6f1", color: e === f ? "#e6e6f1" : "#4B49AC", _hover: { bg: e === f ? "#4B49AC" : "#cbcbe8" }, onClick: () => n(f), variant: "soft", children: _(f) }, f )), /* @__PURE__ */ x( J, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => n(e + 1), isDisabled: e === r, icon: /* @__PURE__ */ x(Re, {}), "aria-label": "صفحه بعدی" } ), /* @__PURE__ */ x( _e, { ref: d, type: "text", inputMode: "numeric", placeholder: "صفحه", w: "56px", value: i, onFocus: () => { a(!0), c(null), o(""); }, onChange: (f) => { const m = f.target.value, h = U(m).replace(/\D/g, ""); o(_(h)); }, onBlur: () => { i || (o(_(e)), a(!1), c(null)); }, onKeyDown: (f) => { f.key === "Enter" && $(); }, textAlign: "center", color: "#1D2939", px: 1, minW: 0, dir: "ltr" } ) ] }), /* @__PURE__ */ Y(W, { spacing: 2, children: [ /* @__PURE__ */ x(q, { w: "auto", fontWeight: "bold", whiteSpace: "nowrap", children: "تعداد کل:" }), /* @__PURE__ */ x(q, { children: _(t) }) ] }) ] } ); }, En = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { const [i, o] = P(_(e)), [s, a] = P(!1), [u, c] = P(null), d = te(null), y = Array.from( /* @__PURE__ */ new Set([1, e, e + 1, r]) ).filter((f) => f >= 1 && f <= r).sort((f, m) => f - m); L(() => { if (u !== null) { e === u && (c(null), a(!1), o(_(e))); return; } s || o(_(e)); }, [e, s, u]), L(() => { if (!s || !i || u !== null) return; const f = parseInt(U(i), 10); if (isNaN(f)) return; const m = setTimeout(() => { var b; const h = Math.min(Math.max(f, 1), r); h !== e ? (c(h), o(_(h)), n(h)) : (a(!1), o(_(e))), (b = d.current) == null || b.blur(); }, 1e3); return () => clearTimeout(m); }, [ i, s, u, r, e, n ]); const $ = () => { var h, b; const f = parseInt(U(i), 10); if (isNaN(f)) { o(_(e)), a(!1), c(null), (h = d.current) == null || h.blur(); return; } const m = Math.min(Math.max(f, 1), r); m !== e ? (c(m), o(_(m)), n(m)) : (o(_(e)), a(!1), c(null)), (b = d.current) == null || b.blur(); }; return r === 0 || !t ? null : /* @__PURE__ */ Y( W, { justifyContent: "space-around", backgroundColor: "white", py: "10px", px: "16px", rounded: "lg", border: "1px", borderColor: "blue.200", w: "100%", children: [ /* @__PURE__ */ Y(W, { spacing: 2, whiteSpace: "nowrap", children: [ /* @__PURE__ */ x(q, { fontWeight: "bold", children: "صفحه" }), /* @__PURE__ */ x(q, { children: _(e) }), /* @__PURE__ */ x(q, { fontWeight: "bold", children: "از" }), /* @__PURE__ */ x(q, { children: _(r) }) ] }), /* @__PURE__ */ Y(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ /* @__PURE__ */ x( J, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => n(e - 1), isDisabled: e === 1, icon: /* @__PURE__ */ x($e, {}), "aria-label": "صفحه قبلی" } ), y.map((f) => /* @__PURE__ */ x( Te, { size: "md", bg: e === f ? "#4B49AC" : "#e6e6f1", color: e === f ? "#e6e6f1" : "#4B49AC", _hover: { bg: e === f ? "#4B49AC" : "#cbcbe8" }, onClick: () => n(f), variant: "soft", children: _(f) }, f )), /* @__PURE__ */ x( J, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => n(e + 1), isDisabled: e === r, icon: /* @__PURE__ */ x(Re, {}), "aria-label": "صفحه بعدی" } ), /* @__PURE__ */ x( _e, { ref: d, type: "text", inputMode: "numeric", placeholder: "صفحه", w: "100px", value: i, onFocus: () => { a(!0), c(null), o(""); }, onChange: (f) => { const m = f.target.value, h = U(m).replace(/\D/g, ""); o(_(h)); }, onBlur: () => { i || (o(_(e)), a(!1), c(null)); }, onKeyDown: (f) => { f.key === "Enter" && $(); }, textAlign: "center", color: "#1D2939", px: 1, minW: 0, dir: "ltr" } ) ] }), /* @__PURE__ */ Y(W, { spacing: 2, whiteSpace: "nowrap", children: [ /* @__PURE__ */ x(q, { fontWeight: "bold", children: "تعداد کل:" }), /* @__PURE__ */ x(q, { children: _(t) }) ] }) ] } ); }, Cn = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { const [i, o] = P(""), [s, a] = P(!1), [u, c] = P(null), d = te(null), y = u ?? e, $ = j( (w) => { const v = Math.min(Math.max(w, 1), r); a(!1), o(""), c(null), v !== e && n(v); }, [e, r, n] ), f = j(() => { if (!i) { a(!1), o(""), c(null); return; } const w = parseInt(U(i), 10); if (isNaN(w)) { a(!1), o(""), c(null); return; } const v = Math.min(Math.max(w, 1), r); a(!1), o(""), v !== e ? (c(v), n(v)) : c(null); }, [i, e, r, n]); L(() => { var w; s && ((w = d.current) == null || w.focus()); }, [s]), L(() => { u !== null && e === u && c(null); }, [e, u]), L(() => { if (!s || !i) return; const w = setTimeout(() => { f(); }, 1e3); return () => clearTimeout(w); }, [i, s, f]); const m = () => { c(null), o(""), a(!0); }, h = (w, v = !1) => /* @__PURE__ */ x( Te, { size: "md", bg: v ? "#4B49AC" : "#e6e6f1", color: v ? "#e6e6f1" : "#4B49AC", _hover: { bg: v ? "#4B49AC" : "#cbcbe8" }, onClick: v ? m : () => $(w), variant: "soft", children: _(w) }, w ); if (r === 0 || !t) return null; const b = r > 1 && y !== 1, T = r > 1 && y !== r; return /* @__PURE__ */ x( W, { justifyContent: "center", backgroundColor: "white", py: "10px", px: "16px", rounded: "lg", border: "1px", borderColor: "blue.200", w: "100%", children: /* @__PURE__ */ Y(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ /* @__PURE__ */ x( J, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => $(y - 1), isDisabled: y === 1, icon: /* @__PURE__ */ x($e, {}), "aria-label": "صفحه قبلی" } ), b && h(1), s ? /* @__PURE__ */ x( _e, { ref: d, type: "text", inputMode: "numeric", placeholder: "صفحه", w: "48px", value: i, onChange: (w) => { const v = w.target.value, k = U(v).replace(/\D/g, ""); o(_(k)); }, onBlur: () => { i ? f() : (o(""), a(!1), c(null)); }, onKeyDown: (w) => { w.key === "Enter" && f(), w.key === "Escape" && (o(""), a(!1), c(null)); }, textAlign: "center", color: "#1D2939", px: 1, minW: 0, dir: "ltr" } ) : h(y, !0), T && h(r), /* @__PURE__ */ x( J, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => $(y + 1), isDisabled: y === r, icon: /* @__PURE__ */ x(Re, {}), "aria-label": "صفحه بعدی" } ) ] }) } ); }; let xe = null, C = null, ve = null, Se = !1; const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (C || (C = new jr({ url: e, realm: r, clientId: t })), C), Zr = (e) => (xe = e, xe), et = () => Se, Xe = () => !!(C != null && C.authenticated), se = () => (C == null ? void 0 : C.token) ?? null, Be = async (e = 30) => C ? C.updateToken(e) : !1, Qe = (e) => C == null ? void 0 : C.logout(e), gn = (e) => C == null ? void 0 : C.login(e), Ze = ({ config: e, initOptions: r = {} } = {}) => { const t = e ?? xe; if (!(t != null && t.url) || !(t != null && t.realm) || !(t != null && t.clientId)) throw new Error("Keycloak config is required."); Zr(t); const n = Qr(t); return ve || (ve = n.init({ onLoad: "login-required", checkLoginIframe: !1, flow: "implicit", ...r }).then((i) => (Se = !0, i)).catch((i) => { throw Se = !0, i; })), ve; }, rt = ({ children: e, config: r, initOptions: t, loading: n = null }) => { const [i, o] = P(!1), [s, a] = P(!1), [u, c] = P(null), d = te(!1), y = j(() => { C && (a(!!C.authenticated), c(C.token ?? null)); }, []); L(() => (d.current = !0, Ze({ config: r, initOptions: t }).then((b) => { d.current && (a(!!b), c((C == null ? void 0 : C.token) ?? null), o(!0)); }).catch(() => { d.current && (a(!1), c(null), o(!0)); }), () => { d.current = !1; }), [r, t]); const $ = j(() => C == null ? void 0 : C.login(), []), f = j((b) => C == null ? void 0 : C.logout(b), []), m = j( async (b = 30) => { if (!C) return !1; const T = await C.updateToken(b); return y(), T; }, [y] ), h = fe( () => ({ initialized: i, authenticated: s, token: u, login: $, logout: f, updateToken: m }), [i, s, u, $, f, m] ); return i ? /* @__PURE__ */ x(Xr.Provider, { value: h, children: e }) : n; }, er = Je(null), he = "permissions", tt = (e) => (e == null ? void 0 : e.storageKey) || he, nt = ({ user: e = null, children: r, config: t, loading: n = /* @__PURE__ */ x("div", { children: "Loading permissions..." }), errorFallback: i = /* @__PURE__ */ x("div", { children: "Error loading permissions" }) }) => { const o = tt(t), [s, a] = P( () => it(o) ), { data: u, isLoading: c, error: d } = ut(t), y = u ?? s; L(() => { u && (ot(o, u), a(u)); }, [u, o]); const $ = fe( () => st(y), [y] ), f = j( (b = "") => at($, b), [$] ), m = j((b = "") => !f(b), [f]), h = fe( () => ({ user: e, can: f, cannot: m, permissions: y, isLoading: c, error: d }), [e, f, m, y, c, d] ); return d && !y ? i : c && !y ? n : /* @__PURE__ */ x(er.Provider, { value: h, children: r }); }, it = (e = he) => { if (!(typeof window > "u")) try { const r = localStorage.getItem(e); return r ? JSON.parse(r) : void 0; } catch { return; } }, ot = (e = he, r) => { if (!(typeof window > "u")) try { localStorage.setItem(e, JSON.stringify(r)); } catch { } }, An = (e = he) => { if (!(typeof window > "u")) try { localStorage.removeItem(e); } catch { } }, st = (e) => e ? new Set(e.map((r) => r.name)) : /* @__PURE__ */ new Set(), at = (e, r = "") => { if (!r) return !1; if (e.has(r) || [...e].some((n) => n.startsWith(r))) return !0; let t = r; for (; t.includes(":"); ) if (t = t.slice(0, t.lastIndexOf(":")), e.has(`${t}:*`)) return !0; return !1; }, rr = { all: ["permissions"], list: (e) => [...rr.all, e] }, ct = async (e) => { if (!(e != null && e.url) || !(e != null && e.clientId)) throw new Error("Permission config requires url and clientId."); const r = se(), t = new URL(e.url); t.searchParams.set("client_id", e.clientId); const n = await fetch(t.toString(), { method: "GET", headers: { ...r ? { Authorization: `Bearer ${r}` } : {} } }); if (!n.ok) throw new Error("Failed to load permissions"); return n.json(); }, ke = () => { const e = He(er); if (!e) throw new Error("usePermission must be used within PermissionProvider"); return e; }, ut = (e) => Ur({ queryKey: rr.list(e == null ? void 0 : e.clientId), queryFn: () => ct(e), enabled: !!(e != null && e.url) && !!(e != null && e.clientId) && Xe(), staleTime: 1 / 0, refetchOnWindowFocus: !1, refetchOnReconnect: !1 }), Tn = ({ perm: e, children: r, fallback: t = /* @__PURE__ */ x("div", { children: "You are not allowed to do this" }) }) => { const { can: n } = ke(); return n(e) ? r : t; }, _n = ({ children: e }) => { const { can: r, permissions: t } = ke(); return t && r("admin") ? e : null; }, $n = ({ children: e }) => { const { can: r, isLoading: t } = ke(); return L(() => { t || r("panel_access") || Qe(); }, [t, r]), e; }; let le = null; const ft = (e) => { const { api: r } = e, t = Hr.create({ baseURL: r.baseUrl }), n = async () => { (!et() || !Xe()) && await Ze(); }, i = async (s) => { await n(); let a = se(); if (a) { try { await Be(5), a = se(); } catch { } s.headers = { ...s.headers, Authorization: `Bearer ${a}` }; } return s; }, o = async (s) => { var u; const a = s.config; if (((u = s == null ? void 0 : s.response) == null ? void 0 : u.status) === 401 && !(a != null && a._retry)) { a._retry = !0; try { await Be(30); const c = se(); return a.headers = { ...a.headers, Authorization: `Bearer ${c}` }, t(a); } catch { Qe({ redirectUri: window.location.origin }); } } return Promise.reject(s); }; return t.interceptors.request.use(i), t.interceptors.response.use( (s) => s, o ), { api: t }; }, lt = (e) => (le = ft(e), le), dt = () => { if (!le) throw new Error("api is not configured. Call configureApi(config) first."); return le.api; }, Rn = new Proxy( {}, { get(e, r) { return dt()[r]; } } ); function ht() { const [e, r] = P(!1), t = te(null); return L(() => { if (process.env.NODE_ENV !== "production") return; let n; const i = async () => { const s = await fetch(`/version.json?t=${Date.now()}`, { cache: "no-store" }); if (!s.ok) throw new Error(`Failed to fetch version: ${s.status}`); const a = await s.json(); return String(a.version); }; return (async () => { try { t.current = await i(), n = setInterval(async () => { try { const s = await i(); t.current && s !== t.current && (r(!0), clearInterval(n)); } catch (s) { console.error("Update check failed:", s); } }, 3e4); } catch (s) { console.error("Initial version fetch failed:", s); } })(), () => { n && clearInterval(n); }; }, []), e ? /* @__PURE__ */ x( "div", { style: { position: "fixed", bottom: "16px", right: "16px", background: "#111", color: "#fff", padding: "12px 16px", borderRadius: "8px", zIndex: 9999, cursor: "pointer" }, onClick: () => window.location.reload(), children: "نسخه جدید سامانه در دسترس است" } ) : null; } const pt = new Gr({ defaultOptions: { queries: { retry: 1, refetchOnWindowFocus: !1 } } }); function mt(e) { if (e.sheet) return e.sheet; for (var r = 0; r < document.styleSheets.length; r++) if (document.styleSheets[r].ownerNode === e) return document.styleSheets[r]; } function yt(e) { var r = document.createElement("style"); return r.setAttribute("data-emotion", e.key), e.nonce !== void 0 && r.setAttribute("nonce", e.nonce), r.appendChild(document.createTextNode("")), r.setAttribute("data-s", ""), r; } var bt = /* @__PURE__ */ function() { function e(t) { var n = this; this._insertTag = function(i) { var o; n.tags.length === 0 ? n.insertionPoint ? o = n.insertionPoint.nextSibling : n.prepend ? o = n.container.firstChild : o = n.before : o = n.tags[n.tags.length - 1].nextSibling, n.container.insertBefore(i, o), n.tags.push(i); }, this.isSpeedy = t.speedy === void 0 ? !0 : t.speedy, this.tags = [], this.ctr = 0, this.nonce = t.nonce, this.key = t.key, this.container = t.container, this.prepend = t.prepend, this.insertionPoint = t.insertionPoint, this.before = null; } var r = e.prototype; return r.hydrate = function(n) { n.forEach(this._insertTag); }, r.insert = function(n) { this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(yt(this)); var i = this.tags[this.tags.length - 1]; if (this.isSpeedy) { var o = mt(i); try { o.insertRule(n, o.cssRules.length); } catch { } } else i.appendChild(document.createTextNode(n)); this.ctr++; }, r.flush = function() { this.tags.forEach(function(n) { var i; return (i = n.parentNode) == null ? void 0 : i.removeChild(n); }), this.tags = [], this.ctr = 0; }, e; }(), O = "-ms-", de = "-moz-", S = "-webkit-", tr = "comm", Ie = "rule", Me = "decl", vt = "@import", nr = "@keyframes", wt = "@layer", xt = Math.abs, pe = String.fromCharCode, St = Object.assign; function Et(e, r) { return M(e, 0) ^ 45 ? (((r << 2 ^ M(e, 0)) << 2 ^ M(e, 1)) << 2 ^ M(e, 2)) << 2 ^ M(e, 3) : 0; } function ir(e) { return e.trim(); } function Ct(e, r) { return (e = r.exec(e)) ? e[0] : e; } function E(e, r, t) { return e.replace(r, t); } function Ee(e, r) { return e.indexOf(r); } function M(e, r) { return e.charCodeAt(r) | 0; } function Z(e, r, t) { return e.slice(r, t); } function z(e) { return e.length; } function Ne(e) { return e.length; } function oe(e, r) { return r.push(e), e; } function gt(e, r) { return e.map(r).join(""); } var me = 1, H = 1, or = 0, D = 0, I = 0, X = ""; function ye(e, r, t, n, i, o, s) { return { value: e, root: r, parent: t, type: n, props: i, children: o, line: me, column: H, length: s, return: "" }; } function Q(e, r) { return St(ye("", null, null, "", null, null, 0), e, { length: -e.length }, r); } function At() { return I; } function Tt() { return I = D > 0 ? M(X, --D) : 0, H--, I === 10 && (H = 1, me--), I; } function B() { return I = D < or ? M(X, D++) : 0, H++, I === 10 && (H = 1, me++), I; } function V() { return M(X, D); } function ae() { return D; } function ne(e, r) { return Z(X, e, r); } function ee(e) { switch (e) { case 0: case 9: case 10: case 13: case 32: return 5; case 33: case 43: case 44: case 47: case 62: case 64: case 126: case 59: case 123: case 125: return 4; case 58: return 3; case 34: case 39: case 40: case 91: return 2; case 41: case 93: return 1; } return 0; } function sr(e) { return me = H = 1, or = z(X = e), D = 0, []; } function ar(e) { return X = "", e; } function ce(e) { return ir(ne(D - 1, Ce(e === 91 ? e + 2 : e === 40 ? e + 1 : e))); } function _t(e) { for (; (I = V()) && I < 33; ) B(); return ee(e) > 2 || ee(I) > 3 ? "" : " "; } function $t(e, r) { for (; --r && B() && !(I < 48 || I > 102 || I > 57 && I < 65 || I > 70 && I < 97); ) ; return ne(e, ae() + (r < 6 && V() == 32 && B() == 32)); } function Ce(e) { for (; B(); ) switch (I) { case e: return D; case 34: case 39: e !== 34 && e !== 39 && Ce(I); break; case 40: e === 41 && Ce(e); break; case 92: B(); break; } return D; } function Rt(e, r) { for (; B() && e + I !== 57; ) if (e + I === 84 && V() === 47) break; return "/*" + ne(r, D - 1) + "*" + pe(e === 47 ? e : B()); } function kt(e) { for (; !ee(V()); ) B(); return ne(e, D); } function It(e) { return ar(ue("", null, null, null, [""], e = sr(e), 0, [0], e)); } function ue(e, r, t, n, i, o, s, a, u) { for (var c = 0, d = 0, y = s, $ = 0, f = 0, m = 0, h = 1, b = 1, T = 1, w = 0, v = "", k = i, l = o, N = n, R = v; b; ) switch (m = w, w = B()) { case 40: if (m != 108 && M(R, y - 1) == 58) { Ee(R += E(ce(w), "&", "&\f"), "&\f") != -1 && (T = -1); break; } case 34: case 39: case 91: R += ce(w); break; case 9: case 10: case 13: case 32: R += _t(m); break; case 92: R += $t(ae() - 1, 7); continue; case 47: switch (V()) { case 42: case 47: oe(Mt(Rt(B(), ae()), r, t), u); break; default: R += "/"; } break; case 123 * h: a[c++] = z(R) * T; case 125 * h: case 59: case 0: switch (w) { case 0: case 125: b = 0; case 59 + d: T == -1 && (R = E(R, /\f/g, "")), f > 0 && z(R) - y && oe(f > 32 ? ze(R + ";", n, t, y - 1) : ze(E(R, " ", "") + ";", n, t, y - 2), u); break; case 59: R += ";"; default: if (oe(N = Le(R, r, t, c, d, i, a, v, k = [], l = [], y), o), w === 123) if (d === 0) ue(R, r, N, N, k, o, y, a, l); else switch ($ === 99 && M(R, 3) === 110 ? 100 : $) { case 100: case 108: case 109: case 115: ue(e, N, N, n && oe(Le(e, N, N, 0, 0, i, a, v, i, k = [], y), l), i, l, y, a, n ? k : l); break; default: ue(R, N, N, N, [""], l, 0, a, l); } } c = d = f = 0, h = T = 1, v = R = "", y = s; break; case 58: y = 1 + z(R), f = m; default: if (h < 1) { if (w == 123) --h; else if (w == 125 && h++ == 0 && Tt() == 125) continue; } switch (R += pe(w), w * h) { case 38: T = d > 0 ? 1 : (R += "\f", -1); break; case 44: a[c++] = (z(R) - 1) * T, T = 1; break; case 64: V() === 45 && (R += ce(B())), $ = V(), d = y = z(v = R += kt(ae())), w++; break; case 45: m === 45 && z(R) == 2 && (h = 0); } } return o; } function Le(e, r, t, n, i, o, s, a, u, c, d) { for (var y = i - 1, $ = i === 0 ? o : [""], f = Ne($), m = 0, h = 0, b = 0; m < n; ++m) for (var T = 0, w = Z(e, y + 1, y = xt(h = s[m])), v = e; T < f; ++T) (v = ir(h > 0 ? $[T] + " " + w : E(w, /&\f/g, $[T]))) && (u[b++] = v); return ye(e, r, t, i === 0 ? Ie : a, u, c, d); } function Mt(e, r, t) { return ye(e, r, t, tr, pe(At()), Z(e, 2, -2), 0); } function ze(e, r, t, n) { return ye(e, r, t, Me, Z(e, 0, n), Z(e, n + 1, -1), n); } function G(e, r) { for (var t = "", n = Ne(e), i = 0; i < n; i++) t += r(e[i], i, e, r) || ""; return t; } function Nt(e, r, t, n) { switch (e.type) { case wt: if (e.children.length) break; case vt: case Me: return e.return = e.return || e.value; case tr: return ""; case nr: return e.return = e.value + "{" + G(e.children, n) + "}"; case Ie: e.value = e.props.join(","); } return z(t = G(e.children, n)) ? e.return = e.value + "{" + t + "}" : ""; } function Ot(e) { var r = Ne(e); return function(t, n, i, o) { for (var s = "", a = 0; a < r; a++) s += e[a](t, n, i, o) || ""; return s; }; } function Ft(e) { return function(r) { r.root || (r = r.return) && e(r); }; } function Pt(e) { var r = /* @__PURE__ */ Object.create(null); return function(t) { return r[t] === void 0 && (r[t] = e(t)), r[t]; }; } var Dt = function(r, t, n) { for (var i = 0, o = 0; i = o, o = V(), i === 38 && o === 12 && (t[n] = 1), !ee(o); ) B(); return ne(r, D); }, Bt = function(r, t) { var n = -1, i = 44; do switch (ee(i)) { case 0: i === 38 && V() === 12 && (t[n] = 1), r[n] += Dt(D - 1, t, n); break; case 2: r[n] += ce(i); break; case 4: if (i === 44) { r[++n] = V() === 58 ? "&\f" : "", t[n] = r[n].length; break; } default: r[n] += pe(i); } while (i = B()); return r; }, Lt = function(r, t) { return ar(Bt(sr(r), t)); }, Ke = /* @__PURE__ */ new WeakMap(), zt = function(r) { if (!(r.type !== "rule" || !r.parent || // positive .length indicates that this rule contains pseudo // negative .length indicates that this rule has been already prefixed r.length < 1)) { for (var t = r.value, n = r.parent, i = r.column === n.column && r.line === n.line; n.type !== "rule"; ) if (n = n.parent, !n) return; if (!(r.props.length === 1 && t.charCodeAt(0) !== 58 && !Ke.get(n)) && !i) { Ke.set(r, !0); for (var o = [], s = Lt(t, o), a = n.props, u = 0, c = 0; u < s.length; u++) for (var d = 0; d < a.length; d++, c++) r.props[c] = o[u] ? s[u].replace(/&\f/g, a[d]) : a[d] + " " + s[u]; } } }, Kt = function(r) { if (r.type === "decl") { var t = r.value; // charcode for l t.charCodeAt(0) === 108 && // charcode for b t.charCodeAt(2) === 98 && (r.return = "", r.value = ""); } }; function cr(e, r) { switch (Et(e, r)) { case 5103: return S + "print-" + e + e; case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: case 6391: case 5879: case 5623: case 6135: case 4599: case 4855: case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: return S + e + e; case 5349: case 4246: case 4810: case 6968: case 2756: return S + e + de + e + O + e + e; case 6828: case 4268: return S + e + O + e + e; case 6165: return S + e + O + "flex-" + e + e; case 5187: return S + e + E(e, /(\w+).+(:[^]+)/, S + "box-$1$2" + O + "flex-$1$2") + e; case 5443: return S + e + O + "flex-item-" + E(e, /flex-|-self/, "") + e; case 4675: return S + e + O + "flex-line-pack" + E(e, /align-content|flex-|-self/, "") + e; case 5548: return S + e + O + E(e, "shrink", "negative") + e; case 5292: return S + e + O + E(e, "basis", "preferred-size") + e; case 6060: return S + "box-" + E(e, "-grow", "") + S + e + O + E(e, "grow", "positive") + e; case 4554: return S + E(e, /([^-])(transform)/g, "$1" + S + "$2") + e; case 6187: return E(E(E(e, /(zoom-|grab)/, S + "$1"), /(image-set)/, S + "$1"), e, "") + e; case 5495: case 3959: return E(e, /(image-set\([^]*)/, S + "$1$`$1"); case 4968: return E(E(e, /(.+:)(flex-)?(.*)/, S + "box-pack:$3" + O + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + S + e + e; case 4095: case 3583: case 4068: case 2532: return E(e, /(.+)-inline(.+)/, S + "$1$2") + e; case 8116: case 7059: case 5753: case 5535: case 5445: case 5701: case 4933: case 4677: case 5533: case 5789: case 5021: case 4765: if (z(e) - 1 - r > 6) switch (M(e, r + 1)) { case 109: if (M(e, r + 4) !== 45) break; case 102: return E(e, /(.+:)(.+)-([^]+)/, "$1" + S + "$2-$3$1" + de + (M(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; case 115: return ~Ee(e, "stretch") ? cr(E(e, "stretch", "fill-available"), r) + e : e; } break; case 4949: if (M(e, r + 1) !== 115) break; case 6444: switch (M(e, z(e) - 3 - (~Ee(e, "!important") && 10))) { case 107: return E(e, ":", ":" + S) + e; case 101: return E(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + S + (M(e, 14) === 45 ? "inline-" : "") + "box$3$1" + S + "$2$3$1" + O + "$2box$3") + e; } break; case 5936: switch (M(e, r + 11)) { case 114: return S + e + O + E(e, /[svh]\w+-[tblr]{2}/, "tb") + e; case 108: return S + e + O + E(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; case 45: return S + e + O + E(e, /[svh]\w+-[tblr]{2}/, "lr") + e; } return S + e + O + e + e; } return e; } var Yt = function(r, t, n, i) { if (r.length > -1 && !r.return) switch (r.type) { case Me: r.return = cr(r.value, r.length); break; case nr: return G([Q(r, { value: E(r.value, "@", "@" + S) })], i); case Ie: if (r.length) return gt(r.props, function(o) { switch (Ct(o, /(::plac\w+|:read-\w+)/)) { case ":read-only": case ":read-write": return G([Q(r, { props: [E(o, /:(read-\w+)/, ":" + de + "$1")] })], i); case "::placeholder": return G([Q(r, { props: [E(o, /:(plac\w+)/, ":" + S + "input-$1")] }), Q(r, { props: [E(o, /:(plac\w+)/, ":" + de + "$1")] }), Q(r, { props: [E(o, /:(plac\w+)/, O + "input-$1")] })], i); } return ""; }); } }, Vt = [Yt], Wt = function(r) { var t = r.key; if (t === "css") { var n = document.querySelectorAll("style[data-emotion]:not([data-s])"); Array.prototype.forEach.call(n, function(h) { var b = h.getAttribute("data-emotion"); b.indexOf(" ") !== -1 && (document.head.appendChild(h), h.setAttribute("data-s", "")); }); } var i = r.stylisPlugins || Vt, o = {}, s, a = []; s = r.container || document.head, Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which // means that the style elements we're looking at are only Emotion 11 server-rendered style elements document.querySelectorAll('style[data-emotion^="' + t + ' "]'), function(h) { for (var b = h.getAttribute("data-emotion").split(" "), T = 1; T < b.length; T++) o[b[T]] = !0; a.push(h); } ); var u, c = [zt, Kt]; { var d, y = [Nt, Ft(function(h) { d.insert(h); })], $ = Ot(c.concat(i, y)), f = function(b) { return G(It(b), $); }; u = function(b, T, w, v) { d = w, f(b ? b + "{" + T.styles + "}" : T.styles), v && (m.inserted[T.name] = !0); }; } var m = { key: t, sheet: new bt({ key: t, container: s, nonce: r.nonce, speedy: r.speedy, prepend: r.prepend, insertionPoint: r.insertionPoint }), nonce: r.nonce, inserted: o, registered: {}, insert: u }; return m.sheet.hydrate(a), m; }, ge = { exports: {} }, g = {}; /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Ye; function qt() { if (Ye) return g; Ye = 1; var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, u = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, y = e ? Symbol.for("react.suspense") : 60113, $ = e ? Symbol.for("react.suspense_list") : 60120, f = e ? Symbol.for("react.memo") : 60115, m = e ? Symbol.for("react.lazy") : 60116, h = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, T = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; function v(l) { if (typeof l == "object" && l !== null) { var N = l.$$typeof; switch (N) { case r: switch (l = l.type, l) { case u: case c: case n: case o: case i: case y: return l; default: switch (l = l && l.$$typeof, l) { case a: case d: case m: case f: case s: return l; default: return N; } } case t: return N; } } } function k(l) { return v(l) === c; } return g.AsyncMode = u, g.ConcurrentMode = c, g.ContextConsumer = a, g.ContextProvider = s, g.Element = r, g.ForwardRef = d, g.Fragment = n, g.Lazy = m, g.Memo = f, g.Portal = t, g.Profiler = o, g.StrictMode = i, g.Suspense = y, g.isAsyncMode = function(l) { return k(l) || v(l) === u; }, g.isConcurrentMode = k, g.isContextConsumer = function(l) { return v(l) === a; }, g.isContextProvider = function(l) { return v(l) === s; }, g.isElement = function(l) { return typeof l == "object" && l !== null && l.$$typeof === r; }, g.isForwardRef = function(l) { return v(l) === d; }, g.isFragment = function(l) { return v(l) === n; }, g.isLazy = function(l) { return v(l) === m; }, g.isMemo = function(l) { return v(l) === f; }, g.isPortal = function(l) { return v(l) === t; }, g.isProfiler = function(l) { return v(l) === o; }, g.isStrictMode = function(l) { return v(l) === i; }, g.isSuspense = function(l) { return v(l) === y; }, g.isValidElementType = function(l) { return typeof l == "string" || typeof l == "function" || l === n || l === c || l === o || l === i || l === y || l === $ || typeof l == "object" && l !== null && (l.$$typeof === m || l.$$typeof === f || l.$$typeof === s || l.$$typeof === a || l.$$typeof === d || l.$$typeof === b || l.$$typeof === T || l.$$typeof === w || l.$$typeof === h); }, g.typeOf = v, g; } var A = {}; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Ve; function jt() { return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() { var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, u = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, y = e ? Symbol.for("react.suspense") : 60113, $ = e ? Symbol.for("react.suspense_list") : 60120, f = e ? Symbol.for("react.memo") : 60115, m = e ? Symbol.for("react.lazy") : 60116, h = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, T = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; function v(p) { return typeof p == "string" || typeof p == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. p === n || p === c || p === o || p === i || p === y || p === $ || typeof p == "object" && p !== null && (p.$$typeof === m || p.$$typeof === f || p.$$typeof === s || p.$$typeof === a || p.$$typeof === d || p.$$typeof === b || p.$$typeof === T || p.$$typeof === w || p.$$typeof === h); } function k(p) { if (typeof p == "object" && p !== null) { var be = p.$$typeof; switch (be) { case r: var ie = p.type; switch (ie) { case u: case c: case n: case o: case i: case y: return ie; default: var De = ie && ie.$$typeof; switch (De) { case a: case d: case m: case f: case s: return De; default: return be; } } case t: return be; } } } var l = u, N = c, R = a, wr = s, xr = r, Sr = d, Er = n, Cr = m, gr = f, Ar = t, Tr = o, _r = i, $r = y, Fe = !1; function Rr(p) { return Fe || (Fe = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), Pe(p) || k(p) === u; } function Pe(p) { return k(p) === c; } function kr(p) { return k(p) === a; } function Ir(p) { return k(p) === s; } function Mr(p) { return typeof p == "object" && p !== null && p.$$typeof === r; } function Nr(p) { return k(p) === d; } function Or(p) { return k(p) === n; } function Fr(p) { return k(p) === m; } function Pr(p) { return k(p) === f; } function Dr(p) { return k(p) === t; } function Br(p) { return k(p) === o; } function Lr(p) { return k(p) === i; } function zr(p) { return k(p) === y; } A.AsyncMode = l, A.ConcurrentMode = N, A.ContextConsumer = R, A.ContextProvider = wr, A.Element = xr, A.ForwardRef = Sr, A.Fragment = Er, A.Lazy = Cr, A.Memo = gr, A.Portal = Ar, A.Profiler = Tr, A.StrictMode = _r, A.Suspense = $r, A.isAsyncMode = Rr, A.isConcurrentMode = Pe, A.isContextConsumer = kr, A.isContextProvider = Ir, A.isElement = Mr, A.isForwardRef = Nr, A.isFragment = Or, A.isLazy = Fr, A.isMemo = Pr, A.isPortal = Dr, A.isProfiler = Br, A.isStrictMode = Lr, A.isSuspense = zr, A.isValidElementType = v, A.typeOf = k; }()), A; } process.env.NODE_ENV === "production" ? ge.exports = qt() : ge.exports = jt(); var Ut = ge.exports, ur = Ut, Gt = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, Jt = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, fr = {}; fr[ur.ForwardRef] = Gt; fr[ur.Memo] = Jt; var Ht = !0; function Xt(e, r, t) { var n = ""; return t.split(" ").forEach(function(i) { e[i] !== void 0 ? r.push(e[i] + ";") : i && (n += i + " "); }), n; } var lr = function(r, t, n) { var i = r.key + "-" + t.name; // we only need to add the styles to the registered cache if the // class name could be used further down // the tree but if it's a string tag, we know it won't // so we don't have to add it to registered cache. // this improves memory usage since we can avoid storing the whole style string (n === !1 || // we need to always store it if we're in compat mode and // in node since emotion-server relies on whether a style is in // the registered cache to know whether a style is global or not // also, note that this check will be dead code eliminated in the browser Ht === !1) && r.registered[i] === void 0 && (r.registered[i] = t.styles); }, dr = function(r, t, n) { lr(r, t, n); var i = r.key + "-" + t.name; if (r.inserted[t.name] === void 0) { var o = t; do r.insert(t === o ? "." + i : "", o, r.sheet, !0), o = o.next; while (o !== void 0); } }; function Qt(e) { for (var r = 0, t, n = 0, i = e.length; i >= 4; ++n, i -= 4) t = e.charCodeAt(n) & 255 | (e.charCodeAt(++n) & 255) << 8 | (e.charCodeAt(++n) & 255) << 16 | (e.charCodeAt(++n) & 255) << 24, t = /* Math.imul(k, m): */ (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), t ^= /* k >>> r: */ t >>> 24, r = /* Math.imul(k, m): */ (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16); switch (i) { case 3: r ^= (e.charCodeAt(n + 2) & 255) << 16; case 2: r ^= (e.charCodeAt(n + 1) & 255) << 8; case 1: r ^= e.charCodeAt(n) & 255, r = /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16); } return r ^= r >>> 13, r = /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), ((r ^ r >>> 15) >>> 0).toString(36); } var Zt = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, scale: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }, en = /[A-Z]|^ms/g, rn = /_EMO_([^_]+?)_([^]*?)_EMO_/g, hr = function(r) { return r.charCodeAt(1) === 45; }, We = function(r) { return r != null && typeof r != "boolean"; }, we = /* @__PURE__ */ Pt(function(e) { return hr(e) ? e : e.replace(en, "-$&").toLowerCase(); }), qe = function(r, t) { switch (r) { case "animation": case "animationName": if (typeof t == "string") return t.replace(rn, function(n, i, o) { return K = { name: i, styles: o, next: K }, i; }); } return Zt[r] !== 1 && !hr(r) && typeof t == "number" && t !== 0 ? t + "px" : t; }; function re(e, r, t) { if (t == null) return ""; var n = t; if (n.__emotion_styles !== void 0) return n; switch (typeof t) { case "boolean": return ""; case "object": { var i = t; if (i.anim === 1) return K = { name: i.name, styles: i.styles, next: K }, i.name; var o = t; if (o.styles !== void 0) { var s = o.next; if (s !== void 0) for (; s !== void 0; ) K = { name: s.name, styles: s.styles, next: K }, s = s.next; var a = o.styles + ";"; return a; } return tn(e, r, t); } case "function": { if (e !== void 0) { var u = K, c = t(e); return K = u, re(e, r, c); } break; } } var d = t; return d; } function tn(e, r, t) { var n = ""; if (Array.isArray(t)) for (var i = 0; i < t.length; i++) n += re(e, r, t[i]) + ";"; else for (var o in t) { var s = t[o]; if (typeof s != "object") { var a = s; We(a) && (n += we(o) + ":" + qe(o, a) + ";"); } else if (Array.isArray(s) && typeof s[0] == "string" && r == null) for (var u = 0; u < s.length; u++) We(s[u]) && (n += we(o) + ":" + qe(o, s[u]) + ";"); else { var c = re(e, r, s); switch (o) { case "animation": case "animationName": { n += we(o) + ":" + c + ";"; break; } default: n += o + "{" + c + "}"; } } } return n; } var je = /label:\s*([^\s;{]+)\s*(;|$)/g, K; function pr(e, r, t) { if (e.length === 1 && typeof e[0] == "object" && e[0] !== null && e[0].styles !== void 0) return e[0]; var n = !0, i = ""; K = void 0; var o = e[0]; if (o == null || o.raw === void 0) n = !1, i += re(t, r, o); else { var s = o; i += s[0]; } for (var a = 1; a < e.length; a++) if (i += re(t, r, e[a]), n) { var u = o; i += u[a]; } je.lastIndex = 0; for (var c = "", d; (d = je.exec(i)) !== null; ) c += "-" + d[1]; var y = Qt(i) + c; return { name: y, styles: i, next: K }; } var nn = function(r) { return r(); }, mr = F.useInsertionEffect ? F.useInsertionEffect : !1, on = mr || nn, Ue = mr || F.useLayoutEffect, yr = /* @__PURE__ */ F.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway typeof HTMLElement < "u" ? /* @__PURE__ */ Wt({ key: "css" }) : null ); yr.Provider; var br = function(r) { return /* @__PURE__ */ Kr(function(t, n) { var i = He(yr); return r(t, i, n); }); }, vr = /* @__PURE__ */ F.createContext({}), Oe = {}.hasOwnProperty, Ae = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", sn = function(r, t) { var n = {}; for (var i in t) Oe.call(t, i) && (n[i] = t[i]); return n[Ae] = r, n; }, an = function(r) { var t = r.cache, n = r.serialized, i = r.isStringTag; return lr(t, n, i), on(function() { return dr(t, n, i); }), null; }, cn = /* @__PURE__ */ br(function(e, r, t) { var n = e.css; typeof n == "string" && r.registered[n] !== void 0 && (n = r.registered[n]); var i = e[Ae], o = [n], s = ""; typeof e.className == "string" ? s = Xt(r.registered, o, e.className) : e.className != null && (s = e.className + " "); var a = pr(o, void 0, F.useContext(vr)); s += r.key + "-" + a.name; var u = {}; for (var c in e) Oe.call(e, c) && c !== "css" && c !== Ae && (u[c] = e[c]); return u.className = s, t && (u.ref = t), /* @__PURE__ */ F.createElement(F.Fragment, null, /* @__PURE__ */ F.createElement(an, { cache: r, serialized: a, isStringTag: typeof i == "string" }), /* @__PURE__ */ F.createElement(i, u)); }), un = cn, Ge = function(r, t) { var n = arguments; if (t == null || !Oe.call(t, "css")) return F.createElement.apply(void 0, n); var i = n.length, o = new Array(i); o[0] = un, o[1] = sn(r, t); for (var s = 2; s < i; s++) o[s] = n[s]; return F.createElement.apply(null, o); }; (function(e) { var r; r || (r = e.JSX || (e.JSX = {})); })(Ge || (Ge = {})); var fn = /* @__PURE__ */ br(function(e, r) { var t = e.styles, n = pr([t], void 0, F.useContext(vr)), i = F.useRef(); return Ue(function() { var o = r.key + "-global", s = new r.sheet.constructor({ key: o, nonce: r.sheet.nonce, container: r.sheet.container, speedy: r.sheet.isSpeedy }), a = !1, u = document.querySelector('style[data-emotion="' + o + " " + n.name + '"]'); return r.sheet.tags.length && (s.before = r.sheet.tags[0]), u !== null && (a = !0, u.setAttribute("data-emotion", o), s.hydrate([u])), i.current = [s, a], function() { s.flush(); }; }, [r]), Ue(function() { var o = i.current, s = o[0], a = o[1]; if (a) { o[1] = !1; return; } if (n.next !== void 0 && dr(r, n.next, !0), s.tags.length) { var u = s.tags[s.tags.length - 1].nextElementSibling; s.before = u, s.flush(); } r.insert("", n, s, !1); }, [r, n.name]), null; }); const ln = Yr( { direction: "rtl", styles: { global: { html: { fontSize: "14px" }, body: { bg: "white" } } }, fonts: { heading: "Estedad", body: "Estedad" } }, Vr({ colorScheme: "facebook" }) ), dn = () => /* @__PURE__ */ x( fn, { styles: ` @font-face { font-family: Estedad; src: url('/fonts/estedad.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } ` } ); function kn({ children: e, apiBaseUrl: r, keycloakClientId: t, permissionClientId: n, loading: i = /* @__PURE__ */ x(qr, {}), updateChecker: o = !0, updateCheckerProps: s, keycloakUrl: a = "https://auth.ibagher.ir", keycloakRealm: u = "bi", permissionUrl: c = "https://api.d.aiengines.ir/user_api/v1/permissions/list" }) { const d = fe( () => ({ api: { baseUrl: r }, keycloak: { url: a, realm: u, clientId: t }, permission: { url: c, clientId: n } }), [ r, t, n, a, u, c ] ); return L(() => { lt(d); }, [d]), /* @__PURE__ */ x(Wr, { theme: ln, children: /* @__PURE__ */ Y(Jr, { client: pt, children: [ o && /* @__PURE__ */ x(ht, { ...s }), /* @__PURE__ */ x(rt, { config: d.keycloak, loading: i, children: /* @__PURE__ */ Y(nt, { config: d.permission, loading: i, children: [ /* @__PURE__ */ x(dn, {}), e ] }) }) ] }) }); } export { _n as AdminGuard, kn as BiProvider, Tn as Can, rt as KeycloakProvider, Sn as LightPagination, En as Pagination, $n as PanelAccessGuard, nt as PermissionProvider, Cn as SimplePagination, Rn as api, at as checkPermission, An as clearCachedPermissions, lt as configureApi, ft as createApi, st as createPermissionSet, dt as getApi, it as getCachedPermissions, se as getKeycloakToken, ct as getPermissions, Ze as initKeycloak, Xe as isKeycloakAuthenticated, et as isKeycloakInitialized, gn as loginKeycloak, Qe as logoutKeycloak, rr as permissionKeys, ot as setCachedPermissions, U as toEnDigits, _ as toFaDigits, xn as toFaNumber, Be as updateKeycloakToken, ke as usePermission, ut as usePermissionsQuery };