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-e972fa8e.js";import{I as O,R}from"./index-734ebdae.js";import{A as z}from"./index-3fedf438.js";import{T as A,a as L}from"./Tabs-dec49dd9.js";import"./AntdIcon-c86cb7c3.js";import"./objectSpread2-5ffd54f7.js";import"./index-44db81fe.js";import"./index-e5978b8b.js";import"./FilterFilled-61dd8e74.js";import"./FilterOutlined-aeeaa696.js";import"./InfoCircleOutlined-83ae77b7.js";import"./SolutionOutlined-98dded38.js";import"./index.esm-b3c20f6d.js";import"./yup-b3178c01.js";import"./SelectComponent-ef6ff29b.js";import"./createClass-8ffbea6f.js";import"./TextField-77f9d647.js";import"./Select-a2938be0.js";import"./Grow-0b3a9797.js";import"./isMuiElement-fab695f8.js";import"./Checkbox-05d562e2.js";import"./SwitchBase-a3d90b7d.js";import"./TextArea-6c7f39e1.js";import"./Avatar-fb312f17.js";import"./Delete-1b6765b9.js";import"./ScrollableList-4768c2b7.js";import"./CircularProgress-58819244.js";import"./Container-41b00a20.js";import"./ListItem-7f8ad7bc.js";import"./ListItemText-79ddc820.js";import"./listItemTextClasses-f7cdafa8.js";import"./DialogContent-51a7b314.js";import"./DialogTitle-6bcbc606.js";import"./DialogContentText-1562904b.js";import"./DialogActions-122de1b4.js";import"./LoadingButton-1312b0f8.js";import"./composeClasses-b42b2e69.js";import"./Divider-1d368ab1.js";import"./dividerClasses-b771f620.js";import"./KeyboardArrowRight-4b11e6b9.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};
