import { f as lt, j as u, u as _O, c as ur, m as jr, a as $e, b as It, d as oa, e as Pt, w as Yp, A as Wu, g as zs, h as Ha, o as Tr, B as MO, i as Kt, k as Hd, l as _s, n as Am, p as Kp, q as Gu, r as ib, s as p2, _ as dS, t as kO, v as RO, x as PO, y as bw, z as NO, C as h2, S as OO, D as v2, E as AO, F as zO, G as IO, H as FO, I as hg, J as LO, P as Wm, K as BO, L as UO, M as HO, N as VO, O as Cw, Q as m2, R as WO, T as Pe, U as g2, V as y2, W as vg, X as Xp, Y as ne, Z as xe, $ as W, a0 as Ce, a1 as xx, a2 as ct, a3 as Ea, a4 as Be, a5 as GO, a6 as qO, a7 as x2, a8 as S2, a9 as an, aa as YO, ab as zt, ac as $p, ad as Yn, ae as Ew, af as Qp, ag as KO, ah as XO, ai as $O, aj as QO, ak as Au, al as mg, am as b2, an as ww, ao as ZO, ap as C2, aq as JO, ar as E2, as as eA, at as tA, au as w2, av as nA, aw as rA, ax as aA, ay as iA, az as oA, aA as sA, aB as Wo, aC as lA, aD as ob, aE as j2, aF as uA, aG as cA, aH as dA, aI as fA, aJ as pA, aK as hA, aL as T2, aM as vA, aN as mA, aO as Gm, aP as gA, aQ as gg, aR as yA, aS as zm, aT as qm, aU as fS, aV as pS, aW as hS, aX as xA, aY as D2, aZ as SA, a_ as _2, a$ as bA, b0 as M2, b1 as k2, b2 as CA, b3 as jw, b4 as zd, b5 as sb, b6 as EA, b7 as wA, b8 as jA, b9 as TA, ba as DA, bb as _A, bc as qu, bd as zu, be as ei, bf as R2, bg as Zp, bh as MA, bi as kA, bj as P2, bk as vS, bl as mS, bm as N2, bn as gS, bo as yS, bp as Tw, bq as O2, br as A2, bs as z2, bt as Im, bu as Fm, bv as RA, bw as xS, bx as I2, by as Id, bz as PA, bA as NA, bB as F2, bC as L2, bD as lb, bE as OA, bF as AA, bG as Dw, bH as _w, bI as zA, bJ as IA, bK as FA, bL as B2, bM as U2, bN as LA, bO as BA, bP as H2, bQ as Mw, bR as UA, bS as kw, bT as HA, bU as VA, bV as V2, bW as WA, bX as GA, bY as qA, bZ as YA, b_ as KA, b$ as XA, c0 as $A, c1 as Sx, c2 as Rw, c3 as QA, c4 as W2, c5 as SS, c6 as ZA, c7 as JA, c8 as ez, c9 as Pw, ca as tz, cb as nz, cc as Fp, cd as Ym, ce as G2, cf as Km, cg as rz, ch as az, ci as Go, cj as q2, ck as ub, cl as Jp, cm as iz, cn as oz, co as sz, cp as Yo, cq as Y2, cr as lz, cs as uz, ct as K2, cu as cz, cv as dz, cw as fz, cx as pz, cy as hz, cz as vz, cA as mz, cB as gz, cC as yz, cD as Nw, cE as xz, cF as Sz, cG as bz, cH as Cz, cI as Ez, cJ as wz, cK as jz, cL as Tz, cM as cb, cN as Dz, cO as _z, cP as bx, cQ as Rp, cR as pm, cS as Ow, cT as Cx, cU as Ex, cV as hm, cW as Aw, cX as bS, cY as Mz, cZ as kz, c_ as Rz, c$ as yg, d0 as Pz, d1 as Nz, d2 as Oz, d3 as Az, d4 as zz, d5 as Iz, d6 as vm, d7 as wx, d8 as mm, d9 as Tp, da as Fz, db as Lz, dc as X2, dd as Xm, de as $2, df as Q2, dg as db, dh as fb, di as Z2, dj as J2, dk as eD, dl as tD, dm as nD, dn as rD, dp as aD, dq as iD, dr as Bz, ds as oD, dt as pb, du as sD, dv as lD, dw as uD, dx as cD, dy as kd, dz as Rd, dA as dD, dB as fD, dC as pD, dD as hD, dE as vD, dF as Uz, dG as Hz, dH as Vz, dI as zw, dJ as gm, dK as Wz, dL as Iw, dM as Fw, dN as Lw, dO as Bw, dP as Gz, dQ as qz, dR as CS, dS as Yz, dT as Kz, dU as Uw, dV as Xz, dW as ym, dX as $z, dY as $m, dZ as Qz, d_ as Zz, d$ as Jz, e0 as eI, e1 as mD, e2 as tI, e3 as nI } from "./exports-21bec2df.mjs"; import * as Ge from "react"; import jt, { Children as eh, useMemo as Xt, useLayoutEffect as co, useEffect as ot, useRef as Xe, useState as qe, useId as Ko, useCallback as ee, forwardRef as Fl, cloneElement as Ll, PureComponent as rI, isValidElement as gD, createElement as Ds, createContext as xg, useReducer as yD, useImperativeHandle as hb, Fragment as aI, useContext as Bl, memo as Yr, Component as iI, useTransition as oI } from "react"; import { I as ia, u as sI, c as lI, C as uI } from "./chunk-ZP4IHIHZ-8f3a3ec4.mjs"; import { flushSync as cI } from "react-dom"; function dI(e, t) { if (e == null) return {}; var r = {}, i = Object.keys(e), s, c; for (c = 0; c < i.length; c++) s = i[c], !(t.indexOf(s) >= 0) && (r[s] = e[s]); return r; } var Qm = "NOT_FOUND"; function fI(e) { var t; return { get: function(i) { return t && e(t.key, i) ? t.value : Qm; }, put: function(i, s) { t = { key: i, value: s }; }, getEntries: function() { return t ? [t] : []; }, clear: function() { t = void 0; } }; } function pI(e, t) { var r = []; function i(m) { var y = r.findIndex(function(S) { return t(m, S.key); }); if (y > -1) { var g = r[y]; return y > 0 && (r.splice(y, 1), r.unshift(g)), g.value; } return Qm; } function s(m, y) { i(m) === Qm && (r.unshift({ key: m, value: y }), r.length > e && r.pop()); } function c() { return r; } function f() { r = []; } return { get: i, put: s, getEntries: c, clear: f }; } var hI = function(t, r) { return t === r; }; function vI(e) { return function(r, i) { if (r === null || i === null || r.length !== i.length) return !1; for (var s = r.length, c = 0; c < s; c++) if (!e(r[c], i[c])) return !1; return !0; }; } function mI(e, t) { var r = typeof t == "object" ? t : { equalityCheck: t }, i = r.equalityCheck, s = i === void 0 ? hI : i, c = r.maxSize, f = c === void 0 ? 1 : c, m = r.resultEqualityCheck, y = vI(s), g = f === 1 ? fI(y) : pI(f, y); function S() { var E = g.get(arguments); if (E === Qm) { if (E = e.apply(null, arguments), m) { var w = g.getEntries(), D = w.find(function(M) { return m(M.value, E); }); D && (E = D.value); } g.put(arguments, E); } return E; } return S.clearCache = function() { return g.clear(); }, S; } function gI(e) { var t = Array.isArray(e[0]) ? e[0] : e; if (!t.every(function(i) { return typeof i == "function"; })) { var r = t.map(function(i) { return typeof i == "function" ? "function " + (i.name || "unnamed") + "()" : typeof i; }).join(", "); throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + r + "]"); } return t; } function yI(e) { for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++) r[i - 1] = arguments[i]; var s = function() { for (var f = arguments.length, m = new Array(f), y = 0; y < f; y++) m[y] = arguments[y]; var g = 0, S, E = { memoizeOptions: void 0 }, w = m.pop(); if (typeof w == "object" && (E = w, w = m.pop()), typeof w != "function") throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof w + "]"); var D = E, M = D.memoizeOptions, k = M === void 0 ? r : M, R = Array.isArray(k) ? k : [k], O = gI(m), I = e.apply(void 0, [function() { return g++, w.apply(null, arguments); }].concat(R)), A = e(function() { for (var H = [], q = O.length, U = 0; U < q; U++) H.push(O[U].apply(null, arguments)); return S = I.apply(null, H), S; }); return Object.assign(A, { resultFunc: w, memoizedResultFunc: I, dependencies: O, lastResult: function() { return S; }, recomputations: function() { return g; }, resetRecomputations: function() { return g = 0; } }), A; }; return s; } var Ze = /* @__PURE__ */ yI(mI); function xI(e) { return e != null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE; } function xD(e) { var t; return xI(e) && (t = e.ownerDocument) != null ? t : document; } function SI() { return !!(typeof window < "u" && window.document && window.document.createElement); } var bI = /* @__PURE__ */ SI(); const SD = 1 / 60 * 1e3, CI = typeof performance < "u" ? () => performance.now() : () => Date.now(), bD = typeof window < "u" ? (e) => window.requestAnimationFrame(e) : (e) => setTimeout(() => e(CI()), SD); function EI(e) { let t = [], r = [], i = 0, s = !1, c = !1; const f = /* @__PURE__ */ new WeakSet(), m = { schedule: (y, g = !1, S = !1) => { const E = S && s, w = E ? t : r; return g && f.add(y), w.indexOf(y) === -1 && (w.push(y), E && s && (i = t.length)), y; }, cancel: (y) => { const g = r.indexOf(y); g !== -1 && r.splice(g, 1), f.delete(y); }, process: (y) => { if (s) { c = !0; return; } if (s = !0, [t, r] = [r, t], r.length = 0, i = t.length, i) for (let g = 0; g < i; g++) { const S = t[g]; S(y), f.has(S) && (m.schedule(S), e()); } s = !1, c && (c = !1, m.process(y)); } }; return m; } const wI = 40; let ES = !0, Lp = !1, wS = !1; const Pd = { delta: 0, timestamp: 0 }, th = [ "read", "update", "preRender", "render", "postRender" ], Sg = th.reduce((e, t) => (e[t] = EI(() => Lp = !0), e), {}), jI = th.reduce((e, t) => { const r = Sg[t]; return e[t] = (i, s = !1, c = !1) => (Lp || _I(), r.schedule(i, s, c)), e; }, {}), TI = th.reduce((e, t) => (e[t] = Sg[t].cancel, e), {}); th.reduce((e, t) => (e[t] = () => Sg[t].process(Pd), e), {}); const DI = (e) => Sg[e].process(Pd), CD = (e) => { Lp = !1, Pd.delta = ES ? SD : Math.max(Math.min(e - Pd.timestamp, wI), 1), Pd.timestamp = e, wS = !0, th.forEach(DI), wS = !1, Lp && (ES = !1, bD(CD)); }, _I = () => { Lp = !0, ES = !0, wS || bD(CD); }, Hw = () => Pd; function vb(e) { const { viewBox: t = "0 0 24 24", d: r, displayName: i, defaultProps: s = {} } = e, c = eh.toArray(e.path), f = lt((m, y) => /* @__PURE__ */ u.jsx(ia, { ref: y, viewBox: t, ...s, ...m, children: c.length ? c : /* @__PURE__ */ u.jsx("path", { fill: "currentColor", d: r }) })); return f.displayName = i, f; } function nh(e) { const { theme: t } = _O(), r = sI(); return Xt( () => lI(t.direction, { ...r, ...e }), [e, t.direction, r] ); } var MI = Object.defineProperty, kI = (e, t, r) => t in e ? MI(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, lr = (e, t, r) => (kI(e, typeof t != "symbol" ? t + "" : t, r), r); function Vw(e) { return e.sort((t, r) => { const i = t.compareDocumentPosition(r); if (i & Node.DOCUMENT_POSITION_FOLLOWING || i & Node.DOCUMENT_POSITION_CONTAINED_BY) return -1; if (i & Node.DOCUMENT_POSITION_PRECEDING || i & Node.DOCUMENT_POSITION_CONTAINS) return 1; if (i & Node.DOCUMENT_POSITION_DISCONNECTED || i & Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC) throw Error("Cannot sort the given nodes."); return 0; }); } var RI = (e) => typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE; function Ww(e, t, r) { let i = e + 1; return r && i >= t && (i = 0), i; } function Gw(e, t, r) { let i = e - 1; return r && i < 0 && (i = t), i; } var jS = typeof window < "u" ? co : ot, Zm = (e) => e, PI = class { constructor() { lr(this, "descendants", /* @__PURE__ */ new Map()), lr(this, "register", (e) => { if (e != null) return RI(e) ? this.registerNode(e) : (t) => { this.registerNode(t, e); }; }), lr(this, "unregister", (e) => { this.descendants.delete(e); const t = Vw(Array.from(this.descendants.keys())); this.assignIndex(t); }), lr(this, "destroy", () => { this.descendants.clear(); }), lr(this, "assignIndex", (e) => { this.descendants.forEach((t) => { const r = e.indexOf(t.node); t.index = r, t.node.dataset.index = t.index.toString(); }); }), lr(this, "count", () => this.descendants.size), lr(this, "enabledCount", () => this.enabledValues().length), lr(this, "values", () => Array.from(this.descendants.values()).sort((t, r) => t.index - r.index)), lr(this, "enabledValues", () => this.values().filter((e) => !e.disabled)), lr(this, "item", (e) => { if (this.count() !== 0) return this.values()[e]; }), lr(this, "enabledItem", (e) => { if (this.enabledCount() !== 0) return this.enabledValues()[e]; }), lr(this, "first", () => this.item(0)), lr(this, "firstEnabled", () => this.enabledItem(0)), lr(this, "last", () => this.item(this.descendants.size - 1)), lr(this, "lastEnabled", () => { const e = this.enabledValues().length - 1; return this.enabledItem(e); }), lr(this, "indexOf", (e) => { var t, r; return e && (r = (t = this.descendants.get(e)) == null ? void 0 : t.index) != null ? r : -1; }), lr(this, "enabledIndexOf", (e) => e == null ? -1 : this.enabledValues().findIndex((t) => t.node.isSameNode(e))), lr(this, "next", (e, t = !0) => { const r = Ww(e, this.count(), t); return this.item(r); }), lr(this, "nextEnabled", (e, t = !0) => { const r = this.item(e); if (!r) return; const i = this.enabledIndexOf(r.node), s = Ww( i, this.enabledCount(), t ); return this.enabledItem(s); }), lr(this, "prev", (e, t = !0) => { const r = Gw(e, this.count() - 1, t); return this.item(r); }), lr(this, "prevEnabled", (e, t = !0) => { const r = this.item(e); if (!r) return; const i = this.enabledIndexOf(r.node), s = Gw( i, this.enabledCount() - 1, t ); return this.enabledItem(s); }), lr(this, "registerNode", (e, t) => { if (!e || this.descendants.has(e)) return; const r = Array.from(this.descendants.keys()).concat(e), i = Vw(r); t != null && t.disabled && (t.disabled = !!t.disabled); const s = { node: e, index: -1, ...t }; this.descendants.set(e, s), this.assignIndex(i); }); } }; function NI() { const e = Xe(new PI()); return jS(() => () => e.current.destroy()), e.current; } var [OI, ED] = ur({ name: "DescendantsProvider", errorMessage: "useDescendantsContext must be used within DescendantsProvider" }); function AI(e) { const t = ED(), [r, i] = qe(-1), s = Xe(null); jS(() => () => { s.current && t.unregister(s.current); }, []), jS(() => { if (!s.current) return; const f = Number(s.current.dataset.index); r != f && !Number.isNaN(f) && i(f); }); const c = Zm(e ? t.register(e) : t.register); return { descendants: t, index: r, enabledIndex: t.enabledIndexOf(s.current), register: jr(c, s) }; } function mb() { return [ Zm(OI), () => Zm(ED()), () => NI(), (s) => AI(s) ]; } var [zI, bg] = ur({ name: "AccordionStylesContext", hookName: "useAccordionStyles", providerName: "" }), [II, gb] = ur({ name: "AccordionItemContext", hookName: "useAccordionItemContext", providerName: "" }), [ FI, dX, LI, BI ] = mb(), wd = lt( function(t, r) { const { getButtonProps: i } = gb(), s = i(t, r), f = { display: "flex", alignItems: "center", width: "100%", outline: 0, ...bg().button }; return /* @__PURE__ */ u.jsx( $e.button, { ...s, className: It("chakra-accordion__button", t.className), __css: f } ); } ); wd.displayName = "AccordionButton"; function yb(e) { const { value: t, defaultValue: r, onChange: i, shouldUpdate: s = (w, D) => w !== D } = e, c = oa(i), f = oa(s), [m, y] = qe(r), g = t !== void 0, S = g ? t : m, E = oa( (w) => { const M = typeof w == "function" ? w(S) : w; f(S, M) && (g || y(M), c(M)); }, [g, c, S, f] ); return [S, E]; } function UI(e) { const { onChange: t, defaultIndex: r, index: i, allowMultiple: s, allowToggle: c, ...f } = e; WI(e), GI(e); const m = LI(), [y, g] = qe(-1); ot(() => () => { g(-1); }, []); const [S, E] = yb({ value: i, defaultValue() { return s ? r ?? [] : r ?? -1; }, onChange: t }); return { index: S, setIndex: E, htmlProps: f, getAccordionItemProps: (D) => { let M = !1; return D !== null && (M = Array.isArray(S) ? S.includes(D) : S === D), { isOpen: M, onChange: (R) => { if (D !== null) if (s && Array.isArray(S)) { const O = R ? S.concat(D) : S.filter((I) => I !== D); E(O); } else R ? E(D) : c && E(-1); } }; }, focusedIndex: y, setFocusedIndex: g, descendants: m }; } var [HI, xb] = ur({ name: "AccordionContext", hookName: "useAccordionContext", providerName: "Accordion" }); function VI(e) { const { isDisabled: t, isFocusable: r, id: i, ...s } = e, { getAccordionItemProps: c, setFocusedIndex: f } = xb(), m = Xe(null), y = Ko(), g = i ?? y, S = `accordion-button-${g}`, E = `accordion-panel-${g}`; qI(e); const { register: w, index: D, descendants: M } = BI({ disabled: t && !r }), { isOpen: k, onChange: R } = c( D === -1 ? null : D ); YI({ isOpen: k, isDisabled: t }); const O = () => { R == null || R(!0); }, I = () => { R == null || R(!1); }, A = ee(() => { R == null || R(!k), f(D); }, [D, f, k, R]), L = ee( ($) => { const oe = { ArrowDown: () => { const Y = M.nextEnabled(D); Y == null || Y.node.focus(); }, ArrowUp: () => { const Y = M.prevEnabled(D); Y == null || Y.node.focus(); }, Home: () => { const Y = M.firstEnabled(); Y == null || Y.node.focus(); }, End: () => { const Y = M.lastEnabled(); Y == null || Y.node.focus(); } }[$.key]; oe && ($.preventDefault(), oe($)); }, [M, D] ), H = ee(() => { f(D); }, [f, D]), q = ee( function(ae = {}, oe = null) { return { ...ae, type: "button", ref: jr(w, m, oe), id: S, disabled: !!t, "aria-expanded": !!k, "aria-controls": E, onClick: Pt(ae.onClick, A), onFocus: Pt(ae.onFocus, H), onKeyDown: Pt(ae.onKeyDown, L) }; }, [ S, t, k, A, H, L, E, w ] ), U = ee( function(ae = {}, oe = null) { return { ...ae, ref: oe, role: "region", id: E, "aria-labelledby": S, hidden: !k }; }, [S, k, E] ); return { isOpen: k, isDisabled: t, isFocusable: r, onOpen: O, onClose: I, getButtonProps: q, getPanelProps: U, htmlProps: s }; } function WI(e) { const t = e.index || e.defaultIndex, r = t != null && !Array.isArray(t) && e.allowMultiple; Yp({ condition: !!r, message: `If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof t},` }); } function GI(e) { Yp({ condition: !!(e.allowMultiple && e.allowToggle), message: "If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not" }); } function qI(e) { Yp({ condition: !!(e.isFocusable && !e.isDisabled), message: `Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. ` }); } function YI(e) { Yp({ condition: e.isOpen && !!e.isDisabled, message: "Cannot open a disabled accordion item" }); } function jd(e) { const { isOpen: t, isDisabled: r } = gb(), { reduceMotion: i } = xb(), s = It("chakra-accordion__icon", e.className), c = bg(), f = { opacity: r ? 0.4 : 1, transform: t ? "rotate(-180deg)" : void 0, transition: i ? void 0 : "transform 0.2s", transformOrigin: "center", ...c.icon }; return /* @__PURE__ */ u.jsx( ia, { viewBox: "0 0 24 24", "aria-hidden": !0, className: s, __css: f, ...e, children: /* @__PURE__ */ u.jsx( "path", { fill: "currentColor", d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" } ) } ); } jd.displayName = "AccordionIcon"; var Td = lt( function(t, r) { const { children: i, className: s } = t, { htmlProps: c, ...f } = VI(t), y = { ...bg().container, overflowAnchor: "none" }, g = Xt(() => f, [f]); return /* @__PURE__ */ u.jsx(II, { value: g, children: /* @__PURE__ */ u.jsx( $e.div, { ref: r, ...c, className: It("chakra-accordion__item", s), __css: y, children: typeof i == "function" ? i({ isExpanded: !!f.isOpen, isDisabled: !!f.isDisabled }) : i } ) }); } ); Td.displayName = "AccordionItem"; var Nu = { ease: [0.25, 0.1, 0.25, 1], easeIn: [0.4, 0, 1, 1], easeOut: [0, 0, 0.2, 1], easeInOut: [0.4, 0, 0.2, 1] }, Dp = { scale: { enter: { scale: 1 }, exit: { scale: 0.95 } }, fade: { enter: { opacity: 1 }, exit: { opacity: 0 } }, pushLeft: { enter: { x: "100%" }, exit: { x: "-30%" } }, pushRight: { enter: { x: "-100%" }, exit: { x: "30%" } }, pushUp: { enter: { y: "100%" }, exit: { y: "-30%" } }, pushDown: { enter: { y: "-100%" }, exit: { y: "30%" } }, slideLeft: { position: { left: 0, top: 0, bottom: 0, width: "100%" }, enter: { x: 0, y: 0 }, exit: { x: "-100%", y: 0 } }, slideRight: { position: { right: 0, top: 0, bottom: 0, width: "100%" }, enter: { x: 0, y: 0 }, exit: { x: "100%", y: 0 } }, slideUp: { position: { top: 0, left: 0, right: 0, maxWidth: "100vw" }, enter: { x: 0, y: 0 }, exit: { x: 0, y: "-100%" } }, slideDown: { position: { bottom: 0, left: 0, right: 0, maxWidth: "100vw" }, enter: { x: 0, y: 0 }, exit: { x: 0, y: "100%" } } }; function TS(e) { var t; switch ((t = e == null ? void 0 : e.direction) != null ? t : "right") { case "right": return Dp.slideRight; case "left": return Dp.slideLeft; case "bottom": return Dp.slideDown; case "top": return Dp.slideUp; default: return Dp.slideRight; } } var Iu = { enter: { duration: 0.2, ease: Nu.easeOut }, exit: { duration: 0.1, ease: Nu.easeIn } }, lo = { enter: (e, t) => ({ ...e, delay: typeof t == "number" ? t : t == null ? void 0 : t.enter }), exit: (e, t) => ({ ...e, delay: typeof t == "number" ? t : t == null ? void 0 : t.exit }) }, KI = (e) => e != null && parseInt(e.toString(), 10) > 0, qw = { exit: { height: { duration: 0.2, ease: Nu.ease }, opacity: { duration: 0.3, ease: Nu.ease } }, enter: { height: { duration: 0.3, ease: Nu.ease }, opacity: { duration: 0.4, ease: Nu.ease } } }, XI = { exit: ({ animateOpacity: e, startingHeight: t, transition: r, transitionEnd: i, delay: s }) => { var c; return { ...e && { opacity: KI(t) ? 1 : 0 }, height: t, transitionEnd: i == null ? void 0 : i.exit, transition: (c = r == null ? void 0 : r.exit) != null ? c : lo.exit(qw.exit, s) }; }, enter: ({ animateOpacity: e, endingHeight: t, transition: r, transitionEnd: i, delay: s }) => { var c; return { ...e && { opacity: 1 }, height: t, transitionEnd: i == null ? void 0 : i.enter, transition: (c = r == null ? void 0 : r.enter) != null ? c : lo.enter(qw.enter, s) }; } }, wD = Fl( (e, t) => { const { in: r, unmountOnExit: i, animateOpacity: s = !0, startingHeight: c = 0, endingHeight: f = "auto", style: m, className: y, transition: g, transitionEnd: S, ...E } = e, [w, D] = qe(!1); ot(() => { const I = setTimeout(() => { D(!0); }); return () => clearTimeout(I); }, []), Yp({ condition: Boolean(c > 0 && i), message: "startingHeight and unmountOnExit are mutually exclusive. You can't use them together" }); const M = parseFloat(c.toString()) > 0, k = { startingHeight: c, endingHeight: f, animateOpacity: s, transition: w ? g : { enter: { duration: 0 } }, transitionEnd: { enter: S == null ? void 0 : S.enter, exit: i ? S == null ? void 0 : S.exit : { ...S == null ? void 0 : S.exit, display: M ? "block" : "none" } } }, R = i ? r : !0, O = r || i ? "enter" : "exit"; return /* @__PURE__ */ u.jsx(Wu, { initial: !1, custom: k, children: R && /* @__PURE__ */ u.jsx( zs.div, { ref: t, ...E, className: It("chakra-collapse", y), style: { overflow: "hidden", display: "block", ...m }, custom: k, variants: XI, initial: i ? "exit" : !1, animate: O, exit: "exit" } ) }); } ); wD.displayName = "Collapse"; var $I = { enter: ({ transition: e, transitionEnd: t, delay: r } = {}) => { var i; return { opacity: 1, transition: (i = e == null ? void 0 : e.enter) != null ? i : lo.enter(Iu.enter, r), transitionEnd: t == null ? void 0 : t.enter }; }, exit: ({ transition: e, transitionEnd: t, delay: r } = {}) => { var i; return { opacity: 0, transition: (i = e == null ? void 0 : e.exit) != null ? i : lo.exit(Iu.exit, r), transitionEnd: t == null ? void 0 : t.exit }; } }, jD = { initial: "exit", animate: "enter", exit: "exit", variants: $I }, QI = Fl(function(t, r) { const { unmountOnExit: i, in: s, className: c, transition: f, transitionEnd: m, delay: y, ...g } = t, S = s || i ? "enter" : "exit", E = i ? s && i : !0, w = { transition: f, transitionEnd: m, delay: y }; return /* @__PURE__ */ u.jsx(Wu, { custom: w, children: E && /* @__PURE__ */ u.jsx( zs.div, { ref: r, className: It("chakra-fade", c), custom: w, ...jD, animate: S, ...g } ) }); }); QI.displayName = "Fade"; var ZI = { exit: ({ reverse: e, initialScale: t, transition: r, transitionEnd: i, delay: s }) => { var c; return { opacity: 0, ...e ? { scale: t, transitionEnd: i == null ? void 0 : i.exit } : { transitionEnd: { scale: t, ...i == null ? void 0 : i.exit } }, transition: (c = r == null ? void 0 : r.exit) != null ? c : lo.exit(Iu.exit, s) }; }, enter: ({ transitionEnd: e, transition: t, delay: r }) => { var i; return { opacity: 1, scale: 1, transition: (i = t == null ? void 0 : t.enter) != null ? i : lo.enter(Iu.enter, r), transitionEnd: e == null ? void 0 : e.enter }; } }, TD = { initial: "exit", animate: "enter", exit: "exit", variants: ZI }, JI = Fl( function(t, r) { const { unmountOnExit: i, in: s, reverse: c = !0, initialScale: f = 0.95, className: m, transition: y, transitionEnd: g, delay: S, ...E } = t, w = i ? s && i : !0, D = s || i ? "enter" : "exit", M = { initialScale: f, reverse: c, transition: y, transitionEnd: g, delay: S }; return /* @__PURE__ */ u.jsx(Wu, { custom: M, children: w && /* @__PURE__ */ u.jsx( zs.div, { ref: r, className: It("chakra-offset-slide", m), ...TD, animate: D, custom: M, ...E } ) }); } ); JI.displayName = "ScaleFade"; var e4 = { initial: ({ offsetX: e, offsetY: t, transition: r, transitionEnd: i, delay: s }) => { var c; return { opacity: 0, x: e, y: t, transition: (c = r == null ? void 0 : r.exit) != null ? c : lo.exit(Iu.exit, s), transitionEnd: i == null ? void 0 : i.exit }; }, enter: ({ transition: e, transitionEnd: t, delay: r }) => { var i; return { opacity: 1, x: 0, y: 0, transition: (i = e == null ? void 0 : e.enter) != null ? i : lo.enter(Iu.enter, r), transitionEnd: t == null ? void 0 : t.enter }; }, exit: ({ offsetY: e, offsetX: t, transition: r, transitionEnd: i, reverse: s, delay: c }) => { var f; const m = { x: t, y: e }; return { opacity: 0, transition: (f = r == null ? void 0 : r.exit) != null ? f : lo.exit(Iu.exit, c), ...s ? { ...m, transitionEnd: i == null ? void 0 : i.exit } : { transitionEnd: { ...m, ...i == null ? void 0 : i.exit } } }; } }, DS = { initial: "initial", animate: "enter", exit: "exit", variants: e4 }, t4 = Fl( function(t, r) { const { unmountOnExit: i, in: s, reverse: c = !0, className: f, offsetX: m = 0, offsetY: y = 8, transition: g, transitionEnd: S, delay: E, ...w } = t, D = i ? s && i : !0, M = s || i ? "enter" : "exit", k = { offsetX: m, offsetY: y, reverse: c, transition: g, transitionEnd: S, delay: E }; return /* @__PURE__ */ u.jsx(Wu, { custom: k, children: D && /* @__PURE__ */ u.jsx( zs.div, { ref: r, className: It("chakra-offset-slide", f), custom: k, ...DS, animate: M, ...w } ) }); } ); t4.displayName = "SlideFade"; var Yw = { exit: { duration: 0.15, ease: Nu.easeInOut }, enter: { type: "spring", damping: 25, stiffness: 180 } }, n4 = { exit: ({ direction: e, transition: t, transitionEnd: r, delay: i }) => { var s; const { exit: c } = TS({ direction: e }); return { ...c, transition: (s = t == null ? void 0 : t.exit) != null ? s : lo.exit(Yw.exit, i), transitionEnd: r == null ? void 0 : r.exit }; }, enter: ({ direction: e, transitionEnd: t, transition: r, delay: i }) => { var s; const { enter: c } = TS({ direction: e }); return { ...c, transition: (s = r == null ? void 0 : r.enter) != null ? s : lo.enter(Yw.enter, i), transitionEnd: t == null ? void 0 : t.enter }; } }, DD = Fl(function(t, r) { const { direction: i = "right", style: s, unmountOnExit: c, in: f, className: m, transition: y, transitionEnd: g, delay: S, motionProps: E, ...w } = t, D = TS({ direction: i }), M = Object.assign( { position: "fixed" }, D.position, s ), k = c ? f && c : !0, R = f || c ? "enter" : "exit", O = { transitionEnd: g, transition: y, direction: i, delay: S }; return /* @__PURE__ */ u.jsx(Wu, { custom: O, children: k && /* @__PURE__ */ u.jsx( zs.div, { ...w, ref: r, initial: "exit", className: It("chakra-slide", m), animate: R, exit: "exit", custom: O, variants: n4, style: M, ...E } ) }); }); DD.displayName = "Slide"; var Dd = lt( function(t, r) { const { className: i, motionProps: s, ...c } = t, { reduceMotion: f } = xb(), { getPanelProps: m, isOpen: y } = gb(), g = m(c, r), S = It("chakra-accordion__panel", i), E = bg(); f || delete g.hidden; const w = /* @__PURE__ */ u.jsx($e.div, { ...g, __css: E.panel, className: S }); return f ? w : /* @__PURE__ */ u.jsx(wD, { in: y, ...s, children: w }); } ); Dd.displayName = "AccordionPanel"; var Sb = lt(function({ children: t, reduceMotion: r, ...i }, s) { const c = Ha("Accordion", i), f = Tr(i), { htmlProps: m, descendants: y, ...g } = UI(f), S = Xt( () => ({ ...g, reduceMotion: !!r }), [g, r] ); return /* @__PURE__ */ u.jsx(FI, { value: y, children: /* @__PURE__ */ u.jsx(HI, { value: S, children: /* @__PURE__ */ u.jsx(zI, { value: c, children: /* @__PURE__ */ u.jsx( $e.div, { ref: s, ...m, className: It("chakra-accordion", i.className), __css: c.root, children: t } ) }) }) }); }); Sb.displayName = "Accordion"; var r4 = { horizontal: { "> *:first-of-type:not(:last-of-type)": { borderEndRadius: 0 }, "> *:not(:first-of-type):not(:last-of-type)": { borderRadius: 0 }, "> *:not(:first-of-type):last-of-type": { borderStartRadius: 0 } }, vertical: { "> *:first-of-type:not(:last-of-type)": { borderBottomRadius: 0 }, "> *:not(:first-of-type):not(:last-of-type)": { borderRadius: 0 }, "> *:not(:first-of-type):last-of-type": { borderTopRadius: 0 } } }, a4 = { horizontal: (e) => ({ "& > *:not(style) ~ *:not(style)": { marginStart: e } }), vertical: (e) => ({ "& > *:not(style) ~ *:not(style)": { marginTop: e } }) }, qr = lt( function(t, r) { const { size: i, colorScheme: s, variant: c, className: f, spacing: m = "0.5rem", isAttached: y, isDisabled: g, orientation: S = "horizontal", ...E } = t, w = It("chakra-button__group", f), D = Xt( () => ({ size: i, colorScheme: s, variant: c, isDisabled: g }), [i, s, c, g] ); let M = { display: "inline-flex", ...y ? r4[S] : a4[S](m) }; const k = S === "vertical"; return /* @__PURE__ */ u.jsx(MO, { value: D, children: /* @__PURE__ */ u.jsx( $e.div, { ref: r, role: "group", __css: M, className: w, "data-attached": y ? "" : void 0, "data-orientation": S, flexDir: k ? "column" : void 0, ...E } ) }); } ); qr.displayName = "ButtonGroup"; var [fX, i4] = ur({ name: "CheckboxGroupContext", strict: !1 }); function o4(e) { return /* @__PURE__ */ u.jsx( $e.svg, { width: "1.2em", viewBox: "0 0 12 10", style: { fill: "none", strokeWidth: 2, stroke: "currentColor", strokeDasharray: 16 }, ...e, children: /* @__PURE__ */ u.jsx("polyline", { points: "1.5 6 4.5 9 10.5 1" }) } ); } function s4(e) { return /* @__PURE__ */ u.jsx( $e.svg, { width: "1.2em", viewBox: "0 0 24 24", style: { stroke: "currentColor", strokeWidth: 4 }, ...e, children: /* @__PURE__ */ u.jsx("line", { x1: "21", x2: "3", y1: "12", y2: "12" }) } ); } function l4(e) { const { isIndeterminate: t, isChecked: r, ...i } = e, s = t ? s4 : o4; return r || t ? /* @__PURE__ */ u.jsx( $e.div, { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100%" }, children: /* @__PURE__ */ u.jsx(s, { ...i }) } ) : null; } var [u4, _D] = ur({ name: "FormControlStylesContext", errorMessage: `useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" ` }), [c4, Yu] = ur({ strict: !1, name: "FormControlContext" }); function d4(e) { const { id: t, isRequired: r, isInvalid: i, isDisabled: s, isReadOnly: c, ...f } = e, m = Ko(), y = t || `field-${m}`, g = `${y}-label`, S = `${y}-feedback`, E = `${y}-helptext`, [w, D] = qe(!1), [M, k] = qe(!1), [R, O] = qe(!1), I = ee( (U = {}, $ = null) => ({ id: E, ...U, ref: jr($, (ae) => { ae && k(!0); }) }), [E] ), A = ee( (U = {}, $ = null) => { var ae, oe; return { ...U, ref: $, "data-focus": Kt(R), "data-disabled": Kt(s), "data-invalid": Kt(i), "data-readonly": Kt(c), id: (ae = U.id) != null ? ae : g, htmlFor: (oe = U.htmlFor) != null ? oe : y }; }, [y, s, R, i, c, g] ), L = ee( (U = {}, $ = null) => ({ id: S, ...U, ref: jr($, (ae) => { ae && D(!0); }), "aria-live": "polite" }), [S] ), H = ee( (U = {}, $ = null) => ({ ...U, ...f, ref: $, role: "group" }), [f] ), q = ee( (U = {}, $ = null) => ({ ...U, ref: $, role: "presentation", "aria-hidden": !0, children: U.children || "*" }), [] ); return { isRequired: !!r, isInvalid: !!i, isReadOnly: !!c, isDisabled: !!s, isFocused: !!R, onFocus: () => O(!0), onBlur: () => O(!1), hasFeedbackText: w, setHasFeedbackText: D, hasHelpText: M, setHasHelpText: k, id: y, labelId: g, feedbackId: S, helpTextId: E, htmlProps: f, getHelpTextProps: I, getErrorMessageProps: L, getRootProps: H, getLabelProps: A, getRequiredIndicatorProps: q }; } var dn = lt( function(t, r) { const i = Ha("Form", t), s = Tr(t), { getRootProps: c, htmlProps: f, ...m } = d4(s), y = It("chakra-form-control", t.className); return /* @__PURE__ */ u.jsx(c4, { value: m, children: /* @__PURE__ */ u.jsx(u4, { value: i, children: /* @__PURE__ */ u.jsx( $e.div, { ...c({}, r), className: y, __css: i.container } ) }) }); } ); dn.displayName = "FormControl"; var Fa = lt( function(t, r) { const i = Yu(), s = _D(), c = It("chakra-form__helper-text", t.className); return /* @__PURE__ */ u.jsx( $e.div, { ...i == null ? void 0 : i.getHelpTextProps(t, r), __css: s.helperText, className: c } ); } ); Fa.displayName = "FormHelperText"; var [f4, p4] = ur({ name: "FormErrorStylesContext", errorMessage: `useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in "" ` }), La = lt( (e, t) => { const r = Ha("FormError", e), i = Tr(e), s = Yu(); return s != null && s.isInvalid ? /* @__PURE__ */ u.jsx(f4, { value: r, children: /* @__PURE__ */ u.jsx( $e.div, { ...s == null ? void 0 : s.getErrorMessageProps(i, t), className: It("chakra-form__error-message", e.className), __css: { display: "flex", alignItems: "center", ...r.text } } ) }) : null; } ); La.displayName = "FormErrorMessage"; var h4 = lt((e, t) => { const r = p4(), i = Yu(); if (!(i != null && i.isInvalid)) return null; const s = It("chakra-form__error-icon", e.className); return /* @__PURE__ */ u.jsx( ia, { ref: t, "aria-hidden": !0, ...e, __css: r.icon, className: s, children: /* @__PURE__ */ u.jsx( "path", { fill: "currentColor", d: "M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z" } ) } ); }); h4.displayName = "FormErrorIcon"; var Sn = lt(function(t, r) { var i; const s = Hd("FormLabel", t), c = Tr(t), { className: f, children: m, requiredIndicator: y = /* @__PURE__ */ u.jsx(MD, {}), optionalIndicator: g = null, ...S } = c, E = Yu(), w = (i = E == null ? void 0 : E.getLabelProps(S, r)) != null ? i : { ref: r, ...S }; return /* @__PURE__ */ u.jsxs( $e.label, { ...w, className: It("chakra-form__label", c.className), __css: { display: "block", textAlign: "start", ...s }, children: [ m, E != null && E.isRequired ? y : g ] } ); }); Sn.displayName = "FormLabel"; var MD = lt( function(t, r) { const i = Yu(), s = _D(); if (!(i != null && i.isRequired)) return null; const c = It("chakra-form__required-indicator", t.className); return /* @__PURE__ */ u.jsx( $e.span, { ...i == null ? void 0 : i.getRequiredIndicatorProps(t, r), __css: s.requiredIndicator, className: c } ); } ); MD.displayName = "RequiredIndicator"; function bb(e) { const { isDisabled: t, isInvalid: r, isReadOnly: i, isRequired: s, ...c } = Cb(e); return { ...c, disabled: t, readOnly: i, required: s, "aria-invalid": _s(r), "aria-required": _s(s), "aria-readonly": _s(i) }; } function Cb(e) { var t, r, i; const s = Yu(), { id: c, disabled: f, readOnly: m, required: y, isRequired: g, isInvalid: S, isReadOnly: E, isDisabled: w, onFocus: D, onBlur: M, ...k } = e, R = e["aria-describedby"] ? [e["aria-describedby"]] : []; return s != null && s.hasFeedbackText && (s != null && s.isInvalid) && R.push(s.feedbackId), s != null && s.hasHelpText && R.push(s.helpTextId), { ...k, "aria-describedby": R.join(" ") || void 0, id: c ?? (s == null ? void 0 : s.id), isDisabled: (t = f ?? w) != null ? t : s == null ? void 0 : s.isDisabled, isReadOnly: (r = m ?? E) != null ? r : s == null ? void 0 : s.isReadOnly, isRequired: (i = y ?? g) != null ? i : s == null ? void 0 : s.isRequired, isInvalid: S ?? (s == null ? void 0 : s.isInvalid), onFocus: Pt(s == null ? void 0 : s.onFocus, D), onBlur: Pt(s == null ? void 0 : s.onBlur, M) }; } var Eb = { border: "0", clip: "rect(0, 0, 0, 0)", height: "1px", width: "1px", margin: "-1px", padding: "0", overflow: "hidden", whiteSpace: "nowrap", position: "absolute" }, kD = $e("span", { baseStyle: Eb }); kD.displayName = "VisuallyHidden"; var v4 = $e("input", { baseStyle: Eb }); v4.displayName = "VisuallyHiddenInput"; var Kw = !1, rh = null, Uu = !1, _S = !1, MS = /* @__PURE__ */ new Set(); function wb(e, t) { MS.forEach((r) => r(e, t)); } var m4 = typeof window < "u" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : !1; function g4(e) { return !(e.metaKey || !m4 && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta"); } function Xw(e) { Uu = !0, g4(e) && (rh = "keyboard", wb("keyboard", e)); } function gd(e) { if (rh = "pointer", e.type === "mousedown" || e.type === "pointerdown") { Uu = !0; const t = e.composedPath ? e.composedPath()[0] : e.target; let r = !1; try { r = t.matches(":focus-visible"); } catch { } if (r) return; wb("pointer", e); } } function y4(e) { return e.mozInputSource === 0 && e.isTrusted ? !0 : e.detail === 0 && !e.pointerType; } function x4(e) { y4(e) && (Uu = !0, rh = "virtual"); } function S4(e) { e.target === window || e.target === document || (!Uu && !_S && (rh = "virtual", wb("virtual", e)), Uu = !1, _S = !1); } function b4() { Uu = !1, _S = !0; } function $w() { return rh !== "pointer"; } function C4() { if (typeof window > "u" || Kw) return; const { focus: e } = HTMLElement.prototype; HTMLElement.prototype.focus = function(...r) { Uu = !0, e.apply(this, r); }, document.addEventListener("keydown", Xw, !0), document.addEventListener("keyup", Xw, !0), document.addEventListener("click", x4, !0), window.addEventListener("focus", S4, !0), window.addEventListener("blur", b4, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", gd, !0), document.addEventListener("pointermove", gd, !0), document.addEventListener("pointerup", gd, !0)) : (document.addEventListener("mousedown", gd, !0), document.addEventListener("mousemove", gd, !0), document.addEventListener("mouseup", gd, !0)), Kw = !0; } function RD(e) { C4(), e($w()); const t = () => e($w()); return MS.add(t), () => { MS.delete(t); }; } function E4(e, t = []) { const r = Object.assign({}, e); for (const i of t) i in r && delete r[i]; return r; } function PD(e = {}) { const t = Cb(e), { isDisabled: r, isReadOnly: i, isRequired: s, isInvalid: c, id: f, onBlur: m, onFocus: y, "aria-describedby": g } = t, { defaultChecked: S, isChecked: E, isFocusable: w, onChange: D, isIndeterminate: M, name: k, value: R, tabIndex: O = void 0, "aria-label": I, "aria-labelledby": A, "aria-invalid": L, ...H } = e, q = E4(H, [ "isDisabled", "isReadOnly", "isRequired", "isInvalid", "id", "onBlur", "onFocus", "aria-describedby" ]), U = oa(D), $ = oa(m), ae = oa(y), [oe, Y] = qe(!1), [ve, de] = qe(!1), [fe, _e] = qe(!1), [Me, te] = qe(!1); ot(() => RD(Y), []); const K = Xe(null), [se, B] = qe(!0), [re, ke] = qe(!!S), De = E !== void 0, Se = De ? E : re, be = ee( (Qe) => { if (i || r) { Qe.preventDefault(); return; } De || ke(Se ? Qe.target.checked : M ? !0 : Qe.target.checked), U == null || U(Qe); }, [ i, r, Se, De, M, U ] ); Am(() => { K.current && (K.current.indeterminate = Boolean(M)); }, [M]), Kp(() => { r && de(!1); }, [r, de]), Am(() => { const Qe = K.current; Qe != null && Qe.form && (Qe.form.onreset = () => { ke(!!S); }); }, []); const Ie = r && !w, Ue = ee( (Qe) => { Qe.key === " " && te(!0); }, [te] ), tt = ee( (Qe) => { Qe.key === " " && te(!1); }, [te] ); Am(() => { if (!K.current) return; K.current.checked !== Se && ke(K.current.checked); }, [K.current]); const ht = ee( (Qe = {}, rn = null) => { const Tn = (pn) => { ve && pn.preventDefault(), te(!0); }; return { ...Qe, ref: rn, "data-active": Kt(Me), "data-hover": Kt(fe), "data-checked": Kt(Se), "data-focus": Kt(ve), "data-focus-visible": Kt(ve && oe), "data-indeterminate": Kt(M), "data-disabled": Kt(r), "data-invalid": Kt(c), "data-readonly": Kt(i), "aria-hidden": !0, onMouseDown: Pt(Qe.onMouseDown, Tn), onMouseUp: Pt(Qe.onMouseUp, () => te(!1)), onMouseEnter: Pt( Qe.onMouseEnter, () => _e(!0) ), onMouseLeave: Pt( Qe.onMouseLeave, () => _e(!1) ) }; }, [ Me, Se, r, ve, oe, fe, M, c, i ] ), dt = ee( (Qe = {}, rn = null) => ({ ...q, ...Qe, ref: jr(rn, (Tn) => { Tn && B(Tn.tagName === "LABEL"); }), onClick: Pt(Qe.onClick, () => { var Tn; se || ((Tn = K.current) == null || Tn.click(), requestAnimationFrame(() => { var pn; (pn = K.current) == null || pn.focus(); })); }), "data-disabled": Kt(r), "data-checked": Kt(Se), "data-invalid": Kt(c) }), [q, r, Se, c, se] ), Le = ee( (Qe = {}, rn = null) => ({ ...Qe, ref: jr(K, rn), type: "checkbox", name: k, value: R, id: f, tabIndex: O, onChange: Pt(Qe.onChange, be), onBlur: Pt( Qe.onBlur, $, () => de(!1) ), onFocus: Pt( Qe.onFocus, ae, () => de(!0) ), onKeyDown: Pt(Qe.onKeyDown, Ue), onKeyUp: Pt(Qe.onKeyUp, tt), required: s, checked: Se, disabled: Ie, readOnly: i, "aria-label": I, "aria-labelledby": A, "aria-invalid": L ? Boolean(L) : c, "aria-describedby": g, "aria-disabled": r, style: Eb }), [ k, R, f, be, $, ae, Ue, tt, s, Se, Ie, i, I, A, L, c, g, r, O ] ), yt = ee( (Qe = {}, rn = null) => ({ ...Qe, ref: rn, onMouseDown: Pt(Qe.onMouseDown, Qw), onTouchStart: Pt(Qe.onTouchStart, Qw), "data-disabled": Kt(r), "data-checked": Kt(Se), "data-invalid": Kt(c) }), [Se, r, c] ); return { state: { isInvalid: c, isFocused: ve, isChecked: Se, isActive: Me, isHovered: fe, isIndeterminate: M, isDisabled: r, isReadOnly: i, isRequired: s }, getRootProps: dt, getCheckboxProps: ht, getInputProps: Le, getLabelProps: yt, htmlProps: q }; } function Qw(e) { e.preventDefault(), e.stopPropagation(); } var w4 = { display: "inline-flex", alignItems: "center", justifyContent: "center", verticalAlign: "top", userSelect: "none", flexShrink: 0 }, j4 = { cursor: "pointer", display: "inline-flex", alignItems: "center", verticalAlign: "top", position: "relative" }, T4 = Gu({ from: { opacity: 0, strokeDashoffset: 16, transform: "scale(0.95)" }, to: { opacity: 1, strokeDashoffset: 0, transform: "scale(1)" } }), D4 = Gu({ from: { opacity: 0 }, to: { opacity: 1 } }), _4 = Gu({ from: { transform: "scaleX(0.65)" }, to: { transform: "scaleX(1)" } }), ND = lt(function(t, r) { const i = i4(), s = { ...i, ...t }, c = Ha("Checkbox", s), f = Tr(t), { spacing: m = "0.5rem", className: y, children: g, iconColor: S, iconSize: E, icon: w = /* @__PURE__ */ u.jsx(l4, {}), isChecked: D, isDisabled: M = i == null ? void 0 : i.isDisabled, onChange: k, inputProps: R, ...O } = f; let I = D; i != null && i.value && f.value && (I = i.value.includes(f.value)); let A = k; i != null && i.onChange && f.value && (A = ib(i.onChange, k)); const { state: L, getInputProps: H, getCheckboxProps: q, getLabelProps: U, getRootProps: $ } = PD({ ...O, isDisabled: M, isChecked: I, onChange: A }), ae = Xt( () => ({ animation: L.isIndeterminate ? `${D4} 20ms linear, ${_4} 200ms linear` : `${T4} 200ms linear`, fontSize: E, color: S, ...c.icon }), [S, E, , L.isIndeterminate, c.icon] ), oe = Ll(w, { __css: ae, isIndeterminate: L.isIndeterminate, isChecked: L.isChecked }); return /* @__PURE__ */ u.jsxs( $e.label, { __css: { ...j4, ...c.container }, className: It("chakra-checkbox", y), ...$(), children: [ /* @__PURE__ */ u.jsx( "input", { className: "chakra-checkbox__input", ...H(R, r) } ), /* @__PURE__ */ u.jsx( $e.span, { __css: { ...w4, ...c.control }, className: "chakra-checkbox__control", ...q(), children: oe } ), g && /* @__PURE__ */ u.jsx( $e.span, { className: "chakra-checkbox__label", ...U(), __css: { marginStart: m, ...c.label }, children: g } ) ] } ); }); ND.displayName = "Checkbox"; function M4(e) { const t = parseFloat(e); return typeof t != "number" || Number.isNaN(t) ? 0 : t; } function jb(e, t) { let r = M4(e); const i = 10 ** (t ?? 10); return r = Math.round(r * i) / i, t ? r.toFixed(t) : r.toString(); } function kS(e) { if (!Number.isFinite(e)) return 0; let t = 1, r = 0; for (; Math.round(e * t) / t !== e; ) t *= 10, r += 1; return r; } function Zw(e, t, r) { return (e - t) * 100 / (r - t); } function k4(e, t, r) { return (r - t) * e + t; } function Jw(e, t, r) { const i = Math.round((e - t) / r) * r + t, s = kS(r); return jb(i, s); } function Lm(e, t, r) { return e == null ? e : (r < t && console.warn("clamp: max cannot be less than min"), Math.min(Math.max(e, t), r)); } function R4(e = {}) { const { onChange: t, precision: r, defaultValue: i, value: s, step: c = 1, min: f = Number.MIN_SAFE_INTEGER, max: m = Number.MAX_SAFE_INTEGER, keepWithinRange: y = !0 } = e, g = oa(t), [S, E] = qe(() => { var oe; return i == null ? "" : (oe = jx(i, c, r)) != null ? oe : ""; }), w = typeof s < "u", D = w ? s : S, M = OD(_l(D), c), k = r ?? M, R = ee( (oe) => { oe !== D && (w || E(oe.toString()), g == null || g(oe.toString(), _l(oe))); }, [g, w, D] ), O = ee( (oe) => { let Y = oe; return y && (Y = Lm(Y, f, m)), jb(Y, k); }, [k, y, m, f] ), I = ee( (oe = c) => { let Y; D === "" ? Y = _l(oe) : Y = _l(D) + oe, Y = O(Y), R(Y); }, [O, c, R, D] ), A = ee( (oe = c) => { let Y; D === "" ? Y = _l(-oe) : Y = _l(D) - oe, Y = O(Y), R(Y); }, [O, c, R, D] ), L = ee(() => { var oe; let Y; i == null ? Y = "" : Y = (oe = jx(i, c, r)) != null ? oe : f, R(Y); }, [i, r, c, R, f]), H = ee( (oe) => { var Y; const ve = (Y = jx(oe, c, k)) != null ? Y : f; R(ve); }, [k, c, R, f] ), q = _l(D); return { isOutOfRange: q > m || q < f, isAtMax: q === m, isAtMin: q === f, precision: k, value: D, valueAsNumber: q, update: R, reset: L, increment: I, decrement: A, clamp: O, cast: H, setValue: E }; } function _l(e) { return parseFloat(e.toString().replace(/[^\w.-]+/g, "")); } function OD(e, t) { return Math.max(kS(t), kS(e)); } function jx(e, t, r) { const i = _l(e); if (Number.isNaN(i)) return; const s = OD(i, t); return jb(i, r ?? s); } var St = {}, ej = { get exports() { return St; }, set exports(e) { St = e; } }; /* object-assign (c) Sindre Sorhus @license MIT */ var Tx, tj; function P4() { if (tj) return Tx; tj = 1; var e = Object.getOwnPropertySymbols, t = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable; function i(c) { if (c == null) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(c); } function s() { try { if (!Object.assign) return !1; var c = new String("abc"); if (c[5] = "de", Object.getOwnPropertyNames(c)[0] === "5") return !1; for (var f = {}, m = 0; m < 10; m++) f["_" + String.fromCharCode(m)] = m; var y = Object.getOwnPropertyNames(f).map(function(S) { return f[S]; }); if (y.join("") !== "0123456789") return !1; var g = {}; return "abcdefghijklmnopqrst".split("").forEach(function(S) { g[S] = S; }), Object.keys(Object.assign({}, g)).join("") === "abcdefghijklmnopqrst"; } catch { return !1; } } return Tx = s() ? Object.assign : function(c, f) { for (var m, y = i(c), g, S = 1; S < arguments.length; S++) { m = Object(arguments[S]); for (var E in m) t.call(m, E) && (y[E] = m[E]); if (e) { g = e(m); for (var w = 0; w < g.length; w++) r.call(m, g[w]) && (y[g[w]] = m[g[w]]); } } return y; }, Tx; } var Dx, nj; function Tb() { if (nj) return Dx; nj = 1; var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; return Dx = e, Dx; } var _x, rj; function AD() { return rj || (rj = 1, _x = Function.call.bind(Object.prototype.hasOwnProperty)), _x; } var Mx, aj; function N4() { if (aj) return Mx; aj = 1; var e = function() { }; if (process.env.NODE_ENV !== "production") { var t = Tb(), r = {}, i = AD(); e = function(c) { var f = "Warning: " + c; typeof console < "u" && console.error(f); try { throw new Error(f); } catch { } }; } function s(c, f, m, y, g) { if (process.env.NODE_ENV !== "production") { for (var S in c) if (i(c, S)) { var E; try { if (typeof c[S] != "function") { var w = Error( (y || "React class") + ": " + m + " type `" + S + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof c[S] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." ); throw w.name = "Invariant Violation", w; } E = c[S](f, S, y, m, null, t); } catch (M) { E = M; } if (E && !(E instanceof Error) && e( (y || "React class") + ": type specification of " + m + " `" + S + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof E + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." ), E instanceof Error && !(E.message in r)) { r[E.message] = !0; var D = g ? g() : ""; e( "Failed " + m + " type: " + E.message + (D ?? "") ); } } } } return s.resetWarningCache = function() { process.env.NODE_ENV !== "production" && (r = {}); }, Mx = s, Mx; } var kx, ij; function O4() { if (ij) return kx; ij = 1; var e = p2, t = P4(), r = Tb(), i = AD(), s = N4(), c = function() { }; process.env.NODE_ENV !== "production" && (c = function(m) { var y = "Warning: " + m; typeof console < "u" && console.error(y); try { throw new Error(y); } catch { } }); function f() { return null; } return kx = function(m, y) { var g = typeof Symbol == "function" && Symbol.iterator, S = "@@iterator"; function E(B) { var re = B && (g && B[g] || B[S]); if (typeof re == "function") return re; } var w = "<>", D = { array: O("array"), bigint: O("bigint"), bool: O("boolean"), func: O("function"), number: O("number"), object: O("object"), string: O("string"), symbol: O("symbol"), any: I(), arrayOf: A, element: L(), elementType: H(), instanceOf: q, node: oe(), objectOf: $, oneOf: U, oneOfType: ae, shape: ve, exact: de }; function M(B, re) { return B === re ? B !== 0 || 1 / B === 1 / re : B !== B && re !== re; } function k(B, re) { this.message = B, this.data = re && typeof re == "object" ? re : {}, this.stack = ""; } k.prototype = Error.prototype; function R(B) { if (process.env.NODE_ENV !== "production") var re = {}, ke = 0; function De(be, Ie, Ue, tt, ht, dt, Le) { if (tt = tt || w, dt = dt || Ue, Le !== r) { if (y) { var yt = new Error( "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types" ); throw yt.name = "Invariant Violation", yt; } else if (process.env.NODE_ENV !== "production" && typeof console < "u") { var Ot = tt + ":" + Ue; !re[Ot] && // Avoid spamming the console because they are often not actionable except for lib authors ke < 3 && (c( "You are manually calling a React.PropTypes validation function for the `" + dt + "` prop on `" + tt + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details." ), re[Ot] = !0, ke++); } } return Ie[Ue] == null ? be ? Ie[Ue] === null ? new k("The " + ht + " `" + dt + "` is marked as required " + ("in `" + tt + "`, but its value is `null`.")) : new k("The " + ht + " `" + dt + "` is marked as required in " + ("`" + tt + "`, but its value is `undefined`.")) : null : B(Ie, Ue, tt, ht, dt); } var Se = De.bind(null, !1); return Se.isRequired = De.bind(null, !0), Se; } function O(B) { function re(ke, De, Se, be, Ie, Ue) { var tt = ke[De], ht = Me(tt); if (ht !== B) { var dt = te(tt); return new k( "Invalid " + be + " `" + Ie + "` of type " + ("`" + dt + "` supplied to `" + Se + "`, expected ") + ("`" + B + "`."), { expectedType: B } ); } return null; } return R(re); } function I() { return R(f); } function A(B) { function re(ke, De, Se, be, Ie) { if (typeof B != "function") return new k("Property `" + Ie + "` of component `" + Se + "` has invalid PropType notation inside arrayOf."); var Ue = ke[De]; if (!Array.isArray(Ue)) { var tt = Me(Ue); return new k("Invalid " + be + " `" + Ie + "` of type " + ("`" + tt + "` supplied to `" + Se + "`, expected an array.")); } for (var ht = 0; ht < Ue.length; ht++) { var dt = B(Ue, ht, Se, be, Ie + "[" + ht + "]", r); if (dt instanceof Error) return dt; } return null; } return R(re); } function L() { function B(re, ke, De, Se, be) { var Ie = re[ke]; if (!m(Ie)) { var Ue = Me(Ie); return new k("Invalid " + Se + " `" + be + "` of type " + ("`" + Ue + "` supplied to `" + De + "`, expected a single ReactElement.")); } return null; } return R(B); } function H() { function B(re, ke, De, Se, be) { var Ie = re[ke]; if (!e.isValidElementType(Ie)) { var Ue = Me(Ie); return new k("Invalid " + Se + " `" + be + "` of type " + ("`" + Ue + "` supplied to `" + De + "`, expected a single ReactElement type.")); } return null; } return R(B); } function q(B) { function re(ke, De, Se, be, Ie) { if (!(ke[De] instanceof B)) { var Ue = B.name || w, tt = se(ke[De]); return new k("Invalid " + be + " `" + Ie + "` of type " + ("`" + tt + "` supplied to `" + Se + "`, expected ") + ("instance of `" + Ue + "`.")); } return null; } return R(re); } function U(B) { if (!Array.isArray(B)) return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? c( "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])." ) : c("Invalid argument supplied to oneOf, expected an array.")), f; function re(ke, De, Se, be, Ie) { for (var Ue = ke[De], tt = 0; tt < B.length; tt++) if (M(Ue, B[tt])) return null; var ht = JSON.stringify(B, function(Le, yt) { var Ot = te(yt); return Ot === "symbol" ? String(yt) : yt; }); return new k("Invalid " + be + " `" + Ie + "` of value `" + String(Ue) + "` " + ("supplied to `" + Se + "`, expected one of " + ht + ".")); } return R(re); } function $(B) { function re(ke, De, Se, be, Ie) { if (typeof B != "function") return new k("Property `" + Ie + "` of component `" + Se + "` has invalid PropType notation inside objectOf."); var Ue = ke[De], tt = Me(Ue); if (tt !== "object") return new k("Invalid " + be + " `" + Ie + "` of type " + ("`" + tt + "` supplied to `" + Se + "`, expected an object.")); for (var ht in Ue) if (i(Ue, ht)) { var dt = B(Ue, ht, Se, be, Ie + "." + ht, r); if (dt instanceof Error) return dt; } return null; } return R(re); } function ae(B) { if (!Array.isArray(B)) return process.env.NODE_ENV !== "production" && c("Invalid argument supplied to oneOfType, expected an instance of array."), f; for (var re = 0; re < B.length; re++) { var ke = B[re]; if (typeof ke != "function") return c( "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + K(ke) + " at index " + re + "." ), f; } function De(Se, be, Ie, Ue, tt) { for (var ht = [], dt = 0; dt < B.length; dt++) { var Le = B[dt], yt = Le(Se, be, Ie, Ue, tt, r); if (yt == null) return null; yt.data && i(yt.data, "expectedType") && ht.push(yt.data.expectedType); } var Ot = ht.length > 0 ? ", expected one of type [" + ht.join(", ") + "]" : ""; return new k("Invalid " + Ue + " `" + tt + "` supplied to " + ("`" + Ie + "`" + Ot + ".")); } return R(De); } function oe() { function B(re, ke, De, Se, be) { return fe(re[ke]) ? null : new k("Invalid " + Se + " `" + be + "` supplied to " + ("`" + De + "`, expected a ReactNode.")); } return R(B); } function Y(B, re, ke, De, Se) { return new k( (B || "React class") + ": " + re + " type `" + ke + "." + De + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + Se + "`." ); } function ve(B) { function re(ke, De, Se, be, Ie) { var Ue = ke[De], tt = Me(Ue); if (tt !== "object") return new k("Invalid " + be + " `" + Ie + "` of type `" + tt + "` " + ("supplied to `" + Se + "`, expected `object`.")); for (var ht in B) { var dt = B[ht]; if (typeof dt != "function") return Y(Se, be, Ie, ht, te(dt)); var Le = dt(Ue, ht, Se, be, Ie + "." + ht, r); if (Le) return Le; } return null; } return R(re); } function de(B) { function re(ke, De, Se, be, Ie) { var Ue = ke[De], tt = Me(Ue); if (tt !== "object") return new k("Invalid " + be + " `" + Ie + "` of type `" + tt + "` " + ("supplied to `" + Se + "`, expected `object`.")); var ht = t({}, ke[De], B); for (var dt in ht) { var Le = B[dt]; if (i(B, dt) && typeof Le != "function") return Y(Se, be, Ie, dt, te(Le)); if (!Le) return new k( "Invalid " + be + " `" + Ie + "` key `" + dt + "` supplied to `" + Se + "`.\nBad object: " + JSON.stringify(ke[De], null, " ") + ` Valid keys: ` + JSON.stringify(Object.keys(B), null, " ") ); var yt = Le(Ue, dt, Se, be, Ie + "." + dt, r); if (yt) return yt; } return null; } return R(re); } function fe(B) { switch (typeof B) { case "number": case "string": case "undefined": return !0; case "boolean": return !B; case "object": if (Array.isArray(B)) return B.every(fe); if (B === null || m(B)) return !0; var re = E(B); if (re) { var ke = re.call(B), De; if (re !== B.entries) { for (; !(De = ke.next()).done; ) if (!fe(De.value)) return !1; } else for (; !(De = ke.next()).done; ) { var Se = De.value; if (Se && !fe(Se[1])) return !1; } } else return !1; return !0; default: return !1; } } function _e(B, re) { return B === "symbol" ? !0 : re ? re["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && re instanceof Symbol : !1; } function Me(B) { var re = typeof B; return Array.isArray(B) ? "array" : B instanceof RegExp ? "object" : _e(re, B) ? "symbol" : re; } function te(B) { if (typeof B > "u" || B === null) return "" + B; var re = Me(B); if (re === "object") { if (B instanceof Date) return "date"; if (B instanceof RegExp) return "regexp"; } return re; } function K(B) { var re = te(B); switch (re) { case "array": case "object": return "an " + re; case "boolean": case "date": case "regexp": return "a " + re; default: return re; } } function se(B) { return !B.constructor || !B.constructor.name ? w : B.constructor.name; } return D.checkPropTypes = s, D.resetWarningCache = s.resetWarningCache, D.PropTypes = D, D; }, kx; } var Rx, oj; function A4() { if (oj) return Rx; oj = 1; var e = Tb(); function t() { } function r() { } return r.resetWarningCache = t, Rx = function() { function i(f, m, y, g, S, E) { if (E !== e) { var w = new Error( "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types" ); throw w.name = "Invariant Violation", w; } } i.isRequired = i; function s() { return i; } var c = { array: i, bigint: i, bool: i, func: i, number: i, object: i, string: i, symbol: i, any: i, arrayOf: s, element: i, elementType: i, instanceOf: s, node: i, objectOf: s, oneOf: s, oneOfType: s, shape: s, exact: s, checkPropTypes: r, resetWarningCache: t }; return c.PropTypes = c, c; }, Rx; } if (process.env.NODE_ENV !== "production") { var z4 = p2, I4 = !0; ej.exports = O4()(z4.isElement, I4); } else ej.exports = A4()(); var RS = "data-focus-lock", zD = "data-focus-lock-disabled", F4 = "data-no-focus-lock", L4 = "data-autofocus-inside", B4 = "data-no-autofocus"; function U4(e, t) { return typeof e == "function" ? e(t) : e && (e.current = t), e; } function H4(e, t) { var r = qe(function() { return { // value value: e, // last callback callback: t, // "memoized" public interface facade: { get current() { return r.value; }, set current(i) { var s = r.value; s !== i && (r.value = i, r.callback(i, s)); } } }; })[0]; return r.callback = t, r.facade; } function ID(e, t) { return H4(t || null, function(r) { return e.forEach(function(i) { return U4(i, r); }); }); } var Px = { width: "1px", height: "0px", padding: 0, overflow: "hidden", position: "fixed", top: "1px", left: "1px" }; process.env.NODE_ENV !== "production" && St.node; var Ho = function() { return Ho = Object.assign || function(t) { for (var r, i = 1, s = arguments.length; i < s; i++) { r = arguments[i]; for (var c in r) Object.prototype.hasOwnProperty.call(r, c) && (t[c] = r[c]); } return t; }, Ho.apply(this, arguments); }; function FD(e, t) { var r = {}; for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.indexOf(i) < 0 && (r[i] = e[i]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var s = 0, i = Object.getOwnPropertySymbols(e); s < i.length; s++) t.indexOf(i[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, i[s]) && (r[i[s]] = e[i[s]]); return r; } function Vd(e, t, r, i) { function s(c) { return c instanceof r ? c : new r(function(f) { f(c); }); } return new (r || (r = Promise))(function(c, f) { function m(S) { try { g(i.next(S)); } catch (E) { f(E); } } function y(S) { try { g(i.throw(S)); } catch (E) { f(E); } } function g(S) { S.done ? c(S.value) : s(S.value).then(m, y); } g((i = i.apply(e, t || [])).next()); }); } function Wd(e, t) { var r = { label: 0, sent: function() { if (c[0] & 1) throw c[1]; return c[1]; }, trys: [], ops: [] }, i, s, c, f; return f = { next: m(0), throw: m(1), return: m(2) }, typeof Symbol == "function" && (f[Symbol.iterator] = function() { return this; }), f; function m(g) { return function(S) { return y([g, S]); }; } function y(g) { if (i) throw new TypeError("Generator is already executing."); for (; f && (f = 0, g[0] && (r = 0)), r; ) try { if (i = 1, s && (c = g[0] & 2 ? s.return : g[0] ? s.throw || ((c = s.return) && c.call(s), 0) : s.next) && !(c = c.call(s, g[1])).done) return c; switch (s = 0, c && (g = [g[0] & 2, c.value]), g[0]) { case 0: case 1: c = g; break; case 4: return r.label++, { value: g[1], done: !1 }; case 5: r.label++, s = g[1], g = [0]; continue; case 7: g = r.ops.pop(), r.trys.pop(); continue; default: if (c = r.trys, !(c = c.length > 0 && c[c.length - 1]) && (g[0] === 6 || g[0] === 2)) { r = 0; continue; } if (g[0] === 3 && (!c || g[1] > c[0] && g[1] < c[3])) { r.label = g[1]; break; } if (g[0] === 6 && r.label < c[1]) { r.label = c[1], c = g; break; } if (c && r.label < c[2]) { r.label = c[2], r.ops.push(g); break; } c[2] && r.ops.pop(), r.trys.pop(); continue; } g = t.call(e, r); } catch (S) { g = [6, S], s = 0; } finally { i = c = 0; } if (g[0] & 5) throw g[1]; return { value: g[0] ? g[1] : void 0, done: !0 }; } } function sj(e, t) { var r = typeof Symbol == "function" && e[Symbol.iterator]; if (!r) return e; var i = r.call(e), s, c = [], f; try { for (; (t === void 0 || t-- > 0) && !(s = i.next()).done; ) c.push(s.value); } catch (m) { f = { error: m }; } finally { try { s && !s.done && (r = i.return) && r.call(i); } finally { if (f) throw f.error; } } return c; } function PS(e, t, r) { if (r || arguments.length === 2) for (var i = 0, s = t.length, c; i < s; i++) (c || !(i in t)) && (c || (c = Array.prototype.slice.call(t, 0, i)), c[i] = t[i]); return e.concat(c || Array.prototype.slice.call(t)); } function LD(e) { return e; } function BD(e, t) { t === void 0 && (t = LD); var r = [], i = !1, s = { read: function() { if (i) throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`."); return r.length ? r[r.length - 1] : e; }, useMedium: function(c) { var f = t(c, i); return r.push(f), function() { r = r.filter(function(m) { return m !== f; }); }; }, assignSyncMedium: function(c) { for (i = !0; r.length; ) { var f = r; r = [], f.forEach(c); } r = { push: function(m) { return c(m); }, filter: function() { return r; } }; }, assignMedium: function(c) { i = !0; var f = []; if (r.length) { var m = r; r = [], m.forEach(c), f = r; } var y = function() { var S = f; f = [], S.forEach(c); }, g = function() { return Promise.resolve().then(y); }; g(), r = { push: function(S) { f.push(S), g(); }, filter: function(S) { return f = f.filter(S), r; } }; } }; return s; } function Db(e, t) { return t === void 0 && (t = LD), BD(e, t); } function UD(e) { e === void 0 && (e = {}); var t = BD(null); return t.options = Ho({ async: !0, ssr: !1 }, e), t; } var HD = function(e) { var t = e.sideCar, r = FD(e, ["sideCar"]); if (!t) throw new Error("Sidecar: please provide `sideCar` property to import the right car"); var i = t.read(); if (!i) throw new Error("Sidecar medium not found"); return Ge.createElement(i, Ho({}, r)); }; HD.isSideCarExport = !0; function V4(e, t) { return e.useMedium(t), HD; } var VD = Db({}, function(e) { var t = e.target, r = e.currentTarget; return { target: t, currentTarget: r }; }), WD = Db(), W4 = Db(), G4 = UD({ async: !0 // focus-lock sidecar is not required on the server // however, it might be required for JSDOM tests // ssr: true, }), q4 = [], _b = /* @__PURE__ */ Ge.forwardRef(function(t, r) { var i, s = Ge.useState(), c = s[0], f = s[1], m = Ge.useRef(), y = Ge.useRef(!1), g = Ge.useRef(null), S = t.children, E = t.disabled, w = t.noFocusGuards, D = t.persistentFocus, M = t.crossFrame, k = t.autoFocus, R = t.allowTextSelection, O = t.group, I = t.className, A = t.whiteList, L = t.hasPositiveIndices, H = t.shards, q = H === void 0 ? q4 : H, U = t.as, $ = U === void 0 ? "div" : U, ae = t.lockProps, oe = ae === void 0 ? {} : ae, Y = t.sideCar, ve = t.returnFocus, de = t.focusOptions, fe = t.onActivation, _e = t.onDeactivation, Me = Ge.useState({}), te = Me[0], K = Ge.useCallback(function() { g.current = g.current || document && document.activeElement, m.current && fe && fe(m.current), y.current = !0; }, [fe]), se = Ge.useCallback(function() { y.current = !1, _e && _e(m.current); }, [_e]); ot(function() { E || (g.current = null); }, []); var B = Ge.useCallback(function(tt) { var ht = g.current; if (ht && ht.focus) { var dt = typeof ve == "function" ? ve(ht) : ve; if (dt) { var Le = typeof dt == "object" ? dt : void 0; g.current = null, tt ? Promise.resolve().then(function() { return ht.focus(Le); }) : ht.focus(Le); } } }, [ve]), re = Ge.useCallback(function(tt) { y.current && VD.useMedium(tt); }, []), ke = WD.useMedium, De = Ge.useCallback(function(tt) { m.current !== tt && (m.current = tt, f(tt)); }, []); process.env.NODE_ENV !== "production" && (typeof R < "u" && console.warn("React-Focus-Lock: allowTextSelection is deprecated and enabled by default"), Ge.useEffect(function() { !m.current && typeof $ != "string" && console.error("FocusLock: could not obtain ref to internal node"); }, [])); var Se = dS((i = {}, i[zD] = E && "disabled", i[RS] = O, i), oe), be = w !== !0, Ie = be && w !== "tail", Ue = ID([r, De]); return /* @__PURE__ */ Ge.createElement(Ge.Fragment, null, be && [ // nearest focus guard /* @__PURE__ */ Ge.createElement("div", { key: "guard-first", "data-focus-guard": !0, tabIndex: E ? -1 : 0, style: Px }), // first tabbed element guard L ? /* @__PURE__ */ Ge.createElement("div", { key: "guard-nearest", "data-focus-guard": !0, tabIndex: E ? -1 : 1, style: Px }) : null ], !E && /* @__PURE__ */ Ge.createElement(Y, { id: te, sideCar: G4, observed: c, disabled: E, persistentFocus: D, crossFrame: M, autoFocus: k, whiteList: A, shards: q, onActivation: K, onDeactivation: se, returnFocus: B, focusOptions: de }), /* @__PURE__ */ Ge.createElement($, dS({ ref: Ue }, Se, { className: I, onBlur: ke, onFocus: re }), S), Ie && /* @__PURE__ */ Ge.createElement("div", { "data-focus-guard": !0, tabIndex: E ? -1 : 0, style: Px })); }); _b.propTypes = process.env.NODE_ENV !== "production" ? { children: St.node, disabled: St.bool, returnFocus: St.oneOfType([St.bool, St.object, St.func]), focusOptions: St.object, noFocusGuards: St.bool, hasPositiveIndices: St.bool, allowTextSelection: St.bool, autoFocus: St.bool, persistentFocus: St.bool, crossFrame: St.bool, group: St.string, className: St.string, whiteList: St.func, shards: St.arrayOf(St.any), as: St.oneOfType([St.string, St.func, St.object]), lockProps: St.object, onActivation: St.func, onDeactivation: St.func, sideCar: St.any.isRequired } : {}; _b.defaultProps = { children: void 0, disabled: !1, returnFocus: !1, focusOptions: void 0, noFocusGuards: !1, autoFocus: !0, persistentFocus: !1, crossFrame: !0, hasPositiveIndices: void 0, allowTextSelection: void 0, group: void 0, className: void 0, whiteList: void 0, shards: void 0, as: "div", lockProps: {}, onActivation: void 0, onDeactivation: void 0 }; const GD = _b; function Y4(e, t) { e.prototype = Object.create(t.prototype), e.prototype.constructor = e, kO(e, t); } function K4(e, t) { if (process.env.NODE_ENV !== "production") { if (typeof e != "function") throw new Error("Expected reducePropsToState to be a function."); if (typeof t != "function") throw new Error("Expected handleStateChangeOnClient to be a function."); } function r(i) { return i.displayName || i.name || "Component"; } return function(s) { if (process.env.NODE_ENV !== "production" && typeof s != "function") throw new Error("Expected WrappedComponent to be a React component."); var c = [], f; function m() { f = e(c.map(function(g) { return g.props; })), t(f); } var y = /* @__PURE__ */ function(g) { Y4(S, g); function S() { return g.apply(this, arguments) || this; } S.peek = function() { return f; }; var E = S.prototype; return E.componentDidMount = function() { c.push(this), m(); }, E.componentDidUpdate = function() { m(); }, E.componentWillUnmount = function() { var D = c.indexOf(this); c.splice(D, 1), m(); }, E.render = function() { return /* @__PURE__ */ jt.createElement(s, this.props); }, S; }(rI); return RO(y, "displayName", "SideEffect(" + r(s) + ")"), y; }; } var Xo = function(e) { for (var t = Array(e.length), r = 0; r < e.length; ++r) t[r] = e[r]; return t; }, Jm = function(e) { return Array.isArray(e) ? e : [e]; }, qD = function(e) { return Array.isArray(e) ? e[0] : e; }, X4 = function(e) { if (e.nodeType !== Node.ELEMENT_NODE) return !1; var t = window.getComputedStyle(e, null); return !t || !t.getPropertyValue ? !1 : t.getPropertyValue("display") === "none" || t.getPropertyValue("visibility") === "hidden"; }, YD = function(e) { return e.parentNode && e.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? ( // eslint-disable-next-line @typescript-eslint/no-explicit-any e.parentNode.host ) : e.parentNode; }, KD = function(e) { return e === document || e && e.nodeType === Node.DOCUMENT_NODE; }, $4 = function(e, t) { return !e || KD(e) || !X4(e) && t(YD(e)); }, XD = function(e, t) { var r = e.get(t); if (r !== void 0) return r; var i = $4(t, XD.bind(void 0, e)); return e.set(t, i), i; }, Q4 = function(e, t) { return e && !KD(e) ? e5(e) ? t(YD(e)) : !1 : !0; }, $D = function(e, t) { var r = e.get(t); if (r !== void 0) return r; var i = Q4(t, $D.bind(void 0, e)); return e.set(t, i), i; }, QD = function(e) { return e.dataset; }, Z4 = function(e) { return e.tagName === "BUTTON"; }, ZD = function(e) { return e.tagName === "INPUT"; }, JD = function(e) { return ZD(e) && e.type === "radio"; }, J4 = function(e) { return !((ZD(e) || Z4(e)) && (e.type === "hidden" || e.disabled)); }, e5 = function(e) { var t = e.getAttribute(B4); return ![!0, "true", ""].includes(t); }, Mb = function(e) { var t; return Boolean(e && ((t = QD(e)) === null || t === void 0 ? void 0 : t.focusGuard)); }, eg = function(e) { return !Mb(e); }, t5 = function(e) { return Boolean(e); }, n5 = function(e, t) { var r = e.tabIndex - t.tabIndex, i = e.index - t.index; if (r) { if (!e.tabIndex) return 1; if (!t.tabIndex) return -1; } return r || i; }, e_ = function(e, t, r) { return Xo(e).map(function(i, s) { return { node: i, index: s, tabIndex: r && i.tabIndex === -1 ? (i.dataset || {}).focusGuard ? 0 : -1 : i.tabIndex }; }).filter(function(i) { return !t || i.tabIndex >= 0; }).sort(n5); }, r5 = [ "button:enabled", "select:enabled", "textarea:enabled", "input:enabled", // elements with explicit roles will also use explicit tabindex // '[role="button"]', "a[href]", "area[href]", "summary", "iframe", "object", "embed", "audio[controls]", "video[controls]", "[tabindex]", "[contenteditable]", "[autofocus]" ], kb = r5.join(","), a5 = "".concat(kb, ", [data-focus-guard]"), t_ = function(e, t) { return Xo((e.shadowRoot || e).children).reduce(function(r, i) { return r.concat(i.matches(t ? a5 : kb) ? [i] : [], t_(i)); }, []); }, i5 = function(e, t) { var r; return e instanceof HTMLIFrameElement && (!((r = e.contentDocument) === null || r === void 0) && r.body) ? Cg([e.contentDocument.body], t) : [e]; }, Cg = function(e, t) { return e.reduce(function(r, i) { var s, c = t_(i, t), f = (s = []).concat.apply(s, c.map(function(m) { return i5(m, t); })); return r.concat( // add all tabbables inside and within shadow DOMs in DOM order f, // add if node is tabbable itself i.parentNode ? Xo(i.parentNode.querySelectorAll(kb)).filter(function(m) { return m === i; }) : [] ); }, []); }, o5 = function(e) { var t = e.querySelectorAll("[".concat(L4, "]")); return Xo(t).map(function(r) { return Cg([r]); }).reduce(function(r, i) { return r.concat(i); }, []); }, Rb = function(e, t) { return Xo(e).filter(function(r) { return XD(t, r); }).filter(function(r) { return J4(r); }); }, lj = function(e, t) { return t === void 0 && (t = /* @__PURE__ */ new Map()), Xo(e).filter(function(r) { return $D(t, r); }); }, NS = function(e, t, r) { return e_(Rb(Cg(e, r), t), !0, r); }, uj = function(e, t) { return e_(Rb(Cg(e), t), !1); }, s5 = function(e, t) { return Rb(o5(e), t); }, Nd = function(e, t) { return e.shadowRoot ? Nd(e.shadowRoot, t) : Object.getPrototypeOf(e).contains !== void 0 && Object.getPrototypeOf(e).contains.call(e, t) ? !0 : Xo(e.children).some(function(r) { var i; if (r instanceof HTMLIFrameElement) { var s = (i = r.contentDocument) === null || i === void 0 ? void 0 : i.body; return s ? Nd(s, t) : !1; } return Nd(r, t); }); }, l5 = function(e) { for (var t = /* @__PURE__ */ new Set(), r = e.length, i = 0; i < r; i += 1) for (var s = i + 1; s < r; s += 1) { var c = e[i].compareDocumentPosition(e[s]); (c & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0 && t.add(s), (c & Node.DOCUMENT_POSITION_CONTAINS) > 0 && t.add(i); } return e.filter(function(f, m) { return !t.has(m); }); }, n_ = function(e) { return e.parentNode ? n_(e.parentNode) : e; }, Pb = function(e) { var t = Jm(e); return t.filter(Boolean).reduce(function(r, i) { var s = i.getAttribute(RS); return r.push.apply(r, s ? l5(Xo(n_(i).querySelectorAll("[".concat(RS, '="').concat(s, '"]:not([').concat(zD, '="disabled"])')))) : [i]), r; }, []); }, u5 = function(e) { try { return e(); } catch { return; } }, Bp = function(e) { if (e === void 0 && (e = document), !(!e || !e.activeElement)) { var t = e.activeElement; return t.shadowRoot ? Bp(t.shadowRoot) : t instanceof HTMLIFrameElement && u5(function() { return t.contentWindow.document; }) ? Bp(t.contentWindow.document) : t; } }, c5 = function(e, t) { return e === t; }, d5 = function(e, t) { return Boolean(Xo(e.querySelectorAll("iframe")).some(function(r) { return c5(r, t); })); }, r_ = function(e, t) { return t === void 0 && (t = Bp(qD(e).ownerDocument)), !t || t.dataset && t.dataset.focusGuard ? !1 : Pb(e).some(function(r) { return Nd(r, t) || d5(r, t); }); }, f5 = function(e) { e === void 0 && (e = document); var t = Bp(e); return t ? Xo(e.querySelectorAll("[".concat(F4, "]"))).some(function(r) { return Nd(r, t); }) : !1; }, p5 = function(e, t) { return t.filter(JD).filter(function(r) { return r.name === e.name; }).filter(function(r) { return r.checked; })[0] || e; }, Nb = function(e, t) { return JD(e) && e.name ? p5(e, t) : e; }, h5 = function(e) { var t = /* @__PURE__ */ new Set(); return e.forEach(function(r) { return t.add(Nb(r, e)); }), e.filter(function(r) { return t.has(r); }); }, cj = function(e) { return e[0] && e.length > 1 ? Nb(e[0], e) : e[0]; }, dj = function(e, t) { return e.length > 1 ? e.indexOf(Nb(e[t], e)) : t; }, a_ = "NEW_FOCUS", v5 = function(e, t, r, i) { var s = e.length, c = e[0], f = e[s - 1], m = Mb(r); if (!(r && e.indexOf(r) >= 0)) { var y = r !== void 0 ? t.indexOf(r) : -1, g = i ? t.indexOf(i) : y, S = i ? e.indexOf(i) : -1, E = y - g, w = t.indexOf(c), D = t.indexOf(f), M = h5(t), k = r !== void 0 ? M.indexOf(r) : -1, R = k - (i ? M.indexOf(i) : y), O = dj(e, 0), I = dj(e, s - 1); if (y === -1 || S === -1) return a_; if (!E && S >= 0) return S; if (y <= w && m && Math.abs(E) > 1) return I; if (y >= D && m && Math.abs(E) > 1) return O; if (E && Math.abs(R) > 1) return S; if (y <= w) return I; if (y > D) return O; if (E) return Math.abs(E) > 1 ? S : (s + S + E) % s; } }, m5 = function(e) { return function(t) { var r, i = (r = QD(t)) === null || r === void 0 ? void 0 : r.autofocus; return ( // @ts-expect-error t.autofocus || // i !== void 0 && i !== "false" || // e.indexOf(t) >= 0 ); }; }, g5 = function(e, t, r) { var i = e.map(function(c) { var f = c.node; return f; }), s = lj(i.filter(m5(r))); return s && s.length ? cj(s) : cj(lj(t)); }, OS = function(e, t) { return t === void 0 && (t = []), t.push(e), e.parentNode && OS(e.parentNode.host || e.parentNode, t), t; }, Nx = function(e, t) { for (var r = OS(e), i = OS(t), s = 0; s < r.length; s += 1) { var c = r[s]; if (i.indexOf(c) >= 0) return c; } return !1; }, i_ = function(e, t, r) { var i = Jm(e), s = Jm(t), c = i[0], f = !1; return s.filter(Boolean).forEach(function(m) { f = Nx(f || m, m) || f, r.filter(Boolean).forEach(function(y) { var g = Nx(c, y); g && (!f || Nd(g, f) ? f = g : f = Nx(g, f)); }); }), f; }, y5 = function(e, t) { return e.reduce(function(r, i) { return r.concat(s5(i, t)); }, []); }, x5 = function(e, t) { var r = /* @__PURE__ */ new Map(); return t.forEach(function(i) { return r.set(i.node, i); }), e.map(function(i) { return r.get(i); }).filter(t5); }, S5 = function(e, t) { var r = Bp(Jm(e).length > 0 ? document : qD(e).ownerDocument), i = Pb(e).filter(eg), s = i_(r || e, e, i), c = /* @__PURE__ */ new Map(), f = uj(i, c), m = NS(i, c).filter(function(D) { var M = D.node; return eg(M); }); if (!(!m[0] && (m = f, !m[0]))) { var y = uj([s], c).map(function(D) { var M = D.node; return M; }), g = x5(y, m), S = g.map(function(D) { var M = D.node; return M; }), E = v5(S, y, r, t); if (E === a_) { var w = g5(f, S, y5(i, c)); if (w) return { node: w }; console.warn("focus-lock: cannot find any node to move focus into"); return; } return E === void 0 ? E : g[E]; } }, b5 = function(e) { var t = Pb(e).filter(eg), r = i_(e, e, t), i = /* @__PURE__ */ new Map(), s = NS([r], i, !0), c = NS(t, i).filter(function(f) { var m = f.node; return eg(m); }).map(function(f) { var m = f.node; return m; }); return s.map(function(f) { var m = f.node, y = f.index; return { node: m, index: y, lockItem: c.indexOf(m) >= 0, guard: Mb(m) }; }); }, C5 = function(e, t) { "focus" in e && e.focus(t), "contentWindow" in e && e.contentWindow && e.contentWindow.focus(); }, Ox = 0, Ax = !1, o_ = function(e, t, r) { r === void 0 && (r = {}); var i = S5(e, t); if (!Ax && i) { if (Ox > 2) { console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"), Ax = !0, setTimeout(function() { Ax = !1; }, 1); return; } Ox++, C5(i.node, r.focusOptions), Ox--; } }; function s_(e) { var t = window, r = t.setImmediate; typeof r < "u" ? r(e) : setTimeout(e, 1); } var E5 = function() { return document && document.activeElement === document.body; }, w5 = function() { return E5() || f5(); }, Od = null, _d = null, Ad = null, Up = !1, j5 = function() { return !0; }, T5 = function(t) { return (Od.whiteList || j5)(t); }, D5 = function(t, r) { Ad = { observerNode: t, portaledElement: r }; }, _5 = function(t) { return Ad && Ad.portaledElement === t; }; function fj(e, t, r, i) { var s = null, c = e; do { var f = i[c]; if (f.guard) f.node.dataset.focusAutoGuard && (s = f); else if (f.lockItem) { if (c !== e) return; s = null; } else break; } while ((c += r) !== t); s && (s.node.tabIndex = 0); } var M5 = function(t) { return t && "current" in t ? t.current : t; }, k5 = function(t) { return t ? Boolean(Up) : Up === "meanwhile"; }, R5 = function e(t, r, i) { return r && // find host equal to active element and check nested active element (r.host === t && (!r.activeElement || i.contains(r.activeElement)) || r.parentNode && e(t, r.parentNode, i)); }, P5 = function(t, r) { return r.some(function(i) { return R5(t, i, i); }); }, tg = function() { var t = !1; if (Od) { var r = Od, i = r.observed, s = r.persistentFocus, c = r.autoFocus, f = r.shards, m = r.crossFrame, y = r.focusOptions, g = i || Ad && Ad.portaledElement, S = document && document.activeElement; if (g) { var E = [g].concat(f.map(M5).filter(Boolean)); if ((!S || T5(S)) && (s || k5(m) || !w5() || !_d && c) && (g && !// active element is "inside" working area (r_(E) || // check for shadow-dom contained elements S && P5(S, E) || _5(S)) && (document && !_d && S && !c ? (S.blur && S.blur(), document.body.focus()) : (t = o_(E, _d, { focusOptions: y }), Ad = {})), Up = !1, _d = document && document.activeElement), document) { var w = document && document.activeElement, D = b5(E), M = D.map(function(k) { var R = k.node; return R; }).indexOf(w); M > -1 && (D.filter(function(k) { var R = k.guard, O = k.node; return R && O.dataset.focusAutoGuard; }).forEach(function(k) { var R = k.node; return R.removeAttribute("tabIndex"); }), fj(M, D.length, 1, D), fj(M, -1, -1, D)); } } } return t; }, l_ = function(t) { tg() && t && (t.stopPropagation(), t.preventDefault()); }, Ob = function() { return s_(tg); }, N5 = function(t) { var r = t.target, i = t.currentTarget; i.contains(r) || D5(i, r); }, O5 = function() { return null; }; process.env.NODE_ENV !== "production" && St.node.isRequired; var u_ = function() { Up = "just", setTimeout(function() { Up = "meanwhile"; }, 0); }, A5 = function() { document.addEventListener("focusin", l_), document.addEventListener("focusout", Ob), window.addEventListener("blur", u_); }, z5 = function() { document.removeEventListener("focusin", l_), document.removeEventListener("focusout", Ob), window.removeEventListener("blur", u_); }; function I5(e) { return e.filter(function(t) { var r = t.disabled; return !r; }); } function F5(e) { var t = e.slice(-1)[0]; t && !Od && A5(); var r = Od, i = r && t && t.id === r.id; Od = t, r && !i && (r.onDeactivation(), e.filter(function(s) { var c = s.id; return c === r.id; }).length || r.returnFocus(!t)), t ? (_d = null, (!i || r.observed !== t.observed) && t.onActivation(), tg(), s_(tg)) : (z5(), _d = null); } VD.assignSyncMedium(N5); WD.assignMedium(Ob); W4.assignMedium(function(e) { return e({ moveFocusInside: o_, focusInside: r_ }); }); const L5 = K4(I5, F5)(O5); var c_ = /* @__PURE__ */ Ge.forwardRef(function(t, r) { return /* @__PURE__ */ Ge.createElement(GD, dS({ sideCar: L5, ref: r }, t)); }), d_ = GD.propTypes || {}; d_.sideCar; var B5 = dI(d_, ["sideCar"]); c_.propTypes = process.env.NODE_ENV !== "production" ? B5 : {}; const pj = c_; var hj, U5 = (hj = pj.default) != null ? hj : pj, f_ = (e) => { const { initialFocusRef: t, finalFocusRef: r, contentRef: i, restoreFocus: s, children: c, isDisabled: f, autoFocus: m, persistentFocus: y, lockFocusAcrossFrames: g } = e, S = ee(() => { t != null && t.current ? t.current.focus() : i != null && i.current && PO(i.current).length === 0 && requestAnimationFrame(() => { var M; (M = i.current) == null || M.focus(); }); }, [t, i]), E = ee(() => { var D; (D = r == null ? void 0 : r.current) == null || D.focus(); }, [r]), w = s && !r; return /* @__PURE__ */ u.jsx( U5, { crossFrame: g, persistentFocus: y, autoFocus: m, disabled: f, onActivation: S, onDeactivation: E, returnFocus: w, children: c } ); }; f_.displayName = "FocusLock"; var H5 = bI ? co : ot; function ng(e, t = []) { const r = Xe(e); return H5(() => { r.current = e; }), ee((...i) => { var s; return (s = r.current) == null ? void 0 : s.call(r, ...i); }, t); } function V5(e, t, r, i) { const s = ng(t); return ot(() => { var c; const f = (c = bw(r)) != null ? c : document; if (t) return f.addEventListener(e, s, i), () => { f.removeEventListener(e, s, i); }; }, [e, r, i, s, t]), () => { var c; ((c = bw(r)) != null ? c : document).removeEventListener(e, s, i); }; } function W5(e) { const { ref: t, handler: r, enabled: i = !0 } = e, s = ng(r), f = Xe({ isPointerDown: !1, ignoreEmulatedMouseEvents: !1 }).current; ot(() => { if (!i) return; const m = (E) => { zx(E, t) && (f.isPointerDown = !0); }, y = (E) => { if (f.ignoreEmulatedMouseEvents) { f.ignoreEmulatedMouseEvents = !1; return; } f.isPointerDown && r && zx(E, t) && (f.isPointerDown = !1, s(E)); }, g = (E) => { f.ignoreEmulatedMouseEvents = !0, r && f.isPointerDown && zx(E, t) && (f.isPointerDown = !1, s(E)); }, S = xD(t.current); return S.addEventListener("mousedown", m, !0), S.addEventListener("mouseup", y, !0), S.addEventListener("touchstart", m, !0), S.addEventListener("touchend", g, !0), () => { S.removeEventListener("mousedown", m, !0), S.removeEventListener("mouseup", y, !0), S.removeEventListener("touchstart", m, !0), S.removeEventListener("touchend", g, !0); }; }, [r, t, s, f, i]); } function zx(e, t) { var r; const i = e.target; return e.button > 0 || i && !xD(i).contains(i) ? !1 : !((r = t.current) != null && r.contains(i)); } function G5(e, t) { const r = Ko(); return Xt( () => e || [t, r].filter(Boolean).join("-"), [e, t, r] ); } function q5(e, t) { const r = e !== void 0; return [r, r && typeof e < "u" ? e : t]; } function Ol(e = {}) { const { onClose: t, onOpen: r, isOpen: i, id: s } = e, c = ng(r), f = ng(t), [m, y] = qe(e.defaultIsOpen || !1), [g, S] = q5(i, m), E = G5(s, "disclosure"), w = ee(() => { g || y(!1), f == null || f(); }, [g, f]), D = ee(() => { g || y(!0), c == null || c(); }, [g, c]), M = ee(() => { (S ? w : D)(); }, [S, D, w]); return { isOpen: !!S, onOpen: D, onClose: w, onToggle: M, isControlled: g, getButtonProps: (k = {}) => ({ ...k, "aria-expanded": S, "aria-controls": E, onClick: NO(k.onClick, M) }), getDisclosureProps: (k = {}) => ({ ...k, hidden: !S, id: E }) }; } var Ab = lt(function(t, r) { const { htmlSize: i, ...s } = t, c = Ha("Input", s), f = Tr(s), m = bb(f), y = It("chakra-input", t.className); return /* @__PURE__ */ u.jsx( $e.input, { size: i, ...m, __css: c.field, ref: r, className: y } ); }); Ab.displayName = "Input"; Ab.id = "Input"; var [Y5, p_] = ur({ name: "ListStylesContext", errorMessage: `useListStyles returned is 'undefined'. Seems you forgot to wrap the components in "" ` }), zb = lt(function(t, r) { const i = Ha("List", t), { children: s, styleType: c = "none", stylePosition: f, spacing: m, ...y } = Tr(t), g = h2(s), E = m ? { ["& > *:not(style) ~ *:not(style)"]: { mt: m } } : {}; return /* @__PURE__ */ u.jsx(Y5, { value: i, children: /* @__PURE__ */ u.jsx( $e.ul, { ref: r, listStyleType: c, listStylePosition: f, role: "list", __css: { ...i.container, ...E }, ...y, children: g } ) }); }); zb.displayName = "List"; var K5 = lt((e, t) => { const { as: r, ...i } = e; return /* @__PURE__ */ u.jsx(zb, { ref: t, as: "ol", styleType: "decimal", marginStart: "1em", ...i }); }); K5.displayName = "OrderedList"; var h_ = lt(function(t, r) { const { as: i, ...s } = t; return /* @__PURE__ */ u.jsx(zb, { ref: r, as: "ul", styleType: "initial", marginStart: "1em", ...s }); }); h_.displayName = "UnorderedList"; var Pp = lt(function(t, r) { const i = p_(); return /* @__PURE__ */ u.jsx($e.li, { ref: r, ...t, __css: i.item }); }); Pp.displayName = "ListItem"; var X5 = lt(function(t, r) { const i = p_(); return /* @__PURE__ */ u.jsx(ia, { ref: r, role: "presentation", ...t, __css: i.icon }); }); X5.displayName = "ListIcon"; var uo = lt(function(t, r) { const { templateAreas: i, gap: s, rowGap: c, columnGap: f, column: m, row: y, autoFlow: g, autoRows: S, templateRows: E, autoColumns: w, templateColumns: D, ...M } = t, k = { display: "grid", gridTemplateAreas: i, gridGap: s, gridRowGap: c, gridColumnGap: f, gridAutoColumns: w, gridColumn: m, gridRow: y, gridAutoFlow: g, gridAutoRows: S, gridTemplateRows: E, gridTemplateColumns: D }; return /* @__PURE__ */ u.jsx($e.div, { ref: r, __css: k, ...M }); }); uo.displayName = "Grid"; var Eg = $e("div", { baseStyle: { flex: 1, justifySelf: "stretch", alignSelf: "stretch" } }); Eg.displayName = "Spacer"; var Gd = lt((e, t) => /* @__PURE__ */ u.jsx(OO, { align: "center", ...e, direction: "row", ref: t })); Gd.displayName = "HStack"; var Ni = lt(function(t, r) { const i = Hd("Heading", t), { className: s, ...c } = Tr(t); return /* @__PURE__ */ u.jsx( $e.h2, { ref: r, className: It("chakra-heading", t.className), ...c, __css: i } ); }); Ni.displayName = "Heading"; var Ut = $e("div"); Ut.displayName = "Box"; var v_ = lt(function(t, r) { const { size: i, centerContent: s = !0, ...c } = t, f = s ? { display: "flex", alignItems: "center", justifyContent: "center" } : {}; return /* @__PURE__ */ u.jsx( Ut, { ref: r, boxSize: i, __css: { ...f, flexShrink: 0, flexGrow: 0 }, ...c } ); }); v_.displayName = "Square"; var $5 = lt(function(t, r) { const { size: i, ...s } = t; return /* @__PURE__ */ u.jsx(v_, { size: i, ref: r, borderRadius: "9999px", ...s }); }); $5.displayName = "Circle"; var Fu = lt(function(t, r) { const i = Hd("Link", t), { className: s, isExternal: c, ...f } = Tr(t); return /* @__PURE__ */ u.jsx( $e.a, { target: c ? "_blank" : void 0, rel: c ? "noopener" : void 0, ref: r, className: It("chakra-link", s), ...f, __css: i } ); }); Fu.displayName = "Link"; var m_ = lt(function(t, r) { const i = Hd("Badge", t), { className: s, ...c } = Tr(t); return /* @__PURE__ */ u.jsx( $e.span, { ref: r, className: It("chakra-badge", t.className), ...c, __css: { display: "inline-block", whiteSpace: "nowrap", verticalAlign: "middle", ...i } } ); }); m_.displayName = "Badge"; var g_ = $e("div", { baseStyle: { display: "flex", alignItems: "center", justifyContent: "center" } }); g_.displayName = "Center"; var Q5 = { horizontal: { insetStart: "50%", transform: "translateX(-50%)" }, vertical: { top: "50%", transform: "translateY(-50%)" }, both: { insetStart: "50%", top: "50%", transform: "translate(-50%, -50%)" } }; lt( function(t, r) { const { axis: i = "both", ...s } = t; return /* @__PURE__ */ u.jsx( $e.div, { ref: r, __css: Q5[i], ...s, position: "absolute" } ); } ); var y_ = lt(function(t, r) { const { borderLeftWidth: i, borderBottomWidth: s, borderTopWidth: c, borderRightWidth: f, borderWidth: m, borderStyle: y, borderColor: g, ...S } = Hd("Divider", t), { className: E, orientation: w = "horizontal", __css: D, ...M } = Tr(t), k = { vertical: { borderLeftWidth: i || f || m || "1px", height: "100%" }, horizontal: { borderBottomWidth: s || c || m || "1px", width: "100%" } }; return /* @__PURE__ */ u.jsx( $e.hr, { ref: r, "aria-orientation": w, ...M, __css: { ...S, border: "0", borderColor: g, borderStyle: y, ...k[w], ...D }, className: It("chakra-divider", E) } ); }); y_.displayName = "Divider"; function Z5(e) { const { key: t } = e; return t.length === 1 || t.length > 1 && /[^a-zA-Z0-9]/.test(t); } function J5(e = {}) { const { timeout: t = 300, preventDefault: r = () => !0 } = e, [i, s] = qe([]), c = Xe(), f = () => { c.current && (clearTimeout(c.current), c.current = null); }, m = () => { f(), c.current = setTimeout(() => { s([]), c.current = null; }, t); }; ot(() => f, []); function y(g) { return (S) => { if (S.key === "Backspace") { const E = [...i]; E.pop(), s(E); return; } if (Z5(S)) { const E = i.concat(S.key); r(S) && (S.preventDefault(), S.stopPropagation()), s(E), g(E.join("")), m(); } }; } return y; } function eF(e, t, r, i) { if (t == null) return i; if (!i) return e.find( (f) => r(f).toLowerCase().startsWith(t.toLowerCase()) ); const s = e.filter( (c) => r(c).toLowerCase().startsWith(t.toLowerCase()) ); if (s.length > 0) { let c; return s.includes(i) ? (c = s.indexOf(i) + 1, c === s.length && (c = 0), s[c]) : (c = e.indexOf(s[0]), e[c]); } return i; } function tF() { const e = Xe(/* @__PURE__ */ new Map()), t = e.current, r = ee((s, c, f, m) => { e.current.set(f, { type: c, el: s, options: m }), s.addEventListener(c, f, m); }, []), i = ee( (s, c, f, m) => { s.removeEventListener(c, f, m), e.current.delete(f); }, [] ); return ot( () => () => { t.forEach((s, c) => { i(s.el, s.type, c, s.options); }); }, [i, t] ), { add: r, remove: i }; } function Ix(e) { const t = e.target, { tagName: r, isContentEditable: i } = t; return r !== "INPUT" && r !== "TEXTAREA" && i !== !0; } function x_(e = {}) { const { ref: t, isDisabled: r, isFocusable: i, clickOnEnter: s = !0, clickOnSpace: c = !0, onMouseDown: f, onMouseUp: m, onClick: y, onKeyDown: g, onKeyUp: S, tabIndex: E, onMouseOver: w, onMouseLeave: D, ...M } = e, [k, R] = qe(!0), [O, I] = qe(!1), A = tF(), L = (te) => { te && te.tagName !== "BUTTON" && R(!1); }, H = k ? E : E || 0, q = r && !i, U = ee( (te) => { if (r) { te.stopPropagation(), te.preventDefault(); return; } te.currentTarget.focus(), y == null || y(te); }, [r, y] ), $ = ee( (te) => { O && Ix(te) && (te.preventDefault(), te.stopPropagation(), I(!1), A.remove(document, "keyup", $, !1)); }, [O, A] ), ae = ee( (te) => { if (g == null || g(te), r || te.defaultPrevented || te.metaKey || !Ix(te.nativeEvent) || k) return; const K = s && te.key === "Enter"; c && te.key === " " && (te.preventDefault(), I(!0)), K && (te.preventDefault(), te.currentTarget.click()), A.add(document, "keyup", $, !1); }, [ r, k, g, s, c, A, $ ] ), oe = ee( (te) => { if (S == null || S(te), r || te.defaultPrevented || te.metaKey || !Ix(te.nativeEvent) || k) return; c && te.key === " " && (te.preventDefault(), I(!1), te.currentTarget.click()); }, [c, k, r, S] ), Y = ee( (te) => { te.button === 0 && (I(!1), A.remove(document, "mouseup", Y, !1)); }, [A] ), ve = ee( (te) => { if (te.button !== 0) return; if (r) { te.stopPropagation(), te.preventDefault(); return; } k || I(!0), te.currentTarget.focus({ preventScroll: !0 }), A.add(document, "mouseup", Y, !1), f == null || f(te); }, [r, k, f, A, Y] ), de = ee( (te) => { te.button === 0 && (k || I(!1), m == null || m(te)); }, [m, k] ), fe = ee( (te) => { if (r) { te.preventDefault(); return; } w == null || w(te); }, [r, w] ), _e = ee( (te) => { O && (te.preventDefault(), I(!1)), D == null || D(te); }, [O, D] ), Me = jr(t, L); return k ? { ...M, ref: Me, type: "button", "aria-disabled": q ? void 0 : r, disabled: q, onClick: U, onMouseDown: f, onMouseUp: m, onKeyUp: S, onKeyDown: g, onMouseOver: w, onMouseLeave: D } : { ...M, ref: Me, role: "button", "data-active": Kt(O), "aria-disabled": r ? "true" : void 0, tabIndex: q ? void 0 : H, onClick: U, onMouseDown: ve, onMouseUp: de, onKeyUp: oe, onKeyDown: ae, onMouseOver: fe, onMouseLeave: _e }; } function nF(e) { const { ref: t, handler: r, enabled: i = !0 } = e, s = oa(r), f = Xe({ isPointerDown: !1, ignoreEmulatedMouseEvents: !1 }).current; ot(() => { if (!i) return; const m = (E) => { Fx(E, t) && (f.isPointerDown = !0); }, y = (E) => { if (f.ignoreEmulatedMouseEvents) { f.ignoreEmulatedMouseEvents = !1; return; } f.isPointerDown && r && Fx(E, t) && (f.isPointerDown = !1, s(E)); }, g = (E) => { f.ignoreEmulatedMouseEvents = !0, r && f.isPointerDown && Fx(E, t) && (f.isPointerDown = !1, s(E)); }, S = S_(t.current); return S.addEventListener("mousedown", m, !0), S.addEventListener("mouseup", y, !0), S.addEventListener("touchstart", m, !0), S.addEventListener("touchend", g, !0), () => { S.removeEventListener("mousedown", m, !0), S.removeEventListener("mouseup", y, !0), S.removeEventListener("touchstart", m, !0), S.removeEventListener("touchend", g, !0); }; }, [r, t, s, f, i]); } function Fx(e, t) { var r; const i = e.target; return e.button > 0 || i && !S_(i).contains(i) ? !1 : !((r = t.current) != null && r.contains(i)); } function S_(e) { var t; return (t = e == null ? void 0 : e.ownerDocument) != null ? t : document; } var [ rF, aF, iF, oF ] = mb(), [sF, ah] = ur({ strict: !1, name: "MenuContext" }); function lF(e, ...t) { const r = Ko(), i = e || r; return Xt(() => t.map((s) => `${s}-${i}`), [i, t]); } function b_(e) { var t; return (t = e == null ? void 0 : e.ownerDocument) != null ? t : document; } function vj(e) { return b_(e).activeElement === e; } function uF(e = {}) { const { id: t, closeOnSelect: r = !0, closeOnBlur: i = !0, initialFocusRef: s, autoSelect: c = !0, isLazy: f, isOpen: m, defaultIsOpen: y, onClose: g, onOpen: S, placement: E = "bottom-start", lazyBehavior: w = "unmount", direction: D, computePositionOnMount: M = !1, ...k } = e, R = Xe(null), O = Xe(null), I = iF(), A = ee(() => { requestAnimationFrame(() => { var De; (De = R.current) == null || De.focus({ preventScroll: !1 }); }); }, []), L = ee(() => { const De = setTimeout(() => { var Se; if (s) (Se = s.current) == null || Se.focus(); else { const be = I.firstEnabled(); be && de(be.index); } }); K.current.add(De); }, [I, s]), H = ee(() => { const De = setTimeout(() => { const Se = I.lastEnabled(); Se && de(Se.index); }); K.current.add(De); }, [I]), q = ee(() => { S == null || S(), c ? L() : A(); }, [c, L, A, S]), { isOpen: U, onOpen: $, onClose: ae, onToggle: oe } = AO({ isOpen: m, defaultIsOpen: y, onClose: g, onOpen: q }); nF({ enabled: U && i, ref: R, handler: (De) => { var Se; (Se = O.current) != null && Se.contains(De.target) || ae(); } }); const Y = zO({ ...k, enabled: U || M, placement: E, direction: D }), [ve, de] = qe(-1); Kp(() => { U || de(-1); }, [U]), IO(R, { focusRef: O, visible: U, shouldFocus: !0 }); const fe = FO({ isOpen: U, ref: R }), [_e, Me] = lF(t, "menu-button", "menu-list"), te = ee(() => { $(), A(); }, [$, A]), K = Xe(/* @__PURE__ */ new Set([])); mF(() => { K.current.forEach((De) => clearTimeout(De)), K.current.clear(); }); const se = ee(() => { $(), L(); }, [L, $]), B = ee(() => { $(), H(); }, [$, H]), re = ee(() => { var De, Se; const be = b_(R.current), Ie = (De = R.current) == null ? void 0 : De.contains(be.activeElement); if (!(U && !Ie)) return; const tt = (Se = I.item(ve)) == null ? void 0 : Se.node; tt == null || tt.focus(); }, [U, ve, I]), ke = Xe(null); return { openAndFocusMenu: te, openAndFocusFirstItem: se, openAndFocusLastItem: B, onTransitionEnd: re, unstable__animationState: fe, descendants: I, popper: Y, buttonId: _e, menuId: Me, forceUpdate: Y.forceUpdate, orientation: "vertical", isOpen: U, onToggle: oe, onOpen: $, onClose: ae, menuRef: R, buttonRef: O, focusedIndex: ve, closeOnSelect: r, closeOnBlur: i, autoSelect: c, setFocusedIndex: de, isLazy: f, lazyBehavior: w, initialFocusRef: s, rafId: ke }; } function cF(e = {}, t = null) { const r = ah(), { onToggle: i, popper: s, openAndFocusFirstItem: c, openAndFocusLastItem: f } = r, m = ee( (y) => { const g = y.key, E = { Enter: c, ArrowDown: c, ArrowUp: f }[g]; E && (y.preventDefault(), y.stopPropagation(), E(y)); }, [c, f] ); return { ...e, ref: jr(r.buttonRef, t, s.referenceRef), id: r.buttonId, "data-active": Kt(r.isOpen), "aria-expanded": r.isOpen, "aria-haspopup": "menu", "aria-controls": r.menuId, onClick: Pt(e.onClick, i), onKeyDown: Pt(e.onKeyDown, m) }; } function AS(e) { var t; return hF(e) && !!((t = e == null ? void 0 : e.getAttribute("role")) != null && t.startsWith("menuitem")); } function dF(e = {}, t = null) { const r = ah(); if (!r) throw new Error( "useMenuContext: context is undefined. Seems you forgot to wrap component within " ); const { focusedIndex: i, setFocusedIndex: s, menuRef: c, isOpen: f, onClose: m, menuId: y, isLazy: g, lazyBehavior: S, unstable__animationState: E } = r, w = aF(), D = J5({ preventDefault: (O) => O.key !== " " && AS(O.target) }), M = ee( (O) => { const I = O.key, L = { Tab: (q) => q.preventDefault(), Escape: m, ArrowDown: () => { const q = w.nextEnabled(i); q && s(q.index); }, ArrowUp: () => { const q = w.prevEnabled(i); q && s(q.index); } }[I]; if (L) { O.preventDefault(), L(O); return; } const H = D((q) => { const U = eF( w.values(), q, ($) => { var ae, oe; return (oe = (ae = $ == null ? void 0 : $.node) == null ? void 0 : ae.textContent) != null ? oe : ""; }, w.item(i) ); if (U) { const $ = w.indexOf(U.node); s($); } }); AS(O.target) && H(O); }, [ w, i, D, m, s ] ), k = Xe(!1); f && (k.current = !0); const R = v2({ wasSelected: k.current, enabled: g, mode: S, isSelected: E.present }); return { ...e, ref: jr(c, t), children: R ? e.children : null, tabIndex: -1, role: "menu", id: y, style: { ...e.style, transformOrigin: "var(--popper-transform-origin)" }, "aria-orientation": "vertical", onKeyDown: Pt(e.onKeyDown, M) }; } function fF(e = {}) { const { popper: t, isOpen: r } = ah(); return t.getPopperProps({ ...e, style: { visibility: r ? "visible" : "hidden", ...e.style } }); } function pF(e = {}, t = null) { const { onMouseEnter: r, onMouseMove: i, onMouseLeave: s, onClick: c, onFocus: f, isDisabled: m, isFocusable: y, closeOnSelect: g, type: S, ...E } = e, w = ah(), { setFocusedIndex: D, focusedIndex: M, closeOnSelect: k, onClose: R, menuRef: O, isOpen: I, menuId: A, rafId: L } = w, H = Xe(null), q = `${A}-menuitem-${Ko()}`, { index: U, register: $ } = oF({ disabled: m && !y }), ae = ee( (te) => { r == null || r(te), !m && D(U); }, [D, U, m, r] ), oe = ee( (te) => { i == null || i(te), H.current && !vj(H.current) && ae(te); }, [ae, i] ), Y = ee( (te) => { s == null || s(te), !m && D(-1); }, [D, m, s] ), ve = ee( (te) => { c == null || c(te), AS(te.currentTarget) && (g ?? k) && R(); }, [R, c, k, g] ), de = ee( (te) => { f == null || f(te), D(U); }, [D, f, U] ), fe = U === M, _e = m && !y; Kp(() => { I && (fe && !_e && H.current ? (L.current && cancelAnimationFrame(L.current), L.current = requestAnimationFrame(() => { var te; (te = H.current) == null || te.focus(), L.current = null; })) : O.current && !vj(O.current) && O.current.focus()); }, [fe, _e, O, I]); const Me = x_({ onClick: ve, onFocus: de, onMouseEnter: ae, onMouseMove: oe, onMouseLeave: Y, ref: jr($, H, t), isDisabled: m, isFocusable: y }); return { ...E, ...Me, type: S ?? Me.type, id: q, role: "menuitem", tabIndex: fe ? 0 : -1 }; } function hF(e) { var t; if (!vF(e)) return !1; const r = (t = e.ownerDocument.defaultView) != null ? t : window; return e instanceof r.HTMLElement; } function vF(e) { return e != null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE; } function mF(e, t = []) { return ot( () => () => e(), t ); } var [gF, wg] = ur({ name: "MenuStylesContext", errorMessage: `useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" ` }), Ib = (e) => { const { children: t } = e, r = Ha("Menu", e), i = Tr(e), { direction: s } = hg(), { descendants: c, ...f } = uF({ ...i, direction: s }), m = Xt(() => f, [f]), { isOpen: y, onClose: g, forceUpdate: S } = m; return /* @__PURE__ */ u.jsx(rF, { value: c, children: /* @__PURE__ */ u.jsx(sF, { value: m, children: /* @__PURE__ */ u.jsx(gF, { value: r, children: LO(t, { isOpen: y, onClose: g, forceUpdate: S }) }) }) }); }; Ib.displayName = "Menu"; var C_ = lt( (e, t) => { const r = wg(); return /* @__PURE__ */ u.jsx( $e.span, { ref: t, ...e, __css: r.command, className: "chakra-menu__command" } ); } ); C_.displayName = "MenuCommand"; var yF = lt( (e, t) => { const { type: r, ...i } = e, s = wg(), c = i.as || r ? r ?? void 0 : "button", f = Xt( () => ({ textDecoration: "none", color: "inherit", userSelect: "none", display: "flex", width: "100%", alignItems: "center", textAlign: "start", flex: "0 0 auto", outline: 0, ...s.item }), [s.item] ); return /* @__PURE__ */ u.jsx($e.button, { ref: t, type: c, ...i, __css: f }); } ), E_ = (e) => { const { className: t, children: r, ...i } = e, s = eh.only(r), c = gD(s) ? Ll(s, { focusable: "false", "aria-hidden": !0, className: It("chakra-menu__icon", s.props.className) }) : null, f = It("chakra-menu__icon-wrapper", t); return /* @__PURE__ */ u.jsx( $e.span, { className: f, ...i, __css: { flexShrink: 0 }, children: c } ); }; E_.displayName = "MenuIcon"; var Bo = lt((e, t) => { const { icon: r, iconSpacing: i = "0.75rem", command: s, commandSpacing: c = "0.75rem", children: f, ...m } = e, y = pF(m, t), S = r || s ? /* @__PURE__ */ u.jsx("span", { style: { pointerEvents: "none", flex: 1 }, children: f }) : f; return /* @__PURE__ */ u.jsxs( yF, { ...y, className: It("chakra-menu__menuitem", y.className), children: [ r && /* @__PURE__ */ u.jsx(E_, { fontSize: "0.8em", marginEnd: i, children: r }), S, s && /* @__PURE__ */ u.jsx(C_, { marginStart: c, children: s }) ] } ); }); Bo.displayName = "MenuItem"; var xF = { enter: { visibility: "visible", opacity: 1, scale: 1, transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] } }, exit: { transitionEnd: { visibility: "hidden" }, opacity: 0, scale: 0.8, transition: { duration: 0.1, easings: "easeOut" } } }, SF = $e(zs.div), Fb = lt(function(t, r) { var i, s; const { rootProps: c, motionProps: f, ...m } = t, { isOpen: y, onTransitionEnd: g, unstable__animationState: S } = ah(), E = dF(m, r), w = fF(c), D = wg(); return /* @__PURE__ */ u.jsx( $e.div, { ...w, __css: { zIndex: (s = t.zIndex) != null ? s : (i = D.list) == null ? void 0 : i.zIndex }, children: /* @__PURE__ */ u.jsx( SF, { variants: xF, initial: !1, animate: y ? "enter" : "exit", __css: { outline: 0, ...D.list }, ...f, className: It("chakra-menu__menu-list", E.className), ...E, onUpdate: g, onAnimationComplete: ib( S.onComplete, E.onAnimationComplete ) } ) } ); }); Fb.displayName = "MenuList"; var bF = lt((e, t) => { const r = wg(); return /* @__PURE__ */ u.jsx( $e.button, { ref: t, ...e, __css: { display: "inline-flex", appearance: "none", alignItems: "center", outline: 0, ...r.button } } ); }), Lb = lt( (e, t) => { const { children: r, as: i, ...s } = e, c = cF(s, t), f = i || bF; return /* @__PURE__ */ u.jsx( f, { ...c, className: It("chakra-menu__menu-button", e.className), children: /* @__PURE__ */ u.jsx( $e.span, { __css: { pointerEvents: "none", flex: "1 1 auto", minW: 0 }, children: e.children } ) } ); } ); Lb.displayName = "MenuButton"; var CF = { slideInBottom: { ...DS, custom: { offsetY: 16, reverse: !0 } }, slideInRight: { ...DS, custom: { offsetX: 16, reverse: !0 } }, scale: { ...TD, custom: { initialScale: 0.95, reverse: !0 } }, none: {} }, EF = $e(zs.section), wF = (e) => CF[e || "none"], w_ = Fl( (e, t) => { const { preset: r, motionProps: i = wF(r), ...s } = e; return /* @__PURE__ */ u.jsx(EF, { ref: t, ...i, ...s }); } ); w_.displayName = "ModalTransition"; var jF = Object.defineProperty, TF = (e, t, r) => t in e ? jF(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, DF = (e, t, r) => (TF(e, typeof t != "symbol" ? t + "" : t, r), r), _F = class { constructor() { DF(this, "modals"), this.modals = /* @__PURE__ */ new Map(); } add(e) { return this.modals.set(e, this.modals.size + 1), this.modals.size; } remove(e) { this.modals.delete(e); } isTopModal(e) { return e ? this.modals.get(e) === this.modals.size : !1; } }, zS = new _F(); function j_(e, t) { const [r, i] = qe(0); return ot(() => { const s = e.current; if (s) { if (t) { const c = zS.add(s); i(c); } return () => { zS.remove(s), i(0); }; } }, [t, e]), r; } var MF = function(e) { if (typeof document > "u") return null; var t = Array.isArray(e) ? e[0] : e; return t.ownerDocument.body; }, yd = /* @__PURE__ */ new WeakMap(), xm = /* @__PURE__ */ new WeakMap(), Sm = {}, Lx = 0, T_ = function(e) { return e && (e.host || T_(e.parentNode)); }, kF = function(e, t) { return t.map(function(r) { if (e.contains(r)) return r; var i = T_(r); return i && e.contains(i) ? i : (console.error("aria-hidden", r, "in not contained inside", e, ". Doing nothing"), null); }).filter(function(r) { return Boolean(r); }); }, RF = function(e, t, r, i) { var s = kF(t, Array.isArray(e) ? e : [e]); Sm[r] || (Sm[r] = /* @__PURE__ */ new WeakMap()); var c = Sm[r], f = [], m = /* @__PURE__ */ new Set(), y = new Set(s), g = function(E) { !E || m.has(E) || (m.add(E), g(E.parentNode)); }; s.forEach(g); var S = function(E) { !E || y.has(E) || Array.prototype.forEach.call(E.children, function(w) { if (m.has(w)) S(w); else { var D = w.getAttribute(i), M = D !== null && D !== "false", k = (yd.get(w) || 0) + 1, R = (c.get(w) || 0) + 1; yd.set(w, k), c.set(w, R), f.push(w), k === 1 && M && xm.set(w, !0), R === 1 && w.setAttribute(r, "true"), M || w.setAttribute(i, "true"); } }); }; return S(t), m.clear(), Lx++, function() { f.forEach(function(E) { var w = yd.get(E) - 1, D = c.get(E) - 1; yd.set(E, w), c.set(E, D), w || (xm.has(E) || E.removeAttribute(i), xm.delete(E)), D || E.removeAttribute(r); }), Lx--, Lx || (yd = /* @__PURE__ */ new WeakMap(), yd = /* @__PURE__ */ new WeakMap(), xm = /* @__PURE__ */ new WeakMap(), Sm = {}); }; }, PF = function(e, t, r) { r === void 0 && (r = "data-aria-hidden"); var i = Array.from(Array.isArray(e) ? e : [e]), s = t || MF(e); return s ? (i.push.apply(i, Array.from(s.querySelectorAll("[aria-live]"))), RF(i, s, r, "aria-hidden")) : function() { return null; }; }; function NF(e) { const { isOpen: t, onClose: r, id: i, closeOnOverlayClick: s = !0, closeOnEsc: c = !0, useInert: f = !0, onOverlayClick: m, onEsc: y } = e, g = Xe(null), S = Xe(null), [E, w, D] = AF( i, "chakra-modal", "chakra-modal--header", "chakra-modal--body" ); OF(g, t && f), j_(g, t); const M = Xe(null), k = ee(($) => { M.current = $.target; }, []), R = ee( ($) => { $.key === "Escape" && ($.stopPropagation(), c && (r == null || r()), y == null || y()); }, [c, r, y] ), [O, I] = qe(!1), [A, L] = qe(!1), H = ee( ($ = {}, ae = null) => ({ role: "dialog", ...$, ref: jr(ae, g), id: E, tabIndex: -1, "aria-modal": !0, "aria-labelledby": O ? w : void 0, "aria-describedby": A ? D : void 0, onClick: Pt( $.onClick, (oe) => oe.stopPropagation() ) }), [D, A, E, w, O] ), q = ee( ($) => { $.stopPropagation(), M.current === $.target && zS.isTopModal(g.current) && (s && (r == null || r()), m == null || m()); }, [r, s, m] ), U = ee( ($ = {}, ae = null) => ({ ...$, ref: jr(ae, S), onClick: Pt($.onClick, q), onKeyDown: Pt($.onKeyDown, R), onMouseDown: Pt($.onMouseDown, k) }), [R, k, q] ); return { isOpen: t, onClose: r, headerId: w, bodyId: D, setBodyMounted: L, setHeaderMounted: I, dialogRef: g, overlayRef: S, getDialogProps: H, getDialogContainerProps: U }; } function OF(e, t) { const r = e.current; ot(() => { if (!(!e.current || !t)) return PF(e.current); }, [t, e, r]); } function AF(e, ...t) { const r = Ko(), i = e || r; return Xt(() => t.map((s) => `${s}-${i}`), [i, t]); } var [zF, qd] = ur({ name: "ModalStylesContext", errorMessage: `useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" ` }), [IF, Hu] = ur({ strict: !0, name: "ModalContext", errorMessage: "useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``" }), Al = (e) => { const t = { scrollBehavior: "outside", autoFocus: !0, trapFocus: !0, returnFocusOnClose: !0, blockScrollOnMount: !0, allowPinchZoom: !1, motionPreset: "scale", lockFocusAcrossFrames: !0, ...e }, { portalProps: r, children: i, autoFocus: s, trapFocus: c, initialFocusRef: f, finalFocusRef: m, returnFocusOnClose: y, blockScrollOnMount: g, allowPinchZoom: S, preserveScrollBarGap: E, motionPreset: w, lockFocusAcrossFrames: D, onCloseComplete: M } = t, k = Ha("Modal", t), O = { ...NF(t), autoFocus: s, trapFocus: c, initialFocusRef: f, finalFocusRef: m, returnFocusOnClose: y, blockScrollOnMount: g, allowPinchZoom: S, preserveScrollBarGap: E, motionPreset: w, lockFocusAcrossFrames: D }; return /* @__PURE__ */ u.jsx(IF, { value: O, children: /* @__PURE__ */ u.jsx(zF, { value: k, children: /* @__PURE__ */ u.jsx(Wu, { onExitComplete: M, children: O.isOpen && /* @__PURE__ */ u.jsx(Wm, { ...r, children: i }) }) }) }); }; Al.displayName = "Modal"; var Bm = "right-scroll-bar-position", Um = "width-before-scroll-bar", FF = "with-scroll-bars-hidden", LF = "--removed-body-scroll-bar-size", D_ = UD(), Bx = function() { }, jg = Ge.forwardRef(function(e, t) { var r = Ge.useRef(null), i = Ge.useState({ onScrollCapture: Bx, onWheelCapture: Bx, onTouchMoveCapture: Bx }), s = i[0], c = i[1], f = e.forwardProps, m = e.children, y = e.className, g = e.removeScrollBar, S = e.enabled, E = e.shards, w = e.sideCar, D = e.noIsolation, M = e.inert, k = e.allowPinchZoom, R = e.as, O = R === void 0 ? "div" : R, I = FD(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), A = w, L = ID([r, t]), H = Ho(Ho({}, I), s); return Ge.createElement( Ge.Fragment, null, S && Ge.createElement(A, { sideCar: D_, removeScrollBar: g, shards: E, noIsolation: D, inert: M, setCallbacks: c, allowPinchZoom: !!k, lockRef: r }), f ? Ge.cloneElement(Ge.Children.only(m), Ho(Ho({}, H), { ref: L })) : Ge.createElement(O, Ho({}, H, { className: y, ref: L }), m) ); }); jg.defaultProps = { enabled: !0, removeScrollBar: !0, inert: !1 }; jg.classNames = { fullWidth: Um, zeroRight: Bm }; var mj, BF = function() { if (mj) return mj; if (typeof __webpack_nonce__ < "u") return __webpack_nonce__; }; function UF() { if (!document) return null; var e = document.createElement("style"); e.type = "text/css"; var t = BF(); return t && e.setAttribute("nonce", t), e; } function HF(e, t) { e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t)); } function VF(e) { var t = document.head || document.getElementsByTagName("head")[0]; t.appendChild(e); } var WF = function() { var e = 0, t = null; return { add: function(r) { e == 0 && (t = UF()) && (HF(t, r), VF(t)), e++; }, remove: function() { e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null); } }; }, GF = function() { var e = WF(); return function(t, r) { Ge.useEffect(function() { return e.add(t), function() { e.remove(); }; }, [t && r]); }; }, __ = function() { var e = GF(), t = function(r) { var i = r.styles, s = r.dynamic; return e(i, s), null; }; return t; }, qF = { left: 0, top: 0, right: 0, gap: 0 }, Ux = function(e) { return parseInt(e || "", 10) || 0; }, YF = function(e) { var t = window.getComputedStyle(document.body), r = t[e === "padding" ? "paddingLeft" : "marginLeft"], i = t[e === "padding" ? "paddingTop" : "marginTop"], s = t[e === "padding" ? "paddingRight" : "marginRight"]; return [Ux(r), Ux(i), Ux(s)]; }, KF = function(e) { if (e === void 0 && (e = "margin"), typeof window > "u") return qF; var t = YF(e), r = document.documentElement.clientWidth, i = window.innerWidth; return { left: t[0], top: t[1], right: t[2], gap: Math.max(0, i - r + t[2] - t[0]) }; }, XF = __(), $F = function(e, t, r, i) { var s = e.left, c = e.top, f = e.right, m = e.gap; return r === void 0 && (r = "margin"), ` .`.concat(FF, ` { overflow: hidden `).concat(i, `; padding-right: `).concat(m, "px ").concat(i, `; } body { overflow: hidden `).concat(i, `; overscroll-behavior: contain; `).concat([ t && "position: relative ".concat(i, ";"), r === "margin" && ` padding-left: `.concat(s, `px; padding-top: `).concat(c, `px; padding-right: `).concat(f, `px; margin-left:0; margin-top:0; margin-right: `).concat(m, "px ").concat(i, `; `), r === "padding" && "padding-right: ".concat(m, "px ").concat(i, ";") ].filter(Boolean).join(""), ` } .`).concat(Bm, ` { right: `).concat(m, "px ").concat(i, `; } .`).concat(Um, ` { margin-right: `).concat(m, "px ").concat(i, `; } .`).concat(Bm, " .").concat(Bm, ` { right: 0 `).concat(i, `; } .`).concat(Um, " .").concat(Um, ` { margin-right: 0 `).concat(i, `; } body { `).concat(LF, ": ").concat(m, `px; } `); }, QF = function(e) { var t = e.noRelative, r = e.noImportant, i = e.gapMode, s = i === void 0 ? "margin" : i, c = Ge.useMemo(function() { return KF(s); }, [s]); return Ge.createElement(XF, { styles: $F(c, !t, s, r ? "" : "!important") }); }, IS = !1; if (typeof window < "u") try { var bm = Object.defineProperty({}, "passive", { get: function() { return IS = !0, !0; } }); window.addEventListener("test", bm, bm), window.removeEventListener("test", bm, bm); } catch { IS = !1; } var xd = IS ? { passive: !1 } : !1, ZF = function(e) { return e.tagName === "TEXTAREA"; }, M_ = function(e, t) { var r = window.getComputedStyle(e); return ( // not-not-scrollable r[t] !== "hidden" && // contains scroll inside self !(r.overflowY === r.overflowX && !ZF(e) && r[t] === "visible") ); }, JF = function(e) { return M_(e, "overflowY"); }, eL = function(e) { return M_(e, "overflowX"); }, gj = function(e, t) { var r = t; do { typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host); var i = k_(e, r); if (i) { var s = R_(e, r), c = s[1], f = s[2]; if (c > f) return !0; } r = r.parentNode; } while (r && r !== document.body); return !1; }, tL = function(e) { var t = e.scrollTop, r = e.scrollHeight, i = e.clientHeight; return [ t, r, i ]; }, nL = function(e) { var t = e.scrollLeft, r = e.scrollWidth, i = e.clientWidth; return [ t, r, i ]; }, k_ = function(e, t) { return e === "v" ? JF(t) : eL(t); }, R_ = function(e, t) { return e === "v" ? tL(t) : nL(t); }, rL = function(e, t) { return e === "h" && t === "rtl" ? -1 : 1; }, aL = function(e, t, r, i, s) { var c = rL(e, window.getComputedStyle(t).direction), f = c * i, m = r.target, y = t.contains(m), g = !1, S = f > 0, E = 0, w = 0; do { var D = R_(e, m), M = D[0], k = D[1], R = D[2], O = k - R - c * M; (M || O) && k_(e, m) && (E += O, w += M), m = m.parentNode; } while ( // portaled content !y && m !== document.body || // self content y && (t.contains(m) || t === m) ); return (S && (s && E === 0 || !s && f > E) || !S && (s && w === 0 || !s && -f > w)) && (g = !0), g; }, Cm = function(e) { return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0]; }, yj = function(e) { return [e.deltaX, e.deltaY]; }, xj = function(e) { return e && "current" in e ? e.current : e; }, iL = function(e, t) { return e[0] === t[0] && e[1] === t[1]; }, oL = function(e) { return ` .block-interactivity-`.concat(e, ` {pointer-events: none;} .allow-interactivity-`).concat(e, ` {pointer-events: all;} `); }, sL = 0, Sd = []; function lL(e) { var t = Ge.useRef([]), r = Ge.useRef([0, 0]), i = Ge.useRef(), s = Ge.useState(sL++)[0], c = Ge.useState(function() { return __(); })[0], f = Ge.useRef(e); Ge.useEffect(function() { f.current = e; }, [e]), Ge.useEffect(function() { if (e.inert) { document.body.classList.add("block-interactivity-".concat(s)); var k = PS([e.lockRef.current], (e.shards || []).map(xj), !0).filter(Boolean); return k.forEach(function(R) { return R.classList.add("allow-interactivity-".concat(s)); }), function() { document.body.classList.remove("block-interactivity-".concat(s)), k.forEach(function(R) { return R.classList.remove("allow-interactivity-".concat(s)); }); }; } }, [e.inert, e.lockRef.current, e.shards]); var m = Ge.useCallback(function(k, R) { if ("touches" in k && k.touches.length === 2) return !f.current.allowPinchZoom; var O = Cm(k), I = r.current, A = "deltaX" in k ? k.deltaX : I[0] - O[0], L = "deltaY" in k ? k.deltaY : I[1] - O[1], H, q = k.target, U = Math.abs(A) > Math.abs(L) ? "h" : "v"; if ("touches" in k && U === "h" && q.type === "range") return !1; var $ = gj(U, q); if (!$) return !0; if ($ ? H = U : (H = U === "v" ? "h" : "v", $ = gj(U, q)), !$) return !1; if (!i.current && "changedTouches" in k && (A || L) && (i.current = H), !H) return !0; var ae = i.current || H; return aL(ae, R, k, ae === "h" ? A : L, !0); }, []), y = Ge.useCallback(function(k) { var R = k; if (!(!Sd.length || Sd[Sd.length - 1] !== c)) { var O = "deltaY" in R ? yj(R) : Cm(R), I = t.current.filter(function(H) { return H.name === R.type && H.target === R.target && iL(H.delta, O); })[0]; if (I && I.should) { R.cancelable && R.preventDefault(); return; } if (!I) { var A = (f.current.shards || []).map(xj).filter(Boolean).filter(function(H) { return H.contains(R.target); }), L = A.length > 0 ? m(R, A[0]) : !f.current.noIsolation; L && R.cancelable && R.preventDefault(); } } }, []), g = Ge.useCallback(function(k, R, O, I) { var A = { name: k, delta: R, target: O, should: I }; t.current.push(A), setTimeout(function() { t.current = t.current.filter(function(L) { return L !== A; }); }, 1); }, []), S = Ge.useCallback(function(k) { r.current = Cm(k), i.current = void 0; }, []), E = Ge.useCallback(function(k) { g(k.type, yj(k), k.target, m(k, e.lockRef.current)); }, []), w = Ge.useCallback(function(k) { g(k.type, Cm(k), k.target, m(k, e.lockRef.current)); }, []); Ge.useEffect(function() { return Sd.push(c), e.setCallbacks({ onScrollCapture: E, onWheelCapture: E, onTouchMoveCapture: w }), document.addEventListener("wheel", y, xd), document.addEventListener("touchmove", y, xd), document.addEventListener("touchstart", S, xd), function() { Sd = Sd.filter(function(k) { return k !== c; }), document.removeEventListener("wheel", y, xd), document.removeEventListener("touchmove", y, xd), document.removeEventListener("touchstart", S, xd); }; }, []); var D = e.removeScrollBar, M = e.inert; return Ge.createElement( Ge.Fragment, null, M ? Ge.createElement(c, { styles: oL(s) }) : null, D ? Ge.createElement(QF, { gapMode: "margin" }) : null ); } const uL = V4(D_, lL); var P_ = Ge.forwardRef(function(e, t) { return Ge.createElement(jg, Ho({}, e, { ref: t, sideCar: uL })); }); P_.classNames = jg.classNames; const cL = P_; function dL(e) { const { autoFocus: t, trapFocus: r, dialogRef: i, initialFocusRef: s, blockScrollOnMount: c, allowPinchZoom: f, finalFocusRef: m, returnFocusOnClose: y, preserveScrollBarGap: g, lockFocusAcrossFrames: S, isOpen: E } = Hu(), [w, D] = BO(); ot(() => { !w && D && setTimeout(D); }, [w, D]); const M = j_(i, E); return /* @__PURE__ */ u.jsx( f_, { autoFocus: t, isDisabled: !r, initialFocusRef: s, finalFocusRef: m, restoreFocus: y, contentRef: i, lockFocusAcrossFrames: S, children: /* @__PURE__ */ u.jsx( cL, { removeScrollBar: !g, allowPinchZoom: f, enabled: M === 1 && c, forwardProps: !0, children: e.children } ) } ); } var zl = lt( (e, t) => { const { className: r, children: i, containerProps: s, motionProps: c, ...f } = e, { getDialogProps: m, getDialogContainerProps: y } = Hu(), g = m(f, t), S = y(s), E = It("chakra-modal__content", r), w = qd(), D = { display: "flex", flexDirection: "column", position: "relative", width: "100%", outline: 0, ...w.dialog }, M = { display: "flex", width: "100vw", height: "$100vh", position: "fixed", left: 0, top: 0, ...w.dialogContainer }, { motionPreset: k } = Hu(); return /* @__PURE__ */ u.jsx(dL, { children: /* @__PURE__ */ u.jsx( $e.div, { ...S, className: "chakra-modal__content-container", tabIndex: -1, __css: M, children: /* @__PURE__ */ u.jsx( w_, { preset: k, motionProps: c, className: E, ...g, __css: D, children: i } ) } ) }); } ); zl.displayName = "ModalContent"; function N_(e) { const { leastDestructiveRef: t, ...r } = e; return /* @__PURE__ */ u.jsx(Al, { ...r, initialFocusRef: t }); } var O_ = lt( (e, t) => /* @__PURE__ */ u.jsx(zl, { ref: t, role: "alertdialog", ...e }) ), Ms = lt( (e, t) => { const { className: r, ...i } = e, s = It("chakra-modal__footer", r), f = { display: "flex", alignItems: "center", justifyContent: "flex-end", ...qd().footer }; return /* @__PURE__ */ u.jsx( $e.footer, { ref: t, ...i, __css: f, className: s } ); } ); Ms.displayName = "ModalFooter"; var ks = lt( (e, t) => { const { className: r, ...i } = e, { headerId: s, setHeaderMounted: c } = Hu(); ot(() => (c(!0), () => c(!1)), [c]); const f = It("chakra-modal__header", r), y = { flex: 0, ...qd().header }; return /* @__PURE__ */ u.jsx( $e.header, { ref: t, className: f, id: s, ...i, __css: y } ); } ); ks.displayName = "ModalHeader"; var fL = $e(zs.div), Rs = lt( (e, t) => { const { className: r, transition: i, motionProps: s, ...c } = e, f = It("chakra-modal__overlay", r), y = { pos: "fixed", left: "0", top: "0", w: "100vw", h: "100vh", ...qd().overlay }, { motionPreset: g } = Hu(), E = s || (g === "none" ? {} : jD); return /* @__PURE__ */ u.jsx( fL, { ...E, __css: y, ref: t, className: f, ...c } ); } ); Rs.displayName = "ModalOverlay"; var Ps = lt((e, t) => { const { className: r, ...i } = e, { bodyId: s, setBodyMounted: c } = Hu(); ot(() => (c(!0), () => c(!1)), [c]); const f = It("chakra-modal__body", r), m = qd(); return /* @__PURE__ */ u.jsx( $e.div, { ref: t, className: f, id: s, ...i, __css: m.body } ); }); Ps.displayName = "ModalBody"; var Yd = lt( (e, t) => { const { onClick: r, className: i, ...s } = e, { onClose: c } = Hu(), f = It("chakra-modal__close-btn", i), m = qd(); return /* @__PURE__ */ u.jsx( uI, { ref: t, __css: m.closeButton, className: f, onClick: Pt(r, (y) => { y.stopPropagation(), c(); }), ...s } ); } ); Yd.displayName = "ModalCloseButton"; var pL = (e) => /* @__PURE__ */ u.jsx(ia, { viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ u.jsx( "path", { fill: "currentColor", d: "M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z" } ) }), hL = (e) => /* @__PURE__ */ u.jsx(ia, { viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ u.jsx( "path", { fill: "currentColor", d: "M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z" } ) }); function Sj(e, t, r, i) { ot(() => { var s; if (!e.current || !i) return; const c = (s = e.current.ownerDocument.defaultView) != null ? s : window, f = Array.isArray(t) ? t : [t], m = new c.MutationObserver((y) => { for (const g of y) g.type === "attributes" && g.attributeName && f.includes(g.attributeName) && r(g); }); return m.observe(e.current, { attributes: !0, attributeFilter: f }), () => m.disconnect(); }); } function vL(e, t) { const r = oa(e); ot(() => { let i = null; const s = () => r(); return t !== null && (i = window.setInterval(s, t)), () => { i && window.clearInterval(i); }; }, [t, r]); } var mL = 50, bj = 300; function gL(e, t) { const [r, i] = qe(!1), [s, c] = qe(null), [f, m] = qe(!0), y = Xe(null), g = () => clearTimeout(y.current); vL( () => { s === "increment" && e(), s === "decrement" && t(); }, r ? mL : null ); const S = ee(() => { f && e(), y.current = setTimeout(() => { m(!1), i(!0), c("increment"); }, bj); }, [e, f]), E = ee(() => { f && t(), y.current = setTimeout(() => { m(!1), i(!0), c("decrement"); }, bj); }, [t, f]), w = ee(() => { m(!0), i(!1), g(); }, []); return ot(() => () => g(), []), { up: S, down: E, stop: w, isSpinning: r }; } var yL = /^[Ee0-9+\-.]$/; function xL(e) { return yL.test(e); } function SL(e, t) { if (e.key == null) return !0; const r = e.ctrlKey || e.altKey || e.metaKey; return !(e.key.length === 1) || r ? !0 : t(e.key); } function bL(e = {}) { const { focusInputOnChange: t = !0, clampValueOnBlur: r = !0, keepWithinRange: i = !0, min: s = Number.MIN_SAFE_INTEGER, max: c = Number.MAX_SAFE_INTEGER, step: f = 1, isReadOnly: m, isDisabled: y, isRequired: g, isInvalid: S, pattern: E = "[0-9]*(.[0-9]+)?", inputMode: w = "decimal", allowMouseWheel: D, id: M, onChange: k, precision: R, name: O, "aria-describedby": I, "aria-label": A, "aria-labelledby": L, onFocus: H, onBlur: q, onInvalid: U, getAriaValueText: $, isValidCharacter: ae, format: oe, parse: Y, ...ve } = e, de = oa(H), fe = oa(q), _e = oa(U), Me = oa( ae ?? xL ), te = oa($), K = R4(e), { update: se, increment: B, decrement: re } = K, [ke, De] = qe(!1), Se = !(m || y), be = Xe(null), Ie = Xe(null), Ue = Xe(null), tt = Xe(null), ht = ee( (Te) => Te.split("").filter(Me).join(""), [Me] ), dt = ee( (Te) => { var _t; return (_t = Y == null ? void 0 : Y(Te)) != null ? _t : Te; }, [Y] ), Le = ee( (Te) => { var _t; return ((_t = oe == null ? void 0 : oe(Te)) != null ? _t : Te).toString(); }, [oe] ); Kp(() => { (K.valueAsNumber > c || K.valueAsNumber < s) && (_e == null || _e("rangeOverflow", Le(K.value), K.valueAsNumber)); }, [K.valueAsNumber, K.value, Le, _e]), Am(() => { if (!be.current) return; if (be.current.value != K.value) { const _t = dt(be.current.value); K.setValue(ht(_t)); } }, [dt, ht]); const yt = ee( (Te = f) => { Se && B(Te); }, [B, Se, f] ), Ot = ee( (Te = f) => { Se && re(Te); }, [re, Se, f] ), Qe = gL(yt, Ot); Sj( Ue, "disabled", Qe.stop, Qe.isSpinning ), Sj( tt, "disabled", Qe.stop, Qe.isSpinning ); const rn = ee( (Te) => { if (Te.nativeEvent.isComposing) return; const Zt = dt(Te.currentTarget.value); se(ht(Zt)), Ie.current = { start: Te.currentTarget.selectionStart, end: Te.currentTarget.selectionEnd }; }, [se, ht, dt] ), Tn = ee( (Te) => { var _t, Zt, Re; de == null || de(Te), Ie.current && (Te.target.selectionStart = (Zt = Ie.current.start) != null ? Zt : (_t = Te.currentTarget.value) == null ? void 0 : _t.length, Te.currentTarget.selectionEnd = (Re = Ie.current.end) != null ? Re : Te.currentTarget.selectionStart); }, [de] ), pn = ee( (Te) => { if (Te.nativeEvent.isComposing) return; SL(Te, Me) || Te.preventDefault(); const _t = Wn(Te) * f, Zt = Te.key, pe = { ArrowUp: () => yt(_t), ArrowDown: () => Ot(_t), Home: () => se(s), End: () => se(c) }[Zt]; pe && (Te.preventDefault(), pe(Te)); }, [Me, f, yt, Ot, se, s, c] ), Wn = (Te) => { let _t = 1; return (Te.metaKey || Te.ctrlKey) && (_t = 0.1), Te.shiftKey && (_t = 10), _t; }, tr = Xt(() => { const Te = te == null ? void 0 : te(K.value); if (Te != null) return Te; const _t = K.value.toString(); return _t || void 0; }, [K.value, te]), Q = ee(() => { let Te = K.value; if (K.value === "") return; /^[eE]/.test(K.value.toString()) ? K.setValue("") : (K.valueAsNumber < s && (Te = s), K.valueAsNumber > c && (Te = c), K.cast(Te)); }, [K, c, s]), He = ee(() => { De(!1), r && Q(); }, [r, De, Q]), Fe = ee(() => { t && requestAnimationFrame(() => { var Te; (Te = be.current) == null || Te.focus(); }); }, [t]), at = ee( (Te) => { Te.preventDefault(), Qe.up(), Fe(); }, [Fe, Qe] ), he = ee( (Te) => { Te.preventDefault(), Qe.down(), Fe(); }, [Fe, Qe] ); UO( () => be.current, "wheel", (Te) => { var _t, Zt; const pe = ((Zt = (_t = be.current) == null ? void 0 : _t.ownerDocument) != null ? Zt : document).activeElement === be.current; if (!D || !pe) return; Te.preventDefault(); const Ne = Wn(Te) * f, ft = Math.sign(Te.deltaY); ft === -1 ? yt(Ne) : ft === 1 && Ot(Ne); }, { passive: !1 } ); const Ae = ee( (Te = {}, _t = null) => { const Zt = y || i && K.isAtMax; return { ...Te, ref: jr(_t, Ue), role: "button", tabIndex: -1, onPointerDown: Pt(Te.onPointerDown, (Re) => { Re.button !== 0 || Zt || at(Re); }), onPointerLeave: Pt(Te.onPointerLeave, Qe.stop), onPointerUp: Pt(Te.onPointerUp, Qe.stop), disabled: Zt, "aria-disabled": _s(Zt) }; }, [K.isAtMax, i, at, Qe.stop, y] ), Dt = ee( (Te = {}, _t = null) => { const Zt = y || i && K.isAtMin; return { ...Te, ref: jr(_t, tt), role: "button", tabIndex: -1, onPointerDown: Pt(Te.onPointerDown, (Re) => { Re.button !== 0 || Zt || he(Re); }), onPointerLeave: Pt(Te.onPointerLeave, Qe.stop), onPointerUp: Pt(Te.onPointerUp, Qe.stop), disabled: Zt, "aria-disabled": _s(Zt) }; }, [K.isAtMin, i, he, Qe.stop, y] ), Ht = ee( (Te = {}, _t = null) => { var Zt, Re, pe, Ne; return { name: O, inputMode: w, type: "text", pattern: E, "aria-labelledby": L, "aria-label": A, "aria-describedby": I, id: M, disabled: y, ...Te, readOnly: (Zt = Te.readOnly) != null ? Zt : m, "aria-readonly": (Re = Te.readOnly) != null ? Re : m, "aria-required": (pe = Te.required) != null ? pe : g, required: (Ne = Te.required) != null ? Ne : g, ref: jr(be, _t), value: Le(K.value), role: "spinbutton", "aria-valuemin": s, "aria-valuemax": c, "aria-valuenow": Number.isNaN(K.valueAsNumber) ? void 0 : K.valueAsNumber, "aria-invalid": _s(S ?? K.isOutOfRange), "aria-valuetext": tr, autoComplete: "off", autoCorrect: "off", onChange: Pt(Te.onChange, rn), onKeyDown: Pt(Te.onKeyDown, pn), onFocus: Pt( Te.onFocus, Tn, () => De(!0) ), onBlur: Pt(Te.onBlur, fe, He) }; }, [ O, w, E, L, A, Le, I, M, y, g, m, S, K.value, K.valueAsNumber, K.isOutOfRange, s, c, tr, rn, pn, Tn, fe, He ] ); return { value: Le(K.value), valueAsNumber: K.valueAsNumber, isFocused: ke, isDisabled: y, isReadOnly: m, getIncrementButtonProps: Ae, getDecrementButtonProps: Dt, getInputProps: Ht, htmlProps: ve }; } var [CL, Tg] = ur({ name: "NumberInputStylesContext", errorMessage: `useNumberInputStyles returned is 'undefined'. Seems you forgot to wrap the components in "" ` }), [EL, Bb] = ur({ name: "NumberInputContext", errorMessage: "useNumberInputContext: `context` is undefined. Seems you forgot to wrap number-input's components within " }), Ub = lt( function(t, r) { const i = Ha("NumberInput", t), s = Tr(t), c = Cb(s), { htmlProps: f, ...m } = bL(c), y = Xt(() => m, [m]); return /* @__PURE__ */ u.jsx(EL, { value: y, children: /* @__PURE__ */ u.jsx(CL, { value: i, children: /* @__PURE__ */ u.jsx( $e.div, { ...f, ref: r, className: It("chakra-numberinput", t.className), __css: { position: "relative", zIndex: 0, ...i.root } } ) }) }); } ); Ub.displayName = "NumberInput"; var Hb = lt( function(t, r) { const i = Tg(); return /* @__PURE__ */ u.jsx( $e.div, { "aria-hidden": !0, ref: r, ...t, __css: { display: "flex", flexDirection: "column", position: "absolute", top: "0", insetEnd: "0px", margin: "1px", height: "calc(100% - 2px)", zIndex: 1, ...i.stepperGroup } } ); } ); Hb.displayName = "NumberInputStepper"; var Vb = lt( function(t, r) { const { getInputProps: i } = Bb(), s = i(t, r), c = Tg(); return /* @__PURE__ */ u.jsx( $e.input, { ...s, className: It("chakra-numberinput__field", t.className), __css: { width: "100%", ...c.field } } ); } ); Vb.displayName = "NumberInputField"; var A_ = $e("div", { baseStyle: { display: "flex", justifyContent: "center", alignItems: "center", flex: 1, transitionProperty: "common", transitionDuration: "normal", userSelect: "none", cursor: "pointer", lineHeight: "normal" } }), Wb = lt(function(t, r) { var i; const s = Tg(), { getDecrementButtonProps: c } = Bb(), f = c(t, r); return /* @__PURE__ */ u.jsx(A_, { ...f, __css: s.stepper, children: (i = t.children) != null ? i : /* @__PURE__ */ u.jsx(pL, {}) }); }); Wb.displayName = "NumberDecrementStepper"; var Gb = lt(function(t, r) { var i; const { getIncrementButtonProps: s } = Bb(), c = s(t, r), f = Tg(); return /* @__PURE__ */ u.jsx(A_, { ...c, __css: f.stepper, children: (i = t.children) != null ? i : /* @__PURE__ */ u.jsx(hL, {}) }); }); Gb.displayName = "NumberIncrementStepper"; var z_ = lt( function(t, r) { const { getBodyProps: i } = HO(), s = VO(); return /* @__PURE__ */ u.jsx( $e.div, { ...i(t, r), className: It("chakra-popover__body", t.className), __css: s.body } ); } ); z_.displayName = "PopoverBody"; function wL(e, t, r) { return (e - t) * 100 / (r - t); } Gu({ "0%": { strokeDasharray: "1, 400", strokeDashoffset: "0" }, "50%": { strokeDasharray: "400, 400", strokeDashoffset: "-100" }, "100%": { strokeDasharray: "400, 400", strokeDashoffset: "-260" } }); Gu({ "0%": { transform: "rotate(0deg)" }, "100%": { transform: "rotate(360deg)" } }); var jL = Gu({ "0%": { left: "-40%" }, "100%": { left: "100%" } }), TL = Gu({ from: { backgroundPosition: "1rem 0" }, to: { backgroundPosition: "0 0" } }); function DL(e) { const { value: t = 0, min: r, max: i, valueText: s, getValueText: c, isIndeterminate: f, role: m = "progressbar" } = e, y = wL(t, r, i); return { bind: { "data-indeterminate": f ? "" : void 0, "aria-valuemax": i, "aria-valuemin": r, "aria-valuenow": f ? void 0 : t, "aria-valuetext": (() => { if (t != null) return typeof c == "function" ? c(t, y) : s; })(), role: m }, percent: y, value: t }; } var [_L, ML] = ur({ name: "ProgressStylesContext", errorMessage: `useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" ` }), kL = lt( (e, t) => { const { min: r, max: i, value: s, isIndeterminate: c, role: f, ...m } = e, y = DL({ value: s, min: r, max: i, isIndeterminate: c, role: f }), S = { height: "100%", ...ML().filledTrack }; return /* @__PURE__ */ u.jsx( $e.div, { ref: t, style: { width: `${y.percent}%`, ...m.style }, ...y.bind, ...m, __css: S } ); } ), I_ = lt((e, t) => { var r; const { value: i, min: s = 0, max: c = 100, hasStripe: f, isAnimated: m, children: y, borderRadius: g, isIndeterminate: S, "aria-label": E, "aria-labelledby": w, "aria-valuetext": D, title: M, role: k, ...R } = Tr(e), O = Ha("Progress", e), I = g ?? ((r = O.track) == null ? void 0 : r.borderRadius), A = { animation: `${TL} 1s linear infinite` }, q = { ...!S && f && m && A, ...S && { position: "absolute", willChange: "left", minWidth: "50%", animation: `${jL} 1s ease infinite normal none running` } }, U = { overflow: "hidden", position: "relative", ...O.track }; return /* @__PURE__ */ u.jsx( $e.div, { ref: t, borderRadius: I, __css: U, ...R, children: /* @__PURE__ */ u.jsxs(_L, { value: O, children: [ /* @__PURE__ */ u.jsx( kL, { "aria-label": E, "aria-labelledby": w, "aria-valuetext": D, min: s, max: c, value: i, isIndeterminate: S, css: q, borderRadius: I, title: M, role: k } ), y ] }) } ); }); I_.displayName = "Progress"; function RL(e) { return e && Cw(e) && Cw(e.target); } function PL(e = {}) { const { onChange: t, value: r, defaultValue: i, name: s, isDisabled: c, isFocusable: f, isNative: m, ...y } = e, [g, S] = qe(i || ""), E = typeof r < "u", w = E ? r : g, D = Xe(null), M = ee(() => { const H = D.current; if (!H) return; let q = "input:not(:disabled):checked"; const U = H.querySelector( q ); if (U) { U.focus(); return; } q = "input:not(:disabled)"; const $ = H.querySelector(q); $ == null || $.focus(); }, []), R = `radio-${Ko()}`, O = s || R, I = ee( (H) => { const q = RL(H) ? H.target.value : H; E || S(q), t == null || t(String(q)); }, [t, E] ), A = ee( (H = {}, q = null) => ({ ...H, ref: jr(q, D), role: "radiogroup" }), [] ), L = ee( (H = {}, q = null) => ({ ...H, ref: q, name: O, [m ? "checked" : "isChecked"]: w != null ? H.value === w : void 0, onChange($) { I($); }, "data-radiogroup": !0 }), [m, O, I, w] ); return { getRootProps: A, getRadioProps: L, name: O, ref: D, focus: M, setValue: S, value: w, onChange: I, isDisabled: c, isFocusable: f, htmlProps: y }; } var [NL, F_] = ur({ name: "RadioGroupContext", strict: !1 }), Hp = lt((e, t) => { const { colorScheme: r, size: i, variant: s, children: c, className: f, isDisabled: m, isFocusable: y, ...g } = e, { value: S, onChange: E, getRootProps: w, name: D, htmlProps: M } = PL(g), k = Xt( () => ({ name: D, size: i, onChange: E, colorScheme: r, value: S, variant: s, isDisabled: m, isFocusable: y }), [ D, i, E, r, S, s, m, y ] ); return /* @__PURE__ */ u.jsx(NL, { value: k, children: /* @__PURE__ */ u.jsx( $e.div, { ...w(M, t), className: It("chakra-radio-group", f), children: c } ) }); }); Hp.displayName = "RadioGroup"; var OL = { border: "0", clip: "rect(0, 0, 0, 0)", height: "1px", width: "1px", margin: "-1px", padding: "0", overflow: "hidden", whiteSpace: "nowrap", position: "absolute" }; function AL(e = {}) { const { defaultChecked: t, isChecked: r, isFocusable: i, isDisabled: s, isReadOnly: c, isRequired: f, onChange: m, isInvalid: y, name: g, value: S, id: E, "data-radiogroup": w, "aria-describedby": D, ...M } = e, k = `radio-${Ko()}`, R = Yu(), I = !!F_() || !!w; let L = !!R && !I ? R.id : k; L = E ?? L; const H = s ?? (R == null ? void 0 : R.isDisabled), q = c ?? (R == null ? void 0 : R.isReadOnly), U = f ?? (R == null ? void 0 : R.isRequired), $ = y ?? (R == null ? void 0 : R.isInvalid), [ae, oe] = qe(!1), [Y, ve] = qe(!1), [de, fe] = qe(!1), [_e, Me] = qe(!1), [te, K] = qe(Boolean(t)), se = typeof r < "u", B = se ? r : te; ot(() => RD(oe), []); const re = ee( (Le) => { if (q || H) { Le.preventDefault(); return; } se || K(Le.target.checked), m == null || m(Le); }, [se, H, q, m] ), ke = ee( (Le) => { Le.key === " " && Me(!0); }, [Me] ), De = ee( (Le) => { Le.key === " " && Me(!1); }, [Me] ), Se = ee( (Le = {}, yt = null) => ({ ...Le, ref: yt, "data-active": Kt(_e), "data-hover": Kt(de), "data-disabled": Kt(H), "data-invalid": Kt($), "data-checked": Kt(B), "data-focus": Kt(Y), "data-focus-visible": Kt(Y && ae), "data-readonly": Kt(q), "aria-hidden": !0, onMouseDown: Pt(Le.onMouseDown, () => Me(!0)), onMouseUp: Pt(Le.onMouseUp, () => Me(!1)), onMouseEnter: Pt( Le.onMouseEnter, () => fe(!0) ), onMouseLeave: Pt( Le.onMouseLeave, () => fe(!1) ) }), [ _e, de, H, $, B, Y, q, ae ] ), { onFocus: be, onBlur: Ie } = R ?? {}, Ue = ee( (Le = {}, yt = null) => { const Ot = H && !i; return { ...Le, id: L, ref: yt, type: "radio", name: g, value: S, onChange: Pt(Le.onChange, re), onBlur: Pt( Ie, Le.onBlur, () => ve(!1) ), onFocus: Pt( be, Le.onFocus, () => ve(!0) ), onKeyDown: Pt(Le.onKeyDown, ke), onKeyUp: Pt(Le.onKeyUp, De), checked: B, disabled: Ot, readOnly: q, required: U, "aria-invalid": _s($), "aria-disabled": _s(Ot), "aria-required": _s(U), "data-readonly": Kt(q), "aria-describedby": D, style: OL }; }, [ H, i, L, g, S, re, Ie, be, ke, De, B, q, U, $, D ] ); return { state: { isInvalid: $, isFocused: Y, isChecked: B, isActive: _e, isHovered: de, isDisabled: H, isReadOnly: q, isRequired: U }, getCheckboxProps: Se, getInputProps: Ue, getLabelProps: (Le = {}, yt = null) => ({ ...Le, ref: yt, onMouseDown: Pt(Le.onMouseDown, Cj), onTouchStart: Pt(Le.onTouchStart, Cj), "data-disabled": Kt(H), "data-checked": Kt(B), "data-invalid": Kt($) }), getRootProps: (Le, yt = null) => ({ ...Le, ref: yt, "data-disabled": Kt(H), "data-checked": Kt(B), "data-invalid": Kt($) }), htmlProps: M }; } function Cj(e) { e.preventDefault(), e.stopPropagation(); } function zL(e, t) { const r = {}, i = {}; for (const [s, c] of Object.entries(e)) t.includes(s) ? r[s] = c : i[s] = c; return [r, i]; } var Ba = lt((e, t) => { var r; const i = F_(), { onChange: s, value: c } = e, f = Ha("Radio", { ...i, ...e }), m = Tr(e), { spacing: y = "0.5rem", children: g, isDisabled: S = i == null ? void 0 : i.isDisabled, isFocusable: E = i == null ? void 0 : i.isFocusable, inputProps: w, ...D } = m; let M = e.isChecked; (i == null ? void 0 : i.value) != null && c != null && (M = i.value === c); let k = s; i != null && i.onChange && c != null && (k = ib(i.onChange, s)); const R = (r = e == null ? void 0 : e.name) != null ? r : i == null ? void 0 : i.name, { getInputProps: O, getCheckboxProps: I, getLabelProps: A, getRootProps: L, htmlProps: H } = AL({ ...D, isChecked: M, isFocusable: E, isDisabled: S, onChange: k, name: R }), [q, U] = zL(H, m2), $ = I(U), ae = O(w, t), oe = A(), Y = Object.assign({}, q, L()), ve = { display: "inline-flex", alignItems: "center", verticalAlign: "top", cursor: "pointer", position: "relative", ...f.container }, de = { display: "inline-flex", alignItems: "center", justifyContent: "center", flexShrink: 0, ...f.control }, fe = { userSelect: "none", marginStart: y, ...f.label }; return /* @__PURE__ */ u.jsxs($e.label, { className: "chakra-radio", ...Y, __css: ve, children: [ /* @__PURE__ */ u.jsx("input", { className: "chakra-radio__input", ...ae }), /* @__PURE__ */ u.jsx( $e.span, { className: "chakra-radio__control", ...$, __css: de } ), g && /* @__PURE__ */ u.jsx( $e.span, { className: "chakra-radio__label", ...oe, __css: fe, children: g } ) ] }); }); Ba.displayName = "Radio"; var L_ = lt( function(t, r) { const { children: i, placeholder: s, className: c, ...f } = t; return /* @__PURE__ */ u.jsxs( $e.select, { ...f, ref: r, className: It("chakra-select", c), children: [ s && /* @__PURE__ */ u.jsx("option", { value: "", children: s }), i ] } ); } ); L_.displayName = "SelectField"; function IL(e, t) { const r = {}, i = {}; for (const [s, c] of Object.entries(e)) t.includes(s) ? r[s] = c : i[s] = c; return [r, i]; } var B_ = lt((e, t) => { var r; const i = Ha("Select", e), { rootProps: s, placeholder: c, icon: f, color: m, height: y, h: g, minH: S, minHeight: E, iconColor: w, iconSize: D, ...M } = Tr(e), [k, R] = IL(M, m2), O = bb(R), I = { width: "100%", height: "fit-content", position: "relative", color: m }, A = { paddingEnd: "2rem", ...i.field, _focus: { zIndex: "unset", ...(r = i.field) == null ? void 0 : r._focus } }; return /* @__PURE__ */ u.jsxs( $e.div, { className: "chakra-select__wrapper", __css: I, ...k, ...s, children: [ /* @__PURE__ */ u.jsx( L_, { ref: t, height: g ?? y, minH: S ?? E, placeholder: c, ...O, __css: A, children: e.children } ), /* @__PURE__ */ u.jsx( U_, { "data-disabled": Kt(O.disabled), ...(w || m) && { color: w || m }, __css: i.icon, ...D && { fontSize: D }, children: f } ) ] } ); }); B_.displayName = "Select"; var FL = (e) => /* @__PURE__ */ u.jsx("svg", { viewBox: "0 0 24 24", ...e, children: /* @__PURE__ */ u.jsx( "path", { fill: "currentColor", d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" } ) }), LL = $e("div", { baseStyle: { position: "absolute", display: "inline-flex", alignItems: "center", justifyContent: "center", pointerEvents: "none", top: "50%", transform: "translateY(-50%)" } }), U_ = (e) => { const { children: t = /* @__PURE__ */ u.jsx(FL, {}), ...r } = e, i = Ll(t, { role: "presentation", className: "chakra-select__icon", focusable: !1, "aria-hidden": !0, style: { width: "1em", height: "1em", color: "currentColor" } }); return /* @__PURE__ */ u.jsx(LL, { ...r, className: "chakra-select__icon-wrapper", children: gD(t) ? i : null }); }; U_.displayName = "SelectIcon"; var bd = (e) => e ? "" : void 0, Hx = (e) => e ? !0 : void 0, ih = (...e) => e.filter(Boolean).join(" "); function Vx(...e) { return function(r) { e.some((i) => (i == null || i(r), r == null ? void 0 : r.defaultPrevented)); }; } function Em(e) { const { orientation: t, vertical: r, horizontal: i } = e; return t === "vertical" ? r : i; } var Hm = { width: 0, height: 0 }, wm = (e) => e || Hm; function BL(e) { const { orientation: t, thumbPercents: r, thumbRects: i, isReversed: s } = e, c = (k) => { var R; const O = (R = i[k]) != null ? R : Hm; return { position: "absolute", userSelect: "none", WebkitUserSelect: "none", MozUserSelect: "none", msUserSelect: "none", touchAction: "none", ...Em({ orientation: t, vertical: { bottom: `calc(${r[k]}% - ${O.height / 2}px)` }, horizontal: { left: `calc(${r[k]}% - ${O.width / 2}px)` } }) }; }, f = t === "vertical" ? i.reduce( (k, R) => wm(k).height > wm(R).height ? k : R, Hm ) : i.reduce( (k, R) => wm(k).width > wm(R).width ? k : R, Hm ), m = { position: "relative", touchAction: "none", WebkitTapHighlightColor: "rgba(0,0,0,0)", userSelect: "none", outline: 0, ...Em({ orientation: t, vertical: f ? { paddingLeft: f.width / 2, paddingRight: f.width / 2 } : {}, horizontal: f ? { paddingTop: f.height / 2, paddingBottom: f.height / 2 } : {} }) }, y = { position: "absolute", ...Em({ orientation: t, vertical: { left: "50%", transform: "translateX(-50%)", height: "100%" }, horizontal: { top: "50%", transform: "translateY(-50%)", width: "100%" } }) }, g = r.length === 1, S = [0, s ? 100 - r[0] : r[0]], E = g ? S : r; let w = E[0]; !g && s && (w = 100 - w); const D = Math.abs(E[E.length - 1] - E[0]), M = { ...y, ...Em({ orientation: t, vertical: s ? { height: `${D}%`, top: `${w}%` } : { height: `${D}%`, bottom: `${w}%` }, horizontal: s ? { width: `${D}%`, right: `${w}%` } : { width: `${D}%`, left: `${w}%` } }) }; return { trackStyle: y, innerTrackStyle: M, rootStyle: m, getThumbStyle: c }; } function UL(e) { const { isReversed: t, direction: r, orientation: i } = e; return r === "ltr" || i === "vertical" ? t : !t; } function HL(e, t, r, i) { return e.addEventListener(t, r, i), () => { e.removeEventListener(t, r, i); }; } function VL(e) { const t = GL(e); return typeof t.PointerEvent < "u" && e instanceof t.PointerEvent ? e.pointerType === "mouse" : e instanceof t.MouseEvent; } function H_(e) { return !!e.touches; } function WL(e) { return H_(e) && e.touches.length > 1; } function GL(e) { var t; return (t = e.view) != null ? t : window; } function qL(e, t = "page") { const r = e.touches[0] || e.changedTouches[0]; return { x: r[`${t}X`], y: r[`${t}Y`] }; } function YL(e, t = "page") { return { x: e[`${t}X`], y: e[`${t}Y`] }; } function V_(e, t = "page") { return H_(e) ? qL(e, t) : YL(e, t); } function KL(e) { return (t) => { const r = VL(t); (!r || r && t.button === 0) && e(t); }; } function XL(e, t = !1) { function r(s) { e(s, { point: V_(s) }); } return t ? KL(r) : r; } function Vm(e, t, r, i) { return HL(e, t, XL(r, t === "pointerdown"), i); } var $L = Object.defineProperty, QL = (e, t, r) => t in e ? $L(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, io = (e, t, r) => (QL(e, typeof t != "symbol" ? t + "" : t, r), r), ZL = class { constructor(e, t, r) { io(this, "history", []), io(this, "startEvent", null), io(this, "lastEvent", null), io(this, "lastEventInfo", null), io(this, "handlers", {}), io(this, "removeListeners", () => { }), io(this, "threshold", 3), io(this, "win"), io(this, "updatePoint", () => { if (!(this.lastEvent && this.lastEventInfo)) return; const m = Wx(this.lastEventInfo, this.history), y = this.startEvent !== null, g = n3(m.offset, { x: 0, y: 0 }) >= this.threshold; if (!y && !g) return; const { timestamp: S } = Hw(); this.history.push({ ...m.point, timestamp: S }); const { onStart: E, onMove: w } = this.handlers; y || (E == null || E(this.lastEvent, m), this.startEvent = this.lastEvent), w == null || w(this.lastEvent, m); }), io(this, "onPointerMove", (m, y) => { this.lastEvent = m, this.lastEventInfo = y, jI.update(this.updatePoint, !0); }), io(this, "onPointerUp", (m, y) => { const g = Wx(y, this.history), { onEnd: S, onSessionEnd: E } = this.handlers; E == null || E(m, g), this.end(), !(!S || !this.startEvent) && (S == null || S(m, g)); }); var i; if (this.win = (i = e.view) != null ? i : window, WL(e)) return; this.handlers = t, r && (this.threshold = r), e.stopPropagation(), e.preventDefault(); const s = { point: V_(e) }, { timestamp: c } = Hw(); this.history = [{ ...s.point, timestamp: c }]; const { onSessionStart: f } = t; f == null || f(e, Wx(s, this.history)), this.removeListeners = t3( Vm(this.win, "pointermove", this.onPointerMove), Vm(this.win, "pointerup", this.onPointerUp), Vm(this.win, "pointercancel", this.onPointerUp) ); } updateHandlers(e) { this.handlers = e; } end() { var e; (e = this.removeListeners) == null || e.call(this), TI.update(this.updatePoint); } }; function Ej(e, t) { return { x: e.x - t.x, y: e.y - t.y }; } function Wx(e, t) { return { point: e.point, delta: Ej(e.point, t[t.length - 1]), offset: Ej(e.point, t[0]), velocity: e3(t, 0.1) }; } var JL = (e) => e * 1e3; function e3(e, t) { if (e.length < 2) return { x: 0, y: 0 }; let r = e.length - 1, i = null; const s = e[e.length - 1]; for (; r >= 0 && (i = e[r], !(s.timestamp - i.timestamp > JL(t))); ) r--; if (!i) return { x: 0, y: 0 }; const c = (s.timestamp - i.timestamp) / 1e3; if (c === 0) return { x: 0, y: 0 }; const f = { x: (s.x - i.x) / c, y: (s.y - i.y) / c }; return f.x === 1 / 0 && (f.x = 0), f.y === 1 / 0 && (f.y = 0), f; } function t3(...e) { return (t) => e.reduce((r, i) => i(r), t); } function Gx(e, t) { return Math.abs(e - t); } function wj(e) { return "x" in e && "y" in e; } function n3(e, t) { if (typeof e == "number" && typeof t == "number") return Gx(e, t); if (wj(e) && wj(t)) { const r = Gx(e.x, t.x), i = Gx(e.y, t.y); return Math.sqrt(r ** 2 + i ** 2); } return 0; } function W_(e) { const t = Xe(null); return t.current = e, t; } function r3(e, t) { const { onPan: r, onPanStart: i, onPanEnd: s, onPanSessionStart: c, onPanSessionEnd: f, threshold: m } = t, y = Boolean( r || i || s || c || f ), g = Xe(null), S = W_({ onSessionStart: c, onSessionEnd: f, onStart: i, onMove: r, onEnd(E, w) { g.current = null, s == null || s(E, w); } }); ot(() => { var E; (E = g.current) == null || E.updateHandlers(S.current); }), ot(() => { const E = e.current; if (!E || !y) return; function w(D) { g.current = new ZL(D, S.current, m); } return Vm(E, "pointerdown", w); }, [e, y, S, m]), ot(() => () => { var E; (E = g.current) == null || E.end(), g.current = null; }, []); } function a3(e, t) { var r; if (!e) { t(void 0); return; } t({ width: e.offsetWidth, height: e.offsetHeight }); const i = (r = e.ownerDocument.defaultView) != null ? r : window, s = new i.ResizeObserver((c) => { if (!Array.isArray(c) || !c.length) return; const [f] = c; let m, y; if ("borderBoxSize" in f) { const g = f.borderBoxSize, S = Array.isArray(g) ? g[0] : g; m = S.inlineSize, y = S.blockSize; } else m = e.offsetWidth, y = e.offsetHeight; t({ width: m, height: y }); }); return s.observe(e, { box: "border-box" }), () => s.unobserve(e); } var i3 = Boolean(globalThis == null ? void 0 : globalThis.document) ? co : ot; function o3(e, t) { var r, i; if (!e || !e.parentElement) return; const s = (i = (r = e.ownerDocument) == null ? void 0 : r.defaultView) != null ? i : window, c = new s.MutationObserver(() => { t(); }); return c.observe(e.parentElement, { childList: !0 }), () => { c.disconnect(); }; } function s3({ getNodes: e, observeMutation: t = !0 }) { const [r, i] = qe([]), [s, c] = qe(0); return i3(() => { const f = e(), m = f.map( (y, g) => a3(y, (S) => { i((E) => [ ...E.slice(0, g), S, ...E.slice(g + 1) ]); }) ); if (t) { const y = f[0]; m.push( o3(y, () => { c((g) => g + 1); }) ); } return () => { m.forEach((y) => { y == null || y(); }); }; }, [s]), r; } function l3(e) { return typeof e == "object" && e !== null && "current" in e; } function u3(e) { const [t] = s3({ observeMutation: !1, getNodes() { return [l3(e) ? e.current : e]; } }); return t; } function c3(e) { var t; const { min: r = 0, max: i = 100, onChange: s, value: c, defaultValue: f, isReversed: m, direction: y = "ltr", orientation: g = "horizontal", id: S, isDisabled: E, isReadOnly: w, onChangeStart: D, onChangeEnd: M, step: k = 1, getAriaValueText: R, "aria-valuetext": O, "aria-label": I, "aria-labelledby": A, name: L, focusThumbOnChange: H = !0, ...q } = e, U = oa(D), $ = oa(M), ae = oa(R), oe = UL({ isReversed: m, direction: y, orientation: g }), [Y, ve] = yb({ value: c, defaultValue: f ?? f3(r, i), onChange: s }), [de, fe] = qe(!1), [_e, Me] = qe(!1), te = !(E || w), K = (i - r) / 10, se = k || (i - r) / 100, B = Lm(Y, r, i), re = i - B + r, De = Zw(oe ? re : B, r, i), Se = g === "vertical", be = W_({ min: r, max: i, step: k, isDisabled: E, value: B, isInteractive: te, isReversed: oe, isVertical: Se, eventSource: null, focusThumbOnChange: H, orientation: g }), Ie = Xe(null), Ue = Xe(null), tt = Xe(null), ht = Ko(), dt = S ?? ht, [Le, yt] = [`slider-thumb-${dt}`, `slider-track-${dt}`], Ot = ee( (pe) => { var Ne, ft; if (!Ie.current) return; const Vt = be.current; Vt.eventSource = "pointer"; const vn = Ie.current.getBoundingClientRect(), { clientX: st, clientY: rt } = (ft = (Ne = pe.touches) == null ? void 0 : Ne[0]) != null ? ft : pe, kn = Se ? vn.bottom - rt : st - vn.left, bn = Se ? vn.height : vn.width; let Ft = kn / bn; oe && (Ft = 1 - Ft); let sa = k4(Ft, Vt.min, Vt.max); return Vt.step && (sa = parseFloat( Jw(sa, Vt.min, Vt.step) )), sa = Lm(sa, Vt.min, Vt.max), sa; }, [Se, oe, be] ), Qe = ee( (pe) => { const Ne = be.current; Ne.isInteractive && (pe = parseFloat(Jw(pe, Ne.min, se)), pe = Lm(pe, Ne.min, Ne.max), ve(pe)); }, [se, ve, be] ), rn = Xt( () => ({ stepUp(pe = se) { const Ne = oe ? B - pe : B + pe; Qe(Ne); }, stepDown(pe = se) { const Ne = oe ? B + pe : B - pe; Qe(Ne); }, reset() { Qe(f || 0); }, stepTo(pe) { Qe(pe); } }), [Qe, oe, B, se, f] ), Tn = ee( (pe) => { const Ne = be.current, Vt = { ArrowRight: () => rn.stepUp(), ArrowUp: () => rn.stepUp(), ArrowLeft: () => rn.stepDown(), ArrowDown: () => rn.stepDown(), PageUp: () => rn.stepUp(K), PageDown: () => rn.stepDown(K), Home: () => Qe(Ne.min), End: () => Qe(Ne.max) }[pe.key]; Vt && (pe.preventDefault(), pe.stopPropagation(), Vt(pe), Ne.eventSource = "keyboard"); }, [rn, Qe, K, be] ), pn = (t = ae == null ? void 0 : ae(B)) != null ? t : O, Wn = u3(Ue), { getThumbStyle: tr, rootStyle: Q, trackStyle: He, innerTrackStyle: Fe } = Xt(() => { const pe = be.current, Ne = Wn ?? { width: 0, height: 0 }; return BL({ isReversed: oe, orientation: pe.orientation, thumbRects: [Ne], thumbPercents: [De] }); }, [oe, Wn, De, be]), at = ee(() => { be.current.focusThumbOnChange && setTimeout(() => { var Ne; return (Ne = Ue.current) == null ? void 0 : Ne.focus(); }); }, [be]); Kp(() => { const pe = be.current; at(), pe.eventSource === "keyboard" && ($ == null || $(pe.value)); }, [B, $]); function he(pe) { const Ne = Ot(pe); Ne != null && Ne !== be.current.value && ve(Ne); } r3(tt, { onPanSessionStart(pe) { const Ne = be.current; Ne.isInteractive && (fe(!0), at(), he(pe), U == null || U(Ne.value)); }, onPanSessionEnd() { const pe = be.current; pe.isInteractive && (fe(!1), $ == null || $(pe.value)); }, onPan(pe) { be.current.isInteractive && he(pe); } }); const Ae = ee( (pe = {}, Ne = null) => ({ ...pe, ...q, ref: jr(Ne, tt), tabIndex: -1, "aria-disabled": Hx(E), "data-focused": bd(_e), style: { ...pe.style, ...Q } }), [q, E, _e, Q] ), Dt = ee( (pe = {}, Ne = null) => ({ ...pe, ref: jr(Ne, Ie), id: yt, "data-disabled": bd(E), style: { ...pe.style, ...He } }), [E, yt, He] ), Ht = ee( (pe = {}, Ne = null) => ({ ...pe, ref: Ne, style: { ...pe.style, ...Fe } }), [Fe] ), Te = ee( (pe = {}, Ne = null) => ({ ...pe, ref: jr(Ne, Ue), role: "slider", tabIndex: te ? 0 : void 0, id: Le, "data-active": bd(de), "aria-valuetext": pn, "aria-valuemin": r, "aria-valuemax": i, "aria-valuenow": B, "aria-orientation": g, "aria-disabled": Hx(E), "aria-readonly": Hx(w), "aria-label": I, "aria-labelledby": I ? void 0 : A, style: { ...pe.style, ...tr(0) }, onKeyDown: Vx(pe.onKeyDown, Tn), onFocus: Vx(pe.onFocus, () => Me(!0)), onBlur: Vx(pe.onBlur, () => Me(!1)) }), [ te, Le, de, pn, r, i, B, g, E, w, I, A, tr, Tn ] ), _t = ee( (pe, Ne = null) => { const ft = !(pe.value < r || pe.value > i), Vt = B >= pe.value, vn = Zw(pe.value, r, i), st = { position: "absolute", pointerEvents: "none", ...d3({ orientation: g, vertical: { bottom: oe ? `${100 - vn}%` : `${vn}%` }, horizontal: { left: oe ? `${100 - vn}%` : `${vn}%` } }) }; return { ...pe, ref: Ne, role: "presentation", "aria-hidden": !0, "data-disabled": bd(E), "data-invalid": bd(!ft), "data-highlighted": bd(Vt), style: { ...pe.style, ...st } }; }, [E, oe, i, r, g, B] ), Zt = ee( (pe = {}, Ne = null) => ({ ...pe, ref: Ne, type: "hidden", value: B, name: L }), [L, B] ); return { state: { value: B, isFocused: _e, isDragging: de }, actions: rn, getRootProps: Ae, getTrackProps: Dt, getInnerTrackProps: Ht, getThumbProps: Te, getMarkerProps: _t, getInputProps: Zt }; } function d3(e) { const { orientation: t, vertical: r, horizontal: i } = e; return t === "vertical" ? r : i; } function f3(e, t) { return t < e ? e : e + (t - e) / 2; } var [p3, Dg] = ur({ name: "SliderContext", hookName: "useSliderContext", providerName: "" }), [h3, _g] = ur({ name: "SliderStylesContext", hookName: "useSliderStyles", providerName: "" }), G_ = lt((e, t) => { const r = { orientation: "horizontal", ...e }, i = Ha("Slider", r), s = Tr(r), { direction: c } = hg(); s.direction = c; const { getInputProps: f, getRootProps: m, ...y } = c3(s), g = m(), S = f({}, t); return /* @__PURE__ */ u.jsx(p3, { value: y, children: /* @__PURE__ */ u.jsx(h3, { value: i, children: /* @__PURE__ */ u.jsxs( $e.div, { ...g, className: ih("chakra-slider", r.className), __css: i.container, children: [ r.children, /* @__PURE__ */ u.jsx("input", { ...S }) ] } ) }) }); }); G_.displayName = "Slider"; var q_ = lt((e, t) => { const { getThumbProps: r } = Dg(), i = _g(), s = r(e, t); return /* @__PURE__ */ u.jsx( $e.div, { ...s, className: ih("chakra-slider__thumb", e.className), __css: i.thumb } ); }); q_.displayName = "SliderThumb"; var Y_ = lt((e, t) => { const { getTrackProps: r } = Dg(), i = _g(), s = r(e, t); return /* @__PURE__ */ u.jsx( $e.div, { ...s, className: ih("chakra-slider__track", e.className), __css: i.track } ); }); Y_.displayName = "SliderTrack"; var K_ = lt( (e, t) => { const { getInnerTrackProps: r } = Dg(), i = _g(), s = r(e, t); return /* @__PURE__ */ u.jsx( $e.div, { ...s, className: ih("chakra-slider__filled-track", e.className), __css: i.filledTrack } ); } ); K_.displayName = "SliderFilledTrack"; var FS = lt((e, t) => { const { getMarkerProps: r } = Dg(), i = _g(), s = r(e, t); return /* @__PURE__ */ u.jsx( $e.div, { ...s, className: ih("chakra-slider__marker", e.className), __css: i.mark } ); }); FS.displayName = "SliderMark"; var X_ = lt(function(t, r) { const i = Ha("Switch", t), { spacing: s = "0.5rem", children: c, ...f } = Tr(t), { state: m, getInputProps: y, getCheckboxProps: g, getRootProps: S, getLabelProps: E } = PD(f), w = Xt( () => ({ display: "inline-block", position: "relative", verticalAlign: "middle", lineHeight: 0, ...i.container }), [i.container] ), D = Xt( () => ({ display: "inline-flex", flexShrink: 0, justifyContent: "flex-start", boxSizing: "content-box", cursor: "pointer", ...i.track }), [i.track] ), M = Xt( () => ({ userSelect: "none", marginStart: s, ...i.label }), [s, i.label] ); return /* @__PURE__ */ u.jsxs( $e.label, { ...S(), className: It("chakra-switch", t.className), __css: w, children: [ /* @__PURE__ */ u.jsx("input", { className: "chakra-switch__input", ...y({}, r) }), /* @__PURE__ */ u.jsx( $e.span, { ...g(), className: "chakra-switch__track", __css: D, children: /* @__PURE__ */ u.jsx( $e.span, { __css: i.thumb, className: "chakra-switch__thumb", "data-checked": Kt(m.isChecked), "data-hover": Kt(m.isHovered) } ) } ), c && /* @__PURE__ */ u.jsx( $e.span, { className: "chakra-switch__label", ...E(), __css: M, children: c } ) ] } ); }); X_.displayName = "Switch"; var [ v3, m3, g3, y3 ] = mb(); function x3(e) { var t; const { defaultIndex: r, onChange: i, index: s, isManual: c, isLazy: f, lazyBehavior: m = "unmount", orientation: y = "horizontal", direction: g = "ltr", ...S } = e, [E, w] = qe(r ?? 0), [D, M] = yb({ defaultValue: r ?? 0, value: s, onChange: i }); ot(() => { s != null && w(s); }, [s]); const k = g3(), R = Ko(); return { id: `tabs-${(t = e.id) != null ? t : R}`, selectedIndex: D, focusedIndex: E, setSelectedIndex: M, setFocusedIndex: w, isManual: c, isLazy: f, lazyBehavior: m, orientation: y, descendants: k, direction: g, htmlProps: S }; } var [S3, Mg] = ur({ name: "TabsContext", errorMessage: "useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within " }); function b3(e) { const { focusedIndex: t, orientation: r, direction: i } = Mg(), s = m3(), c = ee( (f) => { const m = () => { var I; const A = s.nextEnabled(t); A && ((I = A.node) == null || I.focus()); }, y = () => { var I; const A = s.prevEnabled(t); A && ((I = A.node) == null || I.focus()); }, g = () => { var I; const A = s.firstEnabled(); A && ((I = A.node) == null || I.focus()); }, S = () => { var I; const A = s.lastEnabled(); A && ((I = A.node) == null || I.focus()); }, E = r === "horizontal", w = r === "vertical", D = f.key, M = i === "ltr" ? "ArrowLeft" : "ArrowRight", k = i === "ltr" ? "ArrowRight" : "ArrowLeft", O = { [M]: () => E && y(), [k]: () => E && m(), ArrowDown: () => w && m(), ArrowUp: () => w && y(), Home: g, End: S }[D]; O && (f.preventDefault(), O(f)); }, [s, t, r, i] ); return { ...e, role: "tablist", "aria-orientation": r, onKeyDown: Pt(e.onKeyDown, c) }; } function C3(e) { const { isDisabled: t, isFocusable: r, ...i } = e, { setSelectedIndex: s, isManual: c, id: f, setFocusedIndex: m, selectedIndex: y } = Mg(), { index: g, register: S } = y3({ disabled: t && !r }), E = g === y, w = () => { s(g); }, D = () => { m(g), !c && !(t && r) && s(g); }, M = x_({ ...i, ref: jr(S, e.ref), isDisabled: t, isFocusable: r, onClick: Pt(e.onClick, w) }), k = "button"; return { ...M, id: $_(f, g), role: "tab", tabIndex: E ? 0 : -1, type: k, "aria-selected": E, "aria-controls": Q_(f, g), onFocus: t ? void 0 : Pt(e.onFocus, D) }; } var [E3, w3] = ur({}); function j3(e) { const t = Mg(), { id: r, selectedIndex: i } = t, c = h2(e.children).map( (f, m) => Ds( E3, { key: m, value: { isSelected: m === i, id: Q_(r, m), tabId: $_(r, m), selectedIndex: i } }, f ) ); return { ...e, children: c }; } function T3(e) { const { children: t, ...r } = e, { isLazy: i, lazyBehavior: s } = Mg(), { isSelected: c, id: f, tabId: m } = w3(), y = Xe(!1); c && (y.current = !0); const g = v2({ wasSelected: y.current, isSelected: c, enabled: i, mode: s }); return { tabIndex: 0, ...r, children: g ? t : null, role: "tabpanel", "aria-labelledby": m, hidden: !c, id: f }; } function $_(e, t) { return `${e}--tab-${t}`; } function Q_(e, t) { return `${e}--tabpanel-${t}`; } var [D3, kg] = ur({ name: "TabsStylesContext", errorMessage: `useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" ` }), Z_ = lt(function(t, r) { const i = Ha("Tabs", t), { children: s, className: c, ...f } = Tr(t), { htmlProps: m, descendants: y, ...g } = x3(f), S = Xt(() => g, [g]), { isFitted: E, ...w } = m; return /* @__PURE__ */ u.jsx(v3, { value: y, children: /* @__PURE__ */ u.jsx(S3, { value: S, children: /* @__PURE__ */ u.jsx(D3, { value: i, children: /* @__PURE__ */ u.jsx( $e.div, { className: It("chakra-tabs", c), ref: r, ...w, __css: i.root, children: s } ) }) }) }); }); Z_.displayName = "Tabs"; var J_ = lt(function(t, r) { const i = b3({ ...t, ref: r }), c = { display: "flex", ...kg().tablist }; return /* @__PURE__ */ u.jsx( $e.div, { ...i, className: It("chakra-tabs__tablist", t.className), __css: c } ); }); J_.displayName = "TabList"; var eM = lt(function(t, r) { const i = T3({ ...t, ref: r }), s = kg(); return /* @__PURE__ */ u.jsx( $e.div, { outline: "0", ...i, className: It("chakra-tabs__tab-panel", t.className), __css: s.tabpanel } ); }); eM.displayName = "TabPanel"; var tM = lt(function(t, r) { const i = j3(t), s = kg(); return /* @__PURE__ */ u.jsx( $e.div, { ...i, width: "100%", ref: r, className: It("chakra-tabs__tab-panels", t.className), __css: s.tabpanels } ); }); tM.displayName = "TabPanels"; var nM = lt(function(t, r) { const i = kg(), s = C3({ ...t, ref: r }), c = { outline: "0", display: "flex", alignItems: "center", justifyContent: "center", ...i.tab }; return /* @__PURE__ */ u.jsx( $e.button, { ...s, className: It("chakra-tabs__tab", t.className), __css: c } ); }); nM.displayName = "Tab"; function _3(e, t = []) { const r = Object.assign({}, e); for (const i of t) i in r && delete r[i]; return r; } var M3 = ["h", "minH", "height", "minHeight"], qb = lt((e, t) => { const r = Hd("Textarea", e), { className: i, rows: s, ...c } = Tr(e), f = bb(c), m = s ? _3(r, M3) : r; return /* @__PURE__ */ u.jsx( $e.textarea, { ref: t, rows: s, ...f, className: It("chakra-textarea", i), __css: m } ); }); qb.displayName = "Textarea"; const Yb = xg(null); let jj; const Kb = () => ({ setOpenUploader: (e) => { e && (jj = e); }, openUploader: jj }), Bn = Ze( (e) => e.ui, (e) => WO[e.activeTab], { memoizeOptions: { equalityCheck: Pe.isEqual } } ), k3 = Ze( (e) => e.ui, (e) => e.activeTab, { memoizeOptions: { equalityCheck: Pe.isEqual } } ), $o = Ze( (e) => e.ui, (e) => e, { memoizeOptions: { equalityCheck: Pe.isEqual } } ), Tj = (e) => async (t, r) => { const { imageFile: i } = e, s = r(), c = Bn(s), f = new FormData(); f.append("file", i, i.name), f.append( "data", JSON.stringify({ kind: "init" }) ); const y = await (await fetch(`${window.location.origin}/upload`, { method: "POST", body: f })).json(), g = { uuid: g2(), category: "user", ...y }; t(y2({ image: g, category: "user" })), c === "unifiedCanvas" ? t(vg(g)) : c === "img2img" && t(Xp(g)); }; var R3 = /* @__PURE__ */ new Map([ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types ["aac", "audio/aac"], ["abw", "application/x-abiword"], ["arc", "application/x-freearc"], ["avif", "image/avif"], ["avi", "video/x-msvideo"], ["azw", "application/vnd.amazon.ebook"], ["bin", "application/octet-stream"], ["bmp", "image/bmp"], ["bz", "application/x-bzip"], ["bz2", "application/x-bzip2"], ["cda", "application/x-cdf"], ["csh", "application/x-csh"], ["css", "text/css"], ["csv", "text/csv"], ["doc", "application/msword"], ["docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"], ["eot", "application/vnd.ms-fontobject"], ["epub", "application/epub+zip"], ["gz", "application/gzip"], ["gif", "image/gif"], ["heic", "image/heic"], ["heif", "image/heif"], ["htm", "text/html"], ["html", "text/html"], ["ico", "image/vnd.microsoft.icon"], ["ics", "text/calendar"], ["jar", "application/java-archive"], ["jpeg", "image/jpeg"], ["jpg", "image/jpeg"], ["js", "text/javascript"], ["json", "application/json"], ["jsonld", "application/ld+json"], ["mid", "audio/midi"], ["midi", "audio/midi"], ["mjs", "text/javascript"], ["mp3", "audio/mpeg"], ["mp4", "video/mp4"], ["mpeg", "video/mpeg"], ["mpkg", "application/vnd.apple.installer+xml"], ["odp", "application/vnd.oasis.opendocument.presentation"], ["ods", "application/vnd.oasis.opendocument.spreadsheet"], ["odt", "application/vnd.oasis.opendocument.text"], ["oga", "audio/ogg"], ["ogv", "video/ogg"], ["ogx", "application/ogg"], ["opus", "audio/opus"], ["otf", "font/otf"], ["png", "image/png"], ["pdf", "application/pdf"], ["php", "application/x-httpd-php"], ["ppt", "application/vnd.ms-powerpoint"], ["pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"], ["rar", "application/vnd.rar"], ["rtf", "application/rtf"], ["sh", "application/x-sh"], ["svg", "image/svg+xml"], ["swf", "application/x-shockwave-flash"], ["tar", "application/x-tar"], ["tif", "image/tiff"], ["tiff", "image/tiff"], ["ts", "video/mp2t"], ["ttf", "font/ttf"], ["txt", "text/plain"], ["vsd", "application/vnd.visio"], ["wav", "audio/wav"], ["weba", "audio/webm"], ["webm", "video/webm"], ["webp", "image/webp"], ["woff", "font/woff"], ["woff2", "font/woff2"], ["xhtml", "application/xhtml+xml"], ["xls", "application/vnd.ms-excel"], ["xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"], ["xml", "application/xml"], ["xul", "application/vnd.mozilla.xul+xml"], ["zip", "application/zip"], ["7z", "application/x-7z-compressed"], // Others ["mkv", "video/x-matroska"], ["mov", "video/quicktime"], ["msg", "application/vnd.ms-outlook"] ]); function oh(e, t) { var r = P3(e); if (typeof r.path != "string") { var i = e.webkitRelativePath; Object.defineProperty(r, "path", { value: typeof t == "string" ? t : typeof i == "string" && i.length > 0 ? i : e.name, writable: !1, configurable: !1, enumerable: !0 }); } return r; } function P3(e) { var t = e.name, r = t && t.lastIndexOf(".") !== -1; if (r && !e.type) { var i = t.split(".").pop().toLowerCase(), s = R3.get(i); s && Object.defineProperty(e, "type", { value: s, writable: !1, configurable: !1, enumerable: !0 }); } return e; } var N3 = [ // Thumbnail cache files for macOS and Windows ".DS_Store", "Thumbs.db" // Windows ]; function O3(e) { return Vd(this, void 0, void 0, function() { return Wd(this, function(t) { return rg(e) && A3(e.dataTransfer) ? [2, L3(e.dataTransfer, e.type)] : z3(e) ? [2, I3(e)] : Array.isArray(e) && e.every(function(r) { return "getFile" in r && typeof r.getFile == "function"; }) ? [2, F3(e)] : [2, []]; }); }); } function A3(e) { return rg(e); } function z3(e) { return rg(e) && rg(e.target); } function rg(e) { return typeof e == "object" && e !== null; } function I3(e) { return LS(e.target.files).map(function(t) { return oh(t); }); } function F3(e) { return Vd(this, void 0, void 0, function() { var t; return Wd(this, function(r) { switch (r.label) { case 0: return [4, Promise.all(e.map(function(i) { return i.getFile(); }))]; case 1: return t = r.sent(), [2, t.map(function(i) { return oh(i); })]; } }); }); } function L3(e, t) { return Vd(this, void 0, void 0, function() { var r, i; return Wd(this, function(s) { switch (s.label) { case 0: return e.items ? (r = LS(e.items).filter(function(c) { return c.kind === "file"; }), t !== "drop" ? [2, r] : [4, Promise.all(r.map(B3))]) : [3, 2]; case 1: return i = s.sent(), [2, Dj(rM(i))]; case 2: return [2, Dj(LS(e.files).map(function(c) { return oh(c); }))]; } }); }); } function Dj(e) { return e.filter(function(t) { return N3.indexOf(t.name) === -1; }); } function LS(e) { if (e === null) return []; for (var t = [], r = 0; r < e.length; r++) { var i = e[r]; t.push(i); } return t; } function B3(e) { if (typeof e.webkitGetAsEntry != "function") return _j(e); var t = e.webkitGetAsEntry(); return t && t.isDirectory ? aM(t) : _j(e); } function rM(e) { return e.reduce(function(t, r) { return PS(PS([], sj(t), !1), sj(Array.isArray(r) ? rM(r) : [r]), !1); }, []); } function _j(e) { var t = e.getAsFile(); if (!t) return Promise.reject("".concat(e, " is not a File")); var r = oh(t); return Promise.resolve(r); } function U3(e) { return Vd(this, void 0, void 0, function() { return Wd(this, function(t) { return [2, e.isDirectory ? aM(e) : H3(e)]; }); }); } function aM(e) { var t = e.createReader(); return new Promise(function(r, i) { var s = []; function c() { var f = this; t.readEntries(function(m) { return Vd(f, void 0, void 0, function() { var y, g, S; return Wd(this, function(E) { switch (E.label) { case 0: if (m.length) return [3, 5]; E.label = 1; case 1: return E.trys.push([1, 3, , 4]), [4, Promise.all(s)]; case 2: return y = E.sent(), r(y), [3, 4]; case 3: return g = E.sent(), i(g), [3, 4]; case 4: return [3, 6]; case 5: S = Promise.all(m.map(U3)), s.push(S), c(), E.label = 6; case 6: return [ 2 /*return*/ ]; } }); }); }, function(m) { i(m); }); } c(); }); } function H3(e) { return Vd(this, void 0, void 0, function() { return Wd(this, function(t) { return [2, new Promise(function(r, i) { e.file(function(s) { var c = oh(s, e.fullPath); r(c); }, function(s) { i(s); }); })]; }); }); } var V3 = function(e, t) { if (e && t) { var r = Array.isArray(t) ? t : t.split(","), i = e.name || "", s = (e.type || "").toLowerCase(), c = s.replace(/\/.*$/, ""); return r.some(function(f) { var m = f.trim().toLowerCase(); return m.charAt(0) === "." ? i.toLowerCase().endsWith(m) : m.endsWith("/*") ? c === m.replace(/\/.*$/, "") : s === m; }); } return !0; }; function Mj(e) { return q3(e) || G3(e) || oM(e) || W3(); } function W3() { throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function G3(e) { if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e); } function q3(e) { if (Array.isArray(e)) return BS(e); } function kj(e, t) { var r = Object.keys(e); if (Object.getOwnPropertySymbols) { var i = Object.getOwnPropertySymbols(e); t && (i = i.filter(function(s) { return Object.getOwnPropertyDescriptor(e, s).enumerable; })), r.push.apply(r, i); } return r; } function Rj(e) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t] != null ? arguments[t] : {}; t % 2 ? kj(Object(r), !0).forEach(function(i) { iM(e, i, r[i]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : kj(Object(r)).forEach(function(i) { Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(r, i)); }); } return e; } function iM(e, t, r) { return t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e; } function Vp(e, t) { return X3(e) || K3(e, t) || oM(e, t) || Y3(); } function Y3() { throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function oM(e, t) { if (e) { if (typeof e == "string") return BS(e, t); var r = Object.prototype.toString.call(e).slice(8, -1); if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e); if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return BS(e, t); } } function BS(e, t) { (t == null || t > e.length) && (t = e.length); for (var r = 0, i = new Array(t); r < t; r++) i[r] = e[r]; return i; } function K3(e, t) { var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]; if (r != null) { var i = [], s = !0, c = !1, f, m; try { for (r = r.call(e); !(s = (f = r.next()).done) && (i.push(f.value), !(t && i.length === t)); s = !0) ; } catch (y) { c = !0, m = y; } finally { try { !s && r.return != null && r.return(); } finally { if (c) throw m; } } return i; } } function X3(e) { if (Array.isArray(e)) return e; } var $3 = "file-invalid-type", Q3 = "file-too-large", Z3 = "file-too-small", J3 = "too-many-files", eB = function(t) { t = Array.isArray(t) && t.length === 1 ? t[0] : t; var r = Array.isArray(t) ? "one of ".concat(t.join(", ")) : t; return { code: $3, message: "File type must be ".concat(r) }; }, Pj = function(t) { return { code: Q3, message: "File is larger than ".concat(t, " ").concat(t === 1 ? "byte" : "bytes") }; }, Nj = function(t) { return { code: Z3, message: "File is smaller than ".concat(t, " ").concat(t === 1 ? "byte" : "bytes") }; }, tB = { code: J3, message: "Too many files" }; function sM(e, t) { var r = e.type === "application/x-moz-file" || V3(e, t); return [r, r ? null : eB(t)]; } function lM(e, t, r) { if (Pu(e.size)) if (Pu(t) && Pu(r)) { if (e.size > r) return [!1, Pj(r)]; if (e.size < t) return [!1, Nj(t)]; } else { if (Pu(t) && e.size < t) return [!1, Nj(t)]; if (Pu(r) && e.size > r) return [!1, Pj(r)]; } return [!0, null]; } function Pu(e) { return e != null; } function nB(e) { var t = e.files, r = e.accept, i = e.minSize, s = e.maxSize, c = e.multiple, f = e.maxFiles, m = e.validator; return !c && t.length > 1 || c && f >= 1 && t.length > f ? !1 : t.every(function(y) { var g = sM(y, r), S = Vp(g, 1), E = S[0], w = lM(y, i, s), D = Vp(w, 1), M = D[0], k = m ? m(y) : null; return E && M && !k; }); } function ag(e) { return typeof e.isPropagationStopped == "function" ? e.isPropagationStopped() : typeof e.cancelBubble < "u" ? e.cancelBubble : !1; } function jm(e) { return e.dataTransfer ? Array.prototype.some.call(e.dataTransfer.types, function(t) { return t === "Files" || t === "application/x-moz-file"; }) : !!e.target && !!e.target.files; } function Oj(e) { e.preventDefault(); } function rB(e) { return e.indexOf("MSIE") !== -1 || e.indexOf("Trident/") !== -1; } function aB(e) { return e.indexOf("Edge/") !== -1; } function iB() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.navigator.userAgent; return rB(e) || aB(e); } function Lo() { for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++) t[r] = arguments[r]; return function(i) { for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), f = 1; f < s; f++) c[f - 1] = arguments[f]; return t.some(function(m) { return !ag(i) && m && m.apply(void 0, [i].concat(c)), ag(i); }); }; } function oB() { return "showOpenFilePicker" in window; } function sB(e) { if (Pu(e)) { var t = Object.entries(e).filter(function(r) { var i = Vp(r, 2), s = i[0], c = i[1], f = !0; return uM(s) || (console.warn('Skipped "'.concat(s, '" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')), f = !1), (!Array.isArray(c) || !c.every(cM)) && (console.warn('Skipped "'.concat(s, '" because an invalid file extension was provided.')), f = !1), f; }).reduce(function(r, i) { var s = Vp(i, 2), c = s[0], f = s[1]; return Rj(Rj({}, r), {}, iM({}, c, f)); }, {}); return [{ // description is required due to https://crbug.com/1264708 description: "Files", accept: t }]; } return e; } function lB(e) { if (Pu(e)) return Object.entries(e).reduce(function(t, r) { var i = Vp(r, 2), s = i[0], c = i[1]; return [].concat(Mj(t), [s], Mj(c)); }, []).filter(function(t) { return uM(t) || cM(t); }).join(","); } function uB(e) { return e instanceof DOMException && (e.name === "AbortError" || e.code === e.ABORT_ERR); } function cB(e) { return e instanceof DOMException && (e.name === "SecurityError" || e.code === e.SECURITY_ERR); } function uM(e) { return e === "audio/*" || e === "video/*" || e === "image/*" || e === "text/*" || /\w+\/[-+.\w]+/g.test(e); } function cM(e) { return /^.*\.[\w]+$/.test(e); } var dB = ["children"], fB = ["open"], pB = ["refKey", "role", "onKeyDown", "onFocus", "onBlur", "onClick", "onDragEnter", "onDragOver", "onDragLeave", "onDrop"], hB = ["refKey", "onChange", "onClick"]; function vB(e) { return yB(e) || gB(e) || dM(e) || mB(); } function mB() { throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function gB(e) { if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e); } function yB(e) { if (Array.isArray(e)) return US(e); } function qx(e, t) { return bB(e) || SB(e, t) || dM(e, t) || xB(); } function xB() { throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function dM(e, t) { if (e) { if (typeof e == "string") return US(e, t); var r = Object.prototype.toString.call(e).slice(8, -1); if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e); if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return US(e, t); } } function US(e, t) { (t == null || t > e.length) && (t = e.length); for (var r = 0, i = new Array(t); r < t; r++) i[r] = e[r]; return i; } function SB(e, t) { var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]; if (r != null) { var i = [], s = !0, c = !1, f, m; try { for (r = r.call(e); !(s = (f = r.next()).done) && (i.push(f.value), !(t && i.length === t)); s = !0) ; } catch (y) { c = !0, m = y; } finally { try { !s && r.return != null && r.return(); } finally { if (c) throw m; } } return i; } } function bB(e) { if (Array.isArray(e)) return e; } function Aj(e, t) { var r = Object.keys(e); if (Object.getOwnPropertySymbols) { var i = Object.getOwnPropertySymbols(e); t && (i = i.filter(function(s) { return Object.getOwnPropertyDescriptor(e, s).enumerable; })), r.push.apply(r, i); } return r; } function Jn(e) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t] != null ? arguments[t] : {}; t % 2 ? Aj(Object(r), !0).forEach(function(i) { HS(e, i, r[i]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Aj(Object(r)).forEach(function(i) { Object.defineProperty(e, i, Object.getOwnPropertyDescriptor(r, i)); }); } return e; } function HS(e, t, r) { return t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e; } function ig(e, t) { if (e == null) return {}; var r = CB(e, t), i, s; if (Object.getOwnPropertySymbols) { var c = Object.getOwnPropertySymbols(e); for (s = 0; s < c.length; s++) i = c[s], !(t.indexOf(i) >= 0) && Object.prototype.propertyIsEnumerable.call(e, i) && (r[i] = e[i]); } return r; } function CB(e, t) { if (e == null) return {}; var r = {}, i = Object.keys(e), s, c; for (c = 0; c < i.length; c++) s = i[c], !(t.indexOf(s) >= 0) && (r[s] = e[s]); return r; } var Xb = /* @__PURE__ */ Fl(function(e, t) { var r = e.children, i = ig(e, dB), s = pM(i), c = s.open, f = ig(s, fB); return hb(t, function() { return { open: c }; }, [c]), /* @__PURE__ */ jt.createElement(aI, null, r(Jn(Jn({}, f), {}, { open: c }))); }); Xb.displayName = "Dropzone"; var fM = { disabled: !1, getFilesFromEvent: O3, maxSize: 1 / 0, minSize: 0, multiple: !0, maxFiles: 0, preventDropOnDocument: !0, noClick: !1, noKeyboard: !1, noDrag: !1, noDragEventsBubbling: !1, validator: null, useFsAccessApi: !0, autoFocus: !1 }; Xb.defaultProps = fM; Xb.propTypes = { /** * Render function that exposes the dropzone state and prop getter fns * * @param {object} params * @param {Function} params.getRootProps Returns the props you should apply to the root drop container you render * @param {Function} params.getInputProps Returns the props you should apply to hidden file input you render * @param {Function} params.open Open the native file selection dialog * @param {boolean} params.isFocused Dropzone area is in focus * @param {boolean} params.isFileDialogActive File dialog is opened * @param {boolean} params.isDragActive Active drag is in progress * @param {boolean} params.isDragAccept Dragged files are accepted * @param {boolean} params.isDragReject Some dragged files are rejected * @param {File[]} params.acceptedFiles Accepted files * @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected */ children: St.func, /** * Set accepted file types. * Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information. * Keep in mind that mime type determination is not reliable across platforms. CSV files, * for example, are reported as text/plain under macOS but as application/vnd.ms-excel under * Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276). */ accept: St.objectOf(St.arrayOf(St.string)), /** * Allow drag 'n' drop (or selection from the file dialog) of multiple files */ multiple: St.bool, /** * If false, allow dropped items to take over the current browser window */ preventDropOnDocument: St.bool, /** * If true, disables click to open the native file selection dialog */ noClick: St.bool, /** * If true, disables SPACE/ENTER to open the native file selection dialog. * Note that it also stops tracking the focus state. */ noKeyboard: St.bool, /** * If true, disables drag 'n' drop */ noDrag: St.bool, /** * If true, stops drag event propagation to parents */ noDragEventsBubbling: St.bool, /** * Minimum file size (in bytes) */ minSize: St.number, /** * Maximum file size (in bytes) */ maxSize: St.number, /** * Maximum accepted number of files * The default value is 0 which means there is no limitation to how many files are accepted. */ maxFiles: St.number, /** * Enable/disable the dropzone */ disabled: St.bool, /** * Use this to provide a custom file aggregator * * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog) */ getFilesFromEvent: St.func, /** * Cb for when closing the file dialog with no selection */ onFileDialogCancel: St.func, /** * Cb for when opening the file dialog */ onFileDialogOpen: St.func, /** * Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API * to open the file picker instead of using an `` click event. */ useFsAccessApi: St.bool, /** * Set to true to focus the root element on render */ autoFocus: St.bool, /** * Cb for when the `dragenter` event occurs. * * @param {DragEvent} event */ onDragEnter: St.func, /** * Cb for when the `dragleave` event occurs * * @param {DragEvent} event */ onDragLeave: St.func, /** * Cb for when the `dragover` event occurs * * @param {DragEvent} event */ onDragOver: St.func, /** * Cb for when the `drop` event occurs. * Note that this callback is invoked after the `getFilesFromEvent` callback is done. * * Files are accepted or rejected based on the `accept`, `multiple`, `minSize` and `maxSize` props. * `accept` must be a valid [MIME type](http://www.iana.org/assignments/media-types/media-types.xhtml) according to [input element specification](https://www.w3.org/wiki/HTML/Elements/input/file) or a valid file extension. * If `multiple` is set to false and additional files are dropped, * all files besides the first will be rejected. * Any file which does not have a size in the [`minSize`, `maxSize`] range, will be rejected as well. * * Note that the `onDrop` callback will always be invoked regardless if the dropped files were accepted or rejected. * If you'd like to react to a specific scenario, use the `onDropAccepted`/`onDropRejected` props. * * `onDrop` will provide you with an array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects which you can then process and send to a server. * For example, with [SuperAgent](https://github.com/visionmedia/superagent) as a http/ajax library: * * ```js * function onDrop(acceptedFiles) { * const req = request.post('/upload') * acceptedFiles.forEach(file => { * req.attach(file.name, file) * }) * req.end(callback) * } * ``` * * @param {File[]} acceptedFiles * @param {FileRejection[]} fileRejections * @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog) */ onDrop: St.func, /** * Cb for when the `drop` event occurs. * Note that if no files are accepted, this callback is not invoked. * * @param {File[]} files * @param {(DragEvent|Event)} event */ onDropAccepted: St.func, /** * Cb for when the `drop` event occurs. * Note that if no files are rejected, this callback is not invoked. * * @param {FileRejection[]} fileRejections * @param {(DragEvent|Event)} event */ onDropRejected: St.func, /** * Cb for when there's some error from any of the promises. * * @param {Error} error */ onError: St.func, /** * Custom validation function. It must return null if there's no errors. * @param {File} file * @returns {FileError|FileError[]|null} */ validator: St.func }; var VS = { isFocused: !1, isFileDialogActive: !1, isDragActive: !1, isDragAccept: !1, isDragReject: !1, acceptedFiles: [], fileRejections: [] }; function pM() { var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = Jn(Jn({}, fM), e), r = t.accept, i = t.disabled, s = t.getFilesFromEvent, c = t.maxSize, f = t.minSize, m = t.multiple, y = t.maxFiles, g = t.onDragEnter, S = t.onDragLeave, E = t.onDragOver, w = t.onDrop, D = t.onDropAccepted, M = t.onDropRejected, k = t.onFileDialogCancel, R = t.onFileDialogOpen, O = t.useFsAccessApi, I = t.autoFocus, A = t.preventDropOnDocument, L = t.noClick, H = t.noKeyboard, q = t.noDrag, U = t.noDragEventsBubbling, $ = t.onError, ae = t.validator, oe = Xt(function() { return lB(r); }, [r]), Y = Xt(function() { return sB(r); }, [r]), ve = Xt(function() { return typeof R == "function" ? R : zj; }, [R]), de = Xt(function() { return typeof k == "function" ? k : zj; }, [k]), fe = Xe(null), _e = Xe(null), Me = yD(EB, VS), te = qx(Me, 2), K = te[0], se = te[1], B = K.isFocused, re = K.isFileDialogActive, ke = Xe(typeof window < "u" && window.isSecureContext && O && oB()), De = function() { !ke.current && re && setTimeout(function() { if (_e.current) { var Ae = _e.current.files; Ae.length || (se({ type: "closeDialog" }), de()); } }, 300); }; ot(function() { return window.addEventListener("focus", De, !1), function() { window.removeEventListener("focus", De, !1); }; }, [_e, re, de, ke]); var Se = Xe([]), be = function(Ae) { fe.current && fe.current.contains(Ae.target) || (Ae.preventDefault(), Se.current = []); }; ot(function() { return A && (document.addEventListener("dragover", Oj, !1), document.addEventListener("drop", be, !1)), function() { A && (document.removeEventListener("dragover", Oj), document.removeEventListener("drop", be)); }; }, [fe, A]), ot(function() { return !i && I && fe.current && fe.current.focus(), function() { }; }, [fe, I, i]); var Ie = ee(function(he) { $ ? $(he) : console.error(he); }, [$]), Ue = ee(function(he) { he.preventDefault(), he.persist(), Q(he), Se.current = [].concat(vB(Se.current), [he.target]), jm(he) && Promise.resolve(s(he)).then(function(Ae) { if (!(ag(he) && !U)) { var Dt = Ae.length, Ht = Dt > 0 && nB({ files: Ae, accept: oe, minSize: f, maxSize: c, multiple: m, maxFiles: y, validator: ae }), Te = Dt > 0 && !Ht; se({ isDragAccept: Ht, isDragReject: Te, isDragActive: !0, type: "setDraggedFiles" }), g && g(he); } }).catch(function(Ae) { return Ie(Ae); }); }, [s, g, Ie, U, oe, f, c, m, y, ae]), tt = ee(function(he) { he.preventDefault(), he.persist(), Q(he); var Ae = jm(he); if (Ae && he.dataTransfer) try { he.dataTransfer.dropEffect = "copy"; } catch { } return Ae && E && E(he), !1; }, [E, U]), ht = ee(function(he) { he.preventDefault(), he.persist(), Q(he); var Ae = Se.current.filter(function(Ht) { return fe.current && fe.current.contains(Ht); }), Dt = Ae.indexOf(he.target); Dt !== -1 && Ae.splice(Dt, 1), Se.current = Ae, !(Ae.length > 0) && (se({ type: "setDraggedFiles", isDragActive: !1, isDragAccept: !1, isDragReject: !1 }), jm(he) && S && S(he)); }, [fe, S, U]), dt = ee(function(he, Ae) { var Dt = [], Ht = []; he.forEach(function(Te) { var _t = sM(Te, oe), Zt = qx(_t, 2), Re = Zt[0], pe = Zt[1], Ne = lM(Te, f, c), ft = qx(Ne, 2), Vt = ft[0], vn = ft[1], st = ae ? ae(Te) : null; if (Re && Vt && !st) Dt.push(Te); else { var rt = [pe, vn]; st && (rt = rt.concat(st)), Ht.push({ file: Te, errors: rt.filter(function(kn) { return kn; }) }); } }), (!m && Dt.length > 1 || m && y >= 1 && Dt.length > y) && (Dt.forEach(function(Te) { Ht.push({ file: Te, errors: [tB] }); }), Dt.splice(0)), se({ acceptedFiles: Dt, fileRejections: Ht, type: "setFiles" }), w && w(Dt, Ht, Ae), Ht.length > 0 && M && M(Ht, Ae), Dt.length > 0 && D && D(Dt, Ae); }, [se, m, oe, f, c, y, w, D, M, ae]), Le = ee(function(he) { he.preventDefault(), he.persist(), Q(he), Se.current = [], jm(he) && Promise.resolve(s(he)).then(function(Ae) { ag(he) && !U || dt(Ae, he); }).catch(function(Ae) { return Ie(Ae); }), se({ type: "reset" }); }, [s, dt, Ie, U]), yt = ee(function() { if (ke.current) { se({ type: "openDialog" }), ve(); var he = { multiple: m, types: Y }; window.showOpenFilePicker(he).then(function(Ae) { return s(Ae); }).then(function(Ae) { dt(Ae, null), se({ type: "closeDialog" }); }).catch(function(Ae) { uB(Ae) ? (de(Ae), se({ type: "closeDialog" })) : cB(Ae) ? (ke.current = !1, _e.current ? (_e.current.value = null, _e.current.click()) : Ie(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))) : Ie(Ae); }); return; } _e.current && (se({ type: "openDialog" }), ve(), _e.current.value = null, _e.current.click()); }, [se, ve, de, O, dt, Ie, Y, m]), Ot = ee(function(he) { !fe.current || !fe.current.isEqualNode(he.target) || (he.key === " " || he.key === "Enter" || he.keyCode === 32 || he.keyCode === 13) && (he.preventDefault(), yt()); }, [fe, yt]), Qe = ee(function() { se({ type: "focus" }); }, []), rn = ee(function() { se({ type: "blur" }); }, []), Tn = ee(function() { L || (iB() ? setTimeout(yt, 0) : yt()); }, [L, yt]), pn = function(Ae) { return i ? null : Ae; }, Wn = function(Ae) { return H ? null : pn(Ae); }, tr = function(Ae) { return q ? null : pn(Ae); }, Q = function(Ae) { U && Ae.stopPropagation(); }, He = Xt(function() { return function() { var he = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, Ae = he.refKey, Dt = Ae === void 0 ? "ref" : Ae, Ht = he.role, Te = he.onKeyDown, _t = he.onFocus, Zt = he.onBlur, Re = he.onClick, pe = he.onDragEnter, Ne = he.onDragOver, ft = he.onDragLeave, Vt = he.onDrop, vn = ig(he, pB); return Jn(Jn(HS({ onKeyDown: Wn(Lo(Te, Ot)), onFocus: Wn(Lo(_t, Qe)), onBlur: Wn(Lo(Zt, rn)), onClick: pn(Lo(Re, Tn)), onDragEnter: tr(Lo(pe, Ue)), onDragOver: tr(Lo(Ne, tt)), onDragLeave: tr(Lo(ft, ht)), onDrop: tr(Lo(Vt, Le)), role: typeof Ht == "string" && Ht !== "" ? Ht : "presentation" }, Dt, fe), !i && !H ? { tabIndex: 0 } : {}), vn); }; }, [fe, Ot, Qe, rn, Tn, Ue, tt, ht, Le, H, q, i]), Fe = ee(function(he) { he.stopPropagation(); }, []), at = Xt(function() { return function() { var he = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, Ae = he.refKey, Dt = Ae === void 0 ? "ref" : Ae, Ht = he.onChange, Te = he.onClick, _t = ig(he, hB), Zt = HS({ accept: oe, multiple: m, type: "file", style: { display: "none" }, onChange: pn(Lo(Ht, Le)), onClick: pn(Lo(Te, Fe)), tabIndex: -1 }, Dt, _e); return Jn(Jn({}, Zt), _t); }; }, [_e, r, m, Le, i]); return Jn(Jn({}, K), {}, { isFocused: B && !i, getRootProps: He, getInputProps: at, rootRef: fe, inputRef: _e, open: pn(yt) }); } function EB(e, t) { switch (t.type) { case "focus": return Jn(Jn({}, e), {}, { isFocused: !0 }); case "blur": return Jn(Jn({}, e), {}, { isFocused: !1 }); case "openDialog": return Jn(Jn({}, VS), {}, { isFileDialogActive: !0 }); case "closeDialog": return Jn(Jn({}, e), {}, { isFileDialogActive: !1 }); case "setDraggedFiles": return Jn(Jn({}, e), {}, { isDragActive: t.isDragActive, isDragAccept: t.isDragAccept, isDragReject: t.isDragReject }); case "setFiles": return Jn(Jn({}, e), {}, { acceptedFiles: t.acceptedFiles, fileRejections: t.fileRejections }); case "reset": return Jn({}, VS); default: return e; } } function zj() { } function WS() { return WS = Object.assign ? Object.assign.bind() : function(e) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t]; for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]); } return e; }, WS.apply(this, arguments); } var hM = ["shift", "alt", "meta", "mod", "ctrl"], wB = { esc: "escape", return: "enter", ".": "period", ",": "comma", "-": "slash", " ": "space", "`": "backquote", "#": "backslash", "+": "bracketright", ShiftLeft: "shift", ShiftRight: "shift", AltLeft: "alt", AltRight: "alt", MetaLeft: "meta", MetaRight: "meta", ControlLeft: "ctrl", ControlRight: "ctrl" }; function kl(e) { return (wB[e] || e).trim().toLowerCase().replace("key", "").replace("digit", "").replace("numpad", "").replace("arrow", ""); } function jB(e) { return hM.includes(e); } function Yx(e, t) { return t === void 0 && (t = ","), typeof e == "string" ? e.split(t) : e; } function Kx(e, t) { t === void 0 && (t = "+"); var r = e.toLocaleLowerCase().split(t).map(function(c) { return kl(c); }), i = { alt: r.includes("alt"), ctrl: r.includes("ctrl") || r.includes("control"), shift: r.includes("shift"), meta: r.includes("meta"), mod: r.includes("mod") }, s = r.filter(function(c) { return !hM.includes(c); }); return WS({}, i, { keys: s }); } var Rl = /* @__PURE__ */ new Set(); function TB(e, t) { t === void 0 && (t = ","); var r = Array.isArray(e) ? e : e.split(t); return r.every(function(i) { return Rl.has(i.trim().toLowerCase()); }); } function vM(e) { var t = Array.isArray(e) ? e : [e]; Rl.has("meta") && Rl.forEach(function(r) { return !jB(r) && Rl.delete(r.toLowerCase()); }), t.forEach(function(r) { return Rl.add(r.toLowerCase()); }); } function mM(e) { var t = Array.isArray(e) ? e : [e]; e === "meta" ? Rl.clear() : t.forEach(function(r) { return Rl.delete(r.toLowerCase()); }); } (function() { typeof document < "u" && (document.addEventListener("keydown", function(e) { e.key !== void 0 && vM([kl(e.key), kl(e.code)]); }), document.addEventListener("keyup", function(e) { e.key !== void 0 && mM([kl(e.key), kl(e.code)]); })), typeof window < "u" && window.addEventListener("blur", function() { Rl.clear(); }); })(); function DB(e, t, r) { (typeof r == "function" && r(e, t) || r === !0) && e.preventDefault(); } function _B(e, t, r) { return typeof r == "function" ? r(e, t) : r === !0 || r === void 0; } function MB(e) { return gM(e, ["input", "textarea", "select"]); } function gM(e, t) { var r = e.target; t === void 0 && (t = !1); var i = r && r.tagName; return t instanceof Array ? Boolean(i && t && t.some(function(s) { return s.toLowerCase() === i.toLowerCase(); })) : Boolean(i && t && t === !0); } function kB(e, t) { return e.length === 0 && t ? (console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '), !0) : t ? e.some(function(r) { return t.includes(r); }) || e.includes("*") : !0; } var RB = function(t, r, i) { i === void 0 && (i = !1); var s = r.alt, c = r.meta, f = r.mod, m = r.shift, y = r.ctrl, g = r.keys, S = t.key, E = t.code, w = t.ctrlKey, D = t.metaKey, M = t.shiftKey, k = t.altKey, R = kl(E), O = S.toLowerCase(); if (!i) { if (s === !k && O !== "alt" || m === !M && O !== "shift") return !1; if (f) { if (!D && !w) return !1; } else if (c === !D && O !== "meta" || y === !w && O !== "ctrl") return !1; } return g && g.length === 1 && (g.includes(O) || g.includes(R)) ? !0 : g ? TB(g) : !g; }, PB = /* @__PURE__ */ xg(void 0), NB = function() { return Bl(PB); }; function yM(e, t) { return e && t && typeof e == "object" && typeof t == "object" ? Object.keys(e).length === Object.keys(t).length && Object.keys(e).reduce(function(r, i) { return r && yM(e[i], t[i]); }, !0) : e === t; } var OB = /* @__PURE__ */ xg({ hotkeys: [], enabledScopes: [], toggleScope: function() { }, enableScope: function() { }, disableScope: function() { } }), AB = function() { return Bl(OB); }; function zB(e) { var t = Xe(void 0); return yM(t.current, e) || (t.current = e), t.current; } var Ij = function(t) { t.stopPropagation(), t.preventDefault(), t.stopImmediatePropagation(); }, IB = typeof window < "u" ? co : ot; function We(e, t, r, i) { var s = Xe(null), c = Xe(!1), f = r instanceof Array ? i instanceof Array ? void 0 : i : r, m = r instanceof Array ? r : i instanceof Array ? i : void 0, y = ee(t, m ?? []), g = Xe(y); m ? g.current = y : g.current = t; var S = zB(f), E = AB(), w = E.enabledScopes, D = NB(); return IB(function() { if (!((S == null ? void 0 : S.enabled) === !1 || !kB(w, S == null ? void 0 : S.scopes))) { var M = function(I, A) { var L; if (A === void 0 && (A = !1), !(MB(I) && !gM(I, S == null ? void 0 : S.enableOnFormTags))) { if (s.current !== null && document.activeElement !== s.current && !s.current.contains(document.activeElement)) { Ij(I); return; } (L = I.target) != null && L.isContentEditable && !(S != null && S.enableOnContentEditable) || Yx(e, S == null ? void 0 : S.splitKey).forEach(function(H) { var q, U = Kx(H, S == null ? void 0 : S.combinationKey); if (RB(I, U, S == null ? void 0 : S.ignoreModifiers) || (q = U.keys) != null && q.includes("*")) { if (A && c.current) return; if (DB(I, U, S == null ? void 0 : S.preventDefault), !_B(I, U, S == null ? void 0 : S.enabled)) { Ij(I); return; } g.current(I, U), A || (c.current = !0); } }); } }, k = function(I) { I.key !== void 0 && (vM(kl(I.code)), ((S == null ? void 0 : S.keydown) === void 0 && (S == null ? void 0 : S.keyup) !== !0 || S != null && S.keydown) && M(I)); }, R = function(I) { I.key !== void 0 && (mM(kl(I.code)), c.current = !1, S != null && S.keyup && M(I, !0)); }; return (s.current || (f == null ? void 0 : f.document) || document).addEventListener("keyup", R), (s.current || (f == null ? void 0 : f.document) || document).addEventListener("keydown", k), D && Yx(e, S == null ? void 0 : S.splitKey).forEach(function(O) { return D.addHotkey(Kx(O, S == null ? void 0 : S.combinationKey)); }), function() { (s.current || (f == null ? void 0 : f.document) || document).removeEventListener("keyup", R), (s.current || (f == null ? void 0 : f.document) || document).removeEventListener("keydown", k), D && Yx(e, S == null ? void 0 : S.splitKey).forEach(function(O) { return D.removeHotkey(Kx(O, S == null ? void 0 : S.combinationKey)); }); }; } }, [e, S, w]), s; } const FB = (e) => { const { isDragAccept: t, isDragReject: r, overlaySecondaryText: i, setIsHandlingUpload: s } = e; return We("esc", () => { s(!1); }), /* @__PURE__ */ u.jsx( Ut, { sx: { position: "absolute", top: 0, insetInlineStart: 0, width: "100vw", height: "100vh", zIndex: 999, backdropFilter: "blur(20px)" }, children: /* @__PURE__ */ u.jsx( ne, { sx: { opacity: 0.4, width: "100%", height: "100%", flexDirection: "column", rowGap: 4, alignItems: "center", justifyContent: "center", bg: "base.900", boxShadow: `inset 0 0 20rem 1rem var(--invokeai-colors-${t ? "accent" : "error"}-500)` }, children: t ? /* @__PURE__ */ u.jsxs(Ni, { size: "lg", children: [ "Upload Image", i ] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx(Ni, { size: "lg", children: "Invalid Upload" }), /* @__PURE__ */ u.jsx(Ni, { size: "md", children: "Must be single JPEG or PNG image" }) ] }) } ) } ); }, LB = (e) => { const { children: t } = e, r = xe(), i = W(Bn), s = nh({}), { t: c } = Ce(), [f, m] = qe(!1), { setOpenUploader: y } = Kb(), g = ee( (A) => { m(!0); const L = A.errors.reduce( (H, q) => `${H} ${q.message}`, "" ); s({ title: c("toast.uploadFailed"), description: L, status: "error", isClosable: !0 }); }, [c, s] ), S = ee( async (A) => { r(Tj({ imageFile: A })); }, [r] ), E = ee( (A, L) => { L.forEach((H) => { g(H); }), A.forEach((H) => { S(H); }); }, [S, g] ), { getRootProps: w, getInputProps: D, isDragAccept: M, isDragReject: k, isDragActive: R, open: O } = pM({ accept: { "image/png": [".png"], "image/jpeg": [".jpg", ".jpeg", ".png"] }, noClick: !0, onDrop: E, onDragOver: () => m(!0), maxFiles: 1 }); y(O), ot(() => { const A = (L) => { var $; const H = ($ = L.clipboardData) == null ? void 0 : $.items; if (!H) return; const q = []; for (const ae of H) ae.kind === "file" && ["image/png", "image/jpg"].includes(ae.type) && q.push(ae); if (!q.length) return; if (L.stopImmediatePropagation(), q.length > 1) { s({ description: c("toast.uploadFailedMultipleImagesDesc"), status: "error", isClosable: !0 }); return; } const U = q[0].getAsFile(); if (!U) { s({ description: c("toast.uploadFailedUnableToLoadDesc"), status: "error", isClosable: !0 }); return; } r(Tj({ imageFile: U })); }; return document.addEventListener("paste", A), () => { document.removeEventListener("paste", A); }; }, [c, r, s, i]); const I = ["img2img", "unifiedCanvas"].includes( i ) ? ` to ${String(c(`common.${i}`))}` : ""; return /* @__PURE__ */ u.jsx(Yb.Provider, { value: O, children: /* @__PURE__ */ u.jsxs( Ut, { ...w({ style: {} }), onKeyDown: (A) => { A.key; }, children: [ /* @__PURE__ */ u.jsx("input", { ...D() }), t, R && f && /* @__PURE__ */ u.jsx( FB, { isDragAccept: M, isDragReject: k, overlaySecondaryText: I, setIsHandlingUpload: m } ) ] } ) }); }, BB = Yr(LB); var UB = globalThis && globalThis.__extends || function() { var e = function(t, r) { return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) { i.__proto__ = s; } || function(i, s) { for (var c in s) Object.prototype.hasOwnProperty.call(s, c) && (i[c] = s[c]); }, e(t, r); }; return function(t, r) { e(t, r); function i() { this.constructor = t; } t.prototype = r === null ? Object.create(r) : (i.prototype = r.prototype, new i()); }; }(), wr = globalThis && globalThis.__assign || function() { return wr = Object.assign || function(e) { for (var t, r = 1, i = arguments.length; r < i; r++) { t = arguments[r]; for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && (e[s] = t[s]); } return e; }, wr.apply(this, arguments); }, Fj = { width: "100%", height: "10px", top: "0px", left: "0px", cursor: "row-resize" }, Lj = { width: "10px", height: "100%", top: "0px", left: "0px", cursor: "col-resize" }, Tm = { width: "20px", height: "20px", position: "absolute" }, HB = { top: wr(wr({}, Fj), { top: "-5px" }), right: wr(wr({}, Lj), { left: void 0, right: "-5px" }), bottom: wr(wr({}, Fj), { top: void 0, bottom: "-5px" }), left: wr(wr({}, Lj), { left: "-5px" }), topRight: wr(wr({}, Tm), { right: "-10px", top: "-10px", cursor: "ne-resize" }), bottomRight: wr(wr({}, Tm), { right: "-10px", bottom: "-10px", cursor: "se-resize" }), bottomLeft: wr(wr({}, Tm), { left: "-10px", bottom: "-10px", cursor: "sw-resize" }), topLeft: wr(wr({}, Tm), { left: "-10px", top: "-10px", cursor: "nw-resize" }) }, VB = ( /** @class */ function(e) { UB(t, e); function t() { var r = e !== null && e.apply(this, arguments) || this; return r.onMouseDown = function(i) { r.props.onResizeStart(i, r.props.direction); }, r.onTouchStart = function(i) { r.props.onResizeStart(i, r.props.direction); }, r; } return t.prototype.render = function() { return Ge.createElement("div", { className: this.props.className || "", style: wr(wr({ position: "absolute", userSelect: "none" }, HB[this.props.direction]), this.props.replaceStyles || {}), onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart }, this.props.children); }, t; }(Ge.PureComponent) ), WB = globalThis && globalThis.__extends || function() { var e = function(t, r) { return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, s) { i.__proto__ = s; } || function(i, s) { for (var c in s) Object.prototype.hasOwnProperty.call(s, c) && (i[c] = s[c]); }, e(t, r); }; return function(t, r) { e(t, r); function i() { this.constructor = t; } t.prototype = r === null ? Object.create(r) : (i.prototype = r.prototype, new i()); }; }(), Uo = globalThis && globalThis.__assign || function() { return Uo = Object.assign || function(e) { for (var t, r = 1, i = arguments.length; r < i; r++) { t = arguments[r]; for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && (e[s] = t[s]); } return e; }, Uo.apply(this, arguments); }, GB = { width: "auto", height: "auto" }, Dm = function(e, t, r) { return Math.max(Math.min(e, r), t); }, Bj = function(e, t) { return Math.round(e / t) * t; }, Cd = function(e, t) { return new RegExp(e, "i").test(t); }, _m = function(e) { return Boolean(e.touches && e.touches.length); }, qB = function(e) { return Boolean((e.clientX || e.clientX === 0) && (e.clientY || e.clientY === 0)); }, Uj = function(e, t, r) { r === void 0 && (r = 0); var i = t.reduce(function(c, f, m) { return Math.abs(f - e) < Math.abs(t[c] - e) ? m : c; }, 0), s = Math.abs(t[i] - e); return r === 0 || s < r ? t[i] : e; }, Xx = function(e) { return e = e.toString(), e === "auto" || e.endsWith("px") || e.endsWith("%") || e.endsWith("vh") || e.endsWith("vw") || e.endsWith("vmax") || e.endsWith("vmin") ? e : e + "px"; }, Mm = function(e, t, r, i) { if (e && typeof e == "string") { if (e.endsWith("px")) return Number(e.replace("px", "")); if (e.endsWith("%")) { var s = Number(e.replace("%", "")) / 100; return t * s; } if (e.endsWith("vw")) { var s = Number(e.replace("vw", "")) / 100; return r * s; } if (e.endsWith("vh")) { var s = Number(e.replace("vh", "")) / 100; return i * s; } } return e; }, YB = function(e, t, r, i, s, c, f) { return i = Mm(i, e.width, t, r), s = Mm(s, e.height, t, r), c = Mm(c, e.width, t, r), f = Mm(f, e.height, t, r), { maxWidth: typeof i > "u" ? void 0 : Number(i), maxHeight: typeof s > "u" ? void 0 : Number(s), minWidth: typeof c > "u" ? void 0 : Number(c), minHeight: typeof f > "u" ? void 0 : Number(f) }; }, KB = [ "as", "style", "className", "grid", "snap", "bounds", "boundsByDirection", "size", "defaultSize", "minWidth", "minHeight", "maxWidth", "maxHeight", "lockAspectRatio", "lockAspectRatioExtraWidth", "lockAspectRatioExtraHeight", "enable", "handleStyles", "handleClasses", "handleWrapperStyle", "handleWrapperClass", "children", "onResizeStart", "onResize", "onResizeStop", "handleComponent", "scale", "resizeRatio", "snapGap" ], Hj = "__resizable_base__", xM = ( /** @class */ function(e) { WB(t, e); function t(r) { var i = e.call(this, r) || this; return i.ratio = 1, i.resizable = null, i.parentLeft = 0, i.parentTop = 0, i.resizableLeft = 0, i.resizableRight = 0, i.resizableTop = 0, i.resizableBottom = 0, i.targetLeft = 0, i.targetTop = 0, i.appendBase = function() { if (!i.resizable || !i.window) return null; var s = i.parentNode; if (!s) return null; var c = i.window.document.createElement("div"); return c.style.width = "100%", c.style.height = "100%", c.style.position = "absolute", c.style.transform = "scale(0, 0)", c.style.left = "0", c.style.flex = "0 0 100%", c.classList ? c.classList.add(Hj) : c.className += Hj, s.appendChild(c), c; }, i.removeBase = function(s) { var c = i.parentNode; c && c.removeChild(s); }, i.ref = function(s) { s && (i.resizable = s); }, i.state = { isResizing: !1, width: typeof (i.propsSize && i.propsSize.width) > "u" ? "auto" : i.propsSize && i.propsSize.width, height: typeof (i.propsSize && i.propsSize.height) > "u" ? "auto" : i.propsSize && i.propsSize.height, direction: "right", original: { x: 0, y: 0, width: 0, height: 0 }, backgroundStyle: { height: "100%", width: "100%", backgroundColor: "rgba(0,0,0,0)", cursor: "auto", opacity: 0, position: "fixed", zIndex: 9999, top: "0", left: "0", bottom: "0", right: "0" }, flexBasis: void 0 }, i.onResizeStart = i.onResizeStart.bind(i), i.onMouseMove = i.onMouseMove.bind(i), i.onMouseUp = i.onMouseUp.bind(i), i; } return Object.defineProperty(t.prototype, "parentNode", { get: function() { return this.resizable ? this.resizable.parentNode : null; }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "window", { get: function() { return !this.resizable || !this.resizable.ownerDocument ? null : this.resizable.ownerDocument.defaultView; }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "propsSize", { get: function() { return this.props.size || this.props.defaultSize || GB; }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "size", { get: function() { var r = 0, i = 0; if (this.resizable && this.window) { var s = this.resizable.offsetWidth, c = this.resizable.offsetHeight, f = this.resizable.style.position; f !== "relative" && (this.resizable.style.position = "relative"), r = this.resizable.style.width !== "auto" ? this.resizable.offsetWidth : s, i = this.resizable.style.height !== "auto" ? this.resizable.offsetHeight : c, this.resizable.style.position = f; } return { width: r, height: i }; }, enumerable: !1, configurable: !0 }), Object.defineProperty(t.prototype, "sizeStyle", { get: function() { var r = this, i = this.props.size, s = function(m) { if (typeof r.state[m] > "u" || r.state[m] === "auto") return "auto"; if (r.propsSize && r.propsSize[m] && r.propsSize[m].toString().endsWith("%")) { if (r.state[m].toString().endsWith("%")) return r.state[m].toString(); var y = r.getParentSize(), g = Number(r.state[m].toString().replace("px", "")), S = g / y[m] * 100; return S + "%"; } return Xx(r.state[m]); }, c = i && typeof i.width < "u" && !this.state.isResizing ? Xx(i.width) : s("width"), f = i && typeof i.height < "u" && !this.state.isResizing ? Xx(i.height) : s("height"); return { width: c, height: f }; }, enumerable: !1, configurable: !0 }), t.prototype.getParentSize = function() { if (!this.parentNode) return this.window ? { width: this.window.innerWidth, height: this.window.innerHeight } : { width: 0, height: 0 }; var r = this.appendBase(); if (!r) return { width: 0, height: 0 }; var i = !1, s = this.parentNode.style.flexWrap; s !== "wrap" && (i = !0, this.parentNode.style.flexWrap = "wrap"), r.style.position = "relative", r.style.minWidth = "100%", r.style.minHeight = "100%"; var c = { width: r.offsetWidth, height: r.offsetHeight }; return i && (this.parentNode.style.flexWrap = s), this.removeBase(r), c; }, t.prototype.bindEvents = function() { this.window && (this.window.addEventListener("mouseup", this.onMouseUp), this.window.addEventListener("mousemove", this.onMouseMove), this.window.addEventListener("mouseleave", this.onMouseUp), this.window.addEventListener("touchmove", this.onMouseMove, { capture: !0, passive: !1 }), this.window.addEventListener("touchend", this.onMouseUp)); }, t.prototype.unbindEvents = function() { this.window && (this.window.removeEventListener("mouseup", this.onMouseUp), this.window.removeEventListener("mousemove", this.onMouseMove), this.window.removeEventListener("mouseleave", this.onMouseUp), this.window.removeEventListener("touchmove", this.onMouseMove, !0), this.window.removeEventListener("touchend", this.onMouseUp)); }, t.prototype.componentDidMount = function() { if (!(!this.resizable || !this.window)) { var r = this.window.getComputedStyle(this.resizable); this.setState({ width: this.state.width || this.size.width, height: this.state.height || this.size.height, flexBasis: r.flexBasis !== "auto" ? r.flexBasis : void 0 }); } }, t.prototype.componentWillUnmount = function() { this.window && this.unbindEvents(); }, t.prototype.createSizeForCssProperty = function(r, i) { var s = this.propsSize && this.propsSize[i]; return this.state[i] === "auto" && this.state.original[i] === r && (typeof s > "u" || s === "auto") ? "auto" : r; }, t.prototype.calculateNewMaxFromBoundary = function(r, i) { var s = this.props.boundsByDirection, c = this.state.direction, f = s && Cd("left", c), m = s && Cd("top", c), y, g; if (this.props.bounds === "parent") { var S = this.parentNode; S && (y = f ? this.resizableRight - this.parentLeft : S.offsetWidth + (this.parentLeft - this.resizableLeft), g = m ? this.resizableBottom - this.parentTop : S.offsetHeight + (this.parentTop - this.resizableTop)); } else this.props.bounds === "window" ? this.window && (y = f ? this.resizableRight : this.window.innerWidth - this.resizableLeft, g = m ? this.resizableBottom : this.window.innerHeight - this.resizableTop) : this.props.bounds && (y = f ? this.resizableRight - this.targetLeft : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft), g = m ? this.resizableBottom - this.targetTop : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop)); return y && Number.isFinite(y) && (r = r && r < y ? r : y), g && Number.isFinite(g) && (i = i && i < g ? i : g), { maxWidth: r, maxHeight: i }; }, t.prototype.calculateNewSizeFromDirection = function(r, i) { var s = this.props.scale || 1, c = this.props.resizeRatio || 1, f = this.state, m = f.direction, y = f.original, g = this.props, S = g.lockAspectRatio, E = g.lockAspectRatioExtraHeight, w = g.lockAspectRatioExtraWidth, D = y.width, M = y.height, k = E || 0, R = w || 0; return Cd("right", m) && (D = y.width + (r - y.x) * c / s, S && (M = (D - R) / this.ratio + k)), Cd("left", m) && (D = y.width - (r - y.x) * c / s, S && (M = (D - R) / this.ratio + k)), Cd("bottom", m) && (M = y.height + (i - y.y) * c / s, S && (D = (M - k) * this.ratio + R)), Cd("top", m) && (M = y.height - (i - y.y) * c / s, S && (D = (M - k) * this.ratio + R)), { newWidth: D, newHeight: M }; }, t.prototype.calculateNewSizeFromAspectRatio = function(r, i, s, c) { var f = this.props, m = f.lockAspectRatio, y = f.lockAspectRatioExtraHeight, g = f.lockAspectRatioExtraWidth, S = typeof c.width > "u" ? 10 : c.width, E = typeof s.width > "u" || s.width < 0 ? r : s.width, w = typeof c.height > "u" ? 10 : c.height, D = typeof s.height > "u" || s.height < 0 ? i : s.height, M = y || 0, k = g || 0; if (m) { var R = (w - M) * this.ratio + k, O = (D - M) * this.ratio + k, I = (S - k) / this.ratio + M, A = (E - k) / this.ratio + M, L = Math.max(S, R), H = Math.min(E, O), q = Math.max(w, I), U = Math.min(D, A); r = Dm(r, L, H), i = Dm(i, q, U); } else r = Dm(r, S, E), i = Dm(i, w, D); return { newWidth: r, newHeight: i }; }, t.prototype.setBoundingClientRect = function() { if (this.props.bounds === "parent") { var r = this.parentNode; if (r) { var i = r.getBoundingClientRect(); this.parentLeft = i.left, this.parentTop = i.top; } } if (this.props.bounds && typeof this.props.bounds != "string") { var s = this.props.bounds.getBoundingClientRect(); this.targetLeft = s.left, this.targetTop = s.top; } if (this.resizable) { var c = this.resizable.getBoundingClientRect(), f = c.left, m = c.top, y = c.right, g = c.bottom; this.resizableLeft = f, this.resizableRight = y, this.resizableTop = m, this.resizableBottom = g; } }, t.prototype.onResizeStart = function(r, i) { if (!(!this.resizable || !this.window)) { var s = 0, c = 0; if (r.nativeEvent && qB(r.nativeEvent) ? (s = r.nativeEvent.clientX, c = r.nativeEvent.clientY) : r.nativeEvent && _m(r.nativeEvent) && (s = r.nativeEvent.touches[0].clientX, c = r.nativeEvent.touches[0].clientY), this.props.onResizeStart && this.resizable) { var f = this.props.onResizeStart(r, i, this.resizable); if (f === !1) return; } this.props.size && (typeof this.props.size.height < "u" && this.props.size.height !== this.state.height && this.setState({ height: this.props.size.height }), typeof this.props.size.width < "u" && this.props.size.width !== this.state.width && this.setState({ width: this.props.size.width })), this.ratio = typeof this.props.lockAspectRatio == "number" ? this.props.lockAspectRatio : this.size.width / this.size.height; var m, y = this.window.getComputedStyle(this.resizable); if (y.flexBasis !== "auto") { var g = this.parentNode; if (g) { var S = this.window.getComputedStyle(g).flexDirection; this.flexDir = S.startsWith("row") ? "row" : "column", m = y.flexBasis; } } this.setBoundingClientRect(), this.bindEvents(); var E = { original: { x: s, y: c, width: this.size.width, height: this.size.height }, isResizing: !0, backgroundStyle: Uo(Uo({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(r.target).cursor || "auto" }), direction: i, flexBasis: m }; this.setState(E); } }, t.prototype.onMouseMove = function(r) { var i = this; if (!(!this.state.isResizing || !this.resizable || !this.window)) { if (this.window.TouchEvent && _m(r)) try { r.preventDefault(), r.stopPropagation(); } catch { } var s = this.props, c = s.maxWidth, f = s.maxHeight, m = s.minWidth, y = s.minHeight, g = _m(r) ? r.touches[0].clientX : r.clientX, S = _m(r) ? r.touches[0].clientY : r.clientY, E = this.state, w = E.direction, D = E.original, M = E.width, k = E.height, R = this.getParentSize(), O = YB(R, this.window.innerWidth, this.window.innerHeight, c, f, m, y); c = O.maxWidth, f = O.maxHeight, m = O.minWidth, y = O.minHeight; var I = this.calculateNewSizeFromDirection(g, S), A = I.newHeight, L = I.newWidth, H = this.calculateNewMaxFromBoundary(c, f); this.props.snap && this.props.snap.x && (L = Uj(L, this.props.snap.x, this.props.snapGap)), this.props.snap && this.props.snap.y && (A = Uj(A, this.props.snap.y, this.props.snapGap)); var q = this.calculateNewSizeFromAspectRatio(L, A, { width: H.maxWidth, height: H.maxHeight }, { width: m, height: y }); if (L = q.newWidth, A = q.newHeight, this.props.grid) { var U = Bj(L, this.props.grid[0]), $ = Bj(A, this.props.grid[1]), ae = this.props.snapGap || 0; L = ae === 0 || Math.abs(U - L) <= ae ? U : L, A = ae === 0 || Math.abs($ - A) <= ae ? $ : A; } var oe = { width: L - D.width, height: A - D.height }; if (M && typeof M == "string") { if (M.endsWith("%")) { var Y = L / R.width * 100; L = Y + "%"; } else if (M.endsWith("vw")) { var ve = L / this.window.innerWidth * 100; L = ve + "vw"; } else if (M.endsWith("vh")) { var de = L / this.window.innerHeight * 100; L = de + "vh"; } } if (k && typeof k == "string") { if (k.endsWith("%")) { var Y = A / R.height * 100; A = Y + "%"; } else if (k.endsWith("vw")) { var ve = A / this.window.innerWidth * 100; A = ve + "vw"; } else if (k.endsWith("vh")) { var de = A / this.window.innerHeight * 100; A = de + "vh"; } } var fe = { width: this.createSizeForCssProperty(L, "width"), height: this.createSizeForCssProperty(A, "height") }; this.flexDir === "row" ? fe.flexBasis = fe.width : this.flexDir === "column" && (fe.flexBasis = fe.height), cI(function() { i.setState(fe); }), this.props.onResize && this.props.onResize(r, w, this.resizable, oe); } }, t.prototype.onMouseUp = function(r) { var i = this.state, s = i.isResizing, c = i.direction, f = i.original; if (!(!s || !this.resizable)) { var m = { width: this.size.width - f.width, height: this.size.height - f.height }; this.props.onResizeStop && this.props.onResizeStop(r, c, this.resizable, m), this.props.size && this.setState(this.props.size), this.unbindEvents(), this.setState({ isResizing: !1, backgroundStyle: Uo(Uo({}, this.state.backgroundStyle), { cursor: "auto" }) }); } }, t.prototype.updateSize = function(r) { this.setState({ width: r.width, height: r.height }); }, t.prototype.renderResizer = function() { var r = this, i = this.props, s = i.enable, c = i.handleStyles, f = i.handleClasses, m = i.handleWrapperStyle, y = i.handleWrapperClass, g = i.handleComponent; if (!s) return null; var S = Object.keys(s).map(function(E) { return s[E] !== !1 ? Ge.createElement(VB, { key: E, direction: E, onResizeStart: r.onResizeStart, replaceStyles: c && c[E], className: f && f[E] }, g && g[E] ? g[E] : null) : null; }); return Ge.createElement("div", { className: y, style: m }, S); }, t.prototype.render = function() { var r = this, i = Object.keys(this.props).reduce(function(f, m) { return KB.indexOf(m) !== -1 || (f[m] = r.props[m]), f; }, {}), s = Uo(Uo(Uo({ position: "relative", userSelect: this.state.isResizing ? "none" : "auto" }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: "border-box", flexShrink: 0 }); this.state.flexBasis && (s.flexBasis = this.state.flexBasis); var c = this.props.as || "div"; return Ge.createElement( c, Uo({ ref: this.ref, style: s, className: this.props.className }, i), this.state.isResizing && Ge.createElement("div", { style: this.state.backgroundStyle }), this.props.children, this.renderResizer() ); }, t.defaultProps = { as: "div", onResizeStart: function() { }, onResize: function() { }, onResizeStop: function() { }, enable: { top: !0, right: !0, bottom: !0, left: !0, topRight: !0, bottomRight: !0, bottomLeft: !0, topLeft: !0 }, style: {}, grid: [1, 1], lockAspectRatio: !1, lockAspectRatioExtraWidth: 0, lockAspectRatioExtraHeight: 0, scale: 1, resizeRatio: 1, snapGap: 0 }, t; }(Ge.PureComponent) ); const Vn = (e) => e.system, XB = (e) => e.system.toastQueue, SM = Ze( Vn, (e) => { const { model_list: t } = e, r = Pe.reduce( t, (i, s, c) => (s.status === "active" && (i = c), i), "" ); return { ...t[r], name: r }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), $B = Ze( Vn, (e) => { const { model_list: t } = e; return Pe.pickBy(t, (i, s) => { if (i.format === "diffusers") return { name: s, ...i }; }); }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), QB = Ze( Vn, (e) => e.log, { memoizeOptions: { // We don't need a deep equality check for this selector. resultEqualityCheck: (e, t) => e.length === t.length } } ), ZB = Ze( Vn, (e) => ({ shouldShowLogViewer: e.shouldShowLogViewer, hasError: e.hasError, wasErrorSeen: e.wasErrorSeen }), { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), JB = () => { const e = xe(), { t } = Ce(), r = W(QB), { shouldShowLogViewer: i, hasError: s, wasErrorSeen: c } = W(ZB), [f, m] = qe(!0), y = Xe(null); co(() => { y.current !== null && f && (y.current.scrollTop = y.current.scrollHeight); }, [f, r, i]); const g = () => { e(S2()), e(xx(!i)); }; We( "`", () => { e(xx(!i)); }, [i] ), We("esc", () => { e(xx(!1)); }); const S = () => { y.current && f && y.current.scrollTop < y.current.scrollHeight - y.current.clientHeight && m(!1); }; return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ i && /* @__PURE__ */ u.jsx( xM, { defaultSize: { width: "100%", height: 200 }, style: { display: "flex", position: "fixed", insetInlineStart: 0, bottom: 0, zIndex: 9999 }, maxHeight: "90vh", children: /* @__PURE__ */ u.jsx( ne, { sx: { flexDirection: "column", width: "100vw", overflow: "auto", direction: "column", fontFamily: "monospace", pt: 0, pr: 4, pb: 4, pl: 12, borderTopWidth: 5, bg: "base.850", borderColor: "base.700" }, ref: y, onScroll: S, children: r.map((E, w) => { const { timestamp: D, message: M, level: k } = E, R = k === "info" ? "base" : k; return /* @__PURE__ */ u.jsxs( ne, { sx: { gap: 2, color: `${R}.300` }, children: [ /* @__PURE__ */ u.jsxs(ct, { fontWeight: "600", children: [ D, ":" ] }), /* @__PURE__ */ u.jsx(ct, { wordBreak: "break-all", children: M }) ] }, w ); }) } ) } ), i && /* @__PURE__ */ u.jsx( Ea, { hasArrow: !0, label: f ? "Autoscroll On" : "Autoscroll Off", children: /* @__PURE__ */ u.jsx( Be, { size: "sm", "aria-label": t("accessibility.toggleAutoscroll"), icon: /* @__PURE__ */ u.jsx(GO, {}), onClick: () => m(!f), isChecked: f, sx: { position: "fixed", insetInlineStart: 2, bottom: 12, zIndex: "10000" } } ) } ), /* @__PURE__ */ u.jsx( Ea, { hasArrow: !0, label: i ? "Hide Console" : "Show Console", children: /* @__PURE__ */ u.jsx( Be, { size: "sm", "aria-label": t("accessibility.toggleLogViewer"), icon: i ? /* @__PURE__ */ u.jsx(qO, {}) : /* @__PURE__ */ u.jsx(x2, {}), onClick: g, sx: { position: "fixed", insetInlineStart: 2, bottom: 2, zIndex: "10000" }, colorScheme: s || !c ? "error" : "base" } ) } ) ] }); }, e6 = "0px", bM = "calc(70px + 1rem)", og = 1.5, t6 = `calc(100vw - ${e6})`, n6 = `calc(100vh - ${og * 4}px)`, r6 = `calc(100vh - ${bM})`, a6 = `calc(100vh - (${bM} + 4.4rem))`, Vj = 384, i6 = Ze( Vn, (e) => ({ isProcessing: e.isProcessing, currentStep: e.currentStep, totalSteps: e.totalSteps, currentStatusHasSteps: e.currentStatusHasSteps }), { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), o6 = () => { const { t: e } = Ce(), { isProcessing: t, currentStep: r, totalSteps: i, currentStatusHasSteps: s } = W(i6), c = r ? Math.round(r * 100 / i) : 0; return /* @__PURE__ */ u.jsx( I_, { value: c, "aria-label": e("accessibility.invokeProgressBar"), isIndeterminate: t && !s, height: og, zIndex: 99 } ); }; function s6(e) { const { title: t, hotkey: r, description: i } = e; return /* @__PURE__ */ u.jsxs( uo, { sx: { gridTemplateColumns: "auto max-content", justifyContent: "space-between", alignItems: "center" }, children: [ /* @__PURE__ */ u.jsxs(uo, { children: [ /* @__PURE__ */ u.jsx(ct, { fontWeight: 600, children: t }), i && /* @__PURE__ */ u.jsx( ct, { sx: { fontSize: "sm" }, variant: "subtext", children: i } ) ] }), /* @__PURE__ */ u.jsx( Ut, { sx: { fontSize: "sm", fontWeight: 600, px: 2, py: 1 }, children: r } ) ] } ); } function l6({ children: e }) { const { isOpen: t, onOpen: r, onClose: i } = Ol(), { t: s } = Ce(), c = [ { title: s("hotkeys.invoke.title"), desc: s("hotkeys.invoke.desc"), hotkey: "Ctrl+Enter" }, { title: s("hotkeys.cancel.title"), desc: s("hotkeys.cancel.desc"), hotkey: "Shift+X" }, { title: s("hotkeys.focusPrompt.title"), desc: s("hotkeys.focusPrompt.desc"), hotkey: "Alt+A" }, { title: s("hotkeys.toggleOptions.title"), desc: s("hotkeys.toggleOptions.desc"), hotkey: "O" }, { title: s("hotkeys.pinOptions.title"), desc: s("hotkeys.pinOptions.desc"), hotkey: "Shift+O" }, { title: s("hotkeys.toggleViewer.title"), desc: s("hotkeys.toggleViewer.desc"), hotkey: "Z" }, { title: s("hotkeys.toggleGallery.title"), desc: s("hotkeys.toggleGallery.desc"), hotkey: "G" }, { title: s("hotkeys.maximizeWorkSpace.title"), desc: s("hotkeys.maximizeWorkSpace.desc"), hotkey: "F" }, { title: s("hotkeys.changeTabs.title"), desc: s("hotkeys.changeTabs.desc"), hotkey: "1-5" }, { title: s("hotkeys.consoleToggle.title"), desc: s("hotkeys.consoleToggle.desc"), hotkey: "`" } ], f = [ { title: s("hotkeys.setPrompt.title"), desc: s("hotkeys.setPrompt.desc"), hotkey: "P" }, { title: s("hotkeys.setSeed.title"), desc: s("hotkeys.setSeed.desc"), hotkey: "S" }, { title: s("hotkeys.setParameters.title"), desc: s("hotkeys.setParameters.desc"), hotkey: "A" }, { title: s("hotkeys.restoreFaces.title"), desc: s("hotkeys.restoreFaces.desc"), hotkey: "Shift+R" }, { title: s("hotkeys.upscale.title"), desc: s("hotkeys.upscale.desc"), hotkey: "Shift+U" }, { title: s("hotkeys.showInfo.title"), desc: s("hotkeys.showInfo.desc"), hotkey: "I" }, { title: s("hotkeys.sendToImageToImage.title"), desc: s("hotkeys.sendToImageToImage.desc"), hotkey: "Shift+I" }, { title: s("hotkeys.deleteImage.title"), desc: s("hotkeys.deleteImage.desc"), hotkey: "Del" }, { title: s("hotkeys.closePanels.title"), desc: s("hotkeys.closePanels.desc"), hotkey: "Esc" } ], m = [ { title: s("hotkeys.previousImage.title"), desc: s("hotkeys.previousImage.desc"), hotkey: "Arrow Left" }, { title: s("hotkeys.nextImage.title"), desc: s("hotkeys.nextImage.desc"), hotkey: "Arrow Right" }, { title: s("hotkeys.toggleGalleryPin.title"), desc: s("hotkeys.toggleGalleryPin.desc"), hotkey: "Shift+G" }, { title: s("hotkeys.increaseGalleryThumbSize.title"), desc: s("hotkeys.increaseGalleryThumbSize.desc"), hotkey: "Shift+Up" }, { title: s("hotkeys.decreaseGalleryThumbSize.title"), desc: s("hotkeys.decreaseGalleryThumbSize.desc"), hotkey: "Shift+Down" } ], y = [ { title: s("hotkeys.selectBrush.title"), desc: s("hotkeys.selectBrush.desc"), hotkey: "B" }, { title: s("hotkeys.selectEraser.title"), desc: s("hotkeys.selectEraser.desc"), hotkey: "E" }, { title: s("hotkeys.decreaseBrushSize.title"), desc: s("hotkeys.decreaseBrushSize.desc"), hotkey: "[" }, { title: s("hotkeys.increaseBrushSize.title"), desc: s("hotkeys.increaseBrushSize.desc"), hotkey: "]" }, { title: s("hotkeys.decreaseBrushOpacity.title"), desc: s("hotkeys.decreaseBrushOpacity.desc"), hotkey: "Shift + [" }, { title: s("hotkeys.increaseBrushOpacity.title"), desc: s("hotkeys.increaseBrushOpacity.desc"), hotkey: "Shift + ]" }, { title: s("hotkeys.moveTool.title"), desc: s("hotkeys.moveTool.desc"), hotkey: "V" }, { title: s("hotkeys.fillBoundingBox.title"), desc: s("hotkeys.fillBoundingBox.desc"), hotkey: "Shift + F" }, { title: s("hotkeys.eraseBoundingBox.title"), desc: s("hotkeys.eraseBoundingBox.desc"), hotkey: "Delete / Backspace" }, { title: s("hotkeys.colorPicker.title"), desc: s("hotkeys.colorPicker.desc"), hotkey: "C" }, { title: s("hotkeys.toggleSnap.title"), desc: s("hotkeys.toggleSnap.desc"), hotkey: "N" }, { title: s("hotkeys.quickToggleMove.title"), desc: s("hotkeys.quickToggleMove.desc"), hotkey: "Hold Space" }, { title: s("hotkeys.toggleLayer.title"), desc: s("hotkeys.toggleLayer.desc"), hotkey: "Q" }, { title: s("hotkeys.clearMask.title"), desc: s("hotkeys.clearMask.desc"), hotkey: "Shift+C" }, { title: s("hotkeys.hideMask.title"), desc: s("hotkeys.hideMask.desc"), hotkey: "H" }, { title: s("hotkeys.showHideBoundingBox.title"), desc: s("hotkeys.showHideBoundingBox.desc"), hotkey: "Shift+H" }, { title: s("hotkeys.mergeVisible.title"), desc: s("hotkeys.mergeVisible.desc"), hotkey: "Shift+M" }, { title: s("hotkeys.saveToGallery.title"), desc: s("hotkeys.saveToGallery.desc"), hotkey: "Shift+S" }, { title: s("hotkeys.copyToClipboard.title"), desc: s("hotkeys.copyToClipboard.desc"), hotkey: "Ctrl+C" }, { title: s("hotkeys.downloadImage.title"), desc: s("hotkeys.downloadImage.desc"), hotkey: "Shift+D" }, { title: s("hotkeys.undoStroke.title"), desc: s("hotkeys.undoStroke.desc"), hotkey: "Ctrl+Z" }, { title: s("hotkeys.redoStroke.title"), desc: s("hotkeys.redoStroke.desc"), hotkey: "Ctrl+Shift+Z, Ctrl+Y" }, { title: s("hotkeys.resetView.title"), desc: s("hotkeys.resetView.desc"), hotkey: "R" }, { title: s("hotkeys.previousStagingImage.title"), desc: s("hotkeys.previousStagingImage.desc"), hotkey: "Arrow Left" }, { title: s("hotkeys.nextStagingImage.title"), desc: s("hotkeys.nextStagingImage.desc"), hotkey: "Arrow Right" }, { title: s("hotkeys.acceptStagingImage.title"), desc: s("hotkeys.acceptStagingImage.desc"), hotkey: "Enter" } ], g = (S) => /* @__PURE__ */ u.jsx(ne, { flexDir: "column", gap: 4, children: S.map((E, w) => /* @__PURE__ */ u.jsxs(ne, { flexDir: "column", px: 2, gap: 4, children: [ /* @__PURE__ */ u.jsx( s6, { title: E.title, description: E.desc, hotkey: E.hotkey } ), w < S.length - 1 && /* @__PURE__ */ u.jsx(y_, {}) ] }, w)) }); return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ Ll(e, { onClick: r }), /* @__PURE__ */ u.jsxs(Al, { isOpen: t, onClose: i, children: [ /* @__PURE__ */ u.jsx(Rs, {}), /* @__PURE__ */ u.jsxs(zl, { children: [ /* @__PURE__ */ u.jsx(ks, { children: s("hotkeys.keyboardShortcuts") }), /* @__PURE__ */ u.jsx(Yd, {}), /* @__PURE__ */ u.jsx(Ps, { children: /* @__PURE__ */ u.jsx(Sb, { allowMultiple: !0, children: /* @__PURE__ */ u.jsxs(ne, { flexDir: "column", gap: 2, children: [ /* @__PURE__ */ u.jsxs(Td, { children: [ /* @__PURE__ */ u.jsx(wd, { children: /* @__PURE__ */ u.jsxs( ne, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [ /* @__PURE__ */ u.jsx("h2", { children: s("hotkeys.appHotkeys") }), /* @__PURE__ */ u.jsx(jd, {}) ] } ) }), /* @__PURE__ */ u.jsx(Dd, { children: g(c) }) ] }), /* @__PURE__ */ u.jsxs(Td, { children: [ /* @__PURE__ */ u.jsx(wd, { children: /* @__PURE__ */ u.jsxs( ne, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [ /* @__PURE__ */ u.jsx("h2", { children: s("hotkeys.generalHotkeys") }), /* @__PURE__ */ u.jsx(jd, {}) ] } ) }), /* @__PURE__ */ u.jsx(Dd, { children: g(f) }) ] }), /* @__PURE__ */ u.jsxs(Td, { children: [ /* @__PURE__ */ u.jsx(wd, { children: /* @__PURE__ */ u.jsxs( ne, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [ /* @__PURE__ */ u.jsx("h2", { children: s("hotkeys.galleryHotkeys") }), /* @__PURE__ */ u.jsx(jd, {}) ] } ) }), /* @__PURE__ */ u.jsx(Dd, { children: g(m) }) ] }), /* @__PURE__ */ u.jsxs(Td, { children: [ /* @__PURE__ */ u.jsx(wd, { children: /* @__PURE__ */ u.jsxs( ne, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [ /* @__PURE__ */ u.jsx("h2", { children: s("hotkeys.unifiedCanvasHotkeys") }), /* @__PURE__ */ u.jsx(jd, {}) ] } ) }), /* @__PURE__ */ u.jsx(Dd, { children: g(y) }) ] }) ] }) }) }), /* @__PURE__ */ u.jsx(Ms, {}) ] }) ] }) ] }); } const u6 = (e) => { const { label: t = "", isDisabled: r = !1, isInvalid: i, formControlProps: s, ...c } = e; return /* @__PURE__ */ u.jsxs( dn, { isInvalid: i, isDisabled: r, ...s, children: [ t !== "" && /* @__PURE__ */ u.jsx(Sn, { children: t }), /* @__PURE__ */ u.jsx(Ab, { ...c }) ] } ); }, zn = Yr(u6), Wj = /^-?(0\.)?\.?$/, c6 = (e) => { const { label: t, isDisabled: r = !1, showStepper: i = !0, isInvalid: s, value: c, onChange: f, min: m, max: y, isInteger: g = !0, formControlProps: S, formLabelProps: E, numberInputFieldProps: w, numberInputStepperProps: D, tooltipProps: M, ...k } = e, [R, O] = qe(String(c)); ot(() => { !R.match(Wj) && c !== Number(R) && O(String(c)); }, [c, R]); const I = (L) => { O(L), L.match(Wj) || f(g ? Math.floor(Number(L)) : Number(L)); }, A = (L) => { const H = Pe.clamp( g ? Math.floor(Number(L.target.value)) : Number(L.target.value), m, y ); O(String(H)), f(H); }; return /* @__PURE__ */ u.jsx(Ea, { ...M, children: /* @__PURE__ */ u.jsxs( dn, { isDisabled: r, isInvalid: s, ...S, children: [ t && /* @__PURE__ */ u.jsx(Sn, { ...E, children: t }), /* @__PURE__ */ u.jsxs( Ub, { value: R, min: m, max: y, keepWithinRange: !0, clampValueOnBlur: !1, onChange: I, onBlur: A, ...k, children: [ /* @__PURE__ */ u.jsx(Vb, { ...w }), i && /* @__PURE__ */ u.jsxs(Hb, { children: [ /* @__PURE__ */ u.jsx(Gb, { ...D }), /* @__PURE__ */ u.jsx(Wb, { ...D }) ] }) ] } ) ] } ) }); }, Ns = Yr(c6); var Gj = Array.isArray, qj = Object.keys, d6 = Object.prototype.hasOwnProperty, f6 = typeof Element < "u"; function GS(e, t) { if (e === t) return !0; if (e && t && typeof e == "object" && typeof t == "object") { var r = Gj(e), i = Gj(t), s, c, f; if (r && i) { if (c = e.length, c != t.length) return !1; for (s = c; s-- !== 0; ) if (!GS(e[s], t[s])) return !1; return !0; } if (r != i) return !1; var m = e instanceof Date, y = t instanceof Date; if (m != y) return !1; if (m && y) return e.getTime() == t.getTime(); var g = e instanceof RegExp, S = t instanceof RegExp; if (g != S) return !1; if (g && S) return e.toString() == t.toString(); var E = qj(e); if (c = E.length, c !== qj(t).length) return !1; for (s = c; s-- !== 0; ) if (!d6.call(t, E[s])) return !1; if (f6 && e instanceof Element && t instanceof Element) return e === t; for (s = c; s-- !== 0; ) if (f = E[s], !(f === "_owner" && e.$$typeof) && !GS(e[f], t[f])) return !1; return !0; } return e !== e && t !== t; } var Ml = function(t, r) { try { return GS(t, r); } catch (i) { if (i.message && i.message.match(/stack|recursion/i) || i.number === -2146828260) return console.warn("Warning: react-fast-compare does not handle circular references.", i.name, i.message), !1; throw i; } }, p6 = function(t) { return h6(t) && !v6(t); }; function h6(e) { return !!e && typeof e == "object"; } function v6(e) { var t = Object.prototype.toString.call(e); return t === "[object RegExp]" || t === "[object Date]" || y6(e); } var m6 = typeof Symbol == "function" && Symbol.for, g6 = m6 ? Symbol.for("react.element") : 60103; function y6(e) { return e.$$typeof === g6; } function x6(e) { return Array.isArray(e) ? [] : {}; } function sg(e, t) { return t.clone !== !1 && t.isMergeableObject(e) ? Wp(x6(e), e, t) : e; } function S6(e, t, r) { return e.concat(t).map(function(i) { return sg(i, r); }); } function b6(e, t, r) { var i = {}; return r.isMergeableObject(e) && Object.keys(e).forEach(function(s) { i[s] = sg(e[s], r); }), Object.keys(t).forEach(function(s) { !r.isMergeableObject(t[s]) || !e[s] ? i[s] = sg(t[s], r) : i[s] = Wp(e[s], t[s], r); }), i; } function Wp(e, t, r) { r = r || {}, r.arrayMerge = r.arrayMerge || S6, r.isMergeableObject = r.isMergeableObject || p6; var i = Array.isArray(t), s = Array.isArray(e), c = i === s; return c ? i ? r.arrayMerge(e, t, r) : b6(e, t, r) : sg(t, r); } Wp.all = function(t, r) { if (!Array.isArray(t)) throw new Error("first argument should be an array"); return t.reduce(function(i, s) { return Wp(i, s, r); }, {}); }; var qS = Wp, C6 = typeof global == "object" && global && global.Object === Object && global; const CM = C6; var E6 = typeof self == "object" && self && self.Object === Object && self, w6 = CM || E6 || Function("return this")(); const Qo = w6; var j6 = Qo.Symbol; const Il = j6; var EM = Object.prototype, T6 = EM.hasOwnProperty, D6 = EM.toString, _p = Il ? Il.toStringTag : void 0; function _6(e) { var t = T6.call(e, _p), r = e[_p]; try { e[_p] = void 0; var i = !0; } catch { } var s = D6.call(e); return i && (t ? e[_p] = r : delete e[_p]), s; } var M6 = Object.prototype, k6 = M6.toString; function R6(e) { return k6.call(e); } var P6 = "[object Null]", N6 = "[object Undefined]", Yj = Il ? Il.toStringTag : void 0; function Ku(e) { return e == null ? e === void 0 ? N6 : P6 : Yj && Yj in Object(e) ? _6(e) : R6(e); } function wM(e, t) { return function(r) { return e(t(r)); }; } var O6 = wM(Object.getPrototypeOf, Object); const $b = O6; function Xu(e) { return e != null && typeof e == "object"; } var A6 = "[object Object]", z6 = Function.prototype, I6 = Object.prototype, jM = z6.toString, F6 = I6.hasOwnProperty, L6 = jM.call(Object); function Kj(e) { if (!Xu(e) || Ku(e) != A6) return !1; var t = $b(e); if (t === null) return !0; var r = F6.call(t, "constructor") && t.constructor; return typeof r == "function" && r instanceof r && jM.call(r) == L6; } function B6() { this.__data__ = [], this.size = 0; } function TM(e, t) { return e === t || e !== e && t !== t; } function Rg(e, t) { for (var r = e.length; r--; ) if (TM(e[r][0], t)) return r; return -1; } var U6 = Array.prototype, H6 = U6.splice; function V6(e) { var t = this.__data__, r = Rg(t, e); if (r < 0) return !1; var i = t.length - 1; return r == i ? t.pop() : H6.call(t, r, 1), --this.size, !0; } function W6(e) { var t = this.__data__, r = Rg(t, e); return r < 0 ? void 0 : t[r][1]; } function G6(e) { return Rg(this.__data__, e) > -1; } function q6(e, t) { var r = this.__data__, i = Rg(r, e); return i < 0 ? (++this.size, r.push([e, t])) : r[i][1] = t, this; } function Is(e) { var t = -1, r = e == null ? 0 : e.length; for (this.clear(); ++t < r; ) { var i = e[t]; this.set(i[0], i[1]); } } Is.prototype.clear = B6; Is.prototype.delete = V6; Is.prototype.get = W6; Is.prototype.has = G6; Is.prototype.set = q6; function Y6() { this.__data__ = new Is(), this.size = 0; } function K6(e) { var t = this.__data__, r = t.delete(e); return this.size = t.size, r; } function X6(e) { return this.__data__.get(e); } function $6(e) { return this.__data__.has(e); } function sh(e) { var t = typeof e; return e != null && (t == "object" || t == "function"); } var Q6 = "[object AsyncFunction]", Z6 = "[object Function]", J6 = "[object GeneratorFunction]", eU = "[object Proxy]"; function DM(e) { if (!sh(e)) return !1; var t = Ku(e); return t == Z6 || t == J6 || t == Q6 || t == eU; } var tU = Qo["__core-js_shared__"]; const $x = tU; var Xj = function() { var e = /[^.]+$/.exec($x && $x.keys && $x.keys.IE_PROTO || ""); return e ? "Symbol(src)_1." + e : ""; }(); function nU(e) { return !!Xj && Xj in e; } var rU = Function.prototype, aU = rU.toString; function $u(e) { if (e != null) { try { return aU.call(e); } catch { } try { return e + ""; } catch { } } return ""; } var iU = /[\\^$.*+?()[\]{}|]/g, oU = /^\[object .+?Constructor\]$/, sU = Function.prototype, lU = Object.prototype, uU = sU.toString, cU = lU.hasOwnProperty, dU = RegExp( "^" + uU.call(cU).replace(iU, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function fU(e) { if (!sh(e) || nU(e)) return !1; var t = DM(e) ? dU : oU; return t.test($u(e)); } function pU(e, t) { return e == null ? void 0 : e[t]; } function Qu(e, t) { var r = pU(e, t); return fU(r) ? r : void 0; } var hU = Qu(Qo, "Map"); const Gp = hU; var vU = Qu(Object, "create"); const qp = vU; function mU() { this.__data__ = qp ? qp(null) : {}, this.size = 0; } function gU(e) { var t = this.has(e) && delete this.__data__[e]; return this.size -= t ? 1 : 0, t; } var yU = "__lodash_hash_undefined__", xU = Object.prototype, SU = xU.hasOwnProperty; function bU(e) { var t = this.__data__; if (qp) { var r = t[e]; return r === yU ? void 0 : r; } return SU.call(t, e) ? t[e] : void 0; } var CU = Object.prototype, EU = CU.hasOwnProperty; function wU(e) { var t = this.__data__; return qp ? t[e] !== void 0 : EU.call(t, e); } var jU = "__lodash_hash_undefined__"; function TU(e, t) { var r = this.__data__; return this.size += this.has(e) ? 0 : 1, r[e] = qp && t === void 0 ? jU : t, this; } function Vu(e) { var t = -1, r = e == null ? 0 : e.length; for (this.clear(); ++t < r; ) { var i = e[t]; this.set(i[0], i[1]); } } Vu.prototype.clear = mU; Vu.prototype.delete = gU; Vu.prototype.get = bU; Vu.prototype.has = wU; Vu.prototype.set = TU; function DU() { this.size = 0, this.__data__ = { hash: new Vu(), map: new (Gp || Is)(), string: new Vu() }; } function _U(e) { var t = typeof e; return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null; } function Pg(e, t) { var r = e.__data__; return _U(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map; } function MU(e) { var t = Pg(this, e).delete(e); return this.size -= t ? 1 : 0, t; } function kU(e) { return Pg(this, e).get(e); } function RU(e) { return Pg(this, e).has(e); } function PU(e, t) { var r = Pg(this, e), i = r.size; return r.set(e, t), this.size += r.size == i ? 0 : 1, this; } function Ul(e) { var t = -1, r = e == null ? 0 : e.length; for (this.clear(); ++t < r; ) { var i = e[t]; this.set(i[0], i[1]); } } Ul.prototype.clear = DU; Ul.prototype.delete = MU; Ul.prototype.get = kU; Ul.prototype.has = RU; Ul.prototype.set = PU; var NU = 200; function OU(e, t) { var r = this.__data__; if (r instanceof Is) { var i = r.__data__; if (!Gp || i.length < NU - 1) return i.push([e, t]), this.size = ++r.size, this; r = this.__data__ = new Ul(i); } return r.set(e, t), this.size = r.size, this; } function Kd(e) { var t = this.__data__ = new Is(e); this.size = t.size; } Kd.prototype.clear = Y6; Kd.prototype.delete = K6; Kd.prototype.get = X6; Kd.prototype.has = $6; Kd.prototype.set = OU; function AU(e, t) { for (var r = -1, i = e == null ? 0 : e.length; ++r < i && t(e[r], r, e) !== !1; ) ; return e; } var zU = function() { try { var e = Qu(Object, "defineProperty"); return e({}, "", {}), e; } catch { } }(); const $j = zU; function _M(e, t, r) { t == "__proto__" && $j ? $j(e, t, { configurable: !0, enumerable: !0, value: r, writable: !0 }) : e[t] = r; } var IU = Object.prototype, FU = IU.hasOwnProperty; function MM(e, t, r) { var i = e[t]; (!(FU.call(e, t) && TM(i, r)) || r === void 0 && !(t in e)) && _M(e, t, r); } function Ng(e, t, r, i) { var s = !r; r || (r = {}); for (var c = -1, f = t.length; ++c < f; ) { var m = t[c], y = i ? i(r[m], e[m], m, r, e) : void 0; y === void 0 && (y = e[m]), s ? _M(r, m, y) : MM(r, m, y); } return r; } function LU(e, t) { for (var r = -1, i = Array(e); ++r < e; ) i[r] = t(r); return i; } var BU = "[object Arguments]"; function Qj(e) { return Xu(e) && Ku(e) == BU; } var kM = Object.prototype, UU = kM.hasOwnProperty, HU = kM.propertyIsEnumerable, VU = Qj(function() { return arguments; }()) ? Qj : function(e) { return Xu(e) && UU.call(e, "callee") && !HU.call(e, "callee"); }; const WU = VU; var GU = Array.isArray; const lh = GU; function qU() { return !1; } var RM = typeof exports == "object" && exports && !exports.nodeType && exports, Zj = RM && typeof module == "object" && module && !module.nodeType && module, YU = Zj && Zj.exports === RM, Jj = YU ? Qo.Buffer : void 0, KU = Jj ? Jj.isBuffer : void 0, XU = KU || qU; const PM = XU; var $U = 9007199254740991, QU = /^(?:0|[1-9]\d*)$/; function ZU(e, t) { var r = typeof e; return t = t ?? $U, !!t && (r == "number" || r != "symbol" && QU.test(e)) && e > -1 && e % 1 == 0 && e < t; } var JU = 9007199254740991; function NM(e) { return typeof e == "number" && e > -1 && e % 1 == 0 && e <= JU; } var eH = "[object Arguments]", tH = "[object Array]", nH = "[object Boolean]", rH = "[object Date]", aH = "[object Error]", iH = "[object Function]", oH = "[object Map]", sH = "[object Number]", lH = "[object Object]", uH = "[object RegExp]", cH = "[object Set]", dH = "[object String]", fH = "[object WeakMap]", pH = "[object ArrayBuffer]", hH = "[object DataView]", vH = "[object Float32Array]", mH = "[object Float64Array]", gH = "[object Int8Array]", yH = "[object Int16Array]", xH = "[object Int32Array]", SH = "[object Uint8Array]", bH = "[object Uint8ClampedArray]", CH = "[object Uint16Array]", EH = "[object Uint32Array]", Un = {}; Un[vH] = Un[mH] = Un[gH] = Un[yH] = Un[xH] = Un[SH] = Un[bH] = Un[CH] = Un[EH] = !0; Un[eH] = Un[tH] = Un[pH] = Un[nH] = Un[hH] = Un[rH] = Un[aH] = Un[iH] = Un[oH] = Un[sH] = Un[lH] = Un[uH] = Un[cH] = Un[dH] = Un[fH] = !1; function wH(e) { return Xu(e) && NM(e.length) && !!Un[Ku(e)]; } function Qb(e) { return function(t) { return e(t); }; } var OM = typeof exports == "object" && exports && !exports.nodeType && exports, Op = OM && typeof module == "object" && module && !module.nodeType && module, jH = Op && Op.exports === OM, Qx = jH && CM.process, TH = function() { try { var e = Op && Op.require && Op.require("util").types; return e || Qx && Qx.binding && Qx.binding("util"); } catch { } }(); const Fd = TH; var eT = Fd && Fd.isTypedArray, DH = eT ? Qb(eT) : wH; const _H = DH; var MH = Object.prototype, kH = MH.hasOwnProperty; function AM(e, t) { var r = lh(e), i = !r && WU(e), s = !r && !i && PM(e), c = !r && !i && !s && _H(e), f = r || i || s || c, m = f ? LU(e.length, String) : [], y = m.length; for (var g in e) (t || kH.call(e, g)) && !(f && // Safari 9 has enumerable `arguments.length` in strict mode. (g == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. s && (g == "offset" || g == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. c && (g == "buffer" || g == "byteLength" || g == "byteOffset") || // Skip index properties. ZU(g, y))) && m.push(g); return m; } var RH = Object.prototype; function Zb(e) { var t = e && e.constructor, r = typeof t == "function" && t.prototype || RH; return e === r; } var PH = wM(Object.keys, Object); const NH = PH; var OH = Object.prototype, AH = OH.hasOwnProperty; function zH(e) { if (!Zb(e)) return NH(e); var t = []; for (var r in Object(e)) AH.call(e, r) && r != "constructor" && t.push(r); return t; } function zM(e) { return e != null && NM(e.length) && !DM(e); } function Jb(e) { return zM(e) ? AM(e) : zH(e); } function IH(e, t) { return e && Ng(t, Jb(t), e); } function FH(e) { var t = []; if (e != null) for (var r in Object(e)) t.push(r); return t; } var LH = Object.prototype, BH = LH.hasOwnProperty; function UH(e) { if (!sh(e)) return FH(e); var t = Zb(e), r = []; for (var i in e) i == "constructor" && (t || !BH.call(e, i)) || r.push(i); return r; } function e1(e) { return zM(e) ? AM(e, !0) : UH(e); } function HH(e, t) { return e && Ng(t, e1(t), e); } var IM = typeof exports == "object" && exports && !exports.nodeType && exports, tT = IM && typeof module == "object" && module && !module.nodeType && module, VH = tT && tT.exports === IM, nT = VH ? Qo.Buffer : void 0, rT = nT ? nT.allocUnsafe : void 0; function WH(e, t) { if (t) return e.slice(); var r = e.length, i = rT ? rT(r) : new e.constructor(r); return e.copy(i), i; } function FM(e, t) { var r = -1, i = e.length; for (t || (t = Array(i)); ++r < i; ) t[r] = e[r]; return t; } function GH(e, t) { for (var r = -1, i = e == null ? 0 : e.length, s = 0, c = []; ++r < i; ) { var f = e[r]; t(f, r, e) && (c[s++] = f); } return c; } function LM() { return []; } var qH = Object.prototype, YH = qH.propertyIsEnumerable, aT = Object.getOwnPropertySymbols, KH = aT ? function(e) { return e == null ? [] : (e = Object(e), GH(aT(e), function(t) { return YH.call(e, t); })); } : LM; const t1 = KH; function XH(e, t) { return Ng(e, t1(e), t); } function BM(e, t) { for (var r = -1, i = t.length, s = e.length; ++r < i; ) e[s + r] = t[r]; return e; } var $H = Object.getOwnPropertySymbols, QH = $H ? function(e) { for (var t = []; e; ) BM(t, t1(e)), e = $b(e); return t; } : LM; const UM = QH; function ZH(e, t) { return Ng(e, UM(e), t); } function HM(e, t, r) { var i = t(e); return lh(e) ? i : BM(i, r(e)); } function JH(e) { return HM(e, Jb, t1); } function e8(e) { return HM(e, e1, UM); } var t8 = Qu(Qo, "DataView"); const YS = t8; var n8 = Qu(Qo, "Promise"); const KS = n8; var r8 = Qu(Qo, "Set"); const XS = r8; var a8 = Qu(Qo, "WeakMap"); const $S = a8; var iT = "[object Map]", i8 = "[object Object]", oT = "[object Promise]", sT = "[object Set]", lT = "[object WeakMap]", uT = "[object DataView]", o8 = $u(YS), s8 = $u(Gp), l8 = $u(KS), u8 = $u(XS), c8 = $u($S), Ru = Ku; (YS && Ru(new YS(new ArrayBuffer(1))) != uT || Gp && Ru(new Gp()) != iT || KS && Ru(KS.resolve()) != oT || XS && Ru(new XS()) != sT || $S && Ru(new $S()) != lT) && (Ru = function(e) { var t = Ku(e), r = t == i8 ? e.constructor : void 0, i = r ? $u(r) : ""; if (i) switch (i) { case o8: return uT; case s8: return iT; case l8: return oT; case u8: return sT; case c8: return lT; } return t; }); const n1 = Ru; var d8 = Object.prototype, f8 = d8.hasOwnProperty; function p8(e) { var t = e.length, r = new e.constructor(t); return t && typeof e[0] == "string" && f8.call(e, "index") && (r.index = e.index, r.input = e.input), r; } var h8 = Qo.Uint8Array; const cT = h8; function r1(e) { var t = new e.constructor(e.byteLength); return new cT(t).set(new cT(e)), t; } function v8(e, t) { var r = t ? r1(e.buffer) : e.buffer; return new e.constructor(r, e.byteOffset, e.byteLength); } var m8 = /\w*$/; function g8(e) { var t = new e.constructor(e.source, m8.exec(e)); return t.lastIndex = e.lastIndex, t; } var dT = Il ? Il.prototype : void 0, fT = dT ? dT.valueOf : void 0; function y8(e) { return fT ? Object(fT.call(e)) : {}; } function x8(e, t) { var r = t ? r1(e.buffer) : e.buffer; return new e.constructor(r, e.byteOffset, e.length); } var S8 = "[object Boolean]", b8 = "[object Date]", C8 = "[object Map]", E8 = "[object Number]", w8 = "[object RegExp]", j8 = "[object Set]", T8 = "[object String]", D8 = "[object Symbol]", _8 = "[object ArrayBuffer]", M8 = "[object DataView]", k8 = "[object Float32Array]", R8 = "[object Float64Array]", P8 = "[object Int8Array]", N8 = "[object Int16Array]", O8 = "[object Int32Array]", A8 = "[object Uint8Array]", z8 = "[object Uint8ClampedArray]", I8 = "[object Uint16Array]", F8 = "[object Uint32Array]"; function L8(e, t, r) { var i = e.constructor; switch (t) { case _8: return r1(e); case S8: case b8: return new i(+e); case M8: return v8(e, r); case k8: case R8: case P8: case N8: case O8: case A8: case z8: case I8: case F8: return x8(e, r); case C8: return new i(); case E8: case T8: return new i(e); case w8: return g8(e); case j8: return new i(); case D8: return y8(e); } } var pT = Object.create, B8 = function() { function e() { } return function(t) { if (!sh(t)) return {}; if (pT) return pT(t); e.prototype = t; var r = new e(); return e.prototype = void 0, r; }; }(); const U8 = B8; function H8(e) { return typeof e.constructor == "function" && !Zb(e) ? U8($b(e)) : {}; } var V8 = "[object Map]"; function W8(e) { return Xu(e) && n1(e) == V8; } var hT = Fd && Fd.isMap, G8 = hT ? Qb(hT) : W8; const q8 = G8; var Y8 = "[object Set]"; function K8(e) { return Xu(e) && n1(e) == Y8; } var vT = Fd && Fd.isSet, X8 = vT ? Qb(vT) : K8; const $8 = X8; var Q8 = 1, Z8 = 2, J8 = 4, VM = "[object Arguments]", e7 = "[object Array]", t7 = "[object Boolean]", n7 = "[object Date]", r7 = "[object Error]", WM = "[object Function]", a7 = "[object GeneratorFunction]", i7 = "[object Map]", o7 = "[object Number]", GM = "[object Object]", s7 = "[object RegExp]", l7 = "[object Set]", u7 = "[object String]", c7 = "[object Symbol]", d7 = "[object WeakMap]", f7 = "[object ArrayBuffer]", p7 = "[object DataView]", h7 = "[object Float32Array]", v7 = "[object Float64Array]", m7 = "[object Int8Array]", g7 = "[object Int16Array]", y7 = "[object Int32Array]", x7 = "[object Uint8Array]", S7 = "[object Uint8ClampedArray]", b7 = "[object Uint16Array]", C7 = "[object Uint32Array]", Ln = {}; Ln[VM] = Ln[e7] = Ln[f7] = Ln[p7] = Ln[t7] = Ln[n7] = Ln[h7] = Ln[v7] = Ln[m7] = Ln[g7] = Ln[y7] = Ln[i7] = Ln[o7] = Ln[GM] = Ln[s7] = Ln[l7] = Ln[u7] = Ln[c7] = Ln[x7] = Ln[S7] = Ln[b7] = Ln[C7] = !0; Ln[r7] = Ln[WM] = Ln[d7] = !1; function Ap(e, t, r, i, s, c) { var f, m = t & Q8, y = t & Z8, g = t & J8; if (r && (f = s ? r(e, i, s, c) : r(e)), f !== void 0) return f; if (!sh(e)) return e; var S = lh(e); if (S) { if (f = p8(e), !m) return FM(e, f); } else { var E = n1(e), w = E == WM || E == a7; if (PM(e)) return WH(e, m); if (E == GM || E == VM || w && !s) { if (f = y || w ? {} : H8(e), !m) return y ? ZH(e, HH(f, e)) : XH(e, IH(f, e)); } else { if (!Ln[E]) return s ? e : {}; f = L8(e, E, m); } } c || (c = new Kd()); var D = c.get(e); if (D) return D; c.set(e, f), $8(e) ? e.forEach(function(R) { f.add(Ap(R, t, r, R, e, c)); }) : q8(e) && e.forEach(function(R, O) { f.set(O, Ap(R, t, r, O, e, c)); }); var M = g ? y ? e8 : JH : y ? e1 : Jb, k = S ? void 0 : M(e); return AU(k || e, function(R, O) { k && (O = R, R = e[O]), MM(f, O, Ap(R, t, r, O, e, c)); }), f; } var E7 = 4; function mT(e) { return Ap(e, E7); } function qM(e, t) { for (var r = -1, i = e == null ? 0 : e.length, s = Array(i); ++r < i; ) s[r] = t(e[r], r, e); return s; } var w7 = "[object Symbol]"; function a1(e) { return typeof e == "symbol" || Xu(e) && Ku(e) == w7; } var j7 = "Expected a function"; function i1(e, t) { if (typeof e != "function" || t != null && typeof t != "function") throw new TypeError(j7); var r = function() { var i = arguments, s = t ? t.apply(this, i) : i[0], c = r.cache; if (c.has(s)) return c.get(s); var f = e.apply(this, i); return r.cache = c.set(s, f) || c, f; }; return r.cache = new (i1.Cache || Ul)(), r; } i1.Cache = Ul; var T7 = 500; function D7(e) { var t = i1(e, function(i) { return r.size === T7 && r.clear(), i; }), r = t.cache; return t; } var _7 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, M7 = /\\(\\)?/g, k7 = D7(function(e) { var t = []; return e.charCodeAt(0) === 46 && t.push(""), e.replace(_7, function(r, i, s, c) { t.push(s ? c.replace(M7, "$1") : i || r); }), t; }); const R7 = k7; var P7 = 1 / 0; function N7(e) { if (typeof e == "string" || a1(e)) return e; var t = e + ""; return t == "0" && 1 / e == -P7 ? "-0" : t; } var O7 = 1 / 0, gT = Il ? Il.prototype : void 0, yT = gT ? gT.toString : void 0; function YM(e) { if (typeof e == "string") return e; if (lh(e)) return qM(e, YM) + ""; if (a1(e)) return yT ? yT.call(e) : ""; var t = e + ""; return t == "0" && 1 / e == -O7 ? "-0" : t; } function A7(e) { return e == null ? "" : YM(e); } function KM(e) { return lh(e) ? qM(e, N7) : a1(e) ? [e] : FM(R7(A7(e))); } var z7 = process.env.NODE_ENV === "production"; function ba(e, t) { if (!z7) { if (e) return; var r = "Warning: " + t; typeof console < "u" && console.warn(r); try { throw Error(r); } catch { } } } var I7 = 1, F7 = 4; function L7(e) { return Ap(e, I7 | F7); } function On() { return On = Object.assign || function(e) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t]; for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]); } return e; }, On.apply(this, arguments); } function B7(e, t) { e.prototype = Object.create(t.prototype), e.prototype.constructor = e, e.__proto__ = t; } function Ou(e, t) { if (e == null) return {}; var r = {}, i = Object.keys(e), s, c; for (c = 0; c < i.length; c++) s = i[c], !(t.indexOf(s) >= 0) && (r[s] = e[s]); return r; } function xT(e) { if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } var ST = function(t) { return Array.isArray(t) && t.length === 0; }, Sa = function(t) { return typeof t == "function"; }, Og = function(t) { return t !== null && typeof t == "object"; }, U7 = function(t) { return String(Math.floor(Number(t))) === t; }, Zx = function(t) { return Object.prototype.toString.call(t) === "[object String]"; }, o1 = function(t) { return eh.count(t) === 0; }, Jx = function(t) { return Og(t) && Sa(t.then); }; function H7(e) { if (e = e || (typeof document < "u" ? document : void 0), typeof e > "u") return null; try { return e.activeElement || e.body; } catch { return e.body; } } function aa(e, t, r, i) { i === void 0 && (i = 0); for (var s = KM(t); e && i < s.length; ) e = e[s[i++]]; return e === void 0 ? r : e; } function qo(e, t, r) { for (var i = mT(e), s = i, c = 0, f = KM(t); c < f.length - 1; c++) { var m = f[c], y = aa(e, f.slice(0, c + 1)); if (y && (Og(y) || Array.isArray(y))) s = s[m] = mT(y); else { var g = f[c + 1]; s = s[m] = U7(g) && Number(g) >= 0 ? [] : {}; } } return (c === 0 ? e : s)[f[c]] === r ? e : (r === void 0 ? delete s[f[c]] : s[f[c]] = r, c === 0 && r === void 0 && delete i[f[c]], i); } function XM(e, t, r, i) { r === void 0 && (r = /* @__PURE__ */ new WeakMap()), i === void 0 && (i = {}); for (var s = 0, c = Object.keys(e); s < c.length; s++) { var f = c[s], m = e[f]; Og(m) ? r.get(m) || (r.set(m, !0), i[f] = Array.isArray(m) ? [] : {}, XM(m, t, r, i[f])) : i[f] = t; } return i; } var Ag = /* @__PURE__ */ xg(void 0); Ag.displayName = "FormikContext"; var V7 = Ag.Provider; Ag.Consumer; function $M() { var e = Bl(Ag); return e || (process.env.NODE_ENV !== "production" ? ba(!1, "Formik context is undefined, please verify you are calling useFormikContext() as child of a component.") : ba(!1)), e; } function W7(e, t) { switch (t.type) { case "SET_VALUES": return On({}, e, { values: t.payload }); case "SET_TOUCHED": return On({}, e, { touched: t.payload }); case "SET_ERRORS": return Ml(e.errors, t.payload) ? e : On({}, e, { errors: t.payload }); case "SET_STATUS": return On({}, e, { status: t.payload }); case "SET_ISSUBMITTING": return On({}, e, { isSubmitting: t.payload }); case "SET_ISVALIDATING": return On({}, e, { isValidating: t.payload }); case "SET_FIELD_VALUE": return On({}, e, { values: qo(e.values, t.payload.field, t.payload.value) }); case "SET_FIELD_TOUCHED": return On({}, e, { touched: qo(e.touched, t.payload.field, t.payload.value) }); case "SET_FIELD_ERROR": return On({}, e, { errors: qo(e.errors, t.payload.field, t.payload.value) }); case "RESET_FORM": return On({}, e, t.payload); case "SET_FORMIK_STATE": return t.payload(e); case "SUBMIT_ATTEMPT": return On({}, e, { touched: XM(e.values, !0), isSubmitting: !0, submitCount: e.submitCount + 1 }); case "SUBMIT_FAILURE": return On({}, e, { isSubmitting: !1 }); case "SUBMIT_SUCCESS": return On({}, e, { isSubmitting: !1 }); default: return e; } } var _u = {}, km = {}; function G7(e) { var t = e.validateOnChange, r = t === void 0 ? !0 : t, i = e.validateOnBlur, s = i === void 0 ? !0 : i, c = e.validateOnMount, f = c === void 0 ? !1 : c, m = e.isInitialValid, y = e.enableReinitialize, g = y === void 0 ? !1 : y, S = e.onSubmit, E = Ou(e, ["validateOnChange", "validateOnBlur", "validateOnMount", "isInitialValid", "enableReinitialize", "onSubmit"]), w = On({ validateOnChange: r, validateOnBlur: s, validateOnMount: f, onSubmit: S }, E), D = Xe(w.initialValues), M = Xe(w.initialErrors || _u), k = Xe(w.initialTouched || km), R = Xe(w.initialStatus), O = Xe(!1), I = Xe({}); process.env.NODE_ENV !== "production" && ot(function() { typeof m > "u" || (process.env.NODE_ENV !== "production" ? ba(!1, "isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead.") : ba(!1)); }, []), ot(function() { return O.current = !0, function() { O.current = !1; }; }, []); var A = yD(W7, { values: w.initialValues, errors: w.initialErrors || _u, touched: w.initialTouched || km, status: w.initialStatus, isSubmitting: !1, isValidating: !1, submitCount: 0 }), L = A[0], H = A[1], q = ee(function(Q, He) { return new Promise(function(Fe, at) { var he = w.validate(Q, He); he == null ? Fe(_u) : Jx(he) ? he.then(function(Ae) { Fe(Ae || _u); }, function(Ae) { process.env.NODE_ENV !== "production" && console.warn("Warning: An unhandled error was caught during validation in ", Ae), at(Ae); }) : Fe(he); }); }, [w.validate]), U = ee(function(Q, He) { var Fe = w.validationSchema, at = Sa(Fe) ? Fe(He) : Fe, he = He && at.validateAt ? at.validateAt(He, Q) : Y7(Q, at); return new Promise(function(Ae, Dt) { he.then(function() { Ae(_u); }, function(Ht) { Ht.name === "ValidationError" ? Ae(q7(Ht)) : (process.env.NODE_ENV !== "production" && console.warn("Warning: An unhandled error was caught during validation in ", Ht), Dt(Ht)); }); }); }, [w.validationSchema]), $ = ee(function(Q, He) { return new Promise(function(Fe) { return Fe(I.current[Q].validate(He)); }); }, []), ae = ee(function(Q) { var He = Object.keys(I.current).filter(function(at) { return Sa(I.current[at].validate); }), Fe = He.length > 0 ? He.map(function(at) { return $(at, aa(Q, at)); }) : [Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")]; return Promise.all(Fe).then(function(at) { return at.reduce(function(he, Ae, Dt) { return Ae === "DO_NOT_DELETE_YOU_WILL_BE_FIRED" || Ae && (he = qo(he, He[Dt], Ae)), he; }, {}); }); }, [$]), oe = ee(function(Q) { return Promise.all([ae(Q), w.validationSchema ? U(Q) : {}, w.validate ? q(Q) : {}]).then(function(He) { var Fe = He[0], at = He[1], he = He[2], Ae = qS.all([Fe, at, he], { arrayMerge: K7 }); return Ae; }); }, [w.validate, w.validationSchema, ae, q, U]), Y = Ri(function(Q) { return Q === void 0 && (Q = L.values), H({ type: "SET_ISVALIDATING", payload: !0 }), oe(Q).then(function(He) { return O.current && (H({ type: "SET_ISVALIDATING", payload: !1 }), H({ type: "SET_ERRORS", payload: He })), He; }); }); ot(function() { f && O.current === !0 && Ml(D.current, w.initialValues) && Y(D.current); }, [f, Y]); var ve = ee(function(Q) { var He = Q && Q.values ? Q.values : D.current, Fe = Q && Q.errors ? Q.errors : M.current ? M.current : w.initialErrors || {}, at = Q && Q.touched ? Q.touched : k.current ? k.current : w.initialTouched || {}, he = Q && Q.status ? Q.status : R.current ? R.current : w.initialStatus; D.current = He, M.current = Fe, k.current = at, R.current = he; var Ae = function() { H({ type: "RESET_FORM", payload: { isSubmitting: !!Q && !!Q.isSubmitting, errors: Fe, touched: at, status: he, values: He, isValidating: !!Q && !!Q.isValidating, submitCount: Q && Q.submitCount && typeof Q.submitCount == "number" ? Q.submitCount : 0 } }); }; if (w.onReset) { var Dt = w.onReset(L.values, Le); Jx(Dt) ? Dt.then(Ae) : Ae(); } else Ae(); }, [w.initialErrors, w.initialStatus, w.initialTouched]); ot(function() { O.current === !0 && !Ml(D.current, w.initialValues) && (g && (D.current = w.initialValues, ve()), f && Y(D.current)); }, [g, w.initialValues, ve, f, Y]), ot(function() { g && O.current === !0 && !Ml(M.current, w.initialErrors) && (M.current = w.initialErrors || _u, H({ type: "SET_ERRORS", payload: w.initialErrors || _u })); }, [g, w.initialErrors]), ot(function() { g && O.current === !0 && !Ml(k.current, w.initialTouched) && (k.current = w.initialTouched || km, H({ type: "SET_TOUCHED", payload: w.initialTouched || km })); }, [g, w.initialTouched]), ot(function() { g && O.current === !0 && !Ml(R.current, w.initialStatus) && (R.current = w.initialStatus, H({ type: "SET_STATUS", payload: w.initialStatus })); }, [g, w.initialStatus, w.initialTouched]); var de = Ri(function(Q) { if (I.current[Q] && Sa(I.current[Q].validate)) { var He = aa(L.values, Q), Fe = I.current[Q].validate(He); return Jx(Fe) ? (H({ type: "SET_ISVALIDATING", payload: !0 }), Fe.then(function(at) { return at; }).then(function(at) { H({ type: "SET_FIELD_ERROR", payload: { field: Q, value: at } }), H({ type: "SET_ISVALIDATING", payload: !1 }); })) : (H({ type: "SET_FIELD_ERROR", payload: { field: Q, value: Fe } }), Promise.resolve(Fe)); } else if (w.validationSchema) return H({ type: "SET_ISVALIDATING", payload: !0 }), U(L.values, Q).then(function(at) { return at; }).then(function(at) { H({ type: "SET_FIELD_ERROR", payload: { field: Q, value: at[Q] } }), H({ type: "SET_ISVALIDATING", payload: !1 }); }); return Promise.resolve(); }), fe = ee(function(Q, He) { var Fe = He.validate; I.current[Q] = { validate: Fe }; }, []), _e = ee(function(Q) { delete I.current[Q]; }, []), Me = Ri(function(Q, He) { H({ type: "SET_TOUCHED", payload: Q }); var Fe = He === void 0 ? s : He; return Fe ? Y(L.values) : Promise.resolve(); }), te = ee(function(Q) { H({ type: "SET_ERRORS", payload: Q }); }, []), K = Ri(function(Q, He) { var Fe = Sa(Q) ? Q(L.values) : Q; H({ type: "SET_VALUES", payload: Fe }); var at = He === void 0 ? r : He; return at ? Y(Fe) : Promise.resolve(); }), se = ee(function(Q, He) { H({ type: "SET_FIELD_ERROR", payload: { field: Q, value: He } }); }, []), B = Ri(function(Q, He, Fe) { H({ type: "SET_FIELD_VALUE", payload: { field: Q, value: He } }); var at = Fe === void 0 ? r : Fe; return at ? Y(qo(L.values, Q, He)) : Promise.resolve(); }), re = ee(function(Q, He) { var Fe = He, at = Q, he; if (!Zx(Q)) { Q.persist && Q.persist(); var Ae = Q.target ? Q.target : Q.currentTarget, Dt = Ae.type, Ht = Ae.name, Te = Ae.id, _t = Ae.value, Zt = Ae.checked, Re = Ae.outerHTML, pe = Ae.options, Ne = Ae.multiple; Fe = He || Ht || Te, !Fe && process.env.NODE_ENV !== "production" && bT({ htmlContent: Re, documentationAnchorLink: "handlechange-e-reactchangeeventany--void", handlerName: "handleChange" }), at = /number|range/.test(Dt) ? (he = parseFloat(_t), isNaN(he) ? "" : he) : /checkbox/.test(Dt) ? $7(aa(L.values, Fe), Zt, _t) : pe && Ne ? X7(pe) : _t; } Fe && B(Fe, at); }, [B, L.values]), ke = Ri(function(Q) { if (Zx(Q)) return function(He) { return re(He, Q); }; re(Q); }), De = Ri(function(Q, He, Fe) { He === void 0 && (He = !0), H({ type: "SET_FIELD_TOUCHED", payload: { field: Q, value: He } }); var at = Fe === void 0 ? s : Fe; return at ? Y(L.values) : Promise.resolve(); }), Se = ee(function(Q, He) { Q.persist && Q.persist(); var Fe = Q.target, at = Fe.name, he = Fe.id, Ae = Fe.outerHTML, Dt = He || at || he; !Dt && process.env.NODE_ENV !== "production" && bT({ htmlContent: Ae, documentationAnchorLink: "handleblur-e-any--void", handlerName: "handleBlur" }), De(Dt, !0); }, [De]), be = Ri(function(Q) { if (Zx(Q)) return function(He) { return Se(He, Q); }; Se(Q); }), Ie = ee(function(Q) { Sa(Q) ? H({ type: "SET_FORMIK_STATE", payload: Q }) : H({ type: "SET_FORMIK_STATE", payload: function() { return Q; } }); }, []), Ue = ee(function(Q) { H({ type: "SET_STATUS", payload: Q }); }, []), tt = ee(function(Q) { H({ type: "SET_ISSUBMITTING", payload: Q }); }, []), ht = Ri(function() { return H({ type: "SUBMIT_ATTEMPT" }), Y().then(function(Q) { var He = Q instanceof Error, Fe = !He && Object.keys(Q).length === 0; if (Fe) { var at; try { if (at = yt(), at === void 0) return; } catch (he) { throw he; } return Promise.resolve(at).then(function(he) { return O.current && H({ type: "SUBMIT_SUCCESS" }), he; }).catch(function(he) { if (O.current) throw H({ type: "SUBMIT_FAILURE" }), he; }); } else if (O.current && (H({ type: "SUBMIT_FAILURE" }), He)) throw Q; }); }), dt = Ri(function(Q) { if (Q && Q.preventDefault && Sa(Q.preventDefault) && Q.preventDefault(), Q && Q.stopPropagation && Sa(Q.stopPropagation) && Q.stopPropagation(), process.env.NODE_ENV !== "production" && typeof document < "u") { var He = H7(); He !== null && He instanceof HTMLButtonElement && (He.attributes && He.attributes.getNamedItem("type") || (process.env.NODE_ENV !== "production" ? ba(!1, 'You submitted a Formik form using a button with an unspecified `type` attribute. Most browsers default button elements to `type="submit"`. If this is not a submit button, please add `type="button"`.') : ba(!1))); } ht().catch(function(Fe) { console.warn("Warning: An unhandled error was caught from submitForm()", Fe); }); }), Le = { resetForm: ve, validateForm: Y, validateField: de, setErrors: te, setFieldError: se, setFieldTouched: De, setFieldValue: B, setStatus: Ue, setSubmitting: tt, setTouched: Me, setValues: K, setFormikState: Ie, submitForm: ht }, yt = Ri(function() { return S(L.values, Le); }), Ot = Ri(function(Q) { Q && Q.preventDefault && Sa(Q.preventDefault) && Q.preventDefault(), Q && Q.stopPropagation && Sa(Q.stopPropagation) && Q.stopPropagation(), ve(); }), Qe = ee(function(Q) { return { value: aa(L.values, Q), error: aa(L.errors, Q), touched: !!aa(L.touched, Q), initialValue: aa(D.current, Q), initialTouched: !!aa(k.current, Q), initialError: aa(M.current, Q) }; }, [L.errors, L.touched, L.values]), rn = ee(function(Q) { return { setValue: function(Fe, at) { return B(Q, Fe, at); }, setTouched: function(Fe, at) { return De(Q, Fe, at); }, setError: function(Fe) { return se(Q, Fe); } }; }, [B, De, se]), Tn = ee(function(Q) { var He = Og(Q), Fe = He ? Q.name : Q, at = aa(L.values, Fe), he = { name: Fe, value: at, onChange: ke, onBlur: be }; if (He) { var Ae = Q.type, Dt = Q.value, Ht = Q.as, Te = Q.multiple; Ae === "checkbox" ? Dt === void 0 ? he.checked = !!at : (he.checked = !!(Array.isArray(at) && ~at.indexOf(Dt)), he.value = Dt) : Ae === "radio" ? (he.checked = at === Dt, he.value = Dt) : Ht === "select" && Te && (he.value = he.value || [], he.multiple = !0); } return he; }, [be, ke, L.values]), pn = Xt(function() { return !Ml(D.current, L.values); }, [D.current, L.values]), Wn = Xt(function() { return typeof m < "u" ? pn ? L.errors && Object.keys(L.errors).length === 0 : m !== !1 && Sa(m) ? m(w) : m : L.errors && Object.keys(L.errors).length === 0; }, [m, pn, L.errors, w]), tr = On({}, L, { initialValues: D.current, initialErrors: M.current, initialTouched: k.current, initialStatus: R.current, handleBlur: be, handleChange: ke, handleReset: Ot, handleSubmit: dt, resetForm: ve, setErrors: te, setFormikState: Ie, setFieldTouched: De, setFieldValue: B, setFieldError: se, setStatus: Ue, setSubmitting: tt, setTouched: Me, setValues: K, submitForm: ht, validateForm: Y, validateField: de, isValid: Wn, dirty: pn, unregisterField: _e, registerField: fe, getFieldProps: Tn, getFieldMeta: Qe, getFieldHelpers: rn, validateOnBlur: s, validateOnChange: r, validateOnMount: f }); return tr; } function uh(e) { var t = G7(e), r = e.component, i = e.children, s = e.render, c = e.innerRef; return hb(c, function() { return t; }), process.env.NODE_ENV !== "production" && ot(function() { e.render && (process.env.NODE_ENV !== "production" ? ba(!1, " has been deprecated and will be removed in future versions of Formik. Please use a child callback function instead. To get rid of this warning, replace ...} /> with {(props) => ...}") : ba(!1)); }, []), Ds(V7, { value: t }, r ? Ds(r, t) : s ? s(t) : i ? Sa(i) ? i(t) : o1(i) ? null : eh.only(i) : null); } function bT(e) { var t = e.htmlContent, r = e.documentationAnchorLink, i = e.handlerName; console.warn("Warning: Formik called `" + i + "`, but you forgot to pass an `id` or `name` attribute to your input:\n " + t + ` Formik cannot determine which value to update. For more info see https://formik.org/docs/api/formik#` + r + ` `); } function q7(e) { var t = {}; if (e.inner) { if (e.inner.length === 0) return qo(t, e.path, e.message); for (var s = e.inner, r = Array.isArray(s), i = 0, s = r ? s : s[Symbol.iterator](); ; ) { var c; if (r) { if (i >= s.length) break; c = s[i++]; } else { if (i = s.next(), i.done) break; c = i.value; } var f = c; aa(t, f.path) || (t = qo(t, f.path, f.message)); } } return t; } function Y7(e, t, r, i) { r === void 0 && (r = !1), i === void 0 && (i = {}); var s = QS(e); return t[r ? "validateSync" : "validate"](s, { abortEarly: !1, context: i }); } function QS(e) { var t = Array.isArray(e) ? [] : {}; for (var r in e) if (Object.prototype.hasOwnProperty.call(e, r)) { var i = String(r); Array.isArray(e[i]) === !0 ? t[i] = e[i].map(function(s) { return Array.isArray(s) === !0 || Kj(s) ? QS(s) : s !== "" ? s : void 0; }) : Kj(e[i]) ? t[i] = QS(e[i]) : t[i] = e[i] !== "" ? e[i] : void 0; } return t; } function K7(e, t, r) { var i = e.slice(); return t.forEach(function(c, f) { if (typeof i[f] > "u") { var m = r.clone !== !1, y = m && r.isMergeableObject(c); i[f] = y ? qS(Array.isArray(c) ? [] : {}, c, r) : c; } else r.isMergeableObject(c) ? i[f] = qS(e[f], c, r) : e.indexOf(c) === -1 && i.push(c); }), i; } function X7(e) { return Array.from(e).filter(function(t) { return t.selected; }).map(function(t) { return t.value; }); } function $7(e, t, r) { if (typeof e == "boolean") return Boolean(t); var i = [], s = !1, c = -1; if (Array.isArray(e)) i = e, c = e.indexOf(r), s = c >= 0; else if (!r || r == "true" || r == "false") return Boolean(t); return t && r && !s ? i.concat(r) : s ? i.slice(0, c).concat(i.slice(c + 1)) : i; } var Q7 = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? co : ot; function Ri(e) { var t = Xe(e); return Q7(function() { t.current = e; }), ee(function() { for (var r = arguments.length, i = new Array(r), s = 0; s < r; s++) i[s] = arguments[s]; return t.current.apply(void 0, i); }, []); } function Hn(e) { var t = e.validate, r = e.name, i = e.render, s = e.children, c = e.as, f = e.component, m = Ou(e, ["validate", "name", "render", "children", "as", "component"]), y = $M(), g = Ou(y, ["validate", "validationSchema"]); process.env.NODE_ENV !== "production" && ot(function() { i && (process.env.NODE_ENV !== "production" ? ba(!1, ' has been deprecated and will be removed in future versions of Formik. Please use a child callback function instead. To get rid of this warning, replace ...} /> with {({field, form, meta}) => ...}') : ba(!1)), c && s && Sa(s) && (process.env.NODE_ENV !== "production" ? ba(!1, "You should not use and as a function in the same component; will be ignored.") : ba(!1)), f && s && Sa(s) && (process.env.NODE_ENV !== "production" ? ba(!1, "You should not use and as a function in the same component; will be ignored.") : ba(!1)), i && s && !o1(s) && (process.env.NODE_ENV !== "production" ? ba(!1, "You should not use and in the same component; will be ignored") : ba(!1)); }, []); var S = g.registerField, E = g.unregisterField; ot(function() { return S(r, { validate: t }), function() { E(r); }; }, [S, E, r, t]); var w = g.getFieldProps(On({ name: r }, m)), D = g.getFieldMeta(r), M = { field: w, form: g }; if (i) return i(On({}, M, { meta: D })); if (Sa(s)) return s(On({}, M, { meta: D })); if (f) { if (typeof f == "string") { var k = m.innerRef, R = Ou(m, ["innerRef"]); return Ds(f, On({ ref: k }, w, R), s); } return Ds(f, On({ field: w, form: g }, m), s); } var O = c || "input"; if (typeof O == "string") { var I = m.innerRef, A = Ou(m, ["innerRef"]); return Ds(O, On({ ref: I }, w, A), s); } return Ds(O, On({}, w, m), s); } var Z7 = /* @__PURE__ */ Fl(function(e, t) { var r = e.action, i = Ou(e, ["action"]), s = r ?? "#", c = $M(), f = c.handleReset, m = c.handleSubmit; return Ds("form", Object.assign({ onSubmit: m, ref: t, onReset: f, action: s }, i)); }); Z7.displayName = "Form"; var J7 = function(t, r, i) { var s = Ld(t), c = s[r]; return s.splice(r, 1), s.splice(i, 0, c), s; }, e9 = function(t, r, i) { var s = Ld(t), c = s[r]; return s[r] = s[i], s[i] = c, s; }, eS = function(t, r, i) { var s = Ld(t); return s.splice(r, 0, i), s; }, t9 = function(t, r, i) { var s = Ld(t); return s[r] = i, s; }, Ld = function(t) { if (t) { if (Array.isArray(t)) return [].concat(t); var r = Object.keys(t).map(function(i) { return parseInt(i); }).reduce(function(i, s) { return s > i ? s : i; }, 0); return Array.from(On({}, t, { length: r + 1 })); } else return []; }, n9 = /* @__PURE__ */ function(e) { B7(t, e); function t(i) { var s; return s = e.call(this, i) || this, s.updateArrayField = function(c, f, m) { var y = s.props, g = y.name, S = y.formik.setFormikState; S(function(E) { var w = typeof m == "function" ? m : c, D = typeof f == "function" ? f : c, M = qo(E.values, g, c(aa(E.values, g))), k = m ? w(aa(E.errors, g)) : void 0, R = f ? D(aa(E.touched, g)) : void 0; return ST(k) && (k = void 0), ST(R) && (R = void 0), On({}, E, { values: M, errors: m ? qo(E.errors, g, k) : E.errors, touched: f ? qo(E.touched, g, R) : E.touched }); }); }, s.push = function(c) { return s.updateArrayField(function(f) { return [].concat(Ld(f), [L7(c)]); }, !1, !1); }, s.handlePush = function(c) { return function() { return s.push(c); }; }, s.swap = function(c, f) { return s.updateArrayField(function(m) { return e9(m, c, f); }, !0, !0); }, s.handleSwap = function(c, f) { return function() { return s.swap(c, f); }; }, s.move = function(c, f) { return s.updateArrayField(function(m) { return J7(m, c, f); }, !0, !0); }, s.handleMove = function(c, f) { return function() { return s.move(c, f); }; }, s.insert = function(c, f) { return s.updateArrayField(function(m) { return eS(m, c, f); }, function(m) { return eS(m, c, null); }, function(m) { return eS(m, c, null); }); }, s.handleInsert = function(c, f) { return function() { return s.insert(c, f); }; }, s.replace = function(c, f) { return s.updateArrayField(function(m) { return t9(m, c, f); }, !1, !1); }, s.handleReplace = function(c, f) { return function() { return s.replace(c, f); }; }, s.unshift = function(c) { var f = -1; return s.updateArrayField(function(m) { var y = m ? [c].concat(m) : [c]; return f < 0 && (f = y.length), y; }, function(m) { var y = m ? [null].concat(m) : [null]; return f < 0 && (f = y.length), y; }, function(m) { var y = m ? [null].concat(m) : [null]; return f < 0 && (f = y.length), y; }), f; }, s.handleUnshift = function(c) { return function() { return s.unshift(c); }; }, s.handleRemove = function(c) { return function() { return s.remove(c); }; }, s.handlePop = function() { return function() { return s.pop(); }; }, s.remove = s.remove.bind(xT(s)), s.pop = s.pop.bind(xT(s)), s; } var r = t.prototype; return r.componentDidUpdate = function(s) { this.props.validateOnChange && this.props.formik.validateOnChange && !Ml(aa(s.formik.values, s.name), aa(this.props.formik.values, this.props.name)) && this.props.formik.validateForm(this.props.formik.values); }, r.remove = function(s) { var c; return this.updateArrayField( // so this gets call 3 times function(f) { var m = f ? Ld(f) : []; return c || (c = m[s]), Sa(m.splice) && m.splice(s, 1), m; }, !0, !0 ), c; }, r.pop = function() { var s; return this.updateArrayField( // so this gets call 3 times function(c) { var f = c; return s || (s = f && f.pop && f.pop()), f; }, !0, !0 ), s; }, r.render = function() { var s = { push: this.push, pop: this.pop, swap: this.swap, move: this.move, insert: this.insert, replace: this.replace, unshift: this.unshift, remove: this.remove, handlePush: this.handlePush, handlePop: this.handlePop, handleSwap: this.handleSwap, handleMove: this.handleMove, handleInsert: this.handleInsert, handleReplace: this.handleReplace, handleUnshift: this.handleUnshift, handleRemove: this.handleRemove }, c = this.props, f = c.component, m = c.render, y = c.children, g = c.name, S = c.formik, E = Ou(S, ["validate", "validationSchema"]), w = On({}, s, { form: E, name: g }); return f ? Ds(f, w) : m ? m(w) : y ? typeof y == "function" ? y(w) : o1(y) ? null : eh.only(y) : null; }, t; }(iI); n9.defaultProps = { validateOnChange: !0 }; const r9 = lt((e, t) => { const { acceptButtonText: r = "Accept", acceptCallback: i, cancelButtonText: s = "Cancel", cancelCallback: c, children: f, title: m, triggerComponent: y } = e, { isOpen: g, onOpen: S, onClose: E } = Ol(), w = Xe(null), D = () => { i(), E(); }, M = () => { c && c(), E(); }; return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ Ll(y, { onClick: S, ref: t }), /* @__PURE__ */ u.jsx( N_, { isOpen: g, leastDestructiveRef: w, onClose: E, children: /* @__PURE__ */ u.jsx(Rs, { children: /* @__PURE__ */ u.jsxs(O_, { children: [ /* @__PURE__ */ u.jsx(ks, { fontSize: "lg", fontWeight: "bold", children: m }), /* @__PURE__ */ u.jsx(Ps, { children: f }), /* @__PURE__ */ u.jsxs(Ms, { children: [ /* @__PURE__ */ u.jsx(an, { ref: w, onClick: M, children: s }), /* @__PURE__ */ u.jsx(an, { colorScheme: "error", onClick: D, ml: 3, children: r }) ] }) ] }) }) } ) ] }); }), zg = Yr(r9); function a9(e) { const { model: t } = e, i = W( (M) => M.system.model_list )[t], s = xe(), { t: c } = Ce(), f = W( (M) => M.system.isProcessing ), m = W( (M) => M.system.isConnected ), [y, g] = qe("same"), [S, E] = qe(""); ot(() => { g("same"); }, [t]); const w = () => { g("same"); }, D = () => { s(YO({ model_name: t, save_location: y, custom_location: y === "custom" && S !== "" ? S : null })); }; return /* @__PURE__ */ u.jsxs( zg, { title: `${c("modelManager.convert")} ${t}`, acceptCallback: D, cancelCallback: w, acceptButtonText: `${c("modelManager.convert")}`, triggerComponent: /* @__PURE__ */ u.jsxs( an, { size: "sm", "aria-label": c("modelManager.convertToDiffusers"), isDisabled: i.status === "active" || f || !m, className: " modal-close-btn", marginInlineEnd: 8, children: [ "🧨 ", c("modelManager.convertToDiffusers") ] } ), motionPreset: "slideInBottom", children: [ /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", rowGap: 4, children: [ /* @__PURE__ */ u.jsx(ct, { children: c("modelManager.convertToDiffusersHelpText1") }), /* @__PURE__ */ u.jsxs(h_, { children: [ /* @__PURE__ */ u.jsx(Pp, { children: c("modelManager.convertToDiffusersHelpText2") }), /* @__PURE__ */ u.jsx(Pp, { children: c("modelManager.convertToDiffusersHelpText3") }), /* @__PURE__ */ u.jsx(Pp, { children: c("modelManager.convertToDiffusersHelpText4") }), /* @__PURE__ */ u.jsx(Pp, { children: c("modelManager.convertToDiffusersHelpText5") }) ] }), /* @__PURE__ */ u.jsx(ct, { children: c("modelManager.convertToDiffusersHelpText6") }) ] }), /* @__PURE__ */ u.jsxs(ne, { flexDir: "column", gap: 4, children: [ /* @__PURE__ */ u.jsxs(ne, { marginTop: 4, flexDir: "column", gap: 2, children: [ /* @__PURE__ */ u.jsx(ct, { fontWeight: "600", children: c("modelManager.convertToDiffusersSaveLocation") }), /* @__PURE__ */ u.jsx(Hp, { value: y, onChange: (M) => g(M), children: /* @__PURE__ */ u.jsxs(ne, { gap: 4, children: [ /* @__PURE__ */ u.jsx(Ba, { value: "same", children: /* @__PURE__ */ u.jsx(Ea, { label: "Save converted model in the same folder", children: c("modelManager.sameFolder") }) }), /* @__PURE__ */ u.jsx(Ba, { value: "root", children: /* @__PURE__ */ u.jsx(Ea, { label: "Save converted model in the InvokeAI root folder", children: c("modelManager.invokeRoot") }) }), /* @__PURE__ */ u.jsx(Ba, { value: "custom", children: /* @__PURE__ */ u.jsx(Ea, { label: "Save converted model in a custom folder", children: c("modelManager.custom") }) }) ] }) }) ] }), y === "custom" && /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", rowGap: 2, children: [ /* @__PURE__ */ u.jsx(ct, { fontWeight: "500", fontSize: "sm", variant: "subtext", children: c("modelManager.customSaveLocation") }), /* @__PURE__ */ u.jsx( zn, { value: S, onChange: (M) => { M.target.value !== "" && E(M.target.value); }, width: "full" } ) ] }) ] }) ] } ); } function oo(e) { const { children: t, ...r } = e; return /* @__PURE__ */ u.jsx(Fa, { margin: 0, color: "base.400", ...r, children: t }); } function so(e) { const { children: t, ...r } = e; return /* @__PURE__ */ u.jsx(La, { color: "error.400", ...r, children: t }); } const i9 = Ze( [Vn], (e) => { const { openModel: t, model_list: r } = e; return { model_list: r, openModel: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), CT = 64, ET = 2048; function o9() { const { openModel: e, model_list: t } = W(i9), r = W( (y) => y.system.isProcessing ), i = xe(), { t: s } = Ce(), [c, f] = qe({ name: "", description: "", config: "configs/stable-diffusion/v1-inference.yaml", weights: "", vae: "", width: 512, height: 512, default: !1, format: "ckpt" }); ot(() => { var y, g, S, E, w, D, M; if (e) { const k = Pe.pickBy(t, (R, O) => Pe.isEqual(O, e)); f({ name: e, description: (y = k[e]) == null ? void 0 : y.description, config: (g = k[e]) == null ? void 0 : g.config, weights: (S = k[e]) == null ? void 0 : S.weights, vae: (E = k[e]) == null ? void 0 : E.vae, width: (w = k[e]) == null ? void 0 : w.width, height: (D = k[e]) == null ? void 0 : D.height, default: (M = k[e]) == null ? void 0 : M.default, format: "ckpt" }); } }, [t, e]); const m = (y) => { i( $p({ ...y, width: Number(y.width), height: Number(y.height) }) ); }; return e ? /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", rowGap: 4, width: "100%", children: [ /* @__PURE__ */ u.jsxs(ne, { alignItems: "center", gap: 4, justifyContent: "space-between", children: [ /* @__PURE__ */ u.jsx(ct, { fontSize: "lg", fontWeight: "bold", children: e }), /* @__PURE__ */ u.jsx(a9, { model: e }) ] }), /* @__PURE__ */ u.jsx( ne, { flexDirection: "column", maxHeight: window.innerHeight - 270, overflowY: "scroll", paddingInlineEnd: 8, children: /* @__PURE__ */ u.jsx( uh, { enableReinitialize: !0, initialValues: c, onSubmit: m, children: ({ handleSubmit: y, errors: g, touched: S }) => /* @__PURE__ */ u.jsx("form", { onSubmit: y, children: /* @__PURE__ */ u.jsxs(zt, { rowGap: 2, alignItems: "start", children: [ /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!g.description && S.description, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "description", fontSize: "sm", children: s("modelManager.description") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "description", name: "description", type: "text", width: "full" } ), g.description && S.description ? /* @__PURE__ */ u.jsx(so, { children: g.description }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.descriptionValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!g.config && S.config, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "config", fontSize: "sm", children: s("modelManager.config") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "config", name: "config", type: "text", width: "full" } ), g.config && S.config ? /* @__PURE__ */ u.jsx(so, { children: g.config }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.configValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!g.weights && S.weights, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "config", fontSize: "sm", children: s("modelManager.modelLocation") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "weights", name: "weights", type: "text", width: "full" } ), g.weights && S.weights ? /* @__PURE__ */ u.jsx(so, { children: g.weights }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.modelLocationValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs(dn, { isInvalid: !!g.vae && S.vae, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "vae", fontSize: "sm", children: s("modelManager.vaeLocation") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "vae", name: "vae", type: "text", width: "full" } ), g.vae && S.vae ? /* @__PURE__ */ u.jsx(so, { children: g.vae }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.vaeLocationValidationMsg") }) ] }) ] }), /* @__PURE__ */ u.jsxs(Gd, { width: "100%", children: [ /* @__PURE__ */ u.jsxs(dn, { isInvalid: !!g.width && S.width, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "width", fontSize: "sm", children: s("modelManager.width") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx(Hn, { id: "width", name: "width", children: ({ field: E, form: w }) => /* @__PURE__ */ u.jsx( Ns, { id: "width", name: "width", min: CT, max: ET, step: 64, value: w.values.width, onChange: (D) => w.setFieldValue(E.name, Number(D)) } ) }), g.width && S.width ? /* @__PURE__ */ u.jsx(so, { children: g.width }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.widthValidationMsg") }) ] }) ] }), /* @__PURE__ */ u.jsxs(dn, { isInvalid: !!g.height && S.height, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "height", fontSize: "sm", children: s("modelManager.height") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx(Hn, { id: "height", name: "height", children: ({ field: E, form: w }) => /* @__PURE__ */ u.jsx( Ns, { id: "height", name: "height", min: CT, max: ET, step: 64, value: w.values.height, onChange: (D) => w.setFieldValue(E.name, Number(D)) } ) }), g.height && S.height ? /* @__PURE__ */ u.jsx(so, { children: g.height }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.heightValidationMsg") }) ] }) ] }) ] }), /* @__PURE__ */ u.jsx( an, { type: "submit", className: "modal-close-btn", isLoading: r, children: s("modelManager.updateModel") } ) ] }) }) } ) } ) ] }) : /* @__PURE__ */ u.jsx( ne, { sx: { width: "100%", justifyContent: "center", alignItems: "center", borderRadius: "base", bg: "base.900" }, children: /* @__PURE__ */ u.jsx(ct, { fontWeight: 500, children: "Pick A Model To Edit" }) } ); } const s9 = Ze( [Vn], (e) => { const { openModel: t, model_list: r } = e; return { model_list: r, openModel: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function l9() { const { openModel: e, model_list: t } = W(s9), r = W( (y) => y.system.isProcessing ), i = xe(), { t: s } = Ce(), [c, f] = qe({ name: "", description: "", repo_id: "", path: "", vae: { repo_id: "", path: "" }, default: !1, format: "diffusers" }); ot(() => { var y, g, S, E, w, D, M, k, R, O, I, A, L, H, q, U; if (e) { const $ = Pe.pickBy(t, (ae, oe) => Pe.isEqual(oe, e)); f({ name: e, description: (y = $[e]) == null ? void 0 : y.description, path: (g = $[e]) != null && g.path && ((S = $[e]) == null ? void 0 : S.path) !== "None" ? (E = $[e]) == null ? void 0 : E.path : "", repo_id: (w = $[e]) != null && w.repo_id && ((D = $[e]) == null ? void 0 : D.repo_id) !== "None" ? (M = $[e]) == null ? void 0 : M.repo_id : "", vae: { repo_id: (R = (k = $[e]) == null ? void 0 : k.vae) != null && R.repo_id ? (I = (O = $[e]) == null ? void 0 : O.vae) == null ? void 0 : I.repo_id : "", path: (L = (A = $[e]) == null ? void 0 : A.vae) != null && L.path ? (q = (H = $[e]) == null ? void 0 : H.vae) == null ? void 0 : q.path : "" }, default: (U = $[e]) == null ? void 0 : U.default, format: "diffusers" }); } }, [t, e]); const m = (y) => { const g = y; y.path === "" && delete g.path, y.repo_id === "" && delete g.repo_id, y.vae.path === "" && delete g.vae.path, y.vae.repo_id === "" && delete g.vae.repo_id, i($p(y)); }; return e ? /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", rowGap: 4, width: "100%", children: [ /* @__PURE__ */ u.jsx(ne, { alignItems: "center", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "lg", fontWeight: "bold", children: e }) }), /* @__PURE__ */ u.jsx(ne, { flexDirection: "column", overflowY: "scroll", paddingInlineEnd: 8, children: /* @__PURE__ */ u.jsx( uh, { enableReinitialize: !0, initialValues: c, onSubmit: m, children: ({ handleSubmit: y, errors: g, touched: S }) => { var E, w, D, M, k, R, O, I, A, L; return /* @__PURE__ */ u.jsx("form", { onSubmit: y, children: /* @__PURE__ */ u.jsxs(zt, { rowGap: 2, alignItems: "start", children: [ /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!g.description && S.description, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "description", fontSize: "sm", children: s("modelManager.description") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "description", name: "description", type: "text", width: "full" } ), g.description && S.description ? /* @__PURE__ */ u.jsx(so, { children: g.description }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.descriptionValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!g.path && S.path, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "path", fontSize: "sm", children: s("modelManager.modelLocation") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "path", name: "path", type: "text", width: "full" } ), g.path && S.path ? /* @__PURE__ */ u.jsx(so, { children: g.path }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.modelLocationValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs(dn, { isInvalid: !!g.repo_id && S.repo_id, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "repo_id", fontSize: "sm", children: s("modelManager.repo_id") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "repo_id", name: "repo_id", type: "text", width: "full" } ), g.repo_id && S.repo_id ? /* @__PURE__ */ u.jsx(so, { children: g.repo_id }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.repoIDValidationMsg") }) ] }) ] }), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!((E = g.vae) != null && E.path) && ((w = S.vae) == null ? void 0 : w.path), children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "vae.path", fontSize: "sm", children: s("modelManager.vaeLocation") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "vae.path", name: "vae.path", type: "text", width: "full" } ), (D = g.vae) != null && D.path && ((M = S.vae) != null && M.path) ? /* @__PURE__ */ u.jsx(so, { children: (k = g.vae) == null ? void 0 : k.path }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.vaeLocationValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!((R = g.vae) != null && R.repo_id) && ((O = S.vae) == null ? void 0 : O.repo_id), children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "vae.repo_id", fontSize: "sm", children: s("modelManager.vaeRepoID") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "vae.repo_id", name: "vae.repo_id", type: "text", width: "full" } ), (I = g.vae) != null && I.repo_id && ((A = S.vae) != null && A.repo_id) ? /* @__PURE__ */ u.jsx(so, { children: (L = g.vae) == null ? void 0 : L.repo_id }) : /* @__PURE__ */ u.jsx(oo, { children: s("modelManager.vaeRepoIDValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsx( an, { type: "submit", className: "modal-close-btn", isLoading: r, children: s("modelManager.updateModel") } ) ] }) }); } } ) }) ] }) : /* @__PURE__ */ u.jsx( ne, { sx: { width: "100%", justifyContent: "center", alignItems: "center", borderRadius: "base", bg: "base.900" }, children: /* @__PURE__ */ u.jsx(ct, { fontWeight: "500", children: "Pick A Model To Edit" }) } ); } const u9 = (e) => { const { label: t, ...r } = e; return /* @__PURE__ */ u.jsx(ND, { colorScheme: "accent", ...r, children: t }); }, An = Yr(u9); function QM(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M21 11H6.414l5.293-5.293-1.414-1.414L2.586 12l7.707 7.707 1.414-1.414L6.414 13H21z" } }] })(e); } function c9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M19.002 3h-14c-1.103 0-2 .897-2 2v4h2V5h14v14h-14v-4h-2v4c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2V5c0-1.103-.898-2-2-2z" } }, { tag: "path", attr: { d: "m11 16 5-4-5-4v3.001H3v2h8z" } }] })(e); } function s1(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 16c1.671 0 3-1.331 3-3s-1.329-3-3-3-3 1.331-3 3 1.329 3 3 3z" } }, { tag: "path", attr: { d: "M20.817 11.186a8.94 8.94 0 0 0-1.355-3.219 9.053 9.053 0 0 0-2.43-2.43 8.95 8.95 0 0 0-3.219-1.355 9.028 9.028 0 0 0-1.838-.18V2L8 5l3.975 3V6.002c.484-.002.968.044 1.435.14a6.961 6.961 0 0 1 2.502 1.053 7.005 7.005 0 0 1 1.892 1.892A6.967 6.967 0 0 1 19 13a7.032 7.032 0 0 1-.55 2.725 7.11 7.11 0 0 1-.644 1.188 7.2 7.2 0 0 1-.858 1.039 7.028 7.028 0 0 1-3.536 1.907 7.13 7.13 0 0 1-2.822 0 6.961 6.961 0 0 1-2.503-1.054 7.002 7.002 0 0 1-1.89-1.89A6.996 6.996 0 0 1 5 13H3a9.02 9.02 0 0 0 1.539 5.034 9.096 9.096 0 0 0 2.428 2.428A8.95 8.95 0 0 0 12 22a9.09 9.09 0 0 0 1.814-.183 9.014 9.014 0 0 0 3.218-1.355 8.886 8.886 0 0 0 1.331-1.099 9.228 9.228 0 0 0 1.1-1.332A8.952 8.952 0 0 0 21 13a9.09 9.09 0 0 0-.183-1.814z" } }] })(e); } function d9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M6.758 8.758 5.344 7.344a8.048 8.048 0 0 0-1.841 2.859l1.873.701a6.048 6.048 0 0 1 1.382-2.146zM19 12.999a7.935 7.935 0 0 0-2.344-5.655A7.917 7.917 0 0 0 12 5.069V2L7 6l5 4V7.089a5.944 5.944 0 0 1 3.242 1.669A5.956 5.956 0 0 1 17 13v.002c0 .33-.033.655-.086.977-.007.043-.011.088-.019.131a6.053 6.053 0 0 1-1.138 2.536c-.16.209-.331.412-.516.597a5.954 5.954 0 0 1-.728.613 5.906 5.906 0 0 1-2.277 1.015c-.142.03-.285.05-.43.069-.062.009-.122.021-.184.027a6.104 6.104 0 0 1-1.898-.103L9.3 20.819a8.087 8.087 0 0 0 2.534.136c.069-.007.138-.021.207-.03.205-.026.409-.056.61-.098l.053-.009-.001-.005a7.877 7.877 0 0 0 2.136-.795l.001.001.028-.019a7.906 7.906 0 0 0 1.01-.67c.27-.209.532-.43.777-.675.248-.247.47-.513.681-.785.021-.028.049-.053.07-.081l-.006-.004a7.899 7.899 0 0 0 1.093-1.997l.008.003c.029-.078.05-.158.076-.237.037-.11.075-.221.107-.333.04-.14.073-.281.105-.423.022-.099.048-.195.066-.295.032-.171.056-.344.076-.516.01-.076.023-.15.03-.227.023-.249.037-.5.037-.753.002-.002.002-.004.002-.008zM6.197 16.597l-1.6 1.201a8.045 8.045 0 0 0 2.569 2.225l.961-1.754a6.018 6.018 0 0 1-1.93-1.672zM5 13c0-.145.005-.287.015-.429l-1.994-.143a7.977 7.977 0 0 0 .483 3.372l1.873-.701A5.975 5.975 0 0 1 5 13z" } }] })(e); } function f9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M16.242 17.242a6.04 6.04 0 0 1-1.37 1.027l.961 1.754a8.068 8.068 0 0 0 2.569-2.225l-1.6-1.201a5.938 5.938 0 0 1-.56.645zm1.743-4.671a5.975 5.975 0 0 1-.362 2.528l1.873.701a7.977 7.977 0 0 0 .483-3.371l-1.994.142zm1.512-2.368a8.048 8.048 0 0 0-1.841-2.859l-1.414 1.414a6.071 6.071 0 0 1 1.382 2.146l1.873-.701zm-8.128 8.763c-.047-.005-.094-.015-.141-.021a6.701 6.701 0 0 1-.468-.075 5.923 5.923 0 0 1-2.421-1.122 5.954 5.954 0 0 1-.583-.506 6.138 6.138 0 0 1-.516-.597 5.91 5.91 0 0 1-.891-1.634 6.086 6.086 0 0 1-.247-.902c-.008-.043-.012-.088-.019-.131A6.332 6.332 0 0 1 6 13.002V13c0-1.603.624-3.109 1.758-4.242A5.944 5.944 0 0 1 11 7.089V10l5-4-5-4v3.069a7.917 7.917 0 0 0-4.656 2.275A7.936 7.936 0 0 0 4 12.999v.009c0 .253.014.504.037.753.007.076.021.15.03.227.021.172.044.345.076.516.019.1.044.196.066.295.032.142.065.283.105.423.032.112.07.223.107.333.026.079.047.159.076.237l.008-.003A7.948 7.948 0 0 0 5.6 17.785l-.007.005c.021.028.049.053.07.081.211.272.433.538.681.785a8.236 8.236 0 0 0 .966.816c.265.192.537.372.821.529l.028.019.001-.001a7.877 7.877 0 0 0 2.136.795l-.001.005.053.009c.201.042.405.071.61.098.069.009.138.023.207.03a8.038 8.038 0 0 0 2.532-.137l-.424-1.955a6.11 6.11 0 0 1-1.904.102z" } }] })(e); } function p9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M11 6H9v3H6v2h3v3h2v-3h3V9h-3z" } }, { tag: "path", attr: { d: "M10 2c-4.411 0-8 3.589-8 8s3.589 8 8 8a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z" } }] })(e); } function h9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M6 9h8v2H6z" } }, { tag: "path", attr: { d: "M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z" } }] })(e); } const ZM = Ze([Vn], (e) => { const { model_list: t } = e, r = []; return Pe.forEach(t, (i) => { r.push(i.weights); }), r; }); function wT({ model: e, modelsToAdd: t, setModelsToAdd: r }) { const { t: i } = Ce(), s = W(ZM), c = (f) => { t.includes(f.target.value) ? r(Pe.remove(t, (m) => m !== f.target.value)) : r([...t, f.target.value]); }; return /* @__PURE__ */ u.jsx(zt, { children: /* @__PURE__ */ u.jsxs( ne, { flexDirection: "column", gap: 2, backgroundColor: t.includes(e.name) ? "accent.650" : "base.800", paddingX: 4, paddingY: 2, borderRadius: 4, children: [ /* @__PURE__ */ u.jsxs(ne, { gap: 4, children: [ /* @__PURE__ */ u.jsx( An, { value: e.name, label: /* @__PURE__ */ u.jsx(ct, { fontWeight: 500, children: e.name }), isChecked: t.includes(e.name), isDisabled: s.includes(e.location), onChange: c } ), s.includes(e.location) && /* @__PURE__ */ u.jsx(m_, { colorScheme: "accent", children: i("modelManager.modelExists") }) ] }), /* @__PURE__ */ u.jsx(ct, { fontStyle: "italic", variant: "subtext", children: e.location }) ] } ) }); } function v9() { const e = xe(), { t } = Ce(), r = W( (A) => A.system.searchFolder ), i = W( (A) => A.system.foundModels ), s = W(ZM), c = W( (A) => A.ui.shouldShowExistingModelsInSearch ), f = W( (A) => A.system.isProcessing ), [m, y] = jt.useState([]), [g, S] = jt.useState("v1"), [E, w] = jt.useState(""), D = () => { e($O(null)), e(QO(null)), y([]); }, M = (A) => { e(Ew(A.checkpointFolder)); }, k = () => { y([]), i && i.forEach((A) => { s.includes(A.location) || y((L) => [...L, A.name]); }); }, R = () => { y([]); }, O = () => { const A = i == null ? void 0 : i.filter( (H) => m.includes(H.name) ), L = { v1: "configs/stable-diffusion/v1-inference.yaml", v2_base: "configs/stable-diffusion/v2-inference-v.yaml", v2_768: "configs/stable-diffusion/v2-inference-v.yaml", inpainting: "configs/stable-diffusion/v1-inpainting-inference.yaml", custom: E }; A == null || A.forEach((H) => { const q = { name: H.name, description: "", config: L[g], weights: H.location, vae: "", width: 512, height: 512, default: !1, format: "ckpt" }; e($p(q)); }), y([]); }, I = () => { const A = [], L = []; return i && i.forEach((H, q) => { s.includes(H.location) ? L.push( /* @__PURE__ */ u.jsx( wT, { model: H, modelsToAdd: m, setModelsToAdd: y }, q ) ) : A.push( /* @__PURE__ */ u.jsx( wT, { model: H, modelsToAdd: m, setModelsToAdd: y }, q ) ); }), /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ A, c && L ] }); }; return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ r ? /* @__PURE__ */ u.jsxs( ne, { sx: { padding: 4, gap: 2, position: "relative", borderRadius: "base", alignItems: "center", w: "full", bg: "base.900" }, children: [ /* @__PURE__ */ u.jsxs( ne, { sx: { flexDir: "column", gap: 2 }, children: [ /* @__PURE__ */ u.jsx( ct, { sx: { fontWeight: 500, fontSize: "sm" }, variant: "subtext", children: t("modelManager.checkpointFolder") } ), /* @__PURE__ */ u.jsx(ct, { sx: { fontWeight: 500, fontSize: "sm" }, children: r }) ] } ), /* @__PURE__ */ u.jsx(Eg, {}), /* @__PURE__ */ u.jsx( Be, { "aria-label": t("modelManager.scanAgain"), tooltip: t("modelManager.scanAgain"), icon: /* @__PURE__ */ u.jsx(s1, {}), fontSize: 18, disabled: f, onClick: () => e(Ew(r)) } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": t("modelManager.clearCheckpointFolder"), icon: /* @__PURE__ */ u.jsx(Qp, { style: { transform: "rotate(45deg)" } }), onClick: D } ) ] } ) : /* @__PURE__ */ u.jsx( uh, { initialValues: { checkpointFolder: "" }, onSubmit: (A) => { M(A); }, children: ({ handleSubmit: A }) => /* @__PURE__ */ u.jsx("form", { onSubmit: A, children: /* @__PURE__ */ u.jsxs(Gd, { columnGap: 2, alignItems: "flex-end", width: "100%", children: [ /* @__PURE__ */ u.jsx(dn, { isRequired: !0, width: "lg", children: /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "checkpointFolder", name: "checkpointFolder", type: "text", size: "md", label: t("modelManager.checkpointFolder") } ) }), /* @__PURE__ */ u.jsx( an, { leftIcon: /* @__PURE__ */ u.jsx(KO, {}), "aria-label": t("modelManager.findModels"), tooltip: t("modelManager.findModels"), type: "submit", disabled: f, paddingX: 10, children: t("modelManager.findModels") } ) ] }) }) } ), i && /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", rowGap: 4, width: "full", children: [ /* @__PURE__ */ u.jsxs(ne, { justifyContent: "space-between", alignItems: "center", children: [ /* @__PURE__ */ u.jsxs("p", { children: [ t("modelManager.modelsFound"), ": ", i.length ] }), /* @__PURE__ */ u.jsxs("p", { children: [ t("modelManager.selected"), ": ", m.length ] }) ] }), /* @__PURE__ */ u.jsxs(ne, { columnGap: 2, justifyContent: "space-between", children: [ /* @__PURE__ */ u.jsxs(ne, { columnGap: 2, children: [ /* @__PURE__ */ u.jsx( an, { isDisabled: m.length === i.length, onClick: k, children: t("modelManager.selectAll") } ), /* @__PURE__ */ u.jsx( an, { isDisabled: m.length === 0, onClick: R, children: t("modelManager.deselectAll") } ), /* @__PURE__ */ u.jsx( An, { label: t("modelManager.showExisting"), isChecked: c, onChange: () => e( XO( !c ) ) } ) ] }), /* @__PURE__ */ u.jsx( an, { isDisabled: m.length === 0, onClick: O, colorScheme: "accent", children: t("modelManager.addSelected") } ) ] }), /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", padding: 4, rowGap: 4, borderRadius: "base", width: "full", bg: "base.900" }, children: [ /* @__PURE__ */ u.jsxs(ne, { gap: 4, children: [ /* @__PURE__ */ u.jsx(ct, { fontWeight: 500, variant: "subtext", children: t("modelManager.pickModelType") }), /* @__PURE__ */ u.jsx( Hp, { value: g, onChange: (A) => S(A), defaultValue: "v1", name: "model_type", children: /* @__PURE__ */ u.jsxs(ne, { gap: 4, children: [ /* @__PURE__ */ u.jsx(Ba, { value: "v1", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: t("modelManager.v1") }) }), /* @__PURE__ */ u.jsx(Ba, { value: "v2_base", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: t("modelManager.v2_base") }) }), /* @__PURE__ */ u.jsx(Ba, { value: "v2_768", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: t("modelManager.v2_768") }) }), /* @__PURE__ */ u.jsx(Ba, { value: "inpainting", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: t("modelManager.inpainting") }) }), /* @__PURE__ */ u.jsx(Ba, { value: "custom", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: t("modelManager.customConfig") }) }) ] }) } ) ] }), g === "custom" && /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", rowGap: 2, children: [ /* @__PURE__ */ u.jsx(ct, { fontWeight: "500", fontSize: "sm", variant: "subtext", children: t("modelManager.pathToCustomConfig") }), /* @__PURE__ */ u.jsx( zn, { value: E, onChange: (A) => { A.target.value !== "" && w(A.target.value); }, width: "full" } ) ] }) ] } ), /* @__PURE__ */ u.jsx( ne, { flexDirection: "column", maxHeight: 72, overflowY: "scroll", borderRadius: "sm", paddingInlineEnd: 4, gap: 2, children: i.length > 0 ? I() : /* @__PURE__ */ u.jsx( ct, { fontWeight: "500", padding: 2, borderRadius: "sm", textAlign: "center", variant: "subtext", children: t("modelManager.noModelsFound") } ) } ) ] }) ] }); } const jT = 64, TT = 2048; function m9() { const e = xe(), { t } = Ce(), r = W( (g) => g.system.isProcessing ); function i(g) { return /\s/.test(g); } function s(g) { let S; return i(g) && (S = t("modelManager.cannotUseSpaces")), S; } const c = { name: "", description: "", config: "configs/stable-diffusion/v1-inference.yaml", weights: "", vae: "", width: 512, height: 512, format: "ckpt", default: !1 }, f = (g) => { e($p(g)), e(Au(null)); }, [m, y] = jt.useState(!1); return /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "flex-start", children: [ /* @__PURE__ */ u.jsx( Be, { "aria-label": t("common.back"), tooltip: t("common.back"), onClick: () => e(Au(null)), width: "max-content", position: "absolute", zIndex: 1, size: "sm", insetInlineEnd: 12, top: 3, icon: /* @__PURE__ */ u.jsx(QM, {}) } ), /* @__PURE__ */ u.jsx(v9, {}), /* @__PURE__ */ u.jsx( An, { label: t("modelManager.addManually"), isChecked: m, onChange: () => y(!m) } ), m && /* @__PURE__ */ u.jsx( uh, { initialValues: c, onSubmit: f, children: ({ handleSubmit: g, errors: S, touched: E }) => /* @__PURE__ */ u.jsx("form", { onSubmit: g, children: /* @__PURE__ */ u.jsxs(zt, { rowGap: 2, children: [ /* @__PURE__ */ u.jsx(ct, { fontSize: 20, fontWeight: "bold", alignSelf: "start", children: t("modelManager.manual") }), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!S.name && E.name, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "name", fontSize: "sm", children: t("modelManager.name") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "name", name: "name", type: "text", validate: s, width: "2xl" } ), S.name && E.name ? /* @__PURE__ */ u.jsx(La, { children: S.name }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.nameValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!S.description && E.description, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "description", fontSize: "sm", children: t("modelManager.description") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "description", name: "description", type: "text", width: "2xl" } ), S.description && E.description ? /* @__PURE__ */ u.jsx(La, { children: S.description }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.descriptionValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!S.config && E.config, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "config", fontSize: "sm", children: t("modelManager.config") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "config", name: "config", type: "text", width: "2xl" } ), S.config && E.config ? /* @__PURE__ */ u.jsx(La, { children: S.config }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.configValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!S.weights && E.weights, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "config", fontSize: "sm", children: t("modelManager.modelLocation") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "weights", name: "weights", type: "text", width: "2xl" } ), S.weights && E.weights ? /* @__PURE__ */ u.jsx(La, { children: S.weights }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.modelLocationValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs(dn, { isInvalid: !!S.vae && E.vae, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "vae", fontSize: "sm", children: t("modelManager.vaeLocation") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "vae", name: "vae", type: "text", width: "2xl" } ), S.vae && E.vae ? /* @__PURE__ */ u.jsx(La, { children: S.vae }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.vaeLocationValidationMsg") }) ] }) ] }), /* @__PURE__ */ u.jsxs(Gd, { width: "100%", children: [ /* @__PURE__ */ u.jsxs(dn, { isInvalid: !!S.width && E.width, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "width", fontSize: "sm", children: t("modelManager.width") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx(Hn, { id: "width", name: "width", children: ({ field: w, form: D }) => /* @__PURE__ */ u.jsx( Ns, { id: "width", name: "width", min: jT, max: TT, step: 64, width: "90%", value: D.values.width, onChange: (M) => D.setFieldValue(w.name, Number(M)) } ) }), S.width && E.width ? /* @__PURE__ */ u.jsx(La, { children: S.width }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.widthValidationMsg") }) ] }) ] }), /* @__PURE__ */ u.jsxs(dn, { isInvalid: !!S.height && E.height, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "height", fontSize: "sm", children: t("modelManager.height") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx(Hn, { id: "height", name: "height", children: ({ field: w, form: D }) => /* @__PURE__ */ u.jsx( Ns, { id: "height", name: "height", min: jT, max: TT, width: "90%", step: 64, value: D.values.height, onChange: (M) => D.setFieldValue(w.name, Number(M)) } ) }), S.height && E.height ? /* @__PURE__ */ u.jsx(La, { children: S.height }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.heightValidationMsg") }) ] }) ] }) ] }), /* @__PURE__ */ u.jsx( an, { type: "submit", className: "modal-close-btn", isLoading: r, children: t("modelManager.addModel") } ) ] }) }) } ) ] }); } function Rm({ children: e }) { return /* @__PURE__ */ u.jsx( ne, { sx: { flexDirection: "column", padding: 4, rowGap: 4, borderRadius: "base", width: "full", bg: "base.900" }, children: e } ); } function g9() { const e = xe(), { t } = Ce(), r = W( (m) => m.system.isProcessing ); function i(m) { return /\s/.test(m); } function s(m) { let y; return i(m) && (y = t("modelManager.cannotUseSpaces")), y; } const c = { name: "", description: "", repo_id: "", path: "", format: "diffusers", default: !1, vae: { repo_id: "", path: "" } }, f = (m) => { const y = m; m.path === "" && delete y.path, m.repo_id === "" && delete y.repo_id, m.vae.path === "" && delete y.vae.path, m.vae.repo_id === "" && delete y.vae.repo_id, e($p(y)), e(Au(null)); }; return /* @__PURE__ */ u.jsxs(ne, { children: [ /* @__PURE__ */ u.jsx( Be, { "aria-label": t("common.back"), tooltip: t("common.back"), onClick: () => e(Au(null)), width: "max-content", position: "absolute", zIndex: 1, size: "sm", insetInlineEnd: 12, top: 3, icon: /* @__PURE__ */ u.jsx(QM, {}) } ), /* @__PURE__ */ u.jsx( uh, { initialValues: c, onSubmit: f, children: ({ handleSubmit: m, errors: y, touched: g }) => { var S, E, w, D, M, k, R, O, I, A; return /* @__PURE__ */ u.jsx("form", { onSubmit: m, children: /* @__PURE__ */ u.jsxs(zt, { rowGap: 2, children: [ /* @__PURE__ */ u.jsx(Rm, { children: /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!y.name && g.name, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "name", fontSize: "sm", children: t("modelManager.name") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "name", name: "name", type: "text", validate: s, width: "2xl", isRequired: !0 } ), y.name && g.name ? /* @__PURE__ */ u.jsx(La, { children: y.name }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.nameValidationMsg") }) ] }) ] } ) }), /* @__PURE__ */ u.jsx(Rm, { children: /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!y.description && g.description, isRequired: !0, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "description", fontSize: "sm", children: t("modelManager.description") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "description", name: "description", type: "text", width: "2xl", isRequired: !0 } ), y.description && g.description ? /* @__PURE__ */ u.jsx(La, { children: y.description }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.descriptionValidationMsg") }) ] }) ] } ) }), /* @__PURE__ */ u.jsxs(Rm, { children: [ /* @__PURE__ */ u.jsx(ct, { fontWeight: "bold", fontSize: "sm", children: t("modelManager.formMessageDiffusersModelLocation") }), /* @__PURE__ */ u.jsx( ct, { sx: { fontSize: "sm", fontStyle: "italic" }, variant: "subtext", children: t("modelManager.formMessageDiffusersModelLocationDesc") } ), /* @__PURE__ */ u.jsxs(dn, { isInvalid: !!y.path && g.path, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "path", fontSize: "sm", children: t("modelManager.modelLocation") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "path", name: "path", type: "text", width: "2xl" } ), y.path && g.path ? /* @__PURE__ */ u.jsx(La, { children: y.path }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.modelLocationValidationMsg") }) ] }) ] }), /* @__PURE__ */ u.jsxs(dn, { isInvalid: !!y.repo_id && g.repo_id, children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "repo_id", fontSize: "sm", children: t("modelManager.repo_id") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "repo_id", name: "repo_id", type: "text", width: "2xl" } ), y.repo_id && g.repo_id ? /* @__PURE__ */ u.jsx(La, { children: y.repo_id }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.repoIDValidationMsg") }) ] }) ] }) ] }), /* @__PURE__ */ u.jsxs(Rm, { children: [ /* @__PURE__ */ u.jsx(ct, { fontWeight: "bold", children: t("modelManager.formMessageDiffusersVAELocation") }), /* @__PURE__ */ u.jsx( ct, { sx: { fontSize: "sm", fontStyle: "italic" }, variant: "subtext", children: t("modelManager.formMessageDiffusersVAELocationDesc") } ), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!((S = y.vae) != null && S.path) && ((E = g.vae) == null ? void 0 : E.path), children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "vae.path", fontSize: "sm", children: t("modelManager.vaeLocation") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "vae.path", name: "vae.path", type: "text", width: "2xl" } ), (w = y.vae) != null && w.path && ((D = g.vae) != null && D.path) ? /* @__PURE__ */ u.jsx(La, { children: (M = y.vae) == null ? void 0 : M.path }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.vaeLocationValidationMsg") }) ] }) ] } ), /* @__PURE__ */ u.jsxs( dn, { isInvalid: !!((k = y.vae) != null && k.repo_id) && ((R = g.vae) == null ? void 0 : R.repo_id), children: [ /* @__PURE__ */ u.jsx(Sn, { htmlFor: "vae.repo_id", fontSize: "sm", children: t("modelManager.vaeRepoID") }), /* @__PURE__ */ u.jsxs(zt, { alignItems: "start", children: [ /* @__PURE__ */ u.jsx( Hn, { as: zn, id: "vae.repo_id", name: "vae.repo_id", type: "text", width: "2xl" } ), (O = y.vae) != null && O.repo_id && ((I = g.vae) != null && I.repo_id) ? /* @__PURE__ */ u.jsx(La, { children: (A = y.vae) == null ? void 0 : A.repo_id }) : /* @__PURE__ */ u.jsx(Fa, { margin: 0, children: t("modelManager.vaeRepoIDValidationMsg") }) ] }) ] } ) ] }), /* @__PURE__ */ u.jsx(an, { type: "submit", isLoading: r, children: t("modelManager.addModel") }) ] }) }); } } ) ] }); } function DT({ text: e, onClick: t }) { return /* @__PURE__ */ u.jsx( ne, { position: "relative", width: "50%", height: 40, justifyContent: "center", alignItems: "center", onClick: t, as: mg, children: /* @__PURE__ */ u.jsx(ct, { fontWeight: "bold", children: e }) } ); } function y9() { const { isOpen: e, onOpen: t, onClose: r } = Ol(), i = W( (m) => m.ui.addNewModelUIOption ), s = xe(), { t: c } = Ce(), f = () => { r(), s(Au(null)); }; return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx( an, { "aria-label": c("modelManager.addNewModel"), tooltip: c("modelManager.addNewModel"), onClick: t, size: "sm", children: /* @__PURE__ */ u.jsxs(ne, { columnGap: 2, alignItems: "center", children: [ /* @__PURE__ */ u.jsx(Qp, {}), c("modelManager.addNew") ] }) } ), /* @__PURE__ */ u.jsxs( Al, { isOpen: e, onClose: f, size: "3xl", closeOnOverlayClick: !1, children: [ /* @__PURE__ */ u.jsx(Rs, {}), /* @__PURE__ */ u.jsxs(zl, { margin: "auto", paddingInlineEnd: 4, children: [ /* @__PURE__ */ u.jsx(ks, { children: c("modelManager.addNewModel") }), /* @__PURE__ */ u.jsx(Yd, {}), /* @__PURE__ */ u.jsxs(Ps, { children: [ i == null && /* @__PURE__ */ u.jsxs(ne, { columnGap: 4, children: [ /* @__PURE__ */ u.jsx( DT, { text: c("modelManager.addCheckpointModel"), onClick: () => s(Au("ckpt")) } ), /* @__PURE__ */ u.jsx( DT, { text: c("modelManager.addDiffuserModel"), onClick: () => s(Au("diffusers")) } ) ] }), i == "ckpt" && /* @__PURE__ */ u.jsx(m9, {}), i == "diffusers" && /* @__PURE__ */ u.jsx(g9, {}) ] }), /* @__PURE__ */ u.jsx(Ms, {}) ] }) ] } ) ] }); } var x9 = vb({ displayName: "EditIcon", path: /* @__PURE__ */ u.jsxs("g", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeWidth: "2", children: [ /* @__PURE__ */ u.jsx("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), /* @__PURE__ */ u.jsx("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" }) ] }) }), JM = vb({ displayName: "ExternalLinkIcon", path: /* @__PURE__ */ u.jsxs("g", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeWidth: "2", children: [ /* @__PURE__ */ u.jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }), /* @__PURE__ */ u.jsx("path", { d: "M15 3h6v6" }), /* @__PURE__ */ u.jsx("path", { d: "M10 14L21 3" }) ] }) }), S9 = vb({ displayName: "DeleteIcon", path: /* @__PURE__ */ u.jsx("g", { fill: "currentColor", children: /* @__PURE__ */ u.jsx("path", { d: "M19.452 7.5H4.547a.5.5 0 00-.5.545l1.287 14.136A2 2 0 007.326 24h9.347a2 2 0 001.992-1.819L19.95 8.045a.5.5 0 00-.129-.382.5.5 0 00-.369-.163zm-9.2 13a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zm5 0a.75.75 0 01-1.5 0v-9a.75.75 0 011.5 0zM22 4h-4.75a.25.25 0 01-.25-.25V2.5A2.5 2.5 0 0014.5 0h-5A2.5 2.5 0 007 2.5v1.25a.25.25 0 01-.25.25H2a1 1 0 000 2h20a1 1 0 000-2zM9 3.75V2.5a.5.5 0 01.5-.5h5a.5.5 0 01.5.5v1.25a.25.25 0 01-.25.25h-5.5A.25.25 0 019 3.75z" }) }) }); function Pm(e) { const { isProcessing: t, isConnected: r } = W( (D) => D.system ), i = W( (D) => D.system.openModel ), { t: s } = Ce(), c = xe(), { name: f, status: m, description: y } = e, g = () => { c(b2(f)); }, S = () => { c(ww(f)); }, E = () => { c(ZO(f)), c(ww(null)); }, w = () => { switch (m) { case "active": return "ok.500"; case "cached": return "warning.500"; case "not loaded": return "inherit"; } }; return /* @__PURE__ */ u.jsxs( ne, { alignItems: "center", p: 2, borderRadius: "base", sx: f === i ? { bg: "accent.750", _hover: { bg: "accent.750" } } : { _hover: { bg: "base.750" } }, children: [ /* @__PURE__ */ u.jsx(Ut, { onClick: S, cursor: "pointer", children: /* @__PURE__ */ u.jsx(Ea, { label: y, hasArrow: !0, placement: "bottom", children: /* @__PURE__ */ u.jsx(ct, { fontWeight: "600", children: f }) }) }), /* @__PURE__ */ u.jsx(Eg, { onClick: S, cursor: "pointer" }), /* @__PURE__ */ u.jsxs(ne, { gap: 2, alignItems: "center", children: [ /* @__PURE__ */ u.jsx(ct, { color: w(), children: m }), /* @__PURE__ */ u.jsx( mg, { size: "sm", onClick: g, isDisabled: m === "active" || t || !r, children: s("modelManager.load") } ), /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(x9, {}), size: "sm", onClick: S, "aria-label": s("accessibility.modifyConfig"), isDisabled: m === "active" || t || !r } ), /* @__PURE__ */ u.jsx( zg, { title: s("modelManager.deleteModel"), acceptCallback: E, acceptButtonText: s("modelManager.delete"), triggerComponent: /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(S9, {}), size: "sm", "aria-label": s("modelManager.deleteConfig"), isDisabled: m === "active" || t || !r, colorScheme: "error" } ), children: /* @__PURE__ */ u.jsxs(ne, { rowGap: 4, flexDirection: "column", children: [ /* @__PURE__ */ u.jsx("p", { style: { fontWeight: "bold" }, children: s("modelManager.deleteMsg1") }), /* @__PURE__ */ u.jsx("p", { children: s("modelManager.deleteMsg2") }) ] }) } ) ] }) ] } ); } function _T(e) { const { children: t, value: r } = e, [i, s] = C2("colors", ["base.800", "base.200"]); return /* @__PURE__ */ u.jsx("option", { value: r, style: { background: i, color: s }, children: t }); } const b9 = (e) => { const { label: t, isDisabled: r, validValues: i, tooltip: s, tooltipProps: c, ...f } = e; return /* @__PURE__ */ u.jsxs( dn, { isDisabled: r, onClick: (m) => { m.stopPropagation(), m.nativeEvent.stopImmediatePropagation(), m.nativeEvent.stopPropagation(), m.nativeEvent.cancelBubble = !0; }, children: [ t && /* @__PURE__ */ u.jsx(Sn, { children: t }), /* @__PURE__ */ u.jsx(Ea, { label: s, ...c, children: /* @__PURE__ */ u.jsx(B_, { ...f, children: i.map((m) => typeof m == "string" || typeof m == "number" ? /* @__PURE__ */ u.jsx(_T, { value: m, children: m }, m) : /* @__PURE__ */ u.jsx(_T, { value: m.value, children: m.key }, m.value)) }) }) ] } ); }, ni = Yr(b9), C9 = (e) => { const [t, r] = qe(!1), { label: i, value: s, min: c = 1, max: f = 100, step: m = 1, onChange: y, tooltipSuffix: g = "", withSliderMarks: S = !1, withInput: E = !1, isInteger: w = !1, inputWidth: D = 16, inputReadOnly: M = !1, withReset: k = !1, hideTooltip: R = !1, isCompact: O = !1, handleReset: I, isResetDisabled: A, isSliderDisabled: L, isInputDisabled: H, sliderFormControlProps: q, sliderFormLabelProps: U, sliderMarkProps: $, sliderTrackProps: ae, sliderThumbProps: oe, sliderNumberInputProps: Y, sliderNumberInputFieldProps: ve, sliderNumberInputStepperProps: de, sliderTooltipProps: fe, sliderIAIIconButtonProps: _e, ...Me } = e, { t: te } = Ce(), [K, se] = qe(String(s)); ot(() => { se(s); }, [s]); const B = Xt( () => Y != null && Y.max ? Y.max : f, [f, Y == null ? void 0 : Y.max] ), re = (be) => { y(be); }, ke = (be) => { be.target.value === "" && (be.target.value = String(c)); const Ie = Pe.clamp( w ? Math.floor(Number(be.target.value)) : Number(K), c, B ); y(Ie); }, De = (be) => { se(be); }, Se = () => { I && I(); }; return /* @__PURE__ */ u.jsxs( dn, { sx: O ? { display: "flex", flexDirection: "row", alignItems: "center", columnGap: 4, margin: 0, padding: 0 } : {}, ...q, children: [ /* @__PURE__ */ u.jsx(Sn, { ...U, mb: -1, children: i }), /* @__PURE__ */ u.jsxs(Gd, { w: "100%", gap: 2, alignItems: "center", children: [ /* @__PURE__ */ u.jsxs( G_, { "aria-label": i, value: s, min: c, max: f, step: m, onChange: re, onMouseEnter: () => r(!0), onMouseLeave: () => r(!1), focusThumbOnChange: !1, isDisabled: L, ...Me, children: [ S && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx( FS, { value: c, sx: { insetInlineStart: "0 !important", insetInlineEnd: "unset !important" }, ...$, children: c } ), /* @__PURE__ */ u.jsx( FS, { value: f, sx: { insetInlineStart: "unset !important", insetInlineEnd: "0 !important" }, ...$, children: f } ) ] }), /* @__PURE__ */ u.jsx(Y_, { ...ae, children: /* @__PURE__ */ u.jsx(K_, {}) }), /* @__PURE__ */ u.jsx( Ea, { hasArrow: !0, placement: "top", isOpen: t, label: `${s}${g}`, hidden: R, ...fe, children: /* @__PURE__ */ u.jsx(q_, { ...oe }) } ) ] } ), E && /* @__PURE__ */ u.jsxs( Ub, { min: c, max: B, step: m, value: K, onChange: De, onBlur: ke, isDisabled: H, ...Y, children: [ /* @__PURE__ */ u.jsx( Vb, { readOnly: M, minWidth: D, ...ve } ), /* @__PURE__ */ u.jsxs(Hb, { ...de, children: [ /* @__PURE__ */ u.jsx( Gb, { onClick: () => y(Number(K)) } ), /* @__PURE__ */ u.jsx( Wb, { onClick: () => y(Number(K)) } ) ] }) ] } ), k && /* @__PURE__ */ u.jsx( Be, { size: "sm", "aria-label": te("accessibility.reset"), tooltip: "Reset", icon: /* @__PURE__ */ u.jsx(s1, {}), onClick: Se, isDisabled: A, ..._e } ) ] }) ] } ); }, jn = Yr(C9); function E9() { const e = xe(), { isOpen: t, onOpen: r, onClose: i } = Ol(), s = W($B), { t: c } = Ce(), [f, m] = qe( Object.keys(s)[0] ), [y, g] = qe( Object.keys(s)[1] ), [S, E] = qe("none"), [w, D] = qe(""), [M, k] = qe(0.5), [R, O] = qe("weighted_sum"), [I, A] = qe("root"), [L, H] = qe(""), [q, U] = qe(!1), $ = Object.keys(s).filter( (de) => de !== y && de !== S ), ae = Object.keys(s).filter( (de) => de !== f && de !== S ), oe = [ { key: c("modelManager.none"), value: "none" }, ...Object.keys(s).filter((de) => de !== f && de !== y).map((de) => ({ key: de, value: de })) ], Y = W( (de) => de.system.isProcessing ), ve = () => { let de = [f, y, S]; de = de.filter((_e) => _e !== "none"); const fe = { models_to_merge: de, merged_model_name: w !== "" ? w : de.join("-"), alpha: M, interp: R, model_merge_save_path: I === "root" ? null : L, force: q }; e(JO(fe)); }; return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx(an, { onClick: r, size: "sm", children: /* @__PURE__ */ u.jsx(ne, { columnGap: 2, alignItems: "center", children: c("modelManager.mergeModels") }) }), /* @__PURE__ */ u.jsxs( Al, { isOpen: t, onClose: i, size: "4xl", closeOnOverlayClick: !1, children: [ /* @__PURE__ */ u.jsx(Rs, {}), /* @__PURE__ */ u.jsxs(zl, { fontFamily: "Inter", margin: "auto", paddingInlineEnd: 4, children: [ /* @__PURE__ */ u.jsx(ks, { children: c("modelManager.mergeModels") }), /* @__PURE__ */ u.jsx(Yd, {}), /* @__PURE__ */ u.jsx(Ps, { children: /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", rowGap: 4, children: [ /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", marginBottom: 4, padding: 4, borderRadius: "base", rowGap: 1, bg: "base.900" }, children: [ /* @__PURE__ */ u.jsx(ct, { children: c("modelManager.modelMergeHeaderHelp1") }), /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", variant: "subtext", children: c("modelManager.modelMergeHeaderHelp2") }) ] } ), /* @__PURE__ */ u.jsxs(ne, { columnGap: 4, children: [ /* @__PURE__ */ u.jsx( ni, { label: c("modelManager.modelOne"), validValues: $, onChange: (de) => m(de.target.value) } ), /* @__PURE__ */ u.jsx( ni, { label: c("modelManager.modelTwo"), validValues: ae, onChange: (de) => g(de.target.value) } ), /* @__PURE__ */ u.jsx( ni, { label: c("modelManager.modelThree"), validValues: oe, onChange: (de) => { de.target.value !== "none" ? (E(de.target.value), O("add_difference")) : (E("none"), O("weighted_sum")); } } ) ] }), /* @__PURE__ */ u.jsx( zn, { label: c("modelManager.mergedModelName"), value: w, onChange: (de) => D(de.target.value) } ), /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", padding: 4, borderRadius: "base", gap: 4, bg: "base.900" }, children: [ /* @__PURE__ */ u.jsx( jn, { label: c("modelManager.alpha"), min: 0.01, max: 0.99, step: 0.01, value: M, onChange: (de) => k(de), withInput: !0, withReset: !0, handleReset: () => k(0.5), withSliderMarks: !0 } ), /* @__PURE__ */ u.jsx(ct, { variant: "subtext", fontSize: "sm", children: c("modelManager.modelMergeAlphaHelp") }) ] } ), /* @__PURE__ */ u.jsxs( ne, { sx: { padding: 4, borderRadius: "base", gap: 4, bg: "base.900" }, children: [ /* @__PURE__ */ u.jsx(ct, { fontWeight: 500, fontSize: "sm", variant: "subtext", children: c("modelManager.interpolationType") }), /* @__PURE__ */ u.jsx( Hp, { value: R, onChange: (de) => O(de), children: /* @__PURE__ */ u.jsx(ne, { columnGap: 4, children: S === "none" ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx(Ba, { value: "weighted_sum", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: c("modelManager.weightedSum") }) }), /* @__PURE__ */ u.jsx(Ba, { value: "sigmoid", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: c("modelManager.sigmoid") }) }), /* @__PURE__ */ u.jsx(Ba, { value: "inv_sigmoid", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: c("modelManager.inverseSigmoid") }) }) ] }) : /* @__PURE__ */ u.jsx(Ba, { value: "add_difference", children: /* @__PURE__ */ u.jsx( Ea, { label: c( "modelManager.modelMergeInterpAddDifferenceHelp" ), children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: c("modelManager.addDifference") }) } ) }) }) } ) ] } ), /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", padding: 4, borderRadius: "base", gap: 4, bg: "base.900" }, children: [ /* @__PURE__ */ u.jsxs(ne, { columnGap: 4, children: [ /* @__PURE__ */ u.jsx(ct, { fontWeight: "500", fontSize: "sm", variant: "subtext", children: c("modelManager.mergedModelSaveLocation") }), /* @__PURE__ */ u.jsx( Hp, { value: I, onChange: (de) => A(de), children: /* @__PURE__ */ u.jsxs(ne, { columnGap: 4, children: [ /* @__PURE__ */ u.jsx(Ba, { value: "root", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: c("modelManager.invokeAIFolder") }) }), /* @__PURE__ */ u.jsx(Ba, { value: "custom", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "sm", children: c("modelManager.custom") }) }) ] }) } ) ] }), I === "custom" && /* @__PURE__ */ u.jsx( zn, { label: c("modelManager.mergedModelCustomSaveLocation"), value: L, onChange: (de) => H(de.target.value) } ) ] } ), /* @__PURE__ */ u.jsx( An, { label: c("modelManager.ignoreMismatch"), isChecked: q, onChange: (de) => U(de.target.checked), fontWeight: "500" } ), /* @__PURE__ */ u.jsx( an, { onClick: ve, isLoading: Y, isDisabled: I === "custom" && L === "", children: c("modelManager.merge") } ) ] }) }), /* @__PURE__ */ u.jsx(Ms, {}) ] }) ] } ) ] }); } const w9 = Ze( Vn, (e) => Pe.map(e.model_list, (r, i) => ({ name: i, ...r })), { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function tS({ label: e, isActive: t, onClick: r }) { return /* @__PURE__ */ u.jsx( an, { onClick: r, isActive: t, sx: { _active: { bg: "accent.750" } }, size: "sm", children: e } ); } const j9 = () => { const e = W(w9), [t, r] = jt.useState(!1); jt.useEffect(() => { const w = setTimeout(() => { r(!0); }, 200); return () => clearTimeout(w); }, []); const [i, s] = qe(""), [c, f] = qe("all"), [m, y] = oI(), { t: g } = Ce(), S = (w) => { y(() => { s(w.target.value); }); }, E = Xt(() => { const w = [], D = [], M = [], k = []; return e.forEach((R, O) => { R.name.toLowerCase().includes(i.toLowerCase()) && (M.push( /* @__PURE__ */ u.jsx( Pm, { name: R.name, status: R.status, description: R.description }, O ) ), R.format === c && k.push( /* @__PURE__ */ u.jsx( Pm, { name: R.name, status: R.status, description: R.description }, O ) )), R.format !== "diffusers" ? w.push( /* @__PURE__ */ u.jsx( Pm, { name: R.name, status: R.status, description: R.description }, O ) ) : D.push( /* @__PURE__ */ u.jsx( Pm, { name: R.name, status: R.status, description: R.description }, O ) ); }), i !== "" ? c === "all" ? /* @__PURE__ */ u.jsx(Ut, { marginTop: 4, children: M }) : /* @__PURE__ */ u.jsx(Ut, { marginTop: 4, children: k }) : /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", rowGap: 6, children: [ c === "all" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsxs(Ut, { children: [ /* @__PURE__ */ u.jsx( ct, { sx: { fontWeight: "500", py: 2, px: 4, my: 4, mx: 0, borderRadius: "base", width: "max-content", fontSize: "sm", bg: "base.750" }, children: g("modelManager.checkpointModels") } ), w ] }), /* @__PURE__ */ u.jsxs(Ut, { children: [ /* @__PURE__ */ u.jsx( ct, { sx: { fontWeight: "500", py: 2, px: 4, mb: 4, borderRadius: "base", width: "max-content", fontSize: "sm", bg: "base.750" }, children: g("modelManager.diffusersModels") } ), D ] }) ] }), c === "ckpt" && /* @__PURE__ */ u.jsx(ne, { flexDirection: "column", marginTop: 4, children: w }), c === "diffusers" && /* @__PURE__ */ u.jsx(ne, { flexDirection: "column", marginTop: 4, children: D }) ] }); }, [e, i, g, c]); return /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", rowGap: 4, width: "50%", minWidth: "50%", children: [ /* @__PURE__ */ u.jsxs(ne, { justifyContent: "space-between", alignItems: "center", gap: 2, children: [ /* @__PURE__ */ u.jsx(Ni, { size: "md", children: g("modelManager.availableModels") }), /* @__PURE__ */ u.jsx(Eg, {}), /* @__PURE__ */ u.jsx(y9, {}), /* @__PURE__ */ u.jsx(E9, {}) ] }), /* @__PURE__ */ u.jsx( zn, { onChange: S, label: g("modelManager.search") } ), /* @__PURE__ */ u.jsxs( ne, { flexDirection: "column", gap: 1, maxHeight: window.innerHeight - 240, overflow: "scroll", paddingInlineEnd: 4, children: [ /* @__PURE__ */ u.jsxs(ne, { columnGap: 2, children: [ /* @__PURE__ */ u.jsx( tS, { label: g("modelManager.allModels"), onClick: () => f("all"), isActive: c === "all" } ), /* @__PURE__ */ u.jsx( tS, { label: g("modelManager.checkpointModels"), onClick: () => f("ckpt"), isActive: c === "ckpt" } ), /* @__PURE__ */ u.jsx( tS, { label: g("modelManager.diffusersModels"), onClick: () => f("diffusers"), isActive: c === "diffusers" } ) ] }), t ? E : /* @__PURE__ */ u.jsx( ne, { width: "100%", minHeight: 96, justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ u.jsx(E2, {}) } ) ] } ) ] }); }; function T9({ children: e }) { const { isOpen: t, onOpen: r, onClose: i } = Ol(), s = W( (m) => m.system.model_list ), c = W( (m) => m.system.openModel ), { t: f } = Ce(); return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ Ll(e, { onClick: r }), /* @__PURE__ */ u.jsxs( Al, { isOpen: t, onClose: i, size: "full", children: [ /* @__PURE__ */ u.jsx(Rs, {}), /* @__PURE__ */ u.jsxs(zl, { children: [ /* @__PURE__ */ u.jsx(Yd, {}), /* @__PURE__ */ u.jsx(ks, { children: f("modelManager.modelManager") }), /* @__PURE__ */ u.jsx(Ps, { children: /* @__PURE__ */ u.jsxs(ne, { width: "100%", columnGap: 8, children: [ /* @__PURE__ */ u.jsx(j9, {}), c && s[c].format === "diffusers" ? /* @__PURE__ */ u.jsx(l9, {}) : /* @__PURE__ */ u.jsx(o9, {}) ] }) }), /* @__PURE__ */ u.jsx(Ms, {}) ] }) ] } ) ] }); } const D9 = Ze( [Vn], (e) => { const { isProcessing: t, model_list: r } = e; return { models: Pe.map(r, (s, c) => c), isProcessing: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), _9 = () => { const e = xe(), { t } = Ce(), { models: r, isProcessing: i } = W(D9), s = W(SM), c = (f) => { e(b2(f.target.value)); }; return /* @__PURE__ */ u.jsx( ne, { style: { paddingInlineStart: 1.5 }, children: /* @__PURE__ */ u.jsx( ni, { style: { fontSize: "sm" }, "aria-label": t("accessibility.modelSelect"), tooltip: s.description, isDisabled: i, value: s.name, validValues: r, onChange: c } ) } ); }, M9 = (e) => { const { label: t, isDisabled: r = !1, width: i = "auto", formControlProps: s, formLabelProps: c, ...f } = e; return /* @__PURE__ */ u.jsxs( dn, { isDisabled: r, width: i, display: "flex", gap: 4, alignItems: "center", justifyContent: "space-between", ...s, children: [ /* @__PURE__ */ u.jsx(Sn, { my: 1, ...c, children: t }), /* @__PURE__ */ u.jsx(X_, { ...f }) ] } ); }, ti = Yr(M9), k9 = Ze( [Vn, $o], (e, t) => { const { shouldDisplayInProgressType: r, shouldConfirmOnDelete: i, shouldDisplayGuides: s, model_list: c, saveIntermediatesInterval: f, enableImageDebugging: m } = e, { shouldUseCanvasBetaLayout: y, shouldUseSliders: g } = t; return { shouldDisplayInProgressType: r, shouldConfirmOnDelete: i, shouldDisplayGuides: s, models: Pe.map(c, (S, E) => E), saveIntermediatesInterval: f, enableImageDebugging: m, shouldUseCanvasBetaLayout: y, shouldUseSliders: g }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), nS = { flexDirection: "column", gap: 2, p: 4, bg: "base.900" }, R9 = ({ children: e }) => { const t = xe(), { t: r } = Ce(), i = W((A) => A.generation.steps), { isOpen: s, onOpen: c, onClose: f } = Ol(), { isOpen: m, onOpen: y, onClose: g } = Ol(), { shouldDisplayInProgressType: S, shouldConfirmOnDelete: E, shouldDisplayGuides: w, saveIntermediatesInterval: D, enableImageDebugging: M, shouldUseCanvasBetaLayout: k, shouldUseSliders: R } = W(k9), O = () => { oA.purge().then(() => { f(), y(); }); }, I = (A) => { A > i && (A = i), A < 1 && (A = 1), t(sA(A)); }; return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ Ll(e, { onClick: c }), /* @__PURE__ */ u.jsxs( Al, { isOpen: s, onClose: f, size: "xl", children: [ /* @__PURE__ */ u.jsx(Rs, {}), /* @__PURE__ */ u.jsxs(zl, { paddingInlineEnd: 4, children: [ /* @__PURE__ */ u.jsx(ks, { children: r("common.settingsLabel") }), /* @__PURE__ */ u.jsx(Yd, {}), /* @__PURE__ */ u.jsx(Ps, { children: /* @__PURE__ */ u.jsxs(uo, { gap: 4, children: [ /* @__PURE__ */ u.jsxs(ne, { sx: nS, children: [ /* @__PURE__ */ u.jsx( ni, { label: r("settings.displayInProgress"), validValues: eA, value: S, onChange: (A) => t( tA( A.target.value ) ) } ), S === "full-res" && /* @__PURE__ */ u.jsx( Ns, { label: r("settings.saveSteps"), min: 1, max: i, step: 1, onChange: I, value: D, width: "auto", textAlign: "center" } ), /* @__PURE__ */ u.jsx( ti, { label: r("settings.confirmOnDelete"), isChecked: E, onChange: (A) => t(w2(A.target.checked)) } ), /* @__PURE__ */ u.jsx( ti, { label: r("settings.displayHelpIcons"), isChecked: w, onChange: (A) => t(nA(A.target.checked)) } ), /* @__PURE__ */ u.jsx( ti, { label: r("settings.useCanvasBeta"), isChecked: k, onChange: (A) => t(rA(A.target.checked)) } ), /* @__PURE__ */ u.jsx( ti, { label: r("settings.useSlidersForAll"), isChecked: R, onChange: (A) => t(aA(A.target.checked)) } ) ] }), /* @__PURE__ */ u.jsxs(ne, { sx: nS, children: [ /* @__PURE__ */ u.jsx(Ni, { size: "sm", style: { fontWeight: "bold" }, children: "Developer" }), /* @__PURE__ */ u.jsx( ti, { label: r("settings.enableImageDebugging"), isChecked: M, onChange: (A) => t(iA(A.target.checked)) } ) ] }), /* @__PURE__ */ u.jsxs(ne, { sx: nS, children: [ /* @__PURE__ */ u.jsx(Ni, { size: "sm", children: r("settings.resetWebUI") }), /* @__PURE__ */ u.jsx(an, { colorScheme: "error", onClick: O, children: r("settings.resetWebUI") }), /* @__PURE__ */ u.jsx(ct, { children: r("settings.resetWebUIDesc1") }), /* @__PURE__ */ u.jsx(ct, { children: r("settings.resetWebUIDesc2") }) ] }) ] }) }), /* @__PURE__ */ u.jsx(Ms, { children: /* @__PURE__ */ u.jsx(an, { onClick: f, children: r("common.close") }) }) ] }) ] } ), /* @__PURE__ */ u.jsxs( Al, { closeOnOverlayClick: !1, isOpen: m, onClose: g, isCentered: !0, children: [ /* @__PURE__ */ u.jsx(Rs, { backdropFilter: "blur(40px)" }), /* @__PURE__ */ u.jsxs(zl, { children: [ /* @__PURE__ */ u.jsx(ks, {}), /* @__PURE__ */ u.jsx(Ps, { children: /* @__PURE__ */ u.jsx(ne, { justifyContent: "center", children: /* @__PURE__ */ u.jsx(ct, { fontSize: "lg", children: /* @__PURE__ */ u.jsx(ct, { children: r("settings.resetComplete") }) }) }) }), /* @__PURE__ */ u.jsx(Ms, {}) ] }) ] } ) ] }); }, P9 = Ze( Vn, (e) => ({ isConnected: e.isConnected, isProcessing: e.isProcessing, currentIteration: e.currentIteration, totalIterations: e.totalIterations, currentStatus: e.currentStatus, hasError: e.hasError, wasErrorSeen: e.wasErrorSeen }), { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), N9 = () => { const { isConnected: e, isProcessing: t, currentIteration: r, totalIterations: i, currentStatus: s, hasError: c, wasErrorSeen: f } = W(P9), m = xe(), { t: y } = Ce(); let g; e && !c ? g = "ok" : g = "error"; let S = s; t && (g = "working"), S && t && i > 1 && (S = `${y( S )} (${r}/${i})`); const E = c && !f ? "Click to clear, check logs for details" : void 0, w = c && !f ? "pointer" : "initial", D = () => { (c || !f) && m(S2()); }; return /* @__PURE__ */ u.jsx(Ea, { label: E, children: /* @__PURE__ */ u.jsx( ct, { cursor: w, onClick: D, sx: { fontSize: "xs", fontWeight: "600", color: `${g}.400` }, children: y(S) } ) }); }; function O9() { const { t: e, i18n: t } = Ce(), r = { ar: e("common.langArabic", { lng: "ar" }), nl: e("common.langDutch", { lng: "nl" }), en: e("common.langEnglish", { lng: "en" }), fr: e("common.langFrench", { lng: "fr" }), de: e("common.langGerman", { lng: "de" }), he: e("common.langHebrew", { lng: "he" }), it: e("common.langItalian", { lng: "it" }), ja: e("common.langJapanese", { lng: "ja" }), ko: e("common.langKorean", { lng: "ko" }), pl: e("common.langPolish", { lng: "pl" }), pt_BR: e("common.langBrPortuguese", { lng: "pt_BR" }), pt: e("common.langPortuguese", { lng: "pt" }), ru: e("common.langRussian", { lng: "ru" }), zh_CN: e("common.langSimplifiedChinese", { lng: "zh_CN" }), es: e("common.langSpanish", { lng: "es" }), uk: e("common.langUkranian", { lng: "ua" }) }, i = () => { const s = []; return Object.keys(r).forEach((c) => { s.push( /* @__PURE__ */ u.jsx( an, { isChecked: localStorage.getItem("i18nextLng") === c, leftIcon: localStorage.getItem("i18nextLng") === c ? /* @__PURE__ */ u.jsx(ob, {}) : void 0, onClick: () => t.changeLanguage(c), "aria-label": r[c], size: "sm", minWidth: "200px", children: r[c] }, c ) ); }), s; }; return /* @__PURE__ */ u.jsx( Wo, { trigger: "hover", triggerComponent: /* @__PURE__ */ u.jsx( Be, { "aria-label": e("common.languagePickerLabel"), tooltip: e("common.languagePickerLabel"), icon: /* @__PURE__ */ u.jsx(lA, {}), size: "sm", variant: "link", "data-variant": "link", fontSize: 26 } ), children: /* @__PURE__ */ u.jsx(zt, { children: i() }) } ); } function A9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M16.5 9c-.42 0-.83.04-1.24.11L1.01 3 1 10l9 2-9 2 .01 7 8.07-3.46C9.59 21.19 12.71 24 16.5 24c4.14 0 7.5-3.36 7.5-7.5S20.64 9 16.5 9zm0 13c-3.03 0-5.5-2.47-5.5-5.5s2.47-5.5 5.5-5.5 5.5 2.47 5.5 5.5-2.47 5.5-5.5 5.5z" } }, { tag: "path", attr: { d: "M18.27 14.03l-1.77 1.76-1.77-1.76-.7.7 1.76 1.77-1.76 1.77.7.7 1.77-1.76 1.77 1.76.7-.7-1.76-1.77 1.76-1.77z" } }] })(e); } function z9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z" } }] })(e); } function I9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" } }, { tag: "path", attr: { d: "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" } }] })(e); } function F9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z" } }] })(e); } function L9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" } }, { tag: "path", attr: { d: "M17 16l-4-4V8.82C14.16 8.4 15 7.3 15 6c0-1.66-1.34-3-3-3S9 4.34 9 6c0 1.3.84 2.4 2 2.82V12l-4 4H3v5h5v-3.05l4-4.2 4 4.2V21h5v-5h-4z" } }] })(e); } function B9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M7 2v11h3v9l7-12h-4l4-8z" } }] })(e); } function MT(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z" } }] })(e); } function U9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z" } }] })(e); } function H9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" } }, { tag: "path", attr: { d: "M19.02 10v9H5V5h9V3H5.02c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2zM17 10l.94-2.06L20 7l-2.06-.94L17 4l-.94 2.06L14 7l2.06.94zm-3.75.75L12 8l-1.25 2.75L8 12l2.75 1.25L12 16l1.25-2.75L16 12z" } }] })(e); } function l1(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z" } }] })(e); } function V9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z" } }] })(e); } function W9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M7 10l5 5 5-5z" } }] })(e); } function G9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M7 14l5-5 5 5z" } }] })(e); } function q9(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" } }, { tag: "path", attr: { d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" } }] })(e); } const ek = () => { const { t: e } = Ce(); return /* @__PURE__ */ u.jsxs(uo, { gridTemplateColumns: "auto max-content", children: [ /* @__PURE__ */ u.jsx(j2, {}), /* @__PURE__ */ u.jsxs(ne, { alignItems: "center", gap: 2, children: [ /* @__PURE__ */ u.jsx(N9, {}), /* @__PURE__ */ u.jsx(_9, {}), /* @__PURE__ */ u.jsx(T9, { children: /* @__PURE__ */ u.jsx( Be, { "aria-label": e("modelManager.modelManager"), tooltip: e("modelManager.modelManager"), size: "sm", variant: "link", "data-variant": "link", fontSize: 20, icon: /* @__PURE__ */ u.jsx(uA, {}) } ) }), /* @__PURE__ */ u.jsx(l6, { children: /* @__PURE__ */ u.jsx( Be, { "aria-label": e("common.hotkeysLabel"), tooltip: e("common.hotkeysLabel"), size: "sm", variant: "link", "data-variant": "link", fontSize: 20, icon: /* @__PURE__ */ u.jsx(cA, {}) } ) }), /* @__PURE__ */ u.jsx(dA, {}), /* @__PURE__ */ u.jsx(O9, {}), /* @__PURE__ */ u.jsx( Fu, { isExternal: !0, href: "http://github.com/invoke-ai/InvokeAI/issues", marginBottom: "-0.25rem", children: /* @__PURE__ */ u.jsx( Be, { "aria-label": e("common.reportBugLabel"), tooltip: e("common.reportBugLabel"), variant: "link", "data-variant": "link", fontSize: 20, size: "sm", icon: /* @__PURE__ */ u.jsx(fA, {}) } ) } ), /* @__PURE__ */ u.jsx( Fu, { isExternal: !0, href: "http://github.com/invoke-ai/InvokeAI", marginBottom: "-0.25rem", children: /* @__PURE__ */ u.jsx( Be, { "aria-label": e("common.githubLabel"), tooltip: e("common.githubLabel"), variant: "link", "data-variant": "link", fontSize: 20, size: "sm", icon: /* @__PURE__ */ u.jsx(pA, {}) } ) } ), /* @__PURE__ */ u.jsx( Fu, { isExternal: !0, href: "https://discord.gg/ZmtBAhwWhy", marginBottom: "-0.25rem", children: /* @__PURE__ */ u.jsx( Be, { "aria-label": e("common.discordLabel"), tooltip: e("common.discordLabel"), variant: "link", "data-variant": "link", fontSize: 20, size: "sm", icon: /* @__PURE__ */ u.jsx(hA, {}) } ) } ), /* @__PURE__ */ u.jsx(R9, { children: /* @__PURE__ */ u.jsx( Be, { "aria-label": e("common.settingsLabel"), tooltip: e("common.settingsLabel"), variant: "link", "data-variant": "link", fontSize: 22, size: "sm", icon: /* @__PURE__ */ u.jsx(I9, {}) } ) }) ] }) ] }); }; ek.displayName = "SiteHeader"; const u1 = (e) => { const { children: t } = e; return /* @__PURE__ */ u.jsx( ne, { sx: { width: "100%", height: "100%", bg: "base.850" }, children: t } ); }; function Y9() { const { t: e } = Ce(); return /* @__PURE__ */ u.jsx(u1, { children: /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", alignItems: "center", justifyContent: "center", w: "100%", h: "100%", gap: 4, textAlign: "center" }, children: [ /* @__PURE__ */ u.jsx(Ni, { children: e("common.nodes") }), /* @__PURE__ */ u.jsx(zt, { maxW: "50rem", gap: 4, children: /* @__PURE__ */ u.jsx(ct, { children: e("common.nodesDesc") }) }) ] } ) }); } const K9 = () => { const { t: e } = Ce(); return /* @__PURE__ */ u.jsx(u1, { children: /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", alignItems: "center", justifyContent: "center", w: "100%", h: "100%", gap: 4, textAlign: "center" }, children: [ /* @__PURE__ */ u.jsx(Ni, { children: e("common.postProcessing") }), /* @__PURE__ */ u.jsxs(zt, { maxW: "50rem", gap: 4, children: [ /* @__PURE__ */ u.jsx(ct, { children: e("common.postProcessDesc1") }), /* @__PURE__ */ u.jsx(ct, { children: e("common.postProcessDesc2") }), /* @__PURE__ */ u.jsx(ct, { children: e("common.postProcessDesc3") }) ] }) ] } ) }); }; function X9() { const { t: e } = Ce(); return /* @__PURE__ */ u.jsx(u1, { children: /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", alignItems: "center", justifyContent: "center", w: "100%", h: "100%", gap: 4, textAlign: "center" }, children: [ /* @__PURE__ */ u.jsx(Ni, { children: e("common.training") }), /* @__PURE__ */ u.jsxs(zt, { maxW: "50rem", gap: 4, children: [ /* @__PURE__ */ u.jsx(ct, { children: e("common.trainingDesc1") }), /* @__PURE__ */ u.jsx(ct, { children: e("common.trainingDesc2") }) ] }) ] } ) }); } const ch = Ze( (e) => e.lightbox, (e) => e, { memoizeOptions: { equalityCheck: Pe.isEqual } } ), Fs = (e) => e.gallery, $9 = Ze( [Fs, $o, ch, Bn], (e, t, r, i) => { const { categories: s, currentCategory: c, currentImageUuid: f, galleryImageMinimumWidth: m, galleryImageObjectFit: y, shouldAutoSwitchToNewImages: g, galleryWidth: S, shouldUseSingleGalleryColumn: E } = e, { shouldPinGallery: w } = t, { isLightboxOpen: D } = r; return { currentImageUuid: f, shouldPinGallery: w, galleryImageMinimumWidth: m, galleryImageObjectFit: y, galleryGridTemplateColumns: E ? "auto" : `repeat(auto-fill, minmax(${m}px, auto))`, shouldAutoSwitchToNewImages: g, currentCategory: c, images: s[c].images, areMoreImagesAvailable: s[c].areMoreImagesAvailable, galleryWidth: S, shouldEnableResize: !(D || i === "unifiedCanvas" && w), shouldUseSingleGalleryColumn: E }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), Q9 = Ze( [Fs, Vn, ch, Bn], (e, t, r, i) => ({ mayDeleteImage: t.isConnected && !t.isProcessing, galleryImageObjectFit: e.galleryImageObjectFit, galleryImageMinimumWidth: e.galleryImageMinimumWidth, shouldUseSingleGalleryColumn: e.shouldUseSingleGalleryColumn, activeTabName: i, isLightboxOpen: r.isLightboxOpen }), { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), Z9 = Ze(Fs, (e) => ({ resultImages: e.categories.result.images, userImages: e.categories.user.images })), J9 = () => { const { resultImages: e, userImages: t } = W(Z9); return (r) => { const i = e.find( (c) => c.uuid === r ); if (i) return i; const s = t.find((c) => c.uuid === r); if (s) return s; }; }, eV = ({ direction: e, langDirection: t }) => ({ top: e === "bottom", right: t !== "rtl" && e === "left" || t === "rtl" && e === "right", bottom: e === "top", left: t !== "rtl" && e === "right" || t === "rtl" && e === "left" }), tV = ({ direction: e, minWidth: t, maxWidth: r, minHeight: i, maxHeight: s }) => { const c = t ?? (["left", "right"].includes(e) ? 10 : void 0), f = r ?? (["left", "right"].includes(e) ? "95vw" : void 0), m = i ?? (["top", "bottom"].includes(e) ? 10 : void 0), y = s ?? (["top", "bottom"].includes(e) ? "95vh" : void 0); return { ...c ? { minWidth: c } : {}, ...f ? { maxWidth: f } : {}, ...m ? { minHeight: m } : {}, ...y ? { maxHeight: y } : {} }; }, Ts = "0.75rem", Nm = "1rem", nV = "2px", rV = "5px", aV = ({ isPinned: e, isResizable: t, direction: r }) => { if (!t) return { containerStyles: {}, handleStyles: {} }; const i = e ? nV : rV, s = `calc((2 * ${Ts} + ${i}) / -2)`; return r === "top" ? { containerStyles: { borderBottomWidth: i, paddingBottom: Nm }, handleStyles: { top: { paddingTop: Ts, paddingBottom: Ts, bottom: s } } } : r === "left" ? { containerStyles: { borderInlineEndWidth: i, paddingInlineEnd: Nm }, handleStyles: { right: { paddingInlineStart: Ts, paddingInlineEnd: Ts, insetInlineEnd: s } } } : r === "bottom" ? { containerStyles: { borderTopWidth: i, paddingTop: Nm }, handleStyles: { bottom: { paddingTop: Ts, paddingBottom: Ts, top: s } } } : r === "right" ? { containerStyles: { borderInlineStartWidth: i, paddingInlineStart: Nm }, handleStyles: { left: { paddingInlineStart: Ts, paddingInlineEnd: Ts, insetInlineStart: s } } } : { containerStyles: {}, handleStyles: {} }; }, iV = (e, t) => ["top", "bottom"].includes(e) ? e : e === "left" ? t === "rtl" ? "right" : "left" : e === "right" ? t === "rtl" ? "left" : "right" : "left", jl = (e, t) => { if (e) return t ? e + t : e; }, oV = $e(xM, { shouldForwardProp: (e) => !["sx"].includes(e) }), tk = ({ direction: e = "left", isResizable: t, isPinned: r, isOpen: i, onClose: s, children: c, initialWidth: f, minWidth: m, maxWidth: y, initialHeight: g, minHeight: S, maxHeight: E, onResizeStart: w, onResizeStop: D, onResize: M, sx: k = {} }) => { const R = hg().direction, O = Xe(null), I = Xt( () => f ?? m ?? (["left", "right"].includes(e) ? 500 : "100%"), [f, m, e] ), A = Xt( () => g ?? S ?? (["top", "bottom"].includes(e) ? 500 : "100%"), [g, S, e] ), [L, H] = qe(I), [q, U] = qe(A); W5({ ref: O, handler: () => { r || s(); } }); const $ = Xt( () => t ? eV({ direction: e, langDirection: R }) : {}, [t, R, e] ), ae = Xt( () => tV({ direction: e, minWidth: t ? jl(m, 18) : jl(m), maxWidth: t ? jl(y, 18) : jl(y), minHeight: t ? jl(S, 18) : jl(S), maxHeight: t ? jl(E, 18) : jl(E) }), [m, y, S, E, e, t] ), { containerStyles: oe, handleStyles: Y } = Xt( () => aV({ isPinned: r, isResizable: t, direction: e }), [r, t, e] ), ve = Xt( () => iV(e, R), [e, R] ); return ot(() => { ["left", "right"].includes(e) && U(r ? "100%" : "100vh"), ["top", "bottom"].includes(e) && H(r ? "100%" : "100vw"); }, [r, e]), /* @__PURE__ */ u.jsx( DD, { direction: ve, in: i, unmountOnExit: r, motionProps: { initial: r }, ...r ? { style: { position: void 0, left: void 0, right: void 0, top: void 0, bottom: void 0, width: void 0 } } : { // transition: { enter: { duration: 0.15 }, exit: { duration: 0.15 } }, style: { zIndex: 99, width: "full" } }, children: /* @__PURE__ */ u.jsx( Ut, { ref: O, sx: { width: "full", height: "full" }, children: /* @__PURE__ */ u.jsx( oV, { size: { width: t ? L : I, height: t ? q : A }, enable: $, handleStyles: Y, ...ae, sx: { borderColor: "base.800", p: r ? 0 : 4, bg: "base.900", height: "full", boxShadow: r ? "" : "0 0 4rem 0 rgba(0, 0, 0, 0.8)", ...oe, ...k }, onResizeStart: (de, fe, _e) => { w && w(de, fe, _e); }, onResize: (de, fe, _e, Me) => { M && M(de, fe, _e, Me); }, onResizeStop: (de, fe, _e, Me) => { ["left", "right"].includes(fe) && H(Number(L) + Me.width), ["top", "bottom"].includes(fe) && U(Number(q) + Me.height), D && D(de, fe, _e, Me); }, children: c } ) } ) } ); }, kT = { position: "absolute", width: "full", height: 24, left: 0, pointerEvents: "none", transition: "opacity 0.2s ease-in-out" }, nk = ({ children: e }) => { const t = Xe(null), r = Xe(null), i = Xe(null), s = Pe.throttle( () => { if (!t.current || !r.current || !i.current) return; const { scrollTop: c, scrollHeight: f, offsetHeight: m } = t.current; c > 0 ? r.current.style.opacity = "1" : r.current.style.opacity = "0", c >= f - m ? i.current.style.opacity = "0" : i.current.style.opacity = "1"; }, 33, { leading: !0 } ); return ot(() => { s(); }, [s]), /* @__PURE__ */ u.jsxs(Ut, { position: "relative", w: "full", h: "full", children: [ /* @__PURE__ */ u.jsx( Ut, { ref: t, position: "absolute", w: "full", h: "full", overflowY: "scroll", onScroll: s, children: e } ), /* @__PURE__ */ u.jsx( Ut, { ref: i, sx: { ...kT, bottom: 0, boxShadow: "inset 0 -3.5rem 2rem -2rem var(--invokeai-colors-base-900)" } } ), /* @__PURE__ */ u.jsx( Ut, { ref: r, sx: { ...kT, top: 0, boxShadow: "inset 0 3.5rem 2rem -2rem var(--invokeai-colors-base-900)" } } ) ] }); }, sV = Pe.debounce((e) => { e(T2(!0)); }, 300), wa = () => (e, t) => { Bn(t()) === "unifiedCanvas" && sV(e); }; function rk(e) { return Yn({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146z" } }] })(e); } function ak(e) { return Yn({ tag: "svg", attr: { fill: "currentColor", viewBox: "0 0 16 16" }, child: [{ tag: "path", attr: { d: "M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a5.927 5.927 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707-.195-.195.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a5.922 5.922 0 0 1 1.013.16l3.134-3.133a2.772 2.772 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146zm.122 2.112v-.002.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a4.507 4.507 0 0 0-.288-.076 4.922 4.922 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a4.924 4.924 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034.114 0 .23-.011.343-.04L9.927 2.028c-.029.113-.04.23-.04.343a1.779 1.779 0 0 0 .062.46z" } }] })(e); } const RT = (e) => { const { sx: t } = e, r = xe(), i = W( (f) => f.ui.shouldPinParametersPanel ), { t: s } = Ce(), c = () => { r(vA(!i)), r(wa()); }; return /* @__PURE__ */ u.jsx(Ea, { label: s("common.pinOptionsPanel"), children: /* @__PURE__ */ u.jsx( Be, { ...e, "aria-label": s("common.pinOptionsPanel"), onClick: c, icon: i ? /* @__PURE__ */ u.jsx(rk, {}) : /* @__PURE__ */ u.jsx(ak, {}), variant: "ghost", size: "sm", sx: { color: "base.700", _hover: { color: "base.550" }, _active: { color: "base.500" }, ...t } } ) }); }, lV = Ze( [$o, Bn, ch], (e, t, r) => { const { shouldPinParametersPanel: i, shouldShowParametersPanel: s } = e, { isLightboxOpen: c } = r; return { shouldPinParametersPanel: i, shouldShowParametersPanel: s, isResizable: t !== "unifiedCanvas", isLightboxOpen: c }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), uV = ({ children: e }) => { const t = xe(), { shouldPinParametersPanel: r, shouldShowParametersPanel: i, isResizable: s, isLightboxOpen: c } = W(lV), f = () => { t(Gm(!1)); }; return We( "o", () => { t(mA()), r && t(wa()); }, { enabled: () => !c }, [r, c] ), We( "esc", () => { t(Gm(!1)); }, { enabled: () => !r, preventDefault: !0 }, [r] ), We( "shift+o", () => { t(gA()), t(wa()); }, [] ), /* @__PURE__ */ u.jsx( tk, { direction: "left", isResizable: s || !r, isOpen: i, onClose: f, isPinned: r || c, sx: { borderColor: "base.700", p: r ? 0 : 4, bg: "base.900" }, initialWidth: Vj, minWidth: Vj, children: /* @__PURE__ */ u.jsxs(ne, { flexDir: "column", position: "relative", h: "full", w: "full", children: [ !r && /* @__PURE__ */ u.jsxs( ne, { paddingTop: 1.5, paddingBottom: 4, justifyContent: "space-between", alignItems: "center", children: [ /* @__PURE__ */ u.jsx(j2, {}), /* @__PURE__ */ u.jsx(RT, {}) ] } ), /* @__PURE__ */ u.jsx(nk, { children: e }), r && /* @__PURE__ */ u.jsx( RT, { sx: { position: "absolute", top: 0, insetInlineEnd: 0 } } ) ] }) } ); }, cV = Yr(uV), dV = Ze( [$o, Bn], (e, t) => { const { shouldPinParametersPanel: r } = e; return { shouldPinParametersPanel: r, activeTabName: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), c1 = (e) => { const { parametersPanelContent: t, children: r, ...i } = e, s = xe(), { activeTabName: c } = W(dV), f = J9(), m = (y) => { const g = y.dataTransfer.getData("invokeai/imageUuid"), S = f(g); S && (c === "img2img" ? s(Xp(S)) : c === "unifiedCanvas" && s(vg(S))); }; return /* @__PURE__ */ u.jsxs(ne, { ...i, pos: "relative", w: "full", h: r6, gap: 4, children: [ /* @__PURE__ */ u.jsx(cV, { children: t }), /* @__PURE__ */ u.jsx(Ut, { pos: "relative", w: "100%", h: "100%", onDrop: m, children: r }) ] }); }, fV = (e) => { const { styleClass: t } = e, r = Bl(Yb), i = () => { r && r(); }; return /* @__PURE__ */ u.jsx( ne, { sx: { width: "100%", height: "100%", alignItems: "center", justifyContent: "center" }, className: t, children: /* @__PURE__ */ u.jsxs( ne, { onClick: i, sx: { display: "flex", flexDirection: "column", rowGap: 8, p: 8, borderRadius: "base", alignItems: "center", justifyContent: "center", textAlign: "center", cursor: "pointer", color: "base.600", bg: "base.800", _hover: { bg: "base.700" } }, children: [ /* @__PURE__ */ u.jsx(ia, { as: gg, boxSize: 24 }), /* @__PURE__ */ u.jsx(Ni, { size: "md", children: "Click or Drag and Drop" }) ] } ) } ); }; function pV() { const e = W( (s) => s.postprocessing.facetoolType ), t = xe(), { t: r } = Ce(), i = (s) => t(zm(s.target.value)); return /* @__PURE__ */ u.jsx( ni, { label: r("parameters.type"), validValues: yA.concat(), value: e, onChange: i } ); } function hV() { const e = W( (s) => s.system.isGFPGANAvailable ), t = W( (s) => s.postprocessing.facetoolStrength ), { t: r } = Ce(), i = xe(); return /* @__PURE__ */ u.jsx( jn, { isSliderDisabled: !e, isInputDisabled: !e, isResetDisabled: !e, label: r("parameters.strength"), step: 0.05, min: 0, max: 1, onChange: (s) => i(qm(s)), handleReset: () => i(qm(0.75)), value: t, withReset: !0, withSliderMarks: !0, withInput: !0 } ); } function vV() { const e = W( (s) => s.system.isGFPGANAvailable ), t = W( (s) => s.postprocessing.codeformerFidelity ), { t: r } = Ce(), i = xe(); return /* @__PURE__ */ u.jsx( jn, { isSliderDisabled: !e, isInputDisabled: !e, isResetDisabled: !e, label: r("parameters.codeformerFidelity"), step: 0.05, min: 0, max: 1, onChange: (s) => i(fS(s)), handleReset: () => i(fS(1)), value: t, withReset: !0, withSliderMarks: !0, withInput: !0 } ); } const d1 = () => { const e = W( (t) => t.postprocessing.facetoolType ); return /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "stretch", children: [ /* @__PURE__ */ u.jsx(pV, {}), /* @__PURE__ */ u.jsx(hV, {}), e === "codeformer" && /* @__PURE__ */ u.jsx(vV, {}) ] }); }; function mV() { const e = W( (s) => s.system.isESRGANAvailable ), t = W( (s) => s.postprocessing.upscalingDenoising ), { t: r } = Ce(), i = xe(); return /* @__PURE__ */ u.jsx( jn, { label: r("parameters.denoisingStrength"), value: t, min: 0, max: 1, step: 0.01, onChange: (s) => { i(pS(s)); }, handleReset: () => i(pS(0.75)), withSliderMarks: !0, withInput: !0, withReset: !0, isSliderDisabled: !e, isInputDisabled: !e, isResetDisabled: !e } ); } function gV() { const e = W( (s) => s.system.isESRGANAvailable ), t = W( (s) => s.postprocessing.upscalingStrength ), { t: r } = Ce(), i = xe(); return /* @__PURE__ */ u.jsx( jn, { label: `${r("parameters.upscale")} ${r("parameters.strength")}`, value: t, min: 0, max: 1, step: 0.05, onChange: (s) => i(hS(s)), handleReset: () => i(hS(0.75)), withSliderMarks: !0, withInput: !0, withReset: !0, isSliderDisabled: !e, isInputDisabled: !e, isResetDisabled: !e } ); } function yV() { const e = W( (c) => c.system.isESRGANAvailable ), t = W( (c) => c.postprocessing.upscalingLevel ), { t: r } = Ce(), i = xe(), s = (c) => i(D2(Number(c.target.value))); return /* @__PURE__ */ u.jsx( ni, { isDisabled: !e, label: r("parameters.scale"), value: t, onChange: s, validValues: xA } ); } const f1 = () => /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "stretch", children: [ /* @__PURE__ */ u.jsx(yV, {}), /* @__PURE__ */ u.jsx(mV, {}), /* @__PURE__ */ u.jsx(gV, {}) ] }), p1 = (e) => e.postprocessing, xV = Ze( Vn, (e) => { const { shouldConfirmOnDelete: t, isConnected: r, isProcessing: i } = e; return { shouldConfirmOnDelete: t, isConnected: r, isProcessing: i }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), lg = lt( ({ image: e, children: t }, r) => { const { isOpen: i, onOpen: s, onClose: c } = Ol(), f = xe(), { shouldConfirmOnDelete: m, isConnected: y, isProcessing: g } = W( xV ), S = Xe(null), E = (M) => { M.stopPropagation(), m ? s() : w(); }, w = () => { y && !g && e && f(SA(e)), c(); }; We( "delete", () => { m ? s() : w(); }, [e, m, y, g] ); const D = (M) => f(w2(!M.target.checked)); return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ Ll(t, { // TODO: This feels wrong. onClick: e ? E : void 0, ref: r }), /* @__PURE__ */ u.jsx( N_, { isOpen: i, leastDestructiveRef: S, onClose: c, children: /* @__PURE__ */ u.jsx(Rs, { children: /* @__PURE__ */ u.jsxs(O_, { children: [ /* @__PURE__ */ u.jsx(ks, { fontSize: "lg", fontWeight: "bold", children: "Delete image" }), /* @__PURE__ */ u.jsx(Ps, { children: /* @__PURE__ */ u.jsxs(ne, { direction: "column", gap: 5, children: [ /* @__PURE__ */ u.jsx(ct, { children: "Are you sure? Deleted images will be sent to the Bin. You can restore from there if you wish to." }), /* @__PURE__ */ u.jsx( ti, { label: "Don't ask me again", isChecked: !m, onChange: D } ) ] }) }), /* @__PURE__ */ u.jsxs(Ms, { children: [ /* @__PURE__ */ u.jsx(an, { ref: S, onClick: c, children: "Cancel" }), /* @__PURE__ */ u.jsx(an, { colorScheme: "error", onClick: w, ml: 3, children: "Delete" }) ] }) ] }) }) } ) ] }); } ); lg.displayName = "DeleteImageModal"; const h1 = () => { const e = xe(); return (t) => { const r = typeof t == "string" ? t : _2(t), [i, s] = bA(r); e(M2(i)), e(k2(s)); }; }, SV = Ze( [ Vn, Fs, p1, $o, ch, Bn ], (e, t, r, i, s, c) => { const { isProcessing: f, isConnected: m, isGFPGANAvailable: y, isESRGANAvailable: g } = e, { upscalingLevel: S, facetoolStrength: E } = r, { isLightboxOpen: w } = s, { shouldShowImageDetails: D } = i, { intermediateImage: M, currentImage: k } = t; return { isProcessing: f, isConnected: m, isGFPGANAvailable: y, isESRGANAvailable: g, upscalingLevel: S, facetoolStrength: E, shouldDisableToolbarButtons: Boolean(M) || !k, currentImage: k, shouldShowImageDetails: D, activeTabName: c, isLightboxOpen: w }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), ik = (e) => { var Y, ve, de, fe, _e, Me, te, K; const t = xe(), { isProcessing: r, isConnected: i, isGFPGANAvailable: s, isESRGANAvailable: c, upscalingLevel: f, facetoolStrength: m, shouldDisableToolbarButtons: y, shouldShowImageDetails: g, currentImage: S, isLightboxOpen: E, activeTabName: w } = W(SV), D = nh(), { t: M } = Ce(), k = h1(), R = () => { S && (E && t(zu(!1)), t(Xp(S)), t(ei("img2img"))); }, O = async () => { if (!S) return; const se = await fetch(S.url).then((re) => re.blob()), B = [new ClipboardItem({ [se.type]: se })]; await navigator.clipboard.write(B), D({ title: M("toast.imageCopied"), status: "success", duration: 2500, isClosable: !0 }); }, I = () => { navigator.clipboard.writeText( S ? window.location.toString() + S.url : "" ).then(() => { D({ title: M("toast.imageLinkCopied"), status: "success", duration: 2500, isClosable: !0 }); }); }; We( "shift+i", () => { S ? (R(), D({ title: M("toast.sentToImageToImage"), status: "success", duration: 2500, isClosable: !0 })) : D({ title: M("toast.imageNotLoaded"), description: M("toast.imageNotLoadedDesc"), status: "error", duration: 2500, isClosable: !0 }); }, [S] ); const A = () => { var se, B; S && (S.metadata && t(R2(S.metadata)), ((se = S.metadata) == null ? void 0 : se.image.type) === "img2img" ? t(ei("img2img")) : ((B = S.metadata) == null ? void 0 : B.image.type) === "txt2img" && t(ei("txt2img"))); }; We( "a", () => { var se, B; ["txt2img", "img2img"].includes((B = (se = S == null ? void 0 : S.metadata) == null ? void 0 : se.image) == null ? void 0 : B.type) ? (A(), D({ title: M("toast.parametersSet"), status: "success", duration: 2500, isClosable: !0 })) : D({ title: M("toast.parametersNotSet"), description: M("toast.parametersNotSetDesc"), status: "error", duration: 2500, isClosable: !0 }); }, [S] ); const L = () => { S != null && S.metadata && t(Zp(S.metadata.image.seed)); }; We( "s", () => { var se, B; (B = (se = S == null ? void 0 : S.metadata) == null ? void 0 : se.image) != null && B.seed ? (L(), D({ title: M("toast.seedSet"), status: "success", duration: 2500, isClosable: !0 })) : D({ title: M("toast.seedNotSet"), description: M("toast.seedNotSetDesc"), status: "error", duration: 2500, isClosable: !0 }); }, [S] ); const H = ee(() => { var se, B, re, ke; (B = (se = S == null ? void 0 : S.metadata) == null ? void 0 : se.image) != null && B.prompt && k((ke = (re = S == null ? void 0 : S.metadata) == null ? void 0 : re.image) == null ? void 0 : ke.prompt); }, [(ve = (Y = S == null ? void 0 : S.metadata) == null ? void 0 : Y.image) == null ? void 0 : ve.prompt, k]); We( "p", () => { var se, B; (B = (se = S == null ? void 0 : S.metadata) == null ? void 0 : se.image) != null && B.prompt ? (H(), D({ title: M("toast.promptSet"), status: "success", duration: 2500, isClosable: !0 })) : D({ title: M("toast.promptNotSet"), description: M("toast.promptNotSetDesc"), status: "error", duration: 2500, isClosable: !0 }); }, [S] ); const q = () => { S && t(MA(S)); }; We( "Shift+U", () => { c && !y && i && !r && f ? q() : D({ title: M("toast.upscalingFailed"), status: "error", duration: 2500, isClosable: !0 }); }, [ S, c, y, i, r, f ] ); const U = () => { S && t(kA(S)); }; We( "Shift+R", () => { s && !y && i && !r && m ? U() : D({ title: M("toast.faceRestoreFailed"), status: "error", duration: 2500, isClosable: !0 }); }, [ S, s, y, i, r, m ] ); const $ = () => t(P2(!g)), ae = () => { S && (E && t(zu(!1)), t(vg(S)), t(wa()), w !== "unifiedCanvas" && t(ei("unifiedCanvas")), D({ title: M("toast.sentToUnifiedCanvas"), status: "success", duration: 2500, isClosable: !0 })); }; We( "i", () => { S ? $() : D({ title: M("toast.metadataLoadFailed"), status: "error", duration: 2500, isClosable: !0 }); }, [S, g] ); const oe = () => { t(zu(!E)); }; return /* @__PURE__ */ u.jsxs( ne, { sx: { justifyContent: "center", alignItems: "center", columnGap: "0.5em" }, ...e, children: [ /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, children: [ /* @__PURE__ */ u.jsx( Wo, { trigger: "hover", triggerComponent: /* @__PURE__ */ u.jsx( Be, { "aria-label": `${M("parameters.sendTo")}...`, icon: /* @__PURE__ */ u.jsx(CA, {}) } ), children: /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", rowGap: 2 }, children: [ /* @__PURE__ */ u.jsx( an, { size: "sm", onClick: R, leftIcon: /* @__PURE__ */ u.jsx(jw, {}), children: M("parameters.sendToImg2Img") } ), /* @__PURE__ */ u.jsx( an, { size: "sm", onClick: ae, leftIcon: /* @__PURE__ */ u.jsx(jw, {}), children: M("parameters.sendToUnifiedCanvas") } ), /* @__PURE__ */ u.jsx( an, { size: "sm", onClick: O, leftIcon: /* @__PURE__ */ u.jsx(zd, {}), children: M("parameters.copyImage") } ), /* @__PURE__ */ u.jsx( an, { size: "sm", onClick: I, leftIcon: /* @__PURE__ */ u.jsx(zd, {}), children: M("parameters.copyImageToLink") } ), /* @__PURE__ */ u.jsx(Fu, { download: !0, href: S == null ? void 0 : S.url, children: /* @__PURE__ */ u.jsx(an, { leftIcon: /* @__PURE__ */ u.jsx(sb, {}), size: "sm", w: "100%", children: M("parameters.downloadImage") }) }) ] } ) } ), /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(EA, {}), tooltip: E ? `${M("parameters.closeViewer")} (Z)` : `${M("parameters.openInViewer")} (Z)`, "aria-label": E ? `${M("parameters.closeViewer")} (Z)` : `${M("parameters.openInViewer")} (Z)`, isChecked: E, onClick: oe } ) ] }), /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, children: [ /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(wA, {}), tooltip: `${M("parameters.usePrompt")} (P)`, "aria-label": `${M("parameters.usePrompt")} (P)`, isDisabled: !((fe = (de = S == null ? void 0 : S.metadata) == null ? void 0 : de.image) != null && fe.prompt), onClick: H } ), /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(jA, {}), tooltip: `${M("parameters.useSeed")} (S)`, "aria-label": `${M("parameters.useSeed")} (S)`, isDisabled: !((Me = (_e = S == null ? void 0 : S.metadata) == null ? void 0 : _e.image) != null && Me.seed), onClick: L } ), /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(TA, {}), tooltip: `${M("parameters.useAll")} (A)`, "aria-label": `${M("parameters.useAll")} (A)`, isDisabled: !["txt2img", "img2img"].includes( (K = (te = S == null ? void 0 : S.metadata) == null ? void 0 : te.image) == null ? void 0 : K.type ), onClick: A } ) ] }), /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, children: [ /* @__PURE__ */ u.jsx( Wo, { trigger: "hover", triggerComponent: /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(DA, {}), "aria-label": M("parameters.restoreFaces") } ), children: /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", rowGap: 4 }, children: [ /* @__PURE__ */ u.jsx(d1, {}), /* @__PURE__ */ u.jsx( an, { isDisabled: !s || !S || !(i && !r) || !m, onClick: U, children: M("parameters.restoreFaces") } ) ] } ) } ), /* @__PURE__ */ u.jsx( Wo, { trigger: "hover", triggerComponent: /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(_A, {}), "aria-label": M("parameters.upscale") } ), children: /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", gap: 4 }, children: [ /* @__PURE__ */ u.jsx(f1, {}), /* @__PURE__ */ u.jsx( an, { isDisabled: !c || !S || !(i && !r) || !f, onClick: q, children: M("parameters.upscaleImage") } ) ] } ) } ) ] }), /* @__PURE__ */ u.jsx(qr, { isAttached: !0, children: /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(x2, {}), tooltip: `${M("parameters.info")} (I)`, "aria-label": `${M("parameters.info")} (I)`, isChecked: g, onClick: $ } ) }), /* @__PURE__ */ u.jsx(lg, { image: S, children: /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(qu, {}), tooltip: `${M("parameters.deleteImage")} (Del)`, "aria-label": `${M("parameters.deleteImage")} (Del)`, isDisabled: !S || !i || r, colorScheme: "error" } ) }) ] } ); }; function bV(e) { return Yn({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M245.09 327.74v-37.32c57.07 0 84.51 13.47 108.58 38.68 5.4 5.65 15 1.32 14.29-6.43-5.45-61.45-34.14-117.09-122.87-117.09v-37.32a8.32 8.32 0 00-14.05-6L146.58 242a8.2 8.2 0 000 11.94L231 333.71a8.32 8.32 0 0014.09-5.97z" } }, { tag: "path", attr: { fill: "none", strokeMiterlimit: "10", strokeWidth: "32", d: "M256 64C150 64 64 150 64 256s86 192 192 192 192-86 192-192S362 64 256 64z" } }] })(e); } const Fn = ({ label: e, value: t, onClick: r, isLink: i, labelPosition: s, withCopy: c = !1 }) => { const { t: f } = Ce(); return /* @__PURE__ */ u.jsxs(ne, { gap: 2, children: [ r && /* @__PURE__ */ u.jsx(Ea, { label: `Recall ${e}`, children: /* @__PURE__ */ u.jsx( Id, { "aria-label": f("accessibility.useThisParameter"), icon: /* @__PURE__ */ u.jsx(bV, {}), size: "xs", variant: "ghost", fontSize: 20, onClick: r } ) }), c && /* @__PURE__ */ u.jsx(Ea, { label: `Copy ${e}`, children: /* @__PURE__ */ u.jsx( Id, { "aria-label": `Copy ${e}`, icon: /* @__PURE__ */ u.jsx(zd, {}), size: "xs", variant: "ghost", fontSize: 14, onClick: () => navigator.clipboard.writeText(t.toString()) } ) }), /* @__PURE__ */ u.jsxs(ne, { direction: s ? "column" : "row", children: [ /* @__PURE__ */ u.jsxs(ct, { fontWeight: "semibold", whiteSpace: "pre-wrap", pr: 2, children: [ e, ":" ] }), i ? /* @__PURE__ */ u.jsxs(Fu, { href: t.toString(), isExternal: !0, wordBreak: "break-all", children: [ t.toString(), " ", /* @__PURE__ */ u.jsx(JM, { mx: "2px" }) ] }) : /* @__PURE__ */ u.jsx(ct, { overflowY: "scroll", wordBreak: "break-all", children: t.toString() }) ] }) ] }); }, CV = (e, t) => e.image.uuid === t.image.uuid, v1 = Yr(({ image: e }) => { var oe, Y; const t = xe(), r = h1(); We("esc", () => { t(P2(!1)); }); const i = ((oe = e == null ? void 0 : e.metadata) == null ? void 0 : oe.image) || {}, s = e == null ? void 0 : e.dreamPrompt, { cfg_scale: c, fit: f, height: m, hires_fix: y, init_image_path: g, mask_image_path: S, orig_path: E, perlin: w, postprocessing: D, prompt: M, sampler: k, seamless: R, seed: O, steps: I, strength: A, threshold: L, type: H, variations: q, width: U } = i, { t: $ } = Ce(), ae = JSON.stringify(e.metadata, null, 2); return /* @__PURE__ */ u.jsxs( ne, { sx: { padding: 4, gap: 1, flexDirection: "column", width: "full", height: "full", backdropFilter: "blur(20px)", bg: "whiteAlpha.600", _dark: { bg: "blackAlpha.600" } }, children: [ /* @__PURE__ */ u.jsxs(ne, { gap: 2, children: [ /* @__PURE__ */ u.jsx(ct, { fontWeight: "semibold", children: "File:" }), /* @__PURE__ */ u.jsxs(Fu, { href: e.url, isExternal: !0, maxW: "calc(100% - 3rem)", children: [ e.url.length > 64 ? e.url.substring(0, 64).concat("...") : e.url, /* @__PURE__ */ u.jsx(JM, { mx: "2px" }) ] }) ] }), Object.keys(i).length > 0 ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ H && /* @__PURE__ */ u.jsx(Fn, { label: "Generation type", value: H }), ((Y = e.metadata) == null ? void 0 : Y.model_weights) && /* @__PURE__ */ u.jsx(Fn, { label: "Model", value: e.metadata.model_weights }), ["esrgan", "gfpgan"].includes(H) && /* @__PURE__ */ u.jsx(Fn, { label: "Original image", value: E }), M && /* @__PURE__ */ u.jsx( Fn, { label: "Prompt", labelPosition: "top", value: typeof M == "string" ? M : _2(M), onClick: () => r(M) } ), O !== void 0 && /* @__PURE__ */ u.jsx( Fn, { label: "Seed", value: O, onClick: () => t(Zp(O)) } ), L !== void 0 && /* @__PURE__ */ u.jsx( Fn, { label: "Noise Threshold", value: L, onClick: () => t(vS(L)) } ), w !== void 0 && /* @__PURE__ */ u.jsx( Fn, { label: "Perlin Noise", value: w, onClick: () => t(mS(w)) } ), k && /* @__PURE__ */ u.jsx( Fn, { label: "Sampler", value: k, onClick: () => t(N2(k)) } ), I && /* @__PURE__ */ u.jsx( Fn, { label: "Steps", value: I, onClick: () => t(gS(I)) } ), c !== void 0 && /* @__PURE__ */ u.jsx( Fn, { label: "CFG scale", value: c, onClick: () => t(yS(c)) } ), q && q.length > 0 && /* @__PURE__ */ u.jsx( Fn, { label: "Seed-weight pairs", value: Tw(q), onClick: () => t(O2(Tw(q))) } ), R && /* @__PURE__ */ u.jsx( Fn, { label: "Seamless", value: R, onClick: () => t(A2(R)) } ), y && /* @__PURE__ */ u.jsx( Fn, { label: "High Resolution Optimization", value: y, onClick: () => t(z2(y)) } ), U && /* @__PURE__ */ u.jsx( Fn, { label: "Width", value: U, onClick: () => t(Im(U)) } ), m && /* @__PURE__ */ u.jsx( Fn, { label: "Height", value: m, onClick: () => t(Fm(m)) } ), g && /* @__PURE__ */ u.jsx( Fn, { label: "Initial image", value: g, isLink: !0, onClick: () => t(Xp(g)) } ), S && /* @__PURE__ */ u.jsx( Fn, { label: "Mask image", value: S, isLink: !0, onClick: () => t(RA(S)) } ), H === "img2img" && A && /* @__PURE__ */ u.jsx( Fn, { label: "Image to image strength", value: A, onClick: () => t(xS(A)) } ), f && /* @__PURE__ */ u.jsx( Fn, { label: "Image to image fit", value: f, onClick: () => t(I2(f)) } ), D && D.length > 0 && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx(Ni, { size: "sm", children: "Postprocessing" }), D.map( (ve, de) => { if (ve.type === "esrgan") { const { scale: fe, strength: _e, denoise_str: Me } = ve; return /* @__PURE__ */ u.jsxs(ne, { pl: 8, gap: 1, direction: "column", children: [ /* @__PURE__ */ u.jsx(ct, { size: "md", children: `${de + 1}: Upscale (ESRGAN)` }), /* @__PURE__ */ u.jsx( Fn, { label: "Scale", value: fe, onClick: () => t(D2(fe)) } ), /* @__PURE__ */ u.jsx( Fn, { label: "Strength", value: _e, onClick: () => t(hS(_e)) } ), Me !== void 0 && /* @__PURE__ */ u.jsx( Fn, { label: "Denoising strength", value: Me, onClick: () => t(pS(Me)) } ) ] }, de); } else if (ve.type === "gfpgan") { const { strength: fe } = ve; return /* @__PURE__ */ u.jsxs(ne, { pl: 8, gap: 1, direction: "column", children: [ /* @__PURE__ */ u.jsx(ct, { size: "md", children: `${de + 1}: Face restoration (GFPGAN)` }), /* @__PURE__ */ u.jsx( Fn, { label: "Strength", value: fe, onClick: () => { t(qm(fe)), t(zm("gfpgan")); } } ) ] }, de); } else if (ve.type === "codeformer") { const { strength: fe, fidelity: _e } = ve; return /* @__PURE__ */ u.jsxs(ne, { pl: 8, gap: 1, direction: "column", children: [ /* @__PURE__ */ u.jsx(ct, { size: "md", children: `${de + 1}: Face restoration (Codeformer)` }), /* @__PURE__ */ u.jsx( Fn, { label: "Strength", value: fe, onClick: () => { t(qm(fe)), t(zm("codeformer")); } } ), _e && /* @__PURE__ */ u.jsx( Fn, { label: "Fidelity", value: _e, onClick: () => { t(fS(_e)), t(zm("codeformer")); } } ) ] }, de); } } ) ] }), s && /* @__PURE__ */ u.jsx(Fn, { withCopy: !0, label: "Dream Prompt", value: s }), /* @__PURE__ */ u.jsxs(ne, { gap: 2, direction: "column", children: [ /* @__PURE__ */ u.jsxs(ne, { gap: 2, children: [ /* @__PURE__ */ u.jsx(Ea, { label: "Copy metadata JSON", children: /* @__PURE__ */ u.jsx( Id, { "aria-label": $("accessibility.copyMetadataJson"), icon: /* @__PURE__ */ u.jsx(zd, {}), size: "xs", variant: "ghost", fontSize: 14, onClick: () => navigator.clipboard.writeText(ae) } ) }), /* @__PURE__ */ u.jsx(ct, { fontWeight: "semibold", children: "Metadata JSON:" }) ] }), /* @__PURE__ */ u.jsx( Ut, { sx: { mt: 0, mr: 2, mb: 4, ml: 2, padding: 4, borderRadius: "base", overflowX: "scroll", wordBreak: "break-all", bg: "whiteAlpha.500", _dark: { bg: "blackAlpha.500" } }, children: /* @__PURE__ */ u.jsx("pre", { children: ae }) } ) ] }) ] }) : /* @__PURE__ */ u.jsx(g_, { width: "100%", pt: 10, children: /* @__PURE__ */ u.jsx(ct, { fontSize: "lg", fontWeight: "semibold", children: "No metadata available" }) }) ] } ); }, CV); v1.displayName = "ImageMetadataViewer"; const PT = { height: "100%", width: "15%", alignItems: "center", pointerEvents: "auto" }, NT = { color: "base.100" }, EV = Ze( Fs, (e) => { const { currentImage: t } = e, r = e.categories[t ? t.category : "result"].images, i = r.findIndex( (c) => { var f; return c.uuid === ((f = e == null ? void 0 : e.currentImage) == null ? void 0 : f.uuid); } ), s = r.length; return { isOnFirstImage: i === 0, isOnLastImage: !isNaN(i) && i === s - 1 }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), ok = () => { const e = xe(), { t } = Ce(), { isOnFirstImage: r, isOnLastImage: i } = W( EV ), [s, c] = qe(!1), f = () => { c(!0); }, m = () => { c(!1); }, y = () => { e(F2()); }, g = () => { e(L2()); }; return /* @__PURE__ */ u.jsxs( ne, { sx: { justifyContent: "space-between", zIndex: 1, height: "100%", width: "100%", pointerEvents: "none" }, children: [ /* @__PURE__ */ u.jsx( uo, { sx: { ...PT, justifyContent: "flex-start" }, onMouseOver: f, onMouseOut: m, children: s && !r && /* @__PURE__ */ u.jsx( Id, { "aria-label": t("accessibility.previousImage"), icon: /* @__PURE__ */ u.jsx(PA, { size: 64 }), variant: "unstyled", onClick: y, boxSize: 16, sx: NT } ) } ), /* @__PURE__ */ u.jsx( uo, { sx: { ...PT, justifyContent: "flex-end" }, onMouseOver: f, onMouseOut: m, children: s && !i && /* @__PURE__ */ u.jsx( Id, { "aria-label": t("accessibility.nextImage"), icon: /* @__PURE__ */ u.jsx(NA, { size: 64 }), variant: "unstyled", onClick: g, boxSize: 16, sx: NT } ) } ) ] } ); }, wV = Ze( [Fs, $o], (e, t) => { const { currentImage: r, intermediateImage: i } = e, { shouldShowImageDetails: s } = t; return { imageToDisplay: i || r, isIntermediate: Boolean(i), shouldShowImageDetails: s }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function jV() { const { shouldShowImageDetails: e, imageToDisplay: t, isIntermediate: r } = W(wV); return /* @__PURE__ */ u.jsxs( ne, { sx: { position: "relative", justifyContent: "center", alignItems: "center", width: "100%", height: "100%" }, children: [ t && /* @__PURE__ */ u.jsx( lb, { src: t.url, width: t.width, height: t.height, sx: { objectFit: "contain", maxWidth: "100%", maxHeight: "100%", height: "auto", position: "absolute", imageRendering: r ? "pixelated" : "initial", borderRadius: "base" } } ), !e && /* @__PURE__ */ u.jsx(ok, {}), e && t && /* @__PURE__ */ u.jsx( Ut, { sx: { position: "absolute", top: "0", width: "100%", height: "100%", borderRadius: "base", overflow: "scroll", maxHeight: a6 }, children: /* @__PURE__ */ u.jsx(v1, { image: t }) } ) ] } ); } const TV = Ze( [Fs], (e) => { const { currentImage: t, intermediateImage: r } = e; return { hasAnImageToDisplay: t || r }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), sk = () => { const { hasAnImageToDisplay: e } = W(TV); return /* @__PURE__ */ u.jsx( ne, { sx: { flexDirection: "column", height: "100%", width: "100%", rowGap: 4, borderRadius: "base" }, children: e ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx(ik, {}), /* @__PURE__ */ u.jsx(jV, {}) ] }) : /* @__PURE__ */ u.jsx( ne, { sx: { alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: /* @__PURE__ */ u.jsx( ia, { as: V9, sx: { boxSize: 24, color: "base.500" } } ) } ) } ); }, DV = () => { const { t: e } = Ce(), t = Bl(Yb); return /* @__PURE__ */ u.jsx( Be, { "aria-label": e("accessibility.uploadImage"), tooltip: "Upload Image", icon: /* @__PURE__ */ u.jsx(gg, {}), onClick: t || void 0 } ); }; function _V() { const e = W( (c) => c.generation.initialImage ), { t } = Ce(), r = xe(), i = nh(), s = () => { i({ title: t("toast.parametersFailed"), description: t("toast.parametersFailedDesc"), status: "error", isClosable: !0 }), r(OA()); }; return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsxs( ne, { sx: { alignItems: "center", justifyContent: "center", w: "100%", gap: 4 }, children: [ /* @__PURE__ */ u.jsx( ct, { sx: { fontSize: "lg" }, variant: "subtext", children: t("parameters.initialImage") } ), /* @__PURE__ */ u.jsx(DV, {}) ] } ), e && /* @__PURE__ */ u.jsx( ne, { sx: { position: "relative", height: "100%", width: "100%", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ u.jsx( lb, { sx: { fit: "contain", maxWidth: "100%", maxHeight: "100%", borderRadius: "base", objectFit: "contain", position: "absolute" }, src: typeof e == "string" ? e : e.url, onError: s } ) } ) ] }); } const OT = { flexDirection: "column", height: "100%", width: "100%", gap: 4, padding: 4 }, MV = () => { const t = W( (r) => r.generation.initialImage ) ? /* @__PURE__ */ u.jsx(ne, { flexDirection: "column", gap: 4, w: "100%", h: "100%", children: /* @__PURE__ */ u.jsx(_V, {}) }) : /* @__PURE__ */ u.jsx(fV, {}); return /* @__PURE__ */ u.jsxs( uo, { sx: { w: "100%", h: "100%", gridTemplateColumns: "1fr 1fr", borderRadius: "base", bg: "base.850" }, children: [ /* @__PURE__ */ u.jsx(ne, { sx: { ...OT, paddingInlineEnd: 2 }, children: t }), /* @__PURE__ */ u.jsx(ne, { sx: { ...OT, paddingInlineStart: 2 }, children: /* @__PURE__ */ u.jsx(sk, {}) }) ] } ); }; var Ca = /* @__PURE__ */ ((e) => (e[e.PROMPT = 0] = "PROMPT", e[e.GALLERY = 1] = "GALLERY", e[e.OTHER = 2] = "OTHER", e[e.SEED = 3] = "SEED", e[e.VARIATIONS = 4] = "VARIATIONS", e[e.UPSCALE = 5] = "UPSCALE", e[e.FACE_CORRECTION = 6] = "FACE_CORRECTION", e[e.IMAGE_TO_IMAGE = 7] = "IMAGE_TO_IMAGE", e[e.BOUNDING_BOX = 8] = "BOUNDING_BOX", e[e.SEAM_CORRECTION = 9] = "SEAM_CORRECTION", e[e.INFILL_AND_SCALING = 10] = "INFILL_AND_SCALING", e))(Ca || {}); const kV = () => { const { t: e } = Ce(); return Xt( () => ({ [ 0 /* PROMPT */ ]: { text: e("tooltip.feature.prompt"), href: "link/to/docs/feature3.html", guideImage: "asset/path.gif" }, [ 1 /* GALLERY */ ]: { text: e("tooltip.feature.gallery"), href: "link/to/docs/feature3.html", guideImage: "asset/path.gif" }, [ 2 /* OTHER */ ]: { text: e("tooltip.feature.other"), href: "link/to/docs/feature3.html", guideImage: "asset/path.gif" }, [ 3 /* SEED */ ]: { text: e("tooltip.feature.seed"), href: "link/to/docs/feature3.html", guideImage: "asset/path.gif" }, [ 4 /* VARIATIONS */ ]: { text: e("tooltip.feature.variations"), href: "link/to/docs/feature3.html", guideImage: "asset/path.gif" }, [ 5 /* UPSCALE */ ]: { text: e("tooltip.feature.upscale"), href: "link/to/docs/feature1.html", guideImage: "asset/path.gif" }, [ 6 /* FACE_CORRECTION */ ]: { text: e("tooltip.feature.faceCorrection"), href: "link/to/docs/feature3.html", guideImage: "asset/path.gif" }, [ 7 /* IMAGE_TO_IMAGE */ ]: { text: e("tooltip.feature.imageToImage"), href: "link/to/docs/feature3.html", guideImage: "asset/path.gif" }, [ 8 /* BOUNDING_BOX */ ]: { text: e("tooltip.feature.boundingBox"), href: "link/to/docs/feature3.html", guideImage: "asset/path.gif" }, [ 9 /* SEAM_CORRECTION */ ]: { text: e("tooltip.feature.seamCorrection"), href: "link/to/docs/feature3.html", guideImage: "asset/path.gif" }, [ 10 /* INFILL_AND_SCALING */ ]: { text: e("tooltip.feature.infillAndScaling"), href: "link/to/docs/feature3.html", guideImage: "asset/path.gif" } }), [e] ); }, RV = (e) => kV()[e]; function lk() { const e = W( (s) => s.system.isGFPGANAvailable ), t = W( (s) => s.postprocessing.shouldRunFacetool ), r = xe(), i = (s) => r(AA(s.target.checked)); return /* @__PURE__ */ u.jsx( ti, { isDisabled: !e, isChecked: t, onChange: i } ); } const uk = () => { const e = xe(), t = W( (s) => s.generation.seamless ), r = (s) => e(A2(s.target.checked)), { t: i } = Ce(); return /* @__PURE__ */ u.jsx( ti, { label: i("parameters.seamlessTiling"), fontSize: "md", isChecked: t, onChange: r } ); }, PV = () => /* @__PURE__ */ u.jsx(zt, { gap: 2, alignItems: "stretch", children: /* @__PURE__ */ u.jsx(uk, {}) }); function m1() { const e = W( (c) => c.generation.horizontalSymmetrySteps ), t = W( (c) => c.generation.verticalSymmetrySteps ), r = W((c) => c.generation.steps), i = xe(), { t: s } = Ce(); return /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "stretch", children: [ /* @__PURE__ */ u.jsx( jn, { label: s("parameters.hSymmetryStep"), value: e, onChange: (c) => i(Dw(c)), min: 0, max: r, step: 1, withInput: !0, withSliderMarks: !0, withReset: !0, handleReset: () => i(Dw(0)) } ), /* @__PURE__ */ u.jsx( jn, { label: s("parameters.vSymmetryStep"), value: t, onChange: (c) => i(_w(c)), min: 0, max: r, step: 1, withInput: !0, withSliderMarks: !0, withReset: !0, handleReset: () => i(_w(0)) } ) ] }); } function g1() { const e = W( (r) => r.generation.shouldUseSymmetry ), t = xe(); return /* @__PURE__ */ u.jsx( ti, { isChecked: e, onChange: (r) => t(zA(r.target.checked)) } ); } function NV() { const e = xe(), t = W((i) => i.generation.perlin), { t: r } = Ce(); return /* @__PURE__ */ u.jsx( jn, { label: r("parameters.perlinNoise"), min: 0, max: 1, step: 0.05, onChange: (i) => e(mS(i)), handleReset: () => e(mS(0)), value: t, withInput: !0, withReset: !0, withSliderMarks: !0 } ); } function OV() { const e = xe(), { t } = Ce(), r = W( (s) => s.generation.shouldRandomizeSeed ), i = (s) => e(IA(s.target.checked)); return /* @__PURE__ */ u.jsx( ti, { label: t("parameters.randomizeSeed"), isChecked: r, onChange: i } ); } function AV() { const e = xe(), t = W( (s) => s.generation.shouldRandomizeSeed ), { t: r } = Ce(), i = () => e(Zp(FA(U2, B2))); return /* @__PURE__ */ u.jsx( mg, { size: "sm", isDisabled: t, onClick: i, padding: "0 1.5rem", children: /* @__PURE__ */ u.jsx("p", { children: r("parameters.shuffle") }) } ); } function zV() { const e = W((f) => f.generation.seed), t = W( (f) => f.generation.shouldRandomizeSeed ), r = W( (f) => f.generation.shouldGenerateVariations ), { t: i } = Ce(), s = xe(), c = (f) => s(Zp(f)); return /* @__PURE__ */ u.jsxs(Gd, { gap: 2, children: [ /* @__PURE__ */ u.jsx( Ns, { label: i("parameters.seed"), step: 1, precision: 0, flexGrow: 1, min: U2, max: B2, isDisabled: t, isInvalid: e < 0 && r, onChange: c, value: e, formControlProps: { display: "flex", alignItems: "center", gap: 3 // really this should work with 2 but seems to need to be 3 to match gap 2? } } ), /* @__PURE__ */ u.jsx(AV, {}) ] }); } function IV() { const e = xe(), t = W( (i) => i.generation.threshold ), { t: r } = Ce(); return /* @__PURE__ */ u.jsx( jn, { label: r("parameters.noiseThreshold"), min: 0, max: 20, step: 0.1, onChange: (i) => e(vS(i)), handleReset: () => e(vS(0)), value: t, withInput: !0, withReset: !0, withSliderMarks: !0 } ); } const y1 = () => /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "stretch", children: [ /* @__PURE__ */ u.jsx(OV, {}), /* @__PURE__ */ u.jsx(zV, {}), /* @__PURE__ */ u.jsx(IV, {}), /* @__PURE__ */ u.jsx(NV, {}) ] }); function ck() { const e = W( (s) => s.system.isESRGANAvailable ), t = W( (s) => s.postprocessing.shouldRunESRGAN ), r = xe(), i = (s) => r(LA(s.target.checked)); return /* @__PURE__ */ u.jsx( ti, { isDisabled: !e, isChecked: t, onChange: i } ); } function x1() { const e = W( (i) => i.generation.shouldGenerateVariations ), t = xe(), r = (i) => t(BA(i.target.checked)); return /* @__PURE__ */ u.jsx( ti, { isChecked: e, width: "auto", onChange: r } ); } function FV() { const e = W( (c) => c.generation.seedWeights ), t = W( (c) => c.generation.shouldGenerateVariations ), { t: r } = Ce(), i = xe(), s = (c) => i(O2(c.target.value)); return /* @__PURE__ */ u.jsx( zn, { label: r("parameters.seedWeights"), value: e, isInvalid: t && !(H2(e) || e === ""), isDisabled: !t, onChange: s } ); } function LV() { const e = W( (s) => s.generation.variationAmount ), t = W( (s) => s.generation.shouldGenerateVariations ), { t: r } = Ce(), i = xe(); return /* @__PURE__ */ u.jsx( jn, { label: r("parameters.variationAmount"), value: e, step: 0.01, min: 0, max: 1, isSliderDisabled: !t, isInputDisabled: !t, isResetDisabled: !t, onChange: (s) => i(Mw(s)), handleReset: () => i(Mw(0.1)), withInput: !0, withReset: !0, withSliderMarks: !0 } ); } const S1 = () => /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "stretch", children: [ /* @__PURE__ */ u.jsx(LV, {}), /* @__PURE__ */ u.jsx(FV, {}) ] }); function AT() { const e = xe(), t = W( (c) => c.generation.cfgScale ), r = W( (c) => c.ui.shouldUseSliders ), { t: i } = Ce(), s = (c) => e(yS(c)); return r ? /* @__PURE__ */ u.jsx( jn, { label: i("parameters.cfgScale"), step: 0.5, min: 1.01, max: 30, onChange: s, handleReset: () => e(yS(7.5)), value: t, sliderNumberInputProps: { max: 200 }, withInput: !0, withReset: !0, withSliderMarks: !0 } ) : /* @__PURE__ */ u.jsx( Ns, { label: i("parameters.cfgScale"), step: 0.5, min: 1.01, max: 200, onChange: s, value: t, isInteger: !1, numberInputFieldProps: { textAlign: "center" } } ); } function zT() { const e = W((c) => c.generation.height), t = W( (c) => c.ui.shouldUseSliders ), r = W(Bn), i = xe(), { t: s } = Ce(); return t ? /* @__PURE__ */ u.jsx( jn, { isSliderDisabled: r === "unifiedCanvas", isInputDisabled: r === "unifiedCanvas", isResetDisabled: r === "unifiedCanvas", label: s("parameters.height"), value: e, min: 64, step: 64, max: 2048, onChange: (c) => i(Fm(c)), handleReset: () => i(Fm(512)), withInput: !0, withReset: !0, withSliderMarks: !0, sliderNumberInputProps: { max: 15360 } } ) : /* @__PURE__ */ u.jsx( ni, { isDisabled: r === "unifiedCanvas", label: s("parameters.height"), value: e, flexGrow: 1, onChange: (c) => i(Fm(Number(c.target.value))), validValues: UA } ); } function IT() { const e = W( (c) => c.generation.iterations ), t = W( (c) => c.ui.shouldUseSliders ), r = xe(), { t: i } = Ce(), s = (c) => r(kw(c)); return t ? /* @__PURE__ */ u.jsx( jn, { label: i("parameters.images"), step: 1, min: 1, max: 16, onChange: s, handleReset: () => r(kw(1)), value: e, withInput: !0, withReset: !0, withSliderMarks: !0, sliderNumberInputProps: { max: 9999 } } ) : /* @__PURE__ */ u.jsx( Ns, { label: i("parameters.images"), step: 1, min: 1, max: 9999, onChange: s, value: e, numberInputFieldProps: { textAlign: "center" } } ); } function FT() { const e = W( (c) => c.generation.sampler ), t = W(SM), r = xe(), { t: i } = Ce(), s = (c) => r(N2(c.target.value)); return /* @__PURE__ */ u.jsx( ni, { label: i("parameters.sampler"), value: e, onChange: s, validValues: t.format === "diffusers" ? HA : VA, minWidth: 36 } ); } function LT() { const e = xe(), t = W((f) => f.generation.steps), r = W( (f) => f.ui.shouldUseSliders ), { t: i } = Ce(), s = (f) => { e(gS(f)); }, c = () => { e(V2()); }; return r ? /* @__PURE__ */ u.jsx( jn, { label: i("parameters.steps"), min: 1, step: 1, onChange: s, handleReset: () => e(gS(20)), value: t, withInput: !0, withReset: !0, withSliderMarks: !0, sliderNumberInputProps: { max: 9999 } } ) : /* @__PURE__ */ u.jsx( Ns, { label: i("parameters.steps"), min: 1, max: 9999, step: 1, onChange: s, value: t, numberInputFieldProps: { textAlign: "center" }, onBlur: c } ); } function BT() { const e = W((c) => c.generation.width), t = W( (c) => c.ui.shouldUseSliders ), r = W(Bn), { t: i } = Ce(), s = xe(); return t ? /* @__PURE__ */ u.jsx( jn, { isSliderDisabled: r === "unifiedCanvas", isInputDisabled: r === "unifiedCanvas", isResetDisabled: r === "unifiedCanvas", label: i("parameters.width"), value: e, min: 64, step: 64, max: 2048, onChange: (c) => s(Im(c)), handleReset: () => s(Im(512)), withInput: !0, withReset: !0, withSliderMarks: !0, inputReadOnly: !0, sliderNumberInputProps: { max: 15360 } } ) : /* @__PURE__ */ u.jsx( ni, { isDisabled: r === "unifiedCanvas", label: i("parameters.width"), value: e, flexGrow: 1, onChange: (c) => s(Im(Number(c.target.value))), validValues: WA } ); } function b1() { return W( (t) => t.ui.shouldUseSliders ) ? /* @__PURE__ */ u.jsxs(zt, { gap: 2, children: [ /* @__PURE__ */ u.jsx(IT, {}), /* @__PURE__ */ u.jsx(LT, {}), /* @__PURE__ */ u.jsx(AT, {}), /* @__PURE__ */ u.jsx(BT, {}), /* @__PURE__ */ u.jsx(zT, {}), /* @__PURE__ */ u.jsx(FT, {}) ] }) : /* @__PURE__ */ u.jsxs(ne, { rowGap: 2, flexDirection: "column", children: [ /* @__PURE__ */ u.jsxs(ne, { columnGap: 1, children: [ /* @__PURE__ */ u.jsx(IT, {}), /* @__PURE__ */ u.jsx(LT, {}), /* @__PURE__ */ u.jsx(AT, {}) ] }), /* @__PURE__ */ u.jsxs(ne, { columnGap: 1, children: [ /* @__PURE__ */ u.jsx(BT, {}), /* @__PURE__ */ u.jsx(zT, {}), /* @__PURE__ */ u.jsx(FT, {}) ] }) ] }); } const BV = Ze( Vn, (e) => e.shouldDisplayGuides ), UV = ({ children: e, feature: t }) => { const r = W(BV), { text: i } = RV(t); return r ? /* @__PURE__ */ u.jsxs(GA, { trigger: "hover", isLazy: !0, children: [ /* @__PURE__ */ u.jsx(qA, { children: /* @__PURE__ */ u.jsx(Ut, { children: e }) }), /* @__PURE__ */ u.jsxs( YA, { maxWidth: "400px", onClick: (s) => s.preventDefault(), cursor: "initial", children: [ /* @__PURE__ */ u.jsx(KA, {}), /* @__PURE__ */ u.jsx(z_, { children: i }) ] } ) ] }) : null; }, HV = Yr(UV), VV = lt( ({ feature: e, icon: t = z9 }, r) => /* @__PURE__ */ u.jsx(HV, { feature: e, children: /* @__PURE__ */ u.jsx(Ut, { ref: r, children: /* @__PURE__ */ u.jsx(ia, { marginBottom: "-.15rem", as: t }) }) }) ), WV = Yr(VV); function GV(e) { const { header: t, feature: r, content: i, additionalHeaderComponents: s } = e; return /* @__PURE__ */ u.jsxs(Td, { children: [ /* @__PURE__ */ u.jsx(wd, { children: /* @__PURE__ */ u.jsxs(ne, { width: "100%", gap: 2, align: "center", children: [ /* @__PURE__ */ u.jsx(Ut, { flexGrow: 1, textAlign: "start", children: t }), s, r && /* @__PURE__ */ u.jsx(WV, { feature: r }), /* @__PURE__ */ u.jsx(jd, {}) ] }) }), /* @__PURE__ */ u.jsx(Dd, { children: i }) ] }); } const C1 = (e) => { const { accordionInfo: t } = e, r = W( (f) => f.system.openAccordions ), i = xe(), s = (f) => i(XA(f)), c = () => { const f = []; return t && Object.keys(t).forEach((m) => { const { header: y, feature: g, content: S, additionalHeaderComponents: E } = t[m]; f.push( /* @__PURE__ */ u.jsx( GV, { header: y, feature: g, content: S, additionalHeaderComponents: E }, m ) ); }), f; }; return /* @__PURE__ */ u.jsx( Sb, { defaultIndex: r, allowMultiple: !0, reduceMotion: !0, onChange: s, sx: { display: "flex", flexDirection: "column", gap: 2 }, children: c() } ); }, qV = (e) => { const { menuType: t = "icon", iconTooltip: r, buttonText: i, isLazy: s = !0, menuItems: c, menuProps: f, menuButtonProps: m, menuListProps: y, menuItemProps: g } = e, S = () => { const E = []; return c.forEach((w, D) => { E.push( /* @__PURE__ */ u.jsx( Bo, { onClick: w.onClick, fontSize: "sm", ...g, children: w.item }, D ) ); }), E; }; return /* @__PURE__ */ u.jsx(Ib, { ...f, isLazy: s, children: ({ isOpen: E }) => /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx( Lb, { as: t === "icon" ? Id : mg, tooltip: r, "aria-label": r, icon: E ? /* @__PURE__ */ u.jsx(G9, {}) : /* @__PURE__ */ u.jsx(W9, {}), paddingX: 0, paddingY: t === "regular" ? 2 : 0, ...m, children: t === "regular" && i } ), /* @__PURE__ */ u.jsx(Fb, { zIndex: 15, padding: 0, ...y, children: S() }) ] }) }); }, YV = Yr(qV), KV = Ze( Vn, (e) => ({ isProcessing: e.isProcessing, isConnected: e.isConnected, isCancelable: e.isCancelable, currentIteration: e.currentIteration, totalIterations: e.totalIterations, cancelType: e.cancelOptions.cancelType, cancelAfter: e.cancelOptions.cancelAfter }), { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), XV = (e) => { const t = xe(), { btnGroupWidth: r = "auto", ...i } = e, { isProcessing: s, isConnected: c, isCancelable: f, currentIteration: m, totalIterations: y, cancelType: g, cancelAfter: S } = W(KV), E = ee(() => { t($A()), t(Sx(null)); }, [t]), { t: w } = Ce(), D = S !== null; We( "shift+x", () => { (c || s) && f && E(); }, [c, s, f] ), ot(() => { S !== null && S < m && E(); }, [S, m, E]); const M = [ { item: w("parameters.cancel.immediate"), onClick: () => t(Rw("immediate")) }, { item: w("parameters.cancel.schedule"), onClick: () => t(Rw("scheduled")) } ]; return /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, width: r, children: [ g === "immediate" ? /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(q9, {}), tooltip: w("parameters.cancel.immediate"), "aria-label": w("parameters.cancel.immediate"), isDisabled: !c || !s || !f, onClick: E, colorScheme: "error", ...i } ) : /* @__PURE__ */ u.jsx( Be, { icon: D ? /* @__PURE__ */ u.jsx(QA, {}) : /* @__PURE__ */ u.jsx(A9, {}), tooltip: w(D ? "parameters.cancel.isScheduled" : "parameters.cancel.schedule"), "aria-label": w(D ? "parameters.cancel.isScheduled" : "parameters.cancel.schedule"), isDisabled: !c || !s || !f || m === y, onClick: () => { t(D ? Sx(null) : Sx(m)); }, colorScheme: "error", ...i } ), /* @__PURE__ */ u.jsx( YV, { menuItems: M, iconTooltip: w("parameters.cancel.setType"), menuButtonProps: { colorScheme: "error", minWidth: 5 } } ) ] }); }, E1 = Yr(XV), on = (e) => e.canvas, er = Ze( [on, Bn, Vn], (e, t, r) => e.layerState.stagingArea.images.length > 0 || t === "unifiedCanvas" && r.isProcessing ), dk = (e) => e.canvas.layerState.objects.find(W2), w1 = (e) => e.generation; Ze( w1, ({ shouldRandomizeSeed: e, shouldGenerateVariations: t }) => e || t, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); const fk = Ze( [ w1, Vn, dk, Bn ], (e, t, r, i) => { const { prompt: s, shouldGenerateVariations: c, seedWeights: f, initialImage: m, seed: y } = e, { isProcessing: g, isConnected: S } = t; let E = !0; const w = []; return (!s || Boolean(s.match(/^[\s\r\n]+$/))) && (E = !1, w.push("Missing prompt")), i === "img2img" && !m && (E = !1, w.push("No initial image selected")), g && (E = !1, w.push("System Busy")), S || (E = !1, w.push("System Disconnected")), c && (!(H2(f) || f === "") || y === -1) && (E = !1, w.push("Seed-Weights badly formatted.")), { isReady: E, reasonsWhyNotReady: w }; }, { memoizeOptions: { equalityCheck: Pe.isEqual, resultEqualityCheck: Pe.isEqual } } ); function j1(e) { const { iconButton: t = !1, ...r } = e, i = xe(), { isReady: s } = W(fk), c = W(Bn), f = () => { i(SS(c)); }, { t: m } = Ce(); return We( ["ctrl+enter", "meta+enter"], () => { i(V2()), i(SS(c)); }, { enabled: () => s, preventDefault: !0, enableOnFormTags: ["input", "textarea", "select"] }, [s, c] ), /* @__PURE__ */ u.jsx(Ut, { style: { flexGrow: 4 }, children: t ? /* @__PURE__ */ u.jsx( Be, { "aria-label": m("parameters.invoke"), type: "submit", icon: /* @__PURE__ */ u.jsx(ZA, {}), isDisabled: !s, onClick: f, flexGrow: 1, w: "100%", tooltip: m("parameters.invoke"), tooltipProps: { placement: "bottom" }, colorScheme: "accent", ...r } ) : /* @__PURE__ */ u.jsx( an, { "aria-label": m("parameters.invoke"), type: "submit", isDisabled: !s, onClick: f, flexGrow: 1, w: "100%", colorScheme: "accent", fontWeight: 700, ...r, children: "Invoke" } ) }); } const $V = Ze( p1, ({ shouldLoopback: e }) => e ), QV = () => { const e = xe(), t = W($V), { t: r } = Ce(); return /* @__PURE__ */ u.jsx( Be, { "aria-label": r("parameters.toggleLoopback"), tooltip: r("parameters.toggleLoopback"), isChecked: t, icon: /* @__PURE__ */ u.jsx(JA, {}), onClick: () => { e(ez(!t)); } } ); }, T1 = () => { const e = W(Bn); return /* @__PURE__ */ u.jsxs(ne, { gap: 2, children: [ /* @__PURE__ */ u.jsx(j1, {}), e === "img2img" && /* @__PURE__ */ u.jsx(QV, {}), /* @__PURE__ */ u.jsx(E1, {}) ] }); }, D1 = () => { const e = W( (i) => i.generation.negativePrompt ), t = xe(), { t: r } = Ce(); return /* @__PURE__ */ u.jsx(dn, { children: /* @__PURE__ */ u.jsx( qb, { id: "negativePrompt", name: "negativePrompt", value: e, onChange: (i) => t(k2(i.target.value)), placeholder: r("parameters.negativePrompts"), _focusVisible: { borderColor: "error.600" }, fontSize: "sm" } ) }); }, ZV = Ze( [(e) => e.generation, Bn], (e, t) => ({ prompt: e.prompt, activeTabName: t }), { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), _1 = () => { const e = xe(), { prompt: t, activeTabName: r } = W(ZV), { isReady: i } = W(fk), s = Xe(null), { t: c } = Ce(), f = (y) => { e(M2(y.target.value)); }; We( "alt+a", () => { var y; (y = s.current) == null || y.focus(); }, [] ); const m = (y) => { y.key === "Enter" && y.shiftKey === !1 && i && (y.preventDefault(), e(SS(r))); }; return /* @__PURE__ */ u.jsx(Ut, { children: /* @__PURE__ */ u.jsx( dn, { isInvalid: t.length === 0 || Boolean(t.match(/^[\s\r\n]+$/)), children: /* @__PURE__ */ u.jsx( qb, { id: "prompt", name: "prompt", placeholder: c("parameters.promptPlaceholder"), value: t, onChange: f, onKeyDown: m, resize: "vertical", ref: s, minH: 40 } ) } ) }); }; function JV() { const e = xe(), t = W( (s) => s.generation.shouldFitToWidthHeight ), r = (s) => e(I2(s.target.checked)), { t: i } = Ce(); return /* @__PURE__ */ u.jsx( ti, { label: i("parameters.imageFit"), isChecked: t, onChange: r } ); } function pk(e) { const { t } = Ce(), { label: r = `${t("parameters.strength")}` } = e, i = W( (m) => m.generation.img2imgStrength ), s = xe(), c = (m) => s(xS(m)), f = () => { s(xS(0.75)); }; return /* @__PURE__ */ u.jsx( jn, { label: r, step: 0.01, min: 0.01, max: 1, onChange: c, value: i, isInteger: !1, withInput: !0, withSliderMarks: !0, inputWidth: 22, withReset: !0, handleReset: f } ); } function eW() { const { t: e } = Ce(); return /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "stretch", children: [ /* @__PURE__ */ u.jsx(pk, { label: e("parameters.img2imgStrength") }), /* @__PURE__ */ u.jsx(JV, {}) ] }); } const tW = () => { const { t: e } = Ce(), t = { general: { header: `${e("parameters.general")}`, feature: void 0, content: /* @__PURE__ */ u.jsx(b1, {}) }, imageToImage: { header: `${e("parameters.imageToImage")}`, feature: void 0, content: /* @__PURE__ */ u.jsx(eW, {}) }, seed: { header: `${e("parameters.seed")}`, feature: Ca.SEED, content: /* @__PURE__ */ u.jsx(y1, {}) }, variations: { header: `${e("parameters.variations")}`, feature: Ca.VARIATIONS, content: /* @__PURE__ */ u.jsx(S1, {}), additionalHeaderComponents: /* @__PURE__ */ u.jsx(x1, {}) }, face_restore: { header: `${e("parameters.faceRestoration")}`, feature: Ca.FACE_CORRECTION, content: /* @__PURE__ */ u.jsx(d1, {}), additionalHeaderComponents: /* @__PURE__ */ u.jsx(lk, {}) }, upscale: { header: `${e("parameters.upscaling")}`, feature: Ca.UPSCALE, content: /* @__PURE__ */ u.jsx(f1, {}), additionalHeaderComponents: /* @__PURE__ */ u.jsx(ck, {}) }, symmetry: { header: `${e("parameters.symmetry")}`, content: /* @__PURE__ */ u.jsx(m1, {}), additionalHeaderComponents: /* @__PURE__ */ u.jsx(g1, {}) }, other: { header: `${e("parameters.otherOptions")}`, feature: Ca.OTHER, content: /* @__PURE__ */ u.jsx(PV, {}) } }; return /* @__PURE__ */ u.jsxs(ne, { flexDir: "column", gap: 2, position: "relative", children: [ /* @__PURE__ */ u.jsx(_1, {}), /* @__PURE__ */ u.jsx(D1, {}), /* @__PURE__ */ u.jsx(T1, {}), /* @__PURE__ */ u.jsx(C1, { accordionInfo: t }) ] }); }, nW = Yr(tW); function rW() { return /* @__PURE__ */ u.jsx(c1, { parametersPanelContent: /* @__PURE__ */ u.jsx(nW, {}), children: /* @__PURE__ */ u.jsx(MV, {}) }); } const aW = () => /* @__PURE__ */ u.jsx( Ut, { sx: { width: "100%", height: "100%", borderRadius: "base", bg: "base.850" }, children: /* @__PURE__ */ u.jsx(ne, { sx: { p: 4, width: "100%", height: "100%" }, children: /* @__PURE__ */ u.jsx(sk, {}) }) } ), iW = Ze( [p1], ({ hiresFix: e, hiresStrength: t }) => ({ hiresFix: e, hiresStrength: t }), { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), oW = () => { const { hiresFix: e, hiresStrength: t } = W(iW), r = xe(), { t: i } = Ce(), s = (f) => { r(Pw(f)); }, c = () => { r(Pw(0.75)); }; return /* @__PURE__ */ u.jsx( jn, { label: i("parameters.hiresStrength"), step: 0.01, min: 0.01, max: 0.99, onChange: s, value: t, isInteger: !1, withInput: !0, withSliderMarks: !0, withReset: !0, handleReset: c, isSliderDisabled: !e, isInputDisabled: !e, isResetDisabled: !e } ); }, sW = () => { const e = xe(), t = W( (s) => s.postprocessing.hiresFix ), { t: r } = Ce(), i = (s) => e(z2(s.target.checked)); return /* @__PURE__ */ u.jsx( ti, { label: r("parameters.hiresOptim"), fontSize: "md", isChecked: t, onChange: i } ); }, lW = () => /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "stretch", children: [ /* @__PURE__ */ u.jsx(uk, {}), /* @__PURE__ */ u.jsx(sW, {}), /* @__PURE__ */ u.jsx(oW, {}) ] }), uW = () => { const { t: e } = Ce(), t = { general: { header: `${e("parameters.general")}`, feature: void 0, content: /* @__PURE__ */ u.jsx(b1, {}) }, seed: { header: `${e("parameters.seed")}`, feature: Ca.SEED, content: /* @__PURE__ */ u.jsx(y1, {}) }, variations: { header: `${e("parameters.variations")}`, feature: Ca.VARIATIONS, content: /* @__PURE__ */ u.jsx(S1, {}), additionalHeaderComponents: /* @__PURE__ */ u.jsx(x1, {}) }, face_restore: { header: `${e("parameters.faceRestoration")}`, feature: Ca.FACE_CORRECTION, content: /* @__PURE__ */ u.jsx(d1, {}), additionalHeaderComponents: /* @__PURE__ */ u.jsx(lk, {}) }, upscale: { header: `${e("parameters.upscaling")}`, feature: Ca.UPSCALE, content: /* @__PURE__ */ u.jsx(f1, {}), additionalHeaderComponents: /* @__PURE__ */ u.jsx(ck, {}) }, symmetry: { header: `${e("parameters.symmetry")}`, content: /* @__PURE__ */ u.jsx(m1, {}), additionalHeaderComponents: /* @__PURE__ */ u.jsx(g1, {}) }, other: { header: `${e("parameters.otherOptions")}`, feature: Ca.OTHER, content: /* @__PURE__ */ u.jsx(lW, {}) } }; return /* @__PURE__ */ u.jsxs(ne, { flexDir: "column", gap: 2, children: [ /* @__PURE__ */ u.jsx(_1, {}), /* @__PURE__ */ u.jsx(D1, {}), /* @__PURE__ */ u.jsx(T1, {}), /* @__PURE__ */ u.jsx(C1, { accordionInfo: t }) ] }); }, cW = Yr(uW); function dW() { return /* @__PURE__ */ u.jsx(c1, { parametersPanelContent: /* @__PURE__ */ u.jsx(cW, {}), children: /* @__PURE__ */ u.jsx(aW, {}) }); } var ZS = {}, fW = { get exports() { return ZS; }, set exports(e) { ZS = e; } }, Lu = {}, pW = { get exports() { return Lu; }, set exports(e) { Lu = e; } }, rS = {}; /** * @license React * scheduler.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 UT; function hW() { return UT || (UT = 1, function(e) { function t(K, se) { var B = K.length; K.push(se); e: for (; 0 < B; ) { var re = B - 1 >>> 1, ke = K[re]; if (0 < s(ke, se)) K[re] = se, K[B] = ke, B = re; else break e; } } function r(K) { return K.length === 0 ? null : K[0]; } function i(K) { if (K.length === 0) return null; var se = K[0], B = K.pop(); if (B !== se) { K[0] = B; e: for (var re = 0, ke = K.length, De = ke >>> 1; re < De; ) { var Se = 2 * (re + 1) - 1, be = K[Se], Ie = Se + 1, Ue = K[Ie]; if (0 > s(be, B)) Ie < ke && 0 > s(Ue, be) ? (K[re] = Ue, K[Ie] = B, re = Ie) : (K[re] = be, K[Se] = B, re = Se); else if (Ie < ke && 0 > s(Ue, B)) K[re] = Ue, K[Ie] = B, re = Ie; else break e; } } return se; } function s(K, se) { var B = K.sortIndex - se.sortIndex; return B !== 0 ? B : K.id - se.id; } if (typeof performance == "object" && typeof performance.now == "function") { var c = performance; e.unstable_now = function() { return c.now(); }; } else { var f = Date, m = f.now(); e.unstable_now = function() { return f.now() - m; }; } var y = [], g = [], S = 1, E = null, w = 3, D = !1, M = !1, k = !1, R = typeof setTimeout == "function" ? setTimeout : null, O = typeof clearTimeout == "function" ? clearTimeout : null, I = typeof setImmediate < "u" ? setImmediate : null; typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling); function A(K) { for (var se = r(g); se !== null; ) { if (se.callback === null) i(g); else if (se.startTime <= K) i(g), se.sortIndex = se.expirationTime, t(y, se); else break; se = r(g); } } function L(K) { if (k = !1, A(K), !M) if (r(y) !== null) M = !0, Me(H); else { var se = r(g); se !== null && te(L, se.startTime - K); } } function H(K, se) { M = !1, k && (k = !1, O($), $ = -1), D = !0; var B = w; try { for (A(se), E = r(y); E !== null && (!(E.expirationTime > se) || K && !Y()); ) { var re = E.callback; if (typeof re == "function") { E.callback = null, w = E.priorityLevel; var ke = re(E.expirationTime <= se); se = e.unstable_now(), typeof ke == "function" ? E.callback = ke : E === r(y) && i(y), A(se); } else i(y); E = r(y); } if (E !== null) var De = !0; else { var Se = r(g); Se !== null && te(L, Se.startTime - se), De = !1; } return De; } finally { E = null, w = B, D = !1; } } var q = !1, U = null, $ = -1, ae = 5, oe = -1; function Y() { return !(e.unstable_now() - oe < ae); } function ve() { if (U !== null) { var K = e.unstable_now(); oe = K; var se = !0; try { se = U(!0, K); } finally { se ? de() : (q = !1, U = null); } } else q = !1; } var de; if (typeof I == "function") de = function() { I(ve); }; else if (typeof MessageChannel < "u") { var fe = new MessageChannel(), _e = fe.port2; fe.port1.onmessage = ve, de = function() { _e.postMessage(null); }; } else de = function() { R(ve, 0); }; function Me(K) { U = K, q || (q = !0, de()); } function te(K, se) { $ = R(function() { K(e.unstable_now()); }, se); } e.unstable_IdlePriority = 5, e.unstable_ImmediatePriority = 1, e.unstable_LowPriority = 4, e.unstable_NormalPriority = 3, e.unstable_Profiling = null, e.unstable_UserBlockingPriority = 2, e.unstable_cancelCallback = function(K) { K.callback = null; }, e.unstable_continueExecution = function() { M || D || (M = !0, Me(H)); }, e.unstable_forceFrameRate = function(K) { 0 > K || 125 < K ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : ae = 0 < K ? Math.floor(1e3 / K) : 5; }, e.unstable_getCurrentPriorityLevel = function() { return w; }, e.unstable_getFirstCallbackNode = function() { return r(y); }, e.unstable_next = function(K) { switch (w) { case 1: case 2: case 3: var se = 3; break; default: se = w; } var B = w; w = se; try { return K(); } finally { w = B; } }, e.unstable_pauseExecution = function() { }, e.unstable_requestPaint = function() { }, e.unstable_runWithPriority = function(K, se) { switch (K) { case 1: case 2: case 3: case 4: case 5: break; default: K = 3; } var B = w; w = K; try { return se(); } finally { w = B; } }, e.unstable_scheduleCallback = function(K, se, B) { var re = e.unstable_now(); switch (typeof B == "object" && B !== null ? (B = B.delay, B = typeof B == "number" && 0 < B ? re + B : re) : B = re, K) { case 1: var ke = -1; break; case 2: ke = 250; break; case 5: ke = 1073741823; break; case 4: ke = 1e4; break; default: ke = 5e3; } return ke = B + ke, K = { id: S++, callback: se, priorityLevel: K, startTime: B, expirationTime: ke, sortIndex: -1 }, B > re ? (K.sortIndex = B, t(g, K), r(y) === null && K === r(g) && (k ? (O($), $ = -1) : k = !0, te(L, B - re))) : (K.sortIndex = ke, t(y, K), M || D || (M = !0, Me(H))), K; }, e.unstable_shouldYield = Y, e.unstable_wrapCallback = function(K) { var se = w; return function() { var B = w; w = se; try { return K.apply(this, arguments); } finally { w = B; } }; }; }(rS)), rS; } var aS = {}; /** * @license React * scheduler.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 HT; function vW() { return HT || (HT = 1, function(e) { process.env.NODE_ENV !== "production" && function() { typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); var t = !1, r = !1, i = 5; function s(Re, pe) { var Ne = Re.length; Re.push(pe), m(Re, pe, Ne); } function c(Re) { return Re.length === 0 ? null : Re[0]; } function f(Re) { if (Re.length === 0) return null; var pe = Re[0], Ne = Re.pop(); return Ne !== pe && (Re[0] = Ne, y(Re, Ne, 0)), pe; } function m(Re, pe, Ne) { for (var ft = Ne; ft > 0; ) { var Vt = ft - 1 >>> 1, vn = Re[Vt]; if (g(vn, pe) > 0) Re[Vt] = pe, Re[ft] = vn, ft = Vt; else return; } } function y(Re, pe, Ne) { for (var ft = Ne, Vt = Re.length, vn = Vt >>> 1; ft < vn; ) { var st = (ft + 1) * 2 - 1, rt = Re[st], kn = st + 1, bn = Re[kn]; if (g(rt, pe) < 0) kn < Vt && g(bn, rt) < 0 ? (Re[ft] = bn, Re[kn] = pe, ft = kn) : (Re[ft] = rt, Re[st] = pe, ft = st); else if (kn < Vt && g(bn, pe) < 0) Re[ft] = bn, Re[kn] = pe, ft = kn; else return; } } function g(Re, pe) { var Ne = Re.sortIndex - pe.sortIndex; return Ne !== 0 ? Ne : Re.id - pe.id; } var S = 1, E = 2, w = 3, D = 4, M = 5; function k(Re, pe) { } var R = typeof performance == "object" && typeof performance.now == "function"; if (R) { var O = performance; e.unstable_now = function() { return O.now(); }; } else { var I = Date, A = I.now(); e.unstable_now = function() { return I.now() - A; }; } var L = 1073741823, H = -1, q = 250, U = 5e3, $ = 1e4, ae = L, oe = [], Y = [], ve = 1, de = null, fe = w, _e = !1, Me = !1, te = !1, K = typeof setTimeout == "function" ? setTimeout : null, se = typeof clearTimeout == "function" ? clearTimeout : null, B = typeof setImmediate < "u" ? setImmediate : null; typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling); function re(Re) { for (var pe = c(Y); pe !== null; ) { if (pe.callback === null) f(Y); else if (pe.startTime <= Re) f(Y), pe.sortIndex = pe.expirationTime, s(oe, pe); else return; pe = c(Y); } } function ke(Re) { if (te = !1, re(Re), !Me) if (c(oe) !== null) Me = !0, Dt(De); else { var pe = c(Y); pe !== null && Ht(ke, pe.startTime - Re); } } function De(Re, pe) { Me = !1, te && (te = !1, Te()), _e = !0; var Ne = fe; try { var ft; if (!r) return Se(Re, pe); } finally { de = null, fe = Ne, _e = !1; } } function Se(Re, pe) { var Ne = pe; for (re(Ne), de = c(oe); de !== null && !t && !(de.expirationTime > Ne && (!Re || tr())); ) { var ft = de.callback; if (typeof ft == "function") { de.callback = null, fe = de.priorityLevel; var Vt = de.expirationTime <= Ne, vn = ft(Vt); Ne = e.unstable_now(), typeof vn == "function" ? de.callback = vn : de === c(oe) && f(oe), re(Ne); } else f(oe); de = c(oe); } if (de !== null) return !0; var st = c(Y); return st !== null && Ht(ke, st.startTime - Ne), !1; } function be(Re, pe) { switch (Re) { case S: case E: case w: case D: case M: break; default: Re = w; } var Ne = fe; fe = Re; try { return pe(); } finally { fe = Ne; } } function Ie(Re) { var pe; switch (fe) { case S: case E: case w: pe = w; break; default: pe = fe; break; } var Ne = fe; fe = pe; try { return Re(); } finally { fe = Ne; } } function Ue(Re) { var pe = fe; return function() { var Ne = fe; fe = pe; try { return Re.apply(this, arguments); } finally { fe = Ne; } }; } function tt(Re, pe, Ne) { var ft = e.unstable_now(), Vt; if (typeof Ne == "object" && Ne !== null) { var vn = Ne.delay; typeof vn == "number" && vn > 0 ? Vt = ft + vn : Vt = ft; } else Vt = ft; var st; switch (Re) { case S: st = H; break; case E: st = q; break; case M: st = ae; break; case D: st = $; break; case w: default: st = U; break; } var rt = Vt + st, kn = { id: ve++, callback: pe, priorityLevel: Re, startTime: Vt, expirationTime: rt, sortIndex: -1 }; return Vt > ft ? (kn.sortIndex = Vt, s(Y, kn), c(oe) === null && kn === c(Y) && (te ? Te() : te = !0, Ht(ke, Vt - ft))) : (kn.sortIndex = rt, s(oe, kn), !Me && !_e && (Me = !0, Dt(De))), kn; } function ht() { } function dt() { !Me && !_e && (Me = !0, Dt(De)); } function Le() { return c(oe); } function yt(Re) { Re.callback = null; } function Ot() { return fe; } var Qe = !1, rn = null, Tn = -1, pn = i, Wn = -1; function tr() { var Re = e.unstable_now() - Wn; return !(Re < pn); } function Q() { } function He(Re) { if (Re < 0 || Re > 125) { console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"); return; } Re > 0 ? pn = Math.floor(1e3 / Re) : pn = i; } var Fe = function() { if (rn !== null) { var Re = e.unstable_now(); Wn = Re; var pe = !0, Ne = !0; try { Ne = rn(pe, Re); } finally { Ne ? at() : (Qe = !1, rn = null); } } else Qe = !1; }, at; if (typeof B == "function") at = function() { B(Fe); }; else if (typeof MessageChannel < "u") { var he = new MessageChannel(), Ae = he.port2; he.port1.onmessage = Fe, at = function() { Ae.postMessage(null); }; } else at = function() { K(Fe, 0); }; function Dt(Re) { rn = Re, Qe || (Qe = !0, at()); } function Ht(Re, pe) { Tn = K(function() { Re(e.unstable_now()); }, pe); } function Te() { se(Tn), Tn = -1; } var _t = Q, Zt = null; e.unstable_IdlePriority = M, e.unstable_ImmediatePriority = S, e.unstable_LowPriority = D, e.unstable_NormalPriority = w, e.unstable_Profiling = Zt, e.unstable_UserBlockingPriority = E, e.unstable_cancelCallback = yt, e.unstable_continueExecution = dt, e.unstable_forceFrameRate = He, e.unstable_getCurrentPriorityLevel = Ot, e.unstable_getFirstCallbackNode = Le, e.unstable_next = Ie, e.unstable_pauseExecution = ht, e.unstable_requestPaint = _t, e.unstable_runWithPriority = be, e.unstable_scheduleCallback = tt, e.unstable_shouldYield = tr, e.unstable_wrapCallback = Ue, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); }(); }(aS)), aS; } (function(e) { process.env.NODE_ENV === "production" ? e.exports = hW() : e.exports = vW(); })(pW); /** * @license React * react-reconciler.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 iS, VT; function mW() { return VT || (VT = 1, iS = function(t) { var r = {}, i = jt, s = Lu, c = Object.assign; function f(o) { for (var l = "https://reactjs.org/docs/error-decoder.html?invariant=" + o, h = 1; h < arguments.length; h++) l += "&args[]=" + encodeURIComponent(arguments[h]); return "Minified React error #" + o + "; visit " + l + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; } var m = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, y = Symbol.for("react.element"), g = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), D = Symbol.for("react.provider"), M = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), O = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), H = Symbol.iterator; function q(o) { return o === null || typeof o != "object" ? null : (o = H && o[H] || o["@@iterator"], typeof o == "function" ? o : null); } function U(o) { if (o == null) return null; if (typeof o == "function") return o.displayName || o.name || null; if (typeof o == "string") return o; switch (o) { case S: return "Fragment"; case g: return "Portal"; case w: return "Profiler"; case E: return "StrictMode"; case R: return "Suspense"; case O: return "SuspenseList"; } if (typeof o == "object") switch (o.$$typeof) { case M: return (o.displayName || "Context") + ".Consumer"; case D: return (o._context.displayName || "Context") + ".Provider"; case k: var l = o.render; return o = o.displayName, o || (o = l.displayName || l.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o; case I: return l = o.displayName || null, l !== null ? l : U(o.type) || "Memo"; case A: l = o._payload, o = o._init; try { return U(o(l)); } catch { } } return null; } function $(o) { var l = o.type; switch (o.tag) { case 24: return "Cache"; case 9: return (l.displayName || "Context") + ".Consumer"; case 10: return (l._context.displayName || "Context") + ".Provider"; case 18: return "DehydratedFragment"; case 11: return o = l.render, o = o.displayName || o.name || "", l.displayName || (o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"); case 7: return "Fragment"; case 5: return l; case 4: return "Portal"; case 3: return "Root"; case 6: return "Text"; case 16: return U(l); case 8: return l === E ? "StrictMode" : "Mode"; case 22: return "Offscreen"; case 12: return "Profiler"; case 21: return "Scope"; case 13: return "Suspense"; case 19: return "SuspenseList"; case 25: return "TracingMarker"; case 1: case 0: case 17: case 2: case 14: case 15: if (typeof l == "function") return l.displayName || l.name || null; if (typeof l == "string") return l; } return null; } function ae(o) { var l = o, h = o; if (o.alternate) for (; l.return; ) l = l.return; else { o = l; do l = o, l.flags & 4098 && (h = l.return), o = l.return; while (o); } return l.tag === 3 ? h : null; } function oe(o) { if (ae(o) !== o) throw Error(f(188)); } function Y(o) { var l = o.alternate; if (!l) { if (l = ae(o), l === null) throw Error(f(188)); return l !== o ? null : o; } for (var h = o, x = l; ; ) { var C = h.return; if (C === null) break; var j = C.alternate; if (j === null) { if (x = C.return, x !== null) { h = x; continue; } break; } if (C.child === j.child) { for (j = C.child; j; ) { if (j === h) return oe(C), o; if (j === x) return oe(C), l; j = j.sibling; } throw Error(f(188)); } if (h.return !== x.return) h = C, x = j; else { for (var N = !1, V = C.child; V; ) { if (V === h) { N = !0, h = C, x = j; break; } if (V === x) { N = !0, x = C, h = j; break; } V = V.sibling; } if (!N) { for (V = j.child; V; ) { if (V === h) { N = !0, h = j, x = C; break; } if (V === x) { N = !0, x = j, h = C; break; } V = V.sibling; } if (!N) throw Error(f(189)); } } if (h.alternate !== x) throw Error(f(190)); } if (h.tag !== 3) throw Error(f(188)); return h.stateNode.current === h ? o : l; } function ve(o) { return o = Y(o), o !== null ? de(o) : null; } function de(o) { if (o.tag === 5 || o.tag === 6) return o; for (o = o.child; o !== null; ) { var l = de(o); if (l !== null) return l; o = o.sibling; } return null; } function fe(o) { if (o.tag === 5 || o.tag === 6) return o; for (o = o.child; o !== null; ) { if (o.tag !== 4) { var l = fe(o); if (l !== null) return l; } o = o.sibling; } return null; } var _e = Array.isArray, Me = t.getPublicInstance, te = t.getRootHostContext, K = t.getChildHostContext, se = t.prepareForCommit, B = t.resetAfterCommit, re = t.createInstance, ke = t.appendInitialChild, De = t.finalizeInitialChildren, Se = t.prepareUpdate, be = t.shouldSetTextContent, Ie = t.createTextInstance, Ue = t.scheduleTimeout, tt = t.cancelTimeout, ht = t.noTimeout, dt = t.isPrimaryRenderer, Le = t.supportsMutation, yt = t.supportsPersistence, Ot = t.supportsHydration, Qe = t.getInstanceFromNode, rn = t.preparePortalMount, Tn = t.getCurrentEventPriority, pn = t.detachDeletedInstance, Wn = t.supportsMicrotasks, tr = t.scheduleMicrotask, Q = t.supportsTestSelectors, He = t.findFiberRoot, Fe = t.getBoundingRect, at = t.getTextContent, he = t.isHiddenSubtree, Ae = t.matchAccessibilityRole, Dt = t.setFocusIfFocusable, Ht = t.setupIntersectionObserver, Te = t.appendChild, _t = t.appendChildToContainer, Zt = t.commitTextUpdate, Re = t.commitMount, pe = t.commitUpdate, Ne = t.insertBefore, ft = t.insertInContainerBefore, Vt = t.removeChild, vn = t.removeChildFromContainer, st = t.resetTextContent, rt = t.hideInstance, kn = t.hideTextInstance, bn = t.unhideInstance, Ft = t.unhideTextInstance, sa = t.clearContainer, Wl = t.cloneInstance, Zu = t.createContainerChildSet, tn = t.appendChildToContainerChildSet, Oi = t.finalizeContainerChildren, gi = t.replaceContainerChildren, fo = t.cloneHiddenInstance, Va = t.cloneHiddenTextInstance, Ai = t.canHydrateInstance, Zo = t.canHydrateTextInstance, Ju = t.canHydrateSuspenseInstance, fh = t.isSuspenseInstancePending, Xd = t.isSuspenseInstanceFallback, Gl = t.getSuspenseInstanceFallbackErrorDetails, Kr = t.registerSuspenseInstanceRetry, Ls = t.getNextHydratableSibling, ph = t.getFirstHydratableChild, $d = t.getFirstHydratableChildWithinContainer, Jo = t.getFirstHydratableChildWithinSuspenseInstance, Qd = t.hydrateInstance, zi = t.hydrateTextInstance, ec = t.hydrateSuspenseInstance, Zd = t.getNextHydratableInstanceAfterSuspenseInstance, ql = t.commitHydratedContainer, Yl = t.commitHydratedSuspenseInstance, Bs = t.clearSuspenseBoundary, Ii = t.clearSuspenseBoundaryFromContainer, Wg = t.shouldDeleteUnhydratedTailInstances, tc = t.didNotMatchHydratedContainerTextInstance, Gg = t.didNotMatchHydratedTextInstance, Jd; function Us(o) { if (Jd === void 0) try { throw Error(); } catch (h) { var l = h.stack.trim().match(/\n( *(at )?)/); Jd = l && l[1] || ""; } return ` ` + Jd + o; } var nc = !1; function Kl(o, l) { if (!o || nc) return ""; nc = !0; var h = Error.prepareStackTrace; Error.prepareStackTrace = void 0; try { if (l) if (l = function() { throw Error(); }, Object.defineProperty(l.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(l, []); } catch (Oe) { var x = Oe; } Reflect.construct(o, [], l); } else { try { l.call(); } catch (Oe) { x = Oe; } o.call(l.prototype); } else { try { throw Error(); } catch (Oe) { x = Oe; } o(); } } catch (Oe) { if (Oe && x && typeof Oe.stack == "string") { for (var C = Oe.stack.split(` `), j = x.stack.split(` `), N = C.length - 1, V = j.length - 1; 1 <= N && 0 <= V && C[N] !== j[V]; ) V--; for (; 1 <= N && 0 <= V; N--, V--) if (C[N] !== j[V]) { if (N !== 1 || V !== 1) do if (N--, V--, 0 > V || C[N] !== j[V]) { var ue = ` ` + C[N].replace(" at new ", " at "); return o.displayName && ue.includes("") && (ue = ue.replace("", o.displayName)), ue; } while (1 <= N && 0 <= V); break; } } } finally { nc = !1, Error.prepareStackTrace = h; } return (o = o ? o.displayName || o.name : "") ? Us(o) : ""; } var hh = Object.prototype.hasOwnProperty, ef = [], es = -1; function po(o) { return { current: o }; } function Gt(o) { 0 > es || (o.current = ef[es], ef[es] = null, es--); } function mn(o, l) { es++, ef[es] = o.current, o.current = l; } var ho = {}, Br = po(ho), la = po(!1), ts = ho; function Hs(o, l) { var h = o.type.contextTypes; if (!h) return ho; var x = o.stateNode; if (x && x.__reactInternalMemoizedUnmaskedChildContext === l) return x.__reactInternalMemoizedMaskedChildContext; var C = {}, j; for (j in h) C[j] = l[j]; return x && (o = o.stateNode, o.__reactInternalMemoizedUnmaskedChildContext = l, o.__reactInternalMemoizedMaskedChildContext = C), C; } function Ur(o) { return o = o.childContextTypes, o != null; } function Xl() { Gt(la), Gt(Br); } function tf(o, l, h) { if (Br.current !== ho) throw Error(f(168)); mn(Br, l), mn(la, h); } function rc(o, l, h) { var x = o.stateNode; if (l = l.childContextTypes, typeof x.getChildContext != "function") return h; x = x.getChildContext(); for (var C in x) if (!(C in l)) throw Error(f(108, $(o) || "Unknown", C)); return c({}, h, x); } function $l(o) { return o = (o = o.stateNode) && o.__reactInternalMemoizedMergedChildContext || ho, ts = Br.current, mn(Br, o), mn(la, la.current), !0; } function nf(o, l, h) { var x = o.stateNode; if (!x) throw Error(f(169)); h ? (o = rc(o, l, ts), x.__reactInternalMemoizedMergedChildContext = o, Gt(la), Gt(Br), mn(Br, o)) : Gt(la), mn(la, h); } var ri = Math.clz32 ? Math.clz32 : qg, rf = Math.log, ac = Math.LN2; function qg(o) { return o >>>= 0, o === 0 ? 32 : 31 - (rf(o) / ac | 0) | 0; } var Hr = 64, ns = 4194304; function Vr(o) { switch (o & -o) { case 1: return 1; case 2: return 2; case 4: return 4; case 8: return 8; case 16: return 16; case 32: return 32; case 64: case 128: case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: return o & 4194240; case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: return o & 130023424; case 134217728: return 134217728; case 268435456: return 268435456; case 536870912: return 536870912; case 1073741824: return 1073741824; default: return o; } } function ic(o, l) { var h = o.pendingLanes; if (h === 0) return 0; var x = 0, C = o.suspendedLanes, j = o.pingedLanes, N = h & 268435455; if (N !== 0) { var V = N & ~C; V !== 0 ? x = Vr(V) : (j &= N, j !== 0 && (x = Vr(j))); } else N = h & ~C, N !== 0 ? x = Vr(N) : j !== 0 && (x = Vr(j)); if (x === 0) return 0; if (l !== 0 && l !== x && !(l & C) && (C = x & -x, j = l & -l, C >= j || C === 16 && (j & 4194240) !== 0)) return l; if (x & 4 && (x |= h & 16), l = o.entangledLanes, l !== 0) for (o = o.entanglements, l &= x; 0 < l; ) h = 31 - ri(l), C = 1 << h, x |= o[h], l &= ~C; return x; } function Yg(o, l) { switch (o) { case 1: case 2: case 4: return l + 250; case 8: case 16: case 32: case 64: case 128: case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: return l + 5e3; case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: return -1; case 134217728: case 268435456: case 536870912: case 1073741824: return -1; default: return -1; } } function Kg(o, l) { for (var h = o.suspendedLanes, x = o.pingedLanes, C = o.expirationTimes, j = o.pendingLanes; 0 < j; ) { var N = 31 - ri(j), V = 1 << N, ue = C[N]; ue === -1 ? (!(V & h) || V & x) && (C[N] = Yg(V, l)) : ue <= l && (o.expiredLanes |= V), j &= ~V; } } function af(o) { return o = o.pendingLanes & -1073741825, o !== 0 ? o : o & 1073741824 ? 1073741824 : 0; } function vh() { var o = Hr; return Hr <<= 1, !(Hr & 4194240) && (Hr = 64), o; } function of(o) { for (var l = [], h = 0; 31 > h; h++) l.push(o); return l; } function yi(o, l, h) { o.pendingLanes |= l, l !== 536870912 && (o.suspendedLanes = 0, o.pingedLanes = 0), o = o.eventTimes, l = 31 - ri(l), o[l] = h; } function Xg(o, l) { var h = o.pendingLanes & ~l; o.pendingLanes = l, o.suspendedLanes = 0, o.pingedLanes = 0, o.expiredLanes &= l, o.mutableReadLanes &= l, o.entangledLanes &= l, l = o.entanglements; var x = o.eventTimes; for (o = o.expirationTimes; 0 < h; ) { var C = 31 - ri(h), j = 1 << C; l[C] = 0, x[C] = -1, o[C] = -1, h &= ~j; } } function sf(o, l) { var h = o.entangledLanes |= l; for (o = o.entanglements; h; ) { var x = 31 - ri(h), C = 1 << x; C & l | o[x] & l && (o[x] |= l), h &= ~C; } } var sn = 0; function Vs(o) { return o &= -o, 1 < o ? 4 < o ? o & 268435455 ? 16 : 536870912 : 4 : 1; } var lf = s.unstable_scheduleCallback, mh = s.unstable_cancelCallback, $g = s.unstable_shouldYield, Qg = s.unstable_requestPaint, gr = s.unstable_now, uf = s.unstable_ImmediatePriority, Zg = s.unstable_UserBlockingPriority, cf = s.unstable_NormalPriority, Jg = s.unstable_IdlePriority, oc = null, xi = null; function ey(o) { if (xi && typeof xi.onCommitFiberRoot == "function") try { xi.onCommitFiberRoot(oc, o, void 0, (o.current.flags & 128) === 128); } catch { } } function gh(o, l) { return o === l && (o !== 0 || 1 / o === 1 / l) || o !== o && l !== l; } var ai = typeof Object.is == "function" ? Object.is : gh, Fi = null, sc = !1, df = !1; function yh(o) { Fi === null ? Fi = [o] : Fi.push(o); } function ty(o) { sc = !0, yh(o); } function ii() { if (!df && Fi !== null) { df = !0; var o = 0, l = sn; try { var h = Fi; for (sn = 1; o < h.length; o++) { var x = h[o]; do x = x(!0); while (x !== null); } Fi = null, sc = !1; } catch (C) { throw Fi !== null && (Fi = Fi.slice(o + 1)), lf(uf, ii), C; } finally { sn = l, df = !1; } } return null; } var rs = [], Ws = 0, Gs = null, Ql = 0, ja = [], Wa = 0, as = null, Li = 1, Si = ""; function Bi(o, l) { rs[Ws++] = Ql, rs[Ws++] = Gs, Gs = o, Ql = l; } function xh(o, l, h) { ja[Wa++] = Li, ja[Wa++] = Si, ja[Wa++] = as, as = o; var x = Li; o = Si; var C = 32 - ri(x) - 1; x &= ~(1 << C), h += 1; var j = 32 - ri(l) + C; if (30 < j) { var N = C - C % 5; j = (x & (1 << N) - 1).toString(32), x >>= N, C -= N, Li = 1 << 32 - ri(l) + C | h << C | x, Si = j + o; } else Li = 1 << j | h << C | x, Si = o; } function ff(o) { o.return !== null && (Bi(o, 1), xh(o, 1, 0)); } function qs(o) { for (; o === Gs; ) Gs = rs[--Ws], rs[Ws] = null, Ql = rs[--Ws], rs[Ws] = null; for (; o === as; ) as = ja[--Wa], ja[Wa] = null, Si = ja[--Wa], ja[Wa] = null, Li = ja[--Wa], ja[Wa] = null; } var Ta = null, Ga = null, In = !1, Zl = !1, oi = null; function Sh(o, l) { var h = Xa(5, null, null, 0); h.elementType = "DELETED", h.stateNode = l, h.return = o, l = o.deletions, l === null ? (o.deletions = [h], o.flags |= 16) : l.push(h); } function bh(o, l) { switch (o.tag) { case 5: return l = Ai(l, o.type, o.pendingProps), l !== null ? (o.stateNode = l, Ta = o, Ga = ph(l), !0) : !1; case 6: return l = Zo(l, o.pendingProps), l !== null ? (o.stateNode = l, Ta = o, Ga = null, !0) : !1; case 13: if (l = Ju(l), l !== null) { var h = as !== null ? { id: Li, overflow: Si } : null; return o.memoizedState = { dehydrated: l, treeContext: h, retryLane: 1073741824 }, h = Xa(18, null, null, 0), h.stateNode = l, h.return = o, o.child = h, Ta = o, Ga = null, !0; } return !1; default: return !1; } } function pf(o) { return (o.mode & 1) !== 0 && (o.flags & 128) === 0; } function hf(o) { if (In) { var l = Ga; if (l) { var h = l; if (!bh(o, l)) { if (pf(o)) throw Error(f(418)); l = Ls(h); var x = Ta; l && bh(o, l) ? Sh(x, h) : (o.flags = o.flags & -4097 | 2, In = !1, Ta = o); } } else { if (pf(o)) throw Error(f(418)); o.flags = o.flags & -4097 | 2, In = !1, Ta = o; } } } function Ch(o) { for (o = o.return; o !== null && o.tag !== 5 && o.tag !== 3 && o.tag !== 13; ) o = o.return; Ta = o; } function lc(o) { if (!Ot || o !== Ta) return !1; if (!In) return Ch(o), In = !0, !1; if (o.tag !== 3 && (o.tag !== 5 || Wg(o.type) && !be(o.type, o.memoizedProps))) { var l = Ga; if (l) { if (pf(o)) throw Eh(), Error(f(418)); for (; l; ) Sh(o, l), l = Ls(l); } } if (Ch(o), o.tag === 13) { if (!Ot) throw Error(f(316)); if (o = o.memoizedState, o = o !== null ? o.dehydrated : null, !o) throw Error(f(317)); Ga = Zd(o); } else Ga = Ta ? Ls(o.stateNode) : null; return !0; } function Eh() { for (var o = Ga; o; ) o = Ls(o); } function Ys() { Ot && (Ga = Ta = null, Zl = In = !1); } function vf(o) { oi === null ? oi = [o] : oi.push(o); } var ny = m.ReactCurrentBatchConfig; function uc(o, l) { if (ai(o, l)) return !0; if (typeof o != "object" || o === null || typeof l != "object" || l === null) return !1; var h = Object.keys(o), x = Object.keys(l); if (h.length !== x.length) return !1; for (x = 0; x < h.length; x++) { var C = h[x]; if (!hh.call(l, C) || !ai(o[C], l[C])) return !1; } return !0; } function ry(o) { switch (o.tag) { case 5: return Us(o.type); case 16: return Us("Lazy"); case 13: return Us("Suspense"); case 19: return Us("SuspenseList"); case 0: case 2: case 15: return o = Kl(o.type, !1), o; case 11: return o = Kl(o.type.render, !1), o; case 1: return o = Kl(o.type, !0), o; default: return ""; } } function si(o, l) { if (o && o.defaultProps) { l = c({}, l), o = o.defaultProps; for (var h in o) l[h] === void 0 && (l[h] = o[h]); return l; } return l; } var cc = po(null), dc = null, Ks = null, mf = null; function gf() { mf = Ks = dc = null; } function wh(o, l, h) { dt ? (mn(cc, l._currentValue), l._currentValue = h) : (mn(cc, l._currentValue2), l._currentValue2 = h); } function yf(o) { var l = cc.current; Gt(cc), dt ? o._currentValue = l : o._currentValue2 = l; } function xf(o, l, h) { for (; o !== null; ) { var x = o.alternate; if ((o.childLanes & l) !== l ? (o.childLanes |= l, x !== null && (x.childLanes |= l)) : x !== null && (x.childLanes & l) !== l && (x.childLanes |= l), o === h) break; o = o.return; } } function Xs(o, l) { dc = o, mf = Ks = null, o = o.dependencies, o !== null && o.firstContext !== null && (o.lanes & l && (Dr = !0), o.firstContext = null); } function Wr(o) { var l = dt ? o._currentValue : o._currentValue2; if (mf !== o) if (o = { context: o, memoizedValue: l, next: null }, Ks === null) { if (dc === null) throw Error(f(308)); Ks = o, dc.dependencies = { lanes: 0, firstContext: o }; } else Ks = Ks.next = o; return l; } var vo = null; function fc(o) { vo === null ? vo = [o] : vo.push(o); } function Sf(o, l, h, x) { var C = l.interleaved; return C === null ? (h.next = h, fc(l)) : (h.next = C.next, C.next = h), l.interleaved = h, li(o, x); } function li(o, l) { o.lanes |= l; var h = o.alternate; for (h !== null && (h.lanes |= l), h = o, o = o.return; o !== null; ) o.childLanes |= l, h = o.alternate, h !== null && (h.childLanes |= l), h = o, o = o.return; return h.tag === 3 ? h.stateNode : null; } var Ui = !1; function pc(o) { o.updateQueue = { baseState: o.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null }; } function bf(o, l) { o = o.updateQueue, l.updateQueue === o && (l.updateQueue = { baseState: o.baseState, firstBaseUpdate: o.firstBaseUpdate, lastBaseUpdate: o.lastBaseUpdate, shared: o.shared, effects: o.effects }); } function bi(o, l) { return { eventTime: o, lane: l, tag: 0, payload: null, callback: null, next: null }; } function mo(o, l, h) { var x = o.updateQueue; if (x === null) return null; if (x = x.shared, Wt & 2) { var C = x.pending; return C === null ? l.next = l : (l.next = C.next, C.next = l), x.pending = l, li(o, h); } return C = x.interleaved, C === null ? (l.next = l, fc(x)) : (l.next = C.next, C.next = l), x.interleaved = l, li(o, h); } function hc(o, l, h) { if (l = l.updateQueue, l !== null && (l = l.shared, (h & 4194240) !== 0)) { var x = l.lanes; x &= o.pendingLanes, h |= x, l.lanes = h, sf(o, h); } } function vc(o, l) { var h = o.updateQueue, x = o.alternate; if (x !== null && (x = x.updateQueue, h === x)) { var C = null, j = null; if (h = h.firstBaseUpdate, h !== null) { do { var N = { eventTime: h.eventTime, lane: h.lane, tag: h.tag, payload: h.payload, callback: h.callback, next: null }; j === null ? C = j = N : j = j.next = N, h = h.next; } while (h !== null); j === null ? C = j = l : j = j.next = l; } else C = j = l; h = { baseState: x.baseState, firstBaseUpdate: C, lastBaseUpdate: j, shared: x.shared, effects: x.effects }, o.updateQueue = h; return; } o = h.lastBaseUpdate, o === null ? h.firstBaseUpdate = l : o.next = l, h.lastBaseUpdate = l; } function $s(o, l, h, x) { var C = o.updateQueue; Ui = !1; var j = C.firstBaseUpdate, N = C.lastBaseUpdate, V = C.shared.pending; if (V !== null) { C.shared.pending = null; var ue = V, Oe = ue.next; ue.next = null, N === null ? j = Oe : N.next = Oe, N = ue; var ut = o.alternate; ut !== null && (ut = ut.updateQueue, V = ut.lastBaseUpdate, V !== N && (V === null ? ut.firstBaseUpdate = Oe : V.next = Oe, ut.lastBaseUpdate = ue)); } if (j !== null) { var xt = C.baseState; N = 0, ut = Oe = ue = null, V = j; do { var Ke = V.lane, Pn = V.eventTime; if ((x & Ke) === Ke) { ut !== null && (ut = ut.next = { eventTime: Pn, lane: 0, tag: V.tag, payload: V.payload, callback: V.callback, next: null }); e: { var En = o, gn = V; switch (Ke = l, Pn = h, gn.tag) { case 1: if (En = gn.payload, typeof En == "function") { xt = En.call(Pn, xt, Ke); break e; } xt = En; break e; case 3: En.flags = En.flags & -65537 | 128; case 0: if (En = gn.payload, Ke = typeof En == "function" ? En.call(Pn, xt, Ke) : En, Ke == null) break e; xt = c({}, xt, Ke); break e; case 2: Ui = !0; } } V.callback !== null && V.lane !== 0 && (o.flags |= 64, Ke = C.effects, Ke === null ? C.effects = [V] : Ke.push(V)); } else Pn = { eventTime: Pn, lane: Ke, tag: V.tag, payload: V.payload, callback: V.callback, next: null }, ut === null ? (Oe = ut = Pn, ue = xt) : ut = ut.next = Pn, N |= Ke; if (V = V.next, V === null) { if (V = C.shared.pending, V === null) break; Ke = V, V = Ke.next, Ke.next = null, C.lastBaseUpdate = Ke, C.shared.pending = null; } } while (1); if (ut === null && (ue = xt), C.baseState = ue, C.firstBaseUpdate = Oe, C.lastBaseUpdate = ut, l = C.shared.interleaved, l !== null) { C = l; do N |= C.lane, C = C.next; while (C !== l); } else j === null && (C.shared.lanes = 0); ps |= N, o.lanes = N, o.memoizedState = xt; } } function Hi(o, l, h) { if (o = l.effects, l.effects = null, o !== null) for (l = 0; l < o.length; l++) { var x = o[l], C = x.callback; if (C !== null) { if (x.callback = null, x = h, typeof C != "function") throw Error(f(191, C)); C.call(x); } } } var mc = new i.Component().refs; function Qs(o, l, h, x) { l = o.memoizedState, h = h(x, l), h = h == null ? l : c({}, l, h), o.memoizedState = h, o.lanes === 0 && (o.updateQueue.baseState = h); } var gc = { isMounted: function(o) { return (o = o._reactInternals) ? ae(o) === o : !1; }, enqueueSetState: function(o, l, h) { o = o._reactInternals; var x = Pr(), C = Nr(o), j = bi(x, C); j.payload = l, h != null && (j.callback = h), l = mo(o, j, C), l !== null && (Ra(l, o, C, x), hc(l, o, C)); }, enqueueReplaceState: function(o, l, h) { o = o._reactInternals; var x = Pr(), C = Nr(o), j = bi(x, C); j.tag = 1, j.payload = l, h != null && (j.callback = h), l = mo(o, j, C), l !== null && (Ra(l, o, C, x), hc(l, o, C)); }, enqueueForceUpdate: function(o, l) { o = o._reactInternals; var h = Pr(), x = Nr(o), C = bi(h, x); C.tag = 2, l != null && (C.callback = l), l = mo(o, C, x), l !== null && (Ra(l, o, x, h), hc(l, o, x)); } }; function yc(o, l, h, x, C, j, N) { return o = o.stateNode, typeof o.shouldComponentUpdate == "function" ? o.shouldComponentUpdate(x, j, N) : l.prototype && l.prototype.isPureReactComponent ? !uc(h, x) || !uc(C, j) : !0; } function jh(o, l, h) { var x = !1, C = ho, j = l.contextType; return typeof j == "object" && j !== null ? j = Wr(j) : (C = Ur(l) ? ts : Br.current, x = l.contextTypes, j = (x = x != null) ? Hs(o, C) : ho), l = new l(h, j), o.memoizedState = l.state !== null && l.state !== void 0 ? l.state : null, l.updater = gc, o.stateNode = l, l._reactInternals = o, x && (o = o.stateNode, o.__reactInternalMemoizedUnmaskedChildContext = C, o.__reactInternalMemoizedMaskedChildContext = j), l; } function xc(o, l, h, x) { o = l.state, typeof l.componentWillReceiveProps == "function" && l.componentWillReceiveProps(h, x), typeof l.UNSAFE_componentWillReceiveProps == "function" && l.UNSAFE_componentWillReceiveProps(h, x), l.state !== o && gc.enqueueReplaceState(l, l.state, null); } function Cf(o, l, h, x) { var C = o.stateNode; C.props = h, C.state = o.memoizedState, C.refs = mc, pc(o); var j = l.contextType; typeof j == "object" && j !== null ? C.context = Wr(j) : (j = Ur(l) ? ts : Br.current, C.context = Hs(o, j)), C.state = o.memoizedState, j = l.getDerivedStateFromProps, typeof j == "function" && (Qs(o, l, j, h), C.state = o.memoizedState), typeof l.getDerivedStateFromProps == "function" || typeof C.getSnapshotBeforeUpdate == "function" || typeof C.UNSAFE_componentWillMount != "function" && typeof C.componentWillMount != "function" || (l = C.state, typeof C.componentWillMount == "function" && C.componentWillMount(), typeof C.UNSAFE_componentWillMount == "function" && C.UNSAFE_componentWillMount(), l !== C.state && gc.enqueueReplaceState(C, C.state, null), $s(o, h, C, x), C.state = o.memoizedState), typeof C.componentDidMount == "function" && (o.flags |= 4194308); } function is(o, l, h) { if (o = h.ref, o !== null && typeof o != "function" && typeof o != "object") { if (h._owner) { if (h = h._owner, h) { if (h.tag !== 1) throw Error(f(309)); var x = h.stateNode; } if (!x) throw Error(f(147, o)); var C = x, j = "" + o; return l !== null && l.ref !== null && typeof l.ref == "function" && l.ref._stringRef === j ? l.ref : (l = function(N) { var V = C.refs; V === mc && (V = C.refs = {}), N === null ? delete V[j] : V[j] = N; }, l._stringRef = j, l); } if (typeof o != "string") throw Error(f(284)); if (!h._owner) throw Error(f(290, o)); } return o; } function Jl(o, l) { throw o = Object.prototype.toString.call(l), Error(f(31, o === "[object Object]" ? "object with keys {" + Object.keys(l).join(", ") + "}" : o)); } function Ef(o) { var l = o._init; return l(o._payload); } function wf(o) { function l(ie, G) { if (o) { var ce = ie.deletions; ce === null ? (ie.deletions = [G], ie.flags |= 16) : ce.push(G); } } function h(ie, G) { if (!o) return null; for (; G !== null; ) l(ie, G), G = G.sibling; return null; } function x(ie, G) { for (ie = /* @__PURE__ */ new Map(); G !== null; ) G.key !== null ? ie.set(G.key, G) : ie.set(G.index, G), G = G.sibling; return ie; } function C(ie, G) { return ie = Ti(ie, G), ie.index = 0, ie.sibling = null, ie; } function j(ie, G, ce) { return ie.index = ce, o ? (ce = ie.alternate, ce !== null ? (ce = ce.index, ce < G ? (ie.flags |= 2, G) : ce) : (ie.flags |= 2, G)) : (ie.flags |= 1048576, G); } function N(ie) { return o && ie.alternate === null && (ie.flags |= 2), ie; } function V(ie, G, ce, Je) { return G === null || G.tag !== 6 ? (G = gu(ce, ie.mode, Je), G.return = ie, G) : (G = C(G, ce), G.return = ie, G); } function ue(ie, G, ce, Je) { var mt = ce.type; return mt === S ? ut(ie, G, ce.props.children, Je, ce.key) : G !== null && (G.elementType === mt || typeof mt == "object" && mt !== null && mt.$$typeof === A && Ef(mt) === G.type) ? (Je = C(G, ce.props), Je.ref = is(ie, G, ce), Je.return = ie, Je) : (Je = mu(ce.type, ce.key, ce.props, null, ie.mode, Je), Je.ref = is(ie, G, ce), Je.return = ie, Je); } function Oe(ie, G, ce, Je) { return G === null || G.tag !== 4 || G.stateNode.containerInfo !== ce.containerInfo || G.stateNode.implementation !== ce.implementation ? (G = yu(ce, ie.mode, Je), G.return = ie, G) : (G = C(G, ce.children || []), G.return = ie, G); } function ut(ie, G, ce, Je, mt) { return G === null || G.tag !== 7 ? (G = Do(ce, ie.mode, Je, mt), G.return = ie, G) : (G = C(G, ce), G.return = ie, G); } function xt(ie, G, ce) { if (typeof G == "string" && G !== "" || typeof G == "number") return G = gu("" + G, ie.mode, ce), G.return = ie, G; if (typeof G == "object" && G !== null) { switch (G.$$typeof) { case y: return ce = mu(G.type, G.key, G.props, null, ie.mode, ce), ce.ref = is(ie, null, G), ce.return = ie, ce; case g: return G = yu(G, ie.mode, ce), G.return = ie, G; case A: var Je = G._init; return xt(ie, Je(G._payload), ce); } if (_e(G) || q(G)) return G = Do(G, ie.mode, ce, null), G.return = ie, G; Jl(ie, G); } return null; } function Ke(ie, G, ce, Je) { var mt = G !== null ? G.key : null; if (typeof ce == "string" && ce !== "" || typeof ce == "number") return mt !== null ? null : V(ie, G, "" + ce, Je); if (typeof ce == "object" && ce !== null) { switch (ce.$$typeof) { case y: return ce.key === mt ? ue(ie, G, ce, Je) : null; case g: return ce.key === mt ? Oe(ie, G, ce, Je) : null; case A: return mt = ce._init, Ke( ie, G, mt(ce._payload), Je ); } if (_e(ce) || q(ce)) return mt !== null ? null : ut(ie, G, ce, Je, null); Jl(ie, ce); } return null; } function Pn(ie, G, ce, Je, mt) { if (typeof Je == "string" && Je !== "" || typeof Je == "number") return ie = ie.get(ce) || null, V(G, ie, "" + Je, mt); if (typeof Je == "object" && Je !== null) { switch (Je.$$typeof) { case y: return ie = ie.get(Je.key === null ? ce : Je.key) || null, ue(G, ie, Je, mt); case g: return ie = ie.get(Je.key === null ? ce : Je.key) || null, Oe(G, ie, Je, mt); case A: var At = Je._init; return Pn(ie, G, ce, At(Je._payload), mt); } if (_e(Je) || q(Je)) return ie = ie.get(ce) || null, ut(G, ie, Je, mt, null); Jl(G, Je); } return null; } function En(ie, G, ce, Je) { for (var mt = null, At = null, kt = G, $t = G = 0, Gn = null; kt !== null && $t < ce.length; $t++) { kt.index > $t ? (Gn = kt, kt = null) : Gn = kt.sibling; var Qt = Ke(ie, kt, ce[$t], Je); if (Qt === null) { kt === null && (kt = Gn); break; } o && kt && Qt.alternate === null && l(ie, kt), G = j(Qt, G, $t), At === null ? mt = Qt : At.sibling = Qt, At = Qt, kt = Gn; } if ($t === ce.length) return h(ie, kt), In && Bi(ie, $t), mt; if (kt === null) { for (; $t < ce.length; $t++) kt = xt(ie, ce[$t], Je), kt !== null && (G = j(kt, G, $t), At === null ? mt = kt : At.sibling = kt, At = kt); return In && Bi(ie, $t), mt; } for (kt = x(ie, kt); $t < ce.length; $t++) Gn = Pn(kt, ie, $t, ce[$t], Je), Gn !== null && (o && Gn.alternate !== null && kt.delete(Gn.key === null ? $t : Gn.key), G = j(Gn, G, $t), At === null ? mt = Gn : At.sibling = Gn, At = Gn); return o && kt.forEach(function($a) { return l(ie, $a); }), In && Bi(ie, $t), mt; } function gn(ie, G, ce, Je) { var mt = q(ce); if (typeof mt != "function") throw Error(f(150)); if (ce = mt.call(ce), ce == null) throw Error(f(151)); for (var At = mt = null, kt = G, $t = G = 0, Gn = null, Qt = ce.next(); kt !== null && !Qt.done; $t++, Qt = ce.next()) { kt.index > $t ? (Gn = kt, kt = null) : Gn = kt.sibling; var $a = Ke(ie, kt, Qt.value, Je); if ($a === null) { kt === null && (kt = Gn); break; } o && kt && $a.alternate === null && l(ie, kt), G = j($a, G, $t), At === null ? mt = $a : At.sibling = $a, At = $a, kt = Gn; } if (Qt.done) return h( ie, kt ), In && Bi(ie, $t), mt; if (kt === null) { for (; !Qt.done; $t++, Qt = ce.next()) Qt = xt(ie, Qt.value, Je), Qt !== null && (G = j(Qt, G, $t), At === null ? mt = Qt : At.sibling = Qt, At = Qt); return In && Bi(ie, $t), mt; } for (kt = x(ie, kt); !Qt.done; $t++, Qt = ce.next()) Qt = Pn(kt, ie, $t, Qt.value, Je), Qt !== null && (o && Qt.alternate !== null && kt.delete(Qt.key === null ? $t : Qt.key), G = j(Qt, G, $t), At === null ? mt = Qt : At.sibling = Qt, At = Qt); return o && kt.forEach(function(Ss) { return l(ie, Ss); }), In && Bi(ie, $t), mt; } function hn(ie, G, ce, Je) { if (typeof ce == "object" && ce !== null && ce.type === S && ce.key === null && (ce = ce.props.children), typeof ce == "object" && ce !== null) { switch (ce.$$typeof) { case y: e: { for (var mt = ce.key, At = G; At !== null; ) { if (At.key === mt) { if (mt = ce.type, mt === S) { if (At.tag === 7) { h(ie, At.sibling), G = C(At, ce.props.children), G.return = ie, ie = G; break e; } } else if (At.elementType === mt || typeof mt == "object" && mt !== null && mt.$$typeof === A && Ef(mt) === At.type) { h(ie, At.sibling), G = C(At, ce.props), G.ref = is(ie, At, ce), G.return = ie, ie = G; break e; } h(ie, At); break; } else l(ie, At); At = At.sibling; } ce.type === S ? (G = Do(ce.props.children, ie.mode, Je, ce.key), G.return = ie, ie = G) : (Je = mu(ce.type, ce.key, ce.props, null, ie.mode, Je), Je.ref = is(ie, G, ce), Je.return = ie, ie = Je); } return N(ie); case g: e: { for (At = ce.key; G !== null; ) { if (G.key === At) if (G.tag === 4 && G.stateNode.containerInfo === ce.containerInfo && G.stateNode.implementation === ce.implementation) { h(ie, G.sibling), G = C(G, ce.children || []), G.return = ie, ie = G; break e; } else { h(ie, G); break; } else l(ie, G); G = G.sibling; } G = yu(ce, ie.mode, Je), G.return = ie, ie = G; } return N(ie); case A: return At = ce._init, hn(ie, G, At(ce._payload), Je); } if (_e(ce)) return En(ie, G, ce, Je); if (q(ce)) return gn(ie, G, ce, Je); Jl(ie, ce); } return typeof ce == "string" && ce !== "" || typeof ce == "number" ? (ce = "" + ce, G !== null && G.tag === 6 ? (h(ie, G.sibling), G = C(G, ce), G.return = ie, ie = G) : (h(ie, G), G = gu(ce, ie.mode, Je), G.return = ie, ie = G), N(ie)) : h(ie, G); } return hn; } var Vi = wf(!0), qa = wf(!1), os = {}, Xr = po(os), Da = po(os), _a = po(os); function Rn(o) { if (o === os) throw Error(f(174)); return o; } function cr(o, l) { mn(_a, l), mn(Da, o), mn(Xr, os), o = te(l), Gt(Xr), mn(Xr, o); } function go() { Gt(Xr), Gt(Da), Gt(_a); } function ua(o) { var l = Rn(_a.current), h = Rn(Xr.current); l = K(h, o.type, l), h !== l && (mn(Da, o), mn(Xr, l)); } function ui(o) { Da.current === o && (Gt(Xr), Gt(Da)); } var ln = po(0); function Zs(o) { for (var l = o; l !== null; ) { if (l.tag === 13) { var h = l.memoizedState; if (h !== null && (h = h.dehydrated, h === null || fh(h) || Xd(h))) return l; } else if (l.tag === 19 && l.memoizedProps.revealOrder !== void 0) { if (l.flags & 128) return l; } else if (l.child !== null) { l.child.return = l, l = l.child; continue; } if (l === o) break; for (; l.sibling === null; ) { if (l.return === null || l.return === o) return null; l = l.return; } l.sibling.return = l.return, l = l.sibling; } return null; } var yo = []; function Sc() { for (var o = 0; o < yo.length; o++) { var l = yo[o]; dt ? l._workInProgressVersionPrimary = null : l._workInProgressVersionSecondary = null; } yo.length = 0; } var Wi = m.ReactCurrentDispatcher, Js = m.ReactCurrentBatchConfig, Gr = 0, Dn = null, Kn = null, dr = null, eu = !1, xo = !1, el = 0, ay = 0; function Xn() { throw Error(f(321)); } function bc(o, l) { if (l === null) return !1; for (var h = 0; h < l.length && h < o.length; h++) if (!ai(o[h], l[h])) return !1; return !0; } function Ct(o, l, h, x, C, j) { if (Gr = j, Dn = l, l.memoizedState = null, l.updateQueue = null, l.lanes = 0, Wi.current = o === null || o.memoizedState === null ? Mf : kf, o = h(x, C), xo) { j = 0; do { if (xo = !1, el = 0, 25 <= j) throw Error(f(301)); j += 1, dr = Kn = null, l.updateQueue = null, Wi.current = Rf, o = h(x, C); } while (xo); } if (Wi.current = qi, l = Kn !== null && Kn.next !== null, Gr = 0, dr = Kn = Dn = null, eu = !1, l) throw Error(f(300)); return o; } function qt() { var o = el !== 0; return el = 0, o; } function Lt() { var o = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; return dr === null ? Dn.memoizedState = dr = o : dr = dr.next = o, dr; } function cn() { if (Kn === null) { var o = Dn.alternate; o = o !== null ? o.memoizedState : null; } else o = Kn.next; var l = dr === null ? Dn.memoizedState : dr.next; if (l !== null) dr = l, Kn = o; else { if (o === null) throw Error(f(310)); Kn = o, o = { memoizedState: Kn.memoizedState, baseState: Kn.baseState, baseQueue: Kn.baseQueue, queue: Kn.queue, next: null }, dr === null ? Dn.memoizedState = dr = o : dr = dr.next = o; } return dr; } function ca(o, l) { return typeof l == "function" ? l(o) : l; } function Cc(o) { var l = cn(), h = l.queue; if (h === null) throw Error(f(311)); h.lastRenderedReducer = o; var x = Kn, C = x.baseQueue, j = h.pending; if (j !== null) { if (C !== null) { var N = C.next; C.next = j.next, j.next = N; } x.baseQueue = C = j, h.pending = null; } if (C !== null) { j = C.next, x = x.baseState; var V = N = null, ue = null, Oe = j; do { var ut = Oe.lane; if ((Gr & ut) === ut) ue !== null && (ue = ue.next = { lane: 0, action: Oe.action, hasEagerState: Oe.hasEagerState, eagerState: Oe.eagerState, next: null }), x = Oe.hasEagerState ? Oe.eagerState : o(x, Oe.action); else { var xt = { lane: ut, action: Oe.action, hasEagerState: Oe.hasEagerState, eagerState: Oe.eagerState, next: null }; ue === null ? (V = ue = xt, N = x) : ue = ue.next = xt, Dn.lanes |= ut, ps |= ut; } Oe = Oe.next; } while (Oe !== null && Oe !== j); ue === null ? N = x : ue.next = V, ai(x, l.memoizedState) || (Dr = !0), l.memoizedState = x, l.baseState = N, l.baseQueue = ue, h.lastRenderedState = x; } if (o = h.interleaved, o !== null) { C = o; do j = C.lane, Dn.lanes |= j, ps |= j, C = C.next; while (C !== o); } else C === null && (h.lanes = 0); return [l.memoizedState, h.dispatch]; } function jf(o) { var l = cn(), h = l.queue; if (h === null) throw Error(f(311)); h.lastRenderedReducer = o; var x = h.dispatch, C = h.pending, j = l.memoizedState; if (C !== null) { h.pending = null; var N = C = C.next; do j = o(j, N.action), N = N.next; while (N !== C); ai(j, l.memoizedState) || (Dr = !0), l.memoizedState = j, l.baseQueue === null && (l.baseState = j), h.lastRenderedState = j; } return [j, x]; } function Th() { } function Dh(o, l) { var h = Dn, x = cn(), C = l(), j = !ai(x.memoizedState, C); if (j && (x.memoizedState = C, Dr = !0), x = x.queue, tu(fr.bind(null, h, x, o), [o]), x.getSnapshot !== l || j || dr !== null && dr.memoizedState.tag & 1) { if (h.flags |= 2048, ci(9, we.bind(null, h, x, C, l), void 0, null), xr === null) throw Error(f(349)); Gr & 30 || Ec(h, l, C); } return C; } function Ec(o, l, h) { o.flags |= 16384, o = { getSnapshot: l, value: h }, l = Dn.updateQueue, l === null ? (l = { lastEffect: null, stores: null }, Dn.updateQueue = l, l.stores = [o]) : (h = l.stores, h === null ? l.stores = [o] : h.push(o)); } function we(o, l, h, x) { l.value = h, l.getSnapshot = x, Tt(l) && ss(o); } function fr(o, l, h) { return h(function() { Tt(l) && ss(o); }); } function Tt(o) { var l = o.getSnapshot; o = o.value; try { var h = l(); return !ai(o, h); } catch { return !0; } } function ss(o) { var l = li(o, 1); l !== null && Ra(l, o, 1, -1); } function Ci(o) { var l = Lt(); return typeof o == "function" && (o = o()), l.memoizedState = l.baseState = o, o = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: ca, lastRenderedState: o }, l.queue = o, o = o.dispatch = _f.bind(null, Dn, o), [l.memoizedState, o]; } function ci(o, l, h, x) { return o = { tag: o, create: l, destroy: h, deps: x, next: null }, l = Dn.updateQueue, l === null ? (l = { lastEffect: null, stores: null }, Dn.updateQueue = l, l.lastEffect = o.next = o) : (h = l.lastEffect, h === null ? l.lastEffect = o.next = o : (x = h.next, h.next = o, o.next = x, l.lastEffect = o)), o; } function di() { return cn().memoizedState; } function So(o, l, h, x) { var C = Lt(); Dn.flags |= o, C.memoizedState = ci(1 | l, h, void 0, x === void 0 ? null : x); } function Gi(o, l, h, x) { var C = cn(); x = x === void 0 ? null : x; var j = void 0; if (Kn !== null) { var N = Kn.memoizedState; if (j = N.destroy, x !== null && bc(x, N.deps)) { C.memoizedState = ci(l, h, j, x); return; } } Dn.flags |= o, C.memoizedState = ci(1 | l, h, j, x); } function tl(o, l) { return So(8390656, 8, o, l); } function tu(o, l) { return Gi(2048, 8, o, l); } function wc(o, l) { return Gi(4, 2, o, l); } function jc(o, l) { return Gi(4, 4, o, l); } function Tc(o, l) { if (typeof l == "function") return o = o(), l(o), function() { l(null); }; if (l != null) return o = o(), l.current = o, function() { l.current = null; }; } function Dc(o, l, h) { return h = h != null ? h.concat([o]) : null, Gi(4, 4, Tc.bind(null, l, o), h); } function nu() { } function _c(o, l) { var h = cn(); l = l === void 0 ? null : l; var x = h.memoizedState; return x !== null && l !== null && bc(l, x[1]) ? x[0] : (h.memoizedState = [o, l], o); } function Mc(o, l) { var h = cn(); l = l === void 0 ? null : l; var x = h.memoizedState; return x !== null && l !== null && bc(l, x[1]) ? x[0] : (o = o(), h.memoizedState = [o, l], o); } function kc(o, l, h) { return Gr & 21 ? (ai(h, l) || (h = vh(), Dn.lanes |= h, ps |= h, o.baseState = !0), l) : (o.baseState && (o.baseState = !1, Dr = !0), o.memoizedState = h); } function Tf(o, l) { var h = sn; sn = h !== 0 && 4 > h ? h : 4, o(!0); var x = Js.transition; Js.transition = {}; try { o(!1), l(); } finally { sn = h, Js.transition = x; } } function Rc() { return cn().memoizedState; } function Df(o, l, h) { var x = Nr(o); if (h = { lane: x, action: h, hasEagerState: !1, eagerState: null, next: null }, Pc(o)) Nc(l, h); else if (h = Sf(o, l, h, x), h !== null) { var C = Pr(); Ra(h, o, x, C), ru(h, l, x); } } function _f(o, l, h) { var x = Nr(o), C = { lane: x, action: h, hasEagerState: !1, eagerState: null, next: null }; if (Pc(o)) Nc(l, C); else { var j = o.alternate; if (o.lanes === 0 && (j === null || j.lanes === 0) && (j = l.lastRenderedReducer, j !== null)) try { var N = l.lastRenderedState, V = j(N, h); if (C.hasEagerState = !0, C.eagerState = V, ai(V, N)) { var ue = l.interleaved; ue === null ? (C.next = C, fc(l)) : (C.next = ue.next, ue.next = C), l.interleaved = C; return; } } catch { } finally { } h = Sf(o, l, C, x), h !== null && (C = Pr(), Ra(h, o, x, C), ru(h, l, x)); } } function Pc(o) { var l = o.alternate; return o === Dn || l !== null && l === Dn; } function Nc(o, l) { xo = eu = !0; var h = o.pending; h === null ? l.next = l : (l.next = h.next, h.next = l), o.pending = l; } function ru(o, l, h) { if (h & 4194240) { var x = l.lanes; x &= o.pendingLanes, h |= x, l.lanes = h, sf(o, h); } } var qi = { readContext: Wr, useCallback: Xn, useContext: Xn, useEffect: Xn, useImperativeHandle: Xn, useInsertionEffect: Xn, useLayoutEffect: Xn, useMemo: Xn, useReducer: Xn, useRef: Xn, useState: Xn, useDebugValue: Xn, useDeferredValue: Xn, useTransition: Xn, useMutableSource: Xn, useSyncExternalStore: Xn, useId: Xn, unstable_isNewReconciler: !1 }, Mf = { readContext: Wr, useCallback: function(o, l) { return Lt().memoizedState = [o, l === void 0 ? null : l], o; }, useContext: Wr, useEffect: tl, useImperativeHandle: function(o, l, h) { return h = h != null ? h.concat([o]) : null, So( 4194308, 4, Tc.bind(null, l, o), h ); }, useLayoutEffect: function(o, l) { return So(4194308, 4, o, l); }, useInsertionEffect: function(o, l) { return So(4, 2, o, l); }, useMemo: function(o, l) { var h = Lt(); return l = l === void 0 ? null : l, o = o(), h.memoizedState = [o, l], o; }, useReducer: function(o, l, h) { var x = Lt(); return l = h !== void 0 ? h(l) : l, x.memoizedState = x.baseState = l, o = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: o, lastRenderedState: l }, x.queue = o, o = o.dispatch = Df.bind(null, Dn, o), [x.memoizedState, o]; }, useRef: function(o) { var l = Lt(); return o = { current: o }, l.memoizedState = o; }, useState: Ci, useDebugValue: nu, useDeferredValue: function(o) { return Lt().memoizedState = o; }, useTransition: function() { var o = Ci(!1), l = o[0]; return o = Tf.bind(null, o[1]), Lt().memoizedState = o, [l, o]; }, useMutableSource: function() { }, useSyncExternalStore: function(o, l, h) { var x = Dn, C = Lt(); if (In) { if (h === void 0) throw Error(f(407)); h = h(); } else { if (h = l(), xr === null) throw Error(f(349)); Gr & 30 || Ec(x, l, h); } C.memoizedState = h; var j = { value: h, getSnapshot: l }; return C.queue = j, tl(fr.bind( null, x, j, o ), [o]), x.flags |= 2048, ci(9, we.bind(null, x, j, h, l), void 0, null), h; }, useId: function() { var o = Lt(), l = xr.identifierPrefix; if (In) { var h = Si, x = Li; h = (x & ~(1 << 32 - ri(x) - 1)).toString(32) + h, l = ":" + l + "R" + h, h = el++, 0 < h && (l += "H" + h.toString(32)), l += ":"; } else h = ay++, l = ":" + l + "r" + h.toString(32) + ":"; return o.memoizedState = l; }, unstable_isNewReconciler: !1 }, kf = { readContext: Wr, useCallback: _c, useContext: Wr, useEffect: tu, useImperativeHandle: Dc, useInsertionEffect: wc, useLayoutEffect: jc, useMemo: Mc, useReducer: Cc, useRef: di, useState: function() { return Cc(ca); }, useDebugValue: nu, useDeferredValue: function(o) { var l = cn(); return kc(l, Kn.memoizedState, o); }, useTransition: function() { var o = Cc(ca)[0], l = cn().memoizedState; return [o, l]; }, useMutableSource: Th, useSyncExternalStore: Dh, useId: Rc, unstable_isNewReconciler: !1 }, Rf = { readContext: Wr, useCallback: _c, useContext: Wr, useEffect: tu, useImperativeHandle: Dc, useInsertionEffect: wc, useLayoutEffect: jc, useMemo: Mc, useReducer: jf, useRef: di, useState: function() { return jf(ca); }, useDebugValue: nu, useDeferredValue: function(o) { var l = cn(); return Kn === null ? l.memoizedState = o : kc(l, Kn.memoizedState, o); }, useTransition: function() { var o = jf(ca)[0], l = cn().memoizedState; return [o, l]; }, useMutableSource: Th, useSyncExternalStore: Dh, useId: Rc, unstable_isNewReconciler: !1 }; function bo(o, l) { try { var h = "", x = l; do h += ry(x), x = x.return; while (x); var C = h; } catch (j) { C = ` Error generating stack: ` + j.message + ` ` + j.stack; } return { value: o, source: l, stack: C, digest: null }; } function Oc(o, l, h) { return { value: o, source: null, stack: h ?? null, digest: l ?? null }; } function ls(o, l) { try { console.error(l.value); } catch (h) { setTimeout(function() { throw h; }); } } var _h = typeof WeakMap == "function" ? WeakMap : Map; function nl(o, l, h) { h = bi(-1, h), h.tag = 3, h.payload = { element: null }; var x = l.value; return h.callback = function() { qc || (qc = !0, Vf = x), ls(o, l); }, h; } function Co(o, l, h) { h = bi(-1, h), h.tag = 3; var x = o.type.getDerivedStateFromError; if (typeof x == "function") { var C = l.value; h.payload = function() { return x(C); }, h.callback = function() { ls(o, l); }; } var j = o.stateNode; return j !== null && typeof j.componentDidCatch == "function" && (h.callback = function() { ls(o, l), typeof x != "function" && (wi === null ? wi = /* @__PURE__ */ new Set([this]) : wi.add(this)); var N = l.stack; this.componentDidCatch(l.value, { componentStack: N !== null ? N : "" }); }), h; } function da(o, l, h) { var x = o.pingCache; if (x === null) { x = o.pingCache = new _h(); var C = /* @__PURE__ */ new Set(); x.set(l, C); } else C = x.get(l), C === void 0 && (C = /* @__PURE__ */ new Set(), x.set(l, C)); C.has(h) || (C.add(h), o = hi.bind(null, o, l, h), l.then(o, o)); } function Mh(o) { do { var l; if ((l = o.tag === 13) && (l = o.memoizedState, l = l !== null ? l.dehydrated !== null : !0), l) return o; o = o.return; } while (o !== null); return null; } function Cn(o, l, h, x, C) { return o.mode & 1 ? (o.flags |= 65536, o.lanes = C, o) : (o === l ? o.flags |= 65536 : (o.flags |= 128, h.flags |= 131072, h.flags &= -52805, h.tag === 1 && (h.alternate === null ? h.tag = 17 : (l = bi(-1, 1), l.tag = 2, mo(h, l, 1))), h.lanes |= 1), o); } var Ac = m.ReactCurrentOwner, Dr = !1; function pr(o, l, h, x) { l.child = o === null ? qa(l, null, h, x) : Vi(l, o.child, h, x); } function au(o, l, h, x, C) { h = h.render; var j = l.ref; return Xs(l, C), x = Ct(o, l, h, x, j, C), h = qt(), o !== null && !Dr ? (l.updateQueue = o.updateQueue, l.flags &= -2053, o.lanes &= ~C, $n(o, l, C)) : (In && h && ff(l), l.flags |= 1, pr(o, l, x, C), l.child); } function kh(o, l, h, x, C) { if (o === null) { var j = h.type; return typeof j == "function" && !Qc(j) && j.defaultProps === void 0 && h.compare === null && h.defaultProps === void 0 ? (l.tag = 15, l.type = j, Rh(o, l, j, x, C)) : (o = mu(h.type, null, x, l, l.mode, C), o.ref = l.ref, o.return = l, l.child = o); } if (j = o.child, !(o.lanes & C)) { var N = j.memoizedProps; if (h = h.compare, h = h !== null ? h : uc, h(N, x) && o.ref === l.ref) return $n(o, l, C); } return l.flags |= 1, o = Ti(j, x), o.ref = l.ref, o.return = l, l.child = o; } function Rh(o, l, h, x, C) { if (o !== null) { var j = o.memoizedProps; if (uc(j, x) && o.ref === l.ref) if (Dr = !1, l.pendingProps = x = j, (o.lanes & C) !== 0) o.flags & 131072 && (Dr = !0); else return l.lanes = o.lanes, $n(o, l, C); } return iu(o, l, h, x, C); } function Ph(o, l, h) { var x = l.pendingProps, C = x.children, j = o !== null ? o.memoizedState : null; if (x.mode === "hidden") if (!(l.mode & 1)) l.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, mn(cl, ka), ka |= h; else { if (!(h & 1073741824)) return o = j !== null ? j.baseLanes | h : h, l.lanes = l.childLanes = 1073741824, l.memoizedState = { baseLanes: o, cachePool: null, transitions: null }, l.updateQueue = null, mn(cl, ka), ka |= o, null; l.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, x = j !== null ? j.baseLanes : h, mn(cl, ka), ka |= x; } else j !== null ? (x = j.baseLanes | h, l.memoizedState = null) : x = h, mn(cl, ka), ka |= x; return pr(o, l, C, h), l.child; } function Nh(o, l) { var h = l.ref; (o === null && h !== null || o !== null && o.ref !== h) && (l.flags |= 512, l.flags |= 2097152); } function iu(o, l, h, x, C) { var j = Ur(h) ? ts : Br.current; return j = Hs(l, j), Xs(l, C), h = Ct(o, l, h, x, j, C), x = qt(), o !== null && !Dr ? (l.updateQueue = o.updateQueue, l.flags &= -2053, o.lanes &= ~C, $n(o, l, C)) : (In && x && ff(l), l.flags |= 1, pr(o, l, h, C), l.child); } function Oh(o, l, h, x, C) { if (Ur(h)) { var j = !0; $l(l); } else j = !1; if (Xs(l, C), l.stateNode === null) al(o, l), jh(l, h, x), Cf(l, h, x, C), x = !0; else if (o === null) { var N = l.stateNode, V = l.memoizedProps; N.props = V; var ue = N.context, Oe = h.contextType; typeof Oe == "object" && Oe !== null ? Oe = Wr(Oe) : (Oe = Ur(h) ? ts : Br.current, Oe = Hs(l, Oe)); var ut = h.getDerivedStateFromProps, xt = typeof ut == "function" || typeof N.getSnapshotBeforeUpdate == "function"; xt || typeof N.UNSAFE_componentWillReceiveProps != "function" && typeof N.componentWillReceiveProps != "function" || (V !== x || ue !== Oe) && xc(l, N, x, Oe), Ui = !1; var Ke = l.memoizedState; N.state = Ke, $s(l, x, N, C), ue = l.memoizedState, V !== x || Ke !== ue || la.current || Ui ? (typeof ut == "function" && (Qs(l, h, ut, x), ue = l.memoizedState), (V = Ui || yc(l, h, V, x, Ke, ue, Oe)) ? (xt || typeof N.UNSAFE_componentWillMount != "function" && typeof N.componentWillMount != "function" || (typeof N.componentWillMount == "function" && N.componentWillMount(), typeof N.UNSAFE_componentWillMount == "function" && N.UNSAFE_componentWillMount()), typeof N.componentDidMount == "function" && (l.flags |= 4194308)) : (typeof N.componentDidMount == "function" && (l.flags |= 4194308), l.memoizedProps = x, l.memoizedState = ue), N.props = x, N.state = ue, N.context = Oe, x = V) : (typeof N.componentDidMount == "function" && (l.flags |= 4194308), x = !1); } else { N = l.stateNode, bf(o, l), V = l.memoizedProps, Oe = l.type === l.elementType ? V : si(l.type, V), N.props = Oe, xt = l.pendingProps, Ke = N.context, ue = h.contextType, typeof ue == "object" && ue !== null ? ue = Wr(ue) : (ue = Ur(h) ? ts : Br.current, ue = Hs(l, ue)); var Pn = h.getDerivedStateFromProps; (ut = typeof Pn == "function" || typeof N.getSnapshotBeforeUpdate == "function") || typeof N.UNSAFE_componentWillReceiveProps != "function" && typeof N.componentWillReceiveProps != "function" || (V !== xt || Ke !== ue) && xc(l, N, x, ue), Ui = !1, Ke = l.memoizedState, N.state = Ke, $s(l, x, N, C); var En = l.memoizedState; V !== xt || Ke !== En || la.current || Ui ? (typeof Pn == "function" && (Qs(l, h, Pn, x), En = l.memoizedState), (Oe = Ui || yc(l, h, Oe, x, Ke, En, ue) || !1) ? (ut || typeof N.UNSAFE_componentWillUpdate != "function" && typeof N.componentWillUpdate != "function" || (typeof N.componentWillUpdate == "function" && N.componentWillUpdate(x, En, ue), typeof N.UNSAFE_componentWillUpdate == "function" && N.UNSAFE_componentWillUpdate(x, En, ue)), typeof N.componentDidUpdate == "function" && (l.flags |= 4), typeof N.getSnapshotBeforeUpdate == "function" && (l.flags |= 1024)) : (typeof N.componentDidUpdate != "function" || V === o.memoizedProps && Ke === o.memoizedState || (l.flags |= 4), typeof N.getSnapshotBeforeUpdate != "function" || V === o.memoizedProps && Ke === o.memoizedState || (l.flags |= 1024), l.memoizedProps = x, l.memoizedState = En), N.props = x, N.state = En, N.context = ue, x = Oe) : (typeof N.componentDidUpdate != "function" || V === o.memoizedProps && Ke === o.memoizedState || (l.flags |= 4), typeof N.getSnapshotBeforeUpdate != "function" || V === o.memoizedProps && Ke === o.memoizedState || (l.flags |= 1024), x = !1); } return ou(o, l, h, x, j, C); } function ou(o, l, h, x, C, j) { Nh(o, l); var N = (l.flags & 128) !== 0; if (!x && !N) return C && nf(l, h, !1), $n(o, l, j); x = l.stateNode, Ac.current = l; var V = N && typeof h.getDerivedStateFromError != "function" ? null : x.render(); return l.flags |= 1, o !== null && N ? (l.child = Vi(l, o.child, null, j), l.child = Vi(l, null, V, j)) : pr(o, l, V, j), l.memoizedState = x.state, C && nf(l, h, !0), l.child; } function Pf(o) { var l = o.stateNode; l.pendingContext ? tf(o, l.pendingContext, l.pendingContext !== l.context) : l.context && tf(o, l.context, !1), cr(o, l.containerInfo); } function Ah(o, l, h, x, C) { return Ys(), vf(C), l.flags |= 256, pr(o, l, h, x), l.child; } var Nf = { dehydrated: null, treeContext: null, retryLane: 0 }; function rl(o) { return { baseLanes: o, cachePool: null, transitions: null }; } function zh(o, l, h) { var x = l.pendingProps, C = ln.current, j = !1, N = (l.flags & 128) !== 0, V; if ((V = N) || (V = o !== null && o.memoizedState === null ? !1 : (C & 2) !== 0), V ? (j = !0, l.flags &= -129) : (o === null || o.memoizedState !== null) && (C |= 1), mn(ln, C & 1), o === null) return hf(l), o = l.memoizedState, o !== null && (o = o.dehydrated, o !== null) ? (l.mode & 1 ? Xd(o) ? l.lanes = 8 : l.lanes = 1073741824 : l.lanes = 1, null) : (N = x.children, o = x.fallback, j ? (x = l.mode, j = l.child, N = { mode: "hidden", children: N }, !(x & 1) && j !== null ? (j.childLanes = 0, j.pendingProps = N) : j = hl(N, x, 0, null), o = Do(o, x, h, null), j.return = l, o.return = l, j.sibling = o, l.child = j, l.child.memoizedState = rl(h), l.memoizedState = Nf, o) : zc(l, N)); if (C = o.memoizedState, C !== null && (V = C.dehydrated, V !== null)) return iy(o, l, N, x, V, C, h); if (j) { j = x.fallback, N = l.mode, C = o.child, V = C.sibling; var ue = { mode: "hidden", children: x.children }; return !(N & 1) && l.child !== C ? (x = l.child, x.childLanes = 0, x.pendingProps = ue, l.deletions = null) : (x = Ti(C, ue), x.subtreeFlags = C.subtreeFlags & 14680064), V !== null ? j = Ti(V, j) : (j = Do(j, N, h, null), j.flags |= 2), j.return = l, x.return = l, x.sibling = j, l.child = x, x = j, j = l.child, N = o.child.memoizedState, N = N === null ? rl(h) : { baseLanes: N.baseLanes | h, cachePool: null, transitions: N.transitions }, j.memoizedState = N, j.childLanes = o.childLanes & ~h, l.memoizedState = Nf, x; } return j = o.child, o = j.sibling, x = Ti(j, { mode: "visible", children: x.children }), !(l.mode & 1) && (x.lanes = h), x.return = l, x.sibling = null, o !== null && (h = l.deletions, h === null ? (l.deletions = [o], l.flags |= 16) : h.push(o)), l.child = x, l.memoizedState = null, x; } function zc(o, l) { return l = hl({ mode: "visible", children: l }, o.mode, 0, null), l.return = o, o.child = l; } function su(o, l, h, x) { return x !== null && vf(x), Vi(l, o.child, null, h), o = zc(l, l.pendingProps.children), o.flags |= 2, l.memoizedState = null, o; } function iy(o, l, h, x, C, j, N) { if (h) return l.flags & 256 ? (l.flags &= -257, x = Oc(Error(f(422))), su(o, l, N, x)) : l.memoizedState !== null ? (l.child = o.child, l.flags |= 128, null) : (j = x.fallback, C = l.mode, x = hl({ mode: "visible", children: x.children }, C, 0, null), j = Do(j, C, N, null), j.flags |= 2, x.return = l, j.return = l, x.sibling = j, l.child = x, l.mode & 1 && Vi(l, o.child, null, N), l.child.memoizedState = rl(N), l.memoizedState = Nf, j); if (!(l.mode & 1)) return su(o, l, N, null); if (Xd(C)) return x = Gl(C).digest, j = Error(f(419)), x = Oc( j, x, void 0 ), su(o, l, N, x); if (h = (N & o.childLanes) !== 0, Dr || h) { if (x = xr, x !== null) { switch (N & -N) { case 4: C = 2; break; case 16: C = 8; break; case 64: case 128: case 256: case 512: case 1024: case 2048: case 4096: case 8192: case 16384: case 32768: case 65536: case 131072: case 262144: case 524288: case 1048576: case 2097152: case 4194304: case 8388608: case 16777216: case 33554432: case 67108864: C = 32; break; case 536870912: C = 268435456; break; default: C = 0; } C = C & (x.suspendedLanes | N) ? 0 : C, C !== 0 && C !== j.retryLane && (j.retryLane = C, li(o, C), Ra( x, o, C, -1 )); } return Xi(), x = Oc(Error(f(421))), su(o, l, N, x); } return fh(C) ? (l.flags |= 128, l.child = o.child, l = To.bind(null, o), Kr(C, l), null) : (o = j.treeContext, Ot && (Ga = Jo(C), Ta = l, In = !0, oi = null, Zl = !1, o !== null && (ja[Wa++] = Li, ja[Wa++] = Si, ja[Wa++] = as, Li = o.id, Si = o.overflow, as = l)), l = zc(l, x.children), l.flags |= 4096, l); } function Eo(o, l, h) { o.lanes |= l; var x = o.alternate; x !== null && (x.lanes |= l), xf(o.return, l, h); } function us(o, l, h, x, C) { var j = o.memoizedState; j === null ? o.memoizedState = { isBackwards: l, rendering: null, renderingStartTime: 0, last: x, tail: h, tailMode: C } : (j.isBackwards = l, j.rendering = null, j.renderingStartTime = 0, j.last = x, j.tail = h, j.tailMode = C); } function wo(o, l, h) { var x = l.pendingProps, C = x.revealOrder, j = x.tail; if (pr(o, l, x.children, h), x = ln.current, x & 2) x = x & 1 | 2, l.flags |= 128; else { if (o !== null && o.flags & 128) e: for (o = l.child; o !== null; ) { if (o.tag === 13) o.memoizedState !== null && Eo(o, h, l); else if (o.tag === 19) Eo(o, h, l); else if (o.child !== null) { o.child.return = o, o = o.child; continue; } if (o === l) break e; for (; o.sibling === null; ) { if (o.return === null || o.return === l) break e; o = o.return; } o.sibling.return = o.return, o = o.sibling; } x &= 1; } if (mn(ln, x), !(l.mode & 1)) l.memoizedState = null; else switch (C) { case "forwards": for (h = l.child, C = null; h !== null; ) o = h.alternate, o !== null && Zs(o) === null && (C = h), h = h.sibling; h = C, h === null ? (C = l.child, l.child = null) : (C = h.sibling, h.sibling = null), us(l, !1, C, h, j); break; case "backwards": for (h = null, C = l.child, l.child = null; C !== null; ) { if (o = C.alternate, o !== null && Zs(o) === null) { l.child = C; break; } o = C.sibling, C.sibling = h, h = C, C = o; } us(l, !0, h, null, j); break; case "together": us(l, !1, null, null, void 0); break; default: l.memoizedState = null; } return l.child; } function al(o, l) { !(l.mode & 1) && o !== null && (o.alternate = null, l.alternate = null, l.flags |= 2); } function $n(o, l, h) { if (o !== null && (l.dependencies = o.dependencies), ps |= l.lanes, !(h & l.childLanes)) return null; if (o !== null && l.child !== o.child) throw Error(f(153)); if (l.child !== null) { for (o = l.child, h = Ti(o, o.pendingProps), l.child = h, h.return = l; o.sibling !== null; ) o = o.sibling, h = h.sibling = Ti(o, o.pendingProps), h.return = l; h.sibling = null; } return l.child; } function il(o, l, h) { switch (l.tag) { case 3: Pf(l), Ys(); break; case 5: ua(l); break; case 1: Ur(l.type) && $l(l); break; case 4: cr(l, l.stateNode.containerInfo); break; case 10: wh(l, l.type._context, l.memoizedProps.value); break; case 13: var x = l.memoizedState; if (x !== null) return x.dehydrated !== null ? (mn(ln, ln.current & 1), l.flags |= 128, null) : h & l.child.childLanes ? zh(o, l, h) : (mn(ln, ln.current & 1), o = $n(o, l, h), o !== null ? o.sibling : null); mn(ln, ln.current & 1); break; case 19: if (x = (h & l.childLanes) !== 0, o.flags & 128) { if (x) return wo( o, l, h ); l.flags |= 128; } var C = l.memoizedState; if (C !== null && (C.rendering = null, C.tail = null, C.lastEffect = null), mn(ln, ln.current), x) break; return null; case 22: case 23: return l.lanes = 0, Ph(o, l, h); } return $n(o, l, h); } function wt(o) { o.flags |= 4; } function lu(o, l) { if (o !== null && o.child === l.child) return !0; if (l.flags & 16) return !1; for (o = l.child; o !== null; ) { if (o.flags & 12854 || o.subtreeFlags & 12854) return !1; o = o.sibling; } return !0; } var ol, Ic, Fc, sl; if (Le) ol = function(o, l) { for (var h = l.child; h !== null; ) { if (h.tag === 5 || h.tag === 6) ke(o, h.stateNode); else if (h.tag !== 4 && h.child !== null) { h.child.return = h, h = h.child; continue; } if (h === l) break; for (; h.sibling === null; ) { if (h.return === null || h.return === l) return; h = h.return; } h.sibling.return = h.return, h = h.sibling; } }, Ic = function() { }, Fc = function(o, l, h, x, C) { if (o = o.memoizedProps, o !== x) { var j = l.stateNode, N = Rn(Xr.current); h = Se(j, h, o, x, C, N), (l.updateQueue = h) && wt(l); } }, sl = function(o, l, h, x) { h !== x && wt(l); }; else if (yt) { ol = function(o, l, h, x) { for (var C = l.child; C !== null; ) { if (C.tag === 5) { var j = C.stateNode; h && x && (j = fo(j, C.type, C.memoizedProps, C)), ke(o, j); } else if (C.tag === 6) j = C.stateNode, h && x && (j = Va(j, C.memoizedProps, C)), ke(o, j); else if (C.tag !== 4) { if (C.tag === 22 && C.memoizedState !== null) j = C.child, j !== null && (j.return = C), ol(o, C, !0, !0); else if (C.child !== null) { C.child.return = C, C = C.child; continue; } } if (C === l) break; for (; C.sibling === null; ) { if (C.return === null || C.return === l) return; C = C.return; } C.sibling.return = C.return, C = C.sibling; } }; var ll = function(o, l, h, x) { for (var C = l.child; C !== null; ) { if (C.tag === 5) { var j = C.stateNode; h && x && (j = fo(j, C.type, C.memoizedProps, C)), tn(o, j); } else if (C.tag === 6) j = C.stateNode, h && x && (j = Va(j, C.memoizedProps, C)), tn(o, j); else if (C.tag !== 4) { if (C.tag === 22 && C.memoizedState !== null) j = C.child, j !== null && (j.return = C), ll(o, C, !0, !0); else if (C.child !== null) { C.child.return = C, C = C.child; continue; } } if (C === l) break; for (; C.sibling === null; ) { if (C.return === null || C.return === l) return; C = C.return; } C.sibling.return = C.return, C = C.sibling; } }; Ic = function(o, l) { var h = l.stateNode; if (!lu(o, l)) { o = h.containerInfo; var x = Zu(o); ll(x, l, !1, !1), h.pendingChildren = x, wt(l), Oi(o, x); } }, Fc = function(o, l, h, x, C) { var j = o.stateNode, N = o.memoizedProps; if ((o = lu(o, l)) && N === x) l.stateNode = j; else { var V = l.stateNode, ue = Rn(Xr.current), Oe = null; N !== x && (Oe = Se(V, h, N, x, C, ue)), o && Oe === null ? l.stateNode = j : (j = Wl(j, Oe, h, N, x, l, o, V), De(j, h, x, C, ue) && wt(l), l.stateNode = j, o ? wt(l) : ol(j, l, !1, !1)); } }, sl = function(o, l, h, x) { h !== x ? (o = Rn(_a.current), h = Rn(Xr.current), l.stateNode = Ie(x, o, h, l), wt(l)) : l.stateNode = o.stateNode; }; } else Ic = function() { }, Fc = function() { }, sl = function() { }; function uu(o, l) { if (!In) switch (o.tailMode) { case "hidden": l = o.tail; for (var h = null; l !== null; ) l.alternate !== null && (h = l), l = l.sibling; h === null ? o.tail = null : h.sibling = null; break; case "collapsed": h = o.tail; for (var x = null; h !== null; ) h.alternate !== null && (x = h), h = h.sibling; x === null ? l || o.tail === null ? o.tail = null : o.tail.sibling = null : x.sibling = null; } } function _r(o) { var l = o.alternate !== null && o.alternate.child === o.child, h = 0, x = 0; if (l) for (var C = o.child; C !== null; ) h |= C.lanes | C.childLanes, x |= C.subtreeFlags & 14680064, x |= C.flags & 14680064, C.return = o, C = C.sibling; else for (C = o.child; C !== null; ) h |= C.lanes | C.childLanes, x |= C.subtreeFlags, x |= C.flags, C.return = o, C = C.sibling; return o.subtreeFlags |= x, o.childLanes = h, l; } function oy(o, l, h) { var x = l.pendingProps; switch (qs(l), l.tag) { case 2: case 16: case 15: case 0: case 11: case 7: case 8: case 12: case 9: case 14: return _r(l), null; case 1: return Ur(l.type) && Xl(), _r(l), null; case 3: return h = l.stateNode, go(), Gt(la), Gt(Br), Sc(), h.pendingContext && (h.context = h.pendingContext, h.pendingContext = null), (o === null || o.child === null) && (lc(l) ? wt(l) : o === null || o.memoizedState.isDehydrated && !(l.flags & 256) || (l.flags |= 1024, oi !== null && (pl(oi), oi = null))), Ic(o, l), _r(l), null; case 5: ui(l), h = Rn(_a.current); var C = l.type; if (o !== null && l.stateNode != null) Fc(o, l, C, x, h), o.ref !== l.ref && (l.flags |= 512, l.flags |= 2097152); else { if (!x) { if (l.stateNode === null) throw Error(f(166)); return _r(l), null; } if (o = Rn(Xr.current), lc(l)) { if (!Ot) throw Error(f(175)); o = Qd(l.stateNode, l.type, l.memoizedProps, h, o, l, !Zl), l.updateQueue = o, o !== null && wt(l); } else { var j = re(C, x, h, o, l); ol(j, l, !1, !1), l.stateNode = j, De(j, C, x, h, o) && wt(l); } l.ref !== null && (l.flags |= 512, l.flags |= 2097152); } return _r(l), null; case 6: if (o && l.stateNode != null) sl(o, l, o.memoizedProps, x); else { if (typeof x != "string" && l.stateNode === null) throw Error(f(166)); if (o = Rn(_a.current), h = Rn(Xr.current), lc(l)) { if (!Ot) throw Error(f(176)); if (o = l.stateNode, h = l.memoizedProps, (x = zi(o, h, l, !Zl)) && (C = Ta, C !== null)) switch (C.tag) { case 3: tc(C.stateNode.containerInfo, o, h, (C.mode & 1) !== 0); break; case 5: Gg(C.type, C.memoizedProps, C.stateNode, o, h, (C.mode & 1) !== 0); } x && wt(l); } else l.stateNode = Ie(x, o, h, l); } return _r(l), null; case 13: if (Gt(ln), x = l.memoizedState, o === null || o.memoizedState !== null && o.memoizedState.dehydrated !== null) { if (In && Ga !== null && l.mode & 1 && !(l.flags & 128)) Eh(), Ys(), l.flags |= 98560, C = !1; else if (C = lc(l), x !== null && x.dehydrated !== null) { if (o === null) { if (!C) throw Error(f(318)); if (!Ot) throw Error(f(344)); if (C = l.memoizedState, C = C !== null ? C.dehydrated : null, !C) throw Error(f(317)); ec(C, l); } else Ys(), !(l.flags & 128) && (l.memoizedState = null), l.flags |= 4; _r(l), C = !1; } else oi !== null && (pl(oi), oi = null), C = !0; if (!C) return l.flags & 65536 ? l : null; } return l.flags & 128 ? (l.lanes = h, l) : (h = x !== null, h !== (o !== null && o.memoizedState !== null) && h && (l.child.flags |= 8192, l.mode & 1 && (o === null || ln.current & 1 ? ir === 0 && (ir = 3) : Xi())), l.updateQueue !== null && (l.flags |= 4), _r(l), null); case 4: return go(), Ic(o, l), o === null && rn(l.stateNode.containerInfo), _r(l), null; case 10: return yf(l.type._context), _r(l), null; case 17: return Ur(l.type) && Xl(), _r(l), null; case 19: if (Gt(ln), C = l.memoizedState, C === null) return _r(l), null; if (x = (l.flags & 128) !== 0, j = C.rendering, j === null) if (x) uu(C, !1); else { if (ir !== 0 || o !== null && o.flags & 128) for (o = l.child; o !== null; ) { if (j = Zs(o), j !== null) { for (l.flags |= 128, uu(C, !1), o = j.updateQueue, o !== null && (l.updateQueue = o, l.flags |= 4), l.subtreeFlags = 0, o = h, h = l.child; h !== null; ) x = h, C = o, x.flags &= 14680066, j = x.alternate, j === null ? (x.childLanes = 0, x.lanes = C, x.child = null, x.subtreeFlags = 0, x.memoizedProps = null, x.memoizedState = null, x.updateQueue = null, x.dependencies = null, x.stateNode = null) : (x.childLanes = j.childLanes, x.lanes = j.lanes, x.child = j.child, x.subtreeFlags = 0, x.deletions = null, x.memoizedProps = j.memoizedProps, x.memoizedState = j.memoizedState, x.updateQueue = j.updateQueue, x.type = j.type, C = j.dependencies, x.dependencies = C === null ? null : { lanes: C.lanes, firstContext: C.firstContext }), h = h.sibling; return mn(ln, ln.current & 1 | 2), l.child; } o = o.sibling; } C.tail !== null && gr() > Gc && (l.flags |= 128, x = !0, uu(C, !1), l.lanes = 4194304); } else { if (!x) if (o = Zs(j), o !== null) { if (l.flags |= 128, x = !0, o = o.updateQueue, o !== null && (l.updateQueue = o, l.flags |= 4), uu(C, !0), C.tail === null && C.tailMode === "hidden" && !j.alternate && !In) return _r(l), null; } else 2 * gr() - C.renderingStartTime > Gc && h !== 1073741824 && (l.flags |= 128, x = !0, uu(C, !1), l.lanes = 4194304); C.isBackwards ? (j.sibling = l.child, l.child = j) : (o = C.last, o !== null ? o.sibling = j : l.child = j, C.last = j); } return C.tail !== null ? (l = C.tail, C.rendering = l, C.tail = l.sibling, C.renderingStartTime = gr(), l.sibling = null, o = ln.current, mn(ln, x ? o & 1 | 2 : o & 1), l) : (_r(l), null); case 22: case 23: return pi(), h = l.memoizedState !== null, o !== null && o.memoizedState !== null !== h && (l.flags |= 8192), h && l.mode & 1 ? ka & 1073741824 && (_r(l), Le && l.subtreeFlags & 6 && (l.flags |= 8192)) : _r(l), null; case 24: return null; case 25: return null; } throw Error(f( 156, l.tag )); } function Of(o, l) { switch (qs(l), l.tag) { case 1: return Ur(l.type) && Xl(), o = l.flags, o & 65536 ? (l.flags = o & -65537 | 128, l) : null; case 3: return go(), Gt(la), Gt(Br), Sc(), o = l.flags, o & 65536 && !(o & 128) ? (l.flags = o & -65537 | 128, l) : null; case 5: return ui(l), null; case 13: if (Gt(ln), o = l.memoizedState, o !== null && o.dehydrated !== null) { if (l.alternate === null) throw Error(f(340)); Ys(); } return o = l.flags, o & 65536 ? (l.flags = o & -65537 | 128, l) : null; case 19: return Gt(ln), null; case 4: return go(), null; case 10: return yf(l.type._context), null; case 22: case 23: return pi(), null; case 24: return null; default: return null; } } var Lc = !1, Mr = !1, Ih = typeof WeakSet == "function" ? WeakSet : Set, it = null; function $r(o, l) { var h = o.ref; if (h !== null) if (typeof h == "function") try { h(null); } catch (x) { Jt(o, l, x); } else h.current = null; } function cs(o, l, h) { try { h(); } catch (x) { Jt(o, l, x); } } var ul = !1; function Af(o, l) { for (se(o.containerInfo), it = l; it !== null; ) if (o = it, l = o.child, (o.subtreeFlags & 1028) !== 0 && l !== null) l.return = o, it = l; else for (; it !== null; ) { o = it; try { var h = o.alternate; if (o.flags & 1024) switch (o.tag) { case 0: case 11: case 15: break; case 1: if (h !== null) { var x = h.memoizedProps, C = h.memoizedState, j = o.stateNode, N = j.getSnapshotBeforeUpdate(o.elementType === o.type ? x : si(o.type, x), C); j.__reactInternalSnapshotBeforeUpdate = N; } break; case 3: Le && sa(o.stateNode.containerInfo); break; case 5: case 6: case 4: case 17: break; default: throw Error(f(163)); } } catch (V) { Jt(o, o.return, V); } if (l = o.sibling, l !== null) { l.return = o.return, it = l; break; } it = o.return; } return h = ul, ul = !1, h; } function Yi(o, l, h) { var x = l.updateQueue; if (x = x !== null ? x.lastEffect : null, x !== null) { var C = x = x.next; do { if ((C.tag & o) === o) { var j = C.destroy; C.destroy = void 0, j !== void 0 && cs(l, h, j); } C = C.next; } while (C !== x); } } function fa(o, l) { if (l = l.updateQueue, l = l !== null ? l.lastEffect : null, l !== null) { var h = l = l.next; do { if ((h.tag & o) === o) { var x = h.create; h.destroy = x(); } h = h.next; } while (h !== l); } } function nr(o) { var l = o.ref; if (l !== null) { var h = o.stateNode; switch (o.tag) { case 5: o = Me(h); break; default: o = h; } typeof l == "function" ? l(o) : l.current = o; } } function Fh(o) { var l = o.alternate; l !== null && (o.alternate = null, Fh(l)), o.child = null, o.deletions = null, o.sibling = null, o.tag === 5 && (l = o.stateNode, l !== null && pn(l)), o.stateNode = null, o.return = null, o.dependencies = null, o.memoizedProps = null, o.memoizedState = null, o.pendingProps = null, o.stateNode = null, o.updateQueue = null; } function Lh(o) { return o.tag === 5 || o.tag === 3 || o.tag === 4; } function Bh(o) { e: for (; ; ) { for (; o.sibling === null; ) { if (o.return === null || Lh(o.return)) return null; o = o.return; } for (o.sibling.return = o.return, o = o.sibling; o.tag !== 5 && o.tag !== 6 && o.tag !== 18; ) { if (o.flags & 2 || o.child === null || o.tag === 4) continue e; o.child.return = o, o = o.child; } if (!(o.flags & 2)) return o.stateNode; } } function Bc(o, l, h) { var x = o.tag; if (x === 5 || x === 6) o = o.stateNode, l ? ft(h, o, l) : _t(h, o); else if (x !== 4 && (o = o.child, o !== null)) for (Bc(o, l, h), o = o.sibling; o !== null; ) Bc(o, l, h), o = o.sibling; } function Uc(o, l, h) { var x = o.tag; if (x === 5 || x === 6) o = o.stateNode, l ? Ne(h, o, l) : Te(h, o); else if (x !== 4 && (o = o.child, o !== null)) for (Uc(o, l, h), o = o.sibling; o !== null; ) Uc(o, l, h), o = o.sibling; } var yr = null, fi = !1; function Ei(o, l, h) { for (h = h.child; h !== null; ) zf(o, l, h), h = h.sibling; } function zf(o, l, h) { if (xi && typeof xi.onCommitFiberUnmount == "function") try { xi.onCommitFiberUnmount(oc, h); } catch { } switch (h.tag) { case 5: Mr || $r(h, l); case 6: if (Le) { var x = yr, C = fi; yr = null, Ei(o, l, h), yr = x, fi = C, yr !== null && (fi ? vn(yr, h.stateNode) : Vt(yr, h.stateNode)); } else Ei(o, l, h); break; case 18: Le && yr !== null && (fi ? Ii(yr, h.stateNode) : Bs(yr, h.stateNode)); break; case 4: Le ? (x = yr, C = fi, yr = h.stateNode.containerInfo, fi = !0, Ei(o, l, h), yr = x, fi = C) : (yt && (x = h.stateNode.containerInfo, C = Zu(x), gi(x, C)), Ei(o, l, h)); break; case 0: case 11: case 14: case 15: if (!Mr && (x = h.updateQueue, x !== null && (x = x.lastEffect, x !== null))) { C = x = x.next; do { var j = C, N = j.destroy; j = j.tag, N !== void 0 && (j & 2 || j & 4) && cs(h, l, N), C = C.next; } while (C !== x); } Ei(o, l, h); break; case 1: if (!Mr && ($r(h, l), x = h.stateNode, typeof x.componentWillUnmount == "function")) try { x.props = h.memoizedProps, x.state = h.memoizedState, x.componentWillUnmount(); } catch (V) { Jt(h, l, V); } Ei(o, l, h); break; case 21: Ei(o, l, h); break; case 22: h.mode & 1 ? (Mr = (x = Mr) || h.memoizedState !== null, Ei(o, l, h), Mr = x) : Ei(o, l, h); break; default: Ei( o, l, h ); } } function hr(o) { var l = o.updateQueue; if (l !== null) { o.updateQueue = null; var h = o.stateNode; h === null && (h = o.stateNode = new Ih()), l.forEach(function(x) { var C = uy.bind(null, o, x); h.has(x) || (h.add(x), x.then(C, C)); }); } } function pa(o, l) { var h = l.deletions; if (h !== null) for (var x = 0; x < h.length; x++) { var C = h[x]; try { var j = o, N = l; if (Le) { var V = N; e: for (; V !== null; ) { switch (V.tag) { case 5: yr = V.stateNode, fi = !1; break e; case 3: yr = V.stateNode.containerInfo, fi = !0; break e; case 4: yr = V.stateNode.containerInfo, fi = !0; break e; } V = V.return; } if (yr === null) throw Error(f(160)); zf(j, N, C), yr = null, fi = !1; } else zf(j, N, C); var ue = C.alternate; ue !== null && (ue.return = null), C.return = null; } catch (Oe) { Jt(C, l, Oe); } } if (l.subtreeFlags & 12854) for (l = l.child; l !== null; ) If(l, o), l = l.sibling; } function If(o, l) { var h = o.alternate, x = o.flags; switch (o.tag) { case 0: case 11: case 14: case 15: if (pa(l, o), Qr(o), x & 4) { try { Yi(3, o, o.return), fa(3, o); } catch (Ke) { Jt(o, o.return, Ke); } try { Yi(5, o, o.return); } catch (Ke) { Jt(o, o.return, Ke); } } break; case 1: pa(l, o), Qr(o), x & 512 && h !== null && $r(h, h.return); break; case 5: if (pa(l, o), Qr(o), x & 512 && h !== null && $r(h, h.return), Le) { if (o.flags & 32) { var C = o.stateNode; try { st(C); } catch (Ke) { Jt(o, o.return, Ke); } } if (x & 4 && (C = o.stateNode, C != null)) { var j = o.memoizedProps; if (h = h !== null ? h.memoizedProps : j, x = o.type, l = o.updateQueue, o.updateQueue = null, l !== null) try { pe(C, l, x, h, j, o); } catch (Ke) { Jt(o, o.return, Ke); } } } break; case 6: if (pa(l, o), Qr(o), x & 4 && Le) { if (o.stateNode === null) throw Error(f(162)); C = o.stateNode, j = o.memoizedProps, h = h !== null ? h.memoizedProps : j; try { Zt(C, h, j); } catch (Ke) { Jt(o, o.return, Ke); } } break; case 3: if (pa(l, o), Qr(o), x & 4) { if (Le && Ot && h !== null && h.memoizedState.isDehydrated) try { ql(l.containerInfo); } catch (Ke) { Jt(o, o.return, Ke); } if (yt) { C = l.containerInfo, j = l.pendingChildren; try { gi(C, j); } catch (Ke) { Jt(o, o.return, Ke); } } } break; case 4: if (pa( l, o ), Qr(o), x & 4 && yt) { j = o.stateNode, C = j.containerInfo, j = j.pendingChildren; try { gi(C, j); } catch (Ke) { Jt(o, o.return, Ke); } } break; case 13: pa(l, o), Qr(o), C = o.child, C.flags & 8192 && (j = C.memoizedState !== null, C.stateNode.isHidden = j, !j || C.alternate !== null && C.alternate.memoizedState !== null || (Hf = gr())), x & 4 && hr(o); break; case 22: var N = h !== null && h.memoizedState !== null; if (o.mode & 1 ? (Mr = (h = Mr) || N, pa(l, o), Mr = h) : pa(l, o), Qr(o), x & 8192) { if (h = o.memoizedState !== null, (o.stateNode.isHidden = h) && !N && o.mode & 1) for (it = o, x = o.child; x !== null; ) { for (l = it = x; it !== null; ) { N = it; var V = N.child; switch (N.tag) { case 0: case 11: case 14: case 15: Yi(4, N, N.return); break; case 1: $r(N, N.return); var ue = N.stateNode; if (typeof ue.componentWillUnmount == "function") { var Oe = N, ut = N.return; try { var xt = Oe; ue.props = xt.memoizedProps, ue.state = xt.memoizedState, ue.componentWillUnmount(); } catch (Ke) { Jt(Oe, ut, Ke); } } break; case 5: $r(N, N.return); break; case 22: if (N.memoizedState !== null) { ds(l); continue; } } V !== null ? (V.return = N, it = V) : ds(l); } x = x.sibling; } if (Le) { e: if (x = null, Le) for (l = o; ; ) { if (l.tag === 5) { if (x === null) { x = l; try { C = l.stateNode, h ? rt(C) : bn(l.stateNode, l.memoizedProps); } catch (Ke) { Jt(o, o.return, Ke); } } } else if (l.tag === 6) { if (x === null) try { j = l.stateNode, h ? kn(j) : Ft(j, l.memoizedProps); } catch (Ke) { Jt(o, o.return, Ke); } } else if ((l.tag !== 22 && l.tag !== 23 || l.memoizedState === null || l === o) && l.child !== null) { l.child.return = l, l = l.child; continue; } if (l === o) break e; for (; l.sibling === null; ) { if (l.return === null || l.return === o) break e; x === l && (x = null), l = l.return; } x === l && (x = null), l.sibling.return = l.return, l = l.sibling; } } } break; case 19: pa(l, o), Qr(o), x & 4 && hr(o); break; case 21: break; default: pa(l, o), Qr(o); } } function Qr(o) { var l = o.flags; if (l & 2) { try { if (Le) { e: { for (var h = o.return; h !== null; ) { if (Lh(h)) { var x = h; break e; } h = h.return; } throw Error(f(160)); } switch (x.tag) { case 5: var C = x.stateNode; x.flags & 32 && (st(C), x.flags &= -33); var j = Bh(o); Uc(o, j, C); break; case 3: case 4: var N = x.stateNode.containerInfo, V = Bh(o); Bc(o, V, N); break; default: throw Error(f(161)); } } } catch (ue) { Jt(o, o.return, ue); } o.flags &= -3; } l & 4096 && (o.flags &= -4097); } function Uh(o, l, h) { it = o, Hh(o); } function Hh(o, l, h) { for (var x = (o.mode & 1) !== 0; it !== null; ) { var C = it, j = C.child; if (C.tag === 22 && x) { var N = C.memoizedState !== null || Lc; if (!N) { var V = C.alternate, ue = V !== null && V.memoizedState !== null || Mr; V = Lc; var Oe = Mr; if (Lc = N, (Mr = ue) && !Oe) for (it = C; it !== null; ) N = it, ue = N.child, N.tag === 22 && N.memoizedState !== null ? kr(C) : ue !== null ? (ue.return = N, it = ue) : kr(C); for (; j !== null; ) it = j, Hh(j), j = j.sibling; it = C, Lc = V, Mr = Oe; } Vh(o); } else C.subtreeFlags & 8772 && j !== null ? (j.return = C, it = j) : Vh(o); } } function Vh(o) { for (; it !== null; ) { var l = it; if (l.flags & 8772) { var h = l.alternate; try { if (l.flags & 8772) switch (l.tag) { case 0: case 11: case 15: Mr || fa(5, l); break; case 1: var x = l.stateNode; if (l.flags & 4 && !Mr) if (h === null) x.componentDidMount(); else { var C = l.elementType === l.type ? h.memoizedProps : si(l.type, h.memoizedProps); x.componentDidUpdate(C, h.memoizedState, x.__reactInternalSnapshotBeforeUpdate); } var j = l.updateQueue; j !== null && Hi(l, j, x); break; case 3: var N = l.updateQueue; if (N !== null) { if (h = null, l.child !== null) switch (l.child.tag) { case 5: h = Me(l.child.stateNode); break; case 1: h = l.child.stateNode; } Hi(l, N, h); } break; case 5: var V = l.stateNode; h === null && l.flags & 4 && Re(V, l.type, l.memoizedProps, l); break; case 6: break; case 4: break; case 12: break; case 13: if (Ot && l.memoizedState === null) { var ue = l.alternate; if (ue !== null) { var Oe = ue.memoizedState; if (Oe !== null) { var ut = Oe.dehydrated; ut !== null && Yl(ut); } } } break; case 19: case 17: case 21: case 22: case 23: case 25: break; default: throw Error(f(163)); } Mr || l.flags & 512 && nr(l); } catch (xt) { Jt(l, l.return, xt); } } if (l === o) { it = null; break; } if (h = l.sibling, h !== null) { h.return = l.return, it = h; break; } it = l.return; } } function ds(o) { for (; it !== null; ) { var l = it; if (l === o) { it = null; break; } var h = l.sibling; if (h !== null) { h.return = l.return, it = h; break; } it = l.return; } } function kr(o) { for (; it !== null; ) { var l = it; try { switch (l.tag) { case 0: case 11: case 15: var h = l.return; try { fa(4, l); } catch (ue) { Jt(l, h, ue); } break; case 1: var x = l.stateNode; if (typeof x.componentDidMount == "function") { var C = l.return; try { x.componentDidMount(); } catch (ue) { Jt(l, C, ue); } } var j = l.return; try { nr(l); } catch (ue) { Jt(l, j, ue); } break; case 5: var N = l.return; try { nr(l); } catch (ue) { Jt(l, N, ue); } } } catch (ue) { Jt(l, l.return, ue); } if (l === o) { it = null; break; } var V = l.sibling; if (V !== null) { V.return = l.return, it = V; break; } it = l.return; } } var Ye = 0, Ma = 1, ha = 2, Hc = 3, Vc = 4; if (typeof Symbol == "function" && Symbol.for) { var cu = Symbol.for; Ye = cu("selector.component"), Ma = cu("selector.has_pseudo_class"), ha = cu("selector.role"), Hc = cu("selector.test_id"), Vc = cu("selector.text"); } function Ff(o) { var l = Qe(o); if (l != null) { if (typeof l.memoizedProps["data-testname"] != "string") throw Error(f(364)); return l; } if (o = He(o), o === null) throw Error(f(362)); return o.stateNode.current; } function Lf(o, l) { switch (l.$$typeof) { case Ye: if (o.type === l.value) return !0; break; case Ma: e: { l = l.value, o = [o, 0]; for (var h = 0; h < o.length; ) { var x = o[h++], C = o[h++], j = l[C]; if (x.tag !== 5 || !he(x)) { for (; j != null && Lf(x, j); ) C++, j = l[C]; if (C === l.length) { l = !0; break e; } else for (x = x.child; x !== null; ) o.push(x, C), x = x.sibling; } } l = !1; } return l; case ha: if (o.tag === 5 && Ae(o.stateNode, l.value)) return !0; break; case Vc: if ((o.tag === 5 || o.tag === 6) && (o = at(o), o !== null && 0 <= o.indexOf(l.value))) return !0; break; case Hc: if (o.tag === 5 && (o = o.memoizedProps["data-testname"], typeof o == "string" && o.toLowerCase() === l.value.toLowerCase())) return !0; break; default: throw Error(f(365)); } return !1; } function rr(o) { switch (o.$$typeof) { case Ye: return "<" + (U(o.value) || "Unknown") + ">"; case Ma: return ":has(" + (rr(o) || "") + ")"; case ha: return '[role="' + o.value + '"]'; case Vc: return '"' + o.value + '"'; case Hc: return '[data-testname="' + o.value + '"]'; default: throw Error(f(365)); } } function Wh(o, l) { var h = []; o = [o, 0]; for (var x = 0; x < o.length; ) { var C = o[x++], j = o[x++], N = l[j]; if (C.tag !== 5 || !he(C)) { for (; N != null && Lf(C, N); ) j++, N = l[j]; if (j === l.length) h.push(C); else for (C = C.child; C !== null; ) o.push(C, j), C = C.sibling; } } return h; } function Bf(o, l) { if (!Q) throw Error(f(363)); o = Ff(o), o = Wh(o, l), l = [], o = Array.from(o); for (var h = 0; h < o.length; ) { var x = o[h++]; if (x.tag === 5) he(x) || l.push(x.stateNode); else for (x = x.child; x !== null; ) o.push(x), x = x.sibling; } return l; } var sy = Math.ceil, du = m.ReactCurrentDispatcher, fs = m.ReactCurrentOwner, _n = m.ReactCurrentBatchConfig, Wt = 0, xr = null, ar = null, Rr = 0, ka = 0, cl = po(0), ir = 0, dl = null, ps = 0, Wc = 0, Uf = 0, fu = null, va = null, Hf = 0, Gc = 1 / 0, Ki = null; function hs() { Gc = gr() + 500; } var qc = !1, Vf = null, wi = null, Yc = !1, or = null, Ya = 0, vs = 0, pu = null, hu = -1, Kc = 0; function Pr() { return Wt & 6 ? gr() : hu !== -1 ? hu : hu = gr(); } function Nr(o) { return o.mode & 1 ? Wt & 2 && Rr !== 0 ? Rr & -Rr : ny.transition !== null ? (Kc === 0 && (Kc = vh()), Kc) : (o = sn, o !== 0 ? o : Tn()) : 1; } function Ra(o, l, h, x) { if (50 < vs) throw vs = 0, pu = null, Error(f(185)); yi(o, h, x), (!(Wt & 2) || o !== xr) && (o === xr && (!(Wt & 2) && (Wc |= h), ir === 4 && mr(o, Rr)), vr(o, x), h === 1 && Wt === 0 && !(l.mode & 1) && (hs(), sc && ii())); } function vr(o, l) { var h = o.callbackNode; Kg(o, l); var x = ic(o, o === xr ? Rr : 0); if (x === 0) h !== null && mh(h), o.callbackNode = null, o.callbackPriority = 0; else if (l = x & -x, o.callbackPriority !== l) { if (h != null && mh(h), l === 1) o.tag === 0 ? ty(jo.bind(null, o)) : yh(jo.bind(null, o)), Wn ? tr(function() { !(Wt & 6) && ii(); }) : lf(uf, ii), h = null; else { switch (Vs(x)) { case 1: h = uf; break; case 4: h = Zg; break; case 16: h = cf; break; case 536870912: h = Jg; break; default: h = cf; } h = Kh(h, ms.bind(null, o)); } o.callbackPriority = l, o.callbackNode = h; } } function ms(o, l) { if (hu = -1, Kc = 0, Wt & 6) throw Error(f(327)); var h = o.callbackNode; if (Pa() && o.callbackNode !== h) return null; var x = ic(o, o === xr ? Rr : 0); if (x === 0) return null; if (x & 30 || x & o.expiredLanes || l) l = vu(o, x); else { l = x; var C = Wt; Wt |= 2; var j = qh(); (xr !== o || Rr !== l) && (Ki = null, hs(), gs(o, l)); do try { Xc(); break; } catch (V) { Gh(o, V); } while (1); gf(), du.current = j, Wt = C, ar !== null ? l = 0 : (xr = null, Rr = 0, l = ir); } if (l !== 0) { if (l === 2 && (C = af(o), C !== 0 && (x = C, l = fl(o, C))), l === 1) throw h = dl, gs(o, 0), mr(o, x), vr(o, gr()), h; if (l === 6) mr(o, x); else { if (C = o.current.alternate, !(x & 30) && !Ka(C) && (l = vu(o, x), l === 2 && (j = af(o), j !== 0 && (x = j, l = fl(o, j))), l === 1)) throw h = dl, gs(o, 0), mr(o, x), vr(o, gr()), h; switch (o.finishedWork = C, o.finishedLanes = x, l) { case 0: case 1: throw Error(f(345)); case 2: ys(o, va, Ki); break; case 3: if (mr(o, x), (x & 130023424) === x && (l = Hf + 500 - gr(), 10 < l)) { if (ic(o, 0) !== 0) break; if (C = o.suspendedLanes, (C & x) !== x) { Pr(), o.pingedLanes |= o.suspendedLanes & C; break; } o.timeoutHandle = Ue(ys.bind(null, o, va, Ki), l); break; } ys(o, va, Ki); break; case 4: if (mr(o, x), (x & 4194240) === x) break; for (l = o.eventTimes, C = -1; 0 < x; ) { var N = 31 - ri(x); j = 1 << N, N = l[N], N > C && (C = N), x &= ~j; } if (x = C, x = gr() - x, x = (120 > x ? 120 : 480 > x ? 480 : 1080 > x ? 1080 : 1920 > x ? 1920 : 3e3 > x ? 3e3 : 4320 > x ? 4320 : 1960 * sy(x / 1960)) - x, 10 < x) { o.timeoutHandle = Ue(ys.bind(null, o, va, Ki), x); break; } ys(o, va, Ki); break; case 5: ys(o, va, Ki); break; default: throw Error(f(329)); } } } return vr(o, gr()), o.callbackNode === h ? ms.bind(null, o) : null; } function fl(o, l) { var h = fu; return o.current.memoizedState.isDehydrated && (gs(o, l).flags |= 256), o = vu(o, l), o !== 2 && (l = va, va = h, l !== null && pl(l)), o; } function pl(o) { va === null ? va = o : va.push.apply(va, o); } function Ka(o) { for (var l = o; ; ) { if (l.flags & 16384) { var h = l.updateQueue; if (h !== null && (h = h.stores, h !== null)) for (var x = 0; x < h.length; x++) { var C = h[x], j = C.getSnapshot; C = C.value; try { if (!ai(j(), C)) return !1; } catch { return !1; } } } if (h = l.child, l.subtreeFlags & 16384 && h !== null) h.return = l, l = h; else { if (l === o) break; for (; l.sibling === null; ) { if (l.return === null || l.return === o) return !0; l = l.return; } l.sibling.return = l.return, l = l.sibling; } } return !0; } function mr(o, l) { for (l &= ~Uf, l &= ~Wc, o.suspendedLanes |= l, o.pingedLanes &= ~l, o = o.expirationTimes; 0 < l; ) { var h = 31 - ri(l), x = 1 << h; o[h] = -1, l &= ~x; } } function jo(o) { if (Wt & 6) throw Error(f(327)); Pa(); var l = ic(o, 0); if (!(l & 1)) return vr(o, gr()), null; var h = vu(o, l); if (o.tag !== 0 && h === 2) { var x = af(o); x !== 0 && (l = x, h = fl(o, x)); } if (h === 1) throw h = dl, gs(o, 0), mr(o, l), vr(o, gr()), h; if (h === 6) throw Error(f(345)); return o.finishedWork = o.current.alternate, o.finishedLanes = l, ys(o, va, Ki), vr(o, gr()), null; } function ji(o) { or !== null && or.tag === 0 && !(Wt & 6) && Pa(); var l = Wt; Wt |= 1; var h = _n.transition, x = sn; try { if (_n.transition = null, sn = 1, o) return o(); } finally { sn = x, _n.transition = h, Wt = l, !(Wt & 6) && ii(); } } function pi() { ka = cl.current, Gt(cl); } function gs(o, l) { o.finishedWork = null, o.finishedLanes = 0; var h = o.timeoutHandle; if (h !== ht && (o.timeoutHandle = ht, tt(h)), ar !== null) for (h = ar.return; h !== null; ) { var x = h; switch (qs(x), x.tag) { case 1: x = x.type.childContextTypes, x != null && Xl(); break; case 3: go(), Gt(la), Gt(Br), Sc(); break; case 5: ui(x); break; case 4: go(); break; case 13: Gt(ln); break; case 19: Gt(ln); break; case 10: yf(x.type._context); break; case 22: case 23: pi(); } h = h.return; } if (xr = o, ar = o = Ti(o.current, null), Rr = ka = l, ir = 0, dl = null, Uf = Wc = ps = 0, va = fu = null, vo !== null) { for (l = 0; l < vo.length; l++) if (h = vo[l], x = h.interleaved, x !== null) { h.interleaved = null; var C = x.next, j = h.pending; if (j !== null) { var N = j.next; j.next = C, x.next = N; } h.pending = x; } vo = null; } return o; } function Gh(o, l) { do { var h = ar; try { if (gf(), Wi.current = qi, eu) { for (var x = Dn.memoizedState; x !== null; ) { var C = x.queue; C !== null && (C.pending = null), x = x.next; } eu = !1; } if (Gr = 0, dr = Kn = Dn = null, xo = !1, el = 0, fs.current = null, h === null || h.return === null) { ir = 1, dl = l, ar = null; break; } e: { var j = o, N = h.return, V = h, ue = l; if (l = Rr, V.flags |= 32768, ue !== null && typeof ue == "object" && typeof ue.then == "function") { var Oe = ue, ut = V, xt = ut.tag; if (!(ut.mode & 1) && (xt === 0 || xt === 11 || xt === 15)) { var Ke = ut.alternate; Ke ? (ut.updateQueue = Ke.updateQueue, ut.memoizedState = Ke.memoizedState, ut.lanes = Ke.lanes) : (ut.updateQueue = null, ut.memoizedState = null); } var Pn = Mh(N); if (Pn !== null) { Pn.flags &= -257, Cn(Pn, N, V, j, l), Pn.mode & 1 && da(j, Oe, l), l = Pn, ue = Oe; var En = l.updateQueue; if (En === null) { var gn = /* @__PURE__ */ new Set(); gn.add(ue), l.updateQueue = gn; } else En.add(ue); break e; } else { if (!(l & 1)) { da(j, Oe, l), Xi(); break e; } ue = Error(f(426)); } } else if (In && V.mode & 1) { var hn = Mh(N); if (hn !== null) { !(hn.flags & 65536) && (hn.flags |= 256), Cn(hn, N, V, j, l), vf(bo(ue, V)); break e; } } j = ue = bo(ue, V), ir !== 4 && (ir = 2), fu === null ? fu = [j] : fu.push(j), j = N; do { switch (j.tag) { case 3: j.flags |= 65536, l &= -l, j.lanes |= l; var ie = nl(j, ue, l); vc(j, ie); break e; case 1: V = ue; var G = j.type, ce = j.stateNode; if (!(j.flags & 128) && (typeof G.getDerivedStateFromError == "function" || ce !== null && typeof ce.componentDidCatch == "function" && (wi === null || !wi.has(ce)))) { j.flags |= 65536, l &= -l, j.lanes |= l; var Je = Co(j, V, l); vc(j, Je); break e; } } j = j.return; } while (j !== null); } $c(h); } catch (mt) { l = mt, ar === h && h !== null && (ar = h = h.return); continue; } break; } while (1); } function qh() { var o = du.current; return du.current = qi, o === null ? qi : o; } function Xi() { (ir === 0 || ir === 3 || ir === 2) && (ir = 4), xr === null || !(ps & 268435455) && !(Wc & 268435455) || mr(xr, Rr); } function vu(o, l) { var h = Wt; Wt |= 2; var x = qh(); (xr !== o || Rr !== l) && (Ki = null, gs(o, l)); do try { Wf(); break; } catch (C) { Gh(o, C); } while (1); if (gf(), Wt = h, du.current = x, ar !== null) throw Error(f(261)); return xr = null, Rr = 0, ir; } function Wf() { for (; ar !== null; ) Yh(ar); } function Xc() { for (; ar !== null && !$g(); ) Yh(ar); } function Yh(o) { var l = Gf(o.alternate, o, ka); o.memoizedProps = o.pendingProps, l === null ? $c(o) : ar = l, fs.current = null; } function $c(o) { var l = o; do { var h = l.alternate; if (o = l.return, l.flags & 32768) { if (h = Of(h, l), h !== null) { h.flags &= 32767, ar = h; return; } if (o !== null) o.flags |= 32768, o.subtreeFlags = 0, o.deletions = null; else { ir = 6, ar = null; return; } } else if (h = oy(h, l, ka), h !== null) { ar = h; return; } if (l = l.sibling, l !== null) { ar = l; return; } ar = l = o; } while (l !== null); ir === 0 && (ir = 5); } function ys(o, l, h) { var x = sn, C = _n.transition; try { _n.transition = null, sn = 1, ly(o, l, h, x); } finally { _n.transition = C, sn = x; } return null; } function ly(o, l, h, x) { do Pa(); while (or !== null); if (Wt & 6) throw Error(f(327)); h = o.finishedWork; var C = o.finishedLanes; if (h === null) return null; if (o.finishedWork = null, o.finishedLanes = 0, h === o.current) throw Error(f(177)); o.callbackNode = null, o.callbackPriority = 0; var j = h.lanes | h.childLanes; if (Xg(o, j), o === xr && (ar = xr = null, Rr = 0), !(h.subtreeFlags & 2064) && !(h.flags & 2064) || Yc || (Yc = !0, Kh(cf, function() { return Pa(), null; })), j = (h.flags & 15990) !== 0, h.subtreeFlags & 15990 || j) { j = _n.transition, _n.transition = null; var N = sn; sn = 1; var V = Wt; Wt |= 4, fs.current = null, Af(o, h), If(h, o), B(o.containerInfo), o.current = h, Uh(h), Qg(), Wt = V, sn = N, _n.transition = j; } else o.current = h; if (Yc && (Yc = !1, or = o, Ya = C), j = o.pendingLanes, j === 0 && (wi = null), ey(h.stateNode), vr(o, gr()), l !== null) for (x = o.onRecoverableError, h = 0; h < l.length; h++) C = l[h], x(C.value, { componentStack: C.stack, digest: C.digest }); if (qc) throw qc = !1, o = Vf, Vf = null, o; return Ya & 1 && o.tag !== 0 && Pa(), j = o.pendingLanes, j & 1 ? o === pu ? vs++ : (vs = 0, pu = o) : vs = 0, ii(), null; } function Pa() { if (or !== null) { var o = Vs(Ya), l = _n.transition, h = sn; try { if (_n.transition = null, sn = 16 > o ? 16 : o, or === null) var x = !1; else { if (o = or, or = null, Ya = 0, Wt & 6) throw Error(f(331)); var C = Wt; for (Wt |= 4, it = o.current; it !== null; ) { var j = it, N = j.child; if (it.flags & 16) { var V = j.deletions; if (V !== null) { for (var ue = 0; ue < V.length; ue++) { var Oe = V[ue]; for (it = Oe; it !== null; ) { var ut = it; switch (ut.tag) { case 0: case 11: case 15: Yi(8, ut, j); } var xt = ut.child; if (xt !== null) xt.return = ut, it = xt; else for (; it !== null; ) { ut = it; var Ke = ut.sibling, Pn = ut.return; if (Fh(ut), ut === Oe) { it = null; break; } if (Ke !== null) { Ke.return = Pn, it = Ke; break; } it = Pn; } } } var En = j.alternate; if (En !== null) { var gn = En.child; if (gn !== null) { En.child = null; do { var hn = gn.sibling; gn.sibling = null, gn = hn; } while (gn !== null); } } it = j; } } if (j.subtreeFlags & 2064 && N !== null) N.return = j, it = N; else e: for (; it !== null; ) { if (j = it, j.flags & 2048) switch (j.tag) { case 0: case 11: case 15: Yi(9, j, j.return); } var ie = j.sibling; if (ie !== null) { ie.return = j.return, it = ie; break e; } it = j.return; } } var G = o.current; for (it = G; it !== null; ) { N = it; var ce = N.child; if (N.subtreeFlags & 2064 && ce !== null) ce.return = N, it = ce; else e: for (N = G; it !== null; ) { if (V = it, V.flags & 2048) try { switch (V.tag) { case 0: case 11: case 15: fa(9, V); } } catch (mt) { Jt(V, V.return, mt); } if (V === N) { it = null; break e; } var Je = V.sibling; if (Je !== null) { Je.return = V.return, it = Je; break e; } it = V.return; } } if (Wt = C, ii(), xi && typeof xi.onPostCommitFiberRoot == "function") try { xi.onPostCommitFiberRoot(oc, o); } catch { } x = !0; } return x; } finally { sn = h, _n.transition = l; } } return !1; } function Sr(o, l, h) { l = bo(h, l), l = nl(o, l, 1), o = mo(o, l, 1), l = Pr(), o !== null && (yi(o, 1, l), vr(o, l)); } function Jt(o, l, h) { if (o.tag === 3) Sr(o, o, h); else for (; l !== null; ) { if (l.tag === 3) { Sr(l, o, h); break; } else if (l.tag === 1) { var x = l.stateNode; if (typeof l.type.getDerivedStateFromError == "function" || typeof x.componentDidCatch == "function" && (wi === null || !wi.has(x))) { o = bo(h, o), o = Co(l, o, 1), l = mo(l, o, 1), o = Pr(), l !== null && (yi(l, 1, o), vr(l, o)); break; } } l = l.return; } } function hi(o, l, h) { var x = o.pingCache; x !== null && x.delete(l), l = Pr(), o.pingedLanes |= o.suspendedLanes & h, xr === o && (Rr & h) === h && (ir === 4 || ir === 3 && (Rr & 130023424) === Rr && 500 > gr() - Hf ? gs(o, 0) : Uf |= h), vr(o, l); } function $i(o, l) { l === 0 && (o.mode & 1 ? (l = ns, ns <<= 1, !(ns & 130023424) && (ns = 4194304)) : l = 1); var h = Pr(); o = li(o, l), o !== null && (yi(o, l, h), vr(o, h)); } function To(o) { var l = o.memoizedState, h = 0; l !== null && (h = l.retryLane), $i(o, h); } function uy(o, l) { var h = 0; switch (o.tag) { case 13: var x = o.stateNode, C = o.memoizedState; C !== null && (h = C.retryLane); break; case 19: x = o.stateNode; break; default: throw Error(f(314)); } x !== null && x.delete(l), $i(o, h); } var Gf; Gf = function(o, l, h) { if (o !== null) if (o.memoizedProps !== l.pendingProps || la.current) Dr = !0; else { if (!(o.lanes & h) && !(l.flags & 128)) return Dr = !1, il(o, l, h); Dr = !!(o.flags & 131072); } else Dr = !1, In && l.flags & 1048576 && xh(l, Ql, l.index); switch (l.lanes = 0, l.tag) { case 2: var x = l.type; al(o, l), o = l.pendingProps; var C = Hs(l, Br.current); Xs(l, h), C = Ct(null, l, x, o, C, h); var j = qt(); return l.flags |= 1, typeof C == "object" && C !== null && typeof C.render == "function" && C.$$typeof === void 0 ? (l.tag = 1, l.memoizedState = null, l.updateQueue = null, Ur(x) ? (j = !0, $l(l)) : j = !1, l.memoizedState = C.state !== null && C.state !== void 0 ? C.state : null, pc(l), C.updater = gc, l.stateNode = C, C._reactInternals = l, Cf(l, x, o, h), l = ou(null, l, x, !0, j, h)) : (l.tag = 0, In && j && ff(l), pr(null, l, C, h), l = l.child), l; case 16: x = l.elementType; e: { switch (al(o, l), o = l.pendingProps, C = x._init, x = C(x._payload), l.type = x, C = l.tag = Xh(x), o = si(x, o), C) { case 0: l = iu(null, l, x, o, h); break e; case 1: l = Oh(null, l, x, o, h); break e; case 11: l = au(null, l, x, o, h); break e; case 14: l = kh(null, l, x, si(x.type, o), h); break e; } throw Error(f( 306, x, "" )); } return l; case 0: return x = l.type, C = l.pendingProps, C = l.elementType === x ? C : si(x, C), iu(o, l, x, C, h); case 1: return x = l.type, C = l.pendingProps, C = l.elementType === x ? C : si(x, C), Oh(o, l, x, C, h); case 3: e: { if (Pf(l), o === null) throw Error(f(387)); x = l.pendingProps, j = l.memoizedState, C = j.element, bf(o, l), $s(l, x, null, h); var N = l.memoizedState; if (x = N.element, Ot && j.isDehydrated) if (j = { element: x, isDehydrated: !1, cache: N.cache, pendingSuspenseBoundaries: N.pendingSuspenseBoundaries, transitions: N.transitions }, l.updateQueue.baseState = j, l.memoizedState = j, l.flags & 256) { C = bo(Error(f(423)), l), l = Ah(o, l, x, h, C); break e; } else if (x !== C) { C = bo(Error(f(424)), l), l = Ah(o, l, x, h, C); break e; } else for (Ot && (Ga = $d(l.stateNode.containerInfo), Ta = l, In = !0, oi = null, Zl = !1), h = qa(l, null, x, h), l.child = h; h; ) h.flags = h.flags & -3 | 4096, h = h.sibling; else { if (Ys(), x === C) { l = $n(o, l, h); break e; } pr(o, l, x, h); } l = l.child; } return l; case 5: return ua(l), o === null && hf(l), x = l.type, C = l.pendingProps, j = o !== null ? o.memoizedProps : null, N = C.children, be(x, C) ? N = null : j !== null && be(x, j) && (l.flags |= 32), Nh(o, l), pr(o, l, N, h), l.child; case 6: return o === null && hf(l), null; case 13: return zh(o, l, h); case 4: return cr(l, l.stateNode.containerInfo), x = l.pendingProps, o === null ? l.child = Vi(l, null, x, h) : pr(o, l, x, h), l.child; case 11: return x = l.type, C = l.pendingProps, C = l.elementType === x ? C : si(x, C), au(o, l, x, C, h); case 7: return pr(o, l, l.pendingProps, h), l.child; case 8: return pr(o, l, l.pendingProps.children, h), l.child; case 12: return pr(o, l, l.pendingProps.children, h), l.child; case 10: e: { if (x = l.type._context, C = l.pendingProps, j = l.memoizedProps, N = C.value, wh(l, x, N), j !== null) if (ai(j.value, N)) { if (j.children === C.children && !la.current) { l = $n(o, l, h); break e; } } else for (j = l.child, j !== null && (j.return = l); j !== null; ) { var V = j.dependencies; if (V !== null) { N = j.child; for (var ue = V.firstContext; ue !== null; ) { if (ue.context === x) { if (j.tag === 1) { ue = bi(-1, h & -h), ue.tag = 2; var Oe = j.updateQueue; if (Oe !== null) { Oe = Oe.shared; var ut = Oe.pending; ut === null ? ue.next = ue : (ue.next = ut.next, ut.next = ue), Oe.pending = ue; } } j.lanes |= h, ue = j.alternate, ue !== null && (ue.lanes |= h), xf(j.return, h, l), V.lanes |= h; break; } ue = ue.next; } } else if (j.tag === 10) N = j.type === l.type ? null : j.child; else if (j.tag === 18) { if (N = j.return, N === null) throw Error(f(341)); N.lanes |= h, V = N.alternate, V !== null && (V.lanes |= h), xf(N, h, l), N = j.sibling; } else N = j.child; if (N !== null) N.return = j; else for (N = j; N !== null; ) { if (N === l) { N = null; break; } if (j = N.sibling, j !== null) { j.return = N.return, N = j; break; } N = N.return; } j = N; } pr(o, l, C.children, h), l = l.child; } return l; case 9: return C = l.type, x = l.pendingProps.children, Xs(l, h), C = Wr(C), x = x(C), l.flags |= 1, pr(o, l, x, h), l.child; case 14: return x = l.type, C = si(x, l.pendingProps), C = si(x.type, C), kh(o, l, x, C, h); case 15: return Rh(o, l, l.type, l.pendingProps, h); case 17: return x = l.type, C = l.pendingProps, C = l.elementType === x ? C : si(x, C), al(o, l), l.tag = 1, Ur(x) ? (o = !0, $l(l)) : o = !1, Xs(l, h), jh(l, x, C), Cf(l, x, C, h), ou(null, l, x, !0, o, h); case 19: return wo(o, l, h); case 22: return Ph(o, l, h); } throw Error(f(156, l.tag)); }; function Kh(o, l) { return lf(o, l); } function cy(o, l, h, x) { this.tag = o, this.key = h, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.ref = null, this.pendingProps = l, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = x, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null; } function Xa(o, l, h, x) { return new cy(o, l, h, x); } function Qc(o) { return o = o.prototype, !(!o || !o.isReactComponent); } function Xh(o) { if (typeof o == "function") return Qc(o) ? 1 : 0; if (o != null) { if (o = o.$$typeof, o === k) return 11; if (o === I) return 14; } return 2; } function Ti(o, l) { var h = o.alternate; return h === null ? (h = Xa(o.tag, l, o.key, o.mode), h.elementType = o.elementType, h.type = o.type, h.stateNode = o.stateNode, h.alternate = o, o.alternate = h) : (h.pendingProps = l, h.type = o.type, h.flags = 0, h.subtreeFlags = 0, h.deletions = null), h.flags = o.flags & 14680064, h.childLanes = o.childLanes, h.lanes = o.lanes, h.child = o.child, h.memoizedProps = o.memoizedProps, h.memoizedState = o.memoizedState, h.updateQueue = o.updateQueue, l = o.dependencies, h.dependencies = l === null ? null : { lanes: l.lanes, firstContext: l.firstContext }, h.sibling = o.sibling, h.index = o.index, h.ref = o.ref, h; } function mu(o, l, h, x, C, j) { var N = 2; if (x = o, typeof o == "function") Qc(o) && (N = 1); else if (typeof o == "string") N = 5; else e: switch (o) { case S: return Do(h.children, C, j, l); case E: N = 8, C |= 8; break; case w: return o = Xa(12, h, l, C | 2), o.elementType = w, o.lanes = j, o; case R: return o = Xa(13, h, l, C), o.elementType = R, o.lanes = j, o; case O: return o = Xa(19, h, l, C), o.elementType = O, o.lanes = j, o; case L: return hl(h, C, j, l); default: if (typeof o == "object" && o !== null) switch (o.$$typeof) { case D: N = 10; break e; case M: N = 9; break e; case k: N = 11; break e; case I: N = 14; break e; case A: N = 16, x = null; break e; } throw Error(f(130, o == null ? o : typeof o, "")); } return l = Xa(N, h, l, C), l.elementType = o, l.type = x, l.lanes = j, l; } function Do(o, l, h, x) { return o = Xa(7, o, x, l), o.lanes = h, o; } function hl(o, l, h, x) { return o = Xa(22, o, x, l), o.elementType = L, o.lanes = h, o.stateNode = { isHidden: !1 }, o; } function gu(o, l, h) { return o = Xa(6, o, null, l), o.lanes = h, o; } function yu(o, l, h) { return l = Xa(4, o.children !== null ? o.children : [], o.key, l), l.lanes = h, l.stateNode = { containerInfo: o.containerInfo, pendingChildren: null, implementation: o.implementation }, l; } function dy(o, l, h, x, C) { this.tag = l, this.containerInfo = o, this.finishedWork = this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = ht, this.callbackNode = this.pendingContext = this.context = null, this.callbackPriority = 0, this.eventTimes = of(0), this.expirationTimes = of(-1), this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = of(0), this.identifierPrefix = x, this.onRecoverableError = C, Ot && (this.mutableSourceEagerHydrationData = null); } function $h(o, l, h, x, C, j, N, V, ue) { return o = new dy(o, l, h, V, ue), l === 1 ? (l = 1, j === !0 && (l |= 8)) : l = 0, j = Xa(3, null, null, l), o.current = j, j.stateNode = o, j.memoizedState = { element: x, isDehydrated: h, cache: null, transitions: null, pendingSuspenseBoundaries: null }, pc(j), o; } function Qh(o) { if (!o) return ho; o = o._reactInternals; e: { if (ae(o) !== o || o.tag !== 1) throw Error(f(170)); var l = o; do { switch (l.tag) { case 3: l = l.stateNode.context; break e; case 1: if (Ur(l.type)) { l = l.stateNode.__reactInternalMemoizedMergedChildContext; break e; } } l = l.return; } while (l !== null); throw Error(f(171)); } if (o.tag === 1) { var h = o.type; if (Ur(h)) return rc(o, h, l); } return l; } function Zh(o) { var l = o._reactInternals; if (l === void 0) throw typeof o.render == "function" ? Error(f(188)) : (o = Object.keys(o).join(","), Error(f(268, o))); return o = ve(l), o === null ? null : o.stateNode; } function qf(o, l) { if (o = o.memoizedState, o !== null && o.dehydrated !== null) { var h = o.retryLane; o.retryLane = h !== 0 && h < l ? h : l; } } function xs(o, l) { qf(o, l), (o = o.alternate) && qf(o, l); } function fy(o) { return o = ve(o), o === null ? null : o.stateNode; } function Jh() { return null; } return r.attemptContinuousHydration = function(o) { if (o.tag === 13) { var l = li(o, 134217728); if (l !== null) { var h = Pr(); Ra(l, o, 134217728, h); } xs(o, 134217728); } }, r.attemptDiscreteHydration = function(o) { if (o.tag === 13) { var l = li(o, 1); if (l !== null) { var h = Pr(); Ra(l, o, 1, h); } xs(o, 1); } }, r.attemptHydrationAtCurrentPriority = function(o) { if (o.tag === 13) { var l = Nr(o), h = li(o, l); if (h !== null) { var x = Pr(); Ra(h, o, l, x); } xs(o, l); } }, r.attemptSynchronousHydration = function(o) { switch (o.tag) { case 3: var l = o.stateNode; if (l.current.memoizedState.isDehydrated) { var h = Vr(l.pendingLanes); h !== 0 && (sf(l, h | 1), vr(l, gr()), !(Wt & 6) && (hs(), ii())); } break; case 13: ji(function() { var x = li(o, 1); if (x !== null) { var C = Pr(); Ra(x, o, 1, C); } }), xs(o, 1); } }, r.batchedUpdates = function(o, l) { var h = Wt; Wt |= 1; try { return o(l); } finally { Wt = h, Wt === 0 && (hs(), sc && ii()); } }, r.createComponentSelector = function(o) { return { $$typeof: Ye, value: o }; }, r.createContainer = function(o, l, h, x, C, j, N) { return $h(o, l, !1, null, h, x, C, j, N); }, r.createHasPseudoClassSelector = function(o) { return { $$typeof: Ma, value: o }; }, r.createHydrationContainer = function(o, l, h, x, C, j, N, V, ue) { return o = $h(h, x, !0, o, C, j, N, V, ue), o.context = Qh(null), h = o.current, x = Pr(), C = Nr(h), j = bi(x, C), j.callback = l ?? null, mo(h, j, C), o.current.lanes = C, yi(o, C, x), vr(o, x), o; }, r.createPortal = function(o, l, h) { var x = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null; return { $$typeof: g, key: x == null ? null : "" + x, children: o, containerInfo: l, implementation: h }; }, r.createRoleSelector = function(o) { return { $$typeof: ha, value: o }; }, r.createTestNameSelector = function(o) { return { $$typeof: Hc, value: o }; }, r.createTextSelector = function(o) { return { $$typeof: Vc, value: o }; }, r.deferredUpdates = function(o) { var l = sn, h = _n.transition; try { return _n.transition = null, sn = 16, o(); } finally { sn = l, _n.transition = h; } }, r.discreteUpdates = function(o, l, h, x, C) { var j = sn, N = _n.transition; try { return _n.transition = null, sn = 1, o(l, h, x, C); } finally { sn = j, _n.transition = N, Wt === 0 && hs(); } }, r.findAllNodes = Bf, r.findBoundingRects = function(o, l) { if (!Q) throw Error(f(363)); l = Bf(o, l), o = []; for (var h = 0; h < l.length; h++) o.push(Fe(l[h])); for (l = o.length - 1; 0 < l; l--) { h = o[l]; for (var x = h.x, C = x + h.width, j = h.y, N = j + h.height, V = l - 1; 0 <= V; V--) if (l !== V) { var ue = o[V], Oe = ue.x, ut = Oe + ue.width, xt = ue.y, Ke = xt + ue.height; if (x >= Oe && j >= xt && C <= ut && N <= Ke) { o.splice(l, 1); break; } else if (x !== Oe || h.width !== ue.width || Ke < j || xt > N) { if (!(j !== xt || h.height !== ue.height || ut < x || Oe > C)) { Oe > x && (ue.width += Oe - x, ue.x = x), ut < C && (ue.width = C - Oe), o.splice(l, 1); break; } } else { xt > j && (ue.height += xt - j, ue.y = j), Ke < N && (ue.height = N - xt), o.splice(l, 1); break; } } } return o; }, r.findHostInstance = Zh, r.findHostInstanceWithNoPortals = function(o) { return o = Y(o), o = o !== null ? fe(o) : null, o === null ? null : o.stateNode; }, r.findHostInstanceWithWarning = function(o) { return Zh(o); }, r.flushControlled = function(o) { var l = Wt; Wt |= 1; var h = _n.transition, x = sn; try { _n.transition = null, sn = 1, o(); } finally { sn = x, _n.transition = h, Wt = l, Wt === 0 && (hs(), ii()); } }, r.flushPassiveEffects = Pa, r.flushSync = ji, r.focusWithin = function(o, l) { if (!Q) throw Error(f(363)); for (o = Ff(o), l = Wh(o, l), l = Array.from(l), o = 0; o < l.length; ) { var h = l[o++]; if (!he(h)) { if (h.tag === 5 && Dt(h.stateNode)) return !0; for (h = h.child; h !== null; ) l.push(h), h = h.sibling; } } return !1; }, r.getCurrentUpdatePriority = function() { return sn; }, r.getFindAllNodesFailureDescription = function(o, l) { if (!Q) throw Error(f(363)); var h = 0, x = []; o = [Ff(o), 0]; for (var C = 0; C < o.length; ) { var j = o[C++], N = o[C++], V = l[N]; if ((j.tag !== 5 || !he(j)) && (Lf(j, V) && (x.push(rr(V)), N++, N > h && (h = N)), N < l.length)) for (j = j.child; j !== null; ) o.push(j, N), j = j.sibling; } if (h < l.length) { for (o = []; h < l.length; h++) o.push(rr(l[h])); return `findAllNodes was able to match part of the selector: ` + (x.join(" > ") + ` No matching component was found for: `) + o.join(" > "); } return null; }, r.getPublicRootInstance = function(o) { if (o = o.current, !o.child) return null; switch (o.child.tag) { case 5: return Me(o.child.stateNode); default: return o.child.stateNode; } }, r.injectIntoDevTools = function(o) { if (o = { bundleType: o.bundleType, version: o.version, rendererPackageName: o.rendererPackageName, rendererConfig: o.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setErrorHandler: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: m.ReactCurrentDispatcher, findHostInstanceByFiber: fy, findFiberByHostInstance: o.findFiberByHostInstance || Jh, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, reconcilerVersion: "18.2.0" }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u") o = !1; else { var l = __REACT_DEVTOOLS_GLOBAL_HOOK__; if (l.isDisabled || !l.supportsFiber) o = !0; else { try { oc = l.inject(o), xi = l; } catch { } o = !!l.checkDCE; } } return o; }, r.isAlreadyRendering = function() { return !1; }, r.observeVisibleRects = function(o, l, h, x) { if (!Q) throw Error(f(363)); o = Bf(o, l); var C = Ht(o, h, x).disconnect; return { disconnect: function() { C(); } }; }, r.registerMutableSourceForHydration = function(o, l) { var h = l._getVersion; h = h(l._source), o.mutableSourceEagerHydrationData == null ? o.mutableSourceEagerHydrationData = [l, h] : o.mutableSourceEagerHydrationData.push(l, h); }, r.runWithPriority = function(o, l) { var h = sn; try { return sn = o, l(); } finally { sn = h; } }, r.shouldError = function() { return null; }, r.shouldSuspend = function() { return !1; }, r.updateContainer = function(o, l, h, x) { var C = l.current, j = Pr(), N = Nr(C); return h = Qh(h), l.context === null ? l.context = h : l.pendingContext = h, l = bi(j, N), l.payload = { element: o }, x = x === void 0 ? null : x, x !== null && (l.callback = x), o = mo(C, l, N), o !== null && (Ra(o, C, N, j), hc(o, C, N)), N; }, r; }), iS; } var ug = {}, gW = { get exports() { return ug; }, set exports(e) { ug = e; } }; /** * @license React * react-reconciler.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 WT; function yW() { return WT || (WT = 1, process.env.NODE_ENV !== "production" && (gW.exports = function(t) { var r = {}, i = jt, s = Lu, c = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, f = !1; function m(n) { f = n; } function y(n) { if (!f) { for (var a = arguments.length, d = new Array(a > 1 ? a - 1 : 0), p = 1; p < a; p++) d[p - 1] = arguments[p]; S("warn", n, d); } } function g(n) { if (!f) { for (var a = arguments.length, d = new Array(a > 1 ? a - 1 : 0), p = 1; p < a; p++) d[p - 1] = arguments[p]; S("error", n, d); } } function S(n, a, d) { { var p = c.ReactDebugCurrentFrame, v = p.getStackAddendum(); v !== "" && (a += "%s", d = d.concat([v])); var b = d.map(function(T) { return String(T); }); b.unshift("Warning: " + a), Function.prototype.apply.call(console[n], console, b); } } var E = Object.assign; function w(n) { return n._reactInternals; } function D(n, a) { n._reactInternals = a; } var M = !1, k = !1, R = !1, O = !1, I = !1, A = !0, L = !0, H = !0, q = 0, U = 1, $ = 2, ae = 3, oe = 4, Y = 5, ve = 6, de = 7, fe = 8, _e = 9, Me = 10, te = 11, K = 12, se = 13, B = 14, re = 15, ke = 16, De = 17, Se = 18, be = 19, Ie = 21, Ue = 22, tt = 23, ht = 24, dt = 25, Le = Symbol.for("react.element"), yt = Symbol.for("react.portal"), Ot = Symbol.for("react.fragment"), Qe = Symbol.for("react.strict_mode"), rn = Symbol.for("react.profiler"), Tn = Symbol.for("react.provider"), pn = Symbol.for("react.context"), Wn = Symbol.for("react.forward_ref"), tr = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"), He = Symbol.for("react.memo"), Fe = Symbol.for("react.lazy"), at = Symbol.for("react.scope"), he = Symbol.for("react.debug_trace_mode"), Ae = Symbol.for("react.offscreen"), Dt = Symbol.for("react.legacy_hidden"), Ht = Symbol.for("react.cache"), Te = Symbol.for("react.tracing_marker"), _t = Symbol.iterator, Zt = "@@iterator"; function Re(n) { if (n === null || typeof n != "object") return null; var a = _t && n[_t] || n[Zt]; return typeof a == "function" ? a : null; } function pe(n, a, d) { var p = n.displayName; if (p) return p; var v = a.displayName || a.name || ""; return v !== "" ? d + "(" + v + ")" : d; } function Ne(n) { return n.displayName || "Context"; } function ft(n) { if (n == null) return null; if (typeof n.tag == "number" && g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof n == "function") return n.displayName || n.name || null; if (typeof n == "string") return n; switch (n) { case Ot: return "Fragment"; case yt: return "Portal"; case rn: return "Profiler"; case Qe: return "StrictMode"; case tr: return "Suspense"; case Q: return "SuspenseList"; } if (typeof n == "object") switch (n.$$typeof) { case pn: var a = n; return Ne(a) + ".Consumer"; case Tn: var d = n; return Ne(d._context) + ".Provider"; case Wn: return pe(n, n.render, "ForwardRef"); case He: var p = n.displayName || null; return p !== null ? p : ft(n.type) || "Memo"; case Fe: { var v = n, b = v._payload, T = v._init; try { return ft(T(b)); } catch { return null; } } } return null; } function Vt(n, a, d) { var p = a.displayName || a.name || ""; return n.displayName || (p !== "" ? d + "(" + p + ")" : d); } function vn(n) { return n.displayName || "Context"; } function st(n) { var a = n.tag, d = n.type; switch (a) { case ht: return "Cache"; case _e: var p = d; return vn(p) + ".Consumer"; case Me: var v = d; return vn(v._context) + ".Provider"; case Se: return "DehydratedFragment"; case te: return Vt(d, d.render, "ForwardRef"); case de: return "Fragment"; case Y: return d; case oe: return "Portal"; case ae: return "Root"; case ve: return "Text"; case ke: return ft(d); case fe: return d === Qe ? "StrictMode" : "Mode"; case Ue: return "Offscreen"; case K: return "Profiler"; case Ie: return "Scope"; case se: return "Suspense"; case be: return "SuspenseList"; case dt: return "TracingMarker"; case U: case q: case De: case $: case B: case re: if (typeof d == "function") return d.displayName || d.name || null; if (typeof d == "string") return d; break; } return null; } var rt = ( /* */ 0 ), kn = ( /* */ 1 ), bn = ( /* */ 2 ), Ft = ( /* */ 4 ), sa = ( /* */ 16 ), Wl = ( /* */ 32 ), Zu = ( /* */ 64 ), tn = ( /* */ 128 ), Oi = ( /* */ 256 ), gi = ( /* */ 512 ), fo = ( /* */ 1024 ), Va = ( /* */ 2048 ), Ai = ( /* */ 4096 ), Zo = ( /* */ 8192 ), Ju = ( /* */ 16384 ), fh = Va | Ft | Zu | gi | fo | Ju, Xd = ( /* */ 32767 ), Gl = ( /* */ 32768 ), Kr = ( /* */ 65536 ), Ls = ( /* */ 131072 ), ph = ( /* */ 1048576 ), $d = ( /* */ 2097152 ), Jo = ( /* */ 4194304 ), Qd = ( /* */ 8388608 ), zi = ( /* */ 16777216 ), ec = ( /* */ 33554432 ), Zd = ( // TODO: Remove Update flag from before mutation phase by re-landing Visibility // flag logic (see #20043) Ft | fo | 0 ), ql = bn | Ft | sa | Wl | gi | Ai | Zo, Yl = Ft | Zu | gi | Zo, Bs = Va | sa, Ii = Jo | Qd | $d, Wg = c.ReactCurrentOwner; function tc(n) { var a = n, d = n; if (n.alternate) for (; a.return; ) a = a.return; else { var p = a; do a = p, (a.flags & (bn | Ai)) !== rt && (d = a.return), p = a.return; while (p); } return a.tag === ae ? d : null; } function Gg(n) { return tc(n) === n; } function Jd(n) { { var a = Wg.current; if (a !== null && a.tag === U) { var d = a, p = d.stateNode; p._warnedAboutRefsInRender || g("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.", st(d) || "A component"), p._warnedAboutRefsInRender = !0; } } var v = w(n); return v ? tc(v) === v : !1; } function Us(n) { if (tc(n) !== n) throw new Error("Unable to find node on an unmounted component."); } function nc(n) { var a = n.alternate; if (!a) { var d = tc(n); if (d === null) throw new Error("Unable to find node on an unmounted component."); return d !== n ? null : n; } for (var p = n, v = a; ; ) { var b = p.return; if (b === null) break; var T = b.alternate; if (T === null) { var _ = b.return; if (_ !== null) { p = v = _; continue; } break; } if (b.child === T.child) { for (var P = b.child; P; ) { if (P === p) return Us(b), n; if (P === v) return Us(b), a; P = P.sibling; } throw new Error("Unable to find node on an unmounted component."); } if (p.return !== v.return) p = b, v = T; else { for (var z = !1, F = b.child; F; ) { if (F === p) { z = !0, p = b, v = T; break; } if (F === v) { z = !0, v = b, p = T; break; } F = F.sibling; } if (!z) { for (F = T.child; F; ) { if (F === p) { z = !0, p = T, v = b; break; } if (F === v) { z = !0, v = T, p = b; break; } F = F.sibling; } if (!z) throw new Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."); } } if (p.alternate !== v) throw new Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."); } if (p.tag !== ae) throw new Error("Unable to find node on an unmounted component."); return p.stateNode.current === p ? n : a; } function Kl(n) { var a = nc(n); return a !== null ? hh(a) : null; } function hh(n) { if (n.tag === Y || n.tag === ve) return n; for (var a = n.child; a !== null; ) { var d = hh(a); if (d !== null) return d; a = a.sibling; } return null; } function ef(n) { var a = nc(n); return a !== null ? es(a) : null; } function es(n) { if (n.tag === Y || n.tag === ve) return n; for (var a = n.child; a !== null; ) { if (a.tag !== oe) { var d = es(a); if (d !== null) return d; } a = a.sibling; } return null; } var po = Array.isArray; function Gt(n) { return po(n); } var mn = t.getPublicInstance, ho = t.getRootHostContext, Br = t.getChildHostContext, la = t.prepareForCommit, ts = t.resetAfterCommit, Hs = t.createInstance, Ur = t.appendInitialChild, Xl = t.finalizeInitialChildren, tf = t.prepareUpdate, rc = t.shouldSetTextContent, $l = t.createTextInstance, nf = t.scheduleTimeout, ri = t.cancelTimeout, rf = t.noTimeout, ac = t.isPrimaryRenderer, qg = t.warnsIfNotActing, Hr = t.supportsMutation, ns = t.supportsPersistence, Vr = t.supportsHydration, ic = t.getInstanceFromNode; t.beforeActiveInstanceBlur, t.afterActiveInstanceBlur; var Yg = t.preparePortalMount; t.prepareScopeUpdate, t.getInstanceFromScope; var Kg = t.getCurrentEventPriority, af = t.detachDeletedInstance, vh = t.supportsMicrotasks, of = t.scheduleMicrotask, yi = t.supportsTestSelectors, Xg = t.findFiberRoot, sf = t.getBoundingRect, sn = t.getTextContent, Vs = t.isHiddenSubtree, lf = t.matchAccessibilityRole, mh = t.setFocusIfFocusable, $g = t.setupIntersectionObserver, Qg = t.appendChild, gr = t.appendChildToContainer, uf = t.commitTextUpdate, Zg = t.commitMount, cf = t.commitUpdate, Jg = t.insertBefore, oc = t.insertInContainerBefore, xi = t.removeChild, ey = t.removeChildFromContainer, gh = t.resetTextContent, ai = t.hideInstance, Fi = t.hideTextInstance, sc = t.unhideInstance, df = t.unhideTextInstance, yh = t.clearContainer, ty = t.cloneInstance, ii = t.createContainerChildSet, rs = t.appendChildToContainerChildSet, Ws = t.finalizeContainerChildren, Gs = t.replaceContainerChildren, Ql = t.cloneHiddenInstance, ja = t.cloneHiddenTextInstance, Wa = t.canHydrateInstance, as = t.canHydrateTextInstance, Li = t.canHydrateSuspenseInstance, Si = t.isSuspenseInstancePending, Bi = t.isSuspenseInstanceFallback, xh = t.getSuspenseInstanceFallbackErrorDetails, ff = t.registerSuspenseInstanceRetry, qs = t.getNextHydratableSibling, Ta = t.getFirstHydratableChild, Ga = t.getFirstHydratableChildWithinContainer, In = t.getFirstHydratableChildWithinSuspenseInstance, Zl = t.hydrateInstance, oi = t.hydrateTextInstance, Sh = t.hydrateSuspenseInstance, bh = t.getNextHydratableInstanceAfterSuspenseInstance, pf = t.commitHydratedContainer, hf = t.commitHydratedSuspenseInstance, Ch = t.clearSuspenseBoundary, lc = t.clearSuspenseBoundaryFromContainer, Eh = t.shouldDeleteUnhydratedTailInstances, Ys = t.didNotMatchHydratedContainerTextInstance, vf = t.didNotMatchHydratedTextInstance, ny = t.didNotHydrateInstanceWithinContainer, uc = t.didNotHydrateInstanceWithinSuspenseInstance, ry = t.didNotHydrateInstance, si = t.didNotFindHydratableInstanceWithinContainer, cc = t.didNotFindHydratableTextInstanceWithinContainer, dc = t.didNotFindHydratableSuspenseInstanceWithinContainer, Ks = t.didNotFindHydratableInstanceWithinSuspenseInstance, mf = t.didNotFindHydratableTextInstanceWithinSuspenseInstance, gf = t.didNotFindHydratableSuspenseInstanceWithinSuspenseInstance, wh = t.didNotFindHydratableInstance, yf = t.didNotFindHydratableTextInstance, xf = t.didNotFindHydratableSuspenseInstance, Xs = t.errorHydratingContainer, Wr = 0, vo, fc, Sf, li, Ui, pc, bf; function bi() { } bi.__reactDisabledLog = !0; function mo() { { if (Wr === 0) { vo = console.log, fc = console.info, Sf = console.warn, li = console.error, Ui = console.group, pc = console.groupCollapsed, bf = console.groupEnd; var n = { configurable: !0, enumerable: !0, value: bi, writable: !0 }; Object.defineProperties(console, { info: n, log: n, warn: n, error: n, group: n, groupCollapsed: n, groupEnd: n }); } Wr++; } } function hc() { { if (Wr--, Wr === 0) { var n = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: E({}, n, { value: vo }), info: E({}, n, { value: fc }), warn: E({}, n, { value: Sf }), error: E({}, n, { value: li }), group: E({}, n, { value: Ui }), groupCollapsed: E({}, n, { value: pc }), groupEnd: E({}, n, { value: bf }) }); } Wr < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var vc = c.ReactCurrentDispatcher, $s; function Hi(n, a, d) { { if ($s === void 0) try { throw Error(); } catch (v) { var p = v.stack.trim().match(/\n( *(at )?)/); $s = p && p[1] || ""; } return ` ` + $s + n; } } var mc = !1, Qs; { var gc = typeof WeakMap == "function" ? WeakMap : Map; Qs = new gc(); } function yc(n, a) { if (!n || mc) return ""; { var d = Qs.get(n); if (d !== void 0) return d; } var p; mc = !0; var v = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var b; b = vc.current, vc.current = null, mo(); try { if (a) { var T = function() { throw Error(); }; if (Object.defineProperty(T.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(T, []); } catch (je) { p = je; } Reflect.construct(n, [], T); } else { try { T.call(); } catch (je) { p = je; } n.call(T.prototype); } } else { try { throw Error(); } catch (je) { p = je; } n(); } } catch (je) { if (je && p && typeof je.stack == "string") { for (var _ = je.stack.split(` `), P = p.stack.split(` `), z = _.length - 1, F = P.length - 1; z >= 1 && F >= 0 && _[z] !== P[F]; ) F--; for (; z >= 1 && F >= 0; z--, F--) if (_[z] !== P[F]) { if (z !== 1 || F !== 1) do if (z--, F--, F < 0 || _[z] !== P[F]) { var X = ` ` + _[z].replace(" at new ", " at "); return n.displayName && X.includes("") && (X = X.replace("", n.displayName)), typeof n == "function" && Qs.set(n, X), X; } while (z >= 1 && F >= 0); break; } } } finally { mc = !1, vc.current = b, hc(), Error.prepareStackTrace = v; } var le = n ? n.displayName || n.name : "", ye = le ? Hi(le) : ""; return typeof n == "function" && Qs.set(n, ye), ye; } function jh(n, a, d) { return yc(n, !0); } function xc(n, a, d) { return yc(n, !1); } function Cf(n) { var a = n.prototype; return !!(a && a.isReactComponent); } function is(n, a, d) { if (n == null) return ""; if (typeof n == "function") return yc(n, Cf(n)); if (typeof n == "string") return Hi(n); switch (n) { case tr: return Hi("Suspense"); case Q: return Hi("SuspenseList"); } if (typeof n == "object") switch (n.$$typeof) { case Wn: return xc(n.render); case He: return is(n.type, a, d); case Fe: { var p = n, v = p._payload, b = p._init; try { return is(b(v), a, d); } catch { } } } return ""; } var Jl = Object.prototype.hasOwnProperty, Ef = {}, wf = c.ReactDebugCurrentFrame; function Vi(n) { if (n) { var a = n._owner, d = is(n.type, n._source, a ? a.type : null); wf.setExtraStackFrame(d); } else wf.setExtraStackFrame(null); } function qa(n, a, d, p, v) { { var b = Function.call.bind(Jl); for (var T in n) if (b(n, T)) { var _ = void 0; try { if (typeof n[T] != "function") { var P = Error((p || "React class") + ": " + d + " type `" + T + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[T] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw P.name = "Invariant Violation", P; } _ = n[T](a, T, p, d, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (z) { _ = z; } _ && !(_ instanceof Error) && (Vi(v), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", d, T, typeof _), Vi(null)), _ instanceof Error && !(_.message in Ef) && (Ef[_.message] = !0, Vi(v), g("Failed %s type: %s", d, _.message), Vi(null)); } } } var os = [], Xr; Xr = []; var Da = -1; function _a(n) { return { current: n }; } function Rn(n, a) { if (Da < 0) { g("Unexpected pop."); return; } a !== Xr[Da] && g("Unexpected Fiber popped."), n.current = os[Da], os[Da] = null, Xr[Da] = null, Da--; } function cr(n, a, d) { Da++, os[Da] = n.current, Xr[Da] = d, n.current = a; } var go; go = {}; var ua = {}; Object.freeze(ua); var ui = _a(ua), ln = _a(!1), Zs = ua; function yo(n, a, d) { return d && Gr(a) ? Zs : ui.current; } function Sc(n, a, d) { { var p = n.stateNode; p.__reactInternalMemoizedUnmaskedChildContext = a, p.__reactInternalMemoizedMaskedChildContext = d; } } function Wi(n, a) { { var d = n.type, p = d.contextTypes; if (!p) return ua; var v = n.stateNode; if (v && v.__reactInternalMemoizedUnmaskedChildContext === a) return v.__reactInternalMemoizedMaskedChildContext; var b = {}; for (var T in p) b[T] = a[T]; { var _ = st(n) || "Unknown"; qa(p, b, "context", _); } return v && Sc(n, a, b), b; } } function Js() { return ln.current; } function Gr(n) { { var a = n.childContextTypes; return a != null; } } function Dn(n) { Rn(ln, n), Rn(ui, n); } function Kn(n) { Rn(ln, n), Rn(ui, n); } function dr(n, a, d) { { if (ui.current !== ua) throw new Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue."); cr(ui, a, n), cr(ln, d, n); } } function eu(n, a, d) { { var p = n.stateNode, v = a.childContextTypes; if (typeof p.getChildContext != "function") { { var b = st(n) || "Unknown"; go[b] || (go[b] = !0, g("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", b, b)); } return d; } var T = p.getChildContext(); for (var _ in T) if (!(_ in v)) throw new Error((st(n) || "Unknown") + '.getChildContext(): key "' + _ + '" is not defined in childContextTypes.'); { var P = st(n) || "Unknown"; qa(v, T, "child context", P); } return E({}, d, T); } } function xo(n) { { var a = n.stateNode, d = a && a.__reactInternalMemoizedMergedChildContext || ua; return Zs = ui.current, cr(ui, d, n), cr(ln, ln.current, n), !0; } } function el(n, a, d) { { var p = n.stateNode; if (!p) throw new Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue."); if (d) { var v = eu(n, a, Zs); p.__reactInternalMemoizedMergedChildContext = v, Rn(ln, n), Rn(ui, n), cr(ui, v, n), cr(ln, d, n); } else Rn(ln, n), cr(ln, d, n); } } function ay(n) { { if (!Gg(n) || n.tag !== U) throw new Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue."); var a = n; do { switch (a.tag) { case ae: return a.stateNode.context; case U: { var d = a.type; if (Gr(d)) return a.stateNode.__reactInternalMemoizedMergedChildContext; break; } } a = a.return; } while (a !== null); throw new Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue."); } } var Xn = 0, bc = 1, Ct = ( /* */ 0 ), qt = ( /* */ 1 ), Lt = ( /* */ 2 ), cn = ( /* */ 8 ), ca = ( /* */ 16 ), Cc = Math.clz32 ? Math.clz32 : Dh, jf = Math.log, Th = Math.LN2; function Dh(n) { var a = n >>> 0; return a === 0 ? 32 : 31 - (jf(a) / Th | 0) | 0; } var Ec = 31, we = ( /* */ 0 ), fr = ( /* */ 0 ), Tt = ( /* */ 1 ), ss = ( /* */ 2 ), Ci = ( /* */ 4 ), ci = ( /* */ 8 ), di = ( /* */ 16 ), So = ( /* */ 32 ), Gi = ( /* */ 4194240 ), tl = ( /* */ 64 ), tu = ( /* */ 128 ), wc = ( /* */ 256 ), jc = ( /* */ 512 ), Tc = ( /* */ 1024 ), Dc = ( /* */ 2048 ), nu = ( /* */ 4096 ), _c = ( /* */ 8192 ), Mc = ( /* */ 16384 ), kc = ( /* */ 32768 ), Tf = ( /* */ 65536 ), Rc = ( /* */ 131072 ), Df = ( /* */ 262144 ), _f = ( /* */ 524288 ), Pc = ( /* */ 1048576 ), Nc = ( /* */ 2097152 ), ru = ( /* */ 130023424 ), qi = ( /* */ 4194304 ), Mf = ( /* */ 8388608 ), kf = ( /* */ 16777216 ), Rf = ( /* */ 33554432 ), bo = ( /* */ 67108864 ), Oc = qi, ls = ( /* */ 134217728 ), _h = ( /* */ 268435455 ), nl = ( /* */ 268435456 ), Co = ( /* */ 536870912 ), da = ( /* */ 1073741824 ); function Mh(n) { { if (n & Tt) return "Sync"; if (n & ss) return "InputContinuousHydration"; if (n & Ci) return "InputContinuous"; if (n & ci) return "DefaultHydration"; if (n & di) return "Default"; if (n & So) return "TransitionHydration"; if (n & Gi) return "Transition"; if (n & ru) return "Retry"; if (n & ls) return "SelectiveHydration"; if (n & nl) return "IdleHydration"; if (n & Co) return "Idle"; if (n & da) return "Offscreen"; } } var Cn = -1, Ac = tl, Dr = qi; function pr(n) { switch (Eo(n)) { case Tt: return Tt; case ss: return ss; case Ci: return Ci; case ci: return ci; case di: return di; case So: return So; case tl: case tu: case wc: case jc: case Tc: case Dc: case nu: case _c: case Mc: case kc: case Tf: case Rc: case Df: case _f: case Pc: case Nc: return n & Gi; case qi: case Mf: case kf: case Rf: case bo: return n & ru; case ls: return ls; case nl: return nl; case Co: return Co; case da: return da; default: return g("Should have found matching lanes. This is a bug in React."), n; } } function au(n, a) { var d = n.pendingLanes; if (d === we) return we; var p = we, v = n.suspendedLanes, b = n.pingedLanes, T = d & _h; if (T !== we) { var _ = T & ~v; if (_ !== we) p = pr(_); else { var P = T & b; P !== we && (p = pr(P)); } } else { var z = d & ~v; z !== we ? p = pr(z) : b !== we && (p = pr(b)); } if (p === we) return we; if (a !== we && a !== p && // If we already suspended with a delay, then interrupting is fine. Don't // bother waiting until the root is complete. (a & v) === we) { var F = Eo(p), X = Eo(a); if ( // Tests whether the next lane is equal or lower priority than the wip // one. This works because the bits decrease in priority as you go left. F >= X || // Default priority updates should not interrupt transition updates. The // only difference between default updates and transition updates is that // default updates do not support refresh transitions. F === di && (X & Gi) !== we ) return a; } (p & Ci) !== we && (p |= d & di); var le = n.entangledLanes; if (le !== we) for (var ye = n.entanglements, je = p & le; je > 0; ) { var Ee = wo(je), gt = 1 << Ee; p |= ye[Ee], je &= ~gt; } return p; } function kh(n, a) { for (var d = n.eventTimes, p = Cn; a > 0; ) { var v = wo(a), b = 1 << v, T = d[v]; T > p && (p = T), a &= ~b; } return p; } function Rh(n, a) { switch (n) { case Tt: case ss: case Ci: return a + 250; case ci: case di: case So: case tl: case tu: case wc: case jc: case Tc: case Dc: case nu: case _c: case Mc: case kc: case Tf: case Rc: case Df: case _f: case Pc: case Nc: return a + 5e3; case qi: case Mf: case kf: case Rf: case bo: return Cn; case ls: case nl: case Co: case da: return Cn; default: return g("Should have found matching lanes. This is a bug in React."), Cn; } } function Ph(n, a) { for (var d = n.pendingLanes, p = n.suspendedLanes, v = n.pingedLanes, b = n.expirationTimes, T = d; T > 0; ) { var _ = wo(T), P = 1 << _, z = b[_]; z === Cn ? ((P & p) === we || (P & v) !== we) && (b[_] = Rh(P, a)) : z <= a && (n.expiredLanes |= P), T &= ~P; } } function Nh(n) { return pr(n.pendingLanes); } function iu(n) { var a = n.pendingLanes & ~da; return a !== we ? a : a & da ? da : we; } function Oh(n) { return (n & Tt) !== we; } function ou(n) { return (n & _h) !== we; } function Pf(n) { return (n & ru) === n; } function Ah(n) { var a = Tt | Ci | di; return (n & a) === we; } function Nf(n) { return (n & Gi) === n; } function rl(n, a) { var d = ss | Ci | ci | di; return (a & d) !== we; } function zh(n, a) { return (a & n.expiredLanes) !== we; } function zc(n) { return (n & Gi) !== we; } function su() { var n = Ac; return Ac <<= 1, (Ac & Gi) === we && (Ac = tl), n; } function iy() { var n = Dr; return Dr <<= 1, (Dr & ru) === we && (Dr = qi), n; } function Eo(n) { return n & -n; } function us(n) { return Eo(n); } function wo(n) { return 31 - Cc(n); } function al(n) { return wo(n); } function $n(n, a) { return (n & a) !== we; } function il(n, a) { return (n & a) === a; } function wt(n, a) { return n | a; } function lu(n, a) { return n & ~a; } function ol(n, a) { return n & a; } function Ic(n) { return n; } function Fc(n, a) { return n !== fr && n < a ? n : a; } function sl(n) { for (var a = [], d = 0; d < Ec; d++) a.push(n); return a; } function ll(n, a, d) { n.pendingLanes |= a, a !== Co && (n.suspendedLanes = we, n.pingedLanes = we); var p = n.eventTimes, v = al(a); p[v] = d; } function uu(n, a) { n.suspendedLanes |= a, n.pingedLanes &= ~a; for (var d = n.expirationTimes, p = a; p > 0; ) { var v = wo(p), b = 1 << v; d[v] = Cn, p &= ~b; } } function _r(n, a, d) { n.pingedLanes |= n.suspendedLanes & a; } function oy(n, a) { var d = n.pendingLanes & ~a; n.pendingLanes = a, n.suspendedLanes = we, n.pingedLanes = we, n.expiredLanes &= a, n.mutableReadLanes &= a, n.entangledLanes &= a; for (var p = n.entanglements, v = n.eventTimes, b = n.expirationTimes, T = d; T > 0; ) { var _ = wo(T), P = 1 << _; p[_] = we, v[_] = Cn, b[_] = Cn, T &= ~P; } } function Of(n, a) { for (var d = n.entangledLanes |= a, p = n.entanglements, v = d; v; ) { var b = wo(v), T = 1 << b; // Is this one of the newly entangled lanes? T & a | // Is this lane transitively entangled with the newly entangled lanes? p[b] & a && (p[b] |= a), v &= ~T; } } function Lc(n, a) { var d = Eo(a), p; switch (d) { case Ci: p = ss; break; case di: p = ci; break; case tl: case tu: case wc: case jc: case Tc: case Dc: case nu: case _c: case Mc: case kc: case Tf: case Rc: case Df: case _f: case Pc: case Nc: case qi: case Mf: case kf: case Rf: case bo: p = So; break; case Co: p = nl; break; default: p = fr; break; } return (p & (n.suspendedLanes | a)) !== fr ? fr : p; } function Mr(n, a, d) { if (ha) for (var p = n.pendingUpdatersLaneMap; d > 0; ) { var v = al(d), b = 1 << v, T = p[v]; T.add(a), d &= ~b; } } function Ih(n, a) { if (ha) for (var d = n.pendingUpdatersLaneMap, p = n.memoizedUpdaters; a > 0; ) { var v = al(a), b = 1 << v, T = d[v]; T.size > 0 && (T.forEach(function(_) { var P = _.alternate; (P === null || !p.has(P)) && p.add(_); }), T.clear()), a &= ~b; } } function it(n, a) { return null; } var $r = Tt, cs = Ci, ul = di, Af = Co, Yi = fr; function fa() { return Yi; } function nr(n) { Yi = n; } function Fh(n, a) { var d = Yi; try { return Yi = n, a(); } finally { Yi = d; } } function Lh(n, a) { return n !== 0 && n < a ? n : a; } function Bh(n, a) { return n === 0 || n > a ? n : a; } function Bc(n, a) { return n !== 0 && n < a; } function Uc(n) { var a = Eo(n); return Bc($r, a) ? Bc(cs, a) ? ou(a) ? ul : Af : cs : $r; } var yr = s.unstable_scheduleCallback, fi = s.unstable_cancelCallback, Ei = s.unstable_shouldYield, zf = s.unstable_requestPaint, hr = s.unstable_now, pa = s.unstable_ImmediatePriority, If = s.unstable_UserBlockingPriority, Qr = s.unstable_NormalPriority, Uh = s.unstable_IdlePriority, Hh = s.unstable_yieldValue, Vh = s.unstable_setDisableYieldValue, ds = null, kr = null, Ye = null, Ma = !1, ha = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u"; function Hc(n) { if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u") return !1; var a = __REACT_DEVTOOLS_GLOBAL_HOOK__; if (a.isDisabled) return !0; if (!a.supportsFiber) return g("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools"), !0; try { A && (n = E({}, n, { getLaneLabelMap: Bf, injectProfilingHooks: Wh })), ds = a.inject(n), kr = a; } catch (d) { g("React instrumentation encountered an error: %s.", d); } return !!a.checkDCE; } function Vc(n, a) { if (kr && typeof kr.onScheduleFiberRoot == "function") try { kr.onScheduleFiberRoot(ds, n, a); } catch (d) { Ma || (Ma = !0, g("React instrumentation encountered an error: %s", d)); } } function cu(n, a) { if (kr && typeof kr.onCommitFiberRoot == "function") try { var d = (n.current.flags & tn) === tn; if (L) { var p; switch (a) { case $r: p = pa; break; case cs: p = If; break; case ul: p = Qr; break; case Af: p = Uh; break; default: p = Qr; break; } kr.onCommitFiberRoot(ds, n, p, d); } } catch (v) { Ma || (Ma = !0, g("React instrumentation encountered an error: %s", v)); } } function Ff(n) { if (kr && typeof kr.onPostCommitFiberRoot == "function") try { kr.onPostCommitFiberRoot(ds, n); } catch (a) { Ma || (Ma = !0, g("React instrumentation encountered an error: %s", a)); } } function Lf(n) { if (kr && typeof kr.onCommitFiberUnmount == "function") try { kr.onCommitFiberUnmount(ds, n); } catch (a) { Ma || (Ma = !0, g("React instrumentation encountered an error: %s", a)); } } function rr(n) { if (typeof Hh == "function" && (Vh(n), m(n)), kr && typeof kr.setStrictMode == "function") try { kr.setStrictMode(ds, n); } catch (a) { Ma || (Ma = !0, g("React instrumentation encountered an error: %s", a)); } } function Wh(n) { Ye = n; } function Bf() { { for (var n = /* @__PURE__ */ new Map(), a = 1, d = 0; d < Ec; d++) { var p = Mh(a); n.set(a, p), a *= 2; } return n; } } function sy(n) { Ye !== null && typeof Ye.markCommitStarted == "function" && Ye.markCommitStarted(n); } function du() { Ye !== null && typeof Ye.markCommitStopped == "function" && Ye.markCommitStopped(); } function fs(n) { Ye !== null && typeof Ye.markComponentRenderStarted == "function" && Ye.markComponentRenderStarted(n); } function _n() { Ye !== null && typeof Ye.markComponentRenderStopped == "function" && Ye.markComponentRenderStopped(); } function Wt(n) { Ye !== null && typeof Ye.markComponentPassiveEffectMountStarted == "function" && Ye.markComponentPassiveEffectMountStarted(n); } function xr() { Ye !== null && typeof Ye.markComponentPassiveEffectMountStopped == "function" && Ye.markComponentPassiveEffectMountStopped(); } function ar(n) { Ye !== null && typeof Ye.markComponentPassiveEffectUnmountStarted == "function" && Ye.markComponentPassiveEffectUnmountStarted(n); } function Rr() { Ye !== null && typeof Ye.markComponentPassiveEffectUnmountStopped == "function" && Ye.markComponentPassiveEffectUnmountStopped(); } function ka(n) { Ye !== null && typeof Ye.markComponentLayoutEffectMountStarted == "function" && Ye.markComponentLayoutEffectMountStarted(n); } function cl() { Ye !== null && typeof Ye.markComponentLayoutEffectMountStopped == "function" && Ye.markComponentLayoutEffectMountStopped(); } function ir(n) { Ye !== null && typeof Ye.markComponentLayoutEffectUnmountStarted == "function" && Ye.markComponentLayoutEffectUnmountStarted(n); } function dl() { Ye !== null && typeof Ye.markComponentLayoutEffectUnmountStopped == "function" && Ye.markComponentLayoutEffectUnmountStopped(); } function ps(n, a, d) { Ye !== null && typeof Ye.markComponentErrored == "function" && Ye.markComponentErrored(n, a, d); } function Wc(n, a, d) { Ye !== null && typeof Ye.markComponentSuspended == "function" && Ye.markComponentSuspended(n, a, d); } function Uf(n) { Ye !== null && typeof Ye.markLayoutEffectsStarted == "function" && Ye.markLayoutEffectsStarted(n); } function fu() { Ye !== null && typeof Ye.markLayoutEffectsStopped == "function" && Ye.markLayoutEffectsStopped(); } function va(n) { Ye !== null && typeof Ye.markPassiveEffectsStarted == "function" && Ye.markPassiveEffectsStarted(n); } function Hf() { Ye !== null && typeof Ye.markPassiveEffectsStopped == "function" && Ye.markPassiveEffectsStopped(); } function Gc(n) { Ye !== null && typeof Ye.markRenderStarted == "function" && Ye.markRenderStarted(n); } function Ki() { Ye !== null && typeof Ye.markRenderYielded == "function" && Ye.markRenderYielded(); } function hs() { Ye !== null && typeof Ye.markRenderStopped == "function" && Ye.markRenderStopped(); } function qc(n) { Ye !== null && typeof Ye.markRenderScheduled == "function" && Ye.markRenderScheduled(n); } function Vf(n, a) { Ye !== null && typeof Ye.markForceUpdateScheduled == "function" && Ye.markForceUpdateScheduled(n, a); } function wi(n, a) { Ye !== null && typeof Ye.markStateUpdateScheduled == "function" && Ye.markStateUpdateScheduled(n, a); } function Yc(n, a) { return n === a && (n !== 0 || 1 / n === 1 / a) || n !== n && a !== a; } var or = typeof Object.is == "function" ? Object.is : Yc, Ya = null, vs = !1, pu = !1; function hu(n) { Ya === null ? Ya = [n] : Ya.push(n); } function Kc(n) { vs = !0, hu(n); } function Pr() { vs && Nr(); } function Nr() { if (!pu && Ya !== null) { pu = !0; var n = 0, a = fa(); try { var d = !0, p = Ya; for (nr($r); n < p.length; n++) { var v = p[n]; do v = v(d); while (v !== null); } Ya = null, vs = !1; } catch (b) { throw Ya !== null && (Ya = Ya.slice(n + 1)), yr(pa, Nr), b; } finally { nr(a), pu = !1; } } return null; } function Ra(n) { var a = n.current.memoizedState; return a.isDehydrated; } var vr = [], ms = 0, fl = null, pl = 0, Ka = [], mr = 0, jo = null, ji = 1, pi = ""; function gs(n) { return Pa(), (n.flags & ph) !== rt; } function Gh(n) { return Pa(), pl; } function qh() { var n = pi, a = ji, d = a & ~Yh(a); return d.toString(32) + n; } function Xi(n, a) { Pa(), vr[ms++] = pl, vr[ms++] = fl, fl = n, pl = a; } function vu(n, a, d) { Pa(), Ka[mr++] = ji, Ka[mr++] = pi, Ka[mr++] = jo, jo = n; var p = ji, v = pi, b = Xc(p) - 1, T = p & ~(1 << b), _ = d + 1, P = Xc(a) + b; if (P > 30) { var z = b - b % 5, F = (1 << z) - 1, X = (T & F).toString(32), le = T >> z, ye = b - z, je = Xc(a) + ye, Ee = _ << ye, gt = Ee | le, Mt = X + v; ji = 1 << je | gt, pi = Mt; } else { var bt = _ << b, xn = bt | T, nn = v; ji = 1 << P | xn, pi = nn; } } function Wf(n) { Pa(); var a = n.return; if (a !== null) { var d = 1, p = 0; Xi(n, d), vu(n, d, p); } } function Xc(n) { return 32 - Cc(n); } function Yh(n) { return 1 << Xc(n) - 1; } function $c(n) { for (; n === fl; ) fl = vr[--ms], vr[ms] = null, pl = vr[--ms], vr[ms] = null; for (; n === jo; ) jo = Ka[--mr], Ka[mr] = null, pi = Ka[--mr], Ka[mr] = null, ji = Ka[--mr], Ka[mr] = null; } function ys() { return Pa(), jo !== null ? { id: ji, overflow: pi } : null; } function ly(n, a) { Pa(), Ka[mr++] = ji, Ka[mr++] = pi, Ka[mr++] = jo, ji = a.id, pi = a.overflow, jo = n; } function Pa() { h() || g("Expected to be hydrating. This is a bug in React. Please file an issue."); } var Sr = null, Jt = null, hi = !1, $i = !1, To = null; function uy() { hi && g("We should not be hydrating here. This is a bug in React. Please file a bug."); } function Gf() { $i = !0; } function Kh() { return $i; } function cy(n) { if (!Vr) return !1; var a = n.stateNode.containerInfo; return Jt = Ga(a), Sr = n, hi = !0, To = null, $i = !1, !0; } function Xa(n, a, d) { return Vr ? (Jt = In(a), Sr = n, hi = !0, To = null, $i = !1, d !== null && ly(n, d), !0) : !1; } function Qc(n, a) { switch (n.tag) { case ae: { ny(n.stateNode.containerInfo, a); break; } case Y: { var d = (n.mode & qt) !== Ct; ry( n.type, n.memoizedProps, n.stateNode, a, // TODO: Delete this argument when we remove the legacy root API. d ); break; } case se: { var p = n.memoizedState; p.dehydrated !== null && uc(p.dehydrated, a); break; } } } function Xh(n, a) { Qc(n, a); var d = sO(); d.stateNode = a, d.return = n; var p = n.deletions; p === null ? (n.deletions = [d], n.flags |= sa) : p.push(d); } function Ti(n, a) { { if ($i) return; switch (n.tag) { case ae: { var d = n.stateNode.containerInfo; switch (a.tag) { case Y: var p = a.type, v = a.pendingProps; si(d, p, v); break; case ve: var b = a.pendingProps; cc(d, b); break; case se: dc(d); break; } break; } case Y: { var T = n.type, _ = n.memoizedProps, P = n.stateNode; switch (a.tag) { case Y: { var z = a.type, F = a.pendingProps, X = (n.mode & qt) !== Ct; wh( T, _, P, z, F, // TODO: Delete this argument when we remove the legacy root API. X ); break; } case ve: { var le = a.pendingProps, ye = (n.mode & qt) !== Ct; yf( T, _, P, le, // TODO: Delete this argument when we remove the legacy root API. ye ); break; } case se: { xf(T, _, P); break; } } break; } case se: { var je = n.memoizedState, Ee = je.dehydrated; if (Ee !== null) switch (a.tag) { case Y: var gt = a.type, Mt = a.pendingProps; Ks(Ee, gt, Mt); break; case ve: var bt = a.pendingProps; mf(Ee, bt); break; case se: gf(Ee); break; } break; } default: return; } } } function mu(n, a) { a.flags = a.flags & ~Ai | bn, Ti(n, a); } function Do(n, a) { switch (n.tag) { case Y: { var d = n.type, p = n.pendingProps, v = Wa(a, d, p); return v !== null ? (n.stateNode = v, Sr = n, Jt = Ta(v), !0) : !1; } case ve: { var b = n.pendingProps, T = as(a, b); return T !== null ? (n.stateNode = T, Sr = n, Jt = null, !0) : !1; } case se: { var _ = Li(a); if (_ !== null) { var P = { dehydrated: _, treeContext: ys(), retryLane: da }; n.memoizedState = P; var z = lO(_); return z.return = n, n.child = z, Sr = n, Jt = null, !0; } return !1; } default: return !1; } } function hl(n) { return (n.mode & qt) !== Ct && (n.flags & tn) === rt; } function gu(n) { throw new Error("Hydration failed because the initial UI does not match what was rendered on the server."); } function yu(n) { if (hi) { var a = Jt; if (!a) { hl(n) && (Ti(Sr, n), gu()), mu(Sr, n), hi = !1, Sr = n; return; } var d = a; if (!Do(n, a)) { hl(n) && (Ti(Sr, n), gu()), a = qs(d); var p = Sr; if (!a || !Do(n, a)) { mu(Sr, n), hi = !1, Sr = n; return; } Xh(p, d); } } } function dy(n, a, d) { if (!Vr) throw new Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue."); var p = n.stateNode, v = !$i, b = Zl(p, n.type, n.memoizedProps, a, d, n, v); return n.updateQueue = b, b !== null; } function $h(n) { if (!Vr) throw new Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue."); var a = n.stateNode, d = n.memoizedProps, p = !$i, v = oi(a, d, n, p); if (v) { var b = Sr; if (b !== null) switch (b.tag) { case ae: { var T = b.stateNode.containerInfo, _ = (b.mode & qt) !== Ct; Ys( T, a, d, // TODO: Delete this argument when we remove the legacy root API. _ ); break; } case Y: { var P = b.type, z = b.memoizedProps, F = b.stateNode, X = (b.mode & qt) !== Ct; vf( P, z, F, a, d, // TODO: Delete this argument when we remove the legacy root API. X ); break; } } } return v; } function Qh(n) { if (!Vr) throw new Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue."); var a = n.memoizedState, d = a !== null ? a.dehydrated : null; if (!d) throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."); Sh(d, n); } function Zh(n) { if (!Vr) throw new Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue."); var a = n.memoizedState, d = a !== null ? a.dehydrated : null; if (!d) throw new Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue."); return bh(d); } function qf(n) { for (var a = n.return; a !== null && a.tag !== Y && a.tag !== ae && a.tag !== se; ) a = a.return; Sr = a; } function xs(n) { if (!Vr || n !== Sr) return !1; if (!hi) return qf(n), hi = !0, !1; if (n.tag !== ae && (n.tag !== Y || Eh(n.type) && !rc(n.type, n.memoizedProps))) { var a = Jt; if (a) if (hl(n)) Jh(n), gu(); else for (; a; ) Xh(n, a), a = qs(a); } return qf(n), n.tag === se ? Jt = Zh(n) : Jt = Sr ? qs(n.stateNode) : null, !0; } function fy() { return hi && Jt !== null; } function Jh(n) { for (var a = Jt; a; ) Qc(n, a), a = qs(a); } function o() { Vr && (Sr = null, Jt = null, hi = !1, $i = !1); } function l() { To !== null && (PE(To), To = null); } function h() { return hi; } function x(n) { To === null ? To = [n] : To.push(n); } var C = c.ReactCurrentBatchConfig, j = null; function N() { return C.transition; } function V(n, a) { if (or(n, a)) return !0; if (typeof n != "object" || n === null || typeof a != "object" || a === null) return !1; var d = Object.keys(n), p = Object.keys(a); if (d.length !== p.length) return !1; for (var v = 0; v < d.length; v++) { var b = d[v]; if (!Jl.call(a, b) || !or(n[b], a[b])) return !1; } return !0; } function ue(n) { switch (n._debugOwner && n._debugOwner.type, n._debugSource, n.tag) { case Y: return Hi(n.type); case ke: return Hi("Lazy"); case se: return Hi("Suspense"); case be: return Hi("SuspenseList"); case q: case $: case re: return xc(n.type); case te: return xc(n.type.render); case U: return jh(n.type); default: return ""; } } function Oe(n) { try { var a = "", d = n; do a += ue(d), d = d.return; while (d); return a; } catch (p) { return ` Error generating stack: ` + p.message + ` ` + p.stack; } } var ut = c.ReactDebugCurrentFrame, xt = null, Ke = !1; function Pn() { { if (xt === null) return null; var n = xt._debugOwner; if (n !== null && typeof n < "u") return st(n); } return null; } function En() { return xt === null ? "" : Oe(xt); } function gn() { ut.getCurrentStack = null, xt = null, Ke = !1; } function hn(n) { ut.getCurrentStack = n === null ? null : En, xt = n, Ke = !1; } function ie() { return xt; } function G(n) { Ke = n; } var ce = { recordUnsafeLifecycleWarnings: function(n, a) { }, flushPendingUnsafeLifecycleWarnings: function() { }, recordLegacyContextWarning: function(n, a) { }, flushLegacyContextWarning: function() { }, discardPendingWarnings: function() { } }; { var Je = function(n) { for (var a = null, d = n; d !== null; ) d.mode & cn && (a = d), d = d.return; return a; }, mt = function(n) { var a = []; return n.forEach(function(d) { a.push(d); }), a.sort().join(", "); }, At = [], kt = [], $t = [], Gn = [], Qt = [], $a = [], Ss = /* @__PURE__ */ new Set(); ce.recordUnsafeLifecycleWarnings = function(n, a) { Ss.has(n.type) || (typeof a.componentWillMount == "function" && // Don't warn about react-lifecycles-compat polyfilled components. a.componentWillMount.__suppressDeprecationWarning !== !0 && At.push(n), n.mode & cn && typeof a.UNSAFE_componentWillMount == "function" && kt.push(n), typeof a.componentWillReceiveProps == "function" && a.componentWillReceiveProps.__suppressDeprecationWarning !== !0 && $t.push(n), n.mode & cn && typeof a.UNSAFE_componentWillReceiveProps == "function" && Gn.push(n), typeof a.componentWillUpdate == "function" && a.componentWillUpdate.__suppressDeprecationWarning !== !0 && Qt.push(n), n.mode & cn && typeof a.UNSAFE_componentWillUpdate == "function" && $a.push(n)); }, ce.flushPendingUnsafeLifecycleWarnings = function() { var n = /* @__PURE__ */ new Set(); At.length > 0 && (At.forEach(function(le) { n.add(st(le) || "Component"), Ss.add(le.type); }), At = []); var a = /* @__PURE__ */ new Set(); kt.length > 0 && (kt.forEach(function(le) { a.add(st(le) || "Component"), Ss.add(le.type); }), kt = []); var d = /* @__PURE__ */ new Set(); $t.length > 0 && ($t.forEach(function(le) { d.add(st(le) || "Component"), Ss.add(le.type); }), $t = []); var p = /* @__PURE__ */ new Set(); Gn.length > 0 && (Gn.forEach(function(le) { p.add(st(le) || "Component"), Ss.add(le.type); }), Gn = []); var v = /* @__PURE__ */ new Set(); Qt.length > 0 && (Qt.forEach(function(le) { v.add(st(le) || "Component"), Ss.add(le.type); }), Qt = []); var b = /* @__PURE__ */ new Set(); if ($a.length > 0 && ($a.forEach(function(le) { b.add(st(le) || "Component"), Ss.add(le.type); }), $a = []), a.size > 0) { var T = mt(a); g(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move code with side effects to componentDidMount, and set initial state in the constructor. Please update the following components: %s`, T); } if (p.size > 0) { var _ = mt(p); g(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move data fetching code or side effects to componentDidUpdate. * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state Please update the following components: %s`, _); } if (b.size > 0) { var P = mt(b); g(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move data fetching code or side effects to componentDidUpdate. Please update the following components: %s`, P); } if (n.size > 0) { var z = mt(n); y(`componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move code with side effects to componentDidMount, and set initial state in the constructor. * Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. Please update the following components: %s`, z); } if (d.size > 0) { var F = mt(d); y(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move data fetching code or side effects to componentDidUpdate. * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. Please update the following components: %s`, F); } if (v.size > 0) { var X = mt(v); y(`componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move data fetching code or side effects to componentDidUpdate. * Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder. Please update the following components: %s`, X); } }; var ev = /* @__PURE__ */ new Map(), z1 = /* @__PURE__ */ new Set(); ce.recordLegacyContextWarning = function(n, a) { var d = Je(n); if (d === null) { g("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."); return; } if (!z1.has(n.type)) { var p = ev.get(d); (n.type.contextTypes != null || n.type.childContextTypes != null || a !== null && typeof a.getChildContext == "function") && (p === void 0 && (p = [], ev.set(d, p)), p.push(n)); } }, ce.flushLegacyContextWarning = function() { ev.forEach(function(n, a) { if (n.length !== 0) { var d = n[0], p = /* @__PURE__ */ new Set(); n.forEach(function(b) { p.add(st(b) || "Component"), z1.add(b.type); }); var v = mt(p); try { hn(d), g(`Legacy context API has been detected within a strict-mode tree. The old API will be supported in all 16.x releases, but applications using it should migrate to the new version. Please update the following components: %s Learn more about this warning here: https://reactjs.org/link/legacy-context`, v); } finally { gn(); } } }); }, ce.discardPendingWarnings = function() { At = [], kt = [], $t = [], Gn = [], Qt = [], $a = [], ev = /* @__PURE__ */ new Map(); }; } function I1(n) { { var a = typeof Symbol == "function" && Symbol.toStringTag, d = a && n[Symbol.toStringTag] || n.constructor.name || "Object"; return d; } } function F1(n) { try { return py(n), !1; } catch { return !0; } } function py(n) { return "" + n; } function Xk(n) { if (F1(n)) return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", I1(n)), py(n); } function $k(n, a) { if (F1(n)) return g("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", a, I1(n)), py(n); } function Qi(n, a) { if (n && n.defaultProps) { var d = E({}, a), p = n.defaultProps; for (var v in p) d[v] === void 0 && (d[v] = p[v]); return d; } return a; } var tv = _a(null), Yf; Yf = {}; var nv = null, Zc = null, hy = null, rv = !1; function av() { nv = null, Zc = null, hy = null, rv = !1; } function L1() { rv = !0; } function B1() { rv = !1; } function U1(n, a, d) { ac ? (cr(tv, a._currentValue, n), a._currentValue = d, a._currentRenderer !== void 0 && a._currentRenderer !== null && a._currentRenderer !== Yf && g("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."), a._currentRenderer = Yf) : (cr(tv, a._currentValue2, n), a._currentValue2 = d, a._currentRenderer2 !== void 0 && a._currentRenderer2 !== null && a._currentRenderer2 !== Yf && g("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."), a._currentRenderer2 = Yf); } function vy(n, a) { var d = tv.current; Rn(tv, a), ac ? n._currentValue = d : n._currentValue2 = d; } function my(n, a, d) { for (var p = n; p !== null; ) { var v = p.alternate; if (il(p.childLanes, a) ? v !== null && !il(v.childLanes, a) && (v.childLanes = wt(v.childLanes, a)) : (p.childLanes = wt(p.childLanes, a), v !== null && (v.childLanes = wt(v.childLanes, a))), p === d) break; p = p.return; } p !== d && g("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue."); } function Qk(n, a, d) { Zk(n, a, d); } function Zk(n, a, d) { var p = n.child; for (p !== null && (p.return = n); p !== null; ) { var v = void 0, b = p.dependencies; if (b !== null) { v = p.child; for (var T = b.firstContext; T !== null; ) { if (T.context === a) { if (p.tag === U) { var _ = us(d), P = bs(Cn, _); P.tag = ov; var z = p.updateQueue; if (z !== null) { var F = z.shared, X = F.pending; X === null ? P.next = P : (P.next = X.next, X.next = P), F.pending = P; } } p.lanes = wt(p.lanes, d); var le = p.alternate; le !== null && (le.lanes = wt(le.lanes, d)), my(p.return, d, n), b.lanes = wt(b.lanes, d); break; } T = T.next; } } else if (p.tag === Me) v = p.type === n.type ? null : p.child; else if (p.tag === Se) { var ye = p.return; if (ye === null) throw new Error("We just came from a parent so we must have had a parent. This is a bug in React."); ye.lanes = wt(ye.lanes, d); var je = ye.alternate; je !== null && (je.lanes = wt(je.lanes, d)), my(ye, d, n), v = p.sibling; } else v = p.child; if (v !== null) v.return = p; else for (v = p; v !== null; ) { if (v === n) { v = null; break; } var Ee = v.sibling; if (Ee !== null) { Ee.return = v.return, v = Ee; break; } v = v.return; } p = v; } } function Jc(n, a) { nv = n, Zc = null, hy = null; var d = n.dependencies; if (d !== null) { var p = d.firstContext; p !== null && ($n(d.lanes, a) && lp(), d.firstContext = null); } } function br(n) { rv && g("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."); var a = ac ? n._currentValue : n._currentValue2; if (hy !== n) { var d = { context: n, memoizedValue: a, next: null }; if (Zc === null) { if (nv === null) throw new Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."); Zc = d, nv.dependencies = { lanes: we, firstContext: d }; } else Zc = Zc.next = d; } return a; } var xu = null; function gy(n) { xu === null ? xu = [n] : xu.push(n); } function Jk() { if (xu !== null) { for (var n = 0; n < xu.length; n++) { var a = xu[n], d = a.interleaved; if (d !== null) { a.interleaved = null; var p = d.next, v = a.pending; if (v !== null) { var b = v.next; v.next = p, d.next = b; } a.pending = d; } } xu = null; } } function H1(n, a, d, p) { var v = a.interleaved; return v === null ? (d.next = d, gy(a)) : (d.next = v.next, v.next = d), a.interleaved = d, iv(n, p); } function eR(n, a, d, p) { var v = a.interleaved; v === null ? (d.next = d, gy(a)) : (d.next = v.next, v.next = d), a.interleaved = d; } function tR(n, a, d, p) { var v = a.interleaved; return v === null ? (d.next = d, gy(a)) : (d.next = v.next, v.next = d), a.interleaved = d, iv(n, p); } function Na(n, a) { return iv(n, a); } var nR = iv; function iv(n, a) { n.lanes = wt(n.lanes, a); var d = n.alternate; d !== null && (d.lanes = wt(d.lanes, a)), d === null && (n.flags & (bn | Ai)) !== rt && VE(n); for (var p = n, v = n.return; v !== null; ) v.childLanes = wt(v.childLanes, a), d = v.alternate, d !== null ? d.childLanes = wt(d.childLanes, a) : (v.flags & (bn | Ai)) !== rt && VE(n), p = v, v = v.return; if (p.tag === ae) { var b = p.stateNode; return b; } else return null; } var V1 = 0, W1 = 1, ov = 2, yy = 3, sv = !1, xy, lv; xy = !1, lv = null; function Sy(n) { var a = { baseState: n.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: we }, effects: null }; n.updateQueue = a; } function G1(n, a) { var d = a.updateQueue, p = n.updateQueue; if (d === p) { var v = { baseState: p.baseState, firstBaseUpdate: p.firstBaseUpdate, lastBaseUpdate: p.lastBaseUpdate, shared: p.shared, effects: p.effects }; a.updateQueue = v; } } function bs(n, a) { var d = { eventTime: n, lane: a, tag: V1, payload: null, callback: null, next: null }; return d; } function vl(n, a, d) { var p = n.updateQueue; if (p === null) return null; var v = p.shared; if (lv === v && !xy && (g("An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback."), xy = !0), vN()) { var b = v.pending; return b === null ? a.next = a : (a.next = b.next, b.next = a), v.pending = a, nR(n, d); } else return tR(n, v, a, d); } function uv(n, a, d) { var p = a.updateQueue; if (p !== null) { var v = p.shared; if (zc(d)) { var b = v.lanes; b = ol(b, n.pendingLanes); var T = wt(b, d); v.lanes = T, Of(n, T); } } } function by(n, a) { var d = n.updateQueue, p = n.alternate; if (p !== null) { var v = p.updateQueue; if (d === v) { var b = null, T = null, _ = d.firstBaseUpdate; if (_ !== null) { var P = _; do { var z = { eventTime: P.eventTime, lane: P.lane, tag: P.tag, payload: P.payload, callback: P.callback, next: null }; T === null ? b = T = z : (T.next = z, T = z), P = P.next; } while (P !== null); T === null ? b = T = a : (T.next = a, T = a); } else b = T = a; d = { baseState: v.baseState, firstBaseUpdate: b, lastBaseUpdate: T, shared: v.shared, effects: v.effects }, n.updateQueue = d; return; } } var F = d.lastBaseUpdate; F === null ? d.firstBaseUpdate = a : F.next = a, d.lastBaseUpdate = a; } function rR(n, a, d, p, v, b) { switch (d.tag) { case W1: { var T = d.payload; if (typeof T == "function") { L1(); var _ = T.call(b, p, v); { if (n.mode & cn) { rr(!0); try { T.call(b, p, v); } finally { rr(!1); } } B1(); } return _; } return T; } case yy: n.flags = n.flags & ~Kr | tn; case V1: { var P = d.payload, z; if (typeof P == "function") { L1(), z = P.call(b, p, v); { if (n.mode & cn) { rr(!0); try { P.call(b, p, v); } finally { rr(!1); } } B1(); } } else z = P; return z == null ? p : E({}, p, z); } case ov: return sv = !0, p; } return p; } function cv(n, a, d, p) { var v = n.updateQueue; sv = !1, lv = v.shared; var b = v.firstBaseUpdate, T = v.lastBaseUpdate, _ = v.shared.pending; if (_ !== null) { v.shared.pending = null; var P = _, z = P.next; P.next = null, T === null ? b = z : T.next = z, T = P; var F = n.alternate; if (F !== null) { var X = F.updateQueue, le = X.lastBaseUpdate; le !== T && (le === null ? X.firstBaseUpdate = z : le.next = z, X.lastBaseUpdate = P); } } if (b !== null) { var ye = v.baseState, je = we, Ee = null, gt = null, Mt = null, bt = b; do { var xn = bt.lane, nn = bt.eventTime; if (il(p, xn)) { if (Mt !== null) { var me = { eventTime: nn, // This update is going to be committed so we never want uncommit // it. Using NoLane works because 0 is a subset of all bitmasks, so // this will never be skipped by the check above. lane: fr, tag: bt.tag, payload: bt.payload, callback: bt.callback, next: null }; Mt = Mt.next = me; } ye = rR(n, v, bt, ye, a, d); var Z = bt.callback; if (Z !== null && // If the update was already committed, we should not queue its // callback again. bt.lane !== fr) { n.flags |= Zu; var ze = v.effects; ze === null ? v.effects = [bt] : ze.push(bt); } } else { var J = { eventTime: nn, lane: xn, tag: bt.tag, payload: bt.payload, callback: bt.callback, next: null }; Mt === null ? (gt = Mt = J, Ee = ye) : Mt = Mt.next = J, je = wt(je, xn); } if (bt = bt.next, bt === null) { if (_ = v.shared.pending, _ === null) break; var vt = _, nt = vt.next; vt.next = null, bt = nt, v.lastBaseUpdate = vt, v.shared.pending = null; } } while (!0); Mt === null && (Ee = ye), v.baseState = Ee, v.firstBaseUpdate = gt, v.lastBaseUpdate = Mt; var en = v.shared.interleaved; if (en !== null) { var Rt = en; do je = wt(je, Rt.lane), Rt = Rt.next; while (Rt !== en); } else b === null && (v.shared.lanes = we); Cp(je), n.lanes = je, n.memoizedState = ye; } lv = null; } function aR(n, a) { if (typeof n != "function") throw new Error("Invalid argument passed as callback. Expected a function. Instead " + ("received: " + n)); n.call(a); } function q1() { sv = !1; } function dv() { return sv; } function Y1(n, a, d) { var p = a.effects; if (a.effects = null, p !== null) for (var v = 0; v < p.length; v++) { var b = p[v], T = b.callback; T !== null && (b.callback = null, aR(T, d)); } } var Cy = {}, K1 = new i.Component().refs, Ey, wy, jy, Ty, Dy, X1, fv, _y, My, ky; { Ey = /* @__PURE__ */ new Set(), wy = /* @__PURE__ */ new Set(), jy = /* @__PURE__ */ new Set(), Ty = /* @__PURE__ */ new Set(), _y = /* @__PURE__ */ new Set(), Dy = /* @__PURE__ */ new Set(), My = /* @__PURE__ */ new Set(), ky = /* @__PURE__ */ new Set(); var $1 = /* @__PURE__ */ new Set(); fv = function(n, a) { if (!(n === null || typeof n == "function")) { var d = a + "_" + n; $1.has(d) || ($1.add(d), g("%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", a, n)); } }, X1 = function(n, a) { if (a === void 0) { var d = ft(n) || "Component"; Dy.has(d) || (Dy.add(d), g("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", d)); } }, Object.defineProperty(Cy, "_processChildContext", { enumerable: !1, value: function() { throw new Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal)."); } }), Object.freeze(Cy); } function Ry(n, a, d, p) { var v = n.memoizedState, b = d(p, v); { if (n.mode & cn) { rr(!0); try { b = d(p, v); } finally { rr(!1); } } X1(a, b); } var T = b == null ? v : E({}, v, b); if (n.memoizedState = T, n.lanes === we) { var _ = n.updateQueue; _.baseState = T; } } var Py = { isMounted: Jd, enqueueSetState: function(n, a, d) { var p = w(n), v = ga(), b = Cl(p), T = bs(v, b); T.payload = a, d != null && (fv(d, "setState"), T.callback = d); var _ = vl(p, T, b); _ !== null && (Er(_, p, b, v), uv(_, p, b)), wi(p, b); }, enqueueReplaceState: function(n, a, d) { var p = w(n), v = ga(), b = Cl(p), T = bs(v, b); T.tag = W1, T.payload = a, d != null && (fv(d, "replaceState"), T.callback = d); var _ = vl(p, T, b); _ !== null && (Er(_, p, b, v), uv(_, p, b)), wi(p, b); }, enqueueForceUpdate: function(n, a) { var d = w(n), p = ga(), v = Cl(d), b = bs(p, v); b.tag = ov, a != null && (fv(a, "forceUpdate"), b.callback = a); var T = vl(d, b, v); T !== null && (Er(T, d, v, p), uv(T, d, v)), Vf(d, v); } }; function Q1(n, a, d, p, v, b, T) { var _ = n.stateNode; if (typeof _.shouldComponentUpdate == "function") { var P = _.shouldComponentUpdate(p, b, T); { if (n.mode & cn) { rr(!0); try { P = _.shouldComponentUpdate(p, b, T); } finally { rr(!1); } } P === void 0 && g("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", ft(a) || "Component"); } return P; } return a.prototype && a.prototype.isPureReactComponent ? !V(d, p) || !V(v, b) : !0; } function iR(n, a, d) { var p = n.stateNode; { var v = ft(a) || "Component", b = p.render; b || (a.prototype && typeof a.prototype.render == "function" ? g("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", v) : g("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", v)), p.getInitialState && !p.getInitialState.isReactClassApproved && !p.state && g("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", v), p.getDefaultProps && !p.getDefaultProps.isReactClassApproved && g("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", v), p.propTypes && g("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", v), p.contextType && g("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", v), p.contextTypes && g("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", v), a.contextType && a.contextTypes && !My.has(a) && (My.add(a), g("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", v)), typeof p.componentShouldUpdate == "function" && g("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", v), a.prototype && a.prototype.isPureReactComponent && typeof p.shouldComponentUpdate < "u" && g("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", ft(a) || "A pure component"), typeof p.componentDidUnmount == "function" && g("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", v), typeof p.componentDidReceiveProps == "function" && g("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", v), typeof p.componentWillRecieveProps == "function" && g("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", v), typeof p.UNSAFE_componentWillRecieveProps == "function" && g("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", v); var T = p.props !== d; p.props !== void 0 && T && g("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", v, v), p.defaultProps && g("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", v, v), typeof p.getSnapshotBeforeUpdate == "function" && typeof p.componentDidUpdate != "function" && !jy.has(a) && (jy.add(a), g("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", ft(a))), typeof p.getDerivedStateFromProps == "function" && g("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", v), typeof p.getDerivedStateFromError == "function" && g("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", v), typeof a.getSnapshotBeforeUpdate == "function" && g("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", v); var _ = p.state; _ && (typeof _ != "object" || Gt(_)) && g("%s.state: must be set to an object or null", v), typeof p.getChildContext == "function" && typeof a.childContextTypes != "object" && g("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", v); } } function Z1(n, a) { a.updater = Py, n.stateNode = a, D(a, n), a._reactInternalInstance = Cy; } function J1(n, a, d) { var p = !1, v = ua, b = ua, T = a.contextType; if ("contextType" in a) { var _ = ( // Allow null for conditional declaration T === null || T !== void 0 && T.$$typeof === pn && T._context === void 0 ); if (!_ && !ky.has(a)) { ky.add(a); var P = ""; T === void 0 ? P = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : typeof T != "object" ? P = " However, it is set to a " + typeof T + "." : T.$$typeof === Tn ? P = " Did you accidentally pass the Context.Provider instead?" : T._context !== void 0 ? P = " Did you accidentally pass the Context.Consumer instead?" : P = " However, it is set to an object with keys {" + Object.keys(T).join(", ") + "}.", g("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", ft(a) || "Component", P); } } if (typeof T == "object" && T !== null) b = br(T); else { v = yo(n, a, !0); var z = a.contextTypes; p = z != null, b = p ? Wi(n, v) : ua; } var F = new a(d, b); if (n.mode & cn) { rr(!0); try { F = new a(d, b); } finally { rr(!1); } } var X = n.memoizedState = F.state !== null && F.state !== void 0 ? F.state : null; Z1(n, F); { if (typeof a.getDerivedStateFromProps == "function" && X === null) { var le = ft(a) || "Component"; wy.has(le) || (wy.add(le), g("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", le, F.state === null ? "null" : "undefined", le)); } if (typeof a.getDerivedStateFromProps == "function" || typeof F.getSnapshotBeforeUpdate == "function") { var ye = null, je = null, Ee = null; if (typeof F.componentWillMount == "function" && F.componentWillMount.__suppressDeprecationWarning !== !0 ? ye = "componentWillMount" : typeof F.UNSAFE_componentWillMount == "function" && (ye = "UNSAFE_componentWillMount"), typeof F.componentWillReceiveProps == "function" && F.componentWillReceiveProps.__suppressDeprecationWarning !== !0 ? je = "componentWillReceiveProps" : typeof F.UNSAFE_componentWillReceiveProps == "function" && (je = "UNSAFE_componentWillReceiveProps"), typeof F.componentWillUpdate == "function" && F.componentWillUpdate.__suppressDeprecationWarning !== !0 ? Ee = "componentWillUpdate" : typeof F.UNSAFE_componentWillUpdate == "function" && (Ee = "UNSAFE_componentWillUpdate"), ye !== null || je !== null || Ee !== null) { var gt = ft(a) || "Component", Mt = typeof a.getDerivedStateFromProps == "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()"; Ty.has(gt) || (Ty.add(gt), g(`Unsafe legacy lifecycles will not be called for components using new component APIs. %s uses %s but also contains the following legacy lifecycles:%s%s%s The above lifecycles should be removed. Learn more about this warning here: https://reactjs.org/link/unsafe-component-lifecycles`, gt, Mt, ye !== null ? ` ` + ye : "", je !== null ? ` ` + je : "", Ee !== null ? ` ` + Ee : "")); } } } return p && Sc(n, v, b), F; } function oR(n, a) { var d = a.state; typeof a.componentWillMount == "function" && a.componentWillMount(), typeof a.UNSAFE_componentWillMount == "function" && a.UNSAFE_componentWillMount(), d !== a.state && (g("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", st(n) || "Component"), Py.enqueueReplaceState(a, a.state, null)); } function eC(n, a, d, p) { var v = a.state; if (typeof a.componentWillReceiveProps == "function" && a.componentWillReceiveProps(d, p), typeof a.UNSAFE_componentWillReceiveProps == "function" && a.UNSAFE_componentWillReceiveProps(d, p), a.state !== v) { { var b = st(n) || "Component"; Ey.has(b) || (Ey.add(b), g("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", b)); } Py.enqueueReplaceState(a, a.state, null); } } function Ny(n, a, d, p) { iR(n, a, d); var v = n.stateNode; v.props = d, v.state = n.memoizedState, v.refs = K1, Sy(n); var b = a.contextType; if (typeof b == "object" && b !== null) v.context = br(b); else { var T = yo(n, a, !0); v.context = Wi(n, T); } { if (v.state === d) { var _ = ft(a) || "Component"; _y.has(_) || (_y.add(_), g("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", _)); } n.mode & cn && ce.recordLegacyContextWarning(n, v), ce.recordUnsafeLifecycleWarnings(n, v); } v.state = n.memoizedState; var P = a.getDerivedStateFromProps; if (typeof P == "function" && (Ry(n, a, P, d), v.state = n.memoizedState), typeof a.getDerivedStateFromProps != "function" && typeof v.getSnapshotBeforeUpdate != "function" && (typeof v.UNSAFE_componentWillMount == "function" || typeof v.componentWillMount == "function") && (oR(n, v), cv(n, d, v, p), v.state = n.memoizedState), typeof v.componentDidMount == "function") { var z = Ft; z |= Jo, (n.mode & ca) !== Ct && (z |= zi), n.flags |= z; } } function sR(n, a, d, p) { var v = n.stateNode, b = n.memoizedProps; v.props = b; var T = v.context, _ = a.contextType, P = ua; if (typeof _ == "object" && _ !== null) P = br(_); else { var z = yo(n, a, !0); P = Wi(n, z); } var F = a.getDerivedStateFromProps, X = typeof F == "function" || typeof v.getSnapshotBeforeUpdate == "function"; !X && (typeof v.UNSAFE_componentWillReceiveProps == "function" || typeof v.componentWillReceiveProps == "function") && (b !== d || T !== P) && eC(n, v, d, P), q1(); var le = n.memoizedState, ye = v.state = le; if (cv(n, d, v, p), ye = n.memoizedState, b === d && le === ye && !Js() && !dv()) { if (typeof v.componentDidMount == "function") { var je = Ft; je |= Jo, (n.mode & ca) !== Ct && (je |= zi), n.flags |= je; } return !1; } typeof F == "function" && (Ry(n, a, F, d), ye = n.memoizedState); var Ee = dv() || Q1(n, a, b, d, le, ye, P); if (Ee) { if (!X && (typeof v.UNSAFE_componentWillMount == "function" || typeof v.componentWillMount == "function") && (typeof v.componentWillMount == "function" && v.componentWillMount(), typeof v.UNSAFE_componentWillMount == "function" && v.UNSAFE_componentWillMount()), typeof v.componentDidMount == "function") { var gt = Ft; gt |= Jo, (n.mode & ca) !== Ct && (gt |= zi), n.flags |= gt; } } else { if (typeof v.componentDidMount == "function") { var Mt = Ft; Mt |= Jo, (n.mode & ca) !== Ct && (Mt |= zi), n.flags |= Mt; } n.memoizedProps = d, n.memoizedState = ye; } return v.props = d, v.state = ye, v.context = P, Ee; } function lR(n, a, d, p, v) { var b = a.stateNode; G1(n, a); var T = a.memoizedProps, _ = a.type === a.elementType ? T : Qi(a.type, T); b.props = _; var P = a.pendingProps, z = b.context, F = d.contextType, X = ua; if (typeof F == "object" && F !== null) X = br(F); else { var le = yo(a, d, !0); X = Wi(a, le); } var ye = d.getDerivedStateFromProps, je = typeof ye == "function" || typeof b.getSnapshotBeforeUpdate == "function"; !je && (typeof b.UNSAFE_componentWillReceiveProps == "function" || typeof b.componentWillReceiveProps == "function") && (T !== P || z !== X) && eC(a, b, p, X), q1(); var Ee = a.memoizedState, gt = b.state = Ee; if (cv(a, p, b, v), gt = a.memoizedState, T === P && Ee === gt && !Js() && !dv() && !k) return typeof b.componentDidUpdate == "function" && (T !== n.memoizedProps || Ee !== n.memoizedState) && (a.flags |= Ft), typeof b.getSnapshotBeforeUpdate == "function" && (T !== n.memoizedProps || Ee !== n.memoizedState) && (a.flags |= fo), !1; typeof ye == "function" && (Ry(a, d, ye, p), gt = a.memoizedState); var Mt = dv() || Q1(a, d, _, p, Ee, gt, X) || // TODO: In some cases, we'll end up checking if context has changed twice, // both before and after `shouldComponentUpdate` has been called. Not ideal, // but I'm loath to refactor this function. This only happens for memoized // components so it's not that common. k; return Mt ? (!je && (typeof b.UNSAFE_componentWillUpdate == "function" || typeof b.componentWillUpdate == "function") && (typeof b.componentWillUpdate == "function" && b.componentWillUpdate(p, gt, X), typeof b.UNSAFE_componentWillUpdate == "function" && b.UNSAFE_componentWillUpdate(p, gt, X)), typeof b.componentDidUpdate == "function" && (a.flags |= Ft), typeof b.getSnapshotBeforeUpdate == "function" && (a.flags |= fo)) : (typeof b.componentDidUpdate == "function" && (T !== n.memoizedProps || Ee !== n.memoizedState) && (a.flags |= Ft), typeof b.getSnapshotBeforeUpdate == "function" && (T !== n.memoizedProps || Ee !== n.memoizedState) && (a.flags |= fo), a.memoizedProps = p, a.memoizedState = gt), b.props = p, b.state = gt, b.context = X, Mt; } var Oy, Ay, zy, Iy, Fy, tC = function(n, a) { }; Oy = !1, Ay = !1, zy = {}, Iy = {}, Fy = {}, tC = function(n, a) { if (!(n === null || typeof n != "object") && !(!n._store || n._store.validated || n.key != null)) { if (typeof n._store != "object") throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue."); n._store.validated = !0; var d = st(a) || "Component"; Iy[d] || (Iy[d] = !0, g('Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.')); } }; function Kf(n, a, d) { var p = d.ref; if (p !== null && typeof p != "function" && typeof p != "object") { if ((n.mode & cn || I) && // We warn in ReactElement.js if owner and self are equal for string refs // because these cannot be automatically converted to an arrow function // using a codemod. Therefore, we don't have to warn about string refs again. !(d._owner && d._self && d._owner.stateNode !== d._self)) { var v = st(n) || "Component"; zy[v] || (g('A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', p), zy[v] = !0); } if (d._owner) { var b = d._owner, T; if (b) { var _ = b; if (_.tag !== U) throw new Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref"); T = _.stateNode; } if (!T) throw new Error("Missing owner for string ref " + p + ". This error is likely caused by a bug in React. Please file an issue."); var P = T; $k(p, "ref"); var z = "" + p; if (a !== null && a.ref !== null && typeof a.ref == "function" && a.ref._stringRef === z) return a.ref; var F = function(X) { var le = P.refs; le === K1 && (le = P.refs = {}), X === null ? delete le[z] : le[z] = X; }; return F._stringRef = z, F; } else { if (typeof p != "string") throw new Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null."); if (!d._owner) throw new Error("Element ref was specified as a string (" + p + `) but no owner was set. This could happen for one of the following reasons: 1. You may be adding a ref to a function component 2. You may be adding a ref to a component that was not created inside a component's render method 3. You have multiple copies of React loaded See https://reactjs.org/link/refs-must-have-owner for more information.`); } } return p; } function pv(n, a) { var d = Object.prototype.toString.call(a); throw new Error("Objects are not valid as a React child (found: " + (d === "[object Object]" ? "object with keys {" + Object.keys(a).join(", ") + "}" : d) + "). If you meant to render a collection of children, use an array instead."); } function hv(n) { { var a = st(n) || "Component"; if (Fy[a]) return; Fy[a] = !0, g("Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it."); } } function nC(n) { var a = n._payload, d = n._init; return d(a); } function rC(n) { function a(J, me) { if (n) { var Z = J.deletions; Z === null ? (J.deletions = [me], J.flags |= sa) : Z.push(me); } } function d(J, me) { if (!n) return null; for (var Z = me; Z !== null; ) a(J, Z), Z = Z.sibling; return null; } function p(J, me) { for (var Z = /* @__PURE__ */ new Map(), ze = me; ze !== null; ) ze.key !== null ? Z.set(ze.key, ze) : Z.set(ze.index, ze), ze = ze.sibling; return Z; } function v(J, me) { var Z = Du(J, me); return Z.index = 0, Z.sibling = null, Z; } function b(J, me, Z) { if (J.index = Z, !n) return J.flags |= ph, me; var ze = J.alternate; if (ze !== null) { var vt = ze.index; return vt < me ? (J.flags |= bn, me) : vt; } else return J.flags |= bn, me; } function T(J) { return n && J.alternate === null && (J.flags |= bn), J; } function _(J, me, Z, ze) { if (me === null || me.tag !== ve) { var vt = hx(Z, J.mode, ze); return vt.return = J, vt; } else { var nt = v(me, Z); return nt.return = J, nt; } } function P(J, me, Z, ze) { var vt = Z.type; if (vt === Ot) return F(J, me, Z.props.children, ze, Z.key); if (me !== null && (me.elementType === vt || // Keep this check inline so it only runs on the false path: YE(me, Z) || // Lazy types should reconcile their resolved type. // We need to do this after the Hot Reloading check above, // because hot reloading has different semantics than prod because // it doesn't resuspend. So we can't let the call below suspend. typeof vt == "object" && vt !== null && vt.$$typeof === Fe && nC(vt) === me.type)) { var nt = v(me, Z.props); return nt.ref = Kf(J, me, Z), nt.return = J, nt._debugSource = Z._source, nt._debugOwner = Z._owner, nt; } var en = px(Z, J.mode, ze); return en.ref = Kf(J, me, Z), en.return = J, en; } function z(J, me, Z, ze) { if (me === null || me.tag !== oe || me.stateNode.containerInfo !== Z.containerInfo || me.stateNode.implementation !== Z.implementation) { var vt = vx(Z, J.mode, ze); return vt.return = J, vt; } else { var nt = v(me, Z.children || []); return nt.return = J, nt; } } function F(J, me, Z, ze, vt) { if (me === null || me.tag !== de) { var nt = wl(Z, J.mode, ze, vt); return nt.return = J, nt; } else { var en = v(me, Z); return en.return = J, en; } } function X(J, me, Z) { if (typeof me == "string" && me !== "" || typeof me == "number") { var ze = hx("" + me, J.mode, Z); return ze.return = J, ze; } if (typeof me == "object" && me !== null) { switch (me.$$typeof) { case Le: { var vt = px(me, J.mode, Z); return vt.ref = Kf(J, null, me), vt.return = J, vt; } case yt: { var nt = vx(me, J.mode, Z); return nt.return = J, nt; } case Fe: { var en = me._payload, Rt = me._init; return X(J, Rt(en), Z); } } if (Gt(me) || Re(me)) { var un = wl(me, J.mode, Z, null); return un.return = J, un; } pv(J, me); } return typeof me == "function" && hv(J), null; } function le(J, me, Z, ze) { var vt = me !== null ? me.key : null; if (typeof Z == "string" && Z !== "" || typeof Z == "number") return vt !== null ? null : _(J, me, "" + Z, ze); if (typeof Z == "object" && Z !== null) { switch (Z.$$typeof) { case Le: return Z.key === vt ? P(J, me, Z, ze) : null; case yt: return Z.key === vt ? z(J, me, Z, ze) : null; case Fe: { var nt = Z._payload, en = Z._init; return le(J, me, en(nt), ze); } } if (Gt(Z) || Re(Z)) return vt !== null ? null : F(J, me, Z, ze, null); pv(J, Z); } return typeof Z == "function" && hv(J), null; } function ye(J, me, Z, ze, vt) { if (typeof ze == "string" && ze !== "" || typeof ze == "number") { var nt = J.get(Z) || null; return _(me, nt, "" + ze, vt); } if (typeof ze == "object" && ze !== null) { switch (ze.$$typeof) { case Le: { var en = J.get(ze.key === null ? Z : ze.key) || null; return P(me, en, ze, vt); } case yt: { var Rt = J.get(ze.key === null ? Z : ze.key) || null; return z(me, Rt, ze, vt); } case Fe: var un = ze._payload, Yt = ze._init; return ye(J, me, Z, Yt(un), vt); } if (Gt(ze) || Re(ze)) { var Nn = J.get(Z) || null; return F(me, Nn, ze, vt, null); } pv(me, ze); } return typeof ze == "function" && hv(me), null; } function je(J, me, Z) { { if (typeof J != "object" || J === null) return me; switch (J.$$typeof) { case Le: case yt: tC(J, Z); var ze = J.key; if (typeof ze != "string") break; if (me === null) { me = /* @__PURE__ */ new Set(), me.add(ze); break; } if (!me.has(ze)) { me.add(ze); break; } g("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.", ze); break; case Fe: var vt = J._payload, nt = J._init; je(nt(vt), me, Z); break; } } return me; } function Ee(J, me, Z, ze) { for (var vt = null, nt = 0; nt < Z.length; nt++) { var en = Z[nt]; vt = je(en, vt, J); } for (var Rt = null, un = null, Yt = me, Nn = 0, Et = 0, sr = null; Yt !== null && Et < Z.length; Et++) { Yt.index > Et ? (sr = Yt, Yt = null) : sr = Yt.sibling; var ya = le(J, Yt, Z[Et], ze); if (ya === null) { Yt === null && (Yt = sr); break; } n && Yt && ya.alternate === null && a(J, Yt), Nn = b(ya, Nn, Et), un === null ? Rt = ya : un.sibling = ya, un = ya, Yt = sr; } if (Et === Z.length) { if (d(J, Yt), h()) { var ra = Et; Xi(J, ra); } return Rt; } if (Yt === null) { for (; Et < Z.length; Et++) { var mi = X(J, Z[Et], ze); mi !== null && (Nn = b(mi, Nn, Et), un === null ? Rt = mi : un.sibling = mi, un = mi); } if (h()) { var za = Et; Xi(J, za); } return Rt; } for (var Ia = p(J, Yt); Et < Z.length; Et++) { var xa = ye(Ia, J, Et, Z[Et], ze); xa !== null && (n && xa.alternate !== null && Ia.delete(xa.key === null ? Et : xa.key), Nn = b(xa, Nn, Et), un === null ? Rt = xa : un.sibling = xa, un = xa); } if (n && Ia.forEach(function(md) { return a(J, md); }), h()) { var js = Et; Xi(J, js); } return Rt; } function gt(J, me, Z, ze) { var vt = Re(Z); if (typeof vt != "function") throw new Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."); { typeof Symbol == "function" && // $FlowFixMe Flow doesn't know about toStringTag Z[Symbol.toStringTag] === "Generator" && (Ay || g("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."), Ay = !0), Z.entries === vt && (Oy || g("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), Oy = !0); var nt = vt.call(Z); if (nt) for (var en = null, Rt = nt.next(); !Rt.done; Rt = nt.next()) { var un = Rt.value; en = je(un, en, J); } } var Yt = vt.call(Z); if (Yt == null) throw new Error("An iterable object provided no iterator."); for (var Nn = null, Et = null, sr = me, ya = 0, ra = 0, mi = null, za = Yt.next(); sr !== null && !za.done; ra++, za = Yt.next()) { sr.index > ra ? (mi = sr, sr = null) : mi = sr.sibling; var Ia = le(J, sr, za.value, ze); if (Ia === null) { sr === null && (sr = mi); break; } n && sr && Ia.alternate === null && a(J, sr), ya = b(Ia, ya, ra), Et === null ? Nn = Ia : Et.sibling = Ia, Et = Ia, sr = mi; } if (za.done) { if (d(J, sr), h()) { var xa = ra; Xi(J, xa); } return Nn; } if (sr === null) { for (; !za.done; ra++, za = Yt.next()) { var js = X(J, za.value, ze); js !== null && (ya = b(js, ya, ra), Et === null ? Nn = js : Et.sibling = js, Et = js); } if (h()) { var md = ra; Xi(J, md); } return Nn; } for (var jp = p(J, sr); !za.done; ra++, za = Yt.next()) { var Fo = ye(jp, J, ra, za.value, ze); Fo !== null && (n && Fo.alternate !== null && jp.delete(Fo.key === null ? ra : Fo.key), ya = b(Fo, ya, ra), Et === null ? Nn = Fo : Et.sibling = Fo, Et = Fo); } if (n && jp.forEach(function(DO) { return a(J, DO); }), h()) { var TO = ra; Xi(J, TO); } return Nn; } function Mt(J, me, Z, ze) { if (me !== null && me.tag === ve) { d(J, me.sibling); var vt = v(me, Z); return vt.return = J, vt; } d(J, me); var nt = hx(Z, J.mode, ze); return nt.return = J, nt; } function bt(J, me, Z, ze) { for (var vt = Z.key, nt = me; nt !== null; ) { if (nt.key === vt) { var en = Z.type; if (en === Ot) { if (nt.tag === de) { d(J, nt.sibling); var Rt = v(nt, Z.props.children); return Rt.return = J, Rt._debugSource = Z._source, Rt._debugOwner = Z._owner, Rt; } } else if (nt.elementType === en || // Keep this check inline so it only runs on the false path: YE(nt, Z) || // Lazy types should reconcile their resolved type. // We need to do this after the Hot Reloading check above, // because hot reloading has different semantics than prod because // it doesn't resuspend. So we can't let the call below suspend. typeof en == "object" && en !== null && en.$$typeof === Fe && nC(en) === nt.type) { d(J, nt.sibling); var un = v(nt, Z.props); return un.ref = Kf(J, nt, Z), un.return = J, un._debugSource = Z._source, un._debugOwner = Z._owner, un; } d(J, nt); break; } else a(J, nt); nt = nt.sibling; } if (Z.type === Ot) { var Yt = wl(Z.props.children, J.mode, ze, Z.key); return Yt.return = J, Yt; } else { var Nn = px(Z, J.mode, ze); return Nn.ref = Kf(J, me, Z), Nn.return = J, Nn; } } function xn(J, me, Z, ze) { for (var vt = Z.key, nt = me; nt !== null; ) { if (nt.key === vt) if (nt.tag === oe && nt.stateNode.containerInfo === Z.containerInfo && nt.stateNode.implementation === Z.implementation) { d(J, nt.sibling); var en = v(nt, Z.children || []); return en.return = J, en; } else { d(J, nt); break; } else a(J, nt); nt = nt.sibling; } var Rt = vx(Z, J.mode, ze); return Rt.return = J, Rt; } function nn(J, me, Z, ze) { var vt = typeof Z == "object" && Z !== null && Z.type === Ot && Z.key === null; if (vt && (Z = Z.props.children), typeof Z == "object" && Z !== null) { switch (Z.$$typeof) { case Le: return T(bt(J, me, Z, ze)); case yt: return T(xn(J, me, Z, ze)); case Fe: var nt = Z._payload, en = Z._init; return nn(J, me, en(nt), ze); } if (Gt(Z)) return Ee(J, me, Z, ze); if (Re(Z)) return gt(J, me, Z, ze); pv(J, Z); } return typeof Z == "string" && Z !== "" || typeof Z == "number" ? T(Mt(J, me, "" + Z, ze)) : (typeof Z == "function" && hv(J), d(J, me)); } return nn; } var ed = rC(!0), aC = rC(!1); function uR(n, a) { if (n !== null && a.child !== n.child) throw new Error("Resuming work not yet implemented."); if (a.child !== null) { var d = a.child, p = Du(d, d.pendingProps); for (a.child = p, p.return = a; d.sibling !== null; ) d = d.sibling, p = p.sibling = Du(d, d.pendingProps), p.return = a; p.sibling = null; } } function cR(n, a) { for (var d = n.child; d !== null; ) nO(d, a), d = d.sibling; } var Xf = {}, ml = _a(Xf), $f = _a(Xf), vv = _a(Xf); function mv(n) { if (n === Xf) throw new Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."); return n; } function Ly() { var n = mv(vv.current); return n; } function By(n, a) { cr(vv, a, n), cr($f, n, n), cr(ml, Xf, n); var d = ho(a); Rn(ml, n), cr(ml, d, n); } function td(n) { Rn(ml, n), Rn($f, n), Rn(vv, n); } function Qf() { var n = mv(ml.current); return n; } function iC(n) { var a = mv(vv.current), d = mv(ml.current), p = Br(d, n.type, a); d !== p && (cr($f, n, n), cr(ml, p, n)); } function Uy(n) { $f.current === n && (Rn(ml, n), Rn($f, n)); } var dR = 0, oC = 1, sC = 1, Zf = 2, Zi = _a(dR); function Hy(n, a) { return (n & a) !== 0; } function nd(n) { return n & oC; } function Vy(n, a) { return n & oC | a; } function fR(n, a) { return n | a; } function gl(n, a) { cr(Zi, a, n); } function rd(n) { Rn(Zi, n); } function pR(n, a) { var d = n.memoizedState; return d !== null ? d.dehydrated !== null : (n.memoizedProps, !0); } function gv(n) { for (var a = n; a !== null; ) { if (a.tag === se) { var d = a.memoizedState; if (d !== null) { var p = d.dehydrated; if (p === null || Si(p) || Bi(p)) return a; } } else if (a.tag === be && // revealOrder undefined can't be trusted because it don't // keep track of whether it suspended or not. a.memoizedProps.revealOrder !== void 0) { var v = (a.flags & tn) !== rt; if (v) return a; } else if (a.child !== null) { a.child.return = a, a = a.child; continue; } if (a === n) return null; for (; a.sibling === null; ) { if (a.return === null || a.return === n) return null; a = a.return; } a.sibling.return = a.return, a = a.sibling; } return null; } var Qa = ( /* */ 0 ), Or = ( /* */ 1 ), _o = ( /* */ 2 ), Ar = ( /* */ 4 ), Zr = ( /* */ 8 ), Wy = []; function Gy() { for (var n = 0; n < Wy.length; n++) { var a = Wy[n]; ac ? a._workInProgressVersionPrimary = null : a._workInProgressVersionSecondary = null; } Wy.length = 0; } function hR(n, a) { var d = a._getVersion, p = d(a._source); n.mutableSourceEagerHydrationData == null ? n.mutableSourceEagerHydrationData = [a, p] : n.mutableSourceEagerHydrationData.push(a, p); } var et = c.ReactCurrentDispatcher, Jf = c.ReactCurrentBatchConfig, qy, ad; qy = /* @__PURE__ */ new Set(); var Su = we, yn = null, zr = null, Ir = null, yv = !1, ep = !1, tp = 0, vR = 0, mR = 25, ge = null, Di = null, yl = -1, Yy = !1; function fn() { { var n = ge; Di === null ? Di = [n] : Di.push(n); } } function Ve() { { var n = ge; Di !== null && (yl++, Di[yl] !== n && gR(n)); } } function id(n) { n != null && !Gt(n) && g("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.", ge, typeof n); } function gR(n) { { var a = st(yn); if (!qy.has(a) && (qy.add(a), Di !== null)) { for (var d = "", p = 30, v = 0; v <= yl; v++) { for (var b = Di[v], T = v === yl ? n : b, _ = v + 1 + ". " + b; _.length < p; ) _ += " "; _ += T + ` `, d += _; } g(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks Previous render Next render ------------------------------------------------------ %s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `, a, d); } } } function ma() { throw new Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`); } function Ky(n, a) { if (Yy) return !1; if (a === null) return g("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", ge), !1; n.length !== a.length && g(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant. Previous: %s Incoming: %s`, ge, "[" + a.join(", ") + "]", "[" + n.join(", ") + "]"); for (var d = 0; d < a.length && d < n.length; d++) if (!or(n[d], a[d])) return !1; return !0; } function od(n, a, d, p, v, b) { Su = b, yn = a, Di = n !== null ? n._debugHookTypes : null, yl = -1, Yy = n !== null && n.type !== a.type, a.memoizedState = null, a.updateQueue = null, a.lanes = we, n !== null && n.memoizedState !== null ? et.current = MC : Di !== null ? et.current = _C : et.current = DC; var T = d(p, v); if (ep) { var _ = 0; do { if (ep = !1, tp = 0, _ >= mR) throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop."); _ += 1, Yy = !1, zr = null, Ir = null, a.updateQueue = null, yl = -1, et.current = kC, T = d(p, v); } while (ep); } et.current = Rv, a._debugHookTypes = Di; var P = zr !== null && zr.next !== null; if (Su = we, yn = null, zr = null, Ir = null, ge = null, Di = null, yl = -1, n !== null && (n.flags & Ii) !== (a.flags & Ii) && // Disable this warning in legacy mode, because legacy Suspense is weird // and creates false positives. To make this work in legacy mode, we'd // need to mark fibers that commit in an incomplete state, somehow. For // now I'll disable the warning that most of the bugs that would trigger // it are either exclusive to concurrent mode or exist in both. (n.mode & qt) !== Ct && g("Internal React error: Expected static flag was missing. Please notify the React team."), yv = !1, P) throw new Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement."); return T; } function sd() { var n = tp !== 0; return tp = 0, n; } function lC(n, a, d) { a.updateQueue = n.updateQueue, (a.mode & ca) !== Ct ? a.flags &= ~(ec | zi | Va | Ft) : a.flags &= ~(Va | Ft), n.lanes = lu(n.lanes, d); } function uC() { if (et.current = Rv, yv) { for (var n = yn.memoizedState; n !== null; ) { var a = n.queue; a !== null && (a.pending = null), n = n.next; } yv = !1; } Su = we, yn = null, zr = null, Ir = null, Di = null, yl = -1, ge = null, CC = !1, ep = !1, tp = 0; } function Mo() { var n = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; return Ir === null ? yn.memoizedState = Ir = n : Ir = Ir.next = n, Ir; } function _i() { var n; if (zr === null) { var a = yn.alternate; a !== null ? n = a.memoizedState : n = null; } else n = zr.next; var d; if (Ir === null ? d = yn.memoizedState : d = Ir.next, d !== null) Ir = d, d = Ir.next, zr = n; else { if (n === null) throw new Error("Rendered more hooks than during the previous render."); zr = n; var p = { memoizedState: zr.memoizedState, baseState: zr.baseState, baseQueue: zr.baseQueue, queue: zr.queue, next: null }; Ir === null ? yn.memoizedState = Ir = p : Ir = Ir.next = p; } return Ir; } function cC() { return { lastEffect: null, stores: null }; } function Xy(n, a) { return typeof a == "function" ? a(n) : a; } function $y(n, a, d) { var p = Mo(), v; d !== void 0 ? v = d(a) : v = a, p.memoizedState = p.baseState = v; var b = { pending: null, interleaved: null, lanes: we, dispatch: null, lastRenderedReducer: n, lastRenderedState: v }; p.queue = b; var T = b.dispatch = bR.bind(null, yn, b); return [p.memoizedState, T]; } function Qy(n, a, d) { var p = _i(), v = p.queue; if (v === null) throw new Error("Should have a queue. This is likely a bug in React. Please file an issue."); v.lastRenderedReducer = n; var b = zr, T = b.baseQueue, _ = v.pending; if (_ !== null) { if (T !== null) { var P = T.next, z = _.next; T.next = z, _.next = P; } b.baseQueue !== T && g("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."), b.baseQueue = T = _, v.pending = null; } if (T !== null) { var F = T.next, X = b.baseState, le = null, ye = null, je = null, Ee = F; do { var gt = Ee.lane; if (il(Su, gt)) { if (je !== null) { var bt = { // This update is going to be committed so we never want uncommit // it. Using NoLane works because 0 is a subset of all bitmasks, so // this will never be skipped by the check above. lane: fr, action: Ee.action, hasEagerState: Ee.hasEagerState, eagerState: Ee.eagerState, next: null }; je = je.next = bt; } if (Ee.hasEagerState) X = Ee.eagerState; else { var xn = Ee.action; X = n(X, xn); } } else { var Mt = { lane: gt, action: Ee.action, hasEagerState: Ee.hasEagerState, eagerState: Ee.eagerState, next: null }; je === null ? (ye = je = Mt, le = X) : je = je.next = Mt, yn.lanes = wt(yn.lanes, gt), Cp(gt); } Ee = Ee.next; } while (Ee !== null && Ee !== F); je === null ? le = X : je.next = ye, or(X, p.memoizedState) || lp(), p.memoizedState = X, p.baseState = le, p.baseQueue = je, v.lastRenderedState = X; } var nn = v.interleaved; if (nn !== null) { var J = nn; do { var me = J.lane; yn.lanes = wt(yn.lanes, me), Cp(me), J = J.next; } while (J !== nn); } else T === null && (v.lanes = we); var Z = v.dispatch; return [p.memoizedState, Z]; } function Zy(n, a, d) { var p = _i(), v = p.queue; if (v === null) throw new Error("Should have a queue. This is likely a bug in React. Please file an issue."); v.lastRenderedReducer = n; var b = v.dispatch, T = v.pending, _ = p.memoizedState; if (T !== null) { v.pending = null; var P = T.next, z = P; do { var F = z.action; _ = n(_, F), z = z.next; } while (z !== P); or(_, p.memoizedState) || lp(), p.memoizedState = _, p.baseQueue === null && (p.baseState = _), v.lastRenderedState = _; } return [_, b]; } function iX(n, a, d) { } function oX(n, a, d) { } function Jy(n, a, d) { var p = yn, v = Mo(), b, T = h(); if (T) { if (d === void 0) throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."); b = d(), ad || b !== d() && (g("The result of getServerSnapshot should be cached to avoid an infinite loop"), ad = !0); } else { if (b = a(), !ad) { var _ = a(); or(b, _) || (g("The result of getSnapshot should be cached to avoid an infinite loop"), ad = !0); } var P = im(); if (P === null) throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); rl(P, Su) || dC(p, a, b); } v.memoizedState = b; var z = { value: b, getSnapshot: a }; return v.queue = z, Ev(pC.bind(null, p, z, n), [n]), p.flags |= Va, np(Or | Zr, fC.bind(null, p, z, b, a), void 0, null), b; } function xv(n, a, d) { var p = yn, v = _i(), b = a(); if (!ad) { var T = a(); or(b, T) || (g("The result of getSnapshot should be cached to avoid an infinite loop"), ad = !0); } var _ = v.memoizedState, P = !or(_, b); P && (v.memoizedState = b, lp()); var z = v.queue; if (ap(pC.bind(null, p, z, n), [n]), z.getSnapshot !== a || P || // Check if the susbcribe function changed. We can save some memory by // checking whether we scheduled a subscription effect above. Ir !== null && Ir.memoizedState.tag & Or) { p.flags |= Va, np(Or | Zr, fC.bind(null, p, z, b, a), void 0, null); var F = im(); if (F === null) throw new Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); rl(F, Su) || dC(p, a, b); } return b; } function dC(n, a, d) { n.flags |= Ju; var p = { getSnapshot: a, value: d }, v = yn.updateQueue; if (v === null) v = cC(), yn.updateQueue = v, v.stores = [p]; else { var b = v.stores; b === null ? v.stores = [p] : b.push(p); } } function fC(n, a, d, p) { a.value = d, a.getSnapshot = p, hC(a) && vC(n); } function pC(n, a, d) { var p = function() { hC(a) && vC(n); }; return d(p); } function hC(n) { var a = n.getSnapshot, d = n.value; try { var p = a(); return !or(d, p); } catch { return !0; } } function vC(n) { var a = Na(n, Tt); a !== null && Er(a, n, Tt, Cn); } function Sv(n) { var a = Mo(); typeof n == "function" && (n = n()), a.memoizedState = a.baseState = n; var d = { pending: null, interleaved: null, lanes: we, dispatch: null, lastRenderedReducer: Xy, lastRenderedState: n }; a.queue = d; var p = d.dispatch = CR.bind(null, yn, d); return [a.memoizedState, p]; } function e0(n) { return Qy(Xy); } function t0(n) { return Zy(Xy); } function np(n, a, d, p) { var v = { tag: n, create: a, destroy: d, deps: p, // Circular next: null }, b = yn.updateQueue; if (b === null) b = cC(), yn.updateQueue = b, b.lastEffect = v.next = v; else { var T = b.lastEffect; if (T === null) b.lastEffect = v.next = v; else { var _ = T.next; T.next = v, v.next = _, b.lastEffect = v; } } return v; } function n0(n) { var a = Mo(); { var d = { current: n }; return a.memoizedState = d, d; } } function bv(n) { var a = _i(); return a.memoizedState; } function rp(n, a, d, p) { var v = Mo(), b = p === void 0 ? null : p; yn.flags |= n, v.memoizedState = np(Or | a, d, void 0, b); } function Cv(n, a, d, p) { var v = _i(), b = p === void 0 ? null : p, T = void 0; if (zr !== null) { var _ = zr.memoizedState; if (T = _.destroy, b !== null) { var P = _.deps; if (Ky(b, P)) { v.memoizedState = np(a, d, T, b); return; } } } yn.flags |= n, v.memoizedState = np(Or | a, d, T, b); } function Ev(n, a) { return (yn.mode & ca) !== Ct ? rp(ec | Va | Qd, Zr, n, a) : rp(Va | Qd, Zr, n, a); } function ap(n, a) { return Cv(Va, Zr, n, a); } function r0(n, a) { return rp(Ft, _o, n, a); } function wv(n, a) { return Cv(Ft, _o, n, a); } function a0(n, a) { var d = Ft; return d |= Jo, (yn.mode & ca) !== Ct && (d |= zi), rp(d, Ar, n, a); } function jv(n, a) { return Cv(Ft, Ar, n, a); } function mC(n, a) { if (typeof a == "function") { var d = a, p = n(); return d(p), function() { d(null); }; } else if (a != null) { var v = a; v.hasOwnProperty("current") || g("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(v).join(", ") + "}"); var b = n(); return v.current = b, function() { v.current = null; }; } } function i0(n, a, d) { typeof a != "function" && g("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", a !== null ? typeof a : "null"); var p = d != null ? d.concat([n]) : null, v = Ft; return v |= Jo, (yn.mode & ca) !== Ct && (v |= zi), rp(v, Ar, mC.bind(null, a, n), p); } function Tv(n, a, d) { typeof a != "function" && g("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", a !== null ? typeof a : "null"); var p = d != null ? d.concat([n]) : null; return Cv(Ft, Ar, mC.bind(null, a, n), p); } function yR(n, a) { } var Dv = yR; function o0(n, a) { var d = Mo(), p = a === void 0 ? null : a; return d.memoizedState = [n, p], n; } function _v(n, a) { var d = _i(), p = a === void 0 ? null : a, v = d.memoizedState; if (v !== null && p !== null) { var b = v[1]; if (Ky(p, b)) return v[0]; } return d.memoizedState = [n, p], n; } function s0(n, a) { var d = Mo(), p = a === void 0 ? null : a, v = n(); return d.memoizedState = [v, p], v; } function Mv(n, a) { var d = _i(), p = a === void 0 ? null : a, v = d.memoizedState; if (v !== null && p !== null) { var b = v[1]; if (Ky(p, b)) return v[0]; } var T = n(); return d.memoizedState = [T, p], T; } function l0(n) { var a = Mo(); return a.memoizedState = n, n; } function gC(n) { var a = _i(), d = zr, p = d.memoizedState; return xC(a, p, n); } function yC(n) { var a = _i(); if (zr === null) return a.memoizedState = n, n; var d = zr.memoizedState; return xC(a, d, n); } function xC(n, a, d) { var p = !Ah(Su); if (p) { if (!or(d, a)) { var v = su(); yn.lanes = wt(yn.lanes, v), Cp(v), n.baseState = !0; } return a; } else return n.baseState && (n.baseState = !1, lp()), n.memoizedState = d, d; } function xR(n, a, d) { var p = fa(); nr(Lh(p, cs)), n(!0); var v = Jf.transition; Jf.transition = {}; var b = Jf.transition; Jf.transition._updatedFibers = /* @__PURE__ */ new Set(); try { n(!1), a(); } finally { if (nr(p), Jf.transition = v, v === null && b._updatedFibers) { var T = b._updatedFibers.size; T > 10 && y("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."), b._updatedFibers.clear(); } } } function u0() { var n = Sv(!1), a = n[0], d = n[1], p = xR.bind(null, d), v = Mo(); return v.memoizedState = p, [a, p]; } function SC() { var n = e0(), a = n[0], d = _i(), p = d.memoizedState; return [a, p]; } function bC() { var n = t0(), a = n[0], d = _i(), p = d.memoizedState; return [a, p]; } var CC = !1; function SR() { return CC; } function c0() { var n = Mo(), a = im(), d = a.identifierPrefix, p; if (h()) { var v = qh(); p = ":" + d + "R" + v; var b = tp++; b > 0 && (p += "H" + b.toString(32)), p += ":"; } else { var T = vR++; p = ":" + d + "r" + T.toString(32) + ":"; } return n.memoizedState = p, p; } function kv() { var n = _i(), a = n.memoizedState; return a; } function bR(n, a, d) { typeof arguments[3] == "function" && g("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."); var p = Cl(n), v = { lane: p, action: d, hasEagerState: !1, eagerState: null, next: null }; if (EC(n)) wC(a, v); else { var b = H1(n, a, v, p); if (b !== null) { var T = ga(); Er(b, n, p, T), jC(b, a, p); } } TC(n, p); } function CR(n, a, d) { typeof arguments[3] == "function" && g("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."); var p = Cl(n), v = { lane: p, action: d, hasEagerState: !1, eagerState: null, next: null }; if (EC(n)) wC(a, v); else { var b = n.alternate; if (n.lanes === we && (b === null || b.lanes === we)) { var T = a.lastRenderedReducer; if (T !== null) { var _; _ = et.current, et.current = Ji; try { var P = a.lastRenderedState, z = T(P, d); if (v.hasEagerState = !0, v.eagerState = z, or(z, P)) { eR(n, a, v, p); return; } } catch { } finally { et.current = _; } } } var F = H1(n, a, v, p); if (F !== null) { var X = ga(); Er(F, n, p, X), jC(F, a, p); } } TC(n, p); } function EC(n) { var a = n.alternate; return n === yn || a !== null && a === yn; } function wC(n, a) { ep = yv = !0; var d = n.pending; d === null ? a.next = a : (a.next = d.next, d.next = a), n.pending = a; } function jC(n, a, d) { if (zc(d)) { var p = a.lanes; p = ol(p, n.pendingLanes); var v = wt(p, d); a.lanes = v, Of(n, v); } } function TC(n, a, d) { wi(n, a); } var Rv = { readContext: br, useCallback: ma, useContext: ma, useEffect: ma, useImperativeHandle: ma, useInsertionEffect: ma, useLayoutEffect: ma, useMemo: ma, useReducer: ma, useRef: ma, useState: ma, useDebugValue: ma, useDeferredValue: ma, useTransition: ma, useMutableSource: ma, useSyncExternalStore: ma, useId: ma, unstable_isNewReconciler: M }, DC = null, _C = null, MC = null, kC = null, ko = null, Ji = null, Pv = null; { var d0 = function() { g("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."); }, Nt = function() { g("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks"); }; DC = { readContext: function(n) { return br(n); }, useCallback: function(n, a) { return ge = "useCallback", fn(), id(a), o0(n, a); }, useContext: function(n) { return ge = "useContext", fn(), br(n); }, useEffect: function(n, a) { return ge = "useEffect", fn(), id(a), Ev(n, a); }, useImperativeHandle: function(n, a, d) { return ge = "useImperativeHandle", fn(), id(d), i0(n, a, d); }, useInsertionEffect: function(n, a) { return ge = "useInsertionEffect", fn(), id(a), r0(n, a); }, useLayoutEffect: function(n, a) { return ge = "useLayoutEffect", fn(), id(a), a0(n, a); }, useMemo: function(n, a) { ge = "useMemo", fn(), id(a); var d = et.current; et.current = ko; try { return s0(n, a); } finally { et.current = d; } }, useReducer: function(n, a, d) { ge = "useReducer", fn(); var p = et.current; et.current = ko; try { return $y(n, a, d); } finally { et.current = p; } }, useRef: function(n) { return ge = "useRef", fn(), n0(n); }, useState: function(n) { ge = "useState", fn(); var a = et.current; et.current = ko; try { return Sv(n); } finally { et.current = a; } }, useDebugValue: function(n, a) { return ge = "useDebugValue", fn(), void 0; }, useDeferredValue: function(n) { return ge = "useDeferredValue", fn(), l0(n); }, useTransition: function() { return ge = "useTransition", fn(), u0(); }, useMutableSource: function(n, a, d) { return ge = "useMutableSource", fn(), void 0; }, useSyncExternalStore: function(n, a, d) { return ge = "useSyncExternalStore", fn(), Jy(n, a, d); }, useId: function() { return ge = "useId", fn(), c0(); }, unstable_isNewReconciler: M }, _C = { readContext: function(n) { return br(n); }, useCallback: function(n, a) { return ge = "useCallback", Ve(), o0(n, a); }, useContext: function(n) { return ge = "useContext", Ve(), br(n); }, useEffect: function(n, a) { return ge = "useEffect", Ve(), Ev(n, a); }, useImperativeHandle: function(n, a, d) { return ge = "useImperativeHandle", Ve(), i0(n, a, d); }, useInsertionEffect: function(n, a) { return ge = "useInsertionEffect", Ve(), r0(n, a); }, useLayoutEffect: function(n, a) { return ge = "useLayoutEffect", Ve(), a0(n, a); }, useMemo: function(n, a) { ge = "useMemo", Ve(); var d = et.current; et.current = ko; try { return s0(n, a); } finally { et.current = d; } }, useReducer: function(n, a, d) { ge = "useReducer", Ve(); var p = et.current; et.current = ko; try { return $y(n, a, d); } finally { et.current = p; } }, useRef: function(n) { return ge = "useRef", Ve(), n0(n); }, useState: function(n) { ge = "useState", Ve(); var a = et.current; et.current = ko; try { return Sv(n); } finally { et.current = a; } }, useDebugValue: function(n, a) { return ge = "useDebugValue", Ve(), void 0; }, useDeferredValue: function(n) { return ge = "useDeferredValue", Ve(), l0(n); }, useTransition: function() { return ge = "useTransition", Ve(), u0(); }, useMutableSource: function(n, a, d) { return ge = "useMutableSource", Ve(), void 0; }, useSyncExternalStore: function(n, a, d) { return ge = "useSyncExternalStore", Ve(), Jy(n, a, d); }, useId: function() { return ge = "useId", Ve(), c0(); }, unstable_isNewReconciler: M }, MC = { readContext: function(n) { return br(n); }, useCallback: function(n, a) { return ge = "useCallback", Ve(), _v(n, a); }, useContext: function(n) { return ge = "useContext", Ve(), br(n); }, useEffect: function(n, a) { return ge = "useEffect", Ve(), ap(n, a); }, useImperativeHandle: function(n, a, d) { return ge = "useImperativeHandle", Ve(), Tv(n, a, d); }, useInsertionEffect: function(n, a) { return ge = "useInsertionEffect", Ve(), wv(n, a); }, useLayoutEffect: function(n, a) { return ge = "useLayoutEffect", Ve(), jv(n, a); }, useMemo: function(n, a) { ge = "useMemo", Ve(); var d = et.current; et.current = Ji; try { return Mv(n, a); } finally { et.current = d; } }, useReducer: function(n, a, d) { ge = "useReducer", Ve(); var p = et.current; et.current = Ji; try { return Qy(n, a, d); } finally { et.current = p; } }, useRef: function(n) { return ge = "useRef", Ve(), bv(); }, useState: function(n) { ge = "useState", Ve(); var a = et.current; et.current = Ji; try { return e0(n); } finally { et.current = a; } }, useDebugValue: function(n, a) { return ge = "useDebugValue", Ve(), Dv(); }, useDeferredValue: function(n) { return ge = "useDeferredValue", Ve(), gC(n); }, useTransition: function() { return ge = "useTransition", Ve(), SC(); }, useMutableSource: function(n, a, d) { return ge = "useMutableSource", Ve(), void 0; }, useSyncExternalStore: function(n, a, d) { return ge = "useSyncExternalStore", Ve(), xv(n, a); }, useId: function() { return ge = "useId", Ve(), kv(); }, unstable_isNewReconciler: M }, kC = { readContext: function(n) { return br(n); }, useCallback: function(n, a) { return ge = "useCallback", Ve(), _v(n, a); }, useContext: function(n) { return ge = "useContext", Ve(), br(n); }, useEffect: function(n, a) { return ge = "useEffect", Ve(), ap(n, a); }, useImperativeHandle: function(n, a, d) { return ge = "useImperativeHandle", Ve(), Tv(n, a, d); }, useInsertionEffect: function(n, a) { return ge = "useInsertionEffect", Ve(), wv(n, a); }, useLayoutEffect: function(n, a) { return ge = "useLayoutEffect", Ve(), jv(n, a); }, useMemo: function(n, a) { ge = "useMemo", Ve(); var d = et.current; et.current = Pv; try { return Mv(n, a); } finally { et.current = d; } }, useReducer: function(n, a, d) { ge = "useReducer", Ve(); var p = et.current; et.current = Pv; try { return Zy(n, a, d); } finally { et.current = p; } }, useRef: function(n) { return ge = "useRef", Ve(), bv(); }, useState: function(n) { ge = "useState", Ve(); var a = et.current; et.current = Pv; try { return t0(n); } finally { et.current = a; } }, useDebugValue: function(n, a) { return ge = "useDebugValue", Ve(), Dv(); }, useDeferredValue: function(n) { return ge = "useDeferredValue", Ve(), yC(n); }, useTransition: function() { return ge = "useTransition", Ve(), bC(); }, useMutableSource: function(n, a, d) { return ge = "useMutableSource", Ve(), void 0; }, useSyncExternalStore: function(n, a, d) { return ge = "useSyncExternalStore", Ve(), xv(n, a); }, useId: function() { return ge = "useId", Ve(), kv(); }, unstable_isNewReconciler: M }, ko = { readContext: function(n) { return d0(), br(n); }, useCallback: function(n, a) { return ge = "useCallback", Nt(), fn(), o0(n, a); }, useContext: function(n) { return ge = "useContext", Nt(), fn(), br(n); }, useEffect: function(n, a) { return ge = "useEffect", Nt(), fn(), Ev(n, a); }, useImperativeHandle: function(n, a, d) { return ge = "useImperativeHandle", Nt(), fn(), i0(n, a, d); }, useInsertionEffect: function(n, a) { return ge = "useInsertionEffect", Nt(), fn(), r0(n, a); }, useLayoutEffect: function(n, a) { return ge = "useLayoutEffect", Nt(), fn(), a0(n, a); }, useMemo: function(n, a) { ge = "useMemo", Nt(), fn(); var d = et.current; et.current = ko; try { return s0(n, a); } finally { et.current = d; } }, useReducer: function(n, a, d) { ge = "useReducer", Nt(), fn(); var p = et.current; et.current = ko; try { return $y(n, a, d); } finally { et.current = p; } }, useRef: function(n) { return ge = "useRef", Nt(), fn(), n0(n); }, useState: function(n) { ge = "useState", Nt(), fn(); var a = et.current; et.current = ko; try { return Sv(n); } finally { et.current = a; } }, useDebugValue: function(n, a) { return ge = "useDebugValue", Nt(), fn(), void 0; }, useDeferredValue: function(n) { return ge = "useDeferredValue", Nt(), fn(), l0(n); }, useTransition: function() { return ge = "useTransition", Nt(), fn(), u0(); }, useMutableSource: function(n, a, d) { return ge = "useMutableSource", Nt(), fn(), void 0; }, useSyncExternalStore: function(n, a, d) { return ge = "useSyncExternalStore", Nt(), fn(), Jy(n, a, d); }, useId: function() { return ge = "useId", Nt(), fn(), c0(); }, unstable_isNewReconciler: M }, Ji = { readContext: function(n) { return d0(), br(n); }, useCallback: function(n, a) { return ge = "useCallback", Nt(), Ve(), _v(n, a); }, useContext: function(n) { return ge = "useContext", Nt(), Ve(), br(n); }, useEffect: function(n, a) { return ge = "useEffect", Nt(), Ve(), ap(n, a); }, useImperativeHandle: function(n, a, d) { return ge = "useImperativeHandle", Nt(), Ve(), Tv(n, a, d); }, useInsertionEffect: function(n, a) { return ge = "useInsertionEffect", Nt(), Ve(), wv(n, a); }, useLayoutEffect: function(n, a) { return ge = "useLayoutEffect", Nt(), Ve(), jv(n, a); }, useMemo: function(n, a) { ge = "useMemo", Nt(), Ve(); var d = et.current; et.current = Ji; try { return Mv(n, a); } finally { et.current = d; } }, useReducer: function(n, a, d) { ge = "useReducer", Nt(), Ve(); var p = et.current; et.current = Ji; try { return Qy(n, a, d); } finally { et.current = p; } }, useRef: function(n) { return ge = "useRef", Nt(), Ve(), bv(); }, useState: function(n) { ge = "useState", Nt(), Ve(); var a = et.current; et.current = Ji; try { return e0(n); } finally { et.current = a; } }, useDebugValue: function(n, a) { return ge = "useDebugValue", Nt(), Ve(), Dv(); }, useDeferredValue: function(n) { return ge = "useDeferredValue", Nt(), Ve(), gC(n); }, useTransition: function() { return ge = "useTransition", Nt(), Ve(), SC(); }, useMutableSource: function(n, a, d) { return ge = "useMutableSource", Nt(), Ve(), void 0; }, useSyncExternalStore: function(n, a, d) { return ge = "useSyncExternalStore", Nt(), Ve(), xv(n, a); }, useId: function() { return ge = "useId", Nt(), Ve(), kv(); }, unstable_isNewReconciler: M }, Pv = { readContext: function(n) { return d0(), br(n); }, useCallback: function(n, a) { return ge = "useCallback", Nt(), Ve(), _v(n, a); }, useContext: function(n) { return ge = "useContext", Nt(), Ve(), br(n); }, useEffect: function(n, a) { return ge = "useEffect", Nt(), Ve(), ap(n, a); }, useImperativeHandle: function(n, a, d) { return ge = "useImperativeHandle", Nt(), Ve(), Tv(n, a, d); }, useInsertionEffect: function(n, a) { return ge = "useInsertionEffect", Nt(), Ve(), wv(n, a); }, useLayoutEffect: function(n, a) { return ge = "useLayoutEffect", Nt(), Ve(), jv(n, a); }, useMemo: function(n, a) { ge = "useMemo", Nt(), Ve(); var d = et.current; et.current = Ji; try { return Mv(n, a); } finally { et.current = d; } }, useReducer: function(n, a, d) { ge = "useReducer", Nt(), Ve(); var p = et.current; et.current = Ji; try { return Zy(n, a, d); } finally { et.current = p; } }, useRef: function(n) { return ge = "useRef", Nt(), Ve(), bv(); }, useState: function(n) { ge = "useState", Nt(), Ve(); var a = et.current; et.current = Ji; try { return t0(n); } finally { et.current = a; } }, useDebugValue: function(n, a) { return ge = "useDebugValue", Nt(), Ve(), Dv(); }, useDeferredValue: function(n) { return ge = "useDeferredValue", Nt(), Ve(), yC(n); }, useTransition: function() { return ge = "useTransition", Nt(), Ve(), bC(); }, useMutableSource: function(n, a, d) { return ge = "useMutableSource", Nt(), Ve(), void 0; }, useSyncExternalStore: function(n, a, d) { return ge = "useSyncExternalStore", Nt(), Ve(), xv(n, a); }, useId: function() { return ge = "useId", Nt(), Ve(), kv(); }, unstable_isNewReconciler: M }; } var xl = s.unstable_now, RC = 0, Nv = -1, ip = -1, Ov = -1, f0 = !1, Av = !1; function PC() { return f0; } function ER() { Av = !0; } function wR() { f0 = !1, Av = !1; } function jR() { f0 = Av, Av = !1; } function NC() { return RC; } function OC() { RC = xl(); } function p0(n) { ip = xl(), n.actualStartTime < 0 && (n.actualStartTime = xl()); } function AC(n) { ip = -1; } function zv(n, a) { if (ip >= 0) { var d = xl() - ip; n.actualDuration += d, a && (n.selfBaseDuration = d), ip = -1; } } function Ro(n) { if (Nv >= 0) { var a = xl() - Nv; Nv = -1; for (var d = n.return; d !== null; ) { switch (d.tag) { case ae: var p = d.stateNode; p.effectDuration += a; return; case K: var v = d.stateNode; v.effectDuration += a; return; } d = d.return; } } } function h0(n) { if (Ov >= 0) { var a = xl() - Ov; Ov = -1; for (var d = n.return; d !== null; ) { switch (d.tag) { case ae: var p = d.stateNode; p !== null && (p.passiveEffectDuration += a); return; case K: var v = d.stateNode; v !== null && (v.passiveEffectDuration += a); return; } d = d.return; } } } function Po() { Nv = xl(); } function v0() { Ov = xl(); } function m0(n) { for (var a = n.child; a; ) n.actualDuration += a.actualDuration, a = a.sibling; } function bu(n, a) { return { value: n, source: a, stack: Oe(a), digest: null }; } function g0(n, a, d) { return { value: n, source: null, stack: d ?? null, digest: a ?? null }; } function TR(n, a) { return !0; } function y0(n, a) { try { var d = TR(n, a); if (d === !1) return; var p = a.value, v = a.source, b = a.stack, T = b !== null ? b : ""; if (p != null && p._suppressLogging) { if (n.tag === U) return; console.error(p); } var _ = v ? st(v) : null, P = _ ? "The above error occurred in the <" + _ + "> component:" : "The above error occurred in one of your React components:", z; if (n.tag === ae) z = `Consider adding an error boundary to your tree to customize error handling behavior. Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.`; else { var F = st(n) || "Anonymous"; z = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + F + "."); } var X = P + ` ` + T + ` ` + ("" + z); console.error(X); } catch (le) { setTimeout(function() { throw le; }); } } var DR = typeof WeakMap == "function" ? WeakMap : Map; function zC(n, a, d) { var p = bs(Cn, d); p.tag = yy, p.payload = { element: null }; var v = a.value; return p.callback = function() { zN(v), y0(n, a); }, p; } function x0(n, a, d) { var p = bs(Cn, d); p.tag = yy; var v = n.type.getDerivedStateFromError; if (typeof v == "function") { var b = a.value; p.payload = function() { return v(b); }, p.callback = function() { KE(n), y0(n, a); }; } var T = n.stateNode; return T !== null && typeof T.componentDidCatch == "function" && (p.callback = function() { KE(n), y0(n, a), typeof v != "function" && ON(this); var P = a.value, z = a.stack; this.componentDidCatch(P, { componentStack: z !== null ? z : "" }), typeof v != "function" && ($n(n.lanes, Tt) || g("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", st(n) || "Unknown")); }), p; } function IC(n, a, d) { var p = n.pingCache, v; if (p === null ? (p = n.pingCache = new DR(), v = /* @__PURE__ */ new Set(), p.set(a, v)) : (v = p.get(a), v === void 0 && (v = /* @__PURE__ */ new Set(), p.set(a, v))), !v.has(d)) { v.add(d); var b = IN.bind(null, n, a, d); ha && Ep(n, d), a.then(b, b); } } function _R(n, a, d, p) { var v = n.updateQueue; if (v === null) { var b = /* @__PURE__ */ new Set(); b.add(d), n.updateQueue = b; } else v.add(d); } function MR(n, a) { var d = n.tag; if ((n.mode & qt) === Ct && (d === q || d === te || d === re)) { var p = n.alternate; p ? (n.updateQueue = p.updateQueue, n.memoizedState = p.memoizedState, n.lanes = p.lanes) : (n.updateQueue = null, n.memoizedState = null); } } function FC(n) { var a = n; do { if (a.tag === se && pR(a)) return a; a = a.return; } while (a !== null); return null; } function LC(n, a, d, p, v) { if ((n.mode & qt) === Ct) { if (n === a) n.flags |= Kr; else { if (n.flags |= tn, d.flags |= Ls, d.flags &= ~(fh | Gl), d.tag === U) { var b = d.alternate; if (b === null) d.tag = De; else { var T = bs(Cn, Tt); T.tag = ov, vl(d, T, Tt); } } d.lanes = wt(d.lanes, Tt); } return n; } return n.flags |= Kr, n.lanes = v, n; } function kR(n, a, d, p, v) { if (d.flags |= Gl, ha && Ep(n, v), p !== null && typeof p == "object" && typeof p.then == "function") { var b = p; MR(d), h() && d.mode & qt && Gf(); var T = FC(a); if (T !== null) { T.flags &= ~Oi, LC(T, a, d, n, v), T.mode & qt && IC(n, b, v), _R(T, n, b); return; } else { if (!Oh(v)) { IC(n, b, v), nx(); return; } var _ = new Error("A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition."); p = _; } } else if (h() && d.mode & qt) { Gf(); var P = FC(a); if (P !== null) { (P.flags & Kr) === rt && (P.flags |= Oi), LC(P, a, d, n, v), x(bu(p, d)); return; } } p = bu(p, d), TN(p); var z = a; do { switch (z.tag) { case ae: { var F = p; z.flags |= Kr; var X = us(v); z.lanes = wt(z.lanes, X); var le = zC(z, F, X); by(z, le); return; } case U: var ye = p, je = z.type, Ee = z.stateNode; if ((z.flags & tn) === rt && (typeof je.getDerivedStateFromError == "function" || Ee !== null && typeof Ee.componentDidCatch == "function" && !LE(Ee))) { z.flags |= Kr; var gt = us(v); z.lanes = wt(z.lanes, gt); var Mt = x0(z, ye, gt); by(z, Mt); return; } break; } z = z.return; } while (z !== null); } function RR() { return null; } var op = c.ReactCurrentOwner, eo = !1, S0, sp, b0, C0, E0, Cu, w0, Iv; S0 = {}, sp = {}, b0 = {}, C0 = {}, E0 = {}, Cu = !1, w0 = {}, Iv = {}; function Oa(n, a, d, p) { n === null ? a.child = aC(a, null, d, p) : a.child = ed(a, n.child, d, p); } function PR(n, a, d, p) { a.child = ed(a, n.child, null, p), a.child = ed(a, null, d, p); } function BC(n, a, d, p, v) { if (a.type !== a.elementType) { var b = d.propTypes; b && qa( b, p, // Resolved props "prop", ft(d) ); } var T = d.render, _ = a.ref, P, z; Jc(a, v), fs(a); { if (op.current = a, G(!0), P = od(n, a, T, p, _, v), z = sd(), a.mode & cn) { rr(!0); try { P = od(n, a, T, p, _, v), z = sd(); } finally { rr(!1); } } G(!1); } return _n(), n !== null && !eo ? (lC(n, a, v), Cs(n, a, v)) : (h() && z && Wf(a), a.flags |= kn, Oa(n, a, P, v), a.child); } function UC(n, a, d, p, v) { if (n === null) { var b = d.type; if (eO(b) && d.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either. d.defaultProps === void 0) { var T = b; return T = vd(b), a.tag = re, a.type = T, D0(a, b), HC(n, a, T, p, v); } { var _ = b.propTypes; _ && qa( _, p, // Resolved props "prop", ft(b) ); } var P = fx(d.type, null, p, a, a.mode, v); return P.ref = a.ref, P.return = a, a.child = P, P; } { var z = d.type, F = z.propTypes; F && qa( F, p, // Resolved props "prop", ft(z) ); } var X = n.child, le = N0(n, v); if (!le) { var ye = X.memoizedProps, je = d.compare; if (je = je !== null ? je : V, je(ye, p) && n.ref === a.ref) return Cs(n, a, v); } a.flags |= kn; var Ee = Du(X, p); return Ee.ref = a.ref, Ee.return = a, a.child = Ee, Ee; } function HC(n, a, d, p, v) { if (a.type !== a.elementType) { var b = a.elementType; if (b.$$typeof === Fe) { var T = b, _ = T._payload, P = T._init; try { b = P(_); } catch { b = null; } var z = b && b.propTypes; z && qa( z, p, // Resolved (SimpleMemoComponent has no defaultProps) "prop", ft(b) ); } } if (n !== null) { var F = n.memoizedProps; if (V(F, p) && n.ref === a.ref && // Prevent bailout if the implementation changed due to hot reload. a.type === n.type) if (eo = !1, a.pendingProps = p = F, N0(n, v)) (n.flags & Ls) !== rt && (eo = !0); else return a.lanes = n.lanes, Cs(n, a, v); } return j0(n, a, d, p, v); } function VC(n, a, d) { var p = a.pendingProps, v = p.children, b = n !== null ? n.memoizedState : null; if (p.mode === "hidden" || R) if ((a.mode & qt) === Ct) { var T = { baseLanes: we, cachePool: null, transitions: null }; a.memoizedState = T, sm(a, d); } else if ($n(d, da)) { var X = { baseLanes: we, cachePool: null, transitions: null }; a.memoizedState = X; var le = b !== null ? b.baseLanes : d; sm(a, le); } else { var _ = null, P; if (b !== null) { var z = b.baseLanes; P = wt(z, d); } else P = d; a.lanes = a.childLanes = da; var F = { baseLanes: P, cachePool: _, transitions: null }; return a.memoizedState = F, a.updateQueue = null, sm(a, P), null; } else { var ye; b !== null ? (ye = wt(b.baseLanes, d), a.memoizedState = null) : ye = d, sm(a, ye); } return Oa(n, a, v, d), a.child; } function NR(n, a, d) { var p = a.pendingProps; return Oa(n, a, p, d), a.child; } function OR(n, a, d) { var p = a.pendingProps.children; return Oa(n, a, p, d), a.child; } function AR(n, a, d) { { a.flags |= Ft; { var p = a.stateNode; p.effectDuration = 0, p.passiveEffectDuration = 0; } } var v = a.pendingProps, b = v.children; return Oa(n, a, b, d), a.child; } function WC(n, a) { var d = a.ref; (n === null && d !== null || n !== null && n.ref !== d) && (a.flags |= gi, a.flags |= $d); } function j0(n, a, d, p, v) { if (a.type !== a.elementType) { var b = d.propTypes; b && qa( b, p, // Resolved props "prop", ft(d) ); } var T; { var _ = yo(a, d, !0); T = Wi(a, _); } var P, z; Jc(a, v), fs(a); { if (op.current = a, G(!0), P = od(n, a, d, p, T, v), z = sd(), a.mode & cn) { rr(!0); try { P = od(n, a, d, p, T, v), z = sd(); } finally { rr(!1); } } G(!1); } return _n(), n !== null && !eo ? (lC(n, a, v), Cs(n, a, v)) : (h() && z && Wf(a), a.flags |= kn, Oa(n, a, P, v), a.child); } function GC(n, a, d, p, v) { { switch (rw(a)) { case !1: { var b = a.stateNode, T = a.type, _ = new T(a.memoizedProps, b.context), P = _.state; b.updater.enqueueSetState(b, P, null); break; } case !0: { a.flags |= tn, a.flags |= Kr; var z = new Error("Simulated error coming from DevTools"), F = us(v); a.lanes = wt(a.lanes, F); var X = x0(a, bu(z, a), F); by(a, X); break; } } if (a.type !== a.elementType) { var le = d.propTypes; le && qa( le, p, // Resolved props "prop", ft(d) ); } } var ye; Gr(d) ? (ye = !0, xo(a)) : ye = !1, Jc(a, v); var je = a.stateNode, Ee; je === null ? (Lv(n, a), J1(a, d, p), Ny(a, d, p, v), Ee = !0) : n === null ? Ee = sR(a, d, p, v) : Ee = lR(n, a, d, p, v); var gt = T0(n, a, d, Ee, ye, v); { var Mt = a.stateNode; Ee && Mt.props !== p && (Cu || g("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", st(a) || "a component"), Cu = !0); } return gt; } function T0(n, a, d, p, v, b) { WC(n, a); var T = (a.flags & tn) !== rt; if (!p && !T) return v && el(a, d, !1), Cs(n, a, b); var _ = a.stateNode; op.current = a; var P; if (T && typeof d.getDerivedStateFromError != "function") P = null, AC(); else { fs(a); { if (G(!0), P = _.render(), a.mode & cn) { rr(!0); try { _.render(); } finally { rr(!1); } } G(!1); } _n(); } return a.flags |= kn, n !== null && T ? PR(n, a, P, b) : Oa(n, a, P, b), a.memoizedState = _.state, v && el(a, d, !0), a.child; } function qC(n) { var a = n.stateNode; a.pendingContext ? dr(n, a.pendingContext, a.pendingContext !== a.context) : a.context && dr(n, a.context, !1), By(n, a.containerInfo); } function zR(n, a, d) { if (qC(a), n === null) throw new Error("Should have a current fiber. This is a bug in React."); var p = a.pendingProps, v = a.memoizedState, b = v.element; G1(n, a), cv(a, p, null, d); var T = a.memoizedState; a.stateNode; var _ = T.element; if (Vr && v.isDehydrated) { var P = { element: _, isDehydrated: !1, cache: T.cache, pendingSuspenseBoundaries: T.pendingSuspenseBoundaries, transitions: T.transitions }, z = a.updateQueue; if (z.baseState = P, a.memoizedState = P, a.flags & Oi) { var F = bu(new Error("There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering."), a); return YC(n, a, _, d, F); } else if (_ !== b) { var X = bu(new Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."), a); return YC(n, a, _, d, X); } else { cy(a); var le = aC(a, null, _, d); a.child = le; for (var ye = le; ye; ) ye.flags = ye.flags & ~bn | Ai, ye = ye.sibling; } } else { if (o(), _ === b) return Cs(n, a, d); Oa(n, a, _, d); } return a.child; } function YC(n, a, d, p, v) { return o(), x(v), a.flags |= Oi, Oa(n, a, d, p), a.child; } function IR(n, a, d) { iC(a), n === null && yu(a); var p = a.type, v = a.pendingProps, b = n !== null ? n.memoizedProps : null, T = v.children, _ = rc(p, v); return _ ? T = null : b !== null && rc(p, b) && (a.flags |= Wl), WC(n, a), Oa(n, a, T, d), a.child; } function FR(n, a) { return n === null && yu(a), null; } function LR(n, a, d, p) { Lv(n, a); var v = a.pendingProps, b = d, T = b._payload, _ = b._init, P = _(T); a.type = P; var z = a.tag = tO(P), F = Qi(P, v), X; switch (z) { case q: return D0(a, P), a.type = P = vd(P), X = j0(null, a, P, F, p), X; case U: return a.type = P = ox(P), X = GC(null, a, P, F, p), X; case te: return a.type = P = sx(P), X = BC(null, a, P, F, p), X; case B: { if (a.type !== a.elementType) { var le = P.propTypes; le && qa( le, F, // Resolved for outer only "prop", ft(P) ); } return X = UC( null, a, P, Qi(P.type, F), // The inner type can have defaults too p ), X; } } var ye = ""; throw P !== null && typeof P == "object" && P.$$typeof === Fe && (ye = " Did you wrap a component in React.lazy() more than once?"), new Error("Element type is invalid. Received a promise that resolves to: " + P + ". " + ("Lazy element type must resolve to a class or function." + ye)); } function BR(n, a, d, p, v) { Lv(n, a), a.tag = U; var b; return Gr(d) ? (b = !0, xo(a)) : b = !1, Jc(a, v), J1(a, d, p), Ny(a, d, p, v), T0(null, a, d, !0, b, v); } function UR(n, a, d, p) { Lv(n, a); var v = a.pendingProps, b; { var T = yo(a, d, !1); b = Wi(a, T); } Jc(a, p); var _, P; fs(a); { if (d.prototype && typeof d.prototype.render == "function") { var z = ft(d) || "Unknown"; S0[z] || (g("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", z, z), S0[z] = !0); } a.mode & cn && ce.recordLegacyContextWarning(a, null), G(!0), op.current = a, _ = od(null, a, d, v, b, p), P = sd(), G(!1); } if (_n(), a.flags |= kn, typeof _ == "object" && _ !== null && typeof _.render == "function" && _.$$typeof === void 0) { var F = ft(d) || "Unknown"; sp[F] || (g("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", F, F, F), sp[F] = !0); } if ( // Run these checks in production only if the flag is off. // Eventually we'll delete this branch altogether. typeof _ == "object" && _ !== null && typeof _.render == "function" && _.$$typeof === void 0 ) { { var X = ft(d) || "Unknown"; sp[X] || (g("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", X, X, X), sp[X] = !0); } a.tag = U, a.memoizedState = null, a.updateQueue = null; var le = !1; return Gr(d) ? (le = !0, xo(a)) : le = !1, a.memoizedState = _.state !== null && _.state !== void 0 ? _.state : null, Sy(a), Z1(a, _), Ny(a, d, v, p), T0(null, a, d, !0, le, p); } else { if (a.tag = q, a.mode & cn) { rr(!0); try { _ = od(null, a, d, v, b, p), P = sd(); } finally { rr(!1); } } return h() && P && Wf(a), Oa(null, a, _, p), D0(a, d), a.child; } } function D0(n, a) { { if (a && a.childContextTypes && g("%s(...): childContextTypes cannot be defined on a function component.", a.displayName || a.name || "Component"), n.ref !== null) { var d = "", p = Pn(); p && (d += ` Check the render method of \`` + p + "`."); var v = p || "", b = n._debugSource; b && (v = b.fileName + ":" + b.lineNumber), E0[v] || (E0[v] = !0, g("Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s", d)); } if (typeof a.getDerivedStateFromProps == "function") { var T = ft(a) || "Unknown"; C0[T] || (g("%s: Function components do not support getDerivedStateFromProps.", T), C0[T] = !0); } if (typeof a.contextType == "object" && a.contextType !== null) { var _ = ft(a) || "Unknown"; b0[_] || (g("%s: Function components do not support contextType.", _), b0[_] = !0); } } } var _0 = { dehydrated: null, treeContext: null, retryLane: fr }; function M0(n) { return { baseLanes: n, cachePool: RR(), transitions: null }; } function HR(n, a) { var d = null; return { baseLanes: wt(n.baseLanes, a), cachePool: d, transitions: n.transitions }; } function VR(n, a, d, p) { if (a !== null) { var v = a.memoizedState; if (v === null) return !1; } return Hy(n, Zf); } function WR(n, a) { return lu(n.childLanes, a); } function KC(n, a, d) { var p = a.pendingProps; iw(a) && (a.flags |= tn); var v = Zi.current, b = !1, T = (a.flags & tn) !== rt; if (T || VR(v, n) ? (b = !0, a.flags &= ~tn) : (n === null || n.memoizedState !== null) && (v = fR(v, sC)), v = nd(v), gl(a, v), n === null) { yu(a); var _ = a.memoizedState; if (_ !== null) { var P = _.dehydrated; if (P !== null) return XR(a, P); } var z = p.children, F = p.fallback; if (b) { var X = GR(a, z, F, d), le = a.child; return le.memoizedState = M0(d), a.memoizedState = _0, X; } else return k0(a, z); } else { var ye = n.memoizedState; if (ye !== null) { var je = ye.dehydrated; if (je !== null) return $R(n, a, T, p, je, ye, d); } if (b) { var Ee = p.fallback, gt = p.children, Mt = YR(n, a, gt, Ee, d), bt = a.child, xn = n.child.memoizedState; return bt.memoizedState = xn === null ? M0(d) : HR(xn, d), bt.childLanes = WR(n, d), a.memoizedState = _0, Mt; } else { var nn = p.children, J = qR(n, a, nn, d); return a.memoizedState = null, J; } } } function k0(n, a, d) { var p = n.mode, v = { mode: "visible", children: a }, b = R0(v, p); return b.return = n, n.child = b, b; } function GR(n, a, d, p) { var v = n.mode, b = n.child, T = { mode: "hidden", children: a }, _, P; return (v & qt) === Ct && b !== null ? (_ = b, _.childLanes = we, _.pendingProps = T, n.mode & Lt && (_.actualDuration = 0, _.actualStartTime = -1, _.selfBaseDuration = 0, _.treeBaseDuration = 0), P = wl(d, v, p, null)) : (_ = R0(T, v), P = wl(d, v, p, null)), _.return = n, P.return = n, _.sibling = P, n.child = _, P; } function R0(n, a, d) { return $E(n, a, we, null); } function XC(n, a) { return Du(n, a); } function qR(n, a, d, p) { var v = n.child, b = v.sibling, T = XC(v, { mode: "visible", children: d }); if ((a.mode & qt) === Ct && (T.lanes = p), T.return = a, T.sibling = null, b !== null) { var _ = a.deletions; _ === null ? (a.deletions = [b], a.flags |= sa) : _.push(b); } return a.child = T, T; } function YR(n, a, d, p, v) { var b = a.mode, T = n.child, _ = T.sibling, P = { mode: "hidden", children: d }, z; if ( // In legacy mode, we commit the primary tree as if it successfully // completed, even though it's in an inconsistent state. (b & qt) === Ct && // Make sure we're on the second pass, i.e. the primary child fragment was // already cloned. In legacy mode, the only case where this isn't true is // when DevTools forces us to display a fallback; we skip the first render // pass entirely and go straight to rendering the fallback. (In Concurrent // Mode, SuspenseList can also trigger this scenario, but this is a legacy- // only codepath.) a.child !== T ) { var F = a.child; z = F, z.childLanes = we, z.pendingProps = P, a.mode & Lt && (z.actualDuration = 0, z.actualStartTime = -1, z.selfBaseDuration = T.selfBaseDuration, z.treeBaseDuration = T.treeBaseDuration), a.deletions = null; } else z = XC(T, P), z.subtreeFlags = T.subtreeFlags & Ii; var X; return _ !== null ? X = Du(_, p) : (X = wl(p, b, v, null), X.flags |= bn), X.return = a, z.return = a, z.sibling = X, a.child = z, X; } function Fv(n, a, d, p) { p !== null && x(p), ed(a, n.child, null, d); var v = a.pendingProps, b = v.children, T = k0(a, b); return T.flags |= bn, a.memoizedState = null, T; } function KR(n, a, d, p, v) { var b = a.mode, T = { mode: "visible", children: d }, _ = R0(T, b), P = wl(p, b, v, null); return P.flags |= bn, _.return = a, P.return = a, _.sibling = P, a.child = _, (a.mode & qt) !== Ct && ed(a, n.child, null, v), P; } function XR(n, a, d) { return (n.mode & qt) === Ct ? (g("Cannot hydrate Suspense in legacy mode. Switch from ReactDOM.hydrate(element, container) to ReactDOMClient.hydrateRoot(container, ).render(element) or remove the Suspense components from the server rendered components."), n.lanes = Tt) : Bi(a) ? n.lanes = ci : n.lanes = da, null; } function $R(n, a, d, p, v, b, T) { if (d) if (a.flags & Oi) { a.flags &= ~Oi; var J = g0(new Error("There was an error while hydrating this Suspense boundary. Switched to client rendering.")); return Fv(n, a, T, J); } else { if (a.memoizedState !== null) return a.child = n.child, a.flags |= tn, null; var me = p.children, Z = p.fallback, ze = KR(n, a, me, Z, T), vt = a.child; return vt.memoizedState = M0(T), a.memoizedState = _0, ze; } else { if (uy(), (a.mode & qt) === Ct) return Fv( n, a, T, // TODO: When we delete legacy mode, we should make this error argument // required — every concurrent mode path that causes hydration to // de-opt to client rendering should have an error message. null ); if (Bi(v)) { var _, P, z; { var F = xh(v); _ = F.digest, P = F.message, z = F.stack; } var X; P ? X = new Error(P) : X = new Error("The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."); var le = g0(X, _, z); return Fv(n, a, T, le); } var ye = $n(T, n.childLanes); if (eo || ye) { var je = im(); if (je !== null) { var Ee = Lc(je, T); if (Ee !== fr && Ee !== b.retryLane) { b.retryLane = Ee; var gt = Cn; Na(n, Ee), Er(je, n, Ee, gt); } } nx(); var Mt = g0(new Error("This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.")); return Fv(n, a, T, Mt); } else if (Si(v)) { a.flags |= tn, a.child = n.child; var bt = FN.bind(null, n); return ff(v, bt), null; } else { Xa(a, v, b.treeContext); var xn = p.children, nn = k0(a, xn); return nn.flags |= Ai, nn; } } } function $C(n, a, d) { n.lanes = wt(n.lanes, a); var p = n.alternate; p !== null && (p.lanes = wt(p.lanes, a)), my(n.return, a, d); } function QR(n, a, d) { for (var p = a; p !== null; ) { if (p.tag === se) { var v = p.memoizedState; v !== null && $C(p, d, n); } else if (p.tag === be) $C(p, d, n); else if (p.child !== null) { p.child.return = p, p = p.child; continue; } if (p === n) return; for (; p.sibling === null; ) { if (p.return === null || p.return === n) return; p = p.return; } p.sibling.return = p.return, p = p.sibling; } } function ZR(n) { for (var a = n, d = null; a !== null; ) { var p = a.alternate; p !== null && gv(p) === null && (d = a), a = a.sibling; } return d; } function JR(n) { if (n !== void 0 && n !== "forwards" && n !== "backwards" && n !== "together" && !w0[n]) if (w0[n] = !0, typeof n == "string") switch (n.toLowerCase()) { case "together": case "forwards": case "backwards": { g('"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', n, n.toLowerCase()); break; } case "forward": case "backward": { g('"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', n, n.toLowerCase()); break; } default: g('"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', n); break; } else g('%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', n); } function eP(n, a) { n !== void 0 && !Iv[n] && (n !== "collapsed" && n !== "hidden" ? (Iv[n] = !0, g('"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', n)) : a !== "forwards" && a !== "backwards" && (Iv[n] = !0, g(' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', n))); } function QC(n, a) { { var d = Gt(n), p = !d && typeof Re(n) == "function"; if (d || p) { var v = d ? "array" : "iterable"; return g("A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", v, a, v), !1; } } return !0; } function tP(n, a) { if ((a === "forwards" || a === "backwards") && n !== void 0 && n !== null && n !== !1) if (Gt(n)) { for (var d = 0; d < n.length; d++) if (!QC(n[d], d)) return; } else { var p = Re(n); if (typeof p == "function") { var v = p.call(n); if (v) for (var b = v.next(), T = 0; !b.done; b = v.next()) { if (!QC(b.value, T)) return; T++; } } else g('A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', a); } } function P0(n, a, d, p, v) { var b = n.memoizedState; b === null ? n.memoizedState = { isBackwards: a, rendering: null, renderingStartTime: 0, last: p, tail: d, tailMode: v } : (b.isBackwards = a, b.rendering = null, b.renderingStartTime = 0, b.last = p, b.tail = d, b.tailMode = v); } function ZC(n, a, d) { var p = a.pendingProps, v = p.revealOrder, b = p.tail, T = p.children; JR(v), eP(b, v), tP(T, v), Oa(n, a, T, d); var _ = Zi.current, P = Hy(_, Zf); if (P) _ = Vy(_, Zf), a.flags |= tn; else { var z = n !== null && (n.flags & tn) !== rt; z && QR(a, a.child, d), _ = nd(_); } if (gl(a, _), (a.mode & qt) === Ct) a.memoizedState = null; else switch (v) { case "forwards": { var F = ZR(a.child), X; F === null ? (X = a.child, a.child = null) : (X = F.sibling, F.sibling = null), P0( a, !1, // isBackwards X, F, b ); break; } case "backwards": { var le = null, ye = a.child; for (a.child = null; ye !== null; ) { var je = ye.alternate; if (je !== null && gv(je) === null) { a.child = ye; break; } var Ee = ye.sibling; ye.sibling = le, le = ye, ye = Ee; } P0( a, !0, // isBackwards le, null, // last b ); break; } case "together": { P0( a, !1, // isBackwards null, // tail null, // last void 0 ); break; } default: a.memoizedState = null; } return a.child; } function nP(n, a, d) { By(a, a.stateNode.containerInfo); var p = a.pendingProps; return n === null ? a.child = ed(a, null, p, d) : Oa(n, a, p, d), a.child; } var JC = !1; function rP(n, a, d) { var p = a.type, v = p._context, b = a.pendingProps, T = a.memoizedProps, _ = b.value; { "value" in b || JC || (JC = !0, g("The `value` prop is required for the ``. Did you misspell it or forget to pass it?")); var P = a.type.propTypes; P && qa(P, b, "prop", "Context.Provider"); } if (U1(a, v, _), T !== null) { var z = T.value; if (or(z, _)) { if (T.children === b.children && !Js()) return Cs(n, a, d); } else Qk(a, v, d); } var F = b.children; return Oa(n, a, F, d), a.child; } var eE = !1; function aP(n, a, d) { var p = a.type; p._context === void 0 ? p !== p.Consumer && (eE || (eE = !0, g("Rendering directly is not supported and will be removed in a future major release. Did you mean to render instead?"))) : p = p._context; var v = a.pendingProps, b = v.children; typeof b != "function" && g("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."), Jc(a, d); var T = br(p); fs(a); var _; return op.current = a, G(!0), _ = b(T), G(!1), _n(), a.flags |= kn, Oa(n, a, _, d), a.child; } function lp() { eo = !0; } function Lv(n, a) { (a.mode & qt) === Ct && n !== null && (n.alternate = null, a.alternate = null, a.flags |= bn); } function Cs(n, a, d) { return n !== null && (a.dependencies = n.dependencies), AC(), Cp(a.lanes), $n(d, a.childLanes) ? (uR(n, a), a.child) : null; } function iP(n, a, d) { { var p = a.return; if (p === null) throw new Error("Cannot swap the root fiber."); if (n.alternate = null, a.alternate = null, d.index = a.index, d.sibling = a.sibling, d.return = a.return, d.ref = a.ref, a === p.child) p.child = d; else { var v = p.child; if (v === null) throw new Error("Expected parent to have a child."); for (; v.sibling !== a; ) if (v = v.sibling, v === null) throw new Error("Expected to find the previous sibling."); v.sibling = d; } var b = p.deletions; return b === null ? (p.deletions = [n], p.flags |= sa) : b.push(n), d.flags |= bn, d; } } function N0(n, a) { var d = n.lanes; return !!$n(d, a); } function oP(n, a, d) { switch (a.tag) { case ae: qC(a), a.stateNode, o(); break; case Y: iC(a); break; case U: { var p = a.type; Gr(p) && xo(a); break; } case oe: By(a, a.stateNode.containerInfo); break; case Me: { var v = a.memoizedProps.value, b = a.type._context; U1(a, b, v); break; } case K: { var T = $n(d, a.childLanes); T && (a.flags |= Ft); { var _ = a.stateNode; _.effectDuration = 0, _.passiveEffectDuration = 0; } } break; case se: { var P = a.memoizedState; if (P !== null) { if (P.dehydrated !== null) return gl(a, nd(Zi.current)), a.flags |= tn, null; var z = a.child, F = z.childLanes; if ($n(d, F)) return KC(n, a, d); gl(a, nd(Zi.current)); var X = Cs(n, a, d); return X !== null ? X.sibling : null; } else gl(a, nd(Zi.current)); break; } case be: { var le = (n.flags & tn) !== rt, ye = $n(d, a.childLanes); if (le) { if (ye) return ZC(n, a, d); a.flags |= tn; } var je = a.memoizedState; if (je !== null && (je.rendering = null, je.tail = null, je.lastEffect = null), gl(a, Zi.current), ye) break; return null; } case Ue: case tt: return a.lanes = we, VC(n, a, d); } return Cs(n, a, d); } function tE(n, a, d) { if (a._debugNeedsRemount && n !== null) return iP(n, a, fx(a.type, a.key, a.pendingProps, a._debugOwner || null, a.mode, a.lanes)); if (n !== null) { var p = n.memoizedProps, v = a.pendingProps; if (p !== v || Js() || // Force a re-render if the implementation changed due to hot reload: a.type !== n.type) eo = !0; else { var b = N0(n, d); if (!b && // If this is the second pass of an error or suspense boundary, there // may not be work scheduled on `current`, so we check for this flag. (a.flags & tn) === rt) return eo = !1, oP(n, a, d); (n.flags & Ls) !== rt ? eo = !0 : eo = !1; } } else if (eo = !1, h() && gs(a)) { var T = a.index, _ = Gh(); vu(a, _, T); } switch (a.lanes = we, a.tag) { case $: return UR(n, a, a.type, d); case ke: { var P = a.elementType; return LR(n, a, P, d); } case q: { var z = a.type, F = a.pendingProps, X = a.elementType === z ? F : Qi(z, F); return j0(n, a, z, X, d); } case U: { var le = a.type, ye = a.pendingProps, je = a.elementType === le ? ye : Qi(le, ye); return GC(n, a, le, je, d); } case ae: return zR(n, a, d); case Y: return IR(n, a, d); case ve: return FR(n, a); case se: return KC(n, a, d); case oe: return nP(n, a, d); case te: { var Ee = a.type, gt = a.pendingProps, Mt = a.elementType === Ee ? gt : Qi(Ee, gt); return BC(n, a, Ee, Mt, d); } case de: return NR(n, a, d); case fe: return OR(n, a, d); case K: return AR(n, a, d); case Me: return rP(n, a, d); case _e: return aP(n, a, d); case B: { var bt = a.type, xn = a.pendingProps, nn = Qi(bt, xn); if (a.type !== a.elementType) { var J = bt.propTypes; J && qa( J, nn, // Resolved for outer only "prop", ft(bt) ); } return nn = Qi(bt.type, nn), UC(n, a, bt, nn, d); } case re: return HC(n, a, a.type, a.pendingProps, d); case De: { var me = a.type, Z = a.pendingProps, ze = a.elementType === me ? Z : Qi(me, Z); return BR(n, a, me, ze, d); } case be: return ZC(n, a, d); case Ie: break; case Ue: return VC(n, a, d); } throw new Error("Unknown unit of work tag (" + a.tag + "). This error is likely caused by a bug in React. Please file an issue."); } function No(n) { n.flags |= Ft; } function nE(n) { n.flags |= gi, n.flags |= $d; } function rE(n, a) { var d = n !== null && n.child === a.child; if (d) return !0; if ((a.flags & sa) !== rt) return !1; for (var p = a.child; p !== null; ) { if ((p.flags & ql) !== rt || (p.subtreeFlags & ql) !== rt) return !1; p = p.sibling; } return !0; } var up, cp, Bv, Uv; if (Hr) up = function(n, a, d, p) { for (var v = a.child; v !== null; ) { if (v.tag === Y || v.tag === ve) Ur(n, v.stateNode); else if (v.tag !== oe) { if (v.child !== null) { v.child.return = v, v = v.child; continue; } } if (v === a) return; for (; v.sibling === null; ) { if (v.return === null || v.return === a) return; v = v.return; } v.sibling.return = v.return, v = v.sibling; } }, cp = function(n, a) { }, Bv = function(n, a, d, p, v) { var b = n.memoizedProps; if (b !== p) { var T = a.stateNode, _ = Qf(), P = tf(T, d, b, p, v, _); a.updateQueue = P, P && No(a); } }, Uv = function(n, a, d, p) { d !== p && No(a); }; else if (ns) { up = function(n, a, d, p) { for (var v = a.child; v !== null; ) { if (v.tag === Y) { var b = v.stateNode; if (d && p) { var T = v.memoizedProps, _ = v.type; b = Ql(b, _, T, v); } Ur(n, b); } else if (v.tag === ve) { var P = v.stateNode; if (d && p) { var z = v.memoizedProps; P = ja(P, z, v); } Ur(n, P); } else if (v.tag !== oe) { if (v.tag === Ue && v.memoizedState !== null) { var F = v.child; F !== null && (F.return = v), up(n, v, !0, !0); } else if (v.child !== null) { v.child.return = v, v = v.child; continue; } } if (v = v, v === a) return; for (; v.sibling === null; ) { if (v.return === null || v.return === a) return; v = v.return; } v.sibling.return = v.return, v = v.sibling; } }; var aE = function(n, a, d, p) { for (var v = a.child; v !== null; ) { if (v.tag === Y) { var b = v.stateNode; if (d && p) { var T = v.memoizedProps, _ = v.type; b = Ql(b, _, T, v); } rs(n, b); } else if (v.tag === ve) { var P = v.stateNode; if (d && p) { var z = v.memoizedProps; P = ja(P, z, v); } rs(n, P); } else if (v.tag !== oe) { if (v.tag === Ue && v.memoizedState !== null) { var F = v.child; F !== null && (F.return = v), aE(n, v, !0, !0); } else if (v.child !== null) { v.child.return = v, v = v.child; continue; } } if (v = v, v === a) return; for (; v.sibling === null; ) { if (v.return === null || v.return === a) return; v = v.return; } v.sibling.return = v.return, v = v.sibling; } }; cp = function(n, a) { var d = a.stateNode, p = rE(n, a); if (!p) { var v = d.containerInfo, b = ii(v); aE(b, a, !1, !1), d.pendingChildren = b, No(a), Ws(v, b); } }, Bv = function(n, a, d, p, v) { var b = n.stateNode, T = n.memoizedProps, _ = rE(n, a); if (_ && T === p) { a.stateNode = b; return; } var P = a.stateNode, z = Qf(), F = null; if (T !== p && (F = tf(P, d, T, p, v, z)), _ && F === null) { a.stateNode = b; return; } var X = ty(b, F, d, T, p, a, _, P); Xl(X, d, p, v, z) && No(a), a.stateNode = X, _ ? No(a) : up(X, a, !1, !1); }, Uv = function(n, a, d, p) { if (d !== p) { var v = Ly(), b = Qf(); a.stateNode = $l(p, v, b, a), No(a); } else a.stateNode = n.stateNode; }; } else cp = function(n, a) { }, Bv = function(n, a, d, p, v) { }, Uv = function(n, a, d, p) { }; function dp(n, a) { if (!h()) switch (n.tailMode) { case "hidden": { for (var d = n.tail, p = null; d !== null; ) d.alternate !== null && (p = d), d = d.sibling; p === null ? n.tail = null : p.sibling = null; break; } case "collapsed": { for (var v = n.tail, b = null; v !== null; ) v.alternate !== null && (b = v), v = v.sibling; b === null ? !a && n.tail !== null ? n.tail.sibling = null : n.tail = null : b.sibling = null; break; } } } function Jr(n) { var a = n.alternate !== null && n.alternate.child === n.child, d = we, p = rt; if (a) { if ((n.mode & Lt) !== Ct) { for (var P = n.selfBaseDuration, z = n.child; z !== null; ) d = wt(d, wt(z.lanes, z.childLanes)), p |= z.subtreeFlags & Ii, p |= z.flags & Ii, P += z.treeBaseDuration, z = z.sibling; n.treeBaseDuration = P; } else for (var F = n.child; F !== null; ) d = wt(d, wt(F.lanes, F.childLanes)), p |= F.subtreeFlags & Ii, p |= F.flags & Ii, F.return = n, F = F.sibling; n.subtreeFlags |= p; } else { if ((n.mode & Lt) !== Ct) { for (var v = n.actualDuration, b = n.selfBaseDuration, T = n.child; T !== null; ) d = wt(d, wt(T.lanes, T.childLanes)), p |= T.subtreeFlags, p |= T.flags, v += T.actualDuration, b += T.treeBaseDuration, T = T.sibling; n.actualDuration = v, n.treeBaseDuration = b; } else for (var _ = n.child; _ !== null; ) d = wt(d, wt(_.lanes, _.childLanes)), p |= _.subtreeFlags, p |= _.flags, _.return = n, _ = _.sibling; n.subtreeFlags |= p; } return n.childLanes = d, a; } function sP(n, a, d) { if (fy() && (a.mode & qt) !== Ct && (a.flags & tn) === rt) return Jh(a), o(), a.flags |= Oi | Gl | Kr, !1; var p = xs(a); if (d !== null && d.dehydrated !== null) if (n === null) { if (!p) throw new Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React."); if (Qh(a), Jr(a), (a.mode & Lt) !== Ct) { var v = d !== null; if (v) { var b = a.child; b !== null && (a.treeBaseDuration -= b.treeBaseDuration); } } return !1; } else { if (o(), (a.flags & tn) === rt && (a.memoizedState = null), a.flags |= Ft, Jr(a), (a.mode & Lt) !== Ct) { var T = d !== null; if (T) { var _ = a.child; _ !== null && (a.treeBaseDuration -= _.treeBaseDuration); } } return !1; } else return l(), !0; } function iE(n, a, d) { var p = a.pendingProps; switch ($c(a), a.tag) { case $: case ke: case re: case q: case te: case de: case fe: case K: case _e: case B: return Jr(a), null; case U: { var v = a.type; return Gr(v) && Dn(a), Jr(a), null; } case ae: { var b = a.stateNode; if (td(a), Kn(a), Gy(), b.pendingContext && (b.context = b.pendingContext, b.pendingContext = null), n === null || n.child === null) { var T = xs(a); if (T) No(a); else if (n !== null) { var _ = n.memoizedState; // Check if this is a client root (!_.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error) (a.flags & Oi) !== rt) && (a.flags |= fo, l()); } } return cp(n, a), Jr(a), null; } case Y: { Uy(a); var P = Ly(), z = a.type; if (n !== null && a.stateNode != null) Bv(n, a, z, p, P), n.ref !== a.ref && nE(a); else { if (!p) { if (a.stateNode === null) throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."); return Jr(a), null; } var F = Qf(), X = xs(a); if (X) dy(a, P, F) && No(a); else { var le = Hs(z, p, P, F, a); up(le, a, !1, !1), a.stateNode = le, Xl(le, z, p, P, F) && No(a); } a.ref !== null && nE(a); } return Jr(a), null; } case ve: { var ye = p; if (n && a.stateNode != null) { var je = n.memoizedProps; Uv(n, a, je, ye); } else { if (typeof ye != "string" && a.stateNode === null) throw new Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."); var Ee = Ly(), gt = Qf(), Mt = xs(a); Mt ? $h(a) && No(a) : a.stateNode = $l(ye, Ee, gt, a); } return Jr(a), null; } case se: { rd(a); var bt = a.memoizedState; if (n === null || n.memoizedState !== null && n.memoizedState.dehydrated !== null) { var xn = sP(n, a, bt); if (!xn) return a.flags & Kr ? a : null; } if ((a.flags & tn) !== rt) return a.lanes = d, (a.mode & Lt) !== Ct && m0(a), a; var nn = bt !== null, J = n !== null && n.memoizedState !== null; if (nn !== J && nn) { var me = a.child; if (me.flags |= Zo, (a.mode & qt) !== Ct) { var Z = n === null && (a.memoizedProps.unstable_avoidThisFallback !== !0 || !O); Z || Hy(Zi.current, sC) ? jN() : nx(); } } var ze = a.updateQueue; if (ze !== null && (a.flags |= Ft), Jr(a), (a.mode & Lt) !== Ct && nn) { var vt = a.child; vt !== null && (a.treeBaseDuration -= vt.treeBaseDuration); } return null; } case oe: return td(a), cp(n, a), n === null && Yg(a.stateNode.containerInfo), Jr(a), null; case Me: var nt = a.type._context; return vy(nt, a), Jr(a), null; case De: { var en = a.type; return Gr(en) && Dn(a), Jr(a), null; } case be: { rd(a); var Rt = a.memoizedState; if (Rt === null) return Jr(a), null; var un = (a.flags & tn) !== rt, Yt = Rt.rendering; if (Yt === null) if (un) dp(Rt, !1); else { var Nn = DN() && (n === null || (n.flags & tn) === rt); if (!Nn) for (var Et = a.child; Et !== null; ) { var sr = gv(Et); if (sr !== null) { un = !0, a.flags |= tn, dp(Rt, !1); var ya = sr.updateQueue; return ya !== null && (a.updateQueue = ya, a.flags |= Ft), a.subtreeFlags = rt, cR(a, d), gl(a, Vy(Zi.current, Zf)), a.child; } Et = Et.sibling; } Rt.tail !== null && hr() > ME() && (a.flags |= tn, un = !0, dp(Rt, !1), a.lanes = Oc); } else { if (!un) { var ra = gv(Yt); if (ra !== null) { a.flags |= tn, un = !0; var mi = ra.updateQueue; if (mi !== null && (a.updateQueue = mi, a.flags |= Ft), dp(Rt, !0), Rt.tail === null && Rt.tailMode === "hidden" && !Yt.alternate && !h()) return Jr(a), null; } else // The time it took to render last row is greater than the remaining // time we have to render. So rendering one more row would likely // exceed it. hr() * 2 - Rt.renderingStartTime > ME() && d !== da && (a.flags |= tn, un = !0, dp(Rt, !1), a.lanes = Oc); } if (Rt.isBackwards) Yt.sibling = a.child, a.child = Yt; else { var za = Rt.last; za !== null ? za.sibling = Yt : a.child = Yt, Rt.last = Yt; } } if (Rt.tail !== null) { var Ia = Rt.tail; Rt.rendering = Ia, Rt.tail = Ia.sibling, Rt.renderingStartTime = hr(), Ia.sibling = null; var xa = Zi.current; return un ? xa = Vy(xa, Zf) : xa = nd(xa), gl(a, xa), Ia; } return Jr(a), null; } case Ie: break; case Ue: case tt: { tx(a); var js = a.memoizedState, md = js !== null; if (n !== null) { var jp = n.memoizedState, Fo = jp !== null; Fo !== md && // LegacyHidden doesn't do any hiding — it only pre-renders. !R && (a.flags |= Zo); } return !md || (a.mode & qt) === Ct ? Jr(a) : $n(zo, da) && (Jr(a), Hr && a.subtreeFlags & (bn | Ft) && (a.flags |= Zo)), null; } case ht: return null; case dt: return null; } throw new Error("Unknown unit of work tag (" + a.tag + "). This error is likely caused by a bug in React. Please file an issue."); } function lP(n, a, d) { switch ($c(a), a.tag) { case U: { var p = a.type; Gr(p) && Dn(a); var v = a.flags; return v & Kr ? (a.flags = v & ~Kr | tn, (a.mode & Lt) !== Ct && m0(a), a) : null; } case ae: { a.stateNode, td(a), Kn(a), Gy(); var b = a.flags; return (b & Kr) !== rt && (b & tn) === rt ? (a.flags = b & ~Kr | tn, a) : null; } case Y: return Uy(a), null; case se: { rd(a); var T = a.memoizedState; if (T !== null && T.dehydrated !== null) { if (a.alternate === null) throw new Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue."); o(); } var _ = a.flags; return _ & Kr ? (a.flags = _ & ~Kr | tn, (a.mode & Lt) !== Ct && m0(a), a) : null; } case be: return rd(a), null; case oe: return td(a), null; case Me: var P = a.type._context; return vy(P, a), null; case Ue: case tt: return tx(a), null; case ht: return null; default: return null; } } function oE(n, a, d) { switch ($c(a), a.tag) { case U: { var p = a.type.childContextTypes; p != null && Dn(a); break; } case ae: { a.stateNode, td(a), Kn(a), Gy(); break; } case Y: { Uy(a); break; } case oe: td(a); break; case se: rd(a); break; case be: rd(a); break; case Me: var v = a.type._context; vy(v, a); break; case Ue: case tt: tx(a); break; } } function sE(n, a, d, p, v, b, T, _, P) { var z = Array.prototype.slice.call(arguments, 3); try { a.apply(d, z); } catch (F) { this.onError(F); } } var lE = sE; if (typeof window < "u" && typeof window.dispatchEvent == "function" && typeof document < "u" && typeof document.createEvent == "function") { var O0 = document.createElement("react"); lE = function(a, d, p, v, b, T, _, P, z) { if (typeof document > "u" || document === null) throw new Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous."); var F = document.createEvent("Event"), X = !1, le = !0, ye = window.event, je = Object.getOwnPropertyDescriptor(window, "event"); function Ee() { O0.removeEventListener(me, Mt, !1), typeof window.event < "u" && window.hasOwnProperty("event") && (window.event = ye); } var gt = Array.prototype.slice.call(arguments, 3); function Mt() { X = !0, Ee(), d.apply(p, gt), le = !1; } var bt, xn = !1, nn = !1; function J(Z) { if (bt = Z.error, xn = !0, bt === null && Z.colno === 0 && Z.lineno === 0 && (nn = !0), Z.defaultPrevented && bt != null && typeof bt == "object") try { bt._suppressLogging = !0; } catch { } } var me = "react-" + (a || "invokeguardedcallback"); if (window.addEventListener("error", J), O0.addEventListener(me, Mt, !1), F.initEvent(me, !1, !1), O0.dispatchEvent(F), je && Object.defineProperty(window, "event", je), X && le && (xn ? nn && (bt = new Error("A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information.")) : bt = new Error(`An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the "Pause on exceptions" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue.`), this.onError(bt)), window.removeEventListener("error", J), !X) return Ee(), sE.apply(this, arguments); }; } var uP = lE, fp = !1, Hv = null, cP = { onError: function(n) { fp = !0, Hv = n; } }; function uE(n, a, d, p, v, b, T, _, P) { fp = !1, Hv = null, uP.apply(cP, arguments); } function dP() { return fp; } function cE() { if (fp) { var n = Hv; return fp = !1, Hv = null, n; } else throw new Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."); } var dE = null; dE = /* @__PURE__ */ new Set(); var Vv = !1, ea = !1, fP = typeof WeakSet == "function" ? WeakSet : Set, pt = null, ld = null, ud = null; function pP(n) { uE(null, function() { throw n; }), cE(); } var hP = function(n, a) { if (a.props = n.memoizedProps, a.state = n.memoizedState, n.mode & Lt) try { Po(), a.componentWillUnmount(); } finally { Ro(n); } else a.componentWillUnmount(); }; function fE(n, a) { try { Sl(Ar, n); } catch (d) { wn(n, a, d); } } function A0(n, a, d) { try { hP(n, d); } catch (p) { wn(n, a, p); } } function vP(n, a, d) { try { d.componentDidMount(); } catch (p) { wn(n, a, p); } } function pE(n, a) { try { vE(n); } catch (d) { wn(n, a, d); } } function cd(n, a) { var d = n.ref; if (d !== null) if (typeof d == "function") { var p; try { if (L && H && n.mode & Lt) try { Po(), p = d(null); } finally { Ro(n); } else p = d(null); } catch (v) { wn(n, a, v); } typeof p == "function" && g("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", st(n)); } else d.current = null; } function Wv(n, a, d) { try { d(); } catch (p) { wn(n, a, p); } } var hE = !1; function mP(n, a) { la(n.containerInfo), pt = a, gP(); var d = hE; return hE = !1, d; } function gP() { for (; pt !== null; ) { var n = pt, a = n.child; (n.subtreeFlags & Zd) !== rt && a !== null ? (a.return = n, pt = a) : yP(); } } function yP() { for (; pt !== null; ) { var n = pt; hn(n); try { xP(n); } catch (d) { wn(n, n.return, d); } gn(); var a = n.sibling; if (a !== null) { a.return = n.return, pt = a; return; } pt = n.return; } } function xP(n) { var a = n.alternate, d = n.flags; if ((d & fo) !== rt) { switch (hn(n), n.tag) { case q: case te: case re: break; case U: { if (a !== null) { var p = a.memoizedProps, v = a.memoizedState, b = n.stateNode; n.type === n.elementType && !Cu && (b.props !== n.memoizedProps && g("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", st(n) || "instance"), b.state !== n.memoizedState && g("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", st(n) || "instance")); var T = b.getSnapshotBeforeUpdate(n.elementType === n.type ? p : Qi(n.type, p), v); { var _ = dE; T === void 0 && !_.has(n.type) && (_.add(n.type), g("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.", st(n))); } b.__reactInternalSnapshotBeforeUpdate = T; } break; } case ae: { if (Hr) { var P = n.stateNode; yh(P.containerInfo); } break; } case Y: case ve: case oe: case De: break; default: throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."); } gn(); } } function to(n, a, d) { var p = a.updateQueue, v = p !== null ? p.lastEffect : null; if (v !== null) { var b = v.next, T = b; do { if ((T.tag & n) === n) { var _ = T.destroy; T.destroy = void 0, _ !== void 0 && ((n & Zr) !== Qa ? ar(a) : (n & Ar) !== Qa && ir(a), (n & _o) !== Qa && wp(!0), Wv(a, d, _), (n & _o) !== Qa && wp(!1), (n & Zr) !== Qa ? Rr() : (n & Ar) !== Qa && dl()); } T = T.next; } while (T !== b); } } function Sl(n, a) { var d = a.updateQueue, p = d !== null ? d.lastEffect : null; if (p !== null) { var v = p.next, b = v; do { if ((b.tag & n) === n) { (n & Zr) !== Qa ? Wt(a) : (n & Ar) !== Qa && ka(a); var T = b.create; (n & _o) !== Qa && wp(!0), b.destroy = T(), (n & _o) !== Qa && wp(!1), (n & Zr) !== Qa ? xr() : (n & Ar) !== Qa && cl(); { var _ = b.destroy; if (_ !== void 0 && typeof _ != "function") { var P = void 0; (b.tag & Ar) !== rt ? P = "useLayoutEffect" : (b.tag & _o) !== rt ? P = "useInsertionEffect" : P = "useEffect"; var z = void 0; _ === null ? z = " You returned null. If your effect does not require clean up, return undefined (or nothing)." : typeof _.then == "function" ? z = ` It looks like you wrote ` + P + `(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately: ` + P + `(() => { async function fetchData() { // You can await here const response = await MyAPI.getData(someId); // ... } fetchData(); }, [someId]); // Or [] if effect doesn't need props or state Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching` : z = " You returned: " + _, g("%s must not return anything besides a function, which is used for clean-up.%s", P, z); } } } b = b.next; } while (b !== v); } } function SP(n, a) { if ((a.flags & Ft) !== rt) switch (a.tag) { case K: { var d = a.stateNode.passiveEffectDuration, p = a.memoizedProps, v = p.id, b = p.onPostCommit, T = NC(), _ = a.alternate === null ? "mount" : "update"; PC() && (_ = "nested-update"), typeof b == "function" && b(v, _, d, T); var P = a.return; e: for (; P !== null; ) { switch (P.tag) { case ae: var z = P.stateNode; z.passiveEffectDuration += d; break e; case K: var F = P.stateNode; F.passiveEffectDuration += d; break e; } P = P.return; } break; } } } function bP(n, a, d, p) { if ((d.flags & Yl) !== rt) switch (d.tag) { case q: case te: case re: { if (!ea) if (d.mode & Lt) try { Po(), Sl(Ar | Or, d); } finally { Ro(d); } else Sl(Ar | Or, d); break; } case U: { var v = d.stateNode; if (d.flags & Ft && !ea) if (a === null) if (d.type === d.elementType && !Cu && (v.props !== d.memoizedProps && g("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", st(d) || "instance"), v.state !== d.memoizedState && g("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", st(d) || "instance")), d.mode & Lt) try { Po(), v.componentDidMount(); } finally { Ro(d); } else v.componentDidMount(); else { var b = d.elementType === d.type ? a.memoizedProps : Qi(d.type, a.memoizedProps), T = a.memoizedState; if (d.type === d.elementType && !Cu && (v.props !== d.memoizedProps && g("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", st(d) || "instance"), v.state !== d.memoizedState && g("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", st(d) || "instance")), d.mode & Lt) try { Po(), v.componentDidUpdate(b, T, v.__reactInternalSnapshotBeforeUpdate); } finally { Ro(d); } else v.componentDidUpdate(b, T, v.__reactInternalSnapshotBeforeUpdate); } var _ = d.updateQueue; _ !== null && (d.type === d.elementType && !Cu && (v.props !== d.memoizedProps && g("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.", st(d) || "instance"), v.state !== d.memoizedState && g("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.", st(d) || "instance")), Y1(d, _, v)); break; } case ae: { var P = d.updateQueue; if (P !== null) { var z = null; if (d.child !== null) switch (d.child.tag) { case Y: z = mn(d.child.stateNode); break; case U: z = d.child.stateNode; break; } Y1(d, P, z); } break; } case Y: { var F = d.stateNode; if (a === null && d.flags & Ft) { var X = d.type, le = d.memoizedProps; Zg(F, X, le, d); } break; } case ve: break; case oe: break; case K: { { var ye = d.memoizedProps, je = ye.onCommit, Ee = ye.onRender, gt = d.stateNode.effectDuration, Mt = NC(), bt = a === null ? "mount" : "update"; PC() && (bt = "nested-update"), typeof Ee == "function" && Ee(d.memoizedProps.id, bt, d.actualDuration, d.treeBaseDuration, d.actualStartTime, Mt); { typeof je == "function" && je(d.memoizedProps.id, bt, gt, Mt), PN(d); var xn = d.return; e: for (; xn !== null; ) { switch (xn.tag) { case ae: var nn = xn.stateNode; nn.effectDuration += gt; break e; case K: var J = xn.stateNode; J.effectDuration += gt; break e; } xn = xn.return; } } } break; } case se: { kP(n, d); break; } case be: case De: case Ie: case Ue: case tt: case dt: break; default: throw new Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."); } ea || d.flags & gi && vE(d); } function CP(n) { switch (n.tag) { case q: case te: case re: { if (n.mode & Lt) try { Po(), fE(n, n.return); } finally { Ro(n); } else fE(n, n.return); break; } case U: { var a = n.stateNode; typeof a.componentDidMount == "function" && vP(n, n.return, a), pE(n, n.return); break; } case Y: { pE(n, n.return); break; } } } function EP(n, a) { var d = null; if (Hr) for (var p = n; ; ) { if (p.tag === Y) { if (d === null) { d = p; try { var v = p.stateNode; a ? ai(v) : sc(p.stateNode, p.memoizedProps); } catch (T) { wn(n, n.return, T); } } } else if (p.tag === ve) { if (d === null) try { var b = p.stateNode; a ? Fi(b) : df(b, p.memoizedProps); } catch (T) { wn(n, n.return, T); } } else if (!((p.tag === Ue || p.tag === tt) && p.memoizedState !== null && p !== n)) { if (p.child !== null) { p.child.return = p, p = p.child; continue; } } if (p === n) return; for (; p.sibling === null; ) { if (p.return === null || p.return === n) return; d === p && (d = null), p = p.return; } d === p && (d = null), p.sibling.return = p.return, p = p.sibling; } } function vE(n) { var a = n.ref; if (a !== null) { var d = n.stateNode, p; switch (n.tag) { case Y: p = mn(d); break; default: p = d; } if (typeof a == "function") { var v; if (n.mode & Lt) try { Po(), v = a(p); } finally { Ro(n); } else v = a(p); typeof v == "function" && g("Unexpected return value from a callback ref in %s. A callback ref should not return a function.", st(n)); } else a.hasOwnProperty("current") || g("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().", st(n)), a.current = p; } } function wP(n) { var a = n.alternate; a !== null && (a.return = null), n.return = null; } function mE(n) { var a = n.alternate; a !== null && (n.alternate = null, mE(a)); { if (n.child = null, n.deletions = null, n.sibling = null, n.tag === Y) { var d = n.stateNode; d !== null && af(d); } n.stateNode = null, n._debugOwner = null, n.return = null, n.dependencies = null, n.memoizedProps = null, n.memoizedState = null, n.pendingProps = null, n.stateNode = null, n.updateQueue = null; } } function jP(n) { if (ns) { var a = n.stateNode, d = a.containerInfo, p = ii(d); Gs(d, p); } } function TP(n) { for (var a = n.return; a !== null; ) { if (gE(a)) return a; a = a.return; } throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."); } function gE(n) { return n.tag === Y || n.tag === ae || n.tag === oe; } function yE(n) { var a = n; e: for (; ; ) { for (; a.sibling === null; ) { if (a.return === null || gE(a.return)) return null; a = a.return; } for (a.sibling.return = a.return, a = a.sibling; a.tag !== Y && a.tag !== ve && a.tag !== Se; ) { if (a.flags & bn || a.child === null || a.tag === oe) continue e; a.child.return = a, a = a.child; } if (!(a.flags & bn)) return a.stateNode; } } function DP(n) { if (Hr) { var a = TP(n); switch (a.tag) { case Y: { var d = a.stateNode; a.flags & Wl && (gh(d), a.flags &= ~Wl); var p = yE(n); I0(n, p, d); break; } case ae: case oe: { var v = a.stateNode.containerInfo, b = yE(n); z0(n, b, v); break; } default: throw new Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."); } } } function z0(n, a, d) { var p = n.tag, v = p === Y || p === ve; if (v) { var b = n.stateNode; a ? oc(d, b, a) : gr(d, b); } else if (p !== oe) { var T = n.child; if (T !== null) { z0(T, a, d); for (var _ = T.sibling; _ !== null; ) z0(_, a, d), _ = _.sibling; } } } function I0(n, a, d) { var p = n.tag, v = p === Y || p === ve; if (v) { var b = n.stateNode; a ? Jg(d, b, a) : Qg(d, b); } else if (p !== oe) { var T = n.child; if (T !== null) { I0(T, a, d); for (var _ = T.sibling; _ !== null; ) I0(_, a, d), _ = _.sibling; } } } var ta = null, no = !1; function _P(n, a, d) { if (Hr) { var p = a; e: for (; p !== null; ) { switch (p.tag) { case Y: { ta = p.stateNode, no = !1; break e; } case ae: { ta = p.stateNode.containerInfo, no = !0; break e; } case oe: { ta = p.stateNode.containerInfo, no = !0; break e; } } p = p.return; } if (ta === null) throw new Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."); F0(n, a, d), ta = null, no = !1; } else F0(n, a, d); wP(d); } function Oo(n, a, d) { for (var p = d.child; p !== null; ) F0(n, a, p), p = p.sibling; } function F0(n, a, d) { switch (Lf(d), d.tag) { case Y: ea || cd(d, a); case ve: { if (Hr) { var p = ta, v = no; ta = null, Oo(n, a, d), ta = p, no = v, ta !== null && (no ? ey(ta, d.stateNode) : xi(ta, d.stateNode)); } else Oo(n, a, d); return; } case Se: { Hr && ta !== null && (no ? lc(ta, d.stateNode) : Ch(ta, d.stateNode)); return; } case oe: { if (Hr) { var b = ta, T = no; ta = d.stateNode.containerInfo, no = !0, Oo(n, a, d), ta = b, no = T; } else jP(d), Oo(n, a, d); return; } case q: case te: case B: case re: { if (!ea) { var _ = d.updateQueue; if (_ !== null) { var P = _.lastEffect; if (P !== null) { var z = P.next, F = z; do { var X = F, le = X.destroy, ye = X.tag; le !== void 0 && ((ye & _o) !== Qa ? Wv(d, a, le) : (ye & Ar) !== Qa && (ir(d), d.mode & Lt ? (Po(), Wv(d, a, le), Ro(d)) : Wv(d, a, le), dl())), F = F.next; } while (F !== z); } } } Oo(n, a, d); return; } case U: { if (!ea) { cd(d, a); var je = d.stateNode; typeof je.componentWillUnmount == "function" && A0(d, a, je); } Oo(n, a, d); return; } case Ie: { Oo(n, a, d); return; } case Ue: { if ( // TODO: Remove this dead flag d.mode & qt ) { var Ee = ea; ea = Ee || d.memoizedState !== null, Oo(n, a, d), ea = Ee; } else Oo(n, a, d); break; } default: { Oo(n, a, d); return; } } } function MP(n) { n.memoizedState; } function kP(n, a) { if (Vr) { var d = a.memoizedState; if (d === null) { var p = a.alternate; if (p !== null) { var v = p.memoizedState; if (v !== null) { var b = v.dehydrated; b !== null && hf(b); } } } } } function xE(n) { var a = n.updateQueue; if (a !== null) { n.updateQueue = null; var d = n.stateNode; d === null && (d = n.stateNode = new fP()), a.forEach(function(p) { var v = LN.bind(null, n, p); if (!d.has(p)) { if (d.add(p), ha) if (ld !== null && ud !== null) Ep(ud, ld); else throw Error("Expected finished root and lanes to be set. This is a bug in React."); p.then(v, v); } }); } } function RP(n, a, d) { ld = d, ud = n, hn(a), SE(a, n), hn(a), ld = null, ud = null; } function ro(n, a, d) { var p = a.deletions; if (p !== null) for (var v = 0; v < p.length; v++) { var b = p[v]; try { _P(n, a, b); } catch (P) { wn(b, a, P); } } var T = ie(); if (a.subtreeFlags & ql) for (var _ = a.child; _ !== null; ) hn(_), SE(_, n), _ = _.sibling; hn(T); } function SE(n, a, d) { var p = n.alternate, v = n.flags; switch (n.tag) { case q: case te: case B: case re: { if (ro(a, n), Ao(n), v & Ft) { try { to(_o | Or, n, n.return), Sl(_o | Or, n); } catch (Et) { wn(n, n.return, Et); } if (n.mode & Lt) { try { Po(), to(Ar | Or, n, n.return); } catch (Et) { wn(n, n.return, Et); } Ro(n); } else try { to(Ar | Or, n, n.return); } catch (Et) { wn(n, n.return, Et); } } return; } case U: { ro(a, n), Ao(n), v & gi && p !== null && cd(p, p.return); return; } case Y: { if (ro(a, n), Ao(n), v & gi && p !== null && cd(p, p.return), Hr) { if (n.flags & Wl) { var b = n.stateNode; try { gh(b); } catch (Et) { wn(n, n.return, Et); } } if (v & Ft) { var T = n.stateNode; if (T != null) { var _ = n.memoizedProps, P = p !== null ? p.memoizedProps : _, z = n.type, F = n.updateQueue; if (n.updateQueue = null, F !== null) try { cf(T, F, z, P, _, n); } catch (Et) { wn(n, n.return, Et); } } } } return; } case ve: { if (ro(a, n), Ao(n), v & Ft && Hr) { if (n.stateNode === null) throw new Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue."); var X = n.stateNode, le = n.memoizedProps, ye = p !== null ? p.memoizedProps : le; try { uf(X, ye, le); } catch (Et) { wn(n, n.return, Et); } } return; } case ae: { if (ro(a, n), Ao(n), v & Ft) { if (Hr && Vr && p !== null) { var je = p.memoizedState; if (je.isDehydrated) try { pf(a.containerInfo); } catch (Et) { wn(n, n.return, Et); } } if (ns) { var Ee = a.containerInfo, gt = a.pendingChildren; try { Gs(Ee, gt); } catch (Et) { wn(n, n.return, Et); } } } return; } case oe: { if (ro(a, n), Ao(n), v & Ft && ns) { var Mt = n.stateNode, bt = Mt.containerInfo, xn = Mt.pendingChildren; try { Gs(bt, xn); } catch (Et) { wn(n, n.return, Et); } } return; } case se: { ro(a, n), Ao(n); var nn = n.child; if (nn.flags & Zo) { var J = nn.stateNode, me = nn.memoizedState, Z = me !== null; if (J.isHidden = Z, Z) { var ze = nn.alternate !== null && nn.alternate.memoizedState !== null; ze || wN(); } } if (v & Ft) { try { MP(n); } catch (Et) { wn(n, n.return, Et); } xE(n); } return; } case Ue: { var vt = p !== null && p.memoizedState !== null; if ( // TODO: Remove this dead flag n.mode & qt ) { var nt = ea; ea = nt || vt, ro(a, n), ea = nt; } else ro(a, n); if (Ao(n), v & Zo) { var en = n.stateNode, Rt = n.memoizedState, un = Rt !== null, Yt = n; if (en.isHidden = un, un && !vt && (Yt.mode & qt) !== Ct) { pt = Yt; for (var Nn = Yt.child; Nn !== null; ) pt = Nn, NP(Nn), Nn = Nn.sibling; } Hr && EP(Yt, un); } return; } case be: { ro(a, n), Ao(n), v & Ft && xE(n); return; } case Ie: return; default: { ro(a, n), Ao(n); return; } } } function Ao(n) { var a = n.flags; if (a & bn) { try { DP(n); } catch (d) { wn(n, n.return, d); } n.flags &= ~bn; } a & Ai && (n.flags &= ~Ai); } function PP(n, a, d) { ld = d, ud = a, pt = n, bE(n, a, d), ld = null, ud = null; } function bE(n, a, d) { for (var p = (n.mode & qt) !== Ct; pt !== null; ) { var v = pt, b = v.child; if (v.tag === Ue && p) { var T = v.memoizedState !== null, _ = T || Vv; if (_) { L0(n, a, d); continue; } else { var P = v.alternate, z = P !== null && P.memoizedState !== null, F = z || ea, X = Vv, le = ea; Vv = _, ea = F, ea && !le && (pt = v, OP(v)); for (var ye = b; ye !== null; ) pt = ye, bE( ye, // New root; bubble back up to here and stop. a, d ), ye = ye.sibling; pt = v, Vv = X, ea = le, L0(n, a, d); continue; } } (v.subtreeFlags & Yl) !== rt && b !== null ? (b.return = v, pt = b) : L0(n, a, d); } } function L0(n, a, d) { for (; pt !== null; ) { var p = pt; if ((p.flags & Yl) !== rt) { var v = p.alternate; hn(p); try { bP(a, v, p, d); } catch (T) { wn(p, p.return, T); } gn(); } if (p === n) { pt = null; return; } var b = p.sibling; if (b !== null) { b.return = p.return, pt = b; return; } pt = p.return; } } function NP(n) { for (; pt !== null; ) { var a = pt, d = a.child; switch (a.tag) { case q: case te: case B: case re: { if (a.mode & Lt) try { Po(), to(Ar, a, a.return); } finally { Ro(a); } else to(Ar, a, a.return); break; } case U: { cd(a, a.return); var p = a.stateNode; typeof p.componentWillUnmount == "function" && A0(a, a.return, p); break; } case Y: { cd(a, a.return); break; } case Ue: { var v = a.memoizedState !== null; if (v) { CE(n); continue; } break; } } d !== null ? (d.return = a, pt = d) : CE(n); } } function CE(n) { for (; pt !== null; ) { var a = pt; if (a === n) { pt = null; return; } var d = a.sibling; if (d !== null) { d.return = a.return, pt = d; return; } pt = a.return; } } function OP(n) { for (; pt !== null; ) { var a = pt, d = a.child; if (a.tag === Ue) { var p = a.memoizedState !== null; if (p) { EE(n); continue; } } d !== null ? (d.return = a, pt = d) : EE(n); } } function EE(n) { for (; pt !== null; ) { var a = pt; hn(a); try { CP(a); } catch (p) { wn(a, a.return, p); } if (gn(), a === n) { pt = null; return; } var d = a.sibling; if (d !== null) { d.return = a.return, pt = d; return; } pt = a.return; } } function AP(n, a, d, p) { pt = a, zP(a, n, d, p); } function zP(n, a, d, p) { for (; pt !== null; ) { var v = pt, b = v.child; (v.subtreeFlags & Bs) !== rt && b !== null ? (b.return = v, pt = b) : IP(n, a, d, p); } } function IP(n, a, d, p) { for (; pt !== null; ) { var v = pt; if ((v.flags & Va) !== rt) { hn(v); try { FP(a, v, d, p); } catch (T) { wn(v, v.return, T); } gn(); } if (v === n) { pt = null; return; } var b = v.sibling; if (b !== null) { b.return = v.return, pt = b; return; } pt = v.return; } } function FP(n, a, d, p) { switch (a.tag) { case q: case te: case re: { if (a.mode & Lt) { v0(); try { Sl(Zr | Or, a); } finally { h0(a); } } else Sl(Zr | Or, a); break; } } } function LP(n) { pt = n, BP(); } function BP() { for (; pt !== null; ) { var n = pt, a = n.child; if ((pt.flags & sa) !== rt) { var d = n.deletions; if (d !== null) { for (var p = 0; p < d.length; p++) { var v = d[p]; pt = v, VP(v, n); } { var b = n.alternate; if (b !== null) { var T = b.child; if (T !== null) { b.child = null; do { var _ = T.sibling; T.sibling = null, T = _; } while (T !== null); } } } pt = n; } } (n.subtreeFlags & Bs) !== rt && a !== null ? (a.return = n, pt = a) : UP(); } } function UP() { for (; pt !== null; ) { var n = pt; (n.flags & Va) !== rt && (hn(n), HP(n), gn()); var a = n.sibling; if (a !== null) { a.return = n.return, pt = a; return; } pt = n.return; } } function HP(n) { switch (n.tag) { case q: case te: case re: { n.mode & Lt ? (v0(), to(Zr | Or, n, n.return), h0(n)) : to(Zr | Or, n, n.return); break; } } } function VP(n, a) { for (; pt !== null; ) { var d = pt; hn(d), GP(d, a), gn(); var p = d.child; p !== null ? (p.return = d, pt = p) : WP(n); } } function WP(n) { for (; pt !== null; ) { var a = pt, d = a.sibling, p = a.return; if (mE(a), a === n) { pt = null; return; } if (d !== null) { d.return = p, pt = d; return; } pt = p; } } function GP(n, a) { switch (n.tag) { case q: case te: case re: { n.mode & Lt ? (v0(), to(Zr, n, a), h0(n)) : to(Zr, n, a); break; } } } function qP(n) { switch (n.tag) { case q: case te: case re: { try { Sl(Ar | Or, n); } catch (d) { wn(n, n.return, d); } break; } case U: { var a = n.stateNode; try { a.componentDidMount(); } catch (d) { wn(n, n.return, d); } break; } } } function YP(n) { switch (n.tag) { case q: case te: case re: { try { Sl(Zr | Or, n); } catch (a) { wn(n, n.return, a); } break; } } } function KP(n) { switch (n.tag) { case q: case te: case re: { try { to(Ar | Or, n, n.return); } catch (d) { wn(n, n.return, d); } break; } case U: { var a = n.stateNode; typeof a.componentWillUnmount == "function" && A0(n, n.return, a); break; } } } function XP(n) { switch (n.tag) { case q: case te: case re: try { to(Zr | Or, n, n.return); } catch (a) { wn(n, n.return, a); } } } var Gv = 0, qv = 1, Yv = 2, Kv = 3, Xv = 4; if (typeof Symbol == "function" && Symbol.for) { var pp = Symbol.for; Gv = pp("selector.component"), qv = pp("selector.has_pseudo_class"), Yv = pp("selector.role"), Kv = pp("selector.test_id"), Xv = pp("selector.text"); } function $P(n) { return { $$typeof: Gv, value: n }; } function QP(n) { return { $$typeof: qv, value: n }; } function ZP(n) { return { $$typeof: Yv, value: n }; } function JP(n) { return { $$typeof: Xv, value: n }; } function eN(n) { return { $$typeof: Kv, value: n }; } function B0(n) { var a = ic(n); if (a != null) { if (typeof a.memoizedProps["data-testname"] != "string") throw new Error("Invalid host root specified. Should be either a React container or a node with a testname attribute."); return a; } else { var d = Xg(n); if (d === null) throw new Error("Could not find React container within specified host subtree."); return d.stateNode.current; } } function U0(n, a) { switch (a.$$typeof) { case Gv: if (n.type === a.value) return !0; break; case qv: return tN(n, a.value); case Yv: if (n.tag === Y) { var d = n.stateNode; if (lf(d, a.value)) return !0; } break; case Xv: if (n.tag === Y || n.tag === ve) { var p = sn(n); if (p !== null && p.indexOf(a.value) >= 0) return !0; } break; case Kv: if (n.tag === Y) { var v = n.memoizedProps["data-testname"]; if (typeof v == "string" && v.toLowerCase() === a.value.toLowerCase()) return !0; } break; default: throw new Error("Invalid selector type specified."); } return !1; } function H0(n) { switch (n.$$typeof) { case Gv: var a = ft(n.value) || "Unknown"; return "<" + a + ">"; case qv: return ":has(" + (H0(n) || "") + ")"; case Yv: return '[role="' + n.value + '"]'; case Xv: return '"' + n.value + '"'; case Kv: return '[data-testname="' + n.value + '"]'; default: throw new Error("Invalid selector type specified."); } } function wE(n, a) { for (var d = [], p = [n, 0], v = 0; v < p.length; ) { var b = p[v++], T = p[v++], _ = a[T]; if (!(b.tag === Y && Vs(b))) { for (; _ != null && U0(b, _); ) T++, _ = a[T]; if (T === a.length) d.push(b); else for (var P = b.child; P !== null; ) p.push(P, T), P = P.sibling; } } return d; } function tN(n, a) { for (var d = [n, 0], p = 0; p < d.length; ) { var v = d[p++], b = d[p++], T = a[b]; if (!(v.tag === Y && Vs(v))) { for (; T != null && U0(v, T); ) b++, T = a[b]; if (b === a.length) return !0; for (var _ = v.child; _ !== null; ) d.push(_, b), _ = _.sibling; } } return !1; } function $v(n, a) { if (!yi) throw new Error("Test selector API is not supported by this renderer."); for (var d = B0(n), p = wE(d, a), v = [], b = Array.from(p), T = 0; T < b.length; ) { var _ = b[T++]; if (_.tag === Y) { if (Vs(_)) continue; v.push(_.stateNode); } else for (var P = _.child; P !== null; ) b.push(P), P = P.sibling; } return v; } function nN(n, a) { if (!yi) throw new Error("Test selector API is not supported by this renderer."); for (var d = B0(n), p = 0, v = [], b = [d, 0], T = 0; T < b.length; ) { var _ = b[T++], P = b[T++], z = a[P]; if (!(_.tag === Y && Vs(_)) && (U0(_, z) && (v.push(H0(z)), P++, P > p && (p = P)), P < a.length)) for (var F = _.child; F !== null; ) b.push(F, P), F = F.sibling; } if (p < a.length) { for (var X = [], le = p; le < a.length; le++) X.push(H0(a[le])); return `findAllNodes was able to match part of the selector: ` + (" " + v.join(" > ") + ` `) + `No matching component was found for: ` + (" " + X.join(" > ")); } return null; } function rN(n, a) { if (!yi) throw new Error("Test selector API is not supported by this renderer."); for (var d = $v(n, a), p = [], v = 0; v < d.length; v++) p.push(sf(d[v])); for (var b = p.length - 1; b > 0; b--) for (var T = p[b], _ = T.x, P = _ + T.width, z = T.y, F = z + T.height, X = b - 1; X >= 0; X--) if (b !== X) { var le = p[X], ye = le.x, je = ye + le.width, Ee = le.y, gt = Ee + le.height; if (_ >= ye && z >= Ee && P <= je && F <= gt) { p.splice(b, 1); break; } else if (_ === ye && T.width === le.width && !(gt < z) && !(Ee > F)) { Ee > z && (le.height += Ee - z, le.y = z), gt < F && (le.height = F - Ee), p.splice(b, 1); break; } else if (z === Ee && T.height === le.height && !(je < _) && !(ye > P)) { ye > _ && (le.width += ye - _, le.x = _), je < P && (le.width = P - ye), p.splice(b, 1); break; } } return p; } function aN(n, a) { if (!yi) throw new Error("Test selector API is not supported by this renderer."); for (var d = B0(n), p = wE(d, a), v = Array.from(p), b = 0; b < v.length; ) { var T = v[b++]; if (!Vs(T)) { if (T.tag === Y) { var _ = T.stateNode; if (mh(_)) return !0; } for (var P = T.child; P !== null; ) v.push(P), P = P.sibling; } } return !1; } var Qv = []; function iN() { yi && Qv.forEach(function(n) { return n(); }); } function oN(n, a, d, p) { if (!yi) throw new Error("Test selector API is not supported by this renderer."); var v = $v(n, a), b = $g(v, d, p), T = b.disconnect, _ = b.observe, P = b.unobserve, z = function() { var F = $v(n, a); v.forEach(function(X) { F.indexOf(X) < 0 && P(X); }), F.forEach(function(X) { v.indexOf(X) < 0 && _(X); }); }; return Qv.push(z), { disconnect: function() { var F = Qv.indexOf(z); F >= 0 && Qv.splice(F, 1), T(); } }; } var sN = c.ReactCurrentActQueue; function lN(n) { { var a = ( // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global typeof IS_REACT_ACT_ENVIRONMENT < "u" ? IS_REACT_ACT_ENVIRONMENT : void 0 ), d = typeof jest < "u"; return qg && d && a !== !1; } } function jE() { { var n = ( // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global typeof IS_REACT_ACT_ENVIRONMENT < "u" ? IS_REACT_ACT_ENVIRONMENT : void 0 ); return !n && sN.current !== null && g("The current testing environment is not configured to support act(...)"), n; } } var uN = Math.ceil, V0 = c.ReactCurrentDispatcher, W0 = c.ReactCurrentOwner, Qn = c.ReactCurrentBatchConfig, ao = c.ReactCurrentActQueue, Cr = ( /* */ 0 ), G0 = ( /* */ 1 ), na = ( /* */ 2 ), Mi = ( /* */ 4 ), Es = 0, hp = 1, Eu = 2, Zv = 3, vp = 4, TE = 5, q0 = 6, Bt = Cr, Aa = null, Zn = null, Fr = we, zo = we, Y0 = _a(we), Lr = Es, mp = null, Jv = we, gp = we, em = we, yp = null, Za = null, K0 = 0, DE = 500, _E = 1 / 0, cN = 500, ws = null; function dd() { _E = hr() + cN; } function ME() { return _E; } var tm = !1, X0 = null, fd = null, wu = !1, bl = null, xp = we, $0 = [], Q0 = null, dN = 50, Sp = 0, Z0 = null, J0 = !1, nm = !1, fN = 50, pd = 0, rm = null, bp = Cn, am = we, kE = !1; function im() { return Aa; } function ga() { return (Bt & (na | Mi)) !== Cr ? hr() : (bp !== Cn || (bp = hr()), bp); } function Cl(n) { var a = n.mode; if ((a & qt) === Ct) return Tt; if ((Bt & na) !== Cr && Fr !== we) return us(Fr); var d = N() !== j; if (d) { if (Qn.transition !== null) { var p = Qn.transition; p._updatedFibers || (p._updatedFibers = /* @__PURE__ */ new Set()), p._updatedFibers.add(n); } return am === fr && (am = su()), am; } var v = fa(); if (v !== fr) return v; var b = Kg(); return b; } function pN(n) { var a = n.mode; return (a & qt) === Ct ? Tt : iy(); } function Er(n, a, d, p) { UN(), kE && g("useInsertionEffect must not schedule updates."), J0 && (nm = !0), ll(n, d, p), (Bt & na) !== we && n === Aa ? WN(a) : (ha && Mr(n, a, d), GN(a), n === Aa && ((Bt & na) === Cr && (gp = wt(gp, d)), Lr === vp && El(n, Fr)), Ja(n, p), d === Tt && Bt === Cr && (a.mode & qt) === Ct && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode. !ao.isBatchingLegacy && (dd(), Pr())); } function hN(n, a, d) { var p = n.current; p.lanes = a, ll(n, a, d), Ja(n, d); } function vN(n) { return ( // TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We // decided not to enable it. (Bt & na) !== Cr ); } function Ja(n, a) { var d = n.callbackNode; Ph(n, a); var p = au(n, n === Aa ? Fr : we); if (p === we) { d !== null && GE(d), n.callbackNode = null, n.callbackPriority = fr; return; } var v = Eo(p), b = n.callbackPriority; if (b === v && // Special case related to `act`. If the currently scheduled task is a // Scheduler task, rather than an `act` task, cancel it and re-scheduled // on the `act` queue. !(ao.current !== null && d !== ix)) { d == null && b !== Tt && g("Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue."); return; } d != null && GE(d); var T; if (v === Tt) n.tag === Xn ? (ao.isBatchingLegacy !== null && (ao.didScheduleLegacyUpdate = !0), Kc(NE.bind(null, n))) : hu(NE.bind(null, n)), vh ? ao.current !== null ? ao.current.push(Nr) : of(function() { (Bt & (na | Mi)) === Cr && Nr(); }) : dm(pa, Nr), T = null; else { var _; switch (Uc(p)) { case $r: _ = pa; break; case cs: _ = If; break; case ul: _ = Qr; break; case Af: _ = Uh; break; default: _ = Qr; break; } T = dm(_, RE.bind(null, n)); } n.callbackPriority = v, n.callbackNode = T; } function RE(n, a) { if (wR(), bp = Cn, am = we, (Bt & (na | Mi)) !== Cr) throw new Error("Should not already be working."); var d = n.callbackNode, p = Io(); if (p && n.callbackNode !== d) return null; var v = au(n, n === Aa ? Fr : we); if (v === we) return null; var b = !rl(n, v) && !zh(n, v) && !a, T = b ? MN(n, v) : lm(n, v); if (T !== Es) { if (T === Eu) { var _ = iu(n); _ !== we && (v = _, T = ex(n, _)); } if (T === hp) { var P = mp; throw ju(n, we), El(n, v), Ja(n, hr()), P; } if (T === q0) El(n, v); else { var z = !rl(n, v), F = n.current.alternate; if (z && !gN(F)) { if (T = lm(n, v), T === Eu) { var X = iu(n); X !== we && (v = X, T = ex(n, X)); } if (T === hp) { var le = mp; throw ju(n, we), El(n, v), Ja(n, hr()), le; } } n.finishedWork = F, n.finishedLanes = v, mN(n, T, v); } } return Ja(n, hr()), n.callbackNode === d ? RE.bind(null, n) : null; } function ex(n, a) { var d = yp; if (Ra(n)) { var p = ju(n, a); p.flags |= Oi, Xs(n.containerInfo); } var v = lm(n, a); if (v !== Eu) { var b = Za; Za = d, b !== null && PE(b); } return v; } function PE(n) { Za === null ? Za = n : Za.push.apply(Za, n); } function mN(n, a, d) { switch (a) { case Es: case hp: throw new Error("Root did not complete. This is a bug in React."); case Eu: { Tu(n, Za, ws); break; } case Zv: { if (El(n, d), Pf(d) && // do not delay if we're inside an act() scope !qE()) { var p = K0 + DE - hr(); if (p > 10) { var v = au(n, we); if (v !== we) break; var b = n.suspendedLanes; if (!il(b, d)) { ga(), _r(n, b); break; } n.timeoutHandle = nf(Tu.bind(null, n, Za, ws), p); break; } } Tu(n, Za, ws); break; } case vp: { if (El(n, d), Nf(d)) break; if (!qE()) { var T = kh(n, d), _ = T, P = hr() - _, z = BN(P) - P; if (z > 10) { n.timeoutHandle = nf(Tu.bind(null, n, Za, ws), z); break; } } Tu(n, Za, ws); break; } case TE: { Tu(n, Za, ws); break; } default: throw new Error("Unknown root exit status."); } } function gN(n) { for (var a = n; ; ) { if (a.flags & Ju) { var d = a.updateQueue; if (d !== null) { var p = d.stores; if (p !== null) for (var v = 0; v < p.length; v++) { var b = p[v], T = b.getSnapshot, _ = b.value; try { if (!or(T(), _)) return !1; } catch { return !1; } } } } var P = a.child; if (a.subtreeFlags & Ju && P !== null) { P.return = a, a = P; continue; } if (a === n) return !0; for (; a.sibling === null; ) { if (a.return === null || a.return === n) return !0; a = a.return; } a.sibling.return = a.return, a = a.sibling; } return !0; } function El(n, a) { a = lu(a, em), a = lu(a, gp), uu(n, a); } function NE(n) { if (jR(), (Bt & (na | Mi)) !== Cr) throw new Error("Should not already be working."); Io(); var a = au(n, we); if (!$n(a, Tt)) return Ja(n, hr()), null; var d = lm(n, a); if (n.tag !== Xn && d === Eu) { var p = iu(n); p !== we && (a = p, d = ex(n, p)); } if (d === hp) { var v = mp; throw ju(n, we), El(n, a), Ja(n, hr()), v; } if (d === q0) throw new Error("Root did not complete. This is a bug in React."); var b = n.current.alternate; return n.finishedWork = b, n.finishedLanes = a, Tu(n, Za, ws), Ja(n, hr()), null; } function yN(n, a) { a !== we && (Of(n, wt(a, Tt)), Ja(n, hr()), (Bt & (na | Mi)) === Cr && (dd(), Nr())); } function xN(n) { var a = fa(), d = Qn.transition; try { return Qn.transition = null, nr(ul), n(); } finally { nr(a), Qn.transition = d; } } function SN(n, a) { var d = Bt; Bt |= G0; try { return n(a); } finally { Bt = d, Bt === Cr && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode. !ao.isBatchingLegacy && (dd(), Pr()); } } function bN(n, a, d, p, v) { var b = fa(), T = Qn.transition; try { return Qn.transition = null, nr($r), n(a, d, p, v); } finally { nr(b), Qn.transition = T, Bt === Cr && dd(); } } function om(n) { bl !== null && bl.tag === Xn && (Bt & (na | Mi)) === Cr && Io(); var a = Bt; Bt |= G0; var d = Qn.transition, p = fa(); try { return Qn.transition = null, nr($r), n ? n() : void 0; } finally { nr(p), Qn.transition = d, Bt = a, (Bt & (na | Mi)) === Cr && Nr(); } } function CN() { return (Bt & (na | Mi)) !== Cr; } function EN(n) { var a = Bt; Bt |= G0; var d = Qn.transition, p = fa(); try { Qn.transition = null, nr($r), n(); } finally { nr(p), Qn.transition = d, Bt = a, Bt === Cr && (dd(), Nr()); } } function sm(n, a) { cr(Y0, zo, n), zo = wt(zo, a); } function tx(n) { zo = Y0.current, Rn(Y0, n); } function ju(n, a) { n.finishedWork = null, n.finishedLanes = we; var d = n.timeoutHandle; if (d !== rf && (n.timeoutHandle = rf, ri(d)), Zn !== null) for (var p = Zn.return; p !== null; ) { var v = p.alternate; oE(v, p), p = p.return; } Aa = n; var b = Du(n.current, null); return Zn = b, Fr = zo = a, Lr = Es, mp = null, Jv = we, gp = we, em = we, yp = null, Za = null, Jk(), ce.discardPendingWarnings(), b; } function OE(n, a) { do { var d = Zn; try { if (av(), uC(), gn(), W0.current = null, d === null || d.return === null) { Lr = hp, mp = a, Zn = null; return; } if (L && d.mode & Lt && zv(d, !0), A) if (_n(), a !== null && typeof a == "object" && typeof a.then == "function") { var p = a; Wc(d, p, Fr); } else ps(d, a, Fr); kR(n, d.return, d, a, Fr), FE(d); } catch (v) { a = v, Zn === d && d !== null ? (d = d.return, Zn = d) : d = Zn; continue; } return; } while (!0); } function AE() { var n = V0.current; return V0.current = Rv, n === null ? Rv : n; } function zE(n) { V0.current = n; } function wN() { K0 = hr(); } function Cp(n) { Jv = wt(n, Jv); } function jN() { Lr === Es && (Lr = Zv); } function nx() { (Lr === Es || Lr === Zv || Lr === Eu) && (Lr = vp), Aa !== null && (ou(Jv) || ou(gp)) && El(Aa, Fr); } function TN(n) { Lr !== vp && (Lr = Eu), yp === null ? yp = [n] : yp.push(n); } function DN() { return Lr === Es; } function lm(n, a) { var d = Bt; Bt |= na; var p = AE(); if (Aa !== n || Fr !== a) { if (ha) { var v = n.memoizedUpdaters; v.size > 0 && (Ep(n, Fr), v.clear()), Ih(n, a); } ws = it(), ju(n, a); } Gc(a); do try { _N(); break; } catch (b) { OE(n, b); } while (!0); if (av(), Bt = d, zE(p), Zn !== null) throw new Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue."); return hs(), Aa = null, Fr = we, Lr; } function _N() { for (; Zn !== null; ) IE(Zn); } function MN(n, a) { var d = Bt; Bt |= na; var p = AE(); if (Aa !== n || Fr !== a) { if (ha) { var v = n.memoizedUpdaters; v.size > 0 && (Ep(n, Fr), v.clear()), Ih(n, a); } ws = it(), dd(), ju(n, a); } Gc(a); do try { kN(); break; } catch (b) { OE(n, b); } while (!0); return av(), zE(p), Bt = d, Zn !== null ? (Ki(), Es) : (hs(), Aa = null, Fr = we, Lr); } function kN() { for (; Zn !== null && !Ei(); ) IE(Zn); } function IE(n) { var a = n.alternate; hn(n); var d; (n.mode & Lt) !== Ct ? (p0(n), d = rx(a, n, zo), zv(n, !0)) : d = rx(a, n, zo), gn(), n.memoizedProps = n.pendingProps, d === null ? FE(n) : Zn = d, W0.current = null; } function FE(n) { var a = n; do { var d = a.alternate, p = a.return; if ((a.flags & Gl) === rt) { hn(a); var v = void 0; if ((a.mode & Lt) === Ct ? v = iE(d, a, zo) : (p0(a), v = iE(d, a, zo), zv(a, !1)), gn(), v !== null) { Zn = v; return; } } else { var b = lP(d, a); if (b !== null) { b.flags &= Xd, Zn = b; return; } if ((a.mode & Lt) !== Ct) { zv(a, !1); for (var T = a.actualDuration, _ = a.child; _ !== null; ) T += _.actualDuration, _ = _.sibling; a.actualDuration = T; } if (p !== null) p.flags |= Gl, p.subtreeFlags = rt, p.deletions = null; else { Lr = q0, Zn = null; return; } } var P = a.sibling; if (P !== null) { Zn = P; return; } a = p, Zn = a; } while (a !== null); Lr === Es && (Lr = TE); } function Tu(n, a, d) { var p = fa(), v = Qn.transition; try { Qn.transition = null, nr($r), RN(n, a, d, p); } finally { Qn.transition = v, nr(p); } return null; } function RN(n, a, d, p) { do Io(); while (bl !== null); if (HN(), (Bt & (na | Mi)) !== Cr) throw new Error("Should not already be working."); var v = n.finishedWork, b = n.finishedLanes; if (sy(b), v === null) return du(), null; if (b === we && g("root.finishedLanes should not be empty during a commit. This is a bug in React."), n.finishedWork = null, n.finishedLanes = we, v === n.current) throw new Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."); n.callbackNode = null, n.callbackPriority = fr; var T = wt(v.lanes, v.childLanes); oy(n, T), n === Aa && (Aa = null, Zn = null, Fr = we), ((v.subtreeFlags & Bs) !== rt || (v.flags & Bs) !== rt) && (wu || (wu = !0, Q0 = d, dm(Qr, function() { return Io(), null; }))); var _ = (v.subtreeFlags & (Zd | ql | Yl | Bs)) !== rt, P = (v.flags & (Zd | ql | Yl | Bs)) !== rt; if (_ || P) { var z = Qn.transition; Qn.transition = null; var F = fa(); nr($r); var X = Bt; Bt |= Mi, W0.current = null, mP(n, v), OC(), RP(n, v, b), ts(n.containerInfo), n.current = v, Uf(b), PP(v, n, b), fu(), zf(), Bt = X, nr(F), Qn.transition = z; } else n.current = v, OC(); var le = wu; if (wu ? (wu = !1, bl = n, xp = b) : (pd = 0, rm = null), T = n.pendingLanes, T === we && (fd = null), le || HE(n.current, !1), cu(v.stateNode, p), ha && n.memoizedUpdaters.clear(), iN(), Ja(n, hr()), a !== null) for (var ye = n.onRecoverableError, je = 0; je < a.length; je++) { var Ee = a[je], gt = Ee.stack, Mt = Ee.digest; ye(Ee.value, { componentStack: gt, digest: Mt }); } if (tm) { tm = !1; var bt = X0; throw X0 = null, bt; } return $n(xp, Tt) && n.tag !== Xn && Io(), T = n.pendingLanes, $n(T, Tt) ? (ER(), n === Z0 ? Sp++ : (Sp = 0, Z0 = n)) : Sp = 0, Nr(), du(), null; } function Io() { if (bl !== null) { var n = Uc(xp), a = Bh(ul, n), d = Qn.transition, p = fa(); try { return Qn.transition = null, nr(a), NN(); } finally { nr(p), Qn.transition = d; } } return !1; } function PN(n) { $0.push(n), wu || (wu = !0, dm(Qr, function() { return Io(), null; })); } function NN() { if (bl === null) return !1; var n = Q0; Q0 = null; var a = bl, d = xp; if (bl = null, xp = we, (Bt & (na | Mi)) !== Cr) throw new Error("Cannot flush passive effects while already rendering."); J0 = !0, nm = !1, va(d); var p = Bt; Bt |= Mi, LP(a.current), AP(a, a.current, d, n); { var v = $0; $0 = []; for (var b = 0; b < v.length; b++) { var T = v[b]; SP(a, T); } } Hf(), HE(a.current, !0), Bt = p, Nr(), nm ? a === rm ? pd++ : (pd = 0, rm = a) : pd = 0, J0 = !1, nm = !1, Ff(a); { var _ = a.current.stateNode; _.effectDuration = 0, _.passiveEffectDuration = 0; } return !0; } function LE(n) { return fd !== null && fd.has(n); } function ON(n) { fd === null ? fd = /* @__PURE__ */ new Set([n]) : fd.add(n); } function AN(n) { tm || (tm = !0, X0 = n); } var zN = AN; function BE(n, a, d) { var p = bu(d, a), v = zC(n, p, Tt), b = vl(n, v, Tt), T = ga(); b !== null && (ll(b, Tt, T), Ja(b, T)); } function wn(n, a, d) { if (pP(d), wp(!1), n.tag === ae) { BE(n, n, d); return; } var p = null; for (p = a; p !== null; ) { if (p.tag === ae) { BE(p, n, d); return; } else if (p.tag === U) { var v = p.type, b = p.stateNode; if (typeof v.getDerivedStateFromError == "function" || typeof b.componentDidCatch == "function" && !LE(b)) { var T = bu(d, n), _ = x0(p, T, Tt), P = vl(p, _, Tt), z = ga(); P !== null && (ll(P, Tt, z), Ja(P, z)); return; } } p = p.return; } g(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer. Error message: %s`, d); } function IN(n, a, d) { var p = n.pingCache; p !== null && p.delete(a); var v = ga(); _r(n, d), qN(n), Aa === n && il(Fr, d) && (Lr === vp || Lr === Zv && Pf(Fr) && hr() - K0 < DE ? ju(n, we) : em = wt(em, d)), Ja(n, v); } function UE(n, a) { a === fr && (a = pN(n)); var d = ga(), p = Na(n, a); p !== null && (ll(p, a, d), Ja(p, d)); } function FN(n) { var a = n.memoizedState, d = fr; a !== null && (d = a.retryLane), UE(n, d); } function LN(n, a) { var d = fr, p; switch (n.tag) { case se: p = n.stateNode; var v = n.memoizedState; v !== null && (d = v.retryLane); break; case be: p = n.stateNode; break; default: throw new Error("Pinged unknown suspense boundary type. This is probably a bug in React."); } p !== null && p.delete(a), UE(n, d); } function BN(n) { return n < 120 ? 120 : n < 480 ? 480 : n < 1080 ? 1080 : n < 1920 ? 1920 : n < 3e3 ? 3e3 : n < 4320 ? 4320 : uN(n / 1960) * 1960; } function UN() { if (Sp > dN) throw Sp = 0, Z0 = null, new Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops."); pd > fN && (pd = 0, rm = null, g("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")); } function HN() { ce.flushLegacyContextWarning(), ce.flushPendingUnsafeLifecycleWarnings(); } function HE(n, a) { hn(n), um(n, zi, KP), a && um(n, ec, XP), um(n, zi, qP), a && um(n, ec, YP), gn(); } function um(n, a, d) { for (var p = n, v = null; p !== null; ) { var b = p.subtreeFlags & a; p !== v && p.child !== null && b !== rt ? p = p.child : ((p.flags & a) !== rt && d(p), p.sibling !== null ? p = p.sibling : p = v = p.return); } } var cm = null; function VE(n) { { if ((Bt & na) !== Cr || !(n.mode & qt)) return; var a = n.tag; if (a !== $ && a !== ae && a !== U && a !== q && a !== te && a !== B && a !== re) return; var d = st(n) || "ReactComponent"; if (cm !== null) { if (cm.has(d)) return; cm.add(d); } else cm = /* @__PURE__ */ new Set([d]); var p = xt; try { hn(n), g("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead."); } finally { p ? hn(n) : gn(); } } } var rx; { var VN = null; rx = function(n, a, d) { var p = QE(VN, a); try { return tE(n, a, d); } catch (b) { if (Kh() || b !== null && typeof b == "object" && typeof b.then == "function") throw b; if (av(), uC(), oE(n, a), QE(a, p), a.mode & Lt && p0(a), uE(null, tE, null, n, a, d), dP()) { var v = cE(); typeof v == "object" && v !== null && v._suppressLogging && typeof b == "object" && b !== null && !b._suppressLogging && (b._suppressLogging = !0); } throw b; } }; } var WE = !1, ax; ax = /* @__PURE__ */ new Set(); function WN(n) { if (Ke && !SR()) switch (n.tag) { case q: case te: case re: { var a = Zn && st(Zn) || "Unknown", d = a; if (!ax.has(d)) { ax.add(d); var p = st(n) || "Unknown"; g("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render", p, a, a); } break; } case U: { WE || (g("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."), WE = !0); break; } } } function Ep(n, a) { if (ha) { var d = n.memoizedUpdaters; d.forEach(function(p) { Mr(n, p, a); }); } } var ix = {}; function dm(n, a) { { var d = ao.current; return d !== null ? (d.push(a), ix) : yr(n, a); } } function GE(n) { if (n !== ix) return fi(n); } function qE() { return ao.current !== null; } function GN(n) { { if (n.mode & qt) { if (!jE()) return; } else if (!lN() || Bt !== Cr || n.tag !== q && n.tag !== te && n.tag !== re) return; if (ao.current === null) { var a = xt; try { hn(n), g(`An update to %s inside a test was not wrapped in act(...). When testing, code that causes React state updates should be wrapped into act(...): act(() => { /* fire events that update state */ }); /* assert on the output */ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`, st(n)); } finally { a ? hn(n) : gn(); } } } } function qN(n) { n.tag !== Xn && jE() && ao.current === null && g(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...). When testing, code that resolves suspended data should be wrapped into act(...): act(() => { /* finish loading suspended data */ }); /* assert on the output */ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act`); } function wp(n) { kE = n; } var ki = null, hd = null, YN = function(n) { ki = n; }; function vd(n) { { if (ki === null) return n; var a = ki(n); return a === void 0 ? n : a.current; } } function ox(n) { return vd(n); } function sx(n) { { if (ki === null) return n; var a = ki(n); if (a === void 0) { if (n != null && typeof n.render == "function") { var d = vd(n.render); if (n.render !== d) { var p = { $$typeof: Wn, render: d }; return n.displayName !== void 0 && (p.displayName = n.displayName), p; } } return n; } return a.current; } } function YE(n, a) { { if (ki === null) return !1; var d = n.elementType, p = a.type, v = !1, b = typeof p == "object" && p !== null ? p.$$typeof : null; switch (n.tag) { case U: { typeof p == "function" && (v = !0); break; } case q: { (typeof p == "function" || b === Fe) && (v = !0); break; } case te: { (b === Wn || b === Fe) && (v = !0); break; } case B: case re: { (b === He || b === Fe) && (v = !0); break; } default: return !1; } if (v) { var T = ki(d); if (T !== void 0 && T === ki(p)) return !0; } return !1; } } function KE(n) { { if (ki === null || typeof WeakSet != "function") return; hd === null && (hd = /* @__PURE__ */ new WeakSet()), hd.add(n); } } var KN = function(n, a) { { if (ki === null) return; var d = a.staleFamilies, p = a.updatedFamilies; Io(), om(function() { lx(n.current, p, d); }); } }, XN = function(n, a) { { if (n.context !== ua) return; Io(), om(function() { ew(a, n, null, null); }); } }; function lx(n, a, d) { { var p = n.alternate, v = n.child, b = n.sibling, T = n.tag, _ = n.type, P = null; switch (T) { case q: case re: case U: P = _; break; case te: P = _.render; break; } if (ki === null) throw new Error("Expected resolveFamily to be set during hot reload."); var z = !1, F = !1; if (P !== null) { var X = ki(P); X !== void 0 && (d.has(X) ? F = !0 : a.has(X) && (T === U ? F = !0 : z = !0)); } if (hd !== null && (hd.has(n) || p !== null && hd.has(p)) && (F = !0), F && (n._debugNeedsRemount = !0), F || z) { var le = Na(n, Tt); le !== null && Er(le, n, Tt, Cn); } v !== null && !F && lx(v, a, d), b !== null && lx(b, a, d); } } var $N = function(n, a) { { var d = /* @__PURE__ */ new Set(), p = new Set(a.map(function(v) { return v.current; })); return ux(n.current, p, d), d; } }; function ux(n, a, d) { { var p = n.child, v = n.sibling, b = n.tag, T = n.type, _ = null; switch (b) { case q: case re: case U: _ = T; break; case te: _ = T.render; break; } var P = !1; _ !== null && a.has(_) && (P = !0), P ? QN(n, d) : p !== null && ux(p, a, d), v !== null && ux(v, a, d); } } function QN(n, a) { { var d = ZN(n, a); if (d) return; for (var p = n; ; ) { switch (p.tag) { case Y: a.add(p.stateNode); return; case oe: a.add(p.stateNode.containerInfo); return; case ae: a.add(p.stateNode.containerInfo); return; } if (p.return === null) throw new Error("Expected to reach root first."); p = p.return; } } } function ZN(n, a) { for (var d = n, p = !1; ; ) { if (d.tag === Y) p = !0, a.add(d.stateNode); else if (d.child !== null) { d.child.return = d, d = d.child; continue; } if (d === n) return p; for (; d.sibling === null; ) { if (d.return === null || d.return === n) return p; d = d.return; } d.sibling.return = d.return, d = d.sibling; } return !1; } var cx; { cx = !1; try { var XE = Object.preventExtensions({}); } catch { cx = !0; } } function JN(n, a, d, p) { this.tag = n, this.key = d, this.elementType = null, this.type = null, this.stateNode = null, this.return = null, this.child = null, this.sibling = null, this.index = 0, this.ref = null, this.pendingProps = a, this.memoizedProps = null, this.updateQueue = null, this.memoizedState = null, this.dependencies = null, this.mode = p, this.flags = rt, this.subtreeFlags = rt, this.deletions = null, this.lanes = we, this.childLanes = we, this.alternate = null, this.actualDuration = Number.NaN, this.actualStartTime = Number.NaN, this.selfBaseDuration = Number.NaN, this.treeBaseDuration = Number.NaN, this.actualDuration = 0, this.actualStartTime = -1, this.selfBaseDuration = 0, this.treeBaseDuration = 0, this._debugSource = null, this._debugOwner = null, this._debugNeedsRemount = !1, this._debugHookTypes = null, !cx && typeof Object.preventExtensions == "function" && Object.preventExtensions(this); } var vi = function(n, a, d, p) { return new JN(n, a, d, p); }; function dx(n) { var a = n.prototype; return !!(a && a.isReactComponent); } function eO(n) { return typeof n == "function" && !dx(n) && n.defaultProps === void 0; } function tO(n) { if (typeof n == "function") return dx(n) ? U : q; if (n != null) { var a = n.$$typeof; if (a === Wn) return te; if (a === He) return B; } return $; } function Du(n, a) { var d = n.alternate; d === null ? (d = vi(n.tag, a, n.key, n.mode), d.elementType = n.elementType, d.type = n.type, d.stateNode = n.stateNode, d._debugSource = n._debugSource, d._debugOwner = n._debugOwner, d._debugHookTypes = n._debugHookTypes, d.alternate = n, n.alternate = d) : (d.pendingProps = a, d.type = n.type, d.flags = rt, d.subtreeFlags = rt, d.deletions = null, d.actualDuration = 0, d.actualStartTime = -1), d.flags = n.flags & Ii, d.childLanes = n.childLanes, d.lanes = n.lanes, d.child = n.child, d.memoizedProps = n.memoizedProps, d.memoizedState = n.memoizedState, d.updateQueue = n.updateQueue; var p = n.dependencies; switch (d.dependencies = p === null ? null : { lanes: p.lanes, firstContext: p.firstContext }, d.sibling = n.sibling, d.index = n.index, d.ref = n.ref, d.selfBaseDuration = n.selfBaseDuration, d.treeBaseDuration = n.treeBaseDuration, d._debugNeedsRemount = n._debugNeedsRemount, d.tag) { case $: case q: case re: d.type = vd(n.type); break; case U: d.type = ox(n.type); break; case te: d.type = sx(n.type); break; } return d; } function nO(n, a) { n.flags &= Ii | bn; var d = n.alternate; if (d === null) n.childLanes = we, n.lanes = a, n.child = null, n.subtreeFlags = rt, n.memoizedProps = null, n.memoizedState = null, n.updateQueue = null, n.dependencies = null, n.stateNode = null, n.selfBaseDuration = 0, n.treeBaseDuration = 0; else { n.childLanes = d.childLanes, n.lanes = d.lanes, n.child = d.child, n.subtreeFlags = rt, n.deletions = null, n.memoizedProps = d.memoizedProps, n.memoizedState = d.memoizedState, n.updateQueue = d.updateQueue, n.type = d.type; var p = d.dependencies; n.dependencies = p === null ? null : { lanes: p.lanes, firstContext: p.firstContext }, n.selfBaseDuration = d.selfBaseDuration, n.treeBaseDuration = d.treeBaseDuration; } return n; } function rO(n, a, d) { var p; return n === bc ? (p = qt, a === !0 && (p |= cn, p |= ca)) : p = Ct, ha && (p |= Lt), vi(ae, null, null, p); } function fx(n, a, d, p, v, b) { var T = $, _ = n; if (typeof n == "function") dx(n) ? (T = U, _ = ox(_)) : _ = vd(_); else if (typeof n == "string") T = Y; else { e: switch (n) { case Ot: return wl(d.children, v, b, a); case Qe: T = fe, v |= cn, (v & qt) !== Ct && (v |= ca); break; case rn: return aO(d, v, b, a); case tr: return iO(d, v, b, a); case Q: return oO(d, v, b, a); case Ae: return $E(d, v, b, a); case Dt: case at: case Ht: case Te: case he: default: { if (typeof n == "object" && n !== null) switch (n.$$typeof) { case Tn: T = Me; break e; case pn: T = _e; break e; case Wn: T = te, _ = sx(_); break e; case He: T = B; break e; case Fe: T = ke, _ = null; break e; } var P = ""; { (n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (P += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var z = p ? st(p) : null; z && (P += ` Check the render method of \`` + z + "`."); } throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + ("but got: " + (n == null ? n : typeof n) + "." + P)); } } } var F = vi(T, d, a, v); return F.elementType = n, F.type = _, F.lanes = b, F._debugOwner = p, F; } function px(n, a, d) { var p = null; p = n._owner; var v = n.type, b = n.key, T = n.props, _ = fx(v, b, T, p, a, d); return _._debugSource = n._source, _._debugOwner = n._owner, _; } function wl(n, a, d, p) { var v = vi(de, n, p, a); return v.lanes = d, v; } function aO(n, a, d, p) { typeof n.id != "string" && g('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof n.id); var v = vi(K, n, p, a | Lt); return v.elementType = rn, v.lanes = d, v.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }, v; } function iO(n, a, d, p) { var v = vi(se, n, p, a); return v.elementType = tr, v.lanes = d, v; } function oO(n, a, d, p) { var v = vi(be, n, p, a); return v.elementType = Q, v.lanes = d, v; } function $E(n, a, d, p) { var v = vi(Ue, n, p, a); v.elementType = Ae, v.lanes = d; var b = { isHidden: !1 }; return v.stateNode = b, v; } function hx(n, a, d) { var p = vi(ve, n, null, a); return p.lanes = d, p; } function sO() { var n = vi(Y, null, null, Ct); return n.elementType = "DELETED", n; } function lO(n) { var a = vi(Se, null, null, Ct); return a.stateNode = n, a; } function vx(n, a, d) { var p = n.children !== null ? n.children : [], v = vi(oe, p, n.key, a); return v.lanes = d, v.stateNode = { containerInfo: n.containerInfo, pendingChildren: null, // Used by persistent updates implementation: n.implementation }, v; } function QE(n, a) { return n === null && (n = vi($, null, null, Ct)), n.tag = a.tag, n.key = a.key, n.elementType = a.elementType, n.type = a.type, n.stateNode = a.stateNode, n.return = a.return, n.child = a.child, n.sibling = a.sibling, n.index = a.index, n.ref = a.ref, n.pendingProps = a.pendingProps, n.memoizedProps = a.memoizedProps, n.updateQueue = a.updateQueue, n.memoizedState = a.memoizedState, n.dependencies = a.dependencies, n.mode = a.mode, n.flags = a.flags, n.subtreeFlags = a.subtreeFlags, n.deletions = a.deletions, n.lanes = a.lanes, n.childLanes = a.childLanes, n.alternate = a.alternate, n.actualDuration = a.actualDuration, n.actualStartTime = a.actualStartTime, n.selfBaseDuration = a.selfBaseDuration, n.treeBaseDuration = a.treeBaseDuration, n._debugSource = a._debugSource, n._debugOwner = a._debugOwner, n._debugNeedsRemount = a._debugNeedsRemount, n._debugHookTypes = a._debugHookTypes, n; } function uO(n, a, d, p, v) { this.tag = a, this.containerInfo = n, this.pendingChildren = null, this.current = null, this.pingCache = null, this.finishedWork = null, this.timeoutHandle = rf, this.context = null, this.pendingContext = null, this.callbackNode = null, this.callbackPriority = fr, this.eventTimes = sl(we), this.expirationTimes = sl(Cn), this.pendingLanes = we, this.suspendedLanes = we, this.pingedLanes = we, this.expiredLanes = we, this.mutableReadLanes = we, this.finishedLanes = we, this.entangledLanes = we, this.entanglements = sl(we), this.identifierPrefix = p, this.onRecoverableError = v, Vr && (this.mutableSourceEagerHydrationData = null), this.effectDuration = 0, this.passiveEffectDuration = 0; { this.memoizedUpdaters = /* @__PURE__ */ new Set(); for (var b = this.pendingUpdatersLaneMap = [], T = 0; T < Ec; T++) b.push(/* @__PURE__ */ new Set()); } switch (a) { case bc: this._debugRootType = d ? "hydrateRoot()" : "createRoot()"; break; case Xn: this._debugRootType = d ? "hydrate()" : "render()"; break; } } function ZE(n, a, d, p, v, b, T, _, P, z) { var F = new uO(n, a, d, _, P), X = rO(a, b); F.current = X, X.stateNode = F; { var le = { element: p, isDehydrated: d, cache: null, // not enabled yet transitions: null, pendingSuspenseBoundaries: null }; X.memoizedState = le; } return Sy(X), F; } var cO = "18.2.0"; function dO(n, a, d) { var p = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; return Xk(p), { // This tag allow us to uniquely identify this as a React Portal $$typeof: yt, key: p == null ? null : "" + p, children: n, containerInfo: a, implementation: d }; } var mx, gx; mx = !1, gx = {}; function JE(n) { if (!n) return ua; var a = w(n), d = ay(a); if (a.tag === U) { var p = a.type; if (Gr(p)) return eu(a, p, d); } return d; } function fO(n) { var a = w(n); if (a === void 0) { if (typeof n.render == "function") throw new Error("Unable to find node on an unmounted component."); var d = Object.keys(n).join(","); throw new Error("Argument appears to not be a ReactComponent. Keys: " + d); } var p = Kl(a); return p === null ? null : p.stateNode; } function pO(n, a) { { var d = w(n); if (d === void 0) { if (typeof n.render == "function") throw new Error("Unable to find node on an unmounted component."); var p = Object.keys(n).join(","); throw new Error("Argument appears to not be a ReactComponent. Keys: " + p); } var v = Kl(d); if (v === null) return null; if (v.mode & cn) { var b = st(d) || "Component"; if (!gx[b]) { gx[b] = !0; var T = xt; try { hn(v), d.mode & cn ? g("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", a, a, b) : g("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node", a, a, b); } finally { T ? hn(T) : gn(); } } } return v.stateNode; } } function hO(n, a, d, p, v, b, T, _) { var P = !1, z = null; return ZE(n, a, P, z, d, p, v, b, T); } function vO(n, a, d, p, v, b, T, _, P, z) { var F = !0, X = ZE(d, p, F, n, v, b, T, _, P); X.context = JE(null); var le = X.current, ye = ga(), je = Cl(le), Ee = bs(ye, je); return Ee.callback = a ?? null, vl(le, Ee, je), hN(X, je, ye), X; } function ew(n, a, d, p) { Vc(a, n); var v = a.current, b = ga(), T = Cl(v); qc(T); var _ = JE(d); a.context === null ? a.context = _ : a.pendingContext = _, Ke && xt !== null && !mx && (mx = !0, g(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of %s.`, st(xt) || "Unknown")); var P = bs(b, T); P.payload = { element: n }, p = p === void 0 ? null : p, p !== null && (typeof p != "function" && g("render(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", p), P.callback = p); var z = vl(v, P, T); return z !== null && (Er(z, v, T, b), uv(z, v, T)), T; } function mO(n) { var a = n.current; if (!a.child) return null; switch (a.child.tag) { case Y: return mn(a.child.stateNode); default: return a.child.stateNode; } } function gO(n) { switch (n.tag) { case ae: { var a = n.stateNode; if (Ra(a)) { var d = Nh(a); yN(a, d); } break; } case se: { om(function() { var v = Na(n, Tt); if (v !== null) { var b = ga(); Er(v, n, Tt, b); } }); var p = Tt; fm(n, p); break; } } } function tw(n, a) { var d = n.memoizedState; d !== null && d.dehydrated !== null && (d.retryLane = Fc(d.retryLane, a)); } function fm(n, a) { tw(n, a); var d = n.alternate; d && tw(d, a); } function yO(n) { if (n.tag === se) { var a = Tt, d = Na(n, a); if (d !== null) { var p = ga(); Er(d, n, a, p); } fm(n, a); } } function xO(n) { if (n.tag === se) { var a = ls, d = Na(n, a); if (d !== null) { var p = ga(); Er(d, n, a, p); } fm(n, a); } } function SO(n) { if (n.tag === se) { var a = Cl(n), d = Na(n, a); if (d !== null) { var p = ga(); Er(d, n, a, p); } fm(n, a); } } function bO(n) { var a = ef(n); return a === null ? null : a.stateNode; } var nw = function(n) { return null; }; function rw(n) { return nw(n); } var aw = function(n) { return !1; }; function iw(n) { return aw(n); } var ow = null, sw = null, lw = null, uw = null, cw = null, dw = null, fw = null, pw = null, hw = null; { var vw = function(n, a, d) { var p = a[d], v = Gt(n) ? n.slice() : E({}, n); return d + 1 === a.length ? (Gt(v) ? v.splice(p, 1) : delete v[p], v) : (v[p] = vw(n[p], a, d + 1), v); }, mw = function(n, a) { return vw(n, a, 0); }, gw = function(n, a, d, p) { var v = a[p], b = Gt(n) ? n.slice() : E({}, n); if (p + 1 === a.length) { var T = d[p]; b[T] = b[v], Gt(b) ? b.splice(v, 1) : delete b[v]; } else b[v] = gw( // $FlowFixMe number or string is fine here n[v], a, d, p + 1 ); return b; }, yw = function(n, a, d) { if (a.length !== d.length) { y("copyWithRename() expects paths of the same length"); return; } else for (var p = 0; p < d.length - 1; p++) if (a[p] !== d[p]) { y("copyWithRename() expects paths to be the same except for the deepest key"); return; } return gw(n, a, d, 0); }, xw = function(n, a, d, p) { if (d >= a.length) return p; var v = a[d], b = Gt(n) ? n.slice() : E({}, n); return b[v] = xw(n[v], a, d + 1, p), b; }, Sw = function(n, a, d) { return xw(n, a, 0, d); }, yx = function(n, a) { for (var d = n.memoizedState; d !== null && a > 0; ) d = d.next, a--; return d; }; ow = function(n, a, d, p) { var v = yx(n, a); if (v !== null) { var b = Sw(v.memoizedState, d, p); v.memoizedState = b, v.baseState = b, n.memoizedProps = E({}, n.memoizedProps); var T = Na(n, Tt); T !== null && Er(T, n, Tt, Cn); } }, sw = function(n, a, d) { var p = yx(n, a); if (p !== null) { var v = mw(p.memoizedState, d); p.memoizedState = v, p.baseState = v, n.memoizedProps = E({}, n.memoizedProps); var b = Na(n, Tt); b !== null && Er(b, n, Tt, Cn); } }, lw = function(n, a, d, p) { var v = yx(n, a); if (v !== null) { var b = yw(v.memoizedState, d, p); v.memoizedState = b, v.baseState = b, n.memoizedProps = E({}, n.memoizedProps); var T = Na(n, Tt); T !== null && Er(T, n, Tt, Cn); } }, uw = function(n, a, d) { n.pendingProps = Sw(n.memoizedProps, a, d), n.alternate && (n.alternate.pendingProps = n.pendingProps); var p = Na(n, Tt); p !== null && Er(p, n, Tt, Cn); }, cw = function(n, a) { n.pendingProps = mw(n.memoizedProps, a), n.alternate && (n.alternate.pendingProps = n.pendingProps); var d = Na(n, Tt); d !== null && Er(d, n, Tt, Cn); }, dw = function(n, a, d) { n.pendingProps = yw(n.memoizedProps, a, d), n.alternate && (n.alternate.pendingProps = n.pendingProps); var p = Na(n, Tt); p !== null && Er(p, n, Tt, Cn); }, fw = function(n) { var a = Na(n, Tt); a !== null && Er(a, n, Tt, Cn); }, pw = function(n) { nw = n; }, hw = function(n) { aw = n; }; } function CO(n) { var a = Kl(n); return a === null ? null : a.stateNode; } function EO(n) { return null; } function wO() { return xt; } function jO(n) { var a = n.findFiberByHostInstance, d = c.ReactCurrentDispatcher; return Hc({ bundleType: n.bundleType, version: n.version, rendererPackageName: n.rendererPackageName, rendererConfig: n.rendererConfig, overrideHookState: ow, overrideHookStateDeletePath: sw, overrideHookStateRenamePath: lw, overrideProps: uw, overridePropsDeletePath: cw, overridePropsRenamePath: dw, setErrorHandler: pw, setSuspenseHandler: hw, scheduleUpdate: fw, currentDispatcherRef: d, findHostInstanceByFiber: CO, findFiberByHostInstance: a || EO, // React Refresh findHostInstancesForRefresh: $N, scheduleRefresh: KN, scheduleRoot: XN, setRefreshHandler: YN, // Enables DevTools to append owner stacks to error messages in DEV mode. getCurrentFiber: wO, // Enables DevTools to detect reconciler version rather than renderer version // which may not match for third party renderers. reconcilerVersion: cO }); } return r.attemptContinuousHydration = xO, r.attemptDiscreteHydration = yO, r.attemptHydrationAtCurrentPriority = SO, r.attemptSynchronousHydration = gO, r.batchedUpdates = SN, r.createComponentSelector = $P, r.createContainer = hO, r.createHasPseudoClassSelector = QP, r.createHydrationContainer = vO, r.createPortal = dO, r.createRoleSelector = ZP, r.createTestNameSelector = eN, r.createTextSelector = JP, r.deferredUpdates = xN, r.discreteUpdates = bN, r.findAllNodes = $v, r.findBoundingRects = rN, r.findHostInstance = fO, r.findHostInstanceWithNoPortals = bO, r.findHostInstanceWithWarning = pO, r.flushControlled = EN, r.flushPassiveEffects = Io, r.flushSync = om, r.focusWithin = aN, r.getCurrentUpdatePriority = fa, r.getFindAllNodesFailureDescription = nN, r.getPublicRootInstance = mO, r.injectIntoDevTools = jO, r.isAlreadyRendering = CN, r.observeVisibleRects = oN, r.registerMutableSourceForHydration = hR, r.runWithPriority = Fh, r.shouldError = rw, r.shouldSuspend = iw, r.updateContainer = ew, r; })), ug; } (function(e) { process.env.NODE_ENV === "production" ? e.exports = mW() : e.exports = yW(); })(fW); const xW = /* @__PURE__ */ tz(ZS); var cg = {}, SW = { get exports() { return cg; }, set exports(e) { cg = e; } }, Tl = {}; /** * @license React * react-reconciler-constants.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 GT; function bW() { return GT || (GT = 1, Tl.ConcurrentRoot = 1, Tl.ContinuousEventPriority = 4, Tl.DefaultEventPriority = 16, Tl.DiscreteEventPriority = 1, Tl.IdleEventPriority = 536870912, Tl.LegacyRoot = 0), Tl; } var Dl = {}; /** * @license React * react-reconciler-constants.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 qT; function CW() { return qT || (qT = 1, process.env.NODE_ENV !== "production" && function() { var e = ( /* */ 1 ), t = ( /* */ 4 ), r = ( /* */ 16 ), i = ( /* */ 536870912 ), s = e, c = t, f = r, m = i, y = 0, g = 1; Dl.ConcurrentRoot = g, Dl.ContinuousEventPriority = c, Dl.DefaultEventPriority = f, Dl.DiscreteEventPriority = s, Dl.IdleEventPriority = m, Dl.LegacyRoot = y; }()), Dl; } (function(e) { process.env.NODE_ENV === "production" ? e.exports = bW() : e.exports = CW(); })(SW); const YT = { children: !0, ref: !0, key: !0, style: !0, forwardedRef: !0, unstable_applyCache: !0, unstable_applyDrawHitFromCache: !0 }; let KT = !1, XT = !1; const M1 = ".react-konva-event", EW = `ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. Position of a node will be changed during drag&drop, so you should update state of the react app as well. Consider to add onDragMove or onDragEnd events. For more info see: https://github.com/konvajs/react-konva/issues/256 `, wW = `ReactKonva: You are using "zIndex" attribute for a Konva node. react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. For more info see: https://github.com/konvajs/react-konva/issues/194 `, jW = {}; function Ig(e, t, r = jW) { if (!KT && "zIndex" in t && (console.warn(wW), KT = !0), !XT && t.draggable) { var i = t.x !== void 0 || t.y !== void 0, s = t.onDragEnd || t.onDragMove; i && !s && (console.warn(EW), XT = !0); } for (var c in r) if (!YT[c]) { var f = c.slice(0, 2) === "on", m = r[c] !== t[c]; if (f && m) { var y = c.substr(2).toLowerCase(); y.substr(0, 7) === "content" && (y = "content" + y.substr(7, 1).toUpperCase() + y.substr(8)), e.off(y, r[c]); } var g = !t.hasOwnProperty(c); g && e.setAttr(c, void 0); } var S = t._useStrictMode, E = {}, w = !1; const D = {}; for (var c in t) if (!YT[c]) { var f = c.slice(0, 2) === "on", M = r[c] !== t[c]; if (f && M) { var y = c.substr(2).toLowerCase(); y.substr(0, 7) === "content" && (y = "content" + y.substr(7, 1).toUpperCase() + y.substr(8)), t[c] && (D[y] = t[c]); } !f && (t[c] !== r[c] || S && t[c] !== e.getAttr(c)) && (w = !0, E[c] = t[c]); } w && (e.setAttrs(E), Hl(e)); for (var y in D) e.on(y + M1, D[y]); } function Hl(e) { if (!nz.autoDrawEnabled) { var t = e.getLayer() || e.getStage(); t && t.batchDraw(); } } const hk = {}, TW = {}; Fp.Node.prototype._applyProps = Ig; function DW(e, t) { if (typeof t == "string") { console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`); return; } e.add(t), Hl(e); } function _W(e, t, r) { let i = Fp[e]; i || (console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`), i = Fp.Group); const s = {}, c = {}; for (var f in t) { var m = f.slice(0, 2) === "on"; m ? c[f] = t[f] : s[f] = t[f]; } const y = new i(s); return Ig(y, c), y; } function MW(e, t, r) { console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`); } function kW(e, t, r) { return !1; } function RW(e) { return e; } function PW() { return null; } function NW() { return null; } function OW(e, t, r, i) { return TW; } function AW() { } function zW(e) { } function IW(e, t) { return !1; } function FW() { return hk; } function LW() { return hk; } const BW = setTimeout, UW = clearTimeout, HW = -1; function VW(e, t) { return !1; } const WW = !1, GW = !0, qW = !0; function YW(e, t) { t.parent === e ? t.moveToTop() : e.add(t), Hl(e); } function KW(e, t) { t.parent === e ? t.moveToTop() : e.add(t), Hl(e); } function vk(e, t, r) { t._remove(), e.add(t), t.setZIndex(r.getZIndex()), Hl(e); } function XW(e, t, r) { vk(e, t, r); } function $W(e, t) { t.destroy(), t.off(M1), Hl(e); } function QW(e, t) { t.destroy(), t.off(M1), Hl(e); } function ZW(e, t, r) { console.error(`Text components are not yet supported in ReactKonva. You text is: "${r}"`); } function JW(e, t, r) { } function eG(e, t, r, i, s) { Ig(e, s, i); } function tG(e) { e.hide(), Hl(e); } function nG(e) { } function rG(e, t) { (t.visible == null || t.visible) && e.show(); } function aG(e, t) { } function iG(e) { } function oG() { } const sG = () => cg.DefaultEventPriority, lG = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, appendChild: YW, appendChildToContainer: KW, appendInitialChild: DW, cancelTimeout: UW, clearContainer: iG, commitMount: JW, commitTextUpdate: ZW, commitUpdate: eG, createInstance: _W, createTextInstance: MW, detachDeletedInstance: oG, finalizeInitialChildren: kW, getChildHostContext: LW, getCurrentEventPriority: sG, getPublicInstance: RW, getRootHostContext: FW, hideInstance: tG, hideTextInstance: nG, idlePriority: Lu.unstable_IdlePriority, insertBefore: vk, insertInContainerBefore: XW, isPrimaryRenderer: WW, noTimeout: HW, now: Lu.unstable_now, prepareForCommit: PW, preparePortalMount: NW, prepareUpdate: OW, removeChild: $W, removeChildFromContainer: QW, resetAfterCommit: AW, resetTextContent: zW, run: Lu.unstable_runWithPriority, scheduleTimeout: BW, shouldDeprioritizeSubtree: IW, shouldSetTextContent: VW, supportsMutation: qW, unhideInstance: rG, unhideTextInstance: aG, warnsIfNotActing: GW }, Symbol.toStringTag, { value: "Module" })); var uG = Object.defineProperty, cG = Object.defineProperties, dG = Object.getOwnPropertyDescriptors, $T = Object.getOwnPropertySymbols, fG = Object.prototype.hasOwnProperty, pG = Object.prototype.propertyIsEnumerable, QT = (e, t, r) => t in e ? uG(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ZT = (e, t) => { for (var r in t || (t = {})) fG.call(t, r) && QT(e, r, t[r]); if ($T) for (var r of $T(t)) pG.call(t, r) && QT(e, r, t[r]); return e; }, hG = (e, t) => cG(e, dG(t)); function mk(e, t, r) { if (!e) return; if (r(e) === !0) return e; let i = t ? e.return : e.child; for (; i; ) { const s = mk(i, t, r); if (s) return s; i = t ? null : i.sibling; } } function gk(e) { try { return Object.defineProperties(e, { _currentRenderer: { get() { return null; }, set() { } }, _currentRenderer2: { get() { return null; }, set() { } } }); } catch { return e; } } const k1 = gk(Ge.createContext(null)); class yk extends Ge.Component { render() { return /* @__PURE__ */ Ge.createElement(k1.Provider, { value: this._reactInternals }, this.props.children); } } const { ReactCurrentOwner: vG, ReactCurrentDispatcher: mG } = Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function gG() { const e = Ge.useContext(k1); if (!e) throw new Error("its-fine: useFiber must be called within a !"); const t = Ge.useId(); return Ge.useMemo( () => { var i; return (i = vG.current) != null ? i : mk(e, !1, (s) => { let c = s.memoizedState; for (; c; ) { if (c.memoizedState === t) return !0; c = c.next; } }); }, [e, t] ); } function yG() { var e, t; const r = gG(), [i] = Ge.useState(() => /* @__PURE__ */ new Map()); i.clear(); let s = r; for (; s; ) { const c = (e = s.type) == null ? void 0 : e._context; c && c !== k1 && !i.has(c) && i.set(c, (t = mG.current) == null ? void 0 : t.readContext(gk(c))), s = s.return; } return Ge.useMemo( () => Array.from(i.keys()).reduce( (c, f) => (m) => /* @__PURE__ */ Ge.createElement(c, null, /* @__PURE__ */ Ge.createElement(f.Provider, hG(ZT({}, m), { value: i.get(f) }))), (c) => /* @__PURE__ */ Ge.createElement(yk, ZT({}, c)) ), [i] ); } function xG(e) { const t = jt.useRef(); return jt.useLayoutEffect(() => { t.current = e; }), t.current; } const SG = (e) => { const t = jt.useRef(), r = jt.useRef(), i = jt.useRef(), s = xG(e), c = yG(), f = (m) => { const { forwardedRef: y } = e; y && (typeof y == "function" ? y(m) : y.current = m); }; return jt.useLayoutEffect(() => (r.current = new Fp.Stage({ width: e.width, height: e.height, container: t.current }), f(r.current), i.current = Np.createContainer(r.current, cg.LegacyRoot, !1, null), Np.updateContainer(jt.createElement(c, {}, e.children), i.current), () => { Fp.isBrowser && (f(null), Np.updateContainer(null, i.current, null), r.current.destroy()); }), []), jt.useLayoutEffect(() => { f(r.current), Ig(r.current, e, s), Np.updateContainer(jt.createElement(c, {}, e.children), i.current, null); }), jt.createElement("div", { ref: t, accessKey: e.accessKey, className: e.className, role: e.role, style: e.style, tabIndex: e.tabIndex, title: e.title }); }, Mp = "Layer", Os = "Group", As = "Rect", Mu = "Circle", dg = "Line", xk = "Image", bG = "Transformer", Np = xW(lG); Np.injectIntoDevTools({ // @ts-ignore findHostInstanceByFiber: () => null, bundleType: process.env.NODE_ENV !== "production" ? 1 : 0, version: jt.version, rendererPackageName: "react-konva" }); const CG = jt.forwardRef((e, t) => jt.createElement(yk, {}, jt.createElement(SG, { ...e, forwardedRef: t }))), EG = Ze( [on, er], (e, t) => { const { tool: r, isMovingBoundingBox: i } = e; return { tool: r, isStaging: t, isMovingBoundingBox: i }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), wG = () => { const e = xe(), { tool: t, isStaging: r, isMovingBoundingBox: i } = W(EG); return { handleDragStart: ee(() => { (t === "move" || r) && !i && e(Ym(!0)); }, [e, i, r, t]), handleDragMove: ee( (s) => { if (!((t === "move" || r) && !i)) return; const c = { x: s.target.x(), y: s.target.y() }; e(G2(c)); }, [e, i, r, t] ), handleDragEnd: ee(() => { (t === "move" || r) && !i && e(Ym(!1)); }, [e, i, r, t]) }; }, jG = Ze( [on, Bn, er], (e, t, r) => { const { cursorPosition: i, shouldLockBoundingBox: s, shouldShowBoundingBox: c, tool: f, isMaskEnabled: m, shouldSnapToGrid: y } = e; return { activeTabName: t, isCursorOnCanvas: Boolean(i), shouldLockBoundingBox: s, shouldShowBoundingBox: c, tool: f, isStaging: r, isMaskEnabled: m, shouldSnapToGrid: y }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), TG = () => { const e = xe(), { activeTabName: t, shouldShowBoundingBox: r, tool: i, isStaging: s, isMaskEnabled: c, shouldSnapToGrid: f } = W(jG), m = Xe(null), y = q2(), g = () => e(ub()); We( ["shift+c"], () => { g(); }, { enabled: () => !s, preventDefault: !0 }, [] ); const S = () => e(Jp(!c)); We( ["h"], () => { S(); }, { enabled: () => !s, preventDefault: !0 }, [c] ), We( ["n"], () => { e(Km(!f)); }, { enabled: !0, preventDefault: !0 }, [f] ), We( "esc", () => { e(rz()); }, { enabled: () => !0, preventDefault: !0 } ), We( "shift+h", () => { e(az(!r)); }, { enabled: () => !s, preventDefault: !0 }, [t, r] ), We( ["space"], (E) => { E.repeat || (y == null || y.container().focus(), i !== "move" && (m.current = i, e(Go("move"))), i === "move" && m.current && m.current !== "move" && (e(Go(m.current)), m.current = "move")); }, { keyup: !0, keydown: !0, preventDefault: !0 }, [i, m] ); }, R1 = (e) => { const t = e.getPointerPosition(), r = e.getAbsoluteTransform().copy(); if (!t || !r) return; const i = r.invert().point(t); return { x: i.x, y: i.y }; }, Sk = () => { const e = xe(), t = Yo(), r = q2(); return { updateColorUnderCursor: () => { if (!r || !t) return; const i = r.getPointerPosition(); if (!i) return; const s = iz.pixelRatio, [c, f, m, y] = t.getContext().getImageData( i.x * s, i.y * s, 1, 1 ).data; e(oz({ r: c, g: f, b: m, a: y })); }, commitColorUnderCursor: () => { e(sz()); } }; }, DG = Ze( [Bn, on, er], (e, t, r) => { const { tool: i } = t; return { tool: i, activeTabName: e, isStaging: r }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), _G = (e) => { const t = xe(), { tool: r, isStaging: i } = W(DG), { commitColorUnderCursor: s } = Sk(); return ee( (c) => { if (!e.current) return; if (e.current.container().focus(), r === "move" || i) { t(Ym(!0)); return; } if (r === "colorPicker") { s(); return; } const f = R1(e.current); f && (c.evt.preventDefault(), t(Y2(!0)), t(lz([f.x, f.y]))); }, [e, r, i, t, s] ); }, MG = Ze( [Bn, on, er], (e, t, r) => { const { tool: i, isDrawing: s } = t; return { tool: i, isDrawing: s, activeTabName: e, isStaging: r }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), kG = (e, t, r) => { const i = xe(), { isDrawing: s, tool: c, isStaging: f } = W(MG), { updateColorUnderCursor: m } = Sk(); return ee(() => { if (!e.current) return; const y = R1(e.current); if (y) { if (i(uz(y)), r.current = y, c === "colorPicker") { m(); return; } !s || c === "move" || f || (t.current = !0, i( K2([y.x, y.y]) )); } }, [ t, i, s, f, r, e, c, m ]); }, RG = () => { const e = xe(); return ee(() => { e(cz()); }, [e]); }, PG = Ze( [Bn, on, er], (e, t, r) => { const { tool: i, isDrawing: s } = t; return { tool: i, isDrawing: s, activeTabName: e, isStaging: r }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), NG = (e, t) => { const r = xe(), { tool: i, isDrawing: s, isStaging: c } = W(PG); return ee(() => { if (i === "move" || c) { r(Ym(!1)); return; } if (!t.current && s && e.current) { const f = R1(e.current); if (!f) return; r( K2([f.x, f.y]) ); } else t.current = !1; r(Y2(!1)); }, [t, r, s, c, e, i]); }, OG = Ze( [on], (e) => { const { isMoveStageKeyHeld: t, stageScale: r } = e; return { isMoveStageKeyHeld: t, stageScale: r }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), AG = (e) => { const t = xe(), { isMoveStageKeyHeld: r, stageScale: i } = W(OG); return ee( (s) => { if (!e.current || r) return; s.evt.preventDefault(); const c = e.current.getPointerPosition(); if (!c) return; const f = { x: (c.x - e.current.x()) / i, y: (c.y - e.current.y()) / i }; let m = s.evt.deltaY; s.evt.ctrlKey && (m = -m); const y = Pe.clamp( i * dz ** m, fz, pz ), g = { x: c.x - f.x * y, y: c.y - f.y * y }; t(hz(y)), t(G2(g)); }, [e, r, i, t] ); }, zG = Ze( on, (e) => { const { boundingBoxCoordinates: t, boundingBoxDimensions: r, stageDimensions: i, stageScale: s, shouldDarkenOutsideBoundingBox: c, stageCoordinates: f } = e; return { boundingBoxCoordinates: t, boundingBoxDimensions: r, shouldDarkenOutsideBoundingBox: c, stageCoordinates: f, stageDimensions: i, stageScale: s }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), IG = () => { const { boundingBoxCoordinates: e, boundingBoxDimensions: t, shouldDarkenOutsideBoundingBox: r, stageCoordinates: i, stageDimensions: s, stageScale: c } = W(zG); return /* @__PURE__ */ u.jsxs(Os, { children: [ /* @__PURE__ */ u.jsx( As, { offsetX: i.x / c, offsetY: i.y / c, height: s.height / c, width: s.width / c, fill: "rgba(0,0,0,0.4)", listening: !1, visible: r } ), /* @__PURE__ */ u.jsx( As, { x: e.x, y: e.y, width: t.width, height: t.height, fill: "rgb(255,255,255)", listening: !1, visible: r, globalCompositeOperation: "destination-out" } ) ] }); }, FG = Ze( [on], (e) => { const { stageScale: t, stageCoordinates: r, stageDimensions: i } = e; return { stageScale: t, stageCoordinates: r, stageDimensions: i }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), LG = () => { const e = W( (y) => y.ui.currentTheme ), { stageScale: t, stageCoordinates: r, stageDimensions: i } = W(FG), [s, c] = qe([]), [f] = C2("colors", ["gridLineColor"]), m = ee( (y) => y / t, [t] ); return co(() => { const { width: y, height: g } = i, { x: S, y: E } = r, w = { x1: 0, y1: 0, x2: y, y2: g, offset: { x: m(S), y: m(E) } }, D = { x: Math.ceil(m(S) / 64) * 64, y: Math.ceil(m(E) / 64) * 64 }, M = { x1: -D.x, y1: -D.y, x2: m(y) - D.x + 64, y2: m(g) - D.y + 64 }, R = { x1: Math.min(w.x1, M.x1), y1: Math.min(w.y1, M.y1), x2: Math.max(w.x2, M.x2), y2: Math.max(w.y2, M.y2) }, O = R.x2 - R.x1, I = R.y2 - R.y1, A = Math.round(O / 64) + 1, L = Math.round(I / 64) + 1, H = Pe.range(0, A).map((U) => /* @__PURE__ */ u.jsx( dg, { x: R.x1 + U * 64, y: R.y1, points: [0, 0, 0, I], stroke: f, strokeWidth: 1 }, `x_${U}` )), q = Pe.range(0, L).map((U) => /* @__PURE__ */ u.jsx( dg, { x: R.x1, y: R.y1 + U * 64, points: [0, 0, O, 0], stroke: f, strokeWidth: 1 }, `y_${U}` )); c(H.concat(q)); }, [ t, r, i, e, m, f ]), /* @__PURE__ */ u.jsx(Os, { children: s }); }, BG = Ze( [(e) => e.gallery], (e) => e.intermediateImage ? e.intermediateImage : null, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), UG = (e) => { const { ...t } = e, r = W(BG), [i, s] = qe(null); if (ot(() => { if (!r) return; const g = new Image(); g.onload = () => { s(g); }, g.src = r.url; }, [r]), !(r != null && r.boundingBox)) return null; const { boundingBox: { x: c, y: f, width: m, height: y } } = r; return i ? /* @__PURE__ */ u.jsx( xk, { x: c, y: f, width: m, height: y, image: i, listening: !1, ...t } ) : null; }, Bu = (e) => { const { r: t, g: r, b: i, a: s } = e; return `rgba(${t}, ${r}, ${i}, ${s})`; }, HG = Ze( on, (e) => { const { maskColor: t, stageCoordinates: r, stageDimensions: i, stageScale: s } = e; return { stageCoordinates: r, stageDimensions: i, stageScale: s, maskColorString: Bu(t) }; } ), JT = (e) => `data:image/svg+xml;utf8, `.replaceAll("black", e), VG = (e) => { const { ...t } = e, { maskColorString: r, stageCoordinates: i, stageDimensions: s, stageScale: c } = W(HG), [f, m] = qe(null), [y, g] = qe(0), S = Xe(null), E = ee(() => { g(y + 1), setTimeout(E, 500); }, [y]); return ot(() => { if (f) return; const w = new Image(); w.onload = () => { m(w); }, w.src = JT(r); }, [f, r]), ot(() => { f && (f.src = JT(r)); }, [f, r]), ot(() => { const w = setInterval(() => g((D) => (D + 1) % 5), 50); return () => clearInterval(w); }, []), !f || !Pe.isNumber(i.x) || !Pe.isNumber(i.y) || !Pe.isNumber(c) || !Pe.isNumber(s.width) || !Pe.isNumber(s.height) ? null : /* @__PURE__ */ u.jsx( As, { ref: S, offsetX: i.x / c, offsetY: i.y / c, height: s.height / c, width: s.width / c, fillPatternImage: f, fillPatternOffsetY: Pe.isNumber(y) ? y : 0, fillPatternRepeat: "repeat", fillPatternScale: { x: 1 / c, y: 1 / c }, listening: !0, globalCompositeOperation: "source-in", ...t } ); }, WG = Ze( [on], (e) => ({ objects: e.layerState.objects }), { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), GG = (e) => { const { ...t } = e, { objects: r } = W(WG); return /* @__PURE__ */ u.jsx(Os, { listening: !1, ...t, children: r.filter(vz).map((i, s) => /* @__PURE__ */ u.jsx( dg, { points: i.points, stroke: "rgb(0,0,0)", strokeWidth: i.strokeWidth * 2, tension: 0, lineCap: "round", lineJoin: "round", shadowForStrokeEnabled: !1, listening: !1, globalCompositeOperation: i.tool === "brush" ? "source-over" : "destination-out" }, s )) }); }; var ku = jt, qG = function(t, r, i) { const s = ku.useRef("loading"), c = ku.useRef(), [f, m] = ku.useState(0), y = ku.useRef(), g = ku.useRef(), S = ku.useRef(); return (y.current !== t || g.current !== r || S.current !== i) && (s.current = "loading", c.current = void 0, y.current = t, g.current = r, S.current = i), ku.useLayoutEffect( function() { if (!t) return; var E = document.createElement("img"); function w() { s.current = "loaded", c.current = E, m(Math.random()); } function D() { s.current = "failed", c.current = void 0, m(Math.random()); } return E.addEventListener("load", w), E.addEventListener("error", D), r && (E.crossOrigin = r), i && (E.referrerpolicy = i), E.src = t, function() { E.removeEventListener("load", w), E.removeEventListener("error", D); }; }, [t, r, i] ), [c.current, s.current]; }; const bk = (e) => { const { url: t, x: r, y: i } = e, [s] = qG(t); return /* @__PURE__ */ u.jsx(xk, { x: r, y: i, image: s, listening: !1 }); }, YG = Ze( [on], (e) => { const { layerState: { objects: t } } = e; return { objects: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), KG = () => { const { objects: e } = W(YG); return e ? /* @__PURE__ */ u.jsx(Os, { name: "outpainting-objects", listening: !1, children: e.map((t, r) => { if (W2(t)) return /* @__PURE__ */ u.jsx(bk, { x: t.x, y: t.y, url: t.image.url }, r); if (mz(t)) { const i = /* @__PURE__ */ u.jsx( dg, { points: t.points, stroke: t.color ? Bu(t.color) : "rgb(0,0,0)", strokeWidth: t.strokeWidth * 2, tension: 0, lineCap: "round", lineJoin: "round", shadowForStrokeEnabled: !1, listening: !1, globalCompositeOperation: t.tool === "brush" ? "source-over" : "destination-out" }, r ); return t.clip ? /* @__PURE__ */ u.jsx( Os, { clipX: t.clip.x, clipY: t.clip.y, clipWidth: t.clip.width, clipHeight: t.clip.height, children: i }, r ) : i; } else { if (gz(t)) return /* @__PURE__ */ u.jsx( As, { x: t.x, y: t.y, width: t.width, height: t.height, fill: Bu(t.color) }, r ); if (yz(t)) return /* @__PURE__ */ u.jsx( As, { x: t.x, y: t.y, width: t.width, height: t.height, fill: "rgb(255, 255, 255)", globalCompositeOperation: "destination-out" }, r ); } }) }) : null; }, XG = Ze( [on], (e) => { const { layerState: { stagingArea: { images: t, selectedImageIndex: r } }, shouldShowStagingImage: i, shouldShowStagingOutline: s, boundingBoxCoordinates: { x: c, y: f }, boundingBoxDimensions: { width: m, height: y } } = e; return { currentStagingAreaImage: t.length > 0 ? t[r] : void 0, isOnFirstImage: r === 0, isOnLastImage: r === t.length - 1, shouldShowStagingImage: i, shouldShowStagingOutline: s, x: c, y: f, width: m, height: y }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), $G = (e) => { const { ...t } = e, { currentStagingAreaImage: r, shouldShowStagingImage: i, shouldShowStagingOutline: s, x: c, y: f, width: m, height: y } = W(XG); return /* @__PURE__ */ u.jsxs(Os, { ...t, children: [ i && r && /* @__PURE__ */ u.jsx(bk, { url: r.image.url, x: c, y: f }), s && /* @__PURE__ */ u.jsxs(Os, { children: [ /* @__PURE__ */ u.jsx( As, { x: c, y: f, width: m, height: y, strokeWidth: 1, stroke: "white", strokeScaleEnabled: !1 } ), /* @__PURE__ */ u.jsx( As, { x: c, y: f, width: m, height: y, dash: [4, 4], strokeWidth: 1, stroke: "black", strokeScaleEnabled: !1 } ) ] }) ] }); }, QG = Ze( [on], (e) => { const { layerState: { stagingArea: { images: t, selectedImageIndex: r } }, shouldShowStagingOutline: i, shouldShowStagingImage: s } = e; return { currentStagingAreaImage: t.length > 0 ? t[r] : void 0, isOnFirstImage: r === 0, isOnLastImage: r === t.length - 1, shouldShowStagingImage: s, shouldShowStagingOutline: i }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), ZG = () => { const e = xe(), { isOnFirstImage: t, isOnLastImage: r, currentStagingAreaImage: i, shouldShowStagingImage: s } = W(QG), { t: c } = Ce(), f = ee(() => { e(Nw(!0)); }, [e]), m = ee(() => { e(Nw(!1)); }, [e]); We( ["left"], () => { y(); }, { enabled: () => !0, preventDefault: !0 } ), We( ["right"], () => { g(); }, { enabled: () => !0, preventDefault: !0 } ), We( ["enter"], () => { S(); }, { enabled: () => !0, preventDefault: !0 } ); const y = () => e(xz()), g = () => e(Sz()), S = () => e(bz()); return i ? /* @__PURE__ */ u.jsx( ne, { pos: "absolute", bottom: 4, w: "100%", align: "center", justify: "center", filter: "drop-shadow(0 0.5rem 1rem rgba(0,0,0))", onMouseOver: f, onMouseOut: m, children: /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, children: [ /* @__PURE__ */ u.jsx( Be, { tooltip: `${c("unifiedCanvas.previous")} (Left)`, "aria-label": `${c("unifiedCanvas.previous")} (Left)`, icon: /* @__PURE__ */ u.jsx(Cz, {}), onClick: y, colorScheme: "accent", isDisabled: t } ), /* @__PURE__ */ u.jsx( Be, { tooltip: `${c("unifiedCanvas.next")} (Right)`, "aria-label": `${c("unifiedCanvas.next")} (Right)`, icon: /* @__PURE__ */ u.jsx(Ez, {}), onClick: g, colorScheme: "accent", isDisabled: r } ), /* @__PURE__ */ u.jsx( Be, { tooltip: `${c("unifiedCanvas.accept")} (Enter)`, "aria-label": `${c("unifiedCanvas.accept")} (Enter)`, icon: /* @__PURE__ */ u.jsx(ob, {}), onClick: S, colorScheme: "accent" } ), /* @__PURE__ */ u.jsx( Be, { tooltip: c("unifiedCanvas.showHide"), "aria-label": c("unifiedCanvas.showHide"), "data-alert": !s, icon: s ? /* @__PURE__ */ u.jsx(wz, {}) : /* @__PURE__ */ u.jsx(jz, {}), onClick: () => e(Tz(!s)), colorScheme: "accent" } ), /* @__PURE__ */ u.jsx( Be, { tooltip: c("unifiedCanvas.saveToGallery"), "aria-label": c("unifiedCanvas.saveToGallery"), icon: /* @__PURE__ */ u.jsx(cb, {}), onClick: () => e( Dz(i.image.url) ), colorScheme: "accent" } ), /* @__PURE__ */ u.jsx( Be, { tooltip: c("unifiedCanvas.discardAll"), "aria-label": c("unifiedCanvas.discardAll"), icon: /* @__PURE__ */ u.jsx(Qp, { style: { transform: "rotate(45deg)" } }), onClick: () => e(_z()), colorScheme: "error", fontSize: 20 } ) ] }) } ) : null; }, Md = (e) => Math.round(e * 100) / 100, JG = Ze( [on], (e) => { const { cursorPosition: t } = e, { cursorX: r, cursorY: i } = t ? { cursorX: t.x, cursorY: t.y } : { cursorX: -1, cursorY: -1 }; return { cursorCoordinatesString: `(${Md(r)}, ${Md( i )})` }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function eq() { const { cursorCoordinatesString: e } = W(JG), { t } = Ce(); return /* @__PURE__ */ u.jsx(Ut, { children: `${t( "unifiedCanvas.cursorPosition" )}: ${e}` }); } const JS = "var(--invokeai-colors-warning-500)", tq = Ze( [on], (e) => { const { stageDimensions: { width: t, height: r }, stageCoordinates: { x: i, y: s }, boundingBoxDimensions: { width: c, height: f }, scaledBoundingBoxDimensions: { width: m, height: y }, boundingBoxCoordinates: { x: g, y: S }, stageScale: E, shouldShowCanvasDebugInfo: w, layer: D, boundingBoxScaleMethod: M, shouldPreserveMaskedArea: k } = e; let R = "inherit"; return (M === "none" && (c < 512 || f < 512) || M === "manual" && m * y < 512 * 512) && (R = JS), { activeLayerColor: D === "mask" ? JS : "inherit", activeLayerString: D.charAt(0).toUpperCase() + D.slice(1), boundingBoxColor: R, boundingBoxCoordinatesString: `(${Md( g )}, ${Md(S)})`, boundingBoxDimensionsString: `${c}×${f}`, scaledBoundingBoxDimensionsString: `${m}×${y}`, canvasCoordinatesString: `${Md(i)}×${Md( s )}`, canvasDimensionsString: `${t}×${r}`, canvasScaleString: Math.round(E * 100), shouldShowCanvasDebugInfo: w, shouldShowBoundingBox: M !== "auto", shouldShowScaledBoundingBox: M !== "none", shouldPreserveMaskedArea: k }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), nq = () => { const { activeLayerColor: e, activeLayerString: t, boundingBoxColor: r, boundingBoxCoordinatesString: i, boundingBoxDimensionsString: s, scaledBoundingBoxDimensionsString: c, shouldShowScaledBoundingBox: f, canvasCoordinatesString: m, canvasDimensionsString: y, canvasScaleString: g, shouldShowCanvasDebugInfo: S, shouldShowBoundingBox: E, shouldPreserveMaskedArea: w } = W(tq), { t: D } = Ce(); return /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", position: "absolute", top: 0, insetInlineStart: 0, opacity: 0.65, display: "flex", fontSize: "sm", padding: 1, px: 2, minWidth: 48, margin: 1, borderRadius: "base", pointerEvents: "none", bg: "base.800" }, children: [ /* @__PURE__ */ u.jsx( Ut, { style: { color: e }, children: `${D("unifiedCanvas.activeLayer")}: ${t}` } ), /* @__PURE__ */ u.jsx(Ut, { children: `${D("unifiedCanvas.canvasScale")}: ${g}%` }), w && /* @__PURE__ */ u.jsx( Ut, { style: { color: JS }, children: "Preserve Masked Area: On" } ), E && /* @__PURE__ */ u.jsx( Ut, { style: { color: r }, children: `${D( "unifiedCanvas.boundingBox" )}: ${s}` } ), f && /* @__PURE__ */ u.jsx( Ut, { style: { color: r }, children: `${D( "unifiedCanvas.scaledBoundingBox" )}: ${c}` } ), S && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx(Ut, { children: `${D( "unifiedCanvas.boundingBoxPosition" )}: ${i}` }), /* @__PURE__ */ u.jsx(Ut, { children: `${D( "unifiedCanvas.canvasDimensions" )}: ${y}` }), /* @__PURE__ */ u.jsx(Ut, { children: `${D( "unifiedCanvas.canvasPosition" )}: ${m}` }), /* @__PURE__ */ u.jsx(eq, {}) ] }) ] } ); }, rq = Ze( on, (e) => { const { boundingBoxCoordinates: t, boundingBoxDimensions: r, stageScale: i, isDrawing: s, isTransformingBoundingBox: c, isMovingBoundingBox: f, tool: m, shouldSnapToGrid: y } = e; return { boundingBoxCoordinates: t, boundingBoxDimensions: r, isDrawing: s, isMovingBoundingBox: f, isTransformingBoundingBox: c, stageScale: i, shouldSnapToGrid: y, tool: m, hitStrokeWidth: 20 / i }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), aq = (e) => { const { ...t } = e, r = xe(), { boundingBoxCoordinates: i, boundingBoxDimensions: s, isDrawing: c, isMovingBoundingBox: f, isTransformingBoundingBox: m, stageScale: y, shouldSnapToGrid: g, tool: S, hitStrokeWidth: E } = W(rq), w = Xe(null), D = Xe(null), [M, k] = qe(!1); ot(() => { var ve; !w.current || !D.current || (w.current.nodes([D.current]), (ve = w.current.getLayer()) == null || ve.batchDraw()); }, []); const R = 64 * y, O = ee( (ve) => { if (!g) { r( bx({ x: Math.floor(ve.target.x()), y: Math.floor(ve.target.y()) }) ); return; } const de = ve.target.x(), fe = ve.target.y(), _e = Ow(de, 64), Me = Ow(fe, 64); ve.target.x(_e), ve.target.y(Me), r( bx({ x: _e, y: Me }) ); }, [r, g] ), I = ee(() => { if (!D.current) return; const ve = D.current, de = ve.scaleX(), fe = ve.scaleY(), _e = Math.round(ve.width() * de), Me = Math.round(ve.height() * fe), te = Math.round(ve.x()), K = Math.round(ve.y()); r( Rp({ width: _e, height: Me }) ), r( bx({ x: g ? pm(te, 64) : te, y: g ? pm(K, 64) : K }) ), ve.scaleX(1), ve.scaleY(1); }, [r, g]), A = ee( (ve, de, fe) => { const _e = ve.x % R, Me = ve.y % R; return { x: pm(de.x, R) + _e, y: pm(de.y, R) + Me }; }, [R] ), L = () => { r(Cx(!0)); }, H = () => { r(Cx(!1)), r(Ex(!1)), r(hm(!1)), k(!1); }, q = () => { r(Ex(!0)); }, U = () => { r(Cx(!1)), r(Ex(!1)), r(hm(!1)), k(!1); }, $ = () => { k(!0); }, ae = () => { !m && !f && k(!1); }, oe = () => { r(hm(!0)); }, Y = () => { r(hm(!1)); }; return /* @__PURE__ */ u.jsxs(Os, { ...t, children: [ /* @__PURE__ */ u.jsx( As, { height: s.height, width: s.width, x: i.x, y: i.y, onMouseEnter: oe, onMouseOver: oe, onMouseLeave: Y, onMouseOut: Y } ), /* @__PURE__ */ u.jsx( As, { draggable: !0, fillEnabled: !1, height: s.height, hitStrokeWidth: E, listening: !c && S === "move", onDragStart: q, onDragEnd: U, onDragMove: O, onMouseDown: q, onMouseOut: ae, onMouseOver: $, onMouseEnter: $, onMouseUp: U, onTransform: I, onTransformEnd: H, ref: D, stroke: M ? "rgba(255,255,255,0.7)" : "white", strokeWidth: (M ? 8 : 1) / y, width: s.width, x: i.x, y: i.y } ), /* @__PURE__ */ u.jsx( bG, { anchorCornerRadius: 3, anchorDragBoundFunc: A, anchorFill: "rgba(212,216,234,1)", anchorSize: 15, anchorStroke: "rgb(42,42,42)", borderDash: [4, 4], borderEnabled: !0, borderStroke: "black", draggable: !1, enabledAnchors: S === "move" ? void 0 : [], flipEnabled: !1, ignoreStroke: !0, keepRatio: !1, listening: !c && S === "move", onDragStart: q, onDragEnd: U, onMouseDown: L, onMouseUp: H, onTransformEnd: H, ref: w, rotateEnabled: !1 } ) ] }); }, iq = Ze( on, (e) => { const { cursorPosition: t, brushSize: r, colorPickerColor: i, maskColor: s, brushColor: c, tool: f, layer: m, shouldShowBrush: y, isMovingBoundingBox: g, isTransformingBoundingBox: S, stageScale: E, stageDimensions: w, boundingBoxCoordinates: D, boundingBoxDimensions: M, shouldRestrictStrokesToBox: k } = e, R = k ? { clipX: D.x, clipY: D.y, clipWidth: M.width, clipHeight: M.height } : {}; return { cursorPosition: t, brushX: t ? t.x : w.width / 2, brushY: t ? t.y : w.height / 2, radius: r / 2, colorPickerOuterRadius: Aw / E, colorPickerInnerRadius: (Aw - bS + 1) / E, maskColorString: Bu({ ...s, a: 0.5 }), brushColorString: Bu(c), colorPickerColorString: Bu(i), tool: f, layer: m, shouldShowBrush: y, shouldDrawBrushPreview: !(g || S || !t) && y, strokeWidth: 1.5 / E, dotRadius: 1.5 / E, clip: R }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), oq = (e) => { const { ...t } = e, { brushX: r, brushY: i, radius: s, maskColorString: c, tool: f, layer: m, shouldDrawBrushPreview: y, dotRadius: g, strokeWidth: S, brushColorString: E, colorPickerColorString: w, colorPickerInnerRadius: D, colorPickerOuterRadius: M, clip: k } = W(iq); return y ? /* @__PURE__ */ u.jsxs(Os, { listening: !1, ...k, ...t, children: [ f === "colorPicker" ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx( Mu, { x: r, y: i, radius: M, stroke: E, strokeWidth: bS, strokeScaleEnabled: !1 } ), /* @__PURE__ */ u.jsx( Mu, { x: r, y: i, radius: D, stroke: w, strokeWidth: bS, strokeScaleEnabled: !1 } ) ] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx( Mu, { x: r, y: i, radius: s, fill: m === "mask" ? c : E, globalCompositeOperation: f === "eraser" ? "destination-out" : "source-out" } ), /* @__PURE__ */ u.jsx( Mu, { x: r, y: i, radius: s, stroke: "rgba(255,255,255,0.4)", strokeWidth: S * 2, strokeEnabled: !0, listening: !1 } ), /* @__PURE__ */ u.jsx( Mu, { x: r, y: i, radius: s, stroke: "rgba(0,0,0,1)", strokeWidth: S, strokeEnabled: !0, listening: !1 } ) ] }), /* @__PURE__ */ u.jsx( Mu, { x: r, y: i, radius: g * 2, fill: "rgba(255,255,255,0.4)", listening: !1 } ), /* @__PURE__ */ u.jsx( Mu, { x: r, y: i, radius: g, fill: "rgba(0,0,0,1)", listening: !1 } ) ] }) : null; }, sq = Ze( [on, er], (e, t) => { const { isMaskEnabled: r, stageScale: i, shouldShowBoundingBox: s, isTransformingBoundingBox: c, isMouseOverBoundingBox: f, isMovingBoundingBox: m, stageDimensions: y, stageCoordinates: g, tool: S, isMovingStage: E, shouldShowIntermediates: w, shouldShowGrid: D, shouldRestrictStrokesToBox: M } = e; let k = "none"; return S === "move" || t ? E ? k = "grabbing" : k = "grab" : c ? k = void 0 : M && !f && (k = "default"), { isMaskEnabled: r, isModifyingBoundingBox: c || m, shouldShowBoundingBox: s, shouldShowGrid: D, stageCoordinates: g, stageCursor: k, stageDimensions: y, stageScale: i, tool: S, isStaging: t, shouldShowIntermediates: w }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), lq = $e(CG, { shouldForwardProp: (e) => !["sx"].includes(e) }), Ck = () => { const { isMaskEnabled: e, isModifyingBoundingBox: t, shouldShowBoundingBox: r, shouldShowGrid: i, stageCoordinates: s, stageCursor: c, stageDimensions: f, stageScale: m, tool: y, isStaging: g, shouldShowIntermediates: S } = W(sq); TG(); const E = Xe(null), w = Xe(null), D = ee((ae) => { kz(ae), E.current = ae; }, []), M = ee((ae) => { Mz(ae), w.current = ae; }, []), k = Xe({ x: 0, y: 0 }), R = Xe(!1), O = AG(E), I = _G(E), A = NG(E, R), L = kG( E, R, k ), H = RG(), { handleDragStart: q, handleDragMove: U, handleDragEnd: $ } = wG(); return /* @__PURE__ */ u.jsx( ne, { sx: { position: "relative", height: "100%", width: "100%", borderRadius: "base" }, children: /* @__PURE__ */ u.jsxs(Ut, { sx: { position: "relative" }, children: [ /* @__PURE__ */ u.jsxs( lq, { tabIndex: -1, ref: D, sx: { outline: "none", // boxShadow: '0px 0px 0px 1px var(--border-color-light)', overflow: "hidden", cursor: c || void 0, canvas: { outline: "none" } }, x: s.x, y: s.y, width: f.width, height: f.height, scale: { x: m, y: m }, onTouchStart: I, onTouchMove: L, onTouchEnd: A, onMouseDown: I, onMouseLeave: H, onMouseMove: L, onMouseUp: A, onDragStart: q, onDragMove: U, onDragEnd: $, onContextMenu: (ae) => ae.evt.preventDefault(), onWheel: O, draggable: (y === "move" || g) && !t, children: [ /* @__PURE__ */ u.jsx(Mp, { id: "grid", visible: i, children: /* @__PURE__ */ u.jsx(LG, {}) }), /* @__PURE__ */ u.jsx( Mp, { id: "base", ref: M, listening: !1, imageSmoothingEnabled: !1, children: /* @__PURE__ */ u.jsx(KG, {}) } ), /* @__PURE__ */ u.jsxs(Mp, { id: "mask", visible: e, listening: !1, children: [ /* @__PURE__ */ u.jsx(GG, { visible: !0, listening: !1 }), /* @__PURE__ */ u.jsx(VG, { listening: !1 }) ] }), /* @__PURE__ */ u.jsx(Mp, { children: /* @__PURE__ */ u.jsx(IG, {}) }), /* @__PURE__ */ u.jsxs(Mp, { id: "preview", imageSmoothingEnabled: !1, children: [ !g && /* @__PURE__ */ u.jsx( oq, { visible: y !== "move", listening: !1 } ), /* @__PURE__ */ u.jsx($G, { visible: g }), S && /* @__PURE__ */ u.jsx(UG, {}), /* @__PURE__ */ u.jsx( aq, { visible: r && !g } ) ] }) ] } ), /* @__PURE__ */ u.jsx(nq, {}), /* @__PURE__ */ u.jsx(ZG, {}) ] }) } ); }, uq = Ze( on, dk, Bn, (e, t, r) => { const { doesCanvasNeedScaling: i, isCanvasInitialized: s } = e; return { doesCanvasNeedScaling: i, activeTabName: r, initialCanvasImage: t, isCanvasInitialized: s }; } ), Ek = () => { const e = xe(), { doesCanvasNeedScaling: t, activeTabName: r, initialCanvasImage: i, isCanvasInitialized: s } = W(uq), c = Xe(null); return co(() => { window.setTimeout(() => { if (!c.current) return; const { clientWidth: f, clientHeight: m } = c.current; e( Rz({ width: f, height: m }) ), e(s ? Pz() : yg()), e(T2(!1)); }, 0); }, [ e, i, t, r, s ]), /* @__PURE__ */ u.jsx( ne, { ref: c, sx: { flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 4, width: "100%", height: "100%" }, children: /* @__PURE__ */ u.jsx(E2, { thickness: "2px", speed: "1s", size: "xl" }) } ); }, cq = Ze( [on, Bn, Vn], (e, t, r) => { const { futureLayerStates: i } = e; return { canRedo: i.length > 0 && !r.isProcessing, activeTabName: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function wk() { const e = xe(), { canRedo: t, activeTabName: r } = W(cq), { t: i } = Ce(), s = () => { e(Oz()); }; return We( ["meta+shift+z", "ctrl+shift+z", "control+y", "meta+y"], () => { s(); }, { enabled: () => t, preventDefault: !0 }, [r, t] ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${i("unifiedCanvas.redo")} (Ctrl+Shift+Z)`, tooltip: `${i("unifiedCanvas.redo")} (Ctrl+Shift+Z)`, icon: /* @__PURE__ */ u.jsx(Nz, {}), onClick: s, isDisabled: !t } ); } const dq = Ze( [on, Bn, Vn], (e, t, r) => { const { pastLayerStates: i } = e; return { canUndo: i.length > 0 && !r.isProcessing, activeTabName: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function jk() { const e = xe(), { t } = Ce(), { canUndo: r, activeTabName: i } = W(dq), s = () => { e(zz()); }; return We( ["meta+z", "ctrl+z"], () => { s(); }, { enabled: () => r, preventDefault: !0 }, [i, r] ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${t("unifiedCanvas.undo")} (Ctrl+Z)`, tooltip: `${t("unifiedCanvas.undo")} (Ctrl+Z)`, icon: /* @__PURE__ */ u.jsx(Az, {}), onClick: s, isDisabled: !r } ); } const fq = (e, t, r) => { const i = document.createElement("img"); i.addEventListener("load", () => { const s = document.createElement("canvas"); s.width = t, s.height = r; const c = s.getContext("2d"); c && (c.drawImage(i, 0, 0), s.toBlob((f) => { f && navigator.clipboard.write([ new ClipboardItem({ [f.type]: f }) ]); }), s.remove(), i.remove()); }), i.src = e; }, pq = (e) => { const t = document.createElement("a"); t.href = e, t.download = "", document.body.appendChild(t), t.click(), document.body.removeChild(t), t.remove(); }, hq = (e, t, r, i) => { const s = e.scale(), c = e.getClientRect({ relativeTo: e.getParent() }); e.scale({ x: 1 / t, y: 1 / t }); const { x: f, y: m, width: y, height: g } = e.getClientRect(), S = i ? { x: i.x + r.x, y: i.y + r.y, width: i.width, height: i.height } : { x: f, y: m, width: y, height: g }, E = e.toDataURL(S); return e.scale(s), { dataURL: E, boundingBox: { x: c.x, y: c.y, width: y, height: g } }; }, vq = { cropVisible: !1, cropToBoundingBox: !1, shouldSaveToGallery: !1, shouldDownload: !1, shouldCopy: !1, shouldSetAsInitialImage: !0 }, Pl = (e = vq) => async (t, r) => { const { cropVisible: i, cropToBoundingBox: s, shouldSaveToGallery: c, shouldDownload: f, shouldCopy: m, shouldSetAsInitialImage: y } = e; t(Iz("Exporting Image")), t(vm(!1)); const g = r(), { stageScale: S, boundingBoxCoordinates: E, boundingBoxDimensions: w, stageCoordinates: D } = g.canvas, M = Yo(); if (!M) { t(wx(!1)), t(vm(!0)); return; } const { dataURL: k, boundingBox: R } = hq( M, S, D, s ? { ...E, ...w } : void 0 ); if (!k) { t(wx(!1)), t(vm(!0)); return; } const O = new FormData(); O.append( "data", JSON.stringify({ dataURL: k, filename: "merged_canvas.png", kind: c ? "result" : "temp", cropVisible: i }) ); const A = await (await fetch(`${window.location.origin}/upload`, { method: "POST", body: O })).json(), { url: L, width: H, height: q } = A, U = { uuid: g2(), category: c ? "result" : "user", ...A }; f && (pq(L), t( mm({ title: Tp.t("toast.downloadImageStarted"), status: "success", duration: 2500, isClosable: !0 }) )), m && (fq(L, H, q), t( mm({ title: Tp.t("toast.imageCopied"), status: "success", duration: 2500, isClosable: !0 }) )), c && (t(y2({ image: U, category: "result" })), t( mm({ title: Tp.t("toast.imageSavedToGallery"), status: "success", duration: 2500, isClosable: !0 }) )), y && (t( Fz({ kind: "image", layer: "base", ...R, image: U }) ), t( mm({ title: Tp.t("toast.canvasMerged"), status: "success", duration: 2500, isClosable: !0 }) )), t(wx(!1)), t(Lz(Tp.t("common.statusConnected"))), t(vm(!0)); }; function mq() { const e = W(er), t = Yo(), r = W( (m) => m.system.isProcessing ), i = W( (m) => m.canvas.shouldCropToBoundingBoxOnSave ), s = xe(), { t: c } = Ce(); We( ["meta+c", "ctrl+c"], () => { f(); }, { enabled: () => !e, preventDefault: !0 }, [t, r] ); const f = () => { s( Pl({ cropVisible: !i, cropToBoundingBox: i, shouldCopy: !0 }) ); }; return /* @__PURE__ */ u.jsx( Be, { "aria-label": `${c("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`, tooltip: `${c("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`, icon: /* @__PURE__ */ u.jsx(zd, {}), onClick: f, isDisabled: e } ); } function gq() { const e = xe(), { t } = Ce(), r = Yo(), i = W(er), s = W( (m) => m.system.isProcessing ), c = W( (m) => m.canvas.shouldCropToBoundingBoxOnSave ); We( ["shift+d"], () => { f(); }, { enabled: () => !i, preventDefault: !0 }, [r, s] ); const f = () => { e( Pl({ cropVisible: !c, cropToBoundingBox: c, shouldDownload: !0 }) ); }; return /* @__PURE__ */ u.jsx( Be, { "aria-label": `${t("unifiedCanvas.downloadAsImage")} (Shift+D)`, tooltip: `${t("unifiedCanvas.downloadAsImage")} (Shift+D)`, icon: /* @__PURE__ */ u.jsx(sb, {}), onClick: f, isDisabled: i } ); } function yq() { const e = W(er), { openUploader: t } = Kb(), { t: r } = Ce(); return /* @__PURE__ */ u.jsx( Be, { "aria-label": r("common.upload"), tooltip: r("common.upload"), icon: /* @__PURE__ */ u.jsx(gg, {}), onClick: t, isDisabled: e } ); } const xq = Ze( [on, er], (e, t) => { const { layer: r, isMaskEnabled: i } = e; return { layer: r, isMaskEnabled: i, isStaging: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function Sq() { const e = xe(), { t } = Ce(), { layer: r, isMaskEnabled: i, isStaging: s } = W(xq), c = () => { e(Xm(r === "mask" ? "base" : "mask")); }; We( ["q"], () => { c(); }, { enabled: () => !s, preventDefault: !0 }, [r] ); const f = (m) => { const y = m.target.value; e(Xm(y)), y === "mask" && !i && e(Jp(!0)); }; return /* @__PURE__ */ u.jsx( ni, { tooltip: `${t("unifiedCanvas.layer")} (Q)`, "aria-label": `${t("unifiedCanvas.layer")} (Q)`, tooltipProps: { hasArrow: !0, placement: "top" }, value: r, validValues: X2, onChange: f, isDisabled: s } ); } function bq() { const e = xe(), { t } = Ce(), r = Yo(), i = W(er), s = W( (f) => f.system.isProcessing ); We( ["shift+m"], () => { c(); }, { enabled: () => !i, preventDefault: !0 }, [r, s] ); const c = () => { e( Pl({ cropVisible: !1, shouldSetAsInitialImage: !0 }) ); }; return /* @__PURE__ */ u.jsx( Be, { "aria-label": `${t("unifiedCanvas.mergeVisible")} (Shift+M)`, tooltip: `${t("unifiedCanvas.mergeVisible")} (Shift+M)`, icon: /* @__PURE__ */ u.jsx($2, {}), onClick: c, isDisabled: i } ); } function Cq() { const e = W((c) => c.canvas.tool), t = W(er), r = xe(), { t: i } = Ce(); We( ["v"], () => { s(); }, { enabled: () => !t, preventDefault: !0 }, [] ); const s = () => r(Go("move")); return /* @__PURE__ */ u.jsx( Be, { "aria-label": `${i("unifiedCanvas.move")} (V)`, tooltip: `${i("unifiedCanvas.move")} (V)`, icon: /* @__PURE__ */ u.jsx(Q2, {}), isChecked: e === "move" || t, onClick: s } ); } function Eq() { const e = W( (c) => c.ui.shouldPinParametersPanel ), t = W( (c) => c.ui.shouldShowParametersPanel ), r = xe(), { t: i } = Ce(), s = () => { r(Gm(!0)), e && r(wa()); }; return !e || !t ? /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", gap: 2, children: [ /* @__PURE__ */ u.jsx( Be, { tooltip: `${i("parameters.showOptionsPanel")} (O)`, tooltipProps: { placement: "top" }, "aria-label": i("parameters.showOptionsPanel"), onClick: s, children: /* @__PURE__ */ u.jsx(db, {}) } ), /* @__PURE__ */ u.jsx(ne, { children: /* @__PURE__ */ u.jsx(j1, { iconButton: !0 }) }), /* @__PURE__ */ u.jsx(ne, { children: /* @__PURE__ */ u.jsx(E1, { width: "100%", height: "40px", btnGroupWidth: "100%" }) }) ] }) : null; } function wq() { const e = xe(), { t } = Ce(), r = W(er), i = () => { e(fb()), e(yg()); }; return /* @__PURE__ */ u.jsx( Be, { "aria-label": t("unifiedCanvas.clearCanvas"), tooltip: t("unifiedCanvas.clearCanvas"), icon: /* @__PURE__ */ u.jsx(qu, {}), onClick: i, isDisabled: r, colorScheme: "error" } ); } function Tk(e, t, r = 250) { const [i, s] = qe(0); return ot(() => { const c = setTimeout(() => { i === 1 && e(), s(0); }, r); return i === 2 && t(), () => clearTimeout(c); }, [i, e, t, r]), () => s((c) => c + 1); } function jq() { const e = Yo(), t = xe(), { t: r } = Ce(); We( ["r"], () => { s(); }, { enabled: () => !0, preventDefault: !0 }, [e] ); const i = Tk( () => s(!1), () => s(!0) ), s = (c = !1) => { const f = Yo(); if (!f) return; const m = f.getClientRect({ skipTransform: !0 }); t( Z2({ contentRect: m, shouldScaleTo1: c }) ); }; return /* @__PURE__ */ u.jsx( Be, { "aria-label": `${r("unifiedCanvas.resetView")} (R)`, tooltip: `${r("unifiedCanvas.resetView")} (R)`, icon: /* @__PURE__ */ u.jsx(J2, {}), onClick: i } ); } function Tq() { const e = W(er), t = Yo(), r = W( (m) => m.system.isProcessing ), i = W( (m) => m.canvas.shouldCropToBoundingBoxOnSave ), s = xe(), { t: c } = Ce(); We( ["shift+s"], () => { f(); }, { enabled: () => !e, preventDefault: !0 }, [t, r] ); const f = () => { s( Pl({ cropVisible: !i, cropToBoundingBox: i, shouldSaveToGallery: !0 }) ); }; return /* @__PURE__ */ u.jsx( Be, { "aria-label": `${c("unifiedCanvas.saveToGallery")} (Shift+S)`, tooltip: `${c("unifiedCanvas.saveToGallery")} (Shift+S)`, icon: /* @__PURE__ */ u.jsx(cb, {}), onClick: f, isDisabled: e } ); } const Dq = Ze( [on, er, Vn], (e, t, r) => { const { isProcessing: i } = r, { tool: s } = e; return { tool: s, isStaging: t, isProcessing: i }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), _q = () => { const e = xe(), { t } = Ce(), { tool: r, isStaging: i } = W(Dq); We( ["b"], () => { s(); }, { enabled: () => !i, preventDefault: !0 }, [] ), We( ["e"], () => { c(); }, { enabled: () => !i, preventDefault: !0 }, [r] ), We( ["c"], () => { f(); }, { enabled: () => !i, preventDefault: !0 }, [r] ), We( ["shift+f"], () => { m(); }, { enabled: () => !i, preventDefault: !0 } ), We( ["delete", "backspace"], () => { y(); }, { enabled: () => !i, preventDefault: !0 } ); const s = () => e(Go("brush")), c = () => e(Go("eraser")), f = () => e(Go("colorPicker")), m = () => e(eD()), y = () => e(tD()); return /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", gap: 2, children: [ /* @__PURE__ */ u.jsxs(qr, { children: [ /* @__PURE__ */ u.jsx( Be, { "aria-label": `${t("unifiedCanvas.brush")} (B)`, tooltip: `${t("unifiedCanvas.brush")} (B)`, icon: /* @__PURE__ */ u.jsx(nD, {}), isChecked: r === "brush" && !i, onClick: s, isDisabled: i } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${t("unifiedCanvas.eraser")} (E)`, tooltip: `${t("unifiedCanvas.eraser")} (B)`, icon: /* @__PURE__ */ u.jsx(rD, {}), isChecked: r === "eraser" && !i, isDisabled: i, onClick: c } ) ] }), /* @__PURE__ */ u.jsxs(qr, { children: [ /* @__PURE__ */ u.jsx( Be, { "aria-label": `${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`, tooltip: `${t("unifiedCanvas.fillBoundingBox")} (Shift+F)`, icon: /* @__PURE__ */ u.jsx(aD, {}), isDisabled: i, onClick: m } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`, tooltip: `${t("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`, icon: /* @__PURE__ */ u.jsx(Qp, { style: { transform: "rotate(45deg)" } }), isDisabled: i, onClick: y } ) ] }), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${t("unifiedCanvas.colorPicker")} (C)`, tooltip: `${t("unifiedCanvas.colorPicker")} (C)`, icon: /* @__PURE__ */ u.jsx(iD, {}), isChecked: r === "colorPicker" && !i, isDisabled: i, onClick: f, width: "max-content" } ) ] }); }, Dk = () => { const e = W(er), t = xe(), { t: r } = Ce(), i = () => { t(Bz()), t(fb()), t(oD()); }; return /* @__PURE__ */ u.jsxs( zg, { title: r("unifiedCanvas.emptyTempImageFolder"), acceptCallback: i, acceptButtonText: r("unifiedCanvas.emptyFolder"), triggerComponent: /* @__PURE__ */ u.jsx(an, { leftIcon: /* @__PURE__ */ u.jsx(qu, {}), size: "sm", isDisabled: e, children: r("unifiedCanvas.emptyTempImageFolder") }), children: [ /* @__PURE__ */ u.jsx("p", { children: r("unifiedCanvas.emptyTempImagesFolderMessage") }), /* @__PURE__ */ u.jsx("br", {}), /* @__PURE__ */ u.jsx("p", { children: r("unifiedCanvas.emptyTempImagesFolderConfirm") }) ] } ); }, _k = () => { const e = W(er), t = xe(), { t: r } = Ce(); return /* @__PURE__ */ u.jsxs( zg, { title: r("unifiedCanvas.clearCanvasHistory"), acceptCallback: () => t(oD()), acceptButtonText: r("unifiedCanvas.clearHistory"), triggerComponent: /* @__PURE__ */ u.jsx(an, { size: "sm", leftIcon: /* @__PURE__ */ u.jsx(qu, {}), isDisabled: e, children: r("unifiedCanvas.clearCanvasHistory") }), children: [ /* @__PURE__ */ u.jsx("p", { children: r("unifiedCanvas.clearCanvasHistoryMessage") }), /* @__PURE__ */ u.jsx("br", {}), /* @__PURE__ */ u.jsx("p", { children: r("unifiedCanvas.clearCanvasHistoryConfirm") }) ] } ); }, Mq = Ze( [on], (e) => { const { shouldAutoSave: t, shouldCropToBoundingBoxOnSave: r, shouldShowCanvasDebugInfo: i, shouldShowIntermediates: s } = e; return { shouldAutoSave: t, shouldCropToBoundingBoxOnSave: r, shouldShowCanvasDebugInfo: i, shouldShowIntermediates: s }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), kq = () => { const e = xe(), { t } = Ce(), { shouldAutoSave: r, shouldCropToBoundingBoxOnSave: i, shouldShowCanvasDebugInfo: s, shouldShowIntermediates: c } = W(Mq); return /* @__PURE__ */ u.jsx( Wo, { trigger: "hover", triggerComponent: /* @__PURE__ */ u.jsx( Be, { tooltip: t("unifiedCanvas.canvasSettings"), tooltipProps: { placement: "bottom" }, "aria-label": t("unifiedCanvas.canvasSettings"), icon: /* @__PURE__ */ u.jsx(pb, {}) } ), children: /* @__PURE__ */ u.jsxs(ne, { direction: "column", gap: 2, children: [ /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.showIntermediates"), isChecked: c, onChange: (f) => e(sD(f.target.checked)) } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.autoSaveToGallery"), isChecked: r, onChange: (f) => e(lD(f.target.checked)) } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.saveBoxRegionOnly"), isChecked: i, onChange: (f) => e(uD(f.target.checked)) } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.showCanvasDebugInfo"), isChecked: s, onChange: (f) => e(cD(f.target.checked)) } ), /* @__PURE__ */ u.jsx(_k, {}), /* @__PURE__ */ u.jsx(Dk, {}) ] }) } ); }, Rq = () => /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", rowGap: 2, children: [ /* @__PURE__ */ u.jsx(Sq, {}), /* @__PURE__ */ u.jsx(_q, {}), /* @__PURE__ */ u.jsxs(ne, { gap: 2, children: [ /* @__PURE__ */ u.jsx(Cq, {}), /* @__PURE__ */ u.jsx(jq, {}) ] }), /* @__PURE__ */ u.jsxs(ne, { columnGap: 2, children: [ /* @__PURE__ */ u.jsx(bq, {}), /* @__PURE__ */ u.jsx(Tq, {}) ] }), /* @__PURE__ */ u.jsxs(ne, { columnGap: 2, children: [ /* @__PURE__ */ u.jsx(mq, {}), /* @__PURE__ */ u.jsx(gq, {}) ] }), /* @__PURE__ */ u.jsxs(ne, { gap: 2, children: [ /* @__PURE__ */ u.jsx(jk, {}), /* @__PURE__ */ u.jsx(wk, {}) ] }), /* @__PURE__ */ u.jsxs(ne, { gap: 2, children: [ /* @__PURE__ */ u.jsx(yq, {}), /* @__PURE__ */ u.jsx(wq, {}) ] }), /* @__PURE__ */ u.jsx(kq, {}), /* @__PURE__ */ u.jsx(Eq, {}) ] }); function Pq() { const e = xe(), t = W( (s) => s.canvas.brushSize ), { t: r } = Ce(), i = W(er); return We( ["BracketLeft"], () => { e(kd(Math.max(t - 5, 5))); }, { enabled: () => !i, preventDefault: !0 }, [t] ), We( ["BracketRight"], () => { e(kd(Math.min(t + 5, 500))); }, { enabled: () => !i, preventDefault: !0 }, [t] ), /* @__PURE__ */ u.jsx( jn, { label: r("unifiedCanvas.brushSize"), value: t, withInput: !0, onChange: (s) => e(kd(s)), sliderNumberInputProps: { max: 500 }, inputReadOnly: !1, isCompact: !0 } ); } function Fg() { return (Fg = Object.assign || function(e) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t]; for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]); } return e; }).apply(this, arguments); } function Mk(e, t) { if (e == null) return {}; var r, i, s = {}, c = Object.keys(e); for (i = 0; i < c.length; i++) t.indexOf(r = c[i]) >= 0 || (s[r] = e[r]); return s; } function eb(e) { var t = Xe(e), r = Xe(function(i) { t.current && t.current(i); }); return t.current = e, r.current; } var Bd = function(e, t, r) { return t === void 0 && (t = 0), r === void 0 && (r = 1), e > r ? r : e < t ? t : e; }, zp = function(e) { return "touches" in e; }, tb = function(e) { return e && e.ownerDocument.defaultView || self; }, e2 = function(e, t, r) { var i = e.getBoundingClientRect(), s = zp(t) ? function(c, f) { for (var m = 0; m < c.length; m++) if (c[m].identifier === f) return c[m]; return c[0]; }(t.touches, r) : t; return { left: Bd((s.pageX - (i.left + tb(e).pageXOffset)) / i.width), top: Bd((s.pageY - (i.top + tb(e).pageYOffset)) / i.height) }; }, t2 = function(e) { !zp(e) && e.preventDefault(); }, P1 = jt.memo(function(e) { var t = e.onMove, r = e.onKey, i = Mk(e, ["onMove", "onKey"]), s = Xe(null), c = eb(t), f = eb(r), m = Xe(null), y = Xe(!1), g = Xt(function() { var D = function(R) { t2(R), (zp(R) ? R.touches.length > 0 : R.buttons > 0) && s.current ? c(e2(s.current, R, m.current)) : k(!1); }, M = function() { return k(!1); }; function k(R) { var O = y.current, I = tb(s.current), A = R ? I.addEventListener : I.removeEventListener; A(O ? "touchmove" : "mousemove", D), A(O ? "touchend" : "mouseup", M); } return [function(R) { var O = R.nativeEvent, I = s.current; if (I && (t2(O), !function(L, H) { return H && !zp(L); }(O, y.current) && I)) { if (zp(O)) { y.current = !0; var A = O.changedTouches || []; A.length && (m.current = A[0].identifier); } I.focus(), c(e2(I, O, m.current)), k(!0); } }, function(R) { var O = R.which || R.keyCode; O < 37 || O > 40 || (R.preventDefault(), f({ left: O === 39 ? 0.05 : O === 37 ? -0.05 : 0, top: O === 40 ? 0.05 : O === 38 ? -0.05 : 0 })); }, k]; }, [f, c]), S = g[0], E = g[1], w = g[2]; return ot(function() { return w; }, [w]), jt.createElement("div", Fg({}, i, { onTouchStart: S, onMouseDown: S, className: "react-colorful__interactive", ref: s, onKeyDown: E, tabIndex: 0, role: "slider" })); }), Lg = function(e) { return e.filter(Boolean).join(" "); }, N1 = function(e) { var t = e.color, r = e.left, i = e.top, s = i === void 0 ? 0.5 : i, c = Lg(["react-colorful__pointer", e.className]); return jt.createElement("div", { className: c, style: { top: 100 * s + "%", left: 100 * r + "%" } }, jt.createElement("div", { className: "react-colorful__pointer-fill", style: { backgroundColor: t } })); }, Ua = function(e, t, r) { return t === void 0 && (t = 0), r === void 0 && (r = Math.pow(10, t)), Math.round(r * e) / r; }, kk = function(e) { var t = e.s, r = e.v, i = e.a, s = (200 - t) * r / 100; return { h: Ua(e.h), s: Ua(s > 0 && s < 200 ? t * r / 100 / (s <= 100 ? s : 200 - s) * 100 : 0), l: Ua(s / 2), a: Ua(i, 2) }; }, nb = function(e) { var t = kk(e); return "hsl(" + t.h + ", " + t.s + "%, " + t.l + "%)"; }, oS = function(e) { var t = kk(e); return "hsla(" + t.h + ", " + t.s + "%, " + t.l + "%, " + t.a + ")"; }, Nq = function(e) { var t = e.h, r = e.s, i = e.v, s = e.a; t = t / 360 * 6, r /= 100, i /= 100; var c = Math.floor(t), f = i * (1 - r), m = i * (1 - (t - c) * r), y = i * (1 - (1 - t + c) * r), g = c % 6; return { r: Ua(255 * [i, m, f, f, y, i][g]), g: Ua(255 * [y, i, i, m, f, f][g]), b: Ua(255 * [f, f, y, i, i, m][g]), a: Ua(s, 2) }; }, Oq = function(e) { var t = e.r, r = e.g, i = e.b, s = e.a, c = Math.max(t, r, i), f = c - Math.min(t, r, i), m = f ? c === t ? (r - i) / f : c === r ? 2 + (i - t) / f : 4 + (t - r) / f : 0; return { h: Ua(60 * (m < 0 ? m + 6 : m)), s: Ua(c ? f / c * 100 : 0), v: Ua(c / 255 * 100), a: s }; }, Aq = jt.memo(function(e) { var t = e.hue, r = e.onChange, i = Lg(["react-colorful__hue", e.className]); return jt.createElement("div", { className: i }, jt.createElement(P1, { onMove: function(s) { r({ h: 360 * s.left }); }, onKey: function(s) { r({ h: Bd(t + 360 * s.left, 0, 360) }); }, "aria-label": "Hue", "aria-valuenow": Ua(t), "aria-valuemax": "360", "aria-valuemin": "0" }, jt.createElement(N1, { className: "react-colorful__hue-pointer", left: t / 360, color: nb({ h: t, s: 100, v: 100, a: 1 }) }))); }), zq = jt.memo(function(e) { var t = e.hsva, r = e.onChange, i = { backgroundColor: nb({ h: t.h, s: 100, v: 100, a: 1 }) }; return jt.createElement("div", { className: "react-colorful__saturation", style: i }, jt.createElement(P1, { onMove: function(s) { r({ s: 100 * s.left, v: 100 - 100 * s.top }); }, onKey: function(s) { r({ s: Bd(t.s + 100 * s.left, 0, 100), v: Bd(t.v - 100 * s.top, 0, 100) }); }, "aria-label": "Color", "aria-valuetext": "Saturation " + Ua(t.s) + "%, Brightness " + Ua(t.v) + "%" }, jt.createElement(N1, { className: "react-colorful__saturation-pointer", top: 1 - t.v / 100, left: t.s / 100, color: nb(t) }))); }), Rk = function(e, t) { if (e === t) return !0; for (var r in e) if (e[r] !== t[r]) return !1; return !0; }; function Iq(e, t, r) { var i = eb(r), s = qe(function() { return e.toHsva(t); }), c = s[0], f = s[1], m = Xe({ color: t, hsva: c }); ot(function() { if (!e.equal(t, m.current.color)) { var g = e.toHsva(t); m.current = { hsva: g, color: t }, f(g); } }, [t, e]), ot(function() { var g; Rk(c, m.current.hsva) || e.equal(g = e.fromHsva(c), m.current.color) || (m.current = { hsva: c, color: g }, i(g)); }, [c, e, i]); var y = ee(function(g) { f(function(S) { return Object.assign({}, S, g); }); }, []); return [c, y]; } var Fq = typeof window < "u" ? co : ot, Lq = function() { return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : void 0; }, n2 = /* @__PURE__ */ new Map(), Bq = function(e) { Fq(function() { var t = e.current ? e.current.ownerDocument : document; if (t !== void 0 && !n2.has(t)) { var r = t.createElement("style"); r.innerHTML = `.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`, n2.set(t, r); var i = Lq(); i && r.setAttribute("nonce", i), t.head.appendChild(r); } }, []); }, Uq = function(e) { var t = e.className, r = e.hsva, i = e.onChange, s = { backgroundImage: "linear-gradient(90deg, " + oS(Object.assign({}, r, { a: 0 })) + ", " + oS(Object.assign({}, r, { a: 1 })) + ")" }, c = Lg(["react-colorful__alpha", t]), f = Ua(100 * r.a); return jt.createElement("div", { className: c }, jt.createElement("div", { className: "react-colorful__alpha-gradient", style: s }), jt.createElement(P1, { onMove: function(m) { i({ a: m.left }); }, onKey: function(m) { i({ a: Bd(r.a + m.left) }); }, "aria-label": "Alpha", "aria-valuetext": f + "%", "aria-valuenow": f, "aria-valuemin": "0", "aria-valuemax": "100" }, jt.createElement(N1, { className: "react-colorful__alpha-pointer", left: r.a, color: oS(r) }))); }, Hq = function(e) { var t = e.className, r = e.colorModel, i = e.color, s = i === void 0 ? r.defaultColor : i, c = e.onChange, f = Mk(e, ["className", "colorModel", "color", "onChange"]), m = Xe(null); Bq(m); var y = Iq(r, s, c), g = y[0], S = y[1], E = Lg(["react-colorful", t]); return jt.createElement("div", Fg({}, f, { ref: m, className: E }), jt.createElement(zq, { hsva: g, onChange: S }), jt.createElement(Aq, { hue: g.h, onChange: S }), jt.createElement(Uq, { hsva: g, onChange: S, className: "react-colorful__last-control" })); }, Vq = { defaultColor: { r: 0, g: 0, b: 0, a: 1 }, toHsva: Oq, fromHsva: Nq, equal: Rk }, Wq = function(e) { return jt.createElement(Hq, Fg({}, e, { colorModel: Vq })); }; const Gq = $e(Wq, { baseStyle: { paddingInline: 4 }, shouldForwardProp: (e) => !["pickerColor"].includes(e) }), sS = { width: 6, height: 6, borderColor: "base.100" }, qq = (e) => { const { styleClass: t = "", ...r } = e; return /* @__PURE__ */ u.jsx( Gq, { sx: { ".react-colorful__hue-pointer": sS, ".react-colorful__saturation-pointer": sS, ".react-colorful__alpha-pointer": sS }, className: t, ...r } ); }, fg = Yr(qq), Yq = Ze( [on, er], (e, t) => { const { brushColor: r, maskColor: i, layer: s } = e; return { brushColor: r, maskColor: i, layer: s, isStaging: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function Kq() { const e = xe(), { brushColor: t, maskColor: r, layer: i, isStaging: s } = W(Yq), c = () => { if (i === "base") return `rgba(${t.r},${t.g},${t.b},${t.a})`; if (i === "mask") return `rgba(${r.r},${r.g},${r.b},${r.a})`; }; return We( ["shift+BracketLeft"], () => { e( Rd({ ...t, a: Pe.clamp(t.a - 0.05, 0.05, 1) }) ); }, { enabled: () => !s, preventDefault: !0 }, [t] ), We( ["shift+BracketRight"], () => { e( Rd({ ...t, a: Pe.clamp(t.a + 0.05, 0.05, 1) }) ); }, { enabled: () => !s, preventDefault: !0 }, [t] ), /* @__PURE__ */ u.jsx( Wo, { trigger: "hover", triggerComponent: /* @__PURE__ */ u.jsx( Ut, { sx: { width: 7, height: 7, minWidth: 7, minHeight: 7, borderRadius: "full", bg: c(), cursor: "pointer" } } ), children: /* @__PURE__ */ u.jsxs(ne, { minWidth: 60, direction: "column", gap: 4, width: "100%", children: [ i === "base" && /* @__PURE__ */ u.jsx( fg, { sx: { width: "100%", paddingTop: 2, paddingBottom: 2 }, pickerColor: t, onChange: (f) => e(Rd(f)) } ), i === "mask" && /* @__PURE__ */ u.jsx( fg, { sx: { width: "100%", paddingTop: 2, paddingBottom: 2 }, pickerColor: r, onChange: (f) => e(dD(f)) } ) ] }) } ); } function Pk() { return /* @__PURE__ */ u.jsxs(ne, { columnGap: 4, alignItems: "center", children: [ /* @__PURE__ */ u.jsx(Pq, {}), /* @__PURE__ */ u.jsx(Kq, {}) ] }); } function Xq() { const e = xe(), t = W( (i) => i.canvas.shouldRestrictStrokesToBox ), { t: r } = Ce(); return /* @__PURE__ */ u.jsx( An, { label: r("unifiedCanvas.betaLimitToBox"), isChecked: t, onChange: (i) => e(fD(i.target.checked)) } ); } function $q() { return /* @__PURE__ */ u.jsxs(ne, { gap: 4, alignItems: "center", children: [ /* @__PURE__ */ u.jsx(Pk, {}), /* @__PURE__ */ u.jsx(Xq, {}) ] }); } function Qq() { const e = xe(), { t } = Ce(), r = () => e(ub()); return /* @__PURE__ */ u.jsx( an, { size: "sm", leftIcon: /* @__PURE__ */ u.jsx(qu, {}), onClick: r, tooltip: `${t("unifiedCanvas.clearMask")} (Shift+C)`, children: t("unifiedCanvas.betaClear") } ); } function Zq() { const e = W( (s) => s.canvas.isMaskEnabled ), t = xe(), { t: r } = Ce(), i = () => t(Jp(!e)); return /* @__PURE__ */ u.jsx( An, { label: `${r("unifiedCanvas.enableMask")} (H)`, isChecked: e, onChange: i } ); } function Jq() { const e = xe(), { t } = Ce(), r = W( (i) => i.canvas.shouldPreserveMaskedArea ); return /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.betaPreserveMasked"), isChecked: r, onChange: (i) => e(pD(i.target.checked)) } ); } function eY() { return /* @__PURE__ */ u.jsxs(ne, { gap: 4, alignItems: "center", children: [ /* @__PURE__ */ u.jsx(Pk, {}), /* @__PURE__ */ u.jsx(Zq, {}), /* @__PURE__ */ u.jsx(Jq, {}), /* @__PURE__ */ u.jsx(Qq, {}) ] }); } function tY() { const e = W( (i) => i.canvas.shouldDarkenOutsideBoundingBox ), t = xe(), { t: r } = Ce(); return /* @__PURE__ */ u.jsx( An, { label: r("unifiedCanvas.betaDarkenOutside"), isChecked: e, onChange: (i) => t(hD(i.target.checked)) } ); } function nY() { const e = W( (i) => i.canvas.shouldShowGrid ), t = xe(), { t: r } = Ce(); return /* @__PURE__ */ u.jsx( An, { label: r("unifiedCanvas.showGrid"), isChecked: e, onChange: (i) => t(vD(i.target.checked)) } ); } function rY() { const e = W( (s) => s.canvas.shouldSnapToGrid ), t = xe(), { t: r } = Ce(), i = (s) => t(Km(s.target.checked)); return /* @__PURE__ */ u.jsx( An, { label: `${r("unifiedCanvas.snapToGrid")} (N)`, isChecked: e, onChange: i } ); } function aY() { return /* @__PURE__ */ u.jsxs(ne, { alignItems: "center", gap: 4, children: [ /* @__PURE__ */ u.jsx(nY, {}), /* @__PURE__ */ u.jsx(rY, {}), /* @__PURE__ */ u.jsx(tY, {}) ] }); } const iY = Ze( [on], (e) => { const { tool: t, layer: r } = e; return { tool: t, layer: r }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function oY() { const { tool: e, layer: t } = W(iY); return /* @__PURE__ */ u.jsxs(ne, { height: 8, minHeight: 8, maxHeight: 8, alignItems: "center", children: [ t == "base" && ["brush", "eraser", "colorPicker"].includes(e) && /* @__PURE__ */ u.jsx($q, {}), t == "mask" && ["brush", "eraser", "colorPicker"].includes(e) && /* @__PURE__ */ u.jsx(eY, {}), e == "move" && /* @__PURE__ */ u.jsx(aY, {}) ] }); } const sY = Ze( [on], (e) => { const { doesCanvasNeedScaling: t } = e; return { doesCanvasNeedScaling: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), lY = () => { const e = xe(), { doesCanvasNeedScaling: t } = W(sY); return co(() => { e(wa()); const r = () => { e(wa()); }; return window.addEventListener("resize", r), () => window.removeEventListener("resize", r); }, [e]), /* @__PURE__ */ u.jsx( Ut, { sx: { width: "100%", height: "100%", borderRadius: "base", bg: "base.850" }, children: /* @__PURE__ */ u.jsxs( ne, { flexDirection: "row", width: "100%", height: "100%", columnGap: 4, padding: 4, children: [ /* @__PURE__ */ u.jsx(Rq, {}), /* @__PURE__ */ u.jsxs(ne, { width: "100%", height: "100%", flexDirection: "column", rowGap: 4, children: [ /* @__PURE__ */ u.jsx(oY, {}), t ? /* @__PURE__ */ u.jsx(Ek, {}) : /* @__PURE__ */ u.jsx(Ck, {}) ] }) ] } ) } ); }, uY = Ze( [on, er], (e, t) => { const { maskColor: r, layer: i, isMaskEnabled: s, shouldPreserveMaskedArea: c } = e; return { layer: i, maskColor: r, maskColorString: Bu(r), isMaskEnabled: s, shouldPreserveMaskedArea: c, isStaging: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), cY = () => { const e = xe(), { t } = Ce(), { layer: r, maskColor: i, isMaskEnabled: s, shouldPreserveMaskedArea: c, isStaging: f } = W(uY); We( ["q"], () => { m(); }, { enabled: () => !f, preventDefault: !0 }, [r] ), We( ["shift+c"], () => { y(); }, { enabled: () => !f, preventDefault: !0 }, [] ), We( ["h"], () => { g(); }, { enabled: () => !f, preventDefault: !0 }, [s] ); const m = () => { e(Xm(r === "mask" ? "base" : "mask")); }, y = () => e(ub()), g = () => e(Jp(!s)); return /* @__PURE__ */ u.jsx( Wo, { trigger: "hover", triggerComponent: /* @__PURE__ */ u.jsx(qr, { children: /* @__PURE__ */ u.jsx( Be, { "aria-label": t("unifiedCanvas.maskingOptions"), tooltip: t("unifiedCanvas.maskingOptions"), icon: /* @__PURE__ */ u.jsx(Uz, {}), isChecked: r === "mask", isDisabled: f } ) }), children: /* @__PURE__ */ u.jsxs(ne, { direction: "column", gap: 2, children: [ /* @__PURE__ */ u.jsx( An, { label: `${t("unifiedCanvas.enableMask")} (H)`, isChecked: s, onChange: g } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.preserveMaskedArea"), isChecked: c, onChange: (S) => e(pD(S.target.checked)) } ), /* @__PURE__ */ u.jsx( fg, { sx: { paddingTop: 2, paddingBottom: 2 }, pickerColor: i, onChange: (S) => e(dD(S)) } ), /* @__PURE__ */ u.jsxs(an, { size: "sm", leftIcon: /* @__PURE__ */ u.jsx(qu, {}), onClick: y, children: [ t("unifiedCanvas.clearMask"), " (Shift+C)" ] }) ] }) } ); }, dY = Ze( [on], (e) => { const { shouldAutoSave: t, shouldCropToBoundingBoxOnSave: r, shouldDarkenOutsideBoundingBox: i, shouldShowCanvasDebugInfo: s, shouldShowGrid: c, shouldShowIntermediates: f, shouldSnapToGrid: m, shouldRestrictStrokesToBox: y } = e; return { shouldAutoSave: t, shouldCropToBoundingBoxOnSave: r, shouldDarkenOutsideBoundingBox: i, shouldShowCanvasDebugInfo: s, shouldShowGrid: c, shouldShowIntermediates: f, shouldSnapToGrid: m, shouldRestrictStrokesToBox: y }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), fY = () => { const e = xe(), { t } = Ce(), { shouldAutoSave: r, shouldCropToBoundingBoxOnSave: i, shouldDarkenOutsideBoundingBox: s, shouldShowCanvasDebugInfo: c, shouldShowGrid: f, shouldShowIntermediates: m, shouldSnapToGrid: y, shouldRestrictStrokesToBox: g } = W(dY); We( ["n"], () => { e(Km(!y)); }, { enabled: !0, preventDefault: !0 }, [y] ); const S = (E) => e(Km(E.target.checked)); return /* @__PURE__ */ u.jsx( Wo, { trigger: "hover", triggerComponent: /* @__PURE__ */ u.jsx( Be, { tooltip: t("unifiedCanvas.canvasSettings"), "aria-label": t("unifiedCanvas.canvasSettings"), icon: /* @__PURE__ */ u.jsx(pb, {}) } ), children: /* @__PURE__ */ u.jsxs(ne, { direction: "column", gap: 2, children: [ /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.showIntermediates"), isChecked: m, onChange: (E) => e(sD(E.target.checked)) } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.showGrid"), isChecked: f, onChange: (E) => e(vD(E.target.checked)) } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.snapToGrid"), isChecked: y, onChange: S } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.darkenOutsideSelection"), isChecked: s, onChange: (E) => e(hD(E.target.checked)) } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.autoSaveToGallery"), isChecked: r, onChange: (E) => e(lD(E.target.checked)) } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.saveBoxRegionOnly"), isChecked: i, onChange: (E) => e(uD(E.target.checked)) } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.limitStrokesToBox"), isChecked: g, onChange: (E) => e(fD(E.target.checked)) } ), /* @__PURE__ */ u.jsx( An, { label: t("unifiedCanvas.showCanvasDebugInfo"), isChecked: c, onChange: (E) => e(cD(E.target.checked)) } ), /* @__PURE__ */ u.jsx(_k, {}), /* @__PURE__ */ u.jsx(Dk, {}) ] }) } ); }, pY = Ze( [on, er, Vn], (e, t, r) => { const { isProcessing: i } = r, { tool: s, brushColor: c, brushSize: f } = e; return { tool: s, isStaging: t, isProcessing: i, brushColor: c, brushSize: f }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), hY = () => { const e = xe(), { tool: t, brushColor: r, brushSize: i, isStaging: s } = W(pY), { t: c } = Ce(); We( ["b"], () => { f(); }, { enabled: () => !s, preventDefault: !0 }, [] ), We( ["e"], () => { m(); }, { enabled: () => !s, preventDefault: !0 }, [t] ), We( ["c"], () => { y(); }, { enabled: () => !s, preventDefault: !0 }, [t] ), We( ["shift+f"], () => { g(); }, { enabled: () => !s, preventDefault: !0 } ), We( ["delete", "backspace"], () => { S(); }, { enabled: () => !s, preventDefault: !0 } ), We( ["BracketLeft"], () => { e(kd(Math.max(i - 5, 5))); }, { enabled: () => !s, preventDefault: !0 }, [i] ), We( ["BracketRight"], () => { e(kd(Math.min(i + 5, 500))); }, { enabled: () => !s, preventDefault: !0 }, [i] ), We( ["shift+BracketLeft"], () => { e( Rd({ ...r, a: Pe.clamp(r.a - 0.05, 0.05, 1) }) ); }, { enabled: () => !s, preventDefault: !0 }, [r] ), We( ["shift+BracketRight"], () => { e( Rd({ ...r, a: Pe.clamp(r.a + 0.05, 0.05, 1) }) ); }, { enabled: () => !s, preventDefault: !0 }, [r] ); const f = () => e(Go("brush")), m = () => e(Go("eraser")), y = () => e(Go("colorPicker")), g = () => e(eD()), S = () => e(tD()); return /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, children: [ /* @__PURE__ */ u.jsx( Be, { "aria-label": `${c("unifiedCanvas.brush")} (B)`, tooltip: `${c("unifiedCanvas.brush")} (B)`, icon: /* @__PURE__ */ u.jsx(nD, {}), isChecked: t === "brush" && !s, onClick: f, isDisabled: s } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${c("unifiedCanvas.eraser")} (E)`, tooltip: `${c("unifiedCanvas.eraser")} (E)`, icon: /* @__PURE__ */ u.jsx(rD, {}), isChecked: t === "eraser" && !s, isDisabled: s, onClick: m } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${c("unifiedCanvas.fillBoundingBox")} (Shift+F)`, tooltip: `${c("unifiedCanvas.fillBoundingBox")} (Shift+F)`, icon: /* @__PURE__ */ u.jsx(aD, {}), isDisabled: s, onClick: g } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${c("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`, tooltip: `${c("unifiedCanvas.eraseBoundingBox")} (Del/Backspace)`, icon: /* @__PURE__ */ u.jsx(Qp, { style: { transform: "rotate(45deg)" } }), isDisabled: s, onClick: S } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${c("unifiedCanvas.colorPicker")} (C)`, tooltip: `${c("unifiedCanvas.colorPicker")} (C)`, icon: /* @__PURE__ */ u.jsx(iD, {}), isChecked: t === "colorPicker" && !s, isDisabled: s, onClick: y } ), /* @__PURE__ */ u.jsx( Wo, { trigger: "hover", triggerComponent: /* @__PURE__ */ u.jsx( Be, { "aria-label": c("unifiedCanvas.brushOptions"), tooltip: c("unifiedCanvas.brushOptions"), icon: /* @__PURE__ */ u.jsx(db, {}) } ), children: /* @__PURE__ */ u.jsxs(ne, { minWidth: 60, direction: "column", gap: 4, width: "100%", children: [ /* @__PURE__ */ u.jsx(ne, { gap: 4, justifyContent: "space-between", children: /* @__PURE__ */ u.jsx( jn, { label: c("unifiedCanvas.brushSize"), value: i, withInput: !0, onChange: (E) => e(kd(E)), sliderNumberInputProps: { max: 500 }, inputReadOnly: !1 } ) }), /* @__PURE__ */ u.jsx( fg, { sx: { width: "100%", paddingTop: 2, paddingBottom: 2 }, pickerColor: r, onChange: (E) => e(Rd(E)) } ) ] }) } ) ] }); }, vY = Ze( [Vn, on, er], (e, t, r) => { const { isProcessing: i } = e, { tool: s, shouldCropToBoundingBoxOnSave: c, layer: f, isMaskEnabled: m } = t; return { isProcessing: i, isStaging: r, isMaskEnabled: m, tool: s, layer: f, shouldCropToBoundingBoxOnSave: c }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), mY = () => { const e = xe(), { isProcessing: t, isStaging: r, isMaskEnabled: i, layer: s, tool: c, shouldCropToBoundingBoxOnSave: f } = W(vY), m = Yo(), { t: y } = Ce(), { openUploader: g } = Kb(); We( ["v"], () => { S(); }, { enabled: () => !r, preventDefault: !0 }, [] ), We( ["r"], () => { w(); }, { enabled: () => !0, preventDefault: !0 }, [m] ), We( ["shift+m"], () => { M(); }, { enabled: () => !r, preventDefault: !0 }, [m, t] ), We( ["shift+s"], () => { k(); }, { enabled: () => !r, preventDefault: !0 }, [m, t] ), We( ["meta+c", "ctrl+c"], () => { R(); }, { enabled: () => !r, preventDefault: !0 }, [m, t] ), We( ["shift+d"], () => { O(); }, { enabled: () => !r, preventDefault: !0 }, [m, t] ); const S = () => e(Go("move")), E = Tk( () => w(!1), () => w(!0) ), w = (A = !1) => { const L = Yo(); if (!L) return; const H = L.getClientRect({ skipTransform: !0 }); e( Z2({ contentRect: H, shouldScaleTo1: A }) ); }, D = () => { e(fb()), e(yg()); }, M = () => { e( Pl({ cropVisible: !1, shouldSetAsInitialImage: !0 }) ); }, k = () => { e( Pl({ cropVisible: !f, cropToBoundingBox: f, shouldSaveToGallery: !0 }) ); }, R = () => { e( Pl({ cropVisible: !f, cropToBoundingBox: f, shouldCopy: !0 }) ); }, O = () => { e( Pl({ cropVisible: !f, cropToBoundingBox: f, shouldDownload: !0 }) ); }, I = (A) => { const L = A.target.value; e(Xm(L)), L === "mask" && !i && e(Jp(!0)); }; return /* @__PURE__ */ u.jsxs( ne, { sx: { alignItems: "center", gap: 2 }, children: [ /* @__PURE__ */ u.jsx( ni, { tooltip: `${y("unifiedCanvas.layer")} (Q)`, tooltipProps: { hasArrow: !0, placement: "top" }, value: s, validValues: X2, onChange: I, isDisabled: r } ), /* @__PURE__ */ u.jsx(cY, {}), /* @__PURE__ */ u.jsx(hY, {}), /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, children: [ /* @__PURE__ */ u.jsx( Be, { "aria-label": `${y("unifiedCanvas.move")} (V)`, tooltip: `${y("unifiedCanvas.move")} (V)`, icon: /* @__PURE__ */ u.jsx(Q2, {}), isChecked: c === "move" || r, onClick: S } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${y("unifiedCanvas.resetView")} (R)`, tooltip: `${y("unifiedCanvas.resetView")} (R)`, icon: /* @__PURE__ */ u.jsx(J2, {}), onClick: E } ) ] }), /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, children: [ /* @__PURE__ */ u.jsx( Be, { "aria-label": `${y("unifiedCanvas.mergeVisible")} (Shift+M)`, tooltip: `${y("unifiedCanvas.mergeVisible")} (Shift+M)`, icon: /* @__PURE__ */ u.jsx($2, {}), onClick: M, isDisabled: r } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${y("unifiedCanvas.saveToGallery")} (Shift+S)`, tooltip: `${y("unifiedCanvas.saveToGallery")} (Shift+S)`, icon: /* @__PURE__ */ u.jsx(cb, {}), onClick: k, isDisabled: r } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${y("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`, tooltip: `${y("unifiedCanvas.copyToClipboard")} (Cmd/Ctrl+C)`, icon: /* @__PURE__ */ u.jsx(zd, {}), onClick: R, isDisabled: r } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${y("unifiedCanvas.downloadAsImage")} (Shift+D)`, tooltip: `${y("unifiedCanvas.downloadAsImage")} (Shift+D)`, icon: /* @__PURE__ */ u.jsx(sb, {}), onClick: O, isDisabled: r } ) ] }), /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, children: [ /* @__PURE__ */ u.jsx(jk, {}), /* @__PURE__ */ u.jsx(wk, {}) ] }), /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, children: [ /* @__PURE__ */ u.jsx( Be, { "aria-label": `${y("common.upload")}`, tooltip: `${y("common.upload")}`, icon: /* @__PURE__ */ u.jsx(gg, {}), onClick: g, isDisabled: r } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": `${y("unifiedCanvas.clearCanvas")}`, tooltip: `${y("unifiedCanvas.clearCanvas")}`, icon: /* @__PURE__ */ u.jsx(qu, {}), onClick: D, colorScheme: "error", isDisabled: r } ) ] }), /* @__PURE__ */ u.jsx(qr, { isAttached: !0, children: /* @__PURE__ */ u.jsx(fY, {}) }) ] } ); }, gY = Ze( [on], (e) => { const { doesCanvasNeedScaling: t } = e; return { doesCanvasNeedScaling: t }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), yY = () => { const e = xe(), { doesCanvasNeedScaling: t } = W(gY); return co(() => { e(wa()); const r = () => { e(wa()); }; return window.addEventListener("resize", r), () => window.removeEventListener("resize", r); }, [e]), /* @__PURE__ */ u.jsx( Ut, { sx: { width: "100%", height: "100%", padding: 4, borderRadius: "base", bg: "base.850" }, children: /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", alignItems: "center", gap: 4, width: "100%", height: "100%" }, children: [ /* @__PURE__ */ u.jsx(mY, {}), /* @__PURE__ */ u.jsx( ne, { sx: { flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 4, width: "100%", height: "100%" }, children: t ? /* @__PURE__ */ u.jsx(Ek, {}) : /* @__PURE__ */ u.jsx(Ck, {}) } ) ] } ) } ); }, xY = Ze( on, (e) => { const { boundingBoxDimensions: t, boundingBoxScaleMethod: r } = e; return { boundingBoxDimensions: t, boundingBoxScale: r }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), SY = () => { const e = xe(), { boundingBoxDimensions: t } = W(xY), { t: r } = Ce(), i = (m) => { e( Rp({ ...t, width: Math.floor(m) }) ); }, s = (m) => { e( Rp({ ...t, height: Math.floor(m) }) ); }, c = () => { e( Rp({ ...t, width: Math.floor(512) }) ); }, f = () => { e( Rp({ ...t, height: Math.floor(512) }) ); }; return /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "stretch", children: [ /* @__PURE__ */ u.jsx( jn, { label: r("parameters.width"), min: 64, max: 1024, step: 64, value: t.width, onChange: i, sliderNumberInputProps: { max: 4096 }, withSliderMarks: !0, withInput: !0, inputReadOnly: !0, withReset: !0, handleReset: c } ), /* @__PURE__ */ u.jsx( jn, { label: r("parameters.height"), min: 64, max: 1024, step: 64, value: t.height, onChange: s, sliderNumberInputProps: { max: 4096 }, withSliderMarks: !0, withInput: !0, inputReadOnly: !0, withReset: !0, handleReset: f } ) ] }); }, bY = Ze( [w1, Vn, on], (e, t, r) => { const { tileSize: i, infillMethod: s } = e, { infill_methods: c } = t, { boundingBoxScaleMethod: f, scaledBoundingBoxDimensions: m } = r; return { boundingBoxScale: f, scaledBoundingBoxDimensions: m, tileSize: i, infillMethod: s, availableInfillMethods: c, isManual: f === "manual" }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), CY = () => { const e = xe(), { tileSize: t, infillMethod: r, availableInfillMethods: i, boundingBoxScale: s, isManual: c, scaledBoundingBoxDimensions: f } = W(bY), { t: m } = Ce(), y = (D) => { e( gm({ ...f, width: Math.floor(D) }) ); }, g = (D) => { e( gm({ ...f, height: Math.floor(D) }) ); }, S = () => { e( gm({ ...f, width: Math.floor(512) }) ); }, E = () => { e( gm({ ...f, height: Math.floor(512) }) ); }, w = (D) => { e(Wz(D.target.value)); }; return /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "stretch", children: [ /* @__PURE__ */ u.jsx( ni, { label: m("parameters.scaleBeforeProcessing"), validValues: Hz, value: s, onChange: w } ), /* @__PURE__ */ u.jsx( jn, { isInputDisabled: !c, isResetDisabled: !c, isSliderDisabled: !c, label: m("parameters.scaledWidth"), min: 64, max: 1024, step: 64, value: f.width, onChange: y, sliderNumberInputProps: { max: 4096 }, withSliderMarks: !0, withInput: !0, inputReadOnly: !0, withReset: !0, handleReset: S } ), /* @__PURE__ */ u.jsx( jn, { isInputDisabled: !c, isResetDisabled: !c, isSliderDisabled: !c, label: m("parameters.scaledHeight"), min: 64, max: 1024, step: 64, value: f.height, onChange: g, sliderNumberInputProps: { max: 4096 }, withSliderMarks: !0, withInput: !0, inputReadOnly: !0, withReset: !0, handleReset: E } ), /* @__PURE__ */ u.jsx( ni, { label: m("parameters.infillMethod"), value: r, validValues: i, onChange: (D) => e(Vz(D.target.value)) } ), /* @__PURE__ */ u.jsx( jn, { isInputDisabled: r !== "tile", isResetDisabled: r !== "tile", isSliderDisabled: r !== "tile", label: m("parameters.tileSize"), min: 16, max: 64, sliderNumberInputProps: { max: 256 }, value: t, onChange: (D) => { e(zw(D)); }, withInput: !0, withSliderMarks: !0, withReset: !0, handleReset: () => { e(zw(32)); } } ) ] }); }; function EY() { const e = xe(), t = W( (i) => i.generation.seamBlur ), { t: r } = Ce(); return /* @__PURE__ */ u.jsx( jn, { label: r("parameters.seamBlur"), min: 0, max: 64, sliderNumberInputProps: { max: 512 }, value: t, onChange: (i) => { e(Iw(i)); }, withInput: !0, withSliderMarks: !0, withReset: !0, handleReset: () => { e(Iw(16)); } } ); } function wY() { const e = xe(), { t } = Ce(), r = W( (i) => i.generation.seamSize ); return /* @__PURE__ */ u.jsx( jn, { label: t("parameters.seamSize"), min: 1, max: 256, sliderNumberInputProps: { max: 512 }, value: r, onChange: (i) => { e(Fw(i)); }, withInput: !0, withSliderMarks: !0, withReset: !0, handleReset: () => e(Fw(96)) } ); } function jY() { const { t: e } = Ce(), t = W( (i) => i.generation.seamSteps ), r = xe(); return /* @__PURE__ */ u.jsx( jn, { label: e("parameters.seamSteps"), min: 1, max: 100, sliderNumberInputProps: { max: 999 }, value: t, onChange: (i) => { r(Lw(i)); }, withInput: !0, withSliderMarks: !0, withReset: !0, handleReset: () => { r(Lw(30)); } } ); } function TY() { const e = xe(), { t } = Ce(), r = W( (i) => i.generation.seamStrength ); return /* @__PURE__ */ u.jsx( jn, { label: t("parameters.seamStrength"), min: 0.01, max: 0.99, step: 0.01, value: r, onChange: (i) => { e(Bw(i)); }, withInput: !0, withSliderMarks: !0, withReset: !0, handleReset: () => { e(Bw(0.7)); } } ); } const DY = () => /* @__PURE__ */ u.jsxs(zt, { gap: 2, alignItems: "stretch", children: [ /* @__PURE__ */ u.jsx(wY, {}), /* @__PURE__ */ u.jsx(EY, {}), /* @__PURE__ */ u.jsx(TY, {}), /* @__PURE__ */ u.jsx(jY, {}) ] }); function _Y() { const { t: e } = Ce(), t = { general: { header: `${e("parameters.general")}`, feature: void 0, content: /* @__PURE__ */ u.jsx(b1, {}) }, unifiedCanvasImg2Img: { header: `${e("parameters.imageToImage")}`, feature: void 0, content: /* @__PURE__ */ u.jsx(pk, { label: e("parameters.img2imgStrength") }) }, seed: { header: `${e("parameters.seed")}`, feature: Ca.SEED, content: /* @__PURE__ */ u.jsx(y1, {}) }, boundingBox: { header: `${e("parameters.boundingBoxHeader")}`, feature: Ca.BOUNDING_BOX, content: /* @__PURE__ */ u.jsx(SY, {}) }, seamCorrection: { header: `${e("parameters.seamCorrectionHeader")}`, feature: Ca.SEAM_CORRECTION, content: /* @__PURE__ */ u.jsx(DY, {}) }, infillAndScaling: { header: `${e("parameters.infillScalingHeader")}`, feature: Ca.INFILL_AND_SCALING, content: /* @__PURE__ */ u.jsx(CY, {}) }, variations: { header: `${e("parameters.variations")}`, feature: Ca.VARIATIONS, content: /* @__PURE__ */ u.jsx(S1, {}), additionalHeaderComponents: /* @__PURE__ */ u.jsx(x1, {}) }, symmetry: { header: `${e("parameters.symmetry")}`, content: /* @__PURE__ */ u.jsx(m1, {}), additionalHeaderComponents: /* @__PURE__ */ u.jsx(g1, {}) } }; return /* @__PURE__ */ u.jsxs(ne, { flexDir: "column", gap: 2, position: "relative", children: [ /* @__PURE__ */ u.jsx(_1, {}), /* @__PURE__ */ u.jsx(D1, {}), /* @__PURE__ */ u.jsx(T1, {}), /* @__PURE__ */ u.jsx(C1, { accordionInfo: t }) ] }); } function MY() { const e = W( (r) => r.ui.shouldUseCanvasBetaLayout ), t = W(Bn); return /* @__PURE__ */ u.jsx(c1, { parametersPanelContent: /* @__PURE__ */ u.jsx(_Y, {}), children: t === "unifiedCanvas" && (e ? /* @__PURE__ */ u.jsx(lY, {}) : /* @__PURE__ */ u.jsx(yY, {})) }); } const Ed = { boxSize: 6 }, r2 = [ { id: "txt2img", icon: /* @__PURE__ */ u.jsx(ia, { as: F9, sx: Ed }), workarea: /* @__PURE__ */ u.jsx(dW, {}) }, { id: "img2img", icon: /* @__PURE__ */ u.jsx(ia, { as: l1, sx: Ed }), workarea: /* @__PURE__ */ u.jsx(rW, {}) }, { id: "unifiedCanvas", icon: /* @__PURE__ */ u.jsx(ia, { as: U9, sx: Ed }), workarea: /* @__PURE__ */ u.jsx(MY, {}) }, { id: "nodes", icon: /* @__PURE__ */ u.jsx(ia, { as: L9, sx: Ed }), workarea: /* @__PURE__ */ u.jsx(Y9, {}) }, { id: "postprocessing", icon: /* @__PURE__ */ u.jsx(ia, { as: H9, sx: Ed }), workarea: /* @__PURE__ */ u.jsx(K9, {}) }, { id: "training", icon: /* @__PURE__ */ u.jsx(ia, { as: B9, sx: Ed }), workarea: /* @__PURE__ */ u.jsx(X9, {}) } ]; function kY() { const e = W(k3), t = W( (y) => y.lightbox.isLightboxOpen ), r = W( (y) => y.ui.shouldPinGallery ), i = W( (y) => y.ui.shouldPinParametersPanel ), { t: s } = Ce(), c = xe(); We("1", () => { c(ei(0)); }), We("2", () => { c(ei(1)); }), We("3", () => { c(ei(2)); }), We("4", () => { c(ei(3)); }), We("5", () => { c(ei(4)); }), We("6", () => { c(ei(5)); }), We( "z", () => { c(zu(!t)); }, [t] ), We( "f", () => { c(Gz()), (r || i) && c(wa()); }, [r, i] ); const f = Xt( () => r2.map((y) => /* @__PURE__ */ u.jsx( Ea, { hasArrow: !0, label: String(s(`common.${y.id}`)), placement: "end", children: /* @__PURE__ */ u.jsxs(nM, { children: [ /* @__PURE__ */ u.jsx(kD, { children: String(s(`common.${y.id}`)) }), y.icon ] }) }, y.id )), [s] ), m = Xt( () => r2.map((y) => /* @__PURE__ */ u.jsx(eM, { children: y.workarea }, y.id)), [] ); return /* @__PURE__ */ u.jsxs( Z_, { isLazy: !0, defaultIndex: e, index: e, onChange: (y) => { c(ei(y)); }, flexGrow: 1, children: [ /* @__PURE__ */ u.jsx(J_, { children: f }), /* @__PURE__ */ u.jsx(tM, { children: m }) ] } ); } function RY() { async function e(r = "") { return await fetch(r, { method: "GET", cache: "no-cache" }); } const t = () => { const r = document.location; e(r + "/flaskwebgui-keep-server-alive").then((s) => s); }; (!{}.NODE_ENV || {}.NODE_ENV === "production") && document.addEventListener("DOMContentLoaded", () => { t(), setInterval(t, 3e3); }); } const PY = () => { const e = xe(), t = W(XB), r = nh(); ot(() => { t.forEach((i) => { r(i); }), t.length > 0 && e(qz()); }, [e, r, t]); }, NY = Ze( [Bn, $o], (e, t) => { const { shouldPinGallery: r, shouldShowGallery: i } = t; return { shouldPinGallery: r, shouldShowGalleryButton: (!r || !i) && ["txt2img", "img2img", "unifiedCanvas"].includes(e) }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), OY = () => { const { t: e } = Ce(), { shouldPinGallery: t, shouldShowGalleryButton: r } = W( NY ), i = xe(), s = () => { i(CS(!0)), t && i(wa()); }; return r ? /* @__PURE__ */ u.jsx( Be, { tooltip: "Show Gallery (G)", tooltipProps: { placement: "top" }, "aria-label": e("accessibility.showGallery"), onClick: s, sx: { pos: "absolute", top: "50%", transform: "translate(0, -50%)", zIndex: 31, p: 0, insetInlineEnd: 0, px: 3, h: 48, w: 8, borderStartEndRadius: 0, borderEndEndRadius: 0 }, children: /* @__PURE__ */ u.jsx(l1, {}) } ) : null; }, lS = { borderStartStartRadius: 0, borderEndStartRadius: 0 }, AY = Ze( [$o, Bn], (e, t) => { const { shouldPinParametersPanel: r, shouldUseCanvasBetaLayout: i, shouldShowParametersPanel: s } = e, c = i && t === "unifiedCanvas", f = !c && (!r || !s), m = !c && (!r || !s) && ["txt2img", "img2img", "unifiedCanvas"].includes(t); return { shouldPinParametersPanel: r, shouldShowParametersPanelButton: m, shouldShowProcessButtons: f }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ), zY = () => { const e = xe(), { t } = Ce(), { shouldShowProcessButtons: r, shouldShowParametersPanelButton: i, shouldPinParametersPanel: s } = W(AY), c = () => { e(Gm(!0)), s && e(wa()); }; return i ? /* @__PURE__ */ u.jsxs( ne, { pos: "absolute", transform: "translate(0, -50%)", zIndex: 20, minW: 8, top: "50%", insetInlineStart: "4.5rem", direction: "column", gap: 2, children: [ /* @__PURE__ */ u.jsx( Be, { tooltip: "Show Options Panel (O)", tooltipProps: { placement: "top" }, "aria-label": t("accessibility.showOptionsPanel"), onClick: c, sx: lS, children: /* @__PURE__ */ u.jsx(db, {}) } ), r && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx(j1, { iconButton: !0, sx: lS }), /* @__PURE__ */ u.jsx(E1, { sx: lS }) ] }) ] } ) : null; }; var Ip = globalThis && globalThis.__assign || function() { return Ip = Object.assign || function(e) { for (var t, r = 1, i = arguments.length; r < i; r++) { t = arguments[r]; for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && (e[s] = t[s]); } return e; }, Ip.apply(this, arguments); }; function IY(e) { var t, r = qe(!1), i = r[0], s = r[1], c = qe(!1), f = c[0], m = c[1], y = qe(!1), g = y[0], S = y[1], E = qe([0, 0]), w = E[0], D = E[1], M = Xe(null); ot(function() { if (i) setTimeout(function() { m(!0), setTimeout(function() { S(!0); }); }); else { S(!1); var R = setTimeout(function() { m(i); }, 1e3); return function() { return clearTimeout(R); }; } }, [i]), V5("contextmenu", function(R) { var O; !((O = M.current) === null || O === void 0) && O.contains(R.target) || R.target === M.current ? (R.preventDefault(), s(!0), D([R.pageX, R.pageY])) : s(!1); }); var k = ee(function() { var R, O; (O = (R = e.menuProps) === null || R === void 0 ? void 0 : R.onClose) === null || O === void 0 || O.call(R), s(!1); }, [(t = e.menuProps) === null || t === void 0 ? void 0 : t.onClose, s]); return Ge.createElement( Ge.Fragment, null, e.children(M), f && Ge.createElement( Wm, Ip({}, e.portalProps), Ge.createElement( Ib, Ip({ isOpen: g, gutter: 0 }, e.menuProps, { onClose: k }), Ge.createElement(Lb, Ip({ "aria-hidden": !0, w: 1, h: 1, style: { position: "absolute", left: w[0], top: w[1], cursor: "default" } }, e.menuButtonProps)), e.renderMenu() ) ) ); } const FY = (e, t) => e.image.uuid === t.image.uuid && e.isSelected === t.isSelected, Nk = Yr((e) => { const t = xe(), { activeTabName: r, galleryImageObjectFit: i, galleryImageMinimumWidth: s, mayDeleteImage: c, shouldUseSingleGalleryColumn: f } = W(Q9), { image: m, isSelected: y } = e, { url: g, thumbnail: S, uuid: E, metadata: w } = m, [D, M] = qe(!1), k = nh(), { direction: R } = hg(), { t: O } = Ce(), I = h1(), A = () => M(!0), L = () => M(!1), H = () => { var fe, _e, Me, te; (_e = (fe = m.metadata) == null ? void 0 : fe.image) != null && _e.prompt && I((te = (Me = m.metadata) == null ? void 0 : Me.image) == null ? void 0 : te.prompt), k({ title: O("toast.promptSet"), status: "success", duration: 2500, isClosable: !0 }); }, q = () => { m.metadata && t(Zp(m.metadata.image.seed)), k({ title: O("toast.seedSet"), status: "success", duration: 2500, isClosable: !0 }); }, U = () => { t(Xp(m)), r !== "img2img" && t(ei("img2img")), k({ title: O("toast.sentToImageToImage"), status: "success", duration: 2500, isClosable: !0 }); }, $ = () => { t(vg(m)), t(yg()), r !== "unifiedCanvas" && t(ei("unifiedCanvas")), k({ title: O("toast.sentToUnifiedCanvas"), status: "success", duration: 2500, isClosable: !0 }); }, ae = () => { w && t(R2(w)), k({ title: O("toast.parametersSet"), status: "success", duration: 2500, isClosable: !0 }); }, oe = async () => { var fe; if ((fe = w == null ? void 0 : w.image) != null && fe.init_image_path && (await fetch(w.image.init_image_path)).ok) { t(ei("img2img")), t(Kz(w)), k({ title: O("toast.initialImageSet"), status: "success", duration: 2500, isClosable: !0 }); return; } k({ title: O("toast.initialImageNotSet"), description: O("toast.initialImageNotSetDesc"), status: "error", duration: 2500, isClosable: !0 }); }, Y = () => t(Uw(m)), ve = (fe) => { fe.dataTransfer.setData("invokeai/imageUuid", E), fe.dataTransfer.effectAllowed = "move"; }, de = () => { t(Uw(m)), t(zu(!0)); }; return /* @__PURE__ */ u.jsx( IY, { menuProps: { size: "sm", isLazy: !0 }, renderMenu: () => { var fe, _e, Me, te, K, se, B, re; return /* @__PURE__ */ u.jsxs(Fb, { children: [ /* @__PURE__ */ u.jsx(Bo, { onClickCapture: de, children: O("parameters.openInViewer") }), /* @__PURE__ */ u.jsx( Bo, { onClickCapture: H, isDisabled: ((_e = (fe = m == null ? void 0 : m.metadata) == null ? void 0 : fe.image) == null ? void 0 : _e.prompt) === void 0, children: O("parameters.usePrompt") } ), /* @__PURE__ */ u.jsx( Bo, { onClickCapture: q, isDisabled: ((te = (Me = m == null ? void 0 : m.metadata) == null ? void 0 : Me.image) == null ? void 0 : te.seed) === void 0, children: O("parameters.useSeed") } ), /* @__PURE__ */ u.jsx( Bo, { onClickCapture: ae, isDisabled: !["txt2img", "img2img"].includes((se = (K = m == null ? void 0 : m.metadata) == null ? void 0 : K.image) == null ? void 0 : se.type), children: O("parameters.useAll") } ), /* @__PURE__ */ u.jsx( Bo, { onClickCapture: oe, isDisabled: ((re = (B = m == null ? void 0 : m.metadata) == null ? void 0 : B.image) == null ? void 0 : re.type) !== "img2img", children: O("parameters.useInitImg") } ), /* @__PURE__ */ u.jsx(Bo, { onClickCapture: U, children: O("parameters.sendToImg2Img") }), /* @__PURE__ */ u.jsx(Bo, { onClickCapture: $, children: O("parameters.sendToUnifiedCanvas") }), /* @__PURE__ */ u.jsx(Bo, { "data-warning": !0, children: /* @__PURE__ */ u.jsx(lg, { image: m, children: /* @__PURE__ */ u.jsx("p", { children: O("parameters.deleteImage") }) }) }) ] }); }, children: (fe) => /* @__PURE__ */ u.jsxs( Ut, { position: "relative", onMouseOver: A, onMouseOut: L, userSelect: "none", draggable: !0, onDragStart: ve, ref: fe, sx: { padding: 2, display: "flex", justifyContent: "center", transition: "transform 0.2s ease-out", _hover: { cursor: "pointer", zIndex: 2 }, _before: { content: '""', display: "block", paddingBottom: "100%" } }, children: [ /* @__PURE__ */ u.jsx( lb, { objectFit: f ? "contain" : i, rounded: "md", src: S || g, loading: "lazy", sx: { position: "absolute", width: "100%", height: "100%", maxWidth: "100%", maxHeight: "100%", top: "50%", transform: "translate(-50%,-50%)", ...R === "rtl" ? { insetInlineEnd: "50%" } : { insetInlineStart: "50%" } } } ), /* @__PURE__ */ u.jsx( ne, { onClick: Y, sx: { position: "absolute", top: "0", insetInlineStart: "0", width: "100%", height: "100%", alignItems: "center", justifyContent: "center" }, children: y && /* @__PURE__ */ u.jsx( ia, { as: ob, sx: { width: "50%", height: "50%", fill: "ok.500" } } ) } ), D && s >= 64 && /* @__PURE__ */ u.jsx( Ut, { sx: { position: "absolute", top: 1, insetInlineEnd: 1 }, children: /* @__PURE__ */ u.jsx(lg, { image: m, children: /* @__PURE__ */ u.jsx( Be, { "aria-label": O("parameters.deleteImage"), icon: /* @__PURE__ */ u.jsx(Yz, {}), size: "xs", fontSize: 14, isDisabled: !c } ) }) } ) ] }, E ) } ); }, FY); Nk.displayName = "HoverableImage"; const LY = 290, Ok = () => { const e = xe(), { t } = Ce(), r = Xe(null), [i, s] = qe(!0), { images: c, currentCategory: f, currentImageUuid: m, shouldPinGallery: y, galleryImageMinimumWidth: g, galleryGridTemplateColumns: S, galleryImageObjectFit: E, shouldAutoSwitchToNewImages: w, areMoreImagesAvailable: D, shouldUseSingleGalleryColumn: M } = W($9), k = () => { e(eI(f)); }, R = (I) => { e($m(I)); }, O = () => { e(mD()), e(wa()); }; return ot(() => { if (!r.current) return; const I = new ResizeObserver(() => { if (r.current) { if (r.current.clientWidth < LY) { s(!0); return; } s(!1); } }); return I.observe(r.current), () => I.disconnect(); }, []), /* @__PURE__ */ u.jsxs(ne, { flexDirection: "column", w: "full", h: "full", gap: 4, children: [ /* @__PURE__ */ u.jsxs( ne, { ref: r, alignItems: "center", justifyContent: "space-between", children: [ /* @__PURE__ */ u.jsx( qr, { size: "sm", isAttached: !0, w: "max-content", justifyContent: "stretch", children: i ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx( Be, { "aria-label": t("gallery.showGenerations"), tooltip: t("gallery.showGenerations"), isChecked: f === "result", role: "radio", icon: /* @__PURE__ */ u.jsx(Xz, {}), onClick: () => e(ym("result")) } ), /* @__PURE__ */ u.jsx( Be, { "aria-label": t("gallery.showUploads"), tooltip: t("gallery.showUploads"), role: "radio", isChecked: f === "user", icon: /* @__PURE__ */ u.jsx($z, {}), onClick: () => e(ym("user")) } ) ] }) : /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx( an, { size: "sm", isChecked: f === "result", onClick: () => e(ym("result")), flexGrow: 1, children: t("gallery.generations") } ), /* @__PURE__ */ u.jsx( an, { size: "sm", isChecked: f === "user", onClick: () => e(ym("user")), flexGrow: 1, children: t("gallery.uploads") } ) ] }) } ), /* @__PURE__ */ u.jsxs(ne, { gap: 2, children: [ /* @__PURE__ */ u.jsx( Wo, { triggerComponent: /* @__PURE__ */ u.jsx( Be, { size: "sm", "aria-label": t("gallery.gallerySettings"), icon: /* @__PURE__ */ u.jsx(pb, {}) } ), children: /* @__PURE__ */ u.jsxs(ne, { direction: "column", gap: 2, children: [ /* @__PURE__ */ u.jsx( jn, { value: g, onChange: R, min: 32, max: 256, hideTooltip: !0, label: t("gallery.galleryImageSize"), withReset: !0, handleReset: () => e($m(64)) } ), /* @__PURE__ */ u.jsx( An, { label: t("gallery.maintainAspectRatio"), isChecked: E === "contain", onChange: () => e( Qz( E === "contain" ? "cover" : "contain" ) ) } ), /* @__PURE__ */ u.jsx( An, { label: t("gallery.autoSwitchNewImages"), isChecked: w, onChange: (I) => e(Zz(I.target.checked)) } ), /* @__PURE__ */ u.jsx( An, { label: t("gallery.singleColumnLayout"), isChecked: M, onChange: (I) => e(Jz(I.target.checked)) } ) ] }) } ), /* @__PURE__ */ u.jsx( Be, { size: "sm", "aria-label": t("gallery.pinGallery"), tooltip: `${t("gallery.pinGallery")} (Shift+G)`, onClick: O, icon: y ? /* @__PURE__ */ u.jsx(rk, {}) : /* @__PURE__ */ u.jsx(ak, {}) } ) ] }) ] } ), /* @__PURE__ */ u.jsx(nk, { children: /* @__PURE__ */ u.jsx(ne, { direction: "column", gap: 2, h: "full", children: c.length || D ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx( uo, { gap: 2, style: { gridTemplateColumns: S }, children: c.map((I) => { const { uuid: A } = I, L = m === A; return /* @__PURE__ */ u.jsx( Nk, { image: I, isSelected: L }, A ); }) } ), /* @__PURE__ */ u.jsx( an, { onClick: k, isDisabled: !D, flexShrink: 0, children: t(D ? "gallery.loadMore" : "gallery.allImagesLoaded") } ) ] }) : /* @__PURE__ */ u.jsxs( ne, { sx: { flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 2, padding: 8, h: "100%", w: "100%", color: "base.500" }, children: [ /* @__PURE__ */ u.jsx( ia, { as: l1, sx: { w: 16, h: 16 } } ), /* @__PURE__ */ u.jsx(ct, { textAlign: "center", children: t("gallery.noImagesInGallery") }) ] } ) }) }) ] }); }; Ok.displayName = "ImageGalleryContent"; const a2 = { txt2img: { galleryMinWidth: 200, galleryMaxWidth: 500 }, img2img: { galleryMinWidth: 200, galleryMaxWidth: 500 }, unifiedCanvas: { galleryMinWidth: 200, galleryMaxWidth: 200 }, nodes: { galleryMinWidth: 200, galleryMaxWidth: 500 }, postprocessing: { galleryMinWidth: 200, galleryMaxWidth: 500 }, training: { galleryMinWidth: 200, galleryMaxWidth: 500 } }, BY = Ze( [ Bn, $o, Fs, er, ch ], (e, t, r, i, s) => { const { shouldPinGallery: c, shouldShowGallery: f } = t, { galleryImageMinimumWidth: m } = r, { isLightboxOpen: y } = s; return { activeTabName: e, isStaging: i, shouldPinGallery: c, shouldShowGallery: f, galleryImageMinimumWidth: m, isResizable: e !== "unifiedCanvas", isLightboxOpen: y }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function UY() { const e = xe(), { shouldPinGallery: t, shouldShowGallery: r, galleryImageMinimumWidth: i, activeTabName: s, isStaging: c, isResizable: f, isLightboxOpen: m } = W(BY), y = () => { e(mD()), e(wa()); }, g = () => { e(tI()), t && e(wa()); }, S = () => { e(CS(!1)), t && e(wa()); }; We( "g", () => { g(); }, [t] ), We( "left", () => { e(F2()); }, { enabled: !c || s !== "unifiedCanvas" }, [c, s] ), We( "right", () => { e(L2()); }, { enabled: !c || s !== "unifiedCanvas" }, [c, s] ), We( "shift+g", () => { y(); }, [t] ), We( "esc", () => { e(CS(!1)); }, { enabled: () => !t, preventDefault: !0 }, [t] ); const E = 32; return We( "shift+up", () => { if (i < 256) { const w = Pe.clamp( i + E, 32, 256 ); e($m(w)); } }, [i] ), We( "shift+down", () => { if (i > 32) { const w = Pe.clamp( i - E, 32, 256 ); e($m(w)); } }, [i] ), /* @__PURE__ */ u.jsx( tk, { direction: "right", isResizable: f || !t, isOpen: r, onClose: S, isPinned: t && !m, minWidth: t ? a2[s].galleryMinWidth : 200, maxWidth: t ? a2[s].galleryMaxWidth : void 0, children: /* @__PURE__ */ u.jsx(Ok, {}) } ); } var Pi = function(e, t) { return Number(e.toFixed(t)); }, HY = function(e, t) { return typeof e == "number" ? e : t; }, qn = function(e, t, r) { r && typeof r == "function" && r(e, t); }, VY = function(e) { return -Math.cos(e * Math.PI) / 2 + 0.5; }, WY = function(e) { return e; }, GY = function(e) { return e * e; }, qY = function(e) { return e * (2 - e); }, YY = function(e) { return e < 0.5 ? 2 * e * e : -1 + (4 - 2 * e) * e; }, KY = function(e) { return e * e * e; }, XY = function(e) { return --e * e * e + 1; }, $Y = function(e) { return e < 0.5 ? 4 * e * e * e : (e - 1) * (2 * e - 2) * (2 * e - 2) + 1; }, QY = function(e) { return e * e * e * e; }, ZY = function(e) { return 1 - --e * e * e * e; }, JY = function(e) { return e < 0.5 ? 8 * e * e * e * e : 1 - 8 * --e * e * e * e; }, eK = function(e) { return e * e * e * e * e; }, tK = function(e) { return 1 + --e * e * e * e * e; }, nK = function(e) { return e < 0.5 ? 16 * e * e * e * e * e : 1 + 16 * --e * e * e * e * e; }, Ak = { easeOut: VY, linear: WY, easeInQuad: GY, easeOutQuad: qY, easeInOutQuad: YY, easeInCubic: KY, easeOutCubic: XY, easeInOutCubic: $Y, easeInQuart: QY, easeOutQuart: ZY, easeInOutQuart: JY, easeInQuint: eK, easeOutQuint: tK, easeInOutQuint: nK }, zk = function(e) { typeof e == "number" && cancelAnimationFrame(e); }, Vo = function(e) { e.mounted && (zk(e.animation), e.animate = !1, e.animation = null, e.velocity = null); }; function Ik(e, t, r, i) { if (e.mounted) { var s = new Date().getTime(), c = 1; Vo(e), e.animation = function() { if (!e.mounted) return zk(e.animation); var f = new Date().getTime() - s, m = f / r, y = Ak[t], g = y(m); f >= r ? (i(c), e.animation = null) : e.animation && (i(g), requestAnimationFrame(e.animation)); }, requestAnimationFrame(e.animation); } } function rK(e) { var t = e.scale, r = e.positionX, i = e.positionY; return !(Number.isNaN(t) || Number.isNaN(r) || Number.isNaN(i)); } function Vl(e, t, r, i) { var s = rK(t); if (!(!e.mounted || !s)) { var c = e.setTransformState, f = e.transformState, m = f.scale, y = f.positionX, g = f.positionY, S = t.scale - m, E = t.positionX - y, w = t.positionY - g; r === 0 ? c(t.scale, t.positionX, t.positionY) : Ik(e, i, r, function(D) { var M = m + S * D, k = y + E * D, R = g + w * D; c(M, k, R); }); } } function aK(e, t, r) { var i = e.offsetWidth, s = e.offsetHeight, c = t.offsetWidth, f = t.offsetHeight, m = c * r, y = f * r, g = i - m, S = s - y; return { wrapperWidth: i, wrapperHeight: s, newContentWidth: m, newDiffWidth: g, newContentHeight: y, newDiffHeight: S }; } var iK = function(e, t, r, i, s, c, f) { var m = e > t ? r * (f ? 1 : 0.5) : 0, y = i > s ? c * (f ? 1 : 0.5) : 0, g = e - t - m, S = m, E = i - s - y, w = y; return { minPositionX: g, maxPositionX: S, minPositionY: E, maxPositionY: w }; }, O1 = function(e, t) { var r = e.wrapperComponent, i = e.contentComponent, s = e.setup.centerZoomedOut; if (!r || !i) throw new Error("Components are not mounted"); var c = aK(r, i, t), f = c.wrapperWidth, m = c.wrapperHeight, y = c.newContentWidth, g = c.newDiffWidth, S = c.newContentHeight, E = c.newDiffHeight, w = iK(f, y, g, m, S, E, Boolean(s)); return w; }, rb = function(e, t, r, i) { return i ? e < t ? Pi(t, 2) : e > r ? Pi(r, 2) : Pi(e, 2) : Pi(e, 2); }, Ud = function(e, t) { var r = O1(e, t); return e.bounds = r, r; }; function Bg(e, t, r, i, s, c, f) { var m = r.minPositionX, y = r.minPositionY, g = r.maxPositionX, S = r.maxPositionY, E = 0, w = 0; f && (E = s, w = c); var D = rb(e, m - E, g + E, i), M = rb(t, y - w, S + w, i); return { x: D, y: M }; } function Ug(e, t, r, i, s, c) { var f = e.transformState, m = f.scale, y = f.positionX, g = f.positionY, S = i - m; if (typeof t != "number" || typeof r != "number") return console.error("Mouse X and Y position were not provided!"), { x: y, y: g }; var E = y - t * S, w = g - r * S, D = Bg(E, w, s, c, 0, 0, null); return D; } function dh(e, t, r, i, s) { var c = s ? i : 0, f = t - c; return !Number.isNaN(r) && e >= r ? r : !Number.isNaN(t) && e <= f ? f : e; } var i2 = function(e, t) { var r = e.setup.panning.excluded, i = e.isInitialized, s = e.wrapperComponent, c = t.target, f = s == null ? void 0 : s.contains(c), m = i && c && f; if (!m) return !1; var y = Hg(c, r); return !y; }, o2 = function(e) { var t = e.isInitialized, r = e.isPanning, i = e.setup, s = i.panning.disabled, c = t && r && !s; return !!c; }, oK = function(e, t) { var r = e.transformState, i = r.positionX, s = r.positionY; e.isPanning = !0; var c = t.clientX, f = t.clientY; e.startCoords = { x: c - i, y: f - s }; }, sK = function(e, t) { var r = t.touches, i = e.transformState, s = i.positionX, c = i.positionY; e.isPanning = !0; var f = r.length === 1; if (f) { var m = r[0].clientX, y = r[0].clientY; e.startCoords = { x: m - s, y: y - c }; } }; function lK(e) { var t = e.transformState, r = t.positionX, i = t.positionY, s = t.scale, c = e.setup, f = c.disabled, m = c.limitToBounds, y = c.centerZoomedOut, g = e.wrapperComponent; if (!(f || !g || !e.bounds)) { var S = e.bounds, E = S.maxPositionX, w = S.minPositionX, D = S.maxPositionY, M = S.minPositionY, k = r > E || r < w, R = i > D || i < M, O = r > E ? g.offsetWidth : e.setup.minPositionX || 0, I = i > D ? g.offsetHeight : e.setup.minPositionY || 0, A = Ug(e, O, I, s, e.bounds, m || y), L = A.x, H = A.y; return { scale: s, positionX: k ? L : r, positionY: R ? H : i }; } } function uK(e, t, r, i, s) { var c = e.setup.limitToBounds, f = e.wrapperComponent, m = e.bounds, y = e.transformState, g = y.scale, S = y.positionX, E = y.positionY; if (!(f === null || m === null || t === S && r === E)) { var w = Bg(t, r, m, c, i, s, f), D = w.x, M = w.y; e.setTransformState(g, D, M); } } var cK = function(e, t, r) { var i = e.startCoords, s = e.transformState, c = e.setup.panning, f = c.lockAxisX, m = c.lockAxisY, y = s.positionX, g = s.positionY; if (!i) return { x: y, y: g }; var S = t - i.x, E = r - i.y, w = f ? y : S, D = m ? g : E; return { x: w, y: D }; }, pg = function(e, t) { var r = e.setup, i = e.transformState, s = i.scale, c = r.minScale, f = r.disablePadding; return t > 0 && s >= c && !f ? t : 0; }, dK = function(e) { var t = e.mounted, r = e.setup, i = r.disabled, s = r.velocityAnimation, c = e.transformState.scale, f = s.disabled, m = !f || c > 1 || !i || t; return !!m; }, fK = function(e) { var t = e.mounted, r = e.velocity, i = e.bounds, s = e.setup, c = s.disabled, f = s.velocityAnimation, m = e.transformState.scale, y = f.disabled, g = !y || m > 1 || !c || t; return !(!g || !r || !i); }; function pK(e, t) { var r = e.setup.velocityAnimation, i = r.equalToMove, s = r.animationTime, c = r.sensitivity; return i ? s * t * c : s; } function s2(e, t, r, i, s, c, f, m, y, g) { if (s) { if (t > f && r > f) { var S = f + (e - f) * g; return S > y ? y : S < f ? f : S; } if (t < c && r < c) { var S = c + (e - c) * g; return S < m ? m : S > c ? c : S; } } return i ? t : rb(e, c, f, s); } function hK(e, t) { var r = 1; return t ? Math.min(r, e.offsetWidth / window.innerWidth) : r; } function vK(e, t) { var r = dK(e); if (r) { var i = e.lastMousePosition, s = e.velocityTime, c = e.setup, f = e.wrapperComponent, m = c.velocityAnimation.equalToMove, y = Date.now(); if (i && s && f) { var g = hK(f, m), S = t.x - i.x, E = t.y - i.y, w = S / g, D = E / g, M = y - s, k = S * S + E * E, R = Math.sqrt(k) / M; e.velocity = { velocityX: w, velocityY: D, total: R }; } e.lastMousePosition = t, e.velocityTime = y; } } function mK(e) { var t = e.velocity, r = e.bounds, i = e.setup, s = e.wrapperComponent, c = fK(e); if (!(!c || !t || !r || !s)) { var f = t.velocityX, m = t.velocityY, y = t.total, g = r.maxPositionX, S = r.minPositionX, E = r.maxPositionY, w = r.minPositionY, D = i.limitToBounds, M = i.alignmentAnimation, k = i.zoomAnimation, R = i.panning, O = R.lockAxisY, I = R.lockAxisX, A = k.animationType, L = M.sizeX, H = M.sizeY, q = M.velocityAlignmentTime, U = q, $ = pK(e, y), ae = Math.max($, U), oe = pg(e, L), Y = pg(e, H), ve = oe * s.offsetWidth / 100, de = Y * s.offsetHeight / 100, fe = g + ve, _e = S - ve, Me = E + de, te = w - de, K = e.transformState, se = new Date().getTime(); Ik(e, A, ae, function(B) { var re = e.transformState, ke = re.scale, De = re.positionX, Se = re.positionY, be = new Date().getTime() - se, Ie = be / U, Ue = Ak[M.animationType], tt = 1 - Ue(Math.min(1, Ie)), ht = 1 - B, dt = De + f * ht, Le = Se + m * ht, yt = s2(dt, K.positionX, De, I, D, S, g, _e, fe, tt), Ot = s2(Le, K.positionY, Se, O, D, w, E, te, Me, tt); (De !== dt || Se !== Le) && e.setTransformState(ke, yt, Ot); }); } } function l2(e, t) { var r = e.transformState.scale; Vo(e), Ud(e, r), window.TouchEvent !== void 0 && t instanceof TouchEvent ? sK(e, t) : oK(e, t); } function Fk(e) { var t = e.transformState.scale, r = e.setup, i = r.minScale, s = r.alignmentAnimation, c = s.disabled, f = s.sizeX, m = s.sizeY, y = s.animationTime, g = s.animationType, S = c || t < i || !f && !m; if (!S) { var E = lK(e); E && Vl(e, E, y, g); } } function u2(e, t, r) { var i = e.startCoords, s = e.setup, c = s.alignmentAnimation, f = c.sizeX, m = c.sizeY; if (i) { var y = cK(e, t, r), g = y.x, S = y.y, E = pg(e, f), w = pg(e, m); vK(e, { x: g, y: S }), uK(e, g, S, E, w); } } function gK(e) { if (e.isPanning) { var t = e.setup.panning.velocityDisabled, r = e.velocity, i = e.wrapperComponent, s = e.contentComponent; e.isPanning = !1, e.animate = !1, e.animation = null; var c = i == null ? void 0 : i.getBoundingClientRect(), f = s == null ? void 0 : s.getBoundingClientRect(), m = (c == null ? void 0 : c.width) || 0, y = (c == null ? void 0 : c.height) || 0, g = (f == null ? void 0 : f.width) || 0, S = (f == null ? void 0 : f.height) || 0, E = m < g || y < S, w = !t && r && (r == null ? void 0 : r.total) > 0.1 && E; w ? mK(e) : Fk(e); } } function A1(e, t, r, i) { var s = e.setup, c = s.minScale, f = s.maxScale, m = s.limitToBounds, y = dh(Pi(t, 2), c, f, 0, !1), g = Ud(e, y), S = Ug(e, r, i, y, g, m), E = S.x, w = S.y; return { scale: y, positionX: E, positionY: w }; } function Lk(e, t, r) { var i = e.transformState.scale, s = e.wrapperComponent, c = e.setup, f = c.minScale, m = c.limitToBounds, y = c.zoomAnimation, g = y.disabled, S = y.animationTime, E = y.animationType, w = g || i >= f; if ((i >= 1 || m) && Fk(e), !(w || !s || !e.mounted)) { var D = t || s.offsetWidth / 2, M = r || s.offsetHeight / 2, k = A1(e, f, D, M); k && Vl(e, k, S, E); } } var Nl = function() { return Nl = Object.assign || function(t) { for (var r, i = 1, s = arguments.length; i < s; i++) { r = arguments[i]; for (var c in r) Object.prototype.hasOwnProperty.call(r, c) && (t[c] = r[c]); } return t; }, Nl.apply(this, arguments); }; function c2(e, t, r) { if (r || arguments.length === 2) for (var i = 0, s = t.length, c; i < s; i++) (c || !(i in t)) && (c || (c = Array.prototype.slice.call(t, 0, i)), c[i] = t[i]); return e.concat(c || Array.prototype.slice.call(t)); } var Om = { previousScale: 1, scale: 1, positionX: 0, positionY: 0 }, kp = { disabled: !1, minPositionX: null, maxPositionX: null, minPositionY: null, maxPositionY: null, minScale: 1, maxScale: 8, limitToBounds: !0, centerZoomedOut: !1, centerOnInit: !1, disablePadding: !1, wheel: { step: 0.2, disabled: !1, wheelDisabled: !1, touchPadDisabled: !1, activationKeys: [], excluded: [] }, panning: { disabled: !1, velocityDisabled: !1, lockAxisX: !1, lockAxisY: !1, activationKeys: [], excluded: [] }, pinch: { step: 5, disabled: !1, excluded: [] }, doubleClick: { disabled: !1, step: 0.7, mode: "zoomIn", animationType: "easeOut", animationTime: 200, excluded: [] }, zoomAnimation: { disabled: !1, size: 0.4, animationTime: 200, animationType: "easeOut" }, alignmentAnimation: { disabled: !1, sizeX: 100, sizeY: 100, animationTime: 200, velocityAlignmentTime: 400, animationType: "easeOut" }, velocityAnimation: { disabled: !1, sensitivity: 1, animationTime: 400, animationType: "easeOut", equalToMove: !0 } }, Bk = function(e) { var t, r, i, s; return { previousScale: (t = e.initialScale) !== null && t !== void 0 ? t : Om.scale, scale: (r = e.initialScale) !== null && r !== void 0 ? r : Om.scale, positionX: (i = e.initialPositionX) !== null && i !== void 0 ? i : Om.positionX, positionY: (s = e.initialPositionY) !== null && s !== void 0 ? s : Om.positionY }; }, d2 = function(e) { var t = Nl({}, kp); return Object.keys(e).forEach(function(r) { var i = typeof e[r] < "u", s = typeof kp[r] < "u"; if (s && i) { var c = Object.prototype.toString.call(kp[r]), f = c === "[object Object]", m = c === "[object Array]"; f ? t[r] = Nl(Nl({}, kp[r]), e[r]) : m ? t[r] = c2(c2([], kp[r], !0), e[r], !0) : t[r] = e[r]; } }), t; }, Uk = function(e, t, r) { var i = e.transformState.scale, s = e.wrapperComponent, c = e.setup, f = c.maxScale, m = c.minScale, y = c.zoomAnimation, g = y.size; if (!s) throw new Error("Wrapper is not mounted"); var S = i * Math.exp(t * r), E = dh(Pi(S, 3), m, f, g, !1); return E; }; function Hk(e, t, r, i, s) { var c = e.wrapperComponent, f = e.transformState, m = f.scale, y = f.positionX, g = f.positionY; if (!c) return console.error("No WrapperComponent found"); var S = c.offsetWidth, E = c.offsetHeight, w = (S / 2 - y) / m, D = (E / 2 - g) / m, M = Uk(e, t, r), k = A1(e, M, w, D); if (!k) return console.error("Error during zoom event. New transformation state was not calculated."); Vl(e, k, i, s); } function Vk(e, t, r, i) { var s = e.setup, c = e.wrapperComponent, f = s.limitToBounds, m = Bk(e.props), y = e.transformState, g = y.scale, S = y.positionX, E = y.positionY; if (c) { var w = O1(e, m.scale), D = Bg(m.positionX, m.positionY, w, f, 0, 0, c), M = { scale: m.scale, positionX: D.x, positionY: D.y }; g === m.scale && S === m.positionX && E === m.positionY || (i == null || i(), Vl(e, M, t, r)); } } function yK(e, t, r, i) { var s = e.getBoundingClientRect(), c = t.getBoundingClientRect(), f = r.getBoundingClientRect(), m = c.x * i.scale, y = c.y * i.scale; return { x: (s.x - f.x + m) / i.scale, y: (s.y - f.y + y) / i.scale }; } function xK(e, t, r) { var i = e.wrapperComponent, s = e.contentComponent, c = e.transformState, f = e.setup, m = f.limitToBounds, y = f.minScale, g = f.maxScale; if (!i || !s) return c; var S = i.getBoundingClientRect(), E = t.getBoundingClientRect(), w = yK(t, i, s, c), D = w.x, M = w.y, k = E.width / c.scale, R = E.height / c.scale, O = i.offsetWidth / k, I = i.offsetHeight / R, A = dh(r || Math.min(O, I), y, g, 0, !1), L = (S.width - k * A) / 2, H = (S.height - R * A) / 2, q = (S.left - D) * A + L, U = (S.top - M) * A + H, $ = O1(e, A), ae = Bg(q, U, $, m, 0, 0, i), oe = ae.x, Y = ae.y; return { positionX: oe, positionY: Y, scale: A }; } var SK = function(e) { return function(t, r, i) { t === void 0 && (t = 0.5), r === void 0 && (r = 300), i === void 0 && (i = "easeOut"), Hk(e, 1, t, r, i); }; }, bK = function(e) { return function(t, r, i) { t === void 0 && (t = 0.5), r === void 0 && (r = 300), i === void 0 && (i = "easeOut"), Hk(e, -1, t, r, i); }; }, CK = function(e) { return function(t, r, i, s, c) { s === void 0 && (s = 300), c === void 0 && (c = "easeOut"); var f = e.transformState, m = f.positionX, y = f.positionY, g = f.scale, S = e.wrapperComponent, E = e.contentComponent, w = e.setup.disabled; if (!(w || !S || !E)) { var D = { positionX: Number.isNaN(t) ? m : t, positionY: Number.isNaN(r) ? y : r, scale: Number.isNaN(i) ? g : i }; Vl(e, D, s, c); } }; }, EK = function(e) { return function(t, r) { t === void 0 && (t = 200), r === void 0 && (r = "easeOut"), Vk(e, t, r); }; }, wK = function(e) { return function(t, r, i) { r === void 0 && (r = 200), i === void 0 && (i = "easeOut"); var s = e.transformState, c = e.wrapperComponent, f = e.contentComponent; if (c && f) { var m = Wk(t || s.scale, c, f); Vl(e, m, r, i); } }; }, jK = function(e) { return function(t, r, i, s) { i === void 0 && (i = 600), s === void 0 && (s = "easeOut"), Vo(e); var c = e.wrapperComponent, f = typeof t == "string" ? document.getElementById(t) : t; if (c && f && c.contains(f)) { var m = xK(e, f, r); Vl(e, m, i, s); } }; }, Mn = function(e) { return { instance: e, state: e.transformState, zoomIn: SK(e), zoomOut: bK(e), setTransform: CK(e), resetTransform: EK(e), centerView: wK(e), zoomToElement: jK(e) }; }, uS = !1; function cS() { try { var e = { get passive() { return uS = !0, !1; } }; return e; } catch { return uS = !1, uS; } } var Hg = function(e, t) { var r = e.tagName.toUpperCase(), i = t.find(function(c) { return c.toUpperCase() === r; }); if (i) return !0; var s = t.find(function(c) { return e.classList.contains(c); }); return !!s; }, ab = function(e) { e && clearTimeout(e); }, TK = function(e, t, r) { return "translate(".concat(e, "px, ").concat(t, "px) scale(").concat(r, ")"); }, Wk = function(e, t, r) { var i = r.offsetWidth * e, s = r.offsetHeight * e, c = (t.offsetWidth - i) / 2, f = (t.offsetHeight - s) / 2; return { scale: e, positionX: c, positionY: f }; }; function DK(e) { return function(t) { e.forEach(function(r) { typeof r == "function" ? r(t) : r != null && (r.current = t); }); }; } var _K = function(e, t) { var r = e.setup.wheel, i = r.disabled, s = r.wheelDisabled, c = r.touchPadDisabled, f = r.excluded, m = e.isInitialized, y = e.isPanning, g = t.target, S = m && !y && !i && g; if (!S || s && !t.ctrlKey || c && t.ctrlKey) return !1; var E = Hg(g, f); return !E; }, MK = function(e) { return e ? e.deltaY < 0 ? 1 : -1 : 0; }; function kK(e, t) { var r = MK(e), i = HY(t, r); return i; } function Gk(e, t, r) { var i = t.getBoundingClientRect(), s = 0, c = 0; if ("clientX" in e) s = (e.clientX - i.left) / r, c = (e.clientY - i.top) / r; else { var f = e.touches[0]; s = (f.clientX - i.left) / r, c = (f.clientY - i.top) / r; } return (Number.isNaN(s) || Number.isNaN(c)) && console.error("No mouse or touch offset found"), { x: s, y: c }; } var RK = function(e, t, r, i, s) { var c = e.transformState.scale, f = e.wrapperComponent, m = e.setup, y = m.maxScale, g = m.minScale, S = m.zoomAnimation, E = m.disablePadding, w = S.size, D = S.disabled; if (!f) throw new Error("Wrapper is not mounted"); var M = c + t * (c - c * r) * r; if (s) return M; var k = i ? !1 : !D, R = dh(Pi(M, 3), g, y, w, k && !E); return R; }, PK = function(e, t) { var r = e.previousWheelEvent, i = e.transformState.scale, s = e.setup, c = s.maxScale, f = s.minScale; return r ? i < c || i > f || Math.sign(r.deltaY) !== Math.sign(t.deltaY) || r.deltaY > 0 && r.deltaY < t.deltaY || r.deltaY < 0 && r.deltaY > t.deltaY || Math.sign(r.deltaY) !== Math.sign(t.deltaY) : !1; }, NK = function(e, t) { var r = e.setup.pinch, i = r.disabled, s = r.excluded, c = e.isInitialized, f = t.target, m = c && !i && f; if (!m) return !1; var y = Hg(f, s); return !y; }, OK = function(e) { var t = e.setup.pinch.disabled, r = e.isInitialized, i = e.pinchStartDistance, s = r && !t && i; return !!s; }, AK = function(e, t, r) { var i = r.getBoundingClientRect(), s = e.touches, c = Pi(s[0].clientX - i.left, 5), f = Pi(s[0].clientY - i.top, 5), m = Pi(s[1].clientX - i.left, 5), y = Pi(s[1].clientY - i.top, 5); return { x: (c + m) / 2 / t, y: (f + y) / 2 / t }; }, qk = function(e) { return Math.sqrt(Math.pow(e.touches[0].pageX - e.touches[1].pageX, 2) + Math.pow(e.touches[0].pageY - e.touches[1].pageY, 2)); }, zK = function(e, t) { var r = e.pinchStartScale, i = e.pinchStartDistance, s = e.setup, c = s.maxScale, f = s.minScale, m = s.zoomAnimation, y = s.disablePadding, g = m.size, S = m.disabled; if (!r || i === null || !t) throw new Error("Pinch touches distance was not provided"); if (t < 0) return e.transformState.scale; var E = t / i, w = E * r; return dh(Pi(w, 2), f, c, g, !S && !y); }, IK = 160, FK = 100, LK = function(e, t) { var r = e.props, i = r.onWheelStart, s = r.onZoomStart; e.wheelStopEventTimer || (Vo(e), qn(Mn(e), t, i), qn(Mn(e), t, s)); }, BK = function(e, t) { var r = e.props, i = r.onWheel, s = r.onZoom, c = e.contentComponent, f = e.setup, m = e.transformState, y = m.scale, g = f.limitToBounds, S = f.centerZoomedOut, E = f.zoomAnimation, w = f.wheel, D = f.disablePadding, M = E.size, k = E.disabled, R = w.step; if (!c) throw new Error("Component not mounted"); t.preventDefault(), t.stopPropagation(); var O = kK(t, null), I = RK(e, O, R, !t.ctrlKey); if (y !== I) { var A = Ud(e, I), L = Gk(t, c, y), H = k || M === 0 || S || D, q = g && H, U = Ug(e, L.x, L.y, I, A, q), $ = U.x, ae = U.y; e.previousWheelEvent = t, e.setTransformState(I, $, ae), qn(Mn(e), t, i), qn(Mn(e), t, s); } }, UK = function(e, t) { var r = e.props, i = r.onWheelStop, s = r.onZoomStop; ab(e.wheelAnimationTimer), e.wheelAnimationTimer = setTimeout(function() { e.mounted && (Lk(e, t.x, t.y), e.wheelAnimationTimer = null); }, FK); var c = PK(e, t); c && (ab(e.wheelStopEventTimer), e.wheelStopEventTimer = setTimeout(function() { e.mounted && (e.wheelStopEventTimer = null, qn(Mn(e), t, i), qn(Mn(e), t, s)); }, IK)); }, HK = function(e, t) { var r = qk(t); e.pinchStartDistance = r, e.lastDistance = r, e.pinchStartScale = e.transformState.scale, e.isPanning = !1, Vo(e); }, VK = function(e, t) { var r = e.contentComponent, i = e.pinchStartDistance, s = e.transformState.scale, c = e.setup, f = c.limitToBounds, m = c.centerZoomedOut, y = c.zoomAnimation, g = y.disabled, S = y.size; if (!(i === null || !r)) { var E = AK(t, s, r); if (!(!Number.isFinite(E.x) || !Number.isFinite(E.y))) { var w = qk(t), D = zK(e, w); if (D !== s) { var M = Ud(e, D), k = g || S === 0 || m, R = f && k, O = Ug(e, E.x, E.y, D, M, R), I = O.x, A = O.y; e.pinchMidpoint = E, e.lastDistance = w, e.setTransformState(D, I, A); } } } }, WK = function(e) { var t = e.pinchMidpoint; e.velocity = null, e.lastDistance = null, e.pinchMidpoint = null, e.pinchStartScale = null, e.pinchStartDistance = null, Lk(e, t == null ? void 0 : t.x, t == null ? void 0 : t.y); }, Yk = function(e, t) { var r = e.props.onZoomStop, i = e.setup.doubleClick.animationTime; ab(e.doubleClickStopEventTimer), e.doubleClickStopEventTimer = setTimeout(function() { e.doubleClickStopEventTimer = null, qn(Mn(e), t, r); }, i); }, GK = function(e, t) { var r = e.props, i = r.onZoomStart, s = r.onZoom, c = e.setup.doubleClick, f = c.animationTime, m = c.animationType; qn(Mn(e), t, i), Vk(e, f, m, function() { return qn(Mn(e), t, s); }), Yk(e, t); }; function qK(e, t) { var r = e.setup, i = e.doubleClickStopEventTimer, s = e.transformState, c = e.contentComponent, f = s.scale, m = e.props, y = m.onZoomStart, g = m.onZoom, S = r.doubleClick, E = S.disabled, w = S.mode, D = S.step, M = S.animationTime, k = S.animationType; if (!E && !i) { if (w === "reset") return GK(e, t); if (!c) return console.error("No ContentComponent found"); var R = w === "zoomOut" ? -1 : 1, O = Uk(e, R, D); if (f !== O) { qn(Mn(e), t, y); var I = Gk(t, c, f), A = A1(e, O, I.x, I.y); if (!A) return console.error("Error during zoom event. New transformation state was not calculated."); qn(Mn(e), t, g), Vl(e, A, M, k), Yk(e, t); } } } var YK = function(e, t) { var r = e.isInitialized, i = e.setup, s = e.wrapperComponent, c = i.doubleClick, f = c.disabled, m = c.excluded, y = t.target, g = s == null ? void 0 : s.contains(y), S = r && y && g && !f; if (!S) return !1; var E = Hg(y, m); return !E; }, KK = ( /** @class */ function() { function e(t) { var r = this; this.mounted = !0, this.onChangeCallbacks = /* @__PURE__ */ new Set(), this.wrapperComponent = null, this.contentComponent = null, this.isInitialized = !1, this.bounds = null, this.previousWheelEvent = null, this.wheelStopEventTimer = null, this.wheelAnimationTimer = null, this.isPanning = !1, this.startCoords = null, this.lastTouch = null, this.distance = null, this.lastDistance = null, this.pinchStartDistance = null, this.pinchStartScale = null, this.pinchMidpoint = null, this.doubleClickStopEventTimer = null, this.velocity = null, this.velocityTime = null, this.lastMousePosition = null, this.animate = !1, this.animation = null, this.maxBounds = null, this.pressedKeys = {}, this.mount = function() { r.initializeWindowEvents(); }, this.unmount = function() { r.cleanupWindowEvents(); }, this.update = function(i) { Ud(r, r.transformState.scale), r.setup = d2(i); }, this.initializeWindowEvents = function() { var i, s = cS(), c = (i = r.wrapperComponent) === null || i === void 0 ? void 0 : i.ownerDocument, f = c == null ? void 0 : c.defaultView; f == null || f.addEventListener("mousedown", r.onPanningStart, s), f == null || f.addEventListener("mousemove", r.onPanning, s), f == null || f.addEventListener("mouseup", r.onPanningStop, s), c == null || c.addEventListener("mouseleave", r.clearPanning, s), f == null || f.addEventListener("keyup", r.setKeyUnPressed, s), f == null || f.addEventListener("keydown", r.setKeyPressed, s); }, this.cleanupWindowEvents = function() { var i, s, c = cS(), f = (i = r.wrapperComponent) === null || i === void 0 ? void 0 : i.ownerDocument, m = f == null ? void 0 : f.defaultView; m == null || m.removeEventListener("mousedown", r.onPanningStart, c), m == null || m.removeEventListener("mousemove", r.onPanning, c), m == null || m.removeEventListener("mouseup", r.onPanningStop, c), f == null || f.removeEventListener("mouseleave", r.clearPanning, c), m == null || m.removeEventListener("keyup", r.setKeyUnPressed, c), m == null || m.removeEventListener("keydown", r.setKeyPressed, c), document.removeEventListener("mouseleave", r.clearPanning, c), Vo(r), (s = r.observer) === null || s === void 0 || s.disconnect(); }, this.handleInitializeWrapperEvents = function(i) { var s = cS(); i.addEventListener("wheel", r.onWheelZoom, s), i.addEventListener("dblclick", r.onDoubleClick, s), i.addEventListener("touchstart", r.onTouchPanningStart, s), i.addEventListener("touchmove", r.onTouchPanning, s), i.addEventListener("touchend", r.onTouchPanningStop, s); }, this.handleInitialize = function(i) { var s = r.setup.centerOnInit; r.applyTransformation(), s && (r.setCenter(), r.observer = new ResizeObserver(function() { var c; r.setCenter(), (c = r.observer) === null || c === void 0 || c.disconnect(); }), r.observer.observe(i)); }, this.onWheelZoom = function(i) { var s = r.setup.disabled; if (!s) { var c = _K(r, i); if (c) { var f = r.isPressingKeys(r.setup.wheel.activationKeys); f && (LK(r, i), BK(r, i), UK(r, i)); } } }, this.onPanningStart = function(i) { var s = r.setup.disabled, c = r.props.onPanningStart; if (!s) { var f = i2(r, i); if (f) { var m = r.isPressingKeys(r.setup.panning.activationKeys); m && (i.preventDefault(), i.stopPropagation(), Vo(r), l2(r, i), qn(Mn(r), i, c)); } } }, this.onPanning = function(i) { var s = r.setup.disabled, c = r.props.onPanning; if (!s) { var f = o2(r); if (f) { var m = r.isPressingKeys(r.setup.panning.activationKeys); m && (i.preventDefault(), i.stopPropagation(), u2(r, i.clientX, i.clientY), qn(Mn(r), i, c)); } } }, this.onPanningStop = function(i) { var s = r.props.onPanningStop; r.isPanning && (gK(r), qn(Mn(r), i, s)); }, this.onPinchStart = function(i) { var s = r.setup.disabled, c = r.props, f = c.onPinchingStart, m = c.onZoomStart; if (!s) { var y = NK(r, i); y && (HK(r, i), Vo(r), qn(Mn(r), i, f), qn(Mn(r), i, m)); } }, this.onPinch = function(i) { var s = r.setup.disabled, c = r.props, f = c.onPinching, m = c.onZoom; if (!s) { var y = OK(r); y && (i.preventDefault(), i.stopPropagation(), VK(r, i), qn(Mn(r), i, f), qn(Mn(r), i, m)); } }, this.onPinchStop = function(i) { var s = r.props, c = s.onPinchingStop, f = s.onZoomStop; r.pinchStartScale && (WK(r), qn(Mn(r), i, c), qn(Mn(r), i, f)); }, this.onTouchPanningStart = function(i) { var s = r.setup.disabled, c = r.props.onPanningStart; if (!s) { var f = i2(r, i); if (f) { var m = r.lastTouch && +new Date() - r.lastTouch < 200; if (m && i.touches.length === 1) r.onDoubleClick(i); else { r.lastTouch = +new Date(), Vo(r); var y = i.touches, g = y.length === 1, S = y.length === 2; g && (Vo(r), l2(r, i), qn(Mn(r), i, c)), S && r.onPinchStart(i); } } } }, this.onTouchPanning = function(i) { var s = r.setup.disabled, c = r.props.onPanning; if (r.isPanning && i.touches.length === 1) { if (s) return; var f = o2(r); if (!f) return; i.preventDefault(), i.stopPropagation(); var m = i.touches[0]; u2(r, m.clientX, m.clientY), qn(Mn(r), i, c); } else i.touches.length > 1 && r.onPinch(i); }, this.onTouchPanningStop = function(i) { r.onPanningStop(i), r.onPinchStop(i); }, this.onDoubleClick = function(i) { var s = r.setup.disabled; if (!s) { var c = YK(r, i); c && qK(r, i); } }, this.clearPanning = function(i) { r.isPanning && r.onPanningStop(i); }, this.setKeyPressed = function(i) { r.pressedKeys[i.key] = !0; }, this.setKeyUnPressed = function(i) { r.pressedKeys[i.key] = !1; }, this.isPressingKeys = function(i) { return i.length ? Boolean(i.find(function(s) { return r.pressedKeys[s]; })) : !0; }, this.setTransformState = function(i, s, c) { var f = r.props.onTransformed; if (!Number.isNaN(i) && !Number.isNaN(s) && !Number.isNaN(c)) { i !== r.transformState.scale && (r.transformState.previousScale = r.transformState.scale, r.transformState.scale = i), r.transformState.positionX = s, r.transformState.positionY = c; var m = Mn(r); r.onChangeCallbacks.forEach(function(y) { return y(m); }), qn(m, { scale: i, positionX: s, positionY: c }, f), r.applyTransformation(); } else console.error("Detected NaN set state values"); }, this.setCenter = function() { if (r.wrapperComponent && r.contentComponent) { var i = Wk(r.transformState.scale, r.wrapperComponent, r.contentComponent); r.setTransformState(i.scale, i.positionX, i.positionY); } }, this.handleTransformStyles = function(i, s, c) { return r.props.customTransform ? r.props.customTransform(i, s, c) : TK(i, s, c); }, this.applyTransformation = function() { if (!(!r.mounted || !r.contentComponent)) { var i = r.transformState, s = i.scale, c = i.positionX, f = i.positionY, m = r.handleTransformStyles(c, f, s); r.contentComponent.style.transform = m; } }, this.getContext = function() { return Mn(r); }, this.onChange = function(i) { return r.onChangeCallbacks.has(i) || r.onChangeCallbacks.add(i), function() { r.onChangeCallbacks.delete(i); }; }, this.init = function(i, s) { r.cleanupWindowEvents(), r.wrapperComponent = i, r.contentComponent = s, Ud(r, r.transformState.scale), r.handleInitializeWrapperEvents(i), r.handleInitialize(s), r.initializeWindowEvents(), r.isInitialized = !0, qn(Mn(r), void 0, r.props.onInit); }, this.props = t, this.setup = d2(this.props), this.transformState = Bk(this.props); } return e; }() ), Vg = jt.createContext(null), XK = function(e, t) { return typeof e == "function" ? e(t) : e; }, $K = jt.forwardRef(function(e, t) { var r = qe(0), i = r[1], s = e.children, c = Xe(new KK(e)).current, f = XK(e.children, Mn(c)), m = ee(function() { typeof s == "function" && i(function(y) { return y + 1; }); }, [s]); return hb(t, function() { return Mn(c); }, [c]), ot(function() { c.update(e); }, [c, e]), ot(function() { return c.onChange(m); }, [c, e, m]), jt.createElement(Vg.Provider, { value: c }, f); }); function QK(e, t) { t === void 0 && (t = {}); var r = t.insertAt; if (!(!e || typeof document > "u")) { var i = document.head || document.getElementsByTagName("head")[0], s = document.createElement("style"); s.type = "text/css", r === "top" && i.firstChild ? i.insertBefore(s, i.firstChild) : i.appendChild(s), s.styleSheet ? s.styleSheet.cssText = e : s.appendChild(document.createTextNode(e)); } } var ZK = `.transform-component-module_wrapper__7HFJe { position: relative; width: -moz-fit-content; width: fit-content; height: -moz-fit-content; height: fit-content; overflow: hidden; -webkit-touch-callout: none; /* iOS Safari */ -webkit-user-select: none; /* Safari */ -khtml-user-select: none; /* Konqueror HTML */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* Internet Explorer/Edge */ user-select: none; margin: 0; padding: 0; } .transform-component-module_content__uCDPE { display: flex; flex-wrap: wrap; width: -moz-fit-content; width: fit-content; height: -moz-fit-content; height: fit-content; margin: 0; padding: 0; transform-origin: 0% 0%; } .transform-component-module_content__uCDPE img { pointer-events: none; } `, f2 = { wrapper: "transform-component-module_wrapper__7HFJe", content: "transform-component-module_content__uCDPE" }; QK(ZK); var JK = function(e) { var t = e.children, r = e.wrapperClass, i = r === void 0 ? "" : r, s = e.contentClass, c = s === void 0 ? "" : s, f = e.wrapperStyle, m = e.contentStyle, y = e.wrapperProps, g = y === void 0 ? {} : y, S = e.contentProps, E = S === void 0 ? {} : S, w = Bl(Vg).init, D = Xe(null), M = Xe(null); return ot(function() { var k = D.current, R = M.current; k !== null && R !== null && w && w(k, R); }, []), jt.createElement( "div", Nl({}, g, { ref: D, className: "react-transform-wrapper ".concat(f2.wrapper, " ").concat(i), style: f }), jt.createElement("div", Nl({}, E, { ref: M, className: "react-transform-component ".concat(f2.content, " ").concat(c), style: m }), t) ); }, Kk = function() { var e = Bl(Vg), t = qe(Mn(e || {})), r = t[0], i = t[1]; if (!e) throw new Error("Transform context mus be placed inside TransformWrapper"); return ot(function() { e.onChange(function(s) { i(s); }); }, [e]), r; }; jt.forwardRef(function(e, t) { var r = Xe(null), i = Bl(Vg); return ot(function() { return i.onChange(function(s) { if (r.current) { var c = 0, f = 0; r.current.style.transform = i.handleTransformStyles(c, f, 1 / s.state.scale); } }); }, [i]), jt.createElement("div", Nl({}, e, { ref: DK([r, t]) })); }); const eX = () => { const [e, t] = qe(0), [r, i] = qe(1), [s, c] = qe(1); return { rotation: e, scaleX: r, scaleY: s, flipHorizontally: () => { i(r * -1); }, flipVertically: () => { c(s * -1); }, rotateCounterClockwise: () => { t(e === -270 ? 0 : e - 90); }, rotateClockwise: () => { t(e === 270 ? 0 : e + 90); }, reset: () => { t(0), i(1), c(1); } }; }, tX = ({ flipHorizontally: e, flipVertically: t, rotateCounterClockwise: r, rotateClockwise: i, reset: s }) => { const { zoomIn: c, zoomOut: f, resetTransform: m } = Kk(), { t: y } = Ce(); return /* @__PURE__ */ u.jsxs(qr, { isAttached: !0, orientation: "vertical", children: [ /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(p9, {}), "aria-label": y("accessibility.zoomIn"), tooltip: "Zoom In", onClick: () => c(), fontSize: 20 } ), /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(h9, {}), "aria-label": y("accessibility.zoomOut"), tooltip: "Zoom Out", onClick: () => f(), fontSize: 20 } ), /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(d9, {}), "aria-label": y("accessibility.rotateCounterClockwise"), tooltip: "Rotate Counter-Clockwise", onClick: r, fontSize: 20 } ), /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(f9, {}), "aria-label": y("accessibility.rotateClockwise"), tooltip: "Rotate Clockwise", onClick: i, fontSize: 20 } ), /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(MT, {}), "aria-label": y("accessibility.flipHorizontally"), tooltip: "Flip Horizontally", onClick: e, fontSize: 20 } ), /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(MT, { style: { transform: "rotate(90deg)" } }), "aria-label": y("accessibility.flipVertically"), tooltip: "Flip Vertically", onClick: t, fontSize: 20 } ), /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(s1, {}), "aria-label": y("accessibility.reset"), tooltip: "Reset", onClick: () => { m(), s(); }, fontSize: 20 } ) ] }); }; function nX({ image: e, alt: t, ref: r, styleClass: i, rotation: s, scaleX: c, scaleY: f }) { const { centerView: m } = Kk(); return /* @__PURE__ */ u.jsx( JK, { wrapperStyle: { width: "100%", height: "100%" }, children: /* @__PURE__ */ u.jsx( "img", { style: { transform: `rotate(${s}deg) scaleX(${c}) scaleY(${f})`, width: "100%" }, src: e.url, alt: t, ref: r, className: i || "", onLoad: () => m(1, 0, "easeOut") } ) } ); } const rX = Ze( [Fs, $o], (e, t) => { const { currentImage: r } = e, { shouldShowImageDetails: i } = t; return { viewerImageToDisplay: r, shouldShowImageDetails: i }; }, { memoizeOptions: { resultEqualityCheck: Pe.isEqual } } ); function aX() { const e = xe(), t = W( (w) => w.lightbox.isLightboxOpen ), { rotation: r, scaleX: i, scaleY: s, flipHorizontally: c, flipVertically: f, rotateCounterClockwise: m, rotateClockwise: y, reset: g } = eX(), { viewerImageToDisplay: S, shouldShowImageDetails: E } = W(rX); return We( "Esc", () => { t && e(zu(!1)); }, [t] ), /* @__PURE__ */ u.jsx(Wu, { children: t && /* @__PURE__ */ u.jsx( zs.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.15, ease: "easeInOut" }, style: { display: "flex", width: "100vw", height: `calc(100vh - ${og * 4}px)`, position: "fixed", top: `${og * 4}px`, background: "var(--invokeai-colors-base-900)", zIndex: 99 }, children: /* @__PURE__ */ u.jsxs( $K, { centerOnInit: !0, minScale: 0.1, initialPositionX: 50, initialPositionY: 50, children: [ /* @__PURE__ */ u.jsxs( ne, { sx: { flexDir: "column", position: "absolute", insetInlineStart: 4, gap: 4, zIndex: 3, top: 4 }, children: [ /* @__PURE__ */ u.jsx( Be, { icon: /* @__PURE__ */ u.jsx(c9, {}), "aria-label": "Exit Viewer", className: "lightbox-close-btn", onClick: () => { e(zu(!1)); }, fontSize: 20 } ), /* @__PURE__ */ u.jsx( tX, { flipHorizontally: c, flipVertically: f, rotateCounterClockwise: m, rotateClockwise: y, reset: g } ) ] } ), /* @__PURE__ */ u.jsx( ne, { sx: { position: "absolute", top: 4, zIndex: 3, insetInlineStart: "50%", transform: "translate(-50%, 0)" }, children: /* @__PURE__ */ u.jsx(ik, {}) } ), S && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [ /* @__PURE__ */ u.jsx( nX, { rotation: r, scaleX: i, scaleY: s, image: S, styleClass: "lightbox-image" } ), E && /* @__PURE__ */ u.jsx(v1, { image: S }), !E && /* @__PURE__ */ u.jsx( Ut, { sx: { position: "absolute", top: 0, insetInlineStart: 0, w: "100vw", h: "100vh", px: 16, pointerEvents: "none" }, children: /* @__PURE__ */ u.jsx(ok, {}) } ) ] }) ] } ) }, "lightbox" ) }); } RY(); const pX = (e) => { PY(); const t = W((i) => i.ui.currentTheme), { setColorMode: r } = nI(); return ot(() => { r(["light"].includes(t) ? "light" : "dark"); }, [r, t]), /* @__PURE__ */ u.jsxs(uo, { w: "100vw", h: "100vh", children: [ /* @__PURE__ */ u.jsx(aX, {}), /* @__PURE__ */ u.jsxs(BB, { children: [ /* @__PURE__ */ u.jsx(o6, {}), /* @__PURE__ */ u.jsxs( uo, { gap: 4, p: 4, gridAutoRows: "min-content auto", w: t6, h: n6, children: [ e.children ? e.children : /* @__PURE__ */ u.jsx(ek, {}), /* @__PURE__ */ u.jsxs(ne, { gap: 4, w: "full", h: "full", children: [ /* @__PURE__ */ u.jsx(kY, {}), /* @__PURE__ */ u.jsx(UY, {}) ] }) ] } ), /* @__PURE__ */ u.jsx(Ut, { children: /* @__PURE__ */ u.jsx(JB, {}) }) ] }), /* @__PURE__ */ u.jsx(Wm, { children: /* @__PURE__ */ u.jsx(zY, {}) }), /* @__PURE__ */ u.jsx(Wm, { children: /* @__PURE__ */ u.jsx(OY, {}) }) ] }); }; export { pX as default };