@applica-software-guru/react-admin 1.3.147 → 1.3.149
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/ActionsMenu.d.ts.map +1 -1
- package/dist/components/ra-fields/ActionsField.d.ts.map +1 -1
- package/dist/components/ra-forms/LongForm/Tab.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +2 -2
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +172 -170
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +2 -2
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionsMenu.tsx +3 -1
- package/src/components/ra-fields/ActionsField.jsx +0 -1
- package/src/components/ra-forms/LongForm/Tab.tsx +4 -1
package/dist/react-admin.umd.js
CHANGED
|
@@ -67,7 +67,7 @@ const theme2 = createTheme({ palette: {
|
|
|
67
67
|
primary: { main: green[500] },
|
|
68
68
|
} });`:Ci(12,v?` (${v})`:"",JSON.stringify(B.main)));return Hh(B,"light",R,r),Hh(B,"dark",x,r),B.contrastText||(B.contrastText=C(B.main)),B},E={dark:AA,light:Vh};return process.env.NODE_ENV!=="production"&&(E[t]||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),ir(z({common:z({},Ps),mode:t,primary:h({color:s,name:"primary"}),secondary:h({color:l,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:u,name:"error"}),warning:h({color:p,name:"warning"}),info:h({color:A,name:"info"}),success:h({color:g,name:"success"}),grey:Rw,contrastThreshold:n,getContrastText:C,augmentColor:h,tonalOffset:r},E[t]),o)}const zw=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Uw(e){return Math.round(e*1e5)/1e5}const Wh={textTransform:"uppercase"},zh='"Roboto", "Helvetica", "Arial", sans-serif';function Yw(e,t){const n=typeof t=="function"?t(e):t,{fontFamily:r=zh,fontSize:o=14,fontWeightLight:s=300,fontWeightRegular:l=400,fontWeightMedium:u=500,fontWeightBold:A=700,htmlFontSize:g=16,allVariants:p,pxToRem:C}=n,h=Ue(n,zw);process.env.NODE_ENV!=="production"&&(typeof o!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof g!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const E=o/14,m=C||(j=>`${j/g*E}rem`),B=(j,R,x,O,P)=>z({fontFamily:r,fontWeight:j,fontSize:m(R),lineHeight:x},r===zh?{letterSpacing:`${Uw(O/R)}em`}:{},P,p),v={h1:B(s,96,1.167,-1.5),h2:B(s,60,1.2,-.5),h3:B(l,48,1.167,0),h4:B(l,34,1.235,.25),h5:B(l,24,1.334,0),h6:B(u,20,1.6,.15),subtitle1:B(l,16,1.75,.15),subtitle2:B(u,14,1.57,.1),body1:B(l,16,1.5,.15),body2:B(l,14,1.43,.15),button:B(u,14,1.75,.4,Wh),caption:B(l,12,1.66,.4),overline:B(l,12,2.66,1,Wh),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return ir(z({htmlFontSize:g,pxToRem:m,fontFamily:r,fontSize:o,fontWeightLight:s,fontWeightRegular:l,fontWeightMedium:u,fontWeightBold:A},v),h,{clone:!1})}const Gw=.2,Kw=.14,Jw=.12;function bt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Gw})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Kw})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Jw})`].join(",")}const Xw=["none",bt(0,2,1,-1,0,1,1,0,0,1,3,0),bt(0,3,1,-2,0,2,2,0,0,1,5,0),bt(0,3,3,-2,0,3,4,0,0,1,8,0),bt(0,2,4,-1,0,4,5,0,0,1,10,0),bt(0,3,5,-1,0,5,8,0,0,1,14,0),bt(0,3,5,-1,0,6,10,0,0,1,18,0),bt(0,4,5,-2,0,7,10,1,0,2,16,1),bt(0,5,5,-3,0,8,10,1,0,3,14,2),bt(0,5,6,-3,0,9,12,1,0,3,16,2),bt(0,6,6,-3,0,10,14,1,0,4,18,3),bt(0,6,7,-4,0,11,15,1,0,4,20,3),bt(0,7,8,-4,0,12,17,2,0,5,22,4),bt(0,7,8,-4,0,13,19,2,0,5,24,4),bt(0,7,9,-4,0,14,21,2,0,5,26,4),bt(0,8,9,-5,0,15,22,2,0,6,28,5),bt(0,8,10,-5,0,16,24,2,0,6,30,5),bt(0,8,11,-5,0,17,26,2,0,6,32,5),bt(0,9,11,-5,0,18,28,2,0,7,34,6),bt(0,9,12,-6,0,19,29,2,0,7,36,6),bt(0,10,13,-6,0,20,31,3,0,8,38,7),bt(0,10,13,-6,0,21,33,3,0,8,40,7),bt(0,10,14,-6,0,22,35,3,0,8,42,7),bt(0,11,14,-7,0,23,36,3,0,9,44,8),bt(0,11,15,-7,0,24,38,3,0,9,46,8)],Zw=["duration","easing","delay"],_w={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},qw={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Uh(e){return`${Math.round(e)}ms`}function $w(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function eT(e){const t=z({},_w,e.easing),n=z({},qw,e.duration);return z({getAutoHeightDuration:$w,create:(o=["all"],s={})=>{const{duration:l=n.standard,easing:u=t.easeInOut,delay:A=0}=s,g=Ue(s,Zw);if(process.env.NODE_ENV!=="production"){const p=h=>typeof h=="string",C=h=>!isNaN(parseFloat(h));!p(o)&&!Array.isArray(o)&&console.error('MUI: Argument "props" must be a string or Array.'),!C(l)&&!p(l)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${l}.`),p(u)||console.error('MUI: Argument "easing" must be a string.'),!C(A)&&!p(A)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof s!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
|
|
69
69
|
`)),Object.keys(g).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(g).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(p=>`${p} ${typeof l=="string"?l:Uh(l)} ${u} ${typeof A=="string"?A:Uh(A)}`).join(",")}},e,{easing:t,duration:n})}const tT={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},nT=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function dA(e={},...t){const{mixins:n={},palette:r={},transitions:o={},typography:s={}}=e,l=Ue(e,nT);if(e.vars)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name.":Ci(18));const u=Ww(r),A=sA(e);let g=ir(A,{mixins:Mw(A.breakpoints,n),palette:u,shadows:Xw.slice(),typography:Yw(u,s),transitions:eT(o),zIndex:z({},tT)});if(g=ir(g,l),g=t.reduce((p,C)=>ir(p,C),g),process.env.NODE_ENV!=="production"){const p=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],C=(h,E)=>{let m;for(m in h){const B=h[m];if(p.indexOf(m)!==-1&&Object.keys(B).length>0){if(process.env.NODE_ENV!=="production"){const v=Lt("",m);console.error([`MUI: The \`${E}\` component increases the CSS specificity of the \`${m}\` internal state.`,"You can not override it like this: ",JSON.stringify(h,null,2),"",`Instead, you need to use the '&.${v}' syntax:`,JSON.stringify({root:{[`&.${v}`]:B}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
|
|
70
|
-
`))}h[m]={}}}};Object.keys(g.components).forEach(h=>{const E=g.components[h].styleOverrides;E&&h.indexOf("Mui")===0&&C(E,h)})}return g.unstable_sxConfig=z({},nl,l==null?void 0:l.unstable_sxConfig),g.unstable_sx=function(C){return iA({sx:C,theme:this})},g}const gA=dA();function Pt(){const e=xh(gA);return process.env.NODE_ENV!=="production"&&k.useDebugValue(e),e[bs]||e}function Wt({props:e,name:t}){return Tw({props:e,name:t,defaultTheme:gA,themeId:bs})}const fA=e=>il(e)&&e!=="classes",Ae=jh({themeId:bs,defaultTheme:gA,rootShouldForwardProp:fA}),rT=["theme"];function Yh(e){let{theme:t}=e,n=Ue(e,rT);const r=t[bs];return f.jsx(cl,z({},n,{themeId:r?bs:void 0,theme:r||t}))}process.env.NODE_ENV!=="production"&&(Yh.propTypes={children:c.node,theme:c.oneOfType([c.object,c.func]).isRequired});const Gh=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},oT=Ae("span")(({arrow:e,theme:t})=>{const o=`solid 1px ${He(t.palette.grey[500],.12)}`,s={borderRadius:"0 0 3px 0",top:-6,borderBottom:o,borderRight:o},l={borderRadius:"3px 0 0 0",bottom:-6,borderTop:o,borderLeft:o},u={borderRadius:"0 3px 0 0",left:-6,borderTop:o,borderRight:o},A={borderRadius:"0 0 0 3px",right:-6,borderBottom:o,borderLeft:o};return{display:"none",[t.breakpoints.up("sm")]:{zIndex:1,width:12,height:12,content:"''",display:"block",position:"absolute",transform:"rotate(-135deg)",background:t.palette.background.paper},...e==="top-left"&&{...s,left:20},...e==="top-center"&&{...s,left:0,right:0,margin:"auto"},...e==="top-right"&&{...s,right:20},...e==="bottom-left"&&{...l,left:20},...e==="bottom-center"&&{...l,left:0,right:0,margin:"auto"},...e==="bottom-right"&&{...l,right:20},...e==="left-top"&&{...u,top:20},...e==="left-center"&&{...u,top:0,bottom:0,margin:"auto"},...e==="left-bottom"&&{...u,bottom:20},...e==="right-top"&&{...A,top:20},...e==="right-center"&&{...A,top:0,bottom:0,margin:"auto"},...e==="right-bottom"&&{...A,bottom:20}}});function iT(e){let t;switch(e){case"top-left":t={style:{ml:-.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"top-center":t={style:{},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}};break;case"top-right":t={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"bottom-left":t={style:{ml:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"bottom-center":t={style:{},anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}};break;case"bottom-right":t={style:{ml:.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;case"left-top":t={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"left-center":t={anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}};break;case"left-bottom":t={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"right-top":t={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"right-center":t={anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}};break;case"right-bottom":t={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;default:t={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}}return t}const ul=({open:e,children:t,arrow:n="top-right",disabledArrow:r,sx:o,...s})=>{const{style:l,anchorOrigin:u,transformOrigin:A}=iT(n);return f.jsxs(b.Popover,{open:!!e,anchorEl:e,anchorOrigin:u,transformOrigin:A,PaperProps:{sx:{p:1,width:"auto",overflow:"inherit",...l,"& .MuiMenuItem-root":{px:1,typography:"body2",borderRadius:.75,"& svg":{mr:2,width:20,height:20,flexShrink:0}},...o}},...s,children:[!r&&f.jsx(oT,{arrow:n}),t]})};ul.propTypes={sx:c.object,open:c.object,children:c.node,disabledArrow:c.bool,arrow:c.oneOf(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","left-top","left-center","left-bottom","right-top","right-center","right-bottom"])};const sT=b.styled("div",{shouldForwardProp:e=>e!=="color"&&e!=="variant"&&e!=="sx",slot:"root",overridesResolver:(e,t)=>[t.root]})(()=>({textAlign:"right"})),aT=b.styled(ul,{name:"ApplicaActionsMenu",slot:"root"})(({theme:e})=>({"& .MuiMenuItem-root":{padding:0,margin:0,backgroundColor:e.palette.background.paper,"& .MuiButton-startIcon":{marginRight:e.spacing(0)}}})),Mo=({horizontal:e=!1,children:t})=>{const[n,r]=w.useState(null),o=l=>{l.stopPropagation(),l.preventDefault(),r(l.currentTarget)},s=w.useCallback(()
|
|
70
|
+
`))}h[m]={}}}};Object.keys(g.components).forEach(h=>{const E=g.components[h].styleOverrides;E&&h.indexOf("Mui")===0&&C(E,h)})}return g.unstable_sxConfig=z({},nl,l==null?void 0:l.unstable_sxConfig),g.unstable_sx=function(C){return iA({sx:C,theme:this})},g}const gA=dA();function Pt(){const e=xh(gA);return process.env.NODE_ENV!=="production"&&k.useDebugValue(e),e[bs]||e}function Wt({props:e,name:t}){return Tw({props:e,name:t,defaultTheme:gA,themeId:bs})}const fA=e=>il(e)&&e!=="classes",Ae=jh({themeId:bs,defaultTheme:gA,rootShouldForwardProp:fA}),rT=["theme"];function Yh(e){let{theme:t}=e,n=Ue(e,rT);const r=t[bs];return f.jsx(cl,z({},n,{themeId:r?bs:void 0,theme:r||t}))}process.env.NODE_ENV!=="production"&&(Yh.propTypes={children:c.node,theme:c.oneOfType([c.object,c.func]).isRequired});const Gh=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},oT=Ae("span")(({arrow:e,theme:t})=>{const o=`solid 1px ${He(t.palette.grey[500],.12)}`,s={borderRadius:"0 0 3px 0",top:-6,borderBottom:o,borderRight:o},l={borderRadius:"3px 0 0 0",bottom:-6,borderTop:o,borderLeft:o},u={borderRadius:"0 3px 0 0",left:-6,borderTop:o,borderRight:o},A={borderRadius:"0 0 0 3px",right:-6,borderBottom:o,borderLeft:o};return{display:"none",[t.breakpoints.up("sm")]:{zIndex:1,width:12,height:12,content:"''",display:"block",position:"absolute",transform:"rotate(-135deg)",background:t.palette.background.paper},...e==="top-left"&&{...s,left:20},...e==="top-center"&&{...s,left:0,right:0,margin:"auto"},...e==="top-right"&&{...s,right:20},...e==="bottom-left"&&{...l,left:20},...e==="bottom-center"&&{...l,left:0,right:0,margin:"auto"},...e==="bottom-right"&&{...l,right:20},...e==="left-top"&&{...u,top:20},...e==="left-center"&&{...u,top:0,bottom:0,margin:"auto"},...e==="left-bottom"&&{...u,bottom:20},...e==="right-top"&&{...A,top:20},...e==="right-center"&&{...A,top:0,bottom:0,margin:"auto"},...e==="right-bottom"&&{...A,bottom:20}}});function iT(e){let t;switch(e){case"top-left":t={style:{ml:-.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"top-center":t={style:{},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}};break;case"top-right":t={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"bottom-left":t={style:{ml:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"bottom-center":t={style:{},anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}};break;case"bottom-right":t={style:{ml:.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;case"left-top":t={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"}};break;case"left-center":t={anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}};break;case"left-bottom":t={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"left"}};break;case"right-top":t={style:{mt:-.75},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"}};break;case"right-center":t={anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}};break;case"right-bottom":t={style:{mt:.75},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"}};break;default:t={style:{ml:.75},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}}}return t}const ul=({open:e,children:t,arrow:n="top-right",disabledArrow:r,sx:o,...s})=>{const{style:l,anchorOrigin:u,transformOrigin:A}=iT(n);return f.jsxs(b.Popover,{open:!!e,anchorEl:e,anchorOrigin:u,transformOrigin:A,PaperProps:{sx:{p:1,width:"auto",overflow:"inherit",...l,"& .MuiMenuItem-root":{px:1,typography:"body2",borderRadius:.75,"& svg":{mr:2,width:20,height:20,flexShrink:0}},...o}},...s,children:[!r&&f.jsx(oT,{arrow:n}),t]})};ul.propTypes={sx:c.object,open:c.object,children:c.node,disabledArrow:c.bool,arrow:c.oneOf(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","left-top","left-center","left-bottom","right-top","right-center","right-bottom"])};const sT=b.styled("div",{shouldForwardProp:e=>e!=="color"&&e!=="variant"&&e!=="sx",slot:"root",overridesResolver:(e,t)=>[t.root]})(()=>({textAlign:"right"})),aT=b.styled(ul,{name:"ApplicaActionsMenu",slot:"root"})(({theme:e})=>({"& .MuiMenuItem-root":{padding:0,margin:0,backgroundColor:e.palette.background.paper,"& .MuiButton-startIcon":{marginRight:e.spacing(0)}}})),Mo=({horizontal:e=!1,children:t})=>{const[n,r]=w.useState(null),o=l=>{l.stopPropagation(),l.preventDefault(),r(l.currentTarget)},s=w.useCallback(l=>{l.stopPropagation(),l.preventDefault(),r(null)},[]);return!t||w.Children.count(t)===0||t!=null&&t.filter&&(t==null?void 0:t.filter(l=>w.isValidElement(l)).length)===0?null:f.jsxs(sT,{children:[f.jsx(b.IconButton,{"aria-label":"more","aria-haspopup":"true",onClick:o,color:n?"inherit":"default",children:e?f.jsx(fn.MoreHoriz,{}):f.jsx(fn.MoreVert,{})}),f.jsx(aT,{open:n,onClose:s,arrow:"right-top",children:w.Children.map(t,(l,u)=>w.isValidElement(l)&&f.jsx(b.MenuItem,{children:w.cloneElement(l)},u))})]})};Mo.propTypes={...ul.propTypes,children:c.node.isRequired};function lT(e){return Lt("MuiPaper",e)}Ht("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const cT=["className","component","elevation","square","variant"],uT=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,s={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return nn(s,lT,o)},AT=Ae("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return z({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&z({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${He("#fff",Gh(t.elevation))}, ${He("#fff",Gh(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),Kh=k.forwardRef(function(t,n){const r=Wt({props:t,name:"MuiPaper"}),{className:o,component:s="div",elevation:l=1,square:u=!1,variant:A="elevation"}=r,g=Ue(r,cT),p=z({},r,{component:s,elevation:l,square:u,variant:A}),C=uT(p);return process.env.NODE_ENV!=="production"&&Pt().shadows[l]===void 0&&console.error([`MUI: The elevation provided <Paper elevation={${l}}> is not available in the theme.`,`Please make sure that \`theme.shadows[${l}]\` is defined.`].join(`
|
|
71
71
|
`)),f.jsx(AT,z({as:s,ownerState:p,className:Ye(C.root,o),ref:n},g))});process.env.NODE_ENV!=="production"&&(Kh.propTypes={children:c.node,classes:c.object,className:c.string,component:c.elementType,elevation:Cr(ys,e=>{const{elevation:t,variant:n}=e;return t>0&&n==="outlined"?new Error(`MUI: Combining \`elevation={${t}}\` with \`variant="${n}"\` has no effect. Either use \`elevation={0}\` or use a different \`variant\`.`):null}),square:c.bool,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["elevation","outlined"]),c.string])});const pA=Kh;function dT(e){return Lt("MuiAppBar",e)}Ht("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent"]);const gT=["className","color","enableColorOnDark","position"],fT=e=>{const{color:t,position:n,classes:r}=e,o={root:["root",`color${Pe(t)}`,`position${Pe(n)}`]};return nn(o,dT,r)},Al=(e,t)=>e?`${e==null?void 0:e.replace(")","")}, ${t})`:t,pT=Ae(pA,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${Pe(n.position)}`],t[`color${Pe(n.color)}`]]}})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[900];return z({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},t.position==="fixed"&&{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},t.position==="absolute"&&{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},t.position==="sticky"&&{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},t.position==="static"&&{position:"static"},t.position==="relative"&&{position:"relative"},!e.vars&&z({},t.color==="default"&&{backgroundColor:n,color:e.palette.getContrastText(n)},t.color&&t.color!=="default"&&t.color!=="inherit"&&t.color!=="transparent"&&{backgroundColor:e.palette[t.color].main,color:e.palette[t.color].contrastText},t.color==="inherit"&&{color:"inherit"},e.palette.mode==="dark"&&!t.enableColorOnDark&&{backgroundColor:null,color:null},t.color==="transparent"&&z({backgroundColor:"transparent",color:"inherit"},e.palette.mode==="dark"&&{backgroundImage:"none"})),e.vars&&z({},t.color==="default"&&{"--AppBar-background":t.enableColorOnDark?e.vars.palette.AppBar.defaultBg:Al(e.vars.palette.AppBar.darkBg,e.vars.palette.AppBar.defaultBg),"--AppBar-color":t.enableColorOnDark?e.vars.palette.text.primary:Al(e.vars.palette.AppBar.darkColor,e.vars.palette.text.primary)},t.color&&!t.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":t.enableColorOnDark?e.vars.palette[t.color].main:Al(e.vars.palette.AppBar.darkBg,e.vars.palette[t.color].main),"--AppBar-color":t.enableColorOnDark?e.vars.palette[t.color].contrastText:Al(e.vars.palette.AppBar.darkColor,e.vars.palette[t.color].contrastText)},{backgroundColor:"var(--AppBar-background)",color:t.color==="inherit"?"inherit":"var(--AppBar-color)"},t.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),Jh=k.forwardRef(function(t,n){const r=Wt({props:t,name:"MuiAppBar"}),{className:o,color:s="primary",enableColorOnDark:l=!1,position:u="fixed"}=r,A=Ue(r,gT),g=z({},r,{color:s,position:u,enableColorOnDark:l}),p=fT(g);return f.jsx(pT,z({square:!0,component:"header",ownerState:g,elevation:4,className:Ye(p.root,o,u==="fixed"&&"mui-fixed"),ref:n},A))});process.env.NODE_ENV!=="production"&&(Jh.propTypes={children:c.node,classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["default","inherit","primary","secondary","transparent"]),c.string]),enableColorOnDark:c.bool,position:c.oneOf(["absolute","fixed","relative","static","sticky"]),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object])});const hT=Jh,Xh={openDialogs:[],getCurrentDialog:()=>null,openDialog:(e,t)=>{throw new Error(`openDialog not yet ready for: ${e}, ${t}`)},closeDialog:(e,t)=>{throw new Error(`closeDialog not yet ready for: ${e}, ${t}`)}},hA=w.createContext(Xh),CA=({children:e})=>{const[t,n]=w.useState(Xh),r=(l,u)=>{n(A=>({...A,openDialogs:[...A.openDialogs,l]})),u&&u()},o=(l,u)=>{n(A=>({...A,openDialogs:A.openDialogs.filter(g=>g!==l)})),u&&u()},s=()=>t.openDialogs.length>0?t.openDialogs[t.openDialogs.length-1]:null;return f.jsx(hA.Provider,{value:{...t,openDialog:r,closeDialog:o,getCurrentDialog:s},children:e})};CA.propTypes={children:c.node};const Ro=()=>w.useContext(hA);var dl={exports:{}};/**
|
|
72
72
|
* @license
|
|
73
73
|
* Lodash <https://lodash.com/>
|
|
@@ -215,7 +215,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
215
215
|
animation: ${0} 1.4s linear infinite;
|
|
216
216
|
`),n3)),s3=Ae("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),a3=Ae("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&&Xt.css(sm||(sm=Wl`
|
|
217
217
|
animation: ${0} 1.4s ease-in-out infinite;
|
|
218
|
-
`),r3)),am=k.forwardRef(function(t,n){const r=Wt({props:t,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:l=!1,size:u=40,style:A,thickness:g=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ue(r,t3),E=z({},r,{color:s,disableShrink:l,size:u,thickness:g,value:p,variant:C}),m=o3(E),B={},v={},j={};if(C==="determinate"){const R=2*Math.PI*((uo-g)/2);B.strokeDasharray=R.toFixed(3),j["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*R).toFixed(3)}px`,v.transform="rotate(-90deg)"}return f.jsx(i3,z({className:Ye(m.root,o),style:z({width:u,height:u},v,A),ownerState:E,ref:n,role:"progressbar"},j,h,{children:f.jsx(s3,{className:m.svg,ownerState:E,viewBox:`${uo/2} ${uo/2} ${uo} ${uo}`,children:f.jsx(a3,{className:m.circle,style:B,ownerState:E,cx:uo,cy:uo,r:(uo-g)/2,fill:"none",strokeWidth:g})})}))});process.env.NODE_ENV!=="production"&&(am.propTypes={classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","primary","secondary","error","info","success","warning"]),c.string]),disableShrink:Cr(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 Od=am;function l3(e){return Lt("MuiLoadingButton",e)}const Fr=Ht("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),c3=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],u3=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Pe(n)}`],endIcon:[t&&`endIconLoading${Pe(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Pe(n)}`]},s=hr.unstable_composeClasses(o,l3,r);return z({},r,s)},A3=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",d3=Ae($j,{shouldForwardProp:e=>A3(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Fr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Fr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>z({[`& .${Fr.startIconLoadingStart}, & .${Fr.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}),[`&.${Fr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Fr.startIconLoadingStart}, & .${Fr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Fr.startIconLoadingStart}, & .${Fr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),g3=Ae("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})),lm=k.forwardRef(function(t,n){const r=Wt({props:t,name:"MuiLoadingButton"}),{children:o,disabled:s=!1,id:l,loading:u=!1,loadingIndicator:A,loadingPosition:g="center",variant:p="text"}=r,C=Ue(r,c3),h=_u(l),E=A??f.jsx(Od,{"aria-labelledby":h,color:"inherit",size:16}),m=z({},r,{disabled:s,loading:u,loadingIndicator:E,loadingPosition:g,variant:p}),B=u3(m),v=u?f.jsx(g3,{className:B.loadingIndicator,ownerState:m,children:E}):null;return f.jsxs(d3,z({disabled:s||u,id:h,ref:n},C,{variant:p,classes:B,ownerState:m,children:[m.loadingPosition==="end"?o:v,m.loadingPosition==="end"?v:o]}))});process.env.NODE_ENV!=="production"&&(lm.propTypes={children:c.node,classes:c.object,disabled:c.bool,id:c.string,loading:c.bool,loadingIndicator:c.node,loadingPosition:Cr(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 f3=lm;function jd({variant:e,theme:t,color:n,loadingPosition:r}){const o=rn(t,n),{lighter:s,main:l,dark:u,contrastText:A}=o,g=`${n}Button`,p=Fi(t,g),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},E={"&::after":{boxShadow:`0 0 6px 6px ${He(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${He(l,.9)}`},"&:focus-visible":{outline:`2px solid ${u}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...E};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...E};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{boxShadow:"none",backgroundColor:u,color:A},...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 p3=Ae(f3,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:o,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"&&{...jd({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")&&!o&&{color:"#fff"},...t!=="text"&&{...jd({variant:t,theme:e,color:r,loadingPosition:s})},"&.Mui-disabled":{...t!=="text"&&{...jd({variant:t,theme:e,color:r,loadingPosition:s})}}})),Md=w.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...o},s)=>{const l=Pt();return f.jsx(p3,{ref:s,variant:e,shape:t,theme:l,loadingPosition:o.loadingPosition,loading:o.loading,color:r,...o,children:n})});Md.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string},Md.displayName="LoadingButton";function h3({color:e,theme:t,labelColor:n}){const r=rn(t,e),{main:o,contrastText:s}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:o,color:n||s},[`& .${b.tooltipClasses.arrow}`]:{color:o}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||s,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const C3=Ae(({className:e,...t})=>f.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&h3({color:t,theme:e,labelColor:n})}));function cm({children:e,arrow:t,labelColor:n="",...r}){const o=Pt();return f.jsx(b.Box,{display:"flex",children:f.jsx(C3,{arrow:t,...r,theme:o,labelColor:n,children:e})})}cm.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const Ao=w.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...o},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,{...o,timeout:{appear:0,enter:150,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&f.jsx(b.Collapse,{...o,sx:l,children:e}),n==="fade"&&f.jsx(b.Fade,{...o,timeout:{appear:0,enter:300,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&f.jsx(b.Slide,{...o,timeout:{appear:0,enter:150,exit:150},direction:r,children:f.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&f.jsx(b.Zoom,{...o,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"])},w.forwardRef(function(t,n){return f.jsx(b.Zoom,{ref:n,timeout:200,...t})});function um({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)}%`})})]})}um.propTypes={value:c.number};function Am({value:e,size:t,variant:n,thickness:r,showLabel:o,pathColor:s,sx:l,...u}){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,...u,value:100}),o&&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,...u})]})}Am.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 dm({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})]})}dm.propTypes={icon:c.node,value:c.number};function gm({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)}%`})})]})}gm.propTypes={value:c.number};const fm=w.createContext({});function E3(e){const{useDefaults:t=!1,queryOptions:n={}}=e,r=S.useResourceContext(),o=S.useDataProvider(),{search:s}=gi.useLocation(),l=`${r}/new`,u=w.useCallback(()=>{if(!t||!Ce.isFunction(o.get))return Promise.resolve({});const h={};return new URLSearchParams(s??"").forEach((E,m)=>{h[m]=E}),o.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,o]),A=w.useMemo(()=>Ce.chain(n).extend({queryKey:[r,s],queryFn:u}).value(),[r,s,u,n]),{data:g,isLoading:p}=Nu.useQuery(A),C=Ce.omit(e,["useDefaults"]);return p?f.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:f.jsx(b.CircularProgress,{})}):f.jsx(fm.Provider,{value:g??{},children:f.jsx(S.Create,{...C})})}function I3(){return w.useContext(fm)}const m3=Ae(E3,{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",backgroundColor:e.palette.background.default}})),B3=Ts(S.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)}})),ar=e=>f.jsx(B3,{...e});ar.defaultProps={...S.Toolbar.defaultProps},ar.propTypes={...S.Toolbar.propTypes};const Rd=({children:e,content:t,title:n,subheader:r,secondary:o,toolbar:s,...l})=>{const u=S.useTranslate(),A=S.useResourceContext(),{cardTitle:g,cardSubheader:p}=w.useMemo(()=>{const C=n||`resources.${A}.title`;return{cardTitle:u(C,{_:C}),cardSubheader:r!==null?u(r,{_:r}):null}},[A,r,n,u]);return f.jsx(b.Grid,{item:!0,...l,children:f.jsx(Wn,{content:t,title:g,subheader:p,secondary:o,divider:!0,children:f.jsxs(w.Fragment,{children:[e,s===!0?f.jsx(ar,{children:f.jsx(S.SaveButton,{})}):s]})})})};Rd.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12},Rd.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 v3=Ae(S.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),zl=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:o}=wn();return f.jsx(v3,{defaultValues:n,spacing:t||o,children:f.jsx(b.Grid,{container:!0,...r,spacing:t||o,children:e})})};zl.propTypes={...b.Grid.propTypes,...S.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},zl.defaultProps={...b.Stack.defaultProps},zl.Section=Rd;const y3=Ts(S.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}})),Ul=({title:e,modal:t,content:n,subheader:r,secondary:o,sx:s,...l})=>{const u=xA(e),A=S.useRecordContext();return f.jsx(Wn,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?o:null,sx:{...s,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:f.jsx(y3,{toolbar:f.jsx(ar,{}),...l})})};Ul.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:f.jsx(ar,{children:f.jsx(S.SaveButton,{type:"button"})}),secondary:f.jsx(Mo,{children:f.jsx(S.DeleteWithConfirmButton,{})})},Ul.propTypes={...S.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 Yl=({label:e,children:t,display:n,helperText:r,sx:o,addLabel:s,divider:l,...u})=>{const A=Xt.useTheme(),{getCurrentDialog:g}=Ro(),{source:p,resource:C,isRequired:h}=u,{getFieldState:E,formState:m}=fi.useFormContext(),{error:B}=E(p,m),v=g();return f.jsxs(b.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:B?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...o},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(S.FieldTitle,{label:e,source:p,resource:v||C,isRequired:h})}),w.isValidElement(t)?w.cloneElement(t,{...t.props,...u,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})]})};Yl.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},Yl.defaultProps={display:"label",divider:!1};const b3=Ae(S.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%"}}})),Q3=({label:e,addLabel:t,source:n,helperText:r,divider:o=!0,...s})=>f.jsx(Yl,{label:e,addLabel:t,source:n,helperText:r,divider:o,children:f.jsx(b3,{source:n,label:!1,...s})}),Dd=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:f.jsxs(Mo,{children:[e&&f.jsx(S.EditButton,{}),t&&f.jsx(S.DeleteWithConfirmButton,{}),n&&f.jsx(S.CloneButton,{})]});Dd.defaultProps={canEdit:!0,canDelete:!0,canClone:!1},Dd.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const pm=Ae("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),x3=Ae("ul")({display:"inline-block"}),hm=e=>{var p;const{className:t,emptyText:n,source:r,title:o,...s}=e,l=he.useRecordContext(e),u=dt.get(l,r),A=he.useTranslate();if(!u)return n?f.jsx(b.Typography,{component:"span",variant:"body2",className:t,...s,children:n&&A(n,{_:n})}):f.jsx(pm,{className:t,...s});if(Array.isArray(u))return f.jsx(x3,{className:t,...s,children:u.map((C,h)=>{var m;const E=o instanceof String?(m=dt.get(C,o))==null?void 0:m.toString():o;return f.jsx("li",{children:E},h)})});const g=o instanceof String?(p=dt.get(l,o))==null?void 0:p.toString():o;return f.jsx(pm,{className:t,...s,children:g})};hm.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 Cm={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",l="second",u="minute",A="hour",g="day",p="week",C="month",h="quarter",E="year",m="date",B="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,j=/\[([^\]]+)]|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(q){var J=["th","st","nd","rd"],H=q%100;return"["+q+(J[(H-20)%10]||J[H]||J[0])+"]"}},x=function(q,J,H){var K=String(q);return!K||K.length>=J?q:""+Array(J+1-K.length).join(H)+q},O={s:x,z:function(q){var J=-q.utcOffset(),H=Math.abs(J),K=Math.floor(H/60),L=H%60;return(J<=0?"+":"-")+x(K,2,"0")+":"+x(L,2,"0")},m:function q(J,H){if(J.date()<H.date())return-q(H,J);var K=12*(H.year()-J.year())+(H.month()-J.month()),L=J.clone().add(K,C),ee=H-L<0,W=J.clone().add(K+(ee?-1:1),C);return+(-(K+(H-L)/(ee?L-W:W-L))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:C,y:E,w:p,d:g,D:m,h:A,m:u,s:l,ms:s,Q:h}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},P="en",N={};N[P]=R;var F="$isDayjsObject",X=function(q){return q instanceof ce||!(!q||!q[F])},Z=function q(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 W=J.split("-");if(!L&&W.length>1)return q(W[0])}else{var _=J.name;N[_]=J,L=_}return!K&&L&&(P=L),L||!K&&P},Y=function(q,J){if(X(q))return q.clone();var H=typeof J=="object"?J:{};return H.date=q,H.args=arguments,new ce(H)},$=O;$.l=Z,$.i=X,$.w=function(q,J){return Y(q,{locale:J.$L,utc:J.$u,x:J.$x,$offset:J.$offset})};var ce=function(){function q(H){this.$L=Z(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[F]=!0}var J=q.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($.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var W=L.match(v);if(W){var _=W[2]-1||0,de=(W[7]||"0").substring(0,3);return ee?new Date(Date.UTC(W[1],_,W[3]||1,W[4]||0,W[5]||0,W[6]||0,de)):new Date(W[1],_,W[3]||1,W[4]||0,W[5]||0,W[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 $},J.isValid=function(){return this.$d.toString()!==B},J.isSame=function(H,K){var L=Y(H);return this.startOf(K)<=L&&L<=this.endOf(K)},J.isAfter=function(H,K){return Y(H)<this.startOf(K)},J.isBefore=function(H,K){return this.endOf(K)<Y(H)},J.$g=function(H,K,L){return $.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=!!$.u(K)||K,W=$.p(H),_=function(Ee,Be){var xe=$.w(L.$u?Date.UTC(L.$y,Be,Ee):new Date(L.$y,Be,Ee),L);return ee?xe:xe.endOf(g)},de=function(Ee,Be){return $.w(L.toDate()[Ee].apply(L.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(Be)),L)},fe=this.$W,ue=this.$M,ge=this.$D,pe="set"+(this.$u?"UTC":"");switch(W){case E:return ee?_(1,0):_(31,11);case C:return ee?_(1,ue):_(0,ue+1);case p:var ve=this.$locale().weekStart||0,Ie=(fe<ve?fe+7:fe)-ve;return _(ee?ge-Ie:ge+(6-Ie),ue);case g:case m:return de(pe+"Hours",0);case A:return de(pe+"Minutes",1);case u: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=$.p(H),W="set"+(this.$u?"UTC":""),_=(L={},L[g]=W+"Date",L[m]=W+"Date",L[C]=W+"Month",L[E]=W+"FullYear",L[A]=W+"Hours",L[u]=W+"Minutes",L[l]=W+"Seconds",L[s]=W+"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[_](de),fe.init(),this.$d=fe.set(m,Math.min(this.$D,fe.daysInMonth())).$d}else _&&this.$d[_](de);return this.init(),this},J.set=function(H,K){return this.clone().$set(H,K)},J.get=function(H){return this[$.p(H)]()},J.add=function(H,K){var L,ee=this;H=Number(H);var W=$.p(K),_=function(ue){var ge=Y(ee);return $.w(ge.date(ge.date()+Math.round(ue*H)),ee)};if(W===C)return this.set(C,this.$M+H);if(W===E)return this.set(E,this.$y+H);if(W===g)return _(1);if(W===p)return _(7);var de=(L={},L[u]=r,L[A]=o,L[l]=n,L)[W]||1,fe=this.$d.getTime()+H*de;return $.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",W=$.z(this),_=this.$H,de=this.$m,fe=this.$M,ue=L.weekdays,ge=L.months,pe=L.meridiem,ve=function(Be,xe,le,Ve){return Be&&(Be[xe]||Be(K,ee))||le[xe].slice(0,Ve)},Ie=function(Be){return $.s(_%12||12,Be,"0")},Ee=pe||function(Be,xe,le){var Ve=Be<12?"AM":"PM";return le?Ve.toLowerCase():Ve};return ee.replace(j,function(Be,xe){return xe||function(le){switch(le){case"YY":return String(K.$y).slice(-2);case"YYYY":return $.s(K.$y,4,"0");case"M":return fe+1;case"MM":return $.s(fe+1,2,"0");case"MMM":return ve(L.monthsShort,fe,ge,3);case"MMMM":return ve(ge,fe);case"D":return K.$D;case"DD":return $.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return ve(L.weekdaysMin,K.$W,ue,2);case"ddd":return ve(L.weekdaysShort,K.$W,ue,3);case"dddd":return ue[K.$W];case"H":return String(_);case"HH":return $.s(_,2,"0");case"h":return Ie(1);case"hh":return Ie(2);case"a":return Ee(_,de,!0);case"A":return Ee(_,de,!1);case"m":return String(de);case"mm":return $.s(de,2,"0");case"s":return String(K.$s);case"ss":return $.s(K.$s,2,"0");case"SSS":return $.s(K.$ms,3,"0");case"Z":return W}return null}(Be)||W.replace(":","")})},J.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},J.diff=function(H,K,L){var ee,W=this,_=$.p(K),de=Y(H),fe=(de.utcOffset()-this.utcOffset())*r,ue=this-de,ge=function(){return $.m(W,de)};switch(_){case E:ee=ge()/12;break;case C:ee=ge();break;case h:ee=ge()/3;break;case p:ee=(ue-fe)/6048e5;break;case g:ee=(ue-fe)/864e5;break;case A:ee=ue/o;break;case u:ee=ue/r;break;case l:ee=ue/n;break;default:ee=ue}return L?ee:$.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 $.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()},q}(),se=ce.prototype;return Y.prototype=se,[["$ms",s],["$s",l],["$m",u],["$H",A],["$W",g],["$M",C],["$y",E],["$D",m]].forEach(function(q){se[q[1]]=function(J){return this.$g(J,q[0],q[1])}}),Y.extend=function(q,J){return q.$i||(q(J,ce,Y),q.$i=!0),Y},Y.locale=Z,Y.isDayjs=X,Y.unix=function(q){return Y(1e3*q)},Y.en=N[P],Y.Ls=N,Y.p={},Y})})(Cm);var w3=Cm.exports;const Lr=qr(w3),kd=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...o})=>{const[s,l]=w.useState(null),u=S.useRecordContext(o),A=S.useDataProvider(),g=S.useResourceContext(),p=w.useCallback(async E=>{E.preventDefault(),E.stopPropagation();const m=dt.get(u,o==null?void 0:o.source),B=g.replace("entities/",""),v=await A.getFile(`/attachments/${B}/${e||(u==null?void 0:u.id)}/${t||(o==null?void 0:o.source)}/${(m==null?void 0:m.id)||(u==null?void 0:u.id)}`),j=document.createElement("a");j.href=v,j.download=dt.get(u,(o==null?void 0:o.title)||(o==null?void 0:o.source)),j.click()},[A,u,e,g,t,o==null?void 0:o.source,o==null?void 0:o.title]),C=w.useMemo(()=>({...u,[o==null?void 0:o.source]:(u==null?void 0:u.src)||dt.get(u,o==null?void 0:o.source),[o==null?void 0:o.title]:(u==null?void 0:u.title)||dt.get(u,(o==null?void 0:o.title)||(o==null?void 0:o.source))}),[u,o==null?void 0:o.source,o==null?void 0:o.title]),h=S.useTranslate();return w.useEffect(()=>{!u||!(u!=null&&u.userId)||A.getOne(r,{id:u==null?void 0:u.userId}).then(({data:E})=>l(E)).catch(()=>l(null))},[u,A,r]),f.jsx(hm,{...o,disabled:n,record:C,onClick:p,title:f.jsxs(b.Box,{sx:{cursor:"pointer"},children:[f.jsx(b.Typography,{variant:"subtitle1",children:dt.get(C,(o==null?void 0:o.title)||(o==null?void 0:o.source))}),f.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[dt.get(C,"sizeDescription"),s&&" | ",s&&h("ra.attachment.info",{user:s==null?void 0:s.name,created:Lr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};kd.propTypes={...S.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const T3=Ae(S.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),Js=e=>{const t=`_${e==null?void 0:e.source}`;return f.jsx(T3,{...e,source:t})};Js.propTypes={...S.ImageField.propTypes,source:c.string};const Gl=({width:e,height:t,circle:n,justify:r,record:o,...s})=>{const l=w.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]),u=S.useRecordContext(),A=o||u;return f.jsx(Js,{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:A})};Gl.defaultProps={...Js.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"},Gl.propTypes={...Js.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 Em={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){return function(n,r,o){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 u(g,p,C,h){return s.fromToBase(g,p,C,h)}o.en.relativeTime=l,s.fromToBase=function(g,p,C,h,E){for(var m,B,v,j=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"}],x=R.length,O=0;O<x;O+=1){var P=R[O];P.d&&(m=h?o(g).diff(C,P.d,!0):C.diff(g,P.d,!0));var N=(n.rounding||Math.round)(Math.abs(m));if(v=m>0,N<=P.r||!P.r){N<=1&&O>0&&(P=R[O-1]);var F=j[P.l];E&&(N=E(""+N)),B=typeof F=="string"?F.replace("%d",N):F(N,p,P.l,v);break}}if(p)return B;var X=v?j.future:j.past;return typeof X=="function"?X(B):X.replace("%s",B)},s.to=function(g,p){return u(g,p,this,!0)},s.from=function(g,p){return u(g,p,this)};var A=function(g){return g.$u?o.utc():o()};s.toNow=function(g){return this.to(A(this),g)},s.fromNow=function(g){return this.from(A(this),g)}}})})(Em);var P3=Em.exports;const S3=qr(P3);Lr.extend(S3);const Kl=e=>{const t=S.useRecordContext(e),[n]=S.useLocaleState(),r=w.useMemo(()=>Lr(dt.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return f.jsxs(w.Fragment,{children:[f.jsx(S.DateField,{record:t,source:e.source,showTime:!0}),f.jsx("br",{}),f.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Kl.displayName="DateAgoField",Kl.propTypes={source:c.string.isRequired};const Im=Ae(S.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));Im.propTypes={...S.DateField.propTypes};const Fd=e=>f.jsx(Im,{...e});Fd.defaultProps={...S.DateField.defaultProps,variant:"body1"},Fd.propTypes={...S.DateField.propTypes};const mm=Ae(S.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));mm.propTypes={...S.EmailField.propTypes};const Ld=e=>f.jsx(mm,{...e});Ld.defaultProps={...S.EmailField.defaultProps,variant:"body1"},Ld.propTypes={...S.EmailField.propTypes};const O3=Ae(S.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),Nd=({...e})=>{const t=S.useRecordContext(e),n=w.useCallback(r=>{r.preventDefault(),r.stopPropagation();const o=dt.get(t,`_${e==null?void 0:e.source}`,dt.get(t,e==null?void 0:e.source)),s=dt.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=o,l.download=s,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return f.jsx(O3,{...e,record:t,onClick:n})};Nd.propTypes={...S.FileField.propTypes,source:c.string,title:c.string};const Bm=e=>f.jsx(S.FunctionField,{...e});Bm.defaultProps={variant:"body1"};const j3=Ae("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"}})),Vd=({source:e,defaultValue:t,...n})=>{const r=S.useRecordContext(n),o=dt.get(r,e,t);return f.jsx("span",{dangerouslySetInnerHTML:{__html:o&&o!==null?o:t}})};Vd.propTypes={defaultValue:c.any,source:c.string,record:c.object},Vd.defaultProps={defaultValue:" "};const vm=({title:e,children:t})=>e&&e!==!1?f.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;vm.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const Hd=({label:e,source:t,defaultValue:n,children:r,tooltip:o,...s})=>{const{getCurrentDialog:l}=Ro(),u=S.useRecordContext(s),A=S.useResourceContext(s),g=l(),p=w.useMemo(()=>!o||o===!1?!1:typeof o=="function"?o(u):typeof o=="string"?dt.get(u,o,o):o,[u,o]);return f.jsx(vm,{title:p,children:f.jsxs(w.Fragment,{children:[f.jsx(b.InputLabel,{children:f.jsx(S.FieldTitle,{label:e,source:t,resource:g||A})}),f.jsx(j3,{...s,children:w.cloneElement(r,{source:t,record:u,defaultValue:n,resource:g||A})})]})})};Hd.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},Hd.defaultProps={defaultValue:" ",children:f.jsx(Vd,{})};const Wd=function({children:e,className:t}){return f.jsx("div",{className:t,children:e})};Wd.defaultProps={children:null,className:""},Wd.propTypes={children:c.node,className:c.string};const M3=Ts(Wd,{name:"RaApplicaReferenceManyField",slot:"root"})(({theme:e,margin:t,border:n,bulkActionButtons:r})=>({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:r===!1?0: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}}})),Li=e=>f.jsx(M3,{...e,children:f.jsx(S.ReferenceManyField,{pagination:f.jsx(S.Pagination,{}),...e})});Li.defaultProps={margin:!1,border:!1},Li.propTypes={...S.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const ym=({source:e,...t})=>{const n=S.useRecordContext(t),r=dt.get(n,e,0),o=r/1024,s=o/1024,l=s/1024,u=l>1?`${l.toFixed(2)} GB`:s>1?`${s.toFixed(2)} MB`:o>1?`${o.toFixed(2)} KB`:`${r.toFixed(2)} B`;return f.jsx(b.Typography,{component:"span",variant:"body1",...t,children:u})};ym.propTypes={record:c.object,source:c.string};const bm=Ae(S.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));bm.propTypes={...S.TextField.propTypes};const zd=e=>f.jsx(bm,{...e});zd.defaultProps={...S.TextField.defaultProps,variant:"body1"},zd.propTypes={...S.TextField.propTypes};const ut=({label:e,children:t,display:n,helperText:r,sx:o,addLabel:s,divider:l,...u})=>{const A=Xt.useTheme(),{getCurrentDialog:g}=Ro(),{source:p,resource:C,isRequired:h}=u,{fieldState:{invalid:E}}=S.useInput(u),m=g();return f.jsxs(b.Stack,{spacing:1,sx:{width:u!=null&&u.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:E?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...o},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:E===!0,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(S.FieldTitle,{label:e,source:p,resource:m||C,isRequired:h})}),w.isValidElement(t)?w.cloneElement(t,{...t.props,...u,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})]})};ut.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},ut.defaultProps={display:"label",divider:!1};const R3=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},D3=Ae(S.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}},...R3(e)})),Ud=({children:e,disabled:t,type:n,...r})=>{const o=S.useRecordContext(r),s=r==null?void 0:r.source,l=o==null?void 0:o.id;return S.useInput({source:`__${n}__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),f.jsx(ut,{...r,children:f.jsx(D3,{disabled:t,children:w.cloneElement(e,{...e.props,entityId:l,property:s})})})};Ud.propTypes={...S.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool},Ud.defaultProps={children:f.jsx(kd,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const k3=Ae(S.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"}})),Yd=({...e})=>f.jsx(ut,{...e,children:f.jsx(k3,{})});Yd.propTypes={...S.AutocompleteArrayInput.propTypes,...ut.propTypes},Yd.defaultProps={...S.AutocompleteArrayInput.defaultProps,size:"small"};const F3=Ae(S.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"}})),Gd=e=>{const{perPage:t,...n}=e;return f.jsx(ut,{...n,children:f.jsx(F3,{})})};Gd.propTypes={...S.AutocompleteInput.propTypes,...ut.propTypes},Gd.defaultProps={...S.AutocompleteInput.defaultProps,size:"small"};const L3=Ae(S.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),Kd=({horizontal:e,...t})=>{const n=Pt();return f.jsx(ut,{...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(L3,{})})};Kd.defaultProps={...S.BooleanInput.defaultProps,...ut.defaultProps},Kd.propTypes={...S.BooleanInput.propTypes,...ut.propTypes,horizontal:c.bool};const N3=Ae(S.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Jd=e=>f.jsx(ut,{...e,children:f.jsx(N3,{})});Jd.propTypes={...S.DateInput.propTypes,...ut.propTypes},Jd.defaultProps={...S.DateInput.defaultProps,...ut.defaultProps};const V3=Ae(S.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Xd=e=>f.jsx(ut,{...e,children:f.jsx(V3,{})});Xd.propTypes={...S.DateTimeInput.propTypes,...ut.propTypes},Xd.defaultProps={...ut.defaultProps};const H3=Ae(S.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}}})),Zd=({children:e,title:t,...n})=>{const r=fi.useWatch({name:n.source}),o=S.useRecordContext(n),{source:s}=n,l=w.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const u=dt.get(o,s);if(u){const A=u.split("__");return A.length>0?A[A.length-1]:u}return u},[o,s,r]);return f.jsx(ut,{...n,children:f.jsx(H3,{children:w.cloneElement(e,{...e.props,title:t||s,source:s,record:{...o,[s]:(r==null?void 0:r.title)||dt.get(o,s),[`_${s}`]:(r==null?void 0:r.src)||dt.get(o,`_${s}`),[t||s]:l}})})})};Zd.propTypes={...S.FileInput.propTypes,source:c.string,title:c.string,children:c.node},Zd.defaultProps={children:f.jsx(Nd,{})};const _d=({children:e,title:t,...n})=>{const r=fi.useWatch({name:n.source}),o=S.useRecordContext(n),{source:s}=n;return S.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),f.jsx(ut,{...n,children:f.jsx(S.ImageInput,{accept:"image/*",children:w.cloneElement(e,{...e.props,title:t,source:s,record:{...o,[s]:(r==null?void 0:r.title)||dt.get(o,s),[`_${s}`]:(r==null?void 0:r.src)||dt.get(o,`_${s}`)}})})})};_d.defaultProps={children:f.jsx(Gl,{}),multiple:!1},_d.propTypes={...S.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const W3=Ae(S.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),qd=e=>f.jsx(ut,{...e,children:f.jsx(W3,{})});qd.propTypes={...S.NumberInput.propTypes,...ut.propTypes},qd.defaultProps={...S.NumberInput.defaultProps,...ut.defaultProps};const Qm=({source:e,minWidth:t=300,children:n})=>{const r=S.useResourceContext(),o=S.useRecordContext(),[s,l]=w.useState(dt.get(o,e,"")),[u,A]=w.useState(!1),g=w.useCallback(m=>l(m.target.value),[]),p=S.useDataProvider(),C=w.useCallback(m=>{m.key==="Enter"&&(A(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,o,e]),h=w.useCallback(()=>{dt.get(o,e)!==s&&(A(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,e,o]),E=w.useCallback(m=>{A(!0),p.update(r,{id:o.id,data:{...o,[e]:m,_changed:e}}).then(()=>A(!1))},[p,r,e,o]);return w.useEffect(()=>l(dt.get(o,e)),[o,e]),n?w.cloneElement(n,{...n.props,source:e,value:s,onChange:E}):f.jsx(b.TextField,{value:s,disabled:u,onChange:g,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};Qm.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const $d=({children:e,...t})=>f.jsx(S.ReferenceArrayInput,{...t,children:w.cloneElement(e,{...t,source:e.props.source||t.source})});$d.propTypes={...S.ReferenceArrayInput.propTypes,children:c.element},$d.defaultProps={...S.ReferenceArrayInput.defaultProps};const eg=({children:e,...t})=>f.jsx(S.ReferenceInput,{...t,children:w.cloneElement(e,{...t,source:e.props.source||t.source})});eg.propTypes={...S.ReferenceInput.propTypes,children:c.element},eg.defaultProps={...S.ReferenceInput.defaultProps};const tg=({reference:e,target:t,children:n,filters:r,actions:o,...s})=>f.jsx(S.ResourceContextProvider,{value:e,children:f.jsx(Li,{perPage:5,pagination:f.jsx(S.Pagination,{}),...s,reference:e,target:t,children:f.jsxs(w.Fragment,{children:[f.jsx(S.ListToolbar,{filters:r,actions:o}),n]})})});tg.propTypes={...Li.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])},tg.defaultProps={...Li.defaultProps};const z3=Ae(S.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),U3=e=>f.jsx(z3,{...e}),xm=Ae(S.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"}}));xm.propTypes={...S.SelectArrayInput.propTypes};const ng=e=>f.jsx(ut,{...e,children:f.jsx(xm,{options:{autoWidth:!1}})});ng.defaultProps={optionText:"name",optionValue:"id"},ng.propTypes={...S.SelectArrayInput.propTypes,...ut.propTypes};const Y3=Ae(S.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),wm=e=>f.jsx(ut,{...e,children:f.jsx(Y3,{})});wm.propTypes={...S.SelectInput.propTypes,...ut.propTypes};const Un=e=>f.jsx(ut,{...e,children:f.jsx(S.TextInput,{})});Un.propTypes={...S.TextInput.propTypes,...ut.propTypes};const Jl=({...e})=>{var u,A;const t=S.useTranslate(),n=S.maxLength(e==null?void 0:e.maxLength,"app.input.max_length_error"),r=(A=(u=fi.useController({name:e==null?void 0:e.source}))==null?void 0:u.field)==null?void 0:A.value;let o=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&&(o=o&&o.length>0?`${l} - ${t(o)}`:l),f.jsx(Un,{...e,validate:s,helperText:o,inputProps:{maxLength:e==null?void 0:e.maxLength}})};Jl.displayName="SmartTextInput",Jl.defaultProps={multiline:!1},Jl.propTypes={...Un.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const Tm=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return Lr().hour(n).minute(r)};function G3(){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 K3=e=>{if(!e)return"";const t=Tm(e);return t?t.format("HH:mm"):""},J3=e=>e,X3=Ae(S.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),rg=e=>f.jsx(ut,{...e,children:f.jsx(X3,{})});rg.defaultProps={...S.TimeInput.defaultProps,format:K3,parse:J3},rg.propTypes={...S.TimeInput.propTypes,...ut.propTypes};const og=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=wn(),[r,o]=w.useState(!1),s=he.useAuthProvider(),l=he.useTranslate(),u=he.useNotify(),A=w.useCallback(g=>{const{oldPassword:p,newPassword:C}=g;o(!0),s==null||s.changePassword(p,C).then(()=>{u("ra.auth.password_changed"),e()}).catch(h=>{u((h==null?void 0:h.message)||(h==null?void 0:h.toString()),{type:"error"})}).finally(()=>o(!1))},[s,e]);return f.jsx(he.ResourceContextProvider,{value:"user/change-password",children:f.jsx(he.EditContextProvider,{value:{record:{},resource:"user/change-password",save:A},children:f.jsx(Ul,{onSubmit:A,toolbar:f.jsx(ar,{children:f.jsx(S.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(Un,{source:"oldPassword",type:"password",validate:he.required()})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(Un,{source:"newPassword",type:"password",validate:he.required()})})]})})})})},Z3=Ae(S.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",backgroundColor:e.palette.background.default}})),_3=Ae(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),q3=Ae(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),ig=({title:e,divider:t,variant:n})=>{const r=S.useTranslate();return f.jsxs(w.Fragment,{children:[f.jsx(_3,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&f.jsx(q3,{})]})};ig.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])},ig.defaultProps={divider:!0,variant:"h4"};const $3=Ae(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",marginRight:0}},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}}));function Pm(e){const{spacing:t}=wn(),{spacing:n=t}=e,r=Ce.omit(e,["spacing"]);return f.jsx(S.Form,{...r,children:f.jsx($3,{container:!0,spacing:n*2,children:e.children})})}function sg(e){return e.id??e.label}function Sm(e,t){const n=`^${e}.`.replaceAll(".","\\."),r=new RegExp(n,"g");return t.match(r)!==null}function eM(e){return Ce.map(e,"id")}function Xl(e){const t=e.match(new RegExp("[^.]+","g"));return t===null?0:t.length}function Om(e,t){const n=e!==void 0?Xl(e):0;return Ce.chain(t).filter(o=>e!==void 0?Sm(e,o.id):!0).filter(o=>Xl(o.id)===n+1).value()}function tM(e,t){var s;const n=Ce.clone(e),{type:r,payload:o}=t;switch(r){case"setFormRootPath":return Ce.extend(n,{formRootPath:o});case"setSyncWithLocation":return Ce.extend(n,{syncWithLocation:o});case"setErrorCount":return Ce.extend(n,{errorCount:o});case"setActiveItem":return Ce.includes(eM(e.items),o)?Ce.extend(n,{activeItem:o}):n;case"addItem":{const{id:l}=o;return Ce.extend(n,{items:Ce.chain(n.items).clone().reject(u=>u.id===l).concat([o]).orderBy(u=>u.index).value()})}case"removeItem":{const l=Ce.isString(o)?o:o.id,u=Ce.chain(n.items).clone().reject(A=>A.id===l).value();return Ce.extend(n,{items:u}),n.activeItem===l&&Ce.extend(n,{activeItem:((s=Ce.first(u))==null?void 0:s.id)??void 0}),n}default:return n}}const nM={syncWithLocation:!0,errorCount:!0,items:[],activeItem:void 0},jm=w.createContext(void 0);function Mm(e){const t=!!(e.syncWithLocation??!0),n=!!(e.errorCount??!0),{rootMatchString:r}=e,{pathname:o}=gi.useLocation(),[s,l]=w.useReducer(tM,Ce.cloneDeep(nM)),{formRootPath:u,items:A}=s,g=w.useMemo(()=>({state:s,dispatch:l}),[s,l]);return w.useEffect(()=>{const p=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/show/*",":resource/:id/show/*","entities/:resource/:id/*",":resource/:id/*"];r!==void 0&&p.push(r);const C=Ce.chain(p).map(E=>gi.matchPath(E,o)).reject(E=>E===null).first().value(),h=C==null?void 0:C.pathnameBase;h!==void 0&&h!==u&&l({type:"setFormRootPath",payload:h})},[o,u,r]),w.useEffect(()=>{l({type:"setSyncWithLocation",payload:!!t})},[t,l]),w.useEffect(()=>{l({type:"setErrorCount",payload:!!n})},[n,l]),w.useEffect(()=>{var p;if(t&&u!==void 0){let C=o.replace(u,"").replace(new RegExp(/^\/?/),"");Ce.isEmpty(C)&&(C=((p=Ce.chain(A).filter(h=>Om(h.id,A).length===0).orderBy([h=>Xl(h.id),h=>h.index]).first().value())==null?void 0:p.id)??void 0),l({type:"setActiveItem",payload:C})}},[l,u,o,A]),f.jsx(jm.Provider,{value:g,children:e.children})}function Rm(){const e=w.useContext(jm);if(e===void 0)throw new Error("[LongForm] useFormContext: context undefined. Please provide a valid Context using LongForm.Provider");return e}function Xs(){return Rm().state}function ag(){return Rm().dispatch}function Dm(){return Xs().formRootPath}function km(){return Xs().activeItem}function Fm(){return Xs().items}function Lm(){return Xs().syncWithLocation}function Nm(){return Xs().errorCount}function Vm(){const e=ag();return w.useCallback(n=>{e({type:"setActiveItem",payload:n})},[e])}function Hm(){const e=ag();return w.useCallback(n=>{e({type:"addItem",payload:n})},[e])}function Wm(){const e=ag();return w.useCallback(n=>{e({type:"removeItem",payload:n})},[e])}var rM=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},zm=e=>e.firstChild?e.firstChild.offsetParent===e:!0,oM=(e,t)=>{let n=e,r=0;zm(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},iM=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},Zs=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?Zs="sticky":CSS.supports("position","-webkit-sticky")&&(Zs="-webkit-sticky"));var Zl=!1;try{const e=Object.defineProperty({},"passive",{get(){Zl={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var lg=e=>{const{el:t,onChange:n,unsubs:r,measure:o}=e;if(t===window){const s=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=o(s()),u=()=>{Object.assign(l,o(s())),n()};return window.addEventListener("resize",u,Zl),r.push(()=>window.removeEventListener("resize",u)),l}else{const s=o(t.getBoundingClientRect()),l=()=>{Object.assign(s,o(t.getBoundingClientRect())),n()},u=new ResizeObserver(l);return u.observe(t),r.push(()=>u.disconnect()),s}},sM=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}},aM=(e,t,n)=>{const{bottom:r,offsetBottom:o,offsetTop:s}=n,l=rM(e);let u=!1;const A=()=>{u||requestAnimationFrame(()=>{const F=C();F!==x&&O(F),u=!1}),u=!0};let g=l===window?window.scrollY:l.scrollTop;const p=F=>{const{offsetTop:X,height:Z}=E,{naturalTop:Y}=v,{height:$}=j;return F+X+Z>=Y+$+R+o},C=()=>{const{height:F}=E,{height:X}=j;return X+s+o<=F?3:p(g)?1:2},h=l!==window&&zm(l),E=lg({el:l,onChange:A,unsubs:t,measure:({height:F,top:X})=>({height:F,offsetTop:h?X:0})}),m=iM(e),B=m===window?{top:0,bottom:0}:sM(m),v=lg({el:m,onChange:A,unsubs:t,measure:({height:F})=>({height:F-B.top-B.bottom,naturalTop:m===window?0:oM(m,l)+B.top+E.offsetTop})}),j=lg({el:e,onChange:A,unsubs:t,measure:({height:F})=>({height:F})});let R=0,x=C();const O=F=>{const X=x;if(x=F,X===2&&(R=-1),F===3){e.style.position=Zs,r?e.style.bottom=`${o}px`:e.style.top=`${s}px`;return}const{height:Z,offsetTop:Y}=E,{height:$,naturalTop:ce}=v,{height:se}=j;if(F===2)if(e.style.position="relative",R=X===0?Math.max(0,Y+g-ce+s):Math.max(0,Y+g+Z-(ce+se+o)),r){const q=Math.max(0,$-se-R);e.style.bottom=`${q}px`}else e.style.top=`${R}px`;else e.style.position=Zs,F===1?r?e.style.bottom=`${o}px`:e.style.top=`${Z-se-o}px`:r?e.style.bottom=`${Z-se-o}px`:e.style.top=`${s}px`};O(x);const P=F=>{if(F===g)return;const X=F-g;if(g=F,x===3)return;const{offsetTop:Z,height:Y}=E,{naturalTop:$,height:ce}=v,{height:se}=j;if(X>0)if(x===0){if(F+Z+s>$){const q=Math.max(0,Z+g-$+s);F+Z+Y<=$+se+q+o?O(2):O(1)}}else x===2&&p(F)&&O(1);else if(x===1){if(Z+F+Y<$+ce+o){const q=Math.max(0,Z+g+Y-($+se+o));Z+F+s>=$+q?O(2):O(0)}}else x===2&&Z+F+s<$+R&&O(0)},N=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",N,Zl),l.addEventListener("mousewheel",N,Zl),t.push(()=>l.removeEventListener("scroll",N),()=>l.removeEventListener("mousewheel",N))},lM=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,o]=w.useState(null);return w.useEffect(()=>{if(!r||!Zs)return;const s=[];return aM(r,s,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{s.forEach(l=>l())}},[r,t,e,n]),o},cM=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:o,className:s,style:l}=e,u=lM({offsetTop:t,offsetBottom:n,bottom:r});return f.jsx("div",{className:s,style:l,ref:u,children:o})},uM=cM,Um=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(Um||{});function Ym(e){const{sticky:t=!0,disposition:n={xl:3,lg:3,md:4,sm:4,xs:12},spacing:r=2}=e,o=Ce.omit(e,["sticky","disposition","spacing"]),s=t?uM:b.Box,l=w.useMemo(()=>t?{offsetTop:74,offsetBottom:r*2}:{},[t,r]);return f.jsx(b.Grid,{...o,item:!0,...n,children:f.jsx(s,{...l,children:f.jsx(b.Stack,{spacing:r,children:e.children})})})}function Gm(e){return f.jsx(f.Fragment,{children:e.children})}function Km(e){const{children:t}=e;return w.useMemo(()=>{const r={top:[],bottom:[]};return w.Children.forEach(t,o=>{if(w.isValidElement(o)&&(o==null?void 0:o.type)===Gm){const{position:s}=o.props;switch(s){case"top":r.top.push(o);break;case"bottom":r.bottom.push(o);break}}}),r},[t])}function Jm(e){const{disposition:t={xl:9,lg:9,md:8,sm:8,xs:12}}=e,n=Ce.omit(e,["disposition"]);return f.jsx(b.Grid,{...n,item:!0,...t,children:e.children})}function Xm(e){const t=km();return t===void 0?!1:e===t||Sm(e,t)}function Zm(e){const t=Fm();return w.useMemo(()=>Om(e,t),[t,e])}function AM(){const e=Dm(),{search:t}=gi.useLocation(),n=gi.useNavigate();return w.useCallback(o=>{n(`${e}/${o}${t}`)},[e,n])}function _m(){const e=Zm();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:Ce.map(e,(t,n)=>f.jsx(cg,{...t},n))})})}function cg(e){const t=he.useTranslate()??Ce.identity,n=qm(e),{selected:r,label:o,icon:s,onClick:l,badge:u,items:A,isGroup:g,level:p,errors:C=0}=n,{spacing:h}=wn(),[E,m]=w.useState(r),B=w.useCallback(R=>{m(!E),l(R)},[l,E]),v=s!==void 0,j=Ce.omit(e,["label","icon","selected","badge"]);return w.useEffect(()=>{r&&!E&&m(r)},[r,E,m]),f.jsxs(f.Fragment,{children:[f.jsx(b.ListItem,{...j,disablePadding:!0,children:f.jsxs(b.ListItemButton,{selected:r&&!g,onClick:B,sx:{pl:h*p},children:[v&&f.jsx(b.ListItemIcon,{children:s}),f.jsx(b.ListItemText,{inset:!v,primary:C===0?t(o):f.jsx(b.Badge,{variant:"dot",color:"error",sx:{"& > .MuiBadge-badge":{transform:"scale(1) translate(125%, 0)"}},children:t(o)})}),u&&f.jsx(b.ListItemAvatar,{children:f.jsx(Gs,{type:"filled",size:"xs",color:u.color??"default",children:u.content})}),g&&(E?f.jsx(fn.ExpandLess,{}):f.jsx(fn.ExpandMore,{}))]})}),g&&f.jsx(b.Collapse,{in:E,timeout:"auto",children:f.jsx(b.List,{children:Ce.map(A,(R,x)=>f.jsx(cg,{...R},x))})})]})}function qm(e){const{id:t}=e,n=Xm(t),r=Xl(t),o=AM(),s=Lm(),l=Vm(),u=Zm(t),A=!Ce.isEmpty(u),g=w.useCallback(C=>{A||(s?o(e.id):l(e.id)),Ce.isFunction(e.onClick)&&e.onClick(C)},[l,o,e,s,A]);return w.useMemo(()=>({...e,selected:n,onClick:g,items:u,isGroup:A,level:r}),[e,n,g,u,A])}function $m(e=[],t){const n=Ce.isArray(e)?e:[e],r=Ce.filter(n,o=>w.isValidElement(o));Ce.each(r,o=>{var s;t(o),$m(((s=o==null?void 0:o.props)==null?void 0:s.children)??[],t)})}function e0(e){const{errors:t}=fi.useFormState(),n=Nm(),{label:r,icon:o,badge:s,index:l=0,children:u}=e,A=sg(e),g=Hm(),p=Wm(),C=Xm(A),h=[];n&&(e.sources!==void 0?h.push(...e.sources):$m(u,m=>{var B;((B=m==null?void 0:m.props)==null?void 0:B.source)!==void 0&&h.push(m.props.source)}));const E=Ce.chain(h).uniq().map(m=>Ce.get(t,m)).reject(m=>m===void 0).value().length;return w.useEffect(()=>(g({id:A,index:l,label:r,icon:o,badge:s,errors:E}),()=>{p(A)}),[g,p,r,o,A,s,l,E]),f.jsx(b.Box,{display:C?"unset":"none",children:e.children})}function t0(e){const t=ug(e),n=sg(e);return f.jsx(e0,{...e,id:n,children:w.Children.map(t,r=>{const o=sg(r.props);return w.cloneElement(r,{id:`${n}.${o}`})})})}function n0(e){return f.jsx(e0,{...e})}function ug(e){const{children:t}=e;return w.useMemo(()=>Ce.chain(w.Children.toArray(t)).filter(r=>w.isValidElement(r)&&((r==null?void 0:r.type)===n0||(r==null?void 0:r.type)===t0)).map((r,o)=>w.cloneElement(r,{index:o})).value(),[t])}function dM(e){const{tabsDisposition:t,contentDisposition:n,spacing:r=2}=e,o=Ce.pick(e,["syncWithLocation","errorCount"]),s=Ce.omit(e,["tabsDisposition","contentDisposition","syncWithLocation"]),{top:l,bottom:u}=Km(e),A=ug(e);return f.jsx(Mm,{...o,children:f.jsxs(Pm,{...s,spacing:r,children:[f.jsxs(Ym,{disposition:t,spacing:r,children:[l,f.jsx(_m,{}),u]}),f.jsx(Jm,{disposition:n,children:A})]})})}const kt=dM;kt.BaseForm=Pm,kt.Content=Jm,kt.Provider=Mm,kt.useItems=Fm,kt.useSyncWithLocation=Lm,kt.useErrorCount=Nm,kt.useFormRootPath=Dm,kt.useActiveItem=km,kt.useSetActiveItem=Vm,kt.useAddItem=Hm,kt.useRemoveItem=Wm,kt.Sidebar=Ym,kt.SidebarSection=Gm,kt.SidebarSectionPosition=Um,kt.useSidebarChildren=Km,kt.NavMenu=_m,kt.NavMenuItem=cg,kt.useNavMenuItem=qm,kt.Tab=n0,kt.Group=t0,kt.useBaseItemChildren=ug;const gM=Ae(S.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"}})),fM=Ae(S.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}}})),pM=Ts(S.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0}})),Ag=e=>{const{title:t,modal:n,content:r,subheader:o,secondary:s,sx:l,...u}=e,A=xA(t);return f.jsx(Wn,{title:A,modal:n,content:r,subheader:o,secondary:s,sx:{...l,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!n,divider:!0,children:f.jsx(pM,{toolbar:f.jsx(ar,{}),...u})})};Ag.defaultProps={toolbar:f.jsx(ar,{children:f.jsx(S.SaveButton,{type:"button"})}),secondary:f.jsx(Mo,{children:f.jsx(S.DeleteWithConfirmButton,{})})},Ag.Tab=S.TabbedForm.Tab;const hM=k.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:o=!1,index:s,member:l,resource:u}=e,A=S.useTranslate(),[g,p]=k.useState(!1),{total:C,remove:h}=oC(),E=k.useCallback(()=>{p(!1),h(s)},[s,h]),m=w.useMemo(()=>({index:s,total:C,remove:()=>h(s)}),[s,C,h]);return f.jsxs(vA.Provider,{value:m,children:[w.Children.map(n,(B,v)=>{if(!w.isValidElement(B))return null;const{source:j,...R}=B.props;return f.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:w.cloneElement(B,{source:j?`${l}.${j}`:l,index:j?void 0:v,resource:u,disabled:r,...R,label:""})})}),!o&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2.5},children:f.jsx(Mo,{horizontal:!0,children:f.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:A("ra.action.delete")})})}),n.length>0&&f.jsx(S.Confirm,{isOpen:g,title:A("ra.action.remove_item"),content:A("ra.message.remove_item"),onConfirm:E,onClose:()=>p(!1)})]})});var CM=Array.isArray,_l=CM,EM=typeof Vn=="object"&&Vn&&Vn.Object===Object&&Vn,IM=EM,mM=IM,BM=typeof self=="object"&&self&&self.Object===Object&&self,vM=mM||BM||Function("return this")(),ql=vM,yM=ql,bM=yM.Symbol,$l=bM,r0=$l,o0=Object.prototype,QM=o0.hasOwnProperty,xM=o0.toString,_s=r0?r0.toStringTag:void 0;function wM(e){var t=QM.call(e,_s),n=e[_s];try{e[_s]=void 0;var r=!0}catch{}var o=xM.call(e);return r&&(t?e[_s]=n:delete e[_s]),o}var TM=wM,PM=Object.prototype,SM=PM.toString;function OM(e){return SM.call(e)}var jM=OM,i0=$l,MM=TM,RM=jM,DM="[object Null]",kM="[object Undefined]",s0=i0?i0.toStringTag:void 0;function FM(e){return e==null?e===void 0?kM:DM:s0&&s0 in Object(e)?MM(e):RM(e)}var dg=FM;function LM(e){return e!=null&&typeof e=="object"}var ec=LM,NM=dg,VM=ec,HM="[object Symbol]";function WM(e){return typeof e=="symbol"||VM(e)&&NM(e)==HM}var gg=WM,zM=_l,UM=gg,YM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,GM=/^\w*$/;function KM(e,t){if(zM(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||UM(e)?!0:GM.test(e)||!YM.test(e)||t!=null&&e in Object(t)}var JM=KM;function XM(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var a0=XM,ZM=dg,_M=a0,qM="[object AsyncFunction]",$M="[object Function]",eR="[object GeneratorFunction]",tR="[object Proxy]";function nR(e){if(!_M(e))return!1;var t=ZM(e);return t==$M||t==eR||t==qM||t==tR}var l0=nR,rR=ql,oR=rR["__core-js_shared__"],iR=oR,fg=iR,c0=function(){var e=/[^.]+$/.exec(fg&&fg.keys&&fg.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function sR(e){return!!c0&&c0 in e}var aR=sR,lR=Function.prototype,cR=lR.toString;function uR(e){if(e!=null){try{return cR.call(e)}catch{}try{return e+""}catch{}}return""}var AR=uR,dR=l0,gR=aR,fR=a0,pR=AR,hR=/[\\^$.*+?()[\]{}|]/g,CR=/^\[object .+?Constructor\]$/,ER=Function.prototype,IR=Object.prototype,mR=ER.toString,BR=IR.hasOwnProperty,vR=RegExp("^"+mR.call(BR).replace(hR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yR(e){if(!fR(e)||gR(e))return!1;var t=dR(e)?vR:CR;return t.test(pR(e))}var bR=yR;function QR(e,t){return e==null?void 0:e[t]}var xR=QR,wR=bR,TR=xR;function PR(e,t){var n=TR(e,t);return wR(n)?n:void 0}var tc=PR,SR=tc,OR=SR(Object,"create"),nc=OR,u0=nc;function jR(){this.__data__=u0?u0(null):{},this.size=0}var MR=jR;function RR(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var DR=RR,kR=nc,FR="__lodash_hash_undefined__",LR=Object.prototype,NR=LR.hasOwnProperty;function VR(e){var t=this.__data__;if(kR){var n=t[e];return n===FR?void 0:n}return NR.call(t,e)?t[e]:void 0}var HR=VR,WR=nc,zR=Object.prototype,UR=zR.hasOwnProperty;function YR(e){var t=this.__data__;return WR?t[e]!==void 0:UR.call(t,e)}var GR=YR,KR=nc,JR="__lodash_hash_undefined__";function XR(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=KR&&t===void 0?JR:t,this}var ZR=XR,_R=MR,qR=DR,$R=HR,eD=GR,tD=ZR;function Ni(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])}}Ni.prototype.clear=_R,Ni.prototype.delete=qR,Ni.prototype.get=$R,Ni.prototype.has=eD,Ni.prototype.set=tD;var nD=Ni;function rD(){this.__data__=[],this.size=0}var oD=rD;function iD(e,t){return e===t||e!==e&&t!==t}var sD=iD,aD=sD;function lD(e,t){for(var n=e.length;n--;)if(aD(e[n][0],t))return n;return-1}var rc=lD,cD=rc,uD=Array.prototype,AD=uD.splice;function dD(e){var t=this.__data__,n=cD(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():AD.call(t,n,1),--this.size,!0}var gD=dD,fD=rc;function pD(e){var t=this.__data__,n=fD(t,e);return n<0?void 0:t[n][1]}var hD=pD,CD=rc;function ED(e){return CD(this.__data__,e)>-1}var ID=ED,mD=rc;function BD(e,t){var n=this.__data__,r=mD(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var vD=BD,yD=oD,bD=gD,QD=hD,xD=ID,wD=vD;function Vi(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])}}Vi.prototype.clear=yD,Vi.prototype.delete=bD,Vi.prototype.get=QD,Vi.prototype.has=xD,Vi.prototype.set=wD;var TD=Vi,PD=tc,SD=ql,OD=PD(SD,"Map"),jD=OD,A0=nD,MD=TD,RD=jD;function DD(){this.size=0,this.__data__={hash:new A0,map:new(RD||MD),string:new A0}}var kD=DD;function FD(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var LD=FD,ND=LD;function VD(e,t){var n=e.__data__;return ND(t)?n[typeof t=="string"?"string":"hash"]:n.map}var oc=VD,HD=oc;function WD(e){var t=HD(this,e).delete(e);return this.size-=t?1:0,t}var zD=WD,UD=oc;function YD(e){return UD(this,e).get(e)}var GD=YD,KD=oc;function JD(e){return KD(this,e).has(e)}var XD=JD,ZD=oc;function _D(e,t){var n=ZD(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var qD=_D,$D=kD,ek=zD,tk=GD,nk=XD,rk=qD;function Hi(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])}}Hi.prototype.clear=$D,Hi.prototype.delete=ek,Hi.prototype.get=tk,Hi.prototype.has=nk,Hi.prototype.set=rk;var d0=Hi,g0=d0,ok="Expected a function";function pg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ok);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var l=e.apply(this,r);return n.cache=s.set(o,l)||s,l};return n.cache=new(pg.Cache||g0),n}pg.Cache=g0;var ik=pg,sk=ik,ak=500;function lk(e){var t=sk(e,function(r){return n.size===ak&&n.clear(),r}),n=t.cache;return t}var ck=lk,uk=ck,Ak=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dk=/\\(\\)?/g,gk=uk(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ak,function(n,r,o,s){t.push(o?s.replace(dk,"$1"):r||n)}),t}),fk=gk;function pk(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var f0=pk,p0=$l,hk=f0,Ck=_l,Ek=gg,Ik=1/0,h0=p0?p0.prototype:void 0,C0=h0?h0.toString:void 0;function E0(e){if(typeof e=="string")return e;if(Ck(e))return hk(e,E0)+"";if(Ek(e))return C0?C0.call(e):"";var t=e+"";return t=="0"&&1/e==-Ik?"-0":t}var mk=E0,Bk=mk;function vk(e){return e==null?"":Bk(e)}var yk=vk,bk=_l,Qk=JM,xk=fk,wk=yk;function Tk(e,t){return bk(e)?e:Qk(e,t)?[e]:xk(wk(e))}var Pk=Tk,Sk=gg,Ok=1/0;function jk(e){if(typeof e=="string"||Sk(e))return e;var t=e+"";return t=="0"&&1/e==-Ok?"-0":t}var Mk=jk,Rk=Pk,Dk=Mk;function kk(e,t){t=Rk(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Dk(t[n++])];return n&&n==r?e:void 0}var Fk=kk,Lk=Fk;function Nk(e,t,n){var r=e==null?void 0:Lk(e,t);return r===void 0?n:r}var Vk=Nk;const Hk=qr(Vk),I0=e=>{var q,J;const{children:t,resource:n,source:r,label:o,disableActions:s=!1,disableAdd:l=!1,disableRemove:u=!1,className:A,empty:g,template:p={}}=e,[C,h]=w.useState(!1),{fields:E,remove:m,replace:B,append:v}=S.useArrayInput(e),{resetField:j}=fi.useFormContext(),R=Pt(),x=he.useTranslate(),O=he.useRecordContext(e),P=w.useRef(p||{}),N=he.useTranslateLabel(),F=w.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=w.useCallback((H=void 0)=>{let K=H;H==null&&(K=P.current,w.Children.count(t)===1&&k.isValidElement(w.Children.only(t))&&!w.Children.only(t).props.source&&w.Children.map(t,ee=>k.isValidElement(ee)&&ee.type!==he.FormDataConsumer).some(Boolean)?K="":(K=K||{},w.Children.forEach(t,ee=>{k.isValidElement(ee)&&ee.type!==he.FormDataConsumer&&ee.props.source&&(K[ee.props.source]=ee.props.defaultValue??null)})));const L={...K,...p};v(L),j(`${r}.${E.length}`,{defaultValue:K})},[v,t,j,r,E.length,p]),Z=H=>K=>{X(),H&&H(K)},Y=w.useCallback(()=>{B([]),h(!1)},[B]),$=Hk(O,r),ce=w.useMemo(()=>({total:E.length,remove:F,source:r}),[E.length,F,r]),se=R.palette.mode==="dark"?R.palette.grey.A400:R.palette.grey.A800;return E?f.jsx(BA.Provider,{value:ce,children:f.jsxs("div",{className:A,children:[k.cloneElement(f.jsx(m0,{}),{label:o,source:r,disableAdd:l,template:p,onClick:Z((J=(q=e==null?void 0:e.addButton)==null?void 0:q.props)==null?void 0:J.onClick)}),f.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${se}`},children:f.jsxs(b.Table,{children:[f.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${se}`},children:f.jsxs(b.TableRow,{children:[w.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 ${se}}`},children:f.jsx(hM,{disableRemove:u,disableActions:s,index:K,member:`${r}.${K}`,onRemoveField:F,record:$&&$[K]||{},resource:n,source:r,children:t})},H.id))]})]})}),E.length>0&&f.jsx(S.Confirm,{isOpen:C,title:x("ra.action.clear_array_input"),content:x("ra.message.clear_array_input"),onConfirm:Y,onClose:()=>h(!1)})]})}):null},m0=e=>{const{label:t,disableAdd:n,onClick:r}=e,o=Pt(),s=o.palette.mode==="dark"?o.palette.grey.A400:o.palette.grey.A800,l=o.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(nt.PlusCircleOutlined,{style:{color:l}})}))]})},Wk=Ae(I0,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));m0.propTypes={label:c.oneOfType([c.string,c.bool]),source:c.string,defaultValue:c.any},I0.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 zk(e,t){const n=Ce.clone(e),{type:r,payload:o}=t;switch(r){case"updateMedia":{const s=Ce.chain(n.media).clone().extend(o).value();return Ce.extend(n,{media:s})}case"updateDrawer":{const s=Ce.chain(n.drawer).clone().extend(o).value();return Ce.extend(n,{drawer:s})}case"updateLogo":{const s=Ce.chain(n.logo).clone().extend(o).value();return Ce.extend(n,{logo:s})}case"updateNotifications":{const s=Ce.chain(n.notifications).clone().extend(o).value();return Ce.extend(n,{notifications:s})}case"updateTheme":{const s=Ce.chain(n.theme).clone().extend(o).value();return Ce.extend(n,{theme:s})}default:return n}}const Uk={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"}},B0=w.createContext(void 0);function v0(e){var Z;const t=he.useAuthProvider(),n=he.useGetIdentity(),r=b.useTheme(),o=b.useMediaQuery(r.breakpoints.down("md")),s=b.useMediaQuery(r.breakpoints.down("lg")),l=b.useMediaQuery(r.breakpoints.down("xl")),{miniDrawer:u,isHorizontalLayout:A,menuOrientation:g,drawerWidth:p}=wn(),C=A(g)&&!s,{drawerOpen:h,openDrawer:E}=to(),m=w.useCallback(()=>{E(!h)},[h,E]),[B,v]=w.useState(!1),[j,R]=w.useReducer(zk,Ce.chain(Uk).clone().merge({drawer:{open:!u||h}}).value()),x=w.useCallback(()=>v(!1),[]),O=w.useMemo(()=>({state:j,dispatch:R}),[j,R]),{logoIcon:P,logoMain:N,enableNotification:F,notification:X}=e;return w.useEffect(()=>{R({type:"updateMedia",payload:{downMd:o,downLg:s,downXl:l,horizontal:C}})},[g,o,s,l]),w.useEffect(()=>{R({type:"updateDrawer",payload:{open:h,width:p,handleDrawerToggle:m}})},[h,p,m]),w.useEffect(()=>{u||E(!l)},[l,u]),w.useEffect(()=>{R({type:"updateLogo",payload:{main:N,icon:P}})},[P,N]),w.useEffect(()=>{R({type:"updateNotifications",payload:{enable:F,resource:X??"entities/notification"}})},[F,X]),w.useEffect(()=>{R({type:"updateTheme",payload:{iconColorOpen:r.palette.mode==="dark"?"grey.200":"grey.300",iconColor:r.palette.mode==="dark"?"background.default":"grey.100"}})},[r.palette.mode]),w.useEffect(()=>{t.isImpersonating().then(Y=>{var $;v(!Y&&(($=n==null?void 0:n.data)==null?void 0:$.needToChangePassword)===!0)})},[(Z=n==null?void 0:n.data)==null?void 0:Z.needToChangePassword,t]),f.jsxs(B0.Provider,{value:O,children:[f.jsx(b.Dialog,{open:B,maxWidth:"xs",fullWidth:!0,children:f.jsx(og,{onSuccess:x,firstAccess:!0})}),e.children]})}function y0(e){return w.forwardRef((t,n)=>{const{logoIcon:r,logoMain:o,enableNotification:s}=t;return f.jsx(v0,{logoIcon:r,logoMain:o,enableNotification:s,children:f.jsx(e,{ref:n,...t})})})}function hg(){const e=w.useContext(B0);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function Yk(){return hg().dispatch}function Wi(){return hg().state}function Yn(){return Wi().media}function Uo(){return Wi().drawer}function b0(){return Wi().logo}function ic(){return Wi().notifications}function sc(){return Wi().theme}function Q0(){const{iconColor:e,iconColorOpen:t}=sc(),{open:n,handleDrawerToggle:r}=Uo();return f.jsx(co,{"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(nt.MenuFoldOutlined,{}):f.jsx(nt.MenuUnfoldOutlined,{})})}function x0(e){const t=w.useRef(),n=b.useTheme(),{downLg:r,horizontal:o}=Yn(),{open:s,width:l}=Uo(),u=r?b.AppBar:sC,A=Ti(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:o?"100%":s?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),g={position:"fixed",color:"inherit",elevation:0,sx:A};return r||Ce.extend(g,{open:s}),f.jsx(u,{ref:t,...g,children:f.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!o&&f.jsx(Q0,{}),e.children]})})}function Gk(e){const t=b.useTheme(),{notification:n,onClick:r,selected:o,divider:s}=e,{resource:l}=ic(),u=he.useNotify(),A=he.useRedirect(),[g]=he.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:Lr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(A(n==null?void 0:n.resource),r()):(r(),document.location.href=n==null?void 0:n.resource):r()},onFailure:()=>{u("resources.notifications.messages.readed.error","warning")}}),p=w.useCallback(()=>g(),[g]),[C]=he.useLocaleState(),h=w.useMemo(()=>Lr(n.created).locale(C).fromNow(),[n,C]);return f.jsx(b.ListItem,{disablePadding:!0,divider:s,children:f.jsxs(b.ListItemButton,{selected:o,onClick:p,children:[f.jsx(b.ListItemAvatar,{children:f.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:f.jsx(nt.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 Kk={width:36,height:36,fontSize:"1rem"},Jk={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function w0(){const{enable:e}=ic();return e?f.jsx(Xk,{}):null}function Xk(){const e=b.useTheme(),t=w.useRef(),n=he.useTranslate(),{resource:r}=ic(),{downMd:o}=Yn(),{iconColor:s,iconColorOpen:l}=sc(),[u,A]=w.useState(!1),[g,p]=w.useState([]),C=g.filter(v=>v.readed===null).length,h=w.useCallback(()=>A(!u),[u]),E=w.useCallback(()=>{t.current&&t.current.contains(event.target)||A(!1)},[t.current,A]),{data:m,isLoading:B}=he.useGetList(r,{pagination:{page:1,perPage:25},sort:{field:"created",order:"DESC"},filter:{readed:!1}});return w.useEffect(()=>{!B&&m&&p(m??[])},[m,B]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.jsx(co,{color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:u?l:s},"aria-label":"open profile",ref:t,"aria-controls":u?"profile-grow":void 0,"aria-haspopup":"true",onClick:h,children:f.jsx(b.Badge,{badgeContent:C,color:"primary",children:f.jsx(nt.BellOutlined,{})})}),f.jsx(b.Popper,{placement:o?"bottom":"bottom-end",open:u,anchorEl:t.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[o?-5:0,9]}}]},children:({TransitionProps:v})=>f.jsx(Ao,{type:"grow",position:o?"top":"top-right",in:open,...v,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:E,children:f.jsxs(Wn,{title:"Notification",elevation:0,border:!1,content:!1,secondary:f.jsx(f.Fragment,{children:C>0&&f.jsx(b.Tooltip,{title:"Mark as all read",children:f.jsx(co,{color:"success",size:"small",children:f.jsx(nt.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":Kk,"& .MuiListItemSecondaryAction-root":{...Jk,position:"relative"}},maxHeight:"calc(100vh - 240px)",overflow:"auto"},children:g.map((j,R)=>f.jsx(Gk,{selected:C>0,notification:j,onClick:h,divider:R<g.length-1},j.id))}),f.jsx(b.Divider,{}),f.jsx(b.ListItemButton,{sx:{textAlign:"center",py:"12px !important"},to:`/${r}`,LinkComponent:mt.Link,onClick:E,children:f.jsx(b.ListItemText,{primary:f.jsx(b.Typography,{variant:"h6",color:"primary",children:n("ra.notification.view_all")})})})]})})})})})]})}const Zk=()=>{const[e,t]=w.useState(!1),n=w.useCallback(()=>t(!1),[t]),r=w.useCallback(()=>t(!0),[t]),o=he.useTranslate();return f.jsxs(w.Fragment,{children:[f.jsxs(b.ListItemButton,{onClick:r,children:[f.jsx(b.ListItemIcon,{children:f.jsx(fn.Key,{})}),f.jsx(b.ListItemText,{primary:o("ra.auth.change_password")})]}),f.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:f.jsx(og,{onSuccess:n})})]})},_k=()=>{const e=he.useLogout(),t=he.useTranslate();return f.jsx(w.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:e,children:[f.jsx(b.ListItemIcon,{children:f.jsx(fn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},qk=()=>{const e=he.useTranslate(),t=he.useAuthProvider(),n=w.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,o]=w.useState(!1);return w.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(s=>o(s))},[t,o]),r?f.jsx(w.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:n,children:[f.jsx(b.ListItemIcon,{children:f.jsx(fn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};c.node,c.any.isRequired,c.any.isRequired;const T0=()=>{var B;const e=b.useTheme(),{identity:t}=S.useGetIdentity(),n=t!==void 0&&t.image&&t.image!==null&&t.image!=="",r=w.useRef(null),[o,s]=w.useState(!1),l=()=>{s(v=>!v)},u=v=>{r.current&&r.current.contains(v.target)||s(!1)},A=e.palette.mode==="dark"?"grey.200":"grey.300",g=S.useLogout(),p=S.useDataProvider(),C=S.useAuthProvider(),h=w.useCallback(()=>{g()},[C,g]),[E,m]=w.useState(null);return w.useEffect(()=>{if(!n)return;async function v(){var j=await p.getFile("/profile/me/image");m(j)}v()},[p,n]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.jsx(b.ButtonBase,{sx:{p:.25,bgcolor:o?A:"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":o?"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(Gs,{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:o,anchorEl:r.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:v})=>{var j;return f.jsx(Ao,{type:"grow",position:"top-right",in:o,...v,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:u,children:f.jsxs(Wn,{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(Gs,{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:(j=t==null?void 0:t.roles)==null?void 0:j.map(R=>R.name.replace("ROLE_","")).join(",")})]})]})}),f.jsx(b.Grid,{item:!0,children:f.jsx(b.Tooltip,{title:"Logout",children:f.jsx(co,{size:"large",sx:{color:"text.primary"},onClick:h,children:f.jsx(nt.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(Zk,{}),f.jsx(_k,{}),f.jsx(qk,{})]})})})]})})})})}})]})},P0=e=>{const t=Pt(),{downMd:n}=Yn(),{iconColor:r,iconColorOpen:o}=sc(),[s,l]=w.useState(!1),u=w.useRef(null),A=w.useCallback(()=>{l(!s)},[s]),g=w.useCallback(p=>{u.current&&u.current.contains(p.target)||l(!1)},[]);return n?f.jsxs(f.Fragment,{children:[f.jsx(b.Box,{sx:{flexShrink:0},children:f.jsx(co,{sx:{color:"text.primary",bgcolor:s?o:r},"aria-label":"open more menu",ref:u,"aria-controls":s?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:A,color:"secondary",variant:"light",children:f.jsx(nt.MoreOutlined,{})})}),f.jsx(b.Popper,{placement:"bottom-end",open:s,anchorEl:u.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 S0(e){return f.jsx(b.Box,{...e,flex:1})}function qs(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]})})}qs.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string},qs.defaultProps={copy:"© Applica Software Guru for"};var O0={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})(O0);var ac=O0.exports,Cg={};const $k=Fx(Uj);var j0;function lc(){return j0||(j0=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=$k}(Cg)),Cg}function M0(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=M0(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function R0(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=M0(e))&&(r&&(r+=" "),r+=t);return r}var e5="__lodash_hash_undefined__";function t5(e){return this.__data__.set(e,e5),this}var n5=t5;function r5(e){return this.__data__.has(e)}var o5=r5,i5=d0,s5=n5,a5=o5;function cc(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new i5;++t<n;)this.add(e[t])}cc.prototype.add=cc.prototype.push=s5,cc.prototype.has=a5;var D0=cc;function l5(e,t){return e.has(t)}var k0=l5;function c5(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var F0=c5;function u5(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var A5=u5,d5=dg,g5=ec,f5="[object Arguments]";function p5(e){return g5(e)&&d5(e)==f5}var h5=p5,L0=h5,C5=ec,N0=Object.prototype,E5=N0.hasOwnProperty,I5=N0.propertyIsEnumerable,m5=L0(function(){return arguments}())?L0:function(e){return C5(e)&&E5.call(e,"callee")&&!I5.call(e,"callee")},B5=m5,v5=9007199254740991;function y5(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=v5}var b5=y5;function Q5(e){return function(t){return e(t)}}var x5=Q5,w5=l0,T5=b5;function P5(e){return e!=null&&T5(e.length)&&!w5(e)}var S5=P5,O5=tc,j5=ql,M5=O5(j5,"Set"),R5=M5,Eg=globalThis&&globalThis.__assign||function(){return Eg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Eg.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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},V0=function(e){var t=e.className,n=e.sx,r=D5(e,["className","sx"]),o=he.useLoading(),s=Pt();return k.createElement(k5,{className:t,sx:n},o?k.createElement(Od,Eg({className:R0("app-loader",uc.loader),color:"inherit",size:s.spacing(2),thickness:6},r)):k.createElement(wB,{className:uc.loadedIcon}))};V0.propTypes={classes:c.object,className:c.string,width:c.string};var Ig="RaLoadingIndicator",uc={loader:"".concat(Ig,"-loader"),loadedIcon:"".concat(Ig,"-loadedIcon")},k5=Ae("div",{name:Ig,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat(uc.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat(uc.loadedIcon)]={},t});const mg=e=>e.scrollTop;function zi(e,t){var n,r;const{timeout:o,easing:s,style:l={}}=e;return{duration:(n=l.transitionDuration)!=null?n:typeof o=="number"?o:o[t.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof s=="object"?s[t.mode]:s,delay:l.transitionDelay}}const F5=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function L5(e,t,n){const r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),s=Ei(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const g=s.getComputedStyle(t);l=g.getPropertyValue("-webkit-transform")||g.getPropertyValue("transform")}let u=0,A=0;if(l&&l!=="none"&&typeof l=="string"){const g=l.split("(")[1].split(")")[0].split(",");u=parseInt(g[4],10),A=parseInt(g[5],10)}return e==="left"?o?`translateX(${o.right+u-r.left}px)`:`translateX(${s.innerWidth+u-r.left}px)`:e==="right"?o?`translateX(-${r.right-o.left-u}px)`:`translateX(-${r.left+r.width-u}px)`:e==="up"?o?`translateY(${o.bottom+A-r.top}px)`:`translateY(${s.innerHeight+A-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-A}px)`:`translateY(-${r.top+r.height-A}px)`}function H0(e){return typeof e=="function"?e():e}function Ac(e,t,n){const r=H0(n),o=L5(e,t,r);o&&(t.style.webkitTransform=o,t.style.transform=o)}const W0=k.forwardRef(function(t,n){const r=Pt(),o={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:A,container:g,direction:p="down",easing:C=o,in:h,onEnter:E,onEntered:m,onEntering:B,onExit:v,onExited:j,onExiting:R,style:x,timeout:O=s,TransitionComponent:P=bd}=t,N=Ue(t,F5),F=k.useRef(null),X=Qn(A.ref,F,n),Z=L=>ee=>{L&&(ee===void 0?L(F.current):L(F.current,ee))},Y=Z((L,ee)=>{Ac(p,L,g),mg(L),E&&E(L,ee)}),$=Z((L,ee)=>{const W=zi({timeout:O,style:x,easing:C},{mode:"enter"});L.style.webkitTransition=r.transitions.create("-webkit-transform",z({},W)),L.style.transition=r.transitions.create("transform",z({},W)),L.style.webkitTransform="none",L.style.transform="none",B&&B(L,ee)}),ce=Z(m),se=Z(R),q=Z(L=>{const ee=zi({timeout:O,style:x,easing:C},{mode:"exit"});L.style.webkitTransition=r.transitions.create("-webkit-transform",ee),L.style.transition=r.transitions.create("transform",ee),Ac(p,L,g),v&&v(L)}),J=Z(L=>{L.style.webkitTransition="",L.style.transition="",j&&j(L)}),H=L=>{l&&l(F.current,L)},K=k.useCallback(()=>{F.current&&Ac(p,F.current,g)},[p,g]);return k.useEffect(()=>{if(h||p==="down"||p==="right")return;const L=dh(()=>{F.current&&Ac(p,F.current,g)}),ee=Ei(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:Y,onEntered:ce,onEntering:$,onExit:q,onExited:J,onExiting:se,addEndListener:H,appear:u,in:h,timeout:O},N,{children:(L,ee)=>k.cloneElement(A,z({ref:X,style:z({visibility:L==="exited"&&!h?"hidden":void 0},x,A.props.style)},ee))}))});process.env.NODE_ENV!=="production"&&(W0.propTypes={addEndListener:c.func,appear:c.bool,children:hi.isRequired,container:Cr(c.oneOfType([Oo,c.func]),e=>{if(e.open){const t=H0(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(`
|
|
218
|
+
`),r3)),am=k.forwardRef(function(t,n){const r=Wt({props:t,name:"MuiCircularProgress"}),{className:o,color:s="primary",disableShrink:l=!1,size:u=40,style:A,thickness:g=3.6,value:p=0,variant:C="indeterminate"}=r,h=Ue(r,t3),E=z({},r,{color:s,disableShrink:l,size:u,thickness:g,value:p,variant:C}),m=o3(E),B={},v={},j={};if(C==="determinate"){const R=2*Math.PI*((uo-g)/2);B.strokeDasharray=R.toFixed(3),j["aria-valuenow"]=Math.round(p),B.strokeDashoffset=`${((100-p)/100*R).toFixed(3)}px`,v.transform="rotate(-90deg)"}return f.jsx(i3,z({className:Ye(m.root,o),style:z({width:u,height:u},v,A),ownerState:E,ref:n,role:"progressbar"},j,h,{children:f.jsx(s3,{className:m.svg,ownerState:E,viewBox:`${uo/2} ${uo/2} ${uo} ${uo}`,children:f.jsx(a3,{className:m.circle,style:B,ownerState:E,cx:uo,cy:uo,r:(uo-g)/2,fill:"none",strokeWidth:g})})}))});process.env.NODE_ENV!=="production"&&(am.propTypes={classes:c.object,className:c.string,color:c.oneOfType([c.oneOf(["inherit","primary","secondary","error","info","success","warning"]),c.string]),disableShrink:Cr(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 Od=am;function l3(e){return Lt("MuiLoadingButton",e)}const Fr=Ht("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),c3=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],u3=e=>{const{loading:t,loadingPosition:n,classes:r}=e,o={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Pe(n)}`],endIcon:[t&&`endIconLoading${Pe(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Pe(n)}`]},s=hr.unstable_composeClasses(o,l3,r);return z({},r,s)},A3=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",d3=Ae($j,{shouldForwardProp:e=>A3(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${Fr.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${Fr.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>z({[`& .${Fr.startIconLoadingStart}, & .${Fr.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}),[`&.${Fr.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${Fr.startIconLoadingStart}, & .${Fr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${Fr.startIconLoadingStart}, & .${Fr.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),g3=Ae("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})),lm=k.forwardRef(function(t,n){const r=Wt({props:t,name:"MuiLoadingButton"}),{children:o,disabled:s=!1,id:l,loading:u=!1,loadingIndicator:A,loadingPosition:g="center",variant:p="text"}=r,C=Ue(r,c3),h=_u(l),E=A??f.jsx(Od,{"aria-labelledby":h,color:"inherit",size:16}),m=z({},r,{disabled:s,loading:u,loadingIndicator:E,loadingPosition:g,variant:p}),B=u3(m),v=u?f.jsx(g3,{className:B.loadingIndicator,ownerState:m,children:E}):null;return f.jsxs(d3,z({disabled:s||u,id:h,ref:n},C,{variant:p,classes:B,ownerState:m,children:[m.loadingPosition==="end"?o:v,m.loadingPosition==="end"?v:o]}))});process.env.NODE_ENV!=="production"&&(lm.propTypes={children:c.node,classes:c.object,disabled:c.bool,id:c.string,loading:c.bool,loadingIndicator:c.node,loadingPosition:Cr(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 f3=lm;function jd({variant:e,theme:t,color:n,loadingPosition:r}){const o=rn(t,n),{lighter:s,main:l,dark:u,contrastText:A}=o,g=`${n}Button`,p=Fi(t,g),C={"& .MuiLoadingButton-loadingIndicator":{color:l}},h={...r&&r!=="center"&&{color:l}},E={"&::after":{boxShadow:`0 0 6px 6px ${He(l,.9)}`},"&:active::after":{boxShadow:`0 0 0 0 ${He(l,.9)}`},"&:focus-visible":{outline:`2px solid ${u}`,outlineOffset:2}};switch(e){case"contained":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...E};case"light":return{backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{backgroundColor:u,color:A},...E};case"shadow":return{boxShadow:p,backgroundColor:l,...r&&r!=="center"&&{color:A},"& .MuiLoadingButton-loadingIndicator":{color:A},"&:hover":{boxShadow:"none",backgroundColor:u,color:A},...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 p3=Ae(f3,{shouldForwardProp:e=>e!=="shape"&&e!=="variant"})(({theme:e,variant:t,shape:n,color:r,loading:o,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"&&{...jd({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")&&!o&&{color:"#fff"},...t!=="text"&&{...jd({variant:t,theme:e,color:r,loadingPosition:s})},"&.Mui-disabled":{...t!=="text"&&{...jd({variant:t,theme:e,color:r,loadingPosition:s})}}})),Md=w.forwardRef(({variant:e="text",shape:t,children:n,color:r="primary",...o},s)=>{const l=Pt();return f.jsx(p3,{ref:s,variant:e,shape:t,theme:l,loadingPosition:o.loadingPosition,loading:o.loading,color:r,...o,children:n})});Md.propTypes={variant:c.string,shape:c.string,children:c.node,color:c.string},Md.displayName="LoadingButton";function h3({color:e,theme:t,labelColor:n}){const r=rn(t,e),{main:o,contrastText:s}=r;let l=e||"";return["primary","secondary","info","success","warning","error"].includes(l)?{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:o,color:n||s},[`& .${b.tooltipClasses.arrow}`]:{color:o}}:{[`& .${b.tooltipClasses.tooltip}`]:{backgroundColor:l,color:n||s,boxShadow:t.shadows[1]},[`& .${b.tooltipClasses.arrow}`]:{color:l}}}const C3=Ae(({className:e,...t})=>f.jsx(b.Tooltip,{...t,classes:{popper:e}}),{shouldForwardProp:e=>e!=="color"&&e!=="labelColor"})(({theme:e,color:t,labelColor:n})=>({...t&&h3({color:t,theme:e,labelColor:n})}));function cm({children:e,arrow:t,labelColor:n="",...r}){const o=Pt();return f.jsx(b.Box,{display:"flex",children:f.jsx(C3,{arrow:t,...r,theme:o,labelColor:n,children:e})})}cm.propTypes={children:c.element,arrow:c.bool,labelColor:c.string,rest:c.array};const Ao=w.forwardRef(({children:e,position:t="top-left",type:n="grow",direction:r="up",...o},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,{...o,timeout:{appear:0,enter:150,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="collapse"&&f.jsx(b.Collapse,{...o,sx:l,children:e}),n==="fade"&&f.jsx(b.Fade,{...o,timeout:{appear:0,enter:300,exit:150},children:f.jsx(b.Box,{sx:l,children:e})}),n==="slide"&&f.jsx(b.Slide,{...o,timeout:{appear:0,enter:150,exit:150},direction:r,children:f.jsx(b.Box,{sx:l,children:e})}),n==="zoom"&&f.jsx(b.Zoom,{...o,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"])},w.forwardRef(function(t,n){return f.jsx(b.Zoom,{ref:n,timeout:200,...t})});function um({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)}%`})})]})}um.propTypes={value:c.number};function Am({value:e,size:t,variant:n,thickness:r,showLabel:o,pathColor:s,sx:l,...u}){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,...u,value:100}),o&&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,...u})]})}Am.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 dm({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})]})}dm.propTypes={icon:c.node,value:c.number};function gm({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)}%`})})]})}gm.propTypes={value:c.number};const fm=w.createContext({});function E3(e){const{useDefaults:t=!1,queryOptions:n={}}=e,r=S.useResourceContext(),o=S.useDataProvider(),{search:s}=gi.useLocation(),l=`${r}/new`,u=w.useCallback(()=>{if(!t||!Ce.isFunction(o.get))return Promise.resolve({});const h={};return new URLSearchParams(s??"").forEach((E,m)=>{h[m]=E}),o.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,o]),A=w.useMemo(()=>Ce.chain(n).extend({queryKey:[r,s],queryFn:u}).value(),[r,s,u,n]),{data:g,isLoading:p}=Nu.useQuery(A),C=Ce.omit(e,["useDefaults"]);return p?f.jsx(b.Stack,{alignItems:"center",justifyContent:"center",flex:1,p:2,children:f.jsx(b.CircularProgress,{})}):f.jsx(fm.Provider,{value:g??{},children:f.jsx(S.Create,{...C})})}function I3(){return w.useContext(fm)}const m3=Ae(E3,{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",backgroundColor:e.palette.background.default}})),B3=Ts(S.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)}})),ar=e=>f.jsx(B3,{...e});ar.defaultProps={...S.Toolbar.defaultProps},ar.propTypes={...S.Toolbar.propTypes};const Rd=({children:e,content:t,title:n,subheader:r,secondary:o,toolbar:s,...l})=>{const u=S.useTranslate(),A=S.useResourceContext(),{cardTitle:g,cardSubheader:p}=w.useMemo(()=>{const C=n||`resources.${A}.title`;return{cardTitle:u(C,{_:C}),cardSubheader:r!==null?u(r,{_:r}):null}},[A,r,n,u]);return f.jsx(b.Grid,{item:!0,...l,children:f.jsx(Wn,{content:t,title:g,subheader:p,secondary:o,divider:!0,children:f.jsxs(w.Fragment,{children:[e,s===!0?f.jsx(ar,{children:f.jsx(S.SaveButton,{})}):s]})})})};Rd.defaultProps={...b.Grid.defaultProps,content:!0,subheader:null,title:null,secondary:null,toolbar:!1,item:!0,lg:12,md:12,sm:12,xs:12},Rd.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 v3=Ae(S.Form,{name:"RaApplicaCardForm",slot:"root"})(({theme:e,spacing:t})=>({backgroundColor:"transparent","& .RaToolbar-desktopToolbar":{marginTop:e.spacing(t*2),padding:0}})),zl=({children:e,spacing:t,defaultValues:n,...r})=>{const{spacing:o}=wn();return f.jsx(v3,{defaultValues:n,spacing:t||o,children:f.jsx(b.Grid,{container:!0,...r,spacing:t||o,children:e})})};zl.propTypes={...b.Grid.propTypes,...S.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},zl.defaultProps={...b.Stack.defaultProps},zl.Section=Rd;const y3=Ts(S.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}})),Ul=({title:e,modal:t,content:n,subheader:r,secondary:o,sx:s,...l})=>{const u=xA(e),A=S.useRecordContext();return f.jsx(Wn,{content:n,title:u,subheader:r,secondary:A!=null&&A.id?o:null,sx:{...s,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!t,divider:!0,children:f.jsx(y3,{toolbar:f.jsx(ar,{}),...l})})};Ul.defaultProps={modal:!1,content:!1,subheader:null,title:null,toolbar:f.jsx(ar,{children:f.jsx(S.SaveButton,{type:"button"})}),secondary:f.jsx(Mo,{children:f.jsx(S.DeleteWithConfirmButton,{})})},Ul.propTypes={...S.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 Yl=({label:e,children:t,display:n,helperText:r,sx:o,addLabel:s,divider:l,...u})=>{const A=Xt.useTheme(),{getCurrentDialog:g}=Ro(),{source:p,resource:C,isRequired:h}=u,{getFieldState:E,formState:m}=fi.useFormContext(),{error:B}=E(p,m),v=g();return f.jsxs(b.Stack,{spacing:1,sx:{"& .MuiFormHelperText-root":{color:B?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...o},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:!!B,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(S.FieldTitle,{label:e,source:p,resource:v||C,isRequired:h})}),w.isValidElement(t)?w.cloneElement(t,{...t.props,...u,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})]})};Yl.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},Yl.defaultProps={display:"label",divider:!1};const b3=Ae(S.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%"}}})),Q3=({label:e,addLabel:t,source:n,helperText:r,divider:o=!0,...s})=>f.jsx(Yl,{label:e,addLabel:t,source:n,helperText:r,divider:o,children:f.jsx(b3,{source:n,label:!1,...s})}),Dd=({canEdit:e,canDelete:t,canClone:n})=>!e&&!t&&!n?null:f.jsxs(Mo,{children:[e&&f.jsx(S.EditButton,{}),t&&f.jsx(S.DeleteWithConfirmButton,{}),n&&f.jsx(S.CloneButton,{})]});Dd.defaultProps={canEdit:!0,canDelete:!0,canClone:!1},Dd.propTypes={canEdit:c.bool,canDelete:c.bool,canClone:c.bool};const pm=Ae("div",{name:"ApplicaBaseAttachmentField",overridesResolver:(e,t)=>t.root})({display:"inline-block"}),x3=Ae("ul")({display:"inline-block"}),hm=e=>{var p;const{className:t,emptyText:n,source:r,title:o,...s}=e,l=he.useRecordContext(e),u=dt.get(l,r),A=he.useTranslate();if(!u)return n?f.jsx(b.Typography,{component:"span",variant:"body2",className:t,...s,children:n&&A(n,{_:n})}):f.jsx(pm,{className:t,...s});if(Array.isArray(u))return f.jsx(x3,{className:t,...s,children:u.map((C,h)=>{var m;const E=o instanceof String?(m=dt.get(C,o))==null?void 0:m.toString():o;return f.jsx("li",{children:E},h)})});const g=o instanceof String?(p=dt.get(l,o))==null?void 0:p.toString():o;return f.jsx(pm,{className:t,...s,children:g})};hm.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 Cm={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){var n=1e3,r=6e4,o=36e5,s="millisecond",l="second",u="minute",A="hour",g="day",p="week",C="month",h="quarter",E="year",m="date",B="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,j=/\[([^\]]+)]|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(q){var J=["th","st","nd","rd"],H=q%100;return"["+q+(J[(H-20)%10]||J[H]||J[0])+"]"}},x=function(q,J,H){var K=String(q);return!K||K.length>=J?q:""+Array(J+1-K.length).join(H)+q},O={s:x,z:function(q){var J=-q.utcOffset(),H=Math.abs(J),K=Math.floor(H/60),L=H%60;return(J<=0?"+":"-")+x(K,2,"0")+":"+x(L,2,"0")},m:function q(J,H){if(J.date()<H.date())return-q(H,J);var K=12*(H.year()-J.year())+(H.month()-J.month()),L=J.clone().add(K,C),ee=H-L<0,W=J.clone().add(K+(ee?-1:1),C);return+(-(K+(H-L)/(ee?L-W:W-L))||0)},a:function(q){return q<0?Math.ceil(q)||0:Math.floor(q)},p:function(q){return{M:C,y:E,w:p,d:g,D:m,h:A,m:u,s:l,ms:s,Q:h}[q]||String(q||"").toLowerCase().replace(/s$/,"")},u:function(q){return q===void 0}},P="en",N={};N[P]=R;var F="$isDayjsObject",X=function(q){return q instanceof ce||!(!q||!q[F])},Z=function q(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 W=J.split("-");if(!L&&W.length>1)return q(W[0])}else{var _=J.name;N[_]=J,L=_}return!K&&L&&(P=L),L||!K&&P},Y=function(q,J){if(X(q))return q.clone();var H=typeof J=="object"?J:{};return H.date=q,H.args=arguments,new ce(H)},$=O;$.l=Z,$.i=X,$.w=function(q,J){return Y(q,{locale:J.$L,utc:J.$u,x:J.$x,$offset:J.$offset})};var ce=function(){function q(H){this.$L=Z(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[F]=!0}var J=q.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($.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var W=L.match(v);if(W){var _=W[2]-1||0,de=(W[7]||"0").substring(0,3);return ee?new Date(Date.UTC(W[1],_,W[3]||1,W[4]||0,W[5]||0,W[6]||0,de)):new Date(W[1],_,W[3]||1,W[4]||0,W[5]||0,W[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 $},J.isValid=function(){return this.$d.toString()!==B},J.isSame=function(H,K){var L=Y(H);return this.startOf(K)<=L&&L<=this.endOf(K)},J.isAfter=function(H,K){return Y(H)<this.startOf(K)},J.isBefore=function(H,K){return this.endOf(K)<Y(H)},J.$g=function(H,K,L){return $.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=!!$.u(K)||K,W=$.p(H),_=function(Ee,Be){var xe=$.w(L.$u?Date.UTC(L.$y,Be,Ee):new Date(L.$y,Be,Ee),L);return ee?xe:xe.endOf(g)},de=function(Ee,Be){return $.w(L.toDate()[Ee].apply(L.toDate("s"),(ee?[0,0,0,0]:[23,59,59,999]).slice(Be)),L)},fe=this.$W,ue=this.$M,ge=this.$D,pe="set"+(this.$u?"UTC":"");switch(W){case E:return ee?_(1,0):_(31,11);case C:return ee?_(1,ue):_(0,ue+1);case p:var ve=this.$locale().weekStart||0,Ie=(fe<ve?fe+7:fe)-ve;return _(ee?ge-Ie:ge+(6-Ie),ue);case g:case m:return de(pe+"Hours",0);case A:return de(pe+"Minutes",1);case u: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=$.p(H),W="set"+(this.$u?"UTC":""),_=(L={},L[g]=W+"Date",L[m]=W+"Date",L[C]=W+"Month",L[E]=W+"FullYear",L[A]=W+"Hours",L[u]=W+"Minutes",L[l]=W+"Seconds",L[s]=W+"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[_](de),fe.init(),this.$d=fe.set(m,Math.min(this.$D,fe.daysInMonth())).$d}else _&&this.$d[_](de);return this.init(),this},J.set=function(H,K){return this.clone().$set(H,K)},J.get=function(H){return this[$.p(H)]()},J.add=function(H,K){var L,ee=this;H=Number(H);var W=$.p(K),_=function(ue){var ge=Y(ee);return $.w(ge.date(ge.date()+Math.round(ue*H)),ee)};if(W===C)return this.set(C,this.$M+H);if(W===E)return this.set(E,this.$y+H);if(W===g)return _(1);if(W===p)return _(7);var de=(L={},L[u]=r,L[A]=o,L[l]=n,L)[W]||1,fe=this.$d.getTime()+H*de;return $.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",W=$.z(this),_=this.$H,de=this.$m,fe=this.$M,ue=L.weekdays,ge=L.months,pe=L.meridiem,ve=function(Be,xe,le,Ve){return Be&&(Be[xe]||Be(K,ee))||le[xe].slice(0,Ve)},Ie=function(Be){return $.s(_%12||12,Be,"0")},Ee=pe||function(Be,xe,le){var Ve=Be<12?"AM":"PM";return le?Ve.toLowerCase():Ve};return ee.replace(j,function(Be,xe){return xe||function(le){switch(le){case"YY":return String(K.$y).slice(-2);case"YYYY":return $.s(K.$y,4,"0");case"M":return fe+1;case"MM":return $.s(fe+1,2,"0");case"MMM":return ve(L.monthsShort,fe,ge,3);case"MMMM":return ve(ge,fe);case"D":return K.$D;case"DD":return $.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return ve(L.weekdaysMin,K.$W,ue,2);case"ddd":return ve(L.weekdaysShort,K.$W,ue,3);case"dddd":return ue[K.$W];case"H":return String(_);case"HH":return $.s(_,2,"0");case"h":return Ie(1);case"hh":return Ie(2);case"a":return Ee(_,de,!0);case"A":return Ee(_,de,!1);case"m":return String(de);case"mm":return $.s(de,2,"0");case"s":return String(K.$s);case"ss":return $.s(K.$s,2,"0");case"SSS":return $.s(K.$ms,3,"0");case"Z":return W}return null}(Be)||W.replace(":","")})},J.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},J.diff=function(H,K,L){var ee,W=this,_=$.p(K),de=Y(H),fe=(de.utcOffset()-this.utcOffset())*r,ue=this-de,ge=function(){return $.m(W,de)};switch(_){case E:ee=ge()/12;break;case C:ee=ge();break;case h:ee=ge()/3;break;case p:ee=(ue-fe)/6048e5;break;case g:ee=(ue-fe)/864e5;break;case A:ee=ue/o;break;case u:ee=ue/r;break;case l:ee=ue/n;break;default:ee=ue}return L?ee:$.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 $.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()},q}(),se=ce.prototype;return Y.prototype=se,[["$ms",s],["$s",l],["$m",u],["$H",A],["$W",g],["$M",C],["$y",E],["$D",m]].forEach(function(q){se[q[1]]=function(J){return this.$g(J,q[0],q[1])}}),Y.extend=function(q,J){return q.$i||(q(J,ce,Y),q.$i=!0),Y},Y.locale=Z,Y.isDayjs=X,Y.unix=function(q){return Y(1e3*q)},Y.en=N[P],Y.Ls=N,Y.p={},Y})})(Cm);var w3=Cm.exports;const Lr=qr(w3),kd=({entityId:e,property:t,disabled:n,userResource:r="entities/user",...o})=>{const[s,l]=w.useState(null),u=S.useRecordContext(o),A=S.useDataProvider(),g=S.useResourceContext(),p=w.useCallback(async E=>{E.preventDefault(),E.stopPropagation();const m=dt.get(u,o==null?void 0:o.source),B=g.replace("entities/",""),v=await A.getFile(`/attachments/${B}/${e||(u==null?void 0:u.id)}/${t||(o==null?void 0:o.source)}/${(m==null?void 0:m.id)||(u==null?void 0:u.id)}`),j=document.createElement("a");j.href=v,j.download=dt.get(u,(o==null?void 0:o.title)||(o==null?void 0:o.source)),j.click()},[A,u,e,g,t,o==null?void 0:o.source,o==null?void 0:o.title]),C=w.useMemo(()=>({...u,[o==null?void 0:o.source]:(u==null?void 0:u.src)||dt.get(u,o==null?void 0:o.source),[o==null?void 0:o.title]:(u==null?void 0:u.title)||dt.get(u,(o==null?void 0:o.title)||(o==null?void 0:o.source))}),[u,o==null?void 0:o.source,o==null?void 0:o.title]),h=S.useTranslate();return w.useEffect(()=>{!u||!(u!=null&&u.userId)||A.getOne(r,{id:u==null?void 0:u.userId}).then(({data:E})=>l(E)).catch(()=>l(null))},[u,A,r]),f.jsx(hm,{...o,disabled:n,record:C,onClick:p,title:f.jsxs(b.Box,{sx:{cursor:"pointer"},children:[f.jsx(b.Typography,{variant:"subtitle1",children:dt.get(C,(o==null?void 0:o.title)||(o==null?void 0:o.source))}),f.jsxs(b.Typography,{variant:"caption",color:"secondary",children:[dt.get(C,"sizeDescription"),s&&" | ",s&&h("ra.attachment.info",{user:s==null?void 0:s.name,created:Lr(C==null?void 0:C.createdAt).format("DD/MM/YYYY HH:mm")})]})]})})};kd.propTypes={...S.FileField.propTypes,source:c.string,title:c.string,disabled:c.bool};const T3=Ae(S.ImageField,{name:"RaApplicaImageField",slot:"root"})(()=>({})),Js=e=>{const t=`_${e==null?void 0:e.source}`;return f.jsx(T3,{...e,source:t})};Js.propTypes={...S.ImageField.propTypes,source:c.string};const Gl=({width:e,height:t,circle:n,justify:r,record:o,...s})=>{const l=w.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]),u=S.useRecordContext(),A=o||u;return f.jsx(Js,{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:A})};Gl.defaultProps={...Js.defaultProps,width:150,height:150,circle:!1,justify:"flex-start"},Gl.propTypes={...Js.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 Em={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Vn,function(){return function(n,r,o){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 u(g,p,C,h){return s.fromToBase(g,p,C,h)}o.en.relativeTime=l,s.fromToBase=function(g,p,C,h,E){for(var m,B,v,j=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"}],x=R.length,O=0;O<x;O+=1){var P=R[O];P.d&&(m=h?o(g).diff(C,P.d,!0):C.diff(g,P.d,!0));var N=(n.rounding||Math.round)(Math.abs(m));if(v=m>0,N<=P.r||!P.r){N<=1&&O>0&&(P=R[O-1]);var F=j[P.l];E&&(N=E(""+N)),B=typeof F=="string"?F.replace("%d",N):F(N,p,P.l,v);break}}if(p)return B;var X=v?j.future:j.past;return typeof X=="function"?X(B):X.replace("%s",B)},s.to=function(g,p){return u(g,p,this,!0)},s.from=function(g,p){return u(g,p,this)};var A=function(g){return g.$u?o.utc():o()};s.toNow=function(g){return this.to(A(this),g)},s.fromNow=function(g){return this.from(A(this),g)}}})})(Em);var P3=Em.exports;const S3=qr(P3);Lr.extend(S3);const Kl=e=>{const t=S.useRecordContext(e),[n]=S.useLocaleState(),r=w.useMemo(()=>Lr(dt.get(t,e==null?void 0:e.source)).locale(n).fromNow(),[t,e==null?void 0:e.source,n]);return f.jsxs(w.Fragment,{children:[f.jsx(S.DateField,{record:t,source:e.source,showTime:!0}),f.jsx("br",{}),f.jsx(b.Typography,{variant:"caption",color:"textSecondary",children:r})]})};Kl.displayName="DateAgoField",Kl.propTypes={source:c.string.isRequired};const Im=Ae(S.DateField,{name:"RaApplicaDateField",slot:"Root"})(()=>({}));Im.propTypes={...S.DateField.propTypes};const Fd=e=>f.jsx(Im,{...e});Fd.defaultProps={...S.DateField.defaultProps,variant:"body1"},Fd.propTypes={...S.DateField.propTypes};const mm=Ae(S.EmailField,{name:"RaApplicaEmailField",slot:"Root"})(()=>({}));mm.propTypes={...S.EmailField.propTypes};const Ld=e=>f.jsx(mm,{...e});Ld.defaultProps={...S.EmailField.defaultProps,variant:"body1"},Ld.propTypes={...S.EmailField.propTypes};const O3=Ae(S.FileField,{name:"RaApplicaFileField",slot:"root"})(()=>({})),Nd=({...e})=>{const t=S.useRecordContext(e),n=w.useCallback(r=>{r.preventDefault(),r.stopPropagation();const o=dt.get(t,`_${e==null?void 0:e.source}`,dt.get(t,e==null?void 0:e.source)),s=dt.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=o,l.download=s,l.click()},[e==null?void 0:e.source,t,e==null?void 0:e.title]);return f.jsx(O3,{...e,record:t,onClick:n})};Nd.propTypes={...S.FileField.propTypes,source:c.string,title:c.string};const Bm=e=>f.jsx(S.FunctionField,{...e});Bm.defaultProps={variant:"body1"};const j3=Ae("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"}})),Vd=({source:e,defaultValue:t,...n})=>{const r=S.useRecordContext(n),o=dt.get(r,e,t);return f.jsx("span",{dangerouslySetInnerHTML:{__html:o&&o!==null?o:t}})};Vd.propTypes={defaultValue:c.any,source:c.string,record:c.object},Vd.defaultProps={defaultValue:" "};const vm=({title:e,children:t})=>e&&e!==!1?f.jsx(b.Tooltip,{title:e,placement:"top",children:t}):t;vm.propTypes={title:c.oneOfType([c.string,c.bool]),children:c.oneOfType([c.element,c.arrayOf(c.element)])};const Hd=({label:e,source:t,defaultValue:n,children:r,tooltip:o,...s})=>{const{getCurrentDialog:l}=Ro(),u=S.useRecordContext(s),A=S.useResourceContext(s),g=l(),p=w.useMemo(()=>!o||o===!1?!1:typeof o=="function"?o(u):typeof o=="string"?dt.get(u,o,o):o,[u,o]);return f.jsx(vm,{title:p,children:f.jsxs(w.Fragment,{children:[f.jsx(b.InputLabel,{children:f.jsx(S.FieldTitle,{label:e,source:t,resource:g||A})}),f.jsx(j3,{...s,children:w.cloneElement(r,{source:t,record:u,defaultValue:n,resource:g||A})})]})})};Hd.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},Hd.defaultProps={defaultValue:" ",children:f.jsx(Vd,{})};const Wd=function({children:e,className:t}){return f.jsx("div",{className:t,children:e})};Wd.defaultProps={children:null,className:""},Wd.propTypes={children:c.node,className:c.string};const M3=Ts(Wd,{name:"RaApplicaReferenceManyField",slot:"root"})(({theme:e,margin:t,border:n,bulkActionButtons:r})=>({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:r===!1?0: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}}})),Li=e=>f.jsx(M3,{...e,children:f.jsx(S.ReferenceManyField,{pagination:f.jsx(S.Pagination,{}),...e})});Li.defaultProps={margin:!1,border:!1},Li.propTypes={...S.ReferenceManyField.propTypes,margin:c.bool,border:c.bool};const ym=({source:e,...t})=>{const n=S.useRecordContext(t),r=dt.get(n,e,0),o=r/1024,s=o/1024,l=s/1024,u=l>1?`${l.toFixed(2)} GB`:s>1?`${s.toFixed(2)} MB`:o>1?`${o.toFixed(2)} KB`:`${r.toFixed(2)} B`;return f.jsx(b.Typography,{component:"span",variant:"body1",...t,children:u})};ym.propTypes={record:c.object,source:c.string};const bm=Ae(S.TextField,{name:"RaApplicaTextField",slot:"Root"})(()=>({}));bm.propTypes={...S.TextField.propTypes};const zd=e=>f.jsx(bm,{...e});zd.defaultProps={...S.TextField.defaultProps,variant:"body1"},zd.propTypes={...S.TextField.propTypes};const ut=({label:e,children:t,display:n,helperText:r,sx:o,addLabel:s,divider:l,...u})=>{const A=Xt.useTheme(),{getCurrentDialog:g}=Ro(),{source:p,resource:C,isRequired:h}=u,{fieldState:{invalid:E}}=S.useInput(u),m=g();return f.jsxs(b.Stack,{spacing:1,sx:{width:u!=null&&u.fullWidth?"100%":"auto","& .MuiFormHelperText-root":{color:E?A.palette.error.main:A.palette.text.secondary,"& span":{display:"none"}},...o},children:[n==="label"&&e!==!1&&s!==!1&&f.jsx(b.InputLabel,{error:E===!0,sx:{borderBottom:l?`1px solid ${A.palette.divider}`:"none",pb:l?1:0,mt:l?1:0},children:f.jsx(S.FieldTitle,{label:e,source:p,resource:m||C,isRequired:h})}),w.isValidElement(t)?w.cloneElement(t,{...t.props,...u,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})]})};ut.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},ut.defaultProps={display:"label",divider:!1};const R3=e=>e?{"& .RaFileInput-removeButton > .RaFileInputPreview-removeButton":{display:"none",visiblity:"hidden"},"& .RaFileInput-dropZone":{display:"none",visiblity:"hidden"}}:{},D3=Ae(S.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}},...R3(e)})),Ud=({children:e,disabled:t,type:n,...r})=>{const o=S.useRecordContext(r),s=r==null?void 0:r.source,l=o==null?void 0:o.id;return S.useInput({source:`__${n}__${r==null?void 0:r.source}`,defaultValue:r==null?void 0:r.source}),f.jsx(ut,{...r,children:f.jsx(D3,{disabled:t,children:w.cloneElement(e,{...e.props,entityId:l,property:s})})})};Ud.propTypes={...S.FileInput.propTypes,children:c.node,multiple:c.bool,disabled:c.bool},Ud.defaultProps={children:f.jsx(kd,{title:"name",source:"path"}),multiple:!0,disabled:!1,type:"attachment"};const k3=Ae(S.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"}})),Yd=({...e})=>f.jsx(ut,{...e,children:f.jsx(k3,{})});Yd.propTypes={...S.AutocompleteArrayInput.propTypes,...ut.propTypes},Yd.defaultProps={...S.AutocompleteArrayInput.defaultProps,size:"small"};const F3=Ae(S.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"}})),Gd=e=>{const{perPage:t,...n}=e;return f.jsx(ut,{...n,children:f.jsx(F3,{})})};Gd.propTypes={...S.AutocompleteInput.propTypes,...ut.propTypes},Gd.defaultProps={...S.AutocompleteInput.defaultProps,size:"small"};const L3=Ae(S.BooleanInput,{name:"RaApplicaBooleanInput",slot:"Root"})(()=>({})),Kd=({horizontal:e,...t})=>{const n=Pt();return f.jsx(ut,{...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(L3,{})})};Kd.defaultProps={...S.BooleanInput.defaultProps,...ut.defaultProps},Kd.propTypes={...S.BooleanInput.propTypes,...ut.propTypes,horizontal:c.bool};const N3=Ae(S.DateInput,{name:"RaApplicaDateInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Jd=e=>f.jsx(ut,{...e,children:f.jsx(N3,{})});Jd.propTypes={...S.DateInput.propTypes,...ut.propTypes},Jd.defaultProps={...S.DateInput.defaultProps,...ut.defaultProps};const V3=Ae(S.DateTimeInput,{name:"RaApplicaDateTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),Xd=e=>f.jsx(ut,{...e,children:f.jsx(V3,{})});Xd.propTypes={...S.DateTimeInput.propTypes,...ut.propTypes},Xd.defaultProps={...ut.defaultProps};const H3=Ae(S.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}}})),Zd=({children:e,title:t,...n})=>{const r=fi.useWatch({name:n.source}),o=S.useRecordContext(n),{source:s}=n,l=w.useMemo(()=>{if(r&&(r!=null&&r.title))return r==null?void 0:r.title;const u=dt.get(o,s);if(u){const A=u.split("__");return A.length>0?A[A.length-1]:u}return u},[o,s,r]);return f.jsx(ut,{...n,children:f.jsx(H3,{children:w.cloneElement(e,{...e.props,title:t||s,source:s,record:{...o,[s]:(r==null?void 0:r.title)||dt.get(o,s),[`_${s}`]:(r==null?void 0:r.src)||dt.get(o,`_${s}`),[t||s]:l}})})})};Zd.propTypes={...S.FileInput.propTypes,source:c.string,title:c.string,children:c.node},Zd.defaultProps={children:f.jsx(Nd,{})};const _d=({children:e,title:t,...n})=>{const r=fi.useWatch({name:n.source}),o=S.useRecordContext(n),{source:s}=n;return S.useInput({source:`__image__${n==null?void 0:n.source}`,defaultValue:n==null?void 0:n.source}),f.jsx(ut,{...n,children:f.jsx(S.ImageInput,{accept:"image/*",children:w.cloneElement(e,{...e.props,title:t,source:s,record:{...o,[s]:(r==null?void 0:r.title)||dt.get(o,s),[`_${s}`]:(r==null?void 0:r.src)||dt.get(o,`_${s}`)}})})})};_d.defaultProps={children:f.jsx(Gl,{}),multiple:!1},_d.propTypes={...S.ImageInput.propTypes,source:c.string,title:c.string,children:c.node,multiple:c.bool};const W3=Ae(S.NumberInput,{name:"RaApplicaNumberInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),qd=e=>f.jsx(ut,{...e,children:f.jsx(W3,{})});qd.propTypes={...S.NumberInput.propTypes,...ut.propTypes},qd.defaultProps={...S.NumberInput.defaultProps,...ut.defaultProps};const Qm=({source:e,minWidth:t=300,children:n})=>{const r=S.useResourceContext(),o=S.useRecordContext(),[s,l]=w.useState(dt.get(o,e,"")),[u,A]=w.useState(!1),g=w.useCallback(m=>l(m.target.value),[]),p=S.useDataProvider(),C=w.useCallback(m=>{m.key==="Enter"&&(A(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,o,e]),h=w.useCallback(()=>{dt.get(o,e)!==s&&(A(!0),p.update(r,{id:o.id,data:{...o,[e]:s,_changed:e}}).then(()=>A(!1)))},[s,p,r,e,o]),E=w.useCallback(m=>{A(!0),p.update(r,{id:o.id,data:{...o,[e]:m,_changed:e}}).then(()=>A(!1))},[p,r,e,o]);return w.useEffect(()=>l(dt.get(o,e)),[o,e]),n?w.cloneElement(n,{...n.props,source:e,value:s,onChange:E}):f.jsx(b.TextField,{value:s,disabled:u,onChange:g,onKeyPress:C,onBlur:h,style:{minWidth:t,width:"100%"},multiline:!0,InputProps:{"arial-label":"naked"},size:"small"})};Qm.propTypes={source:c.string.isRequired,minWidth:c.number,children:c.element};const $d=({children:e,...t})=>f.jsx(S.ReferenceArrayInput,{...t,children:w.cloneElement(e,{...t,source:e.props.source||t.source})});$d.propTypes={...S.ReferenceArrayInput.propTypes,children:c.element},$d.defaultProps={...S.ReferenceArrayInput.defaultProps};const eg=({children:e,...t})=>f.jsx(S.ReferenceInput,{...t,children:w.cloneElement(e,{...t,source:e.props.source||t.source})});eg.propTypes={...S.ReferenceInput.propTypes,children:c.element},eg.defaultProps={...S.ReferenceInput.defaultProps};const tg=({reference:e,target:t,children:n,filters:r,actions:o,...s})=>f.jsx(S.ResourceContextProvider,{value:e,children:f.jsx(Li,{perPage:5,pagination:f.jsx(S.Pagination,{}),...s,reference:e,target:t,children:f.jsxs(w.Fragment,{children:[f.jsx(S.ListToolbar,{filters:r,actions:o}),n]})})});tg.propTypes={...Li.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])},tg.defaultProps={...Li.defaultProps};const z3=Ae(S.SearchInput,{name:"RaApplicaSearchInput",slot:"root"})(()=>({})),U3=e=>f.jsx(z3,{...e}),xm=Ae(S.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"}}));xm.propTypes={...S.SelectArrayInput.propTypes};const ng=e=>f.jsx(ut,{...e,children:f.jsx(xm,{options:{autoWidth:!1}})});ng.defaultProps={optionText:"name",optionValue:"id"},ng.propTypes={...S.SelectArrayInput.propTypes,...ut.propTypes};const Y3=Ae(S.SelectInput,{name:"RaApplicaSelectArrayInput",slot:"Root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"},'& label.MuiFormLabel-root[data-shrink="false"]':{marginTop:"2px"}})),wm=e=>f.jsx(ut,{...e,children:f.jsx(Y3,{})});wm.propTypes={...S.SelectInput.propTypes,...ut.propTypes};const Un=e=>f.jsx(ut,{...e,children:f.jsx(S.TextInput,{})});Un.propTypes={...S.TextInput.propTypes,...ut.propTypes};const Jl=({...e})=>{var u,A;const t=S.useTranslate(),n=S.maxLength(e==null?void 0:e.maxLength,"app.input.max_length_error"),r=(A=(u=fi.useController({name:e==null?void 0:e.source}))==null?void 0:u.field)==null?void 0:A.value;let o=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&&(o=o&&o.length>0?`${l} - ${t(o)}`:l),f.jsx(Un,{...e,validate:s,helperText:o,inputProps:{maxLength:e==null?void 0:e.maxLength}})};Jl.displayName="SmartTextInput",Jl.defaultProps={multiline:!1},Jl.propTypes={...Un.propTypes,maxLength:c.number,multiline:c.bool,rows:c.number};const Tm=e=>{const t=e.split(":");t.length===1&&t.push("00");const n=parseInt(t[0]),r=parseInt(t[1]);return Lr().hour(n).minute(r)};function G3(){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 K3=e=>{if(!e)return"";const t=Tm(e);return t?t.format("HH:mm"):""},J3=e=>e,X3=Ae(S.TimeInput,{name:"RaApplicaTimeInput",slot:"root"})(({label:e})=>({"& legend":{width:e===!1?0:"auto"}})),rg=e=>f.jsx(ut,{...e,children:f.jsx(X3,{})});rg.defaultProps={...S.TimeInput.defaultProps,format:K3,parse:J3},rg.propTypes={...S.TimeInput.propTypes,...ut.propTypes};const og=({onSuccess:e,firstAccess:t})=>{const{spacing:n}=wn(),[r,o]=w.useState(!1),s=he.useAuthProvider(),l=he.useTranslate(),u=he.useNotify(),A=w.useCallback(g=>{const{oldPassword:p,newPassword:C}=g;o(!0),s==null||s.changePassword(p,C).then(()=>{u("ra.auth.password_changed"),e()}).catch(h=>{u((h==null?void 0:h.message)||(h==null?void 0:h.toString()),{type:"error"})}).finally(()=>o(!1))},[s,e]);return f.jsx(he.ResourceContextProvider,{value:"user/change-password",children:f.jsx(he.EditContextProvider,{value:{record:{},resource:"user/change-password",save:A},children:f.jsx(Ul,{onSubmit:A,toolbar:f.jsx(ar,{children:f.jsx(S.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(Un,{source:"oldPassword",type:"password",validate:he.required()})}),f.jsx(b.Grid,{item:!0,xs:12,children:f.jsx(Un,{source:"newPassword",type:"password",validate:he.required()})})]})})})})},Z3=Ae(S.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",backgroundColor:e.palette.background.default}})),_3=Ae(b.CardHeader)(({theme:e})=>({marginTop:e.spacing(4),marginLeft:0,marginRight:0,paddingLeft:0,paddingRight:0})),q3=Ae(b.Divider)(({theme:e})=>({marginLeft:`-${e.spacing(2.5)}`,marginRight:`-${e.spacing(2.5)}`,marginBottom:e.spacing(2),width:`calc(100% + ${e.spacing(5)})`})),ig=({title:e,divider:t,variant:n})=>{const r=S.useTranslate();return f.jsxs(w.Fragment,{children:[f.jsx(_3,{title:r(e,{_:e}),titleTypographyProps:{variant:n}}),t&&f.jsx(q3,{})]})};ig.propTypes={title:c.string.isRequired,divider:c.bool,variant:c.oneOf(["h1","h2","h3","h4","h5","h6"])},ig.defaultProps={divider:!0,variant:"h4"};const $3=Ae(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",marginRight:0}},"& form > .MuiToolbar-root":{margin:0,marginRight:`-${e.spacing(.5)}`,[e.breakpoints.down("sm")]:{marginRight:e.spacing(.5)}}}));function Pm(e){const{spacing:t}=wn(),{spacing:n=t}=e,r=Ce.omit(e,["spacing"]);return f.jsx(S.Form,{...r,children:f.jsx($3,{container:!0,spacing:n*2,children:e.children})})}function sg(e){return e.id??e.label}function Sm(e,t){const n=`^${e}.`.replaceAll(".","\\."),r=new RegExp(n,"g");return t.match(r)!==null}function eM(e){return Ce.map(e,"id")}function Xl(e){const t=e.match(new RegExp("[^.]+","g"));return t===null?0:t.length}function Om(e,t){const n=e!==void 0?Xl(e):0;return Ce.chain(t).filter(o=>e!==void 0?Sm(e,o.id):!0).filter(o=>Xl(o.id)===n+1).value()}function tM(e,t){var s;const n=Ce.clone(e),{type:r,payload:o}=t;switch(r){case"setFormRootPath":return Ce.extend(n,{formRootPath:o});case"setSyncWithLocation":return Ce.extend(n,{syncWithLocation:o});case"setErrorCount":return Ce.extend(n,{errorCount:o});case"setActiveItem":return Ce.includes(eM(e.items),o)?Ce.extend(n,{activeItem:o}):n;case"addItem":{const{id:l}=o;return Ce.extend(n,{items:Ce.chain(n.items).clone().reject(u=>u.id===l).concat([o]).orderBy(u=>u.index).value()})}case"removeItem":{const l=Ce.isString(o)?o:o.id,u=Ce.chain(n.items).clone().reject(A=>A.id===l).value();return Ce.extend(n,{items:u}),n.activeItem===l&&Ce.extend(n,{activeItem:((s=Ce.first(u))==null?void 0:s.id)??void 0}),n}default:return n}}const nM={syncWithLocation:!0,errorCount:!0,items:[],activeItem:void 0},jm=w.createContext(void 0);function Mm(e){const t=!!(e.syncWithLocation??!0),n=!!(e.errorCount??!0),{rootMatchString:r}=e,{pathname:o}=gi.useLocation(),[s,l]=w.useReducer(tM,Ce.cloneDeep(nM)),{formRootPath:u,items:A}=s,g=w.useMemo(()=>({state:s,dispatch:l}),[s,l]);return w.useEffect(()=>{const p=["entities/:resource/create/*",":resource/create/*","entities/:resource/:id/show/*",":resource/:id/show/*","entities/:resource/:id/*",":resource/:id/*"];r!==void 0&&p.push(r);const C=Ce.chain(p).map(E=>gi.matchPath(E,o)).reject(E=>E===null).first().value(),h=C==null?void 0:C.pathnameBase;h!==void 0&&h!==u&&l({type:"setFormRootPath",payload:h})},[o,u,r]),w.useEffect(()=>{l({type:"setSyncWithLocation",payload:!!t})},[t,l]),w.useEffect(()=>{l({type:"setErrorCount",payload:!!n})},[n,l]),w.useEffect(()=>{var p;if(t&&u!==void 0){let C=o.replace(u,"").replace(new RegExp(/^\/?/),"");Ce.isEmpty(C)&&(C=((p=Ce.chain(A).filter(h=>Om(h.id,A).length===0).orderBy([h=>Xl(h.id),h=>h.index]).first().value())==null?void 0:p.id)??void 0),l({type:"setActiveItem",payload:C})}},[l,u,o,A]),f.jsx(jm.Provider,{value:g,children:e.children})}function Rm(){const e=w.useContext(jm);if(e===void 0)throw new Error("[LongForm] useFormContext: context undefined. Please provide a valid Context using LongForm.Provider");return e}function Xs(){return Rm().state}function ag(){return Rm().dispatch}function Dm(){return Xs().formRootPath}function km(){return Xs().activeItem}function Fm(){return Xs().items}function Lm(){return Xs().syncWithLocation}function Nm(){return Xs().errorCount}function Vm(){const e=ag();return w.useCallback(n=>{e({type:"setActiveItem",payload:n})},[e])}function Hm(){const e=ag();return w.useCallback(n=>{e({type:"addItem",payload:n})},[e])}function Wm(){const e=ag();return w.useCallback(n=>{e({type:"removeItem",payload:n})},[e])}var rM=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},zm=e=>e.firstChild?e.firstChild.offsetParent===e:!0,oM=(e,t)=>{let n=e,r=0;zm(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},iM=e=>{let t=e.parentElement;for(;t&&getComputedStyle(t,null).getPropertyValue("display")==="contents";)t=t.parentElement;return t||window},Zs=null;typeof CSS<"u"&&CSS.supports&&(CSS.supports("position","sticky")?Zs="sticky":CSS.supports("position","-webkit-sticky")&&(Zs="-webkit-sticky"));var Zl=!1;try{const e=Object.defineProperty({},"passive",{get(){Zl={passive:!0}}}),t=()=>{};window.addEventListener("testPassive",t,e),window.removeEventListener("testPassive",t,e)}catch{}var lg=e=>{const{el:t,onChange:n,unsubs:r,measure:o}=e;if(t===window){const s=()=>({top:0,left:0,height:window.innerHeight,width:window.innerWidth}),l=o(s()),u=()=>{Object.assign(l,o(s())),n()};return window.addEventListener("resize",u,Zl),r.push(()=>window.removeEventListener("resize",u)),l}else{const s=o(t.getBoundingClientRect()),l=()=>{Object.assign(s,o(t.getBoundingClientRect())),n()},u=new ResizeObserver(l);return u.observe(t),r.push(()=>u.disconnect()),s}},sM=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}},aM=(e,t,n)=>{const{bottom:r,offsetBottom:o,offsetTop:s}=n,l=rM(e);let u=!1;const A=()=>{u||requestAnimationFrame(()=>{const F=C();F!==x&&O(F),u=!1}),u=!0};let g=l===window?window.scrollY:l.scrollTop;const p=F=>{const{offsetTop:X,height:Z}=E,{naturalTop:Y}=v,{height:$}=j;return F+X+Z>=Y+$+R+o},C=()=>{const{height:F}=E,{height:X}=j;return X+s+o<=F?3:p(g)?1:2},h=l!==window&&zm(l),E=lg({el:l,onChange:A,unsubs:t,measure:({height:F,top:X})=>({height:F,offsetTop:h?X:0})}),m=iM(e),B=m===window?{top:0,bottom:0}:sM(m),v=lg({el:m,onChange:A,unsubs:t,measure:({height:F})=>({height:F-B.top-B.bottom,naturalTop:m===window?0:oM(m,l)+B.top+E.offsetTop})}),j=lg({el:e,onChange:A,unsubs:t,measure:({height:F})=>({height:F})});let R=0,x=C();const O=F=>{const X=x;if(x=F,X===2&&(R=-1),F===3){e.style.position=Zs,r?e.style.bottom=`${o}px`:e.style.top=`${s}px`;return}const{height:Z,offsetTop:Y}=E,{height:$,naturalTop:ce}=v,{height:se}=j;if(F===2)if(e.style.position="relative",R=X===0?Math.max(0,Y+g-ce+s):Math.max(0,Y+g+Z-(ce+se+o)),r){const q=Math.max(0,$-se-R);e.style.bottom=`${q}px`}else e.style.top=`${R}px`;else e.style.position=Zs,F===1?r?e.style.bottom=`${o}px`:e.style.top=`${Z-se-o}px`:r?e.style.bottom=`${Z-se-o}px`:e.style.top=`${s}px`};O(x);const P=F=>{if(F===g)return;const X=F-g;if(g=F,x===3)return;const{offsetTop:Z,height:Y}=E,{naturalTop:$,height:ce}=v,{height:se}=j;if(X>0)if(x===0){if(F+Z+s>$){const q=Math.max(0,Z+g-$+s);F+Z+Y<=$+se+q+o?O(2):O(1)}}else x===2&&p(F)&&O(1);else if(x===1){if(Z+F+Y<$+ce+o){const q=Math.max(0,Z+g+Y-($+se+o));Z+F+s>=$+q?O(2):O(0)}}else x===2&&Z+F+s<$+R&&O(0)},N=l===window?()=>P(window.scrollY):()=>P(l.scrollTop);l.addEventListener("scroll",N,Zl),l.addEventListener("mousewheel",N,Zl),t.push(()=>l.removeEventListener("scroll",N),()=>l.removeEventListener("mousewheel",N))},lM=({offsetTop:e=0,offsetBottom:t=0,bottom:n=!1}={})=>{const[r,o]=w.useState(null);return w.useEffect(()=>{if(!r||!Zs)return;const s=[];return aM(r,s,{offsetBottom:t,offsetTop:e,bottom:n}),()=>{s.forEach(l=>l())}},[r,t,e,n]),o},cM=e=>{const{offsetTop:t,offsetBottom:n,bottom:r,children:o,className:s,style:l}=e,u=lM({offsetTop:t,offsetBottom:n,bottom:r});return f.jsx("div",{className:s,style:l,ref:u,children:o})},uM=cM,Um=(e=>(e.TOP="top",e.BOTTOM="bottom",e))(Um||{});function Ym(e){const{sticky:t=!0,disposition:n={xl:3,lg:3,md:4,sm:4,xs:12},spacing:r=2}=e,o=Ce.omit(e,["sticky","disposition","spacing"]),s=t?uM:b.Box,l=w.useMemo(()=>t?{offsetTop:74,offsetBottom:r*2}:{},[t,r]);return f.jsx(b.Grid,{...o,item:!0,...n,children:f.jsx(s,{...l,children:f.jsx(b.Stack,{spacing:r,children:e.children})})})}function Gm(e){return f.jsx(f.Fragment,{children:e.children})}function Km(e){const{children:t}=e;return w.useMemo(()=>{const r={top:[],bottom:[]};return w.Children.forEach(t,o=>{if(w.isValidElement(o)&&(o==null?void 0:o.type)===Gm){const{position:s}=o.props;switch(s){case"top":r.top.push(o);break;case"bottom":r.bottom.push(o);break}}}),r},[t])}function Jm(e){const{disposition:t={xl:9,lg:9,md:8,sm:8,xs:12}}=e,n=Ce.omit(e,["disposition"]);return f.jsx(b.Grid,{...n,item:!0,...t,children:e.children})}function Xm(e){const t=km();return t===void 0?!1:e===t||Sm(e,t)}function Zm(e){const t=Fm();return w.useMemo(()=>Om(e,t),[t,e])}function AM(){const e=Dm(),{search:t}=gi.useLocation(),n=gi.useNavigate();return w.useCallback(o=>{n(`${e}/${o}${t}`)},[e,n])}function _m(){const e=Zm();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:Ce.map(e,(t,n)=>f.jsx(cg,{...t},n))})})}function cg(e){const t=he.useTranslate()??Ce.identity,n=qm(e),{selected:r,label:o,icon:s,onClick:l,badge:u,items:A,isGroup:g,level:p,errors:C=0}=n,{spacing:h}=wn(),[E,m]=w.useState(r),B=w.useCallback(R=>{m(!E),l(R)},[l,E]),v=s!==void 0,j=Ce.omit(e,["label","icon","selected","badge"]);return w.useEffect(()=>{r&&!E&&m(r)},[r,E,m]),f.jsxs(f.Fragment,{children:[f.jsx(b.ListItem,{...j,disablePadding:!0,children:f.jsxs(b.ListItemButton,{selected:r&&!g,onClick:B,sx:{pl:h*p},children:[v&&f.jsx(b.ListItemIcon,{children:s}),f.jsx(b.ListItemText,{inset:!v,primary:C===0?t(o):f.jsx(b.Badge,{variant:"dot",color:"error",sx:{"& > .MuiBadge-badge":{transform:"scale(1) translate(125%, 0)"}},children:t(o)})}),u&&f.jsx(b.ListItemAvatar,{children:f.jsx(Gs,{type:"filled",size:"xs",color:u.color??"default",children:u.content})}),g&&(E?f.jsx(fn.ExpandLess,{}):f.jsx(fn.ExpandMore,{}))]})}),g&&f.jsx(b.Collapse,{in:E,timeout:"auto",children:f.jsx(b.List,{children:Ce.map(A,(R,x)=>f.jsx(cg,{...R},x))})})]})}function qm(e){const{id:t}=e,n=Xm(t),r=Xl(t),o=AM(),s=Lm(),l=Vm(),u=Zm(t),A=!Ce.isEmpty(u),g=w.useCallback(C=>{A||(s?o(e.id):l(e.id)),Ce.isFunction(e.onClick)&&e.onClick(C)},[l,o,e,s,A]);return w.useMemo(()=>({...e,selected:n,onClick:g,items:u,isGroup:A,level:r}),[e,n,g,u,A])}function $m(e=[],t){const n=Ce.isArray(e)?e:[e],r=Ce.filter(n,o=>w.isValidElement(o));Ce.each(r,o=>{var s;t(o),$m(((s=o==null?void 0:o.props)==null?void 0:s.children)??[],t)})}function e0(e){const{errors:t}=fi.useFormState(),n=Nm(),{label:r,icon:o,badge:s,index:l=0,children:u}=e,A=sg(e),g=Hm(),p=Wm(),C=Xm(A),h=[];n&&(e.sources!==void 0?h.push(...e.sources):$m(u,m=>{var B;((B=m==null?void 0:m.props)==null?void 0:B.source)!==void 0&&h.push(m.props.source)}));const E=Ce.chain(h).uniq().map(m=>Ce.get(t,m)).reject(m=>m===void 0).value().length;return w.useEffect(()=>{g({id:A,index:l,label:r,icon:o,badge:s,errors:E})},[g,p,r,o,A,s,l,E]),w.useEffect(()=>()=>{p(A)},[A]),f.jsx(b.Box,{display:C?"unset":"none",children:e.children})}function t0(e){const t=ug(e),n=sg(e);return f.jsx(e0,{...e,id:n,children:w.Children.map(t,r=>{const o=sg(r.props);return w.cloneElement(r,{id:`${n}.${o}`})})})}function n0(e){return f.jsx(e0,{...e})}function ug(e){const{children:t}=e;return w.useMemo(()=>Ce.chain(w.Children.toArray(t)).filter(r=>w.isValidElement(r)&&((r==null?void 0:r.type)===n0||(r==null?void 0:r.type)===t0)).map((r,o)=>w.cloneElement(r,{index:o})).value(),[t])}function dM(e){const{tabsDisposition:t,contentDisposition:n,spacing:r=2}=e,o=Ce.pick(e,["syncWithLocation","errorCount"]),s=Ce.omit(e,["tabsDisposition","contentDisposition","syncWithLocation"]),{top:l,bottom:u}=Km(e),A=ug(e);return f.jsx(Mm,{...o,children:f.jsxs(Pm,{...s,spacing:r,children:[f.jsxs(Ym,{disposition:t,spacing:r,children:[l,f.jsx(_m,{}),u]}),f.jsx(Jm,{disposition:n,children:A})]})})}const kt=dM;kt.BaseForm=Pm,kt.Content=Jm,kt.Provider=Mm,kt.useItems=Fm,kt.useSyncWithLocation=Lm,kt.useErrorCount=Nm,kt.useFormRootPath=Dm,kt.useActiveItem=km,kt.useSetActiveItem=Vm,kt.useAddItem=Hm,kt.useRemoveItem=Wm,kt.Sidebar=Ym,kt.SidebarSection=Gm,kt.SidebarSectionPosition=Um,kt.useSidebarChildren=Km,kt.NavMenu=_m,kt.NavMenuItem=cg,kt.useNavMenuItem=qm,kt.Tab=n0,kt.Group=t0,kt.useBaseItemChildren=ug;const gM=Ae(S.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"}})),fM=Ae(S.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}}})),pM=Ts(S.TabbedForm,{name:"RaApplicaTabbedForm",slot:"Root"})(({theme:e,modal:t})=>({"& .MuiGrid-root.MuiGrid-container":{paddingBottom:e.spacing(t?0:1)},[e.breakpoints.down("sm")]:{paddingBottom:0}})),Ag=e=>{const{title:t,modal:n,content:r,subheader:o,secondary:s,sx:l,...u}=e,A=xA(t);return f.jsx(Wn,{title:A,modal:n,content:r,subheader:o,secondary:s,sx:{...l,"& .MuiToolbar-root":{paddingLeft:"20px !important",paddingRight:"20px !important"}},border:!n,divider:!0,children:f.jsx(pM,{toolbar:f.jsx(ar,{}),...u})})};Ag.defaultProps={toolbar:f.jsx(ar,{children:f.jsx(S.SaveButton,{type:"button"})}),secondary:f.jsx(Mo,{children:f.jsx(S.DeleteWithConfirmButton,{})})},Ag.Tab=S.TabbedForm.Tab;const hM=k.forwardRef((e,t)=>{const{children:n,disabled:r,disableActions:o=!1,index:s,member:l,resource:u}=e,A=S.useTranslate(),[g,p]=k.useState(!1),{total:C,remove:h}=oC(),E=k.useCallback(()=>{p(!1),h(s)},[s,h]),m=w.useMemo(()=>({index:s,total:C,remove:()=>h(s)}),[s,C,h]);return f.jsxs(vA.Provider,{value:m,children:[w.Children.map(n,(B,v)=>{if(!w.isValidElement(B))return null;const{source:j,...R}=B.props;return f.jsx(b.TableCell,{sx:{border:0,verticalAlign:"top"},children:w.cloneElement(B,{source:j?`${l}.${j}`:l,index:j?void 0:v,resource:u,disabled:r,...R,label:""})})}),!o&&f.jsx(b.TableCell,{sx:{display:"flex",justifyContent:"center",alignItems:"center",border:0,pt:2.5},children:f.jsx(Mo,{horizontal:!0,children:f.jsx(b.Typography,{color:"error",onClick:()=>p(!0),children:A("ra.action.delete")})})}),n.length>0&&f.jsx(S.Confirm,{isOpen:g,title:A("ra.action.remove_item"),content:A("ra.message.remove_item"),onConfirm:E,onClose:()=>p(!1)})]})});var CM=Array.isArray,_l=CM,EM=typeof Vn=="object"&&Vn&&Vn.Object===Object&&Vn,IM=EM,mM=IM,BM=typeof self=="object"&&self&&self.Object===Object&&self,vM=mM||BM||Function("return this")(),ql=vM,yM=ql,bM=yM.Symbol,$l=bM,r0=$l,o0=Object.prototype,QM=o0.hasOwnProperty,xM=o0.toString,_s=r0?r0.toStringTag:void 0;function wM(e){var t=QM.call(e,_s),n=e[_s];try{e[_s]=void 0;var r=!0}catch{}var o=xM.call(e);return r&&(t?e[_s]=n:delete e[_s]),o}var TM=wM,PM=Object.prototype,SM=PM.toString;function OM(e){return SM.call(e)}var jM=OM,i0=$l,MM=TM,RM=jM,DM="[object Null]",kM="[object Undefined]",s0=i0?i0.toStringTag:void 0;function FM(e){return e==null?e===void 0?kM:DM:s0&&s0 in Object(e)?MM(e):RM(e)}var dg=FM;function LM(e){return e!=null&&typeof e=="object"}var ec=LM,NM=dg,VM=ec,HM="[object Symbol]";function WM(e){return typeof e=="symbol"||VM(e)&&NM(e)==HM}var gg=WM,zM=_l,UM=gg,YM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,GM=/^\w*$/;function KM(e,t){if(zM(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||UM(e)?!0:GM.test(e)||!YM.test(e)||t!=null&&e in Object(t)}var JM=KM;function XM(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var a0=XM,ZM=dg,_M=a0,qM="[object AsyncFunction]",$M="[object Function]",eR="[object GeneratorFunction]",tR="[object Proxy]";function nR(e){if(!_M(e))return!1;var t=ZM(e);return t==$M||t==eR||t==qM||t==tR}var l0=nR,rR=ql,oR=rR["__core-js_shared__"],iR=oR,fg=iR,c0=function(){var e=/[^.]+$/.exec(fg&&fg.keys&&fg.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function sR(e){return!!c0&&c0 in e}var aR=sR,lR=Function.prototype,cR=lR.toString;function uR(e){if(e!=null){try{return cR.call(e)}catch{}try{return e+""}catch{}}return""}var AR=uR,dR=l0,gR=aR,fR=a0,pR=AR,hR=/[\\^$.*+?()[\]{}|]/g,CR=/^\[object .+?Constructor\]$/,ER=Function.prototype,IR=Object.prototype,mR=ER.toString,BR=IR.hasOwnProperty,vR=RegExp("^"+mR.call(BR).replace(hR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yR(e){if(!fR(e)||gR(e))return!1;var t=dR(e)?vR:CR;return t.test(pR(e))}var bR=yR;function QR(e,t){return e==null?void 0:e[t]}var xR=QR,wR=bR,TR=xR;function PR(e,t){var n=TR(e,t);return wR(n)?n:void 0}var tc=PR,SR=tc,OR=SR(Object,"create"),nc=OR,u0=nc;function jR(){this.__data__=u0?u0(null):{},this.size=0}var MR=jR;function RR(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var DR=RR,kR=nc,FR="__lodash_hash_undefined__",LR=Object.prototype,NR=LR.hasOwnProperty;function VR(e){var t=this.__data__;if(kR){var n=t[e];return n===FR?void 0:n}return NR.call(t,e)?t[e]:void 0}var HR=VR,WR=nc,zR=Object.prototype,UR=zR.hasOwnProperty;function YR(e){var t=this.__data__;return WR?t[e]!==void 0:UR.call(t,e)}var GR=YR,KR=nc,JR="__lodash_hash_undefined__";function XR(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=KR&&t===void 0?JR:t,this}var ZR=XR,_R=MR,qR=DR,$R=HR,eD=GR,tD=ZR;function Ni(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])}}Ni.prototype.clear=_R,Ni.prototype.delete=qR,Ni.prototype.get=$R,Ni.prototype.has=eD,Ni.prototype.set=tD;var nD=Ni;function rD(){this.__data__=[],this.size=0}var oD=rD;function iD(e,t){return e===t||e!==e&&t!==t}var sD=iD,aD=sD;function lD(e,t){for(var n=e.length;n--;)if(aD(e[n][0],t))return n;return-1}var rc=lD,cD=rc,uD=Array.prototype,AD=uD.splice;function dD(e){var t=this.__data__,n=cD(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():AD.call(t,n,1),--this.size,!0}var gD=dD,fD=rc;function pD(e){var t=this.__data__,n=fD(t,e);return n<0?void 0:t[n][1]}var hD=pD,CD=rc;function ED(e){return CD(this.__data__,e)>-1}var ID=ED,mD=rc;function BD(e,t){var n=this.__data__,r=mD(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var vD=BD,yD=oD,bD=gD,QD=hD,xD=ID,wD=vD;function Vi(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])}}Vi.prototype.clear=yD,Vi.prototype.delete=bD,Vi.prototype.get=QD,Vi.prototype.has=xD,Vi.prototype.set=wD;var TD=Vi,PD=tc,SD=ql,OD=PD(SD,"Map"),jD=OD,A0=nD,MD=TD,RD=jD;function DD(){this.size=0,this.__data__={hash:new A0,map:new(RD||MD),string:new A0}}var kD=DD;function FD(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var LD=FD,ND=LD;function VD(e,t){var n=e.__data__;return ND(t)?n[typeof t=="string"?"string":"hash"]:n.map}var oc=VD,HD=oc;function WD(e){var t=HD(this,e).delete(e);return this.size-=t?1:0,t}var zD=WD,UD=oc;function YD(e){return UD(this,e).get(e)}var GD=YD,KD=oc;function JD(e){return KD(this,e).has(e)}var XD=JD,ZD=oc;function _D(e,t){var n=ZD(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var qD=_D,$D=kD,ek=zD,tk=GD,nk=XD,rk=qD;function Hi(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])}}Hi.prototype.clear=$D,Hi.prototype.delete=ek,Hi.prototype.get=tk,Hi.prototype.has=nk,Hi.prototype.set=rk;var d0=Hi,g0=d0,ok="Expected a function";function pg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ok);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var l=e.apply(this,r);return n.cache=s.set(o,l)||s,l};return n.cache=new(pg.Cache||g0),n}pg.Cache=g0;var ik=pg,sk=ik,ak=500;function lk(e){var t=sk(e,function(r){return n.size===ak&&n.clear(),r}),n=t.cache;return t}var ck=lk,uk=ck,Ak=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dk=/\\(\\)?/g,gk=uk(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ak,function(n,r,o,s){t.push(o?s.replace(dk,"$1"):r||n)}),t}),fk=gk;function pk(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var f0=pk,p0=$l,hk=f0,Ck=_l,Ek=gg,Ik=1/0,h0=p0?p0.prototype:void 0,C0=h0?h0.toString:void 0;function E0(e){if(typeof e=="string")return e;if(Ck(e))return hk(e,E0)+"";if(Ek(e))return C0?C0.call(e):"";var t=e+"";return t=="0"&&1/e==-Ik?"-0":t}var mk=E0,Bk=mk;function vk(e){return e==null?"":Bk(e)}var yk=vk,bk=_l,Qk=JM,xk=fk,wk=yk;function Tk(e,t){return bk(e)?e:Qk(e,t)?[e]:xk(wk(e))}var Pk=Tk,Sk=gg,Ok=1/0;function jk(e){if(typeof e=="string"||Sk(e))return e;var t=e+"";return t=="0"&&1/e==-Ok?"-0":t}var Mk=jk,Rk=Pk,Dk=Mk;function kk(e,t){t=Rk(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Dk(t[n++])];return n&&n==r?e:void 0}var Fk=kk,Lk=Fk;function Nk(e,t,n){var r=e==null?void 0:Lk(e,t);return r===void 0?n:r}var Vk=Nk;const Hk=qr(Vk),I0=e=>{var q,J;const{children:t,resource:n,source:r,label:o,disableActions:s=!1,disableAdd:l=!1,disableRemove:u=!1,className:A,empty:g,template:p={}}=e,[C,h]=w.useState(!1),{fields:E,remove:m,replace:B,append:v}=S.useArrayInput(e),{resetField:j}=fi.useFormContext(),R=Pt(),x=he.useTranslate(),O=he.useRecordContext(e),P=w.useRef(p||{}),N=he.useTranslateLabel(),F=w.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=w.useCallback((H=void 0)=>{let K=H;H==null&&(K=P.current,w.Children.count(t)===1&&k.isValidElement(w.Children.only(t))&&!w.Children.only(t).props.source&&w.Children.map(t,ee=>k.isValidElement(ee)&&ee.type!==he.FormDataConsumer).some(Boolean)?K="":(K=K||{},w.Children.forEach(t,ee=>{k.isValidElement(ee)&&ee.type!==he.FormDataConsumer&&ee.props.source&&(K[ee.props.source]=ee.props.defaultValue??null)})));const L={...K,...p};v(L),j(`${r}.${E.length}`,{defaultValue:K})},[v,t,j,r,E.length,p]),Z=H=>K=>{X(),H&&H(K)},Y=w.useCallback(()=>{B([]),h(!1)},[B]),$=Hk(O,r),ce=w.useMemo(()=>({total:E.length,remove:F,source:r}),[E.length,F,r]),se=R.palette.mode==="dark"?R.palette.grey.A400:R.palette.grey.A800;return E?f.jsx(BA.Provider,{value:ce,children:f.jsxs("div",{className:A,children:[k.cloneElement(f.jsx(m0,{}),{label:o,source:r,disableAdd:l,template:p,onClick:Z((J=(q=e==null?void 0:e.addButton)==null?void 0:q.props)==null?void 0:J.onClick)}),f.jsx(b.TableContainer,{component:b.Paper,sx:{mt:2,border:`1px solid ${se}`},children:f.jsxs(b.Table,{children:[f.jsx(b.TableHead,{sx:{borderTop:0,borderBottom:`1px solid ${se}`},children:f.jsxs(b.TableRow,{children:[w.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 ${se}}`},children:f.jsx(hM,{disableRemove:u,disableActions:s,index:K,member:`${r}.${K}`,onRemoveField:F,record:$&&$[K]||{},resource:n,source:r,children:t})},H.id))]})]})}),E.length>0&&f.jsx(S.Confirm,{isOpen:C,title:x("ra.action.clear_array_input"),content:x("ra.message.clear_array_input"),onConfirm:Y,onClose:()=>h(!1)})]})}):null},m0=e=>{const{label:t,disableAdd:n,onClick:r}=e,o=Pt(),s=o.palette.mode==="dark"?o.palette.grey.A400:o.palette.grey.A800,l=o.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(nt.PlusCircleOutlined,{style:{color:l}})}))]})},Wk=Ae(I0,{name:"RaApplicaTableFormIterator",slot:"Root"})(({theme:e})=>({"& > div.MuiPaper-root":{overflowX:"auto",[e.breakpoints.down("sm")]:{width:`calc(100vw - ${e.spacing(8)})`}}}));m0.propTypes={label:c.oneOfType([c.string,c.bool]),source:c.string,defaultValue:c.any},I0.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 zk(e,t){const n=Ce.clone(e),{type:r,payload:o}=t;switch(r){case"updateMedia":{const s=Ce.chain(n.media).clone().extend(o).value();return Ce.extend(n,{media:s})}case"updateDrawer":{const s=Ce.chain(n.drawer).clone().extend(o).value();return Ce.extend(n,{drawer:s})}case"updateLogo":{const s=Ce.chain(n.logo).clone().extend(o).value();return Ce.extend(n,{logo:s})}case"updateNotifications":{const s=Ce.chain(n.notifications).clone().extend(o).value();return Ce.extend(n,{notifications:s})}case"updateTheme":{const s=Ce.chain(n.theme).clone().extend(o).value();return Ce.extend(n,{theme:s})}default:return n}}const Uk={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"}},B0=w.createContext(void 0);function v0(e){var Z;const t=he.useAuthProvider(),n=he.useGetIdentity(),r=b.useTheme(),o=b.useMediaQuery(r.breakpoints.down("md")),s=b.useMediaQuery(r.breakpoints.down("lg")),l=b.useMediaQuery(r.breakpoints.down("xl")),{miniDrawer:u,isHorizontalLayout:A,menuOrientation:g,drawerWidth:p}=wn(),C=A(g)&&!s,{drawerOpen:h,openDrawer:E}=to(),m=w.useCallback(()=>{E(!h)},[h,E]),[B,v]=w.useState(!1),[j,R]=w.useReducer(zk,Ce.chain(Uk).clone().merge({drawer:{open:!u||h}}).value()),x=w.useCallback(()=>v(!1),[]),O=w.useMemo(()=>({state:j,dispatch:R}),[j,R]),{logoIcon:P,logoMain:N,enableNotification:F,notification:X}=e;return w.useEffect(()=>{R({type:"updateMedia",payload:{downMd:o,downLg:s,downXl:l,horizontal:C}})},[g,o,s,l]),w.useEffect(()=>{R({type:"updateDrawer",payload:{open:h,width:p,handleDrawerToggle:m}})},[h,p,m]),w.useEffect(()=>{u||E(!l)},[l,u]),w.useEffect(()=>{R({type:"updateLogo",payload:{main:N,icon:P}})},[P,N]),w.useEffect(()=>{R({type:"updateNotifications",payload:{enable:F,resource:X??"entities/notification"}})},[F,X]),w.useEffect(()=>{R({type:"updateTheme",payload:{iconColorOpen:r.palette.mode==="dark"?"grey.200":"grey.300",iconColor:r.palette.mode==="dark"?"background.default":"grey.100"}})},[r.palette.mode]),w.useEffect(()=>{t.isImpersonating().then(Y=>{var $;v(!Y&&(($=n==null?void 0:n.data)==null?void 0:$.needToChangePassword)===!0)})},[(Z=n==null?void 0:n.data)==null?void 0:Z.needToChangePassword,t]),f.jsxs(B0.Provider,{value:O,children:[f.jsx(b.Dialog,{open:B,maxWidth:"xs",fullWidth:!0,children:f.jsx(og,{onSuccess:x,firstAccess:!0})}),e.children]})}function y0(e){return w.forwardRef((t,n)=>{const{logoIcon:r,logoMain:o,enableNotification:s}=t;return f.jsx(v0,{logoIcon:r,logoMain:o,enableNotification:s,children:f.jsx(e,{ref:n,...t})})})}function hg(){const e=w.useContext(B0);if(e===void 0)throw new Error("[Layout] useLayoutContext: context undefined. Please provide a valid LayoutContext using LayoutProvider");return e}function Yk(){return hg().dispatch}function Wi(){return hg().state}function Yn(){return Wi().media}function Uo(){return Wi().drawer}function b0(){return Wi().logo}function ic(){return Wi().notifications}function sc(){return Wi().theme}function Q0(){const{iconColor:e,iconColorOpen:t}=sc(),{open:n,handleDrawerToggle:r}=Uo();return f.jsx(co,{"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(nt.MenuFoldOutlined,{}):f.jsx(nt.MenuUnfoldOutlined,{})})}function x0(e){const t=w.useRef(),n=b.useTheme(),{downLg:r,horizontal:o}=Yn(),{open:s,width:l}=Uo(),u=r?b.AppBar:sC,A=Ti(e,{borderBottom:`1px solid ${n.palette.divider}`,zIndex:1200,width:o?"100%":s?`calc(100% - ${l}px)`:{xs:"100%",lg:"calc(100% - 60px)"}}),g={position:"fixed",color:"inherit",elevation:0,sx:A};return r||Ce.extend(g,{open:s}),f.jsx(u,{ref:t,...g,children:f.jsxs(b.Toolbar,{sx:{"& > *":{marginX:n.spacing(.325)}},children:[!o&&f.jsx(Q0,{}),e.children]})})}function Gk(e){const t=b.useTheme(),{notification:n,onClick:r,selected:o,divider:s}=e,{resource:l}=ic(),u=he.useNotify(),A=he.useRedirect(),[g]=he.useUpdate(l,{id:n==null?void 0:n.id,data:{...n,readed:Lr().format("YYYY-MM-DD HH:mm:ss")}},{onSuccess:()=>{n!=null&&n.resource?n!=null&&n.resource.startsWith("/")?(A(n==null?void 0:n.resource),r()):(r(),document.location.href=n==null?void 0:n.resource):r()},onFailure:()=>{u("resources.notifications.messages.readed.error","warning")}}),p=w.useCallback(()=>g(),[g]),[C]=he.useLocaleState(),h=w.useMemo(()=>Lr(n.created).locale(C).fromNow(),[n,C]);return f.jsx(b.ListItem,{disablePadding:!0,divider:s,children:f.jsxs(b.ListItemButton,{selected:o,onClick:p,children:[f.jsx(b.ListItemAvatar,{children:f.jsx(b.Avatar,{sx:{color:"primary.main",bgcolor:"primary.lighter"},children:f.jsx(nt.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 Kk={width:36,height:36,fontSize:"1rem"},Jk={mt:"6px",ml:1,top:"auto",right:"auto",alignSelf:"flex-start",transform:"none"};function w0(){const{enable:e}=ic();return e?f.jsx(Xk,{}):null}function Xk(){const e=b.useTheme(),t=w.useRef(),n=he.useTranslate(),{resource:r}=ic(),{downMd:o}=Yn(),{iconColor:s,iconColorOpen:l}=sc(),[u,A]=w.useState(!1),[g,p]=w.useState([]),C=g.filter(v=>v.readed===null).length,h=w.useCallback(()=>A(!u),[u]),E=w.useCallback(()=>{t.current&&t.current.contains(event.target)||A(!1)},[t.current,A]),{data:m,isLoading:B}=he.useGetList(r,{pagination:{page:1,perPage:25},sort:{field:"created",order:"DESC"},filter:{readed:!1}});return w.useEffect(()=>{!B&&m&&p(m??[])},[m,B]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.jsx(co,{color:"secondary",variant:"light",sx:{color:"text.primary",bgcolor:u?l:s},"aria-label":"open profile",ref:t,"aria-controls":u?"profile-grow":void 0,"aria-haspopup":"true",onClick:h,children:f.jsx(b.Badge,{badgeContent:C,color:"primary",children:f.jsx(nt.BellOutlined,{})})}),f.jsx(b.Popper,{placement:o?"bottom":"bottom-end",open:u,anchorEl:t.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[o?-5:0,9]}}]},children:({TransitionProps:v})=>f.jsx(Ao,{type:"grow",position:o?"top":"top-right",in:open,...v,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:E,children:f.jsxs(Wn,{title:"Notification",elevation:0,border:!1,content:!1,secondary:f.jsx(f.Fragment,{children:C>0&&f.jsx(b.Tooltip,{title:"Mark as all read",children:f.jsx(co,{color:"success",size:"small",children:f.jsx(nt.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":Kk,"& .MuiListItemSecondaryAction-root":{...Jk,position:"relative"}},maxHeight:"calc(100vh - 240px)",overflow:"auto"},children:g.map((j,R)=>f.jsx(Gk,{selected:C>0,notification:j,onClick:h,divider:R<g.length-1},j.id))}),f.jsx(b.Divider,{}),f.jsx(b.ListItemButton,{sx:{textAlign:"center",py:"12px !important"},to:`/${r}`,LinkComponent:mt.Link,onClick:E,children:f.jsx(b.ListItemText,{primary:f.jsx(b.Typography,{variant:"h6",color:"primary",children:n("ra.notification.view_all")})})})]})})})})})]})}const Zk=()=>{const[e,t]=w.useState(!1),n=w.useCallback(()=>t(!1),[t]),r=w.useCallback(()=>t(!0),[t]),o=he.useTranslate();return f.jsxs(w.Fragment,{children:[f.jsxs(b.ListItemButton,{onClick:r,children:[f.jsx(b.ListItemIcon,{children:f.jsx(fn.Key,{})}),f.jsx(b.ListItemText,{primary:o("ra.auth.change_password")})]}),f.jsx(b.Dialog,{open:e,onClose:()=>t(!1),maxWidth:"xs",fullWidth:!0,children:f.jsx(og,{onSuccess:n})})]})},_k=()=>{const e=he.useLogout(),t=he.useTranslate();return f.jsx(w.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:e,children:[f.jsx(b.ListItemIcon,{children:f.jsx(fn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:t("ra.auth.logout")})]})})},qk=()=>{const e=he.useTranslate(),t=he.useAuthProvider(),n=w.useCallback(()=>t.stopImpersonate().then(()=>document.location.href="/"),[t==null?void 0:t.stopImpersonating]),[r,o]=w.useState(!1);return w.useEffect(()=>{t.isImpersonating&&t.isImpersonating().then(s=>o(s))},[t,o]),r?f.jsx(w.Fragment,{children:f.jsxs(b.ListItemButton,{onClick:n,children:[f.jsx(b.ListItemIcon,{children:f.jsx(fn.LogoutOutlined,{})}),f.jsx(b.ListItemText,{primary:e("ra.auth.stop_impersonate")})]})}):null};c.node,c.any.isRequired,c.any.isRequired;const T0=()=>{var B;const e=b.useTheme(),{identity:t}=S.useGetIdentity(),n=t!==void 0&&t.image&&t.image!==null&&t.image!=="",r=w.useRef(null),[o,s]=w.useState(!1),l=()=>{s(v=>!v)},u=v=>{r.current&&r.current.contains(v.target)||s(!1)},A=e.palette.mode==="dark"?"grey.200":"grey.300",g=S.useLogout(),p=S.useDataProvider(),C=S.useAuthProvider(),h=w.useCallback(()=>{g()},[C,g]),[E,m]=w.useState(null);return w.useEffect(()=>{if(!n)return;async function v(){var j=await p.getFile("/profile/me/image");m(j)}v()},[p,n]),f.jsxs(b.Box,{sx:{flexShrink:0},children:[f.jsx(b.ButtonBase,{sx:{p:.25,bgcolor:o?A:"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":o?"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(Gs,{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:o,anchorEl:r.current,role:void 0,transition:!0,disablePortal:!0,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,9]}}]},children:({TransitionProps:v})=>{var j;return f.jsx(Ao,{type:"grow",position:"top-right",in:o,...v,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:u,children:f.jsxs(Wn,{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(Gs,{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:(j=t==null?void 0:t.roles)==null?void 0:j.map(R=>R.name.replace("ROLE_","")).join(",")})]})]})}),f.jsx(b.Grid,{item:!0,children:f.jsx(b.Tooltip,{title:"Logout",children:f.jsx(co,{size:"large",sx:{color:"text.primary"},onClick:h,children:f.jsx(nt.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(Zk,{}),f.jsx(_k,{}),f.jsx(qk,{})]})})})]})})})})}})]})},P0=e=>{const t=Pt(),{downMd:n}=Yn(),{iconColor:r,iconColorOpen:o}=sc(),[s,l]=w.useState(!1),u=w.useRef(null),A=w.useCallback(()=>{l(!s)},[s]),g=w.useCallback(p=>{u.current&&u.current.contains(p.target)||l(!1)},[]);return n?f.jsxs(f.Fragment,{children:[f.jsx(b.Box,{sx:{flexShrink:0},children:f.jsx(co,{sx:{color:"text.primary",bgcolor:s?o:r},"aria-label":"open more menu",ref:u,"aria-controls":s?"menu-list-grow":void 0,"aria-haspopup":"true",onClick:A,color:"secondary",variant:"light",children:f.jsx(nt.MoreOutlined,{})})}),f.jsx(b.Popper,{placement:"bottom-end",open:s,anchorEl:u.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 S0(e){return f.jsx(b.Box,{...e,flex:1})}function qs(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]})})}qs.propTypes={name:c.string.isRequired,version:c.string.isRequired,copy:c.string},qs.defaultProps={copy:"© Applica Software Guru for"};var O0={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})(O0);var ac=O0.exports,Cg={};const $k=Fx(Uj);var j0;function lc(){return j0||(j0=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=$k}(Cg)),Cg}function M0(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=M0(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function R0(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=M0(e))&&(r&&(r+=" "),r+=t);return r}var e5="__lodash_hash_undefined__";function t5(e){return this.__data__.set(e,e5),this}var n5=t5;function r5(e){return this.__data__.has(e)}var o5=r5,i5=d0,s5=n5,a5=o5;function cc(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new i5;++t<n;)this.add(e[t])}cc.prototype.add=cc.prototype.push=s5,cc.prototype.has=a5;var D0=cc;function l5(e,t){return e.has(t)}var k0=l5;function c5(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var F0=c5;function u5(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var A5=u5,d5=dg,g5=ec,f5="[object Arguments]";function p5(e){return g5(e)&&d5(e)==f5}var h5=p5,L0=h5,C5=ec,N0=Object.prototype,E5=N0.hasOwnProperty,I5=N0.propertyIsEnumerable,m5=L0(function(){return arguments}())?L0:function(e){return C5(e)&&E5.call(e,"callee")&&!I5.call(e,"callee")},B5=m5,v5=9007199254740991;function y5(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=v5}var b5=y5;function Q5(e){return function(t){return e(t)}}var x5=Q5,w5=l0,T5=b5;function P5(e){return e!=null&&T5(e.length)&&!w5(e)}var S5=P5,O5=tc,j5=ql,M5=O5(j5,"Set"),R5=M5,Eg=globalThis&&globalThis.__assign||function(){return Eg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Eg.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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},V0=function(e){var t=e.className,n=e.sx,r=D5(e,["className","sx"]),o=he.useLoading(),s=Pt();return k.createElement(k5,{className:t,sx:n},o?k.createElement(Od,Eg({className:R0("app-loader",uc.loader),color:"inherit",size:s.spacing(2),thickness:6},r)):k.createElement(wB,{className:uc.loadedIcon}))};V0.propTypes={classes:c.object,className:c.string,width:c.string};var Ig="RaLoadingIndicator",uc={loader:"".concat(Ig,"-loader"),loadedIcon:"".concat(Ig,"-loadedIcon")},k5=Ae("div",{name:Ig,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={},t["& .".concat(uc.loader)]={marginLeft:n.spacing(1.5),marginRight:n.spacing(1.5)},t["& .".concat(uc.loadedIcon)]={},t});const mg=e=>e.scrollTop;function zi(e,t){var n,r;const{timeout:o,easing:s,style:l={}}=e;return{duration:(n=l.transitionDuration)!=null?n:typeof o=="number"?o:o[t.mode]||0,easing:(r=l.transitionTimingFunction)!=null?r:typeof s=="object"?s[t.mode]:s,delay:l.transitionDelay}}const F5=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function L5(e,t,n){const r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),s=Ei(t);let l;if(t.fakeTransform)l=t.fakeTransform;else{const g=s.getComputedStyle(t);l=g.getPropertyValue("-webkit-transform")||g.getPropertyValue("transform")}let u=0,A=0;if(l&&l!=="none"&&typeof l=="string"){const g=l.split("(")[1].split(")")[0].split(",");u=parseInt(g[4],10),A=parseInt(g[5],10)}return e==="left"?o?`translateX(${o.right+u-r.left}px)`:`translateX(${s.innerWidth+u-r.left}px)`:e==="right"?o?`translateX(-${r.right-o.left-u}px)`:`translateX(-${r.left+r.width-u}px)`:e==="up"?o?`translateY(${o.bottom+A-r.top}px)`:`translateY(${s.innerHeight+A-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-A}px)`:`translateY(-${r.top+r.height-A}px)`}function H0(e){return typeof e=="function"?e():e}function Ac(e,t,n){const r=H0(n),o=L5(e,t,r);o&&(t.style.webkitTransform=o,t.style.transform=o)}const W0=k.forwardRef(function(t,n){const r=Pt(),o={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:l,appear:u=!0,children:A,container:g,direction:p="down",easing:C=o,in:h,onEnter:E,onEntered:m,onEntering:B,onExit:v,onExited:j,onExiting:R,style:x,timeout:O=s,TransitionComponent:P=bd}=t,N=Ue(t,F5),F=k.useRef(null),X=Qn(A.ref,F,n),Z=L=>ee=>{L&&(ee===void 0?L(F.current):L(F.current,ee))},Y=Z((L,ee)=>{Ac(p,L,g),mg(L),E&&E(L,ee)}),$=Z((L,ee)=>{const W=zi({timeout:O,style:x,easing:C},{mode:"enter"});L.style.webkitTransition=r.transitions.create("-webkit-transform",z({},W)),L.style.transition=r.transitions.create("transform",z({},W)),L.style.webkitTransform="none",L.style.transform="none",B&&B(L,ee)}),ce=Z(m),se=Z(R),q=Z(L=>{const ee=zi({timeout:O,style:x,easing:C},{mode:"exit"});L.style.webkitTransition=r.transitions.create("-webkit-transform",ee),L.style.transition=r.transitions.create("transform",ee),Ac(p,L,g),v&&v(L)}),J=Z(L=>{L.style.webkitTransition="",L.style.transition="",j&&j(L)}),H=L=>{l&&l(F.current,L)},K=k.useCallback(()=>{F.current&&Ac(p,F.current,g)},[p,g]);return k.useEffect(()=>{if(h||p==="down"||p==="right")return;const L=dh(()=>{F.current&&Ac(p,F.current,g)}),ee=Ei(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:Y,onEntered:ce,onEntering:$,onExit:q,onExited:J,onExiting:se,addEndListener:H,appear:u,in:h,timeout:O},N,{children:(L,ee)=>k.cloneElement(A,z({ref:X,style:z({visibility:L==="exited"&&!h?"hidden":void 0},x,A.props.style)},ee))}))});process.env.NODE_ENV!=="production"&&(W0.propTypes={addEndListener:c.func,appear:c.bool,children:hi.isRequired,container:Cr(c.oneOfType([Oo,c.func]),e=>{if(e.open){const t=H0(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(`
|
|
219
219
|
`))}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(`
|
|
220
220
|
`))}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 N5=W0;function V5(e){return typeof e=="string"}function H5(e,t,n){return e===void 0||V5(e)?t:z({},t,{ownerState:z({},t.ownerState,n)})}const W5={disableDefaultClasses:!1},z5=k.createContext(W5);function U5(e){const{disableDefaultClasses:t}=k.useContext(z5);return n=>t?"":e(n)}function z0(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 Y5(e,t,n){return typeof e=="function"?e(t,n):e}function U0(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 G5(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:s}=e;if(!t){const E=Ye(o==null?void 0:o.className,r==null?void 0:r.className,s,n==null?void 0:n.className),m=z({},n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),B=z({},n,o,r);return E.length>0&&(B.className=E),Object.keys(m).length>0&&(B.style=m),{props:B,internalRef:void 0}}const l=z0(z({},o,r)),u=U0(r),A=U0(o),g=t(l),p=Ye(g==null?void 0:g.className,n==null?void 0:n.className,s,o==null?void 0:o.className,r==null?void 0:r.className),C=z({},g==null?void 0:g.style,n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),h=z({},g,n,A,u);return p.length>0&&(h.className=p),Object.keys(C).length>0&&(h.style=C),{props:h,internalRef:g.ref}}const K5=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function J5(e){var t;const{elementType:n,externalSlotProps:r,ownerState:o,skipResolvingSlotProps:s=!1}=e,l=Ue(e,K5),u=s?{}:Y5(r,o),{props:A,internalRef:g}=G5(z({},l,{externalSlotProps:u})),p=Qn(g,u==null?void 0:u.ref,(t=e.additionalProps)==null?void 0:t.ref);return H5(n,z({},A,{ref:p}),o)}function X5(e){const t=sr(e);return t.body===e?Ei(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function $s(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function Y0(e){return parseInt(Ei(e).getComputedStyle(e).paddingRight,10)||0}function Z5(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 G0(e,t,n,r,o){const s=[t,n,...r];[].forEach.call(e.children,l=>{const u=s.indexOf(l)===-1,A=!Z5(l);u&&A&&$s(l,o)})}function Bg(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function _5(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(X5(r)){const l=f1(sr(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${Y0(r)+l}px`;const u=sr(r).querySelectorAll(".mui-fixed");[].forEach.call(u,A=>{n.push({value:A.style.paddingRight,property:"padding-right",el:A}),A.style.paddingRight=`${Y0(A)+l}px`})}let s;if(r.parentNode instanceof DocumentFragment)s=sr(r).body;else{const l=r.parentElement,u=Ei(r);s=(l==null?void 0:l.nodeName)==="HTML"&&u.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:u})=>{s?l.style.setProperty(u,s):l.style.removeProperty(u)})}}function q5(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class $5{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&&$s(t.modalRef,!1);const o=q5(n);G0(n,t.mount,t.modalRef,o,!0);const s=Bg(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:o}),r)}mount(t,n){const r=Bg(this.containers,s=>s.modals.indexOf(t)!==-1),o=this.containers[r];o.restore||(o.restore=_5(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=Bg(this.containers,l=>l.modals.indexOf(t)!==-1),s=this.containers[o];if(s.modals.splice(s.modals.indexOf(t),1),this.modals.splice(r,1),s.modals.length===0)s.restore&&s.restore(),t.modalRef&&$s(t.modalRef,n),G0(s.container,t.mount,t.modalRef,s.hiddenSiblings,!1),this.containers.splice(o,1);else{const l=s.modals[s.modals.length-1];l.modalRef&&$s(l.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function e2(e){return typeof e=="function"?e():e}function t2(e){return e?e.props.hasOwnProperty("in"):!1}const n2=new $5;function r2(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:o=n2,closeAfterTransition:s=!1,onTransitionEnter:l,onTransitionExited:u,children:A,onClose:g,open:p,rootRef:C}=e,h=k.useRef({}),E=k.useRef(null),m=k.useRef(null),B=Qn(m,C),[v,j]=k.useState(!p),R=t2(A);let x=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(x=!1);const O=()=>sr(E.current),P=()=>(h.current.modalRef=m.current,h.current.mount=E.current,h.current),N=()=>{o.mount(P(),{disableScrollLock:r}),m.current&&(m.current.scrollTop=0)},F=$r(()=>{const H=e2(t)||O().body;o.add(P(),H),m.current&&N()}),X=k.useCallback(()=>o.isTopModal(P()),[o]),Z=$r(H=>{E.current=H,H&&(p&&X()?N():m.current&&$s(m.current,x))}),Y=k.useCallback(()=>{o.remove(P(),x)},[x,o]);k.useEffect(()=>()=>{Y()},[Y]),k.useEffect(()=>{p?F():(!R||!s)&&Y()},[p,Y,R,s,F]);const $=H=>K=>{var L;(L=H.onKeyDown)==null||L.call(H,K),!(K.key!=="Escape"||!X())&&(n||(K.stopPropagation(),g&&g(K,"escapeKeyDown")))},ce=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=z0(e);delete K.onTransitionEnter,delete K.onTransitionExited;const L=z({},K,H);return z({role:"presentation"},L,{onKeyDown:$(L),ref:B})},getBackdropProps:(H={})=>{const K=H;return z({"aria-hidden":!0},K,{onClick:ce(K),open:p})},getTransitionProps:()=>{const H=()=>{j(!1),l&&l()},K=()=>{j(!0),u&&u(),s&&Y()};return{onEnter:Zu(H,A==null?void 0:A.props.onEnter),onExited:Zu(K,A==null?void 0:A.props.onExited)}},rootRef:B,portalRef:Z,isTopModal:X,exited:v,hasTransition:R}}const o2=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function i2(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 s2(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 a2(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||s2(e))}function l2(e){const t=[],n=[];return Array.from(e.querySelectorAll(o2)).forEach((r,o)=>{const s=i2(r);s===-1||!a2(r)||(s===0?t.push(r):n.push({documentOrder:o,tabIndex:s,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function c2(){return!0}function dc(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:s=l2,isEnabled:l=c2,open:u}=e,A=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=Qn(t.ref,m),v=k.useRef(null);k.useEffect(()=>{!u||!m.current||(E.current=!n)},[n,u]),k.useEffect(()=>{if(!u||!m.current)return;const x=sr(m.current);return m.current.contains(x.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(`
|
|
221
221
|
`)),m.current.setAttribute("tabIndex","-1")),E.current&&m.current.focus()),()=>{o||(C.current&&C.current.focus&&(A.current=!0,C.current.focus()),C.current=null)}},[u]),k.useEffect(()=>{if(!u||!m.current)return;const x=sr(m.current),O=F=>{v.current=F,!(r||!l()||F.key!=="Tab")&&x.activeElement===m.current&&F.shiftKey&&(A.current=!0,p.current&&p.current.focus())},P=()=>{const F=m.current;if(F===null)return;if(!x.hasFocus()||!l()||A.current){A.current=!1;return}if(F.contains(x.activeElement)||r&&x.activeElement!==g.current&&x.activeElement!==p.current)return;if(x.activeElement!==h.current)h.current=null;else if(h.current!==null)return;if(!E.current)return;let X=[];if((x.activeElement===g.current||x.activeElement===p.current)&&(X=s(m.current)),X.length>0){var Z,Y;const $=!!((Z=v.current)!=null&&Z.shiftKey&&((Y=v.current)==null?void 0:Y.key)==="Tab"),ce=X[0],se=X[X.length-1];typeof ce!="string"&&typeof se!="string"&&($?se.focus():ce.focus())}else F.focus()};x.addEventListener("focusin",P),x.addEventListener("keydown",O,!0);const N=setInterval(()=>{x.activeElement&&x.activeElement.tagName==="BODY"&&P()},50);return()=>{clearInterval(N),x.removeEventListener("focusin",P),x.removeEventListener("keydown",O,!0)}},[n,r,o,l,u,s]);const j=x=>{C.current===null&&(C.current=x.relatedTarget),E.current=!0,h.current=x.target;const O=t.props.onFocus;O&&O(x)},R=x=>{C.current===null&&(C.current=x.relatedTarget),E.current=!0};return f.jsxs(k.Fragment,{children:[f.jsx("div",{tabIndex:u?0:-1,onFocus:R,ref:g,"data-testid":"sentinelStart"}),k.cloneElement(t,{ref:B,onFocus:j}),f.jsx("div",{tabIndex:u?0:-1,onFocus:R,ref:p,"data-testid":"sentinelEnd"})]})}process.env.NODE_ENV!=="production"&&(dc.propTypes={children:hi,disableAutoFocus:c.bool,disableEnforceFocus:c.bool,disableRestoreFocus:c.bool,getTabbable:c.func,isEnabled:c.func,open:c.bool.isRequired}),process.env.NODE_ENV!=="production"&&(dc["propTypes"]=Ua(dc.propTypes));function u2(e){return typeof e=="function"?e():e}const ea=k.forwardRef(function(t,n){const{children:r,container:o,disablePortal:s=!1}=t,[l,u]=k.useState(null),A=Qn(k.isValidElement(r)?r.ref:null,n);if(Ii(()=>{s||u(u2(o)||document.body)},[o,s]),Ii(()=>{if(l&&!s)return Ya(n,l),()=>{Ya(n,null)}},[n,l,s]),s){if(k.isValidElement(r)){const g={ref:A};return k.cloneElement(r,g)}return f.jsx(k.Fragment,{children:r})}return f.jsx(k.Fragment,{children:l&&kx.createPortal(r,l)})});process.env.NODE_ENV!=="production"&&(ea.propTypes={children:c.node,container:c.oneOfType([Oo,c.func]),disablePortal:c.bool}),process.env.NODE_ENV!=="production"&&(ea["propTypes"]=Ua(ea.propTypes));const A2=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],d2={entering:{opacity:1},entered:{opacity:1}},K0=k.forwardRef(function(t,n){const r=Pt(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:l=!0,children:u,easing:A,in:g,onEnter:p,onEntered:C,onEntering:h,onExit:E,onExited:m,onExiting:B,style:v,timeout:j=o,TransitionComponent:R=bd}=t,x=Ue(t,A2),O=k.useRef(null),P=Qn(O,u.ref,n),N=q=>J=>{if(q){const H=O.current;J===void 0?q(H):q(H,J)}},F=N(h),X=N((q,J)=>{mg(q);const H=zi({style:v,timeout:j,easing:A},{mode:"enter"});q.style.webkitTransition=r.transitions.create("opacity",H),q.style.transition=r.transitions.create("opacity",H),p&&p(q,J)}),Z=N(C),Y=N(B),$=N(q=>{const J=zi({style:v,timeout:j,easing:A},{mode:"exit"});q.style.webkitTransition=r.transitions.create("opacity",J),q.style.transition=r.transitions.create("opacity",J),E&&E(q)}),ce=N(m),se=q=>{s&&s(O.current,q)};return f.jsx(R,z({appear:l,in:g,nodeRef:O,onEnter:X,onEntered:Z,onEntering:F,onExit:$,onExited:ce,onExiting:Y,addEndListener:se,timeout:j},x,{children:(q,J)=>k.cloneElement(u,z({style:z({opacity:0,visibility:q==="exited"&&!g?"hidden":void 0},d2[q],v,u.props.style),ref:P},J))}))});process.env.NODE_ENV!=="production"&&(K0.propTypes={addEndListener:c.func,appear:c.bool,children:hi.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 g2=K0;function f2(e){return Lt("MuiBackdrop",e)}Ht("MuiBackdrop",["root","invisible"]);const p2=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],h2=e=>{const{classes:t,invisible:n}=e;return nn({root:["root",n&&"invisible"]},f2,t)},C2=Ae("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"})),J0=k.forwardRef(function(t,n){var r,o,s;const l=Wt({props:t,name:"MuiBackdrop"}),{children:u,className:A,component:g="div",components:p={},componentsProps:C={},invisible:h=!1,open:E,slotProps:m={},slots:B={},TransitionComponent:v=g2,transitionDuration:j}=l,R=Ue(l,p2),x=z({},l,{component:g,invisible:h}),O=h2(x),P=(r=m.root)!=null?r:C.root;return f.jsx(v,z({in:E,timeout:j},R,{children:f.jsx(C2,z({"aria-hidden":!0},P,{as:(o=(s=B.root)!=null?s:p.Root)!=null?o:g,className:Ye(O.root,A,P==null?void 0:P.className),ownerState:z({},x,P==null?void 0:P.ownerState),classes:O,ref:n,children:u}))}))});process.env.NODE_ENV!=="production"&&(J0.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 E2=J0;function I2(e){return Lt("MuiModal",e)}Ht("MuiModal",["root","hidden","backdrop"]);const m2=["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"],B2=e=>{const{open:t,exited:n,classes:r}=e;return nn({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},I2,r)},v2=Ae("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"})),y2=Ae(E2,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),X0=k.forwardRef(function(t,n){var r,o,s,l,u,A;const g=Wt({name:"MuiModal",props:t}),{BackdropComponent:p=y2,BackdropProps:C,className:h,closeAfterTransition:E=!1,children:m,container:B,component:v,components:j={},componentsProps:R={},disableAutoFocus:x=!1,disableEnforceFocus:O=!1,disableEscapeKeyDown:P=!1,disablePortal:N=!1,disableRestoreFocus:F=!1,disableScrollLock:X=!1,hideBackdrop:Z=!1,keepMounted:Y=!1,onBackdropClick:$,open:ce,slotProps:se,slots:q}=g,J=Ue(g,m2),H=z({},g,{closeAfterTransition:E,disableAutoFocus:x,disableEnforceFocus:O,disableEscapeKeyDown:P,disablePortal:N,disableRestoreFocus:F,disableScrollLock:X,hideBackdrop:Z,keepMounted:Y}),{getRootProps:K,getBackdropProps:L,getTransitionProps:ee,portalRef:W,isTopModal:_,exited:de,hasTransition:fe}=r2(z({},H,{rootRef:n})),ue=z({},H,{exited:de}),ge=B2(ue),pe={};if(m.props.tabIndex===void 0&&(pe.tabIndex="-1"),fe){const{onEnter:Ve,onExited:ne}=ee();pe.onEnter=Ve,pe.onExited=ne}const ve=(r=(o=q==null?void 0:q.root)!=null?o:j.Root)!=null?r:v2,Ie=(s=(l=q==null?void 0:q.backdrop)!=null?l:j.Backdrop)!=null?s:p,Ee=(u=se==null?void 0:se.root)!=null?u:R.root,Be=(A=se==null?void 0:se.backdrop)!=null?A:R.backdrop,xe=hr.useSlotProps({elementType:ve,externalSlotProps:Ee,externalForwardedProps:J,getSlotProps:K,additionalProps:{ref:n,as:v},ownerState:ue,className:Ye(h,Ee==null?void 0:Ee.className,ge==null?void 0:ge.root,!ue.open&&ue.exited&&(ge==null?void 0:ge.hidden))}),le=hr.useSlotProps({elementType:Ie,externalSlotProps:Be,additionalProps:C,getSlotProps:Ve=>L(z({},Ve,{onClick:ne=>{$&&$(ne),Ve!=null&&Ve.onClick&&Ve.onClick(ne)}})),className:Ye(Be==null?void 0:Be.className,C==null?void 0:C.className,ge==null?void 0:ge.backdrop),ownerState:ue});return!Y&&!ce&&(!fe||de)?null:f.jsx(ea,{ref:W,container:B,disablePortal:N,children:f.jsxs(ve,z({},xe,{children:[!Z&&p?f.jsx(Ie,z({},le)):null,f.jsx(dc,{disableEnforceFocus:O,disableAutoFocus:x,disableRestoreFocus:F,isEnabled:_,open:ce,children:k.cloneElement(m,pe)})]}))})});process.env.NODE_ENV!=="production"&&(X0.propTypes={BackdropComponent:c.elementType,BackdropProps:c.object,children:hi.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([Oo,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 b2=X0;var vg={},Q2=ac;Object.defineProperty(vg,"__esModule",{value:!0});var Z0=vg.default=void 0,x2=Q2(lc()),w2=f,T2=(0,x2.default)((0,w2.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");Z0=vg.default=T2;var yg={},P2=ac;Object.defineProperty(yg,"__esModule",{value:!0});var _0=yg.default=void 0,S2=P2(lc()),O2=f,j2=(0,S2.default)((0,O2.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");_0=yg.default=j2;var M2=function(e){var t=e.children,n=e.editor,r=e.preferenceKey,o=e.openButtonLabel,s=o===void 0?"ra.configurable.customize":o,l=e.sx,u="preferences.".concat(r),A=he.usePreferencesEditor(),g=!!A,p=he.useTranslate(),C=A||{},h=C.isEnabled,E=C.setEditor,m=C.preferenceKey,B=C.setPreferenceKey,v=u===m,j=w.useRef(v),R=w.useRef(null),x=w.useState(!1),O=x[0],P=x[1];if(w.useEffect(function(){j.current=v},[v]),w.useEffect(function(){return function(){j.current&&(B&&B(null),E&&E(null))}},[E,B]),!g)return t;var N=function(){E(w.cloneElement(n,{preferenceKey:u,key:u})),B(u)},F=function(){P(!0)},X=function(){P(!1)};return k.createElement(he.PreferenceKeyContextProvider,{value:u},k.createElement(R2,{className:R0(Nr.root,h&&Nr.editMode,v&&Nr.editorActive),sx:l,ref:R,onMouseEnter:h?F:void 0,onMouseLeave:h?X:void 0},t),k.createElement(b.Popover,{open:h&&(O||v),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(_0,{fontSize:"12px"})))},gc="RaConfigurable",Nr={root:"".concat(gc,"-root"),editMode:"".concat(gc,"-editMode"),editorActive:"".concat(gc,"-editorActive")},R2=Ae("span",{name:gc,overridesResolver:function(e,t){return t.root}})(function(e){var t,n=e.theme;return t={position:"relative",display:"inline-block"},t["&.".concat(Nr.editMode)]={transition:n.transitions.create("outline"),outline:"".concat(b.alpha(n.palette.warning.main,.3)," solid 2px")},t["&.".concat(Nr.editMode,":hover ")]={outline:"".concat(b.alpha(n.palette.warning.main,.5)," solid 2px")},t["&.".concat(Nr.editMode,".").concat(Nr.editorActive," , &.").concat(Nr.editMode,".").concat(Nr.editorActive,":hover ")]={outline:"".concat(n.palette.warning.main," solid 2px")},t}),Yo=globalThis&&globalThis.__assign||function(){return Yo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Yo.apply(this,arguments)},D2=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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},k2=function(e){var t=e.title,n=e.defaultTitle,r=e.className,o=D2(e,["title","defaultTitle","className"]),s=he.usePreference()[0],l=he.useTranslate(),u=he.useRecordContext();return s?k.createElement("span",Yo({className:r},o),l(s,Yo(Yo({},u),{_:s}))):k.createElement("span",{className:r},t?typeof t=="string"?k.createElement("span",Yo({},o),l(t,{_:t})):t:k.createElement("span",Yo({},o),n))},fc=globalThis&&globalThis.__assign||function(){return fc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},fc.apply(this,arguments)},F2=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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},L2=function(){var e=he.usePreferenceInput();return k.createElement("form",null,k.createElement(b.TextField,fc({label:"title",variant:"filled",size:"small",fullWidth:!0,sx:{mb:1}},e)))},N2=function(e){var t=e.preferenceKey,n=F2(e,["preferenceKey"]),r=mt.useLocation().pathname;return k.createElement(M2,{editor:k.createElement(L2,null),preferenceKey:t||"".concat(r,".title"),sx:{"&.RaConfigurable-editMode":{margin:"2px"}}},k.createElement(k2,fc({},n)))},bg=globalThis&&globalThis.__assign||function(){return bg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},bg.apply(this,arguments)},V2=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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},q0=function(e){var t=e.defaultTitle,n=e.title,r=e.preferenceKey,o=V2(e,["defaultTitle","title","preferenceKey"]),s=w.useState(function(){return typeof document<"u"?document.getElementById("react-admin-title"):null}),l=s[0],u=s[1];return w.useEffect(function(){u(function(A){var g=typeof document<"u"&&document.body.contains(A);return A&&g?A:typeof document<"u"?document.getElementById("react-admin-title"):null})},[]),l?(he.warning(!t&&!n,"Missing title prop in <Title> element"),pi.createPortal(k.createElement(N2,bg({title:n,defaultTitle:t,preferenceKey:r},o)),l)):null},$0=c.oneOfType([c.string,c.element]);q0.propTypes={defaultTitle:c.string,className:c.string,record:c.any,title:$0};var H2=function(e){var t=gi.useLocation().pathname,n=w.useRef(t);w.useEffect(function(){t!==n.current&&e()},[t,e])},W2=function(t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),t.length!==n.length||t.some(function(r,o){return!Object.is(r,n[o])})},eB={error:null},z2=function(e){vd(t,e);function t(){for(var r,o=arguments.length,s=new Array(o),l=0;l<o;l++)s[l]=arguments[l];return r=e.call.apply(e,[this].concat(s))||this,r.state=eB,r.resetErrorBoundary=function(){for(var u,A=arguments.length,g=new Array(A),p=0;p<A;p++)g[p]=arguments[p];r.props.onReset==null||(u=r.props).onReset.apply(u,g),r.reset()},r}t.getDerivedStateFromError=function(o){return{error:o}};var n=t.prototype;return n.reset=function(){this.setState(eB)},n.componentDidCatch=function(o,s){var l,u;(l=(u=this.props).onError)==null||l.call(u,o,s)},n.componentDidUpdate=function(o,s){var l=this.state.error,u=this.props.resetKeys;if(l!==null&&s.error!==null&&W2(o.resetKeys,u)){var A,g;(A=(g=this.props).onResetKeysChange)==null||A.call(g,o.resetKeys,u),this.reset()}},n.render=function(){var o=this.state.error,s=this.props,l=s.fallbackRender,u=s.FallbackComponent,A=s.fallback;if(o!==null){var g={error:o,resetErrorBoundary:this.resetErrorBoundary};if(k.isValidElement(A))return A;if(typeof l=="function")return l(g);if(u)return k.createElement(u,g);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(k.Component),Qg=globalThis&&globalThis.__assign||function(){return Qg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Qg.apply(this,arguments)},U2=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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},tB=function(e){var t=e.className,n=e.loadingPrimary,r=n===void 0?"ra.page.loading":n,o=e.loadingSecondary,s=o===void 0?"ra.message.loading":o,l=U2(e,["className","loadingPrimary","loadingSecondary"]),u=he.useTimeout(1e3),A=he.useTranslate();return u?k.createElement(Y2,Qg({className:t},l),k.createElement("div",{className:hc.message},k.createElement(Od,{className:hc.icon}),k.createElement(b.Typography,{variant:"h5",mt:3,color:"text.secondary"},A(r,{_:r})),k.createElement(b.Typography,{variant:"body2"},A(s,{_:s})))):null};tB.propTypes={className:c.string,loadingPrimary:c.string,loadingSecondary:c.string};var pc="RaLoading",hc={root:"".concat(pc,"-root"),icon:"".concat(pc,"-icon"),message:"".concat(pc,"-message")},Y2=Ae("div",{name:pc,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(hc.message)]={textAlign:"center",fontFamily:"Roboto, sans-serif",color:n.palette.text.disabled,paddingTop:"1em",paddingBottom:"1em"},t["& .".concat(hc.icon)]={width:"9em",height:"9em"},t});function G2(e){return Lt("MuiToolbar",e)}Ht("MuiToolbar",["root","gutters","regular","dense"]);const K2=["className","component","disableGutters","variant"],J2=e=>{const{classes:t,disableGutters:n,variant:r}=e;return nn({root:["root",!n&&"gutters",r]},G2,t)},X2=Ae("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(({theme:e,ownerState:t})=>z({position:"relative",display:"flex",alignItems:"center"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}},t.variant==="dense"&&{minHeight:48}),({theme:e,ownerState:t})=>t.variant==="regular"&&e.mixins.toolbar),nB=k.forwardRef(function(t,n){const r=Wt({props:t,name:"MuiToolbar"}),{className:o,component:s="div",disableGutters:l=!1,variant:u="regular"}=r,A=Ue(r,K2),g=z({},r,{component:s,disableGutters:l,variant:u}),p=J2(g);return f.jsx(X2,z({as:s,className:Ye(p.root,o),ref:n,ownerState:g},A))});process.env.NODE_ENV!=="production"&&(nB.propTypes={children:c.node,classes:c.object,className:c.string,component:c.elementType,disableGutters:c.bool,sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["dense","regular"]),c.string])});const Z2=nB;var xg={},_2=ac;Object.defineProperty(xg,"__esModule",{value:!0});var rB=xg.default=void 0,q2=_2(lc()),$2=f,e8=(0,q2.default)((0,$2.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");rB=xg.default=e8;const t8=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function wg(e){return`scale(${e}, ${e**2})`}const n8={entering:{opacity:1,transform:wg(1)},entered:{opacity:1,transform:"none"}},Tg=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:o=!0,children:s,easing:l,in:u,onEnter:A,onEntered:g,onEntering:p,onExit:C,onExited:h,onExiting:E,style:m,timeout:B="auto",TransitionComponent:v=bd}=t,j=Ue(t,t8),R=k.useRef(),x=k.useRef(),O=Pt(),P=k.useRef(null),N=Qn(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)=>{mg(J);const{duration:K,delay:L,easing:ee}=zi({style:m,timeout:B,easing:l},{mode:"enter"});let W;B==="auto"?(W=O.transitions.getAutoHeightDuration(J.clientHeight),x.current=W):W=K,J.style.transition=[O.transitions.create("opacity",{duration:W,delay:L}),O.transitions.create("transform",{duration:Tg?W:W*.666,delay:L,easing:ee})].join(","),A&&A(J,H)}),Y=F(g),$=F(E),ce=F(J=>{const{duration:H,delay:K,easing:L}=zi({style:m,timeout:B,easing:l},{mode:"exit"});let ee;B==="auto"?(ee=O.transitions.getAutoHeightDuration(J.clientHeight),x.current=ee):ee=H,J.style.transition=[O.transitions.create("opacity",{duration:ee,delay:K}),O.transitions.create("transform",{duration:Tg?ee:ee*.666,delay:Tg?K:K||ee*.333,easing:L})].join(","),J.style.opacity=0,J.style.transform=wg(.75),C&&C(J)}),se=F(h),q=J=>{B==="auto"&&(R.current=setTimeout(J,x.current||0)),r&&r(P.current,J)};return k.useEffect(()=>()=>{clearTimeout(R.current)},[]),f.jsx(v,z({appear:o,in:u,nodeRef:P,onEnter:Z,onEntered:Y,onEntering:X,onExit:ce,onExited:se,onExiting:$,addEndListener:q,timeout:B==="auto"?null:B},j,{children:(J,H)=>k.cloneElement(s,z({style:z({opacity:0,transform:wg(.75),visibility:J==="exited"&&!u?"hidden":void 0},n8[J],m,s.props.style),ref:N},H))}))});process.env.NODE_ENV!=="production"&&(Pg.propTypes={addEndListener:c.func,appear:c.bool,children:hi.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 oB=Pg;var hn="top",Gn="bottom",Kn="right",Cn="left",Sg="auto",ta=[hn,Gn,Kn,Cn],Ui="start",na="end",r8="clippingParents",iB="viewport",ra="popper",o8="reference",sB=ta.reduce(function(e,t){return e.concat([t+"-"+Ui,t+"-"+na])},[]),aB=[].concat(ta,[Sg]).reduce(function(e,t){return e.concat([t,t+"-"+Ui,t+"-"+na])},[]),i8="beforeRead",s8="read",a8="afterRead",l8="beforeMain",c8="main",u8="afterMain",A8="beforeWrite",d8="write",g8="afterWrite",f8=[i8,s8,a8,l8,c8,u8,A8,d8,g8];function vr(e){return e?(e.nodeName||"").toLowerCase():null}function Pn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Go(e){var t=Pn(e).Element;return e instanceof t||e instanceof Element}function Jn(e){var t=Pn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Og(e){if(typeof ShadowRoot>"u")return!1;var t=Pn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function p8(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},s=t.elements[n];!Jn(s)||!vr(s)||(Object.assign(s.style,r),Object.keys(o).forEach(function(l){var u=o[l];u===!1?s.removeAttribute(l):s.setAttribute(l,u===!0?"":u)}))})}function h8(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 o=t.elements[r],s=t.attributes[r]||{},l=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),u=l.reduce(function(A,g){return A[g]="",A},{});!Jn(o)||!vr(o)||(Object.assign(o.style,u),Object.keys(s).forEach(function(A){o.removeAttribute(A)}))})}}const C8={name:"applyStyles",enabled:!0,phase:"write",fn:p8,effect:h8,requires:["computeStyles"]};function yr(e){return e.split("-")[0]}var Ko=Math.max,Cc=Math.min,Yi=Math.round;function jg(){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 lB(){return!/^((?!chrome|android).)*safari/i.test(jg())}function Gi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,s=1;t&&Jn(e)&&(o=e.offsetWidth>0&&Yi(r.width)/e.offsetWidth||1,s=e.offsetHeight>0&&Yi(r.height)/e.offsetHeight||1);var l=Go(e)?Pn(e):window,u=l.visualViewport,A=!lB()&&n,g=(r.left+(A&&u?u.offsetLeft:0))/o,p=(r.top+(A&&u?u.offsetTop:0))/s,C=r.width/o,h=r.height/s;return{width:C,height:h,top:p,right:g+C,bottom:p+h,left:g,x:g,y:p}}function Mg(e){var t=Gi(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 cB(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Og(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Vr(e){return Pn(e).getComputedStyle(e)}function E8(e){return["table","td","th"].indexOf(vr(e))>=0}function go(e){return((Go(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ec(e){return vr(e)==="html"?e:e.assignedSlot||e.parentNode||(Og(e)?e.host:null)||go(e)}function uB(e){return!Jn(e)||Vr(e).position==="fixed"?null:e.offsetParent}function I8(e){var t=/firefox/i.test(jg()),n=/Trident/i.test(jg());if(n&&Jn(e)){var r=Vr(e);if(r.position==="fixed")return null}var o=Ec(e);for(Og(o)&&(o=o.host);Jn(o)&&["html","body"].indexOf(vr(o))<0;){var s=Vr(o);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 o;o=o.parentNode}return null}function oa(e){for(var t=Pn(e),n=uB(e);n&&E8(n)&&Vr(n).position==="static";)n=uB(n);return n&&(vr(n)==="html"||vr(n)==="body"&&Vr(n).position==="static")?t:n||I8(e)||t}function Rg(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ia(e,t,n){return Ko(e,Cc(t,n))}function m8(e,t,n){var r=ia(e,t,n);return r>n?n:r}function AB(){return{top:0,right:0,bottom:0,left:0}}function dB(e){return Object.assign({},AB(),e)}function gB(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var B8=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,dB(typeof t!="number"?t:gB(t,ta))};function v8(e){var t,n=e.state,r=e.name,o=e.options,s=n.elements.arrow,l=n.modifiersData.popperOffsets,u=yr(n.placement),A=Rg(u),g=[Cn,Kn].indexOf(u)>=0,p=g?"height":"width";if(!(!s||!l)){var C=B8(o.padding,n),h=Mg(s),E=A==="y"?hn:Cn,m=A==="y"?Gn:Kn,B=n.rects.reference[p]+n.rects.reference[A]-l[A]-n.rects.popper[p],v=l[A]-n.rects.reference[A],j=oa(s),R=j?A==="y"?j.clientHeight||0:j.clientWidth||0:0,x=B/2-v/2,O=C[E],P=R-h[p]-C[m],N=R/2-h[p]/2+x,F=ia(O,N,P),X=A;n.modifiersData[r]=(t={},t[X]=F,t.centerOffset=F-N,t)}}function y8(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||cB(t.elements.popper,o)&&(t.elements.arrow=o))}const b8={name:"arrow",enabled:!0,phase:"main",fn:v8,effect:y8,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ki(e){return e.split("-")[1]}var Q8={top:"auto",right:"auto",bottom:"auto",left:"auto"};function x8(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Yi(n*o)/o||0,y:Yi(r*o)/o||0}}function fB(e){var t,n=e.popper,r=e.popperRect,o=e.placement,s=e.variation,l=e.offsets,u=e.position,A=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,v=typeof p=="function"?p({x:E,y:B}):{x:E,y:B};E=v.x,B=v.y;var j=l.hasOwnProperty("x"),R=l.hasOwnProperty("y"),x=Cn,O=hn,P=window;if(g){var N=oa(n),F="clientHeight",X="clientWidth";if(N===Pn(n)&&(N=go(n),Vr(N).position!=="static"&&u==="absolute"&&(F="scrollHeight",X="scrollWidth")),N=N,o===hn||(o===Cn||o===Kn)&&s===na){O=Gn;var Z=C&&N===P&&P.visualViewport?P.visualViewport.height:N[F];B-=Z-r.height,B*=A?1:-1}if(o===Cn||(o===hn||o===Gn)&&s===na){x=Kn;var Y=C&&N===P&&P.visualViewport?P.visualViewport.width:N[X];E-=Y-r.width,E*=A?1:-1}}var $=Object.assign({position:u},g&&Q8),ce=p===!0?x8({x:E,y:B},Pn(n)):{x:E,y:B};if(E=ce.x,B=ce.y,A){var se;return Object.assign({},$,(se={},se[O]=R?"0":"",se[x]=j?"0":"",se.transform=(P.devicePixelRatio||1)<=1?"translate("+E+"px, "+B+"px)":"translate3d("+E+"px, "+B+"px, 0)",se))}return Object.assign({},$,(t={},t[O]=R?B+"px":"",t[x]=j?E+"px":"",t.transform="",t))}function w8(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,s=n.adaptive,l=s===void 0?!0:s,u=n.roundOffsets,A=u===void 0?!0:u,g={placement:yr(t.placement),variation:Ki(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,fB(Object.assign({},g,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:A})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,fB(Object.assign({},g,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:A})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const T8={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:w8,data:{}};var Ic={passive:!0};function P8(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,s=o===void 0?!0:o,l=r.resize,u=l===void 0?!0:l,A=Pn(t.elements.popper),g=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&g.forEach(function(p){p.addEventListener("scroll",n.update,Ic)}),u&&A.addEventListener("resize",n.update,Ic),function(){s&&g.forEach(function(p){p.removeEventListener("scroll",n.update,Ic)}),u&&A.removeEventListener("resize",n.update,Ic)}}const S8={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:P8,data:{}};var O8={left:"right",right:"left",bottom:"top",top:"bottom"};function mc(e){return e.replace(/left|right|bottom|top/g,function(t){return O8[t]})}var j8={start:"end",end:"start"};function pB(e){return e.replace(/start|end/g,function(t){return j8[t]})}function Dg(e){var t=Pn(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function kg(e){return Gi(go(e)).left+Dg(e).scrollLeft}function M8(e,t){var n=Pn(e),r=go(e),o=n.visualViewport,s=r.clientWidth,l=r.clientHeight,u=0,A=0;if(o){s=o.width,l=o.height;var g=lB();(g||!g&&t==="fixed")&&(u=o.offsetLeft,A=o.offsetTop)}return{width:s,height:l,x:u+kg(e),y:A}}function R8(e){var t,n=go(e),r=Dg(e),o=(t=e.ownerDocument)==null?void 0:t.body,s=Ko(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=Ko(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),u=-r.scrollLeft+kg(e),A=-r.scrollTop;return Vr(o||n).direction==="rtl"&&(u+=Ko(n.clientWidth,o?o.clientWidth:0)-s),{width:s,height:l,x:u,y:A}}function Fg(e){var t=Vr(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function hB(e){return["html","body","#document"].indexOf(vr(e))>=0?e.ownerDocument.body:Jn(e)&&Fg(e)?e:hB(Ec(e))}function sa(e,t){var n;t===void 0&&(t=[]);var r=hB(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),s=Pn(r),l=o?[s].concat(s.visualViewport||[],Fg(r)?r:[]):r,u=t.concat(l);return o?u:u.concat(sa(Ec(l)))}function Lg(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function D8(e,t){var n=Gi(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 CB(e,t,n){return t===iB?Lg(M8(e,n)):Go(t)?D8(t,n):Lg(R8(go(e)))}function k8(e){var t=sa(Ec(e)),n=["absolute","fixed"].indexOf(Vr(e).position)>=0,r=n&&Jn(e)?oa(e):e;return Go(r)?t.filter(function(o){return Go(o)&&cB(o,r)&&vr(o)!=="body"}):[]}function F8(e,t,n,r){var o=t==="clippingParents"?k8(e):[].concat(t),s=[].concat(o,[n]),l=s[0],u=s.reduce(function(A,g){var p=CB(e,g,r);return A.top=Ko(p.top,A.top),A.right=Cc(p.right,A.right),A.bottom=Cc(p.bottom,A.bottom),A.left=Ko(p.left,A.left),A},CB(e,l,r));return u.width=u.right-u.left,u.height=u.bottom-u.top,u.x=u.left,u.y=u.top,u}function EB(e){var t=e.reference,n=e.element,r=e.placement,o=r?yr(r):null,s=r?Ki(r):null,l=t.x+t.width/2-n.width/2,u=t.y+t.height/2-n.height/2,A;switch(o){case hn:A={x:l,y:t.y-n.height};break;case Gn:A={x:l,y:t.y+t.height};break;case Kn:A={x:t.x+t.width,y:u};break;case Cn:A={x:t.x-n.width,y:u};break;default:A={x:t.x,y:t.y}}var g=o?Rg(o):null;if(g!=null){var p=g==="y"?"height":"width";switch(s){case Ui:A[g]=A[g]-(t[p]/2-n[p]/2);break;case na:A[g]=A[g]+(t[p]/2-n[p]/2);break}}return A}function aa(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,s=n.strategy,l=s===void 0?e.strategy:s,u=n.boundary,A=u===void 0?r8:u,g=n.rootBoundary,p=g===void 0?iB:g,C=n.elementContext,h=C===void 0?ra:C,E=n.altBoundary,m=E===void 0?!1:E,B=n.padding,v=B===void 0?0:B,j=dB(typeof v!="number"?v:gB(v,ta)),R=h===ra?o8:ra,x=e.rects.popper,O=e.elements[m?R:h],P=F8(Go(O)?O:O.contextElement||go(e.elements.popper),A,p,l),N=Gi(e.elements.reference),F=EB({reference:N,element:x,strategy:"absolute",placement:o}),X=Lg(Object.assign({},x,F)),Z=h===ra?X:N,Y={top:P.top-Z.top+j.top,bottom:Z.bottom-P.bottom+j.bottom,left:P.left-Z.left+j.left,right:Z.right-P.right+j.right},$=e.modifiersData.offset;if(h===ra&&$){var ce=$[o];Object.keys(Y).forEach(function(se){var q=[Kn,Gn].indexOf(se)>=0?1:-1,J=[hn,Gn].indexOf(se)>=0?"y":"x";Y[se]+=ce[J]*q})}return Y}function L8(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,s=n.rootBoundary,l=n.padding,u=n.flipVariations,A=n.allowedAutoPlacements,g=A===void 0?aB:A,p=Ki(r),C=p?u?sB:sB.filter(function(m){return Ki(m)===p}):ta,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]=aa(e,{placement:B,boundary:o,rootBoundary:s,padding:l})[yr(B)],m},{});return Object.keys(E).sort(function(m,B){return E[m]-E[B]})}function N8(e){if(yr(e)===Sg)return[];var t=mc(e);return[pB(e),t,pB(t)]}function V8(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,s=o===void 0?!0:o,l=n.altAxis,u=l===void 0?!0:l,A=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,v=t.options.placement,j=yr(v),R=j===v,x=A||(R||!m?[mc(v)]:N8(v)),O=[v].concat(x).reduce(function(ue,ge){return ue.concat(yr(ge)===Sg?L8(t,{placement:ge,boundary:p,rootBoundary:C,padding:g,flipVariations:m,allowedAutoPlacements:B}):ge)},[]),P=t.rects.reference,N=t.rects.popper,F=new Map,X=!0,Z=O[0],Y=0;Y<O.length;Y++){var $=O[Y],ce=yr($),se=Ki($)===Ui,q=[hn,Gn].indexOf(ce)>=0,J=q?"width":"height",H=aa(t,{placement:$,boundary:p,rootBoundary:C,altBoundary:h,padding:g}),K=q?se?Kn:Cn:se?Gn:hn;P[J]>N[J]&&(K=mc(K));var L=mc(K),ee=[];if(s&&ee.push(H[ce]<=0),u&&ee.push(H[K]<=0,H[L]<=0),ee.every(function(ue){return ue})){Z=$,X=!1;break}F.set($,ee)}if(X)for(var W=m?3:1,_=function(ge){var pe=O.find(function(ve){var Ie=F.get(ve);if(Ie)return Ie.slice(0,ge).every(function(Ee){return Ee})});if(pe)return Z=pe,"break"},de=W;de>0;de--){var fe=_(de);if(fe==="break")break}t.placement!==Z&&(t.modifiersData[r]._skip=!0,t.placement=Z,t.reset=!0)}}const H8={name:"flip",enabled:!0,phase:"main",fn:V8,requiresIfExists:["offset"],data:{_skip:!1}};function IB(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 mB(e){return[hn,Kn,Gn,Cn].some(function(t){return e[t]>=0})}function W8(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,s=t.modifiersData.preventOverflow,l=aa(t,{elementContext:"reference"}),u=aa(t,{altBoundary:!0}),A=IB(l,r),g=IB(u,o,s),p=mB(A),C=mB(g);t.modifiersData[n]={referenceClippingOffsets:A,popperEscapeOffsets:g,isReferenceHidden:p,hasPopperEscaped:C},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":C})}const z8={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:W8};function U8(e,t,n){var r=yr(e),o=[Cn,hn].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,l=s[0],u=s[1];return l=l||0,u=(u||0)*o,[Cn,Kn].indexOf(r)>=0?{x:u,y:l}:{x:l,y:u}}function Y8(e){var t=e.state,n=e.options,r=e.name,o=n.offset,s=o===void 0?[0,0]:o,l=aB.reduce(function(p,C){return p[C]=U8(C,t.rects,s),p},{}),u=l[t.placement],A=u.x,g=u.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=A,t.modifiersData.popperOffsets.y+=g),t.modifiersData[r]=l}const G8={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Y8};function K8(e){var t=e.state,n=e.name;t.modifiersData[n]=EB({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const J8={name:"popperOffsets",enabled:!0,phase:"read",fn:K8,data:{}};function X8(e){return e==="x"?"y":"x"}function Z8(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,s=o===void 0?!0:o,l=n.altAxis,u=l===void 0?!1:l,A=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,v=aa(t,{boundary:A,rootBoundary:g,padding:C,altBoundary:p}),j=yr(t.placement),R=Ki(t.placement),x=!R,O=Rg(j),P=X8(O),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,Y=typeof Z=="number"?{mainAxis:Z,altAxis:Z}:Object.assign({mainAxis:0,altAxis:0},Z),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,ce={x:0,y:0};if(N){if(s){var se,q=O==="y"?hn:Cn,J=O==="y"?Gn:Kn,H=O==="y"?"height":"width",K=N[O],L=K+v[q],ee=K-v[J],W=E?-X[H]/2:0,_=R===Ui?F[H]:X[H],de=R===Ui?-X[H]:-F[H],fe=t.elements.arrow,ue=E&&fe?Mg(fe):{width:0,height:0},ge=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:AB(),pe=ge[q],ve=ge[J],Ie=ia(0,F[H],ue[H]),Ee=x?F[H]/2-W-Ie-pe-Y.mainAxis:_-Ie-pe-Y.mainAxis,Be=x?-F[H]/2+W+Ie+ve+Y.mainAxis:de+Ie+ve+Y.mainAxis,xe=t.elements.arrow&&oa(t.elements.arrow),le=xe?O==="y"?xe.clientTop||0:xe.clientLeft||0:0,Ve=(se=$==null?void 0:$[O])!=null?se:0,ne=K+Ee-Ve-le,$e=K+Be-Ve,xt=ia(E?Cc(L,ne):L,K,E?Ko(ee,$e):ee);N[O]=xt,ce[O]=xt-K}if(u){var ft,Ot=O==="x"?hn:Cn,Qr=O==="x"?Gn:Kn,wt=N[P],vt=P==="y"?"height":"width",pt=wt+v[Ot],Ut=wt-v[Qr],Yt=[hn,Cn].indexOf(j)!==-1,Oe=(ft=$==null?void 0:$[P])!=null?ft:0,Fe=Yt?pt:wt-F[vt]-X[vt]-Oe+Y.altAxis,Te=Yt?wt+F[vt]+X[vt]-Oe-Y.altAxis:Ut,Ge=E&&Yt?m8(Fe,wt,Te):ia(E?Fe:pt,wt,E?Te:Ut);N[P]=Ge,ce[P]=Ge-wt}t.modifiersData[r]=ce}}const _8={name:"preventOverflow",enabled:!0,phase:"main",fn:Z8,requiresIfExists:["offset"]};function q8(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function $8(e){return e===Pn(e)||!Jn(e)?Dg(e):q8(e)}function e6(e){var t=e.getBoundingClientRect(),n=Yi(t.width)/e.offsetWidth||1,r=Yi(t.height)/e.offsetHeight||1;return n!==1||r!==1}function t6(e,t,n){n===void 0&&(n=!1);var r=Jn(t),o=Jn(t)&&e6(t),s=go(t),l=Gi(e,o,n),u={scrollLeft:0,scrollTop:0},A={x:0,y:0};return(r||!r&&!n)&&((vr(t)!=="body"||Fg(s))&&(u=$8(t)),Jn(t)?(A=Gi(t,!0),A.x+=t.clientLeft,A.y+=t.clientTop):s&&(A.x=kg(s))),{x:l.left+u.scrollLeft-A.x,y:l.top+u.scrollTop-A.y,width:l.width,height:l.height}}function n6(e){var t=new Map,n=new Set,r=[];e.forEach(function(s){t.set(s.name,s)});function o(s){n.add(s.name);var l=[].concat(s.requires||[],s.requiresIfExists||[]);l.forEach(function(u){if(!n.has(u)){var A=t.get(u);A&&o(A)}}),r.push(s)}return e.forEach(function(s){n.has(s.name)||o(s)}),r}function r6(e){var t=n6(e);return f8.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function o6(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function i6(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var BB={placement:"bottom",modifiers:[],strategy:"absolute"};function vB(){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 s6(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,s=o===void 0?BB:o;return function(u,A,g){g===void 0&&(g=s);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},BB,s),modifiersData:{},elements:{reference:u,popper:A},attributes:{},styles:{}},C=[],h=!1,E={state:p,setOptions:function(j){var R=typeof j=="function"?j(p.options):j;B(),p.options=Object.assign({},s,p.options,R),p.scrollParents={reference:Go(u)?sa(u):u.contextElement?sa(u.contextElement):[],popper:sa(A)};var x=r6(i6([].concat(r,p.options.modifiers)));return p.orderedModifiers=x.filter(function(O){return O.enabled}),m(),E.update()},forceUpdate:function(){if(!h){var j=p.elements,R=j.reference,x=j.popper;if(vB(R,x)){p.rects={reference:t6(R,oa(x),p.options.strategy==="fixed"),popper:Mg(x)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(Y){return p.modifiersData[Y.name]=Object.assign({},Y.data)});for(var O=0;O<p.orderedModifiers.length;O++){if(p.reset===!0){p.reset=!1,O=-1;continue}var P=p.orderedModifiers[O],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:o6(function(){return new Promise(function(v){E.forceUpdate(),v(p)})}),destroy:function(){B(),h=!0}};if(!vB(u,A))return E;E.setOptions(g).then(function(v){!h&&g.onFirstUpdate&&g.onFirstUpdate(v)});function m(){p.orderedModifiers.forEach(function(v){var j=v.name,R=v.options,x=R===void 0?{}:R,O=v.effect;if(typeof O=="function"){var P=O({state:p,name:j,instance:E,options:x}),N=function(){};C.push(P||N)}})}function B(){C.forEach(function(v){return v()}),C=[]}return E}}var a6=[S8,J8,T8,C8,G8,H8,_8,b8,z8],l6=s6({defaultModifiers:a6});function c6(e){return Lt("MuiPopper",e)}Ht("MuiPopper",["root"]);const u6=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],A6=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function d6(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 Bc(e){return typeof e=="function"?e():e}function vc(e){return e.nodeType!==void 0}function g6(e){return!vc(e)}const f6=()=>nn({root:["root"]},U5(c6)),p6={},h6=k.forwardRef(function(t,n){var r;const{anchorEl:o,children:s,direction:l,disablePortal:u,modifiers:A,open:g,placement:p,popperOptions:C,popperRef:h,slotProps:E={},slots:m={},TransitionProps:B}=t,v=Ue(t,u6),j=k.useRef(null),R=Qn(j,n),x=k.useRef(null),O=Qn(x,h),P=k.useRef(O);Ii(()=>{P.current=O},[O]),k.useImperativeHandle(h,()=>x.current,[]);const N=d6(p,l),[F,X]=k.useState(N),[Z,Y]=k.useState(Bc(o));k.useEffect(()=>{x.current&&x.current.forceUpdate()}),k.useEffect(()=>{o&&Y(Bc(o))},[o]),Ii(()=>{if(!Z||!g)return;const J=L=>{X(L.placement)};if(process.env.NODE_ENV!=="production"&&Z&&vc(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(`
|