@ssplib/react-components 0.0.299 → 0.0.300

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.
Files changed (106) hide show
  1. package/Map-31d95a26.js +2 -0
  2. package/Map-31d95a26.js.map +1 -0
  3. package/Map-644d2f90.js +2 -0
  4. package/Map-644d2f90.js.map +1 -0
  5. package/components/detalhes/Category.d.ts +3 -0
  6. package/components/detalhes/Field.d.ts +8 -0
  7. package/components/detalhes/FieldLabel.d.ts +8 -0
  8. package/components/detalhes/File.d.ts +7 -0
  9. package/components/form/checkbox/CheckBox.d.ts +10 -0
  10. package/components/form/checkbox/CheckBoxAdditional.d.ts +7 -0
  11. package/components/form/checkbox/CheckBoxWarning.d.ts +10 -0
  12. package/components/form/checkbox/RequiredCheckBoxValidator.d.ts +5 -0
  13. package/components/form/date/DatePicker.d.ts +13 -0
  14. package/components/form/date/GenericDatePicker.d.ts +13 -0
  15. package/components/form/date/TimePicker.d.ts +10 -0
  16. package/components/form/file/DropFileUpload.d.ts +16 -0
  17. package/components/form/file/FileUpload.d.ts +13 -0
  18. package/components/form/input/ActiveInput.d.ts +12 -0
  19. package/components/form/input/AutoComplete.d.ts +11 -0
  20. package/components/form/input/FetchAutoComplete.d.ts +19 -0
  21. package/components/form/input/FixedAutoComplete.d.ts +18 -0
  22. package/components/form/input/GenericFetchAutoComplete.d.ts +19 -0
  23. package/components/form/input/GenericInput.d.ts +19 -0
  24. package/components/form/input/GenericMaskInput.d.ts +14 -0
  25. package/components/form/input/GenericMultInput.d.ts +13 -0
  26. package/components/form/input/Input.d.ts +19 -0
  27. package/components/form/input/MaskInput.d.ts +14 -0
  28. package/components/form/input/MultInput.d.ts +13 -0
  29. package/components/form/input/OptionalInput.d.ts +10 -0
  30. package/components/form/input/OtherCheckBox.d.ts +7 -0
  31. package/components/form/stepper/Stepper.d.ts +16 -0
  32. package/components/form/stepper/StepperBlock.d.ts +14 -0
  33. package/components/form/switch/Switch.d.ts +11 -0
  34. package/components/form/switch/ToggleVisibility.d.ts +13 -0
  35. package/components/form/table/FilterSection.d.ts +7 -0
  36. package/components/form/table/GenericTable.d.ts +8 -0
  37. package/components/form/table/Table.d.ts +5 -0
  38. package/components/form/table/TableErrorState.d.ts +9 -0
  39. package/components/form/table/TableLoadingState.d.ts +5 -0
  40. package/components/form/table/types.d.ts +212 -0
  41. package/components/form/table/utils.d.ts +29 -0
  42. package/components/icons/icons.d.ts +3 -0
  43. package/components/loading/LinearProgress.d.ts +2 -0
  44. package/components/loading/LoadingScreen.d.ts +7 -0
  45. package/components/map/AnimatedMarker.d.ts +5 -0
  46. package/components/map/DraggableMarker.d.ts +12 -0
  47. package/components/map/Map.d.ts +17 -0
  48. package/components/map/index.d.ts +1 -0
  49. package/components/modal/Modal.d.ts +7 -0
  50. package/components/navbar/NavBar.d.ts +15 -0
  51. package/components/navbar/TabNavBar.d.ts +17 -0
  52. package/components/providers/FormProvider.d.ts +11 -0
  53. package/components/providers/GenericFormProvider.d.ts +10 -0
  54. package/components/providers/KeycloakAuthProvider.d.ts +10 -0
  55. package/components/providers/OAuthProvider.d.ts +18 -0
  56. package/components/providers/SspComponentsProvider.d.ts +3 -0
  57. package/components/teste/Teste.d.ts +3 -0
  58. package/components/utils/Bt.d.ts +8 -0
  59. package/components/utils/CustomMenu.d.ts +12 -0
  60. package/context/auth.d.ts +2 -0
  61. package/context/form.d.ts +20 -0
  62. package/decorators/FormBaseDecorator.d.ts +2 -0
  63. package/decorators/GenericFormBaseDecorator.d.ts +2 -0
  64. package/decorators/StepperDecorator.d.ts +2 -0
  65. package/index.cjs +3 -0
  66. package/index.cjs.map +1 -0
  67. package/index.d.ts +44 -0
  68. package/index.esm.js +3 -0
  69. package/index.esm.js.map +1 -0
  70. package/package.json +7 -8
  71. package/stories/Autocomplete.stories.d.ts +6 -0
  72. package/stories/CheckBox.stories.d.ts +6 -0
  73. package/stories/CheckBoxWarning.stories.d.ts +6 -0
  74. package/stories/DatePicker.stories.d.ts +6 -0
  75. package/stories/DetalhesCategory.stories.d.ts +6 -0
  76. package/stories/DetalhesField.stories.d.ts +6 -0
  77. package/stories/DetalhesFieldLabel.stories.d.ts +6 -0
  78. package/stories/DetalhesFile.stories.d.ts +6 -0
  79. package/stories/DropFileUpload.stories.d.ts +6 -0
  80. package/stories/ExemploAssitirValorInput.stories.d.ts +7 -0
  81. package/stories/ExemploInputs.stories.d.ts +7 -0
  82. package/stories/ExemploTable.stories.d.ts +1 -0
  83. package/stories/ExemploValoresCompartilhados.stories.d.ts +7 -0
  84. package/stories/FetchAutocomplete.stories.d.ts +6 -0
  85. package/stories/FileUpload.stories.d.ts +6 -0
  86. package/stories/FixedAutocomplete.stories.d.ts +6 -0
  87. package/stories/GenericFetchAutocomplete.stories.d.ts +6 -0
  88. package/stories/GenericInput.stories.d.ts +6 -0
  89. package/stories/GenericTable.stories.d.ts +6 -0
  90. package/stories/Input.stories.d.ts +6 -0
  91. package/stories/LinearProgress.stories.d.ts +6 -0
  92. package/stories/LoadingScreen.stories.d.ts +6 -0
  93. package/stories/Map.stories.d.ts +6 -0
  94. package/stories/MultInput.stories.d.ts +6 -0
  95. package/stories/NavBar.stories.d.ts +6 -0
  96. package/stories/OptionalInput.stories.d.ts +6 -0
  97. package/stories/OtherCheckBox.stories.d.ts +6 -0
  98. package/stories/Stepper.stories.d.ts +6 -0
  99. package/stories/StepperBlock.stories.d.ts +6 -0
  100. package/stories/Switch.stories.d.ts +6 -0
  101. package/stories/Table.stories.d.ts +4 -0
  102. package/stories/TableWithStaticData.stories.d.ts +6 -0
  103. package/stories/Teste.stories.d.ts +6 -0
  104. package/stories/TimePicker.stories.d.ts +6 -0
  105. package/types/auth.d.ts +72 -0
  106. package/types/form.d.ts +64 -0
package/index.d.ts ADDED
@@ -0,0 +1,44 @@
1
+ import { Category } from './components/detalhes/Category';
2
+ import { Field } from './components/detalhes/Field';
3
+ import { FieldLabel } from './components/detalhes/FieldLabel';
4
+ import { File } from './components/detalhes/File';
5
+ import CheckBox from './components/form/checkbox/CheckBox';
6
+ import CheckBoxAdditional from './components/form/checkbox/CheckBoxAdditional';
7
+ import CheckBoxWarning from './components/form/checkbox/CheckBoxWarning';
8
+ import RequiredCheckBoxGroup from './components/form/checkbox/RequiredCheckBoxValidator';
9
+ import DatePicker from './components/form/date/DatePicker';
10
+ import GenericDatePicker from './components/form/date/GenericDatePicker';
11
+ import TimePicker from './components/form/date/TimePicker';
12
+ import DropFileUpload from './components/form/file/DropFileUpload';
13
+ import FileUpload from './components/form/file/FileUpload';
14
+ import ActiveInput from './components/form/input/ActiveInput';
15
+ import AutoComplete from './components/form/input/AutoComplete';
16
+ import FetchAutoComplete from './components/form/input/FetchAutoComplete';
17
+ import { FixedAutoComplete } from './components/form/input/FixedAutoComplete';
18
+ import GenericFetchAutoComplete from './components/form/input/GenericFetchAutoComplete';
19
+ import GenericInput from './components/form/input/GenericInput';
20
+ import GenericMaskInput from './components/form/input/GenericMaskInput';
21
+ import GenericMultInput from './components/form/input/GenericMultInput';
22
+ import Input from './components/form/input/Input';
23
+ import MaskInput from './components/form/input/MaskInput';
24
+ import MultInput from './components/form/input/MultInput';
25
+ import OtherCheckBox from './components/form/input/OtherCheckBox';
26
+ import Stepper from './components/form/stepper/Stepper';
27
+ import StepperBlock from './components/form/stepper/StepperBlock';
28
+ import Switch from './components/form/switch/Switch';
29
+ import { SwitchWatch, ToggleVisibility } from './components/form/switch/ToggleVisibility';
30
+ import GenericTable from './components/form/table/GenericTable';
31
+ import Table from './components/form/table/Table';
32
+ import { Map } from './components/map';
33
+ import { MODAL } from './components/modal/Modal';
34
+ import NavBar from './components/navbar/NavBar';
35
+ import TabNavBar from './components/navbar/TabNavBar';
36
+ import FormProvider from './components/providers/FormProvider';
37
+ import { KeycloakAuthProvider } from './components/providers/KeycloakAuthProvider';
38
+ import { cookieName as AUTH_COOKIE_NAME, OAuthProvider } from './components/providers/OAuthProvider';
39
+ import { SspComponentsProvider } from './components/providers/SspComponentsProvider';
40
+ import Button from './components/utils/Bt';
41
+ import Menu from './components/utils/CustomMenu';
42
+ import { AuthContext } from './context/auth';
43
+ import { FormContext } from './context/form';
44
+ export { ActiveInput, AUTH_COOKIE_NAME, AuthContext, AutoComplete, Button, Category, CheckBox, CheckBoxAdditional, CheckBoxWarning, DatePicker, DropFileUpload, FetchAutoComplete, Field, FieldLabel, File, FileUpload, FixedAutoComplete, FormContext, FormProvider, GenericDatePicker, GenericFetchAutoComplete, GenericInput, GenericMaskInput, GenericMultInput, GenericTable, Input, KeycloakAuthProvider, Map, MaskInput, Menu, MODAL, MultInput, NavBar, OAuthProvider, OtherCheckBox, RequiredCheckBoxGroup, SspComponentsProvider, Stepper, StepperBlock, Switch, SwitchWatch, Table, TabNavBar, TimePicker, ToggleVisibility, };
package/index.esm.js ADDED
@@ -0,0 +1,3 @@
1
+ import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{Grid as n,Typography as o,Box as i,Stack as a,Button as l,FormControlLabel as s,Checkbox as c,Card as d,InputLabel as u,TextField as p,SvgIcon as m,useTheme as f,useMediaQuery as h,LinearProgress as g,TableContainer as y,Paper as b,CircularProgress as v,Switch as x,Autocomplete as C,MobileStepper as w,SwipeableDrawer as k,Modal as S,Menu as E,MenuItem as Y,Skeleton as O,IconButton as D,Collapse as M,PaginationItem as I,Alert as V,FormControl as A,Select as T,AppBar as N,Avatar as $}from"@mui/material";import{FileDownload as j,ReportProblemRounded as R,PendingRounded as P,FilterAlt as F,KeyboardArrowDown as z,ExpandLess as L,ExpandMore as _,Refresh as W,KeyboardArrowUp as B}from"@mui/icons-material";import*as q from"react";import U,{createContext as K,useContext as X,useCallback as G,useState as H,useEffect as J,useMemo as Z,useRef as Q}from"react";import ee from"@mui/material/Typography";import te from"lodash.get";import{LocalizationProvider as re,DatePicker as ne,TimePicker as oe}from"@mui/x-date-pickers";import{AdapterDayjs as ie}from"@mui/x-date-pickers/AdapterDayjs";import ae from"dayjs";import"dayjs/locale/pt-br";import le from"lodash.hasin";import{useFormContext as se,useForm as ce}from"react-hook-form";import de from"axios";import{useDropzone as ue}from"react-dropzone";import pe from"@emotion/styled";import{ThemeContext as me}from"@emotion/react";import fe from"@mui/icons-material/CameraAlt";import he from"@mui/icons-material/Delete";import ge from"@mui/icons-material/Done";import ye from"@mui/icons-material/InsertDriveFile";import be from"@mui/icons-material/PictureAsPdf";import ve from"@mui/material/InputLabel";import{IMaskInput as xe}from"react-imask";import{useQuery as Ce}from"react-query";import we from"@mui/icons-material/KeyboardArrowLeft";import ke from"@mui/icons-material/KeyboardArrowRight";import Se from"@mui/icons-material/Save";import{LoadingButton as Ee}from"@mui/lab";import{toast as Ye,ToastContainer as Oe}from"react-toastify";import De from"@mui/icons-material/ContentPasteOutlined";import Me from"@mui/icons-material/Clear";import Ie from"@mui/icons-material/FileDownload";import Ve from"@mui/icons-material/NavigateNextRounded";import Ae from"@mui/icons-material/Search";import Te from"@mui/material/Grid";import Ne from"@mui/material/Pagination";import $e from"@mui/material/TextField";import je from"jszip";import Re from"@mui/icons-material/CloseRounded";import Pe from"tinycolor2";import Fe from"lodash.clonedeep";import*as ze from"xlsx";import Le from"next/dynamic";import _e from"@mui/icons-material/KeyboardArrowDown";import We from"@mui/icons-material/LogoutOutlined";import Be from"@mui/icons-material/Menu";import qe from"@mui/icons-material/Person";import Ue from"@mui/material/LinearProgress";import Ke from"next/image";import Xe from"next/link";import{useRouter as Ge}from"next/router";import He from"keycloak-js";import{getCookie as Je,deleteCookie as Ze,setCookie as Qe}from"cookies-next";import et from"jwt-decode";function tt({title:r}){return e(n,{paddingY:1,item:!0,marginTop:1,marginBottom:3,xs:12,children:[t(o,{textTransform:"uppercase",fontWeight:600,children:r}),t(i,{sx:{backgroundColor:"#94A3B8",height:6,borderRadius:1}})]})}function rt({name:r,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 t(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:[t(o,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l}),s&&t(o,{sx:{backgroundColor:p,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:s})]}),r&&t(i,{children:"false"===String(r)?"Não":"true"===String(r)?"Sim":""===String(r)?"":r?String(r):"Não informado"})]})})}function nt({title:r,xs:i=12,tag:l,md:s,lg:c,paddingBottom:d=3}){let u=l&&"Não"===l?"#FECACA":"Sim"===l?"#BBF7D0":"#E2E8F0";return t(n,{paddingBottom:d,item:!0,xs:i,md:s,lg:c,paddingRight:2,children:e(a,{spacing:1,direction:"row",children:[t(o,{sx:{backgroundColor:"#E2E8F0",maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,fontSize:16,children:r}),l&&t(o,{sx:{backgroundColor:u,maxWidth:"max-content",paddingX:1,borderRadius:2,color:"#1E293B"},fontWeight:600,children:l})]})})}const ot=/*#__PURE__*/K({});function it({title:r,name:i,md:s,fileURL:c,fileExt:d="pdf"}){const{user:u}=X(ot);return t(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:[t(o,{fontWeight:600,sx:{textAlign:"center"},children:r}),e(a,{direction:"row",spacing:2,alignItems:"center",children:[t(j,{sx:{fill:"red"}}),t(o,{children:i})]}),t(a,{alignItems:"center",children:t(l,{variant:"outlined",color:"error",size:"small",endIcon:t(j,{}),onClick:()=>fetch(c,{method:"GET",headers:{Authorization:`Bearer ${u?.token}`}}).then(e=>e.blob()).then(e=>{var t=window.URL.createObjectURL(e);const r=document.createElement("a");r.href=t,r.download=i.split(".")[0]+`.${d}`,r.click()}),children:"Baixar"})})]})})}const at=/*#__PURE__*/K(null);function lt({name:e,title:r,defaultValue:o=!1,xs:i=12,sm:a,md:l,onChange:d}){const u=X(at),p=G(t=>{u?.formSetValue(e,!u?.formGetValues(e))},[u,e]);return t(n,{item:!0,xs:i,sm:a,md:l,children:t(s,{control:t(c,{size:"small",defaultChecked:o}),label:r,...u?.formRegister(e),onChange:d,onClick:p})})}function st(e){let t=[];return e.forEach(e=>{if(e.props)if(e.props.children){const r=st(Array.isArray(e.props.children)?e.props.children:[e.props.children]);t=t.concat(r)}else e.props.name&&t.push(e.props.name)}),t}function ct({customText:r="Selecione pelo menos 1 opção",...o}){const[i,a]=H(!1),[l,s]=H(!0),c=X(at),d=/*#__PURE__*/U.cloneElement(o.children,{onChange:()=>{i&&!c.formGetValues(d.props.name)&&s(!1)}});return e(n,{container:!0,sx:{padding:1,borderRadius:2},children:[t("input",{type:"text",...c.formRegister(o.name,{validate:(e,t)=>{if(i&&l)return!0;const n=st(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),r)}}),hidden:!0}),d,t(n,{item:!0,xs:12,children:i&&l&&o.content})]})}function dt({name:r,title:o,customWarning:i,defaultValue:a=!1,xs:l=12,sm:u,md:p}){const m=X(at);return e(n,{item:!0,xs:l,sm:u,md:p,children:[t(s,{control:t(c,{size:"small",...m.formRegister(r),defaultChecked:a}),label:o}),m.formWatch(r)&&t(d,{sx:{bgcolor:"#FFFBF5",color:"#F59E0B",padding:1,paddingLeft:2},children:i||e(ee,{children:[t("b",{children:"Atenção"})," ",t("i",{children:o})," possui regras específicas."]})})]})}function ut(e){let t=[];return e.forEach(e=>{if(e.props)if(e.props.children){const r=ut(Array.isArray(e.props.children)?e.props.children:[e.props.children]);t=t.concat(r)}else e.props.name&&t.push(e.props.name)}),t}function pt({customText:r="Selecione pelo menos 1 opção",...i}){const a=X(at);return e(n,{container:!0,sx:{border:te(a.errors,i.name)?"2px solid #a51c30":"",padding:1,borderRadius:2},children:[t("input",{type:"text",...a.formRegister(i.name,{validate:(e,t)=>{const n=ut(Array.isArray(i.children)?i.children:[i.children]);let o=!1;return n.forEach((e,t)=>{a.formGetValues(e)&&(o=!0)}),!!o||r}}),hidden:!0},1),i.children,t(n,{item:!0,xs:12,children:t(o,{sx:{color:"#a51c30",fontSize:16,paddingLeft:1},children:te(a.errors,i.name)?.message})})]})}function mt({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=X(at),[v,x]=H(void 0!==f?ae(f,"DD/MM/YYYY"):void 0);return J(()=>{void 0!==v&&b.formSetValue(i,v?v.format("DD/MM/YYYY"):v)},[v]),J(()=>{if(!h)return()=>{b.formUnregister(i)}},[]),t(r,{children:e(n,{item:!0,xs:s,sm:c,md:d,children:[l&&t(u,{required:a,children:l}),e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{minDate:ae(m,"DD/MM/YYYY"),maxDate:ae(g,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:v,onChange:e=>{x(e)},disableHighlightToday:!0,sx:{outline:te(b.errors,i)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>t(p,{size:"small",...e,...b?.formRegister(i,{validate:(e,t)=>!le(t,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||ae(m,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(m,"DD/MM/YYYY").isBefore(ae(e,"DD/MM/YYYY"))?!g||ae(g,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(g,"DD/MM/YYYY").isAfter(ae(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})}),t(o,{sx:{color:"#a51c30",fontSize:14,paddingLeft:1},children:te(b.errors,i)?.message})]})]})})}function ft({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=se(),[v,x]=H(void 0!==f?ae(f,"DD/MM/YYYY"):void 0);return J(()=>{void 0!==v&&b.setValue(i,v?v.format("DD/MM/YYYY"):v)},[v]),J(()=>{if(!h)return()=>{b.unregister(i)}},[]),t(r,{children:e(n,{item:!0,xs:s,sm:c,md:d,children:[l&&t(u,{required:a,children:l}),e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{minDate:ae(m,"DD/MM/YYYY"),maxDate:ae(g,"DD/MM/YYYY"),format:"DD/MM/YYYY",value:v,onChange:e=>{x(void 0)},disableHighlightToday:!0,sx:{outline:te(b.formState.errors,i)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>t(p,{size:"small",...e,...b?.register(i,{validate:(e,t)=>!le(t,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||ae(m,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(m,"DD/MM/YYYY").isBefore(ae(e,"DD/MM/YYYY"))?!g||ae(g,"DD/MM/YYYY").isSame(ae(e,"DD/MM/YYYY"))||ae(g,"DD/MM/YYYY").isAfter(ae(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})}),t(o,{sx:{color:"#a51c30",fontSize:14,paddingLeft:1},children:te(b.formState.errors,i)?.message})]})]})})}function ht({name:r,required:i=!1,title:a,defaultValue:l="",xs:s=12,sm:c,md:d}){const m=X(at),[f,h]=H(l?ae(l,"HH:mm"):null);return J(()=>{m.formSetValue(r,f?f.format("HH:mm"):f)},[f]),J(()=>()=>{m.formUnregister(r)},[]),e(n,{item:!0,xs:s,sm:c,md:d,children:[a&&t(u,{required:i,children:a}),e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(oe,{value:f,ampm:!1,onChange:e=>{h(e)},sx:{outline:te(m.errors,r)?"1px solid #a51c30":"",backgroundColor:"white",width:"100%",div:{input:{paddingX:2,paddingY:1.05}}},inputRef:e=>t(p,{size:"small",...e,...m?.formRegister(r,{validate:(e,t)=>!le(t,r)||(e||(e=""),e.length<=0&&i?"Este campo é obrigatório":e.length<5&&i?"A hora precisa seguir o padrão HH:MM":void 0),shouldUnregister:!0}),fullWidth:!0})}),t(o,{sx:{color:"#a51c30",fontSize:15,paddingLeft:1},children:te(m.errors,r)?.message})]})]})}function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gt.apply(this,arguments)}function yt(e){return null!==e&&"object"==typeof e&&e.constructor===Object}function bt(e){if(!yt(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=bt(e[r])}),t}function vt(e,t,r={clone:!0}){const n=r.clone?gt({},e):e;return yt(e)&&yt(t)&&Object.keys(t).forEach(o=>{"__proto__"!==o&&(n[o]=yt(t[o])&&o in e&&yt(e[o])?vt(e[o],t[o],r):r.clone&&yt(t[o])?bt(t[o]):t[o])}),n}function xt(e){var t={exports:{}};return e(t,t.exports),t.exports}var Ct="function"==typeof Symbol&&Symbol.for,wt=Ct?Symbol.for("react.element"):60103,kt=Ct?Symbol.for("react.portal"):60106,St=Ct?Symbol.for("react.fragment"):60107,Et=Ct?Symbol.for("react.strict_mode"):60108,Yt=Ct?Symbol.for("react.profiler"):60114,Ot=Ct?Symbol.for("react.provider"):60109,Dt=Ct?Symbol.for("react.context"):60110,Mt=Ct?Symbol.for("react.async_mode"):60111,It=Ct?Symbol.for("react.concurrent_mode"):60111,Vt=Ct?Symbol.for("react.forward_ref"):60112,At=Ct?Symbol.for("react.suspense"):60113,Tt=Ct?Symbol.for("react.suspense_list"):60120,Nt=Ct?Symbol.for("react.memo"):60115,$t=Ct?Symbol.for("react.lazy"):60116,jt=Ct?Symbol.for("react.block"):60121,Rt=Ct?Symbol.for("react.fundamental"):60117,Pt=Ct?Symbol.for("react.responder"):60118,Ft=Ct?Symbol.for("react.scope"):60119;function zt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case wt:switch(e=e.type){case Mt:case It:case St:case Yt:case Et:case At:return e;default:switch(e=e&&e.$$typeof){case Dt:case Vt:case $t:case Nt:case Ot:return e;default:return t}}case kt:return t}}}function Lt(e){return zt(e)===It}var _t={AsyncMode:Mt,ConcurrentMode:It,ContextConsumer:Dt,ContextProvider:Ot,Element:wt,ForwardRef:Vt,Fragment:St,Lazy:$t,Memo:Nt,Portal:kt,Profiler:Yt,StrictMode:Et,Suspense:At,isAsyncMode:function(e){return Lt(e)||zt(e)===Mt},isConcurrentMode:Lt,isContextConsumer:function(e){return zt(e)===Dt},isContextProvider:function(e){return zt(e)===Ot},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===wt},isForwardRef:function(e){return zt(e)===Vt},isFragment:function(e){return zt(e)===St},isLazy:function(e){return zt(e)===$t},isMemo:function(e){return zt(e)===Nt},isPortal:function(e){return zt(e)===kt},isProfiler:function(e){return zt(e)===Yt},isStrictMode:function(e){return zt(e)===Et},isSuspense:function(e){return zt(e)===At},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===St||e===It||e===Yt||e===Et||e===At||e===Tt||"object"==typeof e&&null!==e&&(e.$$typeof===$t||e.$$typeof===Nt||e.$$typeof===Ot||e.$$typeof===Dt||e.$$typeof===Vt||e.$$typeof===Rt||e.$$typeof===Pt||e.$$typeof===Ft||e.$$typeof===jt)},typeOf:zt},Wt=xt(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,r=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,v=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r: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 t}}case n:return t}}}var C=d,w=s,k=l,S=r,E=u,Y=o,O=h,D=f,M=n,I=a,V=i,A=p,T=!1;function N(e){return x(e)===d}t.AsyncMode=c,t.ConcurrentMode=C,t.ContextConsumer=w,t.ContextProvider=k,t.Element=S,t.ForwardRef=E,t.Fragment=Y,t.Lazy=O,t.Memo=D,t.Portal=M,t.Profiler=I,t.StrictMode=V,t.Suspense=A,t.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.")),N(e)||x(e)===c},t.isConcurrentMode=N,t.isContextConsumer=function(e){return x(e)===s},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===u},t.isFragment=function(e){return x(e)===o},t.isLazy=function(e){return x(e)===h},t.isMemo=function(e){return x(e)===f},t.isPortal=function(e){return x(e)===n},t.isProfiler=function(e){return x(e)===a},t.isStrictMode=function(e){return x(e)===i},t.isSuspense=function(e){return x(e)===p},t.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===v||e.$$typeof===g)},t.typeOf=x}()}),Bt=xt(function(e){e.exports="production"===process.env.NODE_ENV?_t:Wt}),qt=Object.getOwnPropertySymbols,Ut=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable,Xt=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 t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(t).map(function(e){return t[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,t){for(var r,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 r=Object(arguments[i]))Ut.call(r,a)&&(o[a]=r[a]);if(qt){n=qt(r);for(var l=0;l<n.length;l++)Kt.call(r,n[l])&&(o[n[l]]=r[n[l]])}}return o},Gt=Function.call.bind(Object.prototype.hasOwnProperty),Ht="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Jt=Gt,Zt=function(){};if("production"!==process.env.NODE_ENV){var Qt=Ht,er={},tr=Jt;Zt=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function rr(e,t,r,n,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(tr(e,i)){var a;try{if("function"!=typeof e[i]){var l=Error((n||"React class")+": "+r+" 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](t,i,n,r,null,Qt)}catch(e){a=e}if(!a||a instanceof Error||Zt((n||"React class")+": type specification of "+r+" `"+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 er)){er[a.message]=!0;var s=o?o():"";Zt("Failed "+r+" type: "+a.message+(null!=s?s:""))}}}rr.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(er={})};var nr=rr,or=function(){};function ir(){return null}function ar(){}function lr(){}"production"!==process.env.NODE_ENV&&(or=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),lr.resetWarningCache=ar;var sr,cr=xt(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var r="function"==typeof Symbol&&Symbol.iterator,n="<<anonymous>>",o={array:s("array"),bigint:s("bigint"),bool:s("boolean"),func:s("function"),number:s("number"),object:s("object"),string:s("string"),symbol:s("symbol"),any:l(ir),arrayOf:function(e){return l(function(t,r,n,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+n+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new a("Invalid "+o+" `"+i+"` of type `"+u(l)+"` supplied to `"+n+"`, expected an array.");for(var s=0;s<l.length;s++){var c=e(l,s,n,o,i+"["+s+"]",Ht);if(c instanceof Error)return c}return null})},element:l(function(t,r,n,o,i){var l=t[r];return e(l)?null:new a("Invalid "+o+" `"+i+"` of type `"+u(l)+"` supplied to `"+n+"`, expected a single ReactElement.")}),elementType:l(function(e,t,r,n,o){var i=e[t];return Bt.isValidElementType(i)?null:new a("Invalid "+n+" `"+o+"` of type `"+u(i)+"` supplied to `"+r+"`, expected a single ReactElement type.")}),instanceOf:function(e){return l(function(t,r,o,i,l){return t[r]instanceof e?null:new a("Invalid "+i+" `"+l+"` of type `"+((s=t[r]).constructor&&s.constructor.name?s.constructor.name:n)+"` supplied to `"+o+"`, expected instance of `"+(e.name||n)+"`.");var s})},node:l(function(e,t,r,n,o){return d(e[t])?null:new a("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")}),objectOf:function(e){return l(function(t,r,n,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+n+"` has invalid PropType notation inside objectOf.");var l=t[r],s=u(l);if("object"!==s)return new a("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+n+"`, expected an object.");for(var c in l)if(Jt(l,c)){var d=e(l,c,n,o,i+"."+c,Ht);if(d instanceof Error)return d}return null})},oneOf:function(e){return Array.isArray(e)?l(function(t,r,n,o,l){for(var s=t[r],c=0;c<e.length;c++)if(i(s,e[c]))return null;var d=JSON.stringify(e,function(e,t){return"symbol"===p(t)?String(t):t});return new a("Invalid "+o+" `"+l+"` of value `"+String(s)+"` supplied to `"+n+"`, expected one of "+d+".")}):("production"!==process.env.NODE_ENV&&or(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."),ir)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&or("Invalid argument supplied to oneOfType, expected an instance of array."),ir;for(var t=0;t<e.length;t++){var r=e[t];if("function"!=typeof r)return or("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(r)+" at index "+t+"."),ir}return l(function(t,r,n,o,i){for(var l=[],s=0;s<e.length;s++){var c=(0,e[s])(t,r,n,o,i,Ht);if(null==c)return null;c.data&&Jt(c.data,"expectedType")&&l.push(c.data.expectedType)}return new a("Invalid "+o+" `"+i+"` supplied to `"+n+"`"+(l.length>0?", expected one of type ["+l.join(", ")+"]":"")+".")})},shape:function(e){return l(function(t,r,n,o,i){var l=t[r],s=u(l);if("object"!==s)return new a("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+n+"`, expected `object`.");for(var d in e){var m=e[d];if("function"!=typeof m)return c(n,o,i,d,p(m));var f=m(l,d,n,o,i+"."+d,Ht);if(f)return f}return null})},exact:function(e){return l(function(t,r,n,o,i){var l=t[r],s=u(l);if("object"!==s)return new a("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+n+"`, expected `object`.");var d=Xt({},t[r],e);for(var m in d){var f=e[m];if(Jt(e,m)&&"function"!=typeof f)return c(n,o,i,m,p(f));if(!f)return new a("Invalid "+o+" `"+i+"` key `"+m+"` supplied to `"+n+"`.\nBad object: "+JSON.stringify(t[r],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(l,m,n,o,i+"."+m,Ht);if(h)return h}return null})}};function i(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function a(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function l(e){if("production"!==process.env.NODE_ENV)var r={},o=0;function i(i,l,s,c,d,u,p){if(c=c||n,u=u||s,p!==Ht){if(t){var m=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 m.name="Invariant Violation",m}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var f=c+":"+s;!r[f]&&o<3&&(or("You are manually calling a React.PropTypes validation function for the `"+u+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),r[f]=!0,o++)}}return null==l[s]?i?new a(null===l[s]?"The "+d+" `"+u+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+d+" `"+u+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(l,s,c,d,u)}var l=i.bind(null,!1);return l.isRequired=i.bind(null,!0),l}function s(e){return l(function(t,r,n,o,i,l){var s=t[r];return u(s)!==e?new a("Invalid "+o+" `"+i+"` of type `"+p(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null})}function c(e,t,r,n,o){return new a((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function d(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(d);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(!d(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!d(a[1]))return!1}return!0;default:return!1}}function u(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function p(e){if(null==e)return""+e;var t=u(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function m(e){var t=p(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return a.prototype=Error.prototype,o.checkPropTypes=nr,o.resetWarningCache=nr.resetWarningCache,o.PropTypes=o,o}(Bt.isElement,!0):function(){function e(e,t,r,n,o,i){if(i!==Ht){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 t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:lr,resetWarningCache:ar};return r.PropTypes=r,r}()}),dr=Symbol.for("react.element"),ur=Symbol.for("react.portal"),pr=Symbol.for("react.fragment"),mr=Symbol.for("react.strict_mode"),fr=Symbol.for("react.profiler"),hr=Symbol.for("react.provider"),gr=Symbol.for("react.context"),yr=Symbol.for("react.server_context"),br=Symbol.for("react.forward_ref"),vr=Symbol.for("react.suspense"),xr=Symbol.for("react.suspense_list"),Cr=Symbol.for("react.memo"),wr=Symbol.for("react.lazy"),kr=Symbol.for("react.offscreen");function Sr(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case dr:switch(e=e.type){case pr:case fr:case mr:case vr:case xr:return e;default:switch(e=e&&e.$$typeof){case yr:case gr:case br:case wr:case Cr:case hr:return e;default:return t}}case ur:return t}}}sr=Symbol.for("react.module.reference");var Er={ContextConsumer:gr,ContextProvider:hr,Element:dr,ForwardRef:br,Fragment:pr,Lazy:wr,Memo:Cr,Portal:ur,Profiler:fr,StrictMode:mr,Suspense:vr,SuspenseList:xr,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Sr(e)===gr},isContextProvider:function(e){return Sr(e)===hr},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===dr},isForwardRef:function(e){return Sr(e)===br},isFragment:function(e){return Sr(e)===pr},isLazy:function(e){return Sr(e)===wr},isMemo:function(e){return Sr(e)===Cr},isPortal:function(e){return Sr(e)===ur},isProfiler:function(e){return Sr(e)===fr},isStrictMode:function(e){return Sr(e)===mr},isSuspense:function(e){return Sr(e)===vr},isSuspenseList:function(e){return Sr(e)===xr},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===pr||e===fr||e===mr||e===vr||e===xr||e===kr||"object"==typeof e&&null!==e&&(e.$$typeof===wr||e.$$typeof===Cr||e.$$typeof===hr||e.$$typeof===gr||e.$$typeof===br||e.$$typeof===sr||void 0!==e.getModuleId)},typeOf:Sr},Yr=xt(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e,r=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 t=e.$$typeof;switch(t){case r: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 t}}case n:return t}}}e=Symbol.for("react.module.reference");var y=l,b=r,v=d,x=o,C=f,w=m,k=n,S=a,E=i,Y=u,O=p,D=!1,M=!1;t.ContextConsumer=s,t.ContextProvider=y,t.Element=b,t.ForwardRef=v,t.Fragment=x,t.Lazy=C,t.Memo=w,t.Portal=k,t.Profiler=S,t.StrictMode=E,t.Suspense=Y,t.SuspenseList=O,t.isAsyncMode=function(e){return D||(D=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},t.isConcurrentMode=function(e){return M||(M=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},t.isContextConsumer=function(e){return g(e)===s},t.isContextProvider=function(e){return g(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return g(e)===d},t.isFragment=function(e){return g(e)===o},t.isLazy=function(e){return g(e)===f},t.isMemo=function(e){return g(e)===m},t.isPortal=function(e){return g(e)===n},t.isProfiler=function(e){return g(e)===a},t.isStrictMode=function(e){return g(e)===i},t.isSuspense=function(e){return g(e)===u},t.isSuspenseList=function(e){return g(e)===p},t.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===o||t===a||t===i||t===u||t===p||t===h||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===m||t.$$typeof===l||t.$$typeof===s||t.$$typeof===d||t.$$typeof===e||void 0!==t.getModuleId)},t.typeOf=g}()}),Or=xt(function(e){e.exports="production"===process.env.NODE_ENV?Er:Yr});const Dr=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Mr(e,t=""){return e.displayName||e.name||function(e){const t=`${e}`.match(Dr);return t&&t[1]||""}(e)||t}function Ir(e,t,r){const n=Mr(t);return e.displayName||(""!==n?`${r}(${n})`:r)}function Vr(e){if("string"!=typeof e)throw new Error("production"!==process.env.NODE_ENV?"MUI: `capitalize(string)` expects a string argument.":function(e){let t="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Ar(e,t){const r=gt({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=gt({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},i&&Object.keys(i)?o&&Object.keys(o)?(r[n]=gt({},i),Object.keys(o).forEach(e=>{r[n][e]=Ar(o[e],i[e])})):r[n]=i:r[n]=o}else void 0===r[n]&&(r[n]=e[n])}),r}const Tr=e=>e;var Nr=(()=>{let e=Tr;return{configure(t){e=t},generate:t=>e(t),reset(){e=Tr}}})();const $r={active:"active",checked:"checked",completed:"completed",disabled:"disabled",readOnly:"readOnly",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",required:"required",selected:"selected"};function jr(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(o[r]=e[r]);return o}const Rr=["values","unit","step"];var Pr={borderRadius:4},Fr="production"!==process.env.NODE_ENV?cr.oneOfType([cr.number,cr.string,cr.object,cr.array]):{};function zr(e,t){return t?vt(e,t,{clone:!1}):e}const Lr={xs:0,sm:600,md:900,lg:1200,xl:1536},_r={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Lr[e]}px)`};function Wr(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const e=n.breakpoints||_r;return t.reduce((n,o,i)=>(n[e.up(e.keys[i])]=r(t[i]),n),{})}if("object"==typeof t){const e=n.breakpoints||_r;return Object.keys(t).reduce((n,o)=>(-1!==Object.keys(e.values||Lr).indexOf(o)?n[e.up(o)]=r(t[o],o):n[o]=t[o],n),{})}return r(t)}function Br(e={}){var t;return(null==(t=e.keys)?void 0:t.reduce((t,r)=>(t[e.up(r)]={},t),{}))||{}}function qr(e,t){return e.reduce((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e},t)}function Ur({values:e,breakpoints:t,base:r}){const n=r||function(e,t){if("object"!=typeof e)return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((t,n)=>{n<e.length&&(r[t]=!0)}):n.forEach(t=>{null!=e[t]&&(r[t]=!0)}),r}(e,t),o=Object.keys(n);if(0===o.length)return e;let i;return o.reduce((t,r,n)=>(Array.isArray(e)?(t[r]=null!=e[n]?e[n]:e[i],i=n):"object"==typeof e?(t[r]=null!=e[r]?e[r]:e[i],i=r):t[r]=e,t),{})}function Kr(e,t,r=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&r){const r=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=r)return r}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function Xr(e,t,r,n=r){let o;return o="function"==typeof e?e(r):Array.isArray(e)?e[r]||n:Kr(e,r)||n,t&&(o=t(o,n,e)),o}function Gr(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=e=>{if(null==e[t])return null;const i=e[t],a=Kr(e.theme,n)||{};return Wr(e,i,e=>{let n=Xr(a,o,e);return e===n&&"string"==typeof e&&(n=Xr(a,o,`${t}${"default"===e?"":Vr(e)}`,e)),!1===r?n:{[r]:n}})};return i.propTypes="production"!==process.env.NODE_ENV?{[t]:Fr}:{},i.filterProps=[t],i}const Hr={m:"margin",p:"padding"},Jr={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Zr={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Qr=function(e){const t={};return e=>(void 0===t[e]&&(t[e]=(e=>{if(e.length>2){if(!Zr[e])return[e];e=Zr[e]}const[t,r]=e.split(""),n=Hr[t],o=Jr[r]||"";return Array.isArray(o)?o.map(e=>n+e):[n+o]})(e)),t[e])}(),en=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],tn=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],rn=[...en,...tn];function nn(e,t,r,n){var o;const i=null!=(o=Kr(e,t,!1))?o:r;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.${t}\` 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.${t}\` as a number.`].join("\n"))),i[e]):"function"==typeof i?i:("production"!==process.env.NODE_ENV&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,"It should be a number, an array or a function."].join("\n")),()=>{})}function on(e){return nn(e,"spacing",8,"spacing")}function an(e,t){if("string"==typeof t||null==t)return t;const r=e(Math.abs(t));return t>=0?r:"number"==typeof r?-r:`-${r}`}function ln(e,t){const r=on(e.theme);return Object.keys(e).map(n=>function(e,t,r,n){if(-1===t.indexOf(r))return null;const o=function(e,t){return r=>e.reduce((e,n)=>(e[n]=an(t,r),e),{})}(Qr(r),n);return Wr(e,e[r],o)}(e,t,n,r)).reduce(zr,{})}function sn(e){return ln(e,en)}function cn(e){return ln(e,tn)}function dn(...e){const t=e.reduce((e,t)=>(t.filterProps.forEach(r=>{e[r]=t}),e),{}),r=e=>Object.keys(e).reduce((r,n)=>t[n]?zr(r,t[n](e)):r,{});return r.propTypes="production"!==process.env.NODE_ENV?e.reduce((e,t)=>Object.assign(e,t.propTypes),{}):{},r.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),r}function un(e){return"number"!=typeof e?e:`${e}px solid`}sn.propTypes="production"!==process.env.NODE_ENV?en.reduce((e,t)=>(e[t]=Fr,e),{}):{},sn.filterProps=en,cn.propTypes="production"!==process.env.NODE_ENV?tn.reduce((e,t)=>(e[t]=Fr,e),{}):{},cn.filterProps=tn,"production"===process.env.NODE_ENV||rn.reduce((e,t)=>(e[t]=Fr,e),{});const pn=Gr({prop:"border",themeKey:"borders",transform:un}),mn=Gr({prop:"borderTop",themeKey:"borders",transform:un}),fn=Gr({prop:"borderRight",themeKey:"borders",transform:un}),hn=Gr({prop:"borderBottom",themeKey:"borders",transform:un}),gn=Gr({prop:"borderLeft",themeKey:"borders",transform:un}),yn=Gr({prop:"borderColor",themeKey:"palette"}),bn=Gr({prop:"borderTopColor",themeKey:"palette"}),vn=Gr({prop:"borderRightColor",themeKey:"palette"}),xn=Gr({prop:"borderBottomColor",themeKey:"palette"}),Cn=Gr({prop:"borderLeftColor",themeKey:"palette"}),wn=e=>{if(null!=e.borderRadius){const t=nn(e.theme,"shape.borderRadius",4,"borderRadius");return Wr(e,e.borderRadius,e=>({borderRadius:an(t,e)}))}return null};wn.propTypes="production"!==process.env.NODE_ENV?{borderRadius:Fr}:{},wn.filterProps=["borderRadius"],dn(pn,mn,fn,hn,gn,yn,bn,vn,xn,Cn,wn);const kn=e=>{if(null!=e.gap){const t=nn(e.theme,"spacing",8,"gap");return Wr(e,e.gap,e=>({gap:an(t,e)}))}return null};kn.propTypes="production"!==process.env.NODE_ENV?{gap:Fr}:{},kn.filterProps=["gap"];const Sn=e=>{if(null!=e.columnGap){const t=nn(e.theme,"spacing",8,"columnGap");return Wr(e,e.columnGap,e=>({columnGap:an(t,e)}))}return null};Sn.propTypes="production"!==process.env.NODE_ENV?{columnGap:Fr}:{},Sn.filterProps=["columnGap"];const En=e=>{if(null!=e.rowGap){const t=nn(e.theme,"spacing",8,"rowGap");return Wr(e,e.rowGap,e=>({rowGap:an(t,e)}))}return null};function Yn(e,t){return"grey"===t?t:e}function On(e){return e<=1&&0!==e?100*e+"%":e}En.propTypes="production"!==process.env.NODE_ENV?{rowGap:Fr}:{},En.filterProps=["rowGap"],dn(kn,Sn,En,Gr({prop:"gridColumn"}),Gr({prop:"gridRow"}),Gr({prop:"gridAutoFlow"}),Gr({prop:"gridAutoColumns"}),Gr({prop:"gridAutoRows"}),Gr({prop:"gridTemplateColumns"}),Gr({prop:"gridTemplateRows"}),Gr({prop:"gridTemplateAreas"}),Gr({prop:"gridArea"})),dn(Gr({prop:"color",themeKey:"palette",transform:Yn}),Gr({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Yn}),Gr({prop:"backgroundColor",themeKey:"palette",transform:Yn}));const Dn=Gr({prop:"width",transform:On}),Mn=e=>null!=e.maxWidth?Wr(e,e.maxWidth,t=>{var r,n,o;return{maxWidth:(null==(r=e.theme)||null==(n=r.breakpoints)||null==(o=n.values)?void 0:o[t])||Lr[t]||On(t)}}):null;Mn.filterProps=["maxWidth"];const In=Gr({prop:"minWidth",transform:On}),Vn=Gr({prop:"height",transform:On}),An=Gr({prop:"maxHeight",transform:On}),Tn=Gr({prop:"minHeight",transform:On});Gr({prop:"size",cssProperty:"width",transform:On}),Gr({prop:"size",cssProperty:"height",transform:On}),dn(Dn,Mn,In,Vn,An,Tn,Gr({prop:"boxSizing"}));var Nn={border:{themeKey:"borders",transform:un},borderTop:{themeKey:"borders",transform:un},borderRight:{themeKey:"borders",transform:un},borderBottom:{themeKey:"borders",transform:un},borderLeft:{themeKey:"borders",transform:un},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:wn},color:{themeKey:"palette",transform:Yn},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Yn},backgroundColor:{themeKey:"palette",transform:Yn},p:{style:cn},pt:{style:cn},pr:{style:cn},pb:{style:cn},pl:{style:cn},px:{style:cn},py:{style:cn},padding:{style:cn},paddingTop:{style:cn},paddingRight:{style:cn},paddingBottom:{style:cn},paddingLeft:{style:cn},paddingX:{style:cn},paddingY:{style:cn},paddingInline:{style:cn},paddingInlineStart:{style:cn},paddingInlineEnd:{style:cn},paddingBlock:{style:cn},paddingBlockStart:{style:cn},paddingBlockEnd:{style:cn},m:{style:sn},mt:{style:sn},mr:{style:sn},mb:{style:sn},ml:{style:sn},mx:{style:sn},my:{style:sn},margin:{style:sn},marginTop:{style:sn},marginRight:{style:sn},marginBottom:{style:sn},marginLeft:{style:sn},marginX:{style:sn},marginY:{style:sn},marginInline:{style:sn},marginInlineStart:{style:sn},marginInlineEnd:{style:sn},marginBlock:{style:sn},marginBlockStart:{style:sn},marginBlockEnd:{style:sn},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:kn},rowGap:{style:En},columnGap:{style:Sn},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:On},maxWidth:{style:Mn},minWidth:{transform:On},height:{transform:On},maxHeight:{transform:On},minHeight:{transform:On},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};const $n=function(){function e(e,t,r,n){const o={[e]:t,theme:r},i=n[e];if(!i)return{[e]:t};const{cssProperty:a=e,themeKey:l,transform:s,style:c}=i;if(null==t)return null;if("typography"===l&&"inherit"===t)return{[e]:t};const d=Kr(r,l)||{};return c?c(o):Wr(o,t,t=>{let r=Xr(d,s,t);return t===r&&"string"==typeof t&&(r=Xr(d,s,`${e}${"default"===t?"":Vr(t)}`,t)),!1===a?r:{[a]:r}})}return function t(r){var n;const{sx:o,theme:i={}}=r||{};if(!o)return null;const a=null!=(n=i.unstable_sxConfig)?n:Nn;function l(r){let n=r;if("function"==typeof r)n=r(i);else if("object"!=typeof r)return r;if(!n)return null;const o=Br(i.breakpoints),l=Object.keys(o);let s=o;return Object.keys(n).forEach(r=>{const o="function"==typeof(l=n[r])?l(i):l;var l;if(null!=o)if("object"==typeof o)if(a[r])s=zr(s,e(r,o,i,a));else{const e=Wr({theme:i},o,e=>({[r]:e}));!function(...e){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),r=new Set(t);return e.every(e=>r.size===Object.keys(e).length)}(e,o)?s=zr(s,e):s[r]=t({sx:o,theme:i})}else s=zr(s,e(r,o,i,a))}),qr(l,s)}return Array.isArray(o)?o.map(l):l(o)}}();$n.filterProps=["sx"];var jn=$n;const Rn=["breakpoints","palette","spacing","shape"];function Pn(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={}}=e,a=jr(e,Rn),l=function(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5}=e,o=jr(e,Rr),i=(e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>gt({},e,{[t.key]:t.val}),{})})(t),a=Object.keys(i);function l(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r})`}function s(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-n/100}${r})`}function c(e,o){const i=a.indexOf(o);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${r}) and (max-width:${(-1!==i&&"number"==typeof t[a[i]]?t[a[i]]:o)-n/100}${r})`}return gt({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 t=a.indexOf(e);return 0===t?l(a[1]):t===a.length-1?s(a[t]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:r},o)}(r),s=function(e=8){if(e.mui)return e;const t=on({spacing:e}),r=(...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 r=t(e);return"number"==typeof r?`${r}px`:r}).join(" "));return r.mui=!0,r}(o);let c=vt({breakpoints:l,direction:"ltr",components:{},palette:gt({mode:"light"},n),spacing:s,shape:gt({},Pr,i)},a);return c=t.reduce((e,t)=>vt(e,t),c),c.unstable_sxConfig=gt({},Nn,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return jn({sx:e,theme:this})},c}const Fn=Pn(),zn=["sx"];function Ln(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Ln(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function _n(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Ln(e))&&(n&&(n+=" "),n+=t);return n}const Wn=["variant"];function Bn(e){return 0===e.length}function qn(e){const{variant:t}=e,r=jr(e,Wn);let n=t||"";return Object.keys(r).sort().forEach(t=>{n+="color"===t?Bn(n)?e[t]:Vr(e[t]):`${Bn(n)?t:Vr(t)}${Vr(e[t].toString())}`}),n}const Un=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function Kn(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}const Xn=Pn();function Gn({defaultTheme:e,theme:t,themeId:r}){return 0===Object.keys(t).length?e:t[r]||t}const Hn=function(e={}){const{themeId:t,defaultTheme:r=Xn,rootShouldForwardProp:n=Kn,slotShouldForwardProp:o=Kn}=e,i=e=>jn(gt({},e,{theme:Gn(gt({},e,{defaultTheme:r,themeId:t}))}));return i.__mui_systemSx=!0,(e,a={})=>{((e,t)=>{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=jr(a,Un),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=Kn;"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,t){const r=pe(e,t);return"production"!==process.env.NODE_ENV?(...t)=>{const n="string"==typeof e?`"${e}"`:"component";return 0===t.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")):t.some(e=>void 0===e)&&console.error(`MUI: the styled(${n})(...args) API requires all its args to be defined.`),r(...t)}:r}(e,gt({shouldForwardProp:y,label:h},p)),v=(n,...o)=>{const a=o?o.map(e=>"function"==typeof e&&e.__emotion_real!==e?n=>e(gt({},n,{theme:Gn(gt({},n,{defaultTheme:r,themeId:t}))})):e):[];let c=n;l&&u&&a.push(e=>{const n=Gn(gt({},e,{defaultTheme:r,themeId:t})),o=((e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null)(l,n);if(o){const t={};return Object.entries(o).forEach(([r,o])=>{t[r]="function"==typeof o?o(gt({},e,{theme:n})):o}),u(e,t)}return null}),l&&!m&&a.push(e=>{const n=Gn(gt({},e,{defaultTheme:r,themeId:t}));return((e,t,r,n)=>{var o,i;const{ownerState:a={}}=e,l=[],s=null==r||null==(o=r.components)||null==(i=o[n])?void 0:i.variants;return s&&s.forEach(r=>{let n=!0;Object.keys(r.props).forEach(t=>{a[t]!==r.props[t]&&e[t]!==r.props[t]&&(n=!1)}),n&&l.push(t[qn(r.props)])}),l})(e,((e,t)=>{let r=[];t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants);const n={};return r.forEach(e=>{const t=qn(e.props);n[t]=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(gt({},e,{theme:Gn(gt({},e,{defaultTheme:r,themeId:t}))})));const p=b(c,...a);if("production"!==process.env.NODE_ENV){let t;l&&(t=`${l}${s||""}`),void 0===t&&(t=`Styled(${function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return Mr(e,"Component");if("object"==typeof e)switch(e.$$typeof){case Or.ForwardRef:return Ir(e,e.render,"ForwardRef");case Or.Memo:return Ir(e,e.type,"memo");default:return}}}(e)})`),p.displayName=t}return e.muiName&&(p.muiName=e.muiName),p};return b.withConfig&&(v.withConfig=b.withConfig),v}}();var Jn=Hn;function Zn(e){const{theme:t,name:r,props:n}=e;return t&&t.components&&t.components[r]&&t.components[r].defaultProps?Ar(t.components[r].defaultProps,n):n}const Qn=["component","direction","spacing","divider","children","className","useFlexGap"],eo=Pn(),to=Jn("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function ro(e){return function({props:e,name:t,defaultTheme:r,themeId:n}){let o=function(e=Fn){return function(e=null){const t=q.useContext(me);return t&&0!==Object.keys(t).length?t:e}(e)}(r);return n&&(o=o[n]||o),Zn({theme:o,name:t,props:e})}({props:e,name:"MuiStack",defaultTheme:eo})}function no(e,t){const r=q.Children.toArray(e).filter(Boolean);return r.reduce((e,n,o)=>(e.push(n),o<r.length-1&&e.push(/*#__PURE__*/q.cloneElement(t,{key:`separator-${o}`})),e),[])}const oo=({ownerState:e,theme:t})=>{let r=gt({display:"flex",flexDirection:"column"},Wr({theme:t},Ur({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e})));if(e.spacing){const n=on(t),o=Object.keys(t.breakpoints.values).reduce((t,r)=>(("object"==typeof e.spacing&&null!=e.spacing[r]||"object"==typeof e.direction&&null!=e.direction[r])&&(t[r]=!0),t),{}),i=Ur({values:e.direction,base:o}),a=Ur({values:e.spacing,base:o});"object"==typeof i&&Object.keys(i).forEach((e,t,r)=>{i[e]||(i[e]=t>0?i[r[t-1]]:"column")}),r=vt(r,Wr({theme:t},a,(t,r)=>{return e.useFlexGap?{gap:an(n,t)}:{"& > :not(style) + :not(style)":{margin:0,[`margin${o=r?i[r]:e.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[o]}`]:an(n,t)}};var o}))}return r=function(e,...t){const r=Br(e),n=[r,...t].reduce((e,t)=>vt(e,t),{});return qr(Object.keys(r),n)}(t.breakpoints,r),r},io=function(e={}){const{createStyledComponent:r=to,useThemeProps:n=ro,componentName:o="MuiStack"}=e,i=r(oo),a=/*#__PURE__*/q.forwardRef(function(e,r){const a=function(e){const{sx:t}=e,r=jr(e,zn),{systemProps:n,otherProps:o}=(e=>{var t,r;const n={systemProps:{},otherProps:{}},o=null!=(t=null==e||null==(r=e.theme)?void 0:r.unstable_sxConfig)?t:Nn;return Object.keys(e).forEach(t=>{o[t]?n.systemProps[t]=e[t]:n.otherProps[t]=e[t]}),n})(r);let i;return i=Array.isArray(t)?[n,...t]:"function"==typeof t?(...e)=>{const r=t(...e);return yt(r)?gt({},n,r):n}:gt({},n,t),gt({},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=jr(a,Qn),h={direction:s,spacing:c,useFlexGap:m},g=function(e,t,r=undefined){const n={};return Object.keys(e).forEach(o=>{n[o]=e[o].reduce((e,n)=>{if(n){const o=t(n);""!==o&&e.push(o),r&&r[n]&&e.push(r[n])}return e},[]).join(" ")}),n}({root:["root"]},e=>function(e,t,r="Mui"){const n=$r[t];return n?`${r}-${n}`:`${Nr.generate(e)}-${t}`}(o,e),{});/*#__PURE__*/
2
+ return t(i,gt({as:l,ownerState:h,ref:r,className:_n(g.root,p)},f,{children:d?no(u,d):u}))});return"production"!==process.env.NODE_ENV&&(a.propTypes={children:cr.node,direction:cr.oneOfType([cr.oneOf(["column-reverse","column","row-reverse","row"]),cr.arrayOf(cr.oneOf(["column-reverse","column","row-reverse","row"])),cr.object]),divider:cr.node,spacing:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.number,cr.string])),cr.number,cr.object,cr.string]),sx:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.func,cr.object,cr.bool])),cr.func,cr.object])}),a}();"production"!==process.env.NODE_ENV&&(io.propTypes={children:cr.node,component:cr.elementType,direction:cr.oneOfType([cr.oneOf(["column-reverse","column","row-reverse","row"]),cr.arrayOf(cr.oneOf(["column-reverse","column","row-reverse","row"])),cr.object]),divider:cr.node,spacing:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.number,cr.string])),cr.number,cr.object,cr.string]),sx:cr.oneOfType([cr.arrayOf(cr.oneOfType([cr.func,cr.object,cr.bool])),cr.func,cr.object]),useFlexGap:cr.bool});var ao=io;function lo(r){return t(m,{...r,children:e("svg",{width:"26",height:"34",viewBox:"0 0 26 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("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"}),t("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 so(r){return t(m,{...r,children:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("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"}),t("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"}),t("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"}),t("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 co(e){const t=1048576;return e<t?`${(e/1024).toFixed(1)}KB`:`${(e/t).toFixed(1)}MB`}function uo({name:a,tipoArquivo:s,title:c,required:d=!1,multiple:p=!1,apiURL:m,sizeLimit:y=4,xs:b=12,sm:v,md:x,route:C="",tstToken:w="",dropZoneOptions:k}){const{getRootProps:S,getInputProps:E}=ue({multiple:p,useFsAccessApi:!0,onDrop:e=>{I(-1),e.filter(e=>!(e.size/1048576>y&&(P(`Por favor, escolha um arquivo com tamanho inferior a ${y} MB`),setTimeout(()=>{P("")},3e3),1))).forEach((e,t)=>{let r=Date.now()+t;const n=new FormData;n.append("files",e),n.append("tipoArquivo",s),de.post(m,n,{onUploadProgress:t=>{const n=Math.round(100*t.loaded/t.total);I(n),n>=100&&A(t=>[...t,{id:r,name:e.name,loading:!0,error:!1,file:e,size:e.size}])},headers:{Authorization:`Bearer ${""===w?O?O.token:"":w}`}}).then(e=>{if(e.status>200){const t=te(e.data,C,e.data)[0].coSeqArquivo;Y.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:t,CO_TIPO_ARQUIVO:parseInt(s)}]),N(e=>[...e,r]);const n={};n[r]=t,j(e=>({...e,...n}))}else I(-1),F(r)}).catch(e=>{console.log(e),I(-1),F(r)})})},...k||{}}),Y=X(at),{user:O}=X(ot),D=f();h(D.breakpoints.only("xs"));const[M,I]=H(-1),[V,A]=H([]),[T,N]=H([]),[$,j]=H({}),[R,P]=H(""),F=(e,t,r)=>{A(V.filter(t=>t.id!==e)),r&&Y.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==r)),t||(P("Erro ao enviar arquivo. Verifique o formato e tente mais tarde."),setTimeout(()=>{P("")},3e3))};return J(()=>{const e=new DataTransfer;V.forEach(t=>{e.items.add(t.file)}),Y?.formSetValue(a,e.files)},[V,Y,a]),J(()=>()=>{Y.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(s)))},[]),t(n,{item:!0,xs:b,sm:v,md:x,sx:{width:"100%"},children:e(i,{bgcolor:"white",p:2,borderRadius:"8px",color:"#1E293B",children:[t(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(ao,{...S({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:[t("input",{...E(),...Y.formRegister(a,{validate:(e,t)=>{if((e.length&&T.length)<=0&&d)return"O campo de arquivo é obrigatório"}})}),e(ao,{spacing:2,alignItems:"center",children:[e(i,{children:[t(o,{fontWeight:600,fontSize:18,children:"Arraste seus arquivos até aqui"}),t(o,{children:"ou selecione arquivos que estão no seu computador"})]}),t(l,{variant:"contained",sx:{backgroundColor:"#64748B",pointerEvents:"none",borderRadius:"8px",width:"fit-content"},children:"Selecionar"}),e(o,{fontWeight:300,children:["Tamanho máximo por arquivo ",y,"MB"]})]})]}),e(o,{pt:2,fontSize:16,fontWeight:600,children:["Você selecionou ",V.length," arquivo",V.length>1?"s":"","."]}),e(ao,{width:"100%",marginTop:1,spacing:1,children:[V.map(r=>e(ao,{direction:"row",justifyContent:"space-between",border:"solid 1px #E2E8F0",borderRadius:2,p:1,children:[e(ao,{direction:"row",children:[t(ao,{direction:"row",justifyContent:"center",alignItems:"center",minWidth:30,pr:1.5,children:t(lo,{sx:{filter:"invert(42%) sepia(86%) saturate(2412%) hue-rotate(326deg) brightness(86%) contrast(102%)",transform:"scale(1.5)",width:30}})}),e(ao,{children:[t(o,{fontWeight:600,children:r.name}),t(o,{fontSize:14,children:co(r.size)})]})]}),t(l,{size:"small",startIcon:t(so,{}),variant:"contained",onClick:e=>{return t=r.id,void(Object.keys($).includes(t.toString())&&fetch(`${m}/${$[t]}`,{method:"DELETE",headers:{Authorization:`Bearer ${""===w?O?O.token:"":w}`}}).then(e=>{e.ok||F(t,!0,$[t]),200===e.status&&F(t,!0,$[t])}).catch(e=>console.log(e)));var t},sx:{height:40,backgroundColor:"#DE3F50",borderRadius:"8px"},children:"Remover"})]})),M>0&&M<100&&t(g,{value:M,sx:{backgroundColor:"#103D6A",".MuiLinearProgress-bar":{backgroundColor:"#BDDDFA"}}})]}),R&&e(r,{children:[t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,paddingTop:2,children:R}),t("br",{})]}),te(Y?.errors,a)&&t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})})}function po({name:a,tipoArquivo:s,title:c,required:d=!1,multiple:p=!1,apiURL:m,route:g="",sizeLimit:x=4,xs:C=12,sm:w,md:k}){const S=X(at),{user:E}=X(ot),Y=f(),O=h(Y.breakpoints.only("xs")),[D,M]=H([]),[I,V]=H([]),[A,T]=H({}),[N,$]=H(""),j=G(e=>{const t=e.target.files,r=Object.keys(t).map(e=>t[e]);M([...D,...r.filter(e=>!(e.size/1048576>x&&($(`Por favor, escolha um arquivo com tamanho inferior a ${x} MB`),setTimeout(()=>{$("")},3e3),1))).map((e,t)=>{let r=Date.now()+t;const n=new FormData;return n.append("files",e),n.append("tipoArquivo",s),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 t=te(e,g,e)[0].coSeqArquivo;S.setFilesUid(e=>[...e,{CO_SEQ_ARQUIVO:t,CO_TIPO_ARQUIVO:parseInt(s)}]),V(e=>[...e,r]);const n={};n[r]=t,T(e=>({...e,...n}))}else R(r)}):R(r)}).catch(e=>{R(r)}),{id:r,name:e.name,loading:!0,error:!1,file:e}})])},[D,S]),R=(e,t,r)=>{M(D.filter(t=>t.id!==e)),r&&S.setFilesUid(e=>e.filter(e=>e.CO_SEQ_ARQUIVO!==r)),t||($("Erro ao enviar arquivo. Tente novamente mais tarde"),setTimeout(()=>{$("")},3e3))};return J(()=>{const e=new DataTransfer;D.forEach(t=>{e.items.add(t.file)}),S?.formSetValue(a,e.files)},[D,S,a]),J(()=>()=>{S.setFilesUid(e=>e.filter(e=>e.CO_TIPO_ARQUIVO!==parseInt(s)))},[]),e(n,{item:!0,xs:C,sm:w,md:k,sx:{width:"100%"},children:[t(u,{required:d,sx:{marginBottom:2,textTransform:"capitalize"},children:c}),e(i,{sx:{backgroundColor:"#e2eafc",padding:1,borderRadius:1,marginTop:1},children:[t("input",{id:a,type:"file",multiple:p,...S?.formRegister(a,{validate:(e,t)=>{if((e.length&&I.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:j,accept:".pdf",style:{display:"none"}}),t("input",{id:a+"foto",type:"file",capture:"environment",multiple:p,...S?.formRegister(a,{validate:(e,t)=>{if((e.length&&I.length)<=0&&d)return"O campo de arquivo é obrigatório"}}),onChange:j,accept:".jpg, .png, .jpeg",style:{display:"none"}}),e(i,{sx:{display:{sx:"block",md:"flex"}},children:[t(i,{sx:{width:"100%",marginRight:{xs:0,md:1},marginBottom:{xs:1,md:0}},children:!p&&D.length>=1?t(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:t(ye,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"}):t("label",{htmlFor:a,children:t(l,{variant:"contained",disableElevation:!0,startIcon:t(ye,{}),component:"span",sx:{textTransform:"none"},fullWidth:!0,children:"Escolher Documento"})})}),t(i,{sx:{width:"100%"},children:!p&&D.length>=1?t(l,{disabled:!0,variant:"contained",disableElevation:!0,startIcon:t(fe,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:O?"Tirar Foto":"Escolher Imagem"}):t("label",{htmlFor:a+"foto",children:t(l,{variant:"contained",disableElevation:!0,startIcon:t(fe,{}),component:"span",sx:{textTransform:"none",backgroundColor:"#0096c7"},fullWidth:!0,children:O?"Tirar Foto":"Escolher Imagem"})})})]}),e(o,{fontWeight:600,paddingY:1,color:"black",children:["Você selecionou ",D.length," arquivo",D.length>1&&"s"]}),D.length>0&&t(y,{component:b,children:t(ao,{direction:"column",children:D.map(r=>e(ao,{direction:"row",justifyContent:"space-between",padding:.5,children:[t(i,{children:e(ao,{direction:"row",spacing:2,children:[I.includes(r.id)?t(ge,{sx:{fill:"#06d6a0"}}):t(v,{size:22,sx:{color:"black"}}),t(be,{color:"error"}),t(o,{fontWeight:600,children:r.name})]})}),t(i,{children:I.includes(r.id)&&t(l,{variant:"contained",size:"small",sx:{textTransform:"none",backgroundColor:"#d1495b","&:hover":{backgroundColor:"#c1121f"}},onClick:e=>{return t=r.id,void(Object.keys(A).includes(t.toString())&&fetch(`${m}/${A[t]}`,{method:"DELETE",headers:{Authorization:`Bearer ${E?.token}`}}).then(e=>{e.ok||R(t,!0,A[t]),200===e.status&&R(t,!0,A[t])}).catch(e=>console.log(e)));var t},startIcon:t(he,{}),children:"Remover"})})]},r.name))})}),N&&e(r,{children:[t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,paddingTop:2,children:N}),t("br",{})]}),te(S?.errors,a)&&t(o,{variant:"caption",color:"#e53935",fontWeight:600,fontSize:14,children:"* O campo de arquivo é obrigatório"})]})]})}function mo({defaultChecked:r=!1,...n}){const i=X(at);J(()=>{i?.formSetValue(n.name,r)},[]);const l=Z(()=>n.overrideYes||"Sim",[n.overrideYes]),c=Z(()=>n.overrideNo||"Não",[n.overrideNo]);return e(a,{sx:{alignItems:"center",justifyContent:"center"},children:[n.title&&t(u,{children:n.title}),t(s,{control:t(x,{defaultChecked:r,...i?.formRegister(n.name)}),label:t(o,{width:25,sx:{userSelect:"none",fontWeight:600},children:i?.formWatch(n.name)?l:c}),sx:{paddingLeft:1}})]})}var fo=/*#__PURE__*/U.memo(mo);function ho({invert:e=!1,hasCheckValue:n=!1,...o}){const i=X(at);return J(()=>()=>{(n?e:i.formWatch(o.switchId)===e)&&o.unregisterNameList.forEach(e=>i.formUnregister(e))},[o.unregisterNameList]),t(r,{})}function go({invert:n=!1,checkValue:o,...i}){const a=X(at);return t(r,{children:(o?a?.formWatch(i.switchId)===o!==n:a?.formWatch(i.switchId)!==n)&&e(r,{children:[t(ho,{switchId:i.switchId,unregisterNameList:i.unregisterNameList,hasCheckValue:!!o,invert:o?a?.formWatch(i.switchId)===o!==n:n}),i.children]})})}const yo=/*#__PURE__*/U.forwardRef(function(e,r){const{onChange:n,maskProps:o,onMask:i,maskValue:a,setMaskValue:l,watchValue:s,...c}=e,[d,u]=H(o.mask);delete c.value;const p=Q(null),[m,f]=H(""),h=X(at);return J(()=>{s&&f(s)},[s]),J(()=>{h.formSetValue(c.name,p.current.element.value)},[m]),delete c.watchValue,t(xe,{...c,...o,mask:d,value:m,ref:p,inputRef:r,onChange:e=>{},onAccept:(e,t)=>{f(e),t.updateValue(),i&&i(e,u)}})});function bo(e){const n=X(at),[o,i]=H("");return t(r,{children:t(p,{...e.formConfig,onInput:t=>{n.formSetValue(e.formConfig.name,t.target.value)},InputProps:{inputComponent:yo,inputProps:{maskProps:e.maskProps,onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue}},disabled:e.disabled,fullWidth:!0})})}function vo({type:r="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=X(at);return J(()=>{void 0!==f&&g.formSetValue(h.name,f)},[f]),e(n,{item:!0,xs:i,sm:a,md:d,children:[h.title&&t(u,{htmlFor:"campo",required:h.required,children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},n=h.name,i=te(g?.errors,h.name),a=i?.message,d=!!i,u={...g?.formRegister(n,{validate:(e,t)=>{const n=e??"";if(n.length<=0&&h.required)return"Este campo é obrigatório";if("cnpj"===r){if(n.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===r){if(n.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===r){if(n.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===r){if(n.length<9&&h.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===r||"password"===r||"number"===r){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"===r){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"===r){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"===r&&n.length<14&&h.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:d,helperText:a,...e,sx:{backgroundColor:"white"}};switch(r){case"input":case"email":return t(p,{...u,defaultValue:c,disabled:m});case"password":return t(p,{...u,type:"password",disabled:m});case"number":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:o},watchValue:f,disabled:m});case"cep":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-000"},watchValue:f,disabled:m});case"phone":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"(00) [#]0000-0000",definitions:{"#":/^9$/}},watchValue:f,disabled:m});case"sei":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:m});case"cpf_cnpj":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00[0]"},onMask:(e,t)=>{t(e.length>14?"00.000.000/0000-00":"000.000.000-00[0]")},watchValue:f,disabled:m});case"cpf":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00"},watchValue:f,disabled:m});case"cnpj":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"00.000.000/0000-00"},watchValue:f,disabled:m});case"rg":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000[000000]"},watchValue:f,disabled:m})}})()]})}var xo=/*#__PURE__*/U.memo(vo);function Co({name:r,required:o=!1,title:i,defaultChecked:l=!1,xs:s=12,unregisterNameList:c,sm:d,md:u,...p}){const m=`${r}-switch`;return e(n,{item:!0,xs:s,sm:d,md:u,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),e(a,{direction:"row",children:[t(fo,{name:m,defaultChecked:l}),t(go,{switchId:m,unregisterNameList:c,children:t(vo,{name:"ddd",type:"input"})})]})]})}function wo({name:r,required:o=!1,title:i,customPlaceholder:a,url:l,xs:s=12,sm:c,md:d,dataPath:u=""}){const m=X(at),{user:f}=X(ot),[h,g]=H([]);Ce(`autocomplete-${r}`,()=>fetch(l,{headers:{Authorization:`Bearer ${f?f.token:""}`}}).then(e=>e.json().then(e=>g(y(e)))));const y=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,u):void 0,[]),b=G((e,t)=>{m?.formSetValue(r,t?t.id:""),m?.formTrigger(r)},[m,r]);return e(n,{item:!0,xs:s,sm:c,md:d,children:[i&&t(ve,{required:o,children:i}),t("input",{type:"text",...m?.formRegister(r,{validate:(e,t)=>{if(e.length<=0&&o)return"Este campo é obrigatório"}}),hidden:!0}),t(C,{options:h,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:b,renderInput:e=>t(p,{...e,placeholder:a,size:"small",error:!!te(m?.errors,r),helperText:te(m?.errors,r)?.message})})]})}let ko=!0;function So({name:r,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 v=X(at),[x,w]=H(!0),[k,S]=H([]),[E,Y]=H("Carregando..."),[O,D]=H(null),[M,I]=H(null),{user:V}=X(ot);function A(){(c||!l)&&k.length>0||(w(!0),S([]),a&&Y(a),fetch(o,{method:"GET",headers:{Authorization:`Bearer ${V?.token}`}}).then(e=>{e.ok?e.json().then(e=>{S(te(e,d,e)),w(!1)}):Y("Erro ao carregar dados")}))}return J(()=>{c&&fetch(o,{method:"GET",headers:{Authorization:`Bearer ${V?.token}`}}).then(e=>{e.ok?(console.log("llll"),e.json().then(e=>{let t=te(e,d,e).filter(e=>e.id===c);t.length>0?(S(te(e,d,e)),w(!1),v.formSetValue(r,c),D(t[0])):Y("Erro ao carregar dados. Valor inválido")})):Y("Erro ao carregar dados")})},[]),J(()=>{g&&ko&&(I(g),v.formSetValue(r,g.id),m(g.id))},[g]),c&&k.length<=0&&!O?t(n,{item:!0,xs:f,sm:h,md:y,children:t(p,{size:"small",fullWidth:!0,placeholder:E,disabled:!0})}):e(n,{item:!0,xs:f,sm:h,md:y,children:[i&&t(u,{required:s,children:i}),t("input",{type:"text",...v?.formRegister(r,{validate:(e,t)=>e?e.length<=0&&s?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),t(C,{value:M,loading:x,loadingText:E,options:k,defaultValue:O,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(ko=!1,e)return I(e),v.formSetValue(r,e.id),void m(e.id);I(null),v.formSetValue(r,""),m(void 0)}(t),renderInput:e=>t(p,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:A,error:!!te(v?.errors,r),helperText:te(v?.errors,r)?.message}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}let Eo=!0;function Yo({name:r,title:o,required:i=!1,list:a,defaultValue:l,onChange:s=(()=>{}),xs:c=12,sm:d,watchValue:m,forceUpdate:f=!1,md:h}){const g=X(at),[y,b]=H(null);return J(()=>{l&&g?.formSetValue(r,l.id)},[]),J(()=>{m&&(Eo||f)?(b(m),g.formSetValue(r,m.id),s(m.id)):void 0===m&&(Eo||f)&&(b(null),g.formSetValue(r,void 0),s(void 0))},[m]),e(n,{item:!0,xs:c,sm:d,md:h,children:[o&&t(u,{required:i,children:o}),t("input",{type:"text",...g?.formRegister(r,{validate:(e,t)=>e?e?.length<=0&&i?"Este campo é obrigatório":void 0:"Este campo é obrigatório"}),hidden:!0}),t(C,{value:y,options:a,defaultValue:l,getOptionLabel:e=>e.label?e.label.toString():"Não Encontrado",isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(Eo=!1,e)return b(e),g.formSetValue(r,e.id),void s(e.id);b(null),g.formSetValue(r,""),s(void 0)}(t),renderInput:e=>t(p,{...e,size:"small",fullWidth:!0,placeholder:o,error:!!te(g?.errors,r),helperText:te(g?.errors,r)?.message}),size:"small",sx:{bgcolor:"white"},fullWidth:!0})]})}let Oo=!0;function Do({name:r,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 v=se(),[x,w]=H(!0),[k,S]=H([]),[E,Y]=H("Carregando..."),[O,D]=H(null),[M,I]=H(null),{user:V}=X(ot);function A(){(c||!l)&&k.length>0||(w(!0),S([]),a&&Y(a),fetch(o,{method:"GET",headers:{Authorization:`Bearer ${V?.token}`}}).then(e=>{e.ok?e.json().then(e=>{S(te(e,d,e)),w(!1)}):Y("Erro ao carregar dados")}))}return J(()=>{c&&fetch(o,{method:"GET",headers:{Authorization:`Bearer ${V?.token}`}}).then(e=>{e.ok?(console.log("llll"),e.json().then(e=>{let t=te(e,d,e).filter(e=>e.id===c);t.length>0?(S(te(e,d,e)),w(!1),v.setValue(r,c),D(t[0])):Y("Erro ao carregar dados. Valor inválido")})):Y("Erro ao carregar dados")})},[]),J(()=>{g&&Oo&&(I(g),v.setValue(r,g.id),m(g.id))},[g]),c&&k.length<=0&&!O?t(n,{item:!0,xs:f,sm:h,md:y,children:t(p,{size:"small",fullWidth:!0,placeholder:E,disabled:!0})}):e(n,{item:!0,xs:f,sm:h,md:y,children:[i&&t(u,{required:s,children:i}),t("input",{type:"text",...v?.register(r,{validate:(e,t)=>{if(e.length<=0&&s)return"Este campo é obrigatório"}}),hidden:!0}),t(C,{value:M,loading:x,loadingText:E,options:k,defaultValue:O,getOptionDisabled:e=>e?.disabled??!1,isOptionEqualToValue:(e,t)=>e.id===t.id,onChange:(e,t)=>function(e){if(Oo=!1,e)return I(e),v.setValue(r,e.id),void m(e.id);I(null),v.setValue(r,""),m(void 0)}(t),renderInput:e=>t(p,{...e,size:"small",fullWidth:!0,placeholder:i,onFocus:A,error:!!te(v.formState.errors,r),helperText:te(v.formState.errors,r)?.message}),sx:{bgcolor:"white"},size:"small",fullWidth:!0,disabled:b})]})}function Mo({type:r="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=se();return J(()=>{void 0!==f&&g.setValue(h.name,f)},[f]),e(n,{item:!0,xs:i,sm:a,md:d,children:[h.title&&t(u,{htmlFor:"campo",required:h.required,children:h.title}),(()=>{const e={fullWidth:!0,size:"small",placeholder:h.customPlaceholder?h.customPlaceholder:h.title},n=h.name,i=te(g?.formState.errors,h.name),a=i?.message,d=!!i,u={...g?.register(n,{validate:(e,t)=>{const n=e??"";if(n.length<=0&&h.required)return"Este campo é obrigatório";if("cnpj"===r){if(n.length<18&&h.required)return"O CNPJ precisa ter no mínimo 14 dígitos"}else if("cpf"===r){if(n.length<14&&h.required)return"O CPF precisa ter no mínimo 11 dígitos"}else if("sei"===r){if(n.length<22&&h.required)return"O Número SEI precisa ter no mínimo 19 dígitos"}else if("cep"===r){if(n.length<9&&h.required)return"O CPF precisa ter no mínimo 8 dígitos"}else if("input"===r||"password"===r||"number"===r){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"===r){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"===r){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"===r&&n.length<14&&h.required)return"O número precisa ter pelo menos 10 dígitos"}}),error:d,helperText:a,...e,sx:{backgroundColor:"white"}};switch(r){case"input":case"email":return t(p,{...u,defaultValue:c,disabled:m});case"password":return t(p,{...u,type:"password",disabled:m});case"number":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:o},watchValue:f,disabled:m});case"cep":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-000"},watchValue:f,disabled:m});case"phone":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"(00) [#]0000-0000",definitions:{"#":/^9$/}},watchValue:f,disabled:m});case"sei":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000-00000000/0000-00"},watchValue:f,disabled:m});case"cpf_cnpj":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00[0]"},onMask:(e,t)=>{t(e.length>14?"00.000.000/0000-00":"000.000.000-00[0]")},watchValue:f,disabled:m});case"cpf":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"000.000.000-00"},watchValue:f,disabled:m});case"cnpj":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"00.000.000/0000-00"},watchValue:f,disabled:m});case"rg":return t(bo,{formConfig:u,defaultValue:c,maskProps:{mask:"00000[000000]"},watchValue:f,disabled:m})}})()]})}var Io=/*#__PURE__*/U.memo(Mo);const Vo=/*#__PURE__*/U.forwardRef(function(e,r){const{onChange:n,maskProps:o,onMask:i,maskValue:a,setMaskValue:l,watchValue:s,...c}=e,[d,u]=H(o.mask);delete c.value;const p=Q(null),[m,f]=H(""),h=se();return J(()=>{s&&f(s)},[s]),J(()=>{h.setValue(c.name,p.current.element.value)},[m]),delete c.watchValue,t(xe,{...c,...o,mask:d,value:m,ref:p,inputRef:r,onChange:e=>{},onAccept:(e,t)=>{f(e),t.updateValue(),i&&i(e,u)}})});function Ao(e){const n=X(at),[o,i]=H("");return t(r,{children:t(p,{...e.formConfig,onInput:t=>{n.formSetValue(e.formConfig.name,t.target.value)},InputProps:{inputComponent:Vo,inputProps:{maskProps:e.maskProps,onMask:e.onMask,maskValue:o,setMaskValue:i,watchValue:e.watchValue}},disabled:e.disabled,fullWidth:!0})})}function To({name:r,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=se();return J(()=>{g.setValue(r,d)},[d]),e(n,{item:!0,xs:s,sm:c,md:f,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),t(p,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.register(r,{validate:(e,t)=>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:!!te(g.formState.errors,r),helperText:te(g.formState.errors,r)?.message,sx:{bgcolor:"white"},placeholder:a||i})]})}function No({name:r,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=X(at);return J(()=>{g.formSetValue(r,d)},[d]),e(n,{item:!0,xs:s,sm:c,md:f,children:[i&&t(ve,{required:o,sx:{textTransform:"capitalize"},children:i}),t(p,{multiline:!0,fullWidth:!0,minRows:3,defaultValue:l,...g.formRegister(r,{validate:(e,t)=>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:!!te(g.errors,r),helperText:te(g.errors,r)?.message,sx:{bgcolor:"white"},placeholder:a||i})]})}function $o({name:r,required:o=!1,xs:l=12,sm:s,md:d}){const u=X(at),m=`switch-${r}`;return J(()=>{u.formWatch(m)||u.formSetValue(r,void 0)},[u]),t(n,{item:!0,xs:l,sm:s,md:d,children:e(a,{direction:"row",children:[t(i,{children:t(c,{size:"small",...u.formRegister(m),sx:{paddingLeft:0,margin:0}})}),u.formWatch(m)?t(p,{size:"small",...u.formRegister(r,{validate:(e,t)=>{if(!0===u.formWatch(m)&&(!e||e.length<=0&&o))return"Este campo não pode ser vazio"}}),required:!0,error:!!te(u.errors,r),helperText:te(u.errors,r)?.message,placeholder:"Outro"}):t(p,{size:"small",disabled:!0,placeholder:"Outro"})]})})}const jo=(e,t)=>{if(!e||Object.keys(e).length<=0)return[];if(!e[t])return[];let r=Object.keys(e[t]).map(e=>`${t}.${e}`);return e.files&&(r=[...r,...Object.keys(e.files).map(e=>`files.${e}`)]),r};function Ro({debugLog:r=!1,test:n=!1,testConfig:o={},customMarginBottom:s=10,...c}){c.children=Array.isArray(c.children)?c.children.filter((e,t)=>e):c.children;const d=Array.isArray(c.children)?c.children.length:1,u=X(at),p=Q(null),m=f(),[g,y]=H(0),b=(Array.isArray(c.children)?c.children:[c.children]).map((e,t)=>/*#__PURE__*/U.cloneElement(e,{...e.props,prefix:t})),v=d;return e(i,{children:[n&&t(a,{direction:"row",justifyContent:"end",children:t(l,{variant:"contained",color:"error",onClick:()=>{Object.keys(o).forEach((e,t)=>{const r=o[Number(e)];Object.keys(r).forEach(t=>{u.formUnregister(`${e}.${t}`),u.formSetValue(`${e}.${t}`,r[t])}),t<Object.keys(o).length-1&&new Promise(e=>setTimeout(e,100)).then(()=>{p.current?.click()})})},children:"EXCLUIR BANCO PRODUÇÃO"})}),e(a,{sx:{padding:2,marginBottom:s},children:[t(i,{children:b.map((e,r)=>t(i,{hidden:!(g===r),children:b[r]},"formsB"+r))}),t(w,{variant:"text",steps:v,position:h(m.breakpoints.only("xs"))?"bottom":"static",activeStep:g,sx:{paddingTop:2,paddingBottom:4,paddingX:0},backButton:t(l,{variant:"contained",startIcon:t(we,{}),onClick:()=>{y(e=>e-1)},disabled:0===g,sx:{textTransform:"none"},children:"Voltar"}),nextButton:g<v-1?t(l,{variant:"contained",endIcon:t(ke,{}),onClick:function(){try{return r&&console.log(u.formGetValues()),Promise.resolve(u.formTrigger(jo(u.formGetValues(),g))).then(function(e){e?y(e=>e+1):Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",theme:"light"})})}catch(e){return Promise.reject(e)}},sx:{textTransform:"none"},ref:p,children:"Próximo"}):t(i,{children:t(Ee,{variant:"contained",type:"submit",loading:u.submiting,loadingPosition:"start",startIcon:t(Se,{}),onClick:e=>function(e){try{return Promise.resolve(u.formTrigger(jo(u.formGetValues(),g))).then(function(t){t||(e.preventDefault(),Ye("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:t("span",{children:"Salvar"})})})})]})]})}var Po=/*#__PURE__*/U.memo(Ro);function Fo(e,t,r){if(!e.props)return e;const n=e.props.children;if(!n)/*#__PURE__*/return U.cloneElement(e,{...e.props,name:`${t}.${e.props.name}`,key:e.props.name?`${t}.${e.props.name}`:`noListing-${r}-${t}-${e.props.name}`});let o;if(Array.isArray(n)){let e=[];n.forEach((n,o)=>{e.push(Fo(n,t,r+(o+1)))}),o=e}else o=Fo(n,t,r+1);/*#__PURE__*/return U.cloneElement(e,{...e.props,children:o,name:`${t}.${e.props.name}`,key:e.props.name?`${t}.${e.props.name}`:`noListing-${r}-${t}-${e.props.name}`})}function zo({optional:o=!1,title:l,prefix:s=0,optionalMessage:c,defaultChecked:d,...u}){const p=X(at),m=`switch-${s}`,f=(Array.isArray(u.children)?u.children:[u.children]).map((e,t)=>e&&Fo(e,s,t));return e(i,{children:[t(n,{item:!0,xs:12,children:e(a,{direction:"row",justifyContent:"space-between",children:[e(a,{direction:"row",spacing:2,children:[t(i,{sx:{marginTop:.6},children:t(a,{sx:{backgroundColor:"#E6F8EB",borderRadius:"100%",height:"35px",width:"35px"},justifyContent:"center",alignItems:"center",children:t(De,{sx:{height:"18px",fill:"#01BA35"}})})}),t(ee,{variant:"h6",fontWeight:600,fontSize:28,fontFamily:"Inter",sx:{color:"#1E293B",paddingBottom:4},children:l})]}),t(i,{hidden:!o,children:t(fo,{name:m,defaultChecked:!o||d,overrideNo:u.overrideSwitchNo,overrideYes:u.overrideSwitchYes})})]})}),t(a,{spacing:2,children:o?p.formWatch(m)?t(n,{container:!0,spacing:1,children:f}):t(a,{justifyContent:"center",alignItems:"center",children:t(ee,{fontFamily:"Inter",fontSize:22,paddingY:8,textAlign:"center",children:c||e(r,{children:[t("b",{children:l})," é opcional. ",t("br",{}),"Marque a opção acima caso haja necessidade."]})})}):t(n,{container:!0,spacing:1,children:f})})]})}var Lo=/*#__PURE__*/U.memo(zo);let _o={open:()=>{},close:()=>{},openReparented:()=>{},reparent:()=>t(r,{})};function Wo(){const[n,l]=H(!1),[s,c]=H(null),d=()=>l(!1);Q(null);const u=f(),p=h(u.breakpoints.up("sm")),[m,g]=H({}),[y,b]=H(-1321465654);return J(()=>{_o.open=e=>{e&&c(e),b(-1321465654),l(!0)},_o.reparent=(e,n)=>(g(o=>({...o,[n]:t(r,{children:e})})),t(r,{})),_o.openReparented=e=>{b(e),c(null),l(!0)},_o.close=d},[l]),t(r,{children:p?t(S,{open:n,onClose:d,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:[t(i,{onClick:d,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:t(Re,{sx:{transform:"scale(.9)"}})}),e(i,{overflow:"auto",maxHeight:"90vh",p:2,marginTop:4,borderTop:"solid 1px gray",bgcolor:"#F9F9F9",borderRadius:2,children:[s,m[y]]})]})}):e(k,{anchor:"bottom",open:n,onClose:d,onOpen:()=>{},PaperProps:{sx:{bgcolor:"transparent"}},children:[t(a,{direction:"row",onClick:d,maxHeight:"8vh",height:"8vh",justifyContent:"center",alignItems:"center",children:t(o,{fontWeight:600,color:"white",children:"Clique fora para fechar"})}),e(i,{p:2,maxHeight:"92vh",bgcolor:"white",overflow:"auto",children:[s,m[y]]})]})})}function Bo({customColor:e="#383838",customFontColor:r="white",...n}){const o=Pe(e);return t(l,{...n,sx:{bgcolor:o.toHexString(),color:Pe(r).toHexString(),":hover":{bgcolor:o.darken(10).toHexString()},boxShadow:"none",borderRadius:3,textTransform:"capitalize",paddingX:2},size:"small",children:n.children})}function qo({data:n=[],...o}){const[i,a]=U.useState(null),l=Boolean(i),s=()=>{a(null)};return e(r,{children:[t(Bo,{...o.btProps,onClick:e=>{a(e.currentTarget)},children:o.children}),t(E,{id:"basic-menu",anchorEl:i,open:l,onClose:s,MenuListProps:{"aria-labelledby":"basic-button"},children:n.map(e=>t(Y,{onClick:t=>{e.onClick&&e.onClick(),s()},children:e.name}))})]})}function Uo(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function Ko(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}let Xo=[],Go=!1,Ho="",Jo=!1,Zo={},Qo="";function ei({mediaQueryLG:n,columns:o,emptyMsg:s={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:c="",tableName:d="Dados",csv:u,columnSize:p,action:m,useKC:y=!0,statusKeyName:v="",csvExcludeKeys:x=[],csvExcludeKeysCSV:C=[],csvExcludeKeysAll:w=[],csvCustomKeyNames:k={},csvExcludeValidate:S=((e,t)=>!1),csvButtonTitle:E="Salvar .CSV",csvNoZipText:Y="Salvar .CSV",csvAllButtonTitle:V="Salvar todos em CSV",removeQuotes:A=!1,normalize:T=!1,csvShowAllButton:N=!1,csvWithoutZip:$=!1,itemCount:j=10,csvUpper:W=!1,csvZipFileNamesKey:q="",generateCsvZip:U=!1,hideTitleCSV:K=!1,csvExcludeUpper:Z=[],multipleDataPath:re="",expandTextMaxLength:ne=50,collapsedSize:oe=53,customMargin:ie=4,customMarginMobile:le=0,filtersFunc:se,filters:ce=[],orderBy:de=[],customErrorMsg:ue,customTableStyle:pe={},id:me,initialData:fe=null,isLoading:he}){const[ge,ye]=H(null),[be,ve]=H(fe),{user:xe,userLoaded:Ce}=X(ot),[we,ke]=H([]),[Se,Ee]=H([]),[Ye,Oe]=H(j),[De,Re]=H(0),[Pe,Fe]=H(1),[ze,Le]=H(1);H("");const[_e,We]=H({}),[Be,qe]=H({}),[Ue,Ke]=H({}),[Xe,Ge]=H("filterKey"),He=f(),Je=h(He.breakpoints.only("xs")),Ze=Q(null),Qe=h(He.breakpoints.up(2e3));Ho=`tableFilter_${me}`,Qo=`tableFilterCache_${me}`,Zo=se??{},localStorage.getItem(Qo)||localStorage.setItem(Qo,JSON.stringify(ce)),localStorage.getItem(Qo)!==JSON.stringify(ce)&&(localStorage.setItem(Qo,JSON.stringify(ce)),localStorage.removeItem(Ho));const et=G(e=>{if(e.length<=0)return 1;let t=e.length/Ye;return t=t<1?1:t,Math.ceil(t)},[Ye]),tt=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,c):void 0,[]);J(()=>{if(ge||!tt(be))return;const e=tt(be);ke(e),Ee(e),Fe(et(e)),localStorage.getItem(Ho)&&ct(JSON.parse(localStorage.getItem(Ho)))},[Ye,be,et,ge]),J(()=>{Re(ze-1)},[ze]);const rt=G((e,t)=>{Le(t)},[]),nt=G(()=>{const e=De*Ye;return we.slice(e,e+Ye)},[we,Ye,De]),it=G((e,t=!1)=>{if(e.preventDefault(),we.length<=0)return;const r=Object.keys(we[0]);if(U&&t){const e=r.filter(e=>!x.includes(e)),t=e.map(e=>k[e]?k[e]:e).join(",")+"\n",o=new je,i={};we.forEach(e=>{i[e[q]]||(i[e[q]]=[]),i[e[q]].push(e)}),Object.keys(i).forEach(n=>{const a=[];i[n].forEach(t=>{let n=!0;if(r.forEach(e=>{S(e,t[e])&&(n=!1)}),n){const r=e.map(e=>{if("string"==typeof t[e]){let r=W?t[e].toUpperCase():t[e];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof t[e]&&!Array.isArray(t[e])&&null!==t[e]){let r=at(t[e]).slice(1,-1),n=W&&!Z.includes(e)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return t[e]}).join(",");a.push(r)}});const l=K?a.join("\n"):"\ufeff"+t+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",`${u?.fileName}.zip`),n.click()})}else{let e=r.filter(e=>!C.includes(e)).map(e=>e===re?"hrTermino":e);""!==re&&(e=["dtInicio","hrInicio",...e]);const t=e.map(e=>k[e]?k[e]:e).join(",")+"\n",o=[];we.forEach(t=>{let n=!0;if(r.forEach(e=>{S(e,t[e])&&(n=!1)}),n){const r=e.map(e=>{if("dtInicio"===e)return"{dtInicio}";if("hrInicio"===e)return"{hrInicio}";if("hrTermino"===e)return"{hrTermino}";if("string"==typeof t[e]){let r=W&&!Z.includes(e)?t[e].toUpperCase():t[e];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof t[e]&&!Array.isArray(t[e])&&null!==t[e]){let r=at(t[e]).slice(1,-1),n=W&&!Z.includes(e)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return t[e]}).join(",");if(""!==re){const e=t[re];e&&e.forEach(e=>{o.push(r.replace("{dtInicio}",e.dtInicio).replace("{hrInicio}",e.hrInicio).replace("{hrTermino}",e.hrTermino))})}else o.push(r)}});const i=t+o.join("\n");(n=window.document.createElement("a")).setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(i)),n.setAttribute("download",`${u?.fileName}.csv`),n.click()}},[we]);function at(e){let t=[];if("object"==typeof e&&!Array.isArray(e)&&null!==e)for(let[r,n]of Object.entries(e))"object"!=typeof n||Array.isArray(n)||null===n?n&&t.push(r):t.push(r+": "+at(n));return"["+t.join(" - ")+"]"}const lt=G(e=>{if(e.preventDefault(),we.length<=0)return;const t=Object.keys(we[0]).filter(e=>!w.includes(e)),r=t.join(",")+"\n",n=we.map(e=>t.map(t=>{if("tbRa"===t)return e[t].NO_CIDADE;if("rlEventoData"===t)return`${e[t][0].DT_INICIO} - ${e[t][0].HR_INICIO}`;if("string"==typeof e[t]){let r=W&&!Z.includes(t)?e[t].toUpperCase():e[t];return r=T?r.normalize("NFD").replace(/[\u0300-\u036f]/g,""):r,A?`${r}`:`"${r}"`}if("object"==typeof e[t]&&!Array.isArray(e[t])&&null!==e[t]){let r=at(e[t]).slice(1,-1),n=W&&!Z.includes(t)?r.toUpperCase():r;return n=T?n.normalize("NFD").replace(/[\u0300-\u036f]/g,""):n,A?`${n}`:`"${n}"`}return e[t]}).join(",")).join("\n"),o=r+n;var i=window.document.createElement("a");i.setAttribute("href","data:text/csv;charset=utf-8,%EF%BB%BF"+encodeURI(o)),i.setAttribute("download",`${u?.fileName}.csv`),i.click()},[we]);function st(){ke(Xo),Ee(Xo),Fe(et(Xo)),Re(0),Le(1),localStorage.removeItem(Ho),Ge((new Date).getTime().toString())}function ct(e){if(!Xo)return;let t=JSON.parse(JSON.stringify(Xo));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":t.forEach(t=>{Number(te(t,e.keyName,""))===Number(e.value)&&r.push(t)});break;case"maior que":t.forEach(t=>{Number(te(t,e.keyName,""))>Number(e.value)&&r.push(t)});break;case"menor que":t.forEach(t=>{Number(te(t,e.keyName,""))<Number(e.value)&&r.push(t)})}break;case"string":switch(console.log("ata: ",e.operator),e.operator){case"igual":t.forEach(t=>{const n=te(t,e.keyName,"");e.useList?Ko(n)===Ko(e.value.id)&&r.push(t):Ko(n)===Ko(e.value)&&r.push(t)});break;case"contem":t.forEach(t=>{const n=te(t,e.keyName,"");n&&(e.useList?Ko(n).includes(Ko(e.value.id))&&r.push(t):Ko(n).includes(Ko(e.value))&&r.push(t))});break;case"tem um dos":t.forEach(t=>{const n=te(t,e.keyName,"");n&&e.value.map(e=>Ko(e.id)).includes(Ko(n))&&r.push(t)})}break;case"date":switch(e.operator){case"data exata":t.forEach(t=>{const n=ae(te(t,e.keyName,""),"DD/MM/YYYY");n.isValid()&&n.isSame(ae(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"entre":const n=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");t.forEach(t=>{const i=ae(te(t,e.keyName,""),"DD/MM/YYYY");(i.isAfter(n)||i.isSame(n))&&(i.isBefore(o)||i.isSame(o))&&r.push(t)})}break;case"dates":switch(e.operator){case"data inicio":t.forEach(t=>{const n=Zo[e.customFunc](te(t,e.keyName,""))??[];n.length<=0||ae(n[0],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"data fim":t.forEach(t=>{const n=Zo[e.customFunc](te(t,e.keyName,""))??[];n.length<=0||ae(n[n.length-1],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&r.push(t)});break;case"tem a data":t.forEach(t=>{(Zo[e.customFunc](te(t,e.keyName,""))??[]).includes(e.value)&&r.push(t)});break;case"entre":const n=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");t.forEach(t=>{const i=Zo[e.customFunc](te(t,e.keyName,""))??[];let a=!1;i.forEach(e=>{if(a)return;const t=ae(e,"DD/MM/YYYY");t.isValid()&&(t.isAfter(n)||t.isSame(n))&&(t.isBefore(o)||t.isSame(o))&&(a=!0)}),a&&r.push(t)})}}t=r}),ke(t),Fe(et(t)),Re(0),Le(1),localStorage.setItem(Ho,JSON.stringify(e)),Ee(t)}return J(()=>{const e=De*Ye,t=we.slice(e,e+Ye);let r={};t.forEach((e,t)=>{o.forEach(n=>{r[t]=!0===r[t]||(te(e,n?.keyName,"")??"Não Informado").toString().length>=ne})}),qe(r)},[we,Ye,De]),J(()=>{console.log(Ze.current)},[Ze.current]),ge?t(i,{bgcolor:"#fff2c8",color:"#3e3129",padding:2,marginX:2,borderRadius:4,children:e(ee,{fontSize:24,textAlign:"center",fontFamily:"Inter",children:[403===ge.status&&"Acesso negado",500===ge.status&&e(i,{fontWeight:500,textAlign:"center",children:[t(R,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),t(i,{children:ue||e(r,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",t("br",{}),t("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",t("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})}):he?t(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:[t(P,{sx:{fill:"#5e5e5e"}}),e(ee,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",d]})]}),t(g,{color:"inherit"}),Array(10).fill("").map(r=>t(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(r=>e(i,{children:[t(O,{width:60}),t(O,{width:120})]}))}))]})}):!Ce&&y?t(g,{}):e(r,{children:[e(i,{marginX:Je?le:ie,bgcolor:"white",p:2,borderRadius:6,...pe,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:[t($e,{InputProps:{startAdornment:t(Ae,{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(Se);const t=e.target.value;if(""===t)return ke(Se),void Fe(et(tt(we)));const r=tt(we),n=[];r.forEach(e=>{const r=[];if(Object.keys(e).map(t=>{let n=te(e,t,"")??"";"number"==typeof n&&(n=n.toString()),"string"==typeof n&&r.push(n)}),r.length<=0)return;let o=!1;r.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(t.toLowerCase())&&(o=!0));case"C":return void("cancelado".includes(t.toLowerCase())&&(o=!0));case"A":return void("cadastrado".includes(t.toLowerCase())&&(o=!0));case"R":return void("reprovado".includes(t.toLowerCase())&&(o=!0));case"L":return void("licenciado".includes(t.toLowerCase())&&(o=!0));case"PA":return void(("pré aprovado".includes(t.toLowerCase())||"pre aprovado".includes(t.toLowerCase()))&&(o=!0));case"FP":return void("fora do prazo".includes(t.toLowerCase())&&(o=!0))}Uo(e.toLowerCase()).includes(Uo(t.toLowerCase()))&&(o=!0)}),o&&n.push(e)}),ke(n),Fe(et(n)),Re(0),Le(1)},fullWidth:!0,placeholder:`Pesquisar ${d}`}),ce.length>0&&t(l,{startIcon:t(F,{}),variant:"contained",onClick:e=>_o.open(t(ti,{reset:st,filtrar:ct,baseFilters:[...ce],filters:localStorage.getItem(Ho)?JSON.parse(localStorage.getItem(Ho)):[...ce]},Xe)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:t(a,{direction:"row",borderRadius:5,padding:0,children:t("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[t(qo,{data:de.map(e=>({name:e.label,onClick:()=>function(e){let t=[...we];t.sort((t,r)=>{const n="string"===e.type?te(t,e.key,""):Number(te(t,e.key,0)),o="string"===e.type?te(r,e.key,""):Number(te(r,e.key,0));if(Jo){if(n<o)return-1;if(n>o)return 1}else{if(n>o)return-1;if(n<o)return 1}return 0}),Jo=!Jo,ke(t)}(e)})),btProps:{startIcon:t(z,{}),fullWidth:!0},children:"Ordenar"}),t(l,{variant:"contained",fullWidth:!0,startIcon:t(Go?B:z,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let t=0;t<j;t++)e[t]=!Go;Ke(e),We(e),Go=!Go},children:Go?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(ee,{fontWeight:600,textAlign:"end",children:["Registro de ",d,"s"]}),t(a,{justifyContent:"center",children:e(ee,{children:["Exibindo ",De*Ye+1,"-",De*Ye+1+nt().length-1," de ",we.length]})})]})]}),localStorage.getItem(Ho)&&t(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(Ho)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(r=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[t(ee,{fontWeight:700,children:r.label}),t(ee,{fontStyle:"italic",children:r.operator}),t(ee,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(r.value)?r.value.map(e=>e.label).join(" - "):"object"==typeof r.value?r.value.label:"entre"===r.operator?`${r.value?r.value:"Antes"} e ${r.value2?r.value2:"Depois"}`:r.value.toString()}),t(D,{onClick:e=>{let t=JSON.parse(localStorage.getItem(Ho)??"[]");t=t.map(e=>e.label===r.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),ct(t)},size:"small",sx:{padding:0},children:t(Me,{sx:{fill:"white"}})})]}))}),t(a,{spacing:.2,children:nt().length<=0?t(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:t(ee,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:xe?s.user:s.public})}):nt().map((s,c)=>t(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Te,{container:!0,spacing:Je?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Te,{item:!0,xs:12,md:Qe?12/p*(o.size?o.size:1):n?n.all:12/p*(o.size?o.size:1),sx:{overflow:"hidden"},children:[t(i,{sx:{width:"max-content",paddingX:1},children:t(ee,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:o.title})}),t(i,{paddingLeft:1,position:"relative",children:t(M,{in:!0===_e[c],collapsedSize:oe,onExited:e=>Ke(e=>({...e,[c]:!1})),children:e(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:[t(i,{children:o.customComponent?o.customComponent(te(s,o.keyName),s):t(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")})}),t(i,{position:"absolute",top:0,children:o.customComponent?o.customComponent(te(s,o.keyName),s):t(r,{children:Ue[c]?te(s,o?.keyName,""):(te(s,o?.keyName,"")??"").toString().length>=ne?t(r,{children:(te(s,o?.keyName,"")??"").toString().substring(0,ne)+"..."}):te(s,o?.keyName,"")})})]})})})]},String(o?.keyName)+c)),t(Te,{item:!0,xs:12,md:Qe?12/p:n?n.action:12/p,children:t(a,{direction:"row",alignItems:"center",justifyContent:Je?"start":"flex-end",sx:{height:"100%",paddingBottom:Je?2:0},children:m(s)})}),Be[c]&&t(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:t(l,{onClick:e=>{We(e=>({...e,[c]:!e[c]})),Ke(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:t(_e[c]?L:_,{}),children:_e[c]?"Ver Menos":"Ver Mais"})})]})},c))}),nt().length>0&&t(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:u&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[$&&t(l,{startIcon:t(Ie,{}),variant:"contained",size:"small",onClick:it,sx:{backgroundColor:"#5a88b0",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:Y}),N&&t(l,{startIcon:t(Ie,{}),variant:"contained",size:"small",onClick:lt,sx:{backgroundColor:"#64748B",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:V}),t(l,{startIcon:t(Ie,{}),variant:"contained",size:"small",onClick:e=>it(e,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:E})]})})]}),t(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[t(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:t(Ve,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),t(Ne,{renderItem:e=>"page"===e.type?t(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:t(I,{...e}),count:Pe,siblingCount:Je?0:6,size:"large",onChange:rt,page:ze,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),t(l,{onClick:e=>Le(e=>e<Pe?e+1:Pe),sx:{bgcolor:"white",borderRadius:"50px",height:"40px",width:"40px",minWidth:0,border:"solid 1px #E2E8F0"},children:t(Ve,{sx:{transform:"scale(1.5)"}})})]})})]})}function ti({filters:r,baseFilters:n,filtrar:o,reset:s}){const[c,d]=H(r),[u,p]=H(!1),[m,f]=U.useState(null),h=Boolean(m);return e(i,{width:{xs:"inherit",md:850},children:[t(E,{open:h,onClose:()=>{f(null)},anchorEl:m,children:n.map(e=>t(Y,{onClick:t=>{var r;r=e,d(e=>[...e,r]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[t(ee,{fontWeight:700,fontSize:18,children:"Filtrar"}),t(l,{startIcon:t(W,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),_o.close()},children:"Limpar"})]}),t(i,{marginBottom:1,children:t(V,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),t(a,{children:u?c.map((e,r)=>t(ri,{filterValue:e,setReset:p,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}})):t(i,{children:c.map((e,r)=>t(ri,{filterValue:e,setReset:p,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}}))})}),t(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:t(l,{variant:"contained",color:"success",startIcon:t(Ae,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),_o.close()},children:"Filtrar"})})]})}function ri({filterValue:r,setDt:n,idx:o}){const[i,l]=H(r.operator),[s,c]=H(r),d=f(),u=h(d.breakpoints.only("xs"));return J(()=>{n(s)},[s]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:o%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!u&&t(ee,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:r.label}),e(A,{sx:{width:"100%"},children:[u&&t(ee,{children:r.label}),t(T,{onChange:e=>{const t=e.target.value;c(e=>({...e,operator:t,value:""})),l(t)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:r.operators.map(e=>t(Y,{value:e,children:e}))})]}),t(ni,{filterValue:r,operator:s.operator,onChange:(e,t="value")=>{c(r=>({...r,[t]:e}))}})]})}function ni({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return t($e,{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 t(C,{multiple:!0,id:"tags-standard",onChange:(e,t)=>{a(t.length<=0?"":t)},options:n.useList,defaultValue:Array.isArray(n.value)?n.value:[],renderInput:e=>t($e,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return t(i,{width:"100%",children:t(C,{options:n.useList,onChange:(e,t)=>{a(t)},defaultValue:"object"==typeof n.value?n.value:void 0,isOptionEqualToValue:(e,t)=>e.label===t.label,renderInput:e=>t($e,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return t($e,{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 t(re,{adapterLocale:"pt-br",dateAdapter:ie,children:t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t($e,{...e,size:"small",fullWidth:!0})})});case"entre":return e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t($e,{...e,size:"small",fullWidth:!0})}),t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:n.value2?ae(n.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t($e,{...e,size:"small",fullWidth:!0})})]})}}return t(r,{})}var oi=/*#__PURE__*/U.memo(ei);function ii({customErrorMsg:n,error:a}){return t(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:[t(R,{sx:{transform:"scale(2)",marginY:1,fill:"#3e3129"}}),t(i,{children:n||e(r,{children:["Não foi possível se conectar ao servidor no momento. Por favor, aguarde alguns instantes e tente de novo.",t("br",{}),t("br",{}),"Caso precise de ajuda, entre em contato pelo email: ",t("strong",{children:"cdes@ssp.df.gov.br"})]})})]})]})})}function ai({tableName:r}){return t(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:[t(P,{sx:{fill:"#5e5e5e"}}),e(ee,{fontWeight:600,fontSize:20,textTransform:"capitalize",textAlign:"center",color:"#5e5e5e",children:["Carregando ",r]})]}),t(g,{color:"inherit"}),Array(10).fill("").map(r=>t(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(r=>e(i,{children:[t(O,{width:60}),t(O,{width:120})]}))}))]})})}const li=(e,t)=>{if(e.length<=0)return 1;let r=e.length/t;return r=r<1?1:r,Math.ceil(r)};function si(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/g,"")}function ci(e){return("string"!=typeof e?e.toString():e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function di({filterData:e,startData:t,filtersFuncData:r={},localTableName:n="",setCurrentPage:o,setList:i,setListClone:a,setListPage:l,setPagCount:s,itemsCount:c}){if(!t)return;let d=JSON.parse(JSON.stringify(t));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":d.forEach(r=>{Number(te(r,e.keyName,""))===Number(e.value)&&t.push(r)});break;case"maior que":d.forEach(r=>{Number(te(r,e.keyName,""))>Number(e.value)&&t.push(r)});break;case"menor que":d.forEach(r=>{Number(te(r,e.keyName,""))<Number(e.value)&&t.push(r)})}break;case"string":switch(e.operator){case"igual":d.forEach(r=>{const n=te(r,e.keyName,"");e.useList?ci(n)===ci(e.value.id)&&t.push(r):ci(n)===ci(e.value)&&t.push(r)});break;case"contem":d.forEach(r=>{const n=te(r,e.keyName,"");n&&(e.useList?ci(n).includes(ci(e.value.id))&&t.push(r):ci(n).includes(ci(e.value))&&t.push(r))});break;case"tem um dos":d.forEach(r=>{const n=te(r,e.keyName,"");n&&e.value.map(e=>ci(e.id)).includes(ci(n))&&t.push(r)})}break;case"date":switch(e.operator){case"data exata":d.forEach(r=>{const n=ae(te(r,e.keyName,""),"DD/MM/YYYY");n.isValid()&&n.isSame(ae(e.value,"DD/MM/YYYY"))&&t.push(r)});break;case"entre":const r=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),n=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(o=>{const i=ae(te(o,e.keyName,""),"DD/MM/YYYY");(i.isAfter(r)||i.isSame(r))&&(i.isBefore(n)||i.isSame(n))&&t.push(o)})}break;case"dates":switch(e.operator){case"data inicio":d.forEach(n=>{const o=(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.length<=0||ae(o[0],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&t.push(n)});break;case"data fim":d.forEach(n=>{const o=(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.length<=0||(console.log(o),ae(o[o.length-1],"DD/MM/YYYY").isSame(ae(e.value,"DD/MM/YYYY"))&&t.push(n))});break;case"tem a data":d.forEach(n=>{const o=(r[e.customFunc](te(n,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);o.includes(e.value)&&t.push(n)});break;case"entre":const n=ae(e.value?e.value:"01/01/2000","DD/MM/YYYY"),o=ae(e.value2?e.value2:"31/12/2030","DD/MM/YYYY");d.forEach(i=>{const a=(r[e.customFunc](te(i,e.keyName,""))??[]).filter(e=>void 0!==e&&""!==e);let l=!1;a.forEach(e=>{if(l)return;const t=ae(e,"DD/MM/YYYY");t.isValid()&&(t.isAfter(n)||t.isSame(n))&&(t.isBefore(o)||t.isSame(o))&&(l=!0)}),l&&t.push(i)})}}d=t}),i(d),s(li(d,c)),o(0),l(1),localStorage.setItem(n,JSON.stringify(e)),a(d)}function ui({order:e,list:t,orderAsc:r=!1}){const n=Fe(t).sort((t,n)=>{const o="string"===e.type?te(t,e.key,""):Number(te(t,e.key,0)),i="string"===e.type?te(n,e.key,""):Number(te(n,e.key,0));if(r){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 pi({filters:r,baseFilters:n,filtrar:o,reset:s}){const[c,d]=H(r),[u,p]=H(!1),[m,f]=U.useState(null),h=Boolean(m);return e(i,{width:{xs:"inherit",md:850},children:[t(E,{open:h,onClose:()=>{f(null)},anchorEl:m,children:n.map(e=>t(Y,{onClick:t=>{var r;r=e,d(e=>[...e,r]),f(null)},children:e.label}))}),e(a,{direction:"row",justifyContent:"space-between",children:[t(ee,{fontWeight:700,fontSize:18,children:"Filtrar"}),t(l,{startIcon:t(W,{}),sx:{textTransform:"capitalize"},onClick:e=>{s(),_o.close()},children:"Limpar"})]}),t(i,{marginBottom:1,children:t(V,{severity:"warning",children:"Preencha apenas os campos que deseja filtrar."})}),t(a,{children:u?c.map((e,r)=>t(mi,{filterValue:e,setReset:p,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}})):t(i,{children:c.map((e,r)=>t(mi,{filterValue:e,setReset:p,idx:r,setDt:e=>{d(t=>{let n=[...t];return n[r]=e,n})},removeDt:()=>{d(e=>{let t=[...e];return t.splice(r,1),t})}}))})}),t(a,{direction:"row",justifyContent:"flex-end",marginTop:1,children:t(l,{variant:"contained",color:"success",startIcon:t(Ae,{}),sx:{textTransform:"capitalize"},onClick:e=>{o(c),_o.close()},children:"Filtrar"})})]})}function mi({filterValue:r,setDt:n,idx:o}){const[i,l]=H(r.operator),[s,c]=H(r),d=f(),u=h(d.breakpoints.only("xs"));return J(()=>{n(s)},[s]),e(a,{direction:"row",alignItems:"end",spacing:1,width:"100%",bgcolor:o%2==0?"#ededed":"inherit",padding:.5,borderRadius:2,children:[!u&&t(ee,{width:"100%",alignContent:"center",fontWeight:600,color:"#323232",children:r.label}),e(A,{sx:{width:"100%"},children:[u&&t(ee,{children:r.label}),t(T,{onChange:e=>{const t=e.target.value;c(e=>({...e,operator:t,value:""})),l(t)},defaultValue:i,size:"small",sx:{bgcolor:"white"},fullWidth:!0,children:r.operators.map(e=>t(Y,{value:e,children:e}))})]}),t(fi,{filterValue:r,operator:s.operator,onChange:(e,t="value")=>{c(r=>({...r,[t]:e}))}})]})}function fi({filterValue:n,operator:o,onChange:a}){switch(n.type){case"number":return t($e,{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 t(C,{multiple:!0,id:"tags-standard",onChange:(e,t)=>{a(t.length<=0?"":t)},options:n.useList,defaultValue:Array.isArray(n.value)?n.value:[],renderInput:e=>t($e,{...e,variant:"standard",placeholder:"Escolha os valores",fullWidth:!0}),fullWidth:!0});case"contem":case"igual":return t(i,{width:"100%",children:t(C,{options:n.useList,onChange:(e,t)=>{a(t)},defaultValue:"object"==typeof n.value?n.value:void 0,isOptionEqualToValue:(e,t)=>e.label===t.label,renderInput:e=>t($e,{...e,size:"small",placeholder:"Escolha um valor",fullWidth:!0,sx:{bgcolor:"white"}}),fullWidth:!0})})}return t($e,{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 t(re,{adapterLocale:"pt-br",dateAdapter:ie,children:t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t($e,{...e,size:"small",fullWidth:!0})})});case"entre":return e(re,{adapterLocale:"pt-br",dateAdapter:ie,children:[t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"")},defaultValue:n.value?ae(n.value,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t($e,{...e,size:"small",fullWidth:!0})}),t(ne,{format:"DD/MM/YYYY",onChange:e=>{a(e.isValid()?e.format("DD/MM/YYYY"):"","value2")},defaultValue:n.value2?ae(n.value2,"DD/MM/YYYY"):void 0,sx:{div:{input:{paddingX:2,paddingY:1.05}},width:"100%",bgcolor:"white"},inputRef:e=>t($e,{...e,size:"small",fullWidth:!0})})]})}}return t(r,{})}let hi=!1,gi="",yi={},bi="";function vi({mediaQueryLG:n,columns:o,csvConfig:s,fetchFunc:c,emptyMsg:d={user:"Nenhum dado encontrado",public:"Nenhum dado encontrado"},dataPath:u="",tableName:p="Dado",columnSize:m,action:y,useKC:v=!0,itemCount:x=10,expandTextMaxLength:C=50,collapsedSize:w=53,customMargin:k=4,customMarginMobile:S=0,filtersFunc:E,filters:Y=[],orderBy:O=[],customErrorMsg:V,customTableStyle:A={},id:T,initialData:N=null,isExpandable:$=!0}){const[j,R]=H(!1),[P,W]=H(null),[q,U]=H(N),{user:K,userLoaded:Z}=X(ot),[re,ne]=H([]),[oe,ie]=H([]),[ae,le]=H(x),[se,ce]=H(0),[de,ue]=H(1),[pe,me]=H(1),[fe,he]=H({}),[ge,ye]=H({}),[be,ve]=H({}),[xe,Ce]=H("filterKey"),we=f(),ke=h(we.breakpoints.only("xs")),Se=Q(q),Ee=Q("true"===localStorage.getItem(`order-${T}`)||!1),Ye=h(we.breakpoints.up(2e3));gi=`tableFilter_${T}`,bi=`tableFilterCache_${T}`,yi=E??{},localStorage.getItem(bi)||localStorage.setItem(bi,JSON.stringify(Y)),localStorage.getItem(bi)!==JSON.stringify(Y)&&(localStorage.setItem(bi,JSON.stringify(Y)),localStorage.removeItem(gi)),J(()=>{W(null),c&&(!Z&&v||(R(!0),c().then(e=>e.ok?e.json().then(e=>{if(204===e.statusCode)U({body:{data:[]}}),Se.current=[];else if(403===e.statusCode)W({status:e.statusCode});else{let t=u?te(e,u):e;if(t&&Array.isArray(t)){let e=t;if(localStorage.getItem(`order-data-${T}`))try{e=ui({order:JSON.parse(localStorage.getItem(`order-data-${T}`)),list:t,orderAsc:Ee.current})}catch(e){console.log(e)}else O.length>0&&(e=ui({order:O[0],list:t,orderAsc:Ee.current}));U(e),Se.current=JSON.parse(JSON.stringify(e))}else U({body:{data:[]}}),Se.current=[]}R(!1)}):(W({status:500}),void R(!1))).catch(e=>{W({status:500})})))},[Z,c]);const Oe=G(e=>Array.isArray(e)?e:"object"==typeof e?te(e,u):void 0,[]);J(()=>{if(j||P||!Oe(q))return;let e=Oe(q);ne(e),ie(e),ue(li(e,ae)),localStorage.getItem(gi)&&di({filterData:JSON.parse(localStorage.getItem(gi)),filtersFuncData:yi,localTableName:gi,setCurrentPage:ce,setList:ne,setListClone:ie,setListPage:me,setPagCount:ue,startData:Se.current,itemsCount:ae})},[ae,j,q,P]),J(()=>{ce(pe-1)},[pe]);const De=G((e,t)=>{me(t)},[]),je=G(()=>{const e=se*ae;return re.slice(e,e+ae)},[re,ae,se]);function Re(){ne(Se.current),ie(Se.current),ue(li(Se.current,ae)),ce(0),me(1),localStorage.removeItem(gi),Ce((new Date).getTime().toString())}J(()=>{const e=se*ae,t=re.slice(e,e+ae);let r={};t.forEach((e,t)=>{o.forEach(n=>{r[t]=!0===r[t]||(te(e,n.keyName,"")??"Não Informado").toString().length>=C})}),ye(r)},[re,ae,se]);const Pe=(e,t=!1)=>{s&&function(e,t,r){try{if(e.length<=0)return Promise.resolve();let n=[];t.downloadAll&&t.customAll?n=t.customAll(e,r):!t.downloadAll&&t.customFiltered?n=t.customFiltered(e,r):e.forEach(e=>{const o={};t.map.forEach(n=>{if(!n.useFilterValue||t.downloadAll||n.onlyAll)n.onlyFilter||(o[n.name]=te(e,n.key));else{const t=r.filter(e=>e.label==n.useFilterValue.label&&n.useFilterValue.operators.includes(e.operator)),i=t.length>0&&t.reduce(e=>e.value).value||void 0;o[n.name]=i||te(e,n.key)}}),n.push(o)});const o=ze.utils.json_to_sheet(n),i=ze.utils.book_new();return ze.utils.book_append_sheet(i,o,t.fileName),ze.writeFile(i,`${t.fileName}.xlsx`),Promise.resolve()}catch(e){return Promise.reject(e)}}(e,{...s,...t?{downloadAll:!0}:{}},JSON.parse(localStorage.getItem(gi)??"[]")||[])},Fe=e=>{di({filterData:e,filtersFuncData:yi,localTableName:gi,setCurrentPage:ce,setList:ne,setListClone:ie,setListPage:me,setPagCount:ue,startData:Se.current,itemsCount:ae})};return P?t(ii,{customErrorMsg:V,error:P}):j?t(ai,{tableName:p}):!Z&&v?t(g,{}):e(r,{children:[e(i,{marginX:ke?S: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:[t($e,{InputProps:{startAdornment:t(Ae,{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 t=e.target.value;if(""===t)return ne(oe),void ue(li(Oe(re),ae));const r=Oe(re),n=[];r.forEach(e=>{const r=[];if(Object.keys(e).map(t=>{let n=te(e,t,"")??"";"number"==typeof n&&(n=n.toString()),"string"==typeof n&&r.push(n)}),r.length<=0)return;let o=!1;r.forEach(e=>{if(["P","C","A","R","L","PA"].includes(e))switch(e){case"P":return void("em analise".includes(t.toLowerCase())&&(o=!0));case"C":return void("cancelado".includes(t.toLowerCase())&&(o=!0));case"A":return void("cadastrado".includes(t.toLowerCase())&&(o=!0));case"R":return void("reprovado".includes(t.toLowerCase())&&(o=!0));case"L":return void("licenciado".includes(t.toLowerCase())&&(o=!0));case"PA":return void(("pré aprovado".includes(t.toLowerCase())||"pre aprovado".includes(t.toLowerCase()))&&(o=!0));case"FP":return void("fora do prazo".includes(t.toLowerCase())&&(o=!0))}si(e.toLowerCase()).includes(si(t.toLowerCase()))&&(o=!0)}),o&&n.push(e)}),ne(n),ue(li(n,ae)),ce(0),me(1)},fullWidth:!0,placeholder:`Pesquisar ${p}`}),t(l,{startIcon:t(F,{}),variant:"contained",onClick:e=>_o.open(t(pi,{reset:Re,filtrar:e=>Fe(e),baseFilters:[...Y],filters:localStorage.getItem(gi)?JSON.parse(localStorage.getItem(gi)):[...Y]},xe)),sx:{borderRadius:3,paddingX:"24px",paddingY:"8px",backgroundColor:"#208FE8",textTransform:"capitalize"},children:t(a,{direction:"row",borderRadius:5,padding:0,children:t("span",{children:"Filtrar"})})}),e(a,{direction:"row",spacing:1,children:[O.length>0&&t(qo,{data:O.map(e=>({name:e.label,onClick:()=>(e=>{Ee.current=!Ee.current;const t=ui({order:e,list:re,orderAsc:Ee.current});localStorage.setItem(`order-${T}`,Ee.current.toString()),localStorage.setItem(`order-data-${T}`,JSON.stringify(e)),ne(t)})(e)})),btProps:{startIcon:t(z,{}),fullWidth:!0},children:"Ordenar"}),$&&t(l,{variant:"contained",fullWidth:!0,startIcon:t(hi?B:z,{}),sx:{backgroundColor:"#637082",":hover":{backgroundColor:"#3c4757"},textTransform:"capitalize",borderRadius:3,padding:{md:"0px 8px"}},onClick:function(){let e={};for(let t=0;t<x;t++)e[t]=!hi;ve(e),he(e),hi=!hi},children:hi?"Recolher":"Expandir"})]})]}),e(a,{alignItems:"end",width:{xs:"100%",md:"20%"},direction:{xs:"row",md:"column"},spacing:{xs:1,md:0},children:[e(ee,{fontWeight:600,textAlign:"end",children:["Registro de ",p,"s"]}),t(a,{justifyContent:"center",children:e(ee,{children:["Exibindo ",se*ae+1,"-",se*ae+1+je().length-1," de ",re.length]})})]})]}),localStorage.getItem(gi)&&t(i,{display:"inline-flex",flexWrap:"wrap",padding:.5,borderRadius:4,marginBottom:1,children:JSON.parse(localStorage.getItem(gi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).map(r=>e(a,{direction:"row",spacing:1,bgcolor:"#4e85c1",color:"white",width:"fit-content",paddingY:.5,borderRadius:2,paddingX:1,m:.5,children:[t(ee,{fontWeight:700,children:r.label}),t(ee,{fontStyle:"italic",children:r.operator}),t(ee,{bgcolor:"white",borderRadius:2,paddingX:1,color:"black",children:Array.isArray(r.value)?r.value.map(e=>e.label).join(" - "):"object"==typeof r.value?r.value.label:"entre"===r.operator?`${r.value?r.value:"Antes"} e ${r.value2?r.value2:"Depois"}`:r.value.toString()}),t(D,{onClick:e=>{let t=JSON.parse(localStorage.getItem(gi)??"[]");t=t.map(e=>e.label===r.label?{...e,value:"",...e.value2?{value2:""}:{}}:e),Fe(t)},size:"small",sx:{padding:0},children:t(Me,{sx:{fill:"white"}})})]}))}),t(a,{spacing:.2,children:je().length<=0?t(a,{sx:{backgroundColor:"#E2E8F0",padding:2,marginX:{xs:2,md:0}},justifyContent:"center",alignItems:"center",children:t(ee,{fontSize:21,fontFamily:"Inter",fontWeight:600,textAlign:"center",children:K?d.user:d.public})}):je().map((s,c)=>t(b,{sx:{padding:.5,backgroundColor:c%2==0?"#F8FAFC":"white",paddingTop:2,borderTop:"solid 1.5px #E2E8F0",position:"relative"},elevation:0,children:e(Te,{container:!0,spacing:ke?2:0,paddingX:2,rowSpacing:2,children:[o.map(o=>e(Te,{item:!0,xs:12,md:Ye?12/m*(o.size?o.size:1):n?n.all:12/m*(o.size?o.size:1),sx:{overflow:"hidden"},children:[t(i,{sx:{width:"max-content",paddingX:1},children:t(ee,{fontSize:16,fontWeight:700,color:"#1E293B",fontFamily:"Inter",children:o.title})}),t(i,{paddingLeft:1,position:"relative",children:t(M,{in:!0===fe[c],collapsedSize:w,onExited:e=>ve(e=>({...e,[c]:!1})),children:e(i,{sx:{wordWrap:"break-word",color:"#1E293B",fontSize:16},fontFamily:"Inter",children:[t(i,{children:o.customComponent?o.customComponent(te(s,o.keyName),s):t(i,{color:"transparent",sx:{pointerEvents:"none",userSelect:"none"},children:te(s,o.keyName,"")})}),t(i,{position:"absolute",top:0,children:o.customComponent?o.customComponent(te(s,o.keyName),s):t(r,{children:be[c]?te(s,o.keyName,""):(te(s,o.keyName,"")??"").toString().length>=C?t(r,{children:(te(s,o.keyName,"")??"").toString().substring(0,C)+"..."}):te(s,o.keyName,"")})})]})})})]},o.keyName+c)),t(Te,{item:!0,xs:12,md:Ye?12/m:n?n.action:12/m,children:t(a,{direction:"row",alignItems:"center",justifyContent:ke?"start":"flex-end",sx:{height:"100%",paddingBottom:ke?2:0},children:y(s)})}),ge[c]&&t(a,{direction:"row",justifyContent:"flex-end",bottom:0,width:"100%",children:t(l,{onClick:e=>{he(e=>({...e,[c]:!e[c]})),ve(e=>({...e,[c]:!0}))},sx:{padding:0,color:"#637082",textTransform:"capitalize"},startIcon:t(fe[c]?L:_,{}),children:fe[c]?"Ver Menos":"Ver Mais"})})]})},c))}),je().length>0&&t(a,{padding:1,direction:{xs:"column",md:"row"},spacing:{xs:2,md:0},justifyContent:"space-between",alignItems:"center",children:s&&e(a,{direction:{xs:"column",md:"row"},justifyContent:"flex-end",spacing:1,children:[JSON.parse(localStorage.getItem(gi)??"[]").filter(e=>e.value||"entre"===e.operator&&(e.value||e.value2)).length>0&&t(l,{startIcon:t(Ie,{}),variant:"contained",size:"small",onClick:e=>Pe(re),sx:{backgroundColor:"#a5a5a5",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Filtrados"}),t(l,{startIcon:t(Ie,{}),variant:"contained",size:"small",onClick:e=>Pe(Se.current,!0),sx:{backgroundColor:"#22C55E",marginRight:{xs:2,md:0},width:{xs:"100%",md:"fit-content"}},children:"Baixar Tabela"})]})})]}),t(a,{direction:"row",justifyContent:"center",paddingY:1,paddingTop:2,children:e(a,{direction:"row",justifyContent:"center",alignItems:"center",spacing:2,children:[t(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:t(Ve,{sx:{transform:"scale(1.5) scaleX(-1)"}})}),t(Ne,{renderItem:e=>"page"===e.type?t(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:t(I,{...e}),count:de,siblingCount:ke?0:6,size:"large",onChange:De,page:pe,shape:"circular",variant:"outlined",sx:{".MuiPagination-ul":{backgroundColor:"white",border:"solid 1px #E2E8F0",borderRadius:"50px",paddingX:.25,paddingY:.5}}}),t(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:t(Ve,{sx:{transform:"scale(1.5)"}})})]})})]})}var xi=/*#__PURE__*/U.memo(vi);const Ci=Le(()=>import("./Map-31d95a26.js").then(e=>e.Map),{ssr:!1});function wi({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:p,menuItems:m,paddingBottom:f=0,logoutMsg:h="Sair",logoutFunc:g,...y}){let b;u&&(b=Ge());const{user:v,login:x,logout:C,type:w}=X(ot),[k,S]=H(null),[O,M]=H(null),I=Boolean(k),V=Boolean(O),[A,T]=H(!1),j=G(e=>{S(e.currentTarget)},[]),R=G(()=>{S(null)},[]),P=G((e,t)=>{T(!0),S(null),b?b.push({pathname:t}).finally(()=>T(!1)):T(!1)},[b]);return e(r,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[t(N,{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:[t(Xe,{href:"/",children:u?t(Ke,{src:c,alt:s,width:40,height:40}):t("img",{src:c,height:35})}),t(i,{children:t(o,{variant:"subtitle1",fontWeight:600,children:s})})]}),t(i,{sx:{display:{xs:"flex",md:"none"}},children:n.length>0&&e(r,{children:[t(D,{onClick:j,children:t(Be,{})}),t(E,{open:I,onClose:R,anchorEl:k,children:n.map(e=>t(Y,{onClick:t=>P(t,e.path),children:t(o,{textTransform:"capitalize",children:e.name})},`navmenu${e}`))})]})}),e(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{md:"100%"}},children:[t(a,{direction:"row",spacing:2,sx:{display:{xs:"none",md:"flex"}},children:n.map(e=>t(i,{sx:{a:{color:"#2c7da0",textDecoration:"none",textTransform:"capitalize","&:hover":{color:"#90e0ef"}}},children:t(l,{onClick:t=>{return r=e.path,T(!0),void(b?b.push({pathname:r}).finally(()=>T(!1)):T(!1));var r},sx:{textTransform:"capitalize"},children:e.name})},`navigation${e.path}`))}),e(a,{direction:"row",spacing:2,children:[t(i,{children:p}),v?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:[t($,{sx:{width:30,height:30},src:v.image}),e(E,{open:V,onClose:e=>M(null),anchorEl:O,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[m,t(Y,{onClick:function(e){try{function t(){C()}M(null);const r=function(){if(g){const e=function(e,t){try{var r=Promise.resolve(g()).then(function(){})}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[t(We,{sx:{fill:"#545454"}}),t(o,{textTransform:"capitalize",children:h})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>M(e.currentTarget),sx:{userSelect:"none"},children:[t(o,{children:"Olá,"}),t(o,{fontWeight:600,children:v?.given_name}),t(_e,{})]})]}):t(l,"govbr"===w?{variant:"contained",size:"small",startIcon:t(qe,{}),onClick:x,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:t(qe,{}),onClick:x,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})]})]})}),A&&t(Ue,{})]}),t(i,{paddingBottom:f})]})}function ki(e,t){return"/"===t?e===t:e.startsWith(t)}function Si({links:n,title:s,img:c,pos:d="fixed",next:u=!0,el:p,menuItems:m,color:f="blue",route:h="/teste/89",paddingBottom:g=0,logoutMsg:y="Sair",logoutFunc:b,...v}){let x;u&&(x=Ge());const{user:C,login:w,logout:k,type:S}=X(ot),[O,M]=H(null),[I,V]=H(null),A=Boolean(O),T=Boolean(I),[j,R]=H(!1),P=G(e=>{M(e.currentTarget)},[]),F=G(()=>{M(null)},[]),z=G((e,t)=>{R(!0),M(null),x?x.push({pathname:t}).finally(()=>R(!1)):R(!1)},[x]);return e(r,{children:[e(i,{position:d,sx:{width:"100%",zIndex:100},children:[t(N,{position:"relative",elevation:0,sx:{backgroundColor:"white",color:"black",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:[t(Xe,{href:"/",children:u?t(Ke,{src:c,alt:s,width:40,height:40}):t("img",{src:c,height:35})}),t(i,{children:t(o,{variant:"subtitle1",fontWeight:600,children:s})})]}),t(a,{direction:"row",width:"100%",justifyContent:"center",alignItems:"center",spacing:2,sx:{display:{xs:"none",md:"flex"}},children:n.map((e,r)=>t(i,{borderBottom:u?ki(x?.pathname??"",e.path)?`solid 4px ${f}`:"":ki(h,e.path)?`solid 4px ${f}`:"",height:"100%",paddingX:2,sx:{":hover":{backgroundColor:"#fcfcfc",cursor:"pointer",userSelect:"none"}},onClick:t=>{var r;u&&console.log("pathname:",x?.pathname,":=",e.path),r=e.path,R(!0),x?x.push({pathname:r}).finally(()=>R(!1)):R(!1)},children:t(a,{height:"100%",justifyContent:"center",children:e.name})},JSON.stringify({x:e,index:r})))}),t(i,{sx:{display:{xs:"flex",md:"none"}},children:n.length>0&&e(r,{children:[t(D,{onClick:P,children:t(Be,{})}),t(E,{open:A,onClose:F,anchorEl:O,children:n.map((e,r)=>t(Y,{onClick:t=>z(t,e.path),children:t(o,{textTransform:"capitalize",children:e.name})},JSON.stringify({x:e,index:r})))})]})}),t(a,{direction:"row",justifyContent:"flex-end",alignItems:"center",sx:{width:{md:"100%"}},paddingY:1,children:e(a,{direction:"row",spacing:2,children:[t(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:[t($,{sx:{width:30,height:30},src:C.image}),e(E,{open:T,onClose:e=>V(null),anchorEl:I,disableScrollLock:!0,transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},sx:{".MuiMenu-paper":{borderRadius:4}},children:[m,t(Y,{onClick:function(e){try{function t(){k()}V(null);const r=function(){if(b){const e=function(e,t){try{var r=Promise.resolve(b()).then(function(){})}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(0,function(e){console.error(e)});if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(r&&r.then?r.then(t):t())}catch(e){return Promise.reject(e)}},children:e(a,{direction:"row",spacing:1,children:[t(We,{sx:{fill:"#545454"}}),t(o,{textTransform:"capitalize",children:y})]})})]})]}),e(a,{direction:"row",spacing:.4,alignItems:"center",onClick:e=>V(e.currentTarget),sx:{userSelect:"none"},children:[t(o,{children:"Olá,"}),t(o,{fontWeight:600,children:C.given_name}),t(_e,{})]})]}):t(l,"govbr"===S?{variant:"contained",size:"small",startIcon:t(qe,{}),onClick:w,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar com o gov.br"})}:{variant:"contained",size:"small",startIcon:t(qe,{}),onClick:w,sx:{color:"white",textTransform:"inherit",borderRadius:50,paddingX:2},children:t(o,{fontWeight:600,fontSize:15,padding:.4,children:"Entrar"})})]})})]})}),j&&t(Ue,{})]}),t(i,{paddingBottom:g})]})}function Ei({children:e,onSubmit:r,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}=ce(),[h,g]=H([]);return t(at.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:t("form",{method:n,onSubmit:a(e=>r(e,h),()=>Ye("Formulário incompleto! Verifique os campos marcados e tente novamente.",{type:"warning",position:"top-right",theme:"colored"})),children:e})})}function Yi({url:e,realm:r,clientId:n,children:o,type:i="ad",resource_name:a="eventos-front",redirectUri:l=""}){const[s,c]=H(),[d,u]=H(!1),[p,m]=H(null),f=Ge(),h=!!s;return J(()=>{const t=new He({url:e,realm:r,clientId:n});m(t),t.onTokenExpired=function(){try{console.log("token expired");const e=function(e,r){try{var n=Promise.resolve(t.updateToken(5)).then(function(e){e&&c(e=>({...e,token:t.token})),console.log(e?"Token was refreshed":"Token is still valid")})}catch(e){return r(e)}return n&&n.then?n.then(void 0,r):n}(0,function(e){console.log("Failed to refresh token",e)});return Promise.resolve(e&&e.then?e.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},t.init({onLoad:"check-sso",pkceMethod:"S256"}).then(e=>{if(u(!0),e){const e=t.tokenParsed;console.log("TOKEN-> ",e);const r={...e,token:t.token,roles:((e?.resource_access??{})[a]??[]).roles};c(r),console.info("Authenticated!!!")}else console.log("NAO AUTENTICADO")},()=>{console.error("Authenticated Failed")}).catch(e=>console.log(e));const o=f.query.status;o&&"success"===o&&window.history.replaceState(null,"","/")},[]),t(ot.Provider,{value:{user:s,isAuth:h,userLoaded:d,login:function(){console.log("Tentando logar..."),console.log("KC: ",{instancia:p,logado:p?.authenticated,client_id:p?.clientId}),p?.login({redirectUri:l})},logout:function(){u(!1),p?.logout(),c(null),localStorage.removeItem("user-data.img")},saveUserData:()=>{},type:i},children:o})}const Oi="nextauth.token",Di="user-data.img";function Mi({children:e,AUTH_URL:r,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]=H(),[p,m]=H(!1),f=Ge(),h=!!d;function g(){m(!1),f.replace(s).finally(()=>{u(null),Ze(Oi),localStorage.removeItem(Di),m(!0)})}return J(()=>{const e=Je(Oi);e?fetch(`${r}${i}`,{method:"POST",headers:{Authorization:`Bearer ${e}`}}).then(t=>{if(t.ok){const t=et(e),r=localStorage.getItem(Di);u({name:t.given_name,image:r??"",roles:t.roles.map(e=>e.code),token:e}),m(!0)}else g()}):m(!0)},[]),t(ot.Provider,{value:{user:d,isAuth:h,userLoaded:p,login:function(){if(!location||"localhost"!==location.hostname&&location.hostname!==l)m(!1),f.replace(c);else{const e=a;Qe(Oi,e),u({name:"Teste",image:"",roles:[1],token:e}),f.replace(o).finally(()=>m(!0))}},logout:g,saveUserData:function(e){try{const t=e.ssp_token;Qe(Oi,t);const r=et(t),n=et(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(Di,e),u({name:r.name,image:e,roles:r.roles.map(e=>e.code),token:t}),f.replace(o).finally(()=>m(!0))}}),u({name:r.name,image:"",roles:r.roles.map(e=>e.code),token:t}),f.replace(o).finally(()=>m(!0))})).then(function(){f.replace(o).finally(()=>m(!0))})}catch(e){return Promise.reject(e)}},type:"govbr"},children:e})}function Ii(n){return e(r,{children:[t(Wo,{}),n.children,t(Oe,{position:"bottom-right",theme:"colored"})]})}export{Oi as AUTH_COOKIE_NAME,Co as ActiveInput,ot as AuthContext,wo as AutoComplete,Bo as Button,tt as Category,lt as CheckBox,ct as CheckBoxAdditional,dt as CheckBoxWarning,mt as DatePicker,uo as DropFileUpload,So as FetchAutoComplete,rt as Field,nt as FieldLabel,it as File,po as FileUpload,Yo as FixedAutoComplete,at as FormContext,Ei as FormProvider,ft as GenericDatePicker,Do as GenericFetchAutoComplete,Io as GenericInput,Ao as GenericMaskInput,To as GenericMultInput,oi as GenericTable,xo as Input,Yi as KeycloakAuthProvider,_o as MODAL,Ci as Map,bo as MaskInput,qo as Menu,No as MultInput,wi as NavBar,Mi as OAuthProvider,$o as OtherCheckBox,pt as RequiredCheckBoxGroup,Ii as SspComponentsProvider,Po as Stepper,Lo as StepperBlock,fo as Switch,go as SwitchWatch,Si as TabNavBar,xi as Table,ht as TimePicker,ho as ToggleVisibility};
3
+ //# sourceMappingURL=index.esm.js.map