"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4426],{6620:(e,t,i)=>{i.d(t,{I:()=>r});var n=i(15241);let a=e=>!!e?.makeup_try_it_on,r=()=>!!(0,n.K1)(a)},8408:(e,t,i)=>{var n;i.d(t,{h:()=>n}),function(e){e.FINDS_DETAIL_PAGE="finds-detail-page",e.PLP="plp",e.PLP_PRODUCT_CARD="plp-product-card",e.PLP_VIZ_PRODUCT_CARD="plp-viz-product-card",e.PLP_DRAWER="plp-ugc",e.PLP_PRZ="plp-prz",e.PDP_COLUMN="pdp-column",e.PDP_TOP_OF_FOLD="pdp-top-of-fold",e.PDP_TOP_OF_FOLD_IMAGE="pdp-top-of-fold-image",e.PDP_NOW_TEMPLATE_GALLERY="pdp-now-template-gallery",e.PLP_VIZ_SHOPPABLE_DRAWER="viz-shoppable-drawer",e.SII3D="see-it-in-3d"}(n||(n={}))},10807:(e,t,i)=>{i.d(t,{R:()=>f});var n=i(37876),a=i(14232),r=i(15241),o=i(91620),c=i(81414),l=i(90858),d=i(8408),s=i(77232),u=i(43888),_=i(82018);let p=(0,s.I4)(u.SC).withConfig({componentId:"sc-8759a6b7-0"})(["display:flex;text-align:center;font-size:",";border-radius:24px;max-width:90px;padding:"," ",";margin:",";@media (min-width:","){position:absolute;left:40%;transform:translateX(-50%);margin:0;}&:hover{background-color:",";border-color:",";color:",";}&:active{background-color:",";border-color:",";color:",";}"],_.gx.size.text.small,_.xe.generic.x1,_.xe.generic.x3,_.xe.generic.x1,_.fi.sm,_.Tj.interactive.secondary.hover,_.Tj.border.interactive.secondary.hover,_.Tj.text.onLight.primary,_.Tj.interactive.secondary.active,_.Tj.interactive.secondary.active,_.Tj.text.onDark.primary),g=s.I4.span.withConfig({componentId:"sc-8759a6b7-1"})(["display:flex;margin-right:",";margin-bottom:",";"],e=>{let{marginRight:t}=e;return t?_.xe.generic.x2:0},e=>{let{marginBottom:t}=e;return t?_.xe.generic.x1:0}),h=(0,s.I4)(u.SC).withConfig({componentId:"sc-8759a6b7-2"})(["display:flex;justify-content:flex-start;margin-top:",";min-width:125px;padding:0 ",";&.NoWrapButton{text-align:center;justify-content:center;min-width:auto;}&:active svg{fill:",";}&:hover{background-color:",";border-color:",";color:",";}&:active{background-color:",";border-color:",";color:",";}"],_.xe.generic.x3,_.xe.generic.x3,_.Tj.palette.white,_.Tj.interactive.secondary.hover,_.Tj.border.interactive.secondary.hover,_.Tj.text.onLight.primary,_.Tj.interactive.secondary.active,_.Tj.interactive.secondary.active,_.Tj.text.onDark.primary),P=(0,s.I4)(u.SC).withConfig({componentId:"sc-8759a6b7-3"})(["display:flex;margin-top:",";padding:0 ",";justify-content:center;font-size:",";height:",";width:50%;min-width:180px;@media (min-width:","){font-size:",";min-width:210px;}@media (min-width:","){height:",";font-size:",";}&.NoWrapButton{text-align:center;justify-content:center;min-width:auto;}&:active svg{fill:",";}&:hover{background-color:",";border-color:",";color:",";}&:active{background-color:",";border-color:",";color:",";}"],_.xe.generic.x3,_.xe.generic.x3,_.gx.size.text.small,_.uJ.button.sm,_.fi.lg,_.gx.size.text.medium,_.fi.xl,_.uJ.button.md,_.gx.size.text.base,_.Tj.palette.white,_.Tj.interactive.secondary.hover,_.Tj.border.interactive.secondary.hover,_.Tj.text.onLight.primary,_.Tj.interactive.secondary.active,_.Tj.interactive.secondary.active,_.Tj.text.onDark.primary),T=(0,s.I4)(u.SC).withConfig({componentId:"sc-8759a6b7-4"})(["border:"," solid 1px;border-radius:",";display:flex;flex-direction:column;font-size:",";height:auto;min-width:80px;padding:"," ",";white-space:initial;justify-content:flex-start;span{line-height:1.4;}&:hover{background-color:",";}"],_.Tj.palette.gray.medium,_.xe.generic.x2,_.gx.size.text.medium,_.xe.generic.x4,_.xe.generic.x4,_.Tj.palette.gray.lightest),x=(0,s.I4)(u.SC).withConfig({componentId:"sc-8759a6b7-5"})(["border-radius:",";display:flex;text-align:center;font-size:",";padding:"," ",";max-width:170px;position:relative;span{line-height:16px;}"],_.PQ.radius.x6,_.gx.size.text.small,_.xe.generic.x1,_.xe.generic.x2),I=(0,s.I4)(u.nR).withConfig({componentId:"sc-8759a6b7-6"})(["display:flex;margin-top:",";max-width:90px;&.NoWrapButton{text-align:center;justify-content:center;min-width:auto;}&:active svg{fill:",";}&:hover{background-color:",";border-color:",";color:",";}&:active{background-color:",";border-color:",";color:",";}"],_.xe.generic.x3,_.Tj.palette.white,_.Tj.interactive.secondary.hover,_.Tj.border.interactive.secondary.hover,_.Tj.text.onLight.primary,_.Tj.interactive.secondary.active,_.Tj.interactive.secondary.active,_.Tj.text.onDark.primary),b=(0,s.I4)(u.$$).withConfig({componentId:"sc-8759a6b7-7"})(["height:32px;path{fill:",";}"],_.Tj.interactive.secondary.default),m=(0,s.I4)(u.$$).withConfig({componentId:"sc-8759a6b7-8"})(["height:",";width:100%;font-size:",";path{fill:",";}"],_.uJ.button.md,_.gx.size.text.base,_.Tj.interactive.secondary.default),C=(0,s.I4)(u.SC).withConfig({componentId:"sc-8759a6b7-9"})(["display:flex;text-align:center;border-radius:",";background-color:white;"],_.PQ.radius.x4),f=e=>{let t,{clickType:i,displayText:s="See this item in 3D",featureType:u,id:_,onClick:f,placement:y=d.h.PDP_COLUMN,ref:v,Icon:k,ugc:E}=e,A=(0,c.z1)(),{trackClick:O}=(0,l.f)(),D=(0,r.K1)(o.Gs),L=(0,r.EJ)(o.Gs),R=(0,r.bZ)()??D??L,w=(0,a.useRef)(null);switch(y){case d.h.PLP:t=p;break;case d.h.PLP_PRODUCT_CARD:case d.h.PLP_PRZ:t=x;break;case d.h.PDP_COLUMN:t=h;break;case d.h.PLP_DRAWER:case d.h.PDP_TOP_OF_FOLD_IMAGE:t=I;break;case d.h.PDP_NOW_TEMPLATE_GALLERY:t=T;break;case d.h.PLP_VIZ_PRODUCT_CARD:t=b;break;case d.h.PLP_VIZ_SHOPPABLE_DRAWER:t=m;break;case d.h.FINDS_DETAIL_PAGE:case d.h.SII3D:t=C;break;default:t=P}let j=(0,a.useCallback)(()=>{let e,t,n,a={guest:{eventType:"customInteraction"}};if("TRY_IT_ON"===i||!u)switch(y){case d.h.PDP_NOW_TEMPLATE_GALLERY:case d.h.PDP_TOP_OF_FOLD:case d.h.PDP_TOP_OF_FOLD_IMAGE:e="IMAGE_GALLERY";break;case d.h.PLP:case d.h.PLP_PRODUCT_CARD:e="GRID_CARD";break;case d.h.PLP_DRAWER:e="UGC_PRODUCT";break;case d.h.PLP_PRZ:e="TRENDING_TRY_IT_ON";break;case d.h.SII3D:e="VIRTUAL_PRODUCT_TOOLS"}switch("TRY_IT_ON"===i&&y===d.h.PLP_PRODUCT_CARD&&(e=void 0),a.webClientLocalMetadata={productChildOrStandaloneTcin:D,productParentOrStandaloneTcin:L},i){case"CREATE":"Create a bed"===s?n="cgiButton-CreateABed-Click":"Create a space"===s?n="cgiButton-CreateASpace-Click":"Create an outfit"===s&&(n="cgiButton-CreateAnOutfit-Click");break;case"EDIT_IN_PLANNER":n="cgiButton-EditInPlanner-Click";break;case"PLAN_A_BED":n="cgiButton-PlanABedWithThisItem-Click";break;case"PLAN_A_SPACE":n="cgiButton-PlanASpaceWithThisItem-Click";break;case"PLAN_AN_OUTFIT":n="cgiButton-PlanAnOutfitWithThisItem-Click";break;case"SEE_IT_IN_3D":n="cgiButton-SeeItIn3D-Click";break;case"SEE_IT_IN_YOUR_SPACE_ANDROID":t="SEE_IT_IN_YOUR_SPACE",n="cgiButton-SeeItInYourSpaceAndroid-Click";break;case"SEE_IT_IN_YOUR_SPACE_IOS":t="SEE_IT_IN_YOUR_SPACE",n="cgiButton-SeeItInYourSpaceIos-Click";break;case"SEE_IT_IN_YOUR_SPACE":n="cgiButton-SeeItInYourLegacyAndroid-Click";break;case"SEE_IT_ON_YOU_IOS":t="SEE_IT_ON_YOU",n="cgiButton-SeeItOnYouIos-Click";break;case"TRY_IT_ON":n="try-it-on-button"}R&&(a.products=[{tcin:R}]),a.customInteraction="try-it-on-button"===n?{location:`beauty-tryiton-${y}`,type:"click",value:`${n}`}:{type:"click",value:`${n}-${y}`},A.trackEvent(a),u&&(e=u),e&&O.track({clickType:t??i,element:R?{id:R,type:"TCIN"}:void 0,featureType:e,UGC:E??void 0}),f()},[D,i,u,s,f,L,y,R,O,A,E]);return((0,a.useEffect)(()=>{w.current||(w.current=!0,A.trackEvent({guest:{eventType:"componentload"},components:[{component:"CGI Button",componentType:s}],products:[{tcin:R}]}))},[s,R,A]),f)?(0,n.jsxs)(t,{"aria-label":s,"data-test":"cgi-button-default",id:_,onClick:j,ref:v,size:"sm",children:[k&&(0,n.jsx)(g,{marginBottom:y===d.h.PDP_NOW_TEMPLATE_GALLERY,marginRight:!1,children:(0,n.jsx)(k,{width:y===d.h.PDP_NOW_TEMPLATE_GALLERY?"24":"20"})}),(0,n.jsx)("span",{"data-test":"cgi-button-display-text",children:s})]}):null};f.displayName="CgiButtonDefault"},22841:(e,t,i)=>{i.d(t,{A:()=>r});var n=i(15241),a=i(91620);let r=()=>{let e=(0,n.K1)(a.Gs),t=(0,n.EJ)(a.Gs),i=(0,n.bZ)();return{childTcin:e,parentTcin:t,selectedTcin:i,tcin:i??e??t}}},54426:(e,t,i)=>{i.d(t,{T:()=>g});var n=i(37876),a=i(14232),r=i(77216),o=i(61548),c=i(15241),l=i(29494),d=i(35333),s=i(10807),u=i(56698);let _=e=>{let{featureType:t,onClick:i,placement:_}=e,{push:p}=(0,d.rd)(),g=(0,u.b)(),h=(0,a.useCallback)(()=>{i?.(),p(g)},[g,i,p]);return(0,n.jsx)(o.H,{action:"error_boundary_cgi_button_tio",children:(0,n.jsx)(s.R,{"aria-label":`try on ${(0,c.EJ)(l.T)}`,clickType:"TRY_IT_ON",displayText:"Try it on",featureType:t,Icon:r.IconArWeb,onClick:h,placement:_})})};_.displayName="CgiButtonTryItOnBeauty";var p=i(6620);let g=e=>(0,p.I)()?(0,n.jsx)(_,{...e}):null;g.displayName="ConditionalCgiButtonTryItOnBeauty"},56698:(e,t,i)=>{i.d(t,{Y:()=>n,b:()=>c});var n,a=i(14232),r=i(86139),o=i(22841);!function(e){e.FoundationFinder="/virtual-try-on/foundation-finder",e.HairQuiz="/experiences/hair-quiz",e.NowWearing="/virtual-try-on/now-wearing",e.SkinQuiz="/experiences/skin-quiz"}(n||(n={}));let c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.NowWearing,{tcin:t}=(0,o.A)(),i=(0,a.useMemo)(()=>[encodeURIComponent(t??"")],[t]),c="";switch(c=window?.location?.origin??"",e){case n.FoundationFinder:return new r.o(c+n.FoundationFinder);case n.HairQuiz:return new r.o(c+n.HairQuiz+"?studio=true");case n.SkinQuiz:return new r.o(c+n.SkinQuiz+"?studio=true");default:return new r.o(c+n.NowWearing+`?tcins=${i.join(",")}`)}}}}]);