Loading
function(e,r,t){t.d(r,{A:()=>x,p:()=>S});var n=t(627968),a=t(64700),l=t(503698),s=t.n(l),u=t(631903),o=t(17928),i=t(775602),c=t(218394),d=t(203632),A=t(855915),f=t(940622),m=t(881106),T=t(284009),E=t.n(T),I=t(964486);let p=1e3/24,y=function(e){let{minInterval:r=p,allowableMinInterval:t,droppedFramesCallbackThreshold:n,droppedFramesCallback:l,droppedFramesResetTime:s=3e3}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=a.useRef(r),o=a.useRef(0),i=a.useRef(void 0),c=a.useRef(void 0),d=a.useRef(!0),A=a.useRef(0),f=a.useRef(void 0),m=a.useCallback(()=>{A.current=0,null!=f.current&&(clearTimeout(f.current),f.current=void 0)},[]),T=a.useCallback(()=>{d.current=!1,cancelAnimationFrame(o.current),clearTimeout(f.current)},[]),y=a.useCallback(r=>{if(!d.current)return;null==i.current&&(i.current=r),null==c.current&&(c.current=r);let a=r-c.current;r-i.current>1.5*Math.min(t??120,u.current)&&(A.current+=1,null!=f.current&&clearTimeout(f.current),f.current=setTimeout(m,s),null!=n&&A.current>n&&(E()(null!=l,"useClock - If you set a dropped frames threshold, you must provide a droppedFramesCallback to do something when that threshold is hit"),l()&&(A.current=0))),i.current=r,a>=u.current-3&&(c.current=r,e(a)),o.current=requestAnimationFrame(y)},[t,m,s,n,l,e]),N=a.useCallback(()=>{d.current=!0,c.current=void 0,o.current=requestAnimationFrame(y)},[y]);return a.useEffect(()=>{u.current=r},[r]),(0,I.Ay)(()=>(o.current=requestAnimationFrame(y),()=>T())),{stop:T,reset:N,ticking:d}};var N=t(942426),h=t(735438);function v(e){if(null==e)return e;let r=(0,h.cloneDeep)(e),t=Math.floor(Math.random()*(r.effects.reduce((e,r)=>{let t=r.randomizedSources?.length??0;return t>0&&(e=0===e?t:Math.min(e,t)),e},0)-1-0+1)+0);return r.effects=r.effects.map(e=>(null!=e.randomizedSources&&e.randomizedSources.length>0&&(e.src=e.randomizedSources[t].src),e)),r}t(323874),t(14289),t(35956);var b=t(676279),g=t(38405),P=t(839827);let R=e=>{let{layerConfig:r,animationType:t,ticking:l,time:s,hasPlayedThrough:o,setHasPlayedThrough:i,maxLoops:c,loopEnd:d,bannerAdjustment:A,imageData:f}=e,T=!0,E=0,[I,p]=a.useState("reset"),y=a.useRef(f?.src??r.src),[N,h]=a.useState(f?.src??r.src),v=a.useRef(null),R=(0,b.gm)()&&null!=r.loopDelay&&r.loopDelay>0&&f?.src!=null;function S(e){(0,b.gm)()&&e!==I&&p(e)}if(a.useEffect(()=>{if(!R||"layer"===I)return;let e=new AbortController;return(async()=>{try{if(null==v.current){let r=await fetch(f.src,{signal:e.signal}),t=await r.blob();if(e.signal.aborted)return;v.current=t}y.current!==f?.src&&URL.revokeObjectURL(y.current),y.current=URL.createObjectURL(v.current),h(()=>y.current)}catch(e){if("AbortError"===e.name)return null;g.A.captureException(e)}})(),()=>{e.abort()}},[I,R,h,f?.src]),a.useEffect(()=>()=>{y.current!==f?.src&&URL.revokeObjectURL(y.current)},[]),l||(T=!1),s<r.start&&(T=!1),!r.loop&&s>r.duration+r.start&&(T=!1),t===u.l.ANIMATION_TYPE_PERSISTENT&&!o&&null!=c&&s>=d&&i(!0),r.loop&&void 0!==r.loopDelay&&r.loopDelay>0){let e=r.duration+r.loopDelay;E=Math.floor((s-r.start)/e),s-r.start-E*e>r.duration&&(t===u.l.ANIMATION_TYPE_INTERMITTENT&&!o&&null!=c&&E>=c&&i(!0),T=!1)}return T?(S("layer"),(0,n.jsx)("img",{src:N,className:P.QZ,style:{top:(r.position?.y??0)-A,left:r.position?.x??0},alt:"","aria-hidden":!0})):(S("reset"),(0,n.jsx)("img",{src:m.Ut,alt:"","aria-hidden":!0}))},S=e=>{let{bannerAdjustment:r=0,maxLoops:t,resetOnHover:l=!1,isHovering:o=!1,useOpacityOnHover:i=!0,autoPlay:c=!0,restartMethod:A,profileEffect:f,delayIntro:m=!0,restartKey:T,layerData:E}=e,I=a.useRef(null),p=a.useMemo(()=>f.effects.sort((e,r)=>(e.zIndex??0)-(r.zIndex??0)),[f]),{accessibilityLabel:N}=f,{firstLoop:h,loopEnd:v}=a.useMemo(()=>{let e=0,r=1/0;return p.forEach(t=>{let n=t.start+t.duration;n>e&&(e=n),t.loop&&t.start<r&&(r=t.start)}),{firstLoop:r,loopEnd:e}},[p]),b=m?500:.1,[g,S]=a.useState(-b),{stop:_,reset:x,ticking:M}=y(a.useCallback(e=>{S(r=>r+e)},[])),O=a.useRef(b);a.useEffect(()=>{O.current=b}),a.useEffect(()=>{S(-O.current)},[f]);let[C,j]=a.useState(!1);return a.useEffect(()=>{null!=T&&(S(-O.current),j(!1),M.current||x())},[T,x,M]),a.useEffect(()=>{!0===c||o||(_(),S(0)),!o&&C&&M.current&&(_(),S(0)),l&&o&&!M.current&&(x(),f.animationType===u.l.ANIMATION_TYPE_PERSISTENT?S(A===d.HL.FromStart?0:h):S(0))},[o,C,h,l,_,x,M,f.animationType,c,A]),(0,n.jsx)("div",{ref:I,className:s()(P.yC,{[P.yo]:o&&i}),"aria-label":N,role:"img",children:(0,n.jsx)("div",{className:P.vW,children:p.map((e,a)=>{if(!M.current&&f.animationType===u.l.ANIMATION_TYPE_PERSISTENT&&null!=f.staticFrameSrc&&0===a&&!0===c){let{staticFrameSrc:t}=f;return(0,n.jsx)("img",{className:P.QZ,style:{top:e.position?.y??0-r,left:e.position?.x??0},src:t,alt:"","aria-hidden":!0},e.src+a)}return(0,n.jsx)(R,{layerConfig:e,animationType:f.animationType,ticking:M.current,time:g,hasPlayedThrough:C,setHasPlayedThrough:j,maxLoops:t,loopEnd:v,bannerAdjustment:r,imageData:E?.[e.src]},e.src+a)})})})};function _(e){let{profileEffect:r,useThumbnail:t,bannerAdjustment:a=0,isHovering:l=!1,useOpacityOnHover:u=!0}=e,{reducedMotionSrc:o,thumbnailPreviewSrc:i,accessibilityLabel:c}=r;return(0,n.jsx)("div",{className:s()(P.yC,{[P.yo]:l&&u}),"aria-label":c,role:"img",children:(0,n.jsx)("div",{className:P.vW,children:(0,n.jsx)("img",{src:t&&!l?i:o,className:P.QZ,style:{top:0-a},alt:"","aria-hidden":!0})})})}let x=function(e){let r=(0,c.j)(),t=(0,o.bG)([i.Ay],()=>i.Ay.useReducedMotion),l=(0,N.A)(e.skuId),s=(0,f.C)(l),d=function(e){let[r,t]=a.useState(e),[n,l]=a.useState(v(e));return(0,h.isEqual)(r,e)||(t(e),l(v(e))),n}(l),m=s??d,{autoPlay:T=!0,isHovering:E}=e,I=!!(!r&&e.shopPreview||!r&&l?.animationType===u.l.ANIMATION_TYPE_PERSISTENT||t||!1===T&&!1===E),{loaded:p,layerData:y}=(0,A.A)({skuId:l?.skuId,layers:I?void 0:l?.effects});return null!=l&&null!=m&&(r||e.shopPreview||l.animationType!==u.l.ANIMATION_TYPE_INTERMITTENT)?I?(0,n.jsx)(_,{useThumbnail:e.useThumbnail,profileEffect:m,bannerAdjustment:e.bannerAdjustment,isHovering:e.isHovering,useOpacityOnHover:e.useOpacityOnHover}):p?(0,n.jsx)(S,{profileEffect:m,layerData:y,...e}):null:null}}