@20minutes/tyr 2.48.11 → 2.48.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/ads.min.js +1 -1
- package/dist/js/main.min.js +1 -1
- package/package.json +1 -1
package/dist/js/main.min.js
CHANGED
|
@@ -188,5 +188,5 @@ Copyright (c) 2018 Jed Watson.
|
|
|
188
188
|
Licensed under the MIT License (MIT), see
|
|
189
189
|
http://jedwatson.github.io/classnames
|
|
190
190
|
*/
|
|
191
|
-
;var Eb=/* @__PURE__ */ c((/* @__PURE__ */ o(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})))(),1);let Db=({articles:e,seeMoreButton:t,layout:n,...r})=>{let{variablesForQuery:i,...a}=r;return/* @__PURE__ */ (0,U.jsxs)(q,{...a,children:[e.map((t,r)=>{let i=`lastArticleKey${r}`,a=r===e.length-1,o=!a&&(n===Y.DESKTOP||n===Y.MOBILE&&r!==10&&r!==20);return/* @__PURE__ */ (0,U.jsxs)(W.default.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Qo,{...t,px:{xs:`m`,md:`0`},cardTitleProps:{weight:`semi-bold`,maxRows:n===Y.MOBILE?void 0:3,...t.cardTitleProps},...o?{className:`u-divider-bottom-grey-200`}:{},...r!==0&&{pt:`s`},...!a&&{pb:`s`}}),r===10&&n===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_haut`,variant:`ARTICLE`}),r===20&&n===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_milieu`,variant:`ARTICLE`})]},i)}),t&&/* @__PURE__ */ (0,U.jsx)(ka,{...t,color:`primary`,variant:`outlined`,mx:`auto`,mt:`s`})]})},Ob=({legalNotices:e,seeMoreLegalNotices:t,...n})=>e.length===0?null:/* @__PURE__ */ (0,U.jsxs)(q,{...n,children:[e.map((t,n)=>/* @__PURE__ */ (0,W.createElement)(Zo,{...t,key:`${t.link}-${n}`,linkProps:{children:`Lire l’annonce`},...n!==e.length-1&&{className:`u-divider-bottom-grey-200`},...n!==0&&{pt:`l`},...n!==e.length-1&&{pb:`l`}})),t&&/* @__PURE__ */ (0,U.jsx)(ka,{color:`primary`,variant:`outlined`,mx:`auto`,mt:`xl`,...t})]}),kb=({updatedAt:e,...t})=>/* @__PURE__ */ (0,U.jsx)(os,{...t,...e&&{updatedAt:zs(e)}}),Ab=({draftContent:e,pageEndpoint:t,imgEndpoint:n,withCmp:r=!0})=>{let i=W.default.useRef(null);return W.default.useEffect(()=>{let a=wb({rawDraftContent:e,pageEndpoint:t,imgEndpoint:n,withCmp:r}),o=document.createRange().createContextualFragment(a);i.current&&(i.current.innerHTML=``,i.current.appendChild(o))},[e,n,t,r]),/* @__PURE__ */ (0,U.jsx)(q,{ref:i,mt:`s`,className:`c-content`,children:Tb({rawDraftContent:e,pageEndpoint:t,imgEndpoint:n,withCmp:r})})},jb=(e,t)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}},Mb={formId:`elections-form`,autocompleteSelector:`.c-search-form__autocomplete`},Nb=({isSSR:e=!0,layout:t,title:n,titleHref:r,searchFormProps:i,breadcrumbProps:a,selectProps:o,variant:s,hasTopBorder:c})=>{let[l,u]=W.default.useState([]),d=W.default.useCallback(()=>{let e=document.querySelector(Mb.autocompleteSelector);l&&l.length>0&&e&&e.classList.remove(`u-hidden`)},[l]),f=W.default.useCallback(()=>{let e=document.querySelector(Mb.autocompleteSelector);l&&l.length>0&&e&&e.classList.remove(`u-hidden`)},[l]),p=W.default.useCallback(e=>{e.relatedTarget||document.querySelector(Mb.autocompleteSelector)?.classList?.add(`u-hidden`)},[]),m=W.default.useCallback(async e=>{if(e.target instanceof HTMLInputElement){let{target:t}=e;if(t.value.length<3)u([]);else try{let e=await du({url:`${t.closest(`form`)?.action??`#`}?searchValue=${t.value}`});u(e.map(e=>{let{_source:t}=e;return{value:t.output,url:t.url}}))}catch(e){console.error(`20mn> Error while searching:`,e)}}},[]);return W.default.useEffect(()=>{ri()},[]),W.default.useEffect(()=>{let e=document.querySelector(Mb.autocompleteSelector);l&&e&&(l.length>0?e.classList.remove(`u-hidden`):e.classList.add(`u-hidden`))},[l]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(ns,{layout:t,title:n,titleHref:r,breadcrumbProps:a,selectProps:o,variant:s,hasTopBorder:c,searchFormProps:{...i,autocompleteResults:l,onSubmit:e=>{e.preventDefault()},inputProps:{placeholder:`Recherchez les résultats de votre ville, votre département ou votre région`,name:`elections-search`,onClick:d,onFocus:f,onBlur:p,onKeyUp:jb(m,300),autoComplete:`off`,required:!0,"aria-required":!0}}}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsSearchBannerContainer:{layout:t,title:n,titleHref:r,searchFormProps:i,breadcrumbProps:a,selectProps:o,variant:s,hasTopBorder:c}})} };`}})]})},Pb=({layout:e,title:t,editions:n,selectorsLabel:r,editionSelector:i,monthSelector:a,variant:o=`archivesByYear`,enabled:s=!0})=>s?/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Aa,{my:{xs:`xl`,md:`xxl-2`},color:`ultramarine`}),/* @__PURE__ */ (0,U.jsx)(vo,{size:`xs`,mb:`xxl`,children:t}),/* @__PURE__ */ (0,U.jsxs)(J,{alignItems:{xs:`start`,md:`center`},gap:{xs:`xs`,md:`l`},direction:{xs:`column`,md:`row`},children:[/* @__PURE__ */ (0,U.jsx)(X,{size:`s`,weight:`bold`,...r}),/* @__PURE__ */ (0,U.jsx)(uo,{...i,id:`archivePdfListEditionSelector`,containerProps:{style:{width:e===Y.MOBILE?`100%`:`163px`}},py:`m`,px:`s`}),o===`archivesByYear`&&a&&/* @__PURE__ */ (0,U.jsx)(uo,{...a,id:`archivePdfListMonthSelector`,containerProps:{style:{width:e===Y.MOBILE?`100%`:`193px`}},py:`m`,px:`s`})]}),n&&n.length>0&&/* @__PURE__ */ (0,U.jsxs)(J,{direction:`column`,gap:`l`,mt:`l`,children:[n.slice(0,20).map(e=>/* @__PURE__ */ (0,U.jsxs)(J,{alignItems:`baseline`,children:[/* @__PURE__ */ (0,U.jsx)(K,{name:`diode`,color:`ultramarine`,size:11,mr:`xxs`}),/* @__PURE__ */ (0,U.jsx)(ao,{color:`ultramarine`,href:e.href,children:e.name})]},e.name)),n.length>20&&/* @__PURE__ */ (0,U.jsx)(`span`,{children:`Vous ne trouvez pas le journal numérique recherché ? Sélectionnez une édition et un mois pour une recherche plus précise.`})]})]}):null,Fb=e=>{let{variablesForQuery:t,...n}=e;return/* @__PURE__ */ (0,U.jsx)($o,{...n,headingProps:{...n.headingProps,as:`h2`},mb:`xxl`})},Ib=e=>e&&(e.rightSubheader&&new Date(e.rightSubheader?.text).getTime()?{...e,rightSubheader:{...e.rightSubheader,text:zs(e.rightSubheader.text)}}:{...e}),Lb=({articles:e,layout:t,columnsNumber:n=2,hideFirstDivider:r=!1,dividerProps:i,seeMoreButton:a,seeMoreLink:o,tagTotalArticles:s,currentPagePath:c,currentPage:l=`1`,articlesLimit:u,hasCardLarge:d=!1,hasMarginOnCard:f=!0,heading:p,isLoading:m=!1,skeletonCount:h=8,desktopArticlesListClassName:g,desktopCardSize:_=`medium`,...v})=>{if(e.length===0)return null;let y=e=>/* @__PURE__ */ (0,U.jsx)(Lo,{...e,cardTitleProps:{as:`h2`,...e.cardTitleProps},cardHeaderProps:Ib(e.cardHeaderProps),mx:f?`m`:void 0}),b=m?Array.from({length:h},(e,t)=>t):[],x=null;x=t===Y.DESKTOP?/* @__PURE__ */ (0,U.jsxs)(io,{colsNumber:n,gap:`xl`,className:g,children:[e.slice(0,u).map((e,n)=>{let{layout:r,cardImageProps:i,...a}=e,o=Ib(e.cardHeaderProps),s={className:`card-item-${n+1}`,cardImageProps:i};return _===`small`?/* @__PURE__ */ (0,W.createElement)(Jo,{...s,key:`${e.link}-${n}`,justifyContent:`start`,cardTitleProps:{as:`h2`,...e.cardTitleProps},layout:t,link:e.link,title:e.title,cardHeaderProps:o?.headline?{headline:o?.headline}:void 0}):/* @__PURE__ */ (0,W.createElement)(zo,{...s,...a,key:`${e.link}-${n}`,cardTitleProps:{as:`h2`,...e.cardTitleProps},cardHeaderProps:o})}),b.map(e=>/* @__PURE__ */ (0,U.jsx)(qo,{variant:`medium`},`skeleton-${e}`))]}):/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[e.slice(0,u).map((e,n)=>/* @__PURE__ */ (0,U.jsx)(q,{className:`card-item-${n+1}`,children:d?/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[n===0&&/* @__PURE__ */ (0,U.jsx)(Ro,{...e,layout:t}),n>0&&/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Aa,{color:`grey-200`,my:`s`,...i}),y({...e,layout:t})]})]}):/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Aa,{color:`grey-200`,my:`s`,...i,className:(0,Eb.default)({"u-hidden":n===0&&r},i?.className)}),y({...e,layout:t})]})},`${e.link}-${n}`)),b.map(e=>/* @__PURE__ */ (0,U.jsxs)(q,{children:[/* @__PURE__ */ (0,U.jsx)(Aa,{color:`grey-200`,my:`s`,...i}),/* @__PURE__ */ (0,U.jsx)(qo,{variant:`extra-small`,mx:f?`m`:void 0})]},`skeleton-${e}`))]});let S=/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[p&&/* @__PURE__ */ (0,U.jsx)(vo,{size:`m`,mb:`xl`,mx:{xs:`m`,md:`0`},...p}),x,(o||a)&&/* @__PURE__ */ (0,U.jsxs)(J,{justifyContent:`center`,mt:`l`,children:[a&&/* @__PURE__ */ (0,U.jsx)(ka,{...a}),o&&/* @__PURE__ */ (0,U.jsx)(ao,{buttonColor:`primary`,variant:`outlined`,...o}),s&&c&&/* @__PURE__ */ (0,U.jsx)(`noscript`,{children:/* @__PURE__ */ (0,U.jsx)(ys,{totalArticles:s,currentPage:l,pagePath:c,archivesUrl:`https://www.20minutes.fr/archives`})})]})]});return Object.keys(v).length===0?S:/* @__PURE__ */ (0,U.jsx)(q,{...v,children:S})},Rb=({header:{subtitle:e,...t},sectionId:n,liveIndicator:r,children:i,...a})=>{let o=e&&typeof e!=`string`?Tb({rawDraftContent:e}):e;return/* @__PURE__ */ (0,U.jsxs)(q,{...a,id:n,className:(0,Eb.default)(a.className,{"u-anchor-link":!!n}),children:[r&&/* @__PURE__ */ (0,U.jsx)(kb,{...r,variant:`elections`,mx:{xs:`m`,md:`0`},mb:`xs`}),t?.heading?.children&&/* @__PURE__ */ (0,U.jsx)(rs,{...t,subtitle:o,mb:{xs:`m`,sm:`xl`}}),i]})},zb=({mapConstituenciesProps:e,...t})=>e.electionName===``&&e.electionYear===``&&e.resultsPerDistrict.length===0||Object.keys(e.mapDistrictsData||{}).length===0?null:/* @__PURE__ */ (0,U.jsx)(Rb,{...t,header:{...t.header,heading:{...t.header.heading,as:`h2`}},children:/* @__PURE__ */ (0,U.jsx)(us,{...e,mx:{xs:`m`,md:`0`}})}),Bb=({mapDepartmentsProps:e,...t})=>e.electionName===``&&e.electionYear===``&&e.resultsPerDepartment.length===0?null:/* @__PURE__ */ (0,U.jsx)(Rb,{...t,header:{...t.header,heading:{...t.header.heading,as:`h2`}},children:/* @__PURE__ */ (0,U.jsx)(ls,{...e,mx:{xs:`m`,md:`0`}})}),Vb=({mapEuropeProps:e,...t})=>e.electionName===``&&e.electionYear===``&&e.resultsPerCountry.length===0||Object.keys(e.mapEuCountriesData||{}).length===0||Object.keys(e.mapNonEuCountriesData||{}).length===0?null:/* @__PURE__ */ (0,U.jsx)(Rb,{...t,header:{...t.header,heading:{...t.header.heading,as:`h2`}},children:/* @__PURE__ */ (0,U.jsx)(ds,{...e,mx:{xs:`m`,md:`0`}})}),Hb=({mapTownsByDepartmentsProps:e,...t})=>{let{electionName:n,electionYear:r,...i}=e;if(e.electionName===``&&e.electionYear===``&&e.resultsPerTown.length===0)return null;let a=(e?.resultsPerTown?.length??0)===0;return/* @__PURE__ */ (0,U.jsx)(Rb,{...t,className:(0,Eb.default)({"u-placeholder-map-towns-empty":a,"u-placeholder-map-towns":!a},t?.className),header:{...t.header,heading:{...t.header.heading,as:`h2`}},children:/* @__PURE__ */ (0,U.jsx)(vs,{...i,mx:{xs:`m`,md:`0`}})})},Ub=({articles:e,selectProps:t,seeMoreLink:n,layout:r,...i})=>{let{variablesForQuery:a,...o}=i,s=/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(is,{as:`h2`,size:{xs:`s`,md:`m`},isCentered:r===Y.MOBILE,mb:{xs:`l`,md:`0`},iconProps:{name:`rubric-news`,size:40},children:`Actualité locale`}),/* @__PURE__ */ (0,U.jsx)(uo,{...t})]}),c=(t,n)=>/* @__PURE__ */ (0,U.jsx)(zo,{...t,cardTitleProps:{as:`h3`,size:`xxs`,weight:`semi-bold`,fontFamily:`source-serif-pro`,maxRows:4,...t.cardTitleProps},socialBarProps:void 0,...r===Y.MOBILE&&n!==e.length-1&&{className:`u-divider-bottom-grey-200`},...r===Y.MOBILE&&n!==0&&{pt:`s`},...r===Y.MOBILE&&n!==e.length-1&&{pb:`s`}},t.title);return/* @__PURE__ */ (0,U.jsxs)(q,{...o,children:[/* @__PURE__ */ (0,U.jsx)(Aa,{thickness:`heavy`,color:`ultramarine`,mb:`l`}),r===Y.DESKTOP?/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`between`,mb:`xl`,alignItems:`center`,children:s}):/* @__PURE__ */ (0,U.jsx)(q,{mx:`m`,mb:`l`,children:s}),r===Y.DESKTOP?/* @__PURE__ */ (0,U.jsx)(io,{colsNumber:4,gap:`xl`,mx:r===Y.DESKTOP?`0`:`m`,children:e.map(e=>c(e))}):/* @__PURE__ */ (0,U.jsx)(J,{direction:`column`,mx:`m`,children:e.map((e,t)=>c(e,t))}),/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,mt:`xxl`,children:/* @__PURE__ */ (0,U.jsx)(ao,{buttonColor:`primary`,variant:`outlined`,...n,children:`Voir plus d'articles`})})]})},Wb=({post:e,postIndex:t,postsCount:n,pageEndpoint:r,imgEndpoint:i,layout:a,disableAds:o=!1,enableAnchoring:s=!0})=>/* @__PURE__ */ (0,W.createElement)(`section`,{className:(0,Eb.default)(`js-post`,{"u-anchor-link":s}),...s?{id:`post-${e.id}`}:{},key:e.id},/* @__PURE__ */ (0,U.jsx)(cs,{...e.title}),e.content&&/* @__PURE__ */ (0,U.jsx)(Ab,{draftContent:e.content,pageEndpoint:r,imgEndpoint:i}),e.talk&&/* @__PURE__ */ (0,U.jsx)(ss,{...e.talk,mt:`s`}),/* @__PURE__ */ (0,U.jsx)(Aa,{color:`grey-200`,my:`l`}),!o&&n>=8&&t%6==0&&/* @__PURE__ */ (0,U.jsx)(sa,{id:a===Y.MOBILE?`inarticle2`:`inarticle1`,variant:`ARTICLE`,mb:`s`,isFullscreenMobile:!0}),!o&&n>=4&&t%6==3&&/* @__PURE__ */ (0,U.jsx)(sa,{id:a===Y.MOBILE?`inarticle3`:`inarticle2`,variant:`INREAD`,mb:`s`,isFullscreenMobile:!0})),Gb=({posts:e,layout:t,pageEndpoint:n,imgEndpoint:r,seeMoreLink:i,variablesForQuery:a,refreshButton:o,disableAds:s,enableAnchoring:c=!0,...l})=>e.length===0?null:/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(q,{...l,children:e.map((i,a)=>/* @__PURE__ */ (0,U.jsx)(Wb,{post:i,postIndex:a,postsCount:e.length,layout:t,pageEndpoint:n,imgEndpoint:r,disableAds:s,enableAnchoring:c},`${i.id}-${a}`))}),i&&/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,my:`l`,children:/* @__PURE__ */ (0,U.jsx)(ka,{color:`primary`,variant:`outlined`,...i})})]}),Kb=({items:e,seeMoreButton:t,...n})=>e.length<=0?null:/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(q,{...n,children:e.map((t,n)=>{let{summaryProps:r,...i}=t,a=i.layout===Y.DESKTOP&&n!==e.length-1||i.layout===Y.MOBILE&&n!==e.length-1&&n!==2&&n!==7;return/* @__PURE__ */ (0,U.jsxs)(W.default.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Vo,{...i,summaryProps:i.layout===Y.MOBILE?void 0:r,mx:{xs:`m`,md:`0`},...a?{className:`u-divider-bottom-grey-200`}:{},...n!==0&&{pt:`s`},...n!==e.length-1&&{pb:`s`}}),n===2&&i.layout===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_haut`,variant:`ARTICLE`}),n===7&&i.layout===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_milieu`,variant:`ARTICLE`})]},`${i.link}-${n}`)})}),t&&/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,mb:`m`,children:/* @__PURE__ */ (0,U.jsx)(ka,{...t})})]}),qb=({...e})=>{let{variablesForQuery:t,...n}=e;return/* @__PURE__ */ (0,U.jsx)(Ns,{...n})},Jb=({items:e,layout:t,seeMoreButton:n,...r})=>e.length<=0?null:/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(J,{direction:`column`,gap:`xxl-2`,...r,children:e.map((e,n)=>/* @__PURE__ */ (0,U.jsxs)(W.default.Fragment,{children:[n===5&&t===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_haut`,variant:`ARTICLE`}),/* @__PURE__ */ (0,U.jsx)(Ho,{...e,layout:t,containerSpacing:{px:{xs:`m`,lg:`0`}}})]},`${e.link}-${n}`))}),n&&/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,mt:`xl`,children:/* @__PURE__ */ (0,U.jsx)(ka,{...n})}),t===Y.DESKTOP&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`banniere_basse`,variant:`BAN`}),t===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_milieu`,variant:`BAN`,mt:`xl`})]}),Yb=({articles:e,layout:t,totalArticles:n,currentPagePath:r,currentPage:i=`1`,seeMoreButton:a,...o})=>{if(e.length===0)return null;let s=/* @__PURE__ */ (0,U.jsx)(io,{colsNumber:1,gap:{xs:`xxl`,md:`xxl-2`},children:e.map((e,n)=>t===Y.DESKTOP?/* @__PURE__ */ (0,U.jsx)(Uo,{...e,className:(0,Eb.default)(`card-item-${n+1}`,e.className),cardTitleProps:{as:`h2`,...e.cardTitleProps},cardHeaderProps:Ib(e.cardHeaderProps)},e.title):/* @__PURE__ */ (0,U.jsx)(Io,{layout:t,...e,className:(0,Eb.default)(`card-item-${n+1}`,e.className),cardTitleProps:{as:`h2`,...e.cardTitleProps},cardHeaderProps:Ib(e.cardHeaderProps)},e.title))}),c=/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[s,a&&/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[n&&r&&/* @__PURE__ */ (0,U.jsx)(`noscript`,{children:/* @__PURE__ */ (0,U.jsx)(ys,{totalArticles:n,currentPage:i,pagePath:r,archivesUrl:`https://www.20minutes.fr/archives`})}),/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,mt:`xxl`,children:/* @__PURE__ */ (0,U.jsx)(ka,{...a})})]})]});return Object.keys(o).length===0?c:/* @__PURE__ */ (0,U.jsx)(q,{...o,children:c})},Xb=e=>{if(!window.lazyObservers?.defaultObserver&&!window.lazyObservers?.instantObserver){window.lazyElementsToObserve=window.lazyElementsToObserve||[],window.lazyElementsToObserve.push(e);return}let t=e.dataset?.distanceVisible;t===`700`?window.lazyObservers?.defaultObserver?.observe(e):t===`0`&&window.lazyObservers?.instantObserver?.observe(e)},Zb=(e,t)=>{e.forEach(e=>{if(e.isIntersecting&&e.target instanceof HTMLElement){let{target:n}=e,r=n.id,i=n.dataset?.eventName;(r||i)&&(n.dataset.lazyLoaded=`true`,t.unobserve(n),i?(document.dispatchEvent(new CustomEvent(i,{detail:{target:n}})),console.info(`20minLazyCall: element event name %c${i}%c has been lazy loaded`,`color: #0777;font-weight:bold;`,`color: black`)):r&&(n.dispatchEvent(new Event(r)),console.info(`20minLazyCall: element with id %c${r}%c has been lazy loaded`,`color: #0777;font-weight:bold;`,`color: black`)))}})},Qb=()=>{document.querySelectorAll(`[data-delayed="true"]:not([data-dfp-name]):not([data-lazy-loaded="true"])`).forEach(e=>{Xb(e)})},$b=()=>{window.lazyObservers={},window.lazyObservers.defaultObserver=new IntersectionObserver(Zb,{rootMargin:`700px`,threshold:0}),window.lazyObservers.instantObserver=new IntersectionObserver(Zb,{rootMargin:`0px`,threshold:0}),(window.lazyElementsToObserve||[]).forEach(e=>{Xb(e)}),Qb()},ex=({medias:e,imgEndpoint:t})=>{let n=e?.find(e=>e&&e.illustration===!0&&e.type===`photo`&&e.photo?.node?.id);if(!n?.photo?.node?.id)return``;let r=n.photo?.node?.slug?`%format_${n.photo.node.slug}`:`%format`;return`${t}/${ob(n.photo.node.id)}/${r}`},tx=({photo:e})=>e?.node?[{type:`photo`,illustration:!0,legend:e.node.caption??null,photo:{node:{id:e.node.id,brand_id:e.node.brand_id,title:e.node.title??null,caption:e.node.caption??null,credit:e.node.credit??null,slug:e.node.slug??null}},video:null,podcast:null}]:[],nx=({medias:e,picto:t,editorialModel:n})=>{if(n===`Story`)return{caption:{iconName:`diaporama`}};let r;if(t)switch(t){case`video`:if(n!==`Page`){let t=e?.find(e=>e&&e?.illustration===!0&&e?.type===`video`&&e.video?.duration)?.video?.duration;return{caption:{iconName:`video`,text:t?Is(Number(t)):``}}}break;case`podcast`:return{caption:{iconName:`podcast`}};default:return r}else e?.forEach(e=>{if(e?.type===`podcast`&&(r={caption:{iconName:`podcast`}}),e?.type===`video`&&e?.illustration&&n!==`Page`){let t=e?.video?.duration?Number(e?.video?.duration):null;r={caption:{iconName:`video`,text:t?Is(t):``}}}});return r},rx=({pageEndpoint:e,imgEndpoint:t,layout:n,data:r})=>Array.isArray(r)?[]:(r?.brand?.node?.tag?.node?.publishableContents?.edges||[])?.reduce((r,i)=>(!i?.node?.short_title||!i?.node?.medias||!i?.node?.url_current||r.push({title:i.node.short_title,cardImageProps:{cover:ex({medias:i.node.medias,imgEndpoint:t}),caption:{iconName:`video`,text:i?.node?.video?.node?.duration?.toString()?Is(parseInt(i.node.video.node.duration.toString(),10)):void 0}},link:new URL(i.node.url_current,e).href,layout:n,...n===Y.MOBILE&&{reverseCard:!0}}),r),[]),ix=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery?.endCursor||null),[r,i]=W.default.useState(e.defaultVariablesForQuery?.hasNextPage||!1),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,a=new Headers;window.envVariables?.apiAuthKey&&a.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${r}/?id=getTvReplaysOrExtracts&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery?.brandId,slug:e.defaultVariablesForQuery?.slug,first:8,after:t,filter:{publication_status:{eq:`published`},...e.defaultVariablesForQuery?.tagId?{tag_ids:{nin:[e.defaultVariablesForQuery.tagId]}}:{}}}))}`,options:{headers:a}}];try{let t=await du(...s),r=rx({pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,layout:e.layout,data:t});o(e=>[...e,...r]),n(t?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.endCursor||null),i(t?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.hasNextPage||!1),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[t,e.defaultVariablesForQuery,e.layout]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},ax=({isSSR:e=!0,name:t,layout:n,articles:r,variablesForQuery:i,seeMoreButton:a,...o})=>{if(r.length===0)return null;let{isLoading:s,articles:c,hasNextPage:l,onLoadMore:u}=ix({layout:n,defaultArticles:r,defaultVariablesForQuery:i});return W.default.useEffect(()=>{s||Qb()},[s]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Lb,{layout:n,articles:c,seeMoreButton:a&&l?{...a,disabled:s,onClick:u}:void 0,...o}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({[`${t}TvExtractsAndReplaysContainer`]:{layout:n,articles:c,variablesForQuery:i,seeMoreButton:a,...o}})} };`}})]})},ox=e=>{switch(e){case`FRA`:return`Nationale`;case`BOR`:return`Bordeaux`;case`LIL`:return`Lille`;case`MAR`:return`Marseille`;case`MON`:return`Montpellier`;case`NAN`:return`Nantes`;case`NIC`:return`Nice`;case`PAR`:return`Paris`;case`REN`:return`Rennes`;case`STR`:return`Strasbourg`;case`TOU`:return`Toulouse`;default:return``}},sx=e=>{let t=e.slice(0,4),n=e.slice(4,6),r=e.slice(6,8),i=[`janvier`,`février`,`mars`,`avril`,`mai`,`juin`,`juillet`,`août`,`septembre`,`octobre`,`novembre`,`décembre`][parseInt(n,10)-1];return`${parseInt(r,10)} ${i} ${t}`},cx=({data:e})=>{let t=[];return Array.isArray(e)||e?.brand?.node?.edition?.node?.pdfs?.edges?.forEach(e=>{e?.node?.url&&e?.node?.publication_date&&t.push({href:e?.node?.url,name:`Lire le journal du ${sx(e?.node?.publication_date)} - édition ${ox(e.node.url.match(/[0-9]{8}_([A-Z]{3})\.pdf/)?.[1]??``)}`})}),t},lx={editionSelectorId:`archivePdfListEditionSelector`,monthSelectorId:`archivePdfListMonthSelector`},ux=({isSSR:e=!0,variablesForQuery:t,layout:n,title:r,selectorsLabel:i,editionSelector:a,monthSelector:o,editions:s,enabled:c})=>{let[l,u]=W.default.useState(s),d=W.default.useCallback(async()=>{let{apiHost:e}=document.body.dataset,n=new Headers;window.envVariables?.apiAuthKey&&n.append(`auth-key`,window.envVariables.apiAuthKey);let r=document.getElementById(lx.editionSelectorId),i=document.getElementById(lx.monthSelectorId),a=[{url:`${e}/?id=getPdfsByEditionSlug&variables=${encodeURIComponent(JSON.stringify({brandId:t?.brandId,slug:r?.value,first:100,sort:`ASC`,year:t?.year,month:i?.value}))}`,options:{headers:n}}];try{let e=await du(...a),t=cx({data:e});u(t)}catch(e){console.error(`20mn> Error while searching:`,e)}},[t?.brandId,t?.year]);return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Pb,{title:r,selectorsLabel:i,editionSelector:{...a,onChange:d},monthSelector:o&&{...o,onChange:d},editions:l,layout:n,enabled:c}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({archivePdfListContainer:{title:r,layout:n,selectorsLabel:i,editionSelector:a,monthSelector:o,editions:s,variablesForQuery:t,enabled:c}})} };`}})]})},dx=e=>e?Da.find(t=>e.includes(t)):void 0,fx=e=>e!=null,px=/* @__PURE__ */ `actu-generale.justice.economie.auto.emploi.faits_divers.france.politique.sante.societe.monde.locales.nantes.toulouse.strasbourg.lyon.bordeaux.lille.marseille.montpellier.nice.paris.rennes.elections-municipales.production.publicommunique.magazine`.split(`.`),mx=({pageEndpoint:e,imgEndpoint:t,staticEndpoint:n,data:r,hasSummary:i=!1,layout:a})=>Array.isArray(r)?[]:(r?.brand?.node?.tag?.node?.publishableContents?.edges||[])?.reduce((r,o)=>{if(!o?.node?.title||!o?.node?.label||!o?.node?.url||!o?.node?.medias&&!o?.node?.photo?.node)return r;let s=o?.node?.editorial_model===`ExternalContent`,c=o?.node?.editorial_model===`Story`,l=o.node.medias?o.node.medias.filter(fx):[];c&&o?.node?.photo?.node&&(l=tx({photo:o.node.photo}));let u=o?.node?.editorial_model===`Article`&&!px.includes(o?.node?.rubric?.node?.slug||``);return r.push({layout:a,link:new URL(o.node.url,e).href,title:o.node.short_title||o.node.title,cardImageProps:{cover:ex({medias:l,imgEndpoint:t}),...nx({medias:l,picto:o?.node?.picto,editorialModel:o?.node.editorial_model})},cardHeaderProps:{headline:{text:o.node.label,color:dx(o?.node?.rubric?.node?.themeColor?.node?.slug)},rightSubheader:{text:o.node.published_at||``}},cardTitleProps:{cartridge:o?.node?.editorial_model===`Live`?`live`:void 0},socialBarProps:{layout:a,disableComment:!c&&!o.node.enable_comments,variant:`card`,contentLink:new URL(o.node.url,e).href,commentAnchor:`mbrs-comments-container`,commentCount:o.node.comments_count??0,shareCount:o.node.facebook_count??0,contentId:o.node?.id?.toString(),contentLegacyId:s?void 0:o.node?.legacy_id?.toString(),contentModel:o?.node?.editorial_model||void 0,...u&&{reactionCount:Gs(o.node.reactions_count),reactListItems:Ks(o.node.reactions_count)}},...i&&{summaryProps:{children:o.node.lead}},...s&&n&&o?.node?.contentSource?.node?.name&&o?.node?.contentSource?.node?.logo&&o?.node?.contentSource?.node?.url&&{cardFooterProps:{avatarUrl:new URL(o.node.contentSource.node.logo,n).href,text:o.node.contentSource.node.name,externalLink:o.node.contentSource.node.url}}}),r},[]),hx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r,staticHost:s}=document.body.dataset,l=new Headers;window.envVariables?.apiAuthKey&&l.append(`auth-key`,window.envVariables.apiAuthKey);let u=[{url:`${r}/?id=getTagArticlesWithCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery.brandId,slug:e.defaultVariablesForQuery.slug,first:e.defaultVariablesForQuery.first,after:t}))}`,options:{headers:l}}];try{let e=await du(...u),t=mx({pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,staticEndpoint:s||``,data:e,layout:window.layout}),r={articles:[...a,...t],endCursor:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.endCursor??null,hasNextPage:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.hasNextPage??!1};o(e=>[...e,...t]),n(r.endCursor),i(r.hasNextPage),window?.localStorage.setItem(`aticles-container-data`,JSON.stringify(r)),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}finally{c(!1)}},[a,t,e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.first,e.defaultVariablesForQuery.slug]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{if(cl(),!window?.performance?.getEntriesByType(`navigation`).map(e=>e.type).includes(`back_forward`))window?.localStorage.removeItem(`aticles-container-data`);else{let e=qs(`aticles-container-data`);e&&Object.hasOwn(e,`articles`)&&Object.hasOwn(e,`endCursor`)&&Object.hasOwn(e,`hasNextPage`)&&(o(e.articles),n(e.endCursor),i(e.hasNextPage),nc())}},[]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},gx=({isSSR:e=!0,layout:t,articles:n,variablesForQuery:r,seeMoreButton:i,currentPagePath:a,tagTotalArticles:o,columnsNumber:s})=>{let{isLoading:c,articles:l,hasNextPage:u,onLoadMore:d}=hx({defaultArticles:n,defaultVariablesForQuery:r});W.default.useEffect(()=>{c||Qb()},[c]);let f=l.map(e=>({...e,...e.cardImageProps&&{cardImageProps:{...e.cardImageProps,sizes:`(min-width: 1660px) 384px, (min-width: 1440px) calc(18vw + 89px), (min-width: 1080px) 320px, (min-width: 780px) calc(44.29vw - 149px), calc(50vw - 16px)`}}}));return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Lb,{layout:t,articles:f,isLoading:c,skeletonCount:r.first,seeMoreButton:u?{...i,disabled:c,onClick:d}:void 0,currentPagePath:a,tagTotalArticles:o,columnsNumber:s}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({articleListBottomContainer:{layout:t,articles:f,variablesForQuery:r,seeMoreButton:i,skeletonCount:r.first}})} };`}})]})},_x={storageName:`20mnBreakingNews`,storageDelay:18e4},vx=()=>{let[e,t]=W.default.useState(!1),[n,r]=W.default.useState(qs(_x.storageName));return W.default.useEffect(()=>{n&&localStorage.setItem(_x.storageName,JSON.stringify(n))},[n]),W.default.useEffect(()=>{e&&document&&document.querySelectorAll(`#c-alert-info a`).forEach(e=>{e.addEventListener(`click`,e=>{e.stopPropagation(),e.preventDefault();let t=``;e.target instanceof HTMLAnchorElement?t=e.target.href:e.target instanceof HTMLElement&&(t=e.target.closest(`a`)?.href||``),Z({name:`content`,type:`action`,customProps:{cta_context:`smartbanner_alert`,cta_type:`link`,cta_destination:t,cta_engagement:2}}),window.location.href=t})})},[e]),W.default.useEffect(()=>{if(Object.keys(n??{}).includes(`opened`)&&r(e=>({open:e?.opened??!1,time:e?.time,data:e?.data})),n?.time&&n.time+_x.storageDelay>Date.now()){n.open&&t(!0);return}let{apiHost:e,imgHost:i,brandId:a}=document.body.dataset,o=new Headers;window.envVariables?.apiAuthKey&&o.append(`auth-key`,window.envVariables.apiAuthKey);let s=a?rc(`Brand:${a}`):void 0,c=[{url:`${e}/?id=getBreakingNews&variables=${encodeURIComponent(JSON.stringify({brandId:s}))}`,options:{headers:o}}];du(...c).then(e=>{let a=e?.brand?.node?.home?.node?.homeBreakingNews?.node,o;switch(a?.content?.editorial_model){case`Article`:o=a?.content?.article?.node;break;case`Live`:o=a?.content?.live?.node;break;default:o=void 0}if(!o?.title||!o?.url_current){t(!1);return}let s=a?.custom_title??o.title,c,l=o.medias?.[0]?.photo?.node;if(a?.with_photo&&l?.id){let e=atob(l.id).replace(`Photo:`,``);c=`${i}/${e}/147x96_${l.slug??`media`}`}let u=n&&n.data?.description===s?n.open:!0;r({open:u,time:Date.now(),data:{description:s,url:o.url_current,imageUrl:c}}),t(u)}).catch(e=>{console.error(`20mn> Error while loading the breaking news:`,e)})},[n]),e&&n?.data?/* @__PURE__ */ (0,U.jsx)(bo,{title:`ALERTE INFO`,description:n.data.description,cover:n.data.imageUrl,link:n?.data?.url?{href:n.data.url}:void 0,closeButton:{onClick:()=>{r(e=>({...e||{},open:!1})),t(!1)}}}):null},yx=({pageEndpoint:e,data:t})=>Array.isArray(t)?[]:(t?.brand?.node?.tag?.node?.publishableContents?.edges||[])?.reduce((t,n)=>(!n?.node?.title||!n?.node?.url||t.push({title:n.node.title,url:new URL(n.node.url,e).href}),t),[]),bx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,s=new Headers;window.envVariables?.apiAuthKey&&s.append(`auth-key`,window.envVariables.apiAuthKey);let c=[{url:`${r}/?id=getTagArticlesWithCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery.brandId,slug:e.defaultVariablesForQuery.slug,first:e.defaultVariablesForQuery.first,after:t}))}`,options:{headers:s}}];try{let e=await du(...c),t=yx({pageEndpoint:window.envVariables.pageEndpoint,data:e}),r={articles:[...a,...t],endCursor:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.endCursor??null,hasNextPage:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.hasNextPage??!1};o(e=>[...e,...t]),n(r.endCursor),i(r.hasNextPage),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[a,t,e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.first,e.defaultVariablesForQuery.slug]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},xx=({isSSR:e=!0,articles:t,variablesForQuery:n,seeMoreButton:r,linksSize:i,colsNumber:a})=>{let{isLoading:o,articles:s,hasNextPage:c,onLoadMore:l}=bx({defaultArticles:t,defaultVariablesForQuery:n});return W.default.useEffect(()=>{o||Qb()},[o]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Du,{articles:s,seeMoreButton:c?{...r,disabled:o,onClick:l}:void 0,linksSize:i,colsNumber:a}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsAiArticlesContainer:{articles:s,variablesForQuery:n,seeMoreButton:r,linksSize:i,colsNumber:a}})} };`}})]})},Sx=e=>{let[t,n]=W.default.useState(e.defaultMapConstituenciesProps),r=W.default.useCallback(async()=>{try{let e=await du({url:`https://static.20mn.fr/elections/map-districts.json`});n(t=>({...t,mapDistrictsData:e}))}catch(e){console.error(`20mn> Error while loading map data:`,e)}},[]);return W.default.useEffect(()=>{r(),ri(),qi()},[r]),W.default.useMemo(()=>({mapConstituenciesProps:t}),[t])},Cx=({isSSR:e=!0,mapConstituenciesProps:t,...n})=>{let{mapConstituenciesProps:r}=Sx({defaultMapConstituenciesProps:t});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(zb,{mapConstituenciesProps:e?{electionName:``,electionYear:``,resultsPerDistrict:[],mapDistrictsData:{}}:r,...n}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsConstituenciesMapContainer:{mapConstituenciesProps:t,...n}})} };`}})]})},wx=e=>{let[t,n]=W.default.useState(e.defaultMapDepartmentsProps),r=W.default.useCallback(async()=>{try{let e=await du({url:`https://static.20mn.fr/elections/map-departments.json`});n(t=>({...t,mapDepartmentsData:e}))}catch(e){console.error(`20mn> Error while loading map data:`,e)}},[]);return W.default.useEffect(()=>{r()},[r]),W.default.useMemo(()=>({mapDepartmentsProps:t}),[t])},Tx=({isSSR:e=!0,mapDepartmentsProps:t,...n})=>{let{mapDepartmentsProps:r}=wx({defaultMapDepartmentsProps:t});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Bb,{mapDepartmentsProps:e?{electionName:``,electionYear:``,resultsPerDepartment:[],mapDepartmentsData:{}}:r,...n}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsDepartmentsMapContainer:{mapDepartmentsProps:t,...n}})} };`}})]})},Ex=e=>{let[t,n]=W.default.useState(e.defaultMapEuropeProps),r=W.default.useCallback(async()=>{try{let e=await Promise.all([du({url:`https://static.20mn.fr/elections/map-eu-countries.json`}),du({url:`https://static.20mn.fr/elections/map-non-eu-countries.json`})]);n(t=>({...t,mapEuCountriesData:e[0],mapNonEuCountriesData:e[1]}))}catch(e){console.error(`20mn> Error while loading map data:`,e)}},[]);return W.default.useEffect(()=>{r()},[r]),W.default.useMemo(()=>({mapEuropeProps:t}),[t])},Dx=({isSSR:e=!0,mapEuropeProps:t,...n})=>{let{mapEuropeProps:r}=Ex({defaultMapEuropeProps:t});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Vb,{mapEuropeProps:e?{electionName:``,electionYear:``,resultsPerCountry:[],mapEuCountriesData:{},mapNonEuCountriesData:{}}:r,...n}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsEuropeanMapContainer:{mapEuropeProps:t,...n}})} };`}})]})},Ox=e=>{let[t,n]=W.default.useState(e.defaultMapTownsByDepartmentsProps),r=W.default.useCallback(async()=>{try{let t=await du({url:`https://static.20mn.fr/elections/map-departments-paths.json`}),r=await du({url:`https://static.20mn.fr/elections/map-towns.svg`,options:{headers:{"Content-Type":`image/svg+xml`}}}),i=await du({url:`https://static.20mn.fr/elections/map-droms.json`}),a=[];try{a=await du({url:`https://static.20mn.fr/elections/mn${e.defaultMapTownsByDepartmentsProps.electionYear}/electeds.json`})}catch(e){console.warn(`20mn> Error while loading town results data:`,e)}n(e=>({...e,townsSprite:r,departmentsPaths:t,dromsConfig:i,resultsPerTown:a}))}catch(e){console.error(`20mn> Error while loading town map data:`,e)}},[e.defaultMapTownsByDepartmentsProps.electionYear]);return W.default.useEffect(()=>{r()},[r]),W.default.useMemo(()=>({mapTownsByDepartmentsProps:t}),[t])},kx=({isSSR:e=!0,mapTownsByDepartmentsProps:t,...n})=>{let{mapTownsByDepartmentsProps:r}=Ox({defaultMapTownsByDepartmentsProps:t}),i={layout:t.layout,resultsPerTown:[]};return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Hb,{mapTownsByDepartmentsProps:e?i:r,...n}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsMapTownsByDepartmentsContainer:{mapTownsByDepartmentsProps:t,...n}})} };`}})]})},Ax=({pageEndpoint:e,imgEndpoint:t,data:n,layout:r})=>Array.isArray(n)?[]:(n?.brand?.node?.publishableContents?.edges||[])?.reduce((n,i)=>{if(!i?.node?.title||!i?.node?.label||!i?.node?.url||!i?.node?.medias&&!i?.node?.photo?.node)return n;let a=i?.node?.editorial_model===`Story`,o=i.node.medias?i.node.medias.filter(fx):[];return a&&i?.node?.photo?.node&&(o=tx({photo:i.node.photo})),n.push({link:new URL(i.node.url,e).href,title:i.node.short_title||i.node.title,cardImageProps:{cover:ex({medias:o,imgEndpoint:t}),...nx({medias:o,picto:i?.node?.picto,editorialModel:i?.node.editorial_model})},cardHeaderProps:{headline:{text:i.node.label,color:dx(i?.node?.rubric?.node?.themeColor?.node?.slug)},rightSubheader:{text:i.node.published_at||``}},cardTitleProps:{cartridge:i?.node?.editorial_model===`Live`?`live`:void 0},socialBarProps:{layout:r,disableComment:!a&&!i.node.enable_comments,variant:`card`,contentLink:new URL(i.node.url,e).href,commentAnchor:`mbrs-comments-container`,commentCount:i.node.comments_count??0,shareCount:i.node.facebook_count??0,contentLegacyId:i.node?.legacy_id?.toString()}}),n},[]),jx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,a=new Headers;window.envVariables?.apiAuthKey&&a.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${r}/?id=getUserBackArticlesWithCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery.brandId,userBackId:e.defaultVariablesForQuery.userBackId,first:10,after:t}))}`,options:{headers:a}}];try{let e=await du(...s),t=Ax({pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,data:e,layout:window.layout});o(e=>[...e,...t]),n(e?.brand?.node?.publishableContents?.pageInfo?.endCursor||null),i(e?.brand?.node?.publishableContents?.pageInfo?.hasNextPage||!1),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[t,e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.userBackId]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},Mx=({isSSR:e=!0,layout:t,articles:n,variablesForQuery:r,seeMoreButton:i,currentPagePath:a,tagTotalArticles:o,columnsNumber:s,heading:c})=>{if(n.length===0)return null;let{isLoading:l,articles:u,hasNextPage:d,onLoadMore:f}=jx({defaultArticles:n,defaultVariablesForQuery:r});W.default.useEffect(()=>{l||Qb()},[l]);let p=u.map(e=>({...e,...e.cardImageProps&&{cardImageProps:{...e.cardImageProps,sizes:`(min-width: 1660px) 384px, (min-width: 1440px) calc(18vw + 89px), (min-width: 1080px) 320px, (min-width: 780px) calc(44.29vw - 149px), calc(50vw - 16px)`}}}));return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Lb,{layout:t,articles:p,seeMoreButton:d?{...i,disabled:l,onClick:f}:void 0,currentPagePath:a,tagTotalArticles:o,columnsNumber:s,heading:c}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({journalistArticleListContainer:{layout:t,articles:p,variablesForQuery:r,seeMoreButton:i,heading:c}})} };`}})]})},Nx=new Intl.DateTimeFormat(`fr`,{timeStyle:`short`,timeZone:`Europe/Paris`}),Px=({layout:e,pageEndpoint:t,imgEndpoint:n,data:r})=>Array.isArray(r)?[]:(r?.brand?.node?.publishableContents?.edges||[])?.reduce((r,i)=>{if(!i?.node?.title||!i?.node?.label||!i?.node?.url||!i?.node?.published_at||!i?.node?.medias&&!i?.node?.photo?.node)return r;let a=i.node.medias??[];return i?.node?.editorial_model===`Story`&&i?.node?.photo?.node&&(a=tx({photo:i.node.photo})),r.push({link:new URL(i.node.url,t).href,title:i.node.short_title||i.node.title,cardImageProps:{cover:ex({medias:a,imgEndpoint:n}),...nx({medias:a,picto:i?.node?.picto,editorialModel:i?.node.editorial_model})},socialBarProps:{layout:e,commentCount:i.node.comments_count??0,shareCount:(i.node.facebook_count??0)+(i.node.pinterest_count??0),contentLegacyId:i.node?.legacy_id?.toString(),contentLink:new URL(i.node.url,t).href,commentAnchor:`mbrs-comments-container`},cardHeaderProps:{headline:{text:i.node.label,color:dx(i?.node?.rubric?.node?.themeColor?.node?.slug)},liveTime:Nx.format(new Date(i.node.published_at).getTime()).replace(`:`,`h`)},cardTitleProps:{cartridge:i?.node?.editorial_model===`Live`?`live`:void 0},summaryProps:{children:i?.node?.lead??``},layout:e}),r},[]),Fx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,a=new Headers;window.envVariables?.apiAuthKey&&a.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${r}/?id=getLatestContentsCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery.brandId,sourceExcluded:e.defaultVariablesForQuery.sourceExcluded,first:e.defaultVariablesForQuery.first,after:t}))}`,options:{headers:a}}];try{let e=await du(...s),t=Px({layout:window.layout,pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,data:e});o(e=>[...e,...t]),n(e?.brand?.node?.publishableContents?.pageInfo?.endCursor??null),i(e?.brand?.node?.publishableContents?.pageInfo?.hasNextPage??!1),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[t,e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.first,e.defaultVariablesForQuery.sourceExcluded]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useEffect(()=>{ul()},[]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},Ix=({isSSR:e=!0,layout:t,articles:n,variablesForQuery:r,seeMoreButton:i})=>{let{isLoading:a,articles:o,hasNextPage:s,onLoadMore:c}=Fx({defaultArticles:n,defaultVariablesForQuery:r});return W.default.useEffect(()=>{a||Qb()},[a]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Db,{layout:t,articles:o,seeMoreButton:s?{...i,disabled:a,onClick:c}:void 0}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({latestArticlesContainer:{layout:t,articles:o,variablesForQuery:r,seeMoreButton:i}})} };`}})]})},Lx=({layout:e,pageEndpoint:t,imgEndpoint:n,data:r})=>Array.isArray(r)?[]:(r?.brand?.node?.publishableContents?.edges||[])?.reduce((r,i)=>{if(!i?.node?.title||!i?.node?.url||!i?.node?.medias||!i?.node?.rubric?.node?.label||!(i?.node?.medias.length||i?.node?.photo?.node))return r;let a=i.node.medias??[];return i?.node?.editorial_model===`Story`&&i?.node?.photo?.node&&(a=tx({photo:i.node.photo})),r.push({link:new URL(i.node.url,t).href,title:i.node.short_title||i.node.title,cardImageProps:{cover:ex({medias:a,imgEndpoint:n}),...nx({medias:a,picto:i?.node?.picto,editorialModel:i?.node.editorial_model}),lazyLoad:!0},cardHeaderProps:{headline:{text:i?.node?.label||i.node.rubric.node.label,color:dx(i?.node?.rubric?.node?.themeColor?.node?.slug)}},cardTitleProps:{cartridge:i?.node?.editorial_model===`Live`?`live`:void 0,as:`h3`},layout:e}),r},[]),Rx=e=>{let[t,n]=W.default.useState(e.defaultArticles),r=W.default.useCallback(async()=>{let{apiHost:t}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let i=[{url:`${t}/?id=getLatestContentsCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.variablesForQuery.brandId,sourceExcluded:e.variablesForQuery.sourceExcluded,first:e.variablesForQuery.first}))}`,options:{headers:r}}];try{let e=await du(...i),t=Lx({layout:window.layout,data:e,pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint});n(t)}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[e.variablesForQuery.brandId,e.variablesForQuery.first,e.variablesForQuery.sourceExcluded]);return W.default.useEffect(()=>{r()},[r]),W.default.useMemo(()=>({articles:t}),[t])},zx=({isSSR:e=!0,articles:t,variablesForQuery:n,...r})=>{let{articles:i}=Rx({defaultArticles:t,variablesForQuery:n});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Fb,{...r,articles:i,variablesForQuery:n}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({latestContentsCarouselContainer:{articles:t,variablesForQuery:n,...r}})} };`}})]})},Bx=e=>{let t=[];return e.legalNotices.forEach(n=>{let r=n?.node;t.push({link:r?.external_id?new URL(`/al/${r?.external_id}`,e.legalNoticeEndpoint).href:``,title:r?.title??void 0,location:r?.legalNoticeDepartment?.node?.name||``,summaryProps:{children:r?.publishing_date?`Publié le ${Bs(new Date(r.publishing_date),!1)}`:Vs(new Date(Date.now()).toLocaleString())},cardTitleProps:{...r?.external_id?{as:`a`,href:new URL(`/al/${r?.external_id}`,e.legalNoticeEndpoint).href,className:`opacity-hover`}:{}}})}),t},Vx=e=>e!=null,Hx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.legalNotices),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,a=new Headers;window.envVariables?.apiAuthKey&&a.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${r}/?id=getLegalNoticesFromDept&variables=${encodeURIComponent(JSON.stringify({slug:e.defaultVariablesForQuery.slug,first:10,after:t}))}`,options:{headers:a}}];try{let e=await du(...s),t=e?.legalNotices?.edges?.filter(Vx)??[],r=Bx({legalNotices:t,legalNoticeEndpoint:window.location.origin});o(e=>[...e,...r]),n(e?.legalNotices?.pageInfo?.endCursor||null),i(e?.legalNotices?.pageInfo?.hasNextPage||!1),nc()}catch(e){console.error(`20mn> Error while loading annnouncements:`,e)}},[t,e.defaultVariablesForQuery.slug]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,legalNotices:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},Ux=({isSSR:e=!0,variablesForQuery:t,legalNotices:n})=>{let{isLoading:r,legalNotices:i,hasNextPage:a,onLoadMore:o}=Hx({legalNotices:n,defaultVariablesForQuery:t});return W.default.useEffect(()=>{r||Qb()},[r]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Ob,{legalNotices:i,seeMoreLegalNotices:a?{disabled:r,onClick:o,children:`Voir plus d’annonces légales`}:void 0,mx:{xs:`m`,md:`0`}}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({legalNoticeDepartmentContainer:{legalNotices:i,variablesForQuery:t}})} };`}})]})},Wx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.legalNotices),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:e}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let a=[{url:`${e}/?id=getLegalNotices&variables=${encodeURIComponent(JSON.stringify({first:10,after:t}))}`,options:{headers:r}}];try{let e=await du(...a),t=e?.legalNotices?.edges?.filter(Vx)??[],r=Bx({legalNotices:t,legalNoticeEndpoint:window.location.origin});o(e=>[...e,...r]),n(e?.legalNotices?.pageInfo?.endCursor||null),i(e?.legalNotices?.pageInfo?.hasNextPage||!1),nc()}catch(e){console.error(`20mn> Error while loading annnouncements:`,e)}},[t]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,legalNotices:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},Gx=({isSSR:e=!0,variablesForQuery:t,legalNotices:n})=>{let{isLoading:r,legalNotices:i,hasNextPage:a,onLoadMore:o}=Wx({legalNotices:n,defaultVariablesForQuery:t});return W.default.useEffect(()=>{r||Qb()},[r]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Ob,{legalNotices:i,seeMoreLegalNotices:a?{disabled:r,onClick:o,children:`Voir plus d’annonces légales`}:void 0,mx:{xs:`m`,md:`0`}}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({legalNoticeHomeContainer:{legalNotices:i,variablesForQuery:t}})} };`}})]})},Kx=e=>{let t=new Intl.DateTimeFormat(`fr`,{timeStyle:`short`,timeZone:`Europe/Paris`});return{name:e.name,title:e.title,tabColor:e.tabColor,body:e.articleEdges.reduce((n,r)=>{if(r?.node?.title&&r?.node?.url&&r?.node?.rubric?.node?.slug&&r?.node?.rubric?.node?.label){let i;if(e.imgEndpoint){let t=r.node.medias??[];r?.node?.editorial_model===`Story`&&r?.node?.photo?.node&&(t=tx({photo:r.node.photo})),i={cover:ex({medias:t,imgEndpoint:e.imgEndpoint}),lazyLoad:!0}}let a={themeColor:r.node.rubric.node.themeColor?.node?.lightmode_color||void 0,rubricName:r?.node?.label||r.node.rubric.node.label,title:r?.node?.short_title||r.node.title,url:new URL(r.node.url,e.pageEndpoint).href,cartridge:r.node?.editorial_model===`Live`&&r.node?.state===`open`?`live`:void 0,...i?{cardImageProps:i}:{}};e.name===`le-direct`&&r?.node?.published_at&&(a.liveTime=t.format(new Date(r.node.published_at).getTime()).replace(`:`,`h`)),n.push(a)}return n},[]).slice(0,e.limit)}},qx=({data:e,pageEndpoint:t,liveLimit:n,mostReadLimit:r})=>{if(Array.isArray(e))return[];let i=e?.brand?.node,a=i?.mostReadArticles?.edges,o=i?.liveArticles?.edges,s=[];if(o?.length){let e=Kx({name:`le-direct`,title:`Le direct`,pageEndpoint:t,articleEdges:o,limit:n,tabColor:`red`});s.push(e)}if(a?.length){let e=Kx({name:`plus-lus`,title:`Les + lus`,pageEndpoint:t,articleEdges:a,limit:r});s.push(e)}return s},Jx=e=>{let[t,n]=W.default.useState(e.defaultTabItems),r=W.default.useCallback(async()=>{if(e.variablesForQuery.liveLimit&&e.variablesForQuery.mostReadLimit){let{apiHost:t}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let i=[{url:`${t}/?id=getLiveAndMostRead&variables=${encodeURIComponent(JSON.stringify({brandId:e.variablesForQuery.brandId,sourceExcluded:e.variablesForQuery.sourceExcluded,mostReadSourceExcluded:e.variablesForQuery.mostReadSourceExcluded,liveLimit:e.variablesForQuery.liveLimit,mostReadLimit:e.variablesForQuery.mostReadLimit}))}`,options:{headers:r}}];try{let t=await du(...i),r=qx({data:t,pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,liveLimit:e.variablesForQuery.liveLimit,mostReadLimit:e.variablesForQuery.mostReadLimit});n(r),ri()}catch(e){console.error(`20mn> Error while loading tabItems:`,e)}}},[e.variablesForQuery.brandId,e.variablesForQuery.liveLimit,e.variablesForQuery.mostReadLimit,e.variablesForQuery.sourceExcluded,e.variablesForQuery.mostReadSourceExcluded]);return W.default.useEffect(()=>{r()},[r]),W.default.useMemo(()=>({tabItems:t}),[t])},Yx=({isSSR:e=!0,layout:t,tabItems:n,variablesForQuery:r,...i})=>{let{tabItems:a}=Jx({defaultTabItems:n,variablesForQuery:r});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(qb,{...i,layout:t,tabItems:a,variablesForQuery:r,hasButton:!0}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({liveAndMostReadContainer:{layout:t,tabItems:n,variablesForQuery:r}})} };`}})]})},Xx=()=>{window.didomiOnReady=window.didomiOnReady||[],window.didomiOnReady.push(e=>{let t=Array.from(document.getElementsByClassName(`embed-placeholder`)),n=e.getCurrentUserStatus(),r=n?.purposes?.[`activation-gGierZpp`]?.enabled;t.forEach(e=>{let t=e.querySelector(`.cmp-placeholder`),i=e.querySelector(`.embed-wrapper`);t instanceof Element&&i instanceof Element&&(r&&(n?.vendors[e.getAttribute(`data-vendor`)||``]?.enabled??!0)?(t.classList.add(`u-hidden`),i.classList.remove(`u-hidden`),i.querySelectorAll(`[data-src]`).forEach(e=>{let t=e.getAttribute(`data-src`);t&&(e.setAttribute(`src`,t),e.removeAttribute(`data-src`))})):(t.classList.remove(`u-hidden`),i.classList.add(`u-hidden`)))})})},Zx=()=>{let e=Array.from(document.querySelectorAll(`[data-script-loading="lazy"]`));e.length>0&&(e.forEach(e=>{let t=document.createElement(`script`);t.type=`text/javascript`,t.innerHTML=e.innerHTML.replace(/"|&/g,e=>e===`"`?`"`:`&`),t.innerHTML=t.innerHTML.replace(/'/g,`'`),e.after(t),e.remove()}),Xx())},Qx=[`pave_haut`,`pave_milieu`,`pave_bas`,`pave_com`,`native_web`,`banniere_milieu`],$x={firstSlotId:`inarticle1`,secondSlotId:`inarticle2`,duplicateSlotPrefix:`inarticle3`},eS=()=>{Qx.forEach(e=>{let t=`#${e}`,n=[...document.querySelectorAll(t)].filter(e=>e instanceof HTMLElement);for(let t=1;t<=20;t+=1){let r=document.getElementById(`${e}_${t}`);r&&n.push(r)}let r=1;n.length>1&&n.forEach(t=>{t.id=`${e}_${r}`,r+=1})})},tS=()=>{let{firstSlotId:e,secondSlotId:t,duplicateSlotPrefix:n}=$x,r=[...document.querySelectorAll(`#${e}, #${t}, [id^="${n}"]`)],i=!1,a=!1,o=1;r.forEach(r=>{let s=r.id===e,c=r.id===t;s&&!i?(r.id=e,i=!0):c&&!a?(r.id=t,a=!0):(r.id=`${n}_${o}`,o+=1)})},nS=()=>{eS(),tS()},rS=e=>{switch(e){case`default`:case`important`:case`community`:case`faq`:case`bold`:return e;case`very_important`:return`crucial`;default:return`default`}},iS=(e,t)=>Array.isArray(e)?[]:(e?.brand?.node?.live?.node?.livePosts?.edges||[])?.reduce((e,n)=>{if(!n)return e;let r=n?.node?.content_md?.blocks;if(r){let e=[...r],t=e?.slice(-1);t?.[0]?.text===``&&t?.[0]?.type===`unstyled`&&(e.pop(),r=e)}let i;n?.node?.comment?.node&&(i={question:n.node.comment.node.content||``,author:n.node.comment.node.userFront?.node?.username||``,response:r?.[0]?.text});let a=n.node?.legacy_id;return a&&e.push({cursor:n?.cursor||null,id:a,title:{status:rS(n?.node?.type),header:n?.node?.printed_hour||``,title:n?.node?.title||``,img:n?.node?.livePostLabel?.node&&t?{name:n.node.livePostLabel.node.slug||``,src:n.node.livePostLabel.node.logo?`${t}/${n.node.livePostLabel.node.logo}`:``}:void 0},content:i?void 0:{entityMap:{},...n?.node?.content_md,blocks:r??[]},talk:i}),e},[]),aS=e=>{e.some(({content:e})=>Object.values(e?.entityMap||{}).some(({type:e,data:t})=>e===`iframely`&&t?.embedProps?.meta?.site===`idalgo`&&t?.embedProps?.meta?.type===`widget`))&&(window?.iDalgoLoader?window.iDalgoLoader.init():vl({name:`widget_live-posts`,src:`https://20minutes.idalgo-hosting.com/partners/i/cache/datasport/cache/page/r_js_jlu_url.php`,load:`async`}))},oS=e=>{let t=e.filter(({content:e})=>Object.values(e?.entityMap||{}).some(({type:e,data:t})=>e===`iframely`&&(t?.embedProps?.js||t?.embedProps?.css)));t.length&&t.forEach(({content:e})=>{Object.values(e?.entityMap||{}).forEach(({type:e,data:t})=>{if(e===`iframely`&&(t?.embedProps?.js||t?.embedProps?.css)){let{js:e=[],css:n=[]}=t?.embedProps||{};e.length&&e.forEach((e,t)=>{vl({name:`embed_live-posts-${t}`,src:e,load:`async`})}),n.length&&n.forEach(e=>{let t=document.createElement(`link`);t.type=`text/css`,t.rel=`stylesheet`,t.href=e,document.head.appendChild(t)})}})})},sS=()=>{let{hash:e}=new URL(window.location.href),t=e.match(/#post-(\d+)/);return t?Number(t[1]):null},cS=async({first:e,after:t,filter:n,brandId:r,liveId:i})=>{let{apiHost:a}=document.body.dataset,o=new Headers;window.envVariables?.apiAuthKey&&o.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${a}/?id=getLivePosts&variables=${encodeURIComponent(JSON.stringify({brandId:r,liveId:i,first:e,after:t,filter:n}))}`,options:{headers:o}}],c=await du(...s);return{nextPosts:iS(c,document.body.dataset.staticHost),pageInfo:c?.brand?.node?.live?.node?.livePosts?.pageInfo??null}},lS=async({batchSize:e,after:t,filter:n,brandId:r,liveId:i,accumulatedPosts:a,anchorPostId:o})=>{let{nextPosts:s,pageInfo:c}=await cS({first:100,after:t,filter:n,brandId:r,liveId:i}),l=[...a,...s],u=c?.endCursor??null,d=c?.hasNextPage??!1,f=l.findIndex(e=>e.id===o);if(f!==-1){let t=Math.ceil((f+1)/e)*e,n=t>l.length?l[l.length-1].cursor:l[t-1].cursor,r=l.length>t||d;return{nextPosts:l.slice(0,t),pageInfo:{endCursor:n,hasNextPage:r}}}return d&&u?lS({batchSize:e,after:t,filter:n,brandId:r,liveId:i,accumulatedPosts:l,anchorPostId:o}):{nextPosts:[],pageInfo:c}},uS=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultPosts),[s,c]=W.default.useState(!1),[l,u]=W.default.useState(!1),d=W.default.useCallback(()=>{c(!0)},[]),f=W.default.useCallback(async()=>{let r=sS(),a=e.defaultVariablesForQuery.first,{filter:s,brandId:c,liveId:d}=e.defaultVariablesForQuery;try{if(r&&!l&&s?.type?.eq!==`very_important`){let{nextPosts:e}=await lS({batchSize:a,after:t,filter:s,brandId:c,liveId:d,accumulatedPosts:[],anchorPostId:r});o(t=>[...t,...e]),u(!!r),oS(e)}else{let{nextPosts:e,pageInfo:r}=await cS({first:a,after:t,filter:s,brandId:c,liveId:d});n(r?.endCursor??null),i(r?.hasNextPage??!1),o(t=>[...t,...e]),oS(e)}nc()}catch(e){console.error(`20mn> Error while loading posts:`,e)}},[t,l,e.defaultVariablesForQuery]);return W.default.useEffect(()=>{sS()&&!document.getElementById(`post-${sS()}`)&&c(!0)},[]),W.default.useEffect(()=>{document.querySelector(`#tabpanel-le-direct #post-${sS()}`)?.scrollIntoView({behavior:`smooth`,block:`start`})},[]),W.default.useEffect(()=>{s&&f(),aS(a),nS(),Xx()},[s,f,a]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useEffect(()=>{nS()},[]),W.default.useMemo(()=>({isLoading:s,posts:a,hasNextPage:r,onLoadMore:d}),[s,a,r,d])},dS=({isSSR:e=!0,posts:t,variablesForQuery:n,seeMoreLink:r,staticHydrationDataName:i=`livePostsContainer`,disableAds:a,...o})=>{let{isLoading:s,posts:c,hasNextPage:l,onLoadMore:u}=uS({defaultPosts:t,defaultVariablesForQuery:n});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Gb,{...o,posts:c,variablesForQuery:n,disableAds:a,seeMoreLink:l?{...r,disabled:s,onClick:u}:void 0}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({[i]:{posts:Zs(c),variablesForQuery:n,seeMoreLink:r,disableAds:a,...o}})} };`}})]})},fS=()=>{let[e,t]=W.default.useState(null),[n,r]=W.default.useState(0),i=document.getElementById(`tabpanel-le-direct`),a=document.getElementById(`tabpanel-temps-forts`),o=window.__staticHydrationData?.livePostsContainer,s=W.default.useRef(o?.refreshButton?.latestPostId.toString()),c=o?.refreshButton?.state,{brandId:l,liveId:u}=o?.variablesForQuery??{},d=W.default.useCallback(()=>{let{apiHost:e}=document.body.dataset,t=new Headers;return window.envVariables?.apiAuthKey&&t.append(`auth-key`,window.envVariables.apiAuthKey),[{url:`${e}/?id=getLivePosts&variables=${encodeURIComponent(JSON.stringify({brandId:l,liveId:u,first:20,filter:{status:{eq:`published`}}}))}`,options:{headers:t}}]},[l,u]),f=W.default.useCallback(async()=>{let e=d();try{let t=await du(...e),n=0;t?.brand?.node?.live?.node?.livePosts?.edges?.every(e=>e?.node?.legacy_id!==Number(s.current)&&(n+=1,!0)),r(n)}catch(e){console.error(`20mn> Error while refreshing refresh button counter:`,e)}},[d]),p=W.default.useCallback(()=>{let e=document.querySelector(`[data-tabs-name="live-tabs"]`),t=document.getElementById(`tab-le-direct`),n=document.getElementById(`tabpanel-le-direct`);if(e){let r=e.querySelectorAll(`.c-tab`),i=e.querySelectorAll(`.c-tabpanel`);r.forEach(e=>{e.setAttribute(`aria-selected`,`false`),e.setAttribute(`tabindex`,`-1`)}),i.forEach(e=>{e.setAttribute(`aria-hidden`,`true`)}),t&&(t.setAttribute(`aria-selected`,`true`),t.setAttribute(`tabindex`,`0`)),n&&n.setAttribute(`aria-hidden`,`false`)}},[]),m=W.default.useCallback(async()=>{p();let e=d();try{let t=[],n=[],r=await du(...e),o=iS(r,document.querySelector(`body`)?.dataset.staticHost),c=0;if(o?.every(e=>e.id.toString()!==s.current&&(c+=1,!0)),c===0){window.location.reload();return}p();let l=document.getElementById(`tabpanel-le-direct`)?.querySelectorAll(`.js-post`).length||0,u=l+c;o=o.slice(0,c),o.reverse(),o?.every((e,r)=>{let i=r+l,a=em.renderToStaticMarkup(/* @__PURE__ */ (0,U.jsx)(Wb,{post:e,postIndex:i,postsCount:u,layout:window.layout,pageEndpoint:window.envVariables.pageEndpoint},e.id));return t.push(a),e.title.status===`crucial`&&n.push(a),!0});let d=a?.firstChild;if(d instanceof HTMLElement&&d.firstChild instanceof HTMLElement){let e=document.createElement(`div`);for(e.innerHTML=n.reverse().join(``);e.lastChild;)d.prepend(e.lastChild)}let f=i?.firstChild;if(f instanceof HTMLElement&&f.firstChild instanceof HTMLElement){let e=document.createElement(`div`);for(e.innerHTML=t.reverse().join(``);e.lastChild;)f.prepend(e.lastChild);let n=o.reverse()[0];n&&(s.current=n.id.toString()),nS(),nc()}}catch(e){console.error(`20mn> Error while loading more live posts:`,e)}},[d,a,i,p]);W.default.useEffect(()=>{c===`open`&&l&&s.current&&u?setInterval(f,6e4):console.info(`Do not check for new post, live is either closed or miss information.`)},[f,l,u,c]),W.default.useEffect(()=>{if(t(n>0?`Actualiser (${n})`:`Actualiser`),window.layout!==Y.MOBILE){let e=document.title.replace(/^\(\+?[0-9]+\) /,``);n>9?document.title=`(+${n}) ${e}`:n>0?document.title=`(${n}) ${e}`:document.title=e}},[n]);let h=W.default.useCallback(()=>{Z({name:`refresh_content`,type:`action`,customProps:{cta_context:`content`,cta_type:`button`,cta_destination:window.location.href,cta_engagement:1},chapter1:`live`}),m().then(()=>{r(0);let e=document.getElementById(`live-posts-container`)?.getBoundingClientRect();e&&window.scrollBy(0,e.top-100)})},[m]);return e&&l&&u&&s.current?/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,mb:`xxl`,children:/* @__PURE__ */ (0,U.jsx)(ka,{color:`primary`,variant:`outlined`,iconProps:{name:`refresh`,size:22},onClick:h,children:e})}):null},pS=()=>[{title:`Ain`,value:`ain`},{title:`Aisne`,value:`aisne`},{title:`Allier`,value:`allier`},{title:`Alpes-de-Haute-Provence`,value:`alpes_de_haute_provence`},{title:`Alpes-Maritimes`,value:`alpes-maritimes`},{title:`Ardèche`,value:`ardeche`},{title:`Ardennes`,value:`ardennes`},{title:`Ariège`,value:`ariege`},{title:`Aube`,value:`aube`},{title:`Aude`,value:`aude`},{title:`Aveyron`,value:`aveyron`},{title:`Bas-Rhin`,value:`bas_rhin`},{title:`Bouches-du-Rhône`,value:`bouches-rhone`},{title:`Calvados`,value:`calvados`},{title:`Cantal`,value:`cantal`},{title:`Charente`,value:`charente`},{title:`Charente-Maritime`,value:`charente-maritime`},{title:`Cher`,value:`cher`},{title:`Correze`,value:`correze`},{title:`Corse-du-Sud`,value:`corse-sud`},{title:`Côte-d'Or`,value:`cote_d_or`},{title:`Côtes-d'Armor`,value:`cotes_d_armor`},{title:`Creuse`,value:`creuse`},{title:`Deux-Sèvres`,value:`deux-sevres`},{title:`Dordogne`,value:`dordogne`},{title:`Doubs`,value:`doubs`},{title:`Drôme`,value:`drome`},{title:`Essonne`,value:`essonne`},{title:`Eure`,value:`eure`},{title:`Eure-et-Loir`,value:`eure_et_loire`},{title:`Finistère`,value:`finistere`},{title:`Gard`,value:`gard`},{title:`Gers`,value:`gers`},{title:`Gironde`,value:`gironde`},{title:`Guadeloupe`,value:`guadeloupe`},{title:`Guyane`,value:`guyane`},{title:`Haut-Rhin`,value:`haut-rhin`},{title:`Haute-Corse`,value:`haute-corse`},{title:`Haute-Garonne`,value:`haute-garonne`},{title:`Haute-Loire`,value:`haute-loire`},{title:`Haute-Marne`,value:`haute-marne`},{title:`Haute-Saône`,value:`haute-saone`},{title:`Haute-Vienne`,value:`haute-vienne`},{title:`Hautes-Alpes`,value:`hautes-alpes`},{title:`Hautes-Pyrénées`,value:`hautes_pyrenees`},{title:`Hauts-de-Seine`,value:`hauts-de-seine`},{title:`Hérault`,value:`herault`},{title:`Ille-et-Vilaine`,value:`ille_et_vilaine`},{title:`Indre`,value:`indre`},{title:`Indre-et-Loire`,value:`indre-loire`},{title:`Isère`,value:`isere`},{title:`Jura`,value:`jura`},{title:`Landes`,value:`landes`},{title:`Loir-et-Cher`,value:`loir-cher`},{title:`Loire`,value:`loire`},{title:`Loire-Atlantique`,value:`loire-atlantique`},{title:`Loiret`,value:`loiret`},{title:`Lot`,value:`lot`},{title:`Lot-et-Garonne`,value:`lot_et_garonne`},{title:`Lozère`,value:`lozere`},{title:`Maine-et-Loire`,value:`maine-et-loire`},{title:`Manche`,value:`manche`},{title:`Marne`,value:`marne`},{title:`Martinique`,value:`martinique`},{title:`Mayenne`,value:`mayenne`},{title:`Mayotte`,value:`mayotte`},{title:`Meurthe-et-Moselle`,value:`meurthe-et-moselle`},{title:`Meuse`,value:`meuse`},{title:`Morbihan`,value:`morbihan`},{title:`Moselle`,value:`moselle`},{title:`Nièvre`,value:`nievre`},{title:`Nord`,value:`nord`},{title:`Oise`,value:`oise`},{title:`Orne`,value:`orne`},{title:`Paris`,value:`paris`},{title:`Pas-de-Calais`,value:`pas-de-calais`},{title:`Puy de Dôme`,value:`puy-dome`},{title:`Pyrénées-Atlantiques`,value:`pyrenees-atlantiques`},{title:`Pyrénées-Orientales`,value:`pyrenees_orientales`},{title:`Rhône`,value:`rhone`},{title:`Saône-et-Loire`,value:`saone_et_loire`},{title:`Sarthe`,value:`sarthe`},{title:`Savoie`,value:`savoie`},{title:`Seine-et-Marne`,value:`seine-et-marne`},{title:`Seine-Maritime`,value:`seine_maritime-1`},{title:`Seine-Saint-Denis`,value:`seine-saint-denis`},{title:`Somme`,value:`somme`},{title:`Tarn`,value:`tarn`},{title:`Tarn-et-Garonne`,value:`tarn_et_garonne`},{title:`Territoire de Belfort`,value:`territoire-belfort`},{title:`Val-d'Oise`,value:`val_d_oise`},{title:`Val-de-Marne`,value:`val-de-marne`},{title:`Var`,value:`var`},{title:`Vaucluse`,value:`vaucluse`},{title:`Vendée`,value:`vendee`},{title:`Vienne`,value:`vienne-france`},{title:`Vosges`,value:`vosges`},{title:`Yonne`,value:`yonne`},{title:`Yvelines`,value:`yvelines`}],mS=e=>{let t;return e?.forEach(e=>{let n=pS().find(t=>t.value===e?.node?.slug);n&&(t=n)}),t?t.title:``},hS=({data:e,pageEndpoint:t,layout:n})=>(e?.brand?.node?.tag?.node?.publishableContents?.edges||[])?.reduce((e,r)=>{if(r?.node?.rubric?.node?.label&&r?.node?.title&&r?.node?.url&&r?.node?.tags?.edges){let i=r.node.tags.edges.filter(fx);e.push({link:new URL(r.node.url,t).href,title:$s(r?.node?.short_title||r.node.title),cardHeaderProps:{headline:{text:r?.node?.label||r.node.rubric.node.label},location:mS(i)},socialBarProps:{layout:n,commentCount:r.node?.comments_count??0,shareCount:(r.node?.facebook_count??0)+(r.node?.pinterest_count??0),contentLegacyId:r.node?.legacy_id?.toString()}})}return e},[]),gS=e=>{let[t,n]=W.default.useState(e.defaultArticles),[r,i]=W.default.useState(!1),[a,o]=W.default.useState(`locales`),[s,c]=W.default.useState(e.defaultSeeMoreLink.href),l=W.default.useCallback(e=>{o(e.target.value),i(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:t}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let i=[{url:`${t}/?id=getHomeLocalNews&variables=${encodeURIComponent(JSON.stringify({...e.variablesForQuery,slug:a}))}`,options:{headers:r}}];try{let e=await du(...i),t=hS({data:e,pageEndpoint:window.envVariables.pageEndpoint,layout:window.layout});c(new URL(e?.brand?.node?.tag?.node?.url_current??``,window.envVariables.pageEndpoint).href),n(t)}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[e.variablesForQuery,a]);return W.default.useEffect(()=>{r&&u()},[r,u]),W.default.useEffect(()=>{r&&i(!1),Hc()},[r]),W.default.useMemo(()=>({isLoading:r,articles:t,tagUrl:s,onDepartmentChange:l}),[t,r,s,l])},_S=({isSSR:e=!0,articles:t,variablesForQuery:n,seeMoreLink:r,selectProps:i,...a})=>{let{isLoading:o,articles:s,tagUrl:c,onDepartmentChange:l}=gS({defaultArticles:t,defaultSeeMoreLink:r,variablesForQuery:n});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Ub,{...a,articles:s,variablesForQuery:n,seeMoreLink:{href:c},selectProps:{...i,disabled:o,onChange:l}}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({localNewsContainer:{articles:s,variablesForQuery:n,selectProps:i,seeMoreLink:r,...a}})} };`}})]})},vS=({layout:e,pageEndpoint:t,imgEndpoint:n,data:r,lastNumber:i=0})=>Array.isArray(r)?[]:(r?.brand?.node?.publishableContents?.edges||[])?.reduce((r,a,o)=>{if(!a?.node?.title||!a?.node?.label||!a?.node?.url||!a?.node?.published_at||!a?.node?.medias&&!a?.node?.photo?.node)return r;let s=a.node.medias??[];return a?.node?.editorial_model===`Story`&&a?.node?.photo?.node&&(s=tx({photo:a.node.photo})),r.push({link:new URL(a.node.url,t).href,title:a.node.title,cardImageProps:{cover:ex({medias:s,imgEndpoint:n})},cardHeaderProps:{headline:{text:a.node.label}},cardTitleProps:{cartridge:a?.node?.editorial_model===`Live`?`live`:void 0},summaryProps:{children:a?.node?.lead??``},layout:e,cardNumber:{value:i+o+1,size:`medium`},viewCount:a?.node?.total_current_visits||0}),r},[]),yS=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[r,i]=W.default.useState(e.defaultItems),[a,o]=W.default.useState(!1),s=W.default.useCallback(()=>{o(!0)},[]),c=W.default.useCallback(async()=>{let{apiHost:t}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let a=[{url:`${t}/?id=getMostReadContents&variables=${encodeURIComponent(JSON.stringify({first:e.defaultVariablesForQuery.first,brandId:e.defaultVariablesForQuery.brandId,excludeModel:e.defaultVariablesForQuery.excludeModel,sourceExcluded:e.defaultVariablesForQuery.sourceExcluded,after:e.defaultVariablesForQuery.endCursor}))}`,options:{headers:r}}];try{let t=await du(...a),r=vS({layout:window.layout,pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,data:t,lastNumber:e.defaultVariablesForQuery.first});i(e=>[...e,...r||[]]),n(!1),nc()}catch(e){console.error(`20mn> Error while loading contents:`,e)}},[e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.endCursor,e.defaultVariablesForQuery.excludeModel,e.defaultVariablesForQuery.first,e.defaultVariablesForQuery.sourceExcluded]);return W.default.useEffect(()=>{a&&c()},[a,c]),W.default.useEffect(()=>{a&&o(!1)},[a]),W.default.useMemo(()=>({isLoading:a,items:r,hasNextPage:t,onLoadMore:s}),[a,r,t,s])},bS=({isSSR:e=!0,items:t,variablesForQuery:n,seeMoreButton:r})=>{let{isLoading:i,items:a,hasNextPage:o,onLoadMore:s}=yS({defaultItems:t,defaultVariablesForQuery:n});return W.default.useEffect(()=>{i||Qb()},[i]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Kb,{items:a,seeMoreButton:o?{...r,disabled:i,onClick:s}:void 0}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({mainMostReadContainer:{items:a,variablesForQuery:n,seeMoreButton:r}})} };`}})]})},xS=({data:e,pageEndpoint:t,imgEndpoint:n,rubricSlug:r,rubricLabel:i})=>{if(Array.isArray(e))return[];let a=[],o=e?.brand?.node,s=o?.commonArticles?.edges,c=o?.rubricArticles?.edges;if(s?.length){let e=Kx({name:`plus-lus`,title:`Les + lus`,pageEndpoint:t,imgEndpoint:n,articleEdges:s,limit:5});a.push(e)}if(c?.length){let e=Kx({name:`plus-lus-${r}`,title:`Les + lus ${i}`,pageEndpoint:t,imgEndpoint:n,articleEdges:c,limit:5});a.push(e)}return a},SS=e=>{let[t,n]=W.default.useState(e.defaultTabItems),r=W.default.useCallback(async()=>{if(e.variablesForQuery.rubric){let{apiHost:t}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let i=[{url:`${t}/?id=getMostRead&variables=${encodeURIComponent(JSON.stringify({brandId:e.variablesForQuery.brandId,sourceExcluded:e.variablesForQuery.sourceExcluded,rubricId:e.variablesForQuery.rubric.id}))}`,options:{headers:r}}];try{let t=await du(...i),r=xS({data:t,pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,rubricSlug:e.variablesForQuery.rubric.slug,rubricLabel:e.variablesForQuery.rubric.label});n(r),ri()}catch(e){console.error(`20mn> Error while loading tabItems:`,e)}}},[e.variablesForQuery.brandId,e.variablesForQuery.rubric,e.variablesForQuery.sourceExcluded]);return W.default.useEffect(()=>{r(),Kc()},[r]),W.default.useMemo(()=>({tabItems:t}),[t])},CS=({isSSR:e=!0,layout:t,tabItems:n,variablesForQuery:r,...i})=>{let{tabItems:a}=SS({defaultTabItems:n,variablesForQuery:r});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(qb,{layout:t,tabItems:a,variablesForQuery:r,...i}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({mostReadContainer:{layout:t,tabItems:n,variablesForQuery:r,...i}})} };`}})]})},wS=(e,t)=>Array.isArray(e)?[]:e?.movies?.edges?.map(e=>{let n=e?.node,r=n?.movieCastings?.edges?.find(e=>e?.node?.position===`Réalisateur`);return{link:n?.article_url||`#`,title:n?.title_fr||``,cardImageProps:{cover:(n?.movieMedias?.edges?.length??0)>0?`${t}/movies/posters/${n?.movieMedias?.edges?.[0]?.node?.src?.replace(`-%format`,``)??``}`:``},summary:n?.summary_short||``,castings:n?.movieCastings?.edges?.filter(e=>e?.node?.type===`cast`).map(e=>`${e?.node?.firstname} ${e?.node?.lastname}`)??[],genres:n?.genres?.filter(e=>e!==null)||[],directedBy:r?`${r?.node?.firstname} ${r?.node?.lastname}`:void 0,releaseDate:n?.release_date?Bs(new Date(n.release_date)):``,seeMoreLink:{children:`Voir la fiche du film`,href:n?.article_url||`#`}}})||[],TS=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultMovies),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,a=new Headers;window.envVariables?.apiAuthKey&&a.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${r}/?id=getMoviesData&variables=${encodeURIComponent(JSON.stringify({status:e.defaultVariablesForQuery.status,cursor:t,orderField:`EXPECTATION_LEVEL`,orderDirection:`DESC`}))}`,options:{headers:a}}];try{let e=await du(...s),{staticHost:t}=document.body.dataset,r=wS(e,t);o(e=>[...e,...r||[]]),n(e?.movies?.pageInfo?.endCursor??null),i(e?.movies?.pageInfo?.hasNextPage??!1),nc()}catch(e){console.error(`20mn> Error while loading posts:`,e)}},[t,e.defaultVariablesForQuery.status]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,items:a,hasNextPage:r,onLoadMore:l}),[s,a,r,l])},ES=({isSSR:e=!0,layout:t,items:n,variablesForQuery:r,seeMoreButton:i})=>{let{isLoading:a,items:o,hasNextPage:s,onLoadMore:c}=TS({defaultMovies:n,defaultVariablesForQuery:r});return W.default.useEffect(()=>{a||Qb()},[a]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Jb,{layout:t,items:o,seeMoreButton:s?{...i,disabled:a,onClick:c}:void 0}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({moviesListContainer:{layout:t,items:o,variablesForQuery:r,seeMoreButton:i}})} };`}})]})},DS=({pageEndpoint:e,imgEndpoint:t,staticEndpoint:n,data:r,layout:i})=>mx({pageEndpoint:e,imgEndpoint:t,staticEndpoint:n,data:r,hasSummary:!0,layout:i}).map(e=>(delete e.socialBarProps,{...e,linkProps:{children:`Je participe`,"aria-label":`Je participe au quiz`,href:e.link}})),OS=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r,staticHost:s}=document.body.dataset,c=new Headers;window.envVariables?.apiAuthKey&&c.append(`auth-key`,window.envVariables.apiAuthKey);let l=[{url:`${r}/?id=getTagArticlesWithCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery.brandId,slug:e.defaultVariablesForQuery.slug,first:e.defaultVariablesForQuery.first,after:t}))}`,options:{headers:c}}];try{let e=await du(...l),t=DS({pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,staticEndpoint:s||``,data:e,layout:window.layout}),r={articles:[...a,...t],endCursor:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.endCursor??null,hasNextPage:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.hasNextPage??!1};o(e=>[...e,...t]),n(r.endCursor),i(r.hasNextPage),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[a,t,e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.first,e.defaultVariablesForQuery.slug]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useEffect(()=>{ll()},[]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},kS=({isSSR:e=!0,layout:t,articles:n,variablesForQuery:r,seeMoreButton:i,currentPagePath:a,totalArticles:o})=>{let{isLoading:s,articles:c,hasNextPage:l,onLoadMore:u}=OS({defaultArticles:n,defaultVariablesForQuery:r});W.default.useEffect(()=>{s||Qb()},[s]);let d=c.map(e=>({...e,...e.cardImageProps&&{cardImageProps:{...e.cardImageProps,sizes:`(min-width: 1660px) 384px, (min-width: 1440px) calc(18vw + 89px), (min-width: 1080px) 320px, (min-width: 780px) calc(44.29vw - 149px), calc(50vw - 16px)`}}}));return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Yb,{layout:t,articles:d,seeMoreButton:l?{...i,disabled:s,onClick:u}:void 0,currentPagePath:a,totalArticles:o}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({quizContainer:{layout:t,articles:d,variablesForQuery:r,seeMoreButton:i}})} };`}})]})},AS=()=>{let e=document.getElementById(`c-alert-info`);if(e){let t=(0,uu.createRoot)(e);t&&t.render(/* @__PURE__ */ (0,U.jsx)(vx,{}))}},jS=()=>{let e=document.getElementById(`elections-form-container`),t=window?.__staticHydrationData?.electionsSearchBannerContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Nb,{isSSR:!1,...t}))}},MS=()=>{let e=document.getElementById(`article-list-bottom-container`),t=window?.__staticHydrationData?.articleListBottomContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(gx,{isSSR:!1,...t}))}},NS=()=>{let e=document.getElementById(`journalist-article-list-container`),t=window?.__staticHydrationData?.journalistArticleListContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Mx,{isSSR:!1,...t}))}},PS=()=>{let e=document.getElementById(`home-legal-notice-list-container`),t=window?.__staticHydrationData?.legalNoticeHomeContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Gx,{isSSR:!1,...t}))}},FS=()=>{let e=document.getElementById(`department-legal-notice-list-container`),t=window?.__staticHydrationData?.legalNoticeDepartmentContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Ux,{isSSR:!1,...t}))}},IS=()=>{let e=document.getElementById(`elections-towns-by-departments-map-container`),t=window?.__staticHydrationData?.electionsMapTownsByDepartmentsContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(kx,{isSSR:!1,...t}))}},LS=()=>{let e=document.getElementById(`elections-departments-map-container`),t=window?.__staticHydrationData?.electionsDepartmentsMapContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Tx,{isSSR:!1,...t}))}},RS=()=>{let e=document.getElementById(`elections-european-map-container`),t=window?.__staticHydrationData?.electionsEuropeanMapContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Dx,{isSSR:!1,...t}))}},zS=()=>{let e=document.getElementById(`elections-constituencies-map-container`),t=window?.__staticHydrationData?.electionsConstituenciesMapContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Cx,{isSSR:!1,...t}))}},BS=(e,t)=>{let n=document.getElementById(e),r=t?window?.__staticHydrationData?.liveImportantPostsContainer:window?.__staticHydrationData?.livePostsContainer,i=t?`liveImportantPostsContainer`:`livePostsContainer`;if(n&&r){let e=(0,uu.createRoot)(n);e&&e.render(/* @__PURE__ */ (0,U.jsx)(dS,{isSSR:!1,staticHydrationDataName:i,...r,posts:Qs(r?.posts),variablesForQuery:r.variablesForQuery}))}},VS=()=>{let e=document.getElementById(`local-news-container`),t=window?.__staticHydrationData?.localNewsContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(_S,{isSSR:!1,...t}))}},HS=()=>{let e=document.getElementById(`latest-articles-container`),t=window?.__staticHydrationData?.latestArticlesContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Ix,{isSSR:!1,...t}))}},US=()=>{let e=document.getElementById(`live-and-most-read-container`),t=window?.__staticHydrationData?.liveAndMostReadContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Yx,{isSSR:!1,...t}))}},WS=()=>{let e=document.getElementById(`most-read-container`),t=window?.__staticHydrationData?.mostReadContainer;if(e&&t&&t.variablesForQuery?.builtAt&&t.variablesForQuery.builtAt+36e5<Date.now()){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(CS,{isSSR:!1,...t}))}},GS=()=>{let e=document.getElementById(`latest-contents-carousel-container`),t=window?.__staticHydrationData?.latestContentsCarouselContainer;if(e&&t&&t.variablesForQuery?.builtAt&&t.variablesForQuery.builtAt+36e5<Date.now()){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(zx,{isSSR:!1,...t}))}},KS=()=>{let e=document.getElementById(`tabpanel-le-direct`),t=document.getElementById(`live-refresh-button`);if(e&&t){let e=(0,uu.createRoot)(t);e&&e.render(/* @__PURE__ */ (0,U.jsx)(fS,{}))}},qS=()=>{let e=document.getElementById(`archive-pdf-list-container`),t=window?.__staticHydrationData?.archivePdfListContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(ux,{isSSR:!1,...t}))}},JS=()=>{let e=document.getElementById(`movies-container`),t=window?.__staticHydrationData?.moviesListContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(ES,{...t,isSSR:!1}))}},YS=()=>{let e=document.getElementById(`main-most-read-container`),t=window?.__staticHydrationData?.mainMostReadContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(bS,{...t,isSSR:!1}))}},XS=()=>{let e=document.getElementById(`quiz-container`),t=window?.__staticHydrationData?.quizContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(kS,{isSSR:!1,...t}))}},ZS=()=>{let e=document.getElementById(`tv-tab-replays`),t=window?.__staticHydrationData?.replaysTvExtractsAndReplaysContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(ax,{name:`replays`,isSSR:!1,...t}))}let n=document.getElementById(`tv-tab-extraits`),r=window?.__staticHydrationData?.extraitsTvExtractsAndReplaysContainer;if(n&&r){let e=(0,uu.createRoot)(n);e&&e.render(/* @__PURE__ */ (0,U.jsx)(ax,{name:`extraits`,isSSR:!1,...r}))}},QS=()=>{let e=document.getElementById(`elections-ia-articles-container`),t=window?.__staticHydrationData?.electionsAiArticlesContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(xx,{isSSR:!1,...t}))}},$S=(e,t,n,r)=>{n?e.setAttribute(t,r||`true`):e.setAttribute(t,r||`false`)},eC=(e,t,n)=>{t?e.classList.add(n):e.classList.remove(n)},tC=()=>{let e=document.getElementById(`contact-form`);return e instanceof HTMLFormElement?e:null},nC=e=>{let t=document.getElementById(e);return t instanceof HTMLSelectElement?t:null},rC=e=>{let t=document.getElementById(e);return t instanceof HTMLTextAreaElement?t:null},iC={"probleme-ordinateur":`Votre message. Veuillez préciser votre navigateur.`,"probleme-mobile":`Votre message. Veuillez préciser votre navigateur et l’appareil que vous utilisez.`,"probleme-app":`Votre message. Veuillez préciser l’appareil que vous utilisez.`},aC={"suppression-anonymisation":`Dans votre message, merci d'indiquer votre objet, nom / prénom, adresse mail et adresse URL vers l'article concerné si besoin.`,jeux:`Ecrivez votre message en précisant votre appareil, le navigateur utilisé ainsi que les jeux concernés.`,newsletter:`Ecrivez votre message en précisant la date et/ou le nom de la newsletter concernée.`,accessibility:`Ecrivez votre message en précisant si nécessaire la/les page(s) ou le/es composant(s) concernés.`};function oC(e){let t=nC(`service`),n=nC(`subservice`),r=nC(`common-object`),i=nC(`tech-object`),a=rC(`message`),o=nC(`source`),s=nC(`games-object`),c=nC(`subscription-object`);return{serviceSelect:t,subServiceSelect:n,subService:n?.parentElement?.parentElement,commonObjectSelect:r,commonObject:r?.parentElement?.parentElement,techObjectSelect:i,techObject:i?.parentElement?.parentElement,contentInput:a,sourceSelect:o,source:o?.parentElement?.parentElement,gamesObjectSelect:s,gamesObject:s?.parentElement?.parentElement,subscriptionObjectSelect:c,subscriptionObject:c?.parentElement?.parentElement,emailInput:e.querySelector(`input[type=email]`),messageInput:a}}let sC=(e,t,n)=>{let{subService:r,commonObject:i,techObject:a,gamesObject:o,subscriptionObject:s,source:c}=e,l=t===`redaction`,u=t===`service-technique`,d=t===`jeux`,f=t===`service-abonnement`;r&&(eC(r,n||!l,`u-mask`),$S(r,`aria-hidden`,n||!l)),i&&(eC(i,n||!l,`u-mask`),$S(i,`aria-hidden`,n||!l)),a&&(eC(a,n||!u,`u-mask`),$S(a,`aria-hidden`,!u)),o&&(eC(o,n||!d,`u-mask`),$S(o,`aria-hidden`,n||!d)),c&&(eC(c,n||!d,`u-mask`),$S(c,`aria-hidden`,n||!d)),s&&(eC(s,n||!f,`u-mask`),$S(s,`aria-hidden`,n||!f))},cC=()=>{let e=tC();if(!e)return;let{emailInput:t,messageInput:n,serviceSelect:r}=oC(e);t?.addEventListener(`blur`,()=>{let e=document.getElementById(`email-error`);e&&(t.checkValidity()?eC(e,!0,`u-mask`):eC(e,!1,`u-mask`))}),n?.addEventListener(`blur`,()=>{let e=document.getElementById(`message-error`);e&&(n.value===``?eC(e,!1,`u-mask`):eC(e,!0,`u-mask`))}),r?.addEventListener(`blur`,()=>{let e=document.getElementById(`service-error`);e&&(r.checkValidity()?eC(e,!0,`u-mask`):eC(e,!1,`u-mask`))})},lC=(e,t)=>{e&&($S(e,`required`,t),$S(e,`aria-required`,t))},uC=()=>{let e=tC();if(!e)return;let t=oC(e),{serviceSelect:n,subServiceSelect:r,commonObjectSelect:i,techObjectSelect:a,gamesObjectSelect:o,subscriptionObjectSelect:s,sourceSelect:c,contentInput:l}=t,u=!!n?.selectedOptions?.[0]?.hidden,d=n?.selectedOptions?.[0]?.value??``;sC(t,d,u),cC(),n?.addEventListener(`change`,e=>{let{target:n}=e;if(!(n instanceof HTMLSelectElement))return;let u=n.value,d=u===`service-technique`,f=u===`jeux`,p=u===`redaction`,m=u===`service-abonnement`;lC(r,p),lC(i,p),lC(a,d),lC(o,f),lC(s,m),lC(c,f),sC(t,u,!!n.selectedOptions[0]?.hidden),l&&l.setAttribute(`placeholder`,aC[u]??`Votre message.`)}),a?.addEventListener(`change`,e=>{let{target:t}=e;t instanceof HTMLSelectElement&&l&&l.setAttribute(`placeholder`,iC[t.value]??`Votre message.`)})},dC=()=>{let e=tC();e&&e.addEventListener(`submit`,t=>{t.preventDefault();let n=new FormData(e),r=n.get(`message`)?.toString().trim(),i=n.get(`email`)?.toString().trim(),a=n.get(`service`)?.toString().trim(),o=n.get(`subservice`)?.toString().trim(),s=n.get(`common-object`)?.toString().trim(),c=n.get(`tech-object`)?.toString().trim(),l=n.get(`games-object`)?.toString().trim(),u=n.get(`subscription-object`)?.toString().trim(),d=n.get(`source`)?.toString().trim();if([!!i,!!a,!!r,a!==`redaction`||!!o&&!!s,!(a===`service-technique`&&!c),!(a===`jeux`&&!l&&!d),!(a===`service-abonnement`&&!u)].includes(!1)){alert(`Tous les champs obligatoires doivent être remplis.`);return}let f=null,p,m=e=>{if(!e)return``;let t=document.querySelector(`option[value="${e}"]`);return t&&t instanceof HTMLOptionElement?t.text:``};switch(a){case`redaction`:p=s,f=m(p),o&&(a=o);break;case`jeux`:{p=l;let e=m(p);f=d?`${e} (source: ${d})`:e;break}case`service-technique`:p=c,f=m(p);break;case`service-abonnement`:p=u,f=m(p)}let h=document.getElementById(`li-antibot-token`);if(!h||!(h instanceof HTMLInputElement)){alert(`Vous devez valider le captcha.`);return}let g={antibotToken:h.value,service:a,email:i,message:r,object:f,objectId:p||null,accessSource:d?.includes(`app-`)?`apps`:`site`},_=document.body.getAttribute(`data-http-taskrunner-api-host`);fetch(`${_}/contact`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(g)}).then(e=>e.json()).then(e=>{e.success?(alert(`Votre message a bien été envoyé à nos services.`),window.location.reload()):alert(`Merci de valider le captcha afin d'envoyer votre message.`)}).catch(e=>{console.error(`Error:`,e)})})};var fC=()=>{uC(),dC()};let pC=()=>{if(document.querySelector(`.gcse-search`)&&window.envVariables?.googleSearchCode)try{bl(`google-search`)}catch(e){e instanceof Error&&console.error(e.message)}};var mC=()=>{pC()};let hC,gC,_C=e=>{hC&&(e===`show`?(hC.classList.remove(`c-header-mini--is-hidden`),gC?.forEach(e=>{e.classList.add(`c-menu--with-header-mini`)}),document.body.setAttribute(`header`,`mini`)):(hC.classList.add(`c-header-mini--is-hidden`),gC?.forEach(e=>{e.classList.remove(`c-menu--with-header-mini`)}),document.body.removeAttribute(`header`)))},vC=e=>{let t=e[0];hC&&(t.isIntersecting?_C(`hidden`):_C(`show`))},yC=()=>{if(hC=document.querySelector(`.c-header-mini`),hC){let e=document.documentElement.scrollTop,t=document.querySelector(`.c-header`);gC=document.querySelectorAll(`.c-menu`),t&&(e>t.offsetHeight?_C(`show`):_C(`hidden`),new IntersectionObserver(vC,{threshold:[0],rootMargin:`0px 0px -100%`}).observe(t))}},bC,xC,SC,CC=0,wC=e=>{if(!bC)return;let t=document.querySelector(`button.c-btn--close:not(.u-hidden)`),n=document.getElementById(`live-refresh-button`);e===`show`?(bC.classList.remove(`c-header-mobile--is-hidden`),t&&t.classList.add(`c-btn--close-is-below-header`),n&&(n.classList.remove(`u-sticky--spaced-top-screen`),n.classList.add(`u-sticky--spaced-header-mobile`))):(bC.classList.add(`c-header-mobile--is-hidden`),t&&t.classList.remove(`c-btn--close-is-below-header`),n&&(n.classList.add(`u-sticky--spaced-top-screen`),n.classList.remove(`u-sticky--spaced-header-mobile`)))},TC=e=>{xC&&SC&&(e===`show`?(xC.classList.remove(`u-hidden`),SC.classList.add(`u-hidden`)):(xC.classList.add(`u-hidden`),SC.classList.remove(`u-hidden`)))},EC=()=>{let e=window.scrollY;e>CC?(wC(`hidden`),CC=e):CC-e>100&&(wC(`show`),TC(`hidden`),CC=e)},DC=()=>{bC=document.querySelector(`.c-header-mobile`),xC=document.querySelector(`.js-header-btn-menu`),SC=document.querySelector(`.js-header-btn-back`),bC&&window.addEventListener(`scroll`,()=>{window.scrollY<780?(wC(`show`),xC&&SC&&TC(`show`)):EC()})},OC=()=>{let e=document.querySelector(`#page-content`)?.getAttribute(`data-content-id`),t=/android/i.test(navigator.userAgent);document.querySelectorAll(`a.js-open-in-app[data-android-href]`).forEach(n=>{let r=new URL(t?n.dataset.androidHref:n.href);if(e){let n=`article/${encodeURIComponent(e)}`;t?r.searchParams.set(`deep_link`,`fr.20minutes://${n}`):r.pathname=`/${n}`}n.href=r.href})},kC,AC=document.querySelector(`button.c-btn--close`),jC=document.querySelectorAll(`div[id^="taboola-below-article"]`),MC=`20px`,NC=`211px`,PC=0,FC=0,IC=()=>{kC?.classList.remove(`c-read-also-banner--is-hidden`),document.body.setAttribute(`readalsobanner`,`show`)},LC=()=>{kC?.classList.add(`c-read-also-banner--is-hidden`),document.body.setAttribute(`readalsobanner`,`hidden`)},RC=e=>{let t=[];return jC.forEach((n,r)=>{let{top:i,bottom:a}=n.getBoundingClientRect();e===`top`&&i<=180||e===`bottom`&&i<document.documentElement.clientHeight&&a>0?t[r]=!0:t[r]=!1}),!!t.find(e=>e===!0)},zC=()=>RC(`bottom`),BC=()=>RC(`top`),VC=()=>{let e=null;return e=document.body.getBoundingClientRect().top>PC?`up`:`down`,PC=document.body.getBoundingClientRect().top,e},HC=(e,t)=>{let n=zC();t===`down`&&(n?(IC(),kC?.classList.remove(`c-read-also-banner--is-fixed-below-header`),AC&&(AC.style.top=`140px`)):AC&&(AC.style.top=MC),FC=e),t===`up`&&FC-e>100&&(kC?.classList.add(`c-read-also-banner--is-fixed-below-header`),n?(IC(),AC&&(AC.style.top=NC)):(LC(),AC&&(e>780?AC.style.top=`90px`:AC.style.top=``)),FC=e)},UC=(e,t)=>{let n=kC?.dataset.bannerLimitTop||`0`;t===`up`&&-document.body.getBoundingClientRect().top>=parseInt(n,10)&&(IC(),AC&&(AC.style.top=NC)),(t===`down`||-document.body.getBoundingClientRect().top<=parseInt(n,10))&&(LC(),AC&&(e>780?AC.style.top=MC:AC.style.top=``))},WC=(e=document.querySelector(`div.c-read-also-banner`))=>{if(e){kC=e,LC(),setTimeout(()=>{kC?.classList.remove(`u-hidden`)},500);let t=document.body.dataset.layout===`mobile`;window.addEventListener(`scroll`,()=>{if(BC()){LC();return}let e=VC();t?HC(window.scrollY,e):UC(window.scrollY,e)})}},GC=()=>{let{refreshInterval:e}=document.body.dataset;Number(e)>0&&((e,t)=>{let n,r=t*1e3,i=()=>{clearTimeout(n),n=setTimeout(e,r)};document.addEventListener(`click`,i),document.addEventListener(`keypress`,i),document.addEventListener(`scroll`,i),i()})(()=>{window.location.reload()},Number(e))},KC=()=>{let e=document.getElementById(`js-refresh-button`);e&&window?.location&&e.addEventListener(`click`,e=>{e.preventDefault(),window.location.reload()})};var qC=()=>{KC()};let JC=()=>{document.querySelectorAll(`.c-skip-link`).forEach(e=>{e.addEventListener(`click`,e=>{if(!(e.currentTarget instanceof HTMLAnchorElement))return;let t=e.currentTarget.getAttribute(`href`)?.substring(1),n=t?document.getElementById(t):null;n&&(n.hasAttribute(`tabindex`)||n.setAttribute(`tabindex`,`-1`),setTimeout(()=>{n.focus()},0))})})};function YC(){document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,JC):JC()}ri(),cu(),$b(),Zx(),(()=>{let e=document.getElementById(`banniere_haute`),t=document.getElementById(`taboola-below-article-thumbnails`);e&&t&&new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting?e.style.visibility=`hidden`:e.style.visibility=`visible`})}).observe(t)})(),YC(),Ni(),qC(),il(),fl(),qi(),AS(),yC(),KS(),GC(),mC(),Cu(),(()=>{try{`serviceWorker`in navigator&&navigator.serviceWorker.getRegistrations().then(e=>{e.forEach(e=>{e.active?.scriptURL?.endsWith(`/sw.js`)&&e.unregister()})})}catch(e){console.error(`Error while unregistering service worker:`,e)}})(),pl(),DC(),WC(),Xi(),OC(),Tu(),Yi(),Cc(),qS(),MS(),NS(),PS(),FS(),BS(`tabpanel-le-direct`),BS(`tabpanel-temps-forts`,!0),VS(),HS(),US(),WS(),GS(),jS(),LS(),RS(),IS(),zS(),JS(),YS(),XS(),ZS(),QS(),ou(),fC(),ki(),lu(),Al(),Ml(),Sl(),Pl(),au(),Fl(),_l()})();
|
|
191
|
+
;var Eb=/* @__PURE__ */ c((/* @__PURE__ */ o(((e,t)=>{(function(){"use strict";var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})))(),1);let Db=({articles:e,seeMoreButton:t,layout:n,...r})=>{let{variablesForQuery:i,...a}=r;return/* @__PURE__ */ (0,U.jsxs)(q,{...a,children:[e.map((t,r)=>{let i=`lastArticleKey${r}`,a=r===e.length-1,o=!a&&(n===Y.DESKTOP||n===Y.MOBILE&&r!==10&&r!==20);return/* @__PURE__ */ (0,U.jsxs)(W.default.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Qo,{...t,px:{xs:`m`,md:`0`},cardTitleProps:{weight:`semi-bold`,maxRows:n===Y.MOBILE?void 0:3,...t.cardTitleProps},...o?{className:`u-divider-bottom-grey-200`}:{},...r!==0&&{pt:`s`},...!a&&{pb:`s`}}),r===10&&n===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_haut`,variant:`ARTICLE`}),r===20&&n===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_milieu`,variant:`ARTICLE`})]},i)}),t&&/* @__PURE__ */ (0,U.jsx)(ka,{...t,color:`primary`,variant:`outlined`,mx:`auto`,mt:`s`})]})},Ob=({legalNotices:e,seeMoreLegalNotices:t,...n})=>e.length===0?null:/* @__PURE__ */ (0,U.jsxs)(q,{...n,children:[e.map((t,n)=>/* @__PURE__ */ (0,W.createElement)(Zo,{...t,key:`${t.link}-${n}`,linkProps:{children:`Lire l’annonce`},...n!==e.length-1&&{className:`u-divider-bottom-grey-200`},...n!==0&&{pt:`l`},...n!==e.length-1&&{pb:`l`}})),t&&/* @__PURE__ */ (0,U.jsx)(ka,{color:`primary`,variant:`outlined`,mx:`auto`,mt:`xl`,...t})]}),kb=({updatedAt:e,...t})=>/* @__PURE__ */ (0,U.jsx)(os,{...t,...e&&{updatedAt:zs(e)}}),Ab=({draftContent:e,pageEndpoint:t,imgEndpoint:n,withCmp:r=!0})=>{let i=W.default.useRef(null);return W.default.useEffect(()=>{let a=wb({rawDraftContent:e,pageEndpoint:t,imgEndpoint:n,withCmp:r}),o=document.createRange().createContextualFragment(a);i.current&&(i.current.innerHTML=``,i.current.appendChild(o))},[e,n,t,r]),/* @__PURE__ */ (0,U.jsx)(q,{ref:i,mt:`s`,className:`c-content`,children:Tb({rawDraftContent:e,pageEndpoint:t,imgEndpoint:n,withCmp:r})})},jb=(e,t)=>{let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}},Mb={formId:`elections-form`,autocompleteSelector:`.c-search-form__autocomplete`},Nb=({isSSR:e=!0,layout:t,title:n,titleHref:r,searchFormProps:i,breadcrumbProps:a,selectProps:o,variant:s,hasTopBorder:c})=>{let[l,u]=W.default.useState([]),d=W.default.useCallback(()=>{let e=document.querySelector(Mb.autocompleteSelector);l&&l.length>0&&e&&e.classList.remove(`u-hidden`)},[l]),f=W.default.useCallback(()=>{let e=document.querySelector(Mb.autocompleteSelector);l&&l.length>0&&e&&e.classList.remove(`u-hidden`)},[l]),p=W.default.useCallback(e=>{e.relatedTarget||document.querySelector(Mb.autocompleteSelector)?.classList?.add(`u-hidden`)},[]),m=W.default.useCallback(async e=>{if(e.target instanceof HTMLInputElement){let{target:t}=e;if(t.value.length<3)u([]);else try{let e=await du({url:`${t.closest(`form`)?.action??`#`}?searchValue=${t.value}`});u(e.map(e=>{let{_source:t}=e;return{value:t.output,url:t.url}}))}catch(e){console.error(`20mn> Error while searching:`,e)}}},[]);return W.default.useEffect(()=>{ri()},[]),W.default.useEffect(()=>{let e=document.querySelector(Mb.autocompleteSelector);l&&e&&(l.length>0?e.classList.remove(`u-hidden`):e.classList.add(`u-hidden`))},[l]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(ns,{layout:t,title:n,titleHref:r,breadcrumbProps:a,selectProps:o,variant:s,hasTopBorder:c,searchFormProps:{...i,autocompleteResults:l,onSubmit:e=>{e.preventDefault()},inputProps:{placeholder:`Recherchez les résultats de votre ville, votre département ou votre région`,name:`elections-search`,onClick:d,onFocus:f,onBlur:p,onKeyUp:jb(m,300),autoComplete:`off`,required:!0,"aria-required":!0}}}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsSearchBannerContainer:{layout:t,title:n,titleHref:r,searchFormProps:i,breadcrumbProps:a,selectProps:o,variant:s,hasTopBorder:c}})} };`}})]})},Pb=({layout:e,title:t,editions:n,selectorsLabel:r,editionSelector:i,monthSelector:a,variant:o=`archivesByYear`,enabled:s=!0})=>s?/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Aa,{my:{xs:`xl`,md:`xxl-2`},color:`ultramarine`}),/* @__PURE__ */ (0,U.jsx)(vo,{size:`xs`,mb:`xxl`,children:t}),/* @__PURE__ */ (0,U.jsxs)(J,{alignItems:{xs:`start`,md:`center`},gap:{xs:`xs`,md:`l`},direction:{xs:`column`,md:`row`},children:[/* @__PURE__ */ (0,U.jsx)(X,{size:`s`,weight:`bold`,...r}),/* @__PURE__ */ (0,U.jsx)(uo,{...i,id:`archivePdfListEditionSelector`,containerProps:{style:{width:e===Y.MOBILE?`100%`:`163px`}},py:`m`,px:`s`}),o===`archivesByYear`&&a&&/* @__PURE__ */ (0,U.jsx)(uo,{...a,id:`archivePdfListMonthSelector`,containerProps:{style:{width:e===Y.MOBILE?`100%`:`193px`}},py:`m`,px:`s`})]}),n&&n.length>0&&/* @__PURE__ */ (0,U.jsxs)(J,{direction:`column`,gap:`l`,mt:`l`,children:[n.slice(0,20).map(e=>/* @__PURE__ */ (0,U.jsxs)(J,{alignItems:`baseline`,children:[/* @__PURE__ */ (0,U.jsx)(K,{name:`diode`,color:`ultramarine`,size:11,mr:`xxs`}),/* @__PURE__ */ (0,U.jsx)(ao,{color:`ultramarine`,href:e.href,children:e.name})]},e.name)),n.length>20&&/* @__PURE__ */ (0,U.jsx)(`span`,{children:`Vous ne trouvez pas le journal numérique recherché ? Sélectionnez une édition et un mois pour une recherche plus précise.`})]})]}):null,Fb=e=>{let{variablesForQuery:t,...n}=e;return/* @__PURE__ */ (0,U.jsx)($o,{...n,headingProps:{...n.headingProps,as:`h2`},mb:`xxl`})},Ib=e=>e&&(e.rightSubheader&&new Date(e.rightSubheader?.text).getTime()?{...e,rightSubheader:{...e.rightSubheader,text:zs(e.rightSubheader.text)}}:{...e}),Lb=({articles:e,layout:t,columnsNumber:n=2,hideFirstDivider:r=!1,dividerProps:i,seeMoreButton:a,seeMoreLink:o,tagTotalArticles:s,currentPagePath:c,currentPage:l=`1`,articlesLimit:u,hasCardLarge:d=!1,hasMarginOnCard:f=!0,heading:p,isLoading:m=!1,skeletonCount:h=8,desktopArticlesListClassName:g,desktopCardSize:_=`medium`,...v})=>{if(e.length===0)return null;let y=e=>/* @__PURE__ */ (0,U.jsx)(Lo,{...e,cardTitleProps:{as:`h2`,...e.cardTitleProps},cardHeaderProps:Ib(e.cardHeaderProps),mx:f?`m`:void 0}),b=m?Array.from({length:h},(e,t)=>t):[],x=null;x=t===Y.DESKTOP?/* @__PURE__ */ (0,U.jsxs)(io,{colsNumber:n,gap:`xl`,className:g,children:[e.slice(0,u).map((e,n)=>{let{layout:r,cardImageProps:i,...a}=e,o=Ib(e.cardHeaderProps),s={className:`card-item-${n+1}`,cardImageProps:i};return _===`small`?/* @__PURE__ */ (0,W.createElement)(Jo,{...s,key:`${e.link}-${n}`,justifyContent:`start`,cardTitleProps:{as:`h2`,...e.cardTitleProps},layout:t,link:e.link,title:e.title,cardHeaderProps:o?.headline?{headline:o?.headline}:void 0}):/* @__PURE__ */ (0,W.createElement)(zo,{...s,...a,key:`${e.link}-${n}`,cardTitleProps:{as:`h2`,...e.cardTitleProps},cardHeaderProps:o})}),b.map(e=>/* @__PURE__ */ (0,U.jsx)(qo,{variant:`medium`},`skeleton-${e}`))]}):/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[e.slice(0,u).map((e,n)=>/* @__PURE__ */ (0,U.jsx)(q,{className:`card-item-${n+1}`,children:d?/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[n===0&&/* @__PURE__ */ (0,U.jsx)(Ro,{...e,layout:t}),n>0&&/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Aa,{color:`grey-200`,my:`s`,...i}),y({...e,layout:t})]})]}):/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Aa,{color:`grey-200`,my:`s`,...i,className:(0,Eb.default)({"u-hidden":n===0&&r},i?.className)}),y({...e,layout:t})]})},`${e.link}-${n}`)),b.map(e=>/* @__PURE__ */ (0,U.jsxs)(q,{children:[/* @__PURE__ */ (0,U.jsx)(Aa,{color:`grey-200`,my:`s`,...i}),/* @__PURE__ */ (0,U.jsx)(qo,{variant:`extra-small`,mx:f?`m`:void 0})]},`skeleton-${e}`))]});let S=/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[p&&/* @__PURE__ */ (0,U.jsx)(vo,{size:`m`,mb:`xl`,mx:{xs:`m`,md:`0`},...p}),x,(o||a)&&/* @__PURE__ */ (0,U.jsxs)(J,{justifyContent:`center`,mt:`l`,children:[a&&/* @__PURE__ */ (0,U.jsx)(ka,{...a}),o&&/* @__PURE__ */ (0,U.jsx)(ao,{buttonColor:`primary`,variant:`outlined`,...o}),s&&c&&/* @__PURE__ */ (0,U.jsx)(`noscript`,{children:/* @__PURE__ */ (0,U.jsx)(ys,{totalArticles:s,currentPage:l,pagePath:c,archivesUrl:`https://www.20minutes.fr/archives`})})]})]});return Object.keys(v).length===0?S:/* @__PURE__ */ (0,U.jsx)(q,{...v,children:S})},Rb=({header:{subtitle:e,...t},sectionId:n,liveIndicator:r,children:i,...a})=>{let o=e&&typeof e!=`string`?Tb({rawDraftContent:e}):e;return/* @__PURE__ */ (0,U.jsxs)(q,{...a,id:n,className:(0,Eb.default)(a.className,{"u-anchor-link":!!n}),children:[r&&/* @__PURE__ */ (0,U.jsx)(kb,{...r,variant:`elections`,mx:{xs:`m`,md:`0`},mb:`xs`}),t?.heading?.children&&/* @__PURE__ */ (0,U.jsx)(rs,{...t,subtitle:o,mb:{xs:`m`,sm:`xl`}}),i]})},zb=({mapConstituenciesProps:e,...t})=>e.electionName===``&&e.electionYear===``&&e.resultsPerDistrict.length===0||Object.keys(e.mapDistrictsData||{}).length===0?null:/* @__PURE__ */ (0,U.jsx)(Rb,{...t,header:{...t.header,heading:{...t.header.heading,as:`h2`}},children:/* @__PURE__ */ (0,U.jsx)(us,{...e,mx:{xs:`m`,md:`0`}})}),Bb=({mapDepartmentsProps:e,...t})=>e.electionName===``&&e.electionYear===``&&e.resultsPerDepartment.length===0?null:/* @__PURE__ */ (0,U.jsx)(Rb,{...t,header:{...t.header,heading:{...t.header.heading,as:`h2`}},children:/* @__PURE__ */ (0,U.jsx)(ls,{...e,mx:{xs:`m`,md:`0`}})}),Vb=({mapEuropeProps:e,...t})=>e.electionName===``&&e.electionYear===``&&e.resultsPerCountry.length===0||Object.keys(e.mapEuCountriesData||{}).length===0||Object.keys(e.mapNonEuCountriesData||{}).length===0?null:/* @__PURE__ */ (0,U.jsx)(Rb,{...t,header:{...t.header,heading:{...t.header.heading,as:`h2`}},children:/* @__PURE__ */ (0,U.jsx)(ds,{...e,mx:{xs:`m`,md:`0`}})}),Hb=({mapTownsByDepartmentsProps:e,...t})=>{let{electionName:n,electionYear:r,...i}=e;if(e.electionName===``&&e.electionYear===``&&e.resultsPerTown.length===0)return null;let a=(e?.resultsPerTown?.length??0)===0;return/* @__PURE__ */ (0,U.jsx)(Rb,{...t,className:(0,Eb.default)({"u-placeholder-map-towns-empty":a,"u-placeholder-map-towns":!a},t?.className),header:{...t.header,heading:{...t.header.heading,as:`h2`}},children:/* @__PURE__ */ (0,U.jsx)(vs,{...i,mx:{xs:`m`,md:`0`}})})},Ub=({articles:e,selectProps:t,seeMoreLink:n,layout:r,...i})=>{let{variablesForQuery:a,...o}=i,s=/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(is,{as:`h2`,size:{xs:`s`,md:`m`},isCentered:r===Y.MOBILE,mb:{xs:`l`,md:`0`},iconProps:{name:`rubric-news`,size:40},children:`Actualité locale`}),/* @__PURE__ */ (0,U.jsx)(uo,{...t})]}),c=(t,n)=>/* @__PURE__ */ (0,U.jsx)(zo,{...t,cardTitleProps:{as:`h3`,size:`xxs`,weight:`semi-bold`,fontFamily:`source-serif-pro`,maxRows:4,...t.cardTitleProps},socialBarProps:void 0,...r===Y.MOBILE&&n!==e.length-1&&{className:`u-divider-bottom-grey-200`},...r===Y.MOBILE&&n!==0&&{pt:`s`},...r===Y.MOBILE&&n!==e.length-1&&{pb:`s`}},t.title);return/* @__PURE__ */ (0,U.jsxs)(q,{...o,children:[/* @__PURE__ */ (0,U.jsx)(Aa,{thickness:`heavy`,color:`ultramarine`,mb:`l`}),r===Y.DESKTOP?/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`between`,mb:`xl`,alignItems:`center`,children:s}):/* @__PURE__ */ (0,U.jsx)(q,{mx:`m`,mb:`l`,children:s}),r===Y.DESKTOP?/* @__PURE__ */ (0,U.jsx)(io,{colsNumber:4,gap:`xl`,mx:r===Y.DESKTOP?`0`:`m`,children:e.map(e=>c(e))}):/* @__PURE__ */ (0,U.jsx)(J,{direction:`column`,mx:`m`,children:e.map((e,t)=>c(e,t))}),/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,mt:`xxl`,children:/* @__PURE__ */ (0,U.jsx)(ao,{buttonColor:`primary`,variant:`outlined`,...n,children:`Voir plus d'articles`})})]})},Wb=({post:e,postIndex:t,postsCount:n,pageEndpoint:r,imgEndpoint:i,layout:a,disableAds:o=!1,enableAnchoring:s=!0})=>/* @__PURE__ */ (0,W.createElement)(`section`,{className:(0,Eb.default)(`js-post`,{"u-anchor-link":s}),...s?{id:`post-${e.id}`}:{},key:e.id},/* @__PURE__ */ (0,U.jsx)(cs,{...e.title}),e.content&&/* @__PURE__ */ (0,U.jsx)(Ab,{draftContent:e.content,pageEndpoint:r,imgEndpoint:i}),e.talk&&/* @__PURE__ */ (0,U.jsx)(ss,{...e.talk,mt:`s`}),/* @__PURE__ */ (0,U.jsx)(Aa,{color:`grey-200`,my:`l`}),!o&&n>=8&&t%6==0&&/* @__PURE__ */ (0,U.jsx)(sa,{id:a===Y.MOBILE?`inarticle2`:`inarticle1`,variant:`ARTICLE`,mb:`s`,isFullscreenMobile:!0}),!o&&n>=4&&t%6==3&&/* @__PURE__ */ (0,U.jsx)(sa,{id:a===Y.MOBILE?`inarticle3`:`inarticle2`,variant:`INREAD`,mb:`s`,isFullscreenMobile:!0})),Gb=({posts:e,layout:t,pageEndpoint:n,imgEndpoint:r,seeMoreLink:i,variablesForQuery:a,refreshButton:o,disableAds:s,enableAnchoring:c=!0,...l})=>e.length===0?null:/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(q,{...l,children:e.map((i,a)=>/* @__PURE__ */ (0,U.jsx)(Wb,{post:i,postIndex:a,postsCount:e.length,layout:t,pageEndpoint:n,imgEndpoint:r,disableAds:s,enableAnchoring:c},`${i.id}-${a}`))}),i&&/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,my:`l`,children:/* @__PURE__ */ (0,U.jsx)(ka,{color:`primary`,variant:`outlined`,...i})})]}),Kb=({items:e,seeMoreButton:t,...n})=>e.length<=0?null:/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(q,{...n,children:e.map((t,n)=>{let{summaryProps:r,...i}=t,a=i.layout===Y.DESKTOP&&n!==e.length-1||i.layout===Y.MOBILE&&n!==e.length-1&&n!==2&&n!==7;return/* @__PURE__ */ (0,U.jsxs)(W.default.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Vo,{...i,summaryProps:i.layout===Y.MOBILE?void 0:r,mx:{xs:`m`,md:`0`},...a?{className:`u-divider-bottom-grey-200`}:{},...n!==0&&{pt:`s`},...n!==e.length-1&&{pb:`s`}}),n===2&&i.layout===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_haut`,variant:`ARTICLE`}),n===7&&i.layout===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_milieu`,variant:`ARTICLE`})]},`${i.link}-${n}`)})}),t&&/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,mb:`m`,children:/* @__PURE__ */ (0,U.jsx)(ka,{...t})})]}),qb=({...e})=>{let{variablesForQuery:t,...n}=e;return/* @__PURE__ */ (0,U.jsx)(Ns,{...n})},Jb=({items:e,layout:t,seeMoreButton:n,...r})=>e.length<=0?null:/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(J,{direction:`column`,gap:`xxl-2`,...r,children:e.map((e,n)=>/* @__PURE__ */ (0,U.jsxs)(W.default.Fragment,{children:[n===5&&t===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_haut`,variant:`ARTICLE`}),/* @__PURE__ */ (0,U.jsx)(Ho,{...e,layout:t,containerSpacing:{px:{xs:`m`,lg:`0`}}})]},`${e.link}-${n}`))}),n&&/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,mt:`xl`,children:/* @__PURE__ */ (0,U.jsx)(ka,{...n})}),t===Y.DESKTOP&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`banniere_basse`,variant:`BAN`}),t===Y.MOBILE&&/* @__PURE__ */ (0,U.jsx)(sa,{id:`pave_milieu`,variant:`BAN`,mt:`xl`})]}),Yb=({articles:e,layout:t,totalArticles:n,currentPagePath:r,currentPage:i=`1`,seeMoreButton:a,...o})=>{if(e.length===0)return null;let s=/* @__PURE__ */ (0,U.jsx)(io,{colsNumber:1,gap:{xs:`xxl`,md:`xxl-2`},children:e.map((e,n)=>t===Y.DESKTOP?/* @__PURE__ */ (0,U.jsx)(Uo,{...e,className:(0,Eb.default)(`card-item-${n+1}`,e.className),cardTitleProps:{as:`h2`,...e.cardTitleProps},cardHeaderProps:Ib(e.cardHeaderProps)},e.title):/* @__PURE__ */ (0,U.jsx)(Io,{layout:t,...e,className:(0,Eb.default)(`card-item-${n+1}`,e.className),cardTitleProps:{as:`h2`,...e.cardTitleProps},cardHeaderProps:Ib(e.cardHeaderProps)},e.title))}),c=/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[s,a&&/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[n&&r&&/* @__PURE__ */ (0,U.jsx)(`noscript`,{children:/* @__PURE__ */ (0,U.jsx)(ys,{totalArticles:n,currentPage:i,pagePath:r,archivesUrl:`https://www.20minutes.fr/archives`})}),/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,mt:`xxl`,children:/* @__PURE__ */ (0,U.jsx)(ka,{...a})})]})]});return Object.keys(o).length===0?c:/* @__PURE__ */ (0,U.jsx)(q,{...o,children:c})},Xb=e=>{if(!window.lazyObservers?.defaultObserver&&!window.lazyObservers?.instantObserver){window.lazyElementsToObserve=window.lazyElementsToObserve||[],window.lazyElementsToObserve.push(e);return}let t=e.dataset?.distanceVisible;t===`700`?window.lazyObservers?.defaultObserver?.observe(e):t===`0`&&window.lazyObservers?.instantObserver?.observe(e)},Zb=(e,t)=>{e.forEach(e=>{if(e.isIntersecting&&e.target instanceof HTMLElement){let{target:n}=e,r=n.id,i=n.dataset?.eventName;(r||i)&&(n.dataset.lazyLoaded=`true`,t.unobserve(n),i?(document.dispatchEvent(new CustomEvent(i,{detail:{target:n}})),console.info(`20minLazyCall: element event name %c${i}%c has been lazy loaded`,`color: #0777;font-weight:bold;`,`color: black`)):r&&(n.dispatchEvent(new Event(r)),console.info(`20minLazyCall: element with id %c${r}%c has been lazy loaded`,`color: #0777;font-weight:bold;`,`color: black`)))}})},Qb=()=>{document.querySelectorAll(`[data-delayed="true"]:not([data-dfp-name]):not([data-lazy-loaded="true"])`).forEach(e=>{Xb(e)})},$b=()=>{window.lazyObservers={},window.lazyObservers.defaultObserver=new IntersectionObserver(Zb,{rootMargin:`700px`,threshold:0}),window.lazyObservers.instantObserver=new IntersectionObserver(Zb,{rootMargin:`0px`,threshold:0}),(window.lazyElementsToObserve||[]).forEach(e=>{Xb(e)}),Qb()},ex=({medias:e,imgEndpoint:t})=>{let n=e?.find(e=>e&&e.illustration===!0&&e.type===`photo`&&e.photo?.node?.id);if(!n?.photo?.node?.id)return``;let r=n.photo?.node?.slug?`%format_${n.photo.node.slug}`:`%format`;return`${t}/${ob(n.photo.node.id)}/${r}`},tx=({photo:e})=>e?.node?[{type:`photo`,illustration:!0,legend:e.node.caption??null,photo:{node:{id:e.node.id,brand_id:e.node.brand_id,title:e.node.title??null,caption:e.node.caption??null,credit:e.node.credit??null,slug:e.node.slug??null}},video:null,podcast:null}]:[],nx=({medias:e,picto:t,editorialModel:n})=>{if(n===`Story`)return{caption:{iconName:`diaporama`}};let r;if(t)switch(t){case`video`:if(n!==`Page`){let t=e?.find(e=>e&&e?.illustration===!0&&e?.type===`video`&&e.video?.duration)?.video?.duration;return{caption:{iconName:`video`,text:t?Is(Number(t)):``}}}break;case`podcast`:return{caption:{iconName:`podcast`}};default:return r}else e?.forEach(e=>{if(e?.type===`podcast`&&(r={caption:{iconName:`podcast`}}),e?.type===`video`&&e?.illustration&&n!==`Page`){let t=e?.video?.duration?Number(e?.video?.duration):null;r={caption:{iconName:`video`,text:t?Is(t):``}}}});return r},rx=({pageEndpoint:e,imgEndpoint:t,layout:n,data:r})=>Array.isArray(r)?[]:(r?.brand?.node?.tag?.node?.publishableContents?.edges||[])?.reduce((r,i)=>(!i?.node?.short_title||!i?.node?.medias||!i?.node?.url_current||r.push({title:i.node.short_title,cardImageProps:{cover:ex({medias:i.node.medias,imgEndpoint:t}),caption:{iconName:`video`,text:i?.node?.video?.node?.duration?.toString()?Is(parseInt(i.node.video.node.duration.toString(),10)):void 0}},link:new URL(i.node.url_current,e).href,layout:n,...n===Y.MOBILE&&{reverseCard:!0}}),r),[]),ix=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery?.endCursor||null),[r,i]=W.default.useState(e.defaultVariablesForQuery?.hasNextPage||!1),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,a=new Headers;window.envVariables?.apiAuthKey&&a.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${r}/?id=getTvReplaysOrExtracts&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery?.brandId,slug:e.defaultVariablesForQuery?.slug,first:8,after:t,filter:{publication_status:{eq:`published`},...e.defaultVariablesForQuery?.tagId?{tag_ids:{nin:[e.defaultVariablesForQuery.tagId]}}:{}}}))}`,options:{headers:a}}];try{let t=await du(...s),r=rx({pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,layout:e.layout,data:t});o(e=>[...e,...r]),n(t?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.endCursor||null),i(t?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.hasNextPage||!1),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[t,e.defaultVariablesForQuery,e.layout]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},ax=({isSSR:e=!0,name:t,layout:n,articles:r,variablesForQuery:i,seeMoreButton:a,...o})=>{if(r.length===0)return null;let{isLoading:s,articles:c,hasNextPage:l,onLoadMore:u}=ix({layout:n,defaultArticles:r,defaultVariablesForQuery:i});return W.default.useEffect(()=>{s||Qb()},[s]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Lb,{layout:n,articles:c,seeMoreButton:a&&l?{...a,disabled:s,onClick:u}:void 0,...o}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({[`${t}TvExtractsAndReplaysContainer`]:{layout:n,articles:c,variablesForQuery:i,seeMoreButton:a,...o}})} };`}})]})},ox=e=>{switch(e){case`FRA`:return`Nationale`;case`BOR`:return`Bordeaux`;case`LIL`:return`Lille`;case`MAR`:return`Marseille`;case`MON`:return`Montpellier`;case`NAN`:return`Nantes`;case`NIC`:return`Nice`;case`PAR`:return`Paris`;case`REN`:return`Rennes`;case`STR`:return`Strasbourg`;case`TOU`:return`Toulouse`;default:return``}},sx=e=>{let t=e.slice(0,4),n=e.slice(4,6),r=e.slice(6,8),i=[`janvier`,`février`,`mars`,`avril`,`mai`,`juin`,`juillet`,`août`,`septembre`,`octobre`,`novembre`,`décembre`][parseInt(n,10)-1];return`${parseInt(r,10)} ${i} ${t}`},cx=({data:e})=>{let t=[];return Array.isArray(e)||e?.brand?.node?.edition?.node?.pdfs?.edges?.forEach(e=>{e?.node?.url&&e?.node?.publication_date&&t.push({href:e?.node?.url,name:`Lire le journal du ${sx(e?.node?.publication_date)} - édition ${ox(e.node.url.match(/[0-9]{8}_([A-Z]{3})\.pdf/)?.[1]??``)}`})}),t},lx={editionSelectorId:`archivePdfListEditionSelector`,monthSelectorId:`archivePdfListMonthSelector`},ux=({isSSR:e=!0,variablesForQuery:t,layout:n,title:r,selectorsLabel:i,editionSelector:a,monthSelector:o,editions:s,enabled:c})=>{let[l,u]=W.default.useState(s),d=W.default.useCallback(async()=>{let{apiHost:e}=document.body.dataset,n=new Headers;window.envVariables?.apiAuthKey&&n.append(`auth-key`,window.envVariables.apiAuthKey);let r=document.getElementById(lx.editionSelectorId),i=document.getElementById(lx.monthSelectorId),a=[{url:`${e}/?id=getPdfsByEditionSlug&variables=${encodeURIComponent(JSON.stringify({brandId:t?.brandId,slug:r?.value,first:100,sort:`ASC`,year:t?.year,month:i?.value}))}`,options:{headers:n}}];try{let e=await du(...a),t=cx({data:e});u(t)}catch(e){console.error(`20mn> Error while searching:`,e)}},[t?.brandId,t?.year]);return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Pb,{title:r,selectorsLabel:i,editionSelector:{...a,onChange:d},monthSelector:o&&{...o,onChange:d},editions:l,layout:n,enabled:c}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({archivePdfListContainer:{title:r,layout:n,selectorsLabel:i,editionSelector:a,monthSelector:o,editions:s,variablesForQuery:t,enabled:c}})} };`}})]})},dx=e=>e?Da.find(t=>e.includes(t)):void 0,fx=e=>e!=null,px=/* @__PURE__ */ `actu-generale.justice.economie.auto.emploi.faits_divers.france.politique.sante.societe.monde.locales.nantes.toulouse.strasbourg.lyon.bordeaux.lille.marseille.montpellier.nice.paris.rennes.elections-municipales.production.publicommunique.magazine`.split(`.`),mx=({pageEndpoint:e,imgEndpoint:t,staticEndpoint:n,data:r,hasSummary:i=!1,layout:a})=>Array.isArray(r)?[]:(r?.brand?.node?.tag?.node?.publishableContents?.edges||[])?.reduce((r,o)=>{if(!o?.node?.title||!o?.node?.label||!o?.node?.url||!o?.node?.medias&&!o?.node?.photo?.node)return r;let s=o?.node?.editorial_model===`ExternalContent`,c=o?.node?.editorial_model===`Story`,l=o.node.medias?o.node.medias.filter(fx):[];c&&o?.node?.photo?.node&&(l=tx({photo:o.node.photo}));let u=o?.node?.editorial_model===`Article`&&!px.includes(o?.node?.rubric?.node?.slug||``);return r.push({layout:a,link:new URL(o.node.url,e).href,title:o.node.short_title||o.node.title,cardImageProps:{cover:ex({medias:l,imgEndpoint:t}),...nx({medias:l,picto:o?.node?.picto,editorialModel:o?.node.editorial_model})},cardHeaderProps:{headline:{text:o.node.label,color:dx(o?.node?.rubric?.node?.themeColor?.node?.slug)},rightSubheader:{text:o.node.published_at||``}},cardTitleProps:{cartridge:o?.node?.editorial_model===`Live`?`live`:void 0},socialBarProps:{layout:a,disableComment:!c&&!o.node.enable_comments,variant:`card`,contentLink:new URL(o.node.url,e).href,commentAnchor:`mbrs-comments-container`,commentCount:o.node.comments_count??0,shareCount:o.node.facebook_count??0,contentId:o.node?.id?.toString(),contentLegacyId:s?void 0:o.node?.legacy_id?.toString(),contentModel:o?.node?.editorial_model||void 0,...u&&{reactionCount:Gs(o.node.reactions_count),reactListItems:Ks(o.node.reactions_count)}},...i&&{summaryProps:{children:o.node.lead}},...s&&n&&o?.node?.contentSource?.node?.name&&o?.node?.contentSource?.node?.logo&&o?.node?.contentSource?.node?.url&&{cardFooterProps:{avatarUrl:new URL(o.node.contentSource.node.logo,n).href,text:o.node.contentSource.node.name,externalLink:o.node.contentSource.node.url}}}),r},[]),hx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r,staticHost:s}=document.body.dataset,l=new Headers;window.envVariables?.apiAuthKey&&l.append(`auth-key`,window.envVariables.apiAuthKey);let u=[{url:`${r}/?id=getTagArticlesWithCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery.brandId,slug:e.defaultVariablesForQuery.slug,first:e.defaultVariablesForQuery.first,after:t}))}`,options:{headers:l}}];try{let e=await du(...u),t=mx({pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,staticEndpoint:s||``,data:e,layout:window.layout}),r={articles:[...a,...t],endCursor:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.endCursor??null,hasNextPage:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.hasNextPage??!1};o(e=>[...e,...t]),n(r.endCursor),i(r.hasNextPage),window?.localStorage.setItem(`aticles-container-data`,JSON.stringify(r)),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}finally{c(!1)}},[a,t,e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.first,e.defaultVariablesForQuery.slug]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{if(cl(),!window?.performance?.getEntriesByType(`navigation`).map(e=>e.type).includes(`back_forward`))window?.localStorage.removeItem(`aticles-container-data`);else{let e=qs(`aticles-container-data`);e&&Object.hasOwn(e,`articles`)&&Object.hasOwn(e,`endCursor`)&&Object.hasOwn(e,`hasNextPage`)&&(o(e.articles),n(e.endCursor),i(e.hasNextPage),nc())}},[]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},gx=({isSSR:e=!0,layout:t,articles:n,variablesForQuery:r,seeMoreButton:i,currentPagePath:a,tagTotalArticles:o,columnsNumber:s})=>{let{isLoading:c,articles:l,hasNextPage:u,onLoadMore:d}=hx({defaultArticles:n,defaultVariablesForQuery:r});W.default.useEffect(()=>{c||Qb()},[c]);let f=l.map(e=>({...e,...e.cardImageProps&&{cardImageProps:{...e.cardImageProps,sizes:`(min-width: 1660px) 384px, (min-width: 1440px) calc(18vw + 89px), (min-width: 1080px) 320px, (min-width: 780px) calc(44.29vw - 149px), calc(50vw - 16px)`}}}));return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Lb,{layout:t,articles:f,isLoading:c,skeletonCount:r.first,seeMoreButton:u?{...i,disabled:c,onClick:d}:void 0,currentPagePath:a,tagTotalArticles:o,columnsNumber:s}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({articleListBottomContainer:{layout:t,articles:f,variablesForQuery:r,seeMoreButton:i,skeletonCount:r.first}})} };`}})]})},_x={storageName:`20mnBreakingNews`,storageDelay:18e4},vx=()=>{let[e,t]=W.default.useState(!1),[n,r]=W.default.useState(qs(_x.storageName));return W.default.useEffect(()=>{n&&localStorage.setItem(_x.storageName,JSON.stringify(n))},[n]),W.default.useEffect(()=>{e&&document&&document.querySelectorAll(`#c-alert-info a`).forEach(e=>{e.addEventListener(`click`,e=>{e.stopPropagation(),e.preventDefault();let t=``;e.target instanceof HTMLAnchorElement?t=e.target.href:e.target instanceof HTMLElement&&(t=e.target.closest(`a`)?.href||``),Z({name:`content`,type:`action`,customProps:{cta_context:`smartbanner_alert`,cta_type:`link`,cta_destination:t,cta_engagement:2}}),window.location.href=t})})},[e]),W.default.useEffect(()=>{if(Object.keys(n??{}).includes(`opened`)&&r(e=>({open:e?.opened??!1,time:e?.time,data:e?.data})),n?.time&&n.time+_x.storageDelay>Date.now()){n.open&&t(!0);return}let{apiHost:e,imgHost:i,brandId:a}=document.body.dataset,o=new Headers;window.envVariables?.apiAuthKey&&o.append(`auth-key`,window.envVariables.apiAuthKey);let s=a?rc(`Brand:${a}`):void 0,c=[{url:`${e}/?id=getBreakingNews&variables=${encodeURIComponent(JSON.stringify({brandId:s}))}`,options:{headers:o}}];du(...c).then(e=>{let a=e?.brand?.node?.home?.node?.homeBreakingNews?.node,o;switch(a?.content?.editorial_model){case`Article`:o=a?.content?.article?.node;break;case`Live`:o=a?.content?.live?.node;break;default:o=void 0}if(!o?.title||!o?.url_current){t(!1);return}let s=a?.custom_title??o.title,c,l=o.medias?.[0]?.photo?.node;if(a?.with_photo&&l?.id){let e=atob(l.id).replace(`Photo:`,``);c=`${i}/${e}/147x96_${l.slug??`media`}`}let u=n&&n.data?.description===s?n.open:!0;r({open:u,time:Date.now(),data:{description:s,url:o.url_current,imageUrl:c}}),t(u)}).catch(e=>{console.error(`20mn> Error while loading the breaking news:`,e)})},[n]),e&&n?.data?/* @__PURE__ */ (0,U.jsx)(bo,{title:`ALERTE INFO`,description:n.data.description,cover:n.data.imageUrl,link:n?.data?.url?{href:n.data.url}:void 0,closeButton:{onClick:()=>{r(e=>({...e||{},open:!1})),t(!1)}}}):null},yx=({pageEndpoint:e,data:t})=>Array.isArray(t)?[]:(t?.brand?.node?.tag?.node?.publishableContents?.edges||[])?.reduce((t,n)=>(!n?.node?.title||!n?.node?.url||t.push({title:n.node.title,url:new URL(n.node.url,e).href}),t),[]),bx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,s=new Headers;window.envVariables?.apiAuthKey&&s.append(`auth-key`,window.envVariables.apiAuthKey);let c=[{url:`${r}/?id=getTagArticlesWithCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery.brandId,slug:e.defaultVariablesForQuery.slug,first:e.defaultVariablesForQuery.first,after:t}))}`,options:{headers:s}}];try{let e=await du(...c),t=yx({pageEndpoint:window.envVariables.pageEndpoint,data:e}),r={articles:[...a,...t],endCursor:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.endCursor??null,hasNextPage:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.hasNextPage??!1};o(e=>[...e,...t]),n(r.endCursor),i(r.hasNextPage),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[a,t,e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.first,e.defaultVariablesForQuery.slug]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},xx=({isSSR:e=!0,articles:t,variablesForQuery:n,seeMoreButton:r,linksSize:i,colsNumber:a})=>{let{isLoading:o,articles:s,hasNextPage:c,onLoadMore:l}=bx({defaultArticles:t,defaultVariablesForQuery:n});return W.default.useEffect(()=>{o||Qb()},[o]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Du,{articles:s,seeMoreButton:c?{...r,disabled:o,onClick:l}:void 0,linksSize:i,colsNumber:a}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsAiArticlesContainer:{articles:s,variablesForQuery:n,seeMoreButton:r,linksSize:i,colsNumber:a}})} };`}})]})},Sx=e=>{let[t,n]=W.default.useState(e.defaultMapConstituenciesProps),r=W.default.useCallback(async()=>{try{let e=await du({url:`https://static.20mn.fr/elections/map-districts.json`});n(t=>({...t,mapDistrictsData:e}))}catch(e){console.error(`20mn> Error while loading map data:`,e)}},[]);return W.default.useEffect(()=>{r(),ri(),qi()},[r]),W.default.useMemo(()=>({mapConstituenciesProps:t}),[t])},Cx=({isSSR:e=!0,mapConstituenciesProps:t,...n})=>{let{mapConstituenciesProps:r}=Sx({defaultMapConstituenciesProps:t});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(zb,{mapConstituenciesProps:e?{electionName:``,electionYear:``,resultsPerDistrict:[],mapDistrictsData:{}}:r,...n}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsConstituenciesMapContainer:{mapConstituenciesProps:t,...n}})} };`}})]})},wx=e=>{let[t,n]=W.default.useState(e.defaultMapDepartmentsProps),r=W.default.useCallback(async()=>{try{let e=await du({url:`https://static.20mn.fr/elections/map-departments.json`});n(t=>({...t,mapDepartmentsData:e}))}catch(e){console.error(`20mn> Error while loading map data:`,e)}},[]);return W.default.useEffect(()=>{r()},[r]),W.default.useMemo(()=>({mapDepartmentsProps:t}),[t])},Tx=({isSSR:e=!0,mapDepartmentsProps:t,...n})=>{let{mapDepartmentsProps:r}=wx({defaultMapDepartmentsProps:t});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Bb,{mapDepartmentsProps:e?{electionName:``,electionYear:``,resultsPerDepartment:[],mapDepartmentsData:{}}:r,...n}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsDepartmentsMapContainer:{mapDepartmentsProps:t,...n}})} };`}})]})},Ex=e=>{let[t,n]=W.default.useState(e.defaultMapEuropeProps),r=W.default.useCallback(async()=>{try{let e=await Promise.all([du({url:`https://static.20mn.fr/elections/map-eu-countries.json`}),du({url:`https://static.20mn.fr/elections/map-non-eu-countries.json`})]);n(t=>({...t,mapEuCountriesData:e[0],mapNonEuCountriesData:e[1]}))}catch(e){console.error(`20mn> Error while loading map data:`,e)}},[]);return W.default.useEffect(()=>{r()},[r]),W.default.useMemo(()=>({mapEuropeProps:t}),[t])},Dx=({isSSR:e=!0,mapEuropeProps:t,...n})=>{let{mapEuropeProps:r}=Ex({defaultMapEuropeProps:t});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Vb,{mapEuropeProps:e?{electionName:``,electionYear:``,resultsPerCountry:[],mapEuCountriesData:{},mapNonEuCountriesData:{}}:r,...n}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsEuropeanMapContainer:{mapEuropeProps:t,...n}})} };`}})]})},Ox=e=>{let[t,n]=W.default.useState(e.defaultMapTownsByDepartmentsProps),r=W.default.useCallback(async()=>{try{let t=await du({url:`https://static.20mn.fr/elections/map-departments-paths.json`}),r=await du({url:`https://static.20mn.fr/elections/map-towns.svg`,options:{headers:{"Content-Type":`image/svg+xml`}}}),i=await du({url:`https://static.20mn.fr/elections/map-droms.json`}),a=[];try{a=await du({url:`https://static.20mn.fr/elections/mn${e.defaultMapTownsByDepartmentsProps.electionYear}/electeds.json`})}catch(e){console.warn(`20mn> Error while loading town results data:`,e)}n(e=>({...e,townsSprite:r,departmentsPaths:t,dromsConfig:i,resultsPerTown:a}))}catch(e){console.error(`20mn> Error while loading town map data:`,e)}},[e.defaultMapTownsByDepartmentsProps.electionYear]);return W.default.useEffect(()=>{r()},[r]),W.default.useMemo(()=>({mapTownsByDepartmentsProps:t}),[t])},kx=({isSSR:e=!0,mapTownsByDepartmentsProps:t,...n})=>{let{mapTownsByDepartmentsProps:r}=Ox({defaultMapTownsByDepartmentsProps:t}),i={layout:t.layout,resultsPerTown:[]};return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Hb,{mapTownsByDepartmentsProps:e?i:r,...n}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({electionsMapTownsByDepartmentsContainer:{mapTownsByDepartmentsProps:t,...n}})} };`}})]})},Ax=({pageEndpoint:e,imgEndpoint:t,data:n,layout:r})=>Array.isArray(n)?[]:(n?.brand?.node?.publishableContents?.edges||[])?.reduce((n,i)=>{if(!i?.node?.title||!i?.node?.label||!i?.node?.url||!i?.node?.medias&&!i?.node?.photo?.node)return n;let a=i?.node?.editorial_model===`Story`,o=i.node.medias?i.node.medias.filter(fx):[];return a&&i?.node?.photo?.node&&(o=tx({photo:i.node.photo})),n.push({link:new URL(i.node.url,e).href,title:i.node.short_title||i.node.title,cardImageProps:{cover:ex({medias:o,imgEndpoint:t}),...nx({medias:o,picto:i?.node?.picto,editorialModel:i?.node.editorial_model})},cardHeaderProps:{headline:{text:i.node.label,color:dx(i?.node?.rubric?.node?.themeColor?.node?.slug)},rightSubheader:{text:i.node.published_at||``}},cardTitleProps:{cartridge:i?.node?.editorial_model===`Live`?`live`:void 0},socialBarProps:{layout:r,disableComment:!a&&!i.node.enable_comments,variant:`card`,contentLink:new URL(i.node.url,e).href,commentAnchor:`mbrs-comments-container`,commentCount:i.node.comments_count??0,shareCount:i.node.facebook_count??0,contentLegacyId:i.node?.legacy_id?.toString()}}),n},[]),jx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,a=new Headers;window.envVariables?.apiAuthKey&&a.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${r}/?id=getUserBackArticlesWithCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery.brandId,userBackId:e.defaultVariablesForQuery.userBackId,first:10,after:t}))}`,options:{headers:a}}];try{let e=await du(...s),t=Ax({pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,data:e,layout:window.layout});o(e=>[...e,...t]),n(e?.brand?.node?.publishableContents?.pageInfo?.endCursor||null),i(e?.brand?.node?.publishableContents?.pageInfo?.hasNextPage||!1),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[t,e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.userBackId]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},Mx=({isSSR:e=!0,layout:t,articles:n,variablesForQuery:r,seeMoreButton:i,currentPagePath:a,tagTotalArticles:o,columnsNumber:s,heading:c})=>{if(n.length===0)return null;let{isLoading:l,articles:u,hasNextPage:d,onLoadMore:f}=jx({defaultArticles:n,defaultVariablesForQuery:r});W.default.useEffect(()=>{l||Qb()},[l]);let p=u.map(e=>({...e,...e.cardImageProps&&{cardImageProps:{...e.cardImageProps,sizes:`(min-width: 1660px) 384px, (min-width: 1440px) calc(18vw + 89px), (min-width: 1080px) 320px, (min-width: 780px) calc(44.29vw - 149px), calc(50vw - 16px)`}}}));return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Lb,{layout:t,articles:p,seeMoreButton:d?{...i,disabled:l,onClick:f}:void 0,currentPagePath:a,tagTotalArticles:o,columnsNumber:s,heading:c}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({journalistArticleListContainer:{layout:t,articles:p,variablesForQuery:r,seeMoreButton:i,heading:c}})} };`}})]})},Nx=new Intl.DateTimeFormat(`fr`,{timeStyle:`short`,timeZone:`Europe/Paris`}),Px=({layout:e,pageEndpoint:t,imgEndpoint:n,data:r})=>Array.isArray(r)?[]:(r?.brand?.node?.publishableContents?.edges||[])?.reduce((r,i)=>{if(!i?.node?.title||!i?.node?.label||!i?.node?.url||!i?.node?.published_at||!i?.node?.medias&&!i?.node?.photo?.node)return r;let a=i.node.medias??[];return i?.node?.editorial_model===`Story`&&i?.node?.photo?.node&&(a=tx({photo:i.node.photo})),r.push({link:new URL(i.node.url,t).href,title:i.node.short_title||i.node.title,cardImageProps:{cover:ex({medias:a,imgEndpoint:n}),...nx({medias:a,picto:i?.node?.picto,editorialModel:i?.node.editorial_model})},socialBarProps:{layout:e,commentCount:i.node.comments_count??0,shareCount:(i.node.facebook_count??0)+(i.node.pinterest_count??0),contentLegacyId:i.node?.legacy_id?.toString(),contentLink:new URL(i.node.url,t).href,commentAnchor:`mbrs-comments-container`},cardHeaderProps:{headline:{text:i.node.label,color:dx(i?.node?.rubric?.node?.themeColor?.node?.slug)},liveTime:Nx.format(new Date(i.node.published_at).getTime()).replace(`:`,`h`)},cardTitleProps:{cartridge:i?.node?.editorial_model===`Live`?`live`:void 0},summaryProps:{children:i?.node?.lead??``},layout:e}),r},[]),Fx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,a=new Headers;window.envVariables?.apiAuthKey&&a.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${r}/?id=getLatestContentsCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery.brandId,sourceExcluded:e.defaultVariablesForQuery.sourceExcluded,first:e.defaultVariablesForQuery.first,after:t}))}`,options:{headers:a}}];try{let e=await du(...s),t=Px({layout:window.layout,pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,data:e});o(e=>[...e,...t]),n(e?.brand?.node?.publishableContents?.pageInfo?.endCursor??null),i(e?.brand?.node?.publishableContents?.pageInfo?.hasNextPage??!1),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[t,e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.first,e.defaultVariablesForQuery.sourceExcluded]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useEffect(()=>{ul()},[]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},Ix=({isSSR:e=!0,layout:t,articles:n,variablesForQuery:r,seeMoreButton:i})=>{let{isLoading:a,articles:o,hasNextPage:s,onLoadMore:c}=Fx({defaultArticles:n,defaultVariablesForQuery:r});return W.default.useEffect(()=>{a||Qb()},[a]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Db,{layout:t,articles:o,seeMoreButton:s?{...i,disabled:a,onClick:c}:void 0}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({latestArticlesContainer:{layout:t,articles:o,variablesForQuery:r,seeMoreButton:i}})} };`}})]})},Lx=({layout:e,pageEndpoint:t,imgEndpoint:n,data:r})=>Array.isArray(r)?[]:(r?.brand?.node?.publishableContents?.edges||[])?.reduce((r,i)=>{if(!i?.node?.title||!i?.node?.url||!i?.node?.medias||!i?.node?.rubric?.node?.label||!(i?.node?.medias.length||i?.node?.photo?.node))return r;let a=i.node.medias??[];return i?.node?.editorial_model===`Story`&&i?.node?.photo?.node&&(a=tx({photo:i.node.photo})),r.push({link:new URL(i.node.url,t).href,title:i.node.short_title||i.node.title,cardImageProps:{cover:ex({medias:a,imgEndpoint:n}),...nx({medias:a,picto:i?.node?.picto,editorialModel:i?.node.editorial_model}),lazyLoad:!0},cardHeaderProps:{headline:{text:i?.node?.label||i.node.rubric.node.label,color:dx(i?.node?.rubric?.node?.themeColor?.node?.slug)}},cardTitleProps:{cartridge:i?.node?.editorial_model===`Live`?`live`:void 0,as:`h3`},layout:e}),r},[]),Rx=e=>{let[t,n]=W.default.useState(e.defaultArticles),r=W.default.useCallback(async()=>{let{apiHost:t}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let i=[{url:`${t}/?id=getLatestContentsCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.variablesForQuery.brandId,sourceExcluded:e.variablesForQuery.sourceExcluded,first:e.variablesForQuery.first}))}`,options:{headers:r}}];try{let e=await du(...i),t=Lx({layout:window.layout,data:e,pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint});n(t)}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[e.variablesForQuery.brandId,e.variablesForQuery.first,e.variablesForQuery.sourceExcluded]);return W.default.useEffect(()=>{r()},[r]),W.default.useMemo(()=>({articles:t}),[t])},zx=({isSSR:e=!0,articles:t,variablesForQuery:n,...r})=>{let{articles:i}=Rx({defaultArticles:t,variablesForQuery:n});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Fb,{...r,articles:i,variablesForQuery:n}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({latestContentsCarouselContainer:{articles:t,variablesForQuery:n,...r}})} };`}})]})},Bx=e=>{let t=[];return e.legalNotices.forEach(n=>{let r=n?.node;t.push({link:r?.external_id?new URL(`/al/${r?.external_id}`,e.legalNoticeEndpoint).href:``,title:r?.title??void 0,location:r?.legalNoticeDepartment?.node?.name||``,summaryProps:{children:r?.publishing_date?`Publié le ${Bs(new Date(r.publishing_date),!1)}`:Vs(new Date(Date.now()).toLocaleString())},cardTitleProps:{...r?.external_id?{as:`a`,href:new URL(`/al/${r?.external_id}`,e.legalNoticeEndpoint).href,className:`opacity-hover`}:{}}})}),t},Vx=e=>e!=null,Hx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.legalNotices),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,a=new Headers;window.envVariables?.apiAuthKey&&a.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${r}/?id=getLegalNoticesFromDept&variables=${encodeURIComponent(JSON.stringify({slug:e.defaultVariablesForQuery.slug,first:10,after:t}))}`,options:{headers:a}}];try{let e=await du(...s),t=e?.legalNotices?.edges?.filter(Vx)??[],r=Bx({legalNotices:t,legalNoticeEndpoint:window.location.origin});o(e=>[...e,...r]),n(e?.legalNotices?.pageInfo?.endCursor||null),i(e?.legalNotices?.pageInfo?.hasNextPage||!1),nc()}catch(e){console.error(`20mn> Error while loading annnouncements:`,e)}},[t,e.defaultVariablesForQuery.slug]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,legalNotices:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},Ux=({isSSR:e=!0,variablesForQuery:t,legalNotices:n})=>{let{isLoading:r,legalNotices:i,hasNextPage:a,onLoadMore:o}=Hx({legalNotices:n,defaultVariablesForQuery:t});return W.default.useEffect(()=>{r||Qb()},[r]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Ob,{legalNotices:i,seeMoreLegalNotices:a?{disabled:r,onClick:o,children:`Voir plus d’annonces légales`}:void 0,mx:{xs:`m`,md:`0`}}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({legalNoticeDepartmentContainer:{legalNotices:i,variablesForQuery:t}})} };`}})]})},Wx=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.legalNotices),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:e}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let a=[{url:`${e}/?id=getLegalNotices&variables=${encodeURIComponent(JSON.stringify({first:10,after:t}))}`,options:{headers:r}}];try{let e=await du(...a),t=e?.legalNotices?.edges?.filter(Vx)??[],r=Bx({legalNotices:t,legalNoticeEndpoint:window.location.origin});o(e=>[...e,...r]),n(e?.legalNotices?.pageInfo?.endCursor||null),i(e?.legalNotices?.pageInfo?.hasNextPage||!1),nc()}catch(e){console.error(`20mn> Error while loading annnouncements:`,e)}},[t]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,legalNotices:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},Gx=({isSSR:e=!0,variablesForQuery:t,legalNotices:n})=>{let{isLoading:r,legalNotices:i,hasNextPage:a,onLoadMore:o}=Wx({legalNotices:n,defaultVariablesForQuery:t});return W.default.useEffect(()=>{r||Qb()},[r]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Ob,{legalNotices:i,seeMoreLegalNotices:a?{disabled:r,onClick:o,children:`Voir plus d’annonces légales`}:void 0,mx:{xs:`m`,md:`0`}}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({legalNoticeHomeContainer:{legalNotices:i,variablesForQuery:t}})} };`}})]})},Kx=e=>{let t=new Intl.DateTimeFormat(`fr`,{timeStyle:`short`,timeZone:`Europe/Paris`});return{name:e.name,title:e.title,tabColor:e.tabColor,body:e.articleEdges.reduce((n,r)=>{if(r?.node?.title&&r?.node?.url&&r?.node?.rubric?.node?.slug&&r?.node?.rubric?.node?.label){let i;if(e.imgEndpoint){let t=r.node.medias??[];r?.node?.editorial_model===`Story`&&r?.node?.photo?.node&&(t=tx({photo:r.node.photo})),i={cover:ex({medias:t,imgEndpoint:e.imgEndpoint}),lazyLoad:!0}}let a={themeColor:r.node.rubric.node.themeColor?.node?.lightmode_color||void 0,rubricName:r?.node?.label||r.node.rubric.node.label,title:r?.node?.short_title||r.node.title,url:new URL(r.node.url,e.pageEndpoint).href,cartridge:r.node?.editorial_model===`Live`&&r.node?.state===`open`?`live`:void 0,...i?{cardImageProps:i}:{}};e.name===`le-direct`&&r?.node?.published_at&&(a.liveTime=t.format(new Date(r.node.published_at).getTime()).replace(`:`,`h`)),n.push(a)}return n},[]).slice(0,e.limit)}},qx=({data:e,pageEndpoint:t,liveLimit:n,mostReadLimit:r})=>{if(Array.isArray(e))return[];let i=e?.brand?.node,a=i?.mostReadArticles?.edges,o=i?.liveArticles?.edges,s=[];if(o?.length){let e=Kx({name:`le-direct`,title:`Le direct`,pageEndpoint:t,articleEdges:o,limit:n,tabColor:`red`});s.push(e)}if(a?.length){let e=Kx({name:`plus-lus`,title:`Les + lus`,pageEndpoint:t,articleEdges:a,limit:r});s.push(e)}return s},Jx=e=>{let[t,n]=W.default.useState(e.defaultTabItems),r=W.default.useCallback(async()=>{if(e.variablesForQuery.liveLimit&&e.variablesForQuery.mostReadLimit){let{apiHost:t}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let i=[{url:`${t}/?id=getLiveAndMostRead&variables=${encodeURIComponent(JSON.stringify({brandId:e.variablesForQuery.brandId,sourceExcluded:e.variablesForQuery.sourceExcluded,mostReadSourceExcluded:e.variablesForQuery.mostReadSourceExcluded,liveLimit:e.variablesForQuery.liveLimit,mostReadLimit:e.variablesForQuery.mostReadLimit}))}`,options:{headers:r}}];try{let t=await du(...i),r=qx({data:t,pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,liveLimit:e.variablesForQuery.liveLimit,mostReadLimit:e.variablesForQuery.mostReadLimit});n(r),ri()}catch(e){console.error(`20mn> Error while loading tabItems:`,e)}}},[e.variablesForQuery.brandId,e.variablesForQuery.liveLimit,e.variablesForQuery.mostReadLimit,e.variablesForQuery.sourceExcluded,e.variablesForQuery.mostReadSourceExcluded]);return W.default.useEffect(()=>{r()},[r]),W.default.useMemo(()=>({tabItems:t}),[t])},Yx=({isSSR:e=!0,layout:t,tabItems:n,variablesForQuery:r,...i})=>{let{tabItems:a}=Jx({defaultTabItems:n,variablesForQuery:r});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(qb,{...i,layout:t,tabItems:a,variablesForQuery:r,hasButton:!0}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({liveAndMostReadContainer:{layout:t,tabItems:n,variablesForQuery:r}})} };`}})]})},Xx=()=>{window.didomiOnReady=window.didomiOnReady||[],window.didomiOnReady.push(e=>{let t=Array.from(document.getElementsByClassName(`embed-placeholder`)),n=e.getCurrentUserStatus(),r=n?.purposes?.[`activation-gGierZpp`]?.enabled;t.forEach(e=>{let t=e.querySelector(`.cmp-placeholder`),i=e.querySelector(`.embed-wrapper`);t instanceof Element&&i instanceof Element&&(r&&(n?.vendors[e.getAttribute(`data-vendor`)||``]?.enabled??!0)?(t.classList.add(`u-hidden`),i.classList.remove(`u-hidden`),i.querySelectorAll(`[data-src]`).forEach(e=>{let t=e.getAttribute(`data-src`);t&&(e.setAttribute(`src`,t),e.removeAttribute(`data-src`))})):(t.classList.remove(`u-hidden`),i.classList.add(`u-hidden`)))})})},Zx=()=>{let e=Array.from(document.querySelectorAll(`[data-script-loading="lazy"]`));e.length>0&&(e.forEach(e=>{let t=document.createElement(`script`);t.type=`text/javascript`,t.innerHTML=e.innerHTML.replace(/"|&/g,e=>e===`"`?`"`:`&`),t.innerHTML=t.innerHTML.replace(/'/g,`'`),e.after(t),e.remove()}),Xx())},Qx=[`pave_haut`,`pave_milieu`,`pave_bas`,`pave_com`,`native_web`,`banniere_milieu`],$x={firstSlotId:`inarticle1`,secondSlotId:`inarticle2`,duplicateSlotPrefix:`inarticle3`},eS=()=>{Qx.forEach(e=>{let t=`#${e}`,n=[...document.querySelectorAll(t)].filter(e=>e instanceof HTMLElement);for(let t=1;t<=20;t+=1){let r=document.getElementById(`${e}_${t}`);r&&n.push(r)}let r=1;n.length>1&&n.forEach(t=>{t.id=`${e}_${r}`,r+=1})})},tS=()=>{let{firstSlotId:e,secondSlotId:t,duplicateSlotPrefix:n}=$x,r=[...document.querySelectorAll(`#${e}, #${t}, [id^="${n}"]`)],i=!1,a=!1,o=1;r.forEach(r=>{let s=r.id===e,c=r.id===t;s&&!i?(r.id=e,i=!0):c&&!a?(r.id=t,a=!0):(r.id=`${n}_${o}`,o+=1)})},nS=()=>{eS(),tS()},rS=e=>{switch(e){case`default`:case`important`:case`community`:case`faq`:case`bold`:return e;case`very_important`:return`crucial`;default:return`default`}},iS=(e,t)=>Array.isArray(e)?[]:(e?.brand?.node?.live?.node?.livePosts?.edges||[])?.reduce((e,n)=>{if(!n)return e;let r=n?.node?.content_md?.blocks;if(r){let e=[...r],t=e?.slice(-1);t?.[0]?.text===``&&t?.[0]?.type===`unstyled`&&(e.pop(),r=e)}let i;n?.node?.comment?.node&&(i={question:n.node.comment.node.content||``,author:n.node.comment.node.userFront?.node?.username||``,response:r?.[0]?.text});let a=n.node?.legacy_id;return a&&e.push({cursor:n?.cursor||null,id:a,title:{status:rS(n?.node?.type),header:n?.node?.printed_hour||``,title:n?.node?.title||``,img:n?.node?.livePostLabel?.node&&t?{name:n.node.livePostLabel.node.slug||``,src:n.node.livePostLabel.node.logo?`${t}/${n.node.livePostLabel.node.logo}`:``}:void 0},content:i?void 0:{entityMap:{},...n?.node?.content_md,blocks:r??[]},talk:i}),e},[]),aS=e=>{e.some(({content:e})=>Object.values(e?.entityMap||{}).some(({type:e,data:t})=>e===`iframely`&&t?.embedProps?.meta?.site===`idalgo`&&t?.embedProps?.meta?.type===`widget`))&&(window?.iDalgoLoader?window.iDalgoLoader.init():vl({name:`widget_live-posts`,src:`https://20minutes.idalgo-hosting.com/partners/i/cache/datasport/cache/page/r_js_jlu_url.php`,load:`async`}))},oS=e=>{let t=e.filter(({content:e})=>Object.values(e?.entityMap||{}).some(({type:e,data:t})=>e===`iframely`&&(t?.embedProps?.js||t?.embedProps?.css)));t.length&&t.forEach(({content:e})=>{Object.values(e?.entityMap||{}).forEach(({type:e,data:t})=>{if(e===`iframely`&&(t?.embedProps?.js||t?.embedProps?.css)){let{js:e=[],css:n=[]}=t?.embedProps||{};e.length&&e.forEach((e,t)=>{vl({name:`embed_live-posts-${t}`,src:e,load:`async`})}),n.length&&n.forEach(e=>{let t=document.createElement(`link`);t.type=`text/css`,t.rel=`stylesheet`,t.href=e,document.head.appendChild(t)})}})})},sS=()=>{let{hash:e}=new URL(window.location.href),t=e.match(/#post-(\d+)/);return t?Number(t[1]):null},cS=async({first:e,after:t,filter:n,brandId:r,liveId:i})=>{let{apiHost:a}=document.body.dataset,o=new Headers;window.envVariables?.apiAuthKey&&o.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${a}/?id=getLivePosts&variables=${encodeURIComponent(JSON.stringify({brandId:r,liveId:i,first:e,after:t,filter:n}))}`,options:{headers:o}}],c=await du(...s);return{nextPosts:iS(c,document.body.dataset.staticHost),pageInfo:c?.brand?.node?.live?.node?.livePosts?.pageInfo??null}},lS=async({batchSize:e,after:t,filter:n,brandId:r,liveId:i,accumulatedPosts:a,anchorPostId:o})=>{let{nextPosts:s,pageInfo:c}=await cS({first:100,after:t,filter:n,brandId:r,liveId:i}),l=[...a,...s],u=c?.endCursor??null,d=c?.hasNextPage??!1,f=l.findIndex(e=>e.id===o);if(f!==-1){let t=Math.ceil((f+1)/e)*e,n=t>l.length?l[l.length-1].cursor:l[t-1].cursor,r=l.length>t||d;return{nextPosts:l.slice(0,t),pageInfo:{endCursor:n,hasNextPage:r}}}return d&&u?lS({batchSize:e,after:t,filter:n,brandId:r,liveId:i,accumulatedPosts:l,anchorPostId:o}):{nextPosts:[],pageInfo:c}},uS=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultPosts),[s,c]=W.default.useState(!1),[l,u]=W.default.useState(!1),d=W.default.useCallback(()=>{c(!0)},[]),f=W.default.useCallback(async()=>{let r=sS(),a=e.defaultVariablesForQuery.first,{filter:s,brandId:c,liveId:d}=e.defaultVariablesForQuery;try{if(r&&!l&&s?.type?.eq!==`very_important`){let{nextPosts:e}=await lS({batchSize:a,after:t,filter:s,brandId:c,liveId:d,accumulatedPosts:[],anchorPostId:r});o(t=>[...t,...e]),u(!!r),oS(e)}else{let{nextPosts:e,pageInfo:r}=await cS({first:a,after:t,filter:s,brandId:c,liveId:d});n(r?.endCursor??null),i(r?.hasNextPage??!1),o(t=>[...t,...e]),oS(e)}nc()}catch(e){console.error(`20mn> Error while loading posts:`,e)}},[t,l,e.defaultVariablesForQuery]);return W.default.useEffect(()=>{sS()&&!document.getElementById(`post-${sS()}`)&&c(!0)},[]),W.default.useEffect(()=>{document.querySelector(`#tabpanel-le-direct #post-${sS()}`)?.scrollIntoView({behavior:`smooth`,block:`start`})},[]),W.default.useEffect(()=>{s&&f(),aS(a),nS(),Xx()},[s,f,a]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useEffect(()=>{nS()},[]),W.default.useMemo(()=>({isLoading:s,posts:a,hasNextPage:r,onLoadMore:d}),[s,a,r,d])},dS=({isSSR:e=!0,posts:t,variablesForQuery:n,seeMoreLink:r,staticHydrationDataName:i=`livePostsContainer`,disableAds:a,...o})=>{let{isLoading:s,posts:c,hasNextPage:l,onLoadMore:u}=uS({defaultPosts:t,defaultVariablesForQuery:n});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Gb,{...o,posts:c,variablesForQuery:n,disableAds:a,seeMoreLink:l?{...r,disabled:s,onClick:u}:void 0}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({[i]:{posts:Zs(c),variablesForQuery:n,seeMoreLink:r,disableAds:a,...o}})} };`}})]})},fS=()=>{let[e,t]=W.default.useState(null),[n,r]=W.default.useState(0),i=document.getElementById(`tabpanel-le-direct`),a=document.getElementById(`tabpanel-temps-forts`),o=window.__staticHydrationData?.livePostsContainer,s=W.default.useRef(o?.refreshButton?.latestPostId.toString()),c=o?.refreshButton?.state,{brandId:l,liveId:u}=o?.variablesForQuery??{},d=W.default.useCallback(()=>{let{apiHost:e}=document.body.dataset,t=new Headers;return window.envVariables?.apiAuthKey&&t.append(`auth-key`,window.envVariables.apiAuthKey),[{url:`${e}/?id=getLivePosts&variables=${encodeURIComponent(JSON.stringify({brandId:l,liveId:u,first:20,filter:{status:{eq:`published`}}}))}`,options:{headers:t}}]},[l,u]),f=W.default.useCallback(async()=>{let e=d();try{let t=await du(...e),n=0;t?.brand?.node?.live?.node?.livePosts?.edges?.every(e=>e?.node?.legacy_id!==Number(s.current)&&(n+=1,!0)),r(n)}catch(e){console.error(`20mn> Error while refreshing refresh button counter:`,e)}},[d]),p=W.default.useCallback(()=>{let e=document.querySelector(`[data-tabs-name="live-tabs"]`),t=document.getElementById(`tab-le-direct`),n=document.getElementById(`tabpanel-le-direct`);if(e){let r=e.querySelectorAll(`.c-tab`),i=e.querySelectorAll(`.c-tabpanel`);r.forEach(e=>{e.setAttribute(`aria-selected`,`false`),e.setAttribute(`tabindex`,`-1`)}),i.forEach(e=>{e.setAttribute(`aria-hidden`,`true`)}),t&&(t.setAttribute(`aria-selected`,`true`),t.setAttribute(`tabindex`,`0`)),n&&n.setAttribute(`aria-hidden`,`false`)}},[]),m=W.default.useCallback(async()=>{p();let e=d();try{let t=[],n=[],r=await du(...e),o=iS(r,document.querySelector(`body`)?.dataset.staticHost),c=0;if(o?.every(e=>e.id.toString()!==s.current&&(c+=1,!0)),c===0){window.location.reload();return}p();let l=document.getElementById(`tabpanel-le-direct`)?.querySelectorAll(`.js-post`).length||0,u=l+c;o=o.slice(0,c),o.reverse(),o?.every((e,r)=>{let i=r+l,a=em.renderToStaticMarkup(/* @__PURE__ */ (0,U.jsx)(Wb,{post:e,postIndex:i,postsCount:u,layout:window.layout,pageEndpoint:window.envVariables.pageEndpoint},e.id));return t.push(a),e.title.status===`crucial`&&n.push(a),!0});let d=a?.firstChild;if(d instanceof HTMLElement&&d.firstChild instanceof HTMLElement){let e=document.createElement(`div`);for(e.innerHTML=n.reverse().join(``);e.lastChild;)d.prepend(e.lastChild)}let f=i?.firstChild;if(f instanceof HTMLElement&&f.firstChild instanceof HTMLElement){let e=document.createElement(`div`);for(e.innerHTML=t.reverse().join(``);e.lastChild;)f.prepend(e.lastChild);let n=o.reverse()[0];n&&(s.current=n.id.toString()),nS(),nc()}}catch(e){console.error(`20mn> Error while loading more live posts:`,e)}},[d,a,i,p]);W.default.useEffect(()=>{c===`open`&&l&&s.current&&u?setInterval(f,6e4):console.info(`Do not check for new post, live is either closed or miss information.`)},[f,l,u,c]),W.default.useEffect(()=>{if(t(n>0?`Actualiser (${n})`:`Actualiser`),window.layout!==Y.MOBILE){let e=document.title.replace(/^\(\+?[0-9]+\) /,``);n>9?document.title=`(+${n}) ${e}`:n>0?document.title=`(${n}) ${e}`:document.title=e}},[n]);let h=W.default.useCallback(()=>{Z({name:`refresh_content`,type:`action`,customProps:{cta_context:`content`,cta_type:`button`,cta_destination:window.location.href,cta_engagement:1},chapter1:`live`}),m().then(()=>{r(0);let e=document.getElementById(`live-posts-container`)?.getBoundingClientRect();e&&window.scrollBy(0,e.top-100)})},[m]);return e&&l&&u&&s.current?/* @__PURE__ */ (0,U.jsx)(J,{justifyContent:`center`,mb:`xxl`,children:/* @__PURE__ */ (0,U.jsx)(ka,{color:`primary`,variant:`outlined`,iconProps:{name:`refresh`,size:22},onClick:h,children:e})}):null},pS=()=>[{title:`Ain`,value:`ain`},{title:`Aisne`,value:`aisne`},{title:`Allier`,value:`allier`},{title:`Alpes-de-Haute-Provence`,value:`alpes_de_haute_provence`},{title:`Alpes-Maritimes`,value:`alpes-maritimes`},{title:`Ardèche`,value:`ardeche`},{title:`Ardennes`,value:`ardennes`},{title:`Ariège`,value:`ariege`},{title:`Aube`,value:`aube`},{title:`Aude`,value:`aude`},{title:`Aveyron`,value:`aveyron`},{title:`Bas-Rhin`,value:`bas_rhin`},{title:`Bouches-du-Rhône`,value:`bouches-rhone`},{title:`Calvados`,value:`calvados`},{title:`Cantal`,value:`cantal`},{title:`Charente`,value:`charente`},{title:`Charente-Maritime`,value:`charente-maritime`},{title:`Cher`,value:`cher`},{title:`Correze`,value:`correze`},{title:`Corse-du-Sud`,value:`corse-sud`},{title:`Côte-d'Or`,value:`cote_d_or`},{title:`Côtes-d'Armor`,value:`cotes_d_armor`},{title:`Creuse`,value:`creuse`},{title:`Deux-Sèvres`,value:`deux-sevres`},{title:`Dordogne`,value:`dordogne`},{title:`Doubs`,value:`doubs`},{title:`Drôme`,value:`drome`},{title:`Essonne`,value:`essonne`},{title:`Eure`,value:`eure`},{title:`Eure-et-Loir`,value:`eure_et_loire`},{title:`Finistère`,value:`finistere`},{title:`Gard`,value:`gard`},{title:`Gers`,value:`gers`},{title:`Gironde`,value:`gironde`},{title:`Guadeloupe`,value:`guadeloupe`},{title:`Guyane`,value:`guyane`},{title:`Haut-Rhin`,value:`haut-rhin`},{title:`Haute-Corse`,value:`haute-corse`},{title:`Haute-Garonne`,value:`haute-garonne`},{title:`Haute-Loire`,value:`haute-loire`},{title:`Haute-Marne`,value:`haute-marne`},{title:`Haute-Saône`,value:`haute-saone`},{title:`Haute-Vienne`,value:`haute-vienne`},{title:`Hautes-Alpes`,value:`hautes-alpes`},{title:`Hautes-Pyrénées`,value:`hautes_pyrenees`},{title:`Hauts-de-Seine`,value:`hauts-de-seine`},{title:`Hérault`,value:`herault`},{title:`Ille-et-Vilaine`,value:`ille_et_vilaine`},{title:`Indre`,value:`indre`},{title:`Indre-et-Loire`,value:`indre-loire`},{title:`Isère`,value:`isere`},{title:`Jura`,value:`jura`},{title:`Landes`,value:`landes`},{title:`Loir-et-Cher`,value:`loir-cher`},{title:`Loire`,value:`loire`},{title:`Loire-Atlantique`,value:`loire-atlantique`},{title:`Loiret`,value:`loiret`},{title:`Lot`,value:`lot`},{title:`Lot-et-Garonne`,value:`lot_et_garonne`},{title:`Lozère`,value:`lozere`},{title:`Maine-et-Loire`,value:`maine-et-loire`},{title:`Manche`,value:`manche`},{title:`Marne`,value:`marne`},{title:`Martinique`,value:`martinique`},{title:`Mayenne`,value:`mayenne`},{title:`Mayotte`,value:`mayotte`},{title:`Meurthe-et-Moselle`,value:`meurthe-et-moselle`},{title:`Meuse`,value:`meuse`},{title:`Morbihan`,value:`morbihan`},{title:`Moselle`,value:`moselle`},{title:`Nièvre`,value:`nievre`},{title:`Nord`,value:`nord`},{title:`Oise`,value:`oise`},{title:`Orne`,value:`orne`},{title:`Paris`,value:`paris`},{title:`Pas-de-Calais`,value:`pas-de-calais`},{title:`Puy de Dôme`,value:`puy-dome`},{title:`Pyrénées-Atlantiques`,value:`pyrenees-atlantiques`},{title:`Pyrénées-Orientales`,value:`pyrenees_orientales`},{title:`Rhône`,value:`rhone`},{title:`Saône-et-Loire`,value:`saone_et_loire`},{title:`Sarthe`,value:`sarthe`},{title:`Savoie`,value:`savoie`},{title:`Seine-et-Marne`,value:`seine-et-marne`},{title:`Seine-Maritime`,value:`seine_maritime-1`},{title:`Seine-Saint-Denis`,value:`seine-saint-denis`},{title:`Somme`,value:`somme`},{title:`Tarn`,value:`tarn`},{title:`Tarn-et-Garonne`,value:`tarn_et_garonne`},{title:`Territoire de Belfort`,value:`territoire-belfort`},{title:`Val-d'Oise`,value:`val_d_oise`},{title:`Val-de-Marne`,value:`val-de-marne`},{title:`Var`,value:`var`},{title:`Vaucluse`,value:`vaucluse`},{title:`Vendée`,value:`vendee`},{title:`Vienne`,value:`vienne-france`},{title:`Vosges`,value:`vosges`},{title:`Yonne`,value:`yonne`},{title:`Yvelines`,value:`yvelines`}],mS=e=>{let t;return e?.forEach(e=>{let n=pS().find(t=>t.value===e?.node?.slug);n&&(t=n)}),t?t.title:``},hS=({data:e,pageEndpoint:t,layout:n})=>(e?.brand?.node?.tag?.node?.publishableContents?.edges||[])?.reduce((e,r)=>{if(r?.node?.rubric?.node?.label&&r?.node?.title&&r?.node?.url&&r?.node?.tags?.edges){let i=r.node.tags.edges.filter(fx);e.push({link:new URL(r.node.url,t).href,title:$s(r?.node?.short_title||r.node.title),cardHeaderProps:{headline:{text:r?.node?.label||r.node.rubric.node.label},location:mS(i)},socialBarProps:{layout:n,commentCount:r.node?.comments_count??0,shareCount:(r.node?.facebook_count??0)+(r.node?.pinterest_count??0),contentLegacyId:r.node?.legacy_id?.toString()}})}return e},[]),gS=e=>{let[t,n]=W.default.useState(e.defaultArticles),[r,i]=W.default.useState(!1),[a,o]=W.default.useState(`locales`),[s,c]=W.default.useState(e.defaultSeeMoreLink.href),l=W.default.useCallback(e=>{o(e.target.value),i(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:t}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let i=[{url:`${t}/?id=getHomeLocalNews&variables=${encodeURIComponent(JSON.stringify({...e.variablesForQuery,slug:a}))}`,options:{headers:r}}];try{let e=await du(...i),t=hS({data:e,pageEndpoint:window.envVariables.pageEndpoint,layout:window.layout});c(new URL(e?.brand?.node?.tag?.node?.url_current??``,window.envVariables.pageEndpoint).href),n(t)}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[e.variablesForQuery,a]);return W.default.useEffect(()=>{r&&u()},[r,u]),W.default.useEffect(()=>{r&&i(!1),Hc()},[r]),W.default.useMemo(()=>({isLoading:r,articles:t,tagUrl:s,onDepartmentChange:l}),[t,r,s,l])},_S=({isSSR:e=!0,articles:t,variablesForQuery:n,seeMoreLink:r,selectProps:i,...a})=>{let{isLoading:o,articles:s,tagUrl:c,onDepartmentChange:l}=gS({defaultArticles:t,defaultSeeMoreLink:r,variablesForQuery:n});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Ub,{...a,articles:s,variablesForQuery:n,seeMoreLink:{href:c},selectProps:{...i,disabled:o,onChange:l}}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({localNewsContainer:{articles:s,variablesForQuery:n,selectProps:i,seeMoreLink:r,...a}})} };`}})]})},vS=({layout:e,pageEndpoint:t,imgEndpoint:n,data:r,lastNumber:i=0})=>Array.isArray(r)?[]:(r?.brand?.node?.publishableContents?.edges||[])?.reduce((r,a,o)=>{if(!a?.node?.title||!a?.node?.label||!a?.node?.url||!a?.node?.published_at||!a?.node?.medias&&!a?.node?.photo?.node)return r;let s=a.node.medias??[];return a?.node?.editorial_model===`Story`&&a?.node?.photo?.node&&(s=tx({photo:a.node.photo})),r.push({link:new URL(a.node.url,t).href,title:a.node.title,cardImageProps:{cover:ex({medias:s,imgEndpoint:n})},cardHeaderProps:{headline:{text:a.node.label}},cardTitleProps:{cartridge:a?.node?.editorial_model===`Live`?`live`:void 0},summaryProps:{children:a?.node?.lead??``},layout:e,cardNumber:{value:i+o+1,size:`medium`},viewCount:a?.node?.total_current_visits||0}),r},[]),yS=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[r,i]=W.default.useState(e.defaultItems),[a,o]=W.default.useState(!1),s=W.default.useCallback(()=>{o(!0)},[]),c=W.default.useCallback(async()=>{let{apiHost:t}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let a=[{url:`${t}/?id=getMostReadContents&variables=${encodeURIComponent(JSON.stringify({first:e.defaultVariablesForQuery.first,brandId:e.defaultVariablesForQuery.brandId,excludeModel:e.defaultVariablesForQuery.excludeModel,sourceExcluded:e.defaultVariablesForQuery.sourceExcluded,after:e.defaultVariablesForQuery.endCursor}))}`,options:{headers:r}}];try{let t=await du(...a),r=vS({layout:window.layout,pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,data:t,lastNumber:e.defaultVariablesForQuery.first});i(e=>[...e,...r||[]]),n(!1),nc()}catch(e){console.error(`20mn> Error while loading contents:`,e)}},[e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.endCursor,e.defaultVariablesForQuery.excludeModel,e.defaultVariablesForQuery.first,e.defaultVariablesForQuery.sourceExcluded]);return W.default.useEffect(()=>{a&&c()},[a,c]),W.default.useEffect(()=>{a&&o(!1)},[a]),W.default.useMemo(()=>({isLoading:a,items:r,hasNextPage:t,onLoadMore:s}),[a,r,t,s])},bS=({isSSR:e=!0,items:t,variablesForQuery:n,seeMoreButton:r})=>{let{isLoading:i,items:a,hasNextPage:o,onLoadMore:s}=yS({defaultItems:t,defaultVariablesForQuery:n});return W.default.useEffect(()=>{i||Qb()},[i]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Kb,{items:a,seeMoreButton:o?{...r,disabled:i,onClick:s}:void 0}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({mainMostReadContainer:{items:a,variablesForQuery:n,seeMoreButton:r}})} };`}})]})},xS=({data:e,pageEndpoint:t,imgEndpoint:n,rubricSlug:r,rubricLabel:i})=>{if(Array.isArray(e))return[];let a=[],o=e?.brand?.node,s=o?.commonArticles?.edges,c=o?.rubricArticles?.edges;if(s?.length){let e=Kx({name:`plus-lus`,title:`Les + lus`,pageEndpoint:t,imgEndpoint:n,articleEdges:s,limit:5});a.push(e)}if(c?.length){let e=Kx({name:`plus-lus-${r}`,title:`Les + lus ${i}`,pageEndpoint:t,imgEndpoint:n,articleEdges:c,limit:5});a.push(e)}return a},SS=e=>{let[t,n]=W.default.useState(e.defaultTabItems),r=W.default.useCallback(async()=>{if(e.variablesForQuery.rubric){let{apiHost:t}=document.body.dataset,r=new Headers;window.envVariables?.apiAuthKey&&r.append(`auth-key`,window.envVariables.apiAuthKey);let i=[{url:`${t}/?id=getMostRead&variables=${encodeURIComponent(JSON.stringify({brandId:e.variablesForQuery.brandId,sourceExcluded:e.variablesForQuery.sourceExcluded,rubricId:e.variablesForQuery.rubric.id}))}`,options:{headers:r}}];try{let t=await du(...i),r=xS({data:t,pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,rubricSlug:e.variablesForQuery.rubric.slug,rubricLabel:e.variablesForQuery.rubric.label});n(r),ri()}catch(e){console.error(`20mn> Error while loading tabItems:`,e)}}},[e.variablesForQuery.brandId,e.variablesForQuery.rubric,e.variablesForQuery.sourceExcluded]);return W.default.useEffect(()=>{r(),Kc()},[r]),W.default.useMemo(()=>({tabItems:t}),[t])},CS=({isSSR:e=!0,layout:t,tabItems:n,variablesForQuery:r,...i})=>{let{tabItems:a}=SS({defaultTabItems:n,variablesForQuery:r});return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(qb,{layout:t,tabItems:a,variablesForQuery:r,...i}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({mostReadContainer:{layout:t,tabItems:n,variablesForQuery:r,...i}})} };`}})]})},wS=(e,t)=>Array.isArray(e)?[]:e?.movies?.edges?.map(e=>{let n=e?.node,r=n?.movieCastings?.edges?.find(e=>e?.node?.position===`Réalisateur`);return{link:n?.article_url||`#`,title:n?.title_fr||``,cardImageProps:{cover:(n?.movieMedias?.edges?.length??0)>0?`${t}/movies/posters/${n?.movieMedias?.edges?.[0]?.node?.src?.replace(`-%format`,``)??``}`:``},summary:n?.summary_short||``,castings:n?.movieCastings?.edges?.filter(e=>e?.node?.type===`cast`).map(e=>`${e?.node?.firstname} ${e?.node?.lastname}`)??[],genres:n?.genres?.filter(e=>e!==null)||[],directedBy:r?`${r?.node?.firstname} ${r?.node?.lastname}`:void 0,releaseDate:n?.release_date?Bs(new Date(n.release_date)):``,seeMoreLink:{children:`Voir la fiche du film`,href:n?.article_url||`#`}}})||[],TS=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultMovies),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r}=document.body.dataset,a=new Headers;window.envVariables?.apiAuthKey&&a.append(`auth-key`,window.envVariables.apiAuthKey);let s=[{url:`${r}/?id=getMoviesData&variables=${encodeURIComponent(JSON.stringify({status:e.defaultVariablesForQuery.status,cursor:t,orderField:`EXPECTATION_LEVEL`,orderDirection:`DESC`}))}`,options:{headers:a}}];try{let e=await du(...s),{staticHost:t}=document.body.dataset,r=wS(e,t);o(e=>[...e,...r||[]]),n(e?.movies?.pageInfo?.endCursor??null),i(e?.movies?.pageInfo?.hasNextPage??!1),nc()}catch(e){console.error(`20mn> Error while loading posts:`,e)}},[t,e.defaultVariablesForQuery.status]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useMemo(()=>({isLoading:s,items:a,hasNextPage:r,onLoadMore:l}),[s,a,r,l])},ES=({isSSR:e=!0,layout:t,items:n,variablesForQuery:r,seeMoreButton:i})=>{let{isLoading:a,items:o,hasNextPage:s,onLoadMore:c}=TS({defaultMovies:n,defaultVariablesForQuery:r});return W.default.useEffect(()=>{a||Qb()},[a]),/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Jb,{layout:t,items:o,seeMoreButton:s?{...i,disabled:a,onClick:c}:void 0}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({moviesListContainer:{layout:t,items:o,variablesForQuery:r,seeMoreButton:i}})} };`}})]})},DS=({pageEndpoint:e,imgEndpoint:t,staticEndpoint:n,data:r,layout:i})=>mx({pageEndpoint:e,imgEndpoint:t,staticEndpoint:n,data:r,hasSummary:!0,layout:i}).map(e=>(delete e.socialBarProps,{...e,linkProps:{children:`Je participe`,"aria-label":`Je participe au quiz`,href:e.link}})),OS=e=>{let[t,n]=W.default.useState(e.defaultVariablesForQuery.endCursor),[r,i]=W.default.useState(e.defaultVariablesForQuery.hasNextPage),[a,o]=W.default.useState(e.defaultArticles),[s,c]=W.default.useState(!1),l=W.default.useCallback(()=>{c(!0)},[]),u=W.default.useCallback(async()=>{let{apiHost:r,staticHost:s}=document.body.dataset,c=new Headers;window.envVariables?.apiAuthKey&&c.append(`auth-key`,window.envVariables.apiAuthKey);let l=[{url:`${r}/?id=getTagArticlesWithCursor&variables=${encodeURIComponent(JSON.stringify({brandId:e.defaultVariablesForQuery.brandId,slug:e.defaultVariablesForQuery.slug,first:e.defaultVariablesForQuery.first,after:t}))}`,options:{headers:c}}];try{let e=await du(...l),t=DS({pageEndpoint:window.envVariables.pageEndpoint,imgEndpoint:window.envVariables.imgEndpoint,staticEndpoint:s||``,data:e,layout:window.layout}),r={articles:[...a,...t],endCursor:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.endCursor??null,hasNextPage:e?.brand?.node?.tag?.node?.publishableContents?.pageInfo?.hasNextPage??!1};o(e=>[...e,...t]),n(r.endCursor),i(r.hasNextPage),nc()}catch(e){console.error(`20mn> Error while loading articles:`,e)}},[a,t,e.defaultVariablesForQuery.brandId,e.defaultVariablesForQuery.first,e.defaultVariablesForQuery.slug]);return W.default.useEffect(()=>{s&&u()},[s,u]),W.default.useEffect(()=>{s&&c(!1)},[s]),W.default.useEffect(()=>{ll()},[]),W.default.useMemo(()=>({isLoading:s,articles:a,hasNextPage:r,onLoadMore:l}),[a,s,r,l])},kS=({isSSR:e=!0,layout:t,articles:n,variablesForQuery:r,seeMoreButton:i,currentPagePath:a,totalArticles:o})=>{let{isLoading:s,articles:c,hasNextPage:l,onLoadMore:u}=OS({defaultArticles:n,defaultVariablesForQuery:r});W.default.useEffect(()=>{s||Qb()},[s]);let d=c.map(e=>({...e,...e.cardImageProps&&{cardImageProps:{...e.cardImageProps,sizes:`(min-width: 1660px) 384px, (min-width: 1440px) calc(18vw + 89px), (min-width: 1080px) 320px, (min-width: 780px) calc(44.29vw - 149px), calc(50vw - 16px)`}}}));return/* @__PURE__ */ (0,U.jsxs)(U.Fragment,{children:[/* @__PURE__ */ (0,U.jsx)(Yb,{layout:t,articles:d,seeMoreButton:l?{...i,disabled:s,onClick:u}:void 0,currentPagePath:a,totalArticles:o}),e&&/* @__PURE__ */ (0,U.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`window.__staticHydrationData = { ...(window.__staticHydrationData || {}), ...${JSON.stringify({quizContainer:{layout:t,articles:d,variablesForQuery:r,seeMoreButton:i}})} };`}})]})},AS=()=>{let e=document.getElementById(`c-alert-info`);if(e){let t=(0,uu.createRoot)(e);t&&t.render(/* @__PURE__ */ (0,U.jsx)(vx,{}))}},jS=()=>{let e=document.getElementById(`elections-form-container`),t=window?.__staticHydrationData?.electionsSearchBannerContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Nb,{isSSR:!1,...t}))}},MS=()=>{let e=document.getElementById(`article-list-bottom-container`),t=window?.__staticHydrationData?.articleListBottomContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(gx,{isSSR:!1,...t}))}},NS=()=>{let e=document.getElementById(`journalist-article-list-container`),t=window?.__staticHydrationData?.journalistArticleListContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Mx,{isSSR:!1,...t}))}},PS=()=>{let e=document.getElementById(`home-legal-notice-list-container`),t=window?.__staticHydrationData?.legalNoticeHomeContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Gx,{isSSR:!1,...t}))}},FS=()=>{let e=document.getElementById(`department-legal-notice-list-container`),t=window?.__staticHydrationData?.legalNoticeDepartmentContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Ux,{isSSR:!1,...t}))}},IS=()=>{let e=document.getElementById(`elections-towns-by-departments-map-container`),t=window?.__staticHydrationData?.electionsMapTownsByDepartmentsContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(kx,{isSSR:!1,...t}))}},LS=()=>{let e=document.getElementById(`elections-departments-map-container`),t=window?.__staticHydrationData?.electionsDepartmentsMapContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Tx,{isSSR:!1,...t}))}},RS=()=>{let e=document.getElementById(`elections-european-map-container`),t=window?.__staticHydrationData?.electionsEuropeanMapContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Dx,{isSSR:!1,...t}))}},zS=()=>{let e=document.getElementById(`elections-constituencies-map-container`),t=window?.__staticHydrationData?.electionsConstituenciesMapContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Cx,{isSSR:!1,...t}))}},BS=(e,t)=>{let n=document.getElementById(e),r=t?window?.__staticHydrationData?.liveImportantPostsContainer:window?.__staticHydrationData?.livePostsContainer,i=t?`liveImportantPostsContainer`:`livePostsContainer`;if(n&&r){let e=(0,uu.createRoot)(n);e&&e.render(/* @__PURE__ */ (0,U.jsx)(dS,{isSSR:!1,staticHydrationDataName:i,...r,posts:Qs(r?.posts),variablesForQuery:r.variablesForQuery}))}},VS=()=>{let e=document.getElementById(`local-news-container`),t=window?.__staticHydrationData?.localNewsContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(_S,{isSSR:!1,...t}))}},HS=()=>{let e=document.getElementById(`latest-articles-container`),t=window?.__staticHydrationData?.latestArticlesContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Ix,{isSSR:!1,...t}))}},US=()=>{let e=document.getElementById(`live-and-most-read-container`),t=window?.__staticHydrationData?.liveAndMostReadContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(Yx,{isSSR:!1,...t}))}},WS=()=>{let e=document.getElementById(`most-read-container`),t=window?.__staticHydrationData?.mostReadContainer;if(e&&t&&t.variablesForQuery?.builtAt&&t.variablesForQuery.builtAt+36e5<Date.now()){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(CS,{isSSR:!1,...t}))}},GS=()=>{let e=document.getElementById(`latest-contents-carousel-container`),t=window?.__staticHydrationData?.latestContentsCarouselContainer;if(e&&t&&t.variablesForQuery?.builtAt&&t.variablesForQuery.builtAt+36e5<Date.now()){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(zx,{isSSR:!1,...t}))}},KS=()=>{let e=document.getElementById(`tabpanel-le-direct`),t=document.getElementById(`live-refresh-button`);if(e&&t){let e=(0,uu.createRoot)(t);e&&e.render(/* @__PURE__ */ (0,U.jsx)(fS,{}))}},qS=()=>{let e=document.getElementById(`archive-pdf-list-container`),t=window?.__staticHydrationData?.archivePdfListContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(ux,{isSSR:!1,...t}))}},JS=()=>{let e=document.getElementById(`movies-container`),t=window?.__staticHydrationData?.moviesListContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(ES,{...t,isSSR:!1}))}},YS=()=>{let e=document.getElementById(`main-most-read-container`),t=window?.__staticHydrationData?.mainMostReadContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(bS,{...t,isSSR:!1}))}},XS=()=>{let e=document.getElementById(`quiz-container`),t=window?.__staticHydrationData?.quizContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(kS,{isSSR:!1,...t}))}},ZS=()=>{let e=document.getElementById(`tv-tab-replays`),t=window?.__staticHydrationData?.replaysTvExtractsAndReplaysContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(ax,{name:`replays`,isSSR:!1,...t}))}let n=document.getElementById(`tv-tab-extraits`),r=window?.__staticHydrationData?.extraitsTvExtractsAndReplaysContainer;if(n&&r){let e=(0,uu.createRoot)(n);e&&e.render(/* @__PURE__ */ (0,U.jsx)(ax,{name:`extraits`,isSSR:!1,...r}))}},QS=()=>{let e=document.getElementById(`elections-ia-articles-container`),t=window?.__staticHydrationData?.electionsAiArticlesContainer;if(e&&t){let n=(0,uu.createRoot)(e);n&&n.render(/* @__PURE__ */ (0,U.jsx)(xx,{isSSR:!1,...t}))}},$S=(e,t,n,r)=>{n?e.setAttribute(t,r||`true`):e.setAttribute(t,r||`false`)},eC=(e,t,n)=>{t?e.classList.add(n):e.classList.remove(n)},tC=()=>{let e=document.getElementById(`contact-form`);return e instanceof HTMLFormElement?e:null},nC=e=>{let t=document.getElementById(e);return t instanceof HTMLSelectElement?t:null},rC=e=>{let t=document.getElementById(e);return t instanceof HTMLTextAreaElement?t:null},iC={"probleme-ordinateur":`Votre message. Veuillez préciser votre navigateur.`,"probleme-mobile":`Votre message. Veuillez préciser votre navigateur et l’appareil que vous utilisez.`,"probleme-app":`Votre message. Veuillez préciser l’appareil que vous utilisez.`},aC={"suppression-anonymisation":`Dans votre message, merci d'indiquer votre objet, nom / prénom, adresse mail et adresse URL vers l'article concerné si besoin.`,jeux:`Ecrivez votre message en précisant votre appareil, le navigateur utilisé ainsi que les jeux concernés.`,newsletter:`Ecrivez votre message en précisant la date et/ou le nom de la newsletter concernée.`,accessibility:`Ecrivez votre message en précisant si nécessaire la/les page(s) ou le/es composant(s) concernés.`};function oC(e){let t=nC(`service`),n=nC(`subservice`),r=nC(`common-object`),i=nC(`tech-object`),a=rC(`message`),o=nC(`source`),s=nC(`games-object`),c=nC(`subscription-object`);return{serviceSelect:t,subServiceSelect:n,subService:n?.parentElement?.parentElement,commonObjectSelect:r,commonObject:r?.parentElement?.parentElement,techObjectSelect:i,techObject:i?.parentElement?.parentElement,contentInput:a,sourceSelect:o,source:o?.parentElement?.parentElement,gamesObjectSelect:s,gamesObject:s?.parentElement?.parentElement,subscriptionObjectSelect:c,subscriptionObject:c?.parentElement?.parentElement,emailInput:e.querySelector(`input[type=email]`),messageInput:a}}let sC=(e,t,n)=>{let{subService:r,commonObject:i,techObject:a,gamesObject:o,subscriptionObject:s,source:c}=e,l=t===`redaction`,u=t===`service-technique`,d=t===`jeux`,f=t===`service-abonnement`;r&&(eC(r,n||!l,`u-mask`),$S(r,`aria-hidden`,n||!l)),i&&(eC(i,n||!l,`u-mask`),$S(i,`aria-hidden`,n||!l)),a&&(eC(a,n||!u,`u-mask`),$S(a,`aria-hidden`,!u)),o&&(eC(o,n||!d,`u-mask`),$S(o,`aria-hidden`,n||!d)),c&&(eC(c,n||!d,`u-mask`),$S(c,`aria-hidden`,n||!d)),s&&(eC(s,n||!f,`u-mask`),$S(s,`aria-hidden`,n||!f))},cC=()=>{let e=tC();if(!e)return;let{emailInput:t,messageInput:n,serviceSelect:r}=oC(e);t?.addEventListener(`blur`,()=>{let e=document.getElementById(`email-error`);e&&(t.checkValidity()?eC(e,!0,`u-mask`):eC(e,!1,`u-mask`))}),n?.addEventListener(`blur`,()=>{let e=document.getElementById(`message-error`);e&&(n.value===``?eC(e,!1,`u-mask`):eC(e,!0,`u-mask`))}),r?.addEventListener(`blur`,()=>{let e=document.getElementById(`service-error`);e&&(r.checkValidity()?eC(e,!0,`u-mask`):eC(e,!1,`u-mask`))})},lC=(e,t)=>{e&&($S(e,`required`,t),$S(e,`aria-required`,t))},uC=()=>{let e=tC();if(!e)return;let t=oC(e),{serviceSelect:n,subServiceSelect:r,commonObjectSelect:i,techObjectSelect:a,gamesObjectSelect:o,subscriptionObjectSelect:s,sourceSelect:c,contentInput:l}=t,u=!!n?.selectedOptions?.[0]?.hidden,d=n?.selectedOptions?.[0]?.value??``;sC(t,d,u),cC(),n?.addEventListener(`change`,e=>{let{target:n}=e;if(!(n instanceof HTMLSelectElement))return;let u=n.value,d=u===`service-technique`,f=u===`jeux`,p=u===`redaction`,m=u===`service-abonnement`;lC(r,p),lC(i,p),lC(a,d),lC(o,f),lC(s,m),lC(c,f),sC(t,u,!!n.selectedOptions[0]?.hidden),l&&l.setAttribute(`placeholder`,aC[u]??`Votre message.`)}),a?.addEventListener(`change`,e=>{let{target:t}=e;t instanceof HTMLSelectElement&&l&&l.setAttribute(`placeholder`,iC[t.value]??`Votre message.`)})},dC=()=>{let e=tC();e&&e.addEventListener(`submit`,t=>{t.preventDefault();let n=new FormData(e),r=n.get(`message`)?.toString().trim(),i=n.get(`email`)?.toString().trim(),a=n.get(`service`)?.toString().trim(),o=n.get(`subservice`)?.toString().trim(),s=n.get(`common-object`)?.toString().trim(),c=n.get(`tech-object`)?.toString().trim(),l=n.get(`games-object`)?.toString().trim(),u=n.get(`subscription-object`)?.toString().trim(),d=n.get(`source`)?.toString().trim();if([!!i,!!a,!!r,a!==`redaction`||!!o&&!!s,!(a===`service-technique`&&!c),!(a===`jeux`&&!l&&!d),!(a===`service-abonnement`&&!u)].includes(!1)){alert(`Tous les champs obligatoires doivent être remplis.`);return}let f=null,p,m=e=>{if(!e)return``;let t=document.querySelector(`option[value="${e}"]`);return t&&t instanceof HTMLOptionElement?t.text:``};switch(a){case`redaction`:p=s,f=m(p),o&&(a=o);break;case`jeux`:{p=l;let e=m(p);f=d?`${e} (source: ${d})`:e;break}case`service-technique`:p=c,f=m(p);break;case`service-abonnement`:p=u,f=m(p)}let h=document.getElementById(`li-antibot-token`);if(!h||!(h instanceof HTMLInputElement)){alert(`Vous devez valider le captcha.`);return}let g={antibotToken:h.value,service:a,email:i,message:r,object:f,objectId:p||null,accessSource:d?.includes(`app-`)?`apps`:`site`},_=document.body.getAttribute(`data-http-taskrunner-api-host`);fetch(`${_}/contact`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(g)}).then(e=>e.json()).then(e=>{e.success?(alert(`Votre message a bien été envoyé à nos services.`),window.location.reload()):alert(`Merci de valider le captcha afin d'envoyer votre message.`)}).catch(e=>{console.error(`Error:`,e)})})};var fC=()=>{uC(),dC()};let pC=()=>{if(document.querySelector(`.gcse-search`)&&window.envVariables?.googleSearchCode)try{bl(`google-search`)}catch(e){e instanceof Error&&console.error(e.message)}};var mC=()=>{pC()};let hC,gC,_C=e=>{hC&&(e===`show`?(hC.classList.remove(`c-header-mini--is-hidden`),hC.removeAttribute(`inert`),gC?.forEach(e=>{e.classList.add(`c-menu--with-header-mini`)}),document.body.setAttribute(`header`,`mini`)):(hC.classList.add(`c-header-mini--is-hidden`),hC.setAttribute(`inert`,``),gC?.forEach(e=>{e.classList.remove(`c-menu--with-header-mini`)}),document.body.removeAttribute(`header`)))},vC=e=>{let t=e[0];hC&&(t.isIntersecting?_C(`hidden`):_C(`show`))},yC=()=>{if(hC=document.querySelector(`.c-header-mini`),hC){let e=document.documentElement.scrollTop,t=document.querySelector(`.c-header`);gC=document.querySelectorAll(`.c-menu`),t&&(e>t.offsetHeight?_C(`show`):_C(`hidden`),new IntersectionObserver(vC,{threshold:[0],rootMargin:`0px 0px -100%`}).observe(t))}},bC,xC,SC,CC=0,wC=e=>{if(!bC)return;let t=document.querySelector(`button.c-btn--close:not(.u-hidden)`),n=document.getElementById(`live-refresh-button`);e===`show`?(bC.classList.remove(`c-header-mobile--is-hidden`),bC.removeAttribute(`inert`),t&&t.classList.add(`c-btn--close-is-below-header`),n&&(n.classList.remove(`u-sticky--spaced-top-screen`),n.classList.add(`u-sticky--spaced-header-mobile`))):(bC.classList.add(`c-header-mobile--is-hidden`),bC.setAttribute(`inert`,``),t&&t.classList.remove(`c-btn--close-is-below-header`),n&&(n.classList.add(`u-sticky--spaced-top-screen`),n.classList.remove(`u-sticky--spaced-header-mobile`)))},TC=e=>{xC&&SC&&(e===`show`?(xC.classList.remove(`u-hidden`),SC.classList.add(`u-hidden`)):(xC.classList.add(`u-hidden`),SC.classList.remove(`u-hidden`)))},EC=()=>{let e=window.scrollY;e>CC?(wC(`hidden`),CC=e):CC-e>100&&(wC(`show`),TC(`hidden`),CC=e)},DC=()=>{bC=document.querySelector(`.c-header-mobile`),xC=document.querySelector(`.js-header-btn-menu`),SC=document.querySelector(`.js-header-btn-back`),bC&&window.addEventListener(`scroll`,()=>{window.scrollY<780?(wC(`show`),xC&&SC&&TC(`show`)):EC()})},OC=()=>{let e=document.querySelector(`#page-content`)?.getAttribute(`data-content-id`),t=/android/i.test(navigator.userAgent);document.querySelectorAll(`a.js-open-in-app[data-android-href]`).forEach(n=>{let r=new URL(t?n.dataset.androidHref:n.href);if(e){let n=`article/${encodeURIComponent(e)}`;t?r.searchParams.set(`deep_link`,`fr.20minutes://${n}`):r.pathname=`/${n}`}n.href=r.href})},kC,AC=document.querySelector(`button.c-btn--close`),jC=document.querySelectorAll(`div[id^="taboola-below-article"]`),MC=`20px`,NC=`211px`,PC=0,FC=0,IC=()=>{kC?.classList.remove(`c-read-also-banner--is-hidden`),document.body.setAttribute(`readalsobanner`,`show`)},LC=()=>{kC?.classList.add(`c-read-also-banner--is-hidden`),document.body.setAttribute(`readalsobanner`,`hidden`)},RC=e=>{let t=[];return jC.forEach((n,r)=>{let{top:i,bottom:a}=n.getBoundingClientRect();e===`top`&&i<=180||e===`bottom`&&i<document.documentElement.clientHeight&&a>0?t[r]=!0:t[r]=!1}),!!t.find(e=>e===!0)},zC=()=>RC(`bottom`),BC=()=>RC(`top`),VC=()=>{let e=null;return e=document.body.getBoundingClientRect().top>PC?`up`:`down`,PC=document.body.getBoundingClientRect().top,e},HC=(e,t)=>{let n=zC();t===`down`&&(n?(IC(),kC?.classList.remove(`c-read-also-banner--is-fixed-below-header`),AC&&(AC.style.top=`140px`)):AC&&(AC.style.top=MC),FC=e),t===`up`&&FC-e>100&&(kC?.classList.add(`c-read-also-banner--is-fixed-below-header`),n?(IC(),AC&&(AC.style.top=NC)):(LC(),AC&&(e>780?AC.style.top=`90px`:AC.style.top=``)),FC=e)},UC=(e,t)=>{let n=kC?.dataset.bannerLimitTop||`0`;t===`up`&&-document.body.getBoundingClientRect().top>=parseInt(n,10)&&(IC(),AC&&(AC.style.top=NC)),(t===`down`||-document.body.getBoundingClientRect().top<=parseInt(n,10))&&(LC(),AC&&(e>780?AC.style.top=MC:AC.style.top=``))},WC=(e=document.querySelector(`div.c-read-also-banner`))=>{if(e){kC=e,LC(),setTimeout(()=>{kC?.classList.remove(`u-hidden`)},500);let t=document.body.dataset.layout===`mobile`;window.addEventListener(`scroll`,()=>{if(BC()){LC();return}let e=VC();t?HC(window.scrollY,e):UC(window.scrollY,e)})}},GC=()=>{let{refreshInterval:e}=document.body.dataset;Number(e)>0&&((e,t)=>{let n,r=t*1e3,i=()=>{clearTimeout(n),n=setTimeout(e,r)};document.addEventListener(`click`,i),document.addEventListener(`keypress`,i),document.addEventListener(`scroll`,i),i()})(()=>{window.location.reload()},Number(e))},KC=()=>{let e=document.getElementById(`js-refresh-button`);e&&window?.location&&e.addEventListener(`click`,e=>{e.preventDefault(),window.location.reload()})};var qC=()=>{KC()};let JC=()=>{document.querySelectorAll(`.c-skip-link`).forEach(e=>{e.addEventListener(`click`,e=>{if(!(e.currentTarget instanceof HTMLAnchorElement))return;let t=e.currentTarget.getAttribute(`href`)?.substring(1),n=t?document.getElementById(t):null;n&&(n.hasAttribute(`tabindex`)||n.setAttribute(`tabindex`,`-1`),setTimeout(()=>{n.focus()},0))})})};function YC(){document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,JC):JC()}ri(),cu(),$b(),Zx(),(()=>{let e=document.getElementById(`banniere_haute`),t=document.getElementById(`taboola-below-article-thumbnails`);e&&t&&new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting?e.style.visibility=`hidden`:e.style.visibility=`visible`})}).observe(t)})(),YC(),Ni(),qC(),il(),fl(),qi(),AS(),yC(),KS(),GC(),mC(),Cu(),(()=>{try{`serviceWorker`in navigator&&navigator.serviceWorker.getRegistrations().then(e=>{e.forEach(e=>{e.active?.scriptURL?.endsWith(`/sw.js`)&&e.unregister()})})}catch(e){console.error(`Error while unregistering service worker:`,e)}})(),pl(),DC(),WC(),Xi(),OC(),Tu(),Yi(),Cc(),qS(),MS(),NS(),PS(),FS(),BS(`tabpanel-le-direct`),BS(`tabpanel-temps-forts`,!0),VS(),HS(),US(),WS(),GS(),jS(),LS(),RS(),IS(),zS(),JS(),YS(),XS(),ZS(),QS(),ou(),fC(),ki(),lu(),Al(),Ml(),Sl(),Pl(),au(),Fl(),_l()})();
|
|
192
192
|
//# sourceMappingURL=main.min.js.map
|