import{ek as A,a as B,iE as b,b as v,r as y,jl as o,j as a,B as c,P as h,_ as D,b5 as T,jm as E,iD as M,b2 as O,jn as k}from"./index-d2b25495.js";import{T as I}from"./TopComponent-23a44952.js";import{T as N}from"./index-75fca24c.js";import{A as R}from"./LeadStage.add-9566a0fc.js";import"./yup-267e586f.js";import"./index.esm-ce3c2c20.js";import"./componentStyles-0e851d91.js";import"./index-709861af.js";import"./popper-f3391c26.js";import"./OutlinedInput-86f3ec98.js";import"./useFormControl-2b068664.js";import"./InputAdornment-d0c3ebef.js";import"./index-38f860bc.js";import"./useMediaQuery-b1fbc166.js";import"./useControlled-8d737f13.js";import"./InputLabel-bb6ab40e.js";import"./TableRow-74f9cf3b.js";/* empty css                   */import"./PageBreadCrumb-02480d86.js";import"./PageMetaData-7797a3b7.js";import"./ScrollableList-fc1de312.js";import"./Loader-1b927baf.js";import"./List-863f013e.js";import"./index.esm-3043d6d4.js";import"./TextField-e155d2be.js";import"./FormControl-73683015.js";import"./Select-ef36a2b2.js";import"./Menu-337a466b.js";import"./Grow-8719411b.js";import"./createSvgIcon-e39ae511.js";import"./FilterFilled-4dfce120.js";import"./AntdIcon-8449be55.js";import"./objectSpread2-b41ee31b.js";import"./FilterOutlined-653b7cb0.js";import"./TableContainer-dd7cf0ce.js";import"./Skeleton-1012c2e6.js";import"./index-1249dfe4.js";import"./TableHead-fac214d3.js";import"./TablePagination-2c2a1682.js";import"./MenuItem-2bdddad4.js";import"./dividerClasses-02a44d89.js";import"./listItemTextClasses-cadd4b00.js";import"./KeyboardArrowRight-7e978a8a.js";import"./SelectComponent-d286bfef.js";import"./Modal-ad83750a.js";import"./DialogContent-cded694d.js";import"./DialogTitle-a145b392.js";import"./DialogContentText-43575e44.js";import"./DialogActions-7c802cc8.js";import"./LoadingButton-c8e88148.js";import"./composeClasses-b42b2e69.js";import"./SectionDivider-859b9192.js";const Vt=()=>{const{id:p,tab:G}=A(),{leadStage:{itemsList:r,loading:u,pageParams:e,itemsCount:x,modal:V,selectedData:f,isFilterOpen:q},system:{userAccessList:n}}=B(t=>b(t)),j=[{title:"S.No",width:100},{title:"Stage",width:100},{title:"Value",width:100},{title:"Actions",width:100}];function P(t,s,m,d){return{index:t,stage:s,value:m,actions:d}}const S=r==null?void 0:r.map((t,s)=>{var l,g;const m=(e.page-1)*e.page_size+(s+1),d=a.jsx(c,{sx:{display:"flex",gap:2,justifyContent:"start"},children:a.jsx(O,{style:{cursor:"pointer",color:"#fc6f03"},onClick:()=>{i(k({id:t==null?void 0:t.id})),console.log("Print L:or ",f)}})});return P(m,(l=t==null?void 0:t.stage)!=null&&l.name?(g=t==null?void 0:t.stage)==null?void 0:g.name:"",t!=null&&t.value?t==null?void 0:t.value:"",d)}),i=v(),C=t=>{i(E(t))},F=({search:t})=>{i(o({...e,search:t||"",page:1,page_size:10,lead:p}))},L=(t,s)=>{i(o({...e,search:"",page:s+1,lead:p}))},z=t=>{i(o({...e,search:"",page:1,page_size:parseInt(t.target.value),lead:p}))},_=t=>{i(M(t))};return y.useEffect(()=>{i(o({...e,page:1,page_size:10,search:"",lead:p}))},[]),a.jsx(c,{children:a.jsx(h,{container:!0,spacing:2,children:a.jsxs(h,{size:{xs:12,lg:12},children:[a.jsx(D,{sx:{px:2,pt:2},children:a.jsx(I,{permissionPreFix:"TenderManagement",permissionPostFix:"tenderitemmaster",navigateLink:"",showAddButton:(n==null?void 0:n.indexOf("LeadManagement.change_leadstage"))!==-1,addButtonName:"Add Lead Stage",handleSearch:F,showFilterButton:!1,openFilter:C,openModal:_,filteredData:T(e,["tender"])})}),a.jsx(N,{count:x,columns:j,rows:S,loading:u,page:e.page,pageSize:e.page_size,handleChangePage:L,handleChangeRowsPerPage:z,showPagination:!1}),a.jsx(R,{})]})})})};export{Vt as default};
