import{E as _,b as S,ek as g,el as v,a as w,fy as M,r as n,f as b,h as j,fz as C,em as x,j as o,Q as z,J as k}from"./index-d2b25495.js";import{S as E}from"./SideMenuDetailLayout-a14964d2.js";import"./index-b3c5bebe.js";import"./index.esm-ce3c2c20.js";import"./index.esm-3043d6d4.js";import"./yup-267e586f.js";import"./SelectComponent-d286bfef.js";import"./objectSpread2-b41ee31b.js";import"./InputLabel-bb6ab40e.js";import"./useFormControl-2b068664.js";import"./TextArea-7e39a6e1.js";import"./TextField-e155d2be.js";import"./FormControl-73683015.js";import"./OutlinedInput-86f3ec98.js";import"./Select-ef36a2b2.js";import"./Menu-337a466b.js";import"./Grow-8719411b.js";import"./List-863f013e.js";import"./useControlled-8d737f13.js";import"./createSvgIcon-e39ae511.js";import"./AvatarGroup-31138314.js";import"./Avatar-9337c33f.js";import"./Tooltip-82372cdb.js";import"./popper-f3391c26.js";import"./ScrollableList-fc1de312.js";import"./Loader-1b927baf.js";import"./CardContent-be810fe0.js";import"./Chip-75fd9653.js";import"./DialogContent-cded694d.js";import"./DialogTitle-a145b392.js";import"./LoadingButton-c8e88148.js";import"./index-38f860bc.js";import"./useMediaQuery-b1fbc166.js";import"./composeClasses-b42b2e69.js";import"./useToggle-4d859601.js";import"./useViewPort-1fe27edd.js";import"./index-19cd9110.js";import"./AntdIcon-8449be55.js";import"./index-709861af.js";import"./FilterFilled-4dfce120.js";import"./FilterOutlined-653b7cb0.js";import"./InfoCircleOutlined-a1ed1ad6.js";import"./SolutionOutlined-bb59aa7b.js";const ve=()=>{const m=_(),a=S(),{id:r,tab:T}=g(),{tenders:{selectedData:t},system:{tenderMenuItemsList:p,userAccessList:s}}=v(),{caseSheet:{caseSheetList:c,pageParams:l}}=w(e=>M(e)),[h,f]=n.useState(!1);return n.useEffect(()=>{a(b({showMobileMenu:!1})),a(j({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:p&&[{key:"overview",label:"Over View",icon:"DashboardOutlined",url:"/",urlParams:{id:r}},...p.filter(e=>{var i;return!(t.authorized_status!==2&&t.authorized_status!==5&&e.url!=="/tender_items"||!((i=t==null?void 0:t.is_reverse_auction)!=null&&i.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")})],headerContent:o.jsx(z,{direction:"row",spacing:1,children:(s==null?void 0:s.indexOf("ProjectManagement.change_project"))!==-1&&t.authorized_status!=1&&t.authorized_status!=5&&o.jsx(k,{variant:"contained",size:"large",onClick:()=>{var e;m(`/work_order/${r}/${(e=t==null?void 0:t.project)==null?void 0:e.id}`)},children:"Convert To Project"})}),onTabClick:(e,u,i)=>{m(`/tenders/view/${e}/${u}${i}`)}})})};export{ve as default};
