var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(e){return(e<0||9<e?"":"0")+e}function isDate(e,t){return 0!=getDateFromFormat(e,t)}function compareDates(e,t,r,n){e=getDateFromFormat(e,t),t=getDateFromFormat(r,n);return 0==e||0==t?-1:t<e?1:0}function formatDate(e,t){t+="";var r,n="",l=0,a="",M=e.getYear()+"",g=e.getMonth()+1,u=e.getDate(),i=e.getDay(),s=e.getHours(),h=e.getMinutes(),e=e.getSeconds(),o=new Object;for(M.length<4&&(M=""+(+M+1900)),o.y=""+M,o.yyyy=M,o.yy=M.substring(2,4),o.M=g,o.MM=LZ(g),o.MMM=MONTH_NAMES[g-1],o.NNN=MONTH_NAMES[g+11],o.d=u,o.dd=LZ(u),o.E=DAY_NAMES[i+7],o.EE=DAY_NAMES[i],o.H=s,o.HH=LZ(s),o.h=0==s?12:12<s?s-12:s,o.hh=LZ(o.h),o.K=11<s?s-12:s,o.k=s+1,o.KK=LZ(o.K),o.kk=LZ(o.k),o.a=11<s?"PM":"AM",o.m=h,o.mm=LZ(h),o.s=e,o.ss=LZ(e);l<t.length;){for(r=t.charAt(l),a="";t.charAt(l)==r&&l<t.length;)a+=t.charAt(l++);null!=o[a]?n+=o[a]:n+=a}return n}function _isInteger(e){for(var t=0;t<e.length;t++)if(-1=="1234567890".indexOf(e.charAt(t)))return!1;return!0}function _getInt(e,t,r,n){for(var l=n;r<=l;l--){var a=e.substring(t,t+l);if(a.length<r)return null;if(_isInteger(a))return a}return null}function getDateFromFormat(e,t){e+="",t+="";for(var r,n,l,a=0,M=0,g="",u=new Date,i=u.getYear(),s=u.getMonth()+1,h=1,o=u.getHours(),f=u.getMinutes(),y=u.getSeconds(),d="";M<t.length;){for(r=t.charAt(M),g="";t.charAt(M)==r&&M<t.length;)g+=t.charAt(M++);if("yyyy"==g||"yy"==g||"y"==g){if("yyyy"==g&&(l=n=4),"yy"==g&&(l=n=2),"y"==g&&(n=2,l=4),null==(i=_getInt(e,a,n,l)))return 0;a+=i.length,2==i.length&&(i=70<i?+i+1900:+i+2e3)}else if("MMM"==g||"NNN"==g){for(var s=0,A=0;A<MONTH_NAMES.length;A++){var m=MONTH_NAMES[A];if(e.substring(a,a+m.length).toLowerCase()==m.toLowerCase()&&("MMM"==g||"NNN"==g&&11<A)){12<(s=A+1)&&(s-=12),a+=m.length;break}}if(s<1||12<s)return 0}else if("EE"==g||"E"==g)for(A=0;A<DAY_NAMES.length;A++){var N=DAY_NAMES[A];if(e.substring(a,a+N.length).toLowerCase()==N.toLowerCase()){a+=N.length;break}}else if("MM"==g||"M"==g){if(null==(s=_getInt(e,a,g.length,2))||s<1||12<s)return 0;a+=s.length}else if("dd"==g||"d"==g){if(null==(h=_getInt(e,a,g.length,2))||h<1||31<h)return 0;a+=h.length}else if("hh"==g||"h"==g){if(null==(o=_getInt(e,a,g.length,2))||o<1||12<o)return 0;a+=o.length}else if("HH"==g||"H"==g){if(null==(o=_getInt(e,a,g.length,2))||o<0||23<o)return 0;a+=o.length}else if("KK"==g||"K"==g){if(null==(o=_getInt(e,a,g.length,2))||o<0||11<o)return 0;a+=o.length}else if("kk"==g||"k"==g){if(null==(o=_getInt(e,a,g.length,2))||o<1||24<o)return 0;a+=o.length,o--}else if("mm"==g||"m"==g){if(null==(f=_getInt(e,a,g.length,2))||f<0||59<f)return 0;a+=f.length}else if("ss"==g||"s"==g){if(null==(y=_getInt(e,a,g.length,2))||y<0||59<y)return 0;a+=y.length}else if("a"==g){if("am"==e.substring(a,a+2).toLowerCase())d="AM";else{if("pm"!=e.substring(a,a+2).toLowerCase())return 0;d="PM"}a+=2}else{if(e.substring(a,a+g.length)!=g)return 0;a+=g.length}}if(a!=e.length)return 0;if(2==s)if(i%4==0&&i%100!=0||i%400==0){if(29<h)return 0}else if(28<h)return 0;return(4==s||6==s||9==s||11==s)&&30<h?0:(o<12&&"PM"==d?o=+o+12:11<o&&"AM"==d&&(o-=12),new Date(i,s-1,h,o,f,y).getTime())}function parseDate(e){for(var t,r=2==arguments.length&&arguments[1],n=(new Array("y-M-d","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d"),new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d"),new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M"),new Array("generalFormats",r?"dateFirst":"monthFirst",r?"monthFirst":"dateFirst")),l=0;l<n.length;l++)for(var a=window[n[l]],M=0;M<a.length;M++)if(0!=(t=getDateFromFormat(e,a[M])))return new Date(t);return null};
var EC;(e=>{var c,s;function i(){}c=e.ServiceSelector||(e.ServiceSelector={}),i.subscribe=function(e,n,r){e=new s(e,n,r);i.handlers.push(e)},i.unsubscribe=function(n,r){i.handlers=$.grep(i.handlers,function(e){return e.event===n&&e.scope===r},!0)},i.fire=function(n,r,e){void 0===e&&(e=null),c.Debug.logToConsole("Observer:fire: "+n);var s=e||window;i.handlers.forEach(function(e){e.event===n&&e.funct.call(s,r)})},i.resubscribe=function(e,n,r){i.unsubscribe(e,r),i.subscribe(e,n,r)},i.handlers=new Array,c.Observer=i,s=function(e,n,r){this.event=e,this.scope=r,this.funct=n},c.Handle=s})(EC=EC||{});;
var EC;(e=>{function t(){}function n(){}e=e.ServiceSelector||(e.ServiceSelector={}),t.clearContractSelection="ssf.contractmanagement.clearcontractselection",e.Commands=t,n.contractInformationChanged="ssf.contractmanagement.contractInformationChanged",n.slideToggleFinished="ssf.contractmanagement.slideToggleFinished",n.resultsFilterChanged="ssf.results.filterChanged",n.resultsSortChanged="ssf.results.sortChanged",n.resultsShowMoreSubmitted="ssf.results.showMoreSubmitted",e.Events=n})(EC=EC||{});;
var EC,__extends=this&&this.__extends||(()=>{var o=function(e,t){return(o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}})();(a=>{var e=a.ServiceSelector||(a.ServiceSelector={}),r=jQuery;function t(){}function n(){}function o(){}t.jqueryUniformDefaultOptions={selectAutoWidth:!0,selectClass:"has-uniform"},e.Constants=t,n.toggle=function(e){var e=r(e.target).parents(".expert-guidance"),t=e.children(".expert-guidance-box"),n=e.children(".expert-guidance-avatar");t.toggle(400,function(){var e;n.hasClass("moved")?(e=-60,n.removeClass("moved")):(e=60,n.addClass("moved")),n.animate({top:"-="+e},200,"easeOutBounce")})},e.ExpertAdvice=n,o.reInitializeWidgets=function(){void 0===r.fn.initialiseWidgets?a.Datapluginloader.InitializeWidgets():jQuery("body").initialiseWidgets()},o.readInitData=function(e,t){var e=e.attr("data-initdata");return null==e||0==e.length?t:(e=jQuery.parseJSON(e),null!=t&&(e=jQuery.extend(t,e)),S.logToConsole("Read init data performed:"),e)},o.initializeControls=function(n,o){r(function(){r("[data-type='"+n+"']").not("[data-jsenabled='true']").each(function(t,e){try{new o(r(e));r(e).attr("data-jsenabled","true"),S.logToConsole("Initializing control type name:"+n+" with index: "+t)}catch(e){S.logToConsole("Failed to initialize controls for type name: "+n+" of type: "+o+" with index: "+t+". Exception: "+e,!0)}})})},o.initializeControlsByFactoryMethod=function(n,o){r(function(){r("[data-type='"+n+"']").not("[data-jsenabled='true']").each(function(t,e){try{o(r(e));r(e).attr("data-jsenabled","true"),S.logToConsole("Initializing control type name: "+n+" with index: "+t)}catch(e){S.logToConsole("Failed to initialize controls for control type name: "+n+" with index: "+t+". Exception: "+e)}})})},o.initializeControlsByFactoryMethodAndDataSelector=function(n,e,o){r(function(){r(e).not("[data-jsenabled='true']").each(function(t,e){try{o(r(e));r(e).attr("data-jsenabled","true"),S.logToConsole("Initializing control type name: "+n+" with index: "+t)}catch(e){S.logToConsole("Failed to initialize controls for control type name: "+n+" with index: "+t+". Exception: "+e)}})})},e.InitHelpers=o,Object.defineProperty(s.prototype,"dataScopeName",{get:function(){return this._dataScopeName},set:function(e){this._dataScopeName=e},enumerable:!1,configurable:!0}),s.prototype.trackChange=function(e){void 0===e&&(e=!1),c.trackChangeExplicitScope(this.dataScopeName,!1)},s.prototype.trackChangeExplicit=function(e,t){void 0===t&&(t=!1),c.trackChangeExplicitScope(e,!1)},s.prototype.setupDataScopeTracker=function(e){c.setupTracker(e)},s.prototype.resetChangesTracker=function(){c.resetPendingChanges()};var i=s;function s(e){this._dataScopeName="noScopeName",(this.component=e)&&0<e.length&&(e.children(":first").attr("data-scope")?this._dataScopeName=e.children(":first").attr("data-scope"):e.attr("data-scope")?this._dataScopeName=e.attr("data-scope"):0<e.closest("[data-scope]").length&&e.closest("[data-scope]").attr("data-scope")&&(this._dataScopeName=e.closest("[data-scope]").attr("data-scope")))}e.ChangesTrackableDataScope=i,l.setupTracker=function(e){r("input, select",e.component).off(l.change).on(l.change,r.proxy(l.setModified,e)),r("input[type=checkbox]",e.component).off(l.change).on(l.change,r.proxy(l.setModified,e)),r("h3.is-editable--active",e.component).off("keyup.changesTracker").on("keyup.changesTracker",r.proxy(l.setModified,e)),r("[data-scope='cancel-operation']",e.component).off(l.click).on(l.click,r.proxy(l.setUnmodified,e)),r("[data-scope='save-operation']",e.component).off(l.click).on(l.click,r.proxy(l.setUnmodified,e))},l.setModified=function(e){l.trackChange(e,!0)},l.setUnmodified=function(e){l.trackChange(e,!1)},l.trackChange=function(e,t){void 0===t&&(t=!1),null!=e&&(0<(e=r(e.target).parent().closest("[data-scope]")).length?l.modifiedScopes[e.attr("data-scope")]=t:l.modifiedScopes.noScopeName=t)},l.trackChangeExplicitScope=function(e,t){void 0===t&&(t=!1),null!=e&&(l.modifiedScopes[e]=t)},l.hasPendingChanges=function(){var e,t=l.modifiedScopes;for(e in t)if(t.hasOwnProperty(e)&&t[e])return!0;return!1},l.resetPendingChanges=function(){var e,t=l.modifiedScopes;for(e in t)t.hasOwnProperty(e)&&(t[e]=!1);return!0},l.modifiedScopes={},l.click="click.changesTracker",l.change="change.changesTracker";var c=l;function l(){}e.ChangeTrackerDataScope=c,__extends(u,d=i);var d,i=u;function u(e){var t=this,n=r("div[data-js-guid='"+e+"']");return(t=d.call(this,n)||this).guid=e,t}e.BaseComponent=i,__extends(f,p=i);var p,i=f;function f(e){return p.call(this,e)||this}e.BaseContractComponent=f,e.BaseComponentNew=function(e){this.component=e},h.openModal=function(e){r("<a/>").attr("href",e).attr("data-popup-modal","true").attr("data-backdrop","static").attr("data-keyboard","false").attr("data-popup-type","inline").modal().click()},h.scrollIntoView=function(e,t){var n=e.find(".form__item--has-errors").first();0<n.length&&(r("html, body").animate({scrollTop:n.offset().top-10},500),setTimeout(function(){n.focus()},750))};var g=h;function h(){}e.SppHelper=g;var m=function(e,t){this.message=e,this.category=t},S=(e.DebugEvent=m,v.logToConsole=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.isDebugEnabled&&window.console&&void 0!==console&&(t&&void 0!==console.error?console.error("[SSF Debug] "+e):void 0!==console.log&&console.log("[SSF Debug] "+e),this.debugEvents.push(new m(e,n)))},v.registerJavascriptHandler=function(){0==r("meta[name=developerMode]").length?this.isDebugEnabled=!1:(this.isDebugEnabled=!0,window.onerror=this.handleJavascriptError)},v.handleJavascriptError=function(e,t,n,o){e="JS ERROR: "+e+"<br />@ "+t+" (line: "+n;return o&&(e+=", col: "+o),v.logToConsole(e+=")",!0),!1},v.startProfile=function(){return new Date},v.endProfile=function(e,t){this.isDebugEnabled&&(e=(new Date).getTime()-e.getTime(),e=(null==t?"":t+": ")+((t=new Date(e)).getSeconds()+t.getMilliseconds()/1e3)+"s",v.logToConsole(e))},v.isDebugEnabled=!1,v.debugEvents=new Array,v);function v(){}e.Debug=S,a.ServiceSelector.Debug.registerJavascriptHandler(),b.count=function(){return this._count},b.increment=function(){this._count++,S.logToConsole("Waitpanel counter increased to: "+this._count),1<this._count||this.openServiceSelectorLoadingIndicator([r("body")])},b.decrement=function(){this._count--,S.logToConsole("Waitpanel counter decreased to: "+this._count),0<this._count||(this._count<0&&S.logToConsole("Waitpanel counter went below zero! Count be a problem.",!0),this.closeServiceSelectorLoadingIndicator([r("body")]))},b.show=function(e){this.openServiceSelectorLoadingIndicator([e])},b.hide=function(e){this.closeServiceSelectorLoadingIndicator([e])},b.openServiceSelectorLoadingIndicator=function(e){var n=window.matchMedia("screen and (min-width:48em)").matches?"desktop":"mobile",o=r(e).find(".js-AjaxSpinnerLoadText").first().text();o.length<1&&(o=r("#AjaxSpinnerLoadText").text()),r.each(e,function(e,t){r(t).loadingIndicator({mode:n,blockingMessage:o,openOnLoad:!0})})},b.closeServiceSelectorLoadingIndicator=function(e){r.each(e,function(e,t){r(t).filter(":ec-loadingIndicator").loadingIndicator("closeBlocker")})},b._count=0;var y=b;function b(){}function x(){}function w(){}e.WaitPanel=y,x.getEnvironmentPrefix=function(){var e;return null==x.environmentPrefix&&(e=jQuery("meta[name='routingPrefix']").attr("content"),x.environmentPrefix=void 0!==e&&""!==e?"/"+e:""),x.environmentPrefix},x.submitFormAndUpdate=function(e,t){e={url:e.action,type:e.method,data:r(e).serialize(),traditional:!0},e=r.extend(e,t);x.update(e,t)},x.submitFormAndGetData=function(e,t){e={url:e.action,type:e.method,data:r(e).serialize(),traditional:!0},e=r.extend(e,t);x.getData(e,t)},x.getDataFromAction=function(e,t,n,o,i,a){void 0===i&&(i=null),void 0===a&&(a=null);e=x.getApiUrl(e,t,n),t=r.extend({url:e,data:o},i);x.doGeneric(t,a,x.doGetData)},x.sendDataToActionAndUpdate=function(e,t,n,o,i,a){void 0===a&&(a=null);e=x.getApiUrl(e,t,n),t=r.extend({url:e,data:o},i);x.update(t,a)},x.getData=function(e,t){x.doGeneric(e,t,x.doGetData)},x.update=function(e,t){x.doGeneric(e,t,x.doUpdate)},x.getApiUrl=function(e,t,n){void 0===n&&(n=null);var o=r("meta[name='scID']").attr("content"),e=this.getEnvironmentPrefix()+"/ServiceSelectorsAPI/"+e+"/"+t+"/"+o;return e=null!=n&&0<n.length?e+"?"+n.replace("?",""):e},x.doGeneric=function(e,t,n){var o={type:"POST",data:{},dataType:"json",headers:{__RequestVerificationToken:r("meta[name='antiForgeryToken']").attr("content")}},i={onError:jQuery.noop,onSuccess:jQuery.noop,onValidationFailed:jQuery.noop,useErrorWindow:!0,useWaitPanel:!0,waitPanelElement:null};n(r.extend(o,e),r.extend(i,t))},x.doUpdate=function(e,i){i.useWaitPanel&&a.ServiceSelector.WaitPanel.increment();var t=S.startProfile();r.ajax(e).done(function(e,t,n){if(null!=e.Updates)for(var o=0;o<e.Updates.length;o++)r("#"+e.Updates[o].Id).html(e.Updates[o].Html);e.Valid?i.onSuccess(null):i.onValidationFailed(null)}).fail(function(e,t,n){x.handleAjaxFail(e,t,n,i)}).always(function(){i.useWaitPanel&&a.ServiceSelector.WaitPanel.decrement(),S.endProfile(t,"Ajax update ended: ")})},x.doGetData=function(e,o){o.useWaitPanel&&(o.waitPanelElement?a.ServiceSelector.WaitPanel.show(o.waitPanelElement):a.ServiceSelector.WaitPanel.increment());var t=S.startProfile();r.ajax(e).done(function(e,t,n){e.Valid?o.onSuccess(e.Data):o.onValidationFailed(e.ValidationErrors)}).fail(function(e,t,n){x.handleAjaxFail(e,t,n,o)}).always(function(){o.useWaitPanel&&(o.waitPanelElement?a.ServiceSelector.WaitPanel.hide(o.waitPanelElement):a.ServiceSelector.WaitPanel.decrement()),S.endProfile(t,"Ajax update ended: ")})},x.handleAjaxFail=function(e,t,n,o){0===e.status&&1===e.abort.length||(a.ServiceSelector.Debug.logToConsole("Ajax update ended with status "+e.status+" ("+n+")",!0),o.useErrorWindow&&this.showGenericErrorPopup(),o.onError())},x.showGenericErrorPopup=function(){var t=this,n=(y.increment(),"Server error!"),o="An unexpected error has occurred. Please refresh the page or contact us.",i="Refresh";r.ajax({type:"POST",url:x.getApiUrl("SsfErrorMessageBox","GetErrorMessageBoxData",null),data:null,dataType:"json",async:!0,success:function(e){e.success&&(n=e.errorTitleText,o=e.errorText,i=e.buttonText),y.decrement(),t.renderGenericErrorPopup(n,o,i)},error:function(){y.decrement(),t.renderGenericErrorPopup(n,o,i)},timeout:5e3})},x.renderGenericErrorPopup=function(e,t,n){e="<div class='popup__inner white-popup'>"+("<h1>"+e+"</h1>")+("<div class='popup__section spacer-small'>"+t+"</div>")+("<input type='button' class='popup-close btn btn--primary btn--large' value='"+n+"' name='generic-error-action' onclick='window.location.reload();'>")+"</div>";r("#generic-popup-error-placeholder").remove(),r("body").append("<div id='generic-popup-error-placeholder'>"+e+"</div>"),g.openModal("#generic-popup-error-placeholder")},x.environmentPrefix=null,e.Ajax=x,w.redirectThroughPost=function(e,t,n,o){void 0===o&&(o=null);var i=document.createElement("form"),e=(i.method="post",i.action=e,document.createElement("input"));e.type="hidden",e.name=t,e.value=JSON.stringify(n),i.appendChild(e),null!=o&&((t=document.createElement("input")).type="hidden",t.name="SselConfigId",t.value=JSON.stringify(o),i.appendChild(t)),document.body.appendChild(i),i.submit()},e.RedirectHelper=w,P.storeInSession=function(e,t){this.getSessionStorageAvailability&&sessionStorage.setItem(e,JSON.stringify(t))},P.removeFromSession=function(e){this.getSessionStorageAvailability&&sessionStorage.setItem(e,null)},P.getFromSession=function(e){return this.getSessionStorageAvailability?(e=sessionStorage.getItem(e),JSON.parse(e)):null},P.getSessionStorageAvailability=function(){if(!this.isChecked){sessionStorage||(this.sessionStorageIsAvailable=!1);try{sessionStorage.setItem(this.testStorageKey,this.testStorageValue),sessionStorage.getItem(this.testStorageKey)!==this.testStorageValue&&(this.sessionStorageIsAvailable=!1),sessionStorage.removeItem(this.testStorageKey),this.sessionStorageIsAvailable=!0}catch(e){this.sessionStorageIsAvailable=!1}this.isChecked=!0}return this.sessionStorageIsAvailable},P.isChecked=!1,P.sessionStorageIsAvailable=!0,P.testStorageKey="teststore",P.testStorageValue="testme";var C=P;function P(){}function E(){}function T(){}e.SessionStore=C,E.getCurrentFlowSequence=function(){return Number(C.getFromSession(this.sequenceFlowSessionStorageKeyName))},E.startNewFlowSequence=function(){var e=this.getCurrentFlowSequence()+1;return C.storeInSession(this.sequenceFlowSessionStorageKeyName,e),e},E.sequenceFlowSessionStorageKeyName="ssfFlowSequence",e.SelectorFlowHistoryManager=E,T.prototype.registerListenerForQualityBoxAnimations=function(){r(function(){r.subscribe("domupdated.popup-form",function(e,t){r(t).hasClass("js-qualityboxes")&&(r(t).data("ec-qualityboxes")||r(t).qualityboxes(),r(t).qualityboxes("start"))})})},T.prototype.start=function(){this.registerListenerForQualityBoxAnimations()},(new T).start(),r(document).ready(function(){jQuery("body").append("<div id='ssf-ajax-redirect-v2' class='hidden'></div>")})})(EC=EC||{});;
var EC,__extends=this&&this.__extends||(()=>{var r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}))(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}})();(r=>{var t,e,o;function n(t){t=e.call(this,t)||this;return t.bindEvents(),t}t=r.ServiceSelector||(r.ServiceSelector={}),e=r.ServiceSelector.BaseComponentNew,__extends(n,e),n.prototype.bindEvents=function(){this.component.find("[data-selector='email-pdf-form']").on("submit","form",$.proxy(this.sendPdf,this)),this.component.find("[data-selector='pdf-form-close']").on("click",$.proxy(this.togglePdfForm,this))},n.prototype.sendPdf=function(t){t.preventDefault();var e=t.currentTarget,o=$(t.currentTarget);o.data("ssfvalidator")||o.ssfvalidator({autoRevalidate:!0,showValidationMessages:!0}),o.ssfvalidator("validate")&&r.ServiceSelector.Ajax.submitFormAndGetData(e,{onSuccess:function(t){t&&$(o).hide().parent().find("[data-selector='sendpdf-confirmation']").show(),o.ssfvalidator("destroy")},useWaitPanel:!0})},n.prototype.togglePdfForm=function(){var t=$("form","[data-selector='email-pdf-form']");t.is(":hidden")&&(t[0].reset(),t.show(),$("[data-selector='sendpdf-confirmation']").hide())},o=n,t.SsfPrintOrSendPdf=o,t.InitHelpers.initializeControlsByFactoryMethod("SsfPrintOrPreviewComponent",function(t){return new o(t)})})(EC=EC||{});;
(u=>{var s={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("positiveNumber",u.proxy(this._positiveNumberField,this),"#ValidationError_PositiveNumber"),this.addRule("decimal",this._checkNonNegativeDecimalField,"#ValidationError_Number"),this.addRule("positivedecimal",this._checkPositiveDecimalField,"#ValidationError_Number"),this.addRule("positivedecimalorzero",this._checkPositiveDecimalOrZeroField,"#ValidationError_Number"),this.addRule("date",this._checkIsDateField,"#ValidationError_Date"),this.addRule("futuredate",this._checkFutureDateField,"#ValidationError_FutureDate"),this.addRule("pastdate",this._checkPastDateField,"#ValidationError_PastDate"),this.addRule("birthdateAdult",this._checkBirthdateAdultField,"#ValidationError_birthdateAdult"),this.addRule("phonenr",this._checkPhoneNrField,"#ValidationError_PhoneNumber"),this.addRule("phonenrpt",this._checkPtPhoneNrField,"#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("ssfiban",u.proxy(this._checkIBAN,this),"#ValidationError_IBAN"),this.addRule("ssfbecardidentitynumber",u.proxy(this._checkBeIdentityCardNumber,this),"#ValidationError_BECardIdentityNumber"),this.addRule("ssfbenationalnumber",u.proxy(this._checkBeNationalNumber,this),"#ValidationError_BENationalNumber"),this.addRule("regex",u.proxy(this._checkRegex,this),"#ValidationError_BENationalNumber"),this.addRule("ptcarregistrationplate",u.proxy(this._checkPtCarRegistrationPlate,this),"#ValidationError_PTCarRegistrationPlate"),this.addRule("ptfiscalidentitynumber",u.proxy(this._checkPtFiscalIdentityNumber,this),"#ValidationError_PTFiscalIdentityNumber"),this.addRule("ptinsurancestartdate",u.proxy(this._checkPtInsuranceStartDate,this),"#ValidationError_PTInsuranceStartDate"),this.addRule("ptnationalplatedate",u.proxy(this._checkPtNationalPlateDate,this),"#ValidationError_PTNationalPlateDate"),this.addRule("namewithnospecialcharacters",u.proxy(this._checkNameNoSpecialCharacters,this),"#ValidationError_NoSpecialCharactersName"),this.addRule("dependendon",u.proxy(this._dependendOn,this),"#ValidationError_DependendOn"),this.addRule("calculateminimumdifferencedates",u.proxy(this._calculateminimumdifferencedates,this),"#ValidationError_LicenseDate"),this.addRule("pthealthdate",u.proxy(this._checkPtHealthDate,this),"#ValidationError_EndDate"),this.addRule("pthealthaddedelementage",this._checkAddedElementAge,"#ValidationError_DependentsBirthdate"),this.addRule("ptlifeloantermyearslimit",u.proxy(this._checkPtLifeLoanTermYearsLimit,this)),this.addRule("ptlifeinsurancestartdatelimit",u.proxy(this._checkPtLifeInsuranceStartDateLimit,this)),this.addRule("ptlifeinsurancecheckcapitalvalue",u.proxy(this._checkPtLifeInsuranceCapitalValue,this)),this.addRule("ptlifeinsuranceagerange",u.proxy(this._checkPtLifeInsuranceAgeRange,this)),this.addRule("ptinsurancemrhstartdate",u.proxy(this._checkPtMRHStartDate,this)),this.addRule("bessfatleastonecheckbox",u.proxy(this._atLeastOneCheckbox,this)),this._bindRevalidation()},addRule:function(e,t,i){var a=null;i&&(a=(a=this.element.find(i).text())||u(i).text()),this._ruleDefinitions.push({fieldSelector:e,func:t,message:a}),this._processRule(e,t,a)},_processRule:function(e,t,i){for(var a=[],r=this.element.find('[data-validation~="'+e+'"]'),n=0;n<r.length;n++){var s=r.eq(n),l=s.attr("name");if(-1===u.inArray(l,a)){a.push(l);for(var o=null,d=0;d<this._fieldDefinitions.length;d++)if(this._fieldDefinitions[d].name==l){o=this._fieldDefinitions[d];break}o||(o={field:s,name:l,placeholder:this.element.find('[data-validation-placeholder="'+l+'"]'),rules:[]},this._fieldDefinitions.push(o)),o.rules.push({func:t,message:i})}}},_bindRevalidation:function(){if(this.options.autoRevalidate)for(var e=0;e<this._fieldDefinitions.length;e++){var t=this._fieldDefinitions[e],t=this.element.find("[name='"+t.name+"']");t.filter("input:not([type=radio], [type=checkbox]), textarea").blur(u.proxy(this.revalidate,this)),t.filter("select").change(u.proxy(this.revalidate,this)),t.filter("input:checkbox, input:radio").change(u.proxy(this.revalidate,this))}},_checkIsChecked:function(e,t,i){return!!t.is(":checked")},_checkRequiredField:function(e,t,i){return!(void 0===e||null==e||""==e)},_checkRequiredGroupField:function(e,t,i){var a=!1,t=t.data("requiredgroup"),i=i.find('[data-requiredgroup="'+t+'"]');return u(i).each(function(){var e=u(this).val();if(!(void 0===(e=u(this).is(":radio")||u(this).is(":checkbox")?u(this).is(":checked")?u(this).val():null:e)||null==e||""==e))return!(a=!0)}),a},_checkNumberField:function(e,t,i){var a;return""==e||(a=parseInt(e),!isNaN(a)&&null==e.match(/\D+/))},_positiveNumberField:function(e,t,i){return""==e||!!this._checkNumberField(e)&&0<e},_checkPositiveDecimalField:function(e,t,i){return 0<!e.length||!isNaN(e.replace(",",".")||-1!==e.indexOf("."))&&(e=parseFloat(e),!isNaN(e))&&0<e},_checkPositiveDecimalOrZeroField:function(e,t,i){return 0<!e.length||!isNaN(e.replace(",",".")||-1!==e.indexOf("."))&&(e=parseFloat(e),!isNaN(e))&&0<=e},_checkNonNegativeDecimalField:function(e,t,i){return 0<!e.length||!isNaN(e.replace(",",".")||-1!==e.indexOf("."))&&(e=parseFloat(e),!isNaN(e))&&0<=e},_checkRange:function(e,t,i){var a=t.data("min"),t=t.data("max"),e=parseInt(e);return!(""!==a&&e<a||""!==t&&t<e)},_checkDateDay:function(e,t){if(""==e)return!0;try{var i=parseInt(e);return 0<i&&i<=31}catch(e){return!1}},_checkDateMonth:function(e){if(""==e)return!0;try{var t=parseInt(e);return 0<t&&t<=12}catch(e){return!1}},_checkDateYear:function(e,t){if(""==e)return!0;try{var i,a=parseInt(e);return-1<t.data("validation").indexOf("datepast")?(i=(new Date).getFullYear(),4==a.toString().length&&a<=i):-1<t.data("validation").indexOf("datefuture")?(i=(new Date).getFullYear())<=a:4==a.toString().length}catch(e){return!1}},_checkBEphone:function(e){return""==e||0==e.indexOf("+32")&&10<=e.length},_checkBEbank:function(e){return""===e||null!=e.match("[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}")},_checkIsDateField:function(e,t,i,a){if(""==e)return!0;try{var r=a._findRegion();return EC.DateUtilities.parseDate(EC.DateUtilities.regional[r].dateFormat,e),!0}catch(e){}return!1},_findRegion:function(){var t=u("html").attr("lang");return 1===["pt-br","nl-BE"].filter(function(e){return e===t}).length?t:t.split("-")[0]},_checkFutureDateField:function(e,t,i,a){try{var r,n,s;return""==e?!0:(r=a._findRegion(),n=EC.DateUtilities.parseDate(EC.DateUtilities.regional[r].dateFormat,e),s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate())<=n)}catch(e){return!1}},_checkPastDateField:function(e,t,i,a){try{var r,n,s;return""==e?!0:(r=a._findRegion(),n=EC.DateUtilities.parseDate(EC.DateUtilities.regional[r].dateFormat,e),s=new Date,n<new Date(s.getFullYear(),s.getMonth(),s.getDate()))}catch(e){return!1}},_checkBirthdateAdultField:function(e,t,i,a){try{var r,n,s,l,o;return""==e?!0:(r=a._findRegion(),n=EC.DateUtilities.parseDate(EC.DateUtilities.regional[r].dateFormat,e),l=(s=new Date).getFullYear()-n.getFullYear(),((o=s.getMonth()-n.getMonth())<0||0==o&&s.getDate()<n.getDate())&&l--,18<=l)}catch(e){return!1}},_checkAddedElementAge:function(i,e,t,a){try{var r=u("#hi_titular_date_of_birth").val(),n=e.closest(".contractBlock").find("select").val();if(""===i||""===r||""===n||"Outro"===n)return!0;var s=new Date;if("Filho(a)"===n){var l=EC.DateUtilities.parseDate(EC.DateUtilities.regional[a._findRegion()].dateFormat,r),o=EC.DateUtilities.parseDate(EC.DateUtilities.regional[a._findRegion()].dateFormat,i);let e=s.getFullYear()-l.getFullYear(),t=s.getFullYear()-o.getFullYear();var d=s.getMonth()-l.getMonth();(d<0||0==d&&s.getDate()<l.getDate())&&e--,s.getMonth(),o.getMonth();return(d<0||0==d&&s.getDate()<o.getDate())&&t--,15<=e-t}if("Cônjuge"===n){var h=EC.DateUtilities.parseDate(EC.DateUtilities.regional[a._findRegion()].dateFormat,i);let e=s.getFullYear()-h.getFullYear();var c=s.getMonth()-h.getMonth();return(c<0||0==c&&s.getDate()<h.getDate())&&e--,18<=e}}catch(e){return!1}},_checkEmailField:function(e,t,i){return!e||null!=e.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])?"))},_checkPhoneNrField:function(e,t,i){return null!=e.match(new RegExp("^\\+[1-9]{1}[0-9]{9,12}$"))},_checkPtPhoneNrField:function(e,t,i){return null!=e.match(new RegExp("^([0-9]{3}s*[0-9]{3}s*[0-9]{3})$"))},_checkPtCarRegistrationPlate:function(e){var t;return 0==e.length||(t=new RegExp("^([0-9]{2}-[0-9]{2}-[a-zA-Z]{2}|[0-9]{2}-[a-zA-Z]{2}-[0-9]{2}|[a-zA-Z]{2}-[0-9]{2}-[0-9]{2}|[a-zA-Z]{2}-[0-9]{2}-[a-zA-Z]{2}|[a-zA-Z]{2}[0-9]{2}[a-zA-Z]{2})$"),null!=e.match(t))},_checkPtFiscalIdentityNumber:function(e){if(0==e.length)return!0;var t,i=0;if(9==e.length&&("1"==(t=e.charAt(0))||"2"==t||"3"==t)){for(var i=9*t,a=2;a<=8;a++)i+=e.charAt(a-1)*(10-a);if("123456789"==e)return!1;if((i=10<=(i=11-i%11)?0:i)==e.charAt(8))return!0}return!1},_checkPtInsuranceStartDate:function(e){var e=e.split("/"),e=new Date(e[2],e[1]-1,e[0]),t=new Date,i=new Date;return i.setDate(t.getDate()+90),e<i},_checkPtNationalPlateDate:function(e){var t=u(this.element.find('input[name*="ci_vehicle_registration_date"]')).val(),e=e.split("/"),t=t.split("/"),e=new Date(e[2],e[1]-1,e[0]);return new Date(t[2],t[1]-1,t[0])<e},_checkNameNoSpecialCharacters:function(e){return null!=e.match(new RegExp("^[a-zA-ZáàâãéèêíìîóòôõúùûÁÀÂÃÉÈÊÍÌÎÓÒÔÕÚÙÛçÇ' ]*$"))},_hideValidationErrors:function(e,t){this.options.showValidationMessages&&(e.closest(".form__item").removeClass("form__item--has-errors"),this.options.showSummary||t.slideUp({complete:function(){t.text("")}}))},_removeDuplicates:function(e){var t=new Array;e:for(var i=0,a=e.length;i<a;i++){for(var r=0,n=t.length;r<n;r++)if(t[r]==e[i])continue e;t.push(e[i])}return t},_calculateminimumdifferencedates:function(e){var t=this.element.find("[data-validation-calculateminimumdifferencedates-mindate-id]").attr("data-validation-calculateminimumdifferencedates-mindate-id"),t=u(this.element.find("[data-id= "+t+"]")).val(),i=this.element.find("[data-validation-calculateminimumdifferencedates-difference]").attr("data-validation-calculateminimumdifferencedates-difference"),t=t.split("/"),i=i.split("/"),t=new Date(parseInt(t[2])+parseInt(i[2]),parseInt(t[1])+parseInt(i[1]),parseInt(t[0])+parseInt(i[0])),i=e.split("/");return t<=new Date(i[2],i[1],i[0])},reset:function(){this._isValidated=!1;for(var e=0;e<this._fieldDefinitions.length;e++){var t=this._fieldDefinitions[e];this._hideValidationErrors(t.field,t.placeholder)}},restart:function(e){for(this.reset();this._fieldDefinitions.length;)this._fieldDefinitions.pop();for(var t=0;t<this._ruleDefinitions.length;t++){var i=this._ruleDefinitions[t];this._processRule(i.fieldSelector,i.func,i.message)}!0===e&&this.validate()},revalidate:function(){return!!this._isValidated&&this.validate()},_showValidationErrors:function(e,t,i){this.options.showValidationMessages&&(e.closest(".form__item").addClass("form__item--has-errors"),this.options.showSummary||t.text(i).slideDown())},validate:function(){this._isValidated=!0;for(var e=new Date,t=!0,i=[],a=0;a<this._fieldDefinitions.length;a++){var r=this._fieldDefinitions[a],r=this._validateField(r.field,r.rules,r.placeholder);r.success||(t=!1,i.push(r.message))}if(this.options.showSummary){var n=this.element.find(this.options.summarySelector);if(t)n.empty();else{for(var s=u("<ul>"),l=this._removeDuplicates(i),o=0;o<l.length;o++)u("<li></li>").text(l[o]).appendTo(s);n.html(s)}}t||EC.ServiceSelector.SppHelper.scrollIntoView(this.element,".form__item--has-errors");n=new Date-e;return EC.ServiceSelector.Debug.logToConsole("Form validated: "+(t?"Success":"Failure")+" ("+n+"ms)"),t},_validateField:function(e,t,i){if(e.is(":visible")||e.is('[data-validation~="hidden"]')||this.options.includeHiddenFields){var a,r=null;e.is(":radio")||e.is(":checkbox")?(a=e.attr("name"))?r=this.element.find("[name='"+a+"']:checked").val():e.is(":checked")&&(r=e.val()):r=e.val();for(var n=0;n<t.length;n++){var s,l=t[n];if(!l.func(r,e,this.element,this))return s=(s=e.data("validation-message"))||l.message,this._showValidationErrors(e,i,s=s||"No validation message found!"),{success:!1,message:s}}this._hideValidationErrors(e,i)}return{success:!0}},longModulo:function(e,t){for(var i="",a=e.length,r=0;r<a;r++)i=(+(i+=e.charAt(r))%t).toString(10);return+i},_checkBeIdentityCardNumber:function(e){var t;return 0==e.length||(e=e.replace(/[\s-,.]+/g,""),!!/^[0-9]{12}$/.test(e)&&(t=+e.substr(10,2),e=e.substr(0,10),(e=this.longModulo(e,97))===t||0===e))},_checkBeNationalNumber:function(e){var t;return 0==e.length||(e=e.replace(/[\s-,.]+/g,""),!!/^[0-9]{11}$/.test(e)&&(t=+e.substr(9,2),e=e.substr(0,9),97-this.longModulo(e,97)==t||97-this.longModulo("2"+e,97)==t))},_checkIBAN:function(e){if(0==e.length)return!0;var t=e.toUpperCase().replace(/[\s-,.]+/g,"");if(!/^[A-Z0-9]{5,}$/.test(t))return!1;if("PT50"==(e=t).substring(0,4)){if(!/^PT50\d{21}$/.test(e))return!1;e=e.substr(4,e.length-4)+e.substr(0,4);for(var i="",a=0;a<e.length;a++)i+=e[a].match(/[a-z]/i)?e[a].charCodeAt(0)-55:parseInt(e[a]);var r=i,n=parseInt(r.substr(0,1));for(a=1;a<r.length;a++)n=((n*=10)+parseInt(r.substr(a,1)))%97;return 1===n}var s=t.substr(4)+t.substr(0,4),l=s.length,o="";for(a=0;a<l;a++)o+=isNaN(+s[a])?(s[a].charCodeAt(0)-55).toString():s[a];return 1===this.longModulo(o,97)},_checkRegex:function(e,t){var i;return 0===e.length||(i=t.data("valregexpattern"),t=t.data("valregexflags"),i=new RegExp(i,t),null!=e.match(i))},_checkPtHealthDate:function(e){var t=this.element.find("[data-validation-calculateminimumdate-mindate-id]").attr("data-validation-calculateminimumdate-mindate-id"),t=u(this.element.find("[data-id="+t+"]")).val().split("/"),e=e.split("/");return new Date(t[2],t[1]-1,t[0])<new Date(e[2],e[1]-1,e[0])},_checkPtLifeLoanTermYearsLimit:function(e){var t,i=u('[name="FormValues.FirstHolderDate"]').val().split("/"),i=new Date(i[2],i[1]-1,i[0]),a=i;return 0<u('[name="FormValues.SecondHolderDate"]').length&&(t=u('[name="FormValues.SecondHolderDate"]').val().split("/"),i<(i=new Date(t[2],t[1]-1,t[0])))&&(a=i),(new Date).getFullYear()-a.getFullYear()+parseInt(e)<85},_checkPtLifeInsuranceStartDateLimit:function(e){var t=new Date,e=e.split("/");return new Date(e[2],e[1]-1,e[0])<=new Date(t.setMonth(t.getMonth()+6))},_checkPtLifeInsuranceCapitalValue:function(e){return 1e4<=e&&e<=1e6},_checkPtLifeInsuranceAgeRange:function(e){try{var t,i,a,r,n;return""==e?!0:(t=s._findRegion(),i=EC.DateUtilities.parseDate(EC.DateUtilities.regional[t].dateFormat,e),r=(a=new Date).getFullYear()-i.getFullYear(),((n=a.getMonth()-i.getMonth())<0||0==n&&a.getDate()<i.getDate())&&r--,18<=r&&r<=65)}catch(e){return!1}},_checkPtMRHStartDate:function(e){var e=e.split("/"),e=new Date(e[2],e[1]-1,e[0]),t=new Date,i=new Date;return i.setDate(t.getDate()+60),e<i},_atLeastOneCheckbox:function(e,t){var i=t.attr("data-val-ssfatleastonecheckbox-dependentfields").split(","),a=!1;return i.forEach(function(e,t){u("input#"+e).is(":checked")&&(a=!0)}),!(!t.is(":checked")&&!a)},_dependendOn:function(e,t){t=u(t);if(!t.is(":hidden")){t=t.attr("data-dependend-on"),t=u("#"+t).val();if(""!==e||""!==t){if(""===e&&""!==t)return!1;if(""!==e&&""===t)return!1}}return!0}},e=(u.widget("EC.ssfvalidator",s),{addRule:function(e,t){this._ruleDefinitions.push({fieldSelector:e,func:t}),this._processRule(e,t)},_processRule:function(e,t){for(var i=[],a=this.element.find("[data-val-"+e+"]"),r=0;r<a.length;r++){var n=a.eq(r),s=n.attr("name"),l=n.attr("data-val-"+e);if(-1===u.inArray(s,i)){i.push(s);for(var o=null,d=0;d<this._fieldDefinitions.length;d++)if(this._fieldDefinitions[d].name==s){o=this._fieldDefinitions[d];break}o||(o={field:n,name:s,placeholder:this.element.find('[data-validation-placeholder="'+s+'"]'),rules:[]},this._fieldDefinitions.push(o)),o.rules.push({func:t,message:l})}}}});u.widget("EC.ssfvalidatorUnobstrusive",u.extend(!0,s,e))})(jQuery);;
(d=>{function u(t,e){for(var a="",r=t.length,s=0;s<r;s++)a=(+(a+=t.charAt(s))%e).toString(10);return+a}function r(t){t=d("[name='"+t+"']");return t.is(":checkbox")||t.is(":radio")?t.filter(":checked"):t}d.validator.addMethod("ssfbenationalnumber",function(t,e){return this.optional(e)||(e=(e=t).replace(/[\s-,.]+/g,""),!!/^[0-9]{11}$/.test(e)&&(t=+e.substr(9,2),97-u(e=e.substr(0,9),97)==t||97-u("2"+e,97)==t))}),d.validator.unobtrusive.adapters.addBool("ssfbenationalnumber"),d.validator.addMethod("ssfbecardidentitynumber",function(t,e){return this.optional(e)||(e=(e=t).replace(/[\s-,.]+/g,""),!!/^[0-9]{12}$/.test(e)&&(t=+e.substr(10,2),(e=u(e.substr(0,10),97))===t||0===e))}),d.validator.unobtrusive.adapters.addBool("ssfbecardidentitynumber"),d.validator.addMethod("ssfiban",function(t,e){return this.optional(e)||(t=>{var e=t.toUpperCase().replace(/[\s-,.]+/g,"");if(!/^[A-Z0-9]{5,}$/.test(e))return!1;if("PT50"==(t=e).substring(0,4)){if(!/^PT50\d{21}$/.test(t))return!1;t=t.substr(4,t.length-4)+t.substr(0,4);for(var a="",r=0;r<t.length;r++)a+=t[r].match(/[a-z]/i)?t[r].charCodeAt(0)-55:parseInt(t[r]);var s=a,d=parseInt(s.substr(0,1));for(r=1;r<s.length;r++)d=((d*=10)+parseInt(s.substr(r,1)))%97;return 1===d}var n=e.substr(4)+e.substr(0,4),o=n.length,i="";for(r=0;r<o;r++)i+=isNaN(+n[r])?(n[r].charCodeAt(0)-55).toString():n[r];return 1===u(i,97)})(t)}),d.validator.unobtrusive.adapters.addBool("ssfiban"),d.validator.addMethod("ssfregexopt",function(t,e){var a;return!!this.optional(e)||(a=(e=d(e)).attr("data-val-ssfregexopt-pattern"),e=e.attr("data-val-ssfregexopt-flags"),a=new RegExp(a,e),null!=t.match(a))}),d.validator.unobtrusive.adapters.addBool("ssfregexopt"),d.validator.addMethod("ssfrequiredif",function(t,e){var a=r((e=d(e)).attr("data-val-ssfrequiredif-dependentfield")),e=e.attr("data-val-ssfrequiredif-dependentvalues").split(",");return!a.length||!e.length||-1===d.inArray(a.val(),e)||!!t}),d.validator.unobtrusive.adapters.addBool("ssfrequiredif"),d.validator.addMethod("ssfrequiredifnot",function(t,e){var a=r((e=d(e)).attr("data-val-ssfrequiredifnot-dependentfield")),e=e.attr("data-val-ssfrequiredifnot-dependentvalues").split(",");return!a.length||!e.length||-1<d.inArray(a.val(),e)||!!t}),d.validator.unobtrusive.adapters.addBool("ssfrequiredifnot"),d.validator.addMethod("ssfmustbechecked",function(t,e,a){return this.depend(a,e)?e.checked:"dependency-mismatch"}),d.validator.unobtrusive.adapters.addBool("ssfmustbechecked"),d.validator.addMethod("ssfmustbeunique",function(a,r){var t,s;return!!this.optional(r)||(t=d(r).data("valSsfuniquergx"),s=!0,d(t).each(function(t,e){e!==r&&e.value==a&&(s=!1)}),s)}),d.validator.unobtrusive.adapters.addBool("ssfmustbeunique"),d.validator.addMethod("ssfnotonlywhitespaces",function(t,e){return t&&""!==t.toString().trim()}),d.validator.unobtrusive.adapters.addBool("ssfnotonlywhitespaces")})(jQuery);;
var EC=EC||{};EC.ServiceSelector=EC.ServiceSelector||{},EC.ServiceSelector.ServiceSelectorAuthenticationCallout={},EC.ServiceSelector.ServiceSelectorAuthenticationCallout.Init=function(e){$(e.instance).find("[data-plugin]").removeClass("has-plugin"),$(document).initialiseWidgets(),EC.ServiceSelector.ServiceSelectorAuthenticationCallout.RebindEvents(e)},EC.ServiceSelector.ServiceSelectorAuthenticationCallout.RebindEvents=function(e){$(e.instance).find("[data-plugin=iframeAuthentication]").find('a[data-selector="aline-authentication-modal--btn-trigger"]').on("click",function(){var e=$(this).data("login-url")||$(this).data("register-url"),i=$("#aline-authentication-modal"),t=i.find(".waiting"),n=i.find("iframe");setTimeout(function(){i.css("display","block"),n.css("visibility","visible").attr("src",e),t.css("display","none")},250)})};;
var EC;(e=>{var n,o;function s(e){var o=this;this.sessionKeepAliveAndValidateTimeoutInMilliSeconds=3e4,0<e.find("[data-requires-ssf-session-state]").length&&n.Ajax.getDataFromAction("SsfKeepSessionAlive","Init",null,null,null,{onSuccess:function(e){null!=e&&(o.sessionToken=e.SessionToken,n.Debug.logToConsole("SsfKeepSessionAlive with state validation - init - refresh time (sec): "+o.sessionKeepAliveAndValidateTimeoutInMilliSeconds),setTimeout(function(){return o.resetSessionExpirationAndValidate()},o.sessionKeepAliveAndValidateTimeoutInMilliSeconds))},onError:function(){n.Debug.logToConsole("SsfKeepSessionAlive - Error when call refresh from server. Stop polling.",!0)},useErrorWindow:!1,useWaitPanel:!1})}n=e.ServiceSelector||(e.ServiceSelector={}),s.prototype.resetSessionExpirationAndValidate=function(){var o=this;n.Ajax.getDataFromAction("SsfKeepSessionAlive","KeepAliveAndValidate",null,{previousSessionToken:this.sessionToken},null,{onSuccess:function(e){null==e||e.SessionExpired?o.showSessionExpiredPopup():(n.Debug.logToConsole("SsfKeepSessionAlive - response from server: "+e),n.Debug.logToConsole("SsfKeepSessionAlive - reset timer - refresh time (sec): "+o.sessionKeepAliveAndValidateTimeoutInMilliSeconds),setTimeout(function(){return o.resetSessionExpirationAndValidate()},o.sessionKeepAliveAndValidateTimeoutInMilliSeconds))},onError:function(){n.Debug.logToConsole("SsfKeepSessionAlive - Error when call refresh from server..",!0),o.showSessionExpiredPopup()},useErrorWindow:!1,useWaitPanel:!1})},s.prototype.showSessionExpiredPopup=function(){var e=$("body").append("<div id='"+s.popupPlaceHolderId+"'></div>");n.Ajax.sendDataToActionAndUpdate("SsfKeepSessionAlive","RenderWarningPopup",null,{divIdToUpdata:s.popupPlaceHolderId},null,{onSuccess:function(){e.find("[name='ssf-session-expired-reload']").click(function(){location.reload(!0)}),n.SppHelper.openModal("#"+s.popupPlaceHolderId)},onError:function(){location.reload(!0)}})},s.popupPlaceHolderId="ssf-session-expired-popup-placeholder",o=s,n.SsfKeepSessionAliveV2=o,$(function(){new o(jQuery(document))})})(EC=EC||{});;
var EC,__extends=this&&this.__extends||(()=>{var i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}))(t,e)};return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}})();(e=>{var r,t,o,n,a,i;function s(t,e,o,i){this.workflow=t,this.step=e,this.e2e=o,this.serviceOfferId=i}function l(t){this._map=t}function u(){for(var t=window.location.search.substr(1).split("&"),e={},o=0;o<t.length;o++){var i=t[o].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return a.call(this,e)||this}function h(t){this.settings=t}r=e.ServiceSelector||(e.ServiceSelector={}),t=r.SwitchBase||(r.SwitchBase={}),o={},n=function(t){return o[t]||(o[t]=$.parseJSON($(t).text()))},s.prototype.extendValidation=function(){$.validator.addMethod("nonumber",this.checkNoNumbers),$.validator.unobtrusive.adapters.addBool("nonumber"),$.validator.addMethod("autosuggest",this.checkAutosuggest),$.validator.unobtrusive.adapters.addBool("autosuggest"),$('[data-plugin="date-select"]').removeAttr("data-val-date");var t=document.getElementById("switch-form"),e=this.$form=$(t),t={options:{errorPlacement:$.proxy(this.errorPlacement,this),invalidHandler:$.proxy(this.invalidHandler,this),submitHandler:$.proxy(this.submitHandler,this),highlight:this.highlight,unhighlight:this.unhighlight,messages:{},rules:{}},attachValidation:function(){e.validate(this.options)},validate:function(){return e.validate(),e.valid()}};this.$form.removeData("validator"),this.$form.removeData("unobtrusiveValidation"),this.$form.data("unobtrusiveValidation",t),$.validator.unobtrusive.parse(this.$form),e.find(":submit").on("click",function(t){t.preventDefault(),e.submit()})},s.prototype.initComponents=function(){this.query=new i,this.$summary=this.$form.find("[data-valmsg-summary=true] > ul"),$('[data-selector="zipcode-autocomplete"]').each(this.initSingleAutoCompleteComponent),this.$submitSwitchForm=$("[data-selector='submit-light-switch-form']"),this.$authenticationTrigger=$('[data-selector="aline-authentication-trigger"]'),this.$authenticationTrigger.hide()},s.prototype.initSingleAutoCompleteComponent=function(t,e){var o=$(e),i=n(o.data("config")).fields["#"+o.attr("name")],r=$('[name="'+i.feed+'"]');o.blur(function(){var t=$.Event("keydown",{keyCode:$.ui.keyCode.ENTER});o.trigger(t)}).autocomplete({source:function(t,e){$.ajax({url:i.api,dataType:"json",data:{s:t.term},success:function(t){$.each(t,function(t,e){e.label=e.Zipcode+" "+e.City,e.value=e[i.use]}),e(t)}})},autoFocus:!0,select:function(t,e){e=e.item,o.attr("data-autocomplete-shouldbe",e.value),r.val(e[i["feed-with"]]),r.attr("data-autocomplete-shouldbe",e[i["feed-with"]]),r.valid()}})},s.prototype.errorPlacement=function(t,e){t.addClass("form__item__note form__item__note--error");var o=e.closest("div");e.is(":radio")?e.closest(".form__group__items").append(t):e.is(":checkbox")?e.next("label").append(t):o.hasClass("form__item form__item--inline")?o.nextAll(".jq_errorPlacement:eq(0)").empty().append(t):t.insertAfter(e)},s.prototype.invalidHandler=function(t,e){},s.prototype.highlight=function(t,e){$(t).closest("div.form__item").addClass("form__item--has-errors")},s.prototype.unhighlight=function(t,e){$(t).closest("div.form__item").removeClass("form__item--has-errors")},s.prototype.highlightGroup=function(t,e){var o=this;t.forEach(function(t){o.highlight(t.get(0),e)})},s.prototype.unhighlightGroup=function(t,e){var o=this;t.forEach(function(t){o.unhighlight(t.get(0),e)})},s.prototype.addLoadingAnimation=function(t){t.addClass("btn--waiting")},s.prototype.removeLoadingAnimation=function(t){t.removeClass("btn--waiting")},s.prototype.serialize=function(t){t=t.serializeArray();return $.each(t,function(t,e){if($("[name='"+e.name+"']").is("[data-selector='datepicker']"))try{var o=e.value.split("/");e.value=o[2]+"-"+o[1]+"-"+o[0]}catch(t){e.value=null}}),t},s.prototype.submitHandler=function(t){var e=this,o=this.serialize($(t)),i=t.action;r.Ajax.getData({url:i,type:t.method,data:o,traditional:!0},{onSuccess:function(t){t.errorFields?e.displayFieldErrors(t.errorFields):e.goToStep(++e.step)},onError:function(){$("#switch-form :input").prop("disabled",!0),$("#switch-form button").addClass("is-disabled"),$("#switch-form div.jq_serverError").show()},onValidationFailed:$.proxy(this.displayOtherErrors,this)})},s.prototype.displayOtherErrors=function(t){for(var e=0;e<t.length;e++)$("<li />").html(t[e]).appendTo(this.$summary);0<this.$summary.length&&$([document.documentElement,document.body]).animate({scrollTop:this.$summary.offset().top-$(window).height()/2},150)},s.prototype.displayFieldErrors=function(t){for(var e in t){var o=e+"-error",i=this.$form.find("[name='"+e+"']"),o=$('<div id="'+o+'" class="form__item__note--error-message form__item__note--error form__item__note">'+t[e]+"</div>");this.highlight(i.get(0),"form__item--has-errors"),this.errorPlacement(o,i)}},s.prototype.goToStep=function(t){e.ServiceSelector.WaitPanel.increment(),this.query.setParam("s",this.workflow[t]),this.query.setParam("e2e",this.e2e),this.query.setParam("serviceOfferId",this.serviceOfferId.toString()),window.location.search=this.query.build()},s.prototype.checkNoNumbers=function(t){return 0===t.length||/^[^0-9]*$/.test(t)},s.prototype.checkAutosuggest=function(t,e){var e=$(e);return!(0!==t.length&&!e.is(":focus"))||(e=e.attr("data-autocomplete-shouldbe"),t.toLowerCase()===e.toLowerCase())},t.SwitchFormBase=s,l.prototype.k=function(t){if(!this._map.hasOwnProperty(t))for(var e in this._map)if(e.toLowerCase()===t.toLowerCase())return e;return t},l.prototype.getParam=function(t){return this._map[this.k(t)]},l.prototype.remove=function(t){delete this._map[this.k(t)]},l.prototype.setParam=function(t,e){this._map[this.k(t)]=e},__extends(u,a=t.UnsensitiveMap=l),u.prototype.build=function(){var t,e=[];for(t in this._map)e.push(encodeURIComponent(t)+"="+encodeURIComponent(this._map[t]));return"?"+e.join("&")},i=u,t.UrlQuery=i,t.Tooltip=function(){$("[data-tooltip-trigger]").each(function(t,e){var e=$(e),o=e.attr("data-tooltip-trigger"),i=$("[data-tooltip='"+o+"']");e.click(function(t){t.preventDefault(),i.toggle()})})},h.prototype.start=function(){null!=this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout($.proxy(this.pool,this),1e3*this.settings.delay)},h.prototype.pool=function(){var t=this;r.Ajax.getDataFromAction(this.settings.poolingController,this.settings.poolingAction,"e2e="+this.settings.end2endProcessId+"&_="+(new Date).getTime(),null,{type:"GET",success:function(){t.start()}},{useErrorWindow:!1,useWaitPanel:!1})},t.SessionPooling=h})(EC=EC||{});;
