PageSourceSearch

https://www.softzone.es/_nuxt/CbfwyQfH.js

js softzone.es collected 2026-10-02 03:30:02 UTC 3,269 bytes, 1 lines download raw bytes

1import{n as z,a as G,b as $,D as _,p as r,v as H,K,x as U,G as Y,o as i,k as q,d as f,j as p,i as P,e as F,X as W,t as S,T as X,h as J}from"./E10W6L7Z.js";import{f as Q,h as Z}from"./Ba-Sbyt2.js";const ee={key:0,class:"promotional-banner","aria-label":"Promoción"},te={class:"promotional-banner__title"},oe=["href","target","rel"],ae=["src"],ne={key:1,class:"promotional-banner__detail"},x="promotional_banner_dismissed_id",le=300,se=z({__name:"PromotionalBanner",setup(re){const E=new Set(["_self","_blank","_parent","_top"]),L=G("gazConfigData"),{$resolveGazApiEndpoint:C}=$(),u=Q(),a=Z(),o=_(null),y=_(!1),l=_(!1),h=_(!1);let c=!1,v=!1,w=!1,d=!1,b=null;const m=r(()=>{var e;return!!((e=o.value)!=null&&e.id&&o.value.mainText)}),A=r(()=>{var e,t;return((t=(e=o.value)==null?void 0:e.button)==null?void 0:t.icon)||""}),B=r(()=>{var t,n;const e=((n=(t=o.value)==null?void 0:t.button)==null?void 0:n.target)||"_self";return E.has(e)?e:"_self"}),D=r(()=>{var t,n;const e=(((n=(t=o.value)==null?void 0:t.button)==null?void 0:n.rel)||"").split(/\s+/).filter(Boolean);return B.value==="_blank"&&!e.includes("noopener")&&e.push("noopener"),e.join(" ")||void 0}),I=r(()=>y.value&&m.value&&h.value&&!l.value&&u.value==="resolved"),s=()=>{c&&(window.removeEventListener("scroll",g),c=!1)},N=()=>`${C()}/promotions/${L.value.site}`,O=e=>{if(!e||typeof e!="object")return null;const t=e;return"activePromotion"in t&&t.activePromotion||null},j=async()=>{if(!w){w=!0,a.value=!0;try{const e=await fetch(N(),{headers:{Accept:"application/json"},signal:AbortSignal.timeout(3e3)});if(!e.ok)throw new Error(`Unable to fetch active promotion: ${e.status}`);const t=O(await e.json());if(!v)return;if(o.value=t,l.value=!!(t!=null&&t.id&&b===t.id),d=!0,!m.value||l.value){a.value=!1,s();return}a.value=!0}catch{if(!v)return;o.value=null,d=!0,a.value=!1,s()}}},g=()=>{if(window.scrollY<=0){h.value=!1;return}window.scrollY>=le&&(h.value=!0,d||j())},R=()=>{u.value!=="resolved"||l.value||d&&!m.value||(g(),c||(window.addEventListener("scroll",g,{passive:!0}),c=!0))},T=()=>{var t;const e=(t=o.value)==null?void 0:t.id;if(e){l.value=!0,s();try{localStorage.setItem(x,e)}catch{}}},M=()=>{(l.value||!m.value)&&(a.value=!1)};H(()=>{v=!0;try{b=localStorage.getItem(x)}catch{b=null}y.value=!0,a.value=!1,u.value==="resolved"&&R()}),K(u,e=>{if(e==="resolved"){R();return}s()}),U(()=>{v=!1,a.value=!1,s()});const V=()=>T();return(e,t)=>{const n=W;return i(),Y(X,{name:"promotional-banner",onAfterLeave:M},{default:q(()=>{var k;return[I.value&&o.value?(i(),f("aside",ee,[P("button",{class:"promotional-banner__close",type:"button","aria-label":"Cerrar promoción",onClick:V},[F(n,{class:"promotional-banner__close-icon"})]),P("p",te,S(o.value.mainText),1),(k=o.value.button)!=null&&k.url&&o.value.button.text?(i(),f("a",{key:0,class:"promotional-banner__cta",href:o.value.button.url,target:B.value,rel:D.value,onClick:T},[A.value?(i(),f("img",{key:0,class:"promotional-banner__icon",src:A.value,alt:"",width:"30",height:"30",loading:"lazy",decoding:"async"},null,8,ae)):p("",!0),P("span",null,S(o.value.button.text),1)],8,oe)):p("",!0),o.value.secondaryText?(i(),f("p",ne,S(o.value.secondaryText),1)):p("",!0)])):p("",!0)]}),_:1})}}}),ce=J(se,[["__scopeId","data-v-32358c50"]]);export{ce 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.