https://www.osklen.com/_frsh/js/c33a80b927ce0f73d6590843ba6c3d00ee6e0e25/island-promobar_promobar.js
1import{a as E,b as M}from"./chunk-TTLIWBSM.js";import{a as T}from"./chunk-U4AT4GMS.js";import"./chunk-VYZNAVQ6.js";import"./chunk-QESEO7NF.js";import"./chunk-5W4PWPUK.js";import{a as i}from"./chunk-X6IOVEKU.js";import{a as v,b as m}from"./chunk-ZDLMJVT4.js";import"./chunk-6QKRXUVD.js";import"./chunk-Z47A3HLT.js";function R(e,o,n){let t=new Date;t.setTime(t.getTime()+24*60*60*1e3*n),document.cookie=e+"="+o+";path=/;expires="+t.toUTCString()}function P(e){let o=document.cookie.match("(^|;) ?"+e+"=([^;]*)(;|$)");return o?o[2]:null}function C(e){let o=new Date().getTime(),n=new Date(e).getTime(),t=Math.floor((n-o)/1e3);if(t<=0)return{days:0,hours:0,minutes:0,seconds:0,expired:!0};let r=Math.floor(t/86400);t-=r*86400;let s=Math.floor(t/3600);t-=s*3600;let u=Math.floor(t/60);t-=u*60;let d=Math.floor(t);return{days:r,hours:s,minutes:u,seconds:d,expired:!1}}function S(e){if(e.expired)return;let o=String(e.days).padStart(2,"0"),n=String(e.hours).padStart(2,"0"),t=String(e.minutes).padStart(2,"0"),r=String(e.seconds).padStart(2,"0");return`${o}:${n}:${t}:${r}`}var w=["transition-all","duration-100","ease-in-out"],I="top-[calc(1.85rem_+_4px)]",g=()=>globalThis?.window.innerWidth>1024,k=(e,o)=>{e.classList.contains(o[0])||e.classList.add(...o)},D=(e,o,n)=>{let t=document.getElementById("header");if(!t||n!=="custom")return;let r=g();k(t,["relative",...w]),t.classList.remove("top-[62px]","top-[29px]"),e&&!o&&t.classList.add(r?"top-[62px]":"top-[29px]")},O=(e,o,n)=>{if(!g()||n!=="custom")return;let t=document.getElementById("overlay"),r=document.getElementById("searchOverlay");[t,r].forEach(s=>{s&&(s.style.top=e&&!o?"-64px":"0px")})},H=(e,o,n)=>{if(g())return;let t=document.getElementById("mobileMenuContainer");t&&(t.style.top=e&&!o?n==="custom"?"49px":"52px":"20px")},$=(e,o,n)=>{let t=document.getElementById("logo");if(!t)return;k(t,w);let r=n==="custom"&&g()?"top-[55px]":"top-[34px]";t.classList.remove("top-[55px]","top-[34px]",I,"translate-y-full"),e&&!o?t.classList.add(r,"translate-y-full"):t.classList.add(I)},A=(e,o,n)=>{let t=document.getElementsByClassName("offerpopup")[0];if(!t)return;k(t,w);let r=g(),s;r?s=e&&!o?n==="custom"?"163px":"143px":n==="custom"?"100px":"101px":e&&!o?s=n==="custom"?"102px":"113px":s=o?"73px":n==="custom"?"102px":"113px",t.style.top=s},U=(e,o)=>{let n=document.getElementsByClassName("offerpopup-button")[0];if(!n)return;let t=g();(t&&o||!t&&(e||o))&&(n.style.top="0")},Y=(e,o,n)=>{D(e,o,n),O(e,o,n),H(e,o,n),$(e,o,n),A(e,o,n),U(e,o)},B=({timer:e,campaignName:o,disableTimer:n=!1,layout:t,displayCartValue:r,isActive:s=!1})=>{let[u,d]=v(!0),[l,p]=v(!1),[f,c]=v(!1),[y,L]=v(!n&&e?C(e):null),x="promobar-last-closed",b=o.replace(/<[^>]*>|[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase();if(!s)return{isChecking:!1,isVisible:!1,isScrolled:!1,timeRemaining:null,handleClose:()=>{}};if(e&&!n){let a=C(e);if(a.expired)return{isChecking:!1,isVisible:!1,isScrolled:!1,timeRemaining:a,handleClose:()=>{}}}return m(()=>{let a=P(x);(!a||a!==b)&&p(!0),d(!1)},[o,x,b]),m(()=>{if(r)p(!1);else{let a=P(x);(!a||a!==b)&&p(!0)}},[r,x,b]),m(()=>{Y(l,f,t)},[l,f,t]),m(()=>{if(!l||n||!e)return;let a=setInterval(()=>{let h=C(e);L(h),h.expired&&(clearInterval(a),p(!1))},1e3);return()=>clearInterval(a)},[e,l,n]),m(()=>{if(!l)return;let a=()=>{let h=globalThis?.window.pageYOffset||globalThis?.window.scrollY;h<=0?c(!1):h>20&&c(!0)};return globalThis?.window.addEventListener("scroll",a),()=>globalThis?.window.removeEventListener("scroll",a)},[l]),{isChecking:u,isVisible:l,isScrolled:f,timeRemaining:y,handleClose:()=>{if(l)try{R(x,b,365),p(!1)}catch(a){console.error("Error setting promobar cookie:",a),p(!1)}}}};var N=({backgroundColor:e="#222222",textColor:o="#F8F8F8",timer:n,campaignName:t,campaignLink:r,layout:s="default",isActive:u=!1,disableTimer:d=!1})=>{if(!u)return null;let{displayCart:l}=T(),{isChecking:p,isVisible:f,isScrolled:c,timeRemaining:y,handleClose:L}=B({timer:n,campaignName:t,disableTimer:d,layout:s,displayCartValue:l.value,isActive:u});return p||!f?null:i("div",{id:"promobar",class:`${s} ${s==="custom"?"transition-transform duration-300 ease-in-out w-full h-[30px] lg:h-[82px] flex justify-center items-center px-[6px] xl:px-[15px] xll:px-[30px] pt-2 lg:py-[21px] fixed top-0 left-0 z-[60]":""}`,style:{transform:f||c?"translateY(0)":"translateY(-100%)",visibility:c?"hidden":"visible",display:c?"none":"flex"},children:i("div",{class:`w-full h-[30px] justify-center items-center px-2 py-4 lg:p-4 relative top-0 left-0 z-50 transition-transform duration-300 ease-in-out backdrop-blur-[20px] ${s==="custom"?"rounded-xl":""}`,style:{backgroundColor:e,color:o,transform:c?"translateY(-100%)":"translateY(0)",visibility:c?"hidden":"visible",display:c?"none":"flex"},children:[i("div",{class:"font-suisse font-normal leading-extra-2 -tracking-0.02 flex flex-1 justify-center items-center gap-[4px]",children:[!d&&n&&y&&i("div",{class:"flex items-center w-[90px]",children:i("span",{class:"text-[15.83px] inline-block text-center",style:{color:o},children:S(y)})}),i("a",{href:r,class:"flex items-center cursor-pointer hover:opacity-80 transition-opacity gap-2.5",children:i(E,{html:M(t),class:"font-normal leading-extra-2 -tracking-0.02"})})]}),i("button",{onClick:L,class:`absolute right-0 ${s==="custom"?"right-0":"lg:right-4"} p-2 hover:opacity-75 rounded-full transition-opacity flex items-center`,"aria-label":"fechar promo bar",children:i("span",{class:"mr-1 font-suisse font-normal text-[15.83px] leading-extra-2 -tracking-0.02",children:i("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i("rect",{x:"0.5",y:"0.5",width:"19",height:"19",rx:"9.5",stroke:"#EDEDED"}),i("path",{d:"M13.3127 12.3447L12.3451 13.3123L9.94201 10.9092L7.53891 13.3123L6.62446 12.3979L9.02756 9.99479L6.68826 7.
165549L7.65588 6.68787L9.99518 9.02717L12.3983 6.62407L13.3127 7.53853L10.9096 9.94163L13.3127 12.3447Z",fill:"#EDEDED"})]})})})]})})},_=N;export{_ as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.