finform-react-builder 1.12.8 → 1.12.9

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/index.es.js CHANGED
@@ -10384,8 +10384,8 @@ const Ym = Et(Ml)(({ theme: e }) => {
10384
10384
  sx: {
10385
10385
  alignItems: "center",
10386
10386
  borderRadius: "6px",
10387
- p: "8px 10px",
10388
- backgroundColor: "#F2F2F2",
10387
+ p: "10px",
10388
+ backgroundColor: "#FFFFFF",
10389
10389
  "& .MuiTabs-flexContainer": {
10390
10390
  gap: 1
10391
10391
  },
@@ -10409,7 +10409,7 @@ const Ym = Et(Ml)(({ theme: e }) => {
10409
10409
  boxShadow: "none",
10410
10410
  borderRadius: "3px",
10411
10411
  border: "0.5px solid #0000001A",
10412
- backgroundColor: "#E8E8E8",
10412
+ backgroundColor: "#FFFFFF",
10413
10413
  "&:hover": {
10414
10414
  backgroundColor: u.palette.action.hover
10415
10415
  },
package/dist/index.js CHANGED
@@ -173,7 +173,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
173
173
  `:null,_h=typeof $a!="string"?dr.css`
174
174
  animation: ${$a} 1.4s ease-in-out infinite;
175
175
  `:null,Rh=e=>{const{classes:t,variant:r,color:n,disableShrink:i}=e,a={root:["root",r,`color${De(n)}`],svg:["svg"],circle:["circle",`circle${De(r)}`,i&&"circleDisableShrink"]};return cn(a,Ah,t)},Ph=yt("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`color${De(r.color)}`]]}})(Pr(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Oh||{animation:`${Pa} 1.4s linear infinite`}},...Object.entries(e.palette).filter(ci()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),$h=yt("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),Dh=yt("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t[`circle${De(r.variant)}`],r.disableShrink&&t.circleDisableShrink]}})(Pr(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:_h||{animation:`${$a} 1.4s ease-in-out infinite`}}]}))),lc=ie.forwardRef(function(t,r){const n=Dr({props:t,name:"MuiCircularProgress"}),{className:i,color:a="primary",disableShrink:o=!1,size:s=40,style:c,thickness:p=3.6,value:f=0,variant:d="indeterminate",...u}=n,x={...n,color:a,disableShrink:o,size:s,thickness:p,value:f,variant:d},k=Rh(x),m={},C={},v={};if(d==="determinate"){const w=2*Math.PI*((Gt-p)/2);m.strokeDasharray=w.toFixed(3),v["aria-valuenow"]=Math.round(f),m.strokeDashoffset=`${((100-f)/100*w).toFixed(3)}px`,C.transform="rotate(-90deg)"}return l.jsx(Ph,{className:nt(k.root,i),style:{width:s,height:s,...C,...c},ownerState:x,ref:r,role:"progressbar",...v,...u,children:l.jsx($h,{className:k.svg,ownerState:x,viewBox:`${Gt/2} ${Gt/2} ${Gt} ${Gt}`,children:l.jsx(Dh,{className:k.circle,style:m,ownerState:x,cx:Gt,cy:Gt,r:(Gt-p)/2,fill:"none",strokeWidth:p})})})});process.env.NODE_ENV!=="production"&&(lc.propTypes={classes:T.object,className:T.string,color:T.oneOfType([T.oneOf(["inherit","primary","secondary","error","info","success","warning"]),T.string]),disableShrink:oo(T.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:T.oneOfType([T.number,T.string]),style:T.object,sx:T.oneOfType([T.arrayOf(T.oneOfType([T.func,T.object,T.bool])),T.func,T.object]),thickness:T.number,value:T.number,variant:T.oneOf(["determinate","indeterminate"])});function Ih(e){return hr("MuiIconButton",e)}const As=$r("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),Mh=e=>{const{classes:t,disabled:r,color:n,edge:i,size:a,loading:o}=e,s={root:["root",o&&"loading",r&&"disabled",n!=="default"&&`color${De(n)}`,i&&`edge${De(i)}`,`size${De(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return cn(s,Ih,t)},zh=yt(sc,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.loading&&t.loading,r.color!=="default"&&t[`color${De(r.color)}`],r.edge&&t[`edge${De(r.edge)}`],t[`size${De(r.size)}`]]}})(Pr(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:mt(e.palette.action.active,e.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),Pr(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(ci()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(ci()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:mt((e.vars||e).palette[t].main,e.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${As.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${As.loading}`]:{color:"transparent"}}))),Bh=yt("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Gn=ie.forwardRef(function(t,r){const n=Dr({props:t,name:"MuiIconButton"}),{edge:i=!1,children:a,className:o,color:s="default",disabled:c=!1,disableFocusRipple:p=!1,size:f="medium",id:d,loading:u=null,loadingIndicator:x,...k}=n,m=th(d),C=x??l.jsx(lc,{"aria-labelledby":m,color:"inherit",size:16}),v={...n,edge:i,color:s,disabled:c,disableFocusRipple:p,loading:u,loadingIndicator:C,size:f},w=Mh(v);return l.jsxs(zh,{id:u?m:d,className:nt(w.root,o),centerRipple:!0,focusRipple:!p,disabled:c||u,ref:r,...k,ownerState:v,children:[typeof u=="boolean"&&l.jsx("span",{className:w.loadingWrapper,style:{display:"contents"},children:l.jsx(Bh,{className:w.loadingIndicator,ownerState:v,children:u&&C})}),a]})});process.env.NODE_ENV!=="production"&&(Gn.propTypes={children:oo(T.node,e=>ie.Children.toArray(e.children).some(r=>ie.isValidElement(r)&&r.props.onClick)?new Error(["MUI: You are providing an onClick event listener to a child of a button element.","Prefer applying it to the IconButton directly.","This guarantees that the whole <button> will be responsive to click events."].join(`
176
- `)):null),classes:T.object,className:T.string,color:T.oneOfType([T.oneOf(["inherit","default","primary","secondary","error","info","success","warning"]),T.string]),disabled:T.bool,disableFocusRipple:T.bool,disableRipple:T.bool,edge:T.oneOf(["end","start",!1]),id:T.string,loading:T.bool,loadingIndicator:T.node,size:T.oneOfType([T.oneOf(["small","medium","large"]),T.string]),sx:T.oneOfType([T.arrayOf(T.oneOfType([T.func,T.object,T.bool])),T.func,T.object])});const Os=ut(l.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),_s=ut(l.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff"),Vh=ut(l.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),uo=ut(l.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),di=ut(l.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"}),"FileUploadOutlined"),Nh=ut(l.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-4.86 8.86-3 3.87L9 13.14 6 17h12z"}),"ImageOutlined"),ye={primary:{main:"#2C5EFF",contrastText:"#FFFFFF"},secondary:{main:"#00B894",contrastText:"#FFFFFF"},error:{main:"#E53935"},warning:{main:"#FB8C00"},info:{main:"#1E88E5"},success:{main:"#43A047"},background:{default:"#FFFFFF",paper:"#FFFFFF"},text:{primary:"#111827",secondary:"#6B7280",disabled:"#9CA3AF"},divider:"#E5E7EB"},Rs=e=>{const t=e.replace("#",""),r=parseInt(t.length===3?t.split("").map(n=>n+n).join(""):t,16);return{r:r>>16&255,g:r>>8&255,b:r&255}},Lh=(e,t,r)=>"#"+[e,t,r].map(n=>{const i=Math.round(Math.min(255,Math.max(0,n))).toString(16);return i.length===1?"0"+i:i}).join(""),Nt=(e,t,r)=>{const n=Rs(e),i=Rs(t);return Lh(n.r+(i.r-n.r)*r,n.g+(i.g-n.g)*r,n.b+(i.b-n.b)*r)},$i=e=>{const t="#FFFFFF",r="#000000";return{50:Nt(t,e,.08),100:Nt(t,e,.16),200:Nt(t,e,.28),300:Nt(t,e,.4),400:Nt(t,e,.55),500:e,600:Nt(e,r,.1),700:Nt(e,r,.2),800:Nt(e,r,.3),900:Nt(e,r,.42)}},qh=$i(ye.primary.main),Wh=$i(ye.secondary.main),Qn=$i(ye.text.primary),cc=e=>$i(e),Uh={primary:ye.primary.main,secondary:ye.secondary.main,textPrimary:ye.text.primary,textSecondary:ye.text.secondary,divider:ye.divider,background:ye.background},Hh="#111827";function Kh(e){const t=e.palette.text.primary;return typeof t=="string"?t:Hh}function Pn(){const e=tc(),t=e.palette.mode,r=Kh(e),n=e.palette.background.paper,i=e.palette.divider,a=e.palette.text.secondary,o=e.palette.error.main;return P.useMemo(()=>{const s=cc(r);return{paper:n,divider:i,textPrimary:r,textSecondary:a,errorMain:o,neutral50:s[50],outlineDefault:mt(s[300],.5),outlineHover:s[300],outlineFocus:s[400]}},[t,r,n,i,a,o])}const uc="#244061";function Yh(){return Xl({palette:{mode:"light",primary:{main:uc,light:"#0a8a4f",dark:"#0d9c5a"},success:{main:"#10B981"},warning:{main:"#F59E0B"},error:{main:"#D40824"},info:{main:"#3B82F6"},text:{primary:"#1A1A1A",secondary:"rgba(0, 0, 0, 0.6)"},background:{default:"#fafafa",paper:"#ffffff"},divider:"#e2e8f0"},typography:{fontFamily:'"Inter", sans-serif',h1:{fontSize:"24px",fontWeight:700,lineHeight:1.3,letterSpacing:"-0.01em"},h2:{fontSize:"20px",fontWeight:600,lineHeight:1.35,letterSpacing:"-0.005em"},h3:{fontSize:"18px",fontWeight:600,lineHeight:1.4},h4:{fontSize:"18px",fontWeight:600,lineHeight:1.35,letterSpacing:"-0.005em"},h5:{fontSize:"15px",fontWeight:500,lineHeight:1.4},h6:{fontSize:"13px",fontWeight:500,lineHeight:1.5},body1:{fontSize:"14px",fontWeight:400,lineHeight:1.6,letterSpacing:"0.01em"},body2:{fontSize:"13px",fontWeight:400,lineHeight:1.6,letterSpacing:"0.01em"},subtitle1:{fontSize:"14px",fontWeight:500,lineHeight:1.5},subtitle2:{fontSize:"13px",fontWeight:500,lineHeight:1.5},caption:{fontSize:"12px",fontWeight:400,lineHeight:1.5,letterSpacing:"0.02em"},overline:{fontSize:"11px",fontWeight:500,lineHeight:1.5,letterSpacing:"0.08em",textTransform:"uppercase"},button:{fontSize:"14px",fontWeight:500,lineHeight:1.2,letterSpacing:"0.01em"},allVariants:{fontFamily:'"Inter", sans-serif'}},shape:{borderRadius:6},spacing:8})}const vt=({hasError:e,sx:t,labelText:r,labelVariant:n="subtitle2",endAdornment:i,endorsementText:a,endorsementBg:o="#E6E8EC",endorsementColor:s="#111827",endorsementRadius:c="6px",endorsementHeight:p=28,endorsementPaddingX:f="8px",...d})=>{var C,v;const u=Pn(),x=!!r,k=a?l.jsx(g.Box,{component:"span",sx:{display:"inline-flex",flex:"0 0 auto",width:"auto",maxWidth:"100%",alignItems:"center",height:p,paddingLeft:f,paddingRight:f,borderRadius:c,backgroundColor:o,color:s,fontSize:12,fontWeight:300,lineHeight:1,whiteSpace:"nowrap"},children:a}):null,m={...d.InputProps,endAdornment:k||i?l.jsxs(g.InputAdornment,{sx:{mr:-1},position:"end",children:[k||i,(C=d.InputProps)==null?void 0:C.endAdornment]}):(v=d.InputProps)==null?void 0:v.endAdornment};return l.jsxs(g.Box,{children:[x&&l.jsx(g.Typography,{variant:n,sx:{color:u.textPrimary,mb:.5,fontWeight:500},children:r}),l.jsx(g.TextField,{fullWidth:!0,size:"small",...d,InputProps:m,label:x?void 0:d.label,sx:{"& .MuiOutlinedInput-root":{backgroundColor:u.paper,borderRadius:"8px","& fieldset":{borderColor:u.outlineDefault},"&:hover fieldset":{borderColor:u.outlineHover},"&.Mui-focused fieldset":{borderColor:u.outlineFocus},"&.Mui-error fieldset":{borderColor:u.errorMain}},"& .MuiInputBase-input":{color:u.textPrimary},"& .MuiFormLabel-root":{color:u.textSecondary},"& .MuiFormLabel-root.Mui-focused":{color:u.textPrimary},"& .MuiFormHelperText-root":{color:e?u.errorMain:u.textSecondary},...t}})]})},Di=({labelText:e,label:t,options:r,loading:n,helperText:i,size:a="small",labelVariant:o="subtitle2",placeholder:s,value:c,sx:p,...f})=>{const d=Pn(),u=P.useId(),x=c==null||c===""||Array.isArray(c)&&c.length===0,k=m=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...m,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:d.textSecondary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});return l.jsxs(g.FormControl,{fullWidth:!0,size:a,error:!!f.error,variant:"outlined",children:[e&&l.jsx(g.Typography,{variant:o,sx:{color:d.textPrimary,mb:.5,fontWeight:500},children:e}),t&&l.jsx(g.InputLabel,{id:u,shrink:!x||!!s,sx:{color:d.textSecondary,"&.Mui-focused":{color:d.textPrimary},"&.Mui-error":{color:d.errorMain}},children:t}),l.jsx(g.Select,{...f,value:c,labelId:t?u:void 0,label:t,displayEmpty:!0,input:l.jsx(g.OutlinedInput,{label:t}),IconComponent:k,renderValue:m=>{const C=m;if(x)return l.jsx("span",{style:{color:d.textSecondary},children:s??""});const v=r.find(w=>w.value===C);return(v==null?void 0:v.label)??String(C)},endAdornment:n?l.jsx(g.CircularProgress,{size:20}):void 0,MenuProps:{PaperProps:{sx:{boxShadow:"0px 0px 10px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${d.divider}`,mt:.5,borderRadius:"8px"}}},sx:{backgroundColor:d.paper,boxShadow:"none",borderRadius:"8px",height:"40px","& .MuiSelect-select":{color:d.textPrimary,fontSize:14,pr:3},"& .MuiOutlinedInput-notchedOutline":{borderColor:d.outlineDefault},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:d.outlineHover},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:d.outlineFocus},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:d.errorMain},"& svg":{right:8,position:"absolute",pointerEvents:"none"},...p},children:n?l.jsx(g.MenuItem,{disabled:!0,children:l.jsx(g.CircularProgress,{size:16})}):r.map(m=>l.jsx(g.MenuItem,{value:m.value,sx:{backgroundColor:d.paper,color:d.textPrimary,fontSize:14,mx:1,"&:hover":{backgroundColor:d.neutral50,borderRadius:"4px"},"&.Mui-selected":{backgroundColor:d.neutral50,borderRadius:"4px"}},children:m.label},m.value))}),i&&l.jsx(g.FormHelperText,{children:i})]})},pc=({id:e,options:t,value:r,multiple:n,label:i,labelText:a,placeholder:o,onChange:s,labelVariant:c="subtitle2",disabled:p,loading:f,error:d,helperText:u,onOpen:x,noOptionsText:k,sx:m})=>{const C=Pn(),v=w=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...w,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:C.textSecondary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});return l.jsxs(g.Box,{children:[a&&l.jsx(g.Typography,{variant:c,sx:{color:C.textPrimary,mb:.5,fontWeight:500},children:a}),l.jsx(g.Autocomplete,{id:e,options:t,value:r,multiple:n,size:"small",popupIcon:l.jsx(v,{}),disabled:p,loading:f,onOpen:x,noOptionsText:k,fullWidth:!0,componentsProps:{paper:{sx:{boxShadow:"0px 0px 10px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${C.divider}`,mt:.5,borderRadius:"8px"}}},sx:{"& .MuiOutlinedInput-root":{backgroundColor:C.paper,borderRadius:"8px",height:"40px","& fieldset":{borderColor:C.outlineDefault},"&:hover fieldset":{borderColor:C.outlineHover},"&.Mui-focused fieldset":{borderColor:C.outlineFocus},"&.Mui-error fieldset":{borderColor:C.errorMain}},"& .MuiInputBase-input":{color:C.textPrimary,fontSize:14},"& .MuiAutocomplete-popupIndicator":{color:C.textSecondary},"& .MuiAutocomplete-endAdornment svg":{width:16,height:16},...m},getOptionLabel:w=>typeof w=="string"?w:(w==null?void 0:w.label)??"",isOptionEqualToValue:(w,$)=>((w==null?void 0:w.value)??w)===(($==null?void 0:$.value)??$),renderOption:(w,$,{selected:F})=>{const{key:E,..._}=w;return l.jsxs(g.Box,{component:"li",..._,sx:{backgroundColor:C.paper,color:C.textPrimary,mx:.5,borderRadius:"4px","&:hover":{backgroundColor:C.neutral50},"&.Mui-focused":{backgroundColor:C.neutral50},...F?{backgroundColor:C.neutral50}:{}},children:[n&&l.jsx(g.Checkbox,{checked:F}),l.jsx(g.Typography,{variant:"body2",sx:{color:C.textPrimary,fontSize:14},children:typeof $=="string"?$:$.label})]},E)},renderInput:w=>l.jsx(g.TextField,{...w,label:i,placeholder:o,size:"small",error:d,helperText:u,InputLabelProps:{shrink:!!r||!!o,sx:{color:C.textSecondary,"&.Mui-focused":{color:C.textPrimary},"&.Mui-error":{color:C.errorMain}}},InputProps:{...w.InputProps,endAdornment:l.jsxs(l.Fragment,{children:[f?l.jsx(g.CircularProgress,{size:20}):null,w.InputProps.endAdornment]})}}),onChange:(w,$)=>s($)})]})},Ut=({label:e,checked:t,disabled:r,onChange:n,sx:i})=>l.jsx(g.FormControlLabel,{control:l.jsx(g.Checkbox,{size:"small",checked:t,disabled:r,onChange:(a,o)=>n(o)}),label:e,sx:a=>({"& .MuiFormControlLabel-label":{color:a.palette.text.primary,fontSize:14},...i})}),dc=({labelText:e,label:t,value:r=[],options:n,row:i=!1,onChange:a,labelPosition:o="top",labelVariant:s="subtitle2",helperText:c,error:p,groupPadding:f=1.5,itemGap:d=1,disabled:u=!1})=>{const x=typeof i=="number"&&i>0,k=x?i:12,m=i===!0,C=i===!1&&!x,v=(w,$)=>{const F=Array.isArray(r)?[...r]:[];$?F.includes(w)||a([...F,w]):a(F.filter(E=>E!==w))};return l.jsxs(g.FormControl,{error:p,disabled:u,sx:w=>{var $;return{display:"flex",flexDirection:"column",px:w.spacing(f),borderRadius:(($=w.shape)==null?void 0:$.borderRadius)||8,mx:-2.5,backgroundColor:w.palette.background.paper}},children:[o==="top"&&e&&l.jsx(g.Typography,{variant:s,sx:w=>({color:w.palette.text.primary,mb:.5,fontSize:w.typography.fontSize,fontWeight:500}),children:e}),t&&l.jsx(g.FormLabel,{sx:w=>({color:w.palette.text.secondary,mb:.5,mx:1,fontSize:w.typography.fontSize||12,fontWeight:500,"&.Mui-focused":{color:w.palette.text.primary},"&.Mui-error":{color:w.palette.error.main}}),children:t}),x&&l.jsx(g.Box,{sx:w=>({display:"grid",gridTemplateColumns:`repeat(${k}, 1fr)`,gap:w.spacing(d),mt:0}),children:n.map(w=>{const $=Array.isArray(r)&&r.includes(w.value);return l.jsx(g.FormControlLabel,{control:l.jsx(g.Checkbox,{size:"small",checked:$,onChange:F=>v(w.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:w.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(w.value))})}),m&&l.jsx(g.Box,{sx:w=>({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:w.spacing(d),alignItems:"center",mt:0}),children:n.map(w=>{const $=Array.isArray(r)&&r.includes(w.value);return l.jsx(g.FormControlLabel,{control:l.jsx(g.Checkbox,{size:"small",checked:$,onChange:F=>v(w.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:w.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(w.value))})}),C&&l.jsx(g.Box,{sx:w=>({display:"flex",flexDirection:"column",gap:w.spacing(d),alignItems:"flex-start",mt:0}),children:n.map(w=>{const $=Array.isArray(r)&&r.includes(w.value);return l.jsx(g.FormControlLabel,{control:l.jsx(g.Checkbox,{size:"small",checked:$,onChange:F=>v(w.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:w.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(w.value))})}),c&&l.jsx(g.FormHelperText,{sx:{mt:.5},children:c})]})},fi=({label:e,checked:t,disabled:r,onChange:n,sx:i})=>l.jsx(g.FormControlLabel,{control:l.jsx(g.Switch,{checked:t,disabled:r,onChange:(a,o)=>n(o)}),label:e,sx:a=>({"& .MuiFormControlLabel-label":{color:a.palette.text.primary,fontSize:14},...i})}),wr=({labelText:e,label:t,value:r,options:n,row:i=!1,onChange:a,labelPosition:o="top",labelVariant:s="subtitle2",helperText:c,error:p,groupPadding:f=1.5,itemGap:d=1})=>l.jsxs(g.FormControl,{error:p,sx:u=>{var x;return{display:"flex",flexDirection:"column",px:u.spacing(f),borderRadius:((x=u.shape)==null?void 0:x.borderRadius)||8,mx:-2.5,backgroundColor:u.palette.background.paper}},children:[o==="top"&&e&&l.jsx(g.Typography,{variant:s,sx:u=>({color:u.palette.text.primary,mb:.5,fontSize:u.typography.fontSize,fontWeight:500}),children:e}),t&&l.jsx(g.FormLabel,{sx:u=>({color:u.palette.text.secondary,mb:.5,mx:1,fontSize:u.typography.fontSize||12,fontWeight:500,"&.Mui-focused":{color:u.palette.text.primary},"&.Mui-error":{color:u.palette.error.main}}),children:t}),l.jsx(g.RadioGroup,{row:i,value:r,onChange:u=>a(u.target.value),sx:u=>({display:"flex",flexDirection:i?"row":"column",gap:u.spacing(d),alignItems:i?"center":"flex-start"}),children:n.map(u=>l.jsx(g.FormControlLabel,{value:u.value,control:l.jsx(g.Radio,{size:"small",sx:x=>({color:x.palette.text.secondary,"&.Mui-checked":{color:x.palette.primary.main}})}),label:l.jsxs(g.Box,{sx:{display:"flex",flexDirection:"column",gap:0},children:[l.jsx(g.Typography,{variant:"body2",sx:{color:"#1a1a1a",fontSize:12,fontWeight:400,lineHeight:1.5},children:u.label}),u.description&&l.jsx(g.Typography,{variant:"caption",sx:{color:"#1a1a1a",fontSize:10,fontWeight:300,lineHeight:1.5},children:u.description})]}),sx:{m:0,gap:0,"& .MuiFormControlLabel-label":{marginLeft:0},"& .MuiRadio-root":{alignSelf:"flex-start",marginTop:0}}},String(u.value)))}),c&&l.jsx(g.FormHelperText,{sx:{mt:.5},children:c})]}),po=({labelPosition:e="inner",labelVariant:t="subtitle2",label:r,sx:n,...i})=>l.jsxs(g.Box,{children:[e==="top"&&r&&l.jsx(g.Typography,{variant:t,sx:{color:"#111827",mb:.5},children:r}),l.jsx(g.TextField,{fullWidth:!0,type:"date",size:"small",label:e==="inner"?r:void 0,InputLabelProps:{shrink:!0},...i,sx:{"& .MuiOutlinedInput-root":{backgroundColor:"#FFFFFF",borderRadius:"8px","& fieldset":{borderColor:"#E5E7EB"},"&:hover fieldset":{borderColor:"#D1D5DB"},"&.Mui-focused fieldset":{borderColor:"#D1D5DB"},"&.Mui-error fieldset":{borderColor:"#E53935"}},"& .MuiInputBase-input":{color:"#111827",fontSize:14},...n}})]}),fc=({labelText:e,labelVariant:t="subtitle2",hasError:r,sx:n,label:i,...a})=>{const o=Pn(),s=!!e;return l.jsxs(g.Box,{children:[s&&l.jsx(g.Typography,{variant:t,sx:{color:o.textPrimary,mb:.5,fontWeight:500},children:e}),l.jsx(g.TextField,{fullWidth:!0,multiline:!0,minRows:3,size:"small",...a,label:s?void 0:i,sx:{"& .MuiOutlinedInput-root":{backgroundColor:o.paper,borderRadius:"8px","& fieldset":{borderColor:o.outlineDefault},"&:hover fieldset":{borderColor:o.outlineHover},"&.Mui-focused fieldset":{borderColor:o.outlineFocus},"&.Mui-error fieldset":{borderColor:o.errorMain}},"& .MuiInputBase-input":{color:o.textPrimary,fontSize:14},"& .MuiFormLabel-root":{color:o.textSecondary},"& .MuiFormLabel-root.Mui-focused":{color:o.textPrimary},"& .MuiFormHelperText-root":{color:r?o.errorMain:o.textSecondary},...n}})]})},hc=({title:e,subtitle:t,actions:r,align:n="left",sx:i})=>l.jsxs(g.Box,{sx:a=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:a.spacing(1),py:a.spacing(1),...i}),children:[l.jsxs(g.Box,{sx:{display:"flex",flexDirection:"column",minWidth:0,flex:1,textAlign:n},children:[e&&l.jsx(g.Typography,{variant:"h6",sx:a=>({color:a.palette.text.primary,fontSize:16,fontWeight:500,lineHeight:1.3}),children:e}),t&&l.jsx(g.Typography,{variant:"body2",sx:a=>({color:a.palette.text.secondary,mt:e?.5:0,fontSize:12,fontWeight:500}),children:t})]}),r&&l.jsx(g.Box,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:r})]}),yn=ut(l.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),mc=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("g",{"clip-path":"url(#clip0_5814_24904)",children:l.jsx("path",{d:"M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z",fill:"#056739","fill-opacity":"0.5"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_5814_24904",children:l.jsx("rect",{width:"24",height:"24",fill:"white"})})})]});function gc({items:e,getId:t,onReorder:r,header:n,disabled:i,sx:a,getText:o,showIndex:s=!0,showLeftIcon:c=!0,renderItem:p,chipText:f,helperText:d,emptyStateText:u,emptyStateButtonText:x="Add Phase",onEmptyStateButtonClick:k,emptyStateSx:m}){const[C,v]=P.useState(null),[w,$]=P.useState(null),F=h=>B=>{if(!i){v(h),B.dataTransfer.effectAllowed="move";try{B.dataTransfer.setData("text/plain",String(t(e[h])))}catch{}}},E=h=>B=>{i||(B.preventDefault(),$(h),B.dataTransfer.dropEffect="move")},_=h=>B=>{if(i)return;if(B.preventDefault(),C===null||C===h){v(null),$(null);return}const q=[...e],[Z]=q.splice(C,1);q.splice(h,0,Z),v(null),$(null),r(q)},I=()=>{v(null),$(null)},R=e.length===0,Y=R&&(u||k!==void 0);return l.jsxs(g.Box,{role:"list",sx:h=>({display:"flex",flexDirection:"column",gap:h.spacing(1),...a}),children:[n,!R&&l.jsx(g.Divider,{sx:{mt:-.5,mb:1,dividerColor:"#EBEBEB"}}),Y?l.jsxs(g.Box,{sx:h=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",padding:h.spacing(4),backgroundColor:h.palette.mode==="dark"?"#000000":ye.background.paper,border:`2px dashed ${h.palette.mode==="dark"?"#FFFFFF":ye.divider}`,borderRadius:"8px",textAlign:"center",...m}),children:[u&&l.jsx(g.Typography,{variant:"body1",sx:h=>({color:h.palette.text.secondary,fontSize:"14px",fontWeight:400,lineHeight:1.5,mb:k?2:0,maxWidth:"400px"}),children:u}),k&&l.jsx(g.Button,{variant:"outlined",startIcon:l.jsx(yn,{}),onClick:k,disabled:i,sx:h=>({mt:u?0:2,backgroundColor:h.palette.mode==="dark"?`${h.palette.primary.main}1A`:`${h.palette.primary.main}0D`,borderColor:h.palette.primary.main,color:h.palette.primary.main,"&:hover":{backgroundColor:h.palette.mode==="dark"?`${h.palette.primary.main}33`:`${h.palette.primary.main}1A`,borderColor:h.palette.primary.main},borderRadius:"6px",textTransform:"none",fontSize:"14px",fontWeight:500,px:2,py:1}),children:x})]}):e.map((h,B)=>{const q=C===B,Z=w===B&&C!==null&&C!==B;return l.jsx(g.Box,{role:"listitem",draggable:!i,onDragStart:F(B),onDragOver:E(B),onDrop:_(B),onDragEnd:I,sx:L=>({userSelect:"none",cursor:i?"default":"grab",backgroundColor:"#F8F8FA",border:`1px solid ${Z?L.palette.primary.main:"#EBEBEB"}`,borderRadius:"8px",padding:L.spacing(1),opacity:q?.6:1,boxShadow:Z?`0 0 0 2px ${L.palette.primary.main}33`:"none"}),children:p?p(h,q):l.jsxs(g.Box,{sx:L=>({display:"flex",alignItems:"center",gap:L.spacing(1),minWidth:0}),children:[c&&l.jsx(mc,{}),s&&l.jsxs(g.Typography,{variant:"body2",sx:L=>({fontWeight:600,fontSize:14,color:`${L.palette.text.primary}`,flex:"0 0 auto"}),children:[B+1,"."]}),(()=>{const L=typeof f=="function"?f(h,B):f;return L?l.jsx(g.Chip,{label:L,sx:{borderRadius:"4px",p:"12px 3px"},size:"small"}):null})(),l.jsx(g.Typography,{variant:"body2",sx:L=>({fontSize:12,fontWeight:500,color:`${L.palette.text.primary}90`,flex:1,minWidth:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),children:o?o(h):""})]})},String(t(h)))}),!R&&d?typeof d=="string"?l.jsx(g.Typography,{variant:"caption",sx:h=>({color:`${h.palette.text.primary}60`}),children:d}):d:null]})}const Gh=yt(g.StepConnector)(({theme:e})=>{const t=e.palette.divider||"#E8E8E8",r=e.palette.primary.main;return{[`&.${g.stepConnectorClasses.vertical}`]:{marginLeft:11},[`& .${g.stepConnectorClasses.line}`]:{minHeight:28,borderLeftWidth:2,borderColor:t,transition:"border-color 0.3s ease"},[`&.${g.stepConnectorClasses.completed} .${g.stepConnectorClasses.line}`]:{borderColor:r}}}),Qh=({items:e,activeIndex:t=1,onStepClick:r,sx:n,completedSteps:i})=>{const a=tc(),o=a.palette.primary.main,s=a.palette.text.primary,c=a.palette.divider,p=a.palette.action&&a.palette.action.disabledBackground||"#E8E8E8",f=d=>{const{active:u,completed:x,icon:k}=d;return x?l.jsx(g.Box,{sx:{width:24,height:24,border:`1.2px solid ${o}`,borderRadius:"50%",backgroundColor:o,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(uo,{sx:{fontSize:16,fontWeight:600}})}):u?l.jsx(g.Box,{sx:{width:24,height:24,borderRadius:"50%",border:`1.2px solid ${o}`,backgroundColor:mt(o,.2),color:o,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12},children:k}):l.jsx(g.Box,{sx:{width:24,height:24,borderRadius:"50%",backgroundColor:p,color:s,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12},children:k})};return l.jsx(g.Stepper,{orientation:"vertical",activeStep:t,connector:l.jsx(Gh,{}),sx:{"& .MuiStepConnector-vertical":{my:-1.1},"& .MuiStepLabel-label":{fontSize:14,color:s,fontWeight:500},"& .MuiStep-root":{cursor:r?"pointer":"default"},...n},children:e.map((d,u)=>{const x=Array.isArray(i)&&i.length>0?i.includes(u):u<t;return l.jsxs(g.Step,{onClick:()=>r==null?void 0:r(u),completed:x,children:[l.jsx(g.StepLabel,{StepIconComponent:f,children:l.jsx(g.Typography,{sx:{fontSize:12,fontWeight:500,color:u===t?o:s},children:d.label})}),u!==e.length-1&&l.jsx(g.Divider,{sx:{ml:4.2,borderColor:c}})]},u)})})},fo=({colorKey:e="primary",colorHex:t,tone:r="soft",bgAlpha:n=.12,borderAlpha:i=.24,sx:a,...o})=>l.jsx(g.Chip,{...o,sx:s=>({fontWeight:600,borderRadius:"4px",height:18,border:`0.5px solid ${mt(t||s.palette.text.primary,.5)}`,backgroundColor:mt(t||s.palette.text.primary,.1),"& .MuiChip-label":{p:"8px",color:t||s.palette.text.primary,fontSize:10,fontWeight:500},...a})}),Zh=yt(g.StepConnector)(()=>({[`&.${g.stepConnectorClasses.vertical}`]:{marginLeft:11},[`& .${g.stepConnectorClasses.line}`]:{minHeight:28,borderLeftWidth:2,height:"70px",borderColor:"#E8E8E8",transition:"border-color 0.3s ease",zIndex:-1},[`&.${g.stepConnectorClasses.completed} .${g.stepConnectorClasses.line}`]:{borderColor:ye.primary.main}})),Xh=({items:e,activeIndex:t=1,onStepClick:r,sx:n})=>{const[i,a]=P.useState(null),o=s=>{const{active:c,completed:p,icon:f}=s;return p?l.jsx(g.Box,{sx:{width:24,height:24,border:`1.2px solid ${ye.primary.main}`,borderRadius:"50%",backgroundColor:ye.primary.main,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:l.jsx(uo,{sx:{fontSize:16,fontWeight:600}})}):c?l.jsx(g.Box,{sx:{width:24,height:24,borderRadius:"50%",border:`1.2px solid ${ye.primary.main}`,backgroundColor:mt(ye.primary.main,.2),color:ye.primary.main,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12,zIndex:1e3,overflow:"hidden"},children:f}):l.jsx(g.Box,{sx:{width:24,height:24,borderRadius:"50%",backgroundColor:"#E8E8E8",color:ye.text.primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12,zIndex:1e3},children:f})};return l.jsx(g.Stepper,{orientation:"vertical",activeStep:t,connector:l.jsx(Zh,{}),sx:{"& .MuiStepConnector-vertical":{my:-3.5},"& .MuiStepLabel-label":{fontSize:14,color:ye.text.primary,fontWeight:500},"& .MuiStep-root":{cursor:r?"pointer":"default"},...n},children:e.map((s,c)=>l.jsxs(g.Step,{onMouseEnter:()=>a(c),onMouseLeave:()=>a(null),onClick:()=>r==null?void 0:r(c),completed:c<t,children:[l.jsxs(g.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[l.jsxs(g.StepLabel,{StepIconComponent:o,children:[l.jsxs(g.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[l.jsx(g.Typography,{sx:{fontSize:14,fontWeight:500,color:c===t?ye.primary.main:ye.text.primary},children:s.label}),l.jsx(fo,{size:"small",colorHex:c<t?ye.success.main:c===t?"#973B00":ye.text.primary,label:c<t?"Completed":c===t?"In progress":"Not started"})]}),l.jsx(g.Typography,{sx:{fontSize:12,fontWeight:400,color:`${ye.text.primary}60`,mt:.5,width:"80%"},children:s.description})]}),i===c&&l.jsx(g.Button,{sx:{display:c>t?"none":"block"},variant:c<t?"outlined":"contained",size:"small",color:"primary",children:c<t?"Edit":c===t?"Complete":""})]}),c!==e.length-1&&l.jsx(g.Divider,{sx:{ml:4.2,borderColor:ye.divider}})]},c))})},Jh=ut(l.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined"),em=({variant:e="list",title:t,subtitle:r,text:n,items:i=[],icon:a,colorHex:o,sx:s})=>{const c=o||ye.info.main,p=mt(c,.08),f=mt(c,.08),d=a??l.jsx(Jh,{sx:{color:c,fontSize:18}});return e==="inlineInfo"?l.jsxs(g.Card,{sx:{p:1.5,display:"flex",alignItems:"center",gap:1,backgroundColor:p,border:`1px solid ${f}`,boxShadow:"none",...s},children:[l.jsx(g.Box,{sx:{display:"flex",alignItems:"center"},children:d}),l.jsx(g.Typography,{variant:"body2",sx:{fontWeight:400,fontSize:12,lineHeight:1.3,color:c},children:n})]}):e==="inline"?l.jsx(g.Card,{sx:{p:1.5,display:"flex",alignItems:"center",gap:1,backgroundColor:p,border:`1px solid ${f}`,boxShadow:"none",...s},children:l.jsx(g.Typography,{variant:"body2",sx:{fontWeight:400,fontSize:12,lineHeight:1.3,color:c},children:n})}):e==="listWithHeader"?l.jsxs(g.Card,{sx:{p:2,boxShadow:"none",borderRadius:"6px",backgroundColor:p,border:`1px solid ${f}`,...s},children:[l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d,l.jsx(g.Typography,{variant:"subtitle2",sx:{fontWeight:600,color:c,fontSize:14,lineHeight:1.3},children:t})]}),r&&l.jsx(g.Typography,{variant:"body2",sx:{mt:.5,color:c,fontSize:10,lineHeight:1.3},children:r}),l.jsx(g.List,{sx:{pl:5,"& .MuiListItem-root":{display:"list-item",listStyleType:"disc",color:c},"& .MuiListItemText-primary":{fontSize:"12px",fontWeight:400,lineHeight:"18px",color:c,my:-.5}},children:i.map((u,x)=>l.jsx(g.ListItem,{sx:{py:0},children:l.jsx(g.ListItemText,{primary:u})},x))})]}):l.jsx(g.Card,{sx:{p:"11px",borderRadius:"8px",backgroundColor:p,border:`0.5px solid ${f}`,boxShadow:"none",...s},children:l.jsx(g.List,{sx:{pl:4,"& .MuiListItem-root":{display:"list-item",listStyleType:"disc",color:c},"& .MuiListItemText-primary":{fontSize:"12px",fontWeight:600,lineHeight:"18px",color:c,my:-.5}},children:i.map((u,x)=>l.jsx(g.ListItem,{sx:{py:0},children:l.jsx(g.ListItemText,{primary:u})},x))})})},yc=({value:e,onChange:t,items:r,ariaLabel:n,sx:i,tabSx:a})=>l.jsxs(g.Box,{children:[l.jsx(g.Tabs,{value:e,onChange:(o,s)=>t(s),"aria-label":n||"Fin tabs",sx:{alignItems:"center",borderRadius:"6px",p:"8px 10px",backgroundColor:"#F2F2F2","& .MuiTabs-flexContainer":{gap:1},"& .MuiTabs-indicator":{display:"none"},...i},children:r.map((o,s)=>{const c=typeof o.value=="string"||typeof o.value=="number"?o.value:s;return l.jsx(g.Tab,{value:c,disabled:o.disabled,label:l.jsx(g.Typography,{variant:"body2",children:o.label}),sx:p=>({px:2,textTransform:"none",color:p.palette.primary.main,boxShadow:"none",borderRadius:"3px",border:"0.5px solid #0000001A",backgroundColor:"#E8E8E8","&:hover":{backgroundColor:p.palette.action.hover},"&.Mui-selected":{color:p.palette.common.white,borderColor:p.palette.primary.main,backgroundColor:p.palette.primary.main,fontWeight:600},...a})},String(c))})}),r.map((o,s)=>{const c=typeof o.value=="string"||typeof o.value=="number"?o.value:s,p=o.content??(typeof o.value=="object"?o.value:null);return p&&e===c?l.jsx(g.Box,{sx:{mt:1},children:p},`panel-${c}`):null})]}),tm=ut(l.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline"),xc=({name:e,columns:t,initialRow:r,addLabel:n,maxRows:i,hideAddWhenMax:a,disableAddWhenMax:o=!0,showEmptyState:s=!0,rowDeletable:c=!0,control:p,sx:f,addActions:d,emptyTitle:u="No items configured",emptySubtitle:x="Click 'Add' to get started.",emptyCardSx:k,setValue:m,rowSelectionMode:C,rowSelectionKey:v})=>{const{fields:w,append:$,remove:F}=wu({control:p,name:e}),_=!(typeof i=="number"?w.length>=i:!1),I=P.useMemo(()=>{if(v)return v;const H=t.find(G=>G.type==="rowSelect");return H==null?void 0:H.key},[t,v]),R=ml({control:p,name:e})||[],Y=P.useMemo(()=>{if(!I)return{};const H={};return R.forEach((G,re)=>{H[re]=!!(G!=null&&G[I])}),H},[R,I]),h=P.useCallback(H=>Y[H]===!0,[Y]),B=P.useCallback((H,G)=>{if(!m||!I)return;const re=`${e}.${H}.${I}`;C==="single"&&G&&R.forEach((ce,D)=>{if(D!==H){const U=`${e}.${D}.${I}`;m(U,!1,{shouldDirty:!0})}}),m(re,G,{shouldDirty:!0})},[e,I,C,m,R]),q=H=>{const G={...H||r};t.forEach(re=>{re.value!==void 0&&G[re.key]===void 0&&(G[re.key]=typeof re.value=="function"?re.value(G,w.length):re.value)}),$(G)};P.useEffect(()=>{!s&&w.length===0&&_&&q()},[s,w.length,_]);const Z=P.useMemo(()=>t.reduce((G,re)=>{if(re.width==="auto"||re.width===void 0)return G+120;const ce=typeof re.width=="number"?re.width:typeof re.width=="string"&&parseInt(re.width)||160;return G+ce},0)+(c?100:0),[t,c]),L=H=>H.width==="auto"||H.width===void 0?{width:"auto",minWidth:120,maxWidth:"none"}:typeof H.width=="number"?{width:`${H.width}px`,minWidth:`${H.width}px`,maxWidth:`${H.width}px`}:typeof H.width=="string"?{width:H.width,minWidth:H.width}:{width:"160px",minWidth:"160px"};return l.jsx(g.Card,{sx:{width:"100%",borderRadius:"4px",boxShadow:"0px 0.783px 3.131px 0px rgba(0,0,0,0.16)",backgroundColor:"#FFFFFF",overflow:"visible",...f},children:w.length===0&&s?l.jsxs(g.Box,{sx:H=>({p:4,textAlign:"center",borderStyle:"dashed",borderColor:mt(H.palette.primary.main,.4),backgroundColor:mt(H.palette.primary.main,.04),borderWidth:1,borderRadius:"8px",...k}),children:[l.jsx(g.Typography,{variant:"subtitle1",sx:H=>({color:H.palette.primary.main,fontWeight:600,mb:.5,fontSize:14}),children:u}),l.jsx(g.Typography,{variant:"body2",sx:H=>({color:H.palette.primary.main,mb:2,fontSize:12,fontWeight:400}),children:x}),Array.isArray(d)&&d.length>0?d.map((H,G)=>l.jsx(g.Button,{variant:"outlined",size:"small",startIcon:l.jsx(yn,{}),sx:{mr:1,mt:1},onClick:()=>q(H.template),disabled:!_&&o,style:{display:!_&&a?"none":void 0},children:H.label},`empty-add-${G}`)):n&&l.jsx(g.Button,{variant:"outlined",size:"small",startIcon:l.jsx(yn,{}),onClick:()=>q(),disabled:!_&&o,style:{display:!_&&a?"none":void 0},children:n})]}):l.jsxs(l.Fragment,{children:[l.jsx(g.Box,{sx:{height:"45px",display:"flex",alignItems:"center",px:1.125,gap:1,py:1.25,borderBottom:"1px solid #E5E6EB"},children:Array.isArray(d)&&d.length>0?d.map((H,G)=>l.jsx(g.Button,{variant:G===0?"contained":"outlined",size:"small",startIcon:l.jsx(yn,{}),onClick:()=>q(H.template),sx:{borderRadius:"3px",fontSize:"10.938px",fontWeight:500,textTransform:"none",px:1.17,py:.586,minWidth:"90px","&:hover":{backgroundColor:G===0?"#04502d":void 0}},disabled:!_&&o,style:{display:!_&&a?"none":void 0},children:H.label},`add-${G}`)):n&&l.jsx(g.Button,{variant:"contained",size:"small",startIcon:l.jsx(yn,{}),onClick:()=>q(),sx:{backgroundColor:"#056739",color:"#FFFFFF",borderRadius:"3px",fontSize:"10.938px",fontWeight:500,textTransform:"none",px:1.17,py:.586,minWidth:"90px","&:hover":{backgroundColor:"#04502d"}},disabled:!_&&o,style:{display:!_&&a?"none":void 0},children:n})}),l.jsx(g.Box,{sx:{width:"100%",overflowX:"auto",overflowY:"auto",maxHeight:"600px","&::-webkit-scrollbar":{height:"8px",width:"8px"},"&::-webkit-scrollbar-track":{backgroundColor:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#888",borderRadius:"4px","&:hover":{backgroundColor:"#555"}}},children:l.jsx(g.TableContainer,{sx:{width:"100%",minWidth:"100%"},children:l.jsxs(g.Table,{stickyHeader:!0,sx:{minWidth:`${Z||650}px`},children:[l.jsx(g.TableHead,{children:l.jsxs(g.TableRow,{children:[t.map(H=>l.jsx(g.TableCell,{sx:{backgroundColor:"#F2F3F5",borderBottom:"1.756px solid #E5E6EB",fontWeight:500,fontSize:"12px",color:"#6B7785",whiteSpace:"nowrap",height:"43px",px:1.75,py:0,...L(H)},children:H.header},H.key)),c&&l.jsx(g.TableCell,{sx:{backgroundColor:"#F2F3F5",borderBottom:"1.756px solid #E5E6EB",fontWeight:500,fontSize:"12px",color:"#6B7785",whiteSpace:"nowrap",height:"43px",px:1.75,py:0,width:100,textAlign:"center"},children:"Actions"})]})}),l.jsx(g.TableBody,{children:w.map((H,G)=>{const re=h(G),ce=C&&!re;return l.jsxs(g.TableRow,{children:[t.map(D=>{var pe;const U=`${e}.${G}.${D.key}`,X=D.type==="rowSelect"||D.key===I,ue=X?!1:ce?!0:typeof D.disabled=="function"?D.disabled(H,G):!!D.disabled;if(D.type==="index"){const te=D.indexFormat?D.indexFormat(G):`#${G+1}`;return l.jsx(g.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",textAlign:((pe=D.cellSx)==null?void 0:pe.textAlign)||"center",...L(D),...D.cellSx},children:te},D.key)}if(D.value!==void 0&&D.editable===!1){const te=typeof D.value=="function"?D.value(H,G):D.value;return l.jsx(g.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",...L(D),...D.cellSx},children:te},D.key)}const fe=D.endorsementText?typeof D.endorsementText=="function"?D.endorsementText(H,G):D.endorsementText:void 0;return l.jsx(g.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",...L(D),...D.cellSx},children:D.type==="rowSelect"||X&&D.type==="checkbox"?l.jsx(Re,{name:U,control:p,defaultValue:!1,render:({field:te})=>l.jsx(Ut,{label:"",checked:!!te.value,disabled:!1,onChange:W=>{te.onChange(W),B(G,W)},sx:D.sx})}):D.type==="checkbox"?l.jsx(Re,{name:U,control:p,render:({field:te})=>l.jsx(Ut,{label:"",checked:!!te.value,disabled:ue,onChange:te.onChange,sx:D.sx})}):D.type==="select"?l.jsx(Re,{name:U,control:p,render:({field:te})=>l.jsx(Di,{...te,fullWidth:!0,disabled:ue,options:D.options||[],size:"small",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...D.sx},helperText:D.helperText,required:D.required})}):D.type==="date"?l.jsx(Re,{name:U,control:p,defaultValue:D.value!==void 0?typeof D.value=="function"?D.value(H,G):D.value:void 0,render:({field:te})=>(P.useEffect(()=>{if(m&&(te.value===void 0||te.value===null||te.value==="")&&D.value!==void 0){const W=typeof D.value=="function"?D.value(H,G):D.value;m(U,W,{shouldValidate:!1})}},[U,te.value,D.value,H,G,m]),l.jsx(po,{...te,fullWidth:!0,disabled:ue,size:"small",placeholder:D.placeholder||"DD/MM/YYYY",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...D.sx},helperText:D.helperText,required:D.required}))}):l.jsx(Re,{name:U,control:p,defaultValue:D.value!==void 0?typeof D.value=="function"?D.value(H,G):D.value:void 0,render:({field:te})=>(P.useEffect(()=>{if(m&&(te.value===void 0||te.value===null||te.value==="")&&D.value!==void 0){const W=typeof D.value=="function"?D.value(H,G):D.value;m(U,W,{shouldValidate:!1})}},[U,te.value,D.value,H,G,m]),l.jsx(vt,{...te,fullWidth:!0,type:D.type==="number"?"number":"text",placeholder:D.placeholder,disabled:ue,size:"small",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...D.sx},helperText:D.helperText,required:D.required,endorsementText:fe,endorsementBg:D.endorsementBg,endorsementColor:D.endorsementColor,endorsementRadius:D.endorsementRadius,endorsementHeight:D.endorsementHeight,endorsementPaddingX:D.endorsementPaddingX,inputProps:{...D.type==="number"?{min:D.min,max:D.max,step:D.step}:{minLength:D.minLength,maxLength:D.maxLength,pattern:D.pattern}}}))})},D.key)}),c&&l.jsx(g.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",px:1.5,py:0,borderBottom:"1px solid #E5E6EB",textAlign:"center"},children:l.jsx(g.IconButton,{size:"small",color:"error",onClick:()=>F(G),sx:{width:"20px",height:"20px"},children:l.jsx(tm,{sx:{fontSize:"20px"}})})})]},H.id)})})]})})})]})})},vc=({name:e,control:t,items:r,sx:n,cardSx:i})=>l.jsx(g.Box,{sx:{display:"flex",flexDirection:"column",gap:1,...n},children:r.map(a=>{const o=!!a.leftAction,s=!!a.rightAction,c=!!(a.header||a.chipText),p=a.leftAction,f=a.rightAction;return l.jsxs(g.Box,{sx:{border:"1px solid #DDDDDD",borderRadius:"8px",height:"40px",display:"flex",alignItems:"center",justifyContent:"space-between",px:1,...i},children:[o&&p&&l.jsx(g.Box,{sx:{display:"flex",alignItems:"center",gap:1,flexShrink:0},children:l.jsx(Re,{name:p.name,control:t,defaultValue:!1,render:({field:d})=>l.jsx(Ut,{label:p.label||"",checked:!!d.value,onChange:d.onChange,sx:{margin:0}})})}),c&&l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:1,flex:o||s?1:"none",ml:o?1:0},children:[a.header&&l.jsx(g.Typography,{variant:"body2",sx:{fontSize:"12px",color:"rgba(0,0,0,0.87)",fontWeight:400},children:a.header}),a.chipText&&l.jsx(g.Box,{sx:{bgcolor:"rgba(26,26,26,0.1)",px:1.5,py:.375,borderRadius:"4px",fontSize:"12px",color:"rgba(26,26,26,0.8)"},children:a.chipText})]}),s&&f&&l.jsx(g.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexShrink:0,ml:"auto"},children:l.jsx(Re,{name:f.name,control:t,defaultValue:!1,render:({field:d})=>l.jsx(fi,{label:f.label,checked:!!d.value,onChange:d.onChange,sx:{margin:0}})})}),!o&&!s&&!c&&l.jsx(g.Box,{sx:{width:"100%",height:"100%"}})]},a.id)})}),bc=ut(l.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),na=ut(l.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),rm=[{label:"Interest-only",value:"interest-only"},{label:"Principal moratorium",value:"principal-moratorium"},{label:"EMI",value:"emi"},{label:"Equal-principal",value:"equal-principal"},{label:"Balloon",value:"balloon"},{label:"Bullet",value:"bullet"},{label:"Step-up/Down",value:"step-up-down"},{label:"Seasonal skips",value:"seasonal-skips"},{label:"Custom fixed installment",value:"custom-fixed"},{label:"Full payment holiday (no billing)",value:"payment-holiday"}],ia=[{label:"Accrue & capitalize at end of phase",value:"accrue-capitalize"},{label:"Accrue & bill in first period after phase",value:"accrue-bill-next"},{label:"Accrue & forgive at phase end",value:"accrue-forgive"}],nm=({phase:e,index:t,onUpdate:r,onDelete:n,months:i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],disabled:a=!1,sx:o})=>{const[s,c]=P.useState(e.seasonalMonths||[]),p=u=>{const x=s.includes(u)?s.filter(k=>k!==u):[...s,u];c(x),r(e.id,{seasonalMonths:x})},f=(()=>{const u=e.min||0;return u<0?"Min cannot be negative.":Number.isInteger(u)?null:"Use whole periods."})(),d=(()=>{const u=e.min||0,x=e.max||0;return Number.isInteger(x)?x<u?"Max must be ≥ Min.":null:"Use whole periods."})();return l.jsx(g.Card,{sx:{border:"2px solid",borderColor:ye.divider,position:"relative",...o},children:l.jsxs(g.CardContent,{sx:{p:2},children:[l.jsxs(g.Box,{sx:{mb:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs(g.Box,{sx:{display:"flex",gap:.5,alignItems:"center"},children:[l.jsx(g.Box,{children:l.jsx(mc,{})}),l.jsx(fo,{label:t+1,size:"small"})]}),l.jsx(g.IconButton,{onClick:()=>n(e.id),disabled:a,sx:{color:ye.error.main,"&:hover":{bgcolor:Qn[50]}},size:"small",children:l.jsx(bc,{fontSize:"small"})})]}),l.jsx(g.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:l.jsxs(g.Box,{sx:{flex:1,display:"grid",gap:1.5},children:[l.jsxs(g.Box,{sx:{display:"flex",gap:2,mb:.5},children:[l.jsx(g.Box,{sx:{flex:.5,display:"grid",gap:1},children:l.jsx(Di,{labelText:"Phase type",value:e.type,onChange:u=>r(e.id,{type:u.target.value}),options:rm,disabled:a})}),l.jsxs(g.Box,{sx:{display:"grid",gap:1,flex:.5},children:[l.jsx(g.Typography,{variant:"caption",sx:{fontSize:"12px",color:ye.text.secondary},children:"Allocation priority (1–9)"}),l.jsx(vt,{type:"number",value:e.priority||5,onChange:u=>{const x=parseInt(u.target.value)||5;r(e.id,{priority:Math.min(9,Math.max(1,x))})},inputProps:{min:1,max:9},disabled:a,sx:{textAlign:"center"}})]})]}),l.jsxs(g.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[l.jsx(g.Box,{sx:{display:"grid",gap:1},children:l.jsx(vt,{labelText:"Min periods",type:"number",value:e.min||0,onChange:u=>{const x=parseInt(u.target.value)||0;r(e.id,{min:x,...e.lockLength?{max:x}:{}})},inputProps:{min:0},disabled:a,error:!!f,helperText:f||void 0})}),l.jsx(g.Box,{sx:{display:"grid",gap:1},children:l.jsx(vt,{labelText:"Max periods",type:"number",value:e.lockLength?e.min:e.max||0,onChange:u=>r(e.id,{max:parseInt(u.target.value)||0}),inputProps:{min:0},disabled:a||e.lockLength,error:!!d&&!e.lockLength,helperText:e.lockLength?"Locked to Min":d||void 0,sx:e.lockLength?{opacity:.5}:{}})})]}),l.jsxs(g.Box,{sx:{display:"flex",gap:3},children:[l.jsx(Ut,{label:"Lock length (fix to Min)",checked:e.lockLength||!1,onChange:u=>r(e.id,{lockLength:u,...u?{max:e.min}:{}}),disabled:a}),l.jsx(Ut,{label:"Residual fill",checked:e.residualFill||!1,onChange:u=>r(e.id,{residualFill:u}),disabled:a})]}),e.type==="principal-moratorium"&&l.jsxs(g.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(g.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(g.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(na,{sx:{fontSize:14,color:ye.text.secondary,cursor:"help"}})})]}),l.jsx(wr,{value:e.interestPolicy||"accrue-capitalize",onChange:u=>r(e.id,{interestPolicy:u}),options:ia,labelPosition:"none"}),e.interestPolicy==="accrue-forgive"&&l.jsx(g.Typography,{variant:"caption",sx:{color:ye.text.secondary,mt:1},children:"Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."})]}),e.type==="balloon"&&l.jsxs(g.Box,{sx:{display:"grid",gap:1.5},children:[l.jsx(wr,{value:e.balloonType||"percent",onChange:u=>r(e.id,{balloonType:u}),options:[{label:"Amount",value:"amount"},{label:"Percent",value:"percent"}],row:!0,labelPosition:"none"}),e.balloonType==="amount"&&l.jsx(vt,{labelText:"Balloon Amount",type:"number",value:e.balloonAmount||"",onChange:u=>r(e.id,{balloonAmount:parseFloat(u.target.value)||0}),placeholder:"Enter amount",disabled:a}),e.balloonType==="percent"&&l.jsx(vt,{labelText:"Balloon Percent",type:"number",value:e.balloonPercent||"",onChange:u=>r(e.id,{balloonPercent:parseFloat(u.target.value)||0}),placeholder:"Enter percent",inputProps:{max:100},disabled:a})]}),e.type==="bullet"&&l.jsx(g.Typography,{variant:"caption",sx:{color:ye.text.secondary},children:"Principal at maturity"}),e.type==="step-up-down"&&l.jsxs(g.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[l.jsx(vt,{labelText:"Step Percent",type:"number",value:e.stepPercent||"",onChange:u=>r(e.id,{stepPercent:parseFloat(u.target.value)||0}),placeholder:"e.g., 10",disabled:a}),l.jsx(vt,{labelText:"Every N periods",type:"number",value:e.stepEveryN||"",onChange:u=>r(e.id,{stepEveryN:parseInt(u.target.value)||0}),placeholder:"e.g., 6",disabled:a})]}),e.type==="seasonal-skips"&&l.jsxs(g.Box,{sx:{display:"grid",gap:1.5},children:[l.jsxs(g.Box,{sx:{display:"grid",gap:1},children:[l.jsx(g.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Skip Months"}),l.jsx(g.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:i.map(u=>l.jsx(g.Chip,{label:u,size:"small",onClick:()=>!a&&p(u),sx:{cursor:a?"default":"pointer",bgcolor:s.includes(u)?ye.primary.main:"transparent",color:s.includes(u)?ye.primary.contrastText:ye.text.primary,border:`1px solid ${ye.divider}`,"&:hover":{bgcolor:s.includes(u)?Qn[600]:Qn[50]}}},u))})]}),l.jsxs(g.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(g.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(g.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(na,{sx:{fontSize:14,color:ye.text.secondary,cursor:"help"}})})]}),l.jsx(wr,{value:e.interestPolicy||"accrue-capitalize",onChange:u=>r(e.id,{interestPolicy:u}),options:ia,labelPosition:"none"}),e.interestPolicy==="accrue-forgive"&&l.jsx(g.Typography,{variant:"caption",sx:{color:ye.text.secondary},children:"Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."})]})]}),e.type==="custom-fixed"&&l.jsx(vt,{labelText:"Fixed Installment Amount",type:"number",value:e.customAmount||"",onChange:u=>r(e.id,{customAmount:parseFloat(u.target.value)||0}),placeholder:"Enter amount",disabled:a}),e.type==="payment-holiday"&&l.jsxs(g.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(g.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(g.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(na,{sx:{fontSize:14,color:ye.text.secondary,cursor:"help"}})})]}),l.jsx(wr,{value:e.holidayInterestTreatment||"accrue-capitalize",onChange:u=>r(e.id,{holidayInterestTreatment:u}),options:ia,labelPosition:"none"}),e.holidayInterestTreatment==="accrue-forgive"&&l.jsx(g.Typography,{variant:"caption",sx:{color:ye.text.secondary},children:"Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."})]})]})})]})})};async function wc(e,t,r,n){try{const{endpoint:i,method:a="GET",valueField:o="value",labelField:s="label",headers:c={},params:p={},body:f,transform:d,passThroughFields:u}=e;let x=i;if(t&&!i.startsWith("http")&&(x=`${t}${i.startsWith("/")?i:`/${i}`}`),n){const F=/\{([^}]+)\}/g;x=x.replace(F,(E,_)=>{const I=n[_];return I!=null?encodeURIComponent(String(I)):""}),x=x.replace(/\?&/g,"?").replace(/&&/g,"&").replace(/\?$/g,"")}const k=new URLSearchParams;Object.entries(p).forEach(([F,E])=>{E!=null&&k.append(F,String(E))}),k.toString()&&(x+=`${x.includes("?")?"&":"?"}${k.toString()}`);try{const F=/^https?:\/\//i.test(x),E=new URL(x,F?void 0:"http://local.placeholder"),_=Array.from(E.searchParams.entries());for(const[I,R]of _)(R===""||R==="undefined"||R==="null")&&E.searchParams.delete(I);F?x=E.toString():x=E.pathname+(E.search?E.search:""),x=x.replace(/\?&/g,"?").replace(/&&/g,"&").replace(/\?$/g,"")}catch{}const m={"Content-Type":"application/json",...r,...c},C={method:a,headers:m};(a==="POST"||a==="PUT")&&f&&(C.body=JSON.stringify(f));const v=await fetch(x,C);if(!v.ok)throw new Error(`API request failed: ${v.status} ${v.statusText}`);const w=await v.json();if(d)return d(Array.isArray(w)?w:w.data||w);const $=Array.isArray(w)?w:w.data||w;if(!Array.isArray($))throw new Error("API response is not an array");return $.map(F=>{const E={label:F[s]||F.name||F.title||String(F[o]||""),value:F[o]||F.id||F.value||""},_=Array.isArray(u)?u:void 0;if(Array.isArray(_))for(const I of _)F[I]!==void 0&&(E[I]=F[I]);return E})}catch(i){throw console.error("API fetch error:",i),new Error(`Failed to fetch data: ${i instanceof Error?i.message:"Unknown error"}`)}}function Sc(e,t,r,n,i=!1){const a=P.useMemo(()=>{if(!(e!=null&&e.dependsOn)||!n)return null;const s=n[e.dependsOn];return s!==void 0?s:null},[e==null?void 0:e.dependsOn,n]),o=P.useMemo(()=>["api-data",e==null?void 0:e.endpoint,e==null?void 0:e.method,e==null?void 0:e.valueField,e==null?void 0:e.labelField,t,a,n?JSON.stringify(n):null],[e==null?void 0:e.endpoint,e==null?void 0:e.method,e==null?void 0:e.valueField,e==null?void 0:e.labelField,t,a,n]);return op({queryKey:o,queryFn:()=>{if(!e)throw new Error("API config is required");return wc(e,t,r,n)},enabled:i&&!!e,staleTime:15*60*1e3,gcTime:30*60*1e3,retry:3,retryDelay:s=>Math.min(1e3*2**s,3e4),refetchOnWindowFocus:!1,refetchOnReconnect:!0,refetchOnMount:!1})}function yr(e){return!!(e.apiConfig||e.api_endpoint)}function ho(e){return e.apiConfig?e.apiConfig:e.api_endpoint?{endpoint:e.api_endpoint,method:e.api_method||"GET",valueField:e.value_field||"value",labelField:e.label_field||"label",dependsOn:e.depends_on,conditional:e.conditional}:null}function im(e,t){const r=ho(e);if(!(r!=null&&r.conditional)&&!e.conditional)return!0;if(r!=null&&r.dependsOn||e.depends_on){const n=(r==null?void 0:r.dependsOn)||e.depends_on;if(n){const i=t[n];return i!=null&&i!==""}}return!0}const mo=({field:e,control:t,errors:r,baseUrl:n,apiHeaders:i,formData:a,setValue:o})=>{const s=r[e.name],c=!!s,[p,f]=P.useState(!1),d=P.useRef(!1),[u,x]=P.useState(!1),[k,m]=P.useState(!1),[C,v]=P.useState(!1),w=P.useRef(null),$=P.useRef(null),F=()=>{var ae;const W=e.required;if(typeof W=="function")try{return!!W(a||{})}catch{return!1}if(W!==void 0)return!!W;const Q=(ae=e.validation)==null?void 0:ae.required;if(typeof Q=="function")try{return!!Q(a||{})}catch{return!1}return Q!==void 0?!!Q:!1},E=W=>F()?`${W} *`:W,_=()=>{if(e.value!==void 0){if(typeof e.value=="function")try{return e.value(a||{})}catch{return""}return e.value}return e.type==="checkbox"?!1:e.type==="select"&&e.default?e.default:e.type==="autocomplete"&&e.multiple?[]:""},I=P.useRef(void 0);P.useEffect(()=>{const W=e.value;if(typeof W!="function"||!o)return;let Q;try{Q=W(a||{})}catch{return}const ae=a?a[e.name]:void 0;if(I.current===void 0&&(I.current=Q),ae===void 0||ae===I.current)try{o(e.name,Q,{shouldValidate:!0,shouldDirty:!1}),I.current=Q}catch{}},[JSON.stringify(Array.isArray(e.valueDeps)&&a?e.valueDeps.reduce((W,Q)=>({...W,[Q]:a[Q]}),{}):a||{}),e.name]);const R=P.useMemo(()=>{const W=ho(e);return W&&Array.isArray(e.passThroughFields)&&(W.passThroughFields=e.passThroughFields),W},[e.apiConfig,e.api_endpoint,e.api_method,e.value_field,e.label_field,e.depends_on,e.conditional,e.passThroughFields]),Y=P.useRef(null),h=R!=null&&R.dependsOn?a==null?void 0:a[R.dependsOn]:null;P.useEffect(()=>{R!=null&&R.dependsOn&&(Y.current=h)},[R==null?void 0:R.dependsOn,h]);const B=P.useMemo(()=>{const W=e.showWhen;if(typeof W=="function")try{return!!W(a||{})}catch{return!0}if(W&&typeof W=="object"){const Q=W.field,ae=W.equals,se=W.in,le=Q?(a||{})[Q]:void 0;if(Q&&typeof ae<"u")return le===ae;if(Q&&Array.isArray(se))return se.includes(le)}return!0},[e.showWhen,a]),q=P.useCallback(()=>{const W=e.dynamicEndorsement;if(typeof W=="function")try{return W(a||{})}catch{return e.endorsementText}return e.endorsementText},[e,a]),Z=P.useCallback(()=>{const W=e.endAdornment,Q=e.endAdornmentSwitch,ae=e.endAdornmentCheckbox;if(Q)return l.jsx(Re,{name:Q,control:t,defaultValue:e.endAdornmentSwitchDefault??!1,render:({field:se})=>l.jsx(g.Switch,{checked:se.value||!1,onChange:le=>{se.onChange(le.target.checked),e.endAdornmentSwitchOnChange&&e.endAdornmentSwitchOnChange(le.target.checked,a,o)},disabled:e.endAdornmentSwitchDisabled,size:e.endAdornmentSwitchSize||"small",sx:e.endAdornmentSwitchSx})});if(ae)return l.jsx(Re,{name:ae,control:t,defaultValue:e.endAdornmentCheckboxDefault??!1,render:({field:se})=>l.jsx(Ut,{label:"",checked:se.value||!1,onChange:se.onChange,disabled:e.endAdornmentCheckboxDisabled,sx:e.endAdornmentCheckboxSx})});if(typeof W=="function")try{return W(a||{},{control:t,setValue:o})}catch{return}return W},[e,a,t,o]),L=P.useMemo(()=>p&&yr(e)&&(!(R!=null&&R.dependsOn)||h),[p,e,R==null?void 0:R.dependsOn,h]),H=P.useMemo(()=>{const W={};if(!a)return W;const Q=(R==null?void 0:R.endpoint)||(e==null?void 0:e.api_endpoint);if(Q&&typeof Q=="string"){const ae=Q.match(/\{([^}]+)\}/g)||[];for(const se of ae){const le=se.slice(1,-1),be=a[le];be!==void 0&&(W[le]=be)}}if(R!=null&&R.dependsOn){const ae=R.dependsOn,se=a[ae];se!==void 0&&(W[ae]=se)}return W},[R==null?void 0:R.endpoint,e==null?void 0:e.api_endpoint,R==null?void 0:R.dependsOn,a]),{data:G=[],isLoading:re,error:ce}=Sc(R,n,i,H,L),D=P.useCallback(()=>{yr(e)&&!d.current&&(d.current=!0,f(!0))},[e]),U=P.useCallback(()=>{yr(e)&&!d.current&&(d.current=!0,f(!0))},[e]);P.useEffect(()=>{if(yr(e)&&!d.current){const W=a==null?void 0:a[e.name];W!=null&&W!==""&&(d.current=!0,f(!0))}},[e,a]),P.useEffect(()=>{yr(e)&&(R!=null&&R.dependsOn)&&(h!=null&&`${h}`!=""?(d.current=!0,f(!0)):(d.current=!1,f(!1)))},[R==null?void 0:R.dependsOn,h]);const X=P.useCallback(W=>{if(typeof W=="function")try{const Q=W(a||{});return X(Q)}catch{return[]}return W?Array.isArray(W)?W.map(Q=>{if(Q&&typeof Q=="object"){const ae=Q.value??Q.id??Q.key??void 0,se=Q.label??Q.name??Q.title??(ae!==void 0?String(ae):"");return{label:String(se??""),value:String(ae??se??"")}}return{label:String(Q),value:String(Q)}}):typeof W=="object"?Object.keys(W).map(Q=>({value:String(Q),label:String(W[Q])})):[]:[]},[a]),ue=P.useCallback(()=>yr(e)?Array.isArray(G)?G:[]:e.type==="select"||e.type==="toggle"||e.type==="radio"||e.type==="autocomplete"?X(e.options):[],[e,G,X]),fe=()=>{var W,Q,ae,se,le,be;switch(e.type){case"title":return l.jsx(g.Typography,{variant:e.variant||"h4",component:"h1",color:e.color,align:e.align||"left",sx:{mb:3,fontWeight:600,...e.sx},children:e.label});case"section":return l.jsx(g.Typography,{variant:e.variant||"h6",component:"h3",color:e.color,align:e.align||"left",sx:{mb:2,fontWeight:600,color:"text.primary",...e.sx},children:e.label});case"finuiHeader":const J=e.actionName,Ie=e.actionComponent,Ke=e.actionLabel,Ze=j=>l.jsx(hc,{title:e.title||e.label,subtitle:e.subtitle,align:e.align||"left",sx:e.sx,actions:j??e.actions}),Tt=j=>{if(e.cardWrap){const M={...{px:2,py:1,boxShadow:"none",border:"1px solid #DDDDDD"},...e.cardSx};return l.jsx(g.Card,{sx:M,...e.cardProps,children:j})}return j};return Tt(J&&Ie?l.jsx(Re,{name:J,control:t,defaultValue:e.value??!1,render:({field:j})=>Ze(Ie==="switch"?l.jsx(fi,{label:Ke,checked:!!j.value,onChange:j.onChange}):l.jsx(Ut,{label:Ke||"",checked:!!j.value,onChange:j.onChange}))}):Ze());case"tabs":return l.jsx(Re,{name:e.name,control:t,defaultValue:e.defaultValue??(typeof((Q=(W=e.items)==null?void 0:W[0])==null?void 0:Q.value)=="string"||typeof((se=(ae=e.items)==null?void 0:ae[0])==null?void 0:se.value)=="number"?(be=(le=e.items)==null?void 0:le[0])==null?void 0:be.value:0),render:({field:j})=>{const y=e.items||[],M=y.map((z,K)=>({label:z.label,value:typeof z.value=="string"||typeof z.value=="number"?z.value:K,content:z.content,disabled:z.disabled})),b=j.value,A=(()=>{if(typeof b=="string"||typeof b=="number"){const z=y.findIndex((K,de)=>typeof K.value=="string"||typeof K.value=="number"?K.value===b:de===b);return z>=0?z:0}return Number(b)||0})(),V=y[A]||{};return l.jsxs(g.Box,{children:[l.jsx(yc,{value:j.value,onChange:j.onChange,items:M,ariaLabel:e.ariaLabel||e.label,sx:e.sx,tabSx:e.tabSx}),Array.isArray(V.fields)&&V.fields.length>0&&(()=>{const z=V.fields,K=[];let de=[];for(const me of z)me.type==="section"&&de.length>0?(K.push(de),de=[me]):de.push(me);de.length>0&&K.push(de);const ge={p:2,boxShadow:"0px 1px 4px 0px #00000029",background:"#FFFFFF",borderRadius:"6px",display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,width:"100%",mt:1};return l.jsx(g.Box,{sx:{mt:1},children:K.map((me,Ne)=>{const Oe=me.find(Me=>Me.type==="section"),it=(Oe==null?void 0:Oe.cardWrap)!==!1,pt=l.jsx(l.Fragment,{children:me.map(Me=>{const ne=Me.showWhen;if(ne)try{if(typeof ne=="function"){if(!ne(a||{}))return null}else if(typeof ne=="object"){const Kt=ne.field,vo=ne.equals,bo=ne.in,wo=Kt?(a||{})[Kt]:void 0;if(Kt&&typeof vo<"u"&&wo!==vo||Kt&&Array.isArray(bo)&&!bo.includes(wo))return null}}catch{}const Ge=Math.min(Math.max(Me.col??12,1),12);return l.jsx(g.Box,{sx:{gridColumn:`span ${Ge}`},children:l.jsx(mo,{field:Me,control:t,errors:r,baseUrl:n,apiHeaders:i,formData:a,setValue:o})},Me.name)})});return it?l.jsx(g.Card,{sx:{...ge,...(Oe==null?void 0:Oe.cardSx)||{}},...(Oe==null?void 0:Oe.cardProps)||{},children:pt},`tab-group-${Ne}`):l.jsx(g.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,width:"100%",mt:1},children:pt},`tab-group-${Ne}`)})})})()]})}});case"grid":const Ye=e.defaultRows||[];return l.jsx(g.Box,{children:l.jsx(Re,{name:e.name,control:t,defaultValue:Ye.length>0?Ye:_()||[],render:()=>l.jsx(xc,{name:e.name,columns:e.columns||[],initialRow:e.initialRow||{},addLabel:e.addLabel,showEmptyState:e.showEmptyState,maxRows:e.maxRows,hideAddWhenMax:e.hideAddWhenMax,disableAddWhenMax:e.disableAddWhenMax,rowDeletable:e.rowDeletable!==!1,control:t,setValue:o,addActions:e.addActions,emptyTitle:e.emptyTitle,emptySubtitle:e.emptySubtitle,emptyCardSx:e.emptyCardSx,sx:e.sx,rowSelectionMode:e.rowSelectionMode,rowSelectionKey:e.rowSelectionKey})})});case"listcards":return l.jsx(vc,{name:e.name,control:t,items:e.items||[],sx:e.sx,cardSx:e.cardSx});case"dragdroplist":return l.jsx(Re,{name:e.name,control:t,defaultValue:e.items||[],render:({field:j})=>{const y=e,M=j.value||y.items||[],b=typeof y.getId=="function"?y.getId:typeof y.getId=="string"?z=>z[y.getId]:z=>z.id??z._id??z.key??String(z),A=typeof y.getText=="function"?y.getText:typeof y.getText=="string"?z=>z[y.getText]??String(z):z=>z.text??z.label??z.name??z.title??String(z),V=(()=>{if(typeof y.chipText=="function")return y.chipText;if(typeof y.chipText=="string")return M.length>0&&M[0]&&y.chipText in M[0]?(z,K)=>z[y.chipText]??void 0:y.chipText})();return l.jsx(gc,{items:M,getId:b,onReorder:z=>{j.onChange(z)},header:y.header,disabled:e.disabled,sx:y.sx,chipText:V,helperText:y.helperText||(c?s==null?void 0:s.message:void 0),getText:A,showIndex:y.showIndex!==!1,showLeftIcon:y.showLeftIcon!==!1,renderItem:y.renderItem})}});case"text":case"email":case"password":case"tel":case"textarea":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>e.type==="textarea"?l.jsx(fc,{...j,labelText:e.labelPosition==="top"?E(e.label):void 0,label:e.labelPosition!=="top"?E(e.label):void 0,labelVariant:e.labelVariant,placeholder:e.placeholder,disabled:e.disabled,hasError:c,helperText:(s==null?void 0:s.message)||e.helperText}):l.jsx(vt,{...j,id:e.id,labelText:e.labelPosition==="top"?E(e.label):void 0,label:e.labelPosition!=="top"?E(e.label):void 0,endAdornment:Z(),endorsementText:q(),endorsementBg:e.endorsementBg,endorsementColor:e.endorsementColor,endorsementRadius:e.endorsementRadius,endorsementHeight:e.endorsementHeight,endorsementPaddingX:e.endorsementPaddingX,labelVariant:e.labelVariant,type:e.type==="password"?u?"text":"password":e.type,placeholder:e.placeholder,disabled:e.disabled,hasError:c,helperText:(s==null?void 0:s.message)||e.helperText,InputProps:e.type==="password"?{endAdornment:l.jsx(nc,{position:"end",children:l.jsx(Gn,{"aria-label":"toggle password visibility",onClick:()=>x(y=>!y),edge:"end",children:u?l.jsx(_s,{}):l.jsx(Os,{})})})}:void 0})});case"number":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(vt,{...j,id:e.id,labelText:e.labelPosition==="top"?E(e.label):void 0,label:e.labelPosition!=="top"?E(e.label):void 0,endAdornment:Z(),endorsementText:q(),endorsementBg:e.endorsementBg,endorsementColor:e.endorsementColor,endorsementRadius:e.endorsementRadius,endorsementHeight:e.endorsementHeight,endorsementPaddingX:e.endorsementPaddingX,labelVariant:e.labelVariant,type:"number",placeholder:e.placeholder,disabled:e.disabled,hasError:c,helperText:(s==null?void 0:s.message)||e.helperText,inputProps:{min:e.min,max:e.max}})});case"select":const We=ue();return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>{const y=typeof e.disabled=="function"?!!e.disabled(a||{}):!!e.disabled,M=e.disableWhenEmptyOptions===!0&&Array.isArray(We)&&We.length===0,b=y||M||re,A=j.value,V=(()=>{if(Array.isArray(We)&&We.length>0){const z=We.find(K=>String(K==null?void 0:K.value)===String(A));return z?z.value:A}return A})();return l.jsx(Di,{labelText:e.labelPosition==="top"?E(e.label):void 0,label:e.labelPosition!=="top"&&e.labelPosition!=="none"?E(e.label):void 0,labelVariant:e.labelVariant,value:V,onChange:j.onChange,options:We,disabled:b,placeholder:e.labelPosition==="inner"||e.labelPosition==="none"||!e.labelPosition?e.placeholder||(e.labelPosition==="none"?E(e.label):void 0):e.placeholder,loading:re,error:c||!!ce,helperText:(s==null?void 0:s.message)||(ce==null?void 0:ce.message)||e.helperText,onOpen:D})}});case"checkbox":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(Ut,{label:E(e.label),checked:!!j.value,disabled:e.disabled,onChange:j.onChange})});case"toggle":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(wr,{label:E(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:j.value,options:e.options||[],row:!0,onChange:j.onChange})});case"radio":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(wr,{label:E(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:j.value,options:e.options||[],row:e.row===!0,groupPadding:e.groupPadding,itemGap:e.itemGap,helperText:e.helperText,onChange:j.onChange})});case"checkboxGroup":return l.jsx(Re,{name:e.name,control:t,defaultValue:_()||[],render:({field:j})=>l.jsx(dc,{label:E(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:Array.isArray(j.value)?j.value:[],options:e.options||[],row:e.row,groupPadding:e.groupPadding,itemGap:e.itemGap,helperText:e.helperText,onChange:j.onChange,disabled:e.disabled})});case"switch":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(fi,{label:E(e.label),checked:!!j.value,disabled:e.disabled,onChange:j.onChange})});case"autocomplete":const Ue=ue(),S=!!((typeof e.disabled=="function"?e.disabled(a||{},{options:Ue,isLoading:re,error:ce}):e.disabled)||e.disableWhenEmptyOptions===!0&&Array.isArray(Ue)&&Ue.length===0||re||R!=null&&R.dependsOn&&!h);return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>{const y=j.value,M=e.multiple===!0,b=(R==null?void 0:R.valueField)||e.value_field||"value",A=z=>{if(z!=null){if(typeof z=="string"||typeof z=="number")return z;if(typeof z=="object"){if(z[b]!==void 0)return z[b];if(z.value!==void 0)return z.value;if(z.id!==void 0)return z.id}}},V=(()=>{if(M)return(Array.isArray(y)?y:[]).map(K=>{const de=String(typeof K=="object"?A(K):K);return Ue.find(me=>{const Ne=A(me);return Ne!==void 0&&String(Ne)===de})||null}).filter(Boolean);{if(y==null||y==="")return null;const z=String(typeof y=="object"?A(y):y),K=Ue.find(de=>{const ge=A(de);return ge!==void 0&&String(ge)===z});return K||null}})();return l.jsx(pc,{id:e.id,options:Ue,value:V,multiple:M,labelText:e.labelPosition==="top"?E(e.label):void 0,label:e.labelPosition!=="top"?E(e.label):void 0,placeholder:S&&(R!=null&&R.dependsOn)&&!h?`Please select ${R.dependsOn.replace(/_/g," ")} first`:e.placeholder,labelVariant:e.labelVariant,disabled:S,loading:re,error:c||!!ce,helperText:(s==null?void 0:s.message)||(ce==null?void 0:ce.message)||e.helperText||"",onOpen:U,noOptionsText:S&&(R!=null&&R.dependsOn)&&!h?`Please select ${R.dependsOn.replace(/_/g," ")} first`:re?"Fetching data...":p&&!re&&Ue.length===0?"No options available":"Click to load options",onChange:z=>{const K=(R==null?void 0:R.valueField)||e.value_field||"value";if(M){const ge=(Array.isArray(z)?z:[]).map(me=>typeof me=="object"&&(me[K]||me.value||me.id)||me);j.onChange(ge)}else{let de;z&&typeof z=="object"?de=z[K]||z.value||z.id||z:de=z,j.onChange(de);const ge=e.selectedAssignments;if(ge&&z&&typeof z=="object")for(const[me,Ne]of Object.entries(ge)){const Oe=z[Ne];if(Oe!==void 0&&typeof o=="function")try{o(me,Oe,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!1})}catch{}}}}})}});case"date":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(po,{...j,id:e.name,label:E(e.label),labelPosition:e.labelPosition||"inner",labelVariant:e.labelVariant,disabled:e.disabled,error:c,helperText:s==null?void 0:s.message,inputProps:{min:e.minDate,max:e.maxDate}})});case"image":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>{const y=j.value||e.defaultValue||e.src;if(y){const K=e.imageUploaded||{},de=K.previewText||"Preview",ge=K.removeText||"Remove",me=K.saveText||"Save logo",Ne=K.showSave!==void 0?K.showSave:!!(e.onSave||K.saveText),Oe=()=>{if(v(!0),typeof e.onPreview=="function")try{e.onPreview(y)}catch{}},it=()=>{j.onChange(""),typeof e.onRemove=="function"&&e.onRemove()},pt=()=>{typeof e.onSave=="function"&&e.onSave({url:y,file:$.current||void 0})},Me=ne=>{const Ge=ne.target.files&&ne.target.files[0];if(Ge){if(typeof e.onFileSelected=="function")try{e.onFileSelected(Ge)}catch{}try{const Kt=URL.createObjectURL(Ge);j.onChange(Kt)}catch{}$.current=Ge,v(!1)}};return l.jsxs(g.Card,{sx:{display:"flex",alignItems:"center",gap:2,p:2,boxShadow:"0px 1px 4px 0px #00000014",...K.cardSx},children:[l.jsx("input",{type:"file",ref:w,accept:Array.isArray(e.accept)?e.accept.join(","):e.accept||"image/*",style:{display:"none"},onChange:Me}),l.jsxs(g.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[l.jsx(g.Box,{sx:{width:"30%",height:"10%",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",background:"#FFFFFF",overflow:"hidden",...K.thumbnailSx},children:l.jsx("img",{src:y,alt:e.alt||e.label,style:{maxWidth:"100%",maxHeight:"100%"}})}),l.jsxs(g.Box,{sx:{flexGrow:1},children:[l.jsx(g.Typography,{sx:{fontSize:"12px",fontWeight:500,...K.fileNameSx},children:typeof y=="string"?y.split("/").pop():"Selected image"}),l.jsx(g.Typography,{sx:{fontSize:"10px",...K.fileMetaSx},children:"Image selected"})]}),l.jsxs(g.Box,{sx:{display:"flex",gap:1},children:[l.jsx(g.Button,{type:"button",sx:{...K.previewButtonSx},variant:"outlined",onClick:Oe,startIcon:l.jsx(Os,{}),children:de}),l.jsx(g.Button,{variant:"outlined",color:"error",onClick:it,sx:{...K.removeButtonSx},startIcon:l.jsx(_s,{}),children:ge}),Ne&&l.jsx(g.Button,{variant:"contained",onClick:pt,sx:{...K.saveButtonSx},children:me})]})]}),l.jsxs(g.Dialog,{open:C,onClose:()=>v(!1),maxWidth:"md",fullWidth:!0,children:[l.jsx(g.DialogTitle,{children:K.previewTitle||"Image preview"}),l.jsx(g.DialogContent,{children:l.jsx(g.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",border:"1px solid",borderColor:"divider",backgroundColor:"background.paper",p:1,minHeight:260},children:l.jsx("img",{src:y,alt:e.alt||e.label,style:{maxWidth:"100%",maxHeight:380}})})}),l.jsxs(g.DialogActions,{children:[l.jsx(g.Button,{type:"button",variant:"outlined",onClick:()=>{var ne;return(ne=w.current)==null?void 0:ne.click()},children:K.replaceText||"Replace logo"}),l.jsx(g.Button,{type:"button",variant:"contained",onClick:()=>v(!1),children:K.closeText||"Close"})]})]})]})}const M=e.imagePlaceholder||{},b=M.icon||"upload",A=w,V=()=>{var K;try{(K=A.current)==null||K.click()}catch{}},z=K=>{const de=K.target.files&&K.target.files[0];if(de){typeof e.onFileSelected=="function"&&e.onFileSelected(de);try{const ge=URL.createObjectURL(de);j.onChange(ge)}catch{}$.current=de}};return l.jsxs(g.Card,{sx:{border:"1px dashed",borderColor:"#CCCCCC",boxShadow:"none",p:2,textAlign:"center",color:"primary.main",...M.sx},children:[l.jsx("input",{type:"file",ref:A,accept:Array.isArray(e.accept)?e.accept.join(","):e.accept||"image/*",style:{display:"none"},onChange:z}),l.jsx(Gn,{sx:{borderRadius:"8px",...M.iconSx},children:b==="image"?l.jsx(Nh,{sx:{width:36,height:36,color:"primary.main"}}):l.jsx(di,{sx:{width:36,height:36,color:"primary.main"}})}),l.jsx(g.Typography,{sx:{fontSize:"16px",fontWeight:600,color:"primary.main",...M.titleSx},children:M.title||"Drag & Drop the image here"}),l.jsx(g.Typography,{sx:{fontSize:"12px",fontWeight:400,color:"primary.main",...M.subtitleSx},children:M.subtitle||""}),l.jsx(g.Button,{onClick:V,sx:{my:2,...M.buttonSx},startIcon:l.jsx(di,{}),variant:"contained",disabled:e.disabled,children:M.buttonText||"Upload File"}),l.jsx(g.Typography,{sx:{fontSize:"12px",fontWeight:400,...M.helperTextSx},children:M.helperText||e.helperText||""})]})}});case"component":return l.jsx(g.Box,{children:e.render?typeof e.render=="function"?(()=>{try{return e.render(a||{},{control:t,setValue:o})}catch{try{return e.render({control:t,formData:a,setValue:o})}catch{return e.render()}}})():e.render:e.content});default:return null}},pe=P.useMemo(()=>!e.disabled||e.copyWhenDisabled===!1?!1:!["title","section","image","component"].includes(e.type),[e.disabled,e.copyWhenDisabled,e.type]),te=P.useCallback(async()=>{try{const W=a?a[e.name]:void 0;let Q="";W==null?Q="":Array.isArray(W)?Q=W.join(", "):typeof W=="object"?Q=JSON.stringify(W):Q=String(W),await navigator.clipboard.writeText(Q),m(!0),window.setTimeout(()=>m(!1),1200)}catch{}},[a,e.name]);return l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:.3},children:[l.jsx(g.Box,{sx:{flexGrow:1},children:B?fe():null}),pe&&l.jsx(Gn,{"aria-label":`copy ${e.label||e.name}`,onClick:te,size:"small",children:k?l.jsx(uo,{fontSize:"small"}):l.jsx(Vh,{fontSize:"small"})})]})};var aa,Ps;function am(){if(Ps)return aa;Ps=1;function e(v){this._maxSize=v,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(v){return this._values[v]},e.prototype.set=function(v,w){return this._size>=this._maxSize&&this.clear(),v in this._values||this._size++,this._values[v]=w};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,n=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,o=512,s=new e(o),c=new e(o),p=new e(o);aa={Cache:e,split:d,normalizePath:f,setter:function(v){var w=f(v);return c.get(v)||c.set(v,function(F,E){for(var _=0,I=w.length,R=F;_<I-1;){var Y=w[_];if(Y==="__proto__"||Y==="constructor"||Y==="prototype")return F;R=R[w[_++]]}R[w[_]]=E})},getter:function(v,w){var $=f(v);return p.get(v)||p.set(v,function(E){for(var _=0,I=$.length;_<I;)if(E!=null||!w)E=E[$[_++]];else return;return E})},join:function(v){return v.reduce(function(w,$){return w+(x($)||r.test($)?"["+$+"]":(w?".":"")+$)},"")},forEach:function(v,w,$){u(Array.isArray(v)?v:d(v),w,$)}};function f(v){return s.get(v)||s.set(v,d(v).map(function(w){return w.replace(a,"$2")}))}function d(v){return v.match(t)||[""]}function u(v,w,$){var F=v.length,E,_,I,R;for(_=0;_<F;_++)E=v[_],E&&(C(E)&&(E='"'+E+'"'),R=x(E),I=!R&&/^\d+$/.test(E),w.call($,E,R,I,_,v))}function x(v){return typeof v=="string"&&v&&["'",'"'].indexOf(v.charAt(0))!==-1}function k(v){return v.match(n)&&!v.match(r)}function m(v){return i.test(v)}function C(v){return!x(v)&&(k(v)||m(v))}return aa}var _r=am(),oa,$s;function om(){if($s)return oa;$s=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=f=>f.match(e)||[],r=f=>f[0].toUpperCase()+f.slice(1),n=(f,d)=>t(f).join(d).toLowerCase(),i=f=>t(f).reduce((d,u)=>`${d}${d?u[0].toUpperCase()+u.slice(1).toLowerCase():u.toLowerCase()}`,"");return oa={words:t,upperFirst:r,camelCase:i,pascalCase:f=>r(i(f)),snakeCase:f=>n(f,"_"),kebabCase:f=>n(f,"-"),sentenceCase:f=>r(n(f," ")),titleCase:f=>t(f).map(r).join(" ")},oa}var sa=om(),Ln={exports:{}},Ds;function sm(){if(Ds)return Ln.exports;Ds=1,Ln.exports=function(i){return e(t(i),i)},Ln.exports.array=e;function e(i,a){var o=i.length,s=new Array(o),c={},p=o,f=r(a),d=n(i);for(a.forEach(function(x){if(!d.has(x[0])||!d.has(x[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});p--;)c[p]||u(i[p],p,new Set);return s;function u(x,k,m){if(m.has(x)){var C;try{C=", node was:"+JSON.stringify(x)}catch{C=""}throw new Error("Cyclic dependency"+C)}if(!d.has(x))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(x));if(!c[k]){c[k]=!0;var v=f.get(x)||new Set;if(v=Array.from(v),k=v.length){m.add(x);do{var w=v[--k];u(w,d.get(w),m)}while(k);m.delete(x)}s[--o]=x}}}function t(i){for(var a=new Set,o=0,s=i.length;o<s;o++){var c=i[o];a.add(c[0]),a.add(c[1])}return Array.from(a)}function r(i){for(var a=new Map,o=0,s=i.length;o<s;o++){var c=i[o];a.has(c[0])||a.set(c[0],new Set),a.has(c[1])||a.set(c[1],new Set),a.get(c[0]).add(c[1])}return a}function n(i){for(var a=new Map,o=0,s=i.length;o<s;o++)a.set(i[o],o);return a}return Ln.exports}var lm=sm();const cm=Qa(lm),um=Object.prototype.toString,pm=Error.prototype.toString,dm=RegExp.prototype.toString,fm=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",hm=/^Symbol\((.*)\)(.*)$/;function mm(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Is(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return mm(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return fm.call(e).replace(hm,"Symbol($1)");const n=um.call(e).slice(8,-1);return n==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):n==="Error"||e instanceof Error?"["+pm.call(e)+"]":n==="RegExp"?dm.call(e):null}function cr(e,t){let r=Is(e,t);return r!==null?r:JSON.stringify(e,function(n,i){let a=Is(this[n],t);return a!==null?a:i},2)}function Cc(e){return e==null?[]:[].concat(e)}let Ec,Tc,kc,gm=/\$\{\s*(\w+)\s*\}/g;Ec=Symbol.toStringTag;class Ms{constructor(t,r,n,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Ec]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=i,this.errors=[],this.inner=[],Cc(t).forEach(a=>{if(lt.isError(a)){this.errors.push(...a.errors);const o=a.inner.length?a.inner:[a];this.inner.push(...o)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Tc=Symbol.hasInstance;kc=Symbol.toStringTag;class lt extends Error{static formatError(t,r){const n=r.label||r.path||"this";return r=Object.assign({},r,{path:n,originalPath:r.path}),typeof t=="string"?t.replace(gm,(i,a)=>cr(r[a])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,n,i,a){const o=new Ms(t,r,n,i);if(a)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[kc]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,lt)}static[Tc](t){return Ms[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Rt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const i=n!=null&&n!==r?` (cast from the value \`${cr(n,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${cr(r,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${cr(r,!0)}\``+i}},at={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Zt={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Da={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ia={isValue:"${path} field must be ${value}"},Zn={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},ym={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},xm={notType:e=>{const{path:t,value:r,spec:n}=e,i=n.types.length;if(Array.isArray(r)){if(r.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${r.length} for value: \`${cr(r,!0)}\``;if(r.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${r.length} for value: \`${cr(r,!0)}\``}return lt.formatError(Rt.notType,e)}};Object.assign(Object.create(null),{mixed:Rt,string:at,number:Zt,date:Da,object:Zn,array:ym,boolean:Ia,tuple:xm});const go=e=>e&&e.__isYupSchema__;class hi{static fromOptions(t,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:i,otherwise:a}=r,o=typeof n=="function"?n:(...s)=>s.every(c=>c===n);return new hi(t,(s,c)=>{var p;let f=o(...s)?i:a;return(p=f==null?void 0:f(c))!=null?p:c})}constructor(t,r){this.fn=void 0,this.refs=t,this.refs=t,this.fn=r}resolve(t,r){let n=this.refs.map(a=>a.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),i=this.fn(n,t,r);if(i===void 0||i===t)return t;if(!go(i))throw new TypeError("conditions must return a schema object");return i.resolve(r)}}const qn={context:"$",value:"."};function mi(e,t){return new mr(e,t)}class mr{constructor(t,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===qn.context,this.isValue=this.key[0]===qn.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?qn.context:this.isValue?qn.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&_r.getter(this.path,!0),this.map=r.map}getValue(t,r,n){let i=this.isContext?n:this.isValue?t:r;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,r){return this.getValue(t,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}mr.prototype.__isYupRef=!0;const At=e=>e==null;function qr(e){function t({value:r,path:n="",options:i,originalValue:a,schema:o},s,c){const{name:p,test:f,params:d,message:u,skipAbsent:x}=e;let{parent:k,context:m,abortEarly:C=o.spec.abortEarly,disableStackTrace:v=o.spec.disableStackTrace}=i;function w(B){return mr.isRef(B)?B.getValue(r,k,m):B}function $(B={}){const q=Object.assign({value:r,originalValue:a,label:o.spec.label,path:B.path||n,spec:o.spec,disableStackTrace:B.disableStackTrace||v},d,B.params);for(const L of Object.keys(q))q[L]=w(q[L]);const Z=new lt(lt.formatError(B.message||u,q),r,q.path,B.type||p,q.disableStackTrace);return Z.params=q,Z}const F=C?s:c;let E={path:n,parent:k,type:p,from:i.from,createError:$,resolve:w,options:i,originalValue:a,schema:o};const _=B=>{lt.isError(B)?F(B):B?c(null):F($())},I=B=>{lt.isError(B)?F(B):s(B)};if(x&&At(r))return _(!0);let Y;try{var h;if(Y=f.call(E,r,E),typeof((h=Y)==null?void 0:h.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${E.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(Y).then(_,I)}}catch(B){I(B);return}_(Y)}return t.OPTIONS=e,t}function vm(e,t,r,n=r){let i,a,o;return t?(_r.forEach(t,(s,c,p)=>{let f=c?s.slice(1,s.length-1):s;e=e.resolve({context:n,parent:i,value:r});let d=e.type==="tuple",u=p?parseInt(f,10):0;if(e.innerType||d){if(d&&!p)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(r&&u>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=r,r=r&&r[u],e=d?e.spec.types[u]:e.innerType}if(!p){if(!e.fields||!e.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=r,r=r&&r[f],e=e.fields[f]}a=f,o=c?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class gi extends Set{describe(){const t=[];for(const r of this.values())t.push(mr.isRef(r)?r.describe():r);return t}resolveAll(t){let r=[];for(const n of this.values())r.push(t(n));return r}clone(){return new gi(this.values())}merge(t,r){const n=this.clone();return t.forEach(i=>n.add(i)),r.forEach(i=>n.delete(i)),n}}function Ur(e,t=new Map){if(go(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n<e.length;n++)r[n]=Ur(e[n],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[n,i]of e.entries())r.set(n,Ur(i,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(Ur(n,t))}else if(e instanceof Object){r={},t.set(e,r);for(const[n,i]of Object.entries(e))r[n]=Ur(i,t)}else throw Error(`Unable to clone ${e}`);return r}class gt{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new gi,this._blacklist=new gi,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Rt.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=Ur(Object.assign({},this.spec,t)),r}label(t){let r=this.clone();return r.spec.label=t,r}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}withMutation(t){let r=this._mutate;this._mutate=!0;let n=t(this);return this._mutate=r,n}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let r=this,n=t.clone();const i=Object.assign({},r.spec,n.spec);return n.spec=i,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(t._whitelist,t._blacklist),n._blacklist=r._blacklist.merge(t._blacklist,t._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((i,a)=>a.resolve(i,t),r),r=r.resolve(t)}return r}resolveOptions(t){var r,n,i,a;return Object.assign({},t,{from:t.from||[],strict:(r=t.strict)!=null?r:this.spec.strict,abortEarly:(n=t.abortEarly)!=null?n:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(a=t.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(t,r={}){let n=this.resolve(Object.assign({value:t},r)),i=r.assert==="ignore-optionality",a=n._cast(t,r);if(r.assert!==!1&&!n.isType(a)){if(i&&At(a))return a;let o=cr(t),s=cr(a);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
176
+ `)):null),classes:T.object,className:T.string,color:T.oneOfType([T.oneOf(["inherit","default","primary","secondary","error","info","success","warning"]),T.string]),disabled:T.bool,disableFocusRipple:T.bool,disableRipple:T.bool,edge:T.oneOf(["end","start",!1]),id:T.string,loading:T.bool,loadingIndicator:T.node,size:T.oneOfType([T.oneOf(["small","medium","large"]),T.string]),sx:T.oneOfType([T.arrayOf(T.oneOfType([T.func,T.object,T.bool])),T.func,T.object])});const Os=ut(l.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),_s=ut(l.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff"),Vh=ut(l.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),uo=ut(l.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),di=ut(l.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"}),"FileUploadOutlined"),Nh=ut(l.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-4.86 8.86-3 3.87L9 13.14 6 17h12z"}),"ImageOutlined"),ye={primary:{main:"#2C5EFF",contrastText:"#FFFFFF"},secondary:{main:"#00B894",contrastText:"#FFFFFF"},error:{main:"#E53935"},warning:{main:"#FB8C00"},info:{main:"#1E88E5"},success:{main:"#43A047"},background:{default:"#FFFFFF",paper:"#FFFFFF"},text:{primary:"#111827",secondary:"#6B7280",disabled:"#9CA3AF"},divider:"#E5E7EB"},Rs=e=>{const t=e.replace("#",""),r=parseInt(t.length===3?t.split("").map(n=>n+n).join(""):t,16);return{r:r>>16&255,g:r>>8&255,b:r&255}},Lh=(e,t,r)=>"#"+[e,t,r].map(n=>{const i=Math.round(Math.min(255,Math.max(0,n))).toString(16);return i.length===1?"0"+i:i}).join(""),Nt=(e,t,r)=>{const n=Rs(e),i=Rs(t);return Lh(n.r+(i.r-n.r)*r,n.g+(i.g-n.g)*r,n.b+(i.b-n.b)*r)},$i=e=>{const t="#FFFFFF",r="#000000";return{50:Nt(t,e,.08),100:Nt(t,e,.16),200:Nt(t,e,.28),300:Nt(t,e,.4),400:Nt(t,e,.55),500:e,600:Nt(e,r,.1),700:Nt(e,r,.2),800:Nt(e,r,.3),900:Nt(e,r,.42)}},qh=$i(ye.primary.main),Wh=$i(ye.secondary.main),Qn=$i(ye.text.primary),cc=e=>$i(e),Uh={primary:ye.primary.main,secondary:ye.secondary.main,textPrimary:ye.text.primary,textSecondary:ye.text.secondary,divider:ye.divider,background:ye.background},Hh="#111827";function Kh(e){const t=e.palette.text.primary;return typeof t=="string"?t:Hh}function Pn(){const e=tc(),t=e.palette.mode,r=Kh(e),n=e.palette.background.paper,i=e.palette.divider,a=e.palette.text.secondary,o=e.palette.error.main;return P.useMemo(()=>{const s=cc(r);return{paper:n,divider:i,textPrimary:r,textSecondary:a,errorMain:o,neutral50:s[50],outlineDefault:mt(s[300],.5),outlineHover:s[300],outlineFocus:s[400]}},[t,r,n,i,a,o])}const uc="#244061";function Yh(){return Xl({palette:{mode:"light",primary:{main:uc,light:"#0a8a4f",dark:"#0d9c5a"},success:{main:"#10B981"},warning:{main:"#F59E0B"},error:{main:"#D40824"},info:{main:"#3B82F6"},text:{primary:"#1A1A1A",secondary:"rgba(0, 0, 0, 0.6)"},background:{default:"#fafafa",paper:"#ffffff"},divider:"#e2e8f0"},typography:{fontFamily:'"Inter", sans-serif',h1:{fontSize:"24px",fontWeight:700,lineHeight:1.3,letterSpacing:"-0.01em"},h2:{fontSize:"20px",fontWeight:600,lineHeight:1.35,letterSpacing:"-0.005em"},h3:{fontSize:"18px",fontWeight:600,lineHeight:1.4},h4:{fontSize:"18px",fontWeight:600,lineHeight:1.35,letterSpacing:"-0.005em"},h5:{fontSize:"15px",fontWeight:500,lineHeight:1.4},h6:{fontSize:"13px",fontWeight:500,lineHeight:1.5},body1:{fontSize:"14px",fontWeight:400,lineHeight:1.6,letterSpacing:"0.01em"},body2:{fontSize:"13px",fontWeight:400,lineHeight:1.6,letterSpacing:"0.01em"},subtitle1:{fontSize:"14px",fontWeight:500,lineHeight:1.5},subtitle2:{fontSize:"13px",fontWeight:500,lineHeight:1.5},caption:{fontSize:"12px",fontWeight:400,lineHeight:1.5,letterSpacing:"0.02em"},overline:{fontSize:"11px",fontWeight:500,lineHeight:1.5,letterSpacing:"0.08em",textTransform:"uppercase"},button:{fontSize:"14px",fontWeight:500,lineHeight:1.2,letterSpacing:"0.01em"},allVariants:{fontFamily:'"Inter", sans-serif'}},shape:{borderRadius:6},spacing:8})}const vt=({hasError:e,sx:t,labelText:r,labelVariant:n="subtitle2",endAdornment:i,endorsementText:a,endorsementBg:o="#E6E8EC",endorsementColor:s="#111827",endorsementRadius:c="6px",endorsementHeight:p=28,endorsementPaddingX:f="8px",...d})=>{var C,v;const u=Pn(),x=!!r,k=a?l.jsx(g.Box,{component:"span",sx:{display:"inline-flex",flex:"0 0 auto",width:"auto",maxWidth:"100%",alignItems:"center",height:p,paddingLeft:f,paddingRight:f,borderRadius:c,backgroundColor:o,color:s,fontSize:12,fontWeight:300,lineHeight:1,whiteSpace:"nowrap"},children:a}):null,m={...d.InputProps,endAdornment:k||i?l.jsxs(g.InputAdornment,{sx:{mr:-1},position:"end",children:[k||i,(C=d.InputProps)==null?void 0:C.endAdornment]}):(v=d.InputProps)==null?void 0:v.endAdornment};return l.jsxs(g.Box,{children:[x&&l.jsx(g.Typography,{variant:n,sx:{color:u.textPrimary,mb:.5,fontWeight:500},children:r}),l.jsx(g.TextField,{fullWidth:!0,size:"small",...d,InputProps:m,label:x?void 0:d.label,sx:{"& .MuiOutlinedInput-root":{backgroundColor:u.paper,borderRadius:"8px","& fieldset":{borderColor:u.outlineDefault},"&:hover fieldset":{borderColor:u.outlineHover},"&.Mui-focused fieldset":{borderColor:u.outlineFocus},"&.Mui-error fieldset":{borderColor:u.errorMain}},"& .MuiInputBase-input":{color:u.textPrimary},"& .MuiFormLabel-root":{color:u.textSecondary},"& .MuiFormLabel-root.Mui-focused":{color:u.textPrimary},"& .MuiFormHelperText-root":{color:e?u.errorMain:u.textSecondary},...t}})]})},Di=({labelText:e,label:t,options:r,loading:n,helperText:i,size:a="small",labelVariant:o="subtitle2",placeholder:s,value:c,sx:p,...f})=>{const d=Pn(),u=P.useId(),x=c==null||c===""||Array.isArray(c)&&c.length===0,k=m=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...m,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:d.textSecondary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});return l.jsxs(g.FormControl,{fullWidth:!0,size:a,error:!!f.error,variant:"outlined",children:[e&&l.jsx(g.Typography,{variant:o,sx:{color:d.textPrimary,mb:.5,fontWeight:500},children:e}),t&&l.jsx(g.InputLabel,{id:u,shrink:!x||!!s,sx:{color:d.textSecondary,"&.Mui-focused":{color:d.textPrimary},"&.Mui-error":{color:d.errorMain}},children:t}),l.jsx(g.Select,{...f,value:c,labelId:t?u:void 0,label:t,displayEmpty:!0,input:l.jsx(g.OutlinedInput,{label:t}),IconComponent:k,renderValue:m=>{const C=m;if(x)return l.jsx("span",{style:{color:d.textSecondary},children:s??""});const v=r.find(w=>w.value===C);return(v==null?void 0:v.label)??String(C)},endAdornment:n?l.jsx(g.CircularProgress,{size:20}):void 0,MenuProps:{PaperProps:{sx:{boxShadow:"0px 0px 10px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${d.divider}`,mt:.5,borderRadius:"8px"}}},sx:{backgroundColor:d.paper,boxShadow:"none",borderRadius:"8px",height:"40px","& .MuiSelect-select":{color:d.textPrimary,fontSize:14,pr:3},"& .MuiOutlinedInput-notchedOutline":{borderColor:d.outlineDefault},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:d.outlineHover},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:d.outlineFocus},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:d.errorMain},"& svg":{right:8,position:"absolute",pointerEvents:"none"},...p},children:n?l.jsx(g.MenuItem,{disabled:!0,children:l.jsx(g.CircularProgress,{size:16})}):r.map(m=>l.jsx(g.MenuItem,{value:m.value,sx:{backgroundColor:d.paper,color:d.textPrimary,fontSize:14,mx:1,"&:hover":{backgroundColor:d.neutral50,borderRadius:"4px"},"&.Mui-selected":{backgroundColor:d.neutral50,borderRadius:"4px"}},children:m.label},m.value))}),i&&l.jsx(g.FormHelperText,{children:i})]})},pc=({id:e,options:t,value:r,multiple:n,label:i,labelText:a,placeholder:o,onChange:s,labelVariant:c="subtitle2",disabled:p,loading:f,error:d,helperText:u,onOpen:x,noOptionsText:k,sx:m})=>{const C=Pn(),v=w=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...w,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:C.textSecondary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});return l.jsxs(g.Box,{children:[a&&l.jsx(g.Typography,{variant:c,sx:{color:C.textPrimary,mb:.5,fontWeight:500},children:a}),l.jsx(g.Autocomplete,{id:e,options:t,value:r,multiple:n,size:"small",popupIcon:l.jsx(v,{}),disabled:p,loading:f,onOpen:x,noOptionsText:k,fullWidth:!0,componentsProps:{paper:{sx:{boxShadow:"0px 0px 10px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${C.divider}`,mt:.5,borderRadius:"8px"}}},sx:{"& .MuiOutlinedInput-root":{backgroundColor:C.paper,borderRadius:"8px",height:"40px","& fieldset":{borderColor:C.outlineDefault},"&:hover fieldset":{borderColor:C.outlineHover},"&.Mui-focused fieldset":{borderColor:C.outlineFocus},"&.Mui-error fieldset":{borderColor:C.errorMain}},"& .MuiInputBase-input":{color:C.textPrimary,fontSize:14},"& .MuiAutocomplete-popupIndicator":{color:C.textSecondary},"& .MuiAutocomplete-endAdornment svg":{width:16,height:16},...m},getOptionLabel:w=>typeof w=="string"?w:(w==null?void 0:w.label)??"",isOptionEqualToValue:(w,$)=>((w==null?void 0:w.value)??w)===(($==null?void 0:$.value)??$),renderOption:(w,$,{selected:F})=>{const{key:E,..._}=w;return l.jsxs(g.Box,{component:"li",..._,sx:{backgroundColor:C.paper,color:C.textPrimary,mx:.5,borderRadius:"4px","&:hover":{backgroundColor:C.neutral50},"&.Mui-focused":{backgroundColor:C.neutral50},...F?{backgroundColor:C.neutral50}:{}},children:[n&&l.jsx(g.Checkbox,{checked:F}),l.jsx(g.Typography,{variant:"body2",sx:{color:C.textPrimary,fontSize:14},children:typeof $=="string"?$:$.label})]},E)},renderInput:w=>l.jsx(g.TextField,{...w,label:i,placeholder:o,size:"small",error:d,helperText:u,InputLabelProps:{shrink:!!r||!!o,sx:{color:C.textSecondary,"&.Mui-focused":{color:C.textPrimary},"&.Mui-error":{color:C.errorMain}}},InputProps:{...w.InputProps,endAdornment:l.jsxs(l.Fragment,{children:[f?l.jsx(g.CircularProgress,{size:20}):null,w.InputProps.endAdornment]})}}),onChange:(w,$)=>s($)})]})},Ut=({label:e,checked:t,disabled:r,onChange:n,sx:i})=>l.jsx(g.FormControlLabel,{control:l.jsx(g.Checkbox,{size:"small",checked:t,disabled:r,onChange:(a,o)=>n(o)}),label:e,sx:a=>({"& .MuiFormControlLabel-label":{color:a.palette.text.primary,fontSize:14},...i})}),dc=({labelText:e,label:t,value:r=[],options:n,row:i=!1,onChange:a,labelPosition:o="top",labelVariant:s="subtitle2",helperText:c,error:p,groupPadding:f=1.5,itemGap:d=1,disabled:u=!1})=>{const x=typeof i=="number"&&i>0,k=x?i:12,m=i===!0,C=i===!1&&!x,v=(w,$)=>{const F=Array.isArray(r)?[...r]:[];$?F.includes(w)||a([...F,w]):a(F.filter(E=>E!==w))};return l.jsxs(g.FormControl,{error:p,disabled:u,sx:w=>{var $;return{display:"flex",flexDirection:"column",px:w.spacing(f),borderRadius:(($=w.shape)==null?void 0:$.borderRadius)||8,mx:-2.5,backgroundColor:w.palette.background.paper}},children:[o==="top"&&e&&l.jsx(g.Typography,{variant:s,sx:w=>({color:w.palette.text.primary,mb:.5,fontSize:w.typography.fontSize,fontWeight:500}),children:e}),t&&l.jsx(g.FormLabel,{sx:w=>({color:w.palette.text.secondary,mb:.5,mx:1,fontSize:w.typography.fontSize||12,fontWeight:500,"&.Mui-focused":{color:w.palette.text.primary},"&.Mui-error":{color:w.palette.error.main}}),children:t}),x&&l.jsx(g.Box,{sx:w=>({display:"grid",gridTemplateColumns:`repeat(${k}, 1fr)`,gap:w.spacing(d),mt:0}),children:n.map(w=>{const $=Array.isArray(r)&&r.includes(w.value);return l.jsx(g.FormControlLabel,{control:l.jsx(g.Checkbox,{size:"small",checked:$,onChange:F=>v(w.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:w.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(w.value))})}),m&&l.jsx(g.Box,{sx:w=>({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:w.spacing(d),alignItems:"center",mt:0}),children:n.map(w=>{const $=Array.isArray(r)&&r.includes(w.value);return l.jsx(g.FormControlLabel,{control:l.jsx(g.Checkbox,{size:"small",checked:$,onChange:F=>v(w.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:w.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(w.value))})}),C&&l.jsx(g.Box,{sx:w=>({display:"flex",flexDirection:"column",gap:w.spacing(d),alignItems:"flex-start",mt:0}),children:n.map(w=>{const $=Array.isArray(r)&&r.includes(w.value);return l.jsx(g.FormControlLabel,{control:l.jsx(g.Checkbox,{size:"small",checked:$,onChange:F=>v(w.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:w.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(w.value))})}),c&&l.jsx(g.FormHelperText,{sx:{mt:.5},children:c})]})},fi=({label:e,checked:t,disabled:r,onChange:n,sx:i})=>l.jsx(g.FormControlLabel,{control:l.jsx(g.Switch,{checked:t,disabled:r,onChange:(a,o)=>n(o)}),label:e,sx:a=>({"& .MuiFormControlLabel-label":{color:a.palette.text.primary,fontSize:14},...i})}),wr=({labelText:e,label:t,value:r,options:n,row:i=!1,onChange:a,labelPosition:o="top",labelVariant:s="subtitle2",helperText:c,error:p,groupPadding:f=1.5,itemGap:d=1})=>l.jsxs(g.FormControl,{error:p,sx:u=>{var x;return{display:"flex",flexDirection:"column",px:u.spacing(f),borderRadius:((x=u.shape)==null?void 0:x.borderRadius)||8,mx:-2.5,backgroundColor:u.palette.background.paper}},children:[o==="top"&&e&&l.jsx(g.Typography,{variant:s,sx:u=>({color:u.palette.text.primary,mb:.5,fontSize:u.typography.fontSize,fontWeight:500}),children:e}),t&&l.jsx(g.FormLabel,{sx:u=>({color:u.palette.text.secondary,mb:.5,mx:1,fontSize:u.typography.fontSize||12,fontWeight:500,"&.Mui-focused":{color:u.palette.text.primary},"&.Mui-error":{color:u.palette.error.main}}),children:t}),l.jsx(g.RadioGroup,{row:i,value:r,onChange:u=>a(u.target.value),sx:u=>({display:"flex",flexDirection:i?"row":"column",gap:u.spacing(d),alignItems:i?"center":"flex-start"}),children:n.map(u=>l.jsx(g.FormControlLabel,{value:u.value,control:l.jsx(g.Radio,{size:"small",sx:x=>({color:x.palette.text.secondary,"&.Mui-checked":{color:x.palette.primary.main}})}),label:l.jsxs(g.Box,{sx:{display:"flex",flexDirection:"column",gap:0},children:[l.jsx(g.Typography,{variant:"body2",sx:{color:"#1a1a1a",fontSize:12,fontWeight:400,lineHeight:1.5},children:u.label}),u.description&&l.jsx(g.Typography,{variant:"caption",sx:{color:"#1a1a1a",fontSize:10,fontWeight:300,lineHeight:1.5},children:u.description})]}),sx:{m:0,gap:0,"& .MuiFormControlLabel-label":{marginLeft:0},"& .MuiRadio-root":{alignSelf:"flex-start",marginTop:0}}},String(u.value)))}),c&&l.jsx(g.FormHelperText,{sx:{mt:.5},children:c})]}),po=({labelPosition:e="inner",labelVariant:t="subtitle2",label:r,sx:n,...i})=>l.jsxs(g.Box,{children:[e==="top"&&r&&l.jsx(g.Typography,{variant:t,sx:{color:"#111827",mb:.5},children:r}),l.jsx(g.TextField,{fullWidth:!0,type:"date",size:"small",label:e==="inner"?r:void 0,InputLabelProps:{shrink:!0},...i,sx:{"& .MuiOutlinedInput-root":{backgroundColor:"#FFFFFF",borderRadius:"8px","& fieldset":{borderColor:"#E5E7EB"},"&:hover fieldset":{borderColor:"#D1D5DB"},"&.Mui-focused fieldset":{borderColor:"#D1D5DB"},"&.Mui-error fieldset":{borderColor:"#E53935"}},"& .MuiInputBase-input":{color:"#111827",fontSize:14},...n}})]}),fc=({labelText:e,labelVariant:t="subtitle2",hasError:r,sx:n,label:i,...a})=>{const o=Pn(),s=!!e;return l.jsxs(g.Box,{children:[s&&l.jsx(g.Typography,{variant:t,sx:{color:o.textPrimary,mb:.5,fontWeight:500},children:e}),l.jsx(g.TextField,{fullWidth:!0,multiline:!0,minRows:3,size:"small",...a,label:s?void 0:i,sx:{"& .MuiOutlinedInput-root":{backgroundColor:o.paper,borderRadius:"8px","& fieldset":{borderColor:o.outlineDefault},"&:hover fieldset":{borderColor:o.outlineHover},"&.Mui-focused fieldset":{borderColor:o.outlineFocus},"&.Mui-error fieldset":{borderColor:o.errorMain}},"& .MuiInputBase-input":{color:o.textPrimary,fontSize:14},"& .MuiFormLabel-root":{color:o.textSecondary},"& .MuiFormLabel-root.Mui-focused":{color:o.textPrimary},"& .MuiFormHelperText-root":{color:r?o.errorMain:o.textSecondary},...n}})]})},hc=({title:e,subtitle:t,actions:r,align:n="left",sx:i})=>l.jsxs(g.Box,{sx:a=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:a.spacing(1),py:a.spacing(1),...i}),children:[l.jsxs(g.Box,{sx:{display:"flex",flexDirection:"column",minWidth:0,flex:1,textAlign:n},children:[e&&l.jsx(g.Typography,{variant:"h6",sx:a=>({color:a.palette.text.primary,fontSize:16,fontWeight:500,lineHeight:1.3}),children:e}),t&&l.jsx(g.Typography,{variant:"body2",sx:a=>({color:a.palette.text.secondary,mt:e?.5:0,fontSize:12,fontWeight:500}),children:t})]}),r&&l.jsx(g.Box,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:r})]}),yn=ut(l.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),mc=()=>l.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("g",{"clip-path":"url(#clip0_5814_24904)",children:l.jsx("path",{d:"M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z",fill:"#056739","fill-opacity":"0.5"})}),l.jsx("defs",{children:l.jsx("clipPath",{id:"clip0_5814_24904",children:l.jsx("rect",{width:"24",height:"24",fill:"white"})})})]});function gc({items:e,getId:t,onReorder:r,header:n,disabled:i,sx:a,getText:o,showIndex:s=!0,showLeftIcon:c=!0,renderItem:p,chipText:f,helperText:d,emptyStateText:u,emptyStateButtonText:x="Add Phase",onEmptyStateButtonClick:k,emptyStateSx:m}){const[C,v]=P.useState(null),[w,$]=P.useState(null),F=h=>B=>{if(!i){v(h),B.dataTransfer.effectAllowed="move";try{B.dataTransfer.setData("text/plain",String(t(e[h])))}catch{}}},E=h=>B=>{i||(B.preventDefault(),$(h),B.dataTransfer.dropEffect="move")},_=h=>B=>{if(i)return;if(B.preventDefault(),C===null||C===h){v(null),$(null);return}const q=[...e],[Z]=q.splice(C,1);q.splice(h,0,Z),v(null),$(null),r(q)},I=()=>{v(null),$(null)},R=e.length===0,Y=R&&(u||k!==void 0);return l.jsxs(g.Box,{role:"list",sx:h=>({display:"flex",flexDirection:"column",gap:h.spacing(1),...a}),children:[n,!R&&l.jsx(g.Divider,{sx:{mt:-.5,mb:1,dividerColor:"#EBEBEB"}}),Y?l.jsxs(g.Box,{sx:h=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",padding:h.spacing(4),backgroundColor:h.palette.mode==="dark"?"#000000":ye.background.paper,border:`2px dashed ${h.palette.mode==="dark"?"#FFFFFF":ye.divider}`,borderRadius:"8px",textAlign:"center",...m}),children:[u&&l.jsx(g.Typography,{variant:"body1",sx:h=>({color:h.palette.text.secondary,fontSize:"14px",fontWeight:400,lineHeight:1.5,mb:k?2:0,maxWidth:"400px"}),children:u}),k&&l.jsx(g.Button,{variant:"outlined",startIcon:l.jsx(yn,{}),onClick:k,disabled:i,sx:h=>({mt:u?0:2,backgroundColor:h.palette.mode==="dark"?`${h.palette.primary.main}1A`:`${h.palette.primary.main}0D`,borderColor:h.palette.primary.main,color:h.palette.primary.main,"&:hover":{backgroundColor:h.palette.mode==="dark"?`${h.palette.primary.main}33`:`${h.palette.primary.main}1A`,borderColor:h.palette.primary.main},borderRadius:"6px",textTransform:"none",fontSize:"14px",fontWeight:500,px:2,py:1}),children:x})]}):e.map((h,B)=>{const q=C===B,Z=w===B&&C!==null&&C!==B;return l.jsx(g.Box,{role:"listitem",draggable:!i,onDragStart:F(B),onDragOver:E(B),onDrop:_(B),onDragEnd:I,sx:L=>({userSelect:"none",cursor:i?"default":"grab",backgroundColor:"#F8F8FA",border:`1px solid ${Z?L.palette.primary.main:"#EBEBEB"}`,borderRadius:"8px",padding:L.spacing(1),opacity:q?.6:1,boxShadow:Z?`0 0 0 2px ${L.palette.primary.main}33`:"none"}),children:p?p(h,q):l.jsxs(g.Box,{sx:L=>({display:"flex",alignItems:"center",gap:L.spacing(1),minWidth:0}),children:[c&&l.jsx(mc,{}),s&&l.jsxs(g.Typography,{variant:"body2",sx:L=>({fontWeight:600,fontSize:14,color:`${L.palette.text.primary}`,flex:"0 0 auto"}),children:[B+1,"."]}),(()=>{const L=typeof f=="function"?f(h,B):f;return L?l.jsx(g.Chip,{label:L,sx:{borderRadius:"4px",p:"12px 3px"},size:"small"}):null})(),l.jsx(g.Typography,{variant:"body2",sx:L=>({fontSize:12,fontWeight:500,color:`${L.palette.text.primary}90`,flex:1,minWidth:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),children:o?o(h):""})]})},String(t(h)))}),!R&&d?typeof d=="string"?l.jsx(g.Typography,{variant:"caption",sx:h=>({color:`${h.palette.text.primary}60`}),children:d}):d:null]})}const Gh=yt(g.StepConnector)(({theme:e})=>{const t=e.palette.divider||"#E8E8E8",r=e.palette.primary.main;return{[`&.${g.stepConnectorClasses.vertical}`]:{marginLeft:11},[`& .${g.stepConnectorClasses.line}`]:{minHeight:28,borderLeftWidth:2,borderColor:t,transition:"border-color 0.3s ease"},[`&.${g.stepConnectorClasses.completed} .${g.stepConnectorClasses.line}`]:{borderColor:r}}}),Qh=({items:e,activeIndex:t=1,onStepClick:r,sx:n,completedSteps:i})=>{const a=tc(),o=a.palette.primary.main,s=a.palette.text.primary,c=a.palette.divider,p=a.palette.action&&a.palette.action.disabledBackground||"#E8E8E8",f=d=>{const{active:u,completed:x,icon:k}=d;return x?l.jsx(g.Box,{sx:{width:24,height:24,border:`1.2px solid ${o}`,borderRadius:"50%",backgroundColor:o,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(uo,{sx:{fontSize:16,fontWeight:600}})}):u?l.jsx(g.Box,{sx:{width:24,height:24,borderRadius:"50%",border:`1.2px solid ${o}`,backgroundColor:mt(o,.2),color:o,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12},children:k}):l.jsx(g.Box,{sx:{width:24,height:24,borderRadius:"50%",backgroundColor:p,color:s,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12},children:k})};return l.jsx(g.Stepper,{orientation:"vertical",activeStep:t,connector:l.jsx(Gh,{}),sx:{"& .MuiStepConnector-vertical":{my:-1.1},"& .MuiStepLabel-label":{fontSize:14,color:s,fontWeight:500},"& .MuiStep-root":{cursor:r?"pointer":"default"},...n},children:e.map((d,u)=>{const x=Array.isArray(i)&&i.length>0?i.includes(u):u<t;return l.jsxs(g.Step,{onClick:()=>r==null?void 0:r(u),completed:x,children:[l.jsx(g.StepLabel,{StepIconComponent:f,children:l.jsx(g.Typography,{sx:{fontSize:12,fontWeight:500,color:u===t?o:s},children:d.label})}),u!==e.length-1&&l.jsx(g.Divider,{sx:{ml:4.2,borderColor:c}})]},u)})})},fo=({colorKey:e="primary",colorHex:t,tone:r="soft",bgAlpha:n=.12,borderAlpha:i=.24,sx:a,...o})=>l.jsx(g.Chip,{...o,sx:s=>({fontWeight:600,borderRadius:"4px",height:18,border:`0.5px solid ${mt(t||s.palette.text.primary,.5)}`,backgroundColor:mt(t||s.palette.text.primary,.1),"& .MuiChip-label":{p:"8px",color:t||s.palette.text.primary,fontSize:10,fontWeight:500},...a})}),Zh=yt(g.StepConnector)(()=>({[`&.${g.stepConnectorClasses.vertical}`]:{marginLeft:11},[`& .${g.stepConnectorClasses.line}`]:{minHeight:28,borderLeftWidth:2,height:"70px",borderColor:"#E8E8E8",transition:"border-color 0.3s ease",zIndex:-1},[`&.${g.stepConnectorClasses.completed} .${g.stepConnectorClasses.line}`]:{borderColor:ye.primary.main}})),Xh=({items:e,activeIndex:t=1,onStepClick:r,sx:n})=>{const[i,a]=P.useState(null),o=s=>{const{active:c,completed:p,icon:f}=s;return p?l.jsx(g.Box,{sx:{width:24,height:24,border:`1.2px solid ${ye.primary.main}`,borderRadius:"50%",backgroundColor:ye.primary.main,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:l.jsx(uo,{sx:{fontSize:16,fontWeight:600}})}):c?l.jsx(g.Box,{sx:{width:24,height:24,borderRadius:"50%",border:`1.2px solid ${ye.primary.main}`,backgroundColor:mt(ye.primary.main,.2),color:ye.primary.main,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12,zIndex:1e3,overflow:"hidden"},children:f}):l.jsx(g.Box,{sx:{width:24,height:24,borderRadius:"50%",backgroundColor:"#E8E8E8",color:ye.text.primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12,zIndex:1e3},children:f})};return l.jsx(g.Stepper,{orientation:"vertical",activeStep:t,connector:l.jsx(Zh,{}),sx:{"& .MuiStepConnector-vertical":{my:-3.5},"& .MuiStepLabel-label":{fontSize:14,color:ye.text.primary,fontWeight:500},"& .MuiStep-root":{cursor:r?"pointer":"default"},...n},children:e.map((s,c)=>l.jsxs(g.Step,{onMouseEnter:()=>a(c),onMouseLeave:()=>a(null),onClick:()=>r==null?void 0:r(c),completed:c<t,children:[l.jsxs(g.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[l.jsxs(g.StepLabel,{StepIconComponent:o,children:[l.jsxs(g.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[l.jsx(g.Typography,{sx:{fontSize:14,fontWeight:500,color:c===t?ye.primary.main:ye.text.primary},children:s.label}),l.jsx(fo,{size:"small",colorHex:c<t?ye.success.main:c===t?"#973B00":ye.text.primary,label:c<t?"Completed":c===t?"In progress":"Not started"})]}),l.jsx(g.Typography,{sx:{fontSize:12,fontWeight:400,color:`${ye.text.primary}60`,mt:.5,width:"80%"},children:s.description})]}),i===c&&l.jsx(g.Button,{sx:{display:c>t?"none":"block"},variant:c<t?"outlined":"contained",size:"small",color:"primary",children:c<t?"Edit":c===t?"Complete":""})]}),c!==e.length-1&&l.jsx(g.Divider,{sx:{ml:4.2,borderColor:ye.divider}})]},c))})},Jh=ut(l.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined"),em=({variant:e="list",title:t,subtitle:r,text:n,items:i=[],icon:a,colorHex:o,sx:s})=>{const c=o||ye.info.main,p=mt(c,.08),f=mt(c,.08),d=a??l.jsx(Jh,{sx:{color:c,fontSize:18}});return e==="inlineInfo"?l.jsxs(g.Card,{sx:{p:1.5,display:"flex",alignItems:"center",gap:1,backgroundColor:p,border:`1px solid ${f}`,boxShadow:"none",...s},children:[l.jsx(g.Box,{sx:{display:"flex",alignItems:"center"},children:d}),l.jsx(g.Typography,{variant:"body2",sx:{fontWeight:400,fontSize:12,lineHeight:1.3,color:c},children:n})]}):e==="inline"?l.jsx(g.Card,{sx:{p:1.5,display:"flex",alignItems:"center",gap:1,backgroundColor:p,border:`1px solid ${f}`,boxShadow:"none",...s},children:l.jsx(g.Typography,{variant:"body2",sx:{fontWeight:400,fontSize:12,lineHeight:1.3,color:c},children:n})}):e==="listWithHeader"?l.jsxs(g.Card,{sx:{p:2,boxShadow:"none",borderRadius:"6px",backgroundColor:p,border:`1px solid ${f}`,...s},children:[l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d,l.jsx(g.Typography,{variant:"subtitle2",sx:{fontWeight:600,color:c,fontSize:14,lineHeight:1.3},children:t})]}),r&&l.jsx(g.Typography,{variant:"body2",sx:{mt:.5,color:c,fontSize:10,lineHeight:1.3},children:r}),l.jsx(g.List,{sx:{pl:5,"& .MuiListItem-root":{display:"list-item",listStyleType:"disc",color:c},"& .MuiListItemText-primary":{fontSize:"12px",fontWeight:400,lineHeight:"18px",color:c,my:-.5}},children:i.map((u,x)=>l.jsx(g.ListItem,{sx:{py:0},children:l.jsx(g.ListItemText,{primary:u})},x))})]}):l.jsx(g.Card,{sx:{p:"11px",borderRadius:"8px",backgroundColor:p,border:`0.5px solid ${f}`,boxShadow:"none",...s},children:l.jsx(g.List,{sx:{pl:4,"& .MuiListItem-root":{display:"list-item",listStyleType:"disc",color:c},"& .MuiListItemText-primary":{fontSize:"12px",fontWeight:600,lineHeight:"18px",color:c,my:-.5}},children:i.map((u,x)=>l.jsx(g.ListItem,{sx:{py:0},children:l.jsx(g.ListItemText,{primary:u})},x))})})},yc=({value:e,onChange:t,items:r,ariaLabel:n,sx:i,tabSx:a})=>l.jsxs(g.Box,{children:[l.jsx(g.Tabs,{value:e,onChange:(o,s)=>t(s),"aria-label":n||"Fin tabs",sx:{alignItems:"center",borderRadius:"6px",p:"10px",backgroundColor:"#FFFFFF","& .MuiTabs-flexContainer":{gap:1},"& .MuiTabs-indicator":{display:"none"},...i},children:r.map((o,s)=>{const c=typeof o.value=="string"||typeof o.value=="number"?o.value:s;return l.jsx(g.Tab,{value:c,disabled:o.disabled,label:l.jsx(g.Typography,{variant:"body2",children:o.label}),sx:p=>({px:2,textTransform:"none",color:p.palette.primary.main,boxShadow:"none",borderRadius:"3px",border:"0.5px solid #0000001A",backgroundColor:"#FFFFFF","&:hover":{backgroundColor:p.palette.action.hover},"&.Mui-selected":{color:p.palette.common.white,borderColor:p.palette.primary.main,backgroundColor:p.palette.primary.main,fontWeight:600},...a})},String(c))})}),r.map((o,s)=>{const c=typeof o.value=="string"||typeof o.value=="number"?o.value:s,p=o.content??(typeof o.value=="object"?o.value:null);return p&&e===c?l.jsx(g.Box,{sx:{mt:1},children:p},`panel-${c}`):null})]}),tm=ut(l.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline"),xc=({name:e,columns:t,initialRow:r,addLabel:n,maxRows:i,hideAddWhenMax:a,disableAddWhenMax:o=!0,showEmptyState:s=!0,rowDeletable:c=!0,control:p,sx:f,addActions:d,emptyTitle:u="No items configured",emptySubtitle:x="Click 'Add' to get started.",emptyCardSx:k,setValue:m,rowSelectionMode:C,rowSelectionKey:v})=>{const{fields:w,append:$,remove:F}=wu({control:p,name:e}),_=!(typeof i=="number"?w.length>=i:!1),I=P.useMemo(()=>{if(v)return v;const H=t.find(G=>G.type==="rowSelect");return H==null?void 0:H.key},[t,v]),R=ml({control:p,name:e})||[],Y=P.useMemo(()=>{if(!I)return{};const H={};return R.forEach((G,re)=>{H[re]=!!(G!=null&&G[I])}),H},[R,I]),h=P.useCallback(H=>Y[H]===!0,[Y]),B=P.useCallback((H,G)=>{if(!m||!I)return;const re=`${e}.${H}.${I}`;C==="single"&&G&&R.forEach((ce,D)=>{if(D!==H){const U=`${e}.${D}.${I}`;m(U,!1,{shouldDirty:!0})}}),m(re,G,{shouldDirty:!0})},[e,I,C,m,R]),q=H=>{const G={...H||r};t.forEach(re=>{re.value!==void 0&&G[re.key]===void 0&&(G[re.key]=typeof re.value=="function"?re.value(G,w.length):re.value)}),$(G)};P.useEffect(()=>{!s&&w.length===0&&_&&q()},[s,w.length,_]);const Z=P.useMemo(()=>t.reduce((G,re)=>{if(re.width==="auto"||re.width===void 0)return G+120;const ce=typeof re.width=="number"?re.width:typeof re.width=="string"&&parseInt(re.width)||160;return G+ce},0)+(c?100:0),[t,c]),L=H=>H.width==="auto"||H.width===void 0?{width:"auto",minWidth:120,maxWidth:"none"}:typeof H.width=="number"?{width:`${H.width}px`,minWidth:`${H.width}px`,maxWidth:`${H.width}px`}:typeof H.width=="string"?{width:H.width,minWidth:H.width}:{width:"160px",minWidth:"160px"};return l.jsx(g.Card,{sx:{width:"100%",borderRadius:"4px",boxShadow:"0px 0.783px 3.131px 0px rgba(0,0,0,0.16)",backgroundColor:"#FFFFFF",overflow:"visible",...f},children:w.length===0&&s?l.jsxs(g.Box,{sx:H=>({p:4,textAlign:"center",borderStyle:"dashed",borderColor:mt(H.palette.primary.main,.4),backgroundColor:mt(H.palette.primary.main,.04),borderWidth:1,borderRadius:"8px",...k}),children:[l.jsx(g.Typography,{variant:"subtitle1",sx:H=>({color:H.palette.primary.main,fontWeight:600,mb:.5,fontSize:14}),children:u}),l.jsx(g.Typography,{variant:"body2",sx:H=>({color:H.palette.primary.main,mb:2,fontSize:12,fontWeight:400}),children:x}),Array.isArray(d)&&d.length>0?d.map((H,G)=>l.jsx(g.Button,{variant:"outlined",size:"small",startIcon:l.jsx(yn,{}),sx:{mr:1,mt:1},onClick:()=>q(H.template),disabled:!_&&o,style:{display:!_&&a?"none":void 0},children:H.label},`empty-add-${G}`)):n&&l.jsx(g.Button,{variant:"outlined",size:"small",startIcon:l.jsx(yn,{}),onClick:()=>q(),disabled:!_&&o,style:{display:!_&&a?"none":void 0},children:n})]}):l.jsxs(l.Fragment,{children:[l.jsx(g.Box,{sx:{height:"45px",display:"flex",alignItems:"center",px:1.125,gap:1,py:1.25,borderBottom:"1px solid #E5E6EB"},children:Array.isArray(d)&&d.length>0?d.map((H,G)=>l.jsx(g.Button,{variant:G===0?"contained":"outlined",size:"small",startIcon:l.jsx(yn,{}),onClick:()=>q(H.template),sx:{borderRadius:"3px",fontSize:"10.938px",fontWeight:500,textTransform:"none",px:1.17,py:.586,minWidth:"90px","&:hover":{backgroundColor:G===0?"#04502d":void 0}},disabled:!_&&o,style:{display:!_&&a?"none":void 0},children:H.label},`add-${G}`)):n&&l.jsx(g.Button,{variant:"contained",size:"small",startIcon:l.jsx(yn,{}),onClick:()=>q(),sx:{backgroundColor:"#056739",color:"#FFFFFF",borderRadius:"3px",fontSize:"10.938px",fontWeight:500,textTransform:"none",px:1.17,py:.586,minWidth:"90px","&:hover":{backgroundColor:"#04502d"}},disabled:!_&&o,style:{display:!_&&a?"none":void 0},children:n})}),l.jsx(g.Box,{sx:{width:"100%",overflowX:"auto",overflowY:"auto",maxHeight:"600px","&::-webkit-scrollbar":{height:"8px",width:"8px"},"&::-webkit-scrollbar-track":{backgroundColor:"#f1f1f1"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#888",borderRadius:"4px","&:hover":{backgroundColor:"#555"}}},children:l.jsx(g.TableContainer,{sx:{width:"100%",minWidth:"100%"},children:l.jsxs(g.Table,{stickyHeader:!0,sx:{minWidth:`${Z||650}px`},children:[l.jsx(g.TableHead,{children:l.jsxs(g.TableRow,{children:[t.map(H=>l.jsx(g.TableCell,{sx:{backgroundColor:"#F2F3F5",borderBottom:"1.756px solid #E5E6EB",fontWeight:500,fontSize:"12px",color:"#6B7785",whiteSpace:"nowrap",height:"43px",px:1.75,py:0,...L(H)},children:H.header},H.key)),c&&l.jsx(g.TableCell,{sx:{backgroundColor:"#F2F3F5",borderBottom:"1.756px solid #E5E6EB",fontWeight:500,fontSize:"12px",color:"#6B7785",whiteSpace:"nowrap",height:"43px",px:1.75,py:0,width:100,textAlign:"center"},children:"Actions"})]})}),l.jsx(g.TableBody,{children:w.map((H,G)=>{const re=h(G),ce=C&&!re;return l.jsxs(g.TableRow,{children:[t.map(D=>{var pe;const U=`${e}.${G}.${D.key}`,X=D.type==="rowSelect"||D.key===I,ue=X?!1:ce?!0:typeof D.disabled=="function"?D.disabled(H,G):!!D.disabled;if(D.type==="index"){const te=D.indexFormat?D.indexFormat(G):`#${G+1}`;return l.jsx(g.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",textAlign:((pe=D.cellSx)==null?void 0:pe.textAlign)||"center",...L(D),...D.cellSx},children:te},D.key)}if(D.value!==void 0&&D.editable===!1){const te=typeof D.value=="function"?D.value(H,G):D.value;return l.jsx(g.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",...L(D),...D.cellSx},children:te},D.key)}const fe=D.endorsementText?typeof D.endorsementText=="function"?D.endorsementText(H,G):D.endorsementText:void 0;return l.jsx(g.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",...L(D),...D.cellSx},children:D.type==="rowSelect"||X&&D.type==="checkbox"?l.jsx(Re,{name:U,control:p,defaultValue:!1,render:({field:te})=>l.jsx(Ut,{label:"",checked:!!te.value,disabled:!1,onChange:W=>{te.onChange(W),B(G,W)},sx:D.sx})}):D.type==="checkbox"?l.jsx(Re,{name:U,control:p,render:({field:te})=>l.jsx(Ut,{label:"",checked:!!te.value,disabled:ue,onChange:te.onChange,sx:D.sx})}):D.type==="select"?l.jsx(Re,{name:U,control:p,render:({field:te})=>l.jsx(Di,{...te,fullWidth:!0,disabled:ue,options:D.options||[],size:"small",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...D.sx},helperText:D.helperText,required:D.required})}):D.type==="date"?l.jsx(Re,{name:U,control:p,defaultValue:D.value!==void 0?typeof D.value=="function"?D.value(H,G):D.value:void 0,render:({field:te})=>(P.useEffect(()=>{if(m&&(te.value===void 0||te.value===null||te.value==="")&&D.value!==void 0){const W=typeof D.value=="function"?D.value(H,G):D.value;m(U,W,{shouldValidate:!1})}},[U,te.value,D.value,H,G,m]),l.jsx(po,{...te,fullWidth:!0,disabled:ue,size:"small",placeholder:D.placeholder||"DD/MM/YYYY",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...D.sx},helperText:D.helperText,required:D.required}))}):l.jsx(Re,{name:U,control:p,defaultValue:D.value!==void 0?typeof D.value=="function"?D.value(H,G):D.value:void 0,render:({field:te})=>(P.useEffect(()=>{if(m&&(te.value===void 0||te.value===null||te.value==="")&&D.value!==void 0){const W=typeof D.value=="function"?D.value(H,G):D.value;m(U,W,{shouldValidate:!1})}},[U,te.value,D.value,H,G,m]),l.jsx(vt,{...te,fullWidth:!0,type:D.type==="number"?"number":"text",placeholder:D.placeholder,disabled:ue,size:"small",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...D.sx},helperText:D.helperText,required:D.required,endorsementText:fe,endorsementBg:D.endorsementBg,endorsementColor:D.endorsementColor,endorsementRadius:D.endorsementRadius,endorsementHeight:D.endorsementHeight,endorsementPaddingX:D.endorsementPaddingX,inputProps:{...D.type==="number"?{min:D.min,max:D.max,step:D.step}:{minLength:D.minLength,maxLength:D.maxLength,pattern:D.pattern}}}))})},D.key)}),c&&l.jsx(g.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",px:1.5,py:0,borderBottom:"1px solid #E5E6EB",textAlign:"center"},children:l.jsx(g.IconButton,{size:"small",color:"error",onClick:()=>F(G),sx:{width:"20px",height:"20px"},children:l.jsx(tm,{sx:{fontSize:"20px"}})})})]},H.id)})})]})})})]})})},vc=({name:e,control:t,items:r,sx:n,cardSx:i})=>l.jsx(g.Box,{sx:{display:"flex",flexDirection:"column",gap:1,...n},children:r.map(a=>{const o=!!a.leftAction,s=!!a.rightAction,c=!!(a.header||a.chipText),p=a.leftAction,f=a.rightAction;return l.jsxs(g.Box,{sx:{border:"1px solid #DDDDDD",borderRadius:"8px",height:"40px",display:"flex",alignItems:"center",justifyContent:"space-between",px:1,...i},children:[o&&p&&l.jsx(g.Box,{sx:{display:"flex",alignItems:"center",gap:1,flexShrink:0},children:l.jsx(Re,{name:p.name,control:t,defaultValue:!1,render:({field:d})=>l.jsx(Ut,{label:p.label||"",checked:!!d.value,onChange:d.onChange,sx:{margin:0}})})}),c&&l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:1,flex:o||s?1:"none",ml:o?1:0},children:[a.header&&l.jsx(g.Typography,{variant:"body2",sx:{fontSize:"12px",color:"rgba(0,0,0,0.87)",fontWeight:400},children:a.header}),a.chipText&&l.jsx(g.Box,{sx:{bgcolor:"rgba(26,26,26,0.1)",px:1.5,py:.375,borderRadius:"4px",fontSize:"12px",color:"rgba(26,26,26,0.8)"},children:a.chipText})]}),s&&f&&l.jsx(g.Box,{sx:{display:"flex",alignItems:"center",gap:.5,flexShrink:0,ml:"auto"},children:l.jsx(Re,{name:f.name,control:t,defaultValue:!1,render:({field:d})=>l.jsx(fi,{label:f.label,checked:!!d.value,onChange:d.onChange,sx:{margin:0}})})}),!o&&!s&&!c&&l.jsx(g.Box,{sx:{width:"100%",height:"100%"}})]},a.id)})}),bc=ut(l.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),na=ut(l.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutline"),rm=[{label:"Interest-only",value:"interest-only"},{label:"Principal moratorium",value:"principal-moratorium"},{label:"EMI",value:"emi"},{label:"Equal-principal",value:"equal-principal"},{label:"Balloon",value:"balloon"},{label:"Bullet",value:"bullet"},{label:"Step-up/Down",value:"step-up-down"},{label:"Seasonal skips",value:"seasonal-skips"},{label:"Custom fixed installment",value:"custom-fixed"},{label:"Full payment holiday (no billing)",value:"payment-holiday"}],ia=[{label:"Accrue & capitalize at end of phase",value:"accrue-capitalize"},{label:"Accrue & bill in first period after phase",value:"accrue-bill-next"},{label:"Accrue & forgive at phase end",value:"accrue-forgive"}],nm=({phase:e,index:t,onUpdate:r,onDelete:n,months:i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],disabled:a=!1,sx:o})=>{const[s,c]=P.useState(e.seasonalMonths||[]),p=u=>{const x=s.includes(u)?s.filter(k=>k!==u):[...s,u];c(x),r(e.id,{seasonalMonths:x})},f=(()=>{const u=e.min||0;return u<0?"Min cannot be negative.":Number.isInteger(u)?null:"Use whole periods."})(),d=(()=>{const u=e.min||0,x=e.max||0;return Number.isInteger(x)?x<u?"Max must be ≥ Min.":null:"Use whole periods."})();return l.jsx(g.Card,{sx:{border:"2px solid",borderColor:ye.divider,position:"relative",...o},children:l.jsxs(g.CardContent,{sx:{p:2},children:[l.jsxs(g.Box,{sx:{mb:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs(g.Box,{sx:{display:"flex",gap:.5,alignItems:"center"},children:[l.jsx(g.Box,{children:l.jsx(mc,{})}),l.jsx(fo,{label:t+1,size:"small"})]}),l.jsx(g.IconButton,{onClick:()=>n(e.id),disabled:a,sx:{color:ye.error.main,"&:hover":{bgcolor:Qn[50]}},size:"small",children:l.jsx(bc,{fontSize:"small"})})]}),l.jsx(g.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:l.jsxs(g.Box,{sx:{flex:1,display:"grid",gap:1.5},children:[l.jsxs(g.Box,{sx:{display:"flex",gap:2,mb:.5},children:[l.jsx(g.Box,{sx:{flex:.5,display:"grid",gap:1},children:l.jsx(Di,{labelText:"Phase type",value:e.type,onChange:u=>r(e.id,{type:u.target.value}),options:rm,disabled:a})}),l.jsxs(g.Box,{sx:{display:"grid",gap:1,flex:.5},children:[l.jsx(g.Typography,{variant:"caption",sx:{fontSize:"12px",color:ye.text.secondary},children:"Allocation priority (1–9)"}),l.jsx(vt,{type:"number",value:e.priority||5,onChange:u=>{const x=parseInt(u.target.value)||5;r(e.id,{priority:Math.min(9,Math.max(1,x))})},inputProps:{min:1,max:9},disabled:a,sx:{textAlign:"center"}})]})]}),l.jsxs(g.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[l.jsx(g.Box,{sx:{display:"grid",gap:1},children:l.jsx(vt,{labelText:"Min periods",type:"number",value:e.min||0,onChange:u=>{const x=parseInt(u.target.value)||0;r(e.id,{min:x,...e.lockLength?{max:x}:{}})},inputProps:{min:0},disabled:a,error:!!f,helperText:f||void 0})}),l.jsx(g.Box,{sx:{display:"grid",gap:1},children:l.jsx(vt,{labelText:"Max periods",type:"number",value:e.lockLength?e.min:e.max||0,onChange:u=>r(e.id,{max:parseInt(u.target.value)||0}),inputProps:{min:0},disabled:a||e.lockLength,error:!!d&&!e.lockLength,helperText:e.lockLength?"Locked to Min":d||void 0,sx:e.lockLength?{opacity:.5}:{}})})]}),l.jsxs(g.Box,{sx:{display:"flex",gap:3},children:[l.jsx(Ut,{label:"Lock length (fix to Min)",checked:e.lockLength||!1,onChange:u=>r(e.id,{lockLength:u,...u?{max:e.min}:{}}),disabled:a}),l.jsx(Ut,{label:"Residual fill",checked:e.residualFill||!1,onChange:u=>r(e.id,{residualFill:u}),disabled:a})]}),e.type==="principal-moratorium"&&l.jsxs(g.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(g.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(g.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(na,{sx:{fontSize:14,color:ye.text.secondary,cursor:"help"}})})]}),l.jsx(wr,{value:e.interestPolicy||"accrue-capitalize",onChange:u=>r(e.id,{interestPolicy:u}),options:ia,labelPosition:"none"}),e.interestPolicy==="accrue-forgive"&&l.jsx(g.Typography,{variant:"caption",sx:{color:ye.text.secondary,mt:1},children:"Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."})]}),e.type==="balloon"&&l.jsxs(g.Box,{sx:{display:"grid",gap:1.5},children:[l.jsx(wr,{value:e.balloonType||"percent",onChange:u=>r(e.id,{balloonType:u}),options:[{label:"Amount",value:"amount"},{label:"Percent",value:"percent"}],row:!0,labelPosition:"none"}),e.balloonType==="amount"&&l.jsx(vt,{labelText:"Balloon Amount",type:"number",value:e.balloonAmount||"",onChange:u=>r(e.id,{balloonAmount:parseFloat(u.target.value)||0}),placeholder:"Enter amount",disabled:a}),e.balloonType==="percent"&&l.jsx(vt,{labelText:"Balloon Percent",type:"number",value:e.balloonPercent||"",onChange:u=>r(e.id,{balloonPercent:parseFloat(u.target.value)||0}),placeholder:"Enter percent",inputProps:{max:100},disabled:a})]}),e.type==="bullet"&&l.jsx(g.Typography,{variant:"caption",sx:{color:ye.text.secondary},children:"Principal at maturity"}),e.type==="step-up-down"&&l.jsxs(g.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[l.jsx(vt,{labelText:"Step Percent",type:"number",value:e.stepPercent||"",onChange:u=>r(e.id,{stepPercent:parseFloat(u.target.value)||0}),placeholder:"e.g., 10",disabled:a}),l.jsx(vt,{labelText:"Every N periods",type:"number",value:e.stepEveryN||"",onChange:u=>r(e.id,{stepEveryN:parseInt(u.target.value)||0}),placeholder:"e.g., 6",disabled:a})]}),e.type==="seasonal-skips"&&l.jsxs(g.Box,{sx:{display:"grid",gap:1.5},children:[l.jsxs(g.Box,{sx:{display:"grid",gap:1},children:[l.jsx(g.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Skip Months"}),l.jsx(g.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:i.map(u=>l.jsx(g.Chip,{label:u,size:"small",onClick:()=>!a&&p(u),sx:{cursor:a?"default":"pointer",bgcolor:s.includes(u)?ye.primary.main:"transparent",color:s.includes(u)?ye.primary.contrastText:ye.text.primary,border:`1px solid ${ye.divider}`,"&:hover":{bgcolor:s.includes(u)?Qn[600]:Qn[50]}}},u))})]}),l.jsxs(g.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(g.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(g.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(na,{sx:{fontSize:14,color:ye.text.secondary,cursor:"help"}})})]}),l.jsx(wr,{value:e.interestPolicy||"accrue-capitalize",onChange:u=>r(e.id,{interestPolicy:u}),options:ia,labelPosition:"none"}),e.interestPolicy==="accrue-forgive"&&l.jsx(g.Typography,{variant:"caption",sx:{color:ye.text.secondary},children:"Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."})]})]}),e.type==="custom-fixed"&&l.jsx(vt,{labelText:"Fixed Installment Amount",type:"number",value:e.customAmount||"",onChange:u=>r(e.id,{customAmount:parseFloat(u.target.value)||0}),placeholder:"Enter amount",disabled:a}),e.type==="payment-holiday"&&l.jsxs(g.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(g.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(g.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(na,{sx:{fontSize:14,color:ye.text.secondary,cursor:"help"}})})]}),l.jsx(wr,{value:e.holidayInterestTreatment||"accrue-capitalize",onChange:u=>r(e.id,{holidayInterestTreatment:u}),options:ia,labelPosition:"none"}),e.holidayInterestTreatment==="accrue-forgive"&&l.jsx(g.Typography,{variant:"caption",sx:{color:ye.text.secondary},children:"Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."})]})]})})]})})};async function wc(e,t,r,n){try{const{endpoint:i,method:a="GET",valueField:o="value",labelField:s="label",headers:c={},params:p={},body:f,transform:d,passThroughFields:u}=e;let x=i;if(t&&!i.startsWith("http")&&(x=`${t}${i.startsWith("/")?i:`/${i}`}`),n){const F=/\{([^}]+)\}/g;x=x.replace(F,(E,_)=>{const I=n[_];return I!=null?encodeURIComponent(String(I)):""}),x=x.replace(/\?&/g,"?").replace(/&&/g,"&").replace(/\?$/g,"")}const k=new URLSearchParams;Object.entries(p).forEach(([F,E])=>{E!=null&&k.append(F,String(E))}),k.toString()&&(x+=`${x.includes("?")?"&":"?"}${k.toString()}`);try{const F=/^https?:\/\//i.test(x),E=new URL(x,F?void 0:"http://local.placeholder"),_=Array.from(E.searchParams.entries());for(const[I,R]of _)(R===""||R==="undefined"||R==="null")&&E.searchParams.delete(I);F?x=E.toString():x=E.pathname+(E.search?E.search:""),x=x.replace(/\?&/g,"?").replace(/&&/g,"&").replace(/\?$/g,"")}catch{}const m={"Content-Type":"application/json",...r,...c},C={method:a,headers:m};(a==="POST"||a==="PUT")&&f&&(C.body=JSON.stringify(f));const v=await fetch(x,C);if(!v.ok)throw new Error(`API request failed: ${v.status} ${v.statusText}`);const w=await v.json();if(d)return d(Array.isArray(w)?w:w.data||w);const $=Array.isArray(w)?w:w.data||w;if(!Array.isArray($))throw new Error("API response is not an array");return $.map(F=>{const E={label:F[s]||F.name||F.title||String(F[o]||""),value:F[o]||F.id||F.value||""},_=Array.isArray(u)?u:void 0;if(Array.isArray(_))for(const I of _)F[I]!==void 0&&(E[I]=F[I]);return E})}catch(i){throw console.error("API fetch error:",i),new Error(`Failed to fetch data: ${i instanceof Error?i.message:"Unknown error"}`)}}function Sc(e,t,r,n,i=!1){const a=P.useMemo(()=>{if(!(e!=null&&e.dependsOn)||!n)return null;const s=n[e.dependsOn];return s!==void 0?s:null},[e==null?void 0:e.dependsOn,n]),o=P.useMemo(()=>["api-data",e==null?void 0:e.endpoint,e==null?void 0:e.method,e==null?void 0:e.valueField,e==null?void 0:e.labelField,t,a,n?JSON.stringify(n):null],[e==null?void 0:e.endpoint,e==null?void 0:e.method,e==null?void 0:e.valueField,e==null?void 0:e.labelField,t,a,n]);return op({queryKey:o,queryFn:()=>{if(!e)throw new Error("API config is required");return wc(e,t,r,n)},enabled:i&&!!e,staleTime:15*60*1e3,gcTime:30*60*1e3,retry:3,retryDelay:s=>Math.min(1e3*2**s,3e4),refetchOnWindowFocus:!1,refetchOnReconnect:!0,refetchOnMount:!1})}function yr(e){return!!(e.apiConfig||e.api_endpoint)}function ho(e){return e.apiConfig?e.apiConfig:e.api_endpoint?{endpoint:e.api_endpoint,method:e.api_method||"GET",valueField:e.value_field||"value",labelField:e.label_field||"label",dependsOn:e.depends_on,conditional:e.conditional}:null}function im(e,t){const r=ho(e);if(!(r!=null&&r.conditional)&&!e.conditional)return!0;if(r!=null&&r.dependsOn||e.depends_on){const n=(r==null?void 0:r.dependsOn)||e.depends_on;if(n){const i=t[n];return i!=null&&i!==""}}return!0}const mo=({field:e,control:t,errors:r,baseUrl:n,apiHeaders:i,formData:a,setValue:o})=>{const s=r[e.name],c=!!s,[p,f]=P.useState(!1),d=P.useRef(!1),[u,x]=P.useState(!1),[k,m]=P.useState(!1),[C,v]=P.useState(!1),w=P.useRef(null),$=P.useRef(null),F=()=>{var ae;const W=e.required;if(typeof W=="function")try{return!!W(a||{})}catch{return!1}if(W!==void 0)return!!W;const Q=(ae=e.validation)==null?void 0:ae.required;if(typeof Q=="function")try{return!!Q(a||{})}catch{return!1}return Q!==void 0?!!Q:!1},E=W=>F()?`${W} *`:W,_=()=>{if(e.value!==void 0){if(typeof e.value=="function")try{return e.value(a||{})}catch{return""}return e.value}return e.type==="checkbox"?!1:e.type==="select"&&e.default?e.default:e.type==="autocomplete"&&e.multiple?[]:""},I=P.useRef(void 0);P.useEffect(()=>{const W=e.value;if(typeof W!="function"||!o)return;let Q;try{Q=W(a||{})}catch{return}const ae=a?a[e.name]:void 0;if(I.current===void 0&&(I.current=Q),ae===void 0||ae===I.current)try{o(e.name,Q,{shouldValidate:!0,shouldDirty:!1}),I.current=Q}catch{}},[JSON.stringify(Array.isArray(e.valueDeps)&&a?e.valueDeps.reduce((W,Q)=>({...W,[Q]:a[Q]}),{}):a||{}),e.name]);const R=P.useMemo(()=>{const W=ho(e);return W&&Array.isArray(e.passThroughFields)&&(W.passThroughFields=e.passThroughFields),W},[e.apiConfig,e.api_endpoint,e.api_method,e.value_field,e.label_field,e.depends_on,e.conditional,e.passThroughFields]),Y=P.useRef(null),h=R!=null&&R.dependsOn?a==null?void 0:a[R.dependsOn]:null;P.useEffect(()=>{R!=null&&R.dependsOn&&(Y.current=h)},[R==null?void 0:R.dependsOn,h]);const B=P.useMemo(()=>{const W=e.showWhen;if(typeof W=="function")try{return!!W(a||{})}catch{return!0}if(W&&typeof W=="object"){const Q=W.field,ae=W.equals,se=W.in,le=Q?(a||{})[Q]:void 0;if(Q&&typeof ae<"u")return le===ae;if(Q&&Array.isArray(se))return se.includes(le)}return!0},[e.showWhen,a]),q=P.useCallback(()=>{const W=e.dynamicEndorsement;if(typeof W=="function")try{return W(a||{})}catch{return e.endorsementText}return e.endorsementText},[e,a]),Z=P.useCallback(()=>{const W=e.endAdornment,Q=e.endAdornmentSwitch,ae=e.endAdornmentCheckbox;if(Q)return l.jsx(Re,{name:Q,control:t,defaultValue:e.endAdornmentSwitchDefault??!1,render:({field:se})=>l.jsx(g.Switch,{checked:se.value||!1,onChange:le=>{se.onChange(le.target.checked),e.endAdornmentSwitchOnChange&&e.endAdornmentSwitchOnChange(le.target.checked,a,o)},disabled:e.endAdornmentSwitchDisabled,size:e.endAdornmentSwitchSize||"small",sx:e.endAdornmentSwitchSx})});if(ae)return l.jsx(Re,{name:ae,control:t,defaultValue:e.endAdornmentCheckboxDefault??!1,render:({field:se})=>l.jsx(Ut,{label:"",checked:se.value||!1,onChange:se.onChange,disabled:e.endAdornmentCheckboxDisabled,sx:e.endAdornmentCheckboxSx})});if(typeof W=="function")try{return W(a||{},{control:t,setValue:o})}catch{return}return W},[e,a,t,o]),L=P.useMemo(()=>p&&yr(e)&&(!(R!=null&&R.dependsOn)||h),[p,e,R==null?void 0:R.dependsOn,h]),H=P.useMemo(()=>{const W={};if(!a)return W;const Q=(R==null?void 0:R.endpoint)||(e==null?void 0:e.api_endpoint);if(Q&&typeof Q=="string"){const ae=Q.match(/\{([^}]+)\}/g)||[];for(const se of ae){const le=se.slice(1,-1),be=a[le];be!==void 0&&(W[le]=be)}}if(R!=null&&R.dependsOn){const ae=R.dependsOn,se=a[ae];se!==void 0&&(W[ae]=se)}return W},[R==null?void 0:R.endpoint,e==null?void 0:e.api_endpoint,R==null?void 0:R.dependsOn,a]),{data:G=[],isLoading:re,error:ce}=Sc(R,n,i,H,L),D=P.useCallback(()=>{yr(e)&&!d.current&&(d.current=!0,f(!0))},[e]),U=P.useCallback(()=>{yr(e)&&!d.current&&(d.current=!0,f(!0))},[e]);P.useEffect(()=>{if(yr(e)&&!d.current){const W=a==null?void 0:a[e.name];W!=null&&W!==""&&(d.current=!0,f(!0))}},[e,a]),P.useEffect(()=>{yr(e)&&(R!=null&&R.dependsOn)&&(h!=null&&`${h}`!=""?(d.current=!0,f(!0)):(d.current=!1,f(!1)))},[R==null?void 0:R.dependsOn,h]);const X=P.useCallback(W=>{if(typeof W=="function")try{const Q=W(a||{});return X(Q)}catch{return[]}return W?Array.isArray(W)?W.map(Q=>{if(Q&&typeof Q=="object"){const ae=Q.value??Q.id??Q.key??void 0,se=Q.label??Q.name??Q.title??(ae!==void 0?String(ae):"");return{label:String(se??""),value:String(ae??se??"")}}return{label:String(Q),value:String(Q)}}):typeof W=="object"?Object.keys(W).map(Q=>({value:String(Q),label:String(W[Q])})):[]:[]},[a]),ue=P.useCallback(()=>yr(e)?Array.isArray(G)?G:[]:e.type==="select"||e.type==="toggle"||e.type==="radio"||e.type==="autocomplete"?X(e.options):[],[e,G,X]),fe=()=>{var W,Q,ae,se,le,be;switch(e.type){case"title":return l.jsx(g.Typography,{variant:e.variant||"h4",component:"h1",color:e.color,align:e.align||"left",sx:{mb:3,fontWeight:600,...e.sx},children:e.label});case"section":return l.jsx(g.Typography,{variant:e.variant||"h6",component:"h3",color:e.color,align:e.align||"left",sx:{mb:2,fontWeight:600,color:"text.primary",...e.sx},children:e.label});case"finuiHeader":const J=e.actionName,Ie=e.actionComponent,Ke=e.actionLabel,Ze=j=>l.jsx(hc,{title:e.title||e.label,subtitle:e.subtitle,align:e.align||"left",sx:e.sx,actions:j??e.actions}),Tt=j=>{if(e.cardWrap){const M={...{px:2,py:1,boxShadow:"none",border:"1px solid #DDDDDD"},...e.cardSx};return l.jsx(g.Card,{sx:M,...e.cardProps,children:j})}return j};return Tt(J&&Ie?l.jsx(Re,{name:J,control:t,defaultValue:e.value??!1,render:({field:j})=>Ze(Ie==="switch"?l.jsx(fi,{label:Ke,checked:!!j.value,onChange:j.onChange}):l.jsx(Ut,{label:Ke||"",checked:!!j.value,onChange:j.onChange}))}):Ze());case"tabs":return l.jsx(Re,{name:e.name,control:t,defaultValue:e.defaultValue??(typeof((Q=(W=e.items)==null?void 0:W[0])==null?void 0:Q.value)=="string"||typeof((se=(ae=e.items)==null?void 0:ae[0])==null?void 0:se.value)=="number"?(be=(le=e.items)==null?void 0:le[0])==null?void 0:be.value:0),render:({field:j})=>{const y=e.items||[],M=y.map((z,K)=>({label:z.label,value:typeof z.value=="string"||typeof z.value=="number"?z.value:K,content:z.content,disabled:z.disabled})),b=j.value,A=(()=>{if(typeof b=="string"||typeof b=="number"){const z=y.findIndex((K,de)=>typeof K.value=="string"||typeof K.value=="number"?K.value===b:de===b);return z>=0?z:0}return Number(b)||0})(),V=y[A]||{};return l.jsxs(g.Box,{children:[l.jsx(yc,{value:j.value,onChange:j.onChange,items:M,ariaLabel:e.ariaLabel||e.label,sx:e.sx,tabSx:e.tabSx}),Array.isArray(V.fields)&&V.fields.length>0&&(()=>{const z=V.fields,K=[];let de=[];for(const me of z)me.type==="section"&&de.length>0?(K.push(de),de=[me]):de.push(me);de.length>0&&K.push(de);const ge={p:2,boxShadow:"0px 1px 4px 0px #00000029",background:"#FFFFFF",borderRadius:"6px",display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,width:"100%",mt:1};return l.jsx(g.Box,{sx:{mt:1},children:K.map((me,Ne)=>{const Oe=me.find(Me=>Me.type==="section"),it=(Oe==null?void 0:Oe.cardWrap)!==!1,pt=l.jsx(l.Fragment,{children:me.map(Me=>{const ne=Me.showWhen;if(ne)try{if(typeof ne=="function"){if(!ne(a||{}))return null}else if(typeof ne=="object"){const Kt=ne.field,vo=ne.equals,bo=ne.in,wo=Kt?(a||{})[Kt]:void 0;if(Kt&&typeof vo<"u"&&wo!==vo||Kt&&Array.isArray(bo)&&!bo.includes(wo))return null}}catch{}const Ge=Math.min(Math.max(Me.col??12,1),12);return l.jsx(g.Box,{sx:{gridColumn:`span ${Ge}`},children:l.jsx(mo,{field:Me,control:t,errors:r,baseUrl:n,apiHeaders:i,formData:a,setValue:o})},Me.name)})});return it?l.jsx(g.Card,{sx:{...ge,...(Oe==null?void 0:Oe.cardSx)||{}},...(Oe==null?void 0:Oe.cardProps)||{},children:pt},`tab-group-${Ne}`):l.jsx(g.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,width:"100%",mt:1},children:pt},`tab-group-${Ne}`)})})})()]})}});case"grid":const Ye=e.defaultRows||[];return l.jsx(g.Box,{children:l.jsx(Re,{name:e.name,control:t,defaultValue:Ye.length>0?Ye:_()||[],render:()=>l.jsx(xc,{name:e.name,columns:e.columns||[],initialRow:e.initialRow||{},addLabel:e.addLabel,showEmptyState:e.showEmptyState,maxRows:e.maxRows,hideAddWhenMax:e.hideAddWhenMax,disableAddWhenMax:e.disableAddWhenMax,rowDeletable:e.rowDeletable!==!1,control:t,setValue:o,addActions:e.addActions,emptyTitle:e.emptyTitle,emptySubtitle:e.emptySubtitle,emptyCardSx:e.emptyCardSx,sx:e.sx,rowSelectionMode:e.rowSelectionMode,rowSelectionKey:e.rowSelectionKey})})});case"listcards":return l.jsx(vc,{name:e.name,control:t,items:e.items||[],sx:e.sx,cardSx:e.cardSx});case"dragdroplist":return l.jsx(Re,{name:e.name,control:t,defaultValue:e.items||[],render:({field:j})=>{const y=e,M=j.value||y.items||[],b=typeof y.getId=="function"?y.getId:typeof y.getId=="string"?z=>z[y.getId]:z=>z.id??z._id??z.key??String(z),A=typeof y.getText=="function"?y.getText:typeof y.getText=="string"?z=>z[y.getText]??String(z):z=>z.text??z.label??z.name??z.title??String(z),V=(()=>{if(typeof y.chipText=="function")return y.chipText;if(typeof y.chipText=="string")return M.length>0&&M[0]&&y.chipText in M[0]?(z,K)=>z[y.chipText]??void 0:y.chipText})();return l.jsx(gc,{items:M,getId:b,onReorder:z=>{j.onChange(z)},header:y.header,disabled:e.disabled,sx:y.sx,chipText:V,helperText:y.helperText||(c?s==null?void 0:s.message:void 0),getText:A,showIndex:y.showIndex!==!1,showLeftIcon:y.showLeftIcon!==!1,renderItem:y.renderItem})}});case"text":case"email":case"password":case"tel":case"textarea":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>e.type==="textarea"?l.jsx(fc,{...j,labelText:e.labelPosition==="top"?E(e.label):void 0,label:e.labelPosition!=="top"?E(e.label):void 0,labelVariant:e.labelVariant,placeholder:e.placeholder,disabled:e.disabled,hasError:c,helperText:(s==null?void 0:s.message)||e.helperText}):l.jsx(vt,{...j,id:e.id,labelText:e.labelPosition==="top"?E(e.label):void 0,label:e.labelPosition!=="top"?E(e.label):void 0,endAdornment:Z(),endorsementText:q(),endorsementBg:e.endorsementBg,endorsementColor:e.endorsementColor,endorsementRadius:e.endorsementRadius,endorsementHeight:e.endorsementHeight,endorsementPaddingX:e.endorsementPaddingX,labelVariant:e.labelVariant,type:e.type==="password"?u?"text":"password":e.type,placeholder:e.placeholder,disabled:e.disabled,hasError:c,helperText:(s==null?void 0:s.message)||e.helperText,InputProps:e.type==="password"?{endAdornment:l.jsx(nc,{position:"end",children:l.jsx(Gn,{"aria-label":"toggle password visibility",onClick:()=>x(y=>!y),edge:"end",children:u?l.jsx(_s,{}):l.jsx(Os,{})})})}:void 0})});case"number":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(vt,{...j,id:e.id,labelText:e.labelPosition==="top"?E(e.label):void 0,label:e.labelPosition!=="top"?E(e.label):void 0,endAdornment:Z(),endorsementText:q(),endorsementBg:e.endorsementBg,endorsementColor:e.endorsementColor,endorsementRadius:e.endorsementRadius,endorsementHeight:e.endorsementHeight,endorsementPaddingX:e.endorsementPaddingX,labelVariant:e.labelVariant,type:"number",placeholder:e.placeholder,disabled:e.disabled,hasError:c,helperText:(s==null?void 0:s.message)||e.helperText,inputProps:{min:e.min,max:e.max}})});case"select":const We=ue();return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>{const y=typeof e.disabled=="function"?!!e.disabled(a||{}):!!e.disabled,M=e.disableWhenEmptyOptions===!0&&Array.isArray(We)&&We.length===0,b=y||M||re,A=j.value,V=(()=>{if(Array.isArray(We)&&We.length>0){const z=We.find(K=>String(K==null?void 0:K.value)===String(A));return z?z.value:A}return A})();return l.jsx(Di,{labelText:e.labelPosition==="top"?E(e.label):void 0,label:e.labelPosition!=="top"&&e.labelPosition!=="none"?E(e.label):void 0,labelVariant:e.labelVariant,value:V,onChange:j.onChange,options:We,disabled:b,placeholder:e.labelPosition==="inner"||e.labelPosition==="none"||!e.labelPosition?e.placeholder||(e.labelPosition==="none"?E(e.label):void 0):e.placeholder,loading:re,error:c||!!ce,helperText:(s==null?void 0:s.message)||(ce==null?void 0:ce.message)||e.helperText,onOpen:D})}});case"checkbox":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(Ut,{label:E(e.label),checked:!!j.value,disabled:e.disabled,onChange:j.onChange})});case"toggle":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(wr,{label:E(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:j.value,options:e.options||[],row:!0,onChange:j.onChange})});case"radio":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(wr,{label:E(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:j.value,options:e.options||[],row:e.row===!0,groupPadding:e.groupPadding,itemGap:e.itemGap,helperText:e.helperText,onChange:j.onChange})});case"checkboxGroup":return l.jsx(Re,{name:e.name,control:t,defaultValue:_()||[],render:({field:j})=>l.jsx(dc,{label:E(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:Array.isArray(j.value)?j.value:[],options:e.options||[],row:e.row,groupPadding:e.groupPadding,itemGap:e.itemGap,helperText:e.helperText,onChange:j.onChange,disabled:e.disabled})});case"switch":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(fi,{label:E(e.label),checked:!!j.value,disabled:e.disabled,onChange:j.onChange})});case"autocomplete":const Ue=ue(),S=!!((typeof e.disabled=="function"?e.disabled(a||{},{options:Ue,isLoading:re,error:ce}):e.disabled)||e.disableWhenEmptyOptions===!0&&Array.isArray(Ue)&&Ue.length===0||re||R!=null&&R.dependsOn&&!h);return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>{const y=j.value,M=e.multiple===!0,b=(R==null?void 0:R.valueField)||e.value_field||"value",A=z=>{if(z!=null){if(typeof z=="string"||typeof z=="number")return z;if(typeof z=="object"){if(z[b]!==void 0)return z[b];if(z.value!==void 0)return z.value;if(z.id!==void 0)return z.id}}},V=(()=>{if(M)return(Array.isArray(y)?y:[]).map(K=>{const de=String(typeof K=="object"?A(K):K);return Ue.find(me=>{const Ne=A(me);return Ne!==void 0&&String(Ne)===de})||null}).filter(Boolean);{if(y==null||y==="")return null;const z=String(typeof y=="object"?A(y):y),K=Ue.find(de=>{const ge=A(de);return ge!==void 0&&String(ge)===z});return K||null}})();return l.jsx(pc,{id:e.id,options:Ue,value:V,multiple:M,labelText:e.labelPosition==="top"?E(e.label):void 0,label:e.labelPosition!=="top"?E(e.label):void 0,placeholder:S&&(R!=null&&R.dependsOn)&&!h?`Please select ${R.dependsOn.replace(/_/g," ")} first`:e.placeholder,labelVariant:e.labelVariant,disabled:S,loading:re,error:c||!!ce,helperText:(s==null?void 0:s.message)||(ce==null?void 0:ce.message)||e.helperText||"",onOpen:U,noOptionsText:S&&(R!=null&&R.dependsOn)&&!h?`Please select ${R.dependsOn.replace(/_/g," ")} first`:re?"Fetching data...":p&&!re&&Ue.length===0?"No options available":"Click to load options",onChange:z=>{const K=(R==null?void 0:R.valueField)||e.value_field||"value";if(M){const ge=(Array.isArray(z)?z:[]).map(me=>typeof me=="object"&&(me[K]||me.value||me.id)||me);j.onChange(ge)}else{let de;z&&typeof z=="object"?de=z[K]||z.value||z.id||z:de=z,j.onChange(de);const ge=e.selectedAssignments;if(ge&&z&&typeof z=="object")for(const[me,Ne]of Object.entries(ge)){const Oe=z[Ne];if(Oe!==void 0&&typeof o=="function")try{o(me,Oe,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!1})}catch{}}}}})}});case"date":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>l.jsx(po,{...j,id:e.name,label:E(e.label),labelPosition:e.labelPosition||"inner",labelVariant:e.labelVariant,disabled:e.disabled,error:c,helperText:s==null?void 0:s.message,inputProps:{min:e.minDate,max:e.maxDate}})});case"image":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:j})=>{const y=j.value||e.defaultValue||e.src;if(y){const K=e.imageUploaded||{},de=K.previewText||"Preview",ge=K.removeText||"Remove",me=K.saveText||"Save logo",Ne=K.showSave!==void 0?K.showSave:!!(e.onSave||K.saveText),Oe=()=>{if(v(!0),typeof e.onPreview=="function")try{e.onPreview(y)}catch{}},it=()=>{j.onChange(""),typeof e.onRemove=="function"&&e.onRemove()},pt=()=>{typeof e.onSave=="function"&&e.onSave({url:y,file:$.current||void 0})},Me=ne=>{const Ge=ne.target.files&&ne.target.files[0];if(Ge){if(typeof e.onFileSelected=="function")try{e.onFileSelected(Ge)}catch{}try{const Kt=URL.createObjectURL(Ge);j.onChange(Kt)}catch{}$.current=Ge,v(!1)}};return l.jsxs(g.Card,{sx:{display:"flex",alignItems:"center",gap:2,p:2,boxShadow:"0px 1px 4px 0px #00000014",...K.cardSx},children:[l.jsx("input",{type:"file",ref:w,accept:Array.isArray(e.accept)?e.accept.join(","):e.accept||"image/*",style:{display:"none"},onChange:Me}),l.jsxs(g.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[l.jsx(g.Box,{sx:{width:"30%",height:"10%",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",background:"#FFFFFF",overflow:"hidden",...K.thumbnailSx},children:l.jsx("img",{src:y,alt:e.alt||e.label,style:{maxWidth:"100%",maxHeight:"100%"}})}),l.jsxs(g.Box,{sx:{flexGrow:1},children:[l.jsx(g.Typography,{sx:{fontSize:"12px",fontWeight:500,...K.fileNameSx},children:typeof y=="string"?y.split("/").pop():"Selected image"}),l.jsx(g.Typography,{sx:{fontSize:"10px",...K.fileMetaSx},children:"Image selected"})]}),l.jsxs(g.Box,{sx:{display:"flex",gap:1},children:[l.jsx(g.Button,{type:"button",sx:{...K.previewButtonSx},variant:"outlined",onClick:Oe,startIcon:l.jsx(Os,{}),children:de}),l.jsx(g.Button,{variant:"outlined",color:"error",onClick:it,sx:{...K.removeButtonSx},startIcon:l.jsx(_s,{}),children:ge}),Ne&&l.jsx(g.Button,{variant:"contained",onClick:pt,sx:{...K.saveButtonSx},children:me})]})]}),l.jsxs(g.Dialog,{open:C,onClose:()=>v(!1),maxWidth:"md",fullWidth:!0,children:[l.jsx(g.DialogTitle,{children:K.previewTitle||"Image preview"}),l.jsx(g.DialogContent,{children:l.jsx(g.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",border:"1px solid",borderColor:"divider",backgroundColor:"background.paper",p:1,minHeight:260},children:l.jsx("img",{src:y,alt:e.alt||e.label,style:{maxWidth:"100%",maxHeight:380}})})}),l.jsxs(g.DialogActions,{children:[l.jsx(g.Button,{type:"button",variant:"outlined",onClick:()=>{var ne;return(ne=w.current)==null?void 0:ne.click()},children:K.replaceText||"Replace logo"}),l.jsx(g.Button,{type:"button",variant:"contained",onClick:()=>v(!1),children:K.closeText||"Close"})]})]})]})}const M=e.imagePlaceholder||{},b=M.icon||"upload",A=w,V=()=>{var K;try{(K=A.current)==null||K.click()}catch{}},z=K=>{const de=K.target.files&&K.target.files[0];if(de){typeof e.onFileSelected=="function"&&e.onFileSelected(de);try{const ge=URL.createObjectURL(de);j.onChange(ge)}catch{}$.current=de}};return l.jsxs(g.Card,{sx:{border:"1px dashed",borderColor:"#CCCCCC",boxShadow:"none",p:2,textAlign:"center",color:"primary.main",...M.sx},children:[l.jsx("input",{type:"file",ref:A,accept:Array.isArray(e.accept)?e.accept.join(","):e.accept||"image/*",style:{display:"none"},onChange:z}),l.jsx(Gn,{sx:{borderRadius:"8px",...M.iconSx},children:b==="image"?l.jsx(Nh,{sx:{width:36,height:36,color:"primary.main"}}):l.jsx(di,{sx:{width:36,height:36,color:"primary.main"}})}),l.jsx(g.Typography,{sx:{fontSize:"16px",fontWeight:600,color:"primary.main",...M.titleSx},children:M.title||"Drag & Drop the image here"}),l.jsx(g.Typography,{sx:{fontSize:"12px",fontWeight:400,color:"primary.main",...M.subtitleSx},children:M.subtitle||""}),l.jsx(g.Button,{onClick:V,sx:{my:2,...M.buttonSx},startIcon:l.jsx(di,{}),variant:"contained",disabled:e.disabled,children:M.buttonText||"Upload File"}),l.jsx(g.Typography,{sx:{fontSize:"12px",fontWeight:400,...M.helperTextSx},children:M.helperText||e.helperText||""})]})}});case"component":return l.jsx(g.Box,{children:e.render?typeof e.render=="function"?(()=>{try{return e.render(a||{},{control:t,setValue:o})}catch{try{return e.render({control:t,formData:a,setValue:o})}catch{return e.render()}}})():e.render:e.content});default:return null}},pe=P.useMemo(()=>!e.disabled||e.copyWhenDisabled===!1?!1:!["title","section","image","component"].includes(e.type),[e.disabled,e.copyWhenDisabled,e.type]),te=P.useCallback(async()=>{try{const W=a?a[e.name]:void 0;let Q="";W==null?Q="":Array.isArray(W)?Q=W.join(", "):typeof W=="object"?Q=JSON.stringify(W):Q=String(W),await navigator.clipboard.writeText(Q),m(!0),window.setTimeout(()=>m(!1),1200)}catch{}},[a,e.name]);return l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",gap:.3},children:[l.jsx(g.Box,{sx:{flexGrow:1},children:B?fe():null}),pe&&l.jsx(Gn,{"aria-label":`copy ${e.label||e.name}`,onClick:te,size:"small",children:k?l.jsx(uo,{fontSize:"small"}):l.jsx(Vh,{fontSize:"small"})})]})};var aa,Ps;function am(){if(Ps)return aa;Ps=1;function e(v){this._maxSize=v,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(v){return this._values[v]},e.prototype.set=function(v,w){return this._size>=this._maxSize&&this.clear(),v in this._values||this._size++,this._values[v]=w};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,n=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,o=512,s=new e(o),c=new e(o),p=new e(o);aa={Cache:e,split:d,normalizePath:f,setter:function(v){var w=f(v);return c.get(v)||c.set(v,function(F,E){for(var _=0,I=w.length,R=F;_<I-1;){var Y=w[_];if(Y==="__proto__"||Y==="constructor"||Y==="prototype")return F;R=R[w[_++]]}R[w[_]]=E})},getter:function(v,w){var $=f(v);return p.get(v)||p.set(v,function(E){for(var _=0,I=$.length;_<I;)if(E!=null||!w)E=E[$[_++]];else return;return E})},join:function(v){return v.reduce(function(w,$){return w+(x($)||r.test($)?"["+$+"]":(w?".":"")+$)},"")},forEach:function(v,w,$){u(Array.isArray(v)?v:d(v),w,$)}};function f(v){return s.get(v)||s.set(v,d(v).map(function(w){return w.replace(a,"$2")}))}function d(v){return v.match(t)||[""]}function u(v,w,$){var F=v.length,E,_,I,R;for(_=0;_<F;_++)E=v[_],E&&(C(E)&&(E='"'+E+'"'),R=x(E),I=!R&&/^\d+$/.test(E),w.call($,E,R,I,_,v))}function x(v){return typeof v=="string"&&v&&["'",'"'].indexOf(v.charAt(0))!==-1}function k(v){return v.match(n)&&!v.match(r)}function m(v){return i.test(v)}function C(v){return!x(v)&&(k(v)||m(v))}return aa}var _r=am(),oa,$s;function om(){if($s)return oa;$s=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,t=f=>f.match(e)||[],r=f=>f[0].toUpperCase()+f.slice(1),n=(f,d)=>t(f).join(d).toLowerCase(),i=f=>t(f).reduce((d,u)=>`${d}${d?u[0].toUpperCase()+u.slice(1).toLowerCase():u.toLowerCase()}`,"");return oa={words:t,upperFirst:r,camelCase:i,pascalCase:f=>r(i(f)),snakeCase:f=>n(f,"_"),kebabCase:f=>n(f,"-"),sentenceCase:f=>r(n(f," ")),titleCase:f=>t(f).map(r).join(" ")},oa}var sa=om(),Ln={exports:{}},Ds;function sm(){if(Ds)return Ln.exports;Ds=1,Ln.exports=function(i){return e(t(i),i)},Ln.exports.array=e;function e(i,a){var o=i.length,s=new Array(o),c={},p=o,f=r(a),d=n(i);for(a.forEach(function(x){if(!d.has(x[0])||!d.has(x[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});p--;)c[p]||u(i[p],p,new Set);return s;function u(x,k,m){if(m.has(x)){var C;try{C=", node was:"+JSON.stringify(x)}catch{C=""}throw new Error("Cyclic dependency"+C)}if(!d.has(x))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(x));if(!c[k]){c[k]=!0;var v=f.get(x)||new Set;if(v=Array.from(v),k=v.length){m.add(x);do{var w=v[--k];u(w,d.get(w),m)}while(k);m.delete(x)}s[--o]=x}}}function t(i){for(var a=new Set,o=0,s=i.length;o<s;o++){var c=i[o];a.add(c[0]),a.add(c[1])}return Array.from(a)}function r(i){for(var a=new Map,o=0,s=i.length;o<s;o++){var c=i[o];a.has(c[0])||a.set(c[0],new Set),a.has(c[1])||a.set(c[1],new Set),a.get(c[0]).add(c[1])}return a}function n(i){for(var a=new Map,o=0,s=i.length;o<s;o++)a.set(i[o],o);return a}return Ln.exports}var lm=sm();const cm=Qa(lm),um=Object.prototype.toString,pm=Error.prototype.toString,dm=RegExp.prototype.toString,fm=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",hm=/^Symbol\((.*)\)(.*)$/;function mm(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Is(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return mm(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return fm.call(e).replace(hm,"Symbol($1)");const n=um.call(e).slice(8,-1);return n==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):n==="Error"||e instanceof Error?"["+pm.call(e)+"]":n==="RegExp"?dm.call(e):null}function cr(e,t){let r=Is(e,t);return r!==null?r:JSON.stringify(e,function(n,i){let a=Is(this[n],t);return a!==null?a:i},2)}function Cc(e){return e==null?[]:[].concat(e)}let Ec,Tc,kc,gm=/\$\{\s*(\w+)\s*\}/g;Ec=Symbol.toStringTag;class Ms{constructor(t,r,n,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[Ec]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=i,this.errors=[],this.inner=[],Cc(t).forEach(a=>{if(lt.isError(a)){this.errors.push(...a.errors);const o=a.inner.length?a.inner:[a];this.inner.push(...o)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}Tc=Symbol.hasInstance;kc=Symbol.toStringTag;class lt extends Error{static formatError(t,r){const n=r.label||r.path||"this";return r=Object.assign({},r,{path:n,originalPath:r.path}),typeof t=="string"?t.replace(gm,(i,a)=>cr(r[a])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,n,i,a){const o=new Ms(t,r,n,i);if(a)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[kc]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,lt)}static[Tc](t){return Ms[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Rt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:r,originalValue:n})=>{const i=n!=null&&n!==r?` (cast from the value \`${cr(n,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${cr(r,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${cr(r,!0)}\``+i}},at={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Zt={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Da={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Ia={isValue:"${path} field must be ${value}"},Zn={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},ym={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},xm={notType:e=>{const{path:t,value:r,spec:n}=e,i=n.types.length;if(Array.isArray(r)){if(r.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${r.length} for value: \`${cr(r,!0)}\``;if(r.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${r.length} for value: \`${cr(r,!0)}\``}return lt.formatError(Rt.notType,e)}};Object.assign(Object.create(null),{mixed:Rt,string:at,number:Zt,date:Da,object:Zn,array:ym,boolean:Ia,tuple:xm});const go=e=>e&&e.__isYupSchema__;class hi{static fromOptions(t,r){if(!r.then&&!r.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:i,otherwise:a}=r,o=typeof n=="function"?n:(...s)=>s.every(c=>c===n);return new hi(t,(s,c)=>{var p;let f=o(...s)?i:a;return(p=f==null?void 0:f(c))!=null?p:c})}constructor(t,r){this.fn=void 0,this.refs=t,this.refs=t,this.fn=r}resolve(t,r){let n=this.refs.map(a=>a.getValue(r==null?void 0:r.value,r==null?void 0:r.parent,r==null?void 0:r.context)),i=this.fn(n,t,r);if(i===void 0||i===t)return t;if(!go(i))throw new TypeError("conditions must return a schema object");return i.resolve(r)}}const qn={context:"$",value:"."};function mi(e,t){return new mr(e,t)}class mr{constructor(t,r={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===qn.context,this.isValue=this.key[0]===qn.value,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?qn.context:this.isValue?qn.value:"";this.path=this.key.slice(n.length),this.getter=this.path&&_r.getter(this.path,!0),this.map=r.map}getValue(t,r,n){let i=this.isContext?n:this.isValue?t:r;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,r){return this.getValue(t,r==null?void 0:r.parent,r==null?void 0:r.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}mr.prototype.__isYupRef=!0;const At=e=>e==null;function qr(e){function t({value:r,path:n="",options:i,originalValue:a,schema:o},s,c){const{name:p,test:f,params:d,message:u,skipAbsent:x}=e;let{parent:k,context:m,abortEarly:C=o.spec.abortEarly,disableStackTrace:v=o.spec.disableStackTrace}=i;function w(B){return mr.isRef(B)?B.getValue(r,k,m):B}function $(B={}){const q=Object.assign({value:r,originalValue:a,label:o.spec.label,path:B.path||n,spec:o.spec,disableStackTrace:B.disableStackTrace||v},d,B.params);for(const L of Object.keys(q))q[L]=w(q[L]);const Z=new lt(lt.formatError(B.message||u,q),r,q.path,B.type||p,q.disableStackTrace);return Z.params=q,Z}const F=C?s:c;let E={path:n,parent:k,type:p,from:i.from,createError:$,resolve:w,options:i,originalValue:a,schema:o};const _=B=>{lt.isError(B)?F(B):B?c(null):F($())},I=B=>{lt.isError(B)?F(B):s(B)};if(x&&At(r))return _(!0);let Y;try{var h;if(Y=f.call(E,r,E),typeof((h=Y)==null?void 0:h.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${E.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(Y).then(_,I)}}catch(B){I(B);return}_(Y)}return t.OPTIONS=e,t}function vm(e,t,r,n=r){let i,a,o;return t?(_r.forEach(t,(s,c,p)=>{let f=c?s.slice(1,s.length-1):s;e=e.resolve({context:n,parent:i,value:r});let d=e.type==="tuple",u=p?parseInt(f,10):0;if(e.innerType||d){if(d&&!p)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(r&&u>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=r,r=r&&r[u],e=d?e.spec.types[u]:e.innerType}if(!p){if(!e.fields||!e.fields[f])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=r,r=r&&r[f],e=e.fields[f]}a=f,o=c?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class gi extends Set{describe(){const t=[];for(const r of this.values())t.push(mr.isRef(r)?r.describe():r);return t}resolveAll(t){let r=[];for(const n of this.values())r.push(t(n));return r}clone(){return new gi(this.values())}merge(t,r){const n=this.clone();return t.forEach(i=>n.add(i)),r.forEach(i=>n.delete(i)),n}}function Ur(e,t=new Map){if(go(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let r;if(e instanceof Date)r=new Date(e.getTime()),t.set(e,r);else if(e instanceof RegExp)r=new RegExp(e),t.set(e,r);else if(Array.isArray(e)){r=new Array(e.length),t.set(e,r);for(let n=0;n<e.length;n++)r[n]=Ur(e[n],t)}else if(e instanceof Map){r=new Map,t.set(e,r);for(const[n,i]of e.entries())r.set(n,Ur(i,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(Ur(n,t))}else if(e instanceof Object){r={},t.set(e,r);for(const[n,i]of Object.entries(e))r[n]=Ur(i,t)}else throw Error(`Unable to clone ${e}`);return r}class gt{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new gi,this._blacklist=new gi,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Rt.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(r=>{r.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const r=Object.create(Object.getPrototypeOf(this));return r.type=this.type,r._typeCheck=this._typeCheck,r._whitelist=this._whitelist.clone(),r._blacklist=this._blacklist.clone(),r.internalTests=Object.assign({},this.internalTests),r.exclusiveTests=Object.assign({},this.exclusiveTests),r.deps=[...this.deps],r.conditions=[...this.conditions],r.tests=[...this.tests],r.transforms=[...this.transforms],r.spec=Ur(Object.assign({},this.spec,t)),r}label(t){let r=this.clone();return r.spec.label=t,r}meta(...t){if(t.length===0)return this.spec.meta;let r=this.clone();return r.spec.meta=Object.assign(r.spec.meta||{},t[0]),r}withMutation(t){let r=this._mutate;this._mutate=!0;let n=t(this);return this._mutate=r,n}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let r=this,n=t.clone();const i=Object.assign({},r.spec,n.spec);return n.spec=i,n.internalTests=Object.assign({},r.internalTests,n.internalTests),n._whitelist=r._whitelist.merge(t._whitelist,t._blacklist),n._blacklist=r._blacklist.merge(t._blacklist,t._whitelist),n.tests=r.tests,n.exclusiveTests=r.exclusiveTests,n.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),n.transforms=[...r.transforms,...n.transforms],n}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let r=this;if(r.conditions.length){let n=r.conditions;r=r.clone(),r.conditions=[],r=n.reduce((i,a)=>a.resolve(i,t),r),r=r.resolve(t)}return r}resolveOptions(t){var r,n,i,a;return Object.assign({},t,{from:t.from||[],strict:(r=t.strict)!=null?r:this.spec.strict,abortEarly:(n=t.abortEarly)!=null?n:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(a=t.disableStackTrace)!=null?a:this.spec.disableStackTrace})}cast(t,r={}){let n=this.resolve(Object.assign({value:t},r)),i=r.assert==="ignore-optionality",a=n._cast(t,r);if(r.assert!==!1&&!n.isType(a)){if(i&&At(a))return a;let o=cr(t),s=cr(a);throw new TypeError(`The value of ${r.path||"field"} could not be cast to a value that satisfies the schema type: "${n.type}".
177
177
 
178
178
  attempted value: ${o}
179
179
  `+(s!==o?`result of cast: ${s}`:""))}return a}_cast(t,r){let n=t===void 0?t:this.transforms.reduce((i,a)=>a.call(this,i,t,this),t);return n===void 0&&(n=this.getDefault(r)),n}_validate(t,r={},n,i){let{path:a,originalValue:o=t,strict:s=this.spec.strict}=r,c=t;s||(c=this._cast(c,Object.assign({assert:!1},r)));let p=[];for(let f of Object.values(this.internalTests))f&&p.push(f);this.runTests({path:a,value:c,originalValue:o,options:r,tests:p},n,f=>{if(f.length)return i(f,c);this.runTests({path:a,value:c,originalValue:o,options:r,tests:this.tests},n,i)})}runTests(t,r,n){let i=!1,{tests:a,value:o,originalValue:s,path:c,options:p}=t,f=m=>{i||(i=!0,r(m,o))},d=m=>{i||(i=!0,n(m,o))},u=a.length,x=[];if(!u)return d([]);let k={value:o,originalValue:s,path:c,options:p,schema:this};for(let m=0;m<a.length;m++){const C=a[m];C(k,f,function(w){w&&(Array.isArray(w)?x.push(...w):x.push(w)),--u<=0&&d(x)})}}asNestedTest({key:t,index:r,parent:n,parentPath:i,originalParent:a,options:o}){const s=t??r;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof s=="number";let p=n[s];const f=Object.assign({},o,{strict:!0,parent:n,value:p,originalValue:a[s],key:void 0,[c?"index":"key"]:s,path:c||s.includes(".")?`${i||""}[${c?s:`"${s}"`}]`:(i?`${i}.`:"")+t});return(d,u,x)=>this.resolve(f)._validate(p,f,u,x)}validate(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),a=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return new Promise((o,s)=>i._validate(t,r,(c,p)=>{lt.isError(c)&&(c.value=p),s(c)},(c,p)=>{c.length?s(new lt(c,p,void 0,void 0,a)):o(p)}))}validateSync(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),a,o=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return i._validate(t,Object.assign({},r,{sync:!0}),(s,c)=>{throw lt.isError(s)&&(s.value=c),s},(s,c)=>{if(s.length)throw new lt(s,t,void 0,void 0,o);a=c}),a}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(lt.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(lt.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):Ur(r)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,r){const n=this.clone({nullable:t});return n.internalTests.nullable=qr({message:r,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),n}optionality(t,r){const n=this.clone({optional:t});return n.internalTests.optionality=qr({message:r,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=Rt.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Rt.notNull){return this.nullability(!1,t)}required(t=Rt.required){return this.clone().withMutation(r=>r.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let r=this.clone();return r.transforms.push(t),r}test(...t){let r;if(t.length===1?typeof t[0]=="function"?r={test:t[0]}:r=t[0]:t.length===2?r={name:t[0],test:t[1]}:r={name:t[0],message:t[1],test:t[2]},r.message===void 0&&(r.message=Rt.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),i=qr(r),a=r.exclusive||r.name&&n.exclusiveTests[r.name]===!0;if(r.exclusive&&!r.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return r.name&&(n.exclusiveTests[r.name]=!!r.exclusive),n.tests=n.tests.filter(o=>!(o.OPTIONS.name===r.name&&(a||o.OPTIONS.test===i.OPTIONS.test))),n.tests.push(i),n}when(t,r){!Array.isArray(t)&&typeof t!="string"&&(r=t,t=".");let n=this.clone(),i=Cc(t).map(a=>new mr(a));return i.forEach(a=>{a.isSibling&&n.deps.push(a.key)}),n.conditions.push(typeof r=="function"?new hi(i,r):hi.fromOptions(i,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=qr({message:t,name:"typeError",skipAbsent:!0,test(n){return this.schema._typeCheck(n)?!0:this.createError({params:{type:this.schema.type}})}}),r}oneOf(t,r=Rt.oneOf){let n=this.clone();return t.forEach(i=>{n._whitelist.add(i),n._blacklist.delete(i)}),n.internalTests.whiteList=qr({message:r,name:"oneOf",skipAbsent:!0,test(i){let a=this.schema._whitelist,o=a.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:o}})}}),n}notOneOf(t,r=Rt.notOneOf){let n=this.clone();return t.forEach(i=>{n._blacklist.add(i),n._whitelist.delete(i)}),n.internalTests.blacklist=qr({message:r,name:"notOneOf",test(i){let a=this.schema._blacklist,o=a.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(a).join(", "),resolved:o}}):!0}}),n}strip(t=!0){let r=this.clone();return r.spec.strip=t,r}describe(t){const r=(t?this.resolve(t):this).clone(),{label:n,meta:i,optional:a,nullable:o}=r.spec;return{meta:i,label:n,optional:a,nullable:o,default:r.getDefault(t),type:r.type,oneOf:r._whitelist.describe(),notOneOf:r._blacklist.describe(),tests:r.tests.map(c=>({name:c.OPTIONS.name,params:c.OPTIONS.params})).filter((c,p,f)=>f.findIndex(d=>d.name===c.name)===p)}}}gt.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])gt.prototype[`${e}At`]=function(t,r,n={}){const{parent:i,parentPath:a,schema:o}=vm(this,t,r,n.context);return o[e](i&&i[a],Object.assign({},n,{parent:i,path:t}))};for(const e of["equals","is"])gt.prototype[e]=gt.prototype.oneOf;for(const e of["not","nope"])gt.prototype[e]=gt.prototype.notOneOf;const bm=()=>!0;function jc(e){return new Fc(e)}class Fc extends gt{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:bm},t))}}jc.prototype=Fc.prototype;function Ac(){return new Oc}class Oc extends gt{constructor(){super({type:"boolean",check(t){return t instanceof Boolean&&(t=t.valueOf()),typeof t=="boolean"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(n.spec.coerce&&!n.isType(t)){if(/^(true|1)$/i.test(String(t)))return!0;if(/^(false|0)$/i.test(String(t)))return!1}return t})})}isTrue(t=Ia.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return At(r)||r===!0}})}isFalse(t=Ia.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return At(r)||r===!1}})}default(t){return super.default(t)}defined(t){return super.defined(t)}optional(){return super.optional()}required(t){return super.required(t)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(t){return super.nonNullable(t)}strip(t){return super.strip(t)}}Ac.prototype=Oc.prototype;const wm=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Sm(e){const t=Ma(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let r=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(r=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(r=0-r)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+r,t.second,t.millisecond)}function Ma(e){var t,r;const n=wm.exec(e);return n?{year:Lt(n[1]),month:Lt(n[2],1)-1,day:Lt(n[3],1),hour:Lt(n[4]),minute:Lt(n[5]),second:Lt(n[6]),millisecond:n[7]?Lt(n[7].substring(0,3)):0,precision:(t=(r=n[7])==null?void 0:r.length)!=null?t:void 0,z:n[8]||void 0,plusMinus:n[9]||void 0,hourOffset:Lt(n[10]),minuteOffset:Lt(n[11])}:null}function Lt(e,t=0){return Number(e)||t}let Cm=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Em=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Tm=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,km="^\\d{4}-\\d{2}-\\d{2}",jm="\\d{2}:\\d{2}:\\d{2}",Fm="(([+-]\\d{2}(:?\\d{2})?)|Z)",Am=new RegExp(`${km}T${jm}(\\.\\d+)?${Fm}$`),Om=e=>At(e)||e===e.trim(),_m={}.toString();function xn(){return new _c}class _c extends gt{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce||n.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===_m?t:i})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||Rt.required,name:"required",skipAbsent:!0,test:n=>!!n.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(r=>r.OPTIONS.name!=="required"),t))}length(t,r=at.length){return this.test({message:r,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(n){return n.length===this.resolve(t)}})}min(t,r=at.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n.length>=this.resolve(t)}})}max(t,r=at.max){return this.test({name:"max",exclusive:!0,message:r,params:{max:t},skipAbsent:!0,test(n){return n.length<=this.resolve(t)}})}matches(t,r){let n=!1,i,a;return r&&(typeof r=="object"?{excludeEmptyString:n=!1,message:i,name:a}=r:i=r),this.test({name:a||"matches",message:i||at.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&n||o.search(t)!==-1})}email(t=at.email){return this.matches(Cm,{name:"email",message:t,excludeEmptyString:!0})}url(t=at.url){return this.matches(Em,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=at.uuid){return this.matches(Tm,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let r="",n,i;return t&&(typeof t=="object"?{message:r="",allowOffset:n=!1,precision:i=void 0}=t:r=t),this.matches(Am,{name:"datetime",message:r||at.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||at.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:a=>{if(!a||n)return!0;const o=Ma(a);return o?!!o.z:!1}}).test({name:"datetime_precision",message:r||at.datetime_precision,params:{precision:i},skipAbsent:!0,test:a=>{if(!a||i==null)return!0;const o=Ma(a);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=at.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:Om})}lowercase(t=at.lowercase){return this.transform(r=>At(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>At(r)||r===r.toLowerCase()})}uppercase(t=at.uppercase){return this.transform(r=>At(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>At(r)||r===r.toUpperCase()})}}xn.prototype=_c.prototype;let Rm=e=>e!=+e;function Rc(){return new Pc}class Pc extends gt{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!Rm(t)}}),this.withMutation(()=>{this.transform((t,r,n)=>{if(!n.spec.coerce)return t;let i=t;if(typeof i=="string"){if(i=i.replace(/\s/g,""),i==="")return NaN;i=+i}return n.isType(i)||i===null?i:parseFloat(i)})})}min(t,r=Zt.min){return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(n){return n>=this.resolve(t)}})}max(t,r=Zt.max){return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(n){return n<=this.resolve(t)}})}lessThan(t,r=Zt.lessThan){return this.test({message:r,name:"max",exclusive:!0,params:{less:t},skipAbsent:!0,test(n){return n<this.resolve(t)}})}moreThan(t,r=Zt.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(n){return n>this.resolve(t)}})}positive(t=Zt.positive){return this.moreThan(0,t)}negative(t=Zt.negative){return this.lessThan(0,t)}integer(t=Zt.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(t=>At(t)?t:t|0)}round(t){var r;let n=["ceil","floor","round","trunc"];if(t=((r=t)==null?void 0:r.toLowerCase())||"round",t==="trunc")return this.truncate();if(n.indexOf(t.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform(i=>At(i)?i:Math[t](i))}}Rc.prototype=Pc.prototype;let $c=new Date(""),Pm=e=>Object.prototype.toString.call(e)==="[object Date]";function yo(){return new $n}class $n extends gt{constructor(){super({type:"date",check(t){return Pm(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=Sm(t),isNaN(t)?$n.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(mr.isRef(t))n=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${r}\` must be a Date or a value that can be \`cast()\` to a Date`);n=i}return n}min(t,r=Da.min){let n=this.prepareParam(t,"min");return this.test({message:r,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(n)}})}max(t,r=Da.max){let n=this.prepareParam(t,"max");return this.test({message:r,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(n)}})}}$n.INVALID_DATE=$c;yo.prototype=$n.prototype;yo.INVALID_DATE=$c;function $m(e,t=[]){let r=[],n=new Set,i=new Set(t.map(([o,s])=>`${o}-${s}`));function a(o,s){let c=_r.split(o)[0];n.add(c),i.has(`${s}-${c}`)||r.push([s,c])}for(const o of Object.keys(e)){let s=e[o];n.add(o),mr.isRef(s)&&s.isSibling?a(s.path,o):go(s)&&"deps"in s&&s.deps.forEach(c=>a(c,o))}return cm.array(Array.from(n),r).reverse()}function zs(e,t){let r=1/0;return e.some((n,i)=>{var a;if((a=t.path)!=null&&a.includes(n))return r=i,!0}),r}function Dc(e){return(t,r)=>zs(e,t)-zs(e,r)}const Dm=(e,t,r)=>{if(typeof e!="string")return e;let n=e;try{n=JSON.parse(e)}catch{}return r.isType(n)?n:e};function Xn(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Xn(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=Xn(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(Xn)}):"optional"in e?e.optional():e}const Im=(e,t)=>{const r=[..._r.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),i=_r.getter(_r.join(r),!0)(e);return!!(i&&n in i)};let Bs=e=>Object.prototype.toString.call(e)==="[object Object]";function Vs(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const Mm=Dc([]);function Ic(e){return new Mc(e)}class Mc extends gt{constructor(t){super({type:"object",check(r){return Bs(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=Mm,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,r={}){var n;let i=super._cast(t,r);if(i===void 0)return this.getDefault(r);if(!this._typeCheck(i))return i;let a=this.fields,o=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(i).filter(d=>!this._nodes.includes(d))),c={},p=Object.assign({},r,{parent:c,__validating:r.__validating||!1}),f=!1;for(const d of s){let u=a[d],x=d in i;if(u){let k,m=i[d];p.path=(r.path?`${r.path}.`:"")+d,u=u.resolve({value:m,context:r.context,parent:c});let C=u instanceof gt?u.spec:void 0,v=C==null?void 0:C.strict;if(C!=null&&C.strip){f=f||d in i;continue}k=!r.__validating||!v?u.cast(i[d],p):i[d],k!==void 0&&(c[d]=k)}else x&&!o&&(c[d]=i[d]);(x!==d in c||c[d]!==i[d])&&(f=!0)}return f?c:i}_validate(t,r={},n,i){let{from:a=[],originalValue:o=t,recursive:s=this.spec.recursive}=r;r.from=[{schema:this,value:o},...a],r.__validating=!0,r.originalValue=o,super._validate(t,r,n,(c,p)=>{if(!s||!Bs(p)){i(c,p);return}o=o||p;let f=[];for(let d of this._nodes){let u=this.fields[d];!u||mr.isRef(u)||f.push(u.asNestedTest({options:r,key:d,parent:p,parentPath:r.path,originalParent:o}))}this.runTests({tests:f,value:p,originalValue:o,options:r},n,d=>{i(d.sort(this._sortErrors).concat(c),p)})})}clone(t){const r=super.clone(t);return r.fields=Object.assign({},this.fields),r._nodes=this._nodes,r._excludedEdges=this._excludedEdges,r._sortErrors=this._sortErrors,r}concat(t){let r=super.concat(t),n=r.fields;for(let[i,a]of Object.entries(this.fields)){const o=n[i];n[i]=o===void 0?a:o}return r.withMutation(i=>i.setFields(n,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let r={};return this._nodes.forEach(n=>{var i;const a=this.fields[n];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[n]})),r[n]=a&&"getDefault"in a?a.getDefault(o):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=$m(t,r),n._sortErrors=Dc(Object.keys(t)),r&&(n._excludedEdges=r),n}shape(t,r=[]){return this.clone().withMutation(n=>{let i=n._excludedEdges;return r.length&&(Array.isArray(r[0])||(r=[r]),i=[...n._excludedEdges,...r]),n.setFields(Object.assign(n.fields,t),i)})}partial(){const t={};for(const[r,n]of Object.entries(this.fields))t[r]="optional"in n&&n.optional instanceof Function?n.optional():n;return this.setFields(t)}deepPartial(){return Xn(this)}pick(t){const r={};for(const n of t)this.fields[n]&&(r[n]=this.fields[n]);return this.setFields(r,this._excludedEdges.filter(([n,i])=>t.includes(n)&&t.includes(i)))}omit(t){const r=[];for(const n of Object.keys(this.fields))t.includes(n)||r.push(n);return this.pick(r)}from(t,r,n){let i=_r.getter(t,!0);return this.transform(a=>{if(!a)return a;let o=a;return Im(a,t)&&(o=Object.assign({},a),n||delete o[t],o[r]=i(a)),o})}json(){return this.transform(Dm)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Zn.exact,test(r){if(r==null)return!0;const n=Vs(this.schema,r);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,r=Zn.noUnknown){typeof t!="boolean"&&(r=t,t=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:r,test(i){if(i==null)return!0;const a=Vs(this.schema,i);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=Zn.noUnknown){return this.noUnknown(!t,r)}transformKeys(t){return this.transform(r=>{if(!r)return r;const n={};for(const i of Object.keys(r))n[t(i)]=r[i];return n})}camelCase(){return this.transformKeys(sa.camelCase)}snakeCase(){return this.transformKeys(sa.snakeCase)}constantCase(){return this.transformKeys(t=>sa.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[a,o]of Object.entries(r.fields)){var i;let s=t;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[a]})),n.fields[a]=o.describe(s)}return n}}Ic.prototype=Mc.prototype;const zc=e=>{const t={};return e.forEach(r=>{var o,s,c;let n;switch(r.type){case"text":case"textarea":case"tel":n=xn(),r.validation?n=gr(n,r,"string"):(r.minLength&&(n=n.min(r.minLength,`${r.label} must be at least ${r.minLength} characters`)),r.maxLength&&(n=n.max(r.maxLength,`${r.label} must be at most ${r.maxLength} characters`)),r.pattern&&(n=n.test("pattern",`${r.label} format is invalid`,p=>p?new RegExp(r.pattern).test(p):!0)));break;case"email":n=xn().email(((o=r.validation)==null?void 0:o.message)||`${r.label} must be a valid email address`),r.validation&&(n=gr(n,r,"string"));break;case"password":n=xn(),r.validation?n=gr(n,r,"string"):(r.minLength&&(n=n.min(r.minLength,`${r.label} must be at least ${r.minLength} characters`)),r.maxLength&&(n=n.max(r.maxLength,`${r.label} must be at most ${r.maxLength} characters`)),r.pattern&&(n=n.test("pattern",`${r.label} format is invalid`,p=>p?new RegExp(r.pattern).test(p):!0)));break;case"number":if(n=Rc().transform((p,f)=>f===""||f===null?void 0:p).nullable().typeError(`${r.label} must be a number`),r.validation)n=gr(n,r,"number");else{if(r.min!==void 0){const p=typeof r.min=="object"&&r.min!==null&&"field"in r.min,f=p?mi(r.min.field):r.min,d=p&&r.min.message?r.min.message:`${r.label} must be at least ${p?"the minimum value":r.min}`;n=n.min(f,d)}if(r.max!==void 0){const p=typeof r.max=="object"&&r.max!==null&&"field"in r.max,f=p?mi(r.max.field):r.max,d=p&&r.max.message?r.max.message:`${r.label} must be at most ${p?"the maximum value":r.max}`;n=n.max(f,d)}}break;case"select":n=xn(),r.validation&&(n=gr(n,r,"string"));break;case"checkbox":n=Ac(),r.validation&&(n=gr(n,r,"boolean"));break;case"date":n=yo().typeError(`${r.label} must be a valid date`),r.validation?n=gr(n,r,"date"):(r.minDate&&(n=n.min(new Date(r.minDate),`${r.label} must be after ${r.minDate}`)),r.maxDate&&(n=n.max(new Date(r.maxDate),`${r.label} must be before ${r.maxDate}`)));break;default:n=jc()}const i=((s=r.validation)==null?void 0:s.required)!==void 0?r.validation.required:r.required;if(typeof i=="function"?!1:!!i){const p=((c=r.validation)==null?void 0:c.message)||`${r.label} is required`;n=n.required(p)}t[r.name]=n}),Ic().shape(t)},gr=(e,t,r,n)=>{const i=t.validation;if(!i)return e;if(r==="string"){if(i.minLength!==void 0){const a=i.message||`${t.label} must be at least ${i.minLength} characters`;e=e.min(i.minLength,a)}if(i.maxLength!==void 0){const a=i.message||`${t.label} must be at most ${i.maxLength} characters`;e=e.max(i.maxLength,a)}}if(r==="number"){if(i.min!==void 0)if(typeof i.min=="object"&&"field"in i.min){const a=mi(i.min.field),o=i.min.message||i.message||`${t.label} must be at least the value of ${i.min.field}`;e=e.min(a,o)}else{const a=i.message||`${t.label} must be at least ${i.min}`;e=e.min(i.min,a)}if(i.max!==void 0)if(typeof i.max=="object"&&"field"in i.max){const a=mi(i.max.field),o=i.max.message||i.message||`${t.label} must be at most the value of ${i.max.field}`;e=e.max(a,o)}else{const a=i.message||`${t.label} must be at most ${i.max}`;e=e.max(i.max,a)}}if(i.pattern){const a=typeof i.pattern=="string"?new RegExp(i.pattern):i.pattern,o=i.message||`${t.label} format is invalid`;e=e.test("pattern",o,s=>s?a.test(s):!0)}return i.custom&&(e=e.test("custom",i.message||`${t.label} is invalid`,function(a){const o=this.parent||{},s=i.custom(a,o);return typeof s=="boolean"?s:!1})),e},Bc=({currentStep:e,totalSteps:t,onStepChange:r,stepTitles:n=[],showStepTitles:i=!0,completedSteps:a=[]})=>{const o=P.useMemo(()=>Array.from({length:t},(f,d)=>d+1),[t]),s=P.useMemo(()=>Math.round(e/t*100),[e,t]),c=f=>n[f-1]||`Step ${f}`,p=f=>f===e||a.includes(f)||f===e+1&&a.includes(e);return l.jsxs(g.Card,{sx:{mb:2,p:2,boxShadow:"0px 1px 4px 0px #00000014",background:"#F8F8F8",borderRadius:"4px"},children:[l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[l.jsx(g.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap"},children:o.map((f,d)=>{const u=f===e,x=f<e||a.includes(f),k=u||x?"primary.main":"#8F97A4";return l.jsxs(g.Box,{sx:{display:"flex",alignItems:"center"},children:[l.jsxs(g.Box,{onClick:()=>p(f)&&r(f),sx:{display:"flex",alignItems:"center",cursor:p(f)?"pointer":"default"},children:[l.jsx(g.Box,{sx:{width:24,height:24,borderRadius:"50%",border:u||x?"2px solid":"1px solid",borderColor:u||x?"primary.main":"#8F97A4",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:m=>u||x?mt(m.palette.primary.main,.2):"transparent",mr:.5,color:k,fontWeight:u||x?600:500,fontSize:"12px"},children:f}),i&&l.jsx(g.Typography,{sx:{fontSize:"12px",fontWeight:600,color:k},children:c(f)})]}),d<o.length-1&&l.jsx(g.Box,{sx:{width:40,height:2,mx:1,borderRadius:1,backgroundColor:f<e?"primary.main":"#DFE3E8"}})]},f)})}),l.jsx(g.Typography,{sx:{color:"#8F97A4",fontSize:"12px",fontWeight:500},children:`Step ${e} of ${t}, ${s}% complete`})]}),l.jsx(g.LinearProgress,{variant:"determinate",value:s,sx:{height:4,borderRadius:"50px",backgroundColor:f=>f.palette.grey[300],"& .MuiLinearProgress-bar":{backgroundColor:"primary.main",borderRadius:5}}})]})},Vc=({buttons:e,disabled:t=!1})=>{const r=s=>{s.onClick&&s.onClick()},n=e.filter(s=>s.position==="left"||!s.position),i=e.filter(s=>s.position==="center"),a=e.filter(s=>s.position==="right"),o=(s,c)=>{const p=(s.text||"").toLowerCase(),f=s.type==="submit"||p.includes("submit")||p.includes("save")||p.includes("next"),d=s.position==="left"||p.includes("cancel")||p.includes("back")||p.includes("draft"),u=s.type?s.type:f?"submit":"button",x=d?"outlined":"contained",k=s.disabled||t,m=C=>C&&["primary","secondary","error","info","success","warning"].includes(C)?C:"primary";return l.jsxs(g.Button,{type:u,variant:x,color:m(s.color),size:s.size||"large",disabled:k,onClick:s.onClick?()=>r(s):void 0,sx:s.sx,children:[s.loading&&l.jsx(g.CircularProgress,{size:20,sx:{mr:1}}),s.text]},`${s.text}-${c}`)};return l.jsxs(g.Box,{sx:{mt:3,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx(g.Box,{sx:{display:"flex",gap:2},children:n.map((s,c)=>o(s,c))}),l.jsx(g.Box,{sx:{display:"flex",gap:2},children:i.map((s,c)=>o(s,c))}),l.jsx(g.Box,{sx:{display:"flex",gap:2},children:a.map((s,c)=>o(s,c))})]})},zm=({config:e,onSubmit:t,onStepChange:r,currentStep:n=1,totalSteps:i=1,isMultiStep:a=!1,formData:o})=>{const{buttons:s,position:c="right",layout:p="horizontal",spacing:f=2,sx:d}=e,u=v=>{let w="button",$="contained";return v.type?w=v.type:v.text.toLowerCase().includes("submit")||v.text.toLowerCase().includes("save")||v.text.toLowerCase().includes("next")?w="submit":(v.text.toLowerCase().includes("reset")||v.text.toLowerCase().includes("clear"))&&(w="reset"),(v.text.toLowerCase().includes("cancel")||v.text.toLowerCase().includes("back")||v.text.toLowerCase().includes("draft"))&&($="outlined"),{buttonType:w,buttonVariant:$}},x=v=>["primary","secondary","error","warning","info","success"].includes(v||"")?v:"primary",k=v=>{const{buttonType:w}=u(v);v.onClick?v.onClick():w==="submit"&&t?t(o):a&&r&&(v.text.toLowerCase().includes("next")?r(n+1,i):(v.text.toLowerCase().includes("back")||v.text.toLowerCase().includes("previous"))&&r(n-1,i))},m=(v,w)=>{const{buttonType:$,buttonVariant:F}=u(v),E=x(v.color);return l.jsx(g.Button,{type:$,variant:F,color:E,size:v.size||"medium",disabled:v.disabled,onClick:()=>k(v),sx:v.sx,children:v.text},w)},C=()=>{const v={display:"flex",gap:f,...d};switch(c){case"left":return{...v,justifyContent:"flex-start"};case"center":return{...v,justifyContent:"center"};case"right":return{...v,justifyContent:"flex-end"};case"space-between":return{...v,justifyContent:"space-between"};default:return{...v,justifyContent:"flex-end"}}};return p==="vertical"?l.jsx(g.Box,{sx:C(),children:s.map((v,w)=>l.jsx(g.Box,{sx:{width:"100%"},children:m(v,w)},w))}):l.jsx(g.Box,{sx:C(),children:l.jsx(g.ButtonGroup,{variant:"outlined",size:"medium",children:s.map((v,w)=>m(v,w))})})},Nc=(e,t)=>{const r=e==null?void 0:e.showWhen;if(r){if(typeof r=="function")try{return!!r(t||{})}catch{return!0}if(r&&typeof r=="object"){const n=r.field,i=r.equals,a=r.in,o=n?(t||{})[n]:void 0;if(n&&typeof i<"u")return o===i;if(n&&Array.isArray(a))return a.includes(o)}}return!0},Jn=(e,t)=>{const r=[];for(const n of e)if(Nc(n,t)&&(r.push(n),n.type==="tabs"&&n.items)){const i=n.items||[],a=(t||{})[n.name],o=(()=>{if(typeof a=="string"||typeof a=="number"){const c=i.findIndex((p,f)=>typeof p.value=="string"||typeof p.value=="number"?p.value===a:f===a);return c>=0?c:0}return Number(a)||0})(),s=i[o]||{};Array.isArray(s.fields)&&r.push(...Jn(s.fields,t))}return r},Bm=new qu({defaultOptions:{queries:{staleTime:15*60*1e3,gcTime:30*60*1e3,retry:3,retryDelay:e=>Math.min(1e3*2**e,3e4),refetchOnWindowFocus:!1,refetchOnReconnect:!0}}}),Vm=e=>l.jsx(Yu,{client:Bm,children:l.jsx(Nm,{...e})}),Nm=({id:e,theme:t,fields:r,onSubmit:n,onChange:i,submitButtonText:a="Submit",onSubmitClick:o,defaultValues:s,showSubmitButton:c=!0,buttons:p,buttonGroup:f,stickyButtons:d,stickyButtonsSx:u,fixedButtons:x,fixedButtonsSx:k,formCardWrap:m,formCardSx:C,formCardProps:v,baseUrl:w,apiHeaders:$,stepNavigationProps:F})=>{var S,j;const E=[...new Set(r.map(y=>y.step).filter(y=>y!=null&&y>0))].sort((y,M)=>(y||0)-(M||0)),_=E.length>1,I=E.length||1,[R,Y]=P.useState(1),h=_?r.filter(y=>y.step===R):r,B=P.useCallback(y=>{const M=[];for(const b of y)if(M.push(b),b.type==="tabs"&&b.items)for(const A of b.items||[])Array.isArray(A.fields)&&M.push(...B(A.fields));return M},[]),{control:q,handleSubmit:Z,formState:{errors:L},watch:H,setValue:G,resetField:re,trigger:ce}=Su({resolver:P.useCallback((y,M,b)=>{const V=Jn(_?h:r,y),z=zc(V);return Tu(z)(y,M,b)},[_,h,r]),mode:"onChange",defaultValues:s}),D=H(),U=P.useRef({});P.useEffect(()=>{const y=[];for(const M of r){const b=M.depends_on;b&&typeof M.name=="string"&&y.push({dependentField:M.name,dependencyName:b})}if(y.length!==0)for(const{dependentField:M,dependencyName:b}of y){const A=U.current[b],V=D==null?void 0:D[b];if(A!==V)try{re(M)}catch{}U.current[b]=V}},[r,D,re]);const X=P.useRef(i);P.useEffect(()=>{X.current=i},[i]);const ue=P.useMemo(()=>{try{return JSON.stringify(D)}catch{return String(Date.now())}},[D]),fe=P.useRef(null);P.useEffect(()=>{X.current&&fe.current!==ue&&(fe.current=ue,X.current(D))},[ue]);const pe=async()=>{if(!_)return!0;const y=r.filter(b=>b.step===R);for(const b of y)if(typeof b.required=="function"?!!b.required(D):!!b.required){const V=D[b.name];let z=!0;if(b.type==="checkbox"?z=V===!0:Array.isArray(V)?z=V.length>0:z=V!=null&&V!=="",!z)return!1}return await ce()?!0:Object.keys(L).filter(A=>y.some(V=>V.name===A)).map(A=>{const V=L[A];return typeof(V==null?void 0:V.message)=="string"?V.message:`${A} is invalid`}).length===0},te=P.useMemo(()=>{if(!_)return!0;const y=r.filter(b=>b.step===R);for(const b of y)if(typeof b.required=="function"?!!b.required(D):!!b.required){const V=D[b.name];let z=!0;if(b.type==="checkbox"?z=V===!0:Array.isArray(V)?z=V.length>0:z=V!=null&&V!=="",!z)return!1}return Object.keys(L).filter(b=>y.some(A=>A.name===b)).length===0},[_,R,r,D,L]),W=P.useCallback((y,M)=>Nc(y,M),[]),Q=P.useCallback(y=>{const M=[];for(const b of y)if(M.push(b),b.type==="tabs"&&b.items)for(const A of b.items||[])Array.isArray(A.fields)&&M.push(...Q(A.fields));return M},[]),ae=P.useCallback((y,M)=>Jn(y,M),[]),se=P.useMemo(()=>{if(_)return te;const y=Jn(r,D);for(const A of y){if(!W(A,D))continue;if(typeof A.required=="function"?!!A.required(D):!!A.required){const z=D[A.name];let K=!0;if(A.type==="checkbox"?K=z===!0:K=z!=null&&z!==""&&!(Array.isArray(z)&&z.length===0),!K)return!1}}const M=new Set(y.map(A=>A.name));return Object.keys(L).filter(A=>M.has(A)).length===0},[_,te,r,D,L,ae,W]),le=async y=>{y<1||y>I||y>R&&_&&!await pe()||Y(y)},be=async y=>{if(_&&R<I){console.warn("Form submission attempted on non-final step");return}const b=(A=>{const V={...A||{}},z=Q(r);for(const K of z){if(!K||!K.name)continue;const de=V[K.name];if(K.type==="dragdroplist"&&Array.isArray(de)){const ge=K,me=ge.serialize;if(!me)continue;const Ne=de,Oe=typeof ge.getId=="function"?ge.getId:typeof ge.getId=="string"?ne=>ne==null?void 0:ne[ge.getId]:ne=>(ne==null?void 0:ne.id)??(ne==null?void 0:ne._id)??(ne==null?void 0:ne.key)??String(ne),it=typeof ge.getText=="function"?ge.getText:typeof ge.getText=="string"?ne=>(ne==null?void 0:ne[ge.getText])??String(ne):ne=>(ne==null?void 0:ne.text)??(ne==null?void 0:ne.label)??(ne==null?void 0:ne.name)??(ne==null?void 0:ne.title)??String(ne),pt=(()=>{if(typeof ge.chipText=="function")return ge.chipText;if(typeof ge.chipText=="string")return(ne,Ge)=>ne==null?void 0:ne[ge.chipText]})();let Me=de;typeof me=="function"?Me=Ne.map((ne,Ge)=>me(ne,Ge)):me==="ids"?Me=Ne.map(ne=>Oe(ne)):me==="text"?Me=Ne.map(ne=>it(ne)):me==="chips"?Me=Ne.map((ne,Ge)=>(typeof pt=="function"?pt(ne,Ge):void 0)??""):me&&typeof me=="object"&&"field"in me&&(Me=Ne.map(ne=>ne==null?void 0:ne[me.field])),V[K.name]=Me}}return V})(y);o&&o(b),n(b)},J=async y=>{y&&(y.preventDefault(),y.stopPropagation()),_&&R<I&&await pe()&&le(R+1)},Ie=y=>{y&&(y.preventDefault(),y.stopPropagation()),_&&R>1&&le(R-1)},Ke=y=>y.col?y.col:(y.xs||y.sm||y.md||y.lg||y.xl)&&(y.xs||y.sm||y.md||y.lg||y.xl)||12,Ze=t?g.createTheme({palette:{primary:{main:t.primaryColor||"#1976d2"},secondary:{main:t.secondaryColor||"#dc004e"},background:{default:t.backgroundColor||"#ffffff"},text:{primary:t.textColor||"#000000"}},shape:{borderRadius:t.borderRadius||4},spacing:t.spacing||8,typography:{fontFamily:((S=t.typography)==null?void 0:S.fontFamily)||"Roboto, Arial, sans-serif",fontSize:typeof((j=t.typography)==null?void 0:j.fontSize)=="number"?t.typography.fontSize:14}}):void 0,Tt=()=>{const y=x?{position:"fixed",left:0,right:0,bottom:0,background:"#FFFFFF",pt:2,px:2,pb:2,zIndex:1300,borderTop:"1px solid rgba(0,0,0,0.08)",boxShadow:"0 -2px 8px rgba(0,0,0,0.08)",...k}:d?{position:"sticky",bottom:0,background:"#FFFFFF",pt:2,pb:2,zIndex:1200,borderTop:"1px solid rgba(0,0,0,0.08)",boxShadow:"0 -2px 8px rgba(0,0,0,0.04)",...u}:void 0;if(f&&f.buttons&&f.buttons.length>0){const M={...f,buttons:f.buttons.map(b=>{const A=(b.text||"").toLowerCase(),V=b.type==="submit"||A.includes("submit")||A.includes("save")||A.includes("finish")||A.includes("complete"),z=A.includes("next");let K=!1;return _?(V||z)&&(K=!te):V&&(K=!se),{...b,disabled:b.disabled||K}})};return l.jsx(g.Box,{sx:{mt:3,...y||{}},children:l.jsx(zm,{config:M,onSubmit:be,onStepChange:le,currentStep:R,totalSteps:I,isMultiStep:_,formData:D})})}if(p&&p.length>0){const M=p.map(b=>{const A=(b.text||"").toLowerCase(),V=b.type==="submit"||A.includes("submit")||A.includes("save")||A.includes("finish")||A.includes("complete"),z=A.includes("next");let K=!1;return _?(V||z)&&(K=!te):V&&(K=!se),{...b,disabled:b.disabled||K}});return l.jsx(g.Box,{sx:y,children:l.jsx(Vc,{buttons:M})})}return c?l.jsx(g.Box,{sx:{mt:3,display:"flex",justifyContent:"flex-end",flexDirection:"column",alignItems:"flex-end",...y||{}},children:l.jsxs(g.Box,{sx:{display:"flex",gap:2},children:[_&&R>1&&l.jsx(g.Button,{type:"button",variant:"outlined",onClick:Ie,children:"Previous"}),_?R<I?l.jsx(g.Button,{type:"button",variant:"contained",color:"primary",size:"large",disabled:!te,onClick:J,children:"Next"}):l.jsx(g.Button,{type:"submit",variant:"contained",color:"primary",size:"large",disabled:!te,children:a}):l.jsx(g.Button,{type:"submit",variant:"contained",color:"primary",size:"large",disabled:!se,children:a})]})}):null},Ye=P.useMemo(()=>{const y=[];let M=[];for(const b of h)b.type==="section"&&M.length>0?(y.push(M),M=[b]):M.push(b);return M.length>0&&y.push(M),y},[h]),We=l.jsxs(g.Box,{component:"form",onSubmit:y=>{if(_&&R<I){y.preventDefault(),y.stopPropagation(),te&&J();return}Z(be)(y)},id:e,onKeyDown:y=>{y.key==="Enter"&&_&&R<I&&(y.preventDefault(),te&&J())},sx:{pb:x?10:void 0},children:[_&&l.jsx(Bc,{currentStep:R,totalSteps:I,onStepChange:le,stepTitles:F==null?void 0:F.stepTitles,showStepTitles:(F==null?void 0:F.showStepTitles)!==!1}),Ye.map((y,M)=>{const b=y.find(de=>de.type==="section");if(b&&!W(b,D))return null;const A=(b==null?void 0:b.cardWrap)!==!1,V={p:2,boxShadow:"0px 1px 4px 0px #00000029",background:"#FFFFFF",borderRadius:"6px",display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,width:"100%",mb:2},z={display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,width:"100%",mb:2},K=l.jsx(l.Fragment,{children:y.map(de=>{if(!W(de,D))return null;const ge=Ke(de);return l.jsx(g.Box,{sx:{gridColumn:`span ${ge}`},children:l.jsx(mo,{field:de,control:q,errors:L,baseUrl:w,apiHeaders:$,formData:D,setValue:G})},de.name)})});return A?l.jsx(g.Card,{sx:{...V,...(b==null?void 0:b.cardSx)||{}},...(b==null?void 0:b.cardProps)||{},children:K},`group-${M}`):l.jsx(g.Box,{sx:z,children:K},`group-${M}`)}),Tt()]}),Ue=m?l.jsx(g.Card,{sx:{p:2,boxShadow:"0px 1px 4px 0px #00000029",background:"#FFFFFF",borderRadius:"6px",...C},...v,children:We}):We;return Ze?l.jsx(g.ThemeProvider,{theme:Ze,children:Ue}):Ue},Lm=({src:e,alt:t,width:r="100%",height:n="auto",style:i,className:a,onClick:o})=>l.jsx(g.Box,{sx:{textAlign:"center"},children:l.jsx("img",{src:e||"/placeholder-image.png",alt:t||"Image",width:r,height:n,style:{maxWidth:"100%",height:"auto",borderRadius:"8px",cursor:o?"pointer":"default",...i},className:a,onClick:o,onError:s=>{s.currentTarget.src="/placeholder-image.png"}})});function Ir(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(f){try{p(n.next(f))}catch(d){o(d)}}function c(f){try{p(n.throw(f))}catch(d){o(d)}}function p(f){f.done?a(f.value):i(f.value).then(s,c)}p((n=n.apply(e,t||[])).next())})}const qm=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function ln(e,t,r){const n=Wm(e),{webkitRelativePath:i}=e,a=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof n.path!="string"&&Ns(n,"path",a),Ns(n,"relativePath",a),n}function Wm(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const n=t.split(".").pop().toLowerCase(),i=qm.get(n);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function Ns(e,t,r){Object.defineProperty(e,t,{value:r,writable:!1,configurable:!1,enumerable:!0})}const Um=[".DS_Store","Thumbs.db"];function Hm(e){return Ir(this,void 0,void 0,function*(){return yi(e)&&Km(e.dataTransfer)?Zm(e.dataTransfer,e.type):Ym(e)?Gm(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Qm(e):[]})}function Km(e){return yi(e)}function Ym(e){return yi(e)&&yi(e.target)}function yi(e){return typeof e=="object"&&e!==null}function Gm(e){return za(e.target.files).map(t=>ln(t))}function Qm(e){return Ir(this,void 0,void 0,function*(){return(yield Promise.all(e.map(r=>r.getFile()))).map(r=>ln(r))})}function Zm(e,t){return Ir(this,void 0,void 0,function*(){if(e.items){const r=za(e.items).filter(i=>i.kind==="file");if(t!=="drop")return r;const n=yield Promise.all(r.map(Xm));return Ls(Lc(n))}return Ls(za(e.files).map(r=>ln(r)))})}function Ls(e){return e.filter(t=>Um.indexOf(t.name)===-1)}function za(e){if(e===null)return[];const t=[];for(let r=0;r<e.length;r++){const n=e[r];t.push(n)}return t}function Xm(e){if(typeof e.webkitGetAsEntry!="function")return qs(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?qc(t):qs(e,t)}function Lc(e){return e.reduce((t,r)=>[...t,...Array.isArray(r)?Lc(r):[r]],[])}function qs(e,t){return Ir(this,void 0,void 0,function*(){var r;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const a=yield e.getAsFileSystemHandle();if(a===null)throw new Error(`${e} is not a File`);if(a!==void 0){const o=yield a.getFile();return o.handle=a,ln(o)}}const n=e.getAsFile();if(!n)throw new Error(`${e} is not a File`);return ln(n,(r=t==null?void 0:t.fullPath)!==null&&r!==void 0?r:void 0)})}function Jm(e){return Ir(this,void 0,void 0,function*(){return e.isDirectory?qc(e):eg(e)})}function qc(e){const t=e.createReader();return new Promise((r,n)=>{const i=[];function a(){t.readEntries(o=>Ir(this,void 0,void 0,function*(){if(o.length){const s=Promise.all(o.map(Jm));i.push(s),a()}else try{const s=yield Promise.all(i);r(s)}catch(s){n(s)}}),o=>{n(o)})}a()})}function eg(e){return Ir(this,void 0,void 0,function*(){return new Promise((t,r)=>{e.file(n=>{const i=ln(n,e.fullPath);t(i)},n=>{r(n)})})})}var Wn={},Ws;function tg(){return Ws||(Ws=1,Wn.__esModule=!0,Wn.default=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(",");if(r.length===0)return!0;var n=e.name||"",i=(e.type||"").toLowerCase(),a=i.replace(/\/.*$/,"");return r.some(function(o){var s=o.trim().toLowerCase();return s.charAt(0)==="."?n.toLowerCase().endsWith(s):s.endsWith("/*")?a===s.replace(/\/.*$/,""):i===s})}return!0}),Wn}var rg=tg();const la=Qa(rg);function Us(e){return ag(e)||ig(e)||Uc(e)||ng()}function ng(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "finform-react-builder",
3
- "version": "1.12.8",
3
+ "version": "1.12.9",
4
4
  "description": "A powerful, flexible React form builder with dynamic field rendering, custom validation, multi-step forms, Material-UI integration, image component support, toggle/radio buttons, switches, autocomplete, and advanced button positioning",
5
5
  "keywords": [
6
6
  "react",