PageSourceSearch

https://www.courrierinternational.com/bucket/assets/f417c55550034acf3567ad94bbdb9505063c0e86/js/pa.bundle.js

js courrierinternational.com collected 2026-10-01 08:54:03 UTC 8,434 bytes, 1 lines download raw bytes

1!function(){"use strict";const e=()=>{const e=RegExp("lmd_consent=[^;]+").exec(document.cookie);return e?JSON.parse(decodeURIComponent(e.toString().replace(/^[^=]+./,""))).purposes:null},t=()=>{const t=e();let n="not found";if(t){const e=Object.values(t),a=e.reduce(((e,t)=>!1===t?e+1:e),0);0===a?n="full consent":a===e.length?n="no consent":a>0&&a<e.length&&(n="partial consent")}return n},n=[],a="page.display",i=(e=[])=>{window.pa&&window.pa.sendEvents(e)},s=(e={})=>{((e,t)=>{window.pa&&window.pa.sendEvent(e,t)})(a,{consent:t(),consent_at:m(),...e})},o=(e={})=>({name:a,data:{consent:t(),consent_at:m(),...e}}),d=()=>window.courrier?.analytics?.piano||{},r=()=>d()?.properties||{},c=(e,t=null)=>r()[e]??t,l=(e,t=[])=>d()?.privacy[e]??t,p=(e,t=[])=>d()?.events[e]??t,h="optin",u="exempt",w="optout";function v(){window.pa.privacy.setMode(h)}function y(){window.pa.privacy.setMode(u)}const m=()=>void 0===window.pa?.privacy?null:(window.pa.privacy.getMode()===h).toString(),P=()=>void 0!==window.pa?.privacy&&window.pa.privacy.getMode()===h,g=()=>{void 0!==window.pa?.privacy&&window.pa.privacy.getMode()===h&&window.pa.setConfiguration("addEventURL","true"),(()=>{if(void 0!==window.pa?.privacy&&window.pa.privacy.getMode()!==w)if("undefined"!=typeof gdpr&&gdpr.getPurposes&&"function"==typeof gdpr.getPurposes&&gdpr.hasConsent&&"function"==typeof gdpr.hasConsent){const e=gdpr.getPurposes();if(!e||!1===gdpr.hasConsent()||e&&!1===e.analytics)return void y();!0===gdpr.hasConsent()&&e&&!0===e.analytics&&v()}else{const t=e();if(!t||t&&!1===t.analytics)return void y();t&&!0===t.analytics&&v()}})(),(()=>{if(void 0===window.pa?.privacy)return;const{properties:e}=l(u);window.pa.privacy.include.properties(Object.values(e),[u])})(),(()=>{if(void 0===window.pa?.privacy)return;const{events:e}=l(u);window.pa.privacy.include.events(Object.values(e),[u])})(),(()=>{if(!document.querySelector("html").classList.contains("page-donnees-personnelles"))return;if(void 0===window.pa?.privacy)return;const e=document.getElementById("optout-ati");window.pa.privacy.getMode()===w?e.removeAttribute("checked"):e.setAttribute("checked","checked"),e.addEventListener("click",(function(){const t=!0===e.checked;t?y():window.pa.privacy.setMode(w),s(courrier.analytics.piano.properties),CI.sendAppMessage("core.setATInternetOptOut",{enabled:t})}))})()};class E{static EVENTS={PLAYER_PLAY:"play",PLAYER_PAUSE:"pause",PLAYER_END:"ended",PLAYER_TIME_UPDATE:"timeupdate"};constructor(e={}){this.customParams=e.customParams||{},this.debug=e.debug||document.location.search.includes("ci-debug")||!1,this.avMediaManagement=null,this.instanciatedPlayer=null,this.useBeacon=!1,this.avInit(),window.addEventListener("audioLoaded",(({detail:e})=>{this._log("Audio Loaded",e),this.instanciatedPlayer&&(this.destroy(),this._log("Instance already exists .. Current Session ID",this.avMediaManagement.getSessionID()),this.handleEnded({})),this.params=e.pianoData,this.avInit(),this.onPlayerReady(e.audio),this._log("New SessionID: ",this.avMediaManagement.getSessionID())})),window.addEventListener("audioClosed",this.handleClosing),window.addEventListener("beforeunload",this.handleClosing)}set params(e){this.customParams={...this.customParams,...e}}set updateCurrentTime(e){this.currentTime=Math.floor(1e3*e)}_log=(e,t=null)=>{this.debug&&console.log(`[avMediaPlayer] ${e}`,t||"")};avInit=()=>{try{this.playbackPaused=!1,this.playbackStopped=!1,this.currentTime=0,this.avMediaManagement||(this.avMediaManagement=new window.pa.avInsights.Media,this._log("Piano Analytics Media initialized")),this.avMediaManagement.setProps(this.customParams)}catch(e){this._log("[avMediaPlayer] Failed to initialize Piano Analytics:",e)}};onPlayerReady=e=>{this.instanciatedPlayer=e,this._log("Player ready",this.instanciatedPlayer),this.setupEventListeners()};setupEventListeners=()=>{this.instanciatedPlayer?(this.instanciatedPlayer.addEventListener(E.EVENTS.PLAYER_PLAY,this.handlePlay),this.instanciatedPlayer.addEventListener(E.EVENTS.PLAYER_PAUSE,this.handlePause),this.instanciatedPlayer.addEventListener(E.EVENTS.PLAYER_END,this.handleEnded),this.instanciatedPlayer.addEventListener(E.EVENTS.PLAYER_TIME_UPDATE,this.handleTimeUpdate),this._log("Event listeners attached")):this._log("[avMediaPlayer] No player instance available")};handlePlay=e=>{this.playbackPaused?(this.avMediaManagement.playbackResumed(this.currentTime),this.playbackPaused=!1):this.avMediaManagement.playbackStart(this.currentTime)};handlePause=e=>{this.playbackPaused=!0,this.avMediaManagement.playbackPaused(this.currentTime)};handleEnded=e=>{this.playbackStopped||(this.avMediaManagement.playbackStopped(this.currentTime),this.playbackStopped=!0,this.playbackPaused=!1,this.updateCurrentTime=0)};handleTimeUpdate=e=>{this.updateCurrentTime=e.target.currentTime};handleClosing=e=>{this.instanciatedPlayer&&("beforeunload"!==e.type?(this.destroy(),this.handleEnded({}),this.avInit()):this.handleEnded({}))};destroy=()=>{this.instanciatedPlayer&&(this.instanciatedPlayer.removeEventListener(E.EVENTS.PLAYER_PLAY,this.handlePlay),this.instanciatedPlayer.removeEventListener(E.EVENTS.PLAYER_PAUSE,this.handlePause),this.instanciatedPlayer.removeEventListener(E.EVENTS.PLAYER_END,this.handleEnded),this.instanciatedPlayer.removeEventListener(E.EVENTS.PLAYER_TIME_UPDATE,this.handleTimeUpdate),this.instanciatedPlayer=null,this._log("Player destroyed and event listeners removed"))}}var f=E;const _=(e,t)=>
1{"IntersectionObserver"in window?new IntersectionObserver((e=>{e.forEach((function(e){t(e)}))})).observe(e):t(!1)},M=e=>{const{dataset:t}=e;return{onsitead_type:"Publisher",onsitead_campaign:t.ithalc?.replace(/[\])}[{(]/g,"")||"cta_abo",onsitead_format:t.ithalf||c("page")||"",onsitead_detailed_placement:t.ithaldp||"",onsitead_creation:t.ithal||"",onsitead_variant:t.ithalv?.toString()||c("nature_edito")||"",onsitead_url:e?.href||document.location.href||""}},b=(e,t=!1)=>{const n=document.querySelectorAll(`a.${e}, button.${e}, div.${e}`);for(let a=0;a<n.length;a+=1){const i=n[a];i.classList.remove(e),i.addEventListener("click",(function(e){var t;"DIV"===this.tagName&&e.target!==this||(t=M(this),window.pa&&P()&&window.pa.sendEvent("publisher.click",t))})),t&&_(i,(e=>{const{target:t}=e||{};var n;e&&e.intersectionRatio>0&&!Object.prototype.hasOwnProperty.call(t.dataset,"isObserved")&&(n=M(t),window.pa&&P()&&window.pa.sendEvent("publisher.impression",n),t.dataset.isObserved=!0)}))}};window.lmdPianoAsyncCommands=window.lmdPianoAsyncCommands??[];let L=null,A=0,S=!1,T=!1;function k(e={}){if(A+=1,A<=15){for(;window.lmdPianoAsyncCommands.length>0;){const t=window.lmdPianoAsyncCommands.pop();if(t&&"sendEvents"===t.command){const n=T?{}:o(e),a=[{name:t.name,data:t.data},n];i(a),S=!0,clearInterval(L)}}3===A&&!1===S&&(s(e),T=!0)}else clearInterval(L)}new Promise(((e,t)=>{(()=>{const{configuration:e={}}=courrier.analytics.piano;if(!e)throw new Error("The piano configuration is empty");window._pac=window._pac||{},window._pac.cookieDomain=e.cookieDomain,window._pac.privacyDefaultMode=e.privacyDefaultMode,window._pac.site=e.siteId,window._pac.collectDomain=e.collectDomain,window._pac.path=e.path||"courrier",window._pac.campaignPrefix=e.campaignPrefix,window._pac.isVisitorClientSide=e.isVisitorClientSide})(),((e=()=>{},t=()=>{})=>{((e,t=!0,a=!1,i,s)=>{if(n.indexOf(e)>=0){const t=document.querySelector(`script[src~="${e}"]`);if(t)return void i(t)}const o=document.createElement("script");o.type="text/javascript",o.async=t,o.defer=a,o.src=e,o.onload=()=>{n.push(e),i&&i(o)},o.onerror=s;const d=document.getElementsByTagName("script")[0];d.parentNode.insertBefore(o,d)})(window.courrier?.analytics?.piano?.url||"https://tag.aticdn.net/js-sdk/piano-analytics-6.15.2.js",!0,!1,e,t)})((()=>window.pa?(g(),(()=>{if(P()){const e=document.location.hash?.substring(1);e&&(window.courrier.analytics.piano.properties.url_anchor=decodeURIComponent(e))}})(),window.pa&&window.pa.setProperties({...r()},{persistent:!0,events:[...p("page"),...p("click"),...p("publisher"),...p("av")]}),document.dispatchEvent(new CustomEvent("lmdPianoLoaded")),e()):t(new Error("Piano is not loaded"))),(()=>t(new Error("Piano is not loaded"))))})).then((()=>function(){if(window.pa&&P()&&(b("ithal",!0),b("ithalc")),new f,!0!==courrier?.analytics?.skip_page_display_event)if(e())s();else{const e=200;L=window.setInterval(k,e,{})}}())).catch((e=>console.error("Something went wrong while initializing Piano",e)))}();

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.