@scmlatam/web-ui 0.2.47 → 0.2.49

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/web-ui.js CHANGED
@@ -18459,9 +18459,8 @@ var JE = (e) => /* @__PURE__ */ W(VE, { ...e }), YE = ({ sidebar: e, routes: t,
18459
18459
  },
18460
18460
  color: "gr-yellow"
18461
18461
  })
18462
- }), $E(t).map((e, t) => {
18463
- let n = e.items.some((e) => `${e.label} ${e.sublabel ?? ""}`.toLowerCase().includes(v.toLowerCase()));
18464
- return /* @__PURE__ */ G(le, { children: [e.group ? /* @__PURE__ */ W(F, {
18462
+ }), $E(t).flatMap((e, t) => {
18463
+ let n = e.items.some((e) => `${e.label} ${e.sublabel ?? ""}`.toLowerCase().includes(v.toLowerCase())), r = e.group ? /* @__PURE__ */ W(F, {
18465
18464
  disableSticky: !0,
18466
18465
  sx: {
18467
18466
  display: n ? "block" : "none",
@@ -18470,18 +18469,19 @@ var JE = (e) => /* @__PURE__ */ W(VE, { ...e }), YE = ({ sidebar: e, routes: t,
18470
18469
  fontWeight: 600
18471
18470
  },
18472
18471
  children: e.group
18473
- }) : null, e.items.map((e) => /* @__PURE__ */ W(L, {
18474
- value: e.value,
18475
- sx: { display: `${e.label} ${e.sublabel ?? ""}`.toLowerCase().includes(v.toLowerCase()) ? "block" : "none" },
18472
+ }, `group-${e.group}-${t}`) : null, i = e.items.map((t) => /* @__PURE__ */ W(L, {
18473
+ value: t.value,
18474
+ sx: { display: `${t.label} ${t.sublabel ?? ""}`.toLowerCase().includes(v.toLowerCase()) ? "block" : "none" },
18476
18475
  onClick: () => {
18477
18476
  h(!1);
18478
18477
  },
18479
18478
  children: /* @__PURE__ */ G(ae, {
18480
18479
  variant: "caption",
18481
18480
  color: "textSecondary",
18482
- children: [e.label, e.sublabel && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("br", {}), e.sublabel] })]
18481
+ children: [t.label, t.sublabel && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("br", {}), t.sublabel] })]
18483
18482
  })
18484
- }, e.value))] }, `group-${e.group ?? "none"}-${t}`);
18483
+ }, `${e.group ?? ""}-${t.value}`));
18484
+ return r ? [r, ...i] : i;
18485
18485
  })]
18486
18486
  })]
18487
18487
  }) });
@@ -284,7 +284,7 @@
284
284
  scale(1);
285
285
  }
286
286
  }
287
- `})]});return r?(0,f.createPortal)(a,document.body):null};function DT(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():Math.random().toString(36).slice(2,10)}var OT=()=>({showAlert:(e,t,n={})=>{let r=DT(),i=e===`loading`||e==="default";return gT({id:r,severity:e,message:t,duration:n.duration??(i?void 0:5e3),closeLabel:n.closeLabel}),r},closeAlert:e=>{_T(e)}}),kT=`(max-width: 63.9375rem)`,AT=({sidebar:e,routes:t,account:n})=>{let{state:r,setState:i,getWidth:a}=fe(),[o,s]=(0,l.useState)(()=>typeof window>`u`?!1:window.matchMedia(kT).matches),[c,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=window.matchMedia(kT),t=()=>{let t=e.matches;s(t),t||u(!1)};return t(),e.addEventListener?.(`change`,t),()=>{e.removeEventListener?.(`change`,t)}},[]),(0,d.jsxs)(`div`,{className:`rb-shell rb-shell--${r}`,children:[(0,d.jsx)(Bp,{items:e.items,signOut:e.signOut,tooltips:e.tooltips,state:r,setState:i,getWidth:a,isMobile:o,mobileOpen:c,onCloseMobile:()=>u(!1)}),(0,d.jsx)(dT,{account:n,sidebarItems:e.items,onOpenMobile:o?()=>u(!0):void 0}),(0,d.jsx)(oT,{state:r,getWidth:a,routes:t,account:n}),(0,d.jsx)(ET,{})]})},jT=[`module`,`view`];function MT(){return(0,d.jsx)(`img`,{src:Op.arrowBread,alt:``,"aria-hidden":`true`,className:`size-3 opacity-70`})}function NT(e){return e?decodeURIComponent(e).replaceAll(`-`,` `).replaceAll(`_`,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase()):`—`}function PT(e){let t=e!==`/`&&e.endsWith(`/`)?e.slice(0,-1):e;if(t===`/`)return[];let n=t.split(`/`).filter(Boolean),r=``;return n.map(e=>(r+=`/${e}`,{label:NT(e),to:r}))}function FT({pathname:e,searchParams:t,queryKeys:n,labelFormatter:r}){let i=new URLSearchParams;return n.reduce((n,a)=>{let o=t.get(a);if(!o)return n;i.set(a,o);let s=i.toString();return n.push({label:r?r({key:a,value:o}):NT(o),to:`${e}${s?`?${s}`:``}`}),n},[])}function IT({items:e=[],separator:t=(0,d.jsx)(MT,{}),className:n=``,queryKeys:r=jT,includeHome:i=!0,homeLabel:a=`Home`,homeTo:o=`/`,labelFormatter:s}){let c=(0,u.useNavigate)(),f=(0,u.useLocation)(),[p]=(0,u.useSearchParams)(),m=(0,l.useMemo)(()=>{if(e.length>0)return e;let t=FT({pathname:f.pathname,searchParams:p,queryKeys:r,labelFormatter:s}),n=t.length>0?t:PT(f.pathname);return[...i?[{label:a,to:o}]:[],...n]},[e,f.pathname,p,r,i,a,o,s]);return m.length===0?null:(0,d.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:Z(`max-w-full overflow-hidden`,n),children:(0,d.jsx)(`ol`,{className:`flex min-w-0 flex-wrap items-center gap-2 p2 text-[var(--muted)]`,children:m.map((e,n)=>{let r=n===m.length-1,i=!!e.to&&!r;return(0,d.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[n>0&&(0,d.jsx)(`span`,{className:`flex shrink-0 items-center justify-center text-[var(--g-400)]`,"aria-hidden":`true`,children:t}),i?(0,d.jsx)(`button`,{type:`button`,onClick:()=>c(e.to),className:`p2 min-w-0 max-w-[14rem] truncate bg-transparent p-0 text-left text-[var(--muted)] transition-colors hover:text-[var(--text)] hover:underline`,children:e.label}):(0,d.jsx)(`span`,{"aria-current":r?`page`:void 0,className:`p2 min-w-0 max-w-[14rem] truncate font-semibold text-[var(--text)]`,title:typeof e.label==`string`?e.label:void 0,children:e.label})]},`${String(e.label)}-${n}`)})})})}var LT=e=>(0,d.jsx)(AT,{...e}),RT=({sidebar:e,routes:t,product:n,account:r,languages:i,loginForm:a,signup:o,unsavedChangesAlert:s})=>{let{isAuthenticated:c,openUnsaved:u,setOpenUnsaved:f}=(0,l.useContext)(W),p=[{text:s.message,ncolumn:12,element:`TypographyField`}];return(0,d.jsxs)(d.Fragment,{children:[c?(0,d.jsx)(LT,{routes:t,sidebar:e,account:r}):(0,d.jsx)(iT,{product:n,languages:i,form:a,signup:o}),(0,d.jsx)(lE,{title:s.title,open:u,setOpen:f,fields:p,loading:!1,onClickSave:s.actionButton.onClick,action:{actionButton:s.actionButton,cancelButton:s.cancelButton}})]})},zT=({sidebar:e,routes:t,product:n,account:r,languages:o,loginForm:s,signup:c,unsavedChangesAlert:f,msalInstance:g})=>{let{isAuthenticated:_,setIsAuthenticated:v}=(0,l.useContext)(W),[y,b]=(0,l.useState)(0),x=o.find(e=>e.active)||o[0];(0,l.useEffect)(()=>{switch(x.code){case`es`:a.default.locale(`es`);break;case`en`:a.default.locale(`en`);break;case`pt`:a.default.locale(`pt`);break;default:a.default.locale(`en`)}let e=[`token`,`company`,`config`,`privileges`,`account`,`language`,`authenticated`,`type-signin`].filter(e=>localStorage.getItem(e)===null);if(localStorage.getItem(`ues`)===`403`){localStorage.removeItem(`ues`),window.location.href=`/signup`;return}y===0&&window.location.pathname!==`/signup`&&(g.getActiveAccount()&&e.length>0?(console.log(`if 1`),j_(g,g.getActiveAccount())):g.getActiveAccount()&&e.length===0?(console.log(`if 2`),v(!0),localStorage.setItem(`authenticated`,`true`)):!g.getActiveAccount()&&_?(console.log(`if 6`),v(!0)):!g.getActiveAccount()&&e.length===0?(console.log(`if 3`),v(!0),localStorage.setItem(`authenticated`,`true`)):!g.getActiveAccount()&&e.length>0&&(console.log(`if 4`),v(!1),localStorage.setItem(`authenticated`,`false`)),b(y+1))},[x,y]);let S={rabbitLight:de,rabbitDark:(0,i.createTheme)(ue,x.theme.dg,x.theme.core,x.theme.pickers)};return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(Cp,{instance:g,children:(0,d.jsx)(i.Box,{sx:{overflow:`hidden`,height:`100vh`},children:(0,d.jsx)(u.BrowserRouter,{children:(0,d.jsx)(i.ThemeProvider,{theme:S.rabbitDark,children:(0,d.jsx)(m.LocalizationProvider,{dateAdapter:h.AdapterDayjs,adapterLocale:x.code,children:(0,d.jsxs)(p.SnackbarProvider,{maxSnack:15,autoHideDuration:1e4,anchorOrigin:{vertical:`top`,horizontal:`center`},children:[(0,d.jsx)(i.CssBaseline,{}),(0,d.jsx)(RT,{sidebar:e,routes:t,product:n,account:r,languages:o,msalInstance:g,loginForm:s,signup:c,unsavedChangesAlert:f})]})})})})})})})},BT=({children:e})=>{let[t,n]=(0,l.useState)(localStorage.getItem(`authenticated`)===`true`),[r,i]=(0,l.useState)(``),[a,o]=(0,l.useState)(``),[s,c]=(0,l.useState)(``),[u,f]=(0,l.useState)(``),[p,m]=(0,l.useState)(`DD/MM/YYYY`),[h,g]=(0,l.useState)([]),[_,v]=(0,l.useState)([]),[y,b]=(0,l.useState)(!1),[x,S]=(0,l.useState)(``),[C,w]=(0,l.useState)(!1);return(0,d.jsx)(W.Provider,{value:{isAuthenticated:t,setIsAuthenticated:n,user:r,setUser:i,pass:a,setPass:o,avatar:s,setAvatar:c,email:u,setEmail:f,loadingAuth:C,setLoadingAuth:w,format:p,setFormat:m,singleShortcut:h,setSingleShortcut:g,rangeShortcut:_,setRangeShortcut:v,encrypter:(e,t,n)=>{e===`session`?sessionStorage.setItem(t,n):e===`local`&&localStorage.setItem(t,n)},decrypter:(e,t)=>e===`session`?sessionStorage.getItem(t)||``:e===`local`&&localStorage.getItem(t)||``,openUnsaved:y,setOpenUnsaved:b,redirect:x,setRedirect:S},children:e})},VT=({contextMenu:e,setContextMenu:t,options:n,checked:r,optionGroup:a})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.Menu,{open:e!==null,onClose:()=>t(null),anchorReference:`anchorPosition`,anchorPosition:e===null?void 0:{top:e.mouseY,left:e.mouseX},slots:{transition:i.Fade},slotProps:{paper:{sx:{bgcolor:e=>a===`toolbar`?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main,borderRadius:`12px`},elevation:1}},sx:{cursor:`pointer`},children:n.filter(e=>!e.hide).map((e,t)=>(0,d.jsxs)(i.Box,{children:[t!==0&&n[t-1].group!==e.group?(0,d.jsx)(i.Divider,{}):null,(0,d.jsxs)(i.MenuItem,{onClick:e.click,disabled:e.disabled,children:[(0,d.jsx)(i.ListItemIcon,{sx:{color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},children:e.icon}),(0,d.jsx)(i.ListItemText,{children:(0,d.jsx)(i.Typography,{sx:{color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},children:e.name})}),e.selected?(0,d.jsxs)(i.Typography,{sx:{pl:3,color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},variant:`body2`,children:[`selecionados`,`:`,r.length]}):null,e.onlyOne?(0,d.jsx)(i.Typography,{sx:{pl:3,color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},variant:`body2`,children:`solo uno`}):null]},t)]},t))}),n.filter(e=>!e.hide).map((e,t)=>(0,d.jsx)(i.Box,{children:e.dialog},t))]}),HT=e=>{let t=[],n=new Map;return e.forEach(e=>{let r=e.group??``;n.has(r)||(n.set(r,t.length),t.push({group:e.group,items:[]})),t[n.get(r)].items.push(e)}),t},UT=({label:e,values:t,placeholder:n,value:r,setValue:a,disabled:o,fullWidth:s,white:c,search:u})=>{let f=(0,l.useRef)(null),p=(0,l.useRef)(null),m=(0,l.useRef)(null),[h,g]=(0,l.useState)({width:0,height:0}),[v,y]=(0,l.useState)(!1),[b,x]=(0,l.useState)(``),S=u?.value??b,C=e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx},onClick:()=>{console.log(`icon click`),y(!v)}});(0,l.useEffect)(()=>{if(!f.current)return;let e=new ResizeObserver(e=>{let{width:t,height:n}=e[0].contentRect;g({width:t,height:n})});return e.observe(f.current),()=>e.disconnect()},[h]),(0,l.useEffect)(()=>{v&&m.current?.focus()},[v]);let w={marginTop:`-55px`,maxHeight:`500px`,borderRadius:`24px`,borderTopLeftRadius:`24px`,borderTopRightRadius:`24px`,width:h.width+20,backgroundColor:`transparent`,"--Paper-overlay":`none`,border:`1px solid rgba(255, 255, 255, 0.2)`};return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{ref:f,labelId:`filter-table-label-${e}`,id:`filter-${e}`,open:v,onOpen:()=>{y(!0)},onClose:e=>{let t=e?.target;t&&p.current?.contains(t)||y(!1)},value:r,label:e,onChange:e=>a(e.target.value),multiple:!1,renderValue:e=>{let r=Array.isArray(e)?e[0]:e;return r==null||r===``?n:t.find(e=>e.value===r)?.label||n},color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:C,MenuProps:{autoFocus:!1,disableAutoFocusItem:!0,slotProps:{paper:{style:w},list:{sx:{marginTop:`60px`,backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},displayEmpty:!0,disabled:o,children:[(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{backgroundColor:`transparent`,px:1.5,py:1},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:(0,d.jsx)(i.TextField,{ref:p,inputRef:m,variant:`standard`,fullWidth:!0,size:`small`,placeholder:u?.placeholder||`Buscar...`,value:S,onMouseDown:e=>{e.stopPropagation(),y(!0)},onClick:e=>{e.stopPropagation(),y(!0)},onKeyDown:e=>{e.stopPropagation()},onChange:e=>{let t=e.target.value;if(u?.setValue){u.setValue(t);return}x(t)},color:`gr-yellow`})}),HT(t).map((e,t)=>{let n=e.items.some(e=>`${e.label} ${e.sublabel??``}`.toLowerCase().includes(S.toLowerCase()));return(0,d.jsxs)(l.Fragment,{children:[e.group?(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{display:n?`block`:`none`,backgroundColor:`transparent`,color:c?`black`:`white`,fontWeight:600},children:e.group}):null,e.items.map(e=>(0,d.jsx)(i.MenuItem,{value:e.value,sx:{display:`${e.label} ${e.sublabel??``}`.toLowerCase().includes(S.toLowerCase())?`block`:`none`},onClick:()=>{y(!1)},children:(0,d.jsxs)(i.Typography,{variant:`caption`,color:`textSecondary`,children:[e.label,e.sublabel&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),e.sublabel]})]})},e.value))]},`group-${e.group??`none`}-${t}`)})]})]})})},WT=({label:e,value:t,setValue:n,values:r,placeholder:a,disabled:o,fullWidth:s,white:c,search:u})=>{let f=(0,l.useRef)(null),p=(0,l.useRef)(null),[m,h]=(0,l.useState)({width:0,height:0}),[g,v]=(0,l.useState)(!1),[y,b]=(0,l.useState)(``),x=u?.value??y,S=r.filter(e=>`${e.label} ${e.sublabel??``}`.toLowerCase().includes(x.toLowerCase())).map(e=>e.value),C=S.filter(e=>t.includes(e)).length,w=S.length>0&&C===S.length,T=C>0&&!w,E=e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx},onClick:()=>{v(!g)}});(0,l.useEffect)(()=>{if(!f.current)return;let e=new ResizeObserver(e=>{let{width:t,height:n}=e[0].contentRect;h({width:t,height:n})});return e.observe(f.current),()=>e.disconnect()},[m]);let D={marginTop:`-55px`,maxHeight:`500px`,borderRadius:`24px`,borderTopLeftRadius:`24px`,borderTopRightRadius:`24px`,width:m.width+20,backgroundColor:`transparent`,"--Paper-overlay":`none`,border:`1px solid rgba(255, 255, 255, 0.2)`};return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{ref:f,labelId:`filter-table-label-${e}`,id:`filter-${e}`,open:g,onOpen:()=>{v(!0)},onClose:e=>{let t=e?.target;t&&p.current?.contains(t)||v(!1)},value:t,label:e,onChange:e=>{let{target:{value:r}}=e,i=typeof r==`string`?r.split(`,`):r;if(i.includes(`select-all`)){if(w){n(t.filter(e=>!S.includes(e)));return}n(Array.from(new Set([...t,...S])));return}n(i.filter(e=>e!==`select-all`))},color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:E,MenuProps:{slotProps:{paper:{style:D},list:{sx:{marginTop:`60px`,backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},renderValue:e=>!e||e.length===0?a:r.filter(t=>e.includes(t.value)).map(e=>e.label).join(`, `),displayEmpty:!0,disabled:o,multiple:!0,children:[(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{backgroundColor:`transparent`,px:1.5,py:1},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:(0,d.jsx)(i.TextField,{ref:p,variant:`standard`,fullWidth:!0,size:`small`,placeholder:u?.placeholder||`Buscar...`,value:x,onMouseDown:e=>{e.stopPropagation(),v(!0)},onClick:e=>{e.stopPropagation(),v(!0)},onKeyDown:e=>{e.stopPropagation()},onChange:e=>{let t=e.target.value;if(u?.setValue){u.setValue(t);return}b(t)},focused:!1,color:`gr-yellow`})}),(0,d.jsxs)(i.MenuItem,{value:`select-all`,disabled:S.length===0,children:[(0,d.jsx)(i.Checkbox,{checked:w,indeterminate:T}),(0,d.jsx)(i.ListItemText,{slotProps:{primary:{sx:{color:`#FFFFFF`}}},primary:`Seleccionar todo`})]}),r.map(e=>(0,d.jsx)(i.MenuItem,{value:e.value,sx:{display:S.includes(e.value)?`block`:`none`},children:(0,d.jsxs)(i.Box,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,d.jsx)(i.Checkbox,{checked:t.includes(e.value)}),(0,d.jsxs)(i.Typography,{variant:`caption`,color:`textSecondary`,children:[e.label,e.sublabel&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),e.sublabel]})]})]})},e.value))]})]})})},GT=({label:e,value:t,setValue:n,disabled:r,fullWidth:i})=>{let{format:a}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(y.LocalizationProvider,{dateAdapter:h.AdapterDayjs,children:(0,d.jsx)(v.SingleInputDateRangeField,{label:e,value:t,onChange:e=>{n(e)},sx:{"& .MuiInputBase-root":{borderRadius:`16px`}},size:`small`,color:`gr-yellow`,slotProps:{textField:{sx:{"& .MuiInputLabel-root":{color:`white !important`}}}},focused:!0,format:a,disabled:r,fullWidth:i})})})},KT=({label:e,initialValue:t,value:n,setValue:r,calendars:i,disabled:a,white:o,fullWidth:s,maxDate:c,minDate:u})=>{let{format:f,rangeShortcut:p}=(0,l.useContext)(W),m=(0,x.useTheme)(),h=(0,x.createTheme)({...m,palette:{...m.palette,primary:{main:`#9D9A95`}}});return(0,d.jsx)(x.ThemeProvider,{theme:h,children:(0,d.jsx)(b.DateRangePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:a,format:f,calendars:i,slotProps:{shortcuts:{items:p},textField:{variant:`outlined`,size:`small`,fullWidth:s,color:`gr-yellow`,focused:!0,sx:{"& .MuiInputLabel-root":{color:o?`black !important`:`white !important`},"& .MuiInputLabel-root.Mui-focused":{color:o?`black !important`:`white !important`},"& .MuiGrid-root":{marginBottom:`0px !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>o?e.palette[`gr-grey`].light:e.palette[`gr-grey`].main},"& .MuiChip-label":{color:o?`black !important`:`white !important`},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>o?e.palette[`gr-base-dark`].main:`white !important`},"& .MuiPickersCalendarHeader-label":{color:o?`black !important`:`white !important`},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>o?e.palette[`gr-base-dark`].main:`white !important`},"& .Mui-disabled":{color:e=>`${e.palette[`gr-grey`].main} !important`},"& .MuiPickersArrowSwitcher-root":{color:`(theme) => theme.palette["gr-base-dark"].main`},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:o?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:e=>o?e.palette[`gr-grey`].light:`black !important`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}},maxDate:c,minDate:u})})},qT=({label:e,initialValue:t,value:n,setValue:r,disabled:i,white:a,fullWidth:o})=>{let{format:s,singleShortcut:c}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.DatePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:i,format:s,slotProps:{shortcuts:{items:c},textField:{variant:`outlined`,size:`small`,fullWidth:o,color:`gr-yellow`,focused:!0,sx:{"& .MuiInputLabel-root":{color:a?`black !important`:`white !important`},"& .MuiInputLabel-root.Mui-focused":{color:a?`black !important`:`white !important`},"& .MuiGrid-root":{marginBottom:`0px !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:a?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:a?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>a?e.palette[`gr-grey`].light:e.palette[`gr-grey`].main},"& .MuiChip-label":{color:a?`black !important`:`white !important`},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>a?e.palette[`gr-base-dark`].main:`white !important`},"& .MuiPickersCalendarHeader-label":{color:a?`black !important`:`white !important`},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>a?e.palette[`gr-base-dark`].main:`white !important`},"& .Mui-disabled":{color:e=>`${e.palette[`gr-grey`].main} !important`},"& .MuiPickersArrowSwitcher-root":{color:`(theme) => theme.palette["gr-base-dark"].main`},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:e=>a?e.palette[`gr-grey`].light:`black !important`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},JT=e=>{let{name:t={title:``,ncolumn:0},fields:n=[],actions:r={ncolumn:1,buttons:[]}}=e,a=(e,t)=>{switch(e.element){case`SelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(UT,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:e.disable,search:e.search,multiple:e.multiple,fullWidth:!0,white:!1})},t);case`MultiSelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(WT,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:e.disable,search:e.search,fullWidth:!0,white:!1})},t);case`DateRangeField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(GT,{label:e.label,value:e.value,setValue:e.setValue,disabled:e.disable,fullWidth:!0})},t);case`DatePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(qT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:e.disable,fullWidth:!0,white:!1})},t)});case`DateRangePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(KT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:e.disable,fullWidth:!0,white:!1,maxDate:e.maxDate,minDate:e.minDate})},t)});default:return(0,d.jsx)(d.Fragment,{})}};return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Box,{sx:{bgcolor:e=>e.palette.background.paper,height:`70px`,borderTopLeftRadius:`20px`,borderTopRightRadius:`20px`,display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`flex-end`,padding:`20px`,gap:`20px`},children:(0,d.jsxs)(i.Grid,{container:!0,spacing:2,sx:{flexGrow:1},children:[t.title&&(0,d.jsx)(i.Grid,{size:t.ncolumn,sx:{display:`flex`,alignItems:`center`},children:t.title}),n.map((e,t)=>a(e,t)),r&&r.buttons.length>0&&(0,d.jsx)(i.Grid,{size:r.ncolumn,children:(0,d.jsx)(i.Box,{sx:{display:`flex`,justifyContent:`flex-end`,alignItems:`center`,gap:`10px`},children:r.buttons.map((e,t)=>(0,d.jsx)(i.Button,{variant:e.variant,color:`gr-yellow`,sx:{...e.sx},onClick:e.onClick,disabled:e.disabled,disableElevation:!0,children:e.icon?e.icon:(0,d.jsx)(`span`,{style:{marginTop:`2px`,textTransform:`none`,padding:`0px 5px`},children:e.text})},t))})})]})})})},YT=e=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.DataGridPro,{...e,apiRef:e.apiRef,showToolbar:e.toolbar!==void 0,headerFilters:e.headerFilters,slots:{toolbar:JT,headerFilterMenu:null,...e.slots},slotProps:{...e.slotProps,toolbar:{...e.toolbar},baseTextField:{color:e.toolbar===void 0?`error`:`primary`,slotProps:{input:{endAdornment:(0,d.jsx)(i.InputAdornment,{sx:{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette[`gr-grey`].main},position:`end`,children:(0,d.jsx)(S.default,{})})}}},loadingOverlay:{variant:`circular-progress`,noRowsVariant:`circular-progress`}},sx:{border:`none`,color:`black`,flex:1,borderTopLeftRadius:e.toolbar?`0px`:`20px !important`,borderTopRightRadius:e.toolbar?`0px`:`20px !important`,"--DataGrid-t-color-background-base":`transparent !important`,"& .MuiDataGrid-columnHeaderCheckbox":{backgroundColor:`white`},"& .MuiDataGrid-filler--pinnedLeft":{backgroundColor:`white`},"& .MuiDataGrid-filterForm .MuiInputBase-root":{backgroundColor:`#F3F2F2`},"& .MuiDataGrid-columnHeader":{backgroundColor:e.toolbar?`white`:`transparent`,color:e.toolbar?`black`:`white`,borderBottom:e.headerFilters?`none !important`:e=>`${e.palette.primary.main} 1px solid !important`},"& .MuiDataGrid-headerFilterRow":{bgcolor:e.toolbar?`white !important`:`transparent !important`,borderBottom:e=>`${e.palette.primary.main} 1px solid !important`},"& .MuiDataGrid-virtualScroller":{bgcolor:`white`,borderBottomLeftRadius:e.slots?.footer?`0px`:`20px`,borderBottomRightRadius:e.slots?.footer?`0px`:`20px`},"& .MuiDataGrid-columnHeaderTitleContainer":{"& .MuiCheckbox-root":{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette.background.paper}},"& .MuiDataGrid-iconButtonContainer":{"& .MuiIconButton-root":{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette[`gr-grey`].main}},"& .MuiDataGrid-footerContainer":{borderTop:`none`,fontWeight:`500`,display:`flex`,justifyContent:`center`,alignItems:`center`,borderBottomLeftRadius:`20px`,borderBottomRightRadius:`20px`,backgroundColor:`black`},"& .MuiIconButton-root":{color:e=>e.palette.background.paper,"&.Mui-disabled":{color:`#888`,backgroundColor:`#eee`,opacity:.7}},"& .MuiDataGrid-row":{minHeight:45,maxHeight:`none`},"& .MuiDataGrid-cell":{minHeight:45,height:`auto`,maxHeight:`none`,display:`flex`,flexDirection:`column`,alignItems:`start`,justifyContent:`flex-start`,gap:1.5,p:1,borderBottom:`none`,borderTop:`1px solid #CECDCA`},"& .MuiDataGrid-cell--editing":{minHeight:45,height:`auto`,maxHeight:`none`,display:`flex`,flexDirection:`column`,alignItems:`start`,justifyContent:`flex-start`,gap:1.5,p:1},"& .MuiDataGrid-cell--editing input":{color:`black !important`,backgroundColor:`white !important`},"& .MuiDataGrid-row:hover, & .MuiDataGrid-row.Mui-selected":{bgcolor:`#B6B4AF`},"& .MuiDataGrid-cell.enable-cell":{backgroundColor:`white !important`,"& .MuiCheckbox-root":{color:e=>e.palette.background.paper}},"& .MuiDataGrid-cell.parcial-cell":{backgroundColor:`#E7E6E4 !important`,"& .MuiCheckbox-root":{color:e=>e.palette.background.paper}},"& .MuiDataGrid-cell.disable-cell":{backgroundColor:`#E7E6E4 !important`,"& .MuiCheckbox-root":{color:`#CECDCA`}},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.enable-cell":{backgroundColor:`#B6B4AF !important`},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.parcial-cell":{backgroundColor:`#B6B4AF !important`},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.disable-cell":{backgroundColor:`#B6B4AF !important`},...e.sx},loading:e.loading,checkboxSelection:e.checkboxSelection,paginationModel:e.paginationModel,onPaginationModelChange:e.setPaginationModel,onRowSelectionModelChange:e.setRowSelectionModel,rowSelectionModel:e.rowSelectionModel,disableRowSelectionOnClick:e.disableRowSelectionOnClick,getRowHeight:()=>`auto`,onCellEditStop:e.onCellEditStop,disableVirtualization:!0,initialState:e.initialState,showColumnVerticalBorder:!1,showCellVerticalBorder:!1}),(0,d.jsx)(VT,{contextMenu:e.contextMenu,setContextMenu:e.setContextMenu,options:e.options,checked:e.rowSelectionModel,optionGroup:e.optionGroup})]}),XT=()=>{let e=(0,g.useGridApiRef)(),[t,n]=(0,l.useState)(!1),[r,i]=(0,l.useState)([]),[a,o]=(0,l.useState)({pageSize:25,page:0}),[s,c]=(0,l.useState)({type:`include`,ids:new Set}),[u,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(`table`);return{apiRef:e,rows:r,setRows:i,loading:t,setLoading:n,paginationModel:a,setPaginationModel:o,rowSelectionModel:s,setRowSelectionModel:c,contextMenu:u,setContextMenu:d,optionGroup:f,setOptionGroup:p}},ZT=()=>{let{enqueueSnackbar:e}=(0,p.useSnackbar)(),t=e=>{(0,p.closeSnackbar)(e)};return{showAlert:(n,r)=>e(r,{variant:n,content:(e,r)=>(0,d.jsx)(i.Alert,{sx:{borderRadius:`24px`,bgcolor:`#fff`,boxShadow:3,color:e=>e.palette[`gr-base-dark`].main},severity:n,iconMapping:{error:(0,d.jsx)(C.default,{}),info:(0,d.jsx)(E.default,{}),success:(0,d.jsx)(w.default,{}),warning:(0,d.jsx)(T.default,{}),default:(0,d.jsx)(i.CircularProgress,{color:`gr-blue`,size:20})},onClose:()=>t(e),children:r},e)}),closeAlert:t}},QT=({label:e,initialValue:t,value:n,setValue:r,disabled:i,fullWidth:a,white:o})=>{let{format:s}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(k.DateTimeField,{label:e,defaultValue:t,value:n,onChange:e=>{r(e)},sx:{"& .MuiInputBase-root":{borderRadius:`16px`,color:o?`black !important`:`white !important`}},size:`small`,color:`gr-yellow`,slotProps:{textField:{sx:{"& .MuiInputLabel-root":{color:o?`black !important`:`white !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}}},focused:!0,format:s,disabled:i,fullWidth:a})})},$T=({label:e,placeholder:t,values:n,value:r,setValue:a,white:o})=>{let[s,c]=(0,l.useState)(!1);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Autocomplete,{multiple:!0,options:n,getOptionLabel:e=>e.label,value:n.filter(e=>r.includes(e.value)),onChange:(e,t)=>{a(t.map(e=>e.value))},onOpen:()=>c(!0),onClose:()=>c(!1),renderInput:n=>(0,d.jsx)(i.TextField,{...n,label:e,placeholder:t,variant:`outlined`,sx:{backgroundColor:e=>o?`white`:e.palette[`gr-base-dark`].main,borderTopLeftRadius:`18px`,borderTopRightRadius:`18px`,borderBottomLeftRadius:s?`0px`:`18px`,borderBottomRightRadius:s?`0px`:`18px`,color:o?`black !important`:`white !important`,"& .MuiChip-root":{maxWidth:`100px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},"& .MuiAutocomplete-tag":{maxHeight:`32px`,overflow:`hidden`,display:`inline-flex`,flexWrap:`nowrap`},"& .MuiAutocomplete-inputRoot":{flexWrap:`nowrap`}},color:`gr-yellow`,focused:!0}),renderValue:(e,t)=>e.map((e,n)=>{let{key:r,...a}=t({index:n});return(0,d.jsx)(i.Tooltip,{title:e.highlight?.tooltip,sx:{borderRadius:`24px`},children:(0,d.jsx)(i.Chip,{variant:`filled`,label:e.label,size:`small`,...a,sx:{bgcolor:t=>e.highlight?.active?`${t.palette[`gr-orange`].main}20`:`${t.palette[`gr-grey`].main}20`,color:e=>e.palette[`gr-base-dark`].main,"& .MuiChip-deleteIcon":{color:e=>e.palette[`gr-base-dark`].main,"&:hover":{color:e=>e.palette[`gr-base-dark`].main}},border:e.highlight?.active?`1px solid`:`none`,borderColor:t=>e.highlight?.active?t.palette[`gr-orange`].main:`none`}},r)})}),popupIcon:(0,d.jsx)(A.default,{sx:{color:o?`black`:`white`}}),slotProps:{paper:{sx:{maxHeight:`500px`,borderBottomLeftRadius:`32px`,borderBottomRightRadius:`32px`,borderTopLeftRadius:`0px`,borderTopRightRadius:`0px`,backgroundColor:e=>o?`white`:e.palette[`gr-base-dark`].main,color:o?`black`:`white`}},chip:{sx:{bgcolor:e=>o?`${e.palette[`gr-grey`].light} !important`:`${e.palette[`gr-grey`].main} !important`,color:o?`black`:`white`},size:`small`,deleteIcon:(0,d.jsx)(C.default,{sx:{color:o?`black !important`:`white !important`}})}},limitTags:2,size:`small`})})},eE=({label:e,value:t,setValue:n,values:r,placeholder:a,disabled:o,fullWidth:s,white:c})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{labelId:`filter-table-label-${e}`,id:`filter-${e}`,value:t,label:e,onChange:e=>n(e.target.value),color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx}}),MenuProps:{slotProps:{paper:{style:{maxHeight:`500px`,borderBottomLeftRadius:`32px`,borderBottomRightRadius:`32px`,borderTopLeftRadius:`0px`,borderTopRightRadius:`0px`}},list:{sx:{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},displayEmpty:!0,disabled:o,children:[(0,d.jsx)(i.MenuItem,{sx:{mt:2},disabled:!0,value:``,children:(0,d.jsx)(`em`,{children:a})}),r.map(e=>(0,d.jsx)(i.MenuItem,{value:e.value,children:e.label},e.value))]})]})}),tE=({item:e,path:t})=>e.children.length===0?(0,d.jsx)(M.TreeItem,{itemId:`${t}/${e.id}`,label:e.name,disabled:e.disabled,onClick:()=>{e.onClick&&e.onClick(`${t}/${e.id}`)}}):(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(M.TreeItem,{itemId:`${t}/${e.id}`,label:e.name,disabled:e.disabled,children:e.children.map(n=>(0,d.jsx)(tE,{item:n,path:`${t}/${e.id}`},n.id))})}),nE=({items:e})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(j.SimpleTreeView,{sx:{borderRadius:`16px`,border:e=>`1px solid ${e.palette[`gr-base-dark`].main}`,p:1.5},children:e.map(e=>(0,d.jsx)(tE,{item:e,path:`origin`},e.id))})}),rE=({label:e,initialValue:t,value:n,setValue:r,disabled:i,fullWidth:a,white:o})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.TimeField,{label:e,disabled:i,format:`HH:mm`,ampm:!1,defaultValue:t,value:n,autoFocus:!0,onChange:e=>{r(e)},slotProps:{textField:{variant:`outlined`,size:`small`,fullWidth:a,color:`gr-yellow`,focused:!0,sx:{borderRadius:`16px`},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`},endAdornment:(0,d.jsx)(N.default,{style:{color:o?`black`:`white`}})}}}}})}),iE=({label:e,initialValue:t,value:n,setValue:r,disabled:i,white:a,fullWidth:o})=>{let{format:s,singleShortcut:c}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.DatePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:i,format:s,slotProps:{shortcuts:{items:c},textField:{variant:`outlined`,size:`small`,fullWidth:o,color:`gr-yellow`,focused:!0,slotProps:{input:{sx:{borderRadius:`16px`,color:a?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:a?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>e.palette[`gr-base-dark`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:a?`white`:`black`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},aE=({label:e,initialValue:t,value:n,setValue:r,calendars:i,disabled:a,white:o,fullWidth:s})=>{let{format:c,rangeShortcut:u}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(b.DateRangePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:a,format:c,calendars:i,slotProps:{shortcuts:{items:u},textField:{variant:`outlined`,size:`small`,fullWidth:s,color:`gr-yellow`,focused:!0,slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiPickersArrowSwitcher-root":{color:e=>e.palette[`gr-base-dark`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:o?`white`:`black`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},oE=({initialValue:e,value:t,setValue:n,calendars:r,disabled:i,white:a})=>{let{rangeShortcut:o}=(0,l.useContext)(W);return(0,d.jsx)(P.StaticDateRangePicker,{defaultValue:e,value:t,onChange:e=>{n(e),console.log(`Selected Range:`,e)},calendars:r,disabled:i,sx:{width:`560px`,overflowX:`auto`,borderRadius:`20px`,"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiYearCalendar-button":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiButtonBase-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiPickersArrowSwitcher-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiPickersDay-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiChip-label":{color:e=>`${e.palette[`gr-base-dark`].main} !important`},"& .MuiTypography-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiPickersCalendarHeader-label":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main}},slotProps:{shortcuts:{items:o},actionBar:{actions:[]},layout:{sx:{borderRadius:`20px !important`,bgcolor:a?`white !important`:`black !important`}}}})},sE=({data:e,setData:t,columnLabels:n,buttons:r})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.Grid,{sx:{overflow:`hidden`},container:!0,spacing:2,children:[(0,d.jsxs)(i.Grid,{size:1,children:[(0,d.jsx)(i.Button,{variant:`contained`,size:`small`,color:`gr-base-dark`,sx:{borderRadius:`20px`,height:`40px`,maxWidth:`40px`,minWidth:`40px`,width:`40px`,p:1,mt:7,mb:2},onClick:()=>t(e.slice(0,-1)),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:`#FFFFFF`,fontSize:`18px`},children:`remove`})}),(0,d.jsx)(i.Button,{variant:`contained`,size:`small`,color:`gr-base-dark`,sx:{borderRadius:`20px`,height:`40px`,maxWidth:`40px`,minWidth:`40px`,width:`40px`,p:1},onClick:()=>t([...e,n.map(()=>({value:``}))]),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:`#FFFFFF`,fontSize:`18px`},children:`add`})})]}),(0,d.jsx)(i.Grid,{size:11,children:(0,d.jsxs)(i.Grid,{container:!0,children:[(0,d.jsx)(i.Grid,{size:8,sx:{bgcolor:e=>e.palette[`gr-base-dark`].main,borderTopLeftRadius:`20px`,p:1.5,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1},children:r.map((e,t)=>(0,d.jsxs)(i.Button,{sx:{borderRadius:`20px`,textTransform:`none`},variant:`outlined`,size:`small`,color:`gr-base-light`,onClick:e.onClick,children:[e.label,(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{ml:1,mt:-.5,color:`#FFFFFF`,fontSize:`18px`},children:e.icon})]},t))}),(0,d.jsx)(i.Grid,{size:4,sx:{bgcolor:e=>e.palette[`gr-base-dark`].main,borderTopRightRadius:`20px`,p:1.5,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1}}),(0,d.jsx)(i.Grid,{size:12,sx:{overflowX:`auto`,width:`55vh`,borderBottomLeftRadius:`20px`,borderBottomRightRadius:`20px`},children:(0,d.jsx)(F.default,{data:e,columnLabels:n,onChange:e=>t(e),className:``})})]})})]})}),cE=e=>{let t=(0,l.useRef)(null);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(D.default,{nodeRef:t,handle:`#draggable-dialog-title`,cancel:`[class*="MuiDialogContent-root"]`,children:(0,d.jsx)(i.Paper,{...e,ref:t,sx:{bgcolor:`white`,color:e=>e.palette.background.paper,padding:`20px`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,gap:`50px`,borderRadius:`20px`}})})})},lE=({title:e,alert:t,action:n,fields:r,open:a,setOpen:o,loading:s,onClickSave:c,showAlertUnsavedChanges:u=!0})=>{let[f,p]=(0,l.useState)(!1),m=(e,t)=>{switch(e.element){case`TextField`:let[r,a]=(0,l.useState)(!1);return e.hide?null:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.TextField,{fullWidth:!0,variant:`outlined`,label:e.label,type:r?`text`:e.type,placeholder:e.placeholder,focused:!0,value:e.value,multiline:e.multiline,rows:e.rows,onChange:t=>{e.setValue(t.target.value)},disabled:e.disable||n?.actionButton?.loading,slotProps:{input:{endAdornment:e.type===`password`?(0,d.jsx)(i.InputAdornment,{position:`end`,children:(0,d.jsx)(i.IconButton,{"aria-label":r?`Ocultar contraseña`:`Mostrar contraseña`,onClick:()=>{a(!r)},edge:`end`,sx:{color:e=>e.palette[`gr-grey`].main},children:r?(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,children:`visibility_off`}):(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,children:`visibility`})})}):void 0}},size:`small`})},t);case`SelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(eE,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`DateField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(QT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`CheckboxField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.FormGroup,{children:(0,d.jsx)(i.FormControlLabel,{control:(0,d.jsx)(i.Checkbox,{sx:{ml:1.5,color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}},checked:e.value,onChange:t=>e.setValue(t.target.checked),disabled:!!(e.disable||n?.actionButton?.loading)}),label:e.label})})},t);case`CheckboxGroup`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.FormGroup,{children:e.checkboxs.map((e,t)=>(0,d.jsx)(i.FormControlLabel,{control:(0,d.jsx)(i.Checkbox,{sx:{ml:1.5,color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}},checked:e.value,onChange:t=>e.setValue(t.target.checked)}),label:e.label},t))})},t);case`RadioGroupField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsxs)(i.FormControl,{sx:{mt:e.label.text?`none`:`-7px`},children:[(0,d.jsx)(i.FormLabel,{children:e.label.text}),(0,d.jsx)(i.RadioGroup,{value:e.value,onChange:t=>e.setValue(t.target.value),row:e.row,children:e.radios.map((e,t)=>(0,d.jsx)(i.FormControlLabel,{value:e.value,control:(0,d.jsx)(i.Radio,{sx:{color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}}}),label:e.label.text,labelPlacement:e.label.position,disabled:e.disable},t))})]})},t);case`AutoCompleteField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)($T,{label:e.label,placeholder:`Seleccionar`,values:e.values,value:e.value,setValue:e.setValue,white:!0})},t);case`ListField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.List,{dense:!0,sx:{borderRadius:`16px`,border:t=>e.border?`1px solid ${t.palette[`gr-grey`].dark}`:`none`},children:e.items.map((t,n)=>(0,d.jsxs)(i.ListItem,{secondaryAction:e.action,children:[t.icon&&(0,d.jsx)(i.ListItemIcon,{children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:t.icon?.color},children:t.icon?.name})}),(0,d.jsx)(i.ListItemText,{primary:t.primaryText,secondary:t.secondaryText})]},n))})},t);case`TreeviewField`:return(0,d.jsxs)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:[(0,d.jsx)(i.Typography,{variant:`body1`,children:e.label}),(0,d.jsx)(nE,{items:e.items})]},t);case`TimeField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(rE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`TypographyField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.Typography,{variant:`body1`,children:e.text})},t);case`DatePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(iE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!!e.white})},t)});case`DateRangePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(aE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t)});case`DateRangeCalendarField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(oE,{initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:!!(e.disable||n?.actionButton?.loading),white:e.white})},t)});case`SheetField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(sE,{data:e.data,setData:e.setData,columnLabels:e.columnLabels,buttons:e.buttons})},t)});case`DividerField`:return(0,d.jsx)(i.Grid,{size:12,sx:{mb:`20px`},children:(0,d.jsx)(i.Box,{sx:{width:`100%`,height:`1px`,bgcolor:e=>e.palette[`gr-grey`].dark}})},t);case`CustomField`:return(0,d.jsx)(i.Grid,{size:12,sx:{mb:`20px`},children:e.content},t);default:return(0,d.jsx)(d.Fragment,{})}},h=()=>{r.forEach(e=>{switch(e.element){case`TextField`:e.setValue(e.initialValue);break;case`SelectField`:e.setValue(e.initialValue);break;case`DateField`:e.setValue(e.initialValue);break;case`CheckboxField`:e.setValue(e.initialValue);break;case`CheckboxGroup`:e.checkboxs.forEach(e=>{e.setValue(e.initialValue)});break;case`AutoCompleteField`:e.setValue(e.initialValue);break;case`ListField`:break;case`TreeviewField`:break;case`TimeField`:e.setValue(e.initialValue);break;case`DatePickerField`:e.setValue(e.initialValue);break;case`DateRangePickerField`:e.setValue(e.initialValue);break;case`TypographyField`:break;case`DateRangeCalendarField`:e.setValue(e.initialValue);break;case`RadioGroup`:e.setValue(e.initialValue)}}),p(!1)},g=e=>{e.some(e=>{if(e.element===`CheckboxGroup`)return e.checkboxs.some(e=>e.value!==e.initialValue);if(e.element===`CheckboxField`||e.element===`TextField`||e.element===`SelectField`||e.element===`DateField`)return e.value!==e.initialValue;if(e.element===`AutoCompleteField`)return JSON.stringify(e.value.sort())!==JSON.stringify(e.initialValue.sort());if(e.element===`TimeField`||e.element===`DatePickerField`)return e.value!==e.initialValue;if(e.element===`DateRangePickerField`||e.element===`DateRangeCalendarField`)return JSON.stringify(e.value)!==JSON.stringify(e.initialValue);if(e.element===`RadioGroup`)return e.value!==e.initialValue})?p(!0):o(!1)};return(0,l.useEffect)(()=>{a||h()},[a]),(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.Dialog,{open:a,onClose:()=>{u?g(r):(h(),o(!1))},PaperComponent:cE,"aria-labelledby":`draggable-dialog-title`,children:[(0,d.jsxs)(i.DialogTitle,{style:{cursor:`move`,textAlign:`left`,margin:0,padding:0,width:`100%`},id:`draggable-dialog-title`,children:[e,(0,d.jsx)(i.IconButton,{sx:{position:`absolute`,right:10,top:10},onClick:()=>g(r),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:e=>e.palette[`gr-base-dark`].main,fontSize:`24px`},children:`close`})})]}),f&&u&&t&&(0,d.jsx)(i.DialogContent,{sx:{padding:0,margin:0,width:`100%`,overflow:`hidden`,minHeight:`85px`},children:(0,d.jsxs)(i.Alert,{icon:(0,d.jsx)(O.default,{}),sx:{borderRadius:`24px`,bgcolor:`#FFEFE5`,border:e=>`1px solid ${e.palette[`gr-orange`].main}`,"& .MuiAlert-icon":{color:e=>e.palette[`gr-orange`].main}},action:(0,d.jsxs)(i.Box,{sx:{mt:3.75},children:[(0,d.jsx)(i.Button,{color:`gr-grey`,size:`small`,onClick:()=>p(!1),children:(0,d.jsx)(`b`,{children:t.actionButton.buttonText})}),(0,d.jsx)(i.Button,{color:`gr-grey`,size:`small`,onClick:()=>{h(),o(!1)},children:(0,d.jsx)(`b`,{children:t.cancelButton.buttonText})})]}),children:[(0,d.jsx)(i.AlertTitle,{children:t.title}),(0,d.jsx)(i.Typography,{variant:`body2`,children:t.message})]})}),(0,d.jsxs)(i.DialogContent,{sx:{padding:0,margin:0,position:`relative`,overflow:s?`hidden`:`auto`},children:[(0,d.jsx)(i.Grid,{container:!0,spacing:2,sx:{mt:1,visibility:s?`hidden`:`visible`},children:r.map((e,t)=>m(e,t))}),s&&(0,d.jsx)(i.Box,{sx:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:(0,d.jsx)(i.CircularProgress,{size:60})})]}),(0,d.jsxs)(i.DialogActions,{sx:{display:`flex`,flexDirection:`row`,justifyContent:`flex-end`,alignItems:`center`,width:`100%`},children:[n?.cancelButton&&(0,d.jsx)(i.Button,{variant:`outlined`,autoFocus:!0,onClick:()=>{u?g(r):(h(),o(!1))},sx:{minWidth:`130px`,borderRadius:`44px`,fontWeight:`500`,textTransform:`none`},color:`gr-base-dark`,children:n.cancelButton?.buttonText}),n?.actionButton&&(0,d.jsx)(i.Button,{variant:`contained`,onClick:()=>{c()},sx:{minWidth:`130px`,borderRadius:`44px`,color:`white`,fontWeight:`500`,textTransform:`none`},color:`gr-base-dark`,disableElevation:!0,disabled:n.actionButton.disabled,loading:n.actionButton.loading,children:n.actionButton.buttonText})]})]})})},uE={error:``,warning:``,success:``,suggestion:``,info:``},dE={error:Op.feedbackError,warning:Op.feedbackWarning,success:Op.feedbackSuccess,suggestion:Op.feedbackSuggestion,info:Op.feedbackInfo};function fE({type:e=`info`,title:t,children:n,message:r,onClose:i,closeLabel:a=`Close message`,actions:o,hideIcon:s=!1,className:c}){let l=n??r,u=t??uE[e]??``,f=!!o?.length;return(0,d.jsxs)(`div`,{className:Z(`rb-message-alert`,`rb-message-alert--${e}`,s&&`rb-message-alert--no-icon`,f&&`rb-message-alert--with-actions`,c),role:e===`error`||e===`warning`?`alert`:`status`,children:[s?null:(0,d.jsx)(`span`,{className:`rb-message-alert__icon`,"aria-hidden":`true`,children:(0,d.jsx)(`img`,{src:dE[e],alt:``,className:`size-6`,draggable:!1})}),(0,d.jsxs)(`div`,{className:`rb-message-alert__content`,children:[u?(0,d.jsx)(`div`,{className:`rb-message-alert__title`,children:u}):null,l?(0,d.jsx)(`div`,{className:`rb-message-alert__text`,children:l}):null]}),f?(0,d.jsx)(`div`,{className:`rb-message-alert__actions`,children:o?.map((e,t)=>(0,d.jsx)(R_,{type:`button`,variant:`ghost`,size:`s`,onClick:e.onClick,disabled:e.disabled,children:e.label},t))}):null,i?(0,d.jsx)(`button`,{type:`button`,className:`rb-message-alert__close`,onClick:i,"aria-label":a,children:(0,d.jsx)(`img`,{src:Op.close,alt:``,className:`size-4`,draggable:!1})}):null]})}var pE=`Ir a inicio`,mE=(0,d.jsx)(`span`,{className:`material-symbols-rounded`,children:`inventory_2`}),hE=(0,d.jsx)(`span`,{className:`material-symbols-rounded`,children:`article`}),gE=`Necesitas permisos adicionales`,_E=`No pudimos encontrar esta página`,vE=`Es posible que el enlace haya cambiado, esté deshabilitado o la dirección se haya ingresado de forma incorrecta.`;function yE(e){let t=!!(e&&e.length>0);return(0,d.jsxs)(d.Fragment,{children:[`Por configuración de tu perfil, actualmente no cuentas con el acceso habilitado para esta vista.`,(0,d.jsx)(`br`,{}),`Si consideras que necesitas trabajar en esta pantalla, por favor contacta al administrador de tu cuenta para actualizar tu configuración.`,t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),(0,d.jsx)(`br`,{}),`Los permisos que se requieren son:`,(0,d.jsx)(`span`,{className:`rb-empty-state__permissions`,role:`list`,children:e.map(e=>(0,d.jsxs)(`span`,{role:`listitem`,children:[`• `,e]},e))})]}):null]})}function bE({variant:e=`empty`,context:t=`page`,icon:n,title:r,description:i,primaryAction:a,secondaryAction:o,permissions:s,onGoHome:c,homePath:l=`/`,hideIcon:u=!1,hideTitle:f=!1,hideDescription:p=!1,hidePrimaryAction:m=!1,hideSecondaryAction:h=!1,className:g}){let _=e!==`empty`,v=n??(_?hE:mE),y=e===`no-permission`?gE:e===`not-found`?_E:r,b=e===`no-permission`?yE(s):e===`not-found`?vE:i,x=_?{label:pE,onClick:c??(()=>window.location.assign(l))}:a,S=!u,C=(_||!f)&&!!y,w=(_||!p)&&!!b,T=(_||!m)&&!!x,E=!_&&!h&&!!o,D=T||E;return(0,d.jsxs)(`div`,{className:Z(`rb-empty-state`,`rb-empty-state--${t}`,g),children:[S?(0,d.jsx)(`span`,{className:`rb-empty-state__icon`,"aria-hidden":`true`,children:v}):null,C?(0,d.jsx)(`h4`,{className:`rb-empty-state__title h4`,children:y}):null,w?(0,d.jsx)(`p`,{className:`rb-empty-state__description p1`,children:b}):null,D?(0,d.jsxs)(`div`,{className:`rb-empty-state__actions`,children:[E?(0,d.jsx)(R_,{type:`button`,size:`s`,variant:`secondary`,onClick:o?.onClick,disabled:o?.disabled,children:o?.label}):null,T?(0,d.jsx)(R_,{type:`button`,size:`s`,variant:`primary`,onClick:x?.onClick,disabled:x?.disabled,children:x?.label}):null]}):null]})}var xE={s:`max-w-[var(--form-shell-s)]`,m:`max-w-[var(--form-shell-m)]`,l:`max-w-[var(--form-shell-l)]`},SE=16,CE=[`button:not([disabled])`,`a[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function wE(e){return e?Array.from(e.querySelectorAll(CE)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`):[]}function TE(e,t,n){return Math.min(Math.max(e,t),n)}function EE({open:e,title:t,ariaLabel:n,alert:r,children:i,footer:a,onClose:o,loading:s=!1,loadingLabel:c=`Cargando`,closeLabel:u=`Cerrar`,size:f=`m`,draggable:p=!0,closeOnEscape:m=!0,closeOnBackdrop:h=!1,className:g,headerClassName:_,bodyClassName:v,footerClassName:y,marginY:b=0}){let x=(0,l.useId)(),S=(0,l.useRef)(null),C=(0,l.useRef)(null),[w,T]=(0,l.useState)({x:0,y:0}),[E,D]=(0,l.useState)(!1),O=(0,l.useRef)({mouseX:0,mouseY:0,startX:0,startY:0});if((0,l.useEffect)(()=>{e||(T({x:0,y:0}),D(!1))},[e]),(0,l.useEffect)(()=>{if(!e||typeof document>`u`)return;C.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let t=window.requestAnimationFrame(()=>{(wE(S.current)[0]??S.current)?.focus()});return()=>{window.cancelAnimationFrame(t),C.current?.focus()}},[e]),(0,l.useEffect)(()=>{if(!e)return;let t=e=>{if(e.key===`Escape`&&m){e.preventDefault(),o?.();return}if(e.key!==`Tab`||!S.current)return;let t=wE(S.current);if(t.length===0){e.preventDefault(),S.current.focus();return}let n=t[0],r=t[t.length-1],i=document.activeElement;if(e.shiftKey&&i===n){e.preventDefault(),r.focus();return}!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t)}},[e,o,m]),!e)return null;let k=e=>{!p||e.button!==0||e.target instanceof HTMLElement&&e.target.closest(`[data-form-shell-close]`)||(D(!0),O.current={mouseX:e.clientX,mouseY:e.clientY,startX:w.x,startY:w.y},e.currentTarget.setPointerCapture?.(e.pointerId))},A=e=>{if(!p||!E)return;let t=e.clientX-O.current.mouseX,n=e.clientY-O.current.mouseY,r=O.current.startX+t,i=O.current.startY+n,a=S.current;if(!a){T({x:r,y:i});return}let o=SE,s=Math.max(0,(window.innerWidth-a.offsetWidth)/2-o),c=Math.max(0,(window.innerHeight-a.offsetHeight)/2-o);T({x:TE(r,-s,s),y:TE(i,-c,c)})},j=e=>{p&&(D(!1),e.currentTarget.releasePointerCapture?.(e.pointerId))};return(0,d.jsx)(Xw,{children:(0,d.jsx)(`div`,{className:`rb-modal-layer fixed inset-0 flex items-center justify-center bg-[rgba(0,0,0,0.24)] p-4`,role:`presentation`,onPointerDown:e=>{!h||e.target!==e.currentTarget||o?.()},children:(0,d.jsx)(`section`,{ref:S,role:`dialog`,tabIndex:-1,"aria-modal":`true`,"aria-labelledby":t?x:void 0,"aria-label":t?void 0:n??`Formulario`,"aria-busy":s||void 0,className:Z(`relative flex h-fit w-full min-w-0`,`flex-col overflow-hidden`,`font-sans`,`max-h-[calc(100dvh-2rem)]`,`rounded-[var(--r-m)]`,`border border-[var(--border)]`,`bg-[var(--surface-elevated)]`,`text-[var(--text)]`,`shadow-none`,`p-4 min-[36rem]:p-5`,xE[f],g),style:{transform:`translate(${w.x}px, ${w.y}px)`},children:(0,d.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-[var(--surface-elevated)]`,children:[(0,d.jsx)(`header`,{className:Z(`flex shrink-0`,`touch-none select-none`,`items-start gap-3 pr-10`,`bg-[var(--surface-elevated)]`,p?E?`cursor-grabbing`:`cursor-move`:`cursor-default`,_),onPointerDown:k,onPointerMove:A,onPointerUp:j,onPointerCancel:j,children:(0,d.jsx)(`div`,{className:`min-w-0 flex-1`,children:t?(0,d.jsx)(`h2`,{id:x,className:`h4 truncate`,children:t}):null})}),o?(0,d.jsx)(`button`,{type:`button`,"data-form-shell-close":!0,onClick:o,"aria-label":u,className:Z(`motion-fast`,`absolute right-4 top-4`,`z-20 flex size-8`,`items-center justify-center`,`rounded-full`,`min-[36rem]:right-5`,`min-[36rem]:top-5`,`bg-transparent`,`text-[var(--text)]`,`hover:bg-[var(--interaction-hover)]`,`focus-visible:outline-none`,`focus-visible:shadow-[var(--focus-ring-shadow)]`),children:(0,d.jsx)(`img`,{src:Op.close,alt:``,className:`size-4`,draggable:!1})}):null,r?(0,d.jsx)(`div`,{className:`p1 mt-5 shrink-0 bg-[var(--surface-elevated)]`,children:r}):null,(0,d.jsxs)(`div`,{className:Z(`relative flex min-h-0 flex-1`,`flex-col overflow-hidden`,`bg-[var(--surface-elevated)]`,`${`my-${r?`5`:`${b===0?`8`:`${b}`}`}`}`),children:[(0,d.jsx)(`div`,{className:Z(`min-h-0 flex-1`,`overflow-x-hidden`,`overflow-y-auto`,`bg-[var(--surface-elevated)] pr-1`,s&&`overflow-hidden`,v),children:(0,d.jsx)(`div`,{className:Z(`p1 min-w-0 pt-3`,s&&`invisible`),children:i})}),s?(0,d.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:` absolute inset-0 flex items-center justify-center bg-[var(--loading-overlay)]`,children:[(0,d.jsx)(`div`,{className:Z(`size-10 animate-spin`,`rounded-full border-4`,`border-[color-mix(in_oklab,var(--text)_14%,transparent)]`,`border-t-[var(--text)]`),"aria-hidden":`true`}),(0,d.jsx)(`span`,{className:`sr-only`,children:c})]}):null]}),a?(0,d.jsx)(`footer`,{className:Z(`shrink-0`,`bg-[var(--surface-elevated)]`,y),children:a}):null]})})})})}var DE={compact:`gap-y-6`,default:`gap-y-8`,relaxed:`gap-y-10`,loose:`gap-y-12`,spacious:`gap-y-16`},OE={compact:`gap-x-4`,default:`gap-x-5`,wide:`gap-x-6`},kE={1:`col-span-12 min-[36rem]:col-span-1`,2:`col-span-12 min-[36rem]:col-span-2`,3:`col-span-12 min-[36rem]:col-span-3`,4:`col-span-12 min-[36rem]:col-span-4`,5:`col-span-12 min-[36rem]:col-span-5`,6:`col-span-12 min-[36rem]:col-span-6`,7:`col-span-12 min-[36rem]:col-span-7`,8:`col-span-12 min-[36rem]:col-span-8`,9:`col-span-12 min-[36rem]:col-span-9`,10:`col-span-12 min-[36rem]:col-span-10`,11:`col-span-12 min-[36rem]:col-span-11`,12:`col-span-12`};function AE({children:e,rowGap:t=`default`,columnGap:n=`default`,className:r,...i}){return(0,d.jsx)(`div`,{className:Z(`grid w-full min-w-0 grid-cols-12 items-start`,DE[t],OE[n],r),...i,children:e})}function jE({children:e,span:t=12,className:n,...r}){return(0,d.jsx)(`div`,{className:Z(`w-full min-w-0 self-start`,`[&>*]:w-full [&>*]:min-w-0 [&>*]:max-w-full`,kE[t],n),...r,children:e})}var ME=(0,l.forwardRef)(function({children:e,variant:t=`plain`,size:n=`m`,divided:r=!1,emptyState:i=`No hay elementos disponibles.`,className:a,...o},s){let c=l.Children.toArray(e),u=c.length>0;return(0,d.jsx)(`ul`,{ref:s,className:Z(`rb-list`,`rb-list--${t}`,`rb-list--${n}`,r&&`rb-list--divided`,a),...o,children:u?c:i==null?null:(0,d.jsx)(`li`,{className:`rb-list__empty p1`,children:i})})}),NE=(0,l.forwardRef)(function({children:e,icon:t,actions:n,selected:r=!1,disabled:i=!1,className:a,onClick:o,onClickCapture:s,onKeyDown:c,onKeyDownCapture:l,role:u,tabIndex:f,...p},m){let h=!!o&&!n&&!i;return(0,d.jsxs)(`li`,{ref:m,className:Z(`rb-list-item`,a),"data-selected":r||void 0,"data-disabled":i||void 0,"data-interactive":h||void 0,"data-has-actions":!!n||void 0,"data-has-icon":!!t||void 0,"aria-disabled":i||void 0,role:u??(h?`button`:void 0),tabIndex:f??(h?0:void 0),onClick:i?void 0:o,onClickCapture:e=>{if(i){e.preventDefault(),e.stopPropagation();return}s?.(e)},onKeyDownCapture:e=>{if(i){e.preventDefault(),e.stopPropagation();return}l?.(e)},onKeyDown:e=>{c?.(e),!(e.defaultPrevented||!h||e.repeat)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click())},...p,children:[(0,d.jsxs)(`div`,{className:`rb-list-item__content`,children:[t?(0,d.jsx)(`span`,{className:`rb-list-item__icon`,"aria-hidden":`true`,children:t}):null,(0,d.jsx)(`div`,{className:`rb-list-item__body p1`,children:e})]}),n?(0,d.jsx)(`div`,{className:`rb-list-item__actions`,children:n}):null]})});function PE(...e){return e.filter(Boolean).join(` `)}function FE({value:e,items:t,onChange:n,className:r,ariaLabel:i=`Pestañas`}){return(0,d.jsx)(`div`,{role:`tablist`,"aria-label":i,className:PE(`inline-flex w-fit max-w-full items-center rounded-full bg-white p-1`,`shadow-[0_1px_2px_rgba(0,0,0,0.03)]`,r),children:t.map(t=>{let r=t.value===e;return(0,d.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,disabled:t.disabled,onClick:()=>{t.disabled||n(t.value)},className:PE(`inline-flex h-11 items-center justify-center rounded-full px-5 sm:px-6`,`p1 font-semibold leading-none transition-colors`,`min-w-[9rem]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`,r?`bg-[var(--base-dark)] text-white`:`bg-transparent text-[var(--base-dark)] hover:bg-[color-mix(in_oklab,var(--base-dark)_4%,transparent)]`,t.disabled&&`cursor-not-allowed opacity-50 hover:bg-transparent`),children:t.label},t.value)})})}function IE(...e){return e.filter(Boolean).join(` `)}function LE({value:e,items:t,onChange:n,onClose:r,closeLabel:i=`Cerrar`,ariaLabel:a=`Pestañas`,className:o,children:s}){return(0,d.jsxs)(`div`,{className:IE(`flex w-full flex-col items-start gap-6`,`rounded-[20px] bg-white p-5`,o),children:[(0,d.jsxs)(`div`,{className:`flex w-full items-center gap-4`,children:[(0,d.jsx)(`div`,{role:`tablist`,"aria-label":a,className:`flex w-full flex-1 flex-wrap items-center gap-3`,children:t.map(t=>{let r=t.value===e;return(0,d.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,disabled:t.disabled,onClick:()=>{t.disabled||n(t.value)},className:IE(`inline-flex h-10 items-center justify-center rounded-full px-5`,`p2 font-semibold leading-none transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`,r?`bg-[var(--base-dark)] text-white`:`bg-[var(--g-100)] text-[var(--base-dark)] hover:bg-[var(--g-200)]`,t.disabled&&`cursor-not-allowed opacity-40 hover:bg-[var(--g-100)]`),children:t.label},t.value)})}),r&&(0,d.jsx)(`button`,{type:`button`,onClick:r,"aria-label":i,className:IE(`inline-flex size-11 shrink-0 items-center justify-center rounded-full`,`bg-white text-[var(--base-dark)]`,`transition-colors hover:bg-[var(--interaction-hover)]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`),children:(0,d.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,d.jsx)(`path`,{d:`M2 2L14 14M14 2L2 14`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`})})})]}),s&&(0,d.jsx)(`div`,{className:`w-full`,children:s})]})}function RE(...e){return Z(...e)}function zE(e){return`field`in e}function BE(e=[]){return e.filter(e=>e.show!==!1).map(e=>{if(!zE(e))return e;let t=e.field,n=VE(e),r=e.cellClassName;return{key:t,header:e.headerName??e.header??t,show:e.show,width:n,minWidth:e.minWidth,maxWidth:e.maxWidth,align:e.align??e.headerAlign??`left`,fullWidthRender:e.fullWidthRender,headerClassName:e.headerClassName,sortable:e.sortable,filterable:e.filterable,cellClassName:typeof r==`function`?(e,n)=>r({row:e,index:n,id:HE(e,n),field:t,value:UE(e,t)}):r,render:(n,r)=>{let i={row:n,index:r,id:HE(n,r),field:t,value:UE(n,t)};return e.renderCell?e.renderCell(i):e.valueGetter?e.valueGetter(i):i.value??`—`}}})}function VE(e){return e.width?e.width:e.flex?`${e.flex}fr`:e.minWidth?`minmax(${e.minWidth}px, 1fr)`:`1fr`}function HE(e,t){let n=e?.id;if(n==null||n===``)throw Error(`[RbTable] Cada row debe traer un id obligatorio. Revisa la fila en posición ${t??`desconocida`}.`);return n}function UE(e,t){return e?.[t]}function WE(e){if(!e)return[];if(Array.isArray(e))return e;if(e instanceof Set)return Array.from(e);if(typeof e==`object`&&`ids`in e){let t=e.ids;if(t instanceof Set)return Array.from(t);if(Array.isArray(t))return t}return[]}function GE(e,t){return WE(t).includes(e)}function KE(e,t){let n=WE(t);return n.includes(e)?n.filter(t=>t!==e):[...n,e]}function qE(e,t){return{left:e?.left??t?.left??[],right:e?.right??t?.right??[]}}function JE(e){if(!e)return`minmax(0, 1fr)`;if(typeof e==`number`)return`${e}px`;let t=e.trim();return t.startsWith(`minmax(`)||t.endsWith(`px`)?t:t.includes(`fr`)?`minmax(0, ${t.replace(`fr`,``).trim()||`1`}fr)`:t}function YE(e){if(!e)return 180;if(typeof e==`number`)return e;if(e.endsWith(`px`)){let t=Number(e.replace(`px`,``));return Number.isFinite(t)?t:180}return e.includes(`56`)?56:180}function XE(e){return e===`center`?`text-center justify-center`:e===`right`?`text-right justify-end`:`text-left justify-start`}function ZE(e){return l.default.Children.toArray(e).flatMap(e=>{if(!l.default.isValidElement(e))return e;if(e.type===l.default.Fragment){let t=e.props;return ZE(t.children)}return e})}function QE(e){return e===!0||e===`true`}function $E(e){if(!l.default.isValidElement(e))return!1;let t=e.props,n=e.type;return QE(t[`data-toolbar-actions`])||n.rbToolbarActions===!0}function eD({title:e,description:t,left:n,right:r,className:i}){let a=!!(e||t),o=!!(n||r),s=!!n,c=ZE(r).filter(Boolean);return!a&&!o?null:(0,d.jsxs)(`div`,{className:RE(`rb-table-toolbar`,i),children:[a?(0,d.jsxs)(`div`,{className:`rb-table-toolbar__header`,children:[e?(0,d.jsx)(`div`,{className:`
287
+ `})]});return r?(0,f.createPortal)(a,document.body):null};function DT(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():Math.random().toString(36).slice(2,10)}var OT=()=>({showAlert:(e,t,n={})=>{let r=DT(),i=e===`loading`||e==="default";return gT({id:r,severity:e,message:t,duration:n.duration??(i?void 0:5e3),closeLabel:n.closeLabel}),r},closeAlert:e=>{_T(e)}}),kT=`(max-width: 63.9375rem)`,AT=({sidebar:e,routes:t,account:n})=>{let{state:r,setState:i,getWidth:a}=fe(),[o,s]=(0,l.useState)(()=>typeof window>`u`?!1:window.matchMedia(kT).matches),[c,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=window.matchMedia(kT),t=()=>{let t=e.matches;s(t),t||u(!1)};return t(),e.addEventListener?.(`change`,t),()=>{e.removeEventListener?.(`change`,t)}},[]),(0,d.jsxs)(`div`,{className:`rb-shell rb-shell--${r}`,children:[(0,d.jsx)(Bp,{items:e.items,signOut:e.signOut,tooltips:e.tooltips,state:r,setState:i,getWidth:a,isMobile:o,mobileOpen:c,onCloseMobile:()=>u(!1)}),(0,d.jsx)(dT,{account:n,sidebarItems:e.items,onOpenMobile:o?()=>u(!0):void 0}),(0,d.jsx)(oT,{state:r,getWidth:a,routes:t,account:n}),(0,d.jsx)(ET,{})]})},jT=[`module`,`view`];function MT(){return(0,d.jsx)(`img`,{src:Op.arrowBread,alt:``,"aria-hidden":`true`,className:`size-3 opacity-70`})}function NT(e){return e?decodeURIComponent(e).replaceAll(`-`,` `).replaceAll(`_`,` `).replace(/\s+/g,` `).trim().replace(/\b\w/g,e=>e.toUpperCase()):`—`}function PT(e){let t=e!==`/`&&e.endsWith(`/`)?e.slice(0,-1):e;if(t===`/`)return[];let n=t.split(`/`).filter(Boolean),r=``;return n.map(e=>(r+=`/${e}`,{label:NT(e),to:r}))}function FT({pathname:e,searchParams:t,queryKeys:n,labelFormatter:r}){let i=new URLSearchParams;return n.reduce((n,a)=>{let o=t.get(a);if(!o)return n;i.set(a,o);let s=i.toString();return n.push({label:r?r({key:a,value:o}):NT(o),to:`${e}${s?`?${s}`:``}`}),n},[])}function IT({items:e=[],separator:t=(0,d.jsx)(MT,{}),className:n=``,queryKeys:r=jT,includeHome:i=!0,homeLabel:a=`Home`,homeTo:o=`/`,labelFormatter:s}){let c=(0,u.useNavigate)(),f=(0,u.useLocation)(),[p]=(0,u.useSearchParams)(),m=(0,l.useMemo)(()=>{if(e.length>0)return e;let t=FT({pathname:f.pathname,searchParams:p,queryKeys:r,labelFormatter:s}),n=t.length>0?t:PT(f.pathname);return[...i?[{label:a,to:o}]:[],...n]},[e,f.pathname,p,r,i,a,o,s]);return m.length===0?null:(0,d.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:Z(`max-w-full overflow-hidden`,n),children:(0,d.jsx)(`ol`,{className:`flex min-w-0 flex-wrap items-center gap-2 p2 text-[var(--muted)]`,children:m.map((e,n)=>{let r=n===m.length-1,i=!!e.to&&!r;return(0,d.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2`,children:[n>0&&(0,d.jsx)(`span`,{className:`flex shrink-0 items-center justify-center text-[var(--g-400)]`,"aria-hidden":`true`,children:t}),i?(0,d.jsx)(`button`,{type:`button`,onClick:()=>c(e.to),className:`p2 min-w-0 max-w-[14rem] truncate bg-transparent p-0 text-left text-[var(--muted)] transition-colors hover:text-[var(--text)] hover:underline`,children:e.label}):(0,d.jsx)(`span`,{"aria-current":r?`page`:void 0,className:`p2 min-w-0 max-w-[14rem] truncate font-semibold text-[var(--text)]`,title:typeof e.label==`string`?e.label:void 0,children:e.label})]},`${String(e.label)}-${n}`)})})})}var LT=e=>(0,d.jsx)(AT,{...e}),RT=({sidebar:e,routes:t,product:n,account:r,languages:i,loginForm:a,signup:o,unsavedChangesAlert:s})=>{let{isAuthenticated:c,openUnsaved:u,setOpenUnsaved:f}=(0,l.useContext)(W),p=[{text:s.message,ncolumn:12,element:`TypographyField`}];return(0,d.jsxs)(d.Fragment,{children:[c?(0,d.jsx)(LT,{routes:t,sidebar:e,account:r}):(0,d.jsx)(iT,{product:n,languages:i,form:a,signup:o}),(0,d.jsx)(lE,{title:s.title,open:u,setOpen:f,fields:p,loading:!1,onClickSave:s.actionButton.onClick,action:{actionButton:s.actionButton,cancelButton:s.cancelButton}})]})},zT=({sidebar:e,routes:t,product:n,account:r,languages:o,loginForm:s,signup:c,unsavedChangesAlert:f,msalInstance:g})=>{let{isAuthenticated:_,setIsAuthenticated:v}=(0,l.useContext)(W),[y,b]=(0,l.useState)(0),x=o.find(e=>e.active)||o[0];(0,l.useEffect)(()=>{switch(x.code){case`es`:a.default.locale(`es`);break;case`en`:a.default.locale(`en`);break;case`pt`:a.default.locale(`pt`);break;default:a.default.locale(`en`)}let e=[`token`,`company`,`config`,`privileges`,`account`,`language`,`authenticated`,`type-signin`].filter(e=>localStorage.getItem(e)===null);if(localStorage.getItem(`ues`)===`403`){localStorage.removeItem(`ues`),window.location.href=`/signup`;return}y===0&&window.location.pathname!==`/signup`&&(g.getActiveAccount()&&e.length>0?(console.log(`if 1`),j_(g,g.getActiveAccount())):g.getActiveAccount()&&e.length===0?(console.log(`if 2`),v(!0),localStorage.setItem(`authenticated`,`true`)):!g.getActiveAccount()&&_?(console.log(`if 6`),v(!0)):!g.getActiveAccount()&&e.length===0?(console.log(`if 3`),v(!0),localStorage.setItem(`authenticated`,`true`)):!g.getActiveAccount()&&e.length>0&&(console.log(`if 4`),v(!1),localStorage.setItem(`authenticated`,`false`)),b(y+1))},[x,y]);let S={rabbitLight:de,rabbitDark:(0,i.createTheme)(ue,x.theme.dg,x.theme.core,x.theme.pickers)};return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(Cp,{instance:g,children:(0,d.jsx)(i.Box,{sx:{overflow:`hidden`,height:`100vh`},children:(0,d.jsx)(u.BrowserRouter,{children:(0,d.jsx)(i.ThemeProvider,{theme:S.rabbitDark,children:(0,d.jsx)(m.LocalizationProvider,{dateAdapter:h.AdapterDayjs,adapterLocale:x.code,children:(0,d.jsxs)(p.SnackbarProvider,{maxSnack:15,autoHideDuration:1e4,anchorOrigin:{vertical:`top`,horizontal:`center`},children:[(0,d.jsx)(i.CssBaseline,{}),(0,d.jsx)(RT,{sidebar:e,routes:t,product:n,account:r,languages:o,msalInstance:g,loginForm:s,signup:c,unsavedChangesAlert:f})]})})})})})})})},BT=({children:e})=>{let[t,n]=(0,l.useState)(localStorage.getItem(`authenticated`)===`true`),[r,i]=(0,l.useState)(``),[a,o]=(0,l.useState)(``),[s,c]=(0,l.useState)(``),[u,f]=(0,l.useState)(``),[p,m]=(0,l.useState)(`DD/MM/YYYY`),[h,g]=(0,l.useState)([]),[_,v]=(0,l.useState)([]),[y,b]=(0,l.useState)(!1),[x,S]=(0,l.useState)(``),[C,w]=(0,l.useState)(!1);return(0,d.jsx)(W.Provider,{value:{isAuthenticated:t,setIsAuthenticated:n,user:r,setUser:i,pass:a,setPass:o,avatar:s,setAvatar:c,email:u,setEmail:f,loadingAuth:C,setLoadingAuth:w,format:p,setFormat:m,singleShortcut:h,setSingleShortcut:g,rangeShortcut:_,setRangeShortcut:v,encrypter:(e,t,n)=>{e===`session`?sessionStorage.setItem(t,n):e===`local`&&localStorage.setItem(t,n)},decrypter:(e,t)=>e===`session`?sessionStorage.getItem(t)||``:e===`local`&&localStorage.getItem(t)||``,openUnsaved:y,setOpenUnsaved:b,redirect:x,setRedirect:S},children:e})},VT=({contextMenu:e,setContextMenu:t,options:n,checked:r,optionGroup:a})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.Menu,{open:e!==null,onClose:()=>t(null),anchorReference:`anchorPosition`,anchorPosition:e===null?void 0:{top:e.mouseY,left:e.mouseX},slots:{transition:i.Fade},slotProps:{paper:{sx:{bgcolor:e=>a===`toolbar`?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main,borderRadius:`12px`},elevation:1}},sx:{cursor:`pointer`},children:n.filter(e=>!e.hide).map((e,t)=>(0,d.jsxs)(i.Box,{children:[t!==0&&n[t-1].group!==e.group?(0,d.jsx)(i.Divider,{}):null,(0,d.jsxs)(i.MenuItem,{onClick:e.click,disabled:e.disabled,children:[(0,d.jsx)(i.ListItemIcon,{sx:{color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},children:e.icon}),(0,d.jsx)(i.ListItemText,{children:(0,d.jsx)(i.Typography,{sx:{color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},children:e.name})}),e.selected?(0,d.jsxs)(i.Typography,{sx:{pl:3,color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},variant:`body2`,children:[`selecionados`,`:`,r.length]}):null,e.onlyOne?(0,d.jsx)(i.Typography,{sx:{pl:3,color:e=>a===`toolbar`?e.palette[`gr-base-light`].main:e.palette[`gr-base-dark`].main},variant:`body2`,children:`solo uno`}):null]},t)]},t))}),n.filter(e=>!e.hide).map((e,t)=>(0,d.jsx)(i.Box,{children:e.dialog},t))]}),HT=e=>{let t=[],n=new Map;return e.forEach(e=>{let r=e.group??``;n.has(r)||(n.set(r,t.length),t.push({group:e.group,items:[]})),t[n.get(r)].items.push(e)}),t},UT=({label:e,values:t,placeholder:n,value:r,setValue:a,disabled:o,fullWidth:s,white:c,search:u})=>{let f=(0,l.useRef)(null),p=(0,l.useRef)(null),m=(0,l.useRef)(null),[h,g]=(0,l.useState)({width:0,height:0}),[v,y]=(0,l.useState)(!1),[b,x]=(0,l.useState)(``),S=u?.value??b,C=e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx},onClick:()=>{console.log(`icon click`),y(!v)}});(0,l.useEffect)(()=>{if(!f.current)return;let e=new ResizeObserver(e=>{let{width:t,height:n}=e[0].contentRect;g({width:t,height:n})});return e.observe(f.current),()=>e.disconnect()},[h]),(0,l.useEffect)(()=>{v&&m.current?.focus()},[v]);let w={marginTop:`-55px`,maxHeight:`500px`,borderRadius:`24px`,borderTopLeftRadius:`24px`,borderTopRightRadius:`24px`,width:h.width+20,backgroundColor:`transparent`,"--Paper-overlay":`none`,border:`1px solid rgba(255, 255, 255, 0.2)`};return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{ref:f,labelId:`filter-table-label-${e}`,id:`filter-${e}`,open:v,onOpen:()=>{y(!0)},onClose:e=>{let t=e?.target;t&&p.current?.contains(t)||y(!1)},value:r,label:e,onChange:e=>a(e.target.value),multiple:!1,renderValue:e=>{let r=Array.isArray(e)?e[0]:e;return r==null||r===``?n:t.find(e=>e.value===r)?.label||n},color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:C,MenuProps:{autoFocus:!1,disableAutoFocusItem:!0,slotProps:{paper:{style:w},list:{sx:{marginTop:`60px`,backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},displayEmpty:!0,disabled:o,children:[(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{backgroundColor:`transparent`,px:1.5,py:1},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:(0,d.jsx)(i.TextField,{ref:p,inputRef:m,variant:`standard`,fullWidth:!0,size:`small`,placeholder:u?.placeholder||`Buscar...`,value:S,onMouseDown:e=>{e.stopPropagation(),y(!0)},onClick:e=>{e.stopPropagation(),y(!0)},onKeyDown:e=>{e.stopPropagation()},onChange:e=>{let t=e.target.value;if(u?.setValue){u.setValue(t);return}x(t)},color:`gr-yellow`})}),HT(t).flatMap((e,t)=>{let n=e.items.some(e=>`${e.label} ${e.sublabel??``}`.toLowerCase().includes(S.toLowerCase())),r=e.group?(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{display:n?`block`:`none`,backgroundColor:`transparent`,color:c?`black`:`white`,fontWeight:600},children:e.group},`group-${e.group}-${t}`):null,a=e.items.map(t=>(0,d.jsx)(i.MenuItem,{value:t.value,sx:{display:`${t.label} ${t.sublabel??``}`.toLowerCase().includes(S.toLowerCase())?`block`:`none`},onClick:()=>{y(!1)},children:(0,d.jsxs)(i.Typography,{variant:`caption`,color:`textSecondary`,children:[t.label,t.sublabel&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),t.sublabel]})]})},`${e.group??``}-${t.value}`));return r?[r,...a]:a})]})]})})},WT=({label:e,value:t,setValue:n,values:r,placeholder:a,disabled:o,fullWidth:s,white:c,search:u})=>{let f=(0,l.useRef)(null),p=(0,l.useRef)(null),[m,h]=(0,l.useState)({width:0,height:0}),[g,v]=(0,l.useState)(!1),[y,b]=(0,l.useState)(``),x=u?.value??y,S=r.filter(e=>`${e.label} ${e.sublabel??``}`.toLowerCase().includes(x.toLowerCase())).map(e=>e.value),C=S.filter(e=>t.includes(e)).length,w=S.length>0&&C===S.length,T=C>0&&!w,E=e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx},onClick:()=>{v(!g)}});(0,l.useEffect)(()=>{if(!f.current)return;let e=new ResizeObserver(e=>{let{width:t,height:n}=e[0].contentRect;h({width:t,height:n})});return e.observe(f.current),()=>e.disconnect()},[m]);let D={marginTop:`-55px`,maxHeight:`500px`,borderRadius:`24px`,borderTopLeftRadius:`24px`,borderTopRightRadius:`24px`,width:m.width+20,backgroundColor:`transparent`,"--Paper-overlay":`none`,border:`1px solid rgba(255, 255, 255, 0.2)`};return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{ref:f,labelId:`filter-table-label-${e}`,id:`filter-${e}`,open:g,onOpen:()=>{v(!0)},onClose:e=>{let t=e?.target;t&&p.current?.contains(t)||v(!1)},value:t,label:e,onChange:e=>{let{target:{value:r}}=e,i=typeof r==`string`?r.split(`,`):r;if(i.includes(`select-all`)){if(w){n(t.filter(e=>!S.includes(e)));return}n(Array.from(new Set([...t,...S])));return}n(i.filter(e=>e!==`select-all`))},color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:E,MenuProps:{slotProps:{paper:{style:D},list:{sx:{marginTop:`60px`,backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},renderValue:e=>!e||e.length===0?a:r.filter(t=>e.includes(t.value)).map(e=>e.label).join(`, `),displayEmpty:!0,disabled:o,multiple:!0,children:[(0,d.jsx)(i.ListSubheader,{disableSticky:!0,sx:{backgroundColor:`transparent`,px:1.5,py:1},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:(0,d.jsx)(i.TextField,{ref:p,variant:`standard`,fullWidth:!0,size:`small`,placeholder:u?.placeholder||`Buscar...`,value:x,onMouseDown:e=>{e.stopPropagation(),v(!0)},onClick:e=>{e.stopPropagation(),v(!0)},onKeyDown:e=>{e.stopPropagation()},onChange:e=>{let t=e.target.value;if(u?.setValue){u.setValue(t);return}b(t)},focused:!1,color:`gr-yellow`})}),(0,d.jsxs)(i.MenuItem,{value:`select-all`,disabled:S.length===0,children:[(0,d.jsx)(i.Checkbox,{checked:w,indeterminate:T}),(0,d.jsx)(i.ListItemText,{slotProps:{primary:{sx:{color:`#FFFFFF`}}},primary:`Seleccionar todo`})]}),r.map(e=>(0,d.jsx)(i.MenuItem,{value:e.value,sx:{display:S.includes(e.value)?`block`:`none`},children:(0,d.jsxs)(i.Box,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,d.jsx)(i.Checkbox,{checked:t.includes(e.value)}),(0,d.jsxs)(i.Typography,{variant:`caption`,color:`textSecondary`,children:[e.label,e.sublabel&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),e.sublabel]})]})]})},e.value))]})]})})},GT=({label:e,value:t,setValue:n,disabled:r,fullWidth:i})=>{let{format:a}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(y.LocalizationProvider,{dateAdapter:h.AdapterDayjs,children:(0,d.jsx)(v.SingleInputDateRangeField,{label:e,value:t,onChange:e=>{n(e)},sx:{"& .MuiInputBase-root":{borderRadius:`16px`}},size:`small`,color:`gr-yellow`,slotProps:{textField:{sx:{"& .MuiInputLabel-root":{color:`white !important`}}}},focused:!0,format:a,disabled:r,fullWidth:i})})})},KT=({label:e,initialValue:t,value:n,setValue:r,calendars:i,disabled:a,white:o,fullWidth:s,maxDate:c,minDate:u})=>{let{format:f,rangeShortcut:p}=(0,l.useContext)(W),m=(0,x.useTheme)(),h=(0,x.createTheme)({...m,palette:{...m.palette,primary:{main:`#9D9A95`}}});return(0,d.jsx)(x.ThemeProvider,{theme:h,children:(0,d.jsx)(b.DateRangePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:a,format:f,calendars:i,slotProps:{shortcuts:{items:p},textField:{variant:`outlined`,size:`small`,fullWidth:s,color:`gr-yellow`,focused:!0,sx:{"& .MuiInputLabel-root":{color:o?`black !important`:`white !important`},"& .MuiInputLabel-root.Mui-focused":{color:o?`black !important`:`white !important`},"& .MuiGrid-root":{marginBottom:`0px !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>o?e.palette[`gr-grey`].light:e.palette[`gr-grey`].main},"& .MuiChip-label":{color:o?`black !important`:`white !important`},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>o?e.palette[`gr-base-dark`].main:`white !important`},"& .MuiPickersCalendarHeader-label":{color:o?`black !important`:`white !important`},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>o?e.palette[`gr-base-dark`].main:`white !important`},"& .Mui-disabled":{color:e=>`${e.palette[`gr-grey`].main} !important`},"& .MuiPickersArrowSwitcher-root":{color:`(theme) => theme.palette["gr-base-dark"].main`},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:o?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:e=>o?e.palette[`gr-grey`].light:`black !important`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}},maxDate:c,minDate:u})})},qT=({label:e,initialValue:t,value:n,setValue:r,disabled:i,white:a,fullWidth:o})=>{let{format:s,singleShortcut:c}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.DatePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:i,format:s,slotProps:{shortcuts:{items:c},textField:{variant:`outlined`,size:`small`,fullWidth:o,color:`gr-yellow`,focused:!0,sx:{"& .MuiInputLabel-root":{color:a?`black !important`:`white !important`},"& .MuiInputLabel-root.Mui-focused":{color:a?`black !important`:`white !important`},"& .MuiGrid-root":{marginBottom:`0px !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:a?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:a?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>a?e.palette[`gr-grey`].light:e.palette[`gr-grey`].main},"& .MuiChip-label":{color:a?`black !important`:`white !important`},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>a?e.palette[`gr-base-dark`].main:`white !important`},"& .MuiPickersCalendarHeader-label":{color:a?`black !important`:`white !important`},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>a?e.palette[`gr-base-dark`].main:`white !important`},"& .Mui-disabled":{color:e=>`${e.palette[`gr-grey`].main} !important`},"& .MuiPickersArrowSwitcher-root":{color:`(theme) => theme.palette["gr-base-dark"].main`},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:e=>a?e.palette[`gr-grey`].light:`black !important`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},JT=e=>{let{name:t={title:``,ncolumn:0},fields:n=[],actions:r={ncolumn:1,buttons:[]}}=e,a=(e,t)=>{switch(e.element){case`SelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(UT,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:e.disable,search:e.search,multiple:e.multiple,fullWidth:!0,white:!1})},t);case`MultiSelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(WT,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:e.disable,search:e.search,fullWidth:!0,white:!1})},t);case`DateRangeField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(GT,{label:e.label,value:e.value,setValue:e.setValue,disabled:e.disable,fullWidth:!0})},t);case`DatePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(qT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:e.disable,fullWidth:!0,white:!1})},t)});case`DateRangePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,children:(0,d.jsx)(KT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:e.disable,fullWidth:!0,white:!1,maxDate:e.maxDate,minDate:e.minDate})},t)});default:return(0,d.jsx)(d.Fragment,{})}};return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Box,{sx:{bgcolor:e=>e.palette.background.paper,height:`70px`,borderTopLeftRadius:`20px`,borderTopRightRadius:`20px`,display:`flex`,flexDirection:`row`,alignItems:`center`,justifyContent:`flex-end`,padding:`20px`,gap:`20px`},children:(0,d.jsxs)(i.Grid,{container:!0,spacing:2,sx:{flexGrow:1},children:[t.title&&(0,d.jsx)(i.Grid,{size:t.ncolumn,sx:{display:`flex`,alignItems:`center`},children:t.title}),n.map((e,t)=>a(e,t)),r&&r.buttons.length>0&&(0,d.jsx)(i.Grid,{size:r.ncolumn,children:(0,d.jsx)(i.Box,{sx:{display:`flex`,justifyContent:`flex-end`,alignItems:`center`,gap:`10px`},children:r.buttons.map((e,t)=>(0,d.jsx)(i.Button,{variant:e.variant,color:`gr-yellow`,sx:{...e.sx},onClick:e.onClick,disabled:e.disabled,disableElevation:!0,children:e.icon?e.icon:(0,d.jsx)(`span`,{style:{marginTop:`2px`,textTransform:`none`,padding:`0px 5px`},children:e.text})},t))})})]})})})},YT=e=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(g.DataGridPro,{...e,apiRef:e.apiRef,showToolbar:e.toolbar!==void 0,headerFilters:e.headerFilters,slots:{toolbar:JT,headerFilterMenu:null,...e.slots},slotProps:{...e.slotProps,toolbar:{...e.toolbar},baseTextField:{color:e.toolbar===void 0?`error`:`primary`,slotProps:{input:{endAdornment:(0,d.jsx)(i.InputAdornment,{sx:{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette[`gr-grey`].main},position:`end`,children:(0,d.jsx)(S.default,{})})}}},loadingOverlay:{variant:`circular-progress`,noRowsVariant:`circular-progress`}},sx:{border:`none`,color:`black`,flex:1,borderTopLeftRadius:e.toolbar?`0px`:`20px !important`,borderTopRightRadius:e.toolbar?`0px`:`20px !important`,"--DataGrid-t-color-background-base":`transparent !important`,"& .MuiDataGrid-columnHeaderCheckbox":{backgroundColor:`white`},"& .MuiDataGrid-filler--pinnedLeft":{backgroundColor:`white`},"& .MuiDataGrid-filterForm .MuiInputBase-root":{backgroundColor:`#F3F2F2`},"& .MuiDataGrid-columnHeader":{backgroundColor:e.toolbar?`white`:`transparent`,color:e.toolbar?`black`:`white`,borderBottom:e.headerFilters?`none !important`:e=>`${e.palette.primary.main} 1px solid !important`},"& .MuiDataGrid-headerFilterRow":{bgcolor:e.toolbar?`white !important`:`transparent !important`,borderBottom:e=>`${e.palette.primary.main} 1px solid !important`},"& .MuiDataGrid-virtualScroller":{bgcolor:`white`,borderBottomLeftRadius:e.slots?.footer?`0px`:`20px`,borderBottomRightRadius:e.slots?.footer?`0px`:`20px`},"& .MuiDataGrid-columnHeaderTitleContainer":{"& .MuiCheckbox-root":{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette.background.paper}},"& .MuiDataGrid-iconButtonContainer":{"& .MuiIconButton-root":{color:t=>e.toolbar===void 0?t.palette[`gr-grey`].light:t.palette[`gr-grey`].main}},"& .MuiDataGrid-footerContainer":{borderTop:`none`,fontWeight:`500`,display:`flex`,justifyContent:`center`,alignItems:`center`,borderBottomLeftRadius:`20px`,borderBottomRightRadius:`20px`,backgroundColor:`black`},"& .MuiIconButton-root":{color:e=>e.palette.background.paper,"&.Mui-disabled":{color:`#888`,backgroundColor:`#eee`,opacity:.7}},"& .MuiDataGrid-row":{minHeight:45,maxHeight:`none`},"& .MuiDataGrid-cell":{minHeight:45,height:`auto`,maxHeight:`none`,display:`flex`,flexDirection:`column`,alignItems:`start`,justifyContent:`flex-start`,gap:1.5,p:1,borderBottom:`none`,borderTop:`1px solid #CECDCA`},"& .MuiDataGrid-cell--editing":{minHeight:45,height:`auto`,maxHeight:`none`,display:`flex`,flexDirection:`column`,alignItems:`start`,justifyContent:`flex-start`,gap:1.5,p:1},"& .MuiDataGrid-cell--editing input":{color:`black !important`,backgroundColor:`white !important`},"& .MuiDataGrid-row:hover, & .MuiDataGrid-row.Mui-selected":{bgcolor:`#B6B4AF`},"& .MuiDataGrid-cell.enable-cell":{backgroundColor:`white !important`,"& .MuiCheckbox-root":{color:e=>e.palette.background.paper}},"& .MuiDataGrid-cell.parcial-cell":{backgroundColor:`#E7E6E4 !important`,"& .MuiCheckbox-root":{color:e=>e.palette.background.paper}},"& .MuiDataGrid-cell.disable-cell":{backgroundColor:`#E7E6E4 !important`,"& .MuiCheckbox-root":{color:`#CECDCA`}},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.enable-cell":{backgroundColor:`#B6B4AF !important`},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.parcial-cell":{backgroundColor:`#B6B4AF !important`},"& .MuiDataGrid-row:hover .MuiDataGrid-cell.disable-cell":{backgroundColor:`#B6B4AF !important`},...e.sx},loading:e.loading,checkboxSelection:e.checkboxSelection,paginationModel:e.paginationModel,onPaginationModelChange:e.setPaginationModel,onRowSelectionModelChange:e.setRowSelectionModel,rowSelectionModel:e.rowSelectionModel,disableRowSelectionOnClick:e.disableRowSelectionOnClick,getRowHeight:()=>`auto`,onCellEditStop:e.onCellEditStop,disableVirtualization:!0,initialState:e.initialState,showColumnVerticalBorder:!1,showCellVerticalBorder:!1}),(0,d.jsx)(VT,{contextMenu:e.contextMenu,setContextMenu:e.setContextMenu,options:e.options,checked:e.rowSelectionModel,optionGroup:e.optionGroup})]}),XT=()=>{let e=(0,g.useGridApiRef)(),[t,n]=(0,l.useState)(!1),[r,i]=(0,l.useState)([]),[a,o]=(0,l.useState)({pageSize:25,page:0}),[s,c]=(0,l.useState)({type:`include`,ids:new Set}),[u,d]=(0,l.useState)(null),[f,p]=(0,l.useState)(`table`);return{apiRef:e,rows:r,setRows:i,loading:t,setLoading:n,paginationModel:a,setPaginationModel:o,rowSelectionModel:s,setRowSelectionModel:c,contextMenu:u,setContextMenu:d,optionGroup:f,setOptionGroup:p}},ZT=()=>{let{enqueueSnackbar:e}=(0,p.useSnackbar)(),t=e=>{(0,p.closeSnackbar)(e)};return{showAlert:(n,r)=>e(r,{variant:n,content:(e,r)=>(0,d.jsx)(i.Alert,{sx:{borderRadius:`24px`,bgcolor:`#fff`,boxShadow:3,color:e=>e.palette[`gr-base-dark`].main},severity:n,iconMapping:{error:(0,d.jsx)(C.default,{}),info:(0,d.jsx)(E.default,{}),success:(0,d.jsx)(w.default,{}),warning:(0,d.jsx)(T.default,{}),default:(0,d.jsx)(i.CircularProgress,{color:`gr-blue`,size:20})},onClose:()=>t(e),children:r},e)}),closeAlert:t}},QT=({label:e,initialValue:t,value:n,setValue:r,disabled:i,fullWidth:a,white:o})=>{let{format:s}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(k.DateTimeField,{label:e,defaultValue:t,value:n,onChange:e=>{r(e)},sx:{"& .MuiInputBase-root":{borderRadius:`16px`,color:o?`black !important`:`white !important`}},size:`small`,color:`gr-yellow`,slotProps:{textField:{sx:{"& .MuiInputLabel-root":{color:o?`black !important`:`white !important`}},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}}},focused:!0,format:s,disabled:i,fullWidth:a})})},$T=({label:e,placeholder:t,values:n,value:r,setValue:a,white:o})=>{let[s,c]=(0,l.useState)(!1);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Autocomplete,{multiple:!0,options:n,getOptionLabel:e=>e.label,value:n.filter(e=>r.includes(e.value)),onChange:(e,t)=>{a(t.map(e=>e.value))},onOpen:()=>c(!0),onClose:()=>c(!1),renderInput:n=>(0,d.jsx)(i.TextField,{...n,label:e,placeholder:t,variant:`outlined`,sx:{backgroundColor:e=>o?`white`:e.palette[`gr-base-dark`].main,borderTopLeftRadius:`18px`,borderTopRightRadius:`18px`,borderBottomLeftRadius:s?`0px`:`18px`,borderBottomRightRadius:s?`0px`:`18px`,color:o?`black !important`:`white !important`,"& .MuiChip-root":{maxWidth:`100px`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},"& .MuiAutocomplete-tag":{maxHeight:`32px`,overflow:`hidden`,display:`inline-flex`,flexWrap:`nowrap`},"& .MuiAutocomplete-inputRoot":{flexWrap:`nowrap`}},color:`gr-yellow`,focused:!0}),renderValue:(e,t)=>e.map((e,n)=>{let{key:r,...a}=t({index:n});return(0,d.jsx)(i.Tooltip,{title:e.highlight?.tooltip,sx:{borderRadius:`24px`},children:(0,d.jsx)(i.Chip,{variant:`filled`,label:e.label,size:`small`,...a,sx:{bgcolor:t=>e.highlight?.active?`${t.palette[`gr-orange`].main}20`:`${t.palette[`gr-grey`].main}20`,color:e=>e.palette[`gr-base-dark`].main,"& .MuiChip-deleteIcon":{color:e=>e.palette[`gr-base-dark`].main,"&:hover":{color:e=>e.palette[`gr-base-dark`].main}},border:e.highlight?.active?`1px solid`:`none`,borderColor:t=>e.highlight?.active?t.palette[`gr-orange`].main:`none`}},r)})}),popupIcon:(0,d.jsx)(A.default,{sx:{color:o?`black`:`white`}}),slotProps:{paper:{sx:{maxHeight:`500px`,borderBottomLeftRadius:`32px`,borderBottomRightRadius:`32px`,borderTopLeftRadius:`0px`,borderTopRightRadius:`0px`,backgroundColor:e=>o?`white`:e.palette[`gr-base-dark`].main,color:o?`black`:`white`}},chip:{sx:{bgcolor:e=>o?`${e.palette[`gr-grey`].light} !important`:`${e.palette[`gr-grey`].main} !important`,color:o?`black`:`white`},size:`small`,deleteIcon:(0,d.jsx)(C.default,{sx:{color:o?`black !important`:`white !important`}})}},limitTags:2,size:`small`})})},eE=({label:e,value:t,setValue:n,values:r,placeholder:a,disabled:o,fullWidth:s,white:c})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.FormControl,{fullWidth:s,focused:!0,children:[(0,d.jsx)(i.InputLabel,{id:`filter-table-label-${e}`,sx:{color:c?`black`:`white`,position:`absolute`,"&.Mui-focused":{color:c?`black`:`white`},'&[data-shrink="false"]':{transform:`translateY(12px) translateX(12px)`}},children:e}),(0,d.jsxs)(i.Select,{labelId:`filter-table-label-${e}`,id:`filter-${e}`,value:t,label:e,onChange:e=>n(e.target.value),color:`gr-yellow`,sx:{color:c?`black`:`white`},IconComponent:e=>(0,d.jsx)(_.default,{...e,sx:{color:c?`black !important`:`white !important`,...e.sx}}),MenuProps:{slotProps:{paper:{style:{maxHeight:`500px`,borderBottomLeftRadius:`32px`,borderBottomRightRadius:`32px`,borderTopLeftRadius:`0px`,borderTopRightRadius:`0px`}},list:{sx:{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,"& .MuiMenuItem-root":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main,color:c?`black`:`white`,"&:hover":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-selected":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main},"&.Mui-focusVisible":{backgroundColor:e=>c?`white`:e.palette[`gr-base-dark`].main}}}}}},displayEmpty:!0,disabled:o,children:[(0,d.jsx)(i.MenuItem,{sx:{mt:2},disabled:!0,value:``,children:(0,d.jsx)(`em`,{children:a})}),r.map(e=>(0,d.jsx)(i.MenuItem,{value:e.value,children:e.label},e.value))]})]})}),tE=({item:e,path:t})=>e.children.length===0?(0,d.jsx)(M.TreeItem,{itemId:`${t}/${e.id}`,label:e.name,disabled:e.disabled,onClick:()=>{e.onClick&&e.onClick(`${t}/${e.id}`)}}):(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(M.TreeItem,{itemId:`${t}/${e.id}`,label:e.name,disabled:e.disabled,children:e.children.map(n=>(0,d.jsx)(tE,{item:n,path:`${t}/${e.id}`},n.id))})}),nE=({items:e})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(j.SimpleTreeView,{sx:{borderRadius:`16px`,border:e=>`1px solid ${e.palette[`gr-base-dark`].main}`,p:1.5},children:e.map(e=>(0,d.jsx)(tE,{item:e,path:`origin`},e.id))})}),rE=({label:e,initialValue:t,value:n,setValue:r,disabled:i,fullWidth:a,white:o})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.TimeField,{label:e,disabled:i,format:`HH:mm`,ampm:!1,defaultValue:t,value:n,autoFocus:!0,onChange:e=>{r(e)},slotProps:{textField:{variant:`outlined`,size:`small`,fullWidth:a,color:`gr-yellow`,focused:!0,sx:{borderRadius:`16px`},slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`},endAdornment:(0,d.jsx)(N.default,{style:{color:o?`black`:`white`}})}}}}})}),iE=({label:e,initialValue:t,value:n,setValue:r,disabled:i,white:a,fullWidth:o})=>{let{format:s,singleShortcut:c}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.DatePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:i,format:s,slotProps:{shortcuts:{items:c},textField:{variant:`outlined`,size:`small`,fullWidth:o,color:`gr-yellow`,focused:!0,slotProps:{input:{sx:{borderRadius:`16px`,color:a?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:a?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>e.palette[`gr-base-dark`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:a?`white`:`black`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},aE=({label:e,initialValue:t,value:n,setValue:r,calendars:i,disabled:a,white:o,fullWidth:s})=>{let{format:c,rangeShortcut:u}=(0,l.useContext)(W);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(b.DateRangePicker,{label:e,defaultValue:t,value:n,onChange:e=>r(e),disabled:a,format:c,calendars:i,slotProps:{shortcuts:{items:u},textField:{variant:`outlined`,size:`small`,fullWidth:s,color:`gr-yellow`,focused:!0,slotProps:{input:{sx:{borderRadius:`16px`,color:o?`black !important`:`white !important`,"& .MuiIconButton-root .MuiSvgIcon-root":{color:o?`black !important`:`white !important`}}}}},popper:{sx:{"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiYearCalendar-button":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiButtonBase-root":{color:e=>e.palette[`gr-base-dark`].main},"& .MuiPickersArrowSwitcher-root":{color:e=>e.palette[`gr-base-dark`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:`black !important`},"& .MuiPaper-root":{bgcolor:o?`white`:`black`,borderRadius:`20px`},"& .MuiPickersDay-root":{color:e=>e.palette[`gr-base-dark`].main}}}}})})},oE=({initialValue:e,value:t,setValue:n,calendars:r,disabled:i,white:a})=>{let{rangeShortcut:o}=(0,l.useContext)(W);return(0,d.jsx)(P.StaticDateRangePicker,{defaultValue:e,value:t,onChange:e=>{n(e),console.log(`Selected Range:`,e)},calendars:r,disabled:i,sx:{width:`560px`,overflowX:`auto`,borderRadius:`20px`,"& .MuiChip-root":{bgcolor:e=>e.palette[`gr-grey`].light},"& .MuiChip-root:hover":{bgcolor:e=>e.palette[`gr-grey`].dark},"& .MuiDayCalendar-weekDayLabel":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiYearCalendar-button":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiButtonBase-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiPickersArrowSwitcher-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .Mui-selected, & .MuiPickersDay-root.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiYearCalendar-yearButton.Mui-selected":{bgcolor:e=>`${e.palette[`gr-yellow`].main} !important`,color:a?`black !important`:`white !important`},"& .MuiPickersDay-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiChip-label":{color:e=>`${e.palette[`gr-base-dark`].main} !important`},"& .MuiTypography-root":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main},"& .MuiPickersCalendarHeader-label":{color:e=>a?e.palette[`gr-base-dark`].main:e.palette[`gr-base-light`].main}},slotProps:{shortcuts:{items:o},actionBar:{actions:[]},layout:{sx:{borderRadius:`20px !important`,bgcolor:a?`white !important`:`black !important`}}}})},sE=({data:e,setData:t,columnLabels:n,buttons:r})=>(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.Grid,{sx:{overflow:`hidden`},container:!0,spacing:2,children:[(0,d.jsxs)(i.Grid,{size:1,children:[(0,d.jsx)(i.Button,{variant:`contained`,size:`small`,color:`gr-base-dark`,sx:{borderRadius:`20px`,height:`40px`,maxWidth:`40px`,minWidth:`40px`,width:`40px`,p:1,mt:7,mb:2},onClick:()=>t(e.slice(0,-1)),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:`#FFFFFF`,fontSize:`18px`},children:`remove`})}),(0,d.jsx)(i.Button,{variant:`contained`,size:`small`,color:`gr-base-dark`,sx:{borderRadius:`20px`,height:`40px`,maxWidth:`40px`,minWidth:`40px`,width:`40px`,p:1},onClick:()=>t([...e,n.map(()=>({value:``}))]),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:`#FFFFFF`,fontSize:`18px`},children:`add`})})]}),(0,d.jsx)(i.Grid,{size:11,children:(0,d.jsxs)(i.Grid,{container:!0,children:[(0,d.jsx)(i.Grid,{size:8,sx:{bgcolor:e=>e.palette[`gr-base-dark`].main,borderTopLeftRadius:`20px`,p:1.5,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1},children:r.map((e,t)=>(0,d.jsxs)(i.Button,{sx:{borderRadius:`20px`,textTransform:`none`},variant:`outlined`,size:`small`,color:`gr-base-light`,onClick:e.onClick,children:[e.label,(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{ml:1,mt:-.5,color:`#FFFFFF`,fontSize:`18px`},children:e.icon})]},t))}),(0,d.jsx)(i.Grid,{size:4,sx:{bgcolor:e=>e.palette[`gr-base-dark`].main,borderTopRightRadius:`20px`,p:1.5,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:1}}),(0,d.jsx)(i.Grid,{size:12,sx:{overflowX:`auto`,width:`55vh`,borderBottomLeftRadius:`20px`,borderBottomRightRadius:`20px`},children:(0,d.jsx)(F.default,{data:e,columnLabels:n,onChange:e=>t(e),className:``})})]})})]})}),cE=e=>{let t=(0,l.useRef)(null);return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(D.default,{nodeRef:t,handle:`#draggable-dialog-title`,cancel:`[class*="MuiDialogContent-root"]`,children:(0,d.jsx)(i.Paper,{...e,ref:t,sx:{bgcolor:`white`,color:e=>e.palette.background.paper,padding:`20px`,display:`flex`,flexDirection:`column`,justifyContent:`center`,alignItems:`center`,gap:`50px`,borderRadius:`20px`}})})})},lE=({title:e,alert:t,action:n,fields:r,open:a,setOpen:o,loading:s,onClickSave:c,showAlertUnsavedChanges:u=!0})=>{let[f,p]=(0,l.useState)(!1),m=(e,t)=>{switch(e.element){case`TextField`:let[r,a]=(0,l.useState)(!1);return e.hide?null:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.TextField,{fullWidth:!0,variant:`outlined`,label:e.label,type:r?`text`:e.type,placeholder:e.placeholder,focused:!0,value:e.value,multiline:e.multiline,rows:e.rows,onChange:t=>{e.setValue(t.target.value)},disabled:e.disable||n?.actionButton?.loading,slotProps:{input:{endAdornment:e.type===`password`?(0,d.jsx)(i.InputAdornment,{position:`end`,children:(0,d.jsx)(i.IconButton,{"aria-label":r?`Ocultar contraseña`:`Mostrar contraseña`,onClick:()=>{a(!r)},edge:`end`,sx:{color:e=>e.palette[`gr-grey`].main},children:r?(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,children:`visibility_off`}):(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,children:`visibility`})})}):void 0}},size:`small`})},t);case`SelectField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(eE,{label:e.label,placeholder:e.placeholder,value:e.value,setValue:e.setValue,values:e.values,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`DateField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(QT,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`CheckboxField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.FormGroup,{children:(0,d.jsx)(i.FormControlLabel,{control:(0,d.jsx)(i.Checkbox,{sx:{ml:1.5,color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}},checked:e.value,onChange:t=>e.setValue(t.target.checked),disabled:!!(e.disable||n?.actionButton?.loading)}),label:e.label})})},t);case`CheckboxGroup`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.FormGroup,{children:e.checkboxs.map((e,t)=>(0,d.jsx)(i.FormControlLabel,{control:(0,d.jsx)(i.Checkbox,{sx:{ml:1.5,color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}},checked:e.value,onChange:t=>e.setValue(t.target.checked)}),label:e.label},t))})},t);case`RadioGroupField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsxs)(i.FormControl,{sx:{mt:e.label.text?`none`:`-7px`},children:[(0,d.jsx)(i.FormLabel,{children:e.label.text}),(0,d.jsx)(i.RadioGroup,{value:e.value,onChange:t=>e.setValue(t.target.value),row:e.row,children:e.radios.map((e,t)=>(0,d.jsx)(i.FormControlLabel,{value:e.value,control:(0,d.jsx)(i.Radio,{sx:{color:e=>e.palette[`gr-base-dark`].main,"&.Mui-checked":{color:e=>e.palette[`gr-base-dark`].main}}}),label:e.label.text,labelPlacement:e.label.position,disabled:e.disable},t))})]})},t);case`AutoCompleteField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)($T,{label:e.label,placeholder:`Seleccionar`,values:e.values,value:e.value,setValue:e.setValue,white:!0})},t);case`ListField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.List,{dense:!0,sx:{borderRadius:`16px`,border:t=>e.border?`1px solid ${t.palette[`gr-grey`].dark}`:`none`},children:e.items.map((t,n)=>(0,d.jsxs)(i.ListItem,{secondaryAction:e.action,children:[t.icon&&(0,d.jsx)(i.ListItemIcon,{children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:t.icon?.color},children:t.icon?.name})}),(0,d.jsx)(i.ListItemText,{primary:t.primaryText,secondary:t.secondaryText})]},n))})},t);case`TreeviewField`:return(0,d.jsxs)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:[(0,d.jsx)(i.Typography,{variant:`body1`,children:e.label}),(0,d.jsx)(nE,{items:e.items})]},t);case`TimeField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(rE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t);case`TypographyField`:return(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(i.Typography,{variant:`body1`,children:e.text})},t);case`DatePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(iE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!!e.white})},t)});case`DateRangePickerField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(aE,{label:e.label,initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:!!(e.disable||n?.actionButton?.loading),fullWidth:!0,white:!0})},t)});case`DateRangeCalendarField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(oE,{initialValue:e.initialValue,value:e.value,setValue:e.setValue,calendars:e.calendars,disabled:!!(e.disable||n?.actionButton?.loading),white:e.white})},t)});case`SheetField`:return(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(i.Grid,{size:e.ncolumn,sx:{mb:`20px`},children:(0,d.jsx)(sE,{data:e.data,setData:e.setData,columnLabels:e.columnLabels,buttons:e.buttons})},t)});case`DividerField`:return(0,d.jsx)(i.Grid,{size:12,sx:{mb:`20px`},children:(0,d.jsx)(i.Box,{sx:{width:`100%`,height:`1px`,bgcolor:e=>e.palette[`gr-grey`].dark}})},t);case`CustomField`:return(0,d.jsx)(i.Grid,{size:12,sx:{mb:`20px`},children:e.content},t);default:return(0,d.jsx)(d.Fragment,{})}},h=()=>{r.forEach(e=>{switch(e.element){case`TextField`:e.setValue(e.initialValue);break;case`SelectField`:e.setValue(e.initialValue);break;case`DateField`:e.setValue(e.initialValue);break;case`CheckboxField`:e.setValue(e.initialValue);break;case`CheckboxGroup`:e.checkboxs.forEach(e=>{e.setValue(e.initialValue)});break;case`AutoCompleteField`:e.setValue(e.initialValue);break;case`ListField`:break;case`TreeviewField`:break;case`TimeField`:e.setValue(e.initialValue);break;case`DatePickerField`:e.setValue(e.initialValue);break;case`DateRangePickerField`:e.setValue(e.initialValue);break;case`TypographyField`:break;case`DateRangeCalendarField`:e.setValue(e.initialValue);break;case`RadioGroup`:e.setValue(e.initialValue)}}),p(!1)},g=e=>{e.some(e=>{if(e.element===`CheckboxGroup`)return e.checkboxs.some(e=>e.value!==e.initialValue);if(e.element===`CheckboxField`||e.element===`TextField`||e.element===`SelectField`||e.element===`DateField`)return e.value!==e.initialValue;if(e.element===`AutoCompleteField`)return JSON.stringify(e.value.sort())!==JSON.stringify(e.initialValue.sort());if(e.element===`TimeField`||e.element===`DatePickerField`)return e.value!==e.initialValue;if(e.element===`DateRangePickerField`||e.element===`DateRangeCalendarField`)return JSON.stringify(e.value)!==JSON.stringify(e.initialValue);if(e.element===`RadioGroup`)return e.value!==e.initialValue})?p(!0):o(!1)};return(0,l.useEffect)(()=>{a||h()},[a]),(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(i.Dialog,{open:a,onClose:()=>{u?g(r):(h(),o(!1))},PaperComponent:cE,"aria-labelledby":`draggable-dialog-title`,children:[(0,d.jsxs)(i.DialogTitle,{style:{cursor:`move`,textAlign:`left`,margin:0,padding:0,width:`100%`},id:`draggable-dialog-title`,children:[e,(0,d.jsx)(i.IconButton,{sx:{position:`absolute`,right:10,top:10},onClick:()=>g(r),children:(0,d.jsx)(i.Icon,{baseClassName:`material-symbols-rounded`,sx:{color:e=>e.palette[`gr-base-dark`].main,fontSize:`24px`},children:`close`})})]}),f&&u&&t&&(0,d.jsx)(i.DialogContent,{sx:{padding:0,margin:0,width:`100%`,overflow:`hidden`,minHeight:`85px`},children:(0,d.jsxs)(i.Alert,{icon:(0,d.jsx)(O.default,{}),sx:{borderRadius:`24px`,bgcolor:`#FFEFE5`,border:e=>`1px solid ${e.palette[`gr-orange`].main}`,"& .MuiAlert-icon":{color:e=>e.palette[`gr-orange`].main}},action:(0,d.jsxs)(i.Box,{sx:{mt:3.75},children:[(0,d.jsx)(i.Button,{color:`gr-grey`,size:`small`,onClick:()=>p(!1),children:(0,d.jsx)(`b`,{children:t.actionButton.buttonText})}),(0,d.jsx)(i.Button,{color:`gr-grey`,size:`small`,onClick:()=>{h(),o(!1)},children:(0,d.jsx)(`b`,{children:t.cancelButton.buttonText})})]}),children:[(0,d.jsx)(i.AlertTitle,{children:t.title}),(0,d.jsx)(i.Typography,{variant:`body2`,children:t.message})]})}),(0,d.jsxs)(i.DialogContent,{sx:{padding:0,margin:0,position:`relative`,overflow:s?`hidden`:`auto`},children:[(0,d.jsx)(i.Grid,{container:!0,spacing:2,sx:{mt:1,visibility:s?`hidden`:`visible`},children:r.map((e,t)=>m(e,t))}),s&&(0,d.jsx)(i.Box,{sx:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,display:`flex`,justifyContent:`center`,alignItems:`center`},children:(0,d.jsx)(i.CircularProgress,{size:60})})]}),(0,d.jsxs)(i.DialogActions,{sx:{display:`flex`,flexDirection:`row`,justifyContent:`flex-end`,alignItems:`center`,width:`100%`},children:[n?.cancelButton&&(0,d.jsx)(i.Button,{variant:`outlined`,autoFocus:!0,onClick:()=>{u?g(r):(h(),o(!1))},sx:{minWidth:`130px`,borderRadius:`44px`,fontWeight:`500`,textTransform:`none`},color:`gr-base-dark`,children:n.cancelButton?.buttonText}),n?.actionButton&&(0,d.jsx)(i.Button,{variant:`contained`,onClick:()=>{c()},sx:{minWidth:`130px`,borderRadius:`44px`,color:`white`,fontWeight:`500`,textTransform:`none`},color:`gr-base-dark`,disableElevation:!0,disabled:n.actionButton.disabled,loading:n.actionButton.loading,children:n.actionButton.buttonText})]})]})})},uE={error:``,warning:``,success:``,suggestion:``,info:``},dE={error:Op.feedbackError,warning:Op.feedbackWarning,success:Op.feedbackSuccess,suggestion:Op.feedbackSuggestion,info:Op.feedbackInfo};function fE({type:e=`info`,title:t,children:n,message:r,onClose:i,closeLabel:a=`Close message`,actions:o,hideIcon:s=!1,className:c}){let l=n??r,u=t??uE[e]??``,f=!!o?.length;return(0,d.jsxs)(`div`,{className:Z(`rb-message-alert`,`rb-message-alert--${e}`,s&&`rb-message-alert--no-icon`,f&&`rb-message-alert--with-actions`,c),role:e===`error`||e===`warning`?`alert`:`status`,children:[s?null:(0,d.jsx)(`span`,{className:`rb-message-alert__icon`,"aria-hidden":`true`,children:(0,d.jsx)(`img`,{src:dE[e],alt:``,className:`size-6`,draggable:!1})}),(0,d.jsxs)(`div`,{className:`rb-message-alert__content`,children:[u?(0,d.jsx)(`div`,{className:`rb-message-alert__title`,children:u}):null,l?(0,d.jsx)(`div`,{className:`rb-message-alert__text`,children:l}):null]}),f?(0,d.jsx)(`div`,{className:`rb-message-alert__actions`,children:o?.map((e,t)=>(0,d.jsx)(R_,{type:`button`,variant:`ghost`,size:`s`,onClick:e.onClick,disabled:e.disabled,children:e.label},t))}):null,i?(0,d.jsx)(`button`,{type:`button`,className:`rb-message-alert__close`,onClick:i,"aria-label":a,children:(0,d.jsx)(`img`,{src:Op.close,alt:``,className:`size-4`,draggable:!1})}):null]})}var pE=`Ir a inicio`,mE=(0,d.jsx)(`span`,{className:`material-symbols-rounded`,children:`inventory_2`}),hE=(0,d.jsx)(`span`,{className:`material-symbols-rounded`,children:`article`}),gE=`Necesitas permisos adicionales`,_E=`No pudimos encontrar esta página`,vE=`Es posible que el enlace haya cambiado, esté deshabilitado o la dirección se haya ingresado de forma incorrecta.`;function yE(e){let t=!!(e&&e.length>0);return(0,d.jsxs)(d.Fragment,{children:[`Por configuración de tu perfil, actualmente no cuentas con el acceso habilitado para esta vista.`,(0,d.jsx)(`br`,{}),`Si consideras que necesitas trabajar en esta pantalla, por favor contacta al administrador de tu cuenta para actualizar tu configuración.`,t?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`br`,{}),(0,d.jsx)(`br`,{}),`Los permisos que se requieren son:`,(0,d.jsx)(`span`,{className:`rb-empty-state__permissions`,role:`list`,children:e.map(e=>(0,d.jsxs)(`span`,{role:`listitem`,children:[`• `,e]},e))})]}):null]})}function bE({variant:e=`empty`,context:t=`page`,icon:n,title:r,description:i,primaryAction:a,secondaryAction:o,permissions:s,onGoHome:c,homePath:l=`/`,hideIcon:u=!1,hideTitle:f=!1,hideDescription:p=!1,hidePrimaryAction:m=!1,hideSecondaryAction:h=!1,className:g}){let _=e!==`empty`,v=n??(_?hE:mE),y=e===`no-permission`?gE:e===`not-found`?_E:r,b=e===`no-permission`?yE(s):e===`not-found`?vE:i,x=_?{label:pE,onClick:c??(()=>window.location.assign(l))}:a,S=!u,C=(_||!f)&&!!y,w=(_||!p)&&!!b,T=(_||!m)&&!!x,E=!_&&!h&&!!o,D=T||E;return(0,d.jsxs)(`div`,{className:Z(`rb-empty-state`,`rb-empty-state--${t}`,g),children:[S?(0,d.jsx)(`span`,{className:`rb-empty-state__icon`,"aria-hidden":`true`,children:v}):null,C?(0,d.jsx)(`h4`,{className:`rb-empty-state__title h4`,children:y}):null,w?(0,d.jsx)(`p`,{className:`rb-empty-state__description p1`,children:b}):null,D?(0,d.jsxs)(`div`,{className:`rb-empty-state__actions`,children:[E?(0,d.jsx)(R_,{type:`button`,size:`s`,variant:`secondary`,onClick:o?.onClick,disabled:o?.disabled,children:o?.label}):null,T?(0,d.jsx)(R_,{type:`button`,size:`s`,variant:`primary`,onClick:x?.onClick,disabled:x?.disabled,children:x?.label}):null]}):null]})}var xE={s:`max-w-[var(--form-shell-s)]`,m:`max-w-[var(--form-shell-m)]`,l:`max-w-[var(--form-shell-l)]`},SE=16,CE=[`button:not([disabled])`,`a[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function wE(e){return e?Array.from(e.querySelectorAll(CE)).filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`):[]}function TE(e,t,n){return Math.min(Math.max(e,t),n)}function EE({open:e,title:t,ariaLabel:n,alert:r,children:i,footer:a,onClose:o,loading:s=!1,loadingLabel:c=`Cargando`,closeLabel:u=`Cerrar`,size:f=`m`,draggable:p=!0,closeOnEscape:m=!0,closeOnBackdrop:h=!1,className:g,headerClassName:_,bodyClassName:v,footerClassName:y,marginY:b=0}){let x=(0,l.useId)(),S=(0,l.useRef)(null),C=(0,l.useRef)(null),[w,T]=(0,l.useState)({x:0,y:0}),[E,D]=(0,l.useState)(!1),O=(0,l.useRef)({mouseX:0,mouseY:0,startX:0,startY:0});if((0,l.useEffect)(()=>{e||(T({x:0,y:0}),D(!1))},[e]),(0,l.useEffect)(()=>{if(!e||typeof document>`u`)return;C.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let t=window.requestAnimationFrame(()=>{(wE(S.current)[0]??S.current)?.focus()});return()=>{window.cancelAnimationFrame(t),C.current?.focus()}},[e]),(0,l.useEffect)(()=>{if(!e)return;let t=e=>{if(e.key===`Escape`&&m){e.preventDefault(),o?.();return}if(e.key!==`Tab`||!S.current)return;let t=wE(S.current);if(t.length===0){e.preventDefault(),S.current.focus();return}let n=t[0],r=t[t.length-1],i=document.activeElement;if(e.shiftKey&&i===n){e.preventDefault(),r.focus();return}!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t)}},[e,o,m]),!e)return null;let k=e=>{!p||e.button!==0||e.target instanceof HTMLElement&&e.target.closest(`[data-form-shell-close]`)||(D(!0),O.current={mouseX:e.clientX,mouseY:e.clientY,startX:w.x,startY:w.y},e.currentTarget.setPointerCapture?.(e.pointerId))},A=e=>{if(!p||!E)return;let t=e.clientX-O.current.mouseX,n=e.clientY-O.current.mouseY,r=O.current.startX+t,i=O.current.startY+n,a=S.current;if(!a){T({x:r,y:i});return}let o=SE,s=Math.max(0,(window.innerWidth-a.offsetWidth)/2-o),c=Math.max(0,(window.innerHeight-a.offsetHeight)/2-o);T({x:TE(r,-s,s),y:TE(i,-c,c)})},j=e=>{p&&(D(!1),e.currentTarget.releasePointerCapture?.(e.pointerId))};return(0,d.jsx)(Xw,{children:(0,d.jsx)(`div`,{className:`rb-modal-layer fixed inset-0 flex items-center justify-center bg-[rgba(0,0,0,0.24)] p-4`,role:`presentation`,onPointerDown:e=>{!h||e.target!==e.currentTarget||o?.()},children:(0,d.jsx)(`section`,{ref:S,role:`dialog`,tabIndex:-1,"aria-modal":`true`,"aria-labelledby":t?x:void 0,"aria-label":t?void 0:n??`Formulario`,"aria-busy":s||void 0,className:Z(`relative flex h-fit w-full min-w-0`,`flex-col overflow-hidden`,`font-sans`,`max-h-[calc(100dvh-2rem)]`,`rounded-[var(--r-m)]`,`border border-[var(--border)]`,`bg-[var(--surface-elevated)]`,`text-[var(--text)]`,`shadow-none`,`p-4 min-[36rem]:p-5`,xE[f],g),style:{transform:`translate(${w.x}px, ${w.y}px)`},children:(0,d.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col bg-[var(--surface-elevated)]`,children:[(0,d.jsx)(`header`,{className:Z(`flex shrink-0`,`touch-none select-none`,`items-start gap-3 pr-10`,`bg-[var(--surface-elevated)]`,p?E?`cursor-grabbing`:`cursor-move`:`cursor-default`,_),onPointerDown:k,onPointerMove:A,onPointerUp:j,onPointerCancel:j,children:(0,d.jsx)(`div`,{className:`min-w-0 flex-1`,children:t?(0,d.jsx)(`h2`,{id:x,className:`h4 truncate`,children:t}):null})}),o?(0,d.jsx)(`button`,{type:`button`,"data-form-shell-close":!0,onClick:o,"aria-label":u,className:Z(`motion-fast`,`absolute right-4 top-4`,`z-20 flex size-8`,`items-center justify-center`,`rounded-full`,`min-[36rem]:right-5`,`min-[36rem]:top-5`,`bg-transparent`,`text-[var(--text)]`,`hover:bg-[var(--interaction-hover)]`,`focus-visible:outline-none`,`focus-visible:shadow-[var(--focus-ring-shadow)]`),children:(0,d.jsx)(`img`,{src:Op.close,alt:``,className:`size-4`,draggable:!1})}):null,r?(0,d.jsx)(`div`,{className:`p1 mt-5 shrink-0 bg-[var(--surface-elevated)]`,children:r}):null,(0,d.jsxs)(`div`,{className:Z(`relative flex min-h-0 flex-1`,`flex-col overflow-hidden`,`bg-[var(--surface-elevated)]`,`${`my-${r?`5`:`${b===0?`8`:`${b}`}`}`}`),children:[(0,d.jsx)(`div`,{className:Z(`min-h-0 flex-1`,`overflow-x-hidden`,`overflow-y-auto`,`bg-[var(--surface-elevated)] pr-1`,s&&`overflow-hidden`,v),children:(0,d.jsx)(`div`,{className:Z(`p1 min-w-0 pt-3`,s&&`invisible`),children:i})}),s?(0,d.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:` absolute inset-0 flex items-center justify-center bg-[var(--loading-overlay)]`,children:[(0,d.jsx)(`div`,{className:Z(`size-10 animate-spin`,`rounded-full border-4`,`border-[color-mix(in_oklab,var(--text)_14%,transparent)]`,`border-t-[var(--text)]`),"aria-hidden":`true`}),(0,d.jsx)(`span`,{className:`sr-only`,children:c})]}):null]}),a?(0,d.jsx)(`footer`,{className:Z(`shrink-0`,`bg-[var(--surface-elevated)]`,y),children:a}):null]})})})})}var DE={compact:`gap-y-6`,default:`gap-y-8`,relaxed:`gap-y-10`,loose:`gap-y-12`,spacious:`gap-y-16`},OE={compact:`gap-x-4`,default:`gap-x-5`,wide:`gap-x-6`},kE={1:`col-span-12 min-[36rem]:col-span-1`,2:`col-span-12 min-[36rem]:col-span-2`,3:`col-span-12 min-[36rem]:col-span-3`,4:`col-span-12 min-[36rem]:col-span-4`,5:`col-span-12 min-[36rem]:col-span-5`,6:`col-span-12 min-[36rem]:col-span-6`,7:`col-span-12 min-[36rem]:col-span-7`,8:`col-span-12 min-[36rem]:col-span-8`,9:`col-span-12 min-[36rem]:col-span-9`,10:`col-span-12 min-[36rem]:col-span-10`,11:`col-span-12 min-[36rem]:col-span-11`,12:`col-span-12`};function AE({children:e,rowGap:t=`default`,columnGap:n=`default`,className:r,...i}){return(0,d.jsx)(`div`,{className:Z(`grid w-full min-w-0 grid-cols-12 items-start`,DE[t],OE[n],r),...i,children:e})}function jE({children:e,span:t=12,className:n,...r}){return(0,d.jsx)(`div`,{className:Z(`w-full min-w-0 self-start`,`[&>*]:w-full [&>*]:min-w-0 [&>*]:max-w-full`,kE[t],n),...r,children:e})}var ME=(0,l.forwardRef)(function({children:e,variant:t=`plain`,size:n=`m`,divided:r=!1,emptyState:i=`No hay elementos disponibles.`,className:a,...o},s){let c=l.Children.toArray(e),u=c.length>0;return(0,d.jsx)(`ul`,{ref:s,className:Z(`rb-list`,`rb-list--${t}`,`rb-list--${n}`,r&&`rb-list--divided`,a),...o,children:u?c:i==null?null:(0,d.jsx)(`li`,{className:`rb-list__empty p1`,children:i})})}),NE=(0,l.forwardRef)(function({children:e,icon:t,actions:n,selected:r=!1,disabled:i=!1,className:a,onClick:o,onClickCapture:s,onKeyDown:c,onKeyDownCapture:l,role:u,tabIndex:f,...p},m){let h=!!o&&!n&&!i;return(0,d.jsxs)(`li`,{ref:m,className:Z(`rb-list-item`,a),"data-selected":r||void 0,"data-disabled":i||void 0,"data-interactive":h||void 0,"data-has-actions":!!n||void 0,"data-has-icon":!!t||void 0,"aria-disabled":i||void 0,role:u??(h?`button`:void 0),tabIndex:f??(h?0:void 0),onClick:i?void 0:o,onClickCapture:e=>{if(i){e.preventDefault(),e.stopPropagation();return}s?.(e)},onKeyDownCapture:e=>{if(i){e.preventDefault(),e.stopPropagation();return}l?.(e)},onKeyDown:e=>{c?.(e),!(e.defaultPrevented||!h||e.repeat)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.currentTarget.click())},...p,children:[(0,d.jsxs)(`div`,{className:`rb-list-item__content`,children:[t?(0,d.jsx)(`span`,{className:`rb-list-item__icon`,"aria-hidden":`true`,children:t}):null,(0,d.jsx)(`div`,{className:`rb-list-item__body p1`,children:e})]}),n?(0,d.jsx)(`div`,{className:`rb-list-item__actions`,children:n}):null]})});function PE(...e){return e.filter(Boolean).join(` `)}function FE({value:e,items:t,onChange:n,className:r,ariaLabel:i=`Pestañas`}){return(0,d.jsx)(`div`,{role:`tablist`,"aria-label":i,className:PE(`inline-flex w-fit max-w-full items-center rounded-full bg-white p-1`,`shadow-[0_1px_2px_rgba(0,0,0,0.03)]`,r),children:t.map(t=>{let r=t.value===e;return(0,d.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,disabled:t.disabled,onClick:()=>{t.disabled||n(t.value)},className:PE(`inline-flex h-11 items-center justify-center rounded-full px-5 sm:px-6`,`p1 font-semibold leading-none transition-colors`,`min-w-[9rem]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`,r?`bg-[var(--base-dark)] text-white`:`bg-transparent text-[var(--base-dark)] hover:bg-[color-mix(in_oklab,var(--base-dark)_4%,transparent)]`,t.disabled&&`cursor-not-allowed opacity-50 hover:bg-transparent`),children:t.label},t.value)})})}function IE(...e){return e.filter(Boolean).join(` `)}function LE({value:e,items:t,onChange:n,onClose:r,closeLabel:i=`Cerrar`,ariaLabel:a=`Pestañas`,className:o,children:s}){return(0,d.jsxs)(`div`,{className:IE(`flex w-full flex-col items-start gap-6`,`rounded-[20px] bg-white p-5`,o),children:[(0,d.jsxs)(`div`,{className:`flex w-full items-center gap-4`,children:[(0,d.jsx)(`div`,{role:`tablist`,"aria-label":a,className:`flex w-full flex-1 flex-wrap items-center gap-3`,children:t.map(t=>{let r=t.value===e;return(0,d.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r,disabled:t.disabled,onClick:()=>{t.disabled||n(t.value)},className:IE(`inline-flex h-10 items-center justify-center rounded-full px-5`,`p2 font-semibold leading-none transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`,r?`bg-[var(--base-dark)] text-white`:`bg-[var(--g-100)] text-[var(--base-dark)] hover:bg-[var(--g-200)]`,t.disabled&&`cursor-not-allowed opacity-40 hover:bg-[var(--g-100)]`),children:t.label},t.value)})}),r&&(0,d.jsx)(`button`,{type:`button`,onClick:r,"aria-label":i,className:IE(`inline-flex size-11 shrink-0 items-center justify-center rounded-full`,`bg-white text-[var(--base-dark)]`,`transition-colors hover:bg-[var(--interaction-hover)]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--base-dark)] focus-visible:ring-offset-2`),children:(0,d.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,d.jsx)(`path`,{d:`M2 2L14 14M14 2L2 14`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`})})})]}),s&&(0,d.jsx)(`div`,{className:`w-full`,children:s})]})}function RE(...e){return Z(...e)}function zE(e){return`field`in e}function BE(e=[]){return e.filter(e=>e.show!==!1).map(e=>{if(!zE(e))return e;let t=e.field,n=VE(e),r=e.cellClassName;return{key:t,header:e.headerName??e.header??t,show:e.show,width:n,minWidth:e.minWidth,maxWidth:e.maxWidth,align:e.align??e.headerAlign??`left`,fullWidthRender:e.fullWidthRender,headerClassName:e.headerClassName,sortable:e.sortable,filterable:e.filterable,cellClassName:typeof r==`function`?(e,n)=>r({row:e,index:n,id:HE(e,n),field:t,value:UE(e,t)}):r,render:(n,r)=>{let i={row:n,index:r,id:HE(n,r),field:t,value:UE(n,t)};return e.renderCell?e.renderCell(i):e.valueGetter?e.valueGetter(i):i.value??`—`}}})}function VE(e){return e.width?e.width:e.flex?`${e.flex}fr`:e.minWidth?`minmax(${e.minWidth}px, 1fr)`:`1fr`}function HE(e,t){let n=e?.id;if(n==null||n===``)throw Error(`[RbTable] Cada row debe traer un id obligatorio. Revisa la fila en posición ${t??`desconocida`}.`);return n}function UE(e,t){return e?.[t]}function WE(e){if(!e)return[];if(Array.isArray(e))return e;if(e instanceof Set)return Array.from(e);if(typeof e==`object`&&`ids`in e){let t=e.ids;if(t instanceof Set)return Array.from(t);if(Array.isArray(t))return t}return[]}function GE(e,t){return WE(t).includes(e)}function KE(e,t){let n=WE(t);return n.includes(e)?n.filter(t=>t!==e):[...n,e]}function qE(e,t){return{left:e?.left??t?.left??[],right:e?.right??t?.right??[]}}function JE(e){if(!e)return`minmax(0, 1fr)`;if(typeof e==`number`)return`${e}px`;let t=e.trim();return t.startsWith(`minmax(`)||t.endsWith(`px`)?t:t.includes(`fr`)?`minmax(0, ${t.replace(`fr`,``).trim()||`1`}fr)`:t}function YE(e){if(!e)return 180;if(typeof e==`number`)return e;if(e.endsWith(`px`)){let t=Number(e.replace(`px`,``));return Number.isFinite(t)?t:180}return e.includes(`56`)?56:180}function XE(e){return e===`center`?`text-center justify-center`:e===`right`?`text-right justify-end`:`text-left justify-start`}function ZE(e){return l.default.Children.toArray(e).flatMap(e=>{if(!l.default.isValidElement(e))return e;if(e.type===l.default.Fragment){let t=e.props;return ZE(t.children)}return e})}function QE(e){return e===!0||e===`true`}function $E(e){if(!l.default.isValidElement(e))return!1;let t=e.props,n=e.type;return QE(t[`data-toolbar-actions`])||n.rbToolbarActions===!0}function eD({title:e,description:t,left:n,right:r,className:i}){let a=!!(e||t),o=!!(n||r),s=!!n,c=ZE(r).filter(Boolean);return!a&&!o?null:(0,d.jsxs)(`div`,{className:RE(`rb-table-toolbar`,i),children:[a?(0,d.jsxs)(`div`,{className:`rb-table-toolbar__header`,children:[e?(0,d.jsx)(`div`,{className:`
288
288
  h4 min-w-0
289
289
  text-left
290
290
  text-[var(--on-dark-text)]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scmlatam/web-ui",
3
3
  "private": false,
4
- "version": "0.2.47",
4
+ "version": "0.2.49",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"