1"use strict";(globalThis.webpackChunkvaluation_react||=[]).push([[6115],{66115(e,l,o){o.d(l,{A:()=>ue});var i=o(9950),r=o(5726),a=o(1320),t=o(2235),n=o(15769),d=o(69780),s=o(10371),c=o(68605),u=o(34075),p=o(82917),v=o(82053),m=o(93812),x=o(59051),h=o.n(x),b=o(28429),A=o(85970),g=o(47644),f=o(94453),j=o(85815),y=o(53011),C=o(70006),_=o(23266),S=o(25333),N=o(86817),k=o(33738),w=o(10226),P=o(89382),B=o(55382),I=o(40379),z=o(60899),R=o(58567),T=o(29277),F=o(16497),D=o(41413),W=o(25979),E=o(30526),L=o(51556),O=o(97707),Y=o(37849),M=o(6030),V=o(62815);const $=(0,V.A)({activeStatusCard:{background:"rgba(19, 148, 47, 0.05)",border:"0.5px solid #13942F",color:"#13942F"},callbackContainer:{background:"rgba(10, 58, 103, 0.02)",border:"1px solid rgba(10, 58, 103, 0.60) !important",borderRadius:"10px",margin:"20px 0",padding:"24px 20px",position:"relative"},callbackDateTime:{color:"rgba(10, 58, 103, 0.60)",fontSize:"14px",fontWeight:500,marginRight:"20px !important"},callbackDateTimeContainer:{alignItems:"center",background:"#FFF",border:"1px solid rgba(10, 58, 103, 0.15)",borderRadius:"10px",display:"flex",justifyContent:"center",padding:"4px 12px"},cbStatus:{backgroundColor:"rgba(10, 58, 103, 0.05)",borderRadius:"12px",color:"#6785A6",fontSize:"14px !important",marginLeft:"1rem !important",padding:"2px 12px"},commentContainer:{borderRadius:"10px",margin:"1rem 0",padding:"1.2rem"},commentText:{color:"#0A3A67",fontFamily:"Literata !important",fontSize:"14px !important"},createdAt:{color:"#6785A1",fontSize:"14px !important",marginLeft:"1rem !important"},createdBy:{color:"#0A3A67",fontFamily:"Literata !important",fontWeight:"500"},expiredStatusCard:{background:"rgba(255, 107, 107, 0.05)",border:"0.5px solid #FF6B6B",color:"#FF6B6B"},firstRow:{display:"flex",justifyContent:"space-between",maxWidth:"90%"},outline:{background:"#FFF",border:"1px solid rgba(10, 58, 103, 0.15)",borderRadius:"10px",margin:"20px 0",padding:"24px 20px"},radioButton:{color:"rgba(10, 58, 103, 0.60)",fontSize:"14px"},radioLabel:{color:"rgba(10, 58, 103, 0.60) !important",fontSize:"16px !important",marginBottom:"-4px",marginRight:"20px"},statusCard:{borderRadius:"50px !important",fontSize:"14px",fontWeight:500,padding:"6px 30px !important",textAlign:"center"}});var q=o(44414);function H(e){let{callbacks:l,getOrder:o,setRowExpand:a}=e;const t=(0,r.wA)(),{pathname:n}=(0,b.zy)(),d=$(),{currentTablePage:s,filters:c,prospectiveBuyersDropdownValues:u}=(0,r.d4)(e=>e.magik),[p,m]=(0,i.useState)(!1),[x,A]=(0,i.useState)(l),[g,f]=(0,i.useState)(""),S=(0,Y.A)(),N=e=>{var l;const o=null===u||void 0===u||null===(l=u.callback_status)||void 0===l?void 0:l.find(l=>{var o;return l.status_name===(null===x||void 0===x||null===(o=x[e])||void 0===o?void 0:o.status)});return(null===o||void 0===o?void 0:o.status_id)||""};return(0,q.jsx)(q.Fragment,{children:null===x||void 0===x?void 0:x.map((e,l)=>{var i,r;return(0,q.jsx)(q.Fragment,{children:(0,q.jsxs)(y.A,{className:d.callbackContainer,sx:null!==e&&void 0!==e&&e.is_active?{border:"1px solid rgba(10, 58, 103, 0.60) !important"}:{border:"1px solid rgba(10, 58, 103, 0.15) !important"},children:[(null===e||void 0===e?void 0:e.is_active)&&!p&&(0,q.jsx)(w.A,{size:"small",sx:{alignItems:"center",background:"rgba(10, 58, 103, 0.02)",border:"1px solid rgba(10, 58, 103, 0.60)",borderRadius:"10px",color:"#rgba(10, 58, 103, 1)",display:"flex",height:"36px",justifyContent:"center",minWidth:"36px",position:"absolute",right:"20px"},onClick:()=>m(!0),children:(0,q.jsx)(I.A,{})}),(0,q.jsxs)(y.A,{className:d.firstRow,children:[(0,q.jsxs)(y.A,{className:d.callbackDateTimeContainer,children:[(0,q.jsx)(v.A,{variant:"span",className:d.callbackDateTime,children:"Call back date & time"}),(0,q.jsx)(v.A,{variant:"span",className:d.callbackDateTime,children:null!==e&&void 0!==e&&e.date_time_requested?h()(null===e||void 0===e?void 0:e.date_time_requested).format("DD/MM/YYYY hh:mm A"):"-"})]}),(0,q.jsx)(y.A,{className:`\n ${d.statusCard} \n ${null!==e&&void 0!==e&&e.is_active?d.activeStatusCard:d.expiredStatusCard}`,children:null!==e&&void 0!==e&&e.is_active?"Active":"Expired"})]}),(0,q.jsxs)(z.Ay,{container:!0,className:d.outline,children:[(0,q.jsx)(z.Ay,{item:!0,lg:3.5,sx:{alignItems:"center",display:"flex"},children:(0,q.jsxs)(R.A,{row:!0,defaultValue:null===e||void 0===e?void 0:e.prospect_contacted,onChange:e=>{let o=[...x],i={...o[l]};i.prospect_contacted=e.target.value,o[l]=i,A(o)},children:[(0,q.jsx)(T.A,{className:d.radioLabel,children:"Called ?"}),(0,q.jsx)(F.A,{labelPlacement:"end",value:!0,control:(0,q.jsx)(j.A,{}),disabled:!(p&&null!==e&&void 0!==e&&e.is_active),className:d.radioButton,label:"Yes"}),(0,q.jsx)(F.A,{labelPlacement:"end",value:!1,control:(0,q.jsx)(j.A,{}),disabled:!(p&&null!==e&&void 0!==e&&e.is_active),className:d.radioButton,label:"No"})]})}),(0,q.jsx)(z.Ay,{item:!0,lg:3.5,children:(0,q.jsxs)(R.A,{row:!0,defaultValue:null===e||void 0===e?void 0:e.prospect_contacted,onChange:e=>{let o=[...x],i={...o[l]};i.prospect_call_received=e.target.value,o[l]=i,A(o)},children:[(0,q.jsx)(T.A,{className:d.radioLabel,children:"Received?"}),(0,q.jsx)(F.A,{labelPlacement:"end",value:!0,control:(0,q.jsx)(j.A,{}),disabled:!(p&&null!==e&&void 0!==e&&e.is_active),className:d.radioButton,label:"Yes"}),(0,q.jsx)(F.A,{labelPlacement:"end",value:!1,control:(0,q.jsx)(j.A,{}),disabled:!(p&&null!==e&&void 0!==e&&e.is_active),className:d.radioButton,label:"No"})]})}),(0,q.jsxs)(z.Ay,{item:!0,lg:3.5,sx:{alignItems:"center",display:"flex"},children:[(0,q.jsx)(T.A,{className:d.radioLabel,children:"Status"}),(0,q.jsx)(C.A,{size:"small",name:"status",disabled:!(p&&null!==e&&void 0!==e&&e.is_active),value:e.status,onChange:e=>{let o=[...x],i={...o[l]};i.status=e.target.value,o[l]=i,A(o)},sx:{background:"#FFF",border:"1px solid rgba(10, 58, 103, 0.60)",borderRadius:"10px",outline:"none",width:"100%"},children:null===u||void 0===u||null===(i=u.callback_status)||void 0===i?void 0:i.map(e=>(0,q.jsx)(_.A,{value:null===e||void 0===e?void 0:e.status_name,children:null===e||void 0===e?void 0:e.status_name},null===e||void 0===e?void 0:e.status_id))})]})]}
1),(0,q.jsxs)(y.A,{sx:{fontSize:"14px",fontWeight:400,lineHeight:"21px",marginBottom:"24px"},children:[(0,q.jsx)(v.A,{sx:{color:"rgba(10, 58, 103, 0.6)"},children:"Remarks"}),null===(r=e.remarks_list)||void 0===r?void 0:r.map(e=>(0,q.jsxs)(y.A,{display:"flex",backgroundColor:"#f4f5f7",className:d.commentContainer,children:[(0,q.jsx)(D.A,{className:d.avatar,src:""}),(0,q.jsxs)(y.A,{sx:{ml:"20px"},children:[(0,q.jsxs)(y.A,{display:"flex",alignItems:"center",children:[(0,q.jsx)(v.A,{className:d.createdBy,children:e.created_by}),(0,q.jsx)(v.A,{className:d.createdAt,children:null!==e&&void 0!==e&&e.created_at?h()(null===e||void 0===e?void 0:e.created_at).format("DD/MM/YYYY hh:mm A"):""}),(0,q.jsx)(v.A,{className:d.cbStatus,children:e.status})]}),(0,q.jsx)(v.A,{className:d.commentText,children:(0,q.jsx)(L.A,{text:null===e||void 0===e?void 0:e.remark})})]})]},l)),p&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(W.A,{fullWidth:!0,children:(0,q.jsx)(E.A,{fullWidth:!0,value:g,placeholder:"Add remarks here and then press enter",name:"specialNote",variant:"outlined",onChange:e=>f(e.target.value),multiline:!0})}),(0,q.jsx)(M.hl,{fetchSuggestions:S,onChange:f,value:g})]})]}),p&&(0,q.jsxs)(y.A,{sx:{marginTop:"30px",textAlign:"center"},children:[(0,q.jsx)(w.A,{size:"small",sx:{border:"1px solid rgba(10, 58, 103, 0.40)",borderRadius:"8px",marginRight:"16px",padding:"8px 30px",textTransform:"capitalize"},onClick:()=>m(!1),variant:"outlined",children:"Cancel"}),(0,q.jsx)(w.A,{onClick:()=>{null!==g&&void 0!==g&&g.length&&async function(e,l){await t((0,O.ab)(e,l))}(e.call_back_id,{remarks:g,status:N(l)}),async function(e){var l,i;const r={callMade:null===x||void 0===x||null===(l=x[e])||void 0===l?void 0:l.prospect_contacted,callReceived:null===x||void 0===x?void 0:x[e].prospect_call_received,status:N(e)||""};await t((0,O.kU)(null===x||void 0===x||null===(i=x[0])||void 0===i?void 0:i.call_back_id,r))&&(null!==n&&void 0!==n&&n.startsWith("/order/transactional-details/")?await o():await o(s,10,c),a(!1),m(!1))}(l)},size:"small",sx:{background:"#0A3A67",borderRadius:"8px",color:"rgba(236, 238, 245, 1)",padding:"8px 30px",textTransform:"capitalize"},children:"Update"})]})]},l)})})})}var U=o(32268),G=o(52867),J=o(12775),Z=o(73445);const K=(0,V.A)({callbackDetailsText:{color:"#0A3A67",fontSize:"16px",fontWeight:500},collapse:{border:"none !important",padding:"30px 0"},convertToClientButton:{backgroundColor:Z.COLORS.PRIMARY,borderRadius:"10px !important",marginLeft:"12px !important",padding:"8px 16px !important",textTransform:"capitalize !important"},expandIcon:{border:"1px solid rgba(10, 58, 103, 0.15) !important",borderRadius:"10px !important",height:"36px !important",width:"36px !important"},flexBetween:{display:"flex",justifyContent:"space-between"},notificationDot:{background:"#EF5F5F",borderRadius:"50%",height:"12px",left:"-8px",position:"absolute",width:"12px"},scheduleCallBackButton:{backgroundColor:Z.COLORS.PRIMARY,border:"1px solid rgba(10, 58, 103, 0.60) !important",borderRadius:"10px !important",padding:"6px 10px !important",textTransform:"capitalize !important"},sourceImageContainer:{alignItems:"center",border:"1px solid rgba(10, 58, 103, 0.15)",borderRadius:"50%",display:"flex",height:"36px",justifyContent:"center",position:"relative",width:"36px"},tableCell:{border:"none !important",color:"#0A3A67 !important",fontSize:"14px !important",fontWeight:"500 !important",outline:"none !important",textTransform:"capitalize"}});var Q=o(96319),X=o(53777),ee=o(96583),le=o(40033),oe=o(74745),ie=o(28170),re=o(79739),ae=o(80112);const te=e=>{var l;let{open:o,onClose:a,buyer:t,detailsId:n,orderSubStatusId:d,transOrderId:s,clientId:c,getOrder:u=()=>{},pastBuyer:p,finalizedBuyer:m,addBuyer:x}=e;const b=(0,r.wA)(),[A,g]=(0,i.useState)(""),[f,j]=(0,i.useState)(!1),C=((0,r.d4)(e=>{var l;return null===(l=e.magik)||void 0===l?void 0:l.prospectiveBuyersDropdownValues}),async()=>{if(null!==m){let e={finalized_buyer:{email:"-"===(null===m||void 0===m?void 0:m.prospectEmail)?"":null===m||void 0===m?void 0:m.prospectEmail,full_name:"-"===(null===m||void 0===m?void 0:m.name)?"":null===m||void 0===m?void 0:m.name,mobile:"-"===(null===m||void 0===m?void 0:m.prospectPhoneNumber)?"":null===m||void 0===m?void 0:m.prospectPhoneNumber},is_buyer_removed:!1,order_sub_status:d};await b((0,ae.mr)(c,s,e))&&(g(""),j(!1),a())}});return(0,q.jsxs)(ee.A,{fullWidth:!0,open:o,onClose:a,sx:{borderRadius:"20px !important"},children:[(0,q.jsxs)(le.A,{children:[(0,q.jsx)(v.A,{sx:{color:"#0A3A67",fontSize:"18px",fontWeight:"600"},children:"Remove Prospective Buyer"}),(0,q.jsx)(S.A,{onClick:()=>{a(),j(!1),g("")},sx:{position:"absolute",right:8,top:8},children:(0,q.jsx)(Q.A,{})})]}
1),(0,q.jsx)(oe.A,{sx:{color:"#9C9CA8"}}),(0,q.jsxs)(ie.A,{children:[(0,q.jsxs)(y.A,{display:"flex",sx:{justifyContent:"space-between",marginBottom:"1.5rem"},children:[(0,q.jsxs)(y.A,{children:[(0,q.jsx)(v.A,{sx:{color:"#6C89A4"},children:"Name"}),(0,q.jsx)(v.A,{sx:{color:"#0A3A67"},children:(null===t||void 0===t?void 0:t.full_name)||(null===t||void 0===t?void 0:t.name)})]}),(0,q.jsxs)(y.A,{children:[(0,q.jsx)(v.A,{sx:{color:"#6C89A4"},children:"Contact"}),(0,q.jsx)(v.A,{sx:{color:"#0A3A67"},children:(null===t||void 0===t?void 0:t.mobile)||(null===t||void 0===t?void 0:t.prospectPhoneNumber)})]}),(0,q.jsxs)(y.A,{children:[(0,q.jsx)(v.A,{sx:{color:"#6C89A4"},children:"Email"}),(0,q.jsx)(v.A,{sx:{color:"#0A3A67"},children:(null===t||void 0===t?void 0:t.email)||(null===t||void 0===t?void 0:t.prospectEmail)})]})]}),(0,q.jsx)(oe.A,{sx:{color:"#0A3A671A"}}),!p&&(0,q.jsxs)(z.Ay,{container:!0,sx:{margin:"1.5rem 0"},children:[(0,q.jsxs)(z.Ay,{item:!0,xs:7.5,children:[(0,q.jsx)(v.A,{sx:{color:"#505050",fontSize:"15px"},children:"Are you sure, you want to Remove the Buyer ?"}),(0,q.jsxs)(y.A,{sx:{alignItems:"center",display:"flex",gap:2,mt:"1rem"},children:[(0,q.jsx)(w.A,{variant:"contained",onClick:()=>j(!0),sx:{background:"#0A3A67",color:"white",fontSize:"14px",textTransform:"capitalize",width:"90px"},children:"Yes"}),(0,q.jsx)(w.A,{onClick:()=>{j(!1),g(""),a()},variant:"outlined",sx:{border:"1px solid #0A3A67",color:"#0A3A67",fontSize:"14px",textTransform:"capitalize",width:"90px"},children:"No"})]})]}),(0,q.jsx)(oe.A,{orientation:"vertical",flexItem:!0,sx:{mr:"1rem"}}),(0,q.jsxs)(z.Ay,{item:!0,xs:3,sx:{alignItems:"center",display:"flex",gap:1.5},children:[(0,q.jsx)(X.A,{fontSize:"small",sx:{color:"gray"}}),(0,q.jsx)(v.A,{sx:{color:"#0A3A6799",fontSize:"12px",fontStyle:"italic"},children:"Once Removed you may not be able to add this Buyer as a Prospective Buyer Again"})]})]}),f&&(0,q.jsx)(oe.A,{}),f&&!p&&(0,q.jsxs)(W.A,{fullWidth:!0,sx:{marginTop:"1.5rem"},children:[(0,q.jsxs)(T.A,{children:["Reason For Dropping Out ",(0,q.jsx)("span",{style:{color:"crimson"},children:"*"})]}),(0,q.jsx)(E.A,{fullWidth:!0,placeholder:"Enter the reason for cancellation here",required:!0,multiline:!0,value:A,onChange:e=>g(e.target.value)})]}),p&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(y.A,{sx:{margin:"1.5rem 0"},children:[(0,q.jsx)(v.A,{sx:{color:"#6C89A4"},children:"Reason For Dropping Out"}),(0,q.jsx)(v.A,{sx:{color:"#0A3A67"},children:null===p||void 0===p?void 0:p.buyer_removal_reason})]}),(0,q.jsx)(oe.A,{}),(0,q.jsx)(y.A,{sx:{margin:"1.5rem 0"},children:(0,q.jsxs)(v.A,{sx:{color:"#0A3A67"},children:["Buyer removed at"," ",null!==p&&void 0!==p&&p.buyer_removed_at?null===(l=h()(null===p||void 0===p?void 0:p.buyer_removed_at))||void 0===l?void 0:l.format("DD/MM/YYYY hh:mm A"):"-"," ","| ",(0,q.jsxs)("span",{style:{color:"crimson"},children:["Removed by ",null===p||void 0===p?void 0:p.buyer_removed_by]})]})})]})]}),f&&!p&&(0,q.jsx)(re.A,{sx:{justifyContent:"center"},children:(0,q.jsxs)(y.A,{sx:{display:"flex",gap:1,mb:"1rem"},children:[(0,q.jsx)(w.A,{variant:"outlined",sx:{border:"1px solid #0A3A67",color:"#0A3A67",fontSize:"14px",padding:"6px 2rem",textTransform:"capitalize"},onClick:()=>{j(!1),g(""),a()},children:"Cancel"}),(0,q.jsx)(w.A,{variant:"contained",sx:{background:"#0A3A67",color:"white",fontSize:"14px",padding:"6px 1rem",textTransform:"capitalize"},onClick:async()=>{const e={buyer_removal_reason:A,details_id:n,finalized_buyer:{email:"-"===(null===t||void 0===t?void 0:t.email)?"":null===t||void 0===t?void 0:t.email,full_name:"-"===(null===t||void 0===t?void 0:t.full_name)?"":null===t||void 0===t?void 0:t.full_name,mobile:"-"!==(null===t||void 0===t?void 0:t.mobile)&&null!==t&&void 0!==t&&t.mobile?Number(String(t.mobile).replace("+ 91 ","")):""},is_buyer_removed:!0,order_sub_status:d};await b((0,ae.PS)(c,s,e))&&(null!==m&&(null===m||void 0===m?void 0:m.prospectPhoneNumber)!==(null===t||void 0===t?void 0:t.mobile)?await C():(g(""),j(!1),a()))},disabled:""===A.trim(),children:"Remove Buyer"})]})})]})},ne=(e,l)=>{if(!e||!l)return!1;if(e===l)return!0;
1if(e===+l.toString().replace("+ 91 ",""))return!0;if(e.toString().replace(/\s/g,"")===l.toString().replace(/\s/g,""))return!0;const o=e=>e.toString().replace(/\D/g,""),i=o(e).slice(-10),r=o(l).slice(-10);return 10===i.length&&i===r};function de(e){var l,o,a,t,n,d,u,p,m,x;let{row:h=[],getOrder:I=()=>{},enableSelection:z=!1,finalizedBuyer:R={},setFinalizedBuyer:T=()=>{},enableDetailsView:F=!0,detailsId:D,orderSubStatusId:W,clientId:E,transOrderId:L,title:Y,pastBuyers:M,orderDetails:V,finalizedBuyerDetails:$,transType:Z}=e;const Q=(0,r.wA)(),X=(0,b.Zp)(),{pathname:ee}=(0,b.zy)(),le=new URLSearchParams(location.search),oe="buyer"===le.get("add"),ie=le.get("orderid"),{prospectId:re}=(0,b.g)(),ae=K(),de=(0,r.d4)(e=>{var l;return null===(l=e.notification)||void 0===l?void 0:l.notifications}),{currentTablePage:se,filters:ce}=(0,r.d4)(e=>e.magik),[ue,pe]=(0,i.useState)(!1),[ve,me]=(0,i.useState)(!1),xe=(0,r.d4)(e=>{var l;return null===(l=e.magik)||void 0===l?void 0:l.prospectiveBuyersDropdownValues}),[he,be]=(0,i.useState)(null),Ae=Boolean(he),[ge,fe]=(0,i.useState)(!1),je=()=>{be(null)};function ye(e,l){l&&ee.includes("/prospective-buyers")&&X("PrimarySales"===e?`/primary-sales/transactional-order/${l}`:`/order/transactional-details/${l}`)}(0,i.useEffect)(()=>{ue&&async function(){var e,l,o,i;null===de||void 0===de||null===(e=de[0])||void 0===e||null===(l=e.prospects)||void 0===l||null===(o=l[0])||void 0===o||null===(i=o.details)||void 0===i||i.forEach(async e=>{(null===e||void 0===e?void 0:e.prospect_reference_no)===(null===h||void 0===h?void 0:h.referenceNo)&&(await async function(e){await Q((0,U.B2)(e))}(null===e||void 0===e?void 0:e.notification_id),await Q((0,U.R$)()))})}()},[ue]),(0,i.useEffect)(()=>{re===(null===h||void 0===h?void 0:h.prospectId)&&pe(!0)},[]);const Ce=async function(){var e,l,o,i;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=null;const t=(null===r||void 0===r||null===(e=r.mobile)||void 0===e?void 0:e.replace("+ 91 ",""))||(null===r||void 0===r||null===(l=r.prospectPhoneNumber)||void 0===l?void 0:l.replace("+ 91 ","")),n=null===xe||void 0===xe||null===(o=xe.source)||void 0===o||null===(i=o.find(e=>(null===e||void 0===e?void 0:e.source_name)===(null===r||void 0===r?void 0:r.source)||(null===r||void 0===r?void 0:r.prospectFrom)))||void 0===i?void 0:i.source_id,d={country_code:"91",email:r.email||(null===r||void 0===r?void 0:r.prospectEmail),full_name:r.fullName||(null===r||void 0===r?void 0:r.name),mobile:t,order_id:ie,source:n};a=await Q((0,O.Vt)(d)),!a||ee.startsWith("/order/transactional-details")||ee.startsWith("/primary-sales/transactional-order")||(ee.startsWith("/primary-sales/")?X(`/primary-sales/transactional-order/${ie}`):X(`/order/transactional-details/${ie}`))};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(s.A,{onClick:oe?()=>Ce({email:h.prospectEmail,fullName:h.name,id:h.prospectId,mobile:h.prospectPhoneNumber,source:h.prospectFrom}):()=>{"Past Buyers/ Seller"===Y&&fe(!0)},sx:{"&: hover":{background:null!==h&&void 0!==h&&h.orderId?"rgba(109, 177, 224, 0.06)":""},borderRadius:"10px",cursor:null!==h&&void 0!==h&&h.orderId?"pointer":"",outline:"1px solid rgba(15, 62, 106, 0.15)"},children:[z&&(0,q.jsx)(c.A,{className:ae.tableCell,onClick:()=>{var e;return!oe&&ye(null!==h&&void 0!==h&&null!==(e=h.orderNo)&&void 0!==e&&e.startsWith("PST")?"PrimarySales":"",null===h||void 0===h?void 0:h.orderId)},sx:{border:"none !important"},children:(0,q.jsx)(j.A,{checked:ne(null===R||void 0===R?void 0:R.mobile,null===h||void 0===h?void 0:h.prospectPhoneNumber)||ne(null===$||void 0===$?void 0:$.mobile,null===h||void 0===h?void 0:h.prospectPhoneNumber),onChange:()=>{T({email:h.prospectEmail,fullName:h.name,id:null===h||void 0===h?void 0:h.prospectId,mobile:h.prospectPhoneNumber}),D&&fe(!0)}})}),(0,q.jsx)(c.A,{className:ae.tableCell,onClick:()=>{var e;return!oe&&ye(null!==h&&void 0!==h&&null!==(e=h.orderNo)&&void 0!==e&&e.startsWith("PST")?"PrimarySales":"",null===h||void 0===h?void 0:h.orderId)},sx:{border:"none !important"},children:(0,q.jsxs)(y.A,{className:ae.sourceImageContainer,children:[function(){var e,l,o,i;return null===de||void 0===de||null===(e=de[0])||void 0===e||null===(l=e.prospects)||void 0===l||null===(o=l[0])||void 0===o||null===(i=o.details)||void 0===i?void 0:i.find(e=>(null===e||void 0===e?void 0:e.prospect_reference_no)===(null===h||void 0===h?void 0:h.referenceNo))}
1()&&(0,q.jsx)(y.A,{className:ae.notificationDot}),(0,q.jsx)("img",{src:h.source,alt:"source",width:"24px"})]})}),(0,q.jsx)(c.A,{className:ae.tableCell,sx:{width:"10%"},onClick:()=>{var e;return!oe&&ye(null!==h&&void 0!==h&&null!==(e=h.orderNo)&&void 0!==e&&e.startsWith("PST")?"PrimarySales":"",null===h||void 0===h?void 0:h.orderId)},children:h.addedDate}),(0,q.jsx)(c.A,{className:ae.tableCell,onClick:()=>{var e;return!oe&&ye(null!==h&&void 0!==h&&null!==(e=h.orderNo)&&void 0!==e&&e.startsWith("PST")?"PrimarySales":"",null===h||void 0===h?void 0:h.orderId)},children:h.name}),(0,q.jsx)(c.A,{className:ae.tableCell,onClick:()=>{var e;return!oe&&ye(null!==h&&void 0!==h&&null!==(e=h.orderNo)&&void 0!==e&&e.startsWith("PST")?"PrimarySales":"",null===h||void 0===h?void 0:h.orderId)},children:h.prospectPhoneNumber}),(0,q.jsx)(c.A,{className:ae.tableCell,sx:{width:"12%"},onClick:()=>{var e;return!oe&&ye(null!==h&&void 0!==h&&null!==(e=h.orderNo)&&void 0!==e&&e.startsWith("PST")?"PrimarySales":"",null===h||void 0===h?void 0:h.orderId)},children:h.trm}),(0,q.jsx)(c.A,{className:ae.tableCell,sx:{maxWidth:"12%"},onClick:()=>{var e;return!oe&&ye(null!==h&&void 0!==h&&null!==(e=h.orderNo)&&void 0!==e&&e.startsWith("PST")?"PrimarySales":"",null===h||void 0===h?void 0:h.orderId)},children:(0,q.jsx)(P.A,{text:h.propertyName,maxLength:20,forceTruncate:!0})}),(0,q.jsx)(c.A,{className:ae.tableCell,sx:{maxWidth:"12%"},onClick:()=>{var e;return!oe&&ye(null!==h&&void 0!==h&&null!==(e=h.orderNo)&&void 0!==e&&e.startsWith("PST")?"PrimarySales":"",null===h||void 0===h?void 0:h.orderId)},children:(0,G.GM)(h.propertyValue)}),(0,q.jsx)(c.A,{className:ae.tableCell,sx:{maxWidth:"100px"},children:(0,q.jsx)(C.A,{disabled:"Past Buyers/ Seller"===Y,variant:"standard",value:null===(l=h.temperature)||void 0===l?void 0:l.toLowerCase(),sx:{"&::before":{borderBottom:"none !important"},backgroundColor:"#fff !important",border:"none !important",color:"hot"===(null===h||void 0===h||null===(o=h.temperature)||void 0===o?void 0:o.toLowerCase())?"#FF6B6B !important":"cold"===(null===(a=h.temperature)||void 0===a?void 0:a.toLowerCase())?"rgba(34, 121, 203, 1)":"#DB7E48 !important",fontSize:"14px",maxHeight:"32px",outline:"none !important",width:"100%"},children:null===xe||void 0===xe||null===(t=xe.temperature)||void 0===t?void 0:t.map(e=>{var l,o,i,r,a,t;return(0,q.jsx)(_.A,{sx:{backgroundColor:"#fff !important",height:"40px !important"},value:null===e||void 0===e||null===(l=e.status_name)||void 0===l?void 0:l.toLowerCase(),onClick:()=>async function(e,l){await Q((0,O.qf)(e,{temperature:l})),null!==ee&&void 0!==ee&&ee.startsWith("/order/transactional-details/")?await I():await I(se,10,ce)}(null===h||void 0===h?void 0:h.prospectId,null===e||void 0===e?void 0:e.status_id),children:(0,q.jsxs)(y.A,{sx:{alignItems:"center",display:"flex",justifyContent:"center"},children:[null===e||void 0===e?void 0:e.status_name,h.temperature&&(0,q.jsx)("img",{src:"hot"===(null===e||void 0===e||null===(o=e.status_name)||void 0===o?void 0:o.toLowerCase())?null===J.A||void 0===J.A||null===(i=J.A.prospectiveBuyersTemperature)||void 0===i?void 0:i.hot:"cold"===(null===e||void 0===e||null===(r=e.status_name)||void 0===r?void 0:r.toLowerCase())?null===J.A||void 0===J.A||null===(a=J.A.prospectiveBuyersTemperature)||void 0===a?void 0:a.cold:null===J.A||void 0===J.A||null===(t=J.A.prospectiveBuyersTemperature)||void 0===t?void 0:t.warm})]})},null===e||void 0===e?void 0:e.status_id)})})}),(0,q.jsx)(c.A,{className:ae.tableCell,onClick:()=>{var e;return!oe&&ye(null!==h&&void 0!==h&&null!==(e=h.orderNo)&&void 0!==e&&e.startsWith("PST")?"PrimarySales":"",null===h||void 0===h?void 0:h.orderId)},children:h.status}),"primary-sales"!==Z&&ne(null===V||void 0===V||null===(n=V.status_history)||void 0===n||null===(d=n[0])||void 0===d||null===(u=d["Buyer site visit"])||void 0===u||null===(p=u["Prospective buyers/seller hunt"])||void 0===p||null===(m=p.finalized_buyer_details)||void 0===m?void 0:m.mobile,null===h||void 0===h?void 0:h.prospectPhoneNumber)&&(0,q.jsxs)(c.A,{children:[(0,q.jsx)(S.A,{onClick:e=>{be(e.currentTarget)},"aria-controls":Ae?"menu":void 0,"aria-haspopup":"true","aria-expanded":Ae?"true":void 0,children:(0,q.jsx)(f.A,{})}
1),(0,q.jsx)(N.A,{id:"menu",anchorEl:he,open:Ae,onClose:je,MenuListProps:{"aria-labelledby":"basic-button"},children:(0,q.jsx)(_.A,{onClick:()=>fe(!0),sx:{color:"crimson"},children:"Remove Buyer/Seller"})})]}),F&&(0,q.jsx)(c.A,{className:ae.tableCell,sz:{zIndex:"100"},children:(0,q.jsx)(S.A,{className:ae.expandIcon,"aria-label":"expand row",size:"small",onClick:()=>pe(!ue),children:ue?(0,q.jsx)(g.A,{}):(0,q.jsx)(A.A,{})})})]}),(0,q.jsx)(s.A,{children:(0,q.jsx)(c.A,{style:{border:"none",paddingBottom:0,paddingTop:0},colSpan:10,children:(0,q.jsxs)(k.A,{in:ue,timeout:"auto",unmountOnExit:!0,className:ae.collapse,children:[(0,q.jsxs)(y.A,{className:ae.flexBetween,children:[(0,q.jsx)(v.A,{className:ae.callbackDetailsText,children:"Callback Details"}),(0,q.jsxs)(y.A,{children:[!(null!==h&&void 0!==h&&null!==(x=h.callbacks)&&void 0!==x&&x.length)&&(0,q.jsx)(w.A,{variant:"outlined",className:ae.scheduleCallBackButton,onClick:()=>me(!0),children:"Schedule a Call back"}),(0,q.jsx)(w.A,{variant:"contained",className:ae.convertToClientButton,onClick:()=>(()=>{const e=new URLSearchParams({contact:h.prospectPhoneNumber,countryCode:h.countryCode||"91",email:h.prospectEmail,name:h.name});X(`/add-client?${e.toString()}`)})(),children:"Convert to Client"})]})]}),(0,q.jsx)(H,{callbacks:null===h||void 0===h?void 0:h.callbacks,getOrder:I,setRowExpand:pe})]})})}),(0,q.jsx)(B.A,{open:ve,setClose:me,prospect:h,setRowExpand:pe,getOrder:I}),(0,q.jsx)(te,{open:ge,onClose:async()=>{fe(!1),T({}),je(),await I()},buyer:z?$:h,detailsId:D,orderSubStatusId:W,clientId:E,transOrderId:L,pastBuyer:null===M||void 0===M?void 0:M.find(e=>(null===e||void 0===e?void 0:e.email)===(null===h||void 0===h?void 0:h.prospectEmail)||ne(null===e||void 0===e?void 0:e.mobile,null===h||void 0===h?void 0:h.prospectPhoneNumber)),finalizedBuyer:ne(null===R||void 0===R?void 0:R.mobile,null===h||void 0===h?void 0:h.prospectPhoneNumber)?h:null,addBuyer:Ce})]})}const se=(0,i.memo)(de);function ce(e){let{prospects:l=[],isLoading:o,getOrder:x=()=>{},showPagination:b=!1,prospectsCount:A=0,activePageForProspectsListing:g=0,setActivePageForProspectsListing:f=()=>{},enableSelection:j=!1,finalizedBuyer:y={},setFinalizedBuyer:C=()=>{},enableDetailsView:_=!0,setProspects:S=()=>{},detailsId:N,orderSubStatusId:k,clientId:w,transOrderId:P,pastBuyers:B=[],title:I,orderDetails:z,filters:R={},transType:T}=e;const F=(0,r.wA)(),[D,W]=(0,i.useState)([]),E=(0,i.useRef)(null),L=null!==o&&void 0!==o?o:null==l,Y=i.useMemo(()=>(null===l||void 0===l?void 0:l.map(e=>{var l,o,i,r,a,t,n,d,s,c,u,p,v,m,x,b,A,g,f;return i=(null===e||void 0===e?void 0:e.prospect_id)||"-",r=(null===e||void 0===e?void 0:e.source_image_url)||"",a=(null===e||void 0===e?void 0:e.prospect_reference_no)||"-",t=(null===e||void 0===e?void 0:e.call_backs)||"-",n=(null===e||void 0===e?void 0:e.prospect_added_on)||"-",d=(null===e||void 0===e?void 0:e.prospect_name)||"-",s=`+ ${null===e||void 0===e?void 0:e.country_code} ${null===e||void 0===e?void 0:e.prospect_phone}`||"-",c=(null===e||void 0===e?void 0:e.order_assigned_to)||"-",u=(null===e||void 0===e?void 0:e.property_name)||"-",p=(null===e||void 0===e?void 0:e.ia_valuation)||"-",v=(null===e||void 0===e?void 0:e.temperature)||"-",m=(null===e||void 0===e||null===(l=e.call_backs)||void 0===l||null===(o=l[0])||void 0===o?void 0:o.status)||"New",x=(null===e||void 0===e?void 0:e.transaction_order_id)||"-",b=(null===e||void 0===e?void 0:e.order_no)||"-",A=(null===e||void 0===e?void 0:e.prospect_email)||"-",g=(null===e||void 0===e?void 0:e.source_image_url)||"-",f=null===e||void 0===e?void 0:e.prospect_from,{addedDate:n?h()(n).format("DD/MM/YYYY"):"-",callbacks:t,name:d,orderId:x,orderNo:b,propertyName:u,propertyValue:p,prospectEmail:A,prospectFrom:f,prospectId:i,prospectPhoneNumber:s,referenceNo:a,source:r,sourceImage:g,status:m,temperature:v,trm:c}}))||[],[l]);return(0,i.useEffect)(()=>{let e=[{id:"source",name:"Source"},{id:"addedDate",name:"Added Date"},{id:"name",name:"Name"},{id:"contact",name:"Contact"},{id:"trm",name:"TRM"},{id:"propertyName",name:"Property Name"},{id:"propertyValue",name:"Property Value"},{id:"temperature",name:"Temperature"},{id:"status",name:"Status"},{id:"action",name:""}];j&&e.unshift({id:"select",name:"Select"}),W(e)},[]),(0,i.useEffect)(()=>{const e=JSON.stringify(R),l=E.current;null!==l&&l!==e&&(console.log("\ud83d\udd04 Filters changed, resetting page to 0"),F(O.d$.setCurrentTablePage(0)),f(0)),E.current=e},[R,F,f]),(0,q.jsx)(a.A,{component:t.A,sx:{boxShadow:"none",minHeight:"100% !important"},children:(0,q.jsxs)(n.A,{sx:{borderCollapse:"separate",borderSpacing:"0 5px",padding:"0 4px"},children:[(0,q.jsx)(d.A,{sx:{background:"aliceblue"},children:(0,q.jsx)(s.A,{sx:{borderRadius:"10px",outline:"1px solid rgba(15, 62, 106, 0.15)"},children:null===D||void 0===D?void 0:D.map((e,l)=>(0,q.jsx)(c.A,{sx:{border:"none",color:"#0A3A67",fontSize:"14px",fontWeight:"400"},children:null===e||void 0===e?void 0:e.name},l))})}),(0,q.jsx)(u.A,{children:L?Array.from({length:5}).map((e,l)=>(0,q.jsx)(s.A,{children:(0,q.jsx)(c.A,{colSpan:D.length||10,sx:{border:"none",py:1},children:(0,q.jsx)(p.A,{variant:"rounded",height:56,sx:{borderRadius:"10px"}})})},`loading-${l}`)):(null===Y||void 0===Y?void 0:Y.length)>0?null===Y||void 0===Y?void 0:Y.map(e=>{var l,o,i,r;return(0,q.jsx)(se,{row:e,tableHeadCells:D,getOrder:x,enableSelection:j,finalizedBuyer:y,setFinalizedBuyer:C,enableDetailsView:_,detailsId:N,orderSubStatusId:k,clientId:w,transOrderId:P,title:I,pastBuyers:B,orderDetails:z,finalizedBuyerDetails:null===z||void 0===z||null===(l=z.status_history)||void 0===l||null===(o=l[0])||void 0===o||null===(i=o["Buyer site visit"])||void 0===i||null===(r=i["Prospective buyers/seller hunt"])||void 0===r?void 0:r.finalized_buyer_details,transType:T},e.prospectId)}):(0,q.jsx)(c.A,{colSpan:10,children:(0,q.jsx)(v.A,{sx:{padding:"24px",textAlign:"center"},children:"No data"})})}),b&&(0,q.jsx)(m.A,{sx:{backgroundColor:"#E8F1FA",border:"1px solid rgba(15, 62, 106, 0.15)",borderRadius:"10px",color:"rgba(10, 58, 103, 0.60)",marginTop:"40px"},count:A,page:g,rowsPerPage:10,rowsPerPageOptions:[],onPageChange:(e,l)=>{F(O.d$.setCurrentTablePage(l)),S([]),f(l)}})]})})}const ue=(0,i.memo)(ce)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.