"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2775],{25269:(e,t,n)=>{n.d(t,{A:()=>c}),n(14232);var a=n(1992),i=n(60398),l=n(77165),r=n(64907);let o=async()=>{let{data:e}=await i.A.get(r.FW);return e};function c(){return(0,a.useQuery)("offline-payments",o,{enabled:!1,onError:l.Jm})}},26091:(e,t,n)=>{n.d(t,{X:()=>l});var a=n(60398),i=n(35502);let l={placeOrder:e=>a.A.post("/api/v1/customer/order/place",e),prescriptionPlaceOrder:e=>{let{store_id:t,distance:n,address:l,longitude:r,latitude:o,prescriptionImages:c,order_note:d,guest_id:p,contact_person_name:s,contact_person_number:x,dm_tips:u,order_type:m,payment_method:g}=e,h=new FormData;return h.append("store_id",t),h.append("distance",n),h.append("address",l),h.append("longitude",r),h.append("latitude",o),c.forEach(e=>{h.append("order_attachment[]",e)}),h.append("order_note",d),h.append("guest_id",p),(0,i.g)()||(h.append("contact_person_number",x),h.append("contact_person_name",s)),h.append("dm_tips",u),h.append("order_type",m),h.append("payment_method",g),a.A.post("/api/v1/customer/order/prescription/place",h)},orderHistory:(e,t,n)=>a.A.get("/api/v1/customer/order/".concat(e,"?limit=").concat(t,"&offset=").concat(n)),orderDetails:e=>a.A.get("/api/v1/customer/order/details?order_id=".concat(e)),orderTracking:e=>a.A.get("/api/v1/customer/order/track?order_id=".concat(e)),CancelOrder:e=>a.A.post("/api/v1/customer/order/cancel",e),FailedPaymentMethodUpdate:e=>a.A.post("/api/v1/customer/order/payment-method",e),FailedPaymentMethodCancel:e=>a.A.post("/api/v1/customer/order/cancel",e)}},29978:(e,t,n)=>{n.d(t,{k:()=>i});var a=n(60398);let i={placeApiAutocomplete:e=>{if(e&&""!==e)return a.A.get("/api/v1/config/place-api-autocomplete?search_text=".concat(e))},placeApiDetails:e=>a.A.get("/api/v1/config/place-api-details?placeid=".concat(e)),getZoneId:e=>a.A.get("/api/v1/config/get-zone-id?lat=".concat(e.lat,"&lng=").concat(e.lng)),distanceApi:(e,t)=>{if(!e||!t)throw Error("Origin and destination must be provided");return a.A.get("/api/v1/config/distance-api?origin_lat=".concat(e.latitude,"&origin_lng=").concat(e.longitude,"&destination_lat=").concat(t.lat?t.lat:null==t?void 0:t.latitude,"&destination_lng=").concat(t.lng?t.lng:null==t?void 0:t.longitude,"&mode=WALK"))},geoCodeApi:e=>a.A.get("/api/v1/config/geocode-api?lat=".concat(e.lat,"&lng=").concat(e.lng))}},36675:(e,t,n)=>{n.d(t,{A:()=>S});var a=n(37876),i=n(14232),l=n(28343),r=n(85779),o=n(3801),c=n(35268),d=n(84812),p=n(66703),s=n(60795),x=n(35003),u=n(38388),m=n(41316),g=n(24779),h=n(18952),y=n(76572),f=n(7227),j=n(74441),v=n(52904),A=n(35502),_=n(97914),w=n(89099),b=n(74695),C=n(62320);n(90233);var P=n(1383),k=n(75325);n(42410);let B={src:"/_next/static/media/cod2.312876f9.svg"},D={src:"/_next/static/media/wallet.9d5aa44a.svg"};var M=n(24880);let O=(0,c.Ay)(d.A)(e=>{let{theme:t,value:n,paymentMethod:a}=e;return{padding:"15px 15px",border:"1px solid #E4F4FF",filter:"drop-shadow(-1px 1px 0px ".concat((0,j.X4)(t.palette.info.light,.2),")"),gap:"5px",color:(null==n?void 0:n.id)===(null==a?void 0:a.id)?t.palette.whiteContainer.main:t.palette.neutral[1e3],background:(null==n?void 0:n.id)===(null==a?void 0:a.id)?t.palette.primary.main:t.palette.neutral[100],"&:hover":{color:t.palette.whiteContainer.main,background:t.palette.primary.main}}}),I=e=>{var t,n,c,I,z,S,W,F;let{paymentMethod:X,setPaymentMethod:R,paidBy:T,orderPlace:E,isLoading:G,zoneData:N,forprescription:U,configData:Z,orderType:H,parcel:J,offlinePaymentOptions:L,setPaymentMethodImage:V,getParcelPayment:K,setOpen:Q,setSelectedPaymentMethod:q}=e,Y=(0,A.g)();(0,w.useRouter)();let $=(0,p.A)(),ee=(0,i.useRef)(null),et=(0,b.wA)(),{offlineMethod:en,offlineInfoStep:ea}=(0,b.d4)(e=>e.offlinePayment),[ei,el]=(0,i.useState)(""!==en),[er,eo]=(0,i.useState)(!1),ec=()=>{eo(!er),ee.current.scrollIntoView({behavior:"smooth",block:"end"})};return(0,a.jsxs)(l.jB,{justifyContent:"space-between",spacing:1,children:[(0,a.jsxs)(s.A,{pb:2,children:[(0,a.jsx)(P.Zs,{children:(0,_.t)("Payment Method")}),(0,a.jsx)(x.A,{color:$.palette.neutral[400],children:(0,_.t)("Select a Payment Method to Proceed")})]}),(0,a.jsx)(u.A,{children:(0,a.jsxs)(l.jB,{ref:ee,direction:"true"===J?"column":"row",sx:{flexWrap:"wrap",paddingBottom:"10px",gap:{xs:"true"===J?"16px":"0px",sm:"true"===J?"16px":"0px",md:"16px"}},children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(m.Ay,{container:!0,spacing:2,children:[(null==Z?void 0:Z.customer_wallet_status)===1&&Y&&"receiver"!==T&&"true"!==U&&(0,a.jsx)(m.Ay,{item:!0,spacing:3,xs:12,sm:(null==(t=K()[0])?void 0:t.cash_on_delivery)?6:12,children:(0,a.jsxs)(l.jB,{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"10px 9px",gap:"10px",sx:{backgroundColor:"wallet"===X&&(0,j.X4)($.palette.primary.main,.1),border:"wallet"===X?"1px solid ".concat((0,j.X4)($.palette.secondary.light,.3)):"1px solid ".concat((0,j.X4)($.palette.neutral[400],.3)),borderRadius:"10px",cursor:"pointer"},onClick:()=>R("wallet"),children:[(0,a.jsxs)(s.A,{flexDirection:"row",alignItems:"center",gap:"10px",children:[(0,a.jsx)(s.A,{width:"32px",height:"32px",justifyContent:"center",alignItems:"center",backgroundColor:$.palette.customColor.parcelWallet,borderRadius:"50%",children:(0,a.jsx)(v.A,{width:"20px",height:"20px",objectfit:"contain",src:D.src})}),(0,a.jsx)(x.A,{color:"neutral[400]",children:(0,_.t)("Pay via Wallet")})]}),"wallet"===X?(0,a.jsx)(d.A,{variant:"outlined",size:"small",children:(0,_.t)("Applied")}):(0,a.jsx)(d.A,{variant:"outlined",size:"small",children:(0,_.t)("Apply")})]})}),(null==Z?void 0:Z.cash_on_delivery)&&(null==(n=K()[0])?void 0:n.cash_on_delivery)&&(0,a.jsx)(m.Ay,{item:!0,spacing:3,xs:12,sm:6,children:(0,a.jsxs)(l.jB,{flexDirection:"row",alignItems:"center",padding:"14px 9px",justifyContent:"space-between",gap:"10px",sx:{backgroundColor:"cash_on_delivery"===X&&(0,j.X4)($.palette.primary.main,.1),border:"cash_on_delivery"===X?"1px solid ".concat((0,j.X4)($.palette.secondary.light,.3)):"1px solid ".concat((0,j.X4)($.palette.neutral[400],.3)),borderRadius:"10px",cursor:"pointer"},onClick:()=>R("cash_on_delivery"),children:[(0,a.jsxs)(s.A,{flexDirection:"row",alignItems:"center",gap:"10px",children:[(0,a.jsx)(s.A,{width:"32px",height:"32px",justifyContent:"center",alignItems:"center",backgroundColor:$.palette.primary.main,borderRadius:"50%",children:(0,a.jsx)(v.A,{width:"22px",height:"22px",objectfit:"contain",src:B.src})}),(0,a.jsx)(x.A,{color:"neutral[400]",children:(0,_.t)("Cash on delivery")})]}),(0,a.jsx)(g.A,{sx:{color:$.palette.neutral[400],padding:"0px"},checked:"cash_on_delivery"===X,onChange:()=>R("cash_on_delivery")})]})})]}),(0,a.jsxs)(s.A,{children:["receiver"!==T&&(0,a.jsxs)(s.A,{p:"10px 0",flexDirection:"row",alignItems:"baseline",gap:".25rem",children:[(0,a.jsx)(x.A,{fontSize:"16px",fontWeight:500,children:(0,_.t)("Pay Via Online")}),(0,a.jsxs)(x.A,{color:$.palette.neutral[400],fontSize:"12px",children:["(",(0,_.t)("Faster & secure way to pay bill"),")"]})]}),(0,a.jsx)(s.A,{direction:"row",flexWrap:"wrap",columnGap:2,rowGap:1,flexGrow:1,children:"receiver"!==T&&"true"!==U&&(null==Z||null==(c=Z.digital_payment_info)?void 0:c.digital_payment)&&(null==(I=K()[0])?void 0:I.digital_payment)&&(0,a.jsx)(a.Fragment,{children:null==Z||null==(z=Z.active_payment_method_list)?void 0:z.map((e,t)=>{var n,i;return(0,a.jsx)(s.A,{flexGrow:1,flexBasis:"48%",children:(0,a.jsx)(k.A,{parcel:J,paymentType:null==e?void 0:e.gateway_title,image:null==e?void 0:e.gateway_image_full_url,paymentMethod:X,setPaymentMethod:R,setIsCheckedOffline:el,paidBy:T,type:null==e?void 0:e.gateway,digitalPaymentMethodActive:null==Z||null==(n=Z.digital_payment_info)?void 0:n.digital_payment,imageUrl:null==Z||null==(i=Z.base_urls)?void 0:i.gateway_image_url},t)})})})})]})]}),(0,a.jsx)(s.A,{pb:"20px",children:(null==(S=K()[0])?void 0:S.offline_payment)&&void 0!==L&&(null==(F=Object)||null==(W=F.keys(L))?void 0:W.length)!==0&&(null==Z?void 0:Z.offline_payment_status)===1&&"receiver"!==T?(0,a.jsx)(l.jB,{padding:"10px",borderRadius:"10px",backgroundColor:$.palette.neutral[300],border:"1px solid ".concat((0,j.X4)($.palette.primary.main,.2)),onClick:ec,sx:{cursor:"pointer"},children:(0,a.jsxs)(l.jB,{gap:"10px",children:[(0,a.jsxs)(l.jB,{flexDirection:"row",justifyContent:"space-between",children:[(0,a.jsx)(h.A,{sx:{marginRight:{xs:"0px"}},children:(0,a.jsx)(y.A,{"aria-labelledby":"demo-radio-buttons-group-label",name:"radio-buttons-group",fontWeight:"600",children:(0,a.jsx)(l.jr,{value:"Pay Offline",control:(0,a.jsx)(g.A,{sx:{padding:{xs:"2px",md:"10px"}},checked:ei,onClick:ec}),label:(0,a.jsx)(s.A,{flexDirection:"row",gap:".5rem",children:(0,a.jsxs)(x.A,{fontSize:"14px",fontWeight:"500",children:[(0,_.t)("Pay Offline"),(0,a.jsxs)(x.A,{component:"span",fontSize:"10px",children:["( ",(0,_.t)("Select option from below")," )"]})]})})})})}),(0,a.jsx)(f.A,{placement:"left",title:"Offline Payment! Now, with just a click of a button, you can make secure transactions. It's simple, convenient, and reliable.",children:(0,a.jsx)(r.A,{fontSize:"16px",sx:{color:$.palette.primary.main}})})]}),er&&(0,a.jsx)(l.jB,{children:(0,a.jsx)(l.jB,{flexDirection:"row",gap:"20px",children:null==L?void 0:L.map((e,t)=>(0,a.jsx)(O,{value:e,paymentMethod:en,onClick:()=>{et((0,C.JB)(e)),et((0,C.im)(1)),el(!0),R("offline_payment")},children:(0,a.jsx)(x.A,{fontSize:"12px",textTransform:"capitalize",children:e.method_name})},t))})})]})}):null})]})}),(0,a.jsxs)(s.A,{direction:"row",gap:"1rem",justifyContent:"flex-end",children:[(0,a.jsx)(M.mg,{sx:{width:"100px",bgcolor:$.palette.neutral[300],color:$.palette.text.primary,"&:hover":{bgcolor:$.palette.neutral[400]}},onClick:()=>Q(!1),children:(0,_.t)("Cancel")}),T&&(0,a.jsx)(o.A,{type:"submit",variant:"contained",onClick:()=>{q(X),Q(!1)},loading:G,children:(0,_.t)("Update")})]})]})};var z=n(10819);let S=e=>{let{paymentMethod:t,setPaymentMethod:n,paidBy:i,orderPlace:r,isLoading:o,zoneData:c,forprescription:d,configData:p,orderType:s,parcel:x,setOpenModel:u,offlinePaymentOptions:m,usePartialPayment:g,setPaymentMethodImage:h,setSwitchToWallet:y,isZoneDigital:f,getParcelPayment:j,handlePartialPayment:v,walletBalance:A,removePartialPayment:_,switchToWallet:w,customerData:b,payableAmount:C,changeAmount:P,setChangeAmount:k,failed:B,failedOrderPlace:D,setOpen:M,setSelectedPaymentMethod:O}=e;return(0,a.jsx)(l.jB,{spacing:2,children:"true"===x?(0,a.jsx)(I,{setPaymentMethod:n,paymentMethod:t,zoneData:c,configData:p,orderType:s,parcel:x,paidBy:i,orderPlace:r,isLoading:o,offlinePaymentOptions:m,setPaymentMethodImage:h,getParcelPayment:j,setOpen:M,setSelectedPaymentMethod:O}):(0,a.jsx)(z.Ay,{failed:B,changeAmount:P,setChangeAmount:k,setPaymentMethod:n,paymentMethod:t,zoneData:c,configData:p,orderType:s,setOpenModel:u,usePartialPayment:g,forprescription:d,offlinePaymentOptions:m,setPaymentMethodImage:h,setSwitchToWallet:y,isZoneDigital:f,handlePartialPayment:v,walletBalance:A,removePartialPayment:_,switchToWallet:w,customerData:b,payableAmount:C,failedOrderPlace:D})})}},77914:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(37876),i=n(66703),l=n(6995),r=n(35003),o=n(82);let c=e=>{let{text:t,textAlign:n,...c}=e,{t:d}=(0,o.Bd)(),p=(0,i.A)(),s=(0,l.A)(p.breakpoints.down("sm"));return(0,a.jsx)(r.A,{textAlign:n||"center",variant:s?"body2":"subtitle1",lineHeight:"24px",fontWeight:"400",sx:{color:"text.secondary"},...c,children:d(t)})};c.propTypes={};let d=c}}]);