var __extends,EC;(function(n){"use strict";n.widget("cx.equal_heights",{options:{resizeThrottle:200,targetSelector:".js-equal-heights-parent",targetHeading:".js-equal-heights-child",targetChildId:'[class^="js-equal-heights-id"], [class*="js-equal-heights-id"]',targetHeadingActiveClass:"js-equal-heights-child--active",targetMobileSelector:"js-equal-heights-mobile",breakpoint:850,resetOnMobile:"options-resetonmobile",popupClass:".mfp-hide",fadeClass:".js-fade-trigger",filterClass:"[data-value]"},_create:function(){var t=this;if(this._windowWidth=0,this._eventId=this.widgetFullName+this.uuid,this._events=["load","orientationchange."+this._eventId,"resize."+this._eventId],this._onmobile=this.element.hasClass(this.options.targetMobileSelector),this._target=this.element.find(this.options.targetSelector),this._child=this.element.find(this.options.targetHeading),this._childId=this.element.find(this.options.targetChildId),this._hasChild=this._child.length>0,this._hasChildId=this._childId.length>0,this.options.breakpoint=this.element.data(this.options.resetOnMobile)===!1?0:this.options.breakpoint,!this.element.is(":visible")&&(this._popupContainer=this.element.closest(this.options.popupClass),this._popupId=this._popupContainer.length?this._popupContainer.prop("id"):undefined,this._popupId))n(document.body).find("[href=#"+this._popupId+"]").on("click",function(){t._resize(t._eventId)});if(this.options.fadeClass)n(document.body).find(this.options.fadeClass).on("click",function(){t._resize(t._eventId)});if(this.options.filterClass)n(document.body).find(this.options.filterClass).on("click",function(){t._resize(t._eventId)});this.window.on(this._events.join(" "),function(){t._resize(t._eventId)})},_init:function(){this._resize(this._eventId)},_resize:function(t){var i=this;this._delayedEvent(function(){i._windowWidth=window.innerWidth||n(window).width();i._resetHeights();i._windowWidth>i.options.breakpoint?i._equalHeights():i._onmobile&&i._equalHeights()},this.options.resizeThrottle,t)},_resetHeights:function(){this._target.height("auto");(this._hasChild||this._hasChildId)&&this._child.add(this._childId).height("auto").removeClass(this.options.targetHeadingActiveClass)},_equalHeights:function(){var f=this,u=0,t=0,i,r=[];(this._hasChild||this._hasChildId)&&this._child.add(this._childId).addClass(this.options.targetHeadingActiveClass);n.each(this._target,function(r,e){var o=n(e),s=o.height();f._hasChild&&(i=o.find(f.options.targetHeading).innerHeight(),i>t&&(t=i));s>u&&(u=s)});this._hasChild&&this._target.find(this.options.targetHeading).height(t);this._target.height(u);n.each(this._childId,function(t,i){var u=i.classList;n.each(u,function(n,t){var u;/js-equal-heights-id-/i.test(t)&&(u=parseInt(t.replace("js-equal-heights-id-",""),10),r[u]=r[u]||[],r[u].push(i))})});n.each(r,function(){var r=n(this);t=0;n.each(r,function(){i=n(this).innerHeight();i>t&&(t=i)});r.filter(":visible").css({height:t})})},_delayedEvent:function(){var n={};return function(t,i,r){i=i||200;r=r||"anonymous";n[r]&&clearTimeout(n[r]);n[r]=setTimeout(t,i)}}()})})(jQuery),function(n){var t;(function(n){var t;(function(n){var i=function(){function i(){}return i.subscribe=function(n,r,u){var f=new t(n,r,u);i.handlers.push(f)},i.unsubscribe=function(n,t){i.handlers=$.grep(i.handlers,function(i){return i.event===n&&i.scope===t?!0:!1},!0)},i.fire=function(t,r,u){u===void 0&&(u=null);n.Debug.logToConsole("Observer:fire: "+t);var f=u||window;i.handlers.forEach(function(n){n.event===t&&n.funct.call(f,r)})},i.resubscribe=function(n,t,r){i.unsubscribe(n,r);i.subscribe(n,t,r)},i.handlers=[],i}(),t;n.Observer=i;t=function(){function n(n,t,i){this.event=n;this.scope=i;this.funct=t}return n}();n.Handle=t})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){"use strict";var u=function(){function n(n){this._dataScopeName="noScopeName";n&&n.length>0&&(n.children(":first").attr("data-scope")?this._dataScopeName=n.children(":first").attr("data-scope"):n.attr("data-scope")?this._dataScopeName=n.attr("data-scope"):n.closest("[data-scope]").length>0&&n.closest("[data-scope]").attr("data-scope")&&(this._dataScopeName=n.closest("[data-scope]").attr("data-scope")))}return Object.defineProperty(n.prototype,"dataScopeName",{get:function(){return this._dataScopeName},set:function(n){this._dataScopeName=n},enumerable:!0,configurable:!0}),n.prototype.trackChange=function(n){n===void 0&&(n=!1);i.trackChangeExplicitScope(this.dataScopeName,!1)},n.prototype.trackChangeExplicit=function(n,t){t===void 0&&(t=!1);i.trackChangeExplicitScope(n,!1)},n.prototype.setupDataScopeTracker=function(n){i.setupTracker(n)},n.prototype.resetChangesTracker=function(){i.resetPendingChanges()},n}(),i,f,e,r,o,s,h;t.ChangesTrackableDataScope=u;i=function(){function n(){}return n.setupTracker=function(t){$("input, select",t.component).off(n.change).on(n.change,$.proxy(n.setModified,t));$("input[type=checkbox]",t.component).off(n.change).on(n.change,$.proxy(n.setModified,t));$("h3.is-editable--active",t.component).off("keyup.changesTracker").on("keyup.changesTracker",$.proxy(n.setModified,t));$("[data-scope='cancel-operation']",t.component).off(n.click).on(n.click,$.proxy(n.setUnmodified,t));$("[data-scope='save-operation']",t.component).off(n.click).on(n.click,$.proxy(n.setUnmodified,t))},n.setModified=function(t){n.trackChange(t,!0)},n.setUnmodified=function(t){n.trackChange(t,!1)},n.trackChange=function(t,i){if(i===void 0&&(i=!1),t!=null){var r=$(t.target).parent().closest("[data-scope]");r.length>0?n.modifiedScopes[r.attr("data-scope")]=i:n.modifiedScopes.noScopeName=i}},n.trackChangeExplicitScope=function(t,i){i===void 0&&(i=!1);t!=null&&(n.modifiedScopes[t]=i)},n.hasPendingChanges=function(){var t=n.modifiedScopes,i;for(i in t)if(t.hasOwnProperty(i)&&t[i])return!0;return!1},n.resetPendingChanges=function(){var t=n.modifiedScopes,i;for(i in t)t.hasOwnProperty(i)&&(t[i]=!1);return!0},n.modifiedScopes={},n.click="click.changesTracker",n.change="change.changesTracker",n}();t.ChangeTrackerDataScope=i;f=function(n){function t(t){this.component=$("div[data-js-guid='"+t+"']");this.guid=t;n.call(this,this.component)}return __extends(t,n),t}(u);t.BaseComponent=f;e=function(){function n(){}return n.openModal=function(n){$("<a/>").addClass("js-popup").attr("href",n).attr("data-popup-modal","true").modal().click()},n}();t.SppHelper=e;r=function(){function n(){}return n.logToConsole=function(n,t,i){if(t===void 0&&(t=!1),i===void 0&&(i=null),window.console&&console!==undefined&&console.log!==undefined&&console.log(n),this.isDebugEnabled){var r=$("#sppDebugConsole"),u=$("#sppDebugCounter"),f=parseInt(u.text()),e='<span class="line">'+ ++f+"&gt; <\/span>";u.text(f);t===!0&&(n='<span class="error">'+n+"<\/span>",r.addClass("has-error"));i?r.append("<div data-selector="+i+">"+e+n+"<\/div>"):r.append("<div>"+e+n+"<\/div>")}},n.registerJavascrviptHandler=function(){if($("meta[name=developerMode]").length==0){this.isDebugEnabled=!1;return}this.isDebugEnabled=!0;window.onerror=this.handleJavascriptError},n.handleJavascriptError=function(n,t,i,r){var u="JS ERROR: "+n+"<br />@ "+t+" (line: "+i;return r&&(u+=", col: "+r),u+=")",!1},n.startProfile=function(){return new Date},n.endProfile=function(n,t){if(this.isDebugEnabled)var r=(new Date).getTime()-n.getTime(),i=new Date(r),u=t==null?"":t+": ",f=u+(i.getSeconds()+i.getMilliseconds()/1e3)+"s"},n.isDebugEnabled=!1,n}();t.Debug=r;n.ServiceSelector.TypeScript.Debug.registerJavascrviptHandler();o=function(){function n(){}return n.count=function(){return this._count},n.increment=function(){(this._count++,this._count>1)||$.publish("spinner.open",[$("body")])},n.decrement=function(){(this._count--,this._count>0)||(this._count<0,$.publish("spinner.close",[$("body")]))},n.show=function(n){$.publish("spinner.open",[n])},n.hide=function(n){$.publish("spinner.close",[n])},n._count=0,n}();t.WaitPanel=o;s=function(){function t(){}return t.submitFormAndUpdate=function(n,i){var r={url:n.action,type:n.method,data:$(n).serialize(),traditional:!0},u=$.extend(r,i);t.update(u,i)},t.submitFormAndGetData=function(n,i){var r={url:n.action,type:n.method,data:$(n).serialize(),traditional:!0},u=$.extend(r,i);t.getData(u,i)},t.getDataFromAction=function(n,i,r,u,f,e){var o=t.getApiUrl(n,i,r),s=$.extend({url:o,data:u},f);t.doGeneric(s,e,t.doGetData)},t.sendDataToActionAndUpdate=function(n,i,r,u,f,e){var o=t.getApiUrl(n,i,r),s=$.extend({url:o,data:u},f);t.update(s,e)},t.getData=function(n,i){t.doGeneric(n,i,t.doGetData)},t.update=function(n,i){t.doGeneric(n,i,t.doUpdate)},t.getApiUrl=function(n,t,i){var f=$("meta[name='scID']").attr("content"),r="/SmartPhonePortalApi/"+n+"/"+t+"/"+f,u;return i!=null&&i.length>0&&(u=i.replace("?",""),r=r+"?"+u),r},t.doGeneric=function(n,t,i){var r={onError:jQuery.noop,onSuccess:jQuery.noop,onValidationFailed:jQuery.noop,useErrorWindow:!0,useWaitPanel:!0,waitPanelElement:null},u=$.extend({type:"POST",data:{},dataType:"json"},n),f=$.extend(r,t);i(u,f)},t.doUpdate=function(i,u){u.useWaitPanel&&n.ServiceSelector.TypeScript.WaitPanel.increment();var f=r.startProfile();$.ajax(i).done(function(n){if(n.Updates!=null)for(var i=0;i<n.Updates.length;i++)$("#"+n.Updates[i].Id).html(n.Updates[i].Html);if(n.Valid){u.onSuccess(null);t.addEvents(n.Events)}else u.onValidationFailed(null)}).fail(function(n,i,r){t.handleAjaxFail(n,i,r,u)}).always(function(){u.useWaitPanel&&n.ServiceSelector.TypeScript.WaitPanel.decrement()})},t.doGetData=function(i,u){var e=this,f;u.useWaitPanel&&(u.waitPanelElement?n.ServiceSelector.TypeScript.WaitPanel.show(u.waitPanelElement):n.ServiceSelector.TypeScript.WaitPanel.increment());f=r.startProfile();$.ajax(i).done(function(n){if(n.Valid){u.onSuccess(n.Data);t.addEvents(n.Events)}else u.onValidationFailed(n.ValidationErrors)}).fail(function(n,i,r){t.handleAjaxFail(n,i,r,u)}).always(function(){u.useWaitPanel&&(u.waitPanelElement?n.ServiceSelector.TypeScript.WaitPanel.hide(u.waitPanelElement):n.ServiceSelector.TypeScript.WaitPanel.decrement())})},t.addEvents=function(t){for(var i=0;i<t.length;i++)n.ServiceSelector.TypeScript.Debug.logToConsole(t[i],null,"selectorRegisteredEvent")},t.handleAjaxFail=function(t,i,r,u){var s,e,f,h,c,o;(t.status!==0||t.abort.length!==1)&&(s="Ajax update ended with status "+t.status+" ("+r+")",n.ServiceSelector.TypeScript.Debug.logToConsole(s,!0),u.useErrorWindow&&(e=$("#ServerErrorDebugMessage"),e.length>0?(f=t.responseText.indexOf("<body"),f+=t.responseText.substring(f).indexOf(">")+1,h=t.responseText.indexOf("<\/body>"),c=t.responseText.substring(f,h),$("#ServerErrorDebugMessageContent .data-block").html(c),e.click()):(o=$("#ServerErrorMessage"),o.length>0&&o.click())),u.onError())},t}();t.Ajax=s;h=function(){function n(){}return n.storeInSession=function(n,t){this.getSessionStorageAvailability&&sessionStorage.setItem(n,JSON.stringify(t))},n.removeFromSession=function(n){this.getSessionStorageAvailability&&sessionStorage.setItem(n,null)},n.getFromSession=function(n){if(!this.getSessionStorageAvailability)return null;var t=sessionStorage.getItem(n);return JSON.parse(t)},n.getSessionStorageAvailability=function(){if(!this.isChecked){sessionStorage||(this.sessionStorageIsAvailable=!1);try{sessionStorage.setItem(this.testStorageKey,this.testStorageValue);var n=sessionStorage.getItem(this.testStorageKey);n!==this.testStorageValue&&(this.sessionStorageIsAvailable=!1);sessionStorage.removeItem(this.testStorageKey);this.sessionStorageIsAvailable=!0}catch(t){this.sessionStorageIsAvailable=!1}this.isChecked=!0}return this.sessionStorageIsAvailable},n.isChecked=!1,n.sessionStorageIsAvailable=!0,n.testStorageKey="teststore",n.testStorageValue="testme",n}();t.SessionStore=h})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(t){var i;(function(t){var i;(function(t){"use strict";var i=function(){function t(n){this.options=$.extend({},n);this.itemsToCompare=this.getItems();this.compareTable=$(".compare-table");this.bindDeleteFromCompare();this.bindShowHideAddMore()}return t.prototype.bindShowHideAddMore=function(){this.itemsToCompare.length>=this.options.maxItemsToCompare?$(".js-addmore-link").hide():$(".js-addmore-link").show()},t.prototype.bindDeleteFromCompare=function(){var t=this;this.itemsToCompare.on("click",function(i){var r=$(i.currentTarget),u=r.data("remove-id"),f={onSuccess:function(){t.removeColumnsAndAddemptyAnimation(r)}};n.ServiceSelector.TypeScript.Ajax.getDataFromAction(t.options.controllerName,t.options.removeItemAction,null,{itemId:u},null,f)})},t.prototype.removeColumnsAndAddemptyAnimation=function(n){var t=this,u;this.itemsToCompare.length-1==1&&(u=this.itemsToCompare.not(n),window.location.href=u.first().data("redirect-url"));var f=this.itemsToCompare.index(n),r=this.compareTable.find("tr"),i=0;r.each(function(n,u){i++;var e=$(u).find("td:eq("+f+")"),o=i;i==r.length&&(o="last");e.hide(400,function(){e.remove();$(u).append(t.options.emptyRowTemplates[o]||"<td><\/td>");i==r.length&&(t.itemsToCompare=t.getItems(),t.removeEnabledClassFromColumnGroup(),t.bindShowHideAddMore())})})},t.prototype.removeEnabledClassFromColumnGroup=function(){var n=this;this.compareTable.find("tr:first td").each(function(t,i){$(i).hasClass("compare-table__top-row--placeholder")&&n.compareTable.find("colgroup col:eq("+(t+1)+")").removeClass("compare-table__column--panel")})},t.prototype.getItems=function(){return $(".compare-remove")},t}();t.Compare=i})(i=t.SppCommon||(t.SppCommon={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(){function i(n){this.$compare_mobile_version=$(".js-listing--mobile");this.$compare_desktop_version=$(".js-listing--desktop");this.$gotoComparePageLink=$(".compare-bar__button__action");this.$gotoCompareMobileButton=$(".js-btn--compare");this.component=$("[data-selector='compare-bar']");this.settings=n;this.initialize();this.bindEvents();this.bindAjaxEvents();this.bindGoToComparePage();this.fetchCompareItemsInSession()}return i.prototype.initializeCxCompareBar=function(n,t){n.compare_desktop(t)},i.prototype.initialize=function(){n.ServiceSelector.TypeScript.SessionStore.getFromSession("compareIsCollapsed")?this.component.addClass("compare-bar--is-collapsed"):this.component.removeClass("compare-bar--is-collapsed")},i.prototype.bindEvents=function(){this.component.on("click","[data-selector='state-toggle']",$.proxy(this.setCompareBarStateInSession,this))},i.prototype.bindGoToComparePage=function(){var n=this;this.$gotoComparePageLink.click(function(t){t.preventDefault();window.location=n.$gotoComparePageLink.data("url")});this.$gotoCompareMobileButton.on("click",function(t){(t.preventDefault(),$(t.currentTarget).hasClass("is-disabled"))||(window.location=n.$gotoComparePageLink.data("url"))})},i.prototype.fetchCompareItemsInSession=function(){var i=this,n={useWaitPanel:!1,onSuccess:function(n){n.length&&$(document.body).trigger("compareitems-updated",[n])}};t.Ajax.getDataFromAction(this.settings.controllerName,this.settings.getItemsAction,null,null,null,n)},i.prototype.bindAjaxEvents=function(){var t=this;this.$compare_mobile_version.on("compare_mobile_remove",function(n,i){t.executeCompareRequest(i,t.settings.removeItemAction)});this.$compare_mobile_version.on("compare_mobile_add",function(n,i){t.executeCompareRequest(i,t.settings.addItemAction)});this.$compare_desktop_version.on("compare_desktop_remove",function(n,i){t.executeCompareRequest(i,t.settings.removeItemAction)});this.$compare_desktop_version.on("compare_desktop_add",function(n,i){t.executeCompareRequest(i,t.settings.addItemAction,function(n){$(document.body).find("[data-compare-id='"+n+"']").addClass("listing__item__compare--checked")})});this.$compare_desktop_version.on("compare_desktop_remove_all",function(i,r){var u={onSuccess:function(n){r.complete(n)}};n.ServiceSelector.TypeScript.Ajax.getDataFromAction(t.settings.controllerName,t.settings.clearItemsAction,null,null,null,u)})},i.prototype.executeCompareRequest=function(t,i,r){var f=this,e,u;r===void 0&&(r=null);e=this;u={useWaitPanel:!1,onSuccess:function(n){var i={status:n.Succes?"success":"failure",fail_message:n.ErrorMessage,data:f.createCxDataObject(n.AffectedItem)};t.complete(i);r!==null&&r(n.AffectedItem.Id)}};n.ServiceSelector.TypeScript.Ajax.getDataFromAction(this.settings.controllerName,i,null,{itemId:t.id.id},null,u)},i.prototype.createCxDataObject=function(n){return n?{id:{id:n.Id,href:n.Href,title:n.Name,img:n.ImageUrl}}:null},i.prototype.setCompareBarStateInSession=function(){n.ServiceSelector.TypeScript.SessionStore.storeInSession("compareIsCollapsed",!this.component.hasClass("compare-bar--is-collapsed"))},i}();i.CompareBar=r})(i=t.SppCommon||(t.SppCommon={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(t){function i(n){t.call(this,n);this.bindEvents()}return __extends(i,t),i.prototype.bindEvents=function(){$("[data-selector='email-pdf-form']").on("submit","form",$.proxy(this.sendPdf,this));$("[data-selector='pdf-form-close']").on("click",$.proxy(this.togglePdfForm,this))},i.prototype.sendPdf=function(t){t.preventDefault();var r=t.currentTarget,i=$(t.currentTarget);(i.data("ssfvalidator")||i.ssfvalidator({autoRevalidate:!0,showValidationMessages:!0}),i.ssfvalidator("validate"))&&n.ServiceSelector.TypeScript.Ajax.submitFormAndGetData(r,{onSuccess:function(n){n&&$(i).hide().parent().find("[data-selector='sendpdf-confirmation']").show();i.ssfvalidator("destroy")},useWaitPanel:!0})},i.prototype.togglePdfForm=function(){var n=$("form","[data-selector='email-pdf-form']");n.is(":hidden")&&(n[0].reset(),n.show(),$("[data-selector='sendpdf-confirmation']").hide())},i}(n.ServiceSelector.TypeScript.BaseComponent);t.SsfPrintOrSendPdf=i})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t={options:{autoRevalidate:!1,showSummary:!1,showValidationMessages:!1,summarySelector:"",includeHiddenFields:!1},_create:function(){this._isValidated=!1;this._fieldDefinitions=[];this._ruleDefinitions=[];this.addRule("required",this._checkRequiredField,"#ValidationError_MissingFields");this.addRule("requiredgroup",this._checkRequiredGroupField,"#ValidationError_MissingFieldsGroup");this.addRule("email",this._checkEmailField,"#ValidationError_Email");this.addRule("number",this._checkNumberField,"#ValidationError_Number");this.addRule("decimal",this._checkDecimalField,"#ValidationError_Number");this.addRule("date",this._checkIsDateField,"#ValidationError_Date");this.addRule("futuredate",this._checkFutureDateField,"#ValidationError_FutureDate");this.addRule("phonenr",this._checkPhoneNrField,"#ValidationError_PhoneNumber");this.addRule("checked",this._checkIsChecked,"#ValidationError_IsChecked");this.addRule("dateday",this._checkDateDay,"#ValidationError_DateDay");this.addRule("datemonth",this._checkDateMonth,"#ValidationError_DateMonth");this.addRule("dateyear",this._checkDateYear,"#ValidationError_DateYear");this.addRule("BEphone",this._checkBEphone,"#ValidationError_BEphone");this.addRule("BEbank",this._checkBEbank,"#ValidationError_BEbank");this.addRule("range",this._checkRange,"#ValidationError_Range");this.addRule("iban",n.proxy(this._checkIBAN,this),"#ValidationError_IBAN");this.addRule("becardidentitynumber",n.proxy(this._checkBeIdentityCardNumber,this),"#ValidationError_BECardIdentityNumber");this.addRule("benationalnumber",n.proxy(this._checkBeNationalNumber,this),"#ValidationError_BENationalNumber");this.addRule("regex",n.proxy(this._checkRegex,this),"#ValidationError_BENationalNumber");this._bindRevalidation()},addRule:function(t,i,r){var u=null;r&&(u=this.element.find(r).text(),u||(u=n(r).text()));this._ruleDefinitions.push({fieldSelector:t,func:i,message:u});this._processRule(t,i,u)},_processRule:function(t,i,r){for(var h=[],c=this.element.find('[data-validation~="'+t+'"]'),o,u,f,e,s=0;s<c.length;s++){if(o=c.eq(s),u=o.attr("name"),n.inArray(u,h)!==-1)continue;else h.push(u);for(f=null,e=0;e<this._fieldDefinitions.length;e++)if(this._fieldDefinitions[e].name==u){f=this._fieldDefinitions[e];break}f||(f={field:o,name:u,placeholder:this.element.find('[data-validation-placeholder="'+u+'"]'),rules:[]},this._fieldDefinitions.push(f));f.rules.push({func:i,message:r})}},_bindRevalidation:function(){var t,r,i;if(this.options.autoRevalidate)for(t=0;t<this._fieldDefinitions.length;t++)r=this._fieldDefinitions[t],i=this.element.find("[name='"+r.name+"']"),i.filter("input:not([type=radio], [type=checkbox]), textarea").blur(n.proxy(this.revalidate,this)),i.filter("select").change(n.proxy(this.revalidate,this)),i.filter("input:checkbox, input:radio").change(n.proxy(this.revalidate,this))},_checkIsChecked:function(n,t){return t.is(":checked")?!0:!1},_checkRequiredField:function(n){var t=n===undefined||n==null||n=="";return!t},_checkRequiredGroupField:function(t,i,r){var u=!1,f=i.data("requiredgroup"),e=r.find('[data-requiredgroup="'+f+'"]');return n(e).each(function(){var t=n(this).val(),i;return(n(this).is(":radio")||n(this).is(":checkbox"))&&(t=n(this).is(":checked")?n(this).val():null),i=t===undefined||t==null||t=="",i?void 0:(u=!0,!1)}),u},_checkNumberField:function(n){if(n=="")return!0;var t=parseInt(n);return!isNaN(t)&&t>0&&n.match(/\D+/)==null},_checkDecimalField:function(n){if(!n.length>0)return!0;if(isNaN(n.replace(",",".")||n.indexOf(".")!==-1))return!1;var t=parseFloat(n);return!isNaN(t)&&t>0},_checkRange:function(n,t){var i=t.data("min"),r=t.data("max"),u=parseInt(n);return i!==""&&i>u?!1:r!==""&&r<u?!1:!0},_checkDateDay:function(n){if(n=="")return!0;try{var t=parseInt(n);return t>0&&t<=31}catch(i){return!1}},_checkDateMonth:function(n){if(n=="")return!0;try{var t=parseInt(n);return t>0&&t<=12}catch(i){return!1}},_checkDateYear:function(n,t){var i,u,f,r;if(n=="")return!0;try{return i=parseInt(n),u=t.data("validation").indexOf("datepast")>-1,u?(r=(new Date).getFullYear(),i.toString().length==4&&r>=i):(f=t.data("validation").indexOf("datefuture")>-1,f?(r=(new Date).getFullYear(),r<=i):i.toString().length==4)}catch(e){return!1}},_checkBEphone:function(n){return n==""?!0:n.indexOf("+32")==0&&n.length>=10},_checkBEbank:function(n){return n===""?!0:n.match("[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}")!=null},_checkIsDateField:function(t){if(t=="")return!0;try{return window.Modernizr.inputtypes.date?n.datepicker.parseDate("yy-mm-dd",t):n.datepicker.parseDate(n.datepicker.regional[n("html").attr("lang")].dateFormat,t),!0}catch(i){}return!1},_checkFutureDateField:function(t){try{if(t=="")return!0;var r=window.Modernizr.inputtypes.date?n.datepicker.parseDate("yy-mm-dd",t):n.datepicker.parseDate(n.datepicker.regional[n("html").attr("lang")].dateFormat,t),i=new Date,u=new Date(i.getFullYear(),i.getMonth(),i.getDate());return r>u}catch(f){return!1}},_checkEmailField:function(n){return n?n.match(new RegExp("^[a-zA-Z0-9!#$%&'*+\\/=?^_`{|}~-]+(?:.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?"))!=null:!0},_checkPhoneNrField:function(n){return n.match(new RegExp("^\\+[1-9]{1}[0-9]{10}$"))!=null},_hideValidationErrors:function(n,t){this.options.showValidationMessages&&(n.closest(".form__item").removeClass("form__item--has-errors"),this.options.showSummary||t.slideUp({complete:function(){t.text("")}}))},_removeDuplicates:function(n){var i=[],t,u,r,f;n:for(t=0,u=n.length;t<u;t++){for(r=0,f=i.length;r<f;r++)if(i[r]==n[t])continue n;i.push(n[t])}return i},reset:function(){var n,t;for(this._isValidated=!1,n=0;n<this._fieldDefinitions.length;n++)t=this._fieldDefinitions[n],this._hideValidationErrors(t.field,t.placeholder)},restart:function(n){var t,i;for(this.reset();this._fieldDefinitions.length;)this._fieldDefinitions.pop();for(t=0;t<this._ruleDefinitions.length;t++)i=this._ruleDefinitions[t],this._processRule(i.fieldSelector,i.func,i.message);n===!0&&this.validate()},revalidate:function(){return this._isValidated?this.validate():!1},_showValidationErrors:function(n,t,i){this.options.showValidationMessages&&(n.closest(".form__item").addClass("form__item--has-errors"),this.options.showSummary||t.text(i).slideDown())},validate:function(){var t,i,f,e,o,s,r,h,c;this._isValidated=!0;var a=new Date,u=!0,l=[];for(t=0;t<this._fieldDefinitions.length;t++)i=this._fieldDefinitions[t],f=this._validateField(i.field,i.rules,i.placeholder),f.success||(u=!1,l.push(f.message));if(this.options.showSummary)if(e=this.element.find(this.options.summarySelector),u)e.empty();else{for(o=n("<ul>"),s=this._removeDuplicates(l),r=0;r<s.length;r++)n("<li><\/li>").text(s[r]).appendTo(o);e.html(o)}return h=new Date-a,c="Form validated: "+(u?"Success":"Failure")+" ("+h+"ms)",EC.ServiceSelector.TypeScript.Debug.logToConsole(c),u},_validateField:function(n,t,i){var s=this,u,e,f,o,r;if(!n.is(":visible")&&!n.is('[data-validation~="hidden"]')&&!s.options.includeHiddenFields)return{success:!0};for(u=null,n.is(":radio")||n.is(":checkbox")?(e=n.attr("name"),e?u=this.element.find("[name='"+e+"']:checked").val():n.is(":checked")&&(u=n.val())):u=n.val(),f=0;f<t.length;f++)if(o=t[f],!o.func(u,n,this.element))return r=n.data("validation-message"),r||(r=o.message),r||(r="No validation message found!"),this._showValidationErrors(n,i,r),{success:!1,message:r};return this._hideValidationErrors(n,i),{success:!0}},longModulo:function(n,t){for(var i="",f=n.length,u,r=0;r<f;r++)i+=n.charAt(r),u=+i%t,i=u.toString(10);return+i},_checkBeIdentityCardNumber:function(n){var t;if(n.length==0)return!0;if(t=n.replace(/[\s-,.]+/g,""),!/^[0-9]{12}$/.test(t))return!1;var r=+t.substr(10,2),u=t.substr(0,10),i=this.longModulo(u,97);return i===r||i===0},_checkBeNationalNumber:function(n){var t;if(n.length==0)return!0;if(t=n.replace(/[\s-,.]+/g,""),!/^[0-9]{11}$/.test(t))return!1;var i=+t.substr(9,2),r=t.substr(0,9),u=97-this.longModulo(r,97);return u===i?!0:97-this.longModulo("2"+r,97)===i},_checkIBAN:function(n){var i,t;if(n.length==0)return!0;if(i=n.toUpperCase().replace(/[\s-,.]+/g,""),!/^[A-Z0-9]{5,}$/.test(i))return!1;var r=i.substr(4)+i.substr(0,4),f=r.length,u="";for(t=0;t<f;t++)u+=isNaN(+r[t])?(r[t].charCodeAt(0)-55).toString():r[t];return this.longModulo(u,97)===1},_checkRegex:function(n,t){if(n.length==0)return!0;var i=t.data("valRegexPattern"),r=t.data("valRegexFlags"),u=new RegExp(i,r);return n.match(u)!=null}},i;n.widget("EC.ssfvalidator",t);i={addRule:function(n,t){this._ruleDefinitions.push({fieldSelector:n,func:t});this._processRule(n,t)},_processRule:function(t,i){for(var s=[],h=this.element.find("[data-val-"+t+"]"),r,u,e=0;e<h.length;e++){var o=h.eq(e),f=o.attr("name"),c=o.attr("data-val-"+t);if(n.inArray(f,s)!==-1)continue;else s.push(f);for(r=null,u=0;u<this._fieldDefinitions.length;u++)if(this._fieldDefinitions[u].name==f){r=this._fieldDefinitions[u];break}r||(r={field:o,name:f,placeholder:this.element.find('[data-validation-placeholder="'+f+'"]'),rules:[]},this._fieldDefinitions.push(r));r.rules.push({func:i,message:c})}}};n.widget("EC.ssfvalidatorUnobstrusive",n.extend(!0,t,i))}(jQuery),function(n){function t(n,t){for(var i="",f=n.length,u,r=0;r<f;r++)i+=n.charAt(r),u=+i%t,i=u.toString(10);return+i}function i(n){var i=n.replace(/[\s-,.]+/g,"");if(!/^[0-9]{11}$/.test(i))return!1;var r=+i.substr(9,2),u=i.substr(0,9),f=97-t(u,97);return f===r?!0:97-t("2"+u,97)===r}function r(n){var i=n.replace(/[\s-,.]+/g,"");if(!/^[0-9]{12}$/.test(i))return!1;var u=+i.substr(10,2),f=i.substr(0,10),r=t(f,97);return r===u||r===0}function u(n){var u=n.toUpperCase().replace(/[\s-,.]+/g,""),i;if(!/^[A-Z0-9]{5,}$/.test(u))return!1;var r=u.substr(4)+u.substr(0,4),e=r.length,f="";for(i=0;i<e;i++)f+=isNaN(+r[i])?(r[i].charCodeAt(0)-55).toString():r[i];return t(f,97)===1}function f(t,i){if(this.optional(i))return!0;var r=n(i),u=r.data("valRegexoptPattern"),f=r.data("valRegexoptFlags"),e=new RegExp(u,f);return t.match(e)!=null}function e(t,i){console.log("check");var r=n(i),e=r.attr("data-val-requiredif-dependentfield"),u=n("[name='"+e+"']"),f=r.attr("data-val-requiredif-dependentvalues").split(",");return!u.length||!f.length?!0:n.inArray(u.val(),f)===-1?!0:t?!0:!1}function o(t,i){var r=n(i),e=r.attr("data-val-requiredifnot-dependentfield"),u=n("[name='"+e+"']"),f=r.attr("data-val-requiredifnot-dependentvalues").split(",");return!u.length||!f.length?!0:n.inArray(u.val(),f)>-1?!0:t?!0:!1}function s(n,t,i){return this.depend(i,t)?t.checked:"dependency-mismatch"}n.validator.addMethod("benationalnumber",function(n,t){return this.optional(t)||i(n)});n.validator.unobtrusive.adapters.addBool("benationalnumber");n.validator.addMethod("becardidentitynumber",function(n,t){return this.optional(t)||r(n)});n.validator.unobtrusive.adapters.addBool("becardidentitynumber");n.validator.addMethod("iban",function(n,t){return this.optional(t)||u(n)});n.validator.unobtrusive.adapters.addBool("iban");n.validator.addMethod("regexopt",f);n.validator.unobtrusive.adapters.addBool("regexopt");n.validator.addMethod("requiredif",e);n.validator.unobtrusive.adapters.addBool("requiredif");n.validator.addMethod("requiredifnot",o);n.validator.unobtrusive.adapters.addBool("requiredifnot");n.validator.addMethod("mustbechecked",s);n.validator.unobtrusive.adapters.addBool("mustbechecked")}(jQuery);__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t);this.key="debugConsole";this.bindEvents();this.initialize()}return __extends(t,n),t.prototype.bindEvents=function(){this.component.on("click",".selectorToggle",$.proxy(this.toggle,this))},t.prototype.initialize=function(){this.getState()===!0&&this.toggle(null)},t.prototype.toggle=function(n){var t,i;n!=null&&n.preventDefault();t=this.component.find("#sppDebugConsole");t.toggleClass("docked").toggleClass("undocked");i=t.is(".undocked");this.setState(i);this.component.find("button.selectorToggle").text(i?"Close":"Open")},t.prototype.getState=function(){return localStorage!==undefined?localStorage.getItem(this.key)=="undocked":!1},t.prototype.setState=function(n){localStorage!==undefined&&(n?localStorage.setItem(this.key,"undocked"):localStorage.removeItem(this.key))},t}(n.ServiceSelector.TypeScript.BaseComponent);t.Component=i})(i=t.SsfDebug||(t.SsfDebug={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=n.TypeScript.SppCommon.Compare,r=function(n){function t(t){n.call(this,t)}return __extends(t,n),t}(i);t.ServiceSelectorCompare=r})(i=t.SppServiceSelectorBase||(t.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=n.TypeScript.SppCommon.CompareBar,r=function(n){function t(t){n.call(this,{controllerName:t,getItemsAction:"GetCompareItemsInSession",addItemAction:"AddServiceOfferToCompare",removeItemAction:"DeleteServiceOfferFromCompare",clearItemsAction:"ClearCompareStore"})}return __extends(t,n),t}(i);t.ServiceSelectorCompareBar=r})(i=t.SppServiceSelectorBase||(t.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var i=function(){function n(n){this.maxAmountOfVisiblePages=9;this.options=n;this.requiresCurrentPageRange=this.options.maxAmountOfPages>this.maxAmountOfVisiblePages;this.bindEvents()}return n.prototype.bindEvents=function(){var n=this;this.options.component.on("click","[data-selector='pagination']",function(t){t.preventDefault();n.options.pushHistory($(t.currentTarget).parent().data("value"))});this.options.component.on("click",".js-next-page",function(t){t.preventDefault();n.options.pushHistory(n.getCurrentPage()+1)});this.options.component.on("click",".js-previous-page",function(t){t.preventDefault();n.options.pushHistory(n.getCurrentPage()-1)})},n.prototype.createPagination=function(n,t){t&&(this.options.maxAmountOfPages=t);this.selectedPage=n;this.setPageItems(t);this.renderPager()},n.prototype.setPageItems=function(n){var i,r,u,t;if(this.pageItems=[],i=n?n:this.options.maxAmountOfPages,this.shownPages=i,i<=this.maxAmountOfVisiblePages){for(t=1;t<=i;t++)this.pageItems.push(this.createPageItem(t));return}if(r=this.selectedPage+2,this.selectedPage<6){for(t=1;t<=r;t++)this.pageItems.push(this.createPageItem(t));this.pageItems.push(this.createPageItem(i-1));this.pageItems.push(this.createPageItem(i));return}for(u=this.selectedPage-2,this.pageItems.push(this.createPageItem(1)),this.pageItems.push(this.createPageItem(2)),t=u;t<=r&&t<i-1;t++)this.pageItems.push(this.createPageItem(t));this.pageItems.push(this.createPageItem(i-1));this.pageItems.push(this.createPageItem(i))},n.prototype.createPageItem=function(n){return new t(n,this.selectedPage,this.options.maxAmountOfPages,this.requiresCurrentPageRange)},n.prototype.renderPager=function(){var n=$("<ul><\/ul>"),t,i;for(this.selectedPage>1&&this.shownPages>1&&n.append(this.renderPrevNextButton("pagination__item--previous",this.options.prevSelector,"js-previous-page","icon-chevron-left")),t=0;t<this.pageItems.length;t++)i=this.pageItems[t],n.append(i.createListEntry()),n.append(this.renderDynamicSpace(i)),n.append(this.renderSpace(i));this.selectedPage<this.shownPages&&this.shownPages>1&&n.append(this.renderPrevNextButton("pagination__item--next",this.options.nextSelector,"js-next-page","icon-chevron-right"));this.options.component.find(this.options.pagerContainer).html(n.html())},n.prototype.renderPrevNextButton=function(n,t,i,r){var o=$(t,this.options.component).text(),e=$("<li><\/li>"),u,f;return e.addClass(n),u=$('<a href="#!"><\/a>'),u.addClass(i),f=$("<i class='icon-font'><\/i>"),f.addClass(r),i.indexOf("next")>1?u.append(o,f):u.append(f,o),e.append(u),e},n.prototype.renderDynamicSpace=function(n){return this.requiresCurrentPageRange&&this.selectedPage>3&&this.selectedPage<6&&n.isFirstPage||!this.requiresCurrentPageRange&&(n.isFirstPage&&this.selectedPage>2||n.pageNumber==this.options.maxAmountOfPages-1&&this.selectedPage<this.options.maxAmountOfPages-1)?$("<li class='pagination__dynamic-space'>…<\/li>"):$()},n.prototype.renderSpace=function(n){return this.requiresCurrentPageRange&&(this.selectedPage-2>3&&n.pageNumber==2||n.pageNumber==this.selectedPage+2&&this.selectedPage<this.options.maxAmountOfPages-2)?$("<li class='pagination__space'>…<\/li>"):$()},n.prototype.getCurrentPage=function(){var n=1;return $.each(this.pageItems,function(){this.isCurrentPage&&(n=this.pageNumber)}),n},n}(),t;n.Pager=i;t=function(){function n(n,t,i,r){this.pageNumber=n;this.isCurrentPage=n==t;this.isFirstPage=n===1;this.isLastPage=n==i;this.isNextToCurrentPage=n==t+1||n==t-1;this.isCloseToCurrentPage=n==t+2||n==t-2;this.requiresCurrentPageRange=r}return n.prototype.createListEntry=function(){var n=$("<li data-value='"+this.pageNumber+"'><\/li>"),t;return n.addClass(this.getCssClass()),t=$("<a href='#' data-selector='pagination'><\/a>"),t.text(this.pageNumber.toString()),n.append(t),n},n.prototype.getCssClass=function(){return this.isCurrentPage&&this.isFirstPage?"pagination__item--first pagination__item--current":this.isFirstPage?"pagination__item--first":this.isCurrentPage&&this.isLastPage?"pagination__item--last pagination__item--current":this.isLastPage?"pagination__item--last":this.isCurrentPage?"pagination__item--current":this.isNextToCurrentPage&&this.requiresCurrentPageRange?"pagination__item--current-p1":this.isCloseToCurrentPage&&this.requiresCurrentPageRange?"pagination__item--current-p2":"pagination__item"},n}();n.PageItem=t})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.component=n}return n.prototype.hideQuestion=function(n){n.hide();var t=n.find(":input:hidden");$.each(t,function(n,t){var i=$(t);i.prop("disabled",!0)})},n.prototype.showQuestion=function(n){n.show();var t=n.find(":input:visible");$.each(t,function(n,t){var i=$(t);i.prop("disabled",!1)})},n.prototype.showOrHideArrowBoxes=function(n){var t=$(n.target);t.is(":radio")&&this.showOrHideArrowBoxesForElement(t)},n.prototype.showOrHideArrowBoxForAllQuestion=function(){var n=this,t=$("[data-question]",this.component);$.each(t,function(t,i){var r=$(i).attr("data-question"),u=$("input[name='"+r+"']",i);$.each(u,function(t,i){n.showOrHideArrowBoxesForElement($(i))})})},n.prototype.getAnswerValue=function(n){return n.is(":radio")?n.filter(":checked").val():n.is(":checkbox")?n.is(":checked"):n.val()},n.prototype.showOrHideArrowBoxesForElement=function(n){for(var e=n.attr("name"),r=$("input:radio[name="+e+"]",this.component),t,f,u,i=0;i<r.length;i++)t=$("[data-arrowbox-for-option='"+r[i].id+"']",this.component),f=t.find("fieldset"),t.length>0&&(u=f.not("[data-question]").find(":input").not("input[type=submit]"),r.eq(i).is(":checked")?(t.show(),$.each(u,function(n,t){$(t).prop("disabled",!1)})):(t.hide(),$.each(u,function(n,t){$(t).prop("disabled",!0)})))},n}();n.BaseQuestions=t})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i,r){t.call(this,n);this.options=r;this.mainId="[data-selector='save-profile-component']";this.profileContainerId="#profile-update";this.bindEvents();var u=$($(this.mainId)[0]);u.find(this.profileContainerId).length===0&&u.after("<div id='profile-update' data-scope='profile-update-global-scope'><\/div>");this.profileContainer=u.find(this.profileContainerId);this.controllerName=i}return __extends(i,t),i.prototype.bindEvents=function(){$("[data-selector='saveProfile']","[data-selector='save-profile-component']").on("click",$.proxy(this.saveProfile,this));$("[data-selector='modify']","[data-selector='save-profile-component']").on("click",$.proxy(this.loadSummary,this,!1));$("[data-selector='start-adding-contracts']","[data-selector='save-profile-component']").on("click",$.proxy(this.loadSummary,this,!0))},i.prototype.saveProfile=function(){n.Ajax.sendDataToActionAndUpdate(this.controllerName,"SaveProfileToAscr",null,null,null,{useWaitPanel:!0,onSuccess:function(){$(".js-popup").modal()}})},i.prototype.loadSummary=function(t,i){i&&i.preventDefault();n.Ajax.sendDataToActionAndUpdate(this.controllerName,"LoadSummaryModal",null,{replyUri:this.options.returnUri,addContractToggled:t},null,{useWaitPanel:!0,onSuccess:function(){n.SppHelper.openModal("#profile-update")}})},i}(n.BaseComponent);t.ProfileSummaryBox=i})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(t){"use strict";var i=function(n){function i(i,r,u){(n.call(this,i),this.showCostBreakDown=r,r)&&(this.options=u,this.costbreakDownList=[],this.costBreakTemplate=new t.TemplateUpdater($(this.options.costBreakDownTemplateSelector,this.component),$(this.options.costBreakDownPlaceholderSelector,this.component)),this.bindEvents())}return __extends(i,n),i.prototype.bindEvents=function(){var n=this;this.component.on("click",this.options.openElementSelector,function(t){var i=n.findCostBreakInfo($(t.currentTarget).data("serviceoffer"));n.costBreakTemplate.updateTemplateWithJson(i)})},i.prototype.updateCostBreakDown=function(n){this.showCostBreakDown&&this.costbreakDownList.push({id:n.ServiceOfferId,PriceDetailSections:n.PriceDetailSections})},i.prototype.findCostBreakInfo=function(n){for(var t=0;t<=this.costbreakDownList.length;t++)if(this.costbreakDownList[t].id==n)return this.costbreakDownList[t];return null},i}(n.ServiceSelector.TypeScript.BaseComponent);t.CostBreakDown=i})(i=t.SppServiceSelectorBase||(t.SppServiceSelectorBase={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){"use strict";var r=History,u=function(u){function f(t,f){u.call(this,t);this.options=$.extend({filterBlockSelector:"#filter-mobile",filterTemplateSelector:"#js-filteritem-template",costBreakDownTemplateSelector:"#js-costbreakdown-template",filterPlaceholderSelector:"#js-filter-placeholder",filterSections:[],listTemplateSelector:"#js-listitem-template",costBreakDownPlaceholderSelector:"#js-costbreakdown",listPlaceholderSelector:"#js-service-lister",maxAmountOfPages:1,controllerName:"",showCostBreakdown:!1},f);r.enabled&&r.Adapter.bind(window,"statechange",$.proxy(this.loadPageFromState,this));var e={component:this.component,prevSelector:"#PagerPrevious",nextSelector:"#PagerNext",pagerContainer:"#ListerPager",maxAmountOfPages:this.options.maxAmountOfPages,pushHistory:$.proxy(this.pushHistory,this)};this.pager=new i.Pager(e);this.pager.createPagination(1);this.sortElement=$(".js-sort-offers",this.component);this.initialize();this.bindEvents();this.compareBar=new n.ServiceSelector.TypeScript.SppServiceSelectorBase.ServiceSelectorCompareBar(this.options.controllerName)}return __extends(f,u),f.prototype.initialize=function(){var n=this;this.listTemplate=new i.TemplateUpdater($(this.options.listTemplateSelector,this.component),$(this.options.listPlaceholderSelector,this.component));t.Observer.subscribe("update",$.proxy(function(){n.pushHistory(1)},this),null);t.Observer.subscribe("initializefilters",$.proxy(function(t){n.filters=t},this),null)},f.prototype.bindEvents=function(){this.options.showCostBreakdown&&(this.costBreakDown=new i.CostBreakDown(this.guid,!0,{costBreakDownPlaceholderSelector:this.options.costBreakDownPlaceholderSelector,openElementSelector:".js-costbreakdown-opener",costBreakDownTemplateSelector:this.options.costBreakDownTemplateSelector}));this.bindSorting()},f.prototype.checkHistoryOrFirstPage=function(n){var t=this,i=r.getState();i!=null&&(i.data.page>1&&window.location.search.indexOf("list")!=-1?this.loadPageFromState():this.listTemplate.updateTemplateWithJson(n,function(){t.togglePagingandEvents(1);$(".js-collapse",t.component).collapsible();$("span.responsive-image").responsive_image()},function(n){t.options.showCostBreakdown&&t.costBreakDown.updateCostBreakDown(n)}))},f.prototype.loadPageFromState=function(){var n=this,i=r.getState(),u;i&&i.data.page&&(u=JSON.stringify({page:i.data.page,sortOption:i.data.sorting,filters:i.data.filters}),t.Ajax.getDataFromAction(this.options.controllerName,"GetList",null,u,{contentType:"application/json"},{useWaitPanel:!0,onSuccess:function(r){t.Debug.logToConsole("GetList("+JSON.stringify(r)+")",!1,"ajax-update");n.listTemplate.updateTemplateWithJson(r.offers,function(){n.togglePagingandEvents(i.data.page,r.pagecount);n.sortElement.val(i.data.sorting);$.uniform.update(n.sortElement);n.updateTotalResults(r.totalOffers);$(".js-collapse",n.component).collapsible();$("span.responsive-image").responsive_image()},function(t){n.options.showCostBreakdown&&n.costBreakDown.updateCostBreakDown(t)})}}))},f.prototype.updateTotalResults=function(n){$("[data-selector='result-count']",this.component).text(n);var t;t=n>1?$("#multipleOffers").text():$("#singleOffer").text();$("[data-selector='serviceOfferLabel']",this.component).text(t)},f.prototype.bindSorting=function(){var n=this;this.sortElement.on("change",function(){n.pushHistory(1,!0)})},f.prototype.togglePagingandEvents=function(n,t){$(".js-popup").modal();$.publish("domupdated.responsive-image",document.body);this.pager.createPagination(n,t);$(".js-listing--desktop").data("cxCompare_desktop")&&$(".js-listing--desktop").compare_desktop("countCheckButtons");$(document.body).scrollTo(0)},f.prototype.pushHistory=function(n,i,u){t.Observer.fire("triggerInitializefilters",null,null);r.pushState({time:(new Date).getTime(),page:n,sorting:u?u:this.sortElement.val(),sort:i?i:!1,filters:this.filters},document.title,"?list")},f}(n.ServiceSelector.TypeScript.BaseComponent);i.ServiceLister=u})(i=t.SppServiceSelectorBase||(t.SppServiceSelectorBase={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i){t.call(this,n);this.options=$.extend({controller:null,locationOptions:[],locationQuestionSelector:"#loc_1",showAscr:!1,validationRequiredMessage:".selectorLocationRequiredValidationMessage"},i);this.initialize()}return __extends(i,t),i.prototype.initialize=function(){this._ac=$(this.options.locationQuestionSelector,this.component);this._ac.length!==0&&(this.initializeAutocomplete(),this.initializeValidation())},i.prototype.initializeAutocomplete=function(){for(var i=[],t,r=0;r<this.options.locationOptions.length;r++)t=this.options.locationOptions[r],i.push({label:t.Label,value:{Region:t.Group,Label:t.Label}});this._ac.data("ui-autocomplete")&&(n.Debug.logToConsole("Destroying existing autocomplete."),this._ac.autocomplete("destroy"));this._ac.autocomplete({source:function(n,t){var u=$.ui.autocomplete.escapeRegex(n.term),f=new RegExp("^"+u,"i"),e=new RegExp(u,"i"),r=$.grep(i,function(n){return f.test(n.label||n.value||n)});r=r.concat($.grep(i,function(n){return $.inArray(n,r)<0&&e.test(n.label||n.value||n)}));t(r.slice(0,15))},minLength:1,autoFocus:!0,focus:function(n){n.preventDefault()},select:function(n,t){n.preventDefault();var i=$(this);i.val(t.item.label)},change:function(n,t){if(t.item==null){var i=$(this);i.val("")}}}).off("keypress focus blur").focus(function(){var n=$(this);n.autocomplete("search",n.val())}).keypress(function(n){n.which==13&&(n.preventDefault(),$(this).blur(),$("form","#q_location").submit())}).blur(function(){var n=$(this);document.activeElement!==$("ul.ui-autocomplete").get(0)&&n.autocomplete("close")});this._ac.data("ui-autocomplete")._renderMenu=function(n,t){var i=this;$.each(t,function(t,r){i._renderItemData(n,r)});n.attr("data-selector","selectorLocationLookupWidget")}},i.prototype.initializeValidation=function(){var n=this;$("form","#q_location").ssfvalidator({showValidationMessages:!0,showSummary:!1});$("form","#q_location").ssfvalidator("addRule","energylocationrequired",function(t,i,r){var e=r.find("#"+i.attr("id")),u=e.val(),f;return u?(f=n.getLocationByLabel(u),f!=null):!1},this.options.validationRequiredMessage)},i.prototype.getLocationByLabel=function(n){for(var t,i=0;i<this.options.locationOptions.length;i++)if(t=this.options.locationOptions[i],t.Label==n)return t;return null},i.prototype.reset=function(){this._ac.val("")},i}(n.BaseComponent);t.ServiceSelectorLocation=i})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){"use strict";var t=function(){function n(n,t){this.template=n.html();this.targetElement=t;Mustache.parse(this.template)}return n.prototype.updateTemplateWithJson=function(n,t,i){var r,u;if(typeof n=="string"&&(n=$.parseJSON(n)),r="",$.isArray(n))for(u in n)r+=Mustache.render(this.template,n[u]),typeof i=="function"&&i(n[u]);else r+=Mustache.render(this.template,n);this.targetElement.html(r);typeof t=="function"&&setTimeout(function(){t()},0)},n}();n.TemplateUpdater=t})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){"use strict";var r=function(n){function r(t,r,u){n.call(this,t);this.saveProfileQuestion="_saveProfile";this.options=$.extend({profilePrefixSelector:'[id$="_DefaultProfileNamePrefix"]',resultUrl:null,labelResultUrl:null,controllerName:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1},r);this._questionnaire=u;this.initialize();this.bindEvents();this.geoLocator=new i.GeoLocator;this.geoLocator.startLocatingAndSendToServer(this.options.controllerName,"CollectLocationInfo")}return __extends(r,n),r.prototype.initialize=function(){this._questionnaire.initializeNavigator()},r.prototype.bindEvents=function(){var n=this,i=this;this.component.on("submit","form",$.proxy(this.renderQuestionForm,this));this.component.on("change",'input:not([type="checkbox"]), select',$.proxy(this.questionAnswered,this));this.component.on("click",'input[type="checkbox"]',function(n){$(this).val($(this).is(":checked").toString());i.questionAnswered(n)});this._questionnaire.bindExtraEvents();$(".js-btn-start").on("click",function(t){t.preventDefault();var i=$("[data-selector='outOfDateError']",n.component),r=$("form","#q_location");i.length>0&&i.hide();r.length>0&&r.find("input").val("");n.navigator.goToNextStep()});$(document.body).on("click",'[data-selector="submitAscr"] button,[data-selector="submitAscr"] a',function(i){i.preventDefault();var r={profile:$(i.target).closest("[data-ascr-id]").data("ascr-id")},u={onSuccess:function(){$("#location-redirect-link").length===0&&(n.navigator.goToNextStep(),n.reloadServiceSelector(),n._questionnaire.questionsAnsweredLogic(null))}};t.Ajax.sendDataToActionAndUpdate(n.options.controllerName,"LoadAscrProfile",null,r,null,u)})},r.prototype.renderQuestionForm=function(n){var i=this,r;(n.preventDefault(),r=n.target,$(".field-validation-error",this.component).hide(),$(r).ssfvalidator("validate"))&&t.Ajax.submitFormAndUpdate(r,{useWaitPanel:!0,onSuccess:function(){i.navigator.goToNextStep();i.reloadServiceSelector();i._questionnaire.questionsAnsweredLogic(null)},onValidationFailed:function(){i.reloadServiceSelector();i._questionnaire.questionsAnsweredLogic(null)}})},r.prototype.reloadServiceSelector=function(){$(".js-popup",this.component).modal();$(".form__field--select",this.component).uniform();$("form",this.component).ssfvalidator({showValidationMessages:!0})},r.prototype.questionAnswered=function(n){this._questionnaire.questionsAnsweredLogic(n);$.uniform.update()},r}(n.ServiceSelector.TypeScript.BaseComponent);i.BaseQuestionnaire=r})(i=t.SppServiceSelectorBase||(t.SppServiceSelectorBase={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i){t.call(this,$("#profile-update"));this.options=n;this.component=$("#profile-update");this._SppSummary=i;this.controllerName=n.controllerName;this.resultPageUrl=n.resultPageUrl;this.reload=n.shouldReload;this.isNotSaved=!n.currentProfileIsSaved;this.initialize();this.bindEvents();this.setupDataScopeTracker(this)}return __extends(i,t),i.prototype.initialize=function(){$(".js-popup",this.component).modal();$(".js-collapse",this.component).collapsible();$(".js-reveal-panel",this.component).reveal_panel();$(".js-edit-field",this.component).edit_field();$(".form__field--select",this.component).uniform();this.requiredServiceValidationBox=$("#requiredServices");this.dirtyBit=!1;var n=this.component.find("[data-selector='summary-questions'][disabled='disabled']");n.find("input, textarea, select").prop("disabled",!0)},i.prototype.bindEvents=function(){$("[data-selector='remove-profile']",this.component).on("click",$.proxy(this.removeProfile,this));$("[data-selector='remove-current-profile']",this.component).on("click",$.proxy(this.removeCurrentProfile,this));$("[data-selector='switch-profile']",this.component).on("click",$.proxy(this.switchProfile,this));$("[data-action='add-profile']",this.component).on("click",$.proxy(this.addProfile,this));this.component.off("edit_field_save").on("edit_field_save",$.proxy(this.renameProfile,this));$("input, select",this.component).on("change",$.proxy(this.showHideQuestions,this));$("input[type=checkbox]",this.component).on("click",function(){$(this).val($(this).is(":checked").toString())});$("h3.is-editable--active",this.component).keydown($.proxy(this.showHideQuestions,this));$("[data-selector='remove-service']",this.component).on("click",$.proxy(this.removeService,this));$("[href^='#modify-']",this.component).on("click",$.proxy(this.addOrUpdateClicked,this));$("form",this.component).on("submit",$.proxy(this.submitForm,this));$("[data-selector='close-popup']",this.component).on("click",$.proxy(this.onClosePopup,this))},i.prototype.showHideQuestions=function(n){this._SppSummary.showHideQuestionsLogic(n);$.uniform.update()},i.prototype.changeScopeModifiedState=function(t,i){i===void 0&&(i=!1);n.ChangeTrackerDataScope.trackChange(t,i)},i.prototype.removeProfile=function(t){var r=this,i=$(t.target),u=i.data("profilename");n.Ajax.getDataFromAction(this.controllerName,"RemoveProfile",null,{id:u},null,{useWaitPanel:!0,onSuccess:function(){i.parents(".js-removeable").hide();r.toggleViewMoreAndAddProfileButtons()}})},i.prototype.toggleViewMoreAndAddProfileButtons=function(){var n=$("[data-selector='other-profiles']",this.component);n.find(".js-removeable:visible").length===0&&(n.hide(),$("[data-selector='add-profile-single']",this.component).show(),$("[href='#delete-profile']",this.component).hide())},i.prototype.removeService=function(n){this.changeScopeModifiedState(n,!0);var r=$(n.target),t=r.parents(".js-removeable"),u=t.find("[data-selector='add-link-panel']"),f=t.find("[data-hide]"),i=t.find("[data-selector='summary-questions']");u.show();f.hide();i.prop("disabled",!0);this.showHideQuestions(null);i.find("input, textarea, select").prop("disabled",!0)},i.prototype.addProfile=function(n){if(!this.confirmedUnsavedChanges()){n.preventDefault();return}},i.prototype.addOrUpdateClicked=function(n){var i=$(n.target),r=i.parents(".js-removeable"),t=r.find("[data-selector='summary-questions']");t.prop("disabled",!1);t.find("input, textarea, select").prop("disabled",!1);this.requiredServiceValidationBox.hide();this.showHideQuestions(null)},i.prototype.removeCurrentProfile=function(){this.confirmedUnsavedChanges()&&n.Ajax.sendDataToActionAndUpdate(this.controllerName,"RemoveCurrentProfile",null,null,null,{useWaitPanel:!0})},i.prototype.switchProfile=function(t){if(this.confirmedUnsavedChanges()&&this.confirmedUnsavedProfile()){var i=this,r=$(t.target),u=r.data("profilename");n.Ajax.sendDataToActionAndUpdate(this.controllerName,"SwitchProfile",null,{id:u},null,{useWaitPanel:!0,onSuccess:function(){i.initialize()}})}},i.prototype.renameProfile=function(t,i){var r=this,u={profileName:i.text};n.Ajax.getDataFromAction(this.controllerName,"UpdateCurrentProfileName",null,u,null,{useWaitPanel:!0,onSuccess:function(n){i.complete(n);$("[data-selector='profile-name']","[data-selector='save-profile-component']").text(n.text);r.changeScopeModifiedState(t,!1)}})},i.prototype.submitForm=function(n){n.preventDefault();this._SppSummary.validateAndSumbitForm(this.resultPageUrl)},i.prototype.onClosePopup=function(t){if(!this.confirmedUnsavedChanges()){t.preventDefault();t.stopPropagation();return}this.reload&&(n.WaitPanel.increment(),document.location.href=this.resultPageUrl);this.options.cancelUrl!==""&&(document.location.href=this.options.cancelUrl)},i.prototype.confirmedUnsavedChanges=function(){var t=$("#dirtybit_ascrprofile_message").text(),i=n.ChangeTrackerDataScope.hasPendingChanges();return!i||t!=""&&confirm(t)&&n.ChangeTrackerDataScope.resetPendingChanges()},i.prototype.confirmedUnsavedProfile=function(){var n=$("#dirtybit_ascrprofile_message").text();return!this.isNotSaved||n!=""&&confirm(n)},i}(n.ChangesTrackableDataScope);t.SppBaseSummary=i})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(){function t(n){this.controllerName=n.controllerName;this.initialize();this.bindEvents()}return t.prototype.initialize=function(){},t.prototype.bindEvents=function(){$("[data-selector='switch-ascr-profile']").on("change",$.proxy(this.switchProfile,this))},t.prototype.switchProfile=function(t){if(this.confirmedUnsavedChanges()&&this.confirmedUnsavedProfile()){var i=this,r=$(t.target),u=r.children("option:selected").first().text();n.Ajax.sendDataToActionAndUpdate(this.controllerName,"LoadAscrProfile",null,{profile:u},null,{useWaitPanel:!0,onSuccess:function(){i.initialize()}})}},t.prototype.confirmedUnsavedChanges=function(){var n=$("#dirtybit_ascrprofile_message").text();return!this.dirtyBit||n!=""&&confirm(n)},t.prototype.confirmedUnsavedProfile=function(){var n=$("#dirtybit_ascrprofile_message").text();return!this.isNotSaved||n!=""&&confirm(n)},t}();t.SppBaseProfileHeader=i})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var f=function(){function t(n){this.options=n;this.initialize();this.bindEvents()}return t.prototype.initialize=function(){var t=this,n;this.Component=$("#alert-popup");this.form=$("form",this.Component);$(".js-conditional",this.Component).conditional_form_item();$(".form__field--select",this.Component).uniform();this.Component.ssfvalidator({showValidationMessages:!0});n=$("[data-selector$='_provider']",this.Component);$.each(n,function(n,i){t.showProviderTariffs(i)});this.showHideDefaultFrequencyBlock()},t.prototype.bindEvents=function(){var n=this,t=this;this.addTextAreaCallback("Consumption",$.proxy(this.usageTimeRangeChanged,this),400);$("[data-selector='usage_timerange']",this.Component).change($.proxy(this.usageTimeRangeChanged,this));$("[data-selector$='_provider']",this.Component).change(function(n){t.showProviderTariffs(n.target)});this.Component.on("click","[data-selector='submit-alert']",$.proxy(this.validateSubmit,this));if(this.options.cancelUrl!=="")this.Component.on("click","[data-selector='close-popup']",function(){window.location.href=n.options.cancelUrl})},t.prototype.updateDefaultFrequencyConsumption=function(){var r=this,u=$("[data-selector='usage_value']",this.Component).val(),f=$("[data-selector='usage_timerange']",this.Component).val(),t=this.getConsumptionValue(u),i;if(t===0){this.setDefaultFrequencyAmount(t);return}i={amount:$("#Consumption").val().replace(",","."),frequencyId:f};n.Ajax.getDataFromAction(this.options.controllerName,"GetTotalCasConsumptionAmountForJs",null,JSON.stringify(i),{contentType:"application/json"},{useWaitPanel:!1,onSuccess:function(n){return r.setDefaultFrequencyAmount(n)}})},t.prototype.usageTimeRangeChanged=function(){this.showHideDefaultFrequencyBlock();this.updateDefaultFrequencyConsumption()},t.prototype.showHideDefaultFrequencyBlock=function(){var n=$("[data-selector='yearblock']",this.Component),t=$("#ConsumptionFrequency").val();t===this.options.totalAmountFrequencyId?n.length>0&&n.hide():n.length>0&&n.show()},t.prototype.setDefaultFrequencyAmount=function(n){var t;t=n===0?"--":parseFloat(n.toFixed(2)).toString().replace(".",",");$("[data-selector='calculated-annual-consumption']",this.Component).text(t)},t.prototype.getConsumptionValue=function(n){if(n!=undefined){var t=n.lastIndexOf("."),i=n.lastIndexOf(","),u=t>i?".":",",f=t<=i?".":",",e=n.replace(f,"").replace(u,"."),r=parseFloat(e);return isNaN(r)?0:r}return 0},t.prototype.showProviderTariffs=function(n){var i=$(n),u=i.parents(".form__group__items"),t=u.find("[data-selector$='_tariff']"),f=u.find("[data-selector$='_tariff_ph']"),e=i.data("scope"),r=this.getProviderTariffs(i.val());t.empty();$("<option />").appendTo(t);$(r).each(function(){if(this.ServiceScopes.indexOf(e)!=-1){var n=$("<option />",{val:this.TariffName,text:this.TariffName});this.TariffName==t.data("initialvalue")&&n.attr("selected","selected");n.appendTo(t)}});$.uniform.update();r!=null&&r.length>0?f.show():f.hide()},t.prototype.getProviderTariffs=function(n){for(var t,i=0;i<this.options.providerAndTariffs.length;i++)if(t=this.options.providerAndTariffs[i],t.ProviderName==n)return t.Tariffs;return null},t.prototype.validateSubmit=function(t){var f,e,o;if(t.preventDefault(),t.stopPropagation(),this.Component.ssfvalidator("validate")){var i="",r=!0,u=$("#errorMessageBox"),s=$("[data-selector='alertcheckbox']",this.Component).filter(":checked");if(s.length<1&&(i+=$(this.options.alertTypeErrorMessageSelector).text(),i+="<br/>",r=!1),f=$("[data-selector='deliverycheckbox']",this.Component).filter(":checked"),f.length<1&&(i+=$(this.options.deliveryErrorMessageSelector).text(),r=!1),!r){u.html(i);u.show();return}u.hide();e=this;o=this.createPayload();n.Ajax.sendDataToActionAndUpdate(this.options.controllerName,"SaveAlerts",null,JSON.stringify(o),{contentType:"application/json"},{useWaitPanel:!0,onSuccess:function(){n.WaitPanel.increment();window.location.href=e.options.resultUrl}})}},t.prototype.createPayload=function(){var n=new i,t,o,s,f,h,l,e,c,a;return n.EmailAddress=$("#EmailAddress",this.Component).val(),n.GsmNr=$("#send-sms",this.Component).is(":checked")?$("#gsm_value",this.Component).val():"",t=$("#cheaper",this.Component),t.length>0&&t.is(":checked")&&(o=$("#Consumption",this.Component),s=$("#ConsumptionFrequency",this.Component),n.CheaperOfferAlertId=t.val(),n.AlertFrequency=$("#AlertFrequency",this.Component).val(),n.Consumption=o.length>0?o.val():"",n.ConsumptionFrequency=s.length>0?s.val():""),f=$("#supply",this.Component),f.length>0&&f.is(":checked")&&(n.ImportantServiceSupplyChangeAlertId=f.val(),h=[],l=$("[data-selector='contractchange']",this.Component),l.each(function(n,t){var i=$("[data-selector$='_provider']",t),u;i.length<1||i.val()===""||(u=$("[data-selector$='_tariff']",t),u.length<1||u.val()==="")||h.push(new r(i.data("scope"),i.val(),u.val()))}),n.ContractChanges=h),e=$("#contract",this.Component),e.length>0&&e.is(":checked")&&(n.ServiceSupplyContractEndAlertId=e.val(),c=[],a=$("[data-selector='contractend']",this.Component),a.each(function(n,t){var i=$(t);i.length<1||i.val()===""||c.push(new u(i.data("scope"),i.val()))}),n.ContractEnd=c),n},t.prototype.addTextAreaCallback=function(n,t,i){var r=null;$("#"+n).keydown(function(){r&&window.clearTimeout(r);r=window.setTimeout(function(){r=null;t()},i)})},t}(),i,r,u;t.Alerts=f;i=function(){function n(){}return n}();t.UpdateAlert=i;r=function(){function n(n,t,i){this.ServiceScope=n;this.ProviderName=t;this.TariffName=i}return n}();t.ContractChange=r;u=function(){function n(n,t){this.ServiceScope=n;this.EndDate=t}return n}();t.ContractEnd=u})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var r=Common.ComScore,i,u;i=History;u=function(){function t(n,t,i){this._navigator=i;var r={onBeforeShowResults:jQuery.noop,resultUrl:null,labelResultUrl:null,showFieldValidation:!0,firstStep:"location",shouldHideAdditionalRegions:!0,stepToHideAdditionalRegions:"location",onStepLoaded:null,contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1};this.element=n;this.options=$.extend(r,t);this.bindEvents()}return t.prototype.bindEvents=function(){if(!i.enabled){alert("This application requires window.History. Please enable or switch browser.");return}i.Adapter.bind(window,"statechange",$.proxy(this.loadStepFromState,this))},t.prototype.loadStepFromState=function(){var t=i.getState(),f=this.options.firstStep,o=!1,u,s,e,h;if(t.data.step!=undefined?t.data.step==f&&(o=!1):o=!0,t.data.step!=f?$("#questionnaire-wrapper").show():$("#questionnaire-wrapper").hide(),u=$("input:hidden[data-selector='sitestat-url']").val(),o)n.Debug.logToConsole("Set initial step: "+f),i.replaceState({step:f},document.title,"?"+f);else{n.Debug.logToConsole("Load step: "+t.data.step);try{t.data.step!=f&&(u==""||typeof u=="undefined"?r.TrackingModule.track([{Key:r.ComScoreLabelConstants.step,Value:t.data.step}]):(s=u.indexOf("&",u.indexOf("?")),e=u.substr(0,s)+".profilingpage."+window.location.search.substr(1)+u.substr(s),e=e+"&step="+t.data.step+"&ns_sc_href="+encodeURIComponent(document.URL),udm_(e)))}catch(e){}h=t.data.step;this.showStep(h)}},t.prototype.showStep=function(n){$("[id^='q_']",this.element).hide();var t=$("#q_"+n,this.element);if(n!=="landingpage"&&t.find("form").length===0&&i.replaceState({step:this.options.firstStep},document.title,"?"+this.options.firstStep),t.show(),this.options.shouldHideAdditionalRegions&&(n==this.options.stepToHideAdditionalRegions?$("#questionnaire-right-location-only",this.element).show():$("#questionnaire-right-location-only",this.element).hide()),t.offset().top<$(document).scrollTop()&&$.scrollTo(t,{duration:"medium"}),typeof this.options.onStepLoaded=="function")this.options.onStepLoaded(n)},t.prototype.getNextStep=function(){return this._navigator.getNextStepLogic()},t.prototype.goToNextStep=function(){var n=this.getNextStep();this.goToStep(n)},t.prototype.goToStep=function(t){var r=t,u;if(r==null){this.options.onBeforeShowResults();n.WaitPanel.increment();location.href=this.options.labelResultUrl;return}u=i.getState();i.pushState({step:r,modifyProfile:u.data.modifyProfile},document.title,"?"+r)},t.prototype.goToResults=function(){location.href=this.options.labelResultUrl},t.prototype.isAscrQuestionEnabled=function(){return $("#_saveProfile",this.element).length===1},t.prototype.userIsAuthenticated=function(){return this.options.userIsLoggedIn},t.prototype.shouldIncludeContractsFeatureInWizard=function(){return this.userIsAuthenticated()&&this.options.contractsFeatureEnabled},t}();t.BaseNavigator=u})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(n,i,r){t.call(this,n);this.options=r;this.controllerName=i;this.bindEvents()}return __extends(i,t),i.prototype.bindEvents=function(){this.component.on("click","[data-selector='load-alerts']",$.proxy(this.loadAlerts,this));this.component.on("click","[data-selector='delete-alerts']",$.proxy(this.deleteAlerts,this))},i.prototype.loadAlerts=function(){n.Ajax.sendDataToActionAndUpdate(this.controllerName,"GetAlerts",null,{returnUri:this.options.returnUri},null,{onSuccess:function(){n.SppHelper.openModal("#alert-popup")}})},i.prototype.deleteAlerts=function(t){t.preventDefault();var i=$(t.currentTarget).data("confirm");i!=null&&confirm(i)&&n.Ajax.sendDataToActionAndUpdate(this.controllerName,"DeleteAlerts",null,null,null,null)},i}(n.BaseComponent);t.BaseAlertBox=i})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function t(){this.goalocationoptions={maximumAge:12e5}}return t.prototype.canUseLocation=function(){return navigator.geolocation&&navigator.geolocation.getCurrentPosition?!0:!1},t.prototype.startLocatingAndSendToServer=function(t,i,r){this.canUseLocation()&&navigator.geolocation.getCurrentPosition(function(u){var f={lat:u.coords.latitude,lon:u.coords.longitude},e=u.timestamp,o=(new Date).getTime();o-e<1e3&&n.Ajax.getDataFromAction(t,i,null,f,null,{useWaitPanel:!1,onSuccess:function(){typeof r=="function"&&r(f)}})},null,this.goalocationoptions)},t}();t.GeoLocator=i})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){"use strict";var r=History,u=function(n){function u(t,i){n.call(this,t);this.options=$.extend({filterBlockSelector:"#filter-mobile",filterTemplateSelector:"#js-filteritem-template",filterPlaceholderSelector:"#js-filter-placeholder",filterSections:[],controllerName:""},i);this.initialize();this.bindEvents()}return __extends(u,n),u.prototype.initialize=function(){var n=this;t.Debug.logToConsole("Filter:initialize");this.filterBlock=$(this.options.filterBlockSelector,this.component);this.filterTemplate=new i.TemplateUpdater($(this.options.filterTemplateSelector,this.component),$(this.options.filterPlaceholderSelector,this.component));this.updateFilters(this.options.filterSections);this.filterBlock.on("change","input",function(){var i=JSON.stringify({filters:n.getCurrentFilters(),page:1});t.Observer.fire("update",i,null)});t.Observer.subscribe("update",$.proxy(function(t){n.doUpdate(t)},this),null);t.Observer.subscribe("triggerInitializefilters",$.proxy(function(){n.triggerIntitializeFilter()},this),null)},u.prototype.triggerIntitializeFilter=function(){t.Observer.fire("initializefilters",this.getCurrentFilters(),null)},u.prototype.doUpdate=function(n){var i=this;t.Debug.logToConsole("Filter:doUpdate");t.Ajax.getDataFromAction(this.options.controllerName,"GetFilters",null,n,{contentType:"application/json"},{useWaitPanel:!0,onSuccess:function(n){t.Debug.logToConsole("GetFilters("+JSON.stringify(n)+")",!1,"ajax-update");i.updateFilters(n.Sections)}})},u.prototype.bindEvents=function(){this.bindFilters()},u.prototype.loadPageFromState=function(){var u=this,n,i;t.Debug.logToConsole("Filter:loadPageFromState");n=r.getState();n&&n.data.page&&(i=JSON.stringify({page:n.data.page,sortOption:n.data.sorting,filters:n.data.filters}),t.Ajax.getDataFromAction(this.options.controllerName,"GetFilters",null,i,{contentType:"application/json"},{useWaitPanel:!0,onSuccess:function(n){t.Debug.logToConsole("GetFilters("+JSON.stringify(n)+")",!1,"ajax-update");u.updateFilters(n.Sections)}}))},u.prototype.bindFilters=function(){this.filterBlock.on("change","input:checkbox, input:radio",$.proxy(this.filterSelectionChanged,this));this.filterBlock.on("click","[data-selector='filter-clear-subsection']",$.proxy(this.clearCurrentFilter,this));this.filterBlock.on("click","[data-selector='filter-summary-item']",$.proxy(this.filterSummaryItemRemoved,this));this.filterBlock.find(".js-collapse").bind("collapsible_collapsible_before_open",$.proxy(this.hideFilterSummary,this)).bind("collapsible_collapsible_before_close",$.proxy(this.showFilterSummary,this))},u.prototype.updateFilters=function(n){var u,i,f,r;for(t.Debug.logToConsole("Filter:UpdateFilters: "+n),u=this,i=0;i<n.length;i++)f=n[i],r=$("[data-filter-section-id="+f.Id+"]"),r&&r.hasClass("is-collapsible--active")&&(n[i].IsCollapsibleOpen=!0);this.filterTemplate.updateTemplateWithJson(n,function(){u.initializeCollapsible();$(".js-popup").modal()})},u.prototype.initializeCollapsible=function(){t.Debug.logToConsole("Filter:initializeCollapsible");var n=$(".js-collapse",this.component);n.data("cxCollapsible")&&n.collapsible("destroy");n.collapsible()},u.prototype.filterSelectionChanged=function(n){n===void 0&&(n=null);n!=null&&n.preventDefault()},u.prototype.clearCurrentFilter=function(n){var i,r;n.preventDefault();i=$(n.target).data("clearfilter");this.filterBlock.find('input[data-filter-id="'+i+'"]').prop("checked",!1);r=JSON.stringify({filters:this.getCurrentFilters(),page:1});t.Observer.fire("update",r,null)},u.prototype.filterSummaryItemRemoved=function(n){var t,i;n.preventDefault();t=$(n.target);t.hasClass("icon-x")&&(t=$(n.target).parent());i=t.data("option-id");this.filterBlock.find('input[id="'+i+'"]').prop("checked",!1).change();t.data("should-hide-summary")&&t.parents("[data-selector=filter-summary-section]").hide();this.filterSelectionChanged(null)},u.prototype.showFilterSummary=function(n,t){var i=$(t.panel[0]);$("[data-selector=filter-summary-section]",i).slideDown()},u.prototype.hideFilterSummary=function(n,t){var i=$(t.panel[0]);$("[data-selector=filter-summary-section]",i).slideUp()},u.prototype.getCurrentFilters=function(){for(var r=[],u=this.filterBlock.find("input:checked"),n,t,i=0;i<u.length;i++)(n=u.eq(i),t=n.data("filter-id"),t)&&r.push({filter:t,option:n.val()});return r},u}(n.ServiceSelector.TypeScript.BaseComponent);i.Filter=u})(i=t.SppServiceSelectorBase||(t.SppServiceSelectorBase={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"questionnaire":return null;case"landingpage":return"questionnaire"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBeCarLoan||(n.SppServiceSelectorBeCarLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);$(".js-popup",this.component).modal();$(".form__field--select",this.component).uniform();$("form",this.component).ssfvalidator({showValidationMessages:!0});this.carLoanQuestions=new t.QuestionSections.CarLoanQuestions(this.component)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("questionnaire"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.carLoanQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBeCarLoan||(n.SppServiceSelectorBeCarLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t);this.carLoanQuestions=["car_isnew","car_age","credit_duration_months","credit_amount"]}return __extends(t,n),t.prototype.showHideCarLoanQuestions=function(n){n===void 0&&(n=null);this.showHideQuestions();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideQuestions=function(){var t=$("input[name="+this.carLoanQuestions[0]+"]",this.component),n=$("input[name="+this.carLoanQuestions[1]+"]",this.component),i=this.getAnswerValue(t);i==="No"?this.showQuestion(n):this.hideQuestion(n)},t}(n.SppServiceSelectorBase.BaseQuestions);t.CarLoanQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBeCarLoan||(n.SppServiceSelectorBeCarLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.carLoanQuestions=new t.QuestionSections.CarLoanQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.carLoanQuestions.showHideCarLoanQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppCarLoanBeSummary=i})(t=n.SppServiceSelectorBeCarLoan||(n.SppServiceSelectorBeCarLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"questionnaire":return null;case"landingpage":return"questionnaire"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBePersonalLoan||(n.SppServiceSelectorBePersonalLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);$(".js-popup",this.component).modal();$(".form__field--select",this.component).uniform();$("form",this.component).ssfvalidator({showValidationMessages:!0});this.personalLoanQuestions=new t.QuestionSections.PersonalLoanQuestions(this.component)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("questionnaire"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.personalLoanQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBePersonalLoan||(n.SppServiceSelectorBePersonalLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t);this.personalLoanQuestions=["credit_duration_months","credit_amount"]}return __extends(t,n),t.prototype.showHidePersonalLoanQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions);t.PersonalLoanQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBePersonalLoan||(n.SppServiceSelectorBePersonalLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.personalLoanQuestions=new t.QuestionSections.PersonalLoanQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.personalLoanQuestions.showHidePersonalLoanQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppPersonalLoanBeSummary=i})(t=n.SppServiceSelectorBePersonalLoan||(n.SppServiceSelectorBePersonalLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"questionnaire":return null;case"landingpage":return"questionnaire"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBeHomeRenovationLoan||(n.SppServiceSelectorBeHomeRenovationLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var r=History,i=function(n){function i(i,r){n.call(this,i,r,this);$(".js-popup",this.component).modal();$(".form__field--select",this.component).uniform();$("form",this.component).ssfvalidator({showValidationMessages:!0});this.homerenovationLoanQuestions=new t.QuestionSections.HomeRenovationLoanQuestions(this.component)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("questionnaire"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.homerenovationLoanQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBeHomeRenovationLoan||(n.SppServiceSelectorBeHomeRenovationLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t);this.homeRenovationLoanQuestions=["credit_duration_months","credit_amount"]}return __extends(t,n),t.prototype.showHideHomeRenovationLoanQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions);t.HomeRenovationLoanQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBeHomeRenovationLoan||(n.SppServiceSelectorBeHomeRenovationLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.homeRenovationLoanQuestions=new t.QuestionSections.HomeRenovationLoanQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.homeRenovationLoanQuestions.showHideHomeRenovationLoanQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppHomeRenovationLoanBeSummary=i})(t=n.SppServiceSelectorBeHomeRenovationLoan||(n.SppServiceSelectorBeHomeRenovationLoan={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var r=History,i=function(n){function i(i,r){n.call(this,i,r,this);$(".js-popup",this.component).modal();$(".form__field--select",this.component).uniform();$("form",this.component).ssfvalidator({showValidationMessages:!0});this.savingAccountsQuestions=new t.QuestionSections.SavingAccountsQuestions(this.component)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("questionnaire"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.savingAccountsQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBeSavingAccounts||(n.SppServiceSelectorBeSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t);this.savingAccountQuestions=["com_language","sa_initialdepositamount","sa_monthlydeposit","sa_monthlydepositamount","sa_estimatedduration","sa_accountfor","sa_excludeinternet"]}return __extends(t,n),t.prototype.showHideSavingAccountQuestions=function(n){n===void 0&&(n=null);this.showHideQuestions();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideQuestions=function(){var t=$("input[name="+this.savingAccountQuestions[2]+"]",this.component),i=this.getAnswerValue(t),n=$("[data-question="+this.savingAccountQuestions[3]+"]",this.component);i==="Yes"?this.showQuestion(n):this.hideQuestion(n)},t}(n.SppServiceSelectorBase.BaseQuestions);t.SavingAccountsQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBeSavingAccounts||(n.SppServiceSelectorBeSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"questionnaire":return null;case"landingpage":return"questionnaire"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBeSavingAccounts||(n.SppServiceSelectorBeSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.savingAccountQuestions=new t.QuestionSections.SavingAccountsQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.savingAccountQuestions.showHideSavingAccountQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppSavingAccountsBeSummary=i})(t=n.SppServiceSelectorBeSavingAccounts||(n.SppServiceSelectorBeSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(t,i){n.call(this,t,i,this);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("questionnaire"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorItSavingAccounts||(n.SppServiceSelectorItSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"questionnaire":return null;case"landingpage":return"questionnaire"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorItSavingAccounts||(n.SppServiceSelectorItSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(n){t.call(this,n,this);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,t),i.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0)},i.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},i.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},i.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},i}(n.SppServiceSelectorBase.SppBaseSummary);t.SppSavingAccountsItSummary=i})(t=n.SppServiceSelectorItSavingAccounts||(n.SppServiceSelectorItSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"location";case"location":return"serviceselection";case"serviceselection":return $("#ele_include",this.element).prop("checked")?"electricity":"gas";case"electricity":return $("#gas_include",this.element).prop("checked")?"gas":"reductions";case"gas":return"reductions";case"reductions":return null;default:return"landingpage"}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBeEnergy||(n.SppServiceSelectorBeEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.electricityQuestions=new t.QuestionSections.Electricity(this.component);this.gasQuestions=new t.QuestionSections.Gas(this.component)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!1,firstStep:"landingpage",shouldHideAdditionalRegions:!0,stepToHideAdditionalRegions:"location",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("location"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){this.component.on("click","input[name=energy]",function(){var n=$(this);n.is(":checked")?n.val(n.attr("id")):n.val("")})},i.prototype.questionsAnsweredLogic=function(n){this.electricityQuestions.showHideElectricityQuestions(n);this.gasQuestions.showHideGasQuestions(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBeEnergy||(n.SppServiceSelectorBeEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var r=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideGasQuestions=function(n){n===void 0&&(n=null);this.showHideQuestions();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideQuestions=function(){var r="gas_provide_profile_heating",u="gas_provide_profile_noheating",f=$("input[name='gas_for_heating']",this.component),t=this.component.find("[data-question='"+r+"']"),i=this.component.find("[data-question='"+u+"']"),n=this.component.find("[data-question='gas_provide_profile_personalised']").parent();f.is(":checked")?(this.showQuestion(t),this.hideQuestion(i),$("#"+r+"_personalized").is(":checked")?(n.appendTo(t.find(".form__item--boolean:last")),this.showQuestion(n)):this.hideQuestion(n)):(this.hideQuestion(t),this.showQuestion(i),$("#"+u+"_personalized").is(":checked")?(n.appendTo(i.find(".form__item--boolean:last")),this.showQuestion(n)):this.hideQuestion(n))},t}(n.SppServiceSelectorBase.BaseQuestions),i;t.Gas=r;i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideElectricityQuestions=function(n){n===void 0&&(n=null);this.showHideQuestions();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideQuestions=function(){var c="ele_annual_conso_known",l=$("input[name='ele_provide_meter']",this.component),o=this.getAnswerValue(l),a=$("input[name='ele_exclusive_night']",this.component),s=this.getAnswerValue(a),n=$("[data-question='ele_dual_annual_consumption']",this.component),t=$("[data-question='ele_usage_profile']",this.component),i=$("[data-question='ele_annual_consumption']",this.component),r=$("[data-question='ele_dual_usage_profile']",this.component),u=$("[data-question='ele_usage_profile_personalised_overall']",this.component),f=$("[data-question='ele_usage_profile_personalised_daily']",this.component),e=$("[data-question='ele_usage_profile_personalised_nightly']",this.component),h=$("[data-question='"+c+"']",this.component),y=$("input[name='"+c+"']",this.component),v=this.getAnswerValue(y);l.is(":checked")&&a.is(":checked")?this.component.find("[data-selector=ele_part2]").show():this.component.find("[data-selector=ele_part2]").hide();o==="normal"&&s==="no"?(this.showQuestion(h),v=="yes"?(this.showQuestion(u),this.hideQuestion(f),this.hideQuestion(e)):(this.hideQuestion(u),this.showQuestion(f),this.showQuestion(e)),this.showQuestion(t),this.hideQuestion(r),this.hideQuestion(i),this.hideQuestion(n)):o==="dual_meter"&&s==="no"?(this.showQuestion(h),v=="yes"?(this.hideQuestion(u),this.showQuestion(f),this.showQuestion(e)):(this.showQuestion(u),this.hideQuestion(f),this.hideQuestion(e)),this.hideQuestion(t),this.showQuestion(r),this.hideQuestion(i),this.hideQuestion(n)):o==="normal"&&s==="yes"?(this.hideQuestion(h),this.hideQuestion(t),this.hideQuestion(r),this.showQuestion(i),this.hideQuestion(n)):o==="dual_meter"&&s==="yes"?(this.hideQuestion(h),this.hideQuestion(t),this.hideQuestion(r),this.hideQuestion(i),this.showQuestion(n)):(this.hideQuestion(u),this.hideQuestion(f),this.hideQuestion(e),this.hideQuestion(t),this.hideQuestion(r),this.hideQuestion(i),this.hideQuestion(n))},t}(n.SppServiceSelectorBase.BaseQuestions);t.Electricity=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBeEnergy||(n.SppServiceSelectorBeEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function t(){$("#switch-provider-form").ssfvalidator({showValidationMessages:!0});this.bindEvents()}return t.prototype.bindEvents=function(){$(".switch-provider-form").on("blur","input",$.proxy(this.updatePartnerUrl,this));$(".switch-provider-form").on("click",".btn-partner-url",$.proxy(this.submitForm,this))},t.prototype.updatePartnerUrl=function(n){var i=$(n.currentTarget).closest("form"),t=i.find(".btn-partner-url").data("partnerurltemplate");t=t.replace(/(\{firstname\})/gi,i.find(".field-firstname").val());t=t.replace(/(\{lastname\})/gi,i.find(".field-lastname").val());t=t.replace(/(\{email\})/gi,i.find(".field-email").val());t=t.replace(/(\{memberid\})/gi,i.find(".field-membernumber").text());i.find(".btn-partner-url").attr("href",t)},t.prototype.submitForm=function(t){var i=$(t.currentTarget).closest("form");i.ssfvalidator("validate")?n.Ajax.getDataFromAction("SppServiceSelectorBeEnergy","ProcessSwitchProviderForm",null,i.serialize(),null,{useWaitPanel:!0,onValidationFailed:function(){i.find("[data-selector='form-validate-incorrect']").show()}}):t.preventDefault()},t}();t.SppEnergyBeSwitchProvider=i})(t=n.SppServiceSelectorBeEnergy||(n.SppServiceSelectorBeEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(t){function r(n){t.call(this,n,this);this.electicity=new i.QuestionSections.Electricity(this.component);this.gas=new i.QuestionSections.Gas(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,t),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.electicity.showHideElectricityQuestions(n);this.gas.showHideGasQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){this.requiredServiceValidationBox.hide();var n=this.form.find("[data-selector='summary-questions']").not(":disabled");return n.length===0?(this.requiredServiceValidationBox.show(),!1):this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.ServiceSelector.TypeScript.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=t}})},r}(t.SppServiceSelectorBase.SppBaseSummary);i.SppEnergyBeSummary=r})(i=t.SppServiceSelectorBeEnergy||(t.SppServiceSelectorBeEnergy={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"location";case"location":return"serviceselection";case"serviceselection":return $("#com_ele_include",this.element).prop("checked")?"electricity":"gas";case"electricity":return $("#com_gas_include",this.element).prop("checked")?"gas":"reductions";case"gas":return"reductions";case"reductions":return null;default:return"landingpage"}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorItEnergy||(n.SppServiceSelectorItEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.serviceSelectionQuestions=new t.QuestionSections.ServiceSelection(this.component,!1)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!1,firstStep:"landingpage",shouldHideAdditionalRegions:!0,stepToHideAdditionalRegions:"landingpage",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("location"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){this.component.on("click","input[name=energy]",function(){var n=$(this);n.is(":checked")?n.val(n.attr("id")):n.val("")})},i.prototype.questionsAnsweredLogic=function(n){this.serviceSelectionQuestions.showHideSerciceSelectionQuestions(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorItEnergy||(n.SppServiceSelectorItEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t,i){n.call(this,t);this.includeGas="com_gas_include";this.includeElec="com_ele_include";this.sameEnergyProvider="com_same_energy_provider";this.eleProvider="com_ele_provider";this.eleExpense="com_ele_expense";this.gasProvider="com_gas_provider";this.gasExpense="com_gas_expense";this.energyProvider="com_energy_provider";this.energyExpense="com_energy_expense";this.energyMeterPersonalized="ele_meter_power_specific";this.energyMeter="ele_meter_power";this.combinedServiceNoteElec="[data-selector='combinedServiceNoteOnlyElectricity']";this.combinedServiceNoteGas="[data-selector='combinedServiceNoteOnlyGas']";this.disableGas=i;this.gasFieldset=$("#modify-gas-section",this.component).children("fieldset");this.elecFieldset=$("#modify-electricity-section",this.component).children("fieldset")}return __extends(t,n),t.prototype.showHideSerciceSelectionQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion();this.showHideQuestions()},t.prototype.showHideQuestionsForQuestionnaire=function(){var s=$("input[name='"+this.sameEnergyProvider+"']:checked",this.component),h=this.component.find("[data-question='"+this.sameEnergyProvider+"']"),i=this.component.find("[data-question='"+this.eleProvider+"']"),r=this.component.find("[data-question='"+this.eleExpense+"']"),u=this.component.find("[data-question='"+this.gasProvider+"']"),f=this.component.find("[data-question='"+this.gasExpense+"']"),e=this.component.find("[data-question='"+this.energyProvider+"']"),o=this.component.find("[data-question='"+this.energyExpense+"']"),c=this.component.find("[data-question='"+this.energyMeterPersonalized+"']"),l=$("input[id='"+this.includeGas+"']",this.component),a=$("select[id='"+this.energyMeter+"']",this.component),n=$(this.combinedServiceNoteElec,this.component),t=$(this.combinedServiceNoteGas,this.component);l.is(":disabled")||this.disableGas?(this.hideQuestion(u),this.hideQuestion(f),this.showQuestion(i),this.showQuestion(r),this.hideQuestion(e),this.hideQuestion(o),this.hideQuestion(h),n.hide(),t.hide()):s.val()&&s.val().toLowerCase()==="yes"?(this.hideQuestion(u),this.hideQuestion(f),this.hideQuestion(i),this.hideQuestion(r),this.showQuestion(e),this.showQuestion(o),this.gasIsIncluded()&&!this.elecIsIncluded()?(n.hide(),t.show()):this.elecIsIncluded()&&!this.gasIsIncluded()?(n.show(),t.hide()):(n.hide(),t.hide())):(this.gasIsIncluded()?(this.showQuestion(u),this.showQuestion(f)):(this.hideQuestion(u),this.hideQuestion(f)),this.elecIsIncluded()?(this.showQuestion(i),this.showQuestion(r)):(this.hideQuestion(i),this.hideQuestion(r)),this.hideQuestion(e),this.hideQuestion(o),this.showQuestion(h),n.hide(),t.hide());a.val()==="other"?this.showQuestion(c):this.hideQuestion(c)},t.prototype.gasIsIncluded=function(){var n=$("input[id='"+this.includeGas+"']",this.component);return n.is(":checked")||this.gasFieldset.length!==0&&!this.gasFieldset.is(":disabled")},t.prototype.elecIsIncluded=function(){var n=$("input[id='"+this.includeElec+"']",this.component);return n.is(":checked")||this.elecFieldset.length!==0&&!this.elecFieldset.is(":disabled")},t.prototype.showHideQuestions=function(){this.showHideQuestionsForQuestionnaire()},t}(n.SppServiceSelectorBase.BaseQuestions);t.ServiceSelection=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorItEnergy||(n.SppServiceSelectorItEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(t){function r(n,r){t.call(this,n,this);this.serviceSelection=new i.QuestionSections.ServiceSelection(this.component,r);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,t),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.serviceSelection.showHideSerciceSelectionQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){this.requiredServiceValidationBox.hide();var n=this.form.find("[data-selector='summary-questions']").not(":disabled");return n.length===0?(this.requiredServiceValidationBox.show(),!1):this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.ServiceSelector.TypeScript.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=t}})},r}(t.SppServiceSelectorBase.SppBaseSummary);i.SppEnergyItSummary=r})(i=t.SppServiceSelectorItEnergy||(t.SppServiceSelectorItEnergy={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"serviceselection";case"serviceselection":return"telephone";case"telephone":return this.internetIsIncluded()?"internet":this.isAscrQuestionEnabled()?"saveprofile":null;case"internet":return this.isAscrQuestionEnabled()?"saveprofile":null;case"saveprofile":return null;default:return"serviceselection"}},t.prototype.internetIsIncluded=function(){var n=$("input[name='com_service_scope']:checked").val();return n==="calls_sms_data"},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorItTelcoMobile||(n.SppServiceSelectorItTelcoMobile={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var r=History,i=function(n){function i(t,i){n.call(this,t,i,this);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){var n=this;n.telcoMobileQuestions=new t.QuestionSections.TelcoMobileQuestions(n.component);this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("serviceselection"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){this.component.on("click","input[name=telco]",function(){var n=$(this);n.is(":checked")?n.val(n.attr("id")):n.val("")})},i.prototype.questionsAnsweredLogic=function(n){this.telcoMobileQuestions.showHideServiceSelectionQuestions(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorItTelcoMobile||(n.SppServiceSelectorItTelcoMobile={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideServiceSelectionQuestions=function(n){n===void 0&&(n=null);this.showHideQuestions();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideQuestions=function(){var t=$("select[name='mtel_calls_type']",this.component),n=this.component.find("[data-question='mtel_calls_type_provider']");this.getAnswerValue(t)==="cellular"?this.showQuestion(n):this.hideQuestion(n)},t}(n.SppServiceSelectorBase.BaseQuestions);t.TelcoMobileQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorItTelcoMobile||(n.SppServiceSelectorItTelcoMobile={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(r){function u(n){r.call(this,n,this);this.telcoQuestions=new i.QuestionSections.TelcoMobileQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(u,r),u.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);this.telcoQuestions.showHideServiceSelectionQuestions(n)},u.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},u.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},u.prototype.doSubmit=function(i){t.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=i}})},u}(t.SppServiceSelectorBase.SppBaseSummary);i.SppTelcoMobileItSummary=r})(i=t.SppServiceSelectorItTelcoMobile||(t.SppServiceSelectorItTelcoMobile={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(t){function r(n,i){t.call(this,n,i,this)}return __extends(r,t),r.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"location";case"location":return"serviceselection";case"serviceselection":return this.shouldIncludeContractsFeatureInWizard()?"selectcontracts":this.isServiceSelected("internet")?"internet":"telephone";case"internet":return this.isServiceSelected("telephone")?"telephone":this.isServiceSelected("television")?"television":this.isAscrQuestionEnabled()?"saveprofile":null;case"telephone":return this.isServiceSelected("television")?"television":this.isAscrQuestionEnabled()?"saveprofile":null;case"television":return this.isAscrQuestionEnabled()?"saveprofile":null;case"selectcontracts":return this.isServiceSelected("internet")?"internet":"telephone";case"saveprofile":return null;default:return"landingpage"}},r.prototype.isServiceSelected=function(t){var i=$("input[name='service_scope']:checked",this.element),r;i.length===0&&n.Debug.logToConsole("Service selection field not found.",!0);r=i.val();switch(r){case"fix_phone":return t==="telephone";case"fix_internet":return t==="internet";case"fix_internet_phone":return t==="telephone"||t==="internet";case"fix_internet_phone_tv":return!0;case"fix_internet_tv":return t==="internet"||t==="television";default:return n.Debug.logToConsole("Service selection field value could not be matched to known states.",!0),!1}},r}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBeTelco||(n.SppServiceSelectorBeTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.telcoQuestions=new t.QuestionSections.TelcoQuestions(this.component)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!1,firstStep:"landingpage",shouldHideAdditionalRegions:!0,stepToHideAdditionalRegions:"location",contractsFeatureEnabled:this.options.contractsFeatureEnabled,ascrFeatureEnabled:this.options.ascrFeatureEnabled,userIsLoggedIn:this.options.userIsLoggedIn});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("location"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(n){this.telcoQuestions.showHideQuestions(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBeTelco||(n.SppServiceSelectorBeTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t);this.bindEvents()}return __extends(t,n),t.prototype.bindEvents=function(){var n=this,t=this;this.component.on("click","#add-country",function(){t.appendNewCountry($("#country-container",n.component))});this.component.on("click","[data-selector='remove-country']",function(t){n.removeCountry(t)})},t.prototype.showHideQuestions=function(n){this.showHidePersonalisation();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHidePersonalisation=function(){var n=$("#phone_personalisation",this.component),t=$("[name='ftel_profile']:checked",this.component);t.attr("id")==="ftel_profile_personal"?(n.appendTo(t.parent()).show(),this.showHidePersonalisationInternational()):n.hide()},t.prototype.showHidePersonalisationInternational=function(){var t=$("#phone-personalisation-international",this.component);if($("[name='ftel_include_international']",this.component).is(":checked")){this.showQuestion(t);var n=$("#country-container",this.component),i=n.children("[data-selector='country']").length,r=parseInt(n.attr("data-current-index"));i===0&&r===0&&this.appendNewCountry(n);this.showHideButtons(n)}else this.hideQuestion(t)},t.prototype.appendNewCountry=function(n){var r=this,u=n.children("[data-selector='country']").length,f=parseInt(n.attr("data-max-countries"));if(!(u>=f)){var e=$("#js-country-template").html(),t=parseInt(n.attr("data-current-index"))+1,i=$(e.replace(/_1/g,"_"+t));$(".form__field--select",i).uniform();n.append(i);this.recalculatePositions(n);n.attr("data-current-index",t);setTimeout(function(){$("form:visible",r.component).ssfvalidator("restart")},0);this.showHideButtons(n)}},t.prototype.recalculatePositions=function(n){var t=0,i=this;$(n).find("[data-selector='country']").each(function(){$(this).find("[name^='ftel_']").each(function(){var n=$(this).attr("name"),r=t+1,u="";i.endsWith(n,"_country")&&(u=n.substring(0,n.length-9)+r+"_country");u=i.endsWith(n,".Value")?n.substring(0,n.length-7)+r+".Value":n.substring(0,n.length-1)+r;$(this).attr("name",u)});t++})},t.prototype.endsWith=function(n,t){return n.indexOf(t,n.length-t.length)!==-1},t.prototype.removeCountry=function(n){var t=$("#country-container",this.component);$(n.currentTarget).closest("[data-selector='country']").remove();this.recalculatePositions(t);this.showHideButtons(t)},t.prototype.showHideButtons=function(n){var t=n.children("[data-selector='country']"),r=parseInt(n.attr("data-max-countries")),i=t.first().find("[data-selector='actions']");t.length<=1?i.addClass("hidden"):i.removeClass("hidden");t.length===r?$("#add-country").attr("class","hidden"):$("#add-country").attr("class","btn btn--secondary btn--small")},t}(n.SppServiceSelectorBase.BaseQuestions);t.TelcoQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBeTelco||(n.SppServiceSelectorBeTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(r){function u(n){r.call(this,n,this);this.telcoQuestions=new i.QuestionSections.TelcoQuestions(this.component);this.controllerName=n.controllerName;this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null);this.includeTelevision=$("#includeTelevision",this.component);this.televisionServiceValidationBox=$("#requiredOnlyTelevision",this.component);this.form.on("click.telcoSummary","[data-selector='add-link-panel'] .action-link",this.enableDisableServiceOnAdd);this.form.on("click.telcoSummary","[data-selector='remove-service']",this.enableDisableServiceOnRemove);this.form.on("click.telcoSummary","[data-selector='summary-add-profile']",this.toggleAddContract);this.form.on("click.telcoSummary","[data-selector='start-adding-contracts']",this.loadEditFrame);this.form.on("click.telcoSummary","[data-selector='edit-contract']",this.loadEditFrame);this.form.on("click.telcoSummary","[data-selector='related-contracts']",this.hideExpenses);this.enableDisableService();n.addContractToggled&&this.toggleAddContract()}return __extends(u,r),u.prototype.hideExpenses=function(){$("[data-selector='summaryModal_totalExpenses']").hide();$("[data-selector='summaryModal_bestSavingAmount']").hide();$("[data-selector='summaryModal_recalculateBestSavings']").show()},u.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.telcoQuestions.showHideQuestions(n)},u.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},u.prototype.doValidate=function(){var n,t;return(this.requiredServiceValidationBox.hide(),this.televisionServiceValidationBox.hide(),n=this.form.find("[data-selector='summary-questions']").not(":disabled"),n.length===0)?(this.requiredServiceValidationBox.show(),!1):n.length===1&&(t=n.eq(0).data("tv"),t==="True")?(this.televisionServiceValidationBox.show(),!1):this.form.ssfvalidator("validate")},u.prototype.doSubmit=function(i){for(var e=this,f=$('div[data-selector="related-contracts"] input[type="checkbox"]:checked'),r,u=0;u<f.length;u++)r=$(f[u]),r.val(r.attr("data-value"));t.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=i},onValidationFailed:function(){e.requiredServiceValidationBox.show()}})},u.prototype.enableDisableService=function(){var n=this.form.find("[data-section='internet-section']"),u=this.form.find("[data-section='telephone-section']"),f=this.form.find("[data-section='television-section']"),t=n.data("selected"),i=u.data("selected"),r=f.data("selected");return i&&!t&&!r?($(f).find("[data-selector='add-link-panel']").hide(),$(u).find("[data-selector='remove-link-panel']").hide(),!1):!i&&t&&!r?($(n).find("[data-selector='remove-link-panel']").hide(),!1):!i&&t&&r?($(n).find("[data-selector='remove-link-panel']").hide(),!1):void 0},u.prototype.enableDisableServiceOnAdd=function(){var n=$(this).closest(".js-removeable");n.data("section")==="television-section"?n.parent().find("[data-section='internet-section']").find("[data-selector='remove-link-panel']").hide():n.data("section")==="internet-section"&&(n.parent().find("[data-section='television-section']").find("[data-selector='add-link-panel']").show(),n.parent().find("[data-section='telephone-section']").find("[data-selector='remove-link-panel']").show())},u.prototype.toggleAddContract=function(){$("[data-selector='summary-add-profile-box']").slideToggle()},u.prototype.loadEditFrame=function(){var n=$(this).data("value");t.Ajax.sendDataToActionAndUpdate("SSFContractManagement","EditContract",null,{contractId:n,divId:"edit-contract-frame-"+n},null,{onSuccess:function(){return $("#edit-contract-frame-"+n).slideToggle()}})},u.prototype.enableDisableServiceOnRemove=function(){var n=$(this).closest(".js-removeable");n.data("section")==="television-section"&&n.parent().find("[data-section='internet-section']").find("[data-selector='remove-link-panel']").show();n.data("section")==="internet-section"&&n.parent().find("[data-section='television-section']").find("[data-selector='add-link-panel']").hide()},u}(t.SppServiceSelectorBase.SppBaseSummary);i.SppTelcoBeSummary=r})(i=t.SppServiceSelectorBeTelco||(t.SppServiceSelectorBeTelco={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(){function t(n){var t=this;this.serviceOfferId=n;this.steps=$(".step");this.breadcrumb=$(".progress-bar__list");this.dataResume=$(".data-resume");this.form=$(".switch-provider-form");this.verificationStep=5;this.resumeTemplate='<div class="form__item form__item--string"><label class="form__label form__label--adjacent" style="padding-top:0;">{{label}}<\/label><span>{{value}}<\/span><\/div>';i.Adapter.bind(window,"statechange",$.proxy(this.loadStepFromState,this));this.steps.each(function(n,t){$(t).ssfvalidator({showValidationMessages:!0,showSummary:!0,summarySelector:".val-summary"})});this.form.ssfvalidator({showValidationMessages:!0,showSummary:!0,summarySelector:".val-summary",includeHiddenFields:!0});this.steps.find(".next-step").on("click",function(n){n.preventDefault();var r=$(n.currentTarget).parents(".step"),u=parseInt(r.data("step"))+1;r.ssfvalidator("validate")!=!1&&i.pushState({step:u},document.title,"?serviceOfferId="+t.serviceOfferId)});this.bindBreadCrumbClick();this.bindFormSubmit();this.bindEvents();i.replaceState({step:1},document.title,"?serviceOfferId="+this.serviceOfferId)}return t.prototype.bindEvents=function(){var n=this;$(".currentphoneprovider-text").hide();$("#FormValues_CurrentPhoneProviderId").on("change",function(n){$(n.currentTarget).val()!=""?$(".currentphoneprovider-text").show():$(".currentphoneprovider-text").hide()});$("#FormValues_CurrentPhoneProviderId").on("change",function(){n.changePhoneValidation()});$("#FormValues_CurrentPhoneProviderId, #FormValues_CurrentInternetProviderId, #FormValues_CurrentTvProviderId").on("change",function(n){var t=$(n.currentTarget);$("#"+t.attr("id").replace("Id","")).val(t.children("option").filter(":selected").text())})},t.prototype.loadStepFromState=function(){var r=i.getState(),n,t;r.data.step&&(n=r.data.step,t=$("div[data-step='"+n+"']"),this.showStep(n),this.updateBreadCrumb(n),t.data("completed",!0),$("body").scrollTo(t))},t.prototype.changePhoneValidation=function(){$("#FormValues_CurrentPhoneProviderId").val()?($("#FormValues_PhoneNumberToConvert").attr("data-validation","required BEphone"),$("#FormValues_ClientFixedPhone").attr("data-validation","required")):($("#FormValues_PhoneNumberToConvert").attr("data-validation",""),$("#FormValues_ClientFixedPhone").attr("data-validation",""))},t.prototype.bindFormSubmit=function(){var t=this;this.form.on("submit",function(i){i.preventDefault();t.changePhoneValidation();$(".switch-provider-form").ssfvalidator("restart");$(".switch-provider-form").ssfvalidator("validate")?n.Ajax.submitFormAndGetData(t.form[0],{onValidationFailed:function(){t.form.find("[data-selector='form-validate-incorrect']").show()},onSuccess:function(n){n.success?$(".confirmation").show():$(".confirmationFailed").show();$("[data-step]").addClass("hidden");t.breadcrumb.find("li").last().addClass("progress-bar__list__item--complete").removeClass("progress-bar__list__item--current");t.breadcrumb.find("li a").each(function(n,t){var i=$(t),r=i.text();i.parent().text(r);i.remove()})}}):t.showStep(t.form.find(".form__item--has-errors").first().parents("[data-step]").data("step"))})},t.prototype.bindBreadCrumbClick=function(){var n=this;this.breadcrumb.find("li a").off("click").on("click",function(t){var r,u;(t.preventDefault(),r=$(t.currentTarget).parent(),r.hasClass("progress-bar__list__item--incomplete"))||(u=n.breadcrumb.children().index(r)+1,i.pushState({step:u},document.title,null))})},t.prototype.showStep=function(n){var t;if($("[data-step],.confirmation").addClass("hidden"),$("[data-step="+n+"]").removeClass("hidden"),n==this.verificationStep){var u=this.steps.slice(0,this.verificationStep-1),i=this.createFormSummary(u),r="";for(t in i)r+=Mustache.render(this.resumeTemplate,i[t]);this.dataResume.html(r)}},t.prototype.createFormSummary=function(n){var t=[];return $.each(n,function(n,i){var r=$(i),u=r.find(":input:not([type=hidden],button)");$.each(u,function(n,i){var r=$(i),u={},f,e,o,s;if(u.id=r.attr("name"),r.is("input:text")||r.is("textarea"))f=r.parents(".date"),f.length?(e=t.pop(),e.type&&e.type=="date"||t.push(e),o=[],$.each(f.find("input[type=text]"),function(n,t){o.push($(t).val())}),u.type="date",u.label=f.find("label").text(),u.value=o.join("/")):(u.label=r.siblings("label").text(),u.value=r.val());else if(r.is("select"))u.value=r.find("option:selected").text(),u.label=r.parents(".form__item--select").find("label").text();else if(r.is(":radio"))t=$.grep(t,function(n){return n.id!=r.attr("name")}),s=r.parents(".form__group"),u.label=s.find(".form__group__title").text(),u.value=r.is(":checked")?r.siblings("label").text():s.find(":input:checked").siblings("label").text();else return;u.value&&u.value!=""&&t.push(u)})}),t},t.prototype.updateBreadCrumb=function(n){var i=this.breadcrumb.find("li:nth-child("+n+")"),f=this.breadcrumb.children().index($(".progress-bar__list__item--current"))+1,t,r,u;n<f||(t=i.prev(),i.addClass("progress-bar__list__item--current").removeClass("progress-bar__list__item--incomplete"),r=$('<a class="progress-bar__list__link">').attr("href","#").text(i.text()),i.html("").append(r),t.length&&(t.addClass("progress-bar__list__item--complete").removeClass("progress-bar__list__item--current"),u=$('<a class="progress-bar__list__link">').attr("href","#").text(t.text()),t.html("").append(u)),this.breadcrumb.find("li").slice(n).each(function(n,t){var i=$(t),r=i.text();i.removeClass("progress-bar__list__item--current","progress-bar__list__item--complete").addClass("progress-bar__list__item--incomplete").html(r)}),this.bindBreadCrumbClick())},t}();t.SwitchProvider=r})(t=n.SppServiceSelectorBeTelco||(n.SppServiceSelectorBeTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"serviceselection";case"serviceselection":return $("#service_mtel_include",this.element).prop("checked")?"mobilephone":"mobiledata";case"mobilephone":return $("#service_mint_include",this.element).prop("checked")?"mobiledata":"tarifftype";case"mobiledata":return"tarifftype";case"tarifftype":return null;default:return"landingpage"}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBeTelcoMobile||(n.SppServiceSelectorBeTelcoMobile={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(t,i){n.call(this,t,i,this);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.telcoMobileQuestions=new t.QuestionSections.TelcoMobileQuestions(this.component);this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!0,stepToHideAdditionalRegions:"location",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("serviceselection"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){this.component.on("click","input[name=service_scope]",function(){var n=$(this);n.is(":checked")?n.val(n.attr("id")):n.val("")})},i.prototype.questionsAnsweredLogic=function(n){console.log("Questionnaire: questionsAnsweredLogic");this.telcoMobileQuestions.showHideTelcoMobileForms(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBeTelcoMobile||(n.SppServiceSelectorBeTelcoMobile={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){"use strict";var i=function(n){function t(t){n.call(this,t);this.personalizedConst="personalized";this.mobilePhoneConst="mtel";this.mobileDataConst="mint";this.noServicesSelectedConst="none";this.bothServicesSelectedConst="both";this.mobilePhoneServiceSelectedConst="service_mtel_include";this.mobileDataServiceSelectedConst="service_mint_include";this.mobilePhoneFieldset=$("#modify-mobilephone-section",this.component).children("fieldset");this.mobileDataFieldset=$("#modify-mobiledata-section",this.component).children("fieldset");this.hasMobileData=this.component.find("a[href='#delete-mobiledata-section']:visible").length>0;this.hasMobilePhone=this.component.find("a[href='#delete-mobilephone-section']:visible").length>0;this.eventsBound=!1;this.personalisationMtelOpen=!1;this.personalisationMintOpen=!1;this.mobilePersonalizationBound=!1}return __extends(t,n),t.prototype.showHideTelcoMobileForms=function(n){n===void 0&&(n=null);this.showHidePersonalization();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.getSelectedServices=function(){var n,r,t,i;if(this.isSummaryContainerActive=!1,n=$("div[data-component-selector='serviceselection'] input[type='checkbox']:enabled:checked"),r=$("div[data-selector='summary-container']"),n.length===0){if(r.length===1){if(this.isSummaryContainerActive=!0,t=$("div[data-component-selector='mobilephone'] input[type='radio']:enabled:checked"),i=$("div[data-component-selector='mobiledata'] input[type='radio']:enabled:checked"),t.length===1&&i.length>0)return this.bothServicesSelectedConst;if(t.length===1)return this.mobilePhoneServiceSelectedConst;if(i.length>0)return this.mobileDataServiceSelectedConst}return this.noServicesSelectedConst}return n.length===1?n.val():this.bothServicesSelectedConst},t.prototype.showHidePersonalization=function(){var t=$("div[data-component-selector='mobilephone'] input[type='radio']:enabled:checked"),n=$("div[data-component-selector='mobiledata'] input[type='radio']:enabled:checked");switch(this.getSelectedServices()){case"both":this.includeExcludeMobilePhone(!0);t.val()===this.personalizedConst?this.personalizeMobilePhone(t):this.removePersonalization(this.mobilePhoneConst);n.length===2?n.last().val()===this.personalizedConst?this.personalizeMobileData(n.last()):this.removePersonalization(this.mobileDataConst):n.val()===this.personalizedConst?this.personalizeMobileData(n):this.removePersonalization(this.mobileDataConst);break;case"service_mtel_include":t.val()===this.personalizedConst?this.personalizeMobilePhone(t):this.removePersonalization(this.mobilePhoneConst);break;case"service_mint_include":this.includeExcludeMobilePhone(!1);n.val()===this.personalizedConst?this.personalizeMobileData(n):this.removePersonalization(this.mobileDataConst)}this.isSummaryContainerActive&&this.bindTelcoMobileSummaryEvents()},t.prototype.includeExcludeMobilePhone=function(n){var t=$("div[data-component-selector='mobiledata']"),i=t.find("[data-question='mint_profile_includephone']"),r=t.find("[data-question='mint_profile']");n?(this.showQuestion(i),this.hideQuestion(r)):(this.hideQuestion(i),this.showQuestion(r))},t.prototype.personalizeMobilePhone=function(n){var t=$("div[data-component-selector='mobilephone']"),u=t.find("#mobilephone_personalisation"),r,i;this.showQuestion(u.appendTo(n.parent()));r=t.find("#mtel_profile_personalized_fix_phone_include:checked");i=t.find("#mobilephone_personalisation_fixphone");r.length===1?this.showQuestion(i):this.hideQuestion(i)},t.prototype.personalizeMobileData=function(n){var i=$("div[data-component-selector='mobiledata']"),r=i.find("#mobiledata_personalisation"),t=n.parent().children("div");t.length===0&&this.showQuestion(r.appendTo(n.parent()));t.length===1&&this.showQuestion(t.first())},t.prototype.removePersonalization=function(n){switch(n){case this.mobileDataConst:this.hideQuestion($("div[data-component-selector='mobiledata'] #mobiledata_personalisation"));break;case this.mobilePhoneConst:this.hideQuestion($("div[data-component-selector='mobilephone'] #mobilephone_personalisation"))}},t.prototype.bindTelcoMobileSummaryEvents=function(){if(!this.eventsBound){console.log("bindTelcoMobileSummaryEvents: GENERAL");this.hasMobileData=this.component.find("a[href='#delete-mobiledata-section']:visible").length>0;this.hasMobilePhone=this.component.find("a[href='#delete-mobilephone-section']:visible").length>0;var n=this.component.find("[data-addremove-selector='mobilephone-section']"),i=n.find("[data-selector='add-link-panel']").children("a[href='#modify-mobilephone-section']"),r=n.find("a[role='button'][data-profilename='mobilephone-section']"),t=this.component.find("[data-addremove-selector='mobiledata-section']");i.on("click",$.proxy(this.clickMobilePhoneAdd,this,t));r.on("click",$.proxy(this.clickMobilePhoneRemove,this,t));console.log("bindTelcoMobileSummaryEvents: events bound");this.eventsBound=!0}},t.prototype.clickMobilePhoneAdd=function(n){this.hasMobileData&&(n.find("a[href='#modify-mobiledata-section']").click(),console.log("clickMobilePhoneAdd: click forced"))},t.prototype.clickMobilePhoneRemove=function(n){this.hasMobileData&&(n.find("a[href='#modify-mobiledata-section']").last().click(),console.log("clickMobilePhoneRemove: click forced"))},t}(n.SppServiceSelectorBase.BaseQuestions);t.TelcoMobileQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBeTelcoMobile||(n.SppServiceSelectorBeTelcoMobile={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(i){function r(n){i.call(this,n,this);this.telcoMobileQuestions=new t.QuestionSections.TelcoMobileQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.telcoMobileQuestions.showHideTelcoMobileForms(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){var n,t;return(this.requiredServiceValidationBox.hide(),n=this.form.find("[data-selector='summary-questions']").not(":disabled"),n.length===0)?(this.requiredServiceValidationBox.show(),!1):(t=this.form.find("[data-selector='summary-tarifftype']").not(":disabled"),t.length===0)?(this.requiredServiceValidationBox.show(),!1):this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppTelcoMobileBeSummary=i})(t=n.SppServiceSelectorBeTelcoMobile||(n.SppServiceSelectorBeTelcoMobile={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"location";case"location":return"producttype";case"producttype":return null;case"productchoice":return this.isAscrQuestionEnabled()?"saveprofile":null;case"saveprofile":return null;default:return"landingpage"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBeSupermarket||(n.SppServiceSelectorBeSupermarket={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);$(".js-popup",this.component).modal();$("form",this.component).ssfvalidator({showValidationMessages:!0});this.supermarketQuestions=new t.QuestionSections.ProfileChoiceQuestions(this.component)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("questionnaire"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(n){this.supermarketQuestions.showHideQuestions(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBeSupermarket||(n.SppServiceSelectorBeSupermarket={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideQuestions=function(n){this.showHideProductChoice();this.selectProductType();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideProductChoice=function(){var t=$("#brand_choice",this.component),i=$("#distributorFirstPrice_choice",this.component),r=$("#mixBrandDistributor_choice",this.component),n=$("input[name='ele_product_type']:checked",this.component);n.attr("id")==="ele_product_type_brand"?t.appendTo(n.parent().parent()).show():t.hide();n.attr("id")==="ele_product_type_distributor_firstPrice"?i.appendTo(n.parent().parent()).show():i.hide();n.attr("id")==="ele_product_type_mix_brand_distributor_firstPrice"?r.appendTo(n.parent().parent()).show():r.hide()},t.prototype.selectProductType=function(){var n=$("input[name='ele_brand_choice']",this.component),t=$("input[name='ele_distributor_firstPrice_choice']",this.component),i=$("input[name='ele_mix_brand_distributor_choice']",this.component);n.is(":checked")&&$("#ele_product_type_brand",this.component).prop("checked",!0);i.is(":checked")&&$("#ele_product_type_mix_brand_distributor_firstPrice",this.component).prop("checked",!0);t.is(":checked")&&$("#ele_product_type_distributor_firstPrice",this.component).prop("checked",!0)},t}(n.SppServiceSelectorBase.BaseQuestions);t.ProfileChoiceQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBeSupermarket||(n.SppServiceSelectorBeSupermarket={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.profileChoiceQuestions=new t.QuestionSections.ProfileChoiceQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.profileChoiceQuestions.showHideQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppSupermarketBeSummary=i})(t=n.SppServiceSelectorBeSupermarket||(n.SppServiceSelectorBeSupermarket={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){try{n.validator.unobtrusive.parse&&SWITCH_NOVALIDATION&&(n.validator.unobtrusive.parse=n.noop)}catch(t){return}}(jQuery),function(n){var t;(function(t){var i;(function(t){var i;(function(i){"use strict";var e="e2e",o=function(){function i(n,t){this._workflow=n;this._step=t}return i.prototype.extendValidation=function(){var t=this;$.validator.addMethod("nonumber",function(n){return n.length===0||t.checkNoNumbers(n)});$.validator.unobtrusive.adapters.addBool("nonumber");$.validator.addMethod("fulldate",$.proxy(this.checkDateField,this));$.validator.unobtrusive.adapters.addBool("fulldate");$.validator.addMethod("fulldatepast",$.proxy(this.checkDateFieldPast,this));$.validator.unobtrusive.adapters.addBool("fulldatepast");$.validator.addMethod("fulldatefuture",$.proxy(this.checkDateFieldFuture,this));$.validator.unobtrusive.adapters.addBool("fulldatefuture");var i=document.getElementById("switch-form"),n=this.$form=$(i),r={options:{errorClass:"form__item--has-errors",errorPlacement:$.noop,invalidHandler:$.proxy(this.invalidHandler,this),submitHandler:$.proxy(this.submitHandler,this),highlight:this.highlight,unhighlight:this.unhighlight,messages:{},rules:{}},attachValidation:function(){n.validate(this.options)},validate:function(){return n.validate(),n.valid()}};this.$form.data("unobtrusiveValidation",r)},i.prototype.initComponents=function(){this.query=new r(window.location.search);this.$summary=this.$form.find("[data-valmsg-summary=true] > ul")},i.prototype.invalidHandler=function(n,t){if(this.$summary&&this.$summary.length&&t.errorList.length){this.$summary.empty();var i=[],r=this.$summary;$.each(t.errorList,function(){i.indexOf(this.message)===-1&&($("<li />").html(this.message).appendTo(r),i.push(this.message))});i=null}},i.prototype.highlight=function(n,t){$(n).closest("div.form__item").addClass(t)},i.prototype.unhighlight=function(n,t){$(n).closest("div.form__item").removeClass(t)},i.prototype.submitHandler=function(n){var i=this,r,u;this.$summary.empty();r=n.action;u={url:r,type:n.method,data:$(n).serialize(),traditional:!0};t.Ajax.getData(u,{onSuccess:function(n){n.errorFields?i.displayFieldErrors(n.errorFields):i.goToStep(++i._step)},onValidationFailed:$.proxy(this.displayOtherErrors,this)})},i.prototype.displayOtherErrors=function(n){for(var t=0;t<n.length;t++)$("<li />").html(n[t]).appendTo(this.$summary)},i.prototype.displayFieldErrors=function(n){var t,r,i;for(t in n)for(r=this.$form.find("[name='"+t+"']").get(0),this.highlight(r,"form__item--has-errors"),i=0;i<n[t].length;i++)$("<li />").html(n[t][i]).appendTo(this.$summary)},i.prototype.goToStep=function(t){n.ServiceSelector.TypeScript.WaitPanel.increment();this.query.setParam("s",this._workflow[t]);window.location.search=this.query.build()},i.prototype.checkNoNumbers=function(n){return/^[^0-9]*$/.test(n)},i.prototype.extractDate=function(n){var f=n.closest(".date"),u=f.find("[data-val-dateinfo='day']").val(),t=f.find("[data-val-dateinfo='month']").val(),i=f.find("[data-val-dateinfo='year']").val(),r={valid:!0,date:null},e,o;return u.length==0&&t.length==0&&i.length==0?r:u.length==0||t.length==0||i.length<4?(r.valid=!1,r):((u=+u,t=+t,i=+i,t<1||t>12||isNaN(i))?r.valid=!1:(e=i%4!=0?!1:i%100!=0||i%400==0?!0:!1,o=$.inArray(t,[1,3,5,7,8,10,12])>-1?31:t==2?e?29:28:30,(u<1||u>o)&&(r.valid=!1)),r.valid&&(r.date=new Date(i,t-1,u,0,0,0,0)),r)},i.prototype.checkDateField=function(n,t){var i=this.extractDate($(t));return i.valid},i.prototype.checkDateFieldPast=function(n,t){var r=this.extractDate($(t)),i;return r.date==null&&r.valid?!0:r.valid?(i=new Date,i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),r.date<i):!1},i.prototype.checkDateFieldFuture=function(n,t){var r=this.extractDate($(t)),i;return r.date==null&&r.valid?!0:r.valid?(i=new Date,i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),r.date>i):!1},i}(),r,u,f;i.SwitchFormBase=o;r=function(){function n(n){var i,t,r;for(this.search=n,i=window.location.search.substr(1).split("&"),this._params={},t=0;t<i.length;t++)r=i[t].split("="),this._params[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return n.prototype.getParam=function(n){return this._params[n]},n.prototype.remove=function(n){delete this._params[n]},n.prototype.setParam=function(n,t){this._params[n]=t},n.prototype.build=function(){var t=[],n;for(n in this._params)t.push(encodeURIComponent(n)+"="+encodeURIComponent(this._params[n]));return"?"+t.join("&")},n}();i.UrlQuery=r;u=function(){function n(){$("[data-tooltip-trigger]").each(function(n,t){var i=$(t),r=i.attr("data-tooltip-trigger"),u=$("[data-tooltip='"+r+"']");i.click(function(n){n.preventDefault();u.toggle()})})}return n}();i.Tooltip=u;f=function(){function n(n){this.settings=n}return n.prototype.start=function(){this.timeoutId!=null&&clearTimeout(this.timeoutId);this.timeoutId=setTimeout($.proxy(this.pool,this),this.settings.delay*1e3)},n.prototype.pool=function(){var n=this;t.Ajax.getDataFromAction(this.settings.poolingController,this.settings.poolingAction,e+"="+this.settings.end2endProcessId+"&_="+(new Date).getTime(),null,{type:"GET",success:function(){n.start()}},{useErrorWindow:!1,useWaitPanel:!1})},n}();i.SessionPooling=f})(i=t.SwitchBase||(t.SwitchBase={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function t(){n.apply(this,arguments)}return __extends(t,n),t.prototype.initComponents=function(){var t=this;n.prototype.initComponents.call(this);this.$billingAddressWrapper=$("#billingAddress-wrapper");this.$billingAddressInputs=this.$billingAddressWrapper.find("[name^='BillingAddress']");this.$billingAddressInputs.is(":visible")||this.$billingAddressInputs.attr("disabled","disabled");this.$chkHasDifferentBillingAddress=$("[name^='HasDifferentBillingAddress']");this.$chkHasDifferentBillingAddress.change(function(n){$(n.currentTarget).val().toLowerCase()==="true"?(t.$billingAddressInputs.removeAttr("disabled"),t.$billingAddressWrapper.slideDown()):t.$billingAddressWrapper.slideUp(function(){t.$billingAddressInputs.attr("disabled","disabled");t.$form.ssfvalidatorUnobstrusive("revalidate")})});this.$phoneProvidersDropdown=$("#CurrentPhoneProvider");this.$phoneProviderInfosWrapper=$("#CurrentPhoneProviderInfos");this.$phoneProviderInfosInputs=$("#PhoneNumberToConvert,#CustomerNumber,#CurrentOtherPhoneProvider");this.$otherPhoneProviderInput=$("#CurrentOtherPhoneProvider");this.$phoneProvidersDropdown.change($.proxy(this.phoneProviderChange,this));this.$phoneProvidersDropdown.change($.proxy(this.trackOtherProviderHandler,this,this.$otherPhoneProviderInput));this.$internetProvidersDropdown=$("#CurrentInternetProvider");this.$otherInternetProviderInput=$("#CurrentOtherInternetProvider");this.$internetProvidersDropdown.change($.proxy(this.trackOtherProviderHandler,this,this.$otherInternetProviderInput));this.$tvProvidersDropdown=$("#CurrentTvProvider");this.$otherTvProviderInput=$("#CurrentOtherTvProvider");this.$tvProvidersDropdown.change($.proxy(this.trackOtherProviderHandler,this,this.$otherTvProviderInput))},t.prototype.phoneProviderChange=function(){var t=this,n=this.$phoneProvidersDropdown.val();n!=-1&&n?(this.$phoneProviderInfosInputs.removeAttr("disabled"),this.$phoneProviderInfosWrapper.slideDown()):this.$phoneProviderInfosWrapper.slideUp(function(){t.$phoneProviderInfosInputs.attr("disabled","disabled")})},t.prototype.trackOtherProviderHandler=function(n,t){var r=$(t.currentTarget).val(),i=n.closest("div");r==-2?(this.$phoneProviderInfosWrapper.find("span[data-selector='optional']").show(),n.removeAttr("disabled"),i.slideDown()):(this.$phoneProviderInfosWrapper.find("span[data-selector='optional']").hide(),i.slideUp(function(){n.attr("disabled","disabled")}))},t}(n.SwitchBase.SwitchFormBase);t.SwitchFormCurrentContract=i})(t=n.SwitchBeTelco||(n.SwitchBeTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function t(){n.apply(this,arguments)}return __extends(t,n),t.prototype.initComponents=function(){var t=this;n.prototype.initComponents.call(this);this.$activationTimeWrapper=$("#postponedActivationDate-wrapper");this.$activationTimeInputs=$("[name^='ActivationDate']");this.$activationTimeInputs.is(":visible")||this.$activationTimeInputs.attr("disabled","disabled");this.$radioActivationTime=$("[name='HasWishDate']");this.$radioActivationTime.change(function(n){$(n.currentTarget).val()==="true"?(t.$activationTimeInputs.removeAttr("disabled"),t.$activationTimeWrapper.slideDown()):t.$activationTimeWrapper.slideUp(function(){t.$activationTimeInputs.attr("disabled","disabled")})})},t}(n.SwitchBase.SwitchFormBase);t.SwitchFormCustomerPreference=i})(t=n.SwitchBeTelco||(n.SwitchBeTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"serviceselection";case"serviceselection":return $("#com_fint_include",this.element).prop("checked")?"internet":"telephone";case"internet":return $("#com_ftel_include",this.element).prop("checked")?"telephone":this.isAscrQuestionEnabled()?"saveprofile":null;case"telephone":return this.isAscrQuestionEnabled()?"saveprofile":null;case"saveprofile":return null;default:return"serviceselection"}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorItTelcoFix||(n.SppServiceSelectorItTelcoFix={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var r=History,i=function(n){function i(t,i){n.call(this,t,i,this);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){var n=this;n.telcoQuestions=new t.QuestionSections.TelcoQuestions(n.component);this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1,onStepLoaded:function(t){t==="serviceselection"&&n.telcoQuestions.showHideSerciceSelectionQuestions()}});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("serviceselection"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){this.component.on("click","input[name=telco]",function(){var n=$(this);n.is(":checked")?n.val(n.attr("id")):n.val("")})},i.prototype.questionsAnsweredLogic=function(n){this.telcoQuestions.showHideSerciceSelectionQuestions(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorItTelcoFix||(n.SppServiceSelectorItTelcoFix={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t);this.includeInternet="com_fint_include";this.includePhone="com_ftel_include";this.sameProviderTextMessageSelector=".form__item__note:not(.form__item__note--error)";this.telcoFixExpense="com_fixtelco_expense"}return __extends(t,n),t.prototype.showHideSerciceSelectionQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion();this.showHideQuestions()},t.prototype.showHideQuestions=function(){var r=$("input[id='"+this.includeInternet+"']",this.component),u=$("input[id='"+this.includePhone+"']",this.component),n=this.component.find("[data-question='"+this.telcoFixExpense+"']").children(this.sameProviderTextMessageSelector),t=r.is(":checked"),i=u.is(":checked");t&&!i||i&&!t?n.show():n.hide()},t}(n.SppServiceSelectorBase.BaseQuestions);t.TelcoQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorItTelcoFix||(n.SppServiceSelectorItTelcoFix={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(r){function u(n){r.call(this,n,this);this.telcoQuestions=new i.QuestionSections.TelcoQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(u,r),u.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);this.telcoQuestions.showHideSerciceSelectionQuestions(n)},u.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},u.prototype.doValidate=function(){this.requiredServiceValidationBox.hide();var n=this.form.find("[data-selector='summary-questions']").not(":disabled");return n.length===0?(this.requiredServiceValidationBox.show(),!1):this.form.ssfvalidator("validate")},u.prototype.doSubmit=function(i){var r=this;t.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=i},onValidationFailed:function(){r.requiredServiceValidationBox.show()}})},u}(t.SppServiceSelectorBase.SppBaseSummary);i.SppTelcoFixItSummary=r})(i=t.SppServiceSelectorItTelcoFix||(t.SppServiceSelectorItTelcoFix={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"location";case"location":return"serviceselection";case"serviceselection":return $("#e_include",this.element).prop("checked")?"electricity":"gas";case"electricity":return $("#g_include",this.element).prop("checked")?"gas":this.isAscrQuestionEnabled()?"saveprofile":null;case"gas":return this.isAscrQuestionEnabled()?"saveprofile":null;case"saveprofile":return null;default:return"landingpage"}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorEsEnergy||(n.SppServiceSelectorEsEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.electricityQuestions=new t.QuestionSections.Electricity(this.component);this.gasQuestions=new t.QuestionSections.Gas(this.component)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!1,firstStep:"landingpage",shouldHideAdditionalRegions:!0,stepToHideAdditionalRegions:"location",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("location"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){this.component.on("click","input[name=energy]",function(){var n=$(this);n.is(":checked")?n.val(n.attr("id")):n.val("")})},i.prototype.questionsAnsweredLogic=function(n){this.electricityQuestions.showHideElectricityQuestions(n);this.gasQuestions.showHideGasQuestions(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorEsEnergy||(n.SppServiceSelectorEsEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var r=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideGasQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions),i;t.Gas=r;i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideElectricityQuestions=function(n){n===void 0&&(n=null);this.showHideQuestions();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideQuestions=function(){var o=$("input[name='e_tariff']",this.component),n=this.getAnswerValue(o),t=$("[data-question='e_normal_profile']",this.component),i=$("[data-question='e_normal_consumption']",this.component),r=$("[data-question='e_dual_profile']",this.component),u=$("[data-question='e_dual_peak_cons']",this.component),f=$("[data-question='e_dual_offpeak_cons']",this.component),e=$("#step2container",this.component);n==="normal"?(this.showQuestion(t),this.showQuestion(i),this.hideQuestion(r),this.hideQuestion(u),this.hideQuestion(f)):(this.hideQuestion(t),this.hideQuestion(i),this.showQuestion(r),this.showQuestion(u),this.showQuestion(f));n?e.show():e.hide()},t}(n.SppServiceSelectorBase.BaseQuestions);t.Electricity=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorEsEnergy||(n.SppServiceSelectorEsEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(t){function r(n){t.call(this,n,this);this.electicity=new i.QuestionSections.Electricity(this.component);this.gas=new i.QuestionSections.Gas(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,t),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.electicity.showHideElectricityQuestions(n);this.gas.showHideGasQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){this.requiredServiceValidationBox.hide();var n=this.form.find("[data-selector='summary-questions']").not(":disabled");return n.length===0?(this.requiredServiceValidationBox.show(),!1):this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.ServiceSelector.TypeScript.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=t}})},r}(t.SppServiceSelectorBase.SppBaseSummary);i.SppEnergyEsSummary=r})(i=t.SppServiceSelectorEsEnergy||(t.SppServiceSelectorEsEnergy={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"location";case"location":return"serviceselection";case"serviceselection":if($("#fp_include",this.element).prop("checked"))return"fixphone";if($("#fi_include",this.element).prop("checked"))return"fixinternet";if($("#tv_include",this.element).prop("checked"))return"television";if($("#mp_include",this.element).prop("checked"))return"mobilephone";if($("#mi_include",this.element).prop("checked"))return"mobileinternet";case"fixphone":return $("#fi_include",this.element).prop("checked")?"fixinternet":$("#tv_include",this.element).prop("checked")?"television":$("#mp_include",this.element).prop("checked")?"mobilephone":$("#mi_include",this.element).prop("checked")?"mobileinternet":this.isAscrQuestionEnabled()?"saveprofile":null;case"fixinternet":return $("#tv_include",this.element).prop("checked")?"television":$("#mp_include",this.element).prop("checked")?"mobilephone":$("#mi_include",this.element).prop("checked")?"mobileinternet":this.isAscrQuestionEnabled()?"saveprofile":null;case"television":return $("#mp_include",this.element).prop("checked")?"mobilephone":$("#mi_include",this.element).prop("checked")?"mobileinternet":this.isAscrQuestionEnabled()?"saveprofile":null;case"mobilephone":return $("#mi_include",this.element).prop("checked")?"mobileinternet":this.isAscrQuestionEnabled()?"saveprofile":null;case"mobileinternet":return this.isAscrQuestionEnabled()?"saveprofile":null;case"saveprofile":return null;default:return"landingpage"}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorEsTelco||(n.SppServiceSelectorEsTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.telcoQuestions=new t.QuestionSections.TelcoQuestions(this.component)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!1,firstStep:"landingpage",shouldHideAdditionalRegions:!0,stepToHideAdditionalRegions:"location",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("location"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){this.component.on("click","input[name=telco]",function(){var n=$(this);n.is(":checked")?n.val(n.attr("id")):n.val("")})},i.prototype.questionsAnsweredLogic=function(n){this.telcoQuestions.showHideQuestions(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorEsTelco||(n.SppServiceSelectorEsTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideQuestions=function(n){n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions);t.TelcoQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorEsTelco||(n.SppServiceSelectorEsTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(t){function r(n){t.call(this,n,this);this.telcoQuestions=new i.QuestionSections.TelcoQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,t),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.telcoQuestions.showHideQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){this.requiredServiceValidationBox.hide();var n=this.form.find("[data-selector='summary-questions']").not(":disabled");return n.length===0?(this.requiredServiceValidationBox.show(),!1):this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.ServiceSelector.TypeScript.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=t}})},r}(t.SppServiceSelectorBase.SppBaseSummary);i.SppTelcoEsSummary=r})(i=t.SppServiceSelectorEsTelco||(t.SppServiceSelectorEsTelco={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"questionnaire":return null;case"landingpage":return"questionnaire"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorEsSavingAccounts||(n.SppServiceSelectorEsSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.savingAccountsQuestions=new t.QuestionSections.SavingAccountsQuestions(this.component);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("questionnaire"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.savingAccountsQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorEsSavingAccounts||(n.SppServiceSelectorEsSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t);this.savingAccountQuestions=["want_to_invest","duration","type"]}return __extends(t,n),t.prototype.showHideSavingAccountQuestions=function(n){n===void 0&&(n=null);this.showHideQuestions();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideQuestions=function(){},t}(n.SppServiceSelectorBase.BaseQuestions);t.SavingAccountsQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorEsSavingAccounts||(n.SppServiceSelectorEsSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.savingAccountsQuestions=new t.QuestionSections.SavingAccountsQuestions(this.component);this.savingAccountsQuestions.showHideSavingAccountQuestions();this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0,this.savingAccountsQuestions.showHideSavingAccountQuestions(n))},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppSavingAccountsEsSummary=i})(t=n.SppServiceSelectorEsSavingAccounts||(n.SppServiceSelectorEsSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"travelinsurance";case"travelinsurance":return null}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBrTravelInsurance||(n.SppServiceSelectorBrTravelInsurance={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.travelInsuranceQuestions=new t.QuestionSections.TravelInsuranceQuestions(this.component);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("travelinsurance"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.travelInsuranceQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBrTravelInsurance||(n.SppServiceSelectorBrTravelInsurance={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideSerciceSelectionQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions);t.TravelInsuranceQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBrTravelInsurance||(n.SppServiceSelectorBrTravelInsurance={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.travelInsuranceQuestions=new t.QuestionSections.TravelInsuranceQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.travelInsuranceQuestions.showHideSerciceSelectionQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppTravelInsuranceSummary=i})(t=n.SppServiceSelectorBrTravelInsurance||(n.SppServiceSelectorBrTravelInsurance={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"ddd";case"ddd":return null}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBrDdd||(n.SppServiceSelectorBrDdd={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.dddQuestions=new t.QuestionSections.DddQuestions(this.component);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("ddd"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.dddQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBrDdd||(n.SppServiceSelectorBrDdd={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideSerciceSelectionQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions);t.DddQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBrDdd||(n.SppServiceSelectorBrDdd={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.dddQuestions=new t.QuestionSections.DddQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.dddQuestions.showHideSerciceSelectionQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppDddSummary=i})(t=n.SppServiceSelectorBrDdd||(n.SppServiceSelectorBrDdd={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"ddi";case"ddi":return null}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBrDdi||(n.SppServiceSelectorBrDdi={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.ddiQuestions=new t.QuestionSections.DdiQuestions(this.component);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("ddi"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.ddiQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBrDdi||(n.SppServiceSelectorBrDdi={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideSerciceSelectionQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions);t.DdiQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBrDdi||(n.SppServiceSelectorBrDdi={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.ddiQuestions=new t.QuestionSections.DdiQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.ddiQuestions.showHideSerciceSelectionQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppDdiSummary=i})(t=n.SppServiceSelectorBrDdi||(n.SppServiceSelectorBrDdi={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"MobileTariff";case"MobileTariff":return null}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBrMobileTariff||(n.SppServiceSelectorBrMobileTariff={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.MobileTariffQuestions=new t.QuestionSections.MobileTariffQuestions(this.component);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("MobileTariff"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.MobileTariffQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBrMobileTariff||(n.SppServiceSelectorBrMobileTariff={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideSerciceSelectionQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions);t.MobileTariffQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBrMobileTariff||(n.SppServiceSelectorBrMobileTariff={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.MobileTariffQuestions=new t.QuestionSections.MobileTariffQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.MobileTariffQuestions.showHideSerciceSelectionQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppMobileTariffSummary=i})(t=n.SppServiceSelectorBrMobileTariff||(n.SppServiceSelectorBrMobileTariff={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"PayTv";case"PayTv":return null}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorBrPayTv||(n.SppServiceSelectorBrPayTv={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.PayTvQuestions=new t.QuestionSections.PayTvQuestions(this.component);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("PayTv"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.PayTvQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorBrPayTv||(n.SppServiceSelectorBrPayTv={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideSerciceSelectionQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions);t.PayTvQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorBrPayTv||(n.SppServiceSelectorBrPayTv={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.PayTvQuestions=new t.QuestionSections.PayTvQuestions(this.component);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.PayTvQuestions.showHideSerciceSelectionQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppPayTvSummary=i})(t=n.SppServiceSelectorBrPayTv||(n.SppServiceSelectorBrPayTv={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(t,i){n.call(this,t,i,this);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("questionnaire"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppSSFItHHLiabilityInsur||(n.SppSSFItHHLiabilityInsur={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"questionnaire":return null;case"landingpage":return"questionnaire"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppSSFItHHLiabilityInsur||(n.SppSSFItHHLiabilityInsur={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(n){t.call(this,n,this);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,t),i.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0)},i.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},i.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},i.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},i}(n.SppServiceSelectorBase.SppBaseSummary);t.SppHHLiabilityInsurItSummary=i})(t=n.SppSSFItHHLiabilityInsur||(n.SppSSFItHHLiabilityInsur={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"questionnaire":return null;case"landingpage":return"questionnaire"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorPtSavingAccounts||(n.SppServiceSelectorPtSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.savingAccountsQuestions=new t.QuestionSections.SavingAccountsQuestions(this.component);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("questionnaire"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.savingAccountsQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorPtSavingAccounts||(n.SppServiceSelectorPtSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t);this.savingAccountQuestions=["sa_initial_investment","sa_additional_monthly","sa_monthly_investment","sa_investment_timeframe","sa_retired_person"]}return __extends(t,n),t.prototype.showHideSavingAccountQuestions=function(n){n===void 0&&(n=null);this.showHideQuestions();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideQuestions=function(){},t}(n.SppServiceSelectorBase.BaseQuestions);t.SavingAccountsQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorPtSavingAccounts||(n.SppServiceSelectorPtSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n){i.call(this,n,this);this.savingAccountsQuestions=new t.QuestionSections.SavingAccountsQuestions(this.component);this.savingAccountsQuestions.showHideSavingAccountQuestions();this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(r,i),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0,this.savingAccountsQuestions.showHideSavingAccountQuestions(n))},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.WaitPanel.increment();location.href=t}})},r}(n.SppServiceSelectorBase.SppBaseSummary);t.SppSavingAccountsPtSummary=i})(t=n.SppServiceSelectorPtSavingAccounts||(n.SppServiceSelectorPtSavingAccounts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"insuranceSection";case"insuranceSection":return $("input[name=ci_driver_insurance_type]:checked",this.element).val()==="first insurance"?"vehicleSection":"currentInsuranceSection";case"currentInsuranceSection":return"vehicleSection";case"vehicleSection":return"driverSection";case"driverSection":return this.isAscrQuestionEnabled()?"saveprofile":null;case"saveprofile":return null;default:return"insuranceSection"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorPtCarInsuranceBroker||(n.SppServiceSelectorPtCarInsuranceBroker={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var r=History,i=function(n){function i(i,r){n.call(this,i,r,this);this.carInsuranceBrokerQuestions=new t.QuestionSections.CarInsuranceBrokerQuestions(this.component);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",onStepLoaded:"steploaded",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("insuranceSection"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){this.component.off("change","select[name=ci_vehicle_category]").on("change","select[name=ci_vehicle_category]",t.CarECHelper.updateBrands);this.component.off("change","select[name=ci_vehicle_brand]").on("change","select[name=ci_vehicle_brand]",t.CarECHelper.updateModels);this.component.off("change","select[name=ci_vehicle_model]").on("change","select[name=ci_vehicle_model]",t.CarECHelper.updateVersions)},i.prototype.questionsAnsweredLogic=function(){this.carInsuranceBrokerQuestions.showHideServiceSelectionQuestions()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorPtCarInsuranceBroker||(n.SppServiceSelectorPtCarInsuranceBroker={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideServiceSelectionQuestions=function(n){n===void 0&&(n=null);this.showHideQuestions();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideQuestions=function(){var s=$("input[name='ci_vehicle_insurance_coverage']",this.component),h=this.getAnswerValue(s),n=$("[data-question='ci_vehicle_displacement']",this.component),t=$("[data-question='ci_vehicle_brand']",this.component),i=$("[data-question='ci_vehicle_model']",this.component),r=$("[data-question='ci_vehicle_version']",this.component),u=$("[data-question='ci_vehicle_extras_value']",this.component),f=$("[data-question='ci_vehicle_garage']",this.component),e=$("[data-question='ci_vehicle_has_alarm']",this.component),o=$("[data-question='ci_vehicle_trailer']",this.component);h==="CivilResponsability"?(this.showQuestion(n),this.hideQuestion(t),this.hideQuestion(i),this.hideQuestion(r),this.hideQuestion(u),this.hideQuestion(f),this.hideQuestion(e),this.hideQuestion(o)):(this.hideQuestion(n),this.showQuestion(t),this.showQuestion(i),this.showQuestion(r),this.showQuestion(u),this.showQuestion(f),this.showQuestion(e),this.showQuestion(o))},t}(n.SppServiceSelectorBase.BaseQuestions);t.CarInsuranceBrokerQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorPtCarInsuranceBroker||(n.SppServiceSelectorPtCarInsuranceBroker={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(t){function r(n){t.call(this,n,this);this.carInsuranceBrokerQuestions=new i.QuestionSections.CarInsuranceBrokerQuestions(this.component);this.carInsuranceBrokerQuestions.showHideServiceSelectionQuestions(null);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});i.CarECHelper.updateBrands();this.component.off("change","select[name=ci_vehicle_category]").on("change","select[name=ci_vehicle_category]",i.CarECHelper.updateBrands);this.component.off("change","select[name=ci_vehicle_brand]").on("change","select[name=ci_vehicle_brand]",i.CarECHelper.updateModels);this.component.off("change","select[name=ci_vehicle_model]").on("change","select[name=ci_vehicle_model]",i.CarECHelper.updateVersions);this.showHideSteps()}return __extends(r,t),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);this.showHideSteps();n!=null&&(this.dirtyBit=!0,this.carInsuranceBrokerQuestions.showHideServiceSelectionQuestions(n))},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.ServiceSelector.TypeScript.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=t}})},r.prototype.showHideSteps=function(){this.form.find("input[name=ci_driver_insurance_type]:checked").val()==="transfer"?this.form.find(".s_currentInsuranceSection").show():this.form.find(".s_currentInsuranceSection").hide()},r}(t.SppServiceSelectorBase.SppBaseSummary);i.SppCarInsuranceBrokerPtSummary=r})(i=t.SppServiceSelectorPtCarInsuranceBroker||(t.SppServiceSelectorPtCarInsuranceBroker={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){var t;(function(n){function t(){var n=$("select[name=ci_vehicle_category]").children("option:selected").val()===""?null:$("select[name=ci_vehicle_category]").children("option:selected").val();$.getJSON("/SmartPhonePortalAPI/CarProviderPtCarInsuranceBroker/GetCarBrands",{categoryId:n},function(n){var t="<option value=''>"+$("#SelectOption").html()+"<\/option>",i=$("select[name=ci_vehicle_brand]").data("previousanswer");$.each(n,function(r){t+="<option value='"+n[r].BrandId+"' "+(i==n[r].BrandId?"selected":"")+">"+n[r].BrandName+"<\/option>"});$("select[name=ci_vehicle_brand]").html(t);$("select[name=ci_vehicle_brand]").data("previousanswer","");$("select[name=ci_vehicle_brand]").trigger("change")})}function i(){var n=$("select[name=ci_vehicle_brand]").children("option:selected").val()===""?null:$("select[name=ci_vehicle_brand]").children("option:selected").val();n?(console.log("Updating models for brand "+n),$.getJSON("/SmartPhonePortalAPI/CarProviderPtCarInsuranceBroker/GetCarModels",{brandId:n},function(n){var t="<option value=''>"+$("#SelectOption").html()+"<\/option>",i=$("select[name=ci_vehicle_model]").data("previousanswer");$.each(n,function(r){t+="<option value='"+n[r].ModelId+"' "+(i==n[r].ModelId?"selected":"")+">"+n[r].ModelName+"<\/option>"});$("select[name=ci_vehicle_model]").html(t);$("select[name=ci_vehicle_model]").data("previousanswer","");$("select[name=ci_vehicle_model]").trigger("change")})):(console.log("Clearing models and versions"),$("select[name=ci_vehicle_model]").html("<option selected=selected value=''>"+$("#SelectBrandFirst").html()+"<\/option>"),$("select[name=ci_vehicle_model]").trigger("change"),$("select[name=ci_vehicle_version]").html("<option selected=selected value=''>"+$("#SelectBrandFirst").html()+"<\/option>"),$("select[name=ci_vehicle_version]").trigger("change"))}function r(){var n=$("select[name=ci_vehicle_model]").children("option:selected").val()===""?null:$("select[name=ci_vehicle_model]").children("option:selected").val();n?($.getJSON("/SmartPhonePortalAPI/CarProviderPtCarInsuranceBroker/GetCarVersions",{modelId:n},function(n){var t="<option value=''>"+$("#SelectOption").html()+"<\/option>",i=$("select[name=ci_vehicle_version]").data("previousanswer");$.each(n,function(r){t+="<option value='"+n[r].VersionId+"' "+(i==n[r].VersionId?"selected":"")+">"+n[r].VersionName+"<\/option>"});$("select[name=ci_vehicle_version]").html(t);$("select[name=ci_vehicle_version]").data("previousanswer","");$("select[name=ci_vehicle_version]").trigger("change")}),console.log("Updating versions for model "+n)):(console.log("Clearing versions"),$("select[name=ci_vehicle_version]").html("<option selected=selected value=''>"+$("#SelectModelFirst").html()+"<\/option>"),$("select[name=ci_vehicle_version]").trigger("change"))}n.updateBrands=t;n.updateModels=i;n.updateVersions=r})(t=n.CarECHelper||(n.CarECHelper={}))})(t=n.SppServiceSelectorPtCarInsuranceBroker||(n.SppServiceSelectorPtCarInsuranceBroker={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(t){function r(n,i){t.call(this,n);this.loadingElement="<div class='loading_prices'><div class='waiting' style='position:relative;height:35px'><\/div><p style='text-align:center'>"+$("#loadingPricesTranslation").val()+"<\/p><a href='#FinishAlertPopup' class='js-popup info-link--after js-finish-alert-link'  style='text-align:center;margin-bottom: 8px; display:none;'>"+$("#FinishAlertLinkTranslation").val()+"<\/a><\/div>";this.priceTemplate='<del class="listing__item__price__value--old">{{OriginalPrice}}<\/del><div class="listing__item__price__value--large" style="white- space: nowrap; ">{{Price}}<small class="listing__item__price__period">'+$("#PriceTimeRangeTextTranslation").val()+"<\/small><\/div>";this.savingsTemplate='<p class="listing__item__interest" data-selector="saving-feature">'+$("#SavingsAmountTranslation").val()+' <span class="listing__item__price__value--small" > {{SavingsAmount}} <\/span><\/p>';this.elapsedTimeInMs=0;this.options=$.extend({controllerName:"",actionName:"GetUpdatedQuotes",initialRefreshRateInSeconds:30,refreshRateFactor:1.2,maxMinutesRefreshing:1,popupFinishAlertSubscriptionInitSeconds:30,itemWithoutPriceSelector:".price__pannel[data-hasprice='false']",requestIdSelector:"#ServiceSelectorRequestId",subscribeFinishAlertFormSelector:"[data-selector='finish-alert-form']",subscribeFinishAlertCloseSelector:"[data-selector='finish-alert-close']",subscribeFinishAlertConfirmationSelector:"[data-selector='finish-alert-confirmation']"},i);this.initialize()}return __extends(r,t),r.prototype.initialize=function(){var n=this;this.component=$("div[data-type='"+this.options.controllerName+"Controller'][data-rendering='ListerResults'] , div[data-type='"+this.options.controllerName+"Controller'][data-rendering='DetailHeader'] , div[data-type='"+this.options.controllerName+"Controller'][data-rendering='Compare']");i.replaceState({bymail:!0},document.title,window.location.href.split("?")[0]);this.currentRefreshRateInMs=this.options.initialRefreshRateInSeconds*1e3;this.showLoader();this.bindEvents();setTimeout(function(){n.timedRefreshes()},this.currentRefreshRateInMs);this.timedFinishAlertPopup()},r.prototype.showLoader=function(){if($(this.options.itemWithoutPriceSelector,this.component).children(".loading_prices").length<=0){$(this.options.itemWithoutPriceSelector,this.component).prepend(this.loadingElement);$(".hidden_on_realtime_quotes",this.component).hide();var t=n.SessionStore.getFromSession("FinishAlertSubscriptions");(t==null||$.inArray(this.getRequestId(),t)<0)&&$(".js-finish-alert-link",this.component).show()}},r.prototype.timedRefreshes=function(){var t=this;n.Debug.logToConsole("Refreshing "+this.elapsedTimeInMs/1e3+"s of "+this.options.maxMinutesRefreshing*60+"s @ "+this.currentRefreshRateInMs/1e3+"s");this.updatePrices();this.elapsedTimeInMs<this.options.maxMinutesRefreshing*6e4&&$(this.options.itemWithoutPriceSelector,this.component).length>0&&(setTimeout(function(){t.timedRefreshes()},this.currentRefreshRateInMs),this.elapsedTimeInMs+=this.currentRefreshRateInMs,this.currentRefreshRateInMs*=this.options.refreshRateFactor)},r.prototype.timedFinishAlertPopup=function(){var t=this;setTimeout(function(){var i=n.SessionStore.getFromSession("FinishAlertSubscriptions"),r=n.SessionStore.getFromSession("FinishAlertSubscriptionsClosed");(i==null||$.inArray(t.getRequestId(),i)<0)&&(r==null||$.inArray(t.getRequestId(),r)<0)&&$(t.options.itemWithoutPriceSelector,t.component).length>0&&(n.Debug.logToConsole("Showing popup after "+t.options.popupFinishAlertSubscriptionInitSeconds+"s"),$("<a/>").addClass("js-popup").attr("href","#FinishAlertPopup").modal().click())},this.options.popupFinishAlertSubscriptionInitSeconds*1e3)},r.prototype.updatePrices=function(){var t=$("meta[name='scID']").attr("content"),i="/SmartPhonePortalApi/"+this.options.controllerName+"/"+this.options.actionName+"/"+t+"?requestId="+this.getRequestId(),n=this;$.ajax({url:i}).done(function(t){var i,r;if(t.Quotes!=null){for(i=0;i<t.Quotes.length;i++)r=$(n.options.itemWithoutPriceSelector+"[data-serviceoffer='"+t.Quotes[i].ServiceOfferId+"']",n.component),r.attr("data-hasprice","true"),r.children(".loading_prices").remove(),r.prepend(Mustache.render(n.priceTemplate,t.Quotes[i])+(t.Quotes[i].SavingsAmount.length>0?Mustache.render(n.savingsTemplate,t.Quotes[i]):""));$(".js-popup").modal()}}).fail(function(){})},r.prototype.getRequestId=function(){return $(this.options.requestIdSelector).val()},r.prototype.bindEvents=function(){var n=this;$(document).ajaxSuccess(function(t,i,r){r.url.indexOf(n.options.actionName)<0&&n.showLoader()});$(this.options.subscribeFinishAlertFormSelector).off("submit").on("submit","form",$.proxy(this.subscribeToFinishAlert,this));$(this.options.subscribeFinishAlertCloseSelector).off("click").on("click",$.proxy(this.toggleFinishAlertForm,this))},r.prototype.toggleFinishAlertForm=function(){var i=$("form",this.options.subscribeFinishAlertFormSelector),t,r;i.is(":hidden")&&(i[0].reset(),i.show(),$(this.options.subscribeFinishAlertConfirmationSelector).hide());t=n.SessionStore.getFromSession("FinishAlertSubscriptionsClosed");t==null&&(t=[]);t.push(this.getRequestId());n.SessionStore.storeInSession("FinishAlertSubscriptionsClosed",t);r=n.SessionStore.getFromSession("FinishAlertSubscriptionsClosed");n.Debug.logToConsole("Added to Closed -> "+JSON.stringify(r))},r.prototype.subscribeToFinishAlert=function(t){var u,i,r;(t.preventDefault(),u=t.currentTarget,i=$(t.currentTarget),i.data("ssfvalidator")||i.ssfvalidator({autoRevalidate:!0,showValidationMessages:!0}),i.ssfvalidator("validate"))&&(r=this,n.Ajax.submitFormAndGetData(u,{onSuccess:function(){$(i).hide().parent().find(r.options.subscribeFinishAlertConfirmationSelector).show();i.ssfvalidator("destroy");var t=n.SessionStore.getFromSession("FinishAlertSubscriptions");t==null&&(t=[]);t.push(r.getRequestId());n.SessionStore.storeInSession("FinishAlertSubscriptions",t);$(".js-finish-alert-link",r.component).hide()},useWaitPanel:!0}))},r}(n.BaseComponent);t.RealTimeQuotesHandler=r})(t=n.SppServiceSelectorBase||(n.SppServiceSelectorBase={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"profile";case"profile":return null;default:return"profile"}},t}(n.ServiceSelector.TypeScript.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(i=t.SsfPtCarInsuranceProfiler||(t.SsfPtCarInsuranceProfiler={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.savingAccountsQuestions=new t.QuestionSections.SsfPtCarInsuranceProfilerQuestions(this.component);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!1,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:null,contractsFeatureEnabled:this.options.contractsFeatureEnabled,ascrFeatureEnabled:this.options.ascrFeatureEnabled,userIsLoggedIn:this.options.userIsLoggedIn});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("profile"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(n){this.savingAccountsQuestions.showHideServiceSelectionQuestions(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SsfPtCarInsuranceProfiler||(n.SsfPtCarInsuranceProfiler={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideServiceSelectionQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions);t.SsfPtCarInsuranceProfilerQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SsfPtCarInsuranceProfiler||(n.SsfPtCarInsuranceProfiler={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(t){function r(n){t.call(this,n,this);this.ssfPtCarInsuranceProfilerQuestions=new i.QuestionSections.SsfPtCarInsuranceProfilerQuestions(this.component);this.ssfPtCarInsuranceProfilerQuestions.showHideServiceSelectionQuestions(null);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(r,t),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0,this.ssfPtCarInsuranceProfilerQuestions.showHideServiceSelectionQuestions(n))},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.ServiceSelector.TypeScript.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=t}})},r}(t.SppServiceSelectorBase.SppBaseSummary);i.SsfPtCarInsuranceProfilerSummary=r})(i=t.SsfPtCarInsuranceProfiler||(t.SsfPtCarInsuranceProfiler={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"questionnaire":return"account";case"account":return null;default:return"account"}return null},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorPtCondominiumSavingsAccount||(n.SppServiceSelectorPtCondominiumSavingsAccount={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.condominiumSavingsAccountQuestions=new t.QuestionSections.CondominiumSavingsAccountQuestions(this.component);$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",onStepLoaded:"steploaded",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("account"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){},i.prototype.questionsAnsweredLogic=function(){this.condominiumSavingsAccountQuestions.showOrHideArrowBoxForAllQuestion()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorPtCondominiumSavingsAccount||(n.SppServiceSelectorPtCondominiumSavingsAccount={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideSerciceSelectionQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t}(n.SppServiceSelectorBase.BaseQuestions);t.CondominiumSavingsAccountQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorPtCondominiumSavingsAccount||(n.SppServiceSelectorPtCondominiumSavingsAccount={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(t){function r(n){t.call(this,n,this);this.condominiumSavingsAccountQuestions=new i.QuestionSections.CondominiumSavingsAccountQuestions(this.component);this.condominiumSavingsAccountQuestions.showHideSerciceSelectionQuestions(null);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(r,t),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0,this.condominiumSavingsAccountQuestions.showHideSerciceSelectionQuestions(n))},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){return this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.ServiceSelector.TypeScript.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=t}})},r}(t.SppServiceSelectorBase.SppBaseSummary);i.SppCondominiumSavingsAccountPtSummary=r})(i=t.SppServiceSelectorPtCondominiumSavingsAccount||(t.SppServiceSelectorPtCondominiumSavingsAccount={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(n){function t(t,i){n.call(this,t,i,this)}return __extends(t,n),t.prototype.getNextStepLogic=function(){var n=i.getState();switch(n.data.step){case"landingpage":return"location";case"location":return"serviceselection";case"serviceselection":return $("#com_ele_include",this.element).prop("checked")?"electricity":"gas";case"electricity":return $("#com_gas_include",this.element).prop("checked")?"gas":"reductions";case"gas":return"reductions";case"reductions":return null;default:return"landingpage"}},t}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SppServiceSelectorPtEnergy||(n.SppServiceSelectorPtEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.serviceSelectionQuestions=new t.QuestionSections.ServiceSelection(this.component,!1)}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!1,firstStep:"landingpage",shouldHideAdditionalRegions:!0,stepToHideAdditionalRegions:"landingpage",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("location"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){this.component.on("click","input[name=energy]",function(){var n=$(this);n.is(":checked")?n.val(n.attr("id")):n.val("")})},i.prototype.questionsAnsweredLogic=function(n){this.serviceSelectionQuestions.showHideSerciceSelectionQuestions(n)},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SppServiceSelectorPtEnergy||(n.SppServiceSelectorPtEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t,i){n.call(this,t);this.includeGas="com_gas_include";this.includeElec="com_ele_include";this.sameEnergyProvider="com_same_energy_provider";this.eleProvider="com_ele_provider";this.eleExpense="com_ele_expense";this.gasProvider="com_gas_provider";this.gasExpense="com_gas_expense";this.energyProvider="com_energy_provider";this.energyExpense="com_energy_expense";this.energyMeterPersonalized="ele_meter_power_specific";this.energyMeter="ele_meter_power";this.combinedServiceNoteElec="[data-selector='combinedServiceNoteOnlyElectricity']";this.combinedServiceNoteGas="[data-selector='combinedServiceNoteOnlyGas']";this.disableGas=i;this.gasFieldset=$("#modify-gas-section",this.component).children("fieldset");this.elecFieldset=$("#modify-electricity-section",this.component).children("fieldset")}return __extends(t,n),t.prototype.showHideSerciceSelectionQuestions=function(n){n===void 0&&(n=null);n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion();this.showHideQuestions()},t.prototype.showHideQuestionsForQuestionnaire=function(){var s=$("input[name='"+this.sameEnergyProvider+"']:checked",this.component),h=this.component.find("[data-question='"+this.sameEnergyProvider+"']"),i=this.component.find("[data-question='"+this.eleProvider+"']"),r=this.component.find("[data-question='"+this.eleExpense+"']"),u=this.component.find("[data-question='"+this.gasProvider+"']"),f=this.component.find("[data-question='"+this.gasExpense+"']"),e=this.component.find("[data-question='"+this.energyProvider+"']"),o=this.component.find("[data-question='"+this.energyExpense+"']"),c=this.component.find("[data-question='"+this.energyMeterPersonalized+"']"),l=$("input[id='"+this.includeGas+"']",this.component),a=$("select[id='"+this.energyMeter+"']",this.component),n=$(this.combinedServiceNoteElec,this.component),t=$(this.combinedServiceNoteGas,this.component);l.is(":disabled")||this.disableGas?(this.hideQuestion(u),this.hideQuestion(f),this.showQuestion(i),this.showQuestion(r),this.hideQuestion(e),this.hideQuestion(o),this.hideQuestion(h),n.hide(),t.hide()):s.val()&&s.val().toLowerCase()==="yes"?(this.hideQuestion(u),this.hideQuestion(f),this.hideQuestion(i),this.hideQuestion(r),this.showQuestion(e),this.showQuestion(o),this.gasIsIncluded()&&!this.elecIsIncluded()?(n.hide(),t.show()):this.elecIsIncluded()&&!this.gasIsIncluded()?(n.show(),t.hide()):(n.hide(),t.hide())):(this.gasIsIncluded()?(this.showQuestion(u),this.showQuestion(f)):(this.hideQuestion(u),this.hideQuestion(f)),this.elecIsIncluded()?(this.showQuestion(i),this.showQuestion(r)):(this.hideQuestion(i),this.hideQuestion(r)),this.hideQuestion(e),this.hideQuestion(o),this.showQuestion(h),n.hide(),t.hide());a.val()==="other"?this.showQuestion(c):this.hideQuestion(c)},t.prototype.gasIsIncluded=function(){var n=$("input[id='"+this.includeGas+"']",this.component);return n.is(":checked")||this.gasFieldset.length!==0&&!this.gasFieldset.is(":disabled")},t.prototype.elecIsIncluded=function(){var n=$("input[id='"+this.includeElec+"']",this.component);return n.is(":checked")||this.elecFieldset.length!==0&&!this.elecFieldset.is(":disabled")},t.prototype.showHideQuestions=function(){this.showHideQuestionsForQuestionnaire()},t}(n.SppServiceSelectorBase.BaseQuestions);t.ServiceSelection=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SppServiceSelectorPtEnergy||(n.SppServiceSelectorPtEnergy={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(t){function r(n,r){t.call(this,n,this);this.serviceSelection=new i.QuestionSections.ServiceSelection(this.component,r);this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null)}return __extends(r,t),r.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.serviceSelection.showHideSerciceSelectionQuestions(n)},r.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},r.prototype.doValidate=function(){this.requiredServiceValidationBox.hide();var n=this.form.find("[data-selector='summary-questions']").not(":disabled");return n.length===0?(this.requiredServiceValidationBox.show(),!1):this.form.ssfvalidator("validate")},r.prototype.doSubmit=function(t){n.ServiceSelector.TypeScript.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=t}})},r}(t.SppServiceSelectorBase.SppBaseSummary);i.SppEnergyPtSummary=r})(i=t.SppServiceSelectorPtEnergy||(t.SppServiceSelectorPtEnergy={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=History,r=function(r){function u(n,t){r.call(this,n,t,this)}return __extends(u,r),u.prototype.getNextStepLogic=function(){var r=i.getState();switch(r.data.step){case"landingpage":return"serviceselection";case"serviceselection":return $("#tel_include_fixedinternet",this.element).prop("checked")?(n.Debug.logToConsole("Next step: internet"),"internet"):this.hasService(t.QuestionSections.TelcoQuestions.incTelevision)?(n.Debug.logToConsole("Next step: television"),"television"):this.hasService(t.QuestionSections.TelcoQuestions.incPhone)?(n.Debug.logToConsole("Next step: telephone"),"telephone"):this.hasService(t.QuestionSections.TelcoQuestions.incMobile)?(n.Debug.logToConsole("Next step: mobile"),"mobile"):this.hasService(t.QuestionSections.TelcoQuestions.incMobileNet)?(n.Debug.logToConsole("Next step: mobileinternet"),"mobileinternet"):this.isAscrQuestionEnabled()?(n.Debug.logToConsole("Next step: saveprofile"),"saveprofile"):null;case"internet":return this.hasService(t.QuestionSections.TelcoQuestions.incTelevision)?(n.Debug.logToConsole("Next step: television"),"television"):this.hasService(t.QuestionSections.TelcoQuestions.incPhone)?(n.Debug.logToConsole("Next step: telephone"),"telephone"):this.hasService(t.QuestionSections.TelcoQuestions.incMobile)?(n.Debug.logToConsole("Next step: mobile"),"mobile"):this.hasService(t.QuestionSections.TelcoQuestions.incMobileNet)?(n.Debug.logToConsole("Next step: mobileinternet"),"mobileinternet"):this.isAscrQuestionEnabled()?(n.Debug.logToConsole("Next step: saveprofile"),"saveprofile"):null;case"television":return this.hasService(t.QuestionSections.TelcoQuestions.incPhone)?(n.Debug.logToConsole("Next step: telephone"),"telephone"):this.hasService(t.QuestionSections.TelcoQuestions.incMobile)?(n.Debug.logToConsole("Next step: mobile"),"mobile"):this.hasService(t.QuestionSections.TelcoQuestions.incMobileNet)?(n.Debug.logToConsole("Next step: mobileinternet"),"mobileinternet"):this.isAscrQuestionEnabled()?(n.Debug.logToConsole("Next step: saveprofile"),"saveprofile"):null;case"telephone":return this.hasService(t.QuestionSections.TelcoQuestions.incMobile)?(n.Debug.logToConsole("Next step: mobile"),"mobile"):this.hasService(t.QuestionSections.TelcoQuestions.incMobileNet)?(n.Debug.logToConsole("Next step: mobileinternet"),"mobileinternet"):this.isAscrQuestionEnabled()?(n.Debug.logToConsole("Next step: saveprofile"),"saveprofile"):null;case"mobile":return this.hasService(t.QuestionSections.TelcoQuestions.incMobileNet)?(n.Debug.logToConsole("Next step: mobileinternet"),"mobileinternet"):this.isAscrQuestionEnabled()?(n.Debug.logToConsole("Next step: saveprofile"),"saveprofile"):null;case"mobileinternet":return this.isAscrQuestionEnabled()?(n.Debug.logToConsole("Next step: saveprofile"),"saveprofile"):null;case"saveprofile":return null;default:return"serviceselection"}},u.prototype.hasService=function(n){return this.getQuestion(n).is(":checked")},u.prototype.getQuestion=function(n){return $("#"+n,this.element)},u}(n.SppServiceSelectorBase.BaseNavigator);t.Navigator=r})(t=n.SsfPtTelco||(n.SsfPtTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(n){function i(i,r){n.call(this,i,r,this);this.telcoQuestions=new t.QuestionSections.TelcoQuestions(this.component);this.telcoQuestions.showHideServiceSelectionQuestions();$("form",this.component).ssfvalidator({showValidationMessages:!0})}return __extends(i,n),i.prototype.initializeNavigator=function(){this.navigator=new t.Navigator(this.component,{onBeforeShowResults:jQuery.noop,resultUrl:this.options.resultUrl,labelResultUrl:this.options.labelResultUrl,showFieldValidation:!0,firstStep:"landingpage",shouldHideAdditionalRegions:!1,stepToHideAdditionalRegions:"",contractsFeatureEnabled:!1,ascrFeatureEnabled:!1,userIsLoggedIn:!1});location.search.indexOf("skiplanding")>=0?this.navigator.goToStep("serviceselection"):this.navigator.loadStepFromState(null)},i.prototype.bindExtraEvents=function(){var n=this;this.component.off("click",".js-addConsumption").on("click",".js-addConsumption",function(){var i=$(this),t=i.data("card");$(".consumptionBlock[data-card='"+t+"'].compHide",n.component).first().show().removeClass("compHide").addClass("compVisible");$(".js-removeConsumption[data-card='"+t+"']",n.component).show();$(".consumptionBlock[data-card='"+t+"'].compHide",n.component).length===0&&$(".js-addConsumption[data-card='"+t+"']",n.component).hide()});this.component.off("click",".js-removeConsumption").on("click",".js-removeConsumption",function(){for(var r=$(this),t=r.data("card"),u=+r.data("consumption"),f=$(".consumptionBlock[data-card='"+t+"']",n.component).length,i=u;i<=f;i++)$("select[name='tel_card"+t+"_operator"+i+"']",n.component).val($(".compVisible select[name='tel_card"+t+"_operator"+(i+1)+"']",n.component).val()),$("input[name='tel_card"+t+"_min"+i+".Value']",n.component).val($(".compVisible input[name='tel_card"+t+"_min"+(i+1)+".Value']",n.component).val()),$("input[name='tel_card"+t+"_sms"+i+".Value']",n.component).val($(".compVisible input[name='tel_card"+t+"_sms"+(i+1)+".Value']",n.component).val());$(".consumptionBlock[data-card='"+t+"'].compVisible",n.component).last().hide().removeClass("compVisible").addClass("compHide");$(".js-addConsumption[data-card='"+t+"']",n.component).show();$(".consumptionBlock[data-card='"+t+"'].compVisible",n.component).length<=1&&$(".js-removeConsumption[data-card='"+t+"']",n.component).hide()});this.component.off("click",".js-addContract").on("click",".js-addContract",function(){var t=$(this);$(".contractBlock.contHide",n.component).first().show().removeClass("contHide").addClass("contVisible");$(".js-removeContract",n.component).show();$(".contractBlock.contHide",n.component).length===0&&$(".js-addContract",n.component).hide()});this.component.off("click",".js-removeContract").on("click",".js-removeContract",function(){for(var i=$(this),r=+i.data("contract"),u=$(".contractBlock",n.component).length,t=r;t<=u;t++)$("select[name='tel_provider"+t+"']",n.component).val($(".contVisible select[name='tel_provider"+(t+1)+"']",n.component).val()),$("select[name='tel_provider"+t+"']",n.component).change(),$("select[name='tel_provider"+t+"_service']",n.component).val($(".contVisible select[name='tel_provider"+(t+1)+"_service']",n.component).val()),$("select[name='tel_provider"+t+"_service']",n.component).change(),$("select[name='tel_provider"+t+"_technology']",n.component).val($(".contVisible select[name='tel_provider"+(t+1)+"_technology']",n.component).val()),$("select[name='tel_provider"+t+"_technology']",n.component).change();$(".contractBlock.contVisible",n.component).last().hide().removeClass("contVisible").addClass("contHide");$(".js-addContract",n.component).show();$(".contractBlock.contVisible",n.component).length<=1&&$(".js-removeContract",n.component).hide()});this.component.on("click","input[name=telco]",function(){var n=$(this);n.is(":checked")?n.val(n.attr("id")):n.val("")})},i.prototype.questionsAnsweredLogic=function(){this.telcoQuestions.showHideServiceSelectionQuestions()},i}(n.SppServiceSelectorBase.BaseQuestionnaire);t.Questionnaire=i})(t=n.SsfPtTelco||(n.SsfPtTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i;(function(t){var i=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.prototype.showHideServiceSelectionQuestions=function(n){n===void 0&&(n=null);this.showHideQuestions();n!=null?this.showOrHideArrowBoxes(n):this.showOrHideArrowBoxForAllQuestion()},t.prototype.showHideQuestions=function(){var f=$("#"+t.incTelevision,this.component),e=$("#"+t.incNet,this.component),o=$("#"+t.incPhone,this.component),i=$("[data-question='"+t.location+"']",this.component),r=$("[data-question='"+t.currentcontracts+"']",this.component),u,n;this.getAnswerValue(e)||this.getAnswerValue(f)||this.getAnswerValue(o)?(this.showQuestion(i),this.showQuestion(r)):(this.hideQuestion(i),this.hideQuestion(r));u=$("input[name='"+t.extraSim+"']",this.component);n=$("[data-selector='"+t.extraSimBlock+"']",this.component);this.getAnswerValue(u)==="Yes"?this.showQuestion(n):this.hideQuestion(n)},t.incTelevision="tel_include_television",t.incNet="tel_include_fixedinternet",t.incPhone="tel_include_fixedtelephone",t.incMobile="tel_include_mobile",t.incMobileNet="tel_include_mobileinternet",t.location="com_postal_code",t.currentcontracts="tel_currentcontracts",t.extraSim="tel_mobile_extra_sim",t.extraSimBlock="card2Block",t}(n.SppServiceSelectorBase.BaseQuestions);t.TelcoQuestions=i})(i=t.QuestionSections||(t.QuestionSections={}))})(t=n.SsfPtTelco||(n.SsfPtTelco={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(r){function u(n){r.call(this,n,this);this.telcoQuestions=new i.QuestionSections.TelcoQuestions(this.component);this.controllerName=n.controllerName;this.form=$("form",this.component).ssfvalidator({showValidationMessages:!0});this.showHideQuestionsLogic(null);var t=this;this.component.off("click",".js-addConsumption").on("click",".js-addConsumption",function(){var i=$(this),n=i.data("card");$(".consumptionBlock[data-card='"+n+"'].compHide",t.component).first().show().removeClass("compHide").addClass("compVisible");$(".js-removeConsumption[data-card='"+n+"']",t.component).show();$(".consumptionBlock[data-card='"+n+"'].compHide",t.component).length===0&&$(".js-addConsumption[data-card='"+n+"']",t.component).hide()});this.component.off("click",".js-removeConsumption").on("click",".js-removeConsumption",function(){for(var r=$(this),n=r.data("card"),u=+r.data("consumption"),f=$(".consumptionBlock[data-card='"+n+"']",t.component).length,i=u;i<=f;i++)$("select[name='tel_card"+n+"_operator"+i+"']",t.component).val($(".compVisible select[name='tel_card"+n+"_operator"+(i+1)+"']",t.component).val()),$("input[name='tel_card"+n+"_min"+i+".Value']",t.component).val($(".compVisible input[name='tel_card"+n+"_min"+(i+1)+".Value']",t.component).val()),$("input[name='tel_card"+n+"_sms"+i+".Value']",t.component).val($(".compVisible input[name='tel_card"+n+"_sms"+(i+1)+".Value']",t.component).val());$(".consumptionBlock[data-card='"+n+"'].compVisible",t.component).last().hide().removeClass("compVisible").addClass("compHide");$(".js-addConsumption[data-card='"+n+"']",t.component).show();$(".consumptionBlock[data-card='"+n+"'].compVisible",t.component).length<=1&&$(".js-removeConsumption[data-card='"+n+"']",t.component).hide()})}return __extends(u,r),u.prototype.showHideQuestionsLogic=function(n){n===void 0&&(n=null);n!=null&&(this.dirtyBit=!0);this.telcoQuestions.showHideServiceSelectionQuestions(n)},u.prototype.validateAndSumbitForm=function(n){this.doValidate()&&this.doSubmit(n)},u.prototype.doValidate=function(){this.requiredServiceValidationBox.hide();var n=this.form.find("[data-selector='summary-questions']").not(":disabled");return n.length===0?(this.requiredServiceValidationBox.show(),!1):this.form.ssfvalidator("validate")},u.prototype.doSubmit=function(i){for(var e=this,f=$('input[type="checkbox"]:checked'),r,u=0;u<f.length;u++)r=$(f[u]),r.val(r.attr("data-value"));t.Ajax.submitFormAndGetData(this.form[0],{onSuccess:function(){n.ServiceSelector.TypeScript.WaitPanel.increment();location.href=i},onValidationFailed:function(){e.requiredServiceValidationBox.show()}})},u}(t.SppServiceSelectorBase.SppBaseSummary);i.SsfTelcoPtSummary=r})(i=t.SsfPtTelco||(t.SsfPtTelco={}))})(i=t.TypeScript||(t.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i,r){t.call(this,r);this.controllerName=n;this.actionName=i}return __extends(i,t),i.prototype.initialize=function(){this.bindEvents()},i.prototype.bindEvents=function(){var n=this;this.component.find("[data-selector='add-new-contract-button']").on("click",function(){return n.openContractDetailsModal()})},i.prototype.openContractDetailsModal=function(){n.Ajax.sendDataToActionAndUpdate(this.controllerName,this.actionName,null,{},null,{onSuccess:function(){return n.SppHelper.openModal("#contract-details-popup")}})},i}(n.BaseComponent);t.ContractOverview=i})(t=n.SsfContractManagement||(n.SsfContractManagement={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i){t.call(this,n);this.form=this.component.find("[data-selector='contract-details-form']");this.controllerName=i;this.deleteButton=this.component.find("[data-selector='delete-contract-button']");this.deleteConfirmationBox=this.component.find("[data-selector='delete-confirmation-box']")}return __extends(i,t),i.prototype.initialize=function(n){this.bindEvents();n&&this.deleteButton.show();this.setupDataScopeTracker(this)},i.prototype.bindEvents=function(){var n=this;this.component.find("[data-selector='save-contract-button']").on("click",function(){return n.saveContract()});this.component.find("[data-selector='delete-contract-button']").on("click",function(){return n.showDeleteConfirmation()});this.component.find("[data-selector='delete-contract-cancel-button']").on("click",function(){return n.cancelDelete()});this.component.find("[data-selector='delete-contract-confirmation-button']").on("click",function(){return n.deleteContract()})},i.prototype.showDeleteConfirmation=function(){this.deleteButton.hide();this.deleteConfirmationBox.show()},i.prototype.cancelDelete=function(){this.deleteButton.show();this.deleteConfirmationBox.hide()},i.prototype.saveContract=function(){this.form.ssfvalidator("validate")?this.submit():console.log("KO!")},i.prototype.submit=function(){var t=this;n.Ajax.getDataFromAction(this.controllerName,"SaveContract",this.form.find(":input").serialize(),{},null,{useWaitPanel:!0,onSuccess:function(){return t.onSuccessfullySavedContract()},onValidationFailed:function(){return alert("Contract details were invalidated by the backend!")}})},i.prototype.onSuccessfullySavedContract=function(){this.trackChange(!1);this.close();this.refreshContractsList()},i.prototype.close=function(){this.component.find("[data-selector='close-popup']").click()},i.prototype.deleteContract=function(){var t=this;n.Ajax.sendDataToActionAndUpdate(this.controllerName,"DeleteContract",null,{contractId:this.findContractId()},null,{onSuccess:function(){t.refreshContractsList();t.close()}})},i.prototype.findContractId=function(){return this.component.find("[data-selector='contractId']").val()},i.prototype.refreshContractsList=function(){n.Ajax.sendDataToActionAndUpdate(this.controllerName,"Contracts",null,{divToUpdate:"contracts-list"},null,null)},i}(n.BaseComponent);t.ContractDetailsModal=i})(t=n.SsfContractManagement||(n.SsfContractManagement={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i){t.call(this,n);this.form=this.component.find("[data-selector='contract-details-form']");this.controllerName=i;this.deleteButton=this.component.find("[data-selector='delete-contract-button']");this.deleteConfirmationBox=this.component.find("[data-selector='delete-confirmation-box']")}return __extends(i,t),i.prototype.initialize=function(n){this.bindEvents();n&&this.deleteButton.show();this.setupDataScopeTracker(this)},i.prototype.bindEvents=function(){var n=this;this.component.find("[data-selector='save-contract-button']").on("click",function(){return n.saveContract()});this.component.find("[data-selector='delete-contract-button']").on("click",function(){return n.showDeleteConfirmation()});this.component.find("[data-selector='delete-contract-cancel-button']").on("click",function(){return n.cancelDelete()});this.component.find("[data-selector='delete-contract-confirmation-button']").on("click",function(){return n.deleteContract()})},i.prototype.showDeleteConfirmation=function(){this.deleteButton.hide();this.deleteConfirmationBox.show()},i.prototype.cancelDelete=function(){this.deleteButton.show();this.deleteConfirmationBox.hide()},i.prototype.saveContract=function(){this.form.ssfvalidator("validate")?this.submit():console.log("KO!")},i.prototype.submit=function(){var t=this;n.Ajax.getDataFromAction(this.controllerName,"SaveContract",this.form.find(":input").serialize(),{},null,{useWaitPanel:!0,onSuccess:function(){t.trackChange(!1);t.refreshParent()},onValidationFailed:function(){return alert("Contract details were invalidated by the backend!")}})},i.prototype.refreshParent=function(){var t=this.component.parents("[data-service-selector-controller]").data("serviceSelectorController");n.Ajax.sendDataToActionAndUpdate(t,"LoadSummaryModal","",{},null,{})},i.prototype.deleteContract=function(){var t=this;n.Ajax.sendDataToActionAndUpdate(this.controllerName,"DeleteContract",null,{contractId:this.findContractId()},null,{onSuccess:function(){t.refreshParent()}})},i.prototype.findContractId=function(){return this.component.find("[data-selector='contractId']").val()},i}(n.BaseComponent);t.EditContract=i})(t=n.SsfContractManagement||(n.SsfContractManagement={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i){t.call(this,n);this.form=this.component.find("[data-selector='contract-details-form']");this.controllerName=i}return __extends(i,t),i.prototype.initialize=function(){this.bindEvents();this.setupDataScopeTracker(this)},i.prototype.bindEvents=function(){var n=this;this.component.find("[data-selector='save-contract-button']").on("click",function(){return n.addContract()});this.component.find("[data-selector='cancel-contract-button']").on("click",function(){return n.cancelAddContract()})},i.prototype.addContract=function(){this.form.ssfvalidator("validate")?this.submit():console.log("KO!")},i.prototype.submit=function(){var t=this;n.Ajax.getDataFromAction(this.controllerName,"SaveContract",this.form.find(":input").serialize(),{},null,{useWaitPanel:!0,onSuccess:function(){return t.onSuccessfullySavedContract()},onValidationFailed:function(){return alert("Contract details were invalidated by the backend!")}})},i.prototype.onSuccessfullySavedContract=function(){var t=this;this.trackChange(!1);var i=this.findContractHtmlElementsThatCanBeAddedToProfile().filter(":checked").map(function(n,t){return $(t).data("value")}).toArray(),r=this.component.parents("[data-service-selector-controller-name]").data("serviceSelectorControllerName"),u=this.component.parents('[data-selector="related-contracts"]')[0].id;n.Ajax.sendDataToActionAndUpdate(r,"RefreshContractsOfProfile","",{divToUpdate:u},null,{onSuccess:function(){return t.selectContractsIncludingNewlyCreated(i)}})},i.prototype.onCancelContract=function(){var t=this.component.parents("[data-selector='summary-add-profile-box']");n.Ajax.sendDataToActionAndUpdate(this.controllerName,"ResetAddContractToProfile","",{divToUpdate:this.component.parents("[data-selector='add-contract-to-profile-box']")[0].id},null,{onSuccess:function(){return t.slideToggle()}})},i.prototype.findContractHtmlElementsThatCanBeAddedToProfile=function(){return $('[data-selector="unselected-related-contract-id"]')},i.prototype.cancelAddContract=function(){this.onCancelContract()},i.prototype.selectContractsIncludingNewlyCreated=function(n){var t=this,i=this.findContractHtmlElementsThatCanBeAddedToProfile(),r=i.last();i.filter(function(i,r){return t.isAnElementOf(n,r)}).add(r).each(function(n,i){return t.check(i)})},i.prototype.isAnElementOf=function(n,t){var i=$(t).data("value");return n.indexOf(i)!==-1},i.prototype.check=function(n){var t=$(n);t.val("true");t.prop("checked",!0)},i}(n.BaseComponent);t.AddContractToProfile=i})(t=n.SsfContractManagement||(n.SsfContractManagement={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i){t.call(this,n);this.form=this.component.find("[data-selector='contract-details-form']");this.controllerName=i;this.tariffSelection=this.component.find("[data-selector='select-tariff']")}return __extends(i,t),i.prototype.initialize=function(){this.initializeEuroConsumersDropdowns();this.initializeValidation();this.bindEvents();this.setupDataScopeTracker(this)},i.prototype.initializeEuroConsumersDropdowns=function(){this.form.find(".form__field--select").uniform()},i.prototype.initializeValidation=function(){this.form.ssfvalidator({showValidationMessages:!0,showSummary:!1,summarySelector:"[data-selector=validation-summary]"})},i.prototype.bindEvents=function(){var n=this;this.component.find("[data-selector='select-provider']").on("change",function(t){return n.reloadTariffs($(t.target).val())})},i.prototype.reloadTariffs=function(n){n?this.loadTariffs(n):this.clearTariffs()},i.prototype.clearTariffs=function(){this.tariffSelection.children().not("[data-placeholder]").remove();this.tariffSelection.attr("selectedIndex",0);this.tariffSelection.trigger("change")},i.prototype.loadTariffs=function(t){var i=this;n.Ajax.getDataFromAction(this.controllerName,"Tariffs",null,{providerId:t},null,{onSuccess:function(n){return i.renderTariffs(n)}})},i.prototype.renderTariffs=function(n){var t=this;this.clearTariffs();n.forEach(function(n){return t.addTariff(n)})},i.prototype.addTariff=function(n){this.tariffSelection.append($("<option/>").attr("value",n.Id).text(n.Name))},i}(n.BaseComponent);t.ContractDetails=i})(t=n.SsfContractManagement||(n.SsfContractManagement={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i){t.call(this,n);this.controllerName=i}return __extends(i,t),i.prototype.initialize=function(){this.bindEditContractEvents();this.component.find("a.asr__contract__choice").on("click",function(n){n.preventDefault();$(this).toggleClass("asr__contract__choice--checked");$(this).children().first().prop("checked",!$(this).children().first().prop("checked"))})},i.prototype.bindEditContractEvents=function(){var n=this;this.component.find("[data-selector=edit-contract]").on("click",function(t){var i=$(t.currentTarget).data("contract-id").toString();n.openContractDetailsModal(i)});this.component.find("[data-selector=add-new-contract-button]").on("click",function(){return n.openContractDetailsModal()})},i.prototype.openContractDetailsModal=function(t){n.Ajax.sendDataToActionAndUpdate(this.controllerName,"ContractDetails",null,{contractId:t},null,{onSuccess:function(){return n.SppHelper.openModal("#contract-details-popup")}})},i}(n.BaseComponent);t.ContractsList=i})(t=n.SsfContractManagement||(n.SsfContractManagement={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i){this.contractControllername=i;t.call(this,n)}return __extends(i,t),i.prototype.initialize=function(){this.bindEvents()},i.prototype.bindEvents=function(){var n=this;this.component.find('[data-selector="active-contracts-button"]').on("click",function(t){t.preventDefault();n.toggleSelectedTab(t);n.loadContractsList()});this.component.find('[data-selector="archived-contracts-button"]').on("click",function(t){t.preventDefault();n.toggleSelectedTab(t);n.loadContractsList(!1)})},i.prototype.toggleSelectedTab=function(n){this.component.find('[data-selector="active-contracts-button"]').add(this.component.find('[data-selector="archived-contracts-button"]')).removeClass("is-active");$(n.currentTarget).addClass("is-active")},i.prototype.loadContractsList=function(t){t===void 0&&(t=!0);var i=this.component.find('[data-selector="my-contracts-list"]')[0].id;n.Ajax.sendDataToActionAndUpdate(this.contractControllername,"MyContractsList",null,{divToUpdate:i,activeTab:t},null,null)},i}(n.BaseComponent);t.MyContracts=i})(t=n.SsfContractManagement||(n.SsfContractManagement={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n){t.call(this,n)}return __extends(i,t),i.prototype.initialize=function(){this.bindEvents()},i.prototype.bindEvents=function(){var n=this;this.component.find("[data-selector='add-new-contract-button']").on("click",function(t){t.preventDefault();var i=$(t.target).data("servicedomainId");n.openAddContractModal(i)});this.component.find('[data-selector="edit-contract-button"]').on("click",function(t){t.preventDefault();var i=$(t.target).data("contractId");n.openEditContractModal(i)});this.component.find('[data-selector="archive-contract-button"]').on("click",function(t){t.preventDefault();var i=$(t.target).data("contractId");n.askForArchiveConfirmation(i)});this.component.find('[data-selector="unarchive-contract-button"]').on("click",function(t){t.preventDefault();var i=$(t.target).data("contractId");n.askForArchiveConfirmation(i)})},i.prototype.askForArchiveConfirmation=function(t){var i=this.component.find('[data-selector="archive-contract-confirmation"]')[0].id;n.Ajax.sendDataToActionAndUpdate("SSFMyContracts","ArchiveConfirmation",null,{contractId:t,divToUpdate:i,moveToArchive:this.activeContractsTabIsSelected()},null,{onSuccess:function(){return n.SppHelper.openModal("#"+i)}})},i.prototype.openAddContractModal=function(t){n.Ajax.sendDataToActionAndUpdate("SSFContractManagement","MyContractDetails",null,{serviceDomainId:t},null,{onSuccess:function(){return n.SppHelper.openModal("#contract-details-popup")}})},i.prototype.openEditContractModal=function(t){n.Ajax.sendDataToActionAndUpdate("SSFContractManagement","MyContractDetails",null,{contractId:t},null,{onSuccess:function(){return n.SppHelper.openModal("#contract-details-popup")}})},i.prototype.activeContractsTabIsSelected=function(){return this.component.parents().find('[data-selector="active-contracts-button"]').hasClass("is-active")},i}(n.BaseComponent);t.MyContractsList=i})(t=n.SsfContractManagement||(n.SsfContractManagement={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i){t.call(this,n);this.form=this.component.find("[data-selector='contract-details-form']");this.controllerName=i;this.deleteButton=this.component.find("[data-selector='delete-contract-button']");this.deleteConfirmationBox=this.component.find("[data-selector='delete-confirmation-box']")}return __extends(i,t),i.prototype.initialize=function(n){this.bindEvents();n&&this.deleteButton.show();this.setupDataScopeTracker(this)},i.prototype.bindEvents=function(){var n=this;this.component.find("[data-selector='save-contract-button']").on("click",function(){return n.saveContract()});this.component.find("[data-selector='delete-contract-button']").on("click",function(){return n.showDeleteConfirmation()});this.component.find("[data-selector='delete-contract-cancel-button']").on("click",function(){return n.cancelDelete()});this.component.find("[data-selector='delete-contract-confirmation-button']").on("click",function(){return n.deleteContract()})},i.prototype.showDeleteConfirmation=function(){this.deleteButton.hide();this.deleteConfirmationBox.show()},i.prototype.cancelDelete=function(){this.deleteButton.show();this.deleteConfirmationBox.hide()},i.prototype.saveContract=function(){this.form.ssfvalidator("validate")?this.submit():console.log("KO!")},i.prototype.submit=function(){var t=this;n.Ajax.getDataFromAction(this.controllerName,"SaveContract",this.form.find(":input").serialize(),{},null,{useWaitPanel:!0,onSuccess:function(){return t.onSuccessfullySavedContract()},onValidationFailed:function(){return alert("Contract details were invalidated by the backend!")}})},i.prototype.onSuccessfullySavedContract=function(){this.trackChange(!1);this.close();this.refreshCurrentContractsTab()},i.prototype.close=function(){this.component.find("[data-selector='close-popup']").click()},i.prototype.deleteContract=function(){var t=this;n.Ajax.sendDataToActionAndUpdate(this.controllerName,"DeleteContract",null,{contractId:this.findContractId()},null,{onSuccess:function(){t.refreshCurrentContractsTab();t.close()}})},i.prototype.findContractId=function(){return this.component.find("[data-selector='contractId']").val()},i.prototype.refreshCurrentContractsTab=function(){var t=this.component.parents().find('[data-selector="my-contracts-list"]')[0].id,i=this.component.parents().find('[data-selector="active-contracts-button"]').hasClass("is-active");n.Ajax.sendDataToActionAndUpdate("SSFMyContracts","MyContractsList",null,{divToUpdate:t,activeTab:i},null,null)},i}(n.BaseComponent);t.MyContractDetailsModal=i})(t=n.SsfContractManagement||(n.SsfContractManagement={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n,i){t.call(this,n);this.controllerName=i}return __extends(i,t),i.prototype.initialize=function(){this.bindEvents()},i.prototype.bindEvents=function(){var n=this;this.component.find('[data-selector="archive-contract-button"]').on("click",function(t){t.preventDefault();n.moveContract(t)});this.component.find('[data-selector="cancel-archive-contract-button"]').on("click",function(t){t.preventDefault();n.closePopup()})},i.prototype.closePopup=function(){this.component.parent().find('[data-selector="close-popup"]').click()},i.prototype.moveContract=function(n){var t=n.currentTarget,i=$(t).data("contractId"),r=$(t).data("moveToArchive");r?this.archiveContract(i):this.unarchiveContract(i)},i.prototype.archiveContract=function(t){var i=this;n.Ajax.sendDataToActionAndUpdate("SSFMyContracts","Archive",null,{contractId:t},null,{onSuccess:function(){i.closePopup();i.refreshCurrentTab(!0)}})},i.prototype.unarchiveContract=function(t){var i=this;n.Ajax.sendDataToActionAndUpdate("SSFMyContracts","Unarchive",null,{contractId:t},null,{onSuccess:function(){i.closePopup();i.refreshCurrentTab(!1)}})},i.prototype.refreshCurrentTab=function(t){var i=this.component.parents().find('[data-selector="my-contracts-list"]')[0].id;n.Ajax.sendDataToActionAndUpdate("SSFMyContracts","MyContractsList",null,{divToUpdate:i,activeTab:t},null,null)},i}(n.BaseComponent);t.ArchiveContractConfirmation=i})(t=n.SsfContractManagement||(n.SsfContractManagement={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n){t.call(this,n)}return __extends(i,t),i.prototype.initialize=function(){this.bindEvents()},i.prototype.bindEvents=function(){var n=this;this.component.find("[data-selector='add-new-contract-button']").on("click",function(){return n.openAddContractModal()})},i.prototype.openAddContractModal=function(){n.Ajax.sendDataToActionAndUpdate("SSFContractManagement","ContractDetails",null,{},null,{onSuccess:function(){return n.SppHelper.openModal("#contract-details-popup")}})},i}(n.BaseComponent);t.ProfilesByAlert=i})(t=n.SsfSelfManagementAlerts||(n.SsfSelfManagementAlerts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={}));__extends=this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);r.prototype=t.prototype;n.prototype=new r},function(n){var t;(function(n){var t;(function(n){var t;(function(t){"use strict";var i=function(t){function i(n){t.call(this,n)}return __extends(i,t),i.prototype.initialize=function(){this.bindEvents()},i.prototype.bindEvents=function(){var n=this;this.component.find("[data-selector='add-new-contract-button']").on("click",function(){return n.openAddContractModal()})},i.prototype.openAddContractModal=function(){n.Ajax.sendDataToActionAndUpdate("SSFContractManagement","ContractDetails",null,{},null,{onSuccess:function(){return n.SppHelper.openModal("#contract-details-popup")}})},i}(n.BaseComponent);t.MonitorContracts=i})(t=n.SsfSelfManagementAlerts||(n.SsfSelfManagementAlerts={}))})(t=n.TypeScript||(n.TypeScript={}))})(t=n.ServiceSelector||(n.ServiceSelector={}))}(EC||(EC={})),function(n){n(document).trigger("BundleSSL.Executed");n(function(){n(document).trigger("BundleSSL.Ready")})}(jQuery)