@applica-software-guru/react-admin 1.3.127 → 1.3.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ra-forms/LongForm/utils.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +1 -1
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +3 -2
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +1 -1
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ra-forms/LongForm/hooks.tsx +1 -1
- package/src/components/ra-forms/LongForm/utils.ts +3 -1
package/dist/react-admin.umd.js
CHANGED
|
@@ -199,7 +199,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
199
199
|
animation: ${0} 1.4s linear infinite;
|
|
200
200
|
`),a3)),u3=ce("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),d3=ce("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${Pe(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>z({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&Kt.css(VE||(VE=Fl`
|
|
201
201
|
animation: ${0} 1.4s ease-in-out infinite;
|
|
202
|
-
`),l3)),HE=k.forwardRef(function(t,n){const r=zt({props:t,name:"MuiCircularProgress"}),{className:i,color:s="primary",disableShrink:l=!1,size:A=40,style:u,thickness:g=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ke(r,s3),E=z({},r,{color:s,disableShrink:l,size:A,thickness:g,value:p,variant:C}),m=c3(E),B={},y={},O={};if(C==="determinate"){const R=2*Math.PI*((so-g)/2);B.strokeDasharray=R.toFixed(3),O["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*R).toFixed(3)}px`,y.transform="rotate(-90deg)"}return f.jsx(A3,z({className:Xe(m.root,i),style:z({width:A,height:A},y,u),ownerState:E,ref:n,role:"progressbar"},O,h,{children:f.jsx(u3,{className:m.svg,ownerState:E,viewBox:`${so/2} ${so/2} ${so} ${so}`,children:f.jsx(d3,{className:m.circle,style:B,ownerState:E,cx:so,cy:so,r:(so-g)/2,fill:"none",strokeWidth:g})})}))});process.env.NODE_ENV!=="production"&&(HE.propTypes={classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","primary","secondary","error","info","success","warning"]),c.string]),disableShrink:gr(c.bool,e=>e.disableShrink&&e.variant&&e.variant!=="indeterminate"?new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect."):null),size:c.oneOfType([c.number,c.string]),style:c.object,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),thickness:c.number,value:c.number,variant:c.oneOf(["determinate","indeterminate"])});const pd=HE;function g3(e){return Ft("MuiLoadingButton",e)}const Mr=Wt("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),f3=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],p3=e=>{const{loading:t,loadingPosition:n,classes:r}=e,i={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Pe(n)}`],endIcon:[t&&`endIconLoading${Pe(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Pe(n)}`]},s=dr.unstable_composeClasses(i,g3,r);return z({},r,s)},h3=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",C3=ce(o3,{shouldForwardProp:e=>h3(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Mr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Mr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>z({[`& .${Mr.startIconLoadingStart}, & .${Mr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${Mr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Mr.startIconLoadingStart}, & .${Mr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Mr.startIconLoadingStart}, & .${Mr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),I3=ce("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Pe(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>z({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),WE=k.forwardRef(function(t,n){const r=zt({props:t,name:"MuiLoadingButton"}),{children:i,disabled:s=!1,id:l,loading:A=!1,loadingIndicator:u,loadingPosition:g="center",variant:p="text"}=r,C=Ke(r,f3),h=VA(l),E=u??f.jsx(pd,{"aria-labelledby":h,color:"inherit",size:16}),m=z({},r,{disabled:s,loading:A,loadingIndicator:E,loadingPosition:g,variant:p}),B=p3(m),y=A?f.jsx(I3,{className:B.loadingIndicator,ownerState:m,children:E}):null;return f.jsxs(C3,z({disabled:s||A,id:h,ref:n},C,{variant:p,classes:B,ownerState:m,children:[m.loadingPosition==="end"?i:y,m.loadingPosition==="end"?y:i]}))});process.env.NODE_ENV!=="production"&&(WE.propTypes={children:c.node,classes:c.object,disabled:c.bool,id:c.string,loading:c.bool,loadingIndicator:c.node,loadingPosition:gr(c.oneOf(["start","end","center"]),e=>e.loadingPosition==="start"&&!e.startIcon?new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'):e.loadingPosition==="end"&&!e.endIcon?new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):null),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["contained","outlined","text"]),c.string])});const E3=WE;function hd({variant:e,theme:t,color:n,loadingPosition:r}){const i=en(t,n),{lighter:s,main:l,dark:A,contrastText:u}=i,g=`${n}Button`,p=Si(t,g),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},E={"&::after":{boxShadow:`0 0 6px 6px ${Ve(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${Ve(l,.9)}`},"&:focus-visible":{outline:`2px solid ${A}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:l,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{backgroundColor:A,color:u},...E};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{backgroundColor:A,color:u},...E};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{boxShadow:"none",backgroundColor:A,color:u},...E};case"outlined":return{backgroundColor:"transparent",borderColor:l,...h,...C};case"dashed":return{backgroundColor:s,borderColor:l,...h,...C,...E};case"text":default:return{color:l,...C,...E}}}const m3=ce(E3,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:i,loadingPosition:s})=>({"::after":{content:'""',display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:n==="rounded"?"50%":4,opacity:0,transition:"all 0.5s"},":active::after":{position:"absolute",borderRadius:n==="rounded"?"50%":4,left:0,top:0,opacity:1,transition:"0s"},...t==="text"&&{...hd({variant:t,theme:e,color:r,loadingPosition:s}),"&.MuiButton-sizeMedium":{height:36},"&.MuiButton-sizeSmall":{height:30},"&.MuiButton-sizeLarge":{height:44}},...n&&{minWidth:0,"&.MuiButton-sizeMedium":{width:36,height:36},"&.MuiButton-sizeSmall":{width:30,height:30},"&.MuiButton-sizeLarge":{width:44,height:44},...n==="rounded"&&{borderRadius:"50%"}},...t==="outlined"&&{border:"1px solid"},...t==="dashed"&&{border:"1px dashed"},...(t==="contained"||t==="shadow")&&!i&&{color:"#fff"},...t!=="text"&&{...hd({variant:t,theme:e,color:r,loadingPosition:s})},"&.Mui-disabled":{...t!=="text"&&{...hd({variant:t,theme:e,color:r,loadingPosition:s})}}})),Cd=x.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...i},s)=>{const l=xt();return f.jsx(m3,{ref:s,variant:e,shape:t,theme:l,loadingPosition:i.loadingPosition,loading:i.loading,color:r,...i,children:n})});Cd.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string},Cd.displayName="LoadingButton";function B3({color:e,theme:t,labelColor:n}){const r=en(t,e),{main:i,contrastText:s}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:i,color:n||s},[`& .${b.tooltipClasses.arrow}`]:{color:i}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||s,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const v3=ce(({className:e,...t})=>f.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&B3({color:t,theme:e,labelColor:n})}));function zE({children:e,arrow:t,labelColor:n="",...r}){const i=xt();return f.jsx(b.Box,{display:"flex",children:f.jsx(v3,{arrow:t,...r,theme:i,labelColor:n,children:e})})}zE.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const ao=x.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...i},s)=>{let l={transformOrigin:"0 0 0"};switch(t){case"top-right":l={transformOrigin:"top right"};break;case"top":l={transformOrigin:"top"};break;case"bottom-left":l={transformOrigin:"bottom left"};break;case"bottom-right":l={transformOrigin:"bottom right"};break;case"bottom":l={transformOrigin:"bottom"};break;case"top-left":default:l={transformOrigin:"0 0 0"};break}return f.jsxs(b.Box,{ref:s,children:[n==="grow"&&f.jsx(b.Grow,{...i,timeout:{appear:0,enter:150,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&f.jsx(b.Collapse,{...i,sx:l,children:e}),n==="fade"&&f.jsx(b.Fade,{...i,timeout:{appear:0,enter:300,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&f.jsx(b.Slide,{...i,timeout:{appear:0,enter:150,exit:150},direction:r,children:f.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&f.jsx(b.Zoom,{...i,children:f.jsx(b.Box,{sx:l,children:e})})]})});ao.propTypes={children:c.node,type:c.oneOf(["grow","fade","collapse","slide","zoom"]),position:c.oneOf(["top-left","top-right","top","bottom-left","bottom-right","bottom"]),direction:c.oneOf(["up","down","left","right"])},x.forwardRef(function(t,n){return f.jsx(b.Zoom,{ref:n,timeout:200,...t})});function UE({value:e,...t}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",value:e,...t}),f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}UE.propTypes={value:c.number};function YE({value:e,size:t,variant:n,thickness:r,showLabel:i,pathColor:s,sx:l,...A}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",sx:{color:s||"grey.200"},size:t,thickness:r,...A,value:100}),i&&f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),f.jsx(b.CircularProgress,{variant:n,sx:{...l,position:"absolute",left:0,[`& .${b.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...A})]})}YE.propTypes={value:c.number,size:c.number,variant:c.string,thickness:c.number,showLabel:c.bool,pathColor:c.string,sx:c.array,others:c.array};function GE({icon:e,value:t,...n}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:t,...n})}),f.jsx(b.Box,{sx:{minWidth:35},children:e})]})}GE.propTypes={icon:c.node,value:c.number};function KE({value:e,...t}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:e,...t})}),f.jsx(b.Box,{sx:{minWidth:35},children:f.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}KE.propTypes={value:c.number};const JE=x.createContext({});function y3(e){const{useDefaults:t=!1,queryOptions:n={}}=e,r=j.useResourceContext(),i=j.useDataProvider(),{search:s}=hs.useLocation(),l=`${r}/new`,A=x.useCallback(()=>{if(!t||!Ie.isFunction(i.get))return Promise.resolve({});const h={};return new URLSearchParams(s??"").forEach((E,m)=>{h[m]=E}),i.get(l,h).then(E=>E.data).then(E=>{const{responseCode:m,value:B}=E;return m==="ok"?B:Promise.reject(E)})},[r,t,s,i]),u=x.useMemo(()=>Ie.chain(n).extend({queryKey:[r,s],queryFn:A}).value(),[r,s,A,n]),{data:g,isLoading:p}=wA.useQuery(u),C=Ie.omit(e,["useDefaults"]);return p?f.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:f.jsx(b.CircularProgress,{})}):f.jsx(JE.Provider,{value:g??{},children:f.jsx(j.Create,{...C})})}function b3(){return x.useContext(JE)}const Q3=ce(y3,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"& .RaCreate-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaCreate-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),x3=ys(j.Toolbar,{name:"RaApplicaToolbar",slot:"Root"})(({theme:e})=>({...e.mixins.toolbar,backgroundColor:e.palette.background.paper,justifyContent:"flex-end","& .RaToolbar-defaultToolbar":{justifyContent:"right",paddingBottom:e.spacing(2),"& > *":{marginLeft:e.spacing(1)}},"& .MuiButtonBase-root":{marginLeft:e.spacing(1)}})),Dr=e=>f.jsx(x3,{...e});Dr.defaultProps={...j.Toolbar.defaultProps},Dr.propTypes={...j.Toolbar.propTypes};const Id=({children:e,content:t,title:n,subheader:r,secondary:i,toolbar:s,...l})=>{const A=j.useTranslate(),u=j.useResourceContext(),{cardTitle:g,cardSubheader:p}=x.useMemo(()=>{const C=n||`resources.${u}.title`;return{cardTitle:A(C,{_:C}),cardSubheader:r!==null?A(r,{_:r}):null}},[u,r,n,A]);return f.jsx(b.Grid,{item:!0,...l,children:f.jsx(or,{content:t,title:g,subheader:p,secondary:i,divider:!0,children:f.jsxs(x.Fragment,{children:[e,s===!0?f.jsx(Dr,{children:f.jsx(j.SaveButton,{})}):s]})})})};Id.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12},Id.propTypes={...b.Grid.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),contained:c.bool,content:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object]),spacing:c.number,toolbar:c.oneOfType([c.node,c.bool])};const w3=ce(j.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),Ll=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:i}=Qn();return f.jsx(w3,{defaultValues:n,spacing:t||i,children:f.jsx(b.Grid,{container:!0,...r,spacing:t||i,children:e})})};Ll.propTypes={...b.Grid.propTypes,...j.Form.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),spacing:c.number,defaultValues:c.oneOfType([c.object,c.func]),record:c.object,validate:c.func},Ll.defaultProps={...b.Stack.defaultProps},Ll.Section=Id;const T3=ys(j.SimpleForm,{name:"RaApplicaSimpleForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0}})),Nl=({title:e,modal:t,content:n,subheader:r,secondary:i,sx:s,...l})=>{const A=Vh(e),u=j.useRecordContext();return f.jsx(or,{content:n,title:A,subheader:r,secondary:u!=null&&u.id?i:null,sx:{...s,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:f.jsx(T3,{toolbar:f.jsx(Dr,{}),...l})})};Nl.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:f.jsx(Dr,{children:f.jsx(j.SaveButton,{type:"button"})}),secondary:f.jsx(Ei,{children:f.jsx(j.DeleteWithConfirmButton,{})})},Nl.propTypes={...j.SimpleForm.propTypes,modal:c.bool,content:c.bool,contained:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object])};const Vl=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:s,divider:l,...A})=>{const u=Kt.useTheme(),{getCurrentDialog:g}=Po(),{source:p,resource:C,isRequired:h}=A,{getFieldState:E,formState:m}=Cs.useFormContext(),{error:B}=E(p,m),y=g();return f.jsxs(b.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:B?u.palette.error.main:u.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${u.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(j.FieldTitle,{label:e,source:p,resource:y||C,isRequired:h})}),x.isValidElement(t)?x.cloneElement(t,{...t.props,...A,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!B,children:r})]})};Vl.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool},Vl.defaultProps={display:"label",divider:!1};const P3=ce(j.ArrayInput,{name:"ApplicaArrayInput",slot:"root"})(({theme:e})=>({"& .MuiStack-root > label":{marginTop:e.spacing(2)},"& .MuiInputLabel-shrink":{paddingBottom:0},marginTop:"0 !important","& .RaSimpleFormIterator-line > .RaSimpleFormIterator-form":{paddingBottom:e.spacing(.5),"& > div":{width:"100%"}}})),S3=({label:e,addLabel:t,source:n,helperText:r,divider:i=!0,...s})=>f.jsx(Vl,{label:e,addLabel:t,source:n,helperText:r,divider:i,children:f.jsx(P3,{source:n,label:!1,...s})}),Ed=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:f.jsxs(Ei,{children:[e&&f.jsx(j.EditButton,{}),t&&f.jsx(j.DeleteWithConfirmButton,{}),n&&f.jsx(j.CloneButton,{})]});Ed.defaultProps={canEdit:!0,canDelete:!0,canClone:!1},Ed.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const XE=ce("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),O3=ce("ul")({display:"inline-block"}),ZE=e=>{var p;const{className:t,emptyText:n,source:r,title:i,...s}=e,l=Ce.useRecordContext(e),A=ct.get(l,r),u=Ce.useTranslate();if(!A)return n?f.jsx(b.Typography,{component:"span",variant:"body2",className:t,...s,children:n&&u(n,{_:n})}):f.jsx(XE,{className:t,...s});if(Array.isArray(A))return f.jsx(O3,{className:t,...s,children:A.map((C,h)=>{var m;const E=i instanceof String?(m=ct.get(C,i))==null?void 0:m.toString():i;return f.jsx("li",{children:E},h)})});const g=i instanceof String?(p=ct.get(l,i))==null?void 0:p.toString():i;return f.jsx(XE,{className:t,...s,children:g})};ZE.propTypes={className:c.string,emptyText:c.string,source:c.string.isRequired,src:c.string,title:c.oneOfType([c.string,c.element]),target:c.string,download:c.oneOfType([c.bool,c.string]),ping:c.string,rel:c.string};var qE={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ln,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",l="second",A="minute",u="hour",g="day",p="week",C="month",h="quarter",E="year",m="date",B="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var J=["th","st","nd","rd"],H=_%100;return"["+_+(J[(H-20)%10]||J[H]||J[0])+"]"}},w=function(_,J,H){var K=String(_);return!K||K.length>=J?_:""+Array(J+1-K.length).join(H)+_},S={s:w,z:function(_){var J=-_.utcOffset(),H=Math.abs(J),K=Math.floor(H/60),L=H%60;return(J<=0?"+":"-")+w(K,2,"0")+":"+w(L,2,"0")},m:function _(J,H){if(J.date()<H.date())return-_(H,J);var K=12*(H.year()-J.year())+(H.month()-J.month()),L=J.clone().add(K,C),ee=H-L<0,U=J.clone().add(K+(ee?-1:1),C);return+(-(K+(H-L)/(ee?L-U:U-L))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:C,y:E,w:p,d:g,D:m,h:u,m:A,s:l,ms:s,Q:h}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},P="en",N={};N[P]=R;var F="$isDayjsObject",X=function(_){return _ instanceof le||!(!_||!_[F])},Z=function _(J,H,K){var L;if(!J)return P;if(typeof J=="string"){var ee=J.toLowerCase();N[ee]&&(L=ee),H&&(N[ee]=H,L=ee);var U=J.split("-");if(!L&&U.length>1)return _(U[0])}else{var q=J.name;N[q]=J,L=q}return!K&&L&&(P=L),L||!K&&P},G=function(_,J){if(X(_))return _.clone();var H=typeof J=="object"?J:{};return H.date=_,H.args=arguments,new le(H)},te=S;te.l=Z,te.i=X,te.w=function(_,J){return G(_,{locale:J.$L,utc:J.$u,x:J.$x,$offset:J.$offset})};var le=function(){function _(H){this.$L=Z(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[F]=!0}var J=_.prototype;return J.parse=function(H){this.$d=function(K){var L=K.date,ee=K.utc;if(L===null)return new Date(NaN);if(te.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var U=L.match(y);if(U){var q=U[2]-1||0,de=(U[7]||"0").substring(0,3);return ee?new Date(Date.UTC(U[1],q,U[3]||1,U[4]||0,U[5]||0,U[6]||0,de)):new Date(U[1],q,U[3]||1,U[4]||0,U[5]||0,U[6]||0,de)}}return new Date(L)}(H),this.init()},J.init=function(){var H=this.$d;this.$y=H.getFullYear(),this.$M=H.getMonth(),this.$D=H.getDate(),this.$W=H.getDay(),this.$H=H.getHours(),this.$m=H.getMinutes(),this.$s=H.getSeconds(),this.$ms=H.getMilliseconds()},J.$utils=function(){return te},J.isValid=function(){return this.$d.toString()!==B},J.isSame=function(H,K){var L=G(H);return this.startOf(K)<=L&&L<=this.endOf(K)},J.isAfter=function(H,K){return G(H)<this.startOf(K)},J.isBefore=function(H,K){return this.endOf(K)<G(H)},J.$g=function(H,K,L){return te.u(H)?this[K]:this.set(L,H)},J.unix=function(){return Math.floor(this.valueOf()/1e3)},J.valueOf=function(){return this.$d.getTime()},J.startOf=function(H,K){var L=this,ee=!!te.u(K)||K,U=te.p(H),q=function(he,Be){var we=te.w(L.$u?Date.UTC(L.$y,Be,he):new Date(L.$y,Be,he),L);return ee?we:we.endOf(g)},de=function(he,Be){return te.w(L.toDate()[he].apply(L.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(Be)),L)},fe=this.$W,Ae=this.$M,ue=this.$D,pe="set"+(this.$u?"UTC":"");switch(U){case E:return ee?q(1,0):q(31,11);case C:return ee?q(1,Ae):q(0,Ae+1);case p:var ve=this.$locale().weekStart||0,me=(fe<ve?fe+7:fe)-ve;return q(ee?ue-me:ue+(6-me),Ae);case g:case m:return de(pe+"Hours",0);case u:return de(pe+"Minutes",1);case A:return de(pe+"Seconds",2);case l:return de(pe+"Milliseconds",3);default:return this.clone()}},J.endOf=function(H){return this.startOf(H,!1)},J.$set=function(H,K){var L,ee=te.p(H),U="set"+(this.$u?"UTC":""),q=(L={},L[g]=U+"Date",L[m]=U+"Date",L[C]=U+"Month",L[E]=U+"FullYear",L[u]=U+"Hours",L[A]=U+"Minutes",L[l]=U+"Seconds",L[s]=U+"Milliseconds",L)[ee],de=ee===g?this.$D+(K-this.$W):K;if(ee===C||ee===E){var fe=this.clone().set(m,1);fe.$d[q](de),fe.init(),this.$d=fe.set(m,Math.min(this.$D,fe.daysInMonth())).$d}else q&&this.$d[q](de);return this.init(),this},J.set=function(H,K){return this.clone().$set(H,K)},J.get=function(H){return this[te.p(H)]()},J.add=function(H,K){var L,ee=this;H=Number(H);var U=te.p(K),q=function(Ae){var ue=G(ee);return te.w(ue.date(ue.date()+Math.round(Ae*H)),ee)};if(U===C)return this.set(C,this.$M+H);if(U===E)return this.set(E,this.$y+H);if(U===g)return q(1);if(U===p)return q(7);var de=(L={},L[A]=r,L[u]=i,L[l]=n,L)[U]||1,fe=this.$d.getTime()+H*de;return te.w(fe,this)},J.subtract=function(H,K){return this.add(-1*H,K)},J.format=function(H){var K=this,L=this.$locale();if(!this.isValid())return L.invalidDate||B;var ee=H||"YYYY-MM-DDTHH:mm:ssZ",U=te.z(this),q=this.$H,de=this.$m,fe=this.$M,Ae=L.weekdays,ue=L.months,pe=L.meridiem,ve=function(Be,we,ae,ze){return Be&&(Be[we]||Be(K,ee))||ae[we].slice(0,ze)},me=function(Be){return te.s(q%12||12,Be,"0")},he=pe||function(Be,we,ae){var ze=Be<12?"AM":"PM";return ae?ze.toLowerCase():ze};return ee.replace(O,function(Be,we){return we||function(ae){switch(ae){case"YY":return String(K.$y).slice(-2);case"YYYY":return te.s(K.$y,4,"0");case"M":return fe+1;case"MM":return te.s(fe+1,2,"0");case"MMM":return ve(L.monthsShort,fe,ue,3);case"MMMM":return ve(ue,fe);case"D":return K.$D;case"DD":return te.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return ve(L.weekdaysMin,K.$W,Ae,2);case"ddd":return ve(L.weekdaysShort,K.$W,Ae,3);case"dddd":return Ae[K.$W];case"H":return String(q);case"HH":return te.s(q,2,"0");case"h":return me(1);case"hh":return me(2);case"a":return he(q,de,!0);case"A":return he(q,de,!1);case"m":return String(de);case"mm":return te.s(de,2,"0");case"s":return String(K.$s);case"ss":return te.s(K.$s,2,"0");case"SSS":return te.s(K.$ms,3,"0");case"Z":return U}return null}(Be)||U.replace(":","")})},J.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},J.diff=function(H,K,L){var ee,U=this,q=te.p(K),de=G(H),fe=(de.utcOffset()-this.utcOffset())*r,Ae=this-de,ue=function(){return te.m(U,de)};switch(q){case E:ee=ue()/12;break;case C:ee=ue();break;case h:ee=ue()/3;break;case p:ee=(Ae-fe)/6048e5;break;case g:ee=(Ae-fe)/864e5;break;case u:ee=Ae/i;break;case A:ee=Ae/r;break;case l:ee=Ae/n;break;default:ee=Ae}return L?ee:te.a(ee)},J.daysInMonth=function(){return this.endOf(C).$D},J.$locale=function(){return N[this.$L]},J.locale=function(H,K){if(!H)return this.$L;var L=this.clone(),ee=Z(H,K,!0);return ee&&(L.$L=ee),L},J.clone=function(){return te.w(this.$d,this)},J.toDate=function(){return new Date(this.valueOf())},J.toJSON=function(){return this.isValid()?this.toISOString():null},J.toISOString=function(){return this.$d.toISOString()},J.toString=function(){return this.$d.toUTCString()},_}(),ie=le.prototype;return G.prototype=ie,[["$ms",s],["$s",l],["$m",A],["$H",u],["$W",g],["$M",C],["$y",E],["$D",m]].forEach(function(_){ie[_[1]]=function(J){return this.$g(J,_[0],_[1])}}),G.extend=function(_,J){return _.$i||(_(J,le,G),_.$i=!0),G},G.locale=Z,G.isDayjs=X,G.unix=function(_){return G(1e3*_)},G.en=N[P],G.Ls=N,G.p={},G})})(qE);var j3=qE.exports;const Rr=li(j3),md=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...i})=>{const[s,l]=x.useState(null),A=j.useRecordContext(i),u=j.useDataProvider(),g=j.useResourceContext(),p=x.useCallback(async E=>{E.preventDefault(),E.stopPropagation();const m=ct.get(A,i==null?void 0:i.source),B=g.replace("entities/",""),y=await u.getFile(`/attachments/${B}/${e||(A==null?void 0:A.id)}/${t||(i==null?void 0:i.source)}/${(m==null?void 0:m.id)||(A==null?void 0:A.id)}`),O=document.createElement("a");O.href=y,O.download=ct.get(A,(i==null?void 0:i.title)||(i==null?void 0:i.source)),O.click()},[u,A,e,g,t,i==null?void 0:i.source,i==null?void 0:i.title]),C=x.useMemo(()=>({...A,[i==null?void 0:i.source]:(A==null?void 0:A.src)||ct.get(A,i==null?void 0:i.source),[i==null?void 0:i.title]:(A==null?void 0:A.title)||ct.get(A,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),[A,i==null?void 0:i.source,i==null?void 0:i.title]),h=j.useTranslate();return x.useEffect(()=>{!A||!(A!=null&&A.userId)||u.getOne(r,{id:A==null?void 0:A.userId}).then(({data:E})=>l(E)).catch(()=>l(null))},[A,u,r]),f.jsx(ZE,{...i,disabled:n,record:C,onClick:p,title:f.jsxs(b.Box,{sx:{cursor:"pointer"},children:[f.jsx(b.Typography,{variant:"subtitle1",children:ct.get(C,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),f.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[ct.get(C,"sizeDescription"),s&&" | ",s&&h("ra.attachment.info",{user:s==null?void 0:s.name,created:Rr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};md.propTypes={...j.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const M3=ce(j.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),Us=e=>{const t=`_${e==null?void 0:e.source}`;return f.jsx(M3,{...e,source:t})};Us.propTypes={...j.ImageField.propTypes,source:c.string};const Hl=({width:e,height:t,circle:n,justify:r,record:i,...s})=>{const l=x.useMemo(()=>({width:typeof e=="number"?`${e}px !important`:`${e} !important`,height:typeof t=="number"?`${t}px !important`:`${t} !important`,borderRadius:n?"50%":1.5}),[e,t,n]),A=j.useRecordContext(),u=i||A;return f.jsx(Us,{sx:g=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${g.palette.divider}`,objectFit:"cover !important",...l,minWidth:l.width,minHeight:l.height}}),...s,record:u})};Hl.defaultProps={...Us.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"},Hl.propTypes={...Us.propTypes,width:c.oneOfType([c.number,c.string]),height:c.oneOfType([c.number,c.string]),circle:c.bool,justify:c.oneOf(["flex-start","center","flex-end"])};var _E={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ln,function(){return function(n,r,i){n=n||{};var s=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function A(g,p,C,h){return s.fromToBase(g,p,C,h)}i.en.relativeTime=l,s.fromToBase=function(g,p,C,h,E){for(var m,B,y,O=C.$locale().relativeTime||l,R=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],w=R.length,S=0;S<w;S+=1){var P=R[S];P.d&&(m=h?i(g).diff(C,P.d,!0):C.diff(g,P.d,!0));var N=(n.rounding||Math.round)(Math.abs(m));if(y=m>0,N<=P.r||!P.r){N<=1&&S>0&&(P=R[S-1]);var F=O[P.l];E&&(N=E(""+N)),B=typeof F=="string"?F.replace("%d",N):F(N,p,P.l,y);break}}if(p)return B;var X=y?O.future:O.past;return typeof X=="function"?X(B):X.replace("%s",B)},s.to=function(g,p){return A(g,p,this,!0)},s.from=function(g,p){return A(g,p,this)};var u=function(g){return g.$u?i.utc():i()};s.toNow=function(g){return this.to(u(this),g)},s.fromNow=function(g){return this.from(u(this),g)}}})})(_E);var D3=_E.exports;const R3=li(D3);Rr.extend(R3);const Wl=e=>{const t=j.useRecordContext(e),[n]=j.useLocaleState(),r=x.useMemo(()=>Rr(ct.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return f.jsxs(x.Fragment,{children:[f.jsx(j.DateField,{record:t,source:e.source,showTime:!0}),f.jsx("br",{}),f.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Wl.displayName="DateAgoField",Wl.propTypes={source:c.string.isRequired};const $E=ce(j.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));$E.propTypes={...j.DateField.propTypes};const Bd=e=>f.jsx($E,{...e});Bd.defaultProps={...j.DateField.defaultProps,variant:"body1"},Bd.propTypes={...j.DateField.propTypes};const em=ce(j.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));em.propTypes={...j.EmailField.propTypes};const vd=e=>f.jsx(em,{...e});vd.defaultProps={...j.EmailField.defaultProps,variant:"body1"},vd.propTypes={...j.EmailField.propTypes};const k3=ce(j.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),yd=({...e})=>{const t=j.useRecordContext(e),n=x.useCallback(r=>{r.preventDefault(),r.stopPropagation();const i=ct.get(t,`_${e==null?void 0:e.source}`,ct.get(t,e==null?void 0:e.source)),s=ct.get(t,(e==null?void 0:e.title)||(e==null?void 0:e.source))||(e==null?void 0:e.title),l=document.createElement("a");l.href=i,l.download=s,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return f.jsx(k3,{...e,record:t,onClick:n})};yd.propTypes={...j.FileField.propTypes,source:c.string,title:c.string};const tm=e=>f.jsx(j.FunctionField,{...e});tm.defaultProps={variant:"body1"};const F3=ce("div")(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`,paddingTop:e.spacing(1),paddingBottom:e.spacing(1),marginBottom:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",[e.breakpoints.down("sm")]:{whiteSpace:"normal",overflow:"visible",textOverflow:"inherit"}})),bd=({source:e,defaultValue:t,...n})=>{const r=j.useRecordContext(n),i=ct.get(r,e,t);return f.jsx("span",{dangerouslySetInnerHTML:{__html:i&&i!==null?i:t}})};bd.propTypes={defaultValue:c.any,source:c.string,record:c.object},bd.defaultProps={defaultValue:" "};const nm=({title:e,children:t})=>e&&e!==!1?f.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;nm.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const Qd=({label:e,source:t,defaultValue:n,children:r,tooltip:i,...s})=>{const{getCurrentDialog:l}=Po(),A=j.useRecordContext(s),u=j.useResourceContext(s),g=l(),p=x.useMemo(()=>!i||i===!1?!1:typeof i=="function"?i(A):typeof i=="string"?ct.get(A,i,i):i,[A,i]);return f.jsx(nm,{title:p,children:f.jsxs(x.Fragment,{children:[f.jsx(b.InputLabel,{children:f.jsx(j.FieldTitle,{label:e,source:t,resource:g||u})}),f.jsx(F3,{...s,children:x.cloneElement(r,{source:t,record:A,defaultValue:n,resource:g||u})})]})})};Qd.propTypes={defaultValue:c.any,tooltip:c.oneOfType([c.string,c.bool,c.func]),source:c.string,label:c.string,name:c.string,children:c.element},Qd.defaultProps={defaultValue:" ",children:f.jsx(bd,{})};const L3=ys("div",{name:"RaApplicaReferenceManyField",slot:"root"})(({theme:e,margin:t,border:n})=>({marginLeft:t?0:`-${e.spacing(2.5)}`,marginRight:t?0:`-${e.spacing(2.5)}`,borderBottom:n?`1px solid ${e.palette.divider}`:"none","& form":{padding:e.spacing(2)},"& .MuiCardContent-root":{borderTop:n?`1px solid ${e.palette.divider}`:"none"},"& .MuiToolbar-root":{[e.breakpoints.up("sm")]:{marginTop:`-${e.spacing(2)}`,marginBottom:e.spacing(t?0:1),marginLeft:e.spacing(t?1:2),marginRight:e.spacing(t?1:2),width:t?"auto":`calc(100% - ${e.spacing(5)})`},[e.breakpoints.down("md")]:{marginTop:0}},"& .RaDatagrid-root":{overflowX:"auto",paddingTop:48,[e.breakpoints.down("sm")]:{width:"calc(100vw - 34px)"}},"& .RaDatagrid-table":{borderBottom:`1px solid ${e.palette.divider}`},"& .MuiTablePagination-toolbar":{marginTop:e.spacing(1),marginBottom:0},"& .RaBulkActionsToolbar-collapsed.RaBulkActionsToolbar-toolbar":{minHeight:0},"& .RaBulkActionsToolbar-toolbar":{minHeight:48,bottom:-56,"& h6":{marginTop:e.spacing(.5)},"& .RaBulkActionsToolbar-topToolbar":{marginTop:e.spacing(1)},[e.breakpoints.down("sm")]:{bottom:-48,borderRadius:0}}})),Oi=e=>f.jsx(L3,{children:f.jsx(j.ReferenceManyField,{pagination:f.jsx(j.Pagination,{}),...e})});Oi.defaultProps={...j.ReferenceManyField.defaultProps,margin:!1,border:!1},Oi.propTypes={...j.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const rm=({source:e,...t})=>{const n=j.useRecordContext(t),r=ct.get(n,e,0),i=r/1024,s=i/1024,l=s/1024,A=l>1?`${l.toFixed(2)} GB`:s>1?`${s.toFixed(2)} MB`:i>1?`${i.toFixed(2)} KB`:`${r.toFixed(2)} B`;return f.jsx(b.Typography,{component:"span",variant:"body1",...t,children:A})};rm.propTypes={record:c.object,source:c.string};const om=ce(j.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));om.propTypes={...j.TextField.propTypes};const xd=e=>f.jsx(om,{...e});xd.defaultProps={...j.TextField.defaultProps,variant:"body1"},xd.propTypes={...j.TextField.propTypes};const at=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:s,divider:l,...A})=>{const u=Kt.useTheme(),{getCurrentDialog:g}=Po(),{source:p,resource:C,isRequired:h}=A,{fieldState:{invalid:E}}=j.useInput(A),m=g();return f.jsxs(b.Stack,{spacing:1,sx:{width:A!=null&&A.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:E?u.palette.error.main:u.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:E===!0,sx:{borderBottom:l?`1px solid ${u.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(j.FieldTitle,{label:e,source:p,resource:m||C,isRequired:h})}),x.isValidElement(t)?x.cloneElement(t,{...t.props,...A,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:E===!0,children:r})]})};at.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool},at.defaultProps={display:"label",divider:!1};const N3=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},V3=ce(j.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({disabled:e,theme:t})=>({"& .previews":{},"& .previews>div":{marginTop:t.spacing(1),padding:t.spacing(1.5),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:t.palette.action.hover},"& .MuiLink-root":{fontSize:t.typography.body1.fontSize}},...N3(e)})),wd=({children:e,disabled:t,type:n,...r})=>{const i=j.useRecordContext(r),s=r==null?void 0:r.source,l=i==null?void 0:i.id;return j.useInput({source:`__${n}__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),f.jsx(at,{...r,children:f.jsx(V3,{disabled:t,children:x.cloneElement(e,{...e.props,entityId:l,property:s})})})};wd.propTypes={...j.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool},wd.defaultProps={children:f.jsx(md,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const H3=ce(j.AutocompleteArrayInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"}})),Td=({...e})=>f.jsx(at,{...e,children:f.jsx(H3,{})});Td.propTypes={...j.AutocompleteArrayInput.propTypes,...at.propTypes},Td.defaultProps={...j.AutocompleteArrayInput.defaultProps,size:"small"};const W3=ce(j.AutocompleteInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{paddingTop:"4px"}})),Pd=e=>{const{perPage:t,...n}=e;return f.jsx(at,{...n,children:f.jsx(W3,{})})};Pd.propTypes={...j.AutocompleteInput.propTypes,...at.propTypes},Pd.defaultProps={...j.AutocompleteInput.defaultProps,size:"small"};const z3=ce(j.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),Sd=({horizontal:e,...t})=>{const n=xt();return f.jsx(at,{...t,sx:e?{flexDirection:e?"row":"column",alignItems:e?"center":"flex-start","& .MuiFormGroup-root":{margin:0},"& .MuiFormControlLabel-root":{margin:0,"& .MuiTypography-root":{display:"none",visibility:"hidden"},"& .MuiSwitch-root":{marginRight:`-${n.spacing(.5)}`}}}:{},children:f.jsx(z3,{})})};Sd.defaultProps={...j.BooleanInput.defaultProps,...at.defaultProps},Sd.propTypes={...j.BooleanInput.propTypes,...at.propTypes,horizontal:c.bool};const U3=ce(j.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Od=e=>f.jsx(at,{...e,children:f.jsx(U3,{})});Od.propTypes={...j.DateInput.propTypes,...at.propTypes},Od.defaultProps={...j.DateInput.defaultProps,...at.defaultProps};const Y3=ce(j.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),jd=e=>f.jsx(at,{...e,children:f.jsx(Y3,{})});jd.propTypes={...j.DateTimeInput.propTypes,...at.propTypes},jd.defaultProps={...at.defaultProps};const G3=ce(j.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({theme:e})=>({"& .previews":{},"& .previews>div":{marginTop:e.spacing(1),padding:e.spacing(1.5),border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:e.palette.action.hover},"& .MuiLink-root":{fontSize:e.typography.body1.fontSize}}})),Md=({children:e,title:t,...n})=>{const r=Cs.useWatch({name:n.source}),i=j.useRecordContext(n),{source:s}=n,l=x.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const A=ct.get(i,s);if(A){const u=A.split("__");return u.length>0?u[u.length-1]:A}return A},[i,s,r]);return f.jsx(at,{...n,children:f.jsx(G3,{children:x.cloneElement(e,{...e.props,title:t||s,source:s,record:{...i,[s]:(r==null?void 0:r.title)||ct.get(i,s),[`_${s}`]:(r==null?void 0:r.src)||ct.get(i,`_${s}`),[t||s]:l}})})})};Md.propTypes={...j.FileInput.propTypes,source:c.string,title:c.string,children:c.node},Md.defaultProps={children:f.jsx(yd,{})};const Dd=({children:e,title:t,...n})=>{const r=Cs.useWatch({name:n.source}),i=j.useRecordContext(n),{source:s}=n;return j.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),f.jsx(at,{...n,children:f.jsx(j.ImageInput,{accept:"image/*",children:x.cloneElement(e,{...e.props,title:t,source:s,record:{...i,[s]:(r==null?void 0:r.title)||ct.get(i,s),[`_${s}`]:(r==null?void 0:r.src)||ct.get(i,`_${s}`)}})})})};Dd.defaultProps={children:f.jsx(Hl,{}),multiple:!1},Dd.propTypes={...j.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const K3=ce(j.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Rd=e=>f.jsx(at,{...e,children:f.jsx(K3,{})});Rd.propTypes={...j.NumberInput.propTypes,...at.propTypes},Rd.defaultProps={...j.NumberInput.defaultProps,...at.defaultProps};const im=({source:e,minWidth:t=300,children:n})=>{const r=j.useResourceContext(),i=j.useRecordContext(),[s,l]=x.useState(ct.get(i,e,"")),[A,u]=x.useState(!1),g=x.useCallback(m=>l(m.target.value),[]),p=j.useDataProvider(),C=x.useCallback(m=>{m.key==="Enter"&&(u(!0),p.update(r,{id:i.id,data:{...i,[e]:s,_changed:e}}).then(()=>u(!1)))},[s,p,r,i,e]),h=x.useCallback(()=>{ct.get(i,e)!==s&&(u(!0),p.update(r,{id:i.id,data:{...i,[e]:s,_changed:e}}).then(()=>u(!1)))},[s,p,r,e,i]),E=x.useCallback(m=>{u(!0),p.update(r,{id:i.id,data:{...i,[e]:m,_changed:e}}).then(()=>u(!1))},[p,r,e,i]);return x.useEffect(()=>l(ct.get(i,e)),[i,e]),n?x.cloneElement(n,{...n.props,source:e,value:s,onChange:E}):f.jsx(b.TextField,{value:s,disabled:A,onChange:g,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};im.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const kd=({children:e,...t})=>f.jsx(j.ReferenceArrayInput,{...t,children:x.cloneElement(e,{...t,source:e.props.source||t.source})});kd.propTypes={...j.ReferenceArrayInput.propTypes,children:c.element},kd.defaultProps={...j.ReferenceArrayInput.defaultProps};const Fd=({children:e,...t})=>f.jsx(j.ReferenceInput,{...t,children:x.cloneElement(e,{...t,source:e.props.source||t.source})});Fd.propTypes={...j.ReferenceInput.propTypes,children:c.element},Fd.defaultProps={...j.ReferenceInput.defaultProps};const Ld=({reference:e,target:t,children:n,filters:r,actions:i,...s})=>f.jsx(j.ResourceContextProvider,{value:e,children:f.jsx(Oi,{perPage:5,pagination:f.jsx(j.Pagination,{}),...s,reference:e,target:t,children:f.jsxs(x.Fragment,{children:[f.jsx(j.ListToolbar,{filters:r,actions:i}),n]})})});Ld.propTypes={...Oi.propTypes,children:c.node.isRequired,reference:c.string.isRequired,target:c.string.isRequired,filters:c.oneOfType([c.element,c.func,c.element,c.arrayOf(c.node)]),actions:c.oneOfType([c.element,c.func,c.element])},Ld.defaultProps={...Oi.defaultProps};const J3=ce(j.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),X3=e=>f.jsx(J3,{...e}),sm=ce(j.SelectArrayInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .RaSelectArrayInput-chips > .RaSelectArrayInput-chip":{marginTop:"-2px",marginBottom:"-2px"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}}));sm.propTypes={...j.SelectArrayInput.propTypes};const Nd=e=>f.jsx(at,{...e,children:f.jsx(sm,{options:{autoWidth:!1}})});Nd.defaultProps={optionText:"name",optionValue:"id"},Nd.propTypes={...j.SelectArrayInput.propTypes,...at.propTypes};const Z3=ce(j.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),am=e=>f.jsx(at,{...e,children:f.jsx(Z3,{})});am.propTypes={...j.SelectInput.propTypes,...at.propTypes};const Hn=e=>f.jsx(at,{...e,children:f.jsx(j.TextInput,{})});Hn.propTypes={...j.TextInput.propTypes,...at.propTypes};const zl=({...e})=>{var A,u;const t=j.useTranslate(),n=j.maxLength(e==null?void 0:e.maxLength,"app.input.max_length_error"),r=(u=(A=Cs.useController({name:e==null?void 0:e.source}))==null?void 0:A.field)==null?void 0:u.value;let i=e.helperText,s=e.validate;s?Array.isArray(s)&&s.indexOf(n)===-1&&s.push(n):s=[n];const l=t("app.input.max_length_info",{count:(r==null?void 0:r.length)||0,max:e==null?void 0:e.maxLength});return e!=null&&e.maxLength&&(i=i&&i.length>0?`${l} - ${t(i)}`:l),f.jsx(Hn,{...e,validate:s,helperText:i,inputProps:{maxLength:e==null?void 0:e.maxLength}})};zl.displayName="SmartTextInput",zl.defaultProps={multiline:!1},zl.propTypes={...Hn.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const lm=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return Rr().hour(n).minute(r)};function q3(){let e=new Date().getTime();return window.performance&&typeof window.performance.now=="function"&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)})}const _3=e=>{if(!e)return"";const t=lm(e);return t?t.format("HH:mm"):""},$3=e=>e,ej=ce(j.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Vd=e=>f.jsx(at,{...e,children:f.jsx(ej,{})});Vd.defaultProps={...j.TimeInput.defaultProps,format:_3,parse:$3},Vd.propTypes={...j.TimeInput.propTypes,...at.propTypes};const Hd=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=Qn(),[r,i]=x.useState(!1),s=Ce.useAuthProvider(),l=Ce.useTranslate(),A=Ce.useNotify(),u=x.useCallback(g=>{const{oldPassword:p,newPassword:C}=g;i(!0),s==null||s.changePassword(p,C).then(()=>{A("ra.auth.password_changed"),e()}).catch(h=>A(h,{type:"error"})).finally(()=>i(!1))},[s,e]);return f.jsx(Ce.ResourceContextProvider,{value:"user/change-password",children:f.jsx(Ce.EditContextProvider,{value:{record:{},resource:"user/change-password",save:u},children:f.jsx(Nl,{onSubmit:u,toolbar:f.jsx(Dr,{children:f.jsx(j.SaveButton,{disabled:r})}),children:f.jsxs(b.Grid,{container:!0,spacing:n,children:[t===!0&&f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.Alert,{severity:"warning",children:[f.jsx(b.AlertTitle,{children:l("ra.auth.first_access.change_password")}),l("ra.auth.first_access.change_password_helper")]})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(Hn,{source:"oldPassword",type:"password",validate:Ce.required()})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(Hn,{source:"newPassword",type:"password",validate:Ce.required()})})]})})})})},tj=ce(j.Edit,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaEdit-card":{[e.breakpoints.down("sm")]:{marginBottom:e.spacing(6)}},"& .RaEdi-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaToolbar-mobileToolbar":{borderTop:`1px solid ${e.palette.divider}`},"& .RaEdit-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),nj=ce(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),rj=ce(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),Wd=({title:e,divider:t,variant:n})=>{const r=j.useTranslate();return f.jsxs(x.Fragment,{children:[f.jsx(nj,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&f.jsx(rj,{})]})};Wd.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])},Wd.defaultProps={divider:!0,variant:"h4"};const oj=ce(b.Grid,{name:"ApplicaLongFormView",slot:"Root"})(({theme:e})=>({"& .MuiToolbar-root":{position:"initial",marginTop:e.spacing(2),marginLeft:`-${e.spacing(3)}`,marginRight:`-${e.spacing(3)}`,marginBottom:`-${e.spacing(2)}`,borderTop:`1px solid ${e.palette.divider}`,[e.breakpoints.down("sm")]:{position:"initial !important",width:"auto !important"}},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}}));function cm(e){const{spacing:t}=Qn(),{spacing:n=t}=e,r=Ie.omit(e,["spacing"]);return f.jsx(j.Form,{...r,children:f.jsx(oj,{container:!0,spacing:n*2,children:e.children})})}function zd(e){return e.id??e.label}function Am(e,t){return t.match(new RegExp(`^${e}`))!==null}function ij(e){return Ie.map(e,"id")}function Ul(e){const t=e.match(new RegExp("[^.]+","g"));return t===null?0:t.length}function um(e,t){const n=e!==void 0?Ul(e):0;return Ie.chain(t).filter(i=>e!==void 0?Am(e,i.id):!0).filter(i=>Ul(i.id)===n+1).value()}function sj(e,t){var s;const n=Ie.clone(e),{type:r,payload:i}=t;switch(r){case"setFormRootPath":return Ie.extend(n,{formRootPath:i});case"setSyncWithLocation":return Ie.extend(n,{syncWithLocation:i});case"setActiveItem":return Ie.includes(ij(e.items),i)?Ie.extend(n,{activeItem:i}):n;case"addItem":{const l=i.id,A=Ie.chain(n.items).clone().reject(u=>u.id===l).concat([i]).orderBy(u=>u.index).value();return Ie.extend(n,{items:A}),n.activeItem===void 0&&Ie.extend(n,{activeItem:i.id}),n}case"removeItem":{const l=Ie.isString(i)?i:i.id,A=Ie.chain(n.items).clone().reject(u=>u.id===l).value();return Ie.extend(n,{items:A}),n.activeItem===l&&Ie.extend(n,{activeItem:((s=Ie.first(A))==null?void 0:s.id)??void 0}),n}default:return n}}const aj={syncWithLocation:!0,items:[],activeItem:void 0},dm=x.createContext(void 0);function gm(e){const t=!!(e.syncWithLocation??!0),{rootMatchString:n}=e,{pathname:r}=hs.useLocation(),[i,s]=x.useReducer(sj,Ie.cloneDeep(aj)),{formRootPath:l,items:A}=i,u=x.useMemo(()=>({state:i,dispatch:s}),[i,s]);return x.useEffect(()=>{const g=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/show/*",":resource/:id/show/*","entities/:resource/:id/*",":resource/:id/*"];n!==void 0&&g.push(n);const p=Ie.chain(g).map(h=>hs.matchPath(h,r)).reject(h=>h===null).first().value(),C=p==null?void 0:p.pathnameBase;C!==void 0&&C!==l&&s({type:"setFormRootPath",payload:C})},[r,l,n]),x.useEffect(()=>{s({type:"setSyncWithLocation",payload:!!t})},[t,s]),x.useEffect(()=>{var g;if(t&&l!==void 0){let p=r.replace(l,"").replace(new RegExp(/^\/?/),"");Ie.isEmpty(p)&&(p=((g=Ie.chain(A).filter(C=>um(C.id,A).length===0).orderBy([C=>Ul(C.id),C=>C.index]).first().value())==null?void 0:g.id)??void 0),s({type:"setActiveItem",payload:p})}},[s,l,r,A]),f.jsx(dm.Provider,{value:u,children:e.children})}function fm(){const e=x.useContext(dm);if(e===void 0)throw new Error("[LongForm] useFormContext: context undefined. Please provide a valid Context using LongForm.Provider");return e}function Yl(){return fm().state}function Ud(){return fm().dispatch}function pm(){return Yl().formRootPath}function hm(){return Yl().activeItem}function Cm(){return Yl().items}function Im(){return Yl().syncWithLocation}function Em(){const e=Ud();return x.useCallback(n=>{e({type:"setActiveItem",payload:n})},[e])}function mm(){const e=Ud();return x.useCallback(n=>{e({type:"addItem",payload:n})},[e])}function Bm(){const e=Ud();return x.useCallback(n=>{e({type:"removeItem",payload:n})},[e])}var lj=e=>{let t=e;for(;t=t.parentElement;){const n=getComputedStyle(t,null).getPropertyValue("overflow-y");if(t===document.body)return window;if(n==="auto"||n==="scroll"||n==="overlay")return t}return window},vm=e=>e.firstChild?e.firstChild.offsetParent===e:!0,cj=(e,t)=>{let n=e,r=0;vm(t)||(r+=e.offsetTop-t.offsetTop,t=e.offsetParent,r+=-e.offsetTop);do r+=n.offsetTop,n=n.offsetParent;while(n&&n!==t);return r},Aj=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},Ys=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?Ys="sticky":CSS.supports("position","-webkit-sticky")&&(Ys="-webkit-sticky"));var Gl=!1;try{const e=Object.defineProperty({},"passive",{get(){Gl={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var Yd=e=>{const{el:t,onChange:n,unsubs:r,measure:i}=e;if(t===window){const s=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=i(s()),A=()=>{Object.assign(l,i(s())),n()};return window.addEventListener("resize",A,Gl),r.push(()=>window.removeEventListener("resize",A)),l}else{const s=i(t.getBoundingClientRect()),l=()=>{Object.assign(s,i(t.getBoundingClientRect())),n()},A=new ResizeObserver(l);return A.observe(t),r.push(()=>A.disconnect()),s}},uj=e=>{const t=getComputedStyle(e,null),n=parseInt(t.getPropertyValue("padding-top"),10),r=parseInt(t.getPropertyValue("padding-bottom"),10);return{top:n,bottom:r}},dj=(e,t,n)=>{const{bottom:r,offsetBottom:i,offsetTop:s}=n,l=lj(e);let A=!1;const u=()=>{A||requestAnimationFrame(()=>{const F=C();F!==w&&S(F),A=!1}),A=!0};let g=l===window?window.scrollY:l.scrollTop;const p=F=>{const{offsetTop:X,height:Z}=E,{naturalTop:G}=y,{height:te}=O;return F+X+Z>=G+te+R+i},C=()=>{const{height:F}=E,{height:X}=O;return X+s+i<=F?3:p(g)?1:2},h=l!==window&&vm(l),E=Yd({el:l,onChange:u,unsubs:t,measure:({height:F,top:X})=>({height:F,offsetTop:h?X:0})}),m=Aj(e),B=m===window?{top:0,bottom:0}:uj(m),y=Yd({el:m,onChange:u,unsubs:t,measure:({height:F})=>({height:F-B.top-B.bottom,naturalTop:m===window?0:cj(m,l)+B.top+E.offsetTop})}),O=Yd({el:e,onChange:u,unsubs:t,measure:({height:F})=>({height:F})});let R=0,w=C();const S=F=>{const X=w;if(w=F,X===2&&(R=-1),F===3){e.style.position=Ys,r?e.style.bottom=`${i}px`:e.style.top=`${s}px`;return}const{height:Z,offsetTop:G}=E,{height:te,naturalTop:le}=y,{height:ie}=O;if(F===2)if(e.style.position="relative",R=X===0?Math.max(0,G+g-le+s):Math.max(0,G+g+Z-(le+ie+i)),r){const _=Math.max(0,te-ie-R);e.style.bottom=`${_}px`}else e.style.top=`${R}px`;else e.style.position=Ys,F===1?r?e.style.bottom=`${i}px`:e.style.top=`${Z-ie-i}px`:r?e.style.bottom=`${Z-ie-i}px`:e.style.top=`${s}px`};S(w);const P=F=>{if(F===g)return;const X=F-g;if(g=F,w===3)return;const{offsetTop:Z,height:G}=E,{naturalTop:te,height:le}=y,{height:ie}=O;if(X>0)if(w===0){if(F+Z+s>te){const _=Math.max(0,Z+g-te+s);F+Z+G<=te+ie+_+i?S(2):S(1)}}else w===2&&p(F)&&S(1);else if(w===1){if(Z+F+G<te+le+i){const _=Math.max(0,Z+g+G-(te+ie+i));Z+F+s>=te+_?S(2):S(0)}}else w===2&&Z+F+s<te+R&&S(0)},N=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",N,Gl),l.addEventListener("mousewheel",N,Gl),t.push(()=>l.removeEventListener("scroll",N),()=>l.removeEventListener("mousewheel",N))},gj=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,i]=x.useState(null);return x.useEffect(()=>{if(!r||!Ys)return;const s=[];return dj(r,s,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{s.forEach(l=>l())}},[r,t,e,n]),i},fj=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:i,className:s,style:l}=e,A=gj({offsetTop:t,offsetBottom:n,bottom:r});return f.jsx("div",{className:s,style:l,ref:A,children:i})},pj=fj,ym=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(ym||{});function bm(e){const{sticky:t=!0,disposition:n={xl:3,lg:3,md:4,sm:4,xs:12},spacing:r=2}=e,i=Ie.omit(e,["sticky","disposition","spacing"]),s=t?pj:b.Box,l=x.useMemo(()=>t?{offsetTop:74,offsetBottom:r*2}:{},[t,r]);return f.jsx(b.Grid,{...i,item:!0,...n,children:f.jsx(s,{...l,children:f.jsx(b.Stack,{spacing:r,children:e.children})})})}function Qm(e){return f.jsx(f.Fragment,{children:e.children})}function xm(e){const{children:t}=e;return x.useMemo(()=>{const r={top:[],bottom:[]};return x.Children.forEach(t,i=>{if(x.isValidElement(i)&&(i==null?void 0:i.type)===Qm){const{position:s}=i.props;switch(s){case"top":r.top.push(i);break;case"bottom":r.bottom.push(i);break}}}),r},[t])}function wm(e){const{disposition:t={xl:9,lg:9,md:8,sm:8,xs:12}}=e,n=Ie.omit(e,["disposition"]);return f.jsx(b.Grid,{...n,item:!0,...t,children:e.children})}function Tm(e){const t=hm();return Am(e,t??"")}function Pm(e){const t=Cm();return x.useMemo(()=>um(e,t),[t,e])}function hj(){const e=pm(),t=hs.useNavigate();return x.useCallback(r=>{t(`${e}/${r}`)},[e,t])}function Sm(){const e=Pm();return f.jsx(b.Card,{variant:"outlined",children:f.jsx(b.List,{sx:{"& .MuiListItemButton-root.Mui-selected":{borderColor:"palette.primary.main",borderRightStyle:"solid",borderRightWidth:2},"& .MuiListItemAvatar-root":{minWidth:24}},children:Ie.map(e,(t,n)=>f.jsx(Gd,{...t},n))})})}function Gd(e){const t=Ce.useTranslate()??Ie.identity,n=Om(e),{selected:r,label:i,icon:s,onClick:l,badge:A,items:u,isGroup:g,level:p}=n,{spacing:C}=Qn(),[h,E]=x.useState(r),m=x.useCallback(O=>{E(!h),l(O)},[l,h]),B=s!==void 0,y=Ie.omit(e,["label","icon","selected","badge"]);return f.jsxs(f.Fragment,{children:[f.jsx(b.ListItem,{...y,disablePadding:!0,children:f.jsxs(b.ListItemButton,{selected:r&&!g,onClick:m,sx:{pl:C*p},children:[B&&f.jsx(b.ListItemIcon,{children:s}),f.jsx(b.ListItemText,{inset:!B,primary:t(i)}),A&&f.jsx(b.ListItemAvatar,{children:f.jsx(Ws,{type:"filled",size:"xs",color:A.color??"default",children:A.content})}),g&&(h?f.jsx(dn.ExpandLess,{}):f.jsx(dn.ExpandMore,{}))]})}),g&&f.jsx(b.Collapse,{in:h,timeout:"auto",children:f.jsx(b.List,{children:Ie.map(u,(O,R)=>f.jsx(Gd,{...O},R))})})]})}function Om(e){const{id:t}=e,n=Tm(t),r=Ul(t),i=hj(),s=Im(),l=Em(),A=Pm(t),u=!Ie.isEmpty(A),g=x.useCallback(C=>{u||(s?i(e.id):l(e.id)),Ie.isFunction(e.onClick)&&e.onClick(C)},[l,i,e,s,u]);return x.useMemo(()=>({...e,selected:n,onClick:g,items:A,isGroup:u,level:r}),[e,n,g,A,u])}function jm(e){const{label:t,icon:n,badge:r,index:i=0}=e,s=zd(e),l=mm(),A=Bm(),u=Tm(s);return x.useEffect(()=>(l({id:s,index:i,label:t,icon:n,badge:r}),()=>{A(s)}),[l,A,t,n,s,r,i]),f.jsx(b.Box,{display:u?"unset":"none",children:e.children})}function Mm(e){const t=Kd(e),n=zd(e);return f.jsx(jm,{...e,id:n,children:x.Children.map(t,r=>{const i=zd(r.props);return x.cloneElement(r,{id:`${n}.${i}`})})})}function Dm(e){return f.jsx(jm,{...e})}function Kd(e){const{children:t}=e;return x.useMemo(()=>Ie.chain(x.Children.toArray(t)).filter(r=>x.isValidElement(r)&&((r==null?void 0:r.type)===Dm||(r==null?void 0:r.type)===Mm)).map((r,i)=>x.cloneElement(r,{index:i})).value(),[t])}function Cj(e){const{tabsDisposition:t,contentDisposition:n,spacing:r=2}=e,i=Ie.pick(e,["syncWithLocation"]),s=Ie.omit(e,["tabsDisposition","contentDisposition","syncWithLocation"]),{top:l,bottom:A}=xm(e),u=Kd(e);return f.jsx(gm,{...i,children:f.jsxs(cm,{...s,spacing:r,children:[f.jsxs(bm,{disposition:t,spacing:r,children:[l,f.jsx(Sm,{}),A]}),f.jsx(wm,{disposition:n,children:u})]})})}const Dt=Cj;Dt.BaseForm=cm,Dt.Content=wm,Dt.Provider=gm,Dt.useItems=Cm,Dt.useSyncWithLocation=Im,Dt.useFormRootPath=pm,Dt.useActiveItem=hm,Dt.useSetActiveItem=Em,Dt.useAddItem=mm,Dt.useRemoveItem=Bm,Dt.Sidebar=bm,Dt.SidebarSection=Qm,Dt.SidebarSectionPosition=ym,Dt.useSidebarChildren=xm,Dt.NavMenu=Sm,Dt.NavMenuItem=Gd,Dt.useNavMenuItem=Om,Dt.Tab=Dm,Dt.Group=Mm,Dt.useBaseItemChildren=Kd;const Ij=ce(j.Show,{name:"RaApplicaShow",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaShow-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaShow-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),Ej=ce(j.SimpleFormIterator,{name:"ApplicaSimpleFormIterator",root:"root"})(({theme:e})=>({"& .RaSimpleFormIterator-line":{paddingTop:e.spacing(1),paddingBottom:e.spacing(.5)},"& .RaSimpleFormIterator-action":{display:"flex",flexDirection:"row",alignItems:"center",mb:1.5},"& section":{width:"100%","& label":{position:"relative",overflow:"visible",transform:"none",marginLeft:0}}})),Kl=ys(j.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(()=>({}));Kl.propTypes={...j.TabbedForm.propTypes},Kl.defaultProps={...j.TabbedForm.defaultProps},Kl.Tab=j.TabbedForm.Tab;const Rm=x.createContext(void 0),mj=x.createContext(void 0),Bj=()=>x.useContext(Rm),vj=k.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:i=!1,index:s,member:l,resource:A}=e,u=j.useTranslate(),[g,p]=k.useState(!1),{total:C,remove:h}=Bj(),E=k.useCallback(()=>{p(!1),h(s)},[s,h]),m=x.useMemo(()=>({index:s,total:C,remove:()=>h(s)}),[s,C,h]);return f.jsxs(mj.Provider,{value:m,children:[x.Children.map(n,(B,y)=>{if(!x.isValidElement(B))return null;const{source:O,...R}=B.props;return f.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:x.cloneElement(B,{source:O?`${l}.${O}`:l,index:O?void 0:y,resource:A,disabled:r,...R,label:""})})}),!i&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2.5},children:f.jsx(Ei,{horizontal:!0,children:f.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:u("ra.action.delete")})})}),n.length>0&&f.jsx(j.Confirm,{isOpen:g,title:u("ra.action.remove_item"),content:u("ra.message.remove_item"),onConfirm:E,onClose:()=>p(!1)})]})});var yj=Array.isArray,Jd=yj,bj=typeof Ln=="object"&&Ln&&Ln.Object===Object&&Ln,Qj=bj,xj=Qj,wj=typeof self=="object"&&self&&self.Object===Object&&self,Tj=xj||wj||Function("return this")(),Xd=Tj,Pj=Xd,Sj=Pj.Symbol,Zd=Sj,km=Zd,Fm=Object.prototype,Oj=Fm.hasOwnProperty,jj=Fm.toString,Gs=km?km.toStringTag:void 0;function Mj(e){var t=Oj.call(e,Gs),n=e[Gs];try{e[Gs]=void 0;var r=!0}catch{}var i=jj.call(e);return r&&(t?e[Gs]=n:delete e[Gs]),i}var Dj=Mj,Rj=Object.prototype,kj=Rj.toString;function Fj(e){return kj.call(e)}var Lj=Fj,Lm=Zd,Nj=Dj,Vj=Lj,Hj="[object Null]",Wj="[object Undefined]",Nm=Lm?Lm.toStringTag:void 0;function zj(e){return e==null?e===void 0?Wj:Hj:Nm&&Nm in Object(e)?Nj(e):Vj(e)}var Vm=zj;function Uj(e){return e!=null&&typeof e=="object"}var Yj=Uj,Gj=Vm,Kj=Yj,Jj="[object Symbol]";function Xj(e){return typeof e=="symbol"||Kj(e)&&Gj(e)==Jj}var qd=Xj,Zj=Jd,qj=qd,_j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$j=/^\w*$/;function eM(e,t){if(Zj(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||qj(e)?!0:$j.test(e)||!_j.test(e)||t!=null&&e in Object(t)}var tM=eM;function nM(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Hm=nM,rM=Vm,oM=Hm,iM="[object AsyncFunction]",sM="[object Function]",aM="[object GeneratorFunction]",lM="[object Proxy]";function cM(e){if(!oM(e))return!1;var t=rM(e);return t==sM||t==aM||t==iM||t==lM}var AM=cM,uM=Xd,dM=uM["__core-js_shared__"],gM=dM,_d=gM,Wm=function(){var e=/[^.]+$/.exec(_d&&_d.keys&&_d.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function fM(e){return!!Wm&&Wm in e}var pM=fM,hM=Function.prototype,CM=hM.toString;function IM(e){if(e!=null){try{return CM.call(e)}catch{}try{return e+""}catch{}}return""}var EM=IM,mM=AM,BM=pM,vM=Hm,yM=EM,bM=/[\\^$.*+?()[\]{}|]/g,QM=/^\[object .+?Constructor\]$/,xM=Function.prototype,wM=Object.prototype,TM=xM.toString,PM=wM.hasOwnProperty,SM=RegExp("^"+TM.call(PM).replace(bM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function OM(e){if(!vM(e)||BM(e))return!1;var t=mM(e)?SM:QM;return t.test(yM(e))}var jM=OM;function MM(e,t){return e==null?void 0:e[t]}var DM=MM,RM=jM,kM=DM;function FM(e,t){var n=kM(e,t);return RM(n)?n:void 0}var zm=FM,LM=zm,NM=LM(Object,"create"),Jl=NM,Um=Jl;function VM(){this.__data__=Um?Um(null):{},this.size=0}var HM=VM;function WM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zM=WM,UM=Jl,YM="__lodash_hash_undefined__",GM=Object.prototype,KM=GM.hasOwnProperty;function JM(e){var t=this.__data__;if(UM){var n=t[e];return n===YM?void 0:n}return KM.call(t,e)?t[e]:void 0}var XM=JM,ZM=Jl,qM=Object.prototype,_M=qM.hasOwnProperty;function $M(e){var t=this.__data__;return ZM?t[e]!==void 0:_M.call(t,e)}var eD=$M,tD=Jl,nD="__lodash_hash_undefined__";function rD(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=tD&&t===void 0?nD:t,this}var oD=rD,iD=HM,sD=zM,aD=XM,lD=eD,cD=oD;function ji(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ji.prototype.clear=iD,ji.prototype.delete=sD,ji.prototype.get=aD,ji.prototype.has=lD,ji.prototype.set=cD;var AD=ji;function uD(){this.__data__=[],this.size=0}var dD=uD;function gD(e,t){return e===t||e!==e&&t!==t}var fD=gD,pD=fD;function hD(e,t){for(var n=e.length;n--;)if(pD(e[n][0],t))return n;return-1}var Xl=hD,CD=Xl,ID=Array.prototype,ED=ID.splice;function mD(e){var t=this.__data__,n=CD(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():ED.call(t,n,1),--this.size,!0}var BD=mD,vD=Xl;function yD(e){var t=this.__data__,n=vD(t,e);return n<0?void 0:t[n][1]}var bD=yD,QD=Xl;function xD(e){return QD(this.__data__,e)>-1}var wD=xD,TD=Xl;function PD(e,t){var n=this.__data__,r=TD(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var SD=PD,OD=dD,jD=BD,MD=bD,DD=wD,RD=SD;function Mi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Mi.prototype.clear=OD,Mi.prototype.delete=jD,Mi.prototype.get=MD,Mi.prototype.has=DD,Mi.prototype.set=RD;var kD=Mi,FD=zm,LD=Xd,ND=FD(LD,"Map"),VD=ND,Ym=AD,HD=kD,WD=VD;function zD(){this.size=0,this.__data__={hash:new Ym,map:new(WD||HD),string:new Ym}}var UD=zD;function YD(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var GD=YD,KD=GD;function JD(e,t){var n=e.__data__;return KD(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Zl=JD,XD=Zl;function ZD(e){var t=XD(this,e).delete(e);return this.size-=t?1:0,t}var qD=ZD,_D=Zl;function $D(e){return _D(this,e).get(e)}var eR=$D,tR=Zl;function nR(e){return tR(this,e).has(e)}var rR=nR,oR=Zl;function iR(e,t){var n=oR(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var sR=iR,aR=UD,lR=qD,cR=eR,AR=rR,uR=sR;function Di(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Di.prototype.clear=aR,Di.prototype.delete=lR,Di.prototype.get=cR,Di.prototype.has=AR,Di.prototype.set=uR;var dR=Di,Gm=dR,gR="Expected a function";function $d(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(gR);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var l=e.apply(this,r);return n.cache=s.set(i,l)||s,l};return n.cache=new($d.Cache||Gm),n}$d.Cache=Gm;var fR=$d,pR=fR,hR=500;function CR(e){var t=pR(e,function(r){return n.size===hR&&n.clear(),r}),n=t.cache;return t}var IR=CR,ER=IR,mR=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,BR=/\\(\\)?/g,vR=ER(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(mR,function(n,r,i,s){t.push(i?s.replace(BR,"$1"):r||n)}),t}),yR=vR;function bR(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var QR=bR,Km=Zd,xR=QR,wR=Jd,TR=qd,PR=1/0,Jm=Km?Km.prototype:void 0,Xm=Jm?Jm.toString:void 0;function Zm(e){if(typeof e=="string")return e;if(wR(e))return xR(e,Zm)+"";if(TR(e))return Xm?Xm.call(e):"";var t=e+"";return t=="0"&&1/e==-PR?"-0":t}var SR=Zm,OR=SR;function jR(e){return e==null?"":OR(e)}var MR=jR,DR=Jd,RR=tM,kR=yR,FR=MR;function LR(e,t){return DR(e)?e:RR(e,t)?[e]:kR(FR(e))}var NR=LR,VR=qd,HR=1/0;function WR(e){if(typeof e=="string"||VR(e))return e;var t=e+"";return t=="0"&&1/e==-HR?"-0":t}var zR=WR,UR=NR,YR=zR;function GR(e,t){t=UR(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[YR(t[n++])];return n&&n==r?e:void 0}var KR=GR,JR=KR;function XR(e,t,n){var r=e==null?void 0:JR(e,t);return r===void 0?n:r}var ZR=XR;const qR=li(ZR),qm=e=>{var _,J;const{children:t,resource:n,source:r,label:i,disableActions:s=!1,disableAdd:l=!1,disableRemove:A=!1,className:u,empty:g,template:p={}}=e,[C,h]=x.useState(!1),{fields:E,remove:m,replace:B,append:y}=j.useArrayInput(e),{resetField:O}=Cs.useFormContext(),R=xt(),w=Ce.useTranslate(),S=Ce.useRecordContext(e),P=x.useRef(p||{}),N=Ce.useTranslateLabel(),F=x.useCallback(H=>{m(H)},[m]);if(E.length>0){const{...H}=E[0];P.current=H;for(const K in P.current)P.current[K]=null}const X=x.useCallback((H=void 0)=>{let K=H;H==null&&(K=P.current,x.Children.count(t)===1&&k.isValidElement(x.Children.only(t))&&!x.Children.only(t).props.source&&x.Children.map(t,ee=>k.isValidElement(ee)&&ee.type!==Ce.FormDataConsumer).some(Boolean)?K="":(K=K||{},x.Children.forEach(t,ee=>{k.isValidElement(ee)&&ee.type!==Ce.FormDataConsumer&&ee.props.source&&(K[ee.props.source]=ee.props.defaultValue??null)})));const L={...K,...p};y(L),O(`${r}.${E.length}`,{defaultValue:K})},[y,t,O,r,E.length,p]),Z=H=>K=>{X(),H&&H(K)},G=x.useCallback(()=>{B([]),h(!1)},[B]),te=qR(S,r),le=x.useMemo(()=>({total:E.length,remove:F,source:r}),[E.length,F,r]),ie=R.palette.mode==="dark"?R.palette.grey.A400:R.palette.grey.A800;return E?f.jsx(Rm.Provider,{value:le,children:f.jsxs("div",{className:u,children:[k.cloneElement(f.jsx(_m,{}),{label:i,source:r,disableAdd:l,template:p,onClick:Z((J=(_=e==null?void 0:e.addButton)==null?void 0:_.props)==null?void 0:J.onClick)}),f.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${ie}`},children:f.jsxs(b.Table,{children:[f.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${ie}`},children:f.jsxs(b.TableRow,{children:[x.Children.map(t,(H,K)=>k.isValidElement(H)?f.jsx(b.TableCell,{children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none",children:N({...H.props,resource:n})})},K):null),!s&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"top"},children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none"})},"actions")]})}),f.jsxs(b.TableBody,{children:[E.length===0&&f.jsx(b.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:f.jsx(b.TableCell,{colSpan:4+(s?0:1),align:"center",children:g||f.jsx(b.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),E.length>0&&E.map((H,K)=>f.jsx(b.TableRow,{sx:{borderBottom:`1px solid ${ie}}`},children:f.jsx(vj,{disableRemove:A,disableActions:s,index:K,member:`${r}.${K}`,onRemoveField:F,record:te&&te[K]||{},resource:n,source:r,children:t})},H.id))]})]})}),E.length>0&&f.jsx(j.Confirm,{isOpen:C,title:w("ra.action.clear_array_input"),content:w("ra.message.clear_array_input"),onConfirm:G,onClose:()=>h(!1)})]})}):null},_m=e=>{const{label:t,disableAdd:n,onClick:r}=e,i=xt(),s=i.palette.mode==="dark"?i.palette.grey.A400:i.palette.grey.A800,l=i.palette.mode==="light"?"#000000":"#FFFFFF";return f.jsxs(b.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",children:[t!==!1&&f.jsx(b.Typography,{children:t}),!n&&(k.isValidElement(e==null?void 0:e.addButton)?k.cloneElement(e==null?void 0:e.addButton,{onClick:r}):f.jsx(b.IconButton,{size:"small",color:"secondary",sx:{border:`1px solid ${s}`},onClick:r,children:f.jsx(tt.PlusCircleOutlined,{style:{color:l}})}))]})},_R=ce(qm,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));_m.propTypes={label:c.oneOfType([c.string,c.bool]),source:c.string,defaultValue:c.any},qm.propTypes={addButton:c.element,children:c.node,className:c.string,field:c.object,fields:c.array,fieldState:c.object,formState:c.object,record:c.object,source:c.string,label:c.oneOfType([c.string,c.bool]),resource:c.string,translate:c.func,disableAdd:c.bool,disableRemove:c.oneOfType([c.func,c.bool]),TransitionProps:c.shape({}),empty:c.oneOfType([c.node,c.string]),template:c.object};function $R(e,t){const n=Ie.clone(e),{type:r,payload:i}=t;switch(r){case"updateMedia":{const s=Ie.chain(n.media).clone().extend(i).value();return Ie.extend(n,{media:s})}case"updateDrawer":{const s=Ie.chain(n.drawer).clone().extend(i).value();return Ie.extend(n,{drawer:s})}case"updateLogo":{const s=Ie.chain(n.logo).clone().extend(i).value();return Ie.extend(n,{logo:s})}case"updateNotifications":{const s=Ie.chain(n.notifications).clone().extend(i).value();return Ie.extend(n,{notifications:s})}case"updateTheme":{const s=Ie.chain(n.theme).clone().extend(i).value();return Ie.extend(n,{theme:s})}default:return n}}const e2={drawer:{open:!0,width:260,handleDrawerToggle:()=>{}},media:{downMd:!1,downLg:!1,downXl:!1,horizontal:!1},logo:{},notifications:{enable:!0,resource:"entities/notification"},theme:{iconColor:"grey.300",iconColorOpen:"grey.100"}},$m=x.createContext(void 0);function e0(e){var X;const t=Ce.useGetIdentity(),n=b.useTheme(),r=b.useMediaQuery(n.breakpoints.down("md")),i=b.useMediaQuery(n.breakpoints.down("lg")),s=b.useMediaQuery(n.breakpoints.down("xl")),{miniDrawer:l,isHorizontalLayout:A,menuOrientation:u,drawerWidth:g}=Qn(),p=A(u)&&!i,{drawerOpen:C,openDrawer:h}=qr(),E=x.useCallback(()=>{h(!C)},[C,h]),[m,B]=x.useState(!1),[y,O]=x.useReducer($R,Ie.chain(e2).clone().merge({drawer:{open:!l||C}}).value()),R=x.useCallback(()=>B(!1),[]),w=x.useMemo(()=>({state:y,dispatch:O}),[y,O]),{logoIcon:S,logoMain:P,enableNotification:N,notification:F}=e;return x.useEffect(()=>{O({type:"updateMedia",payload:{downMd:r,downLg:i,downXl:s,horizontal:p}})},[u,r,i,s]),x.useEffect(()=>{O({type:"updateDrawer",payload:{open:C,width:g,handleDrawerToggle:E}})},[C,g,E]),x.useEffect(()=>{l||h(!s)},[s,l]),x.useEffect(()=>{O({type:"updateLogo",payload:{main:P,icon:S}})},[S,P]),x.useEffect(()=>{O({type:"updateNotifications",payload:{enable:N,resource:F??"entities/notification"}})},[N,F]),x.useEffect(()=>{O({type:"updateTheme",payload:{iconColorOpen:n.palette.mode==="dark"?"grey.200":"grey.300",iconColor:n.palette.mode==="dark"?"background.default":"grey.100"}})},[n.palette.mode]),x.useEffect(()=>{var Z;B(((Z=t==null?void 0:t.data)==null?void 0:Z.needToChangePassword)===!0)},[(X=t==null?void 0:t.data)==null?void 0:X.needToChangePassword]),f.jsxs($m.Provider,{value:w,children:[f.jsx(b.Dialog,{open:m,maxWidth:"xs",fullWidth:!0,children:f.jsx(Hd,{onSuccess:R,firstAccess:!0})}),e.children]})}function t0(e){return x.forwardRef((t,n)=>{const{logoIcon:r,logoMain:i,enableNotification:s}=t;return f.jsx(e0,{logoIcon:r,logoMain:i,enableNotification:s,children:f.jsx(e,{ref:n,...t})})})}function eg(){const e=x.useContext($m);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function t2(){return eg().dispatch}function Ri(){return eg().state}function Wn(){return Ri().media}function No(){return Ri().drawer}function n0(){return Ri().logo}function ql(){return Ri().notifications}function _l(){return Ri().theme}function r0(){const{iconColor:e,iconColorOpen:t}=_l(),{open:n,handleDrawerToggle:r}=No();return f.jsx(io,{"aria-label":"open drawer",onClick:r,edge:"start",color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:n?t:e,ml:{xs:0,lg:-2}},children:n?f.jsx(tt.MenuFoldOutlined,{}):f.jsx(tt.MenuUnfoldOutlined,{})})}function o0(e){const t=x.useRef(),n=b.useTheme(),{downLg:r,horizontal:i}=Wn(),{open:s,width:l}=No(),A=r?b.AppBar:Wh,u=Bi(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:i?"100%":s?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),g={position:"fixed",color:"inherit",elevation:0,sx:u};return r||Ie.extend(g,{open:s}),f.jsx(A,{ref:t,...g,children:f.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!i&&f.jsx(r0,{}),e.children]})})}function n2(e){const t=b.useTheme(),{notification:n,onClick:r,selected:i,divider:s}=e,{resource:l}=ql(),A=Ce.useNotify(),u=Ce.useRedirect(),[g]=Ce.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:Rr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(u(n==null?void 0:n.resource),r()):document.location.href=n==null?void 0:n.resource:r()},onFailure:()=>{A("resources.notifications.messages.readed.error","warning")}}),p=x.useCallback(()=>g(),[g]),[C]=Ce.useLocaleState(),h=x.useMemo(()=>Rr(n.created).locale(C).fromNow(),[n,C]);return f.jsx(b.ListItem,{disablePadding:!0,divider:s,children:f.jsxs(b.ListItemButton,{selected:i,onClick:p,children:[f.jsx(b.ListItemAvatar,{children:f.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:f.jsx(tt.MessageOutlined,{})})}),f.jsx(b.ListItemText,{primary:n.title,secondary:n.content}),f.jsx(b.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),f.jsx(b.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"}})]})})}const r2={width:36,height:36,fontSize:"1rem"},o2={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function i0(){const{enable:e}=ql();return e?f.jsx(i2,{}):null}function i2(){const e=b.useTheme(),t=x.useRef(),{resource:n}=ql(),{downMd:r}=Wn(),{iconColor:i,iconColorOpen:s}=_l(),[l,A]=x.useState(!1),[u,g]=x.useState([]),p=u.filter(B=>B.readed===null).length,C=x.useCallback(()=>A(!l),[l]),h=x.useCallback(()=>{t.current&&t.current.contains(event.target)||A(!1)},[t.current,A]),{data:E,isLoading:m}=Ce.useGetList(n,{pagination:{page:1,perPage:50},sort:{field:"created",order:"DESC"},filter:{readed:!1}});return x.useEffect(()=>{!m&&E&&g(E??[])},[E,m]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.jsx(io,{color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:l?s:i},"aria-label":"open profile",ref:t,"aria-controls":l?"profile-grow":void 0,"aria-haspopup":"true",onClick:C,children:f.jsx(b.Badge,{badgeContent:p,color:"primary",children:f.jsx(tt.BellOutlined,{})})}),f.jsx(b.Popper,{placement:r?"bottom":"bottom-end",open:l,anchorEl:t.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[r?-5:0,9]}}]},children:({TransitionProps:B})=>f.jsx(ao,{type:"grow",position:r?"top":"top-right",in:open,...B,children:f.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[e.breakpoints.down("md")]:{maxWidth:285}},children:f.jsx(b.ClickAwayListener,{onClickAway:h,children:f.jsx(or,{title:"Notification",elevation:0,border:!1,content:!1,secondary:f.jsx(f.Fragment,{children:p>0&&f.jsx(b.Tooltip,{title:"Mark as all read",children:f.jsx(io,{color:"success",size:"small",children:f.jsx(tt.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:f.jsx(b.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":r2,"& .MuiListItemSecondaryAction-root":{...o2,position:"relative"}}},children:u.map((y,O)=>f.jsx(n2,{selected:p>0,notification:y,onClick:h,divider:O<u.length-1},y.id))})})})})})})]})}const s2=()=>{const[e,t]=x.useState(!1),n=x.useCallback(()=>t(!1),[t]),r=x.useCallback(()=>t(!0),[t]),i=Ce.useTranslate();return f.jsxs(x.Fragment,{children:[f.jsxs(b.ListItemButton,{onClick:r,children:[f.jsx(b.ListItemIcon,{children:f.jsx(dn.Key,{})}),f.jsx(b.ListItemText,{primary:i("ra.auth.change_password")})]}),f.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:f.jsx(Hd,{onSuccess:n})})]})},a2=()=>{const e=Ce.useLogout(),t=Ce.useTranslate();return f.jsx(x.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:e,children:[f.jsx(b.ListItemIcon,{children:f.jsx(dn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},l2=()=>{const e=Ce.useTranslate(),t=Ce.useAuthProvider(),n=x.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,i]=x.useState(!1);return x.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(s=>i(s))},[t,i]),r?f.jsx(x.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:n,children:[f.jsx(b.ListItemIcon,{children:f.jsx(dn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};c.node,c.any.isRequired,c.any.isRequired;const s0=()=>{var B;const e=b.useTheme(),{identity:t}=j.useGetIdentity(),n=t!==void 0&&t.image&&t.image!==null&&t.image!=="",r=x.useRef(null),[i,s]=x.useState(!1),l=()=>{s(y=>!y)},A=y=>{r.current&&r.current.contains(y.target)||s(!1)},u=e.palette.mode==="dark"?"grey.200":"grey.300",g=j.useLogout(),p=j.useDataProvider(),C=j.useAuthProvider(),h=x.useCallback(()=>{g()},[C,g]),[E,m]=x.useState(null);return x.useEffect(()=>{if(!n)return;async function y(){var O=await p.getFile("/profile/me/image");m(O)}y()},[p,n]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.jsx(b.ButtonBase,{sx:{p:.25,bgcolor:i?u:"transparent",borderRadius:1,"&:hover":{bgcolor:e.palette.mode==="dark"?"secondary.light":"secondary.lighter"},"&:focus-visible":{outline:`2px solid ${e.palette.secondary.dark}`,outlineOffset:2}},"aria-label":"open profile",ref:r,"aria-controls":i?"profile-grow":void 0,"aria-haspopup":"true",onClick:l,children:f.jsxs(b.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[f.jsx(Ws,{alt:(B=t==null?void 0:t.name)==null?void 0:B.toUpperCase(),src:E,size:"xs"}),f.jsx(b.Typography,{variant:"subtitle1",children:t==null?void 0:t.name})]})}),f.jsx(b.Popper,{placement:"bottom-end",open:i,anchorEl:r.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:y})=>{var O;return f.jsx(ao,{type:"grow",position:"top-right",in:i,...y,children:f.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250}},children:f.jsx(b.ClickAwayListener,{onClickAway:A,children:f.jsxs(or,{elevation:0,border:!1,content:!1,children:[f.jsx(b.CardContent,{sx:{px:2.5,pt:3},children:f.jsxs(b.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[f.jsx(b.Grid,{item:!0,children:f.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[f.jsx(Ws,{alt:"profile user",src:E,sx:{width:32,height:32}}),f.jsxs(b.Stack,{children:[f.jsx(b.Typography,{variant:"h6",children:t==null?void 0:t.name}),f.jsx(b.Typography,{variant:"body2",color:"textSecondary",children:(O=t==null?void 0:t.roles)==null?void 0:O.map(R=>R.name.replace("ROLE_","")).join(",")})]})]})}),f.jsx(b.Grid,{item:!0,children:f.jsx(b.Tooltip,{title:"Logout",children:f.jsx(io,{size:"large",sx:{color:"text.primary"},onClick:h,children:f.jsx(tt.LogoutOutlined,{})})})})]})}),f.jsx(b.Grid,{container:!0,children:f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[f.jsx(s2,{}),f.jsx(a2,{}),f.jsx(l2,{})]})})})]})})})})}})]})},a0=e=>{const t=xt(),{downMd:n}=Wn(),{iconColor:r,iconColorOpen:i}=_l(),[s,l]=x.useState(!1),A=x.useRef(null),u=x.useCallback(()=>{l(!s)},[s]),g=x.useCallback(p=>{A.current&&A.current.contains(p.target)||l(!1)},[]);return n?f.jsxs(f.Fragment,{children:[f.jsx(b.Box,{sx:{flexShrink:0},children:f.jsx(io,{sx:{color:"text.primary",bgcolor:s?i:r},"aria-label":"open more menu",ref:A,"aria-controls":s?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:u,color:"secondary",variant:"light",children:f.jsx(tt.MoreOutlined,{})})}),f.jsx(b.Popper,{placement:"bottom-end",open:s,anchorEl:A.current,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:p})=>f.jsx(ao,{type:"fade",in:s,...p,children:f.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1},children:f.jsx(b.ClickAwayListener,{onClickAway:g,children:f.jsx(b.AppBar,{color:"inherit",children:f.jsx(b.Toolbar,{children:e.children})})})})})})]}):f.jsx(f.Fragment,{children:e.children})};function l0(e){return f.jsx(b.Box,{...e,flex:1})}function Ks(e){const{name:t,version:n}=e;return f.jsx(b.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:f.jsxs(b.Typography,{variant:"caption",children:[f.jsx("span",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.copy)||""}})," ",t," - ",n]})})}Ks.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string},Ks.defaultProps={copy:"© Applica Software Guru for"};var c0={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(c0);var tg=c0.exports,ng={};const c2=YQ(XO);var A0;function rg(){return A0||(A0=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=c2}(ng)),ng}function u0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=u0(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function d0(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=u0(e))&&(r&&(r+=" "),r+=t);return r}var og=globalThis&&globalThis.__assign||function(){return og=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},og.apply(this,arguments)},A2=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},g0=function(e){var t=e.className,n=e.sx,r=A2(e,["className","sx"]),i=Ce.useLoading(),s=xt();return k.createElement(u2,{className:t,sx:n},i?k.createElement(pd,og({className:d0("app-loader",$l.loader),color:"inherit",size:s.spacing(2),thickness:6},r)):k.createElement($0,{className:$l.loadedIcon}))};g0.propTypes={classes:c.object,className:c.string,width:c.string};var ig="RaLoadingIndicator",$l={loader:"".concat(ig,"-loader"),loadedIcon:"".concat(ig,"-loadedIcon")},u2=ce("div",{name:ig,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat($l.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat($l.loadedIcon)]={},t});const sg=e=>e.scrollTop;function ki(e,t){var n,r;const{timeout:i,easing:s,style:l={}}=e;return{duration:(n=l.transitionDuration)!=null?n:typeof i=="number"?i:i[t.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof s=="object"?s[t.mode]:s,delay:l.transitionDelay}}const d2=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function g2(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),s=ui(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const g=s.getComputedStyle(t);l=g.getPropertyValue("-webkit-transform")||g.getPropertyValue("transform")}let A=0,u=0;if(l&&l!=="none"&&typeof l=="string"){const g=l.split("(")[1].split(")")[0].split(",");A=parseInt(g[4],10),u=parseInt(g[5],10)}return e==="left"?i?`translateX(${i.right+A-r.left}px)`:`translateX(${s.innerWidth+A-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-A}px)`:`translateX(-${r.left+r.width-A}px)`:e==="up"?i?`translateY(${i.bottom+u-r.top}px)`:`translateY(${s.innerHeight+u-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-u}px)`:`translateY(-${r.top+r.height-u}px)`}function f0(e){return typeof e=="function"?e():e}function ec(e,t,n){const r=f0(n),i=g2(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const p0=k.forwardRef(function(t,n){const r=xt(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:A=!0,children:u,container:g,direction:p="down",easing:C=i,in:h,onEnter:E,onEntered:m,onEntering:B,onExit:y,onExited:O,onExiting:R,style:w,timeout:S=s,TransitionComponent:P=cd}=t,N=Ke(t,d2),F=k.useRef(null),X=yn(u.ref,F,n),Z=L=>ee=>{L&&(ee===void 0?L(F.current):L(F.current,ee))},G=Z((L,ee)=>{ec(p,L,g),sg(L),E&&E(L,ee)}),te=Z((L,ee)=>{const U=ki({timeout:S,style:w,easing:C},{mode:"enter"});L.style.webkitTransition=r.transitions.create("-webkit-transform",z({},U)),L.style.transition=r.transitions.create("transform",z({},U)),L.style.webkitTransform="none",L.style.transform="none",B&&B(L,ee)}),le=Z(m),ie=Z(R),_=Z(L=>{const ee=ki({timeout:S,style:w,easing:C},{mode:"exit"});L.style.webkitTransition=r.transitions.create("-webkit-transform",ee),L.style.transition=r.transitions.create("transform",ee),ec(p,L,g),y&&y(L)}),J=Z(L=>{L.style.webkitTransition="",L.style.transition="",O&&O(L)}),H=L=>{l&&l(F.current,L)},K=k.useCallback(()=>{F.current&&ec(p,F.current,g)},[p,g]);return k.useEffect(()=>{if(h||p==="down"||p==="right")return;const L=Jp(()=>{F.current&&ec(p,F.current,g)}),ee=ui(F.current);return ee.addEventListener("resize",L),()=>{L.clear(),ee.removeEventListener("resize",L)}},[p,h,g]),k.useEffect(()=>{h||K()},[h,K]),f.jsx(P,z({nodeRef:F,onEnter:G,onEntered:le,onEntering:te,onExit:_,onExited:J,onExiting:ie,addEndListener:H,appear:A,in:h,timeout:S},N,{children:(L,ee)=>k.cloneElement(u,z({ref:X,style:z({visibility:L==="exited"&&!h?"hidden":void 0},w,u.props.style)},ee))}))});process.env.NODE_ENV!=="production"&&(p0.propTypes={addEndListener:c.func,appear:c.bool,children:ci.isRequired,container:gr(c.oneOfType([wo,c.func]),e=>{if(e.open){const t=f0(e.container);if(t&&t.nodeType===1){const n=t.getBoundingClientRect();if(process.env.NODE_ENV!=="test"&&n.top===0&&n.left===0&&n.right===0&&n.bottom===0)return new Error(["MUI: The `container` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
|
|
202
|
+
`),l3)),HE=k.forwardRef(function(t,n){const r=zt({props:t,name:"MuiCircularProgress"}),{className:i,color:s="primary",disableShrink:l=!1,size:A=40,style:u,thickness:g=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ke(r,s3),E=z({},r,{color:s,disableShrink:l,size:A,thickness:g,value:p,variant:C}),m=c3(E),B={},y={},O={};if(C==="determinate"){const R=2*Math.PI*((so-g)/2);B.strokeDasharray=R.toFixed(3),O["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*R).toFixed(3)}px`,y.transform="rotate(-90deg)"}return f.jsx(A3,z({className:Xe(m.root,i),style:z({width:A,height:A},y,u),ownerState:E,ref:n,role:"progressbar"},O,h,{children:f.jsx(u3,{className:m.svg,ownerState:E,viewBox:`${so/2} ${so/2} ${so} ${so}`,children:f.jsx(d3,{className:m.circle,style:B,ownerState:E,cx:so,cy:so,r:(so-g)/2,fill:"none",strokeWidth:g})})}))});process.env.NODE_ENV!=="production"&&(HE.propTypes={classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","primary","secondary","error","info","success","warning"]),c.string]),disableShrink:gr(c.bool,e=>e.disableShrink&&e.variant&&e.variant!=="indeterminate"?new Error("MUI: You have provided the `disableShrink` prop with a variant other than `indeterminate`. This will have no effect."):null),size:c.oneOfType([c.number,c.string]),style:c.object,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),thickness:c.number,value:c.number,variant:c.oneOf(["determinate","indeterminate"])});const pd=HE;function g3(e){return Ft("MuiLoadingButton",e)}const Mr=Wt("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),f3=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],p3=e=>{const{loading:t,loadingPosition:n,classes:r}=e,i={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Pe(n)}`],endIcon:[t&&`endIconLoading${Pe(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Pe(n)}`]},s=dr.unstable_composeClasses(i,g3,r);return z({},r,s)},h3=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",C3=ce(o3,{shouldForwardProp:e=>h3(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Mr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Mr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>z({[`& .${Mr.startIconLoadingStart}, & .${Mr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${Mr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Mr.startIconLoadingStart}, & .${Mr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Mr.startIconLoadingStart}, & .${Mr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),I3=ce("span",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Pe(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>z({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),WE=k.forwardRef(function(t,n){const r=zt({props:t,name:"MuiLoadingButton"}),{children:i,disabled:s=!1,id:l,loading:A=!1,loadingIndicator:u,loadingPosition:g="center",variant:p="text"}=r,C=Ke(r,f3),h=VA(l),E=u??f.jsx(pd,{"aria-labelledby":h,color:"inherit",size:16}),m=z({},r,{disabled:s,loading:A,loadingIndicator:E,loadingPosition:g,variant:p}),B=p3(m),y=A?f.jsx(I3,{className:B.loadingIndicator,ownerState:m,children:E}):null;return f.jsxs(C3,z({disabled:s||A,id:h,ref:n},C,{variant:p,classes:B,ownerState:m,children:[m.loadingPosition==="end"?i:y,m.loadingPosition==="end"?y:i]}))});process.env.NODE_ENV!=="production"&&(WE.propTypes={children:c.node,classes:c.object,disabled:c.bool,id:c.string,loading:c.bool,loadingIndicator:c.node,loadingPosition:gr(c.oneOf(["start","end","center"]),e=>e.loadingPosition==="start"&&!e.startIcon?new Error('MUI: The loadingPosition="start" should be used in combination with startIcon.'):e.loadingPosition==="end"&&!e.endIcon?new Error('MUI: The loadingPosition="end" should be used in combination with endIcon.'):null),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["contained","outlined","text"]),c.string])});const E3=WE;function hd({variant:e,theme:t,color:n,loadingPosition:r}){const i=en(t,n),{lighter:s,main:l,dark:A,contrastText:u}=i,g=`${n}Button`,p=Si(t,g),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},E={"&::after":{boxShadow:`0 0 6px 6px ${Ve(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${Ve(l,.9)}`},"&:focus-visible":{outline:`2px solid ${A}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:l,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{backgroundColor:A,color:u},...E};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{backgroundColor:A,color:u},...E};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:u},"& .MuiLoadingButton-loadingIndicator":{color:u},"&:hover":{boxShadow:"none",backgroundColor:A,color:u},...E};case"outlined":return{backgroundColor:"transparent",borderColor:l,...h,...C};case"dashed":return{backgroundColor:s,borderColor:l,...h,...C,...E};case"text":default:return{color:l,...C,...E}}}const m3=ce(E3,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:i,loadingPosition:s})=>({"::after":{content:'""',display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:n==="rounded"?"50%":4,opacity:0,transition:"all 0.5s"},":active::after":{position:"absolute",borderRadius:n==="rounded"?"50%":4,left:0,top:0,opacity:1,transition:"0s"},...t==="text"&&{...hd({variant:t,theme:e,color:r,loadingPosition:s}),"&.MuiButton-sizeMedium":{height:36},"&.MuiButton-sizeSmall":{height:30},"&.MuiButton-sizeLarge":{height:44}},...n&&{minWidth:0,"&.MuiButton-sizeMedium":{width:36,height:36},"&.MuiButton-sizeSmall":{width:30,height:30},"&.MuiButton-sizeLarge":{width:44,height:44},...n==="rounded"&&{borderRadius:"50%"}},...t==="outlined"&&{border:"1px solid"},...t==="dashed"&&{border:"1px dashed"},...(t==="contained"||t==="shadow")&&!i&&{color:"#fff"},...t!=="text"&&{...hd({variant:t,theme:e,color:r,loadingPosition:s})},"&.Mui-disabled":{...t!=="text"&&{...hd({variant:t,theme:e,color:r,loadingPosition:s})}}})),Cd=x.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...i},s)=>{const l=xt();return f.jsx(m3,{ref:s,variant:e,shape:t,theme:l,loadingPosition:i.loadingPosition,loading:i.loading,color:r,...i,children:n})});Cd.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string},Cd.displayName="LoadingButton";function B3({color:e,theme:t,labelColor:n}){const r=en(t,e),{main:i,contrastText:s}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:i,color:n||s},[`& .${b.tooltipClasses.arrow}`]:{color:i}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||s,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const v3=ce(({className:e,...t})=>f.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&B3({color:t,theme:e,labelColor:n})}));function zE({children:e,arrow:t,labelColor:n="",...r}){const i=xt();return f.jsx(b.Box,{display:"flex",children:f.jsx(v3,{arrow:t,...r,theme:i,labelColor:n,children:e})})}zE.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const ao=x.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...i},s)=>{let l={transformOrigin:"0 0 0"};switch(t){case"top-right":l={transformOrigin:"top right"};break;case"top":l={transformOrigin:"top"};break;case"bottom-left":l={transformOrigin:"bottom left"};break;case"bottom-right":l={transformOrigin:"bottom right"};break;case"bottom":l={transformOrigin:"bottom"};break;case"top-left":default:l={transformOrigin:"0 0 0"};break}return f.jsxs(b.Box,{ref:s,children:[n==="grow"&&f.jsx(b.Grow,{...i,timeout:{appear:0,enter:150,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&f.jsx(b.Collapse,{...i,sx:l,children:e}),n==="fade"&&f.jsx(b.Fade,{...i,timeout:{appear:0,enter:300,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&f.jsx(b.Slide,{...i,timeout:{appear:0,enter:150,exit:150},direction:r,children:f.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&f.jsx(b.Zoom,{...i,children:f.jsx(b.Box,{sx:l,children:e})})]})});ao.propTypes={children:c.node,type:c.oneOf(["grow","fade","collapse","slide","zoom"]),position:c.oneOf(["top-left","top-right","top","bottom-left","bottom-right","bottom"]),direction:c.oneOf(["up","down","left","right"])},x.forwardRef(function(t,n){return f.jsx(b.Zoom,{ref:n,timeout:200,...t})});function UE({value:e,...t}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",value:e,...t}),f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:`${Math.round(e)}%`})})]})}UE.propTypes={value:c.number};function YE({value:e,size:t,variant:n,thickness:r,showLabel:i,pathColor:s,sx:l,...A}){return f.jsxs(b.Box,{sx:{position:"relative",display:"inline-flex"},children:[f.jsx(b.CircularProgress,{variant:"determinate",sx:{color:s||"grey.200"},size:t,thickness:r,...A,value:100}),i&&f.jsx(b.Box,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:f.jsx(b.Typography,{variant:"caption",component:"div",color:"text.secondary",children:e?`${Math.round(e)}%`:"0%"})}),f.jsx(b.CircularProgress,{variant:n,sx:{...l,position:"absolute",left:0,[`& .${b.circularProgressClasses.circle}`]:{strokeLinecap:"round"}},size:t,thickness:r,value:e,...A})]})}YE.propTypes={value:c.number,size:c.number,variant:c.string,thickness:c.number,showLabel:c.bool,pathColor:c.string,sx:c.array,others:c.array};function GE({icon:e,value:t,...n}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:t,...n})}),f.jsx(b.Box,{sx:{minWidth:35},children:e})]})}GE.propTypes={icon:c.node,value:c.number};function KE({value:e,...t}){return f.jsxs(b.Box,{sx:{display:"flex",alignItems:"center"},children:[f.jsx(b.Box,{sx:{width:"100%",mr:1},children:f.jsx(b.LinearProgress,{variant:"determinate",value:e,...t})}),f.jsx(b.Box,{sx:{minWidth:35},children:f.jsx(b.Typography,{variant:"body2",color:"text.secondary",children:`${Math.round(e)}%`})})]})}KE.propTypes={value:c.number};const JE=x.createContext({});function y3(e){const{useDefaults:t=!1,queryOptions:n={}}=e,r=j.useResourceContext(),i=j.useDataProvider(),{search:s}=hs.useLocation(),l=`${r}/new`,A=x.useCallback(()=>{if(!t||!Ie.isFunction(i.get))return Promise.resolve({});const h={};return new URLSearchParams(s??"").forEach((E,m)=>{h[m]=E}),i.get(l,h).then(E=>E.data).then(E=>{const{responseCode:m,value:B}=E;return m==="ok"?B:Promise.reject(E)})},[r,t,s,i]),u=x.useMemo(()=>Ie.chain(n).extend({queryKey:[r,s],queryFn:A}).value(),[r,s,A,n]),{data:g,isLoading:p}=wA.useQuery(u),C=Ie.omit(e,["useDefaults"]);return p?f.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:f.jsx(b.CircularProgress,{})}):f.jsx(JE.Provider,{value:g??{},children:f.jsx(j.Create,{...C})})}function b3(){return x.useContext(JE)}const Q3=ce(y3,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"& .RaCreate-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaCreate-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),x3=ys(j.Toolbar,{name:"RaApplicaToolbar",slot:"Root"})(({theme:e})=>({...e.mixins.toolbar,backgroundColor:e.palette.background.paper,justifyContent:"flex-end","& .RaToolbar-defaultToolbar":{justifyContent:"right",paddingBottom:e.spacing(2),"& > *":{marginLeft:e.spacing(1)}},"& .MuiButtonBase-root":{marginLeft:e.spacing(1)}})),Dr=e=>f.jsx(x3,{...e});Dr.defaultProps={...j.Toolbar.defaultProps},Dr.propTypes={...j.Toolbar.propTypes};const Id=({children:e,content:t,title:n,subheader:r,secondary:i,toolbar:s,...l})=>{const A=j.useTranslate(),u=j.useResourceContext(),{cardTitle:g,cardSubheader:p}=x.useMemo(()=>{const C=n||`resources.${u}.title`;return{cardTitle:A(C,{_:C}),cardSubheader:r!==null?A(r,{_:r}):null}},[u,r,n,A]);return f.jsx(b.Grid,{item:!0,...l,children:f.jsx(or,{content:t,title:g,subheader:p,secondary:i,divider:!0,children:f.jsxs(x.Fragment,{children:[e,s===!0?f.jsx(Dr,{children:f.jsx(j.SaveButton,{})}):s]})})})};Id.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12},Id.propTypes={...b.Grid.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),contained:c.bool,content:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object]),spacing:c.number,toolbar:c.oneOfType([c.node,c.bool])};const w3=ce(j.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),Ll=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:i}=Qn();return f.jsx(w3,{defaultValues:n,spacing:t||i,children:f.jsx(b.Grid,{container:!0,...r,spacing:t||i,children:e})})};Ll.propTypes={...b.Grid.propTypes,...j.Form.propTypes,children:c.oneOfType([c.node,c.arrayOf(c.node)]),spacing:c.number,defaultValues:c.oneOfType([c.object,c.func]),record:c.object,validate:c.func},Ll.defaultProps={...b.Stack.defaultProps},Ll.Section=Id;const T3=ys(j.SimpleForm,{name:"RaApplicaSimpleForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0}})),Nl=({title:e,modal:t,content:n,subheader:r,secondary:i,sx:s,...l})=>{const A=Vh(e),u=j.useRecordContext();return f.jsx(or,{content:n,title:A,subheader:r,secondary:u!=null&&u.id?i:null,sx:{...s,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:f.jsx(T3,{toolbar:f.jsx(Dr,{}),...l})})};Nl.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:f.jsx(Dr,{children:f.jsx(j.SaveButton,{type:"button"})}),secondary:f.jsx(Ei,{children:f.jsx(j.DeleteWithConfirmButton,{})})},Nl.propTypes={...j.SimpleForm.propTypes,modal:c.bool,content:c.bool,contained:c.bool,subheader:c.oneOfType([c.string,c.node]),title:c.oneOfType([c.string,c.node]),secondary:c.oneOfType([c.node,c.string,c.object])};const Vl=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:s,divider:l,...A})=>{const u=Kt.useTheme(),{getCurrentDialog:g}=Po(),{source:p,resource:C,isRequired:h}=A,{getFieldState:E,formState:m}=Cs.useFormContext(),{error:B}=E(p,m),y=g();return f.jsxs(b.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:B?u.palette.error.main:u.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${u.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(j.FieldTitle,{label:e,source:p,resource:y||C,isRequired:h})}),x.isValidElement(t)?x.cloneElement(t,{...t.props,...A,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:!!B,children:r})]})};Vl.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool},Vl.defaultProps={display:"label",divider:!1};const P3=ce(j.ArrayInput,{name:"ApplicaArrayInput",slot:"root"})(({theme:e})=>({"& .MuiStack-root > label":{marginTop:e.spacing(2)},"& .MuiInputLabel-shrink":{paddingBottom:0},marginTop:"0 !important","& .RaSimpleFormIterator-line > .RaSimpleFormIterator-form":{paddingBottom:e.spacing(.5),"& > div":{width:"100%"}}})),S3=({label:e,addLabel:t,source:n,helperText:r,divider:i=!0,...s})=>f.jsx(Vl,{label:e,addLabel:t,source:n,helperText:r,divider:i,children:f.jsx(P3,{source:n,label:!1,...s})}),Ed=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:f.jsxs(Ei,{children:[e&&f.jsx(j.EditButton,{}),t&&f.jsx(j.DeleteWithConfirmButton,{}),n&&f.jsx(j.CloneButton,{})]});Ed.defaultProps={canEdit:!0,canDelete:!0,canClone:!1},Ed.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const XE=ce("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),O3=ce("ul")({display:"inline-block"}),ZE=e=>{var p;const{className:t,emptyText:n,source:r,title:i,...s}=e,l=Ce.useRecordContext(e),A=ct.get(l,r),u=Ce.useTranslate();if(!A)return n?f.jsx(b.Typography,{component:"span",variant:"body2",className:t,...s,children:n&&u(n,{_:n})}):f.jsx(XE,{className:t,...s});if(Array.isArray(A))return f.jsx(O3,{className:t,...s,children:A.map((C,h)=>{var m;const E=i instanceof String?(m=ct.get(C,i))==null?void 0:m.toString():i;return f.jsx("li",{children:E},h)})});const g=i instanceof String?(p=ct.get(l,i))==null?void 0:p.toString():i;return f.jsx(XE,{className:t,...s,children:g})};ZE.propTypes={className:c.string,emptyText:c.string,source:c.string.isRequired,src:c.string,title:c.oneOfType([c.string,c.element]),target:c.string,download:c.oneOfType([c.bool,c.string]),ping:c.string,rel:c.string};var qE={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ln,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",l="second",A="minute",u="hour",g="day",p="week",C="month",h="quarter",E="year",m="date",B="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var J=["th","st","nd","rd"],H=_%100;return"["+_+(J[(H-20)%10]||J[H]||J[0])+"]"}},w=function(_,J,H){var K=String(_);return!K||K.length>=J?_:""+Array(J+1-K.length).join(H)+_},S={s:w,z:function(_){var J=-_.utcOffset(),H=Math.abs(J),K=Math.floor(H/60),L=H%60;return(J<=0?"+":"-")+w(K,2,"0")+":"+w(L,2,"0")},m:function _(J,H){if(J.date()<H.date())return-_(H,J);var K=12*(H.year()-J.year())+(H.month()-J.month()),L=J.clone().add(K,C),ee=H-L<0,U=J.clone().add(K+(ee?-1:1),C);return+(-(K+(H-L)/(ee?L-U:U-L))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:C,y:E,w:p,d:g,D:m,h:u,m:A,s:l,ms:s,Q:h}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},P="en",N={};N[P]=R;var F="$isDayjsObject",X=function(_){return _ instanceof le||!(!_||!_[F])},Z=function _(J,H,K){var L;if(!J)return P;if(typeof J=="string"){var ee=J.toLowerCase();N[ee]&&(L=ee),H&&(N[ee]=H,L=ee);var U=J.split("-");if(!L&&U.length>1)return _(U[0])}else{var q=J.name;N[q]=J,L=q}return!K&&L&&(P=L),L||!K&&P},G=function(_,J){if(X(_))return _.clone();var H=typeof J=="object"?J:{};return H.date=_,H.args=arguments,new le(H)},te=S;te.l=Z,te.i=X,te.w=function(_,J){return G(_,{locale:J.$L,utc:J.$u,x:J.$x,$offset:J.$offset})};var le=function(){function _(H){this.$L=Z(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[F]=!0}var J=_.prototype;return J.parse=function(H){this.$d=function(K){var L=K.date,ee=K.utc;if(L===null)return new Date(NaN);if(te.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var U=L.match(y);if(U){var q=U[2]-1||0,de=(U[7]||"0").substring(0,3);return ee?new Date(Date.UTC(U[1],q,U[3]||1,U[4]||0,U[5]||0,U[6]||0,de)):new Date(U[1],q,U[3]||1,U[4]||0,U[5]||0,U[6]||0,de)}}return new Date(L)}(H),this.init()},J.init=function(){var H=this.$d;this.$y=H.getFullYear(),this.$M=H.getMonth(),this.$D=H.getDate(),this.$W=H.getDay(),this.$H=H.getHours(),this.$m=H.getMinutes(),this.$s=H.getSeconds(),this.$ms=H.getMilliseconds()},J.$utils=function(){return te},J.isValid=function(){return this.$d.toString()!==B},J.isSame=function(H,K){var L=G(H);return this.startOf(K)<=L&&L<=this.endOf(K)},J.isAfter=function(H,K){return G(H)<this.startOf(K)},J.isBefore=function(H,K){return this.endOf(K)<G(H)},J.$g=function(H,K,L){return te.u(H)?this[K]:this.set(L,H)},J.unix=function(){return Math.floor(this.valueOf()/1e3)},J.valueOf=function(){return this.$d.getTime()},J.startOf=function(H,K){var L=this,ee=!!te.u(K)||K,U=te.p(H),q=function(he,Be){var we=te.w(L.$u?Date.UTC(L.$y,Be,he):new Date(L.$y,Be,he),L);return ee?we:we.endOf(g)},de=function(he,Be){return te.w(L.toDate()[he].apply(L.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(Be)),L)},fe=this.$W,Ae=this.$M,ue=this.$D,pe="set"+(this.$u?"UTC":"");switch(U){case E:return ee?q(1,0):q(31,11);case C:return ee?q(1,Ae):q(0,Ae+1);case p:var ve=this.$locale().weekStart||0,me=(fe<ve?fe+7:fe)-ve;return q(ee?ue-me:ue+(6-me),Ae);case g:case m:return de(pe+"Hours",0);case u:return de(pe+"Minutes",1);case A:return de(pe+"Seconds",2);case l:return de(pe+"Milliseconds",3);default:return this.clone()}},J.endOf=function(H){return this.startOf(H,!1)},J.$set=function(H,K){var L,ee=te.p(H),U="set"+(this.$u?"UTC":""),q=(L={},L[g]=U+"Date",L[m]=U+"Date",L[C]=U+"Month",L[E]=U+"FullYear",L[u]=U+"Hours",L[A]=U+"Minutes",L[l]=U+"Seconds",L[s]=U+"Milliseconds",L)[ee],de=ee===g?this.$D+(K-this.$W):K;if(ee===C||ee===E){var fe=this.clone().set(m,1);fe.$d[q](de),fe.init(),this.$d=fe.set(m,Math.min(this.$D,fe.daysInMonth())).$d}else q&&this.$d[q](de);return this.init(),this},J.set=function(H,K){return this.clone().$set(H,K)},J.get=function(H){return this[te.p(H)]()},J.add=function(H,K){var L,ee=this;H=Number(H);var U=te.p(K),q=function(Ae){var ue=G(ee);return te.w(ue.date(ue.date()+Math.round(Ae*H)),ee)};if(U===C)return this.set(C,this.$M+H);if(U===E)return this.set(E,this.$y+H);if(U===g)return q(1);if(U===p)return q(7);var de=(L={},L[A]=r,L[u]=i,L[l]=n,L)[U]||1,fe=this.$d.getTime()+H*de;return te.w(fe,this)},J.subtract=function(H,K){return this.add(-1*H,K)},J.format=function(H){var K=this,L=this.$locale();if(!this.isValid())return L.invalidDate||B;var ee=H||"YYYY-MM-DDTHH:mm:ssZ",U=te.z(this),q=this.$H,de=this.$m,fe=this.$M,Ae=L.weekdays,ue=L.months,pe=L.meridiem,ve=function(Be,we,ae,ze){return Be&&(Be[we]||Be(K,ee))||ae[we].slice(0,ze)},me=function(Be){return te.s(q%12||12,Be,"0")},he=pe||function(Be,we,ae){var ze=Be<12?"AM":"PM";return ae?ze.toLowerCase():ze};return ee.replace(O,function(Be,we){return we||function(ae){switch(ae){case"YY":return String(K.$y).slice(-2);case"YYYY":return te.s(K.$y,4,"0");case"M":return fe+1;case"MM":return te.s(fe+1,2,"0");case"MMM":return ve(L.monthsShort,fe,ue,3);case"MMMM":return ve(ue,fe);case"D":return K.$D;case"DD":return te.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return ve(L.weekdaysMin,K.$W,Ae,2);case"ddd":return ve(L.weekdaysShort,K.$W,Ae,3);case"dddd":return Ae[K.$W];case"H":return String(q);case"HH":return te.s(q,2,"0");case"h":return me(1);case"hh":return me(2);case"a":return he(q,de,!0);case"A":return he(q,de,!1);case"m":return String(de);case"mm":return te.s(de,2,"0");case"s":return String(K.$s);case"ss":return te.s(K.$s,2,"0");case"SSS":return te.s(K.$ms,3,"0");case"Z":return U}return null}(Be)||U.replace(":","")})},J.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},J.diff=function(H,K,L){var ee,U=this,q=te.p(K),de=G(H),fe=(de.utcOffset()-this.utcOffset())*r,Ae=this-de,ue=function(){return te.m(U,de)};switch(q){case E:ee=ue()/12;break;case C:ee=ue();break;case h:ee=ue()/3;break;case p:ee=(Ae-fe)/6048e5;break;case g:ee=(Ae-fe)/864e5;break;case u:ee=Ae/i;break;case A:ee=Ae/r;break;case l:ee=Ae/n;break;default:ee=Ae}return L?ee:te.a(ee)},J.daysInMonth=function(){return this.endOf(C).$D},J.$locale=function(){return N[this.$L]},J.locale=function(H,K){if(!H)return this.$L;var L=this.clone(),ee=Z(H,K,!0);return ee&&(L.$L=ee),L},J.clone=function(){return te.w(this.$d,this)},J.toDate=function(){return new Date(this.valueOf())},J.toJSON=function(){return this.isValid()?this.toISOString():null},J.toISOString=function(){return this.$d.toISOString()},J.toString=function(){return this.$d.toUTCString()},_}(),ie=le.prototype;return G.prototype=ie,[["$ms",s],["$s",l],["$m",A],["$H",u],["$W",g],["$M",C],["$y",E],["$D",m]].forEach(function(_){ie[_[1]]=function(J){return this.$g(J,_[0],_[1])}}),G.extend=function(_,J){return _.$i||(_(J,le,G),_.$i=!0),G},G.locale=Z,G.isDayjs=X,G.unix=function(_){return G(1e3*_)},G.en=N[P],G.Ls=N,G.p={},G})})(qE);var j3=qE.exports;const Rr=li(j3),md=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...i})=>{const[s,l]=x.useState(null),A=j.useRecordContext(i),u=j.useDataProvider(),g=j.useResourceContext(),p=x.useCallback(async E=>{E.preventDefault(),E.stopPropagation();const m=ct.get(A,i==null?void 0:i.source),B=g.replace("entities/",""),y=await u.getFile(`/attachments/${B}/${e||(A==null?void 0:A.id)}/${t||(i==null?void 0:i.source)}/${(m==null?void 0:m.id)||(A==null?void 0:A.id)}`),O=document.createElement("a");O.href=y,O.download=ct.get(A,(i==null?void 0:i.title)||(i==null?void 0:i.source)),O.click()},[u,A,e,g,t,i==null?void 0:i.source,i==null?void 0:i.title]),C=x.useMemo(()=>({...A,[i==null?void 0:i.source]:(A==null?void 0:A.src)||ct.get(A,i==null?void 0:i.source),[i==null?void 0:i.title]:(A==null?void 0:A.title)||ct.get(A,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),[A,i==null?void 0:i.source,i==null?void 0:i.title]),h=j.useTranslate();return x.useEffect(()=>{!A||!(A!=null&&A.userId)||u.getOne(r,{id:A==null?void 0:A.userId}).then(({data:E})=>l(E)).catch(()=>l(null))},[A,u,r]),f.jsx(ZE,{...i,disabled:n,record:C,onClick:p,title:f.jsxs(b.Box,{sx:{cursor:"pointer"},children:[f.jsx(b.Typography,{variant:"subtitle1",children:ct.get(C,(i==null?void 0:i.title)||(i==null?void 0:i.source))}),f.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[ct.get(C,"sizeDescription"),s&&" | ",s&&h("ra.attachment.info",{user:s==null?void 0:s.name,created:Rr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};md.propTypes={...j.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const M3=ce(j.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),Us=e=>{const t=`_${e==null?void 0:e.source}`;return f.jsx(M3,{...e,source:t})};Us.propTypes={...j.ImageField.propTypes,source:c.string};const Hl=({width:e,height:t,circle:n,justify:r,record:i,...s})=>{const l=x.useMemo(()=>({width:typeof e=="number"?`${e}px !important`:`${e} !important`,height:typeof t=="number"?`${t}px !important`:`${t} !important`,borderRadius:n?"50%":1.5}),[e,t,n]),A=j.useRecordContext(),u=i||A;return f.jsx(Us,{sx:g=>({margin:0,display:"flex",justifyContent:r,"& img":{margin:"0px !important",border:`1px solid ${g.palette.divider}`,objectFit:"cover !important",...l,minWidth:l.width,minHeight:l.height}}),...s,record:u})};Hl.defaultProps={...Us.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"},Hl.propTypes={...Us.propTypes,width:c.oneOfType([c.number,c.string]),height:c.oneOfType([c.number,c.string]),circle:c.bool,justify:c.oneOf(["flex-start","center","flex-end"])};var _E={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ln,function(){return function(n,r,i){n=n||{};var s=r.prototype,l={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function A(g,p,C,h){return s.fromToBase(g,p,C,h)}i.en.relativeTime=l,s.fromToBase=function(g,p,C,h,E){for(var m,B,y,O=C.$locale().relativeTime||l,R=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],w=R.length,S=0;S<w;S+=1){var P=R[S];P.d&&(m=h?i(g).diff(C,P.d,!0):C.diff(g,P.d,!0));var N=(n.rounding||Math.round)(Math.abs(m));if(y=m>0,N<=P.r||!P.r){N<=1&&S>0&&(P=R[S-1]);var F=O[P.l];E&&(N=E(""+N)),B=typeof F=="string"?F.replace("%d",N):F(N,p,P.l,y);break}}if(p)return B;var X=y?O.future:O.past;return typeof X=="function"?X(B):X.replace("%s",B)},s.to=function(g,p){return A(g,p,this,!0)},s.from=function(g,p){return A(g,p,this)};var u=function(g){return g.$u?i.utc():i()};s.toNow=function(g){return this.to(u(this),g)},s.fromNow=function(g){return this.from(u(this),g)}}})})(_E);var D3=_E.exports;const R3=li(D3);Rr.extend(R3);const Wl=e=>{const t=j.useRecordContext(e),[n]=j.useLocaleState(),r=x.useMemo(()=>Rr(ct.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return f.jsxs(x.Fragment,{children:[f.jsx(j.DateField,{record:t,source:e.source,showTime:!0}),f.jsx("br",{}),f.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Wl.displayName="DateAgoField",Wl.propTypes={source:c.string.isRequired};const $E=ce(j.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));$E.propTypes={...j.DateField.propTypes};const Bd=e=>f.jsx($E,{...e});Bd.defaultProps={...j.DateField.defaultProps,variant:"body1"},Bd.propTypes={...j.DateField.propTypes};const em=ce(j.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));em.propTypes={...j.EmailField.propTypes};const vd=e=>f.jsx(em,{...e});vd.defaultProps={...j.EmailField.defaultProps,variant:"body1"},vd.propTypes={...j.EmailField.propTypes};const k3=ce(j.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),yd=({...e})=>{const t=j.useRecordContext(e),n=x.useCallback(r=>{r.preventDefault(),r.stopPropagation();const i=ct.get(t,`_${e==null?void 0:e.source}`,ct.get(t,e==null?void 0:e.source)),s=ct.get(t,(e==null?void 0:e.title)||(e==null?void 0:e.source))||(e==null?void 0:e.title),l=document.createElement("a");l.href=i,l.download=s,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return f.jsx(k3,{...e,record:t,onClick:n})};yd.propTypes={...j.FileField.propTypes,source:c.string,title:c.string};const tm=e=>f.jsx(j.FunctionField,{...e});tm.defaultProps={variant:"body1"};const F3=ce("div")(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`,paddingTop:e.spacing(1),paddingBottom:e.spacing(1),marginBottom:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",[e.breakpoints.down("sm")]:{whiteSpace:"normal",overflow:"visible",textOverflow:"inherit"}})),bd=({source:e,defaultValue:t,...n})=>{const r=j.useRecordContext(n),i=ct.get(r,e,t);return f.jsx("span",{dangerouslySetInnerHTML:{__html:i&&i!==null?i:t}})};bd.propTypes={defaultValue:c.any,source:c.string,record:c.object},bd.defaultProps={defaultValue:" "};const nm=({title:e,children:t})=>e&&e!==!1?f.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;nm.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const Qd=({label:e,source:t,defaultValue:n,children:r,tooltip:i,...s})=>{const{getCurrentDialog:l}=Po(),A=j.useRecordContext(s),u=j.useResourceContext(s),g=l(),p=x.useMemo(()=>!i||i===!1?!1:typeof i=="function"?i(A):typeof i=="string"?ct.get(A,i,i):i,[A,i]);return f.jsx(nm,{title:p,children:f.jsxs(x.Fragment,{children:[f.jsx(b.InputLabel,{children:f.jsx(j.FieldTitle,{label:e,source:t,resource:g||u})}),f.jsx(F3,{...s,children:x.cloneElement(r,{source:t,record:A,defaultValue:n,resource:g||u})})]})})};Qd.propTypes={defaultValue:c.any,tooltip:c.oneOfType([c.string,c.bool,c.func]),source:c.string,label:c.string,name:c.string,children:c.element},Qd.defaultProps={defaultValue:" ",children:f.jsx(bd,{})};const L3=ys("div",{name:"RaApplicaReferenceManyField",slot:"root"})(({theme:e,margin:t,border:n})=>({marginLeft:t?0:`-${e.spacing(2.5)}`,marginRight:t?0:`-${e.spacing(2.5)}`,borderBottom:n?`1px solid ${e.palette.divider}`:"none","& form":{padding:e.spacing(2)},"& .MuiCardContent-root":{borderTop:n?`1px solid ${e.palette.divider}`:"none"},"& .MuiToolbar-root":{[e.breakpoints.up("sm")]:{marginTop:`-${e.spacing(2)}`,marginBottom:e.spacing(t?0:1),marginLeft:e.spacing(t?1:2),marginRight:e.spacing(t?1:2),width:t?"auto":`calc(100% - ${e.spacing(5)})`},[e.breakpoints.down("md")]:{marginTop:0}},"& .RaDatagrid-root":{overflowX:"auto",paddingTop:48,[e.breakpoints.down("sm")]:{width:"calc(100vw - 34px)"}},"& .RaDatagrid-table":{borderBottom:`1px solid ${e.palette.divider}`},"& .MuiTablePagination-toolbar":{marginTop:e.spacing(1),marginBottom:0},"& .RaBulkActionsToolbar-collapsed.RaBulkActionsToolbar-toolbar":{minHeight:0},"& .RaBulkActionsToolbar-toolbar":{minHeight:48,bottom:-56,"& h6":{marginTop:e.spacing(.5)},"& .RaBulkActionsToolbar-topToolbar":{marginTop:e.spacing(1)},[e.breakpoints.down("sm")]:{bottom:-48,borderRadius:0}}})),Oi=e=>f.jsx(L3,{children:f.jsx(j.ReferenceManyField,{pagination:f.jsx(j.Pagination,{}),...e})});Oi.defaultProps={...j.ReferenceManyField.defaultProps,margin:!1,border:!1},Oi.propTypes={...j.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const rm=({source:e,...t})=>{const n=j.useRecordContext(t),r=ct.get(n,e,0),i=r/1024,s=i/1024,l=s/1024,A=l>1?`${l.toFixed(2)} GB`:s>1?`${s.toFixed(2)} MB`:i>1?`${i.toFixed(2)} KB`:`${r.toFixed(2)} B`;return f.jsx(b.Typography,{component:"span",variant:"body1",...t,children:A})};rm.propTypes={record:c.object,source:c.string};const om=ce(j.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));om.propTypes={...j.TextField.propTypes};const xd=e=>f.jsx(om,{...e});xd.defaultProps={...j.TextField.defaultProps,variant:"body1"},xd.propTypes={...j.TextField.propTypes};const at=({label:e,children:t,display:n,helperText:r,sx:i,addLabel:s,divider:l,...A})=>{const u=Kt.useTheme(),{getCurrentDialog:g}=Po(),{source:p,resource:C,isRequired:h}=A,{fieldState:{invalid:E}}=j.useInput(A),m=g();return f.jsxs(b.Stack,{spacing:1,sx:{width:A!=null&&A.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:E?u.palette.error.main:u.palette.text.secondary,"& span":{display:"none"}},...i},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:E===!0,sx:{borderBottom:l?`1px solid ${u.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(j.FieldTitle,{label:e,source:p,resource:m||C,isRequired:h})}),x.isValidElement(t)?x.cloneElement(t,{...t.props,...A,label:n==="legend"?e:!1}):t,n==="label"&&r&&f.jsx(b.FormHelperText,{sx:{pl:1.8,pb:2,marginTop:"0 !important"},error:E===!0,children:r})]})};at.propTypes={sx:c.object,children:c.element,label:c.oneOfType([c.string,c.bool]),addLabel:c.bool,resource:c.string,isRequired:c.bool,source:c.string,display:c.oneOf(["legend","label"]),helperText:c.oneOfType([c.string,c.bool]),divider:c.bool},at.defaultProps={display:"label",divider:!1};const N3=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},V3=ce(j.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({disabled:e,theme:t})=>({"& .previews":{},"& .previews>div":{marginTop:t.spacing(1),padding:t.spacing(1.5),border:`1px solid ${t.palette.divider}`,borderRadius:t.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:t.palette.action.hover},"& .MuiLink-root":{fontSize:t.typography.body1.fontSize}},...N3(e)})),wd=({children:e,disabled:t,type:n,...r})=>{const i=j.useRecordContext(r),s=r==null?void 0:r.source,l=i==null?void 0:i.id;return j.useInput({source:`__${n}__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),f.jsx(at,{...r,children:f.jsx(V3,{disabled:t,children:x.cloneElement(e,{...e.props,entityId:l,property:s})})})};wd.propTypes={...j.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool},wd.defaultProps={children:f.jsx(md,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const H3=ce(j.AutocompleteArrayInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"}})),Td=({...e})=>f.jsx(at,{...e,children:f.jsx(H3,{})});Td.propTypes={...j.AutocompleteArrayInput.propTypes,...at.propTypes},Td.defaultProps={...j.AutocompleteArrayInput.defaultProps,size:"small"};const W3=ce(j.AutocompleteInput,{name:"StyledAutocompleteInput",root:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{minHeight:"18px"},"& .MuiAutocomplete-inputRoot":{padding:"0px 9px"},"& .MuiOutlinedInput-root.MuiInputBase-sizeSmall":{paddingTop:"4px"}})),Pd=e=>{const{perPage:t,...n}=e;return f.jsx(at,{...n,children:f.jsx(W3,{})})};Pd.propTypes={...j.AutocompleteInput.propTypes,...at.propTypes},Pd.defaultProps={...j.AutocompleteInput.defaultProps,size:"small"};const z3=ce(j.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),Sd=({horizontal:e,...t})=>{const n=xt();return f.jsx(at,{...t,sx:e?{flexDirection:e?"row":"column",alignItems:e?"center":"flex-start","& .MuiFormGroup-root":{margin:0},"& .MuiFormControlLabel-root":{margin:0,"& .MuiTypography-root":{display:"none",visibility:"hidden"},"& .MuiSwitch-root":{marginRight:`-${n.spacing(.5)}`}}}:{},children:f.jsx(z3,{})})};Sd.defaultProps={...j.BooleanInput.defaultProps,...at.defaultProps},Sd.propTypes={...j.BooleanInput.propTypes,...at.propTypes,horizontal:c.bool};const U3=ce(j.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Od=e=>f.jsx(at,{...e,children:f.jsx(U3,{})});Od.propTypes={...j.DateInput.propTypes,...at.propTypes},Od.defaultProps={...j.DateInput.defaultProps,...at.defaultProps};const Y3=ce(j.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),jd=e=>f.jsx(at,{...e,children:f.jsx(Y3,{})});jd.propTypes={...j.DateTimeInput.propTypes,...at.propTypes},jd.defaultProps={...at.defaultProps};const G3=ce(j.FileInput,{name:"RaApplicaFileInput",slot:"root"})(({theme:e})=>({"& .previews":{},"& .previews>div":{marginTop:e.spacing(1),padding:e.spacing(1.5),border:`1px solid ${e.palette.divider}`,borderRadius:e.shape.borderRadius,"& button":{float:"right",placeItems:"flex-end",verticalAlign:"middle"},"&:hover":{backgroundColor:e.palette.action.hover},"& .MuiLink-root":{fontSize:e.typography.body1.fontSize}}})),Md=({children:e,title:t,...n})=>{const r=Cs.useWatch({name:n.source}),i=j.useRecordContext(n),{source:s}=n,l=x.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const A=ct.get(i,s);if(A){const u=A.split("__");return u.length>0?u[u.length-1]:A}return A},[i,s,r]);return f.jsx(at,{...n,children:f.jsx(G3,{children:x.cloneElement(e,{...e.props,title:t||s,source:s,record:{...i,[s]:(r==null?void 0:r.title)||ct.get(i,s),[`_${s}`]:(r==null?void 0:r.src)||ct.get(i,`_${s}`),[t||s]:l}})})})};Md.propTypes={...j.FileInput.propTypes,source:c.string,title:c.string,children:c.node},Md.defaultProps={children:f.jsx(yd,{})};const Dd=({children:e,title:t,...n})=>{const r=Cs.useWatch({name:n.source}),i=j.useRecordContext(n),{source:s}=n;return j.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),f.jsx(at,{...n,children:f.jsx(j.ImageInput,{accept:"image/*",children:x.cloneElement(e,{...e.props,title:t,source:s,record:{...i,[s]:(r==null?void 0:r.title)||ct.get(i,s),[`_${s}`]:(r==null?void 0:r.src)||ct.get(i,`_${s}`)}})})})};Dd.defaultProps={children:f.jsx(Hl,{}),multiple:!1},Dd.propTypes={...j.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const K3=ce(j.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Rd=e=>f.jsx(at,{...e,children:f.jsx(K3,{})});Rd.propTypes={...j.NumberInput.propTypes,...at.propTypes},Rd.defaultProps={...j.NumberInput.defaultProps,...at.defaultProps};const im=({source:e,minWidth:t=300,children:n})=>{const r=j.useResourceContext(),i=j.useRecordContext(),[s,l]=x.useState(ct.get(i,e,"")),[A,u]=x.useState(!1),g=x.useCallback(m=>l(m.target.value),[]),p=j.useDataProvider(),C=x.useCallback(m=>{m.key==="Enter"&&(u(!0),p.update(r,{id:i.id,data:{...i,[e]:s,_changed:e}}).then(()=>u(!1)))},[s,p,r,i,e]),h=x.useCallback(()=>{ct.get(i,e)!==s&&(u(!0),p.update(r,{id:i.id,data:{...i,[e]:s,_changed:e}}).then(()=>u(!1)))},[s,p,r,e,i]),E=x.useCallback(m=>{u(!0),p.update(r,{id:i.id,data:{...i,[e]:m,_changed:e}}).then(()=>u(!1))},[p,r,e,i]);return x.useEffect(()=>l(ct.get(i,e)),[i,e]),n?x.cloneElement(n,{...n.props,source:e,value:s,onChange:E}):f.jsx(b.TextField,{value:s,disabled:A,onChange:g,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};im.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const kd=({children:e,...t})=>f.jsx(j.ReferenceArrayInput,{...t,children:x.cloneElement(e,{...t,source:e.props.source||t.source})});kd.propTypes={...j.ReferenceArrayInput.propTypes,children:c.element},kd.defaultProps={...j.ReferenceArrayInput.defaultProps};const Fd=({children:e,...t})=>f.jsx(j.ReferenceInput,{...t,children:x.cloneElement(e,{...t,source:e.props.source||t.source})});Fd.propTypes={...j.ReferenceInput.propTypes,children:c.element},Fd.defaultProps={...j.ReferenceInput.defaultProps};const Ld=({reference:e,target:t,children:n,filters:r,actions:i,...s})=>f.jsx(j.ResourceContextProvider,{value:e,children:f.jsx(Oi,{perPage:5,pagination:f.jsx(j.Pagination,{}),...s,reference:e,target:t,children:f.jsxs(x.Fragment,{children:[f.jsx(j.ListToolbar,{filters:r,actions:i}),n]})})});Ld.propTypes={...Oi.propTypes,children:c.node.isRequired,reference:c.string.isRequired,target:c.string.isRequired,filters:c.oneOfType([c.element,c.func,c.element,c.arrayOf(c.node)]),actions:c.oneOfType([c.element,c.func,c.element])},Ld.defaultProps={...Oi.defaultProps};const J3=ce(j.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),X3=e=>f.jsx(J3,{...e}),sm=ce(j.SelectArrayInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},"& .RaSelectArrayInput-chips > .RaSelectArrayInput-chip":{marginTop:"-2px",marginBottom:"-2px"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}}));sm.propTypes={...j.SelectArrayInput.propTypes};const Nd=e=>f.jsx(at,{...e,children:f.jsx(sm,{options:{autoWidth:!1}})});Nd.defaultProps={optionText:"name",optionValue:"id"},Nd.propTypes={...j.SelectArrayInput.propTypes,...at.propTypes};const Z3=ce(j.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),am=e=>f.jsx(at,{...e,children:f.jsx(Z3,{})});am.propTypes={...j.SelectInput.propTypes,...at.propTypes};const Hn=e=>f.jsx(at,{...e,children:f.jsx(j.TextInput,{})});Hn.propTypes={...j.TextInput.propTypes,...at.propTypes};const zl=({...e})=>{var A,u;const t=j.useTranslate(),n=j.maxLength(e==null?void 0:e.maxLength,"app.input.max_length_error"),r=(u=(A=Cs.useController({name:e==null?void 0:e.source}))==null?void 0:A.field)==null?void 0:u.value;let i=e.helperText,s=e.validate;s?Array.isArray(s)&&s.indexOf(n)===-1&&s.push(n):s=[n];const l=t("app.input.max_length_info",{count:(r==null?void 0:r.length)||0,max:e==null?void 0:e.maxLength});return e!=null&&e.maxLength&&(i=i&&i.length>0?`${l} - ${t(i)}`:l),f.jsx(Hn,{...e,validate:s,helperText:i,inputProps:{maxLength:e==null?void 0:e.maxLength}})};zl.displayName="SmartTextInput",zl.defaultProps={multiline:!1},zl.propTypes={...Hn.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const lm=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return Rr().hour(n).minute(r)};function q3(){let e=new Date().getTime();return window.performance&&typeof window.performance.now=="function"&&(e+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const r=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(n=="x"?r:r&3|8).toString(16)})}const _3=e=>{if(!e)return"";const t=lm(e);return t?t.format("HH:mm"):""},$3=e=>e,ej=ce(j.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Vd=e=>f.jsx(at,{...e,children:f.jsx(ej,{})});Vd.defaultProps={...j.TimeInput.defaultProps,format:_3,parse:$3},Vd.propTypes={...j.TimeInput.propTypes,...at.propTypes};const Hd=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=Qn(),[r,i]=x.useState(!1),s=Ce.useAuthProvider(),l=Ce.useTranslate(),A=Ce.useNotify(),u=x.useCallback(g=>{const{oldPassword:p,newPassword:C}=g;i(!0),s==null||s.changePassword(p,C).then(()=>{A("ra.auth.password_changed"),e()}).catch(h=>A(h,{type:"error"})).finally(()=>i(!1))},[s,e]);return f.jsx(Ce.ResourceContextProvider,{value:"user/change-password",children:f.jsx(Ce.EditContextProvider,{value:{record:{},resource:"user/change-password",save:u},children:f.jsx(Nl,{onSubmit:u,toolbar:f.jsx(Dr,{children:f.jsx(j.SaveButton,{disabled:r})}),children:f.jsxs(b.Grid,{container:!0,spacing:n,children:[t===!0&&f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.Alert,{severity:"warning",children:[f.jsx(b.AlertTitle,{children:l("ra.auth.first_access.change_password")}),l("ra.auth.first_access.change_password_helper")]})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(Hn,{source:"oldPassword",type:"password",validate:Ce.required()})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(Hn,{source:"newPassword",type:"password",validate:Ce.required()})})]})})})})},tj=ce(j.Edit,{name:"RaApplicaEdit",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaEdit-card":{[e.breakpoints.down("sm")]:{marginBottom:e.spacing(6)}},"& .RaEdi-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaToolbar-mobileToolbar":{borderTop:`1px solid ${e.palette.divider}`},"& .RaEdit-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),nj=ce(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),rj=ce(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),Wd=({title:e,divider:t,variant:n})=>{const r=j.useTranslate();return f.jsxs(x.Fragment,{children:[f.jsx(nj,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&f.jsx(rj,{})]})};Wd.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])},Wd.defaultProps={divider:!0,variant:"h4"};const oj=ce(b.Grid,{name:"ApplicaLongFormView",slot:"Root"})(({theme:e})=>({"& .MuiToolbar-root":{position:"initial",marginTop:e.spacing(2),marginLeft:`-${e.spacing(3)}`,marginRight:`-${e.spacing(3)}`,marginBottom:`-${e.spacing(2)}`,borderTop:`1px solid ${e.palette.divider}`,[e.breakpoints.down("sm")]:{position:"initial !important",width:"auto !important"}},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}}));function cm(e){const{spacing:t}=Qn(),{spacing:n=t}=e,r=Ie.omit(e,["spacing"]);return f.jsx(j.Form,{...r,children:f.jsx(oj,{container:!0,spacing:n*2,children:e.children})})}function zd(e){return e.id??e.label}function Am(e,t){const n=`^${e}.`.replaceAll(".","\\."),r=new RegExp(n,"g");return t.match(r)!==null}function ij(e){return Ie.map(e,"id")}function Ul(e){const t=e.match(new RegExp("[^.]+","g"));return t===null?0:t.length}function um(e,t){const n=e!==void 0?Ul(e):0;return Ie.chain(t).filter(i=>e!==void 0?Am(e,i.id):!0).filter(i=>Ul(i.id)===n+1).value()}function sj(e,t){var s;const n=Ie.clone(e),{type:r,payload:i}=t;switch(r){case"setFormRootPath":return Ie.extend(n,{formRootPath:i});case"setSyncWithLocation":return Ie.extend(n,{syncWithLocation:i});case"setActiveItem":return Ie.includes(ij(e.items),i)?Ie.extend(n,{activeItem:i}):n;case"addItem":{const l=i.id,A=Ie.chain(n.items).clone().reject(u=>u.id===l).concat([i]).orderBy(u=>u.index).value();return Ie.extend(n,{items:A}),n.activeItem===void 0&&Ie.extend(n,{activeItem:i.id}),n}case"removeItem":{const l=Ie.isString(i)?i:i.id,A=Ie.chain(n.items).clone().reject(u=>u.id===l).value();return Ie.extend(n,{items:A}),n.activeItem===l&&Ie.extend(n,{activeItem:((s=Ie.first(A))==null?void 0:s.id)??void 0}),n}default:return n}}const aj={syncWithLocation:!0,items:[],activeItem:void 0},dm=x.createContext(void 0);function gm(e){const t=!!(e.syncWithLocation??!0),{rootMatchString:n}=e,{pathname:r}=hs.useLocation(),[i,s]=x.useReducer(sj,Ie.cloneDeep(aj)),{formRootPath:l,items:A}=i,u=x.useMemo(()=>({state:i,dispatch:s}),[i,s]);return x.useEffect(()=>{const g=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/show/*",":resource/:id/show/*","entities/:resource/:id/*",":resource/:id/*"];n!==void 0&&g.push(n);const p=Ie.chain(g).map(h=>hs.matchPath(h,r)).reject(h=>h===null).first().value(),C=p==null?void 0:p.pathnameBase;C!==void 0&&C!==l&&s({type:"setFormRootPath",payload:C})},[r,l,n]),x.useEffect(()=>{s({type:"setSyncWithLocation",payload:!!t})},[t,s]),x.useEffect(()=>{var g;if(t&&l!==void 0){let p=r.replace(l,"").replace(new RegExp(/^\/?/),"");Ie.isEmpty(p)&&(p=((g=Ie.chain(A).filter(C=>um(C.id,A).length===0).orderBy([C=>Ul(C.id),C=>C.index]).first().value())==null?void 0:g.id)??void 0),s({type:"setActiveItem",payload:p})}},[s,l,r,A]),f.jsx(dm.Provider,{value:u,children:e.children})}function fm(){const e=x.useContext(dm);if(e===void 0)throw new Error("[LongForm] useFormContext: context undefined. Please provide a valid Context using LongForm.Provider");return e}function Yl(){return fm().state}function Ud(){return fm().dispatch}function pm(){return Yl().formRootPath}function hm(){return Yl().activeItem}function Cm(){return Yl().items}function Im(){return Yl().syncWithLocation}function Em(){const e=Ud();return x.useCallback(n=>{e({type:"setActiveItem",payload:n})},[e])}function mm(){const e=Ud();return x.useCallback(n=>{e({type:"addItem",payload:n})},[e])}function Bm(){const e=Ud();return x.useCallback(n=>{e({type:"removeItem",payload:n})},[e])}var lj=e=>{let t=e;for(;t=t.parentElement;){const n=getComputedStyle(t,null).getPropertyValue("overflow-y");if(t===document.body)return window;if(n==="auto"||n==="scroll"||n==="overlay")return t}return window},vm=e=>e.firstChild?e.firstChild.offsetParent===e:!0,cj=(e,t)=>{let n=e,r=0;vm(t)||(r+=e.offsetTop-t.offsetTop,t=e.offsetParent,r+=-e.offsetTop);do r+=n.offsetTop,n=n.offsetParent;while(n&&n!==t);return r},Aj=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},Ys=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?Ys="sticky":CSS.supports("position","-webkit-sticky")&&(Ys="-webkit-sticky"));var Gl=!1;try{const e=Object.defineProperty({},"passive",{get(){Gl={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var Yd=e=>{const{el:t,onChange:n,unsubs:r,measure:i}=e;if(t===window){const s=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=i(s()),A=()=>{Object.assign(l,i(s())),n()};return window.addEventListener("resize",A,Gl),r.push(()=>window.removeEventListener("resize",A)),l}else{const s=i(t.getBoundingClientRect()),l=()=>{Object.assign(s,i(t.getBoundingClientRect())),n()},A=new ResizeObserver(l);return A.observe(t),r.push(()=>A.disconnect()),s}},uj=e=>{const t=getComputedStyle(e,null),n=parseInt(t.getPropertyValue("padding-top"),10),r=parseInt(t.getPropertyValue("padding-bottom"),10);return{top:n,bottom:r}},dj=(e,t,n)=>{const{bottom:r,offsetBottom:i,offsetTop:s}=n,l=lj(e);let A=!1;const u=()=>{A||requestAnimationFrame(()=>{const F=C();F!==w&&S(F),A=!1}),A=!0};let g=l===window?window.scrollY:l.scrollTop;const p=F=>{const{offsetTop:X,height:Z}=E,{naturalTop:G}=y,{height:te}=O;return F+X+Z>=G+te+R+i},C=()=>{const{height:F}=E,{height:X}=O;return X+s+i<=F?3:p(g)?1:2},h=l!==window&&vm(l),E=Yd({el:l,onChange:u,unsubs:t,measure:({height:F,top:X})=>({height:F,offsetTop:h?X:0})}),m=Aj(e),B=m===window?{top:0,bottom:0}:uj(m),y=Yd({el:m,onChange:u,unsubs:t,measure:({height:F})=>({height:F-B.top-B.bottom,naturalTop:m===window?0:cj(m,l)+B.top+E.offsetTop})}),O=Yd({el:e,onChange:u,unsubs:t,measure:({height:F})=>({height:F})});let R=0,w=C();const S=F=>{const X=w;if(w=F,X===2&&(R=-1),F===3){e.style.position=Ys,r?e.style.bottom=`${i}px`:e.style.top=`${s}px`;return}const{height:Z,offsetTop:G}=E,{height:te,naturalTop:le}=y,{height:ie}=O;if(F===2)if(e.style.position="relative",R=X===0?Math.max(0,G+g-le+s):Math.max(0,G+g+Z-(le+ie+i)),r){const _=Math.max(0,te-ie-R);e.style.bottom=`${_}px`}else e.style.top=`${R}px`;else e.style.position=Ys,F===1?r?e.style.bottom=`${i}px`:e.style.top=`${Z-ie-i}px`:r?e.style.bottom=`${Z-ie-i}px`:e.style.top=`${s}px`};S(w);const P=F=>{if(F===g)return;const X=F-g;if(g=F,w===3)return;const{offsetTop:Z,height:G}=E,{naturalTop:te,height:le}=y,{height:ie}=O;if(X>0)if(w===0){if(F+Z+s>te){const _=Math.max(0,Z+g-te+s);F+Z+G<=te+ie+_+i?S(2):S(1)}}else w===2&&p(F)&&S(1);else if(w===1){if(Z+F+G<te+le+i){const _=Math.max(0,Z+g+G-(te+ie+i));Z+F+s>=te+_?S(2):S(0)}}else w===2&&Z+F+s<te+R&&S(0)},N=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",N,Gl),l.addEventListener("mousewheel",N,Gl),t.push(()=>l.removeEventListener("scroll",N),()=>l.removeEventListener("mousewheel",N))},gj=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,i]=x.useState(null);return x.useEffect(()=>{if(!r||!Ys)return;const s=[];return dj(r,s,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{s.forEach(l=>l())}},[r,t,e,n]),i},fj=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:i,className:s,style:l}=e,A=gj({offsetTop:t,offsetBottom:n,bottom:r});return f.jsx("div",{className:s,style:l,ref:A,children:i})},pj=fj,ym=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(ym||{});function bm(e){const{sticky:t=!0,disposition:n={xl:3,lg:3,md:4,sm:4,xs:12},spacing:r=2}=e,i=Ie.omit(e,["sticky","disposition","spacing"]),s=t?pj:b.Box,l=x.useMemo(()=>t?{offsetTop:74,offsetBottom:r*2}:{},[t,r]);return f.jsx(b.Grid,{...i,item:!0,...n,children:f.jsx(s,{...l,children:f.jsx(b.Stack,{spacing:r,children:e.children})})})}function Qm(e){return f.jsx(f.Fragment,{children:e.children})}function xm(e){const{children:t}=e;return x.useMemo(()=>{const r={top:[],bottom:[]};return x.Children.forEach(t,i=>{if(x.isValidElement(i)&&(i==null?void 0:i.type)===Qm){const{position:s}=i.props;switch(s){case"top":r.top.push(i);break;case"bottom":r.bottom.push(i);break}}}),r},[t])}function wm(e){const{disposition:t={xl:9,lg:9,md:8,sm:8,xs:12}}=e,n=Ie.omit(e,["disposition"]);return f.jsx(b.Grid,{...n,item:!0,...t,children:e.children})}function Tm(e){const t=hm();return e===t||Am(e,t??"")}function Pm(e){const t=Cm();return x.useMemo(()=>um(e,t),[t,e])}function hj(){const e=pm(),t=hs.useNavigate();return x.useCallback(r=>{t(`${e}/${r}`)},[e,t])}function Sm(){const e=Pm();return f.jsx(b.Card,{variant:"outlined",children:f.jsx(b.List,{sx:{"& .MuiListItemButton-root.Mui-selected":{borderColor:"palette.primary.main",borderRightStyle:"solid",borderRightWidth:2},"& .MuiListItemAvatar-root":{minWidth:24}},children:Ie.map(e,(t,n)=>f.jsx(Gd,{...t},n))})})}function Gd(e){const t=Ce.useTranslate()??Ie.identity,n=Om(e),{selected:r,label:i,icon:s,onClick:l,badge:A,items:u,isGroup:g,level:p}=n,{spacing:C}=Qn(),[h,E]=x.useState(r),m=x.useCallback(O=>{E(!h),l(O)},[l,h]),B=s!==void 0,y=Ie.omit(e,["label","icon","selected","badge"]);return f.jsxs(f.Fragment,{children:[f.jsx(b.ListItem,{...y,disablePadding:!0,children:f.jsxs(b.ListItemButton,{selected:r&&!g,onClick:m,sx:{pl:C*p},children:[B&&f.jsx(b.ListItemIcon,{children:s}),f.jsx(b.ListItemText,{inset:!B,primary:t(i)}),A&&f.jsx(b.ListItemAvatar,{children:f.jsx(Ws,{type:"filled",size:"xs",color:A.color??"default",children:A.content})}),g&&(h?f.jsx(dn.ExpandLess,{}):f.jsx(dn.ExpandMore,{}))]})}),g&&f.jsx(b.Collapse,{in:h,timeout:"auto",children:f.jsx(b.List,{children:Ie.map(u,(O,R)=>f.jsx(Gd,{...O},R))})})]})}function Om(e){const{id:t}=e,n=Tm(t),r=Ul(t),i=hj(),s=Im(),l=Em(),A=Pm(t),u=!Ie.isEmpty(A),g=x.useCallback(C=>{u||(s?i(e.id):l(e.id)),Ie.isFunction(e.onClick)&&e.onClick(C)},[l,i,e,s,u]);return x.useMemo(()=>({...e,selected:n,onClick:g,items:A,isGroup:u,level:r}),[e,n,g,A,u])}function jm(e){const{label:t,icon:n,badge:r,index:i=0}=e,s=zd(e),l=mm(),A=Bm(),u=Tm(s);return x.useEffect(()=>(l({id:s,index:i,label:t,icon:n,badge:r}),()=>{A(s)}),[l,A,t,n,s,r,i]),f.jsx(b.Box,{display:u?"unset":"none",children:e.children})}function Mm(e){const t=Kd(e),n=zd(e);return f.jsx(jm,{...e,id:n,children:x.Children.map(t,r=>{const i=zd(r.props);return x.cloneElement(r,{id:`${n}.${i}`})})})}function Dm(e){return f.jsx(jm,{...e})}function Kd(e){const{children:t}=e;return x.useMemo(()=>Ie.chain(x.Children.toArray(t)).filter(r=>x.isValidElement(r)&&((r==null?void 0:r.type)===Dm||(r==null?void 0:r.type)===Mm)).map((r,i)=>x.cloneElement(r,{index:i})).value(),[t])}function Cj(e){const{tabsDisposition:t,contentDisposition:n,spacing:r=2}=e,i=Ie.pick(e,["syncWithLocation"]),s=Ie.omit(e,["tabsDisposition","contentDisposition","syncWithLocation"]),{top:l,bottom:A}=xm(e),u=Kd(e);return f.jsx(gm,{...i,children:f.jsxs(cm,{...s,spacing:r,children:[f.jsxs(bm,{disposition:t,spacing:r,children:[l,f.jsx(Sm,{}),A]}),f.jsx(wm,{disposition:n,children:u})]})})}const Dt=Cj;Dt.BaseForm=cm,Dt.Content=wm,Dt.Provider=gm,Dt.useItems=Cm,Dt.useSyncWithLocation=Im,Dt.useFormRootPath=pm,Dt.useActiveItem=hm,Dt.useSetActiveItem=Em,Dt.useAddItem=mm,Dt.useRemoveItem=Bm,Dt.Sidebar=bm,Dt.SidebarSection=Qm,Dt.SidebarSectionPosition=ym,Dt.useSidebarChildren=xm,Dt.NavMenu=Sm,Dt.NavMenuItem=Gd,Dt.useNavMenuItem=Om,Dt.Tab=Dm,Dt.Group=Mm,Dt.useBaseItemChildren=Kd;const Ij=ce(j.Show,{name:"RaApplicaShow",slot:"root"})(({theme:e})=>({"&>.MuiToolbar-root:first-of-type":{backgroundColor:e.palette.background.default},"& .RaShow-card, & > div > div > form":{backgroundColor:e.palette.background.default},"& .RaShow-main>.MuiPaper-root:first-of-type":{overflow:"visible"}})),Ej=ce(j.SimpleFormIterator,{name:"ApplicaSimpleFormIterator",root:"root"})(({theme:e})=>({"& .RaSimpleFormIterator-line":{paddingTop:e.spacing(1),paddingBottom:e.spacing(.5)},"& .RaSimpleFormIterator-action":{display:"flex",flexDirection:"row",alignItems:"center",mb:1.5},"& section":{width:"100%","& label":{position:"relative",overflow:"visible",transform:"none",marginLeft:0}}})),Kl=ys(j.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(()=>({}));Kl.propTypes={...j.TabbedForm.propTypes},Kl.defaultProps={...j.TabbedForm.defaultProps},Kl.Tab=j.TabbedForm.Tab;const Rm=x.createContext(void 0),mj=x.createContext(void 0),Bj=()=>x.useContext(Rm),vj=k.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:i=!1,index:s,member:l,resource:A}=e,u=j.useTranslate(),[g,p]=k.useState(!1),{total:C,remove:h}=Bj(),E=k.useCallback(()=>{p(!1),h(s)},[s,h]),m=x.useMemo(()=>({index:s,total:C,remove:()=>h(s)}),[s,C,h]);return f.jsxs(mj.Provider,{value:m,children:[x.Children.map(n,(B,y)=>{if(!x.isValidElement(B))return null;const{source:O,...R}=B.props;return f.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:x.cloneElement(B,{source:O?`${l}.${O}`:l,index:O?void 0:y,resource:A,disabled:r,...R,label:""})})}),!i&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2.5},children:f.jsx(Ei,{horizontal:!0,children:f.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:u("ra.action.delete")})})}),n.length>0&&f.jsx(j.Confirm,{isOpen:g,title:u("ra.action.remove_item"),content:u("ra.message.remove_item"),onConfirm:E,onClose:()=>p(!1)})]})});var yj=Array.isArray,Jd=yj,bj=typeof Ln=="object"&&Ln&&Ln.Object===Object&&Ln,Qj=bj,xj=Qj,wj=typeof self=="object"&&self&&self.Object===Object&&self,Tj=xj||wj||Function("return this")(),Xd=Tj,Pj=Xd,Sj=Pj.Symbol,Zd=Sj,km=Zd,Fm=Object.prototype,Oj=Fm.hasOwnProperty,jj=Fm.toString,Gs=km?km.toStringTag:void 0;function Mj(e){var t=Oj.call(e,Gs),n=e[Gs];try{e[Gs]=void 0;var r=!0}catch{}var i=jj.call(e);return r&&(t?e[Gs]=n:delete e[Gs]),i}var Dj=Mj,Rj=Object.prototype,kj=Rj.toString;function Fj(e){return kj.call(e)}var Lj=Fj,Lm=Zd,Nj=Dj,Vj=Lj,Hj="[object Null]",Wj="[object Undefined]",Nm=Lm?Lm.toStringTag:void 0;function zj(e){return e==null?e===void 0?Wj:Hj:Nm&&Nm in Object(e)?Nj(e):Vj(e)}var Vm=zj;function Uj(e){return e!=null&&typeof e=="object"}var Yj=Uj,Gj=Vm,Kj=Yj,Jj="[object Symbol]";function Xj(e){return typeof e=="symbol"||Kj(e)&&Gj(e)==Jj}var qd=Xj,Zj=Jd,qj=qd,_j=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$j=/^\w*$/;function eM(e,t){if(Zj(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||qj(e)?!0:$j.test(e)||!_j.test(e)||t!=null&&e in Object(t)}var tM=eM;function nM(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Hm=nM,rM=Vm,oM=Hm,iM="[object AsyncFunction]",sM="[object Function]",aM="[object GeneratorFunction]",lM="[object Proxy]";function cM(e){if(!oM(e))return!1;var t=rM(e);return t==sM||t==aM||t==iM||t==lM}var AM=cM,uM=Xd,dM=uM["__core-js_shared__"],gM=dM,_d=gM,Wm=function(){var e=/[^.]+$/.exec(_d&&_d.keys&&_d.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function fM(e){return!!Wm&&Wm in e}var pM=fM,hM=Function.prototype,CM=hM.toString;function IM(e){if(e!=null){try{return CM.call(e)}catch{}try{return e+""}catch{}}return""}var EM=IM,mM=AM,BM=pM,vM=Hm,yM=EM,bM=/[\\^$.*+?()[\]{}|]/g,QM=/^\[object .+?Constructor\]$/,xM=Function.prototype,wM=Object.prototype,TM=xM.toString,PM=wM.hasOwnProperty,SM=RegExp("^"+TM.call(PM).replace(bM,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function OM(e){if(!vM(e)||BM(e))return!1;var t=mM(e)?SM:QM;return t.test(yM(e))}var jM=OM;function MM(e,t){return e==null?void 0:e[t]}var DM=MM,RM=jM,kM=DM;function FM(e,t){var n=kM(e,t);return RM(n)?n:void 0}var zm=FM,LM=zm,NM=LM(Object,"create"),Jl=NM,Um=Jl;function VM(){this.__data__=Um?Um(null):{},this.size=0}var HM=VM;function WM(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zM=WM,UM=Jl,YM="__lodash_hash_undefined__",GM=Object.prototype,KM=GM.hasOwnProperty;function JM(e){var t=this.__data__;if(UM){var n=t[e];return n===YM?void 0:n}return KM.call(t,e)?t[e]:void 0}var XM=JM,ZM=Jl,qM=Object.prototype,_M=qM.hasOwnProperty;function $M(e){var t=this.__data__;return ZM?t[e]!==void 0:_M.call(t,e)}var eD=$M,tD=Jl,nD="__lodash_hash_undefined__";function rD(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=tD&&t===void 0?nD:t,this}var oD=rD,iD=HM,sD=zM,aD=XM,lD=eD,cD=oD;function ji(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ji.prototype.clear=iD,ji.prototype.delete=sD,ji.prototype.get=aD,ji.prototype.has=lD,ji.prototype.set=cD;var AD=ji;function uD(){this.__data__=[],this.size=0}var dD=uD;function gD(e,t){return e===t||e!==e&&t!==t}var fD=gD,pD=fD;function hD(e,t){for(var n=e.length;n--;)if(pD(e[n][0],t))return n;return-1}var Xl=hD,CD=Xl,ID=Array.prototype,ED=ID.splice;function mD(e){var t=this.__data__,n=CD(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():ED.call(t,n,1),--this.size,!0}var BD=mD,vD=Xl;function yD(e){var t=this.__data__,n=vD(t,e);return n<0?void 0:t[n][1]}var bD=yD,QD=Xl;function xD(e){return QD(this.__data__,e)>-1}var wD=xD,TD=Xl;function PD(e,t){var n=this.__data__,r=TD(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var SD=PD,OD=dD,jD=BD,MD=bD,DD=wD,RD=SD;function Mi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Mi.prototype.clear=OD,Mi.prototype.delete=jD,Mi.prototype.get=MD,Mi.prototype.has=DD,Mi.prototype.set=RD;var kD=Mi,FD=zm,LD=Xd,ND=FD(LD,"Map"),VD=ND,Ym=AD,HD=kD,WD=VD;function zD(){this.size=0,this.__data__={hash:new Ym,map:new(WD||HD),string:new Ym}}var UD=zD;function YD(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var GD=YD,KD=GD;function JD(e,t){var n=e.__data__;return KD(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Zl=JD,XD=Zl;function ZD(e){var t=XD(this,e).delete(e);return this.size-=t?1:0,t}var qD=ZD,_D=Zl;function $D(e){return _D(this,e).get(e)}var eR=$D,tR=Zl;function nR(e){return tR(this,e).has(e)}var rR=nR,oR=Zl;function iR(e,t){var n=oR(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var sR=iR,aR=UD,lR=qD,cR=eR,AR=rR,uR=sR;function Di(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Di.prototype.clear=aR,Di.prototype.delete=lR,Di.prototype.get=cR,Di.prototype.has=AR,Di.prototype.set=uR;var dR=Di,Gm=dR,gR="Expected a function";function $d(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(gR);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var l=e.apply(this,r);return n.cache=s.set(i,l)||s,l};return n.cache=new($d.Cache||Gm),n}$d.Cache=Gm;var fR=$d,pR=fR,hR=500;function CR(e){var t=pR(e,function(r){return n.size===hR&&n.clear(),r}),n=t.cache;return t}var IR=CR,ER=IR,mR=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,BR=/\\(\\)?/g,vR=ER(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(mR,function(n,r,i,s){t.push(i?s.replace(BR,"$1"):r||n)}),t}),yR=vR;function bR(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var QR=bR,Km=Zd,xR=QR,wR=Jd,TR=qd,PR=1/0,Jm=Km?Km.prototype:void 0,Xm=Jm?Jm.toString:void 0;function Zm(e){if(typeof e=="string")return e;if(wR(e))return xR(e,Zm)+"";if(TR(e))return Xm?Xm.call(e):"";var t=e+"";return t=="0"&&1/e==-PR?"-0":t}var SR=Zm,OR=SR;function jR(e){return e==null?"":OR(e)}var MR=jR,DR=Jd,RR=tM,kR=yR,FR=MR;function LR(e,t){return DR(e)?e:RR(e,t)?[e]:kR(FR(e))}var NR=LR,VR=qd,HR=1/0;function WR(e){if(typeof e=="string"||VR(e))return e;var t=e+"";return t=="0"&&1/e==-HR?"-0":t}var zR=WR,UR=NR,YR=zR;function GR(e,t){t=UR(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[YR(t[n++])];return n&&n==r?e:void 0}var KR=GR,JR=KR;function XR(e,t,n){var r=e==null?void 0:JR(e,t);return r===void 0?n:r}var ZR=XR;const qR=li(ZR),qm=e=>{var _,J;const{children:t,resource:n,source:r,label:i,disableActions:s=!1,disableAdd:l=!1,disableRemove:A=!1,className:u,empty:g,template:p={}}=e,[C,h]=x.useState(!1),{fields:E,remove:m,replace:B,append:y}=j.useArrayInput(e),{resetField:O}=Cs.useFormContext(),R=xt(),w=Ce.useTranslate(),S=Ce.useRecordContext(e),P=x.useRef(p||{}),N=Ce.useTranslateLabel(),F=x.useCallback(H=>{m(H)},[m]);if(E.length>0){const{...H}=E[0];P.current=H;for(const K in P.current)P.current[K]=null}const X=x.useCallback((H=void 0)=>{let K=H;H==null&&(K=P.current,x.Children.count(t)===1&&k.isValidElement(x.Children.only(t))&&!x.Children.only(t).props.source&&x.Children.map(t,ee=>k.isValidElement(ee)&&ee.type!==Ce.FormDataConsumer).some(Boolean)?K="":(K=K||{},x.Children.forEach(t,ee=>{k.isValidElement(ee)&&ee.type!==Ce.FormDataConsumer&&ee.props.source&&(K[ee.props.source]=ee.props.defaultValue??null)})));const L={...K,...p};y(L),O(`${r}.${E.length}`,{defaultValue:K})},[y,t,O,r,E.length,p]),Z=H=>K=>{X(),H&&H(K)},G=x.useCallback(()=>{B([]),h(!1)},[B]),te=qR(S,r),le=x.useMemo(()=>({total:E.length,remove:F,source:r}),[E.length,F,r]),ie=R.palette.mode==="dark"?R.palette.grey.A400:R.palette.grey.A800;return E?f.jsx(Rm.Provider,{value:le,children:f.jsxs("div",{className:u,children:[k.cloneElement(f.jsx(_m,{}),{label:i,source:r,disableAdd:l,template:p,onClick:Z((J=(_=e==null?void 0:e.addButton)==null?void 0:_.props)==null?void 0:J.onClick)}),f.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${ie}`},children:f.jsxs(b.Table,{children:[f.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${ie}`},children:f.jsxs(b.TableRow,{children:[x.Children.map(t,(H,K)=>k.isValidElement(H)?f.jsx(b.TableCell,{children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none",children:N({...H.props,resource:n})})},K):null),!s&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",verticalAlign:"top"},children:f.jsx(b.Typography,{display:"flex",variant:"subtitle1",fontWeight:500,color:"text.primary",textTransform:"none"})},"actions")]})}),f.jsxs(b.TableBody,{children:[E.length===0&&f.jsx(b.TableRow,{sx:{"&:last-child td, &:last-child th":{border:0}},children:f.jsx(b.TableCell,{colSpan:4+(s?0:1),align:"center",children:g||f.jsx(b.Typography,{variant:"body1",color:"text.secondary",children:"-"})})}),E.length>0&&E.map((H,K)=>f.jsx(b.TableRow,{sx:{borderBottom:`1px solid ${ie}}`},children:f.jsx(vj,{disableRemove:A,disableActions:s,index:K,member:`${r}.${K}`,onRemoveField:F,record:te&&te[K]||{},resource:n,source:r,children:t})},H.id))]})]})}),E.length>0&&f.jsx(j.Confirm,{isOpen:C,title:w("ra.action.clear_array_input"),content:w("ra.message.clear_array_input"),onConfirm:G,onClose:()=>h(!1)})]})}):null},_m=e=>{const{label:t,disableAdd:n,onClick:r}=e,i=xt(),s=i.palette.mode==="dark"?i.palette.grey.A400:i.palette.grey.A800,l=i.palette.mode==="light"?"#000000":"#FFFFFF";return f.jsxs(b.Stack,{justifyContent:"space-between",alignItems:"center",flexDirection:"row",children:[t!==!1&&f.jsx(b.Typography,{children:t}),!n&&(k.isValidElement(e==null?void 0:e.addButton)?k.cloneElement(e==null?void 0:e.addButton,{onClick:r}):f.jsx(b.IconButton,{size:"small",color:"secondary",sx:{border:`1px solid ${s}`},onClick:r,children:f.jsx(tt.PlusCircleOutlined,{style:{color:l}})}))]})},_R=ce(qm,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));_m.propTypes={label:c.oneOfType([c.string,c.bool]),source:c.string,defaultValue:c.any},qm.propTypes={addButton:c.element,children:c.node,className:c.string,field:c.object,fields:c.array,fieldState:c.object,formState:c.object,record:c.object,source:c.string,label:c.oneOfType([c.string,c.bool]),resource:c.string,translate:c.func,disableAdd:c.bool,disableRemove:c.oneOfType([c.func,c.bool]),TransitionProps:c.shape({}),empty:c.oneOfType([c.node,c.string]),template:c.object};function $R(e,t){const n=Ie.clone(e),{type:r,payload:i}=t;switch(r){case"updateMedia":{const s=Ie.chain(n.media).clone().extend(i).value();return Ie.extend(n,{media:s})}case"updateDrawer":{const s=Ie.chain(n.drawer).clone().extend(i).value();return Ie.extend(n,{drawer:s})}case"updateLogo":{const s=Ie.chain(n.logo).clone().extend(i).value();return Ie.extend(n,{logo:s})}case"updateNotifications":{const s=Ie.chain(n.notifications).clone().extend(i).value();return Ie.extend(n,{notifications:s})}case"updateTheme":{const s=Ie.chain(n.theme).clone().extend(i).value();return Ie.extend(n,{theme:s})}default:return n}}const e2={drawer:{open:!0,width:260,handleDrawerToggle:()=>{}},media:{downMd:!1,downLg:!1,downXl:!1,horizontal:!1},logo:{},notifications:{enable:!0,resource:"entities/notification"},theme:{iconColor:"grey.300",iconColorOpen:"grey.100"}},$m=x.createContext(void 0);function e0(e){var X;const t=Ce.useGetIdentity(),n=b.useTheme(),r=b.useMediaQuery(n.breakpoints.down("md")),i=b.useMediaQuery(n.breakpoints.down("lg")),s=b.useMediaQuery(n.breakpoints.down("xl")),{miniDrawer:l,isHorizontalLayout:A,menuOrientation:u,drawerWidth:g}=Qn(),p=A(u)&&!i,{drawerOpen:C,openDrawer:h}=qr(),E=x.useCallback(()=>{h(!C)},[C,h]),[m,B]=x.useState(!1),[y,O]=x.useReducer($R,Ie.chain(e2).clone().merge({drawer:{open:!l||C}}).value()),R=x.useCallback(()=>B(!1),[]),w=x.useMemo(()=>({state:y,dispatch:O}),[y,O]),{logoIcon:S,logoMain:P,enableNotification:N,notification:F}=e;return x.useEffect(()=>{O({type:"updateMedia",payload:{downMd:r,downLg:i,downXl:s,horizontal:p}})},[u,r,i,s]),x.useEffect(()=>{O({type:"updateDrawer",payload:{open:C,width:g,handleDrawerToggle:E}})},[C,g,E]),x.useEffect(()=>{l||h(!s)},[s,l]),x.useEffect(()=>{O({type:"updateLogo",payload:{main:P,icon:S}})},[S,P]),x.useEffect(()=>{O({type:"updateNotifications",payload:{enable:N,resource:F??"entities/notification"}})},[N,F]),x.useEffect(()=>{O({type:"updateTheme",payload:{iconColorOpen:n.palette.mode==="dark"?"grey.200":"grey.300",iconColor:n.palette.mode==="dark"?"background.default":"grey.100"}})},[n.palette.mode]),x.useEffect(()=>{var Z;B(((Z=t==null?void 0:t.data)==null?void 0:Z.needToChangePassword)===!0)},[(X=t==null?void 0:t.data)==null?void 0:X.needToChangePassword]),f.jsxs($m.Provider,{value:w,children:[f.jsx(b.Dialog,{open:m,maxWidth:"xs",fullWidth:!0,children:f.jsx(Hd,{onSuccess:R,firstAccess:!0})}),e.children]})}function t0(e){return x.forwardRef((t,n)=>{const{logoIcon:r,logoMain:i,enableNotification:s}=t;return f.jsx(e0,{logoIcon:r,logoMain:i,enableNotification:s,children:f.jsx(e,{ref:n,...t})})})}function eg(){const e=x.useContext($m);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function t2(){return eg().dispatch}function Ri(){return eg().state}function Wn(){return Ri().media}function No(){return Ri().drawer}function n0(){return Ri().logo}function ql(){return Ri().notifications}function _l(){return Ri().theme}function r0(){const{iconColor:e,iconColorOpen:t}=_l(),{open:n,handleDrawerToggle:r}=No();return f.jsx(io,{"aria-label":"open drawer",onClick:r,edge:"start",color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:n?t:e,ml:{xs:0,lg:-2}},children:n?f.jsx(tt.MenuFoldOutlined,{}):f.jsx(tt.MenuUnfoldOutlined,{})})}function o0(e){const t=x.useRef(),n=b.useTheme(),{downLg:r,horizontal:i}=Wn(),{open:s,width:l}=No(),A=r?b.AppBar:Wh,u=Bi(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:i?"100%":s?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),g={position:"fixed",color:"inherit",elevation:0,sx:u};return r||Ie.extend(g,{open:s}),f.jsx(A,{ref:t,...g,children:f.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!i&&f.jsx(r0,{}),e.children]})})}function n2(e){const t=b.useTheme(),{notification:n,onClick:r,selected:i,divider:s}=e,{resource:l}=ql(),A=Ce.useNotify(),u=Ce.useRedirect(),[g]=Ce.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:Rr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(u(n==null?void 0:n.resource),r()):document.location.href=n==null?void 0:n.resource:r()},onFailure:()=>{A("resources.notifications.messages.readed.error","warning")}}),p=x.useCallback(()=>g(),[g]),[C]=Ce.useLocaleState(),h=x.useMemo(()=>Rr(n.created).locale(C).fromNow(),[n,C]);return f.jsx(b.ListItem,{disablePadding:!0,divider:s,children:f.jsxs(b.ListItemButton,{selected:i,onClick:p,children:[f.jsx(b.ListItemAvatar,{children:f.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:f.jsx(tt.MessageOutlined,{})})}),f.jsx(b.ListItemText,{primary:n.title,secondary:n.content}),f.jsx(b.Box,{flexGrow:1,flexShrink:1,minWidth:t.spacing(2)}),f.jsx(b.ListItemText,{primary:h,primaryTypographyProps:{variant:"caption"}})]})})}const r2={width:36,height:36,fontSize:"1rem"},o2={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function i0(){const{enable:e}=ql();return e?f.jsx(i2,{}):null}function i2(){const e=b.useTheme(),t=x.useRef(),{resource:n}=ql(),{downMd:r}=Wn(),{iconColor:i,iconColorOpen:s}=_l(),[l,A]=x.useState(!1),[u,g]=x.useState([]),p=u.filter(B=>B.readed===null).length,C=x.useCallback(()=>A(!l),[l]),h=x.useCallback(()=>{t.current&&t.current.contains(event.target)||A(!1)},[t.current,A]),{data:E,isLoading:m}=Ce.useGetList(n,{pagination:{page:1,perPage:50},sort:{field:"created",order:"DESC"},filter:{readed:!1}});return x.useEffect(()=>{!m&&E&&g(E??[])},[E,m]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.jsx(io,{color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:l?s:i},"aria-label":"open profile",ref:t,"aria-controls":l?"profile-grow":void 0,"aria-haspopup":"true",onClick:C,children:f.jsx(b.Badge,{badgeContent:p,color:"primary",children:f.jsx(tt.BellOutlined,{})})}),f.jsx(b.Popper,{placement:r?"bottom":"bottom-end",open:l,anchorEl:t.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[r?-5:0,9]}}]},children:({TransitionProps:B})=>f.jsx(ao,{type:"grow",position:r?"top":"top-right",in:open,...B,children:f.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:"100%",minWidth:285,maxWidth:420,[e.breakpoints.down("md")]:{maxWidth:285}},children:f.jsx(b.ClickAwayListener,{onClickAway:h,children:f.jsx(or,{title:"Notification",elevation:0,border:!1,content:!1,secondary:f.jsx(f.Fragment,{children:p>0&&f.jsx(b.Tooltip,{title:"Mark as all read",children:f.jsx(io,{color:"success",size:"small",children:f.jsx(tt.CheckCircleOutlined,{style:{fontSize:"1.15rem"}})})})}),children:f.jsx(b.List,{component:"nav",sx:{p:0,"& .MuiListItemButton-root":{py:.5,"&.Mui-selected":{bgcolor:"grey.50",color:"text.primary"},"& .MuiAvatar-root":r2,"& .MuiListItemSecondaryAction-root":{...o2,position:"relative"}}},children:u.map((y,O)=>f.jsx(n2,{selected:p>0,notification:y,onClick:h,divider:O<u.length-1},y.id))})})})})})})]})}const s2=()=>{const[e,t]=x.useState(!1),n=x.useCallback(()=>t(!1),[t]),r=x.useCallback(()=>t(!0),[t]),i=Ce.useTranslate();return f.jsxs(x.Fragment,{children:[f.jsxs(b.ListItemButton,{onClick:r,children:[f.jsx(b.ListItemIcon,{children:f.jsx(dn.Key,{})}),f.jsx(b.ListItemText,{primary:i("ra.auth.change_password")})]}),f.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:f.jsx(Hd,{onSuccess:n})})]})},a2=()=>{const e=Ce.useLogout(),t=Ce.useTranslate();return f.jsx(x.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:e,children:[f.jsx(b.ListItemIcon,{children:f.jsx(dn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},l2=()=>{const e=Ce.useTranslate(),t=Ce.useAuthProvider(),n=x.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,i]=x.useState(!1);return x.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(s=>i(s))},[t,i]),r?f.jsx(x.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:n,children:[f.jsx(b.ListItemIcon,{children:f.jsx(dn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};c.node,c.any.isRequired,c.any.isRequired;const s0=()=>{var B;const e=b.useTheme(),{identity:t}=j.useGetIdentity(),n=t!==void 0&&t.image&&t.image!==null&&t.image!=="",r=x.useRef(null),[i,s]=x.useState(!1),l=()=>{s(y=>!y)},A=y=>{r.current&&r.current.contains(y.target)||s(!1)},u=e.palette.mode==="dark"?"grey.200":"grey.300",g=j.useLogout(),p=j.useDataProvider(),C=j.useAuthProvider(),h=x.useCallback(()=>{g()},[C,g]),[E,m]=x.useState(null);return x.useEffect(()=>{if(!n)return;async function y(){var O=await p.getFile("/profile/me/image");m(O)}y()},[p,n]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.jsx(b.ButtonBase,{sx:{p:.25,bgcolor:i?u:"transparent",borderRadius:1,"&:hover":{bgcolor:e.palette.mode==="dark"?"secondary.light":"secondary.lighter"},"&:focus-visible":{outline:`2px solid ${e.palette.secondary.dark}`,outlineOffset:2}},"aria-label":"open profile",ref:r,"aria-controls":i?"profile-grow":void 0,"aria-haspopup":"true",onClick:l,children:f.jsxs(b.Stack,{direction:"row",spacing:2,alignItems:"center",sx:{p:.5},children:[f.jsx(Ws,{alt:(B=t==null?void 0:t.name)==null?void 0:B.toUpperCase(),src:E,size:"xs"}),f.jsx(b.Typography,{variant:"subtitle1",children:t==null?void 0:t.name})]})}),f.jsx(b.Popper,{placement:"bottom-end",open:i,anchorEl:r.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:y})=>{var O;return f.jsx(ao,{type:"grow",position:"top-right",in:i,...y,children:f.jsx(b.Paper,{sx:{boxShadow:e.customShadows.z1,width:290,minWidth:240,maxWidth:290,[e.breakpoints.down("md")]:{maxWidth:250}},children:f.jsx(b.ClickAwayListener,{onClickAway:A,children:f.jsxs(or,{elevation:0,border:!1,content:!1,children:[f.jsx(b.CardContent,{sx:{px:2.5,pt:3},children:f.jsxs(b.Grid,{container:!0,justifyContent:"space-between",alignItems:"center",children:[f.jsx(b.Grid,{item:!0,children:f.jsxs(b.Stack,{direction:"row",spacing:1.25,alignItems:"center",children:[f.jsx(Ws,{alt:"profile user",src:E,sx:{width:32,height:32}}),f.jsxs(b.Stack,{children:[f.jsx(b.Typography,{variant:"h6",children:t==null?void 0:t.name}),f.jsx(b.Typography,{variant:"body2",color:"textSecondary",children:(O=t==null?void 0:t.roles)==null?void 0:O.map(R=>R.name.replace("ROLE_","")).join(",")})]})]})}),f.jsx(b.Grid,{item:!0,children:f.jsx(b.Tooltip,{title:"Logout",children:f.jsx(io,{size:"large",sx:{color:"text.primary"},onClick:h,children:f.jsx(tt.LogoutOutlined,{})})})})]})}),f.jsx(b.Grid,{container:!0,children:f.jsx(b.Grid,{item:!0,xs:12,children:f.jsxs(b.List,{component:"nav",sx:{p:0,"& .MuiListItemIcon-root":{minWidth:32}},children:[f.jsx(s2,{}),f.jsx(a2,{}),f.jsx(l2,{})]})})})]})})})})}})]})},a0=e=>{const t=xt(),{downMd:n}=Wn(),{iconColor:r,iconColorOpen:i}=_l(),[s,l]=x.useState(!1),A=x.useRef(null),u=x.useCallback(()=>{l(!s)},[s]),g=x.useCallback(p=>{A.current&&A.current.contains(p.target)||l(!1)},[]);return n?f.jsxs(f.Fragment,{children:[f.jsx(b.Box,{sx:{flexShrink:0},children:f.jsx(io,{sx:{color:"text.primary",bgcolor:s?i:r},"aria-label":"open more menu",ref:A,"aria-controls":s?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:u,color:"secondary",variant:"light",children:f.jsx(tt.MoreOutlined,{})})}),f.jsx(b.Popper,{placement:"bottom-end",open:s,anchorEl:A.current,role:void 0,transition:!0,disablePortal:!0,style:{width:"100%"},popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:p})=>f.jsx(ao,{type:"fade",in:s,...p,children:f.jsx(b.Paper,{sx:{boxShadow:t.customShadows.z1},children:f.jsx(b.ClickAwayListener,{onClickAway:g,children:f.jsx(b.AppBar,{color:"inherit",children:f.jsx(b.Toolbar,{children:e.children})})})})})})]}):f.jsx(f.Fragment,{children:e.children})};function l0(e){return f.jsx(b.Box,{...e,flex:1})}function Ks(e){const{name:t,version:n}=e;return f.jsx(b.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{p:"24px 16px 0px",mt:"auto"},children:f.jsxs(b.Typography,{variant:"caption",children:[f.jsx("span",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.copy)||""}})," ",t," - ",n]})})}Ks.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string},Ks.defaultProps={copy:"© Applica Software Guru for"};var c0={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(c0);var tg=c0.exports,ng={};const c2=YQ(XO);var A0;function rg(){return A0||(A0=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=c2}(ng)),ng}function u0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=u0(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function d0(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=u0(e))&&(r&&(r+=" "),r+=t);return r}var og=globalThis&&globalThis.__assign||function(){return og=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},og.apply(this,arguments)},A2=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},g0=function(e){var t=e.className,n=e.sx,r=A2(e,["className","sx"]),i=Ce.useLoading(),s=xt();return k.createElement(u2,{className:t,sx:n},i?k.createElement(pd,og({className:d0("app-loader",$l.loader),color:"inherit",size:s.spacing(2),thickness:6},r)):k.createElement($0,{className:$l.loadedIcon}))};g0.propTypes={classes:c.object,className:c.string,width:c.string};var ig="RaLoadingIndicator",$l={loader:"".concat(ig,"-loader"),loadedIcon:"".concat(ig,"-loadedIcon")},u2=ce("div",{name:ig,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat($l.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat($l.loadedIcon)]={},t});const sg=e=>e.scrollTop;function ki(e,t){var n,r;const{timeout:i,easing:s,style:l={}}=e;return{duration:(n=l.transitionDuration)!=null?n:typeof i=="number"?i:i[t.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof s=="object"?s[t.mode]:s,delay:l.transitionDelay}}const d2=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function g2(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),s=ui(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const g=s.getComputedStyle(t);l=g.getPropertyValue("-webkit-transform")||g.getPropertyValue("transform")}let A=0,u=0;if(l&&l!=="none"&&typeof l=="string"){const g=l.split("(")[1].split(")")[0].split(",");A=parseInt(g[4],10),u=parseInt(g[5],10)}return e==="left"?i?`translateX(${i.right+A-r.left}px)`:`translateX(${s.innerWidth+A-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-A}px)`:`translateX(-${r.left+r.width-A}px)`:e==="up"?i?`translateY(${i.bottom+u-r.top}px)`:`translateY(${s.innerHeight+u-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-u}px)`:`translateY(-${r.top+r.height-u}px)`}function f0(e){return typeof e=="function"?e():e}function ec(e,t,n){const r=f0(n),i=g2(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const p0=k.forwardRef(function(t,n){const r=xt(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:A=!0,children:u,container:g,direction:p="down",easing:C=i,in:h,onEnter:E,onEntered:m,onEntering:B,onExit:y,onExited:O,onExiting:R,style:w,timeout:S=s,TransitionComponent:P=cd}=t,N=Ke(t,d2),F=k.useRef(null),X=yn(u.ref,F,n),Z=L=>ee=>{L&&(ee===void 0?L(F.current):L(F.current,ee))},G=Z((L,ee)=>{ec(p,L,g),sg(L),E&&E(L,ee)}),te=Z((L,ee)=>{const U=ki({timeout:S,style:w,easing:C},{mode:"enter"});L.style.webkitTransition=r.transitions.create("-webkit-transform",z({},U)),L.style.transition=r.transitions.create("transform",z({},U)),L.style.webkitTransform="none",L.style.transform="none",B&&B(L,ee)}),le=Z(m),ie=Z(R),_=Z(L=>{const ee=ki({timeout:S,style:w,easing:C},{mode:"exit"});L.style.webkitTransition=r.transitions.create("-webkit-transform",ee),L.style.transition=r.transitions.create("transform",ee),ec(p,L,g),y&&y(L)}),J=Z(L=>{L.style.webkitTransition="",L.style.transition="",O&&O(L)}),H=L=>{l&&l(F.current,L)},K=k.useCallback(()=>{F.current&&ec(p,F.current,g)},[p,g]);return k.useEffect(()=>{if(h||p==="down"||p==="right")return;const L=Jp(()=>{F.current&&ec(p,F.current,g)}),ee=ui(F.current);return ee.addEventListener("resize",L),()=>{L.clear(),ee.removeEventListener("resize",L)}},[p,h,g]),k.useEffect(()=>{h||K()},[h,K]),f.jsx(P,z({nodeRef:F,onEnter:G,onEntered:le,onEntering:te,onExit:_,onExited:J,onExiting:ie,addEndListener:H,appear:A,in:h,timeout:S},N,{children:(L,ee)=>k.cloneElement(u,z({ref:X,style:z({visibility:L==="exited"&&!h?"hidden":void 0},w,u.props.style)},ee))}))});process.env.NODE_ENV!=="production"&&(p0.propTypes={addEndListener:c.func,appear:c.bool,children:ci.isRequired,container:gr(c.oneOfType([wo,c.func]),e=>{if(e.open){const t=f0(e.container);if(t&&t.nodeType===1){const n=t.getBoundingClientRect();if(process.env.NODE_ENV!=="test"&&n.top===0&&n.left===0&&n.right===0&&n.bottom===0)return new Error(["MUI: The `container` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
|
|
203
203
|
`))}else if(!t||typeof t.getBoundingClientRect!="function"||t.contextElement!=null&&t.contextElement.nodeType!==1)return new Error(["MUI: The `container` prop provided to the component is invalid.","It should be an HTML element instance."].join(`
|
|
204
204
|
`))}return null}),direction:c.oneOf(["down","left","right","up"]),easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const f2=p0;function p2(e){return typeof e=="string"}function h2(e,t,n){return e===void 0||p2(e)?t:z({},t,{ownerState:z({},t.ownerState,n)})}const C2={disableDefaultClasses:!1},I2=k.createContext(C2);function E2(e){const{disableDefaultClasses:t}=k.useContext(I2);return n=>t?"":e(n)}function h0(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function m2(e,t,n){return typeof e=="function"?e(t,n):e}function C0(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function B2(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:s}=e;if(!t){const E=Xe(i==null?void 0:i.className,r==null?void 0:r.className,s,n==null?void 0:n.className),m=z({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),B=z({},n,i,r);return E.length>0&&(B.className=E),Object.keys(m).length>0&&(B.style=m),{props:B,internalRef:void 0}}const l=h0(z({},i,r)),A=C0(r),u=C0(i),g=t(l),p=Xe(g==null?void 0:g.className,n==null?void 0:n.className,s,i==null?void 0:i.className,r==null?void 0:r.className),C=z({},g==null?void 0:g.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),h=z({},g,n,u,A);return p.length>0&&(h.className=p),Object.keys(C).length>0&&(h.style=C),{props:h,internalRef:g.ref}}const v2=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function y2(e){var t;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:s=!1}=e,l=Ke(e,v2),A=s?{}:m2(r,i),{props:u,internalRef:g}=B2(z({},l,{externalSlotProps:A})),p=yn(g,A==null?void 0:A.ref,(t=e.additionalProps)==null?void 0:t.ref);return h2(n,z({},u,{ref:p}),i)}function b2(e){const t=rr(e);return t.body===e?ui(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function Js(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function I0(e){return parseInt(ui(e).getComputedStyle(e).paddingRight,10)||0}function Q2(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function E0(e,t,n,r,i){const s=[t,n,...r];[].forEach.call(e.children,l=>{const A=s.indexOf(l)===-1,u=!Q2(l);A&&u&&Js(l,i)})}function ag(e,t){let n=-1;return e.some((r,i)=>t(r)?(n=i,!0):!1),n}function x2(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(b2(r)){const l=vx(rr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${I0(r)+l}px`;const A=rr(r).querySelectorAll(".mui-fixed");[].forEach.call(A,u=>{n.push({value:u.style.paddingRight,property:"padding-right",el:u}),u.style.paddingRight=`${I0(u)+l}px`})}let s;if(r.parentNode instanceof DocumentFragment)s=rr(r).body;else{const l=r.parentElement,A=ui(r);s=(l==null?void 0:l.nodeName)==="HTML"&&A.getComputedStyle(l).overflowY==="scroll"?l:r}n.push({value:s.style.overflow,property:"overflow",el:s},{value:s.style.overflowX,property:"overflow-x",el:s},{value:s.style.overflowY,property:"overflow-y",el:s}),s.style.overflow="hidden"}return()=>{n.forEach(({value:s,el:l,property:A})=>{s?l.style.setProperty(A,s):l.style.removeProperty(A)})}}function w2(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class T2{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&Js(t.modalRef,!1);const i=w2(n);E0(n,t.mount,t.modalRef,i,!0);const s=ag(this.containers,l=>l.container===n);return s!==-1?(this.containers[s].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:i}),r)}mount(t,n){const r=ag(this.containers,s=>s.modals.indexOf(t)!==-1),i=this.containers[r];i.restore||(i.restore=x2(i,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const i=ag(this.containers,l=>l.modals.indexOf(t)!==-1),s=this.containers[i];if(s.modals.splice(s.modals.indexOf(t),1),this.modals.splice(r,1),s.modals.length===0)s.restore&&s.restore(),t.modalRef&&Js(t.modalRef,n),E0(s.container,t.mount,t.modalRef,s.hiddenSiblings,!1),this.containers.splice(i,1);else{const l=s.modals[s.modals.length-1];l.modalRef&&Js(l.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function P2(e){return typeof e=="function"?e():e}function S2(e){return e?e.props.hasOwnProperty("in"):!1}const O2=new T2;function j2(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=O2,closeAfterTransition:s=!1,onTransitionEnter:l,onTransitionExited:A,children:u,onClose:g,open:p,rootRef:C}=e,h=k.useRef({}),E=k.useRef(null),m=k.useRef(null),B=yn(m,C),[y,O]=k.useState(!p),R=S2(u);let w=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(w=!1);const S=()=>rr(E.current),P=()=>(h.current.modalRef=m.current,h.current.mount=E.current,h.current),N=()=>{i.mount(P(),{disableScrollLock:r}),m.current&&(m.current.scrollTop=0)},F=Xr(()=>{const H=P2(t)||S().body;i.add(P(),H),m.current&&N()}),X=k.useCallback(()=>i.isTopModal(P()),[i]),Z=Xr(H=>{E.current=H,H&&(p&&X()?N():m.current&&Js(m.current,w))}),G=k.useCallback(()=>{i.remove(P(),w)},[w,i]);k.useEffect(()=>()=>{G()},[G]),k.useEffect(()=>{p?F():(!R||!s)&&G()},[p,G,R,s,F]);const te=H=>K=>{var L;(L=H.onKeyDown)==null||L.call(H,K),!(K.key!=="Escape"||!X())&&(n||(K.stopPropagation(),g&&g(K,"escapeKeyDown")))},le=H=>K=>{var L;(L=H.onClick)==null||L.call(H,K),K.target===K.currentTarget&&g&&g(K,"backdropClick")};return{getRootProps:(H={})=>{const K=h0(e);delete K.onTransitionEnter,delete K.onTransitionExited;const L=z({},K,H);return z({role:"presentation"},L,{onKeyDown:te(L),ref:B})},getBackdropProps:(H={})=>{const K=H;return z({"aria-hidden":!0},K,{onClick:le(K),open:p})},getTransitionProps:()=>{const H=()=>{O(!1),l&&l()},K=()=>{O(!0),A&&A(),s&&G()};return{onEnter:NA(H,u==null?void 0:u.props.onEnter),onExited:NA(K,u==null?void 0:u.props.onExited)}},rootRef:B,portalRef:Z,isTopModal:X,exited:y,hasTransition:R}}const M2=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function D2(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function R2(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function k2(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||R2(e))}function F2(e){const t=[],n=[];return Array.from(e.querySelectorAll(M2)).forEach((r,i)=>{const s=D2(r);s===-1||!k2(r)||(s===0?t.push(r):n.push({documentOrder:i,tabIndex:s,node:r}))}),n.sort((r,i)=>r.tabIndex===i.tabIndex?r.documentOrder-i.documentOrder:r.tabIndex-i.tabIndex).map(r=>r.node).concat(t)}function L2(){return!0}function tc(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:s=F2,isEnabled:l=L2,open:A}=e,u=k.useRef(!1),g=k.useRef(null),p=k.useRef(null),C=k.useRef(null),h=k.useRef(null),E=k.useRef(!1),m=k.useRef(null),B=yn(t.ref,m),y=k.useRef(null);k.useEffect(()=>{!A||!m.current||(E.current=!n)},[n,A]),k.useEffect(()=>{if(!A||!m.current)return;const w=rr(m.current);return m.current.contains(w.activeElement)||(m.current.hasAttribute("tabIndex")||(process.env.NODE_ENV!=="production"&&console.error(["MUI: The modal content node does not accept focus.",'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join(`
|
|
205
205
|
`)),m.current.setAttribute("tabIndex","-1")),E.current&&m.current.focus()),()=>{i||(C.current&&C.current.focus&&(u.current=!0,C.current.focus()),C.current=null)}},[A]),k.useEffect(()=>{if(!A||!m.current)return;const w=rr(m.current),S=F=>{y.current=F,!(r||!l()||F.key!=="Tab")&&w.activeElement===m.current&&F.shiftKey&&(u.current=!0,p.current&&p.current.focus())},P=()=>{const F=m.current;if(F===null)return;if(!w.hasFocus()||!l()||u.current){u.current=!1;return}if(F.contains(w.activeElement)||r&&w.activeElement!==g.current&&w.activeElement!==p.current)return;if(w.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!E.current)return;let X=[];if((w.activeElement===g.current||w.activeElement===p.current)&&(X=s(m.current)),X.length>0){var Z,G;const te=!!((Z=y.current)!=null&&Z.shiftKey&&((G=y.current)==null?void 0:G.key)==="Tab"),le=X[0],ie=X[X.length-1];typeof le!="string"&&typeof ie!="string"&&(te?ie.focus():le.focus())}else F.focus()};w.addEventListener("focusin",P),w.addEventListener("keydown",S,!0);const N=setInterval(()=>{w.activeElement&&w.activeElement.tagName==="BODY"&&P()},50);return()=>{clearInterval(N),w.removeEventListener("focusin",P),w.removeEventListener("keydown",S,!0)}},[n,r,i,l,A,s]);const O=w=>{C.current===null&&(C.current=w.relatedTarget),E.current=!0,h.current=w.target;const S=t.props.onFocus;S&&S(w)},R=w=>{C.current===null&&(C.current=w.relatedTarget),E.current=!0};return f.jsxs(k.Fragment,{children:[f.jsx("div",{tabIndex:A?0:-1,onFocus:R,ref:g,"data-testid":"sentinelStart"}),k.cloneElement(t,{ref:B,onFocus:O}),f.jsx("div",{tabIndex:A?0:-1,onFocus:R,ref:p,"data-testid":"sentinelEnd"})]})}process.env.NODE_ENV!=="production"&&(tc.propTypes={children:ci,disableAutoFocus:c.bool,disableEnforceFocus:c.bool,disableRestoreFocus:c.bool,getTabbable:c.func,isEnabled:c.func,open:c.bool.isRequired}),process.env.NODE_ENV!=="production"&&(tc["propTypes"]=Na(tc.propTypes));function N2(e){return typeof e=="function"?e():e}const Xs=k.forwardRef(function(t,n){const{children:r,container:i,disablePortal:s=!1}=t,[l,A]=k.useState(null),u=yn(k.isValidElement(r)?r.ref:null,n);if(di(()=>{s||A(N2(i)||document.body)},[i,s]),di(()=>{if(l&&!s)return Va(n,l),()=>{Va(n,null)}},[n,l,s]),s){if(k.isValidElement(r)){const g={ref:u};return k.cloneElement(r,g)}return f.jsx(k.Fragment,{children:r})}return f.jsx(k.Fragment,{children:l&&UQ.createPortal(r,l)})});process.env.NODE_ENV!=="production"&&(Xs.propTypes={children:c.node,container:c.oneOfType([wo,c.func]),disablePortal:c.bool}),process.env.NODE_ENV!=="production"&&(Xs["propTypes"]=Na(Xs.propTypes));const V2=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],H2={entering:{opacity:1},entered:{opacity:1}},m0=k.forwardRef(function(t,n){const r=xt(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:l=!0,children:A,easing:u,in:g,onEnter:p,onEntered:C,onEntering:h,onExit:E,onExited:m,onExiting:B,style:y,timeout:O=i,TransitionComponent:R=cd}=t,w=Ke(t,V2),S=k.useRef(null),P=yn(S,A.ref,n),N=_=>J=>{if(_){const H=S.current;J===void 0?_(H):_(H,J)}},F=N(h),X=N((_,J)=>{sg(_);const H=ki({style:y,timeout:O,easing:u},{mode:"enter"});_.style.webkitTransition=r.transitions.create("opacity",H),_.style.transition=r.transitions.create("opacity",H),p&&p(_,J)}),Z=N(C),G=N(B),te=N(_=>{const J=ki({style:y,timeout:O,easing:u},{mode:"exit"});_.style.webkitTransition=r.transitions.create("opacity",J),_.style.transition=r.transitions.create("opacity",J),E&&E(_)}),le=N(m),ie=_=>{s&&s(S.current,_)};return f.jsx(R,z({appear:l,in:g,nodeRef:S,onEnter:X,onEntered:Z,onEntering:F,onExit:te,onExited:le,onExiting:G,addEndListener:ie,timeout:O},w,{children:(_,J)=>k.cloneElement(A,z({style:z({opacity:0,visibility:_==="exited"&&!g?"hidden":void 0},H2[_],y,A.props.style),ref:P},J))}))});process.env.NODE_ENV!=="production"&&(m0.propTypes={addEndListener:c.func,appear:c.bool,children:ci.isRequired,easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const W2=m0;function z2(e){return Ft("MuiBackdrop",e)}Wt("MuiBackdrop",["root","invisible"]);const U2=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],Y2=e=>{const{classes:t,invisible:n}=e;return an({root:["root",n&&"invisible"]},z2,t)},G2=ce("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>z({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),B0=k.forwardRef(function(t,n){var r,i,s;const l=zt({props:t,name:"MuiBackdrop"}),{children:A,className:u,component:g="div",components:p={},componentsProps:C={},invisible:h=!1,open:E,slotProps:m={},slots:B={},TransitionComponent:y=W2,transitionDuration:O}=l,R=Ke(l,U2),w=z({},l,{component:g,invisible:h}),S=Y2(w),P=(r=m.root)!=null?r:C.root;return f.jsx(y,z({in:E,timeout:O},R,{children:f.jsx(G2,z({"aria-hidden":!0},P,{as:(i=(s=B.root)!=null?s:p.Root)!=null?i:g,className:Xe(S.root,u,P==null?void 0:P.className),ownerState:z({},w,P==null?void 0:P.ownerState),classes:S,ref:n,children:A}))}))});process.env.NODE_ENV!=="production"&&(B0.propTypes={children:c.node,classes:c.object,className:c.string,component:c.elementType,components:c.shape({Root:c.elementType}),componentsProps:c.shape({root:c.object}),invisible:c.bool,open:c.bool.isRequired,slotProps:c.shape({root:c.object}),slots:c.shape({root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),TransitionComponent:c.elementType,transitionDuration:c.oneOfType([c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])});const K2=B0;function J2(e){return Ft("MuiModal",e)}Wt("MuiModal",["root","hidden","backdrop"]);const X2=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],Z2=e=>{const{open:t,exited:n,classes:r}=e;return an({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},J2,r)},q2=ce("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>z({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),_2=ce(K2,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),v0=k.forwardRef(function(t,n){var r,i,s,l,A,u;const g=zt({name:"MuiModal",props:t}),{BackdropComponent:p=_2,BackdropProps:C,className:h,closeAfterTransition:E=!1,children:m,container:B,component:y,components:O={},componentsProps:R={},disableAutoFocus:w=!1,disableEnforceFocus:S=!1,disableEscapeKeyDown:P=!1,disablePortal:N=!1,disableRestoreFocus:F=!1,disableScrollLock:X=!1,hideBackdrop:Z=!1,keepMounted:G=!1,onBackdropClick:te,open:le,slotProps:ie,slots:_}=g,J=Ke(g,X2),H=z({},g,{closeAfterTransition:E,disableAutoFocus:w,disableEnforceFocus:S,disableEscapeKeyDown:P,disablePortal:N,disableRestoreFocus:F,disableScrollLock:X,hideBackdrop:Z,keepMounted:G}),{getRootProps:K,getBackdropProps:L,getTransitionProps:ee,portalRef:U,isTopModal:q,exited:de,hasTransition:fe}=j2(z({},H,{rootRef:n})),Ae=z({},H,{exited:de}),ue=Z2(Ae),pe={};if(m.props.tabIndex===void 0&&(pe.tabIndex="-1"),fe){const{onEnter:ze,onExited:ge}=ee();pe.onEnter=ze,pe.onExited=ge}const ve=(r=(i=_==null?void 0:_.root)!=null?i:O.Root)!=null?r:q2,me=(s=(l=_==null?void 0:_.backdrop)!=null?l:O.Backdrop)!=null?s:p,he=(A=ie==null?void 0:ie.root)!=null?A:R.root,Be=(u=ie==null?void 0:ie.backdrop)!=null?u:R.backdrop,we=dr.useSlotProps({elementType:ve,externalSlotProps:he,externalForwardedProps:J,getSlotProps:K,additionalProps:{ref:n,as:y},ownerState:Ae,className:Xe(h,he==null?void 0:he.className,ue==null?void 0:ue.root,!Ae.open&&Ae.exited&&(ue==null?void 0:ue.hidden))}),ae=dr.useSlotProps({elementType:me,externalSlotProps:Be,additionalProps:C,getSlotProps:ze=>L(z({},ze,{onClick:ge=>{te&&te(ge),ze!=null&&ze.onClick&&ze.onClick(ge)}})),className:Xe(Be==null?void 0:Be.className,C==null?void 0:C.className,ue==null?void 0:ue.backdrop),ownerState:Ae});return!G&&!le&&(!fe||de)?null:f.jsx(Xs,{ref:U,container:B,disablePortal:N,children:f.jsxs(ve,z({},we,{children:[!Z&&p?f.jsx(me,z({},ae)):null,f.jsx(tc,{disableEnforceFocus:S,disableAutoFocus:w,disableRestoreFocus:F,isEnabled:q,open:le,children:k.cloneElement(m,pe)})]}))})});process.env.NODE_ENV!=="production"&&(v0.propTypes={BackdropComponent:c.elementType,BackdropProps:c.object,children:ci.isRequired,classes:c.object,className:c.string,closeAfterTransition:c.bool,component:c.elementType,components:c.shape({Backdrop:c.elementType,Root:c.elementType}),componentsProps:c.shape({backdrop:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),container:c.oneOfType([wo,c.func]),disableAutoFocus:c.bool,disableEnforceFocus:c.bool,disableEscapeKeyDown:c.bool,disablePortal:c.bool,disableRestoreFocus:c.bool,disableScrollLock:c.bool,hideBackdrop:c.bool,keepMounted:c.bool,onBackdropClick:c.func,onClose:c.func,onTransitionEnter:c.func,onTransitionExited:c.func,open:c.bool.isRequired,slotProps:c.shape({backdrop:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),slots:c.shape({backdrop:c.elementType,root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object])});const $2=v0;var lg={},e5=tg;Object.defineProperty(lg,"__esModule",{value:!0});var y0=lg.default=void 0,t5=e5(rg()),n5=f,r5=(0,t5.default)((0,n5.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}),"History");y0=lg.default=r5;var cg={},o5=tg;Object.defineProperty(cg,"__esModule",{value:!0});var b0=cg.default=void 0,i5=o5(rg()),s5=f,a5=(0,i5.default)((0,s5.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");b0=cg.default=a5;var l5=function(e){var t=e.children,n=e.editor,r=e.preferenceKey,i=e.openButtonLabel,s=i===void 0?"ra.configurable.customize":i,l=e.sx,A="preferences.".concat(r),u=Ce.usePreferencesEditor(),g=!!u,p=Ce.useTranslate(),C=u||{},h=C.isEnabled,E=C.setEditor,m=C.preferenceKey,B=C.setPreferenceKey,y=A===m,O=x.useRef(y),R=x.useRef(null),w=x.useState(!1),S=w[0],P=w[1];if(x.useEffect(function(){O.current=y},[y]),x.useEffect(function(){return function(){O.current&&(B&&B(null),E&&E(null))}},[E,B]),!g)return t;var N=function(){E(x.cloneElement(n,{preferenceKey:A,key:A})),B(A)},F=function(){P(!0)},X=function(){P(!1)};return k.createElement(Ce.PreferenceKeyContextProvider,{value:A},k.createElement(c5,{className:d0(kr.root,h&&kr.editMode,y&&kr.editorActive),sx:l,ref:R,onMouseEnter:h?F:void 0,onMouseLeave:h?X:void 0},t),k.createElement(b.Popover,{open:h&&(S||y),sx:{pointerEvents:"none","& .MuiPaper-root":{pointerEvents:"auto",borderRadius:10,padding:"2px",lineHeight:0,backgroundColor:"warning.light",color:"warning.contrastText","&:hover":{cursor:"pointer"}}},anchorEl:R.current,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"center"},onClose:X,PaperProps:{elevation:1,onMouseEnter:F,onMouseLeave:X,title:p(s),onClick:N},disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,disableScrollLock:!0,marginThreshold:8},k.createElement(b0,{fontSize:"12px"})))},nc="RaConfigurable",kr={root:"".concat(nc,"-root"),editMode:"".concat(nc,"-editMode"),editorActive:"".concat(nc,"-editorActive")},c5=ce("span",{name:nc,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={position:"relative",display:"inline-block"},t["&.".concat(kr.editMode)]={transition:n.transitions.create("outline"),outline:"".concat(b.alpha(n.palette.warning.main,.3)," solid 2px")},t["&.".concat(kr.editMode,":hover ")]={outline:"".concat(b.alpha(n.palette.warning.main,.5)," solid 2px")},t["&.".concat(kr.editMode,".").concat(kr.editorActive," , &.").concat(kr.editMode,".").concat(kr.editorActive,":hover ")]={outline:"".concat(n.palette.warning.main," solid 2px")},t}),Vo=globalThis&&globalThis.__assign||function(){return Vo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Vo.apply(this,arguments)},A5=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},u5=function(e){var t=e.title,n=e.defaultTitle,r=e.className,i=A5(e,["title","defaultTitle","className"]),s=Ce.usePreference()[0],l=Ce.useTranslate(),A=Ce.useRecordContext();return s?k.createElement("span",Vo({className:r},i),l(s,Vo(Vo({},A),{_:s}))):k.createElement("span",{className:r},t?typeof t=="string"?k.createElement("span",Vo({},i),l(t,{_:t})):t:k.createElement("span",Vo({},i),n))},rc=globalThis&&globalThis.__assign||function(){return rc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},rc.apply(this,arguments)},d5=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},g5=function(){var e=Ce.usePreferenceInput();return k.createElement("form",null,k.createElement(b.TextField,rc({label:"title",variant:"filled",size:"small",fullWidth:!0,sx:{mb:1}},e)))},f5=function(e){var t=e.preferenceKey,n=d5(e,["preferenceKey"]),r=Bt.useLocation().pathname;return k.createElement(l5,{editor:k.createElement(g5,null),preferenceKey:t||"".concat(r,".title"),sx:{"&.RaConfigurable-editMode":{margin:"2px"}}},k.createElement(u5,rc({},n)))},Ag=globalThis&&globalThis.__assign||function(){return Ag=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ag.apply(this,arguments)},p5=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Q0=function(e){var t=e.defaultTitle,n=e.title,r=e.preferenceKey,i=p5(e,["defaultTitle","title","preferenceKey"]),s=x.useState(function(){return typeof document<"u"?document.getElementById("react-admin-title"):null}),l=s[0],A=s[1];return x.useEffect(function(){A(function(u){var g=typeof document<"u"&&document.body.contains(u);return u&&g?u:typeof document<"u"?document.getElementById("react-admin-title"):null})},[]),l?(Ce.warning(!t&&!n,"Missing title prop in <Title> element"),ai.createPortal(k.createElement(f5,Ag({title:n,defaultTitle:t,preferenceKey:r},i)),l)):null},x0=c.oneOfType([c.string,c.element]);Q0.propTypes={defaultTitle:c.string,className:c.string,record:c.any,title:x0};var h5=function(e){var t=hs.useLocation().pathname,n=x.useRef(t);x.useEffect(function(){t!==n.current&&e()},[t,e])},C5=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),t.length!==n.length||t.some(function(r,i){return!Object.is(r,n[i])})},w0={error:null},I5=function(e){ad(t,e);function t(){for(var r,i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];return r=e.call.apply(e,[this].concat(s))||this,r.state=w0,r.resetErrorBoundary=function(){for(var A,u=arguments.length,g=new Array(u),p=0;p<u;p++)g[p]=arguments[p];r.props.onReset==null||(A=r.props).onReset.apply(A,g),r.reset()},r}t.getDerivedStateFromError=function(i){return{error:i}};var n=t.prototype;return n.reset=function(){this.setState(w0)},n.componentDidCatch=function(i,s){var l,A;(l=(A=this.props).onError)==null||l.call(A,i,s)},n.componentDidUpdate=function(i,s){var l=this.state.error,A=this.props.resetKeys;if(l!==null&&s.error!==null&&C5(i.resetKeys,A)){var u,g;(u=(g=this.props).onResetKeysChange)==null||u.call(g,i.resetKeys,A),this.reset()}},n.render=function(){var i=this.state.error,s=this.props,l=s.fallbackRender,A=s.FallbackComponent,u=s.fallback;if(i!==null){var g={error:i,resetErrorBoundary:this.resetErrorBoundary};if(k.isValidElement(u))return u;if(typeof l=="function")return l(g);if(A)return k.createElement(A,g);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(k.Component),ug=globalThis&&globalThis.__assign||function(){return ug=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ug.apply(this,arguments)},E5=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},T0=function(e){var t=e.className,n=e.loadingPrimary,r=n===void 0?"ra.page.loading":n,i=e.loadingSecondary,s=i===void 0?"ra.message.loading":i,l=E5(e,["className","loadingPrimary","loadingSecondary"]),A=Ce.useTimeout(1e3),u=Ce.useTranslate();return A?k.createElement(m5,ug({className:t},l),k.createElement("div",{className:ic.message},k.createElement(pd,{className:ic.icon}),k.createElement(b.Typography,{variant:"h5",mt:3,color:"text.secondary"},u(r,{_:r})),k.createElement(b.Typography,{variant:"body2"},u(s,{_:s})))):null};T0.propTypes={className:c.string,loadingPrimary:c.string,loadingSecondary:c.string};var oc="RaLoading",ic={root:"".concat(oc,"-root"),icon:"".concat(oc,"-icon"),message:"".concat(oc,"-message")},m5=ce("div",{name:oc,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100%"},t["& .".concat(ic.message)]={textAlign:"center",fontFamily:"Roboto, sans-serif",color:n.palette.text.disabled,paddingTop:"1em",paddingBottom:"1em"},t["& .".concat(ic.icon)]={width:"9em",height:"9em"},t}),dg={},B5=tg;Object.defineProperty(dg,"__esModule",{value:!0});var P0=dg.default=void 0,v5=B5(rg()),y5=f,b5=(0,v5.default)((0,y5.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");P0=dg.default=b5;const Q5=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function gg(e){return`scale(${e}, ${e**2})`}const x5={entering:{opacity:1,transform:gg(1)},entered:{opacity:1,transform:"none"}},fg=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),pg=k.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:s,easing:l,in:A,onEnter:u,onEntered:g,onEntering:p,onExit:C,onExited:h,onExiting:E,style:m,timeout:B="auto",TransitionComponent:y=cd}=t,O=Ke(t,Q5),R=k.useRef(),w=k.useRef(),S=xt(),P=k.useRef(null),N=yn(P,s.ref,n),F=J=>H=>{if(J){const K=P.current;H===void 0?J(K):J(K,H)}},X=F(p),Z=F((J,H)=>{sg(J);const{duration:K,delay:L,easing:ee}=ki({style:m,timeout:B,easing:l},{mode:"enter"});let U;B==="auto"?(U=S.transitions.getAutoHeightDuration(J.clientHeight),w.current=U):U=K,J.style.transition=[S.transitions.create("opacity",{duration:U,delay:L}),S.transitions.create("transform",{duration:fg?U:U*.666,delay:L,easing:ee})].join(","),u&&u(J,H)}),G=F(g),te=F(E),le=F(J=>{const{duration:H,delay:K,easing:L}=ki({style:m,timeout:B,easing:l},{mode:"exit"});let ee;B==="auto"?(ee=S.transitions.getAutoHeightDuration(J.clientHeight),w.current=ee):ee=H,J.style.transition=[S.transitions.create("opacity",{duration:ee,delay:K}),S.transitions.create("transform",{duration:fg?ee:ee*.666,delay:fg?K:K||ee*.333,easing:L})].join(","),J.style.opacity=0,J.style.transform=gg(.75),C&&C(J)}),ie=F(h),_=J=>{B==="auto"&&(R.current=setTimeout(J,w.current||0)),r&&r(P.current,J)};return k.useEffect(()=>()=>{clearTimeout(R.current)},[]),f.jsx(y,z({appear:i,in:A,nodeRef:P,onEnter:Z,onEntered:G,onEntering:X,onExit:le,onExited:ie,onExiting:te,addEndListener:_,timeout:B==="auto"?null:B},O,{children:(J,H)=>k.cloneElement(s,z({style:z({opacity:0,transform:gg(.75),visibility:J==="exited"&&!A?"hidden":void 0},x5[J],m,s.props.style),ref:N},H))}))});process.env.NODE_ENV!=="production"&&(pg.propTypes={addEndListener:c.func,appear:c.bool,children:ci.isRequired,easing:c.oneOfType([c.shape({enter:c.string,exit:c.string}),c.string]),in:c.bool,onEnter:c.func,onEntered:c.func,onEntering:c.func,onExit:c.func,onExited:c.func,onExiting:c.func,style:c.object,timeout:c.oneOfType([c.oneOf(["auto"]),c.number,c.shape({appear:c.number,enter:c.number,exit:c.number})])}),pg.muiSupportAuto=!0;const S0=pg;var fn="top",zn="bottom",Un="right",pn="left",hg="auto",Zs=[fn,zn,Un,pn],Fi="start",qs="end",w5="clippingParents",O0="viewport",_s="popper",T5="reference",j0=Zs.reduce(function(e,t){return e.concat([t+"-"+Fi,t+"-"+qs])},[]),M0=[].concat(Zs,[hg]).reduce(function(e,t){return e.concat([t,t+"-"+Fi,t+"-"+qs])},[]),P5="beforeRead",S5="read",O5="afterRead",j5="beforeMain",M5="main",D5="afterMain",R5="beforeWrite",k5="write",F5="afterWrite",L5=[P5,S5,O5,j5,M5,D5,R5,k5,F5];function Ir(e){return e?(e.nodeName||"").toLowerCase():null}function wn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ho(e){var t=wn(e).Element;return e instanceof t||e instanceof Element}function Yn(e){var t=wn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Cg(e){if(typeof ShadowRoot>"u")return!1;var t=wn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function N5(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},s=t.elements[n];!Yn(s)||!Ir(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(l){var A=i[l];A===!1?s.removeAttribute(l):s.setAttribute(l,A===!0?"":A)}))})}function V5(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],s=t.attributes[r]||{},l=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),A=l.reduce(function(u,g){return u[g]="",u},{});!Yn(i)||!Ir(i)||(Object.assign(i.style,A),Object.keys(s).forEach(function(u){i.removeAttribute(u)}))})}}const H5={name:"applyStyles",enabled:!0,phase:"write",fn:N5,effect:V5,requires:["computeStyles"]};function Er(e){return e.split("-")[0]}var Wo=Math.max,sc=Math.min,Li=Math.round;function Ig(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function D0(){return!/^((?!chrome|android).)*safari/i.test(Ig())}function Ni(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,s=1;t&&Yn(e)&&(i=e.offsetWidth>0&&Li(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Li(r.height)/e.offsetHeight||1);var l=Ho(e)?wn(e):window,A=l.visualViewport,u=!D0()&&n,g=(r.left+(u&&A?A.offsetLeft:0))/i,p=(r.top+(u&&A?A.offsetTop:0))/s,C=r.width/i,h=r.height/s;return{width:C,height:h,top:p,right:g+C,bottom:p+h,left:g,x:g,y:p}}function Eg(e){var t=Ni(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function R0(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Cg(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Fr(e){return wn(e).getComputedStyle(e)}function W5(e){return["table","td","th"].indexOf(Ir(e))>=0}function lo(e){return((Ho(e)?e.ownerDocument:e.document)||window.document).documentElement}function ac(e){return Ir(e)==="html"?e:e.assignedSlot||e.parentNode||(Cg(e)?e.host:null)||lo(e)}function k0(e){return!Yn(e)||Fr(e).position==="fixed"?null:e.offsetParent}function z5(e){var t=/firefox/i.test(Ig()),n=/Trident/i.test(Ig());if(n&&Yn(e)){var r=Fr(e);if(r.position==="fixed")return null}var i=ac(e);for(Cg(i)&&(i=i.host);Yn(i)&&["html","body"].indexOf(Ir(i))<0;){var s=Fr(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function $s(e){for(var t=wn(e),n=k0(e);n&&W5(n)&&Fr(n).position==="static";)n=k0(n);return n&&(Ir(n)==="html"||Ir(n)==="body"&&Fr(n).position==="static")?t:n||z5(e)||t}function mg(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ea(e,t,n){return Wo(e,sc(t,n))}function U5(e,t,n){var r=ea(e,t,n);return r>n?n:r}function F0(){return{top:0,right:0,bottom:0,left:0}}function L0(e){return Object.assign({},F0(),e)}function N0(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var Y5=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,L0(typeof t!="number"?t:N0(t,Zs))};function G5(e){var t,n=e.state,r=e.name,i=e.options,s=n.elements.arrow,l=n.modifiersData.popperOffsets,A=Er(n.placement),u=mg(A),g=[pn,Un].indexOf(A)>=0,p=g?"height":"width";if(!(!s||!l)){var C=Y5(i.padding,n),h=Eg(s),E=u==="y"?fn:pn,m=u==="y"?zn:Un,B=n.rects.reference[p]+n.rects.reference[u]-l[u]-n.rects.popper[p],y=l[u]-n.rects.reference[u],O=$s(s),R=O?u==="y"?O.clientHeight||0:O.clientWidth||0:0,w=B/2-y/2,S=C[E],P=R-h[p]-C[m],N=R/2-h[p]/2+w,F=ea(S,N,P),X=u;n.modifiersData[r]=(t={},t[X]=F,t.centerOffset=F-N,t)}}function K5(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||R0(t.elements.popper,i)&&(t.elements.arrow=i))}const J5={name:"arrow",enabled:!0,phase:"main",fn:G5,effect:K5,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Vi(e){return e.split("-")[1]}var X5={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Z5(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Li(n*i)/i||0,y:Li(r*i)/i||0}}function V0(e){var t,n=e.popper,r=e.popperRect,i=e.placement,s=e.variation,l=e.offsets,A=e.position,u=e.gpuAcceleration,g=e.adaptive,p=e.roundOffsets,C=e.isFixed,h=l.x,E=h===void 0?0:h,m=l.y,B=m===void 0?0:m,y=typeof p=="function"?p({x:E,y:B}):{x:E,y:B};E=y.x,B=y.y;var O=l.hasOwnProperty("x"),R=l.hasOwnProperty("y"),w=pn,S=fn,P=window;if(g){var N=$s(n),F="clientHeight",X="clientWidth";if(N===wn(n)&&(N=lo(n),Fr(N).position!=="static"&&A==="absolute"&&(F="scrollHeight",X="scrollWidth")),N=N,i===fn||(i===pn||i===Un)&&s===qs){S=zn;var Z=C&&N===P&&P.visualViewport?P.visualViewport.height:N[F];B-=Z-r.height,B*=u?1:-1}if(i===pn||(i===fn||i===zn)&&s===qs){w=Un;var G=C&&N===P&&P.visualViewport?P.visualViewport.width:N[X];E-=G-r.width,E*=u?1:-1}}var te=Object.assign({position:A},g&&X5),le=p===!0?Z5({x:E,y:B},wn(n)):{x:E,y:B};if(E=le.x,B=le.y,u){var ie;return Object.assign({},te,(ie={},ie[S]=R?"0":"",ie[w]=O?"0":"",ie.transform=(P.devicePixelRatio||1)<=1?"translate("+E+"px, "+B+"px)":"translate3d("+E+"px, "+B+"px, 0)",ie))}return Object.assign({},te,(t={},t[S]=R?B+"px":"",t[w]=O?E+"px":"",t.transform="",t))}function q5(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,l=s===void 0?!0:s,A=n.roundOffsets,u=A===void 0?!0:A,g={placement:Er(t.placement),variation:Vi(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,V0(Object.assign({},g,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,V0(Object.assign({},g,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const _5={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:q5,data:{}};var lc={passive:!0};function $5(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,s=i===void 0?!0:i,l=r.resize,A=l===void 0?!0:l,u=wn(t.elements.popper),g=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&g.forEach(function(p){p.addEventListener("scroll",n.update,lc)}),A&&u.addEventListener("resize",n.update,lc),function(){s&&g.forEach(function(p){p.removeEventListener("scroll",n.update,lc)}),A&&u.removeEventListener("resize",n.update,lc)}}const ek={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:$5,data:{}};var tk={left:"right",right:"left",bottom:"top",top:"bottom"};function cc(e){return e.replace(/left|right|bottom|top/g,function(t){return tk[t]})}var nk={start:"end",end:"start"};function H0(e){return e.replace(/start|end/g,function(t){return nk[t]})}function Bg(e){var t=wn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function vg(e){return Ni(lo(e)).left+Bg(e).scrollLeft}function rk(e,t){var n=wn(e),r=lo(e),i=n.visualViewport,s=r.clientWidth,l=r.clientHeight,A=0,u=0;if(i){s=i.width,l=i.height;var g=D0();(g||!g&&t==="fixed")&&(A=i.offsetLeft,u=i.offsetTop)}return{width:s,height:l,x:A+vg(e),y:u}}function ok(e){var t,n=lo(e),r=Bg(e),i=(t=e.ownerDocument)==null?void 0:t.body,s=Wo(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),l=Wo(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),A=-r.scrollLeft+vg(e),u=-r.scrollTop;return Fr(i||n).direction==="rtl"&&(A+=Wo(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:l,x:A,y:u}}function yg(e){var t=Fr(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function W0(e){return["html","body","#document"].indexOf(Ir(e))>=0?e.ownerDocument.body:Yn(e)&&yg(e)?e:W0(ac(e))}function ta(e,t){var n;t===void 0&&(t=[]);var r=W0(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),s=wn(r),l=i?[s].concat(s.visualViewport||[],yg(r)?r:[]):r,A=t.concat(l);return i?A:A.concat(ta(ac(l)))}function bg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ik(e,t){var n=Ni(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function z0(e,t,n){return t===O0?bg(rk(e,n)):Ho(t)?ik(t,n):bg(ok(lo(e)))}function sk(e){var t=ta(ac(e)),n=["absolute","fixed"].indexOf(Fr(e).position)>=0,r=n&&Yn(e)?$s(e):e;return Ho(r)?t.filter(function(i){return Ho(i)&&R0(i,r)&&Ir(i)!=="body"}):[]}function ak(e,t,n,r){var i=t==="clippingParents"?sk(e):[].concat(t),s=[].concat(i,[n]),l=s[0],A=s.reduce(function(u,g){var p=z0(e,g,r);return u.top=Wo(p.top,u.top),u.right=sc(p.right,u.right),u.bottom=sc(p.bottom,u.bottom),u.left=Wo(p.left,u.left),u},z0(e,l,r));return A.width=A.right-A.left,A.height=A.bottom-A.top,A.x=A.left,A.y=A.top,A}function U0(e){var t=e.reference,n=e.element,r=e.placement,i=r?Er(r):null,s=r?Vi(r):null,l=t.x+t.width/2-n.width/2,A=t.y+t.height/2-n.height/2,u;switch(i){case fn:u={x:l,y:t.y-n.height};break;case zn:u={x:l,y:t.y+t.height};break;case Un:u={x:t.x+t.width,y:A};break;case pn:u={x:t.x-n.width,y:A};break;default:u={x:t.x,y:t.y}}var g=i?mg(i):null;if(g!=null){var p=g==="y"?"height":"width";switch(s){case Fi:u[g]=u[g]-(t[p]/2-n[p]/2);break;case qs:u[g]=u[g]+(t[p]/2-n[p]/2);break}}return u}function na(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,s=n.strategy,l=s===void 0?e.strategy:s,A=n.boundary,u=A===void 0?w5:A,g=n.rootBoundary,p=g===void 0?O0:g,C=n.elementContext,h=C===void 0?_s:C,E=n.altBoundary,m=E===void 0?!1:E,B=n.padding,y=B===void 0?0:B,O=L0(typeof y!="number"?y:N0(y,Zs)),R=h===_s?T5:_s,w=e.rects.popper,S=e.elements[m?R:h],P=ak(Ho(S)?S:S.contextElement||lo(e.elements.popper),u,p,l),N=Ni(e.elements.reference),F=U0({reference:N,element:w,strategy:"absolute",placement:i}),X=bg(Object.assign({},w,F)),Z=h===_s?X:N,G={top:P.top-Z.top+O.top,bottom:Z.bottom-P.bottom+O.bottom,left:P.left-Z.left+O.left,right:Z.right-P.right+O.right},te=e.modifiersData.offset;if(h===_s&&te){var le=te[i];Object.keys(G).forEach(function(ie){var _=[Un,zn].indexOf(ie)>=0?1:-1,J=[fn,zn].indexOf(ie)>=0?"y":"x";G[ie]+=le[J]*_})}return G}function lk(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,s=n.rootBoundary,l=n.padding,A=n.flipVariations,u=n.allowedAutoPlacements,g=u===void 0?M0:u,p=Vi(r),C=p?A?j0:j0.filter(function(m){return Vi(m)===p}):Zs,h=C.filter(function(m){return g.indexOf(m)>=0});h.length===0&&(h=C);var E=h.reduce(function(m,B){return m[B]=na(e,{placement:B,boundary:i,rootBoundary:s,padding:l})[Er(B)],m},{});return Object.keys(E).sort(function(m,B){return E[m]-E[B]})}function ck(e){if(Er(e)===hg)return[];var t=cc(e);return[H0(e),t,H0(t)]}function Ak(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,l=n.altAxis,A=l===void 0?!0:l,u=n.fallbackPlacements,g=n.padding,p=n.boundary,C=n.rootBoundary,h=n.altBoundary,E=n.flipVariations,m=E===void 0?!0:E,B=n.allowedAutoPlacements,y=t.options.placement,O=Er(y),R=O===y,w=u||(R||!m?[cc(y)]:ck(y)),S=[y].concat(w).reduce(function(Ae,ue){return Ae.concat(Er(ue)===hg?lk(t,{placement:ue,boundary:p,rootBoundary:C,padding:g,flipVariations:m,allowedAutoPlacements:B}):ue)},[]),P=t.rects.reference,N=t.rects.popper,F=new Map,X=!0,Z=S[0],G=0;G<S.length;G++){var te=S[G],le=Er(te),ie=Vi(te)===Fi,_=[fn,zn].indexOf(le)>=0,J=_?"width":"height",H=na(t,{placement:te,boundary:p,rootBoundary:C,altBoundary:h,padding:g}),K=_?ie?Un:pn:ie?zn:fn;P[J]>N[J]&&(K=cc(K));var L=cc(K),ee=[];if(s&&ee.push(H[le]<=0),A&&ee.push(H[K]<=0,H[L]<=0),ee.every(function(Ae){return Ae})){Z=te,X=!1;break}F.set(te,ee)}if(X)for(var U=m?3:1,q=function(ue){var pe=S.find(function(ve){var me=F.get(ve);if(me)return me.slice(0,ue).every(function(he){return he})});if(pe)return Z=pe,"break"},de=U;de>0;de--){var fe=q(de);if(fe==="break")break}t.placement!==Z&&(t.modifiersData[r]._skip=!0,t.placement=Z,t.reset=!0)}}const uk={name:"flip",enabled:!0,phase:"main",fn:Ak,requiresIfExists:["offset"],data:{_skip:!1}};function Y0(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function G0(e){return[fn,Un,zn,pn].some(function(t){return e[t]>=0})}function dk(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,s=t.modifiersData.preventOverflow,l=na(t,{elementContext:"reference"}),A=na(t,{altBoundary:!0}),u=Y0(l,r),g=Y0(A,i,s),p=G0(u),C=G0(g);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:g,isReferenceHidden:p,hasPopperEscaped:C},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":C})}const gk={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:dk};function fk(e,t,n){var r=Er(e),i=[pn,fn].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=s[0],A=s[1];return l=l||0,A=(A||0)*i,[pn,Un].indexOf(r)>=0?{x:A,y:l}:{x:l,y:A}}function pk(e){var t=e.state,n=e.options,r=e.name,i=n.offset,s=i===void 0?[0,0]:i,l=M0.reduce(function(p,C){return p[C]=fk(C,t.rects,s),p},{}),A=l[t.placement],u=A.x,g=A.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=g),t.modifiersData[r]=l}const hk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:pk};function Ck(e){var t=e.state,n=e.name;t.modifiersData[n]=U0({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Ik={name:"popperOffsets",enabled:!0,phase:"read",fn:Ck,data:{}};function Ek(e){return e==="x"?"y":"x"}function mk(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,s=i===void 0?!0:i,l=n.altAxis,A=l===void 0?!1:l,u=n.boundary,g=n.rootBoundary,p=n.altBoundary,C=n.padding,h=n.tether,E=h===void 0?!0:h,m=n.tetherOffset,B=m===void 0?0:m,y=na(t,{boundary:u,rootBoundary:g,padding:C,altBoundary:p}),O=Er(t.placement),R=Vi(t.placement),w=!R,S=mg(O),P=Ek(S),N=t.modifiersData.popperOffsets,F=t.rects.reference,X=t.rects.popper,Z=typeof B=="function"?B(Object.assign({},t.rects,{placement:t.placement})):B,G=typeof Z=="number"?{mainAxis:Z,altAxis:Z}:Object.assign({mainAxis:0,altAxis:0},Z),te=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,le={x:0,y:0};if(N){if(s){var ie,_=S==="y"?fn:pn,J=S==="y"?zn:Un,H=S==="y"?"height":"width",K=N[S],L=K+y[_],ee=K-y[J],U=E?-X[H]/2:0,q=R===Fi?F[H]:X[H],de=R===Fi?-X[H]:-F[H],fe=t.elements.arrow,Ae=E&&fe?Eg(fe):{width:0,height:0},ue=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:F0(),pe=ue[_],ve=ue[J],me=ea(0,F[H],Ae[H]),he=w?F[H]/2-U-me-pe-G.mainAxis:q-me-pe-G.mainAxis,Be=w?-F[H]/2+U+me+ve+G.mainAxis:de+me+ve+G.mainAxis,we=t.elements.arrow&&$s(t.elements.arrow),ae=we?S==="y"?we.clientTop||0:we.clientLeft||0:0,ze=(ie=te==null?void 0:te[S])!=null?ie:0,ge=K+he-ze-ae,At=K+Be-ze,Ut=ea(E?sc(L,ge):L,K,E?Wo(ee,At):ee);N[S]=Ut,le[S]=Ut-K}if(A){var It,Tt=S==="x"?fn:pn,Br=S==="x"?zn:Un,bt=N[P],Et=P==="y"?"height":"width",dt=bt+y[Tt],Nt=bt-y[Br],Vt=[fn,pn].indexOf(O)!==-1,Oe=(It=te==null?void 0:te[P])!=null?It:0,Fe=Vt?dt:bt-F[Et]-X[Et]-Oe+G.altAxis,Te=Vt?bt+F[Et]+X[Et]-Oe-G.altAxis:Nt,Ue=E&&Vt?U5(Fe,bt,Te):ea(E?Fe:dt,bt,E?Te:Nt);N[P]=Ue,le[P]=Ue-bt}t.modifiersData[r]=le}}const Bk={name:"preventOverflow",enabled:!0,phase:"main",fn:mk,requiresIfExists:["offset"]};function vk(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function yk(e){return e===wn(e)||!Yn(e)?Bg(e):vk(e)}function bk(e){var t=e.getBoundingClientRect(),n=Li(t.width)/e.offsetWidth||1,r=Li(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Qk(e,t,n){n===void 0&&(n=!1);var r=Yn(t),i=Yn(t)&&bk(t),s=lo(t),l=Ni(e,i,n),A={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Ir(t)!=="body"||yg(s))&&(A=yk(t)),Yn(t)?(u=Ni(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=vg(s))),{x:l.left+A.scrollLeft-u.x,y:l.top+A.scrollTop-u.y,width:l.width,height:l.height}}function xk(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function i(s){n.add(s.name);var l=[].concat(s.requires||[],s.requiresIfExists||[]);l.forEach(function(A){if(!n.has(A)){var u=t.get(A);u&&i(u)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||i(s)}),r}function wk(e){var t=xk(e);return L5.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function Tk(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Pk(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var K0={placement:"bottom",modifiers:[],strategy:"absolute"};function J0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Sk(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,i=t.defaultOptions,s=i===void 0?K0:i;return function(A,u,g){g===void 0&&(g=s);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},K0,s),modifiersData:{},elements:{reference:A,popper:u},attributes:{},styles:{}},C=[],h=!1,E={state:p,setOptions:function(O){var R=typeof O=="function"?O(p.options):O;B(),p.options=Object.assign({},s,p.options,R),p.scrollParents={reference:Ho(A)?ta(A):A.contextElement?ta(A.contextElement):[],popper:ta(u)};var w=wk(Pk([].concat(r,p.options.modifiers)));return p.orderedModifiers=w.filter(function(S){return S.enabled}),m(),E.update()},forceUpdate:function(){if(!h){var O=p.elements,R=O.reference,w=O.popper;if(J0(R,w)){p.rects={reference:Qk(R,$s(w),p.options.strategy==="fixed"),popper:Eg(w)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(G){return p.modifiersData[G.name]=Object.assign({},G.data)});for(var S=0;S<p.orderedModifiers.length;S++){if(p.reset===!0){p.reset=!1,S=-1;continue}var P=p.orderedModifiers[S],N=P.fn,F=P.options,X=F===void 0?{}:F,Z=P.name;typeof N=="function"&&(p=N({state:p,options:X,name:Z,instance:E})||p)}}}},update:Tk(function(){return new Promise(function(y){E.forceUpdate(),y(p)})}),destroy:function(){B(),h=!0}};if(!J0(A,u))return E;E.setOptions(g).then(function(y){!h&&g.onFirstUpdate&&g.onFirstUpdate(y)});function m(){p.orderedModifiers.forEach(function(y){var O=y.name,R=y.options,w=R===void 0?{}:R,S=y.effect;if(typeof S=="function"){var P=S({state:p,name:O,instance:E,options:w}),N=function(){};C.push(P||N)}})}function B(){C.forEach(function(y){return y()}),C=[]}return E}}var Ok=[ek,Ik,_5,H5,hk,uk,Bk,J5,gk],jk=Sk({defaultModifiers:Ok});function Mk(e){return Ft("MuiPopper",e)}Wt("MuiPopper",["root"]);const Dk=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],Rk=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function kk(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function Ac(e){return typeof e=="function"?e():e}function uc(e){return e.nodeType!==void 0}function Fk(e){return!uc(e)}const Lk=()=>an({root:["root"]},E2(Mk)),Nk={},Vk=k.forwardRef(function(t,n){var r;const{anchorEl:i,children:s,direction:l,disablePortal:A,modifiers:u,open:g,placement:p,popperOptions:C,popperRef:h,slotProps:E={},slots:m={},TransitionProps:B}=t,y=Ke(t,Dk),O=k.useRef(null),R=yn(O,n),w=k.useRef(null),S=yn(w,h),P=k.useRef(S);di(()=>{P.current=S},[S]),k.useImperativeHandle(h,()=>w.current,[]);const N=kk(p,l),[F,X]=k.useState(N),[Z,G]=k.useState(Ac(i));k.useEffect(()=>{w.current&&w.current.forceUpdate()}),k.useEffect(()=>{i&&G(Ac(i))},[i]),di(()=>{if(!Z||!g)return;const J=L=>{X(L.placement)};if(process.env.NODE_ENV!=="production"&&Z&&uc(Z)&&Z.nodeType===1){const L=Z.getBoundingClientRect();process.env.NODE_ENV!=="test"&&L.top===0&&L.left===0&&L.right===0&&L.bottom===0&&console.warn(["MUI: The `anchorEl` prop provided to the component is invalid.","The anchor element should be part of the document layout.","Make sure the element is present in the document or that it's not display none."].join(`
|