function SpinnerManager(){"use strict";function u(){i?o():c()}function f(){i?s():h()}function e(){var f=document.getElementById(t),i=!1,e="animation",o="",r="Webkit Moz O ms Khtml".split(" "),u="",n;if(f.style.animationName!==undefined&&(i=!0),i===!1)for(n=0;n<r.length;n++)if(f.style[r[n]+"AnimationName"]!==undefined){u=r[n];e=u+"Animation";o="-"+u.toLowerCase()+"-";i=!0;break}return i}function o(){$("#"+t).toggleClass("hide",!1)}function s(){$("#"+t).toggleClass("hide",!0)}function h(){n!=null&&n!=undefined&&n.stop()}function c(){var i=document.getElementById(r),t=getComputedStyle(i).getPropertyValue("color");($.isEmptyObject(t)||t.length==0)&&(t="#34b7db");$(".spinner").remove();n=new Spinner({color:t,lines:17,length:0,width:6,radius:8,corners:0,rotate:21,direction:1,speed:1.5,trail:100,shadow:!1,hwaccel:!0,className:"spinner",zIndex:2e9,top:"50%",left:"50%"}).spin(i)}var t="loadingIndicator",r="jsLoadingIndicator",n=null,i=e();this.startSpinner=u;this.stopSpinner=f}var QuestionType,PaymentStatus,ApplicantType,Constants,ValidationRule,app;(function(){"use strict";var n=angular.module("eform",["ui.router","ui.bootstrap","ui.bootstrap.datetimepicker","ngIdle","tmh.dynamicLocale","ngSanitize","lr.upload","uiGmapgoogle-maps"]),t=angular.element("#debugMode").val(),i=angular.element("#userId").val(),r=angular.element("#customerId").val();n.constant("config",{debugMode:t=="True",userId:i,customerId:r,supportsIdeal:angular.element("#supportsIdeal").val()=="True",supportsVisa:angular.element("#supportsVisa").val()=="True",supportsMasterCard:angular.element("#supportsMasterCard").val()=="True",supportsMaestro:angular.element("#supportsMaestro").val()=="True",staticMapApiKey:angular.element("#staticMapApiKey").val()});n.run(["cacheService","utilityService","healthMonitorService","$rootScope",function(n,t,i,r){r.ValidationRule=ValidationRule;jQuery.validator.addMethod("pattern",function(n,t,i){var r=new RegExp(i);return this.optional(t)||r.test(n)});var u=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;if(u)$("#mainContainer").on("click",function(){});$(window).on("beforeunload",function(){var r,u;return i.endSession(),r=null,n.CanPersist!=!0?r="Any filled information will be lost.":(u=$.Event("webapp:page:beforeunload"),$(window).trigger(u),u.isDefaultPrevented()&&(r=u.message)),t.isEmpty(r)==!1?r:void 0})}])})(),function(){"use strict";var n=angular.module("eform");n.value("config",{docTitle:"EFORMS",appVersion:"0.0.1",appErrorPrefix:"[EF Error]"});n.config(["datepickerConfig","datepickerPopupConfig","timepickerConfig",function(n,t,i){n.showWeeks=!1;n.startingDay=1;t.showButtonBar=!1;i.showMeridian=!1;i.readonlyInput=!0}]);n.config(["IdleProvider","KeepaliveProvider",function(n,t){n.idle(300);n.timeout(600);t.interval(300)}]);n.config(["uiGmapGoogleMapApiProvider",function(n){n.configure({key:"",v:"3.17",libraries:"geometry,visualization"})}])}(),function(){"use strict";function t(n){n.state("wizard",{abstract:!0,url:"/wizard",template:"<div><div ui-view><\/div><\/div>"}).state(Constants.WIZARD_STATE_INTRODUCTION,{url:"/introduction",templateUrl:"/eform/views/other/introduction.html",controller:"IntroductionController"}).state(Constants.WIZARD_STATE_QUESTION,{url:"/question",templateUrl:"/eform/views/question/question.html",controller:"QuestionsController"}).state(Constants.WIZARD_STATE_CONFIRMATION,{url:"/confirmation",templateUrl:"/eform/views/confirmation/confirmation.html",controller:"ConfirmationController"}).state(Constants.WIZARD_STATE_SUMMARY,{url:"/summary",templateUrl:"/eform/views/other/summary.html",controller:"SummaryController"}).state(Constants.WIZARD_STATE_REDIRECT,{url:"/redirect",controller:"RedirectController"})}var n=angular.module("eform");n.config(["$stateProvider",t])}(),function(){"use strict";function i(t){t.defaults.headers.common.__RequestVerificationToken=$("#__RequestVerificationToken").val();t.interceptors.push(["$q","$injector",function(t,i){var r;return{request:function(t){return n.startSpinner(),t},response:function(t){return r=r||i.get("$http"),r.pendingRequests.length<1&&n.stopSpinner(),t},responseError:function(u){return r=r||i.get("$http"),r.pendingRequests.length<1&&n.stopSpinner(),t.reject(u)}}}])}var t=angular.module("eform"),n=new SpinnerManager;t.config(["$httpProvider",i])}(),function(){"use strict";angular.module("tmh.dynamicLocale",[]).provider("tmhDynamicLocale",function(){function s(n,t,i){var r=document.createElement("script"),u=document.getElementsByTagName("body")[0];r.type="text/javascript";r.readyState?r.onreadystatechange=function(){(r.readyState==="complete"||r.readyState==="loaded")&&(r.onreadystatechange=null,i(t,30,!1))}:r.onload=function(){t()};r.src=n;r.async=!1;u.appendChild(r)}function o(r,f,e,o,h,c,l){function v(n,t){i===e&&angular.forEach(t,function(i,r){angular.isArray(t[r])||angular.isObject(t[r])?v(n[r],t[r]):n[r]=t[r]})}if(t[e])return t[e];var y,a=h.defer();return e===i?a.resolve(f):(y=c.get(e))?(i=e,o.$evalAsync(function(){v(f,y);o.$broadcast("$localeChangeSuccess",e,f);n.put(u,e);a.resolve(f)})):(i=e,t[e]=a.promise,s(r,function(){var r=angular.injector(["ngLocale"]),i=r.get("$locale");v(f,i);c.put(e,i);delete t[e];o.$apply(function(){o.$broadcast("$localeChangeSuccess",e,f);n.put(u,e);a.resolve(f)})},l)),a.promise}var f,r="/eform/scripts/localize/angular-locale_{{locale}}.js",e="tmhDynamicLocaleStorageCache",n,u="tmhDynamicLocale.locale",t={},i;this.localeLocationPattern=function(n){return n?(r=n,this):r};this.useStorage=function(n){e=n};this.useCookieStorage=function(){this.useStorage("$cookieStore")};this.defaultLocale=function(n){f=n};this.$get=["$rootScope","$injector","$interpolate","$locale","$q","tmhDynamicLocaleCache","$timeout",function(t,i,s,h,c,l,a){var v=s(r);return n=i.get(e),t.$evalAsync(function(){var i;(i=n.get(u)||f)&&o(v({locale:i}),h,i,t,c,l,a)}),{set:function(n){return o(v({locale:n}),h,n,t,c,l,a)}}}]}).provider("tmhDynamicLocaleCache",function(){this.$get=["$cacheFactory",function(n){return n("tmh.dynamicLocales")}]}).provider("tmhDynamicLocaleStorageCache",function(){this.$get=["$cacheFactory",function(n){return n("tmh.dynamicLocales.store")}]}).run(["tmhDynamicLocale",angular.noop])}(window),function(){"use strict";var n=angular.module("eform");n.factory("localize",["$http","$rootScope","$window","$filter",function(n,t,i,r){var u={language:i.navigator.userLanguage||i.navigator.language,dictionary:[],resourceFileLoaded:!1,successCallback:function(n){var i=$.parseXML(n),r=$(i),f=$(r).find("root").text(),e=jQuery.parseJSON(f);u.dictionary=e;u.resourceFileLoaded=!0;console.log("Resource file loaded");t.$broadcast("localizeResourcesUpdates")},initLocalizedResources:function(){var i="/eform/scripts/localize/resources-locale_"+t.currentLanguage+".xml";return n({method:"GET",url:i,cache:!1}).success(u.successCallback).error(function(){n({method:"GET",url:"/eform/scripts/localize/resources-locale_nl-NL.xml",cache:!1}).success(u.successCallback)})},getLocalizedString:function(n){var t="",i;try{n&&n!=""&&u.dictionary!==[]&&u.dictionary.length>0&&(i=r("filter")(u.dictionary,function(t){return t.key===n})[0],t=i.value)}catch(f){console.log(f)}return t}};return u}]).filter("i18n",["localize",function(n){return function(t){return n.getLocalizedString(t)}}]).directive("i18n",["localize",function(n){var t={restrict:"EAC",updateText:function(t,i){var u=i.split("|"),r,f,e;if(u.length>=1&&(r=n.getLocalizedString(u[0]),r!==null&&r!==undefined&&r!=="")){if(u.length>1)for(f=1;f<u.length;f++)e="{"+(f-1)+"}",r=r.replace(e,u[f]);t.text(r)}},link:function(n,i,r){n.$on("localizeResourcesUpdates",function(){t.updateText(i,r.i18n)});r.$observe("i18n",function(){t.updateText(i,r.i18n)})}};return t}]).directive("i18nAttr",["localize",function(n){var t={restrict:"EAC",updateText:function(t,i){var u=i.split("|"),r=n.getLocalizedString(u[0]),f,e;if(r!==null&&r!==undefined&&r!==""){if(u.length>2)for(f=2;f<u.length;f++)e="{"+(f-2)+"}",r=r.replace(e,u[f]);t.attr(u[1],r)}},link:function(i,r,u){i.$on("localizeResourcesUpdated",function(){t.updateText(r,u.i18nAttr)});n.resourceFileLoaded&&t.updateText(r,u.i18nAttr);u.$observe("i18nAttr",function(n){t.updateText(r,n)})}};return t}])}();var Guid=function(){function n(){}return n.createGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=Math.random()*16|0,i=n=="x"?t:t&3|8;return i.toString(16)})},n.empty="00000000-0000-0000-0000-000000000000",n}(),WizardStep=function(){function n(n,t,i){this.Name=null;this.Previous=null;this.Next=null;this.Name=n;this.Previous=t;this.Next=i}return n}(),Eform=function(){function n(){this.ApplicantType=null;this.CurrentLanguage=null;this.Questions=null;this.Citizen=null;this.Company=null;this.PaymentDetails=null;this.DraftId=null;this.SessionId=null}return n}(),PersonInfo=function(){function n(){this.CitizenServiceNumber=null;this.LegalIdentifier=null;this.Initials=null;this.FirstName=null;this.Prefix=null;this.LastName=null;this.Name=null;this.DateOfBirth=null;this.Sex=null;this.Address=null;this.IntAddress=null;this.Country=null;this.PhoneNumber=null;this.EmailAddress=null;this.BankAccountNumber=null;this.BankAccountName=null;this.Relation=null;this.RelationshipType=null}return n}(),CompanyInfo=function(){function n(){this.CompanyName=null;this.LegalIdentifier=null;this.TradeRegistrationNumber=null;this.ChamberOfCommerceSubNumber=null;this.PersonName=null;this.PersonFunction=null;this.PhoneNumber=null;this.EmailAddress=null;this.VisitingAddress=null;this.MailingZipCode=null;this.MailingAddress=null;this.MailingCity=null;this.IntAddress=null;this.BankAccountNumber=null;this.BankAccountName=null}return n}(),IntAddress=function(){function n(){this.AddressLine1=null;this.AddressLine2=null;this.AddressLine3=null;this.Country=null}return n}(),WizardStepStatus;(function(n){n[n.Unvisited=1]="Unvisited";n[n.Active=2]="Active";n[n.Visited=3]="Visited"})(WizardStepStatus||(WizardStepStatus={})),function(n){n[n.Text=0]="Text";n[n.Paragraph=1]="Paragraph";n[n.Date=2]="Date";n[n.Dropdown=3]="Dropdown";n[n.Checkbox=4]="Checkbox";n[n.RadioButton=5]="RadioButton";n[n.File=6]="File";n[n.Header=7]="Header";n[n.Map=8]="Map";n[n.PersonInfo=9]="PersonInfo";n[n.Decision=10]="Decision";n[n.Payment=11]="Payment";n[n.CompanyInfo=12]="CompanyInfo";n[n.Number=13]="Number";n[n.RelatedPersons=14]="RelatedPersons";n[n.Address=15]="Address"}(QuestionType||(QuestionType={})),function(n){n[n.Authorized=5]="Authorized";n[n.Accepted=9]="Accepted";n[n.PendingAcceptance1=51]="PendingAcceptance1";n[n.PendingAcceptance2=91]="PendingAcceptance2";n[n.Exception1=52]="Exception1";n[n.Exception2=92]="Exception2";n[n.Cancel=1]="Cancel";n[n.Decline=2]="Decline"}(PaymentStatus||(PaymentStatus={})),function(n){n[n.Anonymous=0]="Anonymous";n[n.Citizen=1]="Citizen";n[n.Company=2]="Company";n[n.Eidas_Citizen=3]="Eidas_Citizen";n[n.Eidas_Company=4]="Eidas_Company"}(ApplicantType||(ApplicantType={}));Constants=function(){function n(){}return n.WIZARD_STATE_INTRODUCTION="wizard.introduction",n.WIZARD_STATE_QUESTION="wizard.question",n.WIZARD_STATE_CONFIRMATION="wizard.confirmation",n.WIZARD_STATE_SUMMARY="wizard.summary",n.WIZARD_STATE_REDIRECT="wizard.redirect",n.NETHERLANDS_DUTCH="Nederland",n.MUNICIPALITY_FOREIGN="1999",n.PERSON_RELATIONS={PARTNER:"NPSNPSHUW",CHILD:"NPSNPSKND",PARENT:"NPSNPSOUD"},n.CITIZEN_VALIDATION_IDS={VALID:"VALID",PERSON_DEAD:"PERSON_DEAD",UNDER_GUARDIANSHIP:"UNDER_GUARDIANSHIP",INVALID_AGE:"INVALID_AGE",INVALID_COUNTRY:"INVALID_COUNTRY",INVALID_MUNICIPALITY:"INVALID_MUNICIPALITY"},n.GUID_EMPTY="00000000-0000-0000-0000-000000000000",n.Countries=["Afghanistan","Albanië","Algerije","Amerikaanse Maagdeneilanden","Amerikaans-Samoa","Andorra","Angola","Anguilla","Antigua en Barbuda","Argentinië","Armenië","Aruba","Ascension","Australië","Azerbeidzjan","Azoren","Bahama's","Bahrein","Bangladesh","Barbados","Belarus","België","Belize","Benin","Bermuda","Bhutan","Bolivia","Bonaire","Bondsrepubliek Duitsland","Bosnië-Herzegovina","Botswana","Brazilië","Brits Antarctisch Territorium","Brits Indische Oceaanterritorium","Britse Maagdeneilanden","Brunei","Bulgarije","Burkina Faso","Burundi","Cambodja","Canada","Canarische Eilanden","Caymaneilanden","Centraal-Afrikaanse Republiek","Chili","China","Christmaseiland","Cocoseilanden","Colombia","Comoren","Congo","Cookeilanden","Costa Rica","Cuba","Curaçao","Cyprus","Democratische Republiek Congo","Denemarken","Djibouti","Dominica","Dominicaanse Republiek","Ecuador","Egypte","El Salvador","Equatoriaal-Guinea","Eritrea","Estland","Ethiopië","Faeröer","Falklandeilanden","Fiji","Filipijnen","Finland","Frankrijk","Frans-Guyana","Frans-Polynesië","Gabon","Gambia","Georgië","Ghana","Gibraltar","Grenada","Griekenland","Groenland","Groot-Brittannië","Guadeloupe","Guam","Guatemala","Guinee","Guinee-Bissau","Guyana","Haïti","Honduras","Hongarije","Ierland","IJsland","India","Indonesië","Internationaal gebied","Irak","Iran","Israël","Italië","Ivoorkust","Jamaica","Japan","Jemen","Johnston","Jordanië","Kaapverdië","Kameroen","Kanaaleilanden","Kazachstan","Kenya","Kirgizië","Kiribati","Koeweit","Kosovo","Kroatië","Laos","Lesotho","Letland","Libanon","Liberia","Libië","Liechtenstein","Litouwen","Luxemburg","Macedonië","Madagaskar","Madeira-eilanden","Malawi","Maldiven","Maleisië","Mali","Malta","Man","Marianen","Marokko","Marshalleilanden","Martinique","Mauritanië","Mauritius","Mayotte","Mexico","Micronesia","Midway","Moldavië","Monaco","Mongolië","Montenegro","Montserrat","Mozambique","Myanmar","Namibië","Nauru","Nederland","Nepal","Nicaragua","Nieuw-Caledonië","Nieuw-Zeeland","Niger","Nigeria","Niue","Noord-Korea","Noorwegen","Norfolk","Oekraïne","Oezbekistan","Oman","Onbekend","Oostenrijk","Pakistan","Palau","Panama","Panamakanaalzone","Papoea-Nieuw-Guinea","Paraguay","Peru","Pitcairneilanden","Polen","Portugal","Puerto Rico","Qatar","Réunion","Roemenië","Rusland","Rwanda","Saba","Saint Kitts en Nevis","Saint Lucia","Saint Pierre en Miquelon","Saint Vincent en de Grenadines","Salomonseilanden","Samoa","San Marino","São Tomé en Principe","Saoedi-Arabië","Senegal","Servië","Seychellen","Sierra Leone","Singapore","Sint Eustatius","Sint Maarten","Sint-Helena","Slovenië","Slowakije","Soedan","Somalië","Spanje","Sri Lanka","Suriname","Svalbardeilanden","Swaziland","Syrië","Tadzjikistan","Taiwan","Tanzania","Thailand","Tibet","Timor Leste","Togo","Tokelau","Tonga","Trinidad en Tobago","Tristan Da Cunha","Tsjaad","Tsjechië","Tunesië","Turkije","Turkmenistan","Turks- en Caicoseilanden","Tuvalu","Uganda","Uruguay","Vanuatu","Vaticaanstad","Venezuela","Verenigde Arabische Emiraten","Verenigde Staten van Amerika","Vietnam","Wake","Wallis en Futuna","Westelijke Sahara","Zambia","Zimbabwe","Zuid-Afrika","Zuid-Korea","Zuid-Soedan","Zweden","Zwitserland"],n.BanksProduction=[{Name:"ABN AMRO",IssuerId:"ABNANL2A"},{Name:"Rabobank",IssuerId:"RABONL2U"},{Name:"ING",IssuerId:"INGBNL2A"},{Name:"SNS Bank",IssuerId:"SNSBNL2A"},{Name:"Regio Bank",IssuerId:"RBRBNL21"},{Name:"ASN Bank",IssuerId:"ASNBNL21"},{Name:"Bunq",IssuerId:"BUNQNL2A"},{Name:"Triodos Bank",IssuerId:"TRIONL2U"},{Name:"van Lanschot Bankiers",IssuerId:"FVLBNL22"},{Name:"Knab bank",IssuerId:"KNABNL2H"},],n.BanksTest=[{Name:"iDEAL simulator",IssuerId:"9999%2BTST"}],n.PaymentMethods={None:{PM:"",BRAND:""},iDEAL:{PM:"iDEAL",BRAND:"iDEAL"},Visa:{PM:"CreditCard",BRAND:"VISA"},MasterCard:{PM:"CreditCard",BRAND:"MasterCard"},Maestro:{PM:"CreditCard",BRAND:"Maestro"}},n}(),function(n){n[n.None=0]="None";n[n.Custom=1]="Custom";n[n.EmailAddress=2]="EmailAddress";n[n.PhoneNumber=3]="PhoneNumber";n[n.PostalCodeNL=4]="PostalCodeNL";n[n.WebsiteAddress=5]="WebsiteAddress";n[n.CitizenServiceNumber=6]="CitizenServiceNumber"}(ValidationRule||(ValidationRule={})),function(){"use strict";var n=angular.module("eform");n.factory("addressService",["$q","dataService","utilityService","healthMonitorService",function(n,t,i,r){function o(f,e,o,h,c){var a=n.defer(),v=s(f,e);return v!=null?i.isEmpty(u)||l(u.ZipCode,f)==!1||u.HouseNumber!=e||u.HouseLetter!=o||u.HouseNumberAddition!=h?t.getAddress(v,o,h,c).success(function(n){n.isAddressPrefilled=!0;r.trackEvent("PrefillAddress");a.resolve(n);u=n}).error(function(n,t){switch(t){case 403:n.error="NewAddressIncorrect";n.isAddressPrefilled=!0;r.trackEvent("PrefillAddress","Wrong municipality");break;case 404:n.warningMessage="NEW_ADDRESS_NOT_FOUND";n.isAddressPrefilled=!1;r.trackEvent("PrefillAddressError",t);break;case 409:n.warningMessage="NEW_ADDRESS_NOT_RESIDENCE";n.isAddressPrefilled=!0;r.trackEvent("PrefillAddress","Not a residence");break;default:if(r.trackEvent("PrefillAddressError",t),n==null){a.reject(n);return}}a.resolve(n);u=n}):(u.sameAsLast=!0,a.resolve(u)):a.reject(null),a.promise}function s(n,t){var r=h(n),u=c(t),i=null;return r&&(e(n).length>6?i=n:u&&(i=n+t)),i}function h(n){var t=!1;return i.isEmpty(n)==!1&&(t=/(^[1-9][0-9]{3}\s*[a-zA-Z]{2}(\s*([0]*[1-9][0-9]{0,3}\s*([a-zA-Z]*([\s-]+[a-zA-Z0-9]+)?)))?$)|^$/.test(n)),t}function c(n){var t=!1;return i.isEmpty(n)==!1&&(t=/(^[0]*[1-9][0-9]{0,3}\s*(([a-zA-Z]+\s*.*)|([a-zA-Z]*))$)|^$/.test(n)),t}function l(n,t){return e(n).toUpperCase()==e(t).toUpperCase()}function e(n){var t="";return n!=null&&(t=n.replace(" ","")),t}var f={},u;return f.PrefillAddress=o,f.PrefillMunicipalityCode=function(i){var r=n.defer();return i||r.reject(null),t.getMunicipalityCodeFromAddress(i).success(function(n){r.resolve(n)}).error(function(){r.reject(null)}),r.promise},f}])}(),function(){"use strict";var n=angular.module("eform");n.factory("applicantService",["$rootScope","$q","$state","$timeout","utilityService","dataService","cacheService","healthMonitorService",function(n,t,i,r,u,f,e,o){function k(n,i,r){var f=t.defer(),u=i?null:e.Get(h,!0);return n?u&&u.IsPrefill?f.resolve(u):tt(i,r).then(function(n){i?n.IsSigned=!0:n.IsPrefill==!0&&v(n);u=n;f.resolve(u)}):f.resolve(u),f.promise}function v(n){e.Put(h,n)}function d(n){var r=t.defer(),i=e.Get(a,!0);return n?i&&i.IsPrefill?r.resolve(i):it().then(function(n){n.IsPrefill==!0&&y(n);i=n;r.resolve(i)}):r.resolve(i),r.promise}function y(n){e.Put(a,n)}function g(){var n=t.defer(),i=e.Get(c,null);return u.isNullOrUndefined(i)?f.getAuthenticatedUser().success(function(t){o.trackEvent("GetAuthenticatedUser",t!=null?t.Type:null);p(t);nt(t);n.resolve(t)}).error(function(t,i){o.trackEvent("GetAuthenticatedUserError",i);n.resolve(!1)}):n.resolve(i),n.promise}function p(n){s.AuthenticatedUser=n;e.Put(c,n,!1)}function w(){return e.Get(l)}function nt(n){var t=w(),i;t&&t.Id||(i=n.CitizenServiceNumber||n.TradeRegistrationNumber||n.LegalIdentifier,t={Id:i,Type:n.Type},b(t))}function b(n){e.Put(l,n)}function tt(n,i){var e=t.defer(),c=n?i:s.AuthenticatedUser.CitizenServiceNumber,u={CitizenServiceNumber:c,IsPrefill:!1,PrefillStatus:"UNSUCCESSFUL"},h=r(function(){console.log("Timed out");e.resolve(u)},1e4);return f.getCitizen(n,i).success(function(t){t.PrefillStatus="SUCCESSFUL";r.cancel(h);o.trackEvent(n?"PrefillCitizen2":"PrefillCitizen");e.resolve(t)}).error(function(t,i){u=t;u.IsPrefill=!1;u.PrefillStatus=i==404?"NOT_FOUND":"UNSUCCESSFUL";r.cancel(h);o.trackEvent(n?"PrefillCitizen2Error":"PrefillCitizenError",i);e.resolve(u)}),e.promise}function it(){var i=t.defer(),n={TradeRegistrationNumber:s.AuthenticatedUser.TradeRegistrationNumber,IsPrefill:!1,PrefillStatus:"UNSUCCESSFUL"},u=r(function(){console.log("Timed out");i.resolve(n)},1e4);return f.getCompany().success(function(n){n.PrefillStatus="SUCCESSFUL";r.cancel(u);o.trackEvent("PrefillCompany");i.resolve(n)}).error(function(t,f){n=t;n.IsPrefill=!1;n.PrefillStatus=f==404?"NOT_FOUND":"UNSUCCESSFUL";r.cancel(u);o.trackEvent("PrefillCompanyError",f);i.resolve(n)}),i.promise}var s={},h="CITIZEN",c="AUTHENTICATED_USER",l="PREVIOUS_AUTHENTICATED_USER",a="COMPANY";return s.AuthenticatedUser,s.GetCitizen=k,s.SetCitizen=v,s.GetCompany=d,s.SetCompany=y,s.GetAuthenticatedUser=g,s.SetAuthenticatedUser=p,s.GetLastAuthenticatedUser=w,s.SetLastAuthenticatedUser=b,s}])}(),function(){"use strict";var n=angular.module("eform");n.factory("cacheService",["$cacheFactory","utilityService","webStorageService",function(n,t,i){function f(n){var i=n;return t.isNullOrUndefined(r.CacheKeySuffix)||(i=i+"_"+r.CacheKeySuffix),i}function e(){return i.Get()}var r={},u=n("eformCache");return r.CanPersist=i.IsStorageSupported,r.CacheKeySuffix,r.GetStorageObject=e,r.Put=function(n,t,r,e){n=e?n:f(n);t=t===undefined?null:t;u.put(n,t);r!=!1&&i.Put(n,JSON.stringify(t))},r.Get=function(n,r){var e;return r!=!1&&(n=f(n),e=u.get(n),t.isNullOrUndefined(e)&&(e=JSON.parse(i.Get(n)))),e},r}])}(),function(){"use strict";var n=angular.module("eform");n.factory("commonService",["$q","utilityService","dataService","cacheService","applicantService","questionService",function(n,t,i,r,u,f){function w(){var n=r.Get(a,e.eformStateInfo);n&&(e.eformStateInfo=n)}function v(n,i){if(!t.isEmpty(n)&&!t.isEmpty(i)){for(var u=0;u<n.length;u++)e.eformStateInfo[n[u]]=i[u];r.Put(a,e.eformStateInfo)}}function b(t){var u=n.defer(),f=r.Get(h,t);return f||t?u.resolve(f):i.getCaseType().success(function(n){y(n);u.resolve(n)}).error(function(n){u.reject(n)}),u.promise}function y(n){r.Put(h,n,!1)}function k(){return r.Get(o,null)}function d(n,t){r.Put(o,t)}function g(){return r.Get(c,null)}function nt(n){r.Put(c,n)}function tt(){return r.Get(l,null)}function it(n){r.Put(l,n)}function rt(){var n,t,i,e;u.SetCitizen(null);u.SetCompany(null);u.SetLastAuthenticatedUser(null);f.SetQuestions(null);f.SetAnsweredQuestions(null);r.Put(p,null);r.Put(o,null);r.Put(s,null);n=["applicantType","checkRequiredFields","paymentQuestionCount","paymentAmount","paymentPageTitle","caseTypeVersion","isContinueButtonVisible"];t=[0,"true",0,0,null,null,!0];v(n,t);i=["StartQuestionIndex","HasSmartQuestion","HasSkipQuestion","HasPaymentQuestion","relatedPersons"];e=[0,!1,!1,!1,{indexes:[],list:null,assigned:!1}];f.UpdateQuestionStateInfo(i,e)}function ut(){return i.keepAlive()}var e={},h="CASE_TYPE",o="DRAFT_ID",c="EFORM_RESULT",l="PAYMENT_RESPONSE",a="EFORM_STATE",p="CURRENT_ROUTE_STATE",o="DRAFT_ID",s="SESSION_ID";return e.eformStateInfo={applicantType:0,checkRequiredFields:"true",paymentQuestionCount:0,paymentAmount:0,paymentPageTitle:null,caseTypeVersion:null,isContinueButtonVisible:!0},e.Initialize=w,e.UpdateEformStateInfo=v,e.GetCaseType=b,e.SetCaseType=y,e.GetDraftId=k,e.SetDraftId=d,e.GetEformResult=g,e.SetEformResult=nt,e.GetPaymentResponse=tt,e.SetPaymentResponse=it,e.ResetCache=rt,e.KeepAlive=ut,e.GetSessionId=function(){var n=r.Get(s,null);return n||(n=Guid.createGuid(),r.Put(s,n),console.info("started new session with id %s",n)),console.debug("using session id %s",n),n},e}])}(),function(){"use strict";var n=angular.module("eform");n.factory("configuration",["$q","dataService",function(n,t){function f(){t.getAllowedFileExtensions().success(function(n){i.AllowedFileTypes=n.split("|")})}function u(){var i=n.defer();return r?i.resolve(r):t.getDefaultMapLocation().then(function(n){r=n.data;i.resolve(r)},function(n){i.reject(n)}),i.promise}var i={},r=null;return i.AllowedFileTypes=null,i.MaxFileSizeLimit=20971520,i.getDefaultMapLocation=u,i.Initialize=function(){f();u()},i}])}(),function(){"use strict";var n=angular.module("eform");n.factory("dataService",["$http","$q","utilityService",function(n,t,i){function u(){var n,u,t,f;if(i.isNullOrUndefined(r.webApiUrl)){for(n=window.location.pathname.split("/"),n=n.filter(Boolean),u=n[0],t=0;t<n.length;t++)if(u=u+"/"+n[t+1],n[t]=="formulieren"||n[t]=="draft")break;f="https://"+window.location.host;r.webApiUrl=f+"/"+u;window.location.pathname.indexOf("voorbeeld")>-1&&(r.webApiUrl+="/voorbeeld");r.webApiUrl+="/EFORM/API"}return r.webApiUrl}var r={};return r.webApiUrl=u(),r.initialize=function(){r.webApiUrl=u()},r.keepAlive=function(){return n({method:"POST",url:r.webApiUrl+"/Common/KeepAlive"})},r.getAuthenticatedUser=function(){return n({method:"GET",url:r.webApiUrl+"/Common/GetAuthenticatedUser"})},r.getAllowedFileExtensions=function(){return n({method:"GET",url:r.webApiUrl+"/Common/GetAllowedFileExtensions"})},r.getDefaultMapLocation=function(){return n({method:"GET",url:r.webApiUrl+"/Common/GetDefaultMapLocation"})},r.getCaseType=function(){return n({method:"GET",url:r.webApiUrl+"/Common/GetCaseType"})},r.getCitizen=function(t,i){return n({method:"GET",url:r.webApiUrl+"/Person/GetCitizen",params:{isSecondary:t,secondaryBsn:i}})},r.getRelatedPersons=function(){return n({method:"GET",url:r.webApiUrl+"/Person/GetRelatedPersons"})},r.getCompany=function(){return n({method:"GET",url:r.webApiUrl+"/Company/GetCompany"})},r.getQuestions=function(){return n({method:"GET",url:r.webApiUrl+"/Question/GetQuestions"})},r.saveEformDraft=function(t){return n({method:"POST",url:r.webApiUrl+"/Common/SaveEformDraft",data:t})},r.getEformDraftMessage=function(t){return n({method:"POST",url:r.webApiUrl+"/Common/GetEformDraftMessage",params:{draftId:t}})},r.getUserProfileValues=function(){return n({method:"GET",url:r.webApiUrl+"/Question/GetUserProfileValues"})},r.saveEform=function(t){return n({method:"POST",url:r.webApiUrl+"/Common/SaveEform",data:t})},r.uploadFiles=function(t,i,r){var u=new FormData;return angular.forEach(t,function(n){u.append("file",n)}),u.append("DocumentId",i),u.append("SessionId",r),n.post("https://"+window.location.host+"/FileUploader.ashx",u,{transformRequest:angular.identity,headers:{"Content-Type":undefined},data:{model:t}})},r.removeUploadedFile=function(t){return n({method:"POST",url:r.webApiUrl+"/Question/RemoveUploadedFile",params:{fileName:t}})},r.getAddress=function(t,i,u,f){return n({method:"GET",url:r.webApiUrl+"/Common/GetAddress",params:{postalCode:t,houseLetter:i,houseNumberAddition:u,toGetFromBag:f}})},r.getMunicipalityCodeFromAddress=function(t){return n({method:"GET",url:r.webApiUrl+"/Common/GetMunicipalityCodeFromAddress",params:{city:t}})},r.submitEformForPayment=function(t){return n({method:"POST",url:r.webApiUrl+"/Common/SubmitEformForPayment",data:t})},r.processAfterPayment=function(t){return n({method:"POST",url:r.webApiUrl+"/Common/ProcessAfterPayment",data:t})},r.getConfirmationPdfSize=function(t,i){return n({method:"GET",cache:!1,url:r.webApiUrl+"/Common/GetConfirmationPdfSize",params:{correlationID:t,pdfFileName:i}})},r.getDownloadFileToken=function(t,i){return n({method:"GET",url:r.webApiUrl+"/Common/GetDownloadFileToken",params:{correlationId:t,pdfFileName:i}})},r}])}(),function(){"use strict";var n=angular.module("eform");n.factory("healthMonitorService",["$window","config",function(n,t){var r=function(){function t(n){this.healthMon=n}return Object.defineProperty(t.prototype,"Matomo",{get:function(){return n._paq},enumerable:!1,configurable:!0}),t.prototype.trackPageView=function(n,t,r){i&&(r=r||this.pageLoadDuration(),i.trackPageView(n,t,r));this.Matomo&&this.Matomo.push(["trackPageView"])},t.prototype.trackEvent=function(n,t,r){if(t!==null&&typeof t!="string"&&(t=JSON.stringify(t)),i&&i.trackEvent(n,t,r),this.Matomo){var u=angular.element("#eventCategory").val()||"Eform";this.Matomo.push(["trackEvent",u,n,t])}},t.prototype.updateSession=function(){i&&i.updateSession()},t.prototype.endSession=function(){i&&i.endSession()},t.prototype.setUserId=function(n){i&&i.setUserId(n);this.Matomo&&this.Matomo.push(["setUserId",n])},t.prototype.pageLoadDuration=function(){return window.performance&&window.performance.timing&&window.performance.navigation&&window.performance.navigation.type==window.performance.navigation.TYPE_NAVIGATE?(window.performance.timing.loadEventStart-window.performance.timing.navigationStart)/1e3:null},t}(),u=t.debugMode||!1,f=t.userId||null,e=t.customerId||null,i;return typeof n.getDecosHealthMonitor=="function"&&(i=n.getDecosHealthMonitor(n.Decos.Health.ProductName.PIP,e,f,!1,u)),new r(i)}])}(),function(){"use strict";var n=angular.module("eform");n.factory("Language",["$rootScope","localize","tmhDynamicLocale",function(n,t,i){function u(){var n=$("#hLanguage").val();n=n?n:"nl";f(n)}function f(i){n.currentLanguage=i;t.initLocalizedResources();e(i)}function e(n){i.set(n.toLowerCase())}var r={};return r.Initialize=u,r}])}(),function(){"use strict";var n=angular.module("eform");n.factory("logService",["$filter",function(n){var t={};return t.console={log:function(t){window!=undefined&&window.console!=undefined&&(t=n("date")(new Date,"HH:mm:ss:sss")+" "+t,window.console.debug?window.console.debug(t):window.console.log?window.console.log(t):window.console.error&&window.console.error(t))}},t}])}(),function(){"use strict";var n=angular.module("eform");n.factory("questionService",["$q","$filter","$timeout","localize","utilityService","dataService","cacheService",function(n,t,i,r,u,f,e){function p(){var n=ot();n&&(o.QuestionStateInfo=n)}function g(){var t=n.defer(),i;return o.QuestionStateInfo.relatedPersons.list==null||o.QuestionStateInfo.relatedPersons.list.length==0?(i=e.Get(d,null),i&&i.Type==ApplicantType.Citizen?f.getRelatedPersons().success(function(n){if(n&&n.length>0){var i=[];n.forEach(function(n){var f=u.joinArray([n.FirstName,n.Prefix,n.LastName]," "),e=u.formatDate(new Date(n.DateOfBirth),"-"),t;n.Relation==Constants.PERSON_RELATIONS.PARTNER?t=r.getLocalizedString("_PARTNER_"):n.Relation==Constants.PERSON_RELATIONS.CHILD?t=r.getLocalizedString("_CHILD_"):n.Relation==Constants.PERSON_RELATIONS.PARENT&&(t=r.getLocalizedString("_PARENT_"));i.push({bsn:n.CitizenServiceNumber,displayValue:u.joinArray([f,e,t],", "),dateOfBirth:n.DateOfBirth,relation:n.RelationshipType})});o.QuestionStateInfo.relatedPersons.list=i;s()}else o.QuestionStateInfo.relatedPersons.list=[],s();t.resolve()}).error(function(){o.QuestionStateInfo.relatedPersons.list=null;s();t.resolve()}):t.resolve()):t.resolve(),t.promise}function nt(t){var i=n.defer(),r=e.Get(h,t);return r||t?(b(r),i.resolve(r)):f.getQuestions().success(function(n){st(n);b(n);i.resolve(n)}).error(function(n){i.reject(n)}),i.promise}function tt(t){var i=n.defer(),r=e.Get(y,t);return r||t?i.resolve(r):f.getUserProfileValues().success(function(n){e.Put(y,n,!1);i.resolve(n)}).error(function(n){i.reject(n)}),i.promise}function it(t){var r=n.defer(),i=e.Get(c,t),u,f;return i||t?r.resolve(i):(u=nt(t),f=tt(t),n.all([u,f]).then(function(n){var u=n[0],t=n[1];i=rt(u,t);t.length>0&&e.Put(c,i,!1);r.resolve(i)},function(n){r.reject(n)})),r.promise}function rt(n,t){return t&&n.forEach(function(n){var r=n.ExtraProperties.ProfileDataKey,i;r&&(i=t[r],i&&(n.QuestionType==QuestionType.Number&&(i=+i,isNaN(i)&&(i="")),n.Answer=i,n.Answers=[{Value:i}]))}),n}function w(n){e.Put(h,n)}function ut(n,t){if(p(),!u.isEmpty(n)&&!u.isEmpty(t)){for(var i=0;i<n.length;i++)o.QuestionStateInfo[n[i]]=t[i];s()}}function ft(){return e.Get(a,null)}function et(n){e.Put(a,n)}function ot(){return e.Get(v,null)}function s(){e.Put(v,o.QuestionStateInfo)}function b(n){if(!o.QuestionStateInfo.relatedPersons.assigned&&o.QuestionStateInfo.relatedPersons.list&&o.QuestionStateInfo.relatedPersons.list.length>0){var t=o.QuestionStateInfo.relatedPersons.indexes;t&&t.length>0&&(t.forEach(function(t){n[t].RelatedPersons=o.QuestionStateInfo.relatedPersons.list}),o.QuestionStateInfo.relatedPersons.assigned=!0,w(n))}}function st(n){var i=0,t=1,r=[];n.forEach(function(n){n.Index=i;i++;ht(n);ct(n);n.QuestionType==QuestionType.Date?lt(n):n.QuestionType==QuestionType.PersonInfo?at(n):o.QuestionStateInfo.HasSmartQuestion||n.QuestionType!=QuestionType.Decision?n.QuestionType==QuestionType.Payment?(n.Answer=n.ExtraProperties.PaymentDetails.Amount,o.QuestionStateInfo.HasPaymentQuestion=!0,s()):n.QuestionType==QuestionType.RelatedPersons&&(r.push(n.Index),vt(n)):(o.QuestionStateInfo.HasSmartQuestion=!0,s());t=yt(n,t);!o.QuestionStateInfo.HasSkipQuestion&&n.QuestionType!=QuestionType.Decision&&n.ExtraProperties.SkipToQuestionId&&(o.QuestionStateInfo.HasSkipQuestion=!0,s())});o.QuestionStateInfo.MaxNumberOfQuestions=t-1;o.QuestionStateInfo.relatedPersons.indexes=r;s()}function ht(n){var t,i;n.PropertyTable&&n.PropertyTable.PropertyTableValues!=null&&(n.FixedAnswer=null,n.ExtraProperties.AllowOtherValues&&(t=n.PropertyTable.PropertyTableValues.length-1,n.PropertyTable.PropertyTableValues[t].Id!="CustomAnswerOption"&&(i={Id:"CustomAnswerOption",Value:r.getLocalizedString("_OTHER_")},n.PropertyTable.PropertyTableValues.push(i))))}function ct(n){if(n.QuestionType==QuestionType.Text||n.QuestionType==QuestionType.Number)n.Answers=[{Value:""}];else if(n.QuestionType==QuestionType.Date)n.Answers=n.ExtraProperties.DateSettings&&n.ExtraProperties.DateSettings.PeriodType?[{StartDate:"",EndDate:""}]:[{Date:""}];else if(n.QuestionType==QuestionType.PersonInfo||n.QuestionType==QuestionType.CompanyInfo){var t=n.QuestionType==QuestionType.PersonInfo?new PersonInfo:new CompanyInfo;n.InfoList=[];n.InfoList.push(t);n.IsAnswered=!1}}function lt(n){var i,u,o,f,s,e,h,t;n.ExtraProperties.DateSettings&&(n.ExtraProperties.DateSettings.FromRestrictions&&(t=n.ExtraProperties.DateSettings.FromRestrictions,t.Enable&&(i=k(t.Number,t.Span,t.Reference)),f=t.ToAllowOtherDates,s=t.ValidationMessage),n.ExtraProperties.DateSettings.UntilRestrictions&&(t=n.ExtraProperties.DateSettings.UntilRestrictions,t.Enable&&(u=k(t.Number,t.Span,t.Reference)),e=t.ToAllowOtherDates,h=t.ValidationMessage),o=wt(i,u,f,e),i=i||new Date(1e3,0,1),u=u||new Date(9999,11,31),n.dateRestrictions={minDate:i,maxDate:u,restrictionMessage:o,toAllowOtherMinDates:f,allowOtherMinDatesMessage:s||r.getLocalizedString("_VALIDATION_MESSAGE_DATE_RESTRICTION_"),toAllowOtherMaxDates:e,allowOtherMaxDatesMessage:h||r.getLocalizedString("_VALIDATION_MESSAGE_DATE_RESTRICTION_")})}function at(n){n.ExtraProperties.PersonInfo.Restrictions&&(n.ExtraProperties.PersonInfo.Restrictions.Death&&n.ExtraProperties.PersonInfo.Restrictions.Death.IsSet||n.ExtraProperties.PersonInfo.Restrictions.Guardianship&&n.ExtraProperties.PersonInfo.Restrictions.Guardianship.IsSet||n.ExtraProperties.PersonInfo.Restrictions.Age&&n.ExtraProperties.PersonInfo.Restrictions.Age.IsSet||n.ExtraProperties.PersonInfo.Restrictions.Country&&n.ExtraProperties.PersonInfo.Restrictions.Country.IsSet||n.ExtraProperties.PersonInfo.Restrictions.Municipality&&n.ExtraProperties.PersonInfo.Restrictions.Municipality.IsSet)&&(n.Restrictions=n.ExtraProperties.PersonInfo.Restrictions);n.ExtraProperties.PersonInfo.IsDigidLoginActivated&&(n.ExtraProperties.PersonInfo.IsLoginTypeSecondary?n.SecondaryLoginRequired=!0:n.PrimaryLoginRequired=!0)}function vt(n){var t={};n.ExtraProperties.RelatedPersons.Found&&n.ExtraProperties.RelatedPersons.Found.GoToQuestionId&&(t.QuestionIdIfFound=n.ExtraProperties.RelatedPersons.Found.GoToQuestionId);n.ExtraProperties.RelatedPersons.NotFound&&n.ExtraProperties.RelatedPersons.NotFound.GoToQuestionId&&(t.QuestionIdIfNotFound=n.ExtraProperties.RelatedPersons.NotFound.GoToQuestionId,t.HideQuestionIfNotFound=n.ExtraProperties.RelatedPersons.NotFound.ToHideQuestion);n.ExtraProperties.RelatedPersons.Unknown&&n.ExtraProperties.RelatedPersons.Unknown.GoToQuestionId&&(t.QuestionIdIfUnknown=n.ExtraProperties.RelatedPersons.Unknown.GoToQuestionId);n.ExtraProperties.RelatedPersons.AgeCheck&&n.ExtraProperties.RelatedPersons.AgeCheck.GoToQuestionId&&(t.ValueForAgeCheck=n.ExtraProperties.RelatedPersons.AgeCheck.Value,t.QuestionIdIfForAgeCheck=n.ExtraProperties.RelatedPersons.AgeCheck.GoToQuestionId,t.HideQuestionForAgeCheck=n.ExtraProperties.RelatedPersons.AgeCheck.ToHideQuestion);(t.QuestionIdIfFound||t.QuestionIdIfNotFound||t.QuestionIdIfUnknown||t.QuestionIdIfForAgeCheck)&&(n.Restrictions=t)}function yt(n,t){if(n.QuestionType==QuestionType.PersonInfo||n.QuestionType==QuestionType.CompanyInfo){n.QuestionCounter=t;var i=pt(n);t+=i}else n.QuestionType==QuestionType.Payment||n.QuestionType==QuestionType.Header?n.QuestionCounter=t:(n.QuestionCounter=t,t++);return t}function pt(n){var t=0;return n.QuestionType==QuestionType.PersonInfo?(n.ExtraProperties.PersonInfo.ShowBsn&&t++,n.ExtraProperties.PersonInfo.ShowName&&t++,n.ExtraProperties.PersonInfo.ShowSex&&t++,n.ExtraProperties.PersonInfo.ShowBirthdate&&t++,n.ExtraProperties.PersonInfo.ShowAddress&&t++,n.ExtraProperties.PersonInfo.ShowIntAddress&&t++,n.ExtraProperties.PersonInfo.ShowCountry&&t++,n.ExtraProperties.PersonInfo.ShowPhone&&t++,n.ExtraProperties.PersonInfo.ShowEmail&&t++,n.ExtraProperties.PersonInfo.ShowBankAccount&&t++):n.QuestionType==QuestionType.CompanyInfo&&(n.ExtraProperties.CompanyInfo.ShowCompanyName&&t++,n.ExtraProperties.CompanyInfo.ShowKvk&&t++,n.ExtraProperties.CompanyInfo.ShowBranchNumber&&t++,n.ExtraProperties.CompanyInfo.ShowPersonName&&t++,n.ExtraProperties.CompanyInfo.ShowFunction&&t++,n.ExtraProperties.CompanyInfo.ShowPhone&&t++,n.ExtraProperties.CompanyInfo.ShowEmail&&t++,n.ExtraProperties.CompanyInfo.ShowVisitingAddress&&t++,n.ExtraProperties.CompanyInfo.ShowMailingAddress&&t++,n.ExtraProperties.CompanyInfo.ShowBankAccount&&t++),t}function k(n,t,i){var r=new Date;switch(t){case"days":i=="past"?r.setDate(r.getDate()-n):r.setDate(r.getDate()+n);break;case"weeks":i=="past"?r.setDate(r.getDate()-n*7):r.setDate(r.getDate()+n*7);break;case"months":i=="past"?r.setMonth(r.getMonth()-n):r.setMonth(r.getMonth()+n);break;case"years":i=="past"?r.setFullYear(r.getFullYear()-n):r.setFullYear(r.getFullYear()+n)}return r}function wt(n,i,u,f){var e;return n&&i&&!u&&!f?e=r.getLocalizedString("_DATE_RESTRICTION_MESSAGE_")+(t("date")(n,"longDate")+r.getLocalizedString("_AND_")+t("date")(i,"longDate")):n&&!u?e=r.getLocalizedString("_FROM_DATE_RESTRICTION_MESSAGE_")+t("date")(n,"longDate"):i&&!f&&(e=r.getLocalizedString("_UNTIL_DATE_RESTRICTION_MESSAGE_")+t("date")(i,"longDate")),e}var o={},h="QUESTIONS",c="QUESTIONS_WITH_PREFILL",l="START_QUESTION_INDEX",a="ANSWERED_QUESTIONS",v="QUESTIONS_STATE",d="AUTHENTICATED_USER",y="USER_PROFILE_VALUES";return o.Initialize=p,o.InitRelatedPersons=g,o.GetQuestions=it,o.SetQuestions=w,o.QuestionStateInfo={StartQuestionIndex:0,MaxNumberOfQuestions:0,HasSmartQuestion:!1,HasSkipQuestion:!1,HasPaymentQuestion:!1,relatedPersons:{indexes:[],list:null,assigned:!1},secondaryLoginQuestion:{index:-1,bsn:null}},o.UpdateQuestionStateInfo=ut,o.GetAnsweredQuestions=ft,o.SetAnsweredQuestions=et,o}])}(),function(){"use strict";var n=angular.module("eform");n.factory("routingService",["$rootScope","$state","$q","utilityService","applicantService","cacheService","healthMonitorService",function(n,t,i,r,u,f,e){function p(){n.$on("$locationChangeStart",function(n){c!=!0&&n.preventDefault();c=!1});n.$on("$stateChangeSuccess",function(){f.Put(y,t.$current.self.name);e.trackPageView(window.location.pathname,t.$current.self.name)})}function w(){if(o){var n=null,t=!1;n=f.Get(y,null);(window.location.hash!=""&&k(n)==!1||n==Constants.WIZARD_STATE_SUMMARY)&&(n=null);n||(n=o[0].Name,t=!0);window.location.hash.indexOf("redirect")>-1||f.Get(l,null)?console.log("Redirection is in progress"):h(n,null,{reload:!0},t);f.Put(l,!1)}}function h(n,i,r,u){if(n){if(t.$current.self.name!=n&&(c=!0),u&&!window.location.hash){var f=n.replace(".","/");window.location.replace(window.location.href+"#/"+f)}t.go(n,i,r)}}function b(){o&&o.length>0&&h(o[0].Name)}function k(n){var t=v(n);return t!=null}function v(n){for(var i=null,t=0;t<o.length;t++)if(o[t].Name==n){i=o[t];break}return i}function d(){var t=[],u=i.defer(),f=null,n=null;return a.isAuthenticationRequired=!1,r.isEmpty(a.currentCaseType.FormIntroductionText)||(n=[new WizardStep(Constants.WIZARD_STATE_INTRODUCTION,null,"%NEXT%")],t=t.concat(n),f=n),n=g(),nt(f,n),t=t.concat(n),o=t,u.resolve(!0),u.promise}function g(){var n=[];return n.push(new WizardStep(Constants.WIZARD_STATE_QUESTION,"%PREVIOUS%",Constants.WIZARD_STATE_CONFIRMATION)),n.push(new WizardStep(Constants.WIZARD_STATE_CONFIRMATION,Constants.WIZARD_STATE_QUESTION,Constants.WIZARD_STATE_SUMMARY)),n.push(new WizardStep(Constants.WIZARD_STATE_SUMMARY,null,null)),n}function nt(n,t){var i,r;n&&(i=null,t&&t.length>0&&(i=t[0]),it(n,i));t&&(r=null,n&&n.length>0&&(r=n[n.length-1]),tt(t,r))}function tt(n,t){var i,r;if(n)for(i=0;i<n.length;i++)r=n[i],r.Previous&&r.Previous=="%PREVIOUS%"&&(r.Previous=t?t.Name:null)}function it(n,t){var i,r;if(n)for(i=0;i<n.length;i++)r=n[i],r.Next&&r.Next=="%NEXT%"&&(r.Next=t?t.Name:null)}var s={},o=[],c=!1,y="CURRENT_ROUTE_STATE",l="IS_REDIRECTED",a={};return s.InitiateRouting=function(n){a.currentCaseType=n;d().then(function(){n!=null&&(p(),w())})},s.GoToState=h,s.GoToError=function(n){window.location.href=window.location.pathname+"/error?ID="+encodeURIComponent(n)},s.IsStartStep=function(){var n=!0;return o&&o.length>0&&(n=t.$current.self.name==o[0].Name),n},s.IsLastStep=function(){return t.$current.self.name==Constants.WIZARD_STATE_CONFIRMATION},s.RouteToLandingPage=b,s.RouteToPreviousPage=function(){var n=v(t.$current.self.name);n!=null&&n.Previous!=null&&h(n.Previous)},s.RouteToNextPage=function(){var n=v(t.$current.self.name);n!=null&&n.Next!=null&&h(n.Next)},s.SetRedirectionFlag=function(n){f.Put(l,n)},s}])}(),function(){"use strict";var n=angular.module("eform");n.factory("utilityService",function(){function i(n,t,i){for(var r=n.length;r--;)n[r]&&n[r].hasOwnProperty(t)&&arguments.length>2&&n[r][t]===i&&n.splice(r,1);return n}function n(n){return typeof n=="undefined"||n==null}function r(t){return n(t)||t.length==0}function u(n,t){var i=n.replace(/{(\d+)}/g,function(n,i){return typeof t[i]!="undefined"&&t[i]!=null?t[i]:""});return i.replace(/\s{2,}/g," ").trim()}function f(n,i){var r=n.getDate(),u=n.getMonth()+1,f=n.getFullYear();return t([r,u,f],i)}function t(n,t){return $.grep(n,Boolean).join(t)}function e(){var n=o();return n[n.length-1].toLowerCase()=="voorbeeld"?n[n.length-3]:n[n.length-2]}function o(){var n=window.location.pathname.split("/");return n.filter(Boolean)}return{removeObjectFromArray:i,isNullOrUndefined:n,isEmpty:r,formatString:u,formatDate:f,joinArray:t,getCaseTypeId:e}})}(),function(){"use strict";var n=angular.module("eform");n.factory("validatorService",["utilityService",function(n){function f(n,t){var i=t.numberOfInvalids();i&&t.errorList[0].element.focus()}function e(n){["checkbox","radio","file","number"].indexOf($(n).prop("type"))>-1||$(n).is("select")?$(n).closest(".eformInput").siblings(".errorText").show():$(n).closest(".datetimepicker").length>0?r(n):i(n);n.type==="radio"||n.type==="checkbox"?$(n).closest(".eformInput").addClass("has-error"):$(n).parent().addClass("has-error")}function o(n){["checkbox","radio","file","number"].indexOf($(n).prop("type"))>-1||$(n).is("select")?$(n).closest(".eformInput").siblings(".errorText").hide():$(n).closest(".datetimepicker").length>0?r(n):i(n);n.type==="radio"||n.type==="checkbox"?$(n).closest(".eformInput").removeClass("has-error"):$(n).parent().removeClass("has-error")}function r(n){var t=$(n).closest(".datetimepicker").find(".date-input-control, .time-input-control"),r=u(t);r?$(n).closest(".eformInput").siblings(".errorText").show():i(n)}function u(t){var u=!1,r=0,i;if(t.length>0){for(i=0;i<t.length;i++)n.isEmpty(t[i].value)&&r++;r!=0&&r<t.length&&(u=!0)}return u}function i(t){n.isEmpty(t.value)&&s(t)?$(t).closest(".eformInput").siblings(".errorText").show():$(t).closest(".eformInput").siblings(".errorText").hide()}function s(n){var t=!1;return(!!$(n).attr("required")||$(n).hasClass("required"))&&(t=!0),t}var t={};return t.FocusFirstInvalidElement=f,t.HighlightElement=e,t.UnhighlightElement=o,t.IsInputIncomplete=u,t}])}(),function(){"use strict";var n=angular.module("eform");n.factory("webStorageService",["$window",function(n){function i(n){return n?r(n,this.DefaultStorageType):e()}function r(n,i){var r=null;return t.IsStorageSupported&&(i==t.StorageType.localstorage&&t.IsLocalStorageSupported?r=f(n):t.IsSessionStorageSupported&&(r=u(n))),r}function u(t){return n.sessionStorage.getItem(t)}function f(t){return n.localStorage.getItem(t)}function e(){var i=null;return t.DefaultStorageType==t.StorageType.localstorage&&t.IsLocalStorageSupported?i=n.localStorage:t.IsSessionStorageSupported&&(i=n.sessionStorage),i}function o(n,t){s(n,t,this.DefaultStorageType)}function s(n,i,r){t.IsStorageSupported&&(r==t.StorageType.localstorage&&t.IsLocalStorageSupported?c(n,i):t.IsSessionStorageSupported&&h(n,i))}function h(t,i){return n.sessionStorage.setItem(t,i)}function c(t,i){return n.localStorage.setItem(t,i)}function l(){var n="test",t=window.localStorage;try{return t.setItem(n,"1"),t.removeItem(n),!0}catch(i){return!1}}function a(){var n="test",t=window.sessionStorage;try{return t.setItem(n,"1"),t.removeItem(n),!0}catch(i){return!1}}var t={};return t.StorageType={sessionstorage:1,localstorage:2},t.DefaultStorageType=t.StorageType.sessionstorage,t.IsStorageSupported=typeof n.Storage!="undefined",t.IsLocalStorageSupported=l(),t.IsSessionStorageSupported=a(),t.Get=i,t.Put=o,t}])}();angular.module("checklist-model",[]).directive("checklistModel",["$parse","$compile",function(n,t){function i(n,t){if(angular.isArray(n))for(var i=0;i<n.length;i++)if(angular.equals(n[i],t))return!0;return!1}function r(n,t){n=angular.isArray(n)?n:[];for(var i=0;i<n.length;i++)if(angular.equals(n[i],t))return n;return n.push(t),n}function u(n,t){if(angular.isArray(n))for(var i=0;i<n.length;i++)if(angular.equals(n[i],t)){n.splice(i,1);break}return n}function f(f,e,o){t(e)(f);var h=n(o.checklistModel),c=h.assign,s=n(o.checklistValue)(f.$parent);f.$watch("checked",function(n,t){if(n!==t){var i=h(f.$parent);n===!0?c(f.$parent,r(i,s)):c(f.$parent,u(i,s))}});f.$parent.$watch(o.checklistModel,function(n){f.checked=i(n,s)},!0)}return{restrict:"A",priority:1e3,terminal:!0,scope:!0,compile:function(n,t){if(n[0].tagName!=="INPUT"||!n.attr("type","checkbox"))throw'checklist-model should be applied to `input[type="checkbox"]`.';if(!t.checklistValue)throw"You should provide `checklist-value`.";return n.removeAttr("checklist-model"),n.attr("ng-model","checked"),f}}}]),function(){"use strict";var n=angular.module("eform");n.directive("onFinishRender",[function(){return function(n){n.$last&&n.$emit("ngRepeatFinished")}}]);n.directive("ngFocusAsync",["$parse",function(n){return{compile:function(t,i){var r=n(i.ngFocusAsync);return function(n,t){t.on("focus",function(t){n.$evalAsync(function(){r(n,{$event:t})})})}}}}]);n.directive("fileUpload",["localize","configuration",function(n,t){function e(e,o){function s(n,t){f.push({fileName:n,message:t})}o.bind("change",function(h){r=[];i=[];f=[];e.$apply(function(){if(u=h.target.files,!$.isEmptyObject(u)){if($.each(u,function(u,f){if(f.size<=t.MaxFileSizeLimit){var e=f.name.split(".").pop().toLowerCase();$.inArray(e,t.AllowedFileTypes)>-1?(r.push(f),i.push(f.name)):s(f.name,n.getLocalizedString("_FILE_TYPE_RESTRICTION_MESSAGE_")+t.AllowedFileTypes.toString())}else s(f.name,n.getLocalizedString("_FILE_SIZE_RESTRICTION_MESSAGE_"))}),!$.isEmptyObject(r)){e.question.SelectedFiles=r;var c=i.length>1?i.length+" "+n.getLocalizedString("_FILES_"):'"'+i[0]+'"';e.question.DisplayText=n.getLocalizedString("_UPLOADING_")+" "+c+"...";e.uploadFiles();$(o).closest("div").siblings(".errorText").prop("hidden","hidden")}e.question.ErrorMessages=f}})})}var u=null,r=[],i=[],f=[];return $.validator.addClassRules("fileQuestion",{fileQuestion:!0}),{scope:{question:"=fileUpload",uploadFiles:"&"},link:e}}]);n.directive("ngEnter",[function(){return function(n,t,i){t.bind("keydown keypress",function(t){t.which===13&&(n.$apply(function(){n.$eval(i.ngEnter)}),t.preventDefault())})}}]);n.directive("efFocusNext",function(){function n(n){var t=$("input, textarea").not(":hidden"),r=t.length-1,i=t.index(n);return i<r?t.get(i+1):document.getElementById("btnNext")}function t(t){var i=n(t);i&&(i.focus(),i.id==="btnNext"&&i.click())}return{restrict:"A",link:function(n,i,r){r.$set("enterkeyhint","next");i.bind("keydown",function(n){var r=n.keyCode||n.which;r===13&&(n.preventDefault(),t(i))})}}})}(),function(){"use strict";var n=angular.module("eform");n.directive("efAddress",["$sce","$timeout","localize","addressService","utilityService",function(n,t,i,r,u){function f(f){function e(t){var r=i.getLocalizedString(t);return n.trustAsHtml(r)}$.validator.addClassRules("validateZipcode",{zipCodeNL:!0});$.validator.messages.zipCodeNL=i.getLocalizedString("_VALIDATION_MESSAGE_ZIP_");$.validator.addClassRules("validateHouseNumber",{houseNumber:!0});$.validator.messages.houseNumber=i.getLocalizedString("_VALIDATION_MESSAGE_HOUSE_");f.prefillAddress=function(n){if(f.address){var s=f.questionType==QuestionType.Address?!0:!1,i=$("#houseNumber-"+n),o=i[0].value;(!o||o&&i.valid())&&r.PrefillAddress(f.address.ZipCode,f.address.HouseNumber,f.address.HouseLetter,f.address.HouseNumberAddition,s).then(function(n){if(f.toggleContinue({enabled:!0}),f.address.WarningMessage=undefined,f.address.Suggestions=undefined,f.questionType!=QuestionType.Address||n==null||u.isEmpty(n.error)||(n.isAddressPrefilled=!0,f.address.WarningMessage=f.address.WarningMessage||e("NEW_ADDRESS_INVALID_MUNICIPALITY"),f.toggleContinue({enabled:!1})),f.questionType!=QuestionType.Address||n==null||u.isEmpty(n.warningMessage)||(f.address.IsPrefilled=n.isAddressPrefilled,f.address.WarningMessage=f.address.WarningMessage||e(n.warningMessage)),n!=null&&Array.isArray(n)){f.address.WarningMessage=f.address.WarningMessage||e("NEW_ADDRESS_MULTIPLE_MATCHES");f.address.Suggestions=[].concat(n);return}n!=null&&u.isEmpty(n.ZipCode)==!1&&(f.address.ZipCode=n.ZipCode,f.address.HouseNumber=n.HouseNumber,u.isEmpty(n.sameAsLast)&&(f.address.HouseLetter=n.HouseLetter,f.address.HouseNumberAddition=n.HouseNumberAddition,t(function(){i.valid()})),(u.isEmpty(n.sameAsLast)||f.address.IsPrefilled||n.isAddressPrefilled)&&(n.StreetName&&(f.address.StreetName=n.StreetName),n.City&&(f.address.City=n.City)),f.address.IsPrefilled=n.isAddressPrefilled,f.setMailAddress());f.setMailAddress();f.onAddressUpdate()},function(){f.toggleContinue({enabled:!0});f.address.IsPrefilled=!1;f.onAddressUpdate()},null)}};f.setMailAddress=function(){var n=[f.address.StreetName,f.address.HouseNumber,f.address.HouseLetter,f.address.HouseNumberAddition];f.address.MailAddress=u.formatString("{0} {1}{2} {3}",n);f.onAddressUpdate()};f.onAddressSelected=function(n){var r=parseInt(f.address.SelectedAddress,10),i=f.address.Suggestions[r];i&&(f.address.ZipCode=i.ZipCode,f.address.HouseNumber=i.HouseNumber,f.address.HouseLetter=i.HouseLetter,f.address.HouseNumberAddition=i.HouseNumberAddition,f.address.StreetName=i.StreetName,f.address.City=i.City,f.address.IsPrefilled=!0,f.setMailAddress(),t(function(){$("#houseNumber-"+n).valid()}))}}return{restrict:"E",scope:{address:"=",isMandatory:"=",onAddressUpdate:"&",toggleContinue:"&onToggleContinue",questionType:"="},link:f,templateUrl:"/Eform/Directives/template/efAddress.html"}}])}(),function(){"use strict";var n=angular.module("eform");n.directive("efDatetimepicker",["utilityService","$filter","$timeout","localize","validatorService",function(n,t,i,r,u){function f(f,e,o){function it(t,i){var r=t.target.value,e=$(t.target),u=t.target.value?e.valid():!1;i=="from"?(u&&(f.dateformatStart="mediumDate",f.model.startDate=d(r,f.model.startDate)),(u||n.isEmpty(r))&&b(),n.isEmpty(f.dateTime)||k()):i=="to"&&(u&&(f.dateformatEnd="mediumDate",f.model.endDate=d(r,f.model.endDate)),(u||n.isEmpty(r))&&a())}function rt(n){var t=this;i(function(){var i;f.dateModel=f.dateModel||{};f.restrictions.toAllowOtherMinDates&&(i=$.validator.methods.efMinDateRestrictions.call(t,n.target.value,n.target),f.dateModel.showMinDateValidationMessage=i?!1:!0);f.restrictions.toAllowOtherMaxDates&&(i=$.validator.methods.efMaxDateRestrictions.call(t,n.target.value,n.target),f.dateModel.showMaxDateValidationMessage=i?!1:!0);$(n.target).hasClass("startDate")?(f.dateModel.showMinDateValidationMsgForStart=f.dateModel.showMinDateValidationMessage,f.dateModel.showMaxDateValidationMsgForStart=f.dateModel.showMaxDateValidationMessage):$(n.target).hasClass("endDate")&&(f.dateModel.showMinDateValidationMsgForEnd=f.dateModel.showMinDateValidationMessage,f.dateModel.showMaxDateValidationMsgForEnd=f.dateModel.showMaxDateValidationMessage)})}function ut(t,i){var r=t.target.value,e=$(t.target),u=t.target.value?e.valid():!1;i=="from"?(u&&(f.model.startTime=nt(r,f.model.startTime,f.model.startDate)),(u||n.isEmpty(r))&&b()):i=="to"&&(u&&(f.model.endDate=nt(r,f.model.endDate,f.model.startDate)),(u||n.isEmpty(r))&&a())}function y(){var n,t;f.isMandatory==!0&&(f.validationMessage=f.model.startDate?null:r.getLocalizedString("_REQUIRED_QUESTION_MESSAGE_"));f.allowPeriod&&!f.showTime?(n=$(event.target).closest(".datetimepicker").find(".date-input-control"),t=u.IsInputIncomplete(n),t&&(f.validationMessage=r.getLocalizedString("_INCOMPLETE_DATE_PERIOD_MESSAGE_"))):f.showTime&&(n=$(event.target).closest(".datetimepicker").find(".date-input-control, .time-input-control"),t=u.IsInputIncomplete(n),t&&(f.validationMessage=r.getLocalizedString("_INCOMPLETE_DATE_TIME_PERIOD_MESSAGE_")))}function p(){f.formattedValue=f.allowPeriod?s(f.dateTime)&&s(f.nextDateTime)?l(f.dateTime,f.showTime)+","+l(f.nextDateTime,f.showTime):"":s(f.dateTime)?l(f.dateTime,!0):""}function s(t){var i=!1;try{n.isNullOrUndefined(t)||(t=new Date(t),angular.isDate(t)&&isNaN(t)==!1&&(i=!0))}catch(r){}return i}function l(n,t){var i,r;return n=new Date(n),n?(i=n.getFullYear()+"-"+("0"+(n.getMonth()+1)).slice(-2)+"-"+("0"+n.getDate()).slice(-2),t?(r="T"+("0"+n.getHours()).slice(-2)+":"+("0"+n.getMinutes()).slice(-2)+":"+("0"+n.getSeconds()).slice(-2),i+r):i+"T00:00:00"):void 0}function c(n){if(n=new Date(n),n){var t=n.getFullYear(),i=n.getMonth(),r=n.getDate();return new Date(t,i,r)}}function w(){var n=!0;return f.allowPeriod&&(n=f.showTime?$("#"+f.ids.endTimeId).val()?$("#"+f.ids.endTimeId).valid():!0:$("#"+f.ids.endDateId).val()?$("#"+f.ids.endDateId).valid():!0),n}function b(){if(s(f.model.startDate)){var t=null;s(f.model.startTime)?t=h(f.model.startDate,f.model.startTime):n.isEmpty(f.model.startTime)&&(t=f.model.startDate);angular.isDate(t)&&t!=f.dateTime&&(f.dateTime=t)}else n.isEmpty(f.model.startDate)&&n.isEmpty(f.model.startTime)&&n.isEmpty(f.dateTime)==!1&&(f.dateTime="");v();i(function(){$("#"+f.ids.startDateId).val()&&$("#"+f.ids.startDateId).valid();f.model.endDate&&w()&&a()})}function a(){if(s(f.model.endDate)){var t=f.model.endDate;f.allowPeriod&&f.showTime&&s(f.model.startDate)&&(t=h(f.model.startDate,f.model.endDate));angular.isDate(t)&&t!=f.nextDateTime&&(f.nextDateTime=t)}else n.isEmpty(f.model.endDate)&&n.isEmpty(f.nextDateTime)==!1&&(f.nextDateTime="");v();i(function(){w()})}function k(){n.isEmpty(f.model.startTime)&&f.showTime&&(f.model.startTime=s(f.model.startDate)?h(f.model.startDate,""):h("",""))}function ft(){n.isEmpty(f.model.endDate)&&(f.model.endDate=s(f.model.startDate)?h(f.model.startDate,""):h("",""))}function d(n,t){var i=null;return n&&(i=et(n),i=i||t),i}function et(n){var t,i;if(n)if(n=n.replace(/^\s+|\s+$/g,""),n.length>=6&&n.length<=10&&!/[a-zA-Z]{3}/.test(n))if(/[\s\/\\-]/.test(n))n=n.replace(/[\s\/\\]/g,"-"),i=n.split("-"),t=g(i[2],i[1],i[0]);else{var r=n.substring(0,2),u=n.substring(2,4),f=n.substring(4);t=g(f,u,r)}else n.length>=10&&/[a-zA-Z]*/.test(n)&&(t=ot(n));return t}function g(n,t,i){var r=parseInt(n,10),u=parseInt(t,10),f=parseInt(i,10);return n.length==2&&(r+=2e3),new Date(r,u-1,f)}function ot(n){var t;return n=n.replace(/januari/i,"jan"),n=n.replace(/februari/i,"feb"),n=n.replace(/maart|mrt/i,"mar"),n=n.replace(/mei/i,"may"),n=n.replace(/juni/i,"jun"),n=n.replace(/juli/i,"jul"),n=n.replace(/augustus/i,"aug"),n=n.replace(/oktober|okt/i,"oct"),t=new Date(n),isNaN(t.getTime())?null:t}function nt(n,t,i){var r=null,u;return n&&(/:/.test(n)==!1&&n.length==4?(s(i)==!1&&(i=""),u=[n.slice(0,2),":",n.slice(2,4)].join(""),r=h(i,u)):r=t),r}function h(i,r){var f=null,u;return n.isEmpty(i)&&(i=new Date),s(i)&&(u="00:00",n.isEmpty(r)==!1&&r.length==5&&/:/.test(r)?u=r:s(r)&&(u=t("date")(r,"HH:mm")),f=new Date(t("date")(i,"MM/dd/yyyy")+" "+u)),f}function st(){if(f.restrictions){f.minDate=f.restrictions.toAllowOtherMinDates?new Date(1e3,0,1):f.restrictions.minDate;f.maxDate=f.restrictions.toAllowOtherMaxDates?new Date(9999,11,31):f.restrictions.maxDate;var n=f.restrictions.toAllowOtherMinDates?new Date(1e3,0,1):c(f.restrictions.minDate),t=f.restrictions.toAllowOtherMaxDates?new Date(9999,11,31):c(f.restrictions.maxDate);f.dateRange=n+"|"+t;f.realDateRange=c(f.restrictions.minDate)+"|"+c(f.restrictions.maxDate)}}function v(){if(f.isMandatory==!1&&(f.allowPeriod==!0||f.showTime==!0)){var t=n.isEmpty(f.model.startDate)==!1||n.isEmpty(f.model.startTime)==!1||n.isEmpty(f.model.endDate)==!1;f.MarkRequired!=t&&(tt("dateClass",t),tt("timeClass",t),f.MarkRequired=t,i(function(){t==!1&&($("#"+f.ids.startDateId).valid(),f.showTime==!0&&$("#"+f.ids.startTimeId).valid(),f.allowPeriod&&f.showTime?$("#"+f.ids.endTimeId).valid():f.allowPeriod&&f.showTime==!1&&$("#"+f.ids.endDateId).valid())}))}}function tt(n,t){t?f[n].indexOf("required",0)==-1&&(f[n]=f[n]+" required"):f[n]=f[n].replace(" required","")}function ht(){f.uniqueId="efDatetimepicker-"+f.$id+"-"+Math.floor(Math.random()*1e4);f.ids={mainId:f.uniqueId,startDateId:"date-"+f.uniqueId,endDateId:"date-period-"+f.uniqueId,startTimeId:"time-"+f.uniqueId,endTimeId:"time-period-"+f.uniqueId};f.ids.startDateButtonId=f.ids.startDateId+"-inputbutton";f.ids.endDateButtonId=f.ids.endDateId+"-inputbutton";f.ids.startTimeButtonId=f.ids.startTimeId+"-inputbutton";f.ids.endTimeButtonId=f.ids.endTimeId+"-inputbutton"}function ct(){f.model={startDate:f.dateTime};f.allowPeriod&&(f.model.endDate=f.nextDateTime);f.showTime&&(f.model.startTime=f.dateTime)}f.MarkRequired=!1;f.dateTimePicker={};ct();ht();f.element=e;f.editDateformat="dd MM yyyy";f.dateformatStart="mediumDate";f.dateformatEnd="mediumDate";f.timeformat="HH:mm";f.dateClass="form-control ";f.timeClass="form-control ";f.uniqueId="efDatetimepicker-"+f.$id+"-"+Math.floor(Math.random()*1e4);$.validator.addClassRules("date-input-control",{dateNL:!0});$.validator.messages.dateNL=r.getLocalizedString("_VALIDATION_MESSAGE_DATE_");$.validator.addClassRules("time-input-control",{time:!0});$.validator.messages.time=r.getLocalizedString("_VALIDATION_MESSAGE_TIME_");$.validator.addClassRules("endDate",{efDatePickerEndDate:!0});$.validator.messages.efDatePickerEndDate=r.getLocalizedString("_VALIDATION_MESSAGE_ENDDATE_");$.validator.addClassRules("endTime",{efDatePickerEndTime:!0});$.validator.messages.efDatePickerEndTime=r.getLocalizedString("_VALIDATION_MESSAGE_ENDTIME_");$.validator.addClassRules("dateRestrictions",{efDateRestrictions:!0});$.validator.messages.efDateRestrictions=r.getLocalizedString("_VALIDATION_MESSAGE_DATE_RESTRICTION_");o.dateClass&&(f.dateClass=f.dateClass+o.dateClass);o.timeClass&&(f.timeClass=f.timeClass+o.timeClass);f.isMandatory==!0&&(f.dateClass+=" required",f.timeClass+=" required",f.validationMessage=r.getLocalizedString("_REQUIRED_QUESTION_MESSAGE_"));st();v();i(function(){});f.openDatePicker=function(n,t){n.preventDefault();n.stopPropagation();f.dateTimePicker[t]=!0};f.openTimePicker=function(n,t,i){i=="from"?k():i=="to"&&ft();n.preventDefault();n.stopPropagation();f.dateTimePicker[t]=!0};f.onEditDate=function(n){n=="from"?f.dateformatStart=f.editDateformat:n=="to"&&(f.dateformatEnd=f.editDateformat)};f.handleDate=function(n,t){it(n,t);y();rt(n)};f.handleTime=function(n,t){ut(n,t);y()};f.getMaxDate=function(n){if(n=="from"&&f.allowPeriod&&f.showTime==!1)return f.model.endDate};f.$watch("dateTime",function(){p();i(function(){f.onDateUpdate()})});f.$watch("nextDateTime",function(){p();i(function(){f.onDateUpdate()})})}return{restrict:"A",scope:{questionTitle:"=",dateModel:"=",dateTime:"=",nextDateTime:"=",formattedValue:"=?",showTime:"=?",allowPeriod:"=?",isMandatory:"=?",restrictions:"=",onDateUpdate:"&"},link:f,templateUrl:"/Eform/Directives/template/efdatetimepicker.html"}}])}(),function(){var n=angular.module("eform");n.directive("efMap",["$timeout","$q","localize","utilityService","config",function(n,t,i,r,u){function f(f,e){function a(){f.oldPosition=angular.copy(f.position);f.position.mapurl=it();f.formattedAddress=tt()}function v(t){t.setAnimation(google.maps.Animation.BOUNCE);n(function(){t.setAnimation(null)},2e3)}function tt(){var n="";return f.position&&f.position.location&&f.position.address&&(n=f.position.location.latitude+"|"+f.position.location.longitude+"|"+f.position.zoom+"|"+f.position.address),n}function it(){var n="";return f.position&&f.position.location&&(n=r.formatString("https://maps.google.com/maps/api/staticmap?center={0},{1}&zoom={2}&markers={0},{1}&size=300x200&key={3}",[f.position.location.latitude,f.position.location.longitude,f.position.zoom,u.staticMapApiKey])),n}function y(n,t){ot(n,!0).then(function(n){o(n.coordinates,n.formattedAddress);f.position.zoom=c},function(r){o(null,n);n&&t&&(f.map.error=r==="NO_LOCATION"?i.getLocalizedString("_VALIDATION_MESSAGE_MAP_ADDRESS_"):r)},null)}function s(n,t){var r={latitude:n,longitude:t};ft(r).then(function(n){o(r,n)},function(n){f.oldPosition&&o(angular.copy(f.oldPosition.location),f.oldPosition.address);f.map.error=n==="NO_ADDRESS"?i.getLocalizedString("_VALIDATION_MESSAGE_MAP_LOCATION_"):n},null)}function o(n,t){f.position.location=n;f.position.address=t;f.map.error=null;f.searchelement.setAttribute("isValidSearch",n!==null);f.search.isValid=n!==null;rt()}function rt(){n(function(){$(f.searchelement).valid()})}function h(t){t&&n(function(){f.map.center=jQuery.extend({},t)})}function ut(t){t&&n(function(){var n=f.map.control.getGMap();n.fitBounds(t)})}function ft(n){var i=t.defer(),r,u;return n!==null?(r=new google.maps.LatLng(n.latitude,n.longitude),u=new google.maps.Geocoder,u.geocode({latLng:r},function(n,t){t===google.maps.GeocoderStatus.OK?n&&n[0]?i.resolve(n[0].formatted_address):i.reject("NO_ADDRESS"):i.reject("NO_ADDRESS")})):i.reject("Invalid location."),i.promise}function p(n){var i=t.defer(),r;return location!==null?(r=new google.maps.Geocoder,r.geocode({address:n},function(n,t){if(t===google.maps.GeocoderStatus.OK)if(n&&n[0]){var r=w(n[0]);i.resolve(r)}else i.reject("NO_LOCATION");else i.reject("NO_LOCATION")})):i.reject("Invalid address."),i.promise}function et(n){var i=t.defer();if(n!==null){var r=f.map.control.getGMap(),u=new google.maps.places.PlacesService(r),e={placeId:n};u.getDetails(e,function(n,t){if(t===google.maps.places.PlacesServiceStatus.OK)if(n){var r=w(n);i.resolve(r)}else i.reject("NO_PLACE");else i.reject("NO_PLACE")})}else i.reject("Invalid location.");return i.promise}function w(n){var r=null,t,i,u;return n&&n.geometry&&(t=null,i=null,n.geometry.location&&(t={latitude:n.geometry.location.lat(),longitude:n.geometry.location.lng()}),n.geometry.viewport&&(i=new google.maps.LatLngBounds(n.geometry.viewport.getSouthWest(),n.geometry.viewport.getNorthEast())),u=nt(n),r={coordinates:t,bounds:i,formattedAddress:u}),r}function ot(n,i){var r=t.defer(),u;return n?(u=new google.maps.places.AutocompleteService,u.getPlacePredictions({input:n},function(t,u){if(u===google.maps.GeocoderStatus.OK)if(t&&t[0]){var f={placeId:t[0].place_id,description:t[0].description};et(f.placeId).then(function(n){r.resolve(n)},function(n){r.reject(n)},null)}else b(i,r,n);else b(i,r,n)})):r.reject("Invalid address."),r.promise}function b(n,t,i){n?p(i).then(function(n){t.resolve(n)},function(n){t.reject(n)},null):t.reject("NO_PREDICTION")}function k(){d(f.defaultMapViewAddress).then(null,function(){d("Netherlands")},null);st().then(function(n){g(n);s(n.latitude,n.longitude)},function(){f.$root.alertLocationServiceDetails()},null)}function d(n){var i=t.defer();return n?l!==n?(l=n,p(n).then(function(n){g(n.coordinates,n.bounds);i.resolve()},function(n){i.reject(n)},null)):i.resolve():i.reject("Provided address is empty address to set as default view."),i.promise}function g(n,t){h(n);ut(t)}function st(){var n=t.defer();return navigator.geolocation?navigator.geolocation.getCurrentPosition(function(t){var i={latitude:t.coords.latitude,longitude:t.coords.longitude};n.resolve(i)},function(){n.reject("Failed get geolocation.")}):n.reject("Browser doesn't support Geolocation."),n.promise}function ht(n){function i(i,r){if(i==="keydown"){var u=r;r=function(t){var i,r,f;t.which===13&&(i=$(".pac-item-selected").length>0,r=$(".pac-container .pac-item:first").text(),r&&!i&&(f=$.Event("keydown",{keyCode:40,which:40}),u.apply(n,[f])));u.apply(n,[t])}}t.apply(n,[i,r])}var r=new google.maps.places.Autocomplete(n,{}),t;ct(r);t=n.addEventListener?n.addEventListener:n.attachEvent;n.addEventListener=i;n.attachEvent=i}function ct(n){google.maps.event.addListener(n,"place_changed",function(){var t=n.getPlace(),i,r;t&&(t.place_id?(i=nt(t),r={latitude:t.geometry.location.lat(),longitude:t.geometry.location.lng()},f.$apply(function(){o(r,i);f.position.zoom=c})):t.name&&y(t.name,!0))})}function nt(n){var t="";return n&&n.formatted_address&&(t=n.name&&n.formatted_address.indexOf(n.name,0)===-1?n.name+", "+n.formatted_address:n.formatted_address),t}var c=15,l=null;f.map={options:{scrollwheel:!0,streetViewControl:!1},bounds:{},control:{}};f.position&&f.position.location||(f.position={zoom:17},k());$.validator.addClassRules("ef-map-search",{mapSearch:!0});$.validator.messages.mapSearch=i.getLocalizedString("_VALIDATION_MESSAGE_MAP_SEARCH_");f.searchelement=e[0].children[0];f.searchelement.setAttribute("isDirty",!1);$(f.searchelement).data("popover-position","top");f.search={id:"efplaceSearch-"+f.$id+"-"+Math.floor(Math.random()*1e4)};n(function(){$("#"+f.search.id).parents(".inputFieldContainer").siblings().attr("for",f.search.id)});f.onSearchBoxBlur=function(){f.searchelement.setAttribute("isDirty",!1);angular.equals(f.oldPosition.address,f.position.address)||(f.search.isValid=!1);n(function(){f.search.isValid||y(f.position.address)},500)};f.onSearchBoxFocus=function(){f.searchelement.setAttribute("isDirty",!0)};ht(f.searchelement);f.map.events={zoom_changed:function(){h(f.position.location)},click:function(n,t,i){var r=i[0].latLng;s(r.lat(),r.lng())}};f.marker={id:"efMapMarker-"+f.$id+"-"+Math.floor(Math.random()*1e4),options:{draggable:!0}};f.marker.events={dragend:function(n){s(n.getPosition().lat(),n.getPosition().lng());v(n)},position_changed:function(n){n.dragging||v(n)}};f.$watch("position.location",function(n){n&&h(f.position.location);a()});f.$watch("position.zoom",function(){a()});f.$watch("defaultMapViewAddress",function(n){!n||f.position&&f.position.location||k()})}return{restrict:"E",replace:!0,scope:{position:"=",formattedAddress:"=?",isMandatory:"=",defaultMapViewAddress:"="},link:f,templateUrl:"/Eform/Directives/template/efmap.html"}}])}(),function(){"use strict";var n=angular.module("eform");n.directive("efMarkdown",function(){function n(n,r,u){n.$watch(u.efMarkdown,function(n){var h=!!u.renderHtml,s,f,e,o;commonmark&&commonmark.Parser&&commonmark.HtmlRenderer?n&&(s=new commonmark.Parser,f=new commonmark.HtmlRenderer({safe:!h,smart:!0}),f.softbreak="<br/>",n=t(n),e=s.parse(n),i(e),o=f.render(e),o&&$(r).html(o)):console.error("commonmark.js is not loaded or loaded incorrectly")})}function t(n){return n&&(n=n.replace(/([^<])(https?:\/\/\S+[\w\/])/gi,"$1<$2>")),n}function i(n){if(n.walker)for(var r=n.walker(),i,t;i=r.next();)t=i.node,i.entering&&t.type==="Link"&&t.destination&&t.destination.match(/^https?:/)&&(t.externalLink=!0)}return{restrict:"A",link:n}})}(),function(){"use strict";var n=angular.module("eform");n.directive("efWizardNavigation",["routingService","$modal","healthMonitorService",function(n,t,i){function r(r){r.wizardState||(r.wizardState={});r.input||(r.input={});r.wizardState.isStartStep=n.IsStartStep();r.wizardState.isLastStep=n.IsLastStep();r.wizardState.isPreview=window.location.pathname.indexOf("voorbeeld")>-1;r.wizardState.activateSaveDraft=r.$root.activateSaveDraft;r.gotoNextPage=function(){i.trackEvent("ContinueClicked");r.$root.isDraftSaved=!1;r.$emit("gotoNextPage")};r.gotoPreviousPage=function(){i.trackEvent("BackClicked");r.$root.isDraftSaved=!1;var t=r.$emit("gotoPreviousPageStart");t.defaultPrevented||n.RouteToPreviousPage()};r.openSaveDraftModal=function(){i.trackEvent("ContinueLaterClicked");var n=t.open({templateUrl:"/Eform/Views/Modal/saveDraftModal.html",controller:"ModalInstanceController"});n.result.then(function(n){r.$emit("saveEformDraft",n)})}}return{restrict:"E",scope:{options:"=",disabled:"="},link:r,templateUrl:"/Eform/Directives/template/efWizardNavigation.html"}}])}();angular.module("eform").directive("lengthIndicator",["$timeout",function(n){function t(n){var i=n.targetId,r=document.getElementById(i),t;return r?(t=angular.element(r),n.maxLength=t.attr("maxlength"),n.length=t.attr("value").length,t):(console.error('"%s" does not exist',i),null)}return{restrict:"A",transclude:!0,scope:{targetId:"@lengthIndicator"},link:function(i){n(function(){var n=t(i);if(n)n.on("change keyup paste input",function(){i.$apply(t)})},0)},templateUrl:"/Eform/Directives/template/lengthIndicator.html"}}]);angular.module("eform").directive("questionValidation",[function(){return{scope:!1,restrict:"AC",link:function(n,t){var u=n.question,i=u.ExtraProperties.ValidationRule,r=u.ExtraProperties.ValidationErrorMessage;t.rules("add",{email:i===ValidationRule.EmailAddress||undefined,url:i===ValidationRule.WebsiteAddress||undefined,phoneNumberNL:i===ValidationRule.PhoneNumber||undefined,zipCodeNLStrict:i===ValidationRule.PostalCodeNL||undefined,bsnNL:i==ValidationRule.CitizenServiceNumber||undefined,messages:{email:r,url:r,phoneNumberNL:r,zipCodeNLStrict:r,bsnNL:r}})}}}]);app=angular.module("eform");app.filter("encodeURIComponent",function(){return function(n){return n===null||typeof n=="undefined"?"":encodeURIComponent(n)}});angular.module("eform").filter("intAddress",["utilityService",function(n){function t(n){return n&&n.Country&&n.Country!=="Nederland"}return function(i){return t(i)?n.joinArray([i.IntAddress.AddressLine1,i.IntAddress.AddressLine2,i.IntAddress.AddressLine3,i.Country],"<br />"):""}}]);angular.module("eform").filter("personName",["utilityService",function(n){return function(t){return n.isEmpty(t)?"":t.PersonFirstName||t.PersonLastName?n.joinArray([t.PersonFirstName,t.PersonLastNamePrefix,t.PersonLastName]," "):t.FirstName||t.LastName?n.joinArray([t.FirstName,t.Prefix,t.LastName]," "):(console.warn("Invalid personName filter input format: %o",t),"")}}]),function(){"use strict";angular.module("eform").filter("time",["$filter",function(n){return function(t,i){if(i===void 0&&(i="HH:mm:ss"),typeof t=="number"){var r=new Date(0,0,0).setSeconds(t);return n("date")(r,i)}return console.error("Invalid type of input: %s",typeof t),t}}])}(),function(){"use strict";var n=angular.module("eform");n.controller("ConfirmationController",["$rootScope","$scope","$filter","$q","$timeout","localize","dataService","utilityService","logService","commonService","questionService","applicantService","routingService","healthMonitorService","config",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y){function w(){t.updateQuestionDisplayName(0);t.hideAllPopovers();t.navigationOptions={};t.isPersonApplicantType=h.eformStateInfo.applicantType==ApplicantType.Citizen;t.isCompanyApplicantType=h.eformStateInfo.applicantType==ApplicantType.Company;t.isEUPersonApplicantType=h.eformStateInfo.applicantType==ApplicantType.Eidas_Citizen;t.isEUCompanyApplicantType=h.eformStateInfo.applicantType==ApplicantType.Eidas_Company;t.isSavingEform=!1;t.Questions=c.GetAnsweredQuestions();var n=h.GetCaseType(!0).then(function(n){t.caseType=n},null,null),i=l.GetCitizen().then(function(n){t.Citizen=n},null,null),u=l.GetCompany().then(function(n){t.Company=n},null,null);r.all([n,i,u]).then(function(){t.navigationOptions.disableNext=p();d()});et();b()}function b(){t.paymentQuestionCount=h.eformStateInfo.paymentQuestionCount;t.paymentAmount=h.eformStateInfo.paymentAmount;t.paymentPageTitle=t.paymentQuestionCount>1?t.caseType.FormName:h.eformStateInfo.paymentPageTitle;t.isPaymentRequired=t.paymentQuestionCount>0&&!o.isNullOrUndefined(t.paymentAmount);t.banks=k()==="test"?Constants.BanksTest:Constants.BanksProduction;t.selectedMethod={paymentMethod:t.supportsCreditCard?null:Constants.PaymentMethods.iDEAL,selectedBank:null}}function k(){var n=window.location.pathname.split("/"),i,t;return n=n.filter(Boolean),i=n[0],t=n.length==5?n[1]:null,t}function d(){var r,n;t.authenticatedUserType==ApplicantType.Citizen&&t.isPersonApplicantType&&t.Citizen?(t.SignatureMessage=f.getLocalizedString("_SIGNATURE_FOR_DIGID_"),n=i("date")(new Date,"dd MMMM yyyy HH:mm"),r=t.Citizen.Name,t.SignatureMessage=t.SignatureMessage.replace("_DATE_TIME_",n),t.SignatureMessage=t.SignatureMessage.replace("_USER_NAME_",r?r:t.Citizen.CitizenServiceNumber)):t.authenticatedUserType==ApplicantType.Company&&t.isCompanyApplicantType&&t.Company?(t.SignatureMessage=f.getLocalizedString("_SIGNATURE_FOR_EHERKENNING_"),n=i("date")(new Date,"dd MMMM yyyy HH:mm"),t.SignatureMessage=t.SignatureMessage.replace("_DATE_TIME_",n),t.SignatureMessage=t.SignatureMessage.replace("_USER_NAME_",t.Company.TradeRegistrationNumber)):t.authenticatedUserType==ApplicantType.Eidas_Citizen&&t.isEUPersonApplicantType&&t.Citizen?(t.SignatureMessage=f.getLocalizedString("_SIGNATURE_FOR_EIDAS_"),n=i("date")(new Date,"dd MMMM yyyy HH:mm"),t.SignatureMessage=t.SignatureMessage.replace("_DATE_TIME_",n),t.SignatureMessage=t.SignatureMessage.replace("_USER_NAME_",r?r:t.Citizen.Name)):t.authenticatedUserType==ApplicantType.Eidas_Company&&t.isEUCompanyApplicantType&&t.Company&&(t.SignatureMessage=f.getLocalizedString("_SIGNATURE_FOR_EIDAS_"),n=i("date")(new Date,"dd MMMM yyyy HH:mm"),t.SignatureMessage=t.SignatureMessage.replace("_DATE_TIME_",n),t.SignatureMessage=t.SignatureMessage.replace("_USER_NAME_",r?r:t.Company.CompanyName))}function g(){var n,i;t.isPaymentRequired||t.AcceptForm!=undefined&&t.AcceptForm?(t.isSavingEform=!0,n=nt(),t.isPaymentRequired?(v.trackEvent("SubmitFormWithPayment"),i=rt(n),it(i)):(v.trackEvent("SubmitForm"),tt(n)),ut(event)):(v.trackEvent("SubmitWithoutAccept"),t.showAcceptFormWarning=!0)}function nt(){var i=new Eform;return i.CurrentLanguage=n.currentLanguage,i.Questions=t.Questions,i.ApplicantType=h.eformStateInfo.applicantType,i.DraftId=h.GetDraftId(),i.SessionId=h.GetSessionId(),t.isPersonApplicantType||t.isEUPersonApplicantType?i.Citizen=t.Citizen:(t.isCompanyApplicantType||t.isEUCompanyApplicantType)&&(i.Company=t.Company),i}function tt(n){e.saveEform(n).success(function(n,i){t.isSavingEform=!1;s.console.log("saveEform: "+i);h.SetEformResult(n);a.GoToState(Constants.WIZARD_STATE_SUMMARY)}).error(function(n){s.console.log(n);t.isSavingEform=!1;a.GoToState(Constants.WIZARD_STATE_SUMMARY)})}function it(n){e.submitEformForPayment(n).success(function(n,i){t.isSavingEform=!1;s.console.log("getPaymentInfo: "+i);n?(t.paymentInfo=n,u(function(){$("#paymentForm").submit()})):a.GoToError("PaymentFailed")}).error(function(n){s.console.log(n);t.isSavingEform=!1;a.GoToError("PaymentFailed")})}function rt(n){return{Eform:n,PaymentDetails:{Amount:t.paymentAmount,PageTitle:t.paymentPageTitle,SelectedPaymentMethod:t.selectedMethod.paymentMethod,SelectedBank:t.selectedMethod.selectedBank?t.selectedMethod.selectedBank.IssuerId:undefined}}}function ut(){t.$on("$locationChangeStart",function(n){t.isSavingEform==!0?n.preventDefault():n.preventDefault=!0})}function p(){var n=!1;return t.isPreview?n=!0:o.isEmpty(t.Questions)?n=!0:t.isPersonApplicantType&&o.isEmpty(t.Citizen)?n=!0:t.isCompanyApplicantType&&o.isEmpty(t.Company)?n=!0:ft()?n=!0:t.isPaymentRequired&&t.selectedMethod.paymentMethod===null?n=!0:!t.isPaymentRequired||t.selectedMethod.paymentMethod!==Constants.PaymentMethods.iDEAL||t.selectedMethod.selectedBank&&t.selectedMethod.selectedBank.IssuerId||(n=!0),n}function ft(){for(var u=!1,r=[],n,i=0;i<t.Questions.length;i++)n=t.Questions[i],n.IsMandatory&&((n.QuestionType==QuestionType.PersonInfo||!o.isEmpty(n.Answer))&&(n.QuestionType!=QuestionType.PersonInfo||n.IsAnswered)&&(n.QuestionType!=QuestionType.CompanyInfo||n.IsAnswered)||(u=!0,r.push(n.Title)));return r.length>0&&st(r),u}function et(){$(window).on("webapp:page:beforeunload",function(n){ot(n)});t.$on("gotoNextPage",function(n){g();n.stopPropagation()});t.$on("saveEformDraft",function(n,i){t.saveEformDraft(i)});t.$on("$destroy",function(){$(window).off("webapp:page:beforeunload")})}function ot(n){t.isSavingEform==!0&&(n.preventDefault(),n.message=f.getLocalizedString("_WARNING_MESSAGE_SAVEEFORM_INPROGRESS_"))}function st(n){var i=n.join(", "),r=n.length===1?f.getLocalizedString("_REQUIRED_QUESTION_EMPTY_MESSAGE_"):f.getLocalizedString("_REQUIRED_QUESTIONS_EMPTY_MESSAGE_");t.requiredQuestionMessage=r.replace("QUESTION_TITLE",i)}s.console.log("Load >> ConfirmationController");t.Constants=Constants;t.supportsIdeal=y.supportsIdeal;t.supportsVisa=y.supportsVisa;t.supportsMasterCard=y.supportsMasterCard;t.supportsMaestro=y.supportsMaestro;t.supportsCreditCard=y.supportsVisa||y.supportsMasterCard||y.supportsMaestro;w();t.localizeSex=function(n){if(n!=null)switch(n.toUpperCase()){case"FEMALE":return f.getLocalizedString("_FEMALE_");case"MALE":return f.getLocalizedString("_MALE_")}return n};t.checkRequiredPaymentValues=function(n){v.trackEvent("SelectPaymentMethod",n);t.navigationOptions.disableNext=p()}}])}(),function(){"use strict";var n=angular.module("eform");n.controller("EformController",["$rootScope","$scope","$sce","$timeout","$modal","Language","Idle","localize","dataService","routingService","configuration","utilityService","logService","validatorService","cacheService","commonService","questionService","applicantService","healthMonitorService",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k){function g(){t.sLoggedInAs=o.getLocalizedString("_LOGGED_IN_AS_");t.sLogout=o.getLocalizedString("_LOGOUT_");t.sStop=o.getLocalizedString("_STOP_");t.idleWarning1=o.getLocalizedString("_IDLE_WARNING_1_");t.idleWarning2=o.getLocalizedString("_IDLE_WARNING_2_");t.goToContent=o.getLocalizedString("_GO_TO_CONTENT_")}function ut(){y.CacheKeySuffix=l.getCaseTypeId();b.GetAuthenticatedUser().then(function(n){t.authenticatedUserType=n.Type||ApplicantType.Anonymous;window.location.pathname.indexOf("draft")>-1?ft():st()})}function ft(){var n=window.location.pathname.split("/");n=n.filter(Boolean);var i=n[0],r=n.length==5?n[1]:null,t=n[n.length-2],u=n[n.length-1];p.GetDraftId(t)?nt(i,r,t,!0):s.getEformDraftMessage(u).success(function(n){var f=!1;n&&(et(n),p.SetDraftId(t,u),f=!0);nt(i,r,t,f)})}function et(n){var i=JSON.parse(n),t;for(t in i)try{y.Put(t.toString(),JSON.parse(i[t]),!0,!0)}catch(r){console.warn(r)}}function nt(n,i,r,u){var f=b.GetLastAuthenticatedUser(),o=!0,e=ot(n,i,r);t.authenticatedUserType==ApplicantType.Anonymous&&f.Type==ApplicantType.Citizen?(o=!1,t.goForDigiDAuthentication()):t.authenticatedUserType==ApplicantType.Anonymous&&f.Type==ApplicantType.Company?(o=!1,t.goForEHerkenningAuthentication()):t.authenticatedUserType==ApplicantType.Anonymous&&f.Type==ApplicantType.Eidas_Citizen?(o=!1,t.goForEIDASAuthentication(null,!1)):t.authenticatedUserType==ApplicantType.Anonymous&&f.Type==ApplicantType.Eidas_Company?(o=!1,t.goForEIDASAuthentication(null,!0)):t.authenticatedUserType==ApplicantType.Citizen&&f.Type==ApplicantType.Citizen&&f.Id!=b.AuthenticatedUser.CitizenServiceNumber?(p.ResetCache(),e+="/error?ID=InvalidDigiDLogin"):t.authenticatedUserType==ApplicantType.Company&&f.Type==ApplicantType.Company&&f.Id!=b.AuthenticatedUser.TradeRegistrationNumber?(p.ResetCache(),e+="/error?ID=InvalidEHerkenningLogin"):t.authenticatedUserType==ApplicantType.Eidas_Citizen&&f.Type==ApplicantType.Eidas_Citizen&&f.Id!=b.AuthenticatedUser.LegalIdentifier?(p.ResetCache(),e+="/error?ID=InvalidEidasLogin"):t.authenticatedUserType==ApplicantType.Eidas_Company&&f.Type==ApplicantType.Eidas_Company&&f.Id!=b.AuthenticatedUser.LegalIdentifier?(p.ResetCache(),e+="/error?ID=InvalidEidasLogin"):u||(p.ResetCache(),e+="/error?ID=DraftNotAvailable");o&&window.location.replace(window.location.protocol+"//"+window.location.hostname+e)}function ot(n,t,i){return t?"/"+n+"/"+t+"/formulieren/"+i+"/EFORM":"/"+n+"/formulieren/"+i+"/EFORM"}function st(){a.console.log("EformController>>Initializing...");f.Initialize();s.initialize();c.Initialize();p.Initialize();w.Initialize();ht();a.console.log("EformController>>Loading CaseType...");p.GetCaseType(!1).then(function(n){lt(n)},null,null)}function ht(){t.authenticatedUserType!=ApplicantType.Anonymous&&b.AuthenticatedUser&&l.isNullOrUndefined(t.sLoggedinUserName)&&(e.watch(),t.authenticatedUserType==ApplicantType.Citizen?tt(b.AuthenticatedUser):t.authenticatedUserType==ApplicantType.Company?t.sLoggedinUserName="KvK "+b.AuthenticatedUser.TradeRegistrationNumber:t.authenticatedUserType===ApplicantType.Eidas_Citizen?tt(b.AuthenticatedUser):t.authenticatedUserType===ApplicantType.Eidas_Company&&ct(b.AuthenticatedUser))}function tt(n){var i="";n&&(i=n.CitizenServiceNumber||n.LegalIdentifier,l.isEmpty(n.Name)?l.isEmpty(n.LastName)||(i=l.formatString("{0} {1} {2}",[n.Initials||n.FirstName,n.Prefix,n.LastName])):i=n.Name);t.sLoggedinUserName=i}function ct(n){var i="";n&&(i=n.TradeRegistrationNumber?"KvK "+n.TradeRegistrationNumber:n.LegalIdentifier,l.isEmpty(n.CompanyName)||(i=n.CompanyName));t.sLoggedinUserName=i}function lt(t){a.console.log("EformController>>Loaded CaseType.");n.activateSaveDraft=t.ActivateSaveDraft==1?!0:!1;n.sessionId=p.GetSessionId();p.eformStateInfo.caseTypeVersion&&p.eformStateInfo.caseTypeVersion!==t.Version&&p.eformStateInfo.compatibilityHash!==t.CompatibilityHash?(p.ResetCache(),window.location.replace(window.location.protocol+"//"+window.location.hostname+window.location.pathname+"error?ID=CaseTypeVersionMismatch")):(p.UpdateEformStateInfo(["caseTypeVersion"],[t.Version]),p.UpdateEformStateInfo(["compatibilityHash"],[t.CompatibilityHash]),at(t))}function at(n){w.GetQuestions().then(function(){t.caseType=n;h.InitiateRouting(n);a.console.log("EformController>>Routing completed.")},null,null)}function d(n,t){var i,u;t===void 0&&(t=!1);i=window.location.protocol+"//"+window.location.hostname+"/Logout.ashx?product=eform";n&&(i=i+"&auto=1");t&&(u=encodeURIComponent($("#homePageUrl").val()),i=i+"&RedirectTo="+u);window.location.href=i;r(function(){p.ResetCache()})}function it(){return window.location.hash}function rt(){k.endSession();t.authenticatedUserType!=ApplicantType.Anonymous?d(!1,!0):vt()}function vt(){t.goToHomePage();r(function(){p.ResetCache()})}a.console.log("Load>>EformController");n.$on("localizeResourcesUpdates",g);o.resourceFileLoaded&&g();t.SessionId=$("#hSessionId").val();t.authenticatedUserType=ApplicantType.Anonymous;ut();t.trackClick=function(n){k.trackEvent(n)};t.goToHomePage=function(){w.UpdateQuestionStateInfo(["StartQuestionIndex"],[0]);var n=$("#homePageUrl").val();n?window.location.assign(n):window.location.replace(window.location.protocol+"//"+window.location.hostname+window.location.pathname)};t.logout=function(){k.trackEvent("LogoutClicked");d(!1)};t.keyPressHandler=function(n,t){(typeof n=="undefined"||n&&(n.keyCode===13||n.keyCode===32))&&t()};t.openStopEformModal=function(){if(k.trackEvent("StopClicked",it()),it()==="#/wizard/summary"){rt();return}var n=u.open({templateUrl:"/Eform/Views/Modal/stopEformModal.html",controller:"ModalInstanceController"});n.result.then(function(){rt()})};t.saveEformDraft=function(t){var i=p.GetDraftId(),r=JSON.stringify(y.GetStorageObject()),u={Id:i||null,CaseTypeId:y.CacheKeySuffix,Message:r,EmailAddress:t.emailAddress,AdditionalText:t.additionalText};s.saveEformDraft(u).success(function(t){a.console.log("Eform draft is saved with ID: "+t);n.isDraftSaved=!0;window.scrollTo(0,0)}).error(function(n){a.console.log(n)})};t.goForDigiDAuthentication=function(n){t.$broadcast("$stateChangeStart");k.trackEvent("DigiDLoginClicked",n?n.Index:null);var i="https://"+window.location.host+window.location.pathname+"/digidforced";n&&(i+="?q="+n.Id);n&&n.ExtraProperties.PersonInfo.IsLoginTypeSecondary&&(i+="&secondLogin=1&questionIndex="+n.Index);window.location.href=i};t.goForEHerkenningAuthentication=function(n){var i,r;t.$broadcast("$stateChangeStart");k.trackEvent("eHerkenningLoginClicked");i=window.location.pathname.split("/");i=i.filter(Boolean);r=i[0];n&&w.UpdateQuestionStateInfo(["ReturnQuestionIndex"],[n.Index]);window.location.replace("/"+r+"/sp/startsso?ReturnUrl="+encodeURIComponent(window.location.href))};t.goForEIDASAuthentication=function(n,i){var r,u;i===void 0&&(i=!1);t.$broadcast("$stateChangeStart");k.trackEvent("eIDASLoginClicked");r=window.location.pathname.split("/");r=r.filter(Boolean);u=r[0];n&&w.UpdateQuestionStateInfo(["ReturnQuestionIndex"],[n.Index]);window.location.replace("/eidas/"+u+"/startsso?returnUrl="+encodeURIComponent(window.location.href)+"&company="+i)};t.$on("Keepalive",function(){return p.KeepAlive()});t.$on("IdleStart",function(){console.debug("User has gone idle");t.isIdle=!0});t.$on("IdleWarn",function(n,i){t.$apply(function(){t.idleCountdown=i})});t.$on("IdleEnd",function(){console.debug("User has resumed activity");t.isIdle=!1});t.$on("IdleTimeout",function(){k.trackEvent("IdleTimeout");d(!0)});$.validator.setDefaults({invalidHandler:v.FocusFirstInvalidElement,highlight:v.HighlightElement,unhighlight:v.UnhighlightElement,onkeyup:!1,onsubmit:!1});t.hideAllPopovers=function(){$(".popover").css("display","none")};t.focusFirstInput=function(){r(function(){$("input:text:not([readonly='readonly']), textarea, select, input:checkbox, input:radio, input:file, button").first().focus();$(window).scrollTop(0)},500)};t.TrustAsHtml=function(n){return i.trustAsHtml(n)};t.TrustAsResourceUrl=function(n){return i.trustAsResourceUrl(n)};t.GoToContent=function(){document.getElementById("viewContainer").focus()};t.OnKeyPress=function(n){n.key==="Enter"&&t.GoToContent()}}])}(),function(){"use strict";var n=angular.module("eform");n.controller("IntroductionController",["$scope","logService","commonService","routingService",function(n,t,i,r){function u(){n.updateQuestionDisplayName();i.GetCaseType().then(function(t){n.CaseType=t},null,null);f()}function f(){n.$on("gotoNextPage",function(){r.RouteToNextPage()});n.$on("saveEformDraft",function(t,i){n.saveEformDraft(i)})}t.console.log("Load>>IntroductionController");u()}])}(),function(){"use strict";var n=angular.module("eform");n.controller("ModalInstanceController",["$scope","$modalInstance","healthMonitorService",function(n,t,i){function r(n){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)}n.eformDraft={};n.saveEformDraft=function(){r(n.eformDraft.emailAddress)?(i.trackEvent("ContinueLaterConfirmed"),t.close(n.eformDraft)):(i.trackEvent("ContinueLaterInvalidEmail"),$("#emailErrorText").show())};n.stopEform=function(){i.trackEvent("StopConfirmed");t.close()};n.cancel=function(){i.trackEvent("ModalCancel");t.dismiss("cancel")};n.hideErrorText=function(){$("#emailErrorText").hide()}}])}(),function(){"use strict";var n=angular.module("eform");n.controller("QuestionInfoBlockController",["$scope","$timeout","$state","$rootScope","questionService","logService","addressService","utilityService","applicantService","localize","routingService",function(n,t,i,r,u,f,e,o,s,h){function p(){n.countries=Constants.Countries;n.GenderMaleString=h.getLocalizedString("_MALE_");n.GenderFemaleString=h.getLocalizedString("_FEMALE_");n.LoginError=angular.element("#hLoginError").val();$.validator.addClassRules("bsn",{bsnNL:!0});$.validator.messages.bsnNL=h.getLocalizedString("_VALIDATION_MESSAGE_BSN_");$.validator.addClassRules("phoneNumber",{phoneNumberNL:!0});$.validator.messages.phoneNumberNL=h.getLocalizedString("_VALIDATION_MESSAGE_PHONENUMBER_");$.validator.addClassRules("email",{email:!0});$.validator.messages.email=h.getLocalizedString("_VALIDATION_MESSAGE_EMAIL_");$.validator.addClassRules("iban",{iban:!0});$.validator.messages.iban=h.getLocalizedString("_VALIDATION_MESSAGE_IBAN_")}function w(){n.countries=Constants.Countries;$.validator.addClassRules("kvk",{kvkNL:!0});$.validator.messages.kvkNL=h.getLocalizedString("_VALIDATION_MESSAGE_KVK_");$.validator.addClassRules("vestigingsnummer",{vestigingsnummer:!0});$.validator.messages.vestigingsnummer=h.getLocalizedString("_VALIDATION_MESSAGE_BRANCHNUMBER_");$.validator.addClassRules("phoneNumber",{phoneNumberNL:!0});$.validator.messages.phoneNumberNL=h.getLocalizedString("_VALIDATION_MESSAGE_PHONENUMBER_");$.validator.addClassRules("email",{email:!0});$.validator.messages.email=h.getLocalizedString("_VALIDATION_MESSAGE_EMAIL_");$.validator.addClassRules("mailingZipCode",{zipCodeNLStrict:!0});$.validator.messages.zipCodeNLStrict=h.getLocalizedString("_VALIDATION_MESSAGE_ZIP_");$.validator.addClassRules("iban",{iban:!0});$.validator.messages.iban=h.getLocalizedString("_VALIDATION_MESSAGE_IBAN_")}function b(t){if(t.InfoList[0]&&t.InfoList[0].Address){var i=t.Restrictions&&t.Restrictions.Municipality&&t.Restrictions.Municipality.IsSet,r=!!t.InfoList[0].Address.City,u=!t.InfoList[0].Address.MunicipalityCode||!!t.InfoList[0].Address.MunicipalityCodeFromLookup;u&&(r?e.PrefillMunicipalityCode(t.InfoList[0].Address.City).then(function(r){t.InfoList[0].Address.MunicipalityCode=r;t.InfoList[0].Address.MunicipalityCodeFromLookup=!0;i&&(t.InfoList[0].validationId=v(t,t.InfoList[0]),n.resetQuestionSet(),c(t))},function(){i&&(t.InfoList[0].validationId=Constants.CITIZEN_VALIDATION_IDS.INVALID_MUNICIPALITY,n.resetQuestionSet(),c(t))}):i&&(t.InfoList[0].validationId=Constants.CITIZEN_VALIDATION_IDS.VALID,n.resetQuestionSet(),c(t)))}}function k(n){n&&n.VisitingAddress&&(n.MailingAddress=n.VisitingAddress.MailAddress,n.MailingZipCode=n.VisitingAddress.ZipCode,n.MailingCity=n.VisitingAddress.City)}function d(n){var i,t;for(n.IsAnswered=!1,i=JSON.parse(n.Answer),t=0;t<i.length;t++)if(g(i[t])){n.IsAnswered=!0;break}}function g(n){var t=!1,i;for(i in n)if(!o.isEmpty(n[i])){t=!0;break}return t}function a(n,t){nt(n,t);c(n)}function nt(n,i){n.InfoList[0].PrefillStatus=i.PrefillStatus;n.InfoList[0].CitizenServiceNumber=i.CitizenServiceNumber;i.DateOfBirthObj=i.DateOfBirth?new Date(i.DateOfBirth):i.DateOfBirth;n.InfoList[0]=i;n.InfoList[0].Name||(n.InfoList[0].Name=o.formatString("{0} {1} {2}",[n.InfoList[0].FirstName,n.InfoList[0].Prefix,n.InfoList[0].LastName]));l(n.InfoList[0].Address);i.IsPrefill&&(n.InfoList[0].validationId=n.Restrictions?v(n,i):Constants.CITIZEN_VALIDATION_IDS.VALID);n.SecondaryLoginRequired&&!n.IsSigned&&(n.IsSigned=i.IsSigned);t(function(){it()})}function c(t){if(t.Restrictions){var i;if(t.InfoList[0].validationId!=Constants.CITIZEN_VALIDATION_IDS.VALID)switch(t.InfoList[0].validationId){case Constants.CITIZEN_VALIDATION_IDS.PERSON_DEAD:i=t.Restrictions.Death.GoToQuestionId;break;case Constants.CITIZEN_VALIDATION_IDS.UNDER_GUARDIANSHIP:i=t.Restrictions.Guardianship.GoToQuestionId;break;case Constants.CITIZEN_VALIDATION_IDS.INVALID_AGE:i=t.Restrictions.Age.GoToQuestionId;break;case Constants.CITIZEN_VALIDATION_IDS.INVALID_COUNTRY:i=t.Restrictions.Country.GoToQuestionId;break;case Constants.CITIZEN_VALIDATION_IDS.INVALID_MUNICIPALITY:i=t.Restrictions.Municipality.GoToQuestionId}n.handleNextQuestionSet(i,t)}}function v(t,i){var u,f,r,e;return t.Restrictions.Death&&t.Restrictions.Death.IsSet&&!o.isEmpty(i.DateOfDeath)?Constants.CITIZEN_VALIDATION_IDS.PERSON_DEAD:t.Restrictions.Guardianship&&t.Restrictions.Guardianship.IsSet&&i.IsUnderGuardianship?Constants.CITIZEN_VALIDATION_IDS.UNDER_GUARDIANSHIP:t.Restrictions.Age&&t.Restrictions.Age.IsSet&&i.Age&&Number(i.Age)<Number(t.Restrictions.Age.Value)?Constants.CITIZEN_VALIDATION_IDS.INVALID_AGE:t.Restrictions.Country&&t.Restrictions.Country.IsSet&&!o.isEmpty(i.Address)&&(u=!o.isEmpty(i.Address.Country)&&i.Address.Country!=Constants.NETHERLANDS_DUTCH,f=!o.isEmpty(i.Address.MunicipalityCode)&&i.Address.MunicipalityCode==Constants.MUNICIPALITY_FOREIGN,u||f)?Constants.CITIZEN_VALIDATION_IDS.INVALID_COUNTRY:t.Restrictions.Municipality&&t.Restrictions.Municipality.IsSet&&(r=t.Restrictions.Municipality.Value,o.isEmpty(r)&&(r=n.caseType.VisibleId),e=o.isEmpty(r)?[]:r.trim().split(/[\s,;|]+/),i.Address!=null&&e.indexOf(i.Address.MunicipalityCode)<0)?Constants.CITIZEN_VALIDATION_IDS.INVALID_MUNICIPALITY:Constants.CITIZEN_VALIDATION_IDS.VALID}function y(n,t){tt(n,t)}function tt(n,t){n.InfoList[0].PrefillStatus=t.PrefillStatus;n.InfoList[0].TradeRegistrationNumber=t.TradeRegistrationNumber;n.InfoList[0]=t;n.InfoList[0].IsChamberOfCommerceSubNumberFilled=n.InfoList[0].ChamberOfCommerceSubNumber?!0:!1;t.IsPrefill?(n.InfoList[0].IsCompanyNameFilled=n.InfoList[0].CompanyName?!0:!1,n.InfoList[0].IsMailingZipCodeFilled=n.InfoList[0].MailingZipCode?!0:!1,n.InfoList[0].IsMailingAddressFilled=n.InfoList[0].MailingAddress?!0:!1,n.InfoList[0].IsMailingCityFilled=n.InfoList[0].MailingCity?!0:!1,n.InfoList[0].VisitingAddress&&(l(n.InfoList[0].VisitingAddress),n.InfoList[0].IsVisitingAddressFilled=n.InfoList[0].VisitingAddress.ZipCode&&n.InfoList[0].VisitingAddress.HouseNumber&&n.InfoList[0].VisitingAddress.StreetName&&n.InfoList[0].VisitingAddress.City?!0:!1)):n.InfoList[0].VisitingAddress&&l(n.InfoList[0].VisitingAddress)}function it(){$(".date-input-control").each(function(){var n=$(this),i=function(n){t(function(){n.focus()},0)};i(n)});t(function(){$("#btnNext").focus()},0)}function l(n){if(n){var t=[n.StreetName,n.HouseNumber,n.HouseLetter,n.HouseNumberAddition];n.MailAddress=o.formatString("{0} {1}{2} {3}",t)}}f.console.log("Load>>QuestionInfoBlockController");n.birthDateRestrictions={minDate:new Date(1e3,0,1),maxDate:new Date};n.initInfoBlock=function(t){if(t.QuestionType==QuestionType.PersonInfo){if(p(),!o.isEmpty(t.Answer)){c(t);return}t.PrimaryLoginRequired?t.ExtraProperties.PersonInfo.IsDigidLoginActivated&&n.authenticatedUserType==ApplicantType.Citizen?n.getCitizen(t):t.ExtraProperties.PersonInfo.IsEIDASLoginActivated&&n.authenticatedUserType==ApplicantType.Eidas_Citizen?n.getCitizen(t):t.InfoList[0]=new PersonInfo:t.SecondaryLoginRequired&&t.Index==u.QuestionStateInfo.secondaryLoginQuestion.index&&(t.SecondaryBsn=u.QuestionStateInfo.secondaryLoginQuestion.bsn,u.UpdateQuestionStateInfo(["secondaryLoginQuestion"],[{index:-1,bsn:null}]),s.GetAuthenticatedUser().then(function(i){var r=i.CitizenServiceNumber;if(t.SecondaryBsn===r){t.SecondaryLoginInvalid=!0;return}n.getCitizen(t)}))}else if(t.QuestionType==QuestionType.CompanyInfo){if(w(),!o.isEmpty(t.Answer))return;t.ExtraProperties.CompanyInfo.IsEHerkenningActivated&&n.authenticatedUserType==ApplicantType.Company?n.getCompany(t):t.ExtraProperties.CompanyInfo.IsEIDASActivated&&n.authenticatedUserType==ApplicantType.Eidas_Company?n.getCompany(t):t.InfoList[0]=new CompanyInfo}};n.SetAnswer=function(n){n.InfoList.forEach(function(n){n.useVisitingAddressAsMailAddress&&k(n)});b(n);n.Answer=angular.toJson(n.InfoList,!0);d(n)};n.addInfoBlock=function(n,i){var u=n.QuestionType==QuestionType.PersonInfo?new PersonInfo:new CompanyInfo,r;n.InfoList.push(u);r=$(i.target).closest("#infoBlock");t(function(){r.next().find("input:first").focus()},10)};n.removeInfoBlock=function(n){n.InfoList.pop();n.Answer=angular.toJson(n.InfoList,!0)};n.getCitizen=function(t){s.GetCitizen(!0,t.SecondaryLoginRequired,t.SecondaryBsn).then(function(i){a(t,i);n.SetAnswer(t)},function(i){a(t,i);n.SetAnswer(t)},null)};n.getCompany=function(t){s.GetCompany(!0).then(function(i){y(t,i);n.SetAnswer(t)},function(i){y(t,i);n.SetAnswer(t)},null)};n.formatMailingZipCode=function(n,t){$(n.srcElement).valid()&&t.MailingZipCode&&(t.MailingZipCode.length==6&&(t.MailingZipCode=t.MailingZipCode.substring(0,4)+" "+t.MailingZipCode.substring(4,6)),t.MailingZipCode=t.MailingZipCode.toUpperCase())}}])}(),function(){"use strict";var n=angular.module("eform");n.controller("QuestionMultipleController",["$scope","$timeout","logService","utilityService","localize",function(n,t,i,r,u){function o(){s()}function s(){n.validationMessageForNumber=u.getLocalizedString("_VALIDATION_MESSAGE_NUMBER_");$.validator.addClassRules("efNumber",{efNumber:!0})}function f(n){if(n){var t=new Date(n),i=t.setDate(t.getDate()+1);return new Date(i)}}function e(n,i,r){var f=r+1,u="#"+i+f;t(function(){n==0||n==13?$(u).focus():n==2&&$(u+" input:first").focus()})}i.console.log("Load>>QuestionMultipleController");o();n.formatAnswer=function(n){var t=[];jQuery.each(n.Answers,function(n,i){r.isEmpty(i.Value)||t.push(i.Value)});n.Answer=t.join("|")};n.addInputField=function(n,t,i){n.Answers.push({Value:""});e(n.QuestionType,t,i)};n.addDateInputField=function(n,t,i){var r,u;if(n.ExtraProperties.DateSettings&&n.ExtraProperties.DateSettings.PeriodType){var o=n.Answers[n.Answers.length-1].StartDate,s=n.Answers[n.Answers.length-1].EndDate,h=f(o),c=f(s);n.Answers.push({StartDate:h,EndDate:c})}else r=n.Answers[n.Answers.length-1].Date,u=f(r),n.Answers.push({Date:u});e(n.QuestionType,t,i)}}])}(),function(){"use strict";var n=angular.module("eform");n.controller("QuestionsController",["$rootScope","$scope","$state","$timeout","$window","$q","localize","dataService","questionService","utilityService","configuration","logService","routingService","applicantService","commonService","healthMonitorService",function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p){function rt(){t.hideAllPopovers();t.baseUrl="https://"+window.location.host;t.isFormDataSupported=!!u.FormData;c.getDefaultMapLocation().then(function(n){t.defaultMapViewAddress=n},null,null);var n=s.InitRelatedPersons();f.all([n]).then(function(){s.GetQuestions().then(function(n){ut();ft(n)},null,null)});bt()}function ut(){t.relatedPersonsLoaded=!0;s.QuestionStateInfo.relatedPersons.list==null?t.relatedPersonsLoaded=null:s.QuestionStateInfo.relatedPersons.list.length==0&&(t.relatedPersonsLoaded=!1)}function ft(n){l.console.log("Questions loaded successfully");t.Questions=n;var i=s.QuestionStateInfo.StartQuestionIndex||0;g(i)}function g(i){nt();t.QuestionSet=[];n.wasFormSuccessfullySubmitted=!0;i=et(i);s.UpdateQuestionStateInfo(["StartQuestionIndex"],[i]);t.formQuestionSet(i)}function et(n){var t=s.QuestionStateInfo.ReturnQuestionIndex;return t>0?(s.UpdateQuestionStateInfo(["ReturnQuestionIndex"],[0]),ot(t)||n):n}function ot(n){var i,r,u;if(n<0||n>t.Questions.length+1)throw new RangeError("questionIndex is out of range");for(i=n;i>0;i--)if((r=t.Questions[i],r.QuestionType==QuestionType.Header&&r.ExtraProperties.StartNewPage)||(u=t.Questions[i-1],u&&u.ExtraProperties.SkipToQuestionId===r.Id))return i;return 0}function st(n){if(t.Questions[n].ExtraProperties.SkipToQuestionId==Constants.GUID_EMPTY)t.Questions[n].ExtraProperties.GoToQuestionId=Constants.GUID_EMPTY;else{var i=t.getQuestionFromId(t.Questions[n].ExtraProperties.SkipToQuestionId,n);h.isEmpty(i)&&(i=n+1<t.Questions.length?t.Questions[n+1]:null);t.handlePageBreak(i)}}function ht(){t.navigationOptions||(t.navigationOptions={});t.navigationOptions.hideNext=t.hideContinueButton;t.navigationOptions.isStartStep=s.QuestionStateInfo.StartQuestionIndex==0;t.toEndEform?(t.setStateToActive(t.wizardStepsLength-1),t.updateQuestionDisplayName(0)):(t.setStateToActive(t.questionStepId),t.updateQuestionDisplayName(t.QuestionSet[0].QuestionCounter))}function ct(n){if(n.IsMandatory){var t="#"+n.Id;$.isEmptyObject(n.UploadedFiles)?$(t).parent().addClass("has-error"):$(t).parent().removeClass("has-error")}}function tt(n,i){$.isEmptyObject(n.UploadedFiles)&&(n.UploadedFiles=[]);$.isEmptyObject(n.ErrorMessages)&&(n.ErrorMessages=[]);i.forEach(function(i){var u,r;h.isEmpty(i.ErrorCode)||i.ErrorCode=="0"?(u={Name:i.Name,Description:"",Id:i.Id},n.UploadedFiles.push(u),t.setFileQuestionAnswer(n)):(r={fileName:i.Name,message:""},i.ErrorCode=="1"||i.ErrorCode=="2"?r.message=e.getLocalizedString("_FILE_TYPE_RESTRICTION_MESSAGE_")+c.AllowedFileTypes.toString():(i.ErrorCode=="3"||i.ErrorCode=="2")&&(r.message=e.getLocalizedString("_FILE_SIZE_RESTRICTION_MESSAGE_")),n.ErrorMessages.push(r))})}function it(){var i=!1,r;return t.checkRequiredFields.value=="false"?(r=t.QuestionSet[t.QuestionSet.length-1],r.QuestionType==QuestionType.Decision?r.Answer&&(i=!0):i=!0):$("#questionForm").valid()&&(i=!0),n.wasFormSuccessfullySubmitted=i,i}function lt(n){nt();a.GoToState(n)}function nt(){t.setValidFormFlag(!0);t.hideAllPopovers()}function at(){t.$parent.validForm&&t.hideAllPopovers();t.setValidFormFlag(!1)}function vt(){var o=!1,u,n;try{var c=[],i=null,r=null,f=null,e=0,a=0;for(u=0;u<t.Questions.length;u++)if(n=t.Questions[u],!i||i==n.Id)if(i=null,c.push(n),n.QuestionType!=QuestionType.PersonInfo||t.isApplicantSetFromQuestion?n.QuestionType!=QuestionType.CompanyInfo||t.isApplicantSetFromQuestion?n.QuestionType==QuestionType.Payment?(e++,f=e==1?n.ExtraProperties.PaymentDetails.PageTitle:f,a+=Number(n.Answer.replace(",",""))):n.QuestionType==QuestionType.RelatedPersons&&n.RelatedPersons&&(!n.ExtraProperties.RelatedPersons.IsReadOnly&&n.FixedAnswers?(n.Answers=n.FixedAnswers,n.Answer=angular.toJson(n.FixedAnswers,!0)):n.ExtraProperties.RelatedPersons.IsReadOnly&&(n.Answers=n.RelatedPersons,n.Answer=angular.toJson(n.RelatedPersons,!0))):wt(n):pt(n),n.QuestionType==QuestionType.Decision){if(i=yt(n.ExtraProperties.QuestionDecisions,n.Answer),h.isEmpty(i)||i==Constants.GUID_EMPTY)break}else if(n.Restrictions&&n.ExtraProperties.GoToQuestionId)if(n.ExtraProperties.GoToQuestionId==Constants.GUID_EMPTY)break;else i=n.ExtraProperties.GoToQuestionId;else if(n.ExtraProperties.SkipToQuestionId&&(i=n.ExtraProperties.SkipToQuestionId,i==Constants.GUID_EMPTY))break;s.SetAnsweredQuestions(c);r=a.toString();r=r.slice(0,r.length-2)+","+r.slice(-2);y.UpdateEformStateInfo(["paymentQuestionCount","paymentAmount","paymentPageTitle"],[e,r,f]);o=!0}catch(v){l.console.log(v)}return o}function yt(n,t){for(var r=null,i=0;i<n.length;i++)if(n[i].TableValue==t){r=n[i].QuestionId;break}return r}function pt(n){n.PrimaryLoginRequired?(y.UpdateEformStateInfo(["applicantType"],[t.authenticatedUserType]),t.isApplicantSetFromQuestion=!0,v.SetCitizen(n.InfoList[0])):(y.UpdateEformStateInfo(["applicantType"],[ApplicantType.Anonymous]),t.isApplicantSetFromQuestion=!1,v.SetCitizen(null))}function wt(n){n.ExtraProperties.CompanyInfo.IsEHerkenningActivated||n.ExtraProperties.CompanyInfo.IsEIDASActivated?(y.UpdateEformStateInfo(["applicantType"],[t.authenticatedUserType]),t.isApplicantSetFromQuestion=!0,v.SetCompany(n.InfoList[0])):(y.UpdateEformStateInfo(["applicantType"],[ApplicantType.Anonymous]),t.isApplicantSetFromQuestion=!1,v.SetCompany(null))}function bt(){$(window).on("webapp:page:beforeunload",function(n){k(n)});t.$on("$stateChangeStart",function(n){k(n)});t.$on("saveEformDraft",function(n,i){k(n);t.saveEformDraft(i)});t.$on("gotoNextPage",function(n){k(n);t.nextQuestionIndex?it()&&(t.isFirstInputFocused=!1,g(t.nextQuestionIndex)):t.goToConfirmation();n.stopPropagation()});t.$on("gotoPreviousPageStart",function(n){k(n);s.QuestionStateInfo.StartQuestionIndex!=0&&(n.preventDefault(),g(t.QuestionSet[0].PreviousStartQuestionIndex))});t.$on("$destroy",function(){$(window).off("webapp:page:beforeunload")})}function k(n){h.isEmpty(t.Questions)||s.SetQuestions(t.Questions);t.showLocationServiceAlert=!1;w>0&&(n.preventDefault(),n.message=e.getLocalizedString("_WARNING_MESSAGE_FILEUPLOAD_INPROGRESS_"))}l.console.log("Load>>QuestionsController");var b=e.getLocalizedString("_OTHER_"),d=new SpinnerManager,w=0;rt();t.resetQuestionSet=function(n){var i=t.QuestionSet,r=i.indexOf(n);t.QuestionSet=i.slice(0,r)};t.formQuestionSet=function(n){var i,u,f;for(t.hideContinueButton=!y.eformStateInfo.isContinueButtonVisible,t.toEndEform=!1,t.nextQuestionIndex=null,i=n;i<t.Questions.length;i++){if(t.QuestionSet.push(t.Questions[i]),t.Questions[i].QuestionType==QuestionType.PersonInfo){var r=s.QuestionStateInfo.secondaryLoginQuestion.index,e=s.QuestionStateInfo.secondaryLoginQuestion.bsn,o=v.AuthenticatedUser?v.AuthenticatedUser.CitizenServiceNumber:null;if(t.Questions[i].PrimaryLoginRequired&&t.authenticatedUserType!=ApplicantType.Citizen&&t.authenticatedUserType!=ApplicantType.Eidas_Citizen||t.Questions[i].PrimaryLoginRequired&&t.authenticatedUserType===ApplicantType.Citizen&&!t.Questions[i].ExtraProperties.PersonInfo.IsDigidLoginActivated||t.Questions[i].PrimaryLoginRequired&&t.authenticatedUserType===ApplicantType.Eidas_Citizen&&!t.Questions[i].ExtraProperties.PersonInfo.IsEIDASLoginActivated||t.Questions[i].SecondaryLoginRequired&&!t.Questions[i].IsSigned&&t.Questions[i].Index!=r||t.Questions[i].Index==r&&o==e){t.hideContinueButton=!0;break}}else if(t.Questions[i].QuestionType==QuestionType.CompanyInfo)if(u=t.Questions[i].ExtraProperties.CompanyInfo.IsEHerkenningActivated||t.Questions[i].ExtraProperties.CompanyInfo.IsEIDASActivated,u&&t.authenticatedUserType!==ApplicantType.Company&&t.authenticatedUserType!==ApplicantType.Eidas_Company){t.hideContinueButton=!0;break}else if(t.authenticatedUserType!==ApplicantType.Company||t.Questions[i].ExtraProperties.CompanyInfo.IsEHerkenningActivated){if(t.authenticatedUserType===ApplicantType.Eidas_Company&&!t.Questions[i].ExtraProperties.CompanyInfo.IsEIDASActivated){t.hideContinueButton=!0;break}}else{t.hideContinueButton=!0;break}if(t.Questions[i].QuestionType==QuestionType.Header&&t.Questions[i].ExtraProperties.StartNewPage){if(t.QuestionSet.length>1){t.Questions[i].PreviousStartQuestionIndex=s.QuestionStateInfo.StartQuestionIndex;f=t.QuestionSet.pop();t.nextQuestionIndex=f.Index;break}else if(t.Questions[i].ExtraProperties.EndEform){t.hideContinueButton=!0;t.toEndEform=!0;p.trackEvent("EndEform",t.Questions[i].Title);break}else if(t.Questions[i].ExtraProperties.SkipToQuestionId&&i+1<t.Questions.length){t.pushNextQuestionSet(i);break}}else if(t.Questions[i].Restrictions){st(i);break}else if(t.Questions[i].ExtraProperties.SkipToQuestionId&&i+1<t.Questions.length){t.pushNextQuestionSet(i);break}else if(t.Questions[i].QuestionType==QuestionType.Header&&t.Questions[i].ExtraProperties.EndEform){t.hideContinueButton=!0;t.toEndEform=!0;p.trackEvent("EndEform",t.Questions[i].Title);break}else if(t.Questions[i].QuestionType==QuestionType.Decision)if(h.isEmpty(t.Questions[i].Answer))break;else{t.showNextQuestionSet(t.Questions[i],i);break}}ht()};t.pushNextQuestionSet=function(n){var i=t.getQuestionFromId(t.Questions[n].ExtraProperties.SkipToQuestionId,n);i?(t.Questions[n].ExtraProperties.GoToQuestionId=i.Id,n+1==i.Index?t.handlePageBreak(i):t.formQuestionSet(i.Index)):t.Questions[n].ExtraProperties.SkipToQuestionId!=Constants.GUID_EMPTY&&n+1<t.Questions.length?(t.Questions[n].ExtraProperties.GoToQuestionId=t.Questions[n+1].Id,t.formQuestionSet(n+1)):t.Questions[n].ExtraProperties.SkipToQuestionId==Constants.GUID_EMPTY&&(t.Questions[n].ExtraProperties.GoToQuestionId=Constants.GUID_EMPTY)};t.handlePageBreak=function(n){n&&(n.PreviousStartQuestionIndex=s.QuestionStateInfo.StartQuestionIndex,t.nextQuestionIndex=n.Index)};t.showNextQuestionSet=function(i,r){var f,u,e;for(n.isDraftSaved=!1,t.nextQuestionIndex=null,nt(),t.QuestionSet.splice(r+1,t.QuestionSet.length-1),f=Constants.GUID_EMPTY,u=0;u<i.ExtraProperties.QuestionDecisions.length;u++)if(i.ExtraProperties.QuestionDecisions[u].TableValue==i.Answer){f=i.ExtraProperties.QuestionDecisions[u].QuestionId;break}f!=Constants.GUID_EMPTY?(e=t.getQuestionFromId(f,i.Index),e&&t.formQuestionSet(e.Index)):(t.navigationOptions||(t.navigationOptions={}),t.navigationOptions.hideNext=!1)};t.getQuestionFromId=function(n,i){if(!h.isEmpty(n)&&n!=Constants.GUID_EMPTY&&!h.isEmpty(i))for(var r=i+1;r<t.Questions.length;r++)if(t.Questions[r].Id==n)return t.Questions[r]};t.uploadFiles=function(n){if(h.isEmpty(n.DisplayText)==!1&&!$.isEmptyObject(n.SelectedFiles)){var i=n.DocumentId;w++;p.trackEvent("FileUploadStarted",n.Title);o.uploadFiles(n.SelectedFiles,i,t.SessionId).then(function(t){l.console.log(t.data);tt(n,t.data);n.DisplayText="";w--;p.trackEvent("FileUploadSuccess",n.Title)},function(t){l.console.log(t);n.DisplayText="";w--;p.trackEvent("FileUploadError",n.Title)})}};t.setFileQuestionAsRequired=function(n){return n.IsMandatory?$.isEmptyObject(n.UploadedFiles)?!0:!1:!1};t.removeUploadedFile=function(n,i){n.UploadedFiles=h.removeObjectFromArray(n.UploadedFiles,"Id",i);h.isEmpty(n.UploadedFiles)?n.Answer=null:t.setFileQuestionAnswer(n);o.removeUploadedFile(i)};t.setFileQuestionAnswer=function(n){n.Answer=angular.toJson(n.UploadedFiles,!0)};t.OnKeyPressOnFileButton=function(n){n.key==="Enter"&&n.target.querySelector("input").click()};t.hasPropertyTableValues=function(n){return n.PropertyTable.PropertyTableValues!=null};t.showCustomAnswerInput=function(n,t){if((n.FixedAnswers||n.FixedAnswer)&&(n.FixedAnswer==b||$.inArray(b,n.FixedAnswers)>-1)){n.ShowCustomAnswerInput=!0;r(function(){$("#txtCustom-"+t).focus()},0);return}n.ShowCustomAnswerInput=!1};t.setQuestionsAnswer=function(n){if(n.FixedAnswers){var t=n.FixedAnswers.slice(),i=$.inArray(b,n.FixedAnswers);i>=0&&t.splice(i,1,n.CustomAnswer);n.Answers=t;n.Answer=angular.toJson(t)}else n.Answer=n.FixedAnswer?n.FixedAnswer==b?n.CustomAnswer:n.FixedAnswer:null};t.updateChecklist=function(n,i,r){if(n){n.FixedAnswers=n.FixedAnswers||[];var u=n.FixedAnswers.indexOf(i);u>-1?n.FixedAnswers.splice(u,1):n.FixedAnswers.push(i);i==b&&u==-1?t.showCustomAnswerInput(n,r):$.inArray(b,n.FixedAnswers)==-1&&(n.ShowCustomAnswerInput=!1);t.setQuestionsAnswer(n)}};t.isChecklistItemChecked=function(n,t){if(n&&n.FixedAnswers)return n.FixedAnswers.indexOf(t)>-1};t.setAnswer=function(n){if(n.Address)if(n.Address.ZipCode||n.Address.HouseNumber||n.Address.HouseLetter||n.Address.HouseNumberAddition||n.Address.StreetName||n.Address.City){var t=jQuery.extend(!0,{},n.Address);delete t.Suggestions;n.Answer=angular.toJson(t,!0);n.IsAnswered=!0}else n.Answer="",n.IsAnswered=!1};t.toggleContinue=function(n){n!=null&&(t.navigationOptions.hideNext=!n,y.UpdateEformStateInfo(["isContinueButtonVisible"],[n]))};t.initRelatedPersons=function(n){if(n.Restrictions){n.ExtraProperties.HideQuestion=!1;var i;t.relatedPersonsLoaded==!0&&n.Restrictions.QuestionIdIfFound?i=n.Restrictions.QuestionIdIfFound:t.relatedPersonsLoaded==!1&&n.Restrictions.QuestionIdIfNotFound?(i=n.Restrictions.QuestionIdIfNotFound,n.ExtraProperties.HideQuestion=n.Restrictions.HideQuestionIfNotFound):t.relatedPersonsLoaded==null&&n.Restrictions.QuestionIdIfUnknown?i=n.Restrictions.QuestionIdIfUnknown:v.AuthenticatedUser.Age&&Number(v.AuthenticatedUser.Age)<Number(n.Restrictions.ValueForAgeCheck)&&n.Restrictions.QuestionIdIfForAgeCheck&&(i=n.Restrictions.QuestionIdIfForAgeCheck,n.ExtraProperties.HideQuestion=n.Restrictions.HideQuestionForAgeCheck);t.handleNextQuestionSet(i,n)}};t.handleNextQuestionSet=function(n,i){if(n==Constants.GUID_EMPTY)i.ExtraProperties.GoToQuestionId=n,t.nextQuestionIndex=null;else{var r=t.getQuestionFromId(n,i.Index);r?(i.ExtraProperties.GoToQuestionId=r.Id,t.formQuestionSet(r.Index)):t.pushNextQuestionSet(i.Index)}};t.$on("ngRepeatFinished",function(){t.isFirstInputFocused||(t.focusFirstInput(),t.isFirstInputFocused=!0)});$(document).ready(function(){$("#questionForm").validate_popover({popoverPosition:"bottom"})});$(document).on("change",".btn-file :file",function(){var n=$(this),t=n.get(0).files?n.get(0).files.length:1,i=n.val().replace(/\\/g,"/").replace(/.*\//,"");n.trigger("fileselect",[t,i])});t.goToConfirmation=function(){r(function(){it()?(vt(),lt(Constants.WIZARD_STATE_CONFIRMATION)):at()})};t.openDatePicker=function(n,t){n.preventDefault();n.stopPropagation();t.Opened1=t.IsMandatory?!0:!1;t.Opened2=t.IsMandatory?!1:!0};t.onUpload=function(n,t){if(h.isEmpty(n)==!1){var i=n.split("\\"),r=i[i.length-1];t.DisplayText=r}t.ErrorMessages=[];d.startSpinner();w++;p.trackEvent("FileUploadStartedIE9",t.Title)};t.onError=function(n,t){l.console.log(n.data);d.stopSpinner();w--;p.trackEvent("FileUploadErrorIE9",t.Title)};t.onSuccess=function(n,t){l.console.log(n.data);tt(t,n.data);t.DisplayText="";ct(t);d.stopSpinner();w--;p.trackEvent("FileUploadSuccessIE9",t.Title)};n.alertLocationServiceDetails=function(){t.showLocationServiceAlert=!0}}])}(),function(){"use strict";var n=angular.module("eform");n.controller("RedirectController",["$timeout","$state","routingService","logService","commonService","cacheService","questionService",function(n,t,i,r,u,f,e){function s(){if(window.location.hash.indexOf("orderID")>-1)h(),i.SetRedirectionFlag(!0),n(function(){f.Put("CURRENT_ROUTE_STATE",Constants.WIZARD_STATE_SUMMARY);i.GoToState(Constants.WIZARD_STATE_SUMMARY)},500);else if(window.location.hash.indexOf("questionIndex")>-1){var t=o("questionIndex"),r=o("secondaryBsn");e.UpdateQuestionStateInfo(["secondaryLoginQuestion"],[{index:t,bsn:r}]);i.GoToState(Constants.WIZARD_STATE_QUESTION)}}function h(){var n=o("orderID"),t=o("PAYID"),i=o("amount"),r=o("BRAND"),f=parseInt(o("STATUS")),e=o("CARDNO"),s={PaymentDetails:{OrderId:n,PayId:t,Amount:i,Method:r,Status:f,CardNumber:e},Query:location.hash};u.SetPaymentResponse(s)}function o(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=i.exec(location.hash);return t===null?"":decodeURIComponent(t[1].replace(/\+/g," "))}r.console.log("Load>>RedirectController");s()}])}(),function(){"use strict";var n=angular.module("eform");n.controller("SummaryController",["$scope","$interval","localize","logService","commonService","dataService","routingService","healthMonitorService",function(n,t,i,r,u,f,e,o){function y(){u.ResetCache();u.GetCaseType().then(function(t){n.CaseType=t;p();n.$watch("eformResult",function(n){n&&v()})},null,null);var t=angular.element("#customerName").val();n.failureMessage=i.getLocalizedString("_DOWNLOAD_FAILED_");n.failureMessage=c(n.failureMessage,"[customername]",t);n.uploadFailureMessage=i.getLocalizedString("_UPLOAD_FAILED_");n.uploadFailureMessage=c(n.uploadFailureMessage,"[customername]",t)}function p(){var t=u.GetPaymentResponse();t!=null?(w(t),u.SetPaymentResponse(null)):(n.eformResult=u.GetEformResult(),n.eformResult&&n.eformResult.CaseNumber?s(1,n.eformResult.CaseNumber):s(2))}function w(t){f.processAfterPayment(t).success(function(i){n.eformResult=i;b(t.PaymentDetails.Status,n.eformResult.CaseNumber)}).error(function(n){r.console.log(n);e.GoToError("PaymentFailed")})}function b(t,i){switch(t){case PaymentStatus.Authorized:case PaymentStatus.Accepted:case PaymentStatus.PendingAcceptance1:case PaymentStatus.PendingAcceptance2:i?s(1,i):s(2);break;case PaymentStatus.Exception1:case PaymentStatus.Exception2:case PaymentStatus.Decline:i?s(3,i):s(2);break;case PaymentStatus.Cancel:n.setStateToActive(n.wizardStepsLength-2);s(4)}}function s(t,r){switch(t){case 1:o.trackPageView(window.location.pathname,"wizard.summary - Successful");n.summaryMessage=n.CaseType.FormSuccessfulMessage||i.getLocalizedString("_FORM_SUCCESSFUL_MESSAGE_");break;case 2:o.trackPageView(window.location.pathname,"wizard.summary - Unsuccessful");n.summaryMessage=n.CaseType.FormUnsuccessfulMessage||i.getLocalizedString("_FORM_UNSUCCESSFUL_MESSAGE_");break;case 3:o.trackPageView(window.location.pathname,"wizard.summary - Payment failed");n.summaryMessage=n.CaseType.FormPaymentFailedMessage||i.getLocalizedString("_FORM_PAYMENT_FAILED_MESSAGE_");break;case 4:o.trackPageView(window.location.pathname,"wizard.summary - Paymenr cancelled");n.summaryMessage=n.CaseType.FormPaymentCancelledMessage||i.getLocalizedString("_FORM_PAYMENT_CANCELLED_MESSAGE_")}n.eformResult&&(n.uploadFailed=n.eformResult.UploadFailed,n.uploadFailed&&r&&(n.uploadFailureMessage=n.uploadFailureMessage+" "+i.getLocalizedString("_MENTION_CASE_"),n.uploadFailureMessage=n.uploadFailureMessage.replace("**[","["),n.uploadFailureMessage=n.uploadFailureMessage.replace("]**","]"),n.uploadFailureMessage=c(n.uploadFailureMessage,"[casenumber]",r)));r&&(n.summaryMessage=c(n.summaryMessage,"[zaakkenmerk]",r),n.summaryMessage=c(n.summaryMessage,"[casenumber]",r))}function c(n,t,i){return n.split(t).join(i)}function v(){n.isPreparing=!0;f.getConfirmationPdfSize(n.eformResult.CorrelationId,n.eformResult.PdfFileName).success(function(i){n.isPreparing=!1;l++;h&&(t.cancel(h),h=null);n.isAvailable=!0;var r=parseFloat(i);n.pdfSize=r?" (pdf, "+r.toFixed(1)+" KiB)":" (pdf)"}).error(function(i,r){n.pdfSize="";l++;h||(console.log("GetConfirmationPdfSize request failed with status: "+r+", retrying."),h=t(v,5e3,a));l>a&&(n.isPreparing=!1)})}r.console.log("Load>>SummaryController");var a=12,l=0,h=null;n.isPreparing=!0;n.isAvailable=!1;n.uploadFailed=!1;y();n.downloadConfirmationPdf=function(){f.getDownloadFileToken(n.eformResult.CorrelationId,n.eformResult.PdfFileName).success(function(n){if(n){var t=f.webApiUrl+"/Utility/DownloadConfirmationPdf?token="+n;window.open(t,"_parent")}}).error(function(n,t){console.log("DownloadConfirmationPdf request failed with status: "+t)})}}])}(),function(){"use strict";var n=angular.module("eform");n.controller("WizardController",["$rootScope","$scope","$state","$q","logService","localize","configuration","commonService","utilityService","cacheService","questionService",function(n,t,i,r,u,f,e,o,s,h,c){function a(){y();t.sPreviewAlert=f.getLocalizedString("_FORM_PREVIEW_ALERT1_");t.sOn=f.getLocalizedString("_ON_");t.sOff=f.getLocalizedString("_OFF_")}function y(){var n=o.GetCaseType().then(function(n){t.caseType=n},null,null),i=c.GetQuestions().then(function(n){t.questions=n},null,null);r.all([n,i]).then(function(){p(t.caseType);w();v();b();t.updateQuestionDisplayName(t.amountQuestionsCompleted)})}function p(n){t.questionString1=f.getLocalizedString("_QUESTIONS_");t.questionString2=s.formatString("{0}<br/>({1}{2})",[f.getLocalizedString("_QUESTIONS_"),"PROGRESS_PERCENTAGE","%"]);t.wizardSteps=[];t.questionStepId=-1;s.isEmpty(n.FormIntroductionText)||t.wizardSteps.push({id:t.wizardSteps.length+1,state:Constants.WIZARD_STATE_INTRODUCTION,displayName:f.getLocalizedString("_INTRODUCTION_"),status:WizardStepStatus.Unvisited});t.questionStepId=t.wizardSteps.length;t.wizardSteps.push({id:t.wizardSteps.length+1,state:Constants.WIZARD_STATE_QUESTION,displayName:f.getLocalizedString("_QUESTIONS_"),status:WizardStepStatus.Unvisited});t.wizardSteps.push({id:t.wizardSteps.length+1,state:Constants.WIZARD_STATE_CONFIRMATION,displayName:f.getLocalizedString("_CONFIRMATION_"),status:WizardStepStatus.Unvisited});c.QuestionStateInfo.HasPaymentQuestion&&t.wizardSteps.push({id:t.wizardSteps.length+1,state:"payment",displayName:f.getLocalizedString("_PAYMENT_"),status:WizardStepStatus.Unvisited});t.wizardSteps.push({id:t.wizardSteps.length+1,state:Constants.WIZARD_STATE_SUMMARY,displayName:f.getLocalizedString("_SUMMARY_"),status:WizardStepStatus.Unvisited})}function w(){t.wizardStepsLength=t.wizardSteps.length;t.progressValue=100/(t.wizardStepsLength-1);t.abcxyz=0}function v(){var r=i.$current.self.name,n;for(r||(r=h.Get("CURRENT_ROUTE_STATE",null)),n=0;n<t.wizardSteps.length;)if(t.wizardSteps[n].state==r){l(n);n++;break}else t.wizardSteps[n].status=WizardStepStatus.Visited,n++;for(;n<t.wizardSteps.length;n++)t.wizardSteps[n].status=WizardStepStatus.Unvisited}function b(){t.$on("$stateChangeSuccess",function(){v();t.setValidFormFlag(!0)})}function l(n){t.wizardSteps&&(t.wizardSteps[n].status=WizardStepStatus.Active,t.activeStepName=t.wizardSteps[n].displayName.replace("<br/>"," "),t.activeStepText=s.formatString("{0} {1} {2} {3}",[f.getLocalizedString("_STEP_"),n+1,f.getLocalizedString("_OF_"),t.wizardStepsLength]),t.abcxyz=n*t.progressValue)}u.console.log("Load>>WizardController");t.validForm=!0;t.amountQuestionsCompleted=1;t.isPreview=window.location.pathname.indexOf("voorbeeld")>-1;t.checkRequiredFields={value:o.eformStateInfo.checkRequiredFields};n.$on("localizeResourcesUpdates",a);f.resourceFileLoaded&&a();t.updateQuestionDisplayName=function(n){if(t.questionStepId>-1){if(n==0&&(t.wizardSteps[t.questionStepId].displayName=f.getLocalizedString("_QUESTIONS_")),t.wizardSteps[t.questionStepId].status==WizardStepStatus.Unvisited&&(t.wizardSteps[t.questionStepId].displayName=t.questionString1),t.wizardSteps[t.questionStepId].status==WizardStepStatus.Active){c.QuestionStateInfo.MaxNumberOfQuestions<=0&&(t.questionString2=f.getLocalizedString("_QUESTIONS_"));var i=((n-1)/c.QuestionStateInfo.MaxNumberOfQuestions*100).toFixed(0);isNaN(+i)||(t.wizardSteps[t.questionStepId].displayName=t.questionString2.replace("PROGRESS_PERCENTAGE",i),t.activeStepName=t.wizardSteps[t.questionStepId].displayName.replace("<br/>"," "))}}else t.amountQuestionsCompleted=n};t.setPaymentToActive=function(){l(t.wizardStepsLength-2);t.wizardSteps[t.wizardStepsLength-1].status=WizardStepStatus.Unvisited};t.setStateToActive=function(n){if(t.wizardSteps){for(var i=0;i<n;i++)t.wizardSteps[i].status=WizardStepStatus.Visited;for(l(i),i++;i<t.wizardSteps.length;i++)t.wizardSteps[i].status=WizardStepStatus.Unvisited}};t.setValidFormFlag=function(n){t.validForm=n};t.setCheckRequiredFlag=function(){o.UpdateEformStateInfo(["checkRequiredFields"],[t.checkRequiredFields.value])}}])}()