import{z as v,d as y,az as M,r as x,g as _,i as I,j as e,B as l,T as $,ia as P,P as k,ib as S,a as T,ic as B,id as E}from"./index-e0c07a84.js";import{I as O,R}from"./index-89215fac.js";import{A as z}from"./index-2b5d26ca.js";import{T as A,a as L}from"./Tabs-da2417ca.js";import"./AntdIcon-bc64d1d9.js";import"./objectSpread2-f946b5f0.js";import"./index-c7a54fed.js";import"./index-e5978b8b.js";import"./FilterFilled-80640201.js";import"./FilterOutlined-6138f61b.js";import"./InfoCircleOutlined-7db61317.js";import"./SolutionOutlined-d47f9a2d.js";import"./index.esm-79617ba5.js";import"./yup-74a95d85.js";import"./SelectComponent-5a0ffb58.js";import"./createClass-1acb73b4.js";import"./TextField-23174150.js";import"./Select-a8f8fd6a.js";import"./Grow-5c4c469c.js";import"./isMuiElement-953ce284.js";import"./Checkbox-80534fe3.js";import"./SwitchBase-ed82e33a.js";import"./TextArea-e9886f56.js";import"./Avatar-acb20b85.js";import"./Delete-51c4ef05.js";import"./ScrollableList-874c742d.js";import"./CircularProgress-cff840b0.js";import"./Container-fd0913ac.js";import"./ListItem-f8776a6a.js";import"./ListItemText-2794ac4e.js";import"./listItemTextClasses-e9c46ccd.js";import"./DialogContent-bfc00e3a.js";import"./DialogTitle-d1ec1f1a.js";import"./DialogContentText-c88b94b0.js";import"./DialogActions-7f92619e.js";import"./LoadingButton-f9561377.js";import"./composeClasses-b42b2e69.js";import"./Divider-ee8faca1.js";import"./dividerClasses-6c6c8dc7.js";import"./KeyboardArrowRight-aeb4c8ed.js";function U(o){const{children:s,value:r,index:t,...c}=o;return e.jsx("div",{role:"tabpanel",hidden:r!==t,id:`simple-tabpanel-${t}`,"aria-labelledby":`simple-tab-${t}`,...c,children:r===t&&e.jsx(l,{mt:2,children:s})})}function W(o){return{id:`simple-tab-${o}`,"aria-controls":`simple-tabpanel-${o}`}}const D=({menuCode:o,fromScreen:s,callback:r,data:t,app_label:c,model_name:i,goBackUrl:m,assignUserCallback:b,headerContent:a,tabsData:d,onTabClick:u})=>{const w=v(),f=y(),{id:h,tab:n}=M(),C=`${c}.${i}`;return x.useEffect(()=>{f(_({showMobileMenu:!1})),f(I({code:o,from:s}))},[]),e.jsx(e.Fragment,{children:e.jsx(l,{sx:{width:"100%"},children:e.jsxs(l,{sx:{mt:1},children:[e.jsxs(l,{sx:{py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[e.jsxs($,{variant:"h4",sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",fontWeight:"500"},onClick:()=>{w(m,{relative:"path"})},children:[e.jsx(P,{size:24}),`${t==null?void 0:t.code}`]}),e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(z,{instance_id:h||"",modal_path:C,callback:b}),a&&a]})]}),e.jsx(l,{sx:{borderColor:"divider",mt:1},children:e.jsx(k,{sx:{boxShadow:"none",borderRadius:"10px",pb:"10px",pt:"3px"},children:e.jsx(A,{value:n?+n:0,sx:{".MuiButtonBase-root":{m:0,p:0},".MuiTabs-flexContainer":{p:0,m:0,px:0,gap:"0px"},".MuiTab-root":{minHeight:"18px",padding:"12px !important",minWidth:"18px !important",boxShadow:"none",borderRadius:"6px",mt:"5px"}},"aria-label":"scrollable auto tabs example",variant:"scrollable",scrollButtons:"auto",children:d&&d.map((p,j)=>{const g=O[p.icon];return e.jsx(L,{icon:g?e.jsx(g,{style:{fontSize:16}}):e.jsx(R,{style:{fontSize:16}}),onClick:()=>u(h||"",j,(p==null?void 0:p.url)||""),iconPosition:"start",label:p.label,...W(j)},p.key)})})})}),e.jsx(U,{value:n?+n:0,index:n?+n:0,children:e.jsx(k,{variant:"elevation",sx:{p:2,borderRadius:"10px"},children:e.jsx(S,{})})})]})})})},$e=()=>{const o=v(),s=y(),{id:r,tab:t,tenderId:c}=M(),{workOrder:{selectedData:i},system:{projectsMenuItemsList:m,userAccessList:b}}=T(a=>B(a));return x.useEffect(()=>{s(_({showMobileMenu:!1})),s(I({code:"MENU0011",from:"projectsmenu"}))},[]),x.useEffect(()=>{r&&s(E({id:r||""}))},[r]),e.jsx(e.Fragment,{children:e.jsx(D,{menuCode:"MENU0011",fromScreen:"projectsmenu",data:i,app_label:"ProjectManagement",model_name:"project",goBackUrl:"/work_order",assignUserCallback:()=>{},tabsData:m&&[{key:"project_details",label:"Details",icon:"DashboardOutlined",url:"/",urlParams:{id:r}},...m.filter(a=>!(!(i!=null&&i.is_performace_bank_guarantee)&&a.url==="/project/performance_bank_guarantee"))],onTabClick:(a,d,u)=>{o(`/work_order/view/${a}/${d}${u}`)}})})};export{$e as default};
