(function(aggregator, $) {    aggregator.component("adminchecker", { template: "
", controller: function(elt) { var href = document.location.href, pos = href.indexOf("?default="), prop, obj, deleteList = function(obj) { for (prop in obj) { if (obj.hasOwnProperty(prop)) { delete obj[prop]; } } }; if(!$(elt).attr("admin-checked")) { if (pos > -1) { /* dans le cas où on demande d'utiliser l'url "default" */ /* reinitialisation des listes selector ou composant d'origine */ obj = window.aggregator.debug().listSelector; for (prop in obj) { if (obj.hasOwnProperty(prop)) { $(prop).removeAttr("aggregator-name"); } } deleteList(window.aggregator.debug().listComposants); deleteList(window.aggregator.debug().listSelector); /* ensuite on charge le module complet d'administration */ $(elt).attr("aggregator-name", "admin"); } }} });}(aggregator, jQuery));(function(aggregator) { aggregator.replaceTo("link[rel='aggregator']", "adminchecker");}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-carrousel-rebonds", "regroupez-tous-vos-contrats-chez-maaf");}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-promo-encart-agence", "encart-promo-generique-1");}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-promo-mention-agence", "mention-legale-generique-1");}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-promo-encart-bonus-duo", "catalogue-bloc-promo-1");}(aggregator));(function(aggregator) {    aggregator.component("encart-promo-generique", { template: "
", controller: function(elt) { var chaineDataContext = null; /** * Lit les paramètres d'appel du composant dans le data-context * @param str l'objet json contenant les paramètres :'{"param1":"valeur1","param2":"valeur2"}' */ function setParamsDataContext(str) { if(str != null && str != '') { var paramsDataContext = JSON.parse(str); return paramsDataContext; } else { return null; } } function getBlocPromo(elt, stringDataContext) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == XMLHttpRequest.DONE) { if (xmlhttp.status == 200) { var texteAjax = xmlhttp.responseText; elt.get()[0].innerHTML = texteAjax; } else if (xmlhttp.status == 400) { } else { } } }; var dataJson = encodeURIComponent(JSON.stringify(stringDataContext)); xmlhttp.open("GET", "https://www.maaf.fr/fr/sites/maaf/home.blocpromogenerique.html.ajax?dataContext=" + dataJson + "" + "", true); xmlhttp.send(); } function alimenteBlocPromo(elt) { var paramsDataContext = setParamsDataContext(elt.attr('data-context')); if (paramsDataContext != null) { if (chaineDataContext !== JSON.stringify(paramsDataContext)) { chaineDataContext = JSON.stringify(paramsDataContext); getBlocPromo(elt, paramsDataContext); } else { } } else { } } alimenteBlocPromo(elt); /* Select the node that will be observed for mutations */ var targetNode = elt.get()[0]; /* Options for the observer (which mutations to observe) */ var config = { attributes: true }; /* Callback function to execute when mutations are observed */ var callback = function(mutationsList) { var i; for (i in mutationsList) { if(mutationsList[i].type === 'attributes') { if (mutationsList[i].attributeName === 'data-context') { alimenteBlocPromo(elt); } } } }; if(targetNode!=null && targetNode!="undefined") { /* Create an observer instance linked to the callback function */ var observer = new MutationObserver(callback); /* Start observing the target node for configured mutations */ observer.observe(targetNode, config); } else { }} });}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-promo-encart-generique", "encart-promo-generique");}(aggregator));(function(aggregator) {    aggregator.component("sticky-contact", { template: "
3 possibilités pour nous joindre, à vous de choisir...
2 possibilités pour nous joindre, à vous de choisir...
Joindre un conseiller MAAF par téléphone
Service gratuit + prix appel.

Du lundi au vendredi de 8h30 à 18h (hors jours fériés).

Joindre un conseiller MAAF par téléphone
Service et appels gratuits.

Du lundi au vendredi de 8h30 à 20h et le samedi de 8h30 à 17h.

", });}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-sticky-contact", "sticky-contact");}(aggregator));(function(aggregator) {    aggregator.component("encart-promo-generique-2", { template: "
", controller: function(elt) { var chaineDataContext = null; /** * Lit les paramètres d'appel du composant dans le data-context * @param str l'objet json contenant les paramètres :'{"param1":"valeur1","param2":"valeur2"}' */ function setParamsDataContext(str) { if(str != null && str != '') { var paramsDataContext = JSON.parse(str); return paramsDataContext; } else { return null; } } function getBlocPromo(elt, stringDataContext) { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == XMLHttpRequest.DONE) { if (xmlhttp.status == 200) { var texteAjax = xmlhttp.responseText; elt.get()[0].innerHTML = texteAjax; } else if (xmlhttp.status == 400) { } else { } } }; var dataJson = encodeURIComponent(JSON.stringify(stringDataContext)); xmlhttp.open("GET", "https://www.maaf.fr/fr/sites/maaf/home.blocpromogenerique.html.ajax?dataContext=" + dataJson + "" + "&isSyntheseDevis=1", true); xmlhttp.send(); } function alimenteBlocPromo(elt) { var paramsDataContext = setParamsDataContext(elt.attr('data-context')); if (paramsDataContext != null) { if (chaineDataContext !== JSON.stringify(paramsDataContext)) { chaineDataContext = JSON.stringify(paramsDataContext); getBlocPromo(elt, paramsDataContext); } else { } } else { } } alimenteBlocPromo(elt); /* Select the node that will be observed for mutations */ var targetNode = elt.get()[0]; /* Options for the observer (which mutations to observe) */ var config = { attributes: true }; /* Callback function to execute when mutations are observed */ var callback = function(mutationsList) { var i; for (i in mutationsList) { if(mutationsList[i].type === 'attributes') { if (mutationsList[i].attributeName === 'data-context') { alimenteBlocPromo(elt); } } } }; if(targetNode!=null && targetNode!="undefined") { /* Create an observer instance linked to the callback function */ var observer = new MutationObserver(callback); /* Start observing the target node for configured mutations */ observer.observe(targetNode, config); } else { }} });}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-promo-encart-generique-label", "encart-promo-generique-2");}(aggregator));(function(aggregator) {    aggregator.component("indispo", { template: "

Oups ! Nous travaillons actuellement à l'amélioration de la page que vous demandez.
Toutes nos excuses pour cette gêne temporaire.
Le service sera de nouveau accessible à partir de 03H00.

Voici les solutions que nous vous proposons :

Joindre l'un de nos conseillers par téléphone

\"3015

du lundi au vendredi de 8h30 à 20h
le samedi de 8h30 à 17h

Service et appel gratuits
du lundi au vendredi de 8h30 à 20h
le samedi de 8h30 à 17h

Prendre rendez-vous dans votre agence MAAF

Choisissez l'agence MAAF la plus proche de chez vous et convenez d'une date de rendez-vous.

Trouver mon agence MAAF
", });}(aggregator));(function(aggregator) { aggregator.replaceTo("", "indispo");}(aggregator));(function(aggregator) {    aggregator.component("header-light", { template: "
", });}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-portal-header-light-simulation", "header-light");}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-portal-header-light-souscription", "reference-vers-un-composant-aggregable-covea-2");}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-portal-header-light-modif", "reference-vers-un-composant-aggregable-covea-5");}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-contenu-pedagogique-mention-rgpd-1-contractuel", "rgpd-1-contractuel");}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-contenu-pedagogique-mention-rgpd-5-prospection", "rgpd-5-prospection");}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-contenu-pedagogique-mention-bloctel", "rgpd-bloctel");}(aggregator));(function(aggregator) {    aggregator.component("footer", { template: "
", controller: function(elt) { function whenAvailable(name, callback) { var interval = 10; window.setTimeout(function() { if (window[name]) { callback(window[name]); } else { whenAvailable(name, callback); } }, interval); } whenAvailable("init_agg_menu_footer", function(t) { init_agg_menu_footer(); });} });}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-portal-footer", "footer");}(aggregator));(function(aggregator) {    aggregator.component("header", { template: "
", controller: function(elt) { var onDesactivePastille = false; if ('false' == 'true') { onDesactivePastille = true; } /** * Lit les paramètres d'appel dans le data-context * @param str l'objet json contenant les paramètres :'{"param1":"valeur1","param2":"valeur2"}' */ function setParamsDataContext(str) { if(str != null && str != '') { paramsDataContext = JSON.parse(str); jsonContextBase = paramsDataContext; } } /** * Met en surbrillance l'onglet et le lien courants dans la barre de navigation en aggrégation * @param str l'objet json indiquant le nom de l'onglet et du lien ex :'{"onglet":"mes-sinistres","lien":"declarer-un-sinistre-habitation"}' */ function changeCurrentTabAgg() { if(paramsDataContext != null && paramsDataContext != '') { /*suppression de la class is-current sur tous les onglets*/ var $onglets = $("body").find('.mars-menu__link'); if ($onglets != undefined && $onglets != null) { $onglets.removeClass('is-current'); } if(jsonContextBase.onglet != null && jsonContextBase.onglet != '' && jsonContextBase.onglet != 'null') { /*ajout de la class is-current sur l'onglet dont le nom correspond au paramétre*/ var $onglet = $('body').find('.mars-menu__link[data-nav-name="' + jsonContextBase.onglet + '"]'); if ($onglet != undefined && $onglet != null) { $onglet.addClass('is-current'); /* $('body').find(".mars-navigation__name").html(($onglet.html()).trim());*/ } } /*suppression de la class is-current sur tous les liens de la barre de navigation*/ var $liens = $('body').find('.mars-megamenu__link'); if ($liens != undefined && $liens != null) { $liens.removeClass('is-current'); } if(jsonContextBase.lien != null && jsonContextBase.lien != '' && jsonContextBase.lien != 'null') { /*ajout de la class is-current sur le lien dont le nom correspond au paramètre*/ var $lien = $('body').find('.mars-megamenu__link[data-nav-name="' + jsonContextBase.lien + '"]'); if ($lien != undefined && $lien != null) { $lien.addClass('is-current'); } } } } function changePastille(str) { if(str != null && str != '') { var jsonContextBase = JSON.parse(str); /* mise à jour de la pastille devis*/ var nbDevis = jsonContextBase.nbDevis; if (nbDevis > 0) { $('.mars-header__item-basket-bubble').text(nbDevis).removeClass("empty-bubble"); } else { $('.mars-header__item-basket-bubble').text(nbDevis).addClass("empty-bubble"); } } } /** * récupère le pie en cours (générique ou spécifique au département précisé dans le data-context et visible espace client) et l'insère dans la div "zone_pie" */ function getPie() { if(paramsDataContext != null && paramsDataContext != '') { if(jsonContextBase.affichePie == 'true') { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == XMLHttpRequest.DONE) { if (xmlhttp.status == 200) { var texteAjax = xmlhttp.responseText; $('#zone_pie').html(texteAjax); init_pie_espaceclient(); } else if (xmlhttp.status == 400) { console.log('PIE - There was an error 400'); } else { console.log('PIE - something else other than 200 was returned :'+xmlhttp.status); } } }; var dataJson = encodeURIComponent(JSON.stringify(paramsDataContext)); xmlhttp.open("GET", "https://www.maaf.fr/fr/sites/maaf/home.hidden.pieEC.html.ajax?dataContext=" + dataJson, true); xmlhttp.send(); }else{ $('#zone_pie').html(""); } } } /* A l'init du header : */ var paramsDataContext = null; var jsonContextBase = null; setParamsDataContext(elt.attr('data-context')); changeCurrentTabAgg(); getPie(); /* Puis on place un écouteur pour intercepter les changements*/ /* Select the node that will be observed for mutations */ var targetNode = document.getElementById('agg-portal-header'); /* Options for the observer (which mutations to observe) */ var config = { attributes: true }; /* Callback function to execute when mutations are observed */ var callback = function(mutationsList) { var i; for (i in mutationsList) { if(mutationsList[i].type === 'attributes') { if (mutationsList[i].attributeName === 'data-context') { /*changeCurrentTabAgg(elt.attr('data-context'));*/ paramsDataContext = null; jsonContextBase = null; setParamsDataContext(elt.attr('data-context')); changeCurrentTabAgg(); getPie(); } } } }; if(targetNode!=null && targetNode!="undefined") { /* Create an observer instance linked to the callback function */ var observer = new MutationObserver(callback); /* Start observing the target node for configured mutations */ observer.observe(targetNode, config); } else { console.log('targetNode is null ou undefined'); } /* écouteur pour intercepter les changements sur le header synthèse devis*/ /* Select the node that will be observed for mutations */ if (!onDesactivePastille) { var targetNodeHSD = document.getElementById('agg-portal-header'); /* Options for the observer (which mutations to observe) */ var configHSD = { attributes: true }; /* Callback function to execute when mutations are observed */ var callbackHSD = function(mutationsList) { var i; for (i in mutationsList) { if(mutationsList[i].type === 'attributes') { if (mutationsList[i].attributeName === 'data-context') { changePastille(elt.attr('data-context')); } } } }; if(targetNodeHSD!=null && targetNodeHSD!="undefined") { /* Create an observer instance linked to the callback function */ var observerHSD = new MutationObserver(callbackHSD); /* Start observing the target node for configured mutations */ observerHSD.observe(targetNodeHSD, configHSD); } } function whenAvailable(name, callback) { var interval = 10; window.setTimeout(function() { if (window[name]) { callback(window[name]); } else { whenAvailable(name, callback); } }, interval); } /* init header et footer agg */ whenAvailable("init_agg", function(t) { init_agg(); }); /* alimentation panier */ var onAffiche = false; if ('true' == 'true') { onAffiche = true; } var onAfficheLogs = false; if ('false' == 'true') { onAfficheLogs = true; } if (onAffiche) { whenAvailable("majURLPanier", function(t) { if (onAfficheLogs){ console.log('DEBUG ACCES PANIER Controller Client - Appel maj URL Panier aggHeaderClient'); } majURLPanier('https://www.maaf.fr/espaceclient/devis-enregistres', '/mes-devis?uuid=', 'coveuse.maaf.panier', 'uuid', false, 'ControllerClient', onAfficheLogs); }); if (!onDesactivePastille) { var dataContextHDS = ""; var fromDataContext = false; if (targetNodeHSD!=null && targetNodeHSD!="undefined" && targetNodeHSD.hasAttribute('data-context')) { dataContextHDS = targetNodeHSD.getAttribute('data-context'); dataContextHDSParsed = JSON.parse(targetNodeHSD.getAttribute('data-context')); if(!isNaN(dataContextHDSParsed.nbDevis) && dataContextHDSParsed.nbDevis != null) { fromDataContext = true; } } if (onAfficheLogs){ console.log('DEBUG ACCES PANIER Controller Client - Alimentation pastille depuis le data context ou non : ' + fromDataContext); } if (fromDataContext) { if (onAfficheLogs){ console.log('DEBUG ACCES PANIER Controller Client - Alimentation pastille panier depuis le datacontext'); } changePastille(dataContextHDS); } else { whenAvailable("addCountBasket", function(t) { if (onAfficheLogs){ console.log('DEBUG ACCES PANIER Controller Client - Appel count pour alimentation pastille panier aggHeaderClient - jeton CSRF = '); } addCountBasket('https://www.maaf.fr/espaceclient/devis-enregistres', '/mes-devis?uuid=', 'coveuse.maaf.panier', 'uuid', 'https://www.maaf.fr/espaceclient/CAP-US_espaceclient/api/devis/internet/count/', false, 'ControllerClient', onAfficheLogs, ''); }); } } }} });}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-portal-header-ec", "header");}(aggregator));(function(aggregator) { aggregator.replaceTo(".agg-info-bloctel", "reference-vers-un-composant-aggregable-covea-1");}(aggregator));