1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[80],{18238:function(e,t,r){"use strict";var l,s=r(67294);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)({}).hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(null,arguments)}t.Z=function(e){return s.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),l||(l=s.createElement("path",{fill:"#2E3C2E",fillRule:"evenodd",d:"M.667 8a7.333 7.333 0 1 1 14.667 0A7.333 7.333 0 0 1 .667 8M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2m0 5.333c.369 0 .667.298.667.666v2.667a.667.667 0 1 1-1.333 0V7.999c0-.368.298-.666.666-.666m0-1.334a.667.667 0 1 0 0-1.333.667.667 0 0 0 0 1.333",clipRule:"evenodd"})))}},55835:function(e,t,r){"use strict";var l,s,n=r(67294);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)({}).hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(null,arguments)}t.Z=function(e){return n.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),l||(l=n.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m11.797 9.713-1.124 3.933a.83.83 0 0 1-.8.603H6.128a.834.834 0 0 1-.801-.604L4.205 9.714a1.66 1.66 0 0 1 .977-2.005 7.6 7.6 0 0 1 5.637 0 1.66 1.66 0 0 1 .978 2.005"})),s||(s=n.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m6.318 7.357.402-5.223a.417.417 0 0 1 .418-.384h1.729a.417.417 0 0 1 .415.385l.401 5.222"})))}},62847:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/kremek/[slug]",function(){return r(23875)}])},83364:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});/** 2 * @license lucide-react v0.314.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */let l=(0,r(64370).Z)("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},49203:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});/** 7 * @license lucide-react v0.314.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */let l=(0,r(64370).Z)("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},85865:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});/** 12 * @license lucide-react v0.314.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */let l=(0,r(64370).Z)("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},44954:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});/** 17 * @license lucide-react v0.314.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */let l=(0,r(64370).Z)("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]])},26848:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});/** 22 * @license lucide-react v0.314.0 - ISC 23 * 24 * This source code is licensed under the ISC license. 25 * See the LICENSE file in the root directory of this source tree. 26 */let l=(0,r(64370).Z)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},53585:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});/** 27 * @license lucide-react v0.314.0 - ISC 28 * 29 * This source code is licensed under the ISC license. 30 * See the LICENSE file in the root directory of this source tree. 31 */let l=(0,r(64370).Z)("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]])},68453:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});/** 32 * @license lucide-react v0.314.0 - ISC 33 * 34 * This source code is licensed under the ISC license. 35 * See the LICENSE file in the root directory of this source tree. 36 */let l=(0,r(64370).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},97647:function(e,t,r){"use strict";r.d(t,{EA:function(){return u},FD:function(){return x},W5:function(){return h},sd:function(){return j},xt:function(){return f}});
36var l=r(30202),s=r(98029),n=r(92214),i=r(98493),a=r(2472),o=r(6815),c=r(98807);let d=async e=>{var t;if(!await (0,c.getAccessToken)())throw Error("No token");let r={title:e.title,type:"collection",is_private:null===(t=e.isPrivate)||void 0===t||t,products:e.products},l=await n.h.post("/shelf",r);return(0,a.JH)(l)},u=()=>{let e=(0,l.NL)();return(0,s.D)({mutationKey:[...o.l.me],mutationFn:d,onSuccess:()=>{e.invalidateQueries({queryKey:o.l.profile})},onError:a.pE})},m=async e=>{if(!await (0,c.getAccessToken)())throw Error("No token");let t=await n.h.post("/shelf/".concat(e.collectionId),{products:e.products});return(0,a.JH)(t)},x=()=>(0,s.D)({mutationKey:[...o.l.collections],mutationFn:m,onSuccess:()=>{},onError:a.pE}),p=async e=>{if(!e.productUuid)throw Error("No productUuid");if(!e.shelfId)throw Error("No shelfId");let{shelfId:t,productUuid:r}=e;await (0,i.S)();let l=await n.h.delete("/shelf/".concat(t,"/").concat(r));return(0,a.JH)(l)},h=()=>{let e=(0,l.NL)();return(0,s.D)({mutationKey:[...o.l.collections],mutationFn:p,onSuccess:()=>{e.invalidateQueries({queryKey:o.l.collections})},onError:a.pE})},g=async e=>{if(!await (0,c.getAccessToken)())throw Error("No token");let{collectionId:t}=e;try{return(await n.h.delete("/shelf/".concat(t),{data:{}})).data}catch(e){throw e}},f=()=>{let e=(0,l.NL)();return(0,s.D)({mutationKey:[...o.l.me],mutationFn:g,onSuccess:()=>{e.invalidateQueries({queryKey:[...o.l.profile]})},onError:a.pE})},v=async e=>{if(!await (0,c.getAccessToken)())throw Error("No token");let t=await n.h.patch("/shelf/".concat(e.collectionId),{title:e.collectionName});return(0,a.JH)(t)},j=()=>{let e=(0,l.NL)();return(0,s.D)({mutationKey:o.l.collections,mutationFn:v,onSuccess:()=>{e.invalidateQueries({queryKey:o.l.collections})},onError:a.pE})}},54622:function(e,t,r){"use strict";r.d(t,{Wb:function(){return p},qd:function(){return x}});var l=r(30202),s=r(98029),n=r(20052),i=r(7978),a=r(82583),o=r(92214),c=r(98493),d=r(2472),u=r(6815);async function m(e){if(null==e)throw Error("Review id is required");await (0,c.S)();let t=await o.h.post("/reviews/".concat(e,"/vote"),{});return(0,d.JH)(t)}let x=e=>{let t=(0,l.NL)(),r=(0,n.J1)(),o=null==e?void 0:e.id;return(0,s.D)({mutationFn:()=>m(o),onSuccess:()=>{var l,s;t.invalidateQueries({queryKey:[...u.l.reviews]});let n=null==e?void 0:e.product;(0,a.BX)("rate_item_review",{user_id:null===(l=r.data)||void 0===l?void 0:l.data.id,ecommerce:{review_id:null==e?void 0:e.id,rating:1,items:[{item_id:null==n?void 0:n.id,item_name:null==n?void 0:n.name,item_category:(0,i.A)(n).getProductCategoryName(),item_brand:null==n?void 0:null===(s=n.brand)||void 0===s?void 0:s.title,price:null==n?void 0:n.price,quantity:1}]}})},onError:d.pE})};async function p(e){let t={},r=e.categoryId,l=e.categories;void 0!==r?t["filter[category_id]"]=r.toString():l&&l.length>0&&(t["filter[categories]"]=l);let{data:s}=await o.h.get("reviews/latest-reviews",{params:t});return s}},44063:function(e,t,r){"use strict";r.d(t,{m:function(){return c}});var l=r(85893),s=r(40424),n=r(45670),i=r(21064),a=r(701),o=r(48755);let c=e=>{let{cardSize:t,imageFullWidth:r}=(0,s.g)(e.type);return(0,l.jsxs)(i.Zb,{className:(0,o.cn)("relative flex flex-shrink-0 flex-col border border-forest-green-100 bg-gray-100","normal"===t&&"px-2 py-2 pb-4 ","large"===t&&"h-[475px] w-[18.125rem] px-6 py-4",r&&"px-0 py-0",e.className),children:[(0,l.jsx)(i.Ol,{children:(0,l.jsx)(n.o,{ratio:1,children:(0,l.jsx)(a.O,{className:"h-full"})})}),(0,l.jsxs)(i.aY,{className:(0,o.cn)("flex flex-1 flex-col justify-between",r&&"px-6 py-4"),children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(a.O,{className:"mt-2 h-6 w-full"}),"wishlist"!==e.type&&(0,l.jsx)(a.O,{className:"mt-2 h-6 w-2/3"}),(0,l.jsx)(a.O,{className:"mt-4 h-4 w-1/3"})]}),"wishlist"!==e.type&&(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(a.O,{className:"mt-2 size-8 rounded-full"}),(0,l.jsx)(a.O,{className:"mt-2 h-4 w-1/3"})]})]})]})}},40424:function(e,t,r){"use strict";r.d(t,{g:function(){return s}});var l=r(98964);let s=e=>(0,l.EQ)(e).with("wishlist",()=>({type:"wishlist",displayTags:!1,favorable:!0,titleSize:"normal",sizeDescription:!1,cardSize:"normal",footerLayout:"stars",imageFullWidth:!1})).with("collection",()=>({type:"collection",displayTags:!1,favorable:!0,titleSize:"normal",sizeDescription:!1,cardSize:"normal",footerLayout:"stars_with_options",imageFullWidth:!1})).with("routine",()=>({type:"routine",displayTags:!0,favorable:!1,titleSize:"normal",sizeDescription:!1,cardSize:"normal",footerLayout:"stars",imageFullWidth:!1})).with("marketplace_small",()=>({type:"marketplace_small",displayTags:!1,favorable:!1,titleSize:"none",sizeDescription:!1,cardSize:"only_image",footerLayout:"none",imageFullWidth:!1})).with("marketplace_large",()=>({type:"marketplace_large",displayTags:!0,favorable:!1,titleSize:"large",sizeDescription:!0,cardSize:"large",footerLayout:"owner_price",imageFullWidth:!0})).with("product",()=>({type:"product",displayTags:!0,favorable:!0,titleSize:"large",sizeDescription:!0,cardSize:"large",footerLayout:"author_stars",imageFullWidth:!1})).with("product_small",()=>({type:"product_small",displayTags:!0,favorable:!0,titleSize:"large",sizeDescription:!1,cardSize:"large",footerLayout:"size",imageFullWidth:!1})).with("product_light",()=>({type:"product_light",displayTags:!1,favorable:!1,titleSize:"large",sizeDescription:!1,cardSize:"only_image",footerLayout:"size",imageFullWidth:!1})).with("test_it",()=>({type:"test_it",displayTags:!0,favorable:!1,titleSize:"large",sizeDescription:!1,cardSize:"medium",footerLayout:"none",imageFullWidth:!0})).exhaustive()},57964:function(e,t,r){"use strict";r.d(t,{y:function(){return z}});
36var l=r(85893),s=r(56312),n=r(43124),i=r(30202),a=r(28154),o=r(87536),c=r(91444),d=r(98964),u=r(1604),m=r(97647),x=r(20052),p=r(86851),h=r(90671),g=r(82417),f=r(12378),v=r(10996),j=r(85457),w=r(48501),b=r(40180),y=r(13880),N=r(55716),_=r(18974),k=r(6815);let z=e=>{let{initialProducts:t,triggerElement:r}=e,{t:z}=(0,_.LD)("error_messages"),{t:C}=(0,_.LD)("collection.new"),S=(0,i.NL)(),E=(0,m.EA)(),{isOpen:P,closeModal:T,openModal:I}=(0,y.E)(),{data:L}=(0,x.J1)();(0,b.kC)(P);let A=E.isPending,O=(0,N.U)(null==L?void 0:L.data).canCreateCollection(),D=u.z.object({title:u.z.string({required_error:C("title_required_error","Title is required")}).min(1,{message:C("title_required_error","Title is required")}),isPrivate:u.z.boolean(),products:u.z.array(u.z.string())}),q=(0,o.cI)({defaultValues:{title:"",isPrivate:!0,products:t||[]},resolver:(0,s.F)(D),criteriaMode:"all",mode:"onBlur"}),F=e=>{if(!O){T(),c.Am.error(z("collection_limit_reached","You've reached the max number of collections"));return}E.mutate(e,{onSuccess:()=>{T(),c.Am.success(C("create_success","Collection was successfully created")),S.invalidateQueries({queryKey:k.l.me})},onError:()=>{T(),c.Am.error(C("create_error","Unable to create collection"))},onSettled:()=>{q.reset({title:"",isPrivate:!0,products:t||[]})}})},Z=(0,d.EQ)(A).with(!0,()=>(0,l.jsx)(g.zx,{type:"button",variant:"primary",className:"w-full",disabled:A,children:(0,l.jsx)(h.a,{className:"size-5"})})).with(!1,()=>(0,l.jsxs)("div",{className:"grid w-full grid-cols-2 gap-4",children:[(0,l.jsx)(n.GG,{asChild:!0,onClick:T,children:(0,l.jsx)(g.zx,{type:"button",variant:"outline",className:"col-span-1",children:C("cancel_button","Cancel")})}),(0,l.jsx)(g.zx,{type:"button",onClick:q.handleSubmit(F),variant:"primary",className:"col-span-1",disabled:!q.formState.isValid,children:C("confirm_button","Confirm")})]})).exhaustive();return(0,l.jsxs)(f.Vq,{open:P,children:[(0,l.jsx)(f.hg,{onClick:I,children:r||(0,l.jsx)(g.KA,{variant:"outline",children:C("create_new_collection","Create new collection")})}),(0,l.jsx)(f.cZ,{className:"sm:max-w-lg lg:rounded-2xl",withCloseBtn:!1,children:(0,l.jsx)(v.l0,{...q,children:(0,l.jsxs)("form",{onSubmit:q.handleSubmit(F),className:"flex flex-col gap-4",children:[(0,l.jsx)("button",{className:"absolute right-4 top-4",onClick:T,children:(0,l.jsx)(a.Z,{})}),(0,l.jsx)(p.D,{variant:"layers"}),(0,l.jsx)(j.w,{size:"h4",children:C("create_new_collection","Create new collection")}),(0,l.jsx)(v.Wi,{control:q.control,name:"title",render:e=>{let{field:t}=e;return(0,l.jsxs)(v.xJ,{children:[(0,l.jsx)(v.lX,{children:C("title_label","Title")}),(0,l.jsx)(v.NI,{children:(0,l.jsx)(w.I,{type:"text",placeholder:C("title_placeholder","Enter collection title"),...t})}),(0,l.jsx)(v.zG,{})]})}}),Z]})})})]})}},53795:function(e,t,r){"use strict";r.d(t,{q:function(){return b},s:function(){return y}});var l=r(85893),s=r(6311),n=r(98964),i=r(97788),a=r(20052),o=r(87917),c=r(97358),d=r(85884),u=r(47042),m=r(49455),x=r(33839),p=r(82417),h=r(701),g=r(48755),f=r(15147),v=r(55716),j=r(93436),w=r(36524);let b=e=>{var t,r,x;let h=(0,i.ws)(),{t:b}=(0,s.$G)("common",{keyPrefix:"product_detail"}),{className:y,comment:N,setReplyTo:_,scrollToReplyForm:k}=e,{data:z}=(0,a.J1)(),C=(0,v.U)(null==z?void 0:z.data).getUserId(),S=(0,f.t)(N).belongsToUser(C),E=(0,v.U)(null==N?void 0:N.user).isMigrated(),P=(0,v.U)(null!==(r=N.user)&&void 0!==r?r:N.author).getUserTags(h),T=null===(t=N.comment)||void 0===t?void 0:t.split(" "),[I,L,A]=(0,n.EQ)(T).with(n.P.array(n.P.string),e=>{var t;let r=null!==(t=e.shift())&&void 0!==t?t:"",l=(null==r?void 0:r[0])==="@";return[r,e.join(" "),l]}).otherwise(()=>["","",!1]);return(0,l.jsxs)("div",{className:(0,g.cn)("mb-0.5 w-full rounded-md rounded-t-md bg-white p-4",y),children:[(0,l.jsxs)("div",{className:"mb-4 flex justify-between flex-col gap-2 md:flex-row",children:[(0,l.jsx)("div",{className:"flex gap-4",children:(0,l.jsx)(o.zG,{comment:N})}),(0,l.jsxs)("div",{className:"flex flex-col items-start gap-2 md:items-end",children:[(0,l.jsxs)("span",{className:"flex gap-2 text-xs text-forest-green-500/40",children:[(0,j.nQ)(N.created_at),(0,l.jsx)(d.q,{children:S&&e.item?(0,l.jsx)(u.G,{comment:N,item:e.item}):null})]}),(0,l.jsxs)("div",{className:"overflow-hidden",children:[(0,l.jsx)(c.$,{tags:P,isUserMigrated:E,type:"comment"}),(0,l.jsx)(m.Q,{user:null!==(x=N.author)&&void 0!==x?x:N.user})]})]})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:justify-between",children:[(0,l.jsxs)("p",{className:"text text-sm",children:[(0,l.jsxs)("span",{className:(0,g.cn)(A&&"font-bold"),children:[I," "]}),L]}),(0,l.jsxs)("div",{className:"flex gap-1",children:[!e.noReply&&(0,l.jsx)(p.zx,{variant:"outline",className:"h-8 text-sm font-medium text-forest-green-500",onClick:()=>{var t,r;e.parentComment&&(null==_||_(e.parentComment)),null==k||k();let l=null===(t=N.user)||void 0===t?void 0:t.username;null!=l&&""!==l&&null!=e.form&&e.form.setValue("text","@"+(null===(r=N.user)||void 0===r?void 0:r.username)+" ")},children:b("reply_button","Reply")}),null!=N.id?(0,l.jsx)(w.u,{commentId:N.id}):null]})]})]})},y=()=>(0,l.jsxs)("div",{className:"mb-0.5 w-full rounded-md rounded-t-md bg-white p-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex justify-between",children:[(0,l.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,l.jsx)(h.O,{className:"size-6 rounded-full md:h-10 md:w-10"}),(0,l.jsx)(h.O,{className:"h-3 w-24 md:h-4"})]}),(0,l.jsx)(h.O,{className:"h-4 w-24"})]}),(0,l.jsx)(x.L,{size:4}),(0,l.jsxs)("div",{className:"flex gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-1 flex-col gap-1.5 md:justify-between",children:[(0,l.jsx)(h.O,{className:"h-4 w-full"}),(0,l.jsx)(h.O,{className:"h-4 w-full"}),(0,l.jsx)(h.O,{className:"h-4 w-2/3"})]}),(0,l.jsx)("div",{children:(0,l.jsx)(h.O,{className:"h-8 w-24"})})]})]})},86851:function(e,t,r){"use strict";r.d(t,{D:function(){return d}});var l=r(85893),s=r(85865),n=r(83364),i=r(49203),a=r(53585),o=r(98964),c=r(48755);let d=e=>{let{icon:t,variant:r}=e,d=(0,o.EQ)(r).with("success",()=>({bgColor:"bg-success-300",textColor:"text-success-500",defaultIcon:(0,l.jsx)(s.Z,{})})).with("warning",()=>({bgColor:"bg-warning-300",textColor:"text-warning-500",defaultIcon:(0,l.jsx)(n.Z,{})})).with("error",()=>({bgColor:"bg-error-300",textColor:"text-error-500",defaultIcon:(0,l.jsx)(i.Z,{})})).with("layers",()=>({bgColor:"bg-primary-300",textColor:"text-accent-purple",defaultIcon:(0,l.jsx)(a.Z,{className:"-rotate-90"})})).exhaustive();
36return(0,l.jsx)("div",{className:(0,c.cn)("size-12 rounded-full bg-opacity-40 p-[6px]",d.bgColor),children:(0,l.jsx)("div",{className:(0,c.cn)("h-full w-full rounded-full p-[6px]",d.bgColor),children:(0,l.jsx)("div",{className:(0,c.cn)("h-full w-full rounded-full",d.textColor),children:t||d.defaultIcon})})})}},186:function(e,t,r){"use strict";r.d(t,{R:function(){return a}});var l=r(85893),s=r(10996),n=r(42890),i=r(18974);function a(e){let{label:t,options:r,onChange:a,value:o}=e,{t:c}=(0,i.LD)("form_general");return(0,l.jsxs)(s.xJ,{children:[(0,l.jsx)(s.lX,{children:t}),(0,l.jsxs)(n.Ph,{onValueChange:a,value:null!=o?o:void 0,children:[(0,l.jsx)(s.NI,{children:(0,l.jsx)(n.i4,{className:"",children:(0,l.jsx)(n.ki,{placeholder:c("select_placeholder","Please select an option")})})}),(0,l.jsx)(n.Bw,{children:(0,l.jsx)(n.DI,{children:r.map(e=>(0,l.jsx)(n.Ql,{value:e.value,children:e.label},e.value))})})]}),(0,l.jsx)(s.zG,{})]})}},90671:function(e,t,r){"use strict";r.d(t,{a:function(){return n}});var l=r(85893),s=r(98388);let n=e=>{let{className:t}=e;return(0,l.jsx)("div",{className:(0,s.m6)("size-10 animate-spin rounded-full border-2 border-solid border-forest-green-500 border-t-transparent",t)})}},11609:function(e,t,r){"use strict";r.d(t,{O:function(){return i}});var l=r(85893),s=r(61027),n=r(30920);let i=e=>{let{tags:t,secondaryTags:r}=e;if(!((null==t?void 0:t.length)||(null==r?void 0:r.length)))return null;let i=n._.productCategories;return(0,l.jsxs)("div",{className:"flex flex-col gap-2 ",children:[(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:null==t?void 0:t.map(e=>(0,l.jsx)(s.Ct,{variant:"profile",href:"".concat(i,"/").concat(e.slug,"?utm_source=").concat("product-page"),children:e.name},e.name))}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:null==r?void 0:r.map(e=>(0,l.jsx)(s.Ct,{variant:"profile",children:e},e))})]})}},42890:function(e,t,r){"use strict";r.d(t,{Bw:function(){return p},DI:function(){return u},Ph:function(){return d},Ql:function(){return h},i4:function(){return x},ki:function(){return m}});var l=r(85893),s=r(7678),n=r(51568),i=r(3785),a=r(67294),o=r(68894),c=r(48755);let d=s.fC,u=s.ZA,m=s.B4,x=a.forwardRef((e,t)=>{let{className:r,children:i,...a}=e;return(0,l.jsxs)(s.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-forest-green-500 bg-white px-3 py-2 text-sm placeholder:text-forest-green-200 outline-none aria-expanded:outline-2 aria-expanded:outline-bg-darker disabled:cursor-not-allowed disabled:opacity-50",!o.gs&&"aria-expanded:outline-0",r),...a,children:[i,(0,l.jsx)(s.JO,{asChild:!0,children:(0,l.jsx)(n.Z,{className:"std-icon"})})]})});x.displayName=s.xz.displayName;let p=a.forwardRef((e,t)=>{let{className:r,children:n,position:i="popper",...a}=e;return(0,l.jsx)(s.h_,{children:(0,l.jsx)(s.VY,{ref:t,className:(0,c.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-background text-forest-green-500 shadow-md max-h-[var(--radix-popper-available-height)]","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",!o.gs&&"bg-bg-cz",r),position:i,...a,children:(0,l.jsx)(s.l_,{className:(0,c.cn)("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n})})})});p.displayName=s.VY.displayName,a.forwardRef((e,t)=>{let{className:r,...n}=e;return(0,l.jsx)(s.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",r),...n})}).displayName=s.__.displayName;let h=a.forwardRef((e,t)=>{let{className:r,children:n,...a}=e;return(0,l.jsxs)(s.ck,{ref:t,className:(0,c.cn)("relative hover:cursor-pointer hover:bg-bg-darker focus:bg-bg-darkerflex w-full cursor-default select-none items-center rounded-md py-1.5 pl-8 pr-2 text-sm outline-none focus:text-forest-green-500 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",!o.gs&&"hover:bg-cz-gray-300 hover:text-white focus:text-white focus:bg-cz-gray-300",r),...a,children:[(0,l.jsx)("span",{className:"absolute left-2 top-1/2 flex h-3.5 w-3.5 -translate-y-1/2 items-center justify-center",children:(0,l.jsx)(s.wU,{children:(0,l.jsx)(i.Z,{className:"size-4"})})}),(0,l.jsx)(s.eT,{children:n})]})});h.displayName=s.ck.displayName,a.forwardRef((e,t)=>
36{let{className:r,...n}=e;return(0,l.jsx)(s.Z0,{ref:t,className:(0,c.cn)("bg-muted -mx-1 my-1 h-px",r),...n})}).displayName=s.Z0.displayName},84151:function(e,t,r){"use strict";r.d(t,{x:function(){return c}});var l=r(85893),s=r(41664),n=r.n(s),i=r(52066),a=r(48755),o=r(55716);let c=e=>{let{user:t,className:r}=e;if(!t)return null;let s=(0,o.U)(t).getProfileUrl(),c=(0,o.U)(t).isMigrated();return(0,l.jsx)(n(),{href:s,className:(0,a.cn)(c&&"pointer-events-none"),"aria-disabled":c,children:(0,l.jsxs)("div",{className:(0,a.cn)("flex items-center gap-2 px-2 py-1",r),children:[e.noImage||c?null:(0,l.jsx)(i.nZ,{user:t}),(0,l.jsx)("p",{className:(0,a.cn)("text-sm font-medium text-forest-green-500",e.paragraphClassName),children:t.username})]})})}},23875:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return t8},default:function(){return t7}});var l,s,n,i,a=r(85893),o=r(9008),c=r.n(o),d=r(75652),u=r(20052),m=r(72984),x=r(69485),p=r(69617),h=r(99384),g=r(24511),f=r(68894),v=r(7978),j=r(24623),w=r(97903),b=r(83189),y=r(6311),N=r(57421),_=r(48755);let k={arukereso:"/logos/arukereso.svg",dermo:"/logos/dermo.svg",douglas:"/logos/douglas.svg",kalmia:"/logos/kalmia.svg","kiehl's":"/logos/kiehls.svg",lavonio:"/logos/lavonio.svg",marionnaud:"/logos/marionnaud.svg",notino:"/logos/notino.svg",pink_panda:"/logos/pinkpanda.svg",stylevana:"/logos/stylevana.svg",unipatika:"/logos/unipatika.svg"},z=e=>{var t;let{product:r}=e,{t:l}=(0,y.$G)("common",{keyPrefix:"product_detail"}),s=(null!==(t=r.ean_affiliates)&&void 0!==t?t:[]).filter(e=>!!(null==e?void 0:e.affiliate_url));if(0===s.length)return null;let n=s.length<=2,i=s.map((e,t)=>{var r,l;let s=null!==(r=e.affiliate_url)&&void 0!==r?r:"",n=null!==(l=e.affiliate_source)&&void 0!==l?l:"";return(0,a.jsxs)("a",{href:s,target:"_blank",rel:"noopener noreferrer sponsored",className:(0,_.cn)("group flex items-center gap-3 p-3 bg-white border border-badge-beige rounded-md transition-all duration-200 hover:shadow-md cursor-pointer",f.gs?"hover:border-primary-500":"hover:border-cz-red-400"),children:[(0,a.jsx)("div",{className:"h-12 w-24 flex-shrink-0 flex items-center justify-center overflow-hidden",children:(0,a.jsx)("img",{src:k[n],alt:n,className:"h-auto object-contain w-full"})}),(0,a.jsx)("div",{className:(0,_.cn)("ml-auto flex items-center justify-center h-10 w-10 rounded-md text-white transition-all duration-200 group-hover:scale-110",f.gs?"bg-accent-purple group-hover:bg-accent-deep-purple":"bg-cz-red-300 group-hover:bg-cz-red-400"),children:(0,a.jsx)(N.Z,{className:"w-5 h-5"})})]},t)});return(0,a.jsx)("section",{className:"py-6",children:(0,a.jsx)("div",{className:"section-content",children:(0,a.jsxs)("div",{className:(0,_.cn)(n?"flex flex-col gap-10 md:flex-row":""),children:[n&&(0,a.jsx)("div",{className:"flex-shrink-0 md:w-2/5 md:max-w-[30rem]"}),(0,a.jsxs)("div",{className:(0,_.cn)("rounded-lg p-6 font-grotesk",n&&"flex w-full flex-col",f.gs?"bg-primary-300":"bg-bg-cz-darker"),children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold mb-4 text-forest-green-500",children:l("buy_here")}),(0,a.jsx)("div",{className:(0,_.cn)("grid gap-3",n?"sm:grid-cols-1 lg:grid-cols-".concat(s.length<2?1:2):"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"),children:i})]})]})})})};var C=r(85457),S=r(85163),E=r(76355),P=r(31434),T=r(18974);let I=e=>{let{ingredients:t}=e,{t:r}=(0,T.LD)("products.detail");return(null==t?void 0:t.length)?(0,a.jsxs)("section",{className:"section-content mt-20",children:[(0,a.jsx)(C.w,{size:"h2",className:"mb-6",children:r("ingredients_section_header","Ingredients")}),(0,a.jsx)("div",{className:"flex gap-4 flex-wrap py-6",children:t.map(e=>(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)(P.hM,{ingredient:e})},e.uuid))})]}):null};var L=r(5152),A=r.n(L),O=r(67294),D=r(39504),q=r(45670),F=r(79209),Z=r(68719);let M=A()(()=>Promise.all([r.e(9707),r.e(4647),r.e(1116)]).then(r.bind(r,11116)).then(e=>e.ImagePopover),{loadableGenerated:{webpack:()=>[11116]},ssr:!1,loading:F.$E}),V=e=>{let{images:t,productName:r}=e,[l,s]=(0,O.useState)(!1);if((0,O.useEffect)(()=>s(!0),[]),l)return(0,a.jsx)(M,{images:t,productName:r});let n=null==t?void 0:t[0],i=r||(null==n?void 0:n.alt)||"product-image";return(0,a.jsx)("div",{className:"relative flex w-full flex-shrink-0 flex-col self-start bg-transparent md:w-2/5 md:max-w-[30rem]",children:(0,a.jsx)(q.o,{ratio:1,className:"",asChild:!0,children:(0,a.jsx)(D.J,{src:(null==n?void 0:n.path)||Z.Z,alt:i,fill:!0,priority:!0,sizes:"(max-width: 768px) 100vw, 30rem",className:"h-full rounded-md object-contain bg-white"})})})};var R=r(11163),B=r(74755),U=r(66881),G=r(85884),W=r(56312),Q=r(44954),J=r(87536),K=r(1604),$=r(98029),H=r(91444),X=r(92214),Y=r(98493),ee=r(2472);let et=async e=>
36{if(await (0,Y.S)(),!e.product_id)throw Error("Product id is required");let{data:t}=await X.h.post("/report/product",e);return t},er=()=>{let{t:e}=(0,T.LD)("report_modal");return(0,$.D)({mutationFn:et,onSuccess:()=>{H.Am.success(e("report_success_toast"))},onError:ee.pE})};var el=r(98367),es=r(60546),en=r(82417),ei=r(10996),ea=r(23494),eo=r(40180),ec=r(13880),ed=r(2809),eu=r(30920);let em=K.z.enum(["no_longer_manufactured","packaging","ingredients","description","product_name","other"]),ex={no_longer_manufactured:"Product is no longer manufactured",packaging:"Packaging",ingredients:"Ingredients",description:"Description",product_name:"Product name",other:"Other"},ep=(0,ed.uc)(ex),eh=K.z.object({categories:K.z.array(em).min(1),description:K.z.string().min(1)}),eg={categories:[],description:void 0},ef=e=>{let{t}=(0,T.LD)("report_modal"),{isOpen:r,setIsOpen:l,closeModal:s,openModal:n}=(0,ec.E)(),{isSuccess:i}=(0,eo.nu)(),o=(0,R.useRouter)(),c=er(),d=(0,J.cI)({defaultValues:eg,resolver:(0,W.F)(eh)}),u=e=>t=>{let r=d.getValues("categories"),l=t?[...r,e]:r.filter(t=>t!==e);d.setValue("categories",l),d.trigger("categories")},m=d.watch("categories"),x=d.formState.isValid;return(0,a.jsxs)(es.aR,{open:r,onOpenChange:l,children:[(0,a.jsx)("button",{className:(0,_.cn)("group flex size-12 items-center justify-center rounded-full bg-error-100 transition hover:bg-error-200",!f.gs&&"bg-white"),onClick:()=>{i?n():o.push({pathname:eu._.signin,query:{next:o.asPath}})},children:(0,a.jsx)(Q.Z,{className:"size-5 text-error-400 transition group-hover:text-error-500"})}),(0,a.jsxs)(es._T,{className:"sm:max-w-[26.75rem]",children:[(0,a.jsx)(es.CI,{}),(0,a.jsxs)("div",{children:[(0,a.jsx)(es.f$,{children:t("report_title","What is wrong with this product?")}),(0,a.jsx)(es.yT,{children:t("report_description","Let us know so we can correct it.")})]}),(0,a.jsx)(ei.l0,{...d,children:(0,a.jsxs)("form",{onSubmit:d.handleSubmit(t=>{var r;let l=t.categories.map(e=>ex[e]);c.mutate({product_id:null===(r=e.product)||void 0===r?void 0:r.id,categories:l,description:t.description}),s(),d.reset(eg)}),className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-forest-green-300",children:t("function_label","Function")}),(0,a.jsx)(ei.xJ,{className:"",children:ep.map(e=>(0,a.jsxs)("div",{className:"flex flex-row items-center gap-4",children:[(0,a.jsx)(el.c,{checked:m.includes(e),onCheckedChange:u(e),id:"report-".concat(e)}),(0,a.jsx)(ei.lX,{htmlFor:"report-".concat(e),children:t("problems.".concat(e))})]},e))})]}),(0,a.jsx)(ei.Wi,{control:d.control,name:"description",render:e=>{let{field:r}=e;return(0,a.jsxs)(ei.xJ,{children:[(0,a.jsx)(ei.lX,{children:t("comment_label","Description")}),(0,a.jsx)(ei.NI,{children:(0,a.jsx)(ea.K,{className:"text-base",rows:4,placeholder:t("comment_placeholder","Write a description of the error."),...r})}),(0,a.jsx)(ei.zG,{})]})}}),(0,a.jsxs)(es.xo,{children:[(0,a.jsx)(es.le,{className:"w-full",children:t("cancel_button","Cancel")}),(0,a.jsx)(en.zx,{type:"submit",className:"w-full",disabled:!x,children:t("send_button","Submit")})]})]})})]})]})};var ev=r(49773),ej=r(84151),ew=r(24218),eb=r(73338),ey=r(82583),eN=r(93436);function e_(e){if(!e)return!1;let t=e.ean_affiliates;return Array.isArray(t)&&t.some(e=>!!(null==e?void 0:e.affiliate_url))}function ek(e){let{product:t}=e,{t:r}=(0,T.LD)("products.detail"),l=null==t?void 0:t.slug,{data:s,isFetching:n}=(0,U.iB)(l),i=null==s?void 0:s.data,o=!e_(t);return(0,a.jsxs)("div",{className:(0,_.cn)("flex w-full flex-row justify-end gap-4 lg:flex-row",!o&&"justify-end flex-row"),children:[(0,a.jsxs)("div",{className:"flex items-start gap-2 mr-2 xs:mr-4 md:mr-0",children:[o,(0,a.jsx)(ev.$,{product:i,isFetching:n})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)(G.G,{children:[(0,a.jsx)(eb.j,{productSlugs:l?[l]:[]}),f.gs&&(0,a.jsx)(ew.E,{type:"create",product:{value:null==i?void 0:i.id,label:null==i?void 0:i.name},triggerElement:(0,a.jsx)(en.KA,{variant:"ghost",className:"hover:bg-bg-darker",children:r("sell_this_product_on_marketplace")})})]}),(0,a.jsx)(ef,{product:t})]})]})}let ez=e=>{let{product:t,className:r}=e,{t:l}=(0,T.LD)("products.detail"),s=(0,eN.cQ)(null==t?void 0:t.published_at),n=null==t?void 0:t.created_by;return(0,a.jsx)("div",{className:r,children:(0,a.jsxs)("span",{className:"flex h-full items-center text-xs md:leading-6 lg:text-sm",children:[s&&(0,a.jsx)("span",{className:"mr-1 text-forest-green-300",children:l("added_on",{date:s})}),n&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"text-forest-green-300",children:"by"}),(0,a.jsx)(ej.x,{noImage:!0,user:null==t?void 0:t.created_by,paragraphClassName:"text-forest-green-500 underline"})]})]})})},eC=e=>{let{product:t}=e,{t:r}=(0,y.$G)("common",{keyPrefix:"product_detail"}),l=(0,u.J1)(),s=(0,R.useRouter)();return(0,a.jsxs)("div",{className:"flex w-full max-w-[400px] flex-col gap-2 lg:w-fit",children:[(0,a.jsxs)(en.zx,{onClick:()=>
36{if(e_(t)){var e,r;(0,ey.BX)("add_to_cart",{user_id:null===(e=l.data)||void 0===e?void 0:e.data.id,ecommerce:{currency:"HUF",value:null==t?void 0:t.price,items:[{item_id:null==t?void 0:t.id,item_name:null==t?void 0:t.name,item_category:(0,v.A)(t).getProductCategoryName(),item_brand:null==t?void 0:null===(r=t.brand)||void 0===r?void 0:r.title,price:null==t?void 0:t.price,quantity:1}]}}),null===ed.pG||void 0===ed.pG||ed.pG.open(null==t?void 0:t.affiliate_url,"_blank","noopener")}else s.push({pathname:eu._.marketplace,query:{name:null==t?void 0:t.name}})},variant:"success",className:(0,_.cn)("px-auto w-full gap-2 py-3 lg:w-64"),children:[e_(t)?r("buy_cta"):r("search_cta","Search Marketplace"),(0,a.jsx)(N.Z,{})]}),(0,a.jsx)("span",{className:"text text-sm text-forest-green-300",children:e_(t)?r("buy_description"):r("search_description","Search for this product on the marketplace")})]})};var eS=r(43524),eE=r(11609),eP=r(70811),eT=r(40867);let eI=e=>{var t;let{t:r}=(0,y.$G)("common",{keyPrefix:"product_detail"}),l=(0,R.useRouter)(),s=new Intl.ListFormat(null!==(t=l.locale)&&void 0!==t?t:"hu",{style:"long",type:"conjunction"}),n=(0,v.A)(e),i=n.getSkinTypeTags(),a=n.getSkinTypeTagsLocalizationKey(),o=null!=i&&null!=a?r(a,{skinTypes:s.format(i)}):null,c=n.getSkinConcernTags();return{skinTypeTag:o,skinConcernTag:null!=c?r("tags.for_skin_problem",{skinConcerns:s.format(c)}):null}},eL=["ml","g","l","kg","db","cl","oz","Ft","â¬","$"];function eA(e){let{value:t}=e,r=t.lastIndexOf(" ");if(-1!==r){let e=t.slice(r+1);if(eL.includes(e))return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-semibold",children:t.slice(0,r)})," ",(0,a.jsx)("span",{className:"text-sm opacity-70",children:e})]})}return(0,a.jsx)(a.Fragment,{children:t})}function eO(e){let{variant:t,className:r}=e,l=[t.size].filter(Boolean);return l.length?(0,a.jsx)("span",{className:r,children:l.map((e,t)=>(0,a.jsxs)("span",{children:[t>0&&(0,a.jsx)("span",{className:"mx-0.5 opacity-40",children:" â "}),(0,a.jsx)(eA,{value:e})]},t))}):null}function eD(e){var t;let{variants:r,className:l}=e,s=null!==(t=null==r?void 0:r.filter(e=>e.size||e.price))&&void 0!==t?t:[];return s.length?(0,a.jsx)("div",{className:(0,_.cn)("flex flex-wrap items-center gap-2",l),children:s.map((e,t)=>(0,a.jsx)(eO,{variant:e,className:"rounded border border-forest-green-200 px-2 py-0.5 text-sm"},t))}):null}function eq(e){var t;let{product:r}=e,l=(0,R.useRouter)(),{t:s}=(0,y.$G)("common",{keyPrefix:"product_detail"}),n=(0,v.A)(r),i=n.getProductDisplayPrice(),o=n.getAllProductCategoryNamesAndSlugs(),{skinTypeTag:c,skinConcernTag:d}=eI(r),u=n.getLocationTag(),m=[c,d,null!=u?s("tags.location_tag","Location: {{location}}",{location:u}):null].filter(ed.C_),x=!!(null==r?void 0:r.is_sponsored);return(0,eT.US)(x&&!!l,()=>{if(null!=l.query.product)return;let e={pathname:l.pathname,query:{...l.query,...x&&{product:"sponsored"}}};l.replace(e,void 0,{shallow:!0})}),(0,a.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[(0,a.jsx)(eE.O,{tags:o,secondaryTags:m}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("div",{className:"flex items-end gap-4",children:(0,a.jsx)(C.w,{size:"h1",className:"max-w-full lg:max-w-[66%] text-4xl leading-none",children:r.name})}),(0,a.jsx)(eD,{variants:r.variants})]}),!1==r.is_manufactured?(0,a.jsx)("div",{className:"flex",children:(0,a.jsx)(C.w,{size:"h3",className:"text-2xl text-red-500 leading-none",children:s("no_longer_manufactured","No longer manufactured.")})}):null,null!=r.rating?(0,a.jsxs)("div",{className:"flex flex-col items-start gap-2 lg:mt-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[!!r.rating&&(0,a.jsx)("span",{className:(0,_.cn)("text-2xl font-bold leading-none text-forest-green-500",!f.gs&&"font-mango"),children:(0,eP.o)(null==r?void 0:r.rating)}),(0,a.jsx)(eS.T,{stars:r.rating,size:"large",className:"mb-1"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-forest-green-300",children:s("reviews_description",{count:null!==(t=r.number_of_reviews)&&void 0!==t?t:0})}),(0,a.jsx)(ez,{product:r,className:"border-l border-badge-beige pl-2"})]})]}):(0,a.jsx)("div",{className:"flex items-center gap-2 lg:flex-col lg:items-start",children:(0,a.jsx)("span",{className:"font-bold text-forest-green-500",children:s("no_reviews","No reviews yet")})}),(0,a.jsx)(B.M,{description:r.description,maxLines:3,className:"mt-2",contentClassName:"space-y-2",alwaysShowButton:!0}),(0,a.jsxs)("div",{className:"mt-auto flex flex-col gap-4 lg:gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4 lg:mt-9",children:[f.gs&&i&&(0,a.jsx)("span",{className:"font-grotesk text-xl font-bold text-forest-green-500 whitespace-nowrap",children:(0,a.jsx)(y.cC,{t:s,i18nKey:"price",tOptions:{price:i},children:(0,a.jsx)("span",{className:"ml-1 text-3xl"})})}),(0,a.jsx)(ek,{product:r})]}),!e_(r)&&f.gs&&(0,a.jsx)(eC,{product:r})]})]})}var eF=r(55278);let eZ=e=>{let{defaultValue:t,items:r,theme:l,onTabClick:s}=e;return(0,a.jsxs)(eF.mQ,{defaultValue:t,children:[(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(eF.dr,{theme:l,className:"w-full max-w-7xl flex flex-wrap gap-1.5 rounded-2xl bg-white p-3 md:justify-start md:gap-10 md:overflow-auto md:bg-transparent md:p-0 md:rounded-none",children:r.map(e=>{let{value:t,label:r}=e;return(0,a.jsx)(eF.SP,{className:(0,_.cn)("h-8 w-auto rounded-lg bg-transparent border-b-0 px-4 py-3","data-[state=active]:bg-primary-300","md:h-auto md:rounded-none md:bg-transparent md:border-b-2 md:px-0","md:data-[state=active]:bg-transparent"),value:t,theme:l,onClick:()=>null==s?void 0:s(t),children:(0,a.jsx)("span",{children:r})},t)})})}),r.map((e,t)=>{let{content:r,value:l}=e;return(0,a.jsx)(eF.nU,{value:l,children:r},"".concat(l,"_content_").concat(t))})]})};var eM=r(39332);function eV(){return(eV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)({}).hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(null,arguments)}var eR=function(e){return O.createElement("svg",eV({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),l||(l=O.createElement("path",{fill:"currentColor",d:"M8 .212c-4.404 0-8 3.3
3665-8 7.5s3.596 7.5 8 7.5a8.4 8.4 0 0 0 3.808-.904l2.557 1.385c.116.057.25.096.366.096a.83.83 0 0 0 .461-.154.78.78 0 0 0 .289-.77l-.692-3.191A7.17 7.17 0 0 0 16 7.712c0-4.135-3.596-7.5-8-7.5m5.346 10.846c-.135.173-.173.404-.135.616l.404 1.884-1.461-.788a.75.75 0 0 0-.75.019c-1 .577-2.192.885-3.404.885-3.558 0-6.462-2.674-6.462-5.962C1.538 4.423 4.442 1.75 8 1.75s6.461 2.673 6.461 5.962c0 1.192-.384 2.346-1.115 3.346"})))};function eB(){return(eB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)({}).hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(null,arguments)}var eU=function(e){return O.createElement("svg",eB({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),s||(s=O.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.348 4.179A4.67 4.67 0 0 1 7.996 7.1 4.67 4.67 0 0 1 6.645 4.18a4.67 4.67 0 0 1 1.351-2.923 4.67 4.67 0 0 1 1.352 2.923M11.212 10.712A4.67 4.67 0 0 1 8 10.478a4.67 4.67 0 0 1 2.258-2.297 4.66 4.66 0 0 1 3.211.235 4.66 4.66 0 0 1-2.257 2.296M4.785 10.711a4.67 4.67 0 0 0 3.212-.234A4.67 4.67 0 0 0 5.74 8.182a4.67 4.67 0 0 0-3.21.234 4.67 4.67 0 0 0 2.255 2.296M7.996 7.1l.005 7.645"})))},eG=r(55835);function eW(){return(eW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)({}).hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(null,arguments)}var eQ=function(e){return O.createElement("svg",eW({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},e),n||(n=O.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m8.65 2.895 1.526 3.004h2.595a.711.711 0 0 1 .512 1.222l-2.382 2.345 1.322 3.037a.72.72 0 0 1-1.025.9l-3.194-1.797-3.197 1.797a.72.72 0 0 1-1.026-.9l1.322-3.037-2.386-2.352a.712.712 0 0 1 .512-1.223h2.599l1.525-3.004a.733.733 0 0 1 1.297.008"})))},eJ=r(66261),eK=r(36617),e$=r(53795);let eH=e=>{let{comment:t,setReplyTo:r,className:l,scrollToReplyForm:s}=e,n=t.replies,i=null==n||0===n.length?null:n.map(t=>(0,a.jsx)("div",{className:"flex",children:(0,a.jsx)(eH,{form:e.form,parentComment:e.parentComment,comment:t,setReplyTo:r,className:"ml-4",item:e.item,scrollToReplyForm:s})},t.id));return(0,a.jsxs)("div",{className:(0,_.cn)("flex w-full flex-col",l),children:[(0,a.jsx)(e$.q,{form:e.form,comment:t,parentComment:e.parentComment,setReplyTo:r,item:e.item,scrollToReplyForm:s}),i]})};var eX=r(42890),eY=r(63445),e0=(r(28154),r(11009));let e1=e=>{var t;let{form:r,productId:l,replyTo:s,setReplyTo:n,scrollToReplyForm:i}=e,{t:o}=(0,y.$G)("common",{keyPrefix:"product_detail"}),c=(0,R.useRouter)(),{isSuccess:d}=(0,eo.nu)(),u=(0,eT.H1)("comment"),m=(0,eK.sy)();return null==s||null===(t=s.user)||void 0===t||t.username,(0,O.useEffect)(()=>{u&&(r.setValue("text",u),null==i||i(),r.trigger(),c.replace({pathname:c.pathname,query:{...c.query,comment:void 0}},void 0,{shallow:!0}))},[i,r,u,c]),(0,a.jsx)(ei.l0,{...r,children:(0,a.jsxs)("form",{className:(0,_.cn)("flex h-fit flex-col rounded-lg bg-primary-300 p-6",!f.gs&&"bg-bg-cz-darker"),onSubmit:r.handleSubmit(e=>{if(!d){c.push({pathname:eu._.signin,query:{next:c.asPath,comment:e.text,activeTab:"discussions"}});return}m.mutate({source:"COMMENT",comment:e.text,product_id:l,parent_id:null==s?void 0:s.id}),r.reset()}),children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2 ",children:[(0,a.jsx)(C.w,{size:"h2",className:"text-3xl font-bold",children:null==s?o("add_comment_title","Add comment"):o("add_reply_title","Add reply")}),(0,a.jsx)(e0.b,{children:(0,a.jsx)("p",{children:o("comment_box_tooltip","Add your reply here.")})})]}),!1,(0,a.jsx)(ei.Wi,{control:r.control,name:"text",render:e=>{let{field:t}=e;return(0,a.jsxs)(ei.xJ,{className:"flex flex-col",children:[(0,a.jsx)(ea.K,{value:t.value,onChange:t.onChange,className:"h-[11rem] rounded-md bg-white px-3 py-2 placeholder:font-light",placeholder:o("comment_placeholder","Enter your reply.")}),(0,a.jsx)(ei.zG,{})]})}}),(0,a.jsx)(en.zx,{className:"mt-6 max-w-[240px]",type:"submit",disabled:!r.formState.isValid,children:o("add_comment_button","Submit reply")})]})})},e2=()=>{let e=(0,eY.y)().t;return[{value:"-created_at",label:e("comments.sorting.newest")},{value:"created_at",label:e("comments.sorting.oldest")}]},e4=e=>{var t;let{productId:r}=e,{t:l}=(0,y.$G)("common",{keyPrefix:"product_detail"}),[s,n]=(0,O.useState)(null),[i,o]=(0,O.useState)("-created_at"),{commentData:c,isLoading:d,isSuccess:u,paginationElement:m}=(0,eK.cg)(r,i),x=u&&(null==c?void 0:null===(t=c.data)||void 0===t?void 0:t.length)===0,p=()=>{eJ.OK.scrollTo("reply-form",{duration:500,delay:50,smooth:"easeInOutQuint",offset:-100})},h=K.z.object({text:K.z.string({required_error:l("reply_is_required","Reply is required")}).min(5,{message:l("reply_too_short","Reply is too short. At least 5 characters")})}),g=(0,J.cI)({defaultValues:{text:""},resolver:(0,W.F)(h)});return(0,a.jsxs)("div",{className:"section-content pb-2 pt-14 mb-8 lg:mb-16",children:[(0,a.jsx)(C.w,{size:"h2",className:"mb-6 text-3xl",children:l("discussions.title")}),(0,a.jsx)(e5,{sortBy:i,setSortBy:o}),(0,a.jsxs)("div",{className:"mb-6",children:[x?(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-sm text-forest-green-500",children:l("no_comment","No comments yet")})}):null,(0,a.jsx)(e6,{form:g,commentData:c,setReplyTo:n,isLoading:d,scrollToReplyForm:p})]}
36),r?(0,a.jsx)(eJ.W_,{name:"reply-form",children:(0,a.jsx)(e1,{form:g,productId:r,replyTo:s,setReplyTo:n,scrollToReplyForm:p})}):null,(0,a.jsx)("div",{className:"mt-10",children:m})]})},e6=e=>{let{form:t,commentData:r,isLoading:l,setReplyTo:s,scrollToReplyForm:n}=e;return l?Array.from({length:6},(e,t)=>t).map((e,t)=>(0,a.jsx)(e$.s,{},t)):null==r?void 0:r.data.map(e=>(0,a.jsx)(eH,{form:t,item:"product",parentComment:e,comment:e,setReplyTo:s,scrollToReplyForm:n},e.id))},e5=e=>{let{sortBy:t,setSortBy:r}=e,{t:l}=(0,y.$G)("common",{keyPrefix:"product_detail"});return(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-forest-green-500/40",children:l("reviews.sort_by")}),(0,a.jsxs)(eX.Ph,{defaultValue:"-created_at",onValueChange:r,value:t,children:[(0,a.jsx)(eX.i4,{className:"w-fit border-none bg-transparent text-forest-green-500",children:(0,a.jsx)(eX.ki,{})}),(0,a.jsx)(eX.Bw,{className:"flex flex-col gap-5 bg-white",children:e2().map(e=>(0,a.jsx)(eX.Ql,{value:e.value,className:"text-sm text-forest-green-500",children:e.label},e.value))})]})]})};var e3=r(4298),e8=r.n(e3),e7=r(98964),e9=r(98521),te=r(19453),tt=r(42083),tr=r(62141),tl=r(36237),ts=r(50048),tn=r(33839);let ti=[1,2,3,4,5],ta=e=>{var t,r,l,s,n,i,o,c;let{product:d,myReview:u,type:m,setMode:x,isTestIt:p}=e,{t:h}=(0,y.$G)("common",{keyPrefix:"product_detail"}),{isSuccess:g}=(0,eo.nu)(),v=(0,R.useRouter)(),j=(0,eT.H1)("review"),{data:w,isSuccess:b}=(0,tl.Z0)({per_page:"1",page:"1",...(null==d?void 0:d.id)&&{"filter[product_id]":d.id.toString()},"filter[current_user]":"1"},p),N=null==u?void 0:u.rate,k=null==u?void 0:u.description,z=(null==w?void 0:null===(r=w.data)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.id)||0,S=null==w?void 0:null===(s=w.data)||void 0===s?void 0:null===(l=s[0])||void 0===l?void 0:l.testing_start_date,E=!!S&&(0,tr.A)(new Date,S),P=K.z.object({rate:K.z.number({required_error:h("rating_required","Product rating is required")}).refine(e=>ti.includes(e),{message:h("rating_invalid","Rating has to be between 1 to 5 stars.")}),description:K.z.string({required_error:h("description_required","Description is required")}).min(5,{message:h("description_too_short","Description is too short. At least 5 characters")})}),T=(0,e7.EQ)(m).with("create",()=>({rate:0,description:""})).with("edit",()=>({rate:N||0,description:k||""})).exhaustive(),I=(0,e9.lW)(d),L=(0,e9.b_)(null==u?void 0:u.id,null==d?void 0:d.uuid),A=(0,e9.t$)(z,d),D=(0,J.cI)({criteriaMode:"all",mode:"onBlur",resolver:(0,W.F)(P),defaultValues:T}),q=async e=>{if(!g){v.push({pathname:eu._.signin,query:{next:v.asPath,review:e.description}});return}(0,e7.EQ)(m).with("create",()=>p?A:I).with("edit",()=>L).exhaustive().mutate(e),null==x||x({type:"read"})};(0,O.useEffect)(()=>{j&&(D.setValue("description",j),v.replace({pathname:v.pathname,query:{...v.query,review:void 0}},void 0,{shallow:!0}))},[D,j,v]);let F=b&&!!(null==w?void 0:null===(n=w.data)||void 0===n?void 0:n.length),Z=null!==(c=b&&(null==w?void 0:null===(o=w.data)||void 0===o?void 0:null===(i=o[0])||void 0===i?void 0:i.isConfirmed))&&void 0!==c&&c;if(p&&(!F||!Z||!E))return null;let M=(0,e7.EQ)(p).with(!0,()=>h("reviews.add_testit_review_title","Test it review")).with(!1,()=>h("reviews.add_review_title")).exhaustive();return(0,a.jsx)(ei.l0,{...D,children:(0,a.jsxs)("form",{className:(0,_.cn)("flex h-fit flex-col rounded-lg bg-primary-300 p-6",!f.gs&&"bg-bg-cz-darker"),onSubmit:D.handleSubmit(q),children:[(0,a.jsx)("div",{className:"mb-6 flex items-center gap-2 ",children:(0,a.jsx)(C.w,{size:"h2",className:"text-3xl font-bold",children:M})}),(0,a.jsx)(ei.Wi,{control:D.control,name:"rate",render:e=>{let{field:t}=e;return(0,a.jsx)(ts.J,{size:"x-large",value:t.value,onChange:t.onChange,label:(0,a.jsx)("span",{className:(0,_.cn)("text-forest-green-500",!f.gs&&"text-cz-gray-300"),children:h("reviews.product_rating")}),emptyStarColor:"#00000014"})}}),(0,a.jsx)(tn.L,{size:4}),(0,a.jsx)(ei.Wi,{control:D.control,name:"description",render:e=>{let{field:t}=e;return(0,a.jsxs)(ei.xJ,{className:"flex flex-col",children:[(0,a.jsx)(ei.lX,{className:(0,_.cn)("text-forest-green-500",!f.gs&&"text-cz-gray-300"),children:h("reviews.review")}),(0,a.jsx)(ea.K,{value:t.value,onChange:t.onChange,className:"h-[11rem] rounded-md bg-white px-3 py-2 placeholder:font-light",placeholder:h("reviews.review_placeholder")}),(0,a.jsx)(ei.zG,{})]})}}),(0,a.jsx)(en.zx,{type:"submit",disabled:D.formState.isSubmitting,className:"mt-6",children:"edit"===m?h("reviews.review_edit","Edit review"):h("reviews.review_submit")})]})})};var to=r(54676),tc=r(21064),td=r(28105),tu=r(18238);let tm=e=>{let{review:t,setMode:r}=e,{t:l}=(0,T.LD)("reviews");return(0,a.jsxs)(tc.Zb,{className:(0,_.cn)("bg-primary-300 p-6",!f.gs&&"bg-bg-cz-darker"),children:[(0,a.jsx)(tc.Ol,{className:"mb-6",children:(0,a.jsxs)("div",{className:"flex w-full gap-4",children:[(0,a.jsx)(C.w,{size:"h2",children:l("my_review_title","My Review")}),(0,a.jsx)(tx,{})]})}),(0,a.jsxs)(tc.aY,{className:"flex flex-col gap-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("p",{className:(0,_.cn)("text-sm font-medium text-forest-green-500",!f.gs&&"text-cz-gray-300"),children:l("rating_label","Product rating")}),(0,a.jsx)(eS.T,{stars:null==t?void 0:t.rate,size:"large",emptyStarColor:"#00000014",isStatic:!0})]}),(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:(0,_.cn)("text-base text-forest-green-500",!f.gs&&"text-cz-gray-300"),children:null==t?void 0:t.description})}),(0,a.jsx)(tc.eW,{children:(0,a.jsxs)(en.zx,{onClick:()=>r({type:"edit"}),variant:"outline",className:"w-full gap-2 border-forest-green-200 bg-transparent",children:[(0,a.jsx)(to.Z,{}),(0,a.jsx)("p",{children:l("edit_button","Edit")})]})})]})]})},tx=()=>{let{t:e}=(0,T.LD)("reviews");return(0,a.jsx)(td.pn,{children:(0,a.jsxs)(td.u,{delayDuration:100,children:[(0,a.jsx)(td.aJ,{children:(0,a.jsx)(tu.Z,{})}),(0,a.jsx)(td._v,{sideOffset:10,className:"bg-forest-green-500 text-white",children:(0,a.jsx)("p",{children:e("your_review_box_tooltip","You can edit your review here.")})})]})})},tp=e=>{var t;let{product:r,type:l}=e,[s,n]=(0,O.useState)({type:"create"}),{data:i}=(0,e9.O7)(null==r?void 0:r.uuid,l),o=null==i?void 0:null===(t=i.data)||void 0===t?void 0:t[0],c=null!=o;(0,O.useEffect)(()=>{c&&n({type:"read"})},[c,n]);let d=(0,e7.EQ)(s.type).with("read",()=>(0,a.jsx)(tm,{review:o,setMode:n})).with("edit","create",e=>(0,a.jsx)(ta,{product:r,myReview:o,type:e,setMode:n,isTestIt:"test-it"===l})).exhaustive();return(0,a.jsx)("div",{className:"w-full flex-grow lg:max-w-[30rem]",children:d})},th="right-ad",tg="right010",tf=()=>{let e=(0,eY.y)().t;return[{value:"-created_at",label:e("reviews.sorting.newest")},{value:"created_at",label:e("reviews.sorting.oldest")},{value:"like_count",label:e("reviews.sorting.highest_ranking")},{value:"-like_count",label:e("reviews.sorting.lowest_rating")}]},tv="reviews",tj=e=>{let{product:t,type:r}=e,{t:l}=(0,T.LD)("product_detail.reviews"),[s,n]=(0,O.useState)("-created_at"),{reviewData:i,isLoading:o,isSuccess:c,paginationElement:d}=(0,e9.X3)(null==t?void 0:t.uuid,s,r,tv),u=null==i?void 0:i.data,m=c&&(null==u?void 0:u.length)===0,x=(0,e7.EQ)(r).with("product",()=>l("title")).with("test-it",()=>l("title_testit","Test it reviews")).exhaustive();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(e8(),{type:"application/ld+json",id:"review-structured-data",children:JSON.stringify((0,tt.I)(u).getStructuredData())}),(0,a.jsx)(eJ.W_,{name:tv,children:(0,a.jsxs)("div",{className:"pb-2 pt-14",children:[(0,a.jsx)(C.w,{size:"h2",className:"mb-6",children:x}),(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-forest-green-500/40",children:l("sort_by")}),(0,a.jsx)(tb,{sortBy:s,setSortBy:n})]}),(0,a.jsxs)("div",{className:"mb-10 flex flex-col items-start gap-10 lg:flex-row",children:[(0,a.jsx)("div",{className:"row-start-1 row-end-3 w-full flex-grow lg:w-2/3",children:m?(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-sm text-forest-green-500",children:l("no_review","No reviews yet")})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(tw,{reviews:u,isLoading:o}),(0,a.jsx)("div",{className:"mt-10",children:d})]})}),(0,a.jsxs)("div",{className:"flex flex-col gap-4 w-full flex-grow lg:max-w-[30rem]",children:[(0,a.jsx)(tp,{product:t,type:r}),(0,a.jsx)("div",{id:th,"data-cts-position":tg,className:"hidden lg:block"})]})]})]})})]})},tw=e=>{let{reviews:t,isLoading:r}=e;return r?Array.from({length:5},(e,t)=>t+1).map(e=>(0,a.jsx)(te.hS,{},e)):null==t?void 0:t.map((e,t)=>(0,a.jsx)(te.a1,{isFirst:0===t,review:e},e.id))},tb=e=>{let{sortBy:t,setSortBy:r}=e;return(0,a.jsxs)(eX.Ph,{onValueChange:r,value:t,children:[(0,a.jsx)(eX.i4,{className:"w-fit border-none bg-transparent text-forest-green-500",children:(0,a.jsx)(eX.ki,{className:""})}),(0,a.jsx)(eX.Bw,{className:"flex flex-col gap-5 bg-white",children:tf().map(e=>(0,a.jsx)(eX.Ql,{value:e.value,className:"text-sm text-forest-green-500",children:e.label},e.value))})]})};var ty=r(19484),tN=r(17684),t_=r(76006),tk=r(75289);let tz=e=>{let{ingredients:t}=e,r=(0,tk.h)({itemsPerPage:7,totalItems:t.length}),l=t.slice(7*r.currentPageIndex,(r.currentPageIndex+1)*7);return(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[l.map(e=>(0,a.jsx)(tN.M,{ingredient:e,titleSize:"h3",hasBorderBottom:!0},e.uuid)),(0,a.jsx)(t_.f,{forcePage:r.currentPageIndex,changePage:r.changePage,pageCount:r.pageCount})]})},tC=e=>{let{ingredients:t}=e,{t:r}=(0,y.$G)("common",{keyPrefix:"product_detail"}),l=[{title:r("ingredients.types.lowrisk","Low risk"),dotColor:"warning"},{title:r("ingredients.types.safe","Safe"),dotColor:"success"},{title:r("ingredients.types.highrisk","High risk"),dotColor:"error"},{title:r("ingredients.types.unknown","Unknown"),dotColor:"gray"}];return(0,a.jsx)("div",{className:"section-content flex flex-wrap pb-2 pt-14",children:(0,a.jsxs)("div",{className:"order-2 grid w-full grid-cols-1 gap-10 md:order-3 md:grid-cols-12",children:[(0,a.jsxs)("div",{className:"col-span-1 flex flex-col gap-2 md:col-span-4",children:[(0,a.jsx)(C.w,{size:"h2",className:"text-3xl",children:r("ingredients.title")}),f.gs&&(0,a.jsx)("div",{className:"mb-4 flex flex-wrap gap-4 border-b border-b-badge-beige pb-4",children:l.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ty.o,{variant:e.dotColor}),(0,a.jsx)("span",{className:"text-sm text-forest-green-400",children:e.title})]},e.title))}),(0,a.jsx)(P.gA,{ingredients:t})]}),(0,a.jsx)("div",{className:"col-span-1 md:col-span-8",children:(0,a.jsx)(tz,{ingredients:t})})]})})};var tS=r(43124);let tE=async e=>
36{if(await (0,Y.S)(),!e.ingredients)throw Error("Ingredients are required");let t=await X.h.post("/ingredient-change-requests/multiple",e);return(0,ee.JH)(t)},tP=()=>{let{t:e}=(0,T.LD)("product_detail");return(0,$.D)({mutationFn:tE,onSuccess:()=>{H.Am.success(e("add_missing_ingredients_success_toast","Ingredients are added successfully. They'll be reviewed by our admins"))},onError:ee.pE})};var tT=r(90671),tI=r(25453),tL=r(12378);function tA(){return(tA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)({}).hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(null,arguments)}var tO=function(e){return O.createElement("svg",tA({xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",viewBox:"0 0 25 24"},e),i||(i=O.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12.5 5v14M5.5 12h14"})))};let tD=e=>{var t;let{ingredients:r,product:l}=e,{t:s}=(0,T.LD)("product_detail"),{isOpen:n,setIsOpen:i,closeModal:o}=(0,ec.E)(),[c]=(0,O.useState)(!1),d=null!==(t=null==r?void 0:r.map(e=>e.name||""))&&void 0!==t?t:[],u=tP(),m=K.z.object({ingredients:K.z.array(K.z.string()).min(1,s("at_least_one_ingredient","At least one ingredient is required"))}),x=(0,J.cI)({defaultValues:{ingredients:[]},resolver:(0,W.F)(m),criteriaMode:"all",mode:"onBlur"}),p=x.watch("ingredients"),h=e=>{x.setValue("ingredients",[...p,e.value]),x.trigger("ingredients")},g=()=>{let e=x.getValues("ingredients");e.pop(),x.setValue("ingredients",e),x.trigger("ingredients")},f=e=>{x.setValue("ingredients",p.filter(t=>t!==e.label)),x.trigger("ingredients")},v=(0,e7.EQ)(c).with(!0,()=>(0,a.jsx)(en.zx,{type:"button",variant:"primary",className:"w-full",disabled:c,children:(0,a.jsx)(tT.a,{className:"size-5"})})).with(!1,()=>(0,a.jsxs)("div",{className:"grid w-full grid-cols-2 gap-4",children:[(0,a.jsx)(tS.GG,{asChild:!0,children:(0,a.jsx)(en.zx,{type:"button",variant:"outline",className:"col-span-1",children:s("cancel_button","Cancel")})}),(0,a.jsx)(en.zx,{type:"submit",variant:"primary",className:"col-span-1",disabled:!x.formState.isValid,children:s("confirm_button","Confirm")})]})).exhaustive();return(0,a.jsxs)(tL.Vq,{open:n,onOpenChange:i,children:[(0,a.jsx)(tL.hg,{asChild:!0,children:(0,a.jsxs)(en.zx,{variant:"outline",className:"order-3 mt-10 flex grow gap-2 md:order-2 md:mt-0 md:grow-0",children:[(0,a.jsx)(tO,{}),(0,a.jsx)("span",{children:s("ingredients.add_missing_ingredients")})]})}),(0,a.jsxs)(tL.cZ,{className:"sm:max-w-lg lg:rounded-2xl",children:[(0,a.jsx)(C.w,{size:"h4",children:s("ingredients.add_missing_ingredients")}),(0,a.jsx)(ei.l0,{...x,children:(0,a.jsxs)("form",{onSubmit:x.handleSubmit(e=>{let t=null==l?void 0:l.id;if(null==t){H.Am.error(s("product_not_found","Product not found"));return}let r={product_id:t,ingredients:e.ingredients.map(e=>({name:e}))};u.mutate(r),o()}),className:"flex flex-col gap-4",children:[(0,a.jsx)(ei.Wi,{name:"ingredients",control:x.control,render:e=>{var t;let{field:r}=e;return(0,a.jsxs)(ei.xJ,{children:[(0,a.jsx)(ei.lX,{children:s("ingredients_label","Ingredients")}),(0,a.jsx)(tI.p,{value:r.value?null===(t=r.value)||void 0===t?void 0:t.map(e=>({value:e,label:e})):[],add:h,remove:f,pop:g,placeholder:s("ingredients_placeholder","Start by typing name of the ingredient"),excludedValues:d,optionValue:"name"})]})}}),v]})})]})]})},tq=e=>{let{product:t}=e,{t:r}=(0,T.LD)("product_detail.ingredients");return(0,a.jsxs)("div",{className:"section-content flex flex-col gap-4 pb-2 pt-14 mb-20",children:[(0,a.jsx)(C.w,{size:"h2",children:r("title")}),(0,a.jsx)("div",{className:"mb-6 flex justify-center gap-2",children:(0,a.jsx)("span",{className:"text-sm text-forest-green-300",children:r("empty_ingredients","There are no ingredients yet. Feel free to add them.")})}),(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(tD,{ingredients:[],product:t})})]})},tF=e=>{let{ingredients:t,product:r}=e;return(0,a.jsxs)("div",{className:"mb-8 lg:mb-16",children:[t&&t.length>0?(0,a.jsx)(tC,{ingredients:t}):(0,a.jsx)(tq,{product:r}),(0,a.jsx)("div",{id:"content-bottom-advertisement","data-cts-position":"content-bottom",className:"section-content"})]})};var tZ=r(41664),tM=r.n(tZ);let tV=e=>{let{defaultValue:t,items:r,theme:l,onTabClick:s}=e;return(0,a.jsxs)(eF.mQ,{defaultValue:t,children:[tQ&&(0,a.jsx)(eF.dr,{theme:l,className:"mb-3 w-full justify-start gap-2 overflow-auto border-0",children:r.map(e=>{let{value:t,label:r}=e;return(0,a.jsx)(eF.SP,{className:"rounded-full border border-forest-green-200 bg-transparent px-3 py-1 text-forest-green-500 data-[state=active]:border-forest-green-500 data-[state=active]:bg-forest-green-500 data-[state=active]:text-white",value:t,theme:l,onClick:()=>null==s?void 0:s(t),children:(0,a.jsx)("span",{children:r})},t)})}),r.map((e,t)=>{let{content:r,value:l}=e;return(0,a.jsx)(eF.nU,{value:l,children:r},"".concat(l,"_content_").concat(t))})]})};var tR=r(94185),tB=r(88771),tU=r(44063);let tG=()=>{let{t:e}=(0,T.LD)("similar_products");return{items:(0,O.useMemo)(()=>[{value:"most_similar",label:e("most_similar","Most similar"),content:(0,a.jsx)(tW,{})},{value:"cheaper",label:e("cheaper","Cheaper"),content:(0,a.jsx)(tW,{})},{value:"more_expensive",label:e("more_expensive","More expensive"),content:(0,a.jsx)(tW,{})},{value:"cruelty_free",label:e("cruelty_free","Cruelty free"),content:(0,a.jsx)(tW,{})},{value:"vegan",label:e("vegan","Vegan"),content:(0,a.jsx)(tW,{})}],[e])}},tW=()=>{var e;let t=(0,eT.H1)("slug"),{data:r,isLoading:l,isFetching:s}=(0,U.F3)(t);return l||s?(0,a.jsx)(tR.g,{children:[0,1,2,3].map(e=>(0,a.jsx)(tU.m,{type:"marketplace_large"},e))}):(0,a.jsx)(tR.g,{children:null==r?void 0:null===(e=r.data)||void 0===e?void 0:e.map(e=>
36(0,a.jsx)("div",{className:"w-[15rem] shrink-0 flex-grow snap-start",children:(0,a.jsx)(tM(),{href:(0,v.A)(e).getProductUrl(),rel:(0,v.A)(e).getProductUrlRel(),target:(0,v.A)(e).getProductUrlTarget(),children:(0,a.jsx)(tB.N,{product:e})})},e.uuid))})},tQ=!1,tJ=()=>{let{items:e}=tG();return(0,a.jsx)(tV,{items:e,defaultValue:"most_similar"})},tK=e=>{let{product:t}=e,{t:r}=(0,y.$G)("common",{keyPrefix:"product_detail"}),l=(0,v.A)(t).getProductCategoryUrl();return(0,a.jsxs)("div",{className:"section-content mb-8 lg:mb-16",children:[(0,a.jsx)("div",{className:"pb-2 pt-14 ",children:(0,a.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,a.jsx)(C.w,{size:"h2",className:"text-3xl",children:r("similar.title")}),(0,a.jsx)(en.zx,{variant:"ghost",className:"gap-2 text-forest-green-500",asChild:!0,children:(0,a.jsxs)(tM(),{href:l,children:[(0,a.jsx)("span",{children:r("show_more")}),(0,a.jsx)(N.Z,{})]})})]})}),(0,a.jsx)(tJ,{})]})},t$=e=>{var t;let{product:r}=e,{t:l}=(0,y.$G)("common",{keyPrefix:"product_detail"}),s=(0,R.useRouter)(),n=(0,eM.useSearchParams)(),i=(0,v.A)(r);return{items:(0,O.useMemo)(()=>[{value:"review",label:(0,a.jsx)(tH,{title:l("tabs.reviews"),Icon:(0,a.jsx)(eQ,{})}),content:(0,a.jsx)(tj,{product:r,type:"product"})},{value:"ingredients",label:(0,a.jsx)(tH,{title:l("tabs.ingredients"),Icon:(0,a.jsx)(eU,{})}),content:(0,a.jsx)(tF,{ingredients:null==r?void 0:r.ingredients,product:r})},{value:"similar_products",label:(0,a.jsx)(tH,{title:l("tabs.similar_products"),Icon:(0,a.jsx)(eG.Z,{})}),content:(0,a.jsx)(tK,{product:r})},{value:"discussions",label:(0,a.jsx)(tH,{title:l("tabs.discussions"),Icon:(0,a.jsx)(eR,{})}),content:(0,a.jsx)(e4,{productId:null==r?void 0:r.id})},...f.gs?[{value:"testit_review",label:(0,a.jsx)(tH,{title:l("tabs.testit_reviews","Test it reviews"),Icon:(0,a.jsx)(eQ,{})}),content:(0,a.jsx)(tj,{product:r,type:"test-it"})}]:[]],[l,r]),defaultTab:null!==(t=n.get("activeTab"))&&void 0!==t?t:"review",onTabClick:(0,O.useCallback)(e=>{s.replace(i.getProductInternalUrl({activeTab:e}),void 0,{scroll:!1,shallow:!0})},[s,i])}},tH=e=>{let{Icon:t,title:r}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"hidden lg:block",children:t}),(0,a.jsx)("span",{children:r})]})},tX=e=>{let{product:t}=e,{items:r,onTabClick:l,defaultTab:s}=t$({product:t});return(0,a.jsx)("section",{className:"section-content mt-20",children:(0,a.jsx)(eZ,{defaultValue:s,items:r,theme:"dark",onTabClick:l})})},tY="list-advertisement",t0="content010",t1="list-advertisement20",t2="content020",t4=e=>{let{product:t}=e,r=(0,v.A)(t).getProductBreadcrumbLinks(),l=null==t?void 0:t.name,{t:s}=(0,T.LD)("product_detail.video");return t?(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"overflow-hidden",children:[(0,a.jsx)("section",{className:(0,_.cn)("py-6",!f.gs&&"bg-bg-cz-darker"),children:(0,a.jsxs)("div",{className:"section-content",children:[(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(j.a,{links:r})}),(0,a.jsxs)("div",{className:"flex flex-col gap-10 md:flex-row lg:grid-cols-product-detail-header",children:[(0,a.jsx)(V,{images:t.images,productName:t.name}),(0,a.jsx)(eq,{product:t})]})]})}),(0,a.jsx)(z,{product:t}),(0,a.jsx)("div",{id:tY,"data-cts-position":t0,className:"section-content py-6"}),(0,a.jsx)(I,{ingredients:t.ingredients}),(0,a.jsx)("div",{id:t1,"data-cts-position":t2,className:"section-content py-6"}),(0,a.jsx)(tX,{product:t}),(0,S.I)(t.video_url)&&(0,a.jsxs)("div",{className:"section-content py-6",children:[(0,a.jsx)(C.w,{size:"h2",className:"mb-2",children:s("title")}),(0,a.jsx)("p",{className:"mb-6 text-sm text-forest-green-300",children:s("subtitle")}),(0,a.jsx)(S.v,{url:t.video_url})]}),f.gs&&(0,a.jsx)(b.i,{variant:"sunset",analyticsSection:"similar_products",productIdToSearch:t.id,productNameToSearch:l}),(0,a.jsx)(E.V,{}),(0,a.jsx)(w.i,{})]})}):null};var t6=r(66547),t5=r(55403),t3=r(12780),t8=!0;function t7(e){var t,r;let{product:l}=e,s=(0,v.A)(l),n=(0,u.J1)(),i=(0,T.NE)();(0,eT.US)(!0,()=>{var e,t;(0,ey.BX)("view_item",{user_id:null===(e=n.data)||void 0===e?void 0:e.data.id,ecommerce:{currency:"HUF",value:null==l?void 0:l.price,items:[{item_id:null==l?void 0:l.id,item_name:null==l?void 0:l.name,item_category:s.getProductCategoryName(),item_brand:null==l?void 0:null===(t=l.brand)||void 0===t?void 0:t.t
36itle,price:null==l?void 0:l.price,quantity:1}]}})});let{adScriptJsx:o,adsReady:j}=(0,d.M)(t6._i.product);return(0,t6.h3)(j,[...p.rd,{place:t0,id:tY},{place:t2,id:t1},{place:tg,id:th}]),(0,a.jsxs)(p.Ar,{header:(0,a.jsx)(x.h,{}),footer:(0,a.jsx)(m.$,{}),mainClassName:"",children:[o,(0,a.jsx)("script",{type:"application/ld+json",id:"product-structured",dangerouslySetInnerHTML:{__html:JSON.stringify(s.getProductStructuredData()).replace(/</g,"\\u003c")}}),(0,a.jsx)(g.V,{title:null==l?void 0:l.name}),(0,a.jsx)(h.V,{description:(0,t3.I)(null==l?void 0:l.description)||(null==l?void 0:l.name),canonical:(0,t5.Y)()}),(0,a.jsxs)(c(),{children:[(0,a.jsx)("meta",{property:"og:site_name",content:i}),(0,a.jsx)("meta",{name:"keywords",content:s.getProductKeywords()}),(0,a.jsx)("meta",{property:"og:url",content:"".concat(f.OB.NEXT_PUBLIC_CLIENT_APP).concat(s.getProductUrl())}),(0,a.jsx)("meta",{property:"og:type",content:"product"}),(0,a.jsx)("meta",{property:"og:image",content:"".concat(f.OB.NEXT_PUBLIC_IMAGE_HOST,"/").concat(null==l?void 0:null===(r=l.images)||void 0===r?void 0:null===(t=r[0])||void 0===t?void 0:t.path)})]}),(0,a.jsx)(t4,{product:l})]})}},73338:function(e,t,r){"use strict";r.d(t,{j:function(){return S}});var l=r(85893),s=r(56312),n=r(43124),i=r(68453),a=r(87536),o=r(91444),c=r(98964),d=r(1604),u=r(97647),m=r(20052),x=r(57964),p=r(86851),h=r(186),g=r(90671),f=r(82417),v=r(12378),j=r(10996),w=r(85457),b=r(68894),y=r(48755),N=r(40180),_=r(13880),k=r(55716),z=r(2809),C=r(18974);let S=e=>{var t,r,S;let{productSlugs:E}=e,{t:P}=(0,C.LD)("products.detail.actions.collection"),T=(0,u.FD)(),{isOpen:I,closeModal:L,setIsOpen:A}=(0,_.E)();(0,N.kC)(I);let O=T.isPending,D=d.z.object({collectionId:d.z.string()}),q=(0,m.J1)(),F=null!==(S=(0,k.U)(null===(t=q.data)||void 0===t?void 0:t.data).getUserCollections().map(e=>{var t;return null==e.id||null==e.title?null:{label:e.title,value:null===(t=e.id)||void 0===t?void 0:t.toString()}}).filter(z.C_))&&void 0!==S?S:[],Z=(0,a.cI)({defaultValues:{collectionId:null===(r=F[0])||void 0===r?void 0:r.value},resolver:(0,s.F)(D),criteriaMode:"all",mode:"onBlur"}),M=(0,c.EQ)(O).with(!0,()=>(0,l.jsx)(f.zx,{type:"button",variant:"primary",className:"w-full",disabled:O,children:(0,l.jsx)(g.a,{className:"size-5"})})).with(!1,()=>(0,l.jsxs)("div",{className:"grid w-full grid-cols-2 gap-4",children:[(0,l.jsx)(n.GG,{asChild:!0,children:(0,l.jsx)(f.zx,{type:"button",variant:"outline",className:"col-span-1",children:P("cancel_button","Cancel")})}),(0,l.jsx)(f.zx,{type:"submit",variant:"primary",className:"col-span-1",disabled:!Z.formState.isValid,children:P("confirm_button","Confirm")})]})).exhaustive();return E?(0,l.jsxs)(v.Vq,{open:I,onOpenChange:A,children:[(0,l.jsx)(v.hg,{asChild:!0,children:(0,l.jsx)(f.zx,{variant:"ghost",className:(0,y.cn)("flex items-center justify-start gap-2 hover:bg-bg-darker",!b.gs&&"hover:bg-cz-gray-300 hover:text-white"),children:P("add_to_collection_button","Add to Collection")})}),(0,l.jsx)(v.cZ,{className:"sm:max-w-lg lg:rounded-2xl",children:(0,l.jsx)(j.l0,{...Z,children:(0,l.jsxs)("form",{onSubmit:Z.handleSubmit(e=>{var t;E&&0!==E.length&&T.mutate({collectionId:null!==(t=parseInt(e.collectionId))&&void 0!==t?t:0,products:[...E]},{onSuccess:()=>{L(),o.Am.success(P("append_success","Product was successfully added to collection"))},onError:()=>{L(),o.Am.error(P("append_error","Unable to add product to collection"))},onSettled:()=>{Z.reset({collectionId:void 0})}})}),className:"flex flex-col gap-4",children:[(0,l.jsx)(p.D,{variant:"layers"}),(0,l.jsx)(w.w,{size:"h4",children:P("add_to_collection_button","Add to Collection")}),(0,l.jsx)(j.Wi,{control:Z.control,name:"collectionId",render:e=>{let{field:t}=e;return(0,l.jsx)(h.R,{label:P("collection_label","Collection"),onChange:t.onChange,value:t.value,options:F})}}),(0,l.jsx)(x.y,{triggerElement:(0,l.jsxs)(f.zx,{type:"button",variant:"text",className:"flex w-full justify-start gap-2 px-0 text-left text-sm font-semibold text-forest-green-500",children:[(0,l.jsx)(i.Z,{className:"size-5"}),P("create_new_collection","Create new collection")]}),initialProducts:E}),M]})})})]}):null}}},function(e){e.O(0,[9226,6859,5675,4878,723,9619,150,3995,919,2590,99,7836,9316,1375,6392,5223,384,5086,3789,4608,9293,5325,6773,8006,2888,9774,179],function(){return e(e.s=62847)}),_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.