1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6980],{4180:function(e,t){t.Z={src:"/_next/static/media/samu-giken.1bf2ec60.webp",height:549,width:1920,blurDataURL:"data:image/webp;base64,UklGRmQAAABXRUJQVlA4WAoAAAAQAAAABwAAAQAAQUxQSBEAAAAAGjk6MjtENBAZNi4qQzcvCgBWUDggLAAAAJABAJ0BKggAAgACQDgloAJ0ugADmAD+6ez/dAAp+z/+0s/+pZ/9Sz/NAAAA",blurWidth:8,blurHeight:2}},54030:function(e,t,n){var r=n(52676);n(75271);var a=n(12355);let s=e=>{let{fill:t="white",stroke:n="#ef6072"}=e;return(0,r.jsx)("svg",{"aria-hidden":"true",className:"absolute inset-0 h-full w-full overflow-visible",viewBox:"0 0 1000 564",preserveAspectRatio:"none",children:(0,r.jsx)("path",{d:"M34 12H970V182C928 182 894 216 894 259C894 302 928 335 970 335V344C970 459 876 552 760 552H34V335C76 335 109 302 109 259C109 216 76 182 34 182V12Z",fill:t,stroke:n,strokeWidth:"1",vectorEffect:"non-scaling-stroke"})})};t.Z=e=>{var t,n;let{coupon:l,claimed:i,loading:o,onClaim:c,displayOnly:u}=e,d=function(e){var t,n;if("PERCENTAGE"===e.discountType)return"".concat(null!==(t=e.percentOff)&&void 0!==t?t:0,"%");if("FIXED"===e.discountType){let t=null!==(n=e.amountOff)&&void 0!==n?n:0;return"RM".concat(Number.isInteger(t)?t:t.toFixed(2))}return"Free Shipping"}(l),m="FREE_SHIPPING"===l.discountType,x=(null===(t=l.description)||void 0===t?void 0:t.trim())||"No additional details for this voucher.",h=null!==(n=l.minSubtotal)&&void 0!==n?n:0,p=i||o,f=()=>{u||p||null==c||c()};return(0,r.jsxs)("div",{className:"relative h-[107px] w-[190px] shrink-0 select-none",children:[(0,r.jsx)("div",{className:"absolute inset-0 translate-x-[4px] translate-y-[5px]",children:(0,r.jsx)(s,{fill:"#e8e8e8",stroke:"none"})}),(0,r.jsx)(s,{}),(0,r.jsx)(a.Z,{trigger:["hover","click"],placement:"bottomRight",content:(0,r.jsx)("p",{className:"max-w-[200px] whitespace-pre-line text-[12px] leading-snug text-neutral-700",children:x}),children:(0,r.jsx)("button",{type:"button","aria-label":"Voucher details",onClick:e=>e.stopPropagation(),className:"absolute right-[11px] top-[9px] z-20 flex h-[14px] w-[14px] items-center justify-center rounded-full border-0 bg-[#eb2d42] p-0 text-[11px] font-bold leading-none text-white transition-transform hover:scale-105",children:"!"})}),(0,r.jsxs)("div",{className:"relative h-full px-6 text-center",children:[(0,r.jsx)("p",{className:"absolute left-6 right-6 pointer-events-none text-[#eb2d42] ".concat(m?"top-[8px] font-manrope text-[21px] font-bold leading-[0.86]":"top-[12px] whitespace-nowrap font-manrope text-[40px] font-bold leading-[0.9]"),children:m?(0,r.jsxs)(r.Fragment,{children:["Free",(0,r.jsx)("br",{}),"Shipping"]}):d}),(0,r.jsx)("p",{className:"absolute left-6 right-6 pointer-events-none font-manrope font-medium uppercase text-black ".concat("top-[47px] text-[12px] tracking-[0.27em]"),children:m?"Voucher":"Off Voucher"}),(0,r.jsx)("div",{className:"pointer-events-none absolute left-[39px] right-[39px] top-[65px] border-t border-[#ef9ba6]"}),(0,r.jsx)("p",{className:"pointer-events-none absolute left-6 right-6 top-[69px] whitespace-nowrap font-manrope text-[9px] font-light leading-none text-black",children:"Min Spend RM".concat(h)}),!u&&(0,r.jsx)("button",{type:"button",disabled:p,onClick:e=>{e.stopPropagation(),f()},className:"absolute left-1/2 top-[83px] h-[15px] w-[88px] -translate-x-1/2 cursor-pointer rounded-[5px] border-0 bg-[#eb2d42] p-0 font-manrope text-[10px] font-semibold leading-none text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:bg-[#f59aac]",children:o?"CLAIMINGâ¦":i?"CLAIMED":"CLAIM NOW"})]})]})}},46980:function(e,t,n){n.d(t,{Z:function(){return en}});var r=n(52676),a=n(75271),s=n(32623),l=n.n(s),i=n(4180),o=n(89367),c=n(21588),u=n(42720),d=n(2069),m=n(33561),x=n.n(m),h=n(30774),p=n(89415),f=n(31564),v=n(5317),g=e=>{let{onMenuClick:t}=e,n=(0,m.useRouter)(),{uniqueCount:a}=(0,v.j)();return(0,r.jsx)("div",{className:"w-full bg-white border-b border-neutral-200",children:(0,r.jsxs)("div",{className:"flex justify-between items-center px-4 py-3 mx-auto maxContainer",children:[(0,r.jsx)(f.Z,{className:"w-6 h-6 cursor-pointer text-neutral-800","aria-label":"Open menu",onClick:t}),(0,r.jsx)(l(),{onClick:()=>{n.push("/")},src:i.Z,alt:"Samu Giken",className:"h-[40px] w-auto cursor-pointer",priority:!0}),(0,r.jsxs)("button",{type:"button","aria-label":"Cart",onClick:()=>n.push("/cart"),className:"relative bg-transparent border-none cursor-pointer text-neutral-800",children:[(0,r.jsx)(u.Z,{className:"w-6 h-6"}),a>0&&(0,r.jsx)("span",{className:"absolute -right-2 -top-1 flex size-4 items-center justify-center rounded-full bg-red-600 text-[10px] font-semibold leading-none text-white",children:a})]})]})})},b=n(58612),w=n(98978),j=n(18316),N=n(8116),y=n(19676),k=n(78390),A=n(43146),S=n(57221),E=n(63309),C=n(72626),I=e=>{let{open:t,onClose:n}
1=e,s=(0,m.useRouter)(),[o,c]=a.useState(!1),[u,d]=a.useState([]);return a.useEffect(()=>{let e=!0;return(async()=>{try{let t=await (0,C.lq)();if(!e)return;d(Array.isArray(t.data)?t.data:[])}catch(t){if(!e)return;d([])}})(),()=>{e=!1}},[]),(0,r.jsxs)("div",{className:(0,E.cn)("fixed inset-0 z-[120] md:hidden",!t&&"pointer-events-none"),"aria-hidden":!t,children:[(0,r.jsx)("div",{className:(0,E.cn)("absolute inset-0 transition-opacity duration-300 bg-black/40",t?"opacity-100":"opacity-0"),onClick:n}),(0,r.jsxs)("aside",{className:(0,E.cn)("pt-4 absolute left-0 top-0 h-full w-[82%] max-w-[300px] bg-white shadow-xl transition-transform duration-300",t?"translate-x-0":"-translate-x-full"),role:"dialog","aria-modal":"true",children:[(0,r.jsxs)("div",{className:"flex gap-3 items-center p-4",children:[(0,r.jsx)("button",{type:"button","aria-label":"Close menu",onClick:n,className:"border-none inline-flex ml-2 h-7 w-7 items-center justify-center rounded-full bg-[#FB233B] active:scale-[0.98]",children:(0,r.jsx)(b.Z,{className:"w-5 h-5 text-white"})}),(0,r.jsx)(l(),{onClick:()=>s.push("/"),src:i.Z,alt:"Samu Giken",className:"ml-4 h-[50px] w-auto",priority:!0})]}),(0,r.jsx)("nav",{className:"px-4 py-1",children:(0,r.jsxs)("div",{className:"flex flex-col gap-8 pl-9",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex gap-5 items-center",onClick:()=>c(e=>!e),children:[(0,r.jsx)(w.Z,{className:"w-5 h-5"}),(0,r.jsx)("span",{children:"Product Categories"}),(0,r.jsx)(j.Z,{className:(0,E.cn)("h-4 w-4 transition-transform duration-300",o&&"rotate-180")})]}),(0,r.jsx)("div",{id:"menu-categories",className:(0,E.cn)("grid ease-in-out transition-[grid-template-rows] duration-400",o?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,r.jsx)("div",{className:"flex overflow-hidden flex-col gap-6 pl-12 text-sm",children:u.map((e,t)=>(0,r.jsx)("div",{onClick:()=>{s.push("/categories/".concat(e.slug)),n()},className:(0,E.cn)(0===t&&"mt-6"),children:e.name},e.refId))})})]}),(0,r.jsxs)("div",{className:"flex gap-5 items-center",onClick:()=>{s.push("/blog"),n()},children:[(0,r.jsx)(N.Z,{className:"w-5 h-5"}),(0,r.jsx)("span",{children:"Blog"})]}),(0,r.jsxs)("div",{className:"flex gap-5 items-center",onClick:()=>s.push("/contact-us"),children:[(0,r.jsx)(y.Z,{className:"w-5 h-5"}),(0,r.jsx)("span",{children:"Contact Us"})]}),(0,r.jsxs)("div",{className:"flex gap-5 items-center",onClick:()=>s.push("/about-us"),children:[(0,r.jsx)(k.Z,{className:"w-5 h-5"}),(0,r.jsx)("span",{children:"About Us"})]}),(0,r.jsxs)("div",{className:"flex gap-5 items-center",onClick:()=>s.push("/terms-and-conditions"),children:[(0,r.jsx)(A.Z,{className:"w-5 h-5"}),(0,r.jsx)("span",{children:"Terms & Conditions"})]}),(0,r.jsxs)("div",{className:"flex gap-5 items-center",onClick:()=>s.push("/our-partners"),children:[(0,r.jsx)(S.Z,{className:"w-5 h-5"}),(0,r.jsx)("span",{children:"Our Partners"})]})]})})]})]})},R=n(69834),Z=n(89120),T=n.n(Z),L=n(39936),B=n(94170);let O=()=>{let[e,t]=(0,a.useState)(""),[n,r]=(0,a.useState)(""),s=(0,a.useMemo)(()=>T()(e=>{r(e)},300),[]),l=(0,a.useCallback)(e=>{t(e),s(e)},[s]),i=(0,a.useCallback)(()=>{t(""),r("")},[]),{data:o,isLoading:c,error:u}=(0,R.a)({queryKey:["products","search",n],queryFn:()=>(0,L.Bz)({search:n,page:1,pageSize:10,sortField:"createdAt",sortOrder:B.As.DESC}),enabled:n.length>=3,staleTime:3e5,retry:1});return{searchQuery:e,setSearchQuery:l,clearSearch:i,data:null==o?void 0:o.data,isLoading:c,error:u}};var P=n(89886),M=n(28994),_=n(27026),D=n.n(_),F=n(22903),z=n(48588),V=e=>{var t;let{product:n,onClick:a}=e,s=(null===(t=n.image)||void 0===t?void 0:t.key)?(0,F.I)(n.image.key):"";return(0,r.jsxs)(D(),{href:(0,z.w)(n.refId,n.slug),className:"flex items-center gap-3 p-2 rounded-md cursor-pointer transition-colors hover:bg-neutral-50 no-underline",onClick:a,children:[(0,r.jsx)("div",{className:"flex-shrink-0 w-20 h-20 bg-neutral-100 rounded overflow-hidden",children:s?(0,r.jsx)("img",{src:s,alt:n.name,className:"object-cover w-full h-full",onError:e=>{e.currentTarget.src="/assets/placeholder-product.png"}}):(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center text-neutral-400",children:"No Image"})}),(0,r.jsx)("div",{className:"flex-1 min-w-0",children:(0,r.jsx)("p",{className:"text-sm text-neutral-900 line-clamp-2 leading-snug",children:n.name})})]})},W=e=>{let{visible:t,searchQuery:n,results:s,isLoading:l,error:i,inputWi
1dth:o,onClose:c,onProductClick:u}=e,d=(0,a.useRef)(null);return((0,M.t$)(d,c),(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&c()};return t&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[t,c]),t&&0!==n.length)?(0,r.jsxs)("div",{ref:d,style:{width:o>0?"".concat(o,"px"):void 0},className:"absolute top-full left-0 mt-2 bg-white border border-neutral-200 rounded-md shadow-lg max-h-96 overflow-y-auto z-50",children:[n.length>0&&n.length<3&&(0,r.jsx)("div",{className:"p-4 text-center text-neutral-500 text-sm",children:"Please enter at least 3 characters to search"}),n.length>=3&&l&&(0,r.jsx)("div",{className:"flex justify-center p-4",children:(0,r.jsx)(P.Z,{className:"w-6 h-6 animate-spin text-red-500"})}),i&&(0,r.jsx)("div",{className:"p-4 text-center text-red-500 text-sm",children:"Failed to load results. Please try again."}),n.length>=3&&!l&&s&&0===s.length&&!i&&(0,r.jsxs)("div",{className:"p-4 text-center text-neutral-500 text-sm",children:['No products found for "',n,'"']}),n.length>=3&&!l&&s&&s.length>0&&!i&&(0,r.jsx)("div",{className:"p-2",children:s.map(e=>(0,r.jsx)(V,{product:e,onClick:u},e.refId))})]}):null},U=n(57065),H=e=>{let{open:t,onClose:n}=e,s=(0,a.useRef)(null),{searchQuery:l,setSearchQuery:i,clearSearch:c,data:u,isLoading:d,error:m}=O();(0,a.useEffect)(()=>{if(t&&s.current){let e=setTimeout(()=>{var e;null===(e=s.current)||void 0===e||e.focus()},300);return()=>clearTimeout(e)}},[t]);let x=()=>{c(),n()},h=()=>{c(),n()};return(0,r.jsxs)("div",{className:(0,E.cn)("fixed inset-0 z-[130] md:hidden",!t&&"pointer-events-none"),"aria-hidden":!t,children:[(0,r.jsx)("div",{className:(0,E.cn)("absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity duration-300",t?"opacity-100":"opacity-0"),onClick:x}),(0,r.jsxs)("div",{className:(0,E.cn)("absolute bottom-0 left-0 right-0 transition-transform duration-500 ease-out flex flex-col max-h-[90vh]",t?"translate-y-0":"translate-y-full"),role:"dialog","aria-modal":"true",children:[(0,r.jsx)("div",{className:(0,E.cn)("bg-white mx-4 mb-3 rounded-2xl shadow-2xl overflow-hidden transition-all duration-300 border border-neutral-100",l.length>0?"opacity-100 scale-100 translate-y-0":"opacity-0 scale-95 translate-y-4 pointer-events-none"),children:(0,r.jsxs)("div",{className:"max-h-[50vh] overflow-y-auto p-2",children:[l.length>0&&l.length<3&&(0,r.jsxs)("div",{className:"p-6 text-sm text-center text-neutral-500",children:[(0,r.jsx)(o.Z,{className:"w-8 h-8 mx-auto mb-2 text-neutral-300"}),"Please enter at least 3 characters to search"]}),l.length>=3&&d&&(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center p-10",children:[(0,r.jsx)(P.Z,{className:"w-8 h-8 text-[#FB233B] animate-spin"}),(0,r.jsx)("p",{className:"mt-2 text-sm text-neutral-500",children:"Searching for products..."})]}),l.length>=3&&m&&(0,r.jsx)("div",{className:"p-6 text-sm text-center text-red-500",children:"Failed to load results. Please try again."}),l.length>=3&&!d&&u&&0===u.rows.length&&!m&&(0,r.jsxs)("div",{className:"p-8 text-sm text-center text-neutral-500",children:[(0,r.jsx)("div",{className:"text-4xl mb-2",children:"\uD83D\uDD0D"}),"No products found for ",(0,r.jsxs)("span",{className:"font-semibold",children:['"',l,'"']})]}),l.length>=3&&!d&&u&&u.rows.length>0&&!m&&(0,r.jsxs)("div",{className:"flex flex-col divide-y divide-neutral-50",children:[(0,r.jsxs)("div",{className:"px-3 py-2 text-[11px] font-bold text-neutral-400 uppercase tracking-wider",children:["Search Results (",u.rows.length,")"]}),u.rows.map(e=>(0,r.jsx)(V,{product:e,onClick:h},e.refId))]})]})}),(0,r.jsxs)("div",{className:"p-4 bg-white border-t border-neutral-100 rounded-t-[32px] shadow-[0_-10px_25px_-5px_rgba(0,0,0,0.1)] pb-8",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 px-2",children:[(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"text-[18px] font-extrabold text-neutral-900 leading-none",children:"Search Products"}),(0,r.jsx)("span",{className:"text-[11px] font-medium text-neutral-400 mt-1 uppercase tracking-wider",children:"Samu Giken Malaysia"})]}),(0,r.jsx)("button",{onClick:x,className:"flex items-center justify-center w-10 h-10 rounded-full bg-neutral-50 text-neutral-400 active:bg-red-50 active:text-[#FB233B] active:scale-90 transition-all duration-300 border border-neutral-100 shadow-sm","aria-label":"Close search",children:(0,r.jsx)(U.Z,{className:"w-5 h-5",strokeWidth:2.5})})]}),(0,r.jsxs)("div",{className:"relative flex items-center gap-3 px-4 bg-neutral-50 border-2 border-neutral-100 focus-within:border-[#FB233B] focu
1s-within:bg-white focus-within:shadow-md transition-all duration-300 rounded-2xl",children:[(0,r.jsx)(o.Z,{className:"w-5 h-5 text-neutral-400"}),(0,r.jsx)("input",{name:"search",ref:s,type:"text",placeholder:"What are you looking for?",value:l,onChange:e=>i(e.target.value),className:"w-full h-14 text-[16px] border-none outline-none bg-transparent placeholder:text-neutral-400 font-medium text-neutral-800"}),l.length>0&&(0,r.jsx)("button",{type:"button",onClick:()=>i(""),className:"flex items-center justify-center w-7 h-7 bg-neutral-200 text-neutral-500 rounded-full active:scale-90 active:bg-neutral-300 transition-all duration-200",children:(0,r.jsx)(U.Z,{className:"w-4 h-4",strokeWidth:2.5})})]})]})]})]})};let G=e=>{let{user:t,isMobileSearchOpen:n=!1,setIsMobileSearchOpen:s=()=>{}}=e,{wishlistCount:m}=(0,p.Ei)(),{uniqueCount:f}=(0,v.j)(),[b,w]=(0,a.useState)(0),[j,N]=(0,a.useState)(!1),[y,k]=(0,a.useState)(!1),[A,S]=(0,a.useState)(0),[E,C]=(0,a.useState)(64),R=a.useRef(null),Z=a.useRef(null),{searchQuery:T,setSearchQuery:L,clearSearch:B,data:P,isLoading:M,error:_}=O();return(0,a.useEffect)(()=>{let e=()=>{R.current&&S(R.current.offsetWidth)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,a.useEffect)(()=>{w(m)},[m]),(0,a.useEffect)(()=>{let e=Z.current;if(!e)return;let t=()=>{let t=Math.round(e.getBoundingClientRect().height);t>0&&C(e=>e===t?e:t)};if(t(),"undefined"!=typeof ResizeObserver){let n=new ResizeObserver(()=>t());return n.observe(e),()=>n.disconnect()}return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),(0,r.jsxs)("header",{className:"w-full bg-white",children:[(0,r.jsx)("div",{ref:Z,className:"md:hidden fixed top-0 left-0 right-0 z-[110] bg-white shadow-sm",children:(0,r.jsx)(g,{onMenuClick:()=>N(!0)})}),(0,r.jsx)("div",{className:"md:hidden",style:{height:E}}),(0,r.jsx)(I,{open:j,onClose:()=>N(!1)}),(0,r.jsx)(H,{open:n,onClose:()=>s(!1)}),(0,r.jsxs)("div",{className:"hidden gap-6 justify-between items-center px-4 pb-3 mx-auto md:flex md:pb-0 maxContainer md:gap-8 md:px-6",children:[(0,r.jsxs)("div",{className:"flex flex-1 gap-6 items-center",children:[(0,r.jsx)(l(),{onClick:()=>{x().push("/")},src:i.Z,alt:"Samu Giken",className:"h-[40px] w-auto md:h-[60px] cursor-pointer",priority:!0}),(0,r.jsx)("div",{className:"relative flex-1",children:(0,r.jsxs)("div",{className:"relative mx-auto w-4/5",children:[(0,r.jsx)("input",{ref:R,type:"text",placeholder:"Search",value:T,onChange:e=>{L(e.target.value),k(!0)},onFocus:()=>{T.length>0&&k(!0)},className:"h-8 w-full rounded-full border border-transparent bg-[#ededed] pl-8 pr-3 text-center text-[14px] outline-none placeholder:text-neutral-500 "}),(0,r.jsx)(o.Z,{size:18,className:"absolute left-4 top-1/2 -translate-y-1/2 cursor-pointer text-[#e73042] transition-all duration-300 hover:stroke-red-500"}),(0,r.jsx)(W,{visible:y,searchQuery:T,results:null==P?void 0:P.rows,isLoading:M,error:_,inputWidth:A,onClose:()=>{k(!1)},onProductClick:()=>{B(),k(!1)}})]})})]}),(0,r.jsxs)("div",{className:"hidden gap-6 items-center md:flex",children:[(0,r.jsxs)("div",{className:"relative cursor-pointer select-none text-neutral-700",onClick:()=>x().push("/wishlist"),"aria-label":"Wishlist",children:[(0,r.jsx)(c.Z,{className:"w-6 h-6 transition-all duration-300 hover:stroke-red-500"}),(0,r.jsx)("span",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full bg-red-600 text-[8px] font-semibold leading-none text-white",children:b})]}),(0,r.jsxs)("div",{className:"relative cursor-pointer select-none text-neutral-700",onClick:()=>x().push("/cart"),children:[(0,r.jsx)(u.Z,{className:"w-6 h-6 transition-all duration-300 hover:stroke-red-500"}),(0,r.jsx)("span",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full bg-red-600 text-[8px] font-semibold leading-none text-white",children:f})]}),(0,r.jsx)("div",{className:"relative cursor-pointer select-none text-neutral-700",onClick:()=>{t?x().push("/my-profile"):x().push("/login")},children:(0,r.jsx)(d.Z,{className:"w-6 h-6 transition-all duration-300 hover:stroke-red-500"})})]})]}),(0,r.jsx)(h.ZP,{})]})};var q=n(11436),K=n(91600),Y=n(49734),Q=n(15530),J=n(85304),X=n(54030),$=e=>{let{open:t,onClose:n}=e,{user:a}=(0,J.a)(),{isClaimed:s,isUsedUp:l,handleClaim:i,claimingRefId:o}=(0,Q.b)(!!a),{data:c,isLoading:u}=(0,R.a)({queryKey:["claimable-coupons"],queryFn:()=>(0,Y.tr)({limit:20}).then(e=>e.data),enabled:t,staleTime:6e4}),d=null==c?void 0:c.filter(e=>!l(e.refId));return(0,r.jsxs)("div",{className:(0,E.cn)("fixed inset-0 z-[130] md:hidden",!t&&"pointer-events-none"),"aria-hidden":!t,children:[(0,r.jsx)("div",{className:(0,E.cn)("absolute inset-0 transition-opacity duration-300 bg-black/40",t?"opacity-100":"opacity-0"),onClick:n}),(0,r.jsxs)("div",{className:(0,E.cn)("absolute bottom-0 left-0 right-0 flex max-h-[78vh] flex-col rounded-t-2xl bg-white shadow-2xl transition-transform duration-300",t?"translate-y-0":"translate-y-full"),role:"dialog","aria-modal":"true",children:[(0,r.jsxs)("div",{className:"pt-3",children:[(0,r.jsx)("div",{className:"mx-auto h-1.5 w-10 rounded-full bg-neutral-300"}),(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3",children:[(0,r.jsx)("h2",{className:"text-lg font-bold text-neutral-900",children:"Vouchers"}),(0,r.jsx)("button",{type:"button","aria-label":"Close",onClick:n,className:"bg-transparent border-none cursor-pointer text-neutral-500",children:(0,r.jsx)(U.Z,{className:"w-6 h-6"})})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 items-start justify-items-center gap-x-2 gap-y-4 overflow-y-auto px-3 pb-6",children:[u&&(0,r.jsx)("div",{className:"col-span-2 py-10 text-sm text-neutral-400",children:"Loadingâ¦"}),!u&&(!d||0===d.length)&&(0,r.jsx)("div",{className:"col-span-2 py-10 text-sm text-neutral-400",children:"No vouchers available right now"}),null==d?void 0:d.map(e=>(0,r.jsx)("div",{className:"[zoom:0.82] min-[400px]:[zoom:0.9]",children:(0,r.jsx)(X.Z,{coupon:e,claimed:s(e.refId),loading:o===e.refId,onClaim:()=>i(e.refId)})},e.refId))]})]})]})},ee=e=>{let{onSearchClick:t}=e,n=(0,m.useRouter)(),[s,l]=(0,a.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("nav",{className:"fixed bottom-0 left-0 right-0 z-[100] md:hidden bg-white border-t border-neutral-200 rounded-t-2xl shadow-xl",children:(0,r.jsx)("div",{className:"py-3 mx-auto maxContainer",children:(0,r.jsxs)("div",{className:"flex justify-evenly items-center text-[#e70342]",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1 items-center cursor-pointer",onClick:()=>{n.push("/")},children:[(0,r.jsx)("div",{className:"flex justify-center items-center w-6 h-6",children:(0,r.jsx)(q.Z,{className:"w-6 h-6"})}),(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase",children:"Home"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 items-center cursor-pointer",onClick:()=>{n.push("/my-profile")},children:[(0,r.jsx)("div",{className:"flex justify-center items-center w-6 h-6",children:(0,r.jsx)(d.Z,{className:"w-6 h-6"})}),(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase",children:"Profile"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 items-center cursor-pointer",onClick:t,children:[(0,r.jsx)("div",{className:"flex items-center justify-center w-10 h-10 bg-[#e70342] text-white rounded-full -mt-8 shadow-lg border-[3px] border-white",children:(0,r.jsx)(o.Z,{size:18})}),(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase mt-[-2px]",children:"Search"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 items-center cursor-pointer",onClick:()=>l(!0),children:[(0,r.jsx)("div",{className:"flex justify-center items-center w-6 h-6",children:(0,r.jsx)(K.Z,{className:"w-6 h-6"})}),(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase",children:"Voucher"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-1 items-center cursor-pointer",onClick:()=>{n.push("/my-profile?tab=warranties")},children:[(0,r.jsx)("div",{className:"flex justify-center items-center w-6 h-6",children:(0,r.jsx)(A.Z,{className:"w-6 h-6"})}),(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase",children:"Warranty"})]})]})})}),(0,r.jsx)($,{open:s,onClose:()=>l(!1)})]})},et=e=>{let{showBottomNav:t,whatsAppMobileBottomOffset:n,onSearchClick:s}=e,[o,c]=a.useState(0),u=(0,M.ac)("(max-width: 768px)",{defaultValue:!1,initializeWithValue:!1});return a.useEffect(()=>{let e=()=>{let e=window.scrollY,t=document.documentElement.scrollHeight-window.innerHeight;c(t>0?Math.min(1,Math.max(0,e/t)):0)};return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]),(0,r.jsxs)("footer",{className:"mt-16 bg-[#F7F7F7]",children:[(0,r.jsx)("div",{className:"flex justify-center items-center w-full md:mb-0 mb-18",children:(0,r.jsxs)("div",{className:"relative w-full maxContainer",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-10 px-8 pt-6 md:gap-10 md:pt-10 lg:flex-row lg:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(l(),{src:i.Z,alt:"Samu Giken",className:"h-[60px] w-auto md:h-[70px] cursor-pointer ml-[-12px]",priority:!0}),(0,r.jsx)("p",{className:"text-[12px] md:text-[15px] font-medium text-black",children:"Samu Giken Malaysia Sdn. Bhd. (1309780-V)"}),(0,r.jsx)("p",{className:"mt-4 text-[12px] md:text-[15px] font-medium text-[#e73042]",children:"Redefining Affordable Luxury"}),(0,r.jsxs)("p",{className:"text-[10px] md:text-[14px] text-black",children:["Introduce luxury into your lifestyle ",(0,r.jsx)("br",{})," without busting your budget."]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-8 md:gap-30 md:flex-row",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"md:text-[20px] text-[14px] font-semibold text-black",children:"NAVIGATION"}),(0,r.jsx)("ul",{className:"pl-0 mt-3 md:mt-6 md:space-y-3 space-y-2 md:text-[15px] text-[12px] text-black",children:[{label:"About Us",href:"/about-us"},{label:"Contact Us",href:"/contact-us"},{label:"Our Partners",href:"/our-partners"},{label:"Collection",href:"/collections"},{label:"Blog",href:"/blog"}].map(e=>{let{label:t,href:n}=e;return(0,r.jsx)("li",{className:"list-none",children:(0,r.jsx)(D(),{href:n,className:"no-underline text-black transition-colors hover:text-[#e73042]",children:t})},t)})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"md:text-[20px] text-[14px] font-semibold text-black",children:"INFORMATION"}),(0,r.jsx)("ul",{className:"pl-0 mt-3 md:mt-6 md:space-y-3 space-y-2 md:text-[15px] text-[12px] text-black",children:[{label:"Terms & Conditions",href:"/terms-and-conditions"},{label:"Privacy & Policy",href:"/privacy-policy"},{label:(0,r.jsxs)(r.Fragment,{children:["Shipping/ Return/",(0,r.jsx)("br",{})," Refund Policy"]}),href:"/warranty-shipping-return-refund-policies"}].map(e=>{let{label:t,href:n}=e;return(0,r.jsx)("li",{className:"list-none",children:(0,r.jsx)(D(),{href:n,className:"no-underline text-black transition-colors hover:text-[#e73042]",children:t})},t.toString())})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"md:text-[20px] text-[14px] font-semibold text-black",children:"WARRANTY"}),(0,r.jsx)("ul",{className:"pl-0 mt-3 md:mt-6 md:space-y-3 space-y-2 md:text-[15px] text-[12px] text-black",children:[{label:"Warranty Registration",href:"/my-profile?tab=warranties"},{label:"Warranty Policy",href:"/warranty-shipping-return-refund-policies"}].map(e=>{let{label:t,href:n}=e;return(0,r.jsx)("li",{className:"list-none",children:(0,r.jsx)(D(),{href:n,className:"no-underline text-black transition-colors hover:text-[#e73042]",children:t})},t)})})]})]})]}),(0,r.jsx)("div",{className:"mx-8",children:(0,r.jsx)("hr",{className:"mt-4 mb-6 w-full md:mb-10"})}),(0,r.jsxs)("div",{className:"flex flex-col gap-4 justify-between px-8 pb-6 md:items-center md:flex-row",children:[(0,r.jsxs)("p",{className:"md:text-[13px] text-[12px] text-black",children:["\xa9 ",new Date().getFullYear()," Samu Giken\xa0\xa0|\xa0\xa0All Rights Reserved."]}),(0,r.jsxs)("div",{className:"flex gap-4 items-center",children:[(0,r.jsx)("a",{href:"https://www.facebook.com/samugiken","aria-label":"facebook",className:"transition-opacity hover:opacity-80",target:"_blank",rel:"noreferrer",children:(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 320 512",xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-[#e73042]",fill:"currentColor",children:(0,r.jsx)("path",{d:"M279.14 288l14.22-92.66h-88.91v
1-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"})})}),(0,r.jsx)("a",{href:"https://www.tiktok.com/@samugiken","aria-label":"tiktok",className:"transition-opacity hover:opacity-80",target:"_blank",rel:"noreferrer",children:(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 448 512",xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-[#e73042]",fill:"currentColor",children:(0,r.jsx)("path",{d:"M448,209.91a210.06,210.06,0,0,1-122.77-39.25V349.38A162.55,162.55,0,1,1,185,188.31V278.2a74.62,74.62,0,1,0,52.23,71.18V0l88,0a121.18,121.18,0,0,0,1.86,22.17h0A122.18,122.18,0,0,0,381,102.39a121.43,121.43,0,0,0,67,20.14Z"})})}),(0,r.jsx)("a",{href:"https://www.youtube.com/@hellosamugiken2753","aria-label":"youtube",className:"transition-opacity hover:opacity-80",target:"_blank",rel:"noreferrer",children:(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 576 512",xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-[#e73042]",fill:"currentColor",children:(0,r.jsx)("path",{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"})})}),(0,r.jsx)("a",{href:"https://www.instagram.com/samugiken","aria-label":"instagram",className:"transition-opacity hover:opacity-80",target:"_blank",rel:"noreferrer",children:(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 448 512",xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-[#e73042]",fill:"currentColor",children:(0,r.jsx)("path",{d:"M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"})})})]})]}),(0,r.jsx)("a",{href:"https://wa.me/60123366726",className:"fixed right-4 bottom-4 z-[103] flex h-14 w-14 items-center justify-center rounded-full bg-[#25d366] text-white shadow-lg cursor-pointer transition-transform duration-500 hover:scale-110 md:mb-0","aria-label":"WhatsApp",target:"_blank",rel:"noreferrer",style:{bottom:u?n:void 0},children:(0,r.jsxs)("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"w-8 h-8",fill:"currentColor",children:[(0,r.jsx)("title",{children:"WhatsApp"}),(0,r.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"})]})})]})}),t&&(0,r.jsx)(ee,{onSearchClick:s})]})},en=e=>{var t;let{children:n,user:s,showBottomNav:l=!0,whatsAppMobileBottomOffset:i=80}=e,[o,c]=a.useState(!1);return(0,r.jsx)(J.H,{user:s,children:(0,r.jsx)(v.Z,{children:(0,r.jsx)(p.TN,{children:(0,r.jsxs)("div",{className:"flex flex-col justify-between min-h-screen bg-white",children:[(0,r.jsxs)("div",{children:[(null==s?void 0:null===(t=s.role.accessRights.DASHBOARD)||void 0===t?void 0:t.READ)&&(0,r.jsx)("div",{className:"p-1 bg-red-500",children:(0,r.jsx)(D(),{href:"/admin/dashboard",className:"font-semibold text-white no-underline",children:"Admin Dashboard"})}),(0,r.jsx)(G,{user:s,isMobileSearchOpen:o,setIsMobileSearchOpen:c}),(0,r.jsx)("main",{children:n})]}),(0,r.jsx)(et,{showBottomNav:l,whatsAppMobileBottomOffset:i,onSearchClick:()=>c(!0)})]})})})})}},30774:function(e,t,n){n.d(t,{e9:function(){return d}});var r=n(52676),a=n(75271),s=n(33561),l=n(32623),i=n.n(l),o=n(99764),c=n(72626),u=n(22903);let d={[o.xw.BEST_SELLER]:"Best Seller",[o.xw.NEW_ARRIVAL]:"New Arrival","baby-and-mummy":"Baby & Mummy","kitchen-appliances":"Kitchen Appliances","home-appliances":"Home Appliances","beauty-and-health":"Beauty & Health"},m={"baby-and-mummy":[{label:"Baby Feeding",value:"baby-feeding"},{label:"Baby Adventure (Travel)",value:"baby-adventure-(travel)"},{label:"Sweet Slumber Collection",value:"sweet-slumber-collection"},{label:"Baby Hygeine Helper",value:"baby-hygeine-helper"},{label:"Baby Safety",value:"baby-safety"},{label:"Baby Dining",value:"baby-dining"}],"kitchen-appliances":[{label:"Barista Choice",value:"barista-choice"},{label:"Quick Serve",value:"quick-serve"},{label:"Multi Function Kitchenware",value:"multi-function-kitchenware"},{label:"Travelling",value:"travelling"},{label:"Power Track",value:"power-track"}],"home-appliances":[{label:"Air Care",value:"air-care"},{label:"Household Essentials",value:"household-essentials"},{label:"Power Track",value:"power-track"}],"beauty-and-health":[{label:"Oral Hygeine",value:"oral-hygeine"},{label:"Hair Care",value:"hair-care"},{label:"Skin Care",value:"skin-care"}]},x=e=>{let t=e.filter(e=>{var t,n;return(null!==(n=null===(t=e.children)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>0});d[o.xw.BEST_SELLER]="Best Seller",d[o.xw.NEW_ARRIVAL]="New Arrival",Object.keys(d).forEac
1h(e=>{e!==o.xw.BEST_SELLER&&e!==o.xw.NEW_ARRIVAL&&delete d[e]}),t.forEach(e=>{d[e.slug]=e.name}),Object.keys(m).forEach(e=>{delete m[e]}),t.forEach(e=>{var t;m[e.slug]=(null!==(t=e.children)&&void 0!==t?t:[]).map(e=>({label:e.name,value:e.slug}))})};t.ZP=()=>{var e,t;let n=(0,s.useRouter)(),[l,d]=(0,a.useState)(null),[m,h]=(0,a.useState)([]),[p,f]=(0,a.useState)("idle"),[v,g]=(0,a.useState)(!1),b=(0,a.useRef)(null),w=(0,a.useRef)(null),j=(0,a.useRef)(null),N=(0,a.useRef)(0),y=(0,a.useRef)(null),[k,A]=(0,a.useState)(0),S=(0,a.useCallback)(()=>{b.current&&(clearTimeout(b.current),b.current=null)},[]),E=(0,a.useCallback)(()=>{S(),f("leave"),b.current=setTimeout(()=>{d(null),f("idle"),b.current=null},200)},[S]),C=(0,a.useCallback)(()=>{S(),b.current=setTimeout(()=>{E()},100)},[S,E]),I=e=>{S(),f("enter"),d(e)},R=(e,t)=>{n.push({pathname:t,query:{product:e}},void 0,{shallow:!1}),E()},Z=e=>{if(v)return"font-manrope font-medium text-[14px] whitespace-nowrap bg-transparent border-none transition-opacity duration-200 cursor-pointer text-white hover:opacity-80";let t=n.query.product,r=Array.isArray(t)?t[0]:t,a=e&&l===e;return"font-manrope font-medium text-[14px] whitespace-nowrap bg-transparent border-none transition-colors duration-200 cursor-pointer ".concat(a||e&&r===e?"text-[#e73042]":"hover:text-[#e73042]")};(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await (0,c.Yc)();if(!e)return;let n=Array.isArray(t.data)?t.data:[];h(n),x(n)}catch(t){if(!e)return;h([])}})(),()=>{e=!1}},[]);let T=(0,a.useMemo)(()=>m.filter(e=>{var t,n;return(null!==(n=null===(t=e.children)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>0}),[m]),L=(0,a.useMemo)(()=>l?T.find(e=>e.slug===l):void 0,[l,T]);return(0,a.useEffect)(()=>()=>S(),[S]),(0,a.useEffect)(()=>{if(j.current){let e=j.current.getBoundingClientRect();N.current=e.top+window.scrollY}let e=()=>{g(window.scrollY>=N.current)};return e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[]),(0,a.useEffect)(()=>{let e=()=>A(y.current?y.current.offsetHeight:0);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,r.jsx)("div",{className:"w-full bg-[#F3F3F3] md:block hidden",children:(0,r.jsxs)("div",{className:"relative",ref:j,children:[(0,r.jsxs)("nav",{ref:y,className:"".concat(v?"fixed top-0 right-0 left-0 text-white bg-[#e73042] z-[102] sg-sticky-enter":"text-neutral-800"," flex overflow-x-auto md:overflow-visible overflow-y-visible gap-6 justify-center items-center px-4 py-3 text-[14px] md:gap-10 md:px-6 flex-wrap"),onMouseLeave:e=>{let t=e.relatedTarget;if(w.current&&t instanceof Node&&w.current.contains(t)){S();return}E()},onMouseMove:e=>{l&&(e.target.closest('[data-dropdown="true"]')||C())},children:[(0,r.jsx)("button",{className:"".concat(Z(o.xw.BEST_SELLER)," ").concat(v?"font-medium text-white whitespace-nowrap bg-transparent border-none transition-opacity duration-200 cursor-pointer font-manrope text-[14px] hover:opacity-80":"font-medium whitespace-nowrap bg-transparent border-none transition-colors duration-200 cursor-pointer font-manrope text-[14px] hover:text-[#e73042]"),onMouseEnter:C,onClick:()=>{R(o.xw.BEST_SELLER,"/collections/best-seller")},children:"Best Seller"}),(0,r.jsx)("button",{className:"".concat(Z(o.xw.NEW_ARRIVAL)," ").concat(v?"font-medium text-white whitespace-nowrap bg-transparent border-none transition-opacity duration-200 cursor-pointer font-manrope text-[14px] hover:opacity-80":"font-medium whitespace-nowrap bg-transparent border-none transition-colors duration-200 cursor-pointer font-manrope text-[14px] hover:text-[#e73042]","\n "),onMouseEnter:C,onClick:()=>{R(o.xw.NEW_ARRIVAL,"/collections/new-arrival")},children:"New Arrivals"}),T.map(e=>(0,r.jsx)("div",{className:"relative",children:(0,r.jsxs)("button",{className:"".concat(Z(e.slug)," text-[14px]"),onMouseEnter:()=>I(e.slug),onClick:()=>{R(e.slug,"/categories/".concat(e.slug))},"data-dropdown":"true",children:[e.name," ",(0,r.jsx)("span",{className:"ml-1",children:"â¾"})]})},e.refId))]}),l&&(0,r.jsx)("div",{className:"".concat(v?"fixed right-0 left-0 z-[101]":"absolute right-0 left-0 top-full z-[101]"," ").concat("enter"===p?"sg-dropdown-enter":"leave"===p?"sg-dropdown-leave":""," ").concat("leave"===p?"pointer-events-none":""),style:v?{top:k}:void 0,ref:w,children:(0,r.jsx)("div",{className:"mx-auto w-[1040px] max-w-[90vw] rounded-md bg-white shadow-2xl",onMouseEnter:S,onMouseLeave:E,children:(0,r.jsxs)("div",{className:"grid grid-cols-12",children:[(0,r.jsx)("div",{className:"col-span-5 border-r border-neutral-200",children:(0,r.jsx)("div",{className:"max-h-[410px] overflow-y-auto no-scrollbar",children:(null!==(e=null==L?void 0:L.children)&&void 0!==e?e:[]).map(e=>(0,r.jsx)("div",{onClick:()=>R(l,"/categories/".concat(l,"/").concat(e.slug)),className:"px-5 py-5 text-[14px] curs
1or-pointer hover:bg-neutral-50 hover:text-[#e73042] border-b border-neutral-200",children:e.name},e.refId))})}),(0,r.jsx)("div",{className:"col-span-7 p-1",children:(0,r.jsx)("div",{className:"grid grid-cols-1 gap-1",children:(null!==(t=null==L?void 0:L.banners)&&void 0!==t?t:[]).map(e=>{let t=(0,r.jsx)("div",{className:"relative h-[180px] w-full overflow-hidden rounded-md",children:(0,r.jsx)(i(),{src:(0,u.I)(e.key),alt:"Promo",fill:!0,className:"object-cover",sizes:"(max-width: 768px) 100vw, 50vw",priority:!0})},e.refId);return e.link?(0,r.jsx)("a",{href:e.link,className:"block",children:t},e.refId):t})})})]})})})]})})}},5409:function(e,t,n){n.d(t,{J:function(){return i}});var r=n(15989),a=n(39771),s=n(91340);let l=r.Z.create({baseURL:a.T5+"/api",headers:{"Content-Type":"application/json"},withCredentials:!0});l.interceptors.request.use(e=>{if((0,s.rD)()){let t=(0,s.Zd)();t&&(e.headers=e.headers||{},e.headers["x-session-id"]=t)}else e.headers&&e.headers["x-session-id"]&&delete e.headers["x-session-id"];return e});let i=r.Z.create({baseURL:a.T5+"/api",headers:{"Content-Type":"multipart/form-data"},maxContentLength:1/0,maxBodyLength:1/0,withCredentials:!0});t.Z=l},15530:function(e,t,n){n.d(t,{b:function(){return u}});var r=n(75271),a=n(33561),s=n(69947),l=n(69834),i=n(71030),o=n(76517),c=n(49734);function u(e){var t;let n=(0,a.useRouter)(),u=(0,s.NL)(),[d,m]=(0,r.useState)(new Set),{data:x}=(0,l.a)({queryKey:["claimed-coupons"],queryFn:()=>(0,c.q7)().then(e=>e.data),enabled:e,staleTime:6e4}),h=(0,r.useMemo)(()=>new Set((null!=x?x:[]).map(e=>e.refId)),[x]),p=e=>h.has(e)||d.has(e),f=(0,r.useMemo)(()=>new Set((null!=x?x:[]).filter(e=>e.unavailable).map(e=>e.refId)),[x]),v=(0,i.D)({mutationFn:e=>(0,c.w0)(e),onSuccess:(e,t)=>{m(e=>new Set(e).add(t)),u.invalidateQueries({queryKey:["claimed-coupons"]}),o.Am.success("Voucher claimed! Find it at checkout.")},onError:e=>{var t,n;let r=(null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message)||(null==e?void 0:e.message)||"Failed to claim voucher";o.Am.error(r)}});return{isClaimed:p,isUsedUp:e=>f.has(e),handleClaim:t=>{if(!e){o.Am.info("Please log in to claim this voucher"),n.push("/login");return}p(t)||v.isPending||v.mutate(t)},claimingRefId:v.isPending&&null!==(t=v.variables)&&void 0!==t?t:null}}},85304:function(e,t,n){n.d(t,{H:function(){return x},a:function(){return h}});var r=n(52676),a=n(75271),s=n(76517),l=n(73414),i=n(71030),o=n(83214),c=n(62581),u=n(69504),d=n(91340);let m=(0,a.createContext)(null),x=e=>{let{children:t,user:n}=e,x=(0,l.useRouter)(),{mutate:h}=(0,i.D)({mutationFn:u.kS,onError:e=>s.Am.error((0,o._g)(e)),onSuccess:()=>{x.push(c.Z.LOGIN)}});return(0,a.useEffect)(()=>{n?(0,d.hv)():(0,d.wN)()},[n]),(0,r.jsx)(m.Provider,{value:{user:n,logout:h},children:t})},h=()=>{let e=(0,a.useContext)(m);if(!e)throw Error("useAuth must be used within a AuthProvider");return e}},5317:function(e,t,n){n.d(t,{Z:function(){return d},j:function(){return m}});var r=n(52676),a=n(75271),s=n(69834),l=n(71030),i=n(57285),o=n(91340),c=n(85304);let u=(0,a.createContext)(null),d=e=>{var t;let{children:n}=e,{user:d}=(0,c.a)(),[m,x]=(0,a.useState)(!1);(0,a.useEffect)(()=>{x(!0)},[]);let h=(0,s.a)({queryKey:["cart",null==d?void 0:d.id],queryFn:i.dv,select:e=>e.data,enabled:m}),{mutate:p,mutateAsync:f,isPending:v}=(0,l.D)({mutationKey:["cart","add"],mutationFn:i._7,onSuccess:()=>h.refetch()}),{mutate:g,isPending:b}=(0,l.D)({mutationKey:["cart","update"],mutationFn:e=>{let{refId:t,quantity:n}=e;return(0,i.bd)(t,n)},onSuccess:()=>h.refetch()}),{mutate:w,isPending:j}=(0,l.D)({mutationKey:["cart","remove"],mutationFn:i.B8,onSuccess:()=>h.refetch()});(0,a.useEffect)(()=>{if(m){if(null==d?void 0:d.id){let e=localStorage.getItem("session_id")||void 0;(0,i.R4)(e).then(()=>h.refetch())}else(0,o.Zd)()}},[null==d?void 0:d.id,m]);let N=(0,a.useMemo)(()=>{var e;return new Set(((null===(e=h.data)||void 0===e?void 0:e.items)||[]).map(e=>{var t,n;return e.product.refId+(null!==(n=null===(t=e.variation)||void 0===t?void 0:t.refId)&&void 0!==n?n:"")})).size},[h.data]),y=async(e,t,n)=>{await f({productRefId:e,variationRefId:t,quantity:n})};return(0,r.jsx)(u.Provider,{value:{uniqueCount:N,items:(null===(t=h.data)||void 0===t?void 0:t.items)||[],refresh:()=>h.refetch(),addToCart:(e,t,n)=>{p({productRefId:e,variationRefId:t,quantity:n})},addToCartAsync:y,updateItem:(e,t)=>
1{g({refId:e,quantity:t})},removeItem:e=>{w(e)},loading:v||b||j||h.isFetching,addingToCart:v},children:n})},m=()=>{let e=(0,a.useContext)(u);if(!e)throw Error("useCart must be used within CartProvider");return e}},99764:function(e,t,n){var r,a,s,l,i,o,c,u;n.d(t,{Pt:function(){return r},kv:function(){return a},uN:function(){return l},xw:function(){return s}}),(i=r||(r={})).PUBLISHED="PUBLISHED",i.UNPUBLISHED="UNPUBLISHED",(o=a||(a={})).SIMPLE="SIMPLE",o.VARIABLE="VARIABLE",(c=s||(s={})).BEST_SELLER="BEST_SELLER",c.NEW_ARRIVAL="NEW_ARRIVAL",(u=l||(l={})).YOUTUBE="YOUTUBE",u.INSTAGRAM="INSTAGRAM",u.TIKTOK="TIKTOK"},89415:function(e,t,n){n.d(t,{Cw:function(){return d},Ei:function(){return h},TN:function(){return x}});var r=n(52676),a=n(75271),s=n(76517),l=n(69947),i=n(69834),o=n(71030),c=n(85304),u=n(87213);let d="wishlistProductIds",m=(0,a.createContext)(null),x=e=>{let{children:t}=e,{user:n}=(0,c.a)(),[,x]=(0,a.useState)(0),h=(0,l.NL)(),p=(0,i.a)({queryKey:["wishlist","full",null==n?void 0:n.id],queryFn:u.us,select:e=>e.data,enabled:!!(null==n?void 0:n.id)}),{mutate:f,isPending:v}=(0,o.D)({mutationKey:["addWishlistProduct"],mutationFn:u.PQ}),{mutate:g,isPending:b}=(0,o.D)({mutationKey:["removeWishlistProduct"],mutationFn:u.Ok});(0,a.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem(d)||"[]");if(!n||!Array.isArray(e)||0===e.length)return;f(e,{onSuccess:()=>{j(),h.invalidateQueries({queryKey:["wishlist"]})}})}catch(e){}},[f,n,h]);let w=()=>{var e,t;if(n)return null!==(t=null===(e=p.data)||void 0===e?void 0:e.length)&&void 0!==t?t:0;try{let e=JSON.parse(localStorage.getItem(d)||"[]");return Array.isArray(e)?e.length:0}catch(e){return 0}},j=()=>{localStorage.removeItem(d)};return(0,a.useEffect)(()=>{let e=e=>{e.key===d&&x(e=>e+1)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[]),(0,r.jsx)(m.Provider,{value:{addToWishlist:(e,t)=>{if(n){f([e],{onSuccess:()=>{var e;p.refetch(),null==t||null===(e=t.onSuccess)||void 0===e||e.call(t)}});return}try{var r;let n=JSON.parse(localStorage.getItem(d)||"[]");Array.isArray(n)?(n.includes(e)||n.push(e),localStorage.setItem(d,JSON.stringify(n))):localStorage.setItem(d,JSON.stringify([e])),null==t||null===(r=t.onSuccess)||void 0===r||r.call(t),x(e=>e+1)}catch(e){s.Am.error("Something went wrong, please try again.")}},removeFromWishlist:(e,t)=>{if(n){g(e,{onSuccess:()=>{var e;p.refetch(),null==t||null===(e=t.onSuccess)||void 0===e||e.call(t)}});return}try{var r;let n=JSON.parse(localStorage.getItem(d)||"[]");if(Array.isArray(n)){let t=n.filter(t=>t!==e);localStorage.setItem(d,JSON.stringify(t))}else localStorage.setItem(d,JSON.stringify([]));null==t||null===(r=t.onSuccess)||void 0===r||r.call(t),x(e=>e+1)}catch(e){s.Am.error("Something went wrong, please try again.")}},loading:v||b,checkWishListCount:w,checkIsInWishlist:e=>{var t,r;if(n)return null!==(r=null===(t=p.data)||void 0===t?void 0:t.some(t=>t.product.refId===e))&&void 0!==r&&r;try{let t=JSON.parse(localStorage.getItem(d)||"[]");return!!Array.isArray(t)&&t.includes(e)}catch(e){return!1}},wishlistCount:w()},children:t})},h=()=>{let e=(0,a.useContext)(m);if(!e)throw Error("useWishlist must be used within a WishlistProvider");return e}},69504:function(e,t,n){n.d(t,{A9:function(){return c},IU:function(){return s},c0:function(){return o},kS:function(){return l},o9:function(){return i},x4:function(){return a}});var r=n(5409);let a=async e=>r.Z.post("/auth/login",e),s=async e=>r.Z.post("/auth/signup",e),l=async()=>r.Z.post("/auth/logout"),i=async e=>r.Z.post("/auth/forget-password",e),o=async e=>r.Z.post("/auth/password-reset/confirm",e),c=async e=>r.Z.post("/auth/verify-user",e)},57285:function(e,t,n){n.d(t,{B8:function(){return i},R4:function(){return o},_7:function(){return s},bd:function(){return l},dv:function(){return a},ir:function(){return c}});var r=n(5409);async function a(){return r.Z.get("/cart")}async function s(e){return r.Z.post("/cart/items",e)}async function l(e,t){return r.Z.patch("/cart/items/".concat(e),{quantity:t})}async function i(e){return r.Z.delete("/cart/items/".concat(e))}async function o(e){return r.Z.post("/cart/sync",e?{sessionId:e}:{})}async function c(){return r.Z.post("/cart/validate")}},49734:function(e,t,n){n.d(t,{hD:function(){return a},q7:function(){return o},tr:function(){return l},w0:function(){return i},y6:function(){return s},yq:function(){return c}});var r=n(5409);async function a(e){return r.Z.post("/checkout/coupons/validate",e)}async function s(e){return r.Z.get("/checkout/coupons/available",{params:e})}async function l(e){return r.Z.get("/checkout/coupons/claimable",{params:e})}async function i(e){return r.Z.post("/checkout/coupons/".concat(e,"/claim"))}async function o(){return r.Z.get("/checkout/coupons/claimed")}async function c(e){return r.Z.post("/checkout/coupons/calculate",e)}},72626:function(e,t,n){n.d(t,{PA:function(){return a},Yc:function(){return s},lq:function(){return l},vd:function(){return i}});var r=n(5409);let a=()=>r.Z.get("admin/option/category"),s=()=>r.Z.get("option/categories/tree"),l=e=>r.Z.get("option/categories/children",{params:e?{parentId:e}:void 0}),i=(e,t)=>r.Z.get("option/products",{params:{productType:e,search:t}})},39936:function(e,t,n){n.d(t,{Bz:function(){return a},Ir:function(){return d},Lv:function(){return u},gk:function(){return i},iT:function(){return l},jw:function(){return s},nM:function(){return c},ry:function(){return o}});var r=n(5409);let a=e=>r.Z.get("/products",{params:e}),s=e=>r.Z.get("/admin/product",{params:e}),l=e=>{let{refId:t,isPublished:n}=e;return r.Z.get("/products/".concat(t),{params:{isPublished:n}})},i=e=>r.Z.get("/admin/product/".concat(e.id)),o=e=>r.Z.post("/admin/product",e),c=e=>r.Z.put("/admin/product/".concat(e.id),e),u=e=>r.Z.put("/admin/product/".concat(e.id,"/status"),e),d=e=>r.Z.delete("/admin/product/".concat(e.id))},87213:function(e,t,n){n.d(t,{Ok:function(){return i},PQ:function(){return l},Qq:function(){return s},nT:function(){return a},us:function(){return o}});var r=n(5409);let a=e=>r.Z.get("/wishlist",{params:e}),s=e=>r.Z.get("/wishlist/mine",{params:e}),l=e=>r.Z.post("/wishlist",{productIds:e}),i=e=>r.Z.put("/wishlist",{productId:e}),o=()=>r.Z.get("/wishlist/full")},62581:function(e,t,n){var r,a;n.d(t,{Z:function(){return r}}
1),(a=r||(r={})).LOGIN="/login",a.ADMIN_DASHBOARD="/admin/dashboard",a.HOME="/",a.USER="/admin/user",a.ROLE="/admin/role",a.NEW_ROLE="/admin/role/new",a.SYSTEM_CONFIG="/admin/system-config",a.PRODUCT="/admin/product",a.BLOG="/admin/blog",a.ORDER="/admin/order",a.ABANDONMENT="/admin/abandonment",a.WARRANTY_REGISTER="/admin/warranty-register",a.WARRANTY_CLAIM="/admin/warranty-claim",a.COUPON="/admin/coupon",a.OUR_PARTNERS="/admin/our-partners",a.REVIEW="/admin/review",a.CONTENT_BANNER="/admin/content/banners",a.CONTENT_REVIEW="/admin/content/reviews",a.CONTENT_VIDEO="/admin/content/videos",a.CONTENT_POPUP="/admin/content/popups"},94170:function(e,t,n){var r,a,s,l,i,o,c,u,d,m;n.d(t,{As:function(){return s},fH:function(){return l},hY:function(){return a}}),(o=r||(r={})).EN="en",o.ZH_HK="zh-HK",(c=a||(a={})).LOGIN="login",c.FORGET_PASSWORD="forget_password",c.SIGNUP="signup",(u=s||(s={})).ASC="asc",u.DESC="desc",(d=l||(l={})).VERIFIED="VERIFIED",d.PENDING_FOR_VERIFICATION="PENDING_FOR_VERIFICATION",d.VERIFICATION_EXPIRED="VERIFICATION_EXPIRED",(m=i||(i={})).ADMIN="Admin",m.CUSTOMER="Customer"},83214:function(e,t,n){n.d(t,{_g:function(){return s},i$:function(){return l}});var r=n(52043),a=n.n(r);let s=e=>{if("response"in e){var t,n;return null===(n=e.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message}return e.message},l=(e,t)=>{let n=a()(e);return e&&n.isValid()?a()(e).format("DD MMM YYYY, hh:mm a"):t||null}},22903:function(e,t,n){n.d(t,{B:function(){return a},I:function(){return r}});let r=e=>"".concat("https://cdn.samugiken.com","/").concat("production","/").concat(encodeURIComponent(e)),a=e=>"".concat("https://cdn.samugiken.com","/").concat("production","/").concat(encodeURIComponent(e))},48588:function(e,t,n){n.d(t,{w:function(){return r}});let r=(e,t)=>"".concat("https://samugiken.com","/product/").concat(e,"/").concat(t)},91340:function(e,t,n){n.d(t,{Zd:function(){return s},hv:function(){return i},rD:function(){return o},wN:function(){return l}});let r="session_id",a="session_header_enabled";function s(){try{let e=localStorage.getItem(r);if(e&&e.length>0)return e;let t="undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():c();return localStorage.setItem(r,t),t}catch(e){return c()}}function l(){try{localStorage.setItem(a,"1")}catch(e){}}function i(){try{localStorage.setItem(a,"0"),localStorage.removeItem(r)}catch(e){}}function o(){try{return"1"===localStorage.getItem(a)}catch(e){return!1}}function c(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}}]);
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.