izen-react-starter 2.4.4 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{2SSKDMRQ-BfrPj7GW.js → 2SSKDMRQ-CieOSajO.js} +2 -2
- package/dist/{AP7HFJJL-Dbo7Qrph.js → AP7HFJJL-BwpUKqx5.js} +1 -1
- package/dist/{WDYDFRGG-B5l8n4Qr.js → WDYDFRGG-DRuFArSB.js} +2 -2
- package/dist/{index-CTvfNUss.js → index-CZ5vgM0K.js} +4 -4
- package/dist/react-starter.js +1 -1
- package/dist/react-starter.umd.cjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./AP7HFJJL-
|
|
2
|
-
import { g as h, c as v, a as e } from "./index-
|
|
1
|
+
import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./AP7HFJJL-BwpUKqx5.js";
|
|
2
|
+
import { g as h, c as v, a as e } from "./index-CZ5vgM0K.js";
|
|
3
3
|
var C = (r) => {
|
|
4
4
|
const [t, o] = s({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var xs = Object.defineProperty;
|
|
2
2
|
var $s = (e, t, n) => t in e ? xs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Re = (e, t, n) => $s(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { b as $e, d as B, o as ft, e as H, c as P, a as m, P as No, m as ve, S as K, t as _, i as k, f as U, h as F, j as Cs, k as ur, u as Ce, l as V, s as Qn, n as Yn, p as gt, q as T, r as Ss, v as Ut, w as _t, x as qe, y as ks, z as Rt, A as Bt, B as Es, C as Ds, D as En, F as As, E as Ht, $ as Ho, G as Ms, H as Ts, I as W, J as Vr, K as Fs, L as Is, M as cr, N as Os, O as Ls, Q as Hn, R as Ps, T as qs, U as ie, V as _s, W as Rs } from "./index-
|
|
4
|
+
import { b as $e, d as B, o as ft, e as H, c as P, a as m, P as No, m as ve, S as K, t as _, i as k, f as U, h as F, j as Cs, k as ur, u as Ce, l as V, s as Qn, n as Yn, p as gt, q as T, r as Ss, v as Ut, w as _t, x as qe, y as ks, z as Rt, A as Bt, B as Es, C as Ds, D as En, F as As, E as Ht, $ as Ho, G as Ms, H as Ts, I as W, J as Vr, K as Fs, L as Is, M as cr, N as Os, O as Ls, Q as Hn, R as Ps, T as qs, U as ie, V as _s, W as Rs } from "./index-CZ5vgM0K.js";
|
|
5
5
|
var zs = (e) => e != null, Ks = (e) => e.filter(zs);
|
|
6
6
|
function Bs(e) {
|
|
7
7
|
return (...t) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c, T as l, P as m, a as u, D as v, Q as i } from "./AP7HFJJL-
|
|
2
|
-
import { g as d, c as f, a as e } from "./index-
|
|
1
|
+
import { c, T as l, P as m, a as u, D as v, Q as i } from "./AP7HFJJL-BwpUKqx5.js";
|
|
2
|
+
import { g as d, c as f, a as e } from "./index-CZ5vgM0K.js";
|
|
3
3
|
var h = (t) => {
|
|
4
4
|
const [r, o] = c({
|
|
5
5
|
prefix: "TanstackQueryDevtools"
|
|
@@ -9165,7 +9165,7 @@ var e4e = (e, t = !1) => {
|
|
|
9165
9165
|
const t = P$(() => {
|
|
9166
9166
|
const n = this, [r] = I(this, Ec), [o] = I(this, _c), [i] = I(this, Oc), [a] = I(this, Pc), [s] = I(this, Lf), [l] = I(this, Sc), [c] = I(this, kc);
|
|
9167
9167
|
let u;
|
|
9168
|
-
return I(this, Nc) ? u = I(this, Nc) : (u = _$(() => import("./WDYDFRGG-
|
|
9168
|
+
return I(this, Nc) ? u = I(this, Nc) : (u = _$(() => import("./WDYDFRGG-DRuFArSB.js")), fe(this, Nc, u)), q$(I(this, jf), I(this, Cc)), C$(u, E$({
|
|
9169
9169
|
get queryFlavor() {
|
|
9170
9170
|
return I(n, $f);
|
|
9171
9171
|
},
|
|
@@ -9272,7 +9272,7 @@ var e4e = (e, t = !1) => {
|
|
|
9272
9272
|
const t = P$(() => {
|
|
9273
9273
|
const n = this, [r] = I(this, Rc), [o] = I(this, Mc), [i] = I(this, Dc), [a] = I(this, Ic), [s] = I(this, Hf), [l] = I(this, Ac), [c] = I(this, $c), [u] = I(this, jc);
|
|
9274
9274
|
let d;
|
|
9275
|
-
return I(this, Fc) ? d = I(this, Fc) : (d = _$(() => import("./2SSKDMRQ-
|
|
9275
|
+
return I(this, Fc) ? d = I(this, Fc) : (d = _$(() => import("./2SSKDMRQ-CieOSajO.js")), fe(this, Fc, d)), q$(I(this, Wf), I(this, Tc)), C$(d, E$({
|
|
9276
9276
|
get queryFlavor() {
|
|
9277
9277
|
return I(n, Bf);
|
|
9278
9278
|
},
|
|
@@ -60264,7 +60264,7 @@ const yVe = ({ placeholder: e, className: t }) => {
|
|
|
60264
60264
|
return /* @__PURE__ */ v(
|
|
60265
60265
|
"div",
|
|
60266
60266
|
{
|
|
60267
|
-
className: "space-y-3",
|
|
60267
|
+
className: "space-y-3 text-white",
|
|
60268
60268
|
onClickCapture: () => {
|
|
60269
60269
|
t && t(!1);
|
|
60270
60270
|
},
|
|
@@ -60291,7 +60291,7 @@ const yVe = ({ placeholder: e, className: t }) => {
|
|
|
60291
60291
|
logoText: t = "Logo",
|
|
60292
60292
|
logoHref: n = "/",
|
|
60293
60293
|
className: r
|
|
60294
|
-
}) => /* @__PURE__ */ T("aside", { className: j("hidden h-screen w-64 flex-col overflow-y-auto overflow-x-hidden rounded-tr-[90px] border-r bg-primary py-8 pl-5 dark:bg-background lg:flex", r), children: [
|
|
60294
|
+
}) => /* @__PURE__ */ T("aside", { className: j("hidden h-screen w-64 flex-col overflow-y-auto overflow-x-hidden rounded-tr-[90px] border-r bg-primary py-8 pl-5 dark:bg-background lg:flex pr-2", r), children: [
|
|
60295
60295
|
/* @__PURE__ */ v(ou, { to: n, className: "text-3xl font-bold text-white", children: t }),
|
|
60296
60296
|
/* @__PURE__ */ v("div", { className: "mt-6 flex flex-1 flex-col justify-between", children: /* @__PURE__ */ v(Mq, { items: e }) })
|
|
60297
60297
|
] }), SVe = ({
|
package/dist/react-starter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aZ as t, bj as o, bm as r, bk as n, bl as i, fb as d, a4 as l, a5 as u, bn as c, bp as b, bq as p, bz as g, bA as S, bu as C, by as m, bw as T, bv as D, bs as M, br as A, bx as h, bt as v, fr as f, bo as I, ba as P, a0 as F, bB as w, b2 as x, bC as B, bE as R, bD as G, bF as L, bH as k, bN as y, bJ as H, bK as N, bI as O, bL as U, bM as E, X as V, bP as z, Y as W, bU as q, bT as j, bR as X, bQ as Y, bS as Z, bV as _, bW as J, bX as K, bZ as Q, bY as $, f8 as aa, b_ as ea, c1 as sa, c2 as ta, c3 as oa, b$ as ra, c0 as na, c4 as ia, c5 as da, c7 as la, c6 as ua, c8 as ca, c9 as ba, cc as pa, cd as ga, ca as Sa, ce as Ca, cb as ma, cg as Ta, cf as Da, aW as Ma, ch as Aa, cl as ha, cj as va, cq as fa, ck as Ia, cn as Pa, cr as Fa, cv as wa, cm as xa, co as Ba, cp as Ra, cs as Ga, ct as La, cu as ka, ci as ya, fq as Ha, _ as Na, fe as Oa, fg as Ua, a9 as Ea, aa as Va, fu as za, fv as Wa, fs as qa, cw as ja, cA as Xa, cB as Ya, cF as Za, cD as _a, cC as Ja, cy as Ka, cx as Qa, cE as $a, cz as ae, cG as ee, cK as se, cL as te, cP as oe, cN as re, cM as ne, cI as ie, cH as de, cO as le, cJ as ue, cQ as ce, cU as be, cS as pe, cZ as ge, cT as Se, cW as Ce, c_ as me, d2 as Te, cV as De, cX as Me, cY as Ae, c$ as he, d0 as ve, d1 as fe, cR as Ie, a3 as Pe, ah as Fe, d4 as we, d7 as xe, d8 as Be, da as Re, d5 as Ge, d6 as Le, a2 as ke, d9 as ye, fj as He, fA as Ne, fx as Oe, db as Ue, dd as Ee, dc as Ve, de as ze, ab as We, ac as qe, ad as je, ae as Xe, df as Ye, a6 as Ze, dg as _e, dh as Je, dj as Ke, di as Qe, dk as $e, ai as as, dl as es, dt as ss, dp as ts, dz as os, dq as rs, ds as ns, dm as is, dw as ds, du as ls, dv as us, dr as cs, dB as bs, dA as ps, dx as gs, dy as Ss, dn as Cs, a1 as ms, dC as Ts, b4 as Ds, fp as Ms, fm as As, fn as hs, fo as vs, dE as fs, dH as Is, dK as Ps, dG as Fs, dJ as ws, dF as xs, dI as Bs, dL as Rs, fk as Gs, b6 as Ls, fy as ks, f9 as ys, fh as Hs, dM as Ns, dP as Os, dO as Us, dN as Es, ft as Vs, dQ as zs, dS as Ws, dR as qs, dT as js, b0 as Xs, dU as Ys, dV as Zs, bc as _s, dY as Js, dX as Ks, dW as Qs, af as $s, dZ as at, d_ as et, d$ as st, e3 as tt, a8 as ot, e0 as rt, a7 as nt, e5 as it, e4 as dt, e8 as lt, e7 as ut, e6 as ct, e2 as bt, e1 as pt, e9 as gt, fi as St, ea as Ct, ee as mt, ef as Tt, ej as Dt, eh as Mt, eg as At, ec as ht, eb as vt, ei as ft, ed as It, ek as Pt, el as Ft, em as wt, en as xt, eo as Bt, ep as Rt, eq as Gt, er as Lt, es as kt, et as yt, eu as Ht, ev as Nt, ew as Ot, ex as Ut, ey as Et, ez as Vt, eA as zt, eB as Wt, eC as qt, eD as jt, eE as Xt, eF as Yt, eG as Zt, fl as _t, eI as Jt, eJ as Kt, eK as Qt, eM as $t, fd as ao, fa as eo, fc as so, fw as to, eN as oo, eQ as ro, eO as no, eP as io, eR as lo, b8 as uo, fz as co, ag as bo, eU as po, eY as go, eX as So, eW as Co, eS as mo, eV as To, bi as Do, eT as Mo, eL as Ao, eZ as ho, e$ as vo, f0 as fo, f1 as Io, f3 as Po, f4 as Fo, f2 as wo, a$ as xo, Z as Bo, bg as Ro, as as Go, bG as Lo, av as ko, at as yo, au as Ho, bO as No, am as Oo, al as Uo, an as Eo, aM as Vo, aL as zo, ar as Wo, ff as qo, aq as jo, aH as Xo, aC as Yo, ax as Zo, ap as _o, ao as Jo, aw as Ko, aF as Qo, aG as $o, aJ as ar, aK as er, dD as sr, aN as tr, bh as or, aB as rr, bb as nr, f5 as ir, ay as dr, aD as lr, aE as ur, aI as cr, az as br, aA as pr, f7 as gr, e_ as Sr, aY as Cr, bd as mr, b3 as Tr, aP as Dr, aQ as Mr, aR as Ar, d3 as hr, aS as vr, aT as fr, ak as Ir, aj as Pr, b5 as Fr, b7 as wr, be as xr, b1 as Br, aO as Rr, bf as Gr, aV as Lr, eH as kr, b9 as yr, f6 as Hr, aU as Nr, aX as Or, a_ as Ur } from "./index-
|
|
1
|
+
import { aZ as t, bj as o, bm as r, bk as n, bl as i, fb as d, a4 as l, a5 as u, bn as c, bp as b, bq as p, bz as g, bA as S, bu as C, by as m, bw as T, bv as D, bs as M, br as A, bx as h, bt as v, fr as f, bo as I, ba as P, a0 as F, bB as w, b2 as x, bC as B, bE as R, bD as G, bF as L, bH as k, bN as y, bJ as H, bK as N, bI as O, bL as U, bM as E, X as V, bP as z, Y as W, bU as q, bT as j, bR as X, bQ as Y, bS as Z, bV as _, bW as J, bX as K, bZ as Q, bY as $, f8 as aa, b_ as ea, c1 as sa, c2 as ta, c3 as oa, b$ as ra, c0 as na, c4 as ia, c5 as da, c7 as la, c6 as ua, c8 as ca, c9 as ba, cc as pa, cd as ga, ca as Sa, ce as Ca, cb as ma, cg as Ta, cf as Da, aW as Ma, ch as Aa, cl as ha, cj as va, cq as fa, ck as Ia, cn as Pa, cr as Fa, cv as wa, cm as xa, co as Ba, cp as Ra, cs as Ga, ct as La, cu as ka, ci as ya, fq as Ha, _ as Na, fe as Oa, fg as Ua, a9 as Ea, aa as Va, fu as za, fv as Wa, fs as qa, cw as ja, cA as Xa, cB as Ya, cF as Za, cD as _a, cC as Ja, cy as Ka, cx as Qa, cE as $a, cz as ae, cG as ee, cK as se, cL as te, cP as oe, cN as re, cM as ne, cI as ie, cH as de, cO as le, cJ as ue, cQ as ce, cU as be, cS as pe, cZ as ge, cT as Se, cW as Ce, c_ as me, d2 as Te, cV as De, cX as Me, cY as Ae, c$ as he, d0 as ve, d1 as fe, cR as Ie, a3 as Pe, ah as Fe, d4 as we, d7 as xe, d8 as Be, da as Re, d5 as Ge, d6 as Le, a2 as ke, d9 as ye, fj as He, fA as Ne, fx as Oe, db as Ue, dd as Ee, dc as Ve, de as ze, ab as We, ac as qe, ad as je, ae as Xe, df as Ye, a6 as Ze, dg as _e, dh as Je, dj as Ke, di as Qe, dk as $e, ai as as, dl as es, dt as ss, dp as ts, dz as os, dq as rs, ds as ns, dm as is, dw as ds, du as ls, dv as us, dr as cs, dB as bs, dA as ps, dx as gs, dy as Ss, dn as Cs, a1 as ms, dC as Ts, b4 as Ds, fp as Ms, fm as As, fn as hs, fo as vs, dE as fs, dH as Is, dK as Ps, dG as Fs, dJ as ws, dF as xs, dI as Bs, dL as Rs, fk as Gs, b6 as Ls, fy as ks, f9 as ys, fh as Hs, dM as Ns, dP as Os, dO as Us, dN as Es, ft as Vs, dQ as zs, dS as Ws, dR as qs, dT as js, b0 as Xs, dU as Ys, dV as Zs, bc as _s, dY as Js, dX as Ks, dW as Qs, af as $s, dZ as at, d_ as et, d$ as st, e3 as tt, a8 as ot, e0 as rt, a7 as nt, e5 as it, e4 as dt, e8 as lt, e7 as ut, e6 as ct, e2 as bt, e1 as pt, e9 as gt, fi as St, ea as Ct, ee as mt, ef as Tt, ej as Dt, eh as Mt, eg as At, ec as ht, eb as vt, ei as ft, ed as It, ek as Pt, el as Ft, em as wt, en as xt, eo as Bt, ep as Rt, eq as Gt, er as Lt, es as kt, et as yt, eu as Ht, ev as Nt, ew as Ot, ex as Ut, ey as Et, ez as Vt, eA as zt, eB as Wt, eC as qt, eD as jt, eE as Xt, eF as Yt, eG as Zt, fl as _t, eI as Jt, eJ as Kt, eK as Qt, eM as $t, fd as ao, fa as eo, fc as so, fw as to, eN as oo, eQ as ro, eO as no, eP as io, eR as lo, b8 as uo, fz as co, ag as bo, eU as po, eY as go, eX as So, eW as Co, eS as mo, eV as To, bi as Do, eT as Mo, eL as Ao, eZ as ho, e$ as vo, f0 as fo, f1 as Io, f3 as Po, f4 as Fo, f2 as wo, a$ as xo, Z as Bo, bg as Ro, as as Go, bG as Lo, av as ko, at as yo, au as Ho, bO as No, am as Oo, al as Uo, an as Eo, aM as Vo, aL as zo, ar as Wo, ff as qo, aq as jo, aH as Xo, aC as Yo, ax as Zo, ap as _o, ao as Jo, aw as Ko, aF as Qo, aG as $o, aJ as ar, aK as er, dD as sr, aN as tr, bh as or, aB as rr, bb as nr, f5 as ir, ay as dr, aD as lr, aE as ur, aI as cr, az as br, aA as pr, f7 as gr, e_ as Sr, aY as Cr, bd as mr, b3 as Tr, aP as Dr, aQ as Mr, aR as Ar, d3 as hr, aS as vr, aT as fr, ak as Ir, aj as Pr, b5 as Fr, b7 as wr, be as xr, b1 as Br, aO as Rr, bf as Gr, aV as Lr, eH as kr, b9 as yr, f6 as Hr, aU as Nr, aX as Or, a_ as Ur } from "./index-CZ5vgM0K.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
export {
|
|
4
4
|
t as AccessControlWrapper,
|
|
@@ -520,7 +520,7 @@ Defaulting to \`null\`.`}var cH=rH,E$e=iH;const uH=y.forwardRef(({className:e,va
|
|
|
520
520
|
|
|
521
521
|
`)}p.write("payload.value = newResult;"),p.write("return payload;");const w=p.compile();return(S,C)=>w(f,S,C)};let i;const a=Rb,s=!PY.jitless,c=s&&ZLe.value,u=t.catchall;let d;e._zod.parse=(f,p)=>{d??(d=r.value);const h=f.value;return a(h)?s&&c&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(i||(i=o(t.shape)),f=i(f,p),u?YY([],h,f,p,d,e):f):n(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f)}});function ZY(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const o=e.filter(i=>!Md(i));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>xc(a,r,bc())))}),t)}const F8e=he("$ZodUnion",(e,t)=>{kn.init(e,t),It(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),It(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),It(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),It(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${o.map(i=>jP(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let a=!1;const s=[];for(const l of t.options){const c=l._zod.run({value:o.value,issues:[]},i);if(c instanceof Promise)s.push(c),a=!0;else{if(c.issues.length===0)return c;s.push(c)}}return a?Promise.all(s).then(l=>ZY(l,o,e,i)):ZY(s,o,e,i)}}),L8e=he("$ZodIntersection",(e,t)=>{kn.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),a=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([l,c])=>XY(n,l,c)):XY(n,i,a)}});function UP(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(hg(e)&&hg(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const a=UP(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],a=UP(o,i);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function XY(e,t,n){const r=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=s);for(const l of s.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(s);for(const s of n.issues)if(s.code==="unrecognized_keys")for(const l of s.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(s);const i=[...r].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&o&&e.issues.push({...o,keys:i}),Md(e))return e;const a=UP(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const z8e=he("$ZodEnum",(e,t)=>{kn.init(e,t);const n=AY(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>XLe.has(typeof o)).map(o=>typeof o=="string"?Bb(o):o.toString()).join("|")})$`),e._zod.parse=(o,i)=>{const a=o.value;return r.has(a)||o.issues.push({code:"invalid_value",values:n,input:a,inst:e}),o}}),j8e=he("$ZodTransform",(e,t)=>{kn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new OY(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(n.value=a,n));if(o instanceof Promise)throw new Td;return n.value=o,n}});function QY(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const JY=he("$ZodOptional",(e,t)=>{kn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${jP(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>QY(i,n.value)):QY(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),R8e=he("$ZodExactOptional",(e,t)=>{JY.init(e,t),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),B8e=he("$ZodNullable",(e,t)=>{kn.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${jP(n.source)}|null)$`):void 0}),It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),V8e=he("$ZodDefault",(e,t)=>{kn.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>eZ(i,t)):eZ(o,t)}});function eZ(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const q8e=he("$ZodPrefault",(e,t)=>{kn.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),U8e=he("$ZodNonOptional",(e,t)=>{kn.init(e,t),It(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>tZ(i,e)):tZ(o,e)}});function tZ(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const H8e=he("$ZodCatch",(e,t)=>{kn.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>xc(a,r,bc()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>xc(i,r,bc()))},input:n.value}),n.issues=[]),n)}}),W8e=he("$ZodPipe",(e,t)=>{kn.init(e,t),It(e._zod,"values",()=>t.in._zod.values),It(e._zod,"optin",()=>t.in._zod.optin),It(e._zod,"optout",()=>t.out._zod.optout),It(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(a=>Kb(a,t.in,r)):Kb(i,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Kb(i,t.out,r)):Kb(o,t.out,r)}});function Kb(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const K8e=he("$ZodReadonly",(e,t)=>{kn.init(e,t),It(e._zod,"propValues",()=>t.innerType._zod.propValues),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),It(e._zod,"optout",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(nZ):nZ(o)}});function nZ(e){return e.value=Object.freeze(e.value),e}const G8e=he("$ZodCustom",(e,t)=>{Yr.init(e,t),kn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>rZ(i,n,r,e));rZ(o,n,r,e)}});function rZ(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(gg(o))}}var oZ;class Y8e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Z8e(){return new Y8e}(oZ=globalThis).__zod_globalRegistry??(oZ.__zod_globalRegistry=Z8e());const mg=globalThis.__zod_globalRegistry;function X8e(e,t){return new e({type:"string",...et(t)})}function Q8e(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...et(t)})}function iZ(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...et(t)})}function J8e(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...et(t)})}function eze(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...et(t)})}function tze(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...et(t)})}function nze(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...et(t)})}function rze(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...et(t)})}function oze(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...et(t)})}function ize(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...et(t)})}function aze(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...et(t)})}function sze(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...et(t)})}function lze(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...et(t)})}function cze(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...et(t)})}function uze(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...et(t)})}function dze(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...et(t)})}function fze(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...et(t)})}function pze(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...et(t)})}function hze(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...et(t)})}function gze(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...et(t)})}function mze(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...et(t)})}function vze(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...et(t)})}function yze(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...et(t)})}function bze(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...et(t)})}function wze(e,t){return new e({type:"string",format:"date",check:"string_format",...et(t)})}function xze(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...et(t)})}function Sze(e,t){return new e({type:"string",format:"duration",check:"string_format",...et(t)})}function Cze(e,t){return new e({type:"number",checks:[],...et(t)})}function Eze(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...et(t)})}function _ze(e){return new e({type:"any"})}function kze(e){return new e({type:"unknown"})}function Oze(e,t){return new e({type:"never",...et(t)})}function aZ(e,t){return new qY({check:"less_than",...et(t),value:e,inclusive:!1})}function HP(e,t){return new qY({check:"less_than",...et(t),value:e,inclusive:!0})}function sZ(e,t){return new UY({check:"greater_than",...et(t),value:e,inclusive:!1})}function WP(e,t){return new UY({check:"greater_than",...et(t),value:e,inclusive:!0})}function lZ(e,t){return new U6e({check:"multiple_of",...et(t),value:e})}function cZ(e,t){return new W6e({check:"max_length",...et(t),maximum:e})}function Gb(e,t){return new K6e({check:"min_length",...et(t),minimum:e})}function uZ(e,t){return new G6e({check:"length_equals",...et(t),length:e})}function Pze(e,t){return new Y6e({check:"string_format",format:"regex",...et(t),pattern:e})}function Aze(e){return new Z6e({check:"string_format",format:"lowercase",...et(e)})}function Tze(e){return new X6e({check:"string_format",format:"uppercase",...et(e)})}function Mze(e,t){return new Q6e({check:"string_format",format:"includes",...et(t),includes:e})}function Nze(e,t){return new J6e({check:"string_format",format:"starts_with",...et(t),prefix:e})}function Dze(e,t){return new e8e({check:"string_format",format:"ends_with",...et(t),suffix:e})}function Nd(e){return new t8e({check:"overwrite",tx:e})}function $ze(e){return Nd(t=>t.normalize(e))}function Ize(){return Nd(e=>e.trim())}function Fze(){return Nd(e=>e.toLowerCase())}function Lze(){return Nd(e=>e.toUpperCase())}function zze(){return Nd(e=>YLe(e))}function jze(e,t,n){return new e({type:"array",element:t,...et(n)})}function Rze(e,t,n){return new e({type:"custom",check:"custom",fn:t,...et(n)})}function Bze(e){const t=Vze(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(gg(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(gg(o))}},e(n.value,n)));return t}function Vze(e,t){const n=new Yr({check:"custom",...et(t)});return n._zod.check=e,n}function dZ(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??mg,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function dr(e,t,n={path:[],schemaPath:[]}){var u,d;var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,a);const s=(d=(u=e._zod).toJSONSchema)==null?void 0:d.call(u);if(s)a.schema=s;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,f);else{const h=a.schema,m=t.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,h,f)}const p=e._zod.parent;p&&(a.ref||(a.ref=p),dr(p,t,f),t.seen.get(p).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(a.schema,l),t.io==="input"&&$r(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function fZ(e,t){var a,s,l,c;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const u of e.seen.entries()){const d=(a=e.metadataRegistry.get(u[0]))==null?void 0:a.id;if(d){const f=r.get(d);if(f&&f!==u[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(d,u[0])}}const o=u=>{var m;const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=(m=e.external.registry.get(u[0]))==null?void 0:m.id,b=e.external.uri??(x=>x);if(v)return{ref:b(v)};const w=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=w,{defId:w,ref:`${b("__shared")}#/${d}/${w}`}}if(u[1]===n)return{ref:"#"};const p=`#/${d}/`,h=u[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:p+h}},i=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:f,defId:p}=o(u);d.def={...d.schema},p&&(d.defId=p);const h=d.schema;for(const m in h)delete h[m];h.$ref=f};if(e.cycles==="throw")for(const u of e.seen.entries()){const d=u[1];if(d.cycle)throw new Error(`Cycle detected: #/${(s=d.cycle)==null?void 0:s.join("/")}/<root>
|
|
522
522
|
|
|
523
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const d=u[1];if(t===u[0]){i(u);continue}if(e.external){const p=(l=e.external.registry.get(u[0]))==null?void 0:l.id;if(t!==u[0]&&p){i(u);continue}}if((c=e.metadataRegistry.get(u[0]))==null?void 0:c.id){i(u);continue}if(d.cycle){i(u);continue}if(d.count>1&&e.reused==="ref"){i(u);continue}}}function pZ(e,t){var a,s,l;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=c=>{const u=e.seen.get(c);if(u.ref===null)return;const d=u.def??u.schema,f={...d},p=u.ref;if(u.ref=null,p){r(p);const m=e.seen.get(p),v=m.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),c._zod.parent===p)for(const w in d)w==="$ref"||w==="allOf"||w in f||delete d[w];if(v.$ref)for(const w in d)w==="$ref"||w==="allOf"||w in m.def&&JSON.stringify(d[w])===JSON.stringify(m.def[w])&&delete d[w]}const h=c._zod.parent;if(h&&h!==p){r(h);const m=e.seen.get(h);if(m!=null&&m.schema.$ref&&(d.$ref=m.schema.$ref,m.def))for(const v in d)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(d[v])===JSON.stringify(m.def[v])&&delete d[v]}e.override({zodSchema:c,jsonSchema:d,path:u.path??[]})};for(const c of[...e.seen.entries()].reverse())r(c[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const c=(s=e.external.registry.get(t))==null?void 0:s.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Object.assign(o,n.def??n.schema);const i=((l=e.external)==null?void 0:l.defs)??{};for(const c of e.seen.entries()){const u=c[1];u.def&&u.defId&&(i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Yb(t,"input",e.processors),output:Yb(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function $r(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return $r(r.element,n);if(r.type==="set")return $r(r.valueType,n);if(r.type==="lazy")return $r(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return $r(r.innerType,n);if(r.type==="intersection")return $r(r.left,n)||$r(r.right,n);if(r.type==="record"||r.type==="map")return $r(r.keyType,n)||$r(r.valueType,n);if(r.type==="pipe")return $r(r.in,n)||$r(r.out,n);if(r.type==="object"){for(const o in r.shape)if($r(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if($r(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if($r(o,n))return!0;return!!(r.rest&&$r(r.rest,n))}return!1}const qze=(e,t={})=>n=>{const r=dZ({...n,processors:t});return dr(e,r),fZ(r,e),pZ(r,e)},Yb=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},a=dZ({...o??{},target:i,io:t,processors:n});return dr(e,a),fZ(a,e),pZ(a,e)},Uze={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Hze=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),s&&(o.format=Uze[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Wze=(e,t,n,r)=>{const o=n,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u),typeof i=="number"&&(o.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof a=="number"&&(o.maximum=a,typeof c=="number"&&t.target!=="draft-04"&&(c<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},Kze=(e,t,n,r)=>{n.not={}},Gze=(e,t,n,r)=>{},Yze=(e,t,n,r)=>{},Zze=(e,t,n,r)=>{const o=e._zod.def,i=AY(o.entries);i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),n.enum=i},Xze=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Qze=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Jze=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=dr(i.element,t,{...r,path:[...r.path,"items"]})},eje=(e,t,n,r)=>{var c;const o=n,i=e._zod.def;o.type="object",o.properties={};const a=i.shape;for(const u in a)o.properties[u]=dr(a[u],t,{...r,path:[...r.path,"properties",u]});const s=new Set(Object.keys(a)),l=new Set([...s].filter(u=>{const d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(o.required=Array.from(l)),((c=i.catchall)==null?void 0:c._zod.def.type)==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=dr(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},tje=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,a=o.options.map((s,l)=>dr(s,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=a:n.anyOf=a},nje=(e,t,n,r)=>{const o=e._zod.def,i=dr(o.left,t,{...r,path:[...r.path,"allOf",0]}),a=dr(o.right,t,{...r,path:[...r.path,"allOf",1]}),s=c=>"allOf"in c&&Object.keys(c).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];n.allOf=l},rje=(e,t,n,r)=>{const o=e._zod.def,i=dr(o.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},oje=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},ije=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},aje=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},sje=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},lje=(e,t,n,r)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;dr(i,t,r);const a=t.seen.get(e);a.ref=i},cje=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},hZ=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},uje=he("ZodISODateTime",(e,t)=>{g8e.init(e,t),bn.init(e,t)});function dje(e){return bze(uje,e)}const fje=he("ZodISODate",(e,t)=>{m8e.init(e,t),bn.init(e,t)});function pje(e){return wze(fje,e)}const hje=he("ZodISOTime",(e,t)=>{v8e.init(e,t),bn.init(e,t)});function gje(e){return xze(hje,e)}const mje=he("ZodISODuration",(e,t)=>{y8e.init(e,t),bn.init(e,t)});function vje(e){return Sze(mje,e)}const Bo=he("ZodError",(e,t)=>{FY.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>l6e(e,n)},flatten:{value:n=>s6e(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,FP,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,FP,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),yje=BP(Bo),bje=VP(Bo),wje=qb(Bo),xje=Ub(Bo),Sje=d6e(Bo),Cje=f6e(Bo),Eje=p6e(Bo),_je=h6e(Bo),kje=g6e(Bo),Oje=m6e(Bo),Pje=v6e(Bo),Aje=y6e(Bo),On=he("ZodType",(e,t)=>(kn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Yb(e,"input"),output:Yb(e,"output")}}),e.toJSONSchema=qze(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ys(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Zs(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>yje(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>wje(e,n,r),e.parseAsync=async(n,r)=>bje(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>xje(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Sje(e,n,r),e.decode=(n,r)=>Cje(e,n,r),e.encodeAsync=async(n,r)=>Eje(e,n,r),e.decodeAsync=async(n,r)=>_je(e,n,r),e.safeEncode=(n,r)=>kje(e,n,r),e.safeDecode=(n,r)=>Oje(e,n,r),e.safeEncodeAsync=async(n,r)=>Pje(e,n,r),e.safeDecodeAsync=async(n,r)=>Aje(e,n,r),e.refine=(n,r)=>e.check(_7e(n,r)),e.superRefine=n=>e.check(k7e(n)),e.overwrite=n=>e.check(Nd(n)),e.optional=()=>SZ(e),e.exactOptional=()=>f7e(e),e.nullable=()=>CZ(e),e.nullish=()=>SZ(CZ(e)),e.nonoptional=n=>y7e(e,n),e.array=()=>n7e(e),e.or=n=>i7e([e,n]),e.and=n=>s7e(e,n),e.transform=n=>_Z(e,u7e(n)),e.default=n=>g7e(e,n),e.prefault=n=>v7e(e,n),e.catch=n=>w7e(e,n),e.pipe=n=>_Z(e,n),e.readonly=()=>C7e(e),e.describe=n=>{const r=e.clone();return mg.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=mg.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return mg.get(e);const r=e.clone();return mg.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),gZ=he("_ZodString",(e,t)=>{qP.init(e,t),On.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Hze(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Pze(...r)),e.includes=(...r)=>e.check(Mze(...r)),e.startsWith=(...r)=>e.check(Nze(...r)),e.endsWith=(...r)=>e.check(Dze(...r)),e.min=(...r)=>e.check(Gb(...r)),e.max=(...r)=>e.check(cZ(...r)),e.length=(...r)=>e.check(uZ(...r)),e.nonempty=(...r)=>e.check(Gb(1,...r)),e.lowercase=r=>e.check(Aze(r)),e.uppercase=r=>e.check(Tze(r)),e.trim=()=>e.check(Ize()),e.normalize=(...r)=>e.check($ze(...r)),e.toLowerCase=()=>e.check(Fze()),e.toUpperCase=()=>e.check(Lze()),e.slugify=()=>e.check(zze())}),Tje=he("ZodString",(e,t)=>{qP.init(e,t),gZ.init(e,t),e.email=n=>e.check(Q8e(Mje,n)),e.url=n=>e.check(rze(Nje,n)),e.jwt=n=>e.check(yze(Kje,n)),e.emoji=n=>e.check(oze(Dje,n)),e.guid=n=>e.check(iZ(mZ,n)),e.uuid=n=>e.check(J8e(Zb,n)),e.uuidv4=n=>e.check(eze(Zb,n)),e.uuidv6=n=>e.check(tze(Zb,n)),e.uuidv7=n=>e.check(nze(Zb,n)),e.nanoid=n=>e.check(ize($je,n)),e.guid=n=>e.check(iZ(mZ,n)),e.cuid=n=>e.check(aze(Ije,n)),e.cuid2=n=>e.check(sze(Fje,n)),e.ulid=n=>e.check(lze(Lje,n)),e.base64=n=>e.check(gze(Uje,n)),e.base64url=n=>e.check(mze(Hje,n)),e.xid=n=>e.check(cze(zje,n)),e.ksuid=n=>e.check(uze(jje,n)),e.ipv4=n=>e.check(dze(Rje,n)),e.ipv6=n=>e.check(fze(Bje,n)),e.cidrv4=n=>e.check(pze(Vje,n)),e.cidrv6=n=>e.check(hze(qje,n)),e.e164=n=>e.check(vze(Wje,n)),e.datetime=n=>e.check(dje(n)),e.date=n=>e.check(pje(n)),e.time=n=>e.check(gje(n)),e.duration=n=>e.check(vje(n))});function Dd(e){return X8e(Tje,e)}const bn=he("ZodStringFormat",(e,t)=>{un.init(e,t),gZ.init(e,t)}),Mje=he("ZodEmail",(e,t)=>{a8e.init(e,t),bn.init(e,t)}),mZ=he("ZodGUID",(e,t)=>{o8e.init(e,t),bn.init(e,t)}),Zb=he("ZodUUID",(e,t)=>{i8e.init(e,t),bn.init(e,t)}),Nje=he("ZodURL",(e,t)=>{s8e.init(e,t),bn.init(e,t)}),Dje=he("ZodEmoji",(e,t)=>{l8e.init(e,t),bn.init(e,t)}),$je=he("ZodNanoID",(e,t)=>{c8e.init(e,t),bn.init(e,t)}),Ije=he("ZodCUID",(e,t)=>{u8e.init(e,t),bn.init(e,t)}),Fje=he("ZodCUID2",(e,t)=>{d8e.init(e,t),bn.init(e,t)}),Lje=he("ZodULID",(e,t)=>{f8e.init(e,t),bn.init(e,t)}),zje=he("ZodXID",(e,t)=>{p8e.init(e,t),bn.init(e,t)}),jje=he("ZodKSUID",(e,t)=>{h8e.init(e,t),bn.init(e,t)}),Rje=he("ZodIPv4",(e,t)=>{b8e.init(e,t),bn.init(e,t)}),Bje=he("ZodIPv6",(e,t)=>{w8e.init(e,t),bn.init(e,t)}),Vje=he("ZodCIDRv4",(e,t)=>{x8e.init(e,t),bn.init(e,t)}),qje=he("ZodCIDRv6",(e,t)=>{S8e.init(e,t),bn.init(e,t)}),Uje=he("ZodBase64",(e,t)=>{C8e.init(e,t),bn.init(e,t)}),Hje=he("ZodBase64URL",(e,t)=>{_8e.init(e,t),bn.init(e,t)}),Wje=he("ZodE164",(e,t)=>{k8e.init(e,t),bn.init(e,t)}),Kje=he("ZodJWT",(e,t)=>{P8e.init(e,t),bn.init(e,t)}),vZ=he("ZodNumber",(e,t)=>{WY.init(e,t),On.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Wze(e,r,o),e.gt=(r,o)=>e.check(sZ(r,o)),e.gte=(r,o)=>e.check(WP(r,o)),e.min=(r,o)=>e.check(WP(r,o)),e.lt=(r,o)=>e.check(aZ(r,o)),e.lte=(r,o)=>e.check(HP(r,o)),e.max=(r,o)=>e.check(HP(r,o)),e.int=r=>e.check(yZ(r)),e.safe=r=>e.check(yZ(r)),e.positive=r=>e.check(sZ(0,r)),e.nonnegative=r=>e.check(WP(0,r)),e.negative=r=>e.check(aZ(0,r)),e.nonpositive=r=>e.check(HP(0,r)),e.multipleOf=(r,o)=>e.check(lZ(r,o)),e.step=(r,o)=>e.check(lZ(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Gje(e){return Cze(vZ,e)}const Yje=he("ZodNumberFormat",(e,t)=>{A8e.init(e,t),vZ.init(e,t)});function yZ(e){return Eze(Yje,e)}const Zje=he("ZodAny",(e,t)=>{T8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gze()});function Xje(){return _ze(Zje)}const Qje=he("ZodUnknown",(e,t)=>{M8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Yze()});function bZ(){return kze(Qje)}const Jje=he("ZodNever",(e,t)=>{N8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Kze(e,n,r)});function e7e(e){return Oze(Jje,e)}const t7e=he("ZodArray",(e,t)=>{D8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jze(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Gb(n,r)),e.nonempty=n=>e.check(Gb(1,n)),e.max=(n,r)=>e.check(cZ(n,r)),e.length=(n,r)=>e.check(uZ(n,r)),e.unwrap=()=>e.element});function n7e(e,t){return jze(t7e,e,t)}const r7e=he("ZodObject",(e,t)=>{I8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>eje(e,n,r,o),It(e,"shape",()=>t.shape),e.keyof=()=>l7e(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:bZ()}),e.loose=()=>e.clone({...e._zod.def,catchall:bZ()}),e.strict=()=>e.clone({...e._zod.def,catchall:e7e()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>n6e(e,n),e.safeExtend=n=>r6e(e,n),e.merge=n=>o6e(e,n),e.pick=n=>e6e(e,n),e.omit=n=>t6e(e,n),e.partial=(...n)=>i6e(xZ,e,n[0]),e.required=(...n)=>a6e(EZ,e,n[0])});function wZ(e,t){const n={type:"object",shape:e??{},...et(t)};return new r7e(n)}const o7e=he("ZodUnion",(e,t)=>{F8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tje(e,n,r,o),e.options=t.options});function i7e(e,t){return new o7e({type:"union",options:e,...et(t)})}const a7e=he("ZodIntersection",(e,t)=>{L8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nje(e,n,r,o)});function s7e(e,t){return new a7e({type:"intersection",left:e,right:t})}const KP=he("ZodEnum",(e,t)=>{z8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Zze(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const a of r)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new KP({...t,checks:[],...et(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new KP({...t,checks:[],...et(o),entries:i})}});function l7e(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new KP({type:"enum",entries:n,...et(t)})}const c7e=he("ZodTransform",(e,t)=>{j8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qze(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new OY(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(gg(i,n.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(gg(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function u7e(e){return new c7e({type:"transform",transform:e})}const xZ=he("ZodOptional",(e,t)=>{JY.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hZ(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function SZ(e){return new xZ({type:"optional",innerType:e})}const d7e=he("ZodExactOptional",(e,t)=>{R8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hZ(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function f7e(e){return new d7e({type:"optional",innerType:e})}const p7e=he("ZodNullable",(e,t)=>{B8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rje(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function CZ(e){return new p7e({type:"nullable",innerType:e})}const h7e=he("ZodDefault",(e,t)=>{V8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ije(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function g7e(e,t){return new h7e({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():DY(t)}})}const m7e=he("ZodPrefault",(e,t)=>{q8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>aje(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function v7e(e,t){return new m7e({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():DY(t)}})}const EZ=he("ZodNonOptional",(e,t)=>{U8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>oje(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function y7e(e,t){return new EZ({type:"nonoptional",innerType:e,...et(t)})}const b7e=he("ZodCatch",(e,t)=>{H8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sje(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function w7e(e,t){return new b7e({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const x7e=he("ZodPipe",(e,t)=>{W8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lje(e,n,r,o),e.in=t.in,e.out=t.out});function _Z(e,t){return new x7e({type:"pipe",in:e,out:t})}const S7e=he("ZodReadonly",(e,t)=>{K8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cje(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function C7e(e){return new S7e({type:"readonly",innerType:e})}const E7e=he("ZodCustom",(e,t)=>{G8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xze(e,n)});function _7e(e,t={}){return Rze(E7e,e,t)}function k7e(e){return Bze(e)}const Xb=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:U("w-full caption-bottom text-sm",e),...t})}));Xb.displayName="Table";const Qb=y.forwardRef(({className:e,...t},n)=>g.jsx("thead",{ref:n,className:U("[&_tr]:border-b",e),...t}));Qb.displayName="TableHeader";const Jb=y.forwardRef(({className:e,...t},n)=>g.jsx("tbody",{ref:n,className:U("[&_tr:last-child]:border-0",e),...t}));Jb.displayName="TableBody";const O7e=y.forwardRef(({className:e,...t},n)=>g.jsx("tfoot",{ref:n,className:U("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));O7e.displayName="TableFooter";const ss=y.forwardRef(({className:e,...t},n)=>g.jsx("tr",{ref:n,className:U("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ss.displayName="TableRow";const ew=y.forwardRef(({className:e,...t},n)=>g.jsx("th",{ref:n,className:U("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ew.displayName="TableHead";const $d=y.forwardRef(({className:e,...t},n)=>g.jsx("td",{ref:n,className:U("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));$d.displayName="TableCell";const P7e=y.forwardRef(({className:e,...t},n)=>g.jsx("caption",{ref:n,className:U("mt-4 text-sm text-muted-foreground",e),...t}));P7e.displayName="TableCaption";const A7e=wZ({id:Gje(),header:Dd(),type:Dd(),status:Dd(),target:Dd(),limit:Dd(),reviewer:Dd()});function T7e({id:e}){const{attributes:t,listeners:n}=uY({id:e});return g.jsxs(mt,{...t,...n,variant:"ghost",size:"icon",className:"size-7 text-muted-foreground hover:bg-transparent",children:[g.jsx(Hue,{className:"size-3 text-muted-foreground"}),g.jsx("span",{className:"sr-only",children:"Drag to reorder"})]})}const kZ=[{id:"drag",header:()=>null,cell:({row:e})=>g.jsx(T7e,{id:e.original.id})},{id:"select",header:({table:e})=>g.jsx("div",{className:"flex items-center justify-center",children:g.jsx(fh,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:t=>e.toggleAllPageRowsSelected(!!t),"aria-label":"Select all"})}),cell:({row:e})=>g.jsx("div",{className:"flex items-center justify-center",children:g.jsx(fh,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(!!t),"aria-label":"Select row"})}),enableSorting:!1,enableHiding:!1},{accessorKey:"header",header:"Header",cell:({row:e})=>g.jsx(I7e,{item:e.original}),enableHiding:!1},{accessorKey:"type",header:"Section Type",cell:({row:e})=>g.jsx("div",{className:"w-32",children:g.jsx(wu,{variant:"outline",className:"px-1.5 text-muted-foreground",children:e.original.type})})},{accessorKey:"status",header:"Status",cell:({row:e})=>g.jsxs(wu,{variant:"outline",className:"flex gap-1 px-1.5 text-muted-foreground [&_svg]:size-3",children:[e.original.status==="Done"?g.jsx(Iue,{className:"text-green-500 dark:text-green-400"}):g.jsx(Yue,{}),e.original.status]})},{accessorKey:"target",header:()=>g.jsx("div",{className:"w-full text-right",children:"Target"}),cell:({row:e})=>g.jsxs("form",{onSubmit:t=>{t.preventDefault(),wK.promise(new Promise(n=>setTimeout(n,1e3)),{loading:`Saving ${e.original.header}`,success:"Done",error:"Error"})},children:[g.jsx(Wr,{htmlFor:`${e.original.id}-target`,className:"sr-only",children:"Target"}),g.jsx(xi,{className:"h-8 w-16 border-transparent bg-transparent text-right shadow-none hover:bg-input/30 focus-visible:border focus-visible:bg-background",defaultValue:e.original.target,id:`${e.original.id}-target`})]})},{accessorKey:"limit",header:()=>g.jsx("div",{className:"w-full text-right",children:"Limit"}),cell:({row:e})=>g.jsxs("form",{onSubmit:t=>{t.preventDefault(),wK.promise(new Promise(n=>setTimeout(n,1e3)),{loading:`Saving ${e.original.header}`,success:"Done",error:"Error"})},children:[g.jsx(Wr,{htmlFor:`${e.original.id}-limit`,className:"sr-only",children:"Limit"}),g.jsx(xi,{className:"h-8 w-16 border-transparent bg-transparent text-right shadow-none hover:bg-input/30 focus-visible:border focus-visible:bg-background",defaultValue:e.original.limit,id:`${e.original.id}-limit`})]})},{accessorKey:"reviewer",header:"Reviewer",cell:({row:e})=>e.original.reviewer!=="Assign reviewer"?e.original.reviewer:g.jsxs(g.Fragment,{children:[g.jsx(Wr,{htmlFor:`${e.original.id}-reviewer`,className:"sr-only",children:"Reviewer"}),g.jsxs(Ei,{children:[g.jsx(zo,{className:"h-8 w-40",id:`${e.original.id}-reviewer`,children:g.jsx(_i,{placeholder:"Assign reviewer"})}),g.jsxs(jo,{align:"end",children:[g.jsx(Pt,{value:"Eddie Lake",children:"Eddie Lake"}),g.jsx(Pt,{value:"Jamik Tashpulatov",children:"Jamik Tashpulatov"})]})]})]})},{id:"actions",cell:()=>g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsxs(mt,{variant:"ghost",className:"flex size-8 text-muted-foreground data-[state=open]:bg-muted",size:"icon",children:[g.jsx(bx,{}),g.jsx("span",{className:"sr-only",children:"Open menu"})]})}),g.jsxs(Bs,{align:"end",className:"w-32",children:[g.jsx(wr,{children:"Edit"}),g.jsx(wr,{children:"Make a copy"}),g.jsx(wr,{children:"Favorite"}),g.jsx(rd,{}),g.jsx(wr,{children:"Delete"})]})]})}];function M7e({row:e}){const{transform:t,transition:n,setNodeRef:r,isDragging:o}=uY({id:e.original.id});return g.jsx(ss,{"data-state":e.getIsSelected()&&"selected","data-dragging":o,ref:r,className:"relative z-0 data-[dragging=true]:z-10 data-[dragging=true]:opacity-80",style:{transform:sg.Transform.toString(t),transition:n},children:e.getVisibleCells().map(i=>g.jsx($d,{children:jb(i.column.columnDef.cell,i.getContext())},i.id))})}function N7e({data:e,className:t}){var x;const[n,r]=y.useState(()=>e),[o,i]=y.useState({}),[a,s]=y.useState({}),[l,c]=y.useState([]),[u,d]=y.useState([]),[f,p]=y.useState({pageIndex:0,pageSize:10}),h=y.useId(),m=R4e(lP(GG,{}),lP(YG,{}),lP(hP,{})),v=y.useMemo(()=>(n==null?void 0:n.map(({id:S})=>S))||[],[n]),b=kY({data:n,columns:kZ,state:{sorting:u,columnVisibility:a,rowSelection:o,columnFilters:l,pagination:f},getRowId:S=>S.id.toString(),enableRowSelection:!0,onRowSelectionChange:i,onSortingChange:d,onColumnFiltersChange:c,onColumnVisibilityChange:s,onPaginationChange:p,getCoreRowModel:SY(),getFilteredRowModel:EY(),getPaginationRowModel:_Y(),getSortedRowModel:ULe(),getFacetedRowModel:VLe(),getFacetedUniqueValues:qLe()});function w(S){const{active:C,over:_}=S;C&&_&&C.id!==_.id&&r(k=>{const O=v.indexOf(C.id),P=v.indexOf(_.id);return bP(k,O,P)})}return g.jsxs(qK,{defaultValue:"outline",className:U("flex w-full flex-col justify-start gap-6",t),children:[g.jsxs("div",{className:"flex items-center justify-between px-4 lg:px-6",children:[g.jsx(Wr,{htmlFor:"view-selector",className:"sr-only",children:"View"}),g.jsxs(Ei,{defaultValue:"outline",children:[g.jsx(zo,{className:"@4xl/main:hidden flex w-fit",id:"view-selector",children:g.jsx(_i,{placeholder:"Select a view"})}),g.jsxs(jo,{children:[g.jsx(Pt,{value:"outline",children:"Outline"}),g.jsx(Pt,{value:"past-performance",children:"Past Performance"}),g.jsx(Pt,{value:"key-personnel",children:"Key Personnel"}),g.jsx(Pt,{value:"focus-documents",children:"Focus Documents"})]})]}),g.jsxs($O,{className:"@4xl/main:flex hidden",children:[g.jsx(_d,{value:"outline",children:"Outline"}),g.jsxs(_d,{value:"past-performance",className:"gap-1",children:["Past Performance",g.jsx(wu,{variant:"secondary",className:"flex h-5 w-5 items-center justify-center rounded-full bg-muted-foreground/30",children:"3"})]}),g.jsxs(_d,{value:"key-personnel",className:"gap-1",children:["Key Personnel",g.jsx(wu,{variant:"secondary",className:"flex h-5 w-5 items-center justify-center rounded-full bg-muted-foreground/30",children:"2"})]}),g.jsx(_d,{value:"focus-documents",children:"Focus Documents"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsxs(mt,{variant:"outline",size:"sm",children:[g.jsx(zue,{}),g.jsx("span",{className:"hidden lg:inline",children:"Customize Columns"}),g.jsx("span",{className:"lg:hidden",children:"Columns"}),g.jsx(ev,{})]})}),g.jsx(Bs,{align:"end",className:"w-56",children:b.getAllColumns().filter(S=>typeof S.accessorFn<"u"&&S.getCanHide()).map(S=>g.jsx(ik,{className:"capitalize",checked:S.getIsVisible(),onCheckedChange:C=>S.toggleVisibility(!!C),children:S.id},S.id))})]}),g.jsxs(mt,{variant:"outline",size:"sm",children:[g.jsx(xx,{}),g.jsx("span",{className:"hidden lg:inline",children:"Add Section"})]})]})]}),g.jsxs(yc,{value:"outline",className:"relative flex flex-col gap-4 overflow-auto px-4 lg:px-6",children:[g.jsx("div",{className:"overflow-hidden rounded-lg border",children:g.jsx(VFe,{collisionDetection:H4e,modifiers:[ZFe],onDragEnd:w,sensors:m,id:h,children:g.jsxs(Xb,{children:[g.jsx(Qb,{className:"sticky top-0 z-10 bg-muted",children:b.getHeaderGroups().map(S=>g.jsx(ss,{children:S.headers.map(C=>g.jsx(ew,{colSpan:C.colSpan,children:C.isPlaceholder?null:jb(C.column.columnDef.header,C.getContext())},C.id))},S.id))}),g.jsx(Jb,{className:"**:data-[slot=table-cell]:first:w-8",children:(x=b.getRowModel().rows)!=null&&x.length?g.jsx(nLe,{items:v,strategy:eLe,children:b.getRowModel().rows.map(S=>g.jsx(M7e,{row:S},S.id))}):g.jsx(ss,{children:g.jsx($d,{colSpan:kZ.length,className:"h-24 text-center",children:"No results."})})})]})})}),g.jsxs("div",{className:"flex items-center justify-between px-4",children:[g.jsxs("div",{className:"hidden flex-1 text-sm text-muted-foreground lg:flex",children:[b.getFilteredSelectedRowModel().rows.length," of ",b.getFilteredRowModel().rows.length," row(s) selected."]}),g.jsxs("div",{className:"flex w-full items-center gap-8 lg:w-fit",children:[g.jsxs("div",{className:"hidden items-center gap-2 lg:flex",children:[g.jsx(Wr,{htmlFor:"rows-per-page",className:"text-sm font-medium",children:"Rows per page"}),g.jsxs(Ei,{value:`${b.getState().pagination.pageSize}`,onValueChange:S=>b.setPageSize(Number(S)),children:[g.jsx(zo,{className:"w-20",id:"rows-per-page",children:g.jsx(_i,{placeholder:b.getState().pagination.pageSize})}),g.jsx(jo,{side:"top",children:[10,20,30,40,50].map(S=>g.jsx(Pt,{value:`${S}`,children:S},S))})]})]}),g.jsxs("div",{className:"flex w-fit items-center justify-center text-sm font-medium",children:["Page ",b.getState().pagination.pageIndex+1," of ",b.getPageCount()]}),g.jsxs("div",{className:"ml-auto flex items-center gap-2 lg:ml-0",children:[g.jsxs(mt,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>b.setPageIndex(0),disabled:!b.getCanPreviousPage(),children:[g.jsx("span",{className:"sr-only",children:"Go to first page"}),g.jsx(Mue,{})]}),g.jsxs(mt,{variant:"outline",className:"size-8",size:"icon",onClick:()=>b.previousPage(),disabled:!b.getCanPreviousPage(),children:[g.jsx("span",{className:"sr-only",children:"Go to previous page"}),g.jsx(xu,{})]}),g.jsxs(mt,{variant:"outline",className:"size-8",size:"icon",onClick:()=>b.nextPage(),disabled:!b.getCanNextPage(),children:[g.jsx("span",{className:"sr-only",children:"Go to next page"}),g.jsx(Ri,{})]}),g.jsxs(mt,{variant:"outline",className:"hidden size-8 lg:flex",size:"icon",onClick:()=>b.setPageIndex(b.getPageCount()-1),disabled:!b.getCanNextPage(),children:[g.jsx("span",{className:"sr-only",children:"Go to last page"}),g.jsx(Nue,{})]})]})]})]})]}),g.jsx(yc,{value:"past-performance",className:"flex flex-col px-4 lg:px-6",children:g.jsx("div",{className:"aspect-video w-full flex-1 rounded-lg border border-dashed"})}),g.jsx(yc,{value:"key-personnel",className:"flex flex-col px-4 lg:px-6",children:g.jsx("div",{className:"aspect-video w-full flex-1 rounded-lg border border-dashed"})}),g.jsx(yc,{value:"focus-documents",className:"flex flex-col px-4 lg:px-6",children:g.jsx("div",{className:"aspect-video w-full flex-1 rounded-lg border border-dashed"})})]})}const D7e=[{month:"January",desktop:186,mobile:80},{month:"February",desktop:305,mobile:200},{month:"March",desktop:237,mobile:120},{month:"April",desktop:73,mobile:190},{month:"May",desktop:209,mobile:130},{month:"June",desktop:214,mobile:140}],$7e={desktop:{label:"Desktop",color:"var(--primary)"},mobile:{label:"Mobile",color:"var(--primary)"}};function I7e({item:e}){const t=pb();return g.jsxs(Rh,{children:[g.jsx(Kq,{asChild:!0,children:g.jsx(mt,{variant:"link",className:"w-fit px-0 text-left text-foreground",children:e.header})}),g.jsxs(sd,{side:"right",className:"flex flex-col",children:[g.jsxs(Bh,{className:"gap-1",children:[g.jsx(Vh,{children:e.header}),g.jsx(qh,{children:"Showing total visitors for the last 6 months"})]}),g.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto py-4 text-sm",children:[!t&&g.jsxs(g.Fragment,{children:[g.jsx(s0,{config:$7e,children:g.jsxs(K7,{accessibilityLayer:!0,data:D7e,margin:{left:0,right:10},children:[g.jsx($2,{vertical:!1}),g.jsx(q2,{dataKey:"month",tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:n=>n.slice(0,3),hide:!0}),g.jsx(Z2,{cursor:!1,content:g.jsx(l0,{indicator:"dot"})}),g.jsx(uh,{dataKey:"mobile",type:"natural",fill:"var(--color-mobile)",fillOpacity:.6,stroke:"var(--color-mobile)",stackId:"a"}),g.jsx(uh,{dataKey:"desktop",type:"natural",fill:"var(--color-desktop)",fillOpacity:.4,stroke:"var(--color-desktop)",stackId:"a"})]})}),g.jsx(wd,{}),g.jsxs("div",{className:"grid gap-2",children:[g.jsxs("div",{className:"flex gap-2 font-medium leading-none",children:["Trending up by 5.2% this month ",g.jsx(ide,{className:"size-4"})]}),g.jsx("div",{className:"text-muted-foreground",children:"Showing total visitors for the last 6 months. This is just some random text to test the layout. It spans multiple lines and should wrap around."})]}),g.jsx(wd,{})]}),g.jsxs("form",{className:"flex flex-col gap-4",children:[g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"header",children:"Header"}),g.jsx(xi,{id:"header",defaultValue:e.header})]}),g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"type",children:"Type"}),g.jsxs(Ei,{defaultValue:e.type,children:[g.jsx(zo,{id:"type",className:"w-full",children:g.jsx(_i,{placeholder:"Select a type"})}),g.jsxs(jo,{children:[g.jsx(Pt,{value:"Table of Contents",children:"Table of Contents"}),g.jsx(Pt,{value:"Executive Summary",children:"Executive Summary"}),g.jsx(Pt,{value:"Technical Approach",children:"Technical Approach"}),g.jsx(Pt,{value:"Design",children:"Design"}),g.jsx(Pt,{value:"Capabilities",children:"Capabilities"}),g.jsx(Pt,{value:"Focus Documents",children:"Focus Documents"}),g.jsx(Pt,{value:"Narrative",children:"Narrative"}),g.jsx(Pt,{value:"Cover Page",children:"Cover Page"})]})]})]}),g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"status",children:"Status"}),g.jsxs(Ei,{defaultValue:e.status,children:[g.jsx(zo,{id:"status",className:"w-full",children:g.jsx(_i,{placeholder:"Select a status"})}),g.jsxs(jo,{children:[g.jsx(Pt,{value:"Done",children:"Done"}),g.jsx(Pt,{value:"In Progress",children:"In Progress"}),g.jsx(Pt,{value:"Not Started",children:"Not Started"})]})]})]})]}),g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"target",children:"Target"}),g.jsx(xi,{id:"target",defaultValue:e.target})]}),g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"limit",children:"Limit"}),g.jsx(xi,{id:"limit",defaultValue:e.limit})]})]}),g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"reviewer",children:"Reviewer"}),g.jsxs(Ei,{defaultValue:e.reviewer,children:[g.jsx(zo,{id:"reviewer",className:"w-full",children:g.jsx(_i,{placeholder:"Select a reviewer"})}),g.jsxs(jo,{children:[g.jsx(Pt,{value:"Eddie Lake",children:"Eddie Lake"}),g.jsx(Pt,{value:"Jamik Tashpulatov",children:"Jamik Tashpulatov"}),g.jsx(Pt,{value:"Emily Whalen",children:"Emily Whalen"})]})]})]})]})]}),g.jsxs(H0,{className:"mt-auto flex gap-2 sm:flex-col sm:space-x-0",children:[g.jsx(mt,{className:"w-full",children:"Submit"}),g.jsx(Gq,{asChild:!0,children:g.jsx(mt,{variant:"outline",className:"w-full",children:"Done"})})]})]})]})}const F7e=({columnCount:e,rowCount:t=10,searchableColumnCount:n=0,filterableColumnCount:r=0,showViewOptions:o=!0,className:i})=>g.jsxs("div",{className:U("w-full space-y-3 overflow-auto",i),children:[g.jsxs("div",{className:"flex w-full items-center justify-between space-x-2 overflow-auto p-1",children:[g.jsxs("div",{className:"flex flex-1 items-center space-x-2 space-y-4",children:[n>0?Array.from({length:n}).map((a,s)=>g.jsx(rn,{className:"h-10 w-[150px] lg:w-[250px]"},s)):null,r>0?Array.from({length:r}).map((a,s)=>g.jsx(rn,{className:"h-10 w-[70px] border-dashed"},s)):null]}),o?g.jsx(rn,{className:"ml-auto hidden h-7 w-[70px] lg:flex"}):null]}),g.jsx("div",{className:"rounded-md border",children:g.jsxs(Xb,{children:[g.jsx(Qb,{children:Array.from({length:1}).map((a,s)=>g.jsx(ss,{className:"hover:bg-transparent",children:Array.from({length:e}).map((l,c)=>g.jsx(ew,{children:g.jsx(rn,{className:"h-6 w-full"})},c))},s))}),g.jsx(Jb,{children:Array.from({length:t}).map((a,s)=>g.jsx(ss,{className:"hover:bg-transparent",children:Array.from({length:e}).map((l,c)=>g.jsx($d,{children:g.jsx(rn,{className:"h-6 w-full"})},c))},s))})]})}),g.jsxs("div",{className:"flex w-full flex-col items-center justify-between gap-4 overflow-auto px-2 py-1 sm:flex-row sm:gap-8",children:[g.jsx("div",{className:"flex-1",children:g.jsx(rn,{className:"h-8 w-40"})}),g.jsxs("div",{className:"flex flex-col items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:[g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(rn,{className:"h-8 w-24"}),g.jsx(rn,{className:"h-8 w-[70px]"})]}),g.jsx("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:g.jsx(rn,{className:"h-8 w-20"})}),g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(rn,{className:"hidden size-8 lg:block"}),g.jsx(rn,{className:"size-8"}),g.jsx(rn,{className:"size-8"}),g.jsx(rn,{className:"hidden size-8 lg:block"})]})]})]})]}),OZ=({className:e,...t})=>g.jsx("nav",{role:"navigation","aria-label":"pagination",className:U("mx-auto flex w-full justify-center",e),...t});OZ.displayName="Pagination";const PZ=y.forwardRef(({className:e,...t},n)=>g.jsx("ul",{ref:n,className:U("flex flex-row items-center gap-1",e),...t}));PZ.displayName="PaginationContent";const tw=y.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:U("",e),...t}));tw.displayName="PaginationItem";const Id=({className:e,isActive:t,size:n="icon",...r})=>g.jsx("a",{"aria-current":t?"page":void 0,className:U(Tl({variant:t?"outline":"ghost",size:n}),e),...r});Id.displayName="PaginationLink";const AZ=({className:e,...t})=>g.jsxs(Id,{"aria-label":"Go to previous page",size:"default",className:U("gap-1 pl-2.5",e),...t,children:[g.jsx(xu,{className:"h-4 w-4"}),g.jsx("span",{children:"Previous"})]});AZ.displayName="PaginationPrevious";const TZ=({className:e,...t})=>g.jsxs(Id,{"aria-label":"Go to next page",size:"default",className:U("gap-1 pr-2.5",e),...t,children:[g.jsx("span",{children:"Next"}),g.jsx(Ri,{className:"h-4 w-4"})]});TZ.displayName="PaginationNext";const GP=({className:e,...t})=>g.jsxs("span",{"aria-hidden":!0,className:U("flex h-9 w-9 items-center justify-center",e),...t,children:[g.jsx(tv,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"More pages"})]});GP.displayName="PaginationEllipsis";const MZ=({className:e,...t})=>g.jsxs(Id,{"aria-label":"Go to next page",size:"default",className:U("gap-1 pr-2.5",e),...t,children:[g.jsx("span",{className:"sr-only",children:"Next Last"}),g.jsx(Ri,{className:"h-4 w-4"})]});MZ.displayName="PaginationNextLast";const NZ=({className:e,...t})=>g.jsxs(Id,{"aria-label":"Go to previous page",size:"default",className:U("gap-1 pl-2.5",e),...t,children:[g.jsx(xu,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous Last"})]});NZ.displayName="PaginationPreviousLast";const L7e=({totalPosts:e,postsPerPage:t,currentPage:n,setCurrentPage:r})=>{const o=[];for(let p=1;p<=Math.ceil(e/t);p++)o.push(p);const a=Math.floor(2/2),s=o.slice(Math.max(0,n-1-a),Math.min(n-1+a+1,o.length)),l=()=>{n<o.length&&r(n+1)},c=()=>{n>1&&r(n-1)},u=()=>{n>1&&r(1)},d=()=>{n<o.length&&r(o.length)},f=()=>{const p=s.map((h,m)=>g.jsx(tw,{className:n===h?"rounded-md bg-primary":"",children:g.jsx(Id,{onClick:()=>r(h),children:h})},m));return s[0]>1&&p.unshift(g.jsx(GP,{onClick:()=>r(s[0]-1)},"ellipsis-start")),s[s.length-1]<o.length&&p.push(g.jsx(GP,{onClick:()=>r(s[s.length-1]+1)},"ellipsis-end")),p};return g.jsx("div",{className:"p-4",children:g.jsx(OZ,{children:g.jsxs(PZ,{children:[g.jsxs(tw,{children:[g.jsx(NZ,{onClick:u}),g.jsx(AZ,{onClick:c})]}),f(),g.jsxs(tw,{children:[g.jsx(TZ,{onClick:l}),g.jsx(MZ,{onClick:d})]})]})})})},z7e=({columns:e,data:t,pageCount:n,pageSizeOptions:r=[10,20,30,40,50],className:o})=>{var b;const[i,a]=an.useSearchParams(),s=(i==null?void 0:i.get("page"))??"1",l=Number(s),c=isNaN(l)||l<1?1:l,u=(i==null?void 0:i.get("limit"))??"10",d=Number(u),f=isNaN(d)?10:d,[{pageIndex:p,pageSize:h},m]=E.useState({pageIndex:c-1,pageSize:f});E.useEffect(()=>{a({...Object.fromEntries(i),page:(p+1).toString(),limit:h.toString()})},[p,h,i,a]);const v=kY({data:t,columns:e,pageCount:n??-1,getCoreRowModel:SY(),getFilteredRowModel:EY(),state:{pagination:{pageIndex:p,pageSize:h}},onPaginationChange:m,getPaginationRowModel:_Y(),manualPagination:!0,manualFiltering:!0});return g.jsxs("div",{className:o,children:[g.jsxs(Hh,{className:"h-[calc(80vh-220px)] rounded-md border",children:[g.jsxs(Xb,{className:"relative",children:[g.jsx(Qb,{children:v.getHeaderGroups().map(w=>g.jsx(ss,{children:w.headers.map(x=>g.jsx(ew,{children:x.isPlaceholder?null:jb(x.column.columnDef.header,x.getContext())},x.id))},w.id))}),g.jsx(Jb,{children:(b=v.getRowModel().rows)!=null&&b.length?v.getRowModel().rows.map(w=>g.jsx(ss,{"data-state":w.getIsSelected()&&"selected",children:w.getVisibleCells().map(x=>g.jsx($d,{children:jb(x.column.columnDef.cell,x.getContext())},x.id))},w.id)):g.jsx(ss,{children:g.jsx($d,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]}),g.jsx(Wh,{orientation:"horizontal"})]}),g.jsxs("div",{className:"flex flex-col items-center justify-end gap-2 space-x-2 py-4 sm:flex-row",children:[g.jsxs("div",{className:"flex w-full items-center justify-between",children:[g.jsxs("div",{className:"flex-1 text-sm text-muted-foreground",children:[v.getFilteredSelectedRowModel().rows.length," of"," ",v.getFilteredRowModel().rows.length," row(s) selected."]}),g.jsx("div",{className:"flex flex-col items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx("p",{className:"whitespace-nowrap text-sm font-medium",children:"Rows per page"}),g.jsxs(Ei,{value:`${v.getState().pagination.pageSize}`,onValueChange:w=>{v.setPageSize(Number(w))},children:[g.jsx(zo,{className:"h-8 w-[70px]",children:g.jsx(_i,{placeholder:v.getState().pagination.pageSize})}),g.jsx(jo,{side:"top",children:r.map(w=>g.jsx(Pt,{value:`${w}`,children:w},w))})]})]})})]}),g.jsxs("div",{className:"flex w-full items-center justify-between gap-2 sm:justify-end",children:[g.jsxs("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",v.getState().pagination.pageIndex+1," of"," ",v.getPageCount()]}),g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(mt,{"aria-label":"Go to first page",variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>v.setPageIndex(0),disabled:!v.getCanPreviousPage(),children:g.jsx(wte,{className:"h-4 w-4","aria-hidden":"true"})}),g.jsx(mt,{"aria-label":"Go to previous page",variant:"outline",className:"h-8 w-8 p-0",onClick:()=>v.previousPage(),disabled:!v.getCanPreviousPage(),children:g.jsx(xu,{className:"h-4 w-4","aria-hidden":"true"})}),g.jsx(mt,{"aria-label":"Go to next page",variant:"outline",className:"h-8 w-8 p-0",onClick:()=>v.nextPage(),disabled:!v.getCanNextPage(),children:g.jsx(Ri,{className:"h-4 w-4","aria-hidden":"true"})}),g.jsx(mt,{"aria-label":"Go to last page",variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>v.setPageIndex(v.getPageCount()-1),disabled:!v.getCanNextPage(),children:g.jsx(Ste,{className:"h-4 w-4","aria-hidden":"true"})})]})]})]})]})};function j7e({key:e,data:t,handleAction:n,className:r}){return g.jsx(yc,{value:e,className:U("mt-4",r),children:g.jsx("div",{className:"h-40 w-full overflow-auto rounded-md border p-4",children:g.jsxs("table",{className:"w-full",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{className:"border p-2 text-left pb-2",children:"Note"}),g.jsx("th",{className:"border p-2 text-left pb-2",children:"Actions"})]})}),g.jsx("tbody",{children:t==null?void 0:t.map(o=>g.jsxs("tr",{children:[g.jsx("td",{className:"border p-2 text-left pb-2",children:o.text}),g.jsx("td",{className:"flex justify-left border p-2 text-center",children:g.jsx(eP,{link:"form-card",handleAction:n,Item:o})})]},o.id))})]})})})}const R7e={position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.5)",zIndex:9999};function B7e({show:e,className:t}){return e?g.jsx("div",{style:R7e,className:t}):null}function DZ({pageTitles:e={},defaultTitle:t="Default Title",className:n}){const r=an.useLocation(),o=e[r.pathname]||t;return g.jsx("header",{className:U("group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 flex h-12 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear",n),children:g.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[g.jsx(yO,{className:"-ml-1"}),g.jsx(wd,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),g.jsx("h1",{className:"text-xl font-bold",children:o})]})})}function $Z({items:e,...t}){return g.jsx(Jh,{...t,children:g.jsx(hb,{children:g.jsx(vc,{children:e.map(n=>g.jsx(os,{children:g.jsx(is,{asChild:!0,children:g.jsxs("a",{href:n.url,target:n.target||"",children:[g.jsx(n.icon,{}),g.jsx("span",{children:n.title})]})})},n.title))})})})}function YP({children:e}){return g.jsx(wu,{variant:"secondary",className:"ml-auto flex h-5 w-5 items-center justify-center rounded-full",children:e})}function V7e({item:e}){const{setOpenMobile:t}=rs(),n=an.useLocation();return g.jsx(i9,{asChild:!0,className:"group/collapsible",children:g.jsxs(os,{children:[g.jsx(a9,{asChild:!0,children:g.jsxs(is,{tooltip:e.title,children:[e.icon&&g.jsx(e.icon,{}),g.jsx("span",{children:e.title}),e.badge&&g.jsx(YP,{children:e.badge}),g.jsx(Ri,{className:"ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 rtl:rotate-180"})]})}),g.jsx(s9,{className:"CollapsibleContent",children:g.jsx(_O,{children:e.items.map(r=>g.jsx(kO,{children:g.jsx(OO,{asChild:!0,isActive:r.isActive||n.pathname===r.url,children:g.jsxs(an.Link,{to:r.url,onClick:()=>t(!1),children:[r.icon&&g.jsx(r.icon,{}),g.jsx("span",{children:r.title}),r.badge&&g.jsx(YP,{children:r.badge})]})})},r.title))})})]})})}function IZ({items:e,className:t}){const n=an.useLocation(),{setOpenMobile:r}=rs();return g.jsx(Jh,{className:t,children:g.jsx(hb,{className:"flex flex-col gap-2",children:g.jsx(vc,{children:e.map(o=>"items"in o&&o.items?g.jsx(V7e,{item:o},o.title):g.jsx(os,{children:g.jsx(is,{asChild:!0,tooltip:o.title,isActive:o.isActive||n.pathname===o.url,children:g.jsxs(an.Link,{to:o.url,onClick:()=>r(!1),children:[o.icon&&g.jsx(o.icon,{}),g.jsx("span",{children:o.title}),o.badge&&g.jsx(YP,{children:o.badge})]})})},o.title))})})})}function FZ({user:e,onLogout:t,menuItems:n=[],className:r}){const{isMobile:o}=rs();return g.jsx(vc,{children:g.jsx(os,{children:g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsxs(is,{size:"lg",className:U("data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",r),children:[g.jsxs(op,{className:"h-8 w-8 rounded-lg",children:[g.jsx(ip,{src:e.avatar,alt:e.name}),g.jsx(ap,{className:"rounded-lg",children:e.name.split(" ").map(i=>i[0]).join("").toUpperCase().slice(0,2)})]}),g.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[g.jsx("span",{className:"truncate font-medium",children:e.name}),g.jsx("span",{className:"truncate text-xs text-muted-foreground",children:e.email})]}),g.jsx(bx,{className:"ml-auto size-4"})]})}),g.jsxs(Bs,{className:"w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg",side:o?"bottom":"right",align:"end",sideOffset:4,children:[g.jsx($0,{className:"p-0 font-normal",children:g.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[g.jsxs(op,{className:"h-8 w-8 rounded-lg",children:[g.jsx(ip,{src:e.avatar,alt:e.name}),g.jsx(ap,{className:"rounded-lg",children:e.name.split(" ").map(i=>i[0]).join("").toUpperCase().slice(0,2)})]}),g.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[g.jsx("span",{className:"truncate font-medium",children:e.name}),g.jsx("span",{className:"truncate text-xs text-muted-foreground",children:e.email})]})]})}),g.jsx(rd,{}),n.map((i,a)=>g.jsxs(wr,{onClick:i.onClick,children:[i.icon&&g.jsx(i.icon,{className:"mr-2 h-4 w-4"}),i.label]},a)),n.length>0&&g.jsx(rd,{}),g.jsxs(wr,{onClick:t,children:[g.jsx(Xue,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})})})}function q7e({navMain:e=[],navSecondary:t=[],user:n,brandName:r="ACS Tracking",brandIcon:o=$ue,onLogout:i,userMenuItems:a,...s}){return g.jsxs(vO,{collapsible:"offcanvas",...s,children:[g.jsx(wO,{children:g.jsx(vc,{children:g.jsx(os,{children:g.jsx(is,{asChild:!0,className:"data-[slot=sidebar-menu-button]:!p-1.5",children:g.jsxs("a",{href:"#",children:[g.jsx(o,{className:"h-5 w-5"}),g.jsx("span",{className:"text-base font-semibold",children:r})]})})})})}),g.jsxs(SO,{children:[g.jsx(IZ,{items:e}),g.jsx($Z,{items:t,className:"mt-auto"})]}),g.jsx(xO,{children:n&&g.jsx(FZ,{user:n,onLogout:i,menuItems:a})})]})}function U7e({items:e,className:t}){const{isMobile:n}=rs();return g.jsxs(Jh,{className:U("group-data-[collapsible=icon]:hidden",t),children:[g.jsx(CO,{children:"Documents"}),g.jsxs(vc,{children:[e.map(r=>g.jsxs(os,{children:[g.jsx(is,{asChild:!0,children:g.jsxs("a",{href:r.url,children:[g.jsx(r.icon,{}),g.jsx("span",{children:r.name})]})}),g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsxs(EO,{showOnHover:!0,className:"rounded-sm data-[state=open]:bg-accent",children:[g.jsx(tv,{}),g.jsx("span",{className:"sr-only",children:"More"})]})}),g.jsxs(Bs,{className:"w-24 rounded-lg",side:n?"bottom":"right",align:n?"end":"start",children:[g.jsxs(wr,{children:[g.jsx(Uue,{}),g.jsx("span",{children:"Open"})]}),g.jsxs(wr,{children:[g.jsx(nde,{}),g.jsx("span",{children:"Share"})]})]})]})]},r.name)),g.jsx(os,{children:g.jsxs(is,{className:"text-sidebar-foreground/70",children:[g.jsx(tv,{className:"text-sidebar-foreground/70"}),g.jsx("span",{children:"More"})]})})]})]})}function H7e({children:e,sidebarProps:t,headerProps:n,defaultOpen:r=!0,showOverlay:o=!1,overlayComponent:i,className:a}){return g.jsx("div",{className:U("flex h-screen overflow-hidden bg-secondary",a),children:g.jsx("main",{className:"relative flex-1 overflow-y-auto bg-background focus:outline-none",children:g.jsxs(mO,{defaultOpen:r,children:[g.jsx(q7e,{variant:"inset",...t}),g.jsxs(bO,{children:[g.jsx(DZ,{...n}),g.jsx("div",{className:"flex flex-1 flex-col shadow-lg",children:g.jsx("div",{className:"@container/main flex flex-1 flex-col gap-2",children:g.jsxs("div",{className:"flex flex-col gap-4 py-4 md:gap-6 md:py-6",children:[e,o&&i]})})})]})]})})})}const W7e=({isOpen:e,onClose:t,onConfirm:n,loading:r,title:o="Are you sure?",description:i="Are you sure you want to continue?",className:a})=>g.jsx(Z0,{title:o,description:i,isOpen:e,onClose:t,className:a,children:g.jsxs("div",{className:"flex w-full items-center justify-end space-x-2 pt-6",children:[g.jsx(mt,{disabled:r,variant:"outline",onClick:t,children:"Cancel"}),g.jsx(mt,{disabled:r,variant:"destructive",onClick:n,children:"Continue"})]})}),K7e=({openDeleteDialog:e,setIsOpenDeleteDialog:t,onDelete:n,className:r})=>g.jsx("div",{className:"flex gap-3 mb-4",children:g.jsx(Z0,{isOpen:e,onClose:()=>t(!1),className:U("justify-center bg-transparent border-none",r),children:g.jsxs("div",{className:"rounded-md bg-gray-50 p-4 md:p-6",children:[g.jsx("p",{className:"text-black",children:"Are you sure you want to delete?"}),g.jsxs("div",{className:"flex items-center justify-between mt-4 space-x-4",children:[g.jsx(mt,{className:"flex-1 bg-red-500 disabled:bg-gray-500",onClick:n,children:"Yes"}),g.jsx(mt,{className:"flex-1",onClick:()=>t(!1),children:"No"})]})]})},"delete")}),G7e=({renderModal:e,modalName:t,showAddBtn:n=!0,title:r,userPopup:o=!1,extraBtns:i,isOpen:a,setIsOpen:s,isAllowedCreate:l=!0,className:c})=>{const u=()=>{s("")};return g.jsxs("div",{className:"flex justify-end",children:[g.jsxs("div",{className:"flex gap-2",children:[n&&l&&g.jsxs(mt,{className:"flex justify-end ml-auto text-xs md:text-sm ",onClick:()=>s(t??"create"),children:[g.jsx(xx,{className:"mr-2 h-4 w-4"})," Add New"]}),i&&i()]}),g.jsxs(Z0,{userPopup:o,isOpen:a,onClose:u,className:U("!bg-background !px-1 w-full lg:w-[85%]",c),children:[g.jsx("h5",{className:"text-2xl font-bold px-10",children:r??"Add Client"}),g.jsx(Hh,{className:"px-6",children:e(u)})]})]})},LZ=({onChange:e,startDate:t,endDate:n,className:r})=>{const[o,i]=y.useState({from:t,to:n}),[a,s]=y.useState(!1),l=()=>{e(o==null?void 0:o.from,o==null?void 0:o.to),s(!1)};return g.jsx(g.Fragment,{children:g.jsxs("div",{className:U("grid z-50",r),children:[g.jsx("label",{className:"mb-0 block text-md font-bold",children:"Pick a date"}),g.jsxs(dd,{open:a,children:[g.jsx(fd,{asChild:!0,onClick:()=>s(c=>!c),children:g.jsxs(mt,{id:"date",variant:"outline",className:U("w-[100%] justify-start text-left font-normal truncate overflow-hidden text-ellipsis",!o&&"text-muted-foreground"),children:[g.jsx(Aue,{className:"pr-2"}),o!=null&&o.from?o.to?g.jsxs(g.Fragment,{children:[Jo(o.from,"LLL dd, y")," -"," ",Jo(o.to,"LLL dd, y")]}):Jo(o.from,"LLL dd, y"):g.jsx("span",{children:"Pick a date"})]})}),g.jsxs(cc,{className:"w-auto p-0 ",align:"start",style:{left:"1rem"},children:[g.jsx(dp,{style:{left:"1rem"},mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:i,numberOfMonths:3}),g.jsx(mt,{onClick:l,className:"m-2",children:"Apply"})]})]})]})})},Y7e=({className:e,startDateParamName:t="filterStartDate",endDateParamName:n="filterEndDate"})=>{const r=new URLSearchParams(location.search),o=an.useNavigate(),i=(u,d)=>{u&&d&&(s(u==null?void 0:u.toISOString().split("T")[0]),c(d==null?void 0:d.toISOString().split("T")[0]),r.set(t,u.toISOString().split("T")[0]),r.set(n,d.toISOString().split("T")[0]),o({search:r.toString()}))};E.useEffect(()=>{const u=r.get(t)??dM(new Date).toISOString().split("T")[0],d=r.get(n)??_f(new Date,3).toISOString().split("T")[0];s(u),c(d)},[location.search]);const[a,s]=E.useState(()=>r.get(t)??dM(new Date).toISOString().split("T")[0]),[l,c]=E.useState(()=>r.get(n)??_f(new Date,3).toISOString().split("T")[0]);return g.jsx(LZ,{startDate:new Date(a+"T00:00"),endDate:new Date(l+"T00:00"),onChange:i,className:`pt-0 ${e}`})};function Z7e(e,t,n,r){var o=this,i=E.useRef(null),a=E.useRef(0),s=E.useRef(0),l=E.useRef(null),c=E.useRef([]),u=E.useRef(),d=E.useRef(),f=E.useRef(e),p=E.useRef(!0);f.current=e;var h=typeof window<"u",m=!t&&t!==0&&h;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(n=n||{}).leading,b=!("trailing"in n)||!!n.trailing,w="maxWait"in n,x="debounceOnServer"in n&&!!n.debounceOnServer,S=w?Math.max(+n.maxWait||0,t):null;E.useEffect(function(){return p.current=!0,function(){p.current=!1}},[]);var C=E.useMemo(function(){var _=function(D){var $=c.current,G=u.current;return c.current=u.current=null,a.current=D,s.current=s.current||D,d.current=f.current.apply(G,$)},k=function(D,$){m&&cancelAnimationFrame(l.current),l.current=m?requestAnimationFrame(D):setTimeout(D,$)},O=function(D){if(!p.current)return!1;var $=D-i.current;return!i.current||$>=t||$<0||w&&D-a.current>=S},P=function(D){return l.current=null,b&&c.current?_(D):(c.current=u.current=null,d.current)},A=function D(){var $=Date.now();if(v&&s.current===a.current&&T(),O($))return P($);if(p.current){var G=t-($-i.current),z=w?Math.min(G,S-($-a.current)):G;k(D,z)}},T=function(){r&&r({})},N=function(){if(h||x){var D=Date.now(),$=O(D);if(c.current=[].slice.call(arguments),u.current=o,i.current=D,$){if(!l.current&&p.current)return a.current=i.current,k(A,t),v?_(i.current):d.current;if(w)return k(A,t),_(i.current)}return l.current||k(A,t),d.current}};return N.cancel=function(){var D=l.current;D&&(m?cancelAnimationFrame(l.current):clearTimeout(l.current)),a.current=0,c.current=i.current=u.current=l.current=null,D&&r&&r({})},N.isPending=function(){return!!l.current},N.flush=function(){return l.current?P(Date.now()):d.current},N},[v,w,t,S,b,m,h,x,r]);return C}function X7e(e,t){return e===t}function Q7e(e,t,n){var r=X7e,o=E.useRef(e),i=E.useState({})[1],a=Z7e(E.useCallback(function(l){o.current=l,i({})},[i]),t,n,i),s=E.useRef(e);return r(s.current,e)||(a(e),s.current=e),[o.current,a]}const J7e=({placeholder:e,className:t})=>{const[n,r]=an.useSearchParams(),o=n.get("search")||"",[i,a]=E.useState(o),[s]=Q7e(i,1e3),l=E.useCallback(c=>{if(c===""||c===void 0||!c){n.delete("search"),r(n);return}r({...Object.fromEntries(n),page:"1",search:c})},[n,r]);return E.useEffect(()=>{l(s)},[s,l]),g.jsx(xi,{placeholder:e||"Search country...",value:i,onChange:c=>a(c.target.value),className:U("w-full md:max-w-sm",t)})},zZ=({title:e,description:t,className:n})=>g.jsxs("div",{className:n,children:[g.jsx("h2",{className:"text-sm font-bold t sm:text-xl xs:hidden",children:e}),g.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),e9e=({title:e="Kutubi"})=>g.jsx(Pae,{children:g.jsxs("title",{children:[" ",e," "]})}),jZ=({setTheme:e,className:t})=>g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsxs(mt,{variant:"outline",size:"icon",className:t,children:[g.jsx(ode,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),g.jsx(NI,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),g.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),g.jsxs(Bs,{align:"end",children:[g.jsx(wr,{onClick:()=>e("light"),children:"Light"}),g.jsx(wr,{onClick:()=>e("dark"),children:"Dark"}),g.jsx(wr,{onClick:()=>e("pink"),children:"Pink"}),g.jsx(wr,{onClick:()=>e("system"),children:"System"})]})]}),RZ=({user:e,onLogout:t,className:n})=>{var r;return g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsx(mt,{variant:"ghost",className:U("relative h-12 w-14 rounded-full",n),children:g.jsxs(op,{className:"h-12 w-12",children:[g.jsx(ip,{src:(e==null?void 0:e.avatar)||"https://png.pngtree.com/png-clipart/20230927/original/pngtree-man-avatar-image-for-profile-png-image_13001882.png",alt:(e==null?void 0:e.name)||""}),g.jsx(ap,{children:((r=e==null?void 0:e.name)==null?void 0:r.substring(0,2).toUpperCase())||"U"})]})})}),g.jsxs(Bs,{className:"w-56",align:"end",forceMount:!0,children:[g.jsx($0,{className:"font-normal",children:g.jsxs("div",{className:"flex flex-col space-y-1",children:[g.jsx("p",{className:"text-sm font-medium leading-none",children:e==null?void 0:e.name}),g.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:e==null?void 0:e.email})]})}),g.jsx(rd,{}),g.jsx(wr,{onClick:t,children:"Log out"})]})]})},t9e=({title:e="App Title",onLogout:t,user:n,setTheme:r,extraContent:o,className:i})=>g.jsxs("div",{className:U("flex flex-1 items-center bg-secondary px-4",i),children:[g.jsx(zZ,{title:e}),g.jsxs("div",{className:"ml-4 flex items-center md:ml-6",children:[g.jsx(RZ,{user:n,onLogout:t}),g.jsx(jZ,{setTheme:r}),o,g.jsx("h2",{className:"text-xl font-bold tracking-tight text-primary sm:text-3xl sm:hidden",children:e.substring(0,3).toUpperCase()})]})]}),n9e=({item:e,setOpen:t})=>{const n=typeof e.icon=="string"?q0[e.icon]||q0.arrowRight:e.icon||q0.arrowRight;return g.jsx("div",{className:"space-y-3",onClickCapture:()=>{t&&t(!1)},children:g.jsxs(an.NavLink,{className:({isActive:r})=>U("flex transform items-center rounded-full px-3 py-2 text-gray-200 transition-colors duration-300 hover:bg-gray-50 hover:text-primary hover:dark:text-black ",r&&"bg-gray-50 text-primary dark:text-black"),to:e.href,end:!0,children:[g.jsx(n,{className:"h-5 w-5","aria-hidden":"true"}),g.jsx("span",{className:"mx-2 text-sm font-medium",children:e.label})]})},e.href)},ZP=({items:e,setOpen:t,className:n})=>e!=null&&e.length?g.jsx("nav",{className:U("-mx-3 space-y-6",n),children:e.filter(r=>r.isShow!==!1).map(r=>g.jsx(n9e,{item:r,setOpen:t},r.href))}):null,r9e=({navItems:e,logoText:t="Logo",logoHref:n="/",className:r})=>g.jsxs("aside",{className:U("hidden h-screen w-64 flex-col overflow-y-auto overflow-x-hidden rounded-tr-[90px] border-r bg-primary py-8 pl-5 dark:bg-background lg:flex",r),children:[g.jsx(an.Link,{to:n,className:"text-3xl font-bold text-white",children:t}),g.jsx("div",{className:"mt-6 flex flex-1 flex-col justify-between",children:g.jsx(ZP,{items:e})})]}),o9e=({setSidebarOpen:e,sidebarOpen:t,navItems:n,logoText:r="Logo",logoHref:o="/",className:i})=>g.jsx(g.Fragment,{children:g.jsx(Rh,{open:t,onOpenChange:e,children:g.jsx(sd,{side:"left",className:U("bg-background !px-0",i),children:g.jsx("div",{className:"space-y-4 py-4",children:g.jsxs("div",{className:"space-y-4 px-3 py-2",children:[g.jsx(an.Link,{to:o,className:"py-2 text-2xl font-bold text-white ",children:r}),g.jsx("div",{className:"space-y-1 px-2",children:g.jsx(ZP,{items:n,setOpen:e})})]})})})})}),BZ=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ie(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},VZ=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?BZ(r.ref,n,e):r.refs&&r.refs.forEach(o=>BZ(o,n,e))}},i9e=(e,t)=>{t.shouldUseNativeValidation&&VZ(e,t);const n={};for(const r in e){const o=Ie(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(a9e(t.names||Object.keys(e),r)){const a=Object.assign({},Ie(n,r));$t(a,"root",i),$t(n,r,a)}else $t(n,r,i)}return n},a9e=(e,t)=>e.some(n=>n.startsWith(t+"."));var s9e=function(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[a]={message:s.message,type:s.code}}else n[a]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var l=n[a].types,c=l&&l[r.code];n[a]=yV(a,t,n,o,c?[].concat(c,r.message):r.message)}e.shift()}return n},l9e=function(e,t,n){return n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve((function(a,s){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return i.shouldUseNativeValidation&&VZ({},i),{errors:{},values:n.raw?r:c}})}catch(c){return s(c)}return l&&l.then?l.then(void 0,s):l})(0,function(a){if((function(s){return Array.isArray(s==null?void 0:s.errors)})(a))return{values:{},errors:i9e(s9e(a.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw a}))}catch(a){return Promise.reject(a)}}};function c9e(){const{pathname:e}=an.useLocation();return E.useMemo(()=>e,[e])}function qZ(){const e=an.useNavigate();return E.useMemo(()=>({back:()=>e(-1),forward:()=>e(1),reload:()=>window.location.reload(),push:n=>e(n),replace:n=>e(n,{replace:!0})}),[e])}function UZ({loading:e,edit:t,showCancelBtn:n,showNewBtn:r,onClick:o,className:i}){const a=E.useContext(yi),s=a==null?void 0:a.reset;return g.jsxs("div",{className:U("m-2 flex justify-end gap-4",i),children:[n&&g.jsx(mt,{type:"button",className:"flex h-10 items-center rounded-lg bg-gray-100 px-4 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-200",children:"Cancel"}),r&&g.jsx(mt,{type:"button",variant:"outline",onClick:()=>s==null?void 0:s(),className:"flex h-10 items-center rounded-lg px-4 text-sm font-medium transition-colors",disabled:e,"aria-disabled":e,children:"New"}),t&&g.jsx(mt,{type:"submit",onClick:o,className:"flex h-10 items-center rounded-lg px-4 text-sm font-medium transition-colors",disabled:e,"aria-disabled":e,children:e?"please wait..":"Submit"})]})}function u9e(e){const t={};return Object.keys(e||{}).forEach(n=>{t[n]=Xje()}),wZ(t)}function d9e(e,t){if(!t)return e;const n=new FormData;for(const r in e)if(t[r]!==void 0){const o=t[r](e[r]);if(o==null)continue;Array.isArray(o)?o.forEach(i=>{n.append(`${r}[]`,i)}):n.append(r,o)}else n.append(r,e[r]);return n}function f9e({item:e,url:t,redirectUrl:n,edit:r=!0,showCancelBtn:o=!1,showNewBtn:i=!0,onSave:a,onReset:s,onError:l,children:c,resetForm:u=!1,validationSchema:d,requestHeaders:f,dataFormatter:p,baseURL:h="",multipartUrls:m=[]}){const v=qZ(),{toast:b}=Cb(),w=E.useRef(null),[x,S]=E.useState(!1),[C,_]=E.useState(e),[k,O]=E.useState(!(e!=null&&e.id)),P=Jf(),[A,T]=XD(t,{baseURL:h,customHeaders:f??{},multipartUrls:m}),{isAllowed:N,getResourceByUrl:D}=hd(),$=e!=null&&e.id?r?pd.Update:pd.Read:pd.Create,[G,z]=E.useState(!0);E.useEffect(()=>{z(N($,D(t)))},[$,D,N,t]);const K=d??u9e(e||{}),R=FV({defaultValues:E.useMemo(()=>e||void 0,[e]),resolver:l9e(K)}),W=()=>{R.reset(),_(void 0),O(!0),s&&s()};E.useEffect(()=>{_(e),e&&Object.keys(e).length>0&&Object.keys(R.getValues()).forEach(H=>{R.setValue(H,e[H])}),O(!(e!=null&&e.id))},[e,R]);const Z=()=>{var H;(H=w.current)==null||H.requestSubmit()},te={...R,errors:R.formState.errors,create:k,edit:r,itemState:C,submit:Z,reset:W,formState:R.formState},V=R.handleSubmit(async(H,F)=>{var ae,Q,X,q,J,se,I,Ce,oe,ve,De,je;F==null||F.preventDefault(),S(!0);const ee=p?d9e(H,p):H;if(k){const fe=b({title:"Please wait ..."});try{const pe=await P.post(A,ee,T);n&&n!=="#"&&v.push(n),b({title:((ae=pe.data)==null?void 0:ae.message)??"Success",description:Mf(new Date)}),u&&W(),a==null||a(((Q=pe.data)==null?void 0:Q.data)??pe.data,"add")}catch(pe){l==null||l(pe);const Re=((q=(X=pe==null?void 0:pe.response)==null?void 0:X.data)==null?void 0:q.message)||(pe==null?void 0:pe.message)||"Something went wrong";R.setError("root",{message:Yw(Re)}),b({title:((se=(J=pe==null?void 0:pe.response)==null?void 0:J.data)==null?void 0:se.error)??"Request failed",description:Mf(new Date),variant:"destructive"})}finally{fe.dismiss(),S(!1)}return}if(r){const fe=b({title:"Please wait ..."});try{const pe=await P.patch(`${A}/${C==null?void 0:C.id}`,ee,T);b({title:((I=pe.data)==null?void 0:I.message)??"Success",description:Mf(new Date)}),a==null||a(((Ce=pe.data)==null?void 0:Ce.data)??pe.data,"edit"),u&&W()}catch(pe){l==null||l(pe);const Re=((ve=(oe=pe==null?void 0:pe.response)==null?void 0:oe.data)==null?void 0:ve.message)||(pe==null?void 0:pe.message)||"Something went wrong";R.setError("root",{message:Yw(Re)}),b({title:((je=(De=pe==null?void 0:pe.response)==null?void 0:De.data)==null?void 0:je.error)??"Request failed",description:Mf(new Date),variant:"destructive"})}finally{fe.dismiss(),S(!1)}}});return g.jsx(zN,{fallback:g.jsx("div",{children:"Something went wrong. Please try again."}),onError:H=>{console.error("Form Error:",H),l==null||l(H)},children:g.jsx(yi.Provider,{value:te,children:g.jsx("form",{onSubmit:V,ref:w,children:G?g.jsx("div",{className:`rounded-md flex flex-col ${t==="/login"?"h-[90vh]":""}`,children:g.jsx("div",{className:"rounded-md bg-white dark:bg-stone-950 flex-1 overflow-auto p-4",children:g.jsxs(Dx,{className:"p-4",children:[c,R.formState.errors.root&&g.jsxs(X1,{variant:"destructive",className:"mt-2",children:[g.jsx(Due,{className:"h-4 w-4"}),g.jsx(Q1,{children:"Error"}),g.jsx(J1,{children:g.jsx("p",{dangerouslySetInnerHTML:{__html:R.formState.errors.root.message??""}})})]}),g.jsx("div",{className:"p-4 bg-white dark:bg-stone-950 border-t sticky bottom-0 z-10",children:g.jsx(UZ,{showNewBtn:i,loading:x,showCancelBtn:o,edit:r})})]})})}):g.jsx("div",{className:"text-center font-bold w-full text-stone-600",children:"Not Allowed"})})})})}const HZ=y.forwardRef(({onFileSelect:e,accept:t="*/*",validationRules:n={maxSize:5*1024*1024,acceptedTypes:void 0},children:r,...o},i)=>{const a=E.useRef(null),{toast:s}=Cb(),l=d=>{if(n.maxSize&&d.size>n.maxSize){const f=n.maxSize/1048576;return s({title:"File too large",description:`File size should be less than ${f}MB`,variant:"destructive"}),!1}if(n.acceptedTypes&&n.acceptedTypes.length>0&&!n.acceptedTypes.includes(d.type))return s({title:"Invalid file type",description:`Please select: ${n.acceptedTypes.join(", ")}`,variant:"destructive"}),!1;if(n.customValidation){const f=n.customValidation(d);if(typeof f=="string")return s({title:"File validation failed",description:f,variant:"destructive"}),!1;if(!f)return s({title:"File validation failed",variant:"destructive"}),!1}return!0},c=d=>{var p;const f=(p=d.target.files)==null?void 0:p[0];f&&(l(f)&&(e==null||e(f),s({title:"File selected",description:f.name})),d.target.value="")},u=d=>{var f,p;d.preventDefault(),(f=a.current)==null||f.click(),(p=o.onClick)==null||p.call(o,d)};return g.jsxs("div",{className:"flex flex-col items-center",children:[g.jsx("input",{type:"file",ref:a,className:"hidden",accept:t,onChange:c}),g.jsx(mt,{...o,onClick:u,ref:i,children:r})]})});HZ.displayName="FileUploadButton";function p9e({title:e,name:t,icon:n,placeholder:r,selected:o,options:i=[],onTypeing:a,otherOption:s,onChange:l,className:c,hidden:u,disabled:d},f){const p=E.useContext(yi),[h,m]=y.useState(!1),[v,b]=y.useState(i);y.useEffect(()=>{b(i||[])},[i]);const w=x=>{const S=v.find(C=>String(C.value)===String(x));return S?S.label:s&&String(x)==="0"?s:""};return g.jsx(es,{control:p==null?void 0:p.control,name:t,render:({field:x})=>{const S=x.value??o??"",C=w(S);return u?g.jsx(g.Fragment,{}):g.jsxs(bi,{className:U("mb-2",c),children:[e?g.jsxs(wi,{className:"font-bold flex items-center gap-2",children:[n||null,e]}):null,g.jsx(ts,{children:g.jsxs(dd,{open:h,onOpenChange:m,children:[g.jsx(fd,{asChild:!0,children:g.jsxs(mt,{ref:f,type:"button",variant:"outline",role:"combobox","aria-expanded":h,className:U("w-full justify-between truncate overflow-hidden text-ellipsis",d&&"opacity-60 cursor-not-allowed"),disabled:d,children:[g.jsx("span",{className:"truncate w-full text-left",children:C||r||"Select..."}),g.jsx(TI,{className:"opacity-50 flex-shrink-0"})]})}),!d&&g.jsx(cc,{className:"w-full p-0",children:g.jsxs(gh,{children:[g.jsx(p0,{placeholder:r,className:"h-9",onValueChange:a}),g.jsxs(h0,{children:[g.jsx(g0,{children:"No item found."}),g.jsxs(m0,{children:[s&&g.jsxs(Zu,{value:`0 ${s}`,onSelect:()=>{x.onChange("0"),l==null||l(ei(t,"0")),m(!1)},children:[s,g.jsx(Oa,{className:U("ml-auto",String(S)==="0"?"opacity-100":"opacity-0")})]},"__other__"),v.map(_=>g.jsxs(Zu,{value:`${_.value} ${_.label}`,onSelect:()=>{const k=String(_.value),O=String(S)===k?"":k;x.onChange(O),l==null||l(ei(t,O)),m(!1)},children:[_.label,g.jsx(Oa,{className:U("ml-auto",String(S)===String(_.value)?"opacity-100":"opacity-0")})]},String(_.value)))]})]})]})})]})}),g.jsx(ns,{className:"h-auto min-h-2"})]})}})}const h9e=y.forwardRef(p9e);function g9e({title:e,name:t,placeholder:n,className:r,selected:o,options:i,onChange:a,...s},l){const c=E.useContext(yi),[u,d]=E.useState(""),[f,p]=E.useState(i||[]),h=v=>String(v.value)+v.label;E.useEffect(()=>{Array.isArray(i)&&i.length>0&&p([...i])},[i]);const m=typeof(c==null?void 0:c.watch)=="function"?c==null?void 0:c.watch(t):o;return E.useEffect(()=>{const v=f.filter(b=>String(b.value)===String(m));v.length>0?d(h(v[0])):d("")},[f,m]),c?g.jsx(es,{control:c.control,name:t,render:({field:v})=>g.jsxs(bi,{className:`mb-2 ${r??""}`,children:[e&&g.jsx(wi,{children:e}),g.jsxs(Ei,{onValueChange:b=>{const w=b===u?"":b;d(w),a&&a(ei(t,w)),v.onChange(w)},defaultValue:String(v.value??""),children:[g.jsx(ts,{children:g.jsx(zo,{children:g.jsx(_i,{placeholder:s.otherOption?"":n||"Select"})})}),g.jsxs(jo,{children:[s.otherOption&&g.jsx(Pt,{value:"0",children:"Please Select"}),f.map(b=>g.jsx(Pt,{value:String(b.value),children:b.label},b.value))]})]}),g.jsx(ns,{className:"mt-1 h-auto min-h-2"})]})}):null}const m9e=E.forwardRef(g9e);function v9e(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function y9e({title:e,name:t,placeholder:n,className:r,error:o},i){var m,v;const a=E.useContext(yi),s=a==null?void 0:a.watch(t),[l,c]=y.useState((m=a==null?void 0:a.getValues)!=null&&m.call(a)[t]?new Date(String((v=a.getValues)==null?void 0:v.call(a)[t])+"T00:00:00"):void 0),[u,d]=y.useState(l||new Date);E.useEffect(()=>{if(!a)return;const b=l?v9e(l):void 0;a.setValue(t,b)},[l,a,t]),E.useEffect(()=>{a&&(s?typeof s=="string"&&c(new Date(s+"T00:00")):c(void 0))},[s,a]);const f=b=>{d(b)},p=b=>{const w=parseInt(b,10),x=new Date(u.setFullYear(w));d(x)},h=Array.from(new Array(200),(b,w)=>u.getFullYear()-100+w);return a?g.jsx(es,{control:a.control,name:t,render:()=>g.jsxs(bi,{className:`mb-2 ${r??""}`,children:[e&&g.jsx(wi,{children:e}),g.jsxs(dd,{children:[g.jsx(fd,{asChild:!0,children:g.jsxs(mt,{variant:"outline",className:U("w-full justify-start text-left font-normal",!l&&"text-muted-foreground",o?"border-red-300":"border-gray-200"),children:[g.jsx(TT,{className:"mr-2 h-4 w-4"}),l?Jo(l,"PPP"):g.jsx("span",{children:n})]})}),g.jsxs(cc,{style:{width:"fit-content"},className:"p-0",children:[g.jsxs(Ei,{value:u.getFullYear()+"",onValueChange:p,children:[g.jsx(zo,{className:"rounded-none shadow-none",children:g.jsx(_i,{placeholder:"Select a Year"})}),g.jsx(jo,{children:h.map(b=>g.jsx(Pt,{value:b+"",children:b},b))})]}),g.jsx(dp,{mode:"single",selected:l,onSelect:c,month:u,onMonthChange:f,initialFocus:!0})]})]}),g.jsx(ns,{className:"h-auto min-h-2"})]})}):null}const b9e=y.forwardRef(y9e);function w9e({title:e,placeholder:t,name:n,items:r,className:o,disabled:i,onChange:a}){const s=E.useContext(yi);return s?g.jsx(es,{control:s.control,name:n,render:()=>g.jsxs(bi,{className:`mb-3 ${o??""}`,children:[g.jsxs("div",{className:"mb-3",children:[e&&g.jsx(wi,{className:"text-base",children:e}),t&&g.jsx(yk,{children:t})]}),r.map(l=>g.jsx(es,{control:s.control,name:n,render:({field:c})=>{const u=c.value,d=Array.isArray(u)?u==null?void 0:u.includes(l.value):String(u)===String(l.value);return g.jsxs(bi,{className:"flex flex-row items-start space-x-3 space-y-0",children:[g.jsx(ts,{children:g.jsx(fh,{disabled:i,checked:l.checked||d,onCheckedChange:f=>{let p=[l.value];return Array.isArray(u)&&u&&(p=[...u,...p]),a&&a(ei(n,String(l.value??""))),f?c.onChange(r.length===1?l.value:p):c.onChange(Array.isArray(u)?u==null?void 0:u.filter(h=>h!==l.value):"")}})}),g.jsx(wi,{className:"text-sm font-normal",children:l.label})]})}},l.value)),g.jsx(ns,{className:"h-auto min-h-2"})]})}):null}function x9e({title:e,name:t,items:n,onChange:r,vertical:o=!1},i){const a=E.useContext(yi);return a?g.jsx(es,{control:a.control,name:t,render:({field:s})=>g.jsxs(bi,{className:"mb-2",children:[e&&g.jsx(wi,{children:e}),g.jsx(ts,{children:g.jsx(Kk,{onValueChange:l=>{r==null||r(ei(t,l)),s.onChange(l)},defaultValue:s.value,className:o?"flex flex-col space-y-1":"flex flex-row flex-wrap gap-4",children:n.map(l=>g.jsxs(bi,{className:"flex items-center space-x-3 space-y-0",children:[g.jsx(ts,{children:g.jsx(Gk,{value:String(l.value),checked:String(l.value)===String(s.value)})}),g.jsxs(wi,{className:"font-normal flex gap-2 ml-1 pt-1",children:[l.title,l.icon&&E.cloneElement(l.icon,{className:"h-4 w-4"})]})]},l.title))})}),g.jsx(ns,{className:"h-auto min-h-2"})]})}):null}const S9e=E.forwardRef(x9e);function C9e({title:e,name:t,type:n,placeholder:r,className:o,...i},a){const s=E.useContext(yi),l=c=>c.replace(/\D/g,"").replace(/(\d{4})(?=\d)/g,"$1 ");return s?g.jsx(es,{control:s.control,name:t,render:({field:c})=>i.hidden?g.jsx(g.Fragment,{}):g.jsxs(bi,{className:U("mb-2",o),children:[e?g.jsxs(wi,{className:"font-bold",children:[e,n==="date"&&c.value?g.jsxs("span",{className:"text-orange-500 ml-1",children:["(",new Date(String(c.value)).toUTCString().substring(5,11),")"]}):null]}):null,g.jsx(ts,{children:n==="textarea"?g.jsx(IO,{placeholder:r,...c,...i,value:c.value??i.value??"",ref:a}):g.jsx(xi,{type:n,placeholder:r,...c,...i,value:c.value??i.value??"",onChange:u=>{const d=n==="cardNumber"?l(u.target.value):u.target.value;c.onChange(d)},ref:a})}),g.jsx(ns,{className:"h-auto min-h-2"})]})}):null}const E9e=E.forwardRef(C9e);function WZ(e){return/^\d{1,}$/.test(e)}function _9e({title:e,name:t,type:n,placeholder:r,error:o,onChange:i,...a},s){const l=E.useContext(yi),[c,u]=E.useState(null),[d,f]=E.useState(null),p=l==null?void 0:l.watch(t);E.useEffect(()=>{if(!l)return;const v=l.getValues(t);try{u(Number(v==null?void 0:v.split(":")[0])),f(Number(v==null?void 0:v.split(":")[1]))}catch{u(0),f(0)}},[l,t]),E.useEffect(()=>{if(l)try{const v=p==null?void 0:p.split(":")[0],b=p==null?void 0:p.split(":")[1];v&&WZ(v)&&Number(v)!==Number(c)&&u(Number(v)),b&&WZ(b)&&Number(b)!==Number(d)&&f(Number(b))}catch{u(0),f(0)}},[p,l,c,d,t]),E.useEffect(()=>{var w;if(!l||c==null||d==null)return;const v=String(c).padStart(2,"0")+":"+String(d).padStart(2,"0"),b=((w=l.getValues(t))==null?void 0:w.split(":").length)===3?":00":"";if(v+b!==l.getValues(t)&&(l.setValue(t,v),i)){const x=ei(t,v);i(x)}},[d,c,l,t,i]);const h=v=>{f(Number(v.target.value))},m=v=>{u(Number(v.target.value))};return g.jsxs("div",{className:`mb-2 ${a.className??""}`,children:[e&&g.jsx("label",{htmlFor:t,className:`mb-2 block text-sm font-bold ${a.className??""}`,children:e}),g.jsxs("div",{className:"relative inline-flex",children:[g.jsx("input",{id:`${t}-hours`,name:`${t}-hours`,type:"number",disabled:a.disabled,onChange:m,value:String(c??0).padStart(2,"0"),min:"0",placeholder:r,className:`h-9 peer block w-full ${a.disabled?"":"cursor-pointer"} rounded-md border ${["time"].includes(String(n))?"py-0":"py-2"} pl-10 text-sm outline-2 placeholder:text-gray-500 ${o?"border-red-300":"border-gray-200"} ${a.disabled?"text-gray-400":"text-black"} p-1`,ref:s}),g.jsx("div",{className:"self-center p-2 text-2xl",children:":"}),g.jsx("input",{id:`${t}-minutes`,name:`${t}-minutes`,type:"number",disabled:a.disabled,onChange:h,value:String(d??0).padStart(2,"0"),placeholder:r,min:"0",className:`h-9 peer block w-full ${a.disabled?"":"cursor-pointer"} rounded-md border ${["time"].includes(String(n))?"":"py-2"} pl-10 text-sm outline-2 placeholder:text-gray-500 ${o?"border-red-300":"border-gray-200"} ${a.disabled?"text-gray-400":"text-black"} p-1`,ref:s})]}),o&&g.jsx("p",{className:"text-xs italic text-red-500 mt-2",children:o})]})}const k9e=E.forwardRef(_9e);var nw={exports:{}},rw={exports:{}},At={};/** @license React v16.13.1
|
|
523
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const d=u[1];if(t===u[0]){i(u);continue}if(e.external){const p=(l=e.external.registry.get(u[0]))==null?void 0:l.id;if(t!==u[0]&&p){i(u);continue}}if((c=e.metadataRegistry.get(u[0]))==null?void 0:c.id){i(u);continue}if(d.cycle){i(u);continue}if(d.count>1&&e.reused==="ref"){i(u);continue}}}function pZ(e,t){var a,s,l;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=c=>{const u=e.seen.get(c);if(u.ref===null)return;const d=u.def??u.schema,f={...d},p=u.ref;if(u.ref=null,p){r(p);const m=e.seen.get(p),v=m.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),c._zod.parent===p)for(const w in d)w==="$ref"||w==="allOf"||w in f||delete d[w];if(v.$ref)for(const w in d)w==="$ref"||w==="allOf"||w in m.def&&JSON.stringify(d[w])===JSON.stringify(m.def[w])&&delete d[w]}const h=c._zod.parent;if(h&&h!==p){r(h);const m=e.seen.get(h);if(m!=null&&m.schema.$ref&&(d.$ref=m.schema.$ref,m.def))for(const v in d)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(d[v])===JSON.stringify(m.def[v])&&delete d[v]}e.override({zodSchema:c,jsonSchema:d,path:u.path??[]})};for(const c of[...e.seen.entries()].reverse())r(c[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const c=(s=e.external.registry.get(t))==null?void 0:s.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Object.assign(o,n.def??n.schema);const i=((l=e.external)==null?void 0:l.defs)??{};for(const c of e.seen.entries()){const u=c[1];u.def&&u.defId&&(i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Yb(t,"input",e.processors),output:Yb(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function $r(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return $r(r.element,n);if(r.type==="set")return $r(r.valueType,n);if(r.type==="lazy")return $r(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return $r(r.innerType,n);if(r.type==="intersection")return $r(r.left,n)||$r(r.right,n);if(r.type==="record"||r.type==="map")return $r(r.keyType,n)||$r(r.valueType,n);if(r.type==="pipe")return $r(r.in,n)||$r(r.out,n);if(r.type==="object"){for(const o in r.shape)if($r(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if($r(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if($r(o,n))return!0;return!!(r.rest&&$r(r.rest,n))}return!1}const qze=(e,t={})=>n=>{const r=dZ({...n,processors:t});return dr(e,r),fZ(r,e),pZ(r,e)},Yb=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},a=dZ({...o??{},target:i,io:t,processors:n});return dr(e,a),fZ(a,e),pZ(a,e)},Uze={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Hze=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:i,maximum:a,format:s,patterns:l,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(o.minLength=i),typeof a=="number"&&(o.maxLength=a),s&&(o.format=Uze[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),c&&(o.contentEncoding=c),l&&l.size>0){const u=[...l];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Wze=(e,t,n,r)=>{const o=n,{minimum:i,maximum:a,format:s,multipleOf:l,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;typeof s=="string"&&s.includes("int")?o.type="integer":o.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u),typeof i=="number"&&(o.minimum=i,typeof u=="number"&&t.target!=="draft-04"&&(u>=i?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof a=="number"&&(o.maximum=a,typeof c=="number"&&t.target!=="draft-04"&&(c<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof l=="number"&&(o.multipleOf=l)},Kze=(e,t,n,r)=>{n.not={}},Gze=(e,t,n,r)=>{},Yze=(e,t,n,r)=>{},Zze=(e,t,n,r)=>{const o=e._zod.def,i=AY(o.entries);i.every(a=>typeof a=="number")&&(n.type="number"),i.every(a=>typeof a=="string")&&(n.type="string"),n.enum=i},Xze=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Qze=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Jze=(e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=dr(i.element,t,{...r,path:[...r.path,"items"]})},eje=(e,t,n,r)=>{var c;const o=n,i=e._zod.def;o.type="object",o.properties={};const a=i.shape;for(const u in a)o.properties[u]=dr(a[u],t,{...r,path:[...r.path,"properties",u]});const s=new Set(Object.keys(a)),l=new Set([...s].filter(u=>{const d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(o.required=Array.from(l)),((c=i.catchall)==null?void 0:c._zod.def.type)==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=dr(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},tje=(e,t,n,r)=>{const o=e._zod.def,i=o.inclusive===!1,a=o.options.map((s,l)=>dr(s,t,{...r,path:[...r.path,i?"oneOf":"anyOf",l]}));i?n.oneOf=a:n.anyOf=a},nje=(e,t,n,r)=>{const o=e._zod.def,i=dr(o.left,t,{...r,path:[...r.path,"allOf",0]}),a=dr(o.right,t,{...r,path:[...r.path,"allOf",1]}),s=c=>"allOf"in c&&Object.keys(c).length===1,l=[...s(i)?i.allOf:[i],...s(a)?a.allOf:[a]];n.allOf=l},rje=(e,t,n,r)=>{const o=e._zod.def,i=dr(o.innerType,t,r),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},oje=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},ije=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},aje=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},sje=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=a},lje=(e,t,n,r)=>{const o=e._zod.def,i=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;dr(i,t,r);const a=t.seen.get(e);a.ref=i},cje=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},hZ=(e,t,n,r)=>{const o=e._zod.def;dr(o.innerType,t,r);const i=t.seen.get(e);i.ref=o.innerType},uje=he("ZodISODateTime",(e,t)=>{g8e.init(e,t),bn.init(e,t)});function dje(e){return bze(uje,e)}const fje=he("ZodISODate",(e,t)=>{m8e.init(e,t),bn.init(e,t)});function pje(e){return wze(fje,e)}const hje=he("ZodISOTime",(e,t)=>{v8e.init(e,t),bn.init(e,t)});function gje(e){return xze(hje,e)}const mje=he("ZodISODuration",(e,t)=>{y8e.init(e,t),bn.init(e,t)});function vje(e){return Sze(mje,e)}const Bo=he("ZodError",(e,t)=>{FY.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>l6e(e,n)},flatten:{value:n=>s6e(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,FP,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,FP,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),yje=BP(Bo),bje=VP(Bo),wje=qb(Bo),xje=Ub(Bo),Sje=d6e(Bo),Cje=f6e(Bo),Eje=p6e(Bo),_je=h6e(Bo),kje=g6e(Bo),Oje=m6e(Bo),Pje=v6e(Bo),Aje=y6e(Bo),On=he("ZodType",(e,t)=>(kn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Yb(e,"input"),output:Yb(e,"output")}}),e.toJSONSchema=qze(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ys(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Zs(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>yje(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>wje(e,n,r),e.parseAsync=async(n,r)=>bje(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>xje(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Sje(e,n,r),e.decode=(n,r)=>Cje(e,n,r),e.encodeAsync=async(n,r)=>Eje(e,n,r),e.decodeAsync=async(n,r)=>_je(e,n,r),e.safeEncode=(n,r)=>kje(e,n,r),e.safeDecode=(n,r)=>Oje(e,n,r),e.safeEncodeAsync=async(n,r)=>Pje(e,n,r),e.safeDecodeAsync=async(n,r)=>Aje(e,n,r),e.refine=(n,r)=>e.check(_7e(n,r)),e.superRefine=n=>e.check(k7e(n)),e.overwrite=n=>e.check(Nd(n)),e.optional=()=>SZ(e),e.exactOptional=()=>f7e(e),e.nullable=()=>CZ(e),e.nullish=()=>SZ(CZ(e)),e.nonoptional=n=>y7e(e,n),e.array=()=>n7e(e),e.or=n=>i7e([e,n]),e.and=n=>s7e(e,n),e.transform=n=>_Z(e,u7e(n)),e.default=n=>g7e(e,n),e.prefault=n=>v7e(e,n),e.catch=n=>w7e(e,n),e.pipe=n=>_Z(e,n),e.readonly=()=>C7e(e),e.describe=n=>{const r=e.clone();return mg.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=mg.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return mg.get(e);const r=e.clone();return mg.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),gZ=he("_ZodString",(e,t)=>{qP.init(e,t),On.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Hze(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Pze(...r)),e.includes=(...r)=>e.check(Mze(...r)),e.startsWith=(...r)=>e.check(Nze(...r)),e.endsWith=(...r)=>e.check(Dze(...r)),e.min=(...r)=>e.check(Gb(...r)),e.max=(...r)=>e.check(cZ(...r)),e.length=(...r)=>e.check(uZ(...r)),e.nonempty=(...r)=>e.check(Gb(1,...r)),e.lowercase=r=>e.check(Aze(r)),e.uppercase=r=>e.check(Tze(r)),e.trim=()=>e.check(Ize()),e.normalize=(...r)=>e.check($ze(...r)),e.toLowerCase=()=>e.check(Fze()),e.toUpperCase=()=>e.check(Lze()),e.slugify=()=>e.check(zze())}),Tje=he("ZodString",(e,t)=>{qP.init(e,t),gZ.init(e,t),e.email=n=>e.check(Q8e(Mje,n)),e.url=n=>e.check(rze(Nje,n)),e.jwt=n=>e.check(yze(Kje,n)),e.emoji=n=>e.check(oze(Dje,n)),e.guid=n=>e.check(iZ(mZ,n)),e.uuid=n=>e.check(J8e(Zb,n)),e.uuidv4=n=>e.check(eze(Zb,n)),e.uuidv6=n=>e.check(tze(Zb,n)),e.uuidv7=n=>e.check(nze(Zb,n)),e.nanoid=n=>e.check(ize($je,n)),e.guid=n=>e.check(iZ(mZ,n)),e.cuid=n=>e.check(aze(Ije,n)),e.cuid2=n=>e.check(sze(Fje,n)),e.ulid=n=>e.check(lze(Lje,n)),e.base64=n=>e.check(gze(Uje,n)),e.base64url=n=>e.check(mze(Hje,n)),e.xid=n=>e.check(cze(zje,n)),e.ksuid=n=>e.check(uze(jje,n)),e.ipv4=n=>e.check(dze(Rje,n)),e.ipv6=n=>e.check(fze(Bje,n)),e.cidrv4=n=>e.check(pze(Vje,n)),e.cidrv6=n=>e.check(hze(qje,n)),e.e164=n=>e.check(vze(Wje,n)),e.datetime=n=>e.check(dje(n)),e.date=n=>e.check(pje(n)),e.time=n=>e.check(gje(n)),e.duration=n=>e.check(vje(n))});function Dd(e){return X8e(Tje,e)}const bn=he("ZodStringFormat",(e,t)=>{un.init(e,t),gZ.init(e,t)}),Mje=he("ZodEmail",(e,t)=>{a8e.init(e,t),bn.init(e,t)}),mZ=he("ZodGUID",(e,t)=>{o8e.init(e,t),bn.init(e,t)}),Zb=he("ZodUUID",(e,t)=>{i8e.init(e,t),bn.init(e,t)}),Nje=he("ZodURL",(e,t)=>{s8e.init(e,t),bn.init(e,t)}),Dje=he("ZodEmoji",(e,t)=>{l8e.init(e,t),bn.init(e,t)}),$je=he("ZodNanoID",(e,t)=>{c8e.init(e,t),bn.init(e,t)}),Ije=he("ZodCUID",(e,t)=>{u8e.init(e,t),bn.init(e,t)}),Fje=he("ZodCUID2",(e,t)=>{d8e.init(e,t),bn.init(e,t)}),Lje=he("ZodULID",(e,t)=>{f8e.init(e,t),bn.init(e,t)}),zje=he("ZodXID",(e,t)=>{p8e.init(e,t),bn.init(e,t)}),jje=he("ZodKSUID",(e,t)=>{h8e.init(e,t),bn.init(e,t)}),Rje=he("ZodIPv4",(e,t)=>{b8e.init(e,t),bn.init(e,t)}),Bje=he("ZodIPv6",(e,t)=>{w8e.init(e,t),bn.init(e,t)}),Vje=he("ZodCIDRv4",(e,t)=>{x8e.init(e,t),bn.init(e,t)}),qje=he("ZodCIDRv6",(e,t)=>{S8e.init(e,t),bn.init(e,t)}),Uje=he("ZodBase64",(e,t)=>{C8e.init(e,t),bn.init(e,t)}),Hje=he("ZodBase64URL",(e,t)=>{_8e.init(e,t),bn.init(e,t)}),Wje=he("ZodE164",(e,t)=>{k8e.init(e,t),bn.init(e,t)}),Kje=he("ZodJWT",(e,t)=>{P8e.init(e,t),bn.init(e,t)}),vZ=he("ZodNumber",(e,t)=>{WY.init(e,t),On.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Wze(e,r,o),e.gt=(r,o)=>e.check(sZ(r,o)),e.gte=(r,o)=>e.check(WP(r,o)),e.min=(r,o)=>e.check(WP(r,o)),e.lt=(r,o)=>e.check(aZ(r,o)),e.lte=(r,o)=>e.check(HP(r,o)),e.max=(r,o)=>e.check(HP(r,o)),e.int=r=>e.check(yZ(r)),e.safe=r=>e.check(yZ(r)),e.positive=r=>e.check(sZ(0,r)),e.nonnegative=r=>e.check(WP(0,r)),e.negative=r=>e.check(aZ(0,r)),e.nonpositive=r=>e.check(HP(0,r)),e.multipleOf=(r,o)=>e.check(lZ(r,o)),e.step=(r,o)=>e.check(lZ(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Gje(e){return Cze(vZ,e)}const Yje=he("ZodNumberFormat",(e,t)=>{A8e.init(e,t),vZ.init(e,t)});function yZ(e){return Eze(Yje,e)}const Zje=he("ZodAny",(e,t)=>{T8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Gze()});function Xje(){return _ze(Zje)}const Qje=he("ZodUnknown",(e,t)=>{M8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Yze()});function bZ(){return kze(Qje)}const Jje=he("ZodNever",(e,t)=>{N8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Kze(e,n,r)});function e7e(e){return Oze(Jje,e)}const t7e=he("ZodArray",(e,t)=>{D8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jze(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(Gb(n,r)),e.nonempty=n=>e.check(Gb(1,n)),e.max=(n,r)=>e.check(cZ(n,r)),e.length=(n,r)=>e.check(uZ(n,r)),e.unwrap=()=>e.element});function n7e(e,t){return jze(t7e,e,t)}const r7e=he("ZodObject",(e,t)=>{I8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>eje(e,n,r,o),It(e,"shape",()=>t.shape),e.keyof=()=>l7e(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:bZ()}),e.loose=()=>e.clone({...e._zod.def,catchall:bZ()}),e.strict=()=>e.clone({...e._zod.def,catchall:e7e()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>n6e(e,n),e.safeExtend=n=>r6e(e,n),e.merge=n=>o6e(e,n),e.pick=n=>e6e(e,n),e.omit=n=>t6e(e,n),e.partial=(...n)=>i6e(xZ,e,n[0]),e.required=(...n)=>a6e(EZ,e,n[0])});function wZ(e,t){const n={type:"object",shape:e??{},...et(t)};return new r7e(n)}const o7e=he("ZodUnion",(e,t)=>{F8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tje(e,n,r,o),e.options=t.options});function i7e(e,t){return new o7e({type:"union",options:e,...et(t)})}const a7e=he("ZodIntersection",(e,t)=>{L8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>nje(e,n,r,o)});function s7e(e,t){return new a7e({type:"intersection",left:e,right:t})}const KP=he("ZodEnum",(e,t)=>{z8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(r,o,i)=>Zze(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const a of r)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new KP({...t,checks:[],...et(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const a of r)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new KP({...t,checks:[],...et(o),entries:i})}});function l7e(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new KP({type:"enum",entries:n,...et(t)})}const c7e=he("ZodTransform",(e,t)=>{j8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Qze(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new OY(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(gg(i,n.value,t));else{const a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(gg(a))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function u7e(e){return new c7e({type:"transform",transform:e})}const xZ=he("ZodOptional",(e,t)=>{JY.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hZ(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function SZ(e){return new xZ({type:"optional",innerType:e})}const d7e=he("ZodExactOptional",(e,t)=>{R8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hZ(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function f7e(e){return new d7e({type:"optional",innerType:e})}const p7e=he("ZodNullable",(e,t)=>{B8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>rje(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function CZ(e){return new p7e({type:"nullable",innerType:e})}const h7e=he("ZodDefault",(e,t)=>{V8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ije(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function g7e(e,t){return new h7e({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():DY(t)}})}const m7e=he("ZodPrefault",(e,t)=>{q8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>aje(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function v7e(e,t){return new m7e({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():DY(t)}})}const EZ=he("ZodNonOptional",(e,t)=>{U8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>oje(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function y7e(e,t){return new EZ({type:"nonoptional",innerType:e,...et(t)})}const b7e=he("ZodCatch",(e,t)=>{H8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sje(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function w7e(e,t){return new b7e({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const x7e=he("ZodPipe",(e,t)=>{W8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lje(e,n,r,o),e.in=t.in,e.out=t.out});function _Z(e,t){return new x7e({type:"pipe",in:e,out:t})}const S7e=he("ZodReadonly",(e,t)=>{K8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cje(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function C7e(e){return new S7e({type:"readonly",innerType:e})}const E7e=he("ZodCustom",(e,t)=>{G8e.init(e,t),On.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Xze(e,n)});function _7e(e,t={}){return Rze(E7e,e,t)}function k7e(e){return Bze(e)}const Xb=y.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:U("w-full caption-bottom text-sm",e),...t})}));Xb.displayName="Table";const Qb=y.forwardRef(({className:e,...t},n)=>g.jsx("thead",{ref:n,className:U("[&_tr]:border-b",e),...t}));Qb.displayName="TableHeader";const Jb=y.forwardRef(({className:e,...t},n)=>g.jsx("tbody",{ref:n,className:U("[&_tr:last-child]:border-0",e),...t}));Jb.displayName="TableBody";const O7e=y.forwardRef(({className:e,...t},n)=>g.jsx("tfoot",{ref:n,className:U("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));O7e.displayName="TableFooter";const ss=y.forwardRef(({className:e,...t},n)=>g.jsx("tr",{ref:n,className:U("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ss.displayName="TableRow";const ew=y.forwardRef(({className:e,...t},n)=>g.jsx("th",{ref:n,className:U("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));ew.displayName="TableHead";const $d=y.forwardRef(({className:e,...t},n)=>g.jsx("td",{ref:n,className:U("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));$d.displayName="TableCell";const P7e=y.forwardRef(({className:e,...t},n)=>g.jsx("caption",{ref:n,className:U("mt-4 text-sm text-muted-foreground",e),...t}));P7e.displayName="TableCaption";const A7e=wZ({id:Gje(),header:Dd(),type:Dd(),status:Dd(),target:Dd(),limit:Dd(),reviewer:Dd()});function T7e({id:e}){const{attributes:t,listeners:n}=uY({id:e});return g.jsxs(mt,{...t,...n,variant:"ghost",size:"icon",className:"size-7 text-muted-foreground hover:bg-transparent",children:[g.jsx(Hue,{className:"size-3 text-muted-foreground"}),g.jsx("span",{className:"sr-only",children:"Drag to reorder"})]})}const kZ=[{id:"drag",header:()=>null,cell:({row:e})=>g.jsx(T7e,{id:e.original.id})},{id:"select",header:({table:e})=>g.jsx("div",{className:"flex items-center justify-center",children:g.jsx(fh,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:t=>e.toggleAllPageRowsSelected(!!t),"aria-label":"Select all"})}),cell:({row:e})=>g.jsx("div",{className:"flex items-center justify-center",children:g.jsx(fh,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(!!t),"aria-label":"Select row"})}),enableSorting:!1,enableHiding:!1},{accessorKey:"header",header:"Header",cell:({row:e})=>g.jsx(I7e,{item:e.original}),enableHiding:!1},{accessorKey:"type",header:"Section Type",cell:({row:e})=>g.jsx("div",{className:"w-32",children:g.jsx(wu,{variant:"outline",className:"px-1.5 text-muted-foreground",children:e.original.type})})},{accessorKey:"status",header:"Status",cell:({row:e})=>g.jsxs(wu,{variant:"outline",className:"flex gap-1 px-1.5 text-muted-foreground [&_svg]:size-3",children:[e.original.status==="Done"?g.jsx(Iue,{className:"text-green-500 dark:text-green-400"}):g.jsx(Yue,{}),e.original.status]})},{accessorKey:"target",header:()=>g.jsx("div",{className:"w-full text-right",children:"Target"}),cell:({row:e})=>g.jsxs("form",{onSubmit:t=>{t.preventDefault(),wK.promise(new Promise(n=>setTimeout(n,1e3)),{loading:`Saving ${e.original.header}`,success:"Done",error:"Error"})},children:[g.jsx(Wr,{htmlFor:`${e.original.id}-target`,className:"sr-only",children:"Target"}),g.jsx(xi,{className:"h-8 w-16 border-transparent bg-transparent text-right shadow-none hover:bg-input/30 focus-visible:border focus-visible:bg-background",defaultValue:e.original.target,id:`${e.original.id}-target`})]})},{accessorKey:"limit",header:()=>g.jsx("div",{className:"w-full text-right",children:"Limit"}),cell:({row:e})=>g.jsxs("form",{onSubmit:t=>{t.preventDefault(),wK.promise(new Promise(n=>setTimeout(n,1e3)),{loading:`Saving ${e.original.header}`,success:"Done",error:"Error"})},children:[g.jsx(Wr,{htmlFor:`${e.original.id}-limit`,className:"sr-only",children:"Limit"}),g.jsx(xi,{className:"h-8 w-16 border-transparent bg-transparent text-right shadow-none hover:bg-input/30 focus-visible:border focus-visible:bg-background",defaultValue:e.original.limit,id:`${e.original.id}-limit`})]})},{accessorKey:"reviewer",header:"Reviewer",cell:({row:e})=>e.original.reviewer!=="Assign reviewer"?e.original.reviewer:g.jsxs(g.Fragment,{children:[g.jsx(Wr,{htmlFor:`${e.original.id}-reviewer`,className:"sr-only",children:"Reviewer"}),g.jsxs(Ei,{children:[g.jsx(zo,{className:"h-8 w-40",id:`${e.original.id}-reviewer`,children:g.jsx(_i,{placeholder:"Assign reviewer"})}),g.jsxs(jo,{align:"end",children:[g.jsx(Pt,{value:"Eddie Lake",children:"Eddie Lake"}),g.jsx(Pt,{value:"Jamik Tashpulatov",children:"Jamik Tashpulatov"})]})]})]})},{id:"actions",cell:()=>g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsxs(mt,{variant:"ghost",className:"flex size-8 text-muted-foreground data-[state=open]:bg-muted",size:"icon",children:[g.jsx(bx,{}),g.jsx("span",{className:"sr-only",children:"Open menu"})]})}),g.jsxs(Bs,{align:"end",className:"w-32",children:[g.jsx(wr,{children:"Edit"}),g.jsx(wr,{children:"Make a copy"}),g.jsx(wr,{children:"Favorite"}),g.jsx(rd,{}),g.jsx(wr,{children:"Delete"})]})]})}];function M7e({row:e}){const{transform:t,transition:n,setNodeRef:r,isDragging:o}=uY({id:e.original.id});return g.jsx(ss,{"data-state":e.getIsSelected()&&"selected","data-dragging":o,ref:r,className:"relative z-0 data-[dragging=true]:z-10 data-[dragging=true]:opacity-80",style:{transform:sg.Transform.toString(t),transition:n},children:e.getVisibleCells().map(i=>g.jsx($d,{children:jb(i.column.columnDef.cell,i.getContext())},i.id))})}function N7e({data:e,className:t}){var x;const[n,r]=y.useState(()=>e),[o,i]=y.useState({}),[a,s]=y.useState({}),[l,c]=y.useState([]),[u,d]=y.useState([]),[f,p]=y.useState({pageIndex:0,pageSize:10}),h=y.useId(),m=R4e(lP(GG,{}),lP(YG,{}),lP(hP,{})),v=y.useMemo(()=>(n==null?void 0:n.map(({id:S})=>S))||[],[n]),b=kY({data:n,columns:kZ,state:{sorting:u,columnVisibility:a,rowSelection:o,columnFilters:l,pagination:f},getRowId:S=>S.id.toString(),enableRowSelection:!0,onRowSelectionChange:i,onSortingChange:d,onColumnFiltersChange:c,onColumnVisibilityChange:s,onPaginationChange:p,getCoreRowModel:SY(),getFilteredRowModel:EY(),getPaginationRowModel:_Y(),getSortedRowModel:ULe(),getFacetedRowModel:VLe(),getFacetedUniqueValues:qLe()});function w(S){const{active:C,over:_}=S;C&&_&&C.id!==_.id&&r(k=>{const O=v.indexOf(C.id),P=v.indexOf(_.id);return bP(k,O,P)})}return g.jsxs(qK,{defaultValue:"outline",className:U("flex w-full flex-col justify-start gap-6",t),children:[g.jsxs("div",{className:"flex items-center justify-between px-4 lg:px-6",children:[g.jsx(Wr,{htmlFor:"view-selector",className:"sr-only",children:"View"}),g.jsxs(Ei,{defaultValue:"outline",children:[g.jsx(zo,{className:"@4xl/main:hidden flex w-fit",id:"view-selector",children:g.jsx(_i,{placeholder:"Select a view"})}),g.jsxs(jo,{children:[g.jsx(Pt,{value:"outline",children:"Outline"}),g.jsx(Pt,{value:"past-performance",children:"Past Performance"}),g.jsx(Pt,{value:"key-personnel",children:"Key Personnel"}),g.jsx(Pt,{value:"focus-documents",children:"Focus Documents"})]})]}),g.jsxs($O,{className:"@4xl/main:flex hidden",children:[g.jsx(_d,{value:"outline",children:"Outline"}),g.jsxs(_d,{value:"past-performance",className:"gap-1",children:["Past Performance",g.jsx(wu,{variant:"secondary",className:"flex h-5 w-5 items-center justify-center rounded-full bg-muted-foreground/30",children:"3"})]}),g.jsxs(_d,{value:"key-personnel",className:"gap-1",children:["Key Personnel",g.jsx(wu,{variant:"secondary",className:"flex h-5 w-5 items-center justify-center rounded-full bg-muted-foreground/30",children:"2"})]}),g.jsx(_d,{value:"focus-documents",children:"Focus Documents"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsxs(mt,{variant:"outline",size:"sm",children:[g.jsx(zue,{}),g.jsx("span",{className:"hidden lg:inline",children:"Customize Columns"}),g.jsx("span",{className:"lg:hidden",children:"Columns"}),g.jsx(ev,{})]})}),g.jsx(Bs,{align:"end",className:"w-56",children:b.getAllColumns().filter(S=>typeof S.accessorFn<"u"&&S.getCanHide()).map(S=>g.jsx(ik,{className:"capitalize",checked:S.getIsVisible(),onCheckedChange:C=>S.toggleVisibility(!!C),children:S.id},S.id))})]}),g.jsxs(mt,{variant:"outline",size:"sm",children:[g.jsx(xx,{}),g.jsx("span",{className:"hidden lg:inline",children:"Add Section"})]})]})]}),g.jsxs(yc,{value:"outline",className:"relative flex flex-col gap-4 overflow-auto px-4 lg:px-6",children:[g.jsx("div",{className:"overflow-hidden rounded-lg border",children:g.jsx(VFe,{collisionDetection:H4e,modifiers:[ZFe],onDragEnd:w,sensors:m,id:h,children:g.jsxs(Xb,{children:[g.jsx(Qb,{className:"sticky top-0 z-10 bg-muted",children:b.getHeaderGroups().map(S=>g.jsx(ss,{children:S.headers.map(C=>g.jsx(ew,{colSpan:C.colSpan,children:C.isPlaceholder?null:jb(C.column.columnDef.header,C.getContext())},C.id))},S.id))}),g.jsx(Jb,{className:"**:data-[slot=table-cell]:first:w-8",children:(x=b.getRowModel().rows)!=null&&x.length?g.jsx(nLe,{items:v,strategy:eLe,children:b.getRowModel().rows.map(S=>g.jsx(M7e,{row:S},S.id))}):g.jsx(ss,{children:g.jsx($d,{colSpan:kZ.length,className:"h-24 text-center",children:"No results."})})})]})})}),g.jsxs("div",{className:"flex items-center justify-between px-4",children:[g.jsxs("div",{className:"hidden flex-1 text-sm text-muted-foreground lg:flex",children:[b.getFilteredSelectedRowModel().rows.length," of ",b.getFilteredRowModel().rows.length," row(s) selected."]}),g.jsxs("div",{className:"flex w-full items-center gap-8 lg:w-fit",children:[g.jsxs("div",{className:"hidden items-center gap-2 lg:flex",children:[g.jsx(Wr,{htmlFor:"rows-per-page",className:"text-sm font-medium",children:"Rows per page"}),g.jsxs(Ei,{value:`${b.getState().pagination.pageSize}`,onValueChange:S=>b.setPageSize(Number(S)),children:[g.jsx(zo,{className:"w-20",id:"rows-per-page",children:g.jsx(_i,{placeholder:b.getState().pagination.pageSize})}),g.jsx(jo,{side:"top",children:[10,20,30,40,50].map(S=>g.jsx(Pt,{value:`${S}`,children:S},S))})]})]}),g.jsxs("div",{className:"flex w-fit items-center justify-center text-sm font-medium",children:["Page ",b.getState().pagination.pageIndex+1," of ",b.getPageCount()]}),g.jsxs("div",{className:"ml-auto flex items-center gap-2 lg:ml-0",children:[g.jsxs(mt,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>b.setPageIndex(0),disabled:!b.getCanPreviousPage(),children:[g.jsx("span",{className:"sr-only",children:"Go to first page"}),g.jsx(Mue,{})]}),g.jsxs(mt,{variant:"outline",className:"size-8",size:"icon",onClick:()=>b.previousPage(),disabled:!b.getCanPreviousPage(),children:[g.jsx("span",{className:"sr-only",children:"Go to previous page"}),g.jsx(xu,{})]}),g.jsxs(mt,{variant:"outline",className:"size-8",size:"icon",onClick:()=>b.nextPage(),disabled:!b.getCanNextPage(),children:[g.jsx("span",{className:"sr-only",children:"Go to next page"}),g.jsx(Ri,{})]}),g.jsxs(mt,{variant:"outline",className:"hidden size-8 lg:flex",size:"icon",onClick:()=>b.setPageIndex(b.getPageCount()-1),disabled:!b.getCanNextPage(),children:[g.jsx("span",{className:"sr-only",children:"Go to last page"}),g.jsx(Nue,{})]})]})]})]})]}),g.jsx(yc,{value:"past-performance",className:"flex flex-col px-4 lg:px-6",children:g.jsx("div",{className:"aspect-video w-full flex-1 rounded-lg border border-dashed"})}),g.jsx(yc,{value:"key-personnel",className:"flex flex-col px-4 lg:px-6",children:g.jsx("div",{className:"aspect-video w-full flex-1 rounded-lg border border-dashed"})}),g.jsx(yc,{value:"focus-documents",className:"flex flex-col px-4 lg:px-6",children:g.jsx("div",{className:"aspect-video w-full flex-1 rounded-lg border border-dashed"})})]})}const D7e=[{month:"January",desktop:186,mobile:80},{month:"February",desktop:305,mobile:200},{month:"March",desktop:237,mobile:120},{month:"April",desktop:73,mobile:190},{month:"May",desktop:209,mobile:130},{month:"June",desktop:214,mobile:140}],$7e={desktop:{label:"Desktop",color:"var(--primary)"},mobile:{label:"Mobile",color:"var(--primary)"}};function I7e({item:e}){const t=pb();return g.jsxs(Rh,{children:[g.jsx(Kq,{asChild:!0,children:g.jsx(mt,{variant:"link",className:"w-fit px-0 text-left text-foreground",children:e.header})}),g.jsxs(sd,{side:"right",className:"flex flex-col",children:[g.jsxs(Bh,{className:"gap-1",children:[g.jsx(Vh,{children:e.header}),g.jsx(qh,{children:"Showing total visitors for the last 6 months"})]}),g.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto py-4 text-sm",children:[!t&&g.jsxs(g.Fragment,{children:[g.jsx(s0,{config:$7e,children:g.jsxs(K7,{accessibilityLayer:!0,data:D7e,margin:{left:0,right:10},children:[g.jsx($2,{vertical:!1}),g.jsx(q2,{dataKey:"month",tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:n=>n.slice(0,3),hide:!0}),g.jsx(Z2,{cursor:!1,content:g.jsx(l0,{indicator:"dot"})}),g.jsx(uh,{dataKey:"mobile",type:"natural",fill:"var(--color-mobile)",fillOpacity:.6,stroke:"var(--color-mobile)",stackId:"a"}),g.jsx(uh,{dataKey:"desktop",type:"natural",fill:"var(--color-desktop)",fillOpacity:.4,stroke:"var(--color-desktop)",stackId:"a"})]})}),g.jsx(wd,{}),g.jsxs("div",{className:"grid gap-2",children:[g.jsxs("div",{className:"flex gap-2 font-medium leading-none",children:["Trending up by 5.2% this month ",g.jsx(ide,{className:"size-4"})]}),g.jsx("div",{className:"text-muted-foreground",children:"Showing total visitors for the last 6 months. This is just some random text to test the layout. It spans multiple lines and should wrap around."})]}),g.jsx(wd,{})]}),g.jsxs("form",{className:"flex flex-col gap-4",children:[g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"header",children:"Header"}),g.jsx(xi,{id:"header",defaultValue:e.header})]}),g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"type",children:"Type"}),g.jsxs(Ei,{defaultValue:e.type,children:[g.jsx(zo,{id:"type",className:"w-full",children:g.jsx(_i,{placeholder:"Select a type"})}),g.jsxs(jo,{children:[g.jsx(Pt,{value:"Table of Contents",children:"Table of Contents"}),g.jsx(Pt,{value:"Executive Summary",children:"Executive Summary"}),g.jsx(Pt,{value:"Technical Approach",children:"Technical Approach"}),g.jsx(Pt,{value:"Design",children:"Design"}),g.jsx(Pt,{value:"Capabilities",children:"Capabilities"}),g.jsx(Pt,{value:"Focus Documents",children:"Focus Documents"}),g.jsx(Pt,{value:"Narrative",children:"Narrative"}),g.jsx(Pt,{value:"Cover Page",children:"Cover Page"})]})]})]}),g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"status",children:"Status"}),g.jsxs(Ei,{defaultValue:e.status,children:[g.jsx(zo,{id:"status",className:"w-full",children:g.jsx(_i,{placeholder:"Select a status"})}),g.jsxs(jo,{children:[g.jsx(Pt,{value:"Done",children:"Done"}),g.jsx(Pt,{value:"In Progress",children:"In Progress"}),g.jsx(Pt,{value:"Not Started",children:"Not Started"})]})]})]})]}),g.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"target",children:"Target"}),g.jsx(xi,{id:"target",defaultValue:e.target})]}),g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"limit",children:"Limit"}),g.jsx(xi,{id:"limit",defaultValue:e.limit})]})]}),g.jsxs("div",{className:"flex flex-col gap-3",children:[g.jsx(Wr,{htmlFor:"reviewer",children:"Reviewer"}),g.jsxs(Ei,{defaultValue:e.reviewer,children:[g.jsx(zo,{id:"reviewer",className:"w-full",children:g.jsx(_i,{placeholder:"Select a reviewer"})}),g.jsxs(jo,{children:[g.jsx(Pt,{value:"Eddie Lake",children:"Eddie Lake"}),g.jsx(Pt,{value:"Jamik Tashpulatov",children:"Jamik Tashpulatov"}),g.jsx(Pt,{value:"Emily Whalen",children:"Emily Whalen"})]})]})]})]})]}),g.jsxs(H0,{className:"mt-auto flex gap-2 sm:flex-col sm:space-x-0",children:[g.jsx(mt,{className:"w-full",children:"Submit"}),g.jsx(Gq,{asChild:!0,children:g.jsx(mt,{variant:"outline",className:"w-full",children:"Done"})})]})]})]})}const F7e=({columnCount:e,rowCount:t=10,searchableColumnCount:n=0,filterableColumnCount:r=0,showViewOptions:o=!0,className:i})=>g.jsxs("div",{className:U("w-full space-y-3 overflow-auto",i),children:[g.jsxs("div",{className:"flex w-full items-center justify-between space-x-2 overflow-auto p-1",children:[g.jsxs("div",{className:"flex flex-1 items-center space-x-2 space-y-4",children:[n>0?Array.from({length:n}).map((a,s)=>g.jsx(rn,{className:"h-10 w-[150px] lg:w-[250px]"},s)):null,r>0?Array.from({length:r}).map((a,s)=>g.jsx(rn,{className:"h-10 w-[70px] border-dashed"},s)):null]}),o?g.jsx(rn,{className:"ml-auto hidden h-7 w-[70px] lg:flex"}):null]}),g.jsx("div",{className:"rounded-md border",children:g.jsxs(Xb,{children:[g.jsx(Qb,{children:Array.from({length:1}).map((a,s)=>g.jsx(ss,{className:"hover:bg-transparent",children:Array.from({length:e}).map((l,c)=>g.jsx(ew,{children:g.jsx(rn,{className:"h-6 w-full"})},c))},s))}),g.jsx(Jb,{children:Array.from({length:t}).map((a,s)=>g.jsx(ss,{className:"hover:bg-transparent",children:Array.from({length:e}).map((l,c)=>g.jsx($d,{children:g.jsx(rn,{className:"h-6 w-full"})},c))},s))})]})}),g.jsxs("div",{className:"flex w-full flex-col items-center justify-between gap-4 overflow-auto px-2 py-1 sm:flex-row sm:gap-8",children:[g.jsx("div",{className:"flex-1",children:g.jsx(rn,{className:"h-8 w-40"})}),g.jsxs("div",{className:"flex flex-col items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:[g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(rn,{className:"h-8 w-24"}),g.jsx(rn,{className:"h-8 w-[70px]"})]}),g.jsx("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:g.jsx(rn,{className:"h-8 w-20"})}),g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(rn,{className:"hidden size-8 lg:block"}),g.jsx(rn,{className:"size-8"}),g.jsx(rn,{className:"size-8"}),g.jsx(rn,{className:"hidden size-8 lg:block"})]})]})]})]}),OZ=({className:e,...t})=>g.jsx("nav",{role:"navigation","aria-label":"pagination",className:U("mx-auto flex w-full justify-center",e),...t});OZ.displayName="Pagination";const PZ=y.forwardRef(({className:e,...t},n)=>g.jsx("ul",{ref:n,className:U("flex flex-row items-center gap-1",e),...t}));PZ.displayName="PaginationContent";const tw=y.forwardRef(({className:e,...t},n)=>g.jsx("li",{ref:n,className:U("",e),...t}));tw.displayName="PaginationItem";const Id=({className:e,isActive:t,size:n="icon",...r})=>g.jsx("a",{"aria-current":t?"page":void 0,className:U(Tl({variant:t?"outline":"ghost",size:n}),e),...r});Id.displayName="PaginationLink";const AZ=({className:e,...t})=>g.jsxs(Id,{"aria-label":"Go to previous page",size:"default",className:U("gap-1 pl-2.5",e),...t,children:[g.jsx(xu,{className:"h-4 w-4"}),g.jsx("span",{children:"Previous"})]});AZ.displayName="PaginationPrevious";const TZ=({className:e,...t})=>g.jsxs(Id,{"aria-label":"Go to next page",size:"default",className:U("gap-1 pr-2.5",e),...t,children:[g.jsx("span",{children:"Next"}),g.jsx(Ri,{className:"h-4 w-4"})]});TZ.displayName="PaginationNext";const GP=({className:e,...t})=>g.jsxs("span",{"aria-hidden":!0,className:U("flex h-9 w-9 items-center justify-center",e),...t,children:[g.jsx(tv,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"More pages"})]});GP.displayName="PaginationEllipsis";const MZ=({className:e,...t})=>g.jsxs(Id,{"aria-label":"Go to next page",size:"default",className:U("gap-1 pr-2.5",e),...t,children:[g.jsx("span",{className:"sr-only",children:"Next Last"}),g.jsx(Ri,{className:"h-4 w-4"})]});MZ.displayName="PaginationNextLast";const NZ=({className:e,...t})=>g.jsxs(Id,{"aria-label":"Go to previous page",size:"default",className:U("gap-1 pl-2.5",e),...t,children:[g.jsx(xu,{className:"h-4 w-4"}),g.jsx("span",{className:"sr-only",children:"Previous Last"})]});NZ.displayName="PaginationPreviousLast";const L7e=({totalPosts:e,postsPerPage:t,currentPage:n,setCurrentPage:r})=>{const o=[];for(let p=1;p<=Math.ceil(e/t);p++)o.push(p);const a=Math.floor(2/2),s=o.slice(Math.max(0,n-1-a),Math.min(n-1+a+1,o.length)),l=()=>{n<o.length&&r(n+1)},c=()=>{n>1&&r(n-1)},u=()=>{n>1&&r(1)},d=()=>{n<o.length&&r(o.length)},f=()=>{const p=s.map((h,m)=>g.jsx(tw,{className:n===h?"rounded-md bg-primary":"",children:g.jsx(Id,{onClick:()=>r(h),children:h})},m));return s[0]>1&&p.unshift(g.jsx(GP,{onClick:()=>r(s[0]-1)},"ellipsis-start")),s[s.length-1]<o.length&&p.push(g.jsx(GP,{onClick:()=>r(s[s.length-1]+1)},"ellipsis-end")),p};return g.jsx("div",{className:"p-4",children:g.jsx(OZ,{children:g.jsxs(PZ,{children:[g.jsxs(tw,{children:[g.jsx(NZ,{onClick:u}),g.jsx(AZ,{onClick:c})]}),f(),g.jsxs(tw,{children:[g.jsx(TZ,{onClick:l}),g.jsx(MZ,{onClick:d})]})]})})})},z7e=({columns:e,data:t,pageCount:n,pageSizeOptions:r=[10,20,30,40,50],className:o})=>{var b;const[i,a]=an.useSearchParams(),s=(i==null?void 0:i.get("page"))??"1",l=Number(s),c=isNaN(l)||l<1?1:l,u=(i==null?void 0:i.get("limit"))??"10",d=Number(u),f=isNaN(d)?10:d,[{pageIndex:p,pageSize:h},m]=E.useState({pageIndex:c-1,pageSize:f});E.useEffect(()=>{a({...Object.fromEntries(i),page:(p+1).toString(),limit:h.toString()})},[p,h,i,a]);const v=kY({data:t,columns:e,pageCount:n??-1,getCoreRowModel:SY(),getFilteredRowModel:EY(),state:{pagination:{pageIndex:p,pageSize:h}},onPaginationChange:m,getPaginationRowModel:_Y(),manualPagination:!0,manualFiltering:!0});return g.jsxs("div",{className:o,children:[g.jsxs(Hh,{className:"h-[calc(80vh-220px)] rounded-md border",children:[g.jsxs(Xb,{className:"relative",children:[g.jsx(Qb,{children:v.getHeaderGroups().map(w=>g.jsx(ss,{children:w.headers.map(x=>g.jsx(ew,{children:x.isPlaceholder?null:jb(x.column.columnDef.header,x.getContext())},x.id))},w.id))}),g.jsx(Jb,{children:(b=v.getRowModel().rows)!=null&&b.length?v.getRowModel().rows.map(w=>g.jsx(ss,{"data-state":w.getIsSelected()&&"selected",children:w.getVisibleCells().map(x=>g.jsx($d,{children:jb(x.column.columnDef.cell,x.getContext())},x.id))},w.id)):g.jsx(ss,{children:g.jsx($d,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]}),g.jsx(Wh,{orientation:"horizontal"})]}),g.jsxs("div",{className:"flex flex-col items-center justify-end gap-2 space-x-2 py-4 sm:flex-row",children:[g.jsxs("div",{className:"flex w-full items-center justify-between",children:[g.jsxs("div",{className:"flex-1 text-sm text-muted-foreground",children:[v.getFilteredSelectedRowModel().rows.length," of"," ",v.getFilteredRowModel().rows.length," row(s) selected."]}),g.jsx("div",{className:"flex flex-col items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx("p",{className:"whitespace-nowrap text-sm font-medium",children:"Rows per page"}),g.jsxs(Ei,{value:`${v.getState().pagination.pageSize}`,onValueChange:w=>{v.setPageSize(Number(w))},children:[g.jsx(zo,{className:"h-8 w-[70px]",children:g.jsx(_i,{placeholder:v.getState().pagination.pageSize})}),g.jsx(jo,{side:"top",children:r.map(w=>g.jsx(Pt,{value:`${w}`,children:w},w))})]})]})})]}),g.jsxs("div",{className:"flex w-full items-center justify-between gap-2 sm:justify-end",children:[g.jsxs("div",{className:"flex w-[100px] items-center justify-center text-sm font-medium",children:["Page ",v.getState().pagination.pageIndex+1," of"," ",v.getPageCount()]}),g.jsxs("div",{className:"flex items-center space-x-2",children:[g.jsx(mt,{"aria-label":"Go to first page",variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>v.setPageIndex(0),disabled:!v.getCanPreviousPage(),children:g.jsx(wte,{className:"h-4 w-4","aria-hidden":"true"})}),g.jsx(mt,{"aria-label":"Go to previous page",variant:"outline",className:"h-8 w-8 p-0",onClick:()=>v.previousPage(),disabled:!v.getCanPreviousPage(),children:g.jsx(xu,{className:"h-4 w-4","aria-hidden":"true"})}),g.jsx(mt,{"aria-label":"Go to next page",variant:"outline",className:"h-8 w-8 p-0",onClick:()=>v.nextPage(),disabled:!v.getCanNextPage(),children:g.jsx(Ri,{className:"h-4 w-4","aria-hidden":"true"})}),g.jsx(mt,{"aria-label":"Go to last page",variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>v.setPageIndex(v.getPageCount()-1),disabled:!v.getCanNextPage(),children:g.jsx(Ste,{className:"h-4 w-4","aria-hidden":"true"})})]})]})]})]})};function j7e({key:e,data:t,handleAction:n,className:r}){return g.jsx(yc,{value:e,className:U("mt-4",r),children:g.jsx("div",{className:"h-40 w-full overflow-auto rounded-md border p-4",children:g.jsxs("table",{className:"w-full",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{className:"border p-2 text-left pb-2",children:"Note"}),g.jsx("th",{className:"border p-2 text-left pb-2",children:"Actions"})]})}),g.jsx("tbody",{children:t==null?void 0:t.map(o=>g.jsxs("tr",{children:[g.jsx("td",{className:"border p-2 text-left pb-2",children:o.text}),g.jsx("td",{className:"flex justify-left border p-2 text-center",children:g.jsx(eP,{link:"form-card",handleAction:n,Item:o})})]},o.id))})]})})})}const R7e={position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0,0,0,0.5)",zIndex:9999};function B7e({show:e,className:t}){return e?g.jsx("div",{style:R7e,className:t}):null}function DZ({pageTitles:e={},defaultTitle:t="Default Title",className:n}){const r=an.useLocation(),o=e[r.pathname]||t;return g.jsx("header",{className:U("group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 flex h-12 shrink-0 items-center gap-2 border-b transition-[width,height] ease-linear",n),children:g.jsxs("div",{className:"flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6",children:[g.jsx(yO,{className:"-ml-1"}),g.jsx(wd,{orientation:"vertical",className:"mx-2 data-[orientation=vertical]:h-4"}),g.jsx("h1",{className:"text-xl font-bold",children:o})]})})}function $Z({items:e,...t}){return g.jsx(Jh,{...t,children:g.jsx(hb,{children:g.jsx(vc,{children:e.map(n=>g.jsx(os,{children:g.jsx(is,{asChild:!0,children:g.jsxs("a",{href:n.url,target:n.target||"",children:[g.jsx(n.icon,{}),g.jsx("span",{children:n.title})]})})},n.title))})})})}function YP({children:e}){return g.jsx(wu,{variant:"secondary",className:"ml-auto flex h-5 w-5 items-center justify-center rounded-full",children:e})}function V7e({item:e}){const{setOpenMobile:t}=rs(),n=an.useLocation();return g.jsx(i9,{asChild:!0,className:"group/collapsible",children:g.jsxs(os,{children:[g.jsx(a9,{asChild:!0,children:g.jsxs(is,{tooltip:e.title,children:[e.icon&&g.jsx(e.icon,{}),g.jsx("span",{children:e.title}),e.badge&&g.jsx(YP,{children:e.badge}),g.jsx(Ri,{className:"ms-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 rtl:rotate-180"})]})}),g.jsx(s9,{className:"CollapsibleContent",children:g.jsx(_O,{children:e.items.map(r=>g.jsx(kO,{children:g.jsx(OO,{asChild:!0,isActive:r.isActive||n.pathname===r.url,children:g.jsxs(an.Link,{to:r.url,onClick:()=>t(!1),children:[r.icon&&g.jsx(r.icon,{}),g.jsx("span",{children:r.title}),r.badge&&g.jsx(YP,{children:r.badge})]})})},r.title))})})]})})}function IZ({items:e,className:t}){const n=an.useLocation(),{setOpenMobile:r}=rs();return g.jsx(Jh,{className:t,children:g.jsx(hb,{className:"flex flex-col gap-2",children:g.jsx(vc,{children:e.map(o=>"items"in o&&o.items?g.jsx(V7e,{item:o},o.title):g.jsx(os,{children:g.jsx(is,{asChild:!0,tooltip:o.title,isActive:o.isActive||n.pathname===o.url,children:g.jsxs(an.Link,{to:o.url,onClick:()=>r(!1),children:[o.icon&&g.jsx(o.icon,{}),g.jsx("span",{children:o.title}),o.badge&&g.jsx(YP,{children:o.badge})]})})},o.title))})})})}function FZ({user:e,onLogout:t,menuItems:n=[],className:r}){const{isMobile:o}=rs();return g.jsx(vc,{children:g.jsx(os,{children:g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsxs(is,{size:"lg",className:U("data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",r),children:[g.jsxs(op,{className:"h-8 w-8 rounded-lg",children:[g.jsx(ip,{src:e.avatar,alt:e.name}),g.jsx(ap,{className:"rounded-lg",children:e.name.split(" ").map(i=>i[0]).join("").toUpperCase().slice(0,2)})]}),g.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[g.jsx("span",{className:"truncate font-medium",children:e.name}),g.jsx("span",{className:"truncate text-xs text-muted-foreground",children:e.email})]}),g.jsx(bx,{className:"ml-auto size-4"})]})}),g.jsxs(Bs,{className:"w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg",side:o?"bottom":"right",align:"end",sideOffset:4,children:[g.jsx($0,{className:"p-0 font-normal",children:g.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[g.jsxs(op,{className:"h-8 w-8 rounded-lg",children:[g.jsx(ip,{src:e.avatar,alt:e.name}),g.jsx(ap,{className:"rounded-lg",children:e.name.split(" ").map(i=>i[0]).join("").toUpperCase().slice(0,2)})]}),g.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[g.jsx("span",{className:"truncate font-medium",children:e.name}),g.jsx("span",{className:"truncate text-xs text-muted-foreground",children:e.email})]})]})}),g.jsx(rd,{}),n.map((i,a)=>g.jsxs(wr,{onClick:i.onClick,children:[i.icon&&g.jsx(i.icon,{className:"mr-2 h-4 w-4"}),i.label]},a)),n.length>0&&g.jsx(rd,{}),g.jsxs(wr,{onClick:t,children:[g.jsx(Xue,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})})})}function q7e({navMain:e=[],navSecondary:t=[],user:n,brandName:r="ACS Tracking",brandIcon:o=$ue,onLogout:i,userMenuItems:a,...s}){return g.jsxs(vO,{collapsible:"offcanvas",...s,children:[g.jsx(wO,{children:g.jsx(vc,{children:g.jsx(os,{children:g.jsx(is,{asChild:!0,className:"data-[slot=sidebar-menu-button]:!p-1.5",children:g.jsxs("a",{href:"#",children:[g.jsx(o,{className:"h-5 w-5"}),g.jsx("span",{className:"text-base font-semibold",children:r})]})})})})}),g.jsxs(SO,{children:[g.jsx(IZ,{items:e}),g.jsx($Z,{items:t,className:"mt-auto"})]}),g.jsx(xO,{children:n&&g.jsx(FZ,{user:n,onLogout:i,menuItems:a})})]})}function U7e({items:e,className:t}){const{isMobile:n}=rs();return g.jsxs(Jh,{className:U("group-data-[collapsible=icon]:hidden",t),children:[g.jsx(CO,{children:"Documents"}),g.jsxs(vc,{children:[e.map(r=>g.jsxs(os,{children:[g.jsx(is,{asChild:!0,children:g.jsxs("a",{href:r.url,children:[g.jsx(r.icon,{}),g.jsx("span",{children:r.name})]})}),g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsxs(EO,{showOnHover:!0,className:"rounded-sm data-[state=open]:bg-accent",children:[g.jsx(tv,{}),g.jsx("span",{className:"sr-only",children:"More"})]})}),g.jsxs(Bs,{className:"w-24 rounded-lg",side:n?"bottom":"right",align:n?"end":"start",children:[g.jsxs(wr,{children:[g.jsx(Uue,{}),g.jsx("span",{children:"Open"})]}),g.jsxs(wr,{children:[g.jsx(nde,{}),g.jsx("span",{children:"Share"})]})]})]})]},r.name)),g.jsx(os,{children:g.jsxs(is,{className:"text-sidebar-foreground/70",children:[g.jsx(tv,{className:"text-sidebar-foreground/70"}),g.jsx("span",{children:"More"})]})})]})]})}function H7e({children:e,sidebarProps:t,headerProps:n,defaultOpen:r=!0,showOverlay:o=!1,overlayComponent:i,className:a}){return g.jsx("div",{className:U("flex h-screen overflow-hidden bg-secondary",a),children:g.jsx("main",{className:"relative flex-1 overflow-y-auto bg-background focus:outline-none",children:g.jsxs(mO,{defaultOpen:r,children:[g.jsx(q7e,{variant:"inset",...t}),g.jsxs(bO,{children:[g.jsx(DZ,{...n}),g.jsx("div",{className:"flex flex-1 flex-col shadow-lg",children:g.jsx("div",{className:"@container/main flex flex-1 flex-col gap-2",children:g.jsxs("div",{className:"flex flex-col gap-4 py-4 md:gap-6 md:py-6",children:[e,o&&i]})})})]})]})})})}const W7e=({isOpen:e,onClose:t,onConfirm:n,loading:r,title:o="Are you sure?",description:i="Are you sure you want to continue?",className:a})=>g.jsx(Z0,{title:o,description:i,isOpen:e,onClose:t,className:a,children:g.jsxs("div",{className:"flex w-full items-center justify-end space-x-2 pt-6",children:[g.jsx(mt,{disabled:r,variant:"outline",onClick:t,children:"Cancel"}),g.jsx(mt,{disabled:r,variant:"destructive",onClick:n,children:"Continue"})]})}),K7e=({openDeleteDialog:e,setIsOpenDeleteDialog:t,onDelete:n,className:r})=>g.jsx("div",{className:"flex gap-3 mb-4",children:g.jsx(Z0,{isOpen:e,onClose:()=>t(!1),className:U("justify-center bg-transparent border-none",r),children:g.jsxs("div",{className:"rounded-md bg-gray-50 p-4 md:p-6",children:[g.jsx("p",{className:"text-black",children:"Are you sure you want to delete?"}),g.jsxs("div",{className:"flex items-center justify-between mt-4 space-x-4",children:[g.jsx(mt,{className:"flex-1 bg-red-500 disabled:bg-gray-500",onClick:n,children:"Yes"}),g.jsx(mt,{className:"flex-1",onClick:()=>t(!1),children:"No"})]})]})},"delete")}),G7e=({renderModal:e,modalName:t,showAddBtn:n=!0,title:r,userPopup:o=!1,extraBtns:i,isOpen:a,setIsOpen:s,isAllowedCreate:l=!0,className:c})=>{const u=()=>{s("")};return g.jsxs("div",{className:"flex justify-end",children:[g.jsxs("div",{className:"flex gap-2",children:[n&&l&&g.jsxs(mt,{className:"flex justify-end ml-auto text-xs md:text-sm ",onClick:()=>s(t??"create"),children:[g.jsx(xx,{className:"mr-2 h-4 w-4"})," Add New"]}),i&&i()]}),g.jsxs(Z0,{userPopup:o,isOpen:a,onClose:u,className:U("!bg-background !px-1 w-full lg:w-[85%]",c),children:[g.jsx("h5",{className:"text-2xl font-bold px-10",children:r??"Add Client"}),g.jsx(Hh,{className:"px-6",children:e(u)})]})]})},LZ=({onChange:e,startDate:t,endDate:n,className:r})=>{const[o,i]=y.useState({from:t,to:n}),[a,s]=y.useState(!1),l=()=>{e(o==null?void 0:o.from,o==null?void 0:o.to),s(!1)};return g.jsx(g.Fragment,{children:g.jsxs("div",{className:U("grid z-50",r),children:[g.jsx("label",{className:"mb-0 block text-md font-bold",children:"Pick a date"}),g.jsxs(dd,{open:a,children:[g.jsx(fd,{asChild:!0,onClick:()=>s(c=>!c),children:g.jsxs(mt,{id:"date",variant:"outline",className:U("w-[100%] justify-start text-left font-normal truncate overflow-hidden text-ellipsis",!o&&"text-muted-foreground"),children:[g.jsx(Aue,{className:"pr-2"}),o!=null&&o.from?o.to?g.jsxs(g.Fragment,{children:[Jo(o.from,"LLL dd, y")," -"," ",Jo(o.to,"LLL dd, y")]}):Jo(o.from,"LLL dd, y"):g.jsx("span",{children:"Pick a date"})]})}),g.jsxs(cc,{className:"w-auto p-0 ",align:"start",style:{left:"1rem"},children:[g.jsx(dp,{style:{left:"1rem"},mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:i,numberOfMonths:3}),g.jsx(mt,{onClick:l,className:"m-2",children:"Apply"})]})]})]})})},Y7e=({className:e,startDateParamName:t="filterStartDate",endDateParamName:n="filterEndDate"})=>{const r=new URLSearchParams(location.search),o=an.useNavigate(),i=(u,d)=>{u&&d&&(s(u==null?void 0:u.toISOString().split("T")[0]),c(d==null?void 0:d.toISOString().split("T")[0]),r.set(t,u.toISOString().split("T")[0]),r.set(n,d.toISOString().split("T")[0]),o({search:r.toString()}))};E.useEffect(()=>{const u=r.get(t)??dM(new Date).toISOString().split("T")[0],d=r.get(n)??_f(new Date,3).toISOString().split("T")[0];s(u),c(d)},[location.search]);const[a,s]=E.useState(()=>r.get(t)??dM(new Date).toISOString().split("T")[0]),[l,c]=E.useState(()=>r.get(n)??_f(new Date,3).toISOString().split("T")[0]);return g.jsx(LZ,{startDate:new Date(a+"T00:00"),endDate:new Date(l+"T00:00"),onChange:i,className:`pt-0 ${e}`})};function Z7e(e,t,n,r){var o=this,i=E.useRef(null),a=E.useRef(0),s=E.useRef(0),l=E.useRef(null),c=E.useRef([]),u=E.useRef(),d=E.useRef(),f=E.useRef(e),p=E.useRef(!0);f.current=e;var h=typeof window<"u",m=!t&&t!==0&&h;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(n=n||{}).leading,b=!("trailing"in n)||!!n.trailing,w="maxWait"in n,x="debounceOnServer"in n&&!!n.debounceOnServer,S=w?Math.max(+n.maxWait||0,t):null;E.useEffect(function(){return p.current=!0,function(){p.current=!1}},[]);var C=E.useMemo(function(){var _=function(D){var $=c.current,G=u.current;return c.current=u.current=null,a.current=D,s.current=s.current||D,d.current=f.current.apply(G,$)},k=function(D,$){m&&cancelAnimationFrame(l.current),l.current=m?requestAnimationFrame(D):setTimeout(D,$)},O=function(D){if(!p.current)return!1;var $=D-i.current;return!i.current||$>=t||$<0||w&&D-a.current>=S},P=function(D){return l.current=null,b&&c.current?_(D):(c.current=u.current=null,d.current)},A=function D(){var $=Date.now();if(v&&s.current===a.current&&T(),O($))return P($);if(p.current){var G=t-($-i.current),z=w?Math.min(G,S-($-a.current)):G;k(D,z)}},T=function(){r&&r({})},N=function(){if(h||x){var D=Date.now(),$=O(D);if(c.current=[].slice.call(arguments),u.current=o,i.current=D,$){if(!l.current&&p.current)return a.current=i.current,k(A,t),v?_(i.current):d.current;if(w)return k(A,t),_(i.current)}return l.current||k(A,t),d.current}};return N.cancel=function(){var D=l.current;D&&(m?cancelAnimationFrame(l.current):clearTimeout(l.current)),a.current=0,c.current=i.current=u.current=l.current=null,D&&r&&r({})},N.isPending=function(){return!!l.current},N.flush=function(){return l.current?P(Date.now()):d.current},N},[v,w,t,S,b,m,h,x,r]);return C}function X7e(e,t){return e===t}function Q7e(e,t,n){var r=X7e,o=E.useRef(e),i=E.useState({})[1],a=Z7e(E.useCallback(function(l){o.current=l,i({})},[i]),t,n,i),s=E.useRef(e);return r(s.current,e)||(a(e),s.current=e),[o.current,a]}const J7e=({placeholder:e,className:t})=>{const[n,r]=an.useSearchParams(),o=n.get("search")||"",[i,a]=E.useState(o),[s]=Q7e(i,1e3),l=E.useCallback(c=>{if(c===""||c===void 0||!c){n.delete("search"),r(n);return}r({...Object.fromEntries(n),page:"1",search:c})},[n,r]);return E.useEffect(()=>{l(s)},[s,l]),g.jsx(xi,{placeholder:e||"Search country...",value:i,onChange:c=>a(c.target.value),className:U("w-full md:max-w-sm",t)})},zZ=({title:e,description:t,className:n})=>g.jsxs("div",{className:n,children:[g.jsx("h2",{className:"text-sm font-bold t sm:text-xl xs:hidden",children:e}),g.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),e9e=({title:e="Kutubi"})=>g.jsx(Pae,{children:g.jsxs("title",{children:[" ",e," "]})}),jZ=({setTheme:e,className:t})=>g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsxs(mt,{variant:"outline",size:"icon",className:t,children:[g.jsx(ode,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),g.jsx(NI,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),g.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),g.jsxs(Bs,{align:"end",children:[g.jsx(wr,{onClick:()=>e("light"),children:"Light"}),g.jsx(wr,{onClick:()=>e("dark"),children:"Dark"}),g.jsx(wr,{onClick:()=>e("pink"),children:"Pink"}),g.jsx(wr,{onClick:()=>e("system"),children:"System"})]})]}),RZ=({user:e,onLogout:t,className:n})=>{var r;return g.jsxs(ic,{children:[g.jsx(ac,{asChild:!0,children:g.jsx(mt,{variant:"ghost",className:U("relative h-12 w-14 rounded-full",n),children:g.jsxs(op,{className:"h-12 w-12",children:[g.jsx(ip,{src:(e==null?void 0:e.avatar)||"https://png.pngtree.com/png-clipart/20230927/original/pngtree-man-avatar-image-for-profile-png-image_13001882.png",alt:(e==null?void 0:e.name)||""}),g.jsx(ap,{children:((r=e==null?void 0:e.name)==null?void 0:r.substring(0,2).toUpperCase())||"U"})]})})}),g.jsxs(Bs,{className:"w-56",align:"end",forceMount:!0,children:[g.jsx($0,{className:"font-normal",children:g.jsxs("div",{className:"flex flex-col space-y-1",children:[g.jsx("p",{className:"text-sm font-medium leading-none",children:e==null?void 0:e.name}),g.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:e==null?void 0:e.email})]})}),g.jsx(rd,{}),g.jsx(wr,{onClick:t,children:"Log out"})]})]})},t9e=({title:e="App Title",onLogout:t,user:n,setTheme:r,extraContent:o,className:i})=>g.jsxs("div",{className:U("flex flex-1 items-center bg-secondary px-4",i),children:[g.jsx(zZ,{title:e}),g.jsxs("div",{className:"ml-4 flex items-center md:ml-6",children:[g.jsx(RZ,{user:n,onLogout:t}),g.jsx(jZ,{setTheme:r}),o,g.jsx("h2",{className:"text-xl font-bold tracking-tight text-primary sm:text-3xl sm:hidden",children:e.substring(0,3).toUpperCase()})]})]}),n9e=({item:e,setOpen:t})=>{const n=typeof e.icon=="string"?q0[e.icon]||q0.arrowRight:e.icon||q0.arrowRight;return g.jsx("div",{className:"space-y-3 text-white",onClickCapture:()=>{t&&t(!1)},children:g.jsxs(an.NavLink,{className:({isActive:r})=>U("flex transform items-center rounded-full px-3 py-2 text-gray-200 transition-colors duration-300 hover:bg-gray-50 hover:text-primary hover:dark:text-black ",r&&"bg-gray-50 text-primary dark:text-black"),to:e.href,end:!0,children:[g.jsx(n,{className:"h-5 w-5","aria-hidden":"true"}),g.jsx("span",{className:"mx-2 text-sm font-medium",children:e.label})]})},e.href)},ZP=({items:e,setOpen:t,className:n})=>e!=null&&e.length?g.jsx("nav",{className:U("-mx-3 space-y-6",n),children:e.filter(r=>r.isShow!==!1).map(r=>g.jsx(n9e,{item:r,setOpen:t},r.href))}):null,r9e=({navItems:e,logoText:t="Logo",logoHref:n="/",className:r})=>g.jsxs("aside",{className:U("hidden h-screen w-64 flex-col overflow-y-auto overflow-x-hidden rounded-tr-[90px] border-r bg-primary py-8 pl-5 dark:bg-background lg:flex pr-2",r),children:[g.jsx(an.Link,{to:n,className:"text-3xl font-bold text-white",children:t}),g.jsx("div",{className:"mt-6 flex flex-1 flex-col justify-between",children:g.jsx(ZP,{items:e})})]}),o9e=({setSidebarOpen:e,sidebarOpen:t,navItems:n,logoText:r="Logo",logoHref:o="/",className:i})=>g.jsx(g.Fragment,{children:g.jsx(Rh,{open:t,onOpenChange:e,children:g.jsx(sd,{side:"left",className:U("bg-background !px-0",i),children:g.jsx("div",{className:"space-y-4 py-4",children:g.jsxs("div",{className:"space-y-4 px-3 py-2",children:[g.jsx(an.Link,{to:o,className:"py-2 text-2xl font-bold text-white ",children:r}),g.jsx("div",{className:"space-y-1 px-2",children:g.jsx(ZP,{items:n,setOpen:e})})]})})})})}),BZ=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ie(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},VZ=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?BZ(r.ref,n,e):r.refs&&r.refs.forEach(o=>BZ(o,n,e))}},i9e=(e,t)=>{t.shouldUseNativeValidation&&VZ(e,t);const n={};for(const r in e){const o=Ie(t.fields,r),i=Object.assign(e[r]||{},{ref:o&&o.ref});if(a9e(t.names||Object.keys(e),r)){const a=Object.assign({},Ie(n,r));$t(a,"root",i),$t(n,r,a)}else $t(n,r,i)}return n},a9e=(e,t)=>e.some(n=>n.startsWith(t+"."));var s9e=function(e,t){for(var n={};e.length;){var r=e[0],o=r.code,i=r.message,a=r.path.join(".");if(!n[a])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[a]={message:s.message,type:s.code}}else n[a]={message:i,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var l=n[a].types,c=l&&l[r.code];n[a]=yV(a,t,n,o,c?[].concat(c,r.message):r.message)}e.shift()}return n},l9e=function(e,t,n){return n===void 0&&(n={}),function(r,o,i){try{return Promise.resolve((function(a,s){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return i.shouldUseNativeValidation&&VZ({},i),{errors:{},values:n.raw?r:c}})}catch(c){return s(c)}return l&&l.then?l.then(void 0,s):l})(0,function(a){if((function(s){return Array.isArray(s==null?void 0:s.errors)})(a))return{values:{},errors:i9e(s9e(a.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw a}))}catch(a){return Promise.reject(a)}}};function c9e(){const{pathname:e}=an.useLocation();return E.useMemo(()=>e,[e])}function qZ(){const e=an.useNavigate();return E.useMemo(()=>({back:()=>e(-1),forward:()=>e(1),reload:()=>window.location.reload(),push:n=>e(n),replace:n=>e(n,{replace:!0})}),[e])}function UZ({loading:e,edit:t,showCancelBtn:n,showNewBtn:r,onClick:o,className:i}){const a=E.useContext(yi),s=a==null?void 0:a.reset;return g.jsxs("div",{className:U("m-2 flex justify-end gap-4",i),children:[n&&g.jsx(mt,{type:"button",className:"flex h-10 items-center rounded-lg bg-gray-100 px-4 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-200",children:"Cancel"}),r&&g.jsx(mt,{type:"button",variant:"outline",onClick:()=>s==null?void 0:s(),className:"flex h-10 items-center rounded-lg px-4 text-sm font-medium transition-colors",disabled:e,"aria-disabled":e,children:"New"}),t&&g.jsx(mt,{type:"submit",onClick:o,className:"flex h-10 items-center rounded-lg px-4 text-sm font-medium transition-colors",disabled:e,"aria-disabled":e,children:e?"please wait..":"Submit"})]})}function u9e(e){const t={};return Object.keys(e||{}).forEach(n=>{t[n]=Xje()}),wZ(t)}function d9e(e,t){if(!t)return e;const n=new FormData;for(const r in e)if(t[r]!==void 0){const o=t[r](e[r]);if(o==null)continue;Array.isArray(o)?o.forEach(i=>{n.append(`${r}[]`,i)}):n.append(r,o)}else n.append(r,e[r]);return n}function f9e({item:e,url:t,redirectUrl:n,edit:r=!0,showCancelBtn:o=!1,showNewBtn:i=!0,onSave:a,onReset:s,onError:l,children:c,resetForm:u=!1,validationSchema:d,requestHeaders:f,dataFormatter:p,baseURL:h="",multipartUrls:m=[]}){const v=qZ(),{toast:b}=Cb(),w=E.useRef(null),[x,S]=E.useState(!1),[C,_]=E.useState(e),[k,O]=E.useState(!(e!=null&&e.id)),P=Jf(),[A,T]=XD(t,{baseURL:h,customHeaders:f??{},multipartUrls:m}),{isAllowed:N,getResourceByUrl:D}=hd(),$=e!=null&&e.id?r?pd.Update:pd.Read:pd.Create,[G,z]=E.useState(!0);E.useEffect(()=>{z(N($,D(t)))},[$,D,N,t]);const K=d??u9e(e||{}),R=FV({defaultValues:E.useMemo(()=>e||void 0,[e]),resolver:l9e(K)}),W=()=>{R.reset(),_(void 0),O(!0),s&&s()};E.useEffect(()=>{_(e),e&&Object.keys(e).length>0&&Object.keys(R.getValues()).forEach(H=>{R.setValue(H,e[H])}),O(!(e!=null&&e.id))},[e,R]);const Z=()=>{var H;(H=w.current)==null||H.requestSubmit()},te={...R,errors:R.formState.errors,create:k,edit:r,itemState:C,submit:Z,reset:W,formState:R.formState},V=R.handleSubmit(async(H,F)=>{var ae,Q,X,q,J,se,I,Ce,oe,ve,De,je;F==null||F.preventDefault(),S(!0);const ee=p?d9e(H,p):H;if(k){const fe=b({title:"Please wait ..."});try{const pe=await P.post(A,ee,T);n&&n!=="#"&&v.push(n),b({title:((ae=pe.data)==null?void 0:ae.message)??"Success",description:Mf(new Date)}),u&&W(),a==null||a(((Q=pe.data)==null?void 0:Q.data)??pe.data,"add")}catch(pe){l==null||l(pe);const Re=((q=(X=pe==null?void 0:pe.response)==null?void 0:X.data)==null?void 0:q.message)||(pe==null?void 0:pe.message)||"Something went wrong";R.setError("root",{message:Yw(Re)}),b({title:((se=(J=pe==null?void 0:pe.response)==null?void 0:J.data)==null?void 0:se.error)??"Request failed",description:Mf(new Date),variant:"destructive"})}finally{fe.dismiss(),S(!1)}return}if(r){const fe=b({title:"Please wait ..."});try{const pe=await P.patch(`${A}/${C==null?void 0:C.id}`,ee,T);b({title:((I=pe.data)==null?void 0:I.message)??"Success",description:Mf(new Date)}),a==null||a(((Ce=pe.data)==null?void 0:Ce.data)??pe.data,"edit"),u&&W()}catch(pe){l==null||l(pe);const Re=((ve=(oe=pe==null?void 0:pe.response)==null?void 0:oe.data)==null?void 0:ve.message)||(pe==null?void 0:pe.message)||"Something went wrong";R.setError("root",{message:Yw(Re)}),b({title:((je=(De=pe==null?void 0:pe.response)==null?void 0:De.data)==null?void 0:je.error)??"Request failed",description:Mf(new Date),variant:"destructive"})}finally{fe.dismiss(),S(!1)}}});return g.jsx(zN,{fallback:g.jsx("div",{children:"Something went wrong. Please try again."}),onError:H=>{console.error("Form Error:",H),l==null||l(H)},children:g.jsx(yi.Provider,{value:te,children:g.jsx("form",{onSubmit:V,ref:w,children:G?g.jsx("div",{className:`rounded-md flex flex-col ${t==="/login"?"h-[90vh]":""}`,children:g.jsx("div",{className:"rounded-md bg-white dark:bg-stone-950 flex-1 overflow-auto p-4",children:g.jsxs(Dx,{className:"p-4",children:[c,R.formState.errors.root&&g.jsxs(X1,{variant:"destructive",className:"mt-2",children:[g.jsx(Due,{className:"h-4 w-4"}),g.jsx(Q1,{children:"Error"}),g.jsx(J1,{children:g.jsx("p",{dangerouslySetInnerHTML:{__html:R.formState.errors.root.message??""}})})]}),g.jsx("div",{className:"p-4 bg-white dark:bg-stone-950 border-t sticky bottom-0 z-10",children:g.jsx(UZ,{showNewBtn:i,loading:x,showCancelBtn:o,edit:r})})]})})}):g.jsx("div",{className:"text-center font-bold w-full text-stone-600",children:"Not Allowed"})})})})}const HZ=y.forwardRef(({onFileSelect:e,accept:t="*/*",validationRules:n={maxSize:5*1024*1024,acceptedTypes:void 0},children:r,...o},i)=>{const a=E.useRef(null),{toast:s}=Cb(),l=d=>{if(n.maxSize&&d.size>n.maxSize){const f=n.maxSize/1048576;return s({title:"File too large",description:`File size should be less than ${f}MB`,variant:"destructive"}),!1}if(n.acceptedTypes&&n.acceptedTypes.length>0&&!n.acceptedTypes.includes(d.type))return s({title:"Invalid file type",description:`Please select: ${n.acceptedTypes.join(", ")}`,variant:"destructive"}),!1;if(n.customValidation){const f=n.customValidation(d);if(typeof f=="string")return s({title:"File validation failed",description:f,variant:"destructive"}),!1;if(!f)return s({title:"File validation failed",variant:"destructive"}),!1}return!0},c=d=>{var p;const f=(p=d.target.files)==null?void 0:p[0];f&&(l(f)&&(e==null||e(f),s({title:"File selected",description:f.name})),d.target.value="")},u=d=>{var f,p;d.preventDefault(),(f=a.current)==null||f.click(),(p=o.onClick)==null||p.call(o,d)};return g.jsxs("div",{className:"flex flex-col items-center",children:[g.jsx("input",{type:"file",ref:a,className:"hidden",accept:t,onChange:c}),g.jsx(mt,{...o,onClick:u,ref:i,children:r})]})});HZ.displayName="FileUploadButton";function p9e({title:e,name:t,icon:n,placeholder:r,selected:o,options:i=[],onTypeing:a,otherOption:s,onChange:l,className:c,hidden:u,disabled:d},f){const p=E.useContext(yi),[h,m]=y.useState(!1),[v,b]=y.useState(i);y.useEffect(()=>{b(i||[])},[i]);const w=x=>{const S=v.find(C=>String(C.value)===String(x));return S?S.label:s&&String(x)==="0"?s:""};return g.jsx(es,{control:p==null?void 0:p.control,name:t,render:({field:x})=>{const S=x.value??o??"",C=w(S);return u?g.jsx(g.Fragment,{}):g.jsxs(bi,{className:U("mb-2",c),children:[e?g.jsxs(wi,{className:"font-bold flex items-center gap-2",children:[n||null,e]}):null,g.jsx(ts,{children:g.jsxs(dd,{open:h,onOpenChange:m,children:[g.jsx(fd,{asChild:!0,children:g.jsxs(mt,{ref:f,type:"button",variant:"outline",role:"combobox","aria-expanded":h,className:U("w-full justify-between truncate overflow-hidden text-ellipsis",d&&"opacity-60 cursor-not-allowed"),disabled:d,children:[g.jsx("span",{className:"truncate w-full text-left",children:C||r||"Select..."}),g.jsx(TI,{className:"opacity-50 flex-shrink-0"})]})}),!d&&g.jsx(cc,{className:"w-full p-0",children:g.jsxs(gh,{children:[g.jsx(p0,{placeholder:r,className:"h-9",onValueChange:a}),g.jsxs(h0,{children:[g.jsx(g0,{children:"No item found."}),g.jsxs(m0,{children:[s&&g.jsxs(Zu,{value:`0 ${s}`,onSelect:()=>{x.onChange("0"),l==null||l(ei(t,"0")),m(!1)},children:[s,g.jsx(Oa,{className:U("ml-auto",String(S)==="0"?"opacity-100":"opacity-0")})]},"__other__"),v.map(_=>g.jsxs(Zu,{value:`${_.value} ${_.label}`,onSelect:()=>{const k=String(_.value),O=String(S)===k?"":k;x.onChange(O),l==null||l(ei(t,O)),m(!1)},children:[_.label,g.jsx(Oa,{className:U("ml-auto",String(S)===String(_.value)?"opacity-100":"opacity-0")})]},String(_.value)))]})]})]})})]})}),g.jsx(ns,{className:"h-auto min-h-2"})]})}})}const h9e=y.forwardRef(p9e);function g9e({title:e,name:t,placeholder:n,className:r,selected:o,options:i,onChange:a,...s},l){const c=E.useContext(yi),[u,d]=E.useState(""),[f,p]=E.useState(i||[]),h=v=>String(v.value)+v.label;E.useEffect(()=>{Array.isArray(i)&&i.length>0&&p([...i])},[i]);const m=typeof(c==null?void 0:c.watch)=="function"?c==null?void 0:c.watch(t):o;return E.useEffect(()=>{const v=f.filter(b=>String(b.value)===String(m));v.length>0?d(h(v[0])):d("")},[f,m]),c?g.jsx(es,{control:c.control,name:t,render:({field:v})=>g.jsxs(bi,{className:`mb-2 ${r??""}`,children:[e&&g.jsx(wi,{children:e}),g.jsxs(Ei,{onValueChange:b=>{const w=b===u?"":b;d(w),a&&a(ei(t,w)),v.onChange(w)},defaultValue:String(v.value??""),children:[g.jsx(ts,{children:g.jsx(zo,{children:g.jsx(_i,{placeholder:s.otherOption?"":n||"Select"})})}),g.jsxs(jo,{children:[s.otherOption&&g.jsx(Pt,{value:"0",children:"Please Select"}),f.map(b=>g.jsx(Pt,{value:String(b.value),children:b.label},b.value))]})]}),g.jsx(ns,{className:"mt-1 h-auto min-h-2"})]})}):null}const m9e=E.forwardRef(g9e);function v9e(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function y9e({title:e,name:t,placeholder:n,className:r,error:o},i){var m,v;const a=E.useContext(yi),s=a==null?void 0:a.watch(t),[l,c]=y.useState((m=a==null?void 0:a.getValues)!=null&&m.call(a)[t]?new Date(String((v=a.getValues)==null?void 0:v.call(a)[t])+"T00:00:00"):void 0),[u,d]=y.useState(l||new Date);E.useEffect(()=>{if(!a)return;const b=l?v9e(l):void 0;a.setValue(t,b)},[l,a,t]),E.useEffect(()=>{a&&(s?typeof s=="string"&&c(new Date(s+"T00:00")):c(void 0))},[s,a]);const f=b=>{d(b)},p=b=>{const w=parseInt(b,10),x=new Date(u.setFullYear(w));d(x)},h=Array.from(new Array(200),(b,w)=>u.getFullYear()-100+w);return a?g.jsx(es,{control:a.control,name:t,render:()=>g.jsxs(bi,{className:`mb-2 ${r??""}`,children:[e&&g.jsx(wi,{children:e}),g.jsxs(dd,{children:[g.jsx(fd,{asChild:!0,children:g.jsxs(mt,{variant:"outline",className:U("w-full justify-start text-left font-normal",!l&&"text-muted-foreground",o?"border-red-300":"border-gray-200"),children:[g.jsx(TT,{className:"mr-2 h-4 w-4"}),l?Jo(l,"PPP"):g.jsx("span",{children:n})]})}),g.jsxs(cc,{style:{width:"fit-content"},className:"p-0",children:[g.jsxs(Ei,{value:u.getFullYear()+"",onValueChange:p,children:[g.jsx(zo,{className:"rounded-none shadow-none",children:g.jsx(_i,{placeholder:"Select a Year"})}),g.jsx(jo,{children:h.map(b=>g.jsx(Pt,{value:b+"",children:b},b))})]}),g.jsx(dp,{mode:"single",selected:l,onSelect:c,month:u,onMonthChange:f,initialFocus:!0})]})]}),g.jsx(ns,{className:"h-auto min-h-2"})]})}):null}const b9e=y.forwardRef(y9e);function w9e({title:e,placeholder:t,name:n,items:r,className:o,disabled:i,onChange:a}){const s=E.useContext(yi);return s?g.jsx(es,{control:s.control,name:n,render:()=>g.jsxs(bi,{className:`mb-3 ${o??""}`,children:[g.jsxs("div",{className:"mb-3",children:[e&&g.jsx(wi,{className:"text-base",children:e}),t&&g.jsx(yk,{children:t})]}),r.map(l=>g.jsx(es,{control:s.control,name:n,render:({field:c})=>{const u=c.value,d=Array.isArray(u)?u==null?void 0:u.includes(l.value):String(u)===String(l.value);return g.jsxs(bi,{className:"flex flex-row items-start space-x-3 space-y-0",children:[g.jsx(ts,{children:g.jsx(fh,{disabled:i,checked:l.checked||d,onCheckedChange:f=>{let p=[l.value];return Array.isArray(u)&&u&&(p=[...u,...p]),a&&a(ei(n,String(l.value??""))),f?c.onChange(r.length===1?l.value:p):c.onChange(Array.isArray(u)?u==null?void 0:u.filter(h=>h!==l.value):"")}})}),g.jsx(wi,{className:"text-sm font-normal",children:l.label})]})}},l.value)),g.jsx(ns,{className:"h-auto min-h-2"})]})}):null}function x9e({title:e,name:t,items:n,onChange:r,vertical:o=!1},i){const a=E.useContext(yi);return a?g.jsx(es,{control:a.control,name:t,render:({field:s})=>g.jsxs(bi,{className:"mb-2",children:[e&&g.jsx(wi,{children:e}),g.jsx(ts,{children:g.jsx(Kk,{onValueChange:l=>{r==null||r(ei(t,l)),s.onChange(l)},defaultValue:s.value,className:o?"flex flex-col space-y-1":"flex flex-row flex-wrap gap-4",children:n.map(l=>g.jsxs(bi,{className:"flex items-center space-x-3 space-y-0",children:[g.jsx(ts,{children:g.jsx(Gk,{value:String(l.value),checked:String(l.value)===String(s.value)})}),g.jsxs(wi,{className:"font-normal flex gap-2 ml-1 pt-1",children:[l.title,l.icon&&E.cloneElement(l.icon,{className:"h-4 w-4"})]})]},l.title))})}),g.jsx(ns,{className:"h-auto min-h-2"})]})}):null}const S9e=E.forwardRef(x9e);function C9e({title:e,name:t,type:n,placeholder:r,className:o,...i},a){const s=E.useContext(yi),l=c=>c.replace(/\D/g,"").replace(/(\d{4})(?=\d)/g,"$1 ");return s?g.jsx(es,{control:s.control,name:t,render:({field:c})=>i.hidden?g.jsx(g.Fragment,{}):g.jsxs(bi,{className:U("mb-2",o),children:[e?g.jsxs(wi,{className:"font-bold",children:[e,n==="date"&&c.value?g.jsxs("span",{className:"text-orange-500 ml-1",children:["(",new Date(String(c.value)).toUTCString().substring(5,11),")"]}):null]}):null,g.jsx(ts,{children:n==="textarea"?g.jsx(IO,{placeholder:r,...c,...i,value:c.value??i.value??"",ref:a}):g.jsx(xi,{type:n,placeholder:r,...c,...i,value:c.value??i.value??"",onChange:u=>{const d=n==="cardNumber"?l(u.target.value):u.target.value;c.onChange(d)},ref:a})}),g.jsx(ns,{className:"h-auto min-h-2"})]})}):null}const E9e=E.forwardRef(C9e);function WZ(e){return/^\d{1,}$/.test(e)}function _9e({title:e,name:t,type:n,placeholder:r,error:o,onChange:i,...a},s){const l=E.useContext(yi),[c,u]=E.useState(null),[d,f]=E.useState(null),p=l==null?void 0:l.watch(t);E.useEffect(()=>{if(!l)return;const v=l.getValues(t);try{u(Number(v==null?void 0:v.split(":")[0])),f(Number(v==null?void 0:v.split(":")[1]))}catch{u(0),f(0)}},[l,t]),E.useEffect(()=>{if(l)try{const v=p==null?void 0:p.split(":")[0],b=p==null?void 0:p.split(":")[1];v&&WZ(v)&&Number(v)!==Number(c)&&u(Number(v)),b&&WZ(b)&&Number(b)!==Number(d)&&f(Number(b))}catch{u(0),f(0)}},[p,l,c,d,t]),E.useEffect(()=>{var w;if(!l||c==null||d==null)return;const v=String(c).padStart(2,"0")+":"+String(d).padStart(2,"0"),b=((w=l.getValues(t))==null?void 0:w.split(":").length)===3?":00":"";if(v+b!==l.getValues(t)&&(l.setValue(t,v),i)){const x=ei(t,v);i(x)}},[d,c,l,t,i]);const h=v=>{f(Number(v.target.value))},m=v=>{u(Number(v.target.value))};return g.jsxs("div",{className:`mb-2 ${a.className??""}`,children:[e&&g.jsx("label",{htmlFor:t,className:`mb-2 block text-sm font-bold ${a.className??""}`,children:e}),g.jsxs("div",{className:"relative inline-flex",children:[g.jsx("input",{id:`${t}-hours`,name:`${t}-hours`,type:"number",disabled:a.disabled,onChange:m,value:String(c??0).padStart(2,"0"),min:"0",placeholder:r,className:`h-9 peer block w-full ${a.disabled?"":"cursor-pointer"} rounded-md border ${["time"].includes(String(n))?"py-0":"py-2"} pl-10 text-sm outline-2 placeholder:text-gray-500 ${o?"border-red-300":"border-gray-200"} ${a.disabled?"text-gray-400":"text-black"} p-1`,ref:s}),g.jsx("div",{className:"self-center p-2 text-2xl",children:":"}),g.jsx("input",{id:`${t}-minutes`,name:`${t}-minutes`,type:"number",disabled:a.disabled,onChange:h,value:String(d??0).padStart(2,"0"),placeholder:r,min:"0",className:`h-9 peer block w-full ${a.disabled?"":"cursor-pointer"} rounded-md border ${["time"].includes(String(n))?"":"py-2"} pl-10 text-sm outline-2 placeholder:text-gray-500 ${o?"border-red-300":"border-gray-200"} ${a.disabled?"text-gray-400":"text-black"} p-1`,ref:s})]}),o&&g.jsx("p",{className:"text-xs italic text-red-500 mt-2",children:o})]})}const k9e=E.forwardRef(_9e);var nw={exports:{}},rw={exports:{}},At={};/** @license React v16.13.1
|
|
524
524
|
* react-is.production.min.js
|
|
525
525
|
*
|
|
526
526
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
package/package.json
CHANGED