import{A as v,d as y,aA as M,r as x,g as I,i as _,j as e,B as l,T as $,jG as P,P as k,jH as S,a as T,jI as A,jJ as B}from"./index-60657852.js";import{I as E,R as O}from"./index-f9386f7e.js";import{A as R}from"./index-e963973a.js";import{T as L,a as U}from"./Tabs-b3c7f88f.js";import"./AntdIcon-53906b68.js";import"./objectSpread2-b46e5e65.js";import"./index-980acb6c.js";import"./FilterFilled-e5a9bf0e.js";import"./FilterOutlined-6f602090.js";import"./InfoCircleOutlined-54a98740.js";import"./SolutionOutlined-3f2d87e9.js";import"./index.esm-509a598d.js";import"./yup-75ad371b.js";import"./SelectComponent-7b1a8800.js";import"./createClass-2b895736.js";import"./TextField-6b778b78.js";import"./Select-7d2a5359.js";import"./Grow-a21bdd26.js";import"./isMuiElement-82a67859.js";import"./Checkbox-026acf65.js";import"./SwitchBase-3b306fc6.js";import"./TextArea-d897dbf9.js";import"./Avatar-44209507.js";import"./Delete-b5761125.js";import"./ScrollableList-ef4c85dc.js";import"./Container-87c36306.js";import"./ListItem-d3e4c009.js";import"./ListItemText-fdaa9509.js";import"./listItemTextClasses-81f8effc.js";import"./DialogContent-d5183bd6.js";import"./DialogTitle-66c21479.js";import"./DialogContentText-e3f3f7dd.js";import"./DialogActions-1dfa5a01.js";import"./LoadingButton-c619bdb5.js";import"./Divider-6555f8d4.js";import"./dividerClasses-590294d7.js";import"./KeyboardArrowRight-5039311c.js";function W(o){const{children:a,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:a})})}function D(o){return{id:`simple-tab-${o}`,"aria-controls":`simple-tabpanel-${o}`}}const z=({menuCode:o,fromScreen:a,callback:r,data:t,app_label:c,model_name:i,goBackUrl:m,assignUserCallback:b,headerContent:s,tabsData:d,onTabClick:u})=>{const w=v(),j=y(),{id:f,tab:n}=M(),C=`${c}.${i}`;return x.useEffect(()=>{j(I({showMobileMenu:!1})),j(_({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:()=>{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(R,{instance_id:f||"",modal_path:C,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(L,{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,h)=>{const g=E[p.icon];return e.jsx(U,{icon:g?e.jsx(g,{style:{fontSize:16}}):e.jsx(O,{style:{fontSize:16}}),onClick:()=>u(f||"",h,(p==null?void 0:p.url)||""),iconPosition:"start",label:p.label,...D(h)},p.key)})})})}),e.jsx(W,{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:c}=M(),{workOrder:{selectedData:i},system:{projectsMenuItemsList:m,userAccessList:b}}=T(s=>A(s));return x.useEffect(()=>{a(I({showMobileMenu:!1})),a(_({code:"MENU0011",from:"projectsmenu"}))},[]),x.useEffect(()=>{r&&a(B({id:r||""}))},[r]),e.jsx(e.Fragment,{children:e.jsx(z,{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(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};
