(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,44001,e=>{"use strict";var t=e.i(68834),s=e.i(79473);let a=(0,t.create)()((0,s.persist)((e,t)=>({items:[],addItem:s=>{let a=t().items;a.find(e=>e.id===s.id)||e({items:[...a,s]})},removeItem:s=>{e({items:t().items.filter(e=>e.id!==s)})},toggleItem:s=>{let a=t().items;a.find(e=>e.id===s.id)?e({items:a.filter(e=>e.id!==s.id)}):e({items:[...a,s]})},isInWishlist:e=>t().items.some(t=>t.id===e),clearWishlist:()=>{e({items:[]})}}),{name:"bambucare-wishlist-storage"}));e.s(["useWishlistStore",0,a])},99738,e=>{"use strict";let t=(0,e.i(56420).default)("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);e.s(["ShoppingCart",0,t],99738)},86563,e=>{"use strict";let t=(0,e.i(56420).default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);e.s(["Star",0,t],86563)},68109,e=>{"use strict";let t=(0,e.i(56420).default)("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]);e.s(["Heart",0,t],68109)},30784,e=>{"use strict";var t=e.i(43476),s=e.i(22016),a=e.i(19455),l=e.i(99738),i=e.i(68109),r=e.i(86563),c=e.i(58628),o=e.i(44001),d=e.i(5766),n=e.i(71645);e.s(["default",0,function({initialProducts:e}){let u=(0,c.useCartStore)(e=>e.addItem),{toggleItem:m,isInWishlist:h}=(0,o.useWishlistStore)(),[x,f]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{f(!0)},[]),0===e.length)?(0,t.jsx)("div",{className:"text-center py-20 text-slate-500 text-lg",children:"No products found."}):(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8",children:e.map(e=>{let c=!!x&&h(e.id);return(0,t.jsxs)(s.default,{href:`/product/${e.slug}`,className:"group flex flex-col bg-white rounded-2xl overflow-hidden border border-slate-100 shadow-sm hover:shadow-xl transition-all duration-300",children:[(0,t.jsxs)("div",{className:"relative aspect-[4/5] bg-[#F5F5F0] overflow-hidden",children:[(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-slate-400 font-medium",children:"No Image"}),(0,t.jsx)("div",{className:"absolute top-4 right-4 flex flex-col gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-300 translate-x-4 group-hover:translate-x-0",children:(0,t.jsx)("button",{onClick:t=>{let s;return t.preventDefault(),s=Number(e.variants?.[0]?.price||0),void(m({id:e.id,name:e.name,slug:e.slug,price:s}),h(e.id)?d.default.success("Removed from wishlist"):d.default.success("Added to wishlist"))},className:`w-10 h-10 rounded-full bg-white shadow-md flex items-center justify-center transition-colors ${c?"text-red-500":"text-slate-400 hover:text-red-500"}`,children:(0,t.jsx)(i.Heart,{className:`w-5 h-5 ${c?"fill-current":""}`})})}),(0,t.jsx)("div",{className:"absolute top-4 left-4",children:(0,t.jsx)("span",{className:"bg-[#285b30] text-white text-[10px] font-bold px-2 py-1 rounded uppercase tracking-wider",children:"In Stock"})})]}),(0,t.jsxs)("div",{className:"p-5 flex flex-col flex-grow",children:[(0,t.jsxs)("div",{className:"flex text-yellow-400 mb-2",children:[(0,t.jsx)(r.Star,{fill:"currentColor",className:"w-3 h-3"}),(0,t.jsx)(r.Star,{fill:"currentColor",className:"w-3 h-3"}),(0,t.jsx)(r.Star,{fill:"currentColor",className:"w-3 h-3"}),(0,t.jsx)(r.Star,{fill:"currentColor",className:"w-3 h-3"}),(0,t.jsx)(r.Star,{fill:"currentColor",className:"w-3 h-3"})]}),(0,t.jsx)("h3",{className:"font-bold text-lg text-slate-900 group-hover:text-[#285b30] transition-colors line-clamp-2 mb-1",children:e.name}),(0,t.jsx)("p",{className:"text-sm text-slate-500 mb-4",children:e.brand?.name||"BambuCare"}),(0,t.jsx)("div",{className:"mt-auto flex items-center justify-between",children:(0,t.jsxs)("span",{className:"text-xl font-bold text-[#1f4a25]",children:["৳ ",e.variants?.[0]?.price?Number(e.variants[0].price).toFixed(2):"N/A"]})}),(0,t.jsxs)(a.Button,{onClick:t=>((e,t)=>{if(e.preventDefault(),!t.variants||0===t.variants.length)return void d.default.error("This product is out of stock or unavailable.");let s=Number(t.variants[0].price);u({productVariantId:t.variants[0].id,productName:t.name,sku:t.slug,price:s,quantity:1}),d.default.success("Added to cart!")})(t,e),className:"w-full mt-4 bg-slate-900 hover:bg-[#285b30] text-white transition-colors gap-2",children:[(0,t.jsx)(l.ShoppingCart,{className:"w-4 h-4"})," Add to Cart"]})]})]},e.id)})})}])}]);