1"use strict";(self.webpackChunkautodukan_ui=self.webpackChunkautodukan_ui||[]).push([[2731],{25383(o,e,t){t.d(e,{A:()=>r});t(9950);const r=t.p+"static/media/round_icon.2a4416537ac859687759484a9f0b2c34.svg"},52731(o,e,t){t.r(e),t.d(e,{default:()=>j});var r=t(9950),n=t(60899),i=t(16491),a=t(82053),s=t(74745),c=t(48089),d=t(13569),l=t(50704),p=t(93230),u=t(45098),x=t(25383),m=t(91069),h=t(35887),g=t(28429),f=t(90239),A=t(96028),v=t(70634),C=t(44414);const y={header:{display:"flex",justifyContent:"flex-start",alignItems:"center",marginTop:"20px"},headerText:{fontSize:"1.3rem",padding:"10px",textTransform:"uppercase"},productStack:{marginTop:"20px"},productCard:{border:"1px solid",borderColor:"#E5E5E5",width:"100%",height:"100%",cursor:"pointer",position:"relative",transition:"box-shadow 0.3s, height 0.3s","&:hover":{boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1)",height:"calc(100% + 30px)","& .add-to-cart-button":{opacity:1},"& .remove-button":{opacity:1}}},productImage:{display:"block",height:"150px",objectFit:"contain"},productCardContent:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",padding:"10px"},productName:{fontWeight:"medium",marginBottom:"4px"},productPrice:{flexGrow:1,display:"flex",flexDirection:"column",justifyContent:"flex-end"},productPriceText:{fontWeight:"bold",color:"#003399"},addToCartButton:{position:"absolute",bottom:"10px",left:"10px",opacity:0,transition:"opacity 0.3s",backgroundColor:"#FF6633",textTransform:"none",fontSize:"16px","&:hover":{backgroundColor:"#000",color:"#fff"}},removeButton:{position:"absolute",bottom:"10px",right:"10px",opacity:0,transition:"opacity 0.3s",backgroundColor:"#003399",textTransform:"none",fontSize:"16px","&:hover":{backgroundColor:"#000",color:"#fff"}}},j=()=>{const[o,e]=(0,r.useState)([]),[t,j]=(0,r.useState)(!0),{fetchCartCount:b}=(0,v._)(),w=(0,g.Zp)(),k=async()=>{try{const o=await(0,m.$6)();200===(null===o||void 0===o?void 0:o.code)?(e(null===o||void 0===o?void 0:o.data),j(!1)):(j(!1),h.Ay.error("Error fetching wishlist"))}catch(o){console.error("Error fetching wishlist:",o),j(!1)}};(0,r.useEffect)((()=>{k()}),[]);o.filter((o=>o.product_image.length>0));return(0,C.jsx)(C.Fragment,{children:t?(0,C.jsx)(A.A,{}):(0,C.jsx)(n.Ay,{fluid:"true",maxWidth:{xl:"1303px",lg:"1103px",xs:void 0,md:"900px",sm:"800px"},margin:"auto",sx:{padding:{lg:"0px",md:"0px",sm:"10px",xs:"10px"}},children:(0,C.jsxs)(i.A,{children:[(0,C.jsxs)(i.A,{sx:y.header,children:[(0,C.jsx)("img",{src:x.A,alt:""}),(0,C.jsx)(a.A,{sx:y.headerText,children:(0,C.jsx)("span",{style:{fontWeight:"bold"},children:"Wishlist"})})]}),(0,C.jsx)(s.A,{}),o.length>0?(0,C.jsx)(i.A,{sx:y.productStack,children:(0,C.jsx)(n.Ay,{container:!0,spacing:2,children:o.map(((o,e)=>(0,C.jsx)(n.Ay,{item:!0,xs:12,sm:6,md:4,lg:3,children:(0,C.jsxs)(c.A,{sx:y.productCard,elevation:0,onClick:()=>(async o=>{w("/product/".concat(o))})(o.id),children:[(0,C.jsx)(d.A,{sx:y.productImage,component:"img",image:o.sub_category_image?o.sub_category_image:f,alt:"product"}),(0,C.jsxs)(l.A,{sx:y.productCardContent,children:[(0,C.jsx)(a.A,{sx:y.productName,children:o.product_name}),(0,C.jsx)(i.A,{sx:y.productPrice,children:(0,C.jsxs)(a.A,{sx:y.productPriceText,children:["Rs. ",o.price]})})]}),(0,C.jsx)(i.A,{justifyContent:"space-between",children:(0,C.jsxs)(p.A,{flexDirection:"row",sx:{paddingTop:"10px"},children:[(0,C.jsx)(n.Ay,{children:(0,C.jsx)(u.A,{className:"remove-button",variant:"contained",color:"primary",size:"small",sx:y.removeButton,onClick:e=>{e.stopPropagation(),(async o=>{const e=await(0,m.Qg)(o);200===(null===e||void 0===e?void 0:e.code)?(h.Ay.success(null===e||void 0===e?void 0:e.msg),k()):h.Ay.error(null===e||void 0===e?void 0:e.msg)})(o.id)},children:"Remove item"})}),(0,C.jsx)(n.Ay,{children:(0,C.jsx)(u.A,{className:"add-to-cart-button",variant:"contained",color:"primary",size:"small",sx:y.addToCartButton,onClick:e=>{e.stopPropagation(),(async o=>{j(!0);const e=await(0,m.bE)(o,1);"success"===e.status?(j(!1),h.Ay.success("Item added to cart"),k(),b()):"error"===e.status&&203===e.code?h.Ay.error("Product is out of stock"):h.Ay.error("Error adding item to cart")})(o.id)},children:"add to cart"})})]})})]})},e)))})}):(0,C.jsx)(i.A,{height:"100vh",children:(0,C.jsxs)(i.A,{padding:"24px 0px !important",display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,C.jsxs)(i.A,{children:[(0,C.jsx)(a.A,{color:"initial",sx:{fontWeight:"600",fontSize:"18px"},children:"No favorites yet."}),(0,C.jsx)(a.A,{color:"initial",sx:{fontWeight:"400",fontSize:"15px",mt:"5px"},children:"Tap any heart to a product to favorite we'll them from you here!"})]}),(0,C.jsx)(u.A,{variant:"contained",fullWidth:!0,onClick:()=>w("/"),sx:{backgroundColor:"#003399",textTransform:"none",fontSize:"16px",height:"44px",width:"200px","&:hover":{backgroundColor:"#000",color:"#fff"}},children:"START SHOPPING"})]})})]})})})}},48089(o,e,t){t.d(e,{A:()=>f});var r=t(58168),n=t(98587),i=t(9950),a=t(60533),s=t(74061),c=t(59254),d=t(48283),l=t(2235),p=t(80863),u=t(68483);function x(o){return(0,u.Ay)("MuiCard",o)}(0,p.A)("MuiCard",["root"]);var m=t(44414);const h=["className","raised"],g=(0,c.Ay)(l.A,{name:"MuiCard",slot:"Root",overridesResolver:(o,e)=>e.root})((()=>({overflow:"hidden"}))),f=i.forwardRef((function(o,e){const t=(0,d.A)({props:o,name:"MuiCard"}),{className:i,raised:c=!1}=t,l=(0,n.A)(t,h),p=(0,r.A)({},t,{raised:c}),u=(o=>{const{classes:e}=o;return(0,s.A)({root:["root"]},x,e)})(p);return(0,m.jsx)(g,(0,r.A)({className:(0,a.A)(u.root,i),elevation:c?8:void 0,ref:e,ownerState:p},l))}))},50704(o,e,t){t.d(e,{A:()=>g});var r=t(58168),n=t(98587),i=t(9950),a=t(60533),s=t(74061),c=t(59254),d=t(48283),l=t(80863),p=t(68483);function u(o){return(0,p.Ay)("MuiCardContent",o)}(0,l.A)("MuiCardContent",["root"]);var x=t(44414);const m=["className","component"],h=(0,c.Ay)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(o,e)=>e.root})((()=>({padding:16,"&:last-child":{paddingBottom:24}}))),g=i.forwardRef((function(o,e){const t=(0,d.A)({props:o,name:"MuiCardContent"}),{className:i,component:c="div"}=t,l=(0,n.A)(t,m),p=(0,r.A)({},t,{component:c}),g=(o=>{const{classes:e}=o;return(0,s.A)({root:["root"]},u,e)})(p);return(0,x.jsx)(h,(0,r.A)({as:c,className:(0,a.A)(g.root,i),ownerState:p,ref:e},l))}))},13569(o,e,t){t.d(e,{A:()=>A});var r=t(98587),n=t(58168),i=t(9950),a=t(60533),s=t(74061),c=t(48283),d=t(59254),l=t(80863),p=t(68483);function u(o){return(0,p.Ay)("MuiCardMedia",o)}(0,l.A)("MuiCardMedia",["root","media","img"]);var x=t(44414);const m=["children","className","component","image","src","style"],h=(0,d.Ay)("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o,{isMediaComponent:r,isImageComponent:n}=t;return[e.root,r&&e.media,n&&e.img]}})((o=>{let{ownerState:e}=o;
1return(0,n.A)({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},e.isMediaComponent&&{width:"100%"},e.isImageComponent&&{objectFit:"cover"})})),g=["video","audio","picture","iframe","img"],f=["picture","img"],A=i.forwardRef((function(o,e){const t=(0,c.A)({props:o,name:"MuiCardMedia"}),{children:i,className:d,component:l="div",image:p,src:A,style:v}=t,C=(0,r.A)(t,m),y=-1!==g.indexOf(l),j=!y&&p?(0,n.A)({backgroundImage:'url("'.concat(p,'")')},v):v,b=(0,n.A)({},t,{component:l,isMediaComponent:y,isImageComponent:-1!==f.indexOf(l)}),w=(o=>{const{classes:e,isMediaComponent:t,isImageComponent:r}=o,n={root:["root",t&&"media",r&&"img"]};return(0,s.A)(n,u,e)})(b);return(0,x.jsx)(h,(0,n.A)({className:(0,a.A)(w.root,d),as:l,role:!y&&p?"img":void 0,ref:e,style:j,ownerState:b,src:y?p||A:void 0},C,{children:i}))}))},90239(o,e,t){o.exports=t.p+"static/media/autoducan_logo.0e169b8d57f417dde881.png"}}]);
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.