@ssplib/react-components 0.0.331 → 0.0.332

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/index.esm.js CHANGED
@@ -1,3 +1,3 @@
1
- import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{Grid as n,Typography as o,Box as i,Stack as a,Button as l,useTheme as s,Checkbox as c,Card as d,InputLabel as u,TextField as p,SvgIcon as m,useMediaQuery as f,LinearProgress as h,TableContainer as g,Paper as y,CircularProgress as b,FormControlLabel as x,Switch as v,Autocomplete as C,MobileStepper as w,SwipeableDrawer as k,Modal as E,Menu as S,MenuItem as D,Skeleton as Y,IconButton as I,Collapse as M,PaginationItem as O,Alert as V,FormControl as A,Select as T,AppBar as R,Avatar as F,FormLabel as j,FormHelperText as $}from"@mui/material";import{FileDownload as P,ErrorOutline as N,ReportProblemRounded as z,PendingRounded as B,FilterAlt as L,KeyboardArrowDown as W,ExpandLess as _,ExpandMore as q,Refresh as U,KeyboardArrowUp as K}from"@mui/icons-material";import*as X from"react";import H,{createContext as G,useContext as J,useCallback as Q,useState as Z,useEffect as ee,useMemo as re,useRef as te}from"react";import ne from"lodash.get";import{LocalizationProvider as oe,DatePicker as ie,TimePicker as ae}from"@mui/x-date-pickers";import{AdapterDayjs as le}from"@mui/x-date-pickers/AdapterDayjs";import se from"dayjs";import"dayjs/locale/pt-br";import ce from"lodash.hasin";import{useFormContext as de,useForm as ue,Controller as pe}from"react-hook-form";import me from"axios";import{useDropzone as fe}from"react-dropzone";import he from"@emotion/styled";import{ThemeContext as ge}from"@emotion/react";import ye from"@mui/icons-material/CameraAlt";import be from"@mui/icons-material/Delete";import xe from"@mui/icons-material/Done";import ve from"@mui/icons-material/InsertDriveFile";import Ce from"@mui/icons-material/PictureAsPdf";import we from"@mui/material/InputLabel";import{IMaskInput as ke}from"react-imask";import{useQuery as Ee}from"react-query";import Se from"@mui/icons-material/KeyboardArrowLeft";import De from"@mui/icons-material/KeyboardArrowRight";import Ye from"@mui/icons-material/Save";import{LoadingButton as Ie}from"@mui/lab";import{toast as Me,ToastContainer as Oe}from"react-toastify";import Ve from"@mui/icons-material/ContentPasteOutlined";import Ae from"@mui/material/Typography";import Te from"@mui/icons-material/Clear";import Re from"@mui/icons-material/FileDownload";import Fe from"@mui/icons-material/NavigateNextRounded";import je from"@mui/icons-material/Search";import $e from"@mui/material/Grid";import Pe from"@mui/material/Pagination";import Ne from"@mui/material/TextField";import ze from"jszip";import Be from"@mui/icons-material/CloseRounded";import Le from"tinycolor2";import We from"lodash.clonedeep";import*as _e from"xlsx";import qe from"next/dynamic";import Ue from"@mui/icons-material/KeyboardArrowDown";import Ke from"@mui/icons-material/LogoutOutlined";import Xe from"@mui/icons-material/Menu";import He from"@mui/icons-material/Person";import Ge from"@mui/material/LinearProgress";import Je from"next/image";import Qe from"next/link";import{useRouter as Ze}from"next/router";import er from"keycloak-js";import{getCookie as rr,setCookie as tr,deleteCookie as nr}from"cookies-next";import or from"jwt-decode";function ir({title:t}){return e(n,{paddingY:1,item:!0,marginTop:1,marginBottom:3,xs:12,children:[r(o,{textTransform:"uppercase",fontWeight:600,children:t}),r(i,{sx:{backgroundColor:"#94A3B8",height:6,borderRadius:1}})]})}function ar({name:t,title:l,tag:s,xs:c=12,md:d,lg:u}){let p=s&&"Distrital"===s?"#BFDBFE":"Estadual"===s?"#BBF7D0":"Federal"===s?"#FEF08A":"Internacional"===s?"#FED7AA":"Não"===s?"#FECACA":"#BBF7D0";return r(n,{paddingBottom:3,item:!0,xs:c,md:d,lg:u,paddingRight:2,children:e(a,{spacing:1,children:[e(a,{spacing:1,direction:"row",children:[r(o,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l}),s&&r(o,{sx:{backgroundColor:p,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:s})]}),t&&r(i,{children:"false"===String(t)?"Não":"true"===String(t)?"Sim":""===String(t)?"":t?String(t):"Não informado"})]})})}function lr({title:t,xs:i=12,tag:l,md:s,lg:c,paddingBottom:d=3}){let u=l&&"Não"===l?"#FECACA":"Sim"===l?"#BBF7D0":"#E2E8F0";return r(n,{paddingBottom:d,item:!0,xs:i,md:s,lg:c,paddingRight:2,children:e(a,{spacing:1,direction:"row",children:[r(o,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,fontSize:16,children:t}),l&&r(o,{sx:{backgroundColor:u,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l})]})})}const sr=/*#__PURE__*/G({});function cr({title:t,name:i,md:s,fileURL:c,fileExt:d="pdf"}){const{user:u}=J(sr);return r(n,{paddingBottom:3,paddingRight:3,md:s,children:e(a,{spacing:1,sx:{backgroundColor:"#F8FAFC",paddingY:1,paddingX:3,borderRadius:2,border:1,borderColor:"#CBD5E1"},children:[r(o,{fontWeight:600,sx:{textAlign:"center"},children:t}),e(a,{direction:"row",spacing:2,alignItems:"center",children:[r(P,{sx:{fill:"red"}}),r(o,{children:i})]}),r(a,{alignItems:"center",children:r(l,{variant:"outlined",color:"error",size:"small",endIcon:r(P,{}),onClick:()=>fetch(c,{method:"GET",headers:{Authorization:`Bearer ${u?.token}`}}).then(e=>e.blob()).then(e=>{var r=window.URL.createObjectURL(e);const t=document.createElement("a");t.href=r,t.download=i.split(".")[0]+`.${d}`,t.click()}),children:"Baixar"})})]})})}const dr=/*#__PURE__*/G(null);function ur({name:t,title:a,defaultValue:l=!1,xs:d=12,sm:u,md:p,onChange:m,disabled:f=!1}){const h=J(dr),g=s(),y=h?.formWatch(t)||l,b=Q(e=>{f||(h?.formSetValue(t,!h?.formGetValues(t)),m?.(e))},[h,t,f,m]);return r(n,{item:!0,xs:d,sm:u,md:p,children:e(i,{onClick:e=>b(e),sx:{border:"1px solid",borderColor:y?g.palette.primary.main:"#E0E0E0",borderRadius:"8px",padding:"8px 16px",cursor:f?"not-allowed":"pointer",backgroundColor:y?`${g.palette.primary.main}10`:"white",transition:"all 0.2s",display:"flex",alignItems:"center",position:"relative",opacity:f?.6:1,mb:.5,"&:hover":{borderColor:f||y?void 0:g.palette.grey[400],backgroundColor:f||y?void 0:g.palette.grey[50]}},children:[r(c,{checked:y,size:"small",sx:{padding:0,mr:1.5,"&.Mui-checked":{color:g.palette.primary.main}}}),"string"==typeof a?r(o,{variant:"body2",color:y?"primary.main":"text.primary",fontWeight:y?600:400,children:a}):a,r("input",{type:"checkbox",...h?.formRegister(t),style:{display:"none"}})]})})}function pr(e){let r=[];return e.forEach(e=>{if(e.props){if(e.props.children){const t=pr(Array.isArray(e.props.children)?e.props.children:[e.props.children]);return void(r=r.concat(t))}e.props.name&&r.push(e.props.name)}}),r}function mr({customText:t="Selecione pelo menos 1 opção",...o}){const[i,a]=Z(!1),[l,s]=Z(!0),c=J(dr),d=/*#__PURE__*/H.cloneElement(o.children,{onChange:()=>{i&&!c.formGetValues(d.props.name)&&s(!1)}});return e(n,{container:!0,sx:{padding:1,borderRadius:2},children:[r("input",{type:"text",...c.formRegister(o.name,{validate:(e,r)=>{if(i&&l)return!0;const n=pr(Array.isArray(o.children)?o.children:[o.children]);let d=!1;return n.forEach(e=>{c.formGetValues(e)&&(d=!0)}),!!d||(a(!0),s(!0),t)}}),hidden:!0}),d,r(n,{item:!0,xs:12,children:i&&l&&o.content})]})}function fr({name:t,title:a,customWarning:l,defaultValue:u=!1,xs:p=12,sm:m,md:f}){const h=J(dr),g=s(),y=h?.formWatch(t)||u,b=Q(e=>{h?.formSetValue(t,!h?.formGetValues(t))},[h,t]);return e(n,{item:!0,xs:p,sm:m,md:f,children:[e(i,{onClick:e=>b(e),sx:{border:"1px solid",borderColor:y?g.palette.primary.main:"#E0E0E0",borderRadius:"8px",padding:"8px 16px",cursor:"pointer",backgroundColor:y?`${g.palette.primary.main}10`:"white",transition:"all 0.2s",display:"flex",alignItems:"center",position:"relative",marginBottom:.5,"&:hover":{borderColor:y?void 0:g.palette.grey[400],backgroundColor:y?void 0:g.palette.grey[50]}},children:[r(c,{checked:y,size:"small",sx:{padding:0,mr:1.5,"&.Mui-checked":{color:g.palette.primary.main}}}),r(o,{variant:"body2",color:y?"primary.main":"text.primary",fontWeight:y?600:400,children:a}),r("input",{type:"checkbox",...h?.formRegister(t),style:{display:"none"}})]}),y&&r(d,{sx:{bgcolor:"#FFFBF5",color:"#F59E0B",padding:1,paddingLeft:2},children:l||e(o,{children:[r("b",{children:"Atenção"})," ",r("i",{children:a})," possui regras específicas."]})})]})}function hr(e){let r=[];return e.forEach(e=>{if(e.props){if(e.props.children){const t=hr(Array.isArray(e.props.children)?e.props.children:[e.props.children]);return void(r=r.concat(t))}e.props.name&&r.push(e.props.name)}}),r}function gr({customText:t="Selecione pelo menos 1 opção",...a}){const l=J(dr);return e(n,{container:!0,sx:{border:ne(l.errors,a.name)?"2px solid #d32f2f":"",padding:1,borderRadius:2},children:[r("input",{type:"text",...l.formRegister(a.name,{validate:(e,r)=>{const n=hr(Array.isArray(a.children)?a.children:[a.children]);let o=!1;return n.forEach((e,r)=>{l.formGetValues(e)&&(o=!0)}),!!o||t}}),hidden:!0},1),a.children,ne(l.errors,a.name)&&r(n,{item:!0,xs:12,children:e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:1,border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:ne(l.errors,a.name)?.message})]})})]})}function yr({name:a,required:l=!1,title:s,xs:c=12,sm:d,md:m,minDt:f,defaultValue:h,persistValue:g,maxDt:y,...b}){const x=J(dr),[v,C]=Z(void 0!==h?se(h,"DD/MM/YYYY"):void 0);return ee(()=>{void 0!==v&&x.formSetValue(a,v?v.format("DD/MM/YYYY"):v)},[v]),ee(()=>{if(!g)return()=>{x.formUnregister(a)}},[]),r(t,{children:e(n,{item:!0,xs:c,sm:d,md:m,children:[s&&r(u,{required:l,children:s}),e(oe,{adapterLocale:"pt-br",dateAdapter:le,children:[r(ie,{minDate:se(f,"DD/MM/YYYY"),maxDate:se(y,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:v,onChange:e=>{C(e)},disableHighlightToday:!0,sx:{outline:ne(x.errors,a)?"1px solid transparent":"",backgroundColor:"white",width:"100%","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"error.main",borderWidth:"2px"}},div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>r(p,{size:"small",...e,...x?.formRegister(a,{validate:(e,r)=>!ce(r,a)||(e||(e=""),e.length<=0&&l?"Este campo é obrigatório":e.length<10&&l?"A data precisa seguir o padrão DD/MM/AAAA":!f||se(f,"DD/MM/YYYY").isSame(se(e,"DD/MM/YYYY"))||se(f,"DD/MM/YYYY").isBefore(se(e,"DD/MM/YYYY"))?!y||se(y,"DD/MM/YYYY").isSame(se(e,"DD/MM/YYYY"))||se(y,"DD/MM/YYYY").isAfter(se(e,"DD/MM/YYYY"))?void 0:"A data escolhida não é válida":`A data tem que ser depois de ${f} e antes de ${y}`),shouldUnregister:!0}),fullWidth:!0})}),ne(x.errors,a)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:ne(x.errors,a)?.message})]})]})]})})}function br({name:i,required:a=!1,title:l,xs:s=12,sm:c,md:d,minDt:m,defaultValue:f,persistValue:h,maxDt:g,...y}){const b=de(),[x,v]=Z(void 0!==f?se(f,"DD/MM/YYYY"):void 0);return ee(()=>{void 0!==x&&b.setValue(i,x?x.format("DD/MM/YYYY"):x)},[x]),ee(()=>{if(!h)return()=>{b.unregister(i)}},[]),r(t,{children:e(n,{item:!0,xs:s,sm:c,md:d,children:[l&&r(u,{required:a,children:l}),e(oe,{adapterLocale:"pt-br",dateAdapter:le,children:[r(ie,{minDate:se(m,"DD/MM/YYYY"),maxDate:se(g,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:x,onChange:e=>{v(void 0)},disableHighlightToday:!0,sx:{outline:ne(b.formState.errors,i)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>r(p,{size:"small",...e,...b?.register(i,{validate:(e,r)=>!ce(r,i)||(e||(e=""),e.length<=0&&a?"Este campo é obrigatório":e.length<10&&a?"A data precisa seguir o padrão DD/MM/AAAA":!m||se(m,"DD/MM/YYYY").isSame(se(e,"DD/MM/YYYY"))||se(m,"DD/MM/YYYY").isBefore(se(e,"DD/MM/YYYY"))?!g||se(g,"DD/MM/YYYY").isSame(se(e,"DD/MM/YYYY"))||se(g,"DD/MM/YYYY").isAfter(se(e,"DD/MM/YYYY"))?void 0:"A data escolhida não é válida":`A data tem que ser depois de ${m} e antes de ${g}`),shouldUnregister:!0}),fullWidth:!0})}),r(o,{sx:{color:"#a51c30",fontSize:14,paddingLeft:1},children:ne(b.formState.errors,i)?.message})]})]})})}function xr({name:t,required:a=!1,title:l,defaultValue:s="",xs:c=12,sm:d,md:m}){const f=J(dr),[h,g]=Z(s?se(s,"HH:mm"):null);return ee(()=>{f.formSetValue(t,h?h.format("HH:mm"):h)},[h]),ee(()=>()=>{f.formUnregister(t)},[]),e(n,{item:!0,xs:c,sm:d,md:m,children:[l&&r(u,{required:a,children:l}),e(oe,{adapterLocale:"pt-br",dateAdapter:le,children:[r(ae,{value:h,ampm:!1,onChange:e=>{g(e)},sx:{outline:ne(f.errors,t)?"1px solid transparent":"",backgroundColor:"white",width:"100%","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"error.main",borderWidth:"2px"}},div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>r(p,{size:"small",...e,...f?.formRegister(t,{validate:(e,r)=>!ce(r,t)||(e||(e=""),e.length<=0&&a?"Este campo é obrigatório":e.length<5&&a?"A hora precisa seguir o padrão HH:MM":void 0),shouldUnregister:!0}),fullWidth:!0})}),ne(f.errors,t)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:ne(f.errors,t)?.message})]})]})]})}function vr(){return vr=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},vr.apply(null,arguments)}function Cr(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function wr(e){if(!Cr(e))return e;const r={};return Object.keys(e).forEach(t=>{r[t]=wr(e[t])}),r}function kr(e,r,t={clone:!0}){const n=t.clone?vr({},e):e;return Cr(e)&&Cr(r)&&Object.keys(r).forEach(o=>{"__proto__"!==o&&(n[o]=Cr(r[o])&&o in e&&Cr(e[o])?kr(e[o],r[o],t):t.clone&&Cr(r[o])?wr(r[o]):r[o])}),n}function Er(e){var r={exports:{}};return e(r,r.exports),r.exports}var Sr="function"==typeof Symbol&&Symbol.for,Dr=Sr?Symbol.for("react.element"):60103,Yr=Sr?Symbol.for("react.portal"):60106,Ir=Sr?Symbol.for("react.fragment"):60107,Mr=Sr?Symbol.for("react.strict_mode"):60108,Or=Sr?Symbol.for("react.profiler"):60114,Vr=Sr?Symbol.for("react.provider"):60109,Ar=Sr?Symbol.for("react.context"):60110,Tr=Sr?Symbol.for("react.async_mode"):60111,Rr=Sr?Symbol.for("react.concurrent_mode"):60111,Fr=Sr?Symbol.for("react.forward_ref"):60112,jr=Sr?Symbol.for("react.suspense"):60113,$r=Sr?Symbol.for("react.suspense_list"):60120,Pr=Sr?Symbol.for("react.memo"):60115,Nr=Sr?Symbol.for("react.lazy"):60116,zr=Sr?Symbol.for("react.block"):60121,Br=Sr?Symbol.for("react.fundamental"):60117,Lr=Sr?Symbol.for("react.responder"):60118,Wr=Sr?Symbol.for("react.scope"):60119;function _r(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case Dr:switch(e=e.type){case Tr:case Rr:case Ir:case Or:case Mr:case jr:return e;default:switch(e=e&&e.$$typeof){case Ar:case Fr:case Nr:case Pr:case Vr:return e;default:return r}}case Yr:return r}}}function qr(e){return _r(e)===Rr}var Ur={AsyncMode:Tr,ConcurrentMode:Rr,ContextConsumer:Ar,ContextProvider:Vr,Element:Dr,ForwardRef:Fr,Fragment:Ir,Lazy:Nr,Memo:Pr,Portal:Yr,Profiler:Or,StrictMode:Mr,Suspense:jr,isAsyncMode:function(e){return qr(e)||_r(e)===Tr},isConcurrentMode:qr,isContextConsumer:function(e){return _r(e)===Ar},isContextProvider:function(e){return _r(e)===Vr},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Dr},isForwardRef:function(e){return _r(e)===Fr},isFragment:function(e){return _r(e)===Ir},isLazy:function(e){return _r(e)===Nr},isMemo:function(e){return _r(e)===Pr},isPortal:function(e){return _r(e)===Yr},isProfiler:function(e){return _r(e)===Or},isStrictMode:function(e){return _r(e)===Mr},isSuspense:function(e){return _r(e)===jr},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Ir||e===Rr||e===Or||e===Mr||e===jr||e===$r||"object"==typeof e&&null!==e&&(e.$$typeof===Nr||e.$$typeof===Pr||e.$$typeof===Vr||e.$$typeof===Ar||e.$$typeof===Fr||e.$$typeof===Br||e.$$typeof===Lr||e.$$typeof===Wr||e.$$typeof===zr)},typeOf:_r},Kr=Er(function(e,r){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case t:var m=e.type;switch(m){case c:case d:case o:case a:case i:case p:return m;default:var g=m&&m.$$typeof;switch(g){case s:case u:case h:case f:case l:return g;default:return r}}case n:return r}}}var C=d,w=s,k=l,E=t,S=u,D=o,Y=h,I=f,M=n,O=a,V=i,A=p,T=!1;function R(e){return v(e)===d}r.AsyncMode=c,r.ConcurrentMode=C,r.ContextConsumer=w,r.ContextProvider=k,r.Element=E,r.ForwardRef=S,r.Fragment=D,r.Lazy=Y,r.Memo=I,r.Portal=M,r.Profiler=O,r.StrictMode=V,r.Suspense=A,r.isAsyncMode=function(e){return T||(T=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||v(e)===c},r.isConcurrentMode=R,r.isContextConsumer=function(e){return v(e)===s},r.isContextProvider=function(e){return v(e)===l},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},r.isForwardRef=function(e){return v(e)===u},r.isFragment=function(e){return v(e)===o},r.isLazy=function(e){return v(e)===h},r.isMemo=function(e){return v(e)===f},r.isPortal=function(e){return v(e)===n},r.isProfiler=function(e){return v(e)===a},r.isStrictMode=function(e){return v(e)===i},r.isSuspense=function(e){return v(e)===p},r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===a||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===f||e.$$typeof===l||e.$$typeof===s||e.$$typeof===u||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===g)},r.typeOf=v}()}),Xr=Er(function(e){e.exports="production"===process.env.NODE_ENV?Ur:Kr}),Hr=Object.getOwnPropertySymbols,Gr=Object.prototype.hasOwnProperty,Jr=Object.prototype.propertyIsEnumerable,Qr=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(r).map(function(e){return r[e]});if("0123456789"!==n.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var t,n,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;i<arguments.length;i++){for(var a in t=Object(arguments[i]))Gr.call(t,a)&&(o[a]=t[a]);if(Hr){n=Hr(t);for(var l=0;l<n.length;l++)Jr.call(t,n[l])&&(o[n[l]]=t[n[l]])}}return o},Zr=Function.call.bind(Object.prototype.hasOwnProperty),et="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",rt=Zr,tt=function(){};if("production"!==process.env.NODE_ENV){var nt=et,ot={},it=rt;tt=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function at(e,r,t,n,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(it(e,i)){var a;try{if("function"!=typeof e[i]){var l=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](r,i,n,t,null,nt)}catch(e){a=e}if(!a||a instanceof Error||tt((n||"React class")+": type specification of "+t+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in ot)){ot[a.message]=!0;var s=o?o():"";tt("Failed "+t+" type: "+a.message+(null!=s?s:""))}}}at.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(ot={})};var lt=at,st=function(){};function ct(){return null}function dt(){}function ut(){}"production"!==process.env.NODE_ENV&&(st=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}),ut.resetWarningCache=dt;var pt,mt=Er(function(e){e.exports="production"!==process.env.NODE_ENV?function(e){var r="function"==typeof Symbol&&Symbol.iterator,t="<<anonymous>>",n={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(ct),arrayOf:function(e){return a(function(r,t,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var l=r[t];if(!Array.isArray(l))return new i("Invalid "+o+" `"+a+"` of type `"+d(l)+"` supplied to `"+n+"`, expected an array.");for(var s=0;s<l.length;s++){var c=e(l,s,n,o,a+"["+s+"]",et);if(c instanceof Error)return c}return null})},element:a(function(r,t,n,o,a){var l=r[t];return e(l)?null:new i("Invalid "+o+" `"+a+"` of type `"+d(l)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:a(function(e,r,t,n,o){var a=e[r];return Xr.isValidElementType(a)?null:new i("Invalid "+n+" `"+o+"` of type `"+d(a)+"` supplied to `"+t+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(r,n,o,a,l){return r[n]instanceof e?null:new i("Invalid "+a+" `"+l+"` of type `"+((s=r[n]).constructor&&s.constructor.name?s.constructor.name:t)+"` supplied to `"+o+"`, expected instance of `"+(e.name||t)+"`.");var s})},node:a(function(e,r,t,n,o){return c(e[r])?null:new i("Invalid "+n+" `"+o+"` supplied to `"+t+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(r,t,n,o,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+n+"` has invalid PropType notation inside objectOf.");var l=r[t],s=d(l);if("object"!==s)return new i("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+n+"`, expected an object.");for(var c in l)if(rt(l,c)){var u=e(l,c,n,o,a+"."+c,et);if(u instanceof Error)return u}return null})},oneOf:function(e){return Array.isArray(e)?a(function(r,t,n,a,l){for(var s=r[t],c=0;c<e.length;c++)if(o(s,e[c]))return null;var d=JSON.stringify(e,function(e,r){return"symbol"===u(r)?String(r):r});return new i("Invalid "+a+" `"+l+"` of value `"+String(s)+"` supplied to `"+n+"`, expected one of "+d+".")}):("production"!==process.env.NODE_ENV&&st(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),ct)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&st("Invalid argument supplied to oneOfType, expected an instance of array."),ct;for(var r=0;r<e.length;r++){var t=e[r];if("function"!=typeof t)return st("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(t)+" at index "+r+"."),ct}return a(function(r,t,n,o,a){for(var l=[],s=0;s<e.length;s++){var c=(0,e[s])(r,t,n,o,a,et);if(null==c)return null;c.data&&rt(c.data,"expectedType")&&l.push(c.data.expectedType)}return new i("Invalid "+o+" `"+a+"` supplied to `"+n+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(r,t,n,o,a){var l=r[t],c=d(l);if("object"!==c)return new i("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+n+"`, expected `object`.");for(var p in e){var m=e[p];if("function"!=typeof m)return s(n,o,a,p,u(m));var f=m(l,p,n,o,a+"."+p,et);if(f)return f}return null})},exact:function(e){return a(function(r,t,n,o,a){var l=r[t],c=d(l);if("object"!==c)return new i("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+n+"`, expected `object`.");var p=Qr({},r[t],e);for(var m in p){var f=e[m];if(rt(e,m)&&"function"!=typeof f)return s(n,o,a,m,u(f));if(!f)return new i("Invalid "+o+" `"+a+"` key `"+m+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(r[t],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(l,m,n,o,a+"."+m,et);if(h)return h}return null})}};function o(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function i(e,r){this.message=e,this.data=r&&"object"==typeof r?r:{},this.stack=""}function a(e){function r(r,n,o,a,l,s,c){if(a=a||t,s=s||o,c!==et){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}return null==n[o]?r?new i(null===n[o]?"The "+l+" `"+s+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+l+" `"+s+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(n,o,a,l,s)}process;var n=r.bind(null,!1);return n.isRequired=r.bind(null,!0),n}function l(e){return a(function(r,t,n,o,a,l){var s=r[t];return d(s)!==e?new i("Invalid "+o+" `"+a+"` of type `"+u(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,r,t,n,o){return new i((e||"React class")+": "+r+" type `"+t+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var n=function(e){var t=e&&(r&&e[r]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!n)return!1;var o,i=n.call(t);if(n!==t.entries){for(;!(o=i.next()).done;)if(!c(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!c(a[1]))return!1}return!0;default:return!1}}function d(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,e)?"symbol":r}function u(e){if(null==e)return""+e;var r=d(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function p(e){var r=u(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return i.prototype=Error.prototype,n.checkPropTypes=lt,n.resetWarningCache=lt.resetWarningCache,n.PropTypes=n,n}(Xr.isElement):function(){function e(e,r,t,n,o,i){if(i!==et){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:ut,resetWarningCache:dt};return t.PropTypes=t,t}()}),ft=Symbol.for("react.element"),ht=Symbol.for("react.portal"),gt=Symbol.for("react.fragment"),yt=Symbol.for("react.strict_mode"),bt=Symbol.for("react.profiler"),xt=Symbol.for("react.provider"),vt=Symbol.for("react.context"),Ct=Symbol.for("react.server_context"),wt=Symbol.for("react.forward_ref"),kt=Symbol.for("react.suspense"),Et=Symbol.for("react.suspense_list"),St=Symbol.for("react.memo"),Dt=Symbol.for("react.lazy"),Yt=Symbol.for("react.offscreen");function It(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case ft:switch(e=e.type){case gt:case bt:case yt:case kt:case Et:return e;default:switch(e=e&&e.$$typeof){case Ct:case vt:case wt:case Dt:case St:case xt:return e;default:return r}}case ht:return r}}}pt=Symbol.for("react.module.reference");var Mt={ContextConsumer:vt,ContextProvider:xt,Element:ft,ForwardRef:wt,Fragment:gt,Lazy:Dt,Memo:St,Portal:ht,Profiler:bt,StrictMode:yt,Suspense:kt,SuspenseList:Et,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return It(e)===vt},isContextProvider:function(e){return It(e)===xt},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ft},isForwardRef:function(e){return It(e)===wt},isFragment:function(e){return It(e)===gt},isLazy:function(e){return It(e)===Dt},isMemo:function(e){return It(e)===St},isPortal:function(e){return It(e)===ht},isProfiler:function(e){return It(e)===bt},isStrictMode:function(e){return It(e)===yt},isSuspense:function(e){return It(e)===kt},isSuspenseList:function(e){return It(e)===Et},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===gt||e===bt||e===yt||e===kt||e===Et||e===Yt||"object"==typeof e&&null!==e&&(e.$$typeof===Dt||e.$$typeof===St||e.$$typeof===xt||e.$$typeof===vt||e.$$typeof===wt||e.$$typeof===pt||void 0!==e.getModuleId)},typeOf:It},Ot=Er(function(e,r){"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case t:var h=e.type;switch(h){case o:case a:case i:case u:case p:return h;default:var g=h&&h.$$typeof;switch(g){case c:case s:case d:case f:case m:case l:return g;default:return r}}case n:return r}}}e=Symbol.for("react.module.reference");var y=l,b=t,x=d,v=o,C=f,w=m,k=n,E=a,S=i,D=u,Y=p,I=!1,M=!1;r.ContextConsumer=s,r.ContextProvider=y,r.Element=b,r.ForwardRef=x,r.Fragment=v,r.Lazy=C,r.Memo=w,r.Portal=k,r.Profiler=E,r.StrictMode=S,r.Suspense=D,r.SuspenseList=Y,r.isAsyncMode=function(e){return I||(I=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},r.isConcurrentMode=function(e){return M||(M=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},r.isContextConsumer=function(e){return g(e)===s},r.isContextProvider=function(e){return g(e)===l},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},r.isForwardRef=function(e){return g(e)===d},r.isFragment=function(e){return g(e)===o},r.isLazy=function(e){return g(e)===f},r.isMemo=function(e){return g(e)===m},r.isPortal=function(e){return g(e)===n},r.isProfiler=function(e){return g(e)===a},r.isStrictMode=function(e){return g(e)===i},r.isSuspense=function(e){return g(e)===u},r.isSuspenseList=function(e){return g(e)===p},r.isValidElementType=function(r){return"string"==typeof r||"function"==typeof r||r===o||r===a||r===i||r===u||r===p||r===h||"object"==typeof r&&null!==r&&(r.$$typeof===f||r.$$typeof===m||r.$$typeof===l||r.$$typeof===s||r.$$typeof===d||r.$$typeof===e||void 0!==r.getModuleId)},r.typeOf=g}()}),Vt=Er(function(e){e.exports="production"===process.env.NODE_ENV?Mt:Ot});const At=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Tt(e,r=""){return e.displayName||e.name||function(e){const r=`${e}`.match(At);return r&&r[1]||""}(e)||r}function Rt(e,r,t){const n=Tt(r);return e.displayName||(""!==n?`${t}(${n})`:t)}function Ft(e){if("string"!=typeof e)throw new Error("production"!==process.env.NODE_ENV?"MUI: `capitalize(string)` expects a string argument.":function(e){let r="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)r+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+r+" for the full message."}(7));return e.charAt(0).toUpperCase()+e.slice(1)}function jt(e,r){const t=vr({},r);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))t[n]=vr({},e[n],t[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=r[n];t[n]={},i&&Object.keys(i)?o&&Object.keys(o)?(t[n]=vr({},i),Object.keys(o).forEach(e=>{t[n][e]=jt(o[e],i[e])})):t[n]=i:t[n]=o}else void 0===t[n]&&(t[n]=e[n])}),t}const $t=e=>e;var Pt=(()=>{let e=$t;return{configure(r){e=r},generate:r=>e(r),reset(){e=$t}}})();const Nt={active:"active",checked:"checked",completed:"completed",disabled:"disabled",readOnly:"readOnly",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",required:"required",selected:"selected"};function zt(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}const Bt=["values","unit","step"];var Lt={borderRadius:4},Wt="production"!==process.env.NODE_ENV?mt.oneOfType([mt.number,mt.string,mt.object,mt.array]):{};function _t(e,r){return r?kr(e,r,{clone:!1}):e}const qt={xs:0,sm:600,md:900,lg:1200,xl:1536},Ut={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${qt[e]}px)`};function Kt(e,r,t){const n=e.theme||{};if(Array.isArray(r)){const e=n.breakpoints||Ut;return r.reduce((n,o,i)=>(n[e.up(e.keys[i])]=t(r[i]),n),{})}if("object"==typeof r){const e=n.breakpoints||Ut;return Object.keys(r).reduce((n,o)=>(-1!==Object.keys(e.values||qt).indexOf(o)?n[e.up(o)]=t(r[o],o):n[o]=r[o],n),{})}return t(r)}function Xt(e={}){var r;return(null==(r=e.keys)?void 0:r.reduce((r,t)=>(r[e.up(t)]={},r),{}))||{}}function Ht(e,r){return e.reduce((e,r)=>{const t=e[r];return(!t||0===Object.keys(t).length)&&delete e[r],e},r)}function Gt({values:e,breakpoints:r,base:t}){const n=t||function(e,r){if("object"!=typeof e)return{};const t={},n=Object.keys(r);return Array.isArray(e)?n.forEach((r,n)=>{n<e.length&&(t[r]=!0)}):n.forEach(r=>{null!=e[r]&&(t[r]=!0)}),t}(e,r),o=Object.keys(n);if(0===o.length)return e;let i;return o.reduce((r,t,n)=>(Array.isArray(e)?(r[t]=null!=e[n]?e[n]:e[i],i=n):"object"==typeof e?(r[t]=null!=e[t]?e[t]:e[i],i=t):r[t]=e,r),{})}function Jt(e,r,t=!0){if(!r||"string"!=typeof r)return null;if(e&&e.vars&&t){const t=`vars.${r}`.split(".").reduce((e,r)=>e&&e[r]?e[r]:null,e);if(null!=t)return t}return r.split(".").reduce((e,r)=>e&&null!=e[r]?e[r]:null,e)}function Qt(e,r,t,n=t){let o;return o="function"==typeof e?e(t):Array.isArray(e)?e[t]||n:Jt(e,t)||n,r&&(o=r(o,n,e)),o}function Zt(e){const{prop:r,cssProperty:t=e.prop,themeKey:n,transform:o}=e,i=e=>{if(null==e[r])return null;const i=e[r],a=Jt(e.theme,n)||{};return Kt(e,i,e=>{let n=Qt(a,o,e);return e===n&&"string"==typeof e&&(n=Qt(a,o,`${r}${"default"===e?"":Ft(e)}`,e)),!1===t?n:{[t]:n}})};return i.propTypes="production"!==process.env.NODE_ENV?{[r]:Wt}:{},i.filterProps=[r],i}const en={m:"margin",p:"padding"},rn={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},tn={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},nn=function(){const e={};return r=>(void 0===e[r]&&(e[r]=(e=>{if(e.length>2){if(!tn[e])return[e];e=tn[e]}const[r,t]=e.split(""),n=en[r],o=rn[t]||"";return Array.isArray(o)?o.map(e=>n+e):[n+o]})(r)),e[r])}(),on=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],an=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],ln=[...on,...an];function sn(e,r,t,n){var o;const i=null!=(o=Jt(e,r,!1))?o:t;return"number"==typeof i?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&"number"!=typeof e&&console.error(`MUI: Expected ${n} argument to be a number or a string, got ${e}.`),i*e):Array.isArray(i)?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&(Number.isInteger(e)?e>i.length-1&&console.error([`MUI: The value provided (${e}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${e} > ${i.length-1}, you need to add the missing values.`].join("\n")):console.error([`MUI: The \`theme.${r}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${r}\` as a number.`].join("\n"))),i[e]):"function"==typeof i?i:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${r}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}function cn(e){return sn(e,"spacing",8,"spacing")}function dn(e,r){if("string"==typeof r||null==r)return r;const t=e(Math.abs(r));return r>=0?t:"number"==typeof t?-t:`-${t}`}function un(e,r){const t=cn(e.theme);return Object.keys(e).map(n=>function(e,r,t,n){if(-1===r.indexOf(t))return null;const o=function(e,r){return t=>e.reduce((e,n)=>(e[n]=dn(r,t),e),{})}(nn(t),n);return Kt(e,e[t],o)}(e,r,n,t)).reduce(_t,{})}function pn(e){return un(e,on)}function mn(e){return un(e,an)}function fn(...e){const r=e.reduce((e,r)=>(r.filterProps.forEach(t=>{e[t]=r}),e),{}),t=e=>Object.keys(e).reduce((t,n)=>r[n]?_t(t,r[n](e)):t,{});return t.propTypes="production"!==process.env.NODE_ENV?e.reduce((e,r)=>Object.assign(e,r.propTypes),{}):{},t.filterProps=e.reduce((e,r)=>e.concat(r.filterProps),[]),t}function hn(e){return"number"!=typeof e?e:`${e}px solid`}pn.propTypes="production"!==process.env.NODE_ENV?on.reduce((e,r)=>(e[r]=Wt,e),{}):{},pn.filterProps=on,mn.propTypes="production"!==process.env.NODE_ENV?an.reduce((e,r)=>(e[r]=Wt,e),{}):{},mn.filterProps=an,"production"===process.env.NODE_ENV||ln.reduce((e,r)=>(e[r]=Wt,e),{});const gn=Zt({prop:"border",themeKey:"borders",transform:hn}),yn=Zt({prop:"borderTop",themeKey:"borders",transform:hn}),bn=Zt({prop:"borderRight",themeKey:"borders",transform:hn}),xn=Zt({prop:"borderBottom",themeKey:"borders",transform:hn}),vn=Zt({prop:"borderLeft",themeKey:"borders",transform:hn}),Cn=Zt({prop:"borderColor",themeKey:"palette"}),wn=Zt({prop:"borderTopColor",themeKey:"palette"}),kn=Zt({prop:"borderRightColor",themeKey:"palette"}),En=Zt({prop:"borderBottomColor",themeKey:"palette"}),Sn=Zt({prop:"borderLeftColor",themeKey:"palette"}),Dn=e=>{if(null!=e.borderRadius){const r=sn(e.theme,"shape.borderRadius",4,"borderRadius");return Kt(e,e.borderRadius,e=>({borderRadius:dn(r,e)}))}return null};Dn.propTypes="production"!==process.env.NODE_ENV?{borderRadius:Wt}:{},Dn.filterProps=["borderRadius"],fn(gn,yn,bn,xn,vn,Cn,wn,kn,En,Sn,Dn);const Yn=e=>{if(null!=e.gap){const r=sn(e.theme,"spacing",8,"gap");return Kt(e,e.gap,e=>({gap:dn(r,e)}))}return null};Yn.propTypes="production"!==process.env.NODE_ENV?{gap:Wt}:{},Yn.filterProps=["gap"];const In=e=>{if(null!=e.columnGap){const r=sn(e.theme,"spacing",8,"columnGap");return Kt(e,e.columnGap,e=>({columnGap:dn(r,e)}))}return null};In.propTypes="production"!==process.env.NODE_ENV?{columnGap:Wt}:{},In.filterProps=["columnGap"];const Mn=e=>{if(null!=e.rowGap){const r=sn(e.theme,"spacing",8,"rowGap");return Kt(e,e.rowGap,e=>({rowGap:dn(r,e)}))}return null};function On(e,r){return"grey"===r?r:e}function Vn(e){return e<=1&&0!==e?100*e+"%":e}Mn.propTypes="production"!==process.env.NODE_ENV?{rowGap:Wt}:{},Mn.filterProps=["rowGap"],fn(Yn,In,Mn,Zt({prop:"gridColumn"}),Zt({prop:"gridRow"}),Zt({prop:"gridAutoFlow"}),Zt({prop:"gridAutoColumns"}),Zt({prop:"gridAutoRows"}),Zt({prop:"gridTemplateColumns"}),Zt({prop:"gridTemplateRows"}),Zt({prop:"gridTemplateAreas"}),Zt({prop:"gridArea"})),fn(Zt({prop:"color",themeKey:"palette",transform:On}),Zt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:On}),Zt({prop:"backgroundColor",themeKey:"palette",transform:On}));const An=Zt({prop:"width",transform:Vn}),Tn=e=>null!=e.maxWidth?Kt(e,e.maxWidth,r=>{var t,n,o;return{maxWidth:(null==(t=e.theme)||null==(n=t.breakpoints)||null==(o=n.values)?void 0:o[r])||qt[r]||Vn(r)}}):null;Tn.filterProps=["maxWidth"];const Rn=Zt({prop:"minWidth",transform:Vn}),Fn=Zt({prop:"height",transform:Vn}),jn=Zt({prop:"maxHeight",transform:Vn}),$n=Zt({prop:"minHeight",transform:Vn});Zt({prop:"size",cssProperty:"width",transform:Vn}),Zt({prop:"size",cssProperty:"height",transform:Vn}),fn(An,Tn,Rn,Fn,jn,$n,Zt({prop:"boxSizing"}));var Pn={border:{themeKey:"borders",transform:hn},borderTop:{themeKey:"borders",transform:hn},borderRight:{themeKey:"borders",transform:hn},borderBottom:{themeKey:"borders",transform:hn},borderLeft:{themeKey:"borders",transform:hn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Dn},color:{themeKey:"palette",transform:On},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:On},backgroundColor:{themeKey:"palette",transform:On},p:{style:mn},pt:{style:mn},pr:{style:mn},pb:{style:mn},pl:{style:mn},px:{style:mn},py:{style:mn},padding:{style:mn},paddingTop:{style:mn},paddingRight:{style:mn},paddingBottom:{style:mn},paddingLeft:{style:mn},paddingX:{style:mn},paddingY:{style:mn},paddingInline:{style:mn},paddingInlineStart:{style:mn},paddingInlineEnd:{style:mn},paddingBlock:{style:mn},paddingBlockStart:{style:mn},paddingBlockEnd:{style:mn},m:{style:pn},mt:{style:pn},mr:{style:pn},mb:{style:pn},ml:{style:pn},mx:{style:pn},my:{style:pn},margin:{style:pn},marginTop:{style:pn},marginRight:{style:pn},marginBottom:{style:pn},marginLeft:{style:pn},marginX:{style:pn},marginY:{style:pn},marginInline:{style:pn},marginInlineStart:{style:pn},marginInlineEnd:{style:pn},marginBlock:{style:pn},marginBlockStart:{style:pn},marginBlockEnd:{style:pn},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Yn},rowGap:{style:Mn},columnGap:{style:In},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Vn},maxWidth:{style:Tn},minWidth:{transform:Vn},height:{transform:Vn},maxHeight:{transform:Vn},minHeight:{transform:Vn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};const Nn=function(){function e(e,r,t,n){const o={[e]:r,theme:t},i=n[e];if(!i)return{[e]:r};const{cssProperty:a=e,themeKey:l,transform:s,style:c}=i;if(null==r)return null;if("typography"===l&&"inherit"===r)return{[e]:r};const d=Jt(t,l)||{};return c?c(o):Kt(o,r,r=>{let t=Qt(d,s,r);return r===t&&"string"==typeof r&&(t=Qt(d,s,`${e}${"default"===r?"":Ft(r)}`,r)),!1===a?t:{[a]:t}})}return function r(t){var n;const{sx:o,theme:i={}}=t||{};if(!o)return null;const a=null!=(n=i.unstable_sxConfig)?n:Pn;function l(t){let n=t;if("function"==typeof t)n=t(i);else if("object"!=typeof t)return t;if(!n)return null;const o=Xt(i.breakpoints),l=Object.keys(o);let s=o;return Object.keys(n).forEach(t=>{const o="function"==typeof(l=n[t])?l(i):l;var l;if(null!=o)if("object"==typeof o)if(a[t])s=_t(s,e(t,o,i,a));else{const e=Kt({theme:i},o,e=>({[t]:e}));!function(...e){const r=e.reduce((e,r)=>e.concat(Object.keys(r)),[]),t=new Set(r);return e.every(e=>t.size===Object.keys(e).length)}(e,o)?s=_t(s,e):s[t]=r({sx:o,theme:i})}else s=_t(s,e(t,o,i,a))}),Ht(l,s)}return Array.isArray(o)?o.map(l):l(o)}}();Nn.filterProps=["sx"];var zn=Nn;const Bn=["breakpoints","palette","spacing","shape"];function Ln(e={},...r){const{breakpoints:t={},palette:n={},spacing:o,shape:i={}}=e,a=zt(e,Bn),l=function(e){const{values:r={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:t="px",step:n=5}=e,o=zt(e,Bt),i=(e=>{const r=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return r.sort((e,r)=>e.val-r.val),r.reduce((e,r)=>vr({},e,{[r.key]:r.val}),{})})(r),a=Object.keys(i);function l(e){return`@media (min-width:${"number"==typeof r[e]?r[e]:e}${t})`}function s(e){return`@media (max-width:${("number"==typeof r[e]?r[e]:e)-n/100}${t})`}function c(e,o){const i=a.indexOf(o);return`@media (min-width:${"number"==typeof r[e]?r[e]:e}${t}) and (max-width:${(-1!==i&&"number"==typeof r[a[i]]?r[a[i]]:o)-n/100}${t})`}return vr({keys:a,values:i,up:l,down:s,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):l(e)},not:function(e){const r=a.indexOf(e);return 0===r?l(a[1]):r===a.length-1?s(a[r]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:t},o)}(t),s=function(e=8){if(e.mui)return e;const r=cn({spacing:e}),t=(...e)=>("production"!==process.env.NODE_ENV&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(0===e.length?[1]:e).map(e=>{const t=r(e);return"number"==typeof t?`${t}px`:t}).join(" "));return t.mui=!0,t}(o);let c=kr({breakpoints:l,direction:"ltr",components:{},palette:vr({mode:"light"},n),spacing:s,shape:vr({},Lt,i)},a);return c=r.reduce((e,r)=>kr(e,r),c),c.unstable_sxConfig=vr({},Pn,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return zn({sx:e,theme:this})},c}const Wn=Ln(),_n=["sx"];function qn(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(t=qn(e[r]))&&(n&&(n+=" "),n+=t);else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Un(){for(var e,r,t=0,n="";t<arguments.length;)(e=arguments[t++])&&(r=qn(e))&&(n&&(n+=" "),n+=r);return n}const Kn=["variant"];function Xn(e){return 0===e.length}function Hn(e){const{variant:r}=e,t=zt(e,Kn);let n=r||"";return Object.keys(t).sort().forEach(r=>{n+="color"===r?Xn(n)?e[r]:Ft(e[r]):`${Xn(n)?r:Ft(r)}${Ft(e[r].toString())}`}),n}const Gn=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Jn(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const Qn=Ln();function Zn({defaultTheme:e,theme:r,themeId:t}){return 0===Object.keys(r).length?e:r[t]||r}const eo=function(e={}){const{themeId:r,defaultTheme:t=Qn,rootShouldForwardProp:n=Jn,slotShouldForwardProp:o=Jn}=e,i=e=>zn(vr({},e,{theme:Zn(vr({},e,{defaultTheme:t,themeId:r}))}));return i.__mui_systemSx=!0,(e,a={})=>{(e=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=e.__emotion_styles.filter(e=>!(null!=e&&e.__mui_systemSx)))})(e);const{name:l,slot:s,skipVariantsResolver:c,skipSx:d,overridesResolver:u}=a,p=zt(a,Gn),m=void 0!==c?c:s&&"Root"!==s||!1,f=d||!1;let h;var g;"production"!==process.env.NODE_ENV&&l&&(h=`${l}-${g=s||"Root",g.charAt(0).toLowerCase()+g.slice(1)}`);let y=Jn;"Root"===s?y=n:s?y=o:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(y=void 0);const b=function(e,r){const t=he(e,r);return"production"!==process.env.NODE_ENV?(...r)=>{const n="string"==typeof e?`"${e}"`:"component";return 0===r.length?console.error([`MUI: Seems like you called \`styled(${n})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n")):r.some(e=>void 0===e)&&console.error(`MUI: the styled(${n})(...args) API requires all its args to be defined.`),t(...r)}:t}(e,vr({shouldForwardProp:y,label:h},p)),x=(n,...o)=>{const a=o?o.map(e=>"function"==typeof e&&e.__emotion_real!==e?n=>e(vr({},n,{theme:Zn(vr({},n,{defaultTheme:t,themeId:r}))})):e):[];let c=n;l&&u&&a.push(e=>{const n=Zn(vr({},e,{defaultTheme:t,themeId:r})),o=((e,r)=>r.components&&r.components[e]&&r.components[e].styleOverrides?r.components[e].styleOverrides:null)(l,n);if(o){const r={};return Object.entries(o).forEach(([t,o])=>{r[t]="function"==typeof o?o(vr({},e,{theme:n})):o}),u(e,r)}return null}),l&&!m&&a.push(e=>{const n=Zn(vr({},e,{defaultTheme:t,themeId:r}));return((e,r,t,n)=>{var o,i;const{ownerState:a={}}=e,l=[],s=null==t||null==(o=t.components)||null==(i=o[n])?void 0:i.variants;return s&&s.forEach(t=>{let n=!0;Object.keys(t.props).forEach(r=>{a[r]!==t.props[r]&&e[r]!==t.props[r]&&(n=!1)}),n&&l.push(r[Hn(t.props)])}),l})(e,((e,r)=>{let t=[];r&&r.components&&r.components[e]&&r.components[e].variants&&(t=r.components[e].variants);const n={};return t.forEach(e=>{const r=Hn(e.props);n[r]=e.style}),n})(l,n),n,l)}),f||a.push(i);const d=a.length-o.length;if(Array.isArray(n)&&d>0){const e=new Array(d).fill("");c=[...n,...e],c.raw=[...n.raw,...e]}else"function"==typeof n&&n.__emotion_real!==n&&(c=e=>n(vr({},e,{theme:Zn(vr({},e,{defaultTheme:t,themeId:r}))})));const p=b(c,...a);if("production"!==process.env.NODE_ENV){let r;l&&(r=`${l}${s||""}`),void 0===r&&(r=`Styled(${function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return Tt(e,"Component");if("object"==typeof e)switch(e.$$typeof){case Vt.ForwardRef:return Rt(e,e.render,"ForwardRef");case Vt.Memo:return Rt(e,e.type,"memo");default:return}}}(e)})`),p.displayName=r}return e.muiName&&(p.muiName=e.muiName),p};return b.withConfig&&(x.withConfig=b.withConfig),x}}();var ro=eo;function to(e){const{theme:r,name:t,props:n}=e;return r&&r.components&&r.components[t]&&r.components[t].defaultProps?jt(r.components[t].defaultProps,n):n}const no=["component","direction","spacing","divider","children","className","useFlexGap"],oo=Ln(),io=ro("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,r)=>r.root});function ao(e){return function({props:e,name:r,defaultTheme:t,themeId:n}){let o=function(e=Wn){return function(e=null){const r=X.useContext(ge);return r&&0!==Object.keys(r).length?r:e}(e)}(t);return n&&(o=o[n]||o),to({theme:o,name:r,props:e})}({props:e,name:"MuiStack",defaultTheme:oo})}function lo(e,r){const t=X.Children.toArray(e).filter(Boolean);return t.reduce((e,n,o)=>(e.push(n),o<t.length-1&&e.push(/*#__PURE__*/X.cloneElement(r,{key:`separator-${o}`})),e),[])}const so=({ownerState:e,theme:r})=>{let t=vr({display:"flex",flexDirection:"column"},Kt({theme:r},Gt({values:e.direction,breakpoints:r.breakpoints.values}),e=>({flexDirection:e})));if(e.spacing){const n=cn(r),o=Object.keys(r.breakpoints.values).reduce((r,t)=>(("object"==typeof e.spacing&&null!=e.spacing[t]||"object"==typeof e.direction&&null!=e.direction[t])&&(r[t]=!0),r),{}),i=Gt({values:e.direction,base:o}),a=Gt({values:e.spacing,base:o});"object"==typeof i&&Object.keys(i).forEach((e,r,t)=>{i[e]||(i[e]=r>0?i[t[r-1]]:"column")}),t=kr(t,Kt({theme:r},a,(r,t)=>{return e.useFlexGap?{gap:dn(n,r)}:{"& > :not(style) + :not(style)":{margin:0,[`margin${o=t?i[t]:e.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[o]}`]:dn(n,r)}};var o}))}return t=function(e,...r){const t=Xt(e),n=[t,...r].reduce((e,r)=>kr(e,r),{});return Ht(Object.keys(t),n)}(r.breakpoints,t),t},co=function(e={}){const{createStyledComponent:t=io,useThemeProps:n=ao,componentName:o="MuiStack"}=e,i=t(so),a=/*#__PURE__*/X.forwardRef(function(e,t){const a=function(e){const{sx:r}=e,t=zt(e,_n),{systemProps:n,otherProps:o}=(e=>{var r,t;const n={systemProps:{},otherProps:{}},o=null!=(r=null==e||null==(t=e.theme)?void 0:t.unstable_sxConfig)?r:Pn;return Object.keys(e).forEach(r=>{o[r]?n.systemProps[r]=e[r]:n.otherProps[r]=e[r]}),n})(t);let i;return i=Array.isArray(r)?[n,...r]:"function"==typeof r?(...e)=>{const t=r(...e);return Cr(t)?vr({},n,t):n}:vr({},n,r),vr({},o,{sx:i})}(n(e)),{component:l="div",direction:s="column",spacing:c=0,divider:d,children:u,className:p,useFlexGap:m=!1}=a,f=zt(a,no),h={direction:s,spacing:c,useFlexGap:m},g=function(e,r,t){const n={};return Object.keys(e).forEach(r=>{n[r]=e[r].reduce((e,r)=>{if(r){const n=(e=>function(e,r,t="Mui"){const n=Nt[r];return n?`${t}-${n}`:`${Pt.generate(e)}-${r}`}(o,e))(r);""!==n&&e.push(n),t&&t[r]&&e.push(t[r])}return e},[]).join(" ")}),n}({root:["root"]},0,{});/*#__PURE__*/
2
- return r(i,vr({as:l,ownerState:h,ref:t,className:Un(g.root,p)},f,{children:d?lo(u,d):u}))});return"production"!==process.env.NODE_ENV&&(a.propTypes={children:mt.node,direction:mt.oneOfType([mt.oneOf(["column-reverse","column","row-reverse","row"]),mt.arrayOf(mt.oneOf(["column-reverse","column","row-reverse","row"])),mt.object]),divider:mt.node,spacing:mt.oneOfType([mt.arrayOf(mt.oneOfType([mt.number,mt.string])),mt.number,mt.object,mt.string]),sx:mt.oneOfType([mt.arrayOf(mt.oneOfType([mt.func,mt.object,mt.bool])),mt.func,mt.object])}),a}();"production"!==process.env.NODE_ENV&&(co.propTypes={children:mt.node,component:mt.elementType,direction:mt.oneOfType([mt.oneOf(["column-reverse","column","row-reverse","row"]),mt.arrayOf(mt.oneOf(["column-reverse","column","row-reverse","row"])),mt.object]),divider:mt.node,spacing:mt.oneOfType([mt.arrayOf(mt.oneOfType([mt.number,mt.string])),mt.number,mt.object,mt.string]),sx:mt.oneOfType([mt.arrayOf(mt.oneOfType([mt.func,mt.object,mt.bool])),mt.func,mt.object]),useFlexGap:mt.bool});var uo=co;function po(t){return r(m,{...t,children:e("svg",{width:"26",height:"34",viewBox:"0 0 26 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r("path",{d:"M24.9717 11.5L14.8333 1.36165C14.5757 1.10371 14.2262 0.958634 13.8617 0.958313H5.66667C4.32953 0.958313 3.04717 1.48949 2.10167 2.43498C1.15617 3.38048 0.625 4.66285 0.625 5.99998V28C0.625 29.3371 1.15617 30.6195 2.10167 31.565C3.04717 32.5105 4.32953 33.0416 5.66667 33.0416H20.3333C21.6705 33.0416 22.9528 32.5105 23.8983 31.565C24.8438 30.6195 25.375 29.3371 25.375 28V12.4166C25.3606 12.0713 25.2166 11.744 24.9717 11.5ZM15.2917 5.65165L20.6817 11.0416H15.2917V5.65165ZM20.3333 30.2916H5.66667C5.05888 30.2916 4.47598 30.0502 4.04621 29.6204C3.61644 29.1907 3.375 28.6078 3.375 28V5.99998C3.375 5.39219 3.61644 4.8093 4.04621 4.37953C4.47598 3.94976 5.05888 3.70831 5.66667 3.70831H12.5417V12.4166C12.5464 12.7798 12.6928 13.1268 12.9496 13.3837C13.2065 13.6405 13.5535 13.7869 13.9167 13.7916H22.625V28C22.625 28.6078 22.3836 29.1907 21.9538 29.6204C21.524 30.0502 20.9411 30.2916 20.3333 30.2916Z",fill:"#fff"}),r("path",{d:"M15.7317 22.225C14.6044 21.5176 13.756 20.4425 13.33 19.1817C13.7248 18.0021 13.8439 16.7478 13.6784 15.515C13.6255 15.2044 13.474 14.9191 13.2464 14.7013C13.0187 14.4835 12.727 14.3448 12.4144 14.3058C12.1018 14.2667 11.7849 14.3293 11.5107 14.4844C11.2364 14.6394 11.0194 14.8786 10.8917 15.1667C10.683 16.6487 10.8403 18.1594 11.35 19.5667C10.6537 21.1933 9.87664 22.7842 9.02169 24.3333C7.72002 25.0667 5.94169 26.1667 5.66669 27.4317C5.44669 28.4583 7.37169 31.0983 10.6534 25.3783C12.1126 24.8366 13.6072 24.3956 15.1267 24.0583C16.2499 24.7005 17.5029 25.0827 18.7934 25.1767C19.0897 25.1843 19.3816 25.1043 19.6325 24.9465C19.8835 24.7887 20.0822 24.5603 20.2036 24.2899C20.3251 24.0195 20.3639 23.7193 20.3152 23.4269C20.2666 23.1345 20.1325 22.8631 19.93 22.6467C19.16 21.8583 16.8684 22.0783 15.7317 22.225ZM6.96836 27.725C7.48213 26.8458 8.16063 26.0739 8.96669 25.4517C7.72002 27.4317 6.96836 27.78 6.96836 27.7433V27.725ZM12.3217 15.24C12.7984 15.24 12.7617 17.3483 12.4317 17.9167C12.1831 17.0521 12.1454 16.1405 12.3217 15.2583V15.24ZM10.7267 24.1867C11.3478 23.0533 11.887 21.877 12.34 20.6667C12.8257 21.5704 13.5012 22.3585 14.32 22.9767C13.09 23.2848 11.888 23.6956 10.7267 24.205V24.1867ZM19.3434 23.8567C19.3434 23.8567 19.0134 24.26 16.905 23.3433C19.1967 23.1967 19.5817 23.7283 19.3434 23.875V23.8567Z",fill:"#fff"})]})})}function mo(t){return r(m,{...t,children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r("path",{d:"M20 8.70001H4C3.90151 8.70001 3.80398 8.68061 3.71299 8.64292C3.62199 8.60523 3.53931 8.54999 3.46967 8.48034C3.40003 8.4107 3.34478 8.32802 3.30709 8.23703C3.2694 8.14603 3.25 8.0485 3.25 7.95001C3.25 7.85152 3.2694 7.75399 3.30709 7.663C3.34478 7.57201 3.40003 7.48933 3.46967 7.41968C3.53931 7.35004 3.62199 7.29479 3.71299 7.2571C3.80398 7.21941 3.90151 7.20001 4 7.20001H20C20.1989 7.20001 20.3897 7.27903 20.5303 7.41968C20.671 7.56033 20.75 7.7511 20.75 7.95001C20.75 8.14892 20.671 8.33969 20.5303 8.48034C20.3897 8.621 20.1989 8.70001 20 8.70001Z",fill:"white"}),r("path",{d:"M16.44 20.75H7.56C7.24309 20.7717 6.92503 20.7302 6.62427 20.628C6.3235 20.5259 6.04601 20.365 5.80788 20.1548C5.56975 19.9446 5.37572 19.6891 5.23704 19.4034C5.09836 19.1176 5.01779 18.8071 5 18.49V7.99998C5 7.80107 5.07902 7.61031 5.21967 7.46965C5.36032 7.329 5.55109 7.24998 5.75 7.24998C5.94891 7.24998 6.13968 7.329 6.28033 7.46965C6.42098 7.61031 6.5 7.80107 6.5 7.99998V18.49C6.5 18.9 6.97 19.25 7.5 19.25H16.38C16.94 19.25 17.38 18.9 17.38 18.49V7.99998C17.38 7.78516 17.4653 7.57913 17.6172 7.42723C17.7691 7.27532 17.9752 7.18998 18.19 7.18998C18.4048 7.18998 18.6109 7.27532 18.7628 7.42723C18.9147 7.57913 19 7.78516 19 7.99998V18.49C18.9822 18.8071 18.9016 19.1176 18.763 19.4034C18.6243 19.6891 18.4303 19.9446 18.1921 20.1548C17.954 20.365 17.6765 20.5259 17.3757 20.628C17.075 20.7302 16.7569 20.7717 16.44 20.75ZM16.56 7.74998C16.4611 7.75133 16.363 7.73285 16.2714 7.69563C16.1798 7.65842 16.0966 7.60323 16.0267 7.53331C15.9568 7.4634 15.9016 7.38018 15.8644 7.28858C15.8271 7.19698 15.8087 7.09885 15.81 6.99998V5.50998C15.81 5.09999 15.33 4.74998 14.81 4.74998H9.22C8.67 4.74998 8.22 5.09999 8.22 5.50998V6.99998C8.22 7.1989 8.14098 7.38966 8.00033 7.53031C7.85968 7.67097 7.66891 7.74998 7.47 7.74998C7.27109 7.74998 7.08032 7.67097 6.93967 7.53031C6.79902 7.38966 6.72 7.1989 6.72 6.99998V5.50998C6.75872 4.8813 7.04203 4.29275 7.50929 3.87035C7.97655 3.44795 8.5906 3.22527 9.22 3.24998H14.78C15.4145 3.21717 16.0362 3.4362 16.51 3.85944C16.9838 4.28267 17.2713 4.87586 17.31 5.50998V6.99998C17.3113 7.09931 17.2929 7.19792 17.2558 7.29007C17.2187 7.38222 17.1637 7.46608 17.0939 7.53679C17.0241 7.6075 16.941 7.66364 16.8493 7.70195C16.7577 7.74027 16.6593 7.75999 16.56 7.75998V7.74998Z",fill:"white"}),r("path",{d:"M10.22 17C10.0219 16.9974 9.8326 16.9175 9.6925 16.7774C9.55241 16.6373 9.47256 16.4481 9.46997 16.25V11.72C9.46997 11.5211 9.54899 11.3303 9.68964 11.1896C9.83029 11.049 10.0211 10.97 10.22 10.97C10.4189 10.97 10.6096 11.049 10.7503 11.1896C10.891 11.3303 10.97 11.5211 10.97 11.72V16.24C10.9713 16.3393 10.9529 16.4379 10.9158 16.5301C10.8787 16.6222 10.8236 16.7061 10.7539 16.7768C10.6841 16.8475 10.601 16.9036 10.5093 16.9419C10.4177 16.9803 10.3193 17 10.22 17Z",fill:"white"}),r("path",{d:"M13.78 17C13.5811 17 13.3904 16.921 13.2497 16.7803C13.109 16.6396 13.03 16.4489 13.03 16.25V11.72C13.03 11.5211 13.109 11.3303 13.2497 11.1896C13.3904 11.049 13.5811 10.97 13.78 10.97C13.9789 10.97 14.1697 11.049 14.3104 11.1896C14.451 11.3303 14.53 11.5211 14.53 11.72V16.24C14.53 16.4398 14.4513 16.6316 14.311 16.7739C14.1706 16.9161 13.9799 16.9973 13.78 17Z",fill:"white"})]})})}function fo(e){const r=1048576;return e<r?`${(e/1024).toFixed(1)}KB`:`${(e/r).toFixed(1)}MB`}function ho({name:t="filesUid",tipoArquivo:a,title:c,required:d=!1,multiple:p=!1,apiURL:m,sizeLimit:g=4,xs:y=12,sm:b,md:x,route:v="",tstToken:C="",dropZoneOptions:w,disabled:k=!1}){const{getRootProps:E,getInputProps:S}=fe({disabled:k,multiple:p,useFsAccessApi:!0,onDrop:e=>{O(-1),e.filter(e=>!(e.size/1048576>g&&(P(`Por favor, escolha um arquivo com tamanho inferior a ${g} MB`),setTimeout(()=>{P("")},3e3),1))).forEach((e,r)=>{let t=Date.now()+r;const n=new FormData;n.append("files",e),n.append("tipoArquivo",a),me.post(m,n,{onUploadProgress:r=>{const n=Math.round(100*r.loaded/r.total);O(n),n>=100&&A(r=>[...r,{id:t,name:e.name,loading:!0,error:!1,file:e,size:e.size}])},headers:{Authorization:`Bearer ${""===C?Y?Y.token:"":C}`}}).then(e=>{if(e.status>200){const r=ne(e.data,v,e.data)[0].coSeqArquivo;D.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:r,CO_TIPO_ARQUIVO:parseInt(a)}]),R(e=>[...e,t]);const n={};n[t]=r,j(e=>({...e,...n}))}else O(-1),z(t)}).catch(e=>{console.log(e),O(-1),z(t)})})},...w||{}}),D=J(dr),{user:Y}=J(sr),I=s();f(I.breakpoints.only("xs"));const[M,O]=Z(-1),[V,A]=Z([]),[T,R]=Z([]),[F,j]=Z({}),[$,P]=Z(""),z=(e,r,t)=>{A(V.filter(r=>r.id!==e)),t&&D.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==t)),r||(P("Erro ao enviar arquivo. Verifique o formato e tente mais tarde."),setTimeout(()=>{P("")},3e3))};return ee(()=>{if(m){const e=V.filter(e=>void 0!==F[e.id]).map(e=>({CO_SEQ_ARQUIVO:F[e.id],CO_TIPO_ARQUIVO:parseInt(a)}));D?.formSetValue(t,e)}else{const e=new DataTransfer;V.forEach(r=>{e.items.add(r.file)}),D?.formSetValue(t,e.files)}},[V,D,t,F,m,a]),ee(()=>()=>{D.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(a)))},[]),r(n,{item:!0,xs:y,sm:b,md:x,sx:{width:"100%",opacity:k?.5:1,pointerEvents:k?"none":"auto"},children:e(i,{bgcolor:"white",p:2,borderRadius:"8px",color:"#1E293B",children:[r(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(uo,{...E({className:"dropzone"}),bgcolor:"#EFEFEF",justifyContent:"center",alignItems:"center",textAlign:"center",borderRadius:"6px",py:8,border:"solid 1.5px #989898",sx:{borderStyle:"dashed",cursor:"pointer"},children:[r("input",{...S(),...D.formRegister(t,{validate:(e,r)=>{if(d&&(null==e||Array.isArray(e)&&0===e.length))return"O campo de arquivo é obrigatório"}})}),e(uo,{spacing:2,alignItems:"center",children:[e(i,{children:[r(o,{fontWeight:600,fontSize:18,children:"Arraste seus arquivos até aqui"}),r(o,{children:"ou selecione arquivos que estão no seu computador"})]}),r(l,{variant:"contained",sx:{backgroundColor:"#64748B",pointerEvents:"none",borderRadius:"8px",width:"fit-content"},disabled:k,children:"Selecionar"}),e(o,{fontWeight:300,children:["Tamanho máximo por arquivo ",g,"MB"]})]})]}),e(o,{pt:2,fontSize:16,fontWeight:600,children:["Você selecionou ",V.length," arquivo",V.length>1?"s":"","."]}),e(uo,{width:"100%",marginTop:1,spacing:1,children:[V.map(t=>e(uo,{direction:"row",justifyContent:"space-between",border:"solid 1px #E2E8F0",borderRadius:2,p:1,children:[e(uo,{direction:"row",children:[r(uo,{direction:"row",justifyContent:"center",alignItems:"center",minWidth:30,pr:1.5,children:r(po,{sx:{filter:"invert(42%) sepia(86%) saturate(2412%) hue-rotate(326deg) brightness(86%) contrast(102%)",transform:"scale(1.5)",width:30}})}),e(uo,{children:[r(o,{fontWeight:600,children:t.name}),r(o,{fontSize:14,children:fo(t.size)})]})]}),r(l,{size:"small",startIcon:r(mo,{}),variant:"contained",onClick:e=>{return r=t.id,void(Object.keys(F).includes(r.toString())&&fetch(`${m}/${F[r]}`,{method:"DELETE",headers:{Authorization:`Bearer ${""===C?Y?Y.token:"":C}`}}).then(e=>{e.ok||z(r,!0,F[r]),200===e.status&&z(r,!0,F[r])}).catch(e=>console.log(e)));var r},sx:{height:40,backgroundColor:"#DE3F50",borderRadius:"8px"},disabled:k,children:"Remover"})]})),M>0&&M<100&&r(h,{value:M,sx:{backgroundColor:"#103D6A",".MuiLinearProgress-bar":{backgroundColor:"#BDDDFA"}}})]}),$&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"16px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:$})]}),ne(D?.errors,t)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:"O campo de arquivo é obrigatório"})]})]})})}function go({name:t,tipoArquivo:a,title:c,required:d=!1,multiple:p=!1,apiURL:m,route:h="",sizeLimit:x=4,xs:v=12,sm:C,md:w}){const k=J(dr),{user:E}=J(sr),S=s(),D=f(S.breakpoints.only("xs")),[Y,I]=Z([]),[M,O]=Z([]),[V,A]=Z({}),[T,R]=Z(""),F=Q(e=>{const r=e.target.files,t=Object.keys(r).map(e=>r[e]);I([...Y,...t.filter(e=>!(e.size/1048576>x&&(R(`Por favor, escolha um arquivo com tamanho inferior a ${x} MB`),setTimeout(()=>{R("")},3e3),1))).map((e,r)=>{let t=Date.now()+r;const n=new FormData;return n.append("files",e),n.append("tipoArquivo",a),fetch(m,{method:"POST",body:n,headers:{Authorization:`Bearer ${E?E.token:""}`}}).then(e=>{e.ok?e.json().then(e=>{if(e.status&&200===e.status.status){const r=ne(e,h,e)[0].coSeqArquivo;k.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:r,CO_TIPO_ARQUIVO:parseInt(a)}]),O(e=>[...e,t]);const n={};n[t]=r,A(e=>({...e,...n}))}else j(t)}):j(t)}).catch(e=>{j(t)}),{id:t,name:e.name,loading:!0,error:!1,file:e}})])},[Y,k]),j=(e,r,t)=>{I(Y.filter(r=>r.id!==e)),t&&k.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==t)),r||(R("Erro ao enviar arquivo. Tente novamente mais tarde"),setTimeout(()=>{R("")},3e3))};return ee(()=>{const e=new DataTransfer;Y.forEach(r=>{e.items.add(r.file)}),k?.formSetValue(t,e.files)},[Y,k,t]),ee(()=>()=>{k.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(a)))},[]),e(n,{item:!0,xs:v,sm:C,md:w,sx:{width:"100%"},children:[r(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(i,{sx:{backgroundColor:"#e2eafc",padding:1,borderRadius:1,marginTop:1},children:[r("input",{id:t,type:"file",multiple:p,...k?.formRegister(t,{validate:(e,r)=>{if((e.length&&M.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:F,accept:".pdf",style:{display:"none"}}),r("input",{id:t+"foto",type:"file",capture:"environment",multiple:p,...k?.formRegister(t,{validate:(e,r)=>{if((e.length&&M.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:F,accept:".jpg, .png, .jpeg",style:{display:"none"}}),e(i,{sx:{display:{sx:"block",md:"flex"}},children:[r(i,{sx:{width:"100%",marginRight:{xs:0,md:1},marginBottom:{xs:1,md:0}},children:!p&&Y.length>=1?r(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:r(ve,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"}):r("label",{htmlFor:t,children:r(l,{variant:"contained",disableElevation:!0,startIcon:r(ve,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"})})}),r(i,{sx:{width:"100%"},children:!p&&Y.length>=1?r(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:r(ye,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:D?"Tirar Foto":"Escolher Imagem"}):r("label",{htmlFor:t+"foto",children:r(l,{variant:"contained",disableElevation:!0,startIcon:r(ye,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:D?"Tirar Foto":"Escolher Imagem"})})})]}),e(o,{fontWeight:600,paddingY:1,color:"black",children:["Você selecionou ",Y.length," arquivo",Y.length>1&&"s"]}),Y.length>0&&r(g,{component:y,children:r(uo,{direction:"column",children:Y.map(t=>e(uo,{direction:"row",justifyContent:"space-between",padding:.5,children:[r(i,{children:e(uo,{direction:"row",spacing:2,children:[M.includes(t.id)?r(xe,{sx:{fill:"#06d6a0"}}):r(b,{size:22,sx:{color:"black"}}),r(Ce,{color:"error"}),r(o,{fontWeight:600,children:t.name})]})}),r(i,{children:M.includes(t.id)&&r(l,{variant:"contained",size:"small",sx:{textTransform:"none",backgroundColor:"#d1495b","&:hover":{backgroundColor:"#c1121f"}},onClick:e=>{return r=t.id,void(Object.keys(V).includes(r.toString())&&fetch(`${m}/${V[r]}`,{method:"DELETE",headers:{Authorization:`Bearer ${E?.token}`}}).then(e=>{e.ok||j(r,!0,V[r]),200===e.status&&j(r,!0,V[r])}).catch(e=>console.log(e)));var r},startIcon:r(be,{}),children:"Remover"})})]},t.name))})}),T&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"16px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:T})]}),ne(k?.errors,t)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(o,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})]})]})}function yo({defaultChecked:t=!1,...n}){const i=J(dr);ee(()=>{i?.formSetValue(n.name,t)},[]);const l=re(()=>n.overrideYes||"Sim",[n.overrideYes]),s=re(()=>n.overrideNo||"Não",[n.overrideNo]);return e(a,{sx:{alignItems:"center",justifyContent:"center"},children:[n.title&&r(u,{children:n.title}),r(x,{control:r(v,{defaultChecked:t,...i?.formRegister(n.name)}),label:r(o,{width:25,sx:{userSelect:"none",fontWeight:600},children:i?.formWatch(n.name)?l:s}),sx:{paddingLeft:1}})]})}var bo=/*#__PURE__*/H.memo(yo);function xo({invert:e=!1,hasCheckValue:n=!1,...o}){const i=J(dr);return ee(()=>()=>{(n?e:i.formWatch(o.switchId)===e)&&o.unregisterNameList.forEach(e=>i.formUnregister(e))},[o.unregisterNameList]),r(t,{})}function vo({invert:n=!1,checkValue:o,...i}){const a=J(dr);return r(t,{children:(o?a?.formWatch(i.switchId)===o!==n:a?.formWatch(i.switchId)!==n)&&e(t,{children:[r(xo,{switchId:i.switchId,unregisterNameList:i.unregisterNameList,hasCheckValue:!!o,invert:o?a?.formWatch(i.switchId)===o!==n:n}),i.children]})})}const Co=/*#__PURE__*/H.forwardRef(function(e,t){const{onChange:n,onMask:o,maskValue:i,setMaskValue:a,watchValue:l,imaskConfig:s,...c}=e,[d,u]=Z(s.mask);delete c.value;const p=te(null),[m,f]=Z(""),h=J(dr);return ee(()=>{l&&f(l)},[l]),ee(()=>{h.formSetValue(c.name,p.current.element.value)},[m]),delete c.watchValue,r(ke,{...c,mask:d,value:m,ref:p,inputRef:t,onChange:e=>{},onAccept:(e,r)=>{f(e),r.updateValue(),o&&o(e,u)},...s})});function wo(e){const n=J(dr),[o,i]=Z("");return r(t,{children:r(p,{...e.formConfig,onInput:r=>{n.formSetValue(e.formConfig.name,r.target.value)},InputProps:{inputComponent:Co,inputProps:{onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue,imaskConfig:e.imaskConfig}},disabled:e.disabled,fullWidth:!0})})}function ko({type:t="input",numberMask:o="000000000000000",xs:a=12,sm:l,inputMinLength:s=1,inputMaxLength:c=255,defaultValue:d="",md:m,disabled:f=!1,watchValue:h,...g}){const y=J(dr);return ee(()=>{void 0!==h&&y.formSetValue(g.name,h)},[h]),e(n,{item:!0,xs:a,sm:l,md:m,children:[g.title&&r(u,{htmlFor:"campo",required:g.required,sx:{mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:g.title}),(()=>{const n={fullWidth:!0,size:"small",placeholder:g.customPlaceholder?g.customPlaceholder:g.title},a=g.name,l=ne(y?.errors,g.name);let u=l?.message;const m=!!l;m&&(u=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),u]}));const b={...y?.formRegister(a,{validate:(e,r)=>{const n=e??"";if(n.length<=0&&g.required)return"Este campo é obrigatório";if(g.customValidate){const e=g.customValidate(n,r);if(e)return e}if("cnpj"===t){if(n.length<18&&g.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===t){if(n.length<14&&g.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===t){if(n.length<22&&g.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===t){if(n.length<9&&g.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===t||"password"===t||"number"===t){if(n.length>c)return`Limite máximo de ${c} caracteres`;if(n.length<s&&g.required)return`Limite mínimo de ${s} caracteres`}else if("email"===t){if(n.length>50)return"Limite máximo de 50 caracteres";if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(e)&&g.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===t){if((n.length<14||n.length>14&&n.length<18)&&g.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===t&&n.length<14&&g.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:m,helperText:u,...n,FormHelperTextProps:{sx:{backgroundColor:m?"#FFEBEE":"transparent",borderRadius:"8px",padding:m?"8px 12px":0,marginBottom:m?"4px":0,marginTop:m?"8px":0,border:m?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}},sx:{backgroundColor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}}};switch(t){case"input":case"email":return r(p,{...b,defaultValue:d,disabled:f});case"password":return r(p,{...b,type:"password",disabled:f});case"number":return r(wo,{formConfig:b,defaultValue:d,imaskConfig:{mask:o},watchValue:h,disabled:f});case"cep":return r(wo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00000-000"},watchValue:h,disabled:f});case"phone":return r(wo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"(00) [9]0000-0000"},watchValue:h,disabled:f});case"sei":return r(wo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00000-00000000/0000-00"},watchValue:h,disabled:f});case"cpf_cnpj":return r(wo,{formConfig:b,defaultValue:d,imaskConfig:{mask:[{mask:"000.000.000-00"},{mask:"00.000.000/0000-00"}],dispatch:(e,r)=>(r.value+e).replace(/\D/g,"").length>11?r.compiledMasks[1]:r.compiledMasks[0]},watchValue:h,disabled:f});case"cpf":return r(wo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"000.000.000-00"},watchValue:h,disabled:f});case"cnpj":return r(wo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00.000.000/0000-00"},watchValue:h,disabled:f});case"rg":return r(wo,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00000[000000]"},watchValue:h,disabled:f})}})()]})}var Eo=/*#__PURE__*/H.memo(ko);function So({name:t,required:o=!1,title:i,defaultChecked:l=!1,xs:s=12,unregisterNameList:c,sm:d,md:u,...p}){const m=`${t}-switch`;return e(n,{item:!0,xs:s,sm:d,md:u,children:[i&&r(we,{required:o,sx:{textTransform:"capitalize"},children:i}),e(a,{direction:"row",children:[r(bo,{name:m,defaultChecked:l}),r(vo,{switchId:m,unregisterNameList:c,children:r(ko,{name:"ddd",type:"input"})})]})]})}function Do({name:t,required:o=!1,title:i,customPlaceholder:a,url:l,xs:s=12,sm:c,md:d,dataPath:u=""}){const m=J(dr),{user:f}=J(sr),[h,g]=Z([]);Ee(`autocomplete-${t}`,()=>fetch(l,{headers:{Authorization:`Bearer ${f?f.token:""}`}}).then(e=>e.json().then(e=>g(y(e)))));const y=Q(e=>Array.isArray(e)?e:"object"==typeof e?ne(e,u):void 0,[]),b=Q((e,r)=>{m?.formSetValue(t,r?r.id:""),m?.formTrigger(t)},[m,t]);return e(n,{item:!0,xs:s,sm:c,md:d,children:[i&&r(we,{required:o,children:i}),r("input",{type:"text",...m?.formRegister(t,{validate:(e,r)=>{if(e.length<=0&&o)return"Este campo é obrigatório"}}),hidden:!0}),r(C,{options:h,isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:b,renderInput:e=>r(p,{...e,placeholder:a,size:"small",error:!!ne(m?.errors,t),helperText:ne(m?.errors,t)?.message})})]})}let Yo=!0;function Io({name:t,url:o,title:a,customLoadingText:l,shouldRefetch:s=!0,required:c=!1,defaultValue:d,route:m="",onChange:f=()=>{},xs:h=12,sm:g,watchValue:y,md:b,disabled:x=!1}){const v=J(dr),[w,k]=Z(!0),[E,S]=Z([]),[D,Y]=Z("Carregando..."),[I,M]=Z(null),[O,V]=Z(null),[A,T]=Z(null),{user:R}=J(sr),F=function(e,r,n=!1){try{return Promise.resolve(function(o,i){try{var a=(T(null),Promise.resolve(fetch(e,{method:"GET",headers:{Authorization:`Bearer ${R?.token}`}})).then(function(e){if(!e.ok){const r=401===e.status?"Sessão expirada. Faça login novamente.":403===e.status?"Acesso negado. Verifique suas permissões.":e.status>=500?"Erro interno do servidor. Tente novamente mais tarde.":"Erro ao carregar dados";return T(r),Y(r),void k(!1)}return Promise.resolve(e.json()).then(function(e){const o=ne(e,r,e);if(n){const e=o.filter(e=>e.id===d);e.length>0?(S(o),k(!1),v.formSetValue(t,d),M(e[0])):(T("Valor padrão inválido"),Y("Erro ao carregar dados. Valor inválido"),k(!1))}else S(o),k(!1)})}))}catch(e){return i(e)}return a&&a.then?a.then(void 0,i):a}(0,function(e){console.error("Network error:",e),T("Erro de conexão. Verifique sua internet e tente novamente."),Y("Erro de conexão. Verifique sua internet e tente novamente."),k(!1)}))}catch(e){return Promise.reject(e)}};function j(){(d||!s)&&E.length>0||(k(!0),S([]),l&&Y(l),F(o,m,!1))}return ee(()=>{d&&F(o,m,!0)},[]),ee(()=>{y&&Yo&&(V(y),v.formSetValue(t,y.id),f(y.id))},[y]),d&&E.length<=0&&!I?r(n,{item:!0,xs:h,sm:g,md:b,children:r(p,{size:"small",fullWidth:!0,placeholder:D,disabled:!0})}):e(n,{item:!0,xs:h,sm:g,md:b,children:[a&&r(u,{required:c,children:a}),r("input",{type:"text",...v?.formRegister(t,{validate:(e,r)=>e?e.length<=0&&c?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),r(C,{value:O,loading:w,loadingText:D,options:E,defaultValue:I,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:(e,r)=>function(e){if(Yo=!1,e)return V(e),v.formSetValue(t,e.id),void f(e.id);V(null),v.formSetValue(t,""),f(void 0)}(r),renderInput:n=>{const o=ne(v?.errors,t),l=!!o||!!A;let s=o?.message||A;return l&&(s=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),s]})),r(p,{...n,size:"small",fullWidth:!0,placeholder:a,onFocus:j,error:l,helperText:s,FormHelperTextProps:{sx:{backgroundColor:l?"#FFEBEE":"transparent",borderRadius:"8px",padding:l?"8px 12px":0,marginBottom:l?"4px":0,marginTop:l?"8px":0,border:l?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}}})},sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}},size:"small",fullWidth:!0,disabled:x})]})}let Mo=!0;function Oo({name:t,title:o,required:a=!1,list:l,defaultValue:s,onChange:c=()=>{},xs:d=12,sm:m,watchValue:f,forceUpdate:h=!1,md:g}){const y=J(dr),[b,x]=Z(null);return ee(()=>{s&&y?.formSetValue(t,s.id)},[]),ee(()=>{f&&(Mo||h)?(x(f),y.formSetValue(t,f.id),c(f.id)):void 0===f&&(Mo||h)&&(x(null),y.formSetValue(t,void 0),c(void 0))},[f]),e(n,{item:!0,xs:d,sm:m,md:g,children:[o&&r(u,{required:a,children:o}),r("input",{type:"text",...y?.formRegister(t,{validate:(e,r)=>e?e?.length<=0&&a?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),r(C,{value:b,options:l,defaultValue:s,getOptionLabel:e=>e.label?e.label.toString():"Não Encontrado",isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:(e,r)=>function(e){if(Mo=!1,e)return x(e),y.formSetValue(t,e.id),void c(e.id);x(null),y.formSetValue(t,""),c(void 0)}(r),renderInput:n=>{const a=ne(y?.errors,t),l=!!a;let s=a?.message;return l&&(s=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),s]})),r(p,{...n,size:"small",fullWidth:!0,placeholder:o,error:l,helperText:s,FormHelperTextProps:{sx:{backgroundColor:l?"#FFEBEE":"transparent",borderRadius:"8px",padding:l?"8px 12px":0,marginBottom:l?"4px":0,marginTop:l?"8px":0,border:l?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}}})},size:"small",sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}},fullWidth:!0})]})}let Vo=!0;function Ao({name:t,url:o,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:m=()=>{},xs:f=12,sm:h,watchValue:g,md:y,disabled:b=!1}){const x=de(),[v,w]=Z(!0),[k,E]=Z([]),[S,D]=Z("Carregando..."),[Y,I]=Z(null),[M,O]=Z(null),{user:V}=J(sr);function A(){(c||!l)&&k.length>0||(w(!0),E([]),a&&D(a),fetch(o,{method:"GET",headers:{Authorization:`Bearer ${V?.token}`}}).then(e=>{e.ok?e.json().then(e=>{E(ne(e,d,e)),w(!1)}):D("Erro ao carregar dados")}))}return ee(()=>{c&&fetch(o,{method:"GET",headers:{Authorization:`Bearer ${V?.token}`}}).then(e=>{e.ok?(console.log("llll"),e.json().then(e=>{let r=ne(e,d,e).filter(e=>e.id===c);r.length>0?(E(ne(e,d,e)),w(!1),x.setValue(t,c),I(r[0])):D("Erro ao carregar dados. Valor inválido")})):D("Erro ao carregar dados")})},[]),ee(()=>{g&&Vo&&(O(g),x.setValue(t,g.id),m(g.id))},[g]),c&&k.length<=0&&!Y?r(n,{item:!0,xs:f,sm:h,md:y,children:r(p,{size:"small",fullWidth:!0,placeholder:S,disabled:!0})}):e(n,{item:!0,xs:f,sm:h,md:y,children:[i&&r(u,{required:s,children:i}),r("input",{type:"text",...x?.register(t,{validate:(e,r)=>{if(e.length<=0&&s)return"Este campo é obrigatório"}}),hidden:!0}),r(C,{value:M,loading:v,loadingText:S,options:k,defaultValue:Y,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:(e,r)=>function(e){if(Vo=!1,e)return O(e),x.setValue(t,e.id),void m(e.id);O(null),x.setValue(t,""),m(void 0)}(r),renderInput:e=>r(p,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:A,error:!!ne(x.formState.errors,t),helperText:ne(x.formState.errors,t)?.message}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}const To=/*#__PURE__*/H.forwardRef(function(e,t){const{onChange:n,maskProps:o,onMask:i,maskValue:a,setMaskValue:l,watchValue:s,...c}=e,[d,u]=Z(o.mask);delete c.value;const p=te(null),[m,f]=Z(""),h=de();return ee(()=>{s&&f(s)},[s]),ee(()=>{h.setValue(c.name,p.current.element.value)},[m]),delete c.watchValue,r(ke,{...c,...o,mask:d,value:m,ref:p,inputRef:t,onChange:e=>{},onAccept:(e,r)=>{f(e),r.updateValue(),i&&i(e,u)}})});function Ro(e){const n=J(dr),[o,i]=Z("");return r(t,{children:r(p,{...e.formConfig,onInput:r=>{n.formSetValue(e.formConfig.name,r.target.value)},InputProps:{inputComponent:To,inputProps:{maskProps:e.maskProps,onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue}},disabled:e.disabled,fullWidth:!0})})}function Fo({type:t="input",numberMask:o="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:m=!1,watchValue:f,...h}){const g=de();return ee(()=>{void 0!==f&&g.setValue(h.name,f)},[f]),e(n,{item:!0,xs:i,sm:a,md:d,children:[h.title&&r(u,{htmlFor:"campo",required:h.required,sx:{mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},n=h.name,i=ne(g?.formState.errors,h.name),a=i?.message,d=!!i,u={...g?.register(n,{validate:(e,r)=>{const n=e??"";if(n.length<=0&&h.required)return"Este campo é obrigatório";if("cnpj"===t){if(n.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===t){if(n.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===t){if(n.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===t){if(n.length<9&&h.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===t||"password"===t||"number"===t){if(n.length>s)return`Limite máximo de ${s} caracteres`;if(n.length<l&&h.required)return`Limite mínimo de ${l} caracteres`}else if("email"===t){if(n.length>50)return"Limite máximo de 50 caracteres";if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(e)&&h.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===t){if((n.length<14||n.length>14&&n.length<18)&&h.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===t&&n.length<14&&h.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:d,helperText:a,...e,sx:{backgroundColor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"1px"}}}};switch(t){case"input":case"email":return r(p,{...u,defaultValue:c,disabled:m});case"password":return r(p,{...u,type:"password",disabled:m});case"number":return r(Ro,{formConfig:u,defaultValue:c,maskProps:{mask:o},watchValue:f,disabled:m});case"cep":return r(Ro,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-000"},watchValue:f,disabled:m});case"phone":return r(Ro,{formConfig:u,defaultValue:c,maskProps:{mask:"(00) [#]0000-0000",definitions:{"#":/^9$/}},watchValue:f,disabled:m});case"sei":return r(Ro,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:m});case"cpf_cnpj":return r(Ro,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00[0]"},onMask:(e,r)=>{r(e.length>14?"00.000.000/0000-00":"000.000.000-00[0]")},watchValue:f,disabled:m});case"cpf":return r(Ro,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00"},watchValue:f,disabled:m});case"cnpj":return r(Ro,{formConfig:u,defaultValue:c,maskProps:{mask:"00.000.000/0000-00"},watchValue:f,disabled:m});case"rg":return r(Ro,{formConfig:u,defaultValue:c,maskProps:{mask:"00000[000000]"},watchValue:f,disabled:m})}})()]})}var jo=/*#__PURE__*/H.memo(Fo);function $o({name:t,required:o=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:m=255,md:f,...h}){const g=de();return ee(()=>{g.setValue(t,d)},[d]),e(n,{item:!0,xs:s,sm:c,md:f,children:[i&&r(we,{required:o,sx:{textTransform:"capitalize",mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:i}),r(p,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.register(t,{validate:(e,r)=>o&&e.length<=0?"Este campo é obrigatório":e.length>m?`Limite máximo de ${m} caracteres`:e.length<u&&o?`Limite mínimo de ${u} caracteres`:void 0}),error:!!ne(g.formState.errors,t),helperText:ne(g.formState.errors,t)?.message,sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"1px"}}},placeholder:a||i})]})}function Po({name:t,required:o=!1,title:a,customPlaceholder:l,defaultValue:s="",xs:c=12,sm:d,watchValue:u="",inputMinLength:m=3,inputMaxLength:f=255,md:h,...g}){const y=J(dr);ee(()=>{y.formSetValue(t,u)},[u]);const b=ne(y.errors,t);let x=b?.message;const v=!!b;return v&&(x=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),x]})),e(n,{item:!0,xs:c,sm:d,md:h,children:[a&&r(we,{required:o,sx:{textTransform:"capitalize",mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:a}),r(p,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:s,...y.formRegister(t,{validate:(e,r)=>o&&e.length<=0?"Este campo é obrigatório":e.length>f?`Limite máximo de ${f} caracteres`:e.length<m&&o?`Limite mínimo de ${m} caracteres`:void 0}),error:v,helperText:x,FormHelperTextProps:{sx:{backgroundColor:v?"#FFEBEE":"transparent",borderRadius:"8px",padding:v?"8px 12px":0,marginBottom:v?"4px":0,marginTop:v?"8px":0,border:v?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}},sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}},placeholder:l||a})]})}function No({name:t,required:a=!1,xs:l=12,sm:d,md:u}){const m=J(dr),f=`switch-${t}`;ee(()=>{m.formWatch(f)||m.formSetValue(t,void 0)},[m]);const h=s(),g=m.formWatch(f);return r(n,{item:!0,xs:l,sm:d,md:u,children:e(i,{onClick:()=>{m.formSetValue(f,!g)},sx:{border:"1px solid",borderColor:g?h.palette.primary.main:"#E0E0E0",borderRadius:"8px",padding:"8px 16px",cursor:"pointer",backgroundColor:g?`${h.palette.primary.main}10`:"white",transition:"all 0.2s",display:"flex",alignItems:"center",mb:.5,"&:hover":{borderColor:g?void 0:h.palette.grey[400],backgroundColor:g?void 0:h.palette.grey[50]}},children:[r(c,{checked:!!g,size:"small",sx:{padding:0,mr:1.5,"&.Mui-checked":{color:h.palette.primary.main}}}),r(i,{sx:{flexGrow:1},onClick:e=>e.stopPropagation(),children:g?r(p,{size:"small",fullWidth:!0,...m.formRegister(t,{validate:(e,r)=>{if(!0===m.formWatch(f)&&(!e||e.length<=0&&a))return"Este campo não pode ser vazio"}}),required:a,error:!!ne(m.errors,t),helperText:ne(m.errors,t)?.message,placeholder:"Outro",sx:{"& .MuiOutlinedInput-root":{backgroundColor:"white"}}}):r(o,{color:"text.primary",children:"Outro"})})]})})}const zo=(e,r)=>{if(!e||Object.keys(e).length<=0)return[];if(!e[r])return[];let t=Object.keys(e[r]).map(e=>`${r}.${e}`);return e.files&&(t=[...t,...Object.keys(e.files).map(e=>`files.${e}`)]),t};function Bo({debugLog:t=!1,test:n=!1,testConfig:o={},customMarginBottom:c=10,...d}){d.children=Array.isArray(d.children)?d.children.filter((e,r)=>e):d.children;const u=Array.isArray(d.children)?d.children.length:1,p=J(dr),m=te(null),h=s(),[g,y]=Z(0),b=(Array.isArray(d.children)?d.children:[d.children]).map((e,r)=>/*#__PURE__*/H.cloneElement(e,{...e.props,prefix:r})),x=u;return e(i,{children:[n&&r(a,{direction:"row",justifyContent:"end",children:r(l,{variant:"contained",color:"error",onClick:()=>{Object.keys(o).forEach((e,r)=>{const t=o[Number(e)];Object.keys(t).forEach(r=>{p.formUnregister(`${e}.${r}`),p.formSetValue(`${e}.${r}`,t[r])}),r<Object.keys(o).length-1&&new Promise(e=>setTimeout(e,100)).then(()=>{m.current?.click()})})},children:"EXCLUIR BANCO PRODUÇÃO"})}),e(a,{sx:{padding:2,marginBottom:c},children:[r(i,{children:b.map((e,t)=>r(i,{hidden:!(g===t),children:b[t]},"formsB"+t))}),r(w,{variant:"text",steps:x,position:f(h.breakpoints.only("xs"))?"bottom":"static",activeStep:g,sx:{paddingTop:2,paddingBottom:4,paddingX:0},backButton:r(l,{variant:"contained",startIcon:r(Se,{}),onClick:()=>{y(e=>e-1)},disabled:0===g,sx:{textTransform:"none"},children:"Voltar"}),nextButton:g<x-1?r(l,{variant:"contained",endIcon:r(De,{}),onClick:function(){try{return t&&console.log(p.formGetValues()),Promise.resolve(p.formTrigger(zo(p.formGetValues(),g))).then(function(e){e?y(e=>e+1):Me("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"})})}catch(e){return Promise.reject(e)}},sx:{textTransform:"none"},ref:m,children:"Próximo"}):r(i,{children:r(Ie,{variant:"contained",type:"submit",loading:p.submiting,loadingPosition:"start",startIcon:r(Ye,{}),onClick:e=>function(e){try{return Promise.resolve(p.formTrigger(zo(p.formGetValues(),g))).then(function(r){r||(e.preventDefault(),Me("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"}))})}catch(e){return Promise.reject(e)}}(e),sx:{textTransform:"none",backgroundColor:"#22C55E","&:hover":{backgroundColor:"#48cf7a"}},children:r("span",{children:"Salvar"})})})})]})]})}var Lo=/*#__PURE__*/H.memo(Bo);function Wo(e,r,t){if(!e.props)return e;const n=e.props.children;if(!n)/*#__PURE__*/return H.cloneElement(e,{...e.props,name:`${r}.${e.props.name}`,key:e.props.name?`${r}.${e.props.name}`:`noListing-${t}-${r}-${e.props.name}`});let o;if(Array.isArray(n)){let e=[];n.forEach((n,o)=>{e.push(Wo(n,r,t+(o+1)))}),o=e}else o=Wo(n,r,t+1);/*#__PURE__*/return H.cloneElement(e,{...e.props,children:o,name:`${r}.${e.props.name}`,key:e.props.name?`${r}.${e.props.name}`:`noListing-${t}-${r}-${e.props.name}`})}function _o({optional:o=!1,title:l,prefix:s=0,optionalMessage:c,defaultChecked:d,...u}){const p=J(dr),m=`switch-${s}`,f=(Array.isArray(u.children)?u.children:[u.children]).map((e,r)=>e&&Wo(e,s,r));return e(i,{children:[r(n,{item:!0,xs:12,children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",spacing:2,children:[r(i,{sx:{marginTop:.6},children:r(a,{sx:{backgroundColor:"#E6F8EB",borderRadius:"100%",height:"35px",width:"35px"},justifyContent:"center",alignItems:"center",children:r(Ve,{sx:{height:"18px",fill:"#01BA35"}})})}),r(Ae,{variant:"h6",fontWeight:600,fontSize:28,fontFamily:"Inter",sx:{color:"#1E293B",paddingBottom:4},children:l})]}),r(i,{hidden:!o,children:r(bo,{name:m,defaultChecked:!o||d,overrideNo:u.overrideSwitchNo,overrideYes:u.overrideSwitchYes})})]})}),r(a,{spacing:2,children:o?p.formWatch(m)?r(n,{container:!0,spacing:1,children:f}):r(a,{justifyContent:"center",alignItems:"center",children:r(Ae,{fontFamily:"Inter",fontSize:22,paddingY:8,textAlign:"center",children:c||e(t,{children:[r("b",{children:l})," é opcional. ",r("br",{}),"Marque a opção acima caso haja necessidade."]})})}):r(n,{container:!0,spacing:1,children:f})})]})}var qo=/*#__PURE__*/H.memo(_o);let Uo={open:()=>{},close:()=>{},openReparented:()=>{},reparent:()=>r(t,{})};function Ko(){const[n,l]=Z(!1),[c,d]=Z(null),u=()=>l(!1);te(null);const p=s(),m=f(p.breakpoints.up("sm")),[h,g]=Z({}),[y,b]=Z(-1321465654);return ee(()=>{Uo.open=e=>{e&&d(e),b(-1321465654),l(!0)},Uo.reparent=(e,n)=>(g(o=>({...o,[n]:r(t,{children:e})})),r(t,{})),Uo.openReparented=e=>{b(e),d(null),l(!0)},Uo.close=u},[l]),r(t,{children:m?r(E,{open:n,onClose:u,children:e(i,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",borderRadius:2,bgcolor:"white",border:"1px solid #454545",boxShadow:24},children:[r(i,{onClick:u,width:"fit-content",height:"fit-content",position:"absolute",right:0,top:0,margin:.6,sx:{":hover":{transform:"scale(1.03)",transition:"all 500ms",cursor:"pointer"}},children:r(Be,{sx:{transform:"scale(.9)"}})}),e(i,{overflow:"auto",maxHeight:"90vh",p:2,marginTop:4,borderTop:"solid 1px gray",bgcolor:"#F9F9F9",borderRadius:2,children:[c,h[y]]})]})}):e(k,{anchor:"bottom",open:n,onClose:u,onOpen:()=>{},PaperProps:{sx:{bgcolor:"transparent"}},children:[r(a,{direction:"row",onClick:u,maxHeight:"8vh",height:"8vh",justifyContent:"center",alignItems:"center",children:r(o,{fontWeight:600,color:"white",children:"Clique fora para fechar"})}),e(i,{p:2,maxHeight:"92vh",bgcolor:"white",overflow:"auto",children:[c,h[y]]})]})})}function Xo({customColor:e="#383838",customFontColor:t="white",...n}){const o=Le(e);return r(l,{...n,sx:{bgcolor:o.toHexString(),color:Le(t).toHexString(),":hover":{bgcolor:o.darken(10).toHexString()},boxShadow:"none",borderRadius:3,textTransform:"capitalize",paddingX:2},size:"small",children:n.children})}function Ho({data:n=[],...o}){const[i,a]=H.useState(null),l=Boolean(i),s=()=>{a(null)};return e(t,{children:[r(Xo,{...o.btProps,onClick:e=>{a(e.currentTarget)},children:o.children}),r(S,{id:"basic-menu",anchorEl:i,open:l,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:n.map(e=>r(D,{onClick:r=>{e.onClick&&e.onClick(),s()},children:e.name}))})]})}function Go(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function Jo(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}let Qo=[],Zo=!1,ei="",ri=!1,ti={},ni="";function oi({mediaQueryLG:n,columns:o,emptyMsg:c={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:d="",tableName:u="Dados",csv:p,columnSize:m,action:g,useKC:b=!0,statusKeyName:x="",csvExcludeKeys:v=[],csvExcludeKeysCSV:C=[],csvExcludeKeysAll:w=[],csvCustomKeyNames:k={},csvExcludeValidate:E=(e,r)=>!1,csvButtonTitle:S="Salvar .CSV",csvNoZipText:D="Salvar .CSV",csvAllButtonTitle:V="Salvar todos em CSV",removeQuotes:A=!1,normalize:T=!1,csvShowAllButton:R=!1,csvWithoutZip:F=!1,itemCount:j=10,csvUpper:$=!1,csvZipFileNamesKey:P="",generateCsvZip:N=!1,hideTitleCSV:U=!1,csvExcludeUpper:X=[],multipleDataPath:H="",expandTextMaxLength:G=50,collapsedSize:re=53,customMargin:oe=4,customMarginMobile:ie=0,filtersFunc:ae,filters:le=[],orderBy:ce=[],customErrorMsg:de,customTableStyle:ue={},id:pe,initialData:me=null,isLoading:fe,alwaysExpanded:he=!1}){const[ge,ye]=Z(null),[be,xe]=Z(me),{user:ve,userLoaded:Ce}=J(sr),[we,ke]=Z([]),[Ee,Se]=Z([]),[De,Ye]=Z(j),[Ie,Me]=Z(0),[Oe,Ve]=Z(1),[Be,Le]=Z(1);Z("");const[We,_e]=Z({}),[qe,Ue]=Z({}),[Ke,Xe]=Z({}),[He,Ge]=Z("filterKey"),Je=s(),Qe=f(Je.breakpoints.only("xs")),Ze=te(null),er=f(Je.breakpoints.up(2e3));ei=`tableFilter_${pe}`,ni=`tableFilterCache_${pe}`,ti=ae??{},localStorage.getItem(ni)||localStorage.setItem(ni,JSON.stringify(le)),localStorage.getItem(ni)!==JSON.stringify(le)&&(localStorage.setItem(ni,JSON.stringify(le)),localStorage.removeItem(ei));const rr=Q(e=>{if(e.length<=0)return 1;let r=e.length/De;return r=r<1?1:r,Math.ceil(r)},[De]),tr=Q(e=>Array.isArray(e)?e:"object"==typeof e?ne(e,d):void 0,[]);ee(()=>{if(ge||!tr(be))return;const e=tr(be);ke(e),Se(e),Ve(rr(e)),localStorage.getItem(ei)&&dr(JSON.parse(localStorage.getItem(ei)))},[De,be,rr,ge]),ee(()=>{Me(Be-1)},[Be]);const nr=Q((e,r)=>{Le(r)},[]),or=Q(()=>{const e=Ie*De;return we.slice(e,e+De)},[we,De,Ie]),ir=Q((e,r=!1)=>{if(e.preventDefault(),we.length<=0)return;const t=Object.keys(we[0]);if(N&&r){const e=t.filter(e=>!v.includes(e)),r=e.map(e=>k[e]?k[e]:e).join(",")+"\n",o=new ze,i={};we.forEach(e=>{i[e[P]]||(i[e[P]]=[]),i[e[P]].push(e)}),Object.keys(i).forEach(n=>{const a=[];i[n].forEach(r=>{let n=!0;if(t.forEach(e=>{E(e,r[e])&&(n=!1)}),n){const t=e.map(e=>{if("string"==typeof r[e]){let t=$?r[e].toUpperCase():r[e];return t=T?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t,A?`${t}`:`"${t}"`}if("object"==typeof r[e]&&!Array.isArray(r[e])&&null!==r[e]){let t=ar(r[e]).slice(1,-1),n=$&&!X.includes(e)?t.toUpperCase():t;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return r[e]}).join(",");a.push(t)}});const l=U?a.join("\n"):"\ufeff"+r+a.join("\n");a.length>0&&o.file(`${n.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}.csv`,l)});var n=window.document.createElement("a");o.generateAsync({type:"base64"}).then(e=>{n.setAttribute("href","data:application/zip;base64,"+e),n.setAttribute("download",`${p?.fileName}.zip`),n.click()})}else{let e=t.filter(e=>!C.includes(e)).map(e=>e===H?"hrTermino":e);""!==H&&(e=["dtInicio","hrInicio",...e]);const r=e.map(e=>k[e]?k[e]:e).join(",")+"\n",o=[];we.forEach(r=>{let n=!0;if(t.forEach(e=>{E(e,r[e])&&(n=!1)}),n){const t=e.map(e=>{if("dtInicio"===e)return"{dtInicio}";if("hrInicio"===e)return"{hrInicio}";if("hrTermino"===e)return"{hrTermino}";if("string"==typeof r[e]){let t=$&&!X.includes(e)?r[e].toUpperCase():r[e];return t=T?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t,A?`${t}`:`"${t}"`}if("object"==typeof r[e]&&!Array.isArray(r[e])&&null!==r[e]){let t=ar(r[e]).slice(1,-1),n=$&&!X.includes(e)?t.toUpperCase():t;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return r[e]}).join(",");if(""!==H){const e=r[H];e&&e.forEach(e=>{o.push(t.replace("{dtInicio}",e.dtInicio).replace("{hrInicio}",e.hrInicio).replace("{hrTermino}",e.hrTermino))})}else o.push(t)}});const i=r+o.join("\n");(n=window.document.createElement("a")).setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(i)),n.setAttribute("download",`${p?.fileName}.csv`),n.click()}},[we]);function ar(e){let r=[];if("object"==typeof e&&!Array.isArray(e)&&null!==e)for(let[t,n]of Object.entries(e))"object"!=typeof n||Array.isArray(n)||null===n?n&&r.push(t):r.push(t+": "+ar(n));return"["+r.join(" - ")+"]"}const lr=Q(e=>{if(e.preventDefault(),we.length<=0)return;const r=Object.keys(we[0]).filter(e=>!w.includes(e)),t=r.join(",")+"\n",n=we.map(e=>r.map(r=>{if("tbRa"===r)return e[r].NO_CIDADE;if("rlEventoData"===r)return`${e[r][0].DT_INICIO} - ${e[r][0].HR_INICIO}`;if("string"==typeof e[r]){let t=$&&!X.includes(r)?e[r].toUpperCase():e[r];return t=T?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t,A?`${t}`:`"${t}"`}if("object"==typeof e[r]&&!Array.isArray(e[r])&&null!==e[r]){let t=ar(e[r]).slice(1,-1),n=$&&!X.includes(r)?t.toUpperCase():t;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return e[r]}).join(",")).join("\n"),o=t+n;var i=window.document.createElement("a");i.setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(o)),i.setAttribute("download",`${p?.fileName}.csv`),i.click()},[we]);function cr(){ke(Qo),Se(Qo),Ve(rr(Qo)),Me(0),Le(1),localStorage.removeItem(ei),Ge((new Date).getTime().toString())}function dr(e){if(!Qo)return;let r=JSON.parse(JSON.stringify(Qo));e.filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).forEach(e=>{let t=[];switch(e.type){case"number":switch(e.operator){case"igual":r.forEach(r=>{Number(ne(r,e.keyName,""))===Number(e.value)&&t.push(r)});break;case"maior que":r.forEach(r=>{Number(ne(r,e.keyName,""))>Number(e.value)&&t.push(r)});break;case"menor que":r.forEach(r=>{Number(ne(r,e.keyName,""))<Number(e.value)&&t.push(r)})}break;case"string":switch(console.log("ata: ",e.operator),e.operator){case"igual":r.forEach(r=>{const n=ne(r,e.keyName,"");e.useList?Jo(n)===Jo(e.value.id)&&t.push(r):Jo(n)===Jo(e.value)&&t.push(r)});break;case"contem":r.forEach(r=>{const n=ne(r,e.keyName,"");n&&(e.useList?Jo(n).includes(Jo(e.value.id))&&t.push(r):Jo(n).includes(Jo(e.value))&&t.push(r))});break;case"tem um dos":r.forEach(r=>{const n=ne(r,e.keyName,"");n&&e.value.map(e=>Jo(e.id)).includes(Jo(n))&&t.push(r)})}break;case"date":switch(e.operator){case"data exata":r.forEach(r=>{const n=se(ne(r,e.keyName,""),"DD/MM/YYYY");n.isValid()&&n.isSame(se(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"entre":const n=se(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=se(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");r.forEach(r=>{const i=se(ne(r,e.keyName,""),"DD/MM/YYYY");(i.isAfter(n)||i.isSame(n))&&(i.isBefore(o)||i.isSame(o))&&t.push(r)})}break;case"dates":switch(e.operator){case"data inicio":r.forEach(r=>{const n=ti[e.customFunc](ne(r,e.keyName,""))??[];n.length<=0||se(n[0],"DD/MM/YYYY").isSame(se(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"data fim":r.forEach(r=>{const n=ti[e.customFunc](ne(r,e.keyName,""))??[];n.length<=0||se(n[n.length-1],"DD/MM/YYYY").isSame(se(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"tem a data":r.forEach(r=>{(ti[e.customFunc](ne(r,e.keyName,""))??[]).includes(e.value)&&t.push(r)});break;case"entre":const n=se(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=se(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");r.forEach(r=>{const i=ti[e.customFunc](ne(r,e.keyName,""))??[];let a=!1;i.forEach(e=>{if(a)return;const r=se(e,"DD/MM/YYYY");r.isValid()&&(r.isAfter(n)||r.isSame(n))&&(r.isBefore(o)||r.isSame(o))&&(a=!0)}),a&&t.push(r)})}}r=t}),ke(r),Ve(rr(r)),Me(0),Le(1),localStorage.setItem(ei,JSON.stringify(e)),Se(r)}return ee(()=>{const e=Ie*De,r=we.slice(e,e+De);let t={};r.forEach((e,r)=>{o.forEach(n=>{t[r]=!0===t[r]||(ne(e,n?.keyName,"")??"Não Informado").toString().length>=G})}),Ue(t)},[we,De,Ie]),ee(()=>{console.log(Ze.current)},[Ze.current]),ge?r(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(Ae,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===ge.status&&"Acesso negado",500===ge.status&&e(i,{fontWeight:500,textAlign:"center",children:[r(z,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),r(i,{children:de||e(t,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",r("br",{}),r("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",r("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})}):fe?r(a,{sx:{height:"100%",width:"100%"},justifyContent:"center",alignItems:"center",children:e(i,{width:"100%",children:[e(a,{direction:"row",justifyContent:"center",alignItems:"center",justifyItems:"center",spacing:2,marginY:4,children:[r(B,{sx:{fill:"#5e5e5e"}}),e(Ae,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",u]})]}),r(h,{color:"inherit"}),Array(10).fill("").map(t=>r(a,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:1},justifyContent:"space-between",paddingY:8,borderBottom:"1px solid #cacaca",children:Array(7).fill(0).map(t=>e(i,{children:[r(Y,{width:60}),r(Y,{width:120})]}))}))]})}):!Ce&&b?r(h,{}):e(t,{children:[e(i,{marginX:Qe?ie:oe,bgcolor:"white",p:2,borderRadius:6,...ue,children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},height:{md:"40px",xs:"inherit"},width:"100%",children:[r(Ne,{InputProps:{startAdornment:r(je,{sx:{marginRight:1,fill:"#c0c0c0"}}),sx:{".MuiOutlinedInput-notchedOutline":{border:"none"}}},sx:{border:"solid 1px #CBD5E1",backgroundColor:"#F8FAFC",borderRadius:"50px",maxWidth:"600px"},size:"small",onChange:function(e){console.log(Ee);const r=e.target.value;if(""===r)return ke(Ee),void Ve(rr(tr(we)));const t=tr(we),n=[];t.forEach(e=>{const t=[];if(Object.keys(e).map(r=>{let n=ne(e,r,"")??"";"number"==typeof n&&(n=n.toString()),"string"==typeof n&&t.push(n)}),t.length<=0)return;let o=!1;t.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(r.toLowerCase())&&(o=!0));case"C":return void("cancelado".includes(r.toLowerCase())&&(o=!0));case"A":return void("cadastrado".includes(r.toLowerCase())&&(o=!0));case"R":return void("reprovado".includes(r.toLowerCase())&&(o=!0));case"L":return void("licenciado".includes(r.toLowerCase())&&(o=!0));case"PA":return void(("pré aprovado".includes(r.toLowerCase())||"pre aprovado".includes(r.toLowerCase()))&&(o=!0));case"FP":return void("fora do prazo".includes(r.toLowerCase())&&(o=!0))}Go(e.toLowerCase()).includes(Go(r.toLowerCase()))&&(o=!0)}),o&&n.push(e)}),ke(n),Ve(rr(n)),Me(0),Le(1)},fullWidth:!0,placeholder:`Pesquisar ${u}`}),le.length>0&&r(l,{startIcon:r(L,{}),variant:"contained",onClick:e=>Uo.open(r(ii,{reset:cr,filtrar:dr,baseFilters:[...le],filters:localStorage.getItem(ei)?JSON.parse(localStorage.getItem(ei)):[...le]},He)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:r(a,{direction:"row",borderRadius:5,padding:0,children:r("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[r(Ho,{data:ce.map(e=>({name:e.label,onClick:()=>function(e){let r=[...we];r.sort((r,t)=>{const n="string"===e.type?ne(r,e.key,""):Number(ne(r,e.key,0)),o="string"===e.type?ne(t,e.key,""):Number(ne(t,e.key,0));if(ri){if(n<o)return-1;if(n>o)return 1}else{if(n>o)return-1;if(n<o)return 1}return 0}),ri=!ri,ke(r)}(e)})),btProps:{startIcon:r(W,{}),fullWidth:!0},children:"Ordenar"}),r(l,{variant:"contained",fullWidth:!0,startIcon:r(Zo?K:W,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let r=0;r<j;r++)e[r]=!Zo;Xe(e),_e(e),Zo=!Zo},children:Zo?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(Ae,{fontWeight:600,textAlign:"end",children:["Registro de ",u,"s"]}),r(a,{justifyContent:"center",children:e(Ae,{children:["Exibindo ",Ie*De+1,"-",Ie*De+1+or().length-1," de ",we.length]})})]})]}),localStorage.getItem(ei)&&r(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(ei)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(t=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[r(Ae,{fontWeight:700,children:t.label}),r(Ae,{fontStyle:"italic",children:t.operator}),r(Ae,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(t.value)?t.value.map(e=>e.label).join(" - "):"object"==typeof t.value?t.value.label:"entre"===t.operator?`${t.value?t.value:"Antes"} e ${t.value2?t.value2:"Depois"}`:t.value.toString()}),r(I,{onClick:e=>{let r=JSON.parse(localStorage.getItem(ei)??"[]");r=r.map(e=>e.label===t.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),dr(r)},size:"small",sx:{padding:0},children:r(Te,{sx:{fill:"white"}})})]}))}),r(a,{spacing:.2,children:or().length<=0?r(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:r(Ae,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:ve?c.user:c.public})}):or().map((s,c)=>r(y,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:he?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e($e,{container:!0,spacing:Qe?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e($e,{item:!0,xs:12,md:er?12/m*(o.size?o.size:1):n?n.all:12/m*(o.size?o.size:1),sx:{overflow:"hidden"},children:[r(i,{sx:{width:"max-content",paddingX:1},children:r(Ae,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:o.title})}),r(i,{paddingLeft:1,position:"relative",children:r(M,{in:he||!0===We[c],collapsedSize:he?"auto":re,onExited:e=>Xe(e=>({...e,[c]:!1})),children:r(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:o.customComponent?o.customComponent(ne(s,o.keyName),s):e(t,{children:[r(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:ne(s,o.keyName,"")}),r(i,{position:"absolute",top:0,children:he||Ke[c]?ne(s,o?.keyName,""):(ne(s,o?.keyName,"")??"").toString().length>=G?r(t,{children:(ne(s,o?.keyName,"")??"").toString().substring(0,G)+"..."}):ne(s,o?.keyName,"")})]})})})})]},String(o?.keyName)+c)),r($e,{item:!0,xs:12,md:er?12/m:n?n.action:12/m,children:r(a,{direction:"row",alignItems:"center",justifyContent:Qe?"start":"flex-end",sx:{height:"100%",paddingBottom:Qe?2:0},children:g(s)})}),qe[c]&&!he&&r(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:r(l,{onClick:e=>{_e(e=>({...e,[c]:!e[c]})),Xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:r(We[c]?_:q,{}),children:We[c]?"Ver Menos":"Ver Mais"})})]})},c))}),or().length>0&&r(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:p&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[F&&r(l,{startIcon:r(Re,{}),variant:"contained",size:"small",onClick:ir,sx:{backgroundColor:"#5a88b0",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:D}),R&&r(l,{startIcon:r(Re,{}),variant:"contained",size:"small",onClick:lr,sx:{backgroundColor:"#64748B",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:V}),r(l,{startIcon:r(Re,{}),variant:"contained",size:"small",onClick:e=>ir(e,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:S})]})})]}),r(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[r(l,{onClick:e=>Le(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Fe,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),r(Pe,{renderItem:e=>"page"===e.type?r(l,{onClick:e.onClick,sx:{fontWeight:600,...e.selected?{bgcolor:"#33B55D",color:"white"}:{color:"#1E293B"},borderRadius:"100%",padding:0,margin:0,minWidth:0,width:"40px",height:"40px",marginX:.25},children:e.page}):["next","previous","page"].includes(e.type)?void 0:r(O,{...e}),count:Oe,siblingCount:Qe?0:6,size:"large",onChange:nr,page:Be,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),r(l,{onClick:e=>Le(e=>e<Oe?e+1:Oe),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Fe,{sx:{transform:"scale(1.5)"}})})]})})]})}function ii({filters:t,baseFilters:n,filtrar:o,reset:s}){const[c,d]=Z(t),[u,p]=Z(!1),[m,f]=H.useState(null),h=Boolean(m);return e(i,{width:{xs:"inherit",md:850},children:[r(S,{open:h,onClose:()=>{f(null)},anchorEl:m,children:n.map(e=>r(D,{onClick:r=>{var t;t=e,d(e=>[...e,t]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[r(Ae,{fontWeight:700,fontSize:18,children:"Filtrar"}),r(l,{startIcon:r(U,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Uo.close()},children:"Limpar"})]}),r(i,{marginBottom:1,children:r(V,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),r(a,{children:u?c.map((e,t)=>r(ai,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let n=[...r];return n[t]=e,n})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}})):r(i,{children:c.map((e,t)=>r(ai,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let n=[...r];return n[t]=e,n})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}}))})}),r(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:r(l,{variant:"contained",color:"success",startIcon:r(je,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),Uo.close()},children:"Filtrar"})})]})}function ai({filterValue:t,setDt:n,idx:o}){const[i,l]=Z(t.operator),[c,d]=Z(t),u=s(),p=f(u.breakpoints.only("xs"));return ee(()=>{n(c)},[c]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:o%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!p&&r(Ae,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:t.label}),e(A,{sx:{width:"100%"},children:[p&&r(Ae,{children:t.label}),r(T,{onChange:e=>{const r=e.target.value;d(e=>({...e,operator:r,value:""})),l(r)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:t.operators.map(e=>r(D,{value:e,children:e}))})]}),r(li,{filterValue:t,operator:c.operator,onChange:(e,r="value")=>{d(t=>({...t,[r]:e}))}})]})}function li({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return r(Ne,{type:"number",size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"string":if(n.useList)switch(o){case"tem um dos":return r(C,{multiple:!0,id:"tags-standard",onChange:(e,r)=>{a(r.length<=0?"":r)},options:n.useList,defaultValue:Array.isArray(n.value)?n.value:[],renderInput:e=>r(Ne,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return r(i,{width:"100%",children:r(C,{options:n.useList,onChange:(e,r)=>{a(r)},defaultValue:"object"==typeof n.value?n.value:void 0,isOptionEqualToValue:(e,r)=>e.label===r.label,renderInput:e=>r(Ne,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return r(Ne,{size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"date":case"dates":switch(o){case"data exata":case"data fim":case"data inicio":case"tem a data":return r(oe,{adapterLocale:"pt-br",dateAdapter:le,children:r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?se(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})})});case"entre":return e(oe,{adapterLocale:"pt-br",dateAdapter:le,children:[r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?se(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})}),r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:n.value2?se(n.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})})]})}}return r(t,{})}var si=/*#__PURE__*/H.memo(oi);function ci({customErrorMsg:n,error:a}){return r(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(o,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===a.status&&"Acesso negado",500===a.status&&e(i,{fontWeight:500,textAlign:"center",children:[r(z,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),r(i,{children:n||e(t,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",r("br",{}),r("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",r("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})})}function di({tableName:t}){return r(a,{sx:{height:"100%",width:"100%"},justifyContent:"center",alignItems:"center",children:e(i,{width:"100%",children:[e(a,{direction:"row",justifyContent:"center",alignItems:"center",justifyItems:"center",spacing:2,marginY:4,children:[r(B,{sx:{fill:"#5e5e5e"}}),e(Ae,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",t]})]}),r(h,{color:"inherit"}),Array(10).fill("").map(t=>r(a,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:1},justifyContent:"space-between",paddingY:8,borderBottom:"1px solid #cacaca",children:Array(7).fill(0).map(t=>e(i,{children:[r(Y,{width:60}),r(Y,{width:120})]}))}))]})})}const ui=(e,r)=>{if(e.length<=0)return 1;let t=e.length/r;return t=t<1?1:t,Math.ceil(t)};function pi(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function mi(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function fi({filterData:e,startData:r,filtersFuncData:t={},localTableName:n="",setCurrentPage:o,setList:i,setListClone:a,setListPage:l,setPagCount:s,itemsCount:c}){if(!r)return;let d=JSON.parse(JSON.stringify(r));e.filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).forEach(e=>{let r=[];switch(e.type){case"number":switch(e.operator){case"igual":d.forEach(t=>{Number(ne(t,e.keyName,""))===Number(e.value)&&r.push(t)});break;case"maior que":d.forEach(t=>{Number(ne(t,e.keyName,""))>Number(e.value)&&r.push(t)});break;case"menor que":d.forEach(t=>{Number(ne(t,e.keyName,""))<Number(e.value)&&r.push(t)})}break;case"string":switch(e.operator){case"igual":d.forEach(t=>{const n=ne(t,e.keyName,"");e.useList?mi(n)===mi(e.value.id)&&r.push(t):mi(n)===mi(e.value)&&r.push(t)});break;case"contem":d.forEach(t=>{const n=ne(t,e.keyName,"");n&&(e.useList?mi(n).includes(mi(e.value.id))&&r.push(t):mi(n).includes(mi(e.value))&&r.push(t))});break;case"tem um dos":d.forEach(t=>{const n=ne(t,e.keyName,"");n&&e.value.map(e=>mi(e.id)).includes(mi(n))&&r.push(t)})}break;case"date":switch(e.operator){case"data exata":d.forEach(t=>{const n=se(ne(t,e.keyName,""),"DD/MM/YYYY");n.isValid()&&n.isSame(se(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"entre":const t=se(e.value?e.value:"01/01/2000","DD/MM/YYYY"),n=se(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(o=>{const i=se(ne(o,e.keyName,""),"DD/MM/YYYY");(i.isAfter(t)||i.isSame(t))&&(i.isBefore(n)||i.isSame(n))&&r.push(o)})}break;case"dates":switch(e.operator){case"data inicio":d.forEach(n=>{const o=(t[e.customFunc](ne(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.length<=0||se(o[0],"DD/MM/YYYY").isSame(se(e.value,"DD/MM/YYYY"))&&r.push(n)});break;case"data fim":d.forEach(n=>{const o=(t[e.customFunc](ne(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.length<=0||(console.log(o),se(o[o.length-1],"DD/MM/YYYY").isSame(se(e.value,"DD/MM/YYYY"))&&r.push(n))});break;case"tem a data":d.forEach(n=>{const o=(t[e.customFunc](ne(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.includes(e.value)&&r.push(n)});break;case"entre":const n=se(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=se(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(i=>{const a=(t[e.customFunc](ne(i,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);let l=!1;a.forEach(e=>{if(l)return;const r=se(e,"DD/MM/YYYY");r.isValid()&&(r.isAfter(n)||r.isSame(n))&&(r.isBefore(o)||r.isSame(o))&&(l=!0)}),l&&r.push(i)})}}d=r}),i(d),s(ui(d,c)),o(0),l(1),localStorage.setItem(n,JSON.stringify(e)),a(d)}function hi({order:e,list:r,orderAsc:t=!1}){const n=We(r).sort((r,n)=>{const o="string"===e.type?ne(r,e.key,""):Number(ne(r,e.key,0)),i="string"===e.type?ne(n,e.key,""):Number(ne(n,e.key,0));if(t){if(o<i)return-1;if(o>i)return 1}else{if(o>i)return-1;if(o<i)return 1}return 0});return n}function gi({filters:t,baseFilters:n,filtrar:o,reset:s}){const[c,d]=Z(t),[u,p]=Z(!1),[m,f]=H.useState(null),h=Boolean(m);return e(i,{width:{xs:"inherit",md:850},children:[r(S,{open:h,onClose:()=>{f(null)},anchorEl:m,children:n.map(e=>r(D,{onClick:r=>{var t;t=e,d(e=>[...e,t]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[r(Ae,{fontWeight:700,fontSize:18,children:"Filtrar"}),r(l,{startIcon:r(U,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Uo.close()},children:"Limpar"})]}),r(i,{marginBottom:1,children:r(V,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),r(a,{children:u?c.map((e,t)=>r(yi,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let n=[...r];return n[t]=e,n})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}})):r(i,{children:c.map((e,t)=>r(yi,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let n=[...r];return n[t]=e,n})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}}))})}),r(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:r(l,{variant:"contained",color:"success",startIcon:r(je,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),Uo.close()},children:"Filtrar"})})]})}function yi({filterValue:t,setDt:n,idx:o}){const[i,l]=Z(t.operator),[c,d]=Z(t),u=s(),p=f(u.breakpoints.only("xs"));return ee(()=>{n(c)},[c]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:o%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!p&&r(Ae,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:t.label}),e(A,{sx:{width:"100%"},children:[p&&r(Ae,{children:t.label}),r(T,{onChange:e=>{const r=e.target.value;d(e=>({...e,operator:r,value:""})),l(r)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:t.operators.map(e=>r(D,{value:e,children:e}))})]}),r(bi,{filterValue:t,operator:c.operator,onChange:(e,r="value")=>{d(t=>({...t,[r]:e}))}})]})}function bi({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return r(Ne,{type:"number",size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"string":if(n.useList)switch(o){case"tem um dos":return r(C,{multiple:!0,id:"tags-standard",onChange:(e,r)=>{a(r.length<=0?"":r)},options:n.useList,defaultValue:Array.isArray(n.value)?n.value:[],renderInput:e=>r(Ne,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return r(i,{width:"100%",children:r(C,{options:n.useList,onChange:(e,r)=>{a(r)},defaultValue:"object"==typeof n.value?n.value:void 0,isOptionEqualToValue:(e,r)=>e.label===r.label,renderInput:e=>r(Ne,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return r(Ne,{size:"small",placeholder:"Valor",defaultValue:n.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"date":case"dates":switch(o){case"data exata":case"data fim":case"data inicio":case"tem a data":return r(oe,{adapterLocale:"pt-br",dateAdapter:le,children:r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?se(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})})});case"entre":return e(oe,{adapterLocale:"pt-br",dateAdapter:le,children:[r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?se(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})}),r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:n.value2?se(n.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})})]})}}return r(t,{})}let xi=!1,vi="",Ci={},wi="";function ki({mediaQueryLG:n,columns:o,csvConfig:c,fetchFunc:d,emptyMsg:u={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:p="",tableName:m="Dado",columnSize:g,action:b,useKC:x=!0,itemCount:v=10,expandTextMaxLength:C=50,collapsedSize:w=53,customMargin:k=4,customMarginMobile:E=0,filtersFunc:S,filters:D=[],orderBy:Y=[],customErrorMsg:V,customTableStyle:A={},id:T,initialData:R=null,isExpandable:F=!0,alwaysExpanded:j=!1}){const[$,P]=Z(!1),[N,z]=Z(null),[B,U]=Z(R),{user:X,userLoaded:H}=J(sr),[G,re]=Z([]),[oe,ie]=Z([]),[ae,le]=Z(v),[se,ce]=Z(0),[de,ue]=Z(1),[pe,me]=Z(1),[fe,he]=Z({}),[ge,ye]=Z({}),[be,xe]=Z({}),[ve,Ce]=Z("filterKey"),we=s(),ke=f(we.breakpoints.only("xs")),Ee=te(B),Se=te("true"===localStorage.getItem(`order-${T}`)||!1),De=f(we.breakpoints.up(2e3));vi=`tableFilter_${T}`,wi=`tableFilterCache_${T}`,Ci=S??{},localStorage.getItem(wi)||localStorage.setItem(wi,JSON.stringify(D)),localStorage.getItem(wi)!==JSON.stringify(D)&&(localStorage.setItem(wi,JSON.stringify(D)),localStorage.removeItem(vi)),ee(()=>{z(null),d&&(!H&&x||(P(!0),d().then(e=>e.ok?e.json().then(e=>{if(204===e.statusCode)U({body:{data:[]}}),Ee.current=[];else if(403===e.statusCode)z({status:e.statusCode});else{let r=p?ne(e,p):e;if(r&&Array.isArray(r)){let e=r;if(localStorage.getItem(`order-data-${T}`))try{e=hi({order:JSON.parse(localStorage.getItem(`order-data-${T}`)),list:r,orderAsc:Se.current})}catch(e){console.log(e)}else Y.length>0&&(e=hi({order:Y[0],list:r,orderAsc:Se.current}));U(e),Ee.current=JSON.parse(JSON.stringify(e))}else U({body:{data:[]}}),Ee.current=[]}P(!1)}):(z({status:500}),void P(!1))).catch(e=>{z({status:500})})))},[H,d]);const Ye=Q(e=>Array.isArray(e)?e:"object"==typeof e?ne(e,p):void 0,[]);ee(()=>{if($||N||!Ye(B))return;let e=Ye(B);re(e),ie(e),ue(ui(e,ae)),localStorage.getItem(vi)&&fi({filterData:JSON.parse(localStorage.getItem(vi)),filtersFuncData:Ci,localTableName:vi,setCurrentPage:ce,setList:re,setListClone:ie,setListPage:me,setPagCount:ue,startData:Ee.current,itemsCount:ae})},[ae,$,B,N]),ee(()=>{ce(pe-1)},[pe]);const Ie=Q((e,r)=>{me(r)},[]),Me=Q(()=>{const e=se*ae;return G.slice(e,e+ae)},[G,ae,se]);function Oe(){re(Ee.current),ie(Ee.current),ue(ui(Ee.current,ae)),ce(0),me(1),localStorage.removeItem(vi),Ce((new Date).getTime().toString())}ee(()=>{const e=se*ae,r=G.slice(e,e+ae);let t={};r.forEach((e,r)=>{o.forEach(n=>{t[r]=!0===t[r]||(ne(e,n.keyName,"")??"Não Informado").toString().length>=C})}),ye(t)},[G,ae,se]);const Ve=(e,r=!1)=>{c&&function(e,r,t){try{if(e.length<=0)return Promise.resolve();let n=[];r.downloadAll&&r.customAll?n=r.customAll(e,t):!r.downloadAll&&r.customFiltered?n=r.customFiltered(e,t):e.forEach(e=>{const o={};r.map.forEach(n=>{if(n.useFilterValue&&!r.downloadAll&&!n.onlyAll){const r=t.filter(e=>e.label==n.useFilterValue.label&&n.useFilterValue.operators.includes(e.operator)),i=r.length>0&&r.reduce(e=>e.value).value||void 0;return void(o[n.name]=i||ne(e,n.key))}n.onlyFilter||(o[n.name]=ne(e,n.key))}),n.push(o)});const o=_e.utils.json_to_sheet(n),i=_e.utils.book_new();return _e.utils.book_append_sheet(i,o,r.fileName),_e.writeFile(i,`${r.fileName}.xlsx`),Promise.resolve()}catch(e){return Promise.reject(e)}}(e,{...c,...r?{downloadAll:!0}:{}},JSON.parse(localStorage.getItem(vi)??"[]")||[])},ze=e=>{fi({filterData:e,filtersFuncData:Ci,localTableName:vi,setCurrentPage:ce,setList:re,setListClone:ie,setListPage:me,setPagCount:ue,startData:Ee.current,itemsCount:ae})};return N?r(ci,{customErrorMsg:V,error:N}):$?r(di,{tableName:m}):!H&&x?r(h,{}):e(t,{children:[e(i,{marginX:ke?E:k,bgcolor:"white",p:2,borderRadius:6,...A,children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},height:{md:"40px",xs:"inherit"},width:"100%",children:[r(Ne,{InputProps:{startAdornment:r(je,{sx:{marginRight:1,fill:"#c0c0c0"}}),sx:{".MuiOutlinedInput-notchedOutline":{border:"none"}}},sx:{border:"solid 1px #CBD5E1",backgroundColor:"#F8FAFC",borderRadius:"50px",maxWidth:"600px"},size:"small",onChange:function(e){const r=e.target.value;if(""===r)return re(oe),void ue(ui(Ye(G),ae));const t=[];oe.forEach(e=>{const n=[];if(Object.keys(e).map(r=>{let t=ne(e,r,"")??"";"number"==typeof t&&(t=t.toString()),"string"==typeof t&&n.push(t)}),n.length<=0)return;let o=!1;n.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(r.toLowerCase())&&(o=!0));case"C":return void("cancelado".includes(r.toLowerCase())&&(o=!0));case"A":return void("cadastrado".includes(r.toLowerCase())&&(o=!0));case"R":return void("reprovado".includes(r.toLowerCase())&&(o=!0));case"L":return void("licenciado".includes(r.toLowerCase())&&(o=!0));case"PA":return void(("pré aprovado".includes(r.toLowerCase())||"pre aprovado".includes(r.toLowerCase()))&&(o=!0));case"FP":return void("fora do prazo".includes(r.toLowerCase())&&(o=!0))}pi(e.toLowerCase()).includes(pi(r.toLowerCase()))&&(o=!0)}),o&&t.push(e)}),re(t),ue(ui(t,ae)),ce(0),me(1)},fullWidth:!0,placeholder:`Pesquisar ${m}`}),r(l,{startIcon:r(L,{}),variant:"contained",onClick:e=>Uo.open(r(gi,{reset:Oe,filtrar:e=>ze(e),baseFilters:[...D],filters:localStorage.getItem(vi)?JSON.parse(localStorage.getItem(vi)):[...D]},ve)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:r(a,{direction:"row",borderRadius:5,padding:0,children:r("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[Y.length>0&&r(Ho,{data:Y.map(e=>({name:e.label,onClick:()=>(e=>{Se.current=!Se.current;const r=hi({order:e,list:G,orderAsc:Se.current});localStorage.setItem(`order-${T}`,Se.current.toString()),localStorage.setItem(`order-data-${T}`,JSON.stringify(e)),re(r)})(e)})),btProps:{startIcon:r(W,{}),fullWidth:!0},children:"Ordenar"}),F&&!j&&r(l,{variant:"contained",fullWidth:!0,startIcon:r(xi?K:W,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let r=0;r<v;r++)e[r]=!xi;xe(e),he(e),xi=!xi},children:xi?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(Ae,{fontWeight:600,textAlign:"end",children:["Registro de ",m,"s"]}),r(a,{justifyContent:"center",children:e(Ae,{children:["Exibindo ",se*ae+1,"-",se*ae+1+Me().length-1," de ",G.length]})})]})]}),localStorage.getItem(vi)&&r(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(vi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(t=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[r(Ae,{fontWeight:700,children:t.label}),r(Ae,{fontStyle:"italic",children:t.operator}),r(Ae,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(t.value)?t.value.map(e=>e.label).join(" - "):"object"==typeof t.value?t.value.label:"entre"===t.operator?`${t.value?t.value:"Antes"} e ${t.value2?t.value2:"Depois"}`:t.value.toString()}),r(I,{onClick:e=>{let r=JSON.parse(localStorage.getItem(vi)??"[]");r=r.map(e=>e.label===t.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),ze(r)},size:"small",sx:{padding:0},children:r(Te,{sx:{fill:"white"}})})]}))}),r(a,{spacing:.2,children:Me().length<=0?r(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:r(Ae,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:X?u.user:u.public})}):Me().map((s,c)=>r(y,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:j?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e($e,{container:!0,spacing:ke?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e($e,{item:!0,xs:12,md:De?12/g*(o.size?o.size:1):n?n.all:12/g*(o.size?o.size:1),sx:{overflow:"hidden"},children:[r(i,{sx:{width:"max-content",paddingX:1},children:r(Ae,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:o.title})}),r(i,{paddingLeft:1,position:"relative",children:r(M,{in:j||!0===fe[c],collapsedSize:j?"auto":w,onExited:e=>xe(e=>({...e,[c]:!1})),children:r(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:o.customComponent?o.customComponent(ne(s,o.keyName),s):e(t,{children:[r(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:ne(s,o.keyName,"")}),r(i,{position:"absolute",top:0,children:j||be[c]?ne(s,o.keyName,""):(ne(s,o.keyName,"")??"").toString().length>=C?r(t,{children:(ne(s,o.keyName,"")??"").toString().substring(0,C)+"..."}):ne(s,o.keyName,"")})]})})})})]},o.keyName+c)),r($e,{item:!0,xs:12,md:De?12/g:n?n.action:12/g,children:r(a,{direction:"row",alignItems:"center",justifyContent:ke?"start":"flex-end",sx:{height:"100%",paddingBottom:ke?2:0},children:b(s)})}),ge[c]&&!j&&r(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:r(l,{onClick:e=>{he(e=>({...e,[c]:!e[c]})),xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:r(fe[c]?_:q,{}),children:fe[c]?"Ver Menos":"Ver Mais"})})]})},c))}),Me().length>0&&r(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:c&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[JSON.parse(localStorage.getItem(vi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).length>0&&r(l,{startIcon:r(Re,{}),variant:"contained",size:"small",onClick:e=>Ve(G),sx:{backgroundColor:"#a5a5a5",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Filtrados"}),r(l,{startIcon:r(Re,{}),variant:"contained",size:"small",onClick:e=>Ve(Ee.current,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Tabela"})]})})]}),r(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[r(l,{onClick:e=>me(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Fe,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),r(Pe,{renderItem:e=>"page"===e.type?r(l,{onClick:e.onClick,sx:{fontWeight:600,...e.selected?{bgcolor:"#33B55D",color:"white"}:{color:"#1E293B"},borderRadius:"100%",padding:0,margin:0,minWidth:0,width:"40px",height:"40px",marginX:.25},children:e.page}):["next","previous","page"].includes(e.type)?void 0:r(O,{...e}),count:de,siblingCount:ke?0:6,size:"large",onChange:Ie,page:pe,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),r(l,{onClick:e=>me(e=>e<de?e+1:de),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Fe,{sx:{transform:"scale(1.5)"}})})]})})]})}var Ei=/*#__PURE__*/H.memo(ki);const Si=qe(()=>import("./Map-31d95a26.js").then(e=>e.Map),{ssr:!1});function Di({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:p,menuItems:m,paddingBottom:f=0,logoutMsg:h="Sair",logoutFunc:g,loginOptions:y,logoutOptions:b,...x}){let v;u&&(v=Ze());const{user:C,login:w,logout:k,type:E}=J(sr),[Y,M]=Z(null),[O,V]=Z(null),A=Boolean(Y),T=Boolean(O),[j,$]=Z(!1),P=Q(e=>{M(e.currentTarget)},[]),N=Q(()=>{M(null)},[]),z=Q((e,r)=>{$(!0),M(null),v?v.push({pathname:r}).finally(()=>$(!1)):$(!1)},[v]);return e(t,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[r(R,{position:"relative",elevation:0,sx:{backgroundColor:"#F1F5F9",color:"black",paddingY:1,paddingX:{xs:1,md:4}},children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",alignItems:"center",spacing:2,marginRight:2,sx:{display:{xs:"none",md:"flex"},width:"100%"},children:[r(Qe,{href:"/",children:u?r(Je,{src:c,alt:s,width:40,height:40}):r("img",{src:c,height:35})}),r(i,{children:r(o,{variant:"subtitle1",fontWeight:600,children:s})})]}),r(i,{sx:{display:{xs:"flex",md:"none"}},children:n.length>0&&e(t,{children:[r(I,{onClick:P,children:r(Xe,{})}),r(S,{open:A,onClose:N,anchorEl:Y,children:n.map(e=>r(D,{onClick:r=>z(r,e.path),children:r(o,{textTransform:"capitalize",children:e.name})},`navmenu${e}`))})]})}),e(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{md:"100%"}},children:[r(a,{direction:"row",spacing:2,sx:{display:{xs:"none",md:"flex"}},children:n.map(e=>r(i,{sx:{a:{color:"#2c7da0",textDecoration:"none",textTransform:"capitalize","&:hover":{color:"#90e0ef"}}},children:r(l,{onClick:r=>{return t=e.path,$(!0),void(v?v.push({pathname:t}).finally(()=>$(!1)):$(!1));var t},sx:{textTransform:"capitalize"},children:e.name})},`navigation${e.path}`))}),e(a,{direction:"row",spacing:2,children:[r(i,{children:p}),C?e(a,{direction:"row",spacing:1,sx:{"&:hover":{backgroundColor:"#a9def9",cursor:"pointer"},padding:.5,borderRadius:60},children:[e(i,{sx:{display:"flex",alignItems:"center"},children:[r(F,{sx:{width:30,height:30},src:C.image}),e(S,{open:T,onClose:e=>V(null),anchorEl:O,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[m,r(D,{onClick:function(e){try{V(null);const e={...b,onBeforeLogout:function(){try{function e(){return Promise.resolve(b?.onBeforeLogout?.()).then(function(){})}const r=function(){if(g){const e=function(e,r){try{var t=Promise.resolve(g()).then(function(){})}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(e):e())}catch(t){return Promise.reject(t)}}};return k(e),Promise.resolve()}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[r(Ke,{sx:{fill:"#545454"}}),r(o,{textTransform:"capitalize",children:h})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>V(e.currentTarget),sx:{userSelect:"none"},children:[r(o,{children:"Olá,"}),r(o,{fontWeight:600,children:C?.given_name}),r(Ue,{})]})]}):r(l,"govbr"===E?{variant:"contained",size:"small",startIcon:r(He,{}),onClick:()=>w(y),sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:r(He,{}),onClick:()=>w(y),sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})]})]})}),j&&r(Ge,{})]}),r(i,{paddingBottom:f})]})}function Yi({links:n,title:c,img:d,pos:u="fixed",next:p=!0,el:m,menuItems:f,color:h="blue",route:g="/teste/89",paddingBottom:y=0,logoutMsg:b="Sair",customBgColor:x="#FFFFFF",logoutFunc:v,loginOptions:C,logoutOptions:w,...k}){const E=s(),Y=n.length<=3?"md":"lg";let M;p&&(M=Ze());const{user:O,login:V,logout:A,type:T}=J(sr),[j,$]=Z(null),[P,N]=Z(null),z=Boolean(j),B=Boolean(P),[L,W]=Z(!1),_=Q(e=>{$(e.currentTarget)},[]),q=Q(()=>{$(null)},[]),U=Q((e,r)=>{W(!0),$(null),M?M.push({pathname:r}).finally(()=>W(!1)):W(!1)},[M]);return e(t,{children:[e(i,{position:u,sx:{width:"100%",zIndex:100},children:[r(R,{position:"relative",elevation:0,sx:{color:E.palette.getContrastText(x),paddingX:{xs:1,[Y]:4},bgcolor:x},children:e(a,{direction:"row",justifyContent:"space-between",bgcolor:x,children:[e(a,{direction:"row",alignItems:"center",spacing:2,marginRight:2,sx:{display:{xs:"none",[Y]:"flex"},width:"100%"},children:[r(Qe,{href:"/",children:p?r(Je,{src:d,alt:c,width:40,height:40}):r("img",{src:d,height:35})}),r(i,{children:r(o,{variant:"subtitle1",fontWeight:600,children:c})})]}),r(a,{direction:"row",width:"100%",justifyContent:"center",alignItems:"center",spacing:2,sx:{display:{xs:"none",[Y]:"flex"}},children:n.map((e,t)=>{const n=function(e,r){return"/"===r?e===r:e.startsWith(r)}(p?M?.pathname??"":g,e.path);return r(i,{paddingX:3,paddingY:.8,borderRadius:50,bgcolor:n?h:"transparent",color:n?"#fff":"inherit",sx:{transition:"all 0.2s ease-in-out",":hover":{backgroundColor:n?h:"rgba(0,0,0,0.05)",cursor:"pointer",userSelect:"none",filter:n?"brightness(1.1)":"none"}},onClick:r=>{var t;p&&console.log("pathname:",M?.pathname,":=",e.path),t=e.path,W(!0),M?M.push({pathname:t}).finally(()=>W(!1)):W(!1)},children:r(a,{justifyContent:"center",children:r(o,{fontWeight:n?600:500,whiteSpace:"nowrap",children:e.name})})},JSON.stringify({x:e,index:t}))})}),r(i,{sx:{display:{xs:"flex",[Y]:"none"}},children:n.length>0&&e(t,{children:[r(I,{onClick:_,children:r(Xe,{})}),r(S,{open:z,onClose:q,anchorEl:j,children:n.map((e,t)=>r(D,{onClick:r=>U(r,e.path),children:r(o,{textTransform:"capitalize",children:e.name})},JSON.stringify({x:e,index:t})))})]})}),r(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{[Y]:"100%"}},paddingY:1,children:e(a,{direction:"row",spacing:2,children:[r(i,{children:m}),O?e(a,{direction:"row",spacing:1,sx:{"&:hover":{backgroundColor:"#a9def9",cursor:"pointer"},padding:.5,borderRadius:60},children:[e(i,{sx:{display:"flex",alignItems:"center"},children:[r(F,{sx:{width:30,height:30},src:O.image}),e(S,{open:B,onClose:e=>N(null),anchorEl:P,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[f,r(D,{onClick:function(e){try{N(null);const e={...w,onBeforeLogout:function(){try{function e(){return Promise.resolve(w?.onBeforeLogout?.()).then(function(){})}const r=function(){if(v){const e=function(e,r){try{var t=Promise.resolve(v()).then(function(){})}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(e):e())}catch(t){return Promise.reject(t)}}};return A(e),Promise.resolve()}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[r(Ke,{sx:{fill:"#545454"}}),r(o,{textTransform:"capitalize",children:b})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>N(e.currentTarget),sx:{userSelect:"none"},children:[r(o,{children:"Olá,"}),r(o,{fontWeight:600,children:O.given_name}),r(Ue,{})]})]}):r(l,"govbr"===T?{variant:"contained",size:"small",startIcon:r(He,{}),onClick:()=>V(C),sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:r(He,{}),onClick:()=>V(C),sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})})]})}),L&&r(Ge,{})]}),r(i,{paddingBottom:y})]})}function Ii({children:e,onSubmit:t,formMethod:n="GET",submiting:o=!1}){const{register:i,handleSubmit:a,control:l,formState:s,reset:c,watch:d,trigger:u,setValue:p,unregister:m,getValues:f}=ue(),[h,g]=Z([]);return r(dr.Provider,{value:{formRegister:i,formWatch:d,formReset:c,formControl:l,formSetValue:p,formTrigger:u,formUnregister:m,formGetValues:f,formHandleSubmit:a,setFilesUid:g,formState:s,errors:s?.errors,submiting:o},children:r("form",{method:n,onSubmit:a(e=>t(e,h),()=>Me("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",position:"top-right",theme:"colored"})),children:e})})}function Mi(e,r){try{var t=e()}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}const Oi="keycloak-logout-pending";function Vi({url:e,realm:t,clientId:n,children:o,type:i="ad",resource_name:a="eventos-front",redirectUri:l="",onAuthSuccess:s,onAuthError:c,onLogoutSuccess:d,enableDebugLogs:u="development"===process.env.NODE_ENV}){const[p,m]=Z(null),[f,h]=Z(!1),g=te(null),y=te(!1),b=te(null),x=Ze(),v=Q(function(e){u&&console.log(`[KeycloakAuth] ${e}`,...[].slice.call(arguments,1))},[u]),C=Q(function(e){u&&console.error(`[KeycloakAuth] ${e}`,...[].slice.call(arguments,1))},[u]),w=Q(e=>{const r=e.tokenParsed;if(!r)return null;const t=(r.resource_access??{})[a],n=Array.isArray(t?.roles)?t.roles:[];return{...r,token:e.token,roles:n}},[a]),k=Q(function(){try{const e=g.current;return e&&e.authenticated?Promise.resolve(Mi(function(){return Promise.resolve(e.updateToken(30)).then(function(r){if(r){const r=w(e);r&&(m(r),v("Token renovado com sucesso"))}else v("Token ainda válido, renovação não necessária");return!0})},function(e){return C("Falha ao renovar token",e),m(null),!1})):(v("Não é possível renovar token: usuário não autenticado"),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[w,v,C]),E=Q(()=>{b.current&&clearInterval(b.current),b.current=setInterval(function(){try{return Promise.resolve(k()).then(function(){})}catch(e){return Promise.reject(e)}},6e4),v("Renovação automática de token configurada")},[k,v]),S=Q(()=>{b.current&&(clearInterval(b.current),b.current=null,v("Renovação automática de token removida"))},[v]);ee(()=>{if(y.current)return;y.current=!0;const r=new er({url:e,realm:t,clientId:n});return g.current=r,r.onTokenExpired=function(){try{return v("Token expirado, tentando renovar..."),Promise.resolve(k()).then(function(){})}catch(e){return Promise.reject(e)}},r.onAuthRefreshError=()=>{C("Erro ao renovar autenticação - refresh token inválido"),m(null),S()},r.onAuthLogout=()=>{v("Usuário deslogado em outra sessão"),m(null),S()},r.init({onLoad:"check-sso",pkceMethod:"S256",silentCheckSsoRedirectUri:"undefined"!=typeof window?`${window.location.origin}/silent-check-sso.html`:void 0,checkLoginIframe:!0,checkLoginIframeInterval:30}).then(e=>{if(sessionStorage.getItem(Oi))return sessionStorage.removeItem(Oi),localStorage.removeItem("user-data.img"),v("Logout pendente detectado, limpando estado e chamando onLogoutSuccess..."),m(null),h(!0),S(),void d?.();if(h(!0),!e)return v("Usuário não autenticado"),void m(null);const t=w(r);t&&(m(t),E(),v("Autenticação bem-sucedida",{user:t.preferred_username}),s?.(t))}).catch(e=>{C("Falha na inicialização do Keycloak",e),h(!0),m(null);const r=e instanceof Error?e:new Error("Falha na autenticação");c?.(r)}),"success"===x.query.status&&window.history.replaceState(null,"",x.pathname),()=>{S()}},[e,t,n,a,x.query,x.pathname,w,E,S,k,v,C,s,c,d]);const D=Q(e=>{const r=g.current;if(!r){const r=new Error("Keycloak não inicializado");return C("Tentativa de login com Keycloak não inicializado"),void e?.onError?.(r)}v("Iniciando fluxo de login...",{authenticated:r.authenticated,clientId:r.clientId});const t={redirectUri:e?.redirectUri||l||window.location.href,idpHint:e?.idpHint,loginHint:e?.loginHint,prompt:e?.prompt,action:e?.action,locale:e?.locale,acr:e?.acr,scope:e?.scope,maxAge:e?.maxAge};r.login(t).then(()=>{e?.onSuccess?.()}).catch(r=>{const t=r instanceof Error?r:new Error("Falha no login");C("Erro no login",t),e?.onError?.(t)})},[l,v,C]),Y=Q(function(e){try{function r(){sessionStorage.setItem(Oi,"true"),S();const r=e?.redirectUri||window.location.origin;v("Redirecionando para logout...",{redirectUri:r});const n=Mi(function(){return Promise.resolve(t.logout({redirectUri:r,logoutMethod:e?.logoutMethod})).then(function(){})},function(e){sessionStorage.removeItem(Oi),C("Erro no logout",e)});if(n&&n.then)return n.then(function(){})}const t=g.current;if(!t)return C("Tentativa de logout com Keycloak não inicializado"),Promise.resolve();v("Iniciando fluxo de logout...");const n=function(){if(e?.onBeforeLogout){const r=Mi(function(){return Promise.resolve(e.onBeforeLogout()).then(function(){})},function(e){C("Erro no callback onBeforeLogout",e)});if(r&&r.then)return r.then(function(){})}}();return Promise.resolve(n&&n.then?n.then(r):r())}catch(o){return Promise.reject(o)}},[v,C,S]),I=Q(e=>{const r={token:e.access_token,roles:e.claims.roles.map(e=>e.name),sub:e.claims.sub,exp:e.claims.exp,iat:e.claims.iat,email_verified:"true"===e.claims.email_verified,preferred_username:e.claims.preferred_username,email:e.claims.email,name:e.claims.name,given_name:e.claims.given_name};m(r),v("Dados de usuário externo salvos",{username:r.preferred_username})},[v]),M=Q(e=>p?.roles?.includes(e)??!1,[p?.roles]),O=Q(e=>!(!p?.roles||0===e.length)&&e.every(e=>p.roles.includes(e)),[p?.roles]),V=Q(e=>!(!p?.roles||0===e.length)&&e.some(e=>p.roles.includes(e)),[p?.roles]),A=re(()=>({user:p,isAuth:!!p,userLoaded:f,login:D,logout:Y,saveUserData:I,type:i,refreshToken:k,hasRole:M,hasAllRoles:O,hasAnyRole:V,accessToken:p?.token}),[p,f,D,Y,I,i,k,M,O,V]);return r(sr.Provider,{value:A,children:o})}const Ai="nextauth.token",Ti="user-data.img";function Ri({children:e,AUTH_URL:t,oidcConfig:n,redirectURL:o,validateTokenRoute:i,testToken:a,testIP:l,logoutURL:s=o}){const c=n.authority+"/authorize?response_type=code&client_id="+n.client_id+"&scope="+n.scope+"&redirect_uri="+n.redirect_uri,[d,u]=Z(null),[p,m]=Z(!1),f=Ze();ee(()=>{const e=rr(Ai);e?fetch(`${t}${i}`,{method:"POST",headers:{Authorization:`Bearer ${e}`}}).then(r=>{if(r.ok){const r=or(e),t=localStorage.getItem(Ti);u({name:r.given_name,image:t??"",roles:r.roles.map(e=>String(e.code)),token:e,preferred_username:r.preferred_username,email:r.email,email_verified:"true"===r.email_verified,sub:r.sub}),m(!0)}else y()}):m(!0)},[]);const h=Q(e=>{if(!location||"localhost"!==location.hostname&&location.hostname!==l)m(!1),f.replace(c);else{const r=a;tr(Ai,r),u({name:"Teste",image:"",roles:["1"],token:r}),f.replace(e?.redirectUri?.toString()||o).then(()=>{m(!0),e?.onSuccess?.()}).catch(r=>{e?.onError?.(r instanceof Error?r:new Error("Erro no redirecionamento"))})}},[l,a,o,c,f]),g=Q(function(e){try{const r=e.ssp_token;tr(Ai,r);const t=or(r),n=or(e.id_token);return Promise.resolve(fetch(n.picture,{headers:{Authorization:`Bearer ${e.access_token}`}}).then(e=>{200===e.status&&e.blob().then(e=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{const e=n.result;localStorage.setItem(Ti,e),u({name:t.name,image:e,roles:t.roles.map(e=>String(e.code)),token:r,preferred_username:t.preferred_username,email:t.email,sub:t.sub}),f.replace(o).finally(()=>m(!0))}}),u({name:t.name,image:"",roles:t.roles.map(e=>String(e.code)),token:r,preferred_username:t.preferred_username,email:t.email,sub:t.sub}),f.replace(o).finally(()=>m(!0))})).then(function(){f.replace(o).finally(()=>m(!0))})}catch(e){return Promise.reject(e)}},[o,f]),y=Q(function(e){try{function r(){m(!1),f.replace(e?.redirectUri||s).then(()=>{e?.onSuccess?.()}).finally(()=>{u(null),nr(Ai),localStorage.removeItem(Ti),m(!0)})}const t=function(){if(e?.onBeforeLogout){const r=function(r,t){try{var n=Promise.resolve(e.onBeforeLogout()).then(function(){})}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}(0,function(e){console.error("[OAuthProvider] Erro no callback onBeforeLogout",e)});if(r&&r.then)return r.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(r):r())}catch(n){return Promise.reject(n)}},[s,f]),b=Q(e=>d?.roles?.includes(e)??!1,[d?.roles]),x=Q(e=>!(!d?.roles||0===e.length)&&e.every(e=>d.roles.includes(e)),[d?.roles]),v=Q(e=>!(!d?.roles||0===e.length)&&e.some(e=>d.roles.includes(e)),[d?.roles]),C=Q(function(){try{return console.warn("[OAuthProvider] refreshToken não é suportado neste provider"),Promise.resolve(!1)}catch(e){return Promise.reject(e)}},[]),w=re(()=>({user:d,isAuth:!!d,userLoaded:p,login:h,logout:y,saveUserData:g,type:"govbr",refreshToken:C,hasRole:b,hasAllRoles:x,hasAnyRole:v,accessToken:d?.token}),[d,p,h,y,g,C,b,x,v]);return r(sr.Provider,{value:w,children:e})}function Fi(n){return e(t,{children:[r(Ko,{}),n.children,r(Oe,{position:"bottom-right",theme:"colored"})]})}function ji({name:t,options:a,title:l,required:c=!1,disabled:d=!1,row:u=!1,xs:p=12,sm:m,md:f,defaultValue:h,watchValue:g}){const y=J(dr),b=s();return ee(()=>{void 0!==g&&y.formSetValue(t,g)},[g,t,y]),r(n,{item:!0,xs:p,sm:m,md:f,children:r(pe,{name:t,control:y.formControl,defaultValue:h??"",rules:{required:!!c&&"Este campo é obrigatório"},render:({field:t,fieldState:{error:n}})=>e(A,{error:!!n,disabled:d,fullWidth:!0,children:[l&&r(j,{required:c,error:!!n,sx:{mb:1,fontWeight:500,fontSize:"0.875rem"},children:l}),r(i,{display:"flex",flexDirection:u?"row":"column",gap:1,flexWrap:"wrap",children:a.map((n,a)=>{const l=t.value===n.value;return e(i,{onClick:()=>!d&&t.onChange(l&&!c?"":n.value),sx:{border:"1px solid",borderColor:l?b.palette.primary.main:"#E0E0E0",borderRadius:"8px",padding:"8px 16px",cursor:d?"not-allowed":"pointer",backgroundColor:l?`${b.palette.primary.main}10`:"white",transition:"all 0.2s",display:"flex",alignItems:"center",position:"relative",opacity:d?.6:1,"&:hover":{borderColor:d||l?void 0:b.palette.grey[400],backgroundColor:d||l?void 0:b.palette.grey[50]}},children:[r(i,{sx:{width:"18px",height:"18px",borderRadius:"50%",border:"2px solid",borderColor:l?b.palette.primary.main:"#9E9E9E",mr:1.5,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},children:l&&r(i,{sx:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:b.palette.primary.main}})}),r(o,{variant:"body2",color:l?"primary.main":"text.primary",fontWeight:l?600:400,children:n.label})]},a)})}),n&&e($,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1,marginLeft:0,marginRight:0},children:[r(N,{fontSize:"small"}),n.message]})]})})})}var $i=/*#__PURE__*/H.memo(ji);export{Ai as AUTH_COOKIE_NAME,So as ActiveInput,sr as AuthContext,Do as AutoComplete,Xo as Button,ir as Category,ur as CheckBox,mr as CheckBoxAdditional,fr as CheckBoxWarning,yr as DatePicker,ho as DropFileUpload,Io as FetchAutoComplete,ar as Field,lr as FieldLabel,cr as File,go as FileUpload,Oo as FixedAutoComplete,dr as FormContext,Ii as FormProvider,br as GenericDatePicker,Ao as GenericFetchAutoComplete,jo as GenericInput,Ro as GenericMaskInput,$o as GenericMultInput,si as GenericTable,Eo as Input,Vi as KeycloakAuthProvider,Uo as MODAL,Si as Map,wo as MaskInput,Ho as Menu,Po as MultInput,Di as NavBar,Ri as OAuthProvider,No as OtherCheckBox,$i as Radio,gr as RequiredCheckBoxGroup,Fi as SspComponentsProvider,Lo as Stepper,qo as StepperBlock,bo as Switch,vo as SwitchWatch,Yi as TabNavBar,Ei as Table,xr as TimePicker,xo as ToggleVisibility};
1
+ import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{Grid as o,Typography as n,Box as i,Stack as a,Button as l,useTheme as s,Checkbox as c,Card as d,InputLabel as u,TextField as p,SvgIcon as m,useMediaQuery as f,LinearProgress as h,TableContainer as g,Paper as y,CircularProgress as b,FormControlLabel as x,Switch as v,Autocomplete as C,MobileStepper as w,SwipeableDrawer as k,Modal as E,Menu as S,MenuItem as D,Skeleton as I,IconButton as Y,Collapse as M,PaginationItem as O,Alert as V,FormControl as T,Select as A,AppBar as R,Avatar as F,FormLabel as $,FormHelperText as j}from"@mui/material";import{FileDownload as P,ErrorOutline as N,ReportProblemRounded as z,PendingRounded as B,FilterAlt as L,KeyboardArrowDown as W,ExpandLess as _,ExpandMore as q,Refresh as U,KeyboardArrowUp as K}from"@mui/icons-material";import*as X from"react";import H,{createContext as G,useContext as J,useCallback as Q,useState as Z,useEffect as ee,useMemo as re,useRef as te}from"react";import oe from"lodash.get";import{LocalizationProvider as ne,DatePicker as ie,TimePicker as ae}from"@mui/x-date-pickers";import{AdapterDayjs as le}from"@mui/x-date-pickers/AdapterDayjs";import se from"dayjs";import"dayjs/locale/pt-br";import ce from"lodash.hasin";import{useFormContext as de,useForm as ue,Controller as pe}from"react-hook-form";import me from"axios";import{useDropzone as fe}from"react-dropzone";import he from"@emotion/styled";import{ThemeContext as ge}from"@emotion/react";import ye from"@mui/icons-material/CameraAlt";import be from"@mui/icons-material/Delete";import xe from"@mui/icons-material/Done";import ve from"@mui/icons-material/InsertDriveFile";import Ce from"@mui/icons-material/PictureAsPdf";import we from"@mui/material/InputLabel";import{IMaskInput as ke}from"react-imask";import{useQuery as Ee}from"react-query";import Se from"@mui/icons-material/KeyboardArrowLeft";import De from"@mui/icons-material/KeyboardArrowRight";import Ie from"@mui/icons-material/Save";import{LoadingButton as Ye}from"@mui/lab";import{toast as Me,ToastContainer as Oe}from"react-toastify";import Ve from"@mui/icons-material/ContentPasteOutlined";import Te from"@mui/material/Typography";import Ae from"@mui/icons-material/Clear";import Re from"@mui/icons-material/FileDownload";import Fe from"@mui/icons-material/NavigateNextRounded";import $e from"@mui/icons-material/Search";import je from"@mui/material/Grid";import Pe from"@mui/material/Pagination";import Ne from"@mui/material/TextField";import ze from"jszip";import Be from"@mui/icons-material/CloseRounded";import Le from"tinycolor2";import We from"lodash.clonedeep";import*as _e from"xlsx";import qe from"next/dynamic";import Ue from"@mui/icons-material/KeyboardArrowDown";import Ke from"@mui/icons-material/LogoutOutlined";import Xe from"@mui/icons-material/Menu";import He from"@mui/icons-material/Person";import Ge from"@mui/material/LinearProgress";import Je from"next/image";import Qe from"next/link";import{useRouter as Ze}from"next/router";import er from"keycloak-js";import{getCookie as rr,setCookie as tr,deleteCookie as or}from"cookies-next";import nr from"jwt-decode";function ir({title:t}){return e(o,{paddingY:1,item:!0,marginTop:1,marginBottom:3,xs:12,children:[r(n,{textTransform:"uppercase",fontWeight:600,children:t}),r(i,{sx:{backgroundColor:"#94A3B8",height:6,borderRadius:1}})]})}function ar({name:t,title:l,tag:s,xs:c=12,md:d,lg:u}){let p=s&&"Distrital"===s?"#BFDBFE":"Estadual"===s?"#BBF7D0":"Federal"===s?"#FEF08A":"Internacional"===s?"#FED7AA":"Não"===s?"#FECACA":"#BBF7D0";return r(o,{paddingBottom:3,item:!0,xs:c,md:d,lg:u,paddingRight:2,children:e(a,{spacing:1,children:[e(a,{spacing:1,direction:"row",children:[r(n,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l}),s&&r(n,{sx:{backgroundColor:p,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:s})]}),t&&r(i,{children:"false"===String(t)?"Não":"true"===String(t)?"Sim":""===String(t)?"":t?String(t):"Não informado"})]})})}function lr({title:t,xs:i=12,tag:l,md:s,lg:c,paddingBottom:d=3}){let u=l&&"Não"===l?"#FECACA":"Sim"===l?"#BBF7D0":"#E2E8F0";return r(o,{paddingBottom:d,item:!0,xs:i,md:s,lg:c,paddingRight:2,children:e(a,{spacing:1,direction:"row",children:[r(n,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,fontSize:16,children:t}),l&&r(n,{sx:{backgroundColor:u,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l})]})})}const sr=/*#__PURE__*/G({});function cr({title:t,name:i,md:s,fileURL:c,fileExt:d="pdf"}){const{user:u}=J(sr);return r(o,{paddingBottom:3,paddingRight:3,md:s,children:e(a,{spacing:1,sx:{backgroundColor:"#F8FAFC",paddingY:1,paddingX:3,borderRadius:2,border:1,borderColor:"#CBD5E1"},children:[r(n,{fontWeight:600,sx:{textAlign:"center"},children:t}),e(a,{direction:"row",spacing:2,alignItems:"center",children:[r(P,{sx:{fill:"red"}}),r(n,{children:i})]}),r(a,{alignItems:"center",children:r(l,{variant:"outlined",color:"error",size:"small",endIcon:r(P,{}),onClick:()=>fetch(c,{method:"GET",headers:{Authorization:`Bearer ${u?.token}`}}).then(e=>e.blob()).then(e=>{var r=window.URL.createObjectURL(e);const t=document.createElement("a");t.href=r,t.download=i.split(".")[0]+`.${d}`,t.click()}),children:"Baixar"})})]})})}const dr=/*#__PURE__*/G(null);function ur({name:t,title:a,defaultValue:l=!1,xs:d=12,sm:u,md:p,onChange:m,disabled:f=!1}){const h=J(dr),g=s(),y=h?.formWatch(t)||l,b=Q(e=>{f||(h?.formSetValue(t,!h?.formGetValues(t)),m?.(e))},[h,t,f,m]);return r(o,{item:!0,xs:d,sm:u,md:p,children:e(i,{onClick:e=>b(e),sx:{border:"1px solid",borderColor:y?g.palette.primary.main:"#E0E0E0",borderRadius:"8px",padding:"8px 16px",cursor:f?"not-allowed":"pointer",backgroundColor:y?`${g.palette.primary.main}10`:"white",transition:"all 0.2s",display:"flex",alignItems:"center",position:"relative",opacity:f?.6:1,mb:.5,"&:hover":{borderColor:f||y?void 0:g.palette.grey[400],backgroundColor:f||y?void 0:g.palette.grey[50]}},children:[r(c,{checked:y,size:"small",sx:{padding:0,mr:1.5,"&.Mui-checked":{color:g.palette.primary.main}}}),"string"==typeof a?r(n,{variant:"body2",color:y?"primary.main":"text.primary",fontWeight:y?600:400,children:a}):a,r("input",{type:"checkbox",...h?.formRegister(t),style:{display:"none"}})]})})}function pr(e){let r=[];return e.forEach(e=>{if(e.props){if(e.props.children){const t=pr(Array.isArray(e.props.children)?e.props.children:[e.props.children]);return void(r=r.concat(t))}e.props.name&&r.push(e.props.name)}}),r}function mr({customText:t="Selecione pelo menos 1 opção",...n}){const[i,a]=Z(!1),[l,s]=Z(!0),c=J(dr),d=/*#__PURE__*/H.cloneElement(n.children,{onChange:()=>{i&&!c.formGetValues(d.props.name)&&s(!1)}});return e(o,{container:!0,sx:{padding:1,borderRadius:2},children:[r("input",{type:"text",...c.formRegister(n.name,{validate:(e,r)=>{if(i&&l)return!0;const o=pr(Array.isArray(n.children)?n.children:[n.children]);let d=!1;return o.forEach(e=>{c.formGetValues(e)&&(d=!0)}),!!d||(a(!0),s(!0),t)}}),hidden:!0}),d,r(o,{item:!0,xs:12,children:i&&l&&n.content})]})}function fr({name:t,title:a,customWarning:l,defaultValue:u=!1,xs:p=12,sm:m,md:f}){const h=J(dr),g=s(),y=h?.formWatch(t)||u,b=Q(e=>{h?.formSetValue(t,!h?.formGetValues(t))},[h,t]);return e(o,{item:!0,xs:p,sm:m,md:f,children:[e(i,{onClick:e=>b(e),sx:{border:"1px solid",borderColor:y?g.palette.primary.main:"#E0E0E0",borderRadius:"8px",padding:"8px 16px",cursor:"pointer",backgroundColor:y?`${g.palette.primary.main}10`:"white",transition:"all 0.2s",display:"flex",alignItems:"center",position:"relative",marginBottom:.5,"&:hover":{borderColor:y?void 0:g.palette.grey[400],backgroundColor:y?void 0:g.palette.grey[50]}},children:[r(c,{checked:y,size:"small",sx:{padding:0,mr:1.5,"&.Mui-checked":{color:g.palette.primary.main}}}),r(n,{variant:"body2",color:y?"primary.main":"text.primary",fontWeight:y?600:400,children:a}),r("input",{type:"checkbox",...h?.formRegister(t),style:{display:"none"}})]}),y&&r(d,{sx:{bgcolor:"#FFFBF5",color:"#F59E0B",padding:1,paddingLeft:2},children:l||e(n,{children:[r("b",{children:"Atenção"})," ",r("i",{children:a})," possui regras específicas."]})})]})}function hr(e){let r=[];return e.forEach(e=>{if(e.props){if(e.props.children){const t=hr(Array.isArray(e.props.children)?e.props.children:[e.props.children]);return void(r=r.concat(t))}e.props.name&&r.push(e.props.name)}}),r}function gr({customText:t="Selecione pelo menos 1 opção",...a}){const l=J(dr);return e(o,{container:!0,sx:{border:oe(l.errors,a.name)?"2px solid #d32f2f":"",padding:1,borderRadius:2},children:[r("input",{type:"text",...l.formRegister(a.name,{validate:(e,r)=>{const o=hr(Array.isArray(a.children)?a.children:[a.children]);let n=!1;return o.forEach((e,r)=>{l.formGetValues(e)&&(n=!0)}),!!n||t}}),hidden:!0},1),a.children,oe(l.errors,a.name)&&r(o,{item:!0,xs:12,children:e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:1,border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(n,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:oe(l.errors,a.name)?.message})]})})]})}function yr({name:a,required:l=!1,title:s,xs:c=12,sm:d,md:m,minDt:f,defaultValue:h,persistValue:g,maxDt:y,...b}){const x=J(dr),[v,C]=Z(void 0!==h?se(h,"DD/MM/YYYY"):void 0);return ee(()=>{void 0!==v&&x.formSetValue(a,v?v.format("DD/MM/YYYY"):v)},[v]),ee(()=>{if(!g)return()=>{x.formUnregister(a)}},[]),r(t,{children:e(o,{item:!0,xs:c,sm:d,md:m,children:[s&&r(u,{required:l,children:s}),e(ne,{adapterLocale:"pt-br",dateAdapter:le,children:[r(ie,{minDate:se(f,"DD/MM/YYYY"),maxDate:se(y,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:v,onChange:e=>{C(e)},disableHighlightToday:!0,sx:{outline:oe(x.errors,a)?"1px solid transparent":"",backgroundColor:"white",width:"100%","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"error.main",borderWidth:"2px"}},div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>r(p,{size:"small",...e,...x?.formRegister(a,{validate:(e,r)=>!ce(r,a)||(e||(e=""),e.length<=0&&l?"Este campo é obrigatório":e.length<10&&l?"A data precisa seguir o padrão DD/MM/AAAA":!f||se(f,"DD/MM/YYYY").isSame(se(e,"DD/MM/YYYY"))||se(f,"DD/MM/YYYY").isBefore(se(e,"DD/MM/YYYY"))?!y||se(y,"DD/MM/YYYY").isSame(se(e,"DD/MM/YYYY"))||se(y,"DD/MM/YYYY").isAfter(se(e,"DD/MM/YYYY"))?void 0:"A data escolhida não é válida":`A data tem que ser depois de ${f} e antes de ${y}`),shouldUnregister:!0}),fullWidth:!0})}),oe(x.errors,a)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(n,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:oe(x.errors,a)?.message})]})]})]})})}function br({name:i,required:a=!1,title:l,xs:s=12,sm:c,md:d,minDt:m,defaultValue:f,persistValue:h,maxDt:g,...y}){const b=de(),[x,v]=Z(void 0!==f?se(f,"DD/MM/YYYY"):void 0);return ee(()=>{void 0!==x&&b.setValue(i,x?x.format("DD/MM/YYYY"):x)},[x]),ee(()=>{if(!h)return()=>{b.unregister(i)}},[]),r(t,{children:e(o,{item:!0,xs:s,sm:c,md:d,children:[l&&r(u,{required:a,children:l}),e(ne,{adapterLocale:"pt-br",dateAdapter:le,children:[r(ie,{minDate:se(m,"DD/MM/YYYY"),maxDate:se(g,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:x,onChange:e=>{v(void 0)},disableHighlightToday:!0,sx:{outline:oe(b.formState.errors,i)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>r(p,{size:"small",...e,...b?.register(i,{validate:(e,r)=>!ce(r,i)||(e||(e=""),e.length<=0&&a?"Este campo é obrigatório":e.length<10&&a?"A data precisa seguir o padrão DD/MM/AAAA":!m||se(m,"DD/MM/YYYY").isSame(se(e,"DD/MM/YYYY"))||se(m,"DD/MM/YYYY").isBefore(se(e,"DD/MM/YYYY"))?!g||se(g,"DD/MM/YYYY").isSame(se(e,"DD/MM/YYYY"))||se(g,"DD/MM/YYYY").isAfter(se(e,"DD/MM/YYYY"))?void 0:"A data escolhida não é válida":`A data tem que ser depois de ${m} e antes de ${g}`),shouldUnregister:!0}),fullWidth:!0})}),r(n,{sx:{color:"#a51c30",fontSize:14,paddingLeft:1},children:oe(b.formState.errors,i)?.message})]})]})})}function xr({name:t,required:a=!1,title:l,defaultValue:s="",xs:c=12,sm:d,md:m}){const f=J(dr),[h,g]=Z(s?se(s,"HH:mm"):null);return ee(()=>{f.formSetValue(t,h?h.format("HH:mm"):h)},[h]),ee(()=>()=>{f.formUnregister(t)},[]),e(o,{item:!0,xs:c,sm:d,md:m,children:[l&&r(u,{required:a,children:l}),e(ne,{adapterLocale:"pt-br",dateAdapter:le,children:[r(ae,{value:h,ampm:!1,onChange:e=>{g(e)},sx:{outline:oe(f.errors,t)?"1px solid transparent":"",backgroundColor:"white",width:"100%","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:"error.main",borderWidth:"2px"}},div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>r(p,{size:"small",...e,...f?.formRegister(t,{validate:(e,r)=>!ce(r,t)||(e||(e=""),e.length<=0&&a?"Este campo é obrigatório":e.length<5&&a?"A hora precisa seguir o padrão HH:MM":void 0),shouldUnregister:!0}),fullWidth:!0})}),oe(f.errors,t)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(n,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:oe(f.errors,t)?.message})]})]})]})}function vr(){return vr=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},vr.apply(null,arguments)}function Cr(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function wr(e){if(!Cr(e))return e;const r={};return Object.keys(e).forEach(t=>{r[t]=wr(e[t])}),r}function kr(e,r,t={clone:!0}){const o=t.clone?vr({},e):e;return Cr(e)&&Cr(r)&&Object.keys(r).forEach(n=>{"__proto__"!==n&&(o[n]=Cr(r[n])&&n in e&&Cr(e[n])?kr(e[n],r[n],t):t.clone&&Cr(r[n])?wr(r[n]):r[n])}),o}function Er(e){var r={exports:{}};return e(r,r.exports),r.exports}var Sr="function"==typeof Symbol&&Symbol.for,Dr=Sr?Symbol.for("react.element"):60103,Ir=Sr?Symbol.for("react.portal"):60106,Yr=Sr?Symbol.for("react.fragment"):60107,Mr=Sr?Symbol.for("react.strict_mode"):60108,Or=Sr?Symbol.for("react.profiler"):60114,Vr=Sr?Symbol.for("react.provider"):60109,Tr=Sr?Symbol.for("react.context"):60110,Ar=Sr?Symbol.for("react.async_mode"):60111,Rr=Sr?Symbol.for("react.concurrent_mode"):60111,Fr=Sr?Symbol.for("react.forward_ref"):60112,$r=Sr?Symbol.for("react.suspense"):60113,jr=Sr?Symbol.for("react.suspense_list"):60120,Pr=Sr?Symbol.for("react.memo"):60115,Nr=Sr?Symbol.for("react.lazy"):60116,zr=Sr?Symbol.for("react.block"):60121,Br=Sr?Symbol.for("react.fundamental"):60117,Lr=Sr?Symbol.for("react.responder"):60118,Wr=Sr?Symbol.for("react.scope"):60119;function _r(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case Dr:switch(e=e.type){case Ar:case Rr:case Yr:case Or:case Mr:case $r:return e;default:switch(e=e&&e.$$typeof){case Tr:case Fr:case Nr:case Pr:case Vr:return e;default:return r}}case Ir:return r}}}function qr(e){return _r(e)===Rr}var Ur={AsyncMode:Ar,ConcurrentMode:Rr,ContextConsumer:Tr,ContextProvider:Vr,Element:Dr,ForwardRef:Fr,Fragment:Yr,Lazy:Nr,Memo:Pr,Portal:Ir,Profiler:Or,StrictMode:Mr,Suspense:$r,isAsyncMode:function(e){return qr(e)||_r(e)===Ar},isConcurrentMode:qr,isContextConsumer:function(e){return _r(e)===Tr},isContextProvider:function(e){return _r(e)===Vr},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Dr},isForwardRef:function(e){return _r(e)===Fr},isFragment:function(e){return _r(e)===Yr},isLazy:function(e){return _r(e)===Nr},isMemo:function(e){return _r(e)===Pr},isPortal:function(e){return _r(e)===Ir},isProfiler:function(e){return _r(e)===Or},isStrictMode:function(e){return _r(e)===Mr},isSuspense:function(e){return _r(e)===$r},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Yr||e===Rr||e===Or||e===Mr||e===$r||e===jr||"object"==typeof e&&null!==e&&(e.$$typeof===Nr||e.$$typeof===Pr||e.$$typeof===Vr||e.$$typeof===Tr||e.$$typeof===Fr||e.$$typeof===Br||e.$$typeof===Lr||e.$$typeof===Wr||e.$$typeof===zr)},typeOf:_r},Kr=Er(function(e,r){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,d=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function v(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case t:var m=e.type;switch(m){case c:case d:case n:case a:case i:case p:return m;default:var g=m&&m.$$typeof;switch(g){case s:case u:case h:case f:case l:return g;default:return r}}case o:return r}}}var C=d,w=s,k=l,E=t,S=u,D=n,I=h,Y=f,M=o,O=a,V=i,T=p,A=!1;function R(e){return v(e)===d}r.AsyncMode=c,r.ConcurrentMode=C,r.ContextConsumer=w,r.ContextProvider=k,r.Element=E,r.ForwardRef=S,r.Fragment=D,r.Lazy=I,r.Memo=Y,r.Portal=M,r.Profiler=O,r.StrictMode=V,r.Suspense=T,r.isAsyncMode=function(e){return A||(A=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||v(e)===c},r.isConcurrentMode=R,r.isContextConsumer=function(e){return v(e)===s},r.isContextProvider=function(e){return v(e)===l},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},r.isForwardRef=function(e){return v(e)===u},r.isFragment=function(e){return v(e)===n},r.isLazy=function(e){return v(e)===h},r.isMemo=function(e){return v(e)===f},r.isPortal=function(e){return v(e)===o},r.isProfiler=function(e){return v(e)===a},r.isStrictMode=function(e){return v(e)===i},r.isSuspense=function(e){return v(e)===p},r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===d||e===a||e===i||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===f||e.$$typeof===l||e.$$typeof===s||e.$$typeof===u||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===g)},r.typeOf=v}()}),Xr=Er(function(e){e.exports="production"===process.env.NODE_ENV?Ur:Kr}),Hr=Object.getOwnPropertySymbols,Gr=Object.prototype.hasOwnProperty,Jr=Object.prototype.propertyIsEnumerable,Qr=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var r={},t=0;t<10;t++)r["_"+String.fromCharCode(t)]=t;var o=Object.getOwnPropertyNames(r).map(function(e){return r[e]});if("0123456789"!==o.join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,r){for(var t,o,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;i<arguments.length;i++){for(var a in t=Object(arguments[i]))Gr.call(t,a)&&(n[a]=t[a]);if(Hr){o=Hr(t);for(var l=0;l<o.length;l++)Jr.call(t,o[l])&&(n[o[l]]=t[o[l]])}}return n},Zr=Function.call.bind(Object.prototype.hasOwnProperty),et="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",rt=Zr,tt=function(){};if("production"!==process.env.NODE_ENV){var ot=et,nt={},it=rt;tt=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function at(e,r,t,o,n){if("production"!==process.env.NODE_ENV)for(var i in e)if(it(e,i)){var a;try{if("function"!=typeof e[i]){var l=Error((o||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](r,i,o,t,null,ot)}catch(e){a=e}if(!a||a instanceof Error||tt((o||"React class")+": type specification of "+t+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof a+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),a instanceof Error&&!(a.message in nt)){nt[a.message]=!0;var s=n?n():"";tt("Failed "+t+" type: "+a.message+(null!=s?s:""))}}}at.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(nt={})};var lt=at,st=function(){};function ct(){return null}function dt(){}function ut(){}"production"!==process.env.NODE_ENV&&(st=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}),ut.resetWarningCache=dt;var pt,mt=Er(function(e){e.exports="production"!==process.env.NODE_ENV?function(e){var r="function"==typeof Symbol&&Symbol.iterator,t="<<anonymous>>",o={array:l("array"),bigint:l("bigint"),bool:l("boolean"),func:l("function"),number:l("number"),object:l("object"),string:l("string"),symbol:l("symbol"),any:a(ct),arrayOf:function(e){return a(function(r,t,o,n,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var l=r[t];if(!Array.isArray(l))return new i("Invalid "+n+" `"+a+"` of type `"+d(l)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<l.length;s++){var c=e(l,s,o,n,a+"["+s+"]",et);if(c instanceof Error)return c}return null})},element:a(function(r,t,o,n,a){var l=r[t];return e(l)?null:new i("Invalid "+n+" `"+a+"` of type `"+d(l)+"` supplied to `"+o+"`, expected a single ReactElement.")}),elementType:a(function(e,r,t,o,n){var a=e[r];return Xr.isValidElementType(a)?null:new i("Invalid "+o+" `"+n+"` of type `"+d(a)+"` supplied to `"+t+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(r,o,n,a,l){return r[o]instanceof e?null:new i("Invalid "+a+" `"+l+"` of type `"+((s=r[o]).constructor&&s.constructor.name?s.constructor.name:t)+"` supplied to `"+n+"`, expected instance of `"+(e.name||t)+"`.");var s})},node:a(function(e,r,t,o,n){return c(e[r])?null:new i("Invalid "+o+" `"+n+"` supplied to `"+t+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(r,t,o,n,a){if("function"!=typeof e)return new i("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside objectOf.");var l=r[t],s=d(l);if("object"!==s)return new i("Invalid "+n+" `"+a+"` of type `"+s+"` supplied to `"+o+"`, expected an object.");for(var c in l)if(rt(l,c)){var u=e(l,c,o,n,a+"."+c,et);if(u instanceof Error)return u}return null})},oneOf:function(e){return Array.isArray(e)?a(function(r,t,o,a,l){for(var s=r[t],c=0;c<e.length;c++)if(n(s,e[c]))return null;var d=JSON.stringify(e,function(e,r){return"symbol"===u(r)?String(r):r});return new i("Invalid "+a+" `"+l+"` of value `"+String(s)+"` supplied to `"+o+"`, expected one of "+d+".")}):("production"!==process.env.NODE_ENV&&st(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),ct)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&st("Invalid argument supplied to oneOfType, expected an instance of array."),ct;for(var r=0;r<e.length;r++){var t=e[r];if("function"!=typeof t)return st("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+p(t)+" at index "+r+"."),ct}return a(function(r,t,o,n,a){for(var l=[],s=0;s<e.length;s++){var c=(0,e[s])(r,t,o,n,a,et);if(null==c)return null;c.data&&rt(c.data,"expectedType")&&l.push(c.data.expectedType)}return new i("Invalid "+n+" `"+a+"` supplied to `"+o+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return a(function(r,t,o,n,a){var l=r[t],c=d(l);if("object"!==c)return new i("Invalid "+n+" `"+a+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var p in e){var m=e[p];if("function"!=typeof m)return s(o,n,a,p,u(m));var f=m(l,p,o,n,a+"."+p,et);if(f)return f}return null})},exact:function(e){return a(function(r,t,o,n,a){var l=r[t],c=d(l);if("object"!==c)return new i("Invalid "+n+" `"+a+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");var p=Qr({},r[t],e);for(var m in p){var f=e[m];if(rt(e,m)&&"function"!=typeof f)return s(o,n,a,m,u(f));if(!f)return new i("Invalid "+n+" `"+a+"` key `"+m+"` supplied to `"+o+"`.\nBad object: "+JSON.stringify(r[t],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(l,m,o,n,a+"."+m,et);if(h)return h}return null})}};function n(e,r){return e===r?0!==e||1/e==1/r:e!=e&&r!=r}function i(e,r){this.message=e,this.data=r&&"object"==typeof r?r:{},this.stack=""}function a(e){function r(r,o,n,a,l,s,c){if(a=a||t,s=s||n,c!==et){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}return null==o[n]?r?new i(null===o[n]?"The "+l+" `"+s+"` is marked as required in `"+a+"`, but its value is `null`.":"The "+l+" `"+s+"` is marked as required in `"+a+"`, but its value is `undefined`."):null:e(o,n,a,l,s)}process;var o=r.bind(null,!1);return o.isRequired=r.bind(null,!0),o}function l(e){return a(function(r,t,o,n,a,l){var s=r[t];return d(s)!==e?new i("Invalid "+n+" `"+a+"` of type `"+u(s)+"` supplied to `"+o+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,r,t,o,n){return new i((e||"React class")+": "+r+" type `"+t+"."+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+n+"`.")}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var o=function(e){var t=e&&(r&&e[r]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!o)return!1;var n,i=o.call(t);if(o!==t.entries){for(;!(n=i.next()).done;)if(!c(n.value))return!1}else for(;!(n=i.next()).done;){var a=n.value;if(a&&!c(a[1]))return!1}return!0;default:return!1}}function d(e){var r=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,r){return"symbol"===e||!!r&&("Symbol"===r["@@toStringTag"]||"function"==typeof Symbol&&r instanceof Symbol)}(r,e)?"symbol":r}function u(e){if(null==e)return""+e;var r=d(e);if("object"===r){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return r}function p(e){var r=u(e);switch(r){case"array":case"object":return"an "+r;case"boolean":case"date":case"regexp":return"a "+r;default:return r}}return i.prototype=Error.prototype,o.checkPropTypes=lt,o.resetWarningCache=lt.resetWarningCache,o.PropTypes=o,o}(Xr.isElement):function(){function e(e,r,t,o,n,i){if(i!==et){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:ut,resetWarningCache:dt};return t.PropTypes=t,t}()}),ft=Symbol.for("react.element"),ht=Symbol.for("react.portal"),gt=Symbol.for("react.fragment"),yt=Symbol.for("react.strict_mode"),bt=Symbol.for("react.profiler"),xt=Symbol.for("react.provider"),vt=Symbol.for("react.context"),Ct=Symbol.for("react.server_context"),wt=Symbol.for("react.forward_ref"),kt=Symbol.for("react.suspense"),Et=Symbol.for("react.suspense_list"),St=Symbol.for("react.memo"),Dt=Symbol.for("react.lazy"),It=Symbol.for("react.offscreen");function Yt(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case ft:switch(e=e.type){case gt:case bt:case yt:case kt:case Et:return e;default:switch(e=e&&e.$$typeof){case Ct:case vt:case wt:case Dt:case St:case xt:return e;default:return r}}case ht:return r}}}pt=Symbol.for("react.module.reference");var Mt={ContextConsumer:vt,ContextProvider:xt,Element:ft,ForwardRef:wt,Fragment:gt,Lazy:Dt,Memo:St,Portal:ht,Profiler:bt,StrictMode:yt,Suspense:kt,SuspenseList:Et,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Yt(e)===vt},isContextProvider:function(e){return Yt(e)===xt},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ft},isForwardRef:function(e){return Yt(e)===wt},isFragment:function(e){return Yt(e)===gt},isLazy:function(e){return Yt(e)===Dt},isMemo:function(e){return Yt(e)===St},isPortal:function(e){return Yt(e)===ht},isProfiler:function(e){return Yt(e)===bt},isStrictMode:function(e){return Yt(e)===yt},isSuspense:function(e){return Yt(e)===kt},isSuspenseList:function(e){return Yt(e)===Et},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===gt||e===bt||e===yt||e===kt||e===Et||e===It||"object"==typeof e&&null!==e&&(e.$$typeof===Dt||e.$$typeof===St||e.$$typeof===xt||e.$$typeof===vt||e.$$typeof===wt||e.$$typeof===pt||void 0!==e.getModuleId)},typeOf:Yt},Ot=Er(function(e,r){"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),o=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen");function g(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case t:var h=e.type;switch(h){case n:case a:case i:case u:case p:return h;default:var g=h&&h.$$typeof;switch(g){case c:case s:case d:case f:case m:case l:return g;default:return r}}case o:return r}}}e=Symbol.for("react.module.reference");var y=l,b=t,x=d,v=n,C=f,w=m,k=o,E=a,S=i,D=u,I=p,Y=!1,M=!1;r.ContextConsumer=s,r.ContextProvider=y,r.Element=b,r.ForwardRef=x,r.Fragment=v,r.Lazy=C,r.Memo=w,r.Portal=k,r.Profiler=E,r.StrictMode=S,r.Suspense=D,r.SuspenseList=I,r.isAsyncMode=function(e){return Y||(Y=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},r.isConcurrentMode=function(e){return M||(M=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},r.isContextConsumer=function(e){return g(e)===s},r.isContextProvider=function(e){return g(e)===l},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},r.isForwardRef=function(e){return g(e)===d},r.isFragment=function(e){return g(e)===n},r.isLazy=function(e){return g(e)===f},r.isMemo=function(e){return g(e)===m},r.isPortal=function(e){return g(e)===o},r.isProfiler=function(e){return g(e)===a},r.isStrictMode=function(e){return g(e)===i},r.isSuspense=function(e){return g(e)===u},r.isSuspenseList=function(e){return g(e)===p},r.isValidElementType=function(r){return"string"==typeof r||"function"==typeof r||r===n||r===a||r===i||r===u||r===p||r===h||"object"==typeof r&&null!==r&&(r.$$typeof===f||r.$$typeof===m||r.$$typeof===l||r.$$typeof===s||r.$$typeof===d||r.$$typeof===e||void 0!==r.getModuleId)},r.typeOf=g}()}),Vt=Er(function(e){e.exports="production"===process.env.NODE_ENV?Mt:Ot});const Tt=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function At(e,r=""){return e.displayName||e.name||function(e){const r=`${e}`.match(Tt);return r&&r[1]||""}(e)||r}function Rt(e,r,t){const o=At(r);return e.displayName||(""!==o?`${t}(${o})`:t)}function Ft(e){if("string"!=typeof e)throw new Error("production"!==process.env.NODE_ENV?"MUI: `capitalize(string)` expects a string argument.":function(e){let r="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)r+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+r+" for the full message."}(7));return e.charAt(0).toUpperCase()+e.slice(1)}function $t(e,r){const t=vr({},r);return Object.keys(e).forEach(o=>{if(o.toString().match(/^(components|slots)$/))t[o]=vr({},e[o],t[o]);else if(o.toString().match(/^(componentsProps|slotProps)$/)){const n=e[o]||{},i=r[o];t[o]={},i&&Object.keys(i)?n&&Object.keys(n)?(t[o]=vr({},i),Object.keys(n).forEach(e=>{t[o][e]=$t(n[e],i[e])})):t[o]=i:t[o]=n}else void 0===t[o]&&(t[o]=e[o])}),t}const jt=e=>e;var Pt=(()=>{let e=jt;return{configure(r){e=r},generate:r=>e(r),reset(){e=jt}}})();const Nt={active:"active",checked:"checked",completed:"completed",disabled:"disabled",readOnly:"readOnly",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",required:"required",selected:"selected"};function zt(e,r){if(null==e)return{};var t={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(-1!==r.indexOf(o))continue;t[o]=e[o]}return t}const Bt=["values","unit","step"];var Lt={borderRadius:4},Wt="production"!==process.env.NODE_ENV?mt.oneOfType([mt.number,mt.string,mt.object,mt.array]):{};function _t(e,r){return r?kr(e,r,{clone:!1}):e}const qt={xs:0,sm:600,md:900,lg:1200,xl:1536},Ut={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${qt[e]}px)`};function Kt(e,r,t){const o=e.theme||{};if(Array.isArray(r)){const e=o.breakpoints||Ut;return r.reduce((o,n,i)=>(o[e.up(e.keys[i])]=t(r[i]),o),{})}if("object"==typeof r){const e=o.breakpoints||Ut;return Object.keys(r).reduce((o,n)=>(-1!==Object.keys(e.values||qt).indexOf(n)?o[e.up(n)]=t(r[n],n):o[n]=r[n],o),{})}return t(r)}function Xt(e={}){var r;return(null==(r=e.keys)?void 0:r.reduce((r,t)=>(r[e.up(t)]={},r),{}))||{}}function Ht(e,r){return e.reduce((e,r)=>{const t=e[r];return(!t||0===Object.keys(t).length)&&delete e[r],e},r)}function Gt({values:e,breakpoints:r,base:t}){const o=t||function(e,r){if("object"!=typeof e)return{};const t={},o=Object.keys(r);return Array.isArray(e)?o.forEach((r,o)=>{o<e.length&&(t[r]=!0)}):o.forEach(r=>{null!=e[r]&&(t[r]=!0)}),t}(e,r),n=Object.keys(o);if(0===n.length)return e;let i;return n.reduce((r,t,o)=>(Array.isArray(e)?(r[t]=null!=e[o]?e[o]:e[i],i=o):"object"==typeof e?(r[t]=null!=e[t]?e[t]:e[i],i=t):r[t]=e,r),{})}function Jt(e,r,t=!0){if(!r||"string"!=typeof r)return null;if(e&&e.vars&&t){const t=`vars.${r}`.split(".").reduce((e,r)=>e&&e[r]?e[r]:null,e);if(null!=t)return t}return r.split(".").reduce((e,r)=>e&&null!=e[r]?e[r]:null,e)}function Qt(e,r,t,o=t){let n;return n="function"==typeof e?e(t):Array.isArray(e)?e[t]||o:Jt(e,t)||o,r&&(n=r(n,o,e)),n}function Zt(e){const{prop:r,cssProperty:t=e.prop,themeKey:o,transform:n}=e,i=e=>{if(null==e[r])return null;const i=e[r],a=Jt(e.theme,o)||{};return Kt(e,i,e=>{let o=Qt(a,n,e);return e===o&&"string"==typeof e&&(o=Qt(a,n,`${r}${"default"===e?"":Ft(e)}`,e)),!1===t?o:{[t]:o}})};return i.propTypes="production"!==process.env.NODE_ENV?{[r]:Wt}:{},i.filterProps=[r],i}const eo={m:"margin",p:"padding"},ro={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},to={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},oo=function(){const e={};return r=>(void 0===e[r]&&(e[r]=(e=>{if(e.length>2){if(!to[e])return[e];e=to[e]}const[r,t]=e.split(""),o=eo[r],n=ro[t]||"";return Array.isArray(n)?n.map(e=>o+e):[o+n]})(r)),e[r])}(),no=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],io=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],ao=[...no,...io];function lo(e,r,t,o){var n;const i=null!=(n=Jt(e,r,!1))?n:t;return"number"==typeof i?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&"number"!=typeof e&&console.error(`MUI: Expected ${o} argument to be a number or a string, got ${e}.`),i*e):Array.isArray(i)?e=>"string"==typeof e?e:("production"!==process.env.NODE_ENV&&(Number.isInteger(e)?e>i.length-1&&console.error([`MUI: The value provided (${e}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${e} > ${i.length-1}, you need to add the missing values.`].join("\n")):console.error([`MUI: The \`theme.${r}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${r}\` as a number.`].join("\n"))),i[e]):"function"==typeof i?i:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${r}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}function so(e){return lo(e,"spacing",8,"spacing")}function co(e,r){if("string"==typeof r||null==r)return r;const t=e(Math.abs(r));return r>=0?t:"number"==typeof t?-t:`-${t}`}function uo(e,r){const t=so(e.theme);return Object.keys(e).map(o=>function(e,r,t,o){if(-1===r.indexOf(t))return null;const n=function(e,r){return t=>e.reduce((e,o)=>(e[o]=co(r,t),e),{})}(oo(t),o);return Kt(e,e[t],n)}(e,r,o,t)).reduce(_t,{})}function po(e){return uo(e,no)}function mo(e){return uo(e,io)}function fo(...e){const r=e.reduce((e,r)=>(r.filterProps.forEach(t=>{e[t]=r}),e),{}),t=e=>Object.keys(e).reduce((t,o)=>r[o]?_t(t,r[o](e)):t,{});return t.propTypes="production"!==process.env.NODE_ENV?e.reduce((e,r)=>Object.assign(e,r.propTypes),{}):{},t.filterProps=e.reduce((e,r)=>e.concat(r.filterProps),[]),t}function ho(e){return"number"!=typeof e?e:`${e}px solid`}po.propTypes="production"!==process.env.NODE_ENV?no.reduce((e,r)=>(e[r]=Wt,e),{}):{},po.filterProps=no,mo.propTypes="production"!==process.env.NODE_ENV?io.reduce((e,r)=>(e[r]=Wt,e),{}):{},mo.filterProps=io,"production"===process.env.NODE_ENV||ao.reduce((e,r)=>(e[r]=Wt,e),{});const go=Zt({prop:"border",themeKey:"borders",transform:ho}),yo=Zt({prop:"borderTop",themeKey:"borders",transform:ho}),bo=Zt({prop:"borderRight",themeKey:"borders",transform:ho}),xo=Zt({prop:"borderBottom",themeKey:"borders",transform:ho}),vo=Zt({prop:"borderLeft",themeKey:"borders",transform:ho}),Co=Zt({prop:"borderColor",themeKey:"palette"}),wo=Zt({prop:"borderTopColor",themeKey:"palette"}),ko=Zt({prop:"borderRightColor",themeKey:"palette"}),Eo=Zt({prop:"borderBottomColor",themeKey:"palette"}),So=Zt({prop:"borderLeftColor",themeKey:"palette"}),Do=e=>{if(null!=e.borderRadius){const r=lo(e.theme,"shape.borderRadius",4,"borderRadius");return Kt(e,e.borderRadius,e=>({borderRadius:co(r,e)}))}return null};Do.propTypes="production"!==process.env.NODE_ENV?{borderRadius:Wt}:{},Do.filterProps=["borderRadius"],fo(go,yo,bo,xo,vo,Co,wo,ko,Eo,So,Do);const Io=e=>{if(null!=e.gap){const r=lo(e.theme,"spacing",8,"gap");return Kt(e,e.gap,e=>({gap:co(r,e)}))}return null};Io.propTypes="production"!==process.env.NODE_ENV?{gap:Wt}:{},Io.filterProps=["gap"];const Yo=e=>{if(null!=e.columnGap){const r=lo(e.theme,"spacing",8,"columnGap");return Kt(e,e.columnGap,e=>({columnGap:co(r,e)}))}return null};Yo.propTypes="production"!==process.env.NODE_ENV?{columnGap:Wt}:{},Yo.filterProps=["columnGap"];const Mo=e=>{if(null!=e.rowGap){const r=lo(e.theme,"spacing",8,"rowGap");return Kt(e,e.rowGap,e=>({rowGap:co(r,e)}))}return null};function Oo(e,r){return"grey"===r?r:e}function Vo(e){return e<=1&&0!==e?100*e+"%":e}Mo.propTypes="production"!==process.env.NODE_ENV?{rowGap:Wt}:{},Mo.filterProps=["rowGap"],fo(Io,Yo,Mo,Zt({prop:"gridColumn"}),Zt({prop:"gridRow"}),Zt({prop:"gridAutoFlow"}),Zt({prop:"gridAutoColumns"}),Zt({prop:"gridAutoRows"}),Zt({prop:"gridTemplateColumns"}),Zt({prop:"gridTemplateRows"}),Zt({prop:"gridTemplateAreas"}),Zt({prop:"gridArea"})),fo(Zt({prop:"color",themeKey:"palette",transform:Oo}),Zt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Oo}),Zt({prop:"backgroundColor",themeKey:"palette",transform:Oo}));const To=Zt({prop:"width",transform:Vo}),Ao=e=>null!=e.maxWidth?Kt(e,e.maxWidth,r=>{var t,o,n;return{maxWidth:(null==(t=e.theme)||null==(o=t.breakpoints)||null==(n=o.values)?void 0:n[r])||qt[r]||Vo(r)}}):null;Ao.filterProps=["maxWidth"];const Ro=Zt({prop:"minWidth",transform:Vo}),Fo=Zt({prop:"height",transform:Vo}),$o=Zt({prop:"maxHeight",transform:Vo}),jo=Zt({prop:"minHeight",transform:Vo});Zt({prop:"size",cssProperty:"width",transform:Vo}),Zt({prop:"size",cssProperty:"height",transform:Vo}),fo(To,Ao,Ro,Fo,$o,jo,Zt({prop:"boxSizing"}));var Po={border:{themeKey:"borders",transform:ho},borderTop:{themeKey:"borders",transform:ho},borderRight:{themeKey:"borders",transform:ho},borderBottom:{themeKey:"borders",transform:ho},borderLeft:{themeKey:"borders",transform:ho},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Do},color:{themeKey:"palette",transform:Oo},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Oo},backgroundColor:{themeKey:"palette",transform:Oo},p:{style:mo},pt:{style:mo},pr:{style:mo},pb:{style:mo},pl:{style:mo},px:{style:mo},py:{style:mo},padding:{style:mo},paddingTop:{style:mo},paddingRight:{style:mo},paddingBottom:{style:mo},paddingLeft:{style:mo},paddingX:{style:mo},paddingY:{style:mo},paddingInline:{style:mo},paddingInlineStart:{style:mo},paddingInlineEnd:{style:mo},paddingBlock:{style:mo},paddingBlockStart:{style:mo},paddingBlockEnd:{style:mo},m:{style:po},mt:{style:po},mr:{style:po},mb:{style:po},ml:{style:po},mx:{style:po},my:{style:po},margin:{style:po},marginTop:{style:po},marginRight:{style:po},marginBottom:{style:po},marginLeft:{style:po},marginX:{style:po},marginY:{style:po},marginInline:{style:po},marginInlineStart:{style:po},marginInlineEnd:{style:po},marginBlock:{style:po},marginBlockStart:{style:po},marginBlockEnd:{style:po},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Io},rowGap:{style:Mo},columnGap:{style:Yo},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Vo},maxWidth:{style:Ao},minWidth:{transform:Vo},height:{transform:Vo},maxHeight:{transform:Vo},minHeight:{transform:Vo},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};const No=function(){function e(e,r,t,o){const n={[e]:r,theme:t},i=o[e];if(!i)return{[e]:r};const{cssProperty:a=e,themeKey:l,transform:s,style:c}=i;if(null==r)return null;if("typography"===l&&"inherit"===r)return{[e]:r};const d=Jt(t,l)||{};return c?c(n):Kt(n,r,r=>{let t=Qt(d,s,r);return r===t&&"string"==typeof r&&(t=Qt(d,s,`${e}${"default"===r?"":Ft(r)}`,r)),!1===a?t:{[a]:t}})}return function r(t){var o;const{sx:n,theme:i={}}=t||{};if(!n)return null;const a=null!=(o=i.unstable_sxConfig)?o:Po;function l(t){let o=t;if("function"==typeof t)o=t(i);else if("object"!=typeof t)return t;if(!o)return null;const n=Xt(i.breakpoints),l=Object.keys(n);let s=n;return Object.keys(o).forEach(t=>{const n="function"==typeof(l=o[t])?l(i):l;var l;if(null!=n)if("object"==typeof n)if(a[t])s=_t(s,e(t,n,i,a));else{const e=Kt({theme:i},n,e=>({[t]:e}));!function(...e){const r=e.reduce((e,r)=>e.concat(Object.keys(r)),[]),t=new Set(r);return e.every(e=>t.size===Object.keys(e).length)}(e,n)?s=_t(s,e):s[t]=r({sx:n,theme:i})}else s=_t(s,e(t,n,i,a))}),Ht(l,s)}return Array.isArray(n)?n.map(l):l(n)}}();No.filterProps=["sx"];var zo=No;const Bo=["breakpoints","palette","spacing","shape"];function Lo(e={},...r){const{breakpoints:t={},palette:o={},spacing:n,shape:i={}}=e,a=zt(e,Bo),l=function(e){const{values:r={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:t="px",step:o=5}=e,n=zt(e,Bt),i=(e=>{const r=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return r.sort((e,r)=>e.val-r.val),r.reduce((e,r)=>vr({},e,{[r.key]:r.val}),{})})(r),a=Object.keys(i);function l(e){return`@media (min-width:${"number"==typeof r[e]?r[e]:e}${t})`}function s(e){return`@media (max-width:${("number"==typeof r[e]?r[e]:e)-o/100}${t})`}function c(e,n){const i=a.indexOf(n);return`@media (min-width:${"number"==typeof r[e]?r[e]:e}${t}) and (max-width:${(-1!==i&&"number"==typeof r[a[i]]?r[a[i]]:n)-o/100}${t})`}return vr({keys:a,values:i,up:l,down:s,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):l(e)},not:function(e){const r=a.indexOf(e);return 0===r?l(a[1]):r===a.length-1?s(a[r]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:t},n)}(t),s=function(e=8){if(e.mui)return e;const r=so({spacing:e}),t=(...e)=>("production"!==process.env.NODE_ENV&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(0===e.length?[1]:e).map(e=>{const t=r(e);return"number"==typeof t?`${t}px`:t}).join(" "));return t.mui=!0,t}(n);let c=kr({breakpoints:l,direction:"ltr",components:{},palette:vr({mode:"light"},o),spacing:s,shape:vr({},Lt,i)},a);return c=r.reduce((e,r)=>kr(e,r),c),c.unstable_sxConfig=vr({},Po,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return zo({sx:e,theme:this})},c}const Wo=Lo(),_o=["sx"];function qo(e){var r,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(t=qo(e[r]))&&(o&&(o+=" "),o+=t);else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Uo(){for(var e,r,t=0,o="";t<arguments.length;)(e=arguments[t++])&&(r=qo(e))&&(o&&(o+=" "),o+=r);return o}const Ko=["variant"];function Xo(e){return 0===e.length}function Ho(e){const{variant:r}=e,t=zt(e,Ko);let o=r||"";return Object.keys(t).sort().forEach(r=>{o+="color"===r?Xo(o)?e[r]:Ft(e[r]):`${Xo(o)?r:Ft(r)}${Ft(e[r].toString())}`}),o}const Go=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Jo(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const Qo=Lo();function Zo({defaultTheme:e,theme:r,themeId:t}){return 0===Object.keys(r).length?e:r[t]||r}const en=function(e={}){const{themeId:r,defaultTheme:t=Qo,rootShouldForwardProp:o=Jo,slotShouldForwardProp:n=Jo}=e,i=e=>zo(vr({},e,{theme:Zo(vr({},e,{defaultTheme:t,themeId:r}))}));return i.__mui_systemSx=!0,(e,a={})=>{(e=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=e.__emotion_styles.filter(e=>!(null!=e&&e.__mui_systemSx)))})(e);const{name:l,slot:s,skipVariantsResolver:c,skipSx:d,overridesResolver:u}=a,p=zt(a,Go),m=void 0!==c?c:s&&"Root"!==s||!1,f=d||!1;let h;var g;"production"!==process.env.NODE_ENV&&l&&(h=`${l}-${g=s||"Root",g.charAt(0).toLowerCase()+g.slice(1)}`);let y=Jo;"Root"===s?y=o:s?y=n:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(y=void 0);const b=function(e,r){const t=he(e,r);return"production"!==process.env.NODE_ENV?(...r)=>{const o="string"==typeof e?`"${e}"`:"component";return 0===r.length?console.error([`MUI: Seems like you called \`styled(${o})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join("\n")):r.some(e=>void 0===e)&&console.error(`MUI: the styled(${o})(...args) API requires all its args to be defined.`),t(...r)}:t}(e,vr({shouldForwardProp:y,label:h},p)),x=(o,...n)=>{const a=n?n.map(e=>"function"==typeof e&&e.__emotion_real!==e?o=>e(vr({},o,{theme:Zo(vr({},o,{defaultTheme:t,themeId:r}))})):e):[];let c=o;l&&u&&a.push(e=>{const o=Zo(vr({},e,{defaultTheme:t,themeId:r})),n=((e,r)=>r.components&&r.components[e]&&r.components[e].styleOverrides?r.components[e].styleOverrides:null)(l,o);if(n){const r={};return Object.entries(n).forEach(([t,n])=>{r[t]="function"==typeof n?n(vr({},e,{theme:o})):n}),u(e,r)}return null}),l&&!m&&a.push(e=>{const o=Zo(vr({},e,{defaultTheme:t,themeId:r}));return((e,r,t,o)=>{var n,i;const{ownerState:a={}}=e,l=[],s=null==t||null==(n=t.components)||null==(i=n[o])?void 0:i.variants;return s&&s.forEach(t=>{let o=!0;Object.keys(t.props).forEach(r=>{a[r]!==t.props[r]&&e[r]!==t.props[r]&&(o=!1)}),o&&l.push(r[Ho(t.props)])}),l})(e,((e,r)=>{let t=[];r&&r.components&&r.components[e]&&r.components[e].variants&&(t=r.components[e].variants);const o={};return t.forEach(e=>{const r=Ho(e.props);o[r]=e.style}),o})(l,o),o,l)}),f||a.push(i);const d=a.length-n.length;if(Array.isArray(o)&&d>0){const e=new Array(d).fill("");c=[...o,...e],c.raw=[...o.raw,...e]}else"function"==typeof o&&o.__emotion_real!==o&&(c=e=>o(vr({},e,{theme:Zo(vr({},e,{defaultTheme:t,themeId:r}))})));const p=b(c,...a);if("production"!==process.env.NODE_ENV){let r;l&&(r=`${l}${s||""}`),void 0===r&&(r=`Styled(${function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return At(e,"Component");if("object"==typeof e)switch(e.$$typeof){case Vt.ForwardRef:return Rt(e,e.render,"ForwardRef");case Vt.Memo:return Rt(e,e.type,"memo");default:return}}}(e)})`),p.displayName=r}return e.muiName&&(p.muiName=e.muiName),p};return b.withConfig&&(x.withConfig=b.withConfig),x}}();var rn=en;function tn(e){const{theme:r,name:t,props:o}=e;return r&&r.components&&r.components[t]&&r.components[t].defaultProps?$t(r.components[t].defaultProps,o):o}const on=["component","direction","spacing","divider","children","className","useFlexGap"],nn=Lo(),an=rn("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,r)=>r.root});function ln(e){return function({props:e,name:r,defaultTheme:t,themeId:o}){let n=function(e=Wo){return function(e=null){const r=X.useContext(ge);return r&&0!==Object.keys(r).length?r:e}(e)}(t);return o&&(n=n[o]||n),tn({theme:n,name:r,props:e})}({props:e,name:"MuiStack",defaultTheme:nn})}function sn(e,r){const t=X.Children.toArray(e).filter(Boolean);return t.reduce((e,o,n)=>(e.push(o),n<t.length-1&&e.push(/*#__PURE__*/X.cloneElement(r,{key:`separator-${n}`})),e),[])}const cn=({ownerState:e,theme:r})=>{let t=vr({display:"flex",flexDirection:"column"},Kt({theme:r},Gt({values:e.direction,breakpoints:r.breakpoints.values}),e=>({flexDirection:e})));if(e.spacing){const o=so(r),n=Object.keys(r.breakpoints.values).reduce((r,t)=>(("object"==typeof e.spacing&&null!=e.spacing[t]||"object"==typeof e.direction&&null!=e.direction[t])&&(r[t]=!0),r),{}),i=Gt({values:e.direction,base:n}),a=Gt({values:e.spacing,base:n});"object"==typeof i&&Object.keys(i).forEach((e,r,t)=>{i[e]||(i[e]=r>0?i[t[r-1]]:"column")}),t=kr(t,Kt({theme:r},a,(r,t)=>{return e.useFlexGap?{gap:co(o,r)}:{"& > :not(style) + :not(style)":{margin:0,[`margin${n=t?i[t]:e.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[n]}`]:co(o,r)}};var n}))}return t=function(e,...r){const t=Xt(e),o=[t,...r].reduce((e,r)=>kr(e,r),{});return Ht(Object.keys(t),o)}(r.breakpoints,t),t},dn=function(e={}){const{createStyledComponent:t=an,useThemeProps:o=ln,componentName:n="MuiStack"}=e,i=t(cn),a=/*#__PURE__*/X.forwardRef(function(e,t){const a=function(e){const{sx:r}=e,t=zt(e,_o),{systemProps:o,otherProps:n}=(e=>{var r,t;const o={systemProps:{},otherProps:{}},n=null!=(r=null==e||null==(t=e.theme)?void 0:t.unstable_sxConfig)?r:Po;return Object.keys(e).forEach(r=>{n[r]?o.systemProps[r]=e[r]:o.otherProps[r]=e[r]}),o})(t);let i;return i=Array.isArray(r)?[o,...r]:"function"==typeof r?(...e)=>{const t=r(...e);return Cr(t)?vr({},o,t):o}:vr({},o,r),vr({},n,{sx:i})}(o(e)),{component:l="div",direction:s="column",spacing:c=0,divider:d,children:u,className:p,useFlexGap:m=!1}=a,f=zt(a,on),h={direction:s,spacing:c,useFlexGap:m},g=function(e,r,t){const o={};return Object.keys(e).forEach(r=>{o[r]=e[r].reduce((e,r)=>{if(r){const o=(e=>function(e,r,t="Mui"){const o=Nt[r];return o?`${t}-${o}`:`${Pt.generate(e)}-${r}`}(n,e))(r);""!==o&&e.push(o),t&&t[r]&&e.push(t[r])}return e},[]).join(" ")}),o}({root:["root"]},0,{});/*#__PURE__*/
2
+ return r(i,vr({as:l,ownerState:h,ref:t,className:Uo(g.root,p)},f,{children:d?sn(u,d):u}))});return"production"!==process.env.NODE_ENV&&(a.propTypes={children:mt.node,direction:mt.oneOfType([mt.oneOf(["column-reverse","column","row-reverse","row"]),mt.arrayOf(mt.oneOf(["column-reverse","column","row-reverse","row"])),mt.object]),divider:mt.node,spacing:mt.oneOfType([mt.arrayOf(mt.oneOfType([mt.number,mt.string])),mt.number,mt.object,mt.string]),sx:mt.oneOfType([mt.arrayOf(mt.oneOfType([mt.func,mt.object,mt.bool])),mt.func,mt.object])}),a}();"production"!==process.env.NODE_ENV&&(dn.propTypes={children:mt.node,component:mt.elementType,direction:mt.oneOfType([mt.oneOf(["column-reverse","column","row-reverse","row"]),mt.arrayOf(mt.oneOf(["column-reverse","column","row-reverse","row"])),mt.object]),divider:mt.node,spacing:mt.oneOfType([mt.arrayOf(mt.oneOfType([mt.number,mt.string])),mt.number,mt.object,mt.string]),sx:mt.oneOfType([mt.arrayOf(mt.oneOfType([mt.func,mt.object,mt.bool])),mt.func,mt.object]),useFlexGap:mt.bool});var un=dn;function pn(t){return r(m,{...t,children:e("svg",{width:"26",height:"34",viewBox:"0 0 26 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r("path",{d:"M24.9717 11.5L14.8333 1.36165C14.5757 1.10371 14.2262 0.958634 13.8617 0.958313H5.66667C4.32953 0.958313 3.04717 1.48949 2.10167 2.43498C1.15617 3.38048 0.625 4.66285 0.625 5.99998V28C0.625 29.3371 1.15617 30.6195 2.10167 31.565C3.04717 32.5105 4.32953 33.0416 5.66667 33.0416H20.3333C21.6705 33.0416 22.9528 32.5105 23.8983 31.565C24.8438 30.6195 25.375 29.3371 25.375 28V12.4166C25.3606 12.0713 25.2166 11.744 24.9717 11.5ZM15.2917 5.65165L20.6817 11.0416H15.2917V5.65165ZM20.3333 30.2916H5.66667C5.05888 30.2916 4.47598 30.0502 4.04621 29.6204C3.61644 29.1907 3.375 28.6078 3.375 28V5.99998C3.375 5.39219 3.61644 4.8093 4.04621 4.37953C4.47598 3.94976 5.05888 3.70831 5.66667 3.70831H12.5417V12.4166C12.5464 12.7798 12.6928 13.1268 12.9496 13.3837C13.2065 13.6405 13.5535 13.7869 13.9167 13.7916H22.625V28C22.625 28.6078 22.3836 29.1907 21.9538 29.6204C21.524 30.0502 20.9411 30.2916 20.3333 30.2916Z",fill:"#fff"}),r("path",{d:"M15.7317 22.225C14.6044 21.5176 13.756 20.4425 13.33 19.1817C13.7248 18.0021 13.8439 16.7478 13.6784 15.515C13.6255 15.2044 13.474 14.9191 13.2464 14.7013C13.0187 14.4835 12.727 14.3448 12.4144 14.3058C12.1018 14.2667 11.7849 14.3293 11.5107 14.4844C11.2364 14.6394 11.0194 14.8786 10.8917 15.1667C10.683 16.6487 10.8403 18.1594 11.35 19.5667C10.6537 21.1933 9.87664 22.7842 9.02169 24.3333C7.72002 25.0667 5.94169 26.1667 5.66669 27.4317C5.44669 28.4583 7.37169 31.0983 10.6534 25.3783C12.1126 24.8366 13.6072 24.3956 15.1267 24.0583C16.2499 24.7005 17.5029 25.0827 18.7934 25.1767C19.0897 25.1843 19.3816 25.1043 19.6325 24.9465C19.8835 24.7887 20.0822 24.5603 20.2036 24.2899C20.3251 24.0195 20.3639 23.7193 20.3152 23.4269C20.2666 23.1345 20.1325 22.8631 19.93 22.6467C19.16 21.8583 16.8684 22.0783 15.7317 22.225ZM6.96836 27.725C7.48213 26.8458 8.16063 26.0739 8.96669 25.4517C7.72002 27.4317 6.96836 27.78 6.96836 27.7433V27.725ZM12.3217 15.24C12.7984 15.24 12.7617 17.3483 12.4317 17.9167C12.1831 17.0521 12.1454 16.1405 12.3217 15.2583V15.24ZM10.7267 24.1867C11.3478 23.0533 11.887 21.877 12.34 20.6667C12.8257 21.5704 13.5012 22.3585 14.32 22.9767C13.09 23.2848 11.888 23.6956 10.7267 24.205V24.1867ZM19.3434 23.8567C19.3434 23.8567 19.0134 24.26 16.905 23.3433C19.1967 23.1967 19.5817 23.7283 19.3434 23.875V23.8567Z",fill:"#fff"})]})})}function mn(t){return r(m,{...t,children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r("path",{d:"M20 8.70001H4C3.90151 8.70001 3.80398 8.68061 3.71299 8.64292C3.62199 8.60523 3.53931 8.54999 3.46967 8.48034C3.40003 8.4107 3.34478 8.32802 3.30709 8.23703C3.2694 8.14603 3.25 8.0485 3.25 7.95001C3.25 7.85152 3.2694 7.75399 3.30709 7.663C3.34478 7.57201 3.40003 7.48933 3.46967 7.41968C3.53931 7.35004 3.62199 7.29479 3.71299 7.2571C3.80398 7.21941 3.90151 7.20001 4 7.20001H20C20.1989 7.20001 20.3897 7.27903 20.5303 7.41968C20.671 7.56033 20.75 7.7511 20.75 7.95001C20.75 8.14892 20.671 8.33969 20.5303 8.48034C20.3897 8.621 20.1989 8.70001 20 8.70001Z",fill:"white"}),r("path",{d:"M16.44 20.75H7.56C7.24309 20.7717 6.92503 20.7302 6.62427 20.628C6.3235 20.5259 6.04601 20.365 5.80788 20.1548C5.56975 19.9446 5.37572 19.6891 5.23704 19.4034C5.09836 19.1176 5.01779 18.8071 5 18.49V7.99998C5 7.80107 5.07902 7.61031 5.21967 7.46965C5.36032 7.329 5.55109 7.24998 5.75 7.24998C5.94891 7.24998 6.13968 7.329 6.28033 7.46965C6.42098 7.61031 6.5 7.80107 6.5 7.99998V18.49C6.5 18.9 6.97 19.25 7.5 19.25H16.38C16.94 19.25 17.38 18.9 17.38 18.49V7.99998C17.38 7.78516 17.4653 7.57913 17.6172 7.42723C17.7691 7.27532 17.9752 7.18998 18.19 7.18998C18.4048 7.18998 18.6109 7.27532 18.7628 7.42723C18.9147 7.57913 19 7.78516 19 7.99998V18.49C18.9822 18.8071 18.9016 19.1176 18.763 19.4034C18.6243 19.6891 18.4303 19.9446 18.1921 20.1548C17.954 20.365 17.6765 20.5259 17.3757 20.628C17.075 20.7302 16.7569 20.7717 16.44 20.75ZM16.56 7.74998C16.4611 7.75133 16.363 7.73285 16.2714 7.69563C16.1798 7.65842 16.0966 7.60323 16.0267 7.53331C15.9568 7.4634 15.9016 7.38018 15.8644 7.28858C15.8271 7.19698 15.8087 7.09885 15.81 6.99998V5.50998C15.81 5.09999 15.33 4.74998 14.81 4.74998H9.22C8.67 4.74998 8.22 5.09999 8.22 5.50998V6.99998C8.22 7.1989 8.14098 7.38966 8.00033 7.53031C7.85968 7.67097 7.66891 7.74998 7.47 7.74998C7.27109 7.74998 7.08032 7.67097 6.93967 7.53031C6.79902 7.38966 6.72 7.1989 6.72 6.99998V5.50998C6.75872 4.8813 7.04203 4.29275 7.50929 3.87035C7.97655 3.44795 8.5906 3.22527 9.22 3.24998H14.78C15.4145 3.21717 16.0362 3.4362 16.51 3.85944C16.9838 4.28267 17.2713 4.87586 17.31 5.50998V6.99998C17.3113 7.09931 17.2929 7.19792 17.2558 7.29007C17.2187 7.38222 17.1637 7.46608 17.0939 7.53679C17.0241 7.6075 16.941 7.66364 16.8493 7.70195C16.7577 7.74027 16.6593 7.75999 16.56 7.75998V7.74998Z",fill:"white"}),r("path",{d:"M10.22 17C10.0219 16.9974 9.8326 16.9175 9.6925 16.7774C9.55241 16.6373 9.47256 16.4481 9.46997 16.25V11.72C9.46997 11.5211 9.54899 11.3303 9.68964 11.1896C9.83029 11.049 10.0211 10.97 10.22 10.97C10.4189 10.97 10.6096 11.049 10.7503 11.1896C10.891 11.3303 10.97 11.5211 10.97 11.72V16.24C10.9713 16.3393 10.9529 16.4379 10.9158 16.5301C10.8787 16.6222 10.8236 16.7061 10.7539 16.7768C10.6841 16.8475 10.601 16.9036 10.5093 16.9419C10.4177 16.9803 10.3193 17 10.22 17Z",fill:"white"}),r("path",{d:"M13.78 17C13.5811 17 13.3904 16.921 13.2497 16.7803C13.109 16.6396 13.03 16.4489 13.03 16.25V11.72C13.03 11.5211 13.109 11.3303 13.2497 11.1896C13.3904 11.049 13.5811 10.97 13.78 10.97C13.9789 10.97 14.1697 11.049 14.3104 11.1896C14.451 11.3303 14.53 11.5211 14.53 11.72V16.24C14.53 16.4398 14.4513 16.6316 14.311 16.7739C14.1706 16.9161 13.9799 16.9973 13.78 17Z",fill:"white"})]})})}function fn(e){const r=1048576;return e<r?`${(e/1024).toFixed(1)}KB`:`${(e/r).toFixed(1)}MB`}function hn({name:t="filesUid",tipoArquivo:a,title:c,required:d=!1,multiple:p=!1,apiURL:m,sizeLimit:g=4,xs:y=12,sm:b,md:x,route:v="",tstToken:C="",dropZoneOptions:w,disabled:k=!1}){const{getRootProps:E,getInputProps:S}=fe({disabled:k,multiple:p,useFsAccessApi:!0,onDrop:e=>{O(-1),e.filter(e=>!(e.size/1048576>g&&(P(`Por favor, escolha um arquivo com tamanho inferior a ${g} MB`),setTimeout(()=>{P("")},3e3),1))).forEach((e,r)=>{let t=Date.now()+r;const o=new FormData;o.append("files",e),o.append("tipoArquivo",a),me.post(m,o,{onUploadProgress:r=>{const o=Math.round(100*r.loaded/r.total);O(o),o>=100&&T(r=>[...r,{id:t,name:e.name,loading:!0,error:!1,file:e,size:e.size}])},headers:{Authorization:`Bearer ${""===C?I?I.token:"":C}`}}).then(e=>{if(e.status>200){const r=oe(e.data,v,e.data)[0].coSeqArquivo;D.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:r,CO_TIPO_ARQUIVO:parseInt(a)}]),R(e=>[...e,t]);const o={};o[t]=r,$(e=>({...e,...o}))}else O(-1),z(t)}).catch(e=>{console.log(e),O(-1),z(t)})})},...w||{}}),D=J(dr),{user:I}=J(sr),Y=s();f(Y.breakpoints.only("xs"));const[M,O]=Z(-1),[V,T]=Z([]),[A,R]=Z([]),[F,$]=Z({}),[j,P]=Z(""),z=(e,r,t)=>{T(V.filter(r=>r.id!==e)),t&&D.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==t)),r||(P("Erro ao enviar arquivo. Verifique o formato e tente mais tarde."),setTimeout(()=>{P("")},3e3))};return ee(()=>{if(m){const e=V.filter(e=>void 0!==F[e.id]).map(e=>({CO_SEQ_ARQUIVO:F[e.id],CO_TIPO_ARQUIVO:parseInt(a)}));D?.formSetValue(t,e)}else{const e=new DataTransfer;V.forEach(r=>{e.items.add(r.file)}),D?.formSetValue(t,e.files)}},[V,D,t,F,m,a]),ee(()=>()=>{D.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(a)))},[]),r(o,{item:!0,xs:y,sm:b,md:x,sx:{width:"100%",opacity:k?.5:1,pointerEvents:k?"none":"auto"},children:e(i,{bgcolor:"white",p:2,borderRadius:"8px",color:"#1E293B",children:[r(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(un,{...E({className:"dropzone"}),bgcolor:"#EFEFEF",justifyContent:"center",alignItems:"center",textAlign:"center",borderRadius:"6px",py:8,border:"solid 1.5px #989898",sx:{borderStyle:"dashed",cursor:"pointer"},children:[r("input",{...S(),...D.formRegister(t,{validate:(e,r)=>{if(d&&(null==e||Array.isArray(e)&&0===e.length))return"O campo de arquivo é obrigatório"}})}),e(un,{spacing:2,alignItems:"center",children:[e(i,{children:[r(n,{fontWeight:600,fontSize:18,children:"Arraste seus arquivos até aqui"}),r(n,{children:"ou selecione arquivos que estão no seu computador"})]}),r(l,{variant:"contained",sx:{backgroundColor:"#64748B",pointerEvents:"none",borderRadius:"8px",width:"fit-content"},disabled:k,children:"Selecionar"}),e(n,{fontWeight:300,children:["Tamanho máximo por arquivo ",g,"MB"]})]})]}),e(n,{pt:2,fontSize:16,fontWeight:600,children:["Você selecionou ",V.length," arquivo",V.length>1?"s":"","."]}),e(un,{width:"100%",marginTop:1,spacing:1,children:[V.map(t=>e(un,{direction:"row",justifyContent:"space-between",border:"solid 1px #E2E8F0",borderRadius:2,p:1,children:[e(un,{direction:"row",children:[r(un,{direction:"row",justifyContent:"center",alignItems:"center",minWidth:30,pr:1.5,children:r(pn,{sx:{filter:"invert(42%) sepia(86%) saturate(2412%) hue-rotate(326deg) brightness(86%) contrast(102%)",transform:"scale(1.5)",width:30}})}),e(un,{children:[r(n,{fontWeight:600,children:t.name}),r(n,{fontSize:14,children:fn(t.size)})]})]}),r(l,{size:"small",startIcon:r(mn,{}),variant:"contained",onClick:e=>{return r=t.id,void(Object.keys(F).includes(r.toString())&&fetch(`${m}/${F[r]}`,{method:"DELETE",headers:{Authorization:`Bearer ${""===C?I?I.token:"":C}`}}).then(e=>{e.ok||z(r,!0,F[r]),200===e.status&&z(r,!0,F[r])}).catch(e=>console.log(e)));var r},sx:{height:40,backgroundColor:"#DE3F50",borderRadius:"8px"},disabled:k,children:"Remover"})]})),M>0&&M<100&&r(h,{value:M,sx:{backgroundColor:"#103D6A",".MuiLinearProgress-bar":{backgroundColor:"#BDDDFA"}}})]}),j&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"16px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(n,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:j})]}),oe(D?.errors,t)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(n,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:"O campo de arquivo é obrigatório"})]})]})})}function gn({name:t,tipoArquivo:a,title:c,required:d=!1,multiple:p=!1,apiURL:m,route:h="",sizeLimit:x=4,xs:v=12,sm:C,md:w}){const k=J(dr),{user:E}=J(sr),S=s(),D=f(S.breakpoints.only("xs")),[I,Y]=Z([]),[M,O]=Z([]),[V,T]=Z({}),[A,R]=Z(""),F=Q(e=>{const r=e.target.files,t=Object.keys(r).map(e=>r[e]);Y([...I,...t.filter(e=>!(e.size/1048576>x&&(R(`Por favor, escolha um arquivo com tamanho inferior a ${x} MB`),setTimeout(()=>{R("")},3e3),1))).map((e,r)=>{let t=Date.now()+r;const o=new FormData;return o.append("files",e),o.append("tipoArquivo",a),fetch(m,{method:"POST",body:o,headers:{Authorization:`Bearer ${E?E.token:""}`}}).then(e=>{e.ok?e.json().then(e=>{if(e.status&&200===e.status.status){const r=oe(e,h,e)[0].coSeqArquivo;k.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:r,CO_TIPO_ARQUIVO:parseInt(a)}]),O(e=>[...e,t]);const o={};o[t]=r,T(e=>({...e,...o}))}else $(t)}):$(t)}).catch(e=>{$(t)}),{id:t,name:e.name,loading:!0,error:!1,file:e}})])},[I,k]),$=(e,r,t)=>{Y(I.filter(r=>r.id!==e)),t&&k.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==t)),r||(R("Erro ao enviar arquivo. Tente novamente mais tarde"),setTimeout(()=>{R("")},3e3))};return ee(()=>{const e=new DataTransfer;I.forEach(r=>{e.items.add(r.file)}),k?.formSetValue(t,e.files)},[I,k,t]),ee(()=>()=>{k.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(a)))},[]),e(o,{item:!0,xs:v,sm:C,md:w,sx:{width:"100%"},children:[r(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(i,{sx:{backgroundColor:"#e2eafc",padding:1,borderRadius:1,marginTop:1},children:[r("input",{id:t,type:"file",multiple:p,...k?.formRegister(t,{validate:(e,r)=>{if((e.length&&M.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:F,accept:".pdf",style:{display:"none"}}),r("input",{id:t+"foto",type:"file",capture:"environment",multiple:p,...k?.formRegister(t,{validate:(e,r)=>{if((e.length&&M.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:F,accept:".jpg, .png, .jpeg",style:{display:"none"}}),e(i,{sx:{display:{sx:"block",md:"flex"}},children:[r(i,{sx:{width:"100%",marginRight:{xs:0,md:1},marginBottom:{xs:1,md:0}},children:!p&&I.length>=1?r(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:r(ve,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"}):r("label",{htmlFor:t,children:r(l,{variant:"contained",disableElevation:!0,startIcon:r(ve,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"})})}),r(i,{sx:{width:"100%"},children:!p&&I.length>=1?r(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:r(ye,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:D?"Tirar Foto":"Escolher Imagem"}):r("label",{htmlFor:t+"foto",children:r(l,{variant:"contained",disableElevation:!0,startIcon:r(ye,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:D?"Tirar Foto":"Escolher Imagem"})})})]}),e(n,{fontWeight:600,paddingY:1,color:"black",children:["Você selecionou ",I.length," arquivo",I.length>1&&"s"]}),I.length>0&&r(g,{component:y,children:r(un,{direction:"column",children:I.map(t=>e(un,{direction:"row",justifyContent:"space-between",padding:.5,children:[r(i,{children:e(un,{direction:"row",spacing:2,children:[M.includes(t.id)?r(xe,{sx:{fill:"#06d6a0"}}):r(b,{size:22,sx:{color:"black"}}),r(Ce,{color:"error"}),r(n,{fontWeight:600,children:t.name})]})}),r(i,{children:M.includes(t.id)&&r(l,{variant:"contained",size:"small",sx:{textTransform:"none",backgroundColor:"#d1495b","&:hover":{backgroundColor:"#c1121f"}},onClick:e=>{return r=t.id,void(Object.keys(V).includes(r.toString())&&fetch(`${m}/${V[r]}`,{method:"DELETE",headers:{Authorization:`Bearer ${E?.token}`}}).then(e=>{e.ok||$(r,!0,V[r]),200===e.status&&$(r,!0,V[r])}).catch(e=>console.log(e)));var r},startIcon:r(be,{}),children:"Remover"})})]},t.name))})}),A&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"16px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(n,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:A})]}),oe(k?.errors,t)&&e(i,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),r(n,{variant:"caption",color:"inherit",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})]})]})}function yn({defaultChecked:t=!1,...o}){const i=J(dr);ee(()=>{i?.formSetValue(o.name,t)},[]);const l=re(()=>o.overrideYes||"Sim",[o.overrideYes]),s=re(()=>o.overrideNo||"Não",[o.overrideNo]);return e(a,{sx:{alignItems:"center",justifyContent:"center"},children:[o.title&&r(u,{children:o.title}),r(x,{control:r(v,{defaultChecked:t,...i?.formRegister(o.name)}),label:r(n,{width:25,sx:{userSelect:"none",fontWeight:600},children:i?.formWatch(o.name)?l:s}),sx:{paddingLeft:1}})]})}var bn=/*#__PURE__*/H.memo(yn);function xn({invert:e=!1,hasCheckValue:o=!1,...n}){const i=J(dr);return ee(()=>()=>{(o?e:i.formWatch(n.switchId)===e)&&n.unregisterNameList.forEach(e=>i.formUnregister(e))},[n.unregisterNameList]),r(t,{})}function vn({invert:o=!1,checkValue:n,...i}){const a=J(dr);return r(t,{children:(n?a?.formWatch(i.switchId)===n!==o:a?.formWatch(i.switchId)!==o)&&e(t,{children:[r(xn,{switchId:i.switchId,unregisterNameList:i.unregisterNameList,hasCheckValue:!!n,invert:n?a?.formWatch(i.switchId)===n!==o:o}),i.children]})})}const Cn=/*#__PURE__*/H.forwardRef(function(e,t){const{onChange:o,onMask:n,maskValue:i,setMaskValue:a,watchValue:l,imaskConfig:s,...c}=e,[d,u]=Z(s.mask);delete c.value;const p=te(null),[m,f]=Z(""),h=J(dr);return ee(()=>{l&&f(l)},[l]),ee(()=>{h.formSetValue(c.name,p.current.element.value)},[m]),delete c.watchValue,r(ke,{...c,mask:d,value:m,ref:p,inputRef:t,onChange:e=>{},onAccept:(e,r)=>{f(e),r.updateValue(),n&&n(e,u)},...s})});function wn(e){const o=J(dr),[n,i]=Z("");return r(t,{children:r(p,{...e.formConfig,onInput:r=>{o.formSetValue(e.formConfig.name,r.target.value)},InputProps:{inputComponent:Cn,inputProps:{onMask:e.onMask,maskValue:n,setMaskValue:i,watchValue:e.watchValue,imaskConfig:e.imaskConfig}},disabled:e.disabled,fullWidth:!0})})}function kn({type:t="input",numberMask:n="000000000000000",xs:a=12,sm:l,inputMinLength:s=1,inputMaxLength:c=255,defaultValue:d="",md:m,disabled:f=!1,watchValue:h,...g}){const y=J(dr);return ee(()=>{void 0!==h&&y.formSetValue(g.name,h)},[h]),e(o,{item:!0,xs:a,sm:l,md:m,children:[g.title&&r(u,{htmlFor:"campo",required:g.required,sx:{mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:g.title}),(()=>{const o={fullWidth:!0,size:"small",placeholder:g.customPlaceholder?g.customPlaceholder:g.title},a=g.name,l=oe(y?.errors,g.name);let u=l?.message;const m=!!l;m&&(u=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),u]}));const b={...y?.formRegister(a,{validate:(e,r)=>{const o=e??"";if(o.length<=0&&g.required)return"Este campo é obrigatório";if(g.customValidate){const e=g.customValidate(o,r);if(e)return e}if("cnpj"===t){if(o.length<18&&g.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===t){if(o.length<14&&g.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===t){if(o.length<22&&g.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===t){if(o.length<9&&g.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===t||"password"===t||"number"===t){if(o.length>c)return`Limite máximo de ${c} caracteres`;if(o.length<s&&g.required)return`Limite mínimo de ${s} caracteres`}else if("email"===t){if(o.length>50)return"Limite máximo de 50 caracteres";if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(e)&&g.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===t){if((o.length<14||o.length>14&&o.length<18)&&g.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===t&&o.length<14&&g.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:m,helperText:u,...o,FormHelperTextProps:{sx:{backgroundColor:m?"#FFEBEE":"transparent",borderRadius:"8px",padding:m?"8px 12px":0,marginBottom:m?"4px":0,marginTop:m?"8px":0,border:m?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}},sx:{backgroundColor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}}};switch(t){case"input":case"email":return r(p,{...b,defaultValue:d,disabled:f});case"password":return r(p,{...b,type:"password",disabled:f});case"number":return r(wn,{formConfig:b,defaultValue:d,imaskConfig:{mask:n},watchValue:h,disabled:f});case"cep":return r(wn,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00000-000"},watchValue:h,disabled:f});case"phone":return r(wn,{formConfig:b,defaultValue:d,imaskConfig:{mask:"(00) [9]0000-0000"},watchValue:h,disabled:f});case"sei":return r(wn,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00000-00000000/0000-00"},watchValue:h,disabled:f});case"cpf_cnpj":return r(wn,{formConfig:b,defaultValue:d,imaskConfig:{mask:[{mask:"000.000.000-00"},{mask:"00.000.000/0000-00"}],dispatch:(e,r)=>(r.value+e).replace(/\D/g,"").length>11?r.compiledMasks[1]:r.compiledMasks[0]},watchValue:h,disabled:f});case"cpf":return r(wn,{formConfig:b,defaultValue:d,imaskConfig:{mask:"000.000.000-00"},watchValue:h,disabled:f});case"cnpj":return r(wn,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00.000.000/0000-00"},watchValue:h,disabled:f});case"rg":return r(wn,{formConfig:b,defaultValue:d,imaskConfig:{mask:"00000[000000]"},watchValue:h,disabled:f})}})()]})}var En=/*#__PURE__*/H.memo(kn);function Sn({name:t,required:n=!1,title:i,defaultChecked:l=!1,xs:s=12,unregisterNameList:c,sm:d,md:u,...p}){const m=`${t}-switch`;return e(o,{item:!0,xs:s,sm:d,md:u,children:[i&&r(we,{required:n,sx:{textTransform:"capitalize"},children:i}),e(a,{direction:"row",children:[r(bn,{name:m,defaultChecked:l}),r(vn,{switchId:m,unregisterNameList:c,children:r(kn,{name:"ddd",type:"input"})})]})]})}function Dn({name:t,required:n=!1,title:i,customPlaceholder:a,url:l,xs:s=12,sm:c,md:d,dataPath:u=""}){const m=J(dr),{user:f}=J(sr),[h,g]=Z([]);Ee(`autocomplete-${t}`,()=>fetch(l,{headers:{Authorization:`Bearer ${f?f.token:""}`}}).then(e=>e.json().then(e=>g(y(e)))));const y=Q(e=>Array.isArray(e)?e:"object"==typeof e?oe(e,u):void 0,[]),b=Q((e,r)=>{m?.formSetValue(t,r?r.id:""),m?.formTrigger(t)},[m,t]);return e(o,{item:!0,xs:s,sm:c,md:d,children:[i&&r(we,{required:n,children:i}),r("input",{type:"text",...m?.formRegister(t,{validate:(e,r)=>{if(e.length<=0&&n)return"Este campo é obrigatório"}}),hidden:!0}),r(C,{options:h,isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:b,renderInput:e=>r(p,{...e,placeholder:a,size:"small",error:!!oe(m?.errors,t),helperText:oe(m?.errors,t)?.message})})]})}let In=!0;function Yn({name:t,url:n,title:a,customLoadingText:l,shouldRefetch:s=!0,required:c=!1,defaultValue:d,route:m="",onChange:f=()=>{},xs:h=12,sm:g,watchValue:y,md:b,disabled:x=!1}){const v=J(dr),[w,k]=Z(!0),[E,S]=Z([]),[D,I]=Z("Carregando..."),[Y,M]=Z(null),[O,V]=Z(null),[T,A]=Z(null),{user:R}=J(sr),F=function(e,r,o=!1){try{return Promise.resolve(function(n,i){try{var a=(A(null),Promise.resolve(fetch(e,{method:"GET",headers:{Authorization:`Bearer ${R?.token}`}})).then(function(e){if(!e.ok){const r=401===e.status?"Sessão expirada. Faça login novamente.":403===e.status?"Acesso negado. Verifique suas permissões.":e.status>=500?"Erro interno do servidor. Tente novamente mais tarde.":"Erro ao carregar dados";return A(r),I(r),void k(!1)}return Promise.resolve(e.json()).then(function(e){const n=oe(e,r,e);if(o){const e=n.filter(e=>e.id===d);e.length>0?(S(n),k(!1),v.formSetValue(t,d),M(e[0])):(A("Valor padrão inválido"),I("Erro ao carregar dados. Valor inválido"),k(!1))}else S(n),k(!1)})}))}catch(e){return i(e)}return a&&a.then?a.then(void 0,i):a}(0,function(e){console.error("Network error:",e),A("Erro de conexão. Verifique sua internet e tente novamente."),I("Erro de conexão. Verifique sua internet e tente novamente."),k(!1)}))}catch(e){return Promise.reject(e)}};function $(){(d||!s)&&E.length>0||(k(!0),S([]),l&&I(l),F(n,m,!1))}return ee(()=>{d&&F(n,m,!0)},[]),ee(()=>{y&&In&&(V(y),v.formSetValue(t,y.id),f(y.id))},[y]),d&&E.length<=0&&!Y?r(o,{item:!0,xs:h,sm:g,md:b,children:r(p,{size:"small",fullWidth:!0,placeholder:D,disabled:!0})}):e(o,{item:!0,xs:h,sm:g,md:b,children:[a&&r(u,{required:c,children:a}),r("input",{type:"text",...v?.formRegister(t,{validate:(e,r)=>e?e.length<=0&&c?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),r(C,{value:O,loading:w,loadingText:D,options:E,defaultValue:Y,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:(e,r)=>function(e){if(In=!1,e)return V(e),v.formSetValue(t,e.id),void f(e.id);V(null),v.formSetValue(t,""),f(void 0)}(r),renderInput:o=>{const n=oe(v?.errors,t),l=!!n||!!T;let s=n?.message||T;return l&&(s=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),s]})),r(p,{...o,size:"small",fullWidth:!0,placeholder:a,onFocus:$,error:l,helperText:s,FormHelperTextProps:{sx:{backgroundColor:l?"#FFEBEE":"transparent",borderRadius:"8px",padding:l?"8px 12px":0,marginBottom:l?"4px":0,marginTop:l?"8px":0,border:l?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}}})},sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}},size:"small",fullWidth:!0,disabled:x})]})}let Mn=!0;function On({name:t,title:n,required:a=!1,list:l,defaultValue:s,onChange:c=()=>{},xs:d=12,sm:m,watchValue:f,forceUpdate:h=!1,md:g}){const y=J(dr),[b,x]=Z(null);return ee(()=>{s&&y?.formSetValue(t,s.id)},[]),ee(()=>{f&&(Mn||h)?(x(f),y.formSetValue(t,f.id),c(f.id)):void 0===f&&(Mn||h)&&(x(null),y.formSetValue(t,void 0),c(void 0))},[f]),e(o,{item:!0,xs:d,sm:m,md:g,children:[n&&r(u,{required:a,children:n}),r("input",{type:"text",...y?.formRegister(t,{validate:(e,r)=>e?e?.length<=0&&a?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),r(C,{value:b,options:l,defaultValue:s,getOptionLabel:e=>e.label?e.label.toString():"Não Encontrado",isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:(e,r)=>function(e){if(Mn=!1,e)return x(e),y.formSetValue(t,e.id),void c(e.id);x(null),y.formSetValue(t,""),c(void 0)}(r),renderInput:o=>{const a=oe(y?.errors,t),l=!!a;let s=a?.message;return l&&(s=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),s]})),r(p,{...o,size:"small",fullWidth:!0,placeholder:n,error:l,helperText:s,FormHelperTextProps:{sx:{backgroundColor:l?"#FFEBEE":"transparent",borderRadius:"8px",padding:l?"8px 12px":0,marginBottom:l?"4px":0,marginTop:l?"8px":0,border:l?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}}})},size:"small",sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}},fullWidth:!0})]})}let Vn=!0;function Tn({name:t,url:n,title:i,customLoadingText:a,shouldRefetch:l=!0,required:s=!1,defaultValue:c,route:d="",onChange:m=()=>{},xs:f=12,sm:h,watchValue:g,md:y,disabled:b=!1}){const x=de(),[v,w]=Z(!0),[k,E]=Z([]),[S,D]=Z("Carregando..."),[I,Y]=Z(null),[M,O]=Z(null),{user:V}=J(sr);function T(){(c||!l)&&k.length>0||(w(!0),E([]),a&&D(a),fetch(n,{method:"GET",headers:{Authorization:`Bearer ${V?.token}`}}).then(e=>{e.ok?e.json().then(e=>{E(oe(e,d,e)),w(!1)}):D("Erro ao carregar dados")}))}return ee(()=>{c&&fetch(n,{method:"GET",headers:{Authorization:`Bearer ${V?.token}`}}).then(e=>{e.ok?(console.log("llll"),e.json().then(e=>{let r=oe(e,d,e).filter(e=>e.id===c);r.length>0?(E(oe(e,d,e)),w(!1),x.setValue(t,c),Y(r[0])):D("Erro ao carregar dados. Valor inválido")})):D("Erro ao carregar dados")})},[]),ee(()=>{g&&Vn&&(O(g),x.setValue(t,g.id),m(g.id))},[g]),c&&k.length<=0&&!I?r(o,{item:!0,xs:f,sm:h,md:y,children:r(p,{size:"small",fullWidth:!0,placeholder:S,disabled:!0})}):e(o,{item:!0,xs:f,sm:h,md:y,children:[i&&r(u,{required:s,children:i}),r("input",{type:"text",...x?.register(t,{validate:(e,r)=>{if(e.length<=0&&s)return"Este campo é obrigatório"}}),hidden:!0}),r(C,{value:M,loading:v,loadingText:S,options:k,defaultValue:I,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,r)=>e.id===r.id,onChange:(e,r)=>function(e){if(Vn=!1,e)return O(e),x.setValue(t,e.id),void m(e.id);O(null),x.setValue(t,""),m(void 0)}(r),renderInput:e=>r(p,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:T,error:!!oe(x.formState.errors,t),helperText:oe(x.formState.errors,t)?.message}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}const An=/*#__PURE__*/H.forwardRef(function(e,t){const{onChange:o,maskProps:n,onMask:i,maskValue:a,setMaskValue:l,watchValue:s,...c}=e,[d,u]=Z(n.mask);delete c.value;const p=te(null),[m,f]=Z(""),h=de();return ee(()=>{s&&f(s)},[s]),ee(()=>{h.setValue(c.name,p.current.element.value)},[m]),delete c.watchValue,r(ke,{...c,...n,mask:d,value:m,ref:p,inputRef:t,onChange:e=>{},onAccept:(e,r)=>{f(e),r.updateValue(),i&&i(e,u)}})});function Rn(e){const o=J(dr),[n,i]=Z("");return r(t,{children:r(p,{...e.formConfig,onInput:r=>{o.formSetValue(e.formConfig.name,r.target.value)},InputProps:{inputComponent:An,inputProps:{maskProps:e.maskProps,onMask:e.onMask,maskValue:n,setMaskValue:i,watchValue:e.watchValue}},disabled:e.disabled,fullWidth:!0})})}function Fn({type:t="input",numberMask:n="000000000000000",xs:i=12,sm:a,inputMinLength:l=1,inputMaxLength:s=255,defaultValue:c="",md:d,disabled:m=!1,watchValue:f,...h}){const g=de();return ee(()=>{void 0!==f&&g.setValue(h.name,f)},[f]),e(o,{item:!0,xs:i,sm:a,md:d,children:[h.title&&r(u,{htmlFor:"campo",required:h.required,sx:{mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},o=h.name,i=oe(g?.formState.errors,h.name),a=i?.message,d=!!i,u={...g?.register(o,{validate:(e,r)=>{const o=e??"";if(o.length<=0&&h.required)return"Este campo é obrigatório";if("cnpj"===t){if(o.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===t){if(o.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===t){if(o.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===t){if(o.length<9&&h.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===t||"password"===t||"number"===t){if(o.length>s)return`Limite máximo de ${s} caracteres`;if(o.length<l&&h.required)return`Limite mínimo de ${l} caracteres`}else if("email"===t){if(o.length>50)return"Limite máximo de 50 caracteres";if(!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(e)&&h.required)return"O e-mail inserido não é valido"}else if("cpf_cnpj"===t){if((o.length<14||o.length>14&&o.length<18)&&h.required)return"O CPF/CNPJ precisa ter no mínimo 11/14 dígitos"}else if("phone"===t&&o.length<14&&h.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:d,helperText:a,...e,sx:{backgroundColor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px",transition:"all 0.2s","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"1px"}}}};switch(t){case"input":case"email":return r(p,{...u,defaultValue:c,disabled:m});case"password":return r(p,{...u,type:"password",disabled:m});case"number":return r(Rn,{formConfig:u,defaultValue:c,maskProps:{mask:n},watchValue:f,disabled:m});case"cep":return r(Rn,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-000"},watchValue:f,disabled:m});case"phone":return r(Rn,{formConfig:u,defaultValue:c,maskProps:{mask:"(00) [#]0000-0000",definitions:{"#":/^9$/}},watchValue:f,disabled:m});case"sei":return r(Rn,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:m});case"cpf_cnpj":return r(Rn,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00[0]"},onMask:(e,r)=>{r(e.length>14?"00.000.000/0000-00":"000.000.000-00[0]")},watchValue:f,disabled:m});case"cpf":return r(Rn,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00"},watchValue:f,disabled:m});case"cnpj":return r(Rn,{formConfig:u,defaultValue:c,maskProps:{mask:"00.000.000/0000-00"},watchValue:f,disabled:m});case"rg":return r(Rn,{formConfig:u,defaultValue:c,maskProps:{mask:"00000[000000]"},watchValue:f,disabled:m})}})()]})}var $n=/*#__PURE__*/H.memo(Fn);function jn({name:t,required:n=!1,title:i,customPlaceholder:a,defaultValue:l="",xs:s=12,sm:c,watchValue:d="",inputMinLength:u=3,inputMaxLength:m=255,md:f,...h}){const g=de();return ee(()=>{g.setValue(t,d)},[d]),e(o,{item:!0,xs:s,sm:c,md:f,children:[i&&r(we,{required:n,sx:{textTransform:"capitalize",mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:i}),r(p,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.register(t,{validate:(e,r)=>n&&e.length<=0?"Este campo é obrigatório":e.length>m?`Limite máximo de ${m} caracteres`:e.length<u&&n?`Limite mínimo de ${u} caracteres`:void 0}),error:!!oe(g.formState.errors,t),helperText:oe(g.formState.errors,t)?.message,sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"1px"}}},placeholder:a||i})]})}function Pn({name:t,required:n=!1,title:a,customPlaceholder:l,defaultValue:s="",xs:c=12,sm:d,watchValue:u="",inputMinLength:m=3,inputMaxLength:f=255,md:h,...g}){const y=J(dr);ee(()=>{y.formSetValue(t,u)},[u]);const b=oe(y.errors,t);let x=b?.message;const v=!!b;return v&&(x=e(i,{component:"span",sx:{display:"flex",alignItems:"center",gap:1},children:[r(N,{fontSize:"small"}),x]})),e(o,{item:!0,xs:c,sm:d,md:h,children:[a&&r(we,{required:n,sx:{textTransform:"capitalize",mb:1,fontWeight:500,fontSize:"0.875rem",color:"text.primary",transform:"none",position:"static"},children:a}),r(p,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:s,...y.formRegister(t,{validate:(e,r)=>n&&e.length<=0?"Este campo é obrigatório":e.length>f?`Limite máximo de ${f} caracteres`:e.length<m&&n?`Limite mínimo de ${m} caracteres`:void 0}),error:v,helperText:x,FormHelperTextProps:{sx:{backgroundColor:v?"#FFEBEE":"transparent",borderRadius:"8px",padding:v?"8px 12px":0,marginBottom:v?"4px":0,marginTop:v?"8px":0,border:v?"1px solid #FFCDD2":"none",color:"error.main",marginLeft:0,marginRight:0}},sx:{bgcolor:"white","& .MuiOutlinedInput-root":{borderRadius:"8px","& fieldset":{borderColor:"#E0E0E0"},"&:hover fieldset":{borderColor:"#BDBDBD"},"&.Mui-focused fieldset":{borderColor:"primary.main",borderWidth:"2px"},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderWidth:"2px"}}},placeholder:l||a})]})}function Nn({name:t,required:a=!1,xs:l=12,sm:d,md:u}){const m=J(dr),f=`switch-${t}`;ee(()=>{m.formWatch(f)||m.formSetValue(t,void 0)},[m]);const h=s(),g=m.formWatch(f);return r(o,{item:!0,xs:l,sm:d,md:u,children:e(i,{onClick:()=>{m.formSetValue(f,!g)},sx:{border:"1px solid",borderColor:g?h.palette.primary.main:"#E0E0E0",borderRadius:"8px",padding:"8px 16px",cursor:"pointer",backgroundColor:g?`${h.palette.primary.main}10`:"white",transition:"all 0.2s",display:"flex",alignItems:"center",mb:.5,"&:hover":{borderColor:g?void 0:h.palette.grey[400],backgroundColor:g?void 0:h.palette.grey[50]}},children:[r(c,{checked:!!g,size:"small",sx:{padding:0,mr:1.5,"&.Mui-checked":{color:h.palette.primary.main}}}),r(i,{sx:{flexGrow:1},onClick:e=>e.stopPropagation(),children:g?r(p,{size:"small",fullWidth:!0,...m.formRegister(t,{validate:(e,r)=>{if(!0===m.formWatch(f)&&(!e||e.length<=0&&a))return"Este campo não pode ser vazio"}}),required:a,error:!!oe(m.errors,t),helperText:oe(m.errors,t)?.message,placeholder:"Outro",sx:{"& .MuiOutlinedInput-root":{backgroundColor:"white"}}}):r(n,{color:"text.primary",children:"Outro"})})]})})}const zn=(e,r)=>{if(!e||Object.keys(e).length<=0)return[];if(!e[r])return[];let t=Object.keys(e[r]).map(e=>`${r}.${e}`);return e.files&&(t=[...t,...Object.keys(e.files).map(e=>`files.${e}`)]),t};function Bn({debugLog:t=!1,test:o=!1,testConfig:n={},customMarginBottom:c=10,...d}){d.children=Array.isArray(d.children)?d.children.filter((e,r)=>e):d.children;const u=Array.isArray(d.children)?d.children.length:1,p=J(dr),m=te(null),h=s(),[g,y]=Z(0),b=(Array.isArray(d.children)?d.children:[d.children]).map((e,r)=>/*#__PURE__*/H.cloneElement(e,{...e.props,prefix:r})),x=u;return e(i,{children:[o&&r(a,{direction:"row",justifyContent:"end",children:r(l,{variant:"contained",color:"error",onClick:()=>{Object.keys(n).forEach((e,r)=>{const t=n[Number(e)];Object.keys(t).forEach(r=>{p.formUnregister(`${e}.${r}`),p.formSetValue(`${e}.${r}`,t[r])}),r<Object.keys(n).length-1&&new Promise(e=>setTimeout(e,100)).then(()=>{m.current?.click()})})},children:"EXCLUIR BANCO PRODUÇÃO"})}),e(a,{sx:{padding:2,marginBottom:c},children:[r(i,{children:b.map((e,t)=>r(i,{hidden:!(g===t),children:b[t]},"formsB"+t))}),r(w,{variant:"text",steps:x,position:f(h.breakpoints.only("xs"))?"bottom":"static",activeStep:g,sx:{paddingTop:2,paddingBottom:4,paddingX:0},backButton:r(l,{variant:"contained",startIcon:r(Se,{}),onClick:()=>{y(e=>e-1)},disabled:0===g,sx:{textTransform:"none"},children:"Voltar"}),nextButton:g<x-1?r(l,{variant:"contained",endIcon:r(De,{}),onClick:function(){try{return t&&console.log(p.formGetValues()),Promise.resolve(p.formTrigger(zn(p.formGetValues(),g))).then(function(e){e?y(e=>e+1):Me("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"})})}catch(e){return Promise.reject(e)}},sx:{textTransform:"none"},ref:m,children:"Próximo"}):r(i,{children:r(Ye,{variant:"contained",type:"submit",loading:p.submiting,loadingPosition:"start",startIcon:r(Ie,{}),onClick:e=>function(e){try{return Promise.resolve(p.formTrigger(zn(p.formGetValues(),g))).then(function(r){r||(e.preventDefault(),Me("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"}))})}catch(e){return Promise.reject(e)}}(e),sx:{textTransform:"none",backgroundColor:"#22C55E","&:hover":{backgroundColor:"#48cf7a"}},children:r("span",{children:"Salvar"})})})})]})]})}var Ln=/*#__PURE__*/H.memo(Bn);function Wn(e,r,t){if(!e.props)return e;const o=e.props.children;if(!o)/*#__PURE__*/return H.cloneElement(e,{...e.props,name:`${r}.${e.props.name}`,key:e.props.name?`${r}.${e.props.name}`:`noListing-${t}-${r}-${e.props.name}`});let n;if(Array.isArray(o)){let e=[];o.forEach((o,n)=>{e.push(Wn(o,r,t+(n+1)))}),n=e}else n=Wn(o,r,t+1);/*#__PURE__*/return H.cloneElement(e,{...e.props,children:n,name:`${r}.${e.props.name}`,key:e.props.name?`${r}.${e.props.name}`:`noListing-${t}-${r}-${e.props.name}`})}function _n({optional:n=!1,title:l,prefix:s=0,optionalMessage:c,defaultChecked:d,...u}){const p=J(dr),m=`switch-${s}`,f=(Array.isArray(u.children)?u.children:[u.children]).map((e,r)=>e&&Wn(e,s,r));return e(i,{children:[r(o,{item:!0,xs:12,children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",spacing:2,children:[r(i,{sx:{marginTop:.6},children:r(a,{sx:{backgroundColor:"#E6F8EB",borderRadius:"100%",height:"35px",width:"35px"},justifyContent:"center",alignItems:"center",children:r(Ve,{sx:{height:"18px",fill:"#01BA35"}})})}),r(Te,{variant:"h6",fontWeight:600,fontSize:28,fontFamily:"Inter",sx:{color:"#1E293B",paddingBottom:4},children:l})]}),r(i,{hidden:!n,children:r(bn,{name:m,defaultChecked:!n||d,overrideNo:u.overrideSwitchNo,overrideYes:u.overrideSwitchYes})})]})}),r(a,{spacing:2,children:n?p.formWatch(m)?r(o,{container:!0,spacing:1,children:f}):r(a,{justifyContent:"center",alignItems:"center",children:r(Te,{fontFamily:"Inter",fontSize:22,paddingY:8,textAlign:"center",children:c||e(t,{children:[r("b",{children:l})," é opcional. ",r("br",{}),"Marque a opção acima caso haja necessidade."]})})}):r(o,{container:!0,spacing:1,children:f})})]})}var qn=/*#__PURE__*/H.memo(_n);let Un={open:()=>{},close:()=>{},openReparented:()=>{},reparent:()=>r(t,{})};function Kn(){const[o,l]=Z(!1),[c,d]=Z(null),u=()=>l(!1);te(null);const p=s(),m=f(p.breakpoints.up("sm")),[h,g]=Z({}),[y,b]=Z(-1321465654);return ee(()=>{Un.open=e=>{e&&d(e),b(-1321465654),l(!0)},Un.reparent=(e,o)=>(g(n=>({...n,[o]:r(t,{children:e})})),r(t,{})),Un.openReparented=e=>{b(e),d(null),l(!0)},Un.close=u},[l]),r(t,{children:m?r(E,{open:o,onClose:u,children:e(i,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",borderRadius:2,bgcolor:"white",border:"1px solid #454545",boxShadow:24},children:[r(i,{onClick:u,width:"fit-content",height:"fit-content",position:"absolute",right:0,top:0,margin:.6,sx:{":hover":{transform:"scale(1.03)",transition:"all 500ms",cursor:"pointer"}},children:r(Be,{sx:{transform:"scale(.9)"}})}),e(i,{overflow:"auto",maxHeight:"90vh",p:2,marginTop:4,borderTop:"solid 1px gray",bgcolor:"#F9F9F9",borderRadius:2,children:[c,h[y]]})]})}):e(k,{anchor:"bottom",open:o,onClose:u,onOpen:()=>{},PaperProps:{sx:{bgcolor:"transparent"}},children:[r(a,{direction:"row",onClick:u,maxHeight:"8vh",height:"8vh",justifyContent:"center",alignItems:"center",children:r(n,{fontWeight:600,color:"white",children:"Clique fora para fechar"})}),e(i,{p:2,maxHeight:"92vh",bgcolor:"white",overflow:"auto",children:[c,h[y]]})]})})}function Xn({customColor:e="#383838",customFontColor:t="white",...o}){const n=Le(e);return r(l,{...o,sx:{bgcolor:n.toHexString(),color:Le(t).toHexString(),":hover":{bgcolor:n.darken(10).toHexString()},boxShadow:"none",borderRadius:3,textTransform:"capitalize",paddingX:2},size:"small",children:o.children})}function Hn({data:o=[],...n}){const[i,a]=H.useState(null),l=Boolean(i),s=()=>{a(null)};return e(t,{children:[r(Xn,{...n.btProps,onClick:e=>{a(e.currentTarget)},children:n.children}),r(S,{id:"basic-menu",anchorEl:i,open:l,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:o.map(e=>r(D,{onClick:r=>{e.onClick&&e.onClick(),s()},children:e.name}))})]})}function Gn(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function Jn(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}let Qn=[],Zn=!1,ei="",ri=!1,ti={},oi="";function ni({mediaQueryLG:o,columns:n,emptyMsg:c={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:d="",tableName:u="Dados",csv:p,columnSize:m,action:g,useKC:b=!0,statusKeyName:x="",csvExcludeKeys:v=[],csvExcludeKeysCSV:C=[],csvExcludeKeysAll:w=[],csvCustomKeyNames:k={},csvExcludeValidate:E=(e,r)=>!1,csvButtonTitle:S="Salvar .CSV",csvNoZipText:D="Salvar .CSV",csvAllButtonTitle:V="Salvar todos em CSV",removeQuotes:T=!1,normalize:A=!1,csvShowAllButton:R=!1,csvWithoutZip:F=!1,itemCount:$=10,csvUpper:j=!1,csvZipFileNamesKey:P="",generateCsvZip:N=!1,hideTitleCSV:U=!1,csvExcludeUpper:X=[],multipleDataPath:H="",expandTextMaxLength:G=50,collapsedSize:re=53,customMargin:ne=4,customMarginMobile:ie=0,filtersFunc:ae,filters:le=[],orderBy:ce=[],customErrorMsg:de,customTableStyle:ue={},id:pe,initialData:me=null,isLoading:fe,alwaysExpanded:he=!1}){const[ge,ye]=Z(null),[be,xe]=Z(me),{user:ve,userLoaded:Ce}=J(sr),[we,ke]=Z([]),[Ee,Se]=Z([]),[De,Ie]=Z($),[Ye,Me]=Z(0),[Oe,Ve]=Z(1),[Be,Le]=Z(1);Z("");const[We,_e]=Z({}),[qe,Ue]=Z({}),[Ke,Xe]=Z({}),[He,Ge]=Z("filterKey"),Je=s(),Qe=f(Je.breakpoints.only("xs")),Ze=te(null),er=f(Je.breakpoints.up(2e3));ei=`tableFilter_${pe}`,oi=`tableFilterCache_${pe}`,ti=ae??{},localStorage.getItem(oi)||localStorage.setItem(oi,JSON.stringify(le)),localStorage.getItem(oi)!==JSON.stringify(le)&&(localStorage.setItem(oi,JSON.stringify(le)),localStorage.removeItem(ei));const rr=Q(e=>{if(e.length<=0)return 1;let r=e.length/De;return r=r<1?1:r,Math.ceil(r)},[De]),tr=Q(e=>Array.isArray(e)?e:"object"==typeof e?oe(e,d):void 0,[]);ee(()=>{if(ge||!tr(be))return;const e=tr(be);ke(e),Se(e),Ve(rr(e)),localStorage.getItem(ei)&&dr(JSON.parse(localStorage.getItem(ei)))},[De,be,rr,ge]),ee(()=>{Me(Be-1)},[Be]);const or=Q((e,r)=>{Le(r)},[]),nr=Q(()=>{const e=Ye*De;return we.slice(e,e+De)},[we,De,Ye]),ir=Q((e,r=!1)=>{if(e.preventDefault(),we.length<=0)return;const t=Object.keys(we[0]);if(N&&r){const e=t.filter(e=>!v.includes(e)),r=e.map(e=>k[e]?k[e]:e).join(",")+"\n",n=new ze,i={};we.forEach(e=>{i[e[P]]||(i[e[P]]=[]),i[e[P]].push(e)}),Object.keys(i).forEach(o=>{const a=[];i[o].forEach(r=>{let o=!0;if(t.forEach(e=>{E(e,r[e])&&(o=!1)}),o){const t=e.map(e=>{if("string"==typeof r[e]){let t=j?r[e].toUpperCase():r[e];return t=A?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t,T?`${t}`:`"${t}"`}if("object"==typeof r[e]&&!Array.isArray(r[e])&&null!==r[e]){let t=ar(r[e]).slice(1,-1),o=j&&!X.includes(e)?t.toUpperCase():t;return o=A?o.normalize("NFD").replace(/[\u0300-\u036f]/g,""):o,T?`${o}`:`"${o}"`}return r[e]}).join(",");a.push(t)}});const l=U?a.join("\n"):"\ufeff"+r+a.join("\n");a.length>0&&n.file(`${o.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}.csv`,l)});var o=window.document.createElement("a");n.generateAsync({type:"base64"}).then(e=>{o.setAttribute("href","data:application/zip;base64,"+e),o.setAttribute("download",`${p?.fileName}.zip`),o.click()})}else{let e=t.filter(e=>!C.includes(e)).map(e=>e===H?"hrTermino":e);""!==H&&(e=["dtInicio","hrInicio",...e]);const r=e.map(e=>k[e]?k[e]:e).join(",")+"\n",n=[];we.forEach(r=>{let o=!0;if(t.forEach(e=>{E(e,r[e])&&(o=!1)}),o){const t=e.map(e=>{if("dtInicio"===e)return"{dtInicio}";if("hrInicio"===e)return"{hrInicio}";if("hrTermino"===e)return"{hrTermino}";if("string"==typeof r[e]){let t=j&&!X.includes(e)?r[e].toUpperCase():r[e];return t=A?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t,T?`${t}`:`"${t}"`}if("object"==typeof r[e]&&!Array.isArray(r[e])&&null!==r[e]){let t=ar(r[e]).slice(1,-1),o=j&&!X.includes(e)?t.toUpperCase():t;return o=A?o.normalize("NFD").replace(/[\u0300-\u036f]/g,""):o,T?`${o}`:`"${o}"`}return r[e]}).join(",");if(""!==H){const e=r[H];e&&e.forEach(e=>{n.push(t.replace("{dtInicio}",e.dtInicio).replace("{hrInicio}",e.hrInicio).replace("{hrTermino}",e.hrTermino))})}else n.push(t)}});const i=r+n.join("\n");(o=window.document.createElement("a")).setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(i)),o.setAttribute("download",`${p?.fileName}.csv`),o.click()}},[we]);function ar(e){let r=[];if("object"==typeof e&&!Array.isArray(e)&&null!==e)for(let[t,o]of Object.entries(e))"object"!=typeof o||Array.isArray(o)||null===o?o&&r.push(t):r.push(t+": "+ar(o));return"["+r.join(" - ")+"]"}const lr=Q(e=>{if(e.preventDefault(),we.length<=0)return;const r=Object.keys(we[0]).filter(e=>!w.includes(e)),t=r.join(",")+"\n",o=we.map(e=>r.map(r=>{if("tbRa"===r)return e[r].NO_CIDADE;if("rlEventoData"===r)return`${e[r][0].DT_INICIO} - ${e[r][0].HR_INICIO}`;if("string"==typeof e[r]){let t=j&&!X.includes(r)?e[r].toUpperCase():e[r];return t=A?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t,T?`${t}`:`"${t}"`}if("object"==typeof e[r]&&!Array.isArray(e[r])&&null!==e[r]){let t=ar(e[r]).slice(1,-1),o=j&&!X.includes(r)?t.toUpperCase():t;return o=A?o.normalize("NFD").replace(/[\u0300-\u036f]/g,""):o,T?`${o}`:`"${o}"`}return e[r]}).join(",")).join("\n"),n=t+o;var i=window.document.createElement("a");i.setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(n)),i.setAttribute("download",`${p?.fileName}.csv`),i.click()},[we]);function cr(){ke(Qn),Se(Qn),Ve(rr(Qn)),Me(0),Le(1),localStorage.removeItem(ei),Ge((new Date).getTime().toString())}function dr(e){if(!Qn)return;let r=JSON.parse(JSON.stringify(Qn));e.filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).forEach(e=>{let t=[];switch(e.type){case"number":switch(e.operator){case"igual":r.forEach(r=>{Number(oe(r,e.keyName,""))===Number(e.value)&&t.push(r)});break;case"maior que":r.forEach(r=>{Number(oe(r,e.keyName,""))>Number(e.value)&&t.push(r)});break;case"menor que":r.forEach(r=>{Number(oe(r,e.keyName,""))<Number(e.value)&&t.push(r)})}break;case"string":switch(console.log("ata: ",e.operator),e.operator){case"igual":r.forEach(r=>{const o=oe(r,e.keyName,"");e.useList?Jn(o)===Jn(e.value.id)&&t.push(r):Jn(o)===Jn(e.value)&&t.push(r)});break;case"contem":r.forEach(r=>{const o=oe(r,e.keyName,"");o&&(e.useList?Jn(o).includes(Jn(e.value.id))&&t.push(r):Jn(o).includes(Jn(e.value))&&t.push(r))});break;case"tem um dos":r.forEach(r=>{const o=oe(r,e.keyName,"");o&&e.value.map(e=>Jn(e.id)).includes(Jn(o))&&t.push(r)})}break;case"date":switch(e.operator){case"data exata":r.forEach(r=>{const o=se(oe(r,e.keyName,""),"DD/MM/YYYY");o.isValid()&&o.isSame(se(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"entre":const o=se(e.value?e.value:"01/01/2000","DD/MM/YYYY"),n=se(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");r.forEach(r=>{const i=se(oe(r,e.keyName,""),"DD/MM/YYYY");(i.isAfter(o)||i.isSame(o))&&(i.isBefore(n)||i.isSame(n))&&t.push(r)})}break;case"dates":switch(e.operator){case"data inicio":r.forEach(r=>{const o=ti[e.customFunc](oe(r,e.keyName,""))??[];o.length<=0||se(o[0],"DD/MM/YYYY").isSame(se(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"data fim":r.forEach(r=>{const o=ti[e.customFunc](oe(r,e.keyName,""))??[];o.length<=0||se(o[o.length-1],"DD/MM/YYYY").isSame(se(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"tem a data":r.forEach(r=>{(ti[e.customFunc](oe(r,e.keyName,""))??[]).includes(e.value)&&t.push(r)});break;case"entre":const o=se(e.value?e.value:"01/01/2000","DD/MM/YYYY"),n=se(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");r.forEach(r=>{const i=ti[e.customFunc](oe(r,e.keyName,""))??[];let a=!1;i.forEach(e=>{if(a)return;const r=se(e,"DD/MM/YYYY");r.isValid()&&(r.isAfter(o)||r.isSame(o))&&(r.isBefore(n)||r.isSame(n))&&(a=!0)}),a&&t.push(r)})}}r=t}),ke(r),Ve(rr(r)),Me(0),Le(1),localStorage.setItem(ei,JSON.stringify(e)),Se(r)}return ee(()=>{const e=Ye*De,r=we.slice(e,e+De);let t={};r.forEach((e,r)=>{n.forEach(o=>{t[r]=!0===t[r]||(oe(e,o?.keyName,"")??"Não Informado").toString().length>=G})}),Ue(t)},[we,De,Ye]),ee(()=>{console.log(Ze.current)},[Ze.current]),ge?r(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(Te,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===ge.status&&"Acesso negado",500===ge.status&&e(i,{fontWeight:500,textAlign:"center",children:[r(z,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),r(i,{children:de||e(t,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",r("br",{}),r("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",r("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})}):fe?r(a,{sx:{height:"100%",width:"100%"},justifyContent:"center",alignItems:"center",children:e(i,{width:"100%",children:[e(a,{direction:"row",justifyContent:"center",alignItems:"center",justifyItems:"center",spacing:2,marginY:4,children:[r(B,{sx:{fill:"#5e5e5e"}}),e(Te,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",u]})]}),r(h,{color:"inherit"}),Array(10).fill("").map(t=>r(a,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:1},justifyContent:"space-between",paddingY:8,borderBottom:"1px solid #cacaca",children:Array(7).fill(0).map(t=>e(i,{children:[r(I,{width:60}),r(I,{width:120})]}))}))]})}):!Ce&&b?r(h,{}):e(t,{children:[e(i,{marginX:Qe?ie:ne,bgcolor:"white",p:2,borderRadius:6,...ue,children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},height:{md:"40px",xs:"inherit"},width:"100%",children:[r(Ne,{InputProps:{startAdornment:r($e,{sx:{marginRight:1,fill:"#c0c0c0"}}),sx:{".MuiOutlinedInput-notchedOutline":{border:"none"}}},sx:{border:"solid 1px #CBD5E1",backgroundColor:"#F8FAFC",borderRadius:"50px",maxWidth:"600px"},size:"small",onChange:function(e){console.log(Ee);const r=e.target.value;if(""===r)return ke(Ee),void Ve(rr(tr(we)));const t=tr(we),o=[];t.forEach(e=>{const t=[];if(Object.keys(e).map(r=>{let o=oe(e,r,"")??"";"number"==typeof o&&(o=o.toString()),"string"==typeof o&&t.push(o)}),t.length<=0)return;let n=!1;t.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(r.toLowerCase())&&(n=!0));case"C":return void("cancelado".includes(r.toLowerCase())&&(n=!0));case"A":return void("cadastrado".includes(r.toLowerCase())&&(n=!0));case"R":return void("reprovado".includes(r.toLowerCase())&&(n=!0));case"L":return void("licenciado".includes(r.toLowerCase())&&(n=!0));case"PA":return void(("pré aprovado".includes(r.toLowerCase())||"pre aprovado".includes(r.toLowerCase()))&&(n=!0));case"FP":return void("fora do prazo".includes(r.toLowerCase())&&(n=!0))}Gn(e.toLowerCase()).includes(Gn(r.toLowerCase()))&&(n=!0)}),n&&o.push(e)}),ke(o),Ve(rr(o)),Me(0),Le(1)},fullWidth:!0,placeholder:`Pesquisar ${u}`}),le.length>0&&r(l,{startIcon:r(L,{}),variant:"contained",onClick:e=>Un.open(r(ii,{reset:cr,filtrar:dr,baseFilters:[...le],filters:localStorage.getItem(ei)?JSON.parse(localStorage.getItem(ei)):[...le]},He)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:r(a,{direction:"row",borderRadius:5,padding:0,children:r("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[r(Hn,{data:ce.map(e=>({name:e.label,onClick:()=>function(e){let r=[...we];r.sort((r,t)=>{const o="string"===e.type?oe(r,e.key,""):Number(oe(r,e.key,0)),n="string"===e.type?oe(t,e.key,""):Number(oe(t,e.key,0));if(ri){if(o<n)return-1;if(o>n)return 1}else{if(o>n)return-1;if(o<n)return 1}return 0}),ri=!ri,ke(r)}(e)})),btProps:{startIcon:r(W,{}),fullWidth:!0},children:"Ordenar"}),r(l,{variant:"contained",fullWidth:!0,startIcon:r(Zn?K:W,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let r=0;r<$;r++)e[r]=!Zn;Xe(e),_e(e),Zn=!Zn},children:Zn?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(Te,{fontWeight:600,textAlign:"end",children:["Registro de ",u,"s"]}),r(a,{justifyContent:"center",children:e(Te,{children:["Exibindo ",Ye*De+1,"-",Ye*De+1+nr().length-1," de ",we.length]})})]})]}),localStorage.getItem(ei)&&r(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(ei)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(t=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[r(Te,{fontWeight:700,children:t.label}),r(Te,{fontStyle:"italic",children:t.operator}),r(Te,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(t.value)?t.value.map(e=>e.label).join(" - "):"object"==typeof t.value?t.value.label:"entre"===t.operator?`${t.value?t.value:"Antes"} e ${t.value2?t.value2:"Depois"}`:t.value.toString()}),r(Y,{onClick:e=>{let r=JSON.parse(localStorage.getItem(ei)??"[]");r=r.map(e=>e.label===t.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),dr(r)},size:"small",sx:{padding:0},children:r(Ae,{sx:{fill:"white"}})})]}))}),r(a,{spacing:.2,children:nr().length<=0?r(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:r(Te,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:ve?c.user:c.public})}):nr().map((s,c)=>r(y,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:he?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(je,{container:!0,spacing:Qe?2:0,paddingX:2,rowSpacing:2,children:[n.map(n=>e(je,{item:!0,xs:12,md:er?12/m*(n.size?n.size:1):o?o.all:12/m*(n.size?n.size:1),sx:{overflow:"hidden"},children:[r(i,{sx:{width:"max-content",paddingX:1},children:r(Te,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:n.title})}),r(i,{paddingLeft:1,position:"relative",children:r(M,{in:he||!0===We[c],collapsedSize:he?"auto":re,onExited:e=>Xe(e=>({...e,[c]:!1})),children:r(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:n.customComponent?n.customComponent(oe(s,n.keyName),s):e(t,{children:[r(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:oe(s,n.keyName,"")}),r(i,{position:"absolute",top:0,children:he||Ke[c]?oe(s,n?.keyName,""):(oe(s,n?.keyName,"")??"").toString().length>=G?r(t,{children:(oe(s,n?.keyName,"")??"").toString().substring(0,G)+"..."}):oe(s,n?.keyName,"")})]})})})})]},String(n?.keyName)+c)),r(je,{item:!0,xs:12,md:er?12/m:o?o.action:12/m,children:r(a,{direction:"row",alignItems:"center",justifyContent:Qe?"start":"flex-end",sx:{height:"100%",paddingBottom:Qe?2:0},children:g(s)})}),qe[c]&&!he&&r(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:r(l,{onClick:e=>{_e(e=>({...e,[c]:!e[c]})),Xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:r(We[c]?_:q,{}),children:We[c]?"Ver Menos":"Ver Mais"})})]})},c))}),nr().length>0&&r(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:p&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[F&&r(l,{startIcon:r(Re,{}),variant:"contained",size:"small",onClick:ir,sx:{backgroundColor:"#5a88b0",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:D}),R&&r(l,{startIcon:r(Re,{}),variant:"contained",size:"small",onClick:lr,sx:{backgroundColor:"#64748B",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:V}),r(l,{startIcon:r(Re,{}),variant:"contained",size:"small",onClick:e=>ir(e,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:S})]})})]}),r(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[r(l,{onClick:e=>Le(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Fe,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),r(Pe,{renderItem:e=>"page"===e.type?r(l,{onClick:e.onClick,sx:{fontWeight:600,...e.selected?{bgcolor:"#33B55D",color:"white"}:{color:"#1E293B"},borderRadius:"100%",padding:0,margin:0,minWidth:0,width:"40px",height:"40px",marginX:.25},children:e.page}):["next","previous","page"].includes(e.type)?void 0:r(O,{...e}),count:Oe,siblingCount:Qe?0:6,size:"large",onChange:or,page:Be,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),r(l,{onClick:e=>Le(e=>e<Oe?e+1:Oe),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Fe,{sx:{transform:"scale(1.5)"}})})]})})]})}function ii({filters:t,baseFilters:o,filtrar:n,reset:s}){const[c,d]=Z(t),[u,p]=Z(!1),[m,f]=H.useState(null),h=Boolean(m);return e(i,{width:{xs:"inherit",md:850},children:[r(S,{open:h,onClose:()=>{f(null)},anchorEl:m,children:o.map(e=>r(D,{onClick:r=>{var t;t=e,d(e=>[...e,t]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[r(Te,{fontWeight:700,fontSize:18,children:"Filtrar"}),r(l,{startIcon:r(U,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Un.close()},children:"Limpar"})]}),r(i,{marginBottom:1,children:r(V,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),r(a,{children:u?c.map((e,t)=>r(ai,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let o=[...r];return o[t]=e,o})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}})):r(i,{children:c.map((e,t)=>r(ai,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let o=[...r];return o[t]=e,o})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}}))})}),r(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:r(l,{variant:"contained",color:"success",startIcon:r($e,{}),sx:{textTransform:"capitalize"},onClick:e=>{n(c),Un.close()},children:"Filtrar"})})]})}function ai({filterValue:t,setDt:o,idx:n}){const[i,l]=Z(t.operator),[c,d]=Z(t),u=s(),p=f(u.breakpoints.only("xs"));return ee(()=>{o(c)},[c]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:n%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!p&&r(Te,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:t.label}),e(T,{sx:{width:"100%"},children:[p&&r(Te,{children:t.label}),r(A,{onChange:e=>{const r=e.target.value;d(e=>({...e,operator:r,value:""})),l(r)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:t.operators.map(e=>r(D,{value:e,children:e}))})]}),r(li,{filterValue:t,operator:c.operator,onChange:(e,r="value")=>{d(t=>({...t,[r]:e}))}})]})}function li({filterValue:o,operator:n,onChange:a}){switch(o.type){case"number":return r(Ne,{type:"number",size:"small",placeholder:"Valor",defaultValue:o.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"string":if(o.useList)switch(n){case"tem um dos":return r(C,{multiple:!0,id:"tags-standard",onChange:(e,r)=>{a(r.length<=0?"":r)},options:o.useList,defaultValue:Array.isArray(o.value)?o.value:[],renderInput:e=>r(Ne,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return r(i,{width:"100%",children:r(C,{options:o.useList,onChange:(e,r)=>{a(r)},defaultValue:"object"==typeof o.value?o.value:void 0,isOptionEqualToValue:(e,r)=>e.label===r.label,renderInput:e=>r(Ne,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return r(Ne,{size:"small",placeholder:"Valor",defaultValue:o.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"date":case"dates":switch(n){case"data exata":case"data fim":case"data inicio":case"tem a data":return r(ne,{adapterLocale:"pt-br",dateAdapter:le,children:r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:o.value?se(o.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})})});case"entre":return e(ne,{adapterLocale:"pt-br",dateAdapter:le,children:[r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:o.value?se(o.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})}),r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:o.value2?se(o.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})})]})}}return r(t,{})}var si=/*#__PURE__*/H.memo(ni);function ci({customErrorMsg:o,error:a}){return r(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(n,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===a.status&&"Acesso negado",500===a.status&&e(i,{fontWeight:500,textAlign:"center",children:[r(z,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),r(i,{children:o||e(t,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",r("br",{}),r("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",r("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})})}function di({tableName:t}){return r(a,{sx:{height:"100%",width:"100%"},justifyContent:"center",alignItems:"center",children:e(i,{width:"100%",children:[e(a,{direction:"row",justifyContent:"center",alignItems:"center",justifyItems:"center",spacing:2,marginY:4,children:[r(B,{sx:{fill:"#5e5e5e"}}),e(Te,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",t]})]}),r(h,{color:"inherit"}),Array(10).fill("").map(t=>r(a,{direction:{xs:"column",md:"row"},spacing:{xs:3,md:1},justifyContent:"space-between",paddingY:8,borderBottom:"1px solid #cacaca",children:Array(7).fill(0).map(t=>e(i,{children:[r(I,{width:60}),r(I,{width:120})]}))}))]})})}const ui=(e,r)=>{if(e.length<=0)return 1;let t=e.length/r;return t=t<1?1:t,Math.ceil(t)};function pi(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function mi(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function fi({filterData:e,startData:r,filtersFuncData:t={},localTableName:o="",setCurrentPage:n,setList:i,setListClone:a,setListPage:l,setPagCount:s,itemsCount:c}){if(!r)return;let d=JSON.parse(JSON.stringify(r));e.filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).forEach(e=>{let r=[];switch(e.type){case"number":switch(e.operator){case"igual":d.forEach(t=>{Number(oe(t,e.keyName,""))===Number(e.value)&&r.push(t)});break;case"maior que":d.forEach(t=>{Number(oe(t,e.keyName,""))>Number(e.value)&&r.push(t)});break;case"menor que":d.forEach(t=>{Number(oe(t,e.keyName,""))<Number(e.value)&&r.push(t)})}break;case"string":switch(e.operator){case"igual":d.forEach(t=>{const o=oe(t,e.keyName,"");e.useList?mi(o)===mi(e.value.id)&&r.push(t):mi(o)===mi(e.value)&&r.push(t)});break;case"contem":d.forEach(t=>{const o=oe(t,e.keyName,"");o&&(e.useList?mi(o).includes(mi(e.value.id))&&r.push(t):mi(o).includes(mi(e.value))&&r.push(t))});break;case"tem um dos":d.forEach(t=>{const o=oe(t,e.keyName,"");o&&e.value.map(e=>mi(e.id)).includes(mi(o))&&r.push(t)})}break;case"date":switch(e.operator){case"data exata":d.forEach(t=>{const o=se(oe(t,e.keyName,""),"DD/MM/YYYY");o.isValid()&&o.isSame(se(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"entre":const t=se(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=se(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(n=>{const i=se(oe(n,e.keyName,""),"DD/MM/YYYY");(i.isAfter(t)||i.isSame(t))&&(i.isBefore(o)||i.isSame(o))&&r.push(n)})}break;case"dates":switch(e.operator){case"data inicio":d.forEach(o=>{const n=(t[e.customFunc](oe(o,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);n.length<=0||se(n[0],"DD/MM/YYYY").isSame(se(e.value,"DD/MM/YYYY"))&&r.push(o)});break;case"data fim":d.forEach(o=>{const n=(t[e.customFunc](oe(o,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);n.length<=0||(console.log(n),se(n[n.length-1],"DD/MM/YYYY").isSame(se(e.value,"DD/MM/YYYY"))&&r.push(o))});break;case"tem a data":d.forEach(o=>{const n=(t[e.customFunc](oe(o,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);n.includes(e.value)&&r.push(o)});break;case"entre":const o=se(e.value?e.value:"01/01/2000","DD/MM/YYYY"),n=se(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(i=>{const a=(t[e.customFunc](oe(i,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);let l=!1;a.forEach(e=>{if(l)return;const r=se(e,"DD/MM/YYYY");r.isValid()&&(r.isAfter(o)||r.isSame(o))&&(r.isBefore(n)||r.isSame(n))&&(l=!0)}),l&&r.push(i)})}}d=r}),i(d),s(ui(d,c)),n(0),l(1),localStorage.setItem(o,JSON.stringify(e)),a(d)}function hi({order:e,list:r,orderAsc:t=!1}){const o=We(r).sort((r,o)=>{const n="string"===e.type?oe(r,e.key,""):Number(oe(r,e.key,0)),i="string"===e.type?oe(o,e.key,""):Number(oe(o,e.key,0));if(t){if(n<i)return-1;if(n>i)return 1}else{if(n>i)return-1;if(n<i)return 1}return 0});return o}function gi({filters:t,baseFilters:o,filtrar:n,reset:s}){const[c,d]=Z(t),[u,p]=Z(!1),[m,f]=H.useState(null),h=Boolean(m);return e(i,{width:{xs:"inherit",md:850},children:[r(S,{open:h,onClose:()=>{f(null)},anchorEl:m,children:o.map(e=>r(D,{onClick:r=>{var t;t=e,d(e=>[...e,t]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[r(Te,{fontWeight:700,fontSize:18,children:"Filtrar"}),r(l,{startIcon:r(U,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),Un.close()},children:"Limpar"})]}),r(i,{marginBottom:1,children:r(V,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),r(a,{children:u?c.map((e,t)=>r(yi,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let o=[...r];return o[t]=e,o})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}})):r(i,{children:c.map((e,t)=>r(yi,{filterValue:e,setReset:p,idx:t,setDt:e=>{d(r=>{let o=[...r];return o[t]=e,o})},removeDt:()=>{d(e=>{let r=[...e];return r.splice(t,1),r})}}))})}),r(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:r(l,{variant:"contained",color:"success",startIcon:r($e,{}),sx:{textTransform:"capitalize"},onClick:e=>{n(c),Un.close()},children:"Filtrar"})})]})}function yi({filterValue:t,setDt:o,idx:n}){const[i,l]=Z(t.operator),[c,d]=Z(t),u=s(),p=f(u.breakpoints.only("xs"));return ee(()=>{o(c)},[c]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:n%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!p&&r(Te,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:t.label}),e(T,{sx:{width:"100%"},children:[p&&r(Te,{children:t.label}),r(A,{onChange:e=>{const r=e.target.value;d(e=>({...e,operator:r,value:""})),l(r)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:t.operators.map(e=>r(D,{value:e,children:e}))})]}),r(bi,{filterValue:t,operator:c.operator,onChange:(e,r="value")=>{d(t=>({...t,[r]:e}))}})]})}function bi({filterValue:o,operator:n,onChange:a}){switch(o.type){case"number":return r(Ne,{type:"number",size:"small",placeholder:"Valor",defaultValue:o.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"string":if(o.useList)switch(n){case"tem um dos":return r(C,{multiple:!0,id:"tags-standard",onChange:(e,r)=>{a(r.length<=0?"":r)},options:o.useList,defaultValue:Array.isArray(o.value)?o.value:[],renderInput:e=>r(Ne,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return r(i,{width:"100%",children:r(C,{options:o.useList,onChange:(e,r)=>{a(r)},defaultValue:"object"==typeof o.value?o.value:void 0,isOptionEqualToValue:(e,r)=>e.label===r.label,renderInput:e=>r(Ne,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return r(Ne,{size:"small",placeholder:"Valor",defaultValue:o.value,onChange:e=>{a(e.target.value)},sx:{bgcolor:"white"},fullWidth:!0});case"date":case"dates":switch(n){case"data exata":case"data fim":case"data inicio":case"tem a data":return r(ne,{adapterLocale:"pt-br",dateAdapter:le,children:r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:o.value?se(o.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})})});case"entre":return e(ne,{adapterLocale:"pt-br",dateAdapter:le,children:[r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:o.value?se(o.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})}),r(ie,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:o.value2?se(o.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>r(Ne,{...e,size:"small",fullWidth:!0})})]})}}return r(t,{})}let xi=!1,vi="",Ci={},wi="";function ki({mediaQueryLG:o,columns:n,csvConfig:c,fetchFunc:d,emptyMsg:u={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:p="",tableName:m="Dado",columnSize:g,action:b,useKC:x=!0,itemCount:v=10,expandTextMaxLength:C=50,collapsedSize:w=53,customMargin:k=4,customMarginMobile:E=0,filtersFunc:S,filters:D=[],orderBy:I=[],customErrorMsg:V,customTableStyle:T={},id:A,initialData:R=null,isExpandable:F=!0,alwaysExpanded:$=!1}){const[j,P]=Z(!1),[N,z]=Z(null),[B,U]=Z(R),{user:X,userLoaded:H}=J(sr),[G,re]=Z([]),[ne,ie]=Z([]),[ae,le]=Z(v),[se,ce]=Z(0),[de,ue]=Z(1),[pe,me]=Z(1),[fe,he]=Z({}),[ge,ye]=Z({}),[be,xe]=Z({}),[ve,Ce]=Z("filterKey"),we=s(),ke=f(we.breakpoints.only("xs")),Ee=te(B),Se=te("true"===localStorage.getItem(`order-${A}`)||!1),De=f(we.breakpoints.up(2e3));vi=`tableFilter_${A}`,wi=`tableFilterCache_${A}`,Ci=S??{},localStorage.getItem(wi)||localStorage.setItem(wi,JSON.stringify(D)),localStorage.getItem(wi)!==JSON.stringify(D)&&(localStorage.setItem(wi,JSON.stringify(D)),localStorage.removeItem(vi)),ee(()=>{z(null),d&&(!H&&x||(P(!0),d().then(e=>e.ok?e.json().then(e=>{if(204===e.statusCode)U({body:{data:[]}}),Ee.current=[];else if(403===e.statusCode)z({status:e.statusCode});else{let r=p?oe(e,p):e;if(r&&Array.isArray(r)){let e=r;if(localStorage.getItem(`order-data-${A}`))try{e=hi({order:JSON.parse(localStorage.getItem(`order-data-${A}`)),list:r,orderAsc:Se.current})}catch(e){console.log(e)}else I.length>0&&(e=hi({order:I[0],list:r,orderAsc:Se.current}));U(e),Ee.current=JSON.parse(JSON.stringify(e))}else U({body:{data:[]}}),Ee.current=[]}P(!1)}):(z({status:500}),void P(!1))).catch(e=>{z({status:500})})))},[H,d]);const Ie=Q(e=>Array.isArray(e)?e:"object"==typeof e?oe(e,p):void 0,[]);ee(()=>{if(j||N||!Ie(B))return;let e=Ie(B);re(e),ie(e),ue(ui(e,ae)),localStorage.getItem(vi)&&fi({filterData:JSON.parse(localStorage.getItem(vi)),filtersFuncData:Ci,localTableName:vi,setCurrentPage:ce,setList:re,setListClone:ie,setListPage:me,setPagCount:ue,startData:Ee.current,itemsCount:ae})},[ae,j,B,N]),ee(()=>{ce(pe-1)},[pe]);const Ye=Q((e,r)=>{me(r)},[]),Me=Q(()=>{const e=se*ae;return G.slice(e,e+ae)},[G,ae,se]);function Oe(){re(Ee.current),ie(Ee.current),ue(ui(Ee.current,ae)),ce(0),me(1),localStorage.removeItem(vi),Ce((new Date).getTime().toString())}ee(()=>{const e=se*ae,r=G.slice(e,e+ae);let t={};r.forEach((e,r)=>{n.forEach(o=>{t[r]=!0===t[r]||(oe(e,o.keyName,"")??"Não Informado").toString().length>=C})}),ye(t)},[G,ae,se]);const Ve=(e,r=!1)=>{c&&function(e,r,t){try{if(e.length<=0)return Promise.resolve();let o=[];r.downloadAll&&r.customAll?o=r.customAll(e,t):!r.downloadAll&&r.customFiltered?o=r.customFiltered(e,t):e.forEach(e=>{const n={};r.map.forEach(o=>{if(o.useFilterValue&&!r.downloadAll&&!o.onlyAll){const r=t.filter(e=>e.label==o.useFilterValue.label&&o.useFilterValue.operators.includes(e.operator)),i=r.length>0&&r.reduce(e=>e.value).value||void 0;return void(n[o.name]=i||oe(e,o.key))}o.onlyFilter||(n[o.name]=oe(e,o.key))}),o.push(n)});const n=_e.utils.json_to_sheet(o),i=_e.utils.book_new();return _e.utils.book_append_sheet(i,n,r.fileName),_e.writeFile(i,`${r.fileName}.xlsx`),Promise.resolve()}catch(e){return Promise.reject(e)}}(e,{...c,...r?{downloadAll:!0}:{}},JSON.parse(localStorage.getItem(vi)??"[]")||[])},ze=e=>{fi({filterData:e,filtersFuncData:Ci,localTableName:vi,setCurrentPage:ce,setList:re,setListClone:ie,setListPage:me,setPagCount:ue,startData:Ee.current,itemsCount:ae})};return N?r(ci,{customErrorMsg:V,error:N}):j?r(di,{tableName:m}):!H&&x?r(h,{}):e(t,{children:[e(i,{marginX:ke?E:k,bgcolor:"white",p:2,borderRadius:6,...T,children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},children:[e(a,{spacing:1.5,direction:{xs:"column",md:"row"},height:{md:"40px",xs:"inherit"},width:"100%",children:[r(Ne,{InputProps:{startAdornment:r($e,{sx:{marginRight:1,fill:"#c0c0c0"}}),sx:{".MuiOutlinedInput-notchedOutline":{border:"none"}}},sx:{border:"solid 1px #CBD5E1",backgroundColor:"#F8FAFC",borderRadius:"50px",maxWidth:"600px"},size:"small",onChange:function(e){const r=e.target.value;if(""===r)return re(ne),void ue(ui(Ie(G),ae));const t=[];ne.forEach(e=>{const o=[];if(Object.keys(e).map(r=>{let t=oe(e,r,"")??"";"number"==typeof t&&(t=t.toString()),"string"==typeof t&&o.push(t)}),o.length<=0)return;let n=!1;o.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(r.toLowerCase())&&(n=!0));case"C":return void("cancelado".includes(r.toLowerCase())&&(n=!0));case"A":return void("cadastrado".includes(r.toLowerCase())&&(n=!0));case"R":return void("reprovado".includes(r.toLowerCase())&&(n=!0));case"L":return void("licenciado".includes(r.toLowerCase())&&(n=!0));case"PA":return void(("pré aprovado".includes(r.toLowerCase())||"pre aprovado".includes(r.toLowerCase()))&&(n=!0));case"FP":return void("fora do prazo".includes(r.toLowerCase())&&(n=!0))}pi(e.toLowerCase()).includes(pi(r.toLowerCase()))&&(n=!0)}),n&&t.push(e)}),re(t),ue(ui(t,ae)),ce(0),me(1)},fullWidth:!0,placeholder:`Pesquisar ${m}`}),r(l,{startIcon:r(L,{}),variant:"contained",onClick:e=>Un.open(r(gi,{reset:Oe,filtrar:e=>ze(e),baseFilters:[...D],filters:localStorage.getItem(vi)?JSON.parse(localStorage.getItem(vi)):[...D]},ve)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:r(a,{direction:"row",borderRadius:5,padding:0,children:r("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[I.length>0&&r(Hn,{data:I.map(e=>({name:e.label,onClick:()=>(e=>{Se.current=!Se.current;const r=hi({order:e,list:G,orderAsc:Se.current});localStorage.setItem(`order-${A}`,Se.current.toString()),localStorage.setItem(`order-data-${A}`,JSON.stringify(e)),re(r)})(e)})),btProps:{startIcon:r(W,{}),fullWidth:!0},children:"Ordenar"}),F&&!$&&r(l,{variant:"contained",fullWidth:!0,startIcon:r(xi?K:W,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let r=0;r<v;r++)e[r]=!xi;xe(e),he(e),xi=!xi},children:xi?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(Te,{fontWeight:600,textAlign:"end",children:["Registro de ",m,"s"]}),r(a,{justifyContent:"center",children:e(Te,{children:["Exibindo ",se*ae+1,"-",se*ae+1+Me().length-1," de ",G.length]})})]})]}),localStorage.getItem(vi)&&r(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(vi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(t=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[r(Te,{fontWeight:700,children:t.label}),r(Te,{fontStyle:"italic",children:t.operator}),r(Te,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(t.value)?t.value.map(e=>e.label).join(" - "):"object"==typeof t.value?t.value.label:"entre"===t.operator?`${t.value?t.value:"Antes"} e ${t.value2?t.value2:"Depois"}`:t.value.toString()}),r(Y,{onClick:e=>{let r=JSON.parse(localStorage.getItem(vi)??"[]");r=r.map(e=>e.label===t.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),ze(r)},size:"small",sx:{padding:0},children:r(Ae,{sx:{fill:"white"}})})]}))}),r(a,{spacing:.2,children:Me().length<=0?r(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:r(Te,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:X?u.user:u.public})}):Me().map((s,c)=>r(y,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,paddingBottom:$?2:.5,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(je,{container:!0,spacing:ke?2:0,paddingX:2,rowSpacing:2,children:[n.map(n=>e(je,{item:!0,xs:12,md:De?12/g*(n.size?n.size:1):o?o.all:12/g*(n.size?n.size:1),sx:{overflow:"hidden"},children:[r(i,{sx:{width:"max-content",paddingX:1},children:r(Te,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:n.title})}),r(i,{paddingLeft:1,position:"relative",children:r(M,{in:$||!0===fe[c],collapsedSize:$?"auto":w,onExited:e=>xe(e=>({...e,[c]:!1})),children:r(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:n.customComponent?n.customComponent(oe(s,n.keyName),s):e(t,{children:[r(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:oe(s,n.keyName,"")}),r(i,{position:"absolute",top:0,children:$||be[c]?oe(s,n.keyName,""):(oe(s,n.keyName,"")??"").toString().length>=C?r(t,{children:(oe(s,n.keyName,"")??"").toString().substring(0,C)+"..."}):oe(s,n.keyName,"")})]})})})})]},n.keyName+c)),r(je,{item:!0,xs:12,md:De?12/g:o?o.action:12/g,children:r(a,{direction:"row",alignItems:"center",justifyContent:ke?"start":"flex-end",sx:{height:"100%",paddingBottom:ke?2:0},children:b(s)})}),ge[c]&&!$&&r(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:r(l,{onClick:e=>{he(e=>({...e,[c]:!e[c]})),xe(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:r(fe[c]?_:q,{}),children:fe[c]?"Ver Menos":"Ver Mais"})})]})},c))}),Me().length>0&&r(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:c&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[JSON.parse(localStorage.getItem(vi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).length>0&&r(l,{startIcon:r(Re,{}),variant:"contained",size:"small",onClick:e=>Ve(G),sx:{backgroundColor:"#a5a5a5",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Filtrados"}),r(l,{startIcon:r(Re,{}),variant:"contained",size:"small",onClick:e=>Ve(Ee.current,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Tabela"})]})})]}),r(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[r(l,{onClick:e=>me(e=>e>1?e-1:1),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Fe,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),r(Pe,{renderItem:e=>"page"===e.type?r(l,{onClick:e.onClick,sx:{fontWeight:600,...e.selected?{bgcolor:"#33B55D",color:"white"}:{color:"#1E293B"},borderRadius:"100%",padding:0,margin:0,minWidth:0,width:"40px",height:"40px",marginX:.25},children:e.page}):["next","previous","page"].includes(e.type)?void 0:r(O,{...e}),count:de,siblingCount:ke?0:6,size:"large",onChange:Ye,page:pe,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),r(l,{onClick:e=>me(e=>e<de?e+1:de),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:r(Fe,{sx:{transform:"scale(1.5)"}})})]})})]})}var Ei=/*#__PURE__*/H.memo(ki);const Si=qe(()=>import("./Map-31d95a26.js").then(e=>e.Map),{ssr:!1});function Di({links:o,title:s,img:c,pos:d="fixed",next:u=!0,el:p,menuItems:m,paddingBottom:f=0,logoutMsg:h="Sair",logoutFunc:g,loginOptions:y,logoutOptions:b,...x}){let v;u&&(v=Ze());const{user:C,login:w,logout:k,type:E}=J(sr),[I,M]=Z(null),[O,V]=Z(null),T=Boolean(I),A=Boolean(O),[$,j]=Z(!1),P=Q(e=>{M(e.currentTarget)},[]),N=Q(()=>{M(null)},[]),z=Q((e,r)=>{j(!0),M(null),v?v.push({pathname:r}).finally(()=>j(!1)):j(!1)},[v]);return e(t,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[r(R,{position:"relative",elevation:0,sx:{backgroundColor:"#F1F5F9",color:"black",paddingY:1,paddingX:{xs:1,md:4}},children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",alignItems:"center",spacing:2,marginRight:2,sx:{display:{xs:"none",md:"flex"},width:"100%"},children:[r(Qe,{href:"/",children:u?r(Je,{src:c,alt:s,width:40,height:40}):r("img",{src:c,height:35})}),r(i,{children:r(n,{variant:"subtitle1",fontWeight:600,children:s})})]}),r(i,{sx:{display:{xs:"flex",md:"none"}},children:o.length>0&&e(t,{children:[r(Y,{onClick:P,children:r(Xe,{})}),r(S,{open:T,onClose:N,anchorEl:I,children:o.map(e=>r(D,{onClick:r=>z(r,e.path),children:r(n,{textTransform:"capitalize",children:e.name})},`navmenu${e}`))})]})}),e(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{md:"100%"}},children:[r(a,{direction:"row",spacing:2,sx:{display:{xs:"none",md:"flex"}},children:o.map(e=>r(i,{sx:{a:{color:"#2c7da0",textDecoration:"none",textTransform:"capitalize","&:hover":{color:"#90e0ef"}}},children:r(l,{onClick:r=>{return t=e.path,j(!0),void(v?v.push({pathname:t}).finally(()=>j(!1)):j(!1));var t},sx:{textTransform:"capitalize"},children:e.name})},`navigation${e.path}`))}),e(a,{direction:"row",spacing:2,children:[r(i,{children:p}),C?e(a,{direction:"row",spacing:1,sx:{"&:hover":{backgroundColor:"#a9def9",cursor:"pointer"},padding:.5,borderRadius:60},children:[e(i,{sx:{display:"flex",alignItems:"center"},children:[r(F,{sx:{width:30,height:30},src:C.image}),e(S,{open:A,onClose:e=>V(null),anchorEl:O,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[m,r(D,{onClick:function(e){try{V(null);const e={...b,onBeforeLogout:function(){try{function e(){return Promise.resolve(b?.onBeforeLogout?.()).then(function(){})}const r=function(){if(g){const e=function(e,r){try{var t=Promise.resolve(g()).then(function(){})}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(e):e())}catch(t){return Promise.reject(t)}}};return k(e),Promise.resolve()}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[r(Ke,{sx:{fill:"#545454"}}),r(n,{textTransform:"capitalize",children:h})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>V(e.currentTarget),sx:{userSelect:"none"},children:[r(n,{children:"Olá,"}),r(n,{fontWeight:600,children:C?.given_name}),r(Ue,{})]})]}):r(l,"govbr"===E?{variant:"contained",size:"small",startIcon:r(He,{}),onClick:()=>w(y),sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(n,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:r(He,{}),onClick:()=>w(y),sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(n,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})]})]})}),$&&r(Ge,{})]}),r(i,{paddingBottom:f})]})}function Ii({links:o,title:c,img:d,pos:u="fixed",next:p=!0,el:m,menuItems:f,color:h="blue",route:g="/teste/89",paddingBottom:y=0,logoutMsg:b="Sair",customBgColor:x="#FFFFFF",logoutFunc:v,loginOptions:C,logoutOptions:w,...k}){const E=s(),I=o.length<=3?"md":"lg";let M;p&&(M=Ze());const{user:O,login:V,logout:T,type:A}=J(sr),[$,j]=Z(null),[P,N]=Z(null),z=Boolean($),B=Boolean(P),[L,W]=Z(!1),_=Q(e=>{j(e.currentTarget)},[]),q=Q(()=>{j(null)},[]),U=Q((e,r)=>{W(!0),j(null),M?M.push({pathname:r}).finally(()=>W(!1)):W(!1)},[M]);return e(t,{children:[e(i,{position:u,sx:{width:"100%",zIndex:100},children:[r(R,{position:"relative",elevation:0,sx:{color:E.palette.getContrastText(x),paddingX:{xs:1,[I]:4},bgcolor:x},children:e(a,{direction:"row",justifyContent:"space-between",bgcolor:x,children:[e(a,{direction:"row",alignItems:"center",spacing:2,marginRight:2,sx:{display:{xs:"none",[I]:"flex"},width:"100%"},children:[r(Qe,{href:"/",children:p?r(Je,{src:d,alt:c,width:40,height:40}):r("img",{src:d,height:35})}),r(i,{children:r(n,{variant:"subtitle1",fontWeight:600,children:c})})]}),r(a,{direction:"row",width:"100%",justifyContent:"center",alignItems:"center",spacing:2,sx:{display:{xs:"none",[I]:"flex"}},children:o.map((e,t)=>{const o=function(e,r){return"/"===r?e===r:e.startsWith(r)}(p?M?.pathname??"":g,e.path);return r(i,{paddingX:3,paddingY:.8,borderRadius:50,bgcolor:o?h:"transparent",color:o?"#fff":"inherit",sx:{transition:"all 0.2s ease-in-out",":hover":{backgroundColor:o?h:"rgba(0,0,0,0.05)",cursor:"pointer",userSelect:"none",filter:o?"brightness(1.1)":"none"}},onClick:r=>{var t;p&&console.log("pathname:",M?.pathname,":=",e.path),t=e.path,W(!0),M?M.push({pathname:t}).finally(()=>W(!1)):W(!1)},children:r(a,{justifyContent:"center",children:r(n,{fontWeight:o?600:500,whiteSpace:"nowrap",children:e.name})})},JSON.stringify({x:e,index:t}))})}),r(i,{sx:{display:{xs:"flex",[I]:"none"}},children:o.length>0&&e(t,{children:[r(Y,{onClick:_,children:r(Xe,{})}),r(S,{open:z,onClose:q,anchorEl:$,children:o.map((e,t)=>r(D,{onClick:r=>U(r,e.path),children:r(n,{textTransform:"capitalize",children:e.name})},JSON.stringify({x:e,index:t})))})]})}),r(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{[I]:"100%"}},paddingY:1,children:e(a,{direction:"row",spacing:2,children:[r(i,{children:m}),O?e(a,{direction:"row",spacing:1,sx:{"&:hover":{backgroundColor:"#a9def9",cursor:"pointer"},padding:.5,borderRadius:60},children:[e(i,{sx:{display:"flex",alignItems:"center"},children:[r(F,{sx:{width:30,height:30},src:O.image}),e(S,{open:B,onClose:e=>N(null),anchorEl:P,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[f,r(D,{onClick:function(e){try{N(null);const e={...w,onBeforeLogout:function(){try{function e(){return Promise.resolve(w?.onBeforeLogout?.()).then(function(){})}const r=function(){if(v){const e=function(e,r){try{var t=Promise.resolve(v()).then(function(){})}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(e):e())}catch(t){return Promise.reject(t)}}};return T(e),Promise.resolve()}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[r(Ke,{sx:{fill:"#545454"}}),r(n,{textTransform:"capitalize",children:b})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>N(e.currentTarget),sx:{userSelect:"none"},children:[r(n,{children:"Olá,"}),r(n,{fontWeight:600,children:O.given_name}),r(Ue,{})]})]}):r(l,"govbr"===A?{variant:"contained",size:"small",startIcon:r(He,{}),onClick:()=>V(C),sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(n,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:r(He,{}),onClick:()=>V(C),sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:r(n,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})})]})}),L&&r(Ge,{})]}),r(i,{paddingBottom:y})]})}function Yi({children:e,onSubmit:t,formMethod:o="GET",submiting:n=!1}){const{register:i,handleSubmit:a,control:l,formState:s,reset:c,watch:d,trigger:u,setValue:p,unregister:m,getValues:f}=ue(),[h,g]=Z([]);return r(dr.Provider,{value:{formRegister:i,formWatch:d,formReset:c,formControl:l,formSetValue:p,formTrigger:u,formUnregister:m,formGetValues:f,formHandleSubmit:a,setFilesUid:g,formState:s,errors:s?.errors,submiting:n},children:r("form",{method:o,onSubmit:a(e=>t(e,h),()=>Me("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",position:"top-right",theme:"colored"})),children:e})})}function Mi(e,r){try{var t=e()}catch(e){return r(e)}return t&&t.then?t.then(void 0,r):t}const Oi="keycloak-logout-pending";function Vi({url:e,realm:t,clientId:o,children:n,type:i="ad",resource_name:a="eventos-front",basePath:l="",redirectUri:s="",onAuthSuccess:c,onAuthError:d,onLogoutSuccess:u,enableDebugLogs:p="development"===process.env.NODE_ENV}){const[m,f]=Z(null),[h,g]=Z(!1),y=te(null),b=te(!1),x=te(null),v=Ze(),C=Q(function(e){p&&console.log(`[KeycloakAuth] ${e}`,...[].slice.call(arguments,1))},[p]),w=Q(function(e){p&&console.error(`[KeycloakAuth] ${e}`,...[].slice.call(arguments,1))},[p]),k=Q(e=>{const r=e.tokenParsed;if(!r)return null;const t=(r.resource_access??{})[a],o=Array.isArray(t?.roles)?t.roles:[];return{...r,token:e.token,roles:o}},[a]),E=Q(function(){try{const e=y.current;return e&&e.authenticated?Promise.resolve(Mi(function(){return Promise.resolve(e.updateToken(30)).then(function(r){if(r){const r=k(e);r&&(f(r),C("Token renovado com sucesso"))}else C("Token ainda válido, renovação não necessária");return!0})},function(e){return w("Falha ao renovar token",e),f(null),!1})):(C("Não é possível renovar token: usuário não autenticado"),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[k,C,w]),S=Q(()=>{x.current&&clearInterval(x.current),x.current=setInterval(function(){try{return Promise.resolve(E()).then(function(){})}catch(e){return Promise.reject(e)}},6e4),C("Renovação automática de token configurada")},[E,C]),D=Q(()=>{x.current&&(clearInterval(x.current),x.current=null,C("Renovação automática de token removida"))},[C]);ee(()=>{if(b.current)return;b.current=!0;const r=new er({url:e,realm:t,clientId:o});return y.current=r,r.onTokenExpired=function(){try{return C("Token expirado, tentando renovar..."),Promise.resolve(E()).then(function(){})}catch(e){return Promise.reject(e)}},r.onAuthRefreshError=()=>{w("Erro ao renovar autenticação - refresh token inválido"),f(null),D()},r.onAuthLogout=()=>{C("Usuário deslogado em outra sessão"),f(null),D()},r.init({onLoad:"check-sso",pkceMethod:"S256",silentCheckSsoRedirectUri:"undefined"!=typeof window?`${window.location.origin}${l}/silent-check-sso.html`:void 0,checkLoginIframe:!0,checkLoginIframeInterval:30}).then(e=>{if(localStorage.getItem(Oi))return localStorage.removeItem(Oi),localStorage.removeItem("user-data.img"),C("Logout pendente detectado, limpando estado e chamando onLogoutSuccess..."),f(null),g(!0),D(),e&&r&&r.clearToken(),void u?.();if(g(!0),!e)return C("Usuário não autenticado"),void f(null);const t=k(r);t&&(f(t),S(),C("Autenticação bem-sucedida",{user:t.preferred_username}),c?.(t))}).catch(e=>{w("Falha na inicialização do Keycloak",e),g(!0),f(null);const r=e instanceof Error?e:new Error("Falha na autenticação");d?.(r)}),"success"===v.query.status&&window.history.replaceState(null,"",v.pathname),()=>{D()}},[e,t,o,a,v.query,v.pathname,k,S,D,E,C,w,c,d,u]);const I=Q(e=>{const r=y.current;if(!r){const r=new Error("Keycloak não inicializado");return w("Tentativa de login com Keycloak não inicializado"),void e?.onError?.(r)}C("Iniciando fluxo de login...",{authenticated:r.authenticated,clientId:r.clientId});const t={redirectUri:e?.redirectUri||s||window.location.href,idpHint:e?.idpHint,loginHint:e?.loginHint,prompt:e?.prompt,action:e?.action,locale:e?.locale,acr:e?.acr,scope:e?.scope,maxAge:e?.maxAge};r.login(t).then(()=>{e?.onSuccess?.()}).catch(r=>{const t=r instanceof Error?r:new Error("Falha no login");w("Erro no login",t),e?.onError?.(t)})},[s,C,w]),Y=Q(function(e){try{function r(){localStorage.setItem(Oi,"true"),D();const r=e?.redirectUri||`${window.location.origin}${l}`;if(C("Redirecionando para logout...",{redirectUri:r,type:i}),"govbr"===i&&t.token)try{const e=new URL(`${t.authServerUrl}/realms/${t.realm}/protocol/openid-connect/logout`);return e.searchParams.set("client_id",t.clientId||o),e.searchParams.set("post_logout_redirect_uri",r),e.searchParams.set("id_token_hint",t.idToken||""),e.searchParams.set("initiating_idp","oidc"),C("Logout GovBR federado - redirecionando para:",e.toString()),void(window.location.href=e.toString())}catch(e){w("Erro ao construir URL de logout federado, usando fallback",e)}const n=Mi(function(){return Promise.resolve(t.logout({redirectUri:r,logoutMethod:e?.logoutMethod})).then(function(){})},function(e){localStorage.removeItem(Oi),w("Erro no logout",e)});if(n&&n.then)return n.then(function(){})}const t=y.current;if(!t)return w("Tentativa de logout com Keycloak não inicializado"),Promise.resolve();C("Iniciando fluxo de logout...");const n=function(){if(e?.onBeforeLogout){const r=Mi(function(){return Promise.resolve(e.onBeforeLogout()).then(function(){})},function(e){w("Erro no callback onBeforeLogout",e)});if(r&&r.then)return r.then(function(){})}}();return Promise.resolve(n&&n.then?n.then(r):r())}catch(a){return Promise.reject(a)}},[C,w,D,i,o]),M=Q(e=>{const r={token:e.access_token,roles:e.claims.roles.map(e=>e.name),sub:e.claims.sub,exp:e.claims.exp,iat:e.claims.iat,email_verified:"true"===e.claims.email_verified,preferred_username:e.claims.preferred_username,email:e.claims.email,name:e.claims.name,given_name:e.claims.given_name};f(r),C("Dados de usuário externo salvos",{username:r.preferred_username})},[C]),O=Q(e=>m?.roles?.includes(e)??!1,[m?.roles]),V=Q(e=>!(!m?.roles||0===e.length)&&e.every(e=>m.roles.includes(e)),[m?.roles]),T=Q(e=>!(!m?.roles||0===e.length)&&e.some(e=>m.roles.includes(e)),[m?.roles]),A=re(()=>({user:m,isAuth:!!m,userLoaded:h,login:I,logout:Y,saveUserData:M,type:i,refreshToken:E,hasRole:O,hasAllRoles:V,hasAnyRole:T,accessToken:m?.token}),[m,h,I,Y,M,i,E,O,V,T]);return r(sr.Provider,{value:A,children:n})}const Ti="nextauth.token",Ai="user-data.img";function Ri({children:e,AUTH_URL:t,oidcConfig:o,redirectURL:n,validateTokenRoute:i,testToken:a,testIP:l,logoutURL:s=n}){const c=o.authority+"/authorize?response_type=code&client_id="+o.client_id+"&scope="+o.scope+"&redirect_uri="+o.redirect_uri,[d,u]=Z(null),[p,m]=Z(!1),f=Ze();ee(()=>{const e=rr(Ti);e?fetch(`${t}${i}`,{method:"POST",headers:{Authorization:`Bearer ${e}`}}).then(r=>{if(r.ok){const r=nr(e),t=localStorage.getItem(Ai);u({name:r.given_name,image:t??"",roles:r.roles.map(e=>String(e.code)),token:e,preferred_username:r.preferred_username,email:r.email,email_verified:"true"===r.email_verified,sub:r.sub}),m(!0)}else y()}):m(!0)},[]);const h=Q(e=>{if(!location||"localhost"!==location.hostname&&location.hostname!==l)m(!1),f.replace(c);else{const r=a;tr(Ti,r),u({name:"Teste",image:"",roles:["1"],token:r}),f.replace(e?.redirectUri?.toString()||n).then(()=>{m(!0),e?.onSuccess?.()}).catch(r=>{e?.onError?.(r instanceof Error?r:new Error("Erro no redirecionamento"))})}},[l,a,n,c,f]),g=Q(function(e){try{const r=e.ssp_token;tr(Ti,r);const t=nr(r),o=nr(e.id_token);return Promise.resolve(fetch(o.picture,{headers:{Authorization:`Bearer ${e.access_token}`}}).then(e=>{200===e.status&&e.blob().then(e=>{const o=new FileReader;o.readAsDataURL(e),o.onload=()=>{const e=o.result;localStorage.setItem(Ai,e),u({name:t.name,image:e,roles:t.roles.map(e=>String(e.code)),token:r,preferred_username:t.preferred_username,email:t.email,sub:t.sub}),f.replace(n).finally(()=>m(!0))}}),u({name:t.name,image:"",roles:t.roles.map(e=>String(e.code)),token:r,preferred_username:t.preferred_username,email:t.email,sub:t.sub}),f.replace(n).finally(()=>m(!0))})).then(function(){f.replace(n).finally(()=>m(!0))})}catch(e){return Promise.reject(e)}},[n,f]),y=Q(function(e){try{function r(){m(!1),f.replace(e?.redirectUri||s).then(()=>{e?.onSuccess?.()}).finally(()=>{u(null),or(Ti),localStorage.removeItem(Ai),m(!0)})}const t=function(){if(e?.onBeforeLogout){const r=function(r,t){try{var o=Promise.resolve(e.onBeforeLogout()).then(function(){})}catch(e){return t(e)}return o&&o.then?o.then(void 0,t):o}(0,function(e){console.error("[OAuthProvider] Erro no callback onBeforeLogout",e)});if(r&&r.then)return r.then(function(){})}}();return Promise.resolve(t&&t.then?t.then(r):r())}catch(o){return Promise.reject(o)}},[s,f]),b=Q(e=>d?.roles?.includes(e)??!1,[d?.roles]),x=Q(e=>!(!d?.roles||0===e.length)&&e.every(e=>d.roles.includes(e)),[d?.roles]),v=Q(e=>!(!d?.roles||0===e.length)&&e.some(e=>d.roles.includes(e)),[d?.roles]),C=Q(function(){try{return console.warn("[OAuthProvider] refreshToken não é suportado neste provider"),Promise.resolve(!1)}catch(e){return Promise.reject(e)}},[]),w=re(()=>({user:d,isAuth:!!d,userLoaded:p,login:h,logout:y,saveUserData:g,type:"govbr",refreshToken:C,hasRole:b,hasAllRoles:x,hasAnyRole:v,accessToken:d?.token}),[d,p,h,y,g,C,b,x,v]);return r(sr.Provider,{value:w,children:e})}function Fi(o){return e(t,{children:[r(Kn,{}),o.children,r(Oe,{position:"bottom-right",theme:"colored"})]})}function $i({name:t,options:a,title:l,required:c=!1,disabled:d=!1,row:u=!1,xs:p=12,sm:m,md:f,defaultValue:h,watchValue:g}){const y=J(dr),b=s();return ee(()=>{void 0!==g&&y.formSetValue(t,g)},[g,t,y]),r(o,{item:!0,xs:p,sm:m,md:f,children:r(pe,{name:t,control:y.formControl,defaultValue:h??"",rules:{required:!!c&&"Este campo é obrigatório"},render:({field:t,fieldState:{error:o}})=>e(T,{error:!!o,disabled:d,fullWidth:!0,children:[l&&r($,{required:c,error:!!o,sx:{mb:1,fontWeight:500,fontSize:"0.875rem"},children:l}),r(i,{display:"flex",flexDirection:u?"row":"column",gap:1,flexWrap:"wrap",children:a.map((o,a)=>{const l=t.value===o.value;return e(i,{onClick:()=>!d&&t.onChange(l&&!c?"":o.value),sx:{border:"1px solid",borderColor:l?b.palette.primary.main:"#E0E0E0",borderRadius:"8px",padding:"8px 16px",cursor:d?"not-allowed":"pointer",backgroundColor:l?`${b.palette.primary.main}10`:"white",transition:"all 0.2s",display:"flex",alignItems:"center",position:"relative",opacity:d?.6:1,"&:hover":{borderColor:d||l?void 0:b.palette.grey[400],backgroundColor:d||l?void 0:b.palette.grey[50]}},children:[r(i,{sx:{width:"18px",height:"18px",borderRadius:"50%",border:"2px solid",borderColor:l?b.palette.primary.main:"#9E9E9E",mr:1.5,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},children:l&&r(i,{sx:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:b.palette.primary.main}})}),r(n,{variant:"body2",color:l?"primary.main":"text.primary",fontWeight:l?600:400,children:o.label})]},a)})}),o&&e(j,{sx:{backgroundColor:"#FFEBEE",borderRadius:"8px",padding:"8px 12px",marginTop:"8px",border:"1px solid #FFCDD2",color:"error.main",display:"flex",alignItems:"center",gap:1,marginLeft:0,marginRight:0},children:[r(N,{fontSize:"small"}),o.message]})]})})})}var ji=/*#__PURE__*/H.memo($i);export{Ti as AUTH_COOKIE_NAME,Sn as ActiveInput,sr as AuthContext,Dn as AutoComplete,Xn as Button,ir as Category,ur as CheckBox,mr as CheckBoxAdditional,fr as CheckBoxWarning,yr as DatePicker,hn as DropFileUpload,Yn as FetchAutoComplete,ar as Field,lr as FieldLabel,cr as File,gn as FileUpload,On as FixedAutoComplete,dr as FormContext,Yi as FormProvider,br as GenericDatePicker,Tn as GenericFetchAutoComplete,$n as GenericInput,Rn as GenericMaskInput,jn as GenericMultInput,si as GenericTable,En as Input,Vi as KeycloakAuthProvider,Un as MODAL,Si as Map,wn as MaskInput,Hn as Menu,Pn as MultInput,Di as NavBar,Ri as OAuthProvider,Nn as OtherCheckBox,ji as Radio,gr as RequiredCheckBoxGroup,Fi as SspComponentsProvider,Ln as Stepper,qn as StepperBlock,bn as Switch,vn as SwitchWatch,Ii as TabNavBar,Ei as Table,xr as TimePicker,xn as ToggleVisibility};
3
3
  //# sourceMappingURL=index.esm.js.map