1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__||=[]).push([[8207],{88207(e,t,n){n.d(t,{S:()=>W});var i=n(93743);const r=/-|_/,o=()=>{const[e,t]=(0,i.h)(!0);return(0,i.p)(()=>{const e=(0,i.d)(()=>{t("visible"===document.visibilityState)},200);return document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("visibilitychange",e)}},[]),e},s=()=>"Shopify"in window?window.Shopify:null,a=e=>"link"===e||"qrcode"===e,c=()=>{const e=[...window.jDataLayer||[]].reverse().find(e=>"shopping-market"===e.type&&void 0!==e.data?.countryCode)?.data.countryCode;if(e)return e;const t=s();return t?t.country:void 0},l=()=>{const e=[...window.jDataLayer||[]].reverse().find(e=>"shopping-market"===e.type&&void 0!==e.data?.currencyCode)?.data.currencyCode;if(e)return e},d=()=>{const e=s();return(e=>e.split(r)[0])(e?e.locale:document.documentElement.lang)},u=e=>Number(e)>=0,h=(0,i.G)(null),p=({productsById:e,children:t})=>{const n=(0,i.F)(()=>({getProductsForIds:t=>{if(!t||0===t.length)return null;const n=t.map(t=>e[t]).filter(e=>!!e);return n.length>0?n:null}}),[e]);return(0,i.o)(h.Provider,{value:n,children:t})},f=(0,i.M)(()=>Promise.all([n.e(6020),n.e(15)]).then(n.bind(n,10015))),m=e=>(0,i.o)(i.U,{fallback:(0,i.o)(i.k,{}),children:(0,i.o)(f,{...e})}),v=(e,t)=>void 0===e||e===t?"active":e===t-1?"previous":e===t+1?"next":e===t+2?"next-2":e<t?"hidden-prev":"hidden-next",g=e=>e.composedPath().some(e=>e instanceof HTMLElement&&e.classList?.contains("interaction-wrapper")),y=e=>e.composedPath().some(e=>e instanceof HTMLElement&&e.classList?.contains("action-button")),b=(0,i.G)(null),w=({storyId:e,children:t})=>{const n=(e=>{const t=(0,i.q)(bo);if(t)return{sendStoryEvent:t.sendStoryEvent.bind(t,e),sendStoryViewEvent:t.sendStoryViewEvent.bind(t,e),sendStoryChapterDisplayedEvent:t?.sendStoryChapterDisplayedEvent.bind(t,e),sendStorySwipeEvent:t.sendStorySwipeEvent.bind(t,e),sendStoryPauseMobileEvent:t.sendStoryPauseMobileEvent.bind(t,e),sendStoryExitEvent:t.sendStoryExitEvent.bind(t,e),sendStoryCloseEvent:t.sendStoryCloseEvent.bind(t,e),sendStoryCloseShortcutEvent:t.sendStoryCloseShortcutEvent.bind(t,e),sendStoryPauseEvent:t.sendStoryPauseEvent.bind(t,e),sendStoryUnpauseEvent:t.sendStoryUnpauseEvent.bind(t,e),sendStoryChangeChapterEvent:t.sendStoryChangeChapterEvent.bind(t,e),sendStoryChapterExitEvent:t.sendStoryChapterExitEvent.bind(t,e),sendInteractionEvent:t.sendInteractionEvent.bind(t,e),sendInteractionViewEvent:t.sendInteractionViewEvent.bind(t,e),sendInteractionEngageEvent:t.sendInteractionEngageEvent.bind(t,e),sendInteractionCompleteEvent:t.sendInteractionCompleteEvent.bind(t,e),sendInteractionExitEvent:t.sendInteractionExitEvent.bind(t,e),sendWidgetPlayerCloseEvent:t.sendWidgetPlayerCloseEvent.bind(t,e),sendStoryTabChangeEvent:t.sendStoryTabChangeEvent.bind(t,e),sendProductLoadedEvent:t.sendProductLoadedEvent.bind(t,e),sendProductViewEvent:t.sendProductViewEvent.bind(t,e),sendProductDetailsViewEvent:t.sendProductDetailsViewEvent.bind(t,e),sendProductEngageEvent:t.sendProductEngageEvent.bind(t,e)}})(e);return(0,i.o)(b.Provider,{value:n,children:t})},C=({size:e=27,ratio:t=26/27,opacity:n=1,withShadow:r=!1})=>(0,i.o)("svg",{width:e,height:e*t,viewBox:"0 0 27 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r&&(0,i.o)("defs",{children:(0,i.o)("filter",{id:"shadow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:(0,i.o)("feDropShadow",{dx:"0",dy:"0",stdDeviation:"2",floodColor:"rgba(0,0,0,0.5)"})})}),(0,i.o)("path",{d:"M19.547 12.4326C19.8163 12.6325 19.8163 13.0357 19.547 13.2356L10.9304 19.6318C10.6004 19.8767 10.1323 19.6412 10.1323 19.2303L10.1323 6.43788C10.1323 6.027 10.6004 5.7915 10.9304 6.03641L19.547 12.4326Z",fill:"#FFFFFF",opacity:n,filter:r?"url(#shadow)":void 0})]}),k=".action-button{display:flex;align-items:center;justify-content:center;width:4.2em;height:4.2em;border-radius:50%;background-color:#0000004d;cursor:pointer;transition:background-color .2s ease-in-out;margin-bottom:1em;pointer-events:all;backdrop-filter:blur(6.5px);z-index:40}.action-button svg{width:2.6em;height:2.6em}.desktop .action-button{width:max(min(3.3em,50px),20px);height:max(min(3.3em,50px),20px);margin-bottom:1.8em}.desktop .action-button svg{width:max(min(2.08em,28px),15px);height:max(min(2.08em,28px),15px)}.hidden{display:none}",x=({size:e=10})=>(0,i.o)("svg",{width:e,height:1.7*e,viewBox:"0 0 10 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.o)("path",{d:"M8.70117 15.178L1.70117 8.17798L8.70117 1.17798",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})}),S=({onClick:e})=>(0,i.o)(i.I,{css:k,children:(0,i.o)("button",{className:"close-button","aria-label":"Close the story feed",onClick:e,children:(0,i.o)(x,{})})}),A=()=>(0,i.o)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",children:(0,i.o)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.5127
17 1.43645C2.12225 1.04592 1.48908 1.04592 1.09856 1.43645C0.708033 1.82697 0.708033 2.46014 1.09856 2.85066L6.82527 8.57738L1.09858 14.3041C0.708053 14.6946 0.708052 15.3278 1.09858 15.7183C1.4891 16.1088 2.12227 16.1088 2.51279 15.7183L8.23949 9.99159L13.9662 15.7183C14.3567 16.1088 14.9899 16.1088 15.3804 15.7183C15.7709 15.3278 15.7709 14.6946 15.3804 14.3041L9.6537 8.57738L15.3804 2.85066C15.7709 2.46014 15.7709 1.82697 15.3804 1.43645C14.9899 1.04592 14.3567 1.04592 13.9662 1.43645L8.23949 7.16316L2.51277 1.43645Z",fill:"white"})}),E=({onClick:e})=>(0,i.o)(i.I,{css:k,children:(0,i.o)("button",{className:"close-button",onClick:e,"aria-label":"Close the story feed",children:[(0,i.o)(A,{}),(0,i.o)("p",{className:"hidden",children:"Close"})]})}),_=({containerLabel:e,isActive:t,watermark:n,showFeedStoryCoverAndTitle:r,enableTitleFocus:o=!0})=>{const s=(0,i._)(null);return(0,i.p)(()=>{(0,i.l)(i.a,i.D)},[]),(0,i.p)(()=>{let e;return t&&o&&(e=setTimeout(()=>s.current?.focus({preventScroll:!0}),500)),()=>{clearTimeout(e)}},[t,o]),(0,i.o)(i.I,{css:".feed-story-title{color:#fff;font-family:Montserrat_600;font-size:1.4em;font-style:normal;font-weight:600;letter-spacing:0;line-height:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:0;margin-bottom:-2px;padding-bottom:2px;outline:none}.title-and-watermark-container{display:flex;flex-direction:column;gap:.8em}",children:(0,i.o)("div",{className:"title-and-watermark-container",children:[r&&(0,i.o)("h1",{ref:s,className:"feed-story-title",tabIndex:-1,children:(0,i.b)(e)}),(0,i.o)("div",{"aria-hidden":!n,children:n??null})]})})},T=({closable:e,onClose:t,storyConfig:n,isActive:r,isMobile:o,showFeedStoryCoverAndTitle:s,watermark:a,enableTitleFocus:c=!0})=>(0,i.o)(i.I,{css:".vertical-feed-story-title-container{display:flex;align-items:center;width:100%;position:relative}.vertical-feed-story-title-container .back-button{position:absolute;left:0}.vertical-feed-story-title-container .back-button.desktop{right:0;left:unset}.vertical-feed-story-title-container{flex:1;display:flex;justify-content:center}.feed-story-title-container{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;padding-right:2.5em;padding-left:2.5em}",children:(0,i.o)("div",{className:"vertical-feed-story-title-container",children:[e&&(0,i.o)("div",{className:"back-button "+(o?"":"desktop"),children:o?(0,i.o)(S,{onClick:t}):(0,i.o)(E,{onClick:t})}),(0,i.o)("div",{className:"feed-story-title-container",children:(0,i.o)(_,{containerLabel:n.containerLabel,isActive:r,watermark:a,showFeedStoryCoverAndTitle:s,enableTitleFocus:c})})]})}),P={desktop:"watermarkDesktop.svg",mobile:"watermarkMobile.svg"},I=({owner:e,storyId:t})=>{const n=new URLSearchParams({utm_medium:"watermark",utm_source:e});return t&&n.set("utm_content",t),`https://join-stories.com?${n.toString()}`},L=e=>`https://images.join-stories.com/cdn-cgi/image/format=auto/watermarks/${P[e]}`,M=({owner:e,storyId:t})=>{const n=(0,i.q)(bo),r=I({owner:e,storyId:t}),o=L("mobile");return(0,i.o)(i.I,{css:".watermark-mobile{pointer-events:all;cursor:pointer;padding:.3em}",children:(0,i.o)("a",{target:"_blank",rel:"noopener noreferrer",href:r,className:"watermark-mobile",onClick:()=>n?.setExitReason("watermark-click"),children:[(0,i.o)("p",{style:{display:"none"},children:"JOIN Stories Watermark"}),(0,i.o)("img",{src:o,alt:"JOIN Stories Watermark",width:104,height:12,loading:"lazy",decoding:"async"})]})})},V=()=>(0,i.o)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.o)("path",{d:"M14.9921 5.4303C14.5779 5.4303 14.2421 5.76608 14.2421 6.1803C14.2421 6.59451 14.5779 6.9303 14.9921 6.9303V5.4303ZM14.9921 6.9303C19.6072 6.9303 21.7286 12.3311 19.1167 15.3564L20.2521 16.3367C23.6848 12.3607 20.9192 5.4303 14.9921 5.4303V6.9303Z",fill:"#FFFFFF"}),(0,i.o)("path",{d:"M8.35677 7.78748L6.79845 9.39007H4.50523C3.67294 9.39007 3.00003 10.063 3.00003 10.8953V13.9499C3.00003 14.7734 3.66409 15.4374 4.47867 15.4551L6.78074 15.4906L11.1193 19.8291C11.2002 19.9067 11.302 19.959 11.4122 19.9796C11.5225 20.0002 11.6363 19.9881 11.7398 19.9448C11.8432 19.9015 11.9318 19.829 11.9946 19.7361C12.0574 19.6431 12.0917 19.5339 12.0932 19.4218V11.3645",fill:"#FFFFFF"}),(0,i.o)("path",{d:"M11.4122 3.98583C11.302 4.00639 11.2002 4.0587 11.1193 4.13635L9.71725 5.823L12.0932 8.20076V4.54364C12.0917 4.43151 12.0574 4.32228 11.9946 4.22936C11.9318 4.13645 11.8432 4.0639 11.7398 4.02063C11.
16363 3.97737 11.5225 3.96527 11.4122 3.98583Z",fill:"#FFFFFF"}),(0,i.o)("path",{d:"M5.70944 4.80359L20.9385 20.0238",stroke:"#FFFFFF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.o)("path",{d:"M15.75 18.5099C16.557 18.3138 17.318 17.9619 17.9901 17.474",stroke:"#FFFFFF",strokeWidth:"1.5",strokeLinecap:"round"}),(0,i.o)("path",{d:"M15.6243 9.13196C15.2101 9.13196 14.8743 9.46774 14.8743 9.88196C14.8743 10.2962 15.2101 10.632 15.6243 10.632V9.13196ZM15.6243 10.632C15.6793 10.632 15.7976 10.6598 15.968 10.835C16.1364 11.0083 16.2994 11.2725 16.4211 11.5853C16.5423 11.8969 16.6047 12.2111 16.6076 12.4603C16.6108 12.7388 16.5418 12.7992 16.569 12.7709L17.6472 13.8138C18.0275 13.4206 18.1125 12.8721 18.1075 12.4428C18.1022 11.9842 17.994 11.4913 17.8191 11.0415C17.6446 10.593 17.3858 10.1415 17.0434 9.78937C16.703 9.43921 16.2214 9.13196 15.6243 9.13196V10.632Z",fill:"#FFFFFF"})]}),F=()=>(0,i.o)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.o)("path",{d:"M14.9921 6.22363C17.4697 6.22363 21 7.94976 21 12.2293C21 17.0022 16.4693 18.6891 14.9921 18.6891",stroke:"#FFFFFF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.o)("path",{d:"M15.6243 9.47412C16.2021 9.71658 17.4254 10.4558 17.4254 12.1628C17.4254 14.1423 16.2021 14.8333 15.6243 15.1566",stroke:"#FFFFFF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.o)("path",{d:"M4.47864 15.4464C3.66406 15.4287 3 14.7646 3 13.9412V10.8865C3 10.0631 3.66406 9.39901 4.47864 9.38131L6.78072 9.34589L11.1192 4.17965C11.2002 4.102 11.302 4.04969 11.4122 4.02913C11.5225 4.00857 11.6363 4.02067 11.7398 4.06393C11.8432 4.1072 11.9318 4.17975 11.9946 4.27266C12.0574 4.36558 12.0917 4.47481 12.0932 4.58694V19.4131C12.0917 19.5252 12.0574 19.6344 11.9946 19.7274C11.9318 19.8203 11.8432 19.8928 11.7398 19.9361C11.6363 19.9793 11.5225 19.9914 11.4122 19.9709C11.302 19.9503 11.2002 19.898 11.1192 19.8204L6.78072 15.4818L4.47864 15.4464Z",fill:"#FFFFFF"})]}),N=({isMuted:e,onClick:t,name:n})=>{const r=((e,t)=>t?e?`Mute the ${t} story`:`Unmute the ${t} story`:e?"Mute the story":"Unmute the story")(e,n);return(0,i.o)(i.I,{css:k,children:(0,i.o)("button",{className:"action-button mute-button",onClick:t,"aria-label":r,children:[e?(0,i.o)(V,{}):(0,i.o)(F,{}),(0,i.o)("p",{className:"hidden",children:e?"Mute":"Unmute"})]})})},R=()=>(0,i.o)("svg",{width:"27",height:"26",viewBox:"0 0 27 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.o)("path",{d:"M9.60449 18.3375L9.60449 7.66309",stroke:"#FFFFFF",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.o)("path",{d:"M16.6963 18.3375L16.6963 7.66309",stroke:"#FFFFFF",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})]}),B=({active:e,onClick:t,name:n})=>{const r=((e,t)=>t?e?`Pause the ${t} story`:`Play the ${t} story`:e?"Pause the story":"Play the story")(e,n);return(0,i.o)(i.I,{css:k,children:(0,i.o)("button",{className:"action-button",onClick:t,"aria-label":r,children:[e?(0,i.o)(R,{}):(0,i.o)(C,{}),(0,i.o)("p",{className:"hidden",children:e?"Pause":"Play"})]})})},O=({onClick:e,name:t})=>{const n=(e=>e?`Share the ${e} story`:"Share the story")(t);return(0,i.o)(i.I,{css:k,children:(0,i.o)("button",{className:"action-button",onClick:e,"aria-label":n,children:[(0,i.o)("svg",{viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.o)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8109 4.78905C15.2309 4.20899 14.2904 4.20899 13.7104 4.78905C13.233 5.26638 13.1485 5.98776 13.4567 6.55153C13.4643 6.56289 13.4716 6.57454 13.4785 6.58648C13.4855 6.59841 13.4921 6.61046 13.4982 6.62262C13.5572 6.71752 13.6279 6.80722 13.7104 6.88963C14.2904 7.46969 15.2309 7.46969 15.8109 6.88963C16.391 6.30958 16.391 5.36911 15.8109 4.78905ZM12.7085 7.83188C12.7183 7.84194 12.7281 7.85195 12.7381 7.86191C13.8551 8.97894 15.6662 8.97894 16.7832 7.86191C17.9002 6.74488 17.9002 4.93381 16.7832 3.81678C15.6662 2.69975 13.8551 2.69975 12.7381 3.81678C11.9726 4.58227 11.7317 5.67371 12.0154 6.64435L8.12147 8.91675C8.1117 8.90669 8.10184 8.89668 8.09189 8.88674
1C6.97486 7.76971 5.16379 7.76971 4.04676 8.88674C2.92973 10.0038 2.92973 11.8148 4.04676 12.9319C5.16379 14.0489 6.97486 14.0489 8.09189 12.9319C8.10193 12.9218 8.11188 12.9117 8.12175 12.9016L12.0163 15.171C11.7311 16.1425 11.9717 17.2355 12.7381 18.0018C13.8551 19.1189 15.6662 19.1189 16.7832 18.0018C17.9002 16.8848 17.9002 15.0737 16.7832 13.9567C15.6662 12.8397 13.8551 12.8397 12.7381 13.9567L12.7108 13.9843L8.81471 11.714C8.96801 11.1891 8.96798 10.6291 8.8146 10.1043L12.7085 7.83188ZM7.33153 10.1257C7.33774 10.138 7.34436 10.1501 7.35139 10.1622C7.35842 10.1742 7.36576 10.186 7.3734 10.1974C7.61508 10.6397 7.61508 11.1789 7.37341 11.6212C7.36569 11.6327 7.35827 11.6446 7.35116 11.6568C7.34422 11.6687 7.33767 11.6808 7.33152 11.6929C7.27257 11.7877 7.20193 11.8773 7.11962 11.9596C6.53956 12.5397 5.59909 12.5397 5.01903 11.9596C4.43897 11.3795 4.43897 10.4391 5.01903 9.85901C5.59909 9.27895 6.53956 9.27895 7.11962 9.85901C7.20194 9.94133 7.27257 10.0309 7.33153 10.1257ZM13.7104 17.0296C13.2438 16.563 13.1525 15.8633 13.4365 15.3055C13.4543 15.2823 13.4709 15.2577 13.486 15.2317C13.5006 15.2067 13.5134 15.1812 13.5245 15.1553C13.5778 15.0754 13.6398 14.9995 13.7104 14.929C14.2904 14.3489 15.2309 14.3489 15.8109 14.929C16.391 15.509 16.391 16.4495 15.8109 17.0296C15.2309 17.6096 14.2904 17.6096 13.7104 17.0296Z",fill:"white"})}),(0,i.o)("p",{className:"hidden",children:"Share"})]})})},D=({onMute:e,paused:t,onPlayToggle:n,onShare:r,isMuted:o,withOffsetTop:s,name:a})=>(0,i.o)(i.I,{css:".action-list{align-self:flex-end;margin-right:.9em;display:flex;flex-direction:column;width:4.2em;aspect-ratio:1}.desktop .action-list{width:max(3.3em,22px);margin-right:min(1.32em,16px)}",children:(0,i.o)("div",{className:"action-list "+(s?"offset-top":""),children:[n?(0,i.o)(B,{active:!t,onClick:n,name:a}):null,e&&(0,i.o)(N,{isMuted:o,onClick:e,name:a}),r?(0,i.o)(O,{onClick:r,name:a}):null]})}),U=(0,i.x)(({mediaUrl:e,contentType:t,containerLabel:n,isActive:r,titleAlignment:o="center",watermark:s,showFeedStoryCoverAndTitle:a,enableTitleFocus:c=!0})=>{const[l,d]=(0,i.h)(!1),u=t.includes("mp4")?(0,i.v)(e):e,h=(0,i.g)(n),p="top"===o?"align-top":"align-center";return(0,i.o)(i.I,{css:".feed-story-title-container{display:flex;align-items:flex-start;gap:1em;width:100%;z-index:40;position:relative}.title-and-watermark-container{display:flex;flex-direction:column;gap:.8em}.title-and-watermark-container .with-cover{display:flex;flex-direction:column;gap:.8em;background-color:red}.feed-story-title-container.align-center .title-and-watermark-container{align-self:center;gap:0}.desktop .feed-story-title{font-size:min(1.2em,18px)}.feed-story-media{object-fit:cover;width:3.7em;height:3.7em;min-width:3.7em;min-height:3.7em;border-radius:4.1em;background:#d3d3d3 50% / cover no-repeat;box-shadow:0 0 .47em #00000030}.desktop .feed-story-media{width:min(2.96em,56px);height:min(2.96em,56px);min-width:min(2.96em,56px);min-height:min(2.96em,56px)}",children:(0,i.o)("div",{className:`feed-story-title-container ${p}`,children:[l?(0,i.o)("div",{className:"feed-story-media"}):(0,i.o)("img",{loading:"lazy",className:"feed-story-media",src:u,onError:()=>{d(!0)},alt:h}),(0,i.o)(_,{containerLabel:n,isActive:r,watermark:s,showFeedStoryCoverAndTitle:a,enableTitleFocus:c})]})})}),$=({mediaUrl:e,contentType:t,containerLabel:n,isActive:r,showFeedStoryCoverAndTitle:o,watermark:s,enableTitleFocus:a=!0})=>{const c=o,l=!!s;return c||l?(0,i.o)(i.I,{css:".horizontal-feed-header{width:85%}.watermark{position:absolute;top:3rem;left:2rem}",children:(0,i.o)("div",{className:`horizontal-feed-header ${c?"with-cover":"without-cover"} ${l&&"with-watermark"}`,children:[c&&(0,i.o)(U,{mediaUrl:e,contentType:t,containerLabel:n,isActive:r,titleAlignment:l?"top":"center",watermark:s,showFeedStoryCoverAndTitle:o,enableTitleFocus:a}),l&&!c&&(0,i.o)("div",{className:"watermark cover-slot",children:s})]})}):null},Y=({storyConfig:e,isActive:t,hasSound:n,onMute:r,feedPaused:o,isMobile:s,onPlayToggle:a,isMuted:c,isVertical:l,showFeedStoryCoverAndTitle:d,closable:u,onClose:h,showControls:p,showWatermark:f=!0,enableTitleFocus:m=!0})=>{const v=s&&f,g=d||v,y=v?(0,i.o)(M,{owner:e.owner,storyId:e._id}):null;return(0,i.o)(i.I,{css:".controls-header{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;z-index:20}.controls-header-title-container{display:flex;height:7.7em;flex-direction:row;justify-content:space-between;align-items:flex-start;padding:2.2em .9em 1.4em 1.3em;background:linear-gradient(0deg,#0000 6.99%,#00000080 163.32%)}.desktop .controls-header-title-container{padding-right:min(1.32em,16px
1)}.controls-header-vertical{display:flex;flex-direction:row;align-items:flex-start;height:7.7em;padding:2.5em 1.2em 0;justify-content:space-between;text-align:center;background:linear-gradient(0deg,#0000 6.99%,#00000080 163.32%)}",children:(0,i.o)("div",{className:"controls-header ui",children:[l?(0,i.o)("div",{className:"controls-header-vertical",children:(0,i.o)(T,{closable:u,onClose:h,storyConfig:e,isActive:t,isMobile:s,showFeedStoryCoverAndTitle:d,watermark:y,enableTitleFocus:m})}):(0,i.o)("div",{className:"controls-header-title-container",children:[g?(0,i.o)($,{mediaUrl:e.currentCover.mediaUrl,contentType:e.currentCover.contentType,containerLabel:e.containerLabel,isActive:t,showFeedStoryCoverAndTitle:d,watermark:y,enableTitleFocus:m}):(0,i.o)("div",{}),u&&(0,i.o)(E,{onClick:h})]}),p&&(0,i.o)(D,{onMute:n?r:void 0,paused:o,onPlayToggle:s?void 0:a,isMuted:c,withOffsetTop:!0,name:e.title})]})})};var j=(e=>(e.CHAPTER_CHANGE="chapter-change",e.INTERACTION_STATE_CHANGED="interaction-state-changed",e.CONTROLLER_READY="controller-ready",e.SHOPPING_VISIBILITY="shopping_visibility",e.CONFIG_UPDATED="config-updated",e))(j||{});const z=(e,t,n)=>{(0,i.p)(()=>{const i=e.current,r=i?.videoController,o=()=>{i?.videoController?.addEventListener("loadedmetadata",()=>{i?.videoController&&t(i.videoController)},{once:!0})};return r?o():i?.addEventListener(j.CONTROLLER_READY,o,{once:!0}),()=>{n?.(r)}},[e])},q=e=>{const[t,n]=(0,i.h)(-1),[r,o]=(0,i.h)([]),s=0===t,a=t===r.length-1,c=(e,t)=>{n(e),o(n=>(t||n).map((t,n)=>({...t,isCurrent:e===n})))},l=e=>{const{chapterIndex:t}=e.detail;c(t)},d=()=>{const t=e.current?.videoController;if(!t)return;const n=t.chapters,i=t.currentChapterIndex;c(i,n)};return z(e,e=>{const t=e.chapters,n=e.currentChapterIndex;c(n,t),e.addEventListener(j.CHAPTER_CHANGE,l),e.addEventListener(j.CONFIG_UPDATED,d)},e=>{e?.removeEventListener(j.CHAPTER_CHANGE,l),e?.removeEventListener(j.CONFIG_UPDATED,d)}),{currentChapterIndex:t,chapters:r,goToChapterIndex:t=>{e.current?.videoController?.goToChapterIndex(t)},isFirstChapter:s,isLastChapter:a}},H=(e,t,n)=>({left:100*e+"%",width:`calc(${100*(t-e)}% - ${2*n/10}em)`});var W=(e=>(e.PROPORTIONAL="proportional",e.FIXED="fixed",e))(W||{});const G=({isActive:e,chapter:t,progress:n,totalDuration:r,onClick:o,segmentWidth:s="proportional"})=>{const a=t.timing.start/r,c=t.timing.end/r;return(0,i.o)(i.I,{css:".segment{position:absolute;height:100%;background-color:#fff6;border-radius:.2em;margin:0 .2em;overflow:hidden;transform:translateZ(0)}.segment.fixed{position:relative;flex:1}.segment.active{opacity:1}.segment-progress{position:absolute;left:0;width:100%;height:100%;background-color:#fff;border-radius:.2em;overflow:hidden;transform-origin:left;transform:scaleX(0);transition:none}.segment.active .segment-progress{transition:transform .3s linear}",children:(0,i.o)("div",{className:`segment ${e?"active":""} ${"fixed"===s?"fixed":""}`,style:"proportional"===s?H(a,c,2):{},onClick:o,children:(0,i.o)("div",{className:"segment-progress",style:{transform:`scaleX(${n}) translate3D(0, 0, 0)`}})})})},X=({totalDuration:e,currentTime:t,chapters:n,onChapterClick:r,segmentWidth:o=W.PROPORTIONAL})=>{const s=e=>()=>{r?.(e)};
1return(0,i.o)(i.I,{css:".time-bar{position:relative;display:flex;flex-direction:row;align-items:center;height:.15em;min-height:1.5px;width:100%}",children:(0,i.o)("div",{className:"time-bar",children:n.map((n,r)=>{const a=t>=n.timing.start&&t<n.timing.end,c=t>=n.timing.end,l=a?(t-n.timing.start)/(n.timing.end-n.timing.start):c?1:0;return(0,i.o)(G,{isActive:a,chapter:n,progress:l,totalDuration:e,onClick:s(r),segmentWidth:o},r)})})})};function Z(e){return`${Math.floor(e/60).toString().padStart(2,"0")}:${Math.floor(e%60).toString().padStart(2,"0")}`}const J=e=>null!==e.target?.closest(".vertical-time-bar"),K=(e,t)=>{const n=Math.min(Math.max(e-t.left,0),t.width);return Math.min(Math.max(n/t.width,0),1)},Q=(e,t,n)=>{if(!n||!t||t<=0)return!1;const i=e*t;if(i>=t)return!1;try{return n.currentTime=i,!0}catch(e){return console.warn("Failed to seek video:",e),!1}},ee=(e,t)=>t?e.touches[0].clientX:e.clientX,te=({currentTime:e,totalDuration:t,videoRef:n,isMobile:r,onTimeBarInteraction:o,contentContainerRef:s})=>{const a=(0,i._)(null),[c,l]=(0,i.h)(1),d=(0,i._)(null);(0,i.p)(()=>{(0,i.l)("Roboto_600","https://fonts.gstatic.com/s/roboto/v48/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWuYaalmUiAr0klQmz24.woff2")},[]),(0,i.p)(()=>{const e=n.current;if(!e)return;const t=()=>l(e.playbackRate);return e.addEventListener("ratechange",t),l(e.playbackRate),()=>{e.removeEventListener("ratechange",t)}},[n]);const u=e=>{const t=s.current?.querySelector(".interaction-layer");t&&(e?t.classList.add("hide"):t.classList.remove("hide"))},h=e=>{const t=s.current?.querySelectorAll(".vertical-time-bar-label");t&&t.forEach(t=>{e?(u(!0),t.classList.add("dragging")):(u(!1),t.classList.remove("dragging"))})},p=()=>{const e=s.current?.querySelectorAll(".vertical-time-bar-label");e&&(e.forEach(e=>{e.classList.add("fade-out")}),setTimeout(()=>{e.forEach(e=>{e.classList.remove("fade-out")})},500))},f=(0,i.T)((e,i)=>{const s=n.current;if(!s||!a.current)return;const c=i?"touchmove":"mousemove",l=i?"touchend":"mouseup",u=ee(e,i),f=i?e.touches[0].clientY:e.clientY;let m=!1;const v=a.current.getBoundingClientRect(),b=s.duration||t;if(!b||b<=0)return;r&&(d.current=s.currentTime?s.currentTime/b:0);const w=e=>{if(g(e)||y(e))return;const t=ee(e,i),n=((e,t)=>t?e.touches[0].clientY:e.clientY)(e,i),a=Math.abs(t-u),c=Math.abs(n-f);if(!m&&a>8&&a>2*c&&(m=!0,h(!0),o?.(!0)),m&&s)if(r){if(null===d.current)return;const e=(t-u)/v.width,n=Math.min(Math.max(d.current+e,0),1);Q(n,b,s)||(m=!1)}else{const e=K(t,v);Q(e,b,s)||(m=!1)}},C=()=>{h(!1),p(),o?.(!1),window.removeEventListener(c,w),window.removeEventListener(l,C)};window.addEventListener(c,w),window.addEventListener(l,C)},[n,t,r,o]);(0,i.p)(()=>{const e=a.current;if(!e)return;const i=e=>{if(e.preventDefault(),J(e)){h(!0),setTimeout(()=>{p()},500);const i=n.current,r=a.current?.getBoundingClientRect();if(i&&r){const n=i.duration||t;if(n&&n>0){const t=K(e.clientX,r);Q(t,n,i)}}}(r||J(e))&&f(e,!1)},o=e=>{e.preventDefault(),f(e,!0)};return e.addEventListener("mousedown",i),e.addEventListener("touchstart",o),()=>{e.removeEventListener("mousedown",i),e.removeEventListener("touchstart",o)}},[n,r,t,f]);const m=t>0?e/t:0,v=e>0;return(0,i.o)(i.I,{css:".vertical-time-bar-touch-area{position:relative;width:100%;height:4em;touch-action:none;pointer-events:auto;border-color:red}.vertical-time-bar-touch-area.mobile{height:5em}.vertical-time-bar-wrapper{position:absolute;bottom:0;left:0;right:0;pointer-events:auto}.vertical-time-bar{position:relative;bottom:.4em;left:0;right:0;transform:translateY(-50%);pointer-events:auto;display:flex;flex-direction:column;align-items:center;height:.2em;min-height:.2em;width:100%;background-color:#fff6;overflow:visible;cursor:pointer;user-select:none;box-shadow:0 0 .4em #0003}.vertical-time-bar.mobile{height:.3em;min-height:3em}.vertical-time-bar:hover,.vertical-time-bar.dragging{transform:translateY(-50%) scaleY(2)}.vertical-time-bar:hover .vertical-time-bar-scrub-head,.vertical-time-bar.dragging .vertical-time-bar-scrub-head{transform:translate(-50%,-50%) scaleY(.5)}.vertical-time-bar-progress{position:absolute;top:0;left:0;width:0;height:100%;background-color:#fff;overflow:visible;box-shadow:0 0 .3em #0000004d}.vertical-time-bar-scrub-head{width:1em;height:1em;border-radius:50%;background:#fff;box-shadow:0 .2em .6em #00000026;border:none;position:absolute;
1left:100%;top:50%;transform:translate(-50%,-50%);z-index:2;opacity:0;visibility:hidden;transition:box-shadow .2s,opacity .15s,visibility .15s}.vertical-time-bar-cursor{position:absolute;top:50%;width:.7em;height:.7em;background:#fff;border-radius:50%;transform:translate(-50%,-50%);z-index:1;box-shadow:0 0 .2em #0000004d;opacity:0}.vertical-time-bar:hover .vertical-time-bar-cursor{opacity:1;box-shadow:0 0 .3em #0006;transform:translate(-50%,-50%) scaleY(.5)}.vertical-time-bar.dragging .vertical-time-bar-scrub-head{opacity:1;visibility:visible;box-shadow:0 0 0 .3em #0000001a,0 .2em .6em #0000002e}.vertical-time-bar-label{position:absolute;display:flex;left:50%;bottom:2em;transform:translate(-50%);color:#fff;font-size:1.5em;font-family:Roboto_600;letter-spacing:.01em;align-items:center;gap:.2em;pointer-events:auto;user-select:none;z-index:3;background:none;white-space:nowrap;justify-content:center;opacity:0;text-shadow:0 .1em .2em rgba(0,0,0,.4)}.vertical-time-bar-label svg{width:1.6em;height:1.6em;filter:drop-shadow(0 .1em .2em rgba(0,0,0,.4))}.vertical-time-bar-label.rate{opacity:1;gap:0}.vertical-time-bar-label.dragging{opacity:1;visibility:visible}.vertical-time-bar-label.fade-out{transition:opacity .5s ease-out}.vertical-time-bar-label-current{color:#fff;letter-spacing:.01em;text-shadow:0 .1em .2em rgba(0,0,0,.4)}.vertical-time-bar-label-slash{color:#fff;opacity:.7;padding:0 .2em;text-shadow:0 .1em .2em rgba(0,0,0,.4)}.vertical-time-bar-label-total{color:#fff;opacity:.5;letter-spacing:.01em;text-shadow:0 .1em .2em rgba(0,0,0,.4)}.vertical-time-bar-rate-arrow{font-size:1.1em;opacity:.8;text-shadow:0 .1em .2em rgba(0,0,0,.4)}",children:(0,i.o)("div",{className:"vertical-time-bar-touch-area "+(r?"mobile":""),ref:a,style:{position:"relative"},children:[(0,i.o)("div",{className:"vertical-time-bar-wrapper",style:{position:"absolute",bottom:0,left:0,right:0},children:(0,i.o)("div",{className:"vertical-time-bar"+(v?" active":""),children:[(0,i.o)("div",{className:"vertical-time-bar-progress",style:{width:100*m+"%"},children:(0,i.o)("div",{className:"vertical-time-bar-scrub-head"})}),(0,i.o)("div",{className:"vertical-time-bar-cursor "+(v?"active":""),style:{left:100*m+"%"}})]})}),(0,i.o)("div",{className:"vertical-time-bar-label",children:[(0,i.o)("span",{className:"vertical-time-bar-label-current",children:Z(e)}),(0,i.o)("span",{className:"vertical-time-bar-label-slash",children:" / "}),(0,i.o)("span",{className:"vertical-time-bar-label-total",children:Z(t)})]}),1!==c&&(0,i.o)("div",{className:"vertical-time-bar-label rate",children:[(0,i.o)("span",{children:["x",c]}),(0,i.o)(C,{})]})]})})},ne=({videoRef:e,isVertical:t,isMobile:n,contentContainerRef:r})=>{const{currentTime:o,duration:s}=(e=>{const[t,n]=(0,i.h)(0),[r,o]=(0,i.h)(0),[s,a]=(0,i.h)(!1),c=(0,i._)(),l=()=>{a(!0)},d=()=>{a(!1)},u=e=>{n(e?.target?.currentTime||0)};return z(e,e=>{n(e.currentTime),o(e.duration),a(e.isPlaying),e.addEventListener("timeupdate",u),e.addEventListener("play",l),e.addEventListener("pause",d)},e=>{e?.removeEventListener("timeupdate",u),e?.removeEventListener("play",l),e?.removeEventListener("pause",d)}),(0,i.p)(()=>{if(s)return c.current=requestAnimationFrame(function t(){if(e.current){const i=e.current.currentTime;n(i),c.current=requestAnimationFrame(t)}}),()=>{c.current&&(cancelAnimationFrame(c.current),c.current=void 0)};c.current&&(cancelAnimationFrame(c.current),c.current=void 0)},[s]),{currentTime:t,duration:r,isPlaying:s,togglePlay:()=>{e.current?.videoController&&(s?e.current?.videoController.pause():e.current?.videoController.play())}}})(e),{chapters:a}=q(e);return(0,i.o)(i.I,{css:".controls-container{position:absolute;bottom:0;left:0;right:0;margin:.5em 0;display:flex;flex-direction:row;align-items:center;pointer-events:all}.controls-container.no-pointer-events{pointer-events:none}.controls-container.top{top:0;bottom:auto}.controls-container.bottom{bottom:0;top:auto}.controls-container.mg{margin:.7em .84em}.controls-container.no-margin{margin:0}.control-bar{flex:1;z-index:1}.time-bar-container{z-index:21}",children:(0,i.o)("div",{className:"ui time-bar-container",children:(0,i.o)("div",{className:`controls-container ${t?"bottom no-margin no-pointer-events":"top mg"} `,children:(0,i.o)("div",{className:"control-bar",children:t?(0,i.o)(te,{videoRef:e,currentTime:o,totalDuration:s,isMobile:n,contentContainerRef:r}):(0,i.o)(X,{segmentWidth:W.FIXED,currentTime:o,chapters:a,totalDuration:s})})})})})},ie=e=>{const[t,n]=(0,i.h)(!1);return(0,i.p)(()=>e.subscribe("ad-is-active",e=>{n(e)}),[]),t},re=e=>{const t=(0,i.q)(b);return{onNextButtonClick:(0,i.T)(n=>{n.preventDefault(),t?.sendStoryChangeChapterEvent("next"),e.current?.videoController?.nextChapter()},[]),onPreviousButtonClick:(0,i.T)(n=>{n.preventDefault(),t?.sendStoryChangeChapterEvent("previous"),e.current?.videoController?.previousChapter()},[])}},oe=["INPUT","TEXTAREA"],se=e=>{const{width:t,height:n}=e?{width:e.clientWidth,height:e.clientHeight}:{width:window.innerWidth,height:window.innerHeight};return t/n<.75},ae=e=>{if(!se(e))return!1;const{width:t,height:n}=e?{width:e.clientWidth,height:e.clientHeight}:{width:window.innerWidth,height:window.innerHeight};return t/n>.5625},ce=(e,t,n=!1)=>{const{width:i,height:r}=t?{width:t.clientWidth,height:t.clientHeight}:{width:window.innerWidth,height:window.innerHeight},o=e?1:.9,s=i/375*o,a=r/667*o;return 10*Math.min(s,a)},le=e=>e?e.clientWidth:window.innerWidth;function de(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class ue{constructor(){this.subscriptions=[]}add(e){return function(e,t){-1===e.indexOf(t)&&e.push(t)}(this.subscriptions,e),()=>de(this.subscriptions,e)}
1notify(e,t,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](e,t,n);else for(let r=0;r<i;r++){const i=this.subscriptions[r];i&&i(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function he(e,t){return t?e*(1e3/t):0}const pe=e=>e;class fe{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const me=["prepare","read","update","preRender","render","postRender"],{schedule:ve,cancel:ge,state:ye,steps:be}=function(e){let t=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=me.reduce((e,n)=>(e[n]=function(e){let t=new fe,n=new fe,i=0,r=!1,o=!1;const s=new WeakSet,a={schedule:(e,o=!1,a=!1)=>{const c=a&&r,l=c?t:n;return o&&s.add(e),l.add(e)&&c&&r&&(i=t.order.length),e},cancel:e=>{n.remove(e),s.delete(e)},process:c=>{if(r)o=!0;else{if(r=!0,[t,n]=[n,t],n.clear(),i=t.order.length,i)for(let n=0;n<i;n++){const i=t.order[n];s.has(i)&&(a.schedule(i),e()),i(c)}r=!1,o&&(o=!1,a.process(c))}}};return a}(()=>t=!0),e),{}),o=e=>{r[e].process(i)},s=()=>{const r=performance.now();t=!1,i.delta=n?1e3/60:Math.max(Math.min(r-i.timestamp,40),1),i.timestamp=r,i.isProcessing=!0,me.forEach(o),i.isProcessing=!1,t&&(n=!1,e(s))};return{schedule:me.reduce((o,a)=>{const c=r[a];return o[a]=(r,o=!1,a=!1)=>(t||(t=!0,n=!0,i.isProcessing||e(s)),c.schedule(r,o,a)),o},{}),cancel:e=>me.forEach(t=>r[t].cancel(e)),state:i,steps:r}}(typeof requestAnimationFrame<"u"?requestAnimationFrame:pe);let we;function Ce(){we=void 0}const ke={now:()=>(void 0===we&&ke.set(ye.isProcessing?ye.timestamp:performance.now()),we),set:e=>{we=e,queueMicrotask(Ce)}};class xe{constructor(e,t={}){var n;this.version="11.0.8",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=ke.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ke.now()}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new ue);const n=this.events[e].add(t);return"change"===e?()=>{n(),ve.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ke.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return he(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Se(e,t){return new xe(e,t)}let Ae=pe,Ee=pe;function _e(e,t,n){var i;if("string"==typeof e){let t=document;n?(null!==(i=n[e])&&void 0!==i||(n[e]=t.querySelectorAll(e)),e=n[e]):e=t.querySelectorAll(e)}else e instanceof Element&&(e=[e]);return Array.from(e||[])}const Te=new WeakMap;function Pe(e){let t;return()=>(void 0===t&&(t=e()),t)}const Ie=Pe(()=>void 0!==window.ScrollTimeline);class Le{constructor(e){this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){const t=this.animations.map(t=>{if(!Ie()||!t.attachTimeline)return t.pause(),function(e,t){let n;const i=()=>{const{currentTime:i}=t,r=(null===i?0:i.value)/100;n!==r&&e(r),n=r};return ve.update(i,!0),()=>ge(i)}(e=>{t.time=t.duration*e},e);t.attachTimeline(e)});return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}stop(){this.runAll("stop")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const Me=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ve=new Set(Me),Fe
1=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),Ne="data-"+Fe("framerAppearId"),Re=e=>1e3*e,Be=e=>e/1e3,Oe=e=>Array.isArray(e)&&"number"==typeof e[0];function De(e){return!!(!e||"string"==typeof e&&$e[e]||Oe(e)||Array.isArray(e)&&e.every(De))}const Ue=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,$e={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ue([0,.65,.55,1]),circOut:Ue([.55,0,1,.45]),backIn:Ue([.31,.01,.66,-.59]),backOut:Ue([.33,1.53,.69,.99])};function Ye(e){if(e)return Oe(e)?Ue(e):Array.isArray(e)?e.map(Ye):$e[e]}const je=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function ze(e,t,n,i){if(e===t&&n===i)return pe;return r=>0===r||1===r?r:je((t=>function(e,t,n,i,r){let o,s,a=0;do{s=t+(n-t)/2,o=je(s,i,r)-e,o>0?n=s:t=s}while(Math.abs(o)>1e-7&&++a<12);return s}(t,0,1,e,n))(r),t,i)}const qe=ze(.42,0,1,1),He=ze(0,0,.58,1),We=ze(.42,0,.58,1),Ge=e=>Array.isArray(e)&&"number"!=typeof e[0],Xe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ze=e=>t=>1-e(1-t),Je=e=>1-Math.sin(Math.acos(e)),Ke=Ze(Je),Qe=Xe(Je),et=ze(.33,1.53,.69,.99),tt=Ze(et),nt=Xe(tt),it={linear:pe,easeIn:qe,easeInOut:We,easeOut:He,circIn:Je,circInOut:Qe,circOut:Ke,backIn:tt,backInOut:nt,backOut:et,anticipate:e=>(e*=2)<1?.5*tt(e):.5*(2-Math.pow(2,-10*(e-1)))},rt=e=>{if(Array.isArray(e)){Ee(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,i,r]=e;return ze(t,n,i,r)}return"string"==typeof e?(Ee(void 0!==it[e],`Invalid easing type '${e}'`),it[e]):e},ot=(e,t,n)=>n>t?t:n<e?e:n,st=(e,t)=>n=>t(e(n)),at=(...e)=>e.reduce(st),ct=(e,t,n)=>{const i=t-e;return 0===i?1:(n-e)/i},lt=(e,t,n)=>e+(t-e)*n;function dt(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const ut={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},ht={...ut,transform:e=>ot(0,1,e)},pt={...ut,default:1},ft=e=>Math.round(1e5*e)/1e5,mt=/(-)?([\d]*\.?[\d])+/g,vt=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,gt=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function yt(e){return"string"==typeof e}const bt=(e,t)=>n=>!!(yt(n)&>.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),wt=(e,t,n)=>i=>{if(!yt(i))return i;const[r,o,s,a]=i.match(mt);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},Ct={...ut,transform:e=>Math.round((e=>ot(0,255,e))(e))},kt={test:bt("rgb","red"),parse:wt("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+Ct.transform(e)+", "+Ct.transform(t)+", "+Ct.transform(n)+", "+ft(ht.transform(i))+")"},xt={test:bt("#"),parse:function(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}},transform:kt.transform},St=e=>({test:t=>yt(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),At=St("deg"),Et=St("%"),_t=St("px"),Tt=St("vh"),Pt=St("vw"),It={...Et,parse:e=>Et.parse(e)/100,transform:e=>Et.transform(100*e)},Lt={test:bt("hsl","hue"),parse:wt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Et.transform(ft(t))+", "+Et.transform(ft(n))+", "+ft(ht.transform(i))+")"},Mt=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},Vt=[xt,kt,Lt];function Ft(e){const t=(e=>Vt.find(t=>t.test(e)))(e);Ee(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`);let n=t.parse(e);return t===Lt&&(n=function({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,n/=100;let r=0,o=0,s=0;if(t/=100){const i=n<.5?n*(1+t):n+t-n*t,a=2*n-i;r=dt(a,i,e+1/3),o=dt(a,i,e),s=dt(a,i,e-1/3)}else r=o=s=n;return{red:Math.round(255*r),green:Math.round(255*o),blue:Math.round(255*s),alpha:i}}(n)),n}const Nt=(e,t)=>{const n=Ft(e),i=Ft(t),r={...n};return e=>(r.red=Mt(n.red,i.red,e),r.green=Mt(n.green,i.green,e),r.blue=Mt(n.blue,i.blue,e),r.alpha=lt(n.alpha,i.alpha,e),kt.transform(r))},Rt={test:e=>kt.test(e)||xt.test(e)||Lt.test(e),parse:e=>kt.test(e)?kt.parse(e):Lt.test(e)?Lt.parse(e):xt.parse(e),transform:e=>yt(e)?e:e.hasOwnProperty("red")?kt.transform(e):Lt.transform(e)}
1,Bt="number",Ot="color",Dt=/(var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\))|(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))|((-)?([\d]*\.?[\d])+)/gi;function Ut(e){const t=e.toString(),n=t.match(Dt)||[],i=[],r={color:[],number:[],var:[]},o=[];for(let e=0;e<n.length;e++){const t=n[e];Rt.test(t)?(r.color.push(e),o.push(Ot),i.push(Rt.parse(t))):t.startsWith("var(")?(r.var.push(e),o.push("var"),i.push(t)):(r.number.push(e),o.push(Bt),i.push(parseFloat(t)))}return{values:i,split:t.replace(Dt,"${}").split("${}"),indexes:r,types:o}}function $t(e){return Ut(e).values}function Yt(e){const{split:t,types:n}=Ut(e),i=t.length;return e=>{let r="";for(let o=0;o<i;o++)if(r+=t[o],void 0!==e[o]){const t=n[o];r+=t===Bt?ft(e[o]):t===Ot?Rt.transform(e[o]):e[o]}return r}}const jt=e=>"number"==typeof e?0:e,zt={test:function(e){var t,n;return isNaN(e)&&yt(e)&&((null===(t=e.match(mt))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(vt))||void 0===n?void 0:n.length)||0)>0},parse:$t,createTransformer:Yt,getAnimatableNone:function(e){const t=$t(e);return Yt(e)(t.map(jt))}},qt=e=>t=>"string"==typeof t&&t.startsWith(e),Ht=qt("--"),Wt=qt("var(--"),Gt=e=>!!Wt(e)&&Xt.test(e.split("/*")[0].trim()),Xt=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?
1:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)$/i;function Zt(e,t){return n=>n>0?t:e}function Jt(e,t){return n=>lt(e,t,n)}function Kt(e){return"number"==typeof e?Jt:"string"==typeof e?Gt(e)?Zt:Rt.test(e)?Nt:tn:Array.isArray(e)?Qt:"object"==typeof e?Rt.test(e)?Nt:en:Zt}function Qt(e,t){const n=[...e],i=n.length,r=e.map((e,n)=>Kt(e)(e,t[n]));return e=>{for(let t=0;t<i;t++)n[t]=r[t](e);return n}}function en(e,t){const n={...e,...t},i={};for(const r in n)void 0!==e[r]&&void 0!==t[r]&&(i[r]=Kt(e[r])(e[r],t[r]));return e=>{for(const t in i)n[t]=i[t](e);return n}}const tn=(e,t)=>{const n=zt.createTransformer(t),i=Ut(e),r=Ut(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?at(Qt(function(e,t){var n;const i=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const s=t.types[o],a=e.indexes[s][r[s]],c=null!==(n=e.values[a])&&void 0!==n?n:0;i[o]=c,r[s]++}return i}(i,r),r.values),n):(Ae(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Zt(e,t))};function nn(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?lt(e,t,n):Kt(e)(e,t)}function rn(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=ct(0,t,i);e.push(lt(n,1,r))}}function on(e){const t=[0];return rn(t,e.length-1),t}function sn(e,t){return e.map(()=>t||We).splice(0,e.length-1)}function an({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=Ge(i)?i.map(rt):rt(i),o={done:!1,value:t[0]},s=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:on(t),e),a=function(e,t,{clamp:n=!0,ease:i,mixer:r}={}){const o=e.length;if(Ee(o===t.length,"Both input and output ranges must be the same length"),1===o)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const i=[],r=n||nn,o=e.length-1;for(let n=0;n<o;n++){let o=r(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||pe:t;o=at(e,o)}i.push(o)}return i}(t,i,r),a=s.length,c=t=>{let n=0;if(a>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const i=ct(e[n],e[n+1],t);return s[n](i)};return n?t=>c(ot(e[0],e[o-1],t)):c}(s,t,{ease:Array.isArray(r)?r:sn(t,r)});return{calculatedDuration:e,next:t=>(o.value=a(t),o.done=t>=e,o)}}function cn(e,t,n){const i=Math.max(t-5,0);return he(n-e(i),t-i)}function ln(e,t){return e*Math.sqrt(1-t*t)}const dn=["duration","bounce"],un=["stiffness","damping","mass"];function hn(e,t){return t.some(t=>void 0!==e[t])}function pn({keyframes:e,restDelta:t,restSpeed:n,...i}){const r=e[0],o=e[e.length-1],s={done:!1,value:r},{stiffness:a,damping:c,mass:l,duration:d,velocity:u,isResolvedFromDuration:h}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!hn(e,un)&&hn(e,dn)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:i=1}){let r,o;Ae(e<=Re(10),"Spring duration must be 10 seconds or less");let s=1-t;s=ot(.05,1,s),e=ot(.01,10,Be(e)),s<1?(r=t=>{const i=t*s,r=i*e;return.001-(i-n)/ln(t,s)*Math.exp(-r)},o=t=>{const i=t*s*e,o=i*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,c=Math.exp(-i),l=ln(Math.pow(t,2),s);return(.001-r(t)>0?-1:1)*((o-a)*c)/l}):(r=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,o=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let i=n;for(let n=1;n<12;n++)i-=e(i)/t(i);return i}(r,o,5/e);if(e=Re(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(a,2)*i;return{stiffness:t,damping:2*s*Math.sqrt(i*t),duration:e}}}(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...i,velocity:-Be(i.velocity||0)}),p=u||0,f=c/(2*Math.sqrt(a*l)),m=o-r,v=Be(Math.sqrt(a/l)),g=Math.abs(m)<5;let y;if(n||(n=g?.01:2),t||(t=g?.005:.5),f<1){const e=ln(v,f);y=t=>{const n=Math.exp(-f*v*t);return o-n*((p+f*v*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===f)y=e=>o-Math.exp(-v*e)*(m+(p+v*m)*e);else{const e=v*Math.sqrt(f*f-1);y=t=>{const n=Math.exp(-f*v*t),i=Math.min(e*t,300);return o-n*((p+f*v*m)*Math.sinh(i)+e*m*Math.cosh(i))/e}}
1return{calculatedDuration:h&&d||null,next:e=>{const i=y(e);if(h)s.done=e>=d;else{let r=p;0!==e&&(r=f<1?cn(y,e,i):0);const a=Math.abs(r)<=n,c=Math.abs(o-i)<=t;s.done=a&&c}return s.value=s.done?o:i,s}}}function fn({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:c,restDelta:l=.5,restSpeed:d}){const u=e[0],h={done:!1,value:u},p=e=>void 0===a?c:void 0===c||Math.abs(a-e)<Math.abs(c-e)?a:c;let f=n*t;const m=u+f,v=void 0===s?m:s(m);v!==m&&(f=v-u);const g=e=>-f*Math.exp(-e/i),y=e=>v+g(e),b=e=>{const t=g(e),n=y(e);h.done=Math.abs(t)<=l,h.value=h.done?v:n};let w,C;const k=e=>{(e=>void 0!==a&&e<a||void 0!==c&&e>c)(h.value)&&(w=e,C=pn({keyframes:[h.value,p(h.value)],velocity:cn(y,e,h.value),damping:r,stiffness:o,restDelta:l,restSpeed:d}))};return k(0),{calculatedDuration:null,next:e=>{let t=!1;return!C&&void 0===w&&(t=!0,b(e),k(e)),void 0!==w&&e>w?C.next(e-w):(!t&&b(e),h)}}}const mn=e=>{const t=({timestamp:t})=>e(t);return{start:()=>ve.update(t,!0),stop:()=>ge(t),now:()=>ye.isProcessing?ye.timestamp:ke.now()}},vn=2e4;function gn(e){let t=0,n=e.next(t);for(;!n.done&&t<vn;)t+=50,n=e.next(t);return t>=vn?1/0:t}const yn={decay:fn,inertia:fn,tween:an,keyframes:an,spring:pn},bn=e=>e/100;function wn({autoplay:e=!0,delay:t=0,driver:n=mn,keyframes:i,type:r="keyframes",repeat:o=0,repeatDelay:s=0,repeatType:a="loop",onPlay:c,onStop:l,onComplete:d,onUpdate:u,...h}){let p,f,m=1,v=!1;const g=()=>{f=new Promise(e=>{p=e})};let y;g();const b=yn[r]||an;let w;b!==an&&"number"!=typeof i[0]&&(w=at(bn,nn(i[0],i[1])),i=[0,100]);const C=b({...h,keyframes:i});let k;"mirror"===a&&(k=b({...h,keyframes:[...i].reverse(),velocity:-(h.velocity||0)}));let x="idle",S=null,A=null,E=null;null===C.calculatedDuration&&o&&(C.calculatedDuration=gn(C));const{calculatedDuration:_}=C;let T=1/0,P=1/0;null!==_&&(T=_+s,P=T*(o+1)-s);let I=0;const L=e=>{if(null===A)return;m>0&&(A=Math.min(A,e)),m<0&&(A=Math.min(e-P/m,A)),I=null!==S?S:Math.round(e-A)*m;const n=I-t*(m>=0?1:-1),r=m>=0?n<0:n>P;I=Math.max(n,0),"finished"===x&&null===S&&(I=P);let c=I,l=C;if(o){const e=Math.min(I,P)/T;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,o+1),!!(t%2)&&("reverse"===a?(n=1-n,s&&(n-=s/T)):"mirror"===a&&(l=k)),c=ot(0,1,n)*T}const d=r?{done:!1,value:i[0]}:l.next(c);w&&(d.value=w(d.value));let{done:h}=d;!r&&null!==_&&(h=m>=0?I>=P:I<=0);const p=null===S&&("finished"===x||"running"===x&&h);return u&&u(d.value),p&&F(),d},M=()=>{y&&y.stop(),y=void 0},V=()=>{x="idle",M(),p(),g(),A=E=null},F=()=>{x="finished",d&&d(),M(),p()},N=()=>{if(v)return;y||(y=n(L));const e=y.now();c&&c(),null!==S?A=e-S:(!A||"finished"===x)&&(A=e),"finished"===x&&g(),E=A,S=null,x="running",y.start()};e&&N();const R={then:(e,t)=>f.then(e,t),get time(){return Be(I)},set time(e){e=Re(e),I=e,null===S&&y&&0!==m?A=y.now()-e/m:S=e},get duration(){const e=null===C.calculatedDuration?gn(C):C.calculatedDuration;return Be(e)},get speed(){return m},set speed(e){e===m||!y||(m=e,R.time=Be(I))},get state(){return x},play:N,pause:()=>{x="paused",S=I},stop:()=>{v=!0,"idle"!==x&&(x="idle",l&&l(),V())},cancel:()=>{null!==E&&L(E),V()},complete:()=>{x="finished"},sample:e=>(A=0,L(e))};return R}const Cn=Pe(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),kn=new Set(["opacity","clipPath","filter","transform"]);const xn={type:"spring",stiffness:500,damping:25,restSpeed:10},Sn={type:"keyframes",duration:.8},An={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},En=(e,{keyframes:t})=>t.length>2?Sn:Ve.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):xn:An,_n=(e,t)=>"zIndex"!==e&&!("number"!=typeof t&&!Array.isArray(t)&&("string"!=typeof t||!zt.test(t)&&"0"!==t||t.startsWith("url("))),Tn=new Set(["brightness","contrast","saturate","opacity"]);function Pn(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[i]=n.match(mt)||[];if(!i)return e;const r=n.replace(i,"");let o=Tn.has(t)?1:0;return i!==n&&(o*=100),t+"("+o+r+")"}const In=/([a-z-]*)\(.*?\)/g,Ln={...zt,getAnimatableNone:e=>{const t=e.match(In);return t?t.map(Pn).join(" "):e}},Mn={...ut,transform:Math.round},Vn={borderWidth:_t,borderTopWidth:_t,borderRightWidth:_t,borderBottomWidth:_t,borderLeftWidth:_t,borderRadius:_t,radiu
1s:_t,borderTopLeftRadius:_t,borderTopRightRadius:_t,borderBottomRightRadius:_t,borderBottomLeftRadius:_t,width:_t,maxWidth:_t,height:_t,maxHeight:_t,size:_t,top:_t,right:_t,bottom:_t,left:_t,padding:_t,paddingTop:_t,paddingRight:_t,paddingBottom:_t,paddingLeft:_t,margin:_t,marginTop:_t,marginRight:_t,marginBottom:_t,marginLeft:_t,rotate:At,rotateX:At,rotateY:At,rotateZ:At,scale:pt,scaleX:pt,scaleY:pt,scaleZ:pt,skew:At,skewX:At,skewY:At,distance:_t,translateX:_t,translateY:_t,translateZ:_t,x:_t,y:_t,z:_t,perspective:_t,transformPerspective:_t,opacity:ht,originX:It,originY:It,originZ:_t,zIndex:Mn,fillOpacity:ht,strokeOpacity:ht,numOctaves:Mn},Fn={...Vn,color:Rt,backgroundColor:Rt,outlineColor:Rt,fill:Rt,stroke:Rt,borderColor:Rt,borderTopColor:Rt,borderRightColor:Rt,borderBottomColor:Rt,borderLeftColor:Rt,filter:Ln,WebkitFilter:Ln},Nn=e=>Fn[e];function Rn(e,t){let n=Nn(e);return n!==Ln&&(n=zt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bn=e=>/^0[^.\s]+$/.test(e);function On(e){return"number"==typeof e?0===e:null!==e?"none"===e||"0"===e||Bn(e):void 0}function Dn(e,t){return e[t]||e.default||e}const Un=(e,t,n,i={})=>r=>{const o=Dn(i,e)||{},s=o.delay||i.delay||0;let{elapsed:a=0}=i;a-=Re(s);const c=function(e,t,n,i){const r=_n(t,n);let o;o=Array.isArray(n)?[...n]:[null,n];const s=void 0!==i.from?i.from:e.get();let a;const c=[];for(let e=0;e<o.length;e++)null===o[e]&&(o[e]=0===e?s:o[e-1]),On(o[e])&&c.push(e),"string"==typeof o[e]&&"none"!==o[e]&&"0"!==o[e]&&(a=o[e]);if(r&&c.length&&a)for(let e=0;e<c.length;e++)o[c[e]]=Rn(t,a);return o}(t,e,n,o),l=c[0],d=c[c.length-1],u=_n(e,l),h=_n(e,d);Ae(u===h,`You are trying to animate ${e} from "${l}" to "${d}". ${l} is not an animatable value - to enable this animation set ${l} to a value animatable to ${d} via the \`style\` property.`);let p={keyframes:c,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-a,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{r(),o.onComplete&&o.onComplete()}};if(function({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:o,repeatType:s,repeatDelay:a,from:c,elapsed:l,...d}){return!!Object.keys(d).length}(o)||(p={...p,...En(e,p)}),p.duration&&(p.duration=Re(p.duration)),p.repeatDelay&&(p.repeatDelay=Re(p.repeatDelay)),!u||!h||!1===o.type)return function({keyframes:e,delay:t,onUpdate:n,onComplete:i}){const r=()=>(n&&n(e[e.length-1]),i&&i(),{time:0,speed:1,duration:0,play:pe,pause:pe,stop:pe,then:e=>(e(),Promise.resolve()),cancel:pe,complete:pe});return t?wn({keyframes:[0,1],duration:0,delay:t,onComplete:r}):r()}(p);if(!i.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const n=function(e,t,{onUpdate:n,onComplete:i,...r}){if(!Cn()||!kn.has(t)||r.repeatDelay||"mirror"===r.repeatType||0===r.damping||"inertia"===r.type)return!1;let o,s,a=!1,c=!1;const l=()=>{s=new Promise(e=>{o=e})};l();let{keyframes:d,duration:u=300,ease:h,times:p}=r;if(((e,t)=>"spring"===t.type||"backgroundColor"===e||!De(t.ease))(t,r)){const e=wn({...r,repeat:0,delay:0});let t={done:!1,value:d[0]};const n=[];let i=0;for(;!t.done&&i<2e4;)t=e.sample(i),n.push(t.value),i+=10;p=void 0,d=n,u=i-10,h="linear"}const f=function(e,t,n,{delay:i=0,duration:r,repeat:o=0,repeatType:s="loop",ease:a,times:c}={}){const l={[t]:n};c&&(l.offset=c);const d=Ye(a);return Array.isArray(d)&&(l.easing=d),e.animate(l,{delay:i,duration:r,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:"reverse"===s?"alternate":"normal"})}(e.owner.current,t,d,{...r,duration:u,ease:h,times:p}),m=()=>{c=!1,f.cancel()},v=()=>{c=!0,ve.update(m),o(),l()};return f.onfinish=()=>{c||(e.set(function(e,{repeat:t,repeatType:n="loop"}){return e[t&&"loop"!==n&&t%2==1?0:e.length-1]}(d,r)),i&&i(),v())},{then:(e,t)=>s.then(e,t),attachTimeline:e=>(f.timeline=e,f.onfinish=null,pe),get time(){return Be(f.currentTime||0)},set time(e){f.currentTime=Re(e)},get speed(){return f.playbackRate},set speed(e){f.playbackRate=e},get duration(){return Be(u)},play:()=>{a||(f.play(),ge(m))},pause:()=>f.pause(),stop:()=>{if(a=!0,"idle"===f.playState)return;const{currentTime:t}=f;if(t){const n=wn({...r,autoplay:!1});e.setWithVelocity(n.sample(t-10).value,n.sample(t).value,10)}v()},complete:()=>{c||f.finish()},cancel:v}}(t,e,p);if(n)return n}return wn(p)},$n=e=>!(!e||!e.getVelocity);function Yn(e){return!(!$n(e)||!e.add)}const jn=e=>/^\-?\d*\.?\d+$/.test(e),zn=e=>Array.isArray(e),qn=e=>zn(e)?e[e.length-1]||0:e,Hn=e=>t=>t.test(e),Wn=[ut,_t,Et,At,Pt,Tt,{test:e=>"auto"===e,parse:e=>e}],Gn=e=>Wn.find(Hn(e)),Xn=[...Wn,Rt,zt],Zn=e=>Xn.find(Hn(e));function Jn(e,t,n,i={},r={}){return"function"==typeof t&&(t=t(void 0!==n?n:e.custom,i,r)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==n?n:e.custom,i,r)),t}function Kn(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Se(n))}function Qn(e,t){return t?(t[e]||t.default||t).from:void 0}function ei({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,i}function ti(e,t){const n=e.get();if(!Array.isArray(t))return n!==t;for(let e=0;e<t.length;e++)if(t[e]!==n)return!0}function ni(e,t,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:s,...a}=e.makeTargetAnimatable(t);const c=e.getValue("willChange");i&&(o=i);const l=[],d=r&&e.animationState&&e.animationState.getState()[r];for(const t in a){const i=e.getValue(t),r=a[t];if(!i||void 0===r||d&&ei(d,t))continue;const s={delay:n,elapsed:0,...Dn(o||{},t)};if(window.HandoffAppearAnimations){const n=e.getProps()[Ne];if(n){const e=window.HandoffAppearAnimations(n,t,i,ve);null!==e&&(s.elapsed=e,s.isHandoff=!0)}}let u=!s.isHandoff&&!ti(i,r);if("spring"===s.type&&(i.getVelocity()||s.velocity)&&(u=!1),i.animation&&(u=!1),u)continue;i.start(Un(t,i,r,e.shouldReduceMotion&&Ve.has(t)?{type:!1}:s));const h=i.animation;Yn(c)&&(c.add(t),h.then(()=>c.remove(t))),l.push(h)}return s&&Promise.all(l).then(()=>{s&&function(e,t){const n=function(e,t){const n=e.getProps();return Jn(n,t,n.custom,function(e){const t={};
1return e.values.forEach((e,n)=>t[n]=e.get()),t}(e),function(e){const t={};return e.values.forEach((e,n)=>t[n]=e.getVelocity()),t}(e))}(e,t);let{transitionEnd:i={},transition:r={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...i};for(const t in o)Kn(e,t,qn(o[t]))}(e,s)}),l}const ii={};function ri(e,{layout:t,layoutId:n}){return Ve.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!ii[e]||"opacity"===e)}function oi(e,t){const{style:n}=e,i={};for(const r in n)($n(n[r])||t.style&&$n(t.style[r])||ri(r,e))&&(i[r]=n[r]);return i}const si=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function ai(e,t,n=1){Ee(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[i,r]=function(e){const t=si.exec(e);if(!t)return[,];const[,n,i]=t;return[n,i]}(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const e=o.trim();return jn(e)?parseFloat(e):e}return Gt(r)?ai(r,t,n+1):r}const ci=typeof document<"u",li=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),di=e=>li.has(e),ui=e=>e===ut||e===_t,hi=(e,t)=>parseFloat(e.split(", ")[t]),pi=(e,t)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/);if(r)return hi(r[1],t);{const t=i.match(/^matrix\((.+)\)$/);return t?hi(t[1],e):0}},fi=new Set(["x","y","z"]),mi=Me.filter(e=>!fi.has(e)),vi={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:pi(4,13),y:pi(5,14)};vi.translateX=vi.x,vi.translateY=vi.y;function gi(e,t,n,i){return(e=>Object.keys(e).some(di))(t)?((e,t,n={},i={})=>{t={...t},i={...i};const r=Object.keys(t).filter(di);let o=[],s=!1;const a=[];if(r.forEach(r=>{const c=e.getValue(r);if(!e.hasValue(r))return;let l=n[r],d=Gn(l);const u=t[r];let h;if(zn(u)){const e=u.length,t=null===u[0]?1:0;l=u[t],d=Gn(l);for(let n=t;n<e&&null!==u[n];n++)h?Ee(Gn(u[n])===h,"All keyframes must be of the same type"):(h=Gn(u[n]),Ee(h===d||ui(d)&&ui(h),"Keyframes must be of the same dimension as the current value"))}else h=Gn(u);if(d!==h)if(ui(d)&&ui(h)){const e=c.get();"string"==typeof e&&c.set(parseFloat(e)),"string"==typeof u?t[r]=parseFloat(u):Array.isArray(u)&&h===_t&&(t[r]=u.map(parseFloat))}else d?.transform&&h?.transform&&(0===l||0===u)?0===l?c.set(h.transform(l)):t[r]=d.transform(u):(s||(o=function(e){const t=[];return mi.forEach(n=>{const i=e.getValue(n);void 0!==i&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}(e),s=!0),a.push(r),i[r]=void 0!==i[r]?i[r]:t[r],c.jump(u))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,r=((e,t,n)=>{const i=t.measureViewportBox(),r=t.current,o=getComputedStyle(r),{display:s}=o,a={};"none"===s&&t.setStaticValue("display",e.display||"block"),n.forEach(e=>{a[e]=vi[e](i,o)}),t.render();const c=t.measureViewportBox();return n.forEach(n=>{const i=t.getValue(n);i&&i.jump(a[n]),e[n]=vi[n](c,o)}),e})(t,e,a);return o.length&&o.forEach(([t,n])=>{e.getValue(t).set(n)}),e.render(),ci&&null!==n&&window.scrollTo({top:n}),{target:r,transitionEnd:i}}return{target:t,transitionEnd:i}})(e,t,n,i):{target:t,transitionEnd:i}}const yi={current:null},bi={current:!1};function wi(e){return"string"==typeof e||Array.isArray(e)}const Ci=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function ki(e){return function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}(e.animate)||Ci.some(t=>wi(e[t]))}const xi={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Si={};for(const e in xi)Si[e]={isEnabled:t=>xi[e].some(e=>!!t[e])};const Ai=Object.keys(Si),Ei=Ai.length,_i=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ti=Ci.length;class Pi{constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>ve.render(this.render,!1,!0);const{latestValues:s,renderState:a}=r;var c;this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=a,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.isControllingVariants=ki(t),this.isVariantNode=!(!ki(c=t)&&!c.variants),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:l,...d}=this.scrapeMotionValuesFromProps(t,{});for(const e in d){const t=d[e];void 0!==s[e]&&$n(t)&&(t.set(s[e],!1),Yn(l)&&l.add(e))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,Te.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
1h((e,t)=>this.bindToMotionValue(t,e)),bi.current||function(){if(bi.current=!0,ci)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yi.current=e.matches;e.addListener(t),t()}else yi.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||yi.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Te.delete(this.current),this.projection&&this.projection.unmount(),ge(this.notifyUpdate),ge(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const n=Ve.has(e),i=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&ve.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),r=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),r()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},n,i,r){let o,s;for(let e=0;e<Ei;e++){const n=Ai[e],{isEnabled:i,Feature:r,ProjectionNode:a,MeasureLayout:c}=Si[n];a&&(o=a),i(t)&&(!this.features[n]&&r&&(this.features[n]=new r(this)),c&&(s=c))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:i,dragConstraints:s,layoutScroll:c,layoutRoot:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:!!i||s&&(a=s,a&&"object"==typeof a&&Object.prototype.hasOwnProperty.call(a,"current")),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:l})}var a;return s}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<_i.length;t++){const n=_i[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=e["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(e,t,n){const{willChange:i}=t;for(const r in t){const o=t[r],s=n[r];if($n(o))e.addValue(r,o),Yn(i)&&i.add(r);else if($n(s))e.addValue(r,Se(o,{owner:e})),Yn(i)&&i.remove(r);else if(s!==o)if(e.hasValue(r)){const t=e.getValue(r);!t.hasAnimated&&t.set(o)}else{const t=e.getStaticValue(r);e.addValue(r,Se(void 0!==t?t:o,{owner:e}))}}for(const i in n)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}const t={};for(let e=0;e<Ti;e++){const n=Ci[e],i=this.props[n];(wi(i)||!1===i)&&(t[n]=i)}return t}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Se(t,{owner:this}),this.addValue(e,n)),n}readValue(e){var t;return void 0===this.latestValues[e]&&this.current?null!==(t=this.getBaseTargetFromProps(this.props,e))&&void 0!==t?t:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props,i="string"==typeof n||"object"==typeof n?null===(t=Jn(this.props,n))||void 0===t?void 0:t[e]:void 0;if(n&&void 0!==i)return i;const r=this.getBaseTargetFromProps(this.props,e);return void 0===r||$n(r)?void 0!==this.initialValues[e]&&void 0===i?void 0:this.baseTarget[e]:r}on(e,t){return this.events[e]||(this.events[e]=new ue),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Ii extends Pi{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...n},i){const r=function(e,t,n){const i={};for(const r in e){const e=Qn(r,t);if(void 0!==e)i[r]=e;else{const e=n.getValue(r);e&&(i[r]=e.get())}}return i}(n,e||{},this);if(i){!function(e,t,n){var i,r;const o=Object.keys(t).filter(t=>!e.hasValue(t)),s=o.length;if(s)for(let a=0;a<s;a++){const s=o[a],c=t[s];let l=null;Array.isArray(c)&&(l=c[0]),null===l&&(l=null!==(r=null!==(i=n[s])&&void 0!==i?i:e.readValue(s))&&void 0!==r?r:t[s]),null!=l&&("string"==typeof l&&(jn(l)||Bn(l))?l=parseFloat(l):!Zn(l)&&zt.test(c)&&(l=Rn(s,c)),e.addValue(s,Se(l,{owner:e})),void 0===n[s]&&(n[s]=l),null!==l&&e.setBaseTarget(s,l))}}(this,n,r);const e=((e,t,n,i)=>{const r=function(e,{...t},n){const i=e.current;if(!(i instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}
1),e.values.forEach(e=>{const t=e.get();if(!Gt(t))return;const n=ai(t,i);n&&e.set(n)});for(const e in t){const r=t[e];if(!Gt(r))continue;const o=ai(r,i);o&&(t[e]=o,n||(n={}),void 0===n[e]&&(n[e]=r))}return{target:t,transitionEnd:n}}(e,t,i);return gi(e,t=r.target,n,i=r.transitionEnd)})(this,n,r,t);t=e.transitionEnd,n=e.target}return{transition:e,transitionEnd:t,...n}}}const Li={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Mi=Me.length,Vi=(e,t)=>t&&"number"==typeof e?t.transform(e):e;function Fi(e,t,n,i){const{style:r,vars:o,transform:s,transformOrigin:a}=e;let c=!1,l=!1,d=!0;for(const e in t){const n=t[e];if(Ht(e)){o[e]=n;continue}const i=Vn[e],u=Vi(n,i);if(Ve.has(e)){if(c=!0,s[e]=u,!d)continue;n!==(i.default||0)&&(d=!1)}else e.startsWith("origin")?(l=!0,a[e]=u):r[e]=u}if(t.transform||(c||i?r.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},i,r){let o="";for(let t=0;t<Mi;t++){const n=Me[t];void 0!==e[n]&&(o+=`${Li[n]||n}(${e[n]}) `)}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),r?o=r(e,i?"":o):n&&i&&(o="none"),o}(e.transform,n,d,i):r.transform&&(r.transform="none")),l){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Ni(e,t,n){return"string"==typeof e?e:_t.transform(t+n*e)}const Ri={offset:"stroke-dashoffset",array:"stroke-dasharray"},Bi={offset:"strokeDashoffset",array:"strokeDasharray"};const Oi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Di(e,{style:t,vars:n},i,r){Object.assign(e.style,t,r&&r.getProjectionStyles(i));for(const t in n)e.style.setProperty(t,n[t])}class Ui extends Ii{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Ve.has(t)){const e=Nn(t);return e&&e.default||0}return t=Oi.has(t)?t:Fe(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t){return function(e,t){const n=oi(e,t);for(const i in e)($n(e[i])||$n(t[i]))&&(n[-1!==Me.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=e[i]);return n}(e,t)}build(e,t,n,i){!function(e,{attrX:t,attrY:n,attrScale:i,originX:r,originY:o,pathLength:s,pathSpacing:a=1,pathOffset:c=0,...l},d,u,h){if(Fi(e,l,d,h),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:p,style:f,dimensions:m}=e;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==r||void 0!==o||f.transform)&&(f.transformOrigin=function(e,t,n){return`${Ni(t,e.x,e.width)} ${Ni(n,e.y,e.height)}`}(m,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==t&&(p.x=t),void 0!==n&&(p.y=n),void 0!==i&&(p.scale=i),void 0!==s&&function(e,t,n=1,i=0,r=!0){e.pathLength=1;const o=r?Ri:Bi;e[o.offset]=_t.transform(-i);const s=_t.transform(t),a=_t.transform(n);e[o.array]=`${s} ${a}`}(p,s,a,c,!1)}(e,t,n,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,n,i){!function(e,t,n,i){Di(e,t,void 0,i);for(const n in t.attrs)e.setAttribute(Oi.has(n)?n:Fe(n),t.attrs[n])}(e,t,0,i)}mount(e){var t;this.isSVGTag="string"==typeof(t=e.tagName)&&"svg"===t.toLowerCase(),super.mount(e)}}class $i extends Ii{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(Ve.has(t)){const e=Nn(t);return e&&e.default||0}{const i=(n=e,window.getComputedStyle(n)),r=(Ht(t)?i.getPropertyValue(t):i[t])||0;return"string"==typeof r?r.trim():r}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return function(e,t){return function({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(e.getBoundingClientRect(),t))}(e,t)}build(e,t,n,i){Fi(e,t,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,t){return oi(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;$n(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}renderInstance(e,t,n,i){Di(e,t,n,i)}}function Yi(e){const t={presenceContext:null,props:{}
1,visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(e){return e instanceof SVGElement&&"svg"!==e.tagName}(e)?new Ui(t,{enableHardwareAcceleration:!1}):new $i(t,{enableHardwareAcceleration:!0});n.mount(e),Te.set(e,n)}function ji(e,t,n){const i=$n(e)?e:Se(e);return i.start(Un("",i,t,n)),i.animation}function zi(e,t=100){const n=pn({keyframes:[0,t],...e}),i=Math.min(gn(n),vn);return{type:"keyframes",ease:e=>n.next(i*e).value/t,duration:Be(i)}}function qi(e,t,n,i){var r;return"number"==typeof t?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):"<"===t?n:null!==(r=i.get(t))&&void 0!==r?r:e}function Hi(e,t){return Ge(e)?e[((e,t,n)=>{const i=t-0;return((n-0)%i+i)%i+0})(0,e.length,t)]:e}function Wi(e,t,n,i,r,o){!function(e,t,n){for(let i=0;i<e.length;i++){const r=e[i];r.at>t&&r.at<n&&(de(e,r),i--)}}(e,r,o);for(let s=0;s<t.length;s++)e.push({value:t[s],at:lt(r,o,i[s]),easing:Hi(n,s)})}function Gi(e,t){return e.at===t.at?null===e.value?1:null===t.value?-1:0:e.at-t.at}function Xi(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Zi(e,t){return t[e]||(t[e]=[]),t[e]}function Ji(e){return Array.isArray(e)?e:[e]}function Ki(e,t){return e[t]?{...e,...e[t]}:{...e}}const Qi=e=>"number"==typeof e,er=e=>e.every(Qi);function tr(e,t,n,i){const r=_e(e),o=r.length;Ee(!!o,"No valid element provided.");const s=[];for(let e=0;e<o;e++){const i=r[e];Te.has(i)||Yi(i);const a=Te.get(i),c={...n};"function"==typeof c.delay&&(c.delay=c.delay(e,o)),s.push(...ni(a,{...t,transition:c},{}))}return new Le(s)}const nr=function(e,t,n){let i;return r=e,i=Array.isArray(r)&&Array.isArray(r[0])?function(e,t){const n=[];return function(e,{defaultTransition:t={},...n}={}){const i=t.duration||.3,r=new Map,o=new Map,s={},a=new Map;let c=0,l=0,d=0;for(let n=0;n<e.length;n++){const r=e[n];if("string"==typeof r){a.set(r,l);continue}if(!Array.isArray(r)){a.set(r.name,qi(l,r.at,c,a));continue}let[u,h,p={}]=r;void 0!==p.at&&(l=qi(l,p.at,c,a));let f=0;const m=(e,n,r,o=0,s=0)=>{const a=Ji(e),{delay:c=0,times:u=on(a),type:h="keyframes",...p}=n;let{ease:m=t.ease||"easeOut",duration:v}=n;const g="function"==typeof c?c(o,s):c,y=a.length;if(y<=2&&"spring"===h){let e=100;if(2===y&&er(a)){const t=a[1]-a[0];e=Math.abs(t)}const t={...p};void 0!==v&&(t.duration=Re(v));const n=zi(t,e);m=n.ease,v=n.duration}v??(v=i);const b=l+g,w=b+v;1===u.length&&0===u[0]&&(u[1]=1);const C=u.length-a.length;C>0&&rn(u,C),1===a.length&&a.unshift(null),Wi(r,a,m,u,b,w),f=Math.max(g+v,f),d=Math.max(w,d)};if($n(u))m(h,p,Zi("default",Xi(u,o)));else{const e=_e(u,0,s),t=e.length;for(let n=0;n<t;n++){const i=Xi(e[n],o);for(const e in h)m(h[e],Ki(p,e),Zi(e,i),n,t)}}c=l,l+=f}return o.forEach((e,i)=>{for(const o in e){const s=e[o];s.sort(Gi);const a=[],c=[],l=[];for(let e=0;e<s.length;e++){const{at:t,value:n,easing:i}=s[e];a.push(n),c.push(ct(0,d,t)),l.push(i||"easeOut")}0!==c[0]&&(c.unshift(0),a.unshift(a[0]),l.unshift("easeInOut")),1!==c[c.length-1]&&(c.push(1),a.push(null)),r.has(i)||r.set(i,{keyframes:{},transition:{}});const u=r.get(i);u.keyframes[o]=a,u.transition[o]={...t,duration:d,ease:l,times:c,...n}}}),r}(e,t).forEach(({keyframes:e,transition:t},i)=>{let r;r=$n(i)?ji(i,e.default,t.default):tr(i,e,t),n.push(r)}),new Le(n)}(e,t):function(e){return"object"==typeof e&&!Array.isArray(e)}(t)?tr(e,t,n):ji(e,t,n),i;var r},ir=(e,t=!1)=>{const n=Math.max(-1,Math.min(1,e));return t?`translate3d(0, calc(${n} * var(--screen-height, 100dvh)), 0)`:`translate3d(0,0, calc(-1 * var(--screen-width, 100vw))) rotateY(${53*n}deg)`},rr=(e,t=!1)=>{const n=Math.max(-2,Math.min(2,e));if(t)return`translate3d(0, calc(${n} * var(--screen-height, ${!t||1!==n&&-1!==n&&2!==n&&-2!==n?100:93}dvh)), 0)`;const i=Math.abs(n);return`translate3d(calc(${n} * var(--screen-width, 100vw)), 0,0) scale(${i**1.5-i+1})`},or=async(e,t,n,r)=>{const{isMobile:o,isVertical:s}=r||{};await nr(e,{transform:[o?ir(t,s):rr(t,s),o?ir(n,s):rr(n,s)]},{duration:200*Math.abs(n-t)/1e3,ease:"easeOut"}),await(0,i.c)(),e.style.transform=""},sr=(e,t)=>{e.style.transform="",e.style.opacity="",e.style.transformOrigin="",t&&(t.style.opacity="")},ar=e=>{const t=e?.parentNode?.querySelector(".feed-background-overlay"),n=e?.querySelector(".video-content-container[data-content-state='active']"),i=e?.querySelector(".video-content-container[data-content-state='previous']"),r=e?.querySelector(".video-content-container[data-content-state='next']"),o=e?.querySelector(".video-content-container[data-content-state='next-2']");
1return{feedPlayer:e,feedBackgroundPlayer:t,playerContainer:n,prevPlayerContainer:i,nextPlayerContainer:r,next2PlayerContainer:o}},cr=e=>{const t=e?.closest(".feed-container");return t?ar(t):{feedPlayer:t,feedBackgroundPlayer:void 0,playerContainer:void 0,prevPlayerContainer:void 0,nextPlayerContainer:void 0,next2PlayerContainer:void 0}},lr=(e=>{let t=null;return n=>{t||e(()=>{const e=t;t=null,e?.()}),t=n}})(i.e),dr=(e,t,n,i,r,o,s,a)=>{const c=((e,{canGoNext:t,canGoRight:n})=>{const i=-e/window.innerWidth,r=i<0;return r&&!t||!r&&!n?.3*i:i})(e,{canGoNext:!!r,canGoRight:!!i});((e,t,n,i,r)=>{((e,t,n,i,r,o)=>{if(i){const s=e<0,a=e=>t?ir(e,n):rr(e,n);i.style.transform=a(e),s?(r&&(r.style.transform=a(1+e)),o&&(o.style.transform=a(-1))):(r&&(r.style.transform=a(1)),o&&(o.style.transform=a(-1+e)))}})(e,t,!1,n,i,r)})(c,t,n,r,i);const l=.25*window.innerWidth,d=e-o.current;o.current=e,s.current=c,null!==a.current&&(a.current.onTouchEndAction=e>l||d>.1*l?"swipe-next":e<-l||d<.1*-l?"swipe-previous":"none")},ur=({onSwipeStart:e,initialTouchRef:t,canSwipePrevAndNext:n,closable:i,playerContainer:r,prevPlayerContainer:o,nextPlayerContainer:s,isMobile:a,isVertical:c,lastVerticalDeltaRef:l,lastSwipeProgressionRef:d,swipeDownHandler:u,blockVerticalSwipeRef:h})=>p=>{lr(()=>{const f=p.touches[0];if(t.current.ended)return;const m=t.current.x-f.clientX,v=t.current.y-f.clientY;if("none"===t.current.swipeAxe)((e,t,n,i,r,o,s,a,c)=>{if(n.current)if(Math.abs(e)>10&&Math.abs(e)>Math.abs(t)){if(!i||c)return;n.current.swipeAxe="horizontal",o()}else if(Math.abs(t)>10){if(!r&&!c)return;n.current.swipeAxe="vertical",o(),a?.onTouchStart?.(s)}})(m,v,t,n,i,e,p,u,c);else switch(t.current.swipeAxe){case"horizontal":if(!n||c)return;dr(m,a,r,o,s,l,d,t);break;case"vertical":if(c&&!h.current&&n)((e,t,n,i,r,o,s,a,c)=>{if(!n)return;const l=((e,{canGoNext:t,canGoPrev:n})=>{const i=-e/window.innerHeight,r=i<0;return!n&&i>0?.1*i:r&&!t||!r&&!n?.3*i:i})(e,{canGoNext:!!o,canGoPrev:!!r});((e,t,n,i,r)=>
1{const o=t?"100dvh":"var(--desktop-vertical-content-player-height, 93dvh)";n&&(n.style.transform=`translate3d(0, calc(${e} * var(--screen-height, ${o})), 0)`),i&&(i.style.transform=`translate3d(0, calc(${1+e} * var(--screen-height, ${o})), 0)`),r&&(r.style.transform=`translate3d(0, calc(${-1+e} * var(--screen-height, ${o})), 0)`)})(l,t,i,o,r);const d=.1*window.innerHeight,u=e-s.current;s.current=e,a.current=l,null!==c.current&&(c.current.onTouchEndAction=e>d||u>.1*d?"swipe-next":e<-d||u<.1*-d?"swipe-previous":"none")})(v,a,c,r,o,s,l,d,t);else{if(!i)return;u?.onTouchMove?.(p)}}})},hr=e=>g(e)||y(e);class pr{constructor(e,t,n){this._onMoveStart=e,this._onMoveUpdate=t,this._onMoveEnd=n,this._startTouchY=0,this._touchY=0,this._touchIsOut=!1,this._lastTouches=[],this._goingDown=!0,this._swipeStarted=!1,this._startTime=new Date,this.startTouch=this.startTouch.bind(this),this.moveTouch=this.moveTouch.bind(this),this.endTouch=this.endTouch.bind(this)}_lastTouches;_startTouchY;_touchIsOut;_touchY;_goingDown;_swipeStarted;_startTime;setTrajectory(e){if(this._lastTouches=[...this._lastTouches.splice(-2),e],3===this._lastTouches.length){const e=this._lastTouches.reduce((e,t,n)=>this._lastTouches[n+1]?e&&t.screenY<=this._lastTouches[n+1].screenY:e,!0),t=this._lastTouches.reduce((e,t,n)=>this._lastTouches[n+1]?e&&t.screenY>=this._lastTouches[n+1].screenY:e,!0);e?this._goingDown=!0:t&&(this._goingDown=!1)}}isTouchLegit(e){return this._goingDown?e.screenY>this._touchY:e.screenY<this._touchY}startTouch(e){this._touchIsOut=!1,this._swipeStarted=!1,this._goingDown=!0,this._lastTouches=[],this._startTouchY=e.touches[0].screenY,this._touchY=e.touches[0].screenY,this._startTime=new Date}moveTouch(e){if(!this._touchIsOut){const t=e.touches[0],n=this._lastTouches[this._lastTouches.length-1]||{screenY:0};if(Math.abs(t.screenY-n.screenY)<1)return;this.setTrajectory(t),this._swipeStarted?this.isTouchLegit(t)&&(this._touchY=t.screenY,this._onMoveUpdate(Math.max(0,t.screenY-this._startTouchY))):t.screenY-this._startTouchY>20&&(this._onMoveStart(Math.max(0,t.screenY-this._startTouchY)),this._swipeStarted=!0,this._touchY=t.screenY)}}endTouch(){if(this._swipeStarted&&!this._touchIsOut){const e=(new Date).getTime()-this._startTime.getTime()<300?45:150,t=this._touchY-this._startTouchY>e;this._onMoveEnd(t)}}}const fr=e=>e**.85,mr=e=>Math.min(1,1-e/(1e3+e)),vr=e=>Math.min(1,1-e/500),gr=({isActive:e,touchContainerRef:t,isMobile:n,videoRef:r,onLongTouchStart:o,onLongTouchEnd:s,onLongClickStart:a,onLongClickEnd:c,onSwipeEnd:l,closable:d,canSwipePrevAndNext:u,touchLeftScreenPercentage:h=.3,onShortClick:p,isVertical:f,contentContainerRef:m})=>{const v=(0,i._)(!1),g=(0,i._)("none"),y=(0,i._)(!1),b=((e,t)=>{const n=(0,i._)(),r=(0,i._)(),o=(0,i._)();(0,i.p)(()=>{n.current=new pr(s,a,c)},[]),(0,i.p)(()=>{if(e){const{feedPlayer:t,feedBackgroundPlayer:n}=cr(e);r.current=t,o.current=n}},[e]);const s=e=>{if(!r.current)return;const t=fr(e);r.current.style.transform=`translate3d(0, ${Math.round(t)}px, 0) scale(${mr(t)})`,o.current&&(o.current.style.opacity=`${vr(t)}`,o.current.classList.add("swipe-down"))},a=e=>{if(!r.current)return;const t=fr(e);r.current.style.transform=`translate3d(0, ${Math.round(t)}px, 0) scale(${mr(t)})`,o.current&&(o.current.style.opacity=`${vr(t)}`)},c=async e=>{if(!r.current)return;const n=r.current.style.transform,s=Number(n.match(/translate3d\(0,\s*(.*?)px,\s*0\)/)?.[1]||0),a=Number(n.match(/scale\((.*)\)/)?.[1]||1),c=Number(o.current?.style.opacity||1);e?await t({feedTranslateY:s,feedScale:a,backgroundOpacity:c}):o.current&&await(async(e,t,n)=>{const{translateY:r=0,scale:o=1,backgroundOpacity:s=1}=n,a=nr(e,{transform:[`translate3d(0,${r},0) scale(${o})`,"translate3d(0,0,0) scale(1)"]},{duration:.25}),c=nr(t,{opacity:[s,1]},{duration:.25});await Promise.all([a,c]),await(0,i.c)(),e.style.transform="",t.style.opacity=""})(r.current,o.current,{translateY:s,scale:a})};return{onTouchStart:n.current?.startTouch,onTouchMove:n.current?.moveTouch,onTouchEnd:n.current?.endTouch}})(r.current,async e=>{await l("swipe-down",e)}),w=(0,i._)(null),C=(0,i._)({x:0,y:0}),k="ontouchstart"in window||navigator.maxTouchPoints>0,x=e=>r.current&&b?((e,{onLongTouchStart:t,onLongTouchEnd:n,longTouchTimeout:r,canSwipePrevAndNext:o,closable:s,isMobile:a,swipeDownHandler:c,onSwipeEnd:l,touchContainer:d,isVertical:u=!1,onShortTouch:h})=>(p,f)=>{if(p.touches.length>1)return;const m=p.touches[0],v={current:!1},g={current:!1},y={current:{x:m.clientX,y:m.clientY,swipeAxe:"none",onTouchEndAction:"none",ended:!1}},b={current:0},w={current:0},{playerContainer:C,prevPlayerContainer:k,nextPlayerContainer:x}=cr(e),S=e=>{g.current=!0,u&&"timeout"===e&&(v.current=!0);const n=(0,i.f)(p,d);t(p,n,e)},A=setTimeout(()=>{hr(p)||S("timeout")},r),E=()=>{clearTimeout(A),S("swipe")},_=e=>{ur({onSwipeStart:E,initialTouchRef:y,canSwipePrevAndNext:o,closable:s,playerContainer:C,prevPlayerContainer:k,nextPlayerContainer:x,isMobile:a,isVertical:u,lastVerticalDeltaRef:b,lastSwipeProgressionRef:w,swipeDownHandler:c,blockVerticalSwipeRef:v})(e)},T=e=>{(({onSwipeAnimationStart:e,initialTouchRef:t,lastSwipeProgressionRef:n,onHorizontalSwipeEnd:r,onVerticalSwipeEnd:o,playerContainer:s,prevPlayerContainer:a,nextPlayerContainer:c,onSwipeAnimationEnd:l,swipeDownHandler:d,isVertical:u=!1,isMobile:h=!1,verticalSwipeBlockerRef:p})=>async f=>{f.touches.length>0||!t.current||t.current.ended?f.preventDefault():(t.current.ended=!0,e(),(0,i.e)(async()=>{"horizontal"===t.current.swipeAxe&&t.current.onTouchEndAction&&await r(t.current.onTouchEndAction,{currentProgression:n.current}),u&&"vertical"===t.current.swipeAxe&&o&&t.current.onTouchEndAction&&"none"!==t.current.onTouchEndAction?await o(t.current.onTouchEndAction,{currentProgression:n.current}):u&&"vertical"===t.current.swipeAxe&&"none"===t.current.onTouchEndAction&&!p.current?await(async(e,t,n,i,r)=>{await Promise.all([e&&or(e,i,0,r),t&&or(t,i-1,-1,r),n&&or(n,i+1,1,r)])})(s,a,c,n.current,{isMobile:h,isVertical:u}):"vertical"===t.current.swipeAxe&&await(d?.onTouchEnd?.()),a&&(a.style.transform=""),c&&(c.style.transform=""),s&&(s.style.transform=""),l()}))})({onSwipeAnimationStart:()=>{clearTimeout(A),document.removeEventListener("touchmove",_),document.removeEventListener("touchend",T)},initialTouchRef:y,lastSwipeProgressionRef:w,playerContainer:C,prevPlayerContainer:k,nextPlayerContainer:x,swipeDownHandler:c,verticalSwipeBlockerRef:v,onHorizontalSwipeEnd:l,onVerticalSwipeEnd:l,onSwipeAnimationEnd:()=>
1{if(g.current)g.current=!1,n(e);else if(!hr(e)){const t=y.current.x-e.changedTouches[0].clientX,n=y.current.y-e.changedTouches[0].clientY;if(Math.sqrt(t*t+n*n)<10){const t=(0,i.f)(e,d);h?.(e,t)}}f()},isVertical:u,isMobile:a})(e)};document.addEventListener("touchend",T,{passive:!1}),document.addEventListener("touchmove",_,{passive:!1})})(r.current,{onLongTouchStart:o,onLongTouchEnd:s,longTouchTimeout:200,canSwipePrevAndNext:u,closable:d,isMobile:n,swipeDownHandler:f?void 0:b,onSwipeEnd:l,touchContainer:e,isVertical:f,touchLeftScreenPercentage:h,onShortTouch:p?(e,t)=>p(e,t):void 0}):()=>{},S=()=>{w.current&&(clearTimeout(w.current),w.current=null)};(0,i.p)(()=>{if(!e||!r.current||!b)return;const n=t.current;if(!n)return;const o=(e=>t=>{m.current?.querySelector('[data-focused="true"]')||v.current||"click"===g.current||(g.current="touch",v.current=!0,e(t,()=>{v.current=!1}),setTimeout(()=>{g.current="none"},500))})(x(n)),s=(e=>t=>{t.preventDefault(),!(k||v.current||"touch"===g.current||(g.current="click",v.current=!0,m.current?.querySelector('[data-focused="true"]')))&&(g.current="click",C.current.x=t.clientX,C.current.y=t.clientY,w.current=setTimeout(()=>{y.current=!0,a?.(t,(0,i.f)(t,e))},200))})(n),l=(e=>t=>{if(y.current)c?.(t);else{const n=C.current.x-t.clientX,r=C.current.y-t.clientY;if(p&&Math.sqrt(n*n+r*r)<10){const n=(0,i.f)(t,e);p(t,n)}}y.current=!1,v.current=!1,S()})(n),d=e=>{y.current&&c?.(e),y.current=!1,v.current=!1,S()},u=f?n.closest(".feed-container"):n;if(!u)return;let h=!1;return(0,i.e)(()=>{h||(u.addEventListener("touchstart",o,{passive:!1}),k||(n.addEventListener("mousedown",s,{passive:!1}),n.addEventListener("mouseup",l,{passive:!1}),n.addEventListener("mouseleave",d,{passive:!1})))}),()=>{h=!0,S(),u.removeEventListener("touchstart",o),k||(n.removeEventListener("mouseup",l),n.removeEventListener("mousedown",s),n.removeEventListener("mouseleave",d))}},[e,o,s,u,d,n,b,l,p,k])},yr=({isActive:e,isMobile:t,videoRef:n,onLongTouchStart:r,onLongTouchEnd:o,onLongClickStart:s,onLongClickEnd:a,onShortClick:c,onSwipeEnd:l,closable:d,canSwipePrevAndNext:u,isVertical:h,contentContainerRef:p})=>{const f=(0,i._)(null),{onNextButtonClick:m,onPreviousButtonClick:v}=re(n);return gr({isActive:e,touchContainerRef:f,isMobile:t,videoRef:n,onLongTouchStart:r,onLongTouchEnd:o,onLongClickStart:s,onLongClickEnd:a,onShortClick:(e,t)=>{if(h)c(e,t);else{const{right:n}=t;n<.7?m?.(e):v?.(e)}},onSwipeEnd:l,onNextButtonClick:h?void 0:m,onPreviousButtonClick:h?void 0:v,closable:d,canSwipePrevAndNext:u,touchLeftScreenPercentage:h?.7:void 0,isVertical:h,contentContainerRef:p}),(0,i.o)(i.I,{css:".touch-controls-panel{position:absolute;top:0;left:0;height:100%;width:100%;pointer-events:all!important;z-index:10;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}",children:(0,i.o)("div",{className:"touch-controls-panel",ref:f,onContextMenu:e=>{e.preventDefault()}})})},br=(0,i.x)(({initialMuted:e,contentContainerRef:t,videoRef:n,closable:r,canSwipePrevAndNext:o,isMobile:s,storyConfig:a,showFeedStoryCoverAndTitle:c=!0,feedEventsController:l,isActive:d,isActiveRef:u,setIsActive:h,feedPaused:p,feedPausedRef:f,localPausedRef:m,onFeedIsPaused:v,isVertical:g,showControls:y=!0,showWatermark:w=!0,enableTitleFocus:k=!0})=>{const x=(0,i.q)(b),[S,A]=(0,i.h)(e),{onLongTouchStart:E,onLongTouchEnd:_,onLongClickStart:T,onLongClickEnd:P,onSwipeEnd:I,onShortClick:L,onPlayToggle:M}=((e,{contentContainerRef:t,feedPausedRef:n,videoRef:r,localPausedRef:o,isActiveRef:s,feedEventsController:a})=>{const c=(0,i._)(null),l=(0,i.q)(b),d=e=>{const n=t.current?.querySelector(".interaction-layer");n&&(e?n.classList.add("hide"):n.classList.remove("hide"))},u=async()=>{await a.setContentIsPaused(!n.current),n.current?l?.sendStoryPauseEvent():l?.sendStoryUnpauseEvent()},h=(e,t)=>(window?.requestIdleCallback?window?.requestIdleCallback(()=>{l?.sendStorySwipeEvent(e)},{timeout:200}):setTimeout(()=>{l?.sendStorySwipeEvent(e)},200),a.onSwipeEnd(e,t));return{onLongTouchStart:e?(e,t,i)=>{const{right:o,top:s}=t;"timeout"===i&&o<.3&&s<.8&&!n.current&&(r.current?.videoController?.setPlaybackRate(2),d(!0))}:()=>{o.current=!0,r.current?.videoController?.pause(),t.current?.classList.add("hide-ui"),c.current=Date.now()},onLongTouchEnd:e?()=>{r.current?.videoController?.setPlaybackRate(1),d(!1)}:()=>{o.current=!1,t.current?.classList.remove("hide-ui"),!n.current&&s.current&&(r.current?.videoController?.play(),l?.sendStoryPauseMobileEvent(c.current))},onShortClick:e?()=>{u()}:()=>{},onLongClickStart:e?(e,t)=>{const{right:i,top:o}=t;i<.3&&o<.8&&!n.current&&(r.current?.videoController?.setPlaybackRate(2),d(!0))}:()=>{},onLongClickEnd:e?()=>{r.current?.videoController?.setPlaybackRate(1),d(!1)}:()=>{},onSwipeEnd:e?(e,t)=>("swipe-down"===e&&(s.current=!1),h(e,t)):(e,t)=>h(e,t),onPlayToggle:u,hideInteractionVisibility:d}})(g,{contentContainerRef:t,feedPausedRef:f,videoRef:n,localPausedRef:m,isActiveRef:u,feedEventsController:l});(0,i.p)(()=>{const e=l.subscribe("is-muted",A);return()=>{e()}},[]),((e,t,n,r=[])=>{const o=(0,i._)(null);(0,i.p)(()=>{const i=e.subscribe(t,(...e)=>{o.current&&o?.current(),o.current=n(...e)||null});return()=>{i(),o.current&&o?.current()}},[t,n,e,...r])})(l,"active-story-changed",e=>{const t=e===a._id;u.current=t,h(t)},[a._id]),(0,i.p)(()=>(d?f.current||n.current?.videoController?.play():(n.current?.videoController?.pause(),n.current?.videoController?.restartCurrentChapter()),l.subscribe("is-feed-paused",v)),[d]),(({isActive:e,videoRef:t,feedEventsController:n,onPlayToggle:r,onEscape:o,setPaused:s,contentContainerRef:a,isVertical:c})=>{const{onNextButtonClick:l,onPreviousButtonClick:d}=re(t),u=(0,i._)(-1),h=ie(n),p=(0,i._)(!1);(0,i.p)(()=>
1{if(!e||h)return void(u.current=-1);const t=async e=>{if(!(e=>{if(!e.key&&!(e=>e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)(e))return!0;const t=e.composedPath()[0]||{};return!!t.isContentEditable||oe.includes(t.nodeName)})(e)&&!p.current)switch(p.current=!0,e.key){case!c&&"ArrowLeft":e.preventDefault(),d(e);break;case!c&&"ArrowRight":e.preventDefault(),l(e);break;case c&&"ArrowUp":e.preventDefault(),n.onPreviousStory();break;case c&&"ArrowDown":e.preventDefault(),n.onNextStory();break;case"Escape":e.preventDefault(),await o();break;case"Tab":{e.stopPropagation(),e.preventDefault();const t=Array.from(a.current?.querySelectorAll("button, a, input, textarea")||[]).filter(e=>{const t=e.getBoundingClientRect();return t.width>0&&t.height>0&&t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth});if(!t||0===t.length)return;const n=((e,t,n)=>n?t>0?t-1:e-1:t<e-1?t+1:0)(t.length,u.current,e.shiftKey);u.current=n,t[n].focus({preventScroll:!0});break}case" ":case"Spacebar":e.preventDefault(),await r()}},i=()=>{p.current=!1};return navigator.mediaSession.setActionHandler("play",()=>{s(!1),navigator.mediaSession.playbackState="playing"}),navigator.mediaSession.setActionHandler("pause",()=>{s(!0),navigator.mediaSession.playbackState="paused"}),document.addEventListener("keydown",t,{capture:!0}),document.addEventListener("keyup",i,{capture:!0}),()=>{navigator.mediaSession.setActionHandler("play",null),navigator.mediaSession.setActionHandler("pause",null),document.removeEventListener("keydown",t,{capture:!0}),document.removeEventListener("keyup",i,{capture:!0})}},[h,e,r,n,l,d])})({isActive:d,videoRef:n,feedEventsController:l,onEscape:async()=>{x?.sendStoryCloseShortcutEvent(),await l.onClose()},onPlayToggle:M,setPaused:async e=>{e?x?.sendStoryPauseEvent():x?.sendStoryUnpauseEvent(),await l.setContentIsPaused(e)},contentContainerRef:t,isVertical:g});const V=a.hasSound;return(0,i.o)(i.I,{css:".close-button{width:4.2em;height:4.2em;pointer-events:all;cursor:pointer;background:transparent;transition:none;padding:0;z-index:50;border-radius:50%;line-height:0}.desktop .close-button{width:max(min(3.3em,50px),20px);height:max(min(3.3em,50px),20px)}.close-button svg{width:1.6em;height:1.6em}.desktop .close-button svg{width:max(min(1.28em,20px),8px);height:max(min(1.28em,20px),8px)}.controls-centered{position:absolute;width:100%;height:100%;display:flex;justify-content:center;align-items:center}",children:[(0,i.o)(yr,{isActive:d,isMobile:s,videoRef:n,onLongTouchStart:E,onLongTouchEnd:_,onLongClickStart:T,onLongClickEnd:P,onSwipeEnd:I,onShortClick:L,closable:r,canSwipePrevAndNext:o,isVertical:g,contentContainerRef:t}),(0,i.o)(Y,{storyConfig:a,isActive:d,hasSound:V,onMute:()=>{l.setMuted(!S),x?.sendStoryEvent(S?"story-unmute":"story-mute",{})},feedPaused:p,isMobile:s,onPlayToggle:M,isMuted:S,isVertical:g,showFeedStoryCoverAndTitle:c,closable:r,onClose:()=>{x?.sendStoryCloseEvent(),l.onClose()},showControls:y,showWatermark:w,enableTitleFocus:k}),p&&g&&u.current?(0,i.o)("div",{className:"controls-centered",children:(0,i.o)(C,{size:125,opacity:1,withShadow:!0})}):null,(0,i.o)(ne,{videoRef:n,isVertical:g,isMobile:s,contentContainerRef:t})]})}),wr=".hidden{display:none}.navigation-button.disabled{cursor:default;opacity:.43}.navigation-button{width:48px;height:48px;z-index:1;background:none;cursor:pointer;pointer-events:all;display:flex;align-items:center;justify-content:center;padding:.4em}",Cr="Go to next chapter",kr="Go to previous story",xr="Go to next story",Sr=({color:e="#141414"})=>(0,i.o)("svg",{width:"30px",height:"30px",viewBox:"0 0 26 27",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.o)("path",{d:"M16.0234 21.1484L7.5651 13.5651L16.0234 5.98177",stroke:e,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ar=({className:e="",onClick:t,disabled:n,ariaLabel:r,children:o})=>(0,i.o)("button",{className:`ui navigation-button ${e} ${n?"disabled":""}`,onClick:n?void 0:t,"aria-label":r,children:o}),Er=({className:e="",direction:t,children:n})=>(0,i.o)("div",{className:`desktop-navigation ${t} ${e}`,children:n}),_r=({color:e="#FFFFFF"})=>(0,i.o)("svg",{width:"34px",height:"35px",viewBox:"0 0 34 35",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.o)("path",{d:"M24.5 12.3001L24.5 22.7001C24.5 23.9001 23.1 24.7001 22 24.0001L14.5 18.8001C13.5 18.2001 13.5 16.8001 14.5 16.2001L22 11.0001C23 10.3001 24.5 11.0001 24.5 12.3001Z",stroke:e,strokeWidth:"1.9",strokeLinecap:"round"}),(0,i.o)("path",{d:"M9.49981 24.4C9.49981 24.8971 9.90275 25.3 10.3998 25.3C10.8969 25.3 11.2998 24.8971 11.2998 24.4L11.2998 10.6C11.2998 10.103 10.8969 9.70005 10.3998 9.70005C9.90275 9.70005 9.49981 10.103 9.49981 10.6L9.49981 24.4Z",fill:e})]}),Tr=()=>(0,i.o)("svg",{width:"30",height:"31",viewBox:"0 0 30 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.o)("path",{d:"M7.22351 10.7745C8.38274 8.86666 10.2028 7.45152 12.3375 6.79826C14.4721 6.14499 16.7725 6.29918 18.8008 7.23149C20.8292 8.1638 22.4441 9.80918 23.3384 11.8546C24.2326 13.9001 24.3438 16.2029 23.6508 18.325C22.9577 20.4471 21.5089 22.2404 19.5797 23.3637C17.6506 24.4871 15.3758 24.8622 13.1881 24.4176C11.0005 23.973 9.05255 22.7398 7.71492 20.9526C6.37728 19.1653 5.74328 16.9487 5.93351 14.7245M6.67351 6.47446V11.0845H11.0735",
1stroke:"black",strokeWidth:"2.4",strokeLinecap:"round"})}),Pr=(e,t,n,r)=>{const o=(0,i.q)(b),{isFirstChapter:s,isLastChapter:a}=q(e),{onNextButtonClick:c,onPreviousButtonClick:l}=re(e),d=ie(t),{adIsSkippable:u,onSkip:h}=(e=>{const[t,n]=(0,i.h)(!1);return(0,i.p)(()=>e.subscribe("ad-state-change",e=>{n("skippable"===e)})),{adIsSkippable:t,onSkip:()=>{e.skipAd()}}})(t);return{onPrev:()=>{o?.sendStorySwipeEvent("swipe-previous"),t.onPreviousStory()},onNext:()=>{o?.sendStorySwipeEvent("swipe-next"),t.onNextStory()},disablePrevChapter:s&&n||d,disableNextChapter:a&&r||d,disablePrevContent:n||d,disableNextContent:r||d,canSkipAd:d&&u,onSkip:h,onNextButtonClick:c,onPreviousButtonClick:l,adIsActive:d,isFirstChapter:s,isLastChapter:a}},Ir=({closable:e,isFirst:t,isLast:n,videoRef:r,showContentNavigationArrow:o,feedEventsController:s})=>{const{onPrev:a,onNext:c,disablePrevChapter:l,disableNextChapter:d,disablePrevContent:u,disableNextContent:h,canSkipAd:p,onSkip:f,onNextButtonClick:m,onPreviousButtonClick:v,adIsActive:g,isLastChapter:y}=Pr(r,s,t,n);return(0,i.o)(i.I,{css:`\n ${wr}\n .desktop-navigation{position:absolute;top:50%;left:calc(50% + 21em);transform:translateY(-50%);display:flex;flex-direction:row;align-items:center;justify-content:center;gap:2.15em;overflow:visible}.desktop-navigation.prev{left:unset;right:calc(50% + 21em);flex-direction:row-reverse}.navigation-button.chapter{border-radius:50%;background:#fff;backdrop-filter:blur(6.5px);display:flex;align-items:center;justify-content:center}.navigation-button.next{left:25%;transform:rotate(180deg)}\n `,children:[(0,i.o)(Er,{direction:"prev",children:[(0,i.o)(Ar,{className:"chapter prev",onClick:p?f:v,disabled:l&&!p,ariaLabel:"Go to previous chapter",children:[(0,i.o)(Sr,{}),(0,i.o)("p",{className:"hidden",children:"Previous Chapter"})]}),o&&(0,i.o)(Ar,{className:"content prev",onClick:a,disabled:u,ariaLabel:kr,children:[(0,i.o)(_r,{}),(0,i.o)("p",{className:"hidden",children:"Previous Story"})]})]}),e?(0,i.o)(Er,{direction:"next",children:[(0,i.o)(Ar,{className:"chapter next",onClick:p?f:m,disabled:d&&!p,ariaLabel:Cr,children:[(0,i.o)(Sr,{}),(0,i.o)("p",{className:"hidden",children:"Next Chapter"})]}),o&&(0,i.o)(Ar,{className:"content next",onClick:c,disabled:h,ariaLabel:xr,children:[(0,i.o)(_r,{}),(0,i.o)("p",{className:"hidden",children:"Next Story"})]})]}):(0,i.o)(Er,{direction:"next",children:[(0,i.o)(Ar,{className:"chapter next",onClick:p?f:m,disabled:g&&!p,ariaLabel:y&&n?"Reset the story":Cr,children:y&&n?(0,i.o)(i.k,{children:[(0,i.o)(Tr,{}),(0,i.o)("p",{className:"hidden",children:"Reset"})]}):(0,i.o)(i.k,{children:[(0,i.o)(Sr,{}),(0,i.o)("p",{className:"hidden",children:"Next Chapter"})]})}),o&&!n&&(0,i.o)(Ar,{className:"content next",onClick:c,disabled:g,ariaLabel:xr,children:[(0,i.o)(_r,{}),(0,i.o)("p",{className:"hidden",children:"Next Story"})]})]})]})},Lr=({closable:e,isFirst:t,isLast:n,videoRef:r,showContentNavigationArrow:o,feedEventsController:s,isMobile:a})=>{const{onPrev:c,onNext:l,disablePrevContent:d,disableNextContent:u,adIsActive:h}=Pr(r,s,t,n),p=a?"#FFFFFF":"#000000";return(0,i.o)(i.I,{css:`\n ${wr}\n .main-navigation-container{display:flex;position:absolute;align-items:center;justify-content:center;flex-direction:column;left:calc(50% + 21em);transform:translateY(-50%);top:50%}.main-navigation-container.mobile{right:1em;left:unset}.desktop-navigation{border-radius:50%;background:#0000004d;backdrop-filter:blur(6.5px);display:flex;align-items:center;justify-content:center;position:relative}.desktop-navigation.prev{margin-bottom:2em}.navigation-button{width:4.2em;height:4.2em}.navigation-button svg{width:2.6em;height:2.6em}.navigation-button.desktop{width:max(min(3.3em,50px),20px);height:max(min(3.3em,50px),20px);background:#fff;border-radius:50%;box-shadow:0 2px 8px #00000026}.navigation-button.desktop svg{width:max(min(2.08em,28px),15px);height:max(min(2.08em,28px),15px)}.navigation-button.prev{transform:rotate(90deg)}.navigation-button.next{transform:rotate(-90deg)}\n `,children:(0,i.o)("div",{className:"main-navigation-container "+(a?"mobile":"desktop"),children:[(0,i.o)(Er,{direction:"prev",children:o&&(0,i.o)(Ar,{className:"prev "+(a?"mobile":"desktop"),onClick:c,disabled:d,ariaLabel:kr,children:[(0,i.o)(Sr,{color:p}),(0,i.o)("p",{className:"hidden",children:"Previous Story"})]})}),e?(0,i.o)(Er,{direction:"next",children:o&&(0,i.o)(Ar,{className:"next "+(a?"mobile":"desktop"),onClick:l,disabled:u,ariaLabel:xr,children:[(0,i.o)(Sr,{color:p}),(0,i.o)("p",{className:"hidden",children:"Next Story"})]})}):(0,i.o)(Er,{direction:"next",children:(0,i.o)(Ar,{className:"next "+(a?"mobile":"desktop"),onClick:l,disabled:h||n,ariaLabel:xr,children:[(0,i.o)(Sr,{color:p}),(0,i.o)("p",{className:"hidden",children:"Next Story"})]})})]})})},Mr=({closable:e,isFirst:t,isLast:n,videoRef:r,isMobile:o,showContentNavigationArrow:s,feedEventsController:a,isVertical:c})=>c?(0,i.o)(Lr,{closable:e,isFirst:t,isLast:n,videoRef:r,feedEventsController:a,showContentNavigationArrow:s,isMobile:o}):o?null:(0,i.o)(Ir,{closable:e,isFirst:t,isLast:n,videoRef:r,feedEventsController:a,showContentNavigationArrow:s}),Vr=(e,t)=>
1e.some(e=>"shopping"===e.type&&"add-to-cart"===e.data.cta.type&&!a(t));class Fr{static instance;ads={};constructor(){return Fr.instance?Fr.instance:window.joinStories?.videoManagerInstance?(Fr.instance=window.joinStories.videoManagerInstance,window.joinStories.videoManagerInstance):(Fr.instance=this,window.joinStories=window.joinStories||{},window.joinStories.videoManagerInstance=this,this.bindMethods(),this.bindEvents(),this)}initializeAd(e,t,n){const i=`${e.widgetAlias}-${e.storyId}-${e.positionInStory}`,r=document.createElement("div");return r.id=`ad-slot-${i}`,r.style.position="absolute",r.style.width="100%",r.style.height="100%",n.querySelector(".script-container")?.appendChild(r),this.ads[i]={adId:i,adUnitPath:e.adUnitPath,positionInStory:e.positionInStory,totalAdsInStory:e.totalAdsInStory,storyId:e.storyId,widgetAlias:e.widgetAlias,requested:!1,preRendered:!1,rendered:!1,cancelled:!1,domElement:r,...t},i}requestAd(e){const t=this.ads[e];t&&(this.ads[e].requested=!0,this.requestAdFromServer(t))}renderAd(e){this.ads[e]&&(this.ads[e].rendered=!0)}getAd(e){return this.ads[e]}cancelAd(e){const t=this.ads[e];t&&(this.ads[e].cancelled=!0,t.domElement.innerHTML="")}exitAd(e){const t=this.ads[e];t&&(t.domElement.innerHTML="")}resetAd(e){this.ads[e]&&(this.ads[e].rendered=!1,this.ads[e].cancelled=!1)}prerenderAd(e){try{const t=this.ads[e.adId];if(!t)throw new Error("Ad not found.");if(!t.domElement)throw new Error("Ad element not found.");if(!t.requested)throw new Error("Ad not requested.");const n={...e,timeBeforeAdIsSkippable:Math.max(e.timeBeforeAdIsSkippable,e.timeBeforeAdIsClosable)};t.creative=n,t.onPrerender(t),t.preRendered=!0}catch(t){console.error("Error while prerendering ad:",t),this.cancelAd(e.adId)}}requestAdFromServer(e){const{adId:t,adUnitPath:n,positionInStory:i,totalAdsInStory:r,storyId:o,widgetAlias:s,domElement:a}=e,c=document.createElement("div");a.appendChild(c),window.googletag=window.googletag||{cmd:[]},window.googletag.cmd.push(()=>{if(!c)return;c.id||(c.id=`ad-slot-script-${t}`);const e=window.googletag.defineOutOfPageSlot(n,c.id).addService(window.googletag.pubads());if(!e)return;this.setCustomTargetingValue(s,e.setTargeting),e.setTargeting("position_in_story",i.toString()),e.setTargeting("total_ads_in_story",r.toString()),e.setTargeting("widget_alias",s),e.setTargeting("story_id",o),e.setTargeting("url",window.location.href),e.setTargeting("ad_id",t);const a=this.getSequentialTargetingValue(o,i);return a&&e.setTargeting("sequential_targeting",a),googletag.display(c),e})}getSequentialTargetingValue(e,t){return Object.values(this.ads).find(n=>n.storyId===e&&n.positionInStory===t-1&&n.rendered)?.creative?.sequentialTargeting}setCustomTargetingValue(e,t){const n=(0,i.i)(e);Object.keys(n).forEach(e=>{t(e,n[e])})}bindEvents(){(0,i.j)().subscribe("JOIN_STORIES_RENDER_AD",this.prerenderAd)}bindMethods(){this.initializeAd=this.initializeAd.bind(this),this.requestAd=this.requestAd.bind(this),this.renderAd=this.renderAd.bind(this),this.prerenderAd=this.prerenderAd.bind(this),this.getAd=this.getAd.bind(this),this.requestAdFromServer=this.requestAdFromServer.bind(this),this.getSequentialTargetingValue=this.getSequentialTargetingValue.bind(this)}}const Nr=new Fr,Rr=2/30,Br=2/30;class Or{tag;storyConfig;widgetAlias;widgetType;blockingInteractions;_callbacks;_chapters=[];_currentChapterIndex=0;_currentChapter=null;_interactions=[];_blockingInteractions=[];_activeInteractionIndexes=[];_listeningToVideo=!1;_isPlaying=!1;_isBlockedMap={interaction:!1,ad:!1};_currentTime=0;_isShoppingVisible=void 0;_adsConfiguration=null;_adContainer=null;_ads=[];_setAds=null;get _isBlocked(){return Object.values(this._isBlockedMap).some(e=>e)}constructor(e,t){this.loadConfig=this.loadConfig.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.reset=this.reset.bind(this),this.destroy=this.destroy.bind(this),this.initAdsContainer=this.initAdsContainer.bind(this),this._setChapterIndex=this._setChapterIndex.bind(this),this._onChapterChange=this._onChapterChange.bind(this),this._updateCurrentChapter=this._updateCurrentChapter.bind(this),this._listenToTimeUpdate=this._listenToTimeUpdate.bind(this),this._listenToVideo=this._listenToVideo.bind(this),this._stopListeningToVideo=this._stopListeningToVideo.bind(this),this._dispatchCustomEvent=this._dispatchCustomEvent.bind(this),this._onCompleted=this._onCompleted.bind(this),this._onInteractionStateChanged=this._onInteractionStateChanged.bind(this),this._updateActiveInteractions=this._updateActiveInteractions.bind(this),this._updateBlockingInteractions=this._updateBlockingInteractions.bind(this),this._onStoryChapterChange=this._onStoryChapterChange.bind(this),this._onStoryChapterComplete=this._onStoryChapterComplete.bind(this),this._onNoPageBefore=this._onNoPageBefore.bind(this),this._onStoryEnd=this._onStoryEnd.bind(this),this._onStoryComplete=this._onStoryComplete.bind(this),this._updateAds=this._updateAds.bind(this),this.block=this.block.bind(this),this.unblock=this.unblock.bind(this),this.setInteractionBlocking=this.setInteractionBlocking.bind(this),this.tag=e,this.tag.videoController=this,this._callbacks=t}destroy(){this._stopListeningToVideo()}attachTag(){this.tag&&(this._listenToVideo(),this.storyConfig&&this._loadConfigInTag(this.tag,this.storyConfig))}detachTag(){this.tag.src&&(this._stopListeningToVideo(),this.tag.src="",this.tag.load&&this.tag.load())}loadConfig(e,t,n,i){this.storyConfig=e,this.widgetAlias=t,this.widgetType=n,this.blockingInteractions=i,this._currentChapter=e.chapters[this._currentChapterIndex],this._chapters=e.chapters,this._interactions=e.interactions,this._activeInteractionIndexes=[],this._dispatchCustomEvent(j.CONFIG_UPDATED)}setAdsCallback(e){this._setAds=e}play(){if(!this.tag)throw new Error("VideoController: No video tag loaded");if(this._isBlocked||this.tag.play(),this._isPlaying=!0,navigator.mediaSession){const e=this.storyConfig?.currentCover?.contentType?.includes("mp4")?(0,i.v)(this.storyConfig?.currentCover?.mediaUrl):this.storyConfig?.currentCover?.mediaUrl;
1navigator.mediaSession.metadata=new MediaMetadata({title:this.storyConfig?.title,artist:"JOIN Stories",artwork:e?[{src:e,sizes:"512x512",type:"image/png"}]:void 0})}}pause(){if(!this.tag)throw new Error("VideoController: No video tag loaded");this.tag.pause(),this._isPlaying=!1}mute(){if(!this.tag)throw new Error("VideoController: No video tag loaded");this.tag.muted=!0}unmute(){if(!this.tag)throw new Error("VideoController: No video tag loaded");this.tag.muted=!1}get currentTime(){if(!this.tag)throw new Error("VideoController: No video tag loaded");return this.tag.currentTime}get duration(){if(!this.tag)throw new Error("VideoController: No video tag loaded");return this.tag.duration}get isPlaying(){if(!this.tag)throw new Error("VideoController: No video tag loaded");return!this.tag.paused}get completionRatio(){return isNaN(this.duration)?0:Math.min(1,this.currentTime/this.duration)}get chapterCompletionRatio(){return this._currentChapter?(0,i.m)(this.currentTime,this._currentChapter):0}nextChapter(){const e=this._currentChapterIndex+1;e<this._chapters.length?this.goToChapterIndex(e):this._onStoryEnd()}previousChapter(){const e=this._currentChapterIndex-1;e>=0?this.goToChapterIndex(e):this._onNoPageBefore()}goToChapterIndex(e){this._setChapterIndex(e),this._onStoryChapterChange(e)}goToProgress(e){if(!this.tag)throw new Error("VideoController: No video tag loaded");this.tag.currentTime=e*this.tag.duration}setPlaybackRate(e){if(!this.tag)throw new Error("VideoController: No video tag loaded");this.tag.playbackRate=e}restartCurrentChapter(){this._setChapterIndex(this._currentChapterIndex)}reset(){this.setPlaybackRate(1),this._setChapterIndex(0)}get chapters(){return this._chapters}get currentChapter(){return this._currentChapter}get currentChapterIndex(){return this._currentChapterIndex}getInteractionState(e){const t=this._interactions.findIndex(t=>t.id===e);return-1===t?"inactive":this._activeInteractionIndexes.includes(t)?"active":"inactive"}setInteractionBlocking(e,t){const n=this._blockingInteractions.filter(t=>t.id!==e);if(t){const t=this._interactions.find(t=>t.id===e);t&&(this._blockingInteractions=[...n,t])}else this._blockingInteractions=n;this._updateBlockingInteractions(this._currentTime)}addEventListener(e,t,n){if(!this.tag)throw new Error("VideoController: No video tag loaded");"loadedmetadata"===e&&this.tag.readyState>=HTMLMediaElement.HAVE_METADATA&&t({...new Event("loadedmetadata",{bubbles:!0}),target:this.tag}),this.tag.addEventListener(e,t,n)}removeEventListener(e,t){if(!this.tag)throw new Error("VideoController: No video tag loaded");this.tag.removeEventListener(e,t)}setAdsConfiguration(e){this._adsConfiguration=e}initAdsContainer(e){if(this._adContainer||!this._adsConfiguration)return;this._adContainer=e;const{adPlacementOffset:t,adPlacementInterval:n,adUnit:i}=this._adsConfiguration;if(this._chapters.length<t)return;const r=Math.floor((this._chapters.length-t-1)/n)+1;this._ads=new Array(r).fill(null).map((o,s)=>{const a=s+1,c=t+s*n,l=this._chapters[c-1].timing.start||0,d=this._chapters[c].timing.start-Br;return{adId:Nr.initializeAd({positionInStory:a,totalAdsInStory:r,storyId:this.storyConfig?this.storyConfig._id:"",widgetAlias:this.widgetAlias||"",adUnitPath:i},{onPrerender:e=>{this._setAds?.(t=>[...t.filter(t=>t.adId!==e.adId),{...e,active:!1}])}},e),adPosition:a,totalAdsInStory:r,fetchTiming:l,renderTiming:d}})}resetAds(){this.unblock("ad"),this._ads.forEach(e=>{Nr.resetAd(e.adId)}),this._setAds?.([])}_loadConfigInTag(e,t){const n=this._isPlaying;if(n||this.pause(),e.src?.startsWith(t.videoUrl))return;const i=this._currentTime||.001;e.src=`${t.videoUrl}?t=${t.lastPublishDate}#t=${i}`,e.currentTime=this._currentTime,e.load&&(e.load(),n&&e.play()),this._dispatchCustomEvent(j.CONTROLLER_READY)}_setChapterIndex(e){const t=this._chapters[e];this._onChapterChange(t,e),this._currentTime=t.timing.start+(0!==e?Rr:0),this.tag&&(this.tag.currentTime=this._currentTime),this._updateCurrentChapter(this._currentTime),this._updateActiveInteractions(this._currentTime),this._updateBlockingInteractions(this._currentTime)}_onChapterChange(e,t){this._currentChapter=e,this._currentChapterIndex=t,this._dispatchCustomEvent(j.CHAPTER_CHANGE,{chapterIndex:t,newChapter:e})}_updateCurrentChapter(e){const t=this._chapters.findIndex(t=>t.timing.start<=e&&e<t.timing.end);-1!==t&&t!==this._currentChapterIndex&&(this._onChapterChange(this._chapters[t],t),this._onStoryChapterChange(t),this._onStoryChapterComplete())}_onCompleted(){this._onStoryEnd(),this._onStoryComplete()}_onInteractionStateChanged(e,t){this._dispatchCustomEvent(j.INTERACTION_STATE_CHANGED,{interactionId:e.id,newState:t})}_onInteractionShoppingStateChanged(e){this._isShoppingVisible!==e&&(this._isShoppingVisible=e,this._dispatchCustomEvent(j.SHOPPING_VISIBILITY,{visibility:e}))}_updateActiveInteractions(e){const t=this._interactions.reduce((t,n,i)=>n.timing.start<=e&&n.timing.end>e?[...t,i]:t,[]),n=t.filter(e=>!this._activeInteractionIndexes.includes(e)),i=this._activeInteractionIndexes.filter(e=>!t.includes(e));
1n.forEach(e=>{this._onInteractionStateChanged(this._interactions[e],"active")}),i.forEach(e=>{this._onInteractionStateChanged(this._interactions[e],"inactive")});const r=t.map(e=>this._interactions[e]),o=Vr(r,this.widgetType);this._onInteractionShoppingStateChanged(o),this._activeInteractionIndexes=t}_updateBlockingInteractions(e){if(!this.blockingInteractions)return;const t=this._blockingInteractions.filter(t=>t.timing.end-e<.5);t.length>0&&!this._isBlocked?this.block("interaction"):0===t.length&&this._isBlocked&&this.unblock("interaction")}_updateAds(e){if(!this._isPlaying||!this._adContainer)return;const t=this._ads.findIndex(t=>t.fetchTiming<=e&&!Nr.getAd(t.adId)?.requested);this._ads[t]&&Nr.requestAd(this._ads[t].adId);const n=this._ads.findIndex(t=>{const n=Nr.getAd(t.adId);return t.renderTiming<=e&&!n?.rendered&&!n.cancelled});if(this._ads[n]){const e=Nr.getAd(this._ads[n].adId);if(!e.preRendered)return Nr.cancelAd(e.adId),void console.warn("Ad not ready to render",e.adId);Nr.renderAd(e.adId);const t=()=>{this._setAds?.(t=>[...t.filter(t=>t.adId!=e.adId)]),Nr.exitAd(e.adId),this.unblock("ad")};this._setAds?.(n=>[...n.filter(t=>t.adId!==e.adId),{...e,active:!0,onEnded:t}]),this.block("ad")}}_listenToTimeUpdate(){const e=this.tag?.currentTime;if(!e)return;const t=this._currentTime-e;t>0&&t<=.3||(this._currentTime=e,this._updateCurrentChapter(e),this._updateActiveInteractions(e),this._updateBlockingInteractions(e),this._updateAds(e))}_listenToVideo(){if(!this.tag)throw new Error("VideoController: No video tag loaded");this._stopListeningToVideo(),this._listeningToVideo=!0,this.tag.addEventListener("timeupdate",this._listenToTimeUpdate,{passive:!0}),this.tag.addEventListener("ended",this._onCompleted,{passive:!0})}_stopListeningToVideo(){if(!this.tag)throw new Error("VideoController: No video tag loaded");this._listeningToVideo&&(this.tag.removeEventListener("timeupdate",this._listenToTimeUpdate),this.tag.removeEventListener("ended",this._onCompleted))}_dispatchCustomEvent(e,t){if(!this.tag)throw new Error(`VideoController: No video tag loaded, cannot dispatch event ${e} `);const n=new CustomEvent(e,{detail:t});this.tag.dispatchEvent(n)}async _onStoryChapterChange(e){this.storyConfig&&(this._updateAds(this._currentTime),await this._callbacks.onChapterChange(this.storyConfig._id,e))}async _onStoryChapterComplete(){this.storyConfig&&await this._callbacks.onChapterComplete(this.storyConfig._id)}async _onNoPageBefore(){await this._callbacks.onPrev()}async _onStoryEnd(){await this._callbacks.onNext()}async _onStoryComplete(){this.storyConfig&&await this._callbacks.onComplete(this.storyConfig._id)}block(e="interaction"){if(!this.tag)throw new Error("VideoController: No video tag loaded");this._callbacks.onStoryBlocked?.(),this._isBlockedMap[e]=!0,this._isPlaying&&this.tag.pause()}unblock(e="interaction"){if(!this.tag)throw new Error("VideoController: No video tag loaded");this._isBlockedMap[e]=!1;const t=this._isBlocked;this._isPlaying&&!t&&this.tag.play()}}const Dr=(0,i.M)(()=>Promise.all([n.e(6020),n.e(7936)]).then(n.bind(n,17936))),Ur=(0,i.M)(()=>Promise.all([n.e(6020),n.e(9071)]).then(n.bind(n,79071))),$r=({isPreview:e,...t})=>(0,i.o)(i.U,{fallback:(0,i.o)(i.k,{}),children:e?(0,i.o)(Ur,{...t}):(0,i.o)(Dr,{...t})}),Yr=(0,i.M)(()=>Promise.all([n.e(4277),n.e(4784)]).then(n.bind(n,74784))),jr=(0,i.M)(()=>Promise.all([n.e(4277),n.e(2413)]).then(n.bind(n,22413))),zr=({isPreview:e,...t})=>(0,i.o)(i.U,{fallback:(0,i.o)(i.k,{}),children:e?(0,i.o)(Yr,{...t}):(0,i.o)(jr,{...t})}),qr=(0,i.M)(()=>n.e(7961).then(n.bind(n,97961))),Hr=(0,i.M)(()=>n.e(9375).then(n.bind(n,79375))),Wr=({isPreview:e,...t})=>(0,i.o)(i.U,{fallback:(0,i.o)(i.k,{}),children:e?(0,i.o)(qr,{...t}):(0,i.o)(Hr,{...t})}),Gr=(0,i.M)(()=>n.e(4979).then(n.bind(n,24979))),Xr=(0,i.M)(()=>n.e(9798).then(n.bind(n,79798))),Zr=({isPreview:e,...t})=>(0,i.o)(i.U,{fallback:(0,i.o)(i.k,{}),children:e?(0,i.o)(Gr,{...t}):(0,i.o)(Xr,{...t})}),Jr=(0,i.M)(()=>Promise.all([n.e(8436),n.e(7088)]).then(n.bind(n,47088))),Kr=(0,i.M)(()=>Promise.all([n.e(8436),n.e(6541)]).then(n.bind(n,6541))),Qr=({isPreview:e,...t})=>(0,i.o)(i.U,{fallback:(0,i.o)(i.k,{}),children:e?(0,i.o)(Jr,{...t}):(0,i.o)(Kr,{...t})}),eo=(0,i.M)(()=>Promise.all([n.e(8406),n.e(3085)]).then(n.bind(n,3085))),to=(0,i.M)(()=>Promise.all([n.e(8406),n.e(4633)]).then(n.bind(n,84633))),no=({isPreview:e,...t})=>(0,i.o)(i.U,{fallback:(0,i.o)(i.k,{}),children:e?(0,i.o)(eo,{...t}):(0,i.o)(to,{...t})}),io=(0,i.x)(({owner:e,publisherApiUrl:t,widgetAlias:n,forceShoppingLink:r,videoRef:o,interaction:s,isPreview:a,isContentActive:c,sendAnalytics:l,isMobile:d,onFeedIsPaused:u,setIsDesktopShoppingOpen:h,isVertical:p})=>{const f=((e,t)=>{const[n,r]=(0,i.h)("inactive"),o=e=>{const{interactionId:n,newState:i}=e.detail;n===t&&r(i)};return z(e,e=>{r(e.getInteractionState(t)),e.addEventListener(j.INTERACTION_STATE_CHANGED,o)},e=>{e?.removeEventListener(j.INTERACTION_STATE_CHANGED,o)}),n})(o,s.id),m=((e,t)=>n=>{const i=()=>{e?.videoController?.setInteractionBlocking(t,n)};e?.videoController?i():e?.addEventListener(j.CONTROLLER_READY,i,{once:!0})})(o.current,s.id),v=(e=>{const t=(0,i.q)(b),n=t=>t?(...n)=>{t(e,...n)}:()=>{};return{onView:n(t?.sendInteractionViewEvent),onEngage:n(t?.sendInteractionEngageEvent),onComplete:n(t?.sendInteractionCompleteEvent),onExit:n(t?.sendInteractionExitEvent)}})(s.id),g=(e=>{const t=(0,i.q)(b),n=n=>n?(i,...r)=>{t&&n(e,i,...r)}:()=>{};return{onProductLoaded:n(t?.sendProductLoadedEvent),onProductView:n(t?.sendProductViewEvent),onProductDetailsView:n(t?.sendProductDetailsViewEvent),onProductEngage:n(t?.sendProductEngageEvent)}})(s.id);return(({owner:e,interaction:t,interactionState:n,setInteractionBlockingState:r,isPreview:o,isContentActive:s,sendAnalytics:a,playStory:c,pauseStory:l,widgetAlias:d,publisherApiUrl:u,isMobile:h,forceShoppingLink:p,setIsDesktopShoppingOpen:f,isVertical:m,...v})=>{switch(t.type){case"cta":return(0,i.o)($r,{isPreview:o,show:"active"===n,isContentActive:s,data:t.data,position:t.position,sendAnalytics:a,isVertical:m,...v});case"multiplePoll":case"binaryPoll":return(0,i.o)(Wr,{type:t.type,isPreview:o,show:"active"===n,isContentActive:s,data:t.data,interactionId:t.id,position:t.position,defaultPosition:t.defaultPosition,setInteractionBlockingState:r,animate:!0,isVertical:m,...v});case"shopping":return(0,i.o)(no,{owner:e,publisherApiUrl:u,widgetAlias:d,forceShoppingLink:p,isContentActive:s,show:"active"===n&&(h||s||"add-to-cart"!==t.data.cta.type),data:t.data,position:t.position,isPreview:o,setInteractionBlockingState:r,isMobile:h,sendAnalytics:a,setIsDesktopShoppingOpen:f,isVertical:m,...v});case"form":return(0,i.o)(zr,{isPreview:o,show:"active"===n,isContentActive:s,data:t.data,position:t.position,formId:t.id,setInteractionBlockingState:r,animate:!0,isVertical:m,...v});case"quiz":return(0,i.o)(Zr,{isPreview:o,show:"active"===n,isContentActive:s,data:t.data,position:t.position,defaultPosition:t.defaultPosition,interactionId:t.id,setInteractionBlockingState:r,animate:!0,isVertical:m,...v});case"reply":return(0,i.o)(Qr,{isPreview:o,show:"active"===n,isContentActive:s,data:t.data,position:t.position,defaultPosition:t.defaultPosition,replyId:t.id,setInteractionBlockingState:r,playStory:c,pauseStory:l,animate:!0,isVertical:m,...v});default:return null}})({owner:e,publisherApiUrl:t,interaction:s,interactionState:f,setInteractionBlockingState:m,isPreview:a,isContentActive:c,sendAnalytics:l,playStory:()=>{u(!1)},pauseStory:()=>{u(!0)},widgetAlias:n,isMobile:d,forceShoppingLink:r,...v,...g,setIsDesktopShoppingOpen:h,isVertical:p})},(e,t)=>e.interaction.id===t.interaction.id&&e.isContentActive===t.isContentActive&&e.isPreview===t.isPreview&&e.isMobile===t.isMobile),ro=({owner:e,publisherApiUrl:t,widgetAlias:n,widgetType:r,storyId:o,videoRef:s,feedEventsController:c,interactions:l,isPreview:d,sendAnalytics:u,isMobile:h,onFeedIsPaused:p,setIsDesktopShoppingOpen:f,isVertical:m})=>{const[v,g]=(0,i.h)(!1);return(0,i.p)(()=>c.subscribe("active-story-changed",e=>{g(o===e)}),[o]),(0,i.o)(i.I,{css:".interaction-layer{z-index:22}.interaction-layer.hide{opacity:0}
1",children:(0,i.o)("div",{className:"interaction-layer",children:l.map(o=>(0,i.o)(io,{owner:e,publisherApiUrl:t,widgetAlias:n,forceShoppingLink:a(r),videoRef:s,interaction:o,isPreview:d,isContentActive:v,sendAnalytics:u,isMobile:h,onFeedIsPaused:p,setIsDesktopShoppingOpen:f,isVertical:m},o.id))})})},oo=(0,i.G)({ads:[],setAds:()=>{}}),so=({children:e,ads:t,setAds:n})=>(0,i.o)(oo.Provider,{value:{ads:t,setAds:n},children:e}),ao=()=>(0,i.o)(i.I,{css:"@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-content-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:1em;animation:fade-in .2s .1s ease-in-out both;display:flex;width:5em;height:5em}.video-content-loader div{position:absolute;top:0;left:0;width:5em;height:5em;border:.15em solid #ffffff33;border-radius:50%}.video-content-loader div:nth-child(2){clip-path:polygon(50% 50%,0 0,100% 0,100% 20%);animation:spin 1s infinite;animation-timing-function:cubic-bezier(.75,.29,.22,.85);border:.15em solid #ffffff}",children:(0,i.o)("div",{className:"video-content-loader",children:[(0,i.o)("div",{}),(0,i.o)("div",{})]})}),co=(0,i.x)(({videoRef:e,...t})=>{const[n,r]=(0,i.h)(!1);return(0,i.p)(()=>{const t=e.current;if(t){const e=()=>{r(!0)},n=()=>{r(!1)};return t.addEventListener("waiting",e),t.addEventListener("canplay",n),()=>{t.removeEventListener("waiting",e),t.removeEventListener("canplay",n)}}},[e]),(0,i.o)(i.k,{children:[(0,i.o)("video",{ref:e,playsInline:!0,muted:!0,width:"100%",height:"100%",preload:"metadata",...t}),n&&(0,i.o)(ao,{})]})}),lo=(0,i.x)(({index:e,isFirst:t,isLast:n,closable:r,widgetConfig:s,storyConfig:a,pxRatio:c,isMobile:l,isPreview:d,CustomVideoPlayer:u,feedEventsController:h,autoplay:p=!1,showControls:f=!0,blockingInteractions:g=!0,isVertical:y=!1,showWatermark:b=!0,enableTitleFocus:C=!0})=>{const[k,x]=(0,i.h)([]),S=(0,i.q)(yo),A=(0,i._)(null),E=(0,i._)(null),[_,T]=(0,i.h)(!1),{isActive:P,isActiveRef:I,setIsActive:L,feedPaused:M,feedPausedRef:V,localPausedRef:F,onFeedIsPaused:N}=(({autoplay:e,videoRef:t})=>{const[n,r]=(0,i.h)(!1),o=(0,i._)(n),s=(0,i._)(!1),[a,c]=(0,i.h)(e),l=(0,i._)(a);return{isActive:a,setIsActive:c,isActiveRef:l,feedPaused:n,setFeedPaused:r,feedPausedRef:o,onFeedIsPaused:e=>{r(e),o.current=e,e||!l.current?t.current?.videoController?.pause():s.current||t.current?.videoController?.play()},localPausedRef:s}})({autoplay:p&&t,videoRef:A});(({index:e,videoRef:t,contentContainerRef:n,storyConfig:r,widgetConfig:s,feedEventsController:a,setAds:c,blockingInteractions:l})=>{const d=(0,i.q)(bo),u=(0,i._)(),h=(0,i._)(!1),p=(0,i.q)(yo),f=e=>{h.current="active"===e,n.current?.setAttribute("data-content-state",e),u.current&&d?.setVideoController(r._id,u.current)};(0,i.p)(()=>{if(t.current&&!u.current)return u.current=new Or(t.current,{onNext:a.onNextStory,onPrev:a.onPreviousStory,onChapterChange:a.onChapterChange,onChapterComplete:a.onChapterComplete,onComplete:a.onStoryComplete,onStoryBlocked:d?.setInteractionBlocked}),()=>{u.current?.destroy(),u.current=void 0}},[]),(0,i.p)(()=>{u.current&&u.current.setAdsCallback(c)},[c]),(0,i.p)(()=>{u.current&&u.current.setAdsConfiguration(s.ads||null)},[s.ads]),(0,i.p)(()=>{u.current&&u.current.loadConfig(r,s.alias,s.type,l)},[r,s.alias,s.type,l]),(0,i.p)(()=>{u.current&&((e,t,n,i)=>{t.subscribe("story-should-mount",(e,t)=>{e===n.storyConfig?._id&&(t?n.attachTag():n.detachTag())}),t.subscribe("active-story-changed",async(r,o)=>{if(r===n.storyConfig?._id){const e=async()=>{await t.setCanPlayThrough(r,!0)};n.tag.readyState>=3?await e():(await t.setCanPlayThrough(r,!1),n.tag.addEventListener("canplaythrough",e,{once:!0}))}i.setContentState(v(e,o))}),t.subscribe("is-muted",e=>{e?n.mute():n.unmute()}),t.subscribe("reset-all-stories",()=>{n.reset(),n.resetAds()})})(e,a,u.current,{setContentState:f})},[e]),((e,t)=>{const n=(0,i.q)(bo),r=o(),s=(0,i._)();(0,i.p)(()=>{s.current?!n||!t.current||n.sendStoryTabChangeEvent(e,r):s.current=!0},[r])})(r._id,h);const m=()=>{if(void 0!==u.current?.currentChapterIndex){const e=u.current?.currentChapterIndex,t=u.current?.chapters.length;p?.sendStoryBeacon("storyPageVisible",r,{cpIndex:e}),t&&e===t-1&&((0,i.n)(s,r),p?.sendStoryBeacon("storyLastPageVisible",r,{cpIndex:e}))}};(0,i.p)(()=>{const e=u.current;if(e){const t=async()=>{h.current&&m()},n=()=>{m(),e.addEventListener(j.CHAPTER_CHANGE,t)},i=()=>{u.current?.removeEventListener(j.CHAPTER_CHANGE,t)},o=a.subscribe("active-story-changed",e=>{e===r._id?n():i()});return()=>{o(),i()}}},[r._id])})({index:e,videoRef:A,storyConfig:a,widgetConfig:s,feedEventsController:h,contentContainerRef:E,setAds:x,blockingInteractions:g});const R=((e,t,n)=>{const[r,o]=(0,i.h)(()=>{const e=n?.interactions.filter(e=>e.timing.start<=0);return Vr(e,t)}),s=(0,i.T)(e=>{o(e.detail.visibility)},[]);return z(e,e=>{e.addEventListener(j.SHOPPING_VISIBILITY,s)},e=>{e?.removeEventListener(j.SHOPPING_VISIBILITY,s)}),r})(A,s.type,a),B=u||co,O=s.playerBorderRadius??10;return(0,i.o)(w,{storyId:a._id,children:(0,i.o)(so,{ads:k,setAds:x,children:(0,i.o)(i.I,{css:".video-content-container{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;font-size:var(--calc-font-size-ratio, 10px)}.video-content-container.vertical.desktop{top:var(--next-story-preview-vertical-desktop-shift, -1vh)}.video-content-container.player-3d{transform-style:preserve-3d}.video-content-container.desktop.shopping-visible{width:75%}.video-content-container.desktop[data-content-state=active]{transition:width .3s ease-in-out}.video-content-player{position:absolute;top:50%;left:50%;width:37.5em;height:66.7em;display:flex;align-items:center;justify-content:center;pointer-events:all;overflow:hidden;box-shadow:0 .4em 1.7em #00000040;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.video-content-player.player-3d{transform:translate3d(-50%,-50%,var(--screen-width, 100vh))}.desktop .video-content-player{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:var(--player-border-radius)}
1.video-content-player.vertical{transform:translate3d(-50%,-50%,0)}.video-content-player>*:not(.video-content-loader){position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.video-content-player>video{background:#141414;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ui{transition:opacity .2s linear}.hide-ui .ui{opacity:0}.video-content-container.player-3d[data-content-state=active]{transform:translateZ(calc(-1 * var(--screen-width, 100vh)));z-index:10}.video-content-container.vertical[data-content-state=active]{transform:translateZ(0);z-index:10}.video-content-container.player-3d[data-content-state=next],.video-content-container.player-3d[data-content-state=hidden-next]{transform:translateZ(calc(-1 * var(--screen-width, 100vh))) rotateY(53deg);z-index:0}.video-content-container.player-3d[data-content-state=previous],.video-content-container.player-3d[data-content-state=hidden-prev]{transform:translateZ(calc(-1 * var(--screen-width, 100vh))) rotateY(-53deg);z-index:0}.video-content-container.desktop[data-content-state=active],.video-content-container.desktop.vertical[data-content-state=active]{transform:translateZ(0)}.video-content-container.player-3d.desktop[data-content-state=next],.video-content-container.player-3d.desktop[data-content-state=hidden-next]{transform:translate3d(100%,0,0) scale(.3)}.video-content-container.player-3d.desktop[data-content-state=previous],.video-content-container.player-3d.desktop[data-content-state=hidden-prev]{transform:translate3d(-100%,0,0) scale(.3)}.video-content-container.vertical[data-content-state=previous],.video-content-container.vertical[data-content-state=hidden-prev]{transform:translate3d(0,-100%,0);z-index:10}.video-content-container.vertical.desktop[data-content-state=previous],.video-content-container.vertical.desktop[data-content-state=hidden-prev]{transform:translate3d(0,calc(-1 * var(--desktop-vertical-content-player
1-height, 93%)),0);z-index:10}.video-content-container.vertical[data-content-state=next],.video-content-container.vertical[data-content-state=hidden-next]{transform:translate3d(0,100%,0);z-index:10}.video-content-container.vertical.desktop[data-content-state=next],.video-content-container.vertical.desktop[data-content-state=hidden-next]{transform:translate3d(0,var(--desktop-vertical-content-player-height, 93%),0)}.video-content-container.vertical.desktop[data-content-state=next-2]{transform:translate3d(0,100%,0)}.video-content-container.vertical.mobile[data-content-state=next-2],.video-content-container.player-3d[data-content-state=next-2],.video-content-container[data-content-state=hidden-next],.video-content-container[data-content-state=hidden-prev]{display:none}",children:(0,i.o)("div",{inert:!P,className:`video-content-container ${l?"mobile":"desktop"} ${R&&_?"shopping-visible":""} ${y?"vertical":"player-3d"}`,"data-content-state":v(e,p?0:-1),style:{"--calc-font-size-ratio":`${c}px`,"--desktop-vertical-content-player-height":"93%","--next-story-preview-vertical-desktop-shift":"-2%"},ref:E,role:"dialog","aria-modal":P,children:[(0,i.o)("div",{className:"video-content-player "+(y?"vertical":"player-3d"),style:{"--player-border-radius":`${O}px`},children:[(0,i.o)(B,{videoRef:A,"aria-label":a.containerLabel}),(0,i.o)(br,{initialMuted:p,feedEventsController:h,videoRef:A,isMobile:l,closable:r,canSwipePrevAndNext:!(t&&n),storyConfig:a,showFeedStoryCoverAndTitle:s.showFeedStoryCoverAndTitle,contentContainerRef:E,isActive:P,isActiveRef:I,setIsActive:L,feedPaused:M,feedPausedRef:V,localPausedRef:F,onFeedIsPaused:N,isVertical:y,showControls:f,showWatermark:b,enableTitleFocus:C}),(0,i.o)(ro,{owner:s.owner,publisherApiUrl:s.publisherApiUrl,widgetAlias:s.alias,widgetType:s.type,storyId:a._id,interactions:a.interactions,videoRef:A,feedEventsController:h,isPreview:d,sendAnalytics:(e,t)=>{S?.sendStoryBeacon(e,a,{...t,cpIndex:A.current?.videoController?.currentChapterIndex||0})},isMobile:l,onFeedIsPaused:N,setIsDesktopShoppingOpen:T,isVertical:y}),A.current&&s.ads&&(0,i.o)(m,{videoPlayer:A.current,isActive:P,isMobile:l,feedEventsController:h})]}),(0,i.o)(Mr,{closable:r,isFirst:t,isLast:n,videoRef:A,isMobile:l,showContentNavigationArrow:!(t&&n),feedEventsController:h,isVertical:y})]})})})})}),uo=({feedController:e,widgetId:t,owner:n})=>{const[r,o]=(0,i.h)();(0,i.p)(()=>e.feedEventsController.subscribe("active-story-changed",e=>{o(e)}),[e.feedEventsController,t]);const s=I({owner:n,storyId:r}),a=L("desktop");return(0,i.o)("a",{target:"_blank",rel:"noopener noreferrer",href:s,className:"watermark-link",children:[(0,i.o)("p",{style:{display:"none"},children:"JOIN Stories Watermark"}),(0,i.o)("img",{src:a,alt:"JOIN Stories Watermark",className:"watermark-svg",width:27,height:121,loading:"lazy",decoding:"async"})]})},ho=(e,t)=>{const n=()=>{t.drawImage(e,0,0,375,667)};e.readyState>=2?n():e.addEventListener("loadeddata",n,{once:!0})};class po extends i.E{constructor(){super(),this.subscribe=this.subscribe.bind(this),this.unsubscribe=this.unsubscribe.bind(this),this.emit=this.emit.bind(this),this.setStoryShouldMount=this.setStoryShouldMount.bind(this),this.setActiveStory=this.setActiveStory.bind(this),this.resetAllStories=this.resetAllStories.bind(this),this.setMuted=this.setMuted.bind(this),this.setFeedPaused=this.setFeedPaused.bind(this),this.setContentIsPaused=this.setContentIsPaused.bind(this),this.onNextStory=this.onNextStory.bind(this),this.onPreviousStory=this.onPreviousStory.bind(this),this.onStoryComplete=this.onStoryComplete.bind(this),this.onClose=this.onClose.bind(this),this.onSwipeEnd=this.onSwipeEnd.bind(this),this.onChapterChange=this.onChapterChange.bind(this),this.onChapterComplete=this.onChapterComplete.bind(this),this.setCanPlayThrough=this.setCanPlayThrough.bind(this),this.setAdIsActive=this.setAdIsActive.bind(this)}async setStoryShouldMount(e,t){return this.emit("story-should-mount",e,t)}async setActiveStory(e,t){return this.emit("active-story-changed",e,t)}async resetAllStories(){return this.emit("reset-all-stories")}
1async setMuted(e){return this.emit("is-muted",e)}async setFeedPaused(e){return this.emit("is-feed-paused",e)}async setContentIsPaused(e){return this.emit("is-content-paused",e)}async onNextStory(){return this.emit("on-next-story")}async onPreviousStory(){return this.emit("on-previous-story")}async onStoryComplete(e){return this.emit("on-story-complete",e)}async onClose(){return this.emit("on-close")}async onSwipeEnd(e,t={}){return this.emit("on-swipe-end",e,t)}async onChapterChange(e,t){return this.emit("on-chapter-change",e,t)}async onChapterComplete(e){return this.emit("on-chapter-complete",e)}async setCanPlayThrough(e,t){return this.emit("can-play-through",e,t)}async setAdIsActive(e){return this.emit("ad-is-active",e)}async setAdState(e){return this.emit("ad-state-change",e)}async skipAd(){return this.emit("ad-skip-request")}}const fo=["click","pointerdown","pointerdown","touchstart","touchmove","touchend","touchcancel"],mo=e=>{if(!e)return()=>{};const t=e.closest(".feed-background-overlay"),n=e=>{e.stopPropagation(),e.preventDefault()};return fo.forEach(i=>{e.addEventListener(i,n,{capture:!0,passive:!1}),t?.addEventListener(i,n,{capture:!0,passive:!1})}),()=>{(0,i.e)(()=>{fo.forEach(i=>{e.removeEventListener(i,n,{capture:!0}),t?.removeEventListener(i,n,{capture:!0})})})}},vo=(e,t,n,r)=>{const[s]=(0,i.h)(()=>new po),{closable:a,autoplay:c,forceSoundInit:l,noAnimation:d,isVertical:u,isMobile:h}=n,{onClose:p,...f}=r,m=e.length,v=(0,i._)(null),g=(0,i._)(),y=(0,i._)(-1),b=async t=>{await(async(e,t,n,i,r,o)=>{const s=!r&&o;return await Promise.all(e.map((e,r)=>{const o=r-n;return i.setStoryShouldMount(e._id,((e,t,n)=>t?n?e>=-1&&e<=2:Math.abs(e)<=1:0===e)(o,t,s))}))})(e,t,y.current,s,h??!1,u??!1)},{setIsActive:w,setForcePause:C}=(({feedEventsController:e,storiesConfig:t,analytics:n,autoplay:r,updateStoriesMounted:s,currentStoryIndexRef:a})=>{const c=o(),l=(0,i._)({feedIsActive:r,tabIsActive:c,contentIsActive:!0,forcePause:!1}),d=(0,i._)(!1),u=async()=>{const t=(e=>{const t=e.current;return t.feedIsActive&&t.tabIsActive&&t.contentIsActive&&!t.forcePause})(l);t!==d.current&&(d.current=t,await e.setFeedPaused(!t))},h=async e=>{l.current.forcePause=e,await u()};return(0,i.p)(()=>{const i=e.subscribe("is-content-paused",async e=>{l.current.contentIsActive=!e,await u()}),r=async e=>{-1!==a.current&&e===t[a.current]._id&&(!l.current.contentIsActive&&l.current.feedIsActive&&n?.sendStoryUnpauseEvent(e),l.current.contentIsActive=!0,await u())},o=e.subscribe("on-chapter-change",r),s=e.subscribe("active-story-changed",r);return()=>{i(),o(),s()}},[t]),(0,i.p)(()=>{l.current.tabIsActive=c,u()},[c]),{setIsActive:async n=>{l.current.feedIsActive=n,n?(-1===a.current&&(a.current=0,await e.setActiveStory(t[0]._id,0)),await e.setContentIsPaused(!1),await h(!1),await s(!0)):(await e.setActiveStory("",-1),a.current=-1),await u()},setForcePause:h}})({feedEventsController:s,storiesConfig:e,analytics:t,autoplay:c,updateStoriesMounted:b,currentStoryIndexRef:y}),k=(({onContentReady:e,onContentLoading:t})=>{const n=(0,i._)(!1);return i=>{n.current!==i&&(i?e?.():t?.()),n.current=i}})(f);(0,i.p)(()=>{const t=s.subscribe("can-play-through",(t,n)=>{const i=e[y.current];i&&t===i._id&&k(n)});return()=>{t()}},[e]);const x=async e=>{await s.setMuted(e)};(0,i.p)(()=>{l&&x(!1)},[l]);const S=async(n,i,r)=>{const o=e.findIndex(e=>e._id===n);if(-1!==o){if(y.current===o)return t?.setOpenedChapter(n),t?.setActiveStory(n),t?.sendStoryViewEvent(n),void t?.sendStoryChapterDisplayedEvent(n);if(k(!1),y.current=o,await s.setActiveStory(n,o),await b(i),r)g.current=r;else if(g.current&&n){const e=g.current.getRootNode();g.current=e.querySelector(`[data-story-id="${n}"]`)}}},A=async(t={})=>{if(t.isBackgroundClick&&!a)return;if(await C(!0),!a)return await s.resetAllStories(),await S(e[0]._id,!0),void await C(!1);const{feedTranslateY:n,feedScale:r,backgroundOpacity:o}=t;if(v.current){const{feedPlayer:e,feedBackgroundPlayer:t}=ar(v.current);e&&t&&(d?sr(e,t):await(async(e,t,n,r)=>{const{translateY:o=0,scale:s=1,backgroundOpacity:a=1}=n,{originX:c=50,originY:l=50}=r;e.style.transformOrigin=`${c}% ${l}%`;const d={opacity:[1,0],transform:[`translate3d(0, ${Math.round(o)}px, 0) scale(${s})`,"translate3d(0, 0, 0) scale(0)"]},u=nr(e,d,{duration:.25}),h=nr(t,{opacity:[a,0]},{duration:.25,ease:"easeOut"});await Promise.all([u,h]),await(0,i.c)(),sr(e,t)})(e,t,{translateY:n,scale:r,backgroundOpacity:o},(0,i.s)(g.current)))}await w(!1),t.external||p?.(),await s.resetAllStories()},E=async(e=0)=>{const t=se(n.container);if(v.current){const{prevPlayerContainer:n,playerContainer:i}=ar(v.current);await Promise.all([n?or(n,-1+e,-1,{isMobile:t,isVertical:u}):null,i?or(i,e,0,{isMobile:t,isVertical:u}):null])}},_=async(t={})=>{const i=mo(v.current),r=se(n.container),{currentProgression:o=0}=t;if(await C(!0),y.current<m-1){if(v.current){const{playerContainer:e,nextPlayerContainer:t,next2PlayerContainer:n}=ar(v.current);e&&t&&await Promise.all([or(e,o,-1,{isMobile:r,isVertical:u}),or(t,1+o,0,{isMobile:r,isVertical:u}),n?or(n,2+o,1,{isMobile:r,isVertical:u}):null])}e[y.current+1]&&await S(e[y.current+1]._id,!0)}else await A();await C(!1),u&&await s.resetAllStories(),i()},T=async(t={})=>{const i=mo(v.current),r=se(n.container),{triggerType:o="tap",currentProgression:a=0}=t;if(await C(!0),y.current>0){if(v.current){const{playerContainer:e,prevPlayerContainer:t,nextPlayerContainer:n}=ar(v.current);e&&t&&await Promise.all([or(e,a,1,{isMobile:r,isVertical:u}),or(t,-1+a,0,{isMobile:r,isVertical:u}),n?or(n,1+a,2,{isMobile:r,isVertical:u}):null])}e[y.current-1]&&await S(e[y.current-1]._id,!0)}else"swipe"===o&&await E(a);await C(!1),u&&await s.resetAllStories(),i()},P=async(e,t={})=>{const{feedTranslateY:n,feedScale:i,backgroundOpacity:r,currentProgression:o}=t;switch(e){case"swipe-previous":await T({triggerType:"swipe",currentProgression:o});break;case"swipe-next":await _({triggerType:"swipe",currentProgression:o});break;case"none":await E(o);break;case"swipe-down":await A({feedTranslateY:n,feedScale:i,backgroundOpacity:r})}};return(0,i.p)(()=>{const e=s.subscribe("on-close",A),t=s.subscribe("on-swipe-end",P),n=s.subscribe("on-next-story",_),i=s.subscribe("on-previous-story",T);return()=>{e(),t(),n(),i()}},[u]),{feedEventsController:s,feedPlayerRef:v,setIsActive:w,onClose:A,setIsMuted:x,goToStoryId:S,storiesConfig:e}},go=e=>{switch(e.type){case"cta":return(e=>e.font?.fontUrl?[{fontFamily:e.font?.fontFamily,fontUrl:e.font?.fontUrl}]:[])(e.data);case"form":return(e=>[...e.fontUrl?[{fontFamily:e.fontFamily,fontUrl:e.fontUrl},{}]:[],...e.fontBold?.fontUrl?[{fontFamily:e.fontBold.fontFamily,fontUrl:e.fontBold.fontUrl}]:[]])(e.data);case"binaryPoll":return(e=>[...e.title.font.fontUrl?[{fontFamily:e.title.font.fontFamily,fontUrl:e.title.font.fontUrl}]:[],...e.choices.textValues.font.fontUrl?[{fontFamily:e.choices.textValues.font.fontFamily,fontUrl:e.choices.textValues.font.fontUrl}]:[]])(e.data);case"multiplePoll":return(e=>[...e.title.font.fontUrl?[{fontFamily:e.title.font.fontFamily,fontUrl:e.title.font.fontUrl}]:[],...e.choices.font.fontUrl?[{fontFamily:e.choices.font.fontFamily,fontUrl:e.choices.font.fontUrl}]:[]])(e.data);case"quiz":return(e=>[...e.title.font.fontUrl?[{fontFamily:e.title.font.fontFamily,fontUrl:e.title.font.fontUrl}]:[],...e.answers.font.fontUrl?[{fontFamily:e.answers.font.fontFamily,fontUrl:e.answers.font.fontUrl}]:[]])(e.data);case"shopping":return(e=>[...e.font?.fontUrl?[{fontFamily:e.font.fontFamily,fontUrl:e.font?.fontUrl}]:[],...e.fontBold?.fontUrl?[{fontFamily:e.fontBold.fontFamily,fontUrl:e.fontBold?.fontUrl}]:[]])(e.data);case"reply":return(e=>[...e.font?.fontUrl?[{fontFamily:e.font.fontFamily,fontUrl:e.font?.fontUrl}]:[],...e.fontBold?.fontUrl?[{fontFamily:e.fontBold.fontFamily,fontUrl:e.fontBold?.fontUrl}]:[],...e.fontExtra?.fontUrl?[{fontFamily:e.fontExtra.fontFamily,fontUrl:e.fontExtra?.fontUrl}]:[]])(e.data);default:return[]}},yo=(0,i.G)(null),bo=(0,i.G)(null),wo=({feedPlayer:e,widgetConfig:t,analyticsController:n,analyticsV2Controller:r,container:o,closable:s=!0,autoplay:a=!s,forceSoundInit:h=!1,withBackgroun
1d:f=!1,defaultMute:m=!1,isPreview:v=!1,CustomVideoPlayer:y,showControls:b=!0,blockingInteractions:w=!0,enableTitleFocus:C=!0})=>{const k="vertical"===t.playerType,{isMobile:x,pxRatio:S,isWideMobile:A}=((e,t=!1)=>{const[n,r]=(0,i.h)(()=>se(e)),[o,s]=(0,i.h)(()=>ae(e)),[a,c]=(0,i.h)(()=>ce(n,e)),[l,d]=(0,i.h)(()=>le(e));return(0,i.p)(()=>{const n=()=>{const n=se(e),i=ae(e),o=ce(n,e,t),a=le(e);c(o),r(n),s(i),d(a)};return n(),window.addEventListener("resize",n,{passive:!0}),()=>{window.removeEventListener("resize",n)}},[e]),{isMobile:n,isWideMobile:o,pxRatio:a,screenWidth:l}})(o,k),E=!!o,_=t.showWatermark;(0,i.p)(()=>{r&&r.setStoryPlatform(x?"mobile":"desktop")},[x]);const T=(0,i.F)(()=>(0,i.u)(t,x?"mobile":"desktop"),[t,x]),P=(({stories:e,apiUrl:t,owner:n})=>{const[r,o]=(0,i.h)({}),s=(0,i._)(""),a=(0,i.F)(()=>{const t=[];return(e??[]).forEach(e=>{(e?.interactions??[]).forEach(e=>{if("shopping"!==e?.type)return;const n=(e.data?.products??[]).filter(e=>u(e?.price?.value)).map(e=>(0,i.t)(e)).filter(e=>void 0!==e);t.push(...n)})}),Array.from(new Set(t)).sort()},[e]);return(0,i.p)(()=>{const e=a.filter(e=>!r[e]);if(!t||0===e.length)return;const i=`${n}|${t}|${e.join(",")}`;s.current!==i&&(s.current=i,((e,{owner:t,ids:n})=>{try{const i=((e,t)=>{const n=new URL("shopping/products",e),i=(e,t)=>t&&n.searchParams.set(e,t);return n.searchParams.set("owner",t.owner),n.searchParams.set("ids",t.ids.join(",")),i("country_code",t.countryCode),i("currency_code",t.currencyCode),i("language",t.language),i("source_url",t.sourceUrl),n})(e,{owner:t,ids:n,countryCode:c(),language:d(),currencyCode:l(),sourceUrl:window.location.origin+window.location.pathname});return fetch(i).then(e=>e.json()).then(e=>e.items).catch(()=>null)}catch(e){return console.error(e),Promise.resolve(null)}})(t,{owner:n,ids:e}).then(e=>{if(!e)return;const t={};e.forEach(e=>{t[e.id]=e}),o(e=>({...e,...t}))}))},[t,n,a.join(",")]),r})({stories:T.stories,apiUrl:t.publisherApiUrl,owner:t.owner}),I=vo(T.stories,r,{closable:s,autoplay:a,container:o,forceSoundInit:h,noAnimation:"solo-sticky"===t.type,isVertical:k,isMobile:x},{onClose:e.close,onContentLoading:e.onContentLoading,onContentReady:e.onContentReady}),{feedPlayerRef:L,storiesConfig:M,onClose:V,goToStoryId:F,setIsActive:N}=I,{isVisible:R,setIsVisible:B}=((e,t,n)=>{const{autoplay:r,forceSoundInit:o,defaultMute:s,feedPlayerRef:a,isVertical:c}=n,l=(0,i._)(r),d=(0,i._)(o),u=(0,i._)(()=>{}),h=(0,i._)(()=>{}),p=(0,i._)(()=>{}),f=e=>{l.current=e;const n=a.current?.getRootNode()?.querySelector(".feed-background-overlay");e?(a.current?.classList.remove("hidden"),a.current?.classList.add("visible"),n?.classList.remove("hidden"),n?.classList.add("visible"),u.current=(()=>{const e=document.scrollingElement,t=e instanceof HTMLElement?e.style.touchAction:void 0;return e&&e instanceof HTMLElement?(e.style.touchAction="none",()=>{e.style.touchAction=t??"auto"}):()=>{}})(),c&&(p.current=(e=>{const t=e.feedPlayerRef.current;if(!t)return()=>{};let n=!1,i=0,r=0;const o=t=>{t.stopPropagation();const o=t.composedPath();if(t instanceof WheelEvent&&Math.abs(t.deltaX)>Math.abs(t.deltaY)&&o.some(e=>e instanceof HTMLElement&&e.classList?.contains("interaction-layer"))||(t.preventDefault(),!(t instanceof WheelEvent)))return;const s=Date.now(),a=t.deltaY;Math.abs(a)<25||n||s-r<800||s-i>=200&&(n=!0,i=s,r=s,a>0?e.feedEventsController.onNextStory():e.feedEventsController.onPreviousStory(),setTimeout(()=>{n=!1},800))},s=e=>o(e),a=e=>o(e);return t.addEventListener("wheel",s,{capture:!0,passive:!1}),t.addEventListener("mousewheel",a,{capture:!0,passive:!1}),()=>{t.removeEventListener("wheel",s,{capture:!0}),t.removeEventListener("mousewheel",a,{capture:!0})}})(t),h.current=(()=>{const e=e=>{g(e)||e.preventDefault()};return document.addEventListener("touchmove",e,{capture:!0,passive:!1}),()=>document.removeEventListener("touchmove",e,{capture:!0})})())):(a.current?.classList.remove("visible"),a.current?.classList.add("hidden"),n?.classList.remove("visible"),n?.classList.add("hidden"),u.current?.(),c&&(p.current(),h.current()))};return(0,i.p)(()=>{const{feedPlayerRef:n,setIsMuted:r,goToStoryId:o,setIsActive:a}=t,c=e.subscribe("open",async(e,t)=>
1{if(performance.mark("feed-open - start"),d.current||(await r(s),d.current=!0),f(!0),await(0,i.c)(),await a(!0),n.current){const{feedPlayer:r,feedBackgroundPlayer:o}=ar(n.current);t||await(async(e,t,n)=>{const{originX:r=50,originY:o=50}=n;e.style.transformOrigin=`${r}% ${o}%`;const s=nr(e,{opacity:[0,1],transform:["translate3d(0,0,0) scale(0.01)","translate3d(0,0,0) scale(1)"]},{duration:.25});t&&(t.style.transform="translate3d(0, 0, 0)");const a=t?nr(t,{opacity:[0,1]},{duration:.25,ease:"easeOut"}):null;await Promise.all([s,a]),await(0,i.c)(),e.style.transform="",e.style.transformOrigin="",e.style.opacity="",t&&(t.style.transform="",t.style.opacity="")})(r,o||null,(0,i.s)(e))}performance.mark("feed-open - end"),performance.measure("feed-open","feed-open - start","feed-open - end")},!0),l=e.subscribe("close",async e=>{performance.mark("feed-close - start"),e&&await t.onClose({external:e}),f(!1),performance.mark("feed-close - end"),performance.measure("feed-close","feed-close - start","feed-close - end")},!0),u=e.subscribe("switchToStory",async(e,t)=>{performance.mark("feed-switchToStory - start"),await o(e,!1,t),performance.mark("feed-switchToStory - end"),performance.measure("feed-switchToStory","feed-switchToStory - start","feed-switchToStory - end")}),h=e.subscribe("play",async()=>{performance.mark("feed-play - start"),await a(!0),performance.mark("feed-play - end"),performance.measure("feed-play","feed-play - start","feed-play - end")}),p=e.subscribe("pause",async()=>{performance.mark("feed-pause - start"),await a(!1),performance.mark("feed-pause - end"),performance.measure("feed-pause","feed-pause - start","feed-pause - end")});return()=>{c(),l(),u(),h(),p()}},[s,t,e]),{isVisible:l.current,setIsVisible:f}})(e,I,{autoplay:a,forceSoundInit:h,defaultMute:m,feedPlayerRef:L,isVertical:k});(0,i.p)(()=>window.JoinStories?.subscribe("JOIN_STORIES_CLOSE_PLAYER",e=>{(e===t.alias||!e)&&V()}),[]),(0,i.p)(()=>{if(a){const e=M[0];e&&F(e._id,!1).then(async()=>{await N(!0),B(!0)})}}
1,[a,M]);const O=(({withBackground:e,isVisible:t,feedPlayerRef:n,feedEventsController:r})=>{const o=(0,i._)(null);return(0,i.p)(()=>{if(e&&t)return r.subscribe("active-story-changed",async()=>{if(o.current){await(0,i.c)();const e=o.current.getContext("2d"),t=n.current?.querySelector('.video-content-container[data-content-state="active"] video:not(.fake-video)');t&&e?ho(t,e):setTimeout(()=>{const t=n.current?.querySelector('.video-content-container[data-content-state="active"] video:not(.fake-video)');t&&e&&ho(t,e)},100)}})},[e,t,n]),o})({feedEventsController:I.feedEventsController,feedPlayerRef:L,withBackground:f,isVisible:R}),D=(e=>{const[t,n]=(0,i.h)(!1),r=ie(e);return(0,i.p)(()=>e.subscribe("ad-state-change",e=>{n("no-controls"!==e)})),!r||t})(I.feedEventsController);return(({stories:e})=>{(0,i.p)(()=>{if(e){const t=e.reduce((e,t)=>[...e,...t.interactions.reduce((e,t)=>[...e,...go(t)],[])],[]);[...new Set(t)].forEach(e=>{(0,i.l)(e.fontFamily,e.fontUrl)})}},[e])})({stories:T.stories}),((e,t,n,r=!1)=>{const o=(0,i._)(r),s=(0,i._)();(0,i.p)(()=>{const i=async t=>{t.state?.joinFeedOpen&&!o.current&&t.state?.feedPlayerId===e.id?await(async t=>{t.preventDefault(),t.stopPropagation(),s.current&&e.switchToStory(s.current),await e.open()})(t):!t.state?.joinFeedOpen&&o.current&&(e=>{e.preventDefault(),e.stopPropagation(),n()})(t)},r=()=>{if(o.current=!0,window.history.state?.joinFeedOpen||window.history.state?.feedPlayerId===e.id)return;const t=history.scrollRestoration;history.scrollRestoration="manual",window.history.pushState({joinFeedOpen:!0,feedPlayerId:e.id},""),history.scrollRestoration=t},a=()=>{o.current=!1,window.history.state?.joinFeedOpen&&window.history.state?.feedPlayerId===e.id&&(window.history.back(),navigator.mediaSession&&(navigator.mediaSession.playbackState="none"))},c=e=>{e&&(s.current=e)};return e.subscribe("open",r),e.subscribe("close",a),t.subscribe("active-story-changed",c),window.addEventListener("popstate",i),()=>{e.unsubscribe("open",r),e.unsubscribe("close",a),t.unsubscribe("active-story-changed",c),window.removeEventListener("popstate",i)}},[n])})(e,I.feedEventsController,()=>{r?.sendHistoryBackExitEvent(),I.feedEventsController.onClose()},a),((e,t,n)=>{(0,i.p)(()=>n?.isPreview?()=>{}:t.subscribe("on-chapter-change",(t,n)=>{const r=e.storiesData[t];n===r.pageCount-1&&(0,i.n)(e,r)}),[e._id])})(T,I.feedEventsController,{isPreview:v}),((e,t,n,r=!1)=>{(0,i.p)(()=>{if(!n)return;n.setMuted(r);const e=t.subscribe("on-chapter-change",(e,t)=>{n.setOpenedChapter(e,t),n.sendStoryChapterDisplayedEvent(e)}),i=t.subscribe("on-chapter-complete",e=>{n.sendStoryChapterExitEvent(e,"auto-advance")}),o=t.subscribe("active-story-changed",(e,t)=>{n.setOpenedChapter(e),-1!==t&&(n.setActiveStory(e),n.setFeedVisible(!0),n.sendStoryViewEvent(e),n.sendStoryChapterDisplayedEvent(e))}),s=t.subscribe("on-story-complete",e=>{n.sendStoryCompletedEvent(e)}),a=t.subscribe("is-muted",e=>{n.setMuted(e)});return()=>{e(),i(),o(),s(),a()}},[e._id])})(t,I.feedEventsController,r,m),(0,i.o)(i.I,{css:"*{box-sizing:border-box}:is(button,a):focus-visible{outline:var(--join-player-controls-focus-outline, 2px solid #000)!important}button{font-size:1em;border:none;outline:none;-webkit-tap-highlight-color:transparent}.feed-container{display:block;position:fixed;top:0;left:0;height:100vh;height:100dvh;width:100vw;overflow:hidden;z-index:var(--join-container-index, 2147483647);pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;overscroll-behavior:contain;touch-action:none}.vertical-feed.mobile.feed-container{pointer-events:all}.feed-container.player-3d{perspective:max(100vw,500px)}.feed-container.anchored{height:100%;width:100%}.feed-background-overlay{display:block;position:fixed;inset:0;overflow:hidden;background:#000000b3;z-index:var(--join-container-index, 2147483647);opacity:var(--feed-background-opacity, 1);-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;overscroll-behavior:contain;touch-action:none}.feed-background-overlay.with-background{background:#000}.feed-background-canvas{display:block;position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;background:#000;filter:blur(90px) grayscale(.3)}.feed-horizontal-mobile-background{display:block;position:absolute;top:0;left:0;width:100%;height:100%;max-height:178vw;background:#000;pointer-events:all}.feed-container.anchored,.feed-background-overlay.anchored{position:absolute}.feed-container.hidden,.feed-background-overlay.hidden{position:fixed;top:0;opacity:0;transform:translateZ(0) scale(.01);pointer-events:none}.watermark-link{position:fixed;bottom:4px;right:10px;border-radius:80px;pointer-events:all;transition:right .4s ease-in-out}.is-add-to-cart .watermark-link{right:calc(25% + 10px)}",children:(0,i.o)(yo.Provider,{value:n,children:(0,i.o)(bo.Provider,{value:r,children:(0,i.o)(p,{productsById:P,children:[(0,i.o)("div",{className:`feed-background-overlay ${k?"vertical":""} ${E?"anchored":""} ${R?"visible":"hidden"} ${f?"with-background":""} ${k&&x?"with-background":""}`,onClick:D?e=>
1{if(e.composedPath?.().some(e=>e.classList?.contains("watermark-link")))r?.setExitReason("watermark-click");else{if(!s)return;r?.sendBackgroundExitEvent(),V({isBackgroundClick:!0})}}:()=>{},onWheel:e=>{k&&!x&&e.preventDefault()},children:[f&&(0,i.o)("canvas",{ref:O,className:"feed-background-canvas",width:375,height:667}),!x&&_&&(0,i.o)(uo,{feedController:I,owner:t.owner,widgetId:t._id})]}),(0,i.o)("div",{ref:L,className:`feed-container ${E?"anchored":""} ${R?"visible":"hidden"} ${k?"vertical-feed":"horizontal-feed player-3d"} ${x?"mobile":""}`,style:{"--screen-width":`${window.innerWidth}px`},children:[A&&(0,i.o)("div",{className:"feed-horizontal-mobile-background",onContextMenu:e=>{e.preventDefault()}}),M.map((e,t)=>(0,i.o)(lo,{index:t,closable:s,autoplay:a,isFirst:0===t,isLast:t===M.length-1,widgetConfig:T,storyConfig:e,pxRatio:S,isMobile:x,isPreview:v,feedEventsController:I.feedEventsController,CustomVideoPlayer:y,isVertical:k,showControls:b,blockingInteractions:w,showWatermark:_,enableTitleFocus:C},e._id))]})]})})})})};class Co{constructor(e,t,n,i){this.widgetConfig=e,this.analyticsController=t,this.analyticsV2Controller=n,this.options=i,this.close=this.close.bind(this),this.open=this.open.bind(this),this.subscribe=this.subscribe.bind(this),this.unsubscribe=this.unsubscribe.bind(this),this.switchToStory=this.switchToStory.bind(this),this.play=this.play.bind(this),this.pause=this.pause.bind(this),this.onContentLoading=this.onContentLoading.bind(this),this.onContentReady=this.onContentReady.bind(this),this.destroy=this.destroy.bind(this),this._render(i?.container||null)}_anchor=null;_eventListeners={};ready=!1;_feedAnchor;get id(){return this.widgetConfig._id}get alias(){return this.widgetConfig.alias}setWidgetConfig(e){this.widgetConfig=e,this._updateFeed(this.options?.container||null)}unsubscribe(e,t){this._eventListeners[e]=this._eventListeners[e]?.filter(e=>e!==t)}subscribe(e,t,n){return this._eventListeners[e]=n?[t,...this._eventListeners[e]||[]]:[...this._eventListeners[e]||[],t],()=>this.unsubscribe(e,t)}switchToStory(e,t){this._eventListeners.switchToStory?.forEach(n=>n(e,t))}play(){this._eventListeners.play?.forEach(e=>e())}pause(){this._eventListeners.pause?.forEach(e=>e())}async open(e,t){for await(const n of this._eventListeners.open||[])await n(e,t)}async close(e){for await(const t of this._eventListeners.close||[])await t(e)}onContentLoading(){this.ready=!1,this._eventListeners.onContentLoading?.forEach(e=>e())}onContentReady(){this.ready=!0,this._eventListeners.onContentReady?.forEach(e=>e())}destroy(){this._eventListeners={},this._anchor&&(0,i.B)((0,i.o)(i.k,{}),this._anchor?.shadowRoot||this._anchor),this._anchor?.remove(),this._anchor=null}setContainer(e){this._anchor&&(e?e.appendChild(this._anchor):document.body.appendChild(this._anchor),this._render(e))}_render(e){const{closable:t,autoplay:n,CustomVideoPlayer:r,useShadowDom:o=!0,forceSoundInit:s,defaultMute:a,withBackground:c,isPreview:l,noRender:d,showControls:u,blockingInteractions:h,enableTitleFocus:p}=this.options||{};d||(this._anchor=document.createElement("div"),this._anchor.style.display="block",this._anchor.classList.add("join-feed-anchor"),e?e.appendChild(this._anchor):document.body.appendChild(this._anchor),this._feedAnchor&&(this._feedAnchor.innerHTML=""),this._feedAnchor=o?this._anchor.attachShadow({mode:"open"}):this._anchor,(0,i.B)((0,i.o)(wo,{widgetConfig:this.widgetConfig,feedPlayer:this,analyticsController:l?void 0:this.analyticsController,analyticsV2Controller:l?void 0:this.analyticsV2Controller,container:e,closable:t,autoplay:n,forceSoundInit:s,defaultMute:a,withBackground:c,CustomVideoPlayer:r,isPreview:l,showControls:u,blockingInteractions:h,enableTitleFocus:p}),this._feedAnchor))}_updateFeed(e){if(!this._feedAnchor)return;const{closable:t,autoplay:n,CustomVideoPlayer:r,forceSoundInit:o,defaultMute:s,withBackground:a,isPreview:c,noRender:l,showControls:d,blockingInteractions:u,enableTitleFocus:h}=this.options||{};l||(0,i.B)((0,i.o)(wo,{widgetConfig:this.widgetConfig,feedPlayer:this,analyticsController:c?void 0:this.analyticsController,anal
1yticsV2Controller:c?void 0:this.analyticsV2Controller,container:e,closable:t,autoplay:n,forceSoundInit:o,defaultMute:s,withBackground:a,CustomVideoPlayer:r,isPreview:c,showControls:d,blockingInteractions:u,enableTitleFocus:h}),this._feedAnchor)}}const ko=({onLoad:e})=>((0,i.p)(()=>{window.JoinFeedPlayer=Co,e?.()},[]),null),xo=Object.freeze(Object.defineProperty({__proto__:null,LazyFeed:ko,default:ko},Symbol.toStringTag,{value:"Module"}));n.d(t,["A",0,oo,"L",0,xo,"P",0,h,"T",0,X,"a",0,o,"b",0,D,"i",0,u,"u",0,gr])}}]); 2//# sourceMappingURL=sourcemaps/8207-c71e8f38d2e567a7.bundle.js.map
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.