webpackJsonp([2],{233:function(n,t,i){i(234);i(236);i(240);i(241);i(242);i(187);i(244);i(246);i(188);i(189);n.exports=i(190)},234:function(n,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(7),u=r.module("assessmentApp",["ngRoute","ngMessages","assessmentControllers","assessmentFactory","assessmentDirectives","assessmentFilters"]);u.config(["$routeProvider","$locationProvider",function(n,t){t.html5Mode(!0);n.when("/assessment",{templateUrl:"/Scripts/AssessmentApp/forms/form-select.html?ver=1517797063882",controllerAs:"idxCtrl",controller:"indexController"}).when("/assessment/:form/:page",{templateUrl:"/Scripts/AssessmentApp/forms/main.html?ver=1517797063882",controllerAs:"mainCtrl",controller:"mainController"}).when("/assessment/thankyou",{templateUrl:"/Scripts/AssessmentApp/forms/thankyou.html?ver=1517797063882",controllerAs:"thanksCtrl",controller:"thanksController"}).otherwise({redirectTo:"/assessment"})}])},236:function(n,t,i){"use strict";var o,s,h,c,l,a,f;Object.defineProperty(t,"__esModule",{value:!0});var r=i(7),e=i(0),u=i(239),v=function(){function n(n,t,i,f,e,o){var s=this;this.$scope=n;this.$location=t;this.$timeout=i;this.$window=f;this.assessmentService=e;this.assessmentShared=o;this.showLoadForm=!1;this.loadFormSubmit=!1;this.isLoading=!1;this.notExist=!1;this.errored=!1;this.errorMessage="";this.applyOrSponsor=null;this.flags=0;this.flagA=1;this.flagB=2;this.flagC=4;this.flagD=8;this.flagE=16;this.flagF=32;this.flagG=64;this.flagH=128;this.flagI=256;this.flagJ=512;this.flagK=1024;this.flagL=2048;this.flagM=4096;this.flagN=8192;this.flagO=16384;this.flagP=32768;this.flagQ=65536;this.flagR=131072;this.applyFlags=this.flagA|this.flagB|this.flagC|this.flagD|this.flagE|this.flagF|this.flagG|this.flagH|this.flagI;this.sponsorFamilyFlags=this.flagJ|this.flagK|this.flagL|this.flagM;this.sponsorEmployeeFlags=this.flagN|this.flagO|this.flagP;this.appealFlags=this.flagQ|this.flagR;this.goToNext=function(n){var t,i;(n||s.frmFormSelect.$valid)&&(t={id:"",pages:[]},r.forEach(s.formDetails,function(n){n.id===s.selectedForm&&(t=n)}),s.applyOrSponsor==="apply"||s.applyOrSponsor==="appeal"?s.assessmentShared.isApplicantSet(!0):s.assessmentShared.isApplicantSet(!1),s.assessmentShared.selectedFormSet(t),s.assessmentShared.applyOrSponsorSet(s.applyOrSponsor),n||s.assessmentShared.model&&s.assessmentShared.model.formType===t.id&&s.assessmentShared.model.applyOrSponsor===s.applyOrSponsor||(i=new u.Model,i.formType=t.id,i.applyOrSponsor=s.applyOrSponsor,s.assessmentShared.model=u.Model.buildApplication(i)),s.$location.path("/assessment/"+t.id+"/"+t.pages[0].replace(/\s/g,"-")))};this.loadFormShow=function(){s.username="";s.pin="";s.showLoadForm=!0;s.loadFormSubmit=!1;s.isLoading=!1;s.notExist=!1;s.errored=!1;s.errorMessage=""};this.formLoad=function(){s.loadForm.$valid&&(s.isLoading=!0,s.assessmentService.loadForm({username:s.username,pin:s.pin}).$promise.then(function(n){s.showLoadForm=!1;var t=r.fromJson(n.FormDetails);t.loadedFormId=n.Id;n.Cloned===!0&&s.clearUploadedFilesForClonedForm(t);s.assessmentShared.model=u.Model.buildApplication(t);r.forEach(s.formDetails,function(n){if(n.id===t.formType)return s.selectedForm=n.id,!1});s.$timeout(function(){s.goToNext(!0)},500)}).catch(function(n){n.status===400?(s.notExist=!0,s.errored=!1,s.isLoading=!1):n.status===500&&(s.errored=!0,s.errorMessage=n.data.Message,s.notExist=!1,s.isLoading=!1)}))};this.cancelLoadForm=function(){s.showLoadForm=!1};this.initializeController()}return n.prototype.initializeController=function(){var n=this,t;this.formTypes=this.assessmentShared.formTypesGet();this.formDetails=this.assessmentShared.formDetailsGet();t=this.assessmentShared.selectedFormGet();t&&(this.selectedForm=t.id);this.applyOrSponsor=this.assessmentShared.applyOrSponsorGet();this.assessmentService.getBusiness().$promise.then(function(t){var i=r.fromJson(t.d);n.assessmentShared.businessNameSet(i.Name);n.businessId=i.Id;n.assessmentShared.businessIdSet(i.Id);n.flags=i.AssessmentFlags;n.assessmentShared.businessTermsSet(i.Terms)});this.$window!==this.$window.parent&&this.$timeout(function(){r.element("div#portalLogo").hide()},10)},n.prototype.clearUploadedFilesForClonedForm=function(n){n.decision&&(n.decision.decisionFile=[],n.decision.fileLocation=null);n.applicantDetails&&(n.applicantDetails.resumeFile=[],n.applicantDetails.resumeLocation=null)},n.$inject=["$scope","$location","$timeout","$window","assessmentService","assessmentShared"],n}();t.IndexController=v;o=function(){function n(n,t,i,r){var u=this;this.$scope=n;this.$routeParams=t;this.$location=i;this.assessmentShared=r;this.getPageName=function(n){return n.replace(/\s/g,"-")};this.getPageNumber=function(){return u.selectedForm?u.selectedForm.pages.indexOf(u.$routeParams.page.replace(/-/g," ")):-1};this.getWidth=function(){var n=99.9/(u.selectedForm?u.selectedForm.pages.length:1);return{width:n+"%"}};this.goToPage=function(n){u.selectedForm&&u.$location.path("/assessment/"+u.selectedForm.id+"/"+u.getPageName(n));u.$location.path("/assessment")};this.initializeController()}return n.prototype.initializeController=function(){this.selectedForm=this.assessmentShared.selectedFormGet()},n.$inject=["$scope","$routeParams","$location","assessmentShared"],n}();t.ProgressController=o;s=function(){function n(n,t,i,u,f,e){var o=this;this.$scope=n;this.$timeout=t;this.$location=i;this.$routeParams=u;this.assessmentService=f;this.assessmentShared=e;this.currentPageIndex=0;this.showSubmitForm=!1;this.showSaveProgressForm=!1;this.isSaving=!1;this.success=!1;this.errored=!1;this.errorMessage="";this.showSave=!0;this.username="";this.repeatUsername="";this.pin="";this.getNextText=function(){return o.isLastPage()?(o.showSave=!1,"Submit"):(o.showSave=!0,"Next")};this.goToPrev=function(){$("form#assessmentForm").addClass("form-min-height");o.currentPageIndex!==0&&o.selectedForm?o.$location.path("/assessment/"+o.selectedForm.id+"/"+o.selectedForm.pages[o.currentPageIndex-1].replace(/\s/g,"-")):o.$location.path("/assessment/")};this.goToNext=function(){o.$scope.mainCtrl.formSubmitted=!0;o.$timeout(function(){var n=o.$scope.assessmentForm;n.$valid&&($("form#assessmentForm").addClass("form-min-height"),o.isLastPage()?o.submit():o.selectedForm?o.$location.path("/assessment/"+o.selectedForm.id+"/"+o.selectedForm.pages[o.currentPageIndex+1].replace(/\s/g,"-")):o.$location.path("/assessment/"))})};this.submit=function(){if(!o.isSaving){o.showSubmitForm=!0;o.isSaving=!0;var n=o.assessmentShared.model,t={Id:n.loadedFormId,Username:o.username,Pin:o.pin,Submitted:!0,FormDetails:r.toJson(n),ResumeId:n.applicantDetails?n.applicantDetails.resumeLocation:null,DecisionId:n.decision?n.decision.fileLocation:null,Cloned:!1};if(n.loadedFormId===null){o.assessmentService.saveForm(t).$promise.then(function(t){n.loadedFormId=t.Id;o.submitSucceeded()}).catch(function(n){var t=n.data?n.data.Message:"Connection was interrupted";o.showSaveOrSubmitError(t)});return}o.assessmentService.updateForm(t).$promise.then(function(){o.submitSucceeded()}).catch(function(n){var t=n.data?n.data.Message:"Connection was interrupted";o.showSaveOrSubmitError(t)})}};this.saveProgressClick=function(){o.username="";o.repeatUsername="";o.pin="";o.showSaveProgressForm=!0;o.assessmentShared.model.loadedFormId!==null&&o.saveProgress()};this.saveProgress=function(){if(!o.isSaving&&o.saveProgressForm.$valid===!0){o.isSaving=!0;var n=o.assessmentShared.model,t={Id:n.loadedFormId,Username:o.username,Pin:o.pin,Submitted:!1,FormDetails:r.toJson(n),ResumeId:n.applicantDetails?n.applicantDetails.resumeLocation:null,DecisionId:n.decision?n.decision.fileLocation:null,Cloned:!1};if(n.loadedFormId===null){o.assessmentService.saveForm(t).$promise.then(function(t){n.loadedFormId=t.Id;o.isSaving=!1;o.success=!0;o.$timeout(function(){o.showSaveProgressForm=!1},1e3)}).catch(function(n){var t=n.data?n.data.Message:"Connection was interrupted";o.showSaveOrSubmitError(t)});return}o.assessmentService.updateForm(t).$promise.then(function(){o.isSaving=!1;o.success=!0;o.$timeout(function(){o.showSaveProgressForm=!1},1e3)}).catch(function(n){var t=n.data?n.data.Message:"Connection was interrupted";o.showSaveOrSubmitError(t)})}};this.closeSubmitForm=function(){o.showSubmitForm=!1;o.errored=!1;o.errorMessage=""};this.closeSaveProgressForm=function(){o.showSaveProgressForm=!1;o.username="";o.repeatUsername="";o.pin="";o.errored=!1;o.errorMessage=""};this.initializeController()}return n.prototype.initializeController=function(){this.selectedForm=this.assessmentShared.selectedFormGet();this.currentPageIndex=this.selectedForm?this.selectedForm.pages.indexOf(this.$routeParams.page.replace(/-/g," ")):-1},n.prototype.isLastPage=function(){return this.selectedForm?this.currentPageIndex+1===this.selectedForm.pages.length:!0},n.prototype.showSaveOrSubmitError=function(n){this.errored=!0;this.errorMessage=n;this.isSaving=!1},n.prototype.submitSucceeded=function(){var n=this;this.isSaving=!1;this.success=!0;this.$timeout(function(){n.showSubmitForm=!1;n.$timeout(function(){n.$location.path("/assessment/thankyou")},500)},800)},n.$inject=["$scope","$timeout","$location","$routeParams","assessmentService","assessmentShared"],n}();t.ButtonsController=s;h=function(){function n(n,t,i,r,f,o,s,h,c){var l=this;this.$scope=n;this.$location=t;this.$routeParams=i;this.$timeout=r;this.$anchorScroll=f;this.$window=o;this.$sce=s;this.assessmentService=h;this.assessmentShared=c;this.showTerms=!1;this.formSubmitted=!1;this.fileInProgress=!1;this.enquiryType="visa";this.getApplicantText=function(n){var t="";switch(n){case 1:t=l.isApplicant?"Your ":"Applicants ";break;case 2:t=l.isApplicant?"Are you ":"Is the applicant ";break;case 3:t=l.isApplicant?"You ":"The applicant ";break;case 4:t=l.isApplicant?"Do you ":"Does the applicant ";break;case 5:t=l.isApplicant?"Have you ":"Has the applicant ";break;case 6:t=l.isApplicant?"You have ":"The applicant has ";break;default:t=""}return t};this.ageDifference=function(n){var i=e(),t=e(n,"DD-MM-YYYY");return t.isValid()?e.duration(i.diff(t)).asYears():null};this.getFormPart=function(){return l.$timeout(function(){$("form#assessmentForm").removeClass("form-min-height")},100,!1),"/Scripts/AssessmentApp/templates/"+l.$routeParams.page+".html?ver=1517797063882"};this.resetSponsor=function(){l.model.hasSponsor==="true"&&l.model.sponsorDetails===null?l.model.sponsorDetails=new u.SponsorDetails:l.model.hasSponsor==="false"&&(l.model.sponsorDetails=null)};this.getNameApplicant=function(){return l.model.applicantDetails.firstName+" "+l.model.applicantDetails.surname};this.getNameSponsor=function(){return l.model.sponsorDetails.firstName.length>0?l.model.sponsorDetails.firstName+" "+l.model.sponsorDetails.surname:l.model.contactDetails.firstName+" "+l.model.contactDetails.surname};this.removeFile=function(n){var t={id:"",key:""};n==="resume"&&(t.id=l.model.applicantDetails.resumeLocation,t.key=l.model.applicantDetails.resumeFile[0].key);n==="decision"&&(t.id=l.model.decision.fileLocation,t.key=l.model.decision.decisionFile[0].key);l.assessmentService.deleteFile(t).$promise.then(function(){n==="resume"&&(l.model.applicantDetails.resumeLocation="",l.model.applicantDetails.resumeFile=[]);n==="decision"&&(l.model.decision.fileLocation="",l.model.decision.decisionFile=[])}).catch(function(n){alert(n.data.Message)})};this.openTerms=function(){l.showTerms=!0};this.onHide=function(){l.showTerms=!1};this.relationshipChange=function(){l.model.relationshipPartner.metInPerson=l.model.relationshipPartner.status!=="engaged"||l.model.relationshipPartner.status!=="interdependent"?"true":""};this.typeChange=function(n){l.enquiryType=n;n!=="business"?(l.assessmentShared.model.employer=null,l.assessmentShared.model.applicantDetails=new u.ApplicantDetails,l.assessmentShared.model.applyOrSponsor="apply"):(l.assessmentShared.model.applicantDetails=null,l.assessmentShared.model.employer=new u.EmployerDetails,l.assessmentShared.model.applyOrSponsor="sponsorEmployee")};this.initializeController()}return n.prototype.initializeController=function(){var n=this,t,i;if(this.formTypes=this.assessmentShared.formTypesGet(),this.allForms=this.assessmentShared.formDetailsGet(),this.businessName=this.assessmentShared.businessNameGet(),this.maritalStatus=this.assessmentShared.maritalStatusGet(),this.titles=this.assessmentShared.titlesGet(),this.qualificationsList=this.assessmentShared.educationLevelsGet(),this.isApplicant=this.assessmentShared.isApplicantGet(),this.relationTypes=this.assessmentShared.relationTypesGet(),this.visaStatus=this.assessmentShared.visaStatusGet(),this.employmentStatus=this.assessmentShared.employmentStatusGet(),this.childRelationTypes=this.assessmentShared.childRelationTypesGet(),this.parentRelationTypes=this.assessmentShared.parentRelationTypesGet(),this.industryTypes=this.assessmentShared.industryTypesGet(),this.ownershipTypes=this.assessmentShared.ownershipTypesGet(),this.assetAmounts=this.assessmentShared.assetAmountsGet(),this.phoneTypes=this.assessmentShared.phoneTypesGet(),this.businessExperience=this.assessmentShared.businessExperienceGet(),this.showTerms=!1,this.terms=this.$sce.trustAsHtml(this.assessmentShared.businessTermsGet()),this.businessId=this.assessmentShared.businessIdGet(),this.formSubmitted=!1,this.fileInProgress=!1,r.element("footer").css("margin-top","15px"),this.$window!==this.$window.parent&&this.$timeout(function(){r.element("div#portalLogo").hide()},10),this.$location.hash("nav-top"),this.$anchorScroll(),this.assessmentShared.selectedFormGet()===null){if(this.$location.path().indexOf("general-enquiry")<=0){this.$location.path("/assessment/");return}t={id:"",pages:[]};r.forEach(this.allForms,function(i){i.id===n.formTypes.generic&&(t=i)});this.assessmentShared.selectedFormSet(t);i=new u.Model;i.formType=t.id;this.assessmentShared.model=u.Model.buildApplication(i)}this.selectedForm=this.assessmentShared.selectedFormGet();this.model=this.assessmentShared.model;this.$timeout(function(){typeof n.model.applicantDetails!="undefined"&&n.model.applicantDetails!==null&&n.$scope.$watch(function(){return typeof n.model.applicantDetails!="undefined"&&n.model.applicantDetails!==null?n.model.applicantDetails.numChildren:0},function(t){var i,r;if(typeof t!="undefined"&&typeof n.model.applicantDetails!="undefined"&&n.model.applicantDetails!==null)if(n.model.applicantDetails.childList.length<t)for(i=n.model.applicantDetails.childList.length;i<t;i++)n.model.applicantDetails.childList.push("");else for(r=n.model.applicantDetails.childList.length;r>t;r--)n.model.applicantDetails.childList.pop()})});(typeof this.selectedForm=="undefined"||this.selectedForm&&this.selectedForm.id===this.formTypes.generic)&&(this.typeChange("visa"),this.assessmentShared.businessIdGet()||this.assessmentService.getBusiness().$promise.then(function(t){var i=r.fromJson(t.d);n.assessmentShared.businessNameSet(i.Name);n.businessId=i.Id;n.assessmentShared.businessIdSet(i.Id);n.flags=i.AssessmentFlags;n.assessmentShared.businessTermsSet(i.Terms);n.terms=n.$sce.trustAsHtml(i.Terms.replace(/&lt;&lt;Firm Name&gt;&gt;/g,i.Name))}))},n.$inject=["$scope","$location","$routeParams","$timeout","$anchorScroll","$window","$sce","assessmentService","assessmentShared"],n}();t.MainController=h;c=function(){function n(n,t,i,r,u,f){this.$scope=n;this.$timeout=t;this.$window=i;this.$location=r;this.$anchorScroll=u;this.assessmentShared=f;this.initializeController()}return n.prototype.initializeController=function(){this.businessId=this.assessmentShared.businessIdGet();this.$location.hash("nav-top");this.$anchorScroll();this.$window!==this.$window.parent&&this.$timeout(function(){r.element("div#portalLogo").hide()},10)},n.$inject=["$scope","$timeout","$window","$location","$anchorScroll","assessmentShared"],n}();t.ThanksController=c;l=function(){function n(n,t,i,r){var f=this;this.$scope=n;this.$location=t;this.$anchorScroll=i;this.assessmentShared=r;this.showAddOtherModal=!1;this.addOtherFormSubmit=!1;this.showNotIncludedModal=!1;this.notIncludedFormSubmit=!1;this.addOrEdit="";this.addPerson=function(n){f.newPerson=new u.personModel(n,"","","","","","","","","","","","","","","",[],[],!1,"","","","","","","","","","",[],[],"");n===f.personType.other?(f.showAddOtherModal=!0,f.addOtherFormSubmit=!1):(f.showNotIncludedModal=!0,f.notIncludedFormSubmit=!1);f.addOrEdit="add"};this.editPerson=function(n,t){t===f.personType.other?(f.showAddOtherModal=!0,f.addOtherFormSubmit=!1):(f.showNotIncludedModal=!0,f.notIncludedFormSubmit=!1);f.addOrEdit="edit";f.newPerson=f.assessmentShared.model.applicantDetails.personList[n]};this.showList=function(n){var t=f.assessmentShared.model.applicantDetails.personList.filter(function(t){return t.type===n});return t.length>0};this.removePerson=function(n){f.assessmentShared.model.applicantDetails.personList.splice(n,1)};this.cancelAddOtherModal=function(){f.addOrEdit==="add"&&(f.newPerson=null);f.showAddOtherModal=!1;f.addOtherFormSubmit=!1;f.showNotIncludedModal=!1;f.notIncludedFormSubmit=!1};this.saveOther=function(){f.addOtherFormSubmit=!0;f.addOtherForm.$valid&&(f.addOrEdit==="add"&&f.assessmentShared.model.applicantDetails.personList.push(f.newPerson),f.showAddOtherModal=!1,f.addOtherFormSubmit=!1)};this.saveNotIncluded=function(){f.notIncludedFormSubmit=!0;f.frmNotIncluded.$valid&&(f.addOrEdit==="add"&&f.assessmentShared.model.applicantDetails.personList.push(f.newPerson),f.showNotIncludedModal=!1,f.notIncludedFormSubmit=!1)};this.isOverAge=function(){var n,t;return f.newPerson&&(n=e(f.newPerson.dob,"DD-MM-YYYY"),!isNaN(n))?(t=n.add(23,"y"),t.isBefore(e())):!1};this.scrollToList=function(n){this.$location.hash(n);this.$anchorScroll()};this.initializeController()}return n.prototype.initializeController=function(){this.personType=this.assessmentShared.personTypeGet()},n.$inject=["$scope","$location","$anchorScroll","assessmentShared"],n}();t.OtherFamilyController=l;a=function(){function n(n,t){this.$scope=n;this.assessmentShared=t;this.initializeController()}return n.prototype.initializeController=function(){this.appealDecisionBy=this.assessmentShared.appealDecisionByGet();this.notifiedBy=this.assessmentShared.decisionNotifiedByGet()},n.$inject=["$scope","assessmentShared"],n}();t.DecisionController=a;f=r.module("assessmentControllers",[]);f.controller("indexController",v);f.controller("progressController",o);f.controller("buttonsController",s);f.controller("mainController",h);f.controller("thanksController",c);f.controller("otherFamilyController",l);f.controller("decisionController",a);f.controller("healthController",["$scope","assessmentShared",function(n,t){var i=this,r;i.personTypes=t.personTypeGet();i.selectedHealthPerson={};i.selectedCrimePerson={};i.selectedRefusedPerson={};i.selectedCancelledPerson={};i.condition="";i.crime="";i.refused="";i.refused="";i.healthList=[];i.crimeList=[];i.refusedList=[];i.cancelledList=[];i.showAddHealth=!1;i.addHealthFormSubmit=!1;i.showAddOffence=!1;i.addOffenceFormSubmit=!1;i.showAddRefused=!1;i.addRefusedFormSubmit=!1;i.showAddCancelled=!1;i.addCancelledFormSubmit=!1;i.personList=[];r=function(){var r=[],n,u;return t.model.applicantDetails!==null&&(n={idx:-1,type:i.personTypes.applicant,name:t.model.applicantDetails.firstName+" "+t.model.applicantDetails.surname},r.push(n),$.each(t.model.applicantDetails.healthCondition,function(t,r){i.healthList.push({person:n,condition:r})}),$.each(t.model.applicantDetails.applicantCrime,function(t,r){i.crimeList.push({person:n,crime:r})}),$.each(t.model.applicantDetails.refusedVisa,function(t,r){i.refusedList.push({person:n,refused:r})}),$.each(t.model.applicantDetails.cancelledVisa,function(t,r){i.cancelledList.push({person:n,cancelled:r})})),t.model.sponsorDetails!==null&&(u={idx:-1,type:i.personTypes.sponsor,name:t.model.sponsorDetails.firstName+" "+t.model.sponsorDetails.surname},r.push(u),$.each(t.model.sponsorDetails.healthDetails,function(n,t){i.healthList.push({person:u,condition:t})}),$.each(t.model.sponsorDetails.convictionDetails,function(n,t){i.crimeList.push({person:u,crime:t})})),$.each(t.model.applicantDetails.personList,function(n,u){var f={idx:n,type:u.type,name:u.firstName+" "+u.surname};r.push(f);$.each(t.model.applicantDetails.personList[n].healthCondition,function(n,t){i.healthList.push({person:f,condition:t})});$.each(t.model.applicantDetails.personList[n].applicantCrime,function(n,t){i.crimeList.push({person:f,crime:t})});$.each(t.model.applicantDetails.personList[n].refusedVisa,function(n,t){i.refusedList.push({person:f,refused:t})});$.each(t.model.applicantDetails.personList[n].cancelledVisa,function(n,t){i.cancelledList.push({person:f,cancelled:t})})}),r};i.personList=i.personList.length>0?i.personList:r();i.removeHealthCondition=function(n,r,u){var f;n.type===i.personTypes.applicant?(f=t.model.applicantDetails.healthCondition.indexOf(r),t.model.applicantDetails.healthCondition.splice(f,1),t.model.applicantDetails.healthCondition.length<1&&(t.model.applicantDetails.hasHealthCondition=!1)):n.type===i.personTypes.sponsor?(f=t.model.sponsorDetails.healthDetails.indexOf(r),t.model.sponsorDetails.healthDetails.splice(f,1),t.model.sponsorDetails.healthDetails.length<1&&(t.model.sponsorDetails.hasHealthCondition=!1)):(f=t.model.applicantDetails.personList[n.idx].healthCondition.indexOf(r),t.model.applicantDetails.personList[n.idx].healthCondition.splice(f,1));i.healthList.splice(u,1)};i.removeCrimePerson=function(n,r,u){var f;n.type===i.personTypes.applicant?(f=t.model.applicantDetails.applicantCrime.indexOf(r),t.model.applicantDetails.applicantCrime.splice(f,1),t.model.applicantDetails.applicantCrime.length<1&&(t.model.applicantDetails.hasApplicantCrime=!1)):n.type===i.personTypes.sponsor?(f=t.model.sponsorDetails.convictionDetails.indexOf(r),t.model.sponsorDetails.convictionDetails.splice(f,1),t.model.sponsorDetails.convictionDetails.length<1&&(t.model.sponsorDetails.hasBeenConvicted=!1)):(f=t.model.applicantDetails.personList[n.idx].applicantCrime.indexOf(r),t.model.applicantDetails.personList[n.idx].applicantCrime.splice(f,1));i.crimeList.splice(u,1)};i.addHealthCondition=function(){i.addHealthFormSubmit=!0;i.frmAddHealth.$valid&&typeof i.selectedHealthPerson.type!="undefined"&&i.condition!==""&&(i.selectedHealthPerson.type===i.personTypes.applicant?(t.model.applicantDetails.hasHealthCondition=!0,t.model.applicantDetails.healthCondition.push(i.condition)):i.selectedHealthPerson.type===i.personTypes.sponsor?(t.model.sponsorDetails.hasHealthCondition=!0,t.model.sponsorDetails.healthDetails.push(i.condition)):t.model.applicantDetails.personList[i.selectedHealthPerson.idx].healthCondition.push(i.condition),i.healthList.push({person:i.selectedHealthPerson,condition:i.condition}),i.selectedHealthPerson={},i.condition="",i.showAddHealth=!1,i.addHealthFormSubmit=!1)};i.addCrimePerson=function(){i.addOffenceFormSubmit=!0;i.frmAddOffence.$valid&&typeof i.selectedCrimePerson.type!="undefined"&&i.crime!==""&&(i.selectedCrimePerson.type===i.personTypes.applicant?(t.model.applicantDetails.hasApplicantCrime=!0,t.model.applicantDetails.applicantCrime.push(i.crime)):i.selectedCrimePerson.type===i.personTypes.sponsor?(t.model.sponsorDetails.hasBeenConvicted=!0,t.model.sponsorDetails.convictionDetails.push(i.crime)):t.model.applicantDetails.personList[i.selectedCrimePerson.idx].applicantCrime.push(i.crime),i.crimeList.push({person:i.selectedCrimePerson,crime:i.crime}),i.selectedCrimePerson={},i.crime="",i.showAddOffence=!1,i.addOffenceFormSubmit=!1)};i.addRefusedPerson=function(){i.addRefusedFormSubmit=!0;i.frmAddRefused.$valid&&typeof i.selectedRefusedPerson.type!="undefined"&&i.refused!==""&&(i.selectedRefusedPerson.type===i.personTypes.applicant?t.model.applicantDetails.refusedVisa.push(i.refused):t.model.applicantDetails.personList[i.selectedRefusedPerson.idx].refusedVisa.push(i.refused),i.refusedList.push({person:i.selectedRefusedPerson,refused:i.refused}),i.selectedRefusedPerson={},i.refused="",i.showAddRefused=!1,i.addRefusedFormSubmit=!1)};i.removeRefusedPerson=function(n,r,u){var f;n.type===i.personTypes.applicant?(f=t.model.applicantDetails.refusedVisa.indexOf(r),t.model.applicantDetails.refusedVisa.splice(f,1)):(f=t.model.applicantDetails.personList[n.idx].refusedVisa.indexOf(r),t.model.applicantDetails.personList[n.idx].refusedVisa.splice(f,1));i.refusedList.splice(u,1)};i.addCancelledPerson=function(){i.addCancelledFormSubmit=!0;i.frmAddCancelled.$valid&&typeof i.selectedCancelledPerson.type!="undefined"&&i.cancelled!==""&&(i.selectedCancelledPerson.type===i.personTypes.applicant?t.model.applicantDetails.cancelledVisa.push(i.cancelled):t.model.applicantDetails.personList[i.selectedCancelledPerson.idx].cancelledVisa.push(i.cancelled),i.cancelledList.push({person:i.selectedCancelledPerson,cancelled:i.cancelled}),i.selectedCancelledPerson={},i.cancelled="",i.showAddCancelled=!1,i.addCancelledFormSubmit=!1)};i.removeCancelledPerson=function(n,r,u){var f;n.type===i.personTypes.applicant?(f=t.model.applicantDetails.cancelledVisa.indexOf(r),t.model.applicantDetails.cancelledVisa.splice(f,1)):(f=t.model.applicantDetails.personList[n.idx].cancelledVisa.indexOf(r),t.model.applicantDetails.personList[n.idx].cancelledVisa.splice(f,1));i.cancelledList.splice(u,1)};i.cancelAddHealthCondition=function(){i.selectedHealthPerson={};i.condition="";i.showAddHealth=!1;i.addHealthFormSubmit=!1};i.showAddHealthModal=function(){i.showAddHealth=!0;i.addHealthFormSubmit=!1};i.cancelAddCrimePerson=function(){i.selectedCrimePerson={};i.crime="";i.showAddOffence=!1;i.addOffenceFormSubmit=!1};i.showAddOffenceModal=function(){i.showAddOffence=!0;i.addOffenceFormSubmit=!1};i.cancelAddRefusedPerson=function(){i.selectedRefusedPerson={};i.refused="";i.showAddRefused=!1;i.addRefusedFormSubmit=!1};i.showAddRefusedModal=function(){i.showAddRefused=!0;i.addRefusedFormSubmit=!1};i.cancelAddCancelledPerson=function(){i.selectedCancelledPerson={};i.cancelled="";i.showAddCancelled=!1;i.addCancelledFormSubmit=!1};i.showAddCancelledModal=function(){i.showAddCancelled=!0;i.addCancelledFormSubmit=!1}}]);f.controller("qualificationController",["$scope","assessmentShared",function(n,t){var i=this;i.showQualificationModal=!1;i.qFormSubmitted=!1;i.addOrEdit="";i.newQual={};i.addQualification=function(){i.newQual=new u.qualificationModel("","","","","","","");i.showQualificationModal=!0;i.addOrEdit="add"};i.showList=function(){return t.model.education.qualifications.length>0};i.removeQualification=function(n){t.model.education.qualifications.splice(n,1)};i.saveQualification=function(){i.qFormSubmitted=!0;i.qualificationForm.$valid&&(i.addOrEdit==="add"&&t.model.education.qualifications.push(i.newQual),i.showQualificationModal=!1,i.qFormSubmitted=!1)};i.cancelAddQualification=function(){i.addOrEdit==="add"&&(i.newQual={});i.showQualificationModal=!1};i.editQualification=function(n){i.newQual=t.model.education.qualifications[n];i.showQualificationModal=!0;i.addOrEdit="edit"}}]);f.controller("occupationController",["$scope","assessmentShared",function(n,t){var i=this;i.showProfessionalHelp=!1;i.showAddForm=!1;i.frmAddSubmitted=!1;i.addOrEdit="";i.newRole={};i.professionalYearHelp=function(){i.showProfessionalHelp=!0};i.showList=function(){return t.model.occupation.roles.length>0};i.addRole=function(){i.newRole=new u.employmentDetailsModel("","","","","","");i.showAddForm=!0;i.addOrEdit="add"};i.removeRole=function(n){t.model.occupation.roles.splice(n,1)};i.saveOccupation=function(){i.frmAddSubmitted=!0;i.frmAddOccupation.$valid&&(i.addOrEdit==="add"&&t.model.occupation.roles.push(i.newRole),i.showAddForm=!1,i.frmAddSubmitted=!1)};i.cancelAddOccupation=function(){i.addOrEdit==="add"&&(i.newRole={});i.showAddForm=!1;i.frmAddSubmitted=!1};i.onHide=function(){i.showProfessionalHelp=!1};i.editRole=function(n){i.newRole=t.model.occupation.roles[n];i.showAddForm=!0;i.addOrEdit="edit"}}]);f.controller("employerSponsorController",["$scope","$location","$anchorScroll","assessmentShared",function(n,t,i,r){var f=this;f.showPostionModal=!1;f.positionFormSubmit=!1;f.newPosition={};f.addPosition=function(){f.showPostionModal=!0;f.positionFormSubmit=!1;f.newPosition=new u.positionsModel("","","","","","","","","","","","","","")};f.removePosition=function(n){r.model.employerSponsor.positions.splice(n,1)};f.savePosition=function(){f.positionFormSubmit=!0;f.frmPosition.$valid&&(r.model.employerSponsor.positions.push(f.newPosition),f.showPostionModal=!1,f.positionFormSubmit=!1)};f.cancelAddPosition=function(){f.newPosition={};f.showPostionModal=!1;f.positionFormSubmit=!1};f.scrollToList=function(n){t.hash(n);i()}}]);f.controller("investmentController",["$scope","$location","$anchorScroll","assessmentShared",function(n,t,i,r){var f=this;f.showAddModal=!1;f.addModalSubmit=!1;f.addOrEdit="";f.newInvest={};f.addOwnership=function(){f.showAddModal=!0;f.addModalSubmit=!1;f.newInvest=new u.ownershipModel("","","","","","",[{turnover:{},ownershipInterest:"",netAssets:{},yearEnd:""},{turnover:{},ownershipInterest:"",netAssets:{},yearEnd:""},{turnover:{},ownershipInterest:"",netAssets:{},yearEnd:""},{turnover:{},ownershipInterest:"",netAssets:{},yearEnd:""}]);f.addOrEdit="add"};f.removeOwnership=function(n){r.model.investment.ownerships.splice(n,1)};f.saveOwnership=function(){f.addModalSubmit=!0;f.frmAddOwnership.$valid&&(r.model.investment.ownerships.push(f.newInvest),f.showAddModal=!1,f.addModalSubmit=!1)};f.cancelAddOwnershipModal=function(){f.addOrEdit==="add"&&(f.newInvest={});f.showAddModal=!1;f.addModalSubmit=!1};f.editOwnership=function(n){f.newInvest=r.model.investment.ownerships[n];f.addOrEdit="edit"};f.scrollToList=function(n){t.hash(n);i()}}])},239:function(n,t){"use strict";var r,f,s,e,h,c,v,i,o,l,u,a,y,p,w,b,k,d;Object.defineProperty(t,"__esModule",{value:!0});r=function(){function n(){this.dob="";this.title="";this.titleOther="";this.firstName="";this.surname="";this.email="";this.phoneType="";this.phoneCountryCode="";this.phoneAreaCode="";this.phoneNumber="";this.countryResidence="";this.passportNumber="";this.passportCountry="";this.hasApplicantCrime="";this.applicantCrime=[];this.hasHealthCondition="";this.healthCondition=[];this.hasPartner="";this.hasChildren="";this.partnerPassport="";this.partnerDob="";this.numChildren="";this.childrenIncluded="";this.biologicalOrAdopted="";this.childList=[];this.studyReasons="";this.acceptedForStudy="";this.nameOfCourse="";this.enrolmentConfirmation="";this.studentDependant="";this.isDisabled="";this.childType="";this.stepChildDob="";this.stepParentCare="";this.adoptedBefore="";this.soleyDependant="";this.relationshipStatus="";this.whenGoAustralia="";this.education="";this.Occupation="";this.intendedOccupation="";this.personList=[];this.childrenNotIncluded="";this.childrenNotIncludedList=[];this.otherApplicants="";this.inAustralia="";this.location="";this.holdAustralianVisa="";this.arriveAustralia="";this.visaType="";this.visaExpire="";this.departAustralia="";this.refusedVisa=[];this.cancelledVisa=[];this.maritalStatus="";this.hasJobOffer="";this.partnerCitizen="";this.resumeLocation=null;this.resumeFile=[];this.inDetention="";this.detentionFacility=""}return n}();t.ApplicantDetails=r;f=function(){function n(){this.hasQualifications="";this.qualifications=[];this.completedEnglishTest="";this.englishTestTaken="";this.englishTestDate="";this.englishAverageScore="";this.englishReadingScore="";this.englishWritingScore="";this.englishSpeakingScore="";this.englishListeningScore="";this.isTranslator="";this.translatorLanguage="";this.skillsAssessment="";this.assessingAuthority="";this.assessedOccupation="";this.assessmentDate=""}return n}();t.EducationDetails=f;s=function(){function n(){this.occupation="";this.workedIn="";this.roles=[];this.professionalYear=""}return n}();t.OccupationDetails=s;e=function(){function n(){this.name="";this.abn="";this.firstName="";this.surname="";this.email="";this.phoneType="";this.phoneCountryCode="";this.phoneAreaCode="";this.phoneNumber="";this.jobTitle="";this.salary="";this.hasOffer="";this.canContact="";this.investedTraining="";this.startTrading="";this.ausStaff="";this.address1="";this.address2="";this.suburb="";this.city="";this.postcode="";this.state=""}return n}();t.EmployerDetails=e;h=function(){function n(){this.knowPositions="";this.positions=[]}return n}();t.EmployerSponsorDetails=h;c=function(){function n(){this.assetsRecent="";this.assetsPrior="";this.assetsTransferred="";this.businessYears="";this.investmentYears="";this.businessHistory="";this.hasPatents="";this.patentDetails="";this.hasTrademarks="";this.trademarkDetails="";this.hasJointVenture="";this.joinVentureDetails="";this.isExport="";this.exportDetails="";this.isGazelle="";this.gazelleDetails="";this.receivedFundingGrants="";this.fundingGrantDetails="";this.receivedFundingCapital="";this.fundingCapitalDetails=""}return n}();t.BusinessDetails=c;v=function(){function n(){this.hadOwnership="";this.ownerships=[]}return n}();t.InvestmentDetails=v;i=function(){function n(){this.comments="";this.appointAgent="";this.startProcess=""}return n}();t.FeedbackDetails=i;o=function(){function n(){this.title="";this.titleOther="";this.firstName="";this.surname="";this.email="";this.phoneType="";this.phoneCountryCode="";this.phoneAreaCode="";this.phoneNumber="";this.passportCountry="";this.dob="";this.hasPartner="";this.partnerName="";this.partnerSurname="";this.partnerDob="";this.hasHealthCondition="";this.healthDetails=[];this.hasBeenConvicted="";this.convictionDetails=[];this.assurers=[];this.countryResidence="";this.previouslySponsored="";this.howManyPreviously="";this.employmentStatus="";this.visaStatus="";this.maritalStatus="";this.realtionToApplicant=""}return n}();t.SponsorDetails=o;l=function(){function n(){this.status="";this.relationshipStart="";this.dateMarried="";this.intendToMarry="";this.datePlannedMarriage="";this.metInPerson="";this.liveTogether="";this.startedLivingTogether="";this.haveChildren="";this.numChildren="";this.firstMet=""}return n}();t.RelationshipPartner=l;u=function(){function n(){this.anyHealthConditions="";this.anyCrime="";this.refusedVisa="";this.cancelledVisa=""}return n}();t.HealthDetails=u;a=function(){function n(){this.visaType="";this.whoMadeDecision="";this.decisionDate="";this.notifiedBy="";this.notifiedDate="";this.fileLocation=null;this.decisionFile=[];this.whyAppeal=""}return n}();t.DecisionDetails=a;y=function(){function n(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot,st,ht,ct){this.type=n;this.title=t;this.titleOther=i;this.firstName=r;this.surname=u;this.dob=f;this.sponsorRelation=e;this.countryResidence=o;this.passportCountry=s;this.passportNumber=h;this.residenceStatus=c;this.timeResident=l;this.maritalStatus=a;this.parentRelation=v;this.timeWithParents=y;this.financialDependancy=p;this.healthCondition=w;this.applicantCrime=b;this.isSponsor=k;this.education=d;this.occupation=g;this.incapacitated=nt;this.inAustralia=tt;this.location=it;this.holdAustralianVisa=rt;this.arriveAustralia=ut;this.visaType=ft;this.visaExpire=et;this.departAustralia=ot;this.refusedVisa=st;this.cancelledVisa=ht;this.realtionToApplicant=ct}return n}();t.personModel=y;p=function(){function n(n,t,i,r,u,f,e){this.type=n;this.institution=t;this.course=i;this.country=r;this.postcode=u;this.start=f;this.end=e}return n}();t.qualificationModel=p;w=function(){function n(n,t,i,r,u,f){this.employerName=n;this.employerCountry=t;this.position=i;this.start=r;this.end=u;this.responsibilities=f}return n}();t.employmentDetailsModel=w;b=function(){function n(n,t,i,r,u,f,e,o,s,h,c,l,a,v){this.jobTitle=n;this.salary=t;this.isAdvertised=i;this.applicantKnown=r;this.title=u;this.titleOther=f;this.firstName=e;this.surname=o;this.dob=s;this.passportCountry=h;this.passportNumber=c;this.maritalStatus=l;this.education=a;this.currentlyEmployed=v}return n}();t.positionsModel=b;k=function(){function n(n,t,i,r,u,f,e){this.name=n;this.country=t;this.industry=i;this.ownershipInterest=r;this.position=u;this.dateStart=f;this.years=e}return n}();t.ownershipModel=k;d=function(){function n(){this.loadedFormId=null;this.applyOrSponsor=null;this.formType=null;this.contactDetails=null;this.applicantDetails=null;this.hasSponsor=null;this.sponsorDetails=null;this.relationshipPartner=null;this.education=null;this.employer=null;this.occupation=null;this.business=null;this.investment=null;this.feedback=null;this.history=null;this.health=null;this.employerSponsor=null;this.decision=null}return n.buildApplication=function(t){switch(t.formType){case"appealCancel":case"appealRefuse":return n.buildAppealApplication(t);case"business":return n.buildBusinessApplication(t);case"sponsor-child":case"sponsor-parent":return n.buildFamilySponsorApplication(t);case"sponsor-partner":return n.buildPartnerApplication(t);case"skilled-visa":case"work":return n.buildWorkApplication(t);case"study":return n.buildStudyApplication(t);case"employerTemp":case"employerPerm":return n.buildEmployerApplication(t);case"generic":return n.buildGenericApplication(t);case"businessEnquiry":return n.buildBusinessEnquiry(t);case"visit":return n.buildVisitApplication(t);case"enquiry":return n.buildGeneralEnquiry(t)}throw new Error("Unknown application type: "+t.formType);},n.buildAppealApplication=function(n){return n.applicantDetails||(n.applicantDetails=new r),n.decision||(n.decision=new a),n.feedback||(n.feedback=new i),n},n.buildBusinessApplication=function(n){return n.applicantDetails||(n.applicantDetails=new r),n.education||(n.education=new f),n.business||(n.business=new c),n.health||(n.health=new u),n.feedback||(n.feedback=new i),n},n.buildFamilySponsorApplication=function(n){return n.applicantDetails||(n.applicantDetails=new r),n.sponsorDetails||(n.sponsorDetails=new o),n.health||(n.health=new u),n.feedback||(n.feedback=new i),n},n.buildPartnerApplication=function(n){return n.applicantDetails||(n.applicantDetails=new r),n.sponsorDetails||(n.sponsorDetails=new o),n.relationshipPartner||(n.relationshipPartner=new l),n.health||(n.health=new u),n.feedback||(n.feedback=new i),n},n.buildWorkApplication=function(n){return n.applicantDetails||(n.applicantDetails=new r),n.employer&&(n.employer=new e),n.education||(n.education=new f),n.occupation||(n.occupation=new s),n.health||(n.health=new u),n.feedback||(n.feedback=new i),n},n.buildStudyApplication=function(n){return n.applicantDetails||(n.applicantDetails=new r),n.education||(n.education=new f),n.health||(n.health=new u),n.feedback||(n.feedback=new i),n},n.buildEmployerApplication=function(n){return n.employerSponsor||(n.employerSponsor=new h),n.feedback||(n.feedback=new i),n},n.buildGenericApplication=function(n){return n.applicantDetails||(n.applicantDetails=new r),n.feedback||(n.feedback=new i),n},n.buildBusinessEnquiry=function(n){return n.employer||(n.employer=new e),n.feedback||(n.feedback=new i),n},n.buildVisitApplication=function(n){return n.applicantDetails||(n.applicantDetails=new r),n.sponsorDetails||(n.sponsorDetails=n.hasSponsor===!0?new o:null),n.occupation||(n.occupation=new s),n.health||(n.health=new u),n.feedback||(n.feedback=new i),n},n.buildGeneralEnquiry=function(n){switch(n.applyOrSponsor){case"sponsorEmployee":n.applicantDetails=null;n.employer||(n.employer=new e);break;case"apply":n.applicantDetails||(n.applicantDetails=new r);n.employer=null;break;default:n.applicantDetails||(n.applicantDetails=new r)}return n.feedback||(n.feedback=new i),n},n}();t.Model=d},240:function(n,t,i){"use strict";var e,o,s,h;Object.defineProperty(t,"__esModule",{value:!0});var u=i(7),f=i(0),r=u.module("assessmentDirectives",[]);r.directive("date",function(){return{template:'<div ng-form="{{vm.formName}}" class="form-group" ng-class="{ \'has-error\': (vm.dayInvalid || vm.monthInvalid || vm.yearInvalid) }"><input name="txtdobDay" type="number" min="1" max="31" placeholder="Day" class="form-control input-md" ng-model="vm.dobDay" ng-model-options="{allowInvalid: true}" style="width: 20%; float: left; margin-right: 10px;" ng-required="vm.isRequired" autocomplete="chrome-hack"><select  name="ddlDobMonth" class="form-control" style="width: 30%; float: left; margin-right: 10px;" ng-model="vm.dobMonth" ng-required="vm.isRequired" autocomplete="chrome-hack"><option value="01">January<\/option><option value="02">February<\/option><option value="03">March<\/option><option value="04">April<\/option><option value="05">May<\/option><option value="06">June<\/option><option value="07">July<\/option><option value="08">August<\/option><option value="09">September<\/option><option value="10">October<\/option><option value="11">November<\/option><option value="12">December<\/option><\/select><input name="txtdobYear" type="number" min="1900" placeholder="Year" class="form-control input-md" ng-model="vm.dobYear" ng-model-options="{allowInvalid: true}" style="width: 30%; float: left;" ng-required="vm.isRequired" autocomplete="chrome-hack"><div style="clear: both;"><\/div><div class="help-block"><p ng-if="vm.dayInvalid">Please enter a valid day<\/p><\/div><div class="help-block"><p ng-if="vm.monthInvalid">Month is required.<\/p><\/div><div class="help-block"><p ng-if="vm.yearInvalid">Year is required and must be greater than 1900 and less than 2100<\/p><\/div><\/div>',restrict:"E",transclude:!0,scope:{},bindToController:{formName:"=",modelDate:"=",isSubmitted:"=",isRequired:"="},controllerAs:"vm",controller:e}});e=function(){function n(n,t){var i=this;this.$scope=n;this.$timeout=t;this.dobDay=null;this.dobMonth=null;this.dobYear=null;this.dayInvalid=!1;this.monthInvalid=!1;this.yearInvalid=!1;this.checkValidDates=function(){if(typeof i.dobDay=="number"&&typeof i.dobMonth!="undefined"&&(i.dobMonth=="04"||i.dobMonth=="06"||i.dobMonth=="09"||i.dobMonth=="11"||i.dobMonth=="02")){if(i.dobMonth!=="02"&&i.dobDay>30&&typeof i.dobYear!="number"){i.dayInvalid=!0;return}if(i.dobMonth=="02"&&typeof i.dobYear!="number"&&i.dobDay>29){i.dayInvalid=!0;return}}if(typeof i.dobYear=="number"&&typeof i.dobMonth!="undefined"&&typeof i.dobDay=="number"&&i.dobMonth=="02"){var n=i.dobYear%4;if(n==0&&i.dobDay>29){i.dayInvalid=!0;return}if(n!=0&&i.dobDay>28){i.dayInvalid=!0;return}}i.dayInvalid=!1};this.updateDate=function(){var n=i.$scope;typeof i.dobDay=="number"&&typeof i.dobMonth!="undefined"&&typeof i.dobYear=="number"&&n[i.formName].$valid&&(i.modelDate=f(i.dobDay+"-"+i.dobMonth+"-"+i.dobYear,"DD-MM-YYYY").format("DD-MM-YYYY"))};this.$scope.$watch(function(){return i.modelDate},function(n){if(i.modelDate||f(n,"DD-MM-YYYY").isValid()){var t=f(i.modelDate,"DD-MM-YYYY");i.dobDay=parseInt(t.format("D"));i.dobMonth=t.format("MM");i.dobYear=parseInt(t.format("Y"))}else i.dobDay=null,i.dobMonth=null,i.dobYear=null,i.$timeout(function(){i.dayInvalid=!1;i.monthInvalid=!1;i.yearInvalid=!1})});this.$scope.$watch(function(){return i.isSubmitted},function(n){if(i.dayInvalid=!1,i.monthInvalid=!1,i.yearInvalid=!1,n){i.dayInvalid=i.dobDay===null&&i.isRequired||i.dobDay!==null&&i.dobDay<0&&i.dobDay>31;i.monthInvalid=!i.dobMonth&&i.isRequired;i.yearInvalid=i.dobYear===null&&i.isRequired||i.dobYear!==null&&i.dobYear<=1900&&i.dobYear>=2100;var t=i.$scope;t[i.formName].$valid=!(i.dayInvalid&&i.monthInvalid&&i.yearInvalid)}});this.$scope.$watch(function(){return i.dobDay},function(n){var t=i.$scope;i.dayInvalid=!(typeof n=="number"&&n>0&&n<32)&&(t[i.formName].txtdobDay.$dirty||i.isSubmitted);i.dayInvalid||i.checkValidDates();t[i.formName].$valid=!i.dayInvalid&&!i.monthInvalid&&!i.yearInvalid;i.updateDate()});this.$scope.$watch(function(){return i.dobMonth},function(n){var t=i.$scope;i.monthInvalid=typeof n=="undefined"&&(t[i.formName].ddlDobMonth.$dirty||i.isSubmitted);i.monthInvalid||i.checkValidDates();t[i.formName].$valid=!i.dayInvalid&&!i.monthInvalid&&!i.yearInvalid;i.updateDate()});this.$scope.$watch(function(){return i.dobYear},function(n){var t=i.$scope;i.yearInvalid=!(typeof n=="number"&&n>=1900&&n<=2100)&&(t[i.formName].txtdobYear.$dirty||i.isSubmitted);i.yearInvalid||i.checkValidDates();t[i.formName].$valid=!i.dayInvalid&&!i.monthInvalid&&!i.yearInvalid;i.updateDate()})}return n.$inject=["$scope","$timeout"],n}();t.DateOfBirthController=e;r.directive("countries",function(){return{template:'<div ng-form="{{vm.formName}}" class="form-group" ng-class="{ \'has-error\': vm.checkValid(), \'required\': vm.isRequired }"><label class="control-label" for="ddlCountryList">{{vm.labelText}}<\/label><div><select name="ddlCountryList" class="form-control" ng-options="c.Value for c in vm.countryList track by c.Key" ng-model="vm.modelValue" ng-required="vm.isRequired" autocomplete="chrome-hack"><\/select><\/div><div class="help-block" ng-show="vm.checkValid()"><p>Country is required.<\/p><\/div><\/div>',restrict:"E",transclude:!0,scope:{},bindToController:{modelValue:"=",labelText:"@",isSubmitted:"=",isRequired:"=",formName:"@"},controllerAs:"vm",controller:o}});o=function(){function n(n){var t=this;this.assessmentService=n;this.countryList=[];this.checkValid=function(){return t.isSubmitted&&t.isRequired&&(typeof t.modelValue=="undefined"||t.modelValue==="")};n.getCountries().$promise.then(function(n){t.countryList=n});this.formName&&(this.formName.$valid=this.checkValid())}return n.$inject=["assessmentService"],n}();t.CountriesController=o;r.directive("visaTypes",["assessmentService",function(){return{template:'<div class="form-group"><label class="control-label" for="ddlVisaType">{{vm.labelText}}<\/label><div><select  name="ddlVisaType" class="form-control" ng-options="v.VisaType for v in vm.visaTypes track by v.Id" ng-model="vm.modelValue" autocomplete="chrome-hack"><\/select><\/div><\/div>',restrict:"E",transclude:!0,scope:{},bindToController:{modelValue:"=",labelText:"@"},controllerAs:"vm",controller:s}}]);s=function(){function n(n){var t=this;this.assessmentService=n;this.visaTypes=[];this.assessmentService.getVisaTypes().$promise.then(function(n){t.visaTypes=n})}return n.$inject=["assessmentService"],n}();t.VisaTypesController=s;r.directive("modal",["$timeout",function(n){return{template:'<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" style="overflow-y:auto;"><div class="modal-dialog modal-lg"><div class="modal-content" ng-transclude><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;<\/span><\/button><h4 class="modal-title" id="myModalLabel">Modal title<\/h4><\/div><\/div><\/div><\/div>',restrict:"E",transclude:!0,replace:!0,scope:{visible:"=",onShown:"&",onHide:"&",keyboard:"<",backdrop:"<"},link:function(t,i,r){$(i).modal({show:!1,keyboard:t.keyboard,backdrop:t.backdrop});t.$watch(function(){return t.visible},function(n){n===!0?$(i).modal("show"):$(i).modal("hide")});$(i).on("shown.bs.modal",function(){n(function(){t.$parent[r.visible]=!0})});$(i).on("shown.bs.modal",function(){n(function(){t.onShown({})})});$(i).on("hidden.bs.modal",function(){n(function(){t.$parent[r.visible]=!1})});$(i).on("hidden.bs.modal",function(){n(function(){t.onHide({})})})}}}]);r.directive("modalHeader",function(){return{template:'<div class="modal-header"><button type="button" ng-show="{{close}}" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;<\/span><\/button><h4 class="modal-title">{{title}}<\/h4><\/div>',replace:!0,restrict:"E",scope:{title:"@",close:"@"}}});r.directive("modalBody",function(){return{template:'<div class="modal-body" ng-transclude><\/div>',replace:!0,restrict:"E",transclude:!0}});r.directive("modalFooter",function(){return{template:'<div class="modal-footer" ng-transclude><\/div>',replace:!0,restrict:"E",transclude:!0}});r.directive("toggle",function(){return{restrict:"A",link:function(n,t,i){i.toggle=="tooltip"&&$(t).tooltip();i.toggle=="popover"&&$(t).popover()}}});r.directive("fileUpload",function(){return{restrict:"A",scope:{},bindToController:{files:"=",progress:"=",folder:"="},controllerAs:"vm",controller:h}});h=function(){function n(n,t,i,r,f){var e=this;this.$scope=n;this.$element=t;this.$timeout=i;this.$attrs=r;this.assessmentService=f;u.element(this.$element).fileupload({url:"api/fileupload/assessmentupload/",type:"POST",dropZone:$("#dropzone"),formData:{type:this.$attrs.uploadType},dataType:"json",maxFileSize:11e5,add:function(n,t){i(function(){e.progress=!0});t.submit()},change:function(){if(typeof e.folder=="number"){var n={id:e.folder,key:e.files[0].key};e.assessmentService.deleteFile(n).$promise.then(function(){e.files.pop()}).catch(function(){e.files.pop()})}},done:function(n,t){i(function(){e.folder=t.result.FileId;u.forEach(t.files,function(n){e.files.push({name:n.name,size:n.size,type:n.type,key:t.result.Key})});e.progress=!1},500)},fail:function(){Raygun.send(new Error("File upload failed"),{},["AssessmentFileUpload"]);i(function(){e.progress=!1})}})}return n.$inject=["$scope","$element","$timeout","$attrs","assessmentService"],n}();t.FileUploadController=h},241:function(n,t,i){"use strict";var r,u,f;Object.defineProperty(t,"__esModule",{value:!0});r=i(7);u=r.module("assessmentFactory",["ngResource"]);u.factory("assessmentService",["$resource",function(n){return n("/api/AssessmentForms/:id",{id:"@id"},{updateForm:{method:"PUT",url:"/api/AssessmentForms/UpdateForm"},loadForm:{method:"POST",url:"/api/AssessmentForms/LoadForm"},saveForm:{method:"POST",url:"/api/AssessmentForms/SaveForm"},getCountries:{method:"GET",url:"/api/AssessmentForms/GetCountryList",isArray:!0},getBusiness:{method:"GET",url:"/api/AssessmentForms/GetBusinessBySubdomain",transformResponse:function(n){return{d:r.fromJson(n)}}},getVisaTypes:{method:"GET",url:"/api/AssessmentForms/GetVisaTypes",isArray:!0},deleteFile:{method:"POST",url:"/api/AssessmentForms/DeleteFile/"}})}]);f=function(){function n(){var n=this;this.formTypes={business:"business",child:"sponsor-child",parent:"sponsor-parent",partner:"sponsor-partner",skilled:"skilled-visa",study:"study",work:"work",visit:"visit",employerTemp:"employerTemp",employerPerm:"employerPerm",generic:"enquiry",businessEnquiry:"businessEnquiry",appealRefuse:"appealRefuse",appealCancel:"appealCancel",general:"generic"};this.formDetails=[{id:this.formTypes.business,pages:["applicant details","education","business skills","business investments","other family","health and character","finish"]},{id:this.formTypes.child,pages:["applicant details","sponsor details","other family","health and character","finish"]},{id:this.formTypes.parent,pages:["applicant details","sponsor details","other family","health and character","finish"]},{id:this.formTypes.partner,pages:["applicant details","sponsor partner","relationship partner","other family","health and character","finish"]},{id:this.formTypes.skilled,pages:["applicant details","employer details","education","occupation","other family","health and character","finish"]},{id:this.formTypes.study,pages:["applicant details","education","other family","health and character","finish"]},{id:this.formTypes.work,pages:["applicant details","employer details","education","occupation","other family","health and character","finish"]},{id:this.formTypes.employerTemp,pages:["employer sponsor","positions","finish"]},{id:this.formTypes.employerPerm,pages:["employer sponsor","positions","finish"]},{id:this.formTypes.general,pages:["enquiry"]},{id:this.formTypes.businessEnquiry,pages:["business enquiry"]},{id:this.formTypes.appealRefuse,pages:["applicant details","decision","finish"]},{id:this.formTypes.appealCancel,pages:["applicant details","decision","finish"]},{id:this.formTypes.visit,pages:["applicant details","sponsor details","occupation","other family","health and character","finish"]},{id:this.formTypes.generic,pages:["general enquiry"]}];this.formSubmitted=!1;this.selectedForm=null;this.applyOrSponsor=null;this.isApplicant=!0;this.countries=[];this.businessName="this firm";this.businessTerms="";this.businessId=0;this.saveFormError="";this.personType={parent:"parent",child:"child",other:"other",applicant:"applicant",sponsor:"sponsor",notIncludedChild:"notIncludedChild"};this.maritalStatus=[{id:"engaged",value:"Engaged"},{id:"married",value:"Married"},{id:"de-facto",value:"In a De Facto Relationship"},{id:"interdependant",value:"Interdependent Relationship"},{id:"separated",value:"Separated"},{id:"divorced",value:"Divorced"},{id:"widowed",value:"Widowed"},{id:"never-married",value:"Never Married"}];this.titles=[{id:"Mr",value:"Mr"},{id:"Mrs",value:"Mrs"},{id:"Miss",value:"Miss"},{id:"Ms",value:"Ms"},{id:"Dr",value:"Dr"},{id:"Other",value:"Other"}];this.educationLevels=[{id:"primary-school",value:"Primary School"},{id:"middle-school",value:"Middle School"},{id:"high-school",value:"High School"},{id:"s-high-school",value:"Senior High School"},{id:"trade-apprenticeship",value:"Trade Apprenticeship"},{id:"training-ex",value:"Training (External)"},{id:"training-in",value:"Training (On the Job)"},{id:"cert1",value:"Certificate I"},{id:"cert2",value:"Certificate II"},{id:"cert3",value:"Certificate III"},{id:"cert4",value:"Certificate IV"},{id:"diploma",value:"Diploma"},{id:"adv-diploma",value:"Advanced Diploma"},{id:"associate",value:"Associate Degree"},{id:"bachelor",value:"Bachelor Degree"},{id:"honours",value:"Honours Degree"},{id:"grad-cert",value:"Graduate Certificate"},{id:"grad-diploma",value:"Graduate Diploma"},{id:"postgrad-cert",value:"Postgraduate Certificate"},{id:"postgrad-dip",value:"Postgraduate Diploma"},{id:"masters",value:"Masters Degree"},{id:"phd",value:"Doctoral Degree"},{id:"other",value:"Other"}];this.relationTypes=[{id:"spouse-partner",value:"Spouse/Partner"},{id:"former-spouse-partner",value:"Former Spouse/Partner"},{id:"child",value:"Child"},{id:"parent",value:"Parent"},{id:"step-parent",value:"Step Parent"},{id:"step-child",value:"Step Child"},{id:"grand-parent",value:"Grand Parent"},{id:"grand-child",value:"Grand Child"},{id:"adopted-parent",value:"Adopted Parent"},{id:"adopted-child",value:"Adopted Child"},{id:"brother",value:"Brother"},{id:"sister",value:"Sister"},{id:"step-brother",value:"Step-brother"},{id:"step-sister",value:"Step-sister"},{id:"half-brother",value:"Half-Brother"},{id:"half-sister",value:"Half-Sister"},{id:"aunt",value:"Aunt"},{id:"uncle",value:"Uncle"},{id:"niece",value:"Niece"},{id:"nephew",value:"Nephew"},{id:"step-grandparent",value:"Step-grandparent"},{id:"step-grandchild",value:"Step-grandchild"},{id:"step-aunt",value:"Step-aunt"},{id:"step-uncle",value:"Step-uncle"},{id:"step-niece",value:"Step-niece"},{id:"step-nephew",value:"Step-nephew"},{id:"mother-in-law",value:"Mother-in-Law"},{id:"father-in-law",value:"Father-in-Law"},{id:"daughter-in-law",value:"Daughter-in-Law"},{id:"son-in-law",value:"Son-in-Law"},{id:"sister-in-law",value:"Sister-in-Law"},{id:"brother-in-law",value:"Brother-in-Law"},{id:"cousin",value:"Cousin"},{id:"friend",value:"Friend"},{id:"associate",value:"Associate"},{id:"acquaintance",value:"Acquaintance"},{id:"guardian",value:"Guardian"},{id:"ward",value:"Ward"},{id:"adopted-brother",value:"Adopted Brother"},{id:"adopted-sister",value:"Adopted Sister"},{id:"other",value:"Other"}];this.childRelationTypes=[{id:"child",value:"Child"},{id:"step-child",value:"Step Child"},{id:"adopted-child",value:"Adopted Child"},{id:"daughter-in-law",value:"Daughter-in-Law"},{id:"son-in-law",value:"Son-in-Law"},{id:"other",value:"Other"}];this.parentRelationTypes=[{id:"parent",value:"Parent"},{id:"step-parent",value:"Step Parent"},{id:"adopted-parent",value:"Adopted Parent"},{id:"mother-in-law",value:"Mother-in-Law"},{id:"father-in-law",value:"Father-in-Law"},{id:"guardian",value:"Guardian"},{id:"other",value:"Other"}];this.visaStatus=[{id:"citizen",value:"Australian Citizen"},{id:"resident",value:"Australian Permanent Resident"},{id:"nz",value:"New Zealand Citizen"},{id:"temp",value:"Australian Temporary Visa Holder"},{id:"other",value:"Other"}];this.employmentStatus=[{id:"full-time",value:"Employed Full Time"},{id:"part-time",value:"Employed Part Time"},{id:"student",value:"Student"},{id:"self-employed",value:"Self Employed"},{id:"unemployed",value:"Unemployed"},{id:"looking",value:"Unemployed and looking for work"},{id:"homemaker",value:"Homemaker"},{id:"retired",value:"Retired"}];this.industryTypes=[{id:"a",value:"A - Agriculture, Forestry and Fishing"},{id:"b",value:"B - Mining"},{id:"c",value:"C - Manufacturing"},{id:"d",value:"D - Electricity, Gas, Water and Waste Services"},{id:"e",value:"E - Construction"},{id:"f",value:"F - Wholesale Trade"},{id:"g",value:"G - Retail Trade"},{id:"h",value:"H - Accommodation and Food Services"},{id:"i",value:"I - Transport Postal and Warehousing"},{id:"j",value:"J - Information Media and Telecommunications"},{id:"k",value:"K - Financial and Insurance Services"},{id:"l",value:"L - Rental, Hiring and Real Estate Services"},{id:"m",value:"M - Professional, Scientific and Technical"},{id:"n",value:"N - Administrative and Support Services"},{id:"o",value:"O - Public Administration and Safety"},{id:"p",value:"P - Education and Training"},{id:"q",value:"Q - Health Care and Social Assistance"},{id:"r",value:"R - Arts and Recreation Services"},{id:"s",value:"S - Other Services"}];this.ownershipTypes=[{id:"company",value:"Company"},{id:"franchise",value:"Franchise"},{id:"partnership",value:"Partnership"},{id:"proprietary",value:"Proprietary Company"},{id:"public",value:"Public Company"},{id:"sole",value:"Sole Proprietor/Sole Trader"},{id:"statutory",value:"Government Department"},{id:"trust",value:"Business Trust"},{id:"other",value:"Other"}];this.assetAmounts=[{id:"0",value:"less than $199,000.99"},{id:"2",value:"$200,000.00 - $399,999.99"},{id:"4",value:"$400,000.00 - $999,999.99"},{id:"10",value:"$1,000,000.00 - $1,999,999.99"},{id:"20",value:"$2,000,000.00 and above"}];this.phoneTypes=[{id:"home",value:"Home"},{id:"work",value:"Work"},{id:"mobile",value:"Mobile"}];this.businessExperience=[{id:"0",value:"None"},{id:"1",value:"At least 1 of the past 10 years"},{id:"2",value:"At least 2 of the past 10 years"},{id:"3",value:"At least 3 of the past 10 years"},{id:"4",value:"At least 4 of the past 10 years"},{id:"5",value:"At least 5 of the past 10 years"},{id:"6",value:"At least 6 of the past 10 years"},{id:"7",value:"At least 7 of the past 10 years"},{id:"8",value:"At least 8 of the past 10 years"},{id:"9",value:"At least 9 of the past 10 years"},{id:"10",value:"At least 10 of the past 10 years"},{id:"11",value:"More than 10 years including the past 10 years"}];this.appealDecisionBy=[{id:"immi",value:"The Immigration Department"},{id:"minister",value:"The Minister"},{id:"tribunal",value:"Tribunal"},{id:"court",value:"Court"},{id:"other",value:"Other"},{id:"unsure",value:"I don't Know"}];this.decisionNotifiedBy=[{id:"post",value:"By Post"},{id:"email",value:"By Email"},{id:"fax",value:"By Fax"},{id:"person",value:"In Person"}];this.formTypesGet=function(){return n.formTypes};this.formDetailsGet=function(){return n.formDetails};this.selectedFormGet=function(){return n.selectedForm};this.selectedFormSet=function(t){n.selectedForm=t};this.applyOrSponsorGet=function(){return n.applyOrSponsor};this.applyOrSponsorSet=function(t){n.applyOrSponsor=t};this.formSubmittedGet=function(){return n.formSubmitted};this.formSubmittedSet=function(t){n.formSubmitted=t};this.businessNameGet=function(){return n.businessName};this.businessNameSet=function(t){n.businessName=t};this.businessIdGet=function(){return n.businessId};this.businessIdSet=function(t){n.businessId=t};this.businessTermsGet=function(){return n.businessTerms.replace(/&lt;&lt;Firm Name&gt;&gt;/g,n.businessName)};this.businessTermsSet=function(t){n.businessTerms=t};this.saveFormErrorGet=function(){return n.saveFormError};this.saveFormErrorSet=function(t){n.saveFormError=t};this.personTypeGet=function(){return n.personType};this.maritalStatusGet=function(){return n.maritalStatus};this.titlesGet=function(){return n.titles};this.educationLevelsGet=function(){return n.educationLevels};this.phoneTypesGet=function(){return n.phoneTypes};this.isApplicantGet=function(){return n.isApplicant};this.isApplicantSet=function(t){n.isApplicant=t};this.relationTypesGet=function(){return n.relationTypes};this.childRelationTypesGet=function(){return n.childRelationTypes};this.parentRelationTypesGet=function(){return n.parentRelationTypes};this.visaStatusGet=function(){return n.visaStatus};this.employmentStatusGet=function(){return n.employmentStatus};this.industryTypesGet=function(){return n.industryTypes};this.ownershipTypesGet=function(){return n.ownershipTypes};this.assetAmountsGet=function(){return n.assetAmounts};this.businessExperienceGet=function(){return n.businessExperience};this.appealDecisionByGet=function(){return n.appealDecisionBy};this.decisionNotifiedByGet=function(){return n.decisionNotifiedBy}}return n}();t.AssessmentSharedController=f;u.service("assessmentShared",f)},242:function(){"use strict";var n=angular.module("assessmentFilters",[]);n.filter("bitwiseAnd",function(){return function(n,t){var i=typeof n=="string"?parseInt(n,10):n,r=typeof t=="string"?parseInt(t,10):t;return(i&r)!=0}})},244:function(n,t,i){i(245);n.exports="ngMessages"},245:function(){(function(n,t){"use strict";function e(){function n(n,t){if(n)return u(n)?n.indexOf(t)>=0:n.hasOwnProperty(t)}return["$animate",function(t){return{restrict:"AE",transclude:"element",priority:1,terminal:!0,require:"^^ngMessages",link:function(i,r,f,e,o){var h=r[0],a,y=f.ngMessage||f.when,c=f.ngMessageExp||f.whenExp,l=function(n){a=n?u(n)?n:n.split(/[\s,]+/):null;e.reRender()},s,v;c?(l(i.$eval(c)),i.$watchCollection(c,l)):l(y);e.register(h,v={test:function(t){return n(a,t)},attach:function(){s||o(function(n,i){t.enter(n,null,r);s=n;var u=s.$$attachId=e.getAttachId();s.on("$destroy",function(){s&&s.$$attachId===u&&(e.deregister(h),v.detach());i.$destroy()})})},detach:function(){if(s){var n=s;s=null;t.leave(n)}}});i.$on("$destroy",function(){e.deregister(h)})}}}]}var r,u,i,f;t.module("ngMessages",[],function(){r=t.forEach;u=t.isArray;i=t.isString;f=t.element}).info({angularVersion:"1.6.9"}).directive("ngMessages",["$animate",function(n){function f(n,t){return i(t)&&t.length===0||e(n.$eval(t))}function e(n){return i(n)?n.length:!!n}var t="ng-active",u="ng-inactive";return{require:"ngMessages",restrict:"AE",controller:["$element","$scope","$attrs",function(i,o,s){function y(n,t){for(var i=t,u=[],r;i&&i!==n;){if(r=i.$$ngMessageNode,r&&r.length)return c[r];i.childNodes.length&&u.indexOf(i)===-1?(u.push(i),i=i.childNodes[i.childNodes.length-1]):i.previousSibling?i=i.previousSibling:(i=i.parentNode,u.push(i))}}function w(n,t,i){var r=c[i],u;h.head?(u=y(n,t),u?(r.next=u.next,u.next=r):(r.next=h.head,h.head=r)):h.head=r}function b(n,t,i){var r=c[i],u;r&&(u=y(n,t),u?u.next=r.next:h.head=r.next)}var h=this,v=0,p=0,c,l,a;this.getAttachId=function(){return p++};c=this.messages={};this.render=function(c){var y,p;c=c||{};l=!1;a=c;for(var g=f(o,s.ngMessagesMultiple)||f(o,s.multiple),w=[],b={},v=h.head,k=!1,d=0;v!=null;)d++,y=v.message,p=!1,k||r(c,function(n,t){if(!p&&e(n)&&y.test(t)){if(b[t])return;b[t]=!0;p=!0;y.attach()}}),p?k=!g:w.push(y),v=v.next;r(w,function(n){n.detach()});w.length!==d?n.setClass(i,t,u):n.setClass(i,u,t)};o.$watchCollection(s.ngMessages||s["for"],h.render);this.reRender=function(){l||(l=!0,o.$evalAsync(function(){l&&a&&h.render(a)}))};this.register=function(n,t){var r=v.toString();c[r]={message:t};w(i[0],n,r);n.$$ngMessageNode=r;v++;h.reRender()};this.deregister=function(n){var t=n.$$ngMessageNode;delete n.$$ngMessageNode;b(i[0],n,t);delete c[t];h.reRender()}}]}}]).directive("ngMessagesInclude",["$templateRequest","$document","$compile",function(n,t,r){function u(n,i){var u=r.$$createComment?r.$$createComment("ngMessagesInclude",i):t[0].createComment(" ngMessagesInclude: "+i+" "),e=f(u);n.after(e);n.remove()}return{restrict:"AE",require:"^^ngMessages",link:function(t,f,e){var o=e.ngMessagesInclude||e.src;n(o).then(function(n){t.$$destroyed||(i(n)&&!n.trim()?u(f,o):r(n)(t,function(n){f.after(n);u(f,o)}))})}}}]).directive("ngMessage",e()).directive("ngMessageExp",e())})(window,window.angular)},246:function(n,t,i){i(247);n.exports="ngResource"},247:function(){(function(n,t){"use strict";function f(n){return n!=null&&n!==""&&n!=="hasOwnProperty"&&u.test("."+n)}function e(n,r){var e,u,o,s;if(!f(r))throw i("badmember",'Dotted member path "@{0}" is invalid.',r);for(e=r.split("."),u=0,o=e.length;u<o&&t.isDefined(n);u++)s=e[u],n=n!==null?n[s]:undefined;return n}function r(n,i){i=i||{};t.forEach(i,function(n,t){delete i[t]});for(var r in n)!n.hasOwnProperty(r)||r.charAt(0)==="$"&&r.charAt(1)==="$"||(i[r]=n[r]);return i}var i=t.$$minErr("$resource"),u=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;t.module("ngResource",["ng"]).info({angularVersion:"1.6.9"}).provider("$resource",function(){var u=/^https?:\/\/\[[^\]]*][^/]*/,n=this;this.defaults={stripTrailingSlashes:!0,cancellable:!1,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};this.$get=["$http","$log","$q","$timeout",function(f,o,s,h){function w(t,i){this.template=t;this.defaults=l({},n.defaults,i);this.urlParams={}}function nt(t,u,d,g){function it(n,t){var i={};return t=l({},u,t),c(t,function(t,r){a(t)&&(t=t(n));i[r]=t&&t.charAt&&t.charAt(0)==="@"?e(n,t.substr(1)):t}),i}function rt(n){return n.resource}function nt(n){r(n||{},this)}var tt=new w(t,g);return d=l({},n.defaults.actions,d),nt.prototype.toJSON=function(){var n=l({},this);return delete n.$promise,delete n.$resolved,delete n.$cancelRequest,n},c(d,function(n,t){var w=n.hasBody===!0||n.hasBody!==!1&&/^(POST|PUT|PATCH)$/i.test(n.method),u=n.timeout,e=p(n.cancellable)?n.cancellable:tt.defaults.cancellable;u&&!k(u)&&(o.debug("ngResource:\n  Only numeric values are allowed as `timeout`.\n  Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."),delete n.timeout,u=null);nt[t]=function(o,p,k,d){function bt(n){ut.catch(v);st!==null&&st.resolve(n)}var lt={},et,ot,ht,ut;switch(arguments.length){case 4:ht=d;ot=k;case 3:case 2:if(a(p)){if(a(o)){ot=o;ht=p;break}ot=p;ht=k}else{lt=o;et=p;ot=k;break}case 1:a(o)?ot=o:w?et=o:lt=o;break;case 0:break;default:throw i("badargs","Expected up to 4 arguments [params, data, success, error], got {0} arguments",arguments.length);}var ct=this instanceof nt,g=ct?et:n.isArray?[]:new nt(et),ft={},wt=n.interceptor&&n.interceptor.response||rt,pt=n.interceptor&&n.interceptor.responseError||undefined,at=!!ht,vt=!!pt,st,yt;return(c(n,function(n,t){switch(t){default:ft[t]=b(n);break;case"params":case"isArray":case"interceptor":case"cancellable":}}),!ct&&e&&(st=s.defer(),ft.timeout=st.promise,u&&(yt=h(st.resolve,u))),w&&(ft.data=et),tt.setUrlParams(ft,l({},it(et,n.params||{}),lt),n.url),ut=f(ft).then(function(u){var f=u.data,e;if(f){if(y(f)!==!!n.isArray)throw i("badcfg","Error in resource configuration for action `{0}`. Expected response to contain an {1} but got an {2} (Request: {3} {4})",t,n.isArray?"array":"object",y(f)?"array":"object",ft.method,ft.url);n.isArray?(g.length=0,c(f,function(n){typeof n=="object"?g.push(new nt(n)):g.push(n)})):(e=g.$promise,r(f,g),g.$promise=e)}return u.resource=g,u},function(n){return n.resource=g,s.reject(n)}),ut=ut["finally"](function(){g.$resolved=!0;!ct&&e&&(g.$cancelRequest=v,h.cancel(yt),st=yt=ft.timeout=null)}),ut=ut.then(function(n){var t=wt(n);return(ot||v)(t,n.headers,n.status,n.statusText),t},at||vt?function(n){return at&&!vt&&ut.catch(v),at&&ht(n),vt?pt(n):s.reject(n)}:undefined),!ct)?(g.$promise=ut,g.$resolved=!1,e&&(g.$cancelRequest=bt),g):ut};nt.prototype["$"+t]=function(n,i,r){a(n)&&(r=i,i=n,n={});var u=nt[t].call(this,n,this,i,r);return u.$promise||u}}),nt}var v=t.noop,c=t.forEach,l=t.extend,b=t.copy,y=t.isArray,p=t.isDefined,a=t.isFunction,k=t.isNumber,d=t.$$encodeUriQuery,g=t.$$encodeUriSegment;return w.prototype={setUrlParams:function(n,t,r){var e=this,f=r||e.template,o,s,h="",l=e.urlParams=Object.create(null);c(f.split(/\W/),function(n){if(n==="hasOwnProperty")throw i("badname","hasOwnProperty is not a valid parameter name.");!new RegExp("^\\d+$").test(n)&&n&&new RegExp("(^|[^\\\\]):"+n+"(\\W|$)").test(f)&&(l[n]={isQueryParamValue:new RegExp("\\?.*=:"+n+"(?:\\W|$)").test(f)})});f=f.replace(/\\:/g,":");f=f.replace(u,function(n){return h=n,""});t=t||{};c(e.urlParams,function(n,i){o=t.hasOwnProperty(i)?t[i]:e.defaults[i];p(o)&&o!==null?(s=n.isQueryParamValue?d(o,!0):g(o),f=f.replace(new RegExp(":"+i+"(\\W|$)","g"),function(n,t){return s+t})):f=f.replace(new RegExp("(/?):"+i+"(\\W|$)","g"),function(n,t,i){return i.charAt(0)==="/"?i:t+i})});e.defaults.stripTrailingSlashes&&(f=f.replace(/\/+$/,"")||"/");f=f.replace(/\/\.(?=\w+($|\?))/,".");n.url=h+f.replace(/\/(\\|%5C)\./,"/.");c(t,function(t,i){e.urlParams[i]||(n.params=n.params||{},n.params[i]=t)})}},nt}]})})(window,window.angular)}},[233])