@codezee/sixtify-brahma 0.2.360 → 0.2.361
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/package.json +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/EditableFields/SmartTextField.d.ts.map +1 -1
- package/packages/shared-components/dist/index.cjs.js +1 -1
- package/packages/shared-components/dist/index.cjs.js.map +1 -1
- package/packages/shared-components/dist/index.esm.js +1 -1
- package/packages/shared-components/dist/index.esm.js.map +1 -1
|
@@ -20,5 +20,5 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o from"@m
|
|
|
20
20
|
opacity: 1;
|
|
21
21
|
transform: translateY(0) scale(1);
|
|
22
22
|
}
|
|
23
|
-
`,lA=v(M)((({theme:e})=>{const{iron:t,butterflyBlue:i}=e.palette.app.color,{white:o}=e.palette.common;return{display:"inline-flex",alignItems:"center",gap:"2px",padding:"4px",borderRadius:"12px",background:o,border:`1px solid ${y(i[900],.14)}`,boxShadow:`\n 0 12px 32px ${y(t[900],.28)},\n 0 4px 12px ${y(t[900],.18)},\n 0 1px 3px ${y(t[900],.12)}\n `,backdropFilter:"blur(10px)",animation:`${rA} 220ms cubic-bezier(0.22, 1, 0.36, 1)`,position:"relative","&::before":{content:'""',position:"absolute",top:-5,left:"50%",width:10,height:10,background:o,border:`1px solid ${y(i[900],.14)}`,borderBottom:"none",borderRight:"none",transform:"translateX(-50%) rotate(45deg)",zIndex:0}}})),aA=v(r,{shouldForwardProp:e=>"logoSize"!==e&&"delayMs"!==e})((({theme:e,logoSize:t="large",delayMs:i=0})=>{const{butterflyBlue:o,iron:r}=e.palette.app.color,{button:n,icon:l,padding:a}=((e="large")=>"small"===e?{button:26,icon:14,padding:"4px"}:"medium"===e?{button:30,icon:16,padding:"5px"}:{button:34,icon:18,padding:"6px"})(t);return{width:n,height:n,padding:a,color:r[800],zIndex:1,animation:`${nA} 240ms cubic-bezier(0.22, 1, 0.36, 1) both`,animationDelay:`${i}ms`,transition:"background-color 0.18s ease, color 0.18s ease, transform 0.18s ease","& .MuiSvgIcon-root":{fontSize:l},"&:hover":{backgroundColor:y(o[900],.1),color:o[900],transform:"translateY(-1px)"},"&:focus-visible":{outline:`2px solid ${o[900]}`,outlineOffset:1}}})),sA=v(M,{shouldForwardProp:e=>"logoSize"!==e})((({logoSize:e="large"})=>({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"small"===e?"2px":"6px",padding:"small"===e?"2px":"4px"})));function CA({open:t,anchorEl:i,size:o,actions:r,onClose:n,onMouseEnter:l,onMouseLeave:a}){const s=J(),{slate:C}=s.palette.app.color;return e(ce,{open:t,anchorEl:i,onClose:n,disableRestoreFocus:!0,disableScrollLock:!0,marginThreshold:8,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},slotProps:{paper:{elevation:0,onMouseEnter:l,onMouseLeave:a,sx:{mt:1,overflow:"visible",background:"transparent",boxShadow:"none"}}},sx:{pointerEvents:"none","& .MuiPaper-root":{pointerEvents:"auto"}},children:e(lA,{role:"toolbar","aria-label":"Logo actions",children:r.map((({key:t,label:i,icon:r,onClick:n},l)=>e(El,{toolTipLabel:i,placement:"top",children:e(aA,{logoSize:o,delayMs:40*l,"aria-label":i,onClick:e=>{e.stopPropagation(),n(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),n(e))},sx:{color:C[900]},children:r})},t)))})})}const dA=v(M)({display:"flex",flexDirection:"column",gap:"12px"}),AA=v(M)({display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",gap:"10px"}),cA=v(M)((({theme:e})=>{const{mirage:t,butterflyBlue:i,lightBlue:o}=e.palette.app.color;return{position:"relative",width:"100%",height:280,borderRadius:"8px",overflow:"hidden",backgroundColor:t[900],border:`1px solid ${i[700]}`,[e.breakpoints.up("sm")]:{height:360},"& .reactEasyCrop_CropArea":{border:`2px solid ${i[900]} !important`,color:y(t[900],.55)},"& .reactEasyCrop_CropAreaGrid::before, & .reactEasyCrop_CropAreaGrid::after":{borderColor:y(o[50],.35)}}})),hA=v(M)({display:"flex",alignItems:"center",gap:"8px"}),pA=v(r)((({theme:e})=>{const{butterflyBlue:t,iron:i}=e.palette.app.color;return{color:t[900],"&.Mui-disabled":{color:i[700]}}})),uA=v(M)((({theme:e})=>{const{butterflyBlue:t,lightBlue:i}=e.palette.app.color;return{width:40,height:40,borderRadius:"6px",overflow:"hidden",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i[50],border:`1px solid ${t[700]}`}})),gA=v(M)((({theme:e})=>{const{mirage:t,lightBlue:i}=e.palette.app.color;return{position:"absolute",inset:0,zIndex:5,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10px",backgroundColor:y(t[900],.7),color:i[50]}}));function mA({imageSrc:t,aspectRatio:i,rotation:o,zoom:r,onZoomChange:n,onCropComplete:l}){const[a,s]=h({x:0,y:0});u((()=>{s({x:0,y:0})}),[i]);const C=g(((e,t)=>{l(t)}),[l]);return e(gi,{image:t,crop:a,zoom:r,rotation:o,aspect:Yd[i],onCropChange:s,onZoomChange:n,onCropComplete:C,objectFit:"contain",showGrid:!0,style:{containerStyle:{width:"100%",height:"100%"}}})}function fA({open:i,imageSrc:o,originalFile:r,aspectRatios:n=qd,enabledVariants:l,initialAspectRatio:s="1:1",onClose:C,onApply:d}){const A=J(),{iron:c,butterflyBlue:p}=A.palette.app.color,[m,f]=h(s),[k,E]=h(1),[I,S]=h(0),[w,B]=h(null),[x,Q]=h(!1),[b,v]=h(null),R=g((()=>{E(1),S(0)}),[]);u((()=>{i&&(f(s),R(),B(null),v((e=>(Nd(e),null))))}),[i,s,R]),u((()=>{const e=new AbortController;return(async()=>{if(w&&o)try{const t=await eA(o,w,I,void 0,void 0,"image/png");if(e.signal.aborted)return;const i=URL.createObjectURL(t);if(e.signal.aborted)return void Nd(i);v((e=>(Nd(e),i)))}catch{if(e.signal.aborted)return;v((e=>(Nd(e),null)))}})(),()=>{e.abort()}}),[w,o,I]);return e(AC,{open:i,onClose:C,title:"Crop Logo",maxWidth:"md",actions:t(a,{direction:"row",gap:"10px",justifyContent:"flex-end",children:[e(Fr,{actionType:"cancel",variant:"outlined",onClick:C,disableKeyboardShortcut:x,disabled:x}),e(Fr,{onClick:()=>{(async()=>{if(w){Q(!0);try{const e=await oA({imageSrc:o,original:r,pixelCrop:w,rotation:I,aspectRatio:m,enabledVariants:l});d({...e,aspectRatio:m}),C()}catch{Ws.error({title:"Failed to process cropped image. Please try again."})}finally{Q(!1)}}else Ws.error({title:"Adjust the crop area before saving."})})()},loading:x,label:"Apply"})]}),children:t(dA,{children:[t(AA,{children:[e(Rr,{renderButtons:n.map((e=>({icon:null,value:e,label:e,selected:m===e,size:"small",onClick:e=>{const t=n.find((t=>t===e));t&&f(t)}}))),sx:{textTransform:"none",fontWeight:500,boxShadow:"none","&.MuiButton-text":{color:c[800]}}}),t(a,{direction:"row",alignItems:"center",gap:"2px",children:[e(El,{toolTipLabel:"Drag to reposition. Scroll or use zoom to refine.",children:e(pA,{size:"small","aria-label":"Crop tips",children:e(Vt,{fontSize:"small"})})}),e(El,{toolTipLabel:"Rotate left",children:e(pA,{size:"small",onClick:()=>S((e=>e-90)),"aria-label":"Rotate left",disabled:x,children:e(Ai,{fontSize:"small"})})}),e(El,{toolTipLabel:"Rotate right",children:e(pA,{size:"small",onClick:()=>S((e=>e+90)),"aria-label":"Rotate right",disabled:x,children:e(ci,{fontSize:"small"})})}),e(El,{toolTipLabel:"Reset",children:e(pA,{size:"small",onClick:R,"aria-label":"Reset crop",disabled:x,children:e(di,{fontSize:"small"})})})]})]}),t(M,{sx:{position:"relative"},children:[e(cA,{children:e(mA,{imageSrc:o,aspectRatio:m,rotation:I,zoom:k,onZoomChange:E,onCropComplete:B})}),x&&t(gA,{children:[e(_,{size:28,sx:{color:p[900]}}),e(q,{variant:"body2",children:"Processing…"})]})]}),t(hA,{children:[e(El,{toolTipLabel:"Zoom out",children:e(pA,{size:"small",onClick:()=>{E((e=>Math.max(1,Number((e-.1).toFixed(2)))))},"aria-label":"Zoom out",disabled:k<=1||x,children:e(pi,{fontSize:"small"})})}),e(ui,{value:k,min:1,max:3,step:.05,"aria-label":"Zoom",onChange:(e,t)=>{"number"==typeof t&&E(t)},size:"small",disabled:x,sx:{flex:1,color:p[900],"& .MuiSlider-rail":{backgroundColor:c[700]}}}),e(El,{toolTipLabel:"Zoom in",children:e(pA,{size:"small",onClick:()=>{E((e=>Math.min(3,Number((e+.1).toFixed(2)))))},"aria-label":"Zoom in",disabled:k>=3||x,children:e(hi,{fontSize:"small"})})}),t(q,{variant:"caption",color:c[800],sx:{minWidth:36,textAlign:"right"},children:[Math.round(100*k),"%"]}),b&&e(uA,{children:e(M,{component:"img",src:b,alt:"Crop preview",sx:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})})]})]})})}const kA="120px",EA="120px",IA=(e,t,i)=>i?"none":t?`1px dashed ${e}`:`1px solid ${e}`,SA=v(M,{shouldForwardProp:e=>"isDragging"!==e&&"hasImage"!==e&&"disabled"!==e&&"frameWidth"!==e&&"frameHeight"!==e&&"frameBorderRadius"!==e&&"isViewMode"!==e&&"hideBorder"!==e})((e=>(({theme:e,isDragging:t,hasImage:i,disabled:o,frameWidth:r,frameHeight:n,frameBorderRadius:l,isViewMode:a,hideBorder:s})=>{const{butterflyBlue:C,iron:d}=e.palette.app.color,A=t||i?C[900]:e.palette.grey[400],c=r??EA,h=a&&i||!a&&!o,p=!o&&!a&&!s;return{width:c,height:n??kA,minWidth:c,maxWidth:c,position:"relative",overflow:"hidden",borderRadius:l??"10px",border:IA(A,t,s),backgroundColor:t?y(C[900],.05):i?e.palette.common.white:d[50],cursor:h?"pointer":"default",opacity:o&&!a?.6:1,transition:"all 0.2s ease-in-out",outline:"none",boxSizing:"border-box","&:focus-visible":{outline:h?`2px solid ${C[900]}`:"none",outlineOffset:2},...p&&{"&:hover":{border:IA(C[900],t)}}}})(e))),wA=v(M)((({theme:e})=>({width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.palette.common.white}))),BA=v(M,{shouldForwardProp:e=>"frameBorderRadius"!==e})((({theme:e,frameBorderRadius:t})=>{const{mirage:i}=e.palette.app.color;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",backgroundColor:y(i[600],.2),backdropFilter:"blur(3px)",borderRadius:t??"10px",zIndex:2}})),xA=v(M,{shouldForwardProp:e=>"frameBorderRadius"!==e})((({theme:e,frameBorderRadius:t})=>{const{mirage:i}=e.palette.app.color;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:y(i[600],.35),backdropFilter:"blur(2px)",borderRadius:t??"10px",zIndex:3}}));function QA({open:i,size:o,disabled:n,borderRadius:l,onEdit:a,onDelete:s,onHoverChange:C}){const d=J(),{lightBlue:A}=d.palette.app.color,c="small"===o?16:20,h="small"===o?"small":"medium";return e(ai,{in:i,timeout:{enter:300,exit:1e3},children:t(BA,{frameBorderRadius:l,onFocus:()=>C(!0),onBlur:e=>{Pd(e.currentTarget,e.relatedTarget)&&C(!1)},children:[e(r,{tabIndex:0,disabled:n,"aria-label":"Replace logo",size:h,onClick:e=>{e.stopPropagation(),a()},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a())},children:e(ni,{sx:{color:A[50],fontSize:c}})}),e(r,{tabIndex:0,disabled:n,"aria-label":"Remove logo",size:h,onClick:s,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||s(e)},children:e(ri,{sx:{color:A[50],fontSize:c}})})]})})}function MA({size:i,disabled:o=!1,enableCaptureImage:r=!1,onAttach:n,onCapture:l}){const a=J(),{iron:s}=a.palette.app.color,C=e=>t=>{t.stopPropagation(),t.preventDefault(),o||e()};return t(sA,{logoSize:i,children:[r&&e(El,{toolTipLabel:"Capture photo",placement:"top",children:e(aA,{logoSize:i,delayMs:0,disabled:o,"aria-label":"Capture photo",onClick:C((()=>l?.())),children:e(oi,{sx:{color:s[900]}})})}),e(El,{toolTipLabel:"Upload logo",placement:"top",children:e(aA,{logoSize:i,delayMs:r?40:0,disabled:o,"aria-label":"Upload logo",onClick:C(n),children:e(fi,{sx:{color:s[900]}})})})]})}const bA={small:{base:60,rectShort:36,rectMaxLong:120,borderRadius:"8px",iconFontSize:20},medium:{base:80,rectShort:48,rectMaxLong:160,borderRadius:"8px",iconFontSize:24},large:{base:120,rectShort:72,rectMaxLong:240,borderRadius:"10px",iconFontSize:28}},JA=(e,t="square")=>{const{base:i,borderRadius:o}=bA[e];return{width:i,height:i,borderRadius:"circle"===t?"50%":o}},vA=e=>{const{base:t,rectMaxLong:i}=bA[e];return{maxPreviewWidth:i,maxPreviewHeight:t}},RA=(e,t)=>{if(!e||!t)return"square";const i=e/t;return Math.abs(i-1)<=.12?"square":i>1?"rectangle":"portrait"},LA=(e,t="large",i,o)=>{const{base:r,rectShort:n,rectMaxLong:l,borderRadius:a}=bA[t];if("circle"===e)return{width:r,height:r,borderRadius:"50%"};if("square"===e)return{width:r,height:r,borderRadius:a};if("rectangle"===e)return{width:l,height:n,borderRadius:a};if(!i||!o)return{width:r,height:r,borderRadius:a};const s=RA(i,o);if("square"===s)return{width:r,height:r,borderRadius:a};const C=i/o;if("rectangle"===s){const e=n;return{width:Math.min(l,Math.round(e*C)),height:e,borderRadius:a}}const d=n;return{width:d,height:Math.min(l,Math.round(d/C)),borderRadius:a}},yA=e=>new Promise(((t,i)=>{const o=new Image;o.onload=()=>{const{naturalWidth:e,naturalHeight:i}=o;t({width:e,height:i})},o.onerror=()=>i(new Error("Failed to load image")),o.crossOrigin="anonymous",o.src=e}));function FA({size:t,disabled:i,enableCaptureImage:o,onAttach:r,onCapture:n}){const l=J(),{iron:s}=l.palette.app.color,{iconFontSize:C}=bA[t];return o?e(MA,{size:t,disabled:i,enableCaptureImage:o,onAttach:r,onCapture:n}):e(a,{justifyContent:"center",alignItems:"center",sx:{height:"100%"},children:e(mi,{sx:{color:s[700],fontSize:C}})})}function UA({open:i,imageSrc:o,title:n="Logo",onClose:l}){const a=J(),{iron:s}=a.palette.app.color;return e(Ei,{open:i,onClose:l,closeAfterTransition:!0,slots:{backdrop:ki},slotProps:{backdrop:{timeout:200,sx:{backgroundColor:y(a.palette.common.white,.45),backdropFilter:"blur(8px) saturate(1.7)",WebkitBackdropFilter:"blur(8px) saturate(9)"}}},"aria-label":n,children:e(ai,{in:i,children:t(M,{sx:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",p:{xs:2,sm:4},outline:"none",overflow:"hidden"},onClick:l,children:[e(r,{"aria-label":"Close",onClick:l,size:"small",sx:{position:"absolute",top:{xs:12,sm:16},right:{xs:12,sm:16},zIndex:2,color:s[400],bgcolor:"transparent",boxShadow:"none","&:hover":{bgcolor:"transparent",opacity:.7}},children:e(Ct,{fontSize:"small"})}),e(M,{sx:{position:"relative",maxWidth:"min(920px, 100%)",maxHeight:"100%",lineHeight:0},onClick:e=>e.stopPropagation(),children:e(M,{component:"img",src:o,alt:n,sx:{display:"block",maxWidth:"100%",maxHeight:"min(82vh, 680px)",width:"auto",height:"auto",objectFit:"contain",borderRadius:"10px",bgcolor:a.palette.common.white,boxShadow:`0 12px 40px ${y(s[400],.18)}`}})})]})})})}function DA({previewUrl:e,errorImage:t="",onError:i}){const[o,r]=h(!1),[n,l]=h(!1);u((()=>{r(!1),l(!1)}),[e,t]);const a=o&&!!t&&!n;return{displayUrl:a?t:e,hasValidImage:!!e&&(!o||a),handleImageError:()=>{if(!o)return r(!0),void i?.();l(!0)}}}function ZA({previewUrl:o,errorImage:n="",label:l,required:s,hideBorder:C,variant:d,size:A,frame:c,maxPreviewWidth:p,maxPreviewHeight:u,onView:g,onError:m,enableFullImageView:f=!0,containerProps:k}){const E=J(),{iron:I,lightBlue:S}=E.palette.app.color,{iconFontSize:w}=bA[A],[B,x]=h(!1),[Q,b]=h(!1),{displayUrl:v,hasValidImage:R,handleImageError:L}=DA({previewUrl:o,errorImage:n,onError:m}),y="auto"===d,F="small"===A?16:20,U=y?{width:"fit-content",height:"fit-content",minWidth:"unset",maxWidth:"unset"}:void 0,{width:D,height:Z,borderRadius:H}=c,K=y?{display:"block",maxWidth:p,maxHeight:u,width:"auto",height:"auto",borderRadius:H}:{display:"block",width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",borderRadius:H},G=e=>{e?.stopPropagation(),R&&f&&(g?g():b(!0))},Y=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),G())},V=e=>{Pd(e.currentTarget,e.relatedTarget)&&x(!1)};if(!R)return t(a,{direction:"row",alignItems:"center",gap:"15px",...k,children:[e(SA,{hasImage:!1,disabled:!0,isViewMode:!0,frameWidth:D,frameHeight:Z,frameBorderRadius:H,role:"img","aria-label":l||"Logo",children:e(M,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",sx:{height:"100%"},children:e(mi,{sx:{color:I[700],fontSize:w}})})}),l&&e(Pe,{required:s,children:l})]});const T=f?{tabIndex:0,role:"button","aria-label":`View ${l||"logo"}`,onClick:()=>G(),onKeyDown:Y,onMouseEnter:()=>x(!0),onFocus:()=>x(!0),onBlur:V,onMouseLeave:()=>x(!1)}:{};return t(i,{children:[t(a,{direction:"row",alignItems:"center",gap:"15px",...k,children:[t(SA,{hasImage:!0,isViewMode:!0,hideBorder:C,frameWidth:y?"fit-content":D,frameHeight:y?"fit-content":Z,frameBorderRadius:H,sx:U,...T,children:[f&&e(ai,{in:B,timeout:{enter:300,exit:1e3},children:e(BA,{frameBorderRadius:H,onFocus:()=>x(!0),onBlur:V,children:e(r,{tabIndex:0,"aria-label":"View logo",size:"small"===A?"small":"medium",onClick:G,onKeyDown:Y,children:e(Nt,{sx:{color:S[50],fontSize:F}})})})}),e(wA,{sx:{borderRadius:H,...y?{width:"fit-content",height:"fit-content"}:void 0},children:e(M,{component:"img",src:v,alt:"Logo",onError:L,sx:K})})]}),l&&e(Pe,{required:s,children:l})]}),e(UA,{open:Q,imageSrc:v,title:l||"View Logo",onClose:()=>b(!1)})]})}const HA=({size:i="large"})=>{const{base:o,borderRadius:r}=bA[i],n="small"===i;return t(a,{direction:"row",alignItems:"center",gap:n?"10px":"15px",children:[e(Se,{variant:"rectangular",sx:{width:o,height:o,minWidth:o,maxWidth:o,borderRadius:r,transform:"scale(1)"}}),t(a,{gap:"5px",children:[e(Se,{width:n?90:120,height:n?18:24,sx:{transform:"scale(1)"}}),e(Se,{width:n?100:140,height:n?12:16,sx:{transform:"scale(1)"}})]})]})},KA=(e,t,i)=>(t&&Ws.error({title:e}),{valid:!1,error:e,...i}),GA=async(e,t,i,o)=>{try{const{width:r,height:n}=await(e=>new Promise(((t,i)=>{const o=URL.createObjectURL(e),r=new Image;r.onload=()=>{const{naturalWidth:e,naturalHeight:i}=r;URL.revokeObjectURL(o),t({width:e,height:i})},r.onerror=()=>{URL.revokeObjectURL(o),i(new Error("Failed to load image"))},r.src=o})))(e),l=Math.min(r,n);if(l<t)return KA(`Image resolution too low. Minimum is ${t}×${t} px.`,o,{width:r,height:n});if(l<i){const e=`Image quality may be low (${r}×${n} px). Consider using a higher-resolution logo.`;return o&&Ws.warning({title:e}),{valid:!0,warning:e,width:r,height:n}}return{valid:!0,width:r,height:n}}catch{return KA("Unable to read image. Please try another file.",o)}};function YA({onChange:o,onDelete:r,onView:n,onError:l,errorImage:s="",defaultValue:C="",value:d,label:A="Logo",subTitle:m="PNG, JPEG under 5 MB",mode:f="edit",variant:k="square",size:E="large",maxPreviewWidth:I,maxPreviewHeight:S,hideBorder:w=!1,maxSizeMB:B=5,minResolution:x=256,qualityWarnResolution:Q=512,aspectRatios:M=qd,enabledVariants:b=Wd,isUploading:v=!1,loading:R=!1,disabled:L=!1,required:y=!1,enableCaptureImage:F=!1,acceptedTypes:U=Ld,enableFullImageView:D=!0,containerProps:Z}){const H=J(),{iron:K,butterflyBlue:G}=H.palette.app.color,Y="view"===f,V=vA(E),T=I??V.maxPreviewWidth,j=S??V.maxPreviewHeight,W="circle"===k?"circle":"square",z=c((()=>JA(E,W)),[E,W]),O=p(null),P=p(null),N=p(null),X=p(null),[$,ee]=h(!1),[te,ie]=h(!1),[oe,re]=h(d??C),[ne,le]=h(null),[ae,se]=h(!1),[Ce,de]=h(!1),[Ae,ce]=h(null),[he,pe]=h(null),[ue,ge]=h(!1),[me,fe]=h(!1),[ke,Ee]=h((()=>LA(k,E))),{inputRef:Ie,setInputRef:Se,maintainFocusAfterClose:we}=ir({isOpen:ue||Ce});u((()=>{void 0!==d&&re(d)}),[d]),u((()=>{if(!Y)return void Ee(z);if("auto"!==k)return void Ee(LA(k,E));if(!oe)return void Ee(LA("square",E));let e=!1;return yA(oe).then((({width:t,height:i})=>{e||Ee(LA("auto",E,t,i))})).catch((()=>{e||Ee(LA("square",E))})),()=>{e=!0}}),[Y,k,oe,E,z]);const Be=Y?ke:z,{displayUrl:xe,hasValidImage:Qe,handleImageError:Me}=DA({previewUrl:oe,errorImage:s,onError:l}),be=g((()=>{Nd(P.current),P.current=null}),[]);u((()=>()=>{be(),Nd(N.current),N.current=null,X.current&&clearTimeout(X.current)}),[be]);const Je=()=>{L||Ie.current?.click()},ve=()=>{!L&&F&&(fe(!1),ge(!0))},Re=()=>{X.current&&(clearTimeout(X.current),X.current=null)},Le=()=>{!L&&Qe&&F&&(Re(),fe(!0))},ye=()=>{Re(),X.current=setTimeout((()=>{fe(!1)}),160)},Fe=e=>{F?e?Le():ye():ee(e)},Ue=async e=>{if(o){le(null),se(!0),fe(!1);try{const t=await(async(e,{maxSizeMB:t=5,minResolution:i=256,qualityWarnResolution:o=512,acceptedTypes:r=Ld,showToasts:n=!0}={})=>Dd(e,r)?qo(e,t)?Od(e)?{valid:!0}:GA(e,i,o,n):KA(`File too large. Maximum size is ${t} MB.`,n):KA("Unsupported file type. Use PNG, JPG, JPEG, SVG, or WEBP.",n))(e,{maxSizeMB:B,minResolution:x,qualityWarnResolution:Q,acceptedTypes:U});if(!t.valid)return void le(t.error??"Invalid file");if(Od(e)){const t=await(async(e,t)=>{const i=URL.createObjectURL(e),o={};for(const i of t)o[i]=e;return{cropped:e,variants:o,previewUrl:i}})(e,b),{cropped:i,variants:r,previewUrl:n}=t;return be(),P.current=n,re(n),void o({original:e,cropped:i,variants:r,aspectRatio:"1:1",previewUrl:n})}const i=URL.createObjectURL(e);pe(e),ce((e=>(Nd(e),N.current=i,i))),de(!0)}finally{se(!1)}}},De=e=>{const[t]=Array.from(e);t&&Ue(t)},Ze=e=>{e?.stopPropagation(),e?.preventDefault(),be(),re(""),le(null),pe(null),fe(!1),ce((e=>(Nd(e),N.current=null,null))),r?.()};if(R)return e(HA,{size:E});if(Y)return e(ZA,{previewUrl:oe,errorImage:s,label:A,required:y,hideBorder:w,variant:k,size:E,frame:Be,maxPreviewWidth:T,maxPreviewHeight:j,onView:n,onError:l,enableFullImageView:D,containerProps:Z});const{width:He,height:Ke,borderRadius:Ge}=Be,Ye="50%"===Ge?"50%":"8px",Ve=(({enableCaptureImage:t,onEdit:i,onCapture:o,onDelete:r})=>{const n=[{key:"edit",label:"Replace logo",icon:e(ni,{}),onClick:e=>{e.stopPropagation(),i()}}];return t&&n.push({key:"capture",label:"Capture photo",icon:e(oi,{}),onClick:e=>{e.stopPropagation(),o()}}),n.push({key:"delete",label:"Remove logo",icon:e(ri,{}),onClick:e=>{r(e)}}),n})({enableCaptureImage:F,onEdit:Je,onCapture:ve,onDelete:Ze});return t(i,{children:[t(a,{direction:"row",alignItems:"center",gap:"15px",...Z,children:[t(SA,{ref:O,isDragging:te,hasImage:Qe,disabled:L,frameWidth:He,frameHeight:Ke,frameBorderRadius:Ge,tabIndex:L?-1:0,role:"button","aria-disabled":L,"aria-label":A||"Logo",onClick:()=>!L&&!Qe&&!F&&Je(),onKeyDown:e=>{L||Qe||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Je())},onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),!L&&(e=>e.dataTransfer.types.includes("Files"))(e)&&ie(!0)},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),L||(e.dataTransfer.dropEffect="copy")},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),Pd(e.currentTarget,e.relatedTarget)&&ie(!1)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),ie(!1),!L&&e.dataTransfer.files.length>0&&De(e.dataTransfer.files)},onMouseEnter:()=>!L&&Fe(!0),onFocus:()=>!L&&Fe(!0),onMouseLeave:()=>Fe(!1),onBlur:e=>{Pd(e.currentTarget,e.relatedTarget)&&Fe(!1)},children:[e("input",{ref:Se,type:"file",accept:yd,onChange:e=>{!L&&e.target.files&&(De(e.target.files),e.target.value="")},disabled:L,style:{display:"none"},"aria-hidden":!0}),!F&&e(QA,{open:$&&!!oe&&!L,size:E,disabled:L,borderRadius:Ge,onEdit:Je,onDelete:Ze,onHoverChange:ee}),(v||ae)&&e(xA,{frameBorderRadius:Ge,children:e(_,{size:"small"===E?16:22,sx:{color:K[600]}})}),te&&e(xA,{frameBorderRadius:Ge,children:e(q,{variant:"caption",color:G[900],children:"Drop"})}),Qe?e(wA,{sx:{borderRadius:Ge},children:e("img",{src:xe,alt:"Logo",onError:Me,style:{width:"100%",height:"100%",objectFit:"contain",objectPosition:"center",display:"block",borderRadius:Ye}})}):e(FA,{size:E,disabled:L,enableCaptureImage:F,onAttach:Je,onCapture:ve})]}),t(a,{gap:"5px",justifyContent:"center",children:[A&&e(Pe,{disabled:L,required:y,children:A}),m&&e(q,{noWrap:!0,variant:"caption",color:K[800],children:m}),ne&&e(q,{variant:"caption",color:"error",children:ne})]})]}),F&&Qe&&!L&&e(CA,{open:me,anchorEl:O.current,size:E,actions:Ve,onClose:()=>fe(!1),onMouseEnter:Le,onMouseLeave:ye}),Ce&&Ae&&he&&o&&e(fA,{open:Ce,imageSrc:Ae,originalFile:he,aspectRatios:M,enabledVariants:b,onClose:()=>{de(!1),we()},onApply:({cropped:e,variants:t,previewUrl:i,aspectRatio:r})=>{be(),P.current=i,re(i),le(null),de(!1),o({original:he,cropped:e,variants:t,aspectRatio:r,previewUrl:i}),Ws.success({title:"Logo cropped successfully"}),we()}}),F&&ue&&e(Md,{open:ue,isUploading:v||ae,onChange:De,onClose:()=>{ge(!1),we()}})]})}const VA=v(le,{shouldForwardProp:e=>"selected"!==e})((({theme:e,selected:t})=>({background:e.palette.app.color.iron[600],color:e.palette.app.color.mirage[900],borderRadius:"4px",border:`1px solid ${e.palette.app.color.butterflyBlue[300]}`,...t?{background:e.palette.app.color.deepAqua[500],color:e.palette.app.color.mirage[900],borderLeft:`6px solid ${e.palette.app.color.butterflyBlue[900]}`}:{}})));function TA({label:i,selected:o,actions:r,companyName:n,href:l,target:s,...d}){const A=J(),{iron:c}=A.palette.app.color,g=p(null),[m,f]=h(!1);u((()=>{const e=g.current;if(!e)return;const t=()=>f(e.scrollWidth>e.clientWidth);return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[i,n]);return e(VA,{selected:o,alignItems:"flex-start",...l?{component:C,href:l,target:s,prefetch:!1}:{},...d,children:t(a,{width:"100%",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[t(a,{gap:"5px",direction:"column",flex:1,display:"grid",children:[e(El,{toolTipLabel:i,checkOverflow:!m,children:e(q,{variant:"body2",fontWeight:500,ref:g,sx:{width:"auto",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"},children:i})}),e(q,{variant:"caption",color:c[800],children:n})]}),r]})})}const jA=new Set(["+","-","e","E","*","/","=","%","^"]),WA=/[+\-eE*/=%^]/,qA={string:"Only alphabetic characters are allowed.","string-number":"Only letters and numbers are allowed.","string-number-special":"Special characters are allowed.","string-special":"Only letters, accents, apostrophes, and hyphens are allowed.","string-special-all":"Only letters and Special characters are allowed",custom:"Please enter a valid input"};function zA({control:i,name:o,defaultValue:r,label:n="",rules:l,type:s,required:C,disabled:d,readOnly:A=!1,loading:c=!1,placeholder:h="",isCapitalize:p=!1,isTrimStartDisabled:u=!1,rows:g,characterType:m="string-number-special",letterCase:f="mixed",setError:k,containerProps:E,styling:I="custom",infoMessage:S,regexExpression:w={message:null,regex:/^[\s\S]*$/},navigationKey:B,customOnChange:x,size:Q,InputProps:M,inputProps:b,...J}){const{field:{value:v,onChange:R,onBlur:L,...y},fieldState:{error:F}}=$e({name:o,control:i,defaultValue:r,rules:l}),{navigationKey:U}=Fo(),D=B??U,{inputRef:Z,maintainFocus:H,handleKeyDown:K,handleEnterNavigation:G}=ir({navigationKey:D}),{inputHeight:Y,inputFontSize:V}=Ns(Q),T=Boolean(g??J.multiline),j=e=>{let t=e;const i=(e=>{switch(e){case"string":return/^[A-Za-z\s]*$/;case"string-number":return/^[A-Za-z0-9\s]*$/;case"string-number-special":default:return/^[\s\S]*$/;case"string-special":return/^[\p{L}’'\-\s.]+$/u;case"string-special-all":return/^[^\d]+$/;case"custom":return w.regex}})(m);return i.test(t)||(t=t.split("").filter((e=>i.test(e))).join("")),"uppercase"===f?t=t.toUpperCase():"lowercase"===f&&(t=t.toLowerCase()),t},{message:W}=w,q=W||qA[m];return c?e(_C,{label:n,multiline:T,styling:I,size:Q}):t(a,{...E,gap:"5px",children:[n&&"custom"===I&&t(a,{direction:"row",children:[e(Pe,{required:C,disabled:d,children:n}),S&&e(El,{toolTipLabel:S,children:e(Vt,{sx:{fontSize:13}})})]}),e(Ne,{disabled:d,required:C,fullWidth:!0,inputRef:Z,onKeyDown:e=>{"number"===s&&jA.has(e.key)&&e.preventDefault();!Boolean(g??J.multiline)||"Enter"!==e.key||"enter"!==D||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey?K(e,void 0,!1):G(e,!0)},onPaste:e=>{(A||"number"===s&&WA.test(e.clipboardData.getData("text")))&&e.preventDefault()},placeholder:"default"===I?h:h||n,type:s,label:"default"===I?n:void 0,sx:{...$s(I),"& .MuiInputBase-root":{...!T&&{height:`${Y}px !important`,fontSize:V}}},InputLabelProps:_s(I,Q,T),InputProps:{...M,readOnly:A||M?.readOnly},inputProps:{min:0,...b,readOnly:A||b?.readOnly},error:Boolean(F),helperText:F?.message,onChange:e=>{if(A)return;const t=e.target,{selectionStart:i,selectionEnd:r}=t;let n=e.target.value||null;"string"==typeof n&&""===n.trim()?n=null:u||"string"!=typeof n||(n=n.trimStart());const l=n&&j(n);if(n!==l&&k)return void k(o,{type:"manual",message:q});let a=l;n&&"number"===s?a=Number(n):p&&l&&(a=l?l.toUpperCase():null),R(a),x&&x(n),requestAnimationFrame((()=>{"text"==s&&t.setSelectionRange(i,r),H()}))},onBlur:()=>{if(!u&&"string"==typeof v){const e=v.trim(),t=""===e?null:e;v!==t&&R(t)}L()},value:"string"==typeof v?v.trimStart():v??"",...y,...J})]})}function OA(t){const[i,o]=h(!1);return e(zA,{type:i?"text":"password",InputProps:{startAdornment:e(Oe,{position:"start",children:e(Ii,{fontSize:"small"})}),endAdornment:e(Oe,{position:"end",children:e(r,{"aria-label":"toggle password visibility",onClick:()=>{o((e=>!e))},edge:"end",children:e(i?Si:Nt,{fontSize:"small"})})})},...t})}const PA=v(M,{shouldForwardProp:e=>"error"!==e})((({styling:e,theme:t,error:i,size:o})=>{const r={position:"relative"},{red:n,butterflyBlue:l,iron:a,slate:s,black:C}=t.palette.app.color,{fontSize:d}=Xs(o);return"custom"===e?{...r,"&.custom_phone_input":{"& .phone-input-container":{"&:focus-within":{border:`2px solid ${l[900]} !important`}},"& .phone-input-field":{padding:"8.5px 50px 8.5px 30px","&:focus":{"& ~ .flag-dropdown":{borderColor:i?n[900]:l[900]}}},"& .flag-dropdown":{"&.open":{borderColor:i?n[900]:l[900]}}}}:{"&.default_phone_input":{"& .react-tel-input":{"& .form-control":{fontSize:"16px",background:a[600],border:`1px solid ${s[100]}`,borderRadius:"5px",width:"300px",outline:"none",padding:"18.5px 14px 18.5px 58px",transition:"box-shadow ease .25s, border-color ease .25s","&:focus":{borderColor:l[900],boxShadow:`0 0 0 2px ${l[900]}`},"&.invalid-number":{border:`1px solid ${n[900]}`,"&:focus":{boxShadow:`0 0 0 2px ${n[900]}`},"&+div:before":{content:"'Error'",display:"none",color:`${n[900]}`,width:"27px"}}},"& .flag-dropdown":{position:"absolute",top:"0",bottom:"0",padding:"0",backgroundColor:a[600],borderRadius:"3px 0 0 3px","&:hover, &:focus":{cursor:"pointer"}},"& input[disabled]":{"&+.flag-dropdown":{"&:hover":{cursor:"default",borderColor:s[100],"& .selected-flag":{backgroundColor:"transparent"}}}},"& .selected-flag":{outline:"none",position:"relative",height:"100%",padding:"0 0 0 8px",borderRadius:"3px 0 0 3px","&:focus":{"& .arrow":{borderLeftWidth:"4px",borderRightWidth:"4px",borderTop:`5px solid ${l[900]}`}},"& .flag":{position:"absolute",top:"50%",marginTop:"-6px"},"& .arrow":{position:"relative",top:"50%",marginTop:"-1px",width:"0",height:"0",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderTop:"4px solid #555","&.up":{borderTop:"none",borderBottom:"4px solid #555"}}},"& .country-list":{outline:"none",zIndex:1,listStyle:"none",position:"absolute",padding:"0",margin:"10px 0 10px -1px",backgroundColor:"white",width:"300px",maxHeight:"220px",overflowY:"scroll",borderRadius:"7px","& .flag":{display:"inline-block",position:"absolute",left:"13px",top:"8px",marginRight:"7px",marginTop:"2px"},"& .divider":{paddingBottom:"5px",marginBottom:"5px",borderBottom:"1px solid #ccc"},"& .country":{position:"relative",padding:"12px 9px 13px 46px","& .dial-code":{color:"#6b6b6b"},"&:hover":{backgroundColor:"hsl(0, 0.00%, 94.50%)"},"&.highlight":{backgroundColor:s[300]}},"& .country-name":{marginRight:"6px"},"& .search":{zIndex:2,position:"sticky",top:"0",backgroundColor:"#fff",padding:"10px 0 6px 10px"},"& .search-emoji":{display:"none",fontSize:"15px"},"& .search-box":{border:`1px solid ${s[100]}`,borderRadius:"3px",fontSize:"15px",lineHeight:"15px",marginLeft:"6px",padding:"3px 8px 5px",outline:"none","&:hover":{borderColor:s[50]}},"& .no-entries-message":{padding:"7px 10px 11px",opacity:".7"}},"& .invalid-number-message":{position:"absolute",zIndex:1,fontSize:"13px",left:"25px",top:"-7px",background:"#fff",padding:"0 5px",color:n[900]},"& .special-label":{position:"absolute",zIndex:5,top:"small"===o?"-8px":"-9px",left:"0px",display:"block",color:C[900],background:a[600],opacity:"1",fontSize:`${d}px`,whiteSpace:"nowrap",lineHeight:"1.1",scale:"small"===o?.83:.85}},"&.phone-input-required .react-tel-input .special-label::after":{content:"' *'",color:n[900],fontSize:"13px",fontWeight:500}}}})),NA=({rows:i,label:o,styling:r,size:n})=>{const{inputHeight:l}=Ns(n),s=void 0===i?l:26.5*i;return t(a,{gap:"5px",children:[o&&"custom"===r&&e(Se,{width:120,height:"18.69px",sx:{transform:"scale(1)"}}),e(Se,{height:`${s}px`,sx:{transform:"scale(1)"}})]})};function XA({control:i,name:o,defaultValue:r,rules:n,label:l,disabled:s=!1,required:C,rows:d,loading:A=!1,placeholder:c="",error:g,helperText:m,navigationKey:f,styling:k="custom",size:E,autoFocus:I=!1,...S}){const w=J(),{iron:B,red:x,slate:Q}=w.palette.app.color,{navigationKey:M}=Fo(),b=f??M,{inputHeight:v,inputFontSize:R}=Ns(E),{inputProps:L,...y}=S,F={...L??{},...I&&!s?{autoFocus:!0}:{}},{field:{value:U,onChange:D,...Z}}=$e({name:o,control:i,defaultValue:r,rules:n}),[H,K]=h(!1),{setInputRef:G,maintainFocusAfterClose:Y,handleKeyDown:V}=ir({isOpen:H,navigationKey:b}),T=p(null);return u((()=>{const e=T.current;if(!e||s)return;const t=e.querySelector("input[type='tel']");t&&(G(t),Z.ref(t));const i=()=>{const t=e.querySelector(".country-list"),i=e.querySelector(".react-tel-input");if(!t)return;const o=i?.getBoundingClientRect()?.width,r=e.querySelector(".flag-dropdown")?.getBoundingClientRect();r&&(t.style.position="fixed",t.style.top=`${r.bottom}px`,t.style.left=`${r.left}px`,t.style.zIndex="99999",t.style.maxHeight="200px",t.style.overflowY="auto",t.style.width=`${o}px`)},o=()=>{i()};window.addEventListener("resize",o),window.addEventListener("scroll",o,!0);const r=()=>{const t=e.querySelector(".selected-flag");t&&(t.setAttribute("tabindex","-1"),t.addEventListener("focus",(()=>{t.blur()})));const o=!!e.querySelector(".flag-dropdown.open");K(o),o&&(i(),setTimeout((()=>{const t=e.querySelector(".country-list .search-box input");t&&t.focus()}),0))},n=new MutationObserver((e=>{r();e.some((({addedNodes:e})=>!e.length))&&i()}));n.observe(e,{attributes:!0,attributeFilter:["class"],subtree:!0,childList:!0});const l=e=>{const t=e.target;(t.closest(".flag-dropdown")||t.closest(".country-list"))&&setTimeout(r,0)},a=e=>{const t=e.target;t.closest(".flag-dropdown")||t.closest(".country-list")||setTimeout(r,0)};return e.addEventListener("click",l),document.addEventListener("click",a),r(),()=>{window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0),n.disconnect(),e.removeEventListener("click",l),document.removeEventListener("click",a)}}),[G,Z,s]),A?e(NA,{label:l,rows:d,styling:k,size:E}):t(a,{gap:"4px",children:[t(a,{gap:"5px",children:[l&&"custom"===k&&e(Pe,{required:C,disabled:s,children:l}),e(PA,{ref:T,styling:k,error:g,size:E,className:`${"custom"===k?"custom_phone_input":"default_phone_input"}${C?" phone-input-required":""}`,children:e(wi,{country:"in",enableSearch:!0,disabled:s,specialLabel:l??"",placeholder:c||l,onChange:e=>{D(e)},value:String(U),onBlur:()=>{Z.onBlur(),H||Y()},onKeyDown:e=>{H||V(e,void 0,!1)},containerStyle:{width:"100%",height:`${v}px`,border:g?`1px solid ${x[900]}`:s?`1px solid ${B[700]}`:`1px solid ${B[800]}`,borderRadius:"4px",transition:"all 0.2s ease"},inputStyle:{width:"100%",padding:"8.5px 40px",fontSize:R,height:`${v}px`,border:"none",outline:"none",transition:"all 0.2s ease",color:s?B[100]:Q[900]},containerClass:"phone-input-container",inputClass:"phone-input-field",buttonStyle:{border:"none"},...y,inputProps:F})})]}),g&&e(q,{variant:"caption",sx:{color:"red",whiteSpace:"pre",textWrap:"wrap"},children:m})]})}const _A=e=>"medium"===e?26:20,$A=({isHorizontal:i,direction:o,optionsLength:r,size:n})=>{const l=_A(n);return t(a,{gap:"10px",direction:i?"row":"column",alignItems:i&&"row"===o?"center":void 0,children:[e(Se,{height:"18.69px",width:"70px",sx:{transform:"scale(1)"}}),e(a,{direction:o,gap:"column"===o?"5px":"10px",children:Array.from({length:r}).map((()=>t(a,{gap:"10px",direction:"row",alignItems:"center",children:[e(Se,{variant:"circular",height:l,width:l}),e(Se,{height:"21px",width:"100px",sx:{transform:"scale(1)"}})]},ti())))})]})};function ec({name:i,rules:o,label:r,control:n,options:l,defaultValue:s,size:C="small",color:d="secondary",loading:A=!1,required:c=!1,direction:h="row",sx:u={},containerProps:g,isHorizontal:m=!1,navigationKey:f,customOnChange:k,...E}){const{field:{value:I,onChange:S,ref:w,...B}}=$e({name:i,control:n,defaultValue:s,rules:o}),{navigationKey:x}=Fo(),Q=f??x,{inputRef:b,handleKeyDown:J,maintainFocus:v}=ir({navigationKey:Q}),R=p(null);return A?e($A,{isHorizontal:m,direction:h,optionsLength:l.length,size:C}):t(a,{direction:m?"row":"column",alignItems:m?"center":void 0,gap:m?1:"5px",children:[r&&e(Pe,{sx:{whiteSpace:"normal",overflow:"visible",textOverflow:"unset"},required:c,disabled:E.disabled,children:r}),e(Qi,{name:i,value:I,onKeyDown:e=>{J(e,void 0,!1)},onChange:(e,t)=>{let i;if("true"===t?(i=!0,S(!0)):"false"===t?(i=!1,S(!1)):(i=t,S(t)),k){const e=l.find((({values:e})=>e===i));e&&k(e)}const o=e.target;o?b.current=o:!b.current&&R.current&&(b.current=R.current),v()},children:e(a,{gap:"column"===h?"5px":"10px",direction:h,...g,children:l?.map((({label:t,values:i,disabled:o},r)=>e(M,{children:e(Bi,{value:i,control:e(xi,{...B,...E,color:d,size:C,inputRef:e=>{if(!e)return;I===i||!b.current&&0===r?(b.current=e,R.current=e):R.current||0!==r||(R.current=e),w&&("function"==typeof w?w(e):w.current=e)},sx:{"& .MuiSvgIcon-root":{fontSize:_A(C)}}}),disabled:o,label:t,sx:u})},r)))})})]})}const tc={small:17,medium:22,large:28},ic=({label:i,size:o="medium",direction:r="row",max:n=5})=>{const l=tc[o],s=Array.from({length:n},((e,t)=>`star-${t+1}`));return t(a,{gap:"5px",direction:r,alignItems:"row"===r?"center":"flex-start",children:[i&&e(Se,{width:120,height:"18.69px",sx:{transform:"scale(1)"}}),e(a,{gap:"2px",direction:"row",children:s.map((t=>e(Se,{variant:"rectangular",width:l,height:l,sx:{borderRadius:"5px"}},t)))})]})};function oc({control:o,name:r,defaultValue:n,label:l="",rules:s,disabled:C,loading:d=!1,direction:A="column",required:c=!1,navigationKey:h,size:p,max:u,containerSx:g,...m}){const{field:{value:f,onChange:k,...E},fieldState:{error:I}}=$e({name:r,control:o,defaultValue:n,rules:s}),{navigationKey:S}=Fo(),w=h??S,{maintainFocus:B,handleKeyDown:x}=ir({navigationKey:w});return d?e(ic,{label:l,size:p,direction:A,max:u}):t(i,{children:[t(a,{gap:"5px",direction:A,alignItems:"row"===A?"center":"flex-start",sx:g,children:[l&&e(Pe,{required:c,disabled:C,children:l}),e("div",{onKeyDown:e=>{x(e,void 0,!1)},children:e(bi,{disabled:C,value:f??null,onChange:(e,t)=>{k(t),B()},size:p,max:u,...E,...m})})]}),I&&e(Mi,{error:!0,children:I?.message})]})}function rc(t){return e(zA,{placeholder:"Search",InputProps:{startAdornment:e(Oe,{position:"start",children:e(Ji,{fontSize:"small"})})},...t,containerProps:{width:{sm:"auto",xs:"100%"},...t.containerProps}})}const nc=({top:t="0px",paperSx:i,boxSx:o,...r})=>e(se,{variant:"outlined",sx:{position:"sticky",top:t,zIndex:100,...i},children:e(Kl,{padding:{padding:"5px"},children:e(M,{sx:{display:"flex",justifyContent:"flex-end",...o},children:e(rc,{...r})})})}),lc=v(Fi)((({theme:e,disabled:t})=>{const{lightBlue:i,iron:o}=e.palette.app.color;return{"& .MuiInputBase-root":{backgroundColor:t?y(i[100],.3):o[600]},"& .MuiSelect-select":{display:"flex",alignItems:"center",gap:"8px",flexWrap:"nowrap",overflow:"hidden"},"& .MuiList-root":{maxHeight:300,overflowY:"auto","&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{backgroundColor:i[100]}}}})),ac=v(q)((({theme:e})=>{const{butterflyBlue:t}=e.palette.app.color;return{position:"sticky",top:0,padding:"8px 16px",fontSize:"13px",fontWeight:600,color:t[900],backgroundColor:t[500],zIndex:1}}));function sc({control:o,defaultValue:n,name:s,required:C=!1,label:d,multiple:A=!1,disabled:u=!1,options:m=[],rules:f,loading:k=!1,helperText:E,error:I,placeholder:S="",isShowSelectAll:w=!0,isShowAvatar:B=!1,onAction:x,renderOption:Q,maxLimit:v,maxDisplayItems:R=2,disableClearable:L=!!C,setOnFinalChange:y=!1,styling:F="custom",navigationKey:U,...D}){const{field:{onChange:Z,value:H,...K}}=$e({name:s,control:o,defaultValue:n,rules:f}),{navigationKey:G}=Fo(),Y=U??G,{t:V}=ot(),T=J(),{slate:j,iron:W}=T.palette.app.color,z=u?W[900]:"revert-layer",[O,P]=h(null),N=p(!1),[X,_]=h(!1),{setInputRef:ee,maintainFocusAfterClose:te,handleKeyDown:ie,handleEnterNavigation:oe}=ir({isOpen:X,navigationKey:Y}),re=c((()=>{if(!A||!w||!Array.isArray(H))return!1;const e=m.filter((e=>!e.disabled));return H.length===e.length}),[A,w,m,H]),ne=c((()=>{if(!A||!Array.isArray(H))return[];const e=new Set(H);return m.filter((t=>e.has(t.value)))}),[A,m,H]),le=c((()=>{const e={};return m.forEach((t=>{const i=t.heading??"";e[i]||(e[i]=[]),e[i].push(t)})),e}),[m]),ae=c((()=>!L&&(!!H&&(Array.isArray(H)?H.length>0:""!==H))),[H,L]),se=g((e=>{e.stopPropagation(),Z(A?[]:"")}),[A,Z]),Ce=g((e=>{"enter"===Y&&"Enter"===e.key&&(e.stopPropagation(),oe(e))}),[Y,oe]),de=g((()=>t(a,{direction:"row",alignItems:"center",gap:"5px",children:[ae&&!X&&e(r,{size:"small",onClick:se,onKeyDown:Ce,children:e(Li,{sx:{fontSize:"14px"}})}),e(r,{size:"small",onClick:e=>{e.stopPropagation(),_((e=>!e))},onKeyDown:e=>{"Enter"===e.key&&(e.stopPropagation(),_((e=>!e)))},children:e(yi,{fontSize:"small",sx:{transform:X?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out"}})})]})),[ae,se,Ce,X,_]);if(k)return t(a,{gap:"10px",children:[d&&"custom"===F&&e(Se,{width:120,height:"18.69px",sx:{transform:"scale(1)"}}),e(Se,{height:"35.69px",sx:{transform:"scale(1)"}})]});const Ae=()=>y&&N.current?O:H;return t(a,{gap:"5px",children:[d&&"custom"===F&&e(Pe,{required:C,disabled:u,children:d}),t(a,{direction:"row",justifyContent:"space-between",gap:"10px",alignItems:"start",children:[t(lc,{fullWidth:!0,error:I,disabled:u,required:C,sx:"default"===F?{...eC(F),"& .MuiOutlinedInput-notchedOutline":{"& legend":{maxWidth:0,"& span":{padding:"0 5px"}}},"& .MuiInputLabel-root.MuiInputLabel-shrink + .MuiInputBase-root .MuiOutlinedInput-notchedOutline legend":{maxWidth:"100%"}}:void 0,children:[d&&"default"===F&&e(Pe,{id:`${s}-label`,sx:tC(F),children:d}),e(Ri,{...K,...D,multiple:A,value:Ae()??(A?[]:""),label:"default"===F?d:void 0,labelId:"default"===F&&d?`${s}-label`:void 0,inputProps:{"aria-label":"custom"===F&&d?d:void 0},onChange:e=>{const t=e.target.value;if(y)N.current=!0,A&&Array.isArray(t)&&t.includes("select-all")?P(Array.isArray(O)&&O.length===m.filter((({disabled:e})=>!e)).length?[]:m.filter((({disabled:e})=>!e)).map((({value:e})=>e))):P(t);else{if(A&&Array.isArray(t)){if(t.includes("select-all"))return void(e=>{if(e){const e=m.filter((e=>!e.disabled)).map((e=>e.value));Z(e)}else Z([])})(!re);if(v&&t.length>v)return void Ws.error({title:V("common.select.limitExceed",{maxLimit:v})})}Z(t)}},open:X,onOpen:()=>{_(!0)},onClose:()=>{_(!1),te(),y&&N.current&&(Z(O),N.current=!1,P(null))},inputRef:e=>ee(e),onKeyDown:e=>{ie(e,(()=>{_(!1)}),X)},renderValue:D.renderValue??(i=>{if(!A){const o=m.find((e=>e.value===i)),r=()=>o?o.label:"default"===F&&d?"":S;return t(M,{sx:{display:"flex",alignItems:"center",gap:1},children:[B&&o?.avatar&&e(we,{src:o.avatar??"",sx:{width:20,height:20}}),e(q,{variant:"body2",color:z,sx:{WebkitTextFillColor:z},noWrap:!0,children:r()})]})}if(!Array.isArray(i)||0===i.length){return e(q,{sx:{WebkitTextFillColor:z},color:z,variant:"body2",noWrap:!0,children:"default"!==F||!d||S?S:""})}const o=ne.slice(0,R),r=ne.length-R;return t(M,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[o.map((t=>e(q,{variant:"body2",noWrap:!0,color:z,sx:{WebkitTextFillColor:z,backgroundColor:j[800],padding:"2px 5px",borderRadius:"12px",fontSize:"12px",maxWidth:"120px"},children:t.label},t.value))),r>0&&t(q,{variant:"body2",color:z,sx:{WebkitTextFillColor:z,backgroundColor:j[300],padding:"2px 5px",borderRadius:"12px",fontSize:"12px",fontWeight:500},children:["+",r]})]})}),IconComponent:de,displayEmpty:!0,MenuProps:{PaperProps:{sx:{width:"inherit",maxHeight:300,"& .MuiList-root":{paddingTop:0,paddingBottom:0}}},MenuListProps:{...D.MenuProps?.MenuListProps,variant:"menu"}},children:Object.entries(le).length?(()=>{const o=[],r=Ae(),n=A&&Array.isArray(r)?new Set(r):new Set;return A&&w&&m.length>0&&(o.push(t(l,{value:"select-all",children:[e(b,{icon:e(Os,{size:"small"}),checkedIcon:e(Ps,{size:"small"}),indeterminate:Array.isArray(r)&&r.length>0&&r.length<m.filter((({disabled:e})=>!e)).length,checked:Array.isArray(r)&&r.length===m.filter((e=>!e.disabled)).length,sx:{marginRight:1}}),e(vi,{primary:"Select All"})]},"select-all")),o.push(e($,{sx:{margin:"0px !important"}},"divider-select-all"))),Object.entries(le).forEach((([a,s])=>{a&&o.push(e(ac,{children:a},`group-${a}`)),s.forEach((a=>{const s=A?n.has(a.value):r===a.value;o.push(e(l,{value:a.value,disabled:a.disabled,children:Q?Q(a,s):t(i,{children:[A&&e(b,{icon:e(Os,{size:"small"}),checkedIcon:e(Ps,{size:"small"}),checked:s,sx:{marginRight:1}}),t(M,{sx:{display:"flex",alignItems:"center",gap:1},children:[B&&a.avatar&&e(we,{src:a.avatar,alt:a.label,sx:{width:24,height:24}}),e(vi,{primary:a.label})]})]})},a.value))}))})),o})():e(l,{disabled:!0,children:e(vi,{primary:"No options"})})}),E&&e(Mi,{children:E})]}),x&&e(bl,{disabled:u,onClick:x})]})]})}const Cc=()=>e(Se,{width:50,height:18,sx:{borderRadius:"10px"},variant:"rectangular"});function dc({name:t,rules:i,control:o,defaultValue:r,loading:n=!1,navigationKey:l,...a}){const s=J(),{butterflyBlue:C,iron:d}=s.palette.app.color,{field:{value:A=!1,...c}}=$e({name:t,control:o,defaultValue:r,rules:i}),{navigationKey:h}=Fo(),p=l??h,{setInputRef:u,maintainFocus:g,handleKeyDown:m}=ir({navigationKey:p});if(n)return e(Cc,{});return e(Ui,{checked:A,...c,...a,inputRef:u,onKeyDown:e=>{m(e,void 0,!1),a.onKeyDown&&a.onKeyDown(e)},onChange:e=>{c.onChange(e),g()},sx:{padding:1,"& .MuiSwitch-track":{borderRadius:11,backgroundColor:d[900],position:"relative","&::before":{content:"unset",position:"absolute",top:"50%",transform:"translateY(-50%)",width:16,height:16,left:12},[Di.input]:{width:"80px !important"},"&::after":{content:"unset",position:"absolute",top:"50%",transform:"translateY(-50%)",width:16,height:16,right:12}},"& .MuiSwitch-thumb":{boxShadow:"none",width:16,height:16,margin:.15,color:"white"},"& .Mui-checked + .MuiSwitch-track":{backgroundColor:`${C[900]} !important`,opacity:"1 !important"}}})}const Ac=({label:i,styling:o,size:r})=>t(a,{gap:"5px",flex:1,children:[i&&"custom"===o&&e(Se,{width:120,height:"18.69px",sx:{transform:"scale(1)"}}),e(Se,{height:`${Ns(r).inputHeight}px`,width:"100%",sx:{transform:"scale(1)"}})]});function cc({control:i,defaultValue:o,disabled:r=!1,label:n,name:l,error:s,helperText:C,loading:d=!1,required:A=!1,rules:c,format:h="HH:mm",isReturnLocalTime:p=!1,isReturnDateWithTime:u=!1,styling:g="custom",navigationKey:m,size:f,...k}){const{field:{value:E,onChange:I,...S}}=$e({name:l,control:i,defaultValue:o,rules:c}),{navigationKey:w}=Fo(),B=m??w,{inputRef:x,maintainFocus:Q,handleKeyDown:M}=ir({navigationKey:B}),{inputHeight:b,inputFontSize:v}=Ns(f),R=J(),{butterflyBlue:L}=R.palette.app.color;s&&E&&"object"==typeof E&&(C="Invalid time");const y=E?U.fromISO(E):null;return d?e(Ac,{label:n,styling:g,size:f}):t(a,{gap:"5px",children:[n&&"custom"===g&&e(Pe,{required:A,disabled:r,children:n}),e(Zi,{...S,...k,disabled:r,value:y,onChange:e=>{if(e?.isValid){if(p)return I(e.toFormat(h)),void Q();if(u)return I(e.toUTC().toISO()),void Q();I(e.toUTC().toISOTime()),Q()}else I(e),Q()},slotProps:{textField:{disabled:r,helperText:C,error:s,label:"default"===g?n:void 0,required:"default"===g?A:void 0,inputRef:x,InputLabelProps:_s(g,f),onKeyDown:e=>{M(e,void 0,!1)},sx:{...$s(g),width:"100%","& .MuiInputBase-root":{fontSize:v,height:b},backgroundColor:"white","& .Mui-selected":{backgroundColor:L[900],borderRadius:"5px"}}}},format:h,helperText:C,sx:{backgroundColor:"white","& .Mui-selected":{backgroundColor:L[900],borderRadius:"5px"},"& .MuiOutlinedInput-input":{fontSize:v}}})]})}const hc=({label:i,styling:o,size:r})=>{const{inputHeight:n}=Ns(r);return t(a,{gap:"5px",flex:1,children:[i&&"custom"===o&&e(Se,{width:120,height:"18.69px",sx:{transform:"scale(1)"}}),e(Se,{height:`${n}px`,width:"100%",sx:{transform:"scale(1)"}})]})};function pc({control:i,defaultValue:o,disabled:r=!1,label:n,readOnly:l=!1,name:s,error:C=!1,helperText:d,loading:A=!1,required:c=!1,rules:p,format:u="HH:mm",isReturnLocalTime:g=!1,isReturnDateWithTime:m=!1,timeStepsMinutes:f=1,helperIcon:k,toolTipText:E,containerProps:I,styling:S="custom",navigationKey:w,size:B,...x}){const{field:{value:Q,onChange:M,...b}}=$e({name:s,control:i,defaultValue:o,rules:p}),[v,R]=h(!1),{navigationKey:L}=Fo(),y=w??L,{setInputRef:F,maintainFocus:D,maintainFocusAfterClose:Z,handleKeyDown:H,handleEnterNavigation:K}=ir({isOpen:v,navigationKey:y}),{inputHeight:G,inputFontSize:Y}=Ns(B);C&&Q&&"object"==typeof Q&&(d="Invalid time");const V=J(),{butterflyBlue:T}=V.palette.app.color,j=Q?U.fromISO(Q):null;return A?e(hc,{label:n,styling:S,size:B}):t(a,{gap:"5px",...I,children:[n&&"custom"===S&&t(a,{alignItems:"center",flexDirection:"row",gap:"5px",children:[e(Pe,{required:c,disabled:r,children:n}),k&&E&&e(W,{title:E,placement:"bottom",children:k})]}),e(Hi,{...b,...x,disabled:r,readOnly:l,open:v,ampm:!1,value:j,format:u,onOpen:()=>R(!0),onClose:()=>{R(!1),Z()},timeSteps:{minutes:f},slotProps:{textField:{disabled:r,helperText:d,error:C,label:"default"===S?n:void 0,required:"default"===S?c:void 0,inputRef:F,InputLabelProps:_s(S,B),sx:{...$s(S),width:"100%","& .MuiInputBase-root":{fontSize:Y,height:G},backgroundColor:"white","& .Mui-selected":{backgroundColor:T[900],borderRadius:"5px"},"& .MuiOutlinedInput-input":{fontSize:Y}},onKeyDown:e=>{if("enter"===y){if(" "===e.key&&!v&&!r&&!l)return e.preventDefault(),e.stopPropagation(),void R(!0);if("Enter"===e.key&&!v)return e.preventDefault(),e.stopPropagation(),void K(e);if("Enter"===e.key&&v)return e.preventDefault(),e.stopPropagation(),R(!1),Z(),void requestAnimationFrame((()=>{K(e)}))}H(e,(()=>R(!1)),v)}},openPickerButton:{..."enter"===y?{onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),K(e))}}:{}},popper:{sx:{"& .MuiMultiSectionDigitalClockSection-root::after":{display:"unset"},"& .MuiList-padding":{padding:"10px"},"& .MuiMultiSectionDigitalClockSection-item":{padding:"4px"},"& .MuiMultiSectionDigitalClockSection-item.Mui-selected":{backgroundColor:T[900],borderRadius:"5px"},"& .MuiMultiSectionDigitalClockSection-item.Mui-selected:hover":{backgroundColor:T[900],borderRadius:"5px"},"& .Mui-selected:hover":{backgroundColor:T[900],borderRadius:"5px"},"& .MuiMultiSectionDigitalClockSection-item.Mui-selected:focus-visible":{backgroundColor:T[900],borderRadius:"5px"},"& .Mui-selected:focus-visible":{backgroundColor:T[900],borderRadius:"5px"}},onKeyDown:e=>{"enter"===y&&"Enter"===e.key&&v&&(e.preventDefault(),e.stopPropagation(),R(!1),Z(),requestAnimationFrame((()=>{K(e)})))}}},onChange:e=>{if(e?.isValid){if(g)return M(e.toFormat(u)),void D();if(m)return M(e.toUTC().toISO()),void D();M(e.toUTC().toISOTime()),D()}else M(e),D()}})]})}function uc({field:i,control:o,index:r}){const n=J(),{iron:l}=n.palette.app.color;return e(a,{direction:"row",component:"li",children:t(a,{direction:"row",alignItems:"center",border:"1px solid",flexGrow:1,borderColor:l[700],children:[e(Kl,{padding:{paddingLeft:"24px"},children:e(q,{sx:{flexGrow:1},children:i.headerName})}),e(dc,{control:o,name:`columns.${r}.hide`})]})})}function gc({column:i}){const o=J(),{lightBlue:r,iron:n}=o.palette.app.color;return e(a,{border:"1px solid",bgcolor:r[100],borderColor:n[700],children:e(Kl,{padding:{padding:"0px 24px"},children:t(a,{direction:"row",alignItems:"center",justifyContent:"space-between",minHeight:"38px",children:[e(q,{children:i.headerName}),e(Ki,{htmlColor:n[800]})]})})})}function mc({lockedColumns:o,fields:r,control:n}){return t(i,{children:[o.map((({field:t="fid",colId:i="cid",headerName:o})=>e(gc,{column:{field:t,colId:i,headerName:o}},t??i))),e(a,{component:"ul",sx:{m:0,p:0},children:r.map(((t,i)=>e(uc,{field:t,control:n,index:i},t.id)))})]})}function fc({columns:t,children:i}){const o=c((()=>t.filter((e=>!("hide"in e)))),[t]),r=c((()=>t.filter((e=>"hide"in e)).map((e=>({...e,hide:!e.hide})))),[t]),n=p(r),{control:l,reset:a,getValues:s,setValue:C}=et({defaultValues:{columns:n.current}}),{fields:d}=tt({name:"columns",control:l});return c((()=>{C("columns",r)}),[t]),i({reset:e=>{a({columns:e?Array.isArray(e)?e:[e]:n.current})},getValues:s,columnList:e(mc,{fields:d,lockedColumns:o,control:l})})}function kc({columns:i,open:o,onClose:r,onSave:n,title:l="Column Chooser"}){const a=(e=>c((()=>e.filter((({field:e,colId:t})=>!!e||!!t)).map((({field:e,hide:t,headerName:i,colId:o})=>{const r={field:e??o,headerName:i};return null!=t&&(r.hide=t),r}))),[e]))(i);return e(fc,{columns:a,children:({columnList:i,reset:a,getValues:s})=>e(AC,{title:l,open:o,onClose:()=>{r(),a()},maxWidth:"xs",actions:t(wC,{sx:{justifyContent:"space-between",flex:1},children:[e(vr,{variant:"outlined",onClick:()=>a(),children:"Reset"}),e(vr,{onClick:()=>{const e=s(),t=Gi(e.columns.map((({field:e,colId:t,hide:i})=>[e??t,i])));n(t),r()},children:"Apply"})]}),children:i})})}const Ec=()=>e(Vi,{className:"bullet-hover",sx:{fontSize:"6px",borderRadius:"50%"}}),Ic=({href:t="/",style:i,scroll:o=!1,...r})=>{const n=ji(),l=Wi(),a=lr(t),{pathname:s,query:d}=a,A=c((()=>{if("string"!=typeof t)return{pathname:t??"/",query:void 0};if(n!==s)return a;const e=Array.from(l.entries()),i={...e.length?Object.fromEntries(e):void 0,...d};return{pathname:s,query:Object.keys(i).length?i:void 0}}),[n,l,t,s,d]);return e(C,{...r,prefetch:!1,scroll:o,style:{textDecoration:"none",outline:"none",...i},href:A})},Sc=({selected:i=!1,icon:o=e(Ec,{}),title:r,endAdornment:n,sx:l,href:s,onClick:C,isShowEndAdornment:d=!1,preventRedirection:A=!1,onPreventRedirection:c,onMenuClick:h,...p})=>{const u=J(),{isMobile:g}=or(),{butterflyBlue:m,iron:f}=u.palette.app.color;return t(Ti,{...p,...d?{}:s?{component:Ic,href:s}:{},onClick:e=>{h&&h(),(!s||d||A)&&(c?.(),C(),e.preventDefault())},sx:{padding:"9.5px 16px",...l,margin:"0",cursor:g||!d?"pointer":"default",userSelect:"none",textDecoration:"none",fontSize:"13px",wordBreak:"break-word",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",flex:1,width:"100%",color:i?f[600]:u.palette.primary.light,":hover":{color:f[600],".bullet-hover":{color:i?"":m[900]}}},children:[t(a,{alignItems:"center",direction:"row",flex:1,gap:"10px",justifyContent:"center",children:[o,r&&e(vi,{primary:r,disableTypography:!0,sx:{...l,marginTop:"6px",padding:"0",textAlign:"left"}})]}),n]})},wc=({icon:t=e(Ec,{}),title:i,isShowEndAdornment:o=!1,selected:r=!1,onMouseEnter:n,href:l,onClick:a,onPreventRedirection:s,preventRedirection:C,onMenuClick:d})=>{const A=J(),{butterflyBlue:c,slate:h}=A.palette.app.color;return e(M,{component:"li",sx:{bgcolor:r&&!o?c[900]:"",padding:i?"0px":"2.5px 0",wordBreak:"break-word"},children:e(Sc,{onClick:a,preventRedirection:C,onPreventRedirection:s,sx:{fontSize:"13px",padding:"9.5px 16px",":focus-visible":{border:`1px solid ${c[900]}`,backgroundColor:h[900]},margin:"0"},selected:r,title:i,icon:t,onMenuClick:d,onMouseEnter:n,href:l,isShowEndAdornment:o,endAdornment:o&&e(Bt,{sx:{fontSize:"16px"}})})})},Bc=({currentPathMenuOpen:o,currentMenuItem:r,onCloseMenuPopover:n,preventRedirection:l=!1,onPreventRedirection:a,onMenuClick:s})=>{const[C,d]=h([]);if(u((()=>{if(!r)return void d([]);const{title:e,key:t,menuItems:i}=r;d([{title:e,items:i??[],parentPath:`/${t}`,currentPathMenuOpen:o[t]??{}}])}),[r,o]),!r)return e(i,{children:"Loading..."});const A=C[C.length-1];if(!A)return null;const c=C.length>1;return t(Yi,{disablePadding:!0,children:[c&&e(wc,{title:A.title,icon:e(wt,{sx:{fontSize:"16px"}}),onClick:()=>{d((e=>e.slice(0,-1)))},onPreventRedirection:a,preventRedirection:l,selected:!1}),A.items.filter((({isView:e})=>!1!==e)).map((t=>{const i=Boolean(t.menuItems?.length),{title:o,icon:r,key:C}=t,c=Boolean(A.currentPathMenuOpen[C]),h=`${A.parentPath}/${C}`;return e(wc,{onClick:()=>{i?(e=>{const{title:t,menuItems:i,key:o}=e;d((e=>{const r=e[e.length-1];return r?[...e,{title:t,items:i??[],parentPath:`${r.parentPath}/${o}`,currentPathMenuOpen:r.currentPathMenuOpen[o]??{}}]:e}))})(t):((e,t="_self")=>{const{key:i,onClick:o}=e,r=`${A.parentPath}/${i}`;o&&(o(r,t),"_blank"!==t&&n())})(t)},onPreventRedirection:a,preventRedirection:l,title:o,icon:r,onMenuClick:i?void 0:s,isShowEndAdornment:i,selected:c,href:i?void 0:h},C)}))]})},xc=({open:t,anchorEl:i,children:o})=>{const r=J(),{mirage:n}=r.palette.app.color,l=p(null),[a,s]=h(null),C=g((()=>{const e=l.current;if(!i||!e||i instanceof Element&&!i.isConnected)return;const t=((e,t)=>{const{top:i,left:o,right:r}=e.getBoundingClientRect(),{offsetHeight:n,offsetWidth:l}=t,a=l||203,{innerHeight:s,innerWidth:C}=window,d=n<=s-i-8?i:s-n-8;return{top:Math.max(8,Math.min(d,s-8)),left:a<=C-r-8?r:Math.max(8,o-a)}})(i,e);s((e=>{const{top:i,left:o}=t;return e?.top===i&&e?.left===o?e:t}))}),[i]),d=g((e=>{l.current=e,e&&C()}),[C]);if(E((()=>{if(!t||!i)return void s(null);C();const e=window.requestAnimationFrame((()=>{C()}));window.addEventListener("resize",C),window.addEventListener("scroll",C,!0);const o=l.current,r="undefined"!=typeof ResizeObserver&&o?new ResizeObserver((()=>C())):null;return o&&r&&r.observe(o),()=>{window.cancelAnimationFrame(e),window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0),r?.disconnect()}}),[t,i,C,o]),!t)return null;const{top:A=0,left:c=0}=a??{};return e(qi,{children:e(M,{ref:d,role:"presentation",style:{position:"fixed",top:A,left:c,width:203,zIndex:1300,visibility:a?"visible":"hidden",pointerEvents:a?"auto":"none"},sx:{background:n[900]},children:o})})},Qc=({item:i,parentPath:o,currentPathMenuOpen:r,onCloseMenuPopover:n,onPreventRedirection:l,preventRedirection:a,onMenuClick:s})=>{const[C,d]=h(null),A=Boolean(C),{key:c,title:p,icon:u,menuItems:g,onClick:m,isView:f}=i;if(!1===f)return;const k=()=>{d(null)},E=Boolean(r[c]),I=`${o}/${c}`;return t(M,{onMouseLeave:k,children:[e(wc,{onClick:(e="_self")=>{m&&(m(`${o}/${c}`,e),"_blank"!==e&&(k(),n()))},onPreventRedirection:l,preventRedirection:a,title:p,icon:u,onMenuClick:s,isShowEndAdornment:Boolean(g?.length),selected:E,onMouseEnter:e=>{g?.length&&d(e.currentTarget)},href:I}),g?.length&&A&&e(xc,{open:!0,anchorEl:C,children:e(Yi,{disablePadding:!0,children:g.map((t=>e(Qc,{item:t,parentPath:I,currentPathMenuOpen:r[c]??{},onCloseMenuPopover:n,preventRedirection:a,onPreventRedirection:l,onMenuClick:s},t.key)))})})]})},Mc=t=>{const{isMobile:o}=or();if(o)return e(Bc,{...t});const{currentPathMenuOpen:r,currentMenuItem:n,onCloseMenuPopover:l,preventRedirection:a=!1,onPreventRedirection:s,onMenuClick:C}=t;return n?e(Yi,{disablePadding:!0,children:n.menuItems?.filter((({isView:e})=>!1!==e)).map((t=>e(Qc,{item:t,onMenuClick:C,parentPath:`/${n.key}`,currentPathMenuOpen:r[n.key]??{},onCloseMenuPopover:l,preventRedirection:a,onPreventRedirection:s},t.key)))}):e(i,{children:"Loading..."})},bc=({menuItems:o,currentPathname:r,anchorEl:n,setAnchorEl:l,preventRedirection:a=!1,onPreventRedirection:s,onMenuClick:C})=>{const[d,A]=h(),[p,u]=h({});c((()=>{const e=Mr(r);if(N(e))return u({home:!0});u(e)}),[r]);const g=()=>{l(null)};return t(i,{children:[o.filter((({isView:e})=>!1!==e)).map((t=>{const{onClick:i,key:o,icon:r,menuItems:n=[]}=t,d=""===o?"/":`/${o}`,c=!!p?.[o];return e(wc,{onClick:e=>{if(i){if(""===o)return void i("/",e);i(`/${o}`,e)}},onMenuClick:C,onMouseEnter:e=>{n?.length?(l(e.currentTarget),A(t)):g()},href:n.length?void 0:d,icon:r,onPreventRedirection:s,preventRedirection:a,selected:c},o)})),!!n&&e(M,{onMouseLeave:g,children:e(xc,{open:!0,anchorEl:n,children:e(Mc,{currentMenuItem:d,currentPathMenuOpen:p,onCloseMenuPopover:g,preventRedirection:a,onPreventRedirection:s,onMenuClick:C})})})]})};v(M)((({theme:e})=>({width:7,height:7,borderRadius:"50%",background:e.palette.app.color.butterflyBlue[400]})));const Jc=v(zi,{shouldForwardProp:e=>"open"!==e})((({theme:e,open:t})=>{const i=e=>({width:300,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden",backgroundColor:e.palette.app.color.mirage[900],[e.breakpoints.down("md")]:{width:"80px"}}),o=e=>({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"0px",[e.breakpoints.up("md")]:{width:"80px"},backgroundColor:e.palette.app.color.mirage[900]});return{width:300,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",...t&&{...i(e),"& .MuiDrawer-paper":i(e)},...!t&&{...o(e),"& .MuiDrawer-paper":o(e)}}})),vc=({children:t,...i})=>e(Oi,{timeout:"auto",unmountOnExit:!0,...i,children:t}),Rc=({icon:t=e(Ec,{}),title:i,isShowEndAdornment:o=!1,selected:r=!1,onClick:n,isExpanded:l,sx:a,preventRedirection:s=!1,href:C,onPreventRedirection:d,onMenuClick:A})=>{const c=J(),{butterflyBlue:h}=c.palette.app.color;return e(M,{sx:{bgcolor:r&&!o?h[900]:""},children:e(Sc,{sx:a,title:i,icon:t,href:C,onClick:n,onMenuClick:A,selected:r,preventRedirection:s,onPreventRedirection:d,endAdornment:o&&e(l?Pi:Ni,{})})})},Lc=(e,t)=>{if(0===t.length)return!1;if("object"!=typeof e)return!1;const[i,...o]=t;if(!i)return!1;const r=e[i];return 0===o.length?Boolean(r):Lc(r,o)},yc=e=>!0===e||"object"==typeof e&&null!==e&&Object.values(e).every(yc),Fc=({menuItem:i,level:o=0,parentPath:r="",subMenusOpen:n,setSubMenusOpen:l,currentPathMenuOpen:a,preventRedirection:s=!1,onPreventRedirection:C,onMenuClick:d})=>{const A=J();if(3===o)return;const{butterflyBlue:c,slate:h}=A.palette.app.color,{key:p,icon:u,title:g,isView:m,onClick:f,menuItems:k=[]}=i;if(!1===m)return;const E=r?`${r}/${p}`:p,I=E.split("/"),S=((e,t)=>{const i=Lc(e,t);return Boolean(i)})(n,I),w=((e,t)=>{const i=t.reduce(((e,t)=>{if("object"==typeof e&&null!==e&&t in e)return e[t]}),e);return yc(i)})(a,I),B=""===p?"/":`/${E}`;return t(M,{children:[e(Rc,{sx:{paddingLeft:3*o+1.5,fontSize:"13px",":focus-visible":{border:`1px solid ${c[900]}`,backgroundColor:h[900]}},onClick:e=>{if(k.length>0){if(w)return;l((e=>{const t={...e};let i=t;for(let e=0;e<I.length-1;e++){const t=I[e];t&&(i[t]="object"==typeof i[t]?i[t]:{},i=i[t])}const o=I[I.length-1];return o&&(i[o]=!S),t}))}else f&&!w&&f(B,e)},onMenuClick:d,href:0===k.length?B:"",icon:0===o?u:void 0,title:g,isShowEndAdornment:k.length>0&&o<2,selected:w,isExpanded:S,preventRedirection:s,onPreventRedirection:C}),k.length>0&&e(vc,{in:S,children:e(Yi,{component:"div",disablePadding:!0,children:k.map((t=>e(Fc,{menuItem:t,level:o+1,parentPath:E,onMenuClick:d,subMenusOpen:n,setSubMenusOpen:l,currentPathMenuOpen:a,preventRedirection:s,onPreventRedirection:C},t.key)))})})]},p)},Uc=({menuItems:t,currentPathname:i,preventRedirection:o=!1,onPreventRedirection:r,onMenuClick:n})=>{const[l,a]=h({}),[s,C]=h({});return u((()=>{const e=Mr(i);if(N(e))return a({home:!0}),void C({home:!0});const t=JSON.parse(JSON.stringify(e)),o=JSON.parse(JSON.stringify(e));a(t),C(o)}),[i]),t.map((t=>e(Fc,{menuItem:t,subMenusOpen:l,setSubMenusOpen:a,onMenuClick:n,currentPathMenuOpen:s,preventRedirection:o,onPreventRedirection:r},t.key)))},Dc=({menuItems:i=[],open:o,currentPathname:r,preventRedirection:n=!1,onLogoClick:l,onPreventRedirection:a,onMenuClick:s,href:d,preventClick:A=!1,openLogoUrl:c,closedLogoUrl:p})=>{const[u,g]=h(null),[m,f]=h(null),k=()=>{g(null)},{layout:E}=or(),I="desktop"===E,S=I&&o,w=S?c:p,B=!!w&&m===w,x=()=>w&&!B?e(M,{sx:{display:"flex",justifyContent:"center",alignItems:"center",px:S?2:1,width:"100%",boxSizing:"border-box"},children:e(YA,{mode:"view",variant:"auto",value:w,label:"",enableFullImageView:!1,hideBorder:!0,size:S?"medium":"small",maxPreviewWidth:S?220:48,maxPreviewHeight:S?48:40,onError:()=>f(w)})}):e(S?Nn:Xn,{});return t(Jc,{variant:"permanent",open:o,children:[t(M,{textAlign:"center",sx:{cursor:d||l?"pointer":"default"},component:d?C:"div",onClick:()=>{l&&!A&&l()},href:d,children:[I&&e(Kl,{padding:{paddingTop:"1.5rem"},children:x()}),!I&&e(Kl,{padding:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:x()})]}),I&&e(Yi,{component:"nav",onMouseLeave:k,children:o?e(Uc,{menuItems:i,onMenuClick:s,currentPathname:r,preventRedirection:n,onPreventRedirection:a}):e(bc,{menuItems:i,currentPathname:r,anchorEl:u,onMenuClick:s,setAnchorEl:g,preventRedirection:n,onPreventRedirection:a})}),!I&&e(re,{onClickAway:k,children:e(Yi,{component:"nav",onMouseLeave:k,children:e(bc,{menuItems:i,onMenuClick:s,currentPathname:r,anchorEl:u,setAnchorEl:g,preventRedirection:n,onPreventRedirection:a})})})]})},Zc=e=>e?Array.isArray(e)?e:[e]:[],Hc=e=>e.zIndex.drawer+200,Kc=({title:o,children:n,onClose:l,actions:s,headerSlot:C,isHideHeader:d=!1,isHideFooter:A=!1,isHideCloseIcon:c=!1,isHideDividers:h=!1,disableEscapeKeyDown:p=!1,anchor:u="right",sx:g,ModalProps:m,...f})=>{const k=!A&&!!s,E=Zc(g),I=Zc(m?.sx);return e(zi,{...f,anchor:u,onClose:l,sx:[e=>({zIndex:Hc(e),"& .MuiBackdrop-root":{zIndex:Hc(e)},"& .MuiDrawer-paper":{display:"flex",flexDirection:"column",zIndex:Hc(e)}}),...E],ModalProps:{...m,disableEscapeKeyDown:p,sx:[e=>({zIndex:Hc(e)}),...I]},children:t(a,{flex:1,sx:{overflow:"hidden"},children:[!d&&t(i,{children:[e(Kl,{padding:{padding:"10px"},children:t(a,{direction:"row",alignItems:"center",children:[e(M,{flex:1,children:C??e(q,{variant:"h6",fontWeight:500,children:o})}),!c&&e(r,{onClick:e=>l?.(e,"escapeKeyDown"),color:"secondary",size:"small","aria-label":"Close",onMouseDown:e=>e.preventDefault(),children:e(At,{fontSize:"medium"})})]})}),!h&&e($,{})]}),e(M,{flex:1,sx:{overflowY:"auto",overflowX:"hidden"},children:n}),k&&t(i,{children:[!h&&e($,{}),e(Kl,{padding:{padding:"10px"},children:s})]})]})})},Gc=({open:i=!1,anchorEl:o,onClose:n,children:l,onApply:s,showDivider:C=!1,title:d,required:A})=>{const c=J(),{slate:h}=c.palette.app.color,p=()=>{te(s)&&s(),te(n)&&n({},"backdropClick")};return t(ce,{open:i,anchorEl:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},onClose:()=>{p()},onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),p())},sx:{"& .MuiPaper-root":{minWidth:"300px"}},children:[C&&t(a,{alignItems:"flex-end",children:[e(Kl,{padding:{padding:"8px"},children:t(a,{direction:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:[t(a,{direction:"row",alignItems:"center",gap:"5px",children:[t(q,{variant:"h6",children:[d," "]}),A&&e(q,{variant:"h6",color:"error",children:"*"})]}),e(r,{onClick:p,children:e(Li,{})})]})}),e($,{sx:{width:"100%"}})]}),e(M,{sx:{background:h[600],borderRadius:"5px"},children:l})]})},Yc=({open:i,anchorEl:o,onClose:n,children:l,onApply:s,showDivider:C=!1,showFooter:d=!0,title:A,required:c,filterItem:p,reset:g,background:m=!1,currentFilterValue:f})=>{const k=J(),{slate:E}=k.palette.app.color,[I,S]=h(null),[w,B]=h(!0);u((()=>{if(i){if(!I&&f){const e=p?.multiSelect?no(f):f;S(e)}}else S(null);if(f&&I){const e=p?.multiSelect?JSON.stringify(no(f))!==JSON.stringify(I):f!==I;B(!e)}}),[i,f,I,p?.multiSelect]);const x=()=>{S(null),te(g)&&g(),te(n)&&n({},"backdropClick")};return t(ce,{open:i,anchorEl:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},onClose:(e,t)=>{te(n)&&(n(e,t),x())},sx:{"& .MuiPaper-root":{minWidth:"300px"}},children:[C&&t(a,{alignItems:"flex-end",children:[e(Kl,{padding:{padding:"8px"},children:t(a,{direction:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:[t(a,{direction:"row",alignItems:"center",gap:"5px",children:[e(q,{variant:"h6",children:A}),c&&e(q,{variant:"h6",color:"error",children:"*"})]}),e(r,{onClick:x,children:e(Te,{})})]})}),e($,{sx:{width:"100%"}})]}),e(M,{sx:{background:m?E[600]:"transparent",borderRadius:"5px",maxWidth:"300px"},children:l}),d&&e(Kl,{padding:{padding:"10px"},children:e(M,{display:"flex",justifyContent:"flex-end",children:e(vr,{onClick:()=>{S(null),te(s)&&s()},disabled:w,variant:"text",sx:{maxWidth:"40px"},children:"Apply"})})})]})};function Vc({selectedFilter:t,control:i,errors:o,setIsPopupOpen:r,autoFocus:n=!1}){const l=J(),{sapphireBlue:a,black:s}=l.palette.app.color,C=o[t.key],{placeholder:d,label:A}=t,c=d??`Select ${A}`,h=d??A;return{autoComplete:t.options&&e(dC,{disableClearable:!0,multiple:t.multiSelect??!1,placeholder:c,name:`${t.key}`,disabled:t.isDisabled,loading:t.loading,shouldCloseOnSelect:t.shouldCloseOnSelect,control:i,options:t.options??[],onOpen:()=>r?.(!0),onClose:()=>r?.(!1),autoFocus:n,sx:{maxHeight:"250px",overflowY:"auto",width:"100%","& .MuiAutocomplete-tag":{backgroundColor:a[300],color:s[900]}},...t.employeeAutocomplete&&{isShowEmployeeData:!0,isShowOptionsOnType:!0,getOptionLabel:e=>"string"==typeof e?e:`${e.label} (${e.employee_code}) - ${e.punch_code}`},error:!!C,helperText:C?.message},t.key),text:e(zA,{name:t.key,control:i,disabled:t.isDisabled,placeholder:h,error:!!C,helperText:C?.message,autoFocus:n}),date:e(DC,{name:t.key,control:i,disabled:t.isDisabled,error:!!C,helperText:C?.message,autoFocus:n,minDate:t.minDate?U.fromISO(t.minDate):void 0,maxDate:t.maxDate?U.fromISO(t.maxDate):void 0,...t.monthYearFormat&&{format:"MMM yyyy",views:["year","month"]}}),dateRange:e(TC,{name:t.key,control:i,disabled:t.isDisabled,error:!!C,helperText:C?.message})}}const Tc=({open:i,anchorEl:o,filterItem:r,onClose:n,control:l,errors:s,onApply:C,currentFilterValue:d,reset:A})=>e(Yc,{title:r.label,required:r.required,filterItem:r,open:i,onClose:n,anchorEl:o,onApply:C,currentFilterValue:d,reset:A,showFooter:!0,showDivider:!0,background:!0,children:t(Kl,{padding:{padding:"10px"},children:[Vc({selectedFilter:r,control:l,errors:s})[r.type],"switch"===r.type&&t(a,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{padding:"10px 5px 10px 20px",margin:"auto"},children:[e(q,{variant:"body2",children:r.label}),e(dc,{control:l,name:r.key})]},r.key)]})}),jc=({open:t,anchorEl:i,filterItem:o,onClose:r,control:n,errors:l,onApply:a})=>e(Gc,{title:o.label,required:o.required,open:t,onClose:r,anchorEl:i,onApply:a,showDivider:!0,background:!0,children:e(Kl,{padding:{padding:"10px"},children:Vc({selectedFilter:o,control:n,errors:l})[o.type]})}),Wc=(e,t)=>{let i=e;if(t&&"autoComplete"===t.type&&(i=t.multiSelect&&Array.isArray(e)?t.options?.filter((t=>e.includes(t.value))).map((e=>e.label)).join(", "):t.options?.filter((t=>t.value===e)).map((e=>e.label)).join(", ")),"dateRange"===t.type&&Array.isArray(e)&&2===e.length){i=`${e[0]} <= Start Date <= ${e[1]}`}return i};function qc(e,t){const i=new Map(t.map((e=>[e.key,e])));return Object.fromEntries(Object.entries(e).flatMap((([e,t])=>{if(t){const o=i.get(e);return[[e,o?.monthYearFormat&&"string"==typeof t?U.fromISO(t).toFormat("yyyy-MM"):t]]}return[]})))}const zc=({filterListItems:o,isDisabled:n=!1,filterListData:l,onApply:s,onClear:C,onChange:d,isSingleCompany:A=!1,defaultComponyId:m,companyKey:f="company_id"})=>{const k=m??void 0,E=J(),{iron:I,slate:S}=E.palette.app.color,{layout:w}=or(),B="desktop"===w,Q="mobile"===w,[b,v]=h(null),R=p(null),L=p(null),[y,F]=h(!1),[D,Z]=h(!1),[H,K]=h(null),G=p(null),[Y,V]=h(!1),T=c((()=>A?o.filter((({key:e})=>e!==f)):o),[o,A,f]),j=c((()=>new Map(o.map((e=>[e.key,e])))),[o]),W=c((()=>new Map(T.map(((e,t)=>[e.key,t])))),[T]),z=g(((e,t)=>{K(e),L.current=t,Z(!0)}),[]),O=c((()=>function(e){return JSON.stringify(e.map((e=>{const{key:t,multiSelect:i,required:o,type:r,isDefaultCurrentDate:n,value:l,options:a}=e;return[t,i??!1,o??!1,r,n??!1,l??null,"autoComplete"===r&&o&&1===a?.length?a[0]?.value??null:null]})))}(o)),[o]),P=c((()=>{const e=o.reduce(((e,{key:t,multiSelect:i,options:o,required:r,type:n,value:l,isDefaultCurrentDate:a})=>(e[t]="autoComplete"===n&&r&&1===o?.length?i?[o[0]?.value]:o[0]?.value:i||"dateRange"===n?l||null:"switch"===n?l||!1:a&&"date"===n?l||U.now().toISODate():l||null,e)),{});return A&&(e[f]=k),e}),[O,A,k,f]),X=c((()=>function(e,t,i){return JSON.stringify([t,i,e.map((e=>{const{key:t,multiSelect:i,type:o,required:r,label:n}=e;return[t,i??!1,o,r??!1,n]}))])}(o,A,f)),[o,A,f]),_=c((()=>{const e={};o.forEach((({key:t,multiSelect:i,type:o})=>{e[t]=i||"dateRange"===o?ro.array(ro.string()).nullable().optional():"switch"===o?ro.boolean().nullable().optional():ro.string().nullable().optional()})),A&&(e[f]=ro.string().nullable().optional());const t=o.filter((({key:e,required:t})=>t&&!(A&&e===f)));return ro.object(e).superRefine(((e,i)=>{t.forEach((({key:t,required:o,label:r})=>{o&&!e[t]?.length&&i.addIssue({path:[t],message:`${r} is required`,code:ro.ZodIssueCode.custom})}))}))}),[X]),ee=c((()=>Xi(_)),[_]),{control:te,handleSubmit:ie,setValue:oe,reset:re,getValues:ne,formState:{errors:le,dirtyFields:ae}}=et({values:P,resolver:ee,mode:"all"});c((()=>{T&&0!==T.length&&T.forEach((({key:e,multiSelect:t,options:i,required:o})=>{if(o&&1===i?.length){ne(e)||oe(e,t?[i[0]?.value]:i[0]?.value)}}))}),[T]),u((()=>{A&&oe(f,k)}),[A,k,f]);const se=it({control:te}),Ce=se[f],de=se.business_unit_id,Ae=se.department_id,ce=()=>{v(null)},he=()=>{Ie((()=>{const e=new Set;return T.forEach((({type:t,key:i,required:o},r)=>{"switch"!==t&&(r===ke||P?.[i]||o)&&e.add(i)})),e}))},pe=()=>{const e=A?{...P,[f]:k}:P;re(e),C(),he(),ce()},ue=e=>{const t=e instanceof HTMLElement?e:e.currentTarget;v(t)},ge=e=>{F(!1),K(null);const t=A?{...e,[f]:k}:e,i={...oo(qc(t,o),(e=>io(e)||N(e))),...A?{[f]:k}:{}};Ie((()=>{const e=new Set;return T.forEach((({type:t,key:o,required:r},n)=>{"switch"!==t&&(n===ke||i[o]||r)&&e.add(o)})),e})),s(i,y,H?.key),ce()},me=e=>j.get(e),fe=c((()=>!!l&&Object.entries(l).some((([e,t])=>(!A||e!==f)&&(!!W.has(e)&&("boolean"==typeof t?t:!io(t)&&!N(t)))))),[l,W,A,f]),ke=c((()=>T.findIndex((({type:e})=>"switch"!==e&&"dateRange"!==e))),[T]),[Ee,Ie]=h((()=>{const e=new Set;return T.forEach((({type:t,key:i,required:o},r)=>{"switch"!==t&&(r===ke||l?.[i]||P?.[i]||o)&&e.add(i)})),e})),Se=g(((e,t)=>{Ie((i=>{const o=new Set(i);return t?o.add(e):o.delete(e),o}))}),[]),we=H?.key?"switch"===H.key?se[H.key]?"true":"false":se[H.key]:null,Be=c((()=>A?{...se,[f]:k}:se),[f,se,A,k]),xe=p(d);xe.current=d;const Qe=p(void 0),Me=p(y);Me.current=y,u((()=>{to(Qe.current,Be)||(Qe.current=Be,x((()=>{xe.current(Be,Me.current)})))}),[Be]);const be=p(P);u((()=>{to(be.current,P)||(be.current=P,to(ne(),P)||re(P))}),[P,ne,re]),u((()=>{Ie((e=>{const t=new Set;return T.forEach((({type:i,key:o,required:r},n)=>{"switch"!==i&&(n===ke||l?.[o]||P?.[o]||r||e.has(o))&&t.add(o)})),function(e,t){if(e.size!==t.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}(e,t)?e:t}))}),[T,l,P,ke]);const Je=p(o);Je.current=o;const ve=p(Ce);u((()=>{A||y?ve.current=Ce:to(ve.current,Ce)||(ve.current=Ce,Je.current.forEach((({key:e,isDefaultCurrentDate:t,type:i})=>{t&&"date"===i||e!==f&&oe(`${e}`,null)})),oe(f,Ce))}),[Ce,f,A,y]);const Re=p(de);u((()=>{y?Re.current=de:to(Re.current,de)||(Re.current=de,oe("business_unit_location_id",null))}),[de,y,oe]);const Le=p(Ae);u((()=>{y?Le.current=Ae:to(Le.current,Ae)||(Le.current=Ae,oe("sub_department_id",null))}),[Ae,y,oe]);const ye=Boolean(b),Fe=c((()=>0===Object.keys(ae).length&&Object.keys(se).every((e=>!(!A||e!==f)||(io(se[e])||N(se[e]))))),[se,ae,A]);return rr({key:"f",modifierKeys:["ctrl","shift"],onTrigger:()=>{if(n)return;const e=G.current??document.createElement("button");ue(e)}}),t(M,{sx:{flexGrow:1},children:[t(a,{direction:"row",justifyContent:{xs:"end",md:"space-between"},spacing:1,children:[B&&e(a,{direction:"row",alignItems:"center",sx:{maxWidth:{xs:"40vw",md:"45vw",lg:"57vw"}},children:!!l&&!!fe&&t(i,{children:[e(q,{variant:"body1",sx:{minWidth:"50px",marginRight:"5px"},children:"Filters:"}),e(a,{direction:"row",gap:"5px",alignItems:"center",sx:{flexWrap:"wrap",maxWidth:"100%"},children:(Ue=l,Object.entries(Ue).map((([t,i])=>{const r=(e=>W.get(e)??-1)(t);if(-1===r)return;if("boolean"!=typeof i&&!i)return;const a=me(t),C=T[r],d=a&&Wc(i,a),c=function(e){return Array.isArray(e)?e.join(", "):ar.test(e)?U.fromFormat(e,"yyyy-MM").toFormat("MMM yyyy"):sr.test(e)?U.fromFormat(e,"yyyy-MM-dd").toFormat("dd-MM-yyyy"):e}("object"==typeof d?JSON.stringify(d):String(d));return"boolean"==typeof i||c?e(Fs,{label:e(El,{toolTipLabel:`${c}`,children:e(q,{noWrap:!0,variant:"subtitle2",children:`${a?.label}: ${c}`})}),onDelete:()=>(e=>{const t=me(e);if(t?.required)return Ws.error({title:"This is a required custom filter field and cannot be removed."});oe(`${e}`,null);const i={...l};delete i[e],A&&(i[f]=k),s(i,!0,e)})(t),onClick:e=>{((e,t)=>{if(A&&e===f)return;if(e===f&&o?.some((({required:e})=>e)))return;F(!0),R.current=t.currentTarget;const i=me(e);i&&K(i)})(t,e)},disabled:n,shouldDisableFocus:C?.shouldDisableFocus??!1,shouldDisableRipple:C?.shouldDisableRipple??!1},t):void 0})))})]})}),t(a,{direction:"row",alignItems:"flex-start",children:[fe&&e(vr,{onClick:()=>pe(),variant:"text",sx:{minWidth:{xs:"60px",sm:"100px"}},children:Q?"Clear":"Clear Filter"}),!n&&e(vl,{isFiltered:fe,onClick:ue,ref:G})]})]}),e("form",{onSubmit:e=>{e.preventDefault(),Fe||ie((e=>{ge(e)}))()},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),Y||Fe||ie((e=>{ge(e)}))())},children:t(zi,{open:ye,onClose:(e,t)=>{"backdropClick"!==t&&ce()},anchor:"right",sx:{zIndex:E.zIndex.drawer+2,"& .MuiPaper-root":{width:"100%",maxWidth:{xs:"270px",sm:"350px"}}},children:[t(a,{sx:{background:I[600]},children:[e(Kl,{padding:{padding:"10px 30px"},children:t(a,{direction:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:[e(q,{variant:"h6",children:"Filter"}),e(r,{onClick:()=>{const e=A?{...P,[f]:k}:P;re(e),he(),ce()},children:e(Te,{})})]})}),e($,{sx:{width:"100%"}})]}),e(a,{flexGrow:1,sx:{overflowX:"hidden"},children:T.map(((t,i)=>e(Oc,{filter:t,index:i,firstNonSwitchIndex:ke,isExpanded:Ee.has(t.key),onExpandedChange:Se,control:te,fieldError:le[t.key],setIsPopupOpen:V,slate600:S[600],dateRangeValue:"dateRange"===t.type?se[t.key]:null,onDateRangeClick:z},t.key)))}),e($,{}),e(a,{children:e(Kl,{padding:{padding:"10px"},children:t(wC,{children:[e(vr,{type:"submit",disabled:Fe,variant:"contained",onClick:()=>{ie(ge)()},children:"Apply"}),e(vr,{type:"button",onClick:()=>pe(),disabled:Object.keys(se).every((e=>!(!A||e!==f)||!se[e])),variant:"outlined",children:"Reset"})]})})})]})}),H&&e(Tc,{open:y,onClose:()=>{H?.key&&oe(`${H?.key}`,l?.[H.key]),F(!1)},onApply:()=>{ie(ge)()},control:te,errors:le,reset:re,anchorEl:R.current,filterItem:H,currentFilterValue:we}),H&&e(jc,{open:D,onClose:()=>{H?.key&&oe(`${H?.key}`,l?.[H.key]),Z(!1)},onApply:()=>{Z(!1)},control:te,errors:le,anchorEl:L.current,filterItem:H})]});var Ue};const Oc=B((function({filter:i,index:o,firstNonSwitchIndex:r,isExpanded:n,onExpandedChange:l,control:s,fieldError:C,setIsPopupOpen:d,slate600:A,dateRangeValue:c,onDateRangeClick:h}){const{type:p,key:u,label:g,required:m,isDisabled:f,menuInfo:k}=i;return"switch"===p?t(a,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"80%",sx:{padding:"10px 5px 10px 20px ",margin:"auto"},children:[e(q,{variant:"body2",children:g}),e(dc,{control:s,name:u})]}):t(_i,{expanded:n,onChange:(e,t)=>{l(u,t)},disabled:f,sx:{boxShadow:"none","&.MuiAccordion-root.Mui-expanded":{margin:"0 !important"},"&.MuiAccordion-root.Mui-disabled":{backgroundColor:"transparent"}},children:[e(eo,{expandIcon:e(Ni,{}),"aria-controls":"panel1a-content",id:"panel1a-header",sx:{flexDirection:"row-reverse","& MuiAccordionSummary-root.Mui-expanded":{marginRight:"10px",transform:"rotate(-90deg)"},"&.Mui-expanded":{minHeight:"40px",paddingY:"5px"},"& .MuiAccordionSummary-content.Mui-expanded":{margin:"0px"}},children:t(a,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"90%",children:[t(a,{direction:"row",alignItems:"center",gap:"5px",children:[e(q,{variant:"body2",children:g}),m&&e(q,{color:"error",children:"*"})]}),e(q,{variant:"body2",children:k})]})}),e($i,{sx:{background:A,borderRadius:"5px",padding:"0px"},children:e(Kl,{padding:{paddingLeft:"15px",paddingY:"5px",paddingRight:"15px"},children:"dateRange"===p?t(a,{direction:"row",alignItems:"center",gap:"10px",onClick:e=>{h(i,e.currentTarget)},children:[e(M,{sx:{border:"1px solid black",borderRadius:"5px",width:"150px",p:1},children:e(q,{variant:"body2",children:Array.isArray(c)&&c[0]?U.fromISO(c[0]).toFormat(yC.dateWithEuropean):"Start Date"})}),e(q,{children:"~"}),e(M,{sx:{border:"1px solid black",borderRadius:"5px",width:"150px",p:1},children:e(q,{variant:"body2",children:Array.isArray(c)&&c[1]?U.fromISO(c[1]).toFormat(yC.dateWithEuropean):"End Date"})})]}):e(M,{children:Vc({selectedFilter:i,control:s,errors:C?{[u]:C}:{},setIsPopupOpen:d,autoFocus:o===r})[p]})})})]})}),(function(e,t){const{index:i,firstNonSwitchIndex:o,isExpanded:r,control:n,fieldError:l,slate600:a,onExpandedChange:s,setIsPopupOpen:C,onDateRangeClick:d,filter:A,dateRangeValue:c}=e,{index:h,firstNonSwitchIndex:p,isExpanded:u,control:g,fieldError:m,slate600:f,onExpandedChange:k,setIsPopupOpen:E,onDateRangeClick:I,filter:S,dateRangeValue:w}=t;if(i!==h||o!==p||r!==u||n!==g||l!==m||a!==f||s!==k||C!==E||d!==I)return!1;const{key:B,type:x,label:Q,required:M,isDisabled:b,loading:J,multiSelect:v,menuInfo:R,options:L,placeholder:y,employeeAutocomplete:F,monthYearFormat:U,minDate:D,maxDate:Z,shouldCloseOnSelect:H}=A,{key:K,type:G,label:Y,required:V,isDisabled:T,loading:j,multiSelect:W,menuInfo:q,options:z,placeholder:O,employeeAutocomplete:P,monthYearFormat:N,minDate:X,maxDate:_,shouldCloseOnSelect:$}=S;return B===K&&x===G&&Q===Y&&M===V&&b===T&&J===j&&v===W&&R===q&&L===z&&y===O&&F===P&&U===N&&D===X&&Z===_&&H===$&&to(c,w)})),Pc=({filter:i,control:o})=>{return e(le,{children:(r=i.type,t(a,{direction:"row",width:"100%",justifyContent:"space-between",alignItems:"center",children:[e(q,{variant:"body2",children:i.label}),"switch"===r?e(dc,{control:o,name:i.key}):e(q,{variant:"body2",children:i.menuInfo})]}))});var r},Nc=({filterListItems:i})=>{const[o,n]=h(null),l=p(null),[s,C]=h(!1),[d,A]=h(),[c,u]=h(null),{control:g,handleSubmit:m,setValue:f,reset:k,formState:{errors:E},watch:I}=et(),S=()=>{n(null)},w=e=>{C(!1),u(null),S();const t=qc(e,i);A(t)},B=e=>{C(!0),n(null),u(e)},x=e=>i.find((t=>t.key===e)),Q=c?.key?I(c.key):null,b=Boolean(o);return t(a,{children:[t(a,{direction:"row",spacing:1,alignItems:"center",children:[d&&(J=d,Object.entries(J).map((([t,i])=>{if(!i)return;const o=x(t),r=o&&Wc(i,o);return e(Ls,{ref:l,label:e(El,{toolTipLabel:`${r}`,children:`${o?.label}: ${r}`}),onDelete:()=>(e=>{f(`${e}`,null),A((t=>{const i={...t};return delete i[e],i}))})(t),onClick:e=>{C(!0),l.current=e.currentTarget;const i=x(t);i&&(u(i),B(i))}},t)}))),e(r,{ref:l,onClick:e=>{n(e.currentTarget)},sx:{height:"40px"},children:e(Fn,{})}),e(vr,{onClick:()=>(k(),void A(void 0)),variant:"text",children:"Clear Filter"})]}),e(Yc,{open:b,anchorEl:o,onClose:S,onApply:()=>{m(w)()},children:i.map((t=>e(M,{onClick:()=>"switch"!==t.type&&B(t),children:e(Pc,{filter:t,control:g})},t.key)))}),c&&"switch"!==c.type&&e(Tc,{open:s,onClose:()=>{C(!1)},onApply:()=>{m(w)()},control:g,currentFilterValue:Q,anchorEl:l.current,filterItem:c,errors:E})]});var J},Xc=({text:t,highlightWords:i})=>{const o=J(),{slate:r}=o.palette.app.color;if(!i?.length)return e(M,{component:"span",children:t});const n=i.map((e=>e.replace(pr,"\\$&"))),l=new RegExp(`(${n.join("|")})`,"gi"),a=t.split(l);return e(M,{component:"span",children:a.map(((t,i)=>l.test(t)?e(M,{component:"span",sx:{padding:"2px 4px",backgroundColor:r[800],border:`1px solid ${r[700]}`,borderRadius:"5px",fontFamily:"monospace",fontSize:"0.9em"},children:t},`highlight-${i}-${t}`):e(M,{component:"span",children:t},`text-${i}-${t}`)))})},_c=({label:i,variant:o,colourCode:r})=>t(a,{gap:"10px",direction:"row",alignItems:"center",children:[e(On,{variant:o,colourCode:r}),i]}),$c=({color:i,label:o,isBackground:r=!1})=>e(M,{sx:{backgroundColor:`${r?y(i,.2):""}`,width:"max-content",borderRadius:"6px"},children:e(Kl,{padding:{padding:r?"5px 8px":"0"},children:t(a,{flexDirection:"row",alignItems:"center",gap:"8px",children:[e(Vi,{sx:{color:i,fontSize:"12px"}}),e(q,{variant:"body2",sx:{fontWeight:500},children:o})]})})}),eh=({count:t,page:i,onPageChange:o,rowsPerPage:r,onRowsPerPageChange:n,sx:l,...a})=>{const s=J(),{grey:C}=s.palette,{layout:d}=or(),A="mobile"===d;return e(lo,{sx:{"& .MuiInputBase-root":{height:"30px"},"& .MuiToolbar-root":{paddingLeft:0},"& .MuiTablePagination-select":{backgroundColor:"transparent !important"},"& .MuiTablePagination-input":{border:`1.5px solid ${C[400]}`,borderRadius:"5px",fontSize:"13px",padding:A?"2px 10px":"4px 8px"},...l},component:"div",count:t,page:i,onPageChange:o,rowsPerPage:r,onRowsPerPageChange:n,rowsPerPageOptions:[20,50,100,200],defaultValue:100,labelRowsPerPage:A?"":"Rows per page",...a})},th=({items:i,disabled:o,sx:r})=>{const[n,l]=h(null);return t(M,{sx:{width:"100%",...r},children:[e(Ml,{onClick:e=>{l(e.currentTarget)},disabled:o}),!!n&&e(Yl,{open:!0,anchorEl:n,onClose:()=>{l(null)},children:e(Kl,{padding:{padding:"2px"},children:i.map((t=>e(M,{children:e(le,{sx:{width:"100%",textAlign:"start"},onClick:()=>{t?.onClick(),l(null)},children:e(q,{variant:"body1",children:t.title})})},t.title)))})})]})},ih="smart-grid-field-input",oh=e=>({...e,wrapperMinHeight:e.controlMinHeight+2*e.paddingY}),rh={sm:oh({controlMinHeight:18,paddingY:2,padding:"2px 6px",autocompletePadding:"2px 2px 2px 6px",fontSize:"12px",borderRadius:"4px",expandIconSize:18,expandMarginLeft:"2px",multipleGap:"2px",chipFontSize:"11px",chipPadding:"1px 6px"}),md:oh({controlMinHeight:20,paddingY:4,padding:"4px 8px",autocompletePadding:"4px 4px 4px 8px",fontSize:"13px",borderRadius:"4px",expandIconSize:20,expandMarginLeft:"4px",multipleGap:"4px",chipFontSize:"12px",chipPadding:"2px 8px"}),lg:oh({controlMinHeight:22,paddingY:6,padding:"6px 10px",autocompletePadding:"6px 6px 6px 10px",fontSize:"15px",borderRadius:"6px",expandIconSize:22,expandMarginLeft:"6px",multipleGap:"4px",chipFontSize:"13px",chipPadding:"3px 10px"})},nh=(e="md")=>rh[e],lh=e=>e[800],ah=(e,t)=>t?e[800]:e[400],sh=e=>`\n .${ih}::placeholder {\n color: ${e};\n opacity: 1;\n }\n .${ih}:disabled {\n color: ${e};\n -webkit-text-fill-color: ${e};\n }\n`,Ch=(e,t="md")=>{const{controlMinHeight:i,fontSize:o}=nh(t);return{width:"100%",border:"none",background:"transparent",padding:0,margin:0,fontSize:o,lineHeight:`${i}px`,minHeight:i,outline:"none",color:e}},dh=(e="md",t="text")=>{const{borderRadius:i,autocompletePadding:o,padding:r,wrapperMinHeight:n}=nh(e);return{alignItems:"center",borderRadius:i,padding:"autocomplete"===t?o:r,minHeight:n,boxSizing:"border-box"}},Ah=({wrapper:i,title:o,position:r})=>{const n=P(),{iron:l}=n.palette.app.color,a=i.getBoundingClientRect(),s={position:"fixed",zIndex:999999,background:l[200],color:l[600],padding:"4px 8px",borderRadius:4,fontSize:12,pointerEvents:"none",whiteSpace:"nowrap",transition:"opacity 0.2s ease, transform 0.2s ease",opacity:1},C={position:"absolute",width:0,height:0,borderStyle:"solid"};switch(r){case"top":s.top=a.top-28,s.left=a.left+a.width/2,s.transform="translateX(-50%)",Object.assign(C,{borderWidth:"6px 6px 0 6px",borderColor:`${l[200]} transparent transparent transparent`,bottom:-6,left:"50%",transform:"translateX(-50%)"});break;case"bottom":s.top=a.bottom+4,s.left=a.left+a.width/2,s.transform="translateX(-50%)",Object.assign(C,{borderWidth:"0 6px 6px 6px",borderColor:`transparent transparent ${l[200]} transparent`,top:-6,left:"50%",transform:"translateX(-50%)"});break;case"left":s.top=a.top+a.height/2,s.left=a.left-8,s.transform="translateY(-50%)",Object.assign(C,{borderWidth:"6px 0 6px 6px",borderColor:`transparent transparent transparent ${l[200]}`,right:-6,top:"50%",transform:"translateY(-50%)"});break;case"right":s.top=a.top+a.height/2,s.left=a.right+8,s.transform="translateY(-50%)",Object.assign(C,{borderWidth:"6px 6px 6px 0",borderColor:`transparent ${l[200]} transparent transparent`,left:-6,top:"50%",transform:"translateY(-50%)"})}return t("div",{style:s,children:[o,e("div",{style:C})]})},ch=({children:o,title:r,position:n="top",delay:l=50})=>{const[a,s]=h(!1),C=p(null),d=p(null);u((()=>()=>{d.current&&clearTimeout(d.current)}),[]);const A=a&&r&&C.current?Co(e(Ah,{wrapper:C.current,title:r,position:n}),document.body):null;return t(i,{children:[e("div",{ref:C,style:{display:"inline-block",width:"100%"},onMouseEnter:()=>{d.current&&clearTimeout(d.current),d.current=setTimeout((()=>s(!0)),l)},onMouseLeave:()=>{d.current&&clearTimeout(d.current),s(!1)},children:o}),A]})},hh={display:"flex",flexDirection:"column",gap:"4px",width:"100%"},ph={width:"100%"},uh=k((({errorMessage:i,size:o="md",currencySymbol:r,decimalCharacter:n,digitGroupSeparator:l,decimalPlaces:a,decimalPlacesShownOnBlur:s,decimalPlacesShownOnFocus:C,minimumValue:d,maximumValue:A,outputFormat:p="number",textAlign:u,allowNegative:m,suffix:f,preDefined:k,navigationKey:E,disabled:I,name:S,value:w,onChange:B,onBlur:x,onFocus:Q,onKeyDown:M,placeholder:b="",style:v,className:R},L)=>{const y=J(),{butterflyBlue:F,iron:U,lipstickRed:D}=y.palette.app.color,{navigationKey:Z}=Fo(),H=E??Z,[K,G]=h(!1),[Y,V]=h(""),{handleEnterNavigation:T,setInputRef:j}=ir({navigationKey:H}),W=c((()=>{const e=k??{},{currencySymbol:t,decimalCharacter:i,digitGroupSeparator:o,decimalPlaces:d,decimalPlacesShownOnBlur:A,decimalPlacesShownOnFocus:c,suffix:h,textAlign:p,allowNegative:g}=e;return{currencySymbol:r??t??"",decimalCharacter:n??i??".",digitGroupSeparator:l??o??",",decimalPlaces:a??d??2,decimalPlacesShownOnBlur:s??A,decimalPlacesShownOnFocus:C??c,suffix:f??h,textAlign:u??p??"right",allowNegative:m??g??!1}}),[m,r,n,a,s,C,l,k,f,u]),{currencySymbol:q,decimalCharacter:z,digitGroupSeparator:O,decimalPlaces:P,decimalPlacesShownOnBlur:N,decimalPlacesShownOnFocus:X,suffix:_,textAlign:$,allowNegative:ee}=W,te=c((()=>null!=d?Number(d):ee?void 0:0),[d,ee]),ie=c((()=>null!=A?Number(A):void 0),[A]),oe=K?X:N??P,re=c((()=>K?Y:null==w||""===w?"":String(w)),[Y,K,w]),ne=c((()=>i?D[900]:K?F[900]:U[800]),[F,i,U,K,D]),le=lh(U),ae=ah(U,I),{fontSize:se}=nh(o),Ce=c((()=>sh(le)),[le]),de=c((()=>dh(o,"text")),[o]),Ae=c((()=>({...Ch(ae,o),textAlign:$,flex:1,minWidth:0,...v})),[ae,$,o,v]),ce=c((()=>({display:"flex",alignItems:"center",border:`2px solid ${ne}`,background:U[600],width:"100%",...de})),[ne,U,de]),he=c((()=>({flexShrink:0,fontSize:se,color:I?U[800]:U[400],marginRight:"4px",userSelect:"none"})),[se,I,U]),pe=c((()=>[ih,R].filter(Boolean).join(" ")),[R]),ue=c((()=>!1!==O&&O),[O]),ge=g((e=>{j(e),"function"==typeof L?L(e):L&&(L.current=e)}),[L,j]),me=g((e=>{B?.({target:{name:S,value:e??""}})}),[S,B]),fe=g(((e,t)=>{const i=e.value;V(i),"prop"!==t?.source&&me(""!==i?"string"!==p?$o(i):i:null)}),[me,p]),ke=g((e=>{e.stopPropagation(),G(!0),V(null==w||""===w?"":String(w)),Q?.(e)}),[Q,w]),Ee=g((e=>{e.stopPropagation(),G(!1),x?.(e)}),[x]),Ie=g((e=>{"enter"!==H||"Enter"!==e.key||e.ctrlKey||e.metaKey||e.altKey||T(e),M?.(e)}),[T,H,M]),Se=g((e=>{const{floatValue:t,value:i}=e;return!(!ee&&i.includes("-"))&&(null==t||!(!ee&&t<0)&&((null==te||Number.isNaN(te)||t>=te)&&(null==ie||Number.isNaN(ie)||t<=ie)))}),[ee,ie,te]),we=g((e=>{e.stopPropagation()}),[]);return t(ch,{title:i??"",position:"top",delay:50,children:[e("style",{children:Ce}),e(ao.Root,{disabled:I,name:S,style:ph,children:e("div",{style:hh,children:t("div",{style:ce,children:[q?e("span",{style:he,children:q}):null,e(Tt,{customInput:so,value:re,valueIsNumericString:!0,thousandSeparator:ue,decimalSeparator:z,decimalScale:oe,fixedDecimalScale:!K,allowNegative:ee,suffix:_,isAllowed:Se,disabled:I,name:S,placeholder:b,className:pe,style:Ae,onValueChange:fe,onFocus:ke,onBlur:Ee,onKeyDown:Ie,onClick:we,inputMode:"decimal",getInputRef:ge})]})})})]})}));uh.displayName="SmartCurrencyFieldComponent";const gh=B(uh,((e,t)=>e.name===t.name&&e.value===t.value&&e.disabled===t.disabled&&e.size===t.size&&e.errorMessage===t.errorMessage&&e.placeholder===t.placeholder&&e.currencySymbol===t.currencySymbol&&e.decimalPlaces===t.decimalPlaces&&e.decimalPlacesShownOnBlur===t.decimalPlacesShownOnBlur&&e.decimalPlacesShownOnFocus===t.decimalPlacesShownOnFocus&&e.allowNegative===t.allowNegative&&e.minimumValue===t.minimumValue&&e.maximumValue===t.maximumValue&&e.digitGroupSeparator===t.digitGroupSeparator&&e.onChange===t.onChange&&e.onBlur===t.onBlur));gh.displayName="SmartCurrencyField";const mh=k((function({columns:o,optionsData:r,searchedByColumn:n,labelKey:l,valueKey:a="id",errorMessage:s,loading:C=!1,height:d="400px",dialogSize:A="lg",dialogTitle:u,size:m="md",placeholder:f="",onRowSelect:k,disabled:E,name:I,value:S,onChange:w,onBlur:B,onKeyDown:x,...Q},M){const b=P(),{butterflyBlue:J,iron:v,lipstickRed:R}=b.palette.app.color,{navigationKey:L}=Fo(),[y,F]=h(!1),[U,D]=h(!1),Z=p(null),H=p(null),K=p(null),G=p(null),{handleEnterNavigation:Y}=ir({navigationKey:L}),V=c((()=>null==S||""===S?"":String(S)),[S]),T=c((()=>{if(!V)return"";const e=r.find((e=>String(e[a])===V));return e?String(e[l]):""}),[l,r,V,a]),j=c((()=>r.map((e=>({label:String(e[l]),value:String(e[a])})))),[l,r,a]),W=c((()=>y||U?J[900]:s?R[900]:v[800]),[J,s,v,U,y,R]),q=lh(v),z=ah(v,E),O=c((()=>dh(m,"autocomplete")),[m]),{expandMarginLeft:N,expandIconSize:X}=c((()=>nh(m)),[m]),_=c((()=>sh(q)),[q]),$=c((()=>({...Ch(z,m),flex:1,minWidth:0,cursor:E?"default":"pointer"})),[E,z,m]),ee=g((e=>{K.current=e,"function"==typeof M?M(e):M&&(M.current=e)}),[M]),te=g((e=>{const t=K.current;t&&(t.value=e),w?.({target:{name:I,value:e}})}),[I,w]),ie=g((()=>{te(""),k?.(null)}),[te,k]),oe=g((()=>{H.current&&(H.current(),H.current=null),D(!1),F(!1),G.current?.focus()}),[]),re=g((()=>{E||(D(!0),setTimeout((()=>{const e=Z.current?.getTable(),t=document.querySelectorAll(".MuiDialog-root table thead input[type='text']"),i=e?.getAllColumns(),o=i?.findIndex((e=>e.id==n));if(void 0!==o&&o>=0&&t[o]){const e=t[o];e.focus();const i=e=>{const t=e;if("ArrowDown"===t.key){t.preventDefault();const e=document.querySelector(".MuiDialog-root table tbody tr");e&&(e.setAttribute("tabindex","0"),e.focus())}};e.addEventListener("keydown",i),H.current=()=>{e.removeEventListener("keydown",i)}}}),100))}),[E,n]),ne=g((({id:e})=>{const t=r.find((t=>String(t[a])===String(e)));if(!t)return;const i=String(t[a]);te(i),k?.(t),oe()}),[te,oe,k,r,a]),le=g((e=>"Backspace"===e.key&&V?(e.preventDefault(),void ie()):"enter"!==L||"Enter"!==e.key||U||e.ctrlKey||e.metaKey||e.altKey?"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||U||E?void x?.(e):(e.preventDefault(),void re()):void Y(e)),[ie,E,re,Y,U,L,x,V]),ae=g((e=>{e.preventDefault(),e.stopPropagation(),E||(U?oe():(F(!0),re()))}),[E,oe,re,U]),se=g((e=>{e.stopPropagation(),E||U||re()}),[E,re,U]),Ce=g((e=>{e.stopPropagation(),F(!0)}),[]),de=g((e=>{e.stopPropagation(),F(!1),B?.(e)}),[B]),Ae=f||"Click to select";return t(i,{children:[t(ch,{title:s??"",position:"top",delay:50,children:[e("style",{children:_}),e("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"},children:t("div",{style:{display:"flex",alignItems:"center",border:`2px solid ${W}`,background:v[600],position:"relative",width:"100%",...O},children:[e("input",{ref:G,readOnly:!0,disabled:E,value:T,placeholder:Ae,className:ih,onClick:se,onFocus:Ce,onBlur:de,onKeyDown:le,style:$}),e("button",{type:"button",tabIndex:-1,"aria-label":U?"Close dialog":"Open dialog",disabled:E,onMouseDown:e=>{e.preventDefault()},onClick:ae,style:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"none",background:"transparent",padding:0,marginLeft:N,cursor:E?"not-allowed":"pointer",color:E?v[800]:v[400]},children:e(Je,{sx:{fontSize:X,transform:U?"rotate(180deg)":"none",transition:"transform 0.2s ease"}})}),e("select",{...Q,ref:ee,name:I,value:V,disabled:E,tabIndex:-1,"aria-hidden":!0,style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0,pointerEvents:"none"},children:0===j.length?e("option",{value:"",disabled:!0,children:"No Options"}):t(i,{children:[e("option",{value:"",children:"Select Option"}),j.map((t=>e("option",{value:t.value,children:t.label},t.value)))]})})]})})]}),e(AC,{open:U,onClose:oe,maxWidth:A,title:u??"Select Option",children:e(pt,{ref:Z,columns:o,data:r,height:d,loading:C,totalCount:r.length,onRowActivate:ne,focusableRowNavigation:!0})})]})}));Object.assign(mh,{displayName:"SmartDialogSelectComponent"});const fh=B(mh,(({name:e,value:t,disabled:i,optionsData:o,columns:r,errorMessage:n,loading:l,placeholder:a,size:s,labelKey:C,valueKey:d,searchedByColumn:A},{name:c,value:h,disabled:p,optionsData:u,columns:g,errorMessage:m,loading:f,placeholder:k,size:E,labelKey:I,valueKey:S,searchedByColumn:w})=>e===c&&t===h&&i===p&&o===u&&r===g&&n===m&&l===f&&a===k&&s===E&&C===I&&d===S&&A===w));Object.assign(fh,{displayName:"SmartDialogSelect"});const kh=k((({errorMessage:o,options:r,onBlur:n,onKeyDown:l,...a},s)=>{const C=P(),{butterflyBlue:d,lipstickRed:A,iron:p}=C.palette.app.color,[u,g]=h(!1),{navigationKey:m}=Fo(),{handleEnterNavigation:f}=ir({navigationKey:m}),k=c((()=>u?d[900]:o?A[900]:u?d[900]:p[800]),[o,u]);return e(ch,{title:o??"",position:"top",delay:50,children:e("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"},children:e("div",{style:{display:"flex",alignItems:"center",border:`2px solid ${k}`,borderRadius:"4px",padding:"4px 8px",background:"white",minHeight:"20px"},children:e("select",{ref:s,...a,style:{width:"100%",border:"none",background:"transparent",padding:"0",fontSize:"13px",outline:"none",cursor:"pointer"},onClick:e=>e.stopPropagation(),onFocus:e=>{e.stopPropagation(),g(!0)},onBlur:e=>{e.stopPropagation(),g(!1),n&&n(e)},onKeyDown:e=>{"enter"!==m||"Enter"!==e.key||e.ctrlKey||e.metaKey||e.altKey||f(e),l?.(e)},children:0===r.length?e("option",{value:"",disabled:!0,children:"No Options"}):t(i,{children:[e("option",{value:"",children:"Select Option"}),r.map((t=>e("option",{value:String(t.value),children:t.label},t.value)))]})})})})})}));kh.displayName="SmartSelectFieldComponent";const Eh=B(kh,((e,t)=>e.name===t.name&&e.value===t.value&&e.disabled===t.disabled&&e.options===t.options&&e.errorMessage===t.errorMessage));Eh.displayName="SmartSelectField";const Ih=28,Sh=100,wh=200,Bh="select-all",xh=({label:e})=>e,Qh=({value:e})=>String(e),Mh=e=>Qh(e)===Bh,bh=e=>void 0===e||""===e?[]:Array.isArray(e)?[...new Set(e.map(String))]:[String(e)],Jh=(e,t)=>t.trim()?No({data:e,fieldsToSearch:["label"],term:t.toLowerCase()}):e,vh=(e,t,i)=>{if(!e.length)return null;if(i&&t.length){const i=new Set(t),o=e.findIndex((e=>!Mh(e)&&i.has(Qh(e))));if(o>=0)return o}if(!i&&t[0]){const i=e.findIndex((e=>Qh(e)===t[0]));if(i>=0)return i}return 0},Rh=B((function({butterflyBlue:t,checked:i,indeterminate:o=!1,iron:r}){const n=i||o;return e("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",flexShrink:0,borderRadius:"2px",border:`1px solid ${n?t[900]:r[800]}`,background:n?t[900]:r[600],boxSizing:"border-box",pointerEvents:"none"},children:o?e(ho,{sx:{fontSize:12,color:`${r[600]} !important`}}):i?e(je,{sx:{fontSize:12,color:`${r[600]} !important`}}):null})})),Lh=B((function({butterflyBlue:i,highlightedIndex:o,indeterminate:r,isSelected:n,iron:l,itemIndex:a,onHighlightIndex:s,onSelectOption:C,option:d,showCheckbox:A,style:c}){return t(co.Item,{index:a,value:d,disabled:d.disabled,onPointerEnter:()=>{d.disabled||s(a)},onClick:e=>{"preventBaseUIHandler"in e&&e.preventBaseUIHandler(),e.preventDefault(),C(d)},style:e=>{const t=a===o||e.highlighted?l[700]:n&&!A?i[500]:"transparent";return{display:"flex",alignItems:"center",gap:"8px",padding:"0 8px",fontSize:"13px",cursor:d.disabled?"not-allowed":"pointer",boxSizing:"border-box",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",background:t,...c}},children:[A?e(Rh,{butterflyBlue:i,checked:n,indeterminate:r,iron:l}):null,xh(d)]})})),yh=(t,i,o,r)=>{const{butterflyBlue:n,highlightedIndex:l,iron:a,isAllSelected:s,isShowSelectAll:C,isSomeSelected:d,onHighlightIndex:A,onSelectOption:c,selectedValuesSet:h,showCheckbox:p}=o,u=Qh(t),g=Mh(t),m=g?s:h.has(u);return e(Lh,{itemIndex:i,butterflyBlue:n,highlightedIndex:l,indeterminate:g&&C&&d&&!s,isSelected:m,iron:a,onHighlightIndex:A,onSelectOption:c,option:t,showCheckbox:p,style:r},`${u}-${i}`)},Fh=B((function({butterflyBlue:t,highlightedIndex:i,iron:o,isAllSelected:r,isShowSelectAll:n,isSomeSelected:l,onHighlightIndex:a,onSelectOption:s,selectedValuesSet:C,showCheckbox:d}){const A=co.useFilteredItems(),c=p(null),h=Re({count:A.length,estimateSize:()=>28,getScrollElement:()=>c.current,overscan:10}),g=h.getVirtualItems();if(u((()=>{null===i||i<0||h.scrollToIndex(i,{align:"auto"})}),[i,h]),!A.length)return null;const m={butterflyBlue:t,highlightedIndex:i,iron:o,isAllSelected:r,isShowSelectAll:n,isSomeSelected:l,onHighlightIndex:a,onSelectOption:s,selectedValuesSet:C,showCheckbox:d};return e("div",{ref:c,style:{maxHeight:200,overflowY:"auto",paddingBottom:"4px"},children:e(co.List,{style:{height:h.getTotalSize(),position:"relative",width:"100%"},children:g.map((({index:e,size:t,start:i})=>{const o=A[e];return o?yh(o,e,m,{position:"absolute",top:i,left:0,width:"100%",height:t}):null}))})})})),Uh=B((function({butterflyBlue:t,highlightedIndex:i,iron:o,isAllSelected:r,isShowSelectAll:n,isSomeSelected:l,onHighlightIndex:a,onSelectOption:s,selectedValuesSet:C,showCheckbox:d,virtualized:A}){if(A)return e(Fh,{butterflyBlue:t,highlightedIndex:i,iron:o,isAllSelected:r,isShowSelectAll:n,isSomeSelected:l,onHighlightIndex:a,onSelectOption:s,selectedValuesSet:C,showCheckbox:d});const c={butterflyBlue:t,highlightedIndex:i,iron:o,isAllSelected:r,isShowSelectAll:n,isSomeSelected:l,onHighlightIndex:a,onSelectOption:s,selectedValuesSet:C,showCheckbox:d};return e(co.List,{style:{maxHeight:200,overflowY:"auto",paddingBottom:"4px"},children:(e,t)=>yh(e,t,c)})})),Dh=B((function({iron:i,label:o,onRemove:r,size:n="md"}){const{chipFontSize:l,chipPadding:a}=c((()=>nh(n)),[n]);return t("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:a,borderRadius:"12px",background:i[700],color:i[900],fontSize:l,fontWeight:500,lineHeight:1.4,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[o,e("button",{type:"button","aria-label":`Remove ${o}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),r()},style:{border:"none",background:"transparent",color:i[900],cursor:"pointer",padding:0,lineHeight:1,fontSize:l},children:"×"})]})})),Zh=k((({containerStyle:o,disabled:r,errorMessage:n,freeSolo:l=!1,isShowCheckbox:a=!0,isShowSelectAll:s=!0,multiple:C=!1,name:d,label:A,onBlur:m,onChange:f,onDropdownOptionSelect:k,onKeyDown:E,options:I,placeholder:S="",required:w=!1,disableClearable:B=!!w,size:x="md",value:Q,defaultValue:M,...b},J)=>{const v=P(),{butterflyBlue:R,iron:L,lipstickRed:y}=v.palette.app.color,{navigationKey:F}=Fo(),[U,D]=h(!1),[Z,H]=h(!1),[K,G]=h(""),Y=p(null),V=p(null),T=p(null),[j,W]=h(!1),q=p(void 0),[z,O]=h(null),N=c((()=>bh(Q)),[Q]),X=C?"":N[0]??"",_=c((()=>C&&s&&I.length?[{label:"Select All",value:Bh},...I]:I),[s,C,I]),$=c((()=>Jh(_,C||!Z||j?K:"")),[K,Z,j,_,C]),ee=c((()=>new Set(N)),[N]),te=c((()=>{if(!C||!I.length)return!1;const e=I.filter((e=>!e.disabled));return e.length>0&&e.every((e=>ee.has(Qh(e))))}),[C,I,ee]),ie=c((()=>C&&I.some((e=>ee.has(Qh(e))))),[C,I,ee]),oe=c((()=>{if(C)return"";const e=I.find((e=>Qh(e)===X));return e?xh(e):l&&X?X:""}),[l,C,I,X]),{handleEnterNavigation:re,handleKeyDown:ne,inputRef:le,maintainFocusAfterClose:ae,setInputRef:se}=ir({isOpen:Z,navigationKey:F}),Ce=_.length>100,de=c((()=>U||Z?R[900]:n?y[900]:L[800]),[R,n,L,U,Z,y]),Ae=g((e=>{const t=I.find((t=>Qh(t)===e));return t?xh(t):e}),[I]),ce=g((e=>{f?.({target:{name:d,value:e}})}),[d,f]),he=g((e=>{const t=T.current;if(t)if(C&&Array.isArray(e)){const i=new Set(e);Array.from(t.options).forEach((e=>{e.selected=i.has(e.value)}))}else C||"string"!=typeof e||(t.value=e)}),[C]),pe=g(((e,t)=>{he(e),ce(e),t&&k(t)}),[ce,k,he]),ue=g(((e="",t)=>{const i=Jh(_,e);O(vh(i,t??N,C))}),[_,C,N]),ge=g((e=>{const t=I.filter((e=>e.disabled)).map((e=>Qh(e))),i=e?I.map((e=>Qh(e))):t;pe(i),Ao((()=>{G("")})),ue("",i)}),[pe,ue,I]),me=g((e=>{const t=Qh(e);if(Mh(e))ge(!te);else{if(C){const e=N.includes(t)?N.filter((e=>e!==t)):[...N,t];return pe(e,t),Ao((()=>{G("")})),void ue("",e)}pe(t,t),G(Ae(t)),H(!1),ae()}}),[pe,Ae,ge,te,ae,C,ue,N]),fe=g((e=>{const t=e.trim();if(!t)return;const i=I.find((e=>xh(e).toLowerCase()===t.toLowerCase()||Qh(e)===t));if(i)me(i);else{if(C){if(N.includes(t))return;const e=[...N,t];return pe(e,t),Ao((()=>{G("")})),void ue("",e)}pe(t,t),G(t),H(!1),ae()}}),[pe,me,ae,C,ue,I,N]),ke=g((e=>{const t=N.filter((t=>t!==e));pe(t)}),[pe,N]),Ee=c((()=>!B&&!r&&(C?N.length>0:Boolean(X))),[B,r,C,X,N.length]),Ie=g((e=>{e.preventDefault(),e.stopPropagation();pe(C?[]:""),G(""),W(!1),H(!1),O(null),ae()}),[pe,ae,C]),Se=g((()=>{H(!1),W(!1),O(null),G(C?"":oe)}),[C,oe]),we=g((()=>{H(!0),W(!1),G(C?"":oe),ue()}),[C,ue,oe]),Be=g(((e,t)=>{r||!e&&C&&"item-press"===t?.reason||(H(e),e?(W(!1),G(C?"":oe),ue()):(W(!1),G(C?"":oe),O(null),D(!1)))}),[r,C,ue,oe]),xe=g(((e,t)=>{if(C&&"item-press"===t?.reason){if(G(""),Z){const e=Jh(_,"");O(e.length?vh(e,N,C):null)}}else if(W(!0),G(e),Z){const t=Jh(_,e);O(t.length?vh(t,N,C):null)}}),[Z,_,C,N]),Qe=g((e=>{O(e)}),[]),Me=g((e=>{$.length?O((t=>null===t?"down"===e?0:$.length-1:"down"===e?Math.min(t+1,$.length-1):Math.max(t-1,0))):O(null)}),[$.length]),be=e=>{"preventBaseUIHandler"in e&&e.preventBaseUIHandler()},ve=g((e=>{e.preventDefault(),be(e),Z?Me("ArrowDown"===e.key?"down":"up"):(Ao((()=>{H(!0),W(!1),G(C?"":oe)})),ue())}),[Z,Me,C,ue,oe]),Re=g((e=>{const t=null!==z?$[z]:void 0;if(t)return e.preventDefault(),be(e),void me(t);l&&K.trim()&&(e.preventDefault(),be(e),fe(K))}),[fe,$,l,me,z,K]),Le=g((e=>{if(!("ArrowDown"===e.key||"ArrowUp"===e.key)||r)return"Tab"===e.key&&Z?(H(!1),void ae()):"enter"!==F||"Enter"!==e.key||Z||e.ctrlKey||e.metaKey||e.altKey?void("Enter"===e.key&&Z?Re(e):(ne(e,(()=>{H(!1),ae()}),Z),E?.(e))):(e.preventDefault(),e.stopPropagation(),void re(e));ve(e)}),[r,ve,re,ne,Re,Z,ae,F,E]),ye=g((e=>{const t=e.relatedTarget;window.setTimeout((()=>{if(t&&(Y.current?.contains(t)||V.current?.contains(t)))return;const e=document.activeElement;Y.current?.contains(e)||V.current?.contains(e)||(Z&&(l&&K.trim()&&fe(K),Se()),D(!1))}),0),m?.(e)}),[Se,fe,l,K,Z,m]),Fe=g((e=>{e.preventDefault(),e.stopPropagation(),r||(Z?(Se(),D(!1)):(we(),D(!0),le.current?.focus()))}),[Se,r,le,Z,we]);u((()=>{Z||(G(C?"":oe),W(!1))}),[Z,C,oe]),u((()=>{q.current=null!==z?$[z]:void 0}),[$,z]);const Ue=c((()=>{if(!I.length&&!N.length)return e("option",{value:"",disabled:!0,children:"No Options"});const o=new Set(I.map(Qh)),r=N.filter((e=>!o.has(e)));return t(i,{children:[C?null:e("option",{value:"",children:"Select Option"}),I.map((t=>e("option",{value:Qh(t),children:xh(t)},Qh(t)))),r.map((t=>e("option",{value:t,children:t},t)))]})}),[C,I,N]),De=g((e=>{T.current=e,"function"==typeof J?J(e):J&&(J.current=e)}),[J]),Ze=g(((e,t)=>!t.trim()||No({data:[e],fieldsToSearch:["label"],term:t.toLowerCase()}).length>0),[]),He=L,Ke=R,Ge=C&&a,Ye={width:"var(--anchor-width)",minWidth:"var(--anchor-width)",maxWidth:"var(--anchor-width)"},Ve=lh(L),je=ah(L,r),We=nh(x),qe=c((()=>sh(Ve)),[Ve]),ze=c((()=>dh(x,"autocomplete")),[x]),Oe=c((()=>({...Ch(je,x),flex:1,minWidth:C?"80px":0,cursor:r?"default":"text"})),[r,je,C,x]);return t(ch,{title:n??"",position:"top",delay:50,children:[e("style",{children:qe}),e("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",...o},children:t(co.Root,{items:_,value:K,onValueChange:xe,open:Z,onOpenChange:Be,disabled:r,name:d,autoHighlight:!1,keepHighlight:!0,virtualized:Ce,openOnInputClick:!0,filter:Ze,filteredItems:$,itemToStringValue:xh,onItemHighlighted:(e,t)=>{q.current=e,t.index>=0&&O(t.index)},children:[t("div",{ref:Y,style:{display:"flex",alignItems:"center",flexWrap:C?"wrap":"nowrap",gap:C?We.multipleGap:void 0,border:`2px solid ${de}`,background:L[600],position:"relative",width:"100%",...ze},children:[C?N.map((t=>e(Dh,{iron:He,size:x,label:Ae(t),onRemove:()=>{ke(t)}},t))):null,e(co.Input,{ref:se,disabled:r,className:ih,placeholder:C&&X?.length?"":S||`Select ${A??"Option"}`,onClick:e=>{e.stopPropagation()},onFocus:e=>{e.stopPropagation(),D(!0),r||Z||document.activeElement!==e.currentTarget||we()},onBlur:ye,onKeyDown:Le,style:Oe}),Ee?e("button",{type:"button",tabIndex:-1,"aria-label":"Clear selection",onMouseDown:e=>{e.preventDefault()},onClick:Ie,style:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"none",background:"transparent",padding:0,marginLeft:We.expandMarginLeft,cursor:"pointer",color:L[400]},children:e(Te,{sx:{fontSize:We.expandIconSize-4}})}):null,e("button",{type:"button",tabIndex:-1,"aria-label":Z?"Close options":"Open options",disabled:r,onMouseDown:e=>{e.preventDefault()},onClick:Fe,style:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"none",background:"transparent",padding:0,marginLeft:We.expandMarginLeft,cursor:r?"not-allowed":"pointer",color:r?L[800]:L[400]},children:e(Je,{sx:{fontSize:We.expandIconSize,transform:Z?"rotate(180deg)":"none",transition:"transform 0.2s ease"}})}),e("select",{...b,ref:De,name:d,value:C?void 0:X,multiple:C,disabled:r,required:w,tabIndex:-1,"aria-hidden":!0,style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0,pointerEvents:"none"},children:Ue})]}),e(co.Portal,{children:e(co.Positioner,{anchor:Y,sideOffset:2,align:"start",style:{zIndex:999,...Ye},children:t(co.Popup,{ref:V,style:{...Ye,background:L[600],border:`1px solid ${L[300]}`,boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1)",borderRadius:"4px",overflow:"hidden"},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:[e(co.Empty,{children:e("div",{style:{padding:We.padding,fontSize:We.fontSize,color:L[800]},children:"No Options"})}),e(Uh,{butterflyBlue:Ke,highlightedIndex:z,iron:He,isAllSelected:te,isShowSelectAll:s,isSomeSelected:ie,onHighlightIndex:Qe,onSelectOption:me,selectedValuesSet:ee,showCheckbox:Ge,virtualized:Ce})]})})})]})})]})}));Zh.displayName="SmartAutoCompleteFieldComponent";const Hh=B(Zh,(({name:e,value:t,disabled:i,options:o,errorMessage:r,freeSolo:n,multiple:l,isShowSelectAll:a,isShowCheckbox:s,placeholder:C,required:d,disableClearable:A,size:c},{name:h,value:p,disabled:u,options:g,errorMessage:m,freeSolo:f,multiple:k,isShowSelectAll:E,isShowCheckbox:I,placeholder:S,required:w,disableClearable:B,size:x})=>e===h&&t===p&&i===u&&o===g&&r===m&&n===f&&l===k&&a===E&&s===I&&C===S&&d===w&&A===B&&c===x));Hh.displayName="SmartAutoCompleteField";const Kh=k((({errorMessage:t,onKeyDown:i,...o},r)=>{const n=P(),{type:l,disabled:a}=o,{butterflyBlue:s,lipstickRed:C,iron:d}=n.palette.app.color,[A,p]=h(!1),{navigationKey:u}=Fo(),{handleEnterNavigation:g}=ir({navigationKey:u}),m=c((()=>a?d[700]:A?s[900]:t?C[900]:d[800]),[a,t,A]);return e(ch,{title:t??"",position:"top",delay:50,children:e("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"},children:e("div",{style:{display:"flex",alignItems:"center",border:"checkbox"===l?"none":`2px solid ${m}`,borderRadius:"4px",padding:"4px 8px",background:a?d[50]:"white",minHeight:"20px"},children:e("input",{ref:r,...o,style:{width:"100%",border:"none",background:"transparent",padding:"0",fontSize:"13px",outline:"none"},onClick:e=>e.stopPropagation(),onFocus:e=>{e.stopPropagation(),p(!0)},onBlur:e=>{e.stopPropagation(),p(!1)},onKeyDown:e=>{"enter"!==u||"Enter"!==e.key||"checkbox"===l||e.ctrlKey||e.metaKey||e.altKey||g(e),i?.(e)}})})})})}));Kh.displayName="SmartTextFieldComponent";const Gh=B(Kh,((e,t)=>e.name===t.name&&e.value===t.value&&e.checked===t.checked&&e.disabled===t.disabled&&e.type===t.type&&e.errorMessage===t.errorMessage));Gh.displayName="SmartTextField";const Yh=k((({errorMessage:i,onKeyDown:o,onFocus:r,onBlur:n,style:l,className:a,size:s="md",...C},d)=>{const A=P(),{type:p,disabled:u,name:m}=C,{butterflyBlue:f,lipstickRed:k,iron:E}=A.palette.app.color,I=lh(E),S=ah(E,u),[w,B]=h(!1),{navigationKey:x}=Fo(),{handleEnterNavigation:Q,setInputRef:M}=ir({navigationKey:x}),b="checkbox"===p,J=c((()=>i?k[900]:w?f[900]:E[800]),[f,i,E,w,k]),v=c((()=>sh(I)),[I]),R=c((()=>dh(s,"text")),[s]),L=c((()=>({...Ch(S,s),...l})),[s,l,S]),y=[ih,a].filter(Boolean).join(" "),F=g((e=>{b||M(e),"function"==typeof d?d(e):d&&(d.current=e)}),[b,d,M]),U=e=>{"enter"!==x||"Enter"!==e.key||b||e.ctrlKey||e.metaKey||e.altKey||Q(e),o?.(e)},D=e=>{e.stopPropagation(),B(!0),r?.(e)},Z=e=>{e.stopPropagation(),B(!1),n?.(e)},H=e(b?"input":so,{ref:F,...C,disabled:u,className:y,style:L,onClick:e=>{e.stopPropagation()},onFocus:D,onBlur:Z,onKeyDown:U});return t(ch,{title:i??"",position:"top",delay:50,children:[b?null:e("style",{children:v}),e(ao.Root,{disabled:u,name:m,style:{width:"100%"},children:e("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"},children:e("div",{style:{display:"flex",alignItems:"center",border:b?"none":`2px solid ${J}`,background:E[600],width:"100%",...R},children:H})})})]})}));Yh.displayName="SmartTextFieldV2Component";const Vh=B(Yh,(({name:e,value:t,checked:i,disabled:o,type:r,size:n,errorMessage:l,placeholder:a},{name:s,value:C,checked:d,disabled:A,type:c,size:h,errorMessage:p,placeholder:u})=>e===s&&t===C&&i===d&&o===A&&r===c&&n===h&&l===p&&a===u));function Th({items:i,disabled:o=!1,avoidDeleteFocus:n=!1}){const[l,a]=h(null),s=!!l,d=J(),A=d.palette.app.color.red?.[900]??d.palette.error.main,g=p(null),m=p([]),f=c((()=>(i??[]).filter((({isView:e})=>!e))),[i]),k=()=>a(null),E=e=>"delete"===e.toLowerCase();u((()=>{const e=g.current;if(!e)return;const t=t=>{o||"Enter"===t.key&&(t.preventDefault(),a(e))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[o]);const I=e=>{const t=m.current;if(!t.length)return;const i=document.activeElement,o=t.findIndex((e=>e===i)),r=-1!==o?o:1===e?-1:t.length;for(let i=1;i<=t.length;i++){const o=(r+i*e+t.length)%t.length,l=t[o],a=f[o]?.title??"";if(l&&(!n||!E(a)))return void l.focus()}};return u((()=>{s&&n&&f.length&&requestAnimationFrame((()=>I(1)))}),[n,f.length,s]),f.length?t(M,{sx:{width:"100%"},children:[e(r,{ref:g,component:"div",sx:{width:"100%",cursor:"pointer",alignItems:"center"},onClick:e=>{o||a(e.currentTarget)},disabled:o,"data-clickable":"true",children:e(Ae,{})}),l&&e(ce,{open:!0,anchorEl:l,onClose:k,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{onKeyDown:e=>{n&&("ArrowDown"===e.key&&(e.preventDefault(),I(1)),"ArrowUp"===e.key&&(e.preventDefault(),I(-1)))}}},children:e(Kl,{padding:{padding:"2px"},children:f.map((({title:t,onClick:i,href:o},r)=>{const l=E(t);return e(M,{children:e(le,{...o?{component:C,href:o,prefetch:!1}:{},ref:e=>{m.current[r]=e},sx:{borderRadius:"4px",color:l?A:void 0,width:"100%",textAlign:"start",padding:"5px 16px 5px 10px"},tabIndex:l&&n?-1:0,onClick:()=>{i?.(),k()},children:e(q,{variant:"body1",children:t})})},t)}))})})]}):null}Vh.displayName="SmartTextFieldV2";const jh=({orientation:t="horizontal",activeStep:i=0,stepLabelProps:o={},steps:r,errorSteps:n=[],onStepClick:l,showActiveStepIcon:a,showTooltips:s=!1,showStepLabels:C=!0,...d})=>{const A=J(),{butterflyBlue:c,red:h}=A.palette.app.color;return e(M,{children:e(go,{activeStep:i,orientation:t,...d,children:r.map(((t,i)=>{const r=n.includes(i),a=e(uo,{...o,error:r,sx:{cursor:l?"pointer":"default",".Mui-active .MuiStepIcon-root":{color:`${c[900]} !important`},".Mui-completed .MuiStepIcon-root":{color:`${c[900]} !important`},...r&&{".MuiStepIcon-root":{color:`${h[900]} !important`},".MuiStepLabel-label":{color:`${h[900]} !important`}},...o.sx},onClick:()=>(e=>{l&&l(e)})(i),children:C&&e(q,{variant:"body2",children:t})});return e(po,{children:s?e(W,{title:t,placement:"top",children:a}):a},t)}))})})},Wh=v(mo)((({theme:e})=>({[`&.${fo.alternativeLabel}`]:{top:10,left:"calc(-50% + 16px)",right:"calc(50% + 16px)"},[`&.${fo.active}`]:{[`& .${fo.line}`]:{borderColor:"#784af4"}},[`&.${fo.completed}`]:{[`& .${fo.line}`]:{borderColor:"#784af4"}},[`& .${fo.line}`]:{borderColor:"#eaeaf0",borderTopWidth:3,borderRadius:1,...e.applyStyles("dark",{borderColor:e.palette.grey[800]})}}))),qh=v("div")((({theme:e})=>({color:"#eaeaf0",display:"flex",height:22,alignItems:"center","& .QontoStepIcon-completedIcon":{color:"#784af4",zIndex:1,fontSize:18},"& .QontoStepIcon-circle":{width:8,height:8,borderRadius:"50%",backgroundColor:"currentColor"},...e.applyStyles("dark",{color:e.palette.grey[700]}),variants:[{props:({ownerState:e})=>e.active,style:{color:"#784af4"}}]})));function zh(t){const{active:i,completed:o,className:r}=t;return e(qh,{ownerState:{active:i},className:r,children:o?e(je,{className:"QontoStepIcon-completedIcon"}):e("div",{className:"QontoStepIcon-circle"})})}const Oh=({steps:t,alternativeLabel:i=!0,stepLabelProps:o={},...r})=>e(a,{sx:{width:"100%"},spacing:4,children:e(go,{alternativeLabel:i,activeStep:1,connector:e(Wh,{}),...r,children:t.map((t=>e(po,{children:e(uo,{StepIconComponent:zh,...o,children:t})},t)))})}),Ph=({orientation:o="horizontal",activeStep:r=0,stepLabelProps:n={},steps:l,...s})=>{const C=J(),{butterflyBlue:d}=C.palette.app.color;return e(M,{children:e(go,{activeStep:r,orientation:o,...s,children:l.map(((o,r)=>e(po,{children:e(uo,{...n,sx:{".Mui-active .css-18pqgpd-MuiSvgIcon-root-MuiStepIcon-root":{color:`${d[900]} !important`},".Mui-completed .MuiStepIcon-root":{color:`${d[900]} !important`},".MuiStepIcon-text":{color:"transparent !important",display:"none"}},children:e(a,{children:t(i,o?.in_time?{children:[e(q,{variant:"caption",children:"In at"}),e(q,{variant:"caption",children:o?.in_time})]}:{children:[e(q,{variant:"caption",children:"Out at"}),e(q,{variant:"caption",children:o?.out_time})]})})})},r)))})})},Nh=()=>e(M,{flex:1,children:e(Se,{height:"30px",sx:{maxWidth:"200px",transform:"scale(1)"}})}),Xh={small:{minHeight:"36px !important",height:"36px !important",fontSize:"12px !important",padding:"10px 5px !important"},medium:{minHeight:"48px !important",height:"48px !important",fontSize:"13px !important",padding:"12px 16px !important"},large:{minHeight:"52px !important",height:"52px !important",fontSize:"14px !important",padding:"14px 18px !important"}},_h={small:{minHeight:"36px !important",height:"36px !important"},medium:{minHeight:"48px !important",height:"48px !important"},large:{minHeight:"52px !important",height:"52px !important"}},$h=({tabs:t,value:i,loading:o,tabProps:r,role:n,size:l="medium"})=>o?e(a,{gap:"10px",direction:"row",children:t.map((()=>e(Nh,{},ti())))}):e(Eo,{value:i,role:n,sx:{..._h[l],"& .MuiTabs-scroller":{minHeight:"inherit",height:"inherit"},"& .MuiTabs-flexContainer":{minHeight:"inherit",height:"inherit"},"& .MuiTab-root.MuiButtonBase-root":{...Xh[l]}},children:t.filter((({isView:e})=>!1!==e)).map((({iconPosition:t="end",toolTipLabel:i="",icon:n,href:l,target:a,...s},d)=>{const A=l?{component:C,href:l,target:a,prefetch:!1}:{},c=ye(s,["isView"]);return I(ko,{...A,key:c.value??d,icon:i?e(El,{toolTipLabel:i,placement:"bottom",children:n}):n,disabled:o,iconPosition:t,...c,...r})}))});function ep({label:i,value:o,menu:r,trimLabel:n=!0,activeTab:l,index:s,onArrowClick:d,menuAnchor:A,onAction:c,href:h,target:p,...u}){const g=J(),{butterflyBlue:m}=g.palette.app.color,f=o===l.value,k=i.toLowerCase().replaceAll(/[ _]/g,"-"),E=Bo(i,{length:n?15:i.length,omission:n?"...":""}),I={title:"Edit",onClick:()=>c&&c("editTemplate",l)},S={title:"Delete",onClick:()=>c&&c("deleteTemplate",l)},w=h?{component:C,href:h,target:p,prefetch:!1}:{},B={iconPosition:"end","data-cy":k,"data-ptag":k,value:o??s,label:t(a,{direction:"row",gap:"6px",alignItems:"center",children:[e(q,{variant:"body1",sx:{whiteSpace:"nowrap"},children:f?i:E}),f&&s>0&&e(Vl,{items:[I,S]})]})};return i.length>15&&!f&&(B.title=i),o===l.value&&r?.length&&(B.icon=e(oe,{onClick:d,id:`tabDropDown-${o}`,"aria-controls":null!==A?`dropDownMenu-${o}`:void 0,"aria-expanded":null!==A?"true":void 0,"aria-haspopup":"true","data-cy":`${k}-arrowicon`,"data-ptag":`${k}-arrowicon`})),e(ko,{sx:{borderBottom:"2px solid",borderBottomColor:f?m[900]:"white",overflow:"visible",[`&.${wo.root}`]:{minHeight:"40px",height:"40px",paddingLeft:f&&s>0?"15px":"10px"},"&:hover":{backgroundColor:m[500]}},...B,...w,...u})}function tp({tabs:t,activeTab:o,menuAnchor:r,onClose:a,onMenuItemClick:s}){return e(i,{children:t.filter((e=>!!e.menu)).map((t=>e(n,{anchorEl:r,open:t.value===o.value&&!!r,onClose:a,id:`dropDownMenu-${t.value}`,MenuListProps:{"aria-labelledby":`tabDropDown-${t.value}`},children:t.menu?.map((({label:t,disabled:i,onClick:r,href:n,target:a})=>e(l,{onClick:()=>{s(),r(o)},disabled:i,...n?{component:C,href:n,target:a,prefetch:!1}:{},children:t},t)))},t.value)))})}function ip({tabs:i,onChange:o,addButton:r,actionButton:n,ariaLabel:l,activeIndex:s=0,onAction:C}){const d=J(),[A,c]=h(i[s]),[p,g]=h(null);u((()=>{-1===i.findIndex((e=>e.value===A.value))&&(o&&i[0]&&o(i[0]),c(i[0]))}),[i,A,o]),u((()=>{c(i[s])}),[s]);return t(M,{children:[e(tp,{activeTab:A,tabs:i,onClose:()=>g(null),onMenuItemClick:()=>g(null),menuAnchor:p}),t(a,{direction:"row",justifyContent:"space-between",sx:{borderBlockEnd:"solid 1px",borderColor:d.palette.app.color.iron[700]},children:[t(a,{direction:"row",gap:"5px",alignItems:"center",overflow:"hidden",children:[e(a,{direction:"row",overflow:"hidden",children:e(Eo,{value:i.some((e=>e.value===A.value))?A.value:i[0]?.value,onChange:(e,t)=>{const r=i.find((e=>e.value===t));r&&(c(r),o&&r&&o(r))},TabIndicatorProps:{sx:{display:"none"}},sx:{[`&.${Io.root}`]:{minHeight:"40px",height:"40px"}},variant:"scrollable",scrollButtons:"auto",ScrollButtonComponent:So,"aria-label":l??"Tabs",children:i.map(((t,i)=>e(ep,{index:i,activeTab:A,onArrowClick:e=>{g(e.target)},onAction:C,menuAnchor:p,...t},t.value)))})}),r]}),e(a,{direction:"row",gap:"10px",alignItems:"center",justifyContent:"space-between",children:n})]})]})}const op=({variant:i,leaveColor:o,toolTipLabel:r})=>{const n=vo(i);return t(a,{sx:{position:"relative",width:"100%",alignItems:"center"},children:[e(M,{sx:{position:"absolute",backgroundColor:"#ffffff",border:`1px solid ${o??n}`,borderRadius:"7px",padding:"0px 5px",zIndex:1,color:`${o??n}`,height:"28px",display:"flex",alignItems:"center",cursor:"pointer"},children:e(El,{toolTipLabel:r,children:Ro(i)})}),e(ui,{valueLabelDisplay:"off",value:[0,2],max:2,step:1,sx:{"& .MuiSlider-track":{background:`${o??n}`,height:"2px",border:"none"},"& .MuiSlider-thumb":{backgroundColor:`${o??n}`,height:8,width:8},"& .MuiSlider-rail":{backgroundColor:"transparent"}}})]})},rp=({totalDots:i,intervals:o,startTimeline:r})=>e(M,{sx:{position:"relative",width:"100%",height:4},children:o?.map(((o,n)=>{const l=Ko(o.in_time),s=Ko(o.out_time),C=U.fromISO(o.in_time),d=U.fromISO(o.out_time).diff(C,["hours","minutes"]).toFormat("hh:mm");let A=np(l),c=np(s);const h=!isNaN(A),p=!isNaN(c);h&&A<r&&(A+=i),p&&(c<r&&(c+=i),h&&c<A&&(c+=i));let u="",g="";h&&(u=`In time : ${l} ${p?"":" / Missing punch"}`),p&&(g=`Out time : ${s} ${h?"":"/ Missing punch"}`);const m=o?.name??`In/Out: ${Ko(o.in_time)} - ${Ko(o.out_time)} (${d})`,f=o?.color??vo(o.status_type),k=h?(A-r)/i*100:0,E=p?(c-r)/i*100:0,I=h&&p?Math.max(E-k,0):0;return t(a,{direction:"row",children:[h&&e(W,{arrow:!0,title:u,placement:"top",children:e(M,{sx:{height:8,width:8,position:"absolute",left:`${k}%`,boxShadow:"none",backgroundColor:f,borderRadius:"50%",top:"15px",zIndex:3,"&:focus, &:hover, &:active":{boxShadow:"none"}}})}),h&&p&&e(W,{arrow:!0,title:m,placement:"top",children:e(M,{sx:{position:"absolute",left:`${k}%`,width:`${I}%`,height:3.5,top:"17.5px",backgroundColor:f,zIndex:2}})}),p&&e(W,{arrow:!0,title:g,placement:"top",children:e(M,{sx:{height:8,width:8,position:"absolute",left:`${E}%`,boxShadow:"none",backgroundColor:f,borderRadius:"50%",top:"15px",zIndex:3,"&:focus, &:hover, &:active":{boxShadow:"none"}}})})]},n)}))}),np=e=>{const t=U.fromFormat(e,"HH:mm");return t.hour+t.minute/60},lp=({totalDots:i,highlightedIntervals:o,shiftStartTime:r,shiftEndTime:n,startTimeline:l="2024-11-17T18:30:04.000Z"})=>{const s=parseFloat(Ko(l)),C=(e,t,o)=>{const r=Ko(e),n=Ko(t);let l=np(r),a=np(n);return l=l<s?l+i:l,a=a<l?a+i:a,"END"===o?a:l},d=e=>{const t=(e+s)%i;return o.some((e=>t>=parseFloat(Ko(e.in_time))&&t<=parseFloat(Ko(e.out_time))))},A=Array.from({length:i},((e,t)=>({value:(t+s)%i,label:"",highlighted:d((t+s)%i)})));return t(a,{sx:{position:"relative",width:"100%"},children:[e(rp,{totalDots:i,intervals:o,startTimeline:s}),e(W,{title:`Shift Start: ${Ko(r)}`,arrow:!0,placement:"top",children:e(M,{sx:{cursor:"pointer",position:"absolute",top:"12px",zIndex:2,left:(C(r,n,"START")-s)%i/i*100+"%"},children:e(Dr,{})})}),e(W,{title:`Shift End: ${Ko(n)}`,arrow:!0,placement:"top",children:e(M,{sx:{cursor:"pointer",position:"absolute",top:"12px",zIndex:2,left:(C(r,n,"END")-s)%i/(i-.6)*100+"%"},children:e(Dr,{})})}),e(ui,{disabled:!0,valueLabelDisplay:"off",marks:A,max:i-1,step:1,value:[],sx:{zIndex:1,"& .MuiSlider-track":{background:"transparent",height:1,border:"none"},"& .MuiSlider-mark":{backgroundColor:"gray",height:4,width:4,borderRadius:"50%"},"& .MuiSlider-markActive":{backgroundColor:"transparent",height:5,width:5},"& .MuiSlider-rail":{height:2,backgroundColor:"#929292"},"& .MuiSlider-thumb":{display:"none"}}})]})},ap=v(se,{shouldForwardProp:e=>"isParent"!==e&&"borderColor"!==e&&"backgroundColor"!==e&&"baseColor"!==e})((({theme:e,isParent:t,borderColor:i,backgroundColor:o,baseColor:r})=>({width:"auto",minWidth:0,padding:e.spacing(1),borderRadius:12,border:`1px solid ${i}`,boxShadow:t?`0 6px 18px ${y(r,.2)}`:"none",backgroundColor:o,display:"flex",alignItems:"center",gap:e.spacing(1),minHeight:40,overflow:"hidden",flex:"1 1 auto",[e.breakpoints.down("sm")]:{flex:"1 1 100%"}}))),sp=({node:i,innerRef:o,isParent:r=!1,themeColor:n})=>{const{id:l,title:a,subtitle:s,value:C}=i,d=J(),{butterflyBlue:A,slate:c}=d.palette.app.color,h=n??A[900],p=r?h:y(h,.7),u=r?y(h,.1):"none",g=c[900];return t(ap,{elevation:r?3:0,ref:o,isParent:r,borderColor:p,backgroundColor:u,baseColor:h,children:[t(M,{children:[e(q,{variant:"subtitle2",noWrap:!0,children:a}),e(q,{variant:"subtitle2",color:g,noWrap:!0,children:s})]}),e(Kl,{padding:{paddingLeft:1},children:e(M,{sx:{ml:"auto",textAlign:"right"},children:e(q,{noWrap:!0,variant:"body2",children:C})})})]},l)},Cp=({node:i,setRef:o,themeColor:r,itemWidth:n})=>{const{id:l,children:s}=i,C=!!s?.length;return t(M,{sx:{display:"flex",gap:3,alignItems:"flex-start",flex:`1 0 ${n}`},children:[e(sp,{node:i,isParent:C,innerRef:e=>o(l,e),themeColor:r}),C&&e(a,{spacing:1,sx:{mt:.5},children:de(s,(t=>e(Cp,{node:t,setRef:o,themeColor:r,itemWidth:n},t.id)))})]},l)},dp=({node:i,setRef:o,themeColor:r})=>{const{id:n,children:l}=i,s=!!l?.length;return t(a,{gap:1,children:[e(sp,{node:i,isParent:s,innerRef:e=>o(n,e),themeColor:r}),s&&e(Kl,{padding:{paddingLeft:3,paddingTop:1},children:e(a,{spacing:1,children:de(l,(t=>e(dp,{node:t,setRef:o,themeColor:r},t.id)))})})]},n)},Ap=({nodes:i,direction:o="horizontal",columns:r=3,color:n})=>{const{isMobile:l}=or(),s=p({}),C=p(null),d=p(null),A=p(null),[c,g]=h([]),m=(e,t)=>{if(t)return s.current[e]=t,void(A.current&&A.current.observe(t));s.current=ye(s.current,e)},f=e=>e?e.getBoundingClientRect():null,k=(e,t,i)=>{xo(e,(e=>{const{id:r,children:n}=e;if(!n?.length)return;const a=s.current[r];if(!a)return;const C=f(a);C&&xo(n,(e=>{const{id:r,children:n}=e,a=s.current[r];if(!a)return;const d=f(a);if(!d)return;const A=l||"vertical"===o?((e,t,i)=>{const{left:o,width:r,bottom:n}=e,{left:l,width:a,top:s}=t,{left:C,top:d}=i,A=o+r/2-C,c=n-d,h=l+a/2-C,p=s-d,u=c+Math.max(12,(p-c)/2);return`M ${A} ${c} C ${A} ${u} ${h} ${u} ${h} ${p}`})(C,d,t):((e,t,i)=>{const{right:o,top:r,height:n}=e,{left:l,top:a,height:s}=t,{left:C,top:d}=i,A=o-C,c=r+n/2-d,h=l-C,p=a+s/2-d,u=h-A,g=Math.abs(u),m=Math.min(120,Math.max(24,g/2)),f=u>=0?1:-1;return`M ${A} ${c} C ${A+m*f} ${c} ${h-m*f} ${p} ${h} ${p}`})(C,d,t);i.push({definition:A}),n?.length&&k([e],t,i)}))}))};u((()=>{const e=()=>requestAnimationFrame((()=>{(()=>{const e=d.current,t=C.current;if(!e||!t)return;const o=t.clientWidth;e.setAttribute("width",String(o)),e.setAttribute("height","auto");const r=t.getBoundingClientRect(),n=[];k(i,r,n),g(n)})()})),t=e(),o=new ResizeObserver(e);A.current=o,C.current&&o.observe(C.current),Ze(s.current).forEach((e=>o.observe(e)));const r=e;return window.addEventListener("resize",r),()=>{cancelAnimationFrame(t),o.disconnect(),A.current=null,window.removeEventListener("resize",r)}}),[i,l,o]);const E=`calc(${100/r}% - 24px)`;return t(M,{ref:C,variant:"outlined",component:se,position:"relative",sx:{overflowX:"hidden",overflowY:"visible"},children:[e(qn,{ref:d,paths:c,strokeColor:n}),e(Kl,l||"vertical"===o?{padding:{padding:2},children:e(a,{spacing:3,children:de(i,(t=>e(dp,{node:t,setRef:m,themeColor:n},t.id)))})}:{padding:{padding:2},children:e(a,{direction:"row",alignItems:"flex-start",justifyContent:"flex-start",flexWrap:"wrap",gap:3,children:de(i,(t=>e(Cp,{node:t,setRef:m,themeColor:n,itemWidth:E},t.id)))})})]})},cp=v(xe)((({theme:e,color:t})=>{const i=((e,t)=>{if(!t||"default"===t)return e.palette.grey[500];const i=e.palette[t];return i&&"object"==typeof i&&"main"in i?i.main:e.palette.grey[500]})(e,t);return{"& .MuiBadge-badge":{backgroundColor:i,color:i,boxShadow:`0 0 0 2px ${e.palette.background.paper}`,"&::after":{position:"absolute",top:"-1px",left:"-1px",width:"100%",height:"100%",borderRadius:"50%",animation:"ripple 1.2s infinite ease-in-out",border:"1px solid currentColor",content:'""'}},"@keyframes ripple":{"0%":{transform:"scale(.8)",opacity:1},"100%":{transform:"scale(2.4)",opacity:0}}}}));v(n)((({theme:e})=>({[`& .${Mo.paper}`]:{boxShadow:e.palette.app.paperBoxShadow,minWidth:"29rem",width:"auto",margin:"0 0.5rem",borderRadius:"8px",overflow:"visible","& .MuiList-root":{padding:"0",overflow:"visible"}}})));const hp=v(r,{shouldForwardProp:e=>"isOpened"!==e})((({theme:e})=>({paddingInline:"0.3rem",paddingBlock:"0.2rem",borderRadius:"8px",color:e.palette.app.color.black[900]})));function pp({userDetails:o,menuItems:r,shouldCloseOnClick:n=!0,showBadge:l=!1,badgeColor:s="success"}){const[d,A]=h(null),c=p(null),{layout:u}=or(),g="desktop"===u,m=J(),{iron:f}=m.palette.app.color,k=Boolean(d),E=()=>A(null),{name:I,avatar:S}=o,w=e(we,{src:S,sx:{border:`1px solid ${f[700]}`,width:28,height:28}});return t(M,{position:"relative",children:[e(M,{sx:{display:"flex",alignItems:"center"},children:e(hp,{ref:c,onClick:e=>{A(e.currentTarget)},size:"small","aria-haspopup":"true",children:t(a,{direction:"row",alignItems:"center",gap:1,color:"black",children:[l&&e(cp,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},variant:"dot",color:s,children:w}),!l&&w,g&&t(i,{children:[e(q,{maxWidth:150,noWrap:!0,children:I}),e(k?ve:Je,{})]})]})})}),k&&e(ce,{open:!0,anchorEl:d,onClose:E,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{elevation:0,sx:{width:220,overflow:"visible",mt:1.5,px:0,py:0,filter:"drop-shadow(0px 2px 8px rgba(0,0,0,0.32))","& .MuiAvatar-root":{width:32,height:32,ml:-.5,mr:1},"&:before":{content:'""',display:"block",position:"absolute",top:0,right:14,width:10,height:10,bgcolor:"background.paper",transform:"translateY(-50%) rotate(45deg)",zIndex:0}}}},children:e(M,{sx:{padding:"4px 0"},children:r.map((({key:i,divider:o,label:r,icon:l,sx:s,onClick:d,href:A,target:c})=>{const h=A?{component:C,href:A,target:c,prefetch:!1}:{};return t(M,{children:[o&&e($,{}),e(le,{...h,onClick:()=>{te(d)&&(d(),n&&E())},children:(l||r)&&t(a,{gap:"16px",alignItems:"center",width:"100%",flexDirection:"row",sx:{...s},children:[e(Qo,{sx:{minWidth:"20px",alignItems:"center",...s},children:l}),r&&e(q,{sx:{fontSize:"13px"},children:r})]})})]},`${i}_container`)}))})})]})}export{Vd as ASPECT_RATIO_LABELS,Yd as ASPECT_RATIO_VALUES,Jr as ActionButton,br as ActionButtons,Tl as ActionButtonsWrapper,Vl as ActionCell,Il as AddIconAction,da as AgGrid,ul as AnnouncementBanner,Ua as AppBar,Nn as AppLogoMedium,Xn as AppLogoSmall,Dr as ArrowUp,Ur as ArrowUpRight,Oa as AttendanceCard,_n as AttendanceManagementDarkSvg,$n as AttendanceReportDarkSvg,op as AttendanceStatus,dC as Autocomplete,Da as Badge,Qs as BarChart,pl as BookMarkSvg,pC as BottomDialog,gC as BottomSheet,Os as BoxStyled,Za as BreadcrumbButtonWrapper,Ya as Breadcrumbs,el as BriefcaseSvg,tl as BulkOperationsDarkSvg,vr as Button,wC as ButtonContainer,Rr as ButtonGroup,Lr as ButtonLayoutProvider,Sl as CalendarIconAction,nl as CalendarSvg,Va as Card,Ta as CardItem,ja as CardItemValue,Bs as CellSelectionTable,ol as ChartIconSvg,RC as CheckBox,Ps as CheckStyled,bo as CheckboxInput,Rs as Chip,ys as ChipWithBorder,rl as ClockSvg,Zs as CodeSnippetBox,mc as ColumnArranger,kc as ColumnArrangerDialog,fc as ColumnArrangerForm,kl as ColumnArrangerSvg,wl as ColumnIconAction,ml as CommentIcon,Wr as CompanyBanner,Bl as ConfigureIconAction,BC as ContentBox,ed as CurrencyField,Hl as CurrentLocationAction,La as CustomEnumFilter,Wl as DEFAULT_AG_GRID_PERSIST_STORAGE_TYPE,qd as DEFAULT_ASPECT_RATIOS,Wd as DEFAULT_ENABLED_VARIANTS,Zd as DEFAULT_MAX_SIZE_MB,Hd as DEFAULT_MIN_RESOLUTION,Kd as DEFAULT_QUALITY_WARN_RESOLUTION,ll as DashboardIconSvg,DC as DatePicker,TC as DateRangePicker,zC as DateRangePickerField,Gc as DateRangePickerPopUp,jC as DateRangeSelector,XC as DateTimePicker,id as DecimalTextField,MC as DeleteDialog,xl as DeleteIconAction,AC as Dialog,JC as DialogSelect,dd as DownloadAction,Ql as DownloadIconAction,Ml as DownloadPrintAction,qr as DownloadSvg,Dc as Drawer,bl as EditIconAction,al as EmployeeManagementDarkSvg,sl as EmployeeReportsDarkSvg,kn as ExitIcon,Jl as ExportIconAction,ia as FacebookCircularProgress,cd as FileNames,Cd as FilePreview,SC as FilePreviewContainer,md as FileUpload,vl as FilterIconAction,Nc as FilterList,zc as FilterListV2,Ls as FilterPill,Fs as FilterPillV2,jc as FilterPopUpDateRangeWrapper,Yc as FilterPopup,Tc as FilterPopupWrapper,Pc as FilterTypeWrapper,hn as FormAction,Fr as FormActionButton,mC as FormContainer,fC as FormGridLayout,EC as FormRow,IC as FormSection,QC as GridProvider,fl as GroupIcon,Xc as HighlightedText,Rl as HistoryIconAction,il as HolidayCalendarSvg,Cl as HomePageBanner,vd as ImageUpload,Rd as ImageUploadView,pn as ImportExcelSuccessIcon,Ll as ImportIconAction,En as InboxIcon,yl as InboxIconAction,_c as Indicator,Gd as JPEG_COMPRESS_QUALITY,Zl as KeyBoardIconAction,Ld as LOGO_ACCEPTED_TYPES,yd as LOGO_ACCEPT_ATTRIBUTE,Fd as LOGO_EXTENSION_MIME_MAP,bA as LOGO_SIZE_TOKENS,jd as LOGO_VARIANT_SIZES,un as LeaveIcon,FC as LeftArrowIcon,gl as LikeIcon,bs as LineChart,TA as ListItemButton,va as LoadingCell,oa as LoadingOverlay,gn as LoanIcon,In as LogoIcon,YA as LogoPicker,UA as LogoViewDialog,wh as MAX_LIST_HEIGHT,zr as MasterIcon,xC as MasterPageLayout,dl as MiscellaneousManagementDarkSvg,yo as NavigationKeyProvider,Do as NavigationRouterProvider,Sn as NoDataFoundSvg,ra as NoDataOverlay,sp as Node,Ih as OPTION_ROW_HEIGHT,mn as OvertimeIcon,Td as PRIMARY_SIZE_BY_RATIO,Kl as PadBox,eh as Pagination,OA as PasswordField,Al as PayrollManagementDarkSvg,cl as PayrollReportDarkSvg,XA as PhoneInputField,Md as PhotoCaptureDialog,vs as PieChart,th as PrintDownloadActions,Fl as ProcessIconAction,Wa as ProfileCard,qa as ProfileCardBody,za as ProfileCardHeader,ec as RadioGroupField,oc as Rating,Ra as RedirectionCell,UC as RightArrowIcon,Bh as SELECT_ALL_VALUE,ih as SMART_FIELD_INPUT_CLASS,nd as SUPPORTED_DOC_FORMATS,ld as SUPPORTED_EXCEL_FORMATS,Wo as SUPPORTED_FILE_TYPES,od as SUPPORTED_IMAGE_FORMATS,rd as SUPPORTED_PDF_FORMATS,fn as SalaryIcon,bC as SaveDialog,rc as SearchField,sc as Select,Or as SettingIcon,$c as SeverityIndicator,Kc as SideDrawer,Hh as SmartAutoCompleteField,gh as SmartCurrencyField,fh as SmartDialogSelect,Th as SmartGridActionCell,Ic as SmartLink,Eh as SmartSelectField,Gh as SmartTextField,Vh as SmartTextFieldV2,ch as SmartTooltip,yr as SplitButton,jh as Stepper,Oh as StepperV2,Ph as StepperV3,nc as StickySearchField,wn as SvgAccessDenied,Pr as SvgAccount,Bn as SvgAdd,xn as SvgAddRounded,Zr as SvgArrival,Nr as SvgBankConfig,qn as SvgBranches,Qn as SvgCalendar,Mn as SvgColumn,Xr as SvgConfiguration,bn as SvgConfigure,hl as SvgCurrentLocation,Jn as SvgDelete,Hr as SvgDeparture,an as SvgDevices,vn as SvgDownload,Rn as SvgDrop,Dn as SvgEdit,zn as SvgEmail,sn as SvgEmployeeOnboarding,_r as SvgEmployees,ln as SvgEngage,$r as SvgExpenses,Ln as SvgExport,Fn as SvgFilterList,yn as SvgFilteredList,An as SvgHelpDesk,Un as SvgHistory,Kr as SvgHoliday,Zn as SvgHome,Hn as SvgImport,On as SvgIndicator,Kn as SvgKeyBoard,Gr as SvgLeaveCalendar,en as SvgLetteremplate,Gn as SvgNoLogo,Yn as SvgNoSign,tn as SvgOrganization,Vn as SvgPageNotFound,on as SvgPayroll,Pn as SvgPhone,Tn as SvgProfile,jn as SvgReGenerate,rn as SvgStock,cn as SvgTasks,Cn as SvgTeam,nn as SvgTransaction,Yr as SvgUnverifieduser,Vr as SvgUser,Tr as SvgVerifiedUser,Wn as SvgView,dn as SvgVisitors,jr as SvgWeekoffCalendar,dc as SwitchField,ep as Tab,ip as TabBar,$h as Tabs,tp as TabsMenus,zA as TextField,wr as Theme,cc as TimeField,pc as TimePicker,lp as Timeline,Gs as Toaster,El as Tooltip,Ap as Tree,pp as UserProfileMenu,Sh as VIRTUALIZE_THRESHOLD,Ul as ViewDetailsIconAction,Ad as ViewFilePreviewDialog,Dl as ViewIconAction,cr as accessorFnRegex,Qr as appTheme,Nl as buildAgGridPersistedState,Qa as calculateSummaryRow,$l as clearAgGridPersistedState,fr as colorPaletteUI,yC as dateFormats,aa as defaultPageSize,RA as detectLogoShape,Vo as downloadFile,jo as downloadPrintHtml,dr as emailRegex,Xo as errorMessages,gd as error_with_transaltion,ya as extractPrefixedValue,ts as extractSortValue,No as filterByFields,Jh as filterOptionsByQuery,Ea as flattenColumns,Ho as formatDate,qc as formatFilterData,Yo as formatHours,zl as getAgGridPersistStorage,ql as getAgGridPersistStorageKey,Ol as getAgGridPersistedState,np as getArrowValue,vo as getColorByVariant,vA as getDefaultPreviewLimits,Go as getDifferenceInHHmmss,JA as getEditFrameSize,_o as getErrorProps,Wc as getFormValue,vh as getInitialHighlightIndex,LA as getLogoFrameSize,Ud as getLogoMimeFromFileName,os as getNextSortDirection,xh as getOptionLabelText,Qh as getOptionValueText,Br as getPaletteByTheme,Ch as getSmartFieldInputStyles,lh as getSmartFieldPlaceholderColor,sh as getSmartFieldPlaceholderCss,nh as getSmartFieldSizeConfig,ah as getSmartFieldTextColor,dh as getSmartFieldWrapperStyles,Ro as getStatusLabel,Ko as getTimeInHHmm,zd as getVariantsForAspectRatio,Oo as getZIndex,pr as highlightWordsRegex,Po as hslToRgb,hr as hslaRegex,qo as isFileSizeValid,sd as isFileType,zo as isFileTypeValid,Dd as isLogoAcceptedType,Mh as isSelectAllOption,ns as isSelectionDisabled,rs as isSortingEnabled,Od as isSvgFile,sr as isoDateRegex,yA as loadImageNaturalSize,ar as monthYearRegex,Cr as noSpecialCharacterRegex,bh as normalizeToStringArray,ur as numericRegex,sa as pageSizeOptions,er as parseCellValue,$o as parseNumericValue,td as predefinedOptions,Xl as restoreAgGridFilterState,_l as restoreAgGridPaginationState,Jo as serverityOptions,Pl as setAgGridPersistedState,la as showNoRowsOverlay,is as sortTableData,Ar as timeRegex,Ws as toasts,Mr as urlToNestedObject,ca as useAgGridCheckBoxSelection,ha as useAgGridFilteredData,ga as useAgGridKeyboardShortcuts,ea as useAgGridPersist,ta as useAgGridPersistReset,ma as useAgGridRowSelectionConfig,Ja as useAgGridSelection,Ma as useAgGridSummaryRow,ba as useAgGridSummaryRowUpdate,tr as useDialogActions,ir as useFormFieldFocus,or as useGetDeviceType,rr as useGlobalKeyboardShortcut,Fo as useNavigationKeyContext,Zo as useNavigationRouter,lr as useParseHref,$a as useRowSelection,ls as useSorting,nr as useZoomLevel};
|
|
23
|
+
`,lA=v(M)((({theme:e})=>{const{iron:t,butterflyBlue:i}=e.palette.app.color,{white:o}=e.palette.common;return{display:"inline-flex",alignItems:"center",gap:"2px",padding:"4px",borderRadius:"12px",background:o,border:`1px solid ${y(i[900],.14)}`,boxShadow:`\n 0 12px 32px ${y(t[900],.28)},\n 0 4px 12px ${y(t[900],.18)},\n 0 1px 3px ${y(t[900],.12)}\n `,backdropFilter:"blur(10px)",animation:`${rA} 220ms cubic-bezier(0.22, 1, 0.36, 1)`,position:"relative","&::before":{content:'""',position:"absolute",top:-5,left:"50%",width:10,height:10,background:o,border:`1px solid ${y(i[900],.14)}`,borderBottom:"none",borderRight:"none",transform:"translateX(-50%) rotate(45deg)",zIndex:0}}})),aA=v(r,{shouldForwardProp:e=>"logoSize"!==e&&"delayMs"!==e})((({theme:e,logoSize:t="large",delayMs:i=0})=>{const{butterflyBlue:o,iron:r}=e.palette.app.color,{button:n,icon:l,padding:a}=((e="large")=>"small"===e?{button:26,icon:14,padding:"4px"}:"medium"===e?{button:30,icon:16,padding:"5px"}:{button:34,icon:18,padding:"6px"})(t);return{width:n,height:n,padding:a,color:r[800],zIndex:1,animation:`${nA} 240ms cubic-bezier(0.22, 1, 0.36, 1) both`,animationDelay:`${i}ms`,transition:"background-color 0.18s ease, color 0.18s ease, transform 0.18s ease","& .MuiSvgIcon-root":{fontSize:l},"&:hover":{backgroundColor:y(o[900],.1),color:o[900],transform:"translateY(-1px)"},"&:focus-visible":{outline:`2px solid ${o[900]}`,outlineOffset:1}}})),sA=v(M,{shouldForwardProp:e=>"logoSize"!==e})((({logoSize:e="large"})=>({height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"small"===e?"2px":"6px",padding:"small"===e?"2px":"4px"})));function CA({open:t,anchorEl:i,size:o,actions:r,onClose:n,onMouseEnter:l,onMouseLeave:a}){const s=J(),{slate:C}=s.palette.app.color;return e(ce,{open:t,anchorEl:i,onClose:n,disableRestoreFocus:!0,disableScrollLock:!0,marginThreshold:8,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},slotProps:{paper:{elevation:0,onMouseEnter:l,onMouseLeave:a,sx:{mt:1,overflow:"visible",background:"transparent",boxShadow:"none"}}},sx:{pointerEvents:"none","& .MuiPaper-root":{pointerEvents:"auto"}},children:e(lA,{role:"toolbar","aria-label":"Logo actions",children:r.map((({key:t,label:i,icon:r,onClick:n},l)=>e(El,{toolTipLabel:i,placement:"top",children:e(aA,{logoSize:o,delayMs:40*l,"aria-label":i,onClick:e=>{e.stopPropagation(),n(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),e.stopPropagation(),n(e))},sx:{color:C[900]},children:r})},t)))})})}const dA=v(M)({display:"flex",flexDirection:"column",gap:"12px"}),AA=v(M)({display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",gap:"10px"}),cA=v(M)((({theme:e})=>{const{mirage:t,butterflyBlue:i,lightBlue:o}=e.palette.app.color;return{position:"relative",width:"100%",height:280,borderRadius:"8px",overflow:"hidden",backgroundColor:t[900],border:`1px solid ${i[700]}`,[e.breakpoints.up("sm")]:{height:360},"& .reactEasyCrop_CropArea":{border:`2px solid ${i[900]} !important`,color:y(t[900],.55)},"& .reactEasyCrop_CropAreaGrid::before, & .reactEasyCrop_CropAreaGrid::after":{borderColor:y(o[50],.35)}}})),hA=v(M)({display:"flex",alignItems:"center",gap:"8px"}),pA=v(r)((({theme:e})=>{const{butterflyBlue:t,iron:i}=e.palette.app.color;return{color:t[900],"&.Mui-disabled":{color:i[700]}}})),uA=v(M)((({theme:e})=>{const{butterflyBlue:t,lightBlue:i}=e.palette.app.color;return{width:40,height:40,borderRadius:"6px",overflow:"hidden",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i[50],border:`1px solid ${t[700]}`}})),gA=v(M)((({theme:e})=>{const{mirage:t,lightBlue:i}=e.palette.app.color;return{position:"absolute",inset:0,zIndex:5,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10px",backgroundColor:y(t[900],.7),color:i[50]}}));function mA({imageSrc:t,aspectRatio:i,rotation:o,zoom:r,onZoomChange:n,onCropComplete:l}){const[a,s]=h({x:0,y:0});u((()=>{s({x:0,y:0})}),[i]);const C=g(((e,t)=>{l(t)}),[l]);return e(gi,{image:t,crop:a,zoom:r,rotation:o,aspect:Yd[i],onCropChange:s,onZoomChange:n,onCropComplete:C,objectFit:"contain",showGrid:!0,style:{containerStyle:{width:"100%",height:"100%"}}})}function fA({open:i,imageSrc:o,originalFile:r,aspectRatios:n=qd,enabledVariants:l,initialAspectRatio:s="1:1",onClose:C,onApply:d}){const A=J(),{iron:c,butterflyBlue:p}=A.palette.app.color,[m,f]=h(s),[k,E]=h(1),[I,S]=h(0),[w,B]=h(null),[x,Q]=h(!1),[b,v]=h(null),R=g((()=>{E(1),S(0)}),[]);u((()=>{i&&(f(s),R(),B(null),v((e=>(Nd(e),null))))}),[i,s,R]),u((()=>{const e=new AbortController;return(async()=>{if(w&&o)try{const t=await eA(o,w,I,void 0,void 0,"image/png");if(e.signal.aborted)return;const i=URL.createObjectURL(t);if(e.signal.aborted)return void Nd(i);v((e=>(Nd(e),i)))}catch{if(e.signal.aborted)return;v((e=>(Nd(e),null)))}})(),()=>{e.abort()}}),[w,o,I]);return e(AC,{open:i,onClose:C,title:"Crop Logo",maxWidth:"md",actions:t(a,{direction:"row",gap:"10px",justifyContent:"flex-end",children:[e(Fr,{actionType:"cancel",variant:"outlined",onClick:C,disableKeyboardShortcut:x,disabled:x}),e(Fr,{onClick:()=>{(async()=>{if(w){Q(!0);try{const e=await oA({imageSrc:o,original:r,pixelCrop:w,rotation:I,aspectRatio:m,enabledVariants:l});d({...e,aspectRatio:m}),C()}catch{Ws.error({title:"Failed to process cropped image. Please try again."})}finally{Q(!1)}}else Ws.error({title:"Adjust the crop area before saving."})})()},loading:x,label:"Apply"})]}),children:t(dA,{children:[t(AA,{children:[e(Rr,{renderButtons:n.map((e=>({icon:null,value:e,label:e,selected:m===e,size:"small",onClick:e=>{const t=n.find((t=>t===e));t&&f(t)}}))),sx:{textTransform:"none",fontWeight:500,boxShadow:"none","&.MuiButton-text":{color:c[800]}}}),t(a,{direction:"row",alignItems:"center",gap:"2px",children:[e(El,{toolTipLabel:"Drag to reposition. Scroll or use zoom to refine.",children:e(pA,{size:"small","aria-label":"Crop tips",children:e(Vt,{fontSize:"small"})})}),e(El,{toolTipLabel:"Rotate left",children:e(pA,{size:"small",onClick:()=>S((e=>e-90)),"aria-label":"Rotate left",disabled:x,children:e(Ai,{fontSize:"small"})})}),e(El,{toolTipLabel:"Rotate right",children:e(pA,{size:"small",onClick:()=>S((e=>e+90)),"aria-label":"Rotate right",disabled:x,children:e(ci,{fontSize:"small"})})}),e(El,{toolTipLabel:"Reset",children:e(pA,{size:"small",onClick:R,"aria-label":"Reset crop",disabled:x,children:e(di,{fontSize:"small"})})})]})]}),t(M,{sx:{position:"relative"},children:[e(cA,{children:e(mA,{imageSrc:o,aspectRatio:m,rotation:I,zoom:k,onZoomChange:E,onCropComplete:B})}),x&&t(gA,{children:[e(_,{size:28,sx:{color:p[900]}}),e(q,{variant:"body2",children:"Processing…"})]})]}),t(hA,{children:[e(El,{toolTipLabel:"Zoom out",children:e(pA,{size:"small",onClick:()=>{E((e=>Math.max(1,Number((e-.1).toFixed(2)))))},"aria-label":"Zoom out",disabled:k<=1||x,children:e(pi,{fontSize:"small"})})}),e(ui,{value:k,min:1,max:3,step:.05,"aria-label":"Zoom",onChange:(e,t)=>{"number"==typeof t&&E(t)},size:"small",disabled:x,sx:{flex:1,color:p[900],"& .MuiSlider-rail":{backgroundColor:c[700]}}}),e(El,{toolTipLabel:"Zoom in",children:e(pA,{size:"small",onClick:()=>{E((e=>Math.min(3,Number((e+.1).toFixed(2)))))},"aria-label":"Zoom in",disabled:k>=3||x,children:e(hi,{fontSize:"small"})})}),t(q,{variant:"caption",color:c[800],sx:{minWidth:36,textAlign:"right"},children:[Math.round(100*k),"%"]}),b&&e(uA,{children:e(M,{component:"img",src:b,alt:"Crop preview",sx:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})})]})]})})}const kA="120px",EA="120px",IA=(e,t,i)=>i?"none":t?`1px dashed ${e}`:`1px solid ${e}`,SA=v(M,{shouldForwardProp:e=>"isDragging"!==e&&"hasImage"!==e&&"disabled"!==e&&"frameWidth"!==e&&"frameHeight"!==e&&"frameBorderRadius"!==e&&"isViewMode"!==e&&"hideBorder"!==e})((e=>(({theme:e,isDragging:t,hasImage:i,disabled:o,frameWidth:r,frameHeight:n,frameBorderRadius:l,isViewMode:a,hideBorder:s})=>{const{butterflyBlue:C,iron:d}=e.palette.app.color,A=t||i?C[900]:e.palette.grey[400],c=r??EA,h=a&&i||!a&&!o,p=!o&&!a&&!s;return{width:c,height:n??kA,minWidth:c,maxWidth:c,position:"relative",overflow:"hidden",borderRadius:l??"10px",border:IA(A,t,s),backgroundColor:t?y(C[900],.05):i?e.palette.common.white:d[50],cursor:h?"pointer":"default",opacity:o&&!a?.6:1,transition:"all 0.2s ease-in-out",outline:"none",boxSizing:"border-box","&:focus-visible":{outline:h?`2px solid ${C[900]}`:"none",outlineOffset:2},...p&&{"&:hover":{border:IA(C[900],t)}}}})(e))),wA=v(M)((({theme:e})=>({width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.palette.common.white}))),BA=v(M,{shouldForwardProp:e=>"frameBorderRadius"!==e})((({theme:e,frameBorderRadius:t})=>{const{mirage:i}=e.palette.app.color;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",backgroundColor:y(i[600],.2),backdropFilter:"blur(3px)",borderRadius:t??"10px",zIndex:2}})),xA=v(M,{shouldForwardProp:e=>"frameBorderRadius"!==e})((({theme:e,frameBorderRadius:t})=>{const{mirage:i}=e.palette.app.color;return{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:y(i[600],.35),backdropFilter:"blur(2px)",borderRadius:t??"10px",zIndex:3}}));function QA({open:i,size:o,disabled:n,borderRadius:l,onEdit:a,onDelete:s,onHoverChange:C}){const d=J(),{lightBlue:A}=d.palette.app.color,c="small"===o?16:20,h="small"===o?"small":"medium";return e(ai,{in:i,timeout:{enter:300,exit:1e3},children:t(BA,{frameBorderRadius:l,onFocus:()=>C(!0),onBlur:e=>{Pd(e.currentTarget,e.relatedTarget)&&C(!1)},children:[e(r,{tabIndex:0,disabled:n,"aria-label":"Replace logo",size:h,onClick:e=>{e.stopPropagation(),a()},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a())},children:e(ni,{sx:{color:A[50],fontSize:c}})}),e(r,{tabIndex:0,disabled:n,"aria-label":"Remove logo",size:h,onClick:s,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||s(e)},children:e(ri,{sx:{color:A[50],fontSize:c}})})]})})}function MA({size:i,disabled:o=!1,enableCaptureImage:r=!1,onAttach:n,onCapture:l}){const a=J(),{iron:s}=a.palette.app.color,C=e=>t=>{t.stopPropagation(),t.preventDefault(),o||e()};return t(sA,{logoSize:i,children:[r&&e(El,{toolTipLabel:"Capture photo",placement:"top",children:e(aA,{logoSize:i,delayMs:0,disabled:o,"aria-label":"Capture photo",onClick:C((()=>l?.())),children:e(oi,{sx:{color:s[900]}})})}),e(El,{toolTipLabel:"Upload logo",placement:"top",children:e(aA,{logoSize:i,delayMs:r?40:0,disabled:o,"aria-label":"Upload logo",onClick:C(n),children:e(fi,{sx:{color:s[900]}})})})]})}const bA={small:{base:60,rectShort:36,rectMaxLong:120,borderRadius:"8px",iconFontSize:20},medium:{base:80,rectShort:48,rectMaxLong:160,borderRadius:"8px",iconFontSize:24},large:{base:120,rectShort:72,rectMaxLong:240,borderRadius:"10px",iconFontSize:28}},JA=(e,t="square")=>{const{base:i,borderRadius:o}=bA[e];return{width:i,height:i,borderRadius:"circle"===t?"50%":o}},vA=e=>{const{base:t,rectMaxLong:i}=bA[e];return{maxPreviewWidth:i,maxPreviewHeight:t}},RA=(e,t)=>{if(!e||!t)return"square";const i=e/t;return Math.abs(i-1)<=.12?"square":i>1?"rectangle":"portrait"},LA=(e,t="large",i,o)=>{const{base:r,rectShort:n,rectMaxLong:l,borderRadius:a}=bA[t];if("circle"===e)return{width:r,height:r,borderRadius:"50%"};if("square"===e)return{width:r,height:r,borderRadius:a};if("rectangle"===e)return{width:l,height:n,borderRadius:a};if(!i||!o)return{width:r,height:r,borderRadius:a};const s=RA(i,o);if("square"===s)return{width:r,height:r,borderRadius:a};const C=i/o;if("rectangle"===s){const e=n;return{width:Math.min(l,Math.round(e*C)),height:e,borderRadius:a}}const d=n;return{width:d,height:Math.min(l,Math.round(d/C)),borderRadius:a}},yA=e=>new Promise(((t,i)=>{const o=new Image;o.onload=()=>{const{naturalWidth:e,naturalHeight:i}=o;t({width:e,height:i})},o.onerror=()=>i(new Error("Failed to load image")),o.crossOrigin="anonymous",o.src=e}));function FA({size:t,disabled:i,enableCaptureImage:o,onAttach:r,onCapture:n}){const l=J(),{iron:s}=l.palette.app.color,{iconFontSize:C}=bA[t];return o?e(MA,{size:t,disabled:i,enableCaptureImage:o,onAttach:r,onCapture:n}):e(a,{justifyContent:"center",alignItems:"center",sx:{height:"100%"},children:e(mi,{sx:{color:s[700],fontSize:C}})})}function UA({open:i,imageSrc:o,title:n="Logo",onClose:l}){const a=J(),{iron:s}=a.palette.app.color;return e(Ei,{open:i,onClose:l,closeAfterTransition:!0,slots:{backdrop:ki},slotProps:{backdrop:{timeout:200,sx:{backgroundColor:y(a.palette.common.white,.45),backdropFilter:"blur(8px) saturate(1.7)",WebkitBackdropFilter:"blur(8px) saturate(9)"}}},"aria-label":n,children:e(ai,{in:i,children:t(M,{sx:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",p:{xs:2,sm:4},outline:"none",overflow:"hidden"},onClick:l,children:[e(r,{"aria-label":"Close",onClick:l,size:"small",sx:{position:"absolute",top:{xs:12,sm:16},right:{xs:12,sm:16},zIndex:2,color:s[400],bgcolor:"transparent",boxShadow:"none","&:hover":{bgcolor:"transparent",opacity:.7}},children:e(Ct,{fontSize:"small"})}),e(M,{sx:{position:"relative",maxWidth:"min(920px, 100%)",maxHeight:"100%",lineHeight:0},onClick:e=>e.stopPropagation(),children:e(M,{component:"img",src:o,alt:n,sx:{display:"block",maxWidth:"100%",maxHeight:"min(82vh, 680px)",width:"auto",height:"auto",objectFit:"contain",borderRadius:"10px",bgcolor:a.palette.common.white,boxShadow:`0 12px 40px ${y(s[400],.18)}`}})})]})})})}function DA({previewUrl:e,errorImage:t="",onError:i}){const[o,r]=h(!1),[n,l]=h(!1);u((()=>{r(!1),l(!1)}),[e,t]);const a=o&&!!t&&!n;return{displayUrl:a?t:e,hasValidImage:!!e&&(!o||a),handleImageError:()=>{if(!o)return r(!0),void i?.();l(!0)}}}function ZA({previewUrl:o,errorImage:n="",label:l,required:s,hideBorder:C,variant:d,size:A,frame:c,maxPreviewWidth:p,maxPreviewHeight:u,onView:g,onError:m,enableFullImageView:f=!0,containerProps:k}){const E=J(),{iron:I,lightBlue:S}=E.palette.app.color,{iconFontSize:w}=bA[A],[B,x]=h(!1),[Q,b]=h(!1),{displayUrl:v,hasValidImage:R,handleImageError:L}=DA({previewUrl:o,errorImage:n,onError:m}),y="auto"===d,F="small"===A?16:20,U=y?{width:"fit-content",height:"fit-content",minWidth:"unset",maxWidth:"unset"}:void 0,{width:D,height:Z,borderRadius:H}=c,K=y?{display:"block",maxWidth:p,maxHeight:u,width:"auto",height:"auto",borderRadius:H}:{display:"block",width:"100%",height:"100%",objectFit:"cover",objectPosition:"center",borderRadius:H},G=e=>{e?.stopPropagation(),R&&f&&(g?g():b(!0))},Y=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),G())},V=e=>{Pd(e.currentTarget,e.relatedTarget)&&x(!1)};if(!R)return t(a,{direction:"row",alignItems:"center",gap:"15px",...k,children:[e(SA,{hasImage:!1,disabled:!0,isViewMode:!0,frameWidth:D,frameHeight:Z,frameBorderRadius:H,role:"img","aria-label":l||"Logo",children:e(M,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",sx:{height:"100%"},children:e(mi,{sx:{color:I[700],fontSize:w}})})}),l&&e(Pe,{required:s,children:l})]});const T=f?{tabIndex:0,role:"button","aria-label":`View ${l||"logo"}`,onClick:()=>G(),onKeyDown:Y,onMouseEnter:()=>x(!0),onFocus:()=>x(!0),onBlur:V,onMouseLeave:()=>x(!1)}:{};return t(i,{children:[t(a,{direction:"row",alignItems:"center",gap:"15px",...k,children:[t(SA,{hasImage:!0,isViewMode:!0,hideBorder:C,frameWidth:y?"fit-content":D,frameHeight:y?"fit-content":Z,frameBorderRadius:H,sx:U,...T,children:[f&&e(ai,{in:B,timeout:{enter:300,exit:1e3},children:e(BA,{frameBorderRadius:H,onFocus:()=>x(!0),onBlur:V,children:e(r,{tabIndex:0,"aria-label":"View logo",size:"small"===A?"small":"medium",onClick:G,onKeyDown:Y,children:e(Nt,{sx:{color:S[50],fontSize:F}})})})}),e(wA,{sx:{borderRadius:H,...y?{width:"fit-content",height:"fit-content"}:void 0},children:e(M,{component:"img",src:v,alt:"Logo",onError:L,sx:K})})]}),l&&e(Pe,{required:s,children:l})]}),e(UA,{open:Q,imageSrc:v,title:l||"View Logo",onClose:()=>b(!1)})]})}const HA=({size:i="large"})=>{const{base:o,borderRadius:r}=bA[i],n="small"===i;return t(a,{direction:"row",alignItems:"center",gap:n?"10px":"15px",children:[e(Se,{variant:"rectangular",sx:{width:o,height:o,minWidth:o,maxWidth:o,borderRadius:r,transform:"scale(1)"}}),t(a,{gap:"5px",children:[e(Se,{width:n?90:120,height:n?18:24,sx:{transform:"scale(1)"}}),e(Se,{width:n?100:140,height:n?12:16,sx:{transform:"scale(1)"}})]})]})},KA=(e,t,i)=>(t&&Ws.error({title:e}),{valid:!1,error:e,...i}),GA=async(e,t,i,o)=>{try{const{width:r,height:n}=await(e=>new Promise(((t,i)=>{const o=URL.createObjectURL(e),r=new Image;r.onload=()=>{const{naturalWidth:e,naturalHeight:i}=r;URL.revokeObjectURL(o),t({width:e,height:i})},r.onerror=()=>{URL.revokeObjectURL(o),i(new Error("Failed to load image"))},r.src=o})))(e),l=Math.min(r,n);if(l<t)return KA(`Image resolution too low. Minimum is ${t}×${t} px.`,o,{width:r,height:n});if(l<i){const e=`Image quality may be low (${r}×${n} px). Consider using a higher-resolution logo.`;return o&&Ws.warning({title:e}),{valid:!0,warning:e,width:r,height:n}}return{valid:!0,width:r,height:n}}catch{return KA("Unable to read image. Please try another file.",o)}};function YA({onChange:o,onDelete:r,onView:n,onError:l,errorImage:s="",defaultValue:C="",value:d,label:A="Logo",subTitle:m="PNG, JPEG under 5 MB",mode:f="edit",variant:k="square",size:E="large",maxPreviewWidth:I,maxPreviewHeight:S,hideBorder:w=!1,maxSizeMB:B=5,minResolution:x=256,qualityWarnResolution:Q=512,aspectRatios:M=qd,enabledVariants:b=Wd,isUploading:v=!1,loading:R=!1,disabled:L=!1,required:y=!1,enableCaptureImage:F=!1,acceptedTypes:U=Ld,enableFullImageView:D=!0,containerProps:Z}){const H=J(),{iron:K,butterflyBlue:G}=H.palette.app.color,Y="view"===f,V=vA(E),T=I??V.maxPreviewWidth,j=S??V.maxPreviewHeight,W="circle"===k?"circle":"square",z=c((()=>JA(E,W)),[E,W]),O=p(null),P=p(null),N=p(null),X=p(null),[$,ee]=h(!1),[te,ie]=h(!1),[oe,re]=h(d??C),[ne,le]=h(null),[ae,se]=h(!1),[Ce,de]=h(!1),[Ae,ce]=h(null),[he,pe]=h(null),[ue,ge]=h(!1),[me,fe]=h(!1),[ke,Ee]=h((()=>LA(k,E))),{inputRef:Ie,setInputRef:Se,maintainFocusAfterClose:we}=ir({isOpen:ue||Ce});u((()=>{void 0!==d&&re(d)}),[d]),u((()=>{if(!Y)return void Ee(z);if("auto"!==k)return void Ee(LA(k,E));if(!oe)return void Ee(LA("square",E));let e=!1;return yA(oe).then((({width:t,height:i})=>{e||Ee(LA("auto",E,t,i))})).catch((()=>{e||Ee(LA("square",E))})),()=>{e=!0}}),[Y,k,oe,E,z]);const Be=Y?ke:z,{displayUrl:xe,hasValidImage:Qe,handleImageError:Me}=DA({previewUrl:oe,errorImage:s,onError:l}),be=g((()=>{Nd(P.current),P.current=null}),[]);u((()=>()=>{be(),Nd(N.current),N.current=null,X.current&&clearTimeout(X.current)}),[be]);const Je=()=>{L||Ie.current?.click()},ve=()=>{!L&&F&&(fe(!1),ge(!0))},Re=()=>{X.current&&(clearTimeout(X.current),X.current=null)},Le=()=>{!L&&Qe&&F&&(Re(),fe(!0))},ye=()=>{Re(),X.current=setTimeout((()=>{fe(!1)}),160)},Fe=e=>{F?e?Le():ye():ee(e)},Ue=async e=>{if(o){le(null),se(!0),fe(!1);try{const t=await(async(e,{maxSizeMB:t=5,minResolution:i=256,qualityWarnResolution:o=512,acceptedTypes:r=Ld,showToasts:n=!0}={})=>Dd(e,r)?qo(e,t)?Od(e)?{valid:!0}:GA(e,i,o,n):KA(`File too large. Maximum size is ${t} MB.`,n):KA("Unsupported file type. Use PNG, JPG, JPEG, SVG, or WEBP.",n))(e,{maxSizeMB:B,minResolution:x,qualityWarnResolution:Q,acceptedTypes:U});if(!t.valid)return void le(t.error??"Invalid file");if(Od(e)){const t=await(async(e,t)=>{const i=URL.createObjectURL(e),o={};for(const i of t)o[i]=e;return{cropped:e,variants:o,previewUrl:i}})(e,b),{cropped:i,variants:r,previewUrl:n}=t;return be(),P.current=n,re(n),void o({original:e,cropped:i,variants:r,aspectRatio:"1:1",previewUrl:n})}const i=URL.createObjectURL(e);pe(e),ce((e=>(Nd(e),N.current=i,i))),de(!0)}finally{se(!1)}}},De=e=>{const[t]=Array.from(e);t&&Ue(t)},Ze=e=>{e?.stopPropagation(),e?.preventDefault(),be(),re(""),le(null),pe(null),fe(!1),ce((e=>(Nd(e),N.current=null,null))),r?.()};if(R)return e(HA,{size:E});if(Y)return e(ZA,{previewUrl:oe,errorImage:s,label:A,required:y,hideBorder:w,variant:k,size:E,frame:Be,maxPreviewWidth:T,maxPreviewHeight:j,onView:n,onError:l,enableFullImageView:D,containerProps:Z});const{width:He,height:Ke,borderRadius:Ge}=Be,Ye="50%"===Ge?"50%":"8px",Ve=(({enableCaptureImage:t,onEdit:i,onCapture:o,onDelete:r})=>{const n=[{key:"edit",label:"Replace logo",icon:e(ni,{}),onClick:e=>{e.stopPropagation(),i()}}];return t&&n.push({key:"capture",label:"Capture photo",icon:e(oi,{}),onClick:e=>{e.stopPropagation(),o()}}),n.push({key:"delete",label:"Remove logo",icon:e(ri,{}),onClick:e=>{r(e)}}),n})({enableCaptureImage:F,onEdit:Je,onCapture:ve,onDelete:Ze});return t(i,{children:[t(a,{direction:"row",alignItems:"center",gap:"15px",...Z,children:[t(SA,{ref:O,isDragging:te,hasImage:Qe,disabled:L,frameWidth:He,frameHeight:Ke,frameBorderRadius:Ge,tabIndex:L?-1:0,role:"button","aria-disabled":L,"aria-label":A||"Logo",onClick:()=>!L&&!Qe&&!F&&Je(),onKeyDown:e=>{L||Qe||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Je())},onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),!L&&(e=>e.dataTransfer.types.includes("Files"))(e)&&ie(!0)},onDragOver:e=>{e.preventDefault(),e.stopPropagation(),L||(e.dataTransfer.dropEffect="copy")},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),Pd(e.currentTarget,e.relatedTarget)&&ie(!1)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),ie(!1),!L&&e.dataTransfer.files.length>0&&De(e.dataTransfer.files)},onMouseEnter:()=>!L&&Fe(!0),onFocus:()=>!L&&Fe(!0),onMouseLeave:()=>Fe(!1),onBlur:e=>{Pd(e.currentTarget,e.relatedTarget)&&Fe(!1)},children:[e("input",{ref:Se,type:"file",accept:yd,onChange:e=>{!L&&e.target.files&&(De(e.target.files),e.target.value="")},disabled:L,style:{display:"none"},"aria-hidden":!0}),!F&&e(QA,{open:$&&!!oe&&!L,size:E,disabled:L,borderRadius:Ge,onEdit:Je,onDelete:Ze,onHoverChange:ee}),(v||ae)&&e(xA,{frameBorderRadius:Ge,children:e(_,{size:"small"===E?16:22,sx:{color:K[600]}})}),te&&e(xA,{frameBorderRadius:Ge,children:e(q,{variant:"caption",color:G[900],children:"Drop"})}),Qe?e(wA,{sx:{borderRadius:Ge},children:e("img",{src:xe,alt:"Logo",onError:Me,style:{width:"100%",height:"100%",objectFit:"contain",objectPosition:"center",display:"block",borderRadius:Ye}})}):e(FA,{size:E,disabled:L,enableCaptureImage:F,onAttach:Je,onCapture:ve})]}),t(a,{gap:"5px",justifyContent:"center",children:[A&&e(Pe,{disabled:L,required:y,children:A}),m&&e(q,{noWrap:!0,variant:"caption",color:K[800],children:m}),ne&&e(q,{variant:"caption",color:"error",children:ne})]})]}),F&&Qe&&!L&&e(CA,{open:me,anchorEl:O.current,size:E,actions:Ve,onClose:()=>fe(!1),onMouseEnter:Le,onMouseLeave:ye}),Ce&&Ae&&he&&o&&e(fA,{open:Ce,imageSrc:Ae,originalFile:he,aspectRatios:M,enabledVariants:b,onClose:()=>{de(!1),we()},onApply:({cropped:e,variants:t,previewUrl:i,aspectRatio:r})=>{be(),P.current=i,re(i),le(null),de(!1),o({original:he,cropped:e,variants:t,aspectRatio:r,previewUrl:i}),Ws.success({title:"Logo cropped successfully"}),we()}}),F&&ue&&e(Md,{open:ue,isUploading:v||ae,onChange:De,onClose:()=>{ge(!1),we()}})]})}const VA=v(le,{shouldForwardProp:e=>"selected"!==e})((({theme:e,selected:t})=>({background:e.palette.app.color.iron[600],color:e.palette.app.color.mirage[900],borderRadius:"4px",border:`1px solid ${e.palette.app.color.butterflyBlue[300]}`,...t?{background:e.palette.app.color.deepAqua[500],color:e.palette.app.color.mirage[900],borderLeft:`6px solid ${e.palette.app.color.butterflyBlue[900]}`}:{}})));function TA({label:i,selected:o,actions:r,companyName:n,href:l,target:s,...d}){const A=J(),{iron:c}=A.palette.app.color,g=p(null),[m,f]=h(!1);u((()=>{const e=g.current;if(!e)return;const t=()=>f(e.scrollWidth>e.clientWidth);return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[i,n]);return e(VA,{selected:o,alignItems:"flex-start",...l?{component:C,href:l,target:s,prefetch:!1}:{},...d,children:t(a,{width:"100%",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[t(a,{gap:"5px",direction:"column",flex:1,display:"grid",children:[e(El,{toolTipLabel:i,checkOverflow:!m,children:e(q,{variant:"body2",fontWeight:500,ref:g,sx:{width:"auto",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"},children:i})}),e(q,{variant:"caption",color:c[800],children:n})]}),r]})})}const jA=new Set(["+","-","e","E","*","/","=","%","^"]),WA=/[+\-eE*/=%^]/,qA={string:"Only alphabetic characters are allowed.","string-number":"Only letters and numbers are allowed.","string-number-special":"Special characters are allowed.","string-special":"Only letters, accents, apostrophes, and hyphens are allowed.","string-special-all":"Only letters and Special characters are allowed",custom:"Please enter a valid input"};function zA({control:i,name:o,defaultValue:r,label:n="",rules:l,type:s,required:C,disabled:d,readOnly:A=!1,loading:c=!1,placeholder:h="",isCapitalize:p=!1,isTrimStartDisabled:u=!1,rows:g,characterType:m="string-number-special",letterCase:f="mixed",setError:k,containerProps:E,styling:I="custom",infoMessage:S,regexExpression:w={message:null,regex:/^[\s\S]*$/},navigationKey:B,customOnChange:x,size:Q,InputProps:M,inputProps:b,...J}){const{field:{value:v,onChange:R,onBlur:L,...y},fieldState:{error:F}}=$e({name:o,control:i,defaultValue:r,rules:l}),{navigationKey:U}=Fo(),D=B??U,{inputRef:Z,maintainFocus:H,handleKeyDown:K,handleEnterNavigation:G}=ir({navigationKey:D}),{inputHeight:Y,inputFontSize:V}=Ns(Q),T=Boolean(g??J.multiline),j=e=>{let t=e;const i=(e=>{switch(e){case"string":return/^[A-Za-z\s]*$/;case"string-number":return/^[A-Za-z0-9\s]*$/;case"string-number-special":default:return/^[\s\S]*$/;case"string-special":return/^[\p{L}’'\-\s.]+$/u;case"string-special-all":return/^[^\d]+$/;case"custom":return w.regex}})(m);return i.test(t)||(t=t.split("").filter((e=>i.test(e))).join("")),"uppercase"===f?t=t.toUpperCase():"lowercase"===f&&(t=t.toLowerCase()),t},{message:W}=w,q=W||qA[m];return c?e(_C,{label:n,multiline:T,styling:I,size:Q}):t(a,{...E,gap:"5px",children:[n&&"custom"===I&&t(a,{direction:"row",children:[e(Pe,{required:C,disabled:d,children:n}),S&&e(El,{toolTipLabel:S,children:e(Vt,{sx:{fontSize:13}})})]}),e(Ne,{disabled:d,required:C,fullWidth:!0,inputRef:Z,onKeyDown:e=>{"number"===s&&jA.has(e.key)&&e.preventDefault();!Boolean(g??J.multiline)||"Enter"!==e.key||"enter"!==D||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey?K(e,void 0,!1):G(e,!0)},onPaste:e=>{(A||"number"===s&&WA.test(e.clipboardData.getData("text")))&&e.preventDefault()},placeholder:"default"===I?h:h||n,type:s,label:"default"===I?n:void 0,sx:{...$s(I),"& .MuiInputBase-root":{...!T&&{height:`${Y}px !important`,fontSize:V}}},InputLabelProps:_s(I,Q,T),InputProps:{...M,readOnly:A||M?.readOnly},inputProps:{min:0,...b,readOnly:A||b?.readOnly},error:Boolean(F),helperText:F?.message,onChange:e=>{if(A)return;const t=e.target,{selectionStart:i,selectionEnd:r}=t;let n=e.target.value||null;"string"==typeof n&&""===n.trim()?n=null:u||"string"!=typeof n||(n=n.trimStart());const l=n&&j(n);if(n!==l&&k)return void k(o,{type:"manual",message:q});let a=l;n&&"number"===s?a=Number(n):p&&l&&(a=l?l.toUpperCase():null),R(a),x&&x(n),requestAnimationFrame((()=>{"text"==s&&t.setSelectionRange(i,r),H()}))},onBlur:()=>{if(!u&&"string"==typeof v){const e=v.trim(),t=""===e?null:e;v!==t&&R(t)}L()},value:"string"==typeof v?v.trimStart():v??"",...y,...J})]})}function OA(t){const[i,o]=h(!1);return e(zA,{type:i?"text":"password",InputProps:{startAdornment:e(Oe,{position:"start",children:e(Ii,{fontSize:"small"})}),endAdornment:e(Oe,{position:"end",children:e(r,{"aria-label":"toggle password visibility",onClick:()=>{o((e=>!e))},edge:"end",children:e(i?Si:Nt,{fontSize:"small"})})})},...t})}const PA=v(M,{shouldForwardProp:e=>"error"!==e})((({styling:e,theme:t,error:i,size:o})=>{const r={position:"relative"},{red:n,butterflyBlue:l,iron:a,slate:s,black:C}=t.palette.app.color,{fontSize:d}=Xs(o);return"custom"===e?{...r,"&.custom_phone_input":{"& .phone-input-container":{"&:focus-within":{border:`2px solid ${l[900]} !important`}},"& .phone-input-field":{padding:"8.5px 50px 8.5px 30px","&:focus":{"& ~ .flag-dropdown":{borderColor:i?n[900]:l[900]}}},"& .flag-dropdown":{"&.open":{borderColor:i?n[900]:l[900]}}}}:{"&.default_phone_input":{"& .react-tel-input":{"& .form-control":{fontSize:"16px",background:a[600],border:`1px solid ${s[100]}`,borderRadius:"5px",width:"300px",outline:"none",padding:"18.5px 14px 18.5px 58px",transition:"box-shadow ease .25s, border-color ease .25s","&:focus":{borderColor:l[900],boxShadow:`0 0 0 2px ${l[900]}`},"&.invalid-number":{border:`1px solid ${n[900]}`,"&:focus":{boxShadow:`0 0 0 2px ${n[900]}`},"&+div:before":{content:"'Error'",display:"none",color:`${n[900]}`,width:"27px"}}},"& .flag-dropdown":{position:"absolute",top:"0",bottom:"0",padding:"0",backgroundColor:a[600],borderRadius:"3px 0 0 3px","&:hover, &:focus":{cursor:"pointer"}},"& input[disabled]":{"&+.flag-dropdown":{"&:hover":{cursor:"default",borderColor:s[100],"& .selected-flag":{backgroundColor:"transparent"}}}},"& .selected-flag":{outline:"none",position:"relative",height:"100%",padding:"0 0 0 8px",borderRadius:"3px 0 0 3px","&:focus":{"& .arrow":{borderLeftWidth:"4px",borderRightWidth:"4px",borderTop:`5px solid ${l[900]}`}},"& .flag":{position:"absolute",top:"50%",marginTop:"-6px"},"& .arrow":{position:"relative",top:"50%",marginTop:"-1px",width:"0",height:"0",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderTop:"4px solid #555","&.up":{borderTop:"none",borderBottom:"4px solid #555"}}},"& .country-list":{outline:"none",zIndex:1,listStyle:"none",position:"absolute",padding:"0",margin:"10px 0 10px -1px",backgroundColor:"white",width:"300px",maxHeight:"220px",overflowY:"scroll",borderRadius:"7px","& .flag":{display:"inline-block",position:"absolute",left:"13px",top:"8px",marginRight:"7px",marginTop:"2px"},"& .divider":{paddingBottom:"5px",marginBottom:"5px",borderBottom:"1px solid #ccc"},"& .country":{position:"relative",padding:"12px 9px 13px 46px","& .dial-code":{color:"#6b6b6b"},"&:hover":{backgroundColor:"hsl(0, 0.00%, 94.50%)"},"&.highlight":{backgroundColor:s[300]}},"& .country-name":{marginRight:"6px"},"& .search":{zIndex:2,position:"sticky",top:"0",backgroundColor:"#fff",padding:"10px 0 6px 10px"},"& .search-emoji":{display:"none",fontSize:"15px"},"& .search-box":{border:`1px solid ${s[100]}`,borderRadius:"3px",fontSize:"15px",lineHeight:"15px",marginLeft:"6px",padding:"3px 8px 5px",outline:"none","&:hover":{borderColor:s[50]}},"& .no-entries-message":{padding:"7px 10px 11px",opacity:".7"}},"& .invalid-number-message":{position:"absolute",zIndex:1,fontSize:"13px",left:"25px",top:"-7px",background:"#fff",padding:"0 5px",color:n[900]},"& .special-label":{position:"absolute",zIndex:5,top:"small"===o?"-8px":"-9px",left:"0px",display:"block",color:C[900],background:a[600],opacity:"1",fontSize:`${d}px`,whiteSpace:"nowrap",lineHeight:"1.1",scale:"small"===o?.83:.85}},"&.phone-input-required .react-tel-input .special-label::after":{content:"' *'",color:n[900],fontSize:"13px",fontWeight:500}}}})),NA=({rows:i,label:o,styling:r,size:n})=>{const{inputHeight:l}=Ns(n),s=void 0===i?l:26.5*i;return t(a,{gap:"5px",children:[o&&"custom"===r&&e(Se,{width:120,height:"18.69px",sx:{transform:"scale(1)"}}),e(Se,{height:`${s}px`,sx:{transform:"scale(1)"}})]})};function XA({control:i,name:o,defaultValue:r,rules:n,label:l,disabled:s=!1,required:C,rows:d,loading:A=!1,placeholder:c="",error:g,helperText:m,navigationKey:f,styling:k="custom",size:E,autoFocus:I=!1,...S}){const w=J(),{iron:B,red:x,slate:Q}=w.palette.app.color,{navigationKey:M}=Fo(),b=f??M,{inputHeight:v,inputFontSize:R}=Ns(E),{inputProps:L,...y}=S,F={...L??{},...I&&!s?{autoFocus:!0}:{}},{field:{value:U,onChange:D,...Z}}=$e({name:o,control:i,defaultValue:r,rules:n}),[H,K]=h(!1),{setInputRef:G,maintainFocusAfterClose:Y,handleKeyDown:V}=ir({isOpen:H,navigationKey:b}),T=p(null);return u((()=>{const e=T.current;if(!e||s)return;const t=e.querySelector("input[type='tel']");t&&(G(t),Z.ref(t));const i=()=>{const t=e.querySelector(".country-list"),i=e.querySelector(".react-tel-input");if(!t)return;const o=i?.getBoundingClientRect()?.width,r=e.querySelector(".flag-dropdown")?.getBoundingClientRect();r&&(t.style.position="fixed",t.style.top=`${r.bottom}px`,t.style.left=`${r.left}px`,t.style.zIndex="99999",t.style.maxHeight="200px",t.style.overflowY="auto",t.style.width=`${o}px`)},o=()=>{i()};window.addEventListener("resize",o),window.addEventListener("scroll",o,!0);const r=()=>{const t=e.querySelector(".selected-flag");t&&(t.setAttribute("tabindex","-1"),t.addEventListener("focus",(()=>{t.blur()})));const o=!!e.querySelector(".flag-dropdown.open");K(o),o&&(i(),setTimeout((()=>{const t=e.querySelector(".country-list .search-box input");t&&t.focus()}),0))},n=new MutationObserver((e=>{r();e.some((({addedNodes:e})=>!e.length))&&i()}));n.observe(e,{attributes:!0,attributeFilter:["class"],subtree:!0,childList:!0});const l=e=>{const t=e.target;(t.closest(".flag-dropdown")||t.closest(".country-list"))&&setTimeout(r,0)},a=e=>{const t=e.target;t.closest(".flag-dropdown")||t.closest(".country-list")||setTimeout(r,0)};return e.addEventListener("click",l),document.addEventListener("click",a),r(),()=>{window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0),n.disconnect(),e.removeEventListener("click",l),document.removeEventListener("click",a)}}),[G,Z,s]),A?e(NA,{label:l,rows:d,styling:k,size:E}):t(a,{gap:"4px",children:[t(a,{gap:"5px",children:[l&&"custom"===k&&e(Pe,{required:C,disabled:s,children:l}),e(PA,{ref:T,styling:k,error:g,size:E,className:`${"custom"===k?"custom_phone_input":"default_phone_input"}${C?" phone-input-required":""}`,children:e(wi,{country:"in",enableSearch:!0,disabled:s,specialLabel:l??"",placeholder:c||l,onChange:e=>{D(e)},value:String(U),onBlur:()=>{Z.onBlur(),H||Y()},onKeyDown:e=>{H||V(e,void 0,!1)},containerStyle:{width:"100%",height:`${v}px`,border:g?`1px solid ${x[900]}`:s?`1px solid ${B[700]}`:`1px solid ${B[800]}`,borderRadius:"4px",transition:"all 0.2s ease"},inputStyle:{width:"100%",padding:"8.5px 40px",fontSize:R,height:`${v}px`,border:"none",outline:"none",transition:"all 0.2s ease",color:s?B[100]:Q[900]},containerClass:"phone-input-container",inputClass:"phone-input-field",buttonStyle:{border:"none"},...y,inputProps:F})})]}),g&&e(q,{variant:"caption",sx:{color:"red",whiteSpace:"pre",textWrap:"wrap"},children:m})]})}const _A=e=>"medium"===e?26:20,$A=({isHorizontal:i,direction:o,optionsLength:r,size:n})=>{const l=_A(n);return t(a,{gap:"10px",direction:i?"row":"column",alignItems:i&&"row"===o?"center":void 0,children:[e(Se,{height:"18.69px",width:"70px",sx:{transform:"scale(1)"}}),e(a,{direction:o,gap:"column"===o?"5px":"10px",children:Array.from({length:r}).map((()=>t(a,{gap:"10px",direction:"row",alignItems:"center",children:[e(Se,{variant:"circular",height:l,width:l}),e(Se,{height:"21px",width:"100px",sx:{transform:"scale(1)"}})]},ti())))})]})};function ec({name:i,rules:o,label:r,control:n,options:l,defaultValue:s,size:C="small",color:d="secondary",loading:A=!1,required:c=!1,direction:h="row",sx:u={},containerProps:g,isHorizontal:m=!1,navigationKey:f,customOnChange:k,...E}){const{field:{value:I,onChange:S,ref:w,...B}}=$e({name:i,control:n,defaultValue:s,rules:o}),{navigationKey:x}=Fo(),Q=f??x,{inputRef:b,handleKeyDown:J,maintainFocus:v}=ir({navigationKey:Q}),R=p(null);return A?e($A,{isHorizontal:m,direction:h,optionsLength:l.length,size:C}):t(a,{direction:m?"row":"column",alignItems:m?"center":void 0,gap:m?1:"5px",children:[r&&e(Pe,{sx:{whiteSpace:"normal",overflow:"visible",textOverflow:"unset"},required:c,disabled:E.disabled,children:r}),e(Qi,{name:i,value:I,onKeyDown:e=>{J(e,void 0,!1)},onChange:(e,t)=>{let i;if("true"===t?(i=!0,S(!0)):"false"===t?(i=!1,S(!1)):(i=t,S(t)),k){const e=l.find((({values:e})=>e===i));e&&k(e)}const o=e.target;o?b.current=o:!b.current&&R.current&&(b.current=R.current),v()},children:e(a,{gap:"column"===h?"5px":"10px",direction:h,...g,children:l?.map((({label:t,values:i,disabled:o},r)=>e(M,{children:e(Bi,{value:i,control:e(xi,{...B,...E,color:d,size:C,inputRef:e=>{if(!e)return;I===i||!b.current&&0===r?(b.current=e,R.current=e):R.current||0!==r||(R.current=e),w&&("function"==typeof w?w(e):w.current=e)},sx:{"& .MuiSvgIcon-root":{fontSize:_A(C)}}}),disabled:o,label:t,sx:u})},r)))})})]})}const tc={small:17,medium:22,large:28},ic=({label:i,size:o="medium",direction:r="row",max:n=5})=>{const l=tc[o],s=Array.from({length:n},((e,t)=>`star-${t+1}`));return t(a,{gap:"5px",direction:r,alignItems:"row"===r?"center":"flex-start",children:[i&&e(Se,{width:120,height:"18.69px",sx:{transform:"scale(1)"}}),e(a,{gap:"2px",direction:"row",children:s.map((t=>e(Se,{variant:"rectangular",width:l,height:l,sx:{borderRadius:"5px"}},t)))})]})};function oc({control:o,name:r,defaultValue:n,label:l="",rules:s,disabled:C,loading:d=!1,direction:A="column",required:c=!1,navigationKey:h,size:p,max:u,containerSx:g,...m}){const{field:{value:f,onChange:k,...E},fieldState:{error:I}}=$e({name:r,control:o,defaultValue:n,rules:s}),{navigationKey:S}=Fo(),w=h??S,{maintainFocus:B,handleKeyDown:x}=ir({navigationKey:w});return d?e(ic,{label:l,size:p,direction:A,max:u}):t(i,{children:[t(a,{gap:"5px",direction:A,alignItems:"row"===A?"center":"flex-start",sx:g,children:[l&&e(Pe,{required:c,disabled:C,children:l}),e("div",{onKeyDown:e=>{x(e,void 0,!1)},children:e(bi,{disabled:C,value:f??null,onChange:(e,t)=>{k(t),B()},size:p,max:u,...E,...m})})]}),I&&e(Mi,{error:!0,children:I?.message})]})}function rc(t){return e(zA,{placeholder:"Search",InputProps:{startAdornment:e(Oe,{position:"start",children:e(Ji,{fontSize:"small"})})},...t,containerProps:{width:{sm:"auto",xs:"100%"},...t.containerProps}})}const nc=({top:t="0px",paperSx:i,boxSx:o,...r})=>e(se,{variant:"outlined",sx:{position:"sticky",top:t,zIndex:100,...i},children:e(Kl,{padding:{padding:"5px"},children:e(M,{sx:{display:"flex",justifyContent:"flex-end",...o},children:e(rc,{...r})})})}),lc=v(Fi)((({theme:e,disabled:t})=>{const{lightBlue:i,iron:o}=e.palette.app.color;return{"& .MuiInputBase-root":{backgroundColor:t?y(i[100],.3):o[600]},"& .MuiSelect-select":{display:"flex",alignItems:"center",gap:"8px",flexWrap:"nowrap",overflow:"hidden"},"& .MuiList-root":{maxHeight:300,overflowY:"auto","&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{backgroundColor:i[100]}}}})),ac=v(q)((({theme:e})=>{const{butterflyBlue:t}=e.palette.app.color;return{position:"sticky",top:0,padding:"8px 16px",fontSize:"13px",fontWeight:600,color:t[900],backgroundColor:t[500],zIndex:1}}));function sc({control:o,defaultValue:n,name:s,required:C=!1,label:d,multiple:A=!1,disabled:u=!1,options:m=[],rules:f,loading:k=!1,helperText:E,error:I,placeholder:S="",isShowSelectAll:w=!0,isShowAvatar:B=!1,onAction:x,renderOption:Q,maxLimit:v,maxDisplayItems:R=2,disableClearable:L=!!C,setOnFinalChange:y=!1,styling:F="custom",navigationKey:U,...D}){const{field:{onChange:Z,value:H,...K}}=$e({name:s,control:o,defaultValue:n,rules:f}),{navigationKey:G}=Fo(),Y=U??G,{t:V}=ot(),T=J(),{slate:j,iron:W}=T.palette.app.color,z=u?W[900]:"revert-layer",[O,P]=h(null),N=p(!1),[X,_]=h(!1),{setInputRef:ee,maintainFocusAfterClose:te,handleKeyDown:ie,handleEnterNavigation:oe}=ir({isOpen:X,navigationKey:Y}),re=c((()=>{if(!A||!w||!Array.isArray(H))return!1;const e=m.filter((e=>!e.disabled));return H.length===e.length}),[A,w,m,H]),ne=c((()=>{if(!A||!Array.isArray(H))return[];const e=new Set(H);return m.filter((t=>e.has(t.value)))}),[A,m,H]),le=c((()=>{const e={};return m.forEach((t=>{const i=t.heading??"";e[i]||(e[i]=[]),e[i].push(t)})),e}),[m]),ae=c((()=>!L&&(!!H&&(Array.isArray(H)?H.length>0:""!==H))),[H,L]),se=g((e=>{e.stopPropagation(),Z(A?[]:"")}),[A,Z]),Ce=g((e=>{"enter"===Y&&"Enter"===e.key&&(e.stopPropagation(),oe(e))}),[Y,oe]),de=g((()=>t(a,{direction:"row",alignItems:"center",gap:"5px",children:[ae&&!X&&e(r,{size:"small",onClick:se,onKeyDown:Ce,children:e(Li,{sx:{fontSize:"14px"}})}),e(r,{size:"small",onClick:e=>{e.stopPropagation(),_((e=>!e))},onKeyDown:e=>{"Enter"===e.key&&(e.stopPropagation(),_((e=>!e)))},children:e(yi,{fontSize:"small",sx:{transform:X?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out"}})})]})),[ae,se,Ce,X,_]);if(k)return t(a,{gap:"10px",children:[d&&"custom"===F&&e(Se,{width:120,height:"18.69px",sx:{transform:"scale(1)"}}),e(Se,{height:"35.69px",sx:{transform:"scale(1)"}})]});const Ae=()=>y&&N.current?O:H;return t(a,{gap:"5px",children:[d&&"custom"===F&&e(Pe,{required:C,disabled:u,children:d}),t(a,{direction:"row",justifyContent:"space-between",gap:"10px",alignItems:"start",children:[t(lc,{fullWidth:!0,error:I,disabled:u,required:C,sx:"default"===F?{...eC(F),"& .MuiOutlinedInput-notchedOutline":{"& legend":{maxWidth:0,"& span":{padding:"0 5px"}}},"& .MuiInputLabel-root.MuiInputLabel-shrink + .MuiInputBase-root .MuiOutlinedInput-notchedOutline legend":{maxWidth:"100%"}}:void 0,children:[d&&"default"===F&&e(Pe,{id:`${s}-label`,sx:tC(F),children:d}),e(Ri,{...K,...D,multiple:A,value:Ae()??(A?[]:""),label:"default"===F?d:void 0,labelId:"default"===F&&d?`${s}-label`:void 0,inputProps:{"aria-label":"custom"===F&&d?d:void 0},onChange:e=>{const t=e.target.value;if(y)N.current=!0,A&&Array.isArray(t)&&t.includes("select-all")?P(Array.isArray(O)&&O.length===m.filter((({disabled:e})=>!e)).length?[]:m.filter((({disabled:e})=>!e)).map((({value:e})=>e))):P(t);else{if(A&&Array.isArray(t)){if(t.includes("select-all"))return void(e=>{if(e){const e=m.filter((e=>!e.disabled)).map((e=>e.value));Z(e)}else Z([])})(!re);if(v&&t.length>v)return void Ws.error({title:V("common.select.limitExceed",{maxLimit:v})})}Z(t)}},open:X,onOpen:()=>{_(!0)},onClose:()=>{_(!1),te(),y&&N.current&&(Z(O),N.current=!1,P(null))},inputRef:e=>ee(e),onKeyDown:e=>{ie(e,(()=>{_(!1)}),X)},renderValue:D.renderValue??(i=>{if(!A){const o=m.find((e=>e.value===i)),r=()=>o?o.label:"default"===F&&d?"":S;return t(M,{sx:{display:"flex",alignItems:"center",gap:1},children:[B&&o?.avatar&&e(we,{src:o.avatar??"",sx:{width:20,height:20}}),e(q,{variant:"body2",color:z,sx:{WebkitTextFillColor:z},noWrap:!0,children:r()})]})}if(!Array.isArray(i)||0===i.length){return e(q,{sx:{WebkitTextFillColor:z},color:z,variant:"body2",noWrap:!0,children:"default"!==F||!d||S?S:""})}const o=ne.slice(0,R),r=ne.length-R;return t(M,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[o.map((t=>e(q,{variant:"body2",noWrap:!0,color:z,sx:{WebkitTextFillColor:z,backgroundColor:j[800],padding:"2px 5px",borderRadius:"12px",fontSize:"12px",maxWidth:"120px"},children:t.label},t.value))),r>0&&t(q,{variant:"body2",color:z,sx:{WebkitTextFillColor:z,backgroundColor:j[300],padding:"2px 5px",borderRadius:"12px",fontSize:"12px",fontWeight:500},children:["+",r]})]})}),IconComponent:de,displayEmpty:!0,MenuProps:{PaperProps:{sx:{width:"inherit",maxHeight:300,"& .MuiList-root":{paddingTop:0,paddingBottom:0}}},MenuListProps:{...D.MenuProps?.MenuListProps,variant:"menu"}},children:Object.entries(le).length?(()=>{const o=[],r=Ae(),n=A&&Array.isArray(r)?new Set(r):new Set;return A&&w&&m.length>0&&(o.push(t(l,{value:"select-all",children:[e(b,{icon:e(Os,{size:"small"}),checkedIcon:e(Ps,{size:"small"}),indeterminate:Array.isArray(r)&&r.length>0&&r.length<m.filter((({disabled:e})=>!e)).length,checked:Array.isArray(r)&&r.length===m.filter((e=>!e.disabled)).length,sx:{marginRight:1}}),e(vi,{primary:"Select All"})]},"select-all")),o.push(e($,{sx:{margin:"0px !important"}},"divider-select-all"))),Object.entries(le).forEach((([a,s])=>{a&&o.push(e(ac,{children:a},`group-${a}`)),s.forEach((a=>{const s=A?n.has(a.value):r===a.value;o.push(e(l,{value:a.value,disabled:a.disabled,children:Q?Q(a,s):t(i,{children:[A&&e(b,{icon:e(Os,{size:"small"}),checkedIcon:e(Ps,{size:"small"}),checked:s,sx:{marginRight:1}}),t(M,{sx:{display:"flex",alignItems:"center",gap:1},children:[B&&a.avatar&&e(we,{src:a.avatar,alt:a.label,sx:{width:24,height:24}}),e(vi,{primary:a.label})]})]})},a.value))}))})),o})():e(l,{disabled:!0,children:e(vi,{primary:"No options"})})}),E&&e(Mi,{children:E})]}),x&&e(bl,{disabled:u,onClick:x})]})]})}const Cc=()=>e(Se,{width:50,height:18,sx:{borderRadius:"10px"},variant:"rectangular"});function dc({name:t,rules:i,control:o,defaultValue:r,loading:n=!1,navigationKey:l,...a}){const s=J(),{butterflyBlue:C,iron:d}=s.palette.app.color,{field:{value:A=!1,...c}}=$e({name:t,control:o,defaultValue:r,rules:i}),{navigationKey:h}=Fo(),p=l??h,{setInputRef:u,maintainFocus:g,handleKeyDown:m}=ir({navigationKey:p});if(n)return e(Cc,{});return e(Ui,{checked:A,...c,...a,inputRef:u,onKeyDown:e=>{m(e,void 0,!1),a.onKeyDown&&a.onKeyDown(e)},onChange:e=>{c.onChange(e),g()},sx:{padding:1,"& .MuiSwitch-track":{borderRadius:11,backgroundColor:d[900],position:"relative","&::before":{content:"unset",position:"absolute",top:"50%",transform:"translateY(-50%)",width:16,height:16,left:12},[Di.input]:{width:"80px !important"},"&::after":{content:"unset",position:"absolute",top:"50%",transform:"translateY(-50%)",width:16,height:16,right:12}},"& .MuiSwitch-thumb":{boxShadow:"none",width:16,height:16,margin:.15,color:"white"},"& .Mui-checked + .MuiSwitch-track":{backgroundColor:`${C[900]} !important`,opacity:"1 !important"}}})}const Ac=({label:i,styling:o,size:r})=>t(a,{gap:"5px",flex:1,children:[i&&"custom"===o&&e(Se,{width:120,height:"18.69px",sx:{transform:"scale(1)"}}),e(Se,{height:`${Ns(r).inputHeight}px`,width:"100%",sx:{transform:"scale(1)"}})]});function cc({control:i,defaultValue:o,disabled:r=!1,label:n,name:l,error:s,helperText:C,loading:d=!1,required:A=!1,rules:c,format:h="HH:mm",isReturnLocalTime:p=!1,isReturnDateWithTime:u=!1,styling:g="custom",navigationKey:m,size:f,...k}){const{field:{value:E,onChange:I,...S}}=$e({name:l,control:i,defaultValue:o,rules:c}),{navigationKey:w}=Fo(),B=m??w,{inputRef:x,maintainFocus:Q,handleKeyDown:M}=ir({navigationKey:B}),{inputHeight:b,inputFontSize:v}=Ns(f),R=J(),{butterflyBlue:L}=R.palette.app.color;s&&E&&"object"==typeof E&&(C="Invalid time");const y=E?U.fromISO(E):null;return d?e(Ac,{label:n,styling:g,size:f}):t(a,{gap:"5px",children:[n&&"custom"===g&&e(Pe,{required:A,disabled:r,children:n}),e(Zi,{...S,...k,disabled:r,value:y,onChange:e=>{if(e?.isValid){if(p)return I(e.toFormat(h)),void Q();if(u)return I(e.toUTC().toISO()),void Q();I(e.toUTC().toISOTime()),Q()}else I(e),Q()},slotProps:{textField:{disabled:r,helperText:C,error:s,label:"default"===g?n:void 0,required:"default"===g?A:void 0,inputRef:x,InputLabelProps:_s(g,f),onKeyDown:e=>{M(e,void 0,!1)},sx:{...$s(g),width:"100%","& .MuiInputBase-root":{fontSize:v,height:b},backgroundColor:"white","& .Mui-selected":{backgroundColor:L[900],borderRadius:"5px"}}}},format:h,helperText:C,sx:{backgroundColor:"white","& .Mui-selected":{backgroundColor:L[900],borderRadius:"5px"},"& .MuiOutlinedInput-input":{fontSize:v}}})]})}const hc=({label:i,styling:o,size:r})=>{const{inputHeight:n}=Ns(r);return t(a,{gap:"5px",flex:1,children:[i&&"custom"===o&&e(Se,{width:120,height:"18.69px",sx:{transform:"scale(1)"}}),e(Se,{height:`${n}px`,width:"100%",sx:{transform:"scale(1)"}})]})};function pc({control:i,defaultValue:o,disabled:r=!1,label:n,readOnly:l=!1,name:s,error:C=!1,helperText:d,loading:A=!1,required:c=!1,rules:p,format:u="HH:mm",isReturnLocalTime:g=!1,isReturnDateWithTime:m=!1,timeStepsMinutes:f=1,helperIcon:k,toolTipText:E,containerProps:I,styling:S="custom",navigationKey:w,size:B,...x}){const{field:{value:Q,onChange:M,...b}}=$e({name:s,control:i,defaultValue:o,rules:p}),[v,R]=h(!1),{navigationKey:L}=Fo(),y=w??L,{setInputRef:F,maintainFocus:D,maintainFocusAfterClose:Z,handleKeyDown:H,handleEnterNavigation:K}=ir({isOpen:v,navigationKey:y}),{inputHeight:G,inputFontSize:Y}=Ns(B);C&&Q&&"object"==typeof Q&&(d="Invalid time");const V=J(),{butterflyBlue:T}=V.palette.app.color,j=Q?U.fromISO(Q):null;return A?e(hc,{label:n,styling:S,size:B}):t(a,{gap:"5px",...I,children:[n&&"custom"===S&&t(a,{alignItems:"center",flexDirection:"row",gap:"5px",children:[e(Pe,{required:c,disabled:r,children:n}),k&&E&&e(W,{title:E,placement:"bottom",children:k})]}),e(Hi,{...b,...x,disabled:r,readOnly:l,open:v,ampm:!1,value:j,format:u,onOpen:()=>R(!0),onClose:()=>{R(!1),Z()},timeSteps:{minutes:f},slotProps:{textField:{disabled:r,helperText:d,error:C,label:"default"===S?n:void 0,required:"default"===S?c:void 0,inputRef:F,InputLabelProps:_s(S,B),sx:{...$s(S),width:"100%","& .MuiInputBase-root":{fontSize:Y,height:G},backgroundColor:"white","& .Mui-selected":{backgroundColor:T[900],borderRadius:"5px"},"& .MuiOutlinedInput-input":{fontSize:Y}},onKeyDown:e=>{if("enter"===y){if(" "===e.key&&!v&&!r&&!l)return e.preventDefault(),e.stopPropagation(),void R(!0);if("Enter"===e.key&&!v)return e.preventDefault(),e.stopPropagation(),void K(e);if("Enter"===e.key&&v)return e.preventDefault(),e.stopPropagation(),R(!1),Z(),void requestAnimationFrame((()=>{K(e)}))}H(e,(()=>R(!1)),v)}},openPickerButton:{..."enter"===y?{onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),K(e))}}:{}},popper:{sx:{"& .MuiMultiSectionDigitalClockSection-root::after":{display:"unset"},"& .MuiList-padding":{padding:"10px"},"& .MuiMultiSectionDigitalClockSection-item":{padding:"4px"},"& .MuiMultiSectionDigitalClockSection-item.Mui-selected":{backgroundColor:T[900],borderRadius:"5px"},"& .MuiMultiSectionDigitalClockSection-item.Mui-selected:hover":{backgroundColor:T[900],borderRadius:"5px"},"& .Mui-selected:hover":{backgroundColor:T[900],borderRadius:"5px"},"& .MuiMultiSectionDigitalClockSection-item.Mui-selected:focus-visible":{backgroundColor:T[900],borderRadius:"5px"},"& .Mui-selected:focus-visible":{backgroundColor:T[900],borderRadius:"5px"}},onKeyDown:e=>{"enter"===y&&"Enter"===e.key&&v&&(e.preventDefault(),e.stopPropagation(),R(!1),Z(),requestAnimationFrame((()=>{K(e)})))}}},onChange:e=>{if(e?.isValid){if(g)return M(e.toFormat(u)),void D();if(m)return M(e.toUTC().toISO()),void D();M(e.toUTC().toISOTime()),D()}else M(e),D()}})]})}function uc({field:i,control:o,index:r}){const n=J(),{iron:l}=n.palette.app.color;return e(a,{direction:"row",component:"li",children:t(a,{direction:"row",alignItems:"center",border:"1px solid",flexGrow:1,borderColor:l[700],children:[e(Kl,{padding:{paddingLeft:"24px"},children:e(q,{sx:{flexGrow:1},children:i.headerName})}),e(dc,{control:o,name:`columns.${r}.hide`})]})})}function gc({column:i}){const o=J(),{lightBlue:r,iron:n}=o.palette.app.color;return e(a,{border:"1px solid",bgcolor:r[100],borderColor:n[700],children:e(Kl,{padding:{padding:"0px 24px"},children:t(a,{direction:"row",alignItems:"center",justifyContent:"space-between",minHeight:"38px",children:[e(q,{children:i.headerName}),e(Ki,{htmlColor:n[800]})]})})})}function mc({lockedColumns:o,fields:r,control:n}){return t(i,{children:[o.map((({field:t="fid",colId:i="cid",headerName:o})=>e(gc,{column:{field:t,colId:i,headerName:o}},t??i))),e(a,{component:"ul",sx:{m:0,p:0},children:r.map(((t,i)=>e(uc,{field:t,control:n,index:i},t.id)))})]})}function fc({columns:t,children:i}){const o=c((()=>t.filter((e=>!("hide"in e)))),[t]),r=c((()=>t.filter((e=>"hide"in e)).map((e=>({...e,hide:!e.hide})))),[t]),n=p(r),{control:l,reset:a,getValues:s,setValue:C}=et({defaultValues:{columns:n.current}}),{fields:d}=tt({name:"columns",control:l});return c((()=>{C("columns",r)}),[t]),i({reset:e=>{a({columns:e?Array.isArray(e)?e:[e]:n.current})},getValues:s,columnList:e(mc,{fields:d,lockedColumns:o,control:l})})}function kc({columns:i,open:o,onClose:r,onSave:n,title:l="Column Chooser"}){const a=(e=>c((()=>e.filter((({field:e,colId:t})=>!!e||!!t)).map((({field:e,hide:t,headerName:i,colId:o})=>{const r={field:e??o,headerName:i};return null!=t&&(r.hide=t),r}))),[e]))(i);return e(fc,{columns:a,children:({columnList:i,reset:a,getValues:s})=>e(AC,{title:l,open:o,onClose:()=>{r(),a()},maxWidth:"xs",actions:t(wC,{sx:{justifyContent:"space-between",flex:1},children:[e(vr,{variant:"outlined",onClick:()=>a(),children:"Reset"}),e(vr,{onClick:()=>{const e=s(),t=Gi(e.columns.map((({field:e,colId:t,hide:i})=>[e??t,i])));n(t),r()},children:"Apply"})]}),children:i})})}const Ec=()=>e(Vi,{className:"bullet-hover",sx:{fontSize:"6px",borderRadius:"50%"}}),Ic=({href:t="/",style:i,scroll:o=!1,...r})=>{const n=ji(),l=Wi(),a=lr(t),{pathname:s,query:d}=a,A=c((()=>{if("string"!=typeof t)return{pathname:t??"/",query:void 0};if(n!==s)return a;const e=Array.from(l.entries()),i={...e.length?Object.fromEntries(e):void 0,...d};return{pathname:s,query:Object.keys(i).length?i:void 0}}),[n,l,t,s,d]);return e(C,{...r,prefetch:!1,scroll:o,style:{textDecoration:"none",outline:"none",...i},href:A})},Sc=({selected:i=!1,icon:o=e(Ec,{}),title:r,endAdornment:n,sx:l,href:s,onClick:C,isShowEndAdornment:d=!1,preventRedirection:A=!1,onPreventRedirection:c,onMenuClick:h,...p})=>{const u=J(),{isMobile:g}=or(),{butterflyBlue:m,iron:f}=u.palette.app.color;return t(Ti,{...p,...d?{}:s?{component:Ic,href:s}:{},onClick:e=>{h&&h(),(!s||d||A)&&(c?.(),C(),e.preventDefault())},sx:{padding:"9.5px 16px",...l,margin:"0",cursor:g||!d?"pointer":"default",userSelect:"none",textDecoration:"none",fontSize:"13px",wordBreak:"break-word",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",flex:1,width:"100%",color:i?f[600]:u.palette.primary.light,":hover":{color:f[600],".bullet-hover":{color:i?"":m[900]}}},children:[t(a,{alignItems:"center",direction:"row",flex:1,gap:"10px",justifyContent:"center",children:[o,r&&e(vi,{primary:r,disableTypography:!0,sx:{...l,marginTop:"6px",padding:"0",textAlign:"left"}})]}),n]})},wc=({icon:t=e(Ec,{}),title:i,isShowEndAdornment:o=!1,selected:r=!1,onMouseEnter:n,href:l,onClick:a,onPreventRedirection:s,preventRedirection:C,onMenuClick:d})=>{const A=J(),{butterflyBlue:c,slate:h}=A.palette.app.color;return e(M,{component:"li",sx:{bgcolor:r&&!o?c[900]:"",padding:i?"0px":"2.5px 0",wordBreak:"break-word"},children:e(Sc,{onClick:a,preventRedirection:C,onPreventRedirection:s,sx:{fontSize:"13px",padding:"9.5px 16px",":focus-visible":{border:`1px solid ${c[900]}`,backgroundColor:h[900]},margin:"0"},selected:r,title:i,icon:t,onMenuClick:d,onMouseEnter:n,href:l,isShowEndAdornment:o,endAdornment:o&&e(Bt,{sx:{fontSize:"16px"}})})})},Bc=({currentPathMenuOpen:o,currentMenuItem:r,onCloseMenuPopover:n,preventRedirection:l=!1,onPreventRedirection:a,onMenuClick:s})=>{const[C,d]=h([]);if(u((()=>{if(!r)return void d([]);const{title:e,key:t,menuItems:i}=r;d([{title:e,items:i??[],parentPath:`/${t}`,currentPathMenuOpen:o[t]??{}}])}),[r,o]),!r)return e(i,{children:"Loading..."});const A=C[C.length-1];if(!A)return null;const c=C.length>1;return t(Yi,{disablePadding:!0,children:[c&&e(wc,{title:A.title,icon:e(wt,{sx:{fontSize:"16px"}}),onClick:()=>{d((e=>e.slice(0,-1)))},onPreventRedirection:a,preventRedirection:l,selected:!1}),A.items.filter((({isView:e})=>!1!==e)).map((t=>{const i=Boolean(t.menuItems?.length),{title:o,icon:r,key:C}=t,c=Boolean(A.currentPathMenuOpen[C]),h=`${A.parentPath}/${C}`;return e(wc,{onClick:()=>{i?(e=>{const{title:t,menuItems:i,key:o}=e;d((e=>{const r=e[e.length-1];return r?[...e,{title:t,items:i??[],parentPath:`${r.parentPath}/${o}`,currentPathMenuOpen:r.currentPathMenuOpen[o]??{}}]:e}))})(t):((e,t="_self")=>{const{key:i,onClick:o}=e,r=`${A.parentPath}/${i}`;o&&(o(r,t),"_blank"!==t&&n())})(t)},onPreventRedirection:a,preventRedirection:l,title:o,icon:r,onMenuClick:i?void 0:s,isShowEndAdornment:i,selected:c,href:i?void 0:h},C)}))]})},xc=({open:t,anchorEl:i,children:o})=>{const r=J(),{mirage:n}=r.palette.app.color,l=p(null),[a,s]=h(null),C=g((()=>{const e=l.current;if(!i||!e||i instanceof Element&&!i.isConnected)return;const t=((e,t)=>{const{top:i,left:o,right:r}=e.getBoundingClientRect(),{offsetHeight:n,offsetWidth:l}=t,a=l||203,{innerHeight:s,innerWidth:C}=window,d=n<=s-i-8?i:s-n-8;return{top:Math.max(8,Math.min(d,s-8)),left:a<=C-r-8?r:Math.max(8,o-a)}})(i,e);s((e=>{const{top:i,left:o}=t;return e?.top===i&&e?.left===o?e:t}))}),[i]),d=g((e=>{l.current=e,e&&C()}),[C]);if(E((()=>{if(!t||!i)return void s(null);C();const e=window.requestAnimationFrame((()=>{C()}));window.addEventListener("resize",C),window.addEventListener("scroll",C,!0);const o=l.current,r="undefined"!=typeof ResizeObserver&&o?new ResizeObserver((()=>C())):null;return o&&r&&r.observe(o),()=>{window.cancelAnimationFrame(e),window.removeEventListener("resize",C),window.removeEventListener("scroll",C,!0),r?.disconnect()}}),[t,i,C,o]),!t)return null;const{top:A=0,left:c=0}=a??{};return e(qi,{children:e(M,{ref:d,role:"presentation",style:{position:"fixed",top:A,left:c,width:203,zIndex:1300,visibility:a?"visible":"hidden",pointerEvents:a?"auto":"none"},sx:{background:n[900]},children:o})})},Qc=({item:i,parentPath:o,currentPathMenuOpen:r,onCloseMenuPopover:n,onPreventRedirection:l,preventRedirection:a,onMenuClick:s})=>{const[C,d]=h(null),A=Boolean(C),{key:c,title:p,icon:u,menuItems:g,onClick:m,isView:f}=i;if(!1===f)return;const k=()=>{d(null)},E=Boolean(r[c]),I=`${o}/${c}`;return t(M,{onMouseLeave:k,children:[e(wc,{onClick:(e="_self")=>{m&&(m(`${o}/${c}`,e),"_blank"!==e&&(k(),n()))},onPreventRedirection:l,preventRedirection:a,title:p,icon:u,onMenuClick:s,isShowEndAdornment:Boolean(g?.length),selected:E,onMouseEnter:e=>{g?.length&&d(e.currentTarget)},href:I}),g?.length&&A&&e(xc,{open:!0,anchorEl:C,children:e(Yi,{disablePadding:!0,children:g.map((t=>e(Qc,{item:t,parentPath:I,currentPathMenuOpen:r[c]??{},onCloseMenuPopover:n,preventRedirection:a,onPreventRedirection:l,onMenuClick:s},t.key)))})})]})},Mc=t=>{const{isMobile:o}=or();if(o)return e(Bc,{...t});const{currentPathMenuOpen:r,currentMenuItem:n,onCloseMenuPopover:l,preventRedirection:a=!1,onPreventRedirection:s,onMenuClick:C}=t;return n?e(Yi,{disablePadding:!0,children:n.menuItems?.filter((({isView:e})=>!1!==e)).map((t=>e(Qc,{item:t,onMenuClick:C,parentPath:`/${n.key}`,currentPathMenuOpen:r[n.key]??{},onCloseMenuPopover:l,preventRedirection:a,onPreventRedirection:s},t.key)))}):e(i,{children:"Loading..."})},bc=({menuItems:o,currentPathname:r,anchorEl:n,setAnchorEl:l,preventRedirection:a=!1,onPreventRedirection:s,onMenuClick:C})=>{const[d,A]=h(),[p,u]=h({});c((()=>{const e=Mr(r);if(N(e))return u({home:!0});u(e)}),[r]);const g=()=>{l(null)};return t(i,{children:[o.filter((({isView:e})=>!1!==e)).map((t=>{const{onClick:i,key:o,icon:r,menuItems:n=[]}=t,d=""===o?"/":`/${o}`,c=!!p?.[o];return e(wc,{onClick:e=>{if(i){if(""===o)return void i("/",e);i(`/${o}`,e)}},onMenuClick:C,onMouseEnter:e=>{n?.length?(l(e.currentTarget),A(t)):g()},href:n.length?void 0:d,icon:r,onPreventRedirection:s,preventRedirection:a,selected:c},o)})),!!n&&e(M,{onMouseLeave:g,children:e(xc,{open:!0,anchorEl:n,children:e(Mc,{currentMenuItem:d,currentPathMenuOpen:p,onCloseMenuPopover:g,preventRedirection:a,onPreventRedirection:s,onMenuClick:C})})})]})};v(M)((({theme:e})=>({width:7,height:7,borderRadius:"50%",background:e.palette.app.color.butterflyBlue[400]})));const Jc=v(zi,{shouldForwardProp:e=>"open"!==e})((({theme:e,open:t})=>{const i=e=>({width:300,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden",backgroundColor:e.palette.app.color.mirage[900],[e.breakpoints.down("md")]:{width:"80px"}}),o=e=>({transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"0px",[e.breakpoints.up("md")]:{width:"80px"},backgroundColor:e.palette.app.color.mirage[900]});return{width:300,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",...t&&{...i(e),"& .MuiDrawer-paper":i(e)},...!t&&{...o(e),"& .MuiDrawer-paper":o(e)}}})),vc=({children:t,...i})=>e(Oi,{timeout:"auto",unmountOnExit:!0,...i,children:t}),Rc=({icon:t=e(Ec,{}),title:i,isShowEndAdornment:o=!1,selected:r=!1,onClick:n,isExpanded:l,sx:a,preventRedirection:s=!1,href:C,onPreventRedirection:d,onMenuClick:A})=>{const c=J(),{butterflyBlue:h}=c.palette.app.color;return e(M,{sx:{bgcolor:r&&!o?h[900]:""},children:e(Sc,{sx:a,title:i,icon:t,href:C,onClick:n,onMenuClick:A,selected:r,preventRedirection:s,onPreventRedirection:d,endAdornment:o&&e(l?Pi:Ni,{})})})},Lc=(e,t)=>{if(0===t.length)return!1;if("object"!=typeof e)return!1;const[i,...o]=t;if(!i)return!1;const r=e[i];return 0===o.length?Boolean(r):Lc(r,o)},yc=e=>!0===e||"object"==typeof e&&null!==e&&Object.values(e).every(yc),Fc=({menuItem:i,level:o=0,parentPath:r="",subMenusOpen:n,setSubMenusOpen:l,currentPathMenuOpen:a,preventRedirection:s=!1,onPreventRedirection:C,onMenuClick:d})=>{const A=J();if(3===o)return;const{butterflyBlue:c,slate:h}=A.palette.app.color,{key:p,icon:u,title:g,isView:m,onClick:f,menuItems:k=[]}=i;if(!1===m)return;const E=r?`${r}/${p}`:p,I=E.split("/"),S=((e,t)=>{const i=Lc(e,t);return Boolean(i)})(n,I),w=((e,t)=>{const i=t.reduce(((e,t)=>{if("object"==typeof e&&null!==e&&t in e)return e[t]}),e);return yc(i)})(a,I),B=""===p?"/":`/${E}`;return t(M,{children:[e(Rc,{sx:{paddingLeft:3*o+1.5,fontSize:"13px",":focus-visible":{border:`1px solid ${c[900]}`,backgroundColor:h[900]}},onClick:e=>{if(k.length>0){if(w)return;l((e=>{const t={...e};let i=t;for(let e=0;e<I.length-1;e++){const t=I[e];t&&(i[t]="object"==typeof i[t]?i[t]:{},i=i[t])}const o=I[I.length-1];return o&&(i[o]=!S),t}))}else f&&!w&&f(B,e)},onMenuClick:d,href:0===k.length?B:"",icon:0===o?u:void 0,title:g,isShowEndAdornment:k.length>0&&o<2,selected:w,isExpanded:S,preventRedirection:s,onPreventRedirection:C}),k.length>0&&e(vc,{in:S,children:e(Yi,{component:"div",disablePadding:!0,children:k.map((t=>e(Fc,{menuItem:t,level:o+1,parentPath:E,onMenuClick:d,subMenusOpen:n,setSubMenusOpen:l,currentPathMenuOpen:a,preventRedirection:s,onPreventRedirection:C},t.key)))})})]},p)},Uc=({menuItems:t,currentPathname:i,preventRedirection:o=!1,onPreventRedirection:r,onMenuClick:n})=>{const[l,a]=h({}),[s,C]=h({});return u((()=>{const e=Mr(i);if(N(e))return a({home:!0}),void C({home:!0});const t=JSON.parse(JSON.stringify(e)),o=JSON.parse(JSON.stringify(e));a(t),C(o)}),[i]),t.map((t=>e(Fc,{menuItem:t,subMenusOpen:l,setSubMenusOpen:a,onMenuClick:n,currentPathMenuOpen:s,preventRedirection:o,onPreventRedirection:r},t.key)))},Dc=({menuItems:i=[],open:o,currentPathname:r,preventRedirection:n=!1,onLogoClick:l,onPreventRedirection:a,onMenuClick:s,href:d,preventClick:A=!1,openLogoUrl:c,closedLogoUrl:p})=>{const[u,g]=h(null),[m,f]=h(null),k=()=>{g(null)},{layout:E}=or(),I="desktop"===E,S=I&&o,w=S?c:p,B=!!w&&m===w,x=()=>w&&!B?e(M,{sx:{display:"flex",justifyContent:"center",alignItems:"center",px:S?2:1,width:"100%",boxSizing:"border-box"},children:e(YA,{mode:"view",variant:"auto",value:w,label:"",enableFullImageView:!1,hideBorder:!0,size:S?"medium":"small",maxPreviewWidth:S?220:48,maxPreviewHeight:S?48:40,onError:()=>f(w)})}):e(S?Nn:Xn,{});return t(Jc,{variant:"permanent",open:o,children:[t(M,{textAlign:"center",sx:{cursor:d||l?"pointer":"default"},component:d?C:"div",onClick:()=>{l&&!A&&l()},href:d,children:[I&&e(Kl,{padding:{paddingTop:"1.5rem"},children:x()}),!I&&e(Kl,{padding:{paddingTop:"0.5rem",paddingBottom:"0.5rem"},children:x()})]}),I&&e(Yi,{component:"nav",onMouseLeave:k,children:o?e(Uc,{menuItems:i,onMenuClick:s,currentPathname:r,preventRedirection:n,onPreventRedirection:a}):e(bc,{menuItems:i,currentPathname:r,anchorEl:u,onMenuClick:s,setAnchorEl:g,preventRedirection:n,onPreventRedirection:a})}),!I&&e(re,{onClickAway:k,children:e(Yi,{component:"nav",onMouseLeave:k,children:e(bc,{menuItems:i,onMenuClick:s,currentPathname:r,anchorEl:u,setAnchorEl:g,preventRedirection:n,onPreventRedirection:a})})})]})},Zc=e=>e?Array.isArray(e)?e:[e]:[],Hc=e=>e.zIndex.drawer+200,Kc=({title:o,children:n,onClose:l,actions:s,headerSlot:C,isHideHeader:d=!1,isHideFooter:A=!1,isHideCloseIcon:c=!1,isHideDividers:h=!1,disableEscapeKeyDown:p=!1,anchor:u="right",sx:g,ModalProps:m,...f})=>{const k=!A&&!!s,E=Zc(g),I=Zc(m?.sx);return e(zi,{...f,anchor:u,onClose:l,sx:[e=>({zIndex:Hc(e),"& .MuiBackdrop-root":{zIndex:Hc(e)},"& .MuiDrawer-paper":{display:"flex",flexDirection:"column",zIndex:Hc(e)}}),...E],ModalProps:{...m,disableEscapeKeyDown:p,sx:[e=>({zIndex:Hc(e)}),...I]},children:t(a,{flex:1,sx:{overflow:"hidden"},children:[!d&&t(i,{children:[e(Kl,{padding:{padding:"10px"},children:t(a,{direction:"row",alignItems:"center",children:[e(M,{flex:1,children:C??e(q,{variant:"h6",fontWeight:500,children:o})}),!c&&e(r,{onClick:e=>l?.(e,"escapeKeyDown"),color:"secondary",size:"small","aria-label":"Close",onMouseDown:e=>e.preventDefault(),children:e(At,{fontSize:"medium"})})]})}),!h&&e($,{})]}),e(M,{flex:1,sx:{overflowY:"auto",overflowX:"hidden"},children:n}),k&&t(i,{children:[!h&&e($,{}),e(Kl,{padding:{padding:"10px"},children:s})]})]})})},Gc=({open:i=!1,anchorEl:o,onClose:n,children:l,onApply:s,showDivider:C=!1,title:d,required:A})=>{const c=J(),{slate:h}=c.palette.app.color,p=()=>{te(s)&&s(),te(n)&&n({},"backdropClick")};return t(ce,{open:i,anchorEl:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},onClose:()=>{p()},onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),p())},sx:{"& .MuiPaper-root":{minWidth:"300px"}},children:[C&&t(a,{alignItems:"flex-end",children:[e(Kl,{padding:{padding:"8px"},children:t(a,{direction:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:[t(a,{direction:"row",alignItems:"center",gap:"5px",children:[t(q,{variant:"h6",children:[d," "]}),A&&e(q,{variant:"h6",color:"error",children:"*"})]}),e(r,{onClick:p,children:e(Li,{})})]})}),e($,{sx:{width:"100%"}})]}),e(M,{sx:{background:h[600],borderRadius:"5px"},children:l})]})},Yc=({open:i,anchorEl:o,onClose:n,children:l,onApply:s,showDivider:C=!1,showFooter:d=!0,title:A,required:c,filterItem:p,reset:g,background:m=!1,currentFilterValue:f})=>{const k=J(),{slate:E}=k.palette.app.color,[I,S]=h(null),[w,B]=h(!0);u((()=>{if(i){if(!I&&f){const e=p?.multiSelect?no(f):f;S(e)}}else S(null);if(f&&I){const e=p?.multiSelect?JSON.stringify(no(f))!==JSON.stringify(I):f!==I;B(!e)}}),[i,f,I,p?.multiSelect]);const x=()=>{S(null),te(g)&&g(),te(n)&&n({},"backdropClick")};return t(ce,{open:i,anchorEl:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},onClose:(e,t)=>{te(n)&&(n(e,t),x())},sx:{"& .MuiPaper-root":{minWidth:"300px"}},children:[C&&t(a,{alignItems:"flex-end",children:[e(Kl,{padding:{padding:"8px"},children:t(a,{direction:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:[t(a,{direction:"row",alignItems:"center",gap:"5px",children:[e(q,{variant:"h6",children:A}),c&&e(q,{variant:"h6",color:"error",children:"*"})]}),e(r,{onClick:x,children:e(Te,{})})]})}),e($,{sx:{width:"100%"}})]}),e(M,{sx:{background:m?E[600]:"transparent",borderRadius:"5px",maxWidth:"300px"},children:l}),d&&e(Kl,{padding:{padding:"10px"},children:e(M,{display:"flex",justifyContent:"flex-end",children:e(vr,{onClick:()=>{S(null),te(s)&&s()},disabled:w,variant:"text",sx:{maxWidth:"40px"},children:"Apply"})})})]})};function Vc({selectedFilter:t,control:i,errors:o,setIsPopupOpen:r,autoFocus:n=!1}){const l=J(),{sapphireBlue:a,black:s}=l.palette.app.color,C=o[t.key],{placeholder:d,label:A}=t,c=d??`Select ${A}`,h=d??A;return{autoComplete:t.options&&e(dC,{disableClearable:!0,multiple:t.multiSelect??!1,placeholder:c,name:`${t.key}`,disabled:t.isDisabled,loading:t.loading,shouldCloseOnSelect:t.shouldCloseOnSelect,control:i,options:t.options??[],onOpen:()=>r?.(!0),onClose:()=>r?.(!1),autoFocus:n,sx:{maxHeight:"250px",overflowY:"auto",width:"100%","& .MuiAutocomplete-tag":{backgroundColor:a[300],color:s[900]}},...t.employeeAutocomplete&&{isShowEmployeeData:!0,isShowOptionsOnType:!0,getOptionLabel:e=>"string"==typeof e?e:`${e.label} (${e.employee_code}) - ${e.punch_code}`},error:!!C,helperText:C?.message},t.key),text:e(zA,{name:t.key,control:i,disabled:t.isDisabled,placeholder:h,error:!!C,helperText:C?.message,autoFocus:n}),date:e(DC,{name:t.key,control:i,disabled:t.isDisabled,error:!!C,helperText:C?.message,autoFocus:n,minDate:t.minDate?U.fromISO(t.minDate):void 0,maxDate:t.maxDate?U.fromISO(t.maxDate):void 0,...t.monthYearFormat&&{format:"MMM yyyy",views:["year","month"]}}),dateRange:e(TC,{name:t.key,control:i,disabled:t.isDisabled,error:!!C,helperText:C?.message})}}const Tc=({open:i,anchorEl:o,filterItem:r,onClose:n,control:l,errors:s,onApply:C,currentFilterValue:d,reset:A})=>e(Yc,{title:r.label,required:r.required,filterItem:r,open:i,onClose:n,anchorEl:o,onApply:C,currentFilterValue:d,reset:A,showFooter:!0,showDivider:!0,background:!0,children:t(Kl,{padding:{padding:"10px"},children:[Vc({selectedFilter:r,control:l,errors:s})[r.type],"switch"===r.type&&t(a,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{padding:"10px 5px 10px 20px",margin:"auto"},children:[e(q,{variant:"body2",children:r.label}),e(dc,{control:l,name:r.key})]},r.key)]})}),jc=({open:t,anchorEl:i,filterItem:o,onClose:r,control:n,errors:l,onApply:a})=>e(Gc,{title:o.label,required:o.required,open:t,onClose:r,anchorEl:i,onApply:a,showDivider:!0,background:!0,children:e(Kl,{padding:{padding:"10px"},children:Vc({selectedFilter:o,control:n,errors:l})[o.type]})}),Wc=(e,t)=>{let i=e;if(t&&"autoComplete"===t.type&&(i=t.multiSelect&&Array.isArray(e)?t.options?.filter((t=>e.includes(t.value))).map((e=>e.label)).join(", "):t.options?.filter((t=>t.value===e)).map((e=>e.label)).join(", ")),"dateRange"===t.type&&Array.isArray(e)&&2===e.length){i=`${e[0]} <= Start Date <= ${e[1]}`}return i};function qc(e,t){const i=new Map(t.map((e=>[e.key,e])));return Object.fromEntries(Object.entries(e).flatMap((([e,t])=>{if(t){const o=i.get(e);return[[e,o?.monthYearFormat&&"string"==typeof t?U.fromISO(t).toFormat("yyyy-MM"):t]]}return[]})))}const zc=({filterListItems:o,isDisabled:n=!1,filterListData:l,onApply:s,onClear:C,onChange:d,isSingleCompany:A=!1,defaultComponyId:m,companyKey:f="company_id"})=>{const k=m??void 0,E=J(),{iron:I,slate:S}=E.palette.app.color,{layout:w}=or(),B="desktop"===w,Q="mobile"===w,[b,v]=h(null),R=p(null),L=p(null),[y,F]=h(!1),[D,Z]=h(!1),[H,K]=h(null),G=p(null),[Y,V]=h(!1),T=c((()=>A?o.filter((({key:e})=>e!==f)):o),[o,A,f]),j=c((()=>new Map(o.map((e=>[e.key,e])))),[o]),W=c((()=>new Map(T.map(((e,t)=>[e.key,t])))),[T]),z=g(((e,t)=>{K(e),L.current=t,Z(!0)}),[]),O=c((()=>function(e){return JSON.stringify(e.map((e=>{const{key:t,multiSelect:i,required:o,type:r,isDefaultCurrentDate:n,value:l,options:a}=e;return[t,i??!1,o??!1,r,n??!1,l??null,"autoComplete"===r&&o&&1===a?.length?a[0]?.value??null:null]})))}(o)),[o]),P=c((()=>{const e=o.reduce(((e,{key:t,multiSelect:i,options:o,required:r,type:n,value:l,isDefaultCurrentDate:a})=>(e[t]="autoComplete"===n&&r&&1===o?.length?i?[o[0]?.value]:o[0]?.value:i||"dateRange"===n?l||null:"switch"===n?l||!1:a&&"date"===n?l||U.now().toISODate():l||null,e)),{});return A&&(e[f]=k),e}),[O,A,k,f]),X=c((()=>function(e,t,i){return JSON.stringify([t,i,e.map((e=>{const{key:t,multiSelect:i,type:o,required:r,label:n}=e;return[t,i??!1,o,r??!1,n]}))])}(o,A,f)),[o,A,f]),_=c((()=>{const e={};o.forEach((({key:t,multiSelect:i,type:o})=>{e[t]=i||"dateRange"===o?ro.array(ro.string()).nullable().optional():"switch"===o?ro.boolean().nullable().optional():ro.string().nullable().optional()})),A&&(e[f]=ro.string().nullable().optional());const t=o.filter((({key:e,required:t})=>t&&!(A&&e===f)));return ro.object(e).superRefine(((e,i)=>{t.forEach((({key:t,required:o,label:r})=>{o&&!e[t]?.length&&i.addIssue({path:[t],message:`${r} is required`,code:ro.ZodIssueCode.custom})}))}))}),[X]),ee=c((()=>Xi(_)),[_]),{control:te,handleSubmit:ie,setValue:oe,reset:re,getValues:ne,formState:{errors:le,dirtyFields:ae}}=et({values:P,resolver:ee,mode:"all"});c((()=>{T&&0!==T.length&&T.forEach((({key:e,multiSelect:t,options:i,required:o})=>{if(o&&1===i?.length){ne(e)||oe(e,t?[i[0]?.value]:i[0]?.value)}}))}),[T]),u((()=>{A&&oe(f,k)}),[A,k,f]);const se=it({control:te}),Ce=se[f],de=se.business_unit_id,Ae=se.department_id,ce=()=>{v(null)},he=()=>{Ie((()=>{const e=new Set;return T.forEach((({type:t,key:i,required:o},r)=>{"switch"!==t&&(r===ke||P?.[i]||o)&&e.add(i)})),e}))},pe=()=>{const e=A?{...P,[f]:k}:P;re(e),C(),he(),ce()},ue=e=>{const t=e instanceof HTMLElement?e:e.currentTarget;v(t)},ge=e=>{F(!1),K(null);const t=A?{...e,[f]:k}:e,i={...oo(qc(t,o),(e=>io(e)||N(e))),...A?{[f]:k}:{}};Ie((()=>{const e=new Set;return T.forEach((({type:t,key:o,required:r},n)=>{"switch"!==t&&(n===ke||i[o]||r)&&e.add(o)})),e})),s(i,y,H?.key),ce()},me=e=>j.get(e),fe=c((()=>!!l&&Object.entries(l).some((([e,t])=>(!A||e!==f)&&(!!W.has(e)&&("boolean"==typeof t?t:!io(t)&&!N(t)))))),[l,W,A,f]),ke=c((()=>T.findIndex((({type:e})=>"switch"!==e&&"dateRange"!==e))),[T]),[Ee,Ie]=h((()=>{const e=new Set;return T.forEach((({type:t,key:i,required:o},r)=>{"switch"!==t&&(r===ke||l?.[i]||P?.[i]||o)&&e.add(i)})),e})),Se=g(((e,t)=>{Ie((i=>{const o=new Set(i);return t?o.add(e):o.delete(e),o}))}),[]),we=H?.key?"switch"===H.key?se[H.key]?"true":"false":se[H.key]:null,Be=c((()=>A?{...se,[f]:k}:se),[f,se,A,k]),xe=p(d);xe.current=d;const Qe=p(void 0),Me=p(y);Me.current=y,u((()=>{to(Qe.current,Be)||(Qe.current=Be,x((()=>{xe.current(Be,Me.current)})))}),[Be]);const be=p(P);u((()=>{to(be.current,P)||(be.current=P,to(ne(),P)||re(P))}),[P,ne,re]),u((()=>{Ie((e=>{const t=new Set;return T.forEach((({type:i,key:o,required:r},n)=>{"switch"!==i&&(n===ke||l?.[o]||P?.[o]||r||e.has(o))&&t.add(o)})),function(e,t){if(e.size!==t.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}(e,t)?e:t}))}),[T,l,P,ke]);const Je=p(o);Je.current=o;const ve=p(Ce);u((()=>{A||y?ve.current=Ce:to(ve.current,Ce)||(ve.current=Ce,Je.current.forEach((({key:e,isDefaultCurrentDate:t,type:i})=>{t&&"date"===i||e!==f&&oe(`${e}`,null)})),oe(f,Ce))}),[Ce,f,A,y]);const Re=p(de);u((()=>{y?Re.current=de:to(Re.current,de)||(Re.current=de,oe("business_unit_location_id",null))}),[de,y,oe]);const Le=p(Ae);u((()=>{y?Le.current=Ae:to(Le.current,Ae)||(Le.current=Ae,oe("sub_department_id",null))}),[Ae,y,oe]);const ye=Boolean(b),Fe=c((()=>0===Object.keys(ae).length&&Object.keys(se).every((e=>!(!A||e!==f)||(io(se[e])||N(se[e]))))),[se,ae,A]);return rr({key:"f",modifierKeys:["ctrl","shift"],onTrigger:()=>{if(n)return;const e=G.current??document.createElement("button");ue(e)}}),t(M,{sx:{flexGrow:1},children:[t(a,{direction:"row",justifyContent:{xs:"end",md:"space-between"},spacing:1,children:[B&&e(a,{direction:"row",alignItems:"center",sx:{maxWidth:{xs:"40vw",md:"45vw",lg:"57vw"}},children:!!l&&!!fe&&t(i,{children:[e(q,{variant:"body1",sx:{minWidth:"50px",marginRight:"5px"},children:"Filters:"}),e(a,{direction:"row",gap:"5px",alignItems:"center",sx:{flexWrap:"wrap",maxWidth:"100%"},children:(Ue=l,Object.entries(Ue).map((([t,i])=>{const r=(e=>W.get(e)??-1)(t);if(-1===r)return;if("boolean"!=typeof i&&!i)return;const a=me(t),C=T[r],d=a&&Wc(i,a),c=function(e){return Array.isArray(e)?e.join(", "):ar.test(e)?U.fromFormat(e,"yyyy-MM").toFormat("MMM yyyy"):sr.test(e)?U.fromFormat(e,"yyyy-MM-dd").toFormat("dd-MM-yyyy"):e}("object"==typeof d?JSON.stringify(d):String(d));return"boolean"==typeof i||c?e(Fs,{label:e(El,{toolTipLabel:`${c}`,children:e(q,{noWrap:!0,variant:"subtitle2",children:`${a?.label}: ${c}`})}),onDelete:()=>(e=>{const t=me(e);if(t?.required)return Ws.error({title:"This is a required custom filter field and cannot be removed."});oe(`${e}`,null);const i={...l};delete i[e],A&&(i[f]=k),s(i,!0,e)})(t),onClick:e=>{((e,t)=>{if(A&&e===f)return;if(e===f&&o?.some((({required:e})=>e)))return;F(!0),R.current=t.currentTarget;const i=me(e);i&&K(i)})(t,e)},disabled:n,shouldDisableFocus:C?.shouldDisableFocus??!1,shouldDisableRipple:C?.shouldDisableRipple??!1},t):void 0})))})]})}),t(a,{direction:"row",alignItems:"flex-start",children:[fe&&e(vr,{onClick:()=>pe(),variant:"text",sx:{minWidth:{xs:"60px",sm:"100px"}},children:Q?"Clear":"Clear Filter"}),!n&&e(vl,{isFiltered:fe,onClick:ue,ref:G})]})]}),e("form",{onSubmit:e=>{e.preventDefault(),Fe||ie((e=>{ge(e)}))()},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),Y||Fe||ie((e=>{ge(e)}))())},children:t(zi,{open:ye,onClose:(e,t)=>{"backdropClick"!==t&&ce()},anchor:"right",sx:{zIndex:E.zIndex.drawer+2,"& .MuiPaper-root":{width:"100%",maxWidth:{xs:"270px",sm:"350px"}}},children:[t(a,{sx:{background:I[600]},children:[e(Kl,{padding:{padding:"10px 30px"},children:t(a,{direction:"row",justifyContent:"space-between",width:"100%",alignItems:"center",children:[e(q,{variant:"h6",children:"Filter"}),e(r,{onClick:()=>{const e=A?{...P,[f]:k}:P;re(e),he(),ce()},children:e(Te,{})})]})}),e($,{sx:{width:"100%"}})]}),e(a,{flexGrow:1,sx:{overflowX:"hidden"},children:T.map(((t,i)=>e(Oc,{filter:t,index:i,firstNonSwitchIndex:ke,isExpanded:Ee.has(t.key),onExpandedChange:Se,control:te,fieldError:le[t.key],setIsPopupOpen:V,slate600:S[600],dateRangeValue:"dateRange"===t.type?se[t.key]:null,onDateRangeClick:z},t.key)))}),e($,{}),e(a,{children:e(Kl,{padding:{padding:"10px"},children:t(wC,{children:[e(vr,{type:"submit",disabled:Fe,variant:"contained",onClick:()=>{ie(ge)()},children:"Apply"}),e(vr,{type:"button",onClick:()=>pe(),disabled:Object.keys(se).every((e=>!(!A||e!==f)||!se[e])),variant:"outlined",children:"Reset"})]})})})]})}),H&&e(Tc,{open:y,onClose:()=>{H?.key&&oe(`${H?.key}`,l?.[H.key]),F(!1)},onApply:()=>{ie(ge)()},control:te,errors:le,reset:re,anchorEl:R.current,filterItem:H,currentFilterValue:we}),H&&e(jc,{open:D,onClose:()=>{H?.key&&oe(`${H?.key}`,l?.[H.key]),Z(!1)},onApply:()=>{Z(!1)},control:te,errors:le,anchorEl:L.current,filterItem:H})]});var Ue};const Oc=B((function({filter:i,index:o,firstNonSwitchIndex:r,isExpanded:n,onExpandedChange:l,control:s,fieldError:C,setIsPopupOpen:d,slate600:A,dateRangeValue:c,onDateRangeClick:h}){const{type:p,key:u,label:g,required:m,isDisabled:f,menuInfo:k}=i;return"switch"===p?t(a,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"80%",sx:{padding:"10px 5px 10px 20px ",margin:"auto"},children:[e(q,{variant:"body2",children:g}),e(dc,{control:s,name:u})]}):t(_i,{expanded:n,onChange:(e,t)=>{l(u,t)},disabled:f,sx:{boxShadow:"none","&.MuiAccordion-root.Mui-expanded":{margin:"0 !important"},"&.MuiAccordion-root.Mui-disabled":{backgroundColor:"transparent"}},children:[e(eo,{expandIcon:e(Ni,{}),"aria-controls":"panel1a-content",id:"panel1a-header",sx:{flexDirection:"row-reverse","& MuiAccordionSummary-root.Mui-expanded":{marginRight:"10px",transform:"rotate(-90deg)"},"&.Mui-expanded":{minHeight:"40px",paddingY:"5px"},"& .MuiAccordionSummary-content.Mui-expanded":{margin:"0px"}},children:t(a,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"90%",children:[t(a,{direction:"row",alignItems:"center",gap:"5px",children:[e(q,{variant:"body2",children:g}),m&&e(q,{color:"error",children:"*"})]}),e(q,{variant:"body2",children:k})]})}),e($i,{sx:{background:A,borderRadius:"5px",padding:"0px"},children:e(Kl,{padding:{paddingLeft:"15px",paddingY:"5px",paddingRight:"15px"},children:"dateRange"===p?t(a,{direction:"row",alignItems:"center",gap:"10px",onClick:e=>{h(i,e.currentTarget)},children:[e(M,{sx:{border:"1px solid black",borderRadius:"5px",width:"150px",p:1},children:e(q,{variant:"body2",children:Array.isArray(c)&&c[0]?U.fromISO(c[0]).toFormat(yC.dateWithEuropean):"Start Date"})}),e(q,{children:"~"}),e(M,{sx:{border:"1px solid black",borderRadius:"5px",width:"150px",p:1},children:e(q,{variant:"body2",children:Array.isArray(c)&&c[1]?U.fromISO(c[1]).toFormat(yC.dateWithEuropean):"End Date"})})]}):e(M,{children:Vc({selectedFilter:i,control:s,errors:C?{[u]:C}:{},setIsPopupOpen:d,autoFocus:o===r})[p]})})})]})}),(function(e,t){const{index:i,firstNonSwitchIndex:o,isExpanded:r,control:n,fieldError:l,slate600:a,onExpandedChange:s,setIsPopupOpen:C,onDateRangeClick:d,filter:A,dateRangeValue:c}=e,{index:h,firstNonSwitchIndex:p,isExpanded:u,control:g,fieldError:m,slate600:f,onExpandedChange:k,setIsPopupOpen:E,onDateRangeClick:I,filter:S,dateRangeValue:w}=t;if(i!==h||o!==p||r!==u||n!==g||l!==m||a!==f||s!==k||C!==E||d!==I)return!1;const{key:B,type:x,label:Q,required:M,isDisabled:b,loading:J,multiSelect:v,menuInfo:R,options:L,placeholder:y,employeeAutocomplete:F,monthYearFormat:U,minDate:D,maxDate:Z,shouldCloseOnSelect:H}=A,{key:K,type:G,label:Y,required:V,isDisabled:T,loading:j,multiSelect:W,menuInfo:q,options:z,placeholder:O,employeeAutocomplete:P,monthYearFormat:N,minDate:X,maxDate:_,shouldCloseOnSelect:$}=S;return B===K&&x===G&&Q===Y&&M===V&&b===T&&J===j&&v===W&&R===q&&L===z&&y===O&&F===P&&U===N&&D===X&&Z===_&&H===$&&to(c,w)})),Pc=({filter:i,control:o})=>{return e(le,{children:(r=i.type,t(a,{direction:"row",width:"100%",justifyContent:"space-between",alignItems:"center",children:[e(q,{variant:"body2",children:i.label}),"switch"===r?e(dc,{control:o,name:i.key}):e(q,{variant:"body2",children:i.menuInfo})]}))});var r},Nc=({filterListItems:i})=>{const[o,n]=h(null),l=p(null),[s,C]=h(!1),[d,A]=h(),[c,u]=h(null),{control:g,handleSubmit:m,setValue:f,reset:k,formState:{errors:E},watch:I}=et(),S=()=>{n(null)},w=e=>{C(!1),u(null),S();const t=qc(e,i);A(t)},B=e=>{C(!0),n(null),u(e)},x=e=>i.find((t=>t.key===e)),Q=c?.key?I(c.key):null,b=Boolean(o);return t(a,{children:[t(a,{direction:"row",spacing:1,alignItems:"center",children:[d&&(J=d,Object.entries(J).map((([t,i])=>{if(!i)return;const o=x(t),r=o&&Wc(i,o);return e(Ls,{ref:l,label:e(El,{toolTipLabel:`${r}`,children:`${o?.label}: ${r}`}),onDelete:()=>(e=>{f(`${e}`,null),A((t=>{const i={...t};return delete i[e],i}))})(t),onClick:e=>{C(!0),l.current=e.currentTarget;const i=x(t);i&&(u(i),B(i))}},t)}))),e(r,{ref:l,onClick:e=>{n(e.currentTarget)},sx:{height:"40px"},children:e(Fn,{})}),e(vr,{onClick:()=>(k(),void A(void 0)),variant:"text",children:"Clear Filter"})]}),e(Yc,{open:b,anchorEl:o,onClose:S,onApply:()=>{m(w)()},children:i.map((t=>e(M,{onClick:()=>"switch"!==t.type&&B(t),children:e(Pc,{filter:t,control:g})},t.key)))}),c&&"switch"!==c.type&&e(Tc,{open:s,onClose:()=>{C(!1)},onApply:()=>{m(w)()},control:g,currentFilterValue:Q,anchorEl:l.current,filterItem:c,errors:E})]});var J},Xc=({text:t,highlightWords:i})=>{const o=J(),{slate:r}=o.palette.app.color;if(!i?.length)return e(M,{component:"span",children:t});const n=i.map((e=>e.replace(pr,"\\$&"))),l=new RegExp(`(${n.join("|")})`,"gi"),a=t.split(l);return e(M,{component:"span",children:a.map(((t,i)=>l.test(t)?e(M,{component:"span",sx:{padding:"2px 4px",backgroundColor:r[800],border:`1px solid ${r[700]}`,borderRadius:"5px",fontFamily:"monospace",fontSize:"0.9em"},children:t},`highlight-${i}-${t}`):e(M,{component:"span",children:t},`text-${i}-${t}`)))})},_c=({label:i,variant:o,colourCode:r})=>t(a,{gap:"10px",direction:"row",alignItems:"center",children:[e(On,{variant:o,colourCode:r}),i]}),$c=({color:i,label:o,isBackground:r=!1})=>e(M,{sx:{backgroundColor:`${r?y(i,.2):""}`,width:"max-content",borderRadius:"6px"},children:e(Kl,{padding:{padding:r?"5px 8px":"0"},children:t(a,{flexDirection:"row",alignItems:"center",gap:"8px",children:[e(Vi,{sx:{color:i,fontSize:"12px"}}),e(q,{variant:"body2",sx:{fontWeight:500},children:o})]})})}),eh=({count:t,page:i,onPageChange:o,rowsPerPage:r,onRowsPerPageChange:n,sx:l,...a})=>{const s=J(),{grey:C}=s.palette,{layout:d}=or(),A="mobile"===d;return e(lo,{sx:{"& .MuiInputBase-root":{height:"30px"},"& .MuiToolbar-root":{paddingLeft:0},"& .MuiTablePagination-select":{backgroundColor:"transparent !important"},"& .MuiTablePagination-input":{border:`1.5px solid ${C[400]}`,borderRadius:"5px",fontSize:"13px",padding:A?"2px 10px":"4px 8px"},...l},component:"div",count:t,page:i,onPageChange:o,rowsPerPage:r,onRowsPerPageChange:n,rowsPerPageOptions:[20,50,100,200],defaultValue:100,labelRowsPerPage:A?"":"Rows per page",...a})},th=({items:i,disabled:o,sx:r})=>{const[n,l]=h(null);return t(M,{sx:{width:"100%",...r},children:[e(Ml,{onClick:e=>{l(e.currentTarget)},disabled:o}),!!n&&e(Yl,{open:!0,anchorEl:n,onClose:()=>{l(null)},children:e(Kl,{padding:{padding:"2px"},children:i.map((t=>e(M,{children:e(le,{sx:{width:"100%",textAlign:"start"},onClick:()=>{t?.onClick(),l(null)},children:e(q,{variant:"body1",children:t.title})})},t.title)))})})]})},ih="smart-grid-field-input",oh=e=>({...e,wrapperMinHeight:e.controlMinHeight+2*e.paddingY}),rh={sm:oh({controlMinHeight:18,paddingY:2,padding:"2px 6px",autocompletePadding:"2px 2px 2px 6px",fontSize:"12px",borderRadius:"4px",expandIconSize:18,expandMarginLeft:"2px",multipleGap:"2px",chipFontSize:"11px",chipPadding:"1px 6px"}),md:oh({controlMinHeight:20,paddingY:4,padding:"4px 8px",autocompletePadding:"4px 4px 4px 8px",fontSize:"13px",borderRadius:"4px",expandIconSize:20,expandMarginLeft:"4px",multipleGap:"4px",chipFontSize:"12px",chipPadding:"2px 8px"}),lg:oh({controlMinHeight:22,paddingY:6,padding:"6px 10px",autocompletePadding:"6px 6px 6px 10px",fontSize:"15px",borderRadius:"6px",expandIconSize:22,expandMarginLeft:"6px",multipleGap:"4px",chipFontSize:"13px",chipPadding:"3px 10px"})},nh=(e="md")=>rh[e],lh=e=>e[800],ah=(e,t)=>t?e[800]:e[400],sh=e=>`\n .${ih}::placeholder {\n color: ${e};\n opacity: 1;\n }\n .${ih}:disabled {\n color: ${e};\n -webkit-text-fill-color: ${e};\n }\n`,Ch=(e,t="md")=>{const{controlMinHeight:i,fontSize:o}=nh(t);return{width:"100%",border:"none",background:"transparent",padding:0,margin:0,fontSize:o,lineHeight:`${i}px`,minHeight:i,outline:"none",color:e}},dh=(e="md",t="text")=>{const{borderRadius:i,autocompletePadding:o,padding:r,wrapperMinHeight:n}=nh(e);return{alignItems:"center",borderRadius:i,padding:"autocomplete"===t?o:r,minHeight:n,boxSizing:"border-box"}},Ah=({wrapper:i,title:o,position:r})=>{const n=P(),{iron:l}=n.palette.app.color,a=i.getBoundingClientRect(),s={position:"fixed",zIndex:999999,background:l[200],color:l[600],padding:"4px 8px",borderRadius:4,fontSize:12,pointerEvents:"none",whiteSpace:"nowrap",transition:"opacity 0.2s ease, transform 0.2s ease",opacity:1},C={position:"absolute",width:0,height:0,borderStyle:"solid"};switch(r){case"top":s.top=a.top-28,s.left=a.left+a.width/2,s.transform="translateX(-50%)",Object.assign(C,{borderWidth:"6px 6px 0 6px",borderColor:`${l[200]} transparent transparent transparent`,bottom:-6,left:"50%",transform:"translateX(-50%)"});break;case"bottom":s.top=a.bottom+4,s.left=a.left+a.width/2,s.transform="translateX(-50%)",Object.assign(C,{borderWidth:"0 6px 6px 6px",borderColor:`transparent transparent ${l[200]} transparent`,top:-6,left:"50%",transform:"translateX(-50%)"});break;case"left":s.top=a.top+a.height/2,s.left=a.left-8,s.transform="translateY(-50%)",Object.assign(C,{borderWidth:"6px 0 6px 6px",borderColor:`transparent transparent transparent ${l[200]}`,right:-6,top:"50%",transform:"translateY(-50%)"});break;case"right":s.top=a.top+a.height/2,s.left=a.right+8,s.transform="translateY(-50%)",Object.assign(C,{borderWidth:"6px 6px 6px 0",borderColor:`transparent ${l[200]} transparent transparent`,left:-6,top:"50%",transform:"translateY(-50%)"})}return t("div",{style:s,children:[o,e("div",{style:C})]})},ch=({children:o,title:r,position:n="top",delay:l=50})=>{const[a,s]=h(!1),C=p(null),d=p(null);u((()=>()=>{d.current&&clearTimeout(d.current)}),[]);const A=a&&r&&C.current?Co(e(Ah,{wrapper:C.current,title:r,position:n}),document.body):null;return t(i,{children:[e("div",{ref:C,style:{display:"inline-block",width:"100%"},onMouseEnter:()=>{d.current&&clearTimeout(d.current),d.current=setTimeout((()=>s(!0)),l)},onMouseLeave:()=>{d.current&&clearTimeout(d.current),s(!1)},children:o}),A]})},hh={display:"flex",flexDirection:"column",gap:"4px",width:"100%"},ph={width:"100%"},uh=k((({errorMessage:i,size:o="md",currencySymbol:r,decimalCharacter:n,digitGroupSeparator:l,decimalPlaces:a,decimalPlacesShownOnBlur:s,decimalPlacesShownOnFocus:C,minimumValue:d,maximumValue:A,outputFormat:p="number",textAlign:u,allowNegative:m,suffix:f,preDefined:k,navigationKey:E,disabled:I,name:S,value:w,onChange:B,onBlur:x,onFocus:Q,onKeyDown:M,placeholder:b="",style:v,className:R},L)=>{const y=J(),{butterflyBlue:F,iron:U,lipstickRed:D}=y.palette.app.color,{navigationKey:Z}=Fo(),H=E??Z,[K,G]=h(!1),[Y,V]=h(""),{handleEnterNavigation:T,setInputRef:j}=ir({navigationKey:H}),W=c((()=>{const e=k??{},{currencySymbol:t,decimalCharacter:i,digitGroupSeparator:o,decimalPlaces:d,decimalPlacesShownOnBlur:A,decimalPlacesShownOnFocus:c,suffix:h,textAlign:p,allowNegative:g}=e;return{currencySymbol:r??t??"",decimalCharacter:n??i??".",digitGroupSeparator:l??o??",",decimalPlaces:a??d??2,decimalPlacesShownOnBlur:s??A,decimalPlacesShownOnFocus:C??c,suffix:f??h,textAlign:u??p??"right",allowNegative:m??g??!1}}),[m,r,n,a,s,C,l,k,f,u]),{currencySymbol:q,decimalCharacter:z,digitGroupSeparator:O,decimalPlaces:P,decimalPlacesShownOnBlur:N,decimalPlacesShownOnFocus:X,suffix:_,textAlign:$,allowNegative:ee}=W,te=c((()=>null!=d?Number(d):ee?void 0:0),[d,ee]),ie=c((()=>null!=A?Number(A):void 0),[A]),oe=K?X:N??P,re=c((()=>K?Y:null==w||""===w?"":String(w)),[Y,K,w]),ne=c((()=>i?D[900]:K?F[900]:U[800]),[F,i,U,K,D]),le=lh(U),ae=ah(U,I),{fontSize:se}=nh(o),Ce=c((()=>sh(le)),[le]),de=c((()=>dh(o,"text")),[o]),Ae=c((()=>({...Ch(ae,o),textAlign:$,flex:1,minWidth:0,...v})),[ae,$,o,v]),ce=c((()=>({display:"flex",alignItems:"center",border:`2px solid ${ne}`,background:U[600],width:"100%",...de})),[ne,U,de]),he=c((()=>({flexShrink:0,fontSize:se,color:I?U[800]:U[400],marginRight:"4px",userSelect:"none"})),[se,I,U]),pe=c((()=>[ih,R].filter(Boolean).join(" ")),[R]),ue=c((()=>!1!==O&&O),[O]),ge=g((e=>{j(e),"function"==typeof L?L(e):L&&(L.current=e)}),[L,j]),me=g((e=>{B?.({target:{name:S,value:e??""}})}),[S,B]),fe=g(((e,t)=>{const i=e.value;V(i),"prop"!==t?.source&&me(""!==i?"string"!==p?$o(i):i:null)}),[me,p]),ke=g((e=>{e.stopPropagation(),G(!0),V(null==w||""===w?"":String(w)),Q?.(e)}),[Q,w]),Ee=g((e=>{e.stopPropagation(),G(!1),x?.(e)}),[x]),Ie=g((e=>{"enter"!==H||"Enter"!==e.key||e.ctrlKey||e.metaKey||e.altKey||T(e),M?.(e)}),[T,H,M]),Se=g((e=>{const{floatValue:t,value:i}=e;return!(!ee&&i.includes("-"))&&(null==t||!(!ee&&t<0)&&((null==te||Number.isNaN(te)||t>=te)&&(null==ie||Number.isNaN(ie)||t<=ie)))}),[ee,ie,te]),we=g((e=>{e.stopPropagation()}),[]);return t(ch,{title:i??"",position:"top",delay:50,children:[e("style",{children:Ce}),e(ao.Root,{disabled:I,name:S,style:ph,children:e("div",{style:hh,children:t("div",{style:ce,children:[q?e("span",{style:he,children:q}):null,e(Tt,{customInput:so,value:re,valueIsNumericString:!0,thousandSeparator:ue,decimalSeparator:z,decimalScale:oe,fixedDecimalScale:!K,allowNegative:ee,suffix:_,isAllowed:Se,disabled:I,name:S,placeholder:b,className:pe,style:Ae,onValueChange:fe,onFocus:ke,onBlur:Ee,onKeyDown:Ie,onClick:we,inputMode:"decimal",getInputRef:ge})]})})})]})}));uh.displayName="SmartCurrencyFieldComponent";const gh=B(uh,((e,t)=>e.name===t.name&&e.value===t.value&&e.disabled===t.disabled&&e.size===t.size&&e.errorMessage===t.errorMessage&&e.placeholder===t.placeholder&&e.currencySymbol===t.currencySymbol&&e.decimalPlaces===t.decimalPlaces&&e.decimalPlacesShownOnBlur===t.decimalPlacesShownOnBlur&&e.decimalPlacesShownOnFocus===t.decimalPlacesShownOnFocus&&e.allowNegative===t.allowNegative&&e.minimumValue===t.minimumValue&&e.maximumValue===t.maximumValue&&e.digitGroupSeparator===t.digitGroupSeparator&&e.onChange===t.onChange&&e.onBlur===t.onBlur));gh.displayName="SmartCurrencyField";const mh=k((function({columns:o,optionsData:r,searchedByColumn:n,labelKey:l,valueKey:a="id",errorMessage:s,loading:C=!1,height:d="400px",dialogSize:A="lg",dialogTitle:u,size:m="md",placeholder:f="",onRowSelect:k,disabled:E,name:I,value:S,onChange:w,onBlur:B,onKeyDown:x,...Q},M){const b=P(),{butterflyBlue:J,iron:v,lipstickRed:R}=b.palette.app.color,{navigationKey:L}=Fo(),[y,F]=h(!1),[U,D]=h(!1),Z=p(null),H=p(null),K=p(null),G=p(null),{handleEnterNavigation:Y}=ir({navigationKey:L}),V=c((()=>null==S||""===S?"":String(S)),[S]),T=c((()=>{if(!V)return"";const e=r.find((e=>String(e[a])===V));return e?String(e[l]):""}),[l,r,V,a]),j=c((()=>r.map((e=>({label:String(e[l]),value:String(e[a])})))),[l,r,a]),W=c((()=>y||U?J[900]:s?R[900]:v[800]),[J,s,v,U,y,R]),q=lh(v),z=ah(v,E),O=c((()=>dh(m,"autocomplete")),[m]),{expandMarginLeft:N,expandIconSize:X}=c((()=>nh(m)),[m]),_=c((()=>sh(q)),[q]),$=c((()=>({...Ch(z,m),flex:1,minWidth:0,cursor:E?"default":"pointer"})),[E,z,m]),ee=g((e=>{K.current=e,"function"==typeof M?M(e):M&&(M.current=e)}),[M]),te=g((e=>{const t=K.current;t&&(t.value=e),w?.({target:{name:I,value:e}})}),[I,w]),ie=g((()=>{te(""),k?.(null)}),[te,k]),oe=g((()=>{H.current&&(H.current(),H.current=null),D(!1),F(!1),G.current?.focus()}),[]),re=g((()=>{E||(D(!0),setTimeout((()=>{const e=Z.current?.getTable(),t=document.querySelectorAll(".MuiDialog-root table thead input[type='text']"),i=e?.getAllColumns(),o=i?.findIndex((e=>e.id==n));if(void 0!==o&&o>=0&&t[o]){const e=t[o];e.focus();const i=e=>{const t=e;if("ArrowDown"===t.key){t.preventDefault();const e=document.querySelector(".MuiDialog-root table tbody tr");e&&(e.setAttribute("tabindex","0"),e.focus())}};e.addEventListener("keydown",i),H.current=()=>{e.removeEventListener("keydown",i)}}}),100))}),[E,n]),ne=g((({id:e})=>{const t=r.find((t=>String(t[a])===String(e)));if(!t)return;const i=String(t[a]);te(i),k?.(t),oe()}),[te,oe,k,r,a]),le=g((e=>"Backspace"===e.key&&V?(e.preventDefault(),void ie()):"enter"!==L||"Enter"!==e.key||U||e.ctrlKey||e.metaKey||e.altKey?"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||U||E?void x?.(e):(e.preventDefault(),void re()):void Y(e)),[ie,E,re,Y,U,L,x,V]),ae=g((e=>{e.preventDefault(),e.stopPropagation(),E||(U?oe():(F(!0),re()))}),[E,oe,re,U]),se=g((e=>{e.stopPropagation(),E||U||re()}),[E,re,U]),Ce=g((e=>{e.stopPropagation(),F(!0)}),[]),de=g((e=>{e.stopPropagation(),F(!1),B?.(e)}),[B]),Ae=f||"Click to select";return t(i,{children:[t(ch,{title:s??"",position:"top",delay:50,children:[e("style",{children:_}),e("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"},children:t("div",{style:{display:"flex",alignItems:"center",border:`2px solid ${W}`,background:v[600],position:"relative",width:"100%",...O},children:[e("input",{ref:G,readOnly:!0,disabled:E,value:T,placeholder:Ae,className:ih,onClick:se,onFocus:Ce,onBlur:de,onKeyDown:le,style:$}),e("button",{type:"button",tabIndex:-1,"aria-label":U?"Close dialog":"Open dialog",disabled:E,onMouseDown:e=>{e.preventDefault()},onClick:ae,style:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"none",background:"transparent",padding:0,marginLeft:N,cursor:E?"not-allowed":"pointer",color:E?v[800]:v[400]},children:e(Je,{sx:{fontSize:X,transform:U?"rotate(180deg)":"none",transition:"transform 0.2s ease"}})}),e("select",{...Q,ref:ee,name:I,value:V,disabled:E,tabIndex:-1,"aria-hidden":!0,style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0,pointerEvents:"none"},children:0===j.length?e("option",{value:"",disabled:!0,children:"No Options"}):t(i,{children:[e("option",{value:"",children:"Select Option"}),j.map((t=>e("option",{value:t.value,children:t.label},t.value)))]})})]})})]}),e(AC,{open:U,onClose:oe,maxWidth:A,title:u??"Select Option",children:e(pt,{ref:Z,columns:o,data:r,height:d,loading:C,totalCount:r.length,onRowActivate:ne,focusableRowNavigation:!0})})]})}));Object.assign(mh,{displayName:"SmartDialogSelectComponent"});const fh=B(mh,(({name:e,value:t,disabled:i,optionsData:o,columns:r,errorMessage:n,loading:l,placeholder:a,size:s,labelKey:C,valueKey:d,searchedByColumn:A},{name:c,value:h,disabled:p,optionsData:u,columns:g,errorMessage:m,loading:f,placeholder:k,size:E,labelKey:I,valueKey:S,searchedByColumn:w})=>e===c&&t===h&&i===p&&o===u&&r===g&&n===m&&l===f&&a===k&&s===E&&C===I&&d===S&&A===w));Object.assign(fh,{displayName:"SmartDialogSelect"});const kh=k((({errorMessage:o,options:r,onBlur:n,onKeyDown:l,...a},s)=>{const C=P(),{butterflyBlue:d,lipstickRed:A,iron:p}=C.palette.app.color,[u,g]=h(!1),{navigationKey:m}=Fo(),{handleEnterNavigation:f}=ir({navigationKey:m}),k=c((()=>u?d[900]:o?A[900]:u?d[900]:p[800]),[o,u]);return e(ch,{title:o??"",position:"top",delay:50,children:e("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"},children:e("div",{style:{display:"flex",alignItems:"center",border:`2px solid ${k}`,borderRadius:"4px",padding:"4px 8px",background:"white",minHeight:"20px"},children:e("select",{ref:s,...a,style:{width:"100%",border:"none",background:"transparent",padding:"0",fontSize:"13px",outline:"none",cursor:"pointer"},onClick:e=>e.stopPropagation(),onFocus:e=>{e.stopPropagation(),g(!0)},onBlur:e=>{e.stopPropagation(),g(!1),n&&n(e)},onKeyDown:e=>{"enter"!==m||"Enter"!==e.key||e.ctrlKey||e.metaKey||e.altKey||f(e),l?.(e)},children:0===r.length?e("option",{value:"",disabled:!0,children:"No Options"}):t(i,{children:[e("option",{value:"",children:"Select Option"}),r.map((t=>e("option",{value:String(t.value),children:t.label},t.value)))]})})})})})}));kh.displayName="SmartSelectFieldComponent";const Eh=B(kh,((e,t)=>e.name===t.name&&e.value===t.value&&e.disabled===t.disabled&&e.options===t.options&&e.errorMessage===t.errorMessage));Eh.displayName="SmartSelectField";const Ih=28,Sh=100,wh=200,Bh="select-all",xh=({label:e})=>e,Qh=({value:e})=>String(e),Mh=e=>Qh(e)===Bh,bh=e=>void 0===e||""===e?[]:Array.isArray(e)?[...new Set(e.map(String))]:[String(e)],Jh=(e,t)=>t.trim()?No({data:e,fieldsToSearch:["label"],term:t.toLowerCase()}):e,vh=(e,t,i)=>{if(!e.length)return null;if(i&&t.length){const i=new Set(t),o=e.findIndex((e=>!Mh(e)&&i.has(Qh(e))));if(o>=0)return o}if(!i&&t[0]){const i=e.findIndex((e=>Qh(e)===t[0]));if(i>=0)return i}return 0},Rh=B((function({butterflyBlue:t,checked:i,indeterminate:o=!1,iron:r}){const n=i||o;return e("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",flexShrink:0,borderRadius:"2px",border:`1px solid ${n?t[900]:r[800]}`,background:n?t[900]:r[600],boxSizing:"border-box",pointerEvents:"none"},children:o?e(ho,{sx:{fontSize:12,color:`${r[600]} !important`}}):i?e(je,{sx:{fontSize:12,color:`${r[600]} !important`}}):null})})),Lh=B((function({butterflyBlue:i,highlightedIndex:o,indeterminate:r,isSelected:n,iron:l,itemIndex:a,onHighlightIndex:s,onSelectOption:C,option:d,showCheckbox:A,style:c}){return t(co.Item,{index:a,value:d,disabled:d.disabled,onPointerEnter:()=>{d.disabled||s(a)},onClick:e=>{"preventBaseUIHandler"in e&&e.preventBaseUIHandler(),e.preventDefault(),C(d)},style:e=>{const t=a===o||e.highlighted?l[700]:n&&!A?i[500]:"transparent";return{display:"flex",alignItems:"center",gap:"8px",padding:"0 8px",fontSize:"13px",cursor:d.disabled?"not-allowed":"pointer",boxSizing:"border-box",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",background:t,...c}},children:[A?e(Rh,{butterflyBlue:i,checked:n,indeterminate:r,iron:l}):null,xh(d)]})})),yh=(t,i,o,r)=>{const{butterflyBlue:n,highlightedIndex:l,iron:a,isAllSelected:s,isShowSelectAll:C,isSomeSelected:d,onHighlightIndex:A,onSelectOption:c,selectedValuesSet:h,showCheckbox:p}=o,u=Qh(t),g=Mh(t),m=g?s:h.has(u);return e(Lh,{itemIndex:i,butterflyBlue:n,highlightedIndex:l,indeterminate:g&&C&&d&&!s,isSelected:m,iron:a,onHighlightIndex:A,onSelectOption:c,option:t,showCheckbox:p,style:r},`${u}-${i}`)},Fh=B((function({butterflyBlue:t,highlightedIndex:i,iron:o,isAllSelected:r,isShowSelectAll:n,isSomeSelected:l,onHighlightIndex:a,onSelectOption:s,selectedValuesSet:C,showCheckbox:d}){const A=co.useFilteredItems(),c=p(null),h=Re({count:A.length,estimateSize:()=>28,getScrollElement:()=>c.current,overscan:10}),g=h.getVirtualItems();if(u((()=>{null===i||i<0||h.scrollToIndex(i,{align:"auto"})}),[i,h]),!A.length)return null;const m={butterflyBlue:t,highlightedIndex:i,iron:o,isAllSelected:r,isShowSelectAll:n,isSomeSelected:l,onHighlightIndex:a,onSelectOption:s,selectedValuesSet:C,showCheckbox:d};return e("div",{ref:c,style:{maxHeight:200,overflowY:"auto",paddingBottom:"4px"},children:e(co.List,{style:{height:h.getTotalSize(),position:"relative",width:"100%"},children:g.map((({index:e,size:t,start:i})=>{const o=A[e];return o?yh(o,e,m,{position:"absolute",top:i,left:0,width:"100%",height:t}):null}))})})})),Uh=B((function({butterflyBlue:t,highlightedIndex:i,iron:o,isAllSelected:r,isShowSelectAll:n,isSomeSelected:l,onHighlightIndex:a,onSelectOption:s,selectedValuesSet:C,showCheckbox:d,virtualized:A}){if(A)return e(Fh,{butterflyBlue:t,highlightedIndex:i,iron:o,isAllSelected:r,isShowSelectAll:n,isSomeSelected:l,onHighlightIndex:a,onSelectOption:s,selectedValuesSet:C,showCheckbox:d});const c={butterflyBlue:t,highlightedIndex:i,iron:o,isAllSelected:r,isShowSelectAll:n,isSomeSelected:l,onHighlightIndex:a,onSelectOption:s,selectedValuesSet:C,showCheckbox:d};return e(co.List,{style:{maxHeight:200,overflowY:"auto",paddingBottom:"4px"},children:(e,t)=>yh(e,t,c)})})),Dh=B((function({iron:i,label:o,onRemove:r,size:n="md"}){const{chipFontSize:l,chipPadding:a}=c((()=>nh(n)),[n]);return t("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:a,borderRadius:"12px",background:i[700],color:i[900],fontSize:l,fontWeight:500,lineHeight:1.4,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[o,e("button",{type:"button","aria-label":`Remove ${o}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),r()},style:{border:"none",background:"transparent",color:i[900],cursor:"pointer",padding:0,lineHeight:1,fontSize:l},children:"×"})]})})),Zh=k((({containerStyle:o,disabled:r,errorMessage:n,freeSolo:l=!1,isShowCheckbox:a=!0,isShowSelectAll:s=!0,multiple:C=!1,name:d,label:A,onBlur:m,onChange:f,onDropdownOptionSelect:k,onKeyDown:E,options:I,placeholder:S="",required:w=!1,disableClearable:B=!!w,size:x="md",value:Q,defaultValue:M,...b},J)=>{const v=P(),{butterflyBlue:R,iron:L,lipstickRed:y}=v.palette.app.color,{navigationKey:F}=Fo(),[U,D]=h(!1),[Z,H]=h(!1),[K,G]=h(""),Y=p(null),V=p(null),T=p(null),[j,W]=h(!1),q=p(void 0),[z,O]=h(null),N=c((()=>bh(Q)),[Q]),X=C?"":N[0]??"",_=c((()=>C&&s&&I.length?[{label:"Select All",value:Bh},...I]:I),[s,C,I]),$=c((()=>Jh(_,C||!Z||j?K:"")),[K,Z,j,_,C]),ee=c((()=>new Set(N)),[N]),te=c((()=>{if(!C||!I.length)return!1;const e=I.filter((e=>!e.disabled));return e.length>0&&e.every((e=>ee.has(Qh(e))))}),[C,I,ee]),ie=c((()=>C&&I.some((e=>ee.has(Qh(e))))),[C,I,ee]),oe=c((()=>{if(C)return"";const e=I.find((e=>Qh(e)===X));return e?xh(e):l&&X?X:""}),[l,C,I,X]),{handleEnterNavigation:re,handleKeyDown:ne,inputRef:le,maintainFocusAfterClose:ae,setInputRef:se}=ir({isOpen:Z,navigationKey:F}),Ce=_.length>100,de=c((()=>U||Z?R[900]:n?y[900]:L[800]),[R,n,L,U,Z,y]),Ae=g((e=>{const t=I.find((t=>Qh(t)===e));return t?xh(t):e}),[I]),ce=g((e=>{f?.({target:{name:d,value:e}})}),[d,f]),he=g((e=>{const t=T.current;if(t)if(C&&Array.isArray(e)){const i=new Set(e);Array.from(t.options).forEach((e=>{e.selected=i.has(e.value)}))}else C||"string"!=typeof e||(t.value=e)}),[C]),pe=g(((e,t)=>{he(e),ce(e),t&&k(t)}),[ce,k,he]),ue=g(((e="",t)=>{const i=Jh(_,e);O(vh(i,t??N,C))}),[_,C,N]),ge=g((e=>{const t=I.filter((e=>e.disabled)).map((e=>Qh(e))),i=e?I.map((e=>Qh(e))):t;pe(i),Ao((()=>{G("")})),ue("",i)}),[pe,ue,I]),me=g((e=>{const t=Qh(e);if(Mh(e))ge(!te);else{if(C){const e=N.includes(t)?N.filter((e=>e!==t)):[...N,t];return pe(e,t),Ao((()=>{G("")})),void ue("",e)}pe(t,t),G(Ae(t)),H(!1),ae()}}),[pe,Ae,ge,te,ae,C,ue,N]),fe=g((e=>{const t=e.trim();if(!t)return;const i=I.find((e=>xh(e).toLowerCase()===t.toLowerCase()||Qh(e)===t));if(i)me(i);else{if(C){if(N.includes(t))return;const e=[...N,t];return pe(e,t),Ao((()=>{G("")})),void ue("",e)}pe(t,t),G(t),H(!1),ae()}}),[pe,me,ae,C,ue,I,N]),ke=g((e=>{const t=N.filter((t=>t!==e));pe(t)}),[pe,N]),Ee=c((()=>!B&&!r&&(C?N.length>0:Boolean(X))),[B,r,C,X,N.length]),Ie=g((e=>{e.preventDefault(),e.stopPropagation();pe(C?[]:""),G(""),W(!1),H(!1),O(null),ae()}),[pe,ae,C]),Se=g((()=>{H(!1),W(!1),O(null),G(C?"":oe)}),[C,oe]),we=g((()=>{H(!0),W(!1),G(C?"":oe),ue()}),[C,ue,oe]),Be=g(((e,t)=>{r||!e&&C&&"item-press"===t?.reason||(H(e),e?(W(!1),G(C?"":oe),ue()):(W(!1),G(C?"":oe),O(null),D(!1)))}),[r,C,ue,oe]),xe=g(((e,t)=>{if(C&&"item-press"===t?.reason){if(G(""),Z){const e=Jh(_,"");O(e.length?vh(e,N,C):null)}}else if(W(!0),G(e),Z){const t=Jh(_,e);O(t.length?vh(t,N,C):null)}}),[Z,_,C,N]),Qe=g((e=>{O(e)}),[]),Me=g((e=>{$.length?O((t=>null===t?"down"===e?0:$.length-1:"down"===e?Math.min(t+1,$.length-1):Math.max(t-1,0))):O(null)}),[$.length]),be=e=>{"preventBaseUIHandler"in e&&e.preventBaseUIHandler()},ve=g((e=>{e.preventDefault(),be(e),Z?Me("ArrowDown"===e.key?"down":"up"):(Ao((()=>{H(!0),W(!1),G(C?"":oe)})),ue())}),[Z,Me,C,ue,oe]),Re=g((e=>{const t=null!==z?$[z]:void 0;if(t)return e.preventDefault(),be(e),void me(t);l&&K.trim()&&(e.preventDefault(),be(e),fe(K))}),[fe,$,l,me,z,K]),Le=g((e=>{if(!("ArrowDown"===e.key||"ArrowUp"===e.key)||r)return"Tab"===e.key&&Z?(H(!1),void ae()):"enter"!==F||"Enter"!==e.key||Z||e.ctrlKey||e.metaKey||e.altKey?void("Enter"===e.key&&Z?Re(e):(ne(e,(()=>{H(!1),ae()}),Z),E?.(e))):(e.preventDefault(),e.stopPropagation(),void re(e));ve(e)}),[r,ve,re,ne,Re,Z,ae,F,E]),ye=g((e=>{const t=e.relatedTarget;window.setTimeout((()=>{if(t&&(Y.current?.contains(t)||V.current?.contains(t)))return;const e=document.activeElement;Y.current?.contains(e)||V.current?.contains(e)||(Z&&(l&&K.trim()&&fe(K),Se()),D(!1))}),0),m?.(e)}),[Se,fe,l,K,Z,m]),Fe=g((e=>{e.preventDefault(),e.stopPropagation(),r||(Z?(Se(),D(!1)):(we(),D(!0),le.current?.focus()))}),[Se,r,le,Z,we]);u((()=>{Z||(G(C?"":oe),W(!1))}),[Z,C,oe]),u((()=>{q.current=null!==z?$[z]:void 0}),[$,z]);const Ue=c((()=>{if(!I.length&&!N.length)return e("option",{value:"",disabled:!0,children:"No Options"});const o=new Set(I.map(Qh)),r=N.filter((e=>!o.has(e)));return t(i,{children:[C?null:e("option",{value:"",children:"Select Option"}),I.map((t=>e("option",{value:Qh(t),children:xh(t)},Qh(t)))),r.map((t=>e("option",{value:t,children:t},t)))]})}),[C,I,N]),De=g((e=>{T.current=e,"function"==typeof J?J(e):J&&(J.current=e)}),[J]),Ze=g(((e,t)=>!t.trim()||No({data:[e],fieldsToSearch:["label"],term:t.toLowerCase()}).length>0),[]),He=L,Ke=R,Ge=C&&a,Ye={width:"var(--anchor-width)",minWidth:"var(--anchor-width)",maxWidth:"var(--anchor-width)"},Ve=lh(L),je=ah(L,r),We=nh(x),qe=c((()=>sh(Ve)),[Ve]),ze=c((()=>dh(x,"autocomplete")),[x]),Oe=c((()=>({...Ch(je,x),flex:1,minWidth:C?"80px":0,cursor:r?"default":"text"})),[r,je,C,x]);return t(ch,{title:n??"",position:"top",delay:50,children:[e("style",{children:qe}),e("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",...o},children:t(co.Root,{items:_,value:K,onValueChange:xe,open:Z,onOpenChange:Be,disabled:r,name:d,autoHighlight:!1,keepHighlight:!0,virtualized:Ce,openOnInputClick:!0,filter:Ze,filteredItems:$,itemToStringValue:xh,onItemHighlighted:(e,t)=>{q.current=e,t.index>=0&&O(t.index)},children:[t("div",{ref:Y,style:{display:"flex",alignItems:"center",flexWrap:C?"wrap":"nowrap",gap:C?We.multipleGap:void 0,border:`2px solid ${de}`,background:L[600],position:"relative",width:"100%",...ze},children:[C?N.map((t=>e(Dh,{iron:He,size:x,label:Ae(t),onRemove:()=>{ke(t)}},t))):null,e(co.Input,{ref:se,disabled:r,className:ih,placeholder:C&&X?.length?"":S||`Select ${A??"Option"}`,onClick:e=>{e.stopPropagation()},onFocus:e=>{e.stopPropagation(),D(!0),r||Z||document.activeElement!==e.currentTarget||we()},onBlur:ye,onKeyDown:Le,style:Oe}),Ee?e("button",{type:"button",tabIndex:-1,"aria-label":"Clear selection",onMouseDown:e=>{e.preventDefault()},onClick:Ie,style:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"none",background:"transparent",padding:0,marginLeft:We.expandMarginLeft,cursor:"pointer",color:L[400]},children:e(Te,{sx:{fontSize:We.expandIconSize-4}})}):null,e("button",{type:"button",tabIndex:-1,"aria-label":Z?"Close options":"Open options",disabled:r,onMouseDown:e=>{e.preventDefault()},onClick:Fe,style:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,border:"none",background:"transparent",padding:0,marginLeft:We.expandMarginLeft,cursor:r?"not-allowed":"pointer",color:r?L[800]:L[400]},children:e(Je,{sx:{fontSize:We.expandIconSize,transform:Z?"rotate(180deg)":"none",transition:"transform 0.2s ease"}})}),e("select",{...b,ref:De,name:d,value:C?void 0:X,multiple:C,disabled:r,required:w,tabIndex:-1,"aria-hidden":!0,style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0,pointerEvents:"none"},children:Ue})]}),e(co.Portal,{children:e(co.Positioner,{anchor:Y,sideOffset:2,align:"start",style:{zIndex:999,...Ye},children:t(co.Popup,{ref:V,style:{...Ye,background:L[600],border:`1px solid ${L[300]}`,boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1)",borderRadius:"4px",overflow:"hidden"},onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:e=>{e.stopPropagation()},children:[e(co.Empty,{children:e("div",{style:{padding:We.padding,fontSize:We.fontSize,color:L[800]},children:"No Options"})}),e(Uh,{butterflyBlue:Ke,highlightedIndex:z,iron:He,isAllSelected:te,isShowSelectAll:s,isSomeSelected:ie,onHighlightIndex:Qe,onSelectOption:me,selectedValuesSet:ee,showCheckbox:Ge,virtualized:Ce})]})})})]})})]})}));Zh.displayName="SmartAutoCompleteFieldComponent";const Hh=B(Zh,(({name:e,value:t,disabled:i,options:o,errorMessage:r,freeSolo:n,multiple:l,isShowSelectAll:a,isShowCheckbox:s,placeholder:C,required:d,disableClearable:A,size:c},{name:h,value:p,disabled:u,options:g,errorMessage:m,freeSolo:f,multiple:k,isShowSelectAll:E,isShowCheckbox:I,placeholder:S,required:w,disableClearable:B,size:x})=>e===h&&t===p&&i===u&&o===g&&r===m&&n===f&&l===k&&a===E&&s===I&&C===S&&d===w&&A===B&&c===x));Hh.displayName="SmartAutoCompleteField";const Kh=k((({errorMessage:t,onKeyDown:i,onBlur:o,onFocus:r,onClick:n,...l},a)=>{const s=P(),{type:C,disabled:d}=l,{butterflyBlue:A,lipstickRed:p,iron:u}=s.palette.app.color,[g,m]=h(!1),{navigationKey:f}=Fo(),{handleEnterNavigation:k}=ir({navigationKey:f}),E=c((()=>d?u[700]:g?A[900]:t?p[900]:u[800]),[d,t,g]);return e(ch,{title:t??"",position:"top",delay:50,children:e("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"},children:e("div",{style:{display:"flex",alignItems:"center",border:"checkbox"===C?"none":`2px solid ${E}`,borderRadius:"4px",padding:"4px 8px",background:d?u[50]:"white",minHeight:"20px"},children:e("input",{ref:a,...l,style:{width:"100%",border:"none",background:"transparent",padding:"0",fontSize:"13px",outline:"none"},onClick:e=>{e.stopPropagation(),n?.(e)},onFocus:e=>{e.stopPropagation(),r?.(e),m(!0)},onBlur:e=>{e.stopPropagation(),o?.(e),m(!1)},onKeyDown:e=>{"enter"!==f||"Enter"!==e.key||"checkbox"===C||e.ctrlKey||e.metaKey||e.altKey||k(e),i?.(e)}})})})})}));Kh.displayName="SmartTextFieldComponent";const Gh=B(Kh,((e,t)=>e.name===t.name&&e.value===t.value&&e.checked===t.checked&&e.disabled===t.disabled&&e.type===t.type&&e.errorMessage===t.errorMessage));Gh.displayName="SmartTextField";const Yh=k((({errorMessage:i,onKeyDown:o,onFocus:r,onBlur:n,style:l,className:a,size:s="md",...C},d)=>{const A=P(),{type:p,disabled:u,name:m}=C,{butterflyBlue:f,lipstickRed:k,iron:E}=A.palette.app.color,I=lh(E),S=ah(E,u),[w,B]=h(!1),{navigationKey:x}=Fo(),{handleEnterNavigation:Q,setInputRef:M}=ir({navigationKey:x}),b="checkbox"===p,J=c((()=>i?k[900]:w?f[900]:E[800]),[f,i,E,w,k]),v=c((()=>sh(I)),[I]),R=c((()=>dh(s,"text")),[s]),L=c((()=>({...Ch(S,s),...l})),[s,l,S]),y=[ih,a].filter(Boolean).join(" "),F=g((e=>{b||M(e),"function"==typeof d?d(e):d&&(d.current=e)}),[b,d,M]),U=e=>{"enter"!==x||"Enter"!==e.key||b||e.ctrlKey||e.metaKey||e.altKey||Q(e),o?.(e)},D=e=>{e.stopPropagation(),B(!0),r?.(e)},Z=e=>{e.stopPropagation(),B(!1),n?.(e)},H=e(b?"input":so,{ref:F,...C,disabled:u,className:y,style:L,onClick:e=>{e.stopPropagation()},onFocus:D,onBlur:Z,onKeyDown:U});return t(ch,{title:i??"",position:"top",delay:50,children:[b?null:e("style",{children:v}),e(ao.Root,{disabled:u,name:m,style:{width:"100%"},children:e("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%"},children:e("div",{style:{display:"flex",alignItems:"center",border:b?"none":`2px solid ${J}`,background:E[600],width:"100%",...R},children:H})})})]})}));Yh.displayName="SmartTextFieldV2Component";const Vh=B(Yh,(({name:e,value:t,checked:i,disabled:o,type:r,size:n,errorMessage:l,placeholder:a},{name:s,value:C,checked:d,disabled:A,type:c,size:h,errorMessage:p,placeholder:u})=>e===s&&t===C&&i===d&&o===A&&r===c&&n===h&&l===p&&a===u));function Th({items:i,disabled:o=!1,avoidDeleteFocus:n=!1}){const[l,a]=h(null),s=!!l,d=J(),A=d.palette.app.color.red?.[900]??d.palette.error.main,g=p(null),m=p([]),f=c((()=>(i??[]).filter((({isView:e})=>!e))),[i]),k=()=>a(null),E=e=>"delete"===e.toLowerCase();u((()=>{const e=g.current;if(!e)return;const t=t=>{o||"Enter"===t.key&&(t.preventDefault(),a(e))};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[o]);const I=e=>{const t=m.current;if(!t.length)return;const i=document.activeElement,o=t.findIndex((e=>e===i)),r=-1!==o?o:1===e?-1:t.length;for(let i=1;i<=t.length;i++){const o=(r+i*e+t.length)%t.length,l=t[o],a=f[o]?.title??"";if(l&&(!n||!E(a)))return void l.focus()}};return u((()=>{s&&n&&f.length&&requestAnimationFrame((()=>I(1)))}),[n,f.length,s]),f.length?t(M,{sx:{width:"100%"},children:[e(r,{ref:g,component:"div",sx:{width:"100%",cursor:"pointer",alignItems:"center"},onClick:e=>{o||a(e.currentTarget)},disabled:o,"data-clickable":"true",children:e(Ae,{})}),l&&e(ce,{open:!0,anchorEl:l,onClose:k,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{onKeyDown:e=>{n&&("ArrowDown"===e.key&&(e.preventDefault(),I(1)),"ArrowUp"===e.key&&(e.preventDefault(),I(-1)))}}},children:e(Kl,{padding:{padding:"2px"},children:f.map((({title:t,onClick:i,href:o},r)=>{const l=E(t);return e(M,{children:e(le,{...o?{component:C,href:o,prefetch:!1}:{},ref:e=>{m.current[r]=e},sx:{borderRadius:"4px",color:l?A:void 0,width:"100%",textAlign:"start",padding:"5px 16px 5px 10px"},tabIndex:l&&n?-1:0,onClick:()=>{i?.(),k()},children:e(q,{variant:"body1",children:t})})},t)}))})})]}):null}Vh.displayName="SmartTextFieldV2";const jh=({orientation:t="horizontal",activeStep:i=0,stepLabelProps:o={},steps:r,errorSteps:n=[],onStepClick:l,showActiveStepIcon:a,showTooltips:s=!1,showStepLabels:C=!0,...d})=>{const A=J(),{butterflyBlue:c,red:h}=A.palette.app.color;return e(M,{children:e(go,{activeStep:i,orientation:t,...d,children:r.map(((t,i)=>{const r=n.includes(i),a=e(uo,{...o,error:r,sx:{cursor:l?"pointer":"default",".Mui-active .MuiStepIcon-root":{color:`${c[900]} !important`},".Mui-completed .MuiStepIcon-root":{color:`${c[900]} !important`},...r&&{".MuiStepIcon-root":{color:`${h[900]} !important`},".MuiStepLabel-label":{color:`${h[900]} !important`}},...o.sx},onClick:()=>(e=>{l&&l(e)})(i),children:C&&e(q,{variant:"body2",children:t})});return e(po,{children:s?e(W,{title:t,placement:"top",children:a}):a},t)}))})})},Wh=v(mo)((({theme:e})=>({[`&.${fo.alternativeLabel}`]:{top:10,left:"calc(-50% + 16px)",right:"calc(50% + 16px)"},[`&.${fo.active}`]:{[`& .${fo.line}`]:{borderColor:"#784af4"}},[`&.${fo.completed}`]:{[`& .${fo.line}`]:{borderColor:"#784af4"}},[`& .${fo.line}`]:{borderColor:"#eaeaf0",borderTopWidth:3,borderRadius:1,...e.applyStyles("dark",{borderColor:e.palette.grey[800]})}}))),qh=v("div")((({theme:e})=>({color:"#eaeaf0",display:"flex",height:22,alignItems:"center","& .QontoStepIcon-completedIcon":{color:"#784af4",zIndex:1,fontSize:18},"& .QontoStepIcon-circle":{width:8,height:8,borderRadius:"50%",backgroundColor:"currentColor"},...e.applyStyles("dark",{color:e.palette.grey[700]}),variants:[{props:({ownerState:e})=>e.active,style:{color:"#784af4"}}]})));function zh(t){const{active:i,completed:o,className:r}=t;return e(qh,{ownerState:{active:i},className:r,children:o?e(je,{className:"QontoStepIcon-completedIcon"}):e("div",{className:"QontoStepIcon-circle"})})}const Oh=({steps:t,alternativeLabel:i=!0,stepLabelProps:o={},...r})=>e(a,{sx:{width:"100%"},spacing:4,children:e(go,{alternativeLabel:i,activeStep:1,connector:e(Wh,{}),...r,children:t.map((t=>e(po,{children:e(uo,{StepIconComponent:zh,...o,children:t})},t)))})}),Ph=({orientation:o="horizontal",activeStep:r=0,stepLabelProps:n={},steps:l,...s})=>{const C=J(),{butterflyBlue:d}=C.palette.app.color;return e(M,{children:e(go,{activeStep:r,orientation:o,...s,children:l.map(((o,r)=>e(po,{children:e(uo,{...n,sx:{".Mui-active .css-18pqgpd-MuiSvgIcon-root-MuiStepIcon-root":{color:`${d[900]} !important`},".Mui-completed .MuiStepIcon-root":{color:`${d[900]} !important`},".MuiStepIcon-text":{color:"transparent !important",display:"none"}},children:e(a,{children:t(i,o?.in_time?{children:[e(q,{variant:"caption",children:"In at"}),e(q,{variant:"caption",children:o?.in_time})]}:{children:[e(q,{variant:"caption",children:"Out at"}),e(q,{variant:"caption",children:o?.out_time})]})})})},r)))})})},Nh=()=>e(M,{flex:1,children:e(Se,{height:"30px",sx:{maxWidth:"200px",transform:"scale(1)"}})}),Xh={small:{minHeight:"36px !important",height:"36px !important",fontSize:"12px !important",padding:"10px 5px !important"},medium:{minHeight:"48px !important",height:"48px !important",fontSize:"13px !important",padding:"12px 16px !important"},large:{minHeight:"52px !important",height:"52px !important",fontSize:"14px !important",padding:"14px 18px !important"}},_h={small:{minHeight:"36px !important",height:"36px !important"},medium:{minHeight:"48px !important",height:"48px !important"},large:{minHeight:"52px !important",height:"52px !important"}},$h=({tabs:t,value:i,loading:o,tabProps:r,role:n,size:l="medium"})=>o?e(a,{gap:"10px",direction:"row",children:t.map((()=>e(Nh,{},ti())))}):e(Eo,{value:i,role:n,sx:{..._h[l],"& .MuiTabs-scroller":{minHeight:"inherit",height:"inherit"},"& .MuiTabs-flexContainer":{minHeight:"inherit",height:"inherit"},"& .MuiTab-root.MuiButtonBase-root":{...Xh[l]}},children:t.filter((({isView:e})=>!1!==e)).map((({iconPosition:t="end",toolTipLabel:i="",icon:n,href:l,target:a,...s},d)=>{const A=l?{component:C,href:l,target:a,prefetch:!1}:{},c=ye(s,["isView"]);return I(ko,{...A,key:c.value??d,icon:i?e(El,{toolTipLabel:i,placement:"bottom",children:n}):n,disabled:o,iconPosition:t,...c,...r})}))});function ep({label:i,value:o,menu:r,trimLabel:n=!0,activeTab:l,index:s,onArrowClick:d,menuAnchor:A,onAction:c,href:h,target:p,...u}){const g=J(),{butterflyBlue:m}=g.palette.app.color,f=o===l.value,k=i.toLowerCase().replaceAll(/[ _]/g,"-"),E=Bo(i,{length:n?15:i.length,omission:n?"...":""}),I={title:"Edit",onClick:()=>c&&c("editTemplate",l)},S={title:"Delete",onClick:()=>c&&c("deleteTemplate",l)},w=h?{component:C,href:h,target:p,prefetch:!1}:{},B={iconPosition:"end","data-cy":k,"data-ptag":k,value:o??s,label:t(a,{direction:"row",gap:"6px",alignItems:"center",children:[e(q,{variant:"body1",sx:{whiteSpace:"nowrap"},children:f?i:E}),f&&s>0&&e(Vl,{items:[I,S]})]})};return i.length>15&&!f&&(B.title=i),o===l.value&&r?.length&&(B.icon=e(oe,{onClick:d,id:`tabDropDown-${o}`,"aria-controls":null!==A?`dropDownMenu-${o}`:void 0,"aria-expanded":null!==A?"true":void 0,"aria-haspopup":"true","data-cy":`${k}-arrowicon`,"data-ptag":`${k}-arrowicon`})),e(ko,{sx:{borderBottom:"2px solid",borderBottomColor:f?m[900]:"white",overflow:"visible",[`&.${wo.root}`]:{minHeight:"40px",height:"40px",paddingLeft:f&&s>0?"15px":"10px"},"&:hover":{backgroundColor:m[500]}},...B,...w,...u})}function tp({tabs:t,activeTab:o,menuAnchor:r,onClose:a,onMenuItemClick:s}){return e(i,{children:t.filter((e=>!!e.menu)).map((t=>e(n,{anchorEl:r,open:t.value===o.value&&!!r,onClose:a,id:`dropDownMenu-${t.value}`,MenuListProps:{"aria-labelledby":`tabDropDown-${t.value}`},children:t.menu?.map((({label:t,disabled:i,onClick:r,href:n,target:a})=>e(l,{onClick:()=>{s(),r(o)},disabled:i,...n?{component:C,href:n,target:a,prefetch:!1}:{},children:t},t)))},t.value)))})}function ip({tabs:i,onChange:o,addButton:r,actionButton:n,ariaLabel:l,activeIndex:s=0,onAction:C}){const d=J(),[A,c]=h(i[s]),[p,g]=h(null);u((()=>{-1===i.findIndex((e=>e.value===A.value))&&(o&&i[0]&&o(i[0]),c(i[0]))}),[i,A,o]),u((()=>{c(i[s])}),[s]);return t(M,{children:[e(tp,{activeTab:A,tabs:i,onClose:()=>g(null),onMenuItemClick:()=>g(null),menuAnchor:p}),t(a,{direction:"row",justifyContent:"space-between",sx:{borderBlockEnd:"solid 1px",borderColor:d.palette.app.color.iron[700]},children:[t(a,{direction:"row",gap:"5px",alignItems:"center",overflow:"hidden",children:[e(a,{direction:"row",overflow:"hidden",children:e(Eo,{value:i.some((e=>e.value===A.value))?A.value:i[0]?.value,onChange:(e,t)=>{const r=i.find((e=>e.value===t));r&&(c(r),o&&r&&o(r))},TabIndicatorProps:{sx:{display:"none"}},sx:{[`&.${Io.root}`]:{minHeight:"40px",height:"40px"}},variant:"scrollable",scrollButtons:"auto",ScrollButtonComponent:So,"aria-label":l??"Tabs",children:i.map(((t,i)=>e(ep,{index:i,activeTab:A,onArrowClick:e=>{g(e.target)},onAction:C,menuAnchor:p,...t},t.value)))})}),r]}),e(a,{direction:"row",gap:"10px",alignItems:"center",justifyContent:"space-between",children:n})]})]})}const op=({variant:i,leaveColor:o,toolTipLabel:r})=>{const n=vo(i);return t(a,{sx:{position:"relative",width:"100%",alignItems:"center"},children:[e(M,{sx:{position:"absolute",backgroundColor:"#ffffff",border:`1px solid ${o??n}`,borderRadius:"7px",padding:"0px 5px",zIndex:1,color:`${o??n}`,height:"28px",display:"flex",alignItems:"center",cursor:"pointer"},children:e(El,{toolTipLabel:r,children:Ro(i)})}),e(ui,{valueLabelDisplay:"off",value:[0,2],max:2,step:1,sx:{"& .MuiSlider-track":{background:`${o??n}`,height:"2px",border:"none"},"& .MuiSlider-thumb":{backgroundColor:`${o??n}`,height:8,width:8},"& .MuiSlider-rail":{backgroundColor:"transparent"}}})]})},rp=({totalDots:i,intervals:o,startTimeline:r})=>e(M,{sx:{position:"relative",width:"100%",height:4},children:o?.map(((o,n)=>{const l=Ko(o.in_time),s=Ko(o.out_time),C=U.fromISO(o.in_time),d=U.fromISO(o.out_time).diff(C,["hours","minutes"]).toFormat("hh:mm");let A=np(l),c=np(s);const h=!isNaN(A),p=!isNaN(c);h&&A<r&&(A+=i),p&&(c<r&&(c+=i),h&&c<A&&(c+=i));let u="",g="";h&&(u=`In time : ${l} ${p?"":" / Missing punch"}`),p&&(g=`Out time : ${s} ${h?"":"/ Missing punch"}`);const m=o?.name??`In/Out: ${Ko(o.in_time)} - ${Ko(o.out_time)} (${d})`,f=o?.color??vo(o.status_type),k=h?(A-r)/i*100:0,E=p?(c-r)/i*100:0,I=h&&p?Math.max(E-k,0):0;return t(a,{direction:"row",children:[h&&e(W,{arrow:!0,title:u,placement:"top",children:e(M,{sx:{height:8,width:8,position:"absolute",left:`${k}%`,boxShadow:"none",backgroundColor:f,borderRadius:"50%",top:"15px",zIndex:3,"&:focus, &:hover, &:active":{boxShadow:"none"}}})}),h&&p&&e(W,{arrow:!0,title:m,placement:"top",children:e(M,{sx:{position:"absolute",left:`${k}%`,width:`${I}%`,height:3.5,top:"17.5px",backgroundColor:f,zIndex:2}})}),p&&e(W,{arrow:!0,title:g,placement:"top",children:e(M,{sx:{height:8,width:8,position:"absolute",left:`${E}%`,boxShadow:"none",backgroundColor:f,borderRadius:"50%",top:"15px",zIndex:3,"&:focus, &:hover, &:active":{boxShadow:"none"}}})})]},n)}))}),np=e=>{const t=U.fromFormat(e,"HH:mm");return t.hour+t.minute/60},lp=({totalDots:i,highlightedIntervals:o,shiftStartTime:r,shiftEndTime:n,startTimeline:l="2024-11-17T18:30:04.000Z"})=>{const s=parseFloat(Ko(l)),C=(e,t,o)=>{const r=Ko(e),n=Ko(t);let l=np(r),a=np(n);return l=l<s?l+i:l,a=a<l?a+i:a,"END"===o?a:l},d=e=>{const t=(e+s)%i;return o.some((e=>t>=parseFloat(Ko(e.in_time))&&t<=parseFloat(Ko(e.out_time))))},A=Array.from({length:i},((e,t)=>({value:(t+s)%i,label:"",highlighted:d((t+s)%i)})));return t(a,{sx:{position:"relative",width:"100%"},children:[e(rp,{totalDots:i,intervals:o,startTimeline:s}),e(W,{title:`Shift Start: ${Ko(r)}`,arrow:!0,placement:"top",children:e(M,{sx:{cursor:"pointer",position:"absolute",top:"12px",zIndex:2,left:(C(r,n,"START")-s)%i/i*100+"%"},children:e(Dr,{})})}),e(W,{title:`Shift End: ${Ko(n)}`,arrow:!0,placement:"top",children:e(M,{sx:{cursor:"pointer",position:"absolute",top:"12px",zIndex:2,left:(C(r,n,"END")-s)%i/(i-.6)*100+"%"},children:e(Dr,{})})}),e(ui,{disabled:!0,valueLabelDisplay:"off",marks:A,max:i-1,step:1,value:[],sx:{zIndex:1,"& .MuiSlider-track":{background:"transparent",height:1,border:"none"},"& .MuiSlider-mark":{backgroundColor:"gray",height:4,width:4,borderRadius:"50%"},"& .MuiSlider-markActive":{backgroundColor:"transparent",height:5,width:5},"& .MuiSlider-rail":{height:2,backgroundColor:"#929292"},"& .MuiSlider-thumb":{display:"none"}}})]})},ap=v(se,{shouldForwardProp:e=>"isParent"!==e&&"borderColor"!==e&&"backgroundColor"!==e&&"baseColor"!==e})((({theme:e,isParent:t,borderColor:i,backgroundColor:o,baseColor:r})=>({width:"auto",minWidth:0,padding:e.spacing(1),borderRadius:12,border:`1px solid ${i}`,boxShadow:t?`0 6px 18px ${y(r,.2)}`:"none",backgroundColor:o,display:"flex",alignItems:"center",gap:e.spacing(1),minHeight:40,overflow:"hidden",flex:"1 1 auto",[e.breakpoints.down("sm")]:{flex:"1 1 100%"}}))),sp=({node:i,innerRef:o,isParent:r=!1,themeColor:n})=>{const{id:l,title:a,subtitle:s,value:C}=i,d=J(),{butterflyBlue:A,slate:c}=d.palette.app.color,h=n??A[900],p=r?h:y(h,.7),u=r?y(h,.1):"none",g=c[900];return t(ap,{elevation:r?3:0,ref:o,isParent:r,borderColor:p,backgroundColor:u,baseColor:h,children:[t(M,{children:[e(q,{variant:"subtitle2",noWrap:!0,children:a}),e(q,{variant:"subtitle2",color:g,noWrap:!0,children:s})]}),e(Kl,{padding:{paddingLeft:1},children:e(M,{sx:{ml:"auto",textAlign:"right"},children:e(q,{noWrap:!0,variant:"body2",children:C})})})]},l)},Cp=({node:i,setRef:o,themeColor:r,itemWidth:n})=>{const{id:l,children:s}=i,C=!!s?.length;return t(M,{sx:{display:"flex",gap:3,alignItems:"flex-start",flex:`1 0 ${n}`},children:[e(sp,{node:i,isParent:C,innerRef:e=>o(l,e),themeColor:r}),C&&e(a,{spacing:1,sx:{mt:.5},children:de(s,(t=>e(Cp,{node:t,setRef:o,themeColor:r,itemWidth:n},t.id)))})]},l)},dp=({node:i,setRef:o,themeColor:r})=>{const{id:n,children:l}=i,s=!!l?.length;return t(a,{gap:1,children:[e(sp,{node:i,isParent:s,innerRef:e=>o(n,e),themeColor:r}),s&&e(Kl,{padding:{paddingLeft:3,paddingTop:1},children:e(a,{spacing:1,children:de(l,(t=>e(dp,{node:t,setRef:o,themeColor:r},t.id)))})})]},n)},Ap=({nodes:i,direction:o="horizontal",columns:r=3,color:n})=>{const{isMobile:l}=or(),s=p({}),C=p(null),d=p(null),A=p(null),[c,g]=h([]),m=(e,t)=>{if(t)return s.current[e]=t,void(A.current&&A.current.observe(t));s.current=ye(s.current,e)},f=e=>e?e.getBoundingClientRect():null,k=(e,t,i)=>{xo(e,(e=>{const{id:r,children:n}=e;if(!n?.length)return;const a=s.current[r];if(!a)return;const C=f(a);C&&xo(n,(e=>{const{id:r,children:n}=e,a=s.current[r];if(!a)return;const d=f(a);if(!d)return;const A=l||"vertical"===o?((e,t,i)=>{const{left:o,width:r,bottom:n}=e,{left:l,width:a,top:s}=t,{left:C,top:d}=i,A=o+r/2-C,c=n-d,h=l+a/2-C,p=s-d,u=c+Math.max(12,(p-c)/2);return`M ${A} ${c} C ${A} ${u} ${h} ${u} ${h} ${p}`})(C,d,t):((e,t,i)=>{const{right:o,top:r,height:n}=e,{left:l,top:a,height:s}=t,{left:C,top:d}=i,A=o-C,c=r+n/2-d,h=l-C,p=a+s/2-d,u=h-A,g=Math.abs(u),m=Math.min(120,Math.max(24,g/2)),f=u>=0?1:-1;return`M ${A} ${c} C ${A+m*f} ${c} ${h-m*f} ${p} ${h} ${p}`})(C,d,t);i.push({definition:A}),n?.length&&k([e],t,i)}))}))};u((()=>{const e=()=>requestAnimationFrame((()=>{(()=>{const e=d.current,t=C.current;if(!e||!t)return;const o=t.clientWidth;e.setAttribute("width",String(o)),e.setAttribute("height","auto");const r=t.getBoundingClientRect(),n=[];k(i,r,n),g(n)})()})),t=e(),o=new ResizeObserver(e);A.current=o,C.current&&o.observe(C.current),Ze(s.current).forEach((e=>o.observe(e)));const r=e;return window.addEventListener("resize",r),()=>{cancelAnimationFrame(t),o.disconnect(),A.current=null,window.removeEventListener("resize",r)}}),[i,l,o]);const E=`calc(${100/r}% - 24px)`;return t(M,{ref:C,variant:"outlined",component:se,position:"relative",sx:{overflowX:"hidden",overflowY:"visible"},children:[e(qn,{ref:d,paths:c,strokeColor:n}),e(Kl,l||"vertical"===o?{padding:{padding:2},children:e(a,{spacing:3,children:de(i,(t=>e(dp,{node:t,setRef:m,themeColor:n},t.id)))})}:{padding:{padding:2},children:e(a,{direction:"row",alignItems:"flex-start",justifyContent:"flex-start",flexWrap:"wrap",gap:3,children:de(i,(t=>e(Cp,{node:t,setRef:m,themeColor:n,itemWidth:E},t.id)))})})]})},cp=v(xe)((({theme:e,color:t})=>{const i=((e,t)=>{if(!t||"default"===t)return e.palette.grey[500];const i=e.palette[t];return i&&"object"==typeof i&&"main"in i?i.main:e.palette.grey[500]})(e,t);return{"& .MuiBadge-badge":{backgroundColor:i,color:i,boxShadow:`0 0 0 2px ${e.palette.background.paper}`,"&::after":{position:"absolute",top:"-1px",left:"-1px",width:"100%",height:"100%",borderRadius:"50%",animation:"ripple 1.2s infinite ease-in-out",border:"1px solid currentColor",content:'""'}},"@keyframes ripple":{"0%":{transform:"scale(.8)",opacity:1},"100%":{transform:"scale(2.4)",opacity:0}}}}));v(n)((({theme:e})=>({[`& .${Mo.paper}`]:{boxShadow:e.palette.app.paperBoxShadow,minWidth:"29rem",width:"auto",margin:"0 0.5rem",borderRadius:"8px",overflow:"visible","& .MuiList-root":{padding:"0",overflow:"visible"}}})));const hp=v(r,{shouldForwardProp:e=>"isOpened"!==e})((({theme:e})=>({paddingInline:"0.3rem",paddingBlock:"0.2rem",borderRadius:"8px",color:e.palette.app.color.black[900]})));function pp({userDetails:o,menuItems:r,shouldCloseOnClick:n=!0,showBadge:l=!1,badgeColor:s="success"}){const[d,A]=h(null),c=p(null),{layout:u}=or(),g="desktop"===u,m=J(),{iron:f}=m.palette.app.color,k=Boolean(d),E=()=>A(null),{name:I,avatar:S}=o,w=e(we,{src:S,sx:{border:`1px solid ${f[700]}`,width:28,height:28}});return t(M,{position:"relative",children:[e(M,{sx:{display:"flex",alignItems:"center"},children:e(hp,{ref:c,onClick:e=>{A(e.currentTarget)},size:"small","aria-haspopup":"true",children:t(a,{direction:"row",alignItems:"center",gap:1,color:"black",children:[l&&e(cp,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},variant:"dot",color:s,children:w}),!l&&w,g&&t(i,{children:[e(q,{maxWidth:150,noWrap:!0,children:I}),e(k?ve:Je,{})]})]})})}),k&&e(ce,{open:!0,anchorEl:d,onClose:E,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{elevation:0,sx:{width:220,overflow:"visible",mt:1.5,px:0,py:0,filter:"drop-shadow(0px 2px 8px rgba(0,0,0,0.32))","& .MuiAvatar-root":{width:32,height:32,ml:-.5,mr:1},"&:before":{content:'""',display:"block",position:"absolute",top:0,right:14,width:10,height:10,bgcolor:"background.paper",transform:"translateY(-50%) rotate(45deg)",zIndex:0}}}},children:e(M,{sx:{padding:"4px 0"},children:r.map((({key:i,divider:o,label:r,icon:l,sx:s,onClick:d,href:A,target:c})=>{const h=A?{component:C,href:A,target:c,prefetch:!1}:{};return t(M,{children:[o&&e($,{}),e(le,{...h,onClick:()=>{te(d)&&(d(),n&&E())},children:(l||r)&&t(a,{gap:"16px",alignItems:"center",width:"100%",flexDirection:"row",sx:{...s},children:[e(Qo,{sx:{minWidth:"20px",alignItems:"center",...s},children:l}),r&&e(q,{sx:{fontSize:"13px"},children:r})]})})]},`${i}_container`)}))})})]})}export{Vd as ASPECT_RATIO_LABELS,Yd as ASPECT_RATIO_VALUES,Jr as ActionButton,br as ActionButtons,Tl as ActionButtonsWrapper,Vl as ActionCell,Il as AddIconAction,da as AgGrid,ul as AnnouncementBanner,Ua as AppBar,Nn as AppLogoMedium,Xn as AppLogoSmall,Dr as ArrowUp,Ur as ArrowUpRight,Oa as AttendanceCard,_n as AttendanceManagementDarkSvg,$n as AttendanceReportDarkSvg,op as AttendanceStatus,dC as Autocomplete,Da as Badge,Qs as BarChart,pl as BookMarkSvg,pC as BottomDialog,gC as BottomSheet,Os as BoxStyled,Za as BreadcrumbButtonWrapper,Ya as Breadcrumbs,el as BriefcaseSvg,tl as BulkOperationsDarkSvg,vr as Button,wC as ButtonContainer,Rr as ButtonGroup,Lr as ButtonLayoutProvider,Sl as CalendarIconAction,nl as CalendarSvg,Va as Card,Ta as CardItem,ja as CardItemValue,Bs as CellSelectionTable,ol as ChartIconSvg,RC as CheckBox,Ps as CheckStyled,bo as CheckboxInput,Rs as Chip,ys as ChipWithBorder,rl as ClockSvg,Zs as CodeSnippetBox,mc as ColumnArranger,kc as ColumnArrangerDialog,fc as ColumnArrangerForm,kl as ColumnArrangerSvg,wl as ColumnIconAction,ml as CommentIcon,Wr as CompanyBanner,Bl as ConfigureIconAction,BC as ContentBox,ed as CurrencyField,Hl as CurrentLocationAction,La as CustomEnumFilter,Wl as DEFAULT_AG_GRID_PERSIST_STORAGE_TYPE,qd as DEFAULT_ASPECT_RATIOS,Wd as DEFAULT_ENABLED_VARIANTS,Zd as DEFAULT_MAX_SIZE_MB,Hd as DEFAULT_MIN_RESOLUTION,Kd as DEFAULT_QUALITY_WARN_RESOLUTION,ll as DashboardIconSvg,DC as DatePicker,TC as DateRangePicker,zC as DateRangePickerField,Gc as DateRangePickerPopUp,jC as DateRangeSelector,XC as DateTimePicker,id as DecimalTextField,MC as DeleteDialog,xl as DeleteIconAction,AC as Dialog,JC as DialogSelect,dd as DownloadAction,Ql as DownloadIconAction,Ml as DownloadPrintAction,qr as DownloadSvg,Dc as Drawer,bl as EditIconAction,al as EmployeeManagementDarkSvg,sl as EmployeeReportsDarkSvg,kn as ExitIcon,Jl as ExportIconAction,ia as FacebookCircularProgress,cd as FileNames,Cd as FilePreview,SC as FilePreviewContainer,md as FileUpload,vl as FilterIconAction,Nc as FilterList,zc as FilterListV2,Ls as FilterPill,Fs as FilterPillV2,jc as FilterPopUpDateRangeWrapper,Yc as FilterPopup,Tc as FilterPopupWrapper,Pc as FilterTypeWrapper,hn as FormAction,Fr as FormActionButton,mC as FormContainer,fC as FormGridLayout,EC as FormRow,IC as FormSection,QC as GridProvider,fl as GroupIcon,Xc as HighlightedText,Rl as HistoryIconAction,il as HolidayCalendarSvg,Cl as HomePageBanner,vd as ImageUpload,Rd as ImageUploadView,pn as ImportExcelSuccessIcon,Ll as ImportIconAction,En as InboxIcon,yl as InboxIconAction,_c as Indicator,Gd as JPEG_COMPRESS_QUALITY,Zl as KeyBoardIconAction,Ld as LOGO_ACCEPTED_TYPES,yd as LOGO_ACCEPT_ATTRIBUTE,Fd as LOGO_EXTENSION_MIME_MAP,bA as LOGO_SIZE_TOKENS,jd as LOGO_VARIANT_SIZES,un as LeaveIcon,FC as LeftArrowIcon,gl as LikeIcon,bs as LineChart,TA as ListItemButton,va as LoadingCell,oa as LoadingOverlay,gn as LoanIcon,In as LogoIcon,YA as LogoPicker,UA as LogoViewDialog,wh as MAX_LIST_HEIGHT,zr as MasterIcon,xC as MasterPageLayout,dl as MiscellaneousManagementDarkSvg,yo as NavigationKeyProvider,Do as NavigationRouterProvider,Sn as NoDataFoundSvg,ra as NoDataOverlay,sp as Node,Ih as OPTION_ROW_HEIGHT,mn as OvertimeIcon,Td as PRIMARY_SIZE_BY_RATIO,Kl as PadBox,eh as Pagination,OA as PasswordField,Al as PayrollManagementDarkSvg,cl as PayrollReportDarkSvg,XA as PhoneInputField,Md as PhotoCaptureDialog,vs as PieChart,th as PrintDownloadActions,Fl as ProcessIconAction,Wa as ProfileCard,qa as ProfileCardBody,za as ProfileCardHeader,ec as RadioGroupField,oc as Rating,Ra as RedirectionCell,UC as RightArrowIcon,Bh as SELECT_ALL_VALUE,ih as SMART_FIELD_INPUT_CLASS,nd as SUPPORTED_DOC_FORMATS,ld as SUPPORTED_EXCEL_FORMATS,Wo as SUPPORTED_FILE_TYPES,od as SUPPORTED_IMAGE_FORMATS,rd as SUPPORTED_PDF_FORMATS,fn as SalaryIcon,bC as SaveDialog,rc as SearchField,sc as Select,Or as SettingIcon,$c as SeverityIndicator,Kc as SideDrawer,Hh as SmartAutoCompleteField,gh as SmartCurrencyField,fh as SmartDialogSelect,Th as SmartGridActionCell,Ic as SmartLink,Eh as SmartSelectField,Gh as SmartTextField,Vh as SmartTextFieldV2,ch as SmartTooltip,yr as SplitButton,jh as Stepper,Oh as StepperV2,Ph as StepperV3,nc as StickySearchField,wn as SvgAccessDenied,Pr as SvgAccount,Bn as SvgAdd,xn as SvgAddRounded,Zr as SvgArrival,Nr as SvgBankConfig,qn as SvgBranches,Qn as SvgCalendar,Mn as SvgColumn,Xr as SvgConfiguration,bn as SvgConfigure,hl as SvgCurrentLocation,Jn as SvgDelete,Hr as SvgDeparture,an as SvgDevices,vn as SvgDownload,Rn as SvgDrop,Dn as SvgEdit,zn as SvgEmail,sn as SvgEmployeeOnboarding,_r as SvgEmployees,ln as SvgEngage,$r as SvgExpenses,Ln as SvgExport,Fn as SvgFilterList,yn as SvgFilteredList,An as SvgHelpDesk,Un as SvgHistory,Kr as SvgHoliday,Zn as SvgHome,Hn as SvgImport,On as SvgIndicator,Kn as SvgKeyBoard,Gr as SvgLeaveCalendar,en as SvgLetteremplate,Gn as SvgNoLogo,Yn as SvgNoSign,tn as SvgOrganization,Vn as SvgPageNotFound,on as SvgPayroll,Pn as SvgPhone,Tn as SvgProfile,jn as SvgReGenerate,rn as SvgStock,cn as SvgTasks,Cn as SvgTeam,nn as SvgTransaction,Yr as SvgUnverifieduser,Vr as SvgUser,Tr as SvgVerifiedUser,Wn as SvgView,dn as SvgVisitors,jr as SvgWeekoffCalendar,dc as SwitchField,ep as Tab,ip as TabBar,$h as Tabs,tp as TabsMenus,zA as TextField,wr as Theme,cc as TimeField,pc as TimePicker,lp as Timeline,Gs as Toaster,El as Tooltip,Ap as Tree,pp as UserProfileMenu,Sh as VIRTUALIZE_THRESHOLD,Ul as ViewDetailsIconAction,Ad as ViewFilePreviewDialog,Dl as ViewIconAction,cr as accessorFnRegex,Qr as appTheme,Nl as buildAgGridPersistedState,Qa as calculateSummaryRow,$l as clearAgGridPersistedState,fr as colorPaletteUI,yC as dateFormats,aa as defaultPageSize,RA as detectLogoShape,Vo as downloadFile,jo as downloadPrintHtml,dr as emailRegex,Xo as errorMessages,gd as error_with_transaltion,ya as extractPrefixedValue,ts as extractSortValue,No as filterByFields,Jh as filterOptionsByQuery,Ea as flattenColumns,Ho as formatDate,qc as formatFilterData,Yo as formatHours,zl as getAgGridPersistStorage,ql as getAgGridPersistStorageKey,Ol as getAgGridPersistedState,np as getArrowValue,vo as getColorByVariant,vA as getDefaultPreviewLimits,Go as getDifferenceInHHmmss,JA as getEditFrameSize,_o as getErrorProps,Wc as getFormValue,vh as getInitialHighlightIndex,LA as getLogoFrameSize,Ud as getLogoMimeFromFileName,os as getNextSortDirection,xh as getOptionLabelText,Qh as getOptionValueText,Br as getPaletteByTheme,Ch as getSmartFieldInputStyles,lh as getSmartFieldPlaceholderColor,sh as getSmartFieldPlaceholderCss,nh as getSmartFieldSizeConfig,ah as getSmartFieldTextColor,dh as getSmartFieldWrapperStyles,Ro as getStatusLabel,Ko as getTimeInHHmm,zd as getVariantsForAspectRatio,Oo as getZIndex,pr as highlightWordsRegex,Po as hslToRgb,hr as hslaRegex,qo as isFileSizeValid,sd as isFileType,zo as isFileTypeValid,Dd as isLogoAcceptedType,Mh as isSelectAllOption,ns as isSelectionDisabled,rs as isSortingEnabled,Od as isSvgFile,sr as isoDateRegex,yA as loadImageNaturalSize,ar as monthYearRegex,Cr as noSpecialCharacterRegex,bh as normalizeToStringArray,ur as numericRegex,sa as pageSizeOptions,er as parseCellValue,$o as parseNumericValue,td as predefinedOptions,Xl as restoreAgGridFilterState,_l as restoreAgGridPaginationState,Jo as serverityOptions,Pl as setAgGridPersistedState,la as showNoRowsOverlay,is as sortTableData,Ar as timeRegex,Ws as toasts,Mr as urlToNestedObject,ca as useAgGridCheckBoxSelection,ha as useAgGridFilteredData,ga as useAgGridKeyboardShortcuts,ea as useAgGridPersist,ta as useAgGridPersistReset,ma as useAgGridRowSelectionConfig,Ja as useAgGridSelection,Ma as useAgGridSummaryRow,ba as useAgGridSummaryRowUpdate,tr as useDialogActions,ir as useFormFieldFocus,or as useGetDeviceType,rr as useGlobalKeyboardShortcut,Fo as useNavigationKeyContext,Zo as useNavigationRouter,lr as useParseHref,$a as useRowSelection,ls as useSorting,nr as useZoomLevel};
|
|
24
24
|
//# sourceMappingURL=index.esm.js.map
|