var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&!(getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}var REGEX=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function validate(e){return"string"==typeof e&®EX.test(e)}function stringify(e){var t=[];for(let e=0;e<256;++e)t.push((e+256).toString(16).substr(1));var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(t[e[o+0]]+t[e[o+1]]+t[e[o+2]]+t[e[o+3]]+"-"+t[e[o+4]]+t[e[o+5]]+"-"+t[e[o+6]]+t[e[o+7]]+"-"+t[e[o+8]]+t[e[o+9]]+"-"+t[e[o+10]]+t[e[o+11]]+t[e[o+12]]+t[e[o+13]]+t[e[o+14]]+t[e[o+15]]).toLowerCase();if(!validate(i))throw TypeError("Stringified UUID is invalid");return i}var Vidjet=function(){var e,t,o,i,a,n,r,d,c,s,l,m,p=/(tablet|ipad|playbook|silk|kindle)/i.test(navigator.userAgent)||/(android(?!.*mobi))|Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|(hpw|web)OS|Opera M(obi|ini)/i.test(navigator.userAgent),u=!1,f=!1,y=!1,g=[],h={},v=!1,b=!1,w=120;const _=40,S=40;let j=0;var E={landing:0,exit:1,scroll:2,delay:3},I=0,x=1;async function _setAnalytics(){const e=document.getElementById("vidjet"),t=e?e.src||e.dataset?.src||e.getAttribute("data-src"):"",o=new URL(t).searchParams;a=o.get("siteId"),function(){const e=document.getElementById("vidjet"),t=e?e.src:"";t.includes("app-api.vidjet.io")||t.includes("/client-app.js")?(r="https://app-api.vidjet.io",d="https://player.vidjet.io"):t.includes("dev-app-api.vidjet.io")||t.includes("/dev-client-app.js")?(r="https://dev-app-api.vidjet.io",d="https://dev-player.vidjet.io"):t.includes("localhost")||t.includes("/local-client-app.js")?(r="http://localhost:3000",d="https://localhost:8080"):(r="https://app-api.vidjet.io",d="https://player.vidjet.io")}();const i=_getCookie("vidjet-sessionId");_setCookie("vidjet-sessionId",c=i||function(e,t,o){var i=(e=e||{}).random||(e.rng||rng)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){o=o||0;for(let e=0;e<16;++e)t[o+e]=i[e];return t}return stringify(i)}(),1),n={url:location.href,sessionId:c,productId:"f1eb6d75-56cd-4808-83d5-2265e156034c"===a?document.querySelector("form.cart")?.querySelector('button[type="submit"]')?.value||document.querySelector("form.cart")?.getAttribute("data-product_id"):"81c4adfb-15f0-47db-8b5e-4e5135dfb808"===a?("undefined"!=typeof cdcDatalayer&&cdcDatalayer?.ecommerce?.items?.length&&cdcDatalayer.ecommerce.items[0].item_id)+"_"+(prestashop.page.body_classes["lang-fr"]?"fr":"en"):"9160896e-d5ab-48df-833a-ebf3816dbfce"===a?document.getElementById("product_page_product_id")?.value:"e537e73f-d665-49aa-9030-d7cc9056a08b"===a?document.querySelector(".single_add_to_cart_button")?.value||document.querySelector('input[name="product_id"]')?.value||document.querySelector(".variations_form")?.getAttribute("data-product_id"):"1edebbeb-e728-426a-a786-1347433eaa68"===a?"product"===window?.ShopifyAnalytics?.meta?.page?.resourceType&&window.ShopifyAnalytics?.meta?.page?.resourceId||document.querySelector("[data-replo-product-container]")?.getAttribute("data-replo-product-container")||document.querySelector("form[data-productid]")?.getAttribute("data-productid"):"d7d380c6-a103-465b-be56-2d21127112ee"===a?document.getElementById("product_page_product_id")?.value:"product"===window?.ShopifyAnalytics?.meta?.page?.resourceType&&window.ShopifyAnalytics?.meta?.page?.resourceId||window.id_product||document.querySelector(".product_id")?.textContent||document.getElementById("product_page_product_id")?.value||"undefined"!=typeof cdcDatalayer&&cdcDatalayer?.ecommerce?.items?.length&&cdcDatalayer.ecommerce.items[0].item_id||window._idp||window.productObject?.id||document.querySelector("[data-product_id]")?.getAttribute("data-product_id")||document.querySelector("a[data-product_id]")?.getAttribute("data-product_id")||document.querySelector("meta.wooptpmProductId")?.getAttribute("data-id")||document.querySelector('button[name="add-to-cart"]')?.value},await async function(){if(window?.vidjetProductData)return n.brand=window?.vidjetProductData?.brand,void(n.category=window?.vidjetProductData?.category);if("9160896e-d5ab-48df-833a-ebf3816dbfce"===a)return void(n.brand=document.querySelector('[itemprop="brand"] meta[itemprop="name"]')?.content||"");if("348bd200-bb2a-48ca-b534-e017cacb1f7e"!==a||window?.vidjetProductData||await new Promise(e=>{let t=0;const o=setInterval(()=>{window?.vidjetProductData?(clearInterval(o),n.brand=window.vidjetProductData?.brand,n.category=window.vidjetProductData?.category,e()):(t+=100,t>=1e3&&(clearInterval(o),console.warn("vidjetProductData not available after 1 second."),e()))},100)}),window?.vidjetProductData)return n.brand=window?.vidjetProductData?.brand,void(n.category=window?.vidjetProductData?.category);document.querySelectorAll('script[type="application/ld+json"]').forEach(e=>{try{const t=JSON.parse(e.textContent);("Product"===t["@type"]||"ProductGroup"===t["@type"])&&t.brand&&t.category&&(n.brand=t.brand?.name,n.category=t.category)}catch(e){console.warn("Vidjet - Error parsing JSON-LD for product data:",e)}});const e=document.querySelector('[name="gtm4wp_product_data"]');if(e){const t=JSON.parse(e.value);n.brand=t.item_brand,n.category=t.item_category}if("f1eb6d75-56cd-4808-83d5-2265e156034c"===a&&!n.category?.length){const e=["femme","homme","enfant"];let t=document.getElementById("wck_viewed_product-js-extra")?.textContent?.toLowerCase();t?.length||(t=document.querySelector("div.product.type-product")?.className);const o=t&&e.find(e=>t.includes(e));o&&(n.brand=o,n.category=o)}}()}function _integrateManualIfNeeded(){if(!(t=e,0===Object.keys(t).length&&t.constructor===Object||e.integration)){_makeRequest("/website/integrate",{siteId:e&&e._id,integrationDate:(new Date).toISOString(),integration:"manual",websiteUrl:window.location.protocol+"//"+window.location.hostname})}var t}function _isWarmangoProductCampaign(e,t){if("383ece2b-e9a7-4e37-a0a2-5f42d0a1009b"!==e)return!1;return!["d7dfa072-fb6d-48ea-9b1d-b8bb576435bd","618bf347-b02b-43d4-9ffa-079318639735","a246fc8d-fd05-4f2e-886b-fac3065d89bd"].includes(t)}function _setIframeSize(e){let t=function(e){const{mobile:t,tablet:o,desktop:i,bigDesktop:a,giantDesktop:n}={mobile:{square:.8,portrait:.65,landscape:.95},tablet:{square:.6,portrait:.3,landscape:.7},desktop:{square:.35,portrait:.25,landscape:.5},bigDesktop:{square:.3,portrait:.2,landscape:.4},giantDesktop:{square:.25,portrait:.2,landscape:.3}},r=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),d=function({height:e,width:t}){return e/t>.9&&e/t<1.2?"square":e>t?"portrait":"landscape"}(e);switch(!0){case r<=480:return r*t[d];case r<=768:return r*o[d];case r<=1024:return r*i[d];case r<=1680:return r*a[d];default:return r*n[d]}}(e);const o=l.hideBubble||p,i=v?0:30,a=o?0:w||120,{width:n,height:r}=e;return iframeHeight=r/(n/t)+i+a,{iframeWidth:t,iframeHeight:iframeHeight}}function _setBubbleSize(){if(w=w||90,"original"===l.bubbleShape){const{width:e,height:t}=h,o=e/t;return o<1?"e537e73f-d665-49aa-9030-d7cc9056a08b"===a?{width:1.4*w,height:w/o*1.4}:{width:w,height:w/o}:{width:w*o,height:w}}return{width:w,height:w}}function _limitOffset(e){const{height:t,width:o}=h;if(0===e.moveX&&0===e.moveY)return{offsetX:0,offsetY:0};const{iframeWidth:i,iframeHeight:a}=b?_setIframeSize({width:o,height:t}):_setBubbleSize(),n=Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)-20,r=Math.max(document.documentElement.clientWidth||0,window.innerWidth||0)-20;let{moveX:d,moveY:c}=e;const s=c+a,l=d+i;return s>n&&(c-=s-n),l>r&&(d-=l-r),{offsetX:d,offsetY:c}}function _addElement(e,t,o,i,a,n){if(l.isStickyBar)return _sendEvent("display"),function(e,t,o,i,a){const n=document.createElement("div"),{backgroundColor:r,textColor:d,text:c}=l.stickyBarOptions,{moveY:s}=i;n.classList.add("vidjet-stickyBar"),n.id="vidjet-stickybar",n.style["background-color"]=r,s&&(n.style.bottom=`${s||20}px`),n.innerHTML=`\n
\n
\n \n ${c}\n
\n
\n \n
\n
\n `,document.body.appendChild(n),document.getElementById("vidjet-stickybar-open-video").addEventListener("click",function(){n.classList.add("vidjet-hidden"),_addIframe(e,t,o,i,a)}),document.getElementById("vidjet-stickybar-close").addEventListener("click",function(){n.classList.add("vidjet-hidden")})}(e,t,o,i,a);_addIframe(e,t,o,i,a)}function _addIframe(t,o,i,r,s,u){const{campaignType:f}=t||{},{offsetX:y,offsetY:g}=_limitOffset(r);if(!document.querySelectorAll(".vidjet-iframe").length){let r=document.createElement("iframe");var b=new URL(`${d}/${o}/${i}`);const u="popup"===f;b.searchParams.set("sessionId",c),b.searchParams.set("device",p?"mobile":"desktop"),b.searchParams.set("url",n.url),b.searchParams.set("isDynamicFormat",_isDynamicFormat(l)),n.productId&&b.searchParams.set("productId",n.productId),r.classList.add("vidjet-iframe"),r.title="Vidjet video player",r.allow="clipboard-read; clipboard-write; fullscreen",r.style.border="none",r.style.position="fixed";const w=10;if(r.style.bottom=u?0:g?`${g}px`:`${w}px`,r.style.display="block",v&&(r.style.borderRadius="10px"),"right"!==f||u?"left"!==f||u?u?r.classList.add("vidjet-popup"):r.style.left=y?`${y}px`:0:r.style.left=y?`${y}px`:`${w}px`:r.style.right=y?`${y}px`:`${w}px`,r.style.zIndex="4815162342","3b552290-2fcf-4b40-84bb-eb6c0118d821"===o?r.style.zIndex="2147483646":"4eb27fa9-2ff9-4c62-8a74-184ded24bb80"===o&&(r.style.zIndex="29"),r.src=b.toString(),u)u&&t.isFullScreen&&(_injectCssFullScreen(),r.classList.add("vidjet-fullscreen"),r.style.height="100%",r.style.width="100%",r.style.bottom="0px",r.style.right="0px",r.style.left="0px");else if(s&&!l.isFullScreen){const{iframeWidth:e,iframeHeight:t}=_setIframeSize(h);r.style.width=`${e}px`,r.style.height=`${t}px`}else{const{width:e,height:t}=_setBubbleSize();r.style.width=`${e+_}px`,r.style.height=`${t+S}px`}_isWarmangoProductCampaign(o,i)?(r.style.position="absolute",document.getElementsByClassName("media-viewer__image-link")[0].style.position="relative",document.getElementsByClassName("media-viewer__image-link")[0].appendChild(r)):"4e3643bd-7978-476a-9118-b09d2197fd00"===a&&"a80b5633-dc00-4c9a-832c-0fb4c5d99f22"===i?(r.style.position="absolute",r.style.right="5px",r.style.bottom="8px",document.getElementsByClassName("swiper-container main-slider")[0].appendChild(r)):document.body.appendChild(r);const j={action:"widgetToDisplay",data:{campaign:m,site:e}};r.onload=function(){r.contentWindow.postMessage(j,"*")}}}function _handleAddToCartEvent(t){if("f98b3ab0-0273-4608-a7c7-842e66a421bf"!==a){switch(e.integration){case"shopify":!function(e){let t={items:[{id:e.variantId,qty:e.qty||1}]};fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(e=>{document.dispatchEvent(new CustomEvent("cart:refresh"))})}(t);break;case"woocommerce":window.vidjetAddToCart(t,t.isBuyNow),1===window.vidjetAddToCart.length&&t.isBuyNow&&(window.location.href=window.vidjetcheckoutUrl);break;case"prestashop":!function(e){const t=window.prestashop&&prestashop.static_token,o=window.prestashop&&prestashop.urls?.pages?.cart||location.origin;var i="controller=cart&add=1&action=update&ajax=true&qty="+(e.qty||1)+"&token="+t+"&id_product="+e.productId+"&ipa="+e.variantId;$.post(o,i,null,"json").then(t=>{window.prestashop&&prestashop.emit("updateCart",{reason:{},resp:t}),e.isBuyNow&&(window.location.href=window.prestashop&&prestashop.urls?.pages?.order||location.origin+"/order")}).fail(e=>{window.prestashop&&prestashop.emit("handleError",{eventType:"addProductToCart",resp:e})})}(t);break;case"magento":!function(e){const t=document.querySelector('input[name="form_key"]').value;fetch(window.location.origin+"/checkout/cart/add/",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},body:new URLSearchParams({product:e.productId,selected_configurable_option:"",related_product:"",item:e.productId,form_key:t,qty:"1",isAjax:"true"})}).then(e=>e.json()).then(t=>{console.log(t),e.isBuyNow&&(window.location.href=window.location.origin+"/checkout/cart/")}).catch(e=>console.error("Error:",e))}(t)}if("9b37caa1-347d-4e4f-8478-1c4126fb9f7e"===a){_callScriptCallEvent(),document.dispatchEvent(new CustomEvent("cart:refresh"));const e=document.querySelector("cart-drawer");e&&!e.hasAttribute("open")&&e.show(),document.dispatchEvent(new CustomEvent("cart:refresh"))}else if("aec674f0-a547-4a5e-a39e-f86e0b2ac770"===a){_callScriptCallEvent(),document.dispatchEvent(new CustomEvent("cart:refresh"));const e=document.querySelector("cart-drawer");e.classList.contains("active")||e.classList.add("active"),document.dispatchEvent(new CustomEvent("cart:refresh"))}else"de5b64fe-d44b-45f9-8efd-2bbd2c36784a"===a&&(_callScriptCallEvent(),setTimeout(()=>{fetch(window.routes.cart_url).then(e=>e.text()).then(e=>{let t=(new DOMParser).parseFromString(e,"text/html"),o=t.querySelector("cart-drawer");document.querySelector("cart-drawer").refreshSections(o.innerHTML,!0);let i=t.querySelector("cart-counter");document.querySelector("cart-counter").refresh(i.innerHTML,!0)})},500))}else _callScriptCallEvent()}function _callScriptCallEvent(){const e=[document.querySelector(".vidjet-iframe"),...document.querySelectorAll(".vidjet-embed-iframe")],t={action:"scriptCloseEvent"},o=e.filter(e=>e);o.length>0&&o.forEach(e=>{e.contentWindow.postMessage(t,"*")})}async function _getCartItems(){if("shopify"===e.integration){return(await async function(){const e=await fetch("/cart.json");if(200===e.status)return e.json();console.log(`Failed to get request, Shopify returned ${e.status} ${e.statusText}`)}()).items.map(e=>({productId:e.id,variantId:e.variant_id,quantity:e.quantity}))}}function _reactToPlayerEvent(i){const{origin:r,properties:d}=i&&i.data,c=document.querySelectorAll(".vidjet-iframe, .vidjet-embed-iframe"),s=Array.from(c).find(e=>e.contentWindow===i.source);if(!s)return;const p=document.querySelector(".vidjet-iframe")||document.querySelector(".vidjet-embed-iframe");if(p)if("closeMainPlayer"===r){if(d&&d.currentVideoId&&"original"===l.bubbleShape){const e=g.find(e=>e._id===d.currentVideoId);h={height:e.height,width:e.width}}if(b=!1,setTimeout(()=>{const{width:e,height:t}=_setBubbleSize();p.style.width=`${e+_}px`,p.style.height=`${t+S}px`},500),l.isFullScreen){document.querySelectorAll(".vidjet-body").forEach(e=>e.classList.remove("vidjet-body")),p.classList.remove("vidjet-fullscreen"),window.scrollTo(0,j);const e=10;p.style.bottom=l.moveY?`${l.moveY+e}px`:`${e}px`,p.style.display="block",1===l.position?(p.style.left="unset",p.style.right=l.moveX?`${l.moveX+e}px`:`${e}px`):0===l.position&&(p.style.right="unset",p.style.left=l.moveX?`${l.moveX+e}px`:`${e}px`),p.src.includes("a80b5633-dc00-4c9a-832c-0fb4c5d99f22")&&(p.style.position="absolute",p.style.right="5px",p.style.bottom="8px")}}else if("openMainPlayer"===r)if(b=!0,v&&(h={width:1080,height:1920}),l.isFullScreen)p.style.height="100%",p.style.width="100%",p.style.bottom="0px",p.style.right="0px",p.style.left="0px",p.classList.add("vidjet-fullscreen"),p.src.includes("a80b5633-dc00-4c9a-832c-0fb4c5d99f22")&&(p.style.position="fixed"),_injectCssFullScreen();else{if(_isWarmangoProductCampaign(e._id,m._id))return p.style.width="auto",void(p.style.height="100%");const{iframeWidth:t,iframeHeight:o}=_setIframeSize(h);p.style.width=`${t}px`,p.style.height=`${o}px`}else if("destroyIframe"===r)setTimeout(()=>{_destroyIframe(),l?.isStickyBar&&document.getElementById("vidjet-stickybar")&&document.getElementById("vidjet-stickybar").classList.remove("vidjet-hidden"),l?.isFullScreen&&document.querySelectorAll(".vidjet-body").forEach(e=>e.classList.remove("vidjet-body"))},500);else if("getCartItems"===r)!async function(){const e=[document.querySelector(".vidjet-iframe"),...document.querySelectorAll(".vidjet-embed-iframe")],t={action:"sendCartItems",data:await _getCartItems()},o=e.filter(e=>e);o.length>0&&o.forEach(e=>{e.contentWindow.postMessage(t,"*")})}();else if("addToCart"===r)_handleAddToCartEvent(d);else if("killIframe"===r){const e=document.querySelector(`iframe[data-vidjet-campaign-id="${d.campaignId}"]`);e?.parentElement?.remove()}else if("getAnalytics"===r){const e={action:"getAnalytics",data:n};p.contentWindow.postMessage(e,"*")}else if("openFullScreen"===r)!function(e){const t=".vidjet-fullscreen { \n position: fixed !important; \n height: 100% !important;\n width: 100% !important;\n z-index: 2147483647; \n top: 0; \n right: 0; \n bottom: 0px; \n left: 0px; \n max-height: none !important; \n margin: 0 !important\n } ",o=document.createElement("style");o.innerText=t,document.head.appendChild(o),window.scrollY&&0!==window.scrollY&&(j=window.scrollY);e&&!Array.from(e.classList).includes("vidjet-fullscreen")&&e.parentElement.classList.add("vidjet-fullscreen");if("734b0b8d-b483-407a-8d92-4aeab5a0fa73"===a)document.querySelector(".product__info-wrapper.grid__item.scroll-trigger.animate--slide-in")?.classList.add("vidjet-fullscreen");else if("6c5262c4-16e4-4f4e-9fb8-9ce7e2a35ebb"===a)document.getElementById("corner-cowi-open-primary-card")?.setAttribute("style","opacity: 0 !important;");else if("85e681e0-fa68-47ea-8c25-87c381917dd3"===a)document.querySelector(".m-main-product--wrapper")?.classList.add("vidjet-fullscreen");else if("2ddbc5bf-6ca3-4416-bebc-5344ed1bc5d3"===a)document.querySelector(".ymq-cart-app-slid-overlay").style.setProperty("display","none","important"),document.getElementById("ymq-cart-app").style.setProperty("display","none","important");else if("5e777d31-4d59-4f34-bfe6-5c6b79d39079"===a)document.querySelector(".product__media").style.setProperty("display","none","important"),document.querySelector(".media-and-text").style.setProperty("display","none","important");else if("9c711719-c902-445b-9ec1-8af6f88c0231"===a)document.querySelector(".sticky-buy-button")?.style?.setProperty("display","none","important");else if("1cad9345-776f-4402-8cf3-c602c6c9c4d8"===a||"2c3703cc-396d-46a4-ad9e-0d0fbd7188a0"===a)document.querySelector(".product__info-wrapper")?.style?.setProperty("display","contents","important");else if("de5b64fe-d44b-45f9-8efd-2bbd2c36784a"===a)document.querySelector("#shopify-section-cart-drawer")?.style?.setProperty("display","none","important"),document.querySelector("#shopify-section-subscription-drawer")?.style?.setProperty("display","none","important"),document.querySelector("#shopify-section-1click-ecofill-drawer")?.style?.setProperty("display","none","important"),document.querySelector("#shopify-section-product-drawer")?.style?.setProperty("display","none","important");else if("f42b0a8b-4eaf-4e4e-b25d-bfc34abc779b"===a)document.querySelector("#new-drawer-cart")?.style?.setProperty("display","none","important");else if("24870130-623d-47c8-acb5-fbb842be49e6"===a)document.querySelector(".salepify-fg-advanced-wrapper")?.style?.setProperty("display","none","important");else if("c2343949-3873-4dc4-b2d8-5508b8e382db"===a)document.querySelectorAll(".product__block.standard__app.aos-animate")?.length&&document.querySelectorAll(".product__block.standard__app.aos-animate")[0]?.style?.setProperty("will-change","auto","important");else if("fecd5b2c-076a-41c2-b712-cfeccc2c4d28"===a)document.querySelector("#product-modal")?.style?.setProperty("display","none","important");else if("8493a150-087d-488f-b52a-30af13a02d93"===a){document.querySelectorAll(".vidjet-carousel-wrapper").forEach(e=>{e.closest(".product__block")?.style.setProperty("will-change","auto")}),document.querySelector(".footer-block.footer-block--menu.text-left")?.style?.setProperty("display","none","important")}else if("4d6c85bb-ad17-4a9d-8f34-1e363f8c9430"===a)document.querySelector('[id*="ss_video_grid_4_gweHxC"]')?.style?.setProperty("display","none","important");else if("6af0a5c1-4fbe-483c-8c0e-94b468e6861d"===a)document.querySelector(".cta-flottant")?.style?.setProperty("display","none","important"),document.querySelector(".crisp-client")?.style?.setProperty("display","none","important");else if("01668c0c-9e2a-4a1b-a301-c25dd4c7d50a"===a){const e=document.querySelector(".product__info-wrapper");e?.style?.setProperty("opacity","1","important"),e?.style?.setProperty("transform","none","important"),e?.style?.setProperty("animation","none","important")}const i=document.querySelectorAll(".vidjet-iframe");i.forEach(e=>{e.style.display="none"})}(s),_injectCssFullScreen();else if("closeFullScreen"===r)!function(){if(document.querySelectorAll(".vidjet-body").forEach(e=>e.classList.remove("vidjet-body")),document.querySelectorAll(".vidjet-fullscreen").forEach(e=>e.classList.remove("vidjet-fullscreen")),window.scrollTo(0,j),"6c5262c4-16e4-4f4e-9fb8-9ce7e2a35ebb"===a)document.getElementById("corner-cowi-open-primary-card").style.removeProperty("opacity");else if("2ddbc5bf-6ca3-4416-bebc-5344ed1bc5d3"===a)document.querySelector(".ymq-cart-app-slid-overlay").style.removeProperty("display"),document.getElementById("ymq-cart-app").style.removeProperty("display");else if("5e777d31-4d59-4f34-bfe6-5c6b79d39079"===a)document.querySelector(".product__media").style.removeProperty("display"),document.querySelector(".media-and-text").style.removeProperty("display");else if("9c711719-c902-445b-9ec1-8af6f88c0231"===a)document.querySelector(".sticky-buy-button")?.style?.removeProperty("display");else if("1cad9345-776f-4402-8cf3-c602c6c9c4d8"===a||"2c3703cc-396d-46a4-ad9e-0d0fbd7188a0"===a)document.querySelector(".product__info-wrapper")?.style?.removeProperty("display");else if("de5b64fe-d44b-45f9-8efd-2bbd2c36784a"===a)document.querySelector("#shopify-section-cart-drawer")?.style?.removeProperty("display"),document.querySelector("#shopify-section-subscription-drawer")?.style?.removeProperty("display"),document.querySelector("#shopify-section-1click-ecofill-drawer")?.style?.removeProperty("display"),document.querySelector("#shopify-section-product-drawer")?.style?.removeProperty("display");else if("f42b0a8b-4eaf-4e4e-b25d-bfc34abc779b"===a)document.querySelector("#new-drawer-cart")?.style?.removeProperty("display");else if("24870130-623d-47c8-acb5-fbb842be49e6"===a)document.querySelector(".salepify-fg-advanced-wrapper")?.style?.removeProperty("display");else if("c2343949-3873-4dc4-b2d8-5508b8e382db"===a)document.querySelectorAll(".product__block.standard__app.aos-animate")?.length&&document.querySelectorAll(".product__block.standard__app.aos-animate")[0]?.style?.removeProperty("will-change");else if("fecd5b2c-076a-41c2-b712-cfeccc2c4d28"===a)document.querySelector("#product-modal")?.style?.removeProperty("display");else if("8493a150-087d-488f-b52a-30af13a02d93"===a){document.querySelectorAll(".vidjet-carousel-wrapper").forEach(e=>{e.closest(".product__block")?.style.setProperty("will-change","transform,opacity")}),document.querySelector(".footer-block.footer-block--menu.text-left")?.style?.removeProperty("display")}else if("4d6c85bb-ad17-4a9d-8f34-1e363f8c9430"===a)document.querySelector('[id*="ss_video_grid_4_gweHxC"]')?.style?.removeProperty("display");else if("6af0a5c1-4fbe-483c-8c0e-94b468e6861d"===a)document.querySelector(".cta-flottant")?.style?.removeProperty("display"),document.querySelector(".crisp-client")?.style?.removeProperty("display");else if("01668c0c-9e2a-4a1b-a301-c25dd4c7d50a"===a){const e=document.querySelector(".product__info-wrapper");e?.style?.removeProperty("opacity"),e?.style?.removeProperty("transform"),e?.style?.removeProperty("animation")}const e=document.querySelectorAll(".vidjet-iframe");e.forEach(e=>{e.style.display="block"})}();else if("carouselHeight"===r){_targetCarousels(d.campaignId).forEach(e=>{e.parentElement.style.height=`calc(${d.carouselHeight}px + 32px)`,e.parentElement.style.paddingBottom="0"})}else if("youtubeThumbnailClicked"===r)document.querySelector("#videos")?.scrollIntoView({behavior:"smooth"});else if("newBulkLoaded"===r){const i=t?.length&&t.find(e=>e._id===d.campaignId);if(o?.length&&o.find(e=>e._id===d.campaignId)){const e=document.querySelector(`iframe[data-vidjet-campaign-id="${d.campaignId}"]`);return e?.parentElement?.remove()}if(!i)return;const n={action:"widgetToDisplay",data:{campaign:i,site:e}};_targetCarousels(d.campaignId).forEach(e=>{function updateIframeStyle(e){e.parentElement.style.height&&"0px"!==e.parentElement.style.height||("77c1d711-700a-4802-aa46-bf4990804ca6"===e.dataset.vidjetCampaignId?e.parentElement.style.height="auto":e.parentElement.style.height="9160896e-d5ab-48df-833a-ebf3816dbfce"===a?"180px":"125px"),"none"===e.parentElement.style.display&&(e.parentElement.style.display="")}e?.contentWindow?.postMessage(n,"*"),updateIframeStyle(e),e.addEventListener("load",()=>{e?.contentWindow?.postMessage(n,"*"),updateIframeStyle(e)})})}else if("whatMattersOpenAtcSlider"===r){_callScriptCallEvent();const e=d.productUrl.match(/\/products\/(.+)/)[1];document.querySelector("product-drawer").open(e)}}function _targetCarousels(e){let t=document.querySelectorAll(".vidjet-embed-iframe");t=Array.prototype.slice.call(t);let o=[];return 1===t.length?t:(o=t.filter(t=>t?.dataset?.vidjetCampaignId?t.dataset.vidjetCampaignId===e:t?.dataset?.src?.includes("vidjet.io")?t.dataset.src.includes(e):t?.attributes?.src?.value?.includes(e)),o)}function _injectCssFullScreen(){if("object"!=typeof Array.from(document.head.querySelectorAll("style")).find(e=>"vidjet-body"===e.id)){const e=".vidjet-body {\n position: fixed;\n top: 0;\n left: 0;\n overflow: hidden;\n height: 100vh;\n width: 100vw;\n background-color: white;\n color: white;\n }\n .vidjet-body *:not(.vidjet-fullscreen) {z-index: unset !important;} ",t=document.createElement("style");t.setAttribute("id","vidjet-body-style"),t.innerText=e,document.head.appendChild(t)}document.querySelector("body").classList.add("vidjet-body"),document.querySelector("html").classList.add("vidjet-body"),p&&window.scrollTo(0,1)}function _decryptParams(e){let t={};return 0===e?.formatType?t.campaignType="popup":1===e?.formatType&&(0===e?.position&&(t.campaignType="left"),1===e?.position&&(t.campaignType="right")),e?.isFullScreen&&(t.isFullScreen="fullscreen"),t}function _setCookie(e,t,o){var i="";if(o){var a=new Date;a.setTime(a.getTime()+60*o*60*1e3),i="; expires="+a.toUTCString()}document.cookie=e+"="+(t||"")+i+"; path=/"}function _getCookie(e){for(var t=e+"=",o=document.cookie.split(";"),i=0;i1?(v=!0,h={width:1080,height:1920}):h={width:e.videos[0].width,height:e.videos[0].height},b=l.openByDefault&&!l.isFullScreen);const{moveX:d,moveY:c,bubbleSize:s}=l||{},_={siteId:n,_id:r,videoOriginalSize:h,moveX:d,moveY:c,isPlayerOpen:b,bubbleSize:s};w=s,e.isBulk||function(){const e=_getCookie(`vidjet_view_${m._id}`),t=e?parseInt(e)+1:1;_setCookie(`vidjet_view_${m._id}`,t,m.segmentation.viewRestriction.notShownTime+1),t>=m.segmentation.viewRestriction.maxView&&(_setCookie(`vidjet_timing_${m._id}`,new Date((new Date).getTime()+1e3*m.segmentation.viewRestriction.notShownTime*3600).toISOString(),m.segmentation.viewRestriction.notShownTime+1),_deleteCookie(`vidjet_view_${m._id}`))}(),e?.segmentation?.trigger?.type&&e.segmentation.trigger.type!==t?e.segmentation.trigger.type===o?(document.addEventListener("mouseout",e=>{_onExitIntent(e,_)}),p&&document.addEventListener("scroll",e=>{_onExitIntent(e,_)})):e.segmentation.trigger.type===i?window.addEventListener("scroll",function(t){f||(window.requestAnimationFrame(function(){!function(e,t){let o=document.documentElement,i=document.body,a="scrollTop",n="scrollHeight",r=(o[a]||i[a])/((o[n]||i[n])-o.clientHeight)*100;const{siteId:d,_id:c,moveX:s,moveY:m,isPlayerOpen:p,bubbleSize:u}=t;r>=e.segmentation.trigger.option&&!y&&(_addElement(_decryptParams(l),d,c,{moveX:s,moveY:m},p),y=!0)}(e,_),f=!1}),f=!0)},!0):e.segmentation.trigger.type===a&&setTimeout(()=>{_addElement(_decryptParams(l),n,r,{moveX:d,moveY:c},b)},1e3*(e.segmentation.trigger.option||10)):_addElement(_decryptParams(l),n,r,{moveX:d,moveY:c},b)}let q=0;const _onExitIntent=(e,t)=>{const{siteId:o,_id:i,moveX:a,moveY:n,isPlayerOpen:r,bubbleSize:d}=t;if(e.clientY<50&&null==e.relatedTarget&&"select"!==e.target.nodeName.toLowerCase())document.removeEventListener("mouseout",e=>{console.log(e,"removed")}),_addElement(_decryptParams(l),o,i,{moveX:a,moveY:n},r);else if("scroll"==e.type){let e=window.pageYOffset||document.documentElement.scrollTop;e+50{console.log(e,"removed")}),_addElement(_decryptParams(l),o,i,{moveX:a,moveY:n},r)),q=e<=0?0:e}};function _deleteCookie(e){document.cookie=e+"=; Max-Age=-99999999;"}function _destroyIframe(){if(document.querySelector(".vidjet-iframe")){return document.querySelector(".vidjet-iframe").remove()}}function _makeRequest(e,t){var o=new XMLHttpRequest,i=r+e;o.open("POST",i,!0),o.setRequestHeader("Content-Type","application/json"),o.send(JSON.stringify(t))}function _sendAnalyticsToIframes(){const e=[...document.querySelectorAll(".vidjet-embed-iframe")],t={action:"getAnalytics",data:n};(s=e.filter(e=>e)).length>0&&s.forEach(e=>{e.contentWindow.postMessage(t,"*")})}function _sendEvent(e,t){const o={siteId:a,campaignId:m&&m._id,sessionId:c||_getCookie("vidjet-sessionId"),type:e,date:(new Date).toISOString(),device:p?"mobile":"desktop",params:t};if("cartCreated"===e){const e=_getCookie("vidjet_cart_id");e&&(o.cartId=e)}_makeRequest("/track-event",o)}function _exclusiveTimeClientBulkInGalery(t){const o=p?"touchend":"click";document.getElementsByClassName("magic-slide mt-active")[0].insertAdjacentHTML("afterend",'');const i=document.getElementsByClassName("magictoolbox-selector mz-thumb");for(let e of i)e.addEventListener(o,()=>{document.getElementsByClassName("magic-slide mt-active")[0].style.display="block",document.getElementsByClassName("magic-slide mt-active vidjet-toggle")[0].style.display="none";const e=document.getElementsByClassName("magictoolbox-selector mz-thumb vidjet-toggle")[0];e.classList.remove("active-selector"),e.classList.remove("mz-thumb-selected")});const a=document.createElement("a");a.innerHTML=`Audemars Piguet Royal Oak - 14img-1`,a.firstChild.addEventListener(o,()=>{document.getElementsByClassName("magic-slide mt-active")[0].style.display="none",document.getElementsByClassName("magic-slide mt-active vidjet-toggle")[0].style.display="block";const e=document.getElementsByClassName("magictoolbox-selector mz-thumb active-selector")[0];e&&e.classList.remove("active-selector"),e&&e.classList.remove("mz-thumb-selected");const t=document.getElementsByClassName("magictoolbox-selector mz-thumb vidjet-toggle")[0];t.classList.add("active-selector"),t.classList.add("mz-thumb-selected")}),document.getElementsByClassName("magictoolbox-selector mz-thumb")[document.getElementsByClassName("magictoolbox-selector mz-thumb").length-1].parentNode.appendChild(a.firstChild);const n=document.querySelector(`iframe[data-vidjet-campaign-id="${t._id}"]`);n&&n.addEventListener("load",function(){_sendAnalyticsToIframes();const o={action:"widgetToDisplay",data:{campaign:t,site:e}};n.contentWindow.postMessage(o,"*")})}function _howssClientBulkInGalery(t){const o=document.querySelector('[id^="Slider-Gallery-template--"][id$="__main"]'),i=document.createElement("x-cell");i.className="slider__slide wow animate__ animate__fadeInUp animated",i.style.opacity="1",i.style.animationName="fadeInUp",i.innerHTML='\n
\n \n
\n ';const a=o.querySelectorAll("x-cell"),n=a.length-2;n>=0&&a[n]?o.insertBefore(i,a[n]):o.appendChild(i);const r=document.querySelector("x-cell.slider-counter--total");if(r){const e=parseInt(r.getAttribute("counter-total"),10)+1;r.setAttribute("counter-total",e),r.textContent=e}const d=document.querySelector(`iframe[data-vidjet-campaign-id="${t._id}"]`);d&&d.addEventListener("load",function(){_sendAnalyticsToIframes();const o={action:"widgetToDisplay",data:{campaign:t,site:e}};d.contentWindow.postMessage(o,"*")})}function _addResizeListener(){let e;window.addEventListener("resize",function(t){clearTimeout(e),e=setTimeout(function(){!function(){if(!l)return;if("popup"===_decryptParams(l).campaignType)return;let{iframeWidth:e,iframeHeight:t}=_setIframeSize(h);const o={moveX:l.moveX,moveY:l.moveY},{offsetX:i,offsetY:a}=_limitOffset(o);if(b)_resizeIframe(e,t,i,a);else{const{width:e,height:t}=_setBubbleSize();_resizeIframe(e+_,t+S,i,a)}}()},250)},!0)}function _resizeIframe(e,t,o,i){const a=document.querySelector(".vidjet-iframe");if(a){const{campaignType:n}=_decryptParams(l),r="popup"===n,d=10;"right"!==n||r?"left"!==n||r||(a.style.left=o?`${o}px`:`${d}px`):a.style.right=o?`${o}px`:`${d}px`,a.style.bottom=r?0:i?`${i}px`:`${d}px`,a&&(a.style.width=`${e}px`,a.style.height=`${t}px`)}}function _isDynamicFormat(e){return e.formats?1===e.formats[0].formatType||0===e.formats[0].formatType:1===e.formatType||0===e.formatType}return{init:async function(){if(await new Promise(e=>setTimeout(e,200)),await _setAnalytics(),_sendAnalyticsToIframes(),window.addEventListener("message",e=>{"vidjet"===e.data.messageOrigin&&_reactToPlayerEvent(e)},!1),function(){if("1f3f4a1f-b5cf-41c9-8906-be1aeebde3e1"===a){const o=[];for(const i of o)if(document.location.pathname===i.url||document.location.pathname===i.secondPath){var e=1,t=setInterval(function(){var o=document.getElementsByClassName("woocommerce-product-gallery__image")&&document.getElementsByClassName("woocommerce-product-gallery__image")[2];o&&(o.innerHTML=`\n
\n \n
`,clearInterval(t)),(e+=1)>=20&&clearInterval(t)},100);break}}else if("15701a38-dae7-47d3-9881-cddf540b11a2"===a){const o=[];for(const i of o)if(document.location.href.includes(i.url)){e=1,t=setInterval(function(){var o=document.getElementsByClassName("product-lmage-large swiper-slide")&&document.getElementsByClassName("product-lmage-large swiper-slide")[2];o&&(o.innerHTML=`\n
\n \n
`,clearInterval(t)),(e+=1)>=20&&clearInterval(t)},100);break}}}(),function(){let e=document.querySelector("style[data-vidjet]");if(e)return e.remove();{const e="";document.head.insertAdjacentHTML("beforeend",e)}}(),a){if(await async function(){const d=[...new Set(Array.from(document.querySelectorAll("iframe.vidjet-embed-iframe")).map(e=>{const t=e.getAttribute("data-vidjet-campaign-id");if(t)return t;const o=e.getAttribute("src").match(/player\.vidjet\.io(?:\/embed)?\/[^\/]+\/([^\/]+)/);return o?o[1]:null}).filter(Boolean))];"8d9a90b8-c0f0-4847-ae8f-3cb3827b6e65"===a&&d.push("459c1095-85d9-41a8-b7b8-2ee2c4d06097");const s=new URLSearchParams({...n,siteId:a,isMobile:p,sessionId:c,embededCampaignIds:d});try{const a=await fetch(`${r}/widgets?${s.toString()}`,{method:"GET"}),n=await a.json();t=n.campaignsReturned||[],o=n.campaignsToKill||[],i=n.campaignsToShowManual||[],e=n.site}catch(e){console.error("Error fetching widget data:",e)}}(),e)if(e.isLocked)!function(){const e=[...document.querySelectorAll(".vidjet-video-wrapper"),...document.querySelectorAll(".vidjet-carousel-wrapper")];for(const t of e)t.remove()}();else if(function(){const e=new URL(window.location.href);if("f1eb6d75-56cd-4808-83d5-2265e156034c"===a&&location.href.includes("live-shopping")){if(document.querySelectorAll("[data-bellepoque-play-onclick]").forEach(e=>{e.addEventListener("click",function(t){t.preventDefault();const o=e.getAttribute("data-bellepoque-play-onclick");o?Vidjet.showCampaign(o,!0):console.error("Vidjet - Campaign ID is missing on clicked element.")})}),e.searchParams.has("autoplay-live-shopping-be")){const t=e.searchParams.get("autoplay-live-shopping-be");Vidjet.showCampaign(t,!0)}}else if("f1eb6d75-56cd-4808-83d5-2265e156034c"===a&&e.searchParams.has("vidjet-show-widget")){const t=e.searchParams.get("vidjet-show-widget");Vidjet.showCampaign(t,!0)}}(),function(){let o=!1;for(const i of t){if("d7d380c6-a103-465b-be56-2d21127112ee"===a&&n.productId&&""!==n.productId){const e=document.getElementById("product-description-short")?.innerHTML;e&&i?.videos?.length&&i.videos[0]?.cta?.products?.length&&i.videos.forEach(t=>{t.cta?.products?.length&&t.cta?.products.forEach(t=>t.description=e)})}if(_isDynamicFormat(i)){if(o)continue;if(l=p?i.formats.find(e=>e.deviceType===I):i.formats.find(e=>e.deviceType===x),!i.bulk){const e=_getCookie(`vidjet_timing_${i._id}`);if(e&&(new Date).getTime(){function updateIframeStyle(e){e.parentElement.style.height&&"0px"!==e.parentElement.style.height||("77c1d711-700a-4802-aa46-bf4990804ca6"===e.dataset.vidjetCampaignId?e.parentElement.style.height="auto":e.parentElement.style.height="9160896e-d5ab-48df-833a-ebf3816dbfce"===a?"180px":"125px"),"none"===e.parentElement.style.display&&(e.parentElement.style.display="")}e?.contentWindow?.postMessage(t,"*"),updateIframeStyle(e),e.addEventListener("load",()=>{e?.contentWindow?.postMessage(t,"*"),updateIframeStyle(e)})})}}}(),s.forEach(t=>{const i=o.find(e=>e._id===t?.getAttribute("data-vidjet-campaign-id"));if(i){if(document?.documentElement?.classList?.contains("shopify-design-mode")||!0===window?.Shopify?.designMode){const t={action:"widgetToDisplay",data:{campaign:{...i,videos:[{url:"https://media.vidjet.io/default-color-preview.mp4",_id:"1",videoId:"3",thumbnail:"https://media.vidjet.io/default-color-preview.jpg"},{url:"https://media.vidjet.io/default-color-preview.mp4",_id:"2",videoId:"3",thumbnail:"https://media.vidjet.io/default-color-preview.jpg"},{url:"https://media.vidjet.io/default-color-preview.mp4",_id:"3",videoId:"3",thumbnail:"https://media.vidjet.io/default-color-preview.jpg"}]},site:e}};return void _targetCarousels(i._id).forEach(e=>{function updateIframeStyle(e){e.parentElement.style.height&&"0px"!==e.parentElement.style.height||(e.parentElement.style.height="125px"),"none"===e.parentElement.style.display&&(e.parentElement.style.display="")}e?.contentWindow?.postMessage(t,"*"),updateIframeStyle(e),e.addEventListener("load",()=>{e?.contentWindow?.postMessage(t,"*"),updateIframeStyle(e)})})}t?.parentElement?.remove()}}),_integrateManualIfNeeded(),function(){var t=[{integration:"shopify",cookieName:"cart"},{integration:"woocommerce",cookieName:"vidjet_woo_cart_id"},{integration:"wix",cookieName:"vidjet_wix_cart_id"},{integration:"prestashop"}].find(t=>t.integration===e.integration);if(t){let e="prestashop"===t.integration?window.vidjetPreastshopCartId:_getCookie(t.cookieName);"2581441e-2743-4fd6-9c0e-e9f734fb551f"===a&&(e=_getCookie("woocommerce_cart_hash")),"shopify"===t?.integration&&e?.includes("key")&&(e.includes("%3Fkey")?e=e.split("%3Fkey")[0]:e.includes("?key")&&(e=e.split("?key")[0])),e&&e!==_getCookie("vidjet_cart_id")&&(_setCookie("vidjet_cart_id",e,1),_sendEvent("cartCreated"))}}(),l){const{isFullScreen:e}=_decryptParams(l);!e&&_addResizeListener()}}else console.error("Vidjet - No SiteId set in script url")},showCampaign:function(e,t){const o=i.find(t=>t._id==e);if(!o)return console.error(`Invalid campaign id for ${e}`);l=p?o.formats.find(e=>e.deviceType===I):o.formats.find(e=>e.deviceType===x);const{isFullScreen:a}=_decryptParams(l);if(t)_destroyIframe(),u=!1,f=!1,y=!1,_displayIframeBasedOnTrigger(o),!a&&_addResizeListener();else{if(document.querySelectorAll(".vidjet-iframe").length)return console.warn('Campaign already running. To show this video, pass "true" as the second parameter to force show.');u=!1,f=!1,y=!1,_displayIframeBasedOnTrigger(o),!a&&_addResizeListener()}},initSpa:function(){const e=this;let t=location.href;setInterval(function(){t!=location.href&&(console.log("VIDJET: page change detected"),_destroyIframe(),u=!1,f=!1,y=!1,e.init(),t=location.href)},500)},send:function(e,t){return"conversion"===e||"order"===e?_sendEvent(e,t):console.warn(`The '${e}' type is not supported. Please use a valid event type.`)}}}();window.__vidjetClientAppLoaded||(window.__vidjetClientAppLoaded=!0,Vidjet.init(),console.log("VIDJET loaded"));