1"use strict";(self.webpackChunkgazzanet_symfony=self.webpackChunkgazzanet_symfony||[]).push([[5075],{15075:function(e,t,s){var i=s(52891),n=s(52752),o=s(85937),a=s(47455),r=s(55821),h=s(1853),l=s(19987),c=s(51405),d=s(23782);const p=(0,c.h)("adv","revive");class m extends i.xI{constructor(){super(...arguments),this.zoneId=null,this.isInitialized=!1,this.isInitLoopRunning=!1,this.gaveUp=!1,this.consentDenied=!1,this.hasAppeared=!1,this.unsubscribeFromBus=[],this.onSignal=()=>{this.consentDenied=!1,this.kickInitLoop()},this.onConsentError=e=>{"consent-denied"===e?.reason&&(this.consentDenied=!0,p.warn(`[Revive] Consenso negato per lo slot: ${this.slotValue}`))}}connect(){if(p.info(`Controller Revive connesso per slot: ${this.slotValue}`),!this.matchesViewport())return p.info(`Dispositivo non corrispondente per ${this.slotValue}. Rimuovo il widget.`),this.gaveUp=!0,void this.element.remove();const e=(0,l.lf)("revive.slots",{});if(this.zoneId=e[this.slotValue]||null,!this.zoneId)return p.warn(`Nessun mapping (zoneId) trovato per lo slot '${this.slotValue}' nel file di configurazione del sito. Mi spengo.`),this.gaveUp=!0,void this.element.remove();this.unsubscribeFromBus=[(0,d.HS)("adv:ready",this.onSignal),(0,d.HS)("adv:error",this.onConsentError)],(0,n.v1)(this,{rootMargin:"800px 0px",threshold:0})}disconnect(){this.unsubscribeFromBus.forEach(e=>e()),this.unsubscribeFromBus=[],this.gaveUp=!0}appear(e){this.hasAppeared||(p.info(`[Revive] Banner ${this.slotValue} entrato nel viewport. Innesco fetch.`),this.hasAppeared=!0,this.kickInitLoop())}matchesViewport(){const e=this.hasIsMobileValue&&this.isMobileValue,t=this.hasIsDesktopValue&&this.isDesktopValue;if(!e&&!t)return!0;const s=window.matchMedia("(min-width: 768px)").matches;return e&&!t?!s:!(t&&!e)||s}kickInitLoop(){!this.hasAppeared||this.gaveUp||this.consentDenied||this.isInitialized||this.isInitLoopRunning||(this.isInitLoopRunning=!0,(0,o.f)(()=>{if(this.tryFetchAndRender())return!0;throw new Error("Attesa consenso o dati di pagina per Revive...")},{startingDelay:120,timeMultiple:1.7,maxDelay:2e3,numOfAttempts:Number.POSITIVE_INFINITY,retry:()=>!this.gaveUp&&!this.consentDenied&&!this.isInitialized,jitter:.2}).catch(e=>{this.isInitLoopRunning=!1,this.gaveUp||this.consentDenied||this.isInitialized||p.warn(`[Revive] Back Off terminato per ${this.slotValue}`,e)}))}hasAdvertisingConsent(){const e=r.s.get();if(!e)return!1;const t=(0,a.zY)(e,a.nb.StorageAndAccess),s=(0,a.zY)(e,a.nb.PersonalisedProfile),i=(0,a.zY)(e,a.nb.PersonalisedAds);return t&&(s||i)}tryFetchAndRender(){if(!this.hasAdvertisingConsent())return!1;const e=(0,h.K)().revive;return e&&!1!==e.enabled&&e.baseUrl?(this.isInitialized=!0,this.loadBanner(e),!0):(p.info("Revive disabilitato globalmente o mancano i parametri base nel page-data."),this.gaveUp=!0,this.element.remove(),!0)}async loadBanner(e){try{const t=new URL(e.baseUrl);t.searchParams.set("charset",e.charset??"UTF-8"),t.searchParams.set("loc",window.location.href),t.searchParams.set("block",String(e.block??1)),t.searchParams.set("referrer",e.referrer??document.referrer??""),t.searchParams.set("nz",String(e.nz??1)),t.searchParams.set("prefix",e.prefix??""),t.searchParams.set("zones",String(this.zoneId)),t.searchParams.set("logastatus",String(e.logastatus??!1)),t.searchParams.set("device",this.isDesktopValue?"desktop":"mobile"),t.searchParams.set("sezione",e.sezione??"home"),t.searchParams.set("sottosezione",e.sottosezione??"default"),t.searchParams.set("tipologia",e.tipologia??"home"),t.searchParams.set("ksegs",null===e.ksegs?"null":e.ksegs),p.info(`Fetch Revive [${this.slotValue}] (Zone: ${this.zoneId}):`,t.toString());const s=await fetch(t.toString(),{method:"GET",credentials:"include"});if(!s.ok)throw new Error(`HTTP ${s.status}`);const i=await s.json();if(i&&i[0]){const e=i[0];if(0===Number(e.width)&&0===Number(e.height))return p.info(`Nessun banner erogato (no-fill) per ${this.slotValue}. Collasso il buco.`),this.element.className=this.element.className.replace(/\bmin-h-[^\s]+\b/g,""),this.element.style.minHeight="0px",void(this.element.style.display="none");this.element.innerHTML=e.html,e.width&&e.height&&(this.element.className=this.element.className.replace(/\bmin-h-[^\s]+\b/g,""),this.element.style.setProperty("height",`${e.height}px`,"important"),this.element.style.setProperty("max-width","100%","important")),p.info(`Banner iniettato per ${this.slotValue} con dimensioni: ${e.width}x${e.height}`)}}catch(e){p.error(`Errore durante il recupero del banner Revive [${this.slotValue}]`,e),this.element.className=this.element.className.replace(/\bmin-h-[^\s]+\b/g,""),this.element.style.display="none"}}}m.values={slot:String,isMobile:{type:Boolean,default:!1},isDesktop:{type:Boolean,default:!1}},t.default=m}}]); 2//# sourceMappingURL=5075.3b3aeb40.js.map
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.