(()=>{"use strict";function t(t,e){if(null==t)return;const{length:s}=t;if(Array.isArray(t)||"number"==typeof s)for(let o=0;o=2&&e<=4&&(s<10||s>=20)?1:2]}`}}}},es:{Shop_this_look:"Compra este look",Shop_now:"Compra ahora",Posted_by:"Publicado por:",View_and_shop:"Entra y compra",Load_more:"Ver más",Submit:"Enviar",Report:"Reportar",Error:"Hubo un error al reproducir este video",Instagram_user:"Instagram user",Reviews:{full:{single:"Basado en 1 opinión",plural:"Basado en {count} opiniones"},short:{single:"1 opinión",plural:"{count} opiniones"}}},fr:{Shop_this_look:"Get this look",Shop_now:"Achetez maintenant",Posted_by:"Posted by:",View_and_shop:"View and shop",Load_more:"Load more",Submit:"Submit",Report:"Report",Error:"Une erreur s'est produite lors de la lecture de cette vidéo",Instagram_user:"Instagram user",Reviews:{full:{single:"Sur la base de 1 avis",plural:"Sur la base de {count} avis"},short:{single:"1 avis",plural:"{count} avis"}}},it:{Shop_this_look:"Get this look",Shop_now:"Acquistare ora",Posted_by:"Posted by:",View_and_shop:"View and shop",Load_more:"Load more",Submit:"Submit",Report:"Report",Error:"Si è verificato un errore durante la riproduzione di questo video",Instagram_user:"Instagram user",Reviews:{full:{single:"Basato su 1 recensione",plural:"Basato su {count} recensioni"},short:{single:"1 recensione",plural:"{count} recensioni"}}},nl:{Shop_this_look:"Shop this look",Shop_now:"Winkel nu",Posted_by:"Posted by:",View_and_shop:"View and shop",Load_more:"Load more",Submit:"Submit",Report:"Report",Error:"Er is een fout opgetreden bij het afspelen van deze video",Instagram_user:"Instagram user",Reviews:{full:{single:"Gebaseerd op 1 recensie",plural:"Gebaseerd op {count} recensies"},short:{single:"1 recensie",plural:"{count} recensies"}}},de:{Shop_this_look:"Shop this look",Shop_now:"Jetzt einkaufen",Posted_by:"Posted by:",View_and_shop:"View and shop",Load_more:"Load more",Submit:"Submit",Report:"Report",Error:"Beim Abspielen dieses Videos ist ein Fehler aufgetreten",Instagram_user:"Instagram user",Reviews:{full:{single:"Basiert auf 1 Bewertung",plural:"Basiert auf {count} Bewertungen"},short:{single:"1 Bewertung",plural:"{count} Bewertungen"}}}};function r(t){return!!t&&"object"==typeof t}const{isArray:a}=Array;function l(e,...s){if(null==e)e={};else if(!r(e))return e;return t(s,(s=>{null!=s&&t(s,((t,s)=>{if(null==t||"__proto__"===s)return;let o;if(r(t)){let i=e[s];a(t)&&!a(i)&&(i=[]),o=l(i,t)}else o=t;e[s]=o}))})),e}const c=window.Photoslurp=window.Photoslurp||{},d=c.support=c.support||{};let u;if("searchParams"in d)({searchParams:u}=d);else{u=!1;try{u=!!new URL(document.location+"").searchParams}catch(t){}d.searchParams=u}const p=u,h=function(t){return encodeURIComponent(t).replace(/[!'()*]/g,(t=>"%"+t.charCodeAt(0).toString(16).toUpperCase()))};let m=function(t,e){return(new RegExp("[?&]"+e+"=([^&#]*)").exec(t)||[])[1]},g=function(t,e,s,o){const i=new RegExp("(\\?|\\&)"+e+"\\=[^\\&]*(\\&|$)");if(i.test(t)&&null!=o){if(o)return t.toString().replace(i,(function(t,o,i){return o+h(e)+"="+h(s)+i}));if(!o)return console.error(`Query parameter ${e} is already defined: ${t}`),t}return t+(/\?/.test(t)?"&":"?")+h(e)+"="+h(s)},v=function(t,e,s,o){return g(t,e,s,o)},y=function(e,s,o){return t(s,(function(t,s){e=g(e,s,t,o)})),e};p&&(m=function(t,e){const s=new URL(t,window.location+"").searchParams.get(e);return null==s?void 0:s},g=function(t,e,s,o){const i=new URL(t,window.location+"");let n=i.searchParams;return o?n.set(e,s):!1===o&&n.has(e)?console.error(`Query parameter ${e} is already defined: ${t}`):n.append(e,s),i.search="?"+n,i+""});const f=Element.prototype,b=window.Photoslurp=window.Photoslurp||{},w=b.support=b.support||{};let S;if("removeElement"in w)({removeElement:S}=w);else{S=function(t){f.remove.call(t)};const t=document.createElement("div");try{t.remove()}catch(t){S=function(t){const{parentNode:e}=t;e&&e.removeChild(t)}}w.removeElement=S}const C=S,_=window.Photoslurp=window.Photoslurp||{},x=_.support=_.support||{};let E,k,P,I;if("nativeCode"in x)({addEventListener:E,fetch:k,XMLHttpRequest:P,setTimeout:I}=x.nativeCode);else{const t=document.createElement("iframe");t.style.display="none",t.style.position="absolute",document.body.appendChild(t);const{contentWindow:e}=t;if(window.EventTarget){const{addEventListener:t}=e.EventTarget.prototype;E=function(e,s,o,i){t.call(e,s,o,i)}}else E=function(t,e,s,o){t.addEventListener(e,s,o)};({XMLHttpRequest:P}=e);const{fetch:s,setTimeout:o}=e;k=s?(...t)=>s.apply(window,t):null,I=(...t)=>o.apply(window,t);const{queueMicrotask:i}=window;i&&C(t),x.nativeCode={addEventListener:E,fetch:k,XMLHttpRequest:P,setTimeout:I}}const L=t=>document.querySelector(`link[rel="stylesheet"][type="text/css"][href="${t}"]`);function T(t){if(L(t))return;let e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("type","text/css"),e.setAttribute("href",t),document.head.appendChild(e)}function A(t){const e=L(t);e&&e.remove()}function q(t,e){B(`"${t}" Photoslurp configuration parameter is deprecated. Please use "${e}" instead`)}function B(t){console.warn(t)}function R(t){console.error(t)}const N={widgetId:null,flowKey:null,albumId:null,productId:null,productType:null,pageType:null,widgetType:"carousel",lazyLoad:!1,initDelay:0,theme:"modern",pageLimit:15,assignedOnly:null,strictProducts:null,emptyThreshold:null,rightsClearedOnly:null,inStockOnly:null,hideOutOfStock:null,catalog:null,collection:null,username:null,allVariants:null,randomOrder:null,orderBy:null,orientation:"horizontal",emptyText:null,varyingThumbSizes:!1,autoscrollLimit:0,liveStream:!1,liveStreamInterval:3e4,liveStreamLimit:null,photosAlign:"center",photosOffset:2,lang:null,ctaButton:null,ctaButtonText:null,shopThisLookText:null,postedByText:null,viewAndShopText:null,loadMoreText:null,submitText:null,reportText:null,errorText:null,instagramUserText:null,analyticsCookieTTL:30,cookieDomain:null,crossDomainTracking:!1,enableGA:!1,utmParams:null,showSubmit:null,addPhotosImg:!1,submissionFormURL:"https://media-uploader.getflowbox.com/submit_iframe.html",submissionFormCSSURL:null,tocLink:null,lightbox:!0,lightboxAutoplay:!1,lightboxLoading:!0,visibleProducts:null,currency:null,socialIcons:!1,poweredByUrl:null,apiPhotoListUrl:"https://gateway.getflowbox.com/public/feed/",productsUrl:"https://experience.getflowbox.com/products/",hotspotsUrl:"https://experience.getflowbox.com/hotspots/",analyticsUrl:"https://a.getflowbox.com/events",reportUrl:"https://app.getflowbox.com/migration-ps/report",themesUrl:"https://static.photoslurp.com/widget/flowbox/v3/themes",dummyImg:e,inlineVideos:!1,autoScroll:!1,autoScrollInterval:1e4,debug:!1,sameTabLinks:null,thumbOverlay:!1,noteAddPicsText:null,noteAddPicsIcons:null,ABTesting:!1},U=function(t,e){const s=t.getPropertyValue(e);return parseFloat(s)||0},M={passive:!0},$=class{constructor(t){const{orientation:e,wrapper:s,container:o,onSlide:i,onSlideEnd:n}=t;this.orientation=e||"horizontal",this.wrapper=s,this.container=o;const r=this.items=Array.from(o.children);this.itemsCount=r.length,this.currentItem=r[0],this.isSliding=!1,this.translation=0,this.hasTransition=!1,this.canSlidePrev=this.canSlideNext=!1;const a=this.isHorizontal="horizontal"===e,l=this.sizeFunction=t=>a?function(t,e){const s=getComputedStyle(t);return(e?t.getBoundingClientRect().width:t.offsetWidth)+U(s,"margin-left")+U(s,"margin-right")}(t,!0):function(t,e){const s=getComputedStyle(t);return(e?t.getBoundingClientRect().height:t.offsetHeight)+U(s,"margin-top")+U(s,"margin-bottom")}(t,!0);this.marginFunction=t=>{const e=getComputedStyle(t).getPropertyValue("margin-"+(a?"left":"top"));return parseFloat(e)},this.visibleSpace=l(o),this.emptySpace=0,this.onSlideCallback=i,this.onSlideEndCallback=n,this.transitionEndCallback=this.transitionEndCallback.bind(this),this.slidePrev=this.slidePrev.bind(this),this.slideNext=this.slideNext.bind(this),this.initControls(),this.initTransition(),this.initSwipe()}initControls(){const t=this.wrapper.querySelector("nav"),{slidePrev:e,slideNext:s}=this,o=t.firstElementChild;E(o,"click",e,M);const i=t.lastElementChild;E(i,"click",s,M),this.prevControl=o,this.nextControl=i}initTransition(){const{container:t,transitionEndCallback:e}=this,s=getComputedStyle(t),o=s.getPropertyValue("transition-property").split(/,\s*/g),i=s.getPropertyValue("transition-duration"),n=(o.includes("transform")||o.includes("all"))&&parseFloat(i)>0;this.hasTransition=n,n&&E(t,"transitionend",e,M)}transitionEndCallback(t){"transform"===t.propertyName&&this.endSliding()}initSwipe(){const{wrapper:t,isHorizontal:e,slidePrev:s,slideNext:o}=this;let i,n;e?(i="right",n="left"):(i="down",n="up");const r=this.prevSwipeEvent=`swipe${i}`;E(t,r,s,M);const a=this.nextSwipeEvent=`swipe${n}`;E(t,a,o,M)}endSliding(){this.isSliding=!1,this.onSlideEndCallback()}validate(){const{items:t,itemsCount:e,sizeFunction:s,marginFunction:o,visibleSpace:i}=this;let{currentItem:n}=this,r=t.indexOf(n);if(-1===r&&(r=0,n=this.currentItem=t[0]),!n)return void(this.emptySpace=i);let a=s(n)-o(n),l=i-a,c=!1;for(let o=r+1;oi){c=!0;break}l-=e}this.canSlidePrev=r>0,this.canSlideNext=c,this.emptySpace=l,this.toggleControls()}toggleControls(){const{prevControl:t,nextControl:e,canSlidePrev:s,canSlideNext:o}=this;t.style.display=s?"block":"none",e.style.display=o?"block":"none"}setTranslation(){const{container:t,isHorizontal:e,translation:s}=this;t.style.transform=e?`translateX(${s}px)`:`translateY(${s}px)`,this.hasTransition||this.endSliding()}translateNext(){const{items:t,currentItem:e,itemsCount:s,sizeFunction:o,marginFunction:i,visibleSpace:n}=this,r=t.indexOf(e);let a=o(e)-i(e);for(let e=r+1;e=0;o--){const e=t[o],a=s(e);if(n&&!(r+a<=i))break;n=n||e,r+=a,n=e}n&&(this.currentItem=n,this.translation+=r-o(n)+o(e))}translateToIndex(t){const{currentItem:e,items:s,itemsCount:o,sizeFunction:i,marginFunction:n,visibleSpace:r}=this,a=s.indexOf(e);if(t<0||t>=o||t===a)return;let l,c,d;if(t>a){c=i(e)-n(e),d=0;for(let e=a+1;e<=t;e++){const t=s[e],o=i(t);c+o>r?(d+=c,c=o,l=t):c+=o}if(!l)return;d=-d}else{c=0,d=n(e);for(let e=a-1;e>=0;e--){const o=s[e],n=i(o);if(c+n>r){if(e=e-s&&t<=e+s}function V(t){const{changedTouches:e}=t;return e?e[0]:t}function F(t){const{identifier:e,pointerId:s}=t;return null!=e?e:s}function O(){return performance.now()}const K={passive:!0,swipeThreshold:100,tapThreshold:150,dbltapThreshold:200,longtapThreshold:1e3,tapPrecision:30},z=class{constructor(t,e={}){this.element=t,this.eventId=null,this.cachedX=this.currentX=null,this.cachedY=this.currentY=null,this.longtapTimer=this.dblTapTimer=null,this.target=null,this.timestamp=null,this.tapNum=0;let s={};for(let t in K)s[t]=t in e?e[t]:K[t];this.config=s;const{passive:o}=s,i={passive:o},n=this.touchStartCallback=this.touchStart.bind(this);E(t,"touchstart",n,i);const r=this.touchEndCallback=this.touchEnd.bind(this);E(t,"touchend",r,i);const a=this.touchMoveCallback=this.touchMove.bind(this);E(t,"touchmove",a,i)}isTheSameFingerId(t){const{eventId:e}=this;return null==e||F(t)===e}sendEvent(t,e,s,o){(o=o||{}).x=this.currentX,o.y=this.currentY;let i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:o});i.originalEvent=s,t.dispatchEvent(i)}touchStart(t){const e=V(t);if(!this.isTheSameFingerId(e))return;this.eventId=F(e);const{pageX:s,pageY:o}=e;this.cachedX=this.currentX=s,this.cachedY=this.currentY=o;const{longtapThreshold:i}=this.config;this.longtapTimer=I((()=>{this.sendEvent(t.target,"longtap",t),this.target=t.target}),i),this.timestamp=O(),this.tapNum++}touchEnd(t){const e=V(t);if(!this.isTheSameFingerId(e))return;this.eventId=null;let s=[];const o=O(),{cachedX:i,currentX:n,cachedY:r,currentY:a}=this,l=i-n,c=r-a,{config:d,dblTapTimer:u,longtapTimer:p}=this;clearTimeout(u),clearTimeout(p);const{swipeThreshold:h,tapPrecision:m,tapThreshold:g,dbltapThreshold:v}=d;l<=-h&&s.push("swiperight"),l>=h&&s.push("swipeleft"),c<=-h&&s.push("swipedown"),c>=h&&s.push("swipeup");const y=s.length;if(y){for(let e=0;e=2&&this.target===e?"dbltap":"tap",t),this.target=e}this.dblTapTimer=I((()=>{this.tapNum=0}),v)}}touchMove(t){const e=V(t);if(!this.isTheSameFingerId(e))return;const{pageX:s,pageY:o}=e;this.currentX=s,this.currentY=o}destroy(){const{element:t,touchStartCallback:e,touchEndCallback:s,touchMoveCallback:o,listenerOptions:i}=this;t.removeEventListener("touchstart",e,i),t.removeEventListener("touchend",s,i),t.removeEventListener("touchmove",o,i)}},H=document.createRange(),W=function(t){return H.createContextualFragment(t)},X=function(e,{method:s="GET",contentType:o="application/json",data:i={},dataType:n="text",timeout:r=15e3,signal:a}){if(s=s.toUpperCase(),k){const t={method:s,mode:"cors"};return o&&(t.headers={"Content-Type":o}),"POST"!==s&&"PUT"!==s||(t.body=JSON.stringify(i)),a&&(t.signal=a),k(e,t).then((t=>Promise[t.ok?"resolve":"reject"](t))).then((t=>"json"===n?t.json():t.text()))}return new Promise(((a,l)=>{const c=new P;let d,u=!1,p=0,h="error";t(["timeout","error","abort"],(t=>{E(c,t,(()=>{h=t}))})),E(c,"load",(()=>{const{status:t}=c;u=t>=200&&t<300||304===t})),E(c,"loadend",(t=>{({loaded:p}=t),u?(()=>{const{response:t}=c;a(d?JSON.parse(t):t)})():l([h,e,c,p])})),c.open(s.toUpperCase(),e,!0),c.setRequestHeader("Content-type",o),c.responseType=n,d="json"===n&&!c.responseType,c.timeout=r,c.send(i||null)}))},Y=function([...t],{signal:e}){let s=[];const{length:o}=t;let i,n;const r=new Promise(((t,e)=>{i=t,n=e}));let a=0,l=!!e&&e.aborted;const c=function(){s.length?n(s):i(t)};if(o)for(let e=0;ef("error"===t.type),f=function(t){a++,t&&s.push(i),r.loadedSrc=i.src,r.isBroken=t,i.removeEventListener("canplay",y),i.removeEventListener("load",y),i.removeEventListener("error",y),a===o&&c()};if(E(i,"canplay",y),E(i,"load",y),E(i,"error",y),m&&m===(h||v))f("true"===g);else if(l&&(d||u))f(0===u||0===d);else if(p||l){let t;"VIDEO"===n?(t=document.createElement("video"),t.muted=t.autoplay=!0):t=new Image,E(t,"canplay",(()=>f(!0))),E(t,"load",(()=>f(!1))),E(t,"error",(()=>f(!0))),t.src=v}}else c();return e&&E(e,"abort",(()=>{t.forEach((t=>{const{originalSrc:e}=t.dataset,s=t.getAttribute("src");e&&e!==s&&t.setAttribute("src",e)})),n(t)})),r};function j(t){return"function"==typeof t}const G=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},J=window.Photoslurp=window.Photoslurp||{},Q=J.support=J.support||{};let Z;"requestFullscreen"in Q?({requestFullscreen:Z}=Q):(Z=f.requestFullscreen||f.webkitRequestFullscreen||HTMLVideoElement.prototype.webkitEnterFullscreen,Q.requestFullscreen=Z);const tt=Z,et=window.Photoslurp=window.Photoslurp||{},st=et.support=et.support||{};let ot;"replaceWith"in st?({replaceWith:ot}=st):(ot=f.replaceWith||function(t){const e=this.parentNode;e&&e.replaceChild(t,this)},st.replaceWith=ot);const it=ot,nt=window.Photoslurp=window.Photoslurp||{},rt=nt.support=nt.support||{};let at;if("cssEscape"in rt)({cssEscape:at}=rt);else{const{CSS:t}=window;at=t&&t.escape||function(t){return t.replace(/[.#()[\]{}\\/]/g,(t=>"\\"+t))},rt.cssEscape=at}const lt=at,ct=window.Photoslurp=window.Photoslurp||{},dt=ct.support=ct.support||{};let ut;"abortController"in dt?({abortController:ut}=dt):j(window.AbortController)&&(ut=window.AbortController,dt.abortController=ut);const pt=ut,ht=window.Photoslurp=window.Photoslurp||{},mt=ht.support=ht.support||{};let gt;"isFullscreen"in mt?({isFullscreen:gt}=mt):(gt=()=>Boolean(document.fullscreenElement||document.webkitFullscreenElement),mt.isFullscreen=gt);const vt=gt,yt=window.Photoslurp=window.Photoslurp||{},ft=yt.support=yt.support||{};let bt;"exitFullscreen"in ft?({exitFullscreen:bt}=ft):(bt=document.exitFullscreen||document.webkitExitFullscreen,ft.exitFullscreen=bt);const wt=bt;function St(t){for(;t.firstChild;)t.removeChild(t.firstChild)}const Ct={passive:!0},_t=class{constructor(t,e){this.container=t,this.opts=l({theme:"default",callbacks:{},visibleProducts:1},e),this.initialized=!1,this.data=[],this.productsByKeys=e.productsByKeys,this.loadedProducts=new Set,this.currentData=null,this.prevIndex=null,this.currentIndex=null,this.touch=null,this.isScrolling=null,this.productsOffset=0,this.shownProducts=0,this.animationRequest=null,this.maxVisibleProducts=this.opts.visibleProducts,this.productsElement=null,this.titleElement=null,this.sourceElement=null,this.shareElement=null,this.poweredByElement=null,this.currentCarouselIndex=0,this.currentCarouselData=null,this.currentCarouselElement=null,this.translateImages=this.translateImages.bind(this),this.navigateToProduct=this.navigateToProduct.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.handleResize=this.handleResize.bind(this),this.init(),this.showPoweredBy(),this.needsFullscreen=this.calculateVideoFullscreen(),this.abortController=pt?new pt:null}calculateMaxProducts(){let t=9;const e=getComputedStyle(this.container).getPropertyValue("--ps-max-visible-products");e&&(t=+e);const s=0|this.opts.visibleProducts;return Math.min(Math.max(s,0),t)}calculateVideoFullscreen(){return+getComputedStyle(this.container).getPropertyValue("--ps-play-video-fullscreen")>0}init(){if(this.initialized)return;const t="ontouchstart"in document,{container:e,opts:s}=this;e.innerHTML="
",e.classList.add("ps-lightbox-container",`ps-lightbox-theme-${s.theme}`,t?"ps-touch":"ps-no-touch"),this.maxVisibleProducts=this.calculateMaxProducts();const o=this.stageElement=e.querySelector(".ps-stage");this.stageWidth=o.getBoundingClientRect().width,this.mediaCarouselLoaderIndicator=e.querySelector(".ps-media-carousel-indicator");const i=this.mediaCarouselLeftNav=e.querySelector(".ps-media-carousel-nav-left"),n=this.mediaCarouselRightNav=e.querySelector(".ps-media-carousel-nav-right");E(i,"click",(()=>this.navigateCarousel("prev")),Ct),E(n,"click",(()=>this.navigateCarousel("next")),Ct),this.loaderElement=o.querySelector(".ps-loader");const r=this.infoElement=e.querySelector(".ps-info"),a=this.imagesElement=o.querySelector(".ps-images"),l=this.productsElement=r.querySelector(".ps-products");this.titleElement=r.querySelector(".ps-title"),this.sourceElement=r.querySelector(".ps-source"),this.shareElement=r.querySelector(".ps-share"),this.poweredByElement=r.querySelector(".ps-powered-by"),E(a,"click",this.playVideo.bind(this),Ct);const c=e.querySelector(".ps-image-nav");if(E(c.querySelector(".ps-image-nav-left"),"click",(()=>this.navigate("prev")),Ct),E(c.querySelector(".ps-image-nav-right"),"click",(()=>this.navigate("next")),Ct),t){const t=this.handleTouchStart.bind(this);E(a,"touchstart",t,{passive:!1}),this.productsTouch=new z(l,{swipeThreshold:50}),E(l,"swipeleft",(()=>this.navigateProducts("next")),Ct),E(l,"swiperight",(()=>this.navigateProducts("prev")),Ct)}E(document,"keydown",this.handleKeydown,Ct),E(window,"resize",this.handleResize,Ct),this.initialized=!0}add(t,e=!0){if(this.addImages(t,e),e)this.data=this.data.concat(t);else{const e=this.data=t.concat(this.data);this.currentIndex=e.indexOf(this.currentData)}this.showImage()}buildMediaElement(t,e,s=0){const{video:o,src:i}=t,{height:n,width:r}=this.stageElement.getBoundingClientRect(),a=document.createElement("div");a.classList.add("ps-image");const{style:l}=a;if(l.height=`${n}px`,l.width=`${r}px`,l.left=(s+e)*r+"px",o){const t=W("
"),e=t.querySelector("video");e.setAttribute("src",o),i&&e.setAttribute("poster",i),a.appendChild(t)}else{const t=document.createElement("img");t.dataset.src=i,a.appendChild(t)}return a}buildMediaCarousel(e,s,o){const{height:i,width:n}=this.stageElement.getBoundingClientRect();e.sort((t=>t.thumbnail?-1:1));const r=document.createElement("div");r.classList.add("ps-media-carousel");const{style:a}=r;a.height=`${i}px`,a.width=`${n}px`,a.left=(o+s)*n+"px";const l=document.createDocumentFragment();return t(e,((t,e)=>{const{url:s,type:o}=t,i={..."image"===o?{src:s}:{video:s}},n=this.buildMediaElement(i,e);l.appendChild(n)})),r.appendChild(l),r}addImages(e,s=!0){const{imagesElement:o}=this;let i=e.map((t=>{const{image:e,selectedMedia:s,media:o}=t;return{src:e,video:s&&"video"===s.type?s.url:null,carousel:o&&o.length>1?o:null}}));const n=s?this.data.length:0,r=document.createDocumentFragment();t(i,((t,e)=>{if(t.carousel){const s=this.buildMediaCarousel(t.carousel,e,n);r.appendChild(s)}else{const s=this.buildMediaElement(t,e,n);r.appendChild(s)}}));const a=this.showVideoError.bind(this);if(t(r.querySelectorAll("video"),(t=>{E(t,"error",a,{once:!0})})),s)o.appendChild(r);else{const e=i.length,{width:s}=this.stageElement.getBoundingClientRect();t(o.childNodes,((t,o)=>{t.style.left=(e+o)*s+"px"})),o.insertBefore(r,o.firstChild)}}setProducts(t){this.productsByKeys=t,this.showImage(),this.updateProducts()}remove(e){let{data:s,imagesElement:o,currentIndex:i}=this;const n=o.childNodes,r=e.map((t=>t.id));let a=[],l=[],c=i;t(s,((t,e)=>{r.includes(t.id)?(a.push(n[e]),e{C(t)})),this.data=l,c=Math.min(Math.max(c,0),d-1),this.currentIndex=null,this.open(c)):this.destroy()}playVideo(){const{imagesElement:t,currentIndex:e,currentData:s,needsFullscreen:o,currentCarouselData:i,currentCarouselElement:n}=this,{selectedMedia:r}=s;let a;if(i){if("video"!==i.type)return;a=n}else{if(!r||"video"!==r.type)return;a=t.childNodes[e]}const l=a.querySelector(".ps-video");if(!l)return;const c=l.querySelector(".ps-video-icon");c.classList.add("ps-hidden");const d=l.querySelector(".ps-video-player");o&&tt.call(d),d.paused?d.play().catch(this.removeVideo.bind(this)):(c.classList.remove("ps-hidden"),d.pause())}playCarouselVideo(){const{currentCarouselData:t,opts:e,needsFullscreen:s}=this,{autoplay:o}=e;t&&o&&!s&&this.playVideo()}stopVideo(t){const e=t.querySelector(".ps-video");if(!e)return;vt()&&wt();const s=e.querySelector(".ps-video-player");s.pause(),s.currentTime=.1,e.querySelector(".ps-video-icon").classList.remove("ps-hidden")}stopMediaCarouselVideo(){const{currentCarouselElement:t}=this;t&&this.stopVideo(t)}showVideoError(t){const{opts:e,currentData:s}=this,o=t.target.closest(".ps-video"),i=document.createElement("div");i.classList.add("ps-video-error"),i.textContent=e.errorText,it.call(o,i);const{imageNotFound:n}=e.callbacks;n&&n(s)}removeVideo(){const{imagesElement:t,currentIndex:e}=this,s=t.childNodes[e].querySelector(".ps-video-player");s&&C(s)}translateImages(t=0){const{animationRequest:e,imagesElement:s,currentIndex:o,stageWidth:i}=this;e&&window.cancelAnimationFrame(e),this.animationRequest=window.requestAnimationFrame((()=>{s.style.transform=`translateX(${t-o*i}px)`}))}translateCarousel(){const{currentCarouselIndex:t,stageWidth:e,imagesElement:s,currentIndex:o}=this;s.childNodes[o].style.transform=`translateX(${-t*e}px)`}showMediaCarouselElements(){const{mediaCarouselLoaderIndicator:e,currentData:s,mediaCarouselLeftNav:o,mediaCarouselRightNav:i}=this;St(e),t(s.media,((t,s)=>{const o=document.createElement("div");o.classList.add("ps-media-carousel-indicator-button"),o.role="button",E(o,"click",(()=>this.updateCarousel(s))),o.tabIndex=0,s===this.currentCarouselIndex&&o.classList.add("ps-media-carousel-indicator-button-active"),e.appendChild(o)})),o.classList.add("ps-visible"),i.classList.add("ps-visible")}hideMediaCarouselElements(e){const{mediaCarouselLoaderIndicator:s,mediaCarouselLeftNav:o,mediaCarouselRightNav:i}=this;e.classList.remove("ps-visible"),t(e.querySelectorAll(".ps-image"),(t=>{t.classList.remove("ps-visible")})),this.currentCarouselIndex=0,this.translateCarousel(),St(s),o.classList.remove("ps-visible"),i.classList.remove("ps-visible")}updateMediaCarouselWithBrokenImages(e){t(e,(t=>{const e=this.currentData.media.findIndex((e=>e.url===t.src));e>-1&&(this.currentData.media[e].isBroken=!0)}))}showImage(){const{opts:e,currentData:s,prevIndex:o,currentIndex:i,imagesElement:n,loaderElement:r,abortController:a}=this;if(null===i)return;this.translateImages();const l=n.childNodes[i],{previousSibling:c,nextSibling:d}=l;t([l,c,d],(e=>{var s;e&&((s=e)&&t(s.querySelectorAll("img"),(t=>{t.setAttribute("src",t.dataset.src)})),e.classList.add("ps-visible"),e.classList.contains("ps-media-carousel")&&e.firstElementChild.classList.add("ps-visible"))})),l.classList.contains("ps-media-carousel")&&this.showMediaCarouselElements();const{imageLoaded:u,imageNotFound:p}=e.callbacks;r.style.display="block",Y(l.querySelectorAll("img"),{signal:a?a.signal:null}).then((()=>{if(u){const{maxVisibleProducts:t}=this;if(!t)return;const{id:e,productKeys:o}=s;u(e,o.slice(0,t))}r.style.display="none",this.showHotspots()}),(t=>{const{currentCarouselData:e}=this;p&&p(s),e?(this.updateMediaCarouselWithBrokenImages(t),t.find((t=>t.src===e.url))&&this.navigateCarousel("next"),r.style.display="none"):this.navigate(o>i?"prev":"next")}))}showCommonData(){const{currentData:t,titleElement:e,sourceElement:s,opts:o}=this,{title:i,source:n,likes:r,comments:a}=t,{url:l,provider:c,username:d}=n;e.textContent=i;const u=document.createDocumentFragment(),p=document.createElement(l?"a":"span");p.classList.add("ps-source-link"),l&&(p.setAttribute("href",l),p.setAttribute("target","_blank"));const h=document.createElement("span");h.classList.add("ps-source-provider",`ps-${c}`),p.appendChild(h);const m=document.createElement("span");if(m.classList.add("ps-source-username"),m.textContent=d||o.instagramUserText,p.appendChild(m),u.appendChild(p),null!=r||null!==a){const t=document.createElement("div");if(t.classList.add("ps-likes-comments"),null!=r){const e=document.createElement("span");e.classList.add("ps-likes"),e.textContent=r,t.appendChild(e)}if(null!=a){const e=document.createElement("span");e.classList.add("ps-comments"),e.textContent=a,t.appendChild(e)}u.appendChild(t)}s.innerHTML="",s.appendChild(u)}setSocialIcons(t){const{currentData:e,shareElement:s}=this,{image:o,title:i}=e,n=t&&t.custom_fields&&t.custom_fields.internal_url,r=W(' '),a=encodeURIComponent(n||window.location.href),l=encodeURIComponent(o),c=encodeURIComponent(i);E(r.querySelector(".ps-facebook"),"click",(()=>{window.open(`https://www.facebook.com/dialog/share?app_id=364476783640017&display=popup&href=${a}&redirect_uri=https%3A%2F%2Fstatic.photoslurp.com%2Fclosefb.html`,"Facebook Share","height=450, width=400")}),Ct);const d=`https://twitter.com/share?text=${c}&url=${a}&via=photoslurp`;r.querySelector(".ps-twitter").setAttribute("href",d);const u=`https://pinterest.com/pin/create/link/?url=${a}&media=${l}&description=${c}`;r.querySelector(".ps-pinterest").setAttribute("href",u),s.innerHTML="",s.appendChild(r)}handleProductClick(t){const{currentData:e,opts:s}=this,{productClick:o}=s.callbacks;o&&o(e,t)}showProductImage(t,e){const{loadedProducts:s}=this,{key:o,image:i}=e,n=t.querySelector(".ps-product-pic"),r=()=>{n.classList.remove("ps-is-loading"),n.style.backgroundImage=`url(${lt(i)})`};if(s.has(o))r();else{const t=document.createElement("img");E(t,"load",(()=>{s.add(o),r(),t.remove()}),{once:!0,passive:!0}),t.setAttribute("src",i)}}showProductRatingPrice(t,e){const{opts:s,maxVisibleProducts:o}=this,{reviewsText:i}=s,{rating:n,reviewsCount:r,price:a}=e;if(n){const e=t.querySelector(".ps-product-rating");for(let t=1;t<=5;t++){const s=document.createElement("span");let o;o=n<=t-.8?"ps-star-empty":n<=t-.3?"ps-star-half":"ps-star-full",s.classList.add("ps-product-star",o),e.appendChild(s)}if(r){const{full:e,short:s}=i,{single:n,plural:a}=o>2?s:e;let l=n;r>1&&(l=a,l=j(l)?l(r):a.replace("{count}",r)),t.querySelector(".ps-reviews-count").textContent=l}}else a&&(t.querySelector(".ps-product-price").textContent=a)}showProducts(){const{opts:t,currentData:e,productsByKeys:s,infoElement:o,productsElement:i,maxVisibleProducts:n}=this,{ctaButton:r,ctaButtonText:a,shopThisLookText:l,sameTabLinks:c}=t,{productKeys:d}=e,u="ps-no-products";if(!d.length||!n)return o.classList.add(u),void(i.innerHTML="");o.classList.remove(u);const p=W("
");p.querySelector(".ps-heading").textContent=l;const h=p.querySelector(".ps-products-container"),m=c?"_self":"_blank";d.forEach((t=>{const e=s.get(t),{title:o,url:i}=e||{},n=W('
');n.firstChild.dataset.productKey=t;const l=n.querySelector("a");if(l.setAttribute("href",i||""),l.setAttribute("target",m),E(l,"click",(()=>{this.handleProductClick(e)})),r){const t="string"==typeof r?r:a,e=document.createElement("div");e.classList.add("ps-product-cta"),e.textContent=t,l.appendChild(e),n.querySelector(".ps-product-pic").classList.add("ps-product-extended")}e&&(this.showProductImage(n,e),this.showProductRatingPrice(n,e)),n.querySelector(".ps-product-description").textContent=o||"",h.appendChild(n)})),i.innerHTML="",i.appendChild(p);const g=h.querySelectorAll(".ps-product-wrapper").length,v=i.querySelector(".ps-product-nav");if(g<=n)C(v);else{const t=v.querySelector(".ps-product-nav-left"),e=v.querySelector(".ps-product-nav-right");E(t,"click",(()=>this.navigateProducts("prev")),Ct),E(e,"click",(()=>this.navigateProducts("next")),Ct)}this.productsOffset=0,this.toggleProducts()}updateProducts(){const{currentData:t,productsByKeys:e,productsElement:s}=this,{productKeys:o}=t;o.forEach((t=>{const o=e.get(t);if(!o)return;const{title:i,url:n}=o||{},r=s.querySelector(`.ps-product-wrapper[data-product-key="${t}"]`);r&&(r.querySelector("a").setAttribute("href",n),this.showProductImage(r,o),this.showProductRatingPrice(r,o),r.querySelector(".ps-product-description").textContent=i)}))}removeHotspots(){const{imagesElement:t,currentIndex:e}=this;t.childNodes[e].querySelectorAll(".ps-hotspot").forEach(C)}showHotspots(){const{imagesElement:e,productsElement:s,currentIndex:o,currentData:i,maxVisibleProducts:n,productsByKeys:r,opts:a}=this,{sameTabLinks:l}=a,{hotspots:c}=i;if(!n||!c||!c.length)return;const d=e.childNodes[o],u=d.querySelector("img"),{height:p,width:h}=d.getBoundingClientRect(),{height:m,width:g}=u.getBoundingClientRect(),v=m/p,y=g/h,f=document.createDocumentFragment(),b=l?"_self":"_blank";t(c,(({index:t,productKey:e,x:s,y:o})=>{const i=r.get(e),n=(100*((s-.5)*y+.5)).toFixed(2),a=(100*((o-.5)*v+.5)).toFixed(2),l=document.createElement("a");l.classList.add("ps-hotspot"),l.setAttribute("href",i.url),l.setAttribute("target",b);const{style:c}=l;c.left=`${n}%`,c.top=`${a}%`,l.textContent=t,f.appendChild(l)}));const w=W("
").querySelector(".ps-hotspot-tooltip");f.appendChild(w);const{firstElementChild:S,lastElementChild:C,classList:_,style:x}=w,{classList:k,style:P}=S,L="ps-visible",T="ps-hovered",A="ps-arrow-up",q="ps-arrow-down",B=(t,e)=>{const{offsetLeft:s,offsetTop:o}=t;C.textContent=e.title;const i=t.getBoundingClientRect().height/2,n=w.getBoundingClientRect(),{height:r,width:a}=n;x.left=s-n.width/2+"px";const{height:l}=S.getBoundingClientRect();let c=o+i+l,d="auto";c+r<=p?(k.add(A),k.remove(q),c+="px"):(k.add(q),k.remove(A),c="auto",d=`${p-o+i+l}px`),x.top=c,x.bottom=d;let u=a/2,m=s-a/2;if(m<0)u+=m,m=0;else{const t=m+a;t>h&&(u+=t-h,m=h-a)}P.left=`${u}px`,x.left=`${m}px`,_.add(L)},R=()=>{C.textContent="",_.remove(L)};let N=null;t(f.querySelectorAll(".ps-hotspot"),((t,e)=>{const o=c[e],{index:i,productKey:n}=o,a=s.querySelectorAll(".ps-product-pic")[i-1],l=r.get(n),{classList:d}=a;let u=!1;E(t,"mouseover",(()=>{u=!0,E(t,"transitionend",(()=>{u&&(B(t,l),d.add(T))}),{once:!0,passive:!0}),N=I((()=>this.navigateToProduct(l)),1e3)}),Ct),E(t,"mouseout",(()=>{u=!1,R(),d.remove(T),N&&(clearTimeout(N),N=null)}),Ct),E(t,"click",(()=>this.handleProductClick(l)),Ct);const{classList:p}=t;E(a,"mouseover",(()=>{B(t,l),p.add(T)}),Ct),E(a,"mouseout",(()=>{R(),p.remove(T)}),Ct)})),d.appendChild(f)}showSocialIcons(){const{currentData:t,opts:e,productsByKeys:s}=this,{productKeys:o}=t,{socialIcons:i}=e;i?this.setSocialIcons(o&&o.length?s.get(s[0]):null):this.shareElement.innerHTML=""}showPoweredBy(){const{opts:t,poweredByElement:e}=this,{poweredByUrl:s,reportUrl:o,reportText:i,callbacks:n}=t,r=W(' \x3c!-- DO NOT REMOVE UNLESS PERMISSION HAS BEEN GRANTED --\x3e'),a=r.querySelector(".ps-report-link");a.setAttribute("href",o),a.textContent=i;const l=r.querySelector(".ps-poweredby-link");l.setAttribute("href",s),e.appendChild(r),!G(l)&&n.logoHidden&&I((()=>n.logoHidden()))}updatePoweredBy(){const{opts:t,currentData:e,poweredByElement:s}=this,{reportUrl:o,flowKey:i}=t,{id:n}=e,r=y(o,{feed:i,post:n});s.querySelector(".ps-report-link").setAttribute("href",r)}open(t){const{currentIndex:e,imagesElement:s,data:o,opts:i,needsFullscreen:n}=this;if(t===e)return;if(null!=e){const o=s.childNodes[e],i=t>e?o.previousSibling:o.nextSibling;i&&i.classList.remove("ps-visible"),o.classList.contains("ps-media-carousel")&&this.hideMediaCarouselElements(o),this.stopVideo(o),o.querySelectorAll(".ps-hotspot, .ps-hotspot-tooltip").forEach(C)}const r=this.currentData=o[t];this.prevIndex=e,this.currentIndex=t,this.showImage(),this.showProducts(),this.showCommonData(),this.showSocialIcons(),this.updatePoweredBy(),this.updateCarousel(0,!0);const{autoplay:a,callbacks:l}=i;a&&!n&&this.playVideo(),l.navigation&&l.navigation(t,r)}navigate(t){const{data:e,currentIndex:s}=this;let o;if("prev"===t&&s)o=s-1;else{if(!("next"===t&&sthis.currentCarouselIndex&&t0?t--:t=this.currentCarouselIndex),this.currentCarouselIndex=t,this.currentCarouselData=s.media.length>1?s.media[t]:null,this.currentCarouselElement=o.childNodes[i].childNodes[t],this.currentCarouselElement&&this.currentCarouselElement.classList.add("ps-visible"),this.translateCarousel(),this.updateCarouselIndicator(),this.playCarouselVideo(),!e&&l&&l(s.id)}updateCarouselIndicator(){const{currentCarouselIndex:e,mediaCarouselLoaderIndicator:s}=this;t(s.childNodes,((t,s)=>{t.classList.toggle("ps-media-carousel-indicator-button-active",s===e)}))}toggleProducts(){const{productsElement:e,productsOffset:s,currentData:o,productsByKeys:i,maxVisibleProducts:n}=this,{productKeys:r}=o,a=e.querySelector(".ps-products-container"),l=a.querySelectorAll(".ps-product-wrapper"),c=r.length,d=Math.min(n,c-s,9);d>1?e.dataset.shownProducts=d:delete e.dataset.shownProducts;const u=Math.ceil(d/3);u>1?(a.classList.add("ps-several-rows"),a.dataset.shownRows=u):(a.classList.remove("ps-several-rows"),delete a.dataset.shownRows);const p="ps-visible";let h=0;t(l,((t,e)=>{const{classList:o}=t;let l=e>=s&&e=l&&(n=0)):(n-=o,n<0&&(n=l-(l%o||o))),this.productsOffset=n,this.toggleProducts(),a){const t=r[n],e=s.get(t);this.setSocialIcons(e)}}navigateToProduct(t){const{opts:e,currentData:s,productsOffset:o,maxVisibleProducts:i}=this,{socialIcons:n}=e,{productKeys:r}=s,a=r.indexOf(t.key),l=Math.floor(a/i)*i;l!==o&&(this.productsOffset=l,this.toggleProducts(),n&&this.setSocialIcons(t))}handleTouchStart(t){if(vt())return;const e=t.touches[0];this.touch={pageX:e.pageX,pageY:e.pageY,deltaX:0,deltaY:0,time:Date.now()},this.isScrolling=null,E(document,"touchmove",this.handleTouchMove,{passive:!1}),E(document,"touchend",this.handleTouchEnd,Ct)}handleTouchMove(t){const{touches:e}=t;if(e.length>1)return;const s=e[0],{touch:o}=this,i=o.deltaX=s.pageX-o.pageX,{abs:n}=Math;if(null==this.isScrolling&&(this.isScrolling=n(i)0||r===this.data.length-1&&i<0)&&(o.deltaX=i/(n(i)/a+1.8)),this.translateImages(o.deltaX),t.preventDefault()}handleTouchEnd(){document.removeEventListener("touchmove",this.handleTouchMove),document.removeEventListener("touchend",this.handleTouchEnd);const{deltaX:t}=this.touch,{stageWidth:e,isScrolling:s}=this;if(s)return;const o=Math.abs(t),i=Date.now()-this.touch.time<250&&o>40||o>e/2,{imagesElement:n}=this;if(n.classList.add("ps-easing"),E(n,"transitionend",(()=>{n.classList.remove("ps-easing")}),{once:!0,passive:!0}),i){const e=t<0?"next":"prev";this.navigate(e)}else this.translateImages()}handleKeydown(t){if(t.altKey||t.ctrlKey||t.shiftKey||t.metaKey)return;const{key:e}=t;"ArrowLeft"===e?this.navigate("prev"):"ArrowRight"===e&&this.navigate("next")}handleResize(){const{stageElement:e,imagesElement:s,stageWidth:o}=this,{height:i,width:n}=e.getBoundingClientRect();this.stageWidth=n,t(s.childNodes,((e,s)=>{const{style:o}=e;o.height=i+"px",o.width=n+"px",o.left=s*n+"px",e.classList.contains("ps-media-carousel")&&t(e.childNodes,((t,e)=>{const{style:s}=t;s.height=i+"px",s.width=n+"px",s.left=e*n+"px"}))})),this.translateImages(),this.translateCarousel();const r=this.calculateMaxProducts();this.maxVisibleProducts!==r&&(this.maxVisibleProducts=this.calculateMaxProducts(),this.showProducts()),this.needsFullscreen=this.calculateVideoFullscreen(),o!==n&&(this.removeHotspots(),this.showHotspots())}destroy(){this.removeVideo(),document.removeEventListener("touchmove",this.handleTouchMove),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("keydown",this.handleKeydown),window.removeEventListener("resize",this.handleResize);const{productsTouch:t}=this;t&&(t.destroy(),this.productsTouch=null)}};function xt(t){const e=document.cookie.split("; ");for(let s=0,o=e.length;s{const o=s[0];(r?o.isIntersecting||o.intersectionRatio:G(e))&&(t.disconnect(),I((()=>{this._initEvents(),this._launch()})))}),{root:null});t.observe(e)}else this._initEvents(),this._launch();else console.error(`Photoslurp target element for widget '${n}' not found`)}}const At=()=>{};Tt.prototype._initVars=At,Tt.prototype._initEvents=At,Tt.prototype._launch=At,Tt.prototype._onWindowResize=At;const qt=Tt,Bt=class{constructor(t){this.o=l({},t),this.initialized=!1}_buildDOM(){const{body:t}=document;let e=t.querySelector(".ps-popup.ps-submitter");if(!e){const s=W('
×
');t.appendChild(s),e=t.querySelector(".ps-popup.ps-submitter")}this.overlay=t.querySelector(".ps-popup-overlay.ps-submitter"),this.popup=e,this.popupClose=e.querySelector(".ps-popup-close"),this.iframe=e.querySelector(".ps-submitter-browser")}_initEvents(){const t=this.closeCallback=this.hide.bind(this);E(this.overlay,"click",t),E(this.popupClose,"click",t)}_init(){this._buildDOM(),this._initEvents(),this.initialized=!0}show(){this.initialized||this._init();const{o:t}=this,{lang:e,albumId:s,tocLink:o,submissionFormCssUrl:i,poweredByUrl:n,feedKey:r}=t;let a=t.submissionFormUrl;e&&"en"!==e&&(a=v(a,"setLng",e.substring(0,2).toLowerCase())),s&&(a=v(a,"album_id",s),r&&(a=v(a,"feed_key",r)),o&&(a=v(a,"toc",o)),i&&(i+"").trim()&&(a=v(a,"css",i)),n&&(a=v(a,"root",n)),this.iframe.setAttribute("src",a),this.popup.style.display="block",this.overlay.style.display="block")}hide(){this.popup.style.display="none",this.overlay.style.display="none"}destroy(){if(this.initialized){const{closeCallback:t}=this;this.popupClose.removeEventListener("click",t),this.overlay.removeEventListener("click",t)}this.initialized=!1,this.closeCallback=this.iframe=this.popup=this.popupClose=this.overlay=null}},Rt=window.Photoslurp=window.Photoslurp||{},Nt=Rt.support=Rt.support||{};let Ut;if("uuid"in Nt)({uuid:Ut}=Nt);else if(crypto&&j(crypto.randomUUID))Ut=crypto.randomUUID.bind(crypto),Nt.uuid=Ut;else{const t=()=>Math.floor(65536*(1+Math.random())).toString(16).substring(1);Ut=()=>`${t()+t()}-${t()}-${t()}-${t()}-${t()}${t()}${t()}`,Nt.uuid=Ut}const Mt=Ut,$t=window.Photoslurp=window.Photoslurp||{},Dt=$t.support=$t.support||{};let Vt;"beacon"in Dt?({beacon:Vt}=Dt):(function(){const t="application/json";let e;try{e="keepalive"in new Request(document.location+"")}catch(t){}Vt=e?function(e,s,o){k(e,{method:"POST",headers:{authorization:`FlowKey ${s}`,"Content-Type":t},body:o,mode:"cors",keepalive:!0}).catch((()=>{console.warn("Photoslurp widget encountered network error")}))}:function(e,s,o){const i=new P;i.open("POST",e,!0),i.setRequestHeader("authorization",`FlowKey ${s}`),i.setRequestHeader("Content-Type",t),i.send(o)}}(),Dt.beacon=Vt);const Ft=Vt,Ot=class{constructor(t){this.o=l({},t)}_notify({event:t,action:e,label:s,target:o,customParams:i,interactive:n}){const{debug:a,flowKey:c,enableGA:d}=this.o;if(a)return;let u={cookies_disabled:!1,created_at:(new Date).toISOString(),data:{action:e,event_name:t,flow_key:c,target:o},from_url:window.location.href,user_id:this.getUid(),version:"1.0.0"};r(i)&&l(u.data,i),Ft(this.o.analyticsUrl,c,JSON.stringify(u)),d&&function(t,e,s=!1){const{ga:o,gtag:i,dataLayer:n}=window;"function"==typeof o?function(t,e,s){const{ga:o}=window;o((i=>{let n=i;if(!n){const t=o.getAll();if(!t||!t.length)return;[n]=t}n.send({hitType:"event",eventCategory:"photoslurp",eventLabel:t,eventAction:e,nonInteraction:!s})}))}(t,e,s):n&&"function"==typeof n.push?n.push({event:`${t}_${e}`,category:"photoslurp",interactive:s}):"function"==typeof i&&i("event",`${t}_${e}`,{category:"photoslurp",interactive:s})}(s,e,n)}isNewWidgetId(t){const{widgetId:e}=this.o;let s;return[,,s]=atob(t).split(":"),s!==e}getUid(){let{uid:t}=this;if(t)return t;const e=m(window.location,i);if(e){let s,[o,i]=decodeURIComponent(e).split(":");try{[s]=atob(o).split(":")}catch(t){}if(i=new Date(+i).getTime(),s&&!isNaN(i)&&i+36e5>=Date.now())return t=this.uid=s,this.updateCookiesTracking(),t}const o=xt(s);return o&&!this.isNewWidgetId(o)?(t=o,this.uid=t):(t=this.uid=Mt(),this.updateCookiesTracking()),t}thumbsDisplayed(t){this._notify({event:"embed_viewed",action:"view",target:"flow",customParams:{visible_post_ids:t}})}loadMoreButtonClicked(){this._notify({event:"embed_load_more_clicked",action:"click",target:"flow"})}carouselNavigated(){this._notify({event:"embed_carousel_next_post_clicked",action:"click",target:"flow"})}photoViewed(t,e){this._notify({event:"post_viewed",action:"view",target:"post",customParams:{post_id:t,visible_product_keys:e}})}lightboxNavigated(){this._notify({event:"gate_next_post_clicked",action:"click",target:"flow"})}shopThisLookClicked(t,e){this._notify({event:"cta_clicked",action:"click",target:"cta",customParams:{cta_type:"product_cta",post_id:t,product_key:e}})}postCarouselNavigated(t){this._notify({event:"post_carousel_next_media_clicked",action:"click",target:"post",customParams:{post_id:t}})}lightboxOpened(t,e){this._notify({event:"post_clicked",action:"click",target:"flow",customParams:{post_id:e,post_position:t}})}updateCookiesTracking(){const{widgetId:t,cookieTTL:e,cookieDomain:o,albumId:i}=this.o,n=btoa([this.uid,i,t].join(":"));try{Et(s,n,e,o)}catch(t){}}};const Kt={getState(){const t=/ps_([^&#]*)_([^&#]*)/.exec(decodeURIComponent(location.hash))||[];return[t[1],+t[2]]},setState(t,e){!function(t){let e;if(p){const s=new URL(location+"");s.hash=t||"",e=s+""}else e=location.pathname+location.search,t&&(e+="#"+t);history.replaceState("",document.title,e)}(!1===t&&!1===e?"":"ps_"+t+"_"+e)}},zt=["instagram","instagram-business","facebook","facebook-page","twitter","linkedin"],Ht={IMAGE:"ps-image",EMPTY:"ps-widget-empty",LOADING:"ps-tile-loading"},Wt=class extends qt{_initVars(){const{o:t}=this,{flowKey:e,albumId:s,analyticsCookieTTL:o,cookieDomain:i,widgetId:n,pageType:r,enableGA:a,apiPhotoListUrl:l,analyticsUrl:c,errorNotificationUrl:d,debug:u}=t;this._widgetAnalytics=new Ot({flowKey:e,albumId:s,cookieTTL:o,cookieDomain:i,widgetId:n,pageType:r,enableGA:a,analyticsUrl:c,errorNotificationUrl:d,debug:u}),this._nextPagePhotoListURL=l,this._isLoading=!1,this._isEnd=!1,this.photos=[],this.photosByIds=new Map,this.productsByKeys=new Map,this.ready=!1,this.trackingId=`${btoa([this._widgetAnalytics.getUid(),s,n].join(":"))}:${Date.now()}`,this._selectedMediaId=null,this.abortController=pt?new pt:null;const{poweredByUrl:p}=t;if(p)this.poweredByUrl=p;else{let t=document.location.hostname;try{t=top.location.hostname}catch(t){}this.poweredByUrl=v("https://hi.photoslurp.com/?utm_source=referral&utm_medium=powered-by-photoslurp","utm_source",t,!0)}this.handleEscape=this.handleEscape.bind(this),this.hidePopup=this.hidePopup.bind(this),this._onHidePopup=this._onHidePopup.bind(this),this._onAlbumItemClick=this._onAlbumItemClick.bind(this),this.showSubmitter=this.showSubmitter.bind(this),this.onProductClick=this.onProductClick.bind(this),this.onPhotosShown=this.onPhotosShown.bind(this)}_showPopup(e,s){const{body:o}=document;t(o.querySelectorAll(".ps-popup.ps-imagelist, .ps-popup-overlay.ps-imagelist"),(t=>t.style.display="block")),this._initLightbox(),this.lightboxInstance.open(e),E(o,"keydown",this.handleEscape,{passive:!0}),this._widgetAnalytics.lightboxOpened(e,s)}handleEscape(t){"Escape"===t.key&&(this.hidePopup(),document.body.removeEventListener("keydown",this.handleEscape))}_onHidePopup(){t(document.body.querySelectorAll(".ps-popup.ps-imagelist, .ps-popup-overlay.ps-imagelist"),(t=>t.style.display="none")),this.o.socialIcons&&Kt.setState(!1,!1);const{lightboxInstance:e}=this;e&&(e.destroy(),this.lightboxInstance=null)}_loadImageSet(t){const{_isLoading:e,_isEnd:s,o,lightboxInstance:i}=this;e||s||!o.lightboxLoading||!i||i.data.length-t>=4||this._loadData()}hidePopup(){const t=new CustomEvent("hide_popup",{bubbles:!0,cancelable:!0});this.targetNode.dispatchEvent(t)}_initLightbox(){const{o:t,poweredByUrl:e,productsByKeys:s}=this;let{lightboxInstance:o,targetNode:i}=this;if(o)return;const{lang:n,flowKey:r,lightboxAutoplay:a,ctaButton:l,ctaButtonText:c,errorText:d,shopThisLookText:u,reportText:p,instagramUserText:h,reviewsText:m,sameTabLinks:g,socialIcons:y,visibleProducts:f,theme:b,reportUrl:w}=t,S=this;o=this.lightboxInstance=new _t(document.querySelector("#photoslurp-lightbox"),{lang:n,flowKey:r,autoplay:!!a,ctaButton:l,ctaButtonText:c,shopThisLookText:u,errorText:d,poweredByUrl:v(e,"utm_campaign","lightbox",!0),reportText:p,reportUrl:w,instagramUserText:h,reviewsText:m,sameTabLinks:g,socialIcons:y,visibleProducts:f,theme:b,productsByKeys:s,callbacks:{logoHidden(){console.error("Photoslurp logo hidden - closing lightbox now"),S.hidePopup()},productClick(t,e){const s=new CustomEvent("info_product_click",{bubbles:!0,cancelable:!0,detail:{photoId:t.id,product:e,productIndex:t.productKeys.indexOf(e.key)}});i.dispatchEvent(s)},navigation(t,e){const o=e.productKeys.filter((t=>!s.has(t)));o.length&&S.loadProducts(o),S._loadImageSet(t),S._widgetAnalytics.lightboxNavigated()},imageLoaded(t,e){I((function(){S._widgetAnalytics.photoViewed(t,e)}),200),S.o.socialIcons&&Kt.setState(S.o.widgetId,t)},postCarouselNavigated(t){S._widgetAnalytics.postCarouselNavigated(t)}}}),o.add(this.photos)}_onAlbumItemClick(t){const{photos:e,o:{lightbox:s,sameTabLinks:o}}=this,{target:{dataset:{imageId:i}}}=t.detail,n=e.findIndex((t=>t.id===i));if(s)this._showPopup(n,i);else{const{productUrl:t}=this.photosByIds.get(i);if(!t)return;o?location.href=t:window.open(t,"_blank")}}onSubmitClick(){const t=new CustomEvent("submit_click",{bubbles:!0,cancelable:!0});this.targetNode.dispatchEvent(t)}_addImageClickHandler(){const{container:t,targetNode:e}=this;t&&E(t,"click",(t=>{const s=t.target.closest(".ps-image");if(!s)return;const o=new CustomEvent("widget_click",{bubbles:!0,cancelable:!0,detail:{target:s}});e.dispatchEvent(o)}))}showSubmitter(){this._submitter.show()}onProductClick(t){const{photoId:e,product:s}=t.detail;this._widgetAnalytics.shopThisLookClicked(e,s.key)}onPhotosShown(t){const{photoIds:e}=t.detail;e&&e.length&&this._widgetAnalytics.thumbsDisplayed(e)}_initEvents(){const t=this.resizeCallback=function(t,e,s){let o;return function(){const e=this,s=arguments;clearTimeout(o),o=I((function(){o=null,t.apply(e,s)}),250)}}(this._onWindowResize.bind(this));E(window,"resize",t,{passive:!0});const{targetNode:e,_onHidePopup:s,_onAlbumItemClick:o,showSubmitter:i,onProductClick:n,onPhotosShown:r}=this;E(e,"hide_popup",s),E(e,"widget_click",o),E(e,"submit_click",i),E(e,"info_product_click",n),E(e,"photos_shown",r,{once:!0})}hideWidget(){this.targetNode.style.display="none"}_loadData(t=!0,e){if(this._isEnd&&!e)return Promise.resolve();this._isLoading=!0;const{_nextPagePhotoListURL:s,abortController:o}=this;return X(s,{dataType:"json",signal:o?o.signal:null,contentType:null}).then((e=>(this._onLoadData(e,t),e)),(()=>{e||this.hideWidget(),this._isLoading=!1}))}addCustomQueryParams(t,e){const{o:s,trackingId:o}=this,{albumId:n,utmParams:a,crossDomainTracking:c,widgetId:d}=s;if(a){let s={utm_source:"photoslurp",utm_medium:"widget_"+d,utm_campaign:n,utm_content:e};r(a)&&l(s,a),t=y(t,s,!1)}return c&&(t=v(t,i,o)),t}parsePostData(t){const{productsByKeys:e}=this,{key:s,text:o,media:i,thumbnail:n,hotspots_assigned:r,productKeys:a,comments:l,likes:c,sourceName:d,postPermalink:u,userName:p}=t;let h;const m=Array.isArray(a)?a:JSON.parse(a||null)||[];return m.forEach((t=>{const s=e.get(t);s&&(h=h||s.url)})),{id:s,title:o,hotspotsAssigned:r,hotspots:null,image:n.url||n.fallbackUrl,comments:l,likes:c,media:i,selectedMedia:i.find((t=>t.thumbnail))||i[0],source:{provider:zt.includes(d)?d:"manual",url:u,username:p},productUrl:h,productKeys:m}}parseProductData(t){const{key:e,details:s}=t,{id:o,name:i,img_url:n,url:r,rating:a,price_tag:l}=s,c={sku:o,key:e,title:i,image:n,url:this.addCustomQueryParams(r,o),price:l};if(a){const{value:t,number_of_reviews:e}=a;c.rating=t,c.reviewsCount=e}return c}createMediaElement(t){const{inlineVideos:s}=this.o,{id:o,title:i,source:{username:n,provider:r},selectedMedia:a}=t,l=W('
  • '),c=l.querySelector(".ps-image"),{dataset:d}=c;d.imageId=o,d.sourceUsername=n,d.sourceProvider=r;const u=c.querySelector(".ps-img-container"),p=u.querySelector("img"),h=u.querySelector(".ps-post-type");if(s&&a&&"video"===a.type){const t=document.createElement("video");t.setAttribute("src",a.url),t.autoplay=t.loop=t.muted=t.playsInline=!0,u.replaceChild(t,p)}else p.setAttribute("src",e),p.setAttribute("alt",i);return t.media&&t.media.length>1&&h.classList.add("ps-visible"),l}createVideoIcon(t,e){const{inlineVideos:s,thumbOverlay:o}=this.o,{selectedMedia:i}=t;if(s||!i||"video"!==i.type)return;const n=document.createElement("div"),{classList:r}=n;r.add("ps-video-icon"),o&&r.add("ps-overlayed");const a=document.createElement("i");n.appendChild(a),e.insertAdjacentElement("afterbegin",n)}createOverlay(t,e){const{thumbOverlay:s,postedByText:o,instagramUserText:i,viewAndShopText:n}=this.o,{source:{username:r,provider:a},likes:l,comments:c}=t;if(!s)return;const d=W("

    ");d.querySelector(".ps-source-provider").classList.add(`ps-${a}`),d.querySelector(".ps-title").textContent=o,d.querySelector(".ps-username").textContent=r||i,d.querySelector(".ps-share").textContent=n;const u=d.querySelector(".ps-likes-comments");if(null!=l){const t=document.createElement("span");t.classList.add("ps-likes"),t.textContent=l,u.appendChild(t)}if(null!=c){const t=document.createElement("span");t.classList.add("ps-comments"),t.textContent=c,u.appendChild(t)}e.insertBefore(d,e.querySelector("img"))}createTitleElement(t,e){const{appendTitle:s,instagramUserText:o}=this.o;if(!s)return;const{title:i,source:{username:n,provider:r}}=t,a=W("
    ");a.querySelector(".ps-source-provider").classList.add(`ps-${r}`),a.querySelector(".ps-username").textContent=n||o,a.querySelector(".ps-photo-title").textContent=i,e.appendChild(a)}parseImageTemplate(t){const e=this.createMediaElement(t),s=e.querySelector(".ps-image"),o=s.querySelector(".ps-img-container");return this.createVideoIcon(t,o),this.createOverlay(t,o),this.createTitleElement(t,s),e}_onLoadData(e,s=!0){const{o,lightboxInstance:i,photos:n,productsByKeys:r,photosByIds:a}=this,{apiPhotoListUrl:l,pageLimit:c}=o,d=document.createDocumentFragment();let u=[];const{cursor:p,pinned:h,posts:m,products:g}=e,y=(h||[]).concat(m);return p&&y.length>=c?this._nextPagePhotoListURL=v(l,"cursor",JSON.stringify(p)):this._isEnd=!0,g&&t(g,(t=>{const{key:e}=t;r.has(e)||r.set(e,this.parseProductData(t))})),y.forEach((t=>{const e=this.parsePostData(t),{id:s}=e;a.has(s)||(d.appendChild(this.parseImageTemplate(e)),u.push(e),a.set(s,e))})),this.photos=s?n.concat(u):u.concat(n),this._appendWidgetMarkup(d,s),this.loadPhotos().then((t=>{if(this._isLoading=!1,this.displayPhotos(),!t.length)return;const e=[],o=u.filter((s=>{const o=s.id;return!!t.includes(o)&&(e.push(o),!0)})),n=new Set,l=[];e.forEach((t=>{const e=a.get(t);if(!e)return;const{hotspotsAssigned:s,productKeys:o}=e;if(o.length){const t=o[0];r.has(t)||n.add(t)}s&&l.push(t)})),this.loadProducts([...n]),this.loadHotspots(l),i&&i.add(o,s),this.reportShownPhotos(e)}),(()=>{}))}loadPhotos(){const{LOADING:e,IMAGE:s}=Ht;let o=new Set;const{photos:i,photosByIds:n,o:r,abortController:a}=this,{base:l}=r;return t(l.querySelectorAll(`.${s}`),(t=>{const s=t.querySelector("img, video");if(t.classList.contains(e)&&o.add(s),"IMG"!==s.tagName)return;const i=s.getAttribute("src"),r=t.dataset.imageId,a=n.get(r).image;i!==a&&(s.dataset.targetSrc=a)})),Y(o,{signal:a?a.signal:null}).catch((e=>{t(e,(t=>{const e=t.closest(`.${s}`),r=e.dataset.imageId,a=i.findIndex((t=>t.id===r));-1!==a&&(i.splice(a,1),n.delete(r),o.delete(e),C(e))}))})).then((()=>{const i=[...o];let n=new Array(i.length);return t(i,((t,o)=>{const i=t.closest(`.${s}`);window.requestAnimationFrame((()=>{i.classList.remove(e)})),n[o]=i.dataset.imageId})),n}))}loadProducts(t){if(!t.length)return;const{o:e,productsByKeys:s,photos:o,abortController:i}=this,{lang:n,productsUrl:r}=e,a=v(`${r}${[...t].join(",")}`,"locale",n);return X(a,{contentType:null,dataType:"json",signal:i?i.signal:null}).then((t=>{const{products:e}=t;e.forEach((t=>{const{key:e}=t;s.has(e)||s.set(e,this.parseProductData(t))})),o.forEach((t=>{const{productUrl:e,productKeys:o}=t;if(e||!o.length)return;const i=o.find((t=>s.has(t)));if(!i)return;const n=s.get(i);if(n&&n.url){const{url:e}=n;t.productUrl=e}}));const{lightboxInstance:i}=this;i&&i.setProducts(s)}))}loadHotspots(t){if(!t.length)return;const{o:e,abortController:s,photosByIds:o}=this,{flowKey:i,hotspotsUrl:n}=e,r=v(`${n}${t.join(",")}`,"feedKey",i);return X(r,{contentType:null,dataType:"json",signal:s?s.signal:null}).then((t=>{t.hotspots.forEach((({post_key:t,product_key:e,x:s,y:i})=>{const n=o.get(t);if(!n)return;const{productKeys:r}=n,a=r.indexOf(e);a<0||(n.hotspots=n.hotspots||[],n.hotspots.push({index:a+1,productKey:e,x:s,y:i}))}))}))}_appendWidgetMarkup(){const{o:e,ready:s,type:o,targetNode:i}=this;if(s)return;const{theme:n,lightbox:r,noteAddPicsText:a,showSubmit:l,submitText:c,addPhotosImg:d,emptyText:u,albumId:p}=e,{body:h}=document,m=e.noteAddPicsIcons||{},g=W("
    "),y=g.firstChild;y.classList.add(`ps-${o}`,`ps-theme-${n}`);const f=g.querySelector(".ps-note-add-pics");if(a){const t=document.createElement("span");t.classList.add("ps-note-add-pics-text"),t.textContent=a,f.appendChild(t)}if(["facebook","twitter","instagram"].forEach((t=>{if(!m[t])return;const e=document.createElement("span");e.classList.add("ps-note-add-pics-icon",`ps-${t}`),f.appendChild(e)})),l){const t=document.createElement("button");t.setAttribute("type","button"),t.classList.add("ps-note-add-pics-submit"),t.textContent=c;const e=document.createElement("span");t.appendChild(e),f.appendChild(t)}if(this.targetNode.appendChild(y),e.base=y,r){let t=h.querySelector(".ps-popup.ps-imagelist");if(!t){const e=W('
    ×
    ');h.appendChild(e),t=h.querySelector(".ps-popup.ps-imagelist")}const{visibleProducts:s}=e;s>1&&(t.classList.add("ps-popup-wide"),s>2&&t.classList.add("ps-popup-extra-wide"))}if(l||d||u){const{lang:t,submissionFormURL:s,submissionFormCSSURL:o,tocLink:i,flowKey:n}=e,{poweredByUrl:r}=this;this._submitter=new Bt({lang:t,albumId:p,submissionFormUrl:s,submissionFormCssUrl:o,tocLink:i,poweredByUrl:v(r,"utm_campaign","uploader",!0),feedKey:n})}const{hidePopup:b}=this;t(h.querySelectorAll(".ps-popup-overlay.ps-imagelist, .ps-imagelist .ps-popup-close"),(t=>{E(t,"click",b)})),t(i.querySelectorAll(".ps-note-add-pics-submit, .ps-add-photos"),(t=>{E(t,"click",(t=>{t.preventDefault(),this.onSubmitClick()}))})),i.classList.add("ps-widget-ready"),this.ready=!0}reportShownPhotos(t){const e=new CustomEvent("photos_shown",{bubbles:!0,cancelable:!0,detail:{photoIds:t}});this.targetNode.dispatchEvent(e)}displayPhotos(){const{IMAGE:t,EMPTY:e}=Ht,{o:s,targetNode:o}=this,{base:i}=s,n=[...i.querySelectorAll(`.${t}`)];if(!n.length){const{addPhotosImg:t}=s;if(t){const e=document.createElement("img");e.setAttribute("src",t),i.querySelector(".ps-add-photos").appendChild(e)}else this.hideWidget();return void o.classList.add(e)}const{_selectedMediaId:r}=this;if(!r)return;const a=n.find((t=>+t.dataset.imageId===r));if(a){const t=new MouseEvent("click",{bubbles:!0,cancelable:!0});a.dispatchEvent(t),this._selectedMediaId=null}}_showPopupBasedOnLink(t){const{socialIcons:e,widgetId:s}=this.o;if(!e)return void t();const[o,i]=Kt.getState();if(s!==o||!i)return void t();const n=()=>{this._loadData().then((t=>{if(!t)return;const{results:e}=t;for(let t=0,s=e.length;t{this._loadData()}))}destroy(e){const{abortController:s,targetNode:o,_onHidePopup:i,_onAlbumItemClick:n,showSubmitter:r,onProductClick:a,onPhotosShown:l}=this;s&&s.abort(),o&&(delete o.photoslurpWidget,o.removeEventListener("hide_popup",i),o.removeEventListener("widget_click",n),o.removeEventListener("submit_click",r),o.removeEventListener("info_product_click",a),o.removeEventListener("photos_shown",l));const c=this._submitter;c&&(c.destroy(),this._submitter=null);const{resizeCallback:d,hidePopup:u,handleEscape:p}=this;window.removeEventListener("resize",d);const{body:h}=document;if(t(h.querySelectorAll(".ps-popup-overlay.ps-imagelist, .ps-imagelist .ps-popup-close"),(t=>{t.removeEventListener("click",u)})),h.removeEventListener("keydown",p),e){const{fontDisplayUrl:t,widgetTypeUrl:e}=this.o;A(t),A(e)}}},Xt=class extends Wt{_initVars(){super._initVars(),this.type="carousel",this.autoScrollInterval=null,this.toggleEmptyContainer=this.toggleEmptyContainer.bind(this),this._autoScroll=this._autoScroll.bind(this),this._launchAutoScroll=this._launchAutoScroll.bind(this),this.clearAutoScrollInterval=this.clearAutoScrollInterval.bind(this)}_appendWidgetMarkup(t){let{container:e}=this;if(e)e.appendChild(t);else{super._appendWidgetMarkup();const{base:s,orientation:o}=this.o,i=W('');i.querySelector(".ps-carousel-slider").classList.add(`ps-slider-${o}`),e=this.container=i.querySelector(".ps-images"),this.spinner=i.querySelector(".ps-spinner-carousel");const n=this.emptyContainer=i.querySelector(".ps-empty-block");E(n,"click",(t=>{t.preventDefault(),this.onSubmitClick()})),e.appendChild(t),s.appendChild(i),this._addImageClickHandler()}}toggleEmptyContainer(t){const e="ps-visible",{_isLoading:s,_isEnd:o,o:i,slider:n,emptyContainer:r}=this,{classList:a}=r;if(s||!n||n.canSlideNext||!1===t)a.remove(e);else if(o){const{emptyText:t,orientation:s}=i,{emptySpace:o}=n,l="horizontal"===s,c=getComputedStyle(r),d=r.getBoundingClientRect()[l?"height":"width"],u=parseFloat(c.getPropertyValue("margin-"+(l?"left":"top")))||0;t&&o>=d+u?(r.querySelector(".ps-empty-text").textContent=t,r.style[l?"width":"height"]=o-u+"px",a.add(e)):a.remove(e)}else this._loadData()}displayPhotos(){const{container:t}=this;if(!t)return Promise.resolve([]);super.displayPhotos();const{o:e,toggleEmptyContainer:s,_widgetAnalytics:o}=this;let{slider:i}=this;if(!i){const{base:n,orientation:r}=e,a=n.querySelector(".ps-carousel-slider");i=this.slider=new $({orientation:r,wrapper:a,container:t,onSlide(){s(!1)},onSlideEnd(){s(),o.carouselNavigated()}}),this.touch=new z(a,{swipeThreshold:50}),this._initAutoScroll()}i.refresh(),I(s),this.spinner.style.display="none"}_loadData(){const{_isEnd:t,spinner:e}=this;return!t&&e&&(e.style.display="block"),super._loadData.apply(this,arguments)}_onWindowResize(){const{slider:t,toggleEmptyContainer:e}=this;t&&(t.refresh(),e())}clearAutoScrollInterval(){const{autoScrollInterval:t}=this;t&&(clearInterval(t),this.autoScrollInterval=null)}_launchAutoScroll(){document.hidden||this.lightboxInstance?this.clearAutoScrollInterval():this.autoScrollInterval||(this.autoScrollInterval=setInterval(this._autoScroll,this.o.autoScrollInterval))}_initAutoScroll(){const{o:t,container:e,_launchAutoScroll:s,clearAutoScrollInterval:o}=this;if(!t.autoScroll)return;const i={passive:!0};E(document,"visibilitychange",this._launchAutoScroll,i),E(e,"mouseenter",o,i),E(e,"mouseleave",s,i),s()}_autoScroll(){if(this._isLoading)return;const{slider:t}=this;t&&t.slide(t.canSlideNext?"next":0)}_showPopup(){this.o.autoScroll&&this.clearAutoScrollInterval(),super._showPopup.apply(this,arguments)}_onHidePopup(){const{slider:t,lightboxInstance:e}=this;t&&e&&t.slide(e.currentIndex),super._onHidePopup(),this.o.autoScroll&&this._launchAutoScroll()}destroy(t){const{touch:e,slider:s,_launchAutoScroll:o}=this;e&&(e.destroy(),this.touch=null),s&&(s.destroy(),this.slider=null),document.removeEventListener("visibilitychange",o),this.clearAutoScrollInterval(),super.destroy(t)}};t(photoSlurpWidgetSettings,((e,s)=>{"carousel"===e.widgetType&&function(e,s,o){I((function(){try{(s=l({},s)).allowEmpty&&(q("allowEmpty","strictProducts"),s.strictProducts=s.strictProducts||s.allowEmpty,delete s.allowEmpty),s.randomOrder&&(q("randomOrder","orderBy='random'"),s.orderBy=s.orderBy||"random",delete s.randomOrder);const{hasOwnProperty:o}=Object.prototype;t(s,((t,e)=>{o.call(N,e)||R(`Unknown Photoslurp config parameter: ${e}`)}));const{lang:i}=s;let r,a;if(i){const t=i.toLowerCase();r=n[t]||n[t.substring(0,2)]}r=r||n.en,s=l({widgetId:e,shopThisLookText:r.Shop_this_look,ctaButtonText:r.Shop_now,viewAndShopText:r.View_and_shop,loadMoreText:r.Load_more,submitText:r.Submit},N,s,{postedByText:r.Posted_by,reportText:r.Report,errorText:r.Error,instagramUserText:r.Instagram_user,reviewsText:r.Reviews});const c=document.querySelector(`[id="${e}"], ps-widget[data-config="${e}"]`);if(c){const t=getComputedStyle(c),e=0|t.getPropertyValue("--ps-page-limit");e>0&&(s.pageLimit=e),a=t.getPropertyValue("--ps-font-display").trim()}const{theme:d,widgetType:u,themesUrl:p}=s;"auto"===a&&(a="");const h=s.fontDisplayUrl=`${p}/Montserrat${a?"-"+a:""}.css`,m=s.widgetTypeUrl=`${p}/${d}-${u}.css`;T(h),T(m);const g=t=>Array.isArray(t)?t:t?[t]:void 0,y={postsPerPage:s.pageLimit,locale:s.lang,tags:s.collection,productId:JSON.stringify(g(s.productId)),productType:JSON.stringify(g(s.productType))};let{apiPhotoListUrl:f}=s;Object.keys(y).forEach((e=>{const s=y[e];null!=s&&(Array.isArray(s)?t(s,(t=>{f=v(f,e,t)})):f=v(f,e,s))})),s.apiPhotoListUrl=f,s.debug&&B("Photoslurp widget launched in debug mode"),"carousel"!==s.widgetType&&delete s.emptyText;const{showSubmit:b,addPhotosImg:w,emptyText:S,tocLink:C}=s;(b||w||S)&&!C&&R("Photoslurp Terms of Use link (tocLink parameter) missing"),function(t,e){new Xt(t,e)}(s,c)}catch(t){}}),s.initDelay||0)}(s,e)}))})();