"use strict";var IncitationNewslettersPopupController=function(t){this.$el=t,this.listen()};IncitationNewslettersPopupController.prototype={listen:function(){this.$el.on("click",".close, .decline",$.proxy(this.declineClickEvent,this)),this.$el.on("click",".optin",$.proxy(this.optinClickEvent,this)),$(document).on("mouseout",$.proxy(this.windowsOutEvent,this))},windowsOutEvent:function(t){t.clientY<0&&this.getIncitation()},hasCookie:function(){var t;return new RegExp("(?:; )?incitationNlPopup=([^;]*);?").test(document.cookie)&&(t=decodeURIComponent(RegExp.$1)),!(!t||"true"!==t)},createCookie:function(){var t=new Date;t.setTime(t.getTime()+6048e5),document.cookie="incitationNlPopup=true;expires="+t+"; path=/"},getIncitation:function(){var t=this;this.hasCookie()||$.ajax({type:"GET",url:"/moncompte/Newsletter/GetIncitation",dataType:"json",success:function(e){!1===e&&(t.$el.modal(),doGtmPushEvent("Popup","Vue","Popup optinisation","UA_Event"))}})},optinClickEvent:function(t){var e=this;$.post("/moncompte/MyAccount/Newsletters",{Newsletter:!0,NewsletterPromotions:!0,NewsletterPartners:!1}).done(function(){e.displayConfirm()}).fail(function(){e.declineClickEvent()})},declineClickEvent:function(t){t.preventDefault(),this.closeModal()},displayConfirm:function(){this.$el.find(".intro, .actions, .legend").hide(),this.$el.find(".confirm-message").show()},closeModal:function(){this.createCookie(),this.$el.modal("hide")}};