diff --git a/dist/index.js b/dist/index.js index 16f799a..56febfc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,34 +1,34 @@ -import { jsxs as Y, jsx as x } from "react/jsx-runtime"; -import * as P from "react"; -import { useState as F, useRef as te, useEffect as B, 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 = ({ +import { jsxs as K, jsx as b } from "react/jsx-runtime"; +import * as B from "react"; +import { useState as F, useRef as te, useEffect as D, useCallback as q, createContext as He, useMemo as fe, useContext as Je, forwardRef as Yr } from "react"; +import { HStack as W, IconButton as H, Button as Te, Input as _e, Text as L, extendTheme as Vr, withDefaultColorScheme as jr, ChakraProvider as qr, Spinner as Ur, Box as Gr, VStack as Xe, Image as Qe } from "@chakra-ui/react"; +import { IoChevronForwardOutline as Re, IoChevronBackOutline as $e } from "react-icons/io5"; +import Hr from "keycloak-js"; +import { useQuery as Jr, QueryClient as Xr, QueryClientProvider as Qr } from "@tanstack/react-query"; +import Zr from "axios"; +const kn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), R = (e) => String(e).replace(/\d/g, (r) => "۰۱۲۳۴۵۶۷۸۹"[Number(r)]), U = (e) => String(e).replace(/[۰-۹]/g, (t) => String("۰۱۲۳۴۵۶۷۸۹".indexOf(t))), In = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { - const [i, o] = F($(e)), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = [.../* @__PURE__ */ new Set([1, e, r])].filter( + const [i, o] = F(R(e)), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = [.../* @__PURE__ */ new Set([1, e, r])].filter( (f) => f >= 1 && f <= r ); - B(() => { + D(() => { if (u !== null) { - e === u && (c(null), a(!1), o($(e))); + e === u && (c(null), a(!1), o(R(e))); return; } - s || o($(e)); - }, [e, s, u]), B(() => { + s || o(R(e)); + }, [e, s, u]), D(() => { if (!s || !i || u !== null) return; const f = parseInt(U(i), 10); if (isNaN(f)) return; const y = setTimeout(() => { - var b; + var v; 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(); + h !== e ? (c(h), o(R(h)), n(h)) : (a(!1), o(R(e))), (v = d.current) == null || v.blur(); }, 1e3); return () => clearTimeout(y); }, [ @@ -40,16 +40,16 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S n ]); const S = () => { - var h, b; + var h, v; const f = parseInt(U(i), 10); if (isNaN(f)) { - o($(e)), a(!1), c(null), (h = d.current) == null || h.blur(); + o(R(e)), a(!1), c(null), (h = d.current) == null || h.blur(); return; } const y = Math.min(Math.max(f, 1), r); - y !== e ? (c(y), o($(y)), n(y)) : (o($(e)), a(!1), c(null)), (b = d.current) == null || b.blur(); + y !== e ? (c(y), o(R(y)), n(y)) : (o(R(e)), a(!1), c(null)), (v = d.current) == null || v.blur(); }; - return r === 0 || !t ? null : /* @__PURE__ */ Y( + return r === 0 || !t ? null : /* @__PURE__ */ K( W, { justifyContent: "space-around", @@ -61,9 +61,9 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S borderColor: "blue.200", w: "100%", children: [ - /* @__PURE__ */ Y(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ - /* @__PURE__ */ x( - J, + /* @__PURE__ */ K(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ + /* @__PURE__ */ b( + H, { size: "md", bg: "#e6e6f1", @@ -71,11 +71,11 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S _hover: { bg: "#cbcbe8" }, onClick: () => n(e - 1), isDisabled: e === 1, - icon: /* @__PURE__ */ x($e, {}), + icon: /* @__PURE__ */ b(Re, {}), "aria-label": "صفحه قبلی" } ), - m.map((f) => /* @__PURE__ */ x( + m.map((f) => /* @__PURE__ */ b( Te, { size: "md", @@ -85,12 +85,12 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S _hover: { bg: e === f ? "#4B49AC" : "#cbcbe8" }, onClick: () => n(f), variant: "soft", - children: $(f) + children: R(f) }, f )), - /* @__PURE__ */ x( - J, + /* @__PURE__ */ b( + H, { size: "md", bg: "#e6e6f1", @@ -98,11 +98,11 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S _hover: { bg: "#cbcbe8" }, onClick: () => n(e + 1), isDisabled: e === r, - icon: /* @__PURE__ */ x(Re, {}), + icon: /* @__PURE__ */ b($e, {}), "aria-label": "صفحه بعدی" } ), - /* @__PURE__ */ x( + /* @__PURE__ */ b( _e, { ref: d, @@ -116,10 +116,10 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S }, onChange: (f) => { const y = f.target.value, h = U(y).replace(/\D/g, ""); - o($(h)); + o(R(h)); }, onBlur: () => { - i || (o($(e)), a(!1), c(null)); + i || (o(R(e)), a(!1), c(null)); }, onKeyDown: (f) => { f.key === "Enter" && S(); @@ -132,36 +132,36 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S } ) ] }), - /* @__PURE__ */ Y(W, { spacing: 2, children: [ - /* @__PURE__ */ x(q, { w: "auto", fontWeight: "bold", whiteSpace: "nowrap", children: "تعداد کل:" }), - /* @__PURE__ */ x(q, { children: $(t) }) + /* @__PURE__ */ K(W, { spacing: 2, children: [ + /* @__PURE__ */ b(L, { w: "auto", fontWeight: "bold", whiteSpace: "nowrap", children: "تعداد کل:" }), + /* @__PURE__ */ b(L, { children: R(t) }) ] }) ] } ); -}, En = ({ +}, Mn = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { - const [i, o] = F($(e)), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = Array.from( + const [i, o] = F(R(e)), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = Array.from( /* @__PURE__ */ new Set([1, e, e + 1, r]) ).filter((f) => f >= 1 && f <= r).sort((f, y) => f - y); - B(() => { + D(() => { if (u !== null) { - e === u && (c(null), a(!1), o($(e))); + e === u && (c(null), a(!1), o(R(e))); return; } - s || o($(e)); - }, [e, s, u]), B(() => { + s || o(R(e)); + }, [e, s, u]), D(() => { if (!s || !i || u !== null) return; const f = parseInt(U(i), 10); if (isNaN(f)) return; const y = setTimeout(() => { - var b; + var v; 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(); + h !== e ? (c(h), o(R(h)), n(h)) : (a(!1), o(R(e))), (v = d.current) == null || v.blur(); }, 1e3); return () => clearTimeout(y); }, [ @@ -173,16 +173,16 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S n ]); const S = () => { - var h, b; + var h, v; const f = parseInt(U(i), 10); if (isNaN(f)) { - o($(e)), a(!1), c(null), (h = d.current) == null || h.blur(); + o(R(e)), a(!1), c(null), (h = d.current) == null || h.blur(); return; } const y = Math.min(Math.max(f, 1), r); - y !== e ? (c(y), o($(y)), n(y)) : (o($(e)), a(!1), c(null)), (b = d.current) == null || b.blur(); + y !== e ? (c(y), o(R(y)), n(y)) : (o(R(e)), a(!1), c(null)), (v = d.current) == null || v.blur(); }; - return r === 0 || !t ? null : /* @__PURE__ */ Y( + return r === 0 || !t ? null : /* @__PURE__ */ K( W, { justifyContent: "space-around", @@ -194,15 +194,15 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S 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__ */ K(W, { spacing: 2, whiteSpace: "nowrap", children: [ + /* @__PURE__ */ b(L, { fontWeight: "bold", children: "صفحه" }), + /* @__PURE__ */ b(L, { children: R(e) }), + /* @__PURE__ */ b(L, { fontWeight: "bold", children: "از" }), + /* @__PURE__ */ b(L, { children: R(r) }) ] }), - /* @__PURE__ */ Y(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ - /* @__PURE__ */ x( - J, + /* @__PURE__ */ K(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ + /* @__PURE__ */ b( + H, { size: "md", bg: "#e6e6f1", @@ -210,11 +210,11 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S _hover: { bg: "#cbcbe8" }, onClick: () => n(e - 1), isDisabled: e === 1, - icon: /* @__PURE__ */ x($e, {}), + icon: /* @__PURE__ */ b(Re, {}), "aria-label": "صفحه قبلی" } ), - m.map((f) => /* @__PURE__ */ x( + m.map((f) => /* @__PURE__ */ b( Te, { size: "md", @@ -223,12 +223,12 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S _hover: { bg: e === f ? "#4B49AC" : "#cbcbe8" }, onClick: () => n(f), variant: "soft", - children: $(f) + children: R(f) }, f )), - /* @__PURE__ */ x( - J, + /* @__PURE__ */ b( + H, { size: "md", bg: "#e6e6f1", @@ -236,11 +236,11 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S _hover: { bg: "#cbcbe8" }, onClick: () => n(e + 1), isDisabled: e === r, - icon: /* @__PURE__ */ x(Re, {}), + icon: /* @__PURE__ */ b($e, {}), "aria-label": "صفحه بعدی" } ), - /* @__PURE__ */ x( + /* @__PURE__ */ b( _e, { ref: d, @@ -254,10 +254,10 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S }, onChange: (f) => { const y = f.target.value, h = U(y).replace(/\D/g, ""); - o($(h)); + o(R(h)); }, onBlur: () => { - i || (o($(e)), a(!1), c(null)); + i || (o(R(e)), a(!1), c(null)); }, onKeyDown: (f) => { f.key === "Enter" && S(); @@ -270,26 +270,26 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S } ) ] }), - /* @__PURE__ */ Y(W, { spacing: 2, whiteSpace: "nowrap", children: [ - /* @__PURE__ */ x(q, { fontWeight: "bold", children: "تعداد کل:" }), - /* @__PURE__ */ x(q, { children: $(t) }) + /* @__PURE__ */ K(W, { spacing: 2, whiteSpace: "nowrap", children: [ + /* @__PURE__ */ b(L, { fontWeight: "bold", children: "تعداد کل:" }), + /* @__PURE__ */ b(L, { children: R(t) }) ] }) ] } ); -}, Cn = ({ +}, Nn = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { - const [i, o] = F(""), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = u ?? e, S = j( + const [i, o] = F(""), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = u ?? e, S = q( (w) => { - const v = Math.min(Math.max(w, 1), r); - a(!1), o(""), c(null), v !== e && n(v); + const x = Math.min(Math.max(w, 1), r); + a(!1), o(""), c(null), x !== e && n(x); }, [e, r, n] - ), f = j(() => { + ), f = q(() => { if (!i) { a(!1), o(""), c(null); return; @@ -299,15 +299,15 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S 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); + const x = Math.min(Math.max(w, 1), r); + a(!1), o(""), x !== e ? (c(x), n(x)) : c(null); }, [i, e, r, n]); - B(() => { + D(() => { var w; s && ((w = d.current) == null || w.focus()); - }, [s]), B(() => { + }, [s]), D(() => { u !== null && e === u && c(null); - }, [e, u]), B(() => { + }, [e, u]), D(() => { if (!s || !i) return; const w = setTimeout(() => { f(); @@ -316,22 +316,22 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S }, [i, s, f]); const y = () => { c(null), o(""), a(!0); - }, h = (w, v = !1) => /* @__PURE__ */ x( + }, h = (w, x = !1) => /* @__PURE__ */ b( Te, { size: "md", - bg: v ? "#4B49AC" : "#e6e6f1", - color: v ? "#e6e6f1" : "#4B49AC", - _hover: { bg: v ? "#4B49AC" : "#cbcbe8" }, - onClick: v ? y : () => S(w), + bg: x ? "#4B49AC" : "#e6e6f1", + color: x ? "#e6e6f1" : "#4B49AC", + _hover: { bg: x ? "#4B49AC" : "#cbcbe8" }, + onClick: x ? y : () => S(w), variant: "soft", - children: $(w) + children: R(w) }, w ); if (r === 0 || !t) return null; - const b = r > 1 && m !== 1, _ = r > 1 && m !== r; - return /* @__PURE__ */ x( + const v = r > 1 && m !== 1, _ = r > 1 && m !== r; + return /* @__PURE__ */ b( W, { justifyContent: "center", @@ -342,9 +342,9 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S border: "1px", borderColor: "blue.200", w: "100%", - children: /* @__PURE__ */ Y(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ - /* @__PURE__ */ x( - J, + children: /* @__PURE__ */ K(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ + /* @__PURE__ */ b( + H, { size: "md", bg: "#e6e6f1", @@ -352,12 +352,12 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S _hover: { bg: "#cbcbe8" }, onClick: () => S(m - 1), isDisabled: m === 1, - icon: /* @__PURE__ */ x($e, {}), + icon: /* @__PURE__ */ b(Re, {}), "aria-label": "صفحه قبلی" } ), - b && h(1), - s ? /* @__PURE__ */ x( + v && h(1), + s ? /* @__PURE__ */ b( _e, { ref: d, @@ -367,8 +367,8 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S w: "48px", value: i, onChange: (w) => { - const v = w.target.value, k = U(v).replace(/\D/g, ""); - o($(k)); + const x = w.target.value, k = U(x).replace(/\D/g, ""); + o(R(k)); }, onBlur: () => { i ? f() : (o(""), a(!1), c(null)); @@ -384,8 +384,8 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S } ) : h(m, !0), _ && h(r), - /* @__PURE__ */ x( - J, + /* @__PURE__ */ b( + H, { size: "md", bg: "#e6e6f1", @@ -393,7 +393,7 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S _hover: { bg: "#cbcbe8" }, onClick: () => S(m + 1), isDisabled: m === r, - icon: /* @__PURE__ */ x(Re, {}), + icon: /* @__PURE__ */ b($e, {}), "aria-label": "صفحه بعدی" } ) @@ -401,17 +401,17 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => S } ); }; -let xe = null, g = null, ve = null, Se = !1; -const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (g || (g = new jr({ +let we = null, C = null, ve = null, Se = !1; +const et = He(null), rt = ({ url: e, realm: r, clientId: t }) => (C || (C = new Hr({ url: e, realm: r, clientId: t -})), g), Zr = (e) => (xe = e, xe), et = () => Se, Xe = () => !!(g != null && g.authenticated), se = () => (g == null ? void 0 : g.token) ?? null, Be = async (e = 30) => g ? g.updateToken(e) : !1, Qe = (e) => g == null ? void 0 : g.logout(e), gn = (e) => g == null ? void 0 : g.login(e), Ze = ({ config: e, initOptions: r = {} } = {}) => { - const t = e ?? xe; +})), C), tt = (e) => (we = e, we), nt = () => Se, Ze = () => !!(C != null && C.authenticated), se = () => (C == null ? void 0 : C.token) ?? null, De = async (e = 30) => C ? C.updateToken(e) : !1, er = (e) => C == null ? void 0 : C.logout(e), On = (e) => C == null ? void 0 : C.login(e), rr = ({ config: e, initOptions: r = {} } = {}) => { + const t = e ?? we; 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); + tt(t); + const n = rt(t); return ve || (ve = n.init({ onLoad: "login-required", checkLoginIframe: !1, @@ -420,26 +420,26 @@ const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (g || (g = new }).then((i) => (Se = !0, i)).catch((i) => { throw Se = !0, i; })), ve; -}, rt = ({ +}, it = ({ children: e, config: r, initOptions: t, loading: n = null }) => { - const [i, o] = F(!1), [s, a] = F(!1), [u, c] = F(null), d = te(!1), m = j(() => { - g && (a(!!g.authenticated), c(g.token ?? null)); + const [i, o] = F(!1), [s, a] = F(!1), [u, c] = F(null), d = te(!1), m = q(() => { + C && (a(!!C.authenticated), c(C.token ?? null)); }, []); - B(() => (d.current = !0, Ze({ config: r, initOptions: t }).then((b) => { - d.current && (a(!!b), c((g == null ? void 0 : g.token) ?? null), o(!0)); + D(() => (d.current = !0, rr({ config: r, initOptions: t }).then((v) => { + d.current && (a(!!v), 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 S = j(() => g == null ? void 0 : g.login(), []), f = j((b) => g == null ? void 0 : g.logout(b), []), y = j( - async (b = 30) => { - if (!g) return !1; - const _ = await g.updateToken(b); + const S = q(() => C == null ? void 0 : C.login(), []), f = q((v) => C == null ? void 0 : C.logout(v), []), y = q( + async (v = 30) => { + if (!C) return !1; + const _ = await C.updateToken(v); return m(), _; }, [m] @@ -454,27 +454,27 @@ const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (g || (g = new }), [i, s, u, S, f, y] ); - 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 = ({ + return i ? /* @__PURE__ */ b(et.Provider, { value: h, children: e }) : n; +}, tr = He(null), he = "permissions", ot = (e) => (e == null ? void 0 : e.storageKey) || he, st = ({ user: e = null, children: r, config: t, - loading: n = /* @__PURE__ */ x("div", { children: "Loading permissions..." }), - errorFallback: i = /* @__PURE__ */ x("div", { children: "Error loading permissions" }) + loading: n = /* @__PURE__ */ b("div", { children: "Loading permissions..." }), + errorFallback: i = /* @__PURE__ */ b("div", { children: "Error loading permissions" }) }) => { - const o = tt(t), [s, a] = F( - () => it(o) - ), { data: u, isLoading: c, error: d } = ut(t), m = u ?? s; - B(() => { - u && (ot(o, u), a(u)); + const o = ot(t), [s, a] = F( + () => at(o) + ), { data: u, isLoading: c, error: d } = dt(t), m = u ?? s; + D(() => { + u && (ct(o, u), a(u)); }, [u, o]); const S = fe( - () => st(m), + () => ut(m), [m] - ), f = j( - (b = "") => at(S, b), + ), f = q( + (v = "") => ft(S, v), [S] - ), y = j((b = "") => !f(b), [f]), h = fe( + ), y = q((v = "") => !f(v), [f]), h = fe( () => ({ user: e, can: f, @@ -485,8 +485,8 @@ const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (g || (g = new }), [e, f, y, m, c, d] ); - return d && !m ? i : c && !m ? n : /* @__PURE__ */ x(er.Provider, { value: h, children: r }); -}, it = (e = he) => { + return d && !m ? i : c && !m ? n : /* @__PURE__ */ b(tr.Provider, { value: h, children: r }); +}, at = (e = he) => { if (!(typeof window > "u")) try { const r = localStorage.getItem(e); @@ -494,29 +494,29 @@ const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (g || (g = new } catch { return; } -}, ot = (e = he, r) => { +}, ct = (e = he, r) => { if (!(typeof window > "u")) try { localStorage.setItem(e, JSON.stringify(r)); } catch { } -}, An = (e = he) => { +}, Fn = (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 = "") => { +}, ut = (e) => e ? new Set(e.map((r) => r.name)) : /* @__PURE__ */ new Set(), ft = (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 = { +}, nr = { all: ["permissions"], - list: (e) => [...rr.all, e] -}, ct = async (e) => { + list: (e) => [...nr.all, e] +}, lt = 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); @@ -531,45 +531,45 @@ const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (g || (g = new throw new Error("Failed to load permissions"); return n.json(); }, ke = () => { - const e = He(er); + const e = Je(tr); 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(), +}, dt = (e) => Jr({ + queryKey: nr.list(e == null ? void 0 : e.clientId), + queryFn: () => lt(e), + enabled: !!(e != null && e.url) && !!(e != null && e.clientId) && Ze(), staleTime: 1 / 0, refetchOnWindowFocus: !1, refetchOnReconnect: !1 -}), Tn = ({ +}), Bn = ({ perm: e, children: r, - fallback: t = /* @__PURE__ */ x("div", { children: "You are not allowed to do this" }) + fallback: t = /* @__PURE__ */ b("div", { children: "You are not allowed to do this" }) }) => { const { can: n } = ke(); return n(e) ? r : t; -}, _n = ({ children: e }) => { +}, Pn = ({ children: e }) => { const { can: r, permissions: t } = ke(); return t && r("admin") ? e : null; -}, $n = ({ children: e }) => { +}, Dn = ({ children: e }) => { const { can: r, isLoading: t } = ke(); - return B(() => { - t || r("panel_access") || Qe(); + return D(() => { + t || r("panel_access") || er(); }, [t, r]), e; }; let le = null; -const ft = (e) => { - const { api: r } = e, t = Hr.create({ +const ht = (e) => { + const { api: r } = e, t = Zr.create({ baseURL: r.baseUrl }), n = async () => { - (!et() || !Xe()) && await Ze(); + (!nt() || !Ze()) && await rr(); }, i = async (s) => { await n(); let a = se(); if (a) { try { - await Be(5), a = se(); + await De(5), a = se(); } catch { } s.headers = { @@ -584,14 +584,14 @@ const ft = (e) => { 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); + await De(30); const c = se(); return a.headers = { ...a.headers, Authorization: `Bearer ${c}` }, t(a); } catch { - Qe({ redirectUri: window.location.origin }); + er({ redirectUri: window.location.origin }); } } return Promise.reject(s); @@ -602,21 +602,21 @@ const ft = (e) => { ), { api: t }; -}, lt = (e) => (le = ft(e), le), dt = () => { +}, pt = (e) => (le = ht(e), le), mt = () => { if (!le) throw new Error("api is not configured. Call configureApi(config) first."); return le.api; -}, Rn = new Proxy( +}, zn = new Proxy( {}, { get(e, r) { - return dt()[r]; + return mt()[r]; } } ); -function ht() { +function yt() { const [e, r] = F(!1), t = te(null); - return B(() => { + return D(() => { if (process.env.NODE_ENV !== "production") return; let n; const i = async () => { @@ -644,7 +644,7 @@ function ht() { })(), () => { n && clearInterval(n); }; - }, []), e ? /* @__PURE__ */ x( + }, []), e ? /* @__PURE__ */ b( "div", { style: { @@ -663,7 +663,7 @@ function ht() { } ) : null; } -const pt = new Gr({ +const bt = new Xr({ defaultOptions: { queries: { retry: 1, @@ -671,18 +671,18 @@ const pt = new Gr({ } } }); -function mt(e) { +function vt(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) { +function xt(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() { +var wt = /* @__PURE__ */ function() { function e(t) { var n = this; this._insertTag = function(i) { @@ -694,10 +694,10 @@ var bt = /* @__PURE__ */ function() { return r.hydrate = function(n) { n.forEach(this._insertTag); }, r.insert = function(n) { - this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(yt(this)); + this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(xt(this)); var i = this.tags[this.tags.length - 1]; if (this.isSpeedy) { - var o = mt(i); + var o = vt(i); try { o.insertRule(n, o.cssRules.length); } catch { @@ -711,20 +711,20 @@ var bt = /* @__PURE__ */ function() { return (i = n.parentNode) == null ? void 0 : i.removeChild(n); }), this.tags = [], this.ctr = 0; }, e; -}(), O = "-ms-", de = "-moz-", E = "-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) { +}(), O = "-ms-", de = "-moz-", g = "-webkit-", ir = "comm", Ie = "rule", Me = "decl", St = "@import", or = "@keyframes", gt = "@layer", Et = Math.abs, pe = String.fromCharCode, Ct = Object.assign; +function At(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) { +function sr(e) { return e.trim(); } -function Ct(e, r) { +function Tt(e, r) { return (e = r.exec(e)) ? e[0] : e; } -function C(e, r, t) { +function E(e, r, t) { return e.replace(r, t); } -function Ee(e, r) { +function ge(e, r) { return e.indexOf(r); } function M(e, r) { @@ -733,7 +733,7 @@ function M(e, r) { function Z(e, r, t) { return e.slice(r, t); } -function z(e) { +function Y(e) { return e.length; } function Ne(e) { @@ -742,30 +742,30 @@ function Ne(e) { function oe(e, r) { return r.push(e), e; } -function gt(e, r) { +function _t(e, r) { return e.map(r).join(""); } -var me = 1, H = 1, or = 0, D = 0, I = 0, X = ""; +var me = 1, J = 1, ar = 0, P = 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: "" }; + return { value: e, root: r, parent: t, type: n, props: i, children: o, line: me, column: J, length: s, return: "" }; } function Q(e, r) { - return St(ye("", null, null, "", null, null, 0), e, { length: -e.length }, r); + return Ct(ye("", null, null, "", null, null, 0), e, { length: -e.length }, r); } -function At() { +function Rt() { return I; } -function Tt() { - return I = D > 0 ? M(X, --D) : 0, H--, I === 10 && (H = 1, me--), I; +function $t() { + return I = P > 0 ? M(X, --P) : 0, J--, I === 10 && (J = 1, me--), I; } -function L() { - return I = D < or ? M(X, D++) : 0, H++, I === 10 && (H = 1, me++), I; +function z() { + return I = P < ar ? M(X, P++) : 0, J++, I === 10 && (J = 1, me++), I; } -function V() { - return M(X, D); +function j() { + return M(X, P); } function ae() { - return D; + return P; } function ne(e, r) { return Z(X, e, r); @@ -802,156 +802,156 @@ function ee(e) { } return 0; } -function sr(e) { - return me = H = 1, or = z(X = e), D = 0, []; +function cr(e) { + return me = J = 1, ar = Y(X = e), P = 0, []; } -function ar(e) { +function ur(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; ) - L(); - return ee(e) > 2 || ee(I) > 3 ? "" : " "; -} -function $t(e, r) { - for (; --r && L() && !(I < 48 || I > 102 || I > 57 && I < 65 || I > 70 && I < 97); ) - ; - return ne(e, ae() + (r < 6 && V() == 32 && L() == 32)); -} -function Ce(e) { - for (; L(); ) - 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: - L(); - break; - } - return D; -} -function Rt(e, r) { - for (; L() && e + I !== 57; ) - if (e + I === 84 && V() === 47) - break; - return "/*" + ne(r, D - 1) + "*" + pe(e === 47 ? e : L()); + return sr(ne(P - 1, Ee(e === 91 ? e + 2 : e === 40 ? e + 1 : e))); } function kt(e) { - for (; !ee(V()); ) - L(); - return ne(e, D); + for (; (I = j()) && I < 33; ) + z(); + return ee(e) > 2 || ee(I) > 3 ? "" : " "; } -function It(e) { - return ar(ue("", null, null, null, [""], e = sr(e), 0, [0], e)); +function It(e, r) { + for (; --r && z() && !(I < 48 || I > 102 || I > 57 && I < 65 || I > 70 && I < 97); ) + ; + return ne(e, ae() + (r < 6 && j() == 32 && z() == 32)); +} +function Ee(e) { + for (; z(); ) + switch (I) { + case e: + return P; + case 34: + case 39: + e !== 34 && e !== 39 && Ee(I); + break; + case 40: + e === 41 && Ee(e); + break; + case 92: + z(); + break; + } + return P; +} +function Mt(e, r) { + for (; z() && e + I !== 57; ) + if (e + I === 84 && j() === 47) + break; + return "/*" + ne(r, P - 1) + "*" + pe(e === 47 ? e : z()); +} +function Nt(e) { + for (; !ee(j()); ) + z(); + return ne(e, P); +} +function Ot(e) { + return ur(ue("", null, null, null, [""], e = cr(e), 0, [0], e)); } function ue(e, r, t, n, i, o, s, a, u) { - for (var c = 0, d = 0, m = s, S = 0, f = 0, y = 0, h = 1, b = 1, _ = 1, w = 0, v = "", k = i, l = o, N = n, R = v; b; ) - switch (y = w, w = L()) { + for (var c = 0, d = 0, m = s, S = 0, f = 0, y = 0, h = 1, v = 1, _ = 1, w = 0, x = "", k = i, l = o, N = n, $ = x; v; ) + switch (y = w, w = z()) { case 40: - if (y != 108 && M(R, m - 1) == 58) { - Ee(R += C(ce(w), "&", "&\f"), "&\f") != -1 && (_ = -1); + if (y != 108 && M($, m - 1) == 58) { + ge($ += E(ce(w), "&", "&\f"), "&\f") != -1 && (_ = -1); break; } case 34: case 39: case 91: - R += ce(w); + $ += ce(w); break; case 9: case 10: case 13: case 32: - R += _t(y); + $ += kt(y); break; case 92: - R += $t(ae() - 1, 7); + $ += It(ae() - 1, 7); continue; case 47: - switch (V()) { + switch (j()) { case 42: case 47: - oe(Mt(Rt(L(), ae()), r, t), u); + oe(Ft(Mt(z(), ae()), r, t), u); break; default: - R += "/"; + $ += "/"; } break; case 123 * h: - a[c++] = z(R) * _; + a[c++] = Y($) * _; case 125 * h: case 59: case 0: switch (w) { case 0: case 125: - b = 0; + v = 0; case 59 + d: - _ == -1 && (R = C(R, /\f/g, "")), f > 0 && z(R) - m && oe(f > 32 ? ze(R + ";", n, t, m - 1) : ze(C(R, " ", "") + ";", n, t, m - 2), u); + _ == -1 && ($ = E($, /\f/g, "")), f > 0 && Y($) - m && oe(f > 32 ? Le($ + ";", n, t, m - 1) : Le(E($, " ", "") + ";", n, t, m - 2), u); break; case 59: - R += ";"; + $ += ";"; default: - if (oe(N = Le(R, r, t, c, d, i, a, v, k = [], l = [], m), o), w === 123) + if (oe(N = ze($, r, t, c, d, i, a, x, k = [], l = [], m), o), w === 123) if (d === 0) - ue(R, r, N, N, k, o, m, a, l); + ue($, r, N, N, k, o, m, a, l); else - switch (S === 99 && M(R, 3) === 110 ? 100 : S) { + switch (S === 99 && M($, 3) === 110 ? 100 : S) { 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 = [], m), l), i, l, m, a, n ? k : l); + ue(e, N, N, n && oe(ze(e, N, N, 0, 0, i, a, x, i, k = [], m), l), i, l, m, a, n ? k : l); break; default: - ue(R, N, N, N, [""], l, 0, a, l); + ue($, N, N, N, [""], l, 0, a, l); } } - c = d = f = 0, h = _ = 1, v = R = "", m = s; + c = d = f = 0, h = _ = 1, x = $ = "", m = s; break; case 58: - m = 1 + z(R), f = y; + m = 1 + Y($), f = y; default: if (h < 1) { if (w == 123) --h; - else if (w == 125 && h++ == 0 && Tt() == 125) + else if (w == 125 && h++ == 0 && $t() == 125) continue; } - switch (R += pe(w), w * h) { + switch ($ += pe(w), w * h) { case 38: - _ = d > 0 ? 1 : (R += "\f", -1); + _ = d > 0 ? 1 : ($ += "\f", -1); break; case 44: - a[c++] = (z(R) - 1) * _, _ = 1; + a[c++] = (Y($) - 1) * _, _ = 1; break; case 64: - V() === 45 && (R += ce(L())), S = V(), d = m = z(v = R += kt(ae())), w++; + j() === 45 && ($ += ce(z())), S = j(), d = m = Y(x = $ += Nt(ae())), w++; break; case 45: - y === 45 && z(R) == 2 && (h = 0); + y === 45 && Y($) == 2 && (h = 0); } } return o; } -function Le(e, r, t, n, i, o, s, a, u, c, d) { - for (var m = i - 1, S = i === 0 ? o : [""], f = Ne(S), y = 0, h = 0, b = 0; y < n; ++y) - for (var _ = 0, w = Z(e, m + 1, m = xt(h = s[y])), v = e; _ < f; ++_) - (v = ir(h > 0 ? S[_] + " " + w : C(w, /&\f/g, S[_]))) && (u[b++] = v); +function ze(e, r, t, n, i, o, s, a, u, c, d) { + for (var m = i - 1, S = i === 0 ? o : [""], f = Ne(S), y = 0, h = 0, v = 0; y < n; ++y) + for (var _ = 0, w = Z(e, m + 1, m = Et(h = s[y])), x = e; _ < f; ++_) + (x = sr(h > 0 ? S[_] + " " + w : E(w, /&\f/g, S[_]))) && (u[v++] = x); 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 Ft(e, r, t) { + return ye(e, r, t, ir, pe(Rt()), Z(e, 2, -2), 0); } -function ze(e, r, t, n) { +function Le(e, r, t, n) { return ye(e, r, t, Me, Z(e, 0, n), Z(e, n + 1, -1), n); } function G(e, r) { @@ -959,23 +959,23 @@ function G(e, r) { t += r(e[i], i, e, r) || ""; return t; } -function Nt(e, r, t, n) { +function Bt(e, r, t, n) { switch (e.type) { - case wt: + case gt: if (e.children.length) break; - case vt: + case St: case Me: return e.return = e.return || e.value; - case tr: + case ir: return ""; - case nr: + case or: 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 + "}" : ""; + return Y(t = G(e.children, n)) ? e.return = e.value + "{" + t + "}" : ""; } -function Ot(e) { +function Pt(e) { var r = Ne(e); return function(t, n, i, o) { for (var s = "", a = 0; a < r; a++) @@ -983,44 +983,44 @@ function Ot(e) { return s; }; } -function Ft(e) { +function Dt(e) { return function(r) { r.root || (r = r.return) && e(r); }; } -function Pt(e) { +function zt(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); ) - L(); - return ne(r, D); -}, Bt = function(r, t) { +var Lt = function(r, t, n) { + for (var i = 0, o = 0; i = o, o = j(), i === 38 && o === 12 && (t[n] = 1), !ee(o); ) + z(); + return ne(r, P); +}, Kt = 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); + i === 38 && j() === 12 && (t[n] = 1), r[n] += Lt(P - 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; + r[++n] = j() === 58 ? "&\f" : "", t[n] = r[n].length; break; } default: r[n] += pe(i); } - while (i = L()); + while (i = z()); return r; -}, Lt = function(r, t) { - return ar(Bt(sr(r), t)); -}, Ke = /* @__PURE__ */ new WeakMap(), zt = function(r) { +}, Wt = function(r, t) { + return ur(Kt(cr(r), t)); +}, Ke = /* @__PURE__ */ new WeakMap(), Yt = 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)) { @@ -1028,12 +1028,12 @@ var Dt = function(r, t, n) { 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 o = [], s = Wt(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) { +}, Vt = function(r) { if (r.type === "decl") { var t = r.value; // charcode for l @@ -1041,10 +1041,10 @@ var Dt = function(r, t, n) { t.charCodeAt(2) === 98 && (r.return = "", r.value = ""); } }; -function cr(e, r) { - switch (Et(e, r)) { +function fr(e, r) { + switch (At(e, r)) { case 5103: - return E + "print-" + e + e; + return g + "print-" + e + e; case 5737: case 4201: case 3177: @@ -1070,44 +1070,44 @@ function cr(e, r) { case 5365: case 5621: case 3829: - return E + e + e; + return g + e + e; case 5349: case 4246: case 4810: case 6968: case 2756: - return E + e + de + e + O + e + e; + return g + e + de + e + O + e + e; case 6828: case 4268: - return E + e + O + e + e; + return g + e + O + e + e; case 6165: - return E + e + O + "flex-" + e + e; + return g + e + O + "flex-" + e + e; case 5187: - return E + e + C(e, /(\w+).+(:[^]+)/, E + "box-$1$2" + O + "flex-$1$2") + e; + return g + e + E(e, /(\w+).+(:[^]+)/, g + "box-$1$2" + O + "flex-$1$2") + e; case 5443: - return E + e + O + "flex-item-" + C(e, /flex-|-self/, "") + e; + return g + e + O + "flex-item-" + E(e, /flex-|-self/, "") + e; case 4675: - return E + e + O + "flex-line-pack" + C(e, /align-content|flex-|-self/, "") + e; + return g + e + O + "flex-line-pack" + E(e, /align-content|flex-|-self/, "") + e; case 5548: - return E + e + O + C(e, "shrink", "negative") + e; + return g + e + O + E(e, "shrink", "negative") + e; case 5292: - return E + e + O + C(e, "basis", "preferred-size") + e; + return g + e + O + E(e, "basis", "preferred-size") + e; case 6060: - return E + "box-" + C(e, "-grow", "") + E + e + O + C(e, "grow", "positive") + e; + return g + "box-" + E(e, "-grow", "") + g + e + O + E(e, "grow", "positive") + e; case 4554: - return E + C(e, /([^-])(transform)/g, "$1" + E + "$2") + e; + return g + E(e, /([^-])(transform)/g, "$1" + g + "$2") + e; case 6187: - return C(C(C(e, /(zoom-|grab)/, E + "$1"), /(image-set)/, E + "$1"), e, "") + e; + return E(E(E(e, /(zoom-|grab)/, g + "$1"), /(image-set)/, g + "$1"), e, "") + e; case 5495: case 3959: - return C(e, /(image-set\([^]*)/, E + "$1$`$1"); + return E(e, /(image-set\([^]*)/, g + "$1$`$1"); case 4968: - return C(C(e, /(.+:)(flex-)?(.*)/, E + "box-pack:$3" + O + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + E + e + e; + return E(E(e, /(.+:)(flex-)?(.*)/, g + "box-pack:$3" + O + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + g + e + e; case 4095: case 3583: case 4068: case 2532: - return C(e, /(.+)-inline(.+)/, E + "$1$2") + e; + return E(e, /(.+)-inline(.+)/, g + "$1$2") + e; case 8116: case 7059: case 5753: @@ -1120,101 +1120,101 @@ function cr(e, r) { case 5789: case 5021: case 4765: - if (z(e) - 1 - r > 6) switch (M(e, r + 1)) { + if (Y(e) - 1 - r > 6) switch (M(e, r + 1)) { case 109: if (M(e, r + 4) !== 45) break; case 102: - return C(e, /(.+:)(.+)-([^]+)/, "$1" + E + "$2-$3$1" + de + (M(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; + return E(e, /(.+:)(.+)-([^]+)/, "$1" + g + "$2-$3$1" + de + (M(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; case 115: - return ~Ee(e, "stretch") ? cr(C(e, "stretch", "fill-available"), r) + e : e; + return ~ge(e, "stretch") ? fr(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))) { + switch (M(e, Y(e) - 3 - (~ge(e, "!important") && 10))) { case 107: - return C(e, ":", ":" + E) + e; + return E(e, ":", ":" + g) + e; case 101: - return C(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + E + (M(e, 14) === 45 ? "inline-" : "") + "box$3$1" + E + "$2$3$1" + O + "$2box$3") + e; + return E(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + g + (M(e, 14) === 45 ? "inline-" : "") + "box$3$1" + g + "$2$3$1" + O + "$2box$3") + e; } break; case 5936: switch (M(e, r + 11)) { case 114: - return E + e + O + C(e, /[svh]\w+-[tblr]{2}/, "tb") + e; + return g + e + O + E(e, /[svh]\w+-[tblr]{2}/, "tb") + e; case 108: - return E + e + O + C(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; + return g + e + O + E(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; case 45: - return E + e + O + C(e, /[svh]\w+-[tblr]{2}/, "lr") + e; + return g + e + O + E(e, /[svh]\w+-[tblr]{2}/, "lr") + e; } - return E + e + O + e + e; + return g + e + O + e + e; } return e; } -var Yt = function(r, t, n, i) { +var jt = function(r, t, n, i) { if (r.length > -1 && !r.return) switch (r.type) { case Me: - r.return = cr(r.value, r.length); + r.return = fr(r.value, r.length); break; - case nr: + case or: return G([Q(r, { - value: C(r.value, "@", "@" + E) + value: E(r.value, "@", "@" + g) })], i); case Ie: - if (r.length) return gt(r.props, function(o) { - switch (Ct(o, /(::plac\w+|:read-\w+)/)) { + if (r.length) return _t(r.props, function(o) { + switch (Tt(o, /(::plac\w+|:read-\w+)/)) { case ":read-only": case ":read-write": return G([Q(r, { - props: [C(o, /:(read-\w+)/, ":" + de + "$1")] + props: [E(o, /:(read-\w+)/, ":" + de + "$1")] })], i); case "::placeholder": return G([Q(r, { - props: [C(o, /:(plac\w+)/, ":" + E + "input-$1")] + props: [E(o, /:(plac\w+)/, ":" + g + "input-$1")] }), Q(r, { - props: [C(o, /:(plac\w+)/, ":" + de + "$1")] + props: [E(o, /:(plac\w+)/, ":" + de + "$1")] }), Q(r, { - props: [C(o, /:(plac\w+)/, O + "input-$1")] + props: [E(o, /:(plac\w+)/, O + "input-$1")] })], i); } return ""; }); } -}, Vt = [Yt], Wt = function(r) { +}, qt = [jt], Ut = 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 v = h.getAttribute("data-emotion"); + v.indexOf(" ") !== -1 && (document.head.appendChild(h), h.setAttribute("data-s", "")); }); } - var i = r.stylisPlugins || Vt, o = {}, s, a = []; + var i = r.stylisPlugins || qt, 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(" "), _ = 1; _ < b.length; _++) - o[b[_]] = !0; + for (var v = h.getAttribute("data-emotion").split(" "), _ = 1; _ < v.length; _++) + o[v[_]] = !0; a.push(h); } ); - var u, c = [zt, Kt]; + var u, c = [Yt, Vt]; { - var d, m = [Nt, Ft(function(h) { + var d, m = [Bt, Dt(function(h) { d.insert(h); - })], S = Ot(c.concat(i, m)), f = function(b) { - return G(It(b), S); + })], S = Pt(c.concat(i, m)), f = function(v) { + return G(Ot(v), S); }; - u = function(b, _, w, v) { - d = w, f(b ? b + "{" + _.styles + "}" : _.styles), v && (y.inserted[_.name] = !0); + u = function(v, _, w, x) { + d = w, f(v ? v + "{" + _.styles + "}" : _.styles), x && (y.inserted[_.name] = !0); }; } var y = { key: t, - sheet: new bt({ + sheet: new wt({ key: t, container: s, nonce: r.nonce, @@ -1228,7 +1228,7 @@ var Yt = function(r, t, n, i) { insert: u }; return y.sheet.hydrate(a), y; -}, ge = { exports: {} }, A = {}; +}, Ce = { exports: {} }, A = {}; /** @license React v16.13.1 * react-is.production.min.js * @@ -1237,12 +1237,12 @@ var Yt = function(r, t, n, i) { * 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 A; - 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, m = e ? Symbol.for("react.suspense") : 60113, S = e ? Symbol.for("react.suspense_list") : 60120, f = e ? Symbol.for("react.memo") : 60115, y = e ? Symbol.for("react.lazy") : 60116, h = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, _ = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; - function v(l) { +var We; +function Gt() { + if (We) return A; + We = 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, m = e ? Symbol.for("react.suspense") : 60113, S = e ? Symbol.for("react.suspense_list") : 60120, f = e ? Symbol.for("react.memo") : 60115, y = e ? Symbol.for("react.lazy") : 60116, h = e ? Symbol.for("react.block") : 60121, v = e ? Symbol.for("react.fundamental") : 60117, _ = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; + function x(l) { if (typeof l == "object" && l !== null) { var N = l.$$typeof; switch (N) { @@ -1273,35 +1273,35 @@ function qt() { } } function k(l) { - return v(l) === c; + return x(l) === c; } return A.AsyncMode = u, A.ConcurrentMode = c, A.ContextConsumer = a, A.ContextProvider = s, A.Element = r, A.ForwardRef = d, A.Fragment = n, A.Lazy = y, A.Memo = f, A.Portal = t, A.Profiler = o, A.StrictMode = i, A.Suspense = m, A.isAsyncMode = function(l) { - return k(l) || v(l) === u; + return k(l) || x(l) === u; }, A.isConcurrentMode = k, A.isContextConsumer = function(l) { - return v(l) === a; + return x(l) === a; }, A.isContextProvider = function(l) { - return v(l) === s; + return x(l) === s; }, A.isElement = function(l) { return typeof l == "object" && l !== null && l.$$typeof === r; }, A.isForwardRef = function(l) { - return v(l) === d; + return x(l) === d; }, A.isFragment = function(l) { - return v(l) === n; + return x(l) === n; }, A.isLazy = function(l) { - return v(l) === y; + return x(l) === y; }, A.isMemo = function(l) { - return v(l) === f; + return x(l) === f; }, A.isPortal = function(l) { - return v(l) === t; + return x(l) === t; }, A.isProfiler = function(l) { - return v(l) === o; + return x(l) === o; }, A.isStrictMode = function(l) { - return v(l) === i; + return x(l) === i; }, A.isSuspense = function(l) { - return v(l) === m; + return x(l) === m; }, A.isValidElementType = function(l) { - return typeof l == "string" || typeof l == "function" || l === n || l === c || l === o || l === i || l === m || l === S || typeof l == "object" && l !== null && (l.$$typeof === y || l.$$typeof === f || l.$$typeof === s || l.$$typeof === a || l.$$typeof === d || l.$$typeof === b || l.$$typeof === _ || l.$$typeof === w || l.$$typeof === h); - }, A.typeOf = v, A; + return typeof l == "string" || typeof l == "function" || l === n || l === c || l === o || l === i || l === m || l === S || typeof l == "object" && l !== null && (l.$$typeof === y || l.$$typeof === f || l.$$typeof === s || l.$$typeof === a || l.$$typeof === d || l.$$typeof === v || l.$$typeof === _ || l.$$typeof === w || l.$$typeof === h); + }, A.typeOf = x, A; } var T = {}; /** @license React v16.13.1 @@ -1312,13 +1312,13 @@ var T = {}; * 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, m = e ? Symbol.for("react.suspense") : 60113, S = e ? Symbol.for("react.suspense_list") : 60120, f = e ? Symbol.for("react.memo") : 60115, y = e ? Symbol.for("react.lazy") : 60116, h = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, _ = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; - function v(p) { +var Ye; +function Ht() { + return Ye || (Ye = 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, m = e ? Symbol.for("react.suspense") : 60113, S = e ? Symbol.for("react.suspense_list") : 60120, f = e ? Symbol.for("react.memo") : 60115, y = e ? Symbol.for("react.lazy") : 60116, h = e ? Symbol.for("react.block") : 60121, v = e ? Symbol.for("react.fundamental") : 60117, _ = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; + function x(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 === m || p === S || typeof p == "object" && p !== null && (p.$$typeof === y || p.$$typeof === f || p.$$typeof === s || p.$$typeof === a || p.$$typeof === d || p.$$typeof === b || p.$$typeof === _ || p.$$typeof === w || p.$$typeof === h); + p === n || p === c || p === o || p === i || p === m || p === S || typeof p == "object" && p !== null && (p.$$typeof === y || p.$$typeof === f || p.$$typeof === s || p.$$typeof === a || p.$$typeof === d || p.$$typeof === v || p.$$typeof === _ || p.$$typeof === w || p.$$typeof === h); } function k(p) { if (typeof p == "object" && p !== null) { @@ -1335,14 +1335,14 @@ function jt() { case m: return ie; default: - var De = ie && ie.$$typeof; - switch (De) { + var Pe = ie && ie.$$typeof; + switch (Pe) { case a: case d: case y: case f: case s: - return De; + return Pe; default: return be; } @@ -1352,74 +1352,74 @@ function jt() { } } } - var l = u, N = c, R = a, wr = s, xr = r, Sr = d, Er = n, Cr = y, gr = f, Ar = t, Tr = o, _r = i, $r = m, 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; + var l = u, N = c, $ = a, Sr = s, gr = r, Er = d, Cr = n, Ar = y, Tr = f, _r = t, Rr = o, $r = i, kr = m, Fe = !1; + function Ir(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.")), Be(p) || k(p) === u; } - function Pe(p) { + function Be(p) { return k(p) === c; } - function kr(p) { + function Mr(p) { return k(p) === a; } - function Ir(p) { + function Nr(p) { return k(p) === s; } - function Mr(p) { + function Or(p) { return typeof p == "object" && p !== null && p.$$typeof === r; } - function Nr(p) { + function Fr(p) { return k(p) === d; } - function Or(p) { + function Br(p) { return k(p) === n; } - function Fr(p) { + function Pr(p) { return k(p) === y; } - function Pr(p) { + function Dr(p) { return k(p) === f; } - function Dr(p) { + function zr(p) { return k(p) === t; } - function Br(p) { + function Lr(p) { return k(p) === o; } - function Lr(p) { + function Kr(p) { return k(p) === i; } - function zr(p) { + function Wr(p) { return k(p) === m; } - T.AsyncMode = l, T.ConcurrentMode = N, T.ContextConsumer = R, T.ContextProvider = wr, T.Element = xr, T.ForwardRef = Sr, T.Fragment = Er, T.Lazy = Cr, T.Memo = gr, T.Portal = Ar, T.Profiler = Tr, T.StrictMode = _r, T.Suspense = $r, T.isAsyncMode = Rr, T.isConcurrentMode = Pe, T.isContextConsumer = kr, T.isContextProvider = Ir, T.isElement = Mr, T.isForwardRef = Nr, T.isFragment = Or, T.isLazy = Fr, T.isMemo = Pr, T.isPortal = Dr, T.isProfiler = Br, T.isStrictMode = Lr, T.isSuspense = zr, T.isValidElementType = v, T.typeOf = k; + T.AsyncMode = l, T.ConcurrentMode = N, T.ContextConsumer = $, T.ContextProvider = Sr, T.Element = gr, T.ForwardRef = Er, T.Fragment = Cr, T.Lazy = Ar, T.Memo = Tr, T.Portal = _r, T.Profiler = Rr, T.StrictMode = $r, T.Suspense = kr, T.isAsyncMode = Ir, T.isConcurrentMode = Be, T.isContextConsumer = Mr, T.isContextProvider = Nr, T.isElement = Or, T.isForwardRef = Fr, T.isFragment = Br, T.isLazy = Pr, T.isMemo = Dr, T.isPortal = zr, T.isProfiler = Lr, T.isStrictMode = Kr, T.isSuspense = Wr, T.isValidElementType = x, T.typeOf = k; }()), T; } -process.env.NODE_ENV === "production" ? ge.exports = qt() : ge.exports = jt(); -var Ut = ge.exports, ur = Ut, Gt = { +process.env.NODE_ENV === "production" ? Ce.exports = Gt() : Ce.exports = Ht(); +var Jt = Ce.exports, lr = Jt, Xt = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 -}, Jt = { +}, Qt = { $$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) { +}, dr = {}; +dr[lr.ForwardRef] = Xt; +dr[lr.Memo] = Qt; +var Zt = !0; +function en(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 hr = 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 @@ -1430,9 +1430,9 @@ var lr = function(r, t, n) { // 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); + Zt === !1) && r.registered[i] === void 0 && (r.registered[i] = t.styles); +}, pr = function(r, t, n) { + hr(r, t, n); var i = r.key + "-" + t.name; if (r.inserted[t.name] === void 0) { var o = t; @@ -1441,7 +1441,7 @@ var lr = function(r, t, n) { while (o !== void 0); } }; -function Qt(e) { +function rn(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: */ @@ -1460,7 +1460,7 @@ function Qt(e) { return r ^= r >>> 13, r = /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), ((r ^ r >>> 15) >>> 0).toString(36); } -var Zt = { +var tn = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, @@ -1509,26 +1509,26 @@ var Zt = { strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 -}, en = /[A-Z]|^ms/g, rn = /_EMO_([^_]+?)_([^]*?)_EMO_/g, hr = function(r) { +}, nn = /[A-Z]|^ms/g, on = /_EMO_([^_]+?)_([^]*?)_EMO_/g, mr = function(r) { return r.charCodeAt(1) === 45; -}, We = function(r) { +}, Ve = 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) { +}, xe = /* @__PURE__ */ zt(function(e) { + return mr(e) ? e : e.replace(nn, "-$&").toLowerCase(); +}), je = function(r, t) { switch (r) { case "animation": case "animationName": if (typeof t == "string") - return t.replace(rn, function(n, i, o) { - return K = { + return t.replace(on, function(n, i, o) { + return V = { name: i, styles: o, - next: K + next: V }, i; }); } - return Zt[r] !== 1 && !hr(r) && typeof t == "number" && t !== 0 ? t + "px" : t; + return tn[r] !== 1 && !mr(r) && typeof t == "number" && t !== 0 ? t + "px" : t; }; function re(e, r, t) { if (t == null) @@ -1542,30 +1542,30 @@ function re(e, r, t) { case "object": { var i = t; if (i.anim === 1) - return K = { + return V = { name: i.name, styles: i.styles, - next: K + next: V }, i.name; var o = t; if (o.styles !== void 0) { var s = o.next; if (s !== void 0) for (; s !== void 0; ) - K = { + V = { name: s.name, styles: s.styles, - next: K + next: V }, s = s.next; var a = o.styles + ";"; return a; } - return tn(e, r, t); + return sn(e, r, t); } case "function": { if (e !== void 0) { - var u = K, c = t(e); - return K = u, re(e, r, c); + var u = V, c = t(e); + return V = u, re(e, r, c); } break; } @@ -1573,7 +1573,7 @@ function re(e, r, t) { var d = t; return d; } -function tn(e, r, t) { +function sn(e, r, t) { var n = ""; if (Array.isArray(t)) for (var i = 0; i < t.length; i++) @@ -1583,16 +1583,16 @@ function tn(e, r, t) { var s = t[o]; if (typeof s != "object") { var a = s; - We(a) && (n += we(o) + ":" + qe(o, a) + ";"); + Ve(a) && (n += xe(o) + ":" + je(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]) + ";"); + Ve(s[u]) && (n += xe(o) + ":" + je(o, s[u]) + ";"); else { var c = re(e, r, s); switch (o) { case "animation": case "animationName": { - n += we(o) + ":" + c + ";"; + n += xe(o) + ":" + c + ";"; break; } default: @@ -1602,12 +1602,12 @@ function tn(e, r, t) { } return n; } -var je = /label:\s*([^\s;{]+)\s*(;|$)/g, K; -function pr(e, r, t) { +var qe = /label:\s*([^\s;{]+)\s*(;|$)/g, V; +function yr(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; + V = void 0; var o = e[0]; if (o == null || o.raw === void 0) n = !1, i += re(t, r, o); @@ -1620,76 +1620,76 @@ function pr(e, r, t) { var u = o; i += u[a]; } - je.lastIndex = 0; - for (var c = "", d; (d = je.exec(i)) !== null; ) + qe.lastIndex = 0; + for (var c = "", d; (d = qe.exec(i)) !== null; ) c += "-" + d[1]; - var m = Qt(i) + c; + var m = rn(i) + c; return { name: m, styles: i, - next: K + next: V }; } -var nn = function(r) { +var an = function(r) { return r(); -}, mr = P.useInsertionEffect ? P.useInsertionEffect : !1, on = mr || nn, Ue = mr || P.useLayoutEffect, yr = /* @__PURE__ */ P.createContext( +}, br = B.useInsertionEffect ? B.useInsertionEffect : !1, cn = br || an, Ue = br || B.useLayoutEffect, vr = /* @__PURE__ */ B.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({ + typeof HTMLElement < "u" ? /* @__PURE__ */ Ut({ key: "css" }) : null ); -yr.Provider; -var br = function(r) { - return /* @__PURE__ */ Kr(function(t, n) { - var i = He(yr); +vr.Provider; +var xr = function(r) { + return /* @__PURE__ */ Yr(function(t, n) { + var i = Je(vr); return r(t, i, n); }); -}, vr = /* @__PURE__ */ P.createContext({}), Oe = {}.hasOwnProperty, Ae = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", sn = function(r, t) { +}, wr = /* @__PURE__ */ B.createContext({}), Oe = {}.hasOwnProperty, Ae = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", un = 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) { +}, fn = function(r) { var t = r.cache, n = r.serialized, i = r.isStringTag; - return lr(t, n, i), on(function() { - return dr(t, n, i); + return hr(t, n, i), cn(function() { + return pr(t, n, i); }), null; -}, cn = /* @__PURE__ */ br(function(e, r, t) { +}, ln = /* @__PURE__ */ xr(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, P.useContext(vr)); + typeof e.className == "string" ? s = en(r.registered, o, e.className) : e.className != null && (s = e.className + " "); + var a = yr(o, void 0, B.useContext(wr)); 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__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement(an, { + return u.className = s, t && (u.ref = t), /* @__PURE__ */ B.createElement(B.Fragment, null, /* @__PURE__ */ B.createElement(fn, { cache: r, serialized: a, isStringTag: typeof i == "string" - }), /* @__PURE__ */ P.createElement(i, u)); -}), un = cn, Ge = function(r, t) { + }), /* @__PURE__ */ B.createElement(i, u)); +}), dn = ln, Ge = function(r, t) { var n = arguments; if (t == null || !Oe.call(t, "css")) - return P.createElement.apply(void 0, n); + return B.createElement.apply(void 0, n); var i = n.length, o = new Array(i); - o[0] = un, o[1] = sn(r, t); + o[0] = dn, o[1] = un(r, t); for (var s = 2; s < i; s++) o[s] = n[s]; - return P.createElement.apply(null, o); + return B.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, P.useContext(vr)), i = P.useRef(); +var hn = /* @__PURE__ */ xr(function(e, r) { + var t = e.styles, n = yr([t], void 0, B.useContext(wr)), i = B.useRef(); return Ue(function() { var o = r.key + "-global", s = new r.sheet.constructor({ key: o, @@ -1706,14 +1706,14 @@ var fn = /* @__PURE__ */ br(function(e, r) { o[1] = !1; return; } - if (n.next !== void 0 && dr(r, n.next, !0), s.tags.length) { + if (n.next !== void 0 && pr(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( +const pn = Vr( { direction: "rtl", styles: { @@ -1731,9 +1731,9 @@ const ln = Yr( body: "Estedad" } }, - Vr({ colorScheme: "facebook" }) -), dn = () => /* @__PURE__ */ x( - fn, + jr({ colorScheme: "facebook" }) +), mn = () => /* @__PURE__ */ b( + hn, { styles: ` @font-face { @@ -1746,12 +1746,12 @@ const ln = Yr( ` } ); -function kn({ +function Ln({ children: e, apiBaseUrl: r, keycloakClientId: t, permissionClientId: n, - loading: i = /* @__PURE__ */ x(qr, {}), + loading: i = /* @__PURE__ */ b(Ur, {}), updateChecker: o = !0, updateCheckerProps: s, keycloakUrl: a = "https://auth.ibagher.ir", @@ -1782,49 +1782,118 @@ function kn({ c ] ); - return B(() => { + return D(() => { m(!0); - }, []), B(() => { - d && lt(S); - }, [d, S]), d ? /* @__PURE__ */ x(Wr, { theme: ln, children: /* @__PURE__ */ Y(Jr, { client: pt, children: [ - o && /* @__PURE__ */ x(ht, { ...s }), - /* @__PURE__ */ x(rt, { config: S.keycloak, loading: i, children: /* @__PURE__ */ Y(nt, { config: S.permission, loading: i, children: [ - /* @__PURE__ */ x(dn, {}), + }, []), D(() => { + d && pt(S); + }, [d, S]), d ? /* @__PURE__ */ b(qr, { theme: pn, children: /* @__PURE__ */ K(Qr, { client: bt, children: [ + o && /* @__PURE__ */ b(yt, { ...s }), + /* @__PURE__ */ b(it, { config: S.keycloak, loading: i, children: /* @__PURE__ */ K(st, { config: S.permission, loading: i, children: [ + /* @__PURE__ */ b(mn, {}), e ] }) }) ] }) }) : null; } +function yn({ children: e, ...r }) { + return /* @__PURE__ */ b( + Gr, + { + as: "header", + w: "100%", + h: "92px", + borderBottom: "1px solid", + borderColor: "gray.200", + bg: "#fdfbff", + px: "20px", + zIndex: 10, + position: "fixed", + top: 0, + ...r, + children: /* @__PURE__ */ b(W, { h: "100%", alignItems: "center", justifyContent: "space-between", children: e }) + } + ); +} +function bn({ children: e, ...r }) { + return /* @__PURE__ */ b(W, { alignItems: "end", h: "100%", py: "10px", ...r, children: e }); +} +function vn(e) { + return /* @__PURE__ */ b(Qe, { loading: "lazy", ...e }); +} +function xn({ children: e, ...r }) { + return /* @__PURE__ */ b( + Xe, + { + alignItems: "start", + justifyContent: "end", + h: "100%", + spacing: 0, + ...r, + children: e + } + ); +} +function wn({ children: e, ...r }) { + return /* @__PURE__ */ b(L, { fontWeight: "bold", fontSize: "20px", ...r, children: e }); +} +function Sn({ children: e, ...r }) { + return /* @__PURE__ */ b(L, { ...r, children: e }); +} +function gn({ logoSrc: e = "/logob.png", ...r }) { + return /* @__PURE__ */ K( + Xe, + { + w: "fit-content", + alignItems: "center", + justifyContent: "center", + py: "10px", + ...r, + children: [ + /* @__PURE__ */ b(Qe, { src: e, loading: "lazy" }), + /* @__PURE__ */ b(L, { fontSize: "xs", fontWeight: "bold", textAlign: "center", children: "موسسه تولید سیستم های خبره و هوشمند اسلامی باقرالعلوم(ع)" }) + ] + } + ); +} +const Kn = Object.assign(yn, { + BrandSection: bn, + Logo: vn, + Brand: xn, + Title: wn, + Description: Sn, + Bi: gn +}); 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, + Pn as AdminGuard, + Ln as BiProvider, + Bn as Can, + Kn as Header, + it as KeycloakProvider, + In as LightPagination, + Mn as Pagination, + Dn as PanelAccessGuard, + st as PermissionProvider, + Nn as SimplePagination, + zn as api, + ft as checkPermission, + Fn as clearCachedPermissions, + pt as configureApi, + ht as createApi, + ut as createPermissionSet, + mt as getApi, + at 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, + lt as getPermissions, + rr as initKeycloak, + Ze as isKeycloakAuthenticated, + nt as isKeycloakInitialized, + On as loginKeycloak, + er as logoutKeycloak, + nr as permissionKeys, + ct as setCachedPermissions, U as toEnDigits, - $ as toFaDigits, - xn as toFaNumber, - Be as updateKeycloakToken, + R as toFaDigits, + kn as toFaNumber, + De as updateKeycloakToken, ke as usePermission, - ut as usePermissionsQuery + dt as usePermissionsQuery }; diff --git a/src/index.js b/src/index.js index d4d4b0c..3d847eb 100644 --- a/src/index.js +++ b/src/index.js @@ -34,3 +34,5 @@ export { export { createApi, configureApi, getApi, api } from "./core/api.js"; export { BiProvider } from "./provider/BiProvider.jsx"; + +export { Header } from "./components/Header.jsx";