finform-react-builder 1.11.0 → 1.11.1
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 +33 -29
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -9097,36 +9097,40 @@ const el = yt(/* @__PURE__ */ p("path", {
|
|
|
9097
9097
|
},
|
|
9098
9098
|
getOptionLabel: (w) => typeof w == "string" ? w : (w == null ? void 0 : w.label) ?? "",
|
|
9099
9099
|
isOptionEqualToValue: (w, v) => ((w == null ? void 0 : w.value) ?? w) === ((v == null ? void 0 : v.value) ?? v),
|
|
9100
|
-
renderOption: (w, v, { selected: T }) =>
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9100
|
+
renderOption: (w, v, { selected: T }) => {
|
|
9101
|
+
const { key: P, ...A } = w;
|
|
9102
|
+
return /* @__PURE__ */ te(
|
|
9103
|
+
K,
|
|
9104
|
+
{
|
|
9105
|
+
component: "li",
|
|
9106
|
+
...A,
|
|
9107
|
+
sx: {
|
|
9108
|
+
backgroundColor: X.background.paper,
|
|
9109
|
+
color: X.text.primary,
|
|
9110
|
+
mx: 0.5,
|
|
9111
|
+
borderRadius: "4px",
|
|
9112
|
+
"&:hover": { backgroundColor: it[50] },
|
|
9113
|
+
"&.Mui-focused": { backgroundColor: it[50] },
|
|
9114
|
+
...T ? { backgroundColor: it[50] } : {}
|
|
9115
|
+
},
|
|
9116
|
+
children: [
|
|
9117
|
+
n && /* @__PURE__ */ p($n, { checked: T }),
|
|
9118
|
+
/* @__PURE__ */ p(
|
|
9119
|
+
me,
|
|
9120
|
+
{
|
|
9121
|
+
variant: "body2",
|
|
9122
|
+
sx: {
|
|
9123
|
+
color: X.text.primary,
|
|
9124
|
+
fontSize: 14
|
|
9125
|
+
},
|
|
9126
|
+
children: typeof v == "string" ? v : v.label
|
|
9127
|
+
}
|
|
9128
|
+
)
|
|
9129
|
+
]
|
|
9113
9130
|
},
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
me,
|
|
9118
|
-
{
|
|
9119
|
-
variant: "body2",
|
|
9120
|
-
sx: {
|
|
9121
|
-
color: X.text.primary,
|
|
9122
|
-
fontSize: 14
|
|
9123
|
-
},
|
|
9124
|
-
children: typeof v == "string" ? v : v.label
|
|
9125
|
-
}
|
|
9126
|
-
)
|
|
9127
|
-
]
|
|
9128
|
-
}
|
|
9129
|
-
),
|
|
9131
|
+
P
|
|
9132
|
+
);
|
|
9133
|
+
},
|
|
9130
9134
|
renderInput: (w) => /* @__PURE__ */ p(
|
|
9131
9135
|
Mi,
|
|
9132
9136
|
{
|
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,Fh=typeof Ra!="string"?fr.css`
|
|
174
174
|
animation: ${Ra} 1.4s ease-in-out infinite;
|
|
175
175
|
`:null,Ah=e=>{const{classes:t,variant:r,color:n,disableShrink:i}=e,a={root:["root",r,`color${Ie(n)}`],svg:["svg"],circle:["circle",`circle${Ie(r)}`,i&&"circleDisableShrink"]};return un(a,Th,t)},Oh=gt("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`color${Ie(r.color)}`]]}})(Pr(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:jh||{animation:`${_a} 1.4s linear infinite`}},...Object.entries(e.palette).filter(li()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),_h=gt("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),Rh=gt("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t[`circle${Ie(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:Fh||{animation:`${Ra} 1.4s ease-in-out infinite`}}]}))),ac=ie.forwardRef(function(t,r){const n=Ir({props:t,name:"MuiCircularProgress"}),{className:i,color:a="primary",disableShrink:s=!1,size:o=40,style:c,thickness:p=3.6,value:f=0,variant:d="indeterminate",...u}=n,y={...n,color:a,disableShrink:s,size:o,thickness:p,value:f,variant:d},E=Ah(y),m={},S={},v={};if(d==="determinate"){const j=2*Math.PI*((Qt-p)/2);m.strokeDasharray=j.toFixed(3),v["aria-valuenow"]=Math.round(f),m.strokeDashoffset=`${((100-f)/100*j).toFixed(3)}px`,S.transform="rotate(-90deg)"}return l.jsx(Oh,{className:at(E.root,i),style:{width:o,height:o,...S,...c},ownerState:y,ref:r,role:"progressbar",...v,...u,children:l.jsx(_h,{className:E.svg,ownerState:y,viewBox:`${Qt/2} ${Qt/2} ${Qt} ${Qt}`,children:l.jsx(Rh,{className:E.circle,style:m,ownerState:y,cx:Qt,cy:Qt,r:(Qt-p)/2,fill:"none",strokeWidth:p})})})});process.env.NODE_ENV!=="production"&&(ac.propTypes={classes:k.object,className:k.string,color:k.oneOfType([k.oneOf(["inherit","primary","secondary","error","info","success","warning"]),k.string]),disableShrink:is(k.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:k.oneOfType([k.number,k.string]),style:k.object,sx:k.oneOfType([k.arrayOf(k.oneOfType([k.func,k.object,k.bool])),k.func,k.object]),thickness:k.number,value:k.number,variant:k.oneOf(["determinate","indeterminate"])});function $h(e){return mr("MuiIconButton",e)}const Fo=Dr("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),Ph=e=>{const{classes:t,disabled:r,color:n,edge:i,size:a,loading:s}=e,o={root:["root",s&&"loading",r&&"disabled",n!=="default"&&`color${Ie(n)}`,i&&`edge${Ie(i)}`,`size${Ie(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return un(o,$h,t)},Dh=gt(ic,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.loading&&t.loading,r.color!=="default"&&t[`color${Ie(r.color)}`],r.edge&&t[`edge${Ie(r.edge)}`],t[`size${Ie(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})`:Et(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(li()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(li()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.vars?`rgba(${(e.vars||e).palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Et((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)}}],[`&.${Fo.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${Fo.loading}`]:{color:"transparent"}}))),Ih=gt("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=Ir({props:t,name:"MuiIconButton"}),{edge:i=!1,children:a,className:s,color:o="default",disabled:c=!1,disableFocusRipple:p=!1,size:f="medium",id:d,loading:u=null,loadingIndicator:y,...E}=n,m=Xf(d),S=y??l.jsx(ac,{"aria-labelledby":m,color:"inherit",size:16}),v={...n,edge:i,color:o,disabled:c,disableFocusRipple:p,loading:u,loadingIndicator:S,size:f},j=Ph(v);return l.jsxs(Dh,{id:u?m:d,className:at(j.root,s),centerRipple:!0,focusRipple:!p,disabled:c||u,ref:r,...E,ownerState:v,children:[typeof u=="boolean"&&l.jsx("span",{className:j.loadingWrapper,style:{display:"contents"},children:l.jsx(Ih,{className:j.loadingIndicator,ownerState:v,children:u&&S})}),a]})});process.env.NODE_ENV!=="production"&&(Gn.propTypes={children:is(k.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:k.object,className:k.string,color:k.oneOfType([k.oneOf(["inherit","default","primary","secondary","error","info","success","warning"]),k.string]),disabled:k.bool,disableFocusRipple:k.bool,disableRipple:k.bool,edge:k.oneOf(["end","start",!1]),id:k.string,loading:k.bool,loadingIndicator:k.node,size:k.oneOfType([k.oneOf(["small","medium","large"]),k.string]),sx:k.oneOfType([k.arrayOf(k.oneOfType([k.func,k.object,k.bool])),k.func,k.object])});const Ao=pt(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"),Oo=pt(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"),Mh=pt(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"),ls=pt(l.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),pi=pt(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"),zh=pt(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"),J={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"},_o=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}},Bh=(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(""),Lt=(e,t,r)=>{const n=_o(e),i=_o(t);return Bh(n.r+(i.r-n.r)*r,n.g+(i.g-n.g)*r,n.b+(i.b-n.b)*r)},cs=e=>{const t="#FFFFFF",r="#000000";return{50:Lt(t,e,.08),100:Lt(t,e,.16),200:Lt(t,e,.28),300:Lt(t,e,.4),400:Lt(t,e,.55),500:e,600:Lt(e,r,.1),700:Lt(e,r,.2),800:Lt(e,r,.3),900:Lt(e,r,.42)}},Vh=cs(J.primary.main),Nh=cs(J.secondary.main),Ze=cs(J.text.primary),Lh={primary:J.primary.main,secondary:J.secondary.main,textPrimary:J.text.primary,textSecondary:J.text.secondary,divider:J.divider,background:J.background},vt=({hasError:e,sx:t,labelText:r,labelVariant:n="subtitle2",endAdornment:i,endorsementText:a,endorsementBg:s="#E6E8EC",endorsementColor:o="#111827",endorsementRadius:c="6px",endorsementHeight:p=28,endorsementPaddingX:f="8px",...d})=>{var m,S;const u=!!r,y=a?l.jsx(x.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:s,color:o,fontSize:12,fontWeight:300,lineHeight:1,whiteSpace:"nowrap"},children:a}):null,E={...d.InputProps,endAdornment:y||i?l.jsxs(x.InputAdornment,{sx:{mr:-1},position:"end",children:[y||i,(m=d.InputProps)==null?void 0:m.endAdornment]}):(S=d.InputProps)==null?void 0:S.endAdornment};return l.jsxs(x.Box,{children:[u&&l.jsx(x.Typography,{variant:n,sx:{color:J.text.primary,mb:.5,fontWeight:500},children:r}),l.jsx(x.TextField,{fullWidth:!0,size:"small",...d,InputProps:E,label:u?void 0:d.label,sx:{"& .MuiOutlinedInput-root":{backgroundColor:J.background.paper,borderRadius:"8px","& fieldset":{borderColor:J.divider},"&:hover fieldset":{borderColor:Ze[300]},"&.Mui-focused fieldset":{borderColor:Ze[400]},"&.Mui-error fieldset":{borderColor:J.error.main}},"& .MuiInputBase-input":{color:J.text.primary},"& .MuiFormLabel-root":{color:J.text.secondary},"& .MuiFormLabel-root.Mui-focused":{color:J.text.primary},"& .MuiFormHelperText-root":{color:e?J.error.main:J.text.secondary},...t}})]})},$i=({labelText:e,label:t,options:r,loading:n,helperText:i,size:a="small",labelVariant:s="subtitle2",placeholder:o,value:c,sx:p,...f})=>{const d=P.useId(),u=c==null||c===""||Array.isArray(c)&&c.length===0,y=E=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...E,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:J.text.secondary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});return l.jsxs(x.FormControl,{fullWidth:!0,size:a,error:!!f.error,variant:"outlined",children:[e&&l.jsx(x.Typography,{variant:s,sx:{color:J.text.primary,mb:.5,fontWeight:500},children:e}),t&&l.jsx(x.InputLabel,{id:d,shrink:!u||!!o,sx:{color:J.text.secondary,"&.Mui-focused":{color:J.text.primary},"&.Mui-error":{color:J.error.main}},children:t}),l.jsx(x.Select,{...f,value:c,labelId:t?d:void 0,label:t,displayEmpty:!0,input:l.jsx(x.OutlinedInput,{label:t}),IconComponent:y,renderValue:E=>{const m=E;if(u)return l.jsx("span",{style:{color:J.text.secondary},children:o??""});const S=r.find(v=>v.value===m);return(S==null?void 0:S.label)??String(m)},endAdornment:n?l.jsx(x.CircularProgress,{size:20}):void 0,MenuProps:{PaperProps:{sx:{boxShadow:"0px 0px 10px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${J.divider}`,mt:.5,borderRadius:"8px"}}},sx:{backgroundColor:J.background.paper,boxShadow:"none",borderRadius:"8px",height:"40px","& .MuiSelect-select":{color:J.text.primary,fontSize:14,pr:3},"& .MuiOutlinedInput-notchedOutline":{borderColor:J.divider},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:Ze[300]},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:Ze[400]},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:J.error.main},"& svg":{right:8,position:"absolute",pointerEvents:"none"},...p},children:n?l.jsx(x.MenuItem,{disabled:!0,children:l.jsx(x.CircularProgress,{size:16})}):r.map(E=>l.jsx(x.MenuItem,{value:E.value,sx:{backgroundColor:J.background.paper,color:J.text.primary,fontSize:14,mx:1,"&:hover":{backgroundColor:Ze[50],borderRadius:"4px"},"&.Mui-selected":{backgroundColor:Ze[50],borderRadius:"4px"}},children:E.label},E.value))}),i&&l.jsx(x.FormHelperText,{children:i})]})},qh=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:J.text.secondary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),sc=({id:e,options:t,value:r,multiple:n,label:i,labelText:a,placeholder:s,onChange:o,labelVariant:c="subtitle2",disabled:p,loading:f,error:d,helperText:u,onOpen:y,noOptionsText:E,sx:m})=>l.jsxs(x.Box,{children:[a&&l.jsx(x.Typography,{variant:c,sx:{color:J.text.primary,mb:.5,fontWeight:500},children:a}),l.jsx(x.Autocomplete,{id:e,options:t,value:r,multiple:n,size:"small",popupIcon:l.jsx(qh,{}),disabled:p,loading:f,onOpen:y,noOptionsText:E,fullWidth:!0,componentsProps:{paper:{sx:{boxShadow:"0px 0px 10px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${J.divider}`,mt:.5,borderRadius:"8px"}}},sx:{"& .MuiOutlinedInput-root":{backgroundColor:J.background.paper,borderRadius:"8px",height:"40px","& fieldset":{borderColor:J.divider},"&:hover fieldset":{borderColor:Ze[300]},"&.Mui-focused fieldset":{borderColor:Ze[400]},"&.Mui-error fieldset":{borderColor:J.error.main}},"& .MuiInputBase-input":{color:J.text.primary,fontSize:14},"& .MuiAutocomplete-popupIndicator":{color:J.text.secondary},"& .MuiAutocomplete-endAdornment svg":{width:16,height:16},...m},getOptionLabel:S=>typeof S=="string"?S:(S==null?void 0:S.label)??"",isOptionEqualToValue:(S,v)=>((S==null?void 0:S.value)??S)===((v==null?void 0:v.value)??v),renderOption:(S,v,{selected:j})=>l.jsxs(x.Box,{component:"li",...S,sx:{backgroundColor:J.background.paper,color:J.text.primary,mx:.5,borderRadius:"4px","&:hover":{backgroundColor:Ze[50]},"&.Mui-focused":{backgroundColor:Ze[50]},...j?{backgroundColor:Ze[50]}:{}},children:[n&&l.jsx(x.Checkbox,{checked:j}),l.jsx(x.Typography,{variant:"body2",sx:{color:J.text.primary,fontSize:14},children:typeof v=="string"?v:v.label})]}),renderInput:S=>l.jsx(x.TextField,{...S,label:i,placeholder:s,size:"small",error:d,helperText:u,InputLabelProps:{shrink:!!r||!!s,sx:{color:J.text.secondary,"&.Mui-focused":{color:J.text.primary},"&.Mui-error":{color:J.error.main}}},InputProps:{...S.InputProps,endAdornment:l.jsxs(l.Fragment,{children:[f?l.jsx(x.CircularProgress,{size:20}):null,S.InputProps.endAdornment]})}}),onChange:(S,v)=>o(v)})]}),Ht=({label:e,checked:t,disabled:r,onChange:n,sx:i})=>l.jsx(x.FormControlLabel,{control:l.jsx(x.Checkbox,{size:"small",checked:t,disabled:r,onChange:(a,s)=>n(s)}),label:e,sx:a=>({"& .MuiFormControlLabel-label":{color:a.palette.text.primary,fontSize:14},...i})}),oc=({labelText:e,label:t,value:r=[],options:n,row:i=!1,onChange:a,labelPosition:s="top",labelVariant:o="subtitle2",helperText:c,error:p,groupPadding:f=1.5,itemGap:d=1,disabled:u=!1})=>{const y=typeof i=="number"&&i>0,E=y?i:12,m=i===!0,S=i===!1&&!y,v=(j,D)=>{const F=Array.isArray(r)?[...r]:[];D?F.includes(j)||a([...F,j]):a(F.filter(C=>C!==j))};return l.jsxs(x.FormControl,{error:p,disabled:u,sx:j=>{var D;return{display:"flex",flexDirection:"column",px:j.spacing(f),borderRadius:((D=j.shape)==null?void 0:D.borderRadius)||8,mx:-2.5,backgroundColor:j.palette.background.paper}},children:[s==="top"&&e&&l.jsx(x.Typography,{variant:o,sx:j=>({color:j.palette.text.primary,mb:.5,fontSize:j.typography.fontSize,fontWeight:500}),children:e}),t&&l.jsx(x.FormLabel,{sx:j=>({color:j.palette.text.secondary,mb:.5,mx:1,fontSize:j.typography.fontSize||12,fontWeight:500,"&.Mui-focused":{color:j.palette.text.primary},"&.Mui-error":{color:j.palette.error.main}}),children:t}),y&&l.jsx(x.Box,{sx:j=>({display:"grid",gridTemplateColumns:`repeat(${E}, 1fr)`,gap:j.spacing(d),mt:0}),children:n.map(j=>{const D=Array.isArray(r)&&r.includes(j.value);return l.jsx(x.FormControlLabel,{control:l.jsx(x.Checkbox,{size:"small",checked:D,onChange:F=>v(j.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:j.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(j.value))})}),m&&l.jsx(x.Box,{sx:j=>({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:j.spacing(d),alignItems:"center",mt:0}),children:n.map(j=>{const D=Array.isArray(r)&&r.includes(j.value);return l.jsx(x.FormControlLabel,{control:l.jsx(x.Checkbox,{size:"small",checked:D,onChange:F=>v(j.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:j.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(j.value))})}),S&&l.jsx(x.Box,{sx:j=>({display:"flex",flexDirection:"column",gap:j.spacing(d),alignItems:"flex-start",mt:0}),children:n.map(j=>{const D=Array.isArray(r)&&r.includes(j.value);return l.jsx(x.FormControlLabel,{control:l.jsx(x.Checkbox,{size:"small",checked:D,onChange:F=>v(j.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:j.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(j.value))})}),c&&l.jsx(x.FormHelperText,{sx:{mt:.5},children:c})]})},di=({label:e,checked:t,disabled:r,onChange:n,sx:i})=>l.jsx(x.FormControlLabel,{control:l.jsx(x.Switch,{checked:t,disabled:r,onChange:(a,s)=>n(s)}),label:e,sx:a=>({"& .MuiFormControlLabel-label":{color:a.palette.text.primary,fontSize:14},...i})}),Sr=({labelText:e,label:t,value:r,options:n,row:i=!1,onChange:a,labelPosition:s="top",labelVariant:o="subtitle2",helperText:c,error:p,groupPadding:f=1.5,itemGap:d=1})=>l.jsxs(x.FormControl,{error:p,sx:u=>{var y;return{display:"flex",flexDirection:"column",px:u.spacing(f),borderRadius:((y=u.shape)==null?void 0:y.borderRadius)||8,mx:-2.5,backgroundColor:u.palette.background.paper}},children:[s==="top"&&e&&l.jsx(x.Typography,{variant:o,sx:u=>({color:u.palette.text.primary,mb:.5,fontSize:u.typography.fontSize,fontWeight:500}),children:e}),t&&l.jsx(x.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(x.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(x.FormControlLabel,{value:u.value,control:l.jsx(x.Radio,{size:"small",sx:y=>({color:y.palette.text.secondary,"&.Mui-checked":{color:y.palette.primary.main}})}),label:l.jsxs(x.Box,{sx:{display:"flex",flexDirection:"column",gap:0},children:[l.jsx(x.Typography,{variant:"body2",sx:{color:"#1a1a1a",fontSize:12,fontWeight:400,lineHeight:1.5},children:u.label}),u.description&&l.jsx(x.Typography,{variant:"caption",sx:{color:"#1a1a1a",fontSize:10,fontWeight:300,lineHeight:1.5},children:u.description})]}),sx:{m:0,gap:.5,"& .MuiFormControlLabel-label":{marginLeft:0},"& .MuiRadio-root":{alignSelf:"flex-start",marginTop:0}}},String(u.value)))}),c&&l.jsx(x.FormHelperText,{sx:{mt:.5},children:c})]}),us=({labelPosition:e="inner",labelVariant:t="subtitle2",label:r,sx:n,...i})=>l.jsxs(x.Box,{children:[e==="top"&&r&&l.jsx(x.Typography,{variant:t,sx:{color:"#111827",mb:.5},children:r}),l.jsx(x.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}})]}),lc=({labelText:e,labelVariant:t="subtitle2",hasError:r,sx:n,label:i,...a})=>{const s=!!e;return l.jsxs(x.Box,{children:[s&&l.jsx(x.Typography,{variant:t,sx:{color:J.text.primary,mb:.5,fontWeight:500},children:e}),l.jsx(x.TextField,{fullWidth:!0,multiline:!0,minRows:3,size:"small",...a,label:s?void 0:i,sx:{"& .MuiOutlinedInput-root":{backgroundColor:J.background.paper,borderRadius:"8px","& fieldset":{borderColor:J.divider},"&:hover fieldset":{borderColor:Ze[300]},"&.Mui-focused fieldset":{borderColor:Ze[400]},"&.Mui-error fieldset":{borderColor:J.error.main}},"& .MuiInputBase-input":{color:J.text.primary,fontSize:14},"& .MuiFormLabel-root":{color:J.text.secondary},"& .MuiFormLabel-root.Mui-focused":{color:J.text.primary},"& .MuiFormHelperText-root":{color:r?J.error.main:J.text.secondary},...n}})]})},cc=({title:e,subtitle:t,actions:r,align:n="left",sx:i})=>l.jsxs(x.Box,{sx:a=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:a.spacing(1),py:a.spacing(1),...i}),children:[l.jsxs(x.Box,{sx:{display:"flex",flexDirection:"column",minWidth:0,flex:1,textAlign:n},children:[e&&l.jsx(x.Typography,{variant:"h6",sx:a=>({color:a.palette.text.primary,fontSize:12,fontWeight:600,lineHeight:1.3}),children:e}),t&&l.jsx(x.Typography,{variant:"body2",sx:a=>({color:a.palette.text.secondary,mt:e?.5:0,fontSize:12,fontWeight:300}),children:t})]}),r&&l.jsx(x.Box,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:r})]}),yn=pt(l.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),uc=()=>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 pc({items:e,getId:t,onReorder:r,header:n,disabled:i,sx:a,getText:s,showIndex:o=!0,showLeftIcon:c=!0,renderItem:p,chipText:f,helperText:d,emptyStateText:u,emptyStateButtonText:y="Add Phase",onEmptyStateButtonClick:E,emptyStateSx:m}){const[S,v]=P.useState(null),[j,D]=P.useState(null),F=h=>M=>{if(!i){v(h),M.dataTransfer.effectAllowed="move";try{M.dataTransfer.setData("text/plain",String(t(e[h])))}catch{}}},C=h=>M=>{i||(M.preventDefault(),D(h),M.dataTransfer.dropEffect="move")},_=h=>M=>{if(i)return;if(M.preventDefault(),S===null||S===h){v(null),D(null);return}const q=[...e],[G]=q.splice(S,1);q.splice(h,0,G),v(null),D(null),r(q)},I=()=>{v(null),D(null)},R=e.length===0,Y=R&&(u||E!==void 0);return l.jsxs(x.Box,{role:"list",sx:h=>({display:"flex",flexDirection:"column",gap:h.spacing(1),...a}),children:[n,!R&&l.jsx(x.Divider,{sx:{mt:-.5,mb:1,dividerColor:"#EBEBEB"}}),Y?l.jsxs(x.Box,{sx:h=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",padding:h.spacing(4),backgroundColor:h.palette.mode==="dark"?"#000000":J.background.paper,border:`2px dashed ${h.palette.mode==="dark"?"#FFFFFF":J.divider}`,borderRadius:"8px",textAlign:"center",...m}),children:[u&&l.jsx(x.Typography,{variant:"body1",sx:h=>({color:h.palette.text.secondary,fontSize:"14px",fontWeight:400,lineHeight:1.5,mb:E?2:0,maxWidth:"400px"}),children:u}),E&&l.jsx(x.Button,{variant:"outlined",startIcon:l.jsx(yn,{}),onClick:E,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:y})]}):e.map((h,M)=>{const q=S===M,G=j===M&&S!==null&&S!==M;return l.jsx(x.Box,{role:"listitem",draggable:!i,onDragStart:F(M),onDragOver:C(M),onDrop:_(M),onDragEnd:I,sx:B=>({userSelect:"none",cursor:i?"default":"grab",backgroundColor:"#F8F8FA",border:`1px solid ${G?B.palette.primary.main:"#EBEBEB"}`,borderRadius:"8px",padding:B.spacing(1),opacity:q?.6:1,boxShadow:G?`0 0 0 2px ${B.palette.primary.main}33`:"none"}),children:p?p(h,q):l.jsxs(x.Box,{sx:B=>({display:"flex",alignItems:"center",gap:B.spacing(1),minWidth:0}),children:[c&&l.jsx(uc,{}),o&&l.jsxs(x.Typography,{variant:"body2",sx:B=>({fontWeight:600,fontSize:14,color:`${B.palette.text.primary}`,flex:"0 0 auto"}),children:[M+1,"."]}),(()=>{const B=typeof f=="function"?f(h,M):f;return B?l.jsx(x.Chip,{label:B,sx:{borderRadius:"4px",p:"12px 3px"},size:"small"}):null})(),l.jsx(x.Typography,{variant:"body2",sx:B=>({fontSize:12,fontWeight:500,color:`${B.palette.text.primary}90`,flex:1,minWidth:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),children:s?s(h):""})]})},String(t(h)))}),!R&&d?typeof d=="string"?l.jsx(x.Typography,{variant:"caption",sx:h=>({color:`${h.palette.text.primary}60`}),children:d}):d:null]})}const Wh=gt(x.StepConnector)(({theme:e})=>{const t=e.palette.divider||"#E8E8E8",r=e.palette.primary.main;return{[`&.${x.stepConnectorClasses.vertical}`]:{marginLeft:11},[`& .${x.stepConnectorClasses.line}`]:{minHeight:28,borderLeftWidth:2,borderColor:t,transition:"border-color 0.3s ease"},[`&.${x.stepConnectorClasses.completed} .${x.stepConnectorClasses.line}`]:{borderColor:r}}}),Uh=({items:e,activeIndex:t=1,onStepClick:r,sx:n,completedSteps:i})=>{const a=_f(),s=a.palette.primary.main,o=a.palette.text.primary,c=a.palette.divider,p=a.palette.action&&a.palette.action.disabledBackground||"#E8E8E8",f=d=>{const{active:u,completed:y,icon:E}=d;return y?l.jsx(x.Box,{sx:{width:24,height:24,border:`1.2px solid ${s}`,borderRadius:"50%",backgroundColor:s,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(ls,{sx:{fontSize:16,fontWeight:600}})}):u?l.jsx(x.Box,{sx:{width:24,height:24,borderRadius:"50%",border:`1.2px solid ${s}`,backgroundColor:Et(s,.2),color:s,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12},children:E}):l.jsx(x.Box,{sx:{width:24,height:24,borderRadius:"50%",backgroundColor:p,color:o,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12},children:E})};return l.jsx(x.Stepper,{orientation:"vertical",activeStep:t,connector:l.jsx(Wh,{}),sx:{"& .MuiStepConnector-vertical":{my:-1.1},"& .MuiStepLabel-label":{fontSize:14,color:o,fontWeight:500},"& .MuiStep-root":{cursor:r?"pointer":"default"},...n},children:e.map((d,u)=>{const y=Array.isArray(i)&&i.length>0?i.includes(u):u<t;return l.jsxs(x.Step,{onClick:()=>r==null?void 0:r(u),completed:y,children:[l.jsx(x.StepLabel,{StepIconComponent:f,children:l.jsx(x.Typography,{sx:{fontSize:12,fontWeight:500,color:u===t?s:o},children:d.label})}),u!==e.length-1&&l.jsx(x.Divider,{sx:{ml:4.2,borderColor:c}})]},u)})})},ps=({colorKey:e="primary",colorHex:t,tone:r="soft",bgAlpha:n=.12,borderAlpha:i=.24,sx:a,...s})=>l.jsx(x.Chip,{...s,sx:o=>({fontWeight:600,borderRadius:"4px",height:18,border:`0.5px solid ${Et(t||o.palette.text.primary,.5)}`,backgroundColor:Et(t||o.palette.text.primary,.1),"& .MuiChip-label":{p:"8px",color:t||o.palette.text.primary,fontSize:10,fontWeight:500},...a})}),Hh=gt(x.StepConnector)(()=>({[`&.${x.stepConnectorClasses.vertical}`]:{marginLeft:11},[`& .${x.stepConnectorClasses.line}`]:{minHeight:28,borderLeftWidth:2,height:"70px",borderColor:"#E8E8E8",transition:"border-color 0.3s ease",zIndex:-1},[`&.${x.stepConnectorClasses.completed} .${x.stepConnectorClasses.line}`]:{borderColor:J.primary.main}})),Kh=({items:e,activeIndex:t=1,onStepClick:r,sx:n})=>{const[i,a]=P.useState(null),s=o=>{const{active:c,completed:p,icon:f}=o;return p?l.jsx(x.Box,{sx:{width:24,height:24,border:`1.2px solid ${J.primary.main}`,borderRadius:"50%",backgroundColor:J.primary.main,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:l.jsx(ls,{sx:{fontSize:16,fontWeight:600}})}):c?l.jsx(x.Box,{sx:{width:24,height:24,borderRadius:"50%",border:`1.2px solid ${J.primary.main}`,backgroundColor:Et(J.primary.main,.2),color:J.primary.main,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12,zIndex:1e3,overflow:"hidden"},children:f}):l.jsx(x.Box,{sx:{width:24,height:24,borderRadius:"50%",backgroundColor:"#E8E8E8",color:J.text.primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12,zIndex:1e3},children:f})};return l.jsx(x.Stepper,{orientation:"vertical",activeStep:t,connector:l.jsx(Hh,{}),sx:{"& .MuiStepConnector-vertical":{my:-3.5},"& .MuiStepLabel-label":{fontSize:14,color:J.text.primary,fontWeight:500},"& .MuiStep-root":{cursor:r?"pointer":"default"},...n},children:e.map((o,c)=>l.jsxs(x.Step,{onMouseEnter:()=>a(c),onMouseLeave:()=>a(null),onClick:()=>r==null?void 0:r(c),completed:c<t,children:[l.jsxs(x.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[l.jsxs(x.StepLabel,{StepIconComponent:s,children:[l.jsxs(x.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[l.jsx(x.Typography,{sx:{fontSize:14,fontWeight:500,color:c===t?J.primary.main:J.text.primary},children:o.label}),l.jsx(ps,{size:"small",colorHex:c<t?J.success.main:c===t?"#973B00":J.text.primary,label:c<t?"Completed":c===t?"In progress":"Not started"})]}),l.jsx(x.Typography,{sx:{fontSize:12,fontWeight:400,color:`${J.text.primary}60`,mt:.5,width:"80%"},children:o.description})]}),i===c&&l.jsx(x.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(x.Divider,{sx:{ml:4.2,borderColor:J.divider}})]},c))})},Yh=pt(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"),Gh=({variant:e="list",title:t,subtitle:r,text:n,items:i=[],icon:a,colorHex:s,sx:o})=>{const c=s||J.info.main,p=Et(c,.08),f=Et(c,.08),d=a??l.jsx(Yh,{sx:{color:c,fontSize:18}});return e==="inlineInfo"?l.jsxs(x.Card,{sx:{p:1.5,display:"flex",alignItems:"center",gap:1,backgroundColor:p,border:`1px solid ${f}`,boxShadow:"none",...o},children:[l.jsx(x.Box,{sx:{display:"flex",alignItems:"center"},children:d}),l.jsx(x.Typography,{variant:"body2",sx:{fontWeight:400,fontSize:12,lineHeight:1.3,color:c},children:n})]}):e==="inline"?l.jsx(x.Card,{sx:{p:1.5,display:"flex",alignItems:"center",gap:1,backgroundColor:p,border:`1px solid ${f}`,boxShadow:"none",...o},children:l.jsx(x.Typography,{variant:"body2",sx:{fontWeight:400,fontSize:12,lineHeight:1.3,color:c},children:n})}):e==="listWithHeader"?l.jsxs(x.Card,{sx:{p:2,boxShadow:"none",borderRadius:"6px",backgroundColor:p,border:`1px solid ${f}`,...o},children:[l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d,l.jsx(x.Typography,{variant:"subtitle2",sx:{fontWeight:600,color:c,fontSize:14,lineHeight:1.3},children:t})]}),r&&l.jsx(x.Typography,{variant:"body2",sx:{mt:.5,color:c,fontSize:10,lineHeight:1.3},children:r}),l.jsx(x.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,y)=>l.jsx(x.ListItem,{sx:{py:0},children:l.jsx(x.ListItemText,{primary:u})},y))})]}):l.jsx(x.Card,{sx:{p:"11px",borderRadius:"8px",backgroundColor:p,border:`0.5px solid ${f}`,boxShadow:"none",...o},children:l.jsx(x.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,y)=>l.jsx(x.ListItem,{sx:{py:0},children:l.jsx(x.ListItemText,{primary:u})},y))})})},dc=({value:e,onChange:t,items:r,ariaLabel:n,sx:i,tabSx:a})=>l.jsxs(x.Box,{children:[l.jsx(x.Tabs,{value:e,onChange:(s,o)=>t(o),"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((s,o)=>{const c=typeof s.value=="string"||typeof s.value=="number"?s.value:o;return l.jsx(x.Tab,{value:c,disabled:s.disabled,label:l.jsx(x.Typography,{variant:"body2",children:s.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((s,o)=>{const c=typeof s.value=="string"||typeof s.value=="number"?s.value:o,p=s.content??(typeof s.value=="object"?s.value:null);return p&&e===c?l.jsx(x.Box,{sx:{mt:1},children:p},`panel-${c}`):null})]}),Qh=pt(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"),fc=({name:e,columns:t,initialRow:r,addLabel:n,maxRows:i,hideAddWhenMax:a,disableAddWhenMax:s=!0,showEmptyState:o=!0,rowDeletable:c=!0,control:p,sx:f,addActions:d,emptyTitle:u="No items configured",emptySubtitle:y="Click 'Add' to get started.",emptyCardSx:E,setValue:m,rowSelectionMode:S,rowSelectionKey:v})=>{const{fields:j,append:D,remove:F}=xu({control:p,name:e}),_=!(typeof i=="number"?j.length>=i:!1),I=P.useMemo(()=>{if(v)return v;const U=t.find(Q=>Q.type==="rowSelect");return U==null?void 0:U.key},[t,v]),R=hl({control:p,name:e})||[],Y=P.useMemo(()=>{if(!I)return{};const U={};return R.forEach((Q,ae)=>{U[ae]=!!(Q!=null&&Q[I])}),U},[R,I]),h=P.useCallback(U=>Y[U]===!0,[Y]),M=P.useCallback((U,Q)=>{if(!m||!I)return;const ae=`${e}.${U}.${I}`;S==="single"&&Q&&R.forEach((de,$)=>{if($!==U){const W=`${e}.${$}.${I}`;m(W,!1,{shouldDirty:!0})}}),m(ae,Q,{shouldDirty:!0})},[e,I,S,m,R]),q=U=>{const Q={...U||r};t.forEach(ae=>{ae.value!==void 0&&Q[ae.key]===void 0&&(Q[ae.key]=typeof ae.value=="function"?ae.value(Q,j.length):ae.value)}),D(Q)};P.useEffect(()=>{!o&&j.length===0&&_&&q()},[o,j.length,_]);const G=P.useMemo(()=>t.reduce((Q,ae)=>{if(ae.width==="auto"||ae.width===void 0)return Q+120;const de=typeof ae.width=="number"?ae.width:typeof ae.width=="string"&&parseInt(ae.width)||160;return Q+de},0)+(c?100:0),[t,c]),B=U=>U.width==="auto"||U.width===void 0?{width:"auto",minWidth:120,maxWidth:"none"}:typeof U.width=="number"?{width:`${U.width}px`,minWidth:`${U.width}px`,maxWidth:`${U.width}px`}:typeof U.width=="string"?{width:U.width,minWidth:U.width}:{width:"160px",minWidth:"160px"};return l.jsx(x.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:j.length===0&&o?l.jsxs(x.Box,{sx:U=>({p:4,textAlign:"center",borderStyle:"dashed",borderColor:Et(U.palette.primary.main,.4),backgroundColor:Et(U.palette.primary.main,.04),borderWidth:1,borderRadius:"8px",...E}),children:[l.jsx(x.Typography,{variant:"subtitle1",sx:U=>({color:U.palette.primary.main,fontWeight:600,mb:.5,fontSize:14}),children:u}),l.jsx(x.Typography,{variant:"body2",sx:U=>({color:U.palette.primary.main,mb:2,fontSize:12,fontWeight:400}),children:y}),Array.isArray(d)&&d.length>0?d.map((U,Q)=>l.jsx(x.Button,{variant:"outlined",size:"small",startIcon:l.jsx(yn,{}),sx:{mr:1,mt:1},onClick:()=>q(U.template),disabled:!_&&s,style:{display:!_&&a?"none":void 0},children:U.label},`empty-add-${Q}`)):n&&l.jsx(x.Button,{variant:"outlined",size:"small",startIcon:l.jsx(yn,{}),onClick:()=>q(),disabled:!_&&s,style:{display:!_&&a?"none":void 0},children:n})]}):l.jsxs(l.Fragment,{children:[l.jsx(x.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((U,Q)=>l.jsx(x.Button,{variant:Q===0?"contained":"outlined",size:"small",startIcon:l.jsx(yn,{}),onClick:()=>q(U.template),sx:{borderRadius:"3px",fontSize:"10.938px",fontWeight:500,textTransform:"none",px:1.17,py:.586,minWidth:"90px","&:hover":{backgroundColor:Q===0?"#04502d":void 0}},disabled:!_&&s,style:{display:!_&&a?"none":void 0},children:U.label},`add-${Q}`)):n&&l.jsx(x.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:!_&&s,style:{display:!_&&a?"none":void 0},children:n})}),l.jsx(x.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(x.TableContainer,{sx:{width:"100%",minWidth:"100%"},children:l.jsxs(x.Table,{stickyHeader:!0,sx:{minWidth:`${G||650}px`},children:[l.jsx(x.TableHead,{children:l.jsxs(x.TableRow,{children:[t.map(U=>l.jsx(x.TableCell,{sx:{backgroundColor:"#F2F3F5",borderBottom:"1.756px solid #E5E6EB",fontWeight:500,fontSize:"12px",color:"#6B7785",whiteSpace:"nowrap",height:"43px",px:1.75,py:0,...B(U)},children:U.header},U.key)),c&&l.jsx(x.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(x.TableBody,{children:j.map((U,Q)=>{const ae=h(Q),de=S&&!ae;return l.jsxs(x.TableRow,{children:[t.map($=>{var pe;const W=`${e}.${Q}.${$.key}`,Z=$.type==="rowSelect"||$.key===I,ue=Z?!1:de?!0:typeof $.disabled=="function"?$.disabled(U,Q):!!$.disabled;if($.type==="index"){const re=$.indexFormat?$.indexFormat(Q):`#${Q+1}`;return l.jsx(x.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",textAlign:((pe=$.cellSx)==null?void 0:pe.textAlign)||"center",...B($),...$.cellSx},children:re},$.key)}if($.value!==void 0&&$.editable===!1){const re=typeof $.value=="function"?$.value(U,Q):$.value;return l.jsx(x.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",...B($),...$.cellSx},children:re},$.key)}const he=$.endorsementText?typeof $.endorsementText=="function"?$.endorsementText(U,Q):$.endorsementText:void 0;return l.jsx(x.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",...B($),...$.cellSx},children:$.type==="rowSelect"||Z&&$.type==="checkbox"?l.jsx(Re,{name:W,control:p,defaultValue:!1,render:({field:re})=>l.jsx(Ht,{label:"",checked:!!re.value,disabled:!1,onChange:H=>{re.onChange(H),M(Q,H)},sx:$.sx})}):$.type==="checkbox"?l.jsx(Re,{name:W,control:p,render:({field:re})=>l.jsx(Ht,{label:"",checked:!!re.value,disabled:ue,onChange:re.onChange,sx:$.sx})}):$.type==="select"?l.jsx(Re,{name:W,control:p,render:({field:re})=>l.jsx($i,{...re,fullWidth:!0,disabled:ue,options:$.options||[],size:"small",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...$.sx},helperText:$.helperText,required:$.required})}):$.type==="date"?l.jsx(Re,{name:W,control:p,defaultValue:$.value!==void 0?typeof $.value=="function"?$.value(U,Q):$.value:void 0,render:({field:re})=>(P.useEffect(()=>{if(m&&(re.value===void 0||re.value===null||re.value==="")&&$.value!==void 0){const H=typeof $.value=="function"?$.value(U,Q):$.value;m(W,H,{shouldValidate:!1})}},[W,re.value,$.value,U,Q,m]),l.jsx(us,{...re,fullWidth:!0,disabled:ue,size:"small",placeholder:$.placeholder||"DD/MM/YYYY",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...$.sx},helperText:$.helperText,required:$.required}))}):l.jsx(Re,{name:W,control:p,defaultValue:$.value!==void 0?typeof $.value=="function"?$.value(U,Q):$.value:void 0,render:({field:re})=>(P.useEffect(()=>{if(m&&(re.value===void 0||re.value===null||re.value==="")&&$.value!==void 0){const H=typeof $.value=="function"?$.value(U,Q):$.value;m(W,H,{shouldValidate:!1})}},[W,re.value,$.value,U,Q,m]),l.jsx(vt,{...re,fullWidth:!0,type:$.type==="number"?"number":"text",placeholder:$.placeholder,disabled:ue,size:"small",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...$.sx},helperText:$.helperText,required:$.required,endorsementText:he,endorsementBg:$.endorsementBg,endorsementColor:$.endorsementColor,endorsementRadius:$.endorsementRadius,endorsementHeight:$.endorsementHeight,endorsementPaddingX:$.endorsementPaddingX,inputProps:{...$.type==="number"?{min:$.min,max:$.max,step:$.step}:{minLength:$.minLength,maxLength:$.maxLength,pattern:$.pattern}}}))})},$.key)}),c&&l.jsx(x.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",px:1.5,py:0,borderBottom:"1px solid #E5E6EB",textAlign:"center"},children:l.jsx(x.IconButton,{size:"small",color:"error",onClick:()=>F(Q),sx:{width:"20px",height:"20px"},children:l.jsx(Qh,{sx:{fontSize:"20px"}})})})]},U.id)})})]})})})]})})},hc=({name:e,control:t,items:r,sx:n,cardSx:i})=>l.jsx(x.Box,{sx:{display:"flex",flexDirection:"column",gap:1,...n},children:r.map(a=>{const s=!!a.leftAction,o=!!a.rightAction,c=!!(a.header||a.chipText),p=a.leftAction,f=a.rightAction;return l.jsxs(x.Box,{sx:{border:"1px solid #DDDDDD",borderRadius:"8px",height:"40px",display:"flex",alignItems:"center",justifyContent:"space-between",px:1,...i},children:[s&&p&&l.jsx(x.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(Ht,{label:p.label||"",checked:!!d.value,onChange:d.onChange,sx:{margin:0}})})}),c&&l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1,flex:s||o?1:"none",ml:s?1:0},children:[a.header&&l.jsx(x.Typography,{variant:"body2",sx:{fontSize:"12px",color:"rgba(0,0,0,0.87)",fontWeight:400},children:a.header}),a.chipText&&l.jsx(x.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})]}),o&&f&&l.jsx(x.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(di,{label:f.label,checked:!!d.value,onChange:d.onChange,sx:{margin:0}})})}),!s&&!o&&!c&&l.jsx(x.Box,{sx:{width:"100%",height:"100%"}})]},a.id)})}),mc=pt(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"),ta=pt(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"),Zh=[{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"}],ra=[{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"}],Xh=({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:s})=>{const[o,c]=P.useState(e.seasonalMonths||[]),p=u=>{const y=o.includes(u)?o.filter(E=>E!==u):[...o,u];c(y),r(e.id,{seasonalMonths:y})},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,y=e.max||0;return Number.isInteger(y)?y<u?"Max must be ≥ Min.":null:"Use whole periods."})();return l.jsx(x.Card,{sx:{border:"2px solid",borderColor:J.divider,position:"relative",...s},children:l.jsxs(x.CardContent,{sx:{p:2},children:[l.jsxs(x.Box,{sx:{mb:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs(x.Box,{sx:{display:"flex",gap:.5,alignItems:"center"},children:[l.jsx(x.Box,{children:l.jsx(uc,{})}),l.jsx(ps,{label:t+1,size:"small"})]}),l.jsx(x.IconButton,{onClick:()=>n(e.id),disabled:a,sx:{color:J.error.main,"&:hover":{bgcolor:Ze[50]}},size:"small",children:l.jsx(mc,{fontSize:"small"})})]}),l.jsx(x.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:l.jsxs(x.Box,{sx:{flex:1,display:"grid",gap:1.5},children:[l.jsxs(x.Box,{sx:{display:"flex",gap:2,mb:.5},children:[l.jsx(x.Box,{sx:{flex:.5,display:"grid",gap:1},children:l.jsx($i,{labelText:"Phase type",value:e.type,onChange:u=>r(e.id,{type:u.target.value}),options:Zh,disabled:a})}),l.jsxs(x.Box,{sx:{display:"grid",gap:1,flex:.5},children:[l.jsx(x.Typography,{variant:"caption",sx:{fontSize:"12px",color:J.text.secondary},children:"Allocation priority (1–9)"}),l.jsx(vt,{type:"number",value:e.priority||5,onChange:u=>{const y=parseInt(u.target.value)||5;r(e.id,{priority:Math.min(9,Math.max(1,y))})},inputProps:{min:1,max:9},disabled:a,sx:{textAlign:"center"}})]})]}),l.jsxs(x.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[l.jsx(x.Box,{sx:{display:"grid",gap:1},children:l.jsx(vt,{labelText:"Min periods",type:"number",value:e.min||0,onChange:u=>{const y=parseInt(u.target.value)||0;r(e.id,{min:y,...e.lockLength?{max:y}:{}})},inputProps:{min:0},disabled:a,error:!!f,helperText:f||void 0})}),l.jsx(x.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(x.Box,{sx:{display:"flex",gap:3},children:[l.jsx(Ht,{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(Ht,{label:"Residual fill",checked:e.residualFill||!1,onChange:u=>r(e.id,{residualFill:u}),disabled:a})]}),e.type==="principal-moratorium"&&l.jsxs(x.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(x.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(x.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(ta,{sx:{fontSize:14,color:J.text.secondary,cursor:"help"}})})]}),l.jsx(Sr,{value:e.interestPolicy||"accrue-capitalize",onChange:u=>r(e.id,{interestPolicy:u}),options:ra,labelPosition:"none"}),e.interestPolicy==="accrue-forgive"&&l.jsx(x.Typography,{variant:"caption",sx:{color:J.text.secondary,mt:1},children:"Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."})]}),e.type==="balloon"&&l.jsxs(x.Box,{sx:{display:"grid",gap:1.5},children:[l.jsx(Sr,{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(x.Typography,{variant:"caption",sx:{color:J.text.secondary},children:"Principal at maturity"}),e.type==="step-up-down"&&l.jsxs(x.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(x.Box,{sx:{display:"grid",gap:1.5},children:[l.jsxs(x.Box,{sx:{display:"grid",gap:1},children:[l.jsx(x.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Skip Months"}),l.jsx(x.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:i.map(u=>l.jsx(x.Chip,{label:u,size:"small",onClick:()=>!a&&p(u),sx:{cursor:a?"default":"pointer",bgcolor:o.includes(u)?J.primary.main:"transparent",color:o.includes(u)?J.primary.contrastText:J.text.primary,border:`1px solid ${J.divider}`,"&:hover":{bgcolor:o.includes(u)?Ze[600]:Ze[50]}}},u))})]}),l.jsxs(x.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(x.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(x.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(ta,{sx:{fontSize:14,color:J.text.secondary,cursor:"help"}})})]}),l.jsx(Sr,{value:e.interestPolicy||"accrue-capitalize",onChange:u=>r(e.id,{interestPolicy:u}),options:ra,labelPosition:"none"}),e.interestPolicy==="accrue-forgive"&&l.jsx(x.Typography,{variant:"caption",sx:{color:J.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(x.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(x.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(x.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(ta,{sx:{fontSize:14,color:J.text.secondary,cursor:"help"}})})]}),l.jsx(Sr,{value:e.holidayInterestTreatment||"accrue-capitalize",onChange:u=>r(e.id,{holidayInterestTreatment:u}),options:ra,labelPosition:"none"}),e.holidayInterestTreatment==="accrue-forgive"&&l.jsx(x.Typography,{variant:"caption",sx:{color:J.text.secondary},children:"Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."})]})]})})]})})};async function xc(e,t,r,n){try{const{endpoint:i,method:a="GET",valueField:s="value",labelField:o="label",headers:c={},params:p={},body:f,transform:d,passThroughFields:u}=e;let y=i;if(t&&!i.startsWith("http")&&(y=`${t}${i.startsWith("/")?i:`/${i}`}`),n){const F=/\{([^}]+)\}/g;y=y.replace(F,(C,_)=>{const I=n[_];return I!=null?encodeURIComponent(String(I)):""}),y=y.replace(/\?&/g,"?").replace(/&&/g,"&").replace(/\?$/g,"")}const E=new URLSearchParams;Object.entries(p).forEach(([F,C])=>{C!=null&&E.append(F,String(C))}),E.toString()&&(y+=`${y.includes("?")?"&":"?"}${E.toString()}`);try{const F=/^https?:\/\//i.test(y),C=new URL(y,F?void 0:"http://local.placeholder"),_=Array.from(C.searchParams.entries());for(const[I,R]of _)(R===""||R==="undefined"||R==="null")&&C.searchParams.delete(I);F?y=C.toString():y=C.pathname+(C.search?C.search:""),y=y.replace(/\?&/g,"?").replace(/&&/g,"&").replace(/\?$/g,"")}catch{}const m={"Content-Type":"application/json",...r,...c},S={method:a,headers:m};(a==="POST"||a==="PUT")&&f&&(S.body=JSON.stringify(f));const v=await fetch(y,S);if(!v.ok)throw new Error(`API request failed: ${v.status} ${v.statusText}`);const j=await v.json();if(d)return d(Array.isArray(j)?j:j.data||j);const D=Array.isArray(j)?j:j.data||j;if(!Array.isArray(D))throw new Error("API response is not an array");return D.map(F=>{const C={label:F[o]||F.name||F.title||String(F[s]||""),value:F[s]||F.id||F.value||""},_=Array.isArray(u)?u:void 0;if(Array.isArray(_))for(const I of _)F[I]!==void 0&&(C[I]=F[I]);return C})}catch(i){throw console.error("API fetch error:",i),new Error(`Failed to fetch data: ${i instanceof Error?i.message:"Unknown error"}`)}}function gc(e,t,r,n,i=!1){const a=P.useMemo(()=>{if(!(e!=null&&e.dependsOn)||!n)return null;const o=n[e.dependsOn];return o!==void 0?o:null},[e==null?void 0:e.dependsOn,n]),s=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 tp({queryKey:s,queryFn:()=>{if(!e)throw new Error("API config is required");return xc(e,t,r,n)},enabled:i&&!!e,staleTime:15*60*1e3,gcTime:30*60*1e3,retry:3,retryDelay:o=>Math.min(1e3*2**o,3e4),refetchOnWindowFocus:!1,refetchOnReconnect:!0,refetchOnMount:!1})}function yr(e){return!!(e.apiConfig||e.api_endpoint)}function ds(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 Jh(e,t){const r=ds(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 fs=({field:e,control:t,errors:r,baseUrl:n,apiHeaders:i,formData:a,setValue:s})=>{const o=r[e.name],c=!!o,[p,f]=P.useState(!1),d=P.useRef(!1),[u,y]=P.useState(!1),[E,m]=P.useState(!1),[S,v]=P.useState(!1),j=P.useRef(null),D=P.useRef(null),F=()=>{var se;const H=e.required;if(typeof H=="function")try{return!!H(a||{})}catch{return!1}if(H!==void 0)return!!H;const ee=(se=e.validation)==null?void 0:se.required;if(typeof ee=="function")try{return!!ee(a||{})}catch{return!1}return ee!==void 0?!!ee:!1},C=H=>F()?`${H} *`:H,_=()=>{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 H=e.value;if(typeof H!="function"||!s)return;let ee;try{ee=H(a||{})}catch{return}const se=a?a[e.name]:void 0;if(I.current===void 0&&(I.current=ee),se===void 0||se===I.current)try{s(e.name,ee,{shouldValidate:!0,shouldDirty:!1}),I.current=ee}catch{}},[JSON.stringify(Array.isArray(e.valueDeps)&&a?e.valueDeps.reduce((H,ee)=>({...H,[ee]:a[ee]}),{}):a||{}),e.name]);const R=P.useMemo(()=>{const H=ds(e);return H&&Array.isArray(e.passThroughFields)&&(H.passThroughFields=e.passThroughFields),H},[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,M=P.useMemo(()=>{if(!(R!=null&&R.dependsOn))return!1;const H=h,ee=Y.current,se=H!==ee;return se&&(Y.current=H),se},[R==null?void 0:R.dependsOn,h]),q=P.useMemo(()=>{const H=e.showWhen;if(typeof H=="function")try{return!!H(a||{})}catch{return!0}if(H&&typeof H=="object"){const ee=H.field,se=H.equals,le=H.in,ce=ee?(a||{})[ee]:void 0;if(ee&&typeof se<"u")return ce===se;if(ee&&Array.isArray(le))return le.includes(ce)}return!0},[e.showWhen,a]),G=P.useCallback(()=>{const H=e.dynamicEndorsement;if(typeof H=="function")try{return H(a||{})}catch{return e.endorsementText}return e.endorsementText},[e,a]),B=P.useCallback(()=>{const H=e.endAdornment,ee=e.endAdornmentSwitch,se=e.endAdornmentCheckbox;if(ee)return l.jsx(Re,{name:ee,control:t,defaultValue:e.endAdornmentSwitchDefault??!1,render:({field:le})=>l.jsx(x.Switch,{checked:le.value||!1,onChange:ce=>{le.onChange(ce.target.checked),e.endAdornmentSwitchOnChange&&e.endAdornmentSwitchOnChange(ce.target.checked,a,s)},disabled:e.endAdornmentSwitchDisabled,size:e.endAdornmentSwitchSize||"small",sx:e.endAdornmentSwitchSx})});if(se)return l.jsx(Re,{name:se,control:t,defaultValue:e.endAdornmentCheckboxDefault??!1,render:({field:le})=>l.jsx(Ht,{label:"",checked:le.value||!1,onChange:le.onChange,disabled:e.endAdornmentCheckboxDisabled,sx:e.endAdornmentCheckboxSx})});if(typeof H=="function")try{return H(a||{},{control:t,setValue:s})}catch{return}return H},[e,a,t,s]),U=P.useMemo(()=>p&&yr(e)&&(!(R!=null&&R.dependsOn)||h),[p,e,R==null?void 0:R.dependsOn,h]),Q=P.useMemo(()=>{const H={};if(!a)return H;const ee=(R==null?void 0:R.endpoint)||(e==null?void 0:e.api_endpoint);if(ee&&typeof ee=="string"){const se=ee.match(/\{([^}]+)\}/g)||[];for(const le of se){const ce=le.slice(1,-1),be=a[ce];be!==void 0&&(H[ce]=be)}}if(R!=null&&R.dependsOn){const se=R.dependsOn,le=a[se];le!==void 0&&(H[se]=le)}return H},[R==null?void 0:R.endpoint,e==null?void 0:e.api_endpoint,R==null?void 0:R.dependsOn,a]),{data:ae=[],isLoading:de,error:$}=gc(R,n,i,Q,U),W=P.useCallback(()=>{yr(e)&&!d.current&&(d.current=!0,f(!0))},[e]),Z=P.useCallback(()=>{yr(e)&&!d.current&&(d.current=!0,f(!0))},[e]);P.useEffect(()=>{if(yr(e)&&!d.current){const H=a==null?void 0:a[e.name];H!=null&&H!==""&&(d.current=!0,f(!0))}},[e,a]),P.useEffect(()=>{yr(e)&&(R!=null&&R.dependsOn)&&M&&d.current&&(d.current=!1,f(!1))},[M,R==null?void 0:R.dependsOn]);const ue=P.useCallback(()=>yr(e)?ae:e.type==="select"||e.type==="toggle"||e.type==="radio"||e.type==="autocomplete"?e.options||[]:[],[e,ae]),he=()=>{var H,ee,se,le,ce,be;switch(e.type){case"title":return l.jsx(x.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(x.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 X=e.actionName,Me=e.actionComponent,Ue=e.actionLabel,Xe=T=>l.jsx(cc,{title:e.title||e.label,subtitle:e.subtitle,align:e.align||"left",sx:e.sx,actions:T??e.actions}),Tt=T=>{if(e.cardWrap){const z={...{px:2,py:1,boxShadow:"none",border:"1px solid #DDDDDD"},...e.cardSx};return l.jsx(x.Card,{sx:z,...e.cardProps,children:T})}return T};return Tt(X&&Me?l.jsx(Re,{name:X,control:t,defaultValue:e.value??!1,render:({field:T})=>Xe(Me==="switch"?l.jsx(di,{label:Ue,checked:!!T.value,onChange:T.onChange}):l.jsx(Ht,{label:Ue||"",checked:!!T.value,onChange:T.onChange}))}):Xe());case"tabs":return l.jsx(Re,{name:e.name,control:t,defaultValue:e.defaultValue??(typeof((ee=(H=e.items)==null?void 0:H[0])==null?void 0:ee.value)=="string"||typeof((le=(se=e.items)==null?void 0:se[0])==null?void 0:le.value)=="number"?(be=(ce=e.items)==null?void 0:ce[0])==null?void 0:be.value:0),render:({field:T})=>{const g=e.items||[],z=g.map((K,V)=>({label:K.label,value:typeof K.value=="string"||typeof K.value=="number"?K.value:V,content:K.content,disabled:K.disabled})),b=T.value,O=(()=>{if(typeof b=="string"||typeof b=="number"){const K=g.findIndex((V,fe)=>typeof V.value=="string"||typeof V.value=="number"?V.value===b:fe===b);return K>=0?K:0}return Number(b)||0})(),L=g[O]||{};return l.jsxs(x.Box,{children:[l.jsx(dc,{value:T.value,onChange:T.onChange,items:z,ariaLabel:e.ariaLabel||e.label,sx:e.sx,tabSx:e.tabSx}),Array.isArray(L.fields)&&L.fields.length>0&&(()=>{const K=L.fields,V=[];let fe=[];for(const ge of K)ge.type==="section"&&fe.length>0?(V.push(fe),fe=[ge]):fe.push(ge);fe.length>0&&V.push(fe);const xe={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(x.Box,{sx:{mt:1},children:V.map((ge,ke)=>{const $e=ge.find(ze=>ze.type==="section"),Ge=($e==null?void 0:$e.cardWrap)!==!1,dt=l.jsx(l.Fragment,{children:ge.map(ze=>{const ne=ze.showWhen;if(ne)try{if(typeof ne=="function"){if(!ne(a||{}))return null}else if(typeof ne=="object"){const Yt=ne.field,gs=ne.equals,ys=ne.in,vs=Yt?(a||{})[Yt]:void 0;if(Yt&&typeof gs<"u"&&vs!==gs||Yt&&Array.isArray(ys)&&!ys.includes(vs))return null}}catch{}const Ke=Math.min(Math.max(ze.col??12,1),12);return l.jsx(x.Box,{sx:{gridColumn:`span ${Ke}`},children:l.jsx(fs,{field:ze,control:t,errors:r,baseUrl:n,apiHeaders:i,formData:a,setValue:s})},ze.name)})});return Ge?l.jsx(x.Card,{sx:{...xe,...($e==null?void 0:$e.cardSx)||{}},...($e==null?void 0:$e.cardProps)||{},children:dt},`tab-group-${ke}`):l.jsx(x.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,width:"100%",mt:1},children:dt},`tab-group-${ke}`)})})})()]})}});case"grid":const He=e.defaultRows||[];return l.jsx(x.Box,{children:l.jsx(Re,{name:e.name,control:t,defaultValue:He.length>0?He:_()||[],render:()=>l.jsx(fc,{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:s,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(hc,{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:T})=>{const g=e,z=T.value||g.items||[],b=typeof g.getId=="function"?g.getId:typeof g.getId=="string"?K=>K[g.getId]:K=>K.id??K._id??K.key??String(K),O=typeof g.getText=="function"?g.getText:typeof g.getText=="string"?K=>K[g.getText]??String(K):K=>K.text??K.label??K.name??K.title??String(K),L=(()=>{if(typeof g.chipText=="function")return g.chipText;if(typeof g.chipText=="string")return z.length>0&&z[0]&&g.chipText in z[0]?(K,V)=>K[g.chipText]??void 0:g.chipText})();return l.jsx(pc,{items:z,getId:b,onReorder:K=>{T.onChange(K)},header:g.header,disabled:e.disabled,sx:g.sx,chipText:L,helperText:g.helperText||(c?o==null?void 0:o.message:void 0),getText:O,showIndex:g.showIndex!==!1,showLeftIcon:g.showLeftIcon!==!1,renderItem:g.renderItem})}});case"text":case"email":case"password":case"tel":case"textarea":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>e.type==="textarea"?l.jsx(lc,{...T,labelText:e.labelPosition==="top"?C(e.label):void 0,label:e.labelPosition!=="top"?C(e.label):void 0,labelVariant:e.labelVariant,placeholder:e.placeholder,disabled:e.disabled,hasError:c,helperText:(o==null?void 0:o.message)||e.helperText}):l.jsx(vt,{...T,id:e.id,labelText:e.labelPosition==="top"?C(e.label):void 0,label:e.labelPosition!=="top"?C(e.label):void 0,endAdornment:B(),endorsementText:G(),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:(o==null?void 0:o.message)||e.helperText,InputProps:e.type==="password"?{endAdornment:l.jsx(ec,{position:"end",children:l.jsx(Gn,{"aria-label":"toggle password visibility",onClick:()=>y(g=>!g),edge:"end",children:u?l.jsx(Oo,{}):l.jsx(Ao,{})})})}:void 0})});case"number":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(vt,{...T,id:e.id,labelText:e.labelPosition==="top"?C(e.label):void 0,label:e.labelPosition!=="top"?C(e.label):void 0,endAdornment:B(),endorsementText:G(),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:(o==null?void 0:o.message)||e.helperText,inputProps:{min:e.min,max:e.max}})});case"select":const et=ue();return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx($i,{labelText:e.labelPosition==="top"?C(e.label):void 0,label:e.labelPosition!=="top"&&e.labelPosition!=="none"?C(e.label):void 0,labelVariant:e.labelVariant,value:T.value,onChange:T.onChange,options:et,disabled:e.disabled||de,placeholder:e.labelPosition==="inner"||e.labelPosition==="none"||!e.labelPosition?e.placeholder||(e.labelPosition==="none"?C(e.label):void 0):e.placeholder,loading:de,error:c||!!$,helperText:(o==null?void 0:o.message)||($==null?void 0:$.message)||e.helperText,onOpen:W})});case"checkbox":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(Ht,{label:C(e.label),checked:!!T.value,disabled:e.disabled,onChange:T.onChange})});case"toggle":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(Sr,{label:C(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:T.value,options:e.options||[],row:!0,onChange:T.onChange})});case"radio":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(Sr,{label:C(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:T.value,options:e.options||[],row:e.row===!0,groupPadding:e.groupPadding,itemGap:e.itemGap,helperText:e.helperText,onChange:T.onChange})});case"checkboxGroup":return l.jsx(Re,{name:e.name,control:t,defaultValue:_()||[],render:({field:T})=>l.jsx(oc,{label:C(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:Array.isArray(T.value)?T.value:[],options:e.options||[],row:e.row,groupPadding:e.groupPadding,itemGap:e.itemGap,helperText:e.helperText,onChange:T.onChange,disabled:e.disabled})});case"switch":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(di,{label:C(e.label),checked:!!T.value,disabled:e.disabled,onChange:T.onChange})});case"autocomplete":const Ye=ue(),w=!!(e.disabled||de||R!=null&&R.dependsOn&&!h);return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>{const g=T.value,z=e.multiple===!0,b=(R==null?void 0:R.valueField)||e.value_field||"value",O=(R==null?void 0:R.labelField)||e.label_field||"label",L=V=>{if(V!=null){if(typeof V=="string"||typeof V=="number")return V;if(typeof V=="object"){if(V[b]!==void 0)return V[b];if(V.value!==void 0)return V.value;if(V.id!==void 0)return V.id}}},K=(()=>{if(z)return(Array.isArray(g)?g:[]).map(fe=>{const xe=Ye.find(ge=>{const ke=L(ge);return ke!==void 0&&ke===fe});return xe||{[b]:fe,[O]:`Selected: ${fe}`,value:fe,label:`Selected: ${fe}`}});{if(g==null||g==="")return null;const V=Ye.find(fe=>{const xe=L(fe);return xe!==void 0&&xe===g});return V||{[b]:g,[O]:`Selected: ${g}`,value:g,label:`Selected: ${g}`}}})();return l.jsx(sc,{id:e.id,options:Ye,value:K,multiple:z,labelText:e.labelPosition==="top"?C(e.label):void 0,label:e.labelPosition!=="top"?C(e.label):void 0,placeholder:w&&(R!=null&&R.dependsOn)&&!h?`Please select ${R.dependsOn.replace(/_/g," ")} first`:e.placeholder,labelVariant:e.labelVariant,disabled:w,loading:de,error:c||!!$,helperText:(o==null?void 0:o.message)||($==null?void 0:$.message)||e.helperText||"",onOpen:Z,noOptionsText:w&&(R!=null&&R.dependsOn)&&!h?`Please select ${R.dependsOn.replace(/_/g," ")} first`:de?"Fetching data...":p&&!de&&Ye.length===0?"No options available":"Click to load options",onChange:V=>{const fe=(R==null?void 0:R.valueField)||e.value_field||"value";if(z){const ge=(Array.isArray(V)?V:[]).map(ke=>typeof ke=="object"&&(ke[fe]||ke.value||ke.id)||ke);T.onChange(ge)}else{let xe;V&&typeof V=="object"?xe=V[fe]||V.value||V.id||V:xe=V,T.onChange(xe);const ge=e.selectedAssignments;if(ge&&V&&typeof V=="object")for(const[ke,$e]of Object.entries(ge)){const Ge=V[$e];if(Ge!==void 0&&typeof s=="function")try{s(ke,Ge,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!1})}catch{}}}}})}});case"date":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(us,{...T,id:e.name,label:C(e.label),labelPosition:e.labelPosition||"inner",labelVariant:e.labelVariant,disabled:e.disabled,error:c,helperText:o==null?void 0:o.message,inputProps:{min:e.minDate,max:e.maxDate}})});case"image":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>{const g=T.value||e.defaultValue||e.src;if(g){const V=e.imageUploaded||{},fe=V.previewText||"Preview",xe=V.removeText||"Remove",ge=V.saveText||"Save logo",ke=V.showSave!==void 0?V.showSave:!!(e.onSave||V.saveText),$e=()=>{if(v(!0),typeof e.onPreview=="function")try{e.onPreview(g)}catch{}},Ge=()=>{T.onChange(""),typeof e.onRemove=="function"&&e.onRemove()},dt=()=>{typeof e.onSave=="function"&&e.onSave({url:g,file:D.current||void 0})},ze=ne=>{const Ke=ne.target.files&&ne.target.files[0];if(Ke){if(typeof e.onFileSelected=="function")try{e.onFileSelected(Ke)}catch{}try{const Yt=URL.createObjectURL(Ke);T.onChange(Yt)}catch{}D.current=Ke,v(!1)}};return l.jsxs(x.Card,{sx:{display:"flex",alignItems:"center",gap:2,p:2,boxShadow:"0px 1px 4px 0px #00000014",...V.cardSx},children:[l.jsx("input",{type:"file",ref:j,accept:Array.isArray(e.accept)?e.accept.join(","):e.accept||"image/*",style:{display:"none"},onChange:ze}),l.jsxs(x.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[l.jsx(x.Box,{sx:{width:"30%",height:"10%",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",background:"#FFFFFF",overflow:"hidden",...V.thumbnailSx},children:l.jsx("img",{src:g,alt:e.alt||e.label,style:{maxWidth:"100%",maxHeight:"100%"}})}),l.jsxs(x.Box,{sx:{flexGrow:1},children:[l.jsx(x.Typography,{sx:{fontSize:"12px",fontWeight:500,...V.fileNameSx},children:typeof g=="string"?g.split("/").pop():"Selected image"}),l.jsx(x.Typography,{sx:{fontSize:"10px",...V.fileMetaSx},children:"Image selected"})]}),l.jsxs(x.Box,{sx:{display:"flex",gap:1},children:[l.jsx(x.Button,{type:"button",sx:{...V.previewButtonSx},variant:"outlined",onClick:$e,startIcon:l.jsx(Ao,{}),children:fe}),l.jsx(x.Button,{variant:"outlined",color:"error",onClick:Ge,sx:{...V.removeButtonSx},startIcon:l.jsx(Oo,{}),children:xe}),ke&&l.jsx(x.Button,{variant:"contained",onClick:dt,sx:{...V.saveButtonSx},children:ge})]})]}),l.jsxs(x.Dialog,{open:S,onClose:()=>v(!1),maxWidth:"md",fullWidth:!0,children:[l.jsx(x.DialogTitle,{children:V.previewTitle||"Image preview"}),l.jsx(x.DialogContent,{children:l.jsx(x.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:g,alt:e.alt||e.label,style:{maxWidth:"100%",maxHeight:380}})})}),l.jsxs(x.DialogActions,{children:[l.jsx(x.Button,{type:"button",variant:"outlined",onClick:()=>{var ne;return(ne=j.current)==null?void 0:ne.click()},children:V.replaceText||"Replace logo"}),l.jsx(x.Button,{type:"button",variant:"contained",onClick:()=>v(!1),children:V.closeText||"Close"})]})]})]})}const z=e.imagePlaceholder||{},b=z.icon||"upload",O=j,L=()=>{var V;try{(V=O.current)==null||V.click()}catch{}},K=V=>{const fe=V.target.files&&V.target.files[0];if(fe){typeof e.onFileSelected=="function"&&e.onFileSelected(fe);try{const xe=URL.createObjectURL(fe);T.onChange(xe)}catch{}D.current=fe}};return l.jsxs(x.Card,{sx:{border:"1px dashed",borderColor:"#CCCCCC",boxShadow:"none",p:2,textAlign:"center",color:"primary.main",...z.sx},children:[l.jsx("input",{type:"file",ref:O,accept:Array.isArray(e.accept)?e.accept.join(","):e.accept||"image/*",style:{display:"none"},onChange:K}),l.jsx(Gn,{sx:{borderRadius:"8px",...z.iconSx},children:b==="image"?l.jsx(zh,{sx:{width:36,height:36,color:"primary.main"}}):l.jsx(pi,{sx:{width:36,height:36,color:"primary.main"}})}),l.jsx(x.Typography,{sx:{fontSize:"16px",fontWeight:600,color:"primary.main",...z.titleSx},children:z.title||"Drag & Drop the image here"}),l.jsx(x.Typography,{sx:{fontSize:"12px",fontWeight:400,color:"primary.main",...z.subtitleSx},children:z.subtitle||""}),l.jsx(x.Button,{onClick:L,sx:{my:2,...z.buttonSx},startIcon:l.jsx(pi,{}),variant:"contained",disabled:e.disabled,children:z.buttonText||"Upload File"}),l.jsx(x.Typography,{sx:{fontSize:"12px",fontWeight:400,...z.helperTextSx},children:z.helperText||e.helperText||""})]})}});case"component":return l.jsx(x.Box,{children:e.render?typeof e.render=="function"?(()=>{try{return e.render(a||{},{control:t,setValue:s})}catch{try{return e.render({control:t,formData:a,setValue:s})}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]),re=P.useCallback(async()=>{try{const H=a?a[e.name]:void 0;let ee="";H==null?ee="":Array.isArray(H)?ee=H.join(", "):typeof H=="object"?ee=JSON.stringify(H):ee=String(H),await navigator.clipboard.writeText(ee),m(!0),window.setTimeout(()=>m(!1),1200)}catch{}},[a,e.name]);return l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:.3},children:[l.jsx(x.Box,{sx:{flexGrow:1},children:q?he():null}),pe&&l.jsx(Gn,{"aria-label":`copy ${e.label||e.name}`,onClick:re,size:"small",children:E?l.jsx(ls,{fontSize:"small"}):l.jsx(Mh,{fontSize:"small"})})]})};var na,Ro;function em(){if(Ro)return na;Ro=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,j){return this._size>=this._maxSize&&this.clear(),v in this._values||this._size++,this._values[v]=j};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,n=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,o=new e(s),c=new e(s),p=new e(s);na={Cache:e,split:d,normalizePath:f,setter:function(v){var j=f(v);return c.get(v)||c.set(v,function(F,C){for(var _=0,I=j.length,R=F;_<I-1;){var Y=j[_];if(Y==="__proto__"||Y==="constructor"||Y==="prototype")return F;R=R[j[_++]]}R[j[_]]=C})},getter:function(v,j){var D=f(v);return p.get(v)||p.set(v,function(C){for(var _=0,I=D.length;_<I;)if(C!=null||!j)C=C[D[_++]];else return;return C})},join:function(v){return v.reduce(function(j,D){return j+(y(D)||r.test(D)?"["+D+"]":(j?".":"")+D)},"")},forEach:function(v,j,D){u(Array.isArray(v)?v:d(v),j,D)}};function f(v){return o.get(v)||o.set(v,d(v).map(function(j){return j.replace(a,"$2")}))}function d(v){return v.match(t)||[""]}function u(v,j,D){var F=v.length,C,_,I,R;for(_=0;_<F;_++)C=v[_],C&&(S(C)&&(C='"'+C+'"'),R=y(C),I=!R&&/^\d+$/.test(C),j.call(D,C,R,I,_,v))}function y(v){return typeof v=="string"&&v&&["'",'"'].indexOf(v.charAt(0))!==-1}function E(v){return v.match(n)&&!v.match(r)}function m(v){return i.test(v)}function S(v){return!y(v)&&(E(v)||m(v))}return na}var Rr=em(),ia,$o;function tm(){if($o)return ia;$o=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 ia={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(" ")},ia}var aa=tm(),Ln={exports:{}},Po;function rm(){if(Po)return Ln.exports;Po=1,Ln.exports=function(i){return e(t(i),i)},Ln.exports.array=e;function e(i,a){var s=i.length,o=new Array(s),c={},p=s,f=r(a),d=n(i);for(a.forEach(function(y){if(!d.has(y[0])||!d.has(y[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 o;function u(y,E,m){if(m.has(y)){var S;try{S=", node was:"+JSON.stringify(y)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!d.has(y))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(y));if(!c[E]){c[E]=!0;var v=f.get(y)||new Set;if(v=Array.from(v),E=v.length){m.add(y);do{var j=v[--E];u(j,d.get(j),m)}while(E);m.delete(y)}o[--s]=y}}}function t(i){for(var a=new Set,s=0,o=i.length;s<o;s++){var c=i[s];a.add(c[0]),a.add(c[1])}return Array.from(a)}function r(i){for(var a=new Map,s=0,o=i.length;s<o;s++){var c=i[s];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,s=0,o=i.length;s<o;s++)a.set(i[s],s);return a}return Ln.exports}var nm=rm();const im=Ya(nm),am=Object.prototype.toString,sm=Error.prototype.toString,om=RegExp.prototype.toString,lm=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",cm=/^Symbol\((.*)\)(.*)$/;function um(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Do(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return um(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return lm.call(e).replace(cm,"Symbol($1)");const n=am.call(e).slice(8,-1);return n==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):n==="Error"||e instanceof Error?"["+sm.call(e)+"]":n==="RegExp"?om.call(e):null}function ur(e,t){let r=Do(e,t);return r!==null?r:JSON.stringify(e,function(n,i){let a=Do(this[n],t);return a!==null?a:i},2)}function yc(e){return e==null?[]:[].concat(e)}let vc,bc,wc,pm=/\$\{\s*(\w+)\s*\}/g;vc=Symbol.toStringTag;class Io{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[vc]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=i,this.errors=[],this.inner=[],yc(t).forEach(a=>{if(ct.isError(a)){this.errors.push(...a.errors);const s=a.inner.length?a.inner:[a];this.inner.push(...s)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}bc=Symbol.hasInstance;wc=Symbol.toStringTag;class ct 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(pm,(i,a)=>ur(r[a])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,n,i,a){const s=new Io(t,r,n,i);if(a)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[wc]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ct)}static[bc](t){return Io[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let $t={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 \`${ur(n,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${ur(r,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${ur(r,!0)}\``+i}},st={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"},Xt={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"},$a={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Pa={isValue:"${path} field must be ${value}"},Qn={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},dm={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"},fm={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: \`${ur(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: \`${ur(r,!0)}\``}return ct.formatError($t.notType,e)}};Object.assign(Object.create(null),{mixed:$t,string:st,number:Xt,date:$a,object:Qn,array:dm,boolean:Pa,tuple:fm});const hs=e=>e&&e.__isYupSchema__;class fi{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,s=typeof n=="function"?n:(...o)=>o.every(c=>c===n);return new fi(t,(o,c)=>{var p;let f=s(...o)?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(!hs(i))throw new TypeError("conditions must return a schema object");return i.resolve(r)}}const qn={context:"$",value:"."};function hi(e,t){return new xr(e,t)}class xr{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&&Rr.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}}xr.prototype.__isYupRef=!0;const Ot=e=>e==null;function Wr(e){function t({value:r,path:n="",options:i,originalValue:a,schema:s},o,c){const{name:p,test:f,params:d,message:u,skipAbsent:y}=e;let{parent:E,context:m,abortEarly:S=s.spec.abortEarly,disableStackTrace:v=s.spec.disableStackTrace}=i;function j(M){return xr.isRef(M)?M.getValue(r,E,m):M}function D(M={}){const q=Object.assign({value:r,originalValue:a,label:s.spec.label,path:M.path||n,spec:s.spec,disableStackTrace:M.disableStackTrace||v},d,M.params);for(const B of Object.keys(q))q[B]=j(q[B]);const G=new ct(ct.formatError(M.message||u,q),r,q.path,M.type||p,q.disableStackTrace);return G.params=q,G}const F=S?o:c;let C={path:n,parent:E,type:p,from:i.from,createError:D,resolve:j,options:i,originalValue:a,schema:s};const _=M=>{ct.isError(M)?F(M):M?c(null):F(D())},I=M=>{ct.isError(M)?F(M):o(M)};if(y&&Ot(r))return _(!0);let Y;try{var h;if(Y=f.call(C,r,C),typeof((h=Y)==null?void 0:h.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${C.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(M){I(M);return}_(Y)}return t.OPTIONS=e,t}function hm(e,t,r,n=r){let i,a,s;return t?(Rr.forEach(t,(o,c,p)=>{let f=c?o.slice(1,o.length-1):o;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 "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&u>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, 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: ${s} which is a type: "${e.type}")`);i=r,r=r&&r[f],e=e.fields[f]}a=f,s=c?"["+o+"]":"."+o}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class mi extends Set{describe(){const t=[];for(const r of this.values())t.push(xr.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 mi(this.values())}merge(t,r){const n=this.clone();return t.forEach(i=>n.add(i)),r.forEach(i=>n.delete(i)),n}}function Hr(e,t=new Map){if(hs(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]=Hr(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,Hr(i,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(Hr(n,t))}else if(e instanceof Object){r={},t.set(e,r);for(const[n,i]of Object.entries(e))r[n]=Hr(i,t)}else throw Error(`Unable to clone ${e}`);return r}class xt{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 mi,this._blacklist=new mi,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError($t.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=Hr(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(s=>{a.test(s.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&&Ot(a))return a;let s=ur(t),o=ur(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:k.object,className:k.string,color:k.oneOfType([k.oneOf(["inherit","default","primary","secondary","error","info","success","warning"]),k.string]),disabled:k.bool,disableFocusRipple:k.bool,disableRipple:k.bool,edge:k.oneOf(["end","start",!1]),id:k.string,loading:k.bool,loadingIndicator:k.node,size:k.oneOfType([k.oneOf(["small","medium","large"]),k.string]),sx:k.oneOfType([k.arrayOf(k.oneOfType([k.func,k.object,k.bool])),k.func,k.object])});const Ao=pt(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"),Oo=pt(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"),Mh=pt(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"),ls=pt(l.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),pi=pt(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"),zh=pt(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"),J={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"},_o=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}},Bh=(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(""),Lt=(e,t,r)=>{const n=_o(e),i=_o(t);return Bh(n.r+(i.r-n.r)*r,n.g+(i.g-n.g)*r,n.b+(i.b-n.b)*r)},cs=e=>{const t="#FFFFFF",r="#000000";return{50:Lt(t,e,.08),100:Lt(t,e,.16),200:Lt(t,e,.28),300:Lt(t,e,.4),400:Lt(t,e,.55),500:e,600:Lt(e,r,.1),700:Lt(e,r,.2),800:Lt(e,r,.3),900:Lt(e,r,.42)}},Vh=cs(J.primary.main),Nh=cs(J.secondary.main),Ze=cs(J.text.primary),Lh={primary:J.primary.main,secondary:J.secondary.main,textPrimary:J.text.primary,textSecondary:J.text.secondary,divider:J.divider,background:J.background},vt=({hasError:e,sx:t,labelText:r,labelVariant:n="subtitle2",endAdornment:i,endorsementText:a,endorsementBg:s="#E6E8EC",endorsementColor:o="#111827",endorsementRadius:c="6px",endorsementHeight:p=28,endorsementPaddingX:f="8px",...d})=>{var m,S;const u=!!r,y=a?l.jsx(x.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:s,color:o,fontSize:12,fontWeight:300,lineHeight:1,whiteSpace:"nowrap"},children:a}):null,E={...d.InputProps,endAdornment:y||i?l.jsxs(x.InputAdornment,{sx:{mr:-1},position:"end",children:[y||i,(m=d.InputProps)==null?void 0:m.endAdornment]}):(S=d.InputProps)==null?void 0:S.endAdornment};return l.jsxs(x.Box,{children:[u&&l.jsx(x.Typography,{variant:n,sx:{color:J.text.primary,mb:.5,fontWeight:500},children:r}),l.jsx(x.TextField,{fullWidth:!0,size:"small",...d,InputProps:E,label:u?void 0:d.label,sx:{"& .MuiOutlinedInput-root":{backgroundColor:J.background.paper,borderRadius:"8px","& fieldset":{borderColor:J.divider},"&:hover fieldset":{borderColor:Ze[300]},"&.Mui-focused fieldset":{borderColor:Ze[400]},"&.Mui-error fieldset":{borderColor:J.error.main}},"& .MuiInputBase-input":{color:J.text.primary},"& .MuiFormLabel-root":{color:J.text.secondary},"& .MuiFormLabel-root.Mui-focused":{color:J.text.primary},"& .MuiFormHelperText-root":{color:e?J.error.main:J.text.secondary},...t}})]})},$i=({labelText:e,label:t,options:r,loading:n,helperText:i,size:a="small",labelVariant:s="subtitle2",placeholder:o,value:c,sx:p,...f})=>{const d=P.useId(),u=c==null||c===""||Array.isArray(c)&&c.length===0,y=E=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...E,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:J.text.secondary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});return l.jsxs(x.FormControl,{fullWidth:!0,size:a,error:!!f.error,variant:"outlined",children:[e&&l.jsx(x.Typography,{variant:s,sx:{color:J.text.primary,mb:.5,fontWeight:500},children:e}),t&&l.jsx(x.InputLabel,{id:d,shrink:!u||!!o,sx:{color:J.text.secondary,"&.Mui-focused":{color:J.text.primary},"&.Mui-error":{color:J.error.main}},children:t}),l.jsx(x.Select,{...f,value:c,labelId:t?d:void 0,label:t,displayEmpty:!0,input:l.jsx(x.OutlinedInput,{label:t}),IconComponent:y,renderValue:E=>{const m=E;if(u)return l.jsx("span",{style:{color:J.text.secondary},children:o??""});const S=r.find(v=>v.value===m);return(S==null?void 0:S.label)??String(m)},endAdornment:n?l.jsx(x.CircularProgress,{size:20}):void 0,MenuProps:{PaperProps:{sx:{boxShadow:"0px 0px 10px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${J.divider}`,mt:.5,borderRadius:"8px"}}},sx:{backgroundColor:J.background.paper,boxShadow:"none",borderRadius:"8px",height:"40px","& .MuiSelect-select":{color:J.text.primary,fontSize:14,pr:3},"& .MuiOutlinedInput-notchedOutline":{borderColor:J.divider},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:Ze[300]},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:Ze[400]},"&.Mui-error .MuiOutlinedInput-notchedOutline":{borderColor:J.error.main},"& svg":{right:8,position:"absolute",pointerEvents:"none"},...p},children:n?l.jsx(x.MenuItem,{disabled:!0,children:l.jsx(x.CircularProgress,{size:16})}):r.map(E=>l.jsx(x.MenuItem,{value:E.value,sx:{backgroundColor:J.background.paper,color:J.text.primary,fontSize:14,mx:1,"&:hover":{backgroundColor:Ze[50],borderRadius:"4px"},"&.Mui-selected":{backgroundColor:Ze[50],borderRadius:"4px"}},children:E.label},E.value))}),i&&l.jsx(x.FormHelperText,{children:i})]})},qh=e=>l.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:l.jsx("path",{d:"M6 9l6 6 6-6",stroke:J.text.secondary,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),sc=({id:e,options:t,value:r,multiple:n,label:i,labelText:a,placeholder:s,onChange:o,labelVariant:c="subtitle2",disabled:p,loading:f,error:d,helperText:u,onOpen:y,noOptionsText:E,sx:m})=>l.jsxs(x.Box,{children:[a&&l.jsx(x.Typography,{variant:c,sx:{color:J.text.primary,mb:.5,fontWeight:500},children:a}),l.jsx(x.Autocomplete,{id:e,options:t,value:r,multiple:n,size:"small",popupIcon:l.jsx(qh,{}),disabled:p,loading:f,onOpen:y,noOptionsText:E,fullWidth:!0,componentsProps:{paper:{sx:{boxShadow:"0px 0px 10px 0px rgba(0, 0, 0, 0.1)",border:`1px solid ${J.divider}`,mt:.5,borderRadius:"8px"}}},sx:{"& .MuiOutlinedInput-root":{backgroundColor:J.background.paper,borderRadius:"8px",height:"40px","& fieldset":{borderColor:J.divider},"&:hover fieldset":{borderColor:Ze[300]},"&.Mui-focused fieldset":{borderColor:Ze[400]},"&.Mui-error fieldset":{borderColor:J.error.main}},"& .MuiInputBase-input":{color:J.text.primary,fontSize:14},"& .MuiAutocomplete-popupIndicator":{color:J.text.secondary},"& .MuiAutocomplete-endAdornment svg":{width:16,height:16},...m},getOptionLabel:S=>typeof S=="string"?S:(S==null?void 0:S.label)??"",isOptionEqualToValue:(S,v)=>((S==null?void 0:S.value)??S)===((v==null?void 0:v.value)??v),renderOption:(S,v,{selected:j})=>{const{key:D,...F}=S;return l.jsxs(x.Box,{component:"li",...F,sx:{backgroundColor:J.background.paper,color:J.text.primary,mx:.5,borderRadius:"4px","&:hover":{backgroundColor:Ze[50]},"&.Mui-focused":{backgroundColor:Ze[50]},...j?{backgroundColor:Ze[50]}:{}},children:[n&&l.jsx(x.Checkbox,{checked:j}),l.jsx(x.Typography,{variant:"body2",sx:{color:J.text.primary,fontSize:14},children:typeof v=="string"?v:v.label})]},D)},renderInput:S=>l.jsx(x.TextField,{...S,label:i,placeholder:s,size:"small",error:d,helperText:u,InputLabelProps:{shrink:!!r||!!s,sx:{color:J.text.secondary,"&.Mui-focused":{color:J.text.primary},"&.Mui-error":{color:J.error.main}}},InputProps:{...S.InputProps,endAdornment:l.jsxs(l.Fragment,{children:[f?l.jsx(x.CircularProgress,{size:20}):null,S.InputProps.endAdornment]})}}),onChange:(S,v)=>o(v)})]}),Ht=({label:e,checked:t,disabled:r,onChange:n,sx:i})=>l.jsx(x.FormControlLabel,{control:l.jsx(x.Checkbox,{size:"small",checked:t,disabled:r,onChange:(a,s)=>n(s)}),label:e,sx:a=>({"& .MuiFormControlLabel-label":{color:a.palette.text.primary,fontSize:14},...i})}),oc=({labelText:e,label:t,value:r=[],options:n,row:i=!1,onChange:a,labelPosition:s="top",labelVariant:o="subtitle2",helperText:c,error:p,groupPadding:f=1.5,itemGap:d=1,disabled:u=!1})=>{const y=typeof i=="number"&&i>0,E=y?i:12,m=i===!0,S=i===!1&&!y,v=(j,D)=>{const F=Array.isArray(r)?[...r]:[];D?F.includes(j)||a([...F,j]):a(F.filter(C=>C!==j))};return l.jsxs(x.FormControl,{error:p,disabled:u,sx:j=>{var D;return{display:"flex",flexDirection:"column",px:j.spacing(f),borderRadius:((D=j.shape)==null?void 0:D.borderRadius)||8,mx:-2.5,backgroundColor:j.palette.background.paper}},children:[s==="top"&&e&&l.jsx(x.Typography,{variant:o,sx:j=>({color:j.palette.text.primary,mb:.5,fontSize:j.typography.fontSize,fontWeight:500}),children:e}),t&&l.jsx(x.FormLabel,{sx:j=>({color:j.palette.text.secondary,mb:.5,mx:1,fontSize:j.typography.fontSize||12,fontWeight:500,"&.Mui-focused":{color:j.palette.text.primary},"&.Mui-error":{color:j.palette.error.main}}),children:t}),y&&l.jsx(x.Box,{sx:j=>({display:"grid",gridTemplateColumns:`repeat(${E}, 1fr)`,gap:j.spacing(d),mt:0}),children:n.map(j=>{const D=Array.isArray(r)&&r.includes(j.value);return l.jsx(x.FormControlLabel,{control:l.jsx(x.Checkbox,{size:"small",checked:D,onChange:F=>v(j.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:j.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(j.value))})}),m&&l.jsx(x.Box,{sx:j=>({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:j.spacing(d),alignItems:"center",mt:0}),children:n.map(j=>{const D=Array.isArray(r)&&r.includes(j.value);return l.jsx(x.FormControlLabel,{control:l.jsx(x.Checkbox,{size:"small",checked:D,onChange:F=>v(j.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:j.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(j.value))})}),S&&l.jsx(x.Box,{sx:j=>({display:"flex",flexDirection:"column",gap:j.spacing(d),alignItems:"flex-start",mt:0}),children:n.map(j=>{const D=Array.isArray(r)&&r.includes(j.value);return l.jsx(x.FormControlLabel,{control:l.jsx(x.Checkbox,{size:"small",checked:D,onChange:F=>v(j.value,F.target.checked),disabled:u,sx:F=>({color:F.palette.text.secondary,"&.Mui-checked":{color:F.palette.primary.main}})}),label:j.label,sx:F=>({m:0,"& .MuiFormControlLabel-label":{color:F.palette.text.primary,fontSize:12}})},String(j.value))})}),c&&l.jsx(x.FormHelperText,{sx:{mt:.5},children:c})]})},di=({label:e,checked:t,disabled:r,onChange:n,sx:i})=>l.jsx(x.FormControlLabel,{control:l.jsx(x.Switch,{checked:t,disabled:r,onChange:(a,s)=>n(s)}),label:e,sx:a=>({"& .MuiFormControlLabel-label":{color:a.palette.text.primary,fontSize:14},...i})}),Sr=({labelText:e,label:t,value:r,options:n,row:i=!1,onChange:a,labelPosition:s="top",labelVariant:o="subtitle2",helperText:c,error:p,groupPadding:f=1.5,itemGap:d=1})=>l.jsxs(x.FormControl,{error:p,sx:u=>{var y;return{display:"flex",flexDirection:"column",px:u.spacing(f),borderRadius:((y=u.shape)==null?void 0:y.borderRadius)||8,mx:-2.5,backgroundColor:u.palette.background.paper}},children:[s==="top"&&e&&l.jsx(x.Typography,{variant:o,sx:u=>({color:u.palette.text.primary,mb:.5,fontSize:u.typography.fontSize,fontWeight:500}),children:e}),t&&l.jsx(x.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(x.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(x.FormControlLabel,{value:u.value,control:l.jsx(x.Radio,{size:"small",sx:y=>({color:y.palette.text.secondary,"&.Mui-checked":{color:y.palette.primary.main}})}),label:l.jsxs(x.Box,{sx:{display:"flex",flexDirection:"column",gap:0},children:[l.jsx(x.Typography,{variant:"body2",sx:{color:"#1a1a1a",fontSize:12,fontWeight:400,lineHeight:1.5},children:u.label}),u.description&&l.jsx(x.Typography,{variant:"caption",sx:{color:"#1a1a1a",fontSize:10,fontWeight:300,lineHeight:1.5},children:u.description})]}),sx:{m:0,gap:.5,"& .MuiFormControlLabel-label":{marginLeft:0},"& .MuiRadio-root":{alignSelf:"flex-start",marginTop:0}}},String(u.value)))}),c&&l.jsx(x.FormHelperText,{sx:{mt:.5},children:c})]}),us=({labelPosition:e="inner",labelVariant:t="subtitle2",label:r,sx:n,...i})=>l.jsxs(x.Box,{children:[e==="top"&&r&&l.jsx(x.Typography,{variant:t,sx:{color:"#111827",mb:.5},children:r}),l.jsx(x.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}})]}),lc=({labelText:e,labelVariant:t="subtitle2",hasError:r,sx:n,label:i,...a})=>{const s=!!e;return l.jsxs(x.Box,{children:[s&&l.jsx(x.Typography,{variant:t,sx:{color:J.text.primary,mb:.5,fontWeight:500},children:e}),l.jsx(x.TextField,{fullWidth:!0,multiline:!0,minRows:3,size:"small",...a,label:s?void 0:i,sx:{"& .MuiOutlinedInput-root":{backgroundColor:J.background.paper,borderRadius:"8px","& fieldset":{borderColor:J.divider},"&:hover fieldset":{borderColor:Ze[300]},"&.Mui-focused fieldset":{borderColor:Ze[400]},"&.Mui-error fieldset":{borderColor:J.error.main}},"& .MuiInputBase-input":{color:J.text.primary,fontSize:14},"& .MuiFormLabel-root":{color:J.text.secondary},"& .MuiFormLabel-root.Mui-focused":{color:J.text.primary},"& .MuiFormHelperText-root":{color:r?J.error.main:J.text.secondary},...n}})]})},cc=({title:e,subtitle:t,actions:r,align:n="left",sx:i})=>l.jsxs(x.Box,{sx:a=>({display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:a.spacing(1),py:a.spacing(1),...i}),children:[l.jsxs(x.Box,{sx:{display:"flex",flexDirection:"column",minWidth:0,flex:1,textAlign:n},children:[e&&l.jsx(x.Typography,{variant:"h6",sx:a=>({color:a.palette.text.primary,fontSize:12,fontWeight:600,lineHeight:1.3}),children:e}),t&&l.jsx(x.Typography,{variant:"body2",sx:a=>({color:a.palette.text.secondary,mt:e?.5:0,fontSize:12,fontWeight:300}),children:t})]}),r&&l.jsx(x.Box,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:r})]}),yn=pt(l.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),uc=()=>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 pc({items:e,getId:t,onReorder:r,header:n,disabled:i,sx:a,getText:s,showIndex:o=!0,showLeftIcon:c=!0,renderItem:p,chipText:f,helperText:d,emptyStateText:u,emptyStateButtonText:y="Add Phase",onEmptyStateButtonClick:E,emptyStateSx:m}){const[S,v]=P.useState(null),[j,D]=P.useState(null),F=h=>M=>{if(!i){v(h),M.dataTransfer.effectAllowed="move";try{M.dataTransfer.setData("text/plain",String(t(e[h])))}catch{}}},C=h=>M=>{i||(M.preventDefault(),D(h),M.dataTransfer.dropEffect="move")},_=h=>M=>{if(i)return;if(M.preventDefault(),S===null||S===h){v(null),D(null);return}const q=[...e],[G]=q.splice(S,1);q.splice(h,0,G),v(null),D(null),r(q)},I=()=>{v(null),D(null)},R=e.length===0,Y=R&&(u||E!==void 0);return l.jsxs(x.Box,{role:"list",sx:h=>({display:"flex",flexDirection:"column",gap:h.spacing(1),...a}),children:[n,!R&&l.jsx(x.Divider,{sx:{mt:-.5,mb:1,dividerColor:"#EBEBEB"}}),Y?l.jsxs(x.Box,{sx:h=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"200px",padding:h.spacing(4),backgroundColor:h.palette.mode==="dark"?"#000000":J.background.paper,border:`2px dashed ${h.palette.mode==="dark"?"#FFFFFF":J.divider}`,borderRadius:"8px",textAlign:"center",...m}),children:[u&&l.jsx(x.Typography,{variant:"body1",sx:h=>({color:h.palette.text.secondary,fontSize:"14px",fontWeight:400,lineHeight:1.5,mb:E?2:0,maxWidth:"400px"}),children:u}),E&&l.jsx(x.Button,{variant:"outlined",startIcon:l.jsx(yn,{}),onClick:E,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:y})]}):e.map((h,M)=>{const q=S===M,G=j===M&&S!==null&&S!==M;return l.jsx(x.Box,{role:"listitem",draggable:!i,onDragStart:F(M),onDragOver:C(M),onDrop:_(M),onDragEnd:I,sx:B=>({userSelect:"none",cursor:i?"default":"grab",backgroundColor:"#F8F8FA",border:`1px solid ${G?B.palette.primary.main:"#EBEBEB"}`,borderRadius:"8px",padding:B.spacing(1),opacity:q?.6:1,boxShadow:G?`0 0 0 2px ${B.palette.primary.main}33`:"none"}),children:p?p(h,q):l.jsxs(x.Box,{sx:B=>({display:"flex",alignItems:"center",gap:B.spacing(1),minWidth:0}),children:[c&&l.jsx(uc,{}),o&&l.jsxs(x.Typography,{variant:"body2",sx:B=>({fontWeight:600,fontSize:14,color:`${B.palette.text.primary}`,flex:"0 0 auto"}),children:[M+1,"."]}),(()=>{const B=typeof f=="function"?f(h,M):f;return B?l.jsx(x.Chip,{label:B,sx:{borderRadius:"4px",p:"12px 3px"},size:"small"}):null})(),l.jsx(x.Typography,{variant:"body2",sx:B=>({fontSize:12,fontWeight:500,color:`${B.palette.text.primary}90`,flex:1,minWidth:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),children:s?s(h):""})]})},String(t(h)))}),!R&&d?typeof d=="string"?l.jsx(x.Typography,{variant:"caption",sx:h=>({color:`${h.palette.text.primary}60`}),children:d}):d:null]})}const Wh=gt(x.StepConnector)(({theme:e})=>{const t=e.palette.divider||"#E8E8E8",r=e.palette.primary.main;return{[`&.${x.stepConnectorClasses.vertical}`]:{marginLeft:11},[`& .${x.stepConnectorClasses.line}`]:{minHeight:28,borderLeftWidth:2,borderColor:t,transition:"border-color 0.3s ease"},[`&.${x.stepConnectorClasses.completed} .${x.stepConnectorClasses.line}`]:{borderColor:r}}}),Uh=({items:e,activeIndex:t=1,onStepClick:r,sx:n,completedSteps:i})=>{const a=_f(),s=a.palette.primary.main,o=a.palette.text.primary,c=a.palette.divider,p=a.palette.action&&a.palette.action.disabledBackground||"#E8E8E8",f=d=>{const{active:u,completed:y,icon:E}=d;return y?l.jsx(x.Box,{sx:{width:24,height:24,border:`1.2px solid ${s}`,borderRadius:"50%",backgroundColor:s,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:l.jsx(ls,{sx:{fontSize:16,fontWeight:600}})}):u?l.jsx(x.Box,{sx:{width:24,height:24,borderRadius:"50%",border:`1.2px solid ${s}`,backgroundColor:Et(s,.2),color:s,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12},children:E}):l.jsx(x.Box,{sx:{width:24,height:24,borderRadius:"50%",backgroundColor:p,color:o,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12},children:E})};return l.jsx(x.Stepper,{orientation:"vertical",activeStep:t,connector:l.jsx(Wh,{}),sx:{"& .MuiStepConnector-vertical":{my:-1.1},"& .MuiStepLabel-label":{fontSize:14,color:o,fontWeight:500},"& .MuiStep-root":{cursor:r?"pointer":"default"},...n},children:e.map((d,u)=>{const y=Array.isArray(i)&&i.length>0?i.includes(u):u<t;return l.jsxs(x.Step,{onClick:()=>r==null?void 0:r(u),completed:y,children:[l.jsx(x.StepLabel,{StepIconComponent:f,children:l.jsx(x.Typography,{sx:{fontSize:12,fontWeight:500,color:u===t?s:o},children:d.label})}),u!==e.length-1&&l.jsx(x.Divider,{sx:{ml:4.2,borderColor:c}})]},u)})})},ps=({colorKey:e="primary",colorHex:t,tone:r="soft",bgAlpha:n=.12,borderAlpha:i=.24,sx:a,...s})=>l.jsx(x.Chip,{...s,sx:o=>({fontWeight:600,borderRadius:"4px",height:18,border:`0.5px solid ${Et(t||o.palette.text.primary,.5)}`,backgroundColor:Et(t||o.palette.text.primary,.1),"& .MuiChip-label":{p:"8px",color:t||o.palette.text.primary,fontSize:10,fontWeight:500},...a})}),Hh=gt(x.StepConnector)(()=>({[`&.${x.stepConnectorClasses.vertical}`]:{marginLeft:11},[`& .${x.stepConnectorClasses.line}`]:{minHeight:28,borderLeftWidth:2,height:"70px",borderColor:"#E8E8E8",transition:"border-color 0.3s ease",zIndex:-1},[`&.${x.stepConnectorClasses.completed} .${x.stepConnectorClasses.line}`]:{borderColor:J.primary.main}})),Kh=({items:e,activeIndex:t=1,onStepClick:r,sx:n})=>{const[i,a]=P.useState(null),s=o=>{const{active:c,completed:p,icon:f}=o;return p?l.jsx(x.Box,{sx:{width:24,height:24,border:`1.2px solid ${J.primary.main}`,borderRadius:"50%",backgroundColor:J.primary.main,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:l.jsx(ls,{sx:{fontSize:16,fontWeight:600}})}):c?l.jsx(x.Box,{sx:{width:24,height:24,borderRadius:"50%",border:`1.2px solid ${J.primary.main}`,backgroundColor:Et(J.primary.main,.2),color:J.primary.main,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12,zIndex:1e3,overflow:"hidden"},children:f}):l.jsx(x.Box,{sx:{width:24,height:24,borderRadius:"50%",backgroundColor:"#E8E8E8",color:J.text.primary,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:500,fontSize:12,zIndex:1e3},children:f})};return l.jsx(x.Stepper,{orientation:"vertical",activeStep:t,connector:l.jsx(Hh,{}),sx:{"& .MuiStepConnector-vertical":{my:-3.5},"& .MuiStepLabel-label":{fontSize:14,color:J.text.primary,fontWeight:500},"& .MuiStep-root":{cursor:r?"pointer":"default"},...n},children:e.map((o,c)=>l.jsxs(x.Step,{onMouseEnter:()=>a(c),onMouseLeave:()=>a(null),onClick:()=>r==null?void 0:r(c),completed:c<t,children:[l.jsxs(x.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[l.jsxs(x.StepLabel,{StepIconComponent:s,children:[l.jsxs(x.Box,{sx:{display:"flex",gap:1,alignItems:"center"},children:[l.jsx(x.Typography,{sx:{fontSize:14,fontWeight:500,color:c===t?J.primary.main:J.text.primary},children:o.label}),l.jsx(ps,{size:"small",colorHex:c<t?J.success.main:c===t?"#973B00":J.text.primary,label:c<t?"Completed":c===t?"In progress":"Not started"})]}),l.jsx(x.Typography,{sx:{fontSize:12,fontWeight:400,color:`${J.text.primary}60`,mt:.5,width:"80%"},children:o.description})]}),i===c&&l.jsx(x.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(x.Divider,{sx:{ml:4.2,borderColor:J.divider}})]},c))})},Yh=pt(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"),Gh=({variant:e="list",title:t,subtitle:r,text:n,items:i=[],icon:a,colorHex:s,sx:o})=>{const c=s||J.info.main,p=Et(c,.08),f=Et(c,.08),d=a??l.jsx(Yh,{sx:{color:c,fontSize:18}});return e==="inlineInfo"?l.jsxs(x.Card,{sx:{p:1.5,display:"flex",alignItems:"center",gap:1,backgroundColor:p,border:`1px solid ${f}`,boxShadow:"none",...o},children:[l.jsx(x.Box,{sx:{display:"flex",alignItems:"center"},children:d}),l.jsx(x.Typography,{variant:"body2",sx:{fontWeight:400,fontSize:12,lineHeight:1.3,color:c},children:n})]}):e==="inline"?l.jsx(x.Card,{sx:{p:1.5,display:"flex",alignItems:"center",gap:1,backgroundColor:p,border:`1px solid ${f}`,boxShadow:"none",...o},children:l.jsx(x.Typography,{variant:"body2",sx:{fontWeight:400,fontSize:12,lineHeight:1.3,color:c},children:n})}):e==="listWithHeader"?l.jsxs(x.Card,{sx:{p:2,boxShadow:"none",borderRadius:"6px",backgroundColor:p,border:`1px solid ${f}`,...o},children:[l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[d,l.jsx(x.Typography,{variant:"subtitle2",sx:{fontWeight:600,color:c,fontSize:14,lineHeight:1.3},children:t})]}),r&&l.jsx(x.Typography,{variant:"body2",sx:{mt:.5,color:c,fontSize:10,lineHeight:1.3},children:r}),l.jsx(x.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,y)=>l.jsx(x.ListItem,{sx:{py:0},children:l.jsx(x.ListItemText,{primary:u})},y))})]}):l.jsx(x.Card,{sx:{p:"11px",borderRadius:"8px",backgroundColor:p,border:`0.5px solid ${f}`,boxShadow:"none",...o},children:l.jsx(x.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,y)=>l.jsx(x.ListItem,{sx:{py:0},children:l.jsx(x.ListItemText,{primary:u})},y))})})},dc=({value:e,onChange:t,items:r,ariaLabel:n,sx:i,tabSx:a})=>l.jsxs(x.Box,{children:[l.jsx(x.Tabs,{value:e,onChange:(s,o)=>t(o),"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((s,o)=>{const c=typeof s.value=="string"||typeof s.value=="number"?s.value:o;return l.jsx(x.Tab,{value:c,disabled:s.disabled,label:l.jsx(x.Typography,{variant:"body2",children:s.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((s,o)=>{const c=typeof s.value=="string"||typeof s.value=="number"?s.value:o,p=s.content??(typeof s.value=="object"?s.value:null);return p&&e===c?l.jsx(x.Box,{sx:{mt:1},children:p},`panel-${c}`):null})]}),Qh=pt(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"),fc=({name:e,columns:t,initialRow:r,addLabel:n,maxRows:i,hideAddWhenMax:a,disableAddWhenMax:s=!0,showEmptyState:o=!0,rowDeletable:c=!0,control:p,sx:f,addActions:d,emptyTitle:u="No items configured",emptySubtitle:y="Click 'Add' to get started.",emptyCardSx:E,setValue:m,rowSelectionMode:S,rowSelectionKey:v})=>{const{fields:j,append:D,remove:F}=xu({control:p,name:e}),_=!(typeof i=="number"?j.length>=i:!1),I=P.useMemo(()=>{if(v)return v;const U=t.find(Q=>Q.type==="rowSelect");return U==null?void 0:U.key},[t,v]),R=hl({control:p,name:e})||[],Y=P.useMemo(()=>{if(!I)return{};const U={};return R.forEach((Q,ae)=>{U[ae]=!!(Q!=null&&Q[I])}),U},[R,I]),h=P.useCallback(U=>Y[U]===!0,[Y]),M=P.useCallback((U,Q)=>{if(!m||!I)return;const ae=`${e}.${U}.${I}`;S==="single"&&Q&&R.forEach((de,$)=>{if($!==U){const W=`${e}.${$}.${I}`;m(W,!1,{shouldDirty:!0})}}),m(ae,Q,{shouldDirty:!0})},[e,I,S,m,R]),q=U=>{const Q={...U||r};t.forEach(ae=>{ae.value!==void 0&&Q[ae.key]===void 0&&(Q[ae.key]=typeof ae.value=="function"?ae.value(Q,j.length):ae.value)}),D(Q)};P.useEffect(()=>{!o&&j.length===0&&_&&q()},[o,j.length,_]);const G=P.useMemo(()=>t.reduce((Q,ae)=>{if(ae.width==="auto"||ae.width===void 0)return Q+120;const de=typeof ae.width=="number"?ae.width:typeof ae.width=="string"&&parseInt(ae.width)||160;return Q+de},0)+(c?100:0),[t,c]),B=U=>U.width==="auto"||U.width===void 0?{width:"auto",minWidth:120,maxWidth:"none"}:typeof U.width=="number"?{width:`${U.width}px`,minWidth:`${U.width}px`,maxWidth:`${U.width}px`}:typeof U.width=="string"?{width:U.width,minWidth:U.width}:{width:"160px",minWidth:"160px"};return l.jsx(x.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:j.length===0&&o?l.jsxs(x.Box,{sx:U=>({p:4,textAlign:"center",borderStyle:"dashed",borderColor:Et(U.palette.primary.main,.4),backgroundColor:Et(U.palette.primary.main,.04),borderWidth:1,borderRadius:"8px",...E}),children:[l.jsx(x.Typography,{variant:"subtitle1",sx:U=>({color:U.palette.primary.main,fontWeight:600,mb:.5,fontSize:14}),children:u}),l.jsx(x.Typography,{variant:"body2",sx:U=>({color:U.palette.primary.main,mb:2,fontSize:12,fontWeight:400}),children:y}),Array.isArray(d)&&d.length>0?d.map((U,Q)=>l.jsx(x.Button,{variant:"outlined",size:"small",startIcon:l.jsx(yn,{}),sx:{mr:1,mt:1},onClick:()=>q(U.template),disabled:!_&&s,style:{display:!_&&a?"none":void 0},children:U.label},`empty-add-${Q}`)):n&&l.jsx(x.Button,{variant:"outlined",size:"small",startIcon:l.jsx(yn,{}),onClick:()=>q(),disabled:!_&&s,style:{display:!_&&a?"none":void 0},children:n})]}):l.jsxs(l.Fragment,{children:[l.jsx(x.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((U,Q)=>l.jsx(x.Button,{variant:Q===0?"contained":"outlined",size:"small",startIcon:l.jsx(yn,{}),onClick:()=>q(U.template),sx:{borderRadius:"3px",fontSize:"10.938px",fontWeight:500,textTransform:"none",px:1.17,py:.586,minWidth:"90px","&:hover":{backgroundColor:Q===0?"#04502d":void 0}},disabled:!_&&s,style:{display:!_&&a?"none":void 0},children:U.label},`add-${Q}`)):n&&l.jsx(x.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:!_&&s,style:{display:!_&&a?"none":void 0},children:n})}),l.jsx(x.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(x.TableContainer,{sx:{width:"100%",minWidth:"100%"},children:l.jsxs(x.Table,{stickyHeader:!0,sx:{minWidth:`${G||650}px`},children:[l.jsx(x.TableHead,{children:l.jsxs(x.TableRow,{children:[t.map(U=>l.jsx(x.TableCell,{sx:{backgroundColor:"#F2F3F5",borderBottom:"1.756px solid #E5E6EB",fontWeight:500,fontSize:"12px",color:"#6B7785",whiteSpace:"nowrap",height:"43px",px:1.75,py:0,...B(U)},children:U.header},U.key)),c&&l.jsx(x.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(x.TableBody,{children:j.map((U,Q)=>{const ae=h(Q),de=S&&!ae;return l.jsxs(x.TableRow,{children:[t.map($=>{var pe;const W=`${e}.${Q}.${$.key}`,Z=$.type==="rowSelect"||$.key===I,ue=Z?!1:de?!0:typeof $.disabled=="function"?$.disabled(U,Q):!!$.disabled;if($.type==="index"){const re=$.indexFormat?$.indexFormat(Q):`#${Q+1}`;return l.jsx(x.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",textAlign:((pe=$.cellSx)==null?void 0:pe.textAlign)||"center",...B($),...$.cellSx},children:re},$.key)}if($.value!==void 0&&$.editable===!1){const re=typeof $.value=="function"?$.value(U,Q):$.value;return l.jsx(x.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",...B($),...$.cellSx},children:re},$.key)}const he=$.endorsementText?typeof $.endorsementText=="function"?$.endorsementText(U,Q):$.endorsementText:void 0;return l.jsx(x.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",p:1,borderBottom:"1px solid #E5E6EB",...B($),...$.cellSx},children:$.type==="rowSelect"||Z&&$.type==="checkbox"?l.jsx(Re,{name:W,control:p,defaultValue:!1,render:({field:re})=>l.jsx(Ht,{label:"",checked:!!re.value,disabled:!1,onChange:H=>{re.onChange(H),M(Q,H)},sx:$.sx})}):$.type==="checkbox"?l.jsx(Re,{name:W,control:p,render:({field:re})=>l.jsx(Ht,{label:"",checked:!!re.value,disabled:ue,onChange:re.onChange,sx:$.sx})}):$.type==="select"?l.jsx(Re,{name:W,control:p,render:({field:re})=>l.jsx($i,{...re,fullWidth:!0,disabled:ue,options:$.options||[],size:"small",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...$.sx},helperText:$.helperText,required:$.required})}):$.type==="date"?l.jsx(Re,{name:W,control:p,defaultValue:$.value!==void 0?typeof $.value=="function"?$.value(U,Q):$.value:void 0,render:({field:re})=>(P.useEffect(()=>{if(m&&(re.value===void 0||re.value===null||re.value==="")&&$.value!==void 0){const H=typeof $.value=="function"?$.value(U,Q):$.value;m(W,H,{shouldValidate:!1})}},[W,re.value,$.value,U,Q,m]),l.jsx(us,{...re,fullWidth:!0,disabled:ue,size:"small",placeholder:$.placeholder||"DD/MM/YYYY",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...$.sx},helperText:$.helperText,required:$.required}))}):l.jsx(Re,{name:W,control:p,defaultValue:$.value!==void 0?typeof $.value=="function"?$.value(U,Q):$.value:void 0,render:({field:re})=>(P.useEffect(()=>{if(m&&(re.value===void 0||re.value===null||re.value==="")&&$.value!==void 0){const H=typeof $.value=="function"?$.value(U,Q):$.value;m(W,H,{shouldValidate:!1})}},[W,re.value,$.value,U,Q,m]),l.jsx(vt,{...re,fullWidth:!0,type:$.type==="number"?"number":"text",placeholder:$.placeholder,disabled:ue,size:"small",sx:{"& .MuiOutlinedInput-input":{py:"7.5px"},...$.sx},helperText:$.helperText,required:$.required,endorsementText:he,endorsementBg:$.endorsementBg,endorsementColor:$.endorsementColor,endorsementRadius:$.endorsementRadius,endorsementHeight:$.endorsementHeight,endorsementPaddingX:$.endorsementPaddingX,inputProps:{...$.type==="number"?{min:$.min,max:$.max,step:$.step}:{minLength:$.minLength,maxLength:$.maxLength,pattern:$.pattern}}}))})},$.key)}),c&&l.jsx(x.TableCell,{sx:{whiteSpace:"nowrap",height:"35px",px:1.5,py:0,borderBottom:"1px solid #E5E6EB",textAlign:"center"},children:l.jsx(x.IconButton,{size:"small",color:"error",onClick:()=>F(Q),sx:{width:"20px",height:"20px"},children:l.jsx(Qh,{sx:{fontSize:"20px"}})})})]},U.id)})})]})})})]})})},hc=({name:e,control:t,items:r,sx:n,cardSx:i})=>l.jsx(x.Box,{sx:{display:"flex",flexDirection:"column",gap:1,...n},children:r.map(a=>{const s=!!a.leftAction,o=!!a.rightAction,c=!!(a.header||a.chipText),p=a.leftAction,f=a.rightAction;return l.jsxs(x.Box,{sx:{border:"1px solid #DDDDDD",borderRadius:"8px",height:"40px",display:"flex",alignItems:"center",justifyContent:"space-between",px:1,...i},children:[s&&p&&l.jsx(x.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(Ht,{label:p.label||"",checked:!!d.value,onChange:d.onChange,sx:{margin:0}})})}),c&&l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1,flex:s||o?1:"none",ml:s?1:0},children:[a.header&&l.jsx(x.Typography,{variant:"body2",sx:{fontSize:"12px",color:"rgba(0,0,0,0.87)",fontWeight:400},children:a.header}),a.chipText&&l.jsx(x.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})]}),o&&f&&l.jsx(x.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(di,{label:f.label,checked:!!d.value,onChange:d.onChange,sx:{margin:0}})})}),!s&&!o&&!c&&l.jsx(x.Box,{sx:{width:"100%",height:"100%"}})]},a.id)})}),mc=pt(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"),ta=pt(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"),Zh=[{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"}],ra=[{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"}],Xh=({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:s})=>{const[o,c]=P.useState(e.seasonalMonths||[]),p=u=>{const y=o.includes(u)?o.filter(E=>E!==u):[...o,u];c(y),r(e.id,{seasonalMonths:y})},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,y=e.max||0;return Number.isInteger(y)?y<u?"Max must be ≥ Min.":null:"Use whole periods."})();return l.jsx(x.Card,{sx:{border:"2px solid",borderColor:J.divider,position:"relative",...s},children:l.jsxs(x.CardContent,{sx:{p:2},children:[l.jsxs(x.Box,{sx:{mb:1,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs(x.Box,{sx:{display:"flex",gap:.5,alignItems:"center"},children:[l.jsx(x.Box,{children:l.jsx(uc,{})}),l.jsx(ps,{label:t+1,size:"small"})]}),l.jsx(x.IconButton,{onClick:()=>n(e.id),disabled:a,sx:{color:J.error.main,"&:hover":{bgcolor:Ze[50]}},size:"small",children:l.jsx(mc,{fontSize:"small"})})]}),l.jsx(x.Box,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:l.jsxs(x.Box,{sx:{flex:1,display:"grid",gap:1.5},children:[l.jsxs(x.Box,{sx:{display:"flex",gap:2,mb:.5},children:[l.jsx(x.Box,{sx:{flex:.5,display:"grid",gap:1},children:l.jsx($i,{labelText:"Phase type",value:e.type,onChange:u=>r(e.id,{type:u.target.value}),options:Zh,disabled:a})}),l.jsxs(x.Box,{sx:{display:"grid",gap:1,flex:.5},children:[l.jsx(x.Typography,{variant:"caption",sx:{fontSize:"12px",color:J.text.secondary},children:"Allocation priority (1–9)"}),l.jsx(vt,{type:"number",value:e.priority||5,onChange:u=>{const y=parseInt(u.target.value)||5;r(e.id,{priority:Math.min(9,Math.max(1,y))})},inputProps:{min:1,max:9},disabled:a,sx:{textAlign:"center"}})]})]}),l.jsxs(x.Box,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2},children:[l.jsx(x.Box,{sx:{display:"grid",gap:1},children:l.jsx(vt,{labelText:"Min periods",type:"number",value:e.min||0,onChange:u=>{const y=parseInt(u.target.value)||0;r(e.id,{min:y,...e.lockLength?{max:y}:{}})},inputProps:{min:0},disabled:a,error:!!f,helperText:f||void 0})}),l.jsx(x.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(x.Box,{sx:{display:"flex",gap:3},children:[l.jsx(Ht,{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(Ht,{label:"Residual fill",checked:e.residualFill||!1,onChange:u=>r(e.id,{residualFill:u}),disabled:a})]}),e.type==="principal-moratorium"&&l.jsxs(x.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(x.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(x.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(ta,{sx:{fontSize:14,color:J.text.secondary,cursor:"help"}})})]}),l.jsx(Sr,{value:e.interestPolicy||"accrue-capitalize",onChange:u=>r(e.id,{interestPolicy:u}),options:ra,labelPosition:"none"}),e.interestPolicy==="accrue-forgive"&&l.jsx(x.Typography,{variant:"caption",sx:{color:J.text.secondary,mt:1},children:"Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."})]}),e.type==="balloon"&&l.jsxs(x.Box,{sx:{display:"grid",gap:1.5},children:[l.jsx(Sr,{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(x.Typography,{variant:"caption",sx:{color:J.text.secondary},children:"Principal at maturity"}),e.type==="step-up-down"&&l.jsxs(x.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(x.Box,{sx:{display:"grid",gap:1.5},children:[l.jsxs(x.Box,{sx:{display:"grid",gap:1},children:[l.jsx(x.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Skip Months"}),l.jsx(x.Box,{sx:{display:"flex",flexWrap:"wrap",gap:1},children:i.map(u=>l.jsx(x.Chip,{label:u,size:"small",onClick:()=>!a&&p(u),sx:{cursor:a?"default":"pointer",bgcolor:o.includes(u)?J.primary.main:"transparent",color:o.includes(u)?J.primary.contrastText:J.text.primary,border:`1px solid ${J.divider}`,"&:hover":{bgcolor:o.includes(u)?Ze[600]:Ze[50]}}},u))})]}),l.jsxs(x.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(x.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(x.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(ta,{sx:{fontSize:14,color:J.text.secondary,cursor:"help"}})})]}),l.jsx(Sr,{value:e.interestPolicy||"accrue-capitalize",onChange:u=>r(e.id,{interestPolicy:u}),options:ra,labelPosition:"none"}),e.interestPolicy==="accrue-forgive"&&l.jsx(x.Typography,{variant:"caption",sx:{color:J.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(x.Box,{sx:{display:"grid",gap:1},children:[l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.jsx(x.Typography,{variant:"subtitle2",sx:{fontWeight:500},children:"Interest policy during phase"}),l.jsx(x.Tooltip,{title:"IFRS: interest is recognized via EIR; to not charge customers, accrue then forgive via waiver journal.",children:l.jsx(ta,{sx:{fontSize:14,color:J.text.secondary,cursor:"help"}})})]}),l.jsx(Sr,{value:e.holidayInterestTreatment||"accrue-capitalize",onChange:u=>r(e.id,{holidayInterestTreatment:u}),options:ra,labelPosition:"none"}),e.holidayInterestTreatment==="accrue-forgive"&&l.jsx(x.Typography,{variant:"caption",sx:{color:J.text.secondary},children:"Accruals are recognized daily and waived at phase end as contra-revenue; no capitalization."})]})]})})]})})};async function xc(e,t,r,n){try{const{endpoint:i,method:a="GET",valueField:s="value",labelField:o="label",headers:c={},params:p={},body:f,transform:d,passThroughFields:u}=e;let y=i;if(t&&!i.startsWith("http")&&(y=`${t}${i.startsWith("/")?i:`/${i}`}`),n){const F=/\{([^}]+)\}/g;y=y.replace(F,(C,_)=>{const I=n[_];return I!=null?encodeURIComponent(String(I)):""}),y=y.replace(/\?&/g,"?").replace(/&&/g,"&").replace(/\?$/g,"")}const E=new URLSearchParams;Object.entries(p).forEach(([F,C])=>{C!=null&&E.append(F,String(C))}),E.toString()&&(y+=`${y.includes("?")?"&":"?"}${E.toString()}`);try{const F=/^https?:\/\//i.test(y),C=new URL(y,F?void 0:"http://local.placeholder"),_=Array.from(C.searchParams.entries());for(const[I,R]of _)(R===""||R==="undefined"||R==="null")&&C.searchParams.delete(I);F?y=C.toString():y=C.pathname+(C.search?C.search:""),y=y.replace(/\?&/g,"?").replace(/&&/g,"&").replace(/\?$/g,"")}catch{}const m={"Content-Type":"application/json",...r,...c},S={method:a,headers:m};(a==="POST"||a==="PUT")&&f&&(S.body=JSON.stringify(f));const v=await fetch(y,S);if(!v.ok)throw new Error(`API request failed: ${v.status} ${v.statusText}`);const j=await v.json();if(d)return d(Array.isArray(j)?j:j.data||j);const D=Array.isArray(j)?j:j.data||j;if(!Array.isArray(D))throw new Error("API response is not an array");return D.map(F=>{const C={label:F[o]||F.name||F.title||String(F[s]||""),value:F[s]||F.id||F.value||""},_=Array.isArray(u)?u:void 0;if(Array.isArray(_))for(const I of _)F[I]!==void 0&&(C[I]=F[I]);return C})}catch(i){throw console.error("API fetch error:",i),new Error(`Failed to fetch data: ${i instanceof Error?i.message:"Unknown error"}`)}}function gc(e,t,r,n,i=!1){const a=P.useMemo(()=>{if(!(e!=null&&e.dependsOn)||!n)return null;const o=n[e.dependsOn];return o!==void 0?o:null},[e==null?void 0:e.dependsOn,n]),s=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 tp({queryKey:s,queryFn:()=>{if(!e)throw new Error("API config is required");return xc(e,t,r,n)},enabled:i&&!!e,staleTime:15*60*1e3,gcTime:30*60*1e3,retry:3,retryDelay:o=>Math.min(1e3*2**o,3e4),refetchOnWindowFocus:!1,refetchOnReconnect:!0,refetchOnMount:!1})}function yr(e){return!!(e.apiConfig||e.api_endpoint)}function ds(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 Jh(e,t){const r=ds(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 fs=({field:e,control:t,errors:r,baseUrl:n,apiHeaders:i,formData:a,setValue:s})=>{const o=r[e.name],c=!!o,[p,f]=P.useState(!1),d=P.useRef(!1),[u,y]=P.useState(!1),[E,m]=P.useState(!1),[S,v]=P.useState(!1),j=P.useRef(null),D=P.useRef(null),F=()=>{var se;const H=e.required;if(typeof H=="function")try{return!!H(a||{})}catch{return!1}if(H!==void 0)return!!H;const ee=(se=e.validation)==null?void 0:se.required;if(typeof ee=="function")try{return!!ee(a||{})}catch{return!1}return ee!==void 0?!!ee:!1},C=H=>F()?`${H} *`:H,_=()=>{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 H=e.value;if(typeof H!="function"||!s)return;let ee;try{ee=H(a||{})}catch{return}const se=a?a[e.name]:void 0;if(I.current===void 0&&(I.current=ee),se===void 0||se===I.current)try{s(e.name,ee,{shouldValidate:!0,shouldDirty:!1}),I.current=ee}catch{}},[JSON.stringify(Array.isArray(e.valueDeps)&&a?e.valueDeps.reduce((H,ee)=>({...H,[ee]:a[ee]}),{}):a||{}),e.name]);const R=P.useMemo(()=>{const H=ds(e);return H&&Array.isArray(e.passThroughFields)&&(H.passThroughFields=e.passThroughFields),H},[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,M=P.useMemo(()=>{if(!(R!=null&&R.dependsOn))return!1;const H=h,ee=Y.current,se=H!==ee;return se&&(Y.current=H),se},[R==null?void 0:R.dependsOn,h]),q=P.useMemo(()=>{const H=e.showWhen;if(typeof H=="function")try{return!!H(a||{})}catch{return!0}if(H&&typeof H=="object"){const ee=H.field,se=H.equals,le=H.in,ce=ee?(a||{})[ee]:void 0;if(ee&&typeof se<"u")return ce===se;if(ee&&Array.isArray(le))return le.includes(ce)}return!0},[e.showWhen,a]),G=P.useCallback(()=>{const H=e.dynamicEndorsement;if(typeof H=="function")try{return H(a||{})}catch{return e.endorsementText}return e.endorsementText},[e,a]),B=P.useCallback(()=>{const H=e.endAdornment,ee=e.endAdornmentSwitch,se=e.endAdornmentCheckbox;if(ee)return l.jsx(Re,{name:ee,control:t,defaultValue:e.endAdornmentSwitchDefault??!1,render:({field:le})=>l.jsx(x.Switch,{checked:le.value||!1,onChange:ce=>{le.onChange(ce.target.checked),e.endAdornmentSwitchOnChange&&e.endAdornmentSwitchOnChange(ce.target.checked,a,s)},disabled:e.endAdornmentSwitchDisabled,size:e.endAdornmentSwitchSize||"small",sx:e.endAdornmentSwitchSx})});if(se)return l.jsx(Re,{name:se,control:t,defaultValue:e.endAdornmentCheckboxDefault??!1,render:({field:le})=>l.jsx(Ht,{label:"",checked:le.value||!1,onChange:le.onChange,disabled:e.endAdornmentCheckboxDisabled,sx:e.endAdornmentCheckboxSx})});if(typeof H=="function")try{return H(a||{},{control:t,setValue:s})}catch{return}return H},[e,a,t,s]),U=P.useMemo(()=>p&&yr(e)&&(!(R!=null&&R.dependsOn)||h),[p,e,R==null?void 0:R.dependsOn,h]),Q=P.useMemo(()=>{const H={};if(!a)return H;const ee=(R==null?void 0:R.endpoint)||(e==null?void 0:e.api_endpoint);if(ee&&typeof ee=="string"){const se=ee.match(/\{([^}]+)\}/g)||[];for(const le of se){const ce=le.slice(1,-1),be=a[ce];be!==void 0&&(H[ce]=be)}}if(R!=null&&R.dependsOn){const se=R.dependsOn,le=a[se];le!==void 0&&(H[se]=le)}return H},[R==null?void 0:R.endpoint,e==null?void 0:e.api_endpoint,R==null?void 0:R.dependsOn,a]),{data:ae=[],isLoading:de,error:$}=gc(R,n,i,Q,U),W=P.useCallback(()=>{yr(e)&&!d.current&&(d.current=!0,f(!0))},[e]),Z=P.useCallback(()=>{yr(e)&&!d.current&&(d.current=!0,f(!0))},[e]);P.useEffect(()=>{if(yr(e)&&!d.current){const H=a==null?void 0:a[e.name];H!=null&&H!==""&&(d.current=!0,f(!0))}},[e,a]),P.useEffect(()=>{yr(e)&&(R!=null&&R.dependsOn)&&M&&d.current&&(d.current=!1,f(!1))},[M,R==null?void 0:R.dependsOn]);const ue=P.useCallback(()=>yr(e)?ae:e.type==="select"||e.type==="toggle"||e.type==="radio"||e.type==="autocomplete"?e.options||[]:[],[e,ae]),he=()=>{var H,ee,se,le,ce,be;switch(e.type){case"title":return l.jsx(x.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(x.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 X=e.actionName,Me=e.actionComponent,Ue=e.actionLabel,Xe=T=>l.jsx(cc,{title:e.title||e.label,subtitle:e.subtitle,align:e.align||"left",sx:e.sx,actions:T??e.actions}),Tt=T=>{if(e.cardWrap){const z={...{px:2,py:1,boxShadow:"none",border:"1px solid #DDDDDD"},...e.cardSx};return l.jsx(x.Card,{sx:z,...e.cardProps,children:T})}return T};return Tt(X&&Me?l.jsx(Re,{name:X,control:t,defaultValue:e.value??!1,render:({field:T})=>Xe(Me==="switch"?l.jsx(di,{label:Ue,checked:!!T.value,onChange:T.onChange}):l.jsx(Ht,{label:Ue||"",checked:!!T.value,onChange:T.onChange}))}):Xe());case"tabs":return l.jsx(Re,{name:e.name,control:t,defaultValue:e.defaultValue??(typeof((ee=(H=e.items)==null?void 0:H[0])==null?void 0:ee.value)=="string"||typeof((le=(se=e.items)==null?void 0:se[0])==null?void 0:le.value)=="number"?(be=(ce=e.items)==null?void 0:ce[0])==null?void 0:be.value:0),render:({field:T})=>{const g=e.items||[],z=g.map((K,V)=>({label:K.label,value:typeof K.value=="string"||typeof K.value=="number"?K.value:V,content:K.content,disabled:K.disabled})),b=T.value,O=(()=>{if(typeof b=="string"||typeof b=="number"){const K=g.findIndex((V,fe)=>typeof V.value=="string"||typeof V.value=="number"?V.value===b:fe===b);return K>=0?K:0}return Number(b)||0})(),L=g[O]||{};return l.jsxs(x.Box,{children:[l.jsx(dc,{value:T.value,onChange:T.onChange,items:z,ariaLabel:e.ariaLabel||e.label,sx:e.sx,tabSx:e.tabSx}),Array.isArray(L.fields)&&L.fields.length>0&&(()=>{const K=L.fields,V=[];let fe=[];for(const ge of K)ge.type==="section"&&fe.length>0?(V.push(fe),fe=[ge]):fe.push(ge);fe.length>0&&V.push(fe);const xe={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(x.Box,{sx:{mt:1},children:V.map((ge,ke)=>{const $e=ge.find(ze=>ze.type==="section"),Ge=($e==null?void 0:$e.cardWrap)!==!1,dt=l.jsx(l.Fragment,{children:ge.map(ze=>{const ne=ze.showWhen;if(ne)try{if(typeof ne=="function"){if(!ne(a||{}))return null}else if(typeof ne=="object"){const Yt=ne.field,gs=ne.equals,ys=ne.in,vs=Yt?(a||{})[Yt]:void 0;if(Yt&&typeof gs<"u"&&vs!==gs||Yt&&Array.isArray(ys)&&!ys.includes(vs))return null}}catch{}const Ke=Math.min(Math.max(ze.col??12,1),12);return l.jsx(x.Box,{sx:{gridColumn:`span ${Ke}`},children:l.jsx(fs,{field:ze,control:t,errors:r,baseUrl:n,apiHeaders:i,formData:a,setValue:s})},ze.name)})});return Ge?l.jsx(x.Card,{sx:{...xe,...($e==null?void 0:$e.cardSx)||{}},...($e==null?void 0:$e.cardProps)||{},children:dt},`tab-group-${ke}`):l.jsx(x.Box,{sx:{display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,width:"100%",mt:1},children:dt},`tab-group-${ke}`)})})})()]})}});case"grid":const He=e.defaultRows||[];return l.jsx(x.Box,{children:l.jsx(Re,{name:e.name,control:t,defaultValue:He.length>0?He:_()||[],render:()=>l.jsx(fc,{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:s,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(hc,{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:T})=>{const g=e,z=T.value||g.items||[],b=typeof g.getId=="function"?g.getId:typeof g.getId=="string"?K=>K[g.getId]:K=>K.id??K._id??K.key??String(K),O=typeof g.getText=="function"?g.getText:typeof g.getText=="string"?K=>K[g.getText]??String(K):K=>K.text??K.label??K.name??K.title??String(K),L=(()=>{if(typeof g.chipText=="function")return g.chipText;if(typeof g.chipText=="string")return z.length>0&&z[0]&&g.chipText in z[0]?(K,V)=>K[g.chipText]??void 0:g.chipText})();return l.jsx(pc,{items:z,getId:b,onReorder:K=>{T.onChange(K)},header:g.header,disabled:e.disabled,sx:g.sx,chipText:L,helperText:g.helperText||(c?o==null?void 0:o.message:void 0),getText:O,showIndex:g.showIndex!==!1,showLeftIcon:g.showLeftIcon!==!1,renderItem:g.renderItem})}});case"text":case"email":case"password":case"tel":case"textarea":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>e.type==="textarea"?l.jsx(lc,{...T,labelText:e.labelPosition==="top"?C(e.label):void 0,label:e.labelPosition!=="top"?C(e.label):void 0,labelVariant:e.labelVariant,placeholder:e.placeholder,disabled:e.disabled,hasError:c,helperText:(o==null?void 0:o.message)||e.helperText}):l.jsx(vt,{...T,id:e.id,labelText:e.labelPosition==="top"?C(e.label):void 0,label:e.labelPosition!=="top"?C(e.label):void 0,endAdornment:B(),endorsementText:G(),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:(o==null?void 0:o.message)||e.helperText,InputProps:e.type==="password"?{endAdornment:l.jsx(ec,{position:"end",children:l.jsx(Gn,{"aria-label":"toggle password visibility",onClick:()=>y(g=>!g),edge:"end",children:u?l.jsx(Oo,{}):l.jsx(Ao,{})})})}:void 0})});case"number":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(vt,{...T,id:e.id,labelText:e.labelPosition==="top"?C(e.label):void 0,label:e.labelPosition!=="top"?C(e.label):void 0,endAdornment:B(),endorsementText:G(),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:(o==null?void 0:o.message)||e.helperText,inputProps:{min:e.min,max:e.max}})});case"select":const et=ue();return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx($i,{labelText:e.labelPosition==="top"?C(e.label):void 0,label:e.labelPosition!=="top"&&e.labelPosition!=="none"?C(e.label):void 0,labelVariant:e.labelVariant,value:T.value,onChange:T.onChange,options:et,disabled:e.disabled||de,placeholder:e.labelPosition==="inner"||e.labelPosition==="none"||!e.labelPosition?e.placeholder||(e.labelPosition==="none"?C(e.label):void 0):e.placeholder,loading:de,error:c||!!$,helperText:(o==null?void 0:o.message)||($==null?void 0:$.message)||e.helperText,onOpen:W})});case"checkbox":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(Ht,{label:C(e.label),checked:!!T.value,disabled:e.disabled,onChange:T.onChange})});case"toggle":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(Sr,{label:C(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:T.value,options:e.options||[],row:!0,onChange:T.onChange})});case"radio":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(Sr,{label:C(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:T.value,options:e.options||[],row:e.row===!0,groupPadding:e.groupPadding,itemGap:e.itemGap,helperText:e.helperText,onChange:T.onChange})});case"checkboxGroup":return l.jsx(Re,{name:e.name,control:t,defaultValue:_()||[],render:({field:T})=>l.jsx(oc,{label:C(e.label),labelPosition:e.labelPosition==="none"?"none":"top",labelVariant:e.labelVariant,value:Array.isArray(T.value)?T.value:[],options:e.options||[],row:e.row,groupPadding:e.groupPadding,itemGap:e.itemGap,helperText:e.helperText,onChange:T.onChange,disabled:e.disabled})});case"switch":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(di,{label:C(e.label),checked:!!T.value,disabled:e.disabled,onChange:T.onChange})});case"autocomplete":const Ye=ue(),w=!!(e.disabled||de||R!=null&&R.dependsOn&&!h);return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>{const g=T.value,z=e.multiple===!0,b=(R==null?void 0:R.valueField)||e.value_field||"value",O=(R==null?void 0:R.labelField)||e.label_field||"label",L=V=>{if(V!=null){if(typeof V=="string"||typeof V=="number")return V;if(typeof V=="object"){if(V[b]!==void 0)return V[b];if(V.value!==void 0)return V.value;if(V.id!==void 0)return V.id}}},K=(()=>{if(z)return(Array.isArray(g)?g:[]).map(fe=>{const xe=Ye.find(ge=>{const ke=L(ge);return ke!==void 0&&ke===fe});return xe||{[b]:fe,[O]:`Selected: ${fe}`,value:fe,label:`Selected: ${fe}`}});{if(g==null||g==="")return null;const V=Ye.find(fe=>{const xe=L(fe);return xe!==void 0&&xe===g});return V||{[b]:g,[O]:`Selected: ${g}`,value:g,label:`Selected: ${g}`}}})();return l.jsx(sc,{id:e.id,options:Ye,value:K,multiple:z,labelText:e.labelPosition==="top"?C(e.label):void 0,label:e.labelPosition!=="top"?C(e.label):void 0,placeholder:w&&(R!=null&&R.dependsOn)&&!h?`Please select ${R.dependsOn.replace(/_/g," ")} first`:e.placeholder,labelVariant:e.labelVariant,disabled:w,loading:de,error:c||!!$,helperText:(o==null?void 0:o.message)||($==null?void 0:$.message)||e.helperText||"",onOpen:Z,noOptionsText:w&&(R!=null&&R.dependsOn)&&!h?`Please select ${R.dependsOn.replace(/_/g," ")} first`:de?"Fetching data...":p&&!de&&Ye.length===0?"No options available":"Click to load options",onChange:V=>{const fe=(R==null?void 0:R.valueField)||e.value_field||"value";if(z){const ge=(Array.isArray(V)?V:[]).map(ke=>typeof ke=="object"&&(ke[fe]||ke.value||ke.id)||ke);T.onChange(ge)}else{let xe;V&&typeof V=="object"?xe=V[fe]||V.value||V.id||V:xe=V,T.onChange(xe);const ge=e.selectedAssignments;if(ge&&V&&typeof V=="object")for(const[ke,$e]of Object.entries(ge)){const Ge=V[$e];if(Ge!==void 0&&typeof s=="function")try{s(ke,Ge,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!1})}catch{}}}}})}});case"date":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>l.jsx(us,{...T,id:e.name,label:C(e.label),labelPosition:e.labelPosition||"inner",labelVariant:e.labelVariant,disabled:e.disabled,error:c,helperText:o==null?void 0:o.message,inputProps:{min:e.minDate,max:e.maxDate}})});case"image":return l.jsx(Re,{name:e.name,control:t,defaultValue:_(),render:({field:T})=>{const g=T.value||e.defaultValue||e.src;if(g){const V=e.imageUploaded||{},fe=V.previewText||"Preview",xe=V.removeText||"Remove",ge=V.saveText||"Save logo",ke=V.showSave!==void 0?V.showSave:!!(e.onSave||V.saveText),$e=()=>{if(v(!0),typeof e.onPreview=="function")try{e.onPreview(g)}catch{}},Ge=()=>{T.onChange(""),typeof e.onRemove=="function"&&e.onRemove()},dt=()=>{typeof e.onSave=="function"&&e.onSave({url:g,file:D.current||void 0})},ze=ne=>{const Ke=ne.target.files&&ne.target.files[0];if(Ke){if(typeof e.onFileSelected=="function")try{e.onFileSelected(Ke)}catch{}try{const Yt=URL.createObjectURL(Ke);T.onChange(Yt)}catch{}D.current=Ke,v(!1)}};return l.jsxs(x.Card,{sx:{display:"flex",alignItems:"center",gap:2,p:2,boxShadow:"0px 1px 4px 0px #00000014",...V.cardSx},children:[l.jsx("input",{type:"file",ref:j,accept:Array.isArray(e.accept)?e.accept.join(","):e.accept||"image/*",style:{display:"none"},onChange:ze}),l.jsxs(x.Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[l.jsx(x.Box,{sx:{width:"30%",height:"10%",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"6px",background:"#FFFFFF",overflow:"hidden",...V.thumbnailSx},children:l.jsx("img",{src:g,alt:e.alt||e.label,style:{maxWidth:"100%",maxHeight:"100%"}})}),l.jsxs(x.Box,{sx:{flexGrow:1},children:[l.jsx(x.Typography,{sx:{fontSize:"12px",fontWeight:500,...V.fileNameSx},children:typeof g=="string"?g.split("/").pop():"Selected image"}),l.jsx(x.Typography,{sx:{fontSize:"10px",...V.fileMetaSx},children:"Image selected"})]}),l.jsxs(x.Box,{sx:{display:"flex",gap:1},children:[l.jsx(x.Button,{type:"button",sx:{...V.previewButtonSx},variant:"outlined",onClick:$e,startIcon:l.jsx(Ao,{}),children:fe}),l.jsx(x.Button,{variant:"outlined",color:"error",onClick:Ge,sx:{...V.removeButtonSx},startIcon:l.jsx(Oo,{}),children:xe}),ke&&l.jsx(x.Button,{variant:"contained",onClick:dt,sx:{...V.saveButtonSx},children:ge})]})]}),l.jsxs(x.Dialog,{open:S,onClose:()=>v(!1),maxWidth:"md",fullWidth:!0,children:[l.jsx(x.DialogTitle,{children:V.previewTitle||"Image preview"}),l.jsx(x.DialogContent,{children:l.jsx(x.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:g,alt:e.alt||e.label,style:{maxWidth:"100%",maxHeight:380}})})}),l.jsxs(x.DialogActions,{children:[l.jsx(x.Button,{type:"button",variant:"outlined",onClick:()=>{var ne;return(ne=j.current)==null?void 0:ne.click()},children:V.replaceText||"Replace logo"}),l.jsx(x.Button,{type:"button",variant:"contained",onClick:()=>v(!1),children:V.closeText||"Close"})]})]})]})}const z=e.imagePlaceholder||{},b=z.icon||"upload",O=j,L=()=>{var V;try{(V=O.current)==null||V.click()}catch{}},K=V=>{const fe=V.target.files&&V.target.files[0];if(fe){typeof e.onFileSelected=="function"&&e.onFileSelected(fe);try{const xe=URL.createObjectURL(fe);T.onChange(xe)}catch{}D.current=fe}};return l.jsxs(x.Card,{sx:{border:"1px dashed",borderColor:"#CCCCCC",boxShadow:"none",p:2,textAlign:"center",color:"primary.main",...z.sx},children:[l.jsx("input",{type:"file",ref:O,accept:Array.isArray(e.accept)?e.accept.join(","):e.accept||"image/*",style:{display:"none"},onChange:K}),l.jsx(Gn,{sx:{borderRadius:"8px",...z.iconSx},children:b==="image"?l.jsx(zh,{sx:{width:36,height:36,color:"primary.main"}}):l.jsx(pi,{sx:{width:36,height:36,color:"primary.main"}})}),l.jsx(x.Typography,{sx:{fontSize:"16px",fontWeight:600,color:"primary.main",...z.titleSx},children:z.title||"Drag & Drop the image here"}),l.jsx(x.Typography,{sx:{fontSize:"12px",fontWeight:400,color:"primary.main",...z.subtitleSx},children:z.subtitle||""}),l.jsx(x.Button,{onClick:L,sx:{my:2,...z.buttonSx},startIcon:l.jsx(pi,{}),variant:"contained",disabled:e.disabled,children:z.buttonText||"Upload File"}),l.jsx(x.Typography,{sx:{fontSize:"12px",fontWeight:400,...z.helperTextSx},children:z.helperText||e.helperText||""})]})}});case"component":return l.jsx(x.Box,{children:e.render?typeof e.render=="function"?(()=>{try{return e.render(a||{},{control:t,setValue:s})}catch{try{return e.render({control:t,formData:a,setValue:s})}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]),re=P.useCallback(async()=>{try{const H=a?a[e.name]:void 0;let ee="";H==null?ee="":Array.isArray(H)?ee=H.join(", "):typeof H=="object"?ee=JSON.stringify(H):ee=String(H),await navigator.clipboard.writeText(ee),m(!0),window.setTimeout(()=>m(!1),1200)}catch{}},[a,e.name]);return l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",gap:.3},children:[l.jsx(x.Box,{sx:{flexGrow:1},children:q?he():null}),pe&&l.jsx(Gn,{"aria-label":`copy ${e.label||e.name}`,onClick:re,size:"small",children:E?l.jsx(ls,{fontSize:"small"}):l.jsx(Mh,{fontSize:"small"})})]})};var na,Ro;function em(){if(Ro)return na;Ro=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,j){return this._size>=this._maxSize&&this.clear(),v in this._values||this._size++,this._values[v]=j};var t=/[^.^\]^[]+|(?=\[\]|\.\.)/g,r=/^\d+$/,n=/^\d/,i=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,a=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,o=new e(s),c=new e(s),p=new e(s);na={Cache:e,split:d,normalizePath:f,setter:function(v){var j=f(v);return c.get(v)||c.set(v,function(F,C){for(var _=0,I=j.length,R=F;_<I-1;){var Y=j[_];if(Y==="__proto__"||Y==="constructor"||Y==="prototype")return F;R=R[j[_++]]}R[j[_]]=C})},getter:function(v,j){var D=f(v);return p.get(v)||p.set(v,function(C){for(var _=0,I=D.length;_<I;)if(C!=null||!j)C=C[D[_++]];else return;return C})},join:function(v){return v.reduce(function(j,D){return j+(y(D)||r.test(D)?"["+D+"]":(j?".":"")+D)},"")},forEach:function(v,j,D){u(Array.isArray(v)?v:d(v),j,D)}};function f(v){return o.get(v)||o.set(v,d(v).map(function(j){return j.replace(a,"$2")}))}function d(v){return v.match(t)||[""]}function u(v,j,D){var F=v.length,C,_,I,R;for(_=0;_<F;_++)C=v[_],C&&(S(C)&&(C='"'+C+'"'),R=y(C),I=!R&&/^\d+$/.test(C),j.call(D,C,R,I,_,v))}function y(v){return typeof v=="string"&&v&&["'",'"'].indexOf(v.charAt(0))!==-1}function E(v){return v.match(n)&&!v.match(r)}function m(v){return i.test(v)}function S(v){return!y(v)&&(E(v)||m(v))}return na}var Rr=em(),ia,$o;function tm(){if($o)return ia;$o=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 ia={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(" ")},ia}var aa=tm(),Ln={exports:{}},Po;function rm(){if(Po)return Ln.exports;Po=1,Ln.exports=function(i){return e(t(i),i)},Ln.exports.array=e;function e(i,a){var s=i.length,o=new Array(s),c={},p=s,f=r(a),d=n(i);for(a.forEach(function(y){if(!d.has(y[0])||!d.has(y[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 o;function u(y,E,m){if(m.has(y)){var S;try{S=", node was:"+JSON.stringify(y)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!d.has(y))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(y));if(!c[E]){c[E]=!0;var v=f.get(y)||new Set;if(v=Array.from(v),E=v.length){m.add(y);do{var j=v[--E];u(j,d.get(j),m)}while(E);m.delete(y)}o[--s]=y}}}function t(i){for(var a=new Set,s=0,o=i.length;s<o;s++){var c=i[s];a.add(c[0]),a.add(c[1])}return Array.from(a)}function r(i){for(var a=new Map,s=0,o=i.length;s<o;s++){var c=i[s];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,s=0,o=i.length;s<o;s++)a.set(i[s],s);return a}return Ln.exports}var nm=rm();const im=Ya(nm),am=Object.prototype.toString,sm=Error.prototype.toString,om=RegExp.prototype.toString,lm=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",cm=/^Symbol\((.*)\)(.*)$/;function um(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Do(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const r=typeof e;if(r==="number")return um(e);if(r==="string")return t?`"${e}"`:e;if(r==="function")return"[Function "+(e.name||"anonymous")+"]";if(r==="symbol")return lm.call(e).replace(cm,"Symbol($1)");const n=am.call(e).slice(8,-1);return n==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):n==="Error"||e instanceof Error?"["+sm.call(e)+"]":n==="RegExp"?om.call(e):null}function ur(e,t){let r=Do(e,t);return r!==null?r:JSON.stringify(e,function(n,i){let a=Do(this[n],t);return a!==null?a:i},2)}function yc(e){return e==null?[]:[].concat(e)}let vc,bc,wc,pm=/\$\{\s*(\w+)\s*\}/g;vc=Symbol.toStringTag;class Io{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[vc]="Error",this.name="ValidationError",this.value=r,this.path=n,this.type=i,this.errors=[],this.inner=[],yc(t).forEach(a=>{if(ct.isError(a)){this.errors.push(...a.errors);const s=a.inner.length?a.inner:[a];this.inner.push(...s)}else this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}bc=Symbol.hasInstance;wc=Symbol.toStringTag;class ct 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(pm,(i,a)=>ur(r[a])):typeof t=="function"?t(r):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,r,n,i,a){const s=new Io(t,r,n,i);if(a)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[wc]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ct)}static[bc](t){return Io[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let $t={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 \`${ur(n,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${ur(r,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${ur(r,!0)}\``+i}},st={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"},Xt={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"},$a={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Pa={isValue:"${path} field must be ${value}"},Qn={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},dm={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"},fm={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: \`${ur(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: \`${ur(r,!0)}\``}return ct.formatError($t.notType,e)}};Object.assign(Object.create(null),{mixed:$t,string:st,number:Xt,date:$a,object:Qn,array:dm,boolean:Pa,tuple:fm});const hs=e=>e&&e.__isYupSchema__;class fi{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,s=typeof n=="function"?n:(...o)=>o.every(c=>c===n);return new fi(t,(o,c)=>{var p;let f=s(...o)?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(!hs(i))throw new TypeError("conditions must return a schema object");return i.resolve(r)}}const qn={context:"$",value:"."};function hi(e,t){return new xr(e,t)}class xr{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&&Rr.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}}xr.prototype.__isYupRef=!0;const Ot=e=>e==null;function Wr(e){function t({value:r,path:n="",options:i,originalValue:a,schema:s},o,c){const{name:p,test:f,params:d,message:u,skipAbsent:y}=e;let{parent:E,context:m,abortEarly:S=s.spec.abortEarly,disableStackTrace:v=s.spec.disableStackTrace}=i;function j(M){return xr.isRef(M)?M.getValue(r,E,m):M}function D(M={}){const q=Object.assign({value:r,originalValue:a,label:s.spec.label,path:M.path||n,spec:s.spec,disableStackTrace:M.disableStackTrace||v},d,M.params);for(const B of Object.keys(q))q[B]=j(q[B]);const G=new ct(ct.formatError(M.message||u,q),r,q.path,M.type||p,q.disableStackTrace);return G.params=q,G}const F=S?o:c;let C={path:n,parent:E,type:p,from:i.from,createError:D,resolve:j,options:i,originalValue:a,schema:s};const _=M=>{ct.isError(M)?F(M):M?c(null):F(D())},I=M=>{ct.isError(M)?F(M):o(M)};if(y&&Ot(r))return _(!0);let Y;try{var h;if(Y=f.call(C,r,C),typeof((h=Y)==null?void 0:h.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${C.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(M){I(M);return}_(Y)}return t.OPTIONS=e,t}function hm(e,t,r,n=r){let i,a,s;return t?(Rr.forEach(t,(o,c,p)=>{let f=c?o.slice(1,o.length-1):o;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 "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(r&&u>=r.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${o}, 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: ${s} which is a type: "${e.type}")`);i=r,r=r&&r[f],e=e.fields[f]}a=f,s=c?"["+o+"]":"."+o}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class mi extends Set{describe(){const t=[];for(const r of this.values())t.push(xr.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 mi(this.values())}merge(t,r){const n=this.clone();return t.forEach(i=>n.add(i)),r.forEach(i=>n.delete(i)),n}}function Hr(e,t=new Map){if(hs(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]=Hr(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,Hr(i,t))}else if(e instanceof Set){r=new Set,t.set(e,r);for(const n of e)r.add(Hr(n,t))}else if(e instanceof Object){r={},t.set(e,r);for(const[n,i]of Object.entries(e))r[n]=Hr(i,t)}else throw Error(`Unable to clone ${e}`);return r}class xt{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 mi,this._blacklist=new mi,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError($t.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=Hr(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(s=>{a.test(s.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&&Ot(a))return a;let s=ur(t),o=ur(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: ${s}
|
|
179
179
|
`+(o!==s?`result of cast: ${o}`:""))}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:s=t,strict:o=this.spec.strict}=r,c=t;o||(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:s,options:r,tests:p},n,f=>{if(f.length)return i(f,c);this.runTests({path:a,value:c,originalValue:s,options:r,tests:this.tests},n,i)})}runTests(t,r,n){let i=!1,{tests:a,value:s,originalValue:o,path:c,options:p}=t,f=m=>{i||(i=!0,r(m,s))},d=m=>{i||(i=!0,n(m,s))},u=a.length,y=[];if(!u)return d([]);let E={value:s,originalValue:o,path:c,options:p,schema:this};for(let m=0;m<a.length;m++){const S=a[m];S(E,f,function(j){j&&(Array.isArray(j)?y.push(...j):y.push(j)),--u<=0&&d(y)})}}asNestedTest({key:t,index:r,parent:n,parentPath:i,originalParent:a,options:s}){const o=t??r;if(o==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof o=="number";let p=n[o];const f=Object.assign({},s,{strict:!0,parent:n,value:p,originalValue:a[o],key:void 0,[c?"index":"key"]:o,path:c||o.includes(".")?`${i||""}[${c?o:`"${o}"`}]`:(i?`${i}.`:"")+t});return(d,u,y)=>this.resolve(f)._validate(p,f,u,y)}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((s,o)=>i._validate(t,r,(c,p)=>{ct.isError(c)&&(c.value=p),o(c)},(c,p)=>{c.length?o(new ct(c,p,void 0,void 0,a)):s(p)}))}validateSync(t,r){var n;let i=this.resolve(Object.assign({},r,{value:t})),a,s=(n=r==null?void 0:r.disableStackTrace)!=null?n:i.spec.disableStackTrace;return i._validate(t,Object.assign({},r,{sync:!0}),(o,c)=>{throw ct.isError(o)&&(o.value=c),o},(o,c)=>{if(o.length)throw new ct(o,t,void 0,void 0,s);a=c}),a}isValid(t,r){return this.validate(t,r).then(()=>!0,n=>{if(ct.isError(n))return!1;throw n})}isValidSync(t,r){try{return this.validateSync(t,r),!0}catch(n){if(ct.isError(n))return!1;throw n}}_getDefault(t){let r=this.spec.default;return r==null?r:typeof r=="function"?r.call(this,t):Hr(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=Wr({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=Wr({message:r,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),n}optional(){return this.optionality(!0)}defined(t=$t.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=$t.notNull){return this.nullability(!1,t)}required(t=$t.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=$t.default),typeof r.test!="function")throw new TypeError("`test` is a required parameters");let n=this.clone(),i=Wr(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(s=>!(s.OPTIONS.name===r.name&&(a||s.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=yc(t).map(a=>new xr(a));return i.forEach(a=>{a.isSibling&&n.deps.push(a.key)}),n.conditions.push(typeof r=="function"?new fi(i,r):fi.fromOptions(i,r)),n}typeError(t){let r=this.clone();return r.internalTests.typeError=Wr({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=$t.oneOf){let n=this.clone();return t.forEach(i=>{n._whitelist.add(i),n._blacklist.delete(i)}),n.internalTests.whiteList=Wr({message:r,name:"oneOf",skipAbsent:!0,test(i){let a=this.schema._whitelist,s=a.resolveAll(this.resolve);return s.includes(i)?!0:this.createError({params:{values:Array.from(a).join(", "),resolved:s}})}}),n}notOneOf(t,r=$t.notOneOf){let n=this.clone();return t.forEach(i=>{n._blacklist.add(i),n._whitelist.delete(i)}),n.internalTests.blacklist=Wr({message:r,name:"notOneOf",test(i){let a=this.schema._blacklist,s=a.resolveAll(this.resolve);return s.includes(i)?this.createError({params:{values:Array.from(a).join(", "),resolved:s}}):!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:s}=r.spec;return{meta:i,label:n,optional:a,nullable:s,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)}}}xt.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])xt.prototype[`${e}At`]=function(t,r,n={}){const{parent:i,parentPath:a,schema:s}=hm(this,t,r,n.context);return s[e](i&&i[a],Object.assign({},n,{parent:i,path:t}))};for(const e of["equals","is"])xt.prototype[e]=xt.prototype.oneOf;for(const e of["not","nope"])xt.prototype[e]=xt.prototype.notOneOf;const mm=()=>!0;function Sc(e){return new Cc(e)}class Cc extends xt{constructor(t){super(typeof t=="function"?{type:"mixed",check:t}:Object.assign({type:"mixed",check:mm},t))}}Sc.prototype=Cc.prototype;function Ec(){return new kc}class kc extends xt{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=Pa.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test(r){return Ot(r)||r===!0}})}isFalse(t=Pa.isValue){return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test(r){return Ot(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)}}Ec.prototype=kc.prototype;const xm=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function gm(e){const t=Da(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 Da(e){var t,r;const n=xm.exec(e);return n?{year:qt(n[1]),month:qt(n[2],1)-1,day:qt(n[3],1),hour:qt(n[4]),minute:qt(n[5]),second:qt(n[6]),millisecond:n[7]?qt(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:qt(n[10]),minuteOffset:qt(n[11])}:null}function qt(e,t=0){return Number(e)||t}let ym=/^[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])?)*$/,vm=/^((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,bm=/^(?:[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,wm="^\\d{4}-\\d{2}-\\d{2}",Sm="\\d{2}:\\d{2}:\\d{2}",Cm="(([+-]\\d{2}(:?\\d{2})?)|Z)",Em=new RegExp(`${wm}T${Sm}(\\.\\d+)?${Cm}$`),km=e=>Ot(e)||e===e.trim(),Tm={}.toString();function vn(){return new Tc}class Tc extends xt{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===Tm?t:i})})}required(t){return super.required(t).withMutation(r=>r.test({message:t||$t.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=st.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=st.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=st.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||st.matches,params:{regex:t},skipAbsent:!0,test:s=>s===""&&n||s.search(t)!==-1})}email(t=st.email){return this.matches(ym,{name:"email",message:t,excludeEmptyString:!0})}url(t=st.url){return this.matches(vm,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=st.uuid){return this.matches(bm,{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(Em,{name:"datetime",message:r||st.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:r||st.datetime_offset,params:{allowOffset:n},skipAbsent:!0,test:a=>{if(!a||n)return!0;const s=Da(a);return s?!!s.z:!1}}).test({name:"datetime_precision",message:r||st.datetime_precision,params:{precision:i},skipAbsent:!0,test:a=>{if(!a||i==null)return!0;const s=Da(a);return s?s.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=st.trim){return this.transform(r=>r!=null?r.trim():r).test({message:t,name:"trim",test:km})}lowercase(t=st.lowercase){return this.transform(r=>Ot(r)?r:r.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>Ot(r)||r===r.toLowerCase()})}uppercase(t=st.uppercase){return this.transform(r=>Ot(r)?r:r.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:r=>Ot(r)||r===r.toUpperCase()})}}vn.prototype=Tc.prototype;let jm=e=>e!=+e;function jc(){return new Fc}class Fc extends xt{constructor(){super({type:"number",check(t){return t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&!jm(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=Xt.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=Xt.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=Xt.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=Xt.moreThan){return this.test({message:r,name:"min",exclusive:!0,params:{more:t},skipAbsent:!0,test(n){return n>this.resolve(t)}})}positive(t=Xt.positive){return this.moreThan(0,t)}negative(t=Xt.negative){return this.lessThan(0,t)}integer(t=Xt.integer){return this.test({name:"integer",message:t,skipAbsent:!0,test:r=>Number.isInteger(r)})}truncate(){return this.transform(t=>Ot(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=>Ot(i)?i:Math[t](i))}}jc.prototype=Fc.prototype;let Ac=new Date(""),Fm=e=>Object.prototype.toString.call(e)==="[object Date]";function ms(){return new Pn}class Pn extends xt{constructor(){super({type:"date",check(t){return Fm(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,r,n)=>!n.spec.coerce||n.isType(t)||t===null?t:(t=gm(t),isNaN(t)?Pn.INVALID_DATE:new Date(t)))})}prepareParam(t,r){let n;if(xr.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=$a.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=$a.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)}})}}Pn.INVALID_DATE=Ac;ms.prototype=Pn.prototype;ms.INVALID_DATE=Ac;function Am(e,t=[]){let r=[],n=new Set,i=new Set(t.map(([s,o])=>`${s}-${o}`));function a(s,o){let c=Rr.split(s)[0];n.add(c),i.has(`${o}-${c}`)||r.push([o,c])}for(const s of Object.keys(e)){let o=e[s];n.add(s),xr.isRef(o)&&o.isSibling?a(o.path,s):hs(o)&&"deps"in o&&o.deps.forEach(c=>a(c,s))}return im.array(Array.from(n),r).reverse()}function Mo(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 Oc(e){return(t,r)=>Mo(e,t)-Mo(e,r)}const Om=(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 Zn(e){if("fields"in e){const t={};for(const[r,n]of Object.entries(e.fields))t[r]=Zn(n);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=Zn(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(Zn)}):"optional"in e?e.optional():e}const _m=(e,t)=>{const r=[...Rr.normalizePath(t)];if(r.length===1)return r[0]in e;let n=r.pop(),i=Rr.getter(Rr.join(r),!0)(e);return!!(i&&n in i)};let zo=e=>Object.prototype.toString.call(e)==="[object Object]";function Bo(e,t){let r=Object.keys(e.fields);return Object.keys(t).filter(n=>r.indexOf(n)===-1)}const Rm=Oc([]);function _c(e){return new Rc(e)}class Rc extends xt{constructor(t){super({type:"object",check(r){return zo(r)||typeof r=="function"}}),this.fields=Object.create(null),this._sortErrors=Rm,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,s=(n=r.stripUnknown)!=null?n:this.spec.noUnknown,o=[].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 o){let u=a[d],y=d in i;if(u){let E,m=i[d];p.path=(r.path?`${r.path}.`:"")+d,u=u.resolve({value:m,context:r.context,parent:c});let S=u instanceof xt?u.spec:void 0,v=S==null?void 0:S.strict;if(S!=null&&S.strip){f=f||d in i;continue}E=!r.__validating||!v?u.cast(i[d],p):i[d],E!==void 0&&(c[d]=E)}else y&&!s&&(c[d]=i[d]);(y!==d in c||c[d]!==i[d])&&(f=!0)}return f?c:i}_validate(t,r={},n,i){let{from:a=[],originalValue:s=t,recursive:o=this.spec.recursive}=r;r.from=[{schema:this,value:s},...a],r.__validating=!0,r.originalValue=s,super._validate(t,r,n,(c,p)=>{if(!o||!zo(p)){i(c,p);return}s=s||p;let f=[];for(let d of this._nodes){let u=this.fields[d];!u||xr.isRef(u)||f.push(u.asNestedTest({options:r,key:d,parent:p,parentPath:r.path,originalParent:s}))}this.runTests({tests:f,value:p,originalValue:s,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 s=n[i];n[i]=s===void 0?a:s}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 s=t;(i=s)!=null&&i.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[n]})),r[n]=a&&"getDefault"in a?a.getDefault(s):void 0}),r}setFields(t,r){let n=this.clone();return n.fields=t,n._nodes=Am(t,r),n._sortErrors=Oc(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 Zn(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=Rr.getter(t,!0);return this.transform(a=>{if(!a)return a;let s=a;return _m(a,t)&&(s=Object.assign({},a),n||delete s[t],s[r]=i(a)),s})}json(){return this.transform(Om)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Qn.exact,test(r){if(r==null)return!0;const n=Bo(this.schema,r);return n.length===0||this.createError({params:{properties:n.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,r=Qn.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=Bo(this.schema,i);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return n.spec.noUnknown=t,n}unknown(t=!0,r=Qn.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(aa.camelCase)}snakeCase(){return this.transformKeys(aa.snakeCase)}constantCase(){return this.transformKeys(t=>aa.snakeCase(t).toUpperCase())}describe(t){const r=(t?this.resolve(t):this).clone(),n=super.describe(t);n.fields={};for(const[a,s]of Object.entries(r.fields)){var i;let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[a]})),n.fields[a]=s.describe(o)}return n}}_c.prototype=Rc.prototype;const $c=e=>{const t={};return e.forEach(r=>{var s,o,c;let n;switch(r.type){case"text":case"textarea":case"tel":n=vn(),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=vn().email(((s=r.validation)==null?void 0:s.message)||`${r.label} must be a valid email address`),r.validation&&(n=gr(n,r,"string"));break;case"password":n=vn(),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=jc().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?hi(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?hi(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=vn(),r.validation&&(n=gr(n,r,"string"));break;case"checkbox":n=Ec(),r.validation&&(n=gr(n,r,"boolean"));break;case"date":n=ms().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=Sc()}const i=((o=r.validation)==null?void 0:o.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}),_c().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=hi(i.min.field),s=i.min.message||i.message||`${t.label} must be at least the value of ${i.min.field}`;e=e.min(a,s)}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=hi(i.max.field),s=i.max.message||i.message||`${t.label} must be at most the value of ${i.max.field}`;e=e.max(a,s)}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,s=i.message||`${t.label} format is invalid`;e=e.test("pattern",s,o=>o?a.test(o):!0)}return i.custom&&(e=e.test("custom",i.message||`${t.label} is invalid`,function(a){const s=this.parent||{},o=i.custom(a,s);return typeof o=="boolean"?o:!1})),e},Pc=({currentStep:e,totalSteps:t,onStepChange:r,stepTitles:n=[],showStepTitles:i=!0,completedSteps:a=[]})=>{const s=P.useMemo(()=>Array.from({length:t},(f,d)=>d+1),[t]),o=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(x.Card,{sx:{mb:2,p:2,boxShadow:"0px 1px 4px 0px #00000014",background:"#F8F8F8",borderRadius:"4px"},children:[l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[l.jsx(x.Box,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap"},children:s.map((f,d)=>{const u=f===e,y=f<e||a.includes(f),E=u||y?"primary.main":"#8F97A4";return l.jsxs(x.Box,{sx:{display:"flex",alignItems:"center"},children:[l.jsxs(x.Box,{onClick:()=>p(f)&&r(f),sx:{display:"flex",alignItems:"center",cursor:p(f)?"pointer":"default"},children:[l.jsx(x.Box,{sx:{width:24,height:24,borderRadius:"50%",border:u||y?"2px solid":"1px solid",borderColor:u||y?"primary.main":"#8F97A4",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:m=>u||y?Et(m.palette.primary.main,.2):"transparent",mr:.5,color:E,fontWeight:u||y?600:500,fontSize:"12px"},children:f}),i&&l.jsx(x.Typography,{sx:{fontSize:"12px",fontWeight:600,color:E},children:c(f)})]}),d<s.length-1&&l.jsx(x.Box,{sx:{width:40,height:2,mx:1,borderRadius:1,backgroundColor:f<e?"primary.main":"#DFE3E8"}})]},f)})}),l.jsx(x.Typography,{sx:{color:"#8F97A4",fontSize:"12px",fontWeight:500},children:`Step ${e} of ${t}, ${o}% complete`})]}),l.jsx(x.LinearProgress,{variant:"determinate",value:o,sx:{height:4,borderRadius:"50px",backgroundColor:f=>f.palette.grey[300],"& .MuiLinearProgress-bar":{backgroundColor:"primary.main",borderRadius:5}}})]})},Dc=({buttons:e,disabled:t=!1})=>{const r=o=>{o.onClick&&o.onClick()},n=e.filter(o=>o.position==="left"||!o.position),i=e.filter(o=>o.position==="center"),a=e.filter(o=>o.position==="right"),s=(o,c)=>{const p=(o.text||"").toLowerCase(),f=o.type==="submit"||p.includes("submit")||p.includes("save")||p.includes("next"),d=o.position==="left"||p.includes("cancel")||p.includes("back")||p.includes("draft"),u=o.type?o.type:f?"submit":"button",y=d?"outlined":"contained",E=o.disabled||t,m=S=>S&&["primary","secondary","error","info","success","warning"].includes(S)?S:"primary";return l.jsxs(x.Button,{type:u,variant:y,color:m(o.color),size:o.size||"large",disabled:E,onClick:o.onClick?()=>r(o):void 0,sx:o.sx,children:[o.loading&&l.jsx(x.CircularProgress,{size:20,sx:{mr:1}}),o.text]},`${o.text}-${c}`)};return l.jsxs(x.Box,{sx:{mt:3,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx(x.Box,{sx:{display:"flex",gap:2},children:n.map((o,c)=>s(o,c))}),l.jsx(x.Box,{sx:{display:"flex",gap:2},children:i.map((o,c)=>s(o,c))}),l.jsx(x.Box,{sx:{display:"flex",gap:2},children:a.map((o,c)=>s(o,c))})]})},$m=({config:e,onSubmit:t,onStepChange:r,currentStep:n=1,totalSteps:i=1,isMultiStep:a=!1,formData:s})=>{const{buttons:o,position:c="right",layout:p="horizontal",spacing:f=2,sx:d}=e,u=v=>{let j="button",D="contained";return v.type?j=v.type:v.text.toLowerCase().includes("submit")||v.text.toLowerCase().includes("save")||v.text.toLowerCase().includes("next")?j="submit":(v.text.toLowerCase().includes("reset")||v.text.toLowerCase().includes("clear"))&&(j="reset"),(v.text.toLowerCase().includes("cancel")||v.text.toLowerCase().includes("back")||v.text.toLowerCase().includes("draft"))&&(D="outlined"),{buttonType:j,buttonVariant:D}},y=v=>["primary","secondary","error","warning","info","success"].includes(v||"")?v:"primary",E=v=>{const{buttonType:j}=u(v);v.onClick?v.onClick():j==="submit"&&t?t(s):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,j)=>{const{buttonType:D,buttonVariant:F}=u(v),C=y(v.color);return l.jsx(x.Button,{type:D,variant:F,color:C,size:v.size||"medium",disabled:v.disabled,onClick:()=>E(v),sx:v.sx,children:v.text},j)},S=()=>{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(x.Box,{sx:S(),children:o.map((v,j)=>l.jsx(x.Box,{sx:{width:"100%"},children:m(v,j)},j))}):l.jsx(x.Box,{sx:S(),children:l.jsx(x.ButtonGroup,{variant:"outlined",size:"medium",children:o.map((v,j)=>m(v,j))})})},Ic=(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,s=n?(t||{})[n]:void 0;if(n&&typeof i<"u")return s===i;if(n&&Array.isArray(a))return a.includes(s)}}return!0},Xn=(e,t)=>{const r=[];for(const n of e)if(Ic(n,t)&&(r.push(n),n.type==="tabs"&&n.items)){const i=n.items||[],a=(t||{})[n.name],s=(()=>{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})(),o=i[s]||{};Array.isArray(o.fields)&&r.push(...Xn(o.fields,t))}return r},Pm=new zu({defaultOptions:{queries:{staleTime:15*60*1e3,gcTime:30*60*1e3,retry:3,retryDelay:e=>Math.min(1e3*2**e,3e4),refetchOnWindowFocus:!1,refetchOnReconnect:!0}}}),Dm=e=>l.jsx(qu,{client:Pm,children:l.jsx(Im,{...e})}),Im=({id:e,theme:t,fields:r,onSubmit:n,onChange:i,submitButtonText:a="Submit",onSubmitClick:s,defaultValues:o,showSubmitButton:c=!0,buttons:p,buttonGroup:f,stickyButtons:d,stickyButtonsSx:u,fixedButtons:y,fixedButtonsSx:E,formCardWrap:m,formCardSx:S,formCardProps:v,baseUrl:j,apiHeaders:D,stepNavigationProps:F})=>{var w,T;const C=[...new Set(r.map(g=>g.step).filter(g=>g!=null&&g>0))].sort((g,z)=>(g||0)-(z||0)),_=C.length>1,I=C.length||1,[R,Y]=P.useState(1),h=_?r.filter(g=>g.step===R):r,M=P.useCallback(g=>{const z=[];for(const b of g)if(z.push(b),b.type==="tabs"&&b.items)for(const O of b.items||[])Array.isArray(O.fields)&&z.push(...M(O.fields));return z},[]),{control:q,handleSubmit:G,formState:{errors:B},watch:U,setValue:Q,resetField:ae,trigger:de}=gu({resolver:P.useCallback((g,z,b)=>{const L=Xn(_?h:r,g),K=$c(L);return bu(K)(g,z,b)},[_,h,r]),mode:"onChange",defaultValues:o}),$=U(),W=P.useRef({});P.useEffect(()=>{const g=[];for(const z of r){const b=z.depends_on;b&&typeof z.name=="string"&&g.push({dependentField:z.name,dependencyName:b})}if(g.length!==0)for(const{dependentField:z,dependencyName:b}of g){const O=W.current[b],L=$==null?void 0:$[b];if(O!==L)try{ae(z)}catch{}W.current[b]=L}},[r,$,ae]);const Z=P.useRef(i);P.useEffect(()=>{Z.current=i},[i]);const ue=P.useMemo(()=>{try{return JSON.stringify($)}catch{return String(Date.now())}},[$]),he=P.useRef(null);P.useEffect(()=>{Z.current&&he.current!==ue&&(he.current=ue,Z.current($))},[ue]);const pe=async()=>{if(!_)return!0;const g=r.filter(b=>b.step===R);for(const b of g)if(typeof b.required=="function"?!!b.required($):!!b.required){const L=$[b.name];let K=!0;if(b.type==="checkbox"?K=L===!0:Array.isArray(L)?K=L.length>0:K=L!=null&&L!=="",!K)return!1}return await de()?!0:Object.keys(B).filter(O=>g.some(L=>L.name===O)).map(O=>{const L=B[O];return typeof(L==null?void 0:L.message)=="string"?L.message:`${O} is invalid`}).length===0},re=P.useMemo(()=>{if(!_)return!0;const g=r.filter(b=>b.step===R);for(const b of g)if(typeof b.required=="function"?!!b.required($):!!b.required){const L=$[b.name];let K=!0;if(b.type==="checkbox"?K=L===!0:Array.isArray(L)?K=L.length>0:K=L!=null&&L!=="",!K)return!1}return Object.keys(B).filter(b=>g.some(O=>O.name===b)).length===0},[_,R,r,$,B]),H=P.useCallback((g,z)=>Ic(g,z),[]),ee=P.useCallback(g=>{const z=[];for(const b of g)if(z.push(b),b.type==="tabs"&&b.items)for(const O of b.items||[])Array.isArray(O.fields)&&z.push(...ee(O.fields));return z},[]),se=P.useCallback((g,z)=>Xn(g,z),[]),le=P.useMemo(()=>{if(_)return re;const g=Xn(r,$);for(const O of g){if(!H(O,$))continue;if(typeof O.required=="function"?!!O.required($):!!O.required){const K=$[O.name];let V=!0;if(O.type==="checkbox"?V=K===!0:V=K!=null&&K!==""&&!(Array.isArray(K)&&K.length===0),!V)return!1}}const z=new Set(g.map(O=>O.name));return Object.keys(B).filter(O=>z.has(O)).length===0},[_,re,r,$,B,se,H]),ce=async g=>{g<1||g>I||g>R&&_&&!await pe()||Y(g)},be=async g=>{if(_&&R<I){console.warn("Form submission attempted on non-final step");return}const b=(O=>{const L={...O||{}},K=ee(r);for(const V of K){if(!V||!V.name)continue;const fe=L[V.name];if(V.type==="dragdroplist"&&Array.isArray(fe)){const xe=V,ge=xe.serialize;if(!ge)continue;const ke=fe,$e=typeof xe.getId=="function"?xe.getId:typeof xe.getId=="string"?ne=>ne==null?void 0:ne[xe.getId]:ne=>(ne==null?void 0:ne.id)??(ne==null?void 0:ne._id)??(ne==null?void 0:ne.key)??String(ne),Ge=typeof xe.getText=="function"?xe.getText:typeof xe.getText=="string"?ne=>(ne==null?void 0:ne[xe.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),dt=(()=>{if(typeof xe.chipText=="function")return xe.chipText;if(typeof xe.chipText=="string")return(ne,Ke)=>ne==null?void 0:ne[xe.chipText]})();let ze=fe;typeof ge=="function"?ze=ke.map((ne,Ke)=>ge(ne,Ke)):ge==="ids"?ze=ke.map(ne=>$e(ne)):ge==="text"?ze=ke.map(ne=>Ge(ne)):ge==="chips"?ze=ke.map((ne,Ke)=>(typeof dt=="function"?dt(ne,Ke):void 0)??""):ge&&typeof ge=="object"&&"field"in ge&&(ze=ke.map(ne=>ne==null?void 0:ne[ge.field])),L[V.name]=ze}}return L})(g);s&&s(b),n(b)},X=async g=>{g&&(g.preventDefault(),g.stopPropagation()),_&&R<I&&await pe()&&ce(R+1)},Me=g=>{g&&(g.preventDefault(),g.stopPropagation()),_&&R>1&&ce(R-1)},Ue=g=>g.col?g.col:(g.xs||g.sm||g.md||g.lg||g.xl)&&(g.xs||g.sm||g.md||g.lg||g.xl)||12,Xe=t?x.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:((w=t.typography)==null?void 0:w.fontFamily)||"Roboto, Arial, sans-serif",fontSize:typeof((T=t.typography)==null?void 0:T.fontSize)=="number"?t.typography.fontSize:14}}):void 0,Tt=()=>{const g=y?{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)",...E}: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 z={...f,buttons:f.buttons.map(b=>{const O=(b.text||"").toLowerCase(),L=b.type==="submit"||O.includes("submit")||O.includes("save")||O.includes("finish")||O.includes("complete"),K=O.includes("next");let V=!1;return _?(L||K)&&(V=!re):L&&(V=!le),{...b,disabled:b.disabled||V}})};return l.jsx(x.Box,{sx:{mt:3,...g||{}},children:l.jsx($m,{config:z,onSubmit:be,onStepChange:ce,currentStep:R,totalSteps:I,isMultiStep:_,formData:$})})}if(p&&p.length>0){const z=p.map(b=>{const O=(b.text||"").toLowerCase(),L=b.type==="submit"||O.includes("submit")||O.includes("save")||O.includes("finish")||O.includes("complete"),K=O.includes("next");let V=!1;return _?(L||K)&&(V=!re):L&&(V=!le),{...b,disabled:b.disabled||V}});return l.jsx(x.Box,{sx:g,children:l.jsx(Dc,{buttons:z})})}return c?l.jsx(x.Box,{sx:{mt:3,display:"flex",justifyContent:"flex-end",flexDirection:"column",alignItems:"flex-end",...g||{}},children:l.jsxs(x.Box,{sx:{display:"flex",gap:2},children:[_&&R>1&&l.jsx(x.Button,{type:"button",variant:"outlined",onClick:Me,children:"Previous"}),_?R<I?l.jsx(x.Button,{type:"button",variant:"contained",color:"primary",size:"large",disabled:!re,onClick:X,children:"Next"}):l.jsx(x.Button,{type:"submit",variant:"contained",color:"primary",size:"large",disabled:!re,children:a}):l.jsx(x.Button,{type:"submit",variant:"contained",color:"primary",size:"large",disabled:!le,children:a})]})}):null},He=P.useMemo(()=>{const g=[];let z=[];for(const b of h)b.type==="section"&&z.length>0?(g.push(z),z=[b]):z.push(b);return z.length>0&&g.push(z),g},[h]),et=l.jsxs(x.Box,{component:"form",onSubmit:g=>{if(_&&R<I){g.preventDefault(),g.stopPropagation(),re&&X();return}G(be)(g)},id:e,onKeyDown:g=>{g.key==="Enter"&&_&&R<I&&(g.preventDefault(),re&&X())},sx:{pb:y?10:void 0},children:[_&&l.jsx(Pc,{currentStep:R,totalSteps:I,onStepChange:ce,stepTitles:F==null?void 0:F.stepTitles,showStepTitles:(F==null?void 0:F.showStepTitles)!==!1}),He.map((g,z)=>{const b=g.find(fe=>fe.type==="section");if(b&&!H(b,$))return null;const O=(b==null?void 0:b.cardWrap)!==!1,L={p:2,boxShadow:"0px 1px 4px 0px #00000029",background:"#FFFFFF",borderRadius:"6px",display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,width:"100%",mb:2},K={display:"grid",gridTemplateColumns:"repeat(12, 1fr)",gap:2,width:"100%",mb:2},V=l.jsx(l.Fragment,{children:g.map(fe=>{if(!H(fe,$))return null;const xe=Ue(fe);return l.jsx(x.Box,{sx:{gridColumn:`span ${xe}`},children:l.jsx(fs,{field:fe,control:q,errors:B,baseUrl:j,apiHeaders:D,formData:$,setValue:Q})},fe.name)})});return O?l.jsx(x.Card,{sx:{...L,...(b==null?void 0:b.cardSx)||{}},...(b==null?void 0:b.cardProps)||{},children:V},`group-${z}`):l.jsx(x.Box,{sx:K,children:V},`group-${z}`)}),Tt()]}),Ye=m?l.jsx(x.Card,{sx:{p:2,boxShadow:"0px 1px 4px 0px #00000029",background:"#FFFFFF",borderRadius:"6px",...S},...v,children:et}):et;return Xe?l.jsx(x.ThemeProvider,{theme:Xe,children:Ye}):Ye},Mm=({src:e,alt:t,width:r="100%",height:n="auto",style:i,className:a,onClick:s})=>l.jsx(x.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:s?"pointer":"default",...i},className:a,onClick:s,onError:o=>{o.currentTarget.src="/placeholder-image.png"}})});function Mr(e,t,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(f){try{p(n.next(f))}catch(d){s(d)}}function c(f){try{p(n.throw(f))}catch(d){s(d)}}function p(f){f.done?a(f.value):i(f.value).then(o,c)}p((n=n.apply(e,t||[])).next())})}const zm=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 cn(e,t,r){const n=Bm(e),{webkitRelativePath:i}=e,a=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof n.path!="string"&&Vo(n,"path",a),Vo(n,"relativePath",a),n}function Bm(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const n=t.split(".").pop().toLowerCase(),i=zm.get(n);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function Vo(e,t,r){Object.defineProperty(e,t,{value:r,writable:!1,configurable:!1,enumerable:!0})}const Vm=[".DS_Store","Thumbs.db"];function Nm(e){return Mr(this,void 0,void 0,function*(){return xi(e)&&Lm(e.dataTransfer)?Hm(e.dataTransfer,e.type):qm(e)?Wm(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Um(e):[]})}function Lm(e){return xi(e)}function qm(e){return xi(e)&&xi(e.target)}function xi(e){return typeof e=="object"&&e!==null}function Wm(e){return Ia(e.target.files).map(t=>cn(t))}function Um(e){return Mr(this,void 0,void 0,function*(){return(yield Promise.all(e.map(r=>r.getFile()))).map(r=>cn(r))})}function Hm(e,t){return Mr(this,void 0,void 0,function*(){if(e.items){const r=Ia(e.items).filter(i=>i.kind==="file");if(t!=="drop")return r;const n=yield Promise.all(r.map(Km));return No(Mc(n))}return No(Ia(e.files).map(r=>cn(r)))})}function No(e){return e.filter(t=>Vm.indexOf(t.name)===-1)}function Ia(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 Km(e){if(typeof e.webkitGetAsEntry!="function")return Lo(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?zc(t):Lo(e,t)}function Mc(e){return e.reduce((t,r)=>[...t,...Array.isArray(r)?Mc(r):[r]],[])}function Lo(e,t){return Mr(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 s=yield a.getFile();return s.handle=a,cn(s)}}const n=e.getAsFile();if(!n)throw new Error(`${e} is not a File`);return cn(n,(r=t==null?void 0:t.fullPath)!==null&&r!==void 0?r:void 0)})}function Ym(e){return Mr(this,void 0,void 0,function*(){return e.isDirectory?zc(e):Gm(e)})}function zc(e){const t=e.createReader();return new Promise((r,n)=>{const i=[];function a(){t.readEntries(s=>Mr(this,void 0,void 0,function*(){if(s.length){const o=Promise.all(s.map(Ym));i.push(o),a()}else try{const o=yield Promise.all(i);r(o)}catch(o){n(o)}}),s=>{n(s)})}a()})}function Gm(e){return Mr(this,void 0,void 0,function*(){return new Promise((t,r)=>{e.file(n=>{const i=cn(n,e.fullPath);t(i)},n=>{r(n)})})})}var Wn={},qo;function Qm(){return qo||(qo=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(s){var o=s.trim().toLowerCase();return o.charAt(0)==="."?n.toLowerCase().endsWith(o):o.endsWith("/*")?a===o.replace(/\/.*$/,""):i===o})}return!0}),Wn}var Zm=Qm();const sa=Ya(Zm);function Wo(e){return ex(e)||Jm(e)||Vc(e)||Xm()}function Xm(){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.11.
|
|
3
|
+
"version": "1.11.1",
|
|
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",
|