(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,79201,e=>{"use strict";var t=e.i(43476),a=e.i(90597),s=e.i(50965);let r=(0,e.i(75254).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var i=e.i(22016);function o({product:e}){return(0,t.jsxs)("div",{className:"   group relative bg-white border border-gray-100 overflow-hidden   transition-shadow duration-300   hover:shadow-md   ",children:[(0,t.jsx)(i.default,{href:`/product-details/${e.slug}`,className:"block",children:(0,t.jsxs)("div",{className:"relative overflow-hidden",children:[(0,t.jsx)("img",{src:e.image,alt:e.name,className:"w-full h-64 object-cover transition-transform duration-300 group-hover:scale-105"}),(0,t.jsxs)("div",{className:"absolute top-3 left-3 flex gap-2",children:[e.badge&&(0,t.jsx)("span",{className:"bg-green-500 text-white text-xs px-2 py-1",children:e.badge}),e.discount&&(0,t.jsx)("span",{className:"bg-red-500 text-white text-xs px-2 py-1",children:e.discount})]})]})}),(0,t.jsxs)("div",{className:"p-4 text-center",children:[(0,t.jsx)("p",{className:"text-xs text-gray-400 uppercase",children:"Category"}),(0,t.jsx)("h3",{className:"text-sm font-medium mt-1 text-gray-400",children:"Casual Spring Blue Shoes"}),(0,t.jsx)("div",{className:"flex justify-center text-yellow-400 text-xs mt-1",children:"★★★★★"}),(0,t.jsxs)("div",{className:"mt-2",children:[e.originalPrice!==e.salePrice&&(0,t.jsxs)("span",{className:"text-sm text-muted-foreground line-through mr-2",children:["$",e.originalPrice.toFixed(2)]}),(0,t.jsxs)("span",{className:"text-lg font-semibold text-foreground",children:["৳",e.salePrice.toFixed(2)]})]}),(0,t.jsxs)("div",{className:"mt-3 flex items-center justify-center gap-2",children:[(0,t.jsx)("button",{className:"   border border-gray-400 p-2 text-gray-400   opacity-0 group-hover:opacity-100   transition-opacity   hover:bg-gray-100   ",children:(0,t.jsx)(a.Heart,{size:16})}),(0,t.jsxs)("button",{className:"   flex items-center justify-center gap-2 px-4 py-2   border border-gray-400 text-gray-400   text-sm font-medium   transition-colors   group-hover:bg-black group-hover:text-white group-hover:border-black   ",children:[(0,t.jsx)(s.ShoppingBag,{size:16}),"cart"===e.buttonType?"Add to Cart":"Select Options"]}),(0,t.jsx)("button",{className:"   border border-gray-400 p-2 text-gray-400   opacity-0 group-hover:opacity-100   transition-opacity   hover:bg-gray-100   ",children:(0,t.jsx)(r,{size:16})})]})]})]})}e.s(["default",()=>o],79201)},68106,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(18566),r=e.i(79201);function i(){let e=(0,s.useSearchParams)(),i=e.get("search_key")||"",o=e.get("category_id")||"",[l,c]=(0,a.useState)([]),[n,d]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(!i)return void c([]);d(!0);let e=new URLSearchParams;e.append("search_key",i),o&&e.append("category_id",o),fetch(`https://emela.malooz.com/admin/api/v1/search?${e.toString()}`).then(e=>e.json()).then(e=>{c((e?.data?.products?.data??[]).map(e=>{let t=Number(e.base_price??0);return{id:e.id,name:e.name,slug:e.slug,category:e.categories?.[0]?.name??"",originalPrice:t,salePrice:t,rating:e.reviews?.length??0,image:e.main_image?`https://emela.malooz.com/admin/assets/images/product/${e.main_image}`:"/placeholder.png",badge:e.is_featured?"FEATURED":null,buttonType:e.has_variants?"options":"cart"}}))}).catch(()=>{c([])}).finally(()=>{d(!1)})},[i,o]),(0,t.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[(0,t.jsxs)("h1",{className:"text-xl font-semibold mb-6",children:['Search Result for "',i,'"']}),n&&(0,t.jsx)("p",{children:"Loading..."}),!n&&0===l.length&&(0,t.jsx)("p",{children:"No product found"}),(0,t.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:l.map(e=>(0,t.jsx)(r.default,{product:e},e.id))})]})}e.s(["default",()=>i])}]);