PageSourceSearch

https://nutrafol.com/_next/static/chunks/app/(checkout)/checkout/c…?dpl=dpl_AbV8fsYBm8KmcgGpigu56RyYEWcy

js nutrafol.com collected 2026-10-01 12:26:39 UTC 45,151 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6044],{4853:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var l in t)Object.defineProperty(e,l,{enumerable:!0,get:t[l]})}(t,{cancelIdleCallback:function(){return n},requestIdleCallback:function(){return l}});let l="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},n="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7238:(e,t,l)=>{"use strict";l.d(t,{default:()=>ef});var n=l(95155),a=l(12115),r=l(51162),o=l(69686),s=l(35181),i=l(52876);let c=()=>{var e;let t="men"===(null!=(e=(0,s.CR)(s.K1.LAST_THEME))?e:"master")?"/hair/men/product/category/":"/hair/brand/product/category/";return(0,n.jsx)("div",{className:"flex flex-col h-full justify-center items-center py-10 lg:py-20",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(o.TextElementNova,{text:"Your cart is empty.",element:"h4",className:"Subtitle-20-Dia-Normal text-center mb-10"}),(0,n.jsx)(r.ButtonNova,{label:"Continue shopping",icon:"Right",className:"mx-auto",ctaLink:t,onClick:()=>{(0,i.a5)("Marketing CTA Clicked",{text:"Continue Shopping",type:"button",destination:t})}})]})})};var d=l(71877),u=l(11958),m=l(70405),p=l(20921),x=l(6829),v=l(48825);let h="Your discount code was removed because it is no longer valid with your current cart items.",f=()=>{let[e,t]=(0,a.useState)(""),[l,r]=(0,a.useState)(""),[i,c]=(0,a.useState)(!1),[d,f]=(0,a.useState)([]),g=(0,a.useRef)(!1),b=(0,a.useRef)(!1),{cartData:y,cartPageToastMessage:j,setCartPageToastMessage:N,setIsLoadingCartPage:w,isLoadingCartPage:_,hasError:k,onCartUpdate:S}=(0,a.useContext)(m.A);(0,a.useEffect)(()=>{let e=(0,x.v8)("mage-messages");if(e){try{let t=decodeURIComponent(e).replace(/&quot;/g,"'").replace(/&#039;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#47;/g,"/");if(t){let e=JSON.parse(t),l=Array.isArray(e)?e:[e],n=["coupon code","discount code"],a=l.filter(e=>{var t;let l=(null==(t=e.text)?void 0:t.toLowerCase())||"";return!n.some(e=>l.includes(e))}).filter((e,t,l)=>t===l.findIndex(t=>t.type===e.type&&t.text===e.text));f(a)}}catch(e){console.error("Failed to parse mage-messages cookie:",e)}setTimeout(()=>{(0,x.Yj)("mage-messages")},250)}},[]),(0,a.useEffect)(()=>{g.current&&!_&&f([]),g.current=_},[_]),(0,a.useEffect)(()=>{var e;if(b.current)return;let l=(0,s.i7)(),n=(0,s.j)(),a=(null==y||null==(e=y.totals)?void 0:e.coupon_code)||null;if(l||n)if(b.current=!0,l){let{savedCode:e}=(0,p.Od)(l.url),n=(null==e?void 0:e.toLowerCase())||null,o=(null==a?void 0:a.toLowerCase())||null;n&&n!==o&&r(h),N("Item".concat(l.qty>1?"s":""," removed from your cart.")),t(l.url),(0,s.tA)(),(0,s.ci)()}else n&&(0===n.qty&&N("Item removed from your cart."),r(h))},[y]);let C=async()=>{if(c(!0),N(null),r(null),w(!0),e){window.location.href="https://nutrafol.com/"+e;return}if((0,s.j)()){try{let{coupon:e,sku:t,itemId:l,qty:n=0,oldQty:a=0,cartId:r}=(0,s.j)(),o=a-n;if(o>0){let l=null==t?void 0:t.replace("-SP01","-S01"),n=null==t?void 0:t.includes("-SP01"),a="/dpa/add/tocart?skus=".concat(l,"|").concat(o,"&code=").concat(e).concat(n?"&promo_product_enabled=true":"");window.location.href="https://nutrafol.com/"+a}else{let n=!a&&t?(0,u.W$)(t):null;if(n){let t=await (0,p.SM)(r,l);if(!t.ok)throw Error("Failed to remove item: ".concat(t.status));(0,u.I9)(n.upsellId),window.location.href=(0,v.j)(n.originalSku,{purchaseSource:n.purchaseSource,code:n.code||e})}else a>0?await (0,p.AR)(r,l,a):await (0,p.SM)(r,l),await (0,p.DD)(r,e),await S(),c(!1)}}catch(e){N("Failed to undo. Please reload page."),w(!1)}(0,s.ci)()}},T=k||j&&(j.toLowerCase().includes("failed")||j.toLowerCase().includes("unable")||j.toLowerCase().includes("invalid"));return j||l||d.length>0?(0,n.jsxs)("div",{className:"flex flex-col gap-2 mb-10",children:[d.map((e,t)=>(0,n.jsxs)("div",{className:"flex flex-row gap-4 justify-between py-2 px-4 ".concat("error"===e.type?"bg-nova-functional-error":"bg-nova-brand-primary-80"),children:[(0,n.jsx)(o.TextElementNova,{text:e.text,element:"h4",className:"Body-20-Dia-Normal text-nova-base-white"}),(0,n.jsx)("button",{onClick:()=>{f(e=>e.filter((e,l)=>l!==t))},"aria-label":"Dismiss",children:(0,n.jsx)(o.TextElementNova,{text:"\xd7",element:"span",className:"Body-20-Dia-Strong text-nova-base-white"})})]},"mage-".concat(t))),j||l?(0,n.jsxs)("div",{className:"flex flex-row items-center gap-8 justify-between py-2 px-4 ".concat(T?"bg-nova-functional-error":"bg-nova-brand-primary-80"),children:[(0,n.jsxs)("div",{children:[j?(0,n.jsx)(o.TextElementNova,{text:j,className:"Body-20-Dia-Normal text-nova-base-white"}):null,l?(0,n.jsx)(o.TextElementNova,{text:l,className:"Body-10-Dia-Normal text-nova-base-white max-w-[256px] smmd:max-w-none"}):null]}),(0,n.jsx)("div",{className:"flex gap-4",children:(e||(0,s.j)())&&!T&&(0,n.jsx)("button",{onClick:C,"aria-label":"Undo",disabled:i,children:(0,n.jsx)(o.TextElementNova,{text:"Undo",element:"span",className:"CTA-10-Dia-Normal text-nova-base-white border-b border-nova-base-white"})})})]}):null]}):null};var g=l(67370),b=l(27898),y=l(42270);let j=e=>{let{label:t,children:l}=e;return(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)(o.TextElementNova,{text:t,className:"C
1aption-10-Dia-Uppercase"}),l]})},N=e=>{let{id:t,value:l,onChange:a,isLoading:o,isError:s,errorMessage:i,handleApplyDiscount:c}=e;return(0,n.jsxs)("div",{className:"flex flex-wrap",children:[(0,n.jsxs)("div",{className:(0,y.cn)("flex items-center justify-between gap-2 w-full px-4 border border-nova-transparency-black-20 rounded h-[56px] bg-nova-base-white",s&&"border-nova-functional-error text-nova-functional-error"),children:[(0,n.jsx)("input",{name:t,id:t,value:null!=l?l:"",onChange:a,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),c())},className:"textelement nova Caption-10-Dia-Uppercase w-full focus:outline-none active:outline-none max-lg:text-[16px]","data-testid":"textinput",placeholder:"Discount code"}),(0,n.jsx)(r.ButtonNova,{level:"Textlink",label:"Apply",onClick:c,loading:o})]}),s&&i&&(0,n.jsx)(b.d,{message:i})]})},w=e=>{let{totals:t,discountCode:l,handleDiscountChange:a,discountApplied:s,handleApplyDiscount:i,handleRemoveDiscount:c,handleContinueToCheckout:d,isLoading:u,isError:m,errorMessage:p,isCheckoutLoading:x,hideDiscountField:v}=e;return(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-2 md:gap-4",children:[(0,n.jsx)(j,{label:"Subtotal",children:(0,n.jsx)(o.TextElementNova,{text:(0,y.TO)(t.subtotal),className:"Body-10-Dia-Strong"})}),(0,n.jsx)(j,{label:"Shipping",children:(0,n.jsx)(o.TextElementNova,{text:"0"===t.shipping||"0.00"===t.shipping?"Free":(0,y.TO)(t.shipping),className:"Body-10-Dia-Strong"})}),(0,n.jsx)(j,{label:"Taxes",children:t.taxes&&"0.00"!==t.taxes?(0,n.jsx)(o.TextElementNova,{text:(0,y.TO)(t.taxes),className:"Body-10-Dia-Strong"}):(0,n.jsx)(o.TextElementNova,{text:"Calculated at Checkout",className:"Body-10-Dia-Normal italic text-nova-transparency-black-70"})}),s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(j,{label:"Discount (".concat(l,")"),children:(0,n.jsx)(o.TextElementNova,{text:t.discount>0?"-".concat((0,y.TO)(t.discount)):"",className:"Body-10-Dia-Strong pl-1"})}),(0,n.jsx)(r.ButtonNova,{level:"Textlink",label:"Remove Code",onClick:c,className:"ml-4 self-start",loading:u,hidden:v})]}):null,v||s?null:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(N,{id:"discount-code",handleApplyDiscount:i,value:l,onChange:e=>a(e.target.value),isError:m,errorMessage:p,isLoading:u})})]}),(0,n.jsx)(g.A,{className:"hidden md:block my-8 lg:my-10"}),(0,n.jsx)(r.ButtonNova,{level:"Primary",icon:"Right",label:"Proceed to Checkout",onClick:d,loading:x,className:"mt-4 md:mt-0"})]})};var _=l(70815),k=l(20556),S=l(28011),C=l(50976);let T=e=>{var t,l,r,s;let{initialTotals:i}=e,c=function(){let[e,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=navigator.userAgent;t(/android/i.test(e)&&!/samsung/i.test(e))},[]),e}(),{cartData:u,onCartUpdate:x,setCartPageToastMessage:v,setIsLoadingCartPage:h}=(0,a.useContext)(m.A),{isLoggedIn:f}=(0,a.useContext)(k.Ay),g=(null==u?void 0:u.totals)||i,b=(null==g?void 0:g.discount)||0,j=(null==u?void 0:u.hide_checkout_discount_text)||(null==u||null==(t=u.totals)?void 0:t.coupon_code),[N,T]=(0,a.useState)(""),[E,P]=(0,a.useState)(!1),[D,O]=(0,a.useState)(!1),[A,q]=(0,a.useState)(""),[L,I]=(0,a.useState)(!1),B=(0,a.useRef)(b),M=null==(s=Object.values((null==u?void 0:u.items)||{}))||null==(r=s[0])||null==(l=r.quote)?void 0:l.quote_id,F=(0,a.useMemo)(()=>({anonymousId:(0,_.m)(),business_line:"Hair",cart_id:null==g?void 0:g.cart_id,cart_state:(0,p.YU)(null==u?void 0:u.items),cart_value:(null==g?void 0:g.grand_total)||0,coupon:N.replace(/\s/g,"").toLowerCase(),coupon_name:N.replace(/\s/g,"").toLowerCase(),currency:"USD",checkout_type:"standard",error:!1,location:"Cart",masked_id:(null==g?void 0:g.masked_id)||"",page_type:"checkout",product_line:(0,p.gV)(Object.values(null==u?void 0:u.items)),quote_id:M}),[null==u?void 0:u.items,N,M,null==g?void 0:g.cart_id,null==g?void 0:g.grand_total,null==g?void 0:g.masked_id]);(0,a.useEffect)(()=>{T(j||"")},[j]),(0,a.useEffect)(()=>{b&&0===B.current&&S.F.onPromoCodeApplied({...F,discount:b,coupon_amount:b}),B.current=b},[b,F]),(0,a.useEffect)(()=>{let e=e=>{e.persisted&&I(!1)};return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)},[]);let R=!!j,U=()=>{var e;I(!0);
1let t=f||null==u||null==(e=u.totals)?void 0:e.masked_id;(0,C.X)({maskedId:t,quote_id:M})},H=async()=>{if(!(null==g?void 0:g.cart_id)){O(!0),q("Sorry, the discount code you entered is not valid.");return}if(!N.trim()){O(!0),q("Discount code is required"),v(null);return}P(!0),h(!0),O(!1),q(""),v(null);try{let e=await (0,p.DD)(g.cart_id,N);e.ok?(await x(),await e.json()):(O(!0),q(p.J$),S.F.onPromoCodeApplied({...F,discount:0,coupon_amount:0,error:!0,failure_reason:p.J$}))}catch(t){O(!0);let e=t instanceof Error?t.message:"Failed to apply discount code. Please try again.";"Discount code is required"!==e&&v(e),q(p.J$),S.F.onPromoCodeApplied({...F,discount:0,coupon_amount:0,error:!0,failure_reason:p.J$})}finally{P(!1),h(!1)}},$=async()=>{if(!(null==g?void 0:g.cart_id))return void O(!0);O(!1),P(!0),h(!0);try{let e=await (0,p.$Q)(g.cart_id);await e.json(),await x(),S.F.onPromoCodeRemoved(F)}catch(e){O(!0),v(e instanceof Error?e.message:"Failed to remove discount code. Please try again."),S.F.onPromoCodeRemoved({...F,error:!0})}finally{P(!1),h(!1)}},z=e=>{T(e),D&&(O(!1),q(""),v(null))};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,y.cn)("md:hidden fixed bottom-0 left-0 right-0 z-10 bg-nova-base-white px-6 py-4 shadow-reverse",c&&"pb-12"),children:(0,n.jsx)(w,{totals:g,discountCode:N,handleDiscountChange:z,discountApplied:R,handleApplyDiscount:H,handleRemoveDiscount:$,handleContinueToCheckout:U,isError:D,errorMessage:A,isLoading:E,isCheckoutLoading:L,hideDiscountField:null==u?void 0:u.hide_checkout_discount_field})}),(0,n.jsxs)("div",{className:"hidden md:block sticky z-8 top-24 lg:top-[124px]",children:[(0,n.jsxs)("div",{className:"bg-nova-base-solid-10 p-8 lg:p-10 rounded-sm",children:[(0,n.jsx)(o.TextElementNova,{text:"Order Summary",className:"Title-10-Super-Normal pb-4 lg:pb-10"}),(0,n.jsx)(w,{totals:g,discountCode:N,handleDiscountChange:z,discountApplied:R,handleApplyDiscount:H,handleRemoveDiscount:$,handleContinueToCheckout:U,isError:D,errorMessage:A,isLoading:E,isCheckoutLoading:L,hideDiscountField:null==u?void 0:u.hide_checkout_discount_field})]}),(0,n.jsx)(d.A,{})]})]})};var E=l(68158);let P=e=>{let{product:t,useBundledPrice:l}=e,a=t.is_core;return(0,n.jsx)(n.Fragment,{children:a?l?(0,n.jsx)(o.TextElementNova,{text:t.price&&t.bundled_price?"<span class='text-nova-transparency-black-70 line-through mr-1'>".concat((0,y.TO)(t.price),"</span>").concat((0,y.TO)(t.bundled_price)):(0,y.TO)(t.price),element:"p",className:"Body-10-Dia-Normal ml-auto min-w-20 text-right"}):(0,n.jsx)(o.TextElementNova,{text:"<span class='text-nova-transparency-black-70 line-through mr-1'>".concat(t.old_price&&t.old_price!==t.price&&"0.00"!==t.old_price?(0,y.TO)(t.old_price):"","</span>").concat((0,y.TO)(t.price)),element:"p",className:"Body-10-Dia-Normal ml-auto min-w-20 text-right"}):l?(0,n.jsx)(o.TextElementNova,{text:t.price&&t.bundled_price?"<span class='text-nova-transparency-black-70 line-through mr-1'>".concat((0,y.TO)(t.price),"</span>").concat((0,y.TO)(t.bundled_price)):(0,y.TO)(t.price),element:"p",className:"Body-10-Dia-Normal ml-auto min-w-20 text-right"}):(0,n.jsx)(o.TextElementNova,{text:"".concat((0,y.TO)(t.price)),element:"p",className:"Body-10-Dia-Normal ml-auto min-w-20 text-right"})})};var D=l(77752),O=l(61987);let A=e=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",...e,children:(0,n.jsx)("path",{d:"M16.8343 5.33333H4.00098M8.66764 8.83333V13.5M12.1676 8.83333V13.5M15.6676 5.33333V16.4167C15.6676 16.5714 15.6062 16.7197 15.4968 16.8291C15.3874 16.9385 15.239 17 15.0843 17H5.75098C5.59627 17 5.44789 16.9385 5.3385 16.8291C5.2291 16.7197 5.16764 16.5714 5.16764 16.4167V5.33333M13.3343 5.33333V4.16667C13.3343 3.85725 13.2114 3.5605 12.9926 3.34171C12.7738 3.12292 12.4771 3 12.1676 3H8.66764C8.35822 3 8.06148 3.12292 7.84269 3.34171C7.62389 3.5605 7.50098 3.85725 7.50098 4.16667V5.33333",stroke:"currentColor",strokeWidth:"0.875",strokeLinecap:"round",strokeLinejoin:"round"})}),q=e=>{let{value:t,onChange:l}=e,a=t<=1;return(0,n.jsxs)("div",{className:"relative flex items-stretch text-nova-base-black w-[88px] justify-between bg-nova-base-solid-20 rounded",children:[(0,n.jsx)("button",{className:"p-1","aria-label":"Remove item from cart",onClick:()=>{t<=1?l(0):l(t-1)},children:a?(0,n.jsx)(A,{className:"w-5 h-5"}):(0,n.jsx)(D.H,{})}),(0,n.jsx)("div",{className:"text-center flex items-center p-1",children:(0,n.jsx)(o.TextElementNova,{text:t.toString(),element:"p",className:"C
1aption-10-Dia-Uppercase leading-none"})}),(0,n.jsx)("button",{className:"p-1","aria-label":"Add item to cart",onClick:()=>l(t+1),children:(0,n.jsx)(O.F,{})})]})},L=e=>{var t,l;let{product:r}=e,{handleQuantityChange:o}=(0,a.useContext)(m.A),[s,i]=(0,a.useState)((null==(t=r.quote)?void 0:t.qty)||1);return((0,a.useEffect)(()=>{var e;i((null==(e=r.quote)?void 0:e.qty)||1)},[null==(l=r.quote)?void 0:l.qty]),(null==r?void 0:r.admin_only)||r.name.includes("Gift")&&"0.00"===r.price)?null:(0,n.jsx)(q,{value:s,onChange:e=>{i(e),o(r,e,s)}})},I=e=>{let{product:t}=e,{removeItem:l}=(0,a.useContext)(m.A);return(0,n.jsx)(r.ButtonNova,{label:"Remove",level:"Textlink",onClick:()=>l(t),size:"Small",width:"auto"})};var B=l(85808);let M=[{id:"serum-to-fhk",level:"item",conditions:{include:[B.v6,B.ZK],includePromos:["somePromo"],exclude:[...B.I$,...B.N9,...B.jp,...B.NY,...B.ku,...B.mA,...B.KE,...B.Ub]}},{id:"core-onetime-to-fhk",level:"item",conditions:{includePromos:["somePromo"],include:[...B.cG],exclude:[]}},{id:"one-to-three-gwp-men",level:"item",conditions:{includePromos:["menallstar2026"],requireProperty:"three_pack_sku",requireValues:{shipping_interval:["1 month"]},exclude:[B.oT]}},{id:"one-to-three-gwp",level:"item",conditions:{includePromos:["somePromo"],include:[...B.I$,...B.aQ],exclude:[B.Xe,B.oT]}},{id:"three-to-six-gwp",level:"item",conditions:{includePromos:["somePromo"],include:[...B.jp,...B.mA],exclude:[B.Xe,B.oT]}},{id:"growthplan-pdp-core-one-to-three-month",level:"item",conditions:{include:[...B.I$],exclude:[],excludeWhenCouponCodes:["COLLAGENGWP"],requireQuotePurchaseSources:["women_pdp","balance_pdp","postpartum_pdp","advanced_pdp_startstrongkit","balance_pdp_startstrongkit","postpartum_pdp_startstrongkit"],requireOneMonthSubscription:!0}},{id:"hair-serum-upsell",level:"item",conditions:{include:[...B.I$],exclude:[...B.Ry,B.v6,B.k$,B.ZK,B.qs,B.Xe,B.oT,...B.ku,...B.M5,...B.aX,...B.u2],requireProperty:"three_pack_sku",requireCartItemCount:1,excludeWhenEvaluatedPurchaseSourceOneMonthSub:["pdp"]}},{id:"scalp-upsell-combo",level:"cart",conditions:{excludePromos:[],include:[...B.I$,...B.jp,...B.NY],exclude:[...B.Ry,B.v6,B.k$,B.ZK,B.qs,B.Xe,B.oT,...B.ku,...B.M5,...B.aX,...B.u2]}},{id:"growthplan-one-to-three-month",level:"item",conditions:{requireProperty:"three_pack_sku",requireValues:{shipping_interval:["1 month"]},requireMinChildProductCount:2,exclude:[],excludeWhenCouponCodes:["COLLAGENGWP"]}},{id:"core-onetime-to-subscription-swap",level:"item",conditions:{includePromos:["laborday2026-2"],include:[...B.N9],exclude:[],requireCartItemCount:1}},{id:"core-onetime-to-subscription-gwp",level:"item",conditions:{includePromos:["somePromo"],include:[...B.N9],exclude:[],requireCartItemCount:1}},{id:"core-onetime-to-subscription",level:"item",conditions:{include:[...B.N9],exclude:[],requireCartItemCount:1}},{id:"serum-onetime-add-growthplan",level:"item",conditions:{include:[B.v6,B.k$,B.ZK,B.qs],exclude:[...B.I$,...B.N9,...B.jp,...B.NY,...B.ku,...B.mA,...B.KE,...B.Ub]}}],F=e=>{let{message:t,onUndo:l,isLoading:a=!1}=e;return(0,n.jsxs)("div",{className:"flex p-4 bg-nova-base-solid-20 justify-between items-center rounded border border-nova-transparency-black-20",children:[(0,n.jsx)(o.TextElementNova,{text:t,element:"p",className:"Body-10-Dia-Normal"}),(0,n.jsx)(r.ButtonNova,{label:"Undo",size:"Small",level:"Textlink",onClick:l,loading:a})]})};var R=l(43890);let U=(0,l(75978).E)("laborday2026-2"),H=(0,a.lazy)(()=>l.e(9616).then(l.bind(l,99616))),$=(0,a.lazy)(()=>l.e(6799).then(l.bind(l,66799))),z=(0,a.lazy)(()=>l.e(9557).then(l.bind(l,59557))),Y=(0,a.lazy)(()=>l.e(1685).then(l.bind(l,61685))),G=(0,a.lazy)(()=>Promise.all([l.e(8278),l.e(7513),l.e(4321)]).then(l.bind(l,34321))),V=(0,a.lazy)(()=>Promise.all([l.e(7962),l.e(8278),l.e(5445)]).then(l.bind(l,65999))),K=(0,a.lazy)(()=>Promise.all([l.e(8734),l.e(8278),l.e(1166)]).then(l.bind(l,41166))),W=(0,a.lazy)(()=>Promise.all([l.e(2812),l.e(8278),l.e(7513),l.e(6200)]).then(l.bind(l,6200))),J=(0,a.lazy)(()=>Promise.all([l.e(7962),l.e(6563)]).then(l.bind(l,30793))),X=(0,a.lazy)(()=>Promise.all([l.e(8278),l.e(6600)]).then(l.bind(l,46600))),Q=(0,a.lazy)(()=>Promise.all([l.e(7962),l.e(8278),l.e(7171)]).then(l.bind(l,32697))),Z={"hair-serum-upsell":X,"scalp-upsell-combo":H,"growthplan-pdp-core-one-to-three-month":J,"growthplan-one-to-three-month":J,"core-onetime-to-subscription":$,"core-onetime-to-subscription-swap":z,"core-onetime-to-subscription-gwp":Y,"core-onetime-to-fhk":G,"serum-onetime-add-growthplan":K,"serum-to-fhk":W,"one-to-three-gwp":Q,"one-to-three-gwp-men":V,"three-to-six-gwp":Q},ee=e=>{var t,l,n,a;if(1!==e.is_subscription)return!1;let r=null!=(n=null==(t=e.billing_interval)?void 0:t.trim().toLowerCase())?n:"",o=null!=(a=null==(l=e.shipping_interval)?void 0:l.trim().toLowerCase())?a:"";return r.includes("1 month")||o.includes("1 month")},et=(e,t,l,n,a)=>{let{include:r=[],exclude:o=[],includePromos:s=[],excludePromos:i=[],requireProperty:c,requireValues:d,requireMinChildProductCount:u,requireCartItemCount:m,excludeWhenCouponCodes:p,excludeWhenEvaluatedPurchaseSourceOneMonthSub:x,requireQuotePurchaseSources:v,requireOneMonthSubscription:h}=e.conditions;if(((e,t)=>{if(!(null==e?void 0:e.length)||!t)return!1;let l=t.trim().toUpperCase();return e.some(e=>e.trim().toUpperCase()===l)})(p,n)||a&&(null==i?void 0:i.length)>0&&i.includes(a)||((e,t)=>{if(null==e?void 0:e.length){let l=e.map(e=>e.trim().toLowerCase());if(t.some(e=>{var t,n;let a=null==(n=e.quote)||null==(t=n.purchase_source)?void 0:t.trim().toLowerCase();return!!(a&&l.includes(a)&&ee(e))}))return!0}return!1})(x,t)||void 0!==m&&l.length!==m)return!1;let f=t.map(e=>{var t;return null==(t=e.quote)?void 0:t.sku.replace("-SP01","-S01")}),g=l.map(e=>{var t;return null==(t=e.quote)?void 0:t.sku.replace("-SP01","-S01")});if(r.length>0&&!r.some(e=>f.includes(e.toUpperCase()))||s.length>0&&!(a&&s.includes(a))||o.length>0&&o.some(e=>(Array.isArray(e)?e:[e]).some(e=>g.includes(e.toUpperCase())))||d&&!t.some(e=>{var t;let l=null==(t=e.quote)?void 0:t.sku.replace("-SP01","-S01");return(0===r.length||r.includes(l))&&Object.entries(d).every(t=>{let[l,n]=t;return n.includes(String(e[l]))})})||void 0!==u&&!t.some(e=>{var t;let l=null==(t=e.quote)?void 0:t.sku.replace("-SP01","-S01"),n=0===r.length||r.includes(l),a=Array.isArray(e.child_products)?e.child_products.length:Object.keys(e.child_products).length;return n&&a>=u})||c&&!t.some(e=>{var t;let l=null==(t=e.quote)?void 0:t.sku.replace("-SP01","-S01");return(0===r.length||r.includes(l))&&e[c]}))return!1;if(null==v?void 0:v.length){let e=v.map(e=>e.trim().toLowerCase());if(!(t.length>0&&t.every(t=>{var l,n;let a=null==(n=t.quote)||null==(l=n.purchase_source)?void 0:l.trim().toLowerCase();return!!(a&&e.includes(a))})))return!1}return(!h||!!(t.length>0&&t.every(e=>ee(e))))&&!0},el=(e,t)=>
1{let l=M.find(e=>"growthplan-pdp-core-one-to-three-month"===e.id);return!!l&&e.some(n=>et(l,[n],e,t,null==U?void 0:U.name))},en=e=>{var t,l,r,o,i,c,d;let{level:u,product:p}=e,{cartData:x,isLoadingCartPage:v}=(0,a.useContext)(m.A),{items:h}=x||{},f=(0,a.useMemo)(()=>h?Array.isArray(h)?h:Object.values(h):[],[h]),g=null!=(d=null==x||null==(t=x.totals)?void 0:t.coupon_code)?d:null,b=p||("cart"===u?f[0]:void 0),{isUndoAvailable:j,undoData:N,executeUndo:w}=(0,R.A)(b,u),_=(0,s.Pi)(),k=(0,a.useMemo)(()=>{if(!f||0===f.length)return null;if("cart"===u&&_){let e=M.find(e=>"scalp-upsell-combo"===e.id);if(e&&!el(f,g))return e}return M.filter(e=>e.level===u).find(e=>!(!Z[e.id]||"scalp-upsell-combo"===e.id&&(((e,t)=>{let l=M.find(e=>"hair-serum-upsell"===e.id);return!!l&&e.some(n=>et(l,[n],e,t,null==U?void 0:U.name))})(f,g)||el(f,g)))&&et(e,"item"===u&&p?[p]:f,f,g,null==U?void 0:U.name))},[f,u,p,_,g]);if(j){let e={"hair-serum-upsell":"You've added Hair Serum to your monthly subscription.","growthplan-pdp-core-one-to-three-month":"You've upgraded to a 3-month subscription.","growthplan-one-to-three-month":"You've upgraded to a 3-month subscription.","core-onetime-to-subscription":"You've upgraded to a monthly subscription.","core-onetime-to-subscription-gwp":"You've upgraded to a monthly subscription.","core-onetime-to-subscription-swap":"You've upgraded to a monthly subscription.","core-onetime-to-fhk":"You've upgraded to a Fullest Hair Kit monthly subscription.","one-to-three-gwp":"You’ve upgraded to a 3-month subscription.","three-to-six-gwp":"You've upgraded to a 6-month subscription."}[N.upsellId]||"You've updated your cart.";return(0,n.jsx)(F,{message:e,onUndo:w,isLoading:v})}if(!k)return null;let S=Z[k.id];if(!S)return null;let C=!(null==(l=k.conditions)?void 0:l.includePromos)||(null==(o=k.conditions)||null==(r=o.includePromos)?void 0:r.length)===0||(null==(c=k.conditions)||null==(i=c.includePromos)?void 0:i.includes(null==U?void 0:U.name));return(0,n.jsx)(a.Suspense,{fallback:null,children:(0,n.jsx)("div",{"data-rule":k.id,className:(0,y.cn)("cart"===u&&"border-t border-nova-transparency-black-20 md:border-t-0"),children:(0,n.jsx)(S,{product:b,level:u,upsellId:k.id,promoCf:C?U:null})})})};var ea=l(5549),er=l(76117),eo=l(16021);let es=e=>{var t,l,a;let{product:r}=e,s="1"===r.is_package_product,i=1===r.is_subscription,c=(null==(t=r.name)?void 0:t.includes("Gift"))&&"0.00"===r.price,d=(null==(l=r.quote)?void 0:l.row_total)||"0",u=(null==(a=r.quote)?void 0:a.row_old_price_total)||"0",m=r.billing_interval||"",p="3 month"===m,x="6 month"===m,v=()=>{let e="1 month"===m?"Monthly Subscription":"".concat((0,y.s0)(m,!0)," Subscription");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(eo.f,{className:"w-5 h-5 lg:w-[25px] lg:h-[25px]"}),(0,n.jsx)(o.TextElementNova,{text:e,element:"p",className:"Body-20-Dia-Strong"})]}),(0,n.jsx)(o.TextElementNova,{text:(0,y.gG)(d,m),element:"p",className:"Body-20-Dia-Strong text-right ml-auto"})]})};if(s){if(i)if("1 month"!==m)return(0,n.jsx)("div",{className:"flex items-center justify-between gap-4",children:v()});else{let e="1 month"===m?"Monthly Subscription":"".concat((0,y.s0)(m,!0)," Subscription");return(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(o.TextElementNova,{text:"Hair Health Plan",element:"p",className:"Body-20-Dia-Strong mb-1"}),(0,n.jsx)(o.TextElementNova,{text:e,element:"p",className:"Body-10-Dia-Normal text-nova-transparency-black-70"})]}),(0,n.jsx)(o.TextElementNova,{text:(0,y.gG)(d,m),element:"p",className:"Body-20-Dia-Strong text-right"})]})}return(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)(o.TextElementNova,{text:"One-Time Purchase",element:"p",className:"Body-20-Dia-Strong"}),(0,n.jsx)("div",{className:"text-right",children:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&u&&u!==d){let e=parseInt(u.replace(/,/g,""),10).toFixed(0),t=parseInt(d.replace(/,/g,""),10).toFixed(0);return(0,n.jsx)(o.TextElementNova,{text:'<span class="text-nova-transparency-black-70 line-through mr-1">$'.concat(e,"</span>$").concat(t),element:"p",className:"Body-20-Dia-Strong text-nova-base-black"})}return(0,n.jsx)(o.TextElementNova,{text:(0,y.TO)(d),element:"p",className:"Body-20-Dia-Strong text-nova-base-black"})}(!0)})]})}return c?(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)(o.TextElementNova,{text:"Free Gift",element:"p",className:"Body-20-Dia-Strong"}),(0,n.jsx)(o.TextElementNova,{text:(0,y.TO)(d),element:"p",className:"Body-20-Dia-Strong text-right"})]}):m&&(!p&&!x||p||x)?(0,n.jsx)("div",{className:"flex items-center justify-between gap-4",children:v()}):(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)(o.TextElementNova,{text:"One-Time Purchase",element:"p",className:"Body-20-Dia-Strong"}),(0,n.jsx)(o.TextElementNova,{text:(0,y.TO)(d),element:"p",className:"Body-20-Dia-Strong text-right"})]})},ei=e=>{var t,l;let{product:a,showHsaFsaBadge:r}=e,s=(0,p.TP)(a),i=a.name.replace(" One-Time Purchase","").replace(/\\'/g,"'"),c=!!(null==a?void 0:a.admin_only)||a.name.includes("Gift")&&"0.00"===a.price,d=!i.includes("Gift")&&"0.00"!==a.price||"HMATKIT2"===a.sku||"HMATKIT3"===a.sku||"HMATKIT4"===a.sku;return(0,n.jsxs)("div",{className:"flex flex-col gap-6 py-6 md:py-8 lg:p-10",children:[(0,n.jsx)(es,{product:a}),(0,n.jsxs)("div",{className:"flex gap-2 md:gap-4 lg:gap-10 items-center",children:[(0,n.jsx)(E.A,{imageUrl:a.label1}),(0,n.jsxs)("div",{className:"grow flex flex-col justify-between gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(o.TextElementNova,{text:i,element:"p",className:"Body-10-Dia-Normal mb-1 text-nova-base-black"}),(0,n.jsx)(P,{product:a})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(o.TextElementNova,{text:s,element:"p",className:"Body-10-Dia-Normal text-nova-transparency-black-70"}),c&&(0,n.jsx)(o.TextElementNova,{text:"QTY: ".concat((null==a||null==(t=a.quote)?void 0:t.qty)||1),element:"p",className:"Body-10-Dia-Normal text-nova-transparency-black-70 ml-auto"})]}),r&&(0,n.jsx)(ea.A,{eligibility:null==(l=a.quote)?void 0:l.hsa_fsa_eligibility,variant:"cart",className:"mt-2 inline-block w-fit",productLine:(0,er.W)({product_gender:a.product_gender}).product_line,businessLine:a.business_line})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[d?(0,n.jsx)(I,{product:a}):null,(0,n.jsx)(L,{product:a})]})]})]}),(0,n.jsx)(en,{level:"item",product:a})]})};var ec=l(32816);let ed=e=>{let{giftDescription:t,giftUrl:l}=e;return(0,n.jsxs)("div",{className:"flex flex-col gap-6 py-6 md:py-8 lg:p-10",children:[(0,n.jsx)("div",{className:"flex items-center justify-between gap-4",children:(0,n.jsx)(o.TextElementNova,{text:"Free Gift",element:"p",className:"Body-20-Dia-Strong"})}),(0,n.jsxs)("div",{className:"flex gap-2 md:gap-4 lg:gap-10 items-start",children:[(0,n.jsx)(ec.A,{src:(0,y.GL)(l,{width:"256"}),sources:[{media:"(min-width: 0px)",srcSet:(0,y.GL)(l,{width:"256"})}],alt:"Free gift",className:"w-20 md:w-[100px] lg:w-[128px] h-16 md:h-[76px] lg:h-[92px] object-cover"}),(0,n.jsx)("div",{className:"grow flex flex-col gap-4",children:(0,n.jsx)(o.TextElementNova,{text:t,element:"p",className:"Body-10-Dia-Normal text-nova-base-black"})})]})]})},eu=e=>{var t,l,a;let{product:r}=e,s=(null==(t=Object.keys(null==r?void 0:r.child_products))?void 0:t.length)>0,i=1===r.is_subscription,c=(null==(l=r.quote)?void 0:l.row_total)||"0",d=(null==(a=r.quote)?void 0:a.row_old_price_total)||"0",[u,m]=(0,y.t)(r.billing_interval);return s?i?(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)(o.TextElementNova,{text:"Hair Health Plan",element:"p",className:"Body-20-Dia-Strong"}),(0,n.jsx)(o.TextElementNova,{text:"".concat((0,y.TO)(c)," ").concat(u>1?"/ ".concat(u," Months"):"/ Month"),element:"p",className:"Body-20-Dia-Strong text-right"})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("div",{className:"flex flex-col items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(eo.f,{className:"w-4 h-4"}),(0,n.jsx)(o.TextElementNova,{text:m,element:"p",className:"Body-10-Dia-Normal text-nova-transparency-black-70"})]}),(0,n.jsx)(I,{product:r})]}),(0,n.jsx)(L,{product:r})]})]}):(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)(o.TextElementNova,{text:"One-Time Purchase",element:"p",className:"Body-20-Dia-Strong"}),(0,n.jsx)("div",{className:"text-right",children:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&d&&d!==c){let e=parseInt(d.replace(/,/g,""),10).toFixed(0),t=parseInt(c.replace(/,/g,""),10).toFixed(0);return(0,n.jsx)(o.TextElementNova,{text:'<span class="text-nova-transparency-black-70 line-through mr-1">$'.concat(e,"</span>$").concat(t),element:"p",className:"Body-20-Dia-Strong text-nova-base-black"})}return(0,n.jsx)(o.TextElementNova,{text:(0,y.TO)(c),element:"p",className:"Body-20-Dia-Strong text-nova-base-black"})}(!0)})]}):(0,n.jsxs)("p",{children:[r.name," - ",(0,y.TO)(r.price)]})},em=e=>{let{product:t,isPromoSku:l=!1}=e,a=t.name.replace(" One-Time Purchase","").replace(/\\'/g,"'"),r=(0,p.TP)(t);return(0,n.jsxs)("div",{className:"flex gap-2 md:gap-4 lg:gap-10 items-center",children:[(0,n.jsx)(E.A,{imageUrl:t.label1}),(0,n.jsx)("div",{className:"grow flex flex-col justify-between gap-4",children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(o.TextElementNova,{text:a,element:"p",className:"Body-10-Dia-Normal mb-1 text-nova-base-black"}),(0,n.jsx)(P,{product:t,useBundledPrice:!l})]}),(0,n.jsx)("div",{className:"flex items-center gap-1",children:(0,n.jsx)(o.TextElementNova,{text:r,element:"p",className:"Body-10-Dia-Normal text-nova-transparency-black-70"})})]})})]})}
1,ep=e=>{let{product:t,isPromoSku:l=!1}=e;return(0,n.jsxs)("div",{className:"flex flex-col gap-6 py-6 md:py-8 lg:p-10",children:[(0,n.jsx)(eu,{product:t}),(0,n.jsx)("div",{className:"flex flex-col gap-2",children:Object.values(t.child_products).sort((e,t)=>!!t.is_core-!!e.is_core).map(e=>(0,n.jsx)(em,{product:e,isPromoSku:l},e.sku))}),(0,n.jsx)(en,{level:"item",product:t})]})},ex=e=>{let{initialData:t}=e,{cartData:l}=(0,a.useContext)(m.A),r=(null==l?void 0:l.items)||t,{gift_description:s,gift_url:i}=l||{},c=s&&i,d=(0,p.Wn)(r);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.TextElementNova,{text:"Shopping Cart",element:"h1",className:"Title-10-Super-Normal mb-6 md:mb-8 lg:mb-10"}),(0,n.jsxs)("div",{className:"border-t border-nova-transparency-black-20",children:[(0,n.jsxs)("div",{className:"divide-y divide-nova-transparency-black-20 md:border-b border-nova-transparency-black-20",children:[Object.keys(r).map((e,t)=>{var l;let a=r[e],o=Object.keys(null!=(l=null==a?void 0:a.child_products)?l:{}).length>0&&"1 month"===a.shipping_interval,s=null==e?void 0:e.includes("-SP01");return o?(0,n.jsx)(ep,{product:a,isPromoSku:s},"".concat(a.sku,"-").concat(t)):(0,n.jsx)(ei,{product:a,showHsaFsaBadge:d},"".concat(a.sku,"-").concat(t))}),c&&(0,n.jsx)(ed,{giftDescription:s,giftUrl:i})]}),(0,n.jsx)("div",{className:"md:py-8 lg:px-10 lg:py-10",children:(0,n.jsx)(en,{level:"cart"})})]})]})};var ev=l(53325),eh=l(45755);let ef=()=>{let{cartData:e,setCart:t,isLoadingCartPage:l,setIsLoadingCartPage:r,setSiteTheme:o}=(0,a.useContext)(m.A),i=(0,a.useRef)(!1),[u,v]=(0,a.useState)(!0),{utmParams:h,isComingFromNativeApp:g}=(()=>{let[e,t]=(0,a.useState)({utm_source:"",utm_medium:"",utm_campaign:"",utm_content:"",utm_term:"",purchase_source:""});(0,a.useEffect)(()=>{{let e=new URLSearchParams(window.location.search);t({utm_source:e.get("utm_source")||"",utm_medium:e.get("utm_medium")||"",utm_campaign:e.get("utm_campaign")||"",utm_content:e.get("utm_content")||"",utm_term:e.get("utm_term")||"",purchase_source:e.get("purchase_source")||""})}},[]);let l="app"===e.utm_medium&&("apple_ios"===e.utm_source||"android_app"===e.utm_source);return{utmParams:e,isComingFromNativeApp:l,platform:e.utm_source}})(),{items:b,totals:y}=e||{},{masked_id:j,cart_id:N}=y||{},w=(null==e?void 0:e.items)&&Object.keys(e.items).length>0,_=(null==e?void 0:e.site)==="men"?"men":"master";(0,a.useEffect)(()=>{o((null==e?void 0:e.site)==="men"?"men":null)},[null==e?void 0:e.site,o]);let k=(0,a.useCallback)(async()=>{r(!1);try{let e=await (0,p.Xd)();t(e)}catch(e){console.error("Failed to fetch cart data:",e)}finally{v(!1),r(!1)}},[t,r]);(0,a.useEffect)(()=>{v(!0),k()},[]);let C=(0,a.useRef)(k);C.current=k,(0,a.useEffect)(()=>{let e=e=>{e.persisted&&(r(!1),v(!0),C.current())};return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)},[r]),(0,a.useEffect)(()=>{e&&(0,s.W7)(s.K1.CART,e,"local")},[e]),(0,a.useEffect)(()=>
1{j&&(0,x.TV)("masked_id",j,7)},[j]),(0,a.useEffect)(()=>{w&&_&&(0,s.W7)(s.K1.LAST_THEME,_)},[w,_]),(0,a.useEffect)(()=>{if(e&&(window.nutrafol=window.nutrafol||{},window.nutrafol.cartProducts=Object.values(e.items||{}),g&&Object.keys(e.items||{}).length>0)){let t=(0,x.v8)("queryID"),l=Object.values(e.items||{})[0],n={...l,business_line:null==l?void 0:l.business_line,index:"Products",queryID:t,quiz_reco:/bbq|quiz/.test(null==h?void 0:h.purchase_source),source:null==h?void 0:h.purchase_source,old_price:Number(l.old_price)};S.F.onProductAdded({options:[n],purchase_source:null==h?void 0:h.purchase_source})}},[e,h,g]),(0,a.useEffect)(()=>{if(!e||i.current)return;i.current=!0;let t=(0,p.Os)(b||{});window.nutrafol=window.nutrafol||{},window.nutrafol.cartProducts=t,S.F.onCartViewed(e)},[e,N,j,b]),(0,a.useEffect)(()=>((0,s.Fo)(),(0,s.ci)(),()=>{(0,s.Fo)(),(0,s.ci)()}),[]);let E=(0,a.useMemo)(()=>!e||!e.items||0===Object.keys(e.items).length,[e]);return u?(0,n.jsx)("div",{className:"flex flex-col md:min-h-[600px]",children:(0,n.jsx)(ev.A,{isFullscreen:!0,className:"bg-nova-transparency-white-40"})}):(0,n.jsxs)("div",{className:"flex flex-col md:min-h-[600px]",children:[(0,n.jsx)(eh.default,{experimentId:"43",experimentName:"Q126 | Cart + Cart Upsell Redesigns",variantName:"variant",cookieName:"cart_vercel_test",expectedValue:"next"}),(0,n.jsxs)("div",{className:"px-6 md:px-0",children:[!e||E?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(f,{}),(0,n.jsx)(c,{})]}):(0,n.jsxs)("div",{className:"flex flex-col md:flex-row gap-4 relative md:gap-8 lg:gap-[80px]",children:[(0,n.jsxs)("div",{className:"w-full md:w-[56%] lg:w-[65%]",children:[(0,n.jsx)(f,{}),(0,n.jsx)(ex,{initialData:b||{}})]}),(0,n.jsx)("div",{className:"w-full md:w-[44%] lg:w-[35%]",children:(0,n.jsx)(T,{initialTotals:y||{}})})]}),l&&(0,n.jsx)(ev.A,{isFullscreen:!0,className:"bg-nova-transparency-white-40"})]}),(0,n.jsx)("div",{className:"md:hidden flex-1 bg-nova-base-solid-10 border-y border-nova-transparency-black-20",children:(0,n.jsx)(d.A,{})})]})}},33282:(e,t,l)=>{"use strict";l.d(t,{Be:()=>r,u$:()=>a,v:()=>o});var n=l(52876);function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"cart";(0,n.a5)("Upsell Product Shown",{products:e,source:t})}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"cart";(0,n.a5)("Upsell Product Added",{products:e,source:t})}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"cart";(0,n.a5)("Upsell Product Removed",{products:e,source:t})}},41402:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var l in t)Object.defineProperty(e,l,{enumerable:!0,get:t[l]})}(t,{default:function(){return f},handleClientScriptLoad:function(){return x},initScriptLoader:function(){return v}});let n=l(28140),a=l(49417),r=l(95155),o=n._(l(47650)),s=a._(l(12115)),i=l(82073),c=l(94681),d=l(4853),u=new Map,m=new Set,p=e=>{let{src:t,id:l,onLoad:n=()=>{},onReady:a=null,dangerouslySetInnerHTML:r,children:s="",strategy:i="afterInteractive",onError:d,stylesheets:p}=e,x=l||t;if(x&&m.has(x))return;if(u.has(t)){m.add(x),u.get(t).then(n,d);return}let v=()=>{a&&a(),m.add(x)},h=document.createElement("script"),f=new Promise((e,t)=>{h.addEventListener("load",function(t){e(),n&&n.call(this,t),v()}),h.addEventListener("error",function(e){t(e)})}).catch(function(e){d&&d(e)});r?(h.innerHTML=r.__html||"",v()):s?(h.textContent="string"==typeof s?s:Array.isArray(s)?s.join(""):"",v()):t&&(h.src=t,u.set(t,f)),(0,c.setAttributesFromProps)(h,e),"worker"===i&&h.setAttribute("type","text/partytown"),h.setAttribute("data-nscript",i),p&&(e=>{if(o.default.preinit)return e.forEach(e=>{o.default.preinit(e,{as:"style"})});{let t=document.head;e.forEach(e=>{let l=document.createElement("link");l.type="text/css",l.rel="stylesheet",l.href=e,t.appendChild(l)})}})(p),document.body.appendChild(h)};function x(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,d.requestIdleCallback)(()=>p(e))}):p(e)}function v(e){e.forEach(x),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEac
1h(e=>{let t=e.id||e.getAttribute("src");m.add(t)})}function h(e){let{id:t,src:l="",onLoad:n=()=>{},onReady:a=null,strategy:c="afterInteractive",onError:u,stylesheets:x,...v}=e,{updateScripts:h,scripts:f,getIsSsr:g,appDir:b,nonce:y}=(0,s.useContext)(i.HeadManagerContext);y=v.nonce||y;let j=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let e=t||l;j.current||(a&&e&&m.has(e)&&a(),j.current=!0)},[a,t,l]);let N=(0,s.useRef)(!1);if((0,s.useEffect)(()=>{if(!N.current){if("afterInteractive"===c)p(e);else"lazyOnload"===c&&("complete"===document.readyState?(0,d.requestIdleCallback)(()=>p(e)):window.addEventListener("load",()=>{(0,d.requestIdleCallback)(()=>p(e))}));N.current=!0}},[e,c]),("beforeInteractive"===c||"worker"===c)&&(h?(f[c]=(f[c]||[]).concat([{id:t,src:l,onLoad:n,onReady:a,onError:u,...v,nonce:y}]),h(f)):g&&g()?m.add(t||l):g&&!g()&&p({...e,nonce:y})),b){if(x&&x.forEach(e=>{o.default.preinit(e,{as:"style"})}),"beforeInteractive"===c)if(!l)return v.dangerouslySetInnerHTML&&(v.children=v.dangerouslySetInnerHTML.__html,delete v.dangerouslySetInnerHTML),(0,r.jsx)("script",{nonce:y,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...v,id:t}])+")"}});else return o.default.preload(l,v.integrity?{as:"script",integrity:v.integrity,nonce:y,crossOrigin:v.crossOrigin}:{as:"script",nonce:y,crossOrigin:v.crossOrigin}),(0,r.jsx)("script",{nonce:y,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([l,{...v,id:t}])+")"}});"afterInteractive"===c&&l&&o.default.preload(l,v.integrity?{as:"script",integrity:v.integrity,nonce:y,crossOrigin:v.crossOrigin}:{as:"script",nonce:y,crossOrigin:v.crossOrigin})}return null}Object.defineProperty(h,"__nextScript",{value:!0});let f=h;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43890:(e,t,l)=>{"use strict";l.d(t,{A:()=>c});var n=l(12115),a=l(70405),r=l(20921),o=l(48825),s=l(33282),i=l(11958);let c=(e,t)=>{var l,c;let{cartData:d,setIsLoadingCartPage:u,setCartPageToastMessage:m}=(0,n.useContext)(a.A),[p,x]=(0,n.useState)(null),v=(null==d||null==(l=d.totals)?void 0:l.cart_id)||"",h=(null==e||null==(c=e.quote)?void 0:c.sku)||(null==e?void 0:e.sku)||"";(0,n.useEffect)(()=>{if(!h)return void x(null);x((0,i.W$)(h,t))},[h,t]);let f=!!p,g=(0,n.useCallback)(async()=>{var t;if(!p)return void console.warn("No undo data available");if(!v)return void m("Unable to update cart. Please try again.");let l=null==e||null==(t=e.quote)?void 0:t.quote_item_id;if(!l)return void m("Unable to remove item. Please try again.");u(!0),p.trackingData&&(0,s.v)([p.trackingData]);try{let e=await (0,r.SM)(v,String(l));if(!e.ok)throw Error("Failed to remove item: ".concat(e.status));(0,i.I9)(p.upsellId),window.location.href=(0,o.j)(p.originalSku,{purchaseSource:p.purchaseSource,...(null==p?void 0:p.code)?{code:p.code}:{}})}catch(e){u(!1),m(e instanceof Error?e.message:"Failed to undo. Please try again."),console.warn("Undo failed:",e)}},[p,v,e,u,m]),b=(0,n.useCallback)(()=>{p&&((0,i.I9)(p.upsellId),x(null))},[p]);return{isUndoAvailable:f,undoData:p,executeUndo:g,clearUndo:b,saveUndoData:e=>{var t,l,n,a;let{upsellId:s,originalProduct:c,newSku:u,trackingData:m,level:p}=e,x=(null==(t=c.quote)?void 0:t.sku)||c.sku,v=(0,o.x)(x),h=(null==(l=c.quote)?void 0:l.qty)||1,f=null!=(a=new URLSearchParams(window.location.search).get("purchase_source"))?a:(0,r.VU)(c),g=null==d||null==(n=d.totals)?void 0:n.coupon_code,b={upsellId:s,originalSku:x,originalDpaPath:v,newSku:u,qty:h,purchaseSource:f,timestamp:Date.now(),trackingData:m,level:null!=p?p:"undefined",...g?{code:g}:{}};try{let e=sessionStorage.getItem(i.nk),t=e?JSON.parse(e):{};t[s]=b,sessionStorage.setItem(i.nk,JSON.stringify(t))}catch(e){console.warn("Failed to save upsell undo data:",e)}}}}},45687:(e,t,l)=>{"use strict";var n,a;n=l(54592),a=l(49506),t.version=n.version,t.renderToString=n.renderToString,t.renderToStaticMarkup=n.renderToStaticMarkup,t.renderToReadableStream=a.renderToReadableStream,a.resume&&(t.resume=a.resume)},48825:(e,t,l)=>{"use strict";function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{purchaseSource:l="cart",code:n,reactivation:a,useDpaKey:r=!1}=t,o=r||(null==e?void 0:e.includes("-SP")),s=Array.isArray(e)?e.join(","):e;s=s.replaceAll("-SP","-S");let i=new URLSearchParams;return i.set("skus",s),l&&i.set("purchase_source",l),n&&i.set("co
1de",n),a&&i.set("reactivation",a),o&&i.set("promo_product_enabled","true"),"".concat("https://nutrafol.com/","dpa/add/tocart?").concat(i.toString())}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{purchaseSource:l,code:n,useDpaKey:a}=t,r=a||(null==e?void 0:e.includes("-SP")),o=Array.isArray(e)?e.join(","):e;o=o.replaceAll("-SP","-S");let s=new URLSearchParams;return s.set("skus",o),l&&s.set("purchase_source",l),n&&s.set("code",n),r&&s.set("promo_product_enabled","true"),"/dpa/add/tocart?".concat(s.toString())}l.d(t,{j:()=>n,x:()=>a})},50976:(e,t,l)=>{"use strict";l.d(t,{X:()=>a});var n=l(6829);function a(e){let t=null==e?void 0:e.maskedId,l=null==e?void 0:e.quote_id;t&&(0,n.TV)("masked_id",t,7),l&&(0,n.TV)("quote_id",l,7),window.location.href="/checkout/"}},61987:(e,t,l)=>{"use strict";l.d(t,{F:()=>a});var n=l(95155);let a=e=>(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsx)("path",{d:"M10 6C10 6 10 10.4853 10 14M14 10C14 10 9.90524 10 6 10",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round"})})},68321:(e,t,l)=>{"use strict";l.d(t,{default:()=>a.a});var n=l(41402),a=l.n(n)},72006:(e,t,l)=>{Promise.resolve().then(l.bind(l,7238)),Promise.resolve().then(l.t.bind(l,78113,23)),Promise.resolve().then(l.bind(l,69686))},75978:(e,t,l)=>{"use strict";l.d(t,{E:()=>a});let n=JSON.parse('[{"savingsData":{},"activeWeb":true,"name":"strand-serum-early-access"}]'),a=e=>n.find(t=>t.name===e)},77752:(e,t,l)=>{"use strict";l.d(t,{H:()=>a});var n=l(95155);let a=e=>(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,n.jsx)("path",{d:"M13 10H7",stroke:"currentColor",strokeLinecap:"square",strokeLinejoin:"round"})})},78113:e=>{e.exports={sectionLine:"Section_sectionLine__HMNh5"}}},e=>{e.O(0,[2886,5288,9690,4390,5619,2619,5108,764,9235,7216,9686,8411,7302,1162,7111,7086,405,6955,8441,1255,7358],()=>e(e.s=72006)),_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.