import{F as _,b as S,eh as g,ei as j,a as v,fF as w,r as n,f as M,i as b,fG as C,ej as x,j as o,S as z,K as k}from"./index-60a3c753.js";import{S as E}from"./SideMenuDetailLayout-c5886ad6.js";import"./index-f98ad8ec.js";import"./index.esm-c494934a.js";import"./index.esm-62d6b2f7.js";import"./yup-92678dde.js";import"./SelectComponent-e431868e.js";import"./objectSpread2-85813881.js";import"./floating-ui.dom-e7d69f3b.js";import"./InputLabel-71dfc9d4.js";import"./useFormControl-e13b5747.js";import"./TextArea-b2d5bcf9.js";import"./TextField-32b29087.js";import"./FormControl-d13d2693.js";import"./OutlinedInput-3a884178.js";import"./List-f567f8e4.js";import"./Select-99fc0d84.js";import"./Menu-d1b7e1c3.js";import"./Grow-68442588.js";import"./useControlled-194ef007.js";import"./createSvgIcon-de433e5f.js";import"./AvatarGroup-2ca54025.js";import"./Avatar-a21f41a5.js";import"./Tooltip-88e63512.js";import"./ScrollableList-1962b023.js";import"./Loader-466ccb5e.js";import"./CardContent-faee3650.js";import"./Chip-cc311899.js";import"./DialogContent-89e21f2e.js";import"./DialogTitle-fe69da5c.js";import"./LoadingButton-3975ddf9.js";import"./index-900fa817.js";import"./useMediaQuery-dba48e3b.js";import"./composeClasses-b42b2e69.js";import"./useToggle-593ec652.js";import"./useViewPort-a06269d3.js";import"./index-3ddab5e6.js";import"./AntdIcon-bed41c21.js";import"./presets-06d13753.js";import"./FilterFilled-cdde02db.js";import"./FilterOutlined-c131dc67.js";import"./InfoCircleOutlined-351fb70a.js";import"./SolutionOutlined-614dece1.js";const je=()=>{const p=_(),a=S(),{id:r,tab:T}=g(),{tenders:{selectedData:t},system:{tenderMenuItemsList:m,userAccessList:i}}=j(),{caseSheet:{caseSheetList:c,pageParams:l}}=v(e=>w(e)),[h,f]=n.useState(!1);return n.useEffect(()=>{a(M({showMobileMenu:!1})),a(b({code:"MENU0009",from:"tendermenu"})),a(C({...l,search:"",page:1,page_size:10,tender:r}))},[]),n.useEffect(()=>{r&&a(x({id:r||""}))},[r]),o.jsx(o.Fragment,{children:o.jsx(E,{menuCode:"MENU0009",fromScreen:"tendermenu",data:t,app_label:"TenderManagement",model_name:"tender",goBackUrl:"/tenders",assignUserCallback:e=>{f((e==null?void 0:e.length)>0)},tabsData:m&&[{key:"overview",label:"Over View",icon:"DashboardOutlined",url:"/",urlParams:{id:r}},...m.filter(e=>{var s;return!(t.authorized_status!==2&&t.authorized_status!==5&&e.url!=="/tender_items"&&e.url!=="/tender_stages"||!((s=t==null?void 0:t.is_reverse_auction)!=null&&s.id)&&e.url==="/reverse_auction"||!h&&e.url==="/case_sheet"||!c.some(d=>d.authorized_status===4||d.authorized_status===2)&&e.url!=="/tender_items"&&e.url!=="/case_sheet"&&e.url!=="/tender_stages")})],headerContent:o.jsx(z,{direction:"row",spacing:1,children:(i==null?void 0:i.indexOf("ProjectManagement.change_project"))!==-1&&t.authorized_status!=1&&t.authorized_status!=5&&o.jsx(k,{variant:"contained",size:"large",onClick:()=>{var e;p(`/work_order/${r}/${(e=t==null?void 0:t.project)==null?void 0:e.id}`)},children:"Convert To Project"})}),onTabClick:(e,u,s)=>{p(`/tenders/view/${e}/${u}${s}`)}})})};export{je as default};
