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-def636a4.js";import{S as E}from"./SideMenuDetailLayout-6e1ae0e7.js";import"./index-accbca3c.js";import"./index.esm-7d9d1491.js";import"./index.esm-eec4f448.js";import"./yup-c8535458.js";import"./SelectComponent-cea9b89b.js";import"./objectSpread2-a4d0f5f6.js";import"./floating-ui.dom-e7d69f3b.js";import"./InputLabel-e2e73b27.js";import"./useFormControl-880b2f7b.js";import"./TextArea-6c103c50.js";import"./TextField-2ba95a45.js";import"./FormControl-1f811046.js";import"./OutlinedInput-ddb8bb3f.js";import"./List-17cd485b.js";import"./Select-2cfb5afd.js";import"./Menu-af49d134.js";import"./Grow-85576dd3.js";import"./useControlled-bd643819.js";import"./createSvgIcon-ff487f53.js";import"./AvatarGroup-862fb05d.js";import"./Avatar-03680000.js";import"./Tooltip-762a58b6.js";import"./ScrollableList-a550bc32.js";import"./Loader-16c57fae.js";import"./CardContent-c8b2d0af.js";import"./Chip-81b6c661.js";import"./DialogContent-0cb684b3.js";import"./DialogTitle-e2e75924.js";import"./LoadingButton-621a0e8f.js";import"./index-f48c8aa0.js";import"./useMediaQuery-4304fb25.js";import"./composeClasses-b42b2e69.js";import"./useToggle-2b3cfa4d.js";import"./useViewPort-4849ab19.js";import"./index-02faff3d.js";import"./AntdIcon-34324527.js";import"./presets-dbb0f3bf.js";import"./FilterFilled-08c5b5a7.js";import"./FilterOutlined-03ee9578.js";import"./InfoCircleOutlined-3c134b7f.js";import"./SolutionOutlined-a1ba47eb.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};
