var Ss=Object.defineProperty,Ts=Object.defineProperties;var Is=Object.getOwnPropertyDescriptors;var bt=Object.getOwnPropertySymbols;var ke=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable;var Yt=(e,t,o)=>t in e?Ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,f=(e,t)=>{for(var o in t||(t={}))ke.call(t,o)&&Yt(e,o,t[o]);if(bt)for(var o of bt(t))$e.call(t,o)&&Yt(e,o,t[o]);return e},S=(e,t)=>Ts(e,Is(t));var Be=(e,t)=>{var o={};for(var s in e)ke.call(e,s)&&t.indexOf(s)<0&&(o[s]=e[s]);if(e!=null&&bt)for(var s of bt(e))t.indexOf(s)<0&&$e.call(e,s)&&(o[s]=e[s]);return o};var y=(e,t,o)=>(Yt(e,typeof t!="symbol"?t+"":t,o),o);var g=(e,t,o)=>new Promise((s,n)=>{var i=d=>{try{a(o.next(d))}catch(c){n(c)}},r=d=>{try{a(o.throw(d))}catch(c){n(c)}},a=d=>d.done?s(d.value):Promise.resolve(d.value).then(i,r);a((o=o.apply(e,t)).next())});const H={pageView:"pageView",sessionStart:"sessionStart",sessionEnd:"sessionEnd",videoPause:"videoPause",videoStart:"videoStart",videoResume:"videoResume",videoReplay:"videoReplay",clickCta:"clickCta",submitInput:"submitInput",collectInfo:"collectInfo",videoResponse:"videoResponse",audioResponse:"audioResponse",imageResponse:"imageResponse",tolstoyClick:"tolstoyClick",chapterSelected:"chapterSelected",chapterPickerOpened:"chapterPickerOpened",videoSeeked:"videoSeeked",shareClick:"shareClick",quizResult:"quizResult",autoplayStart:"autoplayStart"},m={sessionStart:"tolstoyStarted",sessionEnd:"tolstoyReachedEnd",clickCta:"tolstoyAnswerClicked",submitInput:"tolstoyInputSubmit",collectInfo:"tolstoyLeadFormSubmit",videoResponse:"tolstoyVideoSubmit",audioResponse:"tolstoyAudioSubmit",imageResponse:"tolstoyImageSubmit",openGorgias:"tolstoyOpenGorgias",hideGorgias:"tolstoyHideGorgias",openIntercom:"tolstoyOpenIntercom",hideIntercom:"tolstoyHideIntercom",openTawkTo:"tolstoyOpenTawkTo",hideTawkTo:"tolstoyHideTawkTo",openLiveChat:"tolstoyOpenLiveChat",hideLiveChat:"tolstoyHideLiveChat",openHubSpot:"tolstoyOpenHubSpot",hideHubSpot:"tolstoyHideHubSpot",openHelpScout:"tolstoyOpenHelpScout",hideHelpScout:"tolstoyHideHelpScout",openDrift:"tolstoyOpenDrift",hideDrift:"tolstoyHideDrift",openZendesk:"tolstoyOpenZendesk",hideZendesk:"tolstoyHideZendesk"},nl="tolstoyEscapeKeyPressed",bs="tolstoyWatchedProductIds",il="showFeedProductModal",rl="tolstoyWidgets",al="showFeedCartMobile",cl="tolstoyMoveToUrl",ll="tolstoyCloseModalMessage",ao="tolstoyPlayerReady",dl="focusCloseButton",Q={OPEN:"open",CLOSE:"close",PLAY:"play",PAUSE:"pause"},_s=[Q.OPEN,Q.PLAY],Cs=[Q.CLOSE,Q.PAUSE],ul={ready:"tolstoyPreConfigMessengerReady",vodAssetIds:"tolstoyVodAssetIds"},pl="rechargeMessaging",hl="tolstoyRechargeWidgetData",gl="tolstoyRequestRechargeWidgetData",yl="tolstoyRequestRechargeAddToCart",rt={static:"static",dynamic:"dynamic",hoverOver:"hoverOver"},fl={under:"under",over:"over"},As={carousel:"tolstoy-carousel",carouselContainer:"tolstoy-carousel-container",title:"tolstoy-carousel-title",videoCarouselContainer:"tolstoy-video-carousel-container",previousButton:"tolstoy-previous-button",nextButton:"tolstoy-next-button",arrowsContainer:"tolstoy-carousel-arrows-container",videosContainer:"tolstoy-carousel-videos-container",videoContainer:"tolstoy-carousel-video-container",video:"tolstoy-carousel-video",image:"tolstoy-carousel-image",dotsContainer:"tolstoy-dots-container",dot:"tolstoy-dot",playButtonContainer:"tolstoy-play-button-container",controlsContainer:"tolstoy-carousel-controls-container",expandButton:"tolstoy-carousel-expand-button",muteButton:"tolstoy-carousel-mute-button",playButton:"tolstoy-carousel-play-button",tileContainer:"tolstoy-carousel-tile-container",tile:"tolstoy-carousel-tile",centerTile:"tolstoy-carousel-center-tile",tileNameContainer:"tolstoy-tile-name-container",tileNameText:"tolstoy-carousel-tile-name-text",arrowButtonContainer:"tolstoy-carousel-arrow-button-container",arrowButton:"tolstoy-carousel-arrow-button",tileNameHeightPlaceholder:"tolstoy-tile-name-height-placeholder",productTile:"tolstoy-product-tile",productContent:"tolstoy-product-content",productTileImage:"tolstoy-product-tile-image",productTileTitle:"tolstoy-product-tile-title",tileText:"tolstoy-tile-text",variantTile:"tolstoy-product-variant-tile",variantTileIcon:"tolstoy-product-variant-tile-icon",variantTileTitle:"tolstoy-product-variant-tile-title",productTilePrice:"tolstoy-product-tile-price",productTileSubtitle:"tolstoy-product-tile-subtitle",productTileButton:"tolstoy-product-tile-button",productTileArrow:"tolstoy-product-tile-arrow",productTileFallback:"tolstoy-product-tile-fallback",descriptionTile:"tolstoy-description-tile",descriptionTileContent:"tolstoy-description-tile-content",descriptionTileButton:"tolstoy-description-tile-button",progressBarContainer:"tolstoy-carousel-progress-bar-container",progressBar:"tolstoy-carousel-progress-bar"},ml=6,wl=2,El=80,Sl=.3,Tl=80,Il=12,Os=416,bl={DEFAULT:"default",SPOTLIGHT:"spotlight"},_l={product:"product",videoName:"videoName",none:"none"},Cl={shoppableVideoCarousel:"Shoppable Video Carousel",viewProduct:"View Product"},Al={SCROLLS_CAROUSEL:"scrollsCarousel",SCROLLS_VIDEO:"scrollsVideo"},vs={embed:"tolstoy-embed",iframe:"tolstoy-embed-iframe",videoPreview:"tolstoy-embed-video-preview",videoContainer:"tolstoy-embed-video-container",playButtonContainer:"tolstoy-embed-play-button-container",startText:"tolstoy-embed-start-text",startButtonContainer:"tolstoy-embed-start-button-container",startButton:"tolstoy-embed-start-button",embedContainer:"tolstoy-embed-container"},Ol=9/16,Rs={story:"tolstoy-stories",storiesMainContainer:"tolstoy-stories-main-container",storiesContainer:"tolstoy-stories-container",tilesContainer:"tolstoy-stories-tiles-container",tileName:"tolstoy-stories-tile-name",storyTile:"tolstoy-stories-tile",storyImage:"tolstoy-stories-story-image",storyVideo:"tolstoy-stories-story-video",plusTile:"tolstoy-stories-plus-tile",storyName:"tolstoy-stories-story-name",titleContainer:"tolstoy-stories-title",plusTileContainer:"tolstoy-stories-plus-tile-container",previousButton:"tolstoy-stories-previous-button",nextButton:"tolstoy-stories-next-button",onYouButton:"tolstoy-stories-on-you-button",onlyOnYouButton:"tolstoy-stories-only-on-you-button",playButtonContainer:"tolstoy-stories-play-button-container"},Ps=".0000000.jpg",Ls=".avatar",vl=`${Ls}${Ps}`,Rl={static:rt.static,dynamic:rt.dynamic},Ns={responsive:"responsive",fixed:"fixed"},Pl={below:"below",overlay:"overlay"},Ll=Ns.fixed,Nl=8,Ml=80,Ul=8,Dl=240,kl=200,Ms={tile:"tolstoy-tile",tileContainer:"tolstoy-tile-container",video:"tolstoy-tile-video",nativeCaptionsTrack:"tolstoy-tile-native-captions-track",customCaptionsTrack:"tolstoy-tile-custom-captions-track",imageOverlay:"tolstoy-tile-image-overlay",image:"tolstoy-tile-image",controlsOverlay:"tolstoy-tile-controls-overlay",controlsContainer:"tolstoy-tile-controls",playButtonOverlay:"tolstoy-tile-play-button-overlay",playButtonContainer:"tolstoy-tile-play-button-container",playButtonLabelContainer:"tolstoy-tile-play-button-label-container",playButtonLabel:"tolstoy-tile-play-button-label",timebarWrapper:"tolstoy-tile-timebar-wrapper",timebarContainer:"tolstoy-tile-timebar-container",timebar:"tolstoy-tile-timebar",timeIndicator:"tolstoy-tile-time-indicator",muteButton:"tolstoy-tile-mute-button",fullScreenButton:"tolstoy-tile-full-screen-button",togglesContainer:"tolstoy-tile-toggles",captionsButton:"tolstoy-tile-captions-button"},X={collectionTile:"tolstoy-collection-tile",collectionTileHoverWrapper:"tolstoy-collection-tile-hover-wrapper",video:"tolstoy-collection-tile-video",controlsContainer:"tolstoy-collection-tile-controls-container",playButton:"tolstoy-collection-tile-play-button",muteButton:"tolstoy-collection-tile-mute-button"},me={AUTOPLAY:"autoplay",CLICK:"click",HOVER:"hover"},Us={CONSECUTIVELY:"consecutively",SIMULTANEOUSLY:"simultaneously"},$l={LOOP:"loop",PLAY_ONCE:"playOnce"},Ds={PDP:"pdp",PLAY:"play"},Bl="data-tolstoy-collection-tile-key",ks={playMode:me.AUTOPLAY,playVideos:Us.CONSECUTIVELY,autoplayDelay:1,minProductsBetweenVideos:2,mutedByDefault:!1,tileClickMode:Ds.PDP,shouldHideVideoWhenNotPlaying:!0,controls:{play:{enabled:!1,backgroundEnabled:!0,backgroundColor:"#0000004d",borderEnabled:!1,borderColor:"#ffffff",opacity:1},mute:{enabled:!1,backgroundEnabled:!0,backgroundColor:"#0000004d",borderEnabled:!1,borderColor:"#ffffff",opacity:1}}},co="tolstoy-collection-page-tile",re="carousel",$s="inTileCarousel",lo="bubble",ae="stories",ce="embed",xl="onYou",le="tile",uo="centeredModal",ft="collectionTile",po="collectionPageTile",Hl={clickedX:"stopShowingWidgetToClickedX",viewed:"stopShowingWidgetToViewed"},ho={[re]:As.carousel,[ae]:Rs.story,[ce]:vs.embed,[le]:Ms.tile,[ft]:X.collectionTile,[po]:co},Bs="siteActivity",xs="pageVisit",Wl={notAllowedError:"NotAllowedError",abortError:"AbortError"},Hs=1,mt={shop:"shop",appKey:"app-key",productId:"product-id",shouldUseCache:"should-use-cache",cacheVersion:"cache-version"},we={tolstoyAutoOpen:"tolstoyAutoOpen",tolstoyAutoOpenOnYou:"autoOpenOnYou",tolstoyStartVideo:"tolstoyStartVideo",tolstoyMoneyFormat:"tolstoyMoneyFormat"},Ws="PRODUCT_ID",Vl={TOP:"top",BOTTOM:"bottom"},T={embedView:"embedView",embedPlay:"embedPlay",embedPause:"embedPause",embedMute:"embedMute",embedUnmute:"embedUnmute",embedExpand:"embedExpand",tolstoyModalClose:"tolstoyModalClose",feedProductModalOpen:"feedProductModalOpen",feedProductModalClose:"feedProductModalClose",videoLoaded:"videoLoaded",pageView:"pageView",clickViewProduct:"clickViewProduct",openProductPageClick:"openProductPageClick",feedPlay:"feedPlay",feedPause:"feedPause",videoMuted:"videoMuted",videoUnmuted:"videoUnmuted",videoWatched:"videoWatched",openShareLink:"Open Share Link",feedNavigationArrowClick:"feedNavigationArrowClick",feedScroll:"feedScroll",sessionStart:"sessionStart",tolstoyStarted:"tolstoyStarted",abTestInitialized:"abTestInitialized",onYouClick:"onYouClick"},go="https://api.gotolstoy.com",Ee="https://apilb.gotolstoy.com",yo="https://cf-apilb.gotolstoy.com",Vs="https://player.gotolstoy.com",Fs="https://play.gotolstoy.com/widget-v2/index.onyou-fullscreen.html",Fl="https://play.gotolstoy.com/hero",de="widget.gotolstoy.com",fo="https://videos.gotolstoy.com",Ys="https://api.gotolstoy.com/migrations/recreate-video",Gs="https://analytics-v2.gotolstoy.com/site-activity",js=e=>{var t;return e!=null&&e.length?`${(t=e[0])==null?void 0:t.toUpperCase()}${e==null?void 0:e.slice(1)}`:""},V=e=>{var o;if(!("URLSearchParams"in window))return null;try{return new URLSearchParams((o=window.location)==null?void 0:o.search).get(e)}catch(s){if(s)return null}},Yl=(e,t)=>Math.floor(Math.random()*(t-e+1))+e,mo=()=>{const e=t=>{const o=Math.floor(Math.random()*16);return(t==="x"?o:o&3|8).toString(16)};return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e)},wo=()=>V("td")==="true",xt=(...e)=>{wo()&&console.log(...e)},Eo=e=>{wo()&&console.error(e)},Ks=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Gl=()=>Ks()||window.screen.width<=450||window.screen.height<=450,jl=(e,t=300)=>{let o;return(...s)=>{clearTimeout(o),o=setTimeout(()=>{e(...s)},t)}},Kl=(e=0)=>g(void 0,null,function*(){return new Promise(t=>{setTimeout(t,e)})}),ql=(e,t=1)=>{const o=Number(e);return Number.isNaN(o)?0:Number.isInteger(o)?o:Number.parseFloat(o.toFixed(t))},zl=e=>e.replace(/<[^>]*>?/gm,""),qs=e=>e==null,Zl=e=>{const t=Math.floor(e/60),o=Math.floor(e%60);return`${t}:${o.toString().padStart(2,"0")}`},N=()=>{var e,t;return((t=(e=window.Shopify)==null?void 0:e.customerPrivacy)==null?void 0:t.currentVisitorConsent().analytics)!=="no"},zs=e=>{const t=/^[\da-f]{8}-[\da-f]{4}-[0-5][\da-f]{3}-[089ab][\da-f]{3}-[\da-f]{12}$/i;return e==null?void 0:e.match(t)},So=e=>_s.includes(e),Zs=e=>Cs.includes(e),Qs=(e,t)=>{const o=e.src;return new URL(o).searchParams.get(t)},Xs=(e,t)=>e.getAttribute(`data-${t}`),et=e=>{const t=document.querySelectorAll(`script[src*="${de}"]`);for(const o of t){const s=Xs(o,e)||Qs(o,e);if(s)return s}},Js=e=>{var o;const t=(o=e==null?void 0:e.dataset)==null?void 0:o.productId;return t==="{{ product.id }}"?null:t},Ht=()=>{const e=et(mt.productId);if(e)return e;const{stories:t,carousel:o,embed:s,tile:n}=ho,i=document.querySelectorAll(`.${t}, .${o}, .${s}, .${n}`);for(const r of i){const a=Js(r);if(a)return a}},To=()=>et(mt.shouldUseCache)==="true",K=()=>et(mt.cacheVersion),tn="www.",Io=new RegExp("^((([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[\\-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9\\.\\-]+|(?:www\\.|[\\-;:&=\\+\\$,\\w]+@)[A-Za-z0-9\\.\\-]+)((?:\\/[\\+~%\\/\\.\\w\\-_]*)?\\??(?:[\\-\\+=&;%@\\.\\w_]*)#?(?:[\\.\\!\\/\\\\\\w]*))?)","i"),xe=e=>e?!!Io.test(e)||e.startsWith("tel:")||e.startsWith("mailto:")||e.startsWith("_self:"):!1,He=e=>{const t=e.replace(tn,""),o=new URL(t);return`${o.origin}${o.pathname}${o.search}`},Ql=(e,t)=>!xe(e)||!xe(t)?!1:He(e)===He(t),en=()=>{const e=new URLSearchParams(window.location.search),t=new URLSearchParams;for(const[o,s]of e){const n=o.toLowerCase();o.length<50&&s.length<100&&(n.startsWith("custom_")||n.startsWith("utm_"))&&t.append(o,s)}return t},wt=(e={})=>{const t=new URLSearchParams;for(const[o,s]of Object.entries(e))s!=null&&s!==""&&t.append(o,s);return t.toString()},Xl=e=>Io.test(e),Jl=e=>new URLSearchParams(window.location.search).get("tolstoy")===e;let _t="";function R(){return window.tolstoyAppKey||_t?window.tolstoyAppKey||_t:(_t=et(mt.appKey),_t)}const on=4e3;let bo=!1;const ue=[],sn=()=>{for(;ue.length>0;){const{eventFunction:e,args:t}=ue.shift();e(...t)}};setTimeout(()=>{bo=!0,sn()},on);const Se=e=>(...t)=>{if(bo)return e(...t);ue.push({eventFunction:e,args:t})};function Et(){return et(mt.shop)}const St=()=>{var e;return(e=window.tolstoySettings)!=null&&e.shouldUseCache?yo:Ee},nn=()=>g(void 0,null,function*(){var a,d;const e=R(),t=((a=window.Shopify)==null?void 0:a.shop)||Et(),o=To(),s=K(),n=o?yo:Ee;let i,r;window.widget_V1_AccountSettingsPromise=new Promise((c,u)=>{i=c,r=u});try{const c=new URL(`${n}/actions/accounts/${e}`);s&&c.searchParams.set("v",s),t&&c.searchParams.set("appUrl",t);const p=yield(yield fetch(c.toString())).json();return i(p),p}catch(c){r(c),(d=window.tolstoyCaptureError)==null||d.call(window,c,"Error loading account settings:")}}),rn=e=>g(void 0,null,function*(){var t;try{return N()?(yield fetch(`${go}/identify/identify`,{method:"POST",body:JSON.stringify({data:e})})).json():void 0}catch(o){(t=window.tolstoyCaptureError)==null||t.call(window,o,"Error updating identification:")}}),td=(e,t)=>g(void 0,null,function*(){var r;const o=Ht(),s=St(),n=K(),i=wt({widgetType:t,productId:o,publishId:e,v:n});try{return(yield fetch(`${s}/settings/widget/by-publish-id?${i}`)).json()}catch(a){(r=window.tolstoyCaptureError)==null||r.call(window,a,"Error loading config:")}}),an=e=>g(void 0,null,function*(){var n;const t=St(),o=K(),s=wt(S(f({},e),{url:`${window.location.origin}${window.location.pathname}`,v:o}));try{return(yield fetch(`${t}/settings/widget/by-product-url?${s}`)).json()}catch(i){(n=window.tolstoyCaptureError)==null||n.call(window,i,"Error getting product page config:")}}),cn=e=>g(void 0,null,function*(){var n;const t=St(),o=K(),s=wt(S(f({},e),{v:o}));try{return(yield fetch(`${t}/settings/widget/by-product-id?${s}`)).json()}catch(i){(n=window.tolstoyCaptureError)==null||n.call(window,i,"Error getting product page config:")}}),ln=(e,t)=>g(void 0,null,function*(){var i,r;const o=St(),s=K(),n=wt({appKey:e,collectionId:t,v:s});try{const d=yield(yield fetch(`${o}/settings/widget/get-collection-tile-config?${n}`)).json();if(Array.isArray(d)&&d.some(c=>c.project&&c.collectionId)){const c=((i=window.Shopify)==null?void 0:i.shop)||Et();return d.filter(u=>u.project.appUrl===c)}}catch(a){(r=window.tolstoyCaptureError)==null||r.call(window,a,"Error getting collection tile config:")}return[]}),dn=e=>g(void 0,null,function*(){var o;const t=new URLSearchParams(e);try{return(yield fetch(`${Ee}/settings/bubble?${t.toString()}`)).json()}catch(s){(o=window.tolstoyCaptureError)==null||o.call(window,s,"Error getting bubble settings:")}}),ed=(e,t)=>g(void 0,null,function*(){var i;const o=St(),s=K(),n=wt({publishId:e,collectionId:t,v:s});try{return(yield fetch(`${o}/settings/collection-page-tile-config?${n}`)).json()}catch(r){(i=window.tolstoyCaptureError)==null||i.call(window,r,"Error getting collection page tile config:")}}),_o=e=>g(void 0,null,function*(){var t;if(window.location.origin!=={}.VITE_BASE_URL&&N())try{return yield fetch(`${go}/events/event`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)})}catch(o){(t=window.tolstoyCaptureError)==null||t.call(window,o,"Error sending page view:")}}),pe=Se(_o),od=e=>g(void 0,null,function*(){var t;try{return yield fetch(`${Ys}?publishId=${e}`)}catch(o){(t=window.tolstoyCaptureError)==null||t.call(window,o)}}),un=e=>{const t=e==null?void 0:e.siteActivity;return!t||t===""||Object.keys(t).length===0?!1:Object.values(t).some(o=>(o==null?void 0:o.totalTime)>0)},pn=Se(e=>{var t;if(un(e)&&N())try{window.navigator.sendBeacon(Gs,JSON.stringify(e))}catch(o){const s="Error occurred in createSiteActivityEvent";console.error(s,o),(t=window.tolstoyCaptureError)==null||t.call(window,o,s)}}),hn=Se(e=>{}),gn="custom-blocks.tapcart.com",Tt=()=>{var e,t,o;return!!((e=window==null?void 0:window.Tapcart)!=null&&e.isInitialized||(o=(t=document.location)==null?void 0:t.host)!=null&&o.includes(gn))},Co=()=>{var t,o,s;const e=(s=(o=(t=window==null?void 0:window.Tapcart)==null?void 0:t.variables)==null?void 0:o.device)==null?void 0:s.id;return e==null?void 0:e.toLowerCase()},Ao=()=>{var e,t;return((t=(e=window==null?void 0:window.location)==null?void 0:e.hostname)==null?void 0:t.includes)&&window.location.hostname.includes("app.tapcart.com")},Te={TOLSTOY_HIDE_WIDGET_STORAGE_KEY:"tolstoy-hide-widget",TOLSTOY_SESSION_ID_KEY:"tolstoy-session-id",TOLSTOY_SESSION_UNIQUE_ID_KEY:"tolstoy-session-unique-id",TOLSTOY_PRODUCT_RECOMMENDATIONS:"tolstoy-product-recommendation",TOLSTOY_ANONYMOUS_ID:"tolstoy-anonymousId",TOLSTOY_REPLY:"tolstoy-reply",TOLSTOY_GROUP:"tolstoy-group",TOLSTOY_PUBLISH_ID:"tolstoy-publishId",TOLSTOY_ACTIVITY_KEY:"tolstoy-activity",TOLSTOY_NOT_VISIBLE_OPENED_PUBLISH_ID_KEY:"tolstoy-not-visible-opened-publish-id",TOLSTOY_INTERACTION_DATE:"tolstoy-interaction-date",IS_SHOPIFY_CART_ANONYMOUS_ID_SET_KEY:"tolstoy-is-shopify-cart-anonymous-id-set",TOLSTOY_COOKIE_POLICY:"tolstoy-cookie-policy",TOLSTOY_RECREATE_RESOLUTIONS_PREFIX:"tolstoy-recreate-resolutions",TOLSTOY_AB_TEST_GROUP:"tolstoy-ab-test-group"},Wt={accepted:"accepted",rejected:"rejected"},b={IDENTIFY_INFO_ID_KEY:"identifyInfoId",SESSION_COUNTER_KEY:"tolstoySessionCounter",LAST_SEEN_AT_KEY:"tolstoyLastSeenAtKey",FIRST_SEEN_AT_KEY:"tolstoyFirstSeenAtKey",TOLSTOY_VIEWERS_KEY:"tolstoyViewers",TOLSTOY_VIEWED_PRODUCTS:"tolstoyViewedProducts",CURRENT_CUSTOMER_EMAIL_KEY:"tolstoyCurrentCustomer",BUBBLE_TEXT_PREFIX:"bubbleText",NOTIFICATION_BADGE_PREFIX:"notificationBadge",RECREATE_NEW_RESOLUTION_PREFIX:"reCreateNewResolution"},Nt={TOLSTOY_INTERACTION:"_td_key_c",TOLSTOY_IS_ADDED_FROM_TOLSTOY_VARIANT_IDS:"_td_v_id"},{TOLSTOY_COOKIE_POLICY:Oo}=Te;function Mt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.trunc(Math.random()*16);return(e==="x"?t:t&3|8).toString(16)})}function q(e){var t;try{return e()}catch(o){return(t=window.tolstoyCaptureError)==null||t.call(window,o),null}}function F(e){return q(()=>window.sessionStorage.getItem(e))}function M(e){return q(()=>localStorage.getItem(e))||F(e)}function yn(e){return q(()=>{const t=document.cookie.split("; ").find(o=>o.startsWith(`${e}=`));return t?decodeURIComponent(t.split("=")[1]):null})}function J(e){return M(e)||F(e)||yn(e)}function Y(e,t,o=!1){q(()=>{if(!(Ie()===Wt.rejected&&!o))return window.sessionStorage.setItem(e,t)})}function L(e,t,o=!1){q(()=>{if(Ie()!==Wt.rejected)return localStorage.setItem(e,t);if(o)return window.sessionStorage.setItem(e,t)})}function z(e,t,o=!1){q(()=>{if(Ie()!==Wt.rejected)return localStorage.setItem(e,t);if(o)return window.sessionStorage.setItem(e,t)})}function fn(e){return q(()=>window.sessionStorage.removeItem(e))}const Ie=()=>J(Oo),mn=e=>{z(Oo,e,!0)},vo=(e,t,o)=>{const s=window.location.host,n=o?`max-age=${o}; `:"",i="Secure; ",r="SameSite=None; ",a=`${e}=${encodeURIComponent(t)}; path=/; ${n}${i}${r}`;document.cookie=a+`domain=.${s}; `},Ro=e=>{const t=window.location.host;document.cookie=`${e}=; path=/; domain=.${t}; expires=Thu, 01 Jan 1970 00:00:00 UTC;`,document.cookie=`${e}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC;`},Pt=e=>[...Object.values(Te),...Object.values(b)].some(o=>e.includes(o));function wn(){const e=document.cookie.split("; ");for(const t of e){const[o]=t.split("=");Pt(o.trim())&&Ro(o)}for(const t in localStorage)Pt(t)&&localStorage.removeItem(t);for(const t in sessionStorage)Pt(t)&&sessionStorage.removeItem(t)}const En=()=>{const e=document.cookie.split("; ");for(const t of e){const[o]=t.split("=");Pt(o.trim())&&Ro(o)}};En();const{TOLSTOY_HIDE_WIDGET_STORAGE_KEY:be,TOLSTOY_SESSION_ID_KEY:_e,TOLSTOY_SESSION_UNIQUE_ID_KEY:Po,TOLSTOY_PRODUCT_RECOMMENDATIONS:Sn,TOLSTOY_ANONYMOUS_ID:Lo,TOLSTOY_REPLY:Tn,TOLSTOY_GROUP:sd,TOLSTOY_PUBLISH_ID:In,TOLSTOY_ACTIVITY_KEY:Vt,TOLSTOY_NOT_VISIBLE_OPENED_PUBLISH_ID_KEY:No,TOLSTOY_INTERACTION_DATE:We,IS_SHOPIFY_CART_ANONYMOUS_ID_SET_KEY:Mo,TOLSTOY_RECREATE_RESOLUTIONS_PREFIX:nd,TOLSTOY_AB_TEST_GROUP:Uo}=Te,Do=60*60*24*30;function he(e){return e?`${We}-${e}`:We}function bn(){return J(Lo)}function _n(e){!e||["undefined","false"].includes(e)||z(Lo,e)}function tt(){let t=(Tt()?Co():null)||bn()||Mt();return t==="false"&&(t=Mt()),_n(t),t}function Cn(e){z(In,e,!0)}function Ut(){return JSON.parse(F(Vt)||"{}")}function ko({publishId:e,timeStamp:t,type:o,sessionId:s}){const n=Ut()||{},i=n[e]||[];n[e]=[...i,{timeStamp:t,type:o,sessionId:s}],Y(Vt,JSON.stringify(n),!0)}const An=({publishId:e,productId:t})=>{const o=vn(),s=o[t]||[],n={interactionDate:new Date().toISOString(),publishId:e,productId:t};s.push(n),o[t]=s,Rn(o)},On=()=>{Y(Vt,"{}",!0)};function id(e){z(Tn,e)}function rd(){z(Sn,!0)}const Gt=()=>JSON.parse(M(b.TOLSTOY_VIEWERS_KEY)||"{}"),vn=()=>JSON.parse(J(b.TOLSTOY_VIEWED_PRODUCTS)||"{}"),Rn=e=>{z(b.TOLSTOY_VIEWED_PRODUCTS,JSON.stringify(e))},jt=e=>{L(b.TOLSTOY_VIEWERS_KEY,JSON.stringify(e))};function Pn(e){return J(he(e))||J(he())}function Ln(e){L(b.IDENTIFY_INFO_ID_KEY,e)}function Nn(){return M(b.IDENTIFY_INFO_ID_KEY)}function Mn(){localStorage.removeItem(b.IDENTIFY_INFO_ID_KEY)}const Un=e=>{L(b.SESSION_COUNTER_KEY,e)},$o=()=>Number(M(b.SESSION_COUNTER_KEY)),Dn=e=>{L(b.FIRST_SEEN_AT_KEY,e)},Bo=()=>M(b.FIRST_SEEN_AT_KEY);function kn(e,t){const o=new Date().toISOString();z(he(e),o),$n(t)}const $n=e=>{vo(Nt.TOLSTOY_INTERACTION,JSON.stringify({anonymousId:tt(),appUrl:e}),Do),L(Nt.TOLSTOY_INTERACTION,JSON.stringify({anonymousId:tt(),appUrl:e}),!0)},Bn=()=>{const e=J(b.TOLSTOY_IS_ADDED_FROM_TOLSTOY_VARIANT_IDS);return JSON.parse(e||"[]")},Ve=e=>{try{const t=Bn();t.includes(e)||t.push(`${e}`),L(Nt.TOLSTOY_IS_ADDED_FROM_TOLSTOY_VARIANT_IDS,JSON.stringify(t),!0),vo(Nt.TOLSTOY_IS_ADDED_FROM_TOLSTOY_VARIANT_IDS,JSON.stringify(t),Do)}catch(t){}},xo=e=>F(`${be}-${e}`),ad=e=>Y(`${be}-${e}`,"true",!0),cd=e=>window.sessionStorage.removeItem(`${be}-${e}`),Ce=()=>F(_e),Ho=e=>Y(_e,e,!0),ld=()=>fn(_e),Ae=()=>{const e=F(Po);return e||xn()},xn=()=>{const e=Mt();return Y(Po,e,!0),e},Hn=()=>{const e=F(No);return!e||e==="null"?null:e},Oe=e=>Y(No,e,!0),Wn=(e,t)=>{const o=Ut()||{},s=o[e]||[];if(!(s!=null&&s.length))return;const n=s[s.length-1];n.sessionId=t,Y(Vt,JSON.stringify(o),!0)},Vn=()=>F(Mo),Fn=e=>Y(Mo,e),dd=(e,t)=>L(`${b.NOTIFICATION_BADGE_PREFIX}-${e}`,t,!0),ud=e=>M(`${b.NOTIFICATION_BADGE_PREFIX}-${e}`),pd=(e,t,o)=>L(`${b.BUBBLE_TEXT_PREFIX}-${e}-${t}`,o,!0),hd=(e,t)=>M(`${b.BUBBLE_TEXT_PREFIX}-${e}-${t}`),gd=(e,t)=>L(`${b.RECREATE_NEW_RESOLUTION_PREFIX}-${e}`,t,!0),yd=e=>M(`${b.RECREATE_NEW_RESOLUTION_PREFIX}-${e}`),Yn=(e,t)=>L(`${Uo}-${e}`,t,!0),Gn=e=>M(`${Uo}-${e}`),jn=1e3*60*60*24,st=e=>`tolstoy${js(e)}`,Kt=e=>{N()&&(qn(e),Kn(e))},Kn=e=>{const{data:{name:t,text:o,facebookAnalyticsID:s,playlist:n,collectInfoType:i}}=e;if(!window.fbq||!s||!n)return;const r=`tolstoy-${n}`;switch(t){case m.sessionStart:x(s,`${r}-click`,{value:"Start Tolstoy"});break;case m.clickCta:x(s,`${r}-click`,{value:o});break;case m.submitInput:x(s,`${r}-input`,{value:o});break;case m.collectInfo:x(s,`${r}-${H.collectInfo}`,{value:i});break;case m.videoResponse:x(s,`${r}-${H.videoResponse}`);break;case m.imageResponse:x(s,`${r}-${H.imageResponse}`);break;case m.audioResponse:x(s,`${r}-${H.audioResponse}`);break;case H.sessionEnd:x(s,`${r}-${H.sessionEnd}`);break}},x=(e,t,o)=>{window.fbq("trackSingleCustom",e,t,o)},qn=e=>{const{data:{name:t,text:o,googleAnalyticsID:s,playlist:n,collectInfoType:i,productNames:r,totalTime:a,videoName:d,type:c,direction:u}}=e;if(!window.gtag&&!window.dataLayer&&!window.ga||!s||!n)return;const p=`tolstoy-${n}`;switch(t){case T.pageView:break;case H.sessionStart:case m.sessionStart:O(s,p,m.sessionStart),O(s,p,"click","Start Tolstoy");break;case m.clickCta:O(s,p,t,o);break;case m.collectInfo:O(s,p,t,i);break;case m.submitInput:case m.imageResponse:case m.audioResponse:case m.videoResponse:case m.sessionEnd:O(s,p,t);break;case T.tolstoyModalClose:O(s,p,T.tolstoyModalClose,a);break;case T.videoLoaded:r&&O(s,p,"tolstoyVideoLoaded-products",r),O(s,p,"tolstoyVideoLoaded-videoName",d);break;case T.feedProductModalOpen:case T.feedProductModalClose:case T.clickViewProduct:case T.openProductPageClick:O(s,p,st(t),r);break;case T.feedPlay:case T.feedPause:case T.videoMuted:case T.videoUnmuted:case T.videoWatched:O(s,p,st(t),d);break;case T.openShareLink:O(s,p,st("openShareLink"),c);break;case T.feedNavigationArrowClick:case T.feedScroll:O(s,p,st(t),u);break;default:O(s,p,st(t),o)}},O=(e,t,o,s)=>{N()&&(window.gtag?window.gtag("event",o,{event_category:t,event_label:s,send_to:e}):window.dataLayer&&window.dataLayer.push({event:o,event_category:t,event_label:s,send_to:e}))},ge={},qt=(e,t)=>{ge[e]=ge[e]||t};let Fe=!1;const zn=()=>{var e;if(!Fe)try{const t=R();Zn({appKey:t}),Fe=!0}catch(t){console.error(t),(e=window.tolstoyCaptureError)==null||e.call(window,t)}},Zn=({appKey:e}={})=>{let t=0,o=!1;if(Oe(null),!zs(e))return;const s=({now:n,performanceNow:i})=>{var I;o=!1;let r=Ut();ei(n,r),r=Ut();const a=Math.round(i-t),d=Ae(),c=Qn(r),u=window.location.href.split("?")[0],p=Ht(),w={appKey:e,sessionUniqueId:d,timestamp:new Date().toISOString(),anonymousId:tt(),storeUrl:(I=window.Shopify)==null?void 0:I.shop,siteActivity:c,eventName:Bs,timeOnPage:a,pageUrl:u,currentPageProductId:p};pn(w),o=!0,On()};document.addEventListener("visibilitychange",()=>{var n;try{const i=Date.now(),r=window.performance.now();document.visibilityState==="visible"&&(t=r,o=!1,ti(i)),document.visibilityState==="hidden"&&!o&&s({now:i,performanceNow:r})}catch(i){console.error(i),(n=window.tolstoyCaptureError)==null||n.call(window,i)}}),window.addEventListener("beforeunload",()=>{var n;if(!o)try{const i=Date.now(),r=window.performance.now();s({now:i,performanceNow:r})}catch(i){console.error(i),(n=window.tolstoyCaptureError)==null||n.call(window,i)}})},Qn=e=>{const t={};for(const[o,s]of Object.entries(ge)){const n=e[o];!(n!=null&&n.length)&&!t[o]&&(t[o]={activity:{},totalTime:0,impression:s});const i=Xn({publishId:o,activities:n});let r=0;for(const a of Object.values(i))r+=a;t[o]={activity:i,totalTime:r,impression:s}}return t},Xn=({publishId:e,activities:t})=>{if(!e||!(t!=null&&t.length))return{};const o=Date.now(),s={},n={};for(const{timeStamp:i,type:r,sessionId:a}of t)n[a]=n[a]||0,s[a]===void 0&&(s[a]=!1),So(r)&&!s[a]&&(s[a]=!0,n[a]-=i),Zs(r)&&s[a]&&(s[a]=!1,n[a]+=i);for(const[i,r]of Object.entries(s))r&&(n[i]+=o),(n[i]<=0||n[i]>jn)&&delete n[i];return n},Jn=e=>{var t;return(t=Object.entries(e).find(([o,s])=>{if(s.length===0)return;const n=s[s.length-1].type;return So(n)}))==null?void 0:t[0]},ti=e=>{const t=Hn(),o=Ce();!t||!o||(ko({publishId:t,timeStamp:e,type:Q.OPEN,sessionId:o}),Oe(null))},ei=(e,t)=>{const o=Jn(t),s=Ce();!o||!s||(ko({publishId:o,timeStamp:e,type:Q.CLOSE,sessionId:s}),Oe(o))},Wo=()=>{var n;const e=R();if(!e)return;const t=window.location.href.split("?")[0],o=Ht(),s={appKey:e,sessionUniqueId:Ae(),createdAt:new Date().toISOString(),anonymousId:tt(),appUrl:(n=window.Shopify)==null?void 0:n.shop,eventName:xs,parentUrl:t,currentPageProductId:o};hn(s)},oi=()=>{const e=new CustomEvent("tolstoyWidgetReady");window.dispatchEvent(e)},fd=()=>{const e=new CustomEvent(ao);window.dispatchEvent(e)},Dt={PDP_CAROUSEL:"pdp-carousel",VIDEO_PAGE:"video-page"},W={HEADER:"header",HEADER_AND_BOTTOM_NAVBAR:"header-and-bottom-navbar",CUSTOM_SCREEN:"custom-screen",CUSTOM_SCREEN_AND_BOTTOM_NAVBAR:"custom-screen-and-bottom-navbar"},ve=e=>document.documentElement.style.setProperty("height",`${e}px`,"important"),si=()=>navigator.userAgent.toLowerCase().includes("android"),ni=e=>{const t=window.screen.availHeight,o=window.Tapcart.variables.device.windowHeight;switch(e){case W.HEADER:return o;case W.HEADER_AND_BOTTOM_NAVBAR:return o;case W.CUSTOM_SCREEN:return t-100;case W.CUSTOM_SCREEN_AND_BOTTOM_NAVBAR:return t-184;default:return o||t}},ii=e=>{const t=window.screen.availHeight,o=window.Tapcart.variables.device.windowHeight;switch(e){case W.HEADER:return o;case W.HEADER_AND_BOTTOM_NAVBAR:return o-75;case W.CUSTOM_SCREEN:return t-90;case W.CUSTOM_SCREEN_AND_BOTTOM_NAVBAR:return t-175;default:return o||t}},ri=e=>si()?ni(e):ii(e),ai=(e,t)=>{const o=ri(t.navType);ve(o)},ci=e=>` `,li=(e={})=>{const{height:t=490}=e;let o=0;const s=setInterval(function(){o++;const n=document.querySelector(".tolstoy-carousel-container"),i=document.querySelector(".tolstoy-carousel");n&&i?(i.style.display="block",ve(t),clearInterval(s)):o>=50&&clearInterval(s)},200)},di=(e,t)=>{ve(0),li(t)},ui=e=>{var o,s,n;const t=(n=(s=(o=window==null?void 0:window.Tapcart)==null?void 0:o.variables)==null?void 0:s.product)==null?void 0:n.id;return` `},pi=(e,t)=>g(void 0,null,function*(){switch(t.blockType){case Dt.PDP_CAROUSEL:di(e,t);break;case Dt.VIDEO_PAGE:ai(e,t);break}}),hi=`
Tolstoy widget will appear here.
Click on preview in top right to see widget.
`,gi=()=>g(void 0,null,function*(){const e=document.querySelectorAll("tolstoy-block");if(e.length!==0){if(Ao()){for(const t of Array.from(e))t.outerHTML=hi;return}for(const t of Array.from(e)){const{publishId:o,blockType:s,navType:n,height:i}=t.dataset||{},r={blockType:s,navType:n,height:i};let a="";switch(s){case Dt.PDP_CAROUSEL:a=ui(o);break;case Dt.VIDEO_PAGE:a=ci(o);break}a&&(t.outerHTML=a,pi(t,r))}}}),yi=function(){const t=typeof document!="undefined"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}(),fi=function(e){return"https://widget.gotolstoy.com/we/"+e},Ye={},P=function(t,o,s){if(!o||o.length===0)return t();const n=document.getElementsByTagName("link");return Promise.all(o.map(i=>{if(i=fi(i),i in Ye)return;Ye[i]=!0;const r=i.endsWith(".css"),a=r?'[rel="stylesheet"]':"";if(!!s)for(let u=n.length-1;u>=0;u--){const p=n[u];if(p.href===i&&(!r||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const c=document.createElement("link");if(c.rel=r?"stylesheet":yi,r||(c.as="script",c.crossOrigin=""),c.href=i,document.head.appendChild(c),r)return new Promise((u,p)=>{c.addEventListener("load",u),c.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>t()).catch(i=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=i,window.dispatchEvent(r),!r.defaultPrevented)throw i})},Vo=({tagName:e,src:t,container:o,attributes:s,style:n,styleString:i,classNames:r,eventListeners:a})=>{const d=document.createElement(e);if(a)for(const[c,u]of Object.entries(a))d.addEventListener(c,u);if(t&&(d.src=t),s)for(const[c,u]of Object.entries(s))d.setAttribute(c,u);if(i&&(d.style.cssText=i),n)for(const[c,u]of Object.entries(n))d.style[c]=u;return r&&d.classList.add(...r),o&&o.append(d),d},Ge=({src:e,container:t,attributes:o})=>Vo({tagName:"script",src:e,container:t,attributes:o}),md=({src:e,container:t,attributes:o,style:s})=>Vo({tagName:"iframe",src:e,container:t,attributes:o,style:s}),mi=({callback:e,classNames:t})=>{const o=c=>t.some(u=>c.getElementsByClassName(u).length>0),s=c=>t.includes(c),n=c=>[...c.classList].some(s),i=c=>c.classList?n(c)||o(c):!1,r=c=>c.type!=="childList"||c.addedNodes.length===0?!1:[...c.addedNodes].some(i),a=c=>{c.some(r)&&e()};new window.MutationObserver(a).observe(document.body,{subtree:!0,childList:!0})},wi=({callback:e})=>{window.addEventListener("DOMContentLoaded",e),window.addEventListener("load",e)},Fo=({callback:e,classNames:t})=>{wi({callback:e}),"MutationObserver"in window&&mi({callback:e,classNames:t})},wd=({video:e,onError:t})=>{var i;if(!e)return Promise.reject(new Error("No video element"));const o=/iPad|iPhone|iPod/.test(navigator.userAgent),s=Number.parseFloat(((i=navigator.userAgent.match(/OS (\d+)_/))==null?void 0:i[1])||"0");return o&&s>=18&&e.readyState<1&&e.load(),e.play().catch(r=>(console.warn("Video play failed:",r),t&&t(r),Promise.reject(r)))},Ei=e=>{const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstChild},Si=(e,t)=>`${e}-${t}`,Ti=(e,t)=>`[data-tolstoy-element="${Si(e,t)}"]`,Ed=(e,t)=>window.document.querySelector(Ti(e,t)),Sd=(e,t)=>`[${e}="${t}"]`,Td=(e,t)=>window.document.querySelector(`[${e}="${t}"]`),Id=` `,bd=(e="#FFFFFF")=>``,_d=(e="#fff",t="")=>``,Cd='',Ad='',Od=` `,vd=(e="#fff",t="")=>` `,Rd=({color:e="#fff",className:t=""}={})=>``,Pd=({color:e="#fff",className:t=""}={})=>``,Ii=()=>` `,bi=()=>` Publish `;class _i{constructor(t){y(this,"postMessage",t=>{var o;(o=this.broadcaster)==null||o.postMessage(t)});y(this,"addEventListener",(...t)=>{var o;(o=this.receiver)==null||o.addEventListener(...t)});this.name=t||mo();try{"BroadcastChannel"in self&&(this.broadcaster=new BroadcastChannel(this.name),this.receiver=new BroadcastChannel(this.name))}catch(o){console.error("self is not defined",o)}}}class Yo{constructor({shouldIncludeLogs:t=!1,shouldArchivePastEvents:o=!1}={}){y(this,"subscribeMultipleEvents",({eventNames:t,callback:o,shouldIncludePastEvents:s})=>{for(const n of t)this.subscribe({eventName:n,callback:o,shouldIncludePastEvents:s})});y(this,"unsubscribeMultipleEvents",({eventNames:t,callback:o})=>{for(const s of t)this.unsubscribe({eventName:s,callback:o})});this.broadcastHub=new _i,this.eventCallbacks={},this.pastEvents={},this.shouldIncludeLogs=t,this.shouldArchivePastEvents=o}logMessage(t){this.shouldIncludeLogs&&console.log(t)}throwError(t){if(this.shouldIncludeLogs)throw new Error(t)}archivePastEvent(t){if(!this.shouldArchivePastEvents)return;const{eventName:o}=t;this.pastEvents[o]||(this.pastEvents[o]=[]),this.pastEvents[o].push(t)}postMessage(t){this.archivePastEvent(t),this.broadcastHub.postMessage(t)}postPastEvents({eventName:t,callback:o}){if(this.pastEvents[t])for(const s of this.pastEvents[t])o({data:S(f({},s),{isPastEvent:!0})})}subscribe({eventName:t,callback:o,shouldIncludePastEvents:s}){if(this.eventCallbacks[t]||(this.eventCallbacks[t]=new Set),this.eventCallbacks[t].has(o)){this.throwError(`Already subscribed to event ${t} with this callback`);return}this.eventCallbacks[t].add(o),s&&this.postPastEvents({eventName:t,callback:o})}unsubscribe({eventName:t,callback:o}){if(!this.eventCallbacks[t]){this.throwError(`Not subscribed to event ${t}`);return}if(!this.eventCallbacks[t].has(o)){this.throwError("Callback is not subscribed");return}if(!this.eventCallbacks[t].delete(o)){this.logMessage(`Not subscribed to event ${t} with this callback`);return}this.logMessage(`Unsubscribed from event ${t}`)}initListener(t){this.broadcastHub.addEventListener("message",t)}}class at extends Yo{constructor(){if(at.instance)return at.instance;super({shouldArchivePastEvents:!0});y(this,"eventHandler",o=>{const{data:s={}}=o,{eventName:n}=s;if(this.eventCallbacks[n])for(const i of this.eventCallbacks[n])i(o)});y(this,"postMessage",o=>{const s=o.transmissionId||mo();return super.postMessage(S(f({},o),{transmissionId:s})),s});y(this,"init",()=>{this.initListener(this.eventHandler)});at.instance=this}}const h=new at;Object.freeze(h);const Ci={modalOpen:"tolstoyModalOpen",playerReady:"tolstoyPlayerReady",toggleFeedCloseButton:"toggleFeedCloseButton",showFeedProductModal:"showFeedProductModal",reportModalOpen:"tolstoyReportModalOpen",reportModalClose:"tolstoyReportModalClose",modalMessagingReady:"tolstoyModalMessagingReady",closePlayer:"tolstoyClosePlayer",userEmailUpdate:"tolstoyUserEmailUpdate"},Ai={isRebuyAppInstalled:"tolstoyIsRebuyAppInstalled",openRebuyCart:"tolstoyOpenRebuyCart",rebuyCartShown:"rebuyCartShown",rebuyCartHidden:"rebuyCartHidden"},Oi={openKendoModal:"tolstoyOpenKendoModal",changeZIndex:"tolstoyChangeZIndex"},vi={isTapcart:"tolstoyIsTapcart",openTapcartProduct:"tolstoyOpenTapcartProduct"},Ri={getProductsMetafields:"getProductsMetafields",returnProductsMetafields:"returnProductsMetafields"},Pi={isAfterpayAppInstalled:"tolstoyIsAfterpayAppInstalled"},Li={productCardClick:"tolstoyProductCardClick"},Ni={spotlightCarouselQuickShopClick:"tolstoySpotlightCarouselQuickShopClick"},Mi={externalEventSubscribed:"tolstoyExternalEventSubscribed",productCardClickSubscribed:"tolstoyProductCardClickSubscribed"},Ui={setAnonymousIdToCart:"tolstoySetAnonymousIdToCart",blockAnonymousIdToCart:"tolstoyBlockAnonymousIdToCart",addToCart:"tolstoyAddToCart",addToCartSuccess:"tolstoyAddToCartSuccess",addToCartError:"tolstoyAddToCartError",addToCartSoldOut:"tolstoyAddToCartSoldOut",addToCartDisableDefault:"tolstoyAddToCartDisableDefault",cartItemQuantityChange:"tolstoyCartItemQuantityChange",cartItemQuantityChangeSuccess:"tolstoyCartItemQuantityChangeSuccess",cartItemQuantityChangeError:"tolstoyCartItemQuantityChangeError",cartDataRequest:"tolstoyCartDataRequest",cartDataResponse:"tolstoyCartDataResponse"},Di={loginWithMultipassUrlRequest:"tolstoyLoginWithMultipassUrl",loginWithMultipassUrlResponse:"tolstoyLoginWithMultipassUrlResponseMessage"},ki={productRecommendationsRequest:"tolstoyProductRecommendationsRequest",productRecommendationsResponse:"tolstoyProductRecommendationsResponse"},$i={requestProductsUpdate:"tolstoyRequestProductsUpdate",productUpdateResponse:"tolstoyProductUpdateResponse",moveToUrl:"tolstoyMoveToUrl",isNonBaseCurrency:"tolstoyIsNonBaseCurrency"},Bi={urlChange:"urlChange",urlLocaleUpdate:"tolstoyUrlLocaleUpdate"},xi={openCommerceSettingsUpdate:"tolstoyOpenCommerceSettingsUpdate"},l=S(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f({},Ci),Ai),Oi),Pi),Ri),Li),Ni),Mi),vi),Ui),Di),ki),$i),Bi),xi),{rejectCookiePolicy:"rejectCookiePolicy"}),Go="widget-loading",Ld="widget-onyou",Nd="widget-onyou-enableAllPages",Hi="widget-video-fallback",Md="carousel-show-dots",Ud="carousel-videos",Dd="hide-spotlight-plus-button",kd="app-use-creator-profile",Wi="block-shopify-add-to-cart-attribute",$d="shopify-price-formatting",Vi="Nunito Sans, sans-serif",Bd="tolstoy-custom-font-family",xd="tolstoy-custom-heading-font-family",je=[];function Fi(e,t){const o="italic",s="normal",n={".ttf":"truetype",".otf":"opentype",".woff":"woff",".woff2":"woff2"},i=document.createElement("style");for(const r of Object.keys(e)){const a=e[r],d=r.includes(o),c=r.split("-")[1]||r.replace(o,"")||s,u=d?o:s,p=Object.keys(n).find(v=>a.includes(v)),w=n[p],I=a.replace("http://","https://");i.append(document.createTextNode(`@font-face { font-family: '${t}'; src: url("${I}") format("${[w]}"); font-weight: ${c}; font-style: ${u}; font-display: swap;}`))}document.head.append(i)}const jo=(e,t=1)=>{if(!(!e||t===3)){if(!document.querySelector("#tolstoyWidgetElement")){setTimeout(()=>{jo(e,t+1)},1e3);return}document.querySelector("#tolstoyWidgetElement").style.fontFamily=`${e}, ${Vi}`}},Yi=e=>{const t=document.head.querySelectorAll("style");return Array.from(t).some(o=>o.textContent.includes(`@font-face { font-family: '${e}';`))};function Ke(e,t="tolstoy-custom-font-family"){if(!e||je.includes(t)||Yi(t))return;const{sources:o}=e;Fi(o,t),jo(t),je.push(t)}let it,qe="";const Gi=e=>{var o;const t=document.querySelector("#smile-ui-container");e&&(qe=(t==null?void 0:t.style.display)||""),(o=t==null?void 0:t.style)==null||o.setProperty("display",e||qe)},ji=e=>{let t=0;return o=>{try{o()}catch(s){try{if(!N())return;fetch("https://api.gotolstoy.com/events/event",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({eventName:"widgetError",text:s.message,timestamp:new Date().toISOString(),parentUrl:window.location.href,appKey:e.data.appKey,publishId:e.data.publishId,sessionId:e.data.sessionId,source:e.data.name,answerKey:`${t}`,currentPageProductId:o.toString(),formData:`${(s&&s.stack||"").slice(0,1999)}`})})}catch(n){Eo(n)}}finally{t++}}},Ki=e=>{if(e.data.name===m.sessionStart||e.data.name===H.autoplayStart){const t=ji(e);t(()=>Cn(e.data.publishId)),t(()=>kn(e.data.appKey,e.data.appUrl)),t(()=>Ho(e.data.sessionId)),t(()=>Wn(e.data.publishId,e.data.sessionId)),t(()=>Gi("none")),t(()=>qi(e.data.anonymousId))}},qi=e=>{window.Shopify&&h.postMessage({eventName:l.setAnonymousIdToCart,anonymousId:e})},Hd=({data:{name:e,publishId:t,productIds:o}={}})=>{if(e===bs)for(const s of o)An({productId:s,publishId:t})},Wd=e=>{Ze[e.data.name]&&Ze[e.data.name](e.data)},Vd=e=>{Qe[e.data.name]&&setTimeout(()=>Qe[e.data.name](),500)},zi=()=>{var e,t;window.GorgiasChat&&((t=(e=window.GorgiasChat).open)==null||t.call(e),window.tolstoyWidget.hide(),document.head.insertAdjacentHTML("beforeend",""))},Zi=()=>{var e,t;window.GorgiasChat&&((t=(e=window.GorgiasChat).close)==null||t.call(e),document.head.insertAdjacentHTML("beforeend",""))},Qi=()=>{window.adaEmbed&&(window.adaEmbed.toggle(),window.tolstoyWidget.hide())},Xi=()=>{document.head.insertAdjacentHTML("beforeend","")},Ji=()=>{window.fcWidget&&(window.fcWidget.show(),window.fcWidget.open(),window.tolstoyWidget.hide())},tr=()=>{window.fcWidget&&(window.fcWidget.close(),window.fcWidget.hide(),window.tolstoyWidget.show())},er=()=>{var e,t;if(!it&&((e=window.Reamaze)!=null&&e.popup)){window.Reamaze.popup(),window.tolstoyWidget.hide();return}window._support&&it&&((t=window.Reamaze)!=null&&t.reload)&&(window._support.ui=it,window.Reamaze.reload(),it=null,window.tolstoyWidget.hide())},or=()=>{var e,t;(e=window._support)!=null&&e.ui&&((t=window.Reamaze)!=null&&t.reload)&&(it=window._support.ui,delete window._support.ui,window.Reamaze.reload(),window.tolstoyWidget.show())},sr=()=>{const e=setTimeout(()=>clearInterval(t),9e3),t=setInterval(()=>{window.Intercom&&(window.Intercom("show"),window.tolstoyWidget.hide(),clearInterval(t),clearTimeout(e),window.Intercom("onHide",()=>{window.tolstoyWidget.show()}))})},nr=()=>{const e=setTimeout(()=>clearInterval(t),9e3),t=setInterval(()=>{window.Intercom&&(window.Intercom("update",{hide_default_launcher:!0}),clearInterval(t),clearTimeout(e))},100)},ir=()=>{window.Tawk_API&&(window.Tawk_API.maximize(),window.tolstoyWidget.hide())};function rr(){window.Tawk_API&&window.Tawk_API.hideWidget()}const ar=()=>{window.LiveChatWidget&&(window.LiveChatWidget.call("maximize"),window.tolstoyWidget.hide())};function cr(){window.LiveChatWidget&&window.LiveChatWidget.call("hide")}const lr=()=>{window.HubSpotConversations&&window.HubSpotConversations.widget&&(window.HubSpotConversations.widget.open(),window.tolstoyWidget.hide())};function dr(){window.HubSpotConversations&&window.HubSpotConversations.widget&&window.HubSpotConversations.widget.close()}const ur=()=>{window.Beacon&&(window.Beacon("open"),window.tolstoyWidget.hide(),window.Beacon("config",{display:{zIndex:"99999"}}))},pr=()=>{window.Beacon&&window.Beacon("config",{display:{zIndex:"0"}})},hr=()=>{window.drift&&(window.drift.api.toggleChat(),window.tolstoyWidget.hide())},gr=()=>{window.drift&&window.drift.api.widget.hide()},yr=()=>{var e,t;window.zE&&(window.zE("messenger","open"),(t=(e=document.querySelector('[title="Button to launch messaging window"]'))==null?void 0:e.style)==null||t.setProperty("display","block"),window.tolstoyWidget.hide())},fr=()=>{const e=setTimeout(()=>clearInterval(t),5e3),t=setInterval(()=>{var n,i,r;const o=document.querySelector('[title="Button to launch messaging window"]'),s=document.querySelector('[title="Message from company"]');(n=o==null?void 0:o.style)==null||n.setProperty("display","none"),(r=(i=s==null?void 0:s.parentElement)==null?void 0:i.style)==null||r.setProperty("display","none"),o&&s&&(clearInterval(t),clearTimeout(e))},100);window.zE&&window.zE("messenger","close")},mr=()=>{window.tidioChatApi&&(window.tidioChatApi.show(),window.tidioChatApi.open(),window.tolstoyWidget.hide())},wr=()=>{window.tidioChatApi&&window.tidioChatApi.close()},Er=e=>{if(window.certainly)switch(window.certainly.widgetStatus({action:"open"}),window.tolstoyWidget.hide(),e.data.key){case"PmkMI":window.certainly.goTo({module:"670442"});break;case"_23Hl":window.certainly.goTo({module:"670178"});break;case"P9rfq":window.certainly.goTo({module:"670179"});break}},Sr=()=>{window.certainly&&window.certainly.widgetStatus({action:"hide"})},ze=e=>{document.head.insertAdjacentHTML("beforeend",``)},Tr=()=>{ze("#vfChat+div"),ze("#vfChat+div+div")},Ir="tolstoyHideFreshChat",br="tolstoyOpenFreshChat",_r="tolstoyHideReamaze",Cr="tolstoyOpenReamaze",Ar="tolstoyHideAda",Or="tolstoyOpenAda",vr="tolstoyHideTidio",Rr="tolstoyOpenTidio",Pr="tolstoyHideCertainly",Lr="tolstoyOpenCertainly",Nr="tolstoyHideVfChat",Ze={[m.openGorgias]:zi,[m.openIntercom]:sr,[m.openTawkTo]:ir,[m.openLiveChat]:ar,[m.openHubSpot]:lr,[m.openDrift]:hr,[m.openZendesk]:yr,[m.openHelpScout]:ur,[br]:Ji,[Cr]:er,[Or]:Qi,[Rr]:mr,[Lr]:Er},Qe={[m.hideGorgias]:Zi,[m.hideIntercom]:nr,[m.hideTawkTo]:rr,[m.hideLiveChat]:cr,[m.hideHubSpot]:dr,[m.hideDrift]:gr,[m.hideZendesk]:fr,[m.hideHelpScout]:pr,[Ir]:tr,[_r]:or,[Ar]:Xi,[Nr]:Tr,[vr]:wr,[Pr]:Sr};class Mr{constructor({config:t,playerType:o,collectionId:s}){this.config=t,this.publishId=t.publishId,this.playerType=o,this.sessionId=Ce()||Mt(),this.anonymousId=tt(),this.currentPageProductId=Ht(),this.collectionId=s,this.errors={}}getIsMobile(){return window.screen.width<=450||window.screen.height<=450}getAnalyticsParams(t={}){var c;const{id:o,appKey:s,name:n,googleAnalyticsID:i}=this.config,r=window.location.href.split("?")[0],a=(c=window.Shopify)==null?void 0:c.shop,d=this.errors;return f({appKey:s,publishId:this.publishId,sessionId:this.sessionId,anonymousId:this.anonymousId,currentPageProductId:this.currentPageProductId,isMobile:this.getIsMobile(),pageUrl:r,storeUrl:a,appUrl:a,googleAnalyticsID:i,projectId:o,playlist:n,timestamp:new Date().toISOString(),parentUrl:window.location.href,playerType:this.playerType,customParams:d?JSON.stringify(d):void 0,collectionId:this.collectionId},t)}sendEventToAllSources(t){pe(t),Kt({data:S(f({},t),{name:t.eventName})})}sendEventImmediately(t={},o=!1){const s=this.getAnalyticsParams(t);_o(s),!o&&Kt({data:S(f({},s),{name:s.eventName})})}sendEvent(t={},o=!1){if(!N())return;const s=this.getAnalyticsParams(t);s.eventName===T.onYouClick&&console.log("Analytics::sendEvent::params",s),pe(s),!o&&Kt({data:S(f({},s),{name:s.eventName})})}handlePageView(){qt(this.publishId,!1),this.sendEvent({eventName:T.pageView})}handleEmbedView(){qt(this.publishId,!0),this.sendEvent({eventName:T.embedView})}handleOnYouClick(){qt(this.publishId,!0),Ho(this.sessionId),this.sendEvent({eventName:T.onYouClick})}handleSessionStart(){const t=this.getAnalyticsParams({eventName:T.sessionStart});this.sendEventToAllSources(t),Ki({data:S(f({},t),{name:m.sessionStart})}),window.postMessage(S(f({},t),{name:m.sessionStart}),"*")}handleVideoLoaded(t={}){const o=this.getAnalyticsParams(S(f({},t),{eventName:T.videoLoaded}));this.sendEventToAllSources(o)}handleVideoWatched(t={}){const o=this.getAnalyticsParams(S(f({},t),{eventName:T.videoWatched}));this.sendEventToAllSources(o)}}const zt={A:"A",B:"B"};class Ur{constructor(t){this.widgetType=t}sendAbTestInitializedEvent({abTestId:t,group:o,excludeExternalAnalytics:s,probability:n}){const i={abTestId:t,eventName:T.abTestInitialized,sessionUniqueId:Ae(),testGroup:o,probability:n};this.analytics.sendEventImmediately(i,s)}initializeGroup({abTestId:t,probability:o,excludeExternalAnalytics:s}){const n=Gn(t);if(n){this.group=n;return}const r=Math.random()>o?zt.B:zt.A;this.group=r,this.sendAbTestInitializedEvent({abTestId:t,group:r,excludeExternalAnalytics:s,probability:o}),Yn(t,r)}init(t){if(!t)return;const{abTestSettings:o={}}=t,{isEnabled:s,abTestId:n,probability:i,groupASettings:r={},groupBSettings:a={},excludeExternalAnalytics:d}=o;if(s)return this.analytics=new Mr({config:t,playerType:this.widgetType}),this.initializeGroup({abTestId:n,probability:i,excludeExternalAnalytics:d}),this.group===zt.A?r:a}}const Re=({config:e,featureKey:t})=>{var o;return(o=e==null?void 0:e.featureSettings)==null?void 0:o[t]},Dr=({config:e,featureKey:t})=>{var o;return!!((o=e==null?void 0:e.featureSettings)!=null&&o[t])},Fd=(e={})=>{const t=Re({config:e,featureKey:Go});return t==null?void 0:t.playerLazy},Ko=(e={})=>{const t=Re({config:e,featureKey:Go});return t==null?void 0:t.playerOrigin},Yd=(e={})=>{const t=Re({config:e,featureKey:Hi});return t==null?void 0:t.dontUseFallback},Gd=".webp",jd={VIDEO:"video",IMAGE:"image",GALLERY:"gallery"},nt={XS:250,S:480,M:960,L:1280,XL:1920},Kd={[nt.XS]:"_250",[nt.S]:"_480",[nt.M]:"_960",[nt.L]:"_1280",[nt.XL]:"_1920"},qo={"250x140":"250x140","250x250":"250x250","480x480":"480x480","960x540":"960x540"},zo=({path:e=`${fo}/public`,ownerId:t="",assetId:o="",suffix:s="",extension:n=""})=>`${e}/${t}/${o}/${o}${s}${n}`,qd=({stockAsset:e={},posterSettings:t={}})=>{const{useShopifyPoster:o=!0}=t,{shopifyPosterUrl:s,posterUrl:n}=e||{};return s&&o?s:n},kr=({step:e,extension:t,posterSettings:o,size:s=qo["250x250"],custom:n={condition:"",callback:""},path:i=`${fo}/public`})=>{var B;const{videoOwner:r,videoId:a,stockAsset:d={},mediaAssets:c}=e;if(!a)return"";const{avatarUrl:u,posterUrl:p,hasOriginal:w,shopifyPosterUrl:I}=d||{},{shopifyAttributes:v={},shopifySpotlightAttributes:E={},useShopifyPoster:A=!1}=o||{},_=f(f({},v),E),U=!!((B=Object.keys(_))!=null&&B.length),D=I&&A&&U;if(p)return p;if(c&&(c!=null&&c.images)&&(c!=null&&c.images[s])&&!D)return c.images[s];const k=!w&&(u||p);if(I&&!1){let ot="width=300";return A&&(ot=new URLSearchParams(_).toString()),`${I}&${ot}`}return p!=null&&p.endsWith(t)||p&&!w?p:n!=null&&n.condition&&(n!=null&&n.callback)&&n.condition({posterUrl:p,avatarUrl:u,extension:t,isDuplicated:k})?n.callback(d):zo({path:i,ownerId:r,assetId:a,extension:t})},$r=".avatar.0000000.webp",Br=".401.0000000.webp",zd=".avatar.0000000.jpg",Zd=".0000000.jpg",xr=480,Hr=({isMobile:e,isStory:t,isPlayInTileFirst:o,isTile:s})=>o||s?"_640.mp4":e||t?"_preview.mp4":"_preview_embed.mp4",Xe=({step:e,isStory:t,isPlayInTileFirst:o,height:s=Os,isTile:n})=>{const{videoOwner:i,stockAsset:r,videoId:a}=e,d=window.innerWidth<=450,c=Hr({isMobile:d,isStory:t,isPlayInTileFirst:o,isTile:n}),u=r==null?void 0:r.videoUrl,p=!!(r!=null&&r.shopifyFileId),w=r==null?void 0:r.previewUrl,I=r==null?void 0:r.hasOriginal,v=r==null?void 0:r.gifUrl,E=p&&!I;return w&&!o&&s{const n=window.innerWidth<=450?$r:Br;return kr({step:e,extension:n,posterSettings:t,size:o})},Xd=(e,t)=>{const o=()=>{if(e.autoplay){e.src="";return}e.src=t};e.addEventListener("ended",o,{once:!0})},Wr=(e,t,o)=>o?`${e}-${t}-${o}`:`${e}-${t}`,Jd=e=>e.dataset.publishId?e.dataset.publishId.toLowerCase():e.id?e.id.split("_")[0].toLowerCase():"",tu=e=>{var t;return(t=e==null?void 0:e.dataset)==null?void 0:t.collectionId},eu=e=>{var s,n,i,r,a,d;const t=(i=(n=(s=e==null?void 0:e.design)==null?void 0:s.branding)==null?void 0:n.typography)==null?void 0:i.font,o=(d=(a=(r=e==null?void 0:e.design)==null?void 0:r.branding)==null?void 0:a.typography)==null?void 0:d.fontHeading;!(t!=null&&t.family)&&!(o!=null&&o.family)||(t!=null&&t.family&&Ke(t),o!=null&&o.family&&Ke(o,"tolstoy-custom-heading-font-family"))},ou=({step:e,embedMotion:t,isStory:o,loadAll:s=!1,isCarouselPlayInTileFirst:n})=>{if(t===rt.static||n)return null;const r=window.innerWidth<=450,a=t===rt.hoverOver,d=t===rt.dynamic;return d&&s?Xe({step:e,isStory:o}):a&&r||d?null:Xe({step:e,isStory:o})},Vr=e=>{const t=e.getBoundingClientRect();return t.top>=-t.height&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},Zo=(e,t)=>window.document.querySelectorAll(`[data-tolstoy-element="${Wr(e,t)}"]`),Fr=({videoClass:e,publishId:t,removeEventListenerFunction:o})=>{const s=Zo(e,t);for(const n of s)n.pause(),o==null||o(n)},Yr=({videoClass:e,publishId:t,setIsDynamicVideoRunning:o,onVideoEnd:s})=>{o(!1),Fr({videoClass:e,publishId:t,removeEventListenerFunction:n=>{n.removeEventListener("ended",s)}})},su=({videoClass:e,isDynamicVideoRunning:t,setIsDynamicVideoRunning:o,dynamicVideoHandler:s,publishId:n,onVideoEnd:i})=>{const r=Zo(e,n);if(r.length===0)return;const a=Vr(r[0]);!a&&t?(Yr({videoClass:e,publishId:n,setIsDynamicVideoRunning:o,onVideoEnd:i}),o(!1)):a&&!t&&(s(),o(!0))},nu=r=>g(void 0,[r],function*({publishId:e,productId:t,widgetType:o,tags:s,appUrl:n,variantId:i}){const a=t&&t!==Ws?cn:an,d=window.tolstoyAppKey||R()||"",c=new URLSearchParams(window.location.search),u=i||c.get("variant"),p=yield a({productId:t,defaultPublishId:e,widgetType:o,appKey:d,tags:s,appUrl:n,variantId:u});return(new Ur(o).init(p)||{}).hideElement?{disabled:!0}:(p!=null&&p.disabled||(Dr({config:p,featureKey:Wi})&&h.postMessage({eventName:l.blockAnonymousIdToCart,appKey:d}),p!=null&&p.openCommerceSettings&&h.postMessage({eventName:l.openCommerceSettingsUpdate,openCommerceSettings:p.openCommerceSettings})),p)});function iu(e,t){return!!(t==null?e:!t)}const ru=e=>{const t=a=>{const d=Ei(a);return d.style.verticalAlign="middle",d.style.margin="0 5px",d.style.marginBottom="3px",d},o=document.createElement("p"),s=t(Ii()),n=t(bi());return o.append(s),({"Invalid publishId":["Add the publish ID from the",n,"tab of your project in Tolstoy"],"Project is not live":["Your project is in draft. Publish project in the",n," tab of your project in Tolstoy"],"Project is deleted":["Project has been deleted"],"No videos found":["Select videos in the Videos tab of your project in Tolstoy"],"No filtered videos found":["Select videos in the Videos tab of your project in Tolstoy"],"No connections found":["Select videos in the Videos tab of your project in Tolstoy"],"No videos found for product":["Add tagged videos for this product in the Videos tab of your project in Tolstoy"]}[e]||["Couldn't find product page"]).forEach(a=>{typeof a=="string"?o.append(document.createTextNode(a)):o.append(a)}),o},Gr=({element:e})=>{const t=e.getBoundingClientRect();return t.width===0||t.height===0?!1:t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},au=()=>new URLSearchParams(window.location.search).get("variant");function jr(e){function t(){n&&(o.length>0&&/^[~+>]$/.test(o[o.length-1])&&o.push(" "),o.push(n))}var o=[],s,n,i,r=[0],a=0,d,c=/(?:[^\\]|(?:^|[^\\])(?:\\\\)+)$/,u=/^\s+$/,p=[/\s+|\/\*|["'>~+[(]/g,/\s+|\/\*|["'[\]()]/g,/\s+|\/\*|["'[\]()]/g,null,/\*\//g];for(e=e.trim();;)if(n="",i=p[r[r.length-1]],i.lastIndex=a,s=i.exec(e),s)if(d=a,a=i.lastIndex,d0)r.pop();else if(/^(?:\s+|[~+>])$/.test(s[0])&&(o.length>0&&!u.test(o[o.length-1])&&r[r.length-1]===0&&o.push(" "),r[r.length-1]===1&&o.length===5&&o[2].charAt(o[2].length-1)==="="&&(o[4]=" "+o[4]),u.test(s[0])))continue;o.push(s[0])}else o[o.length-1]+=n,c.test(o[o.length-1])&&(r[r.length-1]===4&&(o.length<2||u.test(o[o.length-2])?o.pop():o[o.length-1]=" ",s[0]=""),r.pop()),o[o.length-1]+=s[0];else{n=e.substr(a),t();break}return o.join("").trim()}function kt(e,t=document,o=null){return Kr(e,!0,t,o)}function Kr(e,t,o,s=null){e=jr(e);let n=o.querySelector(e);return document.head.createShadowRoot||document.head.attachShadow?!t&&n?n:Zt(e,",").reduce((r,a)=>{if(!t&&r)return r;const d=Zt(a.replace(/^\s+/g,"").replace(/\s*([>+~]+)\s*/g,"$1")," ").filter(I=>!!I).map(I=>Zt(I,">")),c=d.length-1,u=d[c][d[c].length-1],p=Zr(u,o,s),w=qr(d,c,o);return t?(r=r.concat(p.filter(w)),r):(r=p.find(w),r||null)},t?[]:null):t?o.querySelectorAll(e):n}function qr(e,t,o){return s=>{let n=t,i=s,r=!1;for(;i&&!zr(i);){let a=!0;if(e[n].length===1)a=i.matches(e[n]);else{const d=[].concat(e[n]).reverse();let c=i;for(const u of d){if(!c||!c.matches(u)){a=!1;break}c=Je(c,o)}}if(a&&n===0){r=!0;break}a&&n--,i=Je(i,o)}return r}}function Zt(e,t){return e.match(/\\?.|^$/g).reduce((o,s)=>(s==='"'&&!o.sQuote?(o.quote^=1,o.a[o.a.length-1]+=s):s==="'"&&!o.quote?(o.sQuote^=1,o.a[o.a.length-1]+=s):!o.quote&&!o.sQuote&&s===t?o.a.push(""):o.a[o.a.length-1]+=s,o),{a:[""]}).a}function zr(e){return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE||e.nodeType===Node.DOCUMENT_NODE}function Je(e,t){const o=e.parentNode;return o&&o.host&&o.nodeType===11?o.host:o===t?null:o}function Zr(e=null,t,o=null){let s=[];if(o)s=o;else{const n=function(i){for(let r=0;rn.matches(e)):s}const $t=(e,t,o,s=null)=>{if(!e||e.length===0)return;e.forEach(i=>t.add(i));const n=Array.from(t);s&&s(n),o(n)},Qr=(e,t,o=null)=>setInterval(()=>{const n=Array.from(kt("img")).filter(i=>!e.has(i));n.length>0&&$t(n,e,t,o)},2e3),Xr=(e,t,o,s=null)=>{const n=new IntersectionObserver(i=>{let r=!1;i.forEach(a=>{if(a.isIntersecting){const c=a.target.querySelectorAll("img");if(c.length>0){const u=Array.from(c).filter(p=>!e.has(p));u.length>0&&($t(u,e,t,s),r=!0)}}}),r&&(o.current=Date.now())},{root:null,rootMargin:"100px",threshold:.1});return n.observe(document.body),n},Jr=(e,t,o,s,n=null)=>{const i=new MutationObserver(r=>{let a=!1;const d=[];if(r.forEach(c=>{c.type==="childList"?(Array.from(c.addedNodes).forEach(u=>{if(u.nodeName==="IMG")d.push(u),a=!0,s.observe(u);else if(u.querySelectorAll){const p=Array.from(u.querySelectorAll("img"));p.length>0&&(d.push(...p),a=!0,p.forEach(w=>s.observe(w)))}u.nodeType===1&&s.observe(u)}),Array.from(c.removedNodes).forEach(u=>{(u.nodeName==="IMG"||u.querySelectorAll&&u.querySelectorAll("img").length>0)&&(a=!0)})):c.type==="attributes"&&c.attributeName==="src"&&(a=!0)}),a)if(o.current=Date.now(),d.length>0)$t(d,e,t,n);else{const u=Array.from(kt("img")).filter(p=>!e.has(p));u.length>0&&$t(u,e,t,n)}});return i.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["src"]}),i},ta=(e,t,o,s,n)=>{let i=null;const r={current:Date.now()};function a(){Date.now()-r.current>=e?(clearTimeout(t),clearTimeout(i),n(o)):i=setTimeout(a,100)}return i=setTimeout(a,100),{timeoutId:i,lastChangeTimeRef:r}};function ea(e=3e3,t=1e4,o=null){let s=Array.from(kt("img"));const n=new Set;let i=null,r=null,a=null;return new Promise(c=>{i=c,s.length>0&&(s.forEach(w=>n.add(w)),o&&o(s),c(s)),r=setTimeout(()=>{s=Array.from(kt("img")),s.forEach(w=>n.add(w)),o&&o(s),c(s)},t),a=ta(e,r,s,n,c).lastChangeTimeRef,Qr(n,i,o);const p=Xr(n,i,a,o);Jr(n,i,a,p,o)})}const oa=e=>{var o,s,n;let t=e;if(t){if(((o=t.parentElement)==null?void 0:o.tagName)==="PICTURE"&&(t=e.parentElement),!t.parentElement){const i=((s=t==null?void 0:t.shadowRoot)==null?void 0:s.host)||((n=t==null?void 0:t.parentNode)==null?void 0:n.host);if(i)t=i;else if(e.parentElement)t=e;else return}return t}},sa=e=>{const t=e.getBoundingClientRect();return t.width>200&&t.height>200};function na(e){const t=window.getComputedStyle(e),o=[":hover",":focus",":active",":visited",":focus-within",":focus-visible",":target",":checked",":disabled"],s=[];for(const i of document.styleSheets){let r=[];try{r=i.cssRules||i.rules}catch(d){}const a=(d,c=null)=>{for(const u of d){if(u instanceof CSSMediaRule&&a(u.cssRules,u.conditionText||u.media.mediaText),!(u instanceof CSSStyleRule))continue;const p=u.selectorText.replace(new RegExp(o.join("|"),"g"),"").trim();if(p)try{p&&e.matches(p)&&s.push({selector:u.selectorText,style:u.style,cssText:u.cssText,originalRule:u,media:c?{condition:c,matches:window.matchMedia(c).matches}:null})}catch(w){}}};a(r)}const n=e.style.cssText?{selector:"inline",cssText:e.style.cssText}:null;return{computed:Object.fromEntries(Array.from(t).map(i=>[i,t.getPropertyValue(i)])),rules:n?[...s,n]:s}}function to(e){let t;const o=document.styleSheets;for(const s of o)if(!s.href){t=s;break}if(!t){const s=document.createElement("style");document.head.append(s),t=s.sheet}t.insertRule(e,t.cssRules.length)}function ia(e){const{rules:t}=na(e);t.forEach(o=>{if(o.selector.includes("img")){const s=o.cssText.replace(/img\s*\+\s*img/,`img + .${X.collectionTileHoverWrapper}`);if(s===o.cssText){const n=o.cssText.replace("img",`.${X.collectionTileHoverWrapper}`);to(n)}else to(s)}})}const ra=e=>{const t=e.attributes,o=new Set;for(const s of t){const n=String(s.value||"").split(/[,\s]+/).filter(Boolean);for(const i of n){const r=Qo(i);r&&o.add(r)}}return Array.from(o)},aa=e=>{const t=e.attributes,o=new Set;for(const s of t){const n=String(s.value||"").split(/[,\s]+/).filter(Boolean);for(const i of n){const r=Xo(i);r&&o.add(r)}}return o};function Qo(e){try{return!e||!e.includes("//")?null:new URL(e!=null&&e.startsWith("//")?`https:${e}`:e).pathname.split("/").pop().split(".").slice(0,-1).join(".")}catch(t){return null}}function Xo(e){if(typeof e!="string")return null;const t=e.toLowerCase(),o=/[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}/,s=t.match(o);return s?s[0]:null}const ca=({config:e,project:t,collectionId:o},s)=>{var i;if(!e||!t||!o)return;const n=((i=e.settings||ks)==null?void 0:i.playMode)===me.HOVER;Object.entries((e==null?void 0:e.productsMap)||{}).forEach(([r,a])=>{var I,v;const d=((I=a==null?void 0:a.images)==null?void 0:I.map(E=>E.src))||((v=a==null?void 0:a.variants)==null?void 0:v.map(E=>E==null?void 0:E.imageUrl));if(!d)return;const c=d.map(E=>Qo(E)),u=d.map(E=>Xo(E)).filter(Boolean);let p=s.map(({fileNames:E,fileUuidsSet:A,element:_,isLarge:U,externalElement:D})=>{let k=-1;return u.length>0&&(k=u.findLastIndex($=>A.has($))),k===-1&&(k=c.findLastIndex($=>E.some(B=>B.includes($)&&B.length<1.3*$.length))),{imgElement:_,externalImgElement:D,imageIndex:k,isLarge:U,fileName:c[k]}}).filter(({imageIndex:E})=>E!==-1);xt("filtered by src img elements",{imgElements:s,filteredImgElements:p,productFileNames:c,productUuids:u});const w=p.filter(({isLarge:E})=>E);if(w.length>0&&(p=w),p.length>0){const{externalImgElement:E}=p.at(n?0:-1),A=[...E.classList].join(" ").split(" ").filter(Boolean),_=document.createElement("div");if(_.innerHTML=``,E.parentElement)if(n){ia(E);const{width:U,height:D}=E.getBoundingClientRect();_.style.width=`${U}px`,_.style.height=`${D}px`,_.classList.add(X.collectionTileHoverWrapper,...A),_.firstChild.style.zIndex="0",E.style.display="none",E.parentElement.insertBefore(_,E),_.append(E)}else A&&_.firstChild.classList.add(...A),_.firstChild.style.zIndex="1",E.parentElement.insertBefore(_.firstChild,E)}})},la=(e,t,o)=>{if(!e||e.length===0)return;e.forEach(n=>t.add(n));const s=da(e);pa(s,o)},da=e=>e.map(t=>({element:t,externalElement:oa(t),isLarge:sa(t),fileNames:ra(t),fileUuidsSet:aa(t)})).reverse(),ua=(e,t)=>{if(!t)return e;const o=t.split(",").flatMap(n=>[n,`${n} img`]).join(","),s=document.querySelectorAll(o);return e.filter(n=>[...s].some(i=>i.contains(n)))},pa=(e,t)=>{t.forEach(o=>ca(o,e))},ha=(e,t,o)=>{const{playerSettings:s,widgetSettings:n}=o[0].project,i=n.collectionTileSettings.playMode===me.HOVER,r=s.gallerySelector||"",a=s.galleryImageSelector||"",d=i&&s.galleryImageSecondarySelector,c=(i?d:a)||r,u=ua(e.filter(p=>!t.has(p)),c);return c&&xt("filter new images with selector",{playerSettings:s,widgetSettings:n,imgElements:e,filteredBySelectorImages:u,processedImageElements:t,filterSelector:c}),u},eo=(e,t,o)=>{if(!e||e.length===0)return;const s=ha(e,t,o);s.length!==0&&(xt("processImages",{imgElements:e,newImages:s}),la(s,t,o))},ga=e=>g(void 0,null,function*(){if(!(e!=null&&e.length)||document.querySelector(`.${X.collectionTile}`))return;const t=new Set,s=yield ea(3e3,1e4,n=>{eo(n,t,e)});eo(s,t,e)}),Qt="data-status",Xt=[ft],Ct={loading:"loading",loaded:"loaded",failed:"notFound"},ya=()=>{var t,o;const e=(o=(t=document.querySelector("script[data-collection-id]"))==null?void 0:t.dataset)==null?void 0:o.collectionId;return e!=null&&e.includes("{{ collection.id")||!e?null:e},fa=({element:e,callback:t,outOfViewCallback:o})=>{const s=new window.IntersectionObserver(n=>{n[0].isIntersecting===!0&&n[0].intersectionRatio>.9?(o||s.unobserve(e),t()):n[0].intersectionRatio<.1&&(o==null||o())},{threshold:[.1,.9]});s.observe(e)};class ma{constructor({name:t,component:o,elementClassname:s}){this.name=t,this.Component=o,this.widgets=[],this.initialized=!1,this.elementClassname=s,this.initTemplatesState=this.initAdditionalTemplates()}init(){return g(this,null,function*(){yield this.initTemplatesState;const t=this.getElements();if(t.length!==0){for(const o of t)if(this.getShouldInitializeElement(o)){if(Xt.includes(this.name)&&this.widgets.length>0)break;this.setElementStatus(o,Ct.loading);try{const s=new this.Component;if(yield s.init(o,this.preloadedConfigs.find(n=>n.projectId===o.dataset.projectId)),!s.getIsInitialized()){this.setElementStatus(o,Ct.failed);continue}if(this.widgets.push(s),this.initializeEvents({element:o,widget:s}),this.setElementStatus(o,Ct.loaded),Xt.includes(this.name))break}catch(s){this.setElementStatus(o,Ct.failed),console.log(`error starting tolstoy ${this.name}`,o.id,s)}}this.widgets.length>0&&(this.initialized=!0)}})}deleteElementStatus(t){delete t.removeAttribute(Qt)}getElementStatus(t){return t.getAttribute(Qt)}getIsTolstoyPreview(){return window.tolstoyPreview}getIsElementHidden(t){var o;return((o=window.getComputedStyle(t))==null?void 0:o.display)==="none"||!t.offsetParent}setElementStatus(t,o){return t.setAttribute(Qt,o)}getShouldInitializeElement(t){return t.classList.contains(co)&&!this.getElementStatus(t)?!0:!this.getElementStatus(t)&&!this.getIsElementHidden(t)||!this.getElementStatus(t)&&Tt()||this.getIsTolstoyPreview()}setComponent(t){this.Component=t}loadWidgetAdditionalConfigs(){return g(this,null,function*(){if(this.preloadedConfigs)return this.preloadedConfigs;try{const t=R(),o=ya(),s=et("collection-gallery-projects");if(!s)return[];const n=JSON.parse(s);if(o&&t&&(n!=null&&n.length))return ln(t,o)}catch(t){console.log(t)}return[]})}initAdditionalTemplates(){return g(this,null,function*(){if(this.name!==ft){this.preloadedConfigs=[];return}try{const t=yield this.loadWidgetAdditionalConfigs();this.preloadedConfigs=t,yield ga(this.preloadedConfigs)}catch(t){console.error("error initializing additional templates",t)}})}getElements(){return Xt.includes(this.name)?[...document.querySelectorAll(`.${this.elementClassname}`)].filter(Boolean):[...document.querySelectorAll(`.${this.elementClassname}`)]}shouldLoad(){return this.initTemplatesState.isResolved?this.getElements().length>0:!0}initializeEvents({element:t,widget:o}){var s;(s=o.handlePageView)==null||s.call(o),this.registerEmbedViewListener({element:t,callback:o.handleView,outOfViewCallback:o.handleOutOfView})}registerEmbedViewListener({element:t,callback:o,outOfViewCallback:s}){Gr({element:t})&&(o(),!s)||fa({element:t,callback:o,outOfViewCallback:s})}}let oo=!1;const Jo=()=>g(void 0,null,function*(){if(oo)return;(yield P(()=>import("./c616a8cb4e/widget.events.ea597858.js"),[])).initializeWidgetEvents(),oo=!0});class wa{constructor(){y(this,"loadEmbedWidgets",()=>g(this,null,function*(){const t=Object.entries(this.embedWidgetsMap).map(r=>g(this,[r],function*([o,{embedWidget:s,loaded:n,loading:i}]){if(s.shouldLoad()){if(i){setTimeout(()=>this.loadEmbedWidgets(),2e3);return}n||(yield this.loadEmbedWidget({embedWidgetName:o,embedWidget:s})),yield s.init()}}));yield Promise.all(t)}));y(this,"handleUrlChange",()=>{for(const t of Object.keys(this.embedWidgetsMap))this.embedWidgetsMap[t].loaded=!1;this.loadEmbedWidgets()});this.domUpdatesListenerInitialized=!1,this.widgets=[],this.embedWidgetsMap={}}init(){return g(this,null,function*(){const t=[],o=[re,ae,ce,le,ft];for(const s of o){const n=ho[s],i=new ma({name:s,elementClassname:n});this.embedWidgetsMap[s]={embedWidget:i,loaded:!1},t.push(n)}this.registerDomUpdatesListenerIfNeeded(t),this.subscribeToUrlChange(),yield this.loadEmbedWidgets()})}loadEmbedWidget(s){return g(this,arguments,function*({embedWidgetName:t,embedWidget:o}){this.embedWidgetsMap[t].loading=!0;let n;switch(t){case re:{n=yield P(()=>import("./c616a8cb4e/carousel-loader.85631ffe.js"),[]);break}case ae:{n=yield P(()=>import("./c616a8cb4e/story.34959867.js"),["c616a8cb4e/modal.eb93a2a4.css","c616a8cb4e/story.28102514.css"]);break}case ce:{n=yield P(()=>import("./c616a8cb4e/embed.fe6a4131.js"),["c616a8cb4e/modal.eb93a2a4.css","c616a8cb4e/embed.550ffe5d.css"]);break}case le:{n=yield P(()=>import("./c616a8cb4e/tile.7dc91c2e.js"),["c616a8cb4e/tile.4607c378.css"]);break}case ft:{n=yield P(()=>import("./c616a8cb4e/collection-tile-controller.960924e1.js"),["c616a8cb4e/collection-tile-controller.af177681.css"]);break}case po:{n=yield P(()=>import("./c616a8cb4e/collection-page-tile-controller.c1df9004.js"),["c616a8cb4e/collection-page-tile-controller.5d04a287.css"]);break}}o.setComponent(n.default),yield Jo(),this.embedWidgetsMap[t].loaded=!0,this.embedWidgetsMap[t].loading=!1})}registerDomUpdatesListenerIfNeeded(t){if(this.domUpdatesListenerInitialized)return;Fo({classNames:t,callback:()=>this.loadEmbedWidgets()}),this.domUpdatesListenerInitialized=!0}subscribeToUrlChange(){h.subscribe({eventName:l.urlChange,callback:this.handleUrlChange})}}const G=lo,Ea=new Set(["5bzilmwoe1fon","z7uu0kcyzumt0"]),ts=e=>Ea.has(e)?uo:G;class Sa{constructor(){this.initialized=!1,this.widgets=[],this.start=this.start.bind(this),this.startPart=this.startPart.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.on=this.on.bind(this),this.recreate=this.recreate.bind(this),window.tolstoyWidget=S(f({},window.tolstoyWidget),{start:this.start,startPart:this.startPart,show:this.show,hide:this.hide,on:this.on,recreate:this.recreate})}init(n){return g(this,arguments,function*({bubbleSettings:t,widgetId:o,Component:s}){var a,d;this.bubbleSettings=t;const i=new s(t);if(yield i.init(),this.widgets.push(i),this.updateViewerIdentifyAttributes(),(a=window.tolstoySettings)!=null&&a.noReload||this.registerEvents(),(((d=window.tolstoySettings)==null?void 0:d.alwaysShow)||xo(o)!=="true")&&!t.exitIntentPublishId){const c=ts(o);this.show(c),this.recreate(o,c)}else this.hide()})}updateViewerIdentifyAttributes(){const t=Number($o()||0)+1;Un(t.toString()),Bo()||Dn(new Date().toISOString())}handleMouseDown(){this.userInteracted=!0,document.removeEventListener("mousedown",this.handleMouseDown)}registerEvents(){document.addEventListener("mousedown",()=>{this.handleMouseDown()}),document.body.addEventListener("mouseleave",()=>g(this,null,function*(){var s;const t=(s=this.bubbleSettings)==null?void 0:s.exitIntentPublishId;if(t&&this.userInteracted){const n=this.widgets.find(i=>{var r;return(r=i==null?void 0:i.bubbleSettings)==null?void 0:r.exitIntentPublishId});n&&(yield this.recreate(t,n.name,{startPlayerImmediately:!0}))}}))}start(t=G){const o=Z(this.widgets,t);o&&o.start()}startPart(t,o=G){const s=Z(this.widgets,o);s&&s.startPart(t)}hide(t=G){const o=Z(this.widgets,t);o&&o.hide()}show(t=G){const o=Z(this.widgets,t);o&&o.show()}on(t,o,s=G){const n=Z(this.widgets,s);n&&n.eventChange(t,o)}recreate(t,o=G,s={}){const n=Z(this.widgets,o);n&&n.recreate(t,s)}}const Z=(e,t)=>e.find(o=>o.name===t);class es{addHours(t,o=new Date){return o.setTime(o.getTime()+t*60*60*1e3),o}getTolstoyViewers(){const t=Gt();for(const[s,n]of Object.entries(t)){const i=n.restrictionLimits;!i||!(i!=null&&i.time&&new Date(i==null?void 0:i.time)<=new Date)||delete t[s].restrictionLimits}const o=JSON.stringify(t);return jt(t),o}updateRestrictions(t,o){var r;const s=Gt(),n=(r=s[o])==null?void 0:r.restrictionLimits;if(!n||(n==null?void 0:n.type)!==t)return;const i=n[t];n[t]=i?i+1:1,n.limit&&n.clickLimit===n[t]&&(n.time=this.addHours(n==null?void 0:n.limit)),s[o].restrictionLimits=n,jt(s)}updateRules(t){const o=(t==null?void 0:t.publishId)||void 0,s=t==null?void 0:t.limit,n=Gt();let i=n[o];const r=i==null?void 0:i.restrictionLimits;i?i.impressionCount+=1:i={impressionCount:1,playCount:0};let a=n.undefined;if(a?a.impressionCount+=1:a={impressionCount:1,playCount:0},s){let d={limit:Number(s.timeLimit),type:s.type,clickLimit:Number(s.clickLimit)};r&&(d=f(f({},r),d)),i.restrictionLimits=d}else r&&(i.restrictionLimits=null);n[o]=i,n.undefined=a,jt(n)}}class Bt{static isValidUrl(t){return t?t.startsWith("tel:")||t.startsWith("mailto:")?!0:t.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g)!==null:!1}static isAndroid(){return navigator.userAgent.toLowerCase().indexOf("android")>-1}static isInIframe(){try{return window.self!==window.top}catch(t){return!0}}static isIos(){return/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1}static getMobileOperatingSystem(){const t=navigator.userAgent||navigator.vendor||window.opera;return/windows phone/i.test(t)?"Windows Phone":/android/i.test(t)?"Android":/iPad|iPhone|iPod/.test(t)&&!window.MSStream?"iOS":navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2?"ipad":null}static isMobile(){return Bt.getMobileOperatingSystem()!=null}static isSafari(){return window.safari!==void 0}static enforceProtocol(t,o="https"){return t.startsWith("http")||t.startsWith("//")||t.startsWith("tel:")||t.startsWith("mailto:")?t:`${o}://${t}`}static removeProtocol(t){return t.replace(/(^\w+:|^)\/\//,"")}static stripUrl(t){return Bt.removeProtocol(t).replace(/^www./,"").replace(/\/$/,"")}static stringifyUrlParams(t){const o=new URLSearchParams;return Object.entries(t).forEach(([s,n])=>{o.set(s,n)}),o.toString()}}const Ta="player-version",Ia=(e,t,o)=>{if(o)return`${Fs}`;const s=Ko(e);if(s){const i=V("td"),r=os(e);return i&&r?s.replace("2.0.0","2.0.0-ls"):r?s.replace("2.0.0","2.0.0-l"):i?s.replace("2.0.0","2.0.0-s"):s}let n=`${Vs}`;return t&&(n+="/feed"),e.publishId&&(n+=`/${e.publishId}`),n},so=()=>{var e;return!!(window.Shopify&&((e=window.Shopify)!=null&&e.routes))},os=e=>e.playerLazy||V("pl"),ba=e=>{var t,o;return(o=(t=e==null?void 0:e.featureSettings)==null?void 0:t[Ta])==null?void 0:o.version},_a=e=>{var t;return(t=e==null?void 0:e.carouselEmbed)!=null&&t.carouselPlayInTileFirst?$s:""},Ca=()=>{var e,t,o,s;return((e=window._st)==null?void 0:e.cid)||((s=(o=(t=window.ShopifyAnalytics)==null?void 0:t.meta)==null?void 0:o.page)==null?void 0:s.customerId)||""},Aa=()=>new URLSearchParams(window.location.search).get("authToken"),Oa=()=>{var e;return((e=window.tolstoyUserInfo)==null?void 0:e.email)||window.tolstoyUser},va=()=>V(we.tolstoyAutoOpen)||window.tolstoyAutoOpen,cu=()=>V(we.tolstoyAutoOpenOnYou)||window.tolstoyAutoOpenOnYou,lu=()=>V(we.tolstoyStartVideo)||window.tolstoyStartVideo,Ra=()=>{const e=window.tolstoyMoneyFormat;return e?encodeURIComponent(e):""},Pa=({data:e,onYouMode:t})=>{var u,p;const o=((u=window.Shopify)==null?void 0:u.shop)||Et(),{productId:s}=e,n=`${window.location.origin}${window.location.pathname}`,i=window.location.href,r=localStorage.getItem("tolstoy-anonymousId"),a=Array.from(document.querySelectorAll("div")||{}).find(w=>w.textContent.trim()==="Size & Fit"),d=Array.from(((p=a==null?void 0:a.nextElementSibling)==null?void 0:p.childNodes)||{}).filter(w=>w.nodeType===Node.TEXT_NODE).map(w=>w.textContent.trim()).join(" "),c=new URLSearchParams;return c.append("appUrl",o),c.append("productId",s),c.append("url",n),c.append("urlWithQueryParams",i),c.append("isTolstoyStories","true"),r&&c.append("tolstoyAnonymousId",r),d&&c.append("productFitDetails",d),t&&c.append("mode",t),c.toString().split("&")},La=({data:e,isFeed:t,isOnYou:o,email:s,isDynamic:n,modalId:i,tolstoyStartVideo:r,onYouMode:a})=>{var B,ot,Ft,Pe,Le,Ne,Me,Ue,De;if(o)return Pa({data:e,onYouMode:a});const c=[`url=${`${window.location.origin}${window.location.pathname}`.slice(0,1999)}`,`modalId=${i}`];e.publishId&&c.push(`publishId=${e.publishId}`);const u=Aa();u&&c.push(`authToken=${u}`);const p=s||Oa();p&&c.push(`email=${encodeURIComponent(p)}`),e.productId&&c.push(`productId=${e.productId}`),e.currentProductDbId&&c.push(`currentPageDbProductId=${e.currentProductDbId}`);const w=((B=window.Shopify)==null?void 0:B.shop)||"",I=!!(so()&&w);if(c.push("host",`safari=${!!(window!=null&&window.safari)}`,`dontDownload=${!!e.dontDownload}`,`playerType=${e.playerType}`,`isShopifyStore=${I}`,`shopifyStoreUrl=${w}`,`ai=${tt()}`),so()){const It=(Ft=(ot=window.Shopify)==null?void 0:ot.routes)==null?void 0:Ft.root;It&&c.push(`shopifyRootRoute=${It}`)}if((Pe=window.tolstoyUserInfo)!=null&&Pe.name&&c.push(`name=${encodeURIComponent(window.tolstoyUserInfo.name)}`),(Le=window.tolstoyUserInfo)!=null&&Le.phone&&c.push(`phone=${encodeURIComponent(window.tolstoyUserInfo.phone)}`),window.tolstoyMoneyFormat){const It=Ra();c.push(`tolstoyMoneyFormat=${It}`)}r&&c.push(`tolstoyStartVideo=${r}`),e.testGroup&&c.push(`group=${e.testGroup}`),e.sneakpeek&&c.push("sneakpeek"),e.sneakpeek_hidden&&c.push("sneakpeek_hidden"),e.token&&c.push(`token=${e.token}`),e.gclid&&c.push(`gclid=${e.gclid}`),e.widgetDelay&&c.push("delay"),e.isShoppable===!1&&c.push(`isShoppable=${e.isShoppable}`),e.si&&c.push(`si=${e.si}`);const v=V("td");v&&c.push(`td=${v}`);const E=os(e);E&&c.push(`pl=${E}`);const A=ba(e);A&&c.push(`pv=${A}`);const _=_a(e);_&&c.push(`playerVariant=${_}`),n&&c.push("isDynamic=true");const U=Ca();U&&c.push(`customerId=${U}`);const D=en();D.size>0&&c.push(D.toString()),Tt()&&c.push("isTapcart=true");const $=Ko(e);return $&&e.publishId&&c.push(`publishId=${e.publishId}`),$&&t&&c.push("isFeed=true"),(Ne=window.tolstoySettings)!=null&&Ne.shouldUseCache&&c.push(`shouldUseCache=${(Me=window.tolstoySettings)==null?void 0:Me.shouldUseCache}`),(Ue=window.tolstoySettings)!=null&&Ue.cacheVersion&&c.push(`cacheVersion=${(De=window.tolstoySettings)==null?void 0:De.cacheVersion}`),N()||c.push("userConsent=false"),c},du=({data:e,isFeed:t,isOnYou:o,email:s,isDynamic:n,modalId:i,tolstoyStartVideo:r,onYouMode:a})=>{const d=Ia(e,t,o),c=La({data:e,isFeed:t,isOnYou:o,email:s,isDynamic:n,modalId:i,tolstoyStartVideo:r,onYouMode:a});return`${d}?${c.join("&")}`};class ct{constructor(){var t;if(ct.instance)return ct.instance;ct.instance=this,this.appKey=R(),this.shop=((t=window.Shopify)==null?void 0:t.shop)||Et(),this.accountSettings=null,this.rules=new es,this.shouldUseCache=null,this.cacheVersion=null,this.hasLiveBubble=null}init(){return g(this,null,function*(){var t,o,s,n;if(!(!this.appKey&&!this.shop)){if(this.accountSettings)return this.accountSettings;try{this.accountSettings=yield nn(),this.rules.updateRules(this.accountSettings),(((t=this.accountSettings)==null?void 0:t.shouldUseCache)||To())&&(window.tolstoySettings=window.tolstoySettings||{},window.tolstoySettings.shouldUseCache=!0);const r=((o=this.accountSettings)==null?void 0:o.cacheVersion)||K();return r&&(window.tolstoySettings=window.tolstoySettings||{},window.tolstoySettings.cacheVersion=r),window.tolstoySettings.hasLiveShopAssistant=(s=this.accountSettings)==null?void 0:s.hasLiveShopAssistant,this.hasLiveBubble=((n=this.accountSettings)==null?void 0:n.hasLiveBubble)||!!window.tolstoyWidgetId||va(),this.accountSettings}catch(i){return Eo("Error loading account settings"),null}}})}}const ss=new ct;class Na{constructor(){y(this,"getBubbleSettings",()=>g(this,null,function*(){var a;const t=window.location.href,o=((a=window.Shopify)==null?void 0:a.shop)||Et();if(!this.appKey&&!o)return;const s=Nn(),n=this.rules.getTolstoyViewers(),i=o||window.location.host,r={timestamp:Date.now(),url:t,sessionCount:Number($o()||0),lastSeenAt:new Date().toISOString(),firstSeenAt:Bo(),tolstoySeenCounter:n,isMobile:Bt.isMobile(),domain:i,appUrl:o,appKey:this.appKey};s&&(r.identifyInfoId=s);try{const d=yield dn(r);return d?(this.rules.updateRules(d),d):null}catch(d){return null}}));y(this,"init",()=>g(this,null,function*(){var r,a,d,c;if(!((r=this.account)!=null&&r.hasLiveBubble))return;const t=yield this.getBubbleSettings();this.subscribeToUrlChange();const o=window.tolstoyWidgetId||(t==null?void 0:t.publishId)||(t==null?void 0:t.exitIntentPublishId);if(!o){(d=(a=this.widget)==null?void 0:a.hide)==null||d.call(a);return}if(!((c=window.tolstoySettings)==null?void 0:c.alwaysShow)&&xo(o)==="true")return;const n=ts(o);let i;n===uo?i=yield P(()=>import("./c616a8cb4e/centered-modal.f4ad8b43.js"),["c616a8cb4e/modal.eb93a2a4.css"]):n===lo&&(i=yield P(()=>import("./c616a8cb4e/bubble.599ad443.js"),["c616a8cb4e/modal.eb93a2a4.css","c616a8cb4e/bubble.4d99fbce.css"])),yield Jo(),this.widget?(this.widget.recreate(o,n),this.widget.show()):(this.widget=new Sa,yield this.widget.init({bubbleSettings:t,widgetId:o,Component:i.default}))}));y(this,"handleUrlChange",()=>{this.unsubscribeFromUrlChange(),this.init()});this.account=ss,this.rules=new es,this.appKey=R()}subscribeToUrlChange(){h.subscribe({eventName:l.urlChange,callback:this.handleUrlChange})}unsubscribeFromUrlChange(){h.unsubscribe({eventName:l.urlChange,callback:this.handleUrlChange})}}const Ma={tvContainer:"tolstoy-video-page"},Ua="tolstoy-tv-container",uu="tolstoy-tv",pu={};class Da{constructor(){this.domUpdatesListenerInitialized=!1,this.loaded=!1}init(){return g(this,null,function*(){yield this.loadVideo(),!this.loaded&&this.registerDomUpdatesListenerIfNeeded()})}loadVideo(){return g(this,null,function*(){const t=document.querySelector(`#${Ua}`);if(!t)return;const o=(yield P(()=>import("./c616a8cb4e/tv.05a82209.js"),["c616a8cb4e/tv.176639ca.css"])).default;new o({tolstoyContainer:t}).init(),this.loaded=!0})}registerDomUpdatesListenerIfNeeded(){if(this.domUpdatesListenerInitialized)return;const t=[Ma.tvContainer];Fo({classNames:t,callback:()=>this.loadVideo()}),this.domUpdatesListenerInitialized=!0}}const ka=[l.urlChange],$a=e=>{switch(e.data.eventName){case l.urlChange:return Wo();default:return null}},Ba=["(+https://whatis.contentkingapp.com)","Shopify-Observe-Synthetic-Checks","+http://www.google.com/bot.html","https://naver.me/spd","HeadlessChrome","(+http://www.facebook.com/externalhit_uatext.php)","Bytespider","bot"],xa=()=>Ba.some(e=>window.navigator.userAgent.includes(e)),j={addToCart:"tolstoy_add_to_cart",spotlightCarouselQuickShopClick:"tolstoy_spotlight_carousel_quick_shop_click",productCardClick:"tolstoy_product_card_click"},C={addToCartSuccess:"tolstoy_add_to_cart_success",addToCartError:"tolstoy_add_to_cart_error",rejectCookiePolicy:"tolstoy_reject_cookie_policy",tolstoyZIndexChange:"tolstoy_z_index_change",urlLocaleUpdate:"tolstoy_url_locale_update",productUpdate:"tolstoy_product_update"},ns=Object.values(j),Ha=new Set([C.addToCartSuccess,C.addToCartError,C.rejectCookiePolicy,C.tolstoyZIndexChange,C.urlLocaleUpdate,C.productUpdate]),Wa=({eventName:e,callback:t})=>{if(!ns.includes(e)){console.error(`Event ${e} is not a valid event`);return}if(!t){console.error("Callback must be provided");return}if(typeof t!="function"){console.error("Callback must be a function");return}return!0};class lt extends Yo{constructor(){if(lt.instance)return lt.instance;super({shouldIncludeLogs:!0});y(this,"eventHandler",({data:o={}})=>{const{eventName:s}=o;if(this.eventCallbacks[s])for(const n of this.eventCallbacks[s])try{n(o)}catch(i){console.error(i)}});y(this,"subscribe",(o,s,n={})=>{if(Wa({eventName:o,callback:s}))try{super.subscribe({eventName:o,callback:s}),h.postMessage({eventName:l.externalEventSubscribed,subscribedEventName:o,payload:n});const i=new CustomEvent("TOLSTOY_WIDGET_V2_SUBSCRIBE",{detail:{eventName:o,payload:n,callback:s}});window.dispatchEvent(i),console.log("Subscribed to event",o)}catch(i){console.error(i)}});y(this,"unsubscribe",(o,s)=>super.unsubscribe({eventName:o,callback:s}));y(this,"initInternalMessagingSubscriptions",()=>{h.subscribeMultipleEvents({eventNames:ns,callback:this.eventHandler})});lt.instance=this}init(){this.initInternalMessagingSubscriptions(),this.initListener(this.eventHandler)}}const Lt=new lt;Object.freeze(Lt);const Va=e=>{const{eventName:t}=e;if(!t){console.error("eventName is required");return}if(!Ha.has(t)){console.error(`${t} is not a valid eventName`);return}return!0};class Fa{constructor(){y(this,"postMessage",(t={})=>{Va(t)&&h.postMessage(t)})}closePlayer(){h.postMessage({eventName:l.closePlayer})}changeEmail(t){window.tolstoyUser=t,h.postMessage({eventName:l.userEmailUpdate,email:t})}identify(){return g(this,arguments,function*(t={}){var n;const{email:o,userId:s}=t;if(!o&&!s){console.error("No email or userId");return}try{o&&this.changeEmail(o),s&&(t.userId=s.toString()),t.appKey=R();const i=yield rn(t);Ln(i==null?void 0:i.id)}catch(i){console.error("Error occurred while updating identify info:",i),(n=window.tolstoyCaptureError)==null||n.call(window,i,"Error occurred while updating identify info:"),Mn()}})}}const ye=new Fa;Object.freeze(ye);const Ya=[l.modalOpen];class Ga{constructor(){y(this,"internalMessagingHandler",t=>{switch(t.data.eventName){case l.modalOpen:this.sendIsAfterpayAppInstalledMessage();return;default:return null}})}sendIsAfterpayAppInstalledMessage(){h.postMessage({eventName:l.isAfterpayAppInstalled,value:!!(window!=null&&window.Afterpay)})}initInternalMessagingSubscriptions(){h.subscribeMultipleEvents({eventNames:Ya,callback:this.internalMessagingHandler})}init(){this.initInternalMessagingSubscriptions()}}const is=new Ga;Object.freeze(is);const ja=()=>{wn(),mn(Wt.rejected),h.postMessage({eventName:l.rejectCookiePolicy})},Ka=[C.rejectCookiePolicy];class dt{constructor(){y(this,"externalMessagingHandler",t=>{switch(t.data.eventName){case C.rejectCookiePolicy:return ja();default:return null}});y(this,"initExternalMessagingSubscriptions",()=>{h.subscribeMultipleEvents({eventNames:Ka,callback:this.externalMessagingHandler})});if(dt.instance)return dt.instance;dt.instance=this}init(){this.initExternalMessagingSubscriptions()}}const rs=new dt;Object.freeze(rs);const qa={itemSoldOut:"itemSoldOut"},as={tolstoyAnonymousId:"__tolstoyAnonymousId"},za=({description:e})=>{switch(e){case qa.itemSoldOut:return l.addToCartSoldOut;default:return l.addToCartError}},Za=({data:e})=>{const{description:t}=e,o=za({description:t});h.postMessage(S(f({},e),{eventName:o}))},Qa=({data:e})=>{const{variantId:t,productId:o,transmissionId:s,quantity:n,productHandle:i,templateSuffix:r}=e;h.postMessage({variantId:t,productId:o,transmissionId:s,quantity:n,productHandle:i,eventName:j.addToCart,templateSuffix:r})},Xa=({data:e})=>{const{product:t,transmissionId:o}=e;h.postMessage({product:t,transmissionId:o,eventName:j.spotlightCarouselQuickShopClick})},Ja=({data:e})=>{const{subscribedEventName:t,payload:o={}}=e,{disableDefault:s}=o;switch(t){case j.addToCart:case j.spotlightCarouselQuickShopClick:s&&h.postMessage({eventName:l.addToCartDisableDefault});break;default:return null}},tc=({data:e})=>{h.postMessage(S(f({},e),{eventName:l.addToCartSuccess}))},ec=[l.addToCart,l.spotlightCarouselQuickShopClick,l.externalEventSubscribed],oc=[C.addToCartSuccess,C.addToCartError];class ut{constructor(){y(this,"internalMessagingHandler",t=>{switch(t.data.eventName){case l.addToCart:return Qa(t);case l.spotlightCarouselQuickShopClick:return Xa(t);case l.externalEventSubscribed:return Ja(t);default:return null}});y(this,"externalMessagingHandler",t=>{switch(t.data.eventName){case C.addToCartSuccess:return tc(t);case C.addToCartError:return Za(t);default:return null}});y(this,"initInternalMessagingSubscriptions",()=>{h.subscribeMultipleEvents({eventNames:ec,callback:this.internalMessagingHandler})});y(this,"initExternalMessagingSubscriptions",()=>{h.subscribeMultipleEvents({eventNames:oc,callback:this.externalMessagingHandler})});if(ut.instance)return ut.instance;ut.instance=this}init(){this.initInternalMessagingSubscriptions(),this.initExternalMessagingSubscriptions()}}const cs=new ut;Object.freeze(cs);const sc=[l.openKendoModal];class nc{constructor(){y(this,"internalMessagingHandler",t=>{var o,s;switch(t.data.eventName){case l.openKendoModal:h.postMessage({eventName:l.changeZIndex,zIndex:1e3}),(s=(o=window.KENDO)==null?void 0:o.openQuickModalByHandle)==null||s.call(o,t.data.productHandle);const n=t.data.quantity;if(n<=1)return;for(let i=1;i{var a;const r=document.querySelector(".quantity-selector__action--increment");(a=r==null?void 0:r.click)==null||a.call(r)},1e3+i*150);return;default:return null}})}initInternalMessagingSubscriptions(){h.subscribeMultipleEvents({eventNames:sc,callback:this.internalMessagingHandler})}init(){this.initInternalMessagingSubscriptions()}}const ls=new nc;Object.freeze(ls);const ds={USD:"$",CAD:"CA$",EUR:"€",AED:"د.إ.‏",AFN:"؋",ALL:"Lek",AMD:"դր.",ARS:"$",AUD:"AU$",AZN:"ман.",BAM:"KM",BDT:"৳",BGN:"лв.",BHD:"د.ب.‏",BIF:"FBu",BND:"$",BOB:"Bs",BRL:"R$",BWP:"P",BYN:"руб.",BZD:"$",CDF:"FrCD",CHF:"CHF",CLP:"$",CNY:"CN¥",COP:"$",CRC:"₡",CVE:"CV$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"د.ج.‏",EEK:"kr",EGP:"ج.م.‏",ERN:"Nfk",ETB:"Br",GBP:"£",GEL:"GEL",GHS:"GH₵",GNF:"FG",GTQ:"Q",HKD:"$",HNL:"L",HRK:"kn",HUF:"Ft",IDR:"Rp",ILS:"₪",INR:"₹",IQD:"د.ع.‏",IRR:"﷼",ISK:"kr",JMD:"$",JOD:"د.أ.‏",JPY:"¥",KES:"Ksh",KHR:"៛",KMF:"FC",KRW:"₩",KWD:"د.ك.‏",KZT:"тңг.",LBP:"ل.ل.‏",LKR:"SL Re",LTL:"Lt",LVL:"Ls",LYD:"د.ل.‏",MAD:"د.م.‏",MDL:"MDL",MGA:"MGA",MKD:"MKD",MMK:"K",MOP:"MOP$",MUR:"MURs",MXN:"MX$",MYR:"RM",MZN:"MTn",NAD:"N$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"नेरू",NZD:"$",OMR:"ر.ع.‏",PAB:"B/.",PEN:"S/.",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"₲",QAR:"ر.ق.‏",RON:"RON",RSD:"дин.",RUB:"₽.",RWF:"FR",SAR:"ر.س.‏",SDG:"SDG",SEK:"kr",SGD:"$",SOS:"Ssh",SYP:"ل.س.‏",THB:"฿",TND:"د.ت.‏",TOP:"T$",TRY:"TL",TTD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",UYU:"$",UZS:"UZS",VEF:"Bs.F.",VND:"₫",XAF:"FCFA",XOF:"CFA",YER:"ر.ي.‏",ZAR:"R",ZMK:"ZK",ZWL:"ZWL$"},ic=e=>({id:e.id,price:e.price,compareAtPrice:e.price,currencyCode:e.currency,currencySymbol:ds[e.currency],variants:[{price:e.price,compareAtPrice:e.price}]}),rc=(e="")=>e.replace("_","-"),ac=[l.openCommerceSettingsUpdate,l.requestProductsUpdate],Jt={},At={};class cc{constructor(){y(this,"fetchProduct",t=>g(this,null,function*(){const o=`${this.apiBaseUrl}/products/${t}`,s=new URL(o);s.searchParams.append("client_id",this.clientId),s.searchParams.append("locale",this.locale),s.searchParams.append("currency",this.currencyCode),s.searchParams.append("expand","prices");try{const i=yield(yield fetch(s)).json();return ic(i)}catch(n){console.error("Error fetching product price",n)}}));y(this,"getProduct",t=>g(this,null,function*(){if(Jt[t])return Jt[t];if(At[t])return At[t];const o=this.fetchProduct(t);At[t]=o;const s=yield o;return Jt[t]=s,delete At[t],s}));y(this,"onRequestProductsUpdateMessage",o=>g(this,[o],function*({productIds:t}){const n=[...new Set(t)].map(r=>this.getProduct(r)),i=(yield Promise.all(n)).filter(Boolean);for(const r of i)h.postMessage({eventName:l.productUpdateResponse,product:r,isProductUpdateResponse:!0})}));y(this,"internalMessagingHandler",t=>{switch(t.data.eventName){case l.openCommerceSettingsUpdate:return this.onOpenCommerceSettingsUpdate(t.data);case l.requestProductsUpdate:return this.onRequestProductsUpdateMessage(t.data);default:return null}});var t,o,s,n;this.isOpenCommerceStore=!!window.CQuotient,this.siteId=(t=window.CQuotient)==null?void 0:t.siteId,this.locale=rc((o=window.CQuotient)==null?void 0:o.locale),this.apiBaseUrl="",this.clientId="",this.currencyCode=(n=(s=window.pageContext)==null?void 0:s.ecommerce)==null?void 0:n.currencyCode}postUrlLocaleUpdateIfNeeded(t){this.locale!==t&&h.postMessage({eventName:l.urlLocaleUpdate,urlLocale:this.locale})}postIsNonBaseCurrencyIfNeeded(t){this.currencyCode!==t&&h.postMessage({eventName:l.isNonBaseCurrency,currencyCode:this.currencyCode})}onOpenCommerceSettingsUpdate({openCommerceSettings:t}){const{apiVersion:o,clientId:s,baseLocale:n,baseCurrency:i}=t;this.apiBaseUrl=`https://${window.location.host}/s/${this.siteId}/dw/shop/${o}`,this.clientId=s,this.postUrlLocaleUpdateIfNeeded(n),this.postIsNonBaseCurrencyIfNeeded(i)}initInternalMessagingSubscriptions(){h.subscribeMultipleEvents({eventNames:ac,callback:this.internalMessagingHandler})}init(){this.isOpenCommerceStore&&this.initInternalMessagingSubscriptions()}}const lc=new cc,dc=[l.externalEventSubscribed,l.productCardClick],uc=({subscribedEventName:e,payload:t})=>{switch(e){case j.productCardClick:{const{disableProductModal:o=!0}=t;h.postMessage({eventName:l.productCardClickSubscribed,isDisableProductModal:o});break}default:return null}},pc=({data:e})=>{const{eventName:t}=e;switch(t){case l.externalEventSubscribed:{const{subscribedEventName:o,payload:s}=e;uc({subscribedEventName:o,payload:s});break}case l.productCardClick:{const{variantId:o,productId:s,externalProductIds:n,productHandle:i}=e;h.postMessage({eventName:j.productCardClick,variantId:o,productId:s,taggedProductIds:n,productHandle:i});break}default:return null}};class hc{initInternalMessagingSubscriptions(){h.subscribeMultipleEvents({eventNames:dc,callback:pc})}init(){this.initInternalMessagingSubscriptions()}}const us=new hc;Object.freeze(us);const gc=[l.getProductsMetafields];class yc{constructor(){y(this,"internalMessagingHandler",({data:t})=>{var o;switch(t.eventName){case l.getProductsMetafields:if(!((o=t==null?void 0:t.productIds)!=null&&o.length))return;h.postMessage({productsExtraData:this.getProductsMetafields(t.productIds),modalId:t.modalId,eventName:l.returnProductsMetafields});return;default:return null}})}getProductsMetafields(t=[]){var s,n;const o={};for(const i of t)o[i]=(n=(s=window==null?void 0:window.metafields)==null?void 0:s.products)==null?void 0:n[i];return o}initInternalMessagingSubscriptions(){h.subscribeMultipleEvents({eventNames:gc,callback:this.internalMessagingHandler})}init(){this.initInternalMessagingSubscriptions()}}const ps=new yc;Object.freeze(ps);const fc=[C.productUpdate],mc=["id","descriptionHtml","description_html","variants","price","compare_at_price","title"],wc=["id","price","compare_at_price","title"],Ec=e=>mc.includes(e),Sc=e=>Array.isArray(e)?e.flatMap((t,o)=>{const n=Object.keys(t).filter(i=>!wc.includes(i));return n.length===0?[]:`variants[${o}]: { ${n.join(", ")} }`}):["variants (must be an array)"],Tc=({product:e})=>{const o=Object.keys(e).filter(s=>!Ec(s));if(e.variants&&o.push(...Sc(e.variants)),o.length>0){console.error(`Fields ${o.join(", ")} are not supported for product update.`);return}h.postMessage({product:e,eventName:l.productUpdateResponse})},Ic=({data:e})=>{switch(e.eventName){case C.productUpdate:return Tc(e);default:return null}};class bc{initExternalMessagingSubscriptions(){h.subscribeMultipleEvents({eventNames:fc,callback:Ic})}init(){this.initExternalMessagingSubscriptions()}}const hs=new bc;Object.freeze(hs);const _c=[l.openRebuyCart],te={show:"rebuy:smartcart.show",hide:"rebuy:smartcart.hide",init:"rebuy:smartcart.init"};class Cc{constructor(){y(this,"sendIsRebuyAppInstalledMessage",()=>{var t,o;if(!((t=window==null?void 0:window.Rebuy)!=null&&t.SmartCart)){document.addEventListener(te.init,this.sendIsRebuyAppInstalledMessage,{once:!0});return}h.postMessage({eventName:l.isRebuyAppInstalled,value:!!((o=window==null?void 0:window.Rebuy)!=null&&o.SmartCart)}),this.initRebuyEventListeners()});y(this,"internalMessagingHandler",t=>{var o,s;switch(t.data.eventName){case l.openRebuyCart:return(s=(o=window==null?void 0:window.Rebuy)==null?void 0:o.SmartCart)==null?void 0:s.show();default:return null}})}initInternalMessagingSubscriptions(){h.subscribeMultipleEvents({eventNames:_c,callback:this.internalMessagingHandler})}initRebuyEventListeners(){document.addEventListener(te.show,()=>{h.postMessage({eventName:l.rebuyCartShown})}),document.addEventListener(te.hide,()=>{h.postMessage({eventName:l.rebuyCartHidden})})}init(){this.initInternalMessagingSubscriptions(),this.sendIsRebuyAppInstalledMessage()}}const gs=new Cc;Object.freeze(gs);const Ac=()=>{var e,t;return Number((t=(e=window.Shopify)==null?void 0:e.currency)==null?void 0:t.rate)===1},hu=e=>typeof e=="string"&&e.includes("cdn.shopify.com"),no={soldOut:"already sold out",sellingPlanRequired:"Variant can only be purchased with a selling plan."},Oc=[l.addToCartDisableDefault,l.setAnonymousIdToCart,l.loginWithMultipassUrlRequest,l.cartItemQuantityChange,l.cartDataRequest,l.productRecommendationsRequest,l.requestProductsUpdate,l.blockAnonymousIdToCart],io=[l.addToCart,l.spotlightCarouselQuickShopClick],ee=e=>({headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(e)});let ro=!1,oe=!1;const se={},Ot={};class pt{constructor(){y(this,"getProduct",t=>g(this,null,function*(){if(se[t])return se[t];if(Ot[t])return Ot[t];const o=this.fetchRawProduct(t);Ot[t]=o;const s=yield o;return se[t]=s,delete Ot[t],s}));y(this,"onRequestProductsUpdateMessage",o=>g(this,[o],function*({handles:t}){const n=[...new Set(t)].map(r=>this.getProduct(r)),i=(yield Promise.all(n)).filter(Boolean);for(const r of i)h.postMessage({eventName:l.productUpdateResponse,product:r,isProductUpdateResponse:!0})}));y(this,"shopifyAddToCart",r=>g(this,[r],function*({variantId:t,productHandle:o,sellingPlanId:s,quantity:n=Hs,transmissionId:i}){const a={};oe||(a._isAddedFromTolstoy=!0,Ve(t));const d={id:t,quantity:n,properties:a};s&&(d.selling_plan=s);const u=ee({items:[d]});try{const p=yield fetch(`${this.storeRootUrl}cart/add.js`,u);if(!p.ok){const w=yield p.json();return this.handleAddToCartError({error:w,variantId:t,productHandle:o,transmissionId:i})}this.triggerExternalCartUpdate(),Ve(t),h.postMessage({eventName:l.addToCartSuccess,variantId:t,transmissionId:i,shouldEndTransmission:!1}),this.getCart({transmissionId:i})}catch(p){console.log(p),this.handleAddToCartError({error:p,variantId:t,productHandle:o,transmissionId:i})}}));y(this,"shopifyUpdateItemQuantity",n=>g(this,[n],function*({variantId:t,quantity:o,transmissionId:s}){const i={updates:{[t]:o}},r=ee(i);try{const a=yield fetch(`${this.storeRootUrl}cart/update.js`,r);if(!a.ok){const d=yield a.json();return this.handleUpdateItemQuantityError({error:d,variantId:t,transmissionId:s})}this.triggerExternalCartUpdate(),h.postMessage({eventName:l.cartItemQuantityChangeSuccess,variantId:t,transmissionId:s,shouldEndTransmission:!1}),this.getCart({transmissionId:s})}catch(a){this.handleUpdateItemQuantityError({error:a,variantId:t,transmissionId:s})}}));y(this,"internalMessagingHandler",t=>{switch(t.data.eventName){case l.addToCart:return this.shopifyAddToCart(t.data);case l.spotlightCarouselQuickShopClick:return this.shopifyQuickShopClick(t.data);case l.addToCartDisableDefault:return this.disableAddToCart(t.data);case l.blockAnonymousIdToCart:return this.blockAnonymousIdToCart(t.data);case l.setAnonymousIdToCart:return this.setAnonymousIdToCart(t.data);case l.loginWithMultipassUrlRequest:return this.loginWithMultipassUrl(t.data);case l.cartItemQuantityChange:return this.shopifyUpdateItemQuantity(t.data);case l.cartDataRequest:return this.getCart(t.data);case l.productRecommendationsRequest:return this.getProductRecommendations(t.data);case l.requestProductsUpdate:return this.onRequestProductsUpdateMessage(t.data);default:return null}});y(this,"initInternalMessagingSubscriptions",()=>{if(h.subscribeMultipleEvents({eventNames:Oc,callback:this.internalMessagingHandler}),ro){xt("Add to cart disabled");return}h.subscribeMultipleEvents({eventNames:io,callback:this.internalMessagingHandler})});var t,o,s,n;if(pt.instance)return pt.instance;pt.instance=this,this.isShopifyStore=!!((t=window.Shopify)!=null&&t.shop&&((o=window.Shopify)!=null&&o.routes)),this.storeRootUrl=(n=(s=window.Shopify)==null?void 0:s.routes)==null?void 0:n.root}getIsProductSoldOutError(t){return t.includes(no.soldOut)}getIsSellingPlanError(t){return t.includes(no.sellingPlanRequired)}formatProduct(t){var n,i,r;if(!t)return null;const o=((i=(n=window.Shopify)==null?void 0:n.currency)==null?void 0:i.active)||((r=window.Shopify)==null?void 0:r.currency),s=window.tolstoyCurrencySymbol||ds[o];return S(f({},t),{id:String(t.id),price:t.price/100,compare_at_price:t.compare_at_price?t.compare_at_price/100:t.compare_at_price,currencyCode:o,currencySymbol:s,variants:t.variants.map(a=>S(f({},a),{price:a.price/100,compare_at_price:a.compare_at_price?a.compare_at_price/100:a.compare_at_price}))})}fetchRawProduct(t){return g(this,null,function*(){const o=this.storeRootUrl+`products/${t}.js`;try{const n=yield(yield fetch(o)).json();return this.formatProduct(n)}catch(s){}})}handleSellingPlanError(t,o){return g(this,null,function*(){const s=yield this.getProduct(o);if(!s)return;const{id:n}=s.selling_plan_groups[0].selling_plans[0];return this.shopifyAddToCart({variantId:t,productHandle:o,sellingPlanId:n})})}handleAddToCartError({error:t,variantId:o,productHandle:s,transmissionId:n}){const{description:i}=t;if(this.getIsProductSoldOutError(i)){h.postMessage({eventName:l.addToCartSoldOut,variantId:o,transmissionId:n});return}if(this.getIsSellingPlanError(i))return this.handleSellingPlanError(o,s);h.postMessage({eventName:l.addToCartError,error:i,variantId:o,transmissionId:n})}handleUpdateItemQuantityError({error:t,variantId:o,transmissionId:s}){const{description:n}=t;h.postMessage({eventName:l.cartItemQuantityChangeError,error:n,variantId:o,transmissionId:s})}getCart(o){return g(this,arguments,function*({transmissionId:t}){try{const n=yield(yield fetch(`${this.storeRootUrl}cart.js`,{method:"GET"})).json();h.postMessage({eventName:l.cartDataResponse,cart:n,transmissionId:t})}catch(s){}})}triggerExternalCartUpdate(){var t,o,s,n,i,r,a,d,c,u,p;(i=(n=(s=(o=(t=window.VueMiniCart)==null?void 0:t.$store)==null?void 0:o._actions)==null?void 0:s.initCart)==null?void 0:n[0])==null||i.call(n),(d=(a=(r=window.slate)==null?void 0:r.cart)==null?void 0:a.reloadCart)==null||d.call(a),(c=window.tolstoyCartRefresh)==null||c.call(window),(u=window.monster_refresh)==null||u.call(window),(p=window.updateMiniCart)==null||p.call(window)}disableAddToCart(){ro=!0,h.unsubscribeMultipleEvents({eventNames:io,callback:this.internalMessagingHandler})}postUrlLocaleUpdateIfNeeded(){var t,o,s,n;((o=(t=window.Shopify)==null?void 0:t.routes)==null?void 0:o.root)!=="/"&&h.postMessage({eventName:l.urlLocaleUpdate,urlLocale:(n=(s=window.Shopify)==null?void 0:s.routes)==null?void 0:n.root})}postIsNonBaseCurrencyIfNeeded(){Ac()||h.postMessage({eventName:l.isNonBaseCurrency})}shopifyQuickShopClick({product:t}){const{variants:o,handle:s,quantity:n=1}=t,i=o[0].id;return this.shopifyAddToCart({variantId:i,productHandle:s,quantity:n})}getProductRecommendations(s){return g(this,arguments,function*({productId:t,transmissionId:o}){const n=`${this.storeRootUrl}recommendations/products.json?product_id=${t}`;try{const i=yield fetch(n,{method:"GET"}),{products:r}=yield i.json();h.postMessage({eventName:l.productRecommendationsResponse,productId:t,products:r,transmissionId:o})}catch(i){}})}loginWithMultipassUrl(s){return g(this,arguments,function*({multipassUrl:t,transmissionId:o}){try{const n=yield fetch(t);h.postMessage({eventName:l.loginWithMultipassUrlResponse,statusCode:n.status,transmissionId:o})}catch(n){}})}setAnonymousIdToCart(o){return g(this,arguments,function*({anonymousId:t}){if(Vn()==="true"||oe||!N())return;const s={attributes:{[as.tolstoyAnonymousId]:t}},n=ee(s);try{yield fetch(`${this.storeRootUrl}cart/update.js`,n),Fn(!0)}catch(i){console.error(i)}})}blockAnonymousIdToCart(o){return g(this,arguments,function*({appKey:t}){const s=Pn(t);qs(s)||(yield this.setAnonymousIdToCart({anonymousId:null})),oe=!0})}forceClearAnonymousIdFromCart(){var o;if(((o=window.Shopify)==null?void 0:o.shop)!=="mlt-boutique.myshopify.com")return;const t=R();t&&this.blockAnonymousIdToCart({appKey:t})}init(){this.isShopifyStore&&(this.initInternalMessagingSubscriptions(),this.postUrlLocaleUpdateIfNeeded(),this.postIsNonBaseCurrencyIfNeeded(),this.forceClearAnonymousIdFromCart())}}const ys=new pt;Object.freeze(ys);const vc=[l.addToCart,l.playerReady,l.productCardClick],Rc={cartUpdated:"cart/updated"},Pc=({productId:e,variantId:t})=>{const o={productId:String(e)};return t&&(o.variantId=String(t)),window.Tapcart.actions.openProduct(o)},Lc=e=>{const o=setTimeout(()=>{h.postMessage(S(f({},e),{eventName:l.addToCartError}))},4e3);window.Tapcart.registerEventHandler(Rc.cartUpdated,()=>{clearTimeout(o),h.postMessage(S(f({},e),{eventName:l.addToCartSuccess}))})},Nc=e=>g(void 0,null,function*(){const{variantId:t,productId:o}=e;try{Lc(e),window.Tapcart.actions.addToCart({lineItems:[{variantId:String(t||o),quantity:1}]})}catch(s){return h.postMessage(S(f({},e),{error:s,eventName:l.addToCartError}))}}),Mc=()=>{var e,t,o,s,n,i;try{const r=Co();if(!r)return;const d=[...((o=(t=(e=window==null?void 0:window.Tapcart)==null?void 0:e.variables)==null?void 0:t.cart)==null?void 0:o.attributes)||[],{key:as.tolstoyAnonymousId,value:r}];(i=(n=(s=window==null?void 0:window.Tapcart)==null?void 0:s.actions)==null?void 0:n.updateCartAttributes)==null||i.call(n,{attributes:d})}catch(r){pe({text:r==null?void 0:r.message,parentUrl:window.location.href,appKey:R(),source:"tapcart",eventName:"widgetError",timestamp:new Date().toISOString()})}};class Uc{constructor(){y(this,"internalMessagingHandler",t=>{switch(t.data.eventName){case l.playerReady:return this.disableCartDefault();case l.productCardClick:return Pc(t.data);case l.addToCart:return Nc(t.data);default:return null}})}disableCartDefault(){h.postMessage({eventName:l.addToCartDisableDefault})}initInternalMessagingSubscriptions(){h.subscribeMultipleEvents({eventNames:vc,callback:this.internalMessagingHandler})}init(){Tt()&&(this.initInternalMessagingSubscriptions(),Mc())}}const fs=new Uc;Object.freeze(fs);const Dc=[C.urlLocaleUpdate],kc=({data:e})=>{switch(e.eventName){case C.urlLocaleUpdate:const{payload:t}=e;h.postMessage({eventName:l.urlLocaleUpdate,urlLocale:t.urlLocale});break;default:return null}};class ht{constructor(){if(ht.instance)return ht.instance;ht.instance=this}initExternalMessagingSubscriptions(){h.subscribeMultipleEvents({eventNames:Dc,callback:kc})}init(){this.initExternalMessagingSubscriptions();const t=window.history.pushState,o=window.history.replaceState;let s=window.location.href;const n=()=>{window.location.href!==s&&(s=window.location.href,h.postMessage({eventName:l.urlChange}))};window.history.pushState=function(){t.apply(window.history,arguments),n()},window.history.replaceState=function(){o.apply(window.history,arguments),n()}}}const ms=new ht;Object.freeze(ms);const $c=[C.addToCartSuccess,C.addToCartError];class gt{constructor(){y(this,"postMessageToWidgetV2",t=>{const{data:o}=t||{},{eventName:s,subscribedEventName:n}=o||{};if(!s&&!n)return;const i=new CustomEvent("TOLSTOY_WIDGET_V2_MESSAGE",{detail:S(f({},o),{eventName:n||s})});window.dispatchEvent(i)});y(this,"initExternalMessagingSubscriptions",()=>{h.subscribeMultipleEvents({eventNames:$c,callback:this.postMessageToWidgetV2})});if(gt.instance)return gt.instance;gt.instance=this}init(){this.initExternalMessagingSubscriptions()}}const ws=new gt;Object.freeze(ws);class Bc{constructor(){this.domUpdatesListenerInitialized=!1,this.loaded=!1}init(){return g(this,null,function*(){})}loadVideo(){return g(this,null,function*(){})}registerDomUpdatesListenerIfNeeded(){}}const xc=[l.addToCartError,l.addToCartSuccess,l.addToCartSoldOut,l.isRebuyAppInstalled,l.isAfterpayAppInstalled,l.openRebuyCart,l.returnProductsMetafields,l.rejectCookiePolicy,l.productCardClickSubscribed,l.isTapcart,l.urlLocaleUpdate,l.loginWithMultipassUrlResponse,l.cartDataResponse,l.cartItemQuantityChangeSuccess,l.cartItemQuantityChangeError,l.productRecommendationsResponse,l.productUpdateResponse,l.isNonBaseCurrency,l.eventListenersInitialized],vt={},ne={},Rt={},ie=[];class yt{constructor(){y(this,"eventHandler",({data:t={}})=>{const{modalId:o,eventName:s}=t;if(o)switch(s){case l.addToCart:case l.openRebuyCart:case l.openKendoModal:case l.getProductsMetafields:case l.productCardClick:case l.loginWithMultipassUrlRequest:case l.cartItemQuantityChange:case l.cartDataRequest:case l.productRecommendationsRequest:case l.requestProductsUpdate:case l.moveToUrl:case l.showFeedProductModal:case l.reportModalOpen:case l.reportModalClose:case ao:return this.postInternalMessage({modalId:o,data:t});case l.modalMessagingReady:return this.postInternalMessage({modalId:o,data:t}),this.handleModalMessagingReady({modalId:o});case l.toggleFeedCloseButton:return this.postInternalMessage({modalId:o,data:t});default:return null}});y(this,"internalEventHandler",({data:t})=>{this.postMessageToModal(t)});y(this,"initInternalMessagingSubscriptions",()=>{h.subscribeMultipleEvents({eventNames:xc,callback:this.internalEventHandler})});if(yt.instance)return yt.instance;yt.instance=this}registerIframe({modalId:t,modalIframe:o}){vt[t]=o}postInternalMessage({modalId:t,data:o}){delete o.modalId;const s=h.postMessage(o);Rt[s]=t}handleModalMessagingReady({modalId:t}){ne[t]=!0;const o=vt[t];for(const s of ie){const{transmissionId:n}=s,i=Rt[n];(!i||i===t)&&this.postMessageToIframe({iframe:o,message:s})}}postMessageToIframe({iframe:t,message:o}){var s;(s=t.contentWindow)==null||s.postMessage(o,"*")}postMessageToAllIframes({message:t}){ie.push(t);for(const[o,s]of Object.entries(vt))ne[o]&&this.postMessageToIframe({iframe:s,message:t})}postMessageToModal(t){const d=t,{transmissionId:o,shouldEndTransmission:s=!0}=d,n=Be(d,["transmissionId","shouldEndTransmission"]),i=Rt[o];if(!i)return this.postMessageToAllIframes({message:n});if(!ne[i]){ie.push(t);return}const a=vt[i];this.postMessageToIframe({iframe:a,message:n}),s&&delete Rt[o]}init(){this.initInternalMessagingSubscriptions(),window.addEventListener("message",this.eventHandler)}}const fe=new yt;Object.freeze(fe);const Hc=50,Wc="8b32dacc-8f1d-4cce-b641-9f60e88f9414",Vc=()=>{var t,o;const e=((t=document.currentScript)==null?void 0:t.src)||((o=import.meta)==null?void 0:o.url);if(e!=null&&e.includes("/we/widget.js")){Ge({src:`https://${de}/wes/widget.js`,container:document.head,attributes:{type:"module"}});return}Ge({src:`https://${de}/ws/widget.js`,container:document.head})},Fc=()=>!!document.body,Yc=()=>{try{return window.self!==window.top}catch(e){return!0}},Gc=()=>Yc()&&window.location.host==="theordinary.com",Es=()=>g(void 0,null,function*(){var e,t,o,s,n,i;try{if(window.tolstoyWidget||Gc())return;if(xa()){console.debug("Bot user");return}if(!Fc()){setTimeout(Es,Hc);return}if(Tt()&&(yield gi()),Ao())return;if(V("td")==="true"&&!((o=(t=(e=document.currentScript)==null?void 0:e.src)==null?void 0:t.includes)!=null&&o.call(t,"/ws/widget.js"))&&!((i=(n=(s=import.meta)==null?void 0:s.url)==null?void 0:n.includes)!=null&&i.call(n,"/wes/widget.js"))){Vc();return}zn(),Qc(),Xc(),Jc(),tl(),el(),ol(),Wo(),yield jc(),yield Promise.all([Kc(),qc(),Zc(),zc()]),oi()}catch(r){console.log("error",r)}}),jc=()=>g(void 0,null,function*(){return ss.init()}),Kc=e=>new Na(e).init(),qc=()=>new Da().init(),zc=()=>new wa().init(),Zc=()=>new Bc().init(),Qc=()=>(h.init(),h),Xc=()=>(fe.init(),fe),Jc=()=>{Lt.init();const{subscribe:e,unsubscribe:t}=Lt;return window.tolstoyWidget=S(f({},window.tolstoyWidget),{subscribe:e,unsubscribe:t}),Lt},tl=()=>{const{postMessage:e,closePlayer:t,identify:o,changeEmail:s}=ye;return window.tolstoyWidget=S(f({},window.tolstoyWidget),{postMessage:e,closePlayer:t,identify:o,changeEmail:s}),ye},el=()=>{ys.init(),ms.init(),cs.init(),gs.init(),ls.init(),fs.init(),is.init(),rs.init(),us.init(),lc.init(),hs.init(),ws.init(),R()===Wc&&ps.init()},ol=()=>{h.subscribeMultipleEvents({eventNames:ka,callback:$a})};Es();export{Q as $,Nd as A,V as B,re as C,Ml as D,Rl as E,Vi as F,Fd as G,eu as H,l as I,zd as J,qt as K,rl as L,Zo as M,Re as N,Go as O,Rs as P,Xe as Q,Ks as R,Ns as S,wd as T,h as U,Ll as V,$r as W,Nl as X,Ul as Y,Pl as Z,P as _,Js as a,Vd as a$,Wl as a0,vs as a1,ce as a2,Ms as a3,zo as a4,qs as a5,jd as a6,ql as a7,jl as a8,Gr as a9,uo as aA,td as aB,lo as aC,es as aD,Ke as aE,ud as aF,hd as aG,ao as aH,Gt as aI,jt as aJ,Hl as aK,pd as aL,dd as aM,Id as aN,fd as aO,ad as aP,cd as aQ,Yd as aR,fo as aS,xo as aT,Bt as aU,Ur as aV,mo as aW,fe as aX,Ql as aY,Ho as aZ,Wn as a_,ld as aa,au as ab,le as ac,Mr as ad,iu as ae,Zl as af,qd as ag,Bl as ah,me as ai,X as aj,$l as ak,Us as al,vd as am,Rd as an,Pd as ao,ft as ap,T as aq,m as ar,Ki as as,Ds as at,Gl as au,ks as av,Fl as aw,po as ax,tu as ay,ed as az,Et as b,Si as b$,bd as b0,xt as b1,md as b2,ko as b3,Ua as b4,uu as b5,Ca as b6,Tt as b7,Co as b8,lu as b9,C as bA,va as bB,cu as bC,xl as bD,Oa as bE,du as bF,ul as bG,dl as bH,il as bI,al as bJ,nl as bK,ll as bL,cl as bM,Jl as bN,Ce as bO,yd as bP,od as bQ,gd as bR,hl as bS,pl as bT,yl as bU,gl as bV,fl as bW,Tl as bX,Ud as bY,Ed as bZ,Ei as b_,pu as ba,Yl as bb,Vs as bc,Ra as bd,Wd as be,Kt as bf,Hd as bg,rd as bh,kn as bi,id as bj,Cn as bk,Os as bl,Il as bm,Ol as bn,As as bo,Xd as bp,wl as bq,ml as br,rt as bs,Fr as bt,$s as bu,Al as bv,Sl as bw,Dr as bx,Md as by,El as bz,ru as c,Kl as c0,Ti as c1,Sd as c2,Qd as c3,zl as c4,xd as c5,Bd as c6,Cl as c7,Ad as c8,hu as c9,Td as ca,Od as cb,_l as cc,oi as cd,$d as ce,Dd as cf,kd as cg,Xl as ch,so as ci,Ut as cj,H as ck,Vl as cl,Kd as cm,Gd as cn,nu as d,bl as e,Wr as f,Jd as g,R as h,Cd as i,Vo as j,Zd as k,Eo as l,_d as m,ou as n,kr as o,nt as p,kl as q,Br as r,qo as s,Ps as t,vl as u,su as v,Yr as w,Dl as x,ae as y,Ld as z};