uikit/dist/index.js
2026-06-13 19:44:46 +03:30

1831 lines
53 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 = ({
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(
(f) => f >= 1 && f <= r
);
B(() => {
if (u !== null) {
e === u && (c(null), a(!1), o($(e)));
return;
}
s || o($(e));
}, [e, s, u]), B(() => {
if (!s || !i || u !== null) return;
const f = parseInt(U(i), 10);
if (isNaN(f)) return;
const y = 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(y);
}, [
i,
s,
u,
r,
e,
n
]);
const S = () => {
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 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();
};
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": "صفحه قبلی"
}
),
m.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 y = f.target.value, h = U(y).replace(/\D/g, "");
o($(h));
},
onBlur: () => {
i || (o($(e)), a(!1), c(null));
},
onKeyDown: (f) => {
f.key === "Enter" && S();
},
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] = F($(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(() => {
if (u !== null) {
e === u && (c(null), a(!1), o($(e)));
return;
}
s || o($(e));
}, [e, s, u]), B(() => {
if (!s || !i || u !== null) return;
const f = parseInt(U(i), 10);
if (isNaN(f)) return;
const y = 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(y);
}, [
i,
s,
u,
r,
e,
n
]);
const S = () => {
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 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();
};
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": "صفحه قبلی"
}
),
m.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 y = f.target.value, h = U(y).replace(/\D/g, "");
o($(h));
},
onBlur: () => {
i || (o($(e)), a(!1), c(null));
},
onKeyDown: (f) => {
f.key === "Enter" && S();
},
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] = F(""), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = u ?? e, S = 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]);
B(() => {
var w;
s && ((w = d.current) == null || w.focus());
}, [s]), B(() => {
u !== null && e === u && c(null);
}, [e, u]), B(() => {
if (!s || !i) return;
const w = setTimeout(() => {
f();
}, 1e3);
return () => clearTimeout(w);
}, [i, s, f]);
const y = () => {
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 ? y : () => S(w),
variant: "soft",
children: $(w)
},
w
);
if (r === 0 || !t) return null;
const b = r > 1 && m !== 1, _ = r > 1 && m !== 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: () => S(m - 1),
isDisabled: m === 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(m, !0),
_ && h(r),
/* @__PURE__ */ x(
J,
{
size: "md",
bg: "#e6e6f1",
color: "#4B49AC",
_hover: { bg: "#cbcbe8" },
onClick: () => S(m + 1),
isDisabled: m === r,
icon: /* @__PURE__ */ x(Re, {}),
"aria-label": "صفحه بعدی"
}
)
] })
}
);
};
let xe = null, g = null, ve = null, Se = !1;
const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (g || (g = new jr({
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;
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] = F(!1), [s, a] = F(!1), [u, c] = F(null), d = te(!1), m = j(() => {
g && (a(!!g.authenticated), c(g.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));
}).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);
return m(), _;
},
[m]
), h = fe(
() => ({
initialized: i,
authenticated: s,
token: u,
login: S,
logout: f,
updateToken: y
}),
[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 = ({
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] = F(
() => it(o)
), { data: u, isLoading: c, error: d } = ut(t), m = u ?? s;
B(() => {
u && (ot(o, u), a(u));
}, [u, o]);
const S = fe(
() => st(m),
[m]
), f = j(
(b = "") => at(S, b),
[S]
), y = j((b = "") => !f(b), [f]), h = fe(
() => ({
user: e,
can: f,
cannot: y,
permissions: m,
isLoading: c,
error: d
}),
[e, f, y, m, c, d]
);
return d && !m ? i : c && !m ? 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 B(() => {
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] = F(!1), t = te(null);
return B(() => {
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-", 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) {
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 C(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 L() {
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; )
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());
}
function kt(e) {
for (; !ee(V()); )
L();
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, 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()) {
case 40:
if (y != 108 && M(R, m - 1) == 58) {
Ee(R += C(ce(w), "&", "&\f"), "&\f") != -1 && (_ = -1);
break;
}
case 34:
case 39:
case 91:
R += ce(w);
break;
case 9:
case 10:
case 13:
case 32:
R += _t(y);
break;
case 92:
R += $t(ae() - 1, 7);
continue;
case 47:
switch (V()) {
case 42:
case 47:
oe(Mt(Rt(L(), ae()), r, t), u);
break;
default:
R += "/";
}
break;
case 123 * h:
a[c++] = z(R) * _;
case 125 * h:
case 59:
case 0:
switch (w) {
case 0:
case 125:
b = 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);
break;
case 59:
R += ";";
default:
if (oe(N = Le(R, r, t, c, d, i, a, v, k = [], l = [], m), o), w === 123)
if (d === 0)
ue(R, r, N, N, k, o, m, a, l);
else
switch (S === 99 && M(R, 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);
break;
default:
ue(R, N, N, N, [""], l, 0, a, l);
}
}
c = d = f = 0, h = _ = 1, v = R = "", m = s;
break;
case 58:
m = 1 + z(R), f = y;
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:
_ = d > 0 ? 1 : (R += "\f", -1);
break;
case 44:
a[c++] = (z(R) - 1) * _, _ = 1;
break;
case 64:
V() === 45 && (R += ce(L())), S = V(), d = m = z(v = R += kt(ae())), w++;
break;
case 45:
y === 45 && z(R) == 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);
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); )
L();
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 = L());
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 E + "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 E + e + e;
case 5349:
case 4246:
case 4810:
case 6968:
case 2756:
return E + e + de + e + O + e + e;
case 6828:
case 4268:
return E + e + O + e + e;
case 6165:
return E + e + O + "flex-" + e + e;
case 5187:
return E + e + C(e, /(\w+).+(:[^]+)/, E + "box-$1$2" + O + "flex-$1$2") + e;
case 5443:
return E + e + O + "flex-item-" + C(e, /flex-|-self/, "") + e;
case 4675:
return E + e + O + "flex-line-pack" + C(e, /align-content|flex-|-self/, "") + e;
case 5548:
return E + e + O + C(e, "shrink", "negative") + e;
case 5292:
return E + e + O + C(e, "basis", "preferred-size") + e;
case 6060:
return E + "box-" + C(e, "-grow", "") + E + e + O + C(e, "grow", "positive") + e;
case 4554:
return E + C(e, /([^-])(transform)/g, "$1" + E + "$2") + e;
case 6187:
return C(C(C(e, /(zoom-|grab)/, E + "$1"), /(image-set)/, E + "$1"), e, "") + e;
case 5495:
case 3959:
return C(e, /(image-set\([^]*)/, E + "$1$`$1");
case 4968:
return C(C(e, /(.+:)(flex-)?(.*)/, E + "box-pack:$3" + O + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + E + e + e;
case 4095:
case 3583:
case 4068:
case 2532:
return C(e, /(.+)-inline(.+)/, E + "$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 C(e, /(.+:)(.+)-([^]+)/, "$1" + E + "$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;
}
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 C(e, ":", ":" + E) + e;
case 101:
return C(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + E + (M(e, 14) === 45 ? "inline-" : "") + "box$3$1" + E + "$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;
case 108:
return E + e + O + C(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
case 45:
return E + e + O + C(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
}
return E + 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: C(r.value, "@", "@" + E)
})], 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: [C(o, /:(read-\w+)/, ":" + de + "$1")]
})], i);
case "::placeholder":
return G([Q(r, {
props: [C(o, /:(plac\w+)/, ":" + E + "input-$1")]
}), Q(r, {
props: [C(o, /:(plac\w+)/, ":" + de + "$1")]
}), Q(r, {
props: [C(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(" "), _ = 1; _ < b.length; _++)
o[b[_]] = !0;
a.push(h);
}
);
var u, c = [zt, Kt];
{
var d, m = [Nt, Ft(function(h) {
d.insert(h);
})], S = Ot(c.concat(i, m)), f = function(b) {
return G(It(b), S);
};
u = function(b, _, w, v) {
d = w, f(b ? b + "{" + _.styles + "}" : _.styles), v && (y.inserted[_.name] = !0);
};
}
var y = {
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 y.sheet.hydrate(a), y;
}, ge = { exports: {} }, A = {};
/** @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 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) {
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 m:
return l;
default:
switch (l = l && l.$$typeof, l) {
case a:
case d:
case y:
case f:
case s:
return l;
default:
return N;
}
}
case t:
return N;
}
}
}
function k(l) {
return v(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;
}, A.isConcurrentMode = k, A.isContextConsumer = function(l) {
return v(l) === a;
}, A.isContextProvider = function(l) {
return v(l) === s;
}, A.isElement = function(l) {
return typeof l == "object" && l !== null && l.$$typeof === r;
}, A.isForwardRef = function(l) {
return v(l) === d;
}, A.isFragment = function(l) {
return v(l) === n;
}, A.isLazy = function(l) {
return v(l) === y;
}, A.isMemo = function(l) {
return v(l) === f;
}, A.isPortal = function(l) {
return v(l) === t;
}, A.isProfiler = function(l) {
return v(l) === o;
}, A.isStrictMode = function(l) {
return v(l) === i;
}, A.isSuspense = function(l) {
return v(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;
}
var T = {};
/** @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, 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) {
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);
}
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 m:
return ie;
default:
var De = ie && ie.$$typeof;
switch (De) {
case a:
case d:
case y:
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 = 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;
}
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) === y;
}
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) === 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;
}
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 m = Qt(i) + c;
return {
name: m,
styles: i,
next: K
};
}
var nn = function(r) {
return r();
}, mr = P.useInsertionEffect ? P.useInsertionEffect : !1, on = mr || nn, Ue = mr || P.useLayoutEffect, yr = /* @__PURE__ */ P.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__ */ P.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, P.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__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement(an, {
cache: r,
serialized: a,
isStringTag: typeof i == "string"
}), /* @__PURE__ */ P.createElement(i, u));
}), un = cn, Ge = function(r, t) {
var n = arguments;
if (t == null || !Oe.call(t, "css"))
return P.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 P.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();
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, m] = F(!1), S = fe(
() => ({
api: {
baseUrl: r
},
keycloak: {
url: a,
realm: u,
clientId: t
},
permission: {
url: c,
clientId: n
}
}),
[
r,
t,
n,
a,
u,
c
]
);
return B(() => {
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, {}),
e
] }) })
] }) }) : null;
}
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
};