1"use strict";(globalThis.webpackChunktopicc2a=globalThis.webpackChunktopicc2a||[]).push([[325,445,901],{910(t,e,a){function i(t,e,a){t.preventDefault(),e.checked=!e.checked,a.setAttribute("aria-checked",e.checked?"true":"false"),e.dispatchEvent(new Event("change",{bubbles:!0}))}a.d(e,["o",0,(t,e)=>{if(!t)return;const a=t.jquery?t[0]:t;if(!a||"function"!=typeof a.querySelector)return;const s=a.querySelector(".hs-form-booleancheckbox span"),o=a.querySelector(".hs-form-booleancheckbox input[type='checkbox']"),n="popup"===e?"boolean-accessible-popup":"boolean-accessible-iframe";if(!s||!o)return;const r=document.createElement("div");r.classList.add("boolean-accessible",n),r.setAttribute("tabindex",0),r.setAttribute("role","checkbox"),r.setAttribute("aria-checked",o.checked?"true":"false"),s.insertBefore(r,s.firstChild),r.addEventListener("keydown",function(t){" "===t.key&&i(t,o,r)}),r.addEventListener("click",function(t){i(t,o,r)})}])},597(t,e,a){var i=a(723);let s;const o=[],n=()=>{if(s=document.querySelectorAll(".topic-c2a__countdown:not([data-timestamp-trigger])"),s)for(let t=s.length-1;t>=0;t--)s[t].dataset.timestampTrigger=!0,o.push(setInterval(r,1e3,s[t]))},r=t=>{const e=parseInt(t.dataset.timestamp,10)-(new Date).getTime(),a=Math.floor(e/864e5),s=Math.floor(e%864e5/36e5),o=Math.floor(e%36e5/6e4),n=Math.floor(e%6e4/1e3),r=(0,i.__)("Inizia tra","topic-c2a");if(e>0)t.innerHTML='<span class="countdown__text">'+r+'</span> <div class="gio date-time-counter">'+a+'</div><div class="ore date-time-counter">'+s+'</div><div class="min date-time-counter">'+o+'</div><div class="sec date-time-counter">'+n+'</div><div class="clearfix"></div>';else{t.innerHTML="";const e=t.dataset.engagementPhrase;e&&(t.innerHTML=`<span class="frase-ingaggio">${e}</span>`,t.classList.remove("topic-c2a__countdown"),t.classList.add("engagement-phrase"))}};a.d(e,["A",0,()=>{document.addEventListener("topicc2a-start-timers",n),n()}])},482(t,e,a){var i=a(910);let s,o;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){let e=this;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null});const n=(t,e,a,i=document)=>{i.addEventListener(e,function(e){let s,o=e.target||e.srcElement;for(;o&&o.matches&&o!==i&&!(s=o.matches(t));)o=o.parentElement;s&&a.call(o,e)})},r=t=>t.attributes&&t.attributes.hubspot_list_id&&window.isHubspotListDataSource?`hubspot_list_${t.attributes.hubspot_list_id.value}`:window.isCompanyDataSource?`ip2company[${window.SSb2binfo}]`:t.attributes&&t.attributes.idTopic&&"T_JOLLY"!==t.attributes.idTopic.value?"topic":"jolly",c=t=>{let e=0;const a=setInterval(function(){"undefined"!=typeof hbspt&&null!==hbspt?(clearInterval(a),hbspt.forms.create(t)):(e++,e>=5&&clearInterval(a))},2e3)},l=function(t){const{title:e="",type:a="",ctaType:i="",idCta:s="",layout:o="",hbFormId:n="",ruleSelected:r="",ruleValue:c="",targetcta:l=""}=t;if(window.dataLayer=window.dataLayer||[],"popupSelected"===a)return void window.dataLayer.push({title:e,eventType:"popupSelected",event:"pushPopup",idCta:s,layout:o,ruleSelected:r,ruleValue:c});"frame_clicks"!==a&&"frame_views"!==a||window.dataLayer.push({event:"frame_clicks"===a?"iframeHubspot_clicks":"iframeHubspot_views",frame_title:e,[a]:"frame_clicks"===a?"frame_clicked":"frame_viewed"});const d={frame_clicks:{iframe:"newsClicked",popup:"popupClicked"},frame_views:{iframe:"newsViewed",popup:"popupViewed"},form_submitted:{iframe:"iframeSubmitted",popup:"popupSubmitted"}}[a][i];if(!d)return;const u={title:e,eventType:d,event:"iframe"===i?"pushiFrame":"pushPopup",idCta:s,layout:o,hbFormId:n};"form_submitted"!==a&&"frame_views"!==a||(u.targetcta=l),window.dataLayer.push(u)},d=function(){let t;const e=document.querySelectorAll("cta-form");e.length>0&&(s=new IntersectionObserver((e,a)=>{e.forEach(e=>{e.isIntersecting&&(a.unobserve(e.target),t={title:e.target.attributes?.title?.value,idCta:e.target.attributes?.idcta?.value,layout:e.target.attributes?.layout?.value,hbFormId:e.target.attributes?.hb_form_id?.value,type:"frame_views",ctaType:e.target.attributes?.ctatype?.value,targetcta:r(e.target)},l(t))})},{threshold:.5}),o=new MutationObserver((t,e)=>{t.forEach(t=>{"childList"===t.type&&t.target.id.includes("hb_form")&&(t=>{const e=t.target,a=e.querySelector('input[name="idcta"]'),i=e.querySelector('input[name="layoutcta"]'),s=t.target.parentNode.parentNode,o=s.attributes.idcta??s.attributes.id,n=s.attributes.layout,c=e.querySelector('input[name="targetcta"]');
1a&&o&&(a.value=o.value),i&&n&&(i.value=n.value),c&&(c.value=r(s))})(t)})}),e.forEach(t=>{s.observe(t),t.dataset.observed="true",o.observe(t,{attributes:!0,childList:!0,subtree:!0})}))},u=t=>{const{cta:e}=t?.detail;e&&(((t,e)=>{for(let a=t.length-1;a>=0;a--){const s={portalId:t[a].dataset.portalid,formId:t[a].dataset.formid,formInstanceId:t[a].dataset.forminstanceid,target:t[a].dataset.target,onFormReady:t=>{(0,i.o)(t,"iframe")},onFormSubmitted:()=>{l({title:e.attributes.title.value,ctaType:e.attributes.ctatype.value,idCta:e.attributes.idcta.value,layout:e.attributes.layout.value,hbFormId:t[a].dataset.formid,type:"form_submitted",targetcta:r(e)})}};"false"!==t[a].dataset.sfdcampaignid&&(s.sfdcCampaignId=t[a].dataset.sfdcampaignid),c(s),t[a].dataset.enabled=!0}})(e.querySelectorAll(".hb-form-wrapper[data-enabled=false]"),e),s&&o?document.querySelectorAll("cta-form:not([data-observed='true'])").forEach(t=>{s.observe(t),t.dataset.observed="true",o.observe(t,{attributes:!0,childList:!0,subtree:!0})}):d())},p=function(t){t.preventDefault();const e=this.parentNode,a=e.querySelector(".hb-form-wrapper"),i=e.shadowRoot.querySelector(".cta-footer");a&&i&&(a.classList.remove("cstm-hide"),i.classList.add("cstm-hide"))},h=function(t){const e=t.target.closest("cta-form");if(!e.attributes)return;const a={title:e.attributes.title?.value,idCta:e.attributes.idcta?.value,layout:e.attributes.layout?.value,hbFormId:e.attributes.hb_form_id?.value,type:"frame_clicks",ctaType:e.attributes.ctatype?.value};l(a)},m=function(t){const e=t.target.closest(".c2a-box"),a={title:e.querySelector(".c2a-box__title")?.innerText,idCta:e.attributes.idcta?.value,layout:e.attributes.layout?.value,hbFormId:e.attributes.hb_form_id?.value,type:"frame_clicks"};l(a)};a.d(e,["Ay",0,()=>{n(".cta-btn[href='']","click",p),n("cta-form .actions input[type='submit']","click",h),n("cta-form a[target='_blank'][href]","click",h),n(".c2a-box a[target='_blank'][href]","click",m),document.addEventListener("topicc2a-trigger-hb-creation",u),d()},"UZ",0,l,"VD",0,n,"bI",0,t=>{const e=t.target.closest(".swal2-html-container"),a=e.querySelector(".hb-form-wrapper"),i={title:e.querySelector("div[slot='title']")?.innerText,idCta:e.attributes.idcta?.value,layout:e.attributes.layoutCta?.value,hbFormId:a?.dataset?.formid??"external",type:"frame_clicks",ctaType:"popup"};l(i)}])},901(t,e,a){a.d(e,{default:()=>q});var i=a(234);const s=async(t,e)=>{t=(0,i.SF)()+"_"+t;const a=await o(e);if(a)return a[0].data;const s=await fetch(`${TopicC2A.endpoint}/list/${e}/${t}`).then(t=>t.json()).catch(t=>{console.error(t)});return s?.response?s.response:(t=>{if(!t.length)return;const e={data:{T_JOLLY:[]},version:2},a={data:{T_JOLLY:[]},version:2},i={T_JOLLY:[]};for(const i of t)i.isFallback?e.data.T_JOLLY=i.data.T_JOLLY:a.data.T_JOLLY=i.data.T_JOLLY;return a.data.T_JOLLY.length||e.data.T_JOLLY.length?a.data.T_JOLLY.length?e.data.T_JOLLY.length?(a.data.T_JOLLY=((t,e)=>{const a=e[e.length-1].end;let i=t;return e.map(e=>{const s=Math.round(t*e.value.peso/a*100)/100;return e.value.peso=s,e.start=i,e.end=e.start+e.value.peso,i=e.end,e})})(e.data.T_JOLLY[e.data.T_JOLLY.length-1].end,a.data.T_JOLLY),i.T_JOLLY=e.data.T_JOLLY.concat(a.data.T_JOLLY),i):a.data:e.data:{}})(s?.responses)},o=async t=>{const e=(0,i.Ri)("hubspotutk"),a=TopicC2A.endpoint;if(!a)return null;if(window.isHubspotListDataSource=!1,window.isCompanyDataSource=!1,e){const i=new URLSearchParams({utk:e,ctaType:t}),s=localStorage.getItem("hs_profile_email");s&&i.append("email",s);try{const t=await fetch(`${a}/user/?${i.toString()}`),e=await t.json();if(e?.response&&e.response[0]?.data.USER.length>0)return window.isHubspotListDataSource=!0,e.response}catch(t){console.error(`Error fetching profiled CTA Hubspot list: ${t}`)}}if(window.SSb2binfo&&"noCompany"!==window.SSb2binfo){const e=new URLSearchParams({ctaType:t,piva:window.SSb2binfo});try{const t=await fetch(`${a}/company/cta?${e.toString()}`),i=await t.json();if(i&&i[0]?.data.COMPANY.length>0)return window.isCompanyDataSource=!0,i}catch(t){console.error(`Error fetching profiled CTA Company: ${t}`)}}return null},n=(t,e)=>{if(!e.length)return[];if(t>=e.length)return e.map(t=>t.value);const a=e.slice(),i=[],s=t=>{let e=0;for(const a of t){const t=parseFloat(a.value.peso)||1;a.start=e,a.end=e+t,e=a.end}return e};for(;i.length<t&&a.length>0;){const t=s(a),e=Math.floor(Math.random()*t),o=a.findIndex(t=>e>=t.start&&e<t.end);-1!==o&&(i.push(a[o].value),a.splice(o,1))}return i};var r=a(723);const c=[{key:"WHITEPAPER",name:(0,r.__)("WHITEPAPER","topic-c2a"),icon:"assets/images/book.svg",frase_ingaggio:(0,r.__)("Scarica subito","topic-c2a"),testo_pulsante:(0,r.__)("Scarica il Whitepaper","to
1pic-c2a")},{key:"INFOGRAFICA",name:(0,r.__)("INFOGRAFICA","topic-c2a"),icon:"assets/images/book.svg",frase_ingaggio:(0,r.__)("Scarica subito","topic-c2a"),testo_pulsante:(0,r.__)("Scarica l'Infografica","topic-c2a")},{key:"EVENTO",name:(0,r.__)("EVENTO","topic-c2a"),icon:"assets/images/event.svg",frase_ingaggio:"",testo_pulsante:(0,r.__)("Iscriviti all'Evento","topic-c2a")},{key:"WEBINAR",name:(0,r.__)("WEBINAR","topic-c2a"),icon:"assets/images/video.svg",frase_ingaggio:"",testo_pulsante:(0,r.__)("Iscriviti al Webinar","topic-c2a")},{key:"WEBCAST",name:(0,r.__)("WEBCAST","topic-c2a"),icon:"assets/images/video.svg",frase_ingaggio:(0,r.__)("Non sei riuscito a seguire il Webinar?","topic-c2a"),testo_pulsante:(0,r.__)("Guarda il Webcast","topic-c2a")},{key:"NEWSLETTER",name:(0,r.__)("NEWSLETTER","topic-c2a"),icon:"assets/images/email.svg",frase_ingaggio:(0,r.__)("Rimani aggiornato!","topic-c2a"),testo_pulsante:(0,r.__)("Iscriviti alla Newsletter","topic-c2a")},{key:"ALTRO",name:(0,r.__)("ALTRO","topic-c2a"),icon:"assets/images/star.svg",frase_ingaggio:"",testo_pulsante:(0,r.__)("SCARICA ORA","topic-c2a")},{key:"AUTOPROMO",name:(0,r.__)("AUTOPROMO","topic-c2a"),icon:"assets/images/star.svg",frase_ingaggio:"",testo_pulsante:(0,r.__)("SCARICA ORA","topic-c2a")},{key:"LG BOOST",name:(0,r.__)("LG BOOST","topic-c2a"),icon:"assets/images/star.svg",frase_ingaggio:"",testo_pulsante:(0,r.__)("SCARICA ORA","topic-c2a")},{key:"SURVEY",name:(0,r.__)("SURVEY","topic-c2a"),icon:"assets/images/poll.svg",frase_ingaggio:"",testo_pulsante:(0,r.__)("INVIA","topic-c2a")}],l='<svg xmlns="http://www.w3.org/2000/svg" width="22" height="17" viewBox="0 0 22 17"><path d="M13,12h7v1.5H13m0-4h7V11H13m0,3.5h7V16H13M21,4H3A2,2,0,0,0,1,6V19a2,2,0,0,0,2,2H21a2,2,0,0,0,2-2V6a2,2,0,0,0-2-2m0,15H12V6h9" transform="translate(-1 -4)"/></svg>',d='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M21,3H3A1.993,1.993,0,0,0,1,5V17a2,2,0,0,0,2,2H8v2h8V19h5a2,2,0,0,0,1.99-2L23,5A2,2,0,0,0,21,3Zm0,14H3V5H21Zm-5-6L9,15V7Z"/></svg>',u='<svg xmlns="http://www.w3.org/2000/svg" width="22.288" height="21.197" viewBox="0 0 22.288 21.197"><g transform="translate(0 -1.84)">
1<path d="M14.588,8.818,11.144,1.84,7.7,8.818,0,9.937l5.572,5.431L4.256,23.037l6.888-3.621,6.888,3.621-1.316-7.669,5.572-5.431Z"/></g></svg>';class p extends HTMLElement{constructor(){super(),this.iconMap={WHITEPAPER:l,INFOGRAFICA:l,EVENTO:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17,12H12v5h5ZM16,1V3H8V1H6V3H5A1.991,1.991,0,0,0,3.01,5L3,19a2,2,0,0,0,2,2H19a2.006,2.006,0,0,0,2-2V5a2.006,2.006,0,0,0-2-2H18V1Zm3,18H5V8H19Z"/></svg>',WEBINAR:d,WEBCAST:d,NEWSLETTER:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M22,6a2.006,2.006,0,0,0-2-2H4A2.006,2.006,0,0,0,2,6V18a2.006,2.006,0,0,0,2,2H20a2.006,2.006,0,0,0,2-2ZM20,6l-8,5L4,6Zm0,12H4V8l8,5,8-5Z"/></svg>',ALTRO:u,AUTOPROMO:u,"LG BOOST":u,SURVEY:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#5f6368"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 10h2v7H7zm4-3h2v10h-2zm4 6h2v4h-2z"/></svg>'};const t=document.getElementById("cta-template").content;this.attachShadow({mode:"open"}).appendChild(t.cloneNode(!0))}createSlot(t,e,a=null){const i=document.createElement(t);return i.slot=e,i.innerHTML=a,i}createTypeOfService(t,e){const a=`${e}<span>${t}</span>`,i=this.createSlot("div","typeofservice",a);return i.classList.add("cta-tipo-servizio","cstm-is-flex","cstm-center-align"),i}createImage(t){const e=this.createSlot("div","image",null);return e.classList.add("responsive-bg"),e.style.backgroundImage=`url("${t}")`,e}createCtaBtn(t,e){const a=this.createSlot("a","cta-button",t);return a.classList.add("cta-btn"),a.target="_blank",a.href=e,a}createCountdown(t){const e=this.createSlot("div","countdown");e.classList.add("topic-c2a__countdown"),e.dataset.timestamp=t;const a=this.getAttribute("engagement_phrase");return a&&(e.dataset.engagementPhrase=a),e}createEventInfo(t,e){const a=this.createSlot("div","event-info");a.classList.add("event-info-container"); 2/* translators: preposizione prima dell'orario (es. "alle 12:30") */ 3const i=(0,r.__)("alle","topic-c2a");let s="";if(e){const a=new Date(e),o=a.toLocaleDateString("it-IT",{day:"numeric",month:"short",year:"numeric"}),n=a.toLocaleTimeString("it-IT",{hour:"2-digit",minute:"2-digit"});s=t?`${t} - ${o} ${i} ${n}`:`${o} ${i} ${n}`}return a.innerHTML=s,a}createUniqId(){return Date.now().toString(36)+Math.random().toString(36).substring(2)}createTopics(t=[]){const e=this.createSlot("div","topics");e.classList.add("cta-topics-wrapper");const a=(t.length?t.split(",").slice(0,2):[]).map(t=>{const e=t.split("#").pop(),a=document.createElement("div");return a.classList.add("cta-topic","cstm-left","cstm-is-flex","cstm-valign-wrapper","cstm-center-align"),a.innerHTML=`\n <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><style>.a{fill:#0097b5;}</style></defs><path class="a" d="M3,5A2,2,0,0,1,5,3H19a2,2,0,0,1,2,2V19a2,2,0,0,1-2,2H5a2,2,0,0,1-2-2V5M7,18H9l.35-2h4L13,18h2l.35-2h2l.36-2h-2l.7-4h2l.35-2h-2l.36-2h-2l-.36,2h-4l.36-2h-2L8.76,8h-2l-.35,2h2l-.7,4h-2l-.36,2h2L7,18m3.41-8h4l-.7,4h-4Z" transform="translate(-3 -3)"/></svg>
3\n <span>${e}</span>\n `,a});return e.append(...a),e}createHbFormSlot(t){const e=this.createUniqId(),a=`hb_form_target_${e}`,i=`<div className="hbspt-form" id="${a}"></div>`,s=this.createSlot("div","hb_form",i);return s.classList.add("hb-form-wrapper"),s.dataset.enabled=!1,s.dataset.portalid=hs_config||!1,s.dataset.formid=t.formId,s.dataset.target=`#${a}`,s.dataset.forminstanceid=e,s.dataset.sfdcampaignid=t.sfdcCampaignId||!1,s}createHiddenFormSlot(t,e,a){const i=this.querySelector(".hb-form-wrapper"),s=t.testo_pulsante,o=this.createCtaBtn(s,""),n=["EVENTO","WEBINAR"].includes(t.key)?this.createCountdownOrEngagement():this.createEngagementPhrase();this.shadowRoot.querySelector(".cta-footer").classList.remove("cstm-hide"),i.classList.add("cstm-hide"),n&&(a.appendChild(n),this.appendChild(n)),a.appendChild(o),this.appendChild(o)}createEngagementPhrase(){const t=this.getAttribute("engagement_phrase");return t?this.createSlot("span","frase-ingaggio",t):null}createCountdownOrEngagement(){const t=this.getAttribute("event_date");if(!t)return this.createEngagementPhrase();const e=new Date(t).getTime(),a=(new Date).getTime();return e&&!isNaN(e)&&e>a?this.createCountdown(e):this.createEngagementPhrase()}manageCtaType(t,e){const a=this.getAttribute("title_custom_type");return e?a??"WHITEPAPER":a??t}connectedCallback(){const t=document.createDocumentFragment(),e=c.find(t=>t.key===this.getAttribute("type"));if(!e)return void console.error(`Nessun ctaType trovato: ${this.getAttribute("type")}`);const a=e.key,i=e.name,s=this.iconMap[a],o=e.testo_pulsante,n=this.getAttribute("testo_pulsante"),r=this.getAttribute("form_type"),l=["ALTRO","AUTOPROMO","LG BOOST"].includes(a),d=this.manageCtaType(i,l),u=this.createTypeOfService(d,s);if(t.appendChild(u),["EVENTO","WEBINAR"].includes(a)){const e="EVENTO"===a?this.getAttribute("event_location"):null,i=this.getAttribute("event_date");if(i){const a=this.createEventInfo(e,i);t.appendChild(a)}}const p=this.createSlot("p","title",this.getAttribute("title"));if(t.appendChild(p),this.getAttribute("show_topics")){const e=this.createTopics(this.attributes.topic_names.value);t.appendChild(e)}if(this.getAttribute("image")){const e=this.createImage(this.getAttribute("image"));t.appendChild(e)}if("form_hubspot"!==r){const e=["EVENTO","WEBINAR"].includes(a)?this.createCountdownOrEngagement():this.createEngagementPhrase();e&&t.appendChild(e);const i=this.createCtaBtn(n||o,this.getAttribute("external_link"));t.appendChild(i),this.shadowRoot.querySelector(".cta-footer.cstm-hide").classList.remove("cstm-hide")}if("form_hubspot"===r){const e={formId:this.attributes.hb_form_id.value,sfdcCampaignId:this.attributes.sf_campaign_id.value},a=this.createHbFormSlot(e);t.appendChild(a)}this.appendChild(t),"false"===this.getAttribute("expanded_form")&&"form_hubspot"===r&&this.createHiddenFormSlot(e,l,t),document.dispatchEvent(new Event("topicc2a-start-timers")),"form_hubspot"===r&&document.dispatchEvent(new CustomEvent("topicc2a-trigger-hb-creation",{detail:{cta:this}}))}}const h=p;var m=a(482),f=a(427),g=a(597);class b{constructor(){this.scrollCallbacks=[],this.timeCallbacks=[],this.exitCallbacks=[],this.idleTimeout=null,this.idleThresholds=new Map,this.idleElapsedSeconds=0,this.scrollThresholds=new Map,this.initialWindowHeight=document.documentElement.scrollHeight-window.innerHeight,this.lastScrollTop=window.scrollY||document.documentElement.scrollTop,this.setupScrollListener(),this.setupIdleListener(),this.setupExitListener()}isMobile(){return window.matchMedia("only screen and (max-width: 997px)").matches}onScroll(t,e){this.scrollThresholds.has(t)||this.scrollThresholds.set(t,[]),this.scrollThresholds.get(t).push(e)}afterSeconds(t,e){setTimeout(e,1e3*t),this.timeCallbacks.push({seconds:t,callback:e})}onExit(t){this.exitCallbacks.push(t)}onIdle(t,e){this.idleThresholds.has(t)||this.idleThresholds.set(t,[]),this.idleThresholds.get(t).push(e)}scrollHandler=()=>{const t=window.scrollY/this.initialWindowHeight*100;this.scrollThresholds.forEach((e,a)=>{t>=a&&(e.forEach(e=>e(t)),this.scrollThresholds.delete(a),window.removeEventListener("scroll",this.scrollHandler))})};setupScrollListener(){window.addEventListener("scroll",this.scrollHandler)}mobileExitIntent=()=>{let t=!1;t||(window.requestAnimationFrame(()=>{const e=window.scrollY||document.documentElement.scrollTop;this.lastScrollTop-e>10&&(this.exitCallbacks.forEach(t=>t()),this.exitCallbacks=[],window.removeEventListener("scroll",this.mobileExitIntent)),this.lastScrollTop=e,t=!1}),t=!0)};setupExitListener(){this.isMobile()?window.addEventListener("scroll",this.mobileExitIntent):window.addEventListener("mouseout",t=>
3{t.clientY<=0&&(this.exitCallbacks.forEach(t=>t()),this.exitCallbacks=[])})}setupIdleListener(){document.addEventListener("DOMContentLoaded",()=>{const t=()=>{this.idleElapsedSeconds++,this.idleThresholds.forEach((t,e)=>{this.idleElapsedSeconds>=e&&(t.forEach(t=>t()),this.idleThresholds.delete(e))}),this.idleThresholds.size>0&&(this.idleTimeout=setTimeout(t,1e3))},e=()=>{clearTimeout(this.idleTimeout),this.idleElapsedSeconds=0,this.idleThresholds.size>0&&(this.idleTimeout=setTimeout(t,1e3))};["mousemove","keydown","scroll","touchstart"].forEach(t=>{window.addEventListener(t,e)}),e()})}}var _=a(465),v=a.n(_),y=a(910),w=a(418);const T=(t,e=null)=>{if(!t)return;let a=null===e?document.querySelectorAll(".wp-block-group.body-text")[0]:e;if("undefined"!=typeof cta_preview&&(0,i.iR)()&&(a=document.querySelector("main .container")),!a)return;const s=a.querySelectorAll("h2, h3, h4");let o=null,n=!0;for(const t of s){if(!o&&"P"===t.nextElementSibling.tagName){o=t.nextElementSibling;break}if(!o&&!n&&"P"===t.previousElementSibling.tagName){o=t.previousElementSibling;break}n=!1}o&&t[0]&&o.after(t[0]);const r=a.querySelectorAll("& > p");if(r&&r.length>=20&&t[1]){const e=a.querySelector(".auto-inserted-accordion");if(e)return void e.after(t[1]);r[r.length-1].after(t[1])}},S=t=>{const e=document.createElement("cta-form");if(Object.keys(t).forEach(a=>{"object"!=typeof t[a]||null===t[a]?e.setAttribute(a.toLowerCase(),t[a]):e.setAttribute(a.toLowerCase(),JSON.stringify(t[a]))}),t.data_inizio){const a=(0,f.qg)(t.data_inizio,"yyyy-MM-dd HH:mm:ss",new Date);e.setAttribute("timestamp",a.getTime())}return e},E=async(t=0,e,a=!0)=>{const o=await(async(t,e)=>{let a;if(a=topics_associations.list_id,0!==e){const t=document.querySelector(`[data-list-id]#post-${e}`);a=t?t.dataset.listId:"T_JOLLY"}topics_associations&&!a&&topics_associations.topic_ids&&topics_associations.subtopic_ids&&(a=(0,i.$2)()),a||(a="T_JOLLY");const[o,n]=await Promise.all([s(a,"iframe"),t?Promise.resolve(null):s(a,"popup")]);return[o,n]})(a,t);L(e,o[0]),a||R(o[1])},L=(t,e)=>{const a=Object.keys(e);if(!a.length)return;const i=e[a[Math.floor(Math.random()*a.length)]],s=n(TopicC2A.numRequiredCTA,i).map(t=>S(t));T(s,t)},A=(t,e,a=null,i=null)=>{const s=document.createElement(t);e&&(s.slot=e),i&&(s.className=i);const o=w.A.sanitize(a??"","subtitle"===e?{ADD_ATTR:["target","rel"]}:{});return s.innerHTML="subtitle"===e?o.replace(/( |\u00A0)/g," "):o,s},C=(t,e="",a="")=>{if(t)return A("div",e,t,a)},I=t=>{if(!t)return!0;const e=document.createElement("div");return e.innerHTML=w.A.sanitize(t),""===e.textContent.replace(/[ \u00A0]/g,"").trim()},k=t=>{if(!t)return;const e=A("img","image",null);return e.classList.add("popup-img"),e.src=`${t}`,e},O=()=>{const t=document.querySelector("#swal2-html-container"),e=t.querySelector('input[name="idcta"]'),a=t.querySelector('input[name="layoutcta"]'),i=t.attributes.idcta,s=t.attributes.layoutCta,o=t.querySelector('input[name="targetcta"]'),n=t.attributes.hubspotListId,r=t.attributes.idTopic,c=window.isHubspotListDataSource;if(e&&i&&(e.value=i.value),a&&s&&(a.value=s.value),o){if(window.isCompanyDataSource)return void(o.value=`ip2company[${window.SSb2binfo}]`);if(n&&c)return void(o.value=`hubspot_list_${n.value}`);if(!r)return;o.value="T_JOLLY"===r.value?"jolly":"topic"}},H=(t,e,a,i,s,o,n,r,c,l)=>{let d,u,p=`${e} ${t}`;switch("form_hubspot"===i&&r&&(p+=" hidden"),"sidebar-c2a"===t&&document.body.classList.contains("logged-in")&&(p+=" logged-in"),t){case"slidein-c2a":d=!1,u="bottom-end";break;case"modal-c2a":d=!0,u="center";break;case"sidebar-c2a":d=!1,u="center-end"}const h={idcta:o,layoutcta:n,hubspotlistid:c,idtopic:l};let f=l;c&&(f=`hubspot_list_${c}`),!f&&window.isCompanyDataSource&&(f=`ip2company[${window.SSb2binfo}]`);const g={title:s,idCta:o,layout:n,hbFormId:r,type:"frame_views",ctaType:"popup",targetcta:f},b=document.activeElement;v().fire({showCloseButton:!0,showConfirmButton:!1,closeButtonHtml:"<div>Ã</div>",html:a,backdrop:d,position:u,customClass:{container:p},willOpen:t=>{s&&t.setAttribute("aria-label",s)},didOpen:()=>
3{v().getPopup()?.focus()},didClose:()=>N(b)}).then((t=>{const e=document.querySelector("#swal2-html-container");Object.keys(t).forEach(a=>{null!=t[a]&&e.setAttribute(a.toLowerCase(),t[a])})})(h)).then((t=>{const e=document.querySelector(".hb-form-wrapper[data-enabled=false]");if(e){const a={portalId:e.dataset.portalid,formId:e.dataset.formid,region:e.dataset.region,target:e.dataset.target,onFormReady:t=>{O(),(0,y.o)(t,"popup")},onFormSubmitted:()=>{(0,m.UZ)({title:t.title,ctaType:t.ctaType,idCta:t.idCta,layout:t.layout,hbFormId:e.dataset.formid,type:"form_submitted",targetcta:t.targetcta})}};"false"!==e.dataset.sfdcampaignid&&(a.sfdcCampaignId=e.dataset.sfdcampaignid),(t=>{let e=0;const a=setInterval(function(){if("undefined"!=typeof hbspt&&null!==hbspt){clearInterval(a),hbspt.forms.create(t);const e=document.querySelector(".swal2-container");if(!e)return;return e.classList.remove("hidden"),void v().getPopup()?.focus()}e++,e>=5&&clearInterval(a)},500)})(a),e.dataset.enabled=!0}})(g)),(0,m.UZ)(g)},x=t=>{let e,a,i,s;const{title:o,subtitle:n,layout:c,type:l,id:d}=t,u=t?.title_custom_type;a=u??l;const p=t?.image,h=t.hb_form_id,m=t.sf_campaign_id,f=t?.event_date,g=(t=>{if(!t)return;const e=new Date(t),a=site?.locale??"it-IT",i=new Intl.DateTimeFormat(a,{dateStyle:"medium"}).format(e),s=new Intl.DateTimeFormat(a,{timeStyle:"short",hour12:!1}).format(e);return`${i} ${(0,r.__)("alle","topic-c2a")} ${s}`})(f),b=t?.event_location,_=t.form_type,v=t?.external_link,y=t?.testo_pulsante,w=t?.hubspot_list_id,T=t?.idTopic;switch(l){case"EVENTO":case"WEBINAR":e="eventi",s=y||(0,r.__)("ISCRIVITI","topic-c2a");break;case"WEBCAST":e="eventi",s=y||(0,r.__)("GUARDA","topic-c2a");break;case"NEWSLETTER":e="newsletter",s=y||(0,r.__)("ISCRIVITI","topic-c2a");break;case"WHITEPAPER":case"INFOGRAFICA":e="whitepaper",s=y||(0,r.__)("SCARICA","topic-c2a");break;case"ALTRO":case"AUTOPROMO":case"LG BOOST":e="whitepaper",a=u??"WHITEPAPER",s=y||(0,r.__)("SCARICA","topic-c2a");break;case"SURVEY":e="survey",s=y||(0,r.__)("INVIA","topic-c2a")}switch(c){case"Slide in":i="slidein-c2a";break;case"Modale":i="modal-c2a";break;case"Sidebar":i="sidebar-c2a"}const S=document.getElementById(`${i}-${e}`);if(!S)return void console.error(`Template con id ${i}-${e} non trovato.`);const E=S.content.cloneNode(!0),L={"type-of-service":C(a,"type-of-service"),title:C(o,"title"),subtitle:I(n)?void 0:C(n,"subtitle"),location:C(b,"location"),datetime:C(g,"datetime"),image:k(p),"form-hubspot":"","link-esterno":""};"form_hubspot"===_&&(L["form-hubspot"]=(t=>{if(!t.formId||!t.sfdcCampaignId)return;const e=Date.now().toString(36)+Math.random().toString(36).substring(2),a=`hb_form_target_${e}`,i=A("div","hb_form",`<div className="hbspt-form" id="${a}"></div>`);return i.classList.add("hb-form-wrapper"),i.dataset.enabled=!1,i.dataset.portalid=hs_config||!1,i.dataset.formid=t.formId,i.dataset.target=`#${a}`,i.dataset.forminstanceid=e,i.dataset.sfdcampaignid=t.sfdcCampaignId||!1,i})({formId:h,sfdcCampaignId:m})),"link_esterno"===_&&(L["link-esterno"]=((t,e)=>{const a=A("a","",t);return a.classList.add("external-link-btn"),a.target="_blank",a.href=e,a})(s,v)),Object.entries(L).forEach(([t,e])=>{E.querySelectorAll(`slot[name="${t}"]`).forEach(t=>{if(!t)return;if(!e)return void t.remove();const a="string"==typeof e?e:e.cloneNode(!0);t.replaceWith(a)})});const O=document.createElement("div");O.appendChild(E),O&&H(i,e,O.innerHTML,_,o,d,c,h,w,T)},R=t=>{const e=Object.keys(t);if(!e.length)return;const a=t[e[Math.floor(Math.random()*e.length)]];n(1,a).forEach(t=>{const e=new b,a=JSON.parse(t.show_rules),{on_page_scroll:i,on_exit:s,after_seconds:o}=a,n="form_hubspot"===t.form_type?".popup-content .actions input[type='submit']":".external-link-btn",r=[{name:"on_page_scroll",condition:i,action:()=>e.onScroll(i,()=>x(t))},{name:"on_exit",condition:s,action:()=>e.onExit(()=>x(t))},{name:"after_seconds",condition:o,action:()=>e.afterSeconds(o,()=>x(t))}],c={title:t.title,type:"popupSelected",ctaType:"popup",idCta:t.id,layout:t.layout,ruleSelected:"",ruleValue:""};r.forEach(t=>{t.condition&&(c.ruleSelected=t.name,c.ruleValue=t.condition,t.action(),(0,m.UZ)(c))}),(0,m.VD)(n,"click",m.bI)})},M=()=>{customElements.define("cta-form",h),(0,m.Ay)(),"undefined"==typeof cta_preview?["frontpage","post_tag","category","brand","personaggi"].includes(topics_associations?.entity)?(async t=>{let e="T_JOLLY";""!==topics_associations?.list_id&&"frontpage"!==t&&(e=topics_associations?.list_id),topics_associations&&"T_JOLLY"===e&&0!==topics_associations.topic_ids.length&&0!==topics_associations.subto
3pic_ids.length&&(e=(0,i.$2)());const a=await s(e,"popup");R(a)})(topics_associations?.entity):(()=>{if(TopicC2A.postEnabled.includes(parseInt(postID))){const t=!1;E(0,(()=>{if((0,i.iR)())return document.querySelector("article .content");const t=document.querySelector("main [id^=post]");return t?t.parentNode.querySelector(".body-text"):document.querySelector(".post-content")})(),t)}})():(t=>{if(t){if("iframe"===t.cta_type){const e=S(t),a=document.querySelector("main");return void T([e],a)}x(t)}})(cta_preview.data)},$=()=>{(0,g.A)()};window.addCtaToPost=E;const N=t=>{if(t&&document.contains(t)&&"function"==typeof t.focus)try{if(t.focus(),document.activeElement===t)return}catch(t){console.error(t)}const e=document.getElementById("main-content");e&&(e.setAttribute("tabindex","-1"),e.focus(),e.addEventListener("blur",()=>{e.removeAttribute("tabindex")},{once:!0}))},q=()=>{(async()=>{Array.isArray(TopicC2A?.stylesheets)&&TopicC2A.stylesheets.forEach(t=>{if(document.querySelector(`link[href="${t}"]`))return;const e=document.createElement("link");e.rel="preload",e.as="style",e.href=t,e.onload=()=>{e.rel="stylesheet",e.onload=null},document.head.appendChild(e)})})(),(()=>{if("interactive"===document.readyState||"complete"===document.readyState)return M(),void $();document.addEventListener("DOMContentLoaded",M),window.addEventListener("load",$)})(),window.addEventListener("message",t=>{if("hsFormCallback"===t.data.type&&"onFormSubmitted"===t.data.eventName){const t=["title","subtitle"],e=document.querySelector(".popup-content");t.forEach(t=>{const a=e.querySelector(`div[slot=${t}]`);a&&(a.innerHTML="")})}})}},234(t,e,a){a(87),a(723),a(455),a(832),a.d(e,["$2",0,()=>{let t=topics_associations.topic_ids.sort((t,e)=>parseInt(t,10)-parseInt(e,10)),e=topics_associations.subtopic_ids.sort((t,e)=>parseInt(t,10)-parseInt(e,10));return t=t.map(t=>`T_${t}`),e=e.map(t=>`S_${t}`),e.concat(t).join("")},"Ri",0,t=>{const e={};return document.cookie.split(";").forEach(function(t){const[a,i]=t.split("=");e[a.trim()]=i}),e[t]},"SF",0,()=>{const{region:t,key:e}=site;switch(t){case"latam":return e;case"iberia":return"iberia";default:return"forumpa"===e?"fpa":"network"}},"iR",0,()=>"forumpa"===TopicC2A.testata||"fpa"===TopicC2A.testata])}}]);
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.