1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3021],{8217:function(e,t,r){Promise.resolve().then(r.bind(r,19069))},78030:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var l=r(2265);let s=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),a=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&r.indexOf(e)===t).join(" ")};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,l.forwardRef)((e,t)=>{let{color:r="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:u,...m}=e;return(0,l.createElement)("svg",{ref:t,...n,width:s,height:s,stroke:r,strokeWidth:o?24*Number(i)/Number(s):i,className:a("lucide",c),...m},[...u.map(e=>{let[t,r]=e;return(0,l.createElement)(t,r)}),...Array.isArray(d)?d:[d]])}),o=(e,t)=>{let r=(0,l.forwardRef)((r,n)=>{let{className:o,...c}=r;return(0,l.createElement)(i,{ref:n,iconNode:t,className:a("lucide-".concat(s(e)),o),...c})});return r.displayName="".concat(e),r}},87138:function(e,t,r){"use strict";r.d(t,{default:function(){return s.a}});var l=r(231),s=r.n(l)},19069:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return d}});var l=r(57437),s=r(2265),a=r(38472),n=r(88726);let i=(0,r(78030).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var o=r(41942),c=r(87138);function d(e){let{initialData:t}
1=e,[r,d]=(0,s.useState)((null==t?void 0:t.products)||[]),[u,m]=(0,s.useState)([]),[f,h]=(0,s.useState)([]),[p,g]=(0,s.useState)({name:""}),[x,v]=(0,s.useState)(!1),[b,j]=(0,s.useState)(1),[y,w]=(0,s.useState)((null==t?void 0:t.totalPages)||1),[N,O]=(0,s.useState)(!1),[k,P]=(0,s.useState)([]),S=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;try{v(!0);let{data:t}=await a.Z.get("/api/product",{params:{page:e,name:p.name,category:f.length>0?f.join(","):void 0,limit:12}});d(null==t?void 0:t.products),w((null==t?void 0:t.totalPages)||1)}catch(e){n.Am.error("Failed to fetch products")}finally{v(!1)}};(0,s.useEffect)(()=>{S(b)},[b,p.name,f]);let C=async()=>{try{let{data:e}=await a.Z.get("/api/category");m(null==e?void 0:e.categories)}catch(e){n.Am.error("Failed to fetch categories")}};(0,s.useEffect)(()=>{C()},[]);let E=e=>{let{name:t,checked:r}=e.target;h(e=>r?[...e,t]:e.filter(e=>e!==t))},_=e=>{e>=1&&e<=y&&j(e)},A=e=>{let t=JSON.parse(localStorage.getItem("wishlist"))||[];if(t.some(t=>t._id===e._id)){let r=t.filter(t=>t._id!==e._id);t.length=0,t.push(...r),n.Am.success("Product removed from wishlist!")}else t.push(e),n.Am.success("Product added to wishlist!");localStorage.setItem("wishlist",JSON.stringify(t)),P(t)},z=e=>k.some(t=>t._id===e);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"w-full h-46",children:(0,l.jsx)("img",{className:"w-full h-full object-cover",src:"/aura-banner.jpg",alt:"Aura Banner"})}),(0,l.jsxs)("div",{className:"container mx-auto p-4",children:[(0,l.jsx)(n.Toaster,{}),(0,l.jsxs)("div",{className:"px-4 md:px-10 pb-6 my-8 flex items-center gap-5 md:gap-0 justify-between md:flex-row flex-col",children:[(0,l.jsx)("h1",{className:"text-2xl md:text-4xl font-bold tracking-wide text-gray-700",children:"All Products"}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("input",{style:{transition:".4s",opacity:N?"1":"0",visibility:N?"visible":"hidden"},name:"name",placeholder:"Search here",value:p.name,onChange:e=>{g({...p,[e.target.name]:e.target.value})},className:"border border-gray-300 hover:ring-1 ring-capri px-3 py-1 rounded-full w-[180px] sm:w-[240px] text-gray-600 placeholder:text-gray-400 font-light outline-none focus:ring-2 focus:ring-capri"}),(0,l.jsx)("button",{onClick:()=>O(!0),className:"animate-pulse text-xl text-gray-400 cursor-pointer absolute top-1/2 right-2 -translate-y-1/2 transition-all duration-300 hover:text-capri",children:(0,l.jsx)(i,{})})]})]}),(0,l.jsxs)("div",{className:"flex md:flex-row flex-col gap-4 md:px-10",children:[(0,l.jsxs)("aside",{className:"md:w-1/4 p-4 border rounded-lg",children:[(0,l.jsx)("h2",{className:"text-xl font-medium mb-2",children:"Categories"}),(0,l.jsx)("div",{children:u.map(e=>(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,l.jsx)("input",{type:"checkbox",id:e.id,name:e.name,onChange:E}),(0,l.jsx)("label",{htmlFor:e.name,children:e.name})]},e.id))})]}),(0,l.jsxs)("div",{className:"flex-1",children:[x?(0,l.jsx)("div",{className:"grid grid-cols-1 px-4 sm:grid-cols-3 md:grid-cols-4 gap-4",children:Array.from({length:9}).map((e,t)=>(0,l.jsxs)("div",{className:"p-3 w-full border rounded-xl overflow-hidden bg-white relative",children:[(0,l.jsx)("div",{className:"h-56 border relative skeleton"}),(0,l.jsxs)("div",{className:"space-y-3 mt-2",children:[(0,l.jsx)("div",{className:"w-1/2 h-5 bg-gray-300 rounded-md skeleton"}),(0,l.jsx)("div",{className:"w-3/4 h-5 bg-gray-300 rounded-md skeleton"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-1/4 h-5 bg-gray-300 rounded-md skeleton"}),(0,l.jsx)("div",{className:"w-10 h-10 bg-gray-300 rounded-full skeleton"})]})]})]},t))}):0===r.length?(0,l.jsx)("p",{className:"flex justify-center items-center h-[20vh] text-xl text-capri",children:"No products found."}):(0,l.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 md:grid-cols-4 gap-4",children:r.map(e=>(0,l.jsxs)("div",{className:"p-2 w-full border rounded-xl overflow-hidden bg-white relative",children:[(0,l.jsxs)("div",{className:"h-56 border relative group",children:[(0,l.jsx)("img",{src:null==e?void 0:e.images[0],alt:e.name,className:"w-full h-full object-cover transition-all duration-300"}),(0,l.jsx)("button",{onClick:()=>A(e),className:"absolute top-3 right-3 p-2 rounded-full transition-all duration-300 hidden group-hover:block ".concat(z(e._id)?"bg-red-500":"bg-gray-300"),children:(0,l.jsx)(o.$0H,{title:"add to wishlist",className:"h-3 w-3 ".concat(z(e._id)?"text-white":"text-gray-600")})})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-gray-600",children:e.category}),(0,l.jsx)("div",{children:(0,l.jsx)(c.default,{href:"/singleProduct/".concat(e._id),children:(0,l.jsx)("p",{className:"text-xl font-semibold hover:text-blue-400 pb-2 pt-2 cursor-pointer",children:e.name})})}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pb-2 border-b-2 border-gray-200 relative",children:[(0,l.jsxs)("p",{className:"font-bold text-blue-600 text-[1.1rem]",children:["Rs. ",e.price]}),(0,l.jsx)(c.default,{href:"/brand/".concat(e.brandId._id),className:"absolute size-12 flex items-center justify-center rounded-full border right-2 top-0 overflow-hidden",children:(0,l.jsx)("img",{src:e.brandId.logo,alt:""})})]})]})]},e._id))}),(0,l.jsxs)("div",{className:"flex justify-center items-center mt-4",children:[(0,l.jsx)("button",{onClick:()=>_(b-1),disabled:1===b,className:"px-4 py-2 border rounded-lg mr-2",children:"Previous"}),(0,l.jsxs)("span",{children:["Page ",b," of ",y]}),(0,l.jsx)("button",{onClick:()=>_(b+1),disabled:b===y,className:"px-4 py-2 border rounded-lg ml-2",children:"Next"})]})]})]})]})]})}},91810:function(e,t,r){"use strict";r.d(t,{w_:function(){return d}});var l=r(2265),s={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},a=l.createContext&&l.createContext(s),n=["attr","size","title"];function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,l)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?o(Object(r),!0).forEach(function(t){var l,s;l=t,s=r[t],(l=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var l=r.call(e,t||"default");if("object"!=typeof l)return l;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(l))in e?Object.defineProperty(e,l,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[l]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function d(e){return t=>l.createElement(u,i({attr:c({},e.attr)},t),function e(t){return t&&t.map((t,r)=>l.createElement(t.tag,c({key:r},t.attr),e(t.child)))}(e.child))}function u(e){var t=t=>{var r,{attr:s,size:a,title:o}=e,d=function(e,t){if(null==e)return{};var r,l,s=function(e,t){if(null==e)return{};var r={};for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){if(t.indexOf(l)>=0)continue;r[l]=e[l]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}(e,n),u=a||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),l.createElement("svg",i({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,s,d,{className:r,style:c(c({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),o&&l.createElement("title",null,o),e.children)};return void 0!==a?l.createElement(a.Consumer,null,e=>t(e)):t(s)}}},function(e){e.O(0,[7699,8472,8726,231,2971,7023,1744],function(){return e(e.s=8217)}),_N_E=e.O()}]);
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.