import{z as v,d as y,av as M,r as x,g as _,i as C,j as e,B as l,T as $,hz as P,P as k,hA as S,a as T,hB as B,hC as E}from"./index-858224db.js";import{I as A,R as O}from"./index-db80c23a.js";import{A as R}from"./index-9fb59bc9.js";import{T as z,a as L}from"./Tabs-bae8b806.js";import"./AntdIcon-8f3bee6f.js";import"./objectSpread2-cfd43bb2.js";import"./index-9223140c.js";import"./index-e5978b8b.js";import"./FilterFilled-4ddeca5a.js";import"./FilterOutlined-c1046d9f.js";import"./InfoCircleOutlined-d8efa3c7.js";import"./SolutionOutlined-ac051014.js";import"./index.esm-241dec99.js";import"./yup-9213c3af.js";import"./SelectComponent-e1904bd2.js";import"./createClass-042c577b.js";import"./TextField-bbb2480f.js";import"./Select-8b602eed.js";import"./Grow-b7b43b3f.js";import"./isMuiElement-ec705bc2.js";import"./Checkbox-57cdf644.js";import"./SwitchBase-959e94f2.js";import"./TextArea-78cda1eb.js";import"./Avatar-cdf09d52.js";import"./Delete-517797a1.js";import"./ScrollableList-bf78e54b.js";import"./CircularProgress-5bd54bd6.js";import"./Container-d9947ee3.js";import"./ListItem-b47a5898.js";import"./ListItemText-16b22a4d.js";import"./listItemTextClasses-ac0d77df.js";import"./DialogContent-e06a39bc.js";import"./DialogTitle-6e616d34.js";import"./DialogContentText-a2775ca2.js";import"./DialogActions-825c19e9.js";import"./LoadingButton-4babbc5c.js";import"./composeClasses-b42b2e69.js";import"./Divider-262150be.js";import"./dividerClasses-3bf2d765.js";import"./KeyboardArrowRight-b25c72ab.js";function U(o){const{children:a,value:r,index:t,...m}=o;return e.jsx("div",{role:"tabpanel",hidden:r!==t,id:`simple-tabpanel-${t}`,"aria-labelledby":`simple-tab-${t}`,...m,children:r===t&&e.jsx(l,{mt:2,children:a})})}function W(o){return{id:`simple-tab-${o}`,"aria-controls":`simple-tabpanel-${o}`}}const D=({menuCode:o,fromScreen:a,callback:r,data:t,app_label:m,model_name:i,goBackUrl:c,assignUserCallback:b,headerContent:s,tabsData:d,onTabClick:u})=>{const I=v(),h=y(),{id:f,tab:n}=M(),w=`${m}.${i}`;return x.useEffect(()=>{h(_({showMobileMenu:!1})),h(C({code:o,from:a}))},[]),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:()=>{I(c,{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(R,{instance_id:f||"",modal_path:w,callback:b}),s&&s]})]}),e.jsx(l,{sx:{borderColor:"divider",mt:1},children:e.jsx(k,{sx:{boxShadow:"none",borderRadius:"10px",pb:"10px",pt:"3px"},children:e.jsx(z,{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=A[p.icon];return e.jsx(L,{icon:g?e.jsx(g,{style:{fontSize:16}}):e.jsx(O,{style:{fontSize:16}}),onClick:()=>u(f||"",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(),a=y(),{id:r,tab:t,tenderId:m}=M(),{workOrder:{selectedData:i},system:{projectsMenuItemsList:c,userAccessList:b}}=T(s=>B(s));return x.useEffect(()=>{a(_({showMobileMenu:!1})),a(C({code:"MENU0011",from:"projectsmenu"}))},[]),x.useEffect(()=>{r&&a(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:c&&[{key:"project_details",label:"Details",icon:"DashboardOutlined",url:"/",urlParams:{id:r}},...c.filter(s=>!(!(i!=null&&i.is_performace_bank_guarantee)&&s.url==="/project/performance_bank_guarantee"))],onTabClick:(s,d,u)=>{o(`/work_order/view/${s}/${d}${u}`)}})})};export{$e as default};
