@csmart/ngc-smart-victim 0.1.3 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common/http"),require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("apollo-angular"),require("@angular/common"),require("@angular/router"),require("@angular/material/table"),require("@angular/material"),require("@angular/forms"),require("@angular/cdk/table"),require("@angular/cdk/layout"),require("@csmart/ngc-smart-address"),require("@angular/cdk/coercion"),require("@angular/material/dialog"),require("@angular/platform-browser/animations"),require("@angular/material/icon"),require("@angular/material/snack-bar"),require("@azure/msal-angular"),require("@csmart/ngc-smart-core")):"function"==typeof define&&define.amd?define("@csmart/ngc-smart-victim",["exports","@angular/common/http","@angular/core","rxjs","rxjs/operators","apollo-angular","@angular/common","@angular/router","@angular/material/table","@angular/material","@angular/forms","@angular/cdk/table","@angular/cdk/layout","@csmart/ngc-smart-address","@angular/cdk/coercion","@angular/material/dialog","@angular/platform-browser/animations","@angular/material/icon","@angular/material/snack-bar","@azure/msal-angular","@csmart/ngc-smart-core"],e):e(((t=t||self).csmart=t.csmart||{},t.csmart["ngc-smart-victim"]={}),t.ng.common.http,t.ng.core,t.rxjs,t.rxjs.operators,t.apolloAngular,t.ng.common,t.ng.router,t.ng.material.table,t.ng.material,t.ng.forms,t.ng.cdk.table,t.ng.cdk.layout,t.ngcSmartAddress,t.ng.cdk.coercion,t.ng.material.dialog,t.ng.platformBrowser.animations,t.ng.material.icon,t.ng.material["snack-bar"],t.msalAngular,t.ngcSmartCore)}(this,(function(t,e,r,i,a,o,n,l,c,m,s,d,u,v,p,h,f,g,b,y,F){"use strict";
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common/http"),require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("apollo-angular"),require("@angular/common"),require("@angular/router"),require("@angular/material/table"),require("@angular/material"),require("@csmart/ngc-smart-core"),require("@angular/forms"),require("@angular/cdk/table"),require("@angular/cdk/layout"),require("@csmart/ngc-smart-address"),require("@angular/cdk/coercion"),require("@angular/material/dialog"),require("@angular/platform-browser/animations"),require("@angular/material/icon"),require("@angular/material/snack-bar"),require("@azure/msal-angular")):"function"==typeof define&&define.amd?define("@csmart/ngc-smart-victim",["exports","@angular/common/http","@angular/core","rxjs","rxjs/operators","apollo-angular","@angular/common","@angular/router","@angular/material/table","@angular/material","@csmart/ngc-smart-core","@angular/forms","@angular/cdk/table","@angular/cdk/layout","@csmart/ngc-smart-address","@angular/cdk/coercion","@angular/material/dialog","@angular/platform-browser/animations","@angular/material/icon","@angular/material/snack-bar","@azure/msal-angular"],e):e(((t=t||self).csmart=t.csmart||{},t.csmart["ngc-smart-victim"]={}),t.ng.common.http,t.ng.core,t.rxjs,t.rxjs.operators,t.apolloAngular,t.ng.common,t.ng.router,t.ng.material.table,t.ng.material,t.ngcSmartCore,t.ng.forms,t.ng.cdk.table,t.ng.cdk.layout,t.ngcSmartAddress,t.ng.cdk.coercion,t.ng.material.dialog,t.ng.platformBrowser.animations,t.ng.material.icon,t.ng.material["snack-bar"],t.msalAngular)}(this,(function(t,e,r,i,a,o,n,l,c,m,s,d,u,v,p,h,f,g,y,b,F){"use strict";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function I(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,a,o=r.call(t),n=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)n.push(i.value)}catch(t){a={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return n}function S(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(I(arguments[e]));return t}var C=new r.InjectionToken("smart offender service url"),D=new r.InjectionToken("smart lookup service url"),P=new r.InjectionToken("smart victim service url"),N=new r.InjectionToken("smart warrant web url");var w=function(){};var V=function(t,e,r,i,a,o,n,l,c,m,s,d){this.victimAdvocateId=t,this.lastName=e,this.firstName=r,this.prefixId=i,this.suffixId=a,this.addressId=o,this.noPhoneFlag=n,this.homePhone=l,this.workPhone=c,this.cellPhone=m,this.email=s,this.modifiedBy=d};var k=function(t,e,r,i){this.victimId=t,this.weaponTypeId=e,this.otherWeapon=r,this.modifiedBy=i};var x=function(t,e,r,i){this.victimId=t,this.drugTypeId=e,this.otherDrug=r,this.modifiedBy=i};var M=function(t,e,r){this.victimId=t,this.victimSupportTypeId=e,this.modifiedBy=r};var T=function(t,e,r,i,a,o,n,l,c,m,s,d,u){this.victimGuardianId=t,this.lastName=e,this.firstName=r,this.prefixId=i,this.suffixId=a,this.birthDate=o,this.addressId=n,this.noPhoneFlag=l,this.homePhone=c,this.workPhone=m,this.cellPhone=s,this.email=d,this.modifiedBy=u};var A=function(t,e,r,i,a,o,n,l,c,m,s,d,u,v,p,h,f,g,b,y,F,I,S,C,D,P,N,w,V,k,x,M,T,A,E,R,U,L,O,B,H,q,W,G,_,j,z,Y,$,J,K,Q,X,Z,tt,et,rt,it){this.victimId=t,this.offenderId=e,this.underSupervisionFlag=r,this.victimOffenderRelationshipTypeId=i,this.lastName=a,this.firstName=o,this.middleName=n,this.prefixId=l,this.suffixId=c,this.birthDate=m,this.genderCode=s,this.homePhone=d,this.workPhone=u,this.cellPhone=v,this.email=p,this.addressId=h,this.minorFlag=f,this.victimAdvocateFlag=g,this.guardianFirstName=b,this.guardianLastName=y,this.guardianPrefixId=F,this.guardianSuffixId=I,this.guardianNoPhoneFlag=S,this.guardianHomePhone=C,this.guardianWorkPhone=D,this.guardianCellPhone=P,this.guardianEmail=N,this.guardianAddressId=w,this.guardianBirthDate=V,this.advocateFirstName=k,this.advocateLastName=x,this.advocatePrefixId=M,this.advocateSuffixId=T,this.advocateNoPhoneFlag=A,this.advocateHomePhone=E,this.advocateWorkPhone=R,this.advocateCellPhone=U,this.advocateEmail=L,this.advocateAddressId=O,this.emergencyContact=B,this.emergencyContactPhone=H,this.commonChildrenFlag=q,this.commonChildrenNumber=W,this.cpoExpirationFlag=G,this.cpoExpirationDate=_,this.supportInPlaceFlag=j,this.weaponInvolvedFlag=z,this.drugUseFlag=Y,this.alcoholUseFlag=$,this.accessRisk=J,this.modifiedBy=K,this.relationship=Q,this.vVictimAdvocate=X,this.vVictimGuardian=Z,this.victimSupports=tt,this.victimWeaponUses=et,this.victimDrugUses=rt,this.allowCsosaContactFlag=it};var E=new e.HttpHeaders({"Content-Type":"application/json"}),R={headers:E},U=function(){function t(t,e,r,i,a){this.http=t,this.smartOffenderServiceUrl=e,this.smartLookupServiceUrl=r,this.smartVictimServiceUrl=i,this.apollo=a,this.serviceApiUrl="https://smart-service-test.azurewebsites.net/graphql"}return t.prototype.handleError=function(t){return console.error(t),i.throwError(t.json().error||"Server error")},t.prototype.getDrugsTypes=function(){return this.http.get(this.smartLookupServiceUrl+"DrugTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getDocketList=function(t){var e="\n {\n findDockets(input: { where: { offenderId:"+t+" } }) {\n totalCount\n message\n data {\n docketId\n docketNumber\n \n }\n }\n }";return this.http.post(this.serviceApiUrl,{query:e}).pipe(a.map((function(t){var e=t.data;return console.log("dockets for this offender:",e.findDockets.data),e.findDockets.data})))},t.prototype.getSupportTypes=function(){return this.http.get(this.smartLookupServiceUrl+"VictimSupportTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getPrefixes=function(){return this.http.get(this.smartLookupServiceUrl+"Prefixes",R).pipe(a.map((function(t){return t})))},t.prototype.getSuffixes=function(){return this.http.get(this.smartLookupServiceUrl+"Suffixes",R).pipe(a.map((function(t){return t})))},t.prototype.getRelationshipTypes=function(){return this.http.get(this.smartLookupServiceUrl+"RelationshipTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getGenders=function(){return this.http.get(this.smartLookupServiceUrl+"Genders",R).pipe(a.map((function(t){return t})))},t.prototype.getWeaponTypes=function(){return this.http.get(this.smartLookupServiceUrl+"WeaponTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getFlagOptionYesNoUnknowns=function(){return this.http.get(this.smartLookupServiceUrl+"FlagOptionYesNoUnknowns",R).pipe(a.map((function(t){return t})))},t.prototype.getContactTypes=function(){return this.http.get(this.smartLookupServiceUrl+"ContactTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getContactMethods=function(){return this.http.get(this.smartLookupServiceUrl+"VictimContactMethods",R).pipe(a.map((function(t){return t})))},t.prototype.getContactBys=function(){return this.http.get(this.smartLookupServiceUrl+"VictimContactPurposes",R).pipe(a.map((function(t){return t})))},t.prototype.getVictimContactPurposes=function(){return this.http.get(this.smartLookupServiceUrl+"VictimContactPurposes",R).pipe(a.map((function(t){return t})))},t.prototype.getVictimServiceTypes=function(){return this.http.get(this.smartLookupServiceUrl+"VictimServiceTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getVictimServiceStatus=function(){return this.http.get(this.smartLookupServiceUrl+"VictimServiceStatus",R).pipe(a.map((function(t){return t})))},t.prototype.getvVictimServiceTypeProgramProviders=function(){return this.http.get(this.smartLookupServiceUrl+"vVictimServiceTypeProgramProviders",R).pipe(a.map((function(t){return t})))},t.prototype.getVictim=function(t){return this.http.get(this.smartVictimServiceUrl+"Victims/"+t,R).pipe(a.map((function(t){return console.log("victim return data"),console.log(t),t})))},t.prototype.getVictimAdvocate=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimAdvocates/"+t,R).pipe(a.map((function(t){return t})))},t.prototype.getVictimGuardian=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimGuardians/"+t,R).pipe(a.map((function(t){return t})))},t.prototype.postVictims=function(t){var e=JSON.stringify(t);return this.http.post(this.smartVictimServiceUrl+"Victims",e,R).pipe(a.map((function(t){return t})))},t.prototype.putVictims=function(t,e){var r=JSON.stringify(e);return this.http.put(this.smartVictimServiceUrl+"Victims/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.putVictimAdvocate=function(t,e){var r;return r=JSON.stringify(e),this.http.put(this.smartVictimServiceUrl+"VictimAdvocates/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.postVictimAdvocate=function(t,e){var r=JSON.stringify(e);return this.http.post(this.smartVictimServiceUrl+"VictimAdvocates/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.putVictimGuardian=function(t,e){console.log("update victim guardian"),console.log(e);var r=JSON.stringify(e);return this.http.put(this.smartVictimServiceUrl+"VictimGuardians/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.postVictimGuardian=function(t,e){var r=JSON.stringify(e);return this.http.post(this.smartVictimServiceUrl+"VictimGuardians/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.getVictimDrugUse=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimDrugUses/"+t,R).pipe(a.map((function(t){return t})))},t.prototype.putVictimDrugUse=function(t,e){var r=JSON.stringify(e);return this.http.put(this.smartVictimServiceUrl+"VictimDrugUses/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.postVictimDrugUse=function(t,e){var r=JSON.stringify(e);return this.http.post(this.smartVictimServiceUrl+"VictimDrugUses/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.putVictimWeaponUse=function(t,e){var r=JSON.stringify(e);return this.http.put(this.smartVictimServiceUrl+"VictimWeaponUses/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.postVictimWeaponUse=function(t,e){var r=JSON.stringify(e);return this.http.post(this.smartVictimServiceUrl+"VictimWeaponUses/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.putVictimSupport=function(t,e){var r=JSON.stringify(e);return this.http.put(this.smartVictimServiceUrl+"VictimSupports/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.postVictimSupport=function(t,e){var r=JSON.stringify(e);return this.http.post(this.smartVictimServiceUrl+"VictimSupports/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.deleteVictims=function(t){return this.http.delete(this.smartVictimServiceUrl+"Victims/"+t,R).pipe(a.map((function(t){return t})))},t.prototype.getVictims=function(t){return this.http.get(this.smartVictimServiceUrl+"Victims/offender/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.getVictimsByFilter=function(t){return this.http.post(this.smartVictimServiceUrl+"/Victims",JSON.stringify(t),{headers:E}).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.getVictimListByFilter=function(t){return console.log("filer in service"),console.log(t),this.http.post(this.smartVictimServiceUrl+"vVictims/Filter",JSON.stringify(t),R).pipe()},t.prototype.getCasetNotes=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimCaseNotes/victim/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.addCaseNote=function(t){var e;return e=JSON.stringify(t),this.http.post(this.smartVictimServiceUrl+"VictimCaseNotes/",e,R)},t.prototype.updateCaseNote=function(t){var e;return e=JSON.stringify(t),this.http.put(this.smartVictimServiceUrl+"VictimCaseNotes/"+t.victimCaseNoteId,e,R)},t.prototype.deleteCaseNote=function(t,e){return this.http.delete(this.smartVictimServiceUrl+"VictimCaseNotes/"+t+"?staffId="+e)},t.prototype.getContacts=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimContacts/victim/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.addContact=function(t){var e;return e=JSON.stringify(t),this.http.post(this.smartVictimServiceUrl+"VictimContacts/",e,R)},t.prototype.updateContact=function(t){var e;return e=JSON.stringify(t),this.http.put(this.smartVictimServiceUrl+"VictimContacts/"+t.victimContactId,e,R)},t.prototype.getSafetyPlans=function(t){return this.http.get(this.smartVictimServiceUrl+"vVictimServiceLists/victim/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.getVictimServices=function(t){return this.http.get(this.smartVictimServiceUrl+"vVictimServiceLists/victimServiceId/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.getVictimServiceDetail=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimServiceDetails/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.addSafetyPlan=function(t){var e;return e=JSON.stringify(t),this.http.post(this.smartVictimServiceUrl+"VictimServices/",e,R).pipe()},t.prototype.updateSafetyPlan=function(t){var e;return e=JSON.stringify(t),this.http.put(this.smartVictimServiceUrl+"VictimServices/"+t.victimServiceId,e,R)},t.prototype.addVictimServiceStatus=function(t){var e;return e=JSON.stringify(t),this.http.post(this.smartVictimServiceUrl+"VictimServiceStatusHistories/",e,R)},t.prototype.getServiceStatusHistories=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimServiceStatusHistories/victimServiceId/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.deleteSafetyPlan=function(t,e){return this.http.delete(this.smartVictimServiceUrl+"VictimServices/"+t+"?staffId="+e)},t.prototype.addPlanProvider=function(t){var e;return e=JSON.stringify(t),this.http.post(this.smartVictimServiceUrl+"VictimServiceDetails/",e,R).pipe()},t.prototype.deleteProvider=function(t,e){return this.http.delete(this.smartVictimServiceUrl+"VictimServiceDetails/"+t+"?staffId="+e)},t.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:e.HttpClient},{type:String,decorators:[{type:r.Inject,args:[C]}]},{type:String,decorators:[{type:r.Inject,args:[D]}]},{type:String,decorators:[{type:r.Inject,args:[P]}]},{type:o.Apollo}]},t.ngInjectableDef=r.defineInjectable({factory:function(){return new t(r.inject(e.HttpClient),r.inject(C),r.inject(D),r.inject(P),r.inject(o.Apollo))},token:t,providedIn:"root"}),t}();new Headers({"Content-Type":"application/json"});var L=function(){function t(t,e){this.http=t,this.smartOffenderServiceUrl=e}return t.prototype.getIntakeByOffender=function(t){return this.http.get(this.smartOffenderServiceUrl+"IntakeBasic/offender/"+t).pipe()},t.prototype.updateIntakeSteps=function(t,e){return this.http.put(this.smartOffenderServiceUrl+"/IntakeStepStatus/"+t,e)},t.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:e.HttpClient},{type:String,decorators:[{type:r.Inject,args:[C]}]}]},t.ngInjectableDef=r.defineInjectable({factory:function(){return new t(r.inject(e.HttpClient),r.inject(C))},token:t,providedIn:"root"}),t}();var O=function(){function t(){}return t.PhysicalInformation="PHYSIN",t.Photo="PHOTOS",t.HousingInformation="HOUSE",t.DocketInformation="DOCKET",t.Alias="ALIAS",t.IntakeBasicInformation="INTKBI",t.ContactInformation="CONTCT",t.DeceasedInformation="DEATH",t.DriversLicense="DRVLIC",t.EmploymentInformation="EMPLOY",t.GangAffiliation="GANG",t.HealthInsurance="HLTHINS",t.Identification="IDNTFCTN",t.InternetIdentifier="INTERNETID",t.MilitaryService="MLTSVC",t.School="SCHOOL",t.SelectiveService="SLCTVSVC",t.Vehicle="VEHICLE",t.VictimInformation="VICTIM",t.WarrantInformation="WARRNT",t.RunningRecord="RUNREC",t.Signature="SIGN",t}();var B=function(){function t(t,e,r,i,a,o,n,l){this.dialog=t,this.victimService=e,this.router=r,this.route=i,this.snackBar=a,this.intakeService=o,this.smartWarrantUrl=n,this.document=l,this.victims=[],this.victimDetail={},this.showDetail=!1,this.victimListFilter=new w,this.victimListDataSource=new c.MatTableDataSource,this.doSpin=!1,this.showListFlag=!1,this.msg="",this.isIntake=!1}return t.prototype.applyFilter=function(t){this.victimListDataSource.filter=t.trim().toLowerCase()},t.prototype.addRecord=function(){this.showDetail=!0,this.showAdd=!1,this.victimDetail=null,this.showListFlag=!1},t.prototype.editVictimDetail=function(t){console.log("victim edit record"),console.log(t),console.log(t.victimId),this.victimDetail=t,this.showDetail=!0,this.showAdd=!1,this.showListFlag=!1},t.prototype.save=function(t){this.showDetail=!1,this.showAdd=!0,this.showListFlag=!0},t.prototype.cancel=function(){this.showDetail=!1,this.victimDetail={}},t.prototype.ngAfterViewInit=function(){this.victimListDataSource.paginator=this.paginator,this.victimListDataSource.sort=this.sort},t.prototype.ngOnInit=function(){var t=this,e=this.route.snapshot.data,r=this.router.url.slice(-10);if(console.log("smart-victim ngOnInit"),console.log(this.intakeFlag),console.log(r),(this.intakeFlag||"victimHome"==r)&&(this.isIntake=!0),this.displayedColumns=["lastName","firstName"],1!=this.showRelationshipColumn&&"victimList"!=r&&"victimHome"!=r||this.displayedColumns.push("relationship"),1==this.showOffenderNameColumn&&this.displayedColumns.push("offenderName"),1!=this.showOffenderPhoneColumn&&"victimList"!=r&&"victimHome"!=r||this.displayedColumns.push("homePhone"),this.displayedColumns.push("victimId"),1==this.showSearchForm&&(this.showListFlag=!1),console.log("this.showSearchForm"),console.log(this.showSearchForm),console.log("myPath"),console.log(r),0==this.showSearchForm||"victimList"==r||"victimHome"==r){var i;this.offenderId?i=this.offenderId:(console.log("back from previous page"),this.showAdd=!0,this.showRelationshipColumn=!0,this.showOffenderPhoneColumn=!0,this.accessByModule="true",this.showEdit="true",this.showCaseNote="true",this.showSafetyPlan="true",i=e.selectedOffender.offenderId);var a={offenderId:i,lastName:null,firstName:null,pdid:null,birthDate:null};console.log("victimListFilter in smar-victim componenet"),console.log(a),this.victimService.getVictimListByFilter(a).subscribe((function(e){t.victimListDataSource.data=e,t.victims=e,e.forEach((function(t){null!=t.homePhone&&""!=t.homePhone||(t.homePhone=t.cellPhone),null!=t.homePhone&&""!=t.homePhone||(t.homePhone=t.workPhone)})),console.log("victim data at line 179"),console.log(t.victims),console.log("showListFlag"),console.log(t.showListFlag),t.showListFlag=!0,0==e.length&&(t.msg="No Record Found!")}))}else console.log("find filter"),console.log(this.victimListFilter),!0===this.showListFlag&&null!=this.victimListFilter&&this.victimService.getVictimListByFilter(this.victimListFilter).subscribe((function(e){t.victimListDataSource.data=e,t.victims=e,console.log("victim data at line 201"),console.log(e)}))},t.prototype.formatPhoneNumber=function(t){if(!t)return"";var e=(""+t).replace(/\D/g,"").match(/^(\d{3})(\d{3})(\d{4})$/);return e?"("+e[1]+") "+e[2]+"-"+e[3]:""},t.prototype.saveIntake=function(){var t=this;if(this.isIntake){var e={intakeStepId:O.VictimInformation,offenderId:this.offenderId,modifiedBy:this.staffId};this.intakeService.updateIntakeSteps(this.offenderId,e).subscribe((function(e){console.log("save intake step."),t.snackBar.open("Status Saved.","",{duration:3e3}),t.document.location.href=t.smartWarrantUrl+"/warrant"}))}},t.prototype.goToCaseNote=function(t){this.router.navigate(["casenote",t])},t.prototype.goToSaftyPlan=function(t){this.router.navigate(["saftyPlan",t])},t.prototype.getVictimList=function(t){var e=this;this.victimListFilter=t,console.log("this.victimListFilter inside getVictimList"),console.log(this.victimListFilter),this.doSpin=!0,this.victimService.getVictimListByFilter(t).subscribe((function(t){e.victimListDataSource.data=t,e.doSpin=!e.doSpin,t.length>0?e.showListFlag=!0:e.msg="No record found!"}),(function(t){e.doSpin=!e.doSpin}))},t.decorators=[{type:r.Component,args:[{selector:"csmart-victim",template:'<div *ngIf="showSearchForm">\r\n <app-victim-search-form\r\n (onSearch)="getVictimList($event)">\r\n </app-victim-search-form>\r\n</div>\r\n\r\n<div *ngIf="showDetail">\r\n <csmart-victim-detail [victimDetail]="victimDetail" \r\n [staffId]="staffId"\r\n [offenderId] ="offenderId"\r\n [isIntake]="isIntake"\r\n (onSave)="save($event)" \r\n (onCancel)="cancel()" >\r\n</csmart-victim-detail>\r\n</div>\r\n<div class="main-container">\r\n \r\n <div class="add-action" *ngIf="showAdd">\r\n <button mat-raised-button color="primary" (click)="addRecord()">\r\n <mat-icon>add</mat-icon>\r\n Add Victim\r\n </button>\r\n &nbsp;&nbsp;\r\n\r\n <div *ngIf="isIntake">\r\n <button \r\n mat-raised-button \r\n color="primary" \r\n (click)="saveIntake()">\r\n Continue\r\n </button> \r\n </div>\r\n\r\n </div>\r\n <div *ngIf="showListFlag">\r\n <mat-card id="divVictim" >\r\n <mat-card-content >\r\n <mat-table #table [dataSource]="victimListDataSource" >\r\n\r\n <ng-container matColumnDef="lastName">\r\n <mat-header-cell *matHeaderCellDef>Victim Last Name</mat-header-cell>\r\n <mat-cell *matCellDef="let row" > {{row.lastName}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef="firstName">\r\n <mat-header-cell *matHeaderCellDef >Victim First Name</mat-header-cell>\r\n <mat-cell *matCellDef="let row" > {{row.firstName}} </mat-cell>\r\n </ng-container>\r\n \r\n <div *ngIf="showRelationshipColumn">\r\n <ng-container matColumnDef="relationship">\r\n <mat-header-cell *matHeaderCellDef >Relationship to Offender</mat-header-cell>\r\n <mat-cell *matCellDef="let row" > {{row.relationship}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf="showOffenderPhoneColumn">\r\n <ng-container matColumnDef="homePhone">\r\n <mat-header-cell *matHeaderCellDef >Phone Number</mat-header-cell>\r\n <mat-cell *matCellDef="let row" > {{formatPhoneNumber(row.homePhone)}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n \r\n <div *ngIf="showOffenderNameColumn">\r\n <ng-container matColumnDef="offenderName">\r\n <mat-header-cell *matHeaderCellDef>Offender Name</mat-header-cell>\r\n <mat-cell *matCellDef="let row" > {{row.offenderName}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n \r\n <ng-container matColumnDef="victimId">\r\n <mat-header-cell *matHeaderCellDef ></mat-header-cell>\r\n <mat-cell *matCellDef="let row" >\r\n \r\n \x3c!-- <div *ngIf="accessByModule">\r\n <mat-checkbox></mat-checkbox>\r\n </div> --\x3e\r\n \r\n <div *ngIf="showEdit">\r\n <button class="edit-btn" mat-icon-button color="primary" matTooltip="View/Edit Victim" (click)="editVictimDetail(row)">\r\n <i class="material-icons">mode_edit</i>\r\n </button>\r\n </div>\r\n\r\n \r\n\r\n &nbsp;&nbsp; \r\n\r\n <div *ngIf="showCaseNote">\r\n <button type="button" matTooltip="CaseNote" mat-raised-button color="primary" (click)="goToCaseNote(row.victimId)"> \r\n <span class="glyphicon glyphicon-pencil" ></span>&nbsp;Case Note\r\n </button> \r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n <div *ngIf="showSafetyPlan">\r\n <button type="button" matTooltip="safety plan" mat-raised-button color="primary" (click)="goToSaftyPlan(row.victimId)"> \r\n <span class="glyphicon glyphicon-pencil" ></span>&nbsp;Safety Plan\r\n </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="displayedColumns" class="example-header-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns: displayedColumns" class="example-row"></mat-row>\r\n </mat-table>\r\n\r\n <mat-paginator #paginator [pageSize]="10" [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator> \r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div>\r\n <b>{{msg}}</b>\r\n </div>\r\n</div>',styles:['div.services{max-width:500px;margin:auto;border:3px solid #73ad21}.rTable{display:block;width:100%}.rTableBody,.rTableFoot,.rTableHeading,.rTableRow{clear:both}.rTableFoot,.rTableHead{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.victimSearch{display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-description,.example-headers-align .mat-expansion-panel-header-title{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-firstName,.mat-column-homePhone,.mat-column-lastName,.mat-column-offenderName,.mat-column-relationship{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}']}]}],t.ctorParameters=function(){return[{type:m.MatDialog},{type:U},{type:l.Router},{type:l.ActivatedRoute},{type:m.MatSnackBar},{type:L},{type:String,decorators:[{type:r.Inject,args:[N]}]},{type:void 0,decorators:[{type:r.Inject,args:[n.DOCUMENT]}]}]},t.propDecorators={offenderId:[{type:r.Input}],staffId:[{type:r.Input}],staffRole:[{type:r.Input}],showCaseNote:[{type:r.Input}],showSafetyPlan:[{type:r.Input}],showAdd:[{type:r.Input}],showEdit:[{type:r.Input}],showRelationshipColumn:[{type:r.Input}],showOffenderNameColumn:[{type:r.Input}],showOffenderPhoneColumn:[{type:r.Input}],showSearchForm:[{type:r.Input}],accessByModule:[{type:r.Input}],intakeFlag:[{type:r.Input}],paginator:[{type:r.ViewChild,args:[m.MatPaginator]}],sort:[{type:r.ViewChild,args:[m.MatSort]}]},t}();var H=function(){function t(t){this.commondialogRef=t,this.cmdYesTitle="Yes",this.cmdNoTitle="No"}return t.prototype.ngOnInit=function(){},t.decorators=[{type:r.Component,args:[{selector:"app-common-dialog",template:'\r\n \r\n <mat-card class="example-card"> \r\n <mat-card-content>\r\n <p>{{ title }}</p>\r\n <p>{{ message }}</p>\r\n <br>\r\n\r\n <div class="inner">\r\n <button type="button" mat-raised-button color="primary"\r\n (click)="commondialogRef.close(true)">{{cmdYesTitle}}</button>\r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n <div *ngIf="cmdYesTitle!==\'Ok\'" class="inner">\r\n <button type="button" mat-raised-button color="primary" \r\n (click)="commondialogRef.close()">{{cmdNoTitle}}</button>\r\n \r\n </div>\r\n \r\n \r\n </mat-card-content>\r\n </mat-card>',styles:[".md-dialog-container{position:fixed;top:0!important;overflow:hidden}.inner{display:inline-block}"]}]}],t.ctorParameters=function(){return[{type:m.MatDialogRef}]},t}();var q=function(){function t(t){this.dialog=t}return t.prototype.confirm=function(t,e,r,i){var a;return(a=this.dialog.open(H)).componentInstance.title=t,a.componentInstance.message=e,a.componentInstance.cmdYesTitle=r,a.componentInstance.cmdNoTitle=i,a.afterClosed()},t.prototype.warning=function(t,e,r){var i;return(i=this.dialog.open(H)).componentInstance.title=t,i.componentInstance.message=e,i.componentInstance.cmdYesTitle=r,i.afterClosed()},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:m.MatDialog}]},t}();function W(t,e,r){return function(i){if(!i.parent)return null;var a=null;if(t()&&(a=e(i)),r&&a){var o={};o[r]=a,a=o}return a}}function G(t,e,r){return function(i){if(!i.parent)return null;var a=null;if("YS"==t()&&(a=e(i)),r&&a){var o={};o[r]=a,a=o}return a}}var _=function(){function t(t,e,i,a,o,l,m,s){this.location=t,this.formBuilder=e,this.dialog=i,this.route=a,this.router=o,this.snackBar=l,this.commonDialogService=m,this.victimService=s,this.victimDetail={},this.onSave=new r.EventEmitter,this.onCancel=new r.EventEmitter,this.hidden=!0,this.victimAdvocate={},this.victimGuardian={},this.guardianTabFlag=!1,this.advocateTabFlag=!1,this.commonChildrenDivFlag=!1,this.cpoExpirationDivFlag=!1,this.supportInPlaceDivFlag=!1,this.weaponInvolvedDivFlag=!1,this.drugUseDivFlag=!1,this.showDelete=!1,this.addressId=0,this.advocateAddressId=0,this.guardianAddressId=0,this.datePipe=new n.DatePipe("en-US"),this.emailPattern="^[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",this.phoneNumber="\\d{10}",this.editVictim={},this.otherWeaponFlag=!1,this.otherDrugFlag=!1,this.contactDataSource=new c.MatTableDataSource,this.guardianPhoneExistFlag=!1,this.advocatePhoneExistFlag=!1,this.phoneValidationFlag=!1,this.guaridanNoPhoneChkFlag=!0,this.advocateNoPhoneChkFlag=!0,this.addressValidators={street:[],street2:[],city:[],stateCode:[],zipCode:[],psaCode:[]},this.initForm()}return t.prototype.initForm=function(){var t=this;this.victimForm=this.formBuilder.group({underSupervisionFlag:new s.FormControl("",s.Validators.compose([s.Validators.required])),victimOffenderRelationshipTypeId:new s.FormControl("",s.Validators.compose([s.Validators.required])),lastName:new s.FormControl("",s.Validators.compose([s.Validators.required])),firstName:new s.FormControl("",s.Validators.compose([s.Validators.required])),middleName:new s.FormControl(""),prefixId:new s.FormControl(""),suffixId:new s.FormControl(""),genderCode:new s.FormControl(""),birthDate:new s.FormControl(""),homePhone:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.phoneNumber)])),cellPhone:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.phoneNumber)])),workPhone:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.phoneNumber)])),email:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.emailPattern)])),minorFlag:new s.FormControl("",s.Validators.compose([s.Validators.required])),victimAdvocateFlag:new s.FormControl("",s.Validators.compose([s.Validators.required])),guardianLastName:new s.FormControl("",W((function(){return t.victimForm.get("minorFlag").value}),s.Validators.required,"illuminatiError")),guardianFirstName:new s.FormControl("",W((function(){return t.victimForm.get("minorFlag").value}),s.Validators.required,"illuminatiError")),guardianPrefixId:new s.FormControl(""),guardianSuffixId:new s.FormControl(""),guardianBirthDate:new s.FormControl(""),guardianNoPhoneFlag:new s.FormControl(!0),guardianHomePhone:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.phoneNumber)])),guardianCellPhone:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.phoneNumber)])),guardianWorkPhone:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.phoneNumber)])),guardianEmail:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.emailPattern)])),advocateNoPhoneFlag:new s.FormControl(!0),advocateWorkPhone:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.phoneNumber)])),advocateHomePhone:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.phoneNumber)])),advocateCellPhone:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.phoneNumber)])),advocateSuffixId:new s.FormControl(""),advocatePrefixId:new s.FormControl(""),advocateFirstName:new s.FormControl("",G((function(){return t.victimForm.get("victimAdvocateFlag").value}),s.Validators.required,"illuminatiError")),advocateLastName:new s.FormControl("",G((function(){return t.victimForm.get("victimAdvocateFlag").value}),s.Validators.required,"illuminatiError")),advocateEmail:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.emailPattern)])),emergencyContact:new s.FormControl(""),emergencyContactPhone:new s.FormControl("",s.Validators.compose([s.Validators.pattern(this.phoneNumber)])),emergencyChildren:new s.FormControl(""),emergencyCpo:new s.FormControl(""),emergencyDrug:new s.FormControl(""),emergencySupport:new s.FormControl(""),emergencyWeapon:new s.FormControl(""),drug:new s.FormControl(""),weapon:new s.FormControl(""),support:new s.FormControl(""),commonChildrenFlag:new s.FormControl(""),commonChildrenNumber:new s.FormControl(""),cpoExpirationFlag:new s.FormControl(""),cpoExpirationDate:new s.FormControl(""),accessRisk:new s.FormControl(""),drugUseFlag:new s.FormControl(""),supportInPlaceFlag:new s.FormControl(""),weaponInvolvedFlag:new s.FormControl(""),otherWeapon:new s.FormControl(""),otherDrug:new s.FormControl(""),alcoholUseFlag:new s.FormControl(""),victimSupports:new s.FormControl(""),victimWeaponUses:new s.FormControl(""),victimDrugUses:new s.FormControl(""),allowCsosaContactFlag:new s.FormControl("")}),this.victimForm.markAsPristine(),this.victimForm.markAsUntouched()},t.prototype._getVictim=function(){var t=this;if(0!==this.victimId)return 1==this.editMode?(console.log("find victim id inside getVictim"),console.log(this.victimId),void 0===this.victimId&&(this.sub=this.route.params.subscribe((function(e){t.victimId=e.victimId,console.log("my this.victimId"),console.log(t.victimId)}))),void this.victimService.getVictim(this.victimId).subscribe((function(e){console.log("victim data 1"),console.log(e),t.editVictim=e;var r=[];t.editVictim.victimSupports.forEach((function(t){r.push(t.victimSupportTypeId)})),t.victimForm.get("victimSupports").setValue(r);var i=[],a="";t.editVictim.victimWeaponUses.forEach((function(e){i.push(e.weaponTypeId),"OTHER"==e.weaponTypeId&&(a=e.otherWeapon,t.otherWeaponFlag=!0)})),t.victimForm.get("victimWeaponUses").setValue(i),t.victimForm.get("otherWeapon").setValue(a);var o=[],n="";console.log("load this.editVictim.victimDrugUses"),console.log(t.editVictim.victimDrugUses),t.editVictim.victimDrugUses.forEach((function(e){null===e.drugTypeId&&(n=e.otherDrug,t.otherDrugFlag=!0,e.drugTypeId="OTHER"),o.push(e.drugTypeId)})),console.log("this.editVictim.victimDrugUses after push"),console.log(o),t.victimForm.get("victimDrugUses").setValue(o),t.victimForm.get("otherDrug").setValue(n),t.victimService.getContacts(t.victimId).subscribe((function(e){console.log("contactList"),console.log(e),t.contactList=e,t.contactDataSource.data=t.contactList})),!1===t.editVictim.guardianNoPhoneFlag&&t.victimForm.patchValue({guardianNoPhoneFlag:!1}),!1===t.editVictim.advocateNoPhoneFlag&&t.victimForm.patchValue({advocateNoPhoneFlag:!1})}),(function(e){t.snackBar.open("Error occured while retriving Victim Information. Please try again.")}))):void 0},t.prototype.ngOnChanges=function(){},t.prototype.onAddressChange=function(t){this.victimForm.patchValue({addressId:t}),this.addressId=t},t.prototype.onGuardianAddressChange=function(t){this.victimForm.patchValue({guardianAddressId:t}),this.guardianAddressId=t},t.prototype.onAdvocateAddressChange=function(t){this.victimForm.patchValue({advocateAddressId:t}),this.advocateAddressId=t},t.prototype.cancel=function(){this.victimForm.reset()},t.prototype.ngOnInit=function(){var t=this;console.log("show offenderId"),console.log(this.offenderId),console.log("show staffId"),console.log(this.staffId),console.log("show isIntake"),console.log(this.isIntake);var e={get:function(){if(this._required)return this._required;if(this.ngControl&&this.ngControl.control&&this.ngControl.control.validator){var t=Object.assign({},this.ngControl.control);return t.value=null,"required"in(this.ngControl.control.validator(t)||{})}return!1},set:function(t){this._required=p.coerceBooleanProperty(t)}};if(Object.defineProperty(m.MatInput.prototype,"required",e),Object.defineProperty(m.MatSelect.prototype,"required",e),Object.defineProperty(m.MatRadioGroup.prototype,"required",e),null!=this.victimDetail){if(this.editMode=!0,this.showDelete=!0,this.victimId=this.victimDetail.victimId,this.guardianTabFlag=this.victimDetail.minorFlag,"YS"==this.victimDetail.victimAdvocateFlag&&(this.advocateTabFlag=!0),1==this.otherWeaponFlag)this.victimForm.get("otherWeapon").setValidators(s.Validators.required);if(1==this.otherDrugFlag)this.victimForm.get("otherDrug").setValidators(s.Validators.required);this.cpoExpirationDivFlag=this.victimDetail.cpoExpirationFlag,this.commonChildrenDivFlag=this.victimDetail.commonChildrenFlag,this.supportInPlaceDivFlag=this.victimDetail.supportInPlaceFlag,this.weaponInvolvedDivFlag=this.victimDetail.weaponInvolvedFlag,this.drugUseDivFlag=this.victimDetail.drugUseFlag,this.addressId=this.victimDetail.addressId,this.guardianAddressId=this.victimDetail.guardianAddressId,this.advocateAddressId=this.victimDetail.advocateAddressId,this._getVictim()}else this.victimForm.patchValue({guardianNoPhoneFlag:!0}),this.victimForm.patchValue({advocateNoPhoneFlag:!0});this.victimService.getFlagOptionYesNoUnknowns().subscribe((function(e){t.flagOption=e})),this.victimService.getGenders().subscribe((function(e){t.genders=e})),this.victimService.getPrefixes().subscribe((function(e){t.prefixes=e})),this.victimService.getSuffixes().subscribe((function(e){t.suffixes=e})),this.victimService.getRelationshipTypes().subscribe((function(e){t.relationshipTypes=e.filter((function(t){return"ST"===t.relationshipCategoryId||"FM"===t.relationshipCategoryId}))})),this.victimService.getSupportTypes().subscribe((function(e){t.victimSupportTypes=e})),this.victimService.getWeaponTypes().subscribe((function(e){t.weaponTypes=e})),this.victimService.getDrugsTypes().subscribe((function(e){console.log("drug lookup items"),console.log(e),t.drugs=e,t.drugs.push({drugTypeId:"OTHER",name:"Other"}),console.log(t.drugs)})),this.victimForm.get("minorFlag").valueChanges.subscribe((function(e){t.victimForm.get("guardianFirstName").updateValueAndValidity(),t.victimForm.get("guardianLastName").updateValueAndValidity(),t.victimForm.get("guardianWorkPhone").updateValueAndValidity(),t.victimForm.get("guardianHomePhone").updateValueAndValidity(),t.victimForm.get("guardianCellPhone").updateValueAndValidity()})),this.victimForm.get("victimAdvocateFlag").valueChanges.subscribe((function(e){t.victimForm.get("advocateFirstName").updateValueAndValidity(),t.victimForm.get("advocateLastName").updateValueAndValidity(),t.victimForm.get("advocateWorkPhone").updateValueAndValidity(),t.victimForm.get("advocateHomePhone").updateValueAndValidity(),t.victimForm.get("advocateCellPhone").updateValueAndValidity()}))},t.prototype.back=function(){this.onSave.emit(this.victimDetail)},t.prototype.deleteVictim=function(){var t=this;this.commonDialogService.confirm("","Do you want to delete this Victim?","Yes","No").subscribe((function(e){t.result=e,t.result&&(t.victimService.deleteVictims(t.victimDetail.victimId).subscribe((function(e){t.snackBar.open("Delete Successfully!","",{duration:3e3})})),t.onSave.emit(t.victimDetail))}))},t.prototype.radioMinorChange=function(t){var e=this.victimForm.get("guardianLastName"),r=this.victimForm.get("guardianFirstName");!0===t.value?(this.guardianTabFlag=!0,e.setValidators(s.Validators.required),r.setValidators(s.Validators.required)):(this.guardianTabFlag=!1,e.clearValidators(),r.clearValidators()),e.updateValueAndValidity(),r.updateValueAndValidity()},t.prototype.radioAdvocateChange=function(t){var e=this.victimForm.get("advocateLastName"),r=this.victimForm.get("advocateFirstName");"YS"===t.value?(this.advocateTabFlag=!0,e.setValidators(s.Validators.required),r.setValidators(s.Validators.required)):(this.advocateTabFlag=!1,e.clearValidators(),r.clearValidators()),e.updateValueAndValidity(),r.updateValueAndValidity()},t.prototype.radioCicChange=function(t){!0===t.value?(this.commonChildrenDivFlag=!0,this.setValidators("commonChildren")):this.commonChildrenDivFlag=!1},t.prototype.setValidators=function(t){"commonChildren"==t?(this.victimForm.get("commonChildrenNumber").clearValidators(),this.victimForm.get("commonChildrenNumber").setValidators(s.Validators.required)):"cpo"==t&&(this.victimForm.get("cpoExpirationDate").clearValidators(),this.victimForm.get("cpoExpirationDate").setValidators(s.Validators.required))},t.prototype.radioSupportChange=function(t){!0===t.value?this.supportInPlaceDivFlag=!0:this.supportInPlaceDivFlag=!1},t.prototype.radioWeaponChange=function(t){!0===t.value?this.weaponInvolvedDivFlag=!0:this.weaponInvolvedDivFlag=!1},t.prototype.radioDrugChange=function(t){!0===t.value?this.drugUseDivFlag=!0:this.drugUseDivFlag=!1},t.prototype.radioCpoChange=function(t){!0===t.value?(this.cpoExpirationDivFlag=!0,this.setValidators("cpo")):this.cpoExpirationDivFlag=!1},t.prototype.handleDOBChange=function(t){var e=Date.now()-t.value,r=new Date(e);if(Math.abs(r.getUTCFullYear()-1970)<=18){this.snackBar.open("Victim is a Minor. This information is a sensitive and should not be disclosed to any unauthorized parties. Contact the legal guardian.","",{duration:6e3}),this.victimForm.get("minorFlag").setValue(!0);var i=this.victimForm.get("guardianLastName"),a=this.victimForm.get("guardianFirstName");this.guardianTabFlag=!0,i.setValidators(s.Validators.required),a.setValidators(s.Validators.required)}},t.prototype.checkOtherWeapon=function(t){var e=this.victimForm.get("otherWeapon");t.includes("OTHER")?(this.otherWeaponFlag=!0,e.setValidators(s.Validators.required)):(this.otherWeaponFlag=!1,e.clearValidators()),e.updateValueAndValidity()},t.prototype.checkOtherDrug=function(t){var e=this.victimForm.get("otherDrug");t.includes("OTHER")?(this.otherDrugFlag=!0,e.setValidators(s.Validators.required)):(this.otherDrugFlag=!1,e.clearValidators()),e.updateValueAndValidity()},t.prototype.saveVictim=function(){var t=this;if(this.victimForm.value.guardianNoPhoneFlag||(this.victimForm.value.guardianHomePhone&&null!==this.victimForm.value.guardianHomePhone&&""!==this.victimForm.value.guardianHomePhone&&(this.guardianPhoneExistFlag=!0),void 0!==this.victimForm.value.guardianWorkPhone&&null!==this.victimForm.value.guardianWorkPhone&&""!==this.victimForm.value.guardianWorkPhone&&(this.guardianPhoneExistFlag=!0),this.victimForm.value.guardianCellPhone&&null!==this.victimForm.value.guardianCellPhone&&""!==this.victimForm.value.guardianCellhone&&(this.guardianPhoneExistFlag=!0)),console.log("this.victimForm.value.guardianNoPhoneFlag"),console.log(this.victimForm.value.guardianNoPhoneFlag),console.log("this.guardianPhoneExistFlag"),console.log(this.guardianPhoneExistFlag),!1===this.guardianPhoneExistFlag&&!1===this.victimForm.value.guardianNoPhoneFlag&&(this.phoneValidationFlag=!0,this.commonDialogService.warning("","Please check the guardian phone field. You have to fill one of the three phone fileds.","Ok").subscribe((function(e){t.result=e}))),console.log("this.phoneValidationFlag"),console.log(this.phoneValidationFlag),this.victimForm.value.advocateNoPhoneFlag||(this.victimForm.value.advocateHomePhone&&null!==this.victimForm.value.advocateHomePhone&&""!==this.victimForm.value.advocateHomePhone&&(this.advocatePhoneExistFlag=!0),void 0!==this.victimForm.value.advocateWorkPhone&&null!==this.victimForm.value.advocateWorkPhone&&""!==this.victimForm.value.advocateWorkPhone&&(this.advocatePhoneExistFlag=!0),this.victimForm.value.advocateCellPhone&&null!==this.victimForm.value.advocateCellPhone&&""!==this.victimForm.value.advocateCellhone&&(this.advocatePhoneExistFlag=!0)),console.log("this.victimForm.value.advocateNoPhoneFlag"),console.log(this.victimForm.value.advocateNoPhoneFlag),console.log("this.advocatePhoneExistFlag"),console.log(this.advocatePhoneExistFlag),!1===this.advocatePhoneExistFlag&&!1===this.victimForm.value.advocateNoPhoneFlag&&(this.phoneValidationFlag=!0,this.commonDialogService.warning("","Please check the advocate phone field. You have to fill one of the three phone fileds.","Ok").subscribe((function(e){t.result=e}))),console.log("this.phoneValidationFlag 1"),console.log(this.phoneValidationFlag),!1===this.phoneValidationFlag)if(null===this.victimDetail){var e=[];this.victimForm.value.victimSupports&&this.victimForm.value.victimSupports.forEach((function(r){var i={};i.victimId=t.victimForm.value.victimId,i.victimSupportTypeId=r,i.modifiedBy=t.staffId,e.push(i)}));var r=[];console.log("this.victimForm.value.victimDrugUses during save"),console.log(this.victimForm.value.victimDrugUses),this.victimForm.value.victimDrugUses&&this.victimForm.value.victimDrugUses.forEach((function(e){var i={};i.drugTypeId=e,"OTHER"===e||""===e||null===e?(i.drugTypeId=null,i.otherDrug=t.victimForm.value.otherDrug):(i.drugTypeId=e,i.otherDrug=null),i.modifiedBy=t.staffId,i.victimId=t.victimForm.value.victimId,r.push(i)})),console.log("this.victimForm.value.victimDrugUses during save 1"),console.log(this.victimForm.value.victimDrugUses);var i=[];this.victimForm.value.victimWeaponUses&&this.victimForm.value.victimWeaponUses.forEach((function(e){var r={};r.victimId=t.victimForm.value.victimId,r.weaponTypeId=e,r.otherWeapon="OTHER"==e?t.victimForm.value.otherWeapon:null,r.modifiedBy=t.staffId,i.push(r)}));var a={victimId:0,offenderId:this.offenderId,victimOffenderRelationshipTypeId:this.victimForm.value.victimOffenderRelationshipTypeId,lastName:this.victimForm.value.lastName,firstName:this.victimForm.value.firstName,middleName:this.victimForm.value.middleName?this.victimForm.value.middleName:null,prefixId:this.victimForm.value.prefixId?this.victimForm.value.prefixId:null,suffixId:this.victimForm.value.suffixId?this.victimForm.value.suffixId:null,birthDate:this.victimForm.value.birthDate?this.victimForm.value.birthDate:null,genderCode:this.victimForm.value.genderCode?this.victimForm.value.genderCode:null,underSupervisionFlag:this.victimForm.value.underSupervisionFlag,minorFlag:this.victimForm.value.minorFlag,victimAdvocateFlag:this.victimForm.value.victimAdvocateFlag,homePhone:this.victimForm.value.homePhone?this.victimForm.value.homePhone:null,workPhone:this.victimForm.value.workPhone?this.victimForm.value.workPhone:null,cellPhone:this.victimForm.value.cellPhone?this.victimForm.value.cellPhone:null,email:this.victimForm.value.email?this.victimForm.value.email:null,addressId:this.victimForm.value.addressId?this.victimForm.value.addressId:1,emergencyContact:this.victimForm.value.emergencyContact?this.victimForm.value.emergencyContact:null,emergencyContactPhone:this.victimForm.value.emergencyContactPhone?this.victimForm.value.emergencyContactPhone:null,commonChildrenFlag:this.victimForm.value.commonChildrenFlag,commonChildrenNumber:this.victimForm.value.commonChildrenNumber,cpoExpirationFlag:this.victimForm.value.cpoExpirationFlag,cpoExpirationDate:this.victimForm.value.cpoExpirationDate?this.datePipe.transform(this.victimForm.value.startDate,"short"):null,supportInPlaceFlag:this.victimForm.value.supportInPlaceFlag,weaponInvolvedFlag:this.victimForm.value.weaponInvolvedFlag,drugUseFlag:this.victimForm.value.drugUseFlag,alcoholUseFlag:this.victimForm.value.alcoholUseFlag,accessRisk:this.victimForm.value.accessRisk,modifiedBy:this.staffId,vVictimAdvocate:null,vVictimGuardian:null,victimDrugUses:r,victimSupports:e,victimWeaponUses:i,advocateFirstName:null,advocateLastName:null,advocateEmail:null,advocatePrefixId:null,advocateSuffixId:null,advocateNoPhoneFlag:null,advocateHomePhone:null,advocateWorkPhone:null,advocateCellPhone:null,advocateAddressId:null,guardianFirstName:null,guardianLastName:null,guardianEmail:null,guardianPrefixId:null,guardianSuffixId:null,guardianNoPhoneFlag:null,guardianHomePhone:null,guardianWorkPhone:null,guardianCellPhone:null,guardianAddressId:null,guardianBirthDate:null,relationship:null,allowCsosaContactFlag:null};0==this.addressId?a.addressId=null:a.addressId=this.addressId,a.advocateAddressId=this.advocateAddressId,a.guardianAddressId=this.guardianAddressId,console.log("newVictim"),console.log(a),this.victimService.postVictims(a).subscribe((function(e){var r=e?e.victimId:"";if("YS"==t.victimForm.value.victimAdvocateFlag){console.log("add advocate");var i={victimAdvocateId:r,lastName:t.victimForm.value.advocateLastName,firstName:t.victimForm.value.advocateFirstName,prefixId:t.victimForm.value.advocatePrefixId,suffixId:t.victimForm.value.advocateSuffixId,addressId:t.advocateAddressId?t.advocateAddressId:null,noPhoneFlag:t.victimForm.value.advocateNoPhoneFlag?t.victimForm.value.advocateNoPhoneFlag:null,homePhone:t.victimForm.value.advocateHomePhone,workPhone:t.victimForm.value.advocateWorkPhone,cellPhone:t.victimForm.value.advocateCellPhone,email:t.victimForm.value.advocateEmail,modifiedBy:t.staffId};t.victimService.postVictimAdvocate(r,i).subscribe()}if(1==t.victimForm.value.minorFlag){var a={victimGuardianId:r,lastName:t.victimForm.value.guardianLastName,firstName:t.victimForm.value.guardianFirstName,prefixId:t.victimForm.value.guardianPrefixId,suffixId:t.victimForm.value.guardianSuffixId,birthDate:t.victimForm.value.guardianBirthDate,addressId:t.guardianAddressId?t.guardianAddressId:null,noPhoneFlag:t.victimForm.value.guardianNoPhoneFlag?t.victimForm.value.guardianNoPhoneFlag:null,homePhone:t.victimForm.value.guardianHomePhone,workPhone:t.victimForm.value.guardianWorkPhone,cellPhone:t.victimForm.value.guardianCellPhone,email:t.victimForm.value.guardianEmail,modifiedBy:t.staffId};t.victimService.postVictimGuardian(r,a).subscribe()}t.snackBar.open("Add Victim Successfully!","",{duration:3e3}),!0===t.isIntake?t.router.navigate(["victimHome"]):t.router.navigate(["victimList"])}))}else console.log(" this.victimForm.value.victimOffenderRelationshipTypeId"),console.log(this.victimForm.value.victimOffenderRelationshipTypeId),this.victimDetail.underSupervisionFlag=this.victimForm.value.underSupervisionFlag,this.victimDetail.victimOffenderRelationshipTypeId=this.victimForm.value.victimOffenderRelationshipTypeId,this.victimDetail.lastName=this.victimForm.value.lastName,this.victimDetail.firstName=this.victimForm.value.firstName,this.victimDetail.middleName=this.victimForm.value.middleName,this.victimDetail.prefixId=this.victimForm.value.prefixId?this.victimForm.value.prefixId:null,this.victimDetail.suffixId=this.victimForm.value.suffixId?this.victimForm.value.suffixId:null,this.victimDetail.birthDate=this.victimForm.value.birthDate,this.victimDetail.genderCode=this.victimForm.value.genderCode,this.victimDetail.minorFlag=this.victimForm.value.minorFlag,this.victimDetail.homePhone=this.victimForm.value.homePhone?this.victimForm.value.homePhone:null,this.victimDetail.workPhone=this.victimForm.value.workPhone?this.victimForm.value.workPhone:null,this.victimDetail.cellPhone=this.victimForm.value.cellPhone?this.victimForm.value.cellPhone:null,this.victimDetail.email=this.victimForm.value.email,this.victimDetail.victimAdvocateFlag=this.victimForm.value.victimAdvocateFlag,this.victimDetail.emergencyContact=this.victimForm.value.emergencyContact,this.victimDetail.emergencyContactPhone=this.victimForm.value.emergencyContactPhone?this.victimForm.value.emergencyContactPhone:null,this.victimDetail.commonChildrenFlag=this.victimForm.value.commonChildrenFlag,this.victimDetail.commonChildrenNumber=this.victimForm.value.commonChildrenNumber,this.victimDetail.cpoExpirationDate=this.victimForm.value.cpoExpirationDate,this.victimDetail.cpoExpirationFlag=this.victimForm.value.cpoExpirationFlag,this.victimDetail.supportInPlaceFlag=this.victimForm.value.supportInPlaceFlag,this.victimDetail.weaponInvolvedFlag=this.victimForm.value.weaponInvolvedFlag,this.victimDetail.drugUseFlag=this.victimForm.value.drugUseFlag,this.victimDetail.alcoholUseFlag=this.victimForm.value.alcoholUseFlag,this.victimDetail.accessRisk=this.victimForm.value.accessRisk,this.victimDetail.addressId=this.victimForm.value.addressId,this.victimDetail.allowCsosaContactFlag=this.victimForm.value.allowCsosaContactFlag,this.victimDetail.victimSupports=[],this.victimForm.value.victimSupports.forEach((function(e){var r={};r.victimId=t.victimDetail.victimId,r.victimSupportTypeId=e,r.modifiedBy=t.staffId,t.victimDetail.victimSupports.push(r)})),this.victimDetail.victimDrugUses=[],console.log("this.victimForm.value.victimDrugUses calculate"),console.log(this.victimForm.value.victimDrugUses),this.victimForm.value.victimDrugUses.forEach((function(e){var r={};r.drugTypeId=e,console.log("this.victimForm.value.victimDrugUses before"),console.log(t.victimForm.value.victimDrugUses),"OTHER"===e||""===e?(r.drugTypeId=null,r.otherDrug=t.victimForm.value.otherDrug):(r.drugTypeId=e,r.otherDrug=null),r.modifiedBy=t.staffId,r.victimId=t.victimDetail.victimId,t.victimDetail.victimDrugUses.push(r),console.log("this.victimForm.value.victimDrugUses after"),console.log(t.victimForm.value.victimDrugUses)})),this.victimForm.value.victimDrugUses.filter((function(t){return!(null===t.drugTypeId&&null===t.otherDrug)})),console.log("adjust this.victimForm.value.victimDrugUses "),console.log(this.victimForm.value.victimDrugUses),this.victimDetail.victimWeaponUses=[],this.victimForm.value.victimWeaponUses.forEach((function(e){var r={};r.victimId=t.victimDetail.victimId,r.weaponTypeId=e,console.log("weapon element"),console.log(e),console.log(t.victimForm.value.otherWeapon),console.log(t.victimForm.value.victimWeaponUses),r.otherWeapon="OTHER"==e?t.victimForm.value.otherWeapon:null,r.modifiedBy=t.staffId,t.victimDetail.victimWeaponUses.push(r)})),console.log("this.victimDetail before emit"),console.log(this.victimDetail),this.victimService.putVictims(this.victimDetail.victimId,this.victimDetail).subscribe((function(e){t.snackBar.open("Update Successfully!","",{duration:3e3}),t.victimAdvocate.victimAdvocateId=t.victimDetail.victimId,t.victimAdvocate.lastName=t.victimForm.value.advocateLastName,t.victimAdvocate.firstName=t.victimForm.value.advocateFirstName,t.victimAdvocate.prefixId=t.victimForm.value.advocatePrefixId?t.victimForm.value.advocatePrefixId:null,t.victimAdvocate.suffixId=t.victimForm.value.advocateSuffixId?t.victimForm.value.advocateSuffixId:null,t.victimAdvocate.addressId=t.advocateAddressId?t.advocateAddressId:null,t.victimAdvocate.noPhoneFlag=!!t.victimForm.value.advocateNoPhoneFlag,t.victimAdvocate.homePhone=t.victimForm.value.advocateHomePhone?t.victimForm.value.advocateHomePhone:null,t.victimAdvocate.workPhone=t.victimForm.value.advocateWorkPhone?t.victimForm.value.advocateWorkPhone:null,t.victimAdvocate.cellPhone=t.victimForm.value.advocateCellPhone?t.victimForm.value.advocateCellPhone:null,t.victimAdvocate.email=t.victimForm.value.advocateEmail?t.victimForm.value.advocateEmail:null,t.victimAdvocate.modifiedBy=t.staffId,"YS"==t.victimDetail.victimAdvocateFlag&&null!=t.victimDetail.advocateFirstName?t.victimService.putVictimAdvocate(t.victimDetail.victimId,t.victimAdvocate).subscribe((function(t){})):(console.log("add advocate"),t.victimService.postVictimAdvocate(t.victimDetail.victimId,t.victimAdvocate).subscribe()),t.victimGuardian.victimGuardianId=t.victimDetail.victimId,t.victimGuardian.lastName=t.victimForm.value.guardianLastName,t.victimGuardian.firstName=t.victimForm.value.guardianFirstName,t.victimGuardian.prefixId=t.victimForm.value.guardianPrefixId?t.victimForm.value.guardianPrefixId:null,t.victimGuardian.suffixId=t.victimForm.value.guardianSuffixId?t.victimForm.value.guardianSuffixId:null,t.victimGuardian.addressId=t.guardianAddressId?t.guardianAddressId:null,t.victimGuardian.noPhoneFlag=!!t.victimForm.value.guardianNoPhoneFlag,t.victimGuardian.homePhone=t.victimForm.value.guardianHomePhone?t.victimForm.value.guardianHomePhone:null,t.victimGuardian.workPhone=t.victimForm.value.guardianWorkPhone?t.victimForm.value.guardianWorkPhone:null,t.victimGuardian.cellPhone=t.victimForm.value.guardianCellPhone?t.victimForm.value.guardianCellPhone:null,t.victimGuardian.email=t.victimForm.value.guardianEmail?t.victimForm.value.guardianEmail:null,t.victimGuardian.modifiedBy=t.staffId,1==t.victimDetail.minorFlag&&null!=t.victimDetail.guardianFirstName?t.victimService.putVictimGuardian(t.victimDetail.victimId,t.victimGuardian).subscribe((function(t){})):t.victimService.postVictimGuardian(t.victimDetail.victimId,t.victimGuardian).subscribe()}));this.onSave.emit(this.victimDetail)},t.prototype.addContact=function(){this.router.navigate(["victimContact",this.victimId])},t.prototype.formatLabel=function(t){return t},t.decorators=[{type:r.Component,args:[{selector:"csmart-victim-detail",template:'<mat-card>\r\n <mat-card-content>\r\n\r\n <div [formGroup]="victimForm">\r\n\r\n <mat-tab-group dynamicHeight mat-stretch-tabs>\r\n <mat-tab label="Victim Detail" >\r\n <div class=\'container\'>\r\n\r\n <mat-form-field>\r\n <mat-label>Is victim a minor?<font color="red">* </font></mat-label>\r\n <br>\r\n <mat-radio-group formControlName="minorFlag" (change)="radioMinorChange($event)" [(ngModel)]="editVictim.minorFlag" >\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n <div class="help-block" *ngIf="victimForm.get(\'minorFlag\').errors \r\n && (victimForm.get(\'minorFlag\').dirty || victimForm.get(\'minorFlag\').touched)">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Does the Victim have a Victim Advocate or Social Worker with <br>whom CSOSA should maintain contact?<font color="red">* </font></mat-label>\r\n <br>\r\n <br>\r\n <mat-radio-group class = "tp-radio-group" formControlName="victimAdvocateFlag" (change)="radioAdvocateChange($event)" [(ngModel)]="editVictim.victimAdvocateFlag">\r\n <mat-radio-button color="primary" *ngFor="let item of flagOption" [value]="item.flagOptionYesNoUnknownId">{{item.name}} </mat-radio-button>&nbsp;\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n <div class="help-block" *ngIf="victimForm.get(\'victimAdvocateFlag\').errors \r\n && (victimForm.get(\'victimAdvocateFlag\').dirty || victimForm.get(\'victimAdvocateFlag\').touched)">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n \r\n \r\n <mat-form-field>\r\n <mat-label>Victim Currently Under Supervision:</mat-label>\r\n <mat-select formControlName="underSupervisionFlag" name="supervision" [(ngModel)]="editVictim.underSupervisionFlag" >\r\n <mat-option *ngFor="let item of flagOption" [value]="item.flagOptionYesNoUnknownId" >\r\n {{item.name}}</mat-option>\r\n </mat-select>\r\n <div class="help-block" *ngIf="victimForm.get(\'underSupervisionFlag\').errors \r\n && (victimForm.get(\'underSupervisionFlag\').dirty || victimForm.get(\'underSupervisionFlag\').touched)">\r\n <mat-error>under supervision field is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n \r\n \r\n <mat-form-field>\r\n <mat-label>Relationship to Offender:</mat-label>\r\n <mat-select formControlName="victimOffenderRelationshipTypeId" [(ngModel)]="editVictim.victimOffenderRelationshipTypeId" >\r\n <mat-option *ngFor="let item of relationshipTypes" [value]="item.relationshipTypeId">{{item.name}}</mat-option>\r\n </mat-select>\r\n <div class="help-block" *ngIf="victimForm.get(\'victimOffenderRelationshipTypeId\').errors \r\n && (victimForm.get(\'victimOffenderRelationshipTypeId\').dirty || victimForm.get(\'victimOffenderRelationshipTypeId\').touched)">\r\n <mat-error>relationship is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n \r\n \r\n <mat-form-field>\r\n <mat-label>Victim Last Name:</mat-label>\r\n <input matInput formControlName="lastName" [(ngModel)]="editVictim.lastName" >\r\n <div class="help-block" *ngIf="victimForm.get(\'lastName\').errors \r\n && (victimForm.get(\'lastName\').dirty || victimForm.get(\'lastName\').touched)">\r\n <mat-error>victim last name is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim First Name: </mat-label>\r\n <input matInput formControlName="firstName" [(ngModel)]="editVictim.firstName" >\r\n <div class="help-block" *ngIf="victimForm.get(\'firstName\').errors \r\n && (victimForm.get(\'firstName\').dirty || victimForm.get(\'firstName\').touched)">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Middle Name:</mat-label>\r\n <input matInput formControlName="middleName" [(ngModel)]="editVictim.middleName">\r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Victim Prefix:</mat-label>\r\n <mat-select formControlName="prefixId" [(ngModel)]="editVictim.prefixId">\r\n <mat-option *ngFor="let item of prefixes" [value]="item.prefixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Suffix:</mat-label>\r\n <mat-select formControlName="suffixId" [(ngModel)]="editVictim.suffixId">\r\n <mat-option *ngFor="let item of suffixes" [value]="item.suffixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Victim Gender:</mat-label>\r\n <mat-select formControlName="genderCode" [(ngModel)]="editVictim.genderCode">\r\n <mat-option *ngFor="let item of genders" [value]="item.genderCode">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput \r\n [matDatepicker]="victimBirthRef" \r\n formControlName="birthDate"\r\n [(ngModel)]="editVictim.birthDate"\r\n (click)="victimBirthRef.open()"\r\n (dateChange)="handleDOBChange($event)" \r\n >\r\n <mat-datepicker-toggle [for]="victimBirthRef" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #victimBirthRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Home Phone:</mat-label>\r\n <input \r\n matInput \r\n formControlName="homePhone" \r\n [(ngModel)]="editVictim.homePhone" \r\n phoneMask\r\n maxlength="14"/>\r\n\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'homePhone\').errors\r\n && (victimForm.get(\'homePhone\').dirty || victimForm.get(\'homePhone\').touched)">\r\n\r\n\r\n <mat-error><strong>Home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Cell Phone:</mat-label>\r\n <input matInput formControlName="cellPhone" [(ngModel)]="editVictim.cellPhone" >\r\n <div class="help-block" *ngIf="victimForm.get(\'cellPhone\').errors \r\n && (victimForm.get(\'cellPhone\').dirty || victimForm.get(\'cellPhone\').touched)">\r\n <mat-error><strong>Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n \r\n <mat-form-field >\r\n <mat-label>Victim Work Phone:</mat-label>\r\n <input matInput formControlName="workPhone" [(ngModel)]="editVictim.workPhone" >\r\n <div class="help-block" *ngIf="victimForm.get(\'workPhone\').errors \r\n && (victimForm.get(\'workPhone\').dirty || victimForm.get(\'workPhone\').touched)">\r\n <mat-error><strong>Work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Email:</mat-label>\r\n <input matInput formControlName="email" [(ngModel)]="editVictim.email" >\r\n <div class="help-block" *ngIf="victimForm.get(\'email\').errors \r\n && (victimForm.get(\'email\').dirty || victimForm.get(\'email\').touched)">\r\n <mat-error><strong>victim email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n \r\n <div></div>\r\n \r\n <app-smart-address \r\n [showPsa]="true" \r\n [modifiedBy]="staffId" \r\n [id]="addressId"\r\n (addressIdChange)="onAddressChange($event)"\r\n [outline]="true" \r\n readonly="false"\r\n [rowHeight]="80" \r\n (isValid)="false" \r\n [addressValidators]="addressValidators"\r\n #addressComponent\r\n >\r\n </app-smart-address>\r\n \r\n \r\n \x3c!-- Docket: \r\n <div>\r\n <div *ngFor="let docket of docketlist; let i=index">\r\n <mat-checkbox >{{docket.docketNumber}}</mat-checkbox>\r\n </div>\r\n </div> --\x3e\r\n\r\n <mat-checkbox color="primary" formControlName="allowCsosaContactFlag" name="allowCsosaContactFlag" [(ngModel)]="editVictim.allowCsosaContactFlag">victim wants to be contacted by CSOSA</mat-checkbox>\r\n \r\n </div> \r\n\r\n <mat-card>\r\n <mat-form-field>\r\n <mat-label> Children in Common</mat-label>\r\n <br>\r\n <mat-radio-group formControlName="commonChildrenFlag" [(ngModel)]="editVictim.commonChildrenFlag" (change)="radioCicChange($event)">\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n\r\n <div *ngIf="commonChildrenDivFlag">\r\n \r\n <mat-form-field >\r\n <mat-label>\r\n Children number\r\n </mat-label>\r\n <input matInput formControlName="commonChildrenNumber" [(ngModel)]="editVictim.commonChildrenNumber" >\r\n </mat-form-field>\r\n \r\n </div>\r\n \r\n <mat-form-field>\r\n <mat-label>CPO: </mat-label>\r\n <br>\r\n <mat-radio-group formControlName="cpoExpirationFlag" [(ngModel)]="editVictim.cpoExpirationFlag" (change)="radioCpoChange($event)">\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n <div *ngIf="cpoExpirationDivFlag"> \r\n <mat-form-field>\r\n <mat-label>Expiration Date: </mat-label>\r\n <input matInput \r\n [matDatepicker]="cpoDateRef" \r\n formControlName="cpoExpirationDate" \r\n (click)="cpoDateRef.open()" \r\n [(ngModel)]="editVictim.cpoExpirationDate" >\r\n <mat-datepicker-toggle [for]="cpoDateRef" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #cpoDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n </div>\r\n \r\n <br>\r\n <br>\r\n \r\n <mat-form-field>\r\n <mat-label>Victim has a Support System in Place? </mat-label>\r\n <br>\r\n <mat-radio-group formControlName="supportInPlaceFlag" [(ngModel)]="editVictim.supportInPlaceFlag" (change)="radioSupportChange($event)">\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n <div *ngIf="supportInPlaceDivFlag"> \r\n <mat-form-field>\r\n <mat-label>Support type? </mat-label>\r\n <mat-select #supportSel formControlName="victimSupports" [(ngModel)]="editVictim.victimSupports" multiple>\r\n <div (mouseleave)="supportSel.close()">\r\n <mat-option color="primary" *ngFor="let item of victimSupportTypes" [value]="item.victimSupportTypeId">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n\r\n </div>\r\n \r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Weapons Involved?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName="weaponInvolvedFlag" (change)="radioWeaponChange($event)" [(ngModel)]="editVictim.weaponInvolvedFlag" >\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n \r\n <div *ngIf="weaponInvolvedDivFlag"> \r\n <mat-form-field>\r\n <mat-label>Weapon Type</mat-label>\r\n <mat-select #weaponSel formControlName="victimWeaponUses" multiple [(ngModel)]="editVictim.victimWeaponUses" (selectionChange)="checkOtherWeapon($event.value)" >\r\n <div (mouseleave)="weaponSel.close()">\r\n <mat-option color="primary" *ngFor="let item of weaponTypes" [value]="item.weaponTypeId">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div *ngIf="otherWeaponFlag"> \r\n <mat-form-field>\r\n <mat-label>Other Weapon:* </mat-label>\r\n <input matInput formControlName="otherWeapon" >\r\n </mat-form-field>\r\n <div class="help-block" *ngIf="victimForm.get(\'otherWeapon\').errors \r\n && (victimForm.get(\'otherWeapon\').dirty || victimForm.get(\'otherWeapon\').touched)">\r\n <mat-error><strong>Other weapon is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n\r\n \r\n <br>\r\n <br>\r\n \r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of alcohol at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName="alcoholUseFlag" [(ngModel)]="editVictim.alcoholUseFlag" >\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of drugs at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName="drugUseFlag" (change)="radioDrugChange($event)" [(ngModel)]="editVictim.drugUseFlag" >\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n <div *ngIf="drugUseDivFlag"> \r\n <mat-form-field>\r\n <mat-label>Drug:</mat-label>\r\n <mat-select #drugSel formControlName="victimDrugUses" multiple (selectionChange)="checkOtherDrug($event.value)" >\r\n <div (mouseleave)="drugSel.close()">\r\n <mat-option color="primary" *ngFor="let item of drugs" [value]="item.drugTypeId">\r\n {{item.name}}\r\n </mat-option>\r\n \r\n </div>\r\n </mat-select>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n </div>\r\n\r\n <div *ngIf="otherDrugFlag"> \r\n <mat-form-field>\r\n <mat-label>Other Drug:* </mat-label>\r\n <input matInput formControlName="otherDrug" >\r\n </mat-form-field>\r\n <div class="help-block" *ngIf="victimForm.get(\'otherDrug\').errors \r\n && (victimForm.get(\'otherDrug\').dirty || victimForm.get(\'otherDrug\').touched)">\r\n <mat-error><strong>Other drug is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div>\r\n <div>\r\n <mat-label>\r\n Access Risk: 1 thru 10 (10 greatest risk): &nbsp;<b> {{editVictim.accessRisk}}</b>\r\n </mat-label>\r\n </div>\r\n <div>\r\n \r\n <mat-slider\r\n formControlName="accessRisk"\r\n thumbLabel="true"\r\n [displayWith]="formatLabel"\r\n min="1"\r\n max="10"\r\n [(ngModel)]="editVictim.accessRisk" \r\n ></mat-slider>\r\n \r\n </div>\r\n\r\n </div>\r\n\r\n </mat-card> \r\n\r\n \r\n <br><br><br> \r\n </mat-tab>\r\n \r\n <mat-tab *ngIf="guardianTabFlag" label="Legal Guardian">\r\n <div class=\'container\'>\r\n <mat-form-field>\r\n <mat-label>Guardian Last Name:</mat-label>\r\n <input matInput formControlName="guardianLastName" [(ngModel)]="editVictim.guardianLastName" > \r\n <div class="help-block" *ngIf="victimForm.get(\'guardianLastName\').errors ">\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian First Name:</mat-label>\r\n <input matInput formControlName="guardianFirstName" [(ngModel)]="editVictim.guardianFirstName" >\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianFirstName\').errors ">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div> \r\n \r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Guardian Prefix:</mat-label>\r\n <mat-select formControlName="guardianPrefixId" [(ngModel)]="editVictim.guardianPrefixId" >\r\n <mat-option *ngFor="let item of prefixes" [value]="item.prefixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Suffix:</mat-label>\r\n <mat-select formControlName="guardianSuffixId" [(ngModel)]="editVictim.guardianSuffixId" >\r\n <mat-option *ngFor="let item of suffixes" [value]="item.suffixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n \r\n \x3c!-- <mat-form-field>\r\n <mat-select placeholder="Choose" formControlName="guardianGender" [(ngModel)]="editVictim.guardianGender">\r\n <mat-option *ngFor="let item of genders" [value]="item.genderCode">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field> --\x3e\r\n \r\n \r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput \r\n [matDatepicker]="guardianDateRef" \r\n formControlName="guardianBirthDate"\r\n [(ngModel)]="editVictim.guardianBirthDate" \r\n (click)="guardianDateRef.open()" \r\n >\r\n <mat-datepicker-toggle [for]="guardianDateRef" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #guardianDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <mat-form-field >\r\n <mat-checkbox \r\n color = "primary" \r\n formControlName="guardianNoPhoneFlag" \r\n \r\n >\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder="" style="display: none;">\r\n </mat-form-field>\r\n\r\n\r\n <div></div>\r\n <mat-card>\r\n <mat-form-field >\r\n <mat-label>Guardian Home Phone:</mat-label>\r\n <input matInput \r\n formControlName="guardianHomePhone" \r\n [(ngModel)]="editVictim.guardianHomePhone" \r\n phoneMask\r\n maxlength="14" >\r\n \r\n <div class="help-block" *ngIf="victimForm.get(\'guardianHomePhone\').errors \r\n && (victimForm.get(\'guardianHomePhone\').dirty || victimForm.get(\'guardianHomePhone\').touched)">\r\n <mat-error><strong>Guardian home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n \r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Cell Phone:</mat-label>\r\n <input matInput \r\n formControlName="guardianCellPhone" \r\n [(ngModel)]="editVictim.guardianCellPhone" \r\n phoneMask\r\n maxlength="14" \r\n >\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianCellPhone\').errors \r\n && (victimForm.get(\'guardianCellPhone\').dirty || victimForm.get(\'guardianCellPhone\').touched)">\r\n <mat-error><strong>Guardian Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n \r\n\r\n \r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Work Phone:</mat-label>\r\n <input matInput \r\n formControlName="guardianWorkPhone" \r\n [(ngModel)]="editVictim.guardianWorkPhone" \r\n phoneMask\r\n maxlength="14" >\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianWorkPhone\').errors \r\n && (victimForm.get(\'guardianWorkPhone\').dirty || victimForm.get(\'guardianWorkPhone\').touched)">\r\n <mat-error><strong>Guardian work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n \r\n \r\n </mat-form-field>\r\n </mat-card>\r\n \r\n <div></div>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Email:</mat-label>\r\n <input matInput formControlName="guardianEmail" [(ngModel)]="editVictim.guardianEmail" >\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianEmail\').errors \r\n && (victimForm.get(\'guardianEmail\').dirty || victimForm.get(\'guardianEmail\').touched)">\r\n <mat-error><strong>Guardian email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n \r\n <div>\r\n <app-smart-address \r\n\r\n [showPsa]="true" \r\n [modifiedBy]="staffId" \r\n [id]="guardianAddressId"\r\n (addressIdChange)="onGuardianAddressChange($event)"\r\n [outline]="true" \r\n readonly="false"\r\n [rowHeight]="80" \r\n (isValid)="false" \r\n [addressValidators]="addressValidators"\r\n #guardianAddressComponent\r\n >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n \r\n <br><br><br> \r\n </mat-tab>\r\n \r\n \x3c!--advocate--\x3e\r\n \r\n <mat-tab *ngIf="advocateTabFlag" label="Advocate" > \r\n <div class=\'container\'>\r\n \r\n <mat-form-field>\r\n <mat-label>Advocate Last Name:</mat-label>\r\n <input matInput formControlName="advocateLastName" [(ngModel)]="editVictim.advocateLastName" >\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateLastName\').errors ">\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Advocate First Name:</mat-label>\r\n <input matInput formControlName="advocateFirstName" [(ngModel)]="editVictim.advocateFirstName" >\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateFirstName\').errors ">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Prefix:</mat-label>\r\n <mat-select formControlName="advocatePrefixId" [(ngModel)]="editVictim.advocatePrefixId" >\r\n <mat-option *ngFor="let item of prefixes" [value]="item.prefixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Suffix:</mat-label>\r\n <mat-select formControlName="advocateSuffixId" [(ngModel)]="editVictim.advocateSuffixId" >\r\n <mat-option *ngFor="let item of suffixes" [value]="item.suffixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n \r\n <mat-form-field>\r\n <mat-checkbox \r\n color = "primary" \r\n formControlName="advocateNoPhoneFlag" \r\n \r\n [(ngModel)]="editVictim.advocateNoPhoneFlag" >\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder="" style="display: none;">\r\n </mat-form-field>\r\n\r\n <div></div> \r\n <mat-card> \r\n <mat-form-field >\r\n <mat-label>Advocate Home Phone:</mat-label>\r\n <input matInput \r\n formControlName="advocateHomePhone" \r\n [(ngModel)]="editVictim.advocateHomePhone"\r\n phoneMask\r\n maxlength="14" >\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateHomePhone\').errors \r\n && (victimForm.get(\'advocateHomePhone\').dirty || victimForm.get(\'advocateHomePhone\').touched)">\r\n <mat-error><strong>Advocate home number format is not correct.</strong></mat-error>\r\n </div>\r\n \r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Advocate Cell Phone:</mat-label>\r\n <input matInput \r\n formControlName="advocateCellPhone" \r\n [(ngModel)]="editVictim.advocateCellPhone" \r\n phoneMask\r\n maxlength="14">\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateCellPhone\').errors \r\n && (victimForm.get(\'advocateCellPhone\').dirty || victimForm.get(\'advocateCellPhone\').touched)">\r\n <mat-error><strong>Advocate cell number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n \r\n </mat-form-field> \r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Work Phone:</mat-label>\r\n <input matInput \r\n formControlName="advocateWorkPhone" \r\n [(ngModel)]="editVictim.advocateWorkPhone" \r\n phoneMask\r\n maxlength="14"\r\n >\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateWorkPhone\').errors \r\n && (victimForm.get(\'advocateWorkPhone\').dirty || victimForm.get(\'advocateWorkPhone\').touched)">\r\n <mat-error><strong>Advocate work number format is not correct.</strong></mat-error>\r\n </div>\r\n \r\n </mat-form-field>\r\n </mat-card>\r\n\r\n <div></div>\r\n \r\n <mat-form-field>\r\n <mat-label>Advocate Email:</mat-label>\r\n <input matInput formControlName="advocateEmail" [(ngModel)]="editVictim.advocateEmail" >\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateEmail\').errors \r\n && (victimForm.get(\'advocateEmail\').dirty || victimForm.get(\'advocateEmail\').touched)">\r\n <mat-error><strong>Advocate email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n\r\n \r\n <div >\r\n <app-smart-address \r\n [showPsa]="true" \r\n [modifiedBy]="staffId" \r\n [id]="advocateAddressId"\r\n (addressIdChange)="onAdvocateAddressChange($event)"\r\n [outline]="true" \r\n readonly="false"\r\n [rowHeight]="80" \r\n (isValid)="false" \r\n [addressValidators]="addressValidators"\r\n #advocateAddressComponent >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n <br><br><br> \r\n </mat-tab>\r\n \r\n \r\n <mat-tab label="Emergency Contact">\r\n <div class=\'container\'>\r\n \r\n <mat-form-field>\r\n <mat-label>Emergency Contact Name:</mat-label>\r\n <input matInput formControlName="emergencyContact" [(ngModel)]="editVictim.emergencyContact" >\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Emergency Phone Number:</mat-label>\r\n <input matInput formControlName="emergencyContactPhone" [(ngModel)]="editVictim.emergencyContactPhone" >\r\n <div class="help-block" *ngIf="victimForm.get(\'emergencyContactPhone\').errors \r\n && (victimForm.get(\'emergencyContactPhone\').dirty || victimForm.get(\'emergencyContactPhone\').touched)">\r\n <mat-error><strong>Emergency contact number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n </div>\r\n <br><br><br> \r\n </mat-tab> \r\n \r\n </mat-tab-group>\r\n <div class=\'outer\'>\r\n <div>\r\n All buttons apply to all tabs. If save button is grey, please check each tab to make sure the required field is filled.<br><br>\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'minorFlag\').errors \r\n && (victimForm.get(\'minorFlag\').dirty || victimForm.get(\'minorFlag\').touched)">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div>\r\n \r\n <div class="help-block" *ngIf="victimForm.get(\'victimAdvocateFlag\').errors \r\n && (victimForm.get(\'victimAdvocateFlag\').dirty || victimForm.get(\'victimAdvocateFlag\').touched)">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div> \r\n \r\n <div class="help-block" *ngIf="victimForm.get(\'underSupervisionFlag\').errors \r\n && (victimForm.get(\'underSupervisionFlag\').dirty || victimForm.get(\'underSupervisionFlag\').touched)">\r\n <mat-error>Under supervision field is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'victimOffenderRelationshipTypeId\').errors \r\n && (victimForm.get(\'victimOffenderRelationshipTypeId\').dirty || victimForm.get(\'victimOffenderRelationshipTypeId\').touched)">\r\n <mat-error>Relationship is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'lastName\').errors \r\n && (victimForm.get(\'lastName\').dirty || victimForm.get(\'lastName\').touched)">\r\n <mat-error>Victim last name is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'firstName\').errors \r\n && (victimForm.get(\'firstName\').dirty || victimForm.get(\'firstName\').touched)">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianFirstName\').errors \r\n && (victimForm.get(\'guardianFirstName\').dirty || victimForm.get(\'guardianFirstName\').touched)">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianLastName\').errors\r\n && (victimForm.get(\'guardianLastName\').dirty || victimForm.get(\'guardianLastName\').touched)" >\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateLastName\').errors\r\n && (victimForm.get(\'advocateLastName\').dirty || victimForm.get(\'advocateLastName\').touched)" >\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div> \r\n \r\n <div class="help-block" *ngIf="victimForm.get(\'advocateFirstName\').errors\r\n && (victimForm.get(\'advocateFirstName\').dirty || victimForm.get(\'advocateFirstName\').touched)">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n \r\n <div class="help-block" *ngIf="victimForm.get(\'otherWeapon\').errors \r\n && (victimForm.get(\'otherWeapon\').dirty || victimForm.get(\'otherWeapon\').touched)">\r\n <mat-error>Other weapon field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'otherDrug\').errors \r\n && (victimForm.get(\'otherDrug\').dirty || victimForm.get(\'otherDrug\').touched)">\r\n <mat-error>Other drug field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n\r\n </div>\r\n \r\n <div class="inner">\r\n <button mat-raised-button color="primary" (click)="saveVictim()" [disabled]="!victimForm.valid" >Save </button> \r\n </div>\r\n &nbsp;&nbsp;\r\n <div *ngIf="showDelete" class="inner">\r\n <button mat-raised-button color="primary" (click)="deleteVictim()">Delete </button>\r\n </div>\r\n &nbsp;&nbsp; \r\n <div class="inner">\r\n <button mat-raised-button color="primary" (click)="cancel()">Clear </button>\r\n </div>\r\n &nbsp;&nbsp; \r\n <button mat-raised-button color="primary" (click)="back()">Back</button>\r\n\r\n </div>\r\n\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div align="right">\r\n <button mat-raised-button color="primary" (click)="addContact()" >Add victim contact</button>\r\n </div>\r\n \r\n <div>\r\n\r\n <mat-table #table [dataSource]="contactDataSource" class="example-table">\r\n <ng-container matColumnDef="contactDate">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.contactDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef="victimContactMethod">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact Method</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.victimContactMethod}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="nextContactDate">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Next Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.nextContactDate | date}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef="staff">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact By</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.staff}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="comment">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="contactId">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell"></mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell">\r\n \r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="[\'contactDate\', \'victimContactMethod\',\'nextContactDate\', \'staff\', \'comment\', \'contactId\']" class="example-header-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns:[\'contactDate\', \'victimContactMethod\',\'nextContactDate\', \'staff\', \'comment\', \'contactId\'];" class="example-row"></mat-row>\r\n </mat-table>\r\n\r\n\r\n </div>\r\n \r\n </mat-card-content>\r\n</mat-card>\r\n',providers:[q],styles:["mat-form-field{width:100%}.container{margin:16px;display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}@media only screen and (max-width:1120px){.container{display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr;grid-row-gap:15px}}@media only screen and (max-width:675px){.container{display:flex;flex-direction:column}}#outer{width:100%;text-align:center}.inner{display:inline-block}.tp-radio-group{display:flex;justify-content:space-between}"]}]}],t.ctorParameters=function(){return[{type:n.Location},{type:s.FormBuilder},{type:m.MatDialog},{type:l.ActivatedRoute},{type:l.Router},{type:m.MatSnackBar},{type:q},{type:U}]},t.propDecorators={victimDetail:[{type:r.Input}],staffId:[{type:r.Input}],offenderId:[{type:r.Input}],isIntake:[{type:r.Input}],onSave:[{type:r.Output}],onCancel:[{type:r.Output}]},t}();var j=function(){function t(t,e){this.dialogRef=t,this.data=e}return t.prototype.onNoClick=function(){this.dialogRef.close()},t.prototype.ngOnInit=function(){},t.decorators=[{type:r.Component,args:[{selector:"csmart-victim-delete-confirm",template:'\n <h1 mat-dialog-title>Delete Confirmation</h1>\n <div mat-dialog-content>\n <p>Are you sure you want to delete this item?</p>\n </div>\n <div mat-dialog-actions class="actions">\n <button mat-flat-button color="primary" (click)="onNoClick()">No</button>\n <button mat-flat-button color="warn" [mat-dialog-close]=\'"YES"\' cdkFocusInitial>Yes</button>\n </div>\n ',styles:["\n .actions{\n display: flex;\n justify-content: space-between; \n }\n "]}]}],t.ctorParameters=function(){return[{type:h.MatDialogRef},{type:void 0,decorators:[{type:r.Inject,args:[h.MAT_DIALOG_DATA]}]}]},t}();var z=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[m.MatButtonModule,m.MatCardModule,m.MatCheckboxModule,m.MatToolbarModule,m.MatSelectModule,m.MatDatepickerModule,m.MatNativeDateModule,m.MatDialogModule,m.MatTabsModule,m.MatListModule,m.MatInputModule,m.MatStepperModule,f.BrowserAnimationsModule,m.MatGridListModule,m.MatProgressSpinnerModule,m.MatTableModule,m.MatSidenavModule,m.MatRadioModule,g.MatIconModule,m.MatSliderModule,m.MatChipsModule,b.MatSnackBarModule,d.CdkTableModule,m.MatSortModule,m.MatPaginatorModule,m.MatExpansionModule,m.MatRippleModule],exports:[m.MatButtonModule,m.MatCardModule,m.MatCheckboxModule,m.MatToolbarModule,m.MatSelectModule,m.MatDatepickerModule,m.MatNativeDateModule,m.MatDialogModule,m.MatTabsModule,m.MatListModule,m.MatInputModule,m.MatStepperModule,f.BrowserAnimationsModule,m.MatGridListModule,m.MatProgressSpinnerModule,m.MatTableModule,m.MatSidenavModule,m.MatRadioModule,g.MatIconModule,m.MatSliderModule,m.MatChipsModule,b.MatSnackBarModule,d.CdkTableModule,m.MatSortModule,m.MatPaginatorModule,m.MatExpansionModule,m.MatRippleModule],entryComponents:[]}]}],t}(),Y=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[z],exports:[H],declarations:[H],providers:[H],entryComponents:[H]}]}],t}();function $(){return function(t){var e=t.value;return new Date(e)>new Date?{date:"future Date is Not Allowed"}:null}}var J=function(){function t(t,e,r,i,a,o,n){this.formBuilder=t,this._victimServicesComponent=e,this.commonDialogService=r,this.snackBar=i,this.route=a,this.router=o,this.smartAuthService=n,this.editCaseNote={},this.caseNoteDataSource=new m.MatTableDataSource,this.initForm()}return t.prototype.initForm=function(){this.caseNoteForm=this.formBuilder.group({caseNoteDate:new s.FormControl("",s.Validators.compose([s.Validators.required,$()])),contactType:new s.FormControl("",s.Validators.required),contactPurpose:new s.FormControl("",s.Validators.required),comment:new s.FormControl("",s.Validators.required)}),this.caseNoteForm.markAsPristine(),this.caseNoteForm.markAsUntouched()},t.prototype.ngAfterViewInit=function(){this.smartAuthService.setPermission("Victim",this.route.snapshot)},t.prototype.ngOnInit=function(){var t=this,e=this.route.snapshot.data;this.loginStaff=e.loginStaff,this.staffId=this.loginStaff.staffId,this.sub=this.route.params.subscribe((function(e){t.victimId=e.victimId})),this.addDisableFlag=!1,this.hiddenDetailFlag=!0,this.hiddenAddNewFlag=!1,this._victimServicesComponent.getVictim(this.victimId).subscribe((function(e){t.victimName=e.firstName+", "+e.lastName})),this._victimServicesComponent.getContactTypes().subscribe((function(e){t.contactTypes=e})),this._victimServicesComponent.getVictimContactPurposes().subscribe((function(e){t.contactPurposes=e})),this._victimServicesComponent.getCasetNotes(this.victimId).subscribe((function(e){console.log("caseNoteList"),console.log(e),t.caseNoteList=e,t.caseNoteDataSource.data=t.caseNoteList}))},t.prototype.onEditCaseNote=function(t){this.hiddenDetailFlag=!1,this.hiddenAddNewFlag=!0,this.addDisableFlag=!0,this.editCaseNote=this.caseNoteList.find((function(e){return e.victimCaseNoteId===t}))},t.prototype.onDeleteCaseNote=function(t){var e=this;this.commonDialogService.confirm("","Do you want to delete this case note?","Yes","No").subscribe((function(r){e.result=r,e.result&&e._victimServicesComponent.deleteCaseNote(t,e.staffId).subscribe((function(t){e.snackBar.open("delete Successfully !","",{duration:3e3}),e._victimServicesComponent.getCasetNotes(e.victimId).subscribe((function(t){e.caseNoteList=t,e.caseNoteDataSource.data=e.caseNoteList}))}))}))},t.prototype.onAddNew=function(){this.hiddenDetailFlag=!1,this.editCaseNote.victimCaseNoteId=0;var t=this.caseNoteForm.get("caseNoteDate");t.setValue(null),t.setErrors(null),t.markAsPristine(),t.markAsPristine();var e=this.caseNoteForm.get("contactType");e.setValue(null),e.setErrors(null),e.markAsPristine(),e.markAsUntouched();var r=this.caseNoteForm.get("contactPurpose");r.setValue(null),r.setErrors(null),r.markAsPristine(),r.markAsUntouched();var i=this.caseNoteForm.get("comment");i.setValue(null),i.setErrors(null),i.markAsPristine(),i.markAsUntouched()},t.prototype.back=function(){this.router.navigate(["victimHome"])},t.prototype.saveCaseNote=function(){var t=this;if(void 0===this.editCaseNote.victimCaseNoteId||0===this.editCaseNote.victimCaseNoteId){var e={victimId:this.victimId,victimCaseNoteId:0,caseNoteDate:this.editCaseNote.caseNoteDate,contactTypeId:this.editCaseNote.contactTypeId,contactType:null,victimContactPurposeId:this.editCaseNote.victimContactPurposeId,victimContactPurpose:null,comment:this.editCaseNote.comment,modifiedBy:this.staffId,victimFirstName:null,victimLastName:null};this._victimServicesComponent.addCaseNote(e).subscribe((function(e){t.snackBar.open("Saved Successfully !","",{duration:3e3}),t.hiddenDetailFlag=!0,t._victimServicesComponent.getCasetNotes(t.victimId).subscribe((function(e){t.caseNoteList=e,t.caseNoteDataSource.data=t.caseNoteList}))}))}else this._victimServicesComponent.updateCaseNote(this.editCaseNote).subscribe((function(e){t.snackBar.open("Update Successfully !","",{duration:3e3}),t.hiddenDetailFlag=!0,t.hiddenAddNewFlag=!1,t.addDisableFlag=!1,t._victimServicesComponent.getCasetNotes(t.victimId).subscribe((function(e){t.caseNoteList=e,t.caseNoteDataSource.data=t.caseNoteList}))}))},t.decorators=[{type:r.Component,args:[{template:'\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n \r\n <mat-toolbar color="primary">\r\n <h4 class="card-header" >Case Note</h4>\r\n </mat-toolbar>\r\n <br>\r\n <div class="row" >\r\n <div [hidden]="hiddenAddNewFlag">\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="onAddNew()" [disabled]="addDisableFlag">Add Case Note</button>\r\n\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="back()">Back</button>\r\n </div>\r\n </div>\r\n\r\n <div [hidden]="hiddenDetailFlag" >\r\n <mat-card >\r\n <div class=\'container\'> \r\n <form [formGroup]="caseNoteForm" #caseNoteDetailForm="ngForm" >\r\n \r\n <div>\r\n <mat-label>Victim Name:</mat-label>\r\n {{victimName}} \r\n </div>\r\n \r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Date of Case Note: </mat-label>\r\n <input matInput formControlName="caseNoteDate" \r\n (click)="caseNoteDate.open()" \r\n [matDatepicker]="caseNoteDate" \r\n placeholder="Choose a start date" \r\n [(ngModel)]="editCaseNote.caseNoteDate" required>\r\n <mat-datepicker-toggle matSuffix [for]="caseNoteDate"></mat-datepicker-toggle>\r\n <mat-datepicker #caseNoteDate></mat-datepicker>\r\n\r\n <div class="help-block" *ngIf="caseNoteForm.get(\'caseNoteDate\').errors \r\n && (caseNoteForm.get(\'caseNoteDate\').dirty || caseNoteForm.get(\'caseNoteDate\').touched)">\r\n <mat-error>case note date is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" \r\n *ngIf="caseNoteForm.get(\'caseNoteDate\').hasError(\'date\') \r\n && (caseNoteForm.get(\'caseNoteDate\').dirty || caseNoteForm.get(\'caseNoteDate\').touched)">\r\n <mat-error>future case note Date is <strong>not allowed</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n </div> \r\n \r\n \r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Type:</mat-label>\r\n <mat-select placeholder="contactType" formControlName="contactType" required [(ngModel)]="editCaseNote.contactTypeId">\r\n <mat-option *ngFor=" let contactType of contactTypes" [value]="contactType.contactTypeId" >{{contactType.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class="help-block" *ngIf="caseNoteForm.get(\'contactType\').errors \r\n && (caseNoteForm.get(\'contactType\').dirty || caseNoteForm.get(\'contactType\').touched)">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n </div>\r\n \r\n <div> \r\n <mat-form-field class="mat-select-content">\r\n <mat-label>Contact Purpose:</mat-label>\r\n <mat-select formControlName="contactPurpose" required [(ngModel)]="editCaseNote.victimContactPurposeId" class="mat-select-inner">\r\n <mat-option *ngFor=" let contactPurpose of contactPurposes" [value]="contactPurpose.victimContactPurposeId" >{{contactPurpose.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class="help-block" *ngIf="caseNoteForm.get(\'contactPurpose\').errors \r\n && (caseNoteForm.get(\'contactPurpose\').dirty || caseNoteForm.get(\'contactPurpose\').touched)">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n \r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n\r\n <mat-form-field style="width: 400px;">\r\n <mat-label>Comment:</mat-label>\r\n <textarea \r\n class="textarea-content"\r\n matInput \r\n placeholder="" \r\n required formControlName="comment" \r\n [(ngModel)]="editCaseNote.comment"\r\n cdkTextareaAutosize\r\n #autosize="cdkTextareaAutosize"\r\n cdkAutosizeMinRows="8"\r\n cdkAutosizeMaxRows="12">\r\n </textarea> \r\n\r\n <div class="help-block" *ngIf="caseNoteForm.get(\'comment\').errors \r\n && (caseNoteForm.get(\'comment\').dirty || caseNoteForm.get(\'comment\').touched)">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n </div>\r\n \r\n <div>\r\n <button mat-raised-button color="primary" (click)="saveCaseNote()" [disabled]="!caseNoteDetailForm.form.valid" >Save</button>\r\n\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="hiddenDetailFlag = true;addDisableFlag = false; this.hiddenAddNewFlag = false;">Cancel</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n \r\n </div>\r\n <br>\r\n <mat-table #table [dataSource]="caseNoteDataSource" class="example-table">\r\n <ng-container matColumnDef="caseNoteDate">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Case Note Date</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.caseNoteDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef="contactType">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact Type</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.contactType}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef="contactPurpose">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact Purpose</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.contactPurpose}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="comment">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="victimCaseNoteId">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell"></mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell">\r\n \r\n <button \r\n class="sac-cso-read sac-vsp-read" \r\n mat-icon-button \r\n color="primary" \r\n matTooltip="Edit Case Note" \r\n (click)="onEditCaseNote(row.victimCaseNoteId)">\r\n <i class="material-icons">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n \r\n \r\n\r\n <button\r\n class="sac-vsp-read"\r\n matTooltip="Delete Case Note" \r\n mat-icon-button\r\n color="primary"\r\n (click)="onDeleteCaseNote(row.victimCaseNoteId)">\r\n <i class="material-icons">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n </mat-cell>\r\n </ng-container>\r\n \r\n <mat-header-row *matHeaderRowDef="[\'caseNoteDate\', \'contactType\', \'contactPurpose\', \'comment\', \'victimCaseNoteId\']" class="example-header-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns:[\'caseNoteDate\', \'contactType\', \'contactPurpose\', \'comment\', \'victimCaseNoteId\'];" class="example-row"></mat-row>\r\n </mat-table>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>',providers:[q],styles:[".container{width:800px;margin:16px;display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[1];grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}.textarea-content{width:500px}"]}]}],t.ctorParameters=function(){return[{type:s.FormBuilder},{type:U},{type:q},{type:m.MatSnackBar},{type:l.ActivatedRoute},{type:l.Router},{type:F.SmartAuthService}]},t}();var K=function(){function t(t,e,r,i,a){this._victimServicesComponent=t,this.snackBar=e,this.route=r,this.router=i,this.smartAuthService=a,this.editContact={},this.staff={},this.contactForm=new s.FormGroup({contactDate:new s.FormControl,contactMethod:new s.FormControl,contactBy:new s.FormControl,comment:new s.FormControl,nextContactDate:new s.FormControl})}return t.prototype.ngAfterViewInit=function(){this.smartAuthService.setPermission("Victim",this.route.snapshot)},t.prototype.ngOnInit=function(){var t=this,e=this.route.snapshot.data;this.loginStaff=e.loginStaff,this.staffId=this.loginStaff.staffId,this.staff=[{staffId:this.loginStaff.staffId,fullName:this.loginStaff.firstName+" "+this.loginStaff.lastName}],this.sub=this.route.params.subscribe((function(e){t.victimId=e.victimId,console.log("my this.victimId"),console.log(t.victimId)})),this._victimServicesComponent.getContactMethods().subscribe((function(e){t.contactMethods=e,console.log("this.contactMethods"),console.log(t.contactMethods)}))},t.prototype.onEditContact=function(t){},t.prototype.onAddNew=function(){},t.prototype.back=function(){this.router.navigate(["victimDetail",this.victimId])},t.prototype.saveContact=function(){var t=this,e={victimId:this.victimId,victimContactId:0,contactDate:this.editContact.contactDate,victimContactMethodId:this.editContact.victimContactMethodId,contactMethod:null,contactedByName:null,contactedBy:this.editContact.contactedBy,comment:this.editContact.comment,nextContactDate:this.editContact.nextContactDate,modifiedBy:this.staffId};this._victimServicesComponent.addContact(e).subscribe((function(e){t.snackBar.open("Saved Successfully !","",{duration:3e3}),t.router.navigate(["victimDetail",t.victimId])}))},t.decorators=[{type:r.Component,args:[{template:'\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n \r\n <mat-toolbar color="primary">\r\n <h4 class="card-header" >Contact detail</h4>\r\n </mat-toolbar>\r\n <br>\r\n \r\n\r\n \r\n <mat-card >\r\n <div class=\'container\'> \r\n <form [formGroup]="contactForm" #caseNoteDetailForm="ngForm" >\r\n \r\n \r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Contact Date:</mat-label>\r\n <input matInput formControlName="contactDate" \r\n (click)="contactDate.open()" \r\n [matDatepicker]="contactDate" \r\n placeholder="Choose a contact date" \r\n [(ngModel)]="editContact.contactDate" required>\r\n <mat-datepicker-toggle matSuffix [for]="contactDate"></mat-datepicker-toggle>\r\n <mat-datepicker #contactDate></mat-datepicker>\r\n </mat-form-field>\r\n </div> \r\n \r\n \r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Method:</mat-label>\r\n <mat-select placeholder="contactMethod" formControlName="contactMethod" required [(ngModel)]="editContact.victimContactMethodId">\r\n <mat-option *ngFor=" let contactMethod of contactMethods" [value]="contactMethod.victimContactMethodId" >{{contactMethod.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n \r\n <div> \r\n <mat-form-field class="mat-select-content">\r\n <mat-label>Contact By:</mat-label>\r\n <mat-select formControlName="contactBy" required [(ngModel)]="editContact.contactedBy" class="mat-select-inner">\r\n <mat-option *ngFor=" let item of staff" [value]="item.staffId" >{{ item.fullName}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n\r\n <mat-form-field>\r\n <mat-label>Comments </mat-label>\r\n <textarea \r\n matInput \r\n placeholder="" \r\n required formControlName="comment" \r\n [(ngModel)]="editContact.comment"\r\n cdkTextareaAutosize\r\n #autosize="cdkTextareaAutosize"\r\n cdkAutosizeMinRows="1"\r\n cdkAutosizeMaxRows="5">\r\n </textarea> \r\n </mat-form-field>\r\n </div>\r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Next Contact Date: </mat-label>\r\n <input matInput formControlName="nextContactDate" \r\n (click)="nextContactDate.open()" \r\n [matDatepicker]="nextContactDate" \r\n placeholder="Choose a next contact date" \r\n [(ngModel)]="editContact.nextContactDate" required>\r\n <mat-datepicker-toggle matSuffix [for]="nextContactDate"></mat-datepicker-toggle>\r\n <mat-datepicker #nextContactDate></mat-datepicker>\r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n \x3c!-- <button mat-raised-button color="primary" (click)="saveContact()" [disabled]="!contactForm.form.valid" >Save</button> --\x3e\r\n <button mat-raised-button color="primary" (click)="saveContact()" >Save</button>\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" >Cancel</button>\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="back()" >Back</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n \r\n \r\n <br>\r\n \r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>',styles:["mat-form-field{width:50%}.container{margin:16px;display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[1];grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}"]}]}],t.ctorParameters=function(){return[{type:U},{type:m.MatSnackBar},{type:l.ActivatedRoute},{type:l.Router},{type:F.SmartAuthService}]},t}();var Q=function(){function t(t,e,r,i,a,o,n,l){this._victimServicesComponent=t,this.commonDialogService=e,this.http=r,this.dialog=i,this.route=a,this.router=o,this.snackBar=n,this.smartAuthService=l,this.editSafetyPlan={},this.safetyPlanDataSource=new m.MatTableDataSource}return t.prototype.ngAfterViewInit=function(){this.smartAuthService.setPermission("Victim",this.route.snapshot)},t.prototype.ngOnInit=function(){var t=this,e=this.route.snapshot.data;this.loginStaff=e.loginStaff,this.staffId=this.loginStaff.staffId,this.sub=this.route.params.subscribe((function(e){t.victimId=e.victimId})),this.hiddenAddNewFlag=!1,this.victimName=this.victimName,this._victimServicesComponent.getSafetyPlans(this.victimId).subscribe((function(e){t.victimSafetyPlans=e,t.safetyPlanDataSource.data=t.victimSafetyPlans,console.log("this.victimSafetyPlans"),console.log(t.victimSafetyPlans)})),this._victimServicesComponent.getServiceStatusHistories(1).subscribe((function(t){}))},t.prototype.goToSafetyPlanDetail=function(t){this.router.navigate(["saftyPlanDetail",t,this.victimId])},t.prototype.onAddNew=function(){this.hiddenDetailFlag=!1},t.prototype.onDeleteSafetyPlan=function(t){var e=this;this.commonDialogService.confirm("","Do you want to delete this safety plan?","Yes","No").subscribe((function(r){e.result=r,e.result&&e._victimServicesComponent.deleteSafetyPlan(t,e.staffId).subscribe((function(t){e.snackBar.open("delete safety plan Successfully !","",{duration:3e3}),e._victimServicesComponent.getSafetyPlans(e.victimId).subscribe((function(t){e.victimSafetyPlans=t,e.safetyPlanDataSource.data=e.victimSafetyPlans}))}))}))},t.prototype.back=function(){this.router.navigate(["victimHome"])},t.decorators=[{type:r.Component,args:[{template:'\r\n <mat-card>\r\n <mat-card-header>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color="primary">\r\n <h4 class="card-header" style="display: inline-block;">Safety Plan</h4>\r\n </mat-toolbar>\r\n <br>\r\n <button mat-raised-button color="primary" (click)="goToSafetyPlanDetail(0)" >Add Goal</button>\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="back()">Back</button>\r\n <br>\r\n <br>\r\n <mat-table #table [dataSource]="safetyPlanDataSource" class="example-table">\r\n <ng-container matColumnDef="startDate">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="goal">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Goal</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.goal }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="victimServiceStatus">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Status</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.victimServiceStatus }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="comment">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.comment }} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="victimServiceId">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell"></mat-header-cell>\r\n \x3c!-- <mat-cell *matCellDef="let row" class="example-cell">\r\n <button type="button" mat-raised-button color="primary" (click)="goToSafetyPlanDetail(row.victimServiceId)"> \r\n <span class="glyphicon glyphicon-pencil" ></span>&nbsp;\r\n <mat-icon>edit</mat-icon> \r\n </button> \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n &nbsp;&nbsp;\r\n <button type="button" mat-raised-button color="primary" (click)="onDeleteSafetyPlan(row.victimServiceId)"> \r\n <span class="glyphicon glyphicon-trash" ></span>&nbsp;Delete\r\n </button> \r\n </mat-cell> --\x3e\r\n\r\n <mat-cell *matCellDef="let element">\r\n \r\n <button class="edit-btn" mat-icon-button color="primary" matTooltip="Edit Safety Plan" (click)="goToSafetyPlanDetail(element.victimServiceId)">\r\n <i class="material-icons">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n \r\n <button\r\n class="delete-btn"\r\n matTooltip="Delete Safety Plan"\r\n mat-icon-button\r\n color="primary"\r\n (click)="onDeleteSafetyPlan(element.victimServiceId)">\r\n <i class="material-icons">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n \r\n </mat-cell>\r\n\r\n \r\n \r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="[\'startDate\', \'goal\', \'victimServiceStatus\', \'comment\', \'victimServiceId\']" class="example-header-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns:[\'startDate\', \'goal\', \'victimServiceStatus\', \'comment\', \'victimServiceId\'];" class="example-row"></mat-row>\r\n </mat-table>\r\n \r\n \r\n</mat-card-content>\r\n</mat-card>',providers:[q]}]}],t.ctorParameters=function(){return[{type:U},{type:q},{type:e.HttpClient},{type:m.MatDialog},{type:l.ActivatedRoute},{type:l.Router},{type:m.MatSnackBar},{type:F.SmartAuthService}]},t}();var X=function(){function t(t,e,r,i){this.formBuilder=t,this.dialogRef=e,this._victimServicesComponent=r,this.data=i,this.spForm=this.formBuilder.group({voteeProviderId:[""]})}return t.prototype.cancel=function(){this.dialogRef.close()},t.prototype.ngOnInit=function(){var t=this;console.log("data.providerCollections"),console.log(this.data),console.log(this.data.serviceTypeId),this._victimServicesComponent.getvVictimServiceTypeProgramProviders().subscribe((function(e){t.programProviders=e.filter((function(e){return e.victimServiceTypeId===t.data.serviceTypeId})),console.log("this.programProviders"),console.log(t.programProviders)})),this.spForm.get("voteeProviderId").valueChanges.subscribe((function(t){console.log("voteeProviderId in service provider component."),console.log(t)}))},t.decorators=[{type:r.Component,args:[{selector:"app-service-provider",template:'\n <h1 mat-dialog-title> {{data.serviceType}}</h1>\n <div mat-dialog-content class="main" [formGroup]="spForm">\n <mat-form-field>\n <mat-label>service provider</mat-label>\n \n <mat-select formControlName="voteeProviderId">\n <mat-option\n *ngFor="let providerOption of programProviders"\n [value]="providerOption.victimProgramProviderId">{{ providerOption.victimProgramProvider }}\n </mat-option>\n </mat-select>\n \n </mat-form-field>\n \n </div>\n <div mat-dialog-actions class="actions">\n <button mat-raised-button color="primary" (click)="cancel()" cdkFocusInitial>\n Cancel Change\n </button>\n <button mat-raised-button color="primary" [mat-dialog-close]="spForm.value" >\n Save Change\n </button>\n </div>\n ',styles:["\n .main {\n width: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .actions{\n display: flex;\n }\n "]}]}],t.ctorParameters=function(){return[{type:s.FormBuilder},{type:m.MatDialogRef},{type:U},{type:void 0,decorators:[{type:r.Inject,args:[m.MAT_DIALOG_DATA]}]}]},t}();var Z=function(){function t(t,e,r,i,a,o,n,l){this.dialog=t,this._victimServicesComponent=e,this.http=r,this.snackBar=i,this.route=a,this.router=o,this.commonDialogService=n,this.formBuilder=l,this.editSafetyPlan={},this.providerListCollection=[],this.serviceCheck=[],this.victimServiceStatusHistoriesDataSource=new m.MatTableDataSource,this.initForm()}return t.prototype.initForm=function(){this.spForm=this.formBuilder.group({serviceGoal:new s.FormControl("",s.Validators.compose([s.Validators.required])),goalStatus:new s.FormControl("",s.Validators.compose([s.Validators.required])),goalStatusDate:new s.FormControl("",s.Validators.compose([s.Validators.required,$()])),comment:new s.FormControl("",s.Validators.required)}),this.spForm.markAsPristine(),this.spForm.markAsUntouched()},t.prototype.ngOnInit=function(){var t=this,e=this.route.snapshot.data;this.loginStaff=e.loginStaff,this.staffId=this.loginStaff.staffId,this.sub=this.route.params.subscribe((function(e){t.victimServiceId=e.victimServiceId,t.victimId=e.victimId})),this.hiddenAddNewFlag=!1,this.isDisplay=!1,this._victimServicesComponent.getVictimServiceTypes().subscribe((function(e){t.victimServiceTypes=e})),this._victimServicesComponent.getVictimServiceStatus().subscribe((function(e){t.victimServiceStatus=e})),this._victimServicesComponent.getVictim(this.victimId).subscribe((function(e){t.victimName=e.firstName+", "+e.lastName})),0!=this.victimServiceId&&(this._victimServicesComponent.getVictimServices(this.victimServiceId).subscribe((function(e){console.log("victimSafetyPlans"),console.log(e),t.editSafetyPlan=e[0],t.victimId=e[0].victimId,console.log("this.editSafetyPlan"),console.log(t.editSafetyPlan)})),this._victimServicesComponent.getServiceStatusHistories(this.victimServiceId).subscribe((function(e){t.victimServiceStatusHistoriesDataSource.data=e}))),this.loadProvider()},t.prototype.isInArray=function(t,e,r){var i=this;if(console.log("providerListCollectionKey"),console.log(t),console.log("serviceTypeName"),console.log(e),console.log("event.source.value"),console.log(r.checked),1==r.checked)for(var a=0;a<this.providerListCollection.length;a++){if(t==this.providerListCollection[a].groupId)this.providerListCollection[a].isDisplay=!this.providerListCollection[a].isDisplay,this.dialog.open(X,{width:"500px",data:{serviceType:e,serviceTypeId:t,providerCollections:S(this.providerListCollection)},panelClass:"formFieldWidth480"}).afterClosed().subscribe((function(e){console.log("The dialog was closed"),console.log(e),e&&(console.log("The dialog was closed, inside result"),i.savePlanProvider(t,e.voteeProviderId))}))}},t.prototype.loadProvider=function(){var t=this;this.providerListCollection=[],this._victimServicesComponent.getvVictimServiceTypeProgramProviders().subscribe((function(e){if(e)for(var r=Object.create(null),i=0;i<e.length;i++){if(!r[e[i].victimServiceTypeId]){if(r[e[i].victimServiceTypeId]=[],null!=t.editSafetyPlan.vVictimServiceDetails)for(var a=0;a<t.editSafetyPlan.vVictimServiceDetails.length;a++)e[i].victimServiceTypeId==t.editSafetyPlan.vVictimServiceDetails[a].victimServiceId.toString()&&(t.isDisplay=!0);t.providerListCollection.push({groupId:e[i].victimServiceTypeId,isDisplay:t.isDisplay,collection:r[e[i].victimServiceTypeId]})}r[e[i].victimServiceTypeId].push(e[i])}}))},t.prototype.evaluateSelection=function(t){if(this.editSafetyPlan.vVictimServiceDetails)return this.editSafetyPlan.vVictimServiceDetails.findIndex((function(e){return e.victimServiceTypeId===t}))>=0},t.prototype.savePlanProvider=function(t,e){var r=this;if(console.log("savePlanProvider"),console.log(t),console.log(e),""===e||null==e)this.snackBar.open("Please pick a program on the drop down list !","",{duration:120});else if(0==this.victimServiceId){console.log("insert new plan");var i={victimId:this.victimId,fullName:null,victimServiceId:0,goal:this.editSafetyPlan.goal,comment:this.editSafetyPlan.comment,modifiedBy:this.staffId,victimServiceStatusId:null,status:null,startDate:null,vVictimServiceDetails:null,victimName:null};this._victimServicesComponent.addSafetyPlan(i).subscribe((function(i){var a={victimServiceStatusHistoryId:0,victimServiceId:i.victimServiceId,victimServiceStatusId:r.editSafetyPlan.victimServiceStatusId,startDate:r.editSafetyPlan.startDate,modifiedBy:r.staffId,comment:"test add safety plan"};r._victimServicesComponent.addVictimServiceStatus(a).subscribe((function(){console.log("check itms.victimServiceId iniside add victim serive status"),console.log(i.victimServiceId);var a={victimServiceId:i.victimServiceId,victimServiceDetailId:0,victimServiceTypeId:t,victimProgramProviderId:e,modifiedBy:r.staffId,victimProgramProvider:null};console.log("add plan provider here at insert"),r._victimServicesComponent.addPlanProvider(a).subscribe((function(){r.router.navigate(["saftyPlanDetail",i.victimServiceId,r.victimId])}))}))}))}else{var a={victimServiceId:this.victimServiceId,victimServiceDetailId:0,victimServiceTypeId:t,victimProgramProviderId:e,modifiedBy:this.staffId,victimProgramProvider:null};console.log("add plan provider here at update"),this._victimServicesComponent.addPlanProvider(a).subscribe((function(){r.router.navigate(["saftyPlanDetail",r.victimServiceId,r.victimId])}))}},t.prototype.deleteProvider=function(t){var e=this;this.commonDialogService.confirm("","Do you want to delete this provider?","Yes","No").subscribe((function(r){e.result=r,e.result&&e._victimServicesComponent.deleteProvider(t,e.staffId).subscribe((function(t){e.snackBar.open("delete provider Successfully !","",{duration:3e3}),location.reload()}))}))},t.prototype.saveSafetyPlan=function(){var t=this;if(void 0===this.editSafetyPlan.victimServiceId){var e={victimId:this.victimId,fullName:null,victimServiceId:0,goal:this.editSafetyPlan.goal,comment:this.editSafetyPlan.comment,modifiedBy:this.staffId,victimServiceStatusId:null,status:null,startDate:null,vVictimServiceDetails:null,victimName:null};this._victimServicesComponent.addSafetyPlan(e).subscribe((function(e){var r={victimServiceStatusHistoryId:0,victimServiceId:e.victimServiceId,victimServiceStatusId:t.editSafetyPlan.victimServiceStatusId,startDate:t.editSafetyPlan.startDate,modifiedBy:t.staffId,comment:"test add safety Plan"};t._victimServicesComponent.addVictimServiceStatus(r).subscribe((function(e){t.snackBar.open("Insert status successfully!","",{duration:3e3})})),t.router.navigate(["saftyPlanDetail",e.victimServiceId,t.victimId])}))}else this.editSafetyPlan.modifiedBy=this.staffId,this._victimServicesComponent.updateSafetyPlan(this.editSafetyPlan).subscribe((function(e){var r={victimServiceStatusHistoryId:0,victimServiceId:t.editSafetyPlan.victimServiceId.toString(),victimServiceStatusId:t.editSafetyPlan.victimServiceStatusId,startDate:t.editSafetyPlan.startDate,modifiedBy:t.staffId,comment:"test update safety Plan"};t._victimServicesComponent.addVictimServiceStatus(r).subscribe(),t.router.navigate(["saftyPlanDetail",t.editSafetyPlan.victimServiceId,t.victimId])}))},t.prototype.back=function(){console.log("this.victimId"),console.log(this.victimId),this.router.navigate(["saftyPlan",this.victimId])},t.decorators=[{type:r.Component,args:[{template:'<mat-card>\r\n <mat-card-header>\r\n \r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color="primary">\r\n <h4 class="card-header" style="display: inline-block;">Safety Plan</h4>\r\n </mat-toolbar>\r\n \r\n \r\n <div class=\'container\'>\r\n <form [formGroup]="spForm" #spDetailForm="ngForm" >\r\n \r\n \r\n <div class="row" ><b>Victim Name:</b> {{victimName}} </div>\r\n \r\n\r\n <div class="row" > \r\n <mat-form-field >\r\n <mat-label>Goal:</mat-label>\r\n <input matInput formControlName="serviceGoal" [(ngModel)]="editSafetyPlan.goal" >\r\n </mat-form-field>\r\n \r\n </div>\r\n \r\n \r\n \r\n \r\n \r\n \r\n <div class="row"> \r\n <mat-form-field>\r\n <mat-label>Goal Status:</mat-label>\r\n <mat-select formControlName="goalStatus" [(ngModel)]="editSafetyPlan.victimServiceStatusId" >\r\n \r\n <mat-option *ngFor=" let victimServiceStatu of victimServiceStatus" [value]="victimServiceStatu.victimServiceStatusId" >{{victimServiceStatu.name}}</mat-option>\r\n \r\n </mat-select> \r\n </mat-form-field>\r\n </div>\r\n \r\n\r\n \r\n \r\n <div class="row"> \r\n \r\n <mat-form-field>\r\n <mat-label>Goal Status Date:</mat-label>\r\n <input matInput \r\n formControlName="goalStatusDate" \r\n [matDatepicker]="goalStatusDate" \r\n placeholder="Choose a date" [(ngModel)]="editSafetyPlan.startDate" \r\n (click)="goalStatusDate.open()" \r\n >\r\n \r\n <mat-datepicker-toggle matSuffix [for]="goalStatusDate"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker> \r\n </mat-form-field> \r\n\r\n\r\n <div class="help-block" \r\n *ngIf="spForm.get(\'goalStatusDate\').hasError(\'date\') \r\n && (spForm.get(\'goalStatusDate\').dirty || spForm.get(\'goalStatusDate\').touched)">\r\n <mat-error>Future Date is <strong>not allowed</strong> for goal status date</mat-error>\r\n </div>\r\n </div>\r\n\r\n \r\n <div class="row" > \r\n \x3c!-- <mat-form-field style="width: 200px;"> --\x3e\r\n \x3c!-- <mat-label>Comment:</mat-label> \r\n <textarea mdInput \r\n class="textarea-content"\r\n [(ngModel)]="editSafetyPlan.comment"\r\n formControlName="comment" \r\n cdkTextareaAutosize\r\n #autosize="cdkTextareaAutosize"\r\n cdkAutosizeMinRows="8"\r\n cdkAutosizeMaxRows="12"\r\n >\r\n </textarea> --\x3e\r\n \x3c!-- </mat-form-field> --\x3e\r\n\r\n\r\n\r\n <mat-form-field style="width: 400px;">\r\n <mat-label>Comment:</mat-label>\r\n <textarea \r\n class="textarea-content"\r\n matInput \r\n placeholder="" \r\n formControlName="comment" \r\n [(ngModel)]="editSafetyPlan.comment"\r\n cdkTextareaAutosize\r\n #autosize="cdkTextareaAutosize"\r\n cdkAutosizeMinRows="8"\r\n cdkAutosizeMaxRows="12">\r\n </textarea> \r\n\r\n \r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </form>\r\n </div>\x3c!--end form--\x3e\r\n \r\n \r\n <br>\r\n\r\n <div class="row"><b>Need and provider:</b><br> (click on a check box to select provider information)\r\n \r\n <mat-list>\r\n <mat-list-item *ngFor="let serviceType of victimServiceTypes; let i=index" >\r\n <mat-checkbox class="example-margin" name="victimService" color ="primary" [checked]="evaluateSelection(serviceType.victimServiceTypeId)" (change)="isInArray(serviceType.victimServiceTypeId,serviceType.name, $event);" > {{serviceType.name}}</mat-checkbox>\r\n <div> &nbsp;&nbsp;</div>\r\n <div *ngFor="let provider of providerListCollection; let pi = index" >\r\n \x3c!-- <div *ngIf="provider.isDisplay && serviceType.victimServiceTypeId == provider.groupId " class="Row">\r\n \r\n <div class="serviceSelect"> --\x3e\r\n \x3c!-- <mat-form-field> --\x3e\r\n \x3c!-- <mat-select name="provider" id="provider.groupId" [(ngModel)]="providerId" > --\x3e\r\n \x3c!-- <mat-select name="provider" id="provider.groupId" [(value)]="providerId" > \r\n <mat-option *ngFor=" let providerOption of provider.collection" [value]="providerOption.victimProgramProviderId" >{{providerOption.victimProgramProvider}}</mat-option>\r\n </mat-select> --\x3e\r\n \x3c!-- </mat-form-field> --\x3e\r\n \r\n \x3c!-- </div>\r\n\r\n <div class="serviceButton">\r\n <button mat-raised-button color="primary" (click)="savePlanProvider(serviceType.victimServiceTypeId ,providerId)">Add Provider</button>\r\n </div>\r\n </div> --\x3e\r\n </div>\r\n <div *ngFor=" let serviceprovider of editSafetyPlan.vVictimServiceDetails" >\r\n \r\n <div *ngIf="serviceType.victimServiceTypeId===serviceprovider.victimServiceTypeId" class="Row" >\r\n \x3c!-- . {{ serviceprovider.victimProgramProvider}}<button mat-raised-button color="primary" (click)="deleteProvider(serviceprovider.victimServiceDetailId)">Delete</button> <br> --\x3e\r\n <div class="serviceSelect" >\r\n . {{ serviceprovider.victimProgramProvider}}\r\n </div>\r\n <div class="serviceButton">\r\n <button mat-raised-button color="primary" (click)="deleteProvider(serviceprovider.victimServiceDetailId)">Delete</button> \r\n </div>\r\n \r\n </div>\r\n \r\n </div>\r\n \r\n </mat-list-item> \r\n \r\n </mat-list>\r\n </div>\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \x3c!-- <div class=\'row\' >\r\n <div class=\'col-md-5 desc-label\'><b>Victim Name:</b> {{victimName}} </div>\r\n <div class=\'col-md-7\'> \r\n \r\n </div> \r\n </div> --\x3e\r\n \x3c!-- <div class=\'row\' >\r\n <div class=\'col-md-5 desc-label\'><b>Goal:<font color="red">*</font></b></div>\r\n <div class=\'col-md-7\'> \r\n <mat-form-field >\r\n <input matInput name="serviceGoal" [(ngModel)]="editSafetyPlan.goal" required placeholder="">\r\n </mat-form-field>\r\n </div> \r\n </div>\r\n\r\n <div class=\'row\' >\r\n <div class=\'col-md-5 desc-label\'><b>Goal Status:<font color="red">*</font></b></div>\r\n <div class=\'col-md-7\'> \r\n <mat-select name="goalStatus" [style.width]="\'50%\'" [(ngModel)]="editSafetyPlan.victimServiceStatusId" required>\r\n <mat-option *ngFor=" let victimServiceStatu of victimServiceStatus" [value]="victimServiceStatu.victimServiceStatusId" >{{victimServiceStatu.name}}</mat-option>\r\n </mat-select>\r\n </div> \r\n </div>\r\n \r\n <div class=\'row\' >\r\n <div class=\'col-md-5 desc-label\'><b>Goal Status Date:<font color="red">*</font></b></div>\r\n <div class=\'col-md-7\'> \r\n <input matInput name="goalStatusDate" [matDatepicker]="goalStatusDate" placeholder="Choose a date" [(ngModel)]="editSafetyPlan.startDate" required>\r\n <mat-datepicker-toggle matSuffix [for]="goalStatusDate"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker> \r\n </div> \r\n </div>\r\n \r\n <div class=\'row\' >\r\n <div class=\'col-md-5 desc-label\'><b>Comment:</b></div>\r\n <div class=\'col-md-7\'> \r\n <textarea mdInput placeholder="" rows="10" cols="50" name="comment" [(ngModel)]="editSafetyPlan.comment"></textarea> \r\n </div> \r\n </div> --\x3e\r\n\r\n \r\n <div class=\'row\' >\r\n <div class=\'col-md-12 text-center\'>\r\n \x3c!-- <button type="button" class="btn btn-default btn-small" (click)="print()">Print</button> --\x3e\r\n <button mat-raised-button color="primary" (click)="saveSafetyPlan()" [disabled]="!spForm.valid">Save</button>\r\n \x3c!-- &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="commondialogRef.close()">Cancel</button> --\x3e\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="back()">Back</button>\r\n </div> \r\n </div> \r\n\r\n \x3c!--status hisotry--\x3e\r\n \r\n <mat-table #table [dataSource]="victimServiceStatusHistoriesDataSource" class="example-table">\r\n <ng-container matColumnDef="startDate">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef="victimServiceStatusId">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Status</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.victimServiceStatusId}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef="comment">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n <mat-header-row *matHeaderRowDef="[ \'startDate\', \'victimServiceStatusId\', \'comment\']" class="example-header-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns:[ \'startDate\', \'victimServiceStatusId\', \'comment\'];" class="example-row"></mat-row>\r\n </mat-table>\r\n\r\n \r\n \r\n\r\n</mat-card-content>\r\n</mat-card>',providers:[q],styles:["div.serviceSelect{width:500px}div.serviceButton{width:20%}.container{margin:16px;display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.app-class .mat-list-item{height:auto}.textarea-content{width:500px}"]}]}],t.ctorParameters=function(){return[{type:m.MatDialog},{type:U},{type:e.HttpClient},{type:m.MatSnackBar},{type:l.ActivatedRoute},{type:l.Router},{type:q},{type:s.FormBuilder}]},t}();var tt=[{path:"casenote/:victimId",component:J,pathMatch:"full",canActivate:[y.MsalGuard],resolve:{loginStaff:F.LoginStaffResolverService}},{path:"saftyPlan/:victimId",component:Q,pathMatch:"full",resolve:{loginStaff:F.LoginStaffResolverService}},{path:"saftyPlanDetail/:victimServiceId/:victimId",component:Z,pathMatch:"full",resolve:{loginStaff:F.LoginStaffResolverService}},{path:"victimList",component:B,resolve:{loginStaff:F.LoginStaffResolverService,selectedOffender:F.SelectedOffenderResolverService}},{path:"victimHome",component:B,resolve:{loginStaff:F.LoginStaffResolverService,selectedOffender:F.SelectedOffenderResolverService}},{path:"victimContact/:victimId",component:K,resolve:{loginStaff:F.LoginStaffResolverService,selectedOffender:F.SelectedOffenderResolverService}},{path:"victimDetail/:victimId",component:_,resolve:{loginStaff:F.LoginStaffResolverService,selectedOffender:F.SelectedOffenderResolverService}},{path:"smart-error",component:F.SmartErrorComponent}],et=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[l.RouterModule.forChild(tt)],exports:[l.RouterModule]}]}],t}(),rt=function(){};var it=function(){function t(){this.onSearch=new r.EventEmitter,this.change=new r.EventEmitter,this.filter=new rt}return t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){},t.prototype.onChange=function(){console.log("this.filter in serach form."),console.log(this.filter),this.onSearch.emit(this.filter)},t.decorators=[{type:r.Component,args:[{selector:"app-victim-search-form",template:'<form name="victimSearchFrom" #From="ngForm">\r\n<mat-expansion-panel [expanded]="true">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Search for Victims\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div class="victimSearch">\r\n <mat-form-field>\r\n <input matInput placeholder="Victim Last Name" [(ngModel)]="filter.lastName" name="lastName" id="lastName">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder="Victim First Name" [(ngModel)]="filter.firstName" name="firstName" id="firstName">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder="Victim Date of Birth" type="date" [(ngModel)]="filter.birthDate" name="birthDate" id="birthDate">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder="Offender PDID" [(ngModel)]="filter.pdid" name="pdid" id="pdid">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder="Offender CSOSA #"[(ngModel)]="filter.offenderId" name="offenderId" id="offenderId">\r\n </mat-form-field>\r\n \r\n \r\n <section>\r\n <button id="victimSearchButton" mat-raised-button color="primary" (click)="onChange()">Search</button>\r\n <span style="padding-right: 5px;"></span>\r\n <button mat-raised-button color="primary" type="reset" value="Reset">Clear Changes</button>\r\n </section>\r\n </div>\r\n </mat-expansion-panel>\r\n</form>\r\n\r\n\r\n',encapsulation:r.ViewEncapsulation.None,styles:['div.services{max-width:500px;margin:auto;border:3px solid #73ad21}.rTable{display:block;width:100%}.rTableBody,.rTableFoot,.rTableHeading,.rTableRow{clear:both}.rTableFoot,.rTableHead{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.victimSearch{display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-description,.example-headers-align .mat-expansion-panel-header-title{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-firstName,.mat-column-homePhone,.mat-column-lastName,.mat-column-offenderName,.mat-column-relationship{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}']}]}],t.ctorParameters=function(){return[]},t.propDecorators={onSearch:[{type:r.Output}]},t}();var at=function(){function t(t,e){this.el=t,this.renderer=e}return Object.defineProperty(t.prototype,"phoneControl",{set:function(t){this._phoneControl=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preValue",{set:function(t){this._preValue=t,this.formatPhoneNumber(t)},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.ngOnDestroy=function(){},t.prototype.formatPhoneNumber=function(t){this._preValue||(this._preValue="",t="");var e=this._preValue,r=e.substr(e.length-1),i=t.replace(/\D/g,""),a=this.renderer.selectRootElement("#tel").selectionStart,o=this.renderer.selectRootElement("#tel").selectionEnd;if(t.length<e.length)e.length<a&&")"==r&&(i=i.substr(0,i.length-1)),i=0==i.length?"":i.length<=3?i.replace(/^(\d{0,3})/,"($1"):i.length<=6?i.replace(/^(\d{0,3})(\d{0,3})/,"($1) $2"):i.replace(/^(\d{0,3})(\d{0,3})(.*)/,"($1) $2-$3"),this._phoneControl.setValue(i,{emitEvent:!1}),this.renderer.selectRootElement("#tel").setSelectionRange(a,o);else{var n=t.charAt(a);i=0==i.length?"":i.length<=3?i.replace(/^(\d{0,3})/,"($1)"):i.length<=6?i.replace(/^(\d{0,3})(\d{0,3})/,"($1) $2"):i.replace(/^(\d{0,3})(\d{0,3})(.*)/,"($1) $2-$3"),e.length>=a?("("==n&&(a+=1,o+=1),")"==n&&(a+=2,o+=2),"-"==n&&(a+=1,o+=1)," "==n&&(a+=1,o+=1),""==n&&(a+=1,o+=1),this._phoneControl.setValue(i,{emitEvent:!1}),this.renderer.selectRootElement("#tel").setSelectionRange(a,o)):(this._phoneControl.setValue(i,{emitEvent:!1}),this.renderer.selectRootElement("#tel").setSelectionRange(a+2,o+2))}},t.decorators=[{type:r.Directive,args:[{selector:"[phoneMask]"}]}],t.ctorParameters=function(){return[{type:r.ElementRef},{type:r.Renderer2}]},t.propDecorators={phoneControl:[{type:r.Input,args:["phoneControl"]}],preValue:[{type:r.Input,args:["preValue"]}]},t}();var ot=[B,_,j,at],nt=[j],lt=[n.CommonModule,s.ReactiveFormsModule],ct=[v.SmartAddressModule],mt=[m.MatButtonModule,m.MatCheckboxModule,m.MatRadioModule,m.MatSliderModule,m.MatCardModule,m.MatSlideToggleModule,m.MatListModule,m.MatIconModule,m.MatButtonToggleModule,m.MatToolbarModule,m.MatTabsModule,m.MatExpansionModule,m.MatMenuModule,m.MatInputModule,m.MatProgressBarModule,m.MatDatepickerModule,m.MatNativeDateModule,m.MatPaginatorModule,m.MatDialogModule,m.MatSidenavModule,m.MatSelectModule,m.MatTableModule,m.MatSortModule,m.MatGridListModule,d.CdkTableModule,u.LayoutModule],st=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:S(ot,[J,K,Q,Z,it,X]),imports:S(lt,mt,ct,[Y,s.FormsModule,et,o.ApolloModule]),exports:S(ot,[o.ApolloModule]),entryComponents:S(nt,[X]),providers:[U]}]}],t}();t.NgcSmartVictimComponent=B,t.NgcSmartVictimModule=st,t.NgcSmartVictimService=U,t.SMART_LOOKUP_SERVICE_URL=D,t.SMART_OFFENDER_SERVICE_URL=C,t.SMART_VICTIM_SERVICE_URL=P,t.SMART_WARRANT_URL=N,t.Victim=A,t.VictimAdvocate=V,t.VictimDrugUse=x,t.VictimGuardian=T,t.VictimListFilter=w,t.VictimSupport=M,t.VictimWeaponUse=k,t.ɵa=L,t.ɵb=_,t.ɵc=q,t.ɵd=j,t.ɵe=at,t.ɵf=J,t.ɵg=K,t.ɵh=Q,t.ɵi=Z,t.ɵj=it,t.ɵk=X,t.ɵl=Y,t.ɵm=z,t.ɵn=H,t.ɵo=et,Object.defineProperty(t,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */function I(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,a,o=r.call(t),n=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)n.push(i.value)}catch(t){a={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(a)throw a.error}}return n}function S(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(I(arguments[e]));return t}var C=new r.InjectionToken("smart offender service url"),D=new r.InjectionToken("smart lookup service url"),P=new r.InjectionToken("smart victim service url"),w=new r.InjectionToken("smart warrant web url");var N=function(){};var k=function(t,e,r,i,a,o,n,l,c,m,s,d){this.victimAdvocateId=t,this.lastName=e,this.firstName=r,this.prefixId=i,this.suffixId=a,this.addressId=o,this.noPhoneFlag=n,this.homePhone=l,this.workPhone=c,this.cellPhone=m,this.email=s,this.modifiedBy=d};var x=function(t,e,r,i){this.victimId=t,this.weaponTypeId=e,this.otherWeapon=r,this.modifiedBy=i};var V=function(t,e,r,i){this.victimId=t,this.drugTypeId=e,this.otherDrug=r,this.modifiedBy=i};var M=function(t,e,r){this.victimId=t,this.victimSupportTypeId=e,this.modifiedBy=r};var T=function(t,e,r,i,a,o,n,l,c,m,s,d,u){this.victimGuardianId=t,this.lastName=e,this.firstName=r,this.prefixId=i,this.suffixId=a,this.birthDate=o,this.addressId=n,this.noPhoneFlag=l,this.homePhone=c,this.workPhone=m,this.cellPhone=s,this.email=d,this.modifiedBy=u};var A=function(t,e,r,i,a,o,n,l,c,m,s,d,u,v,p,h,f,g,y,b,F,I,S,C,D,P,w,N,k,x,V,M,T,A,E,R,U,L,O,B,H,q,W,G,_,j,Y,z,$,J,K,Q,X,Z,tt,et,rt,it){this.victimId=t,this.offenderId=e,this.underSupervisionFlag=r,this.victimOffenderRelationshipTypeId=i,this.lastName=a,this.firstName=o,this.middleName=n,this.prefixId=l,this.suffixId=c,this.birthDate=m,this.genderCode=s,this.homePhone=d,this.workPhone=u,this.cellPhone=v,this.email=p,this.addressId=h,this.minorFlag=f,this.victimAdvocateFlag=g,this.guardianFirstName=y,this.guardianLastName=b,this.guardianPrefixId=F,this.guardianSuffixId=I,this.guardianNoPhoneFlag=S,this.guardianHomePhone=C,this.guardianWorkPhone=D,this.guardianCellPhone=P,this.guardianEmail=w,this.guardianAddressId=N,this.guardianBirthDate=k,this.advocateFirstName=x,this.advocateLastName=V,this.advocatePrefixId=M,this.advocateSuffixId=T,this.advocateNoPhoneFlag=A,this.advocateHomePhone=E,this.advocateWorkPhone=R,this.advocateCellPhone=U,this.advocateEmail=L,this.advocateAddressId=O,this.emergencyContact=B,this.emergencyContactPhone=H,this.commonChildrenFlag=q,this.commonChildrenNumber=W,this.cpoExpirationFlag=G,this.cpoExpirationDate=_,this.supportInPlaceFlag=j,this.weaponInvolvedFlag=Y,this.drugUseFlag=z,this.alcoholUseFlag=$,this.accessRisk=J,this.modifiedBy=K,this.relationship=Q,this.vVictimAdvocate=X,this.vVictimGuardian=Z,this.victimSupports=tt,this.victimWeaponUses=et,this.victimDrugUses=rt,this.allowCsosaContactFlag=it};var E=new e.HttpHeaders({"Content-Type":"application/json"}),R={headers:E},U=function(){function t(t,e,r,i,a){this.http=t,this.smartOffenderServiceUrl=e,this.smartLookupServiceUrl=r,this.smartVictimServiceUrl=i,this.apollo=a,this.serviceApiUrl="https://smart-service-test.azurewebsites.net/graphql"}return t.prototype.handleError=function(t){return console.error(t),i.throwError(t.json().error||"Server error")},t.prototype.getDrugsTypes=function(){return this.http.get(this.smartLookupServiceUrl+"DrugTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getDocketList=function(t){var e="\n {\n findDockets(input: { where: { offenderId:"+t+" } }) {\n totalCount\n message\n data {\n docketId\n docketNumber\n \n }\n }\n }";return this.http.post(this.serviceApiUrl,{query:e}).pipe(a.map((function(t){var e=t.data;return console.log("dockets for this offender:",e.findDockets.data),e.findDockets.data})))},t.prototype.getSupportTypes=function(){return this.http.get(this.smartLookupServiceUrl+"VictimSupportTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getPrefixes=function(){return this.http.get(this.smartLookupServiceUrl+"Prefixes",R).pipe(a.map((function(t){return t})))},t.prototype.getSuffixes=function(){return this.http.get(this.smartLookupServiceUrl+"Suffixes",R).pipe(a.map((function(t){return t})))},t.prototype.getRelationshipTypes=function(){return this.http.get(this.smartLookupServiceUrl+"RelationshipTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getGenders=function(){return this.http.get(this.smartLookupServiceUrl+"Genders",R).pipe(a.map((function(t){return t})))},t.prototype.getWeaponTypes=function(){return this.http.get(this.smartLookupServiceUrl+"WeaponTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getFlagOptionYesNoUnknowns=function(){return this.http.get(this.smartLookupServiceUrl+"FlagOptionYesNoUnknowns",R).pipe(a.map((function(t){return t})))},t.prototype.getContactTypes=function(){return this.http.get(this.smartLookupServiceUrl+"ContactTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getContactMethods=function(){return this.http.get(this.smartLookupServiceUrl+"VictimContactMethods",R).pipe(a.map((function(t){return t})))},t.prototype.getContactBys=function(){return this.http.get(this.smartLookupServiceUrl+"VictimContactPurposes",R).pipe(a.map((function(t){return t})))},t.prototype.getVictimContactPurposes=function(){return this.http.get(this.smartLookupServiceUrl+"VictimContactPurposes",R).pipe(a.map((function(t){return t})))},t.prototype.getVictimServiceTypes=function(){return this.http.get(this.smartLookupServiceUrl+"VictimServiceTypes",R).pipe(a.map((function(t){return t})))},t.prototype.getVictimServiceStatus=function(){return this.http.get(this.smartLookupServiceUrl+"VictimServiceStatus",R).pipe(a.map((function(t){return t})))},t.prototype.getvVictimServiceTypeProgramProviders=function(){return this.http.get(this.smartLookupServiceUrl+"vVictimServiceTypeProgramProviders",R).pipe(a.map((function(t){return t})))},t.prototype.getVictim=function(t){return this.http.get(this.smartVictimServiceUrl+"Victims/"+t,R).pipe(a.map((function(t){return console.log("victim return data"),console.log(t),t})))},t.prototype.getVictimAdvocate=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimAdvocates/"+t,R).pipe(a.map((function(t){return t})))},t.prototype.getVictimGuardian=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimGuardians/"+t,R).pipe(a.map((function(t){return t})))},t.prototype.postVictims=function(t){var e=JSON.stringify(t);return this.http.post(this.smartVictimServiceUrl+"Victims",e,R).pipe(a.map((function(t){return t})))},t.prototype.putVictims=function(t,e){var r=JSON.stringify(e);return this.http.put(this.smartVictimServiceUrl+"Victims/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.putVictimAdvocate=function(t,e){var r;return r=JSON.stringify(e),this.http.put(this.smartVictimServiceUrl+"VictimAdvocates/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.postVictimAdvocate=function(t,e){var r=JSON.stringify(e);return this.http.post(this.smartVictimServiceUrl+"VictimAdvocates/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.putVictimGuardian=function(t,e){console.log("update victim guardian"),console.log(e);var r=JSON.stringify(e);return this.http.put(this.smartVictimServiceUrl+"VictimGuardians/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.postVictimGuardian=function(t,e){var r=JSON.stringify(e);return this.http.post(this.smartVictimServiceUrl+"VictimGuardians/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.getVictimDrugUse=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimDrugUses/"+t,R).pipe(a.map((function(t){return t})))},t.prototype.putVictimDrugUse=function(t,e){var r=JSON.stringify(e);return this.http.put(this.smartVictimServiceUrl+"VictimDrugUses/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.postVictimDrugUse=function(t,e){var r=JSON.stringify(e);return this.http.post(this.smartVictimServiceUrl+"VictimDrugUses/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.putVictimWeaponUse=function(t,e){var r=JSON.stringify(e);return this.http.put(this.smartVictimServiceUrl+"VictimWeaponUses/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.postVictimWeaponUse=function(t,e){var r=JSON.stringify(e);return this.http.post(this.smartVictimServiceUrl+"VictimWeaponUses/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.putVictimSupport=function(t,e){var r=JSON.stringify(e);return this.http.put(this.smartVictimServiceUrl+"VictimSupports/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.postVictimSupport=function(t,e){var r=JSON.stringify(e);return this.http.post(this.smartVictimServiceUrl+"VictimSupports/"+t,r,R).pipe(a.map((function(t){return t})))},t.prototype.deleteVictims=function(t){return this.http.delete(this.smartVictimServiceUrl+"Victims/"+t,R).pipe(a.map((function(t){return t})))},t.prototype.getVictims=function(t){return this.http.get(this.smartVictimServiceUrl+"Victims/offender/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.getVictimsByFilter=function(t){return this.http.post(this.smartVictimServiceUrl+"/Victims",JSON.stringify(t),{headers:E}).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.getVictimListByFilter=function(t){return console.log("filer in service"),console.log(t),this.http.post(this.smartVictimServiceUrl+"vVictims/Filter",JSON.stringify(t),R).pipe()},t.prototype.getCasetNotes=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimCaseNotes/victim/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.addCaseNote=function(t){var e;return e=JSON.stringify(t),this.http.post(this.smartVictimServiceUrl+"VictimCaseNotes/",e,R)},t.prototype.updateCaseNote=function(t){var e;return e=JSON.stringify(t),this.http.put(this.smartVictimServiceUrl+"VictimCaseNotes/"+t.victimCaseNoteId,e,R)},t.prototype.deleteCaseNote=function(t,e){return this.http.delete(this.smartVictimServiceUrl+"VictimCaseNotes/"+t+"?staffId="+e)},t.prototype.getContacts=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimContacts/victim/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.addContact=function(t){var e;return e=JSON.stringify(t),this.http.post(this.smartVictimServiceUrl+"VictimContacts/",e,R)},t.prototype.updateContact=function(t){var e;return e=JSON.stringify(t),this.http.put(this.smartVictimServiceUrl+"VictimContacts/"+t.victimContactId,e,R)},t.prototype.getSafetyPlans=function(t){return this.http.get(this.smartVictimServiceUrl+"vVictimServiceLists/victim/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.getVictimServices=function(t){return this.http.get(this.smartVictimServiceUrl+"vVictimServiceLists/victimServiceId/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.getVictimServiceDetail=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimServiceDetails/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.addSafetyPlan=function(t){var e;return e=JSON.stringify(t),this.http.post(this.smartVictimServiceUrl+"VictimServices/",e,R).pipe()},t.prototype.updateSafetyPlan=function(t){var e;return e=JSON.stringify(t),this.http.put(this.smartVictimServiceUrl+"VictimServices/"+t.victimServiceId,e,R)},t.prototype.addVictimServiceStatus=function(t){var e;return e=JSON.stringify(t),this.http.post(this.smartVictimServiceUrl+"VictimServiceStatusHistories/",e,R)},t.prototype.getServiceStatusHistories=function(t){return this.http.get(this.smartVictimServiceUrl+"VictimServiceStatusHistories/victimServiceId/"+t).pipe(a.map((function(t){return t})),a.catchError(this.handleError))},t.prototype.deleteSafetyPlan=function(t,e){return this.http.delete(this.smartVictimServiceUrl+"VictimServices/"+t+"?staffId="+e)},t.prototype.addPlanProvider=function(t){var e;return e=JSON.stringify(t),this.http.post(this.smartVictimServiceUrl+"VictimServiceDetails/",e,R).pipe()},t.prototype.deleteProvider=function(t,e){return this.http.delete(this.smartVictimServiceUrl+"VictimServiceDetails/"+t+"?staffId="+e)},t.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:e.HttpClient},{type:String,decorators:[{type:r.Inject,args:[C]}]},{type:String,decorators:[{type:r.Inject,args:[D]}]},{type:String,decorators:[{type:r.Inject,args:[P]}]},{type:o.Apollo}]},t.ngInjectableDef=r.defineInjectable({factory:function(){return new t(r.inject(e.HttpClient),r.inject(C),r.inject(D),r.inject(P),r.inject(o.Apollo))},token:t,providedIn:"root"}),t}();new Headers({"Content-Type":"application/json"});var L=function(){function t(t,e){this.http=t,this.smartOffenderServiceUrl=e}return t.prototype.getIntakeByOffender=function(t){return this.http.get(this.smartOffenderServiceUrl+"IntakeBasic/offender/"+t).pipe()},t.prototype.updateIntakeSteps=function(t,e){return this.http.put(this.smartOffenderServiceUrl+"/IntakeStepStatus/"+t,e)},t.decorators=[{type:r.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:e.HttpClient},{type:String,decorators:[{type:r.Inject,args:[C]}]}]},t.ngInjectableDef=r.defineInjectable({factory:function(){return new t(r.inject(e.HttpClient),r.inject(C))},token:t,providedIn:"root"}),t}();var O=function(){function t(){}return t.PhysicalInformation="PHYSIN",t.Photo="PHOTOS",t.HousingInformation="HOUSE",t.DocketInformation="DOCKET",t.Alias="ALIAS",t.IntakeBasicInformation="INTKBI",t.ContactInformation="CONTCT",t.DeceasedInformation="DEATH",t.DriversLicense="DRVLIC",t.EmploymentInformation="EMPLOY",t.GangAffiliation="GANG",t.HealthInsurance="HLTHINS",t.Identification="IDNTFCTN",t.InternetIdentifier="INTERNETID",t.MilitaryService="MLTSVC",t.School="SCHOOL",t.SelectiveService="SLCTVSVC",t.Vehicle="VEHICLE",t.VictimInformation="VICTIM",t.WarrantInformation="WARRNT",t.RunningRecord="RUNREC",t.Signature="SIGN",t}();var B=function(){function t(t,e,r,i,a,o,n,l){this.dialog=t,this.victimService=e,this.router=r,this.route=i,this.snackBar=a,this.intakeService=o,this.smartWarrantUrl=n,this.document=l,this.appModuleId="",this.activatedRoute=null,this.victims=[],this.victimDetail={},this.showDetail=!1,this.victimListFilter=new N,this.victimListDataSource=new c.MatTableDataSource,this.doSpin=!1,this.showListFlag=!1,this.msg="",this.isIntake=!1}return t.prototype.applyFilter=function(t){this.victimListDataSource.filter=t.trim().toLowerCase()},t.prototype.addRecord=function(){this.showDetail=!0,this.showAdd=!1,this.victimDetail=null,this.showListFlag=!1},t.prototype.editVictimDetail=function(t){console.log("victim edit record"),console.log(t),console.log(t.victimId),this.victimDetail=t,this.showDetail=!0,this.showAdd=!1,this.showListFlag=!1},t.prototype.save=function(t){this.showDetail=!1,this.showAdd=!0,this.showListFlag=!0},t.prototype.cancel=function(){this.showDetail=!1,this.victimDetail={}},t.prototype.ngAfterViewInit=function(){this.victimListDataSource.paginator=this.paginator,this.victimListDataSource.sort=this.sort},t.prototype.ngOnChanges=function(){this.updateAccessControlConfig={accessType:s.AccessType.UPDATE,appModuleId:this.appModuleId,roleId:null,route:this.activatedRoute.snapshot},this.createAccessControlConfig={accessType:s.AccessType.CREATE,appModuleId:this.appModuleId,roleId:null,route:this.activatedRoute.snapshot},this.deleteAccessControlConfig={accessType:s.AccessType.DELETE,appModuleId:this.appModuleId,roleId:null,route:this.activatedRoute.snapshot}},t.prototype.ngOnInit=function(){var t=this,e=this.route.snapshot.data,r=this.router.url.slice(-10);if(console.log("smart-victim ngOnInit"),console.log(this.intakeFlag),console.log(r),(this.intakeFlag||"victimHome"==r)&&(this.isIntake=!0),this.displayedColumns=["lastName","firstName"],1!=this.showRelationshipColumn&&"victimList"!=r&&"victimHome"!=r||this.displayedColumns.push("relationship"),1==this.showOffenderNameColumn&&this.displayedColumns.push("offenderName"),1!=this.showOffenderPhoneColumn&&"victimList"!=r&&"victimHome"!=r||this.displayedColumns.push("homePhone"),this.displayedColumns.push("victimId"),1==this.showSearchForm&&(this.showListFlag=!1),console.log("this.showSearchForm"),console.log(this.showSearchForm),console.log("myPath"),console.log(r),0==this.showSearchForm||"victimList"==r||"victimHome"==r){var i;this.offenderId?i=this.offenderId:(console.log("back from previous page"),this.showAdd=!0,this.showRelationshipColumn=!0,this.showOffenderPhoneColumn=!0,this.accessByModule="true",this.showEdit="true",this.showCaseNote="true",this.showSafetyPlan="true",i=e.selectedOffender.offenderId);var a={offenderId:i,lastName:null,firstName:null,pdid:null,birthDate:null};console.log("victimListFilter in smar-victim componenet"),console.log(a),this.victimService.getVictimListByFilter(a).subscribe((function(e){t.victimListDataSource.data=e,t.victims=e,e.forEach((function(t){null!=t.homePhone&&""!=t.homePhone||(t.homePhone=t.cellPhone),null!=t.homePhone&&""!=t.homePhone||(t.homePhone=t.workPhone)})),console.log("victim data at line 179"),console.log(t.victims),console.log("showListFlag"),console.log(t.showListFlag),t.showListFlag=!0,0==e.length&&(t.msg="No Record Found!")}))}else console.log("find filter"),console.log(this.victimListFilter),!0===this.showListFlag&&null!=this.victimListFilter&&this.victimService.getVictimListByFilter(this.victimListFilter).subscribe((function(e){t.victimListDataSource.data=e,t.victims=e,console.log("victim data at line 201"),console.log(e)}))},t.prototype.formatPhoneNumber=function(t){if(!t)return"";var e=(""+t).replace(/\D/g,"").match(/^(\d{3})(\d{3})(\d{4})$/);return e?"("+e[1]+") "+e[2]+"-"+e[3]:""},t.prototype.saveIntake=function(){var t=this;if(this.isIntake){var e={intakeStepId:O.VictimInformation,offenderId:this.offenderId,modifiedBy:this.staffId};this.intakeService.updateIntakeSteps(this.offenderId,e).subscribe((function(e){console.log("save intake step."),t.snackBar.open("Status Saved.","",{duration:3e3}),t.document.location.href=t.smartWarrantUrl+"/warrant"}))}},t.prototype.goToCaseNote=function(t){this.router.navigate(["casenote",t])},t.prototype.goToSaftyPlan=function(t){this.router.navigate(["saftyPlan",t])},t.prototype.getVictimList=function(t){var e=this;this.victimListFilter=t,console.log("this.victimListFilter inside getVictimList"),console.log(this.victimListFilter),this.doSpin=!0,this.victimService.getVictimListByFilter(t).subscribe((function(t){e.victimListDataSource.data=t,e.doSpin=!e.doSpin,t.length>0?e.showListFlag=!0:e.msg="No record found!"}),(function(t){e.doSpin=!e.doSpin}))},t.decorators=[{type:r.Component,args:[{selector:"csmart-victim",template:'<div *ngIf="showSearchForm">\r\n <app-victim-search-form\r\n (onSearch)="getVictimList($event)">\r\n </app-victim-search-form>\r\n</div>\r\n\r\n<div *ngIf="showDetail">\r\n <csmart-victim-detail [victimDetail]="victimDetail" \r\n [staffId]="staffId"\r\n [offenderId] ="offenderId"\r\n [isIntake]="isIntake"\r\n (onSave)="save($event)" \r\n (onCancel)="cancel()" >\r\n</csmart-victim-detail>\r\n</div>\r\n<div class="main-container">\r\n \r\n <div class="add-action" *ngIf="showAdd">\r\n <button mat-raised-button color="primary" \r\n accessControl\r\n [accessControlConfig]="createAccessControlConfig" \r\n (click)="addRecord()">\r\n <mat-icon>add</mat-icon>\r\n Add Victim\r\n </button>\r\n &nbsp;&nbsp;\r\n\r\n <div *ngIf="isIntake">\r\n <button \r\n mat-raised-button \r\n color="primary" \r\n accessControl\r\n [accessControlConfig]="updateAccessControlConfig" \r\n (click)="saveIntake()">\r\n Continue\r\n </button> \r\n </div>\r\n\r\n </div>\r\n <div *ngIf="showListFlag">\r\n <mat-card id="divVictim" >\r\n <mat-card-content >\r\n <mat-table #table [dataSource]="victimListDataSource" >\r\n\r\n <ng-container matColumnDef="lastName">\r\n <mat-header-cell *matHeaderCellDef>Victim Last Name</mat-header-cell>\r\n <mat-cell *matCellDef="let row" > {{row.lastName}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef="firstName">\r\n <mat-header-cell *matHeaderCellDef >Victim First Name</mat-header-cell>\r\n <mat-cell *matCellDef="let row" > {{row.firstName}} </mat-cell>\r\n </ng-container>\r\n \r\n <div *ngIf="showRelationshipColumn">\r\n <ng-container matColumnDef="relationship">\r\n <mat-header-cell *matHeaderCellDef >Relationship to Offender</mat-header-cell>\r\n <mat-cell *matCellDef="let row" > {{row.relationship}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf="showOffenderPhoneColumn">\r\n <ng-container matColumnDef="homePhone">\r\n <mat-header-cell *matHeaderCellDef >Phone Number</mat-header-cell>\r\n <mat-cell *matCellDef="let row" > {{formatPhoneNumber(row.homePhone)}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n \r\n <div *ngIf="showOffenderNameColumn">\r\n <ng-container matColumnDef="offenderName">\r\n <mat-header-cell *matHeaderCellDef>Offender Name</mat-header-cell>\r\n <mat-cell *matCellDef="let row" > {{row.offenderName}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n \r\n <ng-container matColumnDef="victimId">\r\n <mat-header-cell *matHeaderCellDef ></mat-header-cell>\r\n <mat-cell *matCellDef="let row" >\r\n \r\n \x3c!-- <div *ngIf="accessByModule">\r\n <mat-checkbox></mat-checkbox>\r\n </div> --\x3e\r\n \r\n <div *ngIf="showEdit">\r\n <button class="edit-btn" mat-icon-button color="primary" matTooltip="View/Edit Victim"\r\n accessControl\r\n [accessControlConfig]="updateAccessControlConfig" \r\n (click)="editVictimDetail(row)">\r\n <i class="material-icons">mode_edit</i>\r\n </button>\r\n </div>\r\n\r\n \r\n\r\n &nbsp;&nbsp; \r\n\r\n <div *ngIf="showCaseNote">\r\n <button type="button" matTooltip="CaseNote" mat-raised-button color="primary" \r\n accessControl\r\n [accessControlConfig]="updateAccessControlConfig" \r\n (click)="goToCaseNote(row.victimId)"> \r\n <span class="glyphicon glyphicon-pencil" ></span>&nbsp;Case Note\r\n </button> \r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n <div *ngIf="showSafetyPlan">\r\n <button type="button" matTooltip="safety plan" mat-raised-button color="primary"\r\n accessControl\r\n [accessControlConfig]="updateAccessControlConfig" \r\n (click)="goToSaftyPlan(row.victimId)"> \r\n <span class="glyphicon glyphicon-pencil" ></span>&nbsp;Safety Plan\r\n </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="displayedColumns" class="example-header-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns: displayedColumns" class="example-row"></mat-row>\r\n </mat-table>\r\n\r\n <mat-paginator #paginator [pageSize]="10" [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator> \r\n </mat-card-content>\r\n </mat-card>\r\n </div>\r\n\r\n <div>\r\n <b>{{msg}}</b>\r\n </div>\r\n</div>',styles:['div.services{max-width:500px;margin:auto;border:3px solid #73ad21}.rTable{display:block;width:100%}.rTableBody,.rTableFoot,.rTableHeading,.rTableRow{clear:both}.rTableFoot,.rTableHead{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.victimSearch{display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-description,.example-headers-align .mat-expansion-panel-header-title{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-firstName,.mat-column-homePhone,.mat-column-lastName,.mat-column-offenderName,.mat-column-relationship{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}']}]}],t.ctorParameters=function(){return[{type:m.MatDialog},{type:U},{type:l.Router},{type:l.ActivatedRoute},{type:m.MatSnackBar},{type:L},{type:String,decorators:[{type:r.Inject,args:[w]}]},{type:void 0,decorators:[{type:r.Inject,args:[n.DOCUMENT]}]}]},t.propDecorators={offenderId:[{type:r.Input}],staffId:[{type:r.Input}],staffRole:[{type:r.Input}],showCaseNote:[{type:r.Input}],showSafetyPlan:[{type:r.Input}],showAdd:[{type:r.Input}],showEdit:[{type:r.Input}],showRelationshipColumn:[{type:r.Input}],showOffenderNameColumn:[{type:r.Input}],showOffenderPhoneColumn:[{type:r.Input}],showSearchForm:[{type:r.Input}],accessByModule:[{type:r.Input}],intakeFlag:[{type:r.Input}],appModuleId:[{type:r.Input}],activatedRoute:[{type:r.Input}],paginator:[{type:r.ViewChild,args:[m.MatPaginator]}],sort:[{type:r.ViewChild,args:[m.MatSort]}]},t}();var H=function(){function t(t){this.commondialogRef=t,this.cmdYesTitle="Yes",this.cmdNoTitle="No"}return t.prototype.ngOnInit=function(){},t.decorators=[{type:r.Component,args:[{selector:"app-common-dialog",template:'\r\n \r\n <mat-card class="example-card"> \r\n <mat-card-content>\r\n <p>{{ title }}</p>\r\n <p>{{ message }}</p>\r\n <br>\r\n\r\n <div class="inner">\r\n <button type="button" mat-raised-button color="primary"\r\n (click)="commondialogRef.close(true)">{{cmdYesTitle}}</button>\r\n </div>\r\n &nbsp;&nbsp;\r\n \r\n <div *ngIf="cmdYesTitle!==\'Ok\'" class="inner">\r\n <button type="button" mat-raised-button color="primary" \r\n (click)="commondialogRef.close()">{{cmdNoTitle}}</button>\r\n \r\n </div>\r\n \r\n \r\n </mat-card-content>\r\n </mat-card>',styles:[".md-dialog-container{position:fixed;top:0!important;overflow:hidden}.inner{display:inline-block}"]}]}],t.ctorParameters=function(){return[{type:m.MatDialogRef}]},t}();var q=function(){function t(t){this.dialog=t}return t.prototype.confirm=function(t,e,r,i){var a;return(a=this.dialog.open(H)).componentInstance.title=t,a.componentInstance.message=e,a.componentInstance.cmdYesTitle=r,a.componentInstance.cmdNoTitle=i,a.afterClosed()},t.prototype.warning=function(t,e,r){var i;return(i=this.dialog.open(H)).componentInstance.title=t,i.componentInstance.message=e,i.componentInstance.cmdYesTitle=r,i.afterClosed()},t.decorators=[{type:r.Injectable}],t.ctorParameters=function(){return[{type:m.MatDialog}]},t}();function W(t,e,r){return function(i){if(!i.parent)return null;var a=null;if("YS"==t()&&(a=e(i)),r&&a){var o={};o[r]=a,a=o}return a}}var G=function(){function t(t,e,i,a,o,l,m,s){this.location=t,this.formBuilder=e,this.dialog=i,this.route=a,this.router=o,this.snackBar=l,this.commonDialogService=m,this.victimService=s,this.victimDetail={},this.onSave=new r.EventEmitter,this.onCancel=new r.EventEmitter,this.hidden=!0,this.victimAdvocate={},this.victimGuardian={},this.guardianTabFlag=!1,this.advocateTabFlag=!1,this.commonChildrenDivFlag=!1,this.cpoExpirationDivFlag=!1,this.supportInPlaceDivFlag=!1,this.weaponInvolvedDivFlag=!1,this.drugUseDivFlag=!1,this.showDelete=!1,this.addressId=0,this.advocateAddressId=0,this.guardianAddressId=0,this.datePipe=new n.DatePipe("en-US"),this.emailPattern="^[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,4}$",this.phoneNumber="\\d{10}",this.editVictim={},this.otherWeaponFlag=!1,this.otherDrugFlag=!1,this.contactDataSource=new c.MatTableDataSource,this.guardianPhoneExistFlag=!1,this.advocatePhoneExistFlag=!1,this.phoneValidationFlag=!1,this.guaridanNoPhoneChkFlag=!0,this.advocateNoPhoneChkFlag=!0,this.addressValidators={street:[],street2:[],city:[],stateCode:[],zipCode:[],psaCode:[]},this.initForm()}return t.prototype.initForm=function(){var t=this;this.victimForm=this.formBuilder.group({underSupervisionFlag:new d.FormControl("",d.Validators.compose([d.Validators.required])),victimOffenderRelationshipTypeId:new d.FormControl("",d.Validators.compose([d.Validators.required])),lastName:new d.FormControl("",d.Validators.compose([d.Validators.required])),firstName:new d.FormControl("",d.Validators.compose([d.Validators.required])),middleName:new d.FormControl(""),prefixId:new d.FormControl(""),suffixId:new d.FormControl(""),genderCode:new d.FormControl(""),birthDate:new d.FormControl(""),homePhone:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.phoneNumber)])),cellPhone:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.phoneNumber)])),workPhone:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.phoneNumber)])),email:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.emailPattern)])),minorFlag:new d.FormControl("",d.Validators.compose([d.Validators.required])),victimAdvocateFlag:new d.FormControl("",d.Validators.compose([d.Validators.required])),guardianLastName:new d.FormControl(""),guardianFirstName:new d.FormControl(""),guardianPrefixId:new d.FormControl(""),guardianSuffixId:new d.FormControl(""),guardianBirthDate:new d.FormControl(""),guardianNoPhoneFlag:new d.FormControl(!0),guardianHomePhone:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.phoneNumber)])),guardianCellPhone:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.phoneNumber)])),guardianWorkPhone:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.phoneNumber)])),guardianEmail:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.emailPattern)])),advocateNoPhoneFlag:new d.FormControl(!0),advocateWorkPhone:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.phoneNumber)])),advocateHomePhone:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.phoneNumber)])),advocateCellPhone:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.phoneNumber)])),advocateSuffixId:new d.FormControl(""),advocatePrefixId:new d.FormControl(""),advocateFirstName:new d.FormControl("",W((function(){return t.victimForm.get("victimAdvocateFlag").value}),d.Validators.required,"illuminatiError")),advocateLastName:new d.FormControl("",W((function(){return t.victimForm.get("victimAdvocateFlag").value}),d.Validators.required,"illuminatiError")),advocateEmail:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.emailPattern)])),emergencyContact:new d.FormControl(""),emergencyContactPhone:new d.FormControl("",d.Validators.compose([d.Validators.pattern(this.phoneNumber)])),emergencyChildren:new d.FormControl(""),emergencyCpo:new d.FormControl(""),emergencyDrug:new d.FormControl(""),emergencySupport:new d.FormControl(""),emergencyWeapon:new d.FormControl(""),drug:new d.FormControl(""),weapon:new d.FormControl(""),support:new d.FormControl(""),commonChildrenFlag:new d.FormControl(""),commonChildrenNumber:new d.FormControl(""),cpoExpirationFlag:new d.FormControl(""),cpoExpirationDate:new d.FormControl(""),accessRisk:new d.FormControl(""),drugUseFlag:new d.FormControl(""),supportInPlaceFlag:new d.FormControl(""),weaponInvolvedFlag:new d.FormControl(""),otherWeapon:new d.FormControl(""),otherDrug:new d.FormControl(""),alcoholUseFlag:new d.FormControl(""),victimSupports:new d.FormControl(""),victimWeaponUses:new d.FormControl(""),victimDrugUses:new d.FormControl(""),allowCsosaContactFlag:new d.FormControl("")}),this.victimForm.markAsPristine(),this.victimForm.markAsUntouched()},t.prototype._getVictim=function(){var t=this;if(0!==this.victimId)return 1==this.editMode?(console.log("find victim id inside getVictim"),console.log(this.victimId),void 0===this.victimId&&(this.sub=this.route.params.subscribe((function(e){t.victimId=e.victimId,console.log("my this.victimId"),console.log(t.victimId)}))),void this.victimService.getVictim(this.victimId).subscribe((function(e){console.log("victim data 1"),console.log(e),t.editVictim=e;var r=[];t.editVictim.victimSupports.forEach((function(t){r.push(t.victimSupportTypeId)})),t.victimForm.get("victimSupports").setValue(r);var i=[],a="";t.editVictim.victimWeaponUses.forEach((function(e){i.push(e.weaponTypeId),"OTHER"==e.weaponTypeId&&(a=e.otherWeapon,t.otherWeaponFlag=!0)})),t.victimForm.get("victimWeaponUses").setValue(i),t.victimForm.get("otherWeapon").setValue(a);var o=[],n="";console.log("load this.editVictim.victimDrugUses"),console.log(t.editVictim.victimDrugUses),t.editVictim.victimDrugUses.forEach((function(e){null===e.drugTypeId&&(n=e.otherDrug,t.otherDrugFlag=!0,e.drugTypeId="OTHER"),o.push(e.drugTypeId)})),console.log("this.editVictim.victimDrugUses after push"),console.log(o),t.victimForm.get("victimDrugUses").setValue(o),t.victimForm.get("otherDrug").setValue(n),t.victimService.getContacts(t.victimId).subscribe((function(e){console.log("contactList"),console.log(e),t.contactList=e,t.contactDataSource.data=t.contactList})),!1===t.editVictim.guardianNoPhoneFlag&&t.victimForm.patchValue({guardianNoPhoneFlag:!1}),!1===t.editVictim.advocateNoPhoneFlag&&t.victimForm.patchValue({advocateNoPhoneFlag:!1})}),(function(e){t.snackBar.open("Error occured while retriving Victim Information. Please try again.")}))):void 0},t.prototype.ngOnChanges=function(){},t.prototype.onAddressChange=function(t){this.victimForm.patchValue({addressId:t}),this.addressId=t},t.prototype.onGuardianAddressChange=function(t){this.victimForm.patchValue({guardianAddressId:t}),this.guardianAddressId=t},t.prototype.onAdvocateAddressChange=function(t){this.victimForm.patchValue({advocateAddressId:t}),this.advocateAddressId=t},t.prototype.cancel=function(){this.victimForm.reset()},t.prototype.ngOnInit=function(){var t=this;console.log("show offenderId"),console.log(this.offenderId),console.log("show staffId"),console.log(this.staffId),console.log("show isIntake"),console.log(this.isIntake);var e={get:function(){if(this._required)return this._required;if(this.ngControl&&this.ngControl.control&&this.ngControl.control.validator){var t=Object.assign({},this.ngControl.control);return t.value=null,"required"in(this.ngControl.control.validator(t)||{})}return!1},set:function(t){this._required=h.coerceBooleanProperty(t)}};if(Object.defineProperty(m.MatInput.prototype,"required",e),Object.defineProperty(m.MatSelect.prototype,"required",e),Object.defineProperty(m.MatRadioGroup.prototype,"required",e),null!=this.victimDetail){if(this.editMode=!0,this.showDelete=!0,this.victimId=this.victimDetail.victimId,this.guardianTabFlag=this.victimDetail.minorFlag,"YS"==this.victimDetail.victimAdvocateFlag&&(this.advocateTabFlag=!0),1==this.otherWeaponFlag)this.victimForm.get("otherWeapon").setValidators(d.Validators.required);if(1==this.otherDrugFlag)this.victimForm.get("otherDrug").setValidators(d.Validators.required);this.cpoExpirationDivFlag=this.victimDetail.cpoExpirationFlag,this.commonChildrenDivFlag=this.victimDetail.commonChildrenFlag,this.supportInPlaceDivFlag=this.victimDetail.supportInPlaceFlag,this.weaponInvolvedDivFlag=this.victimDetail.weaponInvolvedFlag,this.drugUseDivFlag=this.victimDetail.drugUseFlag,this.addressId=this.victimDetail.addressId,this.guardianAddressId=this.victimDetail.guardianAddressId,this.advocateAddressId=this.victimDetail.advocateAddressId,this._getVictim()}else this.victimForm.patchValue({guardianNoPhoneFlag:!0}),this.victimForm.patchValue({advocateNoPhoneFlag:!0});this.victimService.getFlagOptionYesNoUnknowns().subscribe((function(e){t.flagOption=e})),this.victimService.getGenders().subscribe((function(e){t.genders=e})),this.victimService.getPrefixes().subscribe((function(e){t.prefixes=e})),this.victimService.getSuffixes().subscribe((function(e){t.suffixes=e})),this.victimService.getRelationshipTypes().subscribe((function(e){t.relationshipTypes=e.filter((function(t){return"ST"===t.relationshipCategoryId||"FM"===t.relationshipCategoryId}))})),this.victimService.getSupportTypes().subscribe((function(e){t.victimSupportTypes=e})),this.victimService.getWeaponTypes().subscribe((function(e){t.weaponTypes=e})),this.victimService.getDrugsTypes().subscribe((function(e){console.log("drug lookup items"),console.log(e),t.drugs=e,t.drugs.push({drugTypeId:"OTHER",name:"Other"}),console.log(t.drugs)})),this.victimForm.get("minorFlag").valueChanges.subscribe((function(e){t.victimForm.get("guardianWorkPhone").updateValueAndValidity(),t.victimForm.get("guardianHomePhone").updateValueAndValidity(),t.victimForm.get("guardianCellPhone").updateValueAndValidity()})),this.victimForm.get("victimAdvocateFlag").valueChanges.subscribe((function(e){t.victimForm.get("advocateFirstName").updateValueAndValidity(),t.victimForm.get("advocateLastName").updateValueAndValidity(),t.victimForm.get("advocateWorkPhone").updateValueAndValidity(),t.victimForm.get("advocateHomePhone").updateValueAndValidity(),t.victimForm.get("advocateCellPhone").updateValueAndValidity()}))},t.prototype.back=function(){this.router.navigate(["victimList"])},t.prototype.deleteVictim=function(){var t=this;this.commonDialogService.confirm("","Do you want to delete this Victim?","Yes","No").subscribe((function(e){t.result=e,t.result&&(t.victimService.deleteVictims(t.victimDetail.victimId).subscribe((function(e){t.snackBar.open("Delete Successfully!","",{duration:3e3})})),t.onSave.emit(t.victimDetail))}))},t.prototype.radioMinorChange=function(t){!0===t.value?this.guardianTabFlag=!0:this.guardianTabFlag=!1},t.prototype.radioAdvocateChange=function(t){var e=this.victimForm.get("advocateLastName"),r=this.victimForm.get("advocateFirstName");"YS"===t.value?(this.advocateTabFlag=!0,e.setValidators(d.Validators.required),r.setValidators(d.Validators.required)):(this.advocateTabFlag=!1,e.clearValidators(),r.clearValidators()),e.updateValueAndValidity(),r.updateValueAndValidity()},t.prototype.radioCicChange=function(t){!0===t.value?(this.commonChildrenDivFlag=!0,this.setValidators("commonChildren")):this.commonChildrenDivFlag=!1},t.prototype.setValidators=function(t){"commonChildren"==t?(this.victimForm.get("commonChildrenNumber").clearValidators(),this.victimForm.get("commonChildrenNumber").setValidators(d.Validators.required)):"cpo"==t&&(this.victimForm.get("cpoExpirationDate").clearValidators(),this.victimForm.get("cpoExpirationDate").setValidators(d.Validators.required))},t.prototype.radioSupportChange=function(t){!0===t.value?this.supportInPlaceDivFlag=!0:this.supportInPlaceDivFlag=!1},t.prototype.radioWeaponChange=function(t){!0===t.value?this.weaponInvolvedDivFlag=!0:this.weaponInvolvedDivFlag=!1},t.prototype.radioDrugChange=function(t){!0===t.value?this.drugUseDivFlag=!0:this.drugUseDivFlag=!1},t.prototype.radioCpoChange=function(t){!0===t.value?(this.cpoExpirationDivFlag=!0,this.setValidators("cpo")):this.cpoExpirationDivFlag=!1},t.prototype.handleDOBChange=function(t){var e=Date.now()-t.value,r=new Date(e);Math.abs(r.getUTCFullYear()-1970)<=18&&(this.snackBar.open("Victim is a Minor. This information is a sensitive and should not be disclosed to any unauthorized parties. Contact the legal guardian.","",{duration:6e3}),this.victimForm.get("minorFlag").setValue(!0),this.guardianTabFlag=!0)},t.prototype.checkOtherWeapon=function(t){var e=this.victimForm.get("otherWeapon");t.includes("OTHER")?(this.otherWeaponFlag=!0,e.setValidators(d.Validators.required)):(this.otherWeaponFlag=!1,e.clearValidators()),e.updateValueAndValidity()},t.prototype.checkOtherDrug=function(t){var e=this.victimForm.get("otherDrug");t.includes("OTHER")?(this.otherDrugFlag=!0,e.setValidators(d.Validators.required)):(this.otherDrugFlag=!1,e.clearValidators()),e.updateValueAndValidity()},t.prototype.saveVictim=function(){var t=this;if(this.victimForm.value.guardianNoPhoneFlag||(this.victimForm.value.guardianHomePhone&&null!==this.victimForm.value.guardianHomePhone&&""!==this.victimForm.value.guardianHomePhone&&(this.guardianPhoneExistFlag=!0),void 0!==this.victimForm.value.guardianWorkPhone&&null!==this.victimForm.value.guardianWorkPhone&&""!==this.victimForm.value.guardianWorkPhone&&(this.guardianPhoneExistFlag=!0),this.victimForm.value.guardianCellPhone&&null!==this.victimForm.value.guardianCellPhone&&""!==this.victimForm.value.guardianCellhone&&(this.guardianPhoneExistFlag=!0)),console.log("this.victimForm.value.guardianNoPhoneFlag"),console.log(this.victimForm.value.guardianNoPhoneFlag),console.log("this.guardianPhoneExistFlag"),console.log(this.guardianPhoneExistFlag),!1===this.guardianPhoneExistFlag&&!1===this.victimForm.value.guardianNoPhoneFlag&&(this.phoneValidationFlag=!0,this.commonDialogService.warning("","Please check the guardian phone field. You have to fill one of the three phone fileds.","Ok").subscribe((function(e){t.result=e}))),console.log("this.phoneValidationFlag"),console.log(this.phoneValidationFlag),this.victimForm.value.advocateNoPhoneFlag||(this.victimForm.value.advocateHomePhone&&null!==this.victimForm.value.advocateHomePhone&&""!==this.victimForm.value.advocateHomePhone&&(this.advocatePhoneExistFlag=!0),void 0!==this.victimForm.value.advocateWorkPhone&&null!==this.victimForm.value.advocateWorkPhone&&""!==this.victimForm.value.advocateWorkPhone&&(this.advocatePhoneExistFlag=!0),this.victimForm.value.advocateCellPhone&&null!==this.victimForm.value.advocateCellPhone&&""!==this.victimForm.value.advocateCellhone&&(this.advocatePhoneExistFlag=!0)),console.log("this.victimForm.value.advocateNoPhoneFlag"),console.log(this.victimForm.value.advocateNoPhoneFlag),console.log("this.advocatePhoneExistFlag"),console.log(this.advocatePhoneExistFlag),!1===this.advocatePhoneExistFlag&&!1===this.victimForm.value.advocateNoPhoneFlag&&(this.phoneValidationFlag=!0,this.commonDialogService.warning("","Please check the advocate phone field. You have to fill one of the three phone fileds.","Ok").subscribe((function(e){t.result=e}))),console.log("this.phoneValidationFlag 1"),console.log(this.phoneValidationFlag),!1===this.phoneValidationFlag)if(null===this.victimDetail){var e=[];this.victimForm.value.victimSupports&&this.victimForm.value.victimSupports.forEach((function(r){var i={};i.victimId=t.victimForm.value.victimId,i.victimSupportTypeId=r,i.modifiedBy=t.staffId,e.push(i)}));var r=[];console.log("this.victimForm.value.victimDrugUses during save"),console.log(this.victimForm.value.victimDrugUses),this.victimForm.value.victimDrugUses&&this.victimForm.value.victimDrugUses.forEach((function(e){var i={};i.drugTypeId=e,"OTHER"===e||""===e||null===e?(i.drugTypeId=null,i.otherDrug=t.victimForm.value.otherDrug):(i.drugTypeId=e,i.otherDrug=null),i.modifiedBy=t.staffId,i.victimId=t.victimForm.value.victimId,r.push(i)})),console.log("this.victimForm.value.victimDrugUses during save 1"),console.log(this.victimForm.value.victimDrugUses);var i=[];this.victimForm.value.victimWeaponUses&&this.victimForm.value.victimWeaponUses.forEach((function(e){var r={};r.victimId=t.victimForm.value.victimId,r.weaponTypeId=e,r.otherWeapon="OTHER"==e?t.victimForm.value.otherWeapon:null,r.modifiedBy=t.staffId,i.push(r)}));var a={victimId:0,offenderId:this.offenderId,victimOffenderRelationshipTypeId:this.victimForm.value.victimOffenderRelationshipTypeId,lastName:this.victimForm.value.lastName,firstName:this.victimForm.value.firstName,middleName:this.victimForm.value.middleName?this.victimForm.value.middleName:null,prefixId:this.victimForm.value.prefixId?this.victimForm.value.prefixId:null,suffixId:this.victimForm.value.suffixId?this.victimForm.value.suffixId:null,birthDate:this.victimForm.value.birthDate?this.victimForm.value.birthDate:null,genderCode:this.victimForm.value.genderCode?this.victimForm.value.genderCode:null,underSupervisionFlag:this.victimForm.value.underSupervisionFlag,minorFlag:this.victimForm.value.minorFlag,victimAdvocateFlag:this.victimForm.value.victimAdvocateFlag,homePhone:this.victimForm.value.homePhone?this.victimForm.value.homePhone:null,workPhone:this.victimForm.value.workPhone?this.victimForm.value.workPhone:null,cellPhone:this.victimForm.value.cellPhone?this.victimForm.value.cellPhone:null,email:this.victimForm.value.email?this.victimForm.value.email:null,addressId:this.victimForm.value.addressId?this.victimForm.value.addressId:1,emergencyContact:this.victimForm.value.emergencyContact?this.victimForm.value.emergencyContact:null,emergencyContactPhone:this.victimForm.value.emergencyContactPhone?this.victimForm.value.emergencyContactPhone:null,commonChildrenFlag:this.victimForm.value.commonChildrenFlag,commonChildrenNumber:this.victimForm.value.commonChildrenNumber,cpoExpirationFlag:this.victimForm.value.cpoExpirationFlag,cpoExpirationDate:this.victimForm.value.cpoExpirationDate?this.datePipe.transform(this.victimForm.value.startDate,"short"):null,supportInPlaceFlag:this.victimForm.value.supportInPlaceFlag,weaponInvolvedFlag:this.victimForm.value.weaponInvolvedFlag,drugUseFlag:this.victimForm.value.drugUseFlag,alcoholUseFlag:this.victimForm.value.alcoholUseFlag,accessRisk:this.victimForm.value.accessRisk,modifiedBy:this.staffId,vVictimAdvocate:null,vVictimGuardian:null,victimDrugUses:r,victimSupports:e,victimWeaponUses:i,advocateFirstName:null,advocateLastName:null,advocateEmail:null,advocatePrefixId:null,advocateSuffixId:null,advocateNoPhoneFlag:null,advocateHomePhone:null,advocateWorkPhone:null,advocateCellPhone:null,advocateAddressId:null,guardianFirstName:null,guardianLastName:null,guardianEmail:null,guardianPrefixId:null,guardianSuffixId:null,guardianNoPhoneFlag:null,guardianHomePhone:null,guardianWorkPhone:null,guardianCellPhone:null,guardianAddressId:null,guardianBirthDate:null,relationship:null,allowCsosaContactFlag:null};0==this.addressId?a.addressId=null:a.addressId=this.addressId,a.advocateAddressId=this.advocateAddressId,a.guardianAddressId=this.guardianAddressId,console.log("newVictim"),console.log(a),this.victimService.postVictims(a).subscribe((function(e){var r=e?e.victimId:"";if("YS"==t.victimForm.value.victimAdvocateFlag){console.log("add advocate");var i={victimAdvocateId:r,lastName:t.victimForm.value.advocateLastName,firstName:t.victimForm.value.advocateFirstName,prefixId:t.victimForm.value.advocatePrefixId,suffixId:t.victimForm.value.advocateSuffixId,addressId:t.advocateAddressId?t.advocateAddressId:null,noPhoneFlag:t.victimForm.value.advocateNoPhoneFlag?t.victimForm.value.advocateNoPhoneFlag:null,homePhone:t.victimForm.value.advocateHomePhone,workPhone:t.victimForm.value.advocateWorkPhone,cellPhone:t.victimForm.value.advocateCellPhone,email:t.victimForm.value.advocateEmail,modifiedBy:t.staffId};t.victimService.postVictimAdvocate(r,i).subscribe()}if(1==t.victimForm.value.minorFlag){var a={victimGuardianId:r,lastName:t.victimForm.value.guardianLastName,firstName:t.victimForm.value.guardianFirstName,prefixId:t.victimForm.value.guardianPrefixId,suffixId:t.victimForm.value.guardianSuffixId,birthDate:t.victimForm.value.guardianBirthDate,addressId:t.guardianAddressId?t.guardianAddressId:null,noPhoneFlag:t.victimForm.value.guardianNoPhoneFlag?t.victimForm.value.guardianNoPhoneFlag:null,homePhone:t.victimForm.value.guardianHomePhone,workPhone:t.victimForm.value.guardianWorkPhone,cellPhone:t.victimForm.value.guardianCellPhone,email:t.victimForm.value.guardianEmail,modifiedBy:t.staffId};t.victimService.postVictimGuardian(r,a).subscribe()}t.snackBar.open("Add Victim Successfully!","",{duration:3e3}),!0===t.isIntake?t.router.navigate(["victimHome"]):t.router.navigate(["victimList"])}))}else this.victimDetail.underSupervisionFlag=this.victimForm.value.underSupervisionFlag,this.victimDetail.victimOffenderRelationshipTypeId=this.victimForm.value.victimOffenderRelationshipTypeId,this.victimDetail.lastName=this.victimForm.value.lastName,this.victimDetail.firstName=this.victimForm.value.firstName,this.victimDetail.middleName=this.victimForm.value.middleName,this.victimDetail.prefixId=this.victimForm.value.prefixId?this.victimForm.value.prefixId:null,this.victimDetail.suffixId=this.victimForm.value.suffixId?this.victimForm.value.suffixId:null,this.victimDetail.birthDate=this.victimForm.value.birthDate,this.victimDetail.genderCode=this.victimForm.value.genderCode,this.victimDetail.minorFlag=this.victimForm.value.minorFlag,this.victimDetail.homePhone=this.victimForm.value.homePhone?this.victimForm.value.homePhone:null,this.victimDetail.workPhone=this.victimForm.value.workPhone?this.victimForm.value.workPhone:null,this.victimDetail.cellPhone=this.victimForm.value.cellPhone?this.victimForm.value.cellPhone:null,this.victimDetail.email=this.victimForm.value.email,this.victimDetail.victimAdvocateFlag=this.victimForm.value.victimAdvocateFlag,this.victimDetail.emergencyContact=this.victimForm.value.emergencyContact,this.victimDetail.emergencyContactPhone=this.victimForm.value.emergencyContactPhone?this.victimForm.value.emergencyContactPhone:null,this.victimDetail.commonChildrenFlag=this.victimForm.value.commonChildrenFlag,this.victimDetail.commonChildrenNumber=this.victimForm.value.commonChildrenNumber,this.victimDetail.cpoExpirationDate=this.victimForm.value.cpoExpirationDate,this.victimDetail.cpoExpirationFlag=this.victimForm.value.cpoExpirationFlag,this.victimDetail.supportInPlaceFlag=this.victimForm.value.supportInPlaceFlag,this.victimDetail.weaponInvolvedFlag=this.victimForm.value.weaponInvolvedFlag,this.victimDetail.drugUseFlag=this.victimForm.value.drugUseFlag,this.victimDetail.alcoholUseFlag=this.victimForm.value.alcoholUseFlag,this.victimDetail.accessRisk=this.victimForm.value.accessRisk,this.victimDetail.addressId=this.addressId,this.victimDetail.allowCsosaContactFlag=this.victimForm.value.allowCsosaContactFlag,this.victimDetail.victimSupports=[],this.victimForm.value.victimSupports.forEach((function(e){var r={};r.victimId=t.victimDetail.victimId,r.victimSupportTypeId=e,r.modifiedBy=t.staffId,t.victimDetail.victimSupports.push(r)})),this.victimDetail.victimDrugUses=[],console.log("this.victimForm.value.victimDrugUses calculate"),console.log(this.victimForm.value.victimDrugUses),this.victimForm.value.victimDrugUses.forEach((function(e){var r={};r.drugTypeId=e,console.log("this.victimForm.value.victimDrugUses before"),console.log(t.victimForm.value.victimDrugUses),"OTHER"===e||""===e?(r.drugTypeId=null,r.otherDrug=t.victimForm.value.otherDrug):(r.drugTypeId=e,r.otherDrug=null),r.modifiedBy=t.staffId,r.victimId=t.victimDetail.victimId,t.victimDetail.victimDrugUses.push(r),console.log("this.victimForm.value.victimDrugUses after"),console.log(t.victimForm.value.victimDrugUses)})),this.victimForm.value.victimDrugUses.filter((function(t){return!(null===t.drugTypeId&&null===t.otherDrug)})),console.log("adjust this.victimForm.value.victimDrugUses "),console.log(this.victimForm.value.victimDrugUses),this.victimDetail.victimWeaponUses=[],this.victimForm.value.victimWeaponUses.forEach((function(e){var r={};r.victimId=t.victimDetail.victimId,r.weaponTypeId=e,console.log("weapon element"),console.log(e),console.log(t.victimForm.value.otherWeapon),console.log(t.victimForm.value.victimWeaponUses),r.otherWeapon="OTHER"==e?t.victimForm.value.otherWeapon:null,r.modifiedBy=t.staffId,t.victimDetail.victimWeaponUses.push(r)})),console.log("this.victimDetail before emit"),console.log(this.victimDetail),this.victimService.putVictims(this.victimDetail.victimId,this.victimDetail).subscribe((function(e){t.snackBar.open("Update Successfully!","",{duration:3e3}),t.victimAdvocate.victimAdvocateId=t.victimDetail.victimId,t.victimAdvocate.lastName=t.victimForm.value.advocateLastName,t.victimAdvocate.firstName=t.victimForm.value.advocateFirstName,t.victimAdvocate.prefixId=t.victimForm.value.advocatePrefixId?t.victimForm.value.advocatePrefixId:null,t.victimAdvocate.suffixId=t.victimForm.value.advocateSuffixId?t.victimForm.value.advocateSuffixId:null,t.victimAdvocate.addressId=t.advocateAddressId?t.advocateAddressId:null,t.victimAdvocate.noPhoneFlag=!!t.victimForm.value.advocateNoPhoneFlag,t.victimAdvocate.homePhone=t.victimForm.value.advocateHomePhone?t.victimForm.value.advocateHomePhone:null,t.victimAdvocate.workPhone=t.victimForm.value.advocateWorkPhone?t.victimForm.value.advocateWorkPhone:null,t.victimAdvocate.cellPhone=t.victimForm.value.advocateCellPhone?t.victimForm.value.advocateCellPhone:null,t.victimAdvocate.email=t.victimForm.value.advocateEmail?t.victimForm.value.advocateEmail:null,t.victimAdvocate.modifiedBy=t.staffId,console.log("work on advocate part"),"YS"==t.victimDetail.victimAdvocateFlag&&(console.log("work on advocate flag is YS "),null!=t.victimDetail.advocateFirstName?(console.log("check advocate fisrt name "),console.log(t.victimDetail.advocateFirstName),t.victimService.putVictimAdvocate(t.victimDetail.victimId,t.victimAdvocate).subscribe((function(t){}))):(console.log("add advocate"),console.log(t.victimAdvocate),t.victimService.postVictimAdvocate(t.victimDetail.victimId,t.victimAdvocate).subscribe())),t.victimGuardian.victimGuardianId=t.victimDetail.victimId,t.victimGuardian.lastName=t.victimForm.value.guardianLastName,t.victimGuardian.firstName=t.victimForm.value.guardianFirstName,t.victimGuardian.prefixId=t.victimForm.value.guardianPrefixId?t.victimForm.value.guardianPrefixId:null,t.victimGuardian.suffixId=t.victimForm.value.guardianSuffixId?t.victimForm.value.guardianSuffixId:null,t.victimGuardian.addressId=t.guardianAddressId?t.guardianAddressId:null,t.victimGuardian.noPhoneFlag=!!t.victimForm.value.guardianNoPhoneFlag,t.victimGuardian.homePhone=t.victimForm.value.guardianHomePhone?t.victimForm.value.guardianHomePhone:null,t.victimGuardian.workPhone=t.victimForm.value.guardianWorkPhone?t.victimForm.value.guardianWorkPhone:null,t.victimGuardian.cellPhone=t.victimForm.value.guardianCellPhone?t.victimForm.value.guardianCellPhone:null,t.victimGuardian.email=t.victimForm.value.guardianEmail?t.victimForm.value.guardianEmail:null,t.victimGuardian.modifiedBy=t.staffId,1==t.victimDetail.minorFlag&&(null!=t.victimDetail.guardianFirstName?t.victimService.putVictimGuardian(t.victimDetail.victimId,t.victimGuardian).subscribe((function(t){})):(console.log("add gurdian"),console.log(t.victimGuardian),t.victimService.postVictimGuardian(t.victimDetail.victimId,t.victimGuardian).subscribe()))}));console.log("this.victimDetail"),console.log(this.victimDetail),this.onSave.emit(this.victimDetail)},t.prototype.addContact=function(){this.router.navigate(["victimContact",this.victimId])},t.prototype.formatLabel=function(t){return t},t.decorators=[{type:r.Component,args:[{selector:"csmart-victim-detail",template:'<mat-card>\r\n <mat-card-content>\r\n\r\n <div [formGroup]="victimForm">\r\n\r\n <mat-tab-group dynamicHeight mat-stretch-tabs>\r\n <mat-tab label="Victim Detail" >\r\n <div class=\'container\'>\r\n\r\n <mat-form-field>\r\n <mat-label>Is victim a minor?<font color="red">* </font></mat-label>\r\n <br>\r\n <mat-radio-group formControlName="minorFlag" (change)="radioMinorChange($event)" [(ngModel)]="editVictim.minorFlag" >\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n <div class="help-block" *ngIf="victimForm.get(\'minorFlag\').errors \r\n && (victimForm.get(\'minorFlag\').dirty || victimForm.get(\'minorFlag\').touched)">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Does the Victim have a Victim Advocate or Social Worker with <br>whom CSOSA should maintain contact?<font color="red">* </font></mat-label>\r\n <br>\r\n <br>\r\n <mat-radio-group class = "tp-radio-group" formControlName="victimAdvocateFlag" (change)="radioAdvocateChange($event)" [(ngModel)]="editVictim.victimAdvocateFlag">\r\n <mat-radio-button color="primary" *ngFor="let item of flagOption" [value]="item.flagOptionYesNoUnknownId">{{item.name}} </mat-radio-button>&nbsp;\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n <div class="help-block" *ngIf="victimForm.get(\'victimAdvocateFlag\').errors \r\n && (victimForm.get(\'victimAdvocateFlag\').dirty || victimForm.get(\'victimAdvocateFlag\').touched)">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n \r\n \r\n <mat-form-field>\r\n <mat-label>Victim Currently Under Supervision:</mat-label>\r\n <mat-select formControlName="underSupervisionFlag" name="supervision" [(ngModel)]="editVictim.underSupervisionFlag" >\r\n <mat-option *ngFor="let item of flagOption" [value]="item.flagOptionYesNoUnknownId" >\r\n {{item.name}}</mat-option>\r\n </mat-select>\r\n <div class="help-block" *ngIf="victimForm.get(\'underSupervisionFlag\').errors \r\n && (victimForm.get(\'underSupervisionFlag\').dirty || victimForm.get(\'underSupervisionFlag\').touched)">\r\n <mat-error>under supervision field is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n \r\n \r\n <mat-form-field>\r\n <mat-label>Relationship to Offender:</mat-label>\r\n <mat-select formControlName="victimOffenderRelationshipTypeId" [(ngModel)]="editVictim.victimOffenderRelationshipTypeId" >\r\n <mat-option *ngFor="let item of relationshipTypes" [value]="item.relationshipTypeId">{{item.name}}</mat-option>\r\n </mat-select>\r\n <div class="help-block" *ngIf="victimForm.get(\'victimOffenderRelationshipTypeId\').errors \r\n && (victimForm.get(\'victimOffenderRelationshipTypeId\').dirty || victimForm.get(\'victimOffenderRelationshipTypeId\').touched)">\r\n <mat-error>relationship is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n \r\n \r\n <mat-form-field>\r\n <mat-label>Victim Last Name:</mat-label>\r\n <input matInput formControlName="lastName" [(ngModel)]="editVictim.lastName" >\r\n <div class="help-block" *ngIf="victimForm.get(\'lastName\').errors \r\n && (victimForm.get(\'lastName\').dirty || victimForm.get(\'lastName\').touched)">\r\n <mat-error>victim last name is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim First Name: </mat-label>\r\n <input matInput formControlName="firstName" [(ngModel)]="editVictim.firstName" >\r\n <div class="help-block" *ngIf="victimForm.get(\'firstName\').errors \r\n && (victimForm.get(\'firstName\').dirty || victimForm.get(\'firstName\').touched)">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Middle Name:</mat-label>\r\n <input matInput formControlName="middleName" [(ngModel)]="editVictim.middleName">\r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Victim Prefix:</mat-label>\r\n <mat-select formControlName="prefixId" [(ngModel)]="editVictim.prefixId">\r\n <mat-option *ngFor="let item of prefixes" [value]="item.prefixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Suffix:</mat-label>\r\n <mat-select formControlName="suffixId" [(ngModel)]="editVictim.suffixId">\r\n <mat-option *ngFor="let item of suffixes" [value]="item.suffixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Victim Gender:</mat-label>\r\n <mat-select formControlName="genderCode" [(ngModel)]="editVictim.genderCode">\r\n <mat-option *ngFor="let item of genders" [value]="item.genderCode">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput \r\n [matDatepicker]="victimBirthRef" \r\n formControlName="birthDate"\r\n [(ngModel)]="editVictim.birthDate"\r\n (click)="victimBirthRef.open()"\r\n (dateChange)="handleDOBChange($event)" \r\n >\r\n <mat-datepicker-toggle [for]="victimBirthRef" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #victimBirthRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Home Phone:</mat-label>\r\n <input \r\n matInput \r\n formControlName="homePhone" \r\n [(ngModel)]="editVictim.homePhone" \r\n phoneMask\r\n maxlength="14"/>\r\n\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'homePhone\').errors\r\n && (victimForm.get(\'homePhone\').dirty || victimForm.get(\'homePhone\').touched)">\r\n\r\n\r\n <mat-error><strong>Home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Cell Phone:</mat-label>\r\n <input matInput formControlName="cellPhone" [(ngModel)]="editVictim.cellPhone" >\r\n <div class="help-block" *ngIf="victimForm.get(\'cellPhone\').errors \r\n && (victimForm.get(\'cellPhone\').dirty || victimForm.get(\'cellPhone\').touched)">\r\n <mat-error><strong>Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n \r\n <mat-form-field >\r\n <mat-label>Victim Work Phone:</mat-label>\r\n <input matInput formControlName="workPhone" [(ngModel)]="editVictim.workPhone" >\r\n <div class="help-block" *ngIf="victimForm.get(\'workPhone\').errors \r\n && (victimForm.get(\'workPhone\').dirty || victimForm.get(\'workPhone\').touched)">\r\n <mat-error><strong>Work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Email:</mat-label>\r\n <input matInput formControlName="email" [(ngModel)]="editVictim.email" >\r\n <div class="help-block" *ngIf="victimForm.get(\'email\').errors \r\n && (victimForm.get(\'email\').dirty || victimForm.get(\'email\').touched)">\r\n <mat-error><strong>victim email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n \r\n <div></div>\r\n \r\n \x3c!-- <app-smart-address \r\n [showPsa]="true" \r\n [modifiedBy]="staffId" \r\n [id]="addressId"\r\n (addressIdChange)="onAddressChange($event)"\r\n [outline]="true" \r\n readonly="false"\r\n [rowHeight]="80" \r\n (isValid)="false" \r\n [addressValidators]="addressValidators"\r\n #addressComponent\r\n > --\x3e\r\n\r\n\r\n <app-smart-address\r\n [modifiedBy]="staffId"\r\n [id]="addressId"\r\n [outline]="true"\r\n [showPsa]="true"\r\n [addressValidators]="addressValidators"\r\n [readonly]="false"\r\n (addressIdChange)="onAddressChange($event)"\r\n #addressComponent\r\n >\r\n\r\n </app-smart-address>\r\n \r\n \r\n \x3c!-- Docket: \r\n <div>\r\n <div *ngFor="let docket of docketlist; let i=index">\r\n <mat-checkbox >{{docket.docketNumber}}</mat-checkbox>\r\n </div>\r\n </div> --\x3e\r\n\r\n <mat-checkbox color="primary" formControlName="allowCsosaContactFlag" name="allowCsosaContactFlag" [(ngModel)]="editVictim.allowCsosaContactFlag">victim wants to be contacted by CSOSA</mat-checkbox>\r\n \r\n </div> \r\n\r\n <mat-card>\r\n <mat-form-field>\r\n <mat-label> Children in Common</mat-label>\r\n <br>\r\n <mat-radio-group formControlName="commonChildrenFlag" [(ngModel)]="editVictim.commonChildrenFlag" (change)="radioCicChange($event)">\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n\r\n <div *ngIf="commonChildrenDivFlag">\r\n \r\n <mat-form-field >\r\n <mat-label>\r\n Children number\r\n </mat-label>\r\n <input matInput formControlName="commonChildrenNumber" [(ngModel)]="editVictim.commonChildrenNumber" >\r\n </mat-form-field>\r\n \r\n </div>\r\n \r\n <mat-form-field>\r\n <mat-label>CPO: </mat-label>\r\n <br>\r\n <mat-radio-group formControlName="cpoExpirationFlag" [(ngModel)]="editVictim.cpoExpirationFlag" (change)="radioCpoChange($event)">\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n <div *ngIf="cpoExpirationDivFlag"> \r\n <mat-form-field>\r\n <mat-label>Expiration Date: </mat-label>\r\n <input matInput \r\n [matDatepicker]="cpoDateRef" \r\n formControlName="cpoExpirationDate" \r\n (click)="cpoDateRef.open()" \r\n [(ngModel)]="editVictim.cpoExpirationDate" >\r\n <mat-datepicker-toggle [for]="cpoDateRef" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #cpoDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n </div>\r\n \r\n <br>\r\n <br>\r\n \r\n <mat-form-field>\r\n <mat-label>Victim has a Support System in Place? </mat-label>\r\n <br>\r\n <mat-radio-group formControlName="supportInPlaceFlag" [(ngModel)]="editVictim.supportInPlaceFlag" (change)="radioSupportChange($event)">\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n <div *ngIf="supportInPlaceDivFlag"> \r\n <mat-form-field>\r\n <mat-label>Support type? </mat-label>\r\n <mat-select #supportSel formControlName="victimSupports" [(ngModel)]="editVictim.victimSupports" multiple>\r\n <div (mouseleave)="supportSel.close()">\r\n <mat-option color="primary" *ngFor="let item of victimSupportTypes" [value]="item.victimSupportTypeId">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n\r\n </div>\r\n \r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Weapons Involved?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName="weaponInvolvedFlag" (change)="radioWeaponChange($event)" [(ngModel)]="editVictim.weaponInvolvedFlag" >\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n \r\n <div *ngIf="weaponInvolvedDivFlag"> \r\n <mat-form-field>\r\n <mat-label>Weapon Type</mat-label>\r\n <mat-select #weaponSel formControlName="victimWeaponUses" multiple [(ngModel)]="editVictim.victimWeaponUses" (selectionChange)="checkOtherWeapon($event.value)" >\r\n <div (mouseleave)="weaponSel.close()">\r\n <mat-option color="primary" *ngFor="let item of weaponTypes" [value]="item.weaponTypeId">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div *ngIf="otherWeaponFlag"> \r\n <mat-form-field>\r\n <mat-label>Other Weapon:* </mat-label>\r\n <input matInput formControlName="otherWeapon" >\r\n </mat-form-field>\r\n <div class="help-block" *ngIf="victimForm.get(\'otherWeapon\').errors \r\n && (victimForm.get(\'otherWeapon\').dirty || victimForm.get(\'otherWeapon\').touched)">\r\n <mat-error><strong>Other weapon is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n\r\n \r\n <br>\r\n <br>\r\n \r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of alcohol at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName="alcoholUseFlag" [(ngModel)]="editVictim.alcoholUseFlag" >\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of drugs at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName="drugUseFlag" (change)="radioDrugChange($event)" [(ngModel)]="editVictim.drugUseFlag" >\r\n <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color="primary" [value]="false">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n <div *ngIf="drugUseDivFlag"> \r\n <mat-form-field>\r\n <mat-label>Drug:</mat-label>\r\n <mat-select #drugSel formControlName="victimDrugUses" multiple (selectionChange)="checkOtherDrug($event.value)" >\r\n <div (mouseleave)="drugSel.close()">\r\n <mat-option color="primary" *ngFor="let item of drugs" [value]="item.drugTypeId">\r\n {{item.name}}\r\n </mat-option>\r\n \r\n </div>\r\n </mat-select>\r\n <input matInput placeholder="" style="display: none">\r\n </mat-form-field>\r\n \r\n </div>\r\n\r\n <div *ngIf="otherDrugFlag"> \r\n <mat-form-field>\r\n <mat-label>Other Drug:* </mat-label>\r\n <input matInput formControlName="otherDrug" >\r\n </mat-form-field>\r\n <div class="help-block" *ngIf="victimForm.get(\'otherDrug\').errors \r\n && (victimForm.get(\'otherDrug\').dirty || victimForm.get(\'otherDrug\').touched)">\r\n <mat-error><strong>Other drug is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div>\r\n <div>\r\n <mat-label>\r\n Access Risk: 1 thru 10 (10 greatest risk): &nbsp;<b> {{editVictim.accessRisk}}</b>\r\n </mat-label>\r\n </div>\r\n <div>\r\n \r\n <mat-slider\r\n formControlName="accessRisk"\r\n thumbLabel="true"\r\n [displayWith]="formatLabel"\r\n min="1"\r\n max="10"\r\n [(ngModel)]="editVictim.accessRisk" \r\n ></mat-slider>\r\n \r\n </div>\r\n\r\n </div>\r\n\r\n </mat-card> \r\n\r\n \r\n <br><br><br> \r\n </mat-tab>\r\n \r\n <mat-tab *ngIf="guardianTabFlag" label="Legal Guardian">\r\n <div class=\'container\'>\r\n <mat-form-field>\r\n <mat-label>Guardian Last Name:</mat-label>\r\n <input matInput formControlName="guardianLastName" [(ngModel)]="editVictim.guardianLastName" > \r\n \x3c!-- <div class="help-block" *ngIf="victimForm.get(\'guardianLastName\').errors ">\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div> --\x3e\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian First Name:</mat-label>\r\n <input matInput formControlName="guardianFirstName" [(ngModel)]="editVictim.guardianFirstName" >\r\n \x3c!-- <div class="help-block" *ngIf="victimForm.get(\'guardianFirstName\').errors ">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div> --\x3e\r\n \r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Guardian Prefix:</mat-label>\r\n <mat-select formControlName="guardianPrefixId" [(ngModel)]="editVictim.guardianPrefixId" >\r\n <mat-option *ngFor="let item of prefixes" [value]="item.prefixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Suffix:</mat-label>\r\n <mat-select formControlName="guardianSuffixId" [(ngModel)]="editVictim.guardianSuffixId" >\r\n <mat-option *ngFor="let item of suffixes" [value]="item.suffixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n \r\n \x3c!-- <mat-form-field>\r\n <mat-select placeholder="Choose" formControlName="guardianGender" [(ngModel)]="editVictim.guardianGender">\r\n <mat-option *ngFor="let item of genders" [value]="item.genderCode">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field> --\x3e\r\n \r\n \r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput \r\n [matDatepicker]="guardianDateRef" \r\n formControlName="guardianBirthDate"\r\n [(ngModel)]="editVictim.guardianBirthDate" \r\n (click)="guardianDateRef.open()" \r\n >\r\n <mat-datepicker-toggle [for]="guardianDateRef" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #guardianDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <mat-form-field >\r\n <mat-checkbox \r\n color = "primary" \r\n formControlName="guardianNoPhoneFlag" \r\n \r\n >\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder="" style="display: none;">\r\n </mat-form-field>\r\n\r\n\r\n <div></div>\r\n <mat-card>\r\n <mat-form-field >\r\n <mat-label>Guardian Home Phone:</mat-label>\r\n <input matInput \r\n formControlName="guardianHomePhone" \r\n [(ngModel)]="editVictim.guardianHomePhone" \r\n phoneMask\r\n maxlength="14" >\r\n \r\n <div class="help-block" *ngIf="victimForm.get(\'guardianHomePhone\').errors \r\n && (victimForm.get(\'guardianHomePhone\').dirty || victimForm.get(\'guardianHomePhone\').touched)">\r\n <mat-error><strong>Guardian home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n \r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Cell Phone:</mat-label>\r\n <input matInput \r\n formControlName="guardianCellPhone" \r\n [(ngModel)]="editVictim.guardianCellPhone" \r\n phoneMask\r\n maxlength="14" \r\n >\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianCellPhone\').errors \r\n && (victimForm.get(\'guardianCellPhone\').dirty || victimForm.get(\'guardianCellPhone\').touched)">\r\n <mat-error><strong>Guardian Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n \r\n\r\n \r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Work Phone:</mat-label>\r\n <input matInput \r\n formControlName="guardianWorkPhone" \r\n [(ngModel)]="editVictim.guardianWorkPhone" \r\n phoneMask\r\n maxlength="14" >\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianWorkPhone\').errors \r\n && (victimForm.get(\'guardianWorkPhone\').dirty || victimForm.get(\'guardianWorkPhone\').touched)">\r\n <mat-error><strong>Guardian work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n \r\n \r\n </mat-form-field>\r\n </mat-card>\r\n \r\n <div></div>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Email:</mat-label>\r\n <input matInput formControlName="guardianEmail" [(ngModel)]="editVictim.guardianEmail" >\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianEmail\').errors \r\n && (victimForm.get(\'guardianEmail\').dirty || victimForm.get(\'guardianEmail\').touched)">\r\n <mat-error><strong>Guardian email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n \r\n <div>\r\n <app-smart-address \r\n\r\n [showPsa]="true" \r\n [modifiedBy]="staffId" \r\n [id]="guardianAddressId"\r\n (addressIdChange)="onGuardianAddressChange($event)"\r\n [outline]="true" \r\n readonly="false"\r\n [rowHeight]="80" \r\n (isValid)="false" \r\n [addressValidators]="addressValidators"\r\n #guardianAddressComponent\r\n >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n \r\n <br><br><br> \r\n </mat-tab>\r\n \r\n \x3c!--advocate--\x3e\r\n \r\n <mat-tab *ngIf="advocateTabFlag" label="Advocate" > \r\n <div class=\'container\'>\r\n \r\n <mat-form-field>\r\n <mat-label>Advocate Last Name:</mat-label>\r\n <input matInput formControlName="advocateLastName" [(ngModel)]="editVictim.advocateLastName" >\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateLastName\').errors ">\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Advocate First Name:</mat-label>\r\n <input matInput formControlName="advocateFirstName" [(ngModel)]="editVictim.advocateFirstName" >\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateFirstName\').errors ">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Prefix:</mat-label>\r\n <mat-select formControlName="advocatePrefixId" [(ngModel)]="editVictim.advocatePrefixId" >\r\n <mat-option *ngFor="let item of prefixes" [value]="item.prefixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Suffix:</mat-label>\r\n <mat-select formControlName="advocateSuffixId" [(ngModel)]="editVictim.advocateSuffixId" >\r\n <mat-option *ngFor="let item of suffixes" [value]="item.suffixId">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n \r\n <mat-form-field>\r\n <mat-checkbox \r\n color = "primary" \r\n formControlName="advocateNoPhoneFlag" \r\n \r\n [(ngModel)]="editVictim.advocateNoPhoneFlag" >\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder="" style="display: none;">\r\n </mat-form-field>\r\n\r\n <div></div> \r\n <mat-card> \r\n <mat-form-field >\r\n <mat-label>Advocate Home Phone:</mat-label>\r\n <input matInput \r\n formControlName="advocateHomePhone" \r\n [(ngModel)]="editVictim.advocateHomePhone"\r\n phoneMask\r\n maxlength="14" >\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateHomePhone\').errors \r\n && (victimForm.get(\'advocateHomePhone\').dirty || victimForm.get(\'advocateHomePhone\').touched)">\r\n <mat-error><strong>Advocate home number format is not correct.</strong></mat-error>\r\n </div>\r\n \r\n </mat-form-field>\r\n \r\n <mat-form-field>\r\n <mat-label>Advocate Cell Phone:</mat-label>\r\n <input matInput \r\n formControlName="advocateCellPhone" \r\n [(ngModel)]="editVictim.advocateCellPhone" \r\n phoneMask\r\n maxlength="14">\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateCellPhone\').errors \r\n && (victimForm.get(\'advocateCellPhone\').dirty || victimForm.get(\'advocateCellPhone\').touched)">\r\n <mat-error><strong>Advocate cell number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n \r\n </mat-form-field> \r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Work Phone:</mat-label>\r\n <input matInput \r\n formControlName="advocateWorkPhone" \r\n [(ngModel)]="editVictim.advocateWorkPhone" \r\n phoneMask\r\n maxlength="14"\r\n >\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateWorkPhone\').errors \r\n && (victimForm.get(\'advocateWorkPhone\').dirty || victimForm.get(\'advocateWorkPhone\').touched)">\r\n <mat-error><strong>Advocate work number format is not correct.</strong></mat-error>\r\n </div>\r\n \r\n </mat-form-field>\r\n </mat-card>\r\n\r\n <div></div>\r\n \r\n <mat-form-field>\r\n <mat-label>Advocate Email:</mat-label>\r\n <input matInput formControlName="advocateEmail" [(ngModel)]="editVictim.advocateEmail" >\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateEmail\').errors \r\n && (victimForm.get(\'advocateEmail\').dirty || victimForm.get(\'advocateEmail\').touched)">\r\n <mat-error><strong>Advocate email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n\r\n \r\n <div >\r\n <app-smart-address \r\n [showPsa]="true" \r\n [modifiedBy]="staffId" \r\n [id]="advocateAddressId"\r\n (addressIdChange)="onAdvocateAddressChange($event)"\r\n [outline]="true" \r\n readonly="false"\r\n [rowHeight]="80" \r\n (isValid)="false" \r\n [addressValidators]="addressValidators"\r\n #advocateAddressComponent >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n <br><br><br> \r\n </mat-tab>\r\n \r\n \r\n <mat-tab label="Emergency Contact">\r\n <div class=\'container\'>\r\n \r\n <mat-form-field>\r\n <mat-label>Emergency Contact Name:</mat-label>\r\n <input matInput formControlName="emergencyContact" [(ngModel)]="editVictim.emergencyContact" >\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Emergency Phone Number:</mat-label>\r\n <input matInput formControlName="emergencyContactPhone" [(ngModel)]="editVictim.emergencyContactPhone" >\r\n <div class="help-block" *ngIf="victimForm.get(\'emergencyContactPhone\').errors \r\n && (victimForm.get(\'emergencyContactPhone\').dirty || victimForm.get(\'emergencyContactPhone\').touched)">\r\n <mat-error><strong>Emergency contact number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n </div>\r\n <br><br><br> \r\n </mat-tab> \r\n \r\n </mat-tab-group>\r\n <div class=\'outer\'>\r\n <div>\r\n All buttons apply to all tabs. If save button is grey, please check each tab to make sure the required field is filled.<br><br>\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'minorFlag\').errors \r\n && (victimForm.get(\'minorFlag\').dirty || victimForm.get(\'minorFlag\').touched)">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div>\r\n \r\n <div class="help-block" *ngIf="victimForm.get(\'victimAdvocateFlag\').errors \r\n && (victimForm.get(\'victimAdvocateFlag\').dirty || victimForm.get(\'victimAdvocateFlag\').touched)">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div> \r\n \r\n <div class="help-block" *ngIf="victimForm.get(\'underSupervisionFlag\').errors \r\n && (victimForm.get(\'underSupervisionFlag\').dirty || victimForm.get(\'underSupervisionFlag\').touched)">\r\n <mat-error>Under supervision field is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'victimOffenderRelationshipTypeId\').errors \r\n && (victimForm.get(\'victimOffenderRelationshipTypeId\').dirty || victimForm.get(\'victimOffenderRelationshipTypeId\').touched)">\r\n <mat-error>Relationship is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'lastName\').errors \r\n && (victimForm.get(\'lastName\').dirty || victimForm.get(\'lastName\').touched)">\r\n <mat-error>Victim last name is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'firstName\').errors \r\n && (victimForm.get(\'firstName\').dirty || victimForm.get(\'firstName\').touched)">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianFirstName\').errors \r\n && (victimForm.get(\'guardianFirstName\').dirty || victimForm.get(\'guardianFirstName\').touched)">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'guardianLastName\').errors\r\n && (victimForm.get(\'guardianLastName\').dirty || victimForm.get(\'guardianLastName\').touched)" >\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'advocateLastName\').errors\r\n && (victimForm.get(\'advocateLastName\').dirty || victimForm.get(\'advocateLastName\').touched)" >\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div> \r\n \r\n <div class="help-block" *ngIf="victimForm.get(\'advocateFirstName\').errors\r\n && (victimForm.get(\'advocateFirstName\').dirty || victimForm.get(\'advocateFirstName\').touched)">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n \r\n <div class="help-block" *ngIf="victimForm.get(\'otherWeapon\').errors \r\n && (victimForm.get(\'otherWeapon\').dirty || victimForm.get(\'otherWeapon\').touched)">\r\n <mat-error>Other weapon field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class="help-block" *ngIf="victimForm.get(\'otherDrug\').errors \r\n && (victimForm.get(\'otherDrug\').dirty || victimForm.get(\'otherDrug\').touched)">\r\n <mat-error>Other drug field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n\r\n </div>\r\n \r\n <div class="inner">\r\n <button mat-raised-button color="primary" (click)="saveVictim()" [disabled]="!victimForm.valid" >Save </button> \r\n </div>\r\n &nbsp;&nbsp;\r\n <div *ngIf="showDelete" class="inner">\r\n <button mat-raised-button color="primary" (click)="deleteVictim()">Delete </button>\r\n </div>\r\n &nbsp;&nbsp; \r\n <div class="inner">\r\n <button mat-raised-button color="primary" (click)="cancel()">Clear </button>\r\n </div>\r\n &nbsp;&nbsp; \r\n <button mat-raised-button color="primary" (click)="back()">Back</button>\r\n\r\n </div>\r\n\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div align="right">\r\n <button mat-raised-button color="primary" (click)="addContact()" >Add victim contact</button>\r\n </div>\r\n \r\n <div>\r\n\r\n <mat-table #table [dataSource]="contactDataSource" class="example-table">\r\n <ng-container matColumnDef="contactDate">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.contactDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef="victimContactMethod">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact Method</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.victimContactMethod}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="nextContactDate">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Next Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.nextContactDate | date}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef="staff">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact By</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.staff}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="comment">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="contactId">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell"></mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell">\r\n \r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="[\'contactDate\', \'victimContactMethod\',\'nextContactDate\', \'staff\', \'comment\', \'contactId\']" class="example-header-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns:[\'contactDate\', \'victimContactMethod\',\'nextContactDate\', \'staff\', \'comment\', \'contactId\'];" class="example-row"></mat-row>\r\n </mat-table>\r\n\r\n\r\n </div>\r\n \r\n </mat-card-content>\r\n</mat-card>\r\n',providers:[q],styles:["mat-form-field{width:100%}.container{margin:16px;display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}@media only screen and (max-width:1120px){.container{display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr;grid-row-gap:15px}}@media only screen and (max-width:675px){.container{display:flex;flex-direction:column}}#outer{width:100%;text-align:center}.inner{display:inline-block}.tp-radio-group{display:flex;justify-content:space-between}"]}]}],t.ctorParameters=function(){return[{type:n.Location},{type:d.FormBuilder},{type:m.MatDialog},{type:l.ActivatedRoute},{type:l.Router},{type:m.MatSnackBar},{type:q},{type:U}]},t.propDecorators={victimDetail:[{type:r.Input}],staffId:[{type:r.Input}],offenderId:[{type:r.Input}],isIntake:[{type:r.Input}],onSave:[{type:r.Output}],onCancel:[{type:r.Output}]},t}();var _=function(){function t(t,e){this.dialogRef=t,this.data=e}return t.prototype.onNoClick=function(){this.dialogRef.close()},t.prototype.ngOnInit=function(){},t.decorators=[{type:r.Component,args:[{selector:"csmart-victim-delete-confirm",template:'\n <h1 mat-dialog-title>Delete Confirmation</h1>\n <div mat-dialog-content>\n <p>Are you sure you want to delete this item?</p>\n </div>\n <div mat-dialog-actions class="actions">\n <button mat-flat-button color="primary" (click)="onNoClick()">No</button>\n <button mat-flat-button color="warn" [mat-dialog-close]=\'"YES"\' cdkFocusInitial>Yes</button>\n </div>\n ',styles:["\n .actions{\n display: flex;\n justify-content: space-between; \n }\n "]}]}],t.ctorParameters=function(){return[{type:f.MatDialogRef},{type:void 0,decorators:[{type:r.Inject,args:[f.MAT_DIALOG_DATA]}]}]},t}();var j=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[m.MatButtonModule,m.MatCardModule,m.MatCheckboxModule,m.MatToolbarModule,m.MatSelectModule,m.MatDatepickerModule,m.MatNativeDateModule,m.MatDialogModule,m.MatTabsModule,m.MatListModule,m.MatInputModule,m.MatStepperModule,g.BrowserAnimationsModule,m.MatGridListModule,m.MatProgressSpinnerModule,m.MatTableModule,m.MatSidenavModule,m.MatRadioModule,y.MatIconModule,m.MatSliderModule,m.MatChipsModule,b.MatSnackBarModule,u.CdkTableModule,m.MatSortModule,m.MatPaginatorModule,m.MatExpansionModule,m.MatRippleModule],exports:[m.MatButtonModule,m.MatCardModule,m.MatCheckboxModule,m.MatToolbarModule,m.MatSelectModule,m.MatDatepickerModule,m.MatNativeDateModule,m.MatDialogModule,m.MatTabsModule,m.MatListModule,m.MatInputModule,m.MatStepperModule,g.BrowserAnimationsModule,m.MatGridListModule,m.MatProgressSpinnerModule,m.MatTableModule,m.MatSidenavModule,m.MatRadioModule,y.MatIconModule,m.MatSliderModule,m.MatChipsModule,b.MatSnackBarModule,u.CdkTableModule,m.MatSortModule,m.MatPaginatorModule,m.MatExpansionModule,m.MatRippleModule],entryComponents:[]}]}],t}(),Y=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[j],exports:[H],declarations:[H],providers:[H],entryComponents:[H]}]}],t}();function z(){return function(t){var e=t.value;return new Date(e)>new Date?{date:"future Date is Not Allowed"}:null}}var $=function(){function t(t,e,r,i,a,o,n){this.formBuilder=t,this._victimServicesComponent=e,this.commonDialogService=r,this.snackBar=i,this.route=a,this.router=o,this.smartAuthService=n,this.editCaseNote={},this.caseNoteDataSource=new m.MatTableDataSource,this.initForm()}return t.prototype.initForm=function(){this.caseNoteForm=this.formBuilder.group({caseNoteDate:new d.FormControl("",d.Validators.compose([d.Validators.required,z()])),contactType:new d.FormControl("",d.Validators.required),contactPurpose:new d.FormControl("",d.Validators.required),comment:new d.FormControl("",d.Validators.required)}),this.caseNoteForm.markAsPristine(),this.caseNoteForm.markAsUntouched()},t.prototype.ngAfterViewInit=function(){this.smartAuthService.setPermission("Victim",this.route.snapshot)},t.prototype.ngOnInit=function(){var t=this,e=this.route.snapshot.data;this.loginStaff=e.loginStaff,this.staffId=this.loginStaff.staffId,this.sub=this.route.params.subscribe((function(e){t.victimId=e.victimId})),this.addDisableFlag=!1,this.hiddenDetailFlag=!0,this.hiddenAddNewFlag=!1,this._victimServicesComponent.getVictim(this.victimId).subscribe((function(e){t.victimName=e.firstName+", "+e.lastName})),this._victimServicesComponent.getContactTypes().subscribe((function(e){t.contactTypes=e})),this._victimServicesComponent.getVictimContactPurposes().subscribe((function(e){t.contactPurposes=e})),this._victimServicesComponent.getCasetNotes(this.victimId).subscribe((function(e){console.log("caseNoteList"),console.log(e),t.caseNoteList=e,t.caseNoteDataSource.data=t.caseNoteList}))},t.prototype.onEditCaseNote=function(t){this.hiddenDetailFlag=!1,this.hiddenAddNewFlag=!0,this.addDisableFlag=!0,this.editCaseNote=this.caseNoteList.find((function(e){return e.victimCaseNoteId===t}))},t.prototype.onDeleteCaseNote=function(t){var e=this;this.commonDialogService.confirm("","Do you want to delete this case note?","Yes","No").subscribe((function(r){e.result=r,e.result&&e._victimServicesComponent.deleteCaseNote(t,e.staffId).subscribe((function(t){e.snackBar.open("delete Successfully !","",{duration:3e3}),e._victimServicesComponent.getCasetNotes(e.victimId).subscribe((function(t){e.caseNoteList=t,e.caseNoteDataSource.data=e.caseNoteList}))}))}))},t.prototype.onAddNew=function(){this.hiddenDetailFlag=!1,this.editCaseNote.victimCaseNoteId=0;var t=this.caseNoteForm.get("caseNoteDate");t.setValue(null),t.setErrors(null),t.markAsPristine(),t.markAsPristine();var e=this.caseNoteForm.get("contactType");e.setValue(null),e.setErrors(null),e.markAsPristine(),e.markAsUntouched();var r=this.caseNoteForm.get("contactPurpose");r.setValue(null),r.setErrors(null),r.markAsPristine(),r.markAsUntouched();var i=this.caseNoteForm.get("comment");i.setValue(null),i.setErrors(null),i.markAsPristine(),i.markAsUntouched()},t.prototype.back=function(){this.router.navigate(["victimHome"])},t.prototype.saveCaseNote=function(){var t=this;if(void 0===this.editCaseNote.victimCaseNoteId||0===this.editCaseNote.victimCaseNoteId){var e={victimId:this.victimId,victimCaseNoteId:0,caseNoteDate:this.editCaseNote.caseNoteDate,contactTypeId:this.editCaseNote.contactTypeId,contactType:null,victimContactPurposeId:this.editCaseNote.victimContactPurposeId,victimContactPurpose:null,comment:this.editCaseNote.comment,modifiedBy:this.staffId,victimFirstName:null,victimLastName:null};this._victimServicesComponent.addCaseNote(e).subscribe((function(e){t.snackBar.open("Saved Successfully !","",{duration:3e3}),t.hiddenDetailFlag=!0,t._victimServicesComponent.getCasetNotes(t.victimId).subscribe((function(e){t.caseNoteList=e,t.caseNoteDataSource.data=t.caseNoteList}))}))}else this._victimServicesComponent.updateCaseNote(this.editCaseNote).subscribe((function(e){t.snackBar.open("Update Successfully !","",{duration:3e3}),t.hiddenDetailFlag=!0,t.hiddenAddNewFlag=!1,t.addDisableFlag=!1,t._victimServicesComponent.getCasetNotes(t.victimId).subscribe((function(e){t.caseNoteList=e,t.caseNoteDataSource.data=t.caseNoteList}))}))},t.decorators=[{type:r.Component,args:[{template:'\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n \r\n <mat-toolbar color="primary">\r\n <h4 class="card-header" >Case Note</h4>\r\n </mat-toolbar>\r\n <br>\r\n <div class="row" >\r\n <div [hidden]="hiddenAddNewFlag">\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="onAddNew()" [disabled]="addDisableFlag">Add Case Note</button>\r\n\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="back()">Back</button>\r\n </div>\r\n </div>\r\n\r\n <div [hidden]="hiddenDetailFlag" >\r\n <mat-card >\r\n <div class=\'container\'> \r\n <form [formGroup]="caseNoteForm" #caseNoteDetailForm="ngForm" >\r\n \r\n <div>\r\n <mat-label>Victim Name:</mat-label>\r\n {{victimName}} \r\n </div>\r\n \r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Date of Case Note: </mat-label>\r\n <input matInput formControlName="caseNoteDate" \r\n (click)="caseNoteDate.open()" \r\n [matDatepicker]="caseNoteDate" \r\n placeholder="Choose a start date" \r\n [(ngModel)]="editCaseNote.caseNoteDate" required>\r\n <mat-datepicker-toggle matSuffix [for]="caseNoteDate"></mat-datepicker-toggle>\r\n <mat-datepicker #caseNoteDate></mat-datepicker>\r\n\r\n <div class="help-block" *ngIf="caseNoteForm.get(\'caseNoteDate\').errors \r\n && (caseNoteForm.get(\'caseNoteDate\').dirty || caseNoteForm.get(\'caseNoteDate\').touched)">\r\n <mat-error>case note date is <strong>required</strong></mat-error>\r\n </div> \r\n\r\n <div class="help-block" \r\n *ngIf="caseNoteForm.get(\'caseNoteDate\').hasError(\'date\') \r\n && (caseNoteForm.get(\'caseNoteDate\').dirty || caseNoteForm.get(\'caseNoteDate\').touched)">\r\n <mat-error>future case note Date is <strong>not allowed</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n </div> \r\n \r\n \r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Type:</mat-label>\r\n <mat-select placeholder="contactType" formControlName="contactType" required [(ngModel)]="editCaseNote.contactTypeId">\r\n <mat-option *ngFor=" let contactType of contactTypes" [value]="contactType.contactTypeId" >{{contactType.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class="help-block" *ngIf="caseNoteForm.get(\'contactType\').errors \r\n && (caseNoteForm.get(\'contactType\').dirty || caseNoteForm.get(\'contactType\').touched)">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n </div>\r\n \r\n <div> \r\n <mat-form-field class="mat-select-content">\r\n <mat-label>Contact Purpose:</mat-label>\r\n <mat-select formControlName="contactPurpose" required [(ngModel)]="editCaseNote.victimContactPurposeId" class="mat-select-inner">\r\n <mat-option *ngFor=" let contactPurpose of contactPurposes" [value]="contactPurpose.victimContactPurposeId" >{{contactPurpose.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class="help-block" *ngIf="caseNoteForm.get(\'contactPurpose\').errors \r\n && (caseNoteForm.get(\'contactPurpose\').dirty || caseNoteForm.get(\'contactPurpose\').touched)">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n \r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n\r\n <mat-form-field style="width: 400px;">\r\n <mat-label>Comment:</mat-label>\r\n <textarea \r\n class="textarea-content"\r\n matInput \r\n placeholder="" \r\n required formControlName="comment" \r\n [(ngModel)]="editCaseNote.comment"\r\n cdkTextareaAutosize\r\n #autosize="cdkTextareaAutosize"\r\n cdkAutosizeMinRows="8"\r\n cdkAutosizeMaxRows="12">\r\n </textarea> \r\n\r\n <div class="help-block" *ngIf="caseNoteForm.get(\'comment\').errors \r\n && (caseNoteForm.get(\'comment\').dirty || caseNoteForm.get(\'comment\').touched)">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div> \r\n </mat-form-field>\r\n </div>\r\n \r\n <div>\r\n <button mat-raised-button color="primary" (click)="saveCaseNote()" [disabled]="!caseNoteDetailForm.form.valid" >Save</button>\r\n\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="hiddenDetailFlag = true;addDisableFlag = false; this.hiddenAddNewFlag = false;">Cancel</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n \r\n </div>\r\n <br>\r\n <mat-table #table [dataSource]="caseNoteDataSource" class="example-table">\r\n <ng-container matColumnDef="caseNoteDate">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Case Note Date</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.caseNoteDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef="contactType">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact Type</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.contactType}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef="contactPurpose">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact Purpose</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.contactPurpose}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="comment">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="victimCaseNoteId">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell"></mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell">\r\n \r\n <button \r\n class="sac-cso-read sac-vsp-read" \r\n mat-icon-button \r\n color="primary" \r\n matTooltip="Edit Case Note" \r\n (click)="onEditCaseNote(row.victimCaseNoteId)">\r\n <i class="material-icons">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n \r\n \r\n\r\n <button\r\n class="sac-vsp-read"\r\n matTooltip="Delete Case Note" \r\n mat-icon-button\r\n color="primary"\r\n (click)="onDeleteCaseNote(row.victimCaseNoteId)">\r\n <i class="material-icons">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n </mat-cell>\r\n </ng-container>\r\n \r\n <mat-header-row *matHeaderRowDef="[\'caseNoteDate\', \'contactType\', \'contactPurpose\', \'comment\', \'victimCaseNoteId\']" class="example-header-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns:[\'caseNoteDate\', \'contactType\', \'contactPurpose\', \'comment\', \'victimCaseNoteId\'];" class="example-row"></mat-row>\r\n </mat-table>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>',providers:[q],styles:[".container{width:800px;margin:16px;display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[1];grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}.textarea-content{width:500px}"]}]}],t.ctorParameters=function(){return[{type:d.FormBuilder},{type:U},{type:q},{type:m.MatSnackBar},{type:l.ActivatedRoute},{type:l.Router},{type:s.SmartAuthService}]},t}();var J=function(){function t(t,e,r,i,a){this._victimServicesComponent=t,this.snackBar=e,this.route=r,this.router=i,this.smartAuthService=a,this.editContact={},this.staff={},this.contactForm=new d.FormGroup({contactDate:new d.FormControl("",d.Validators.compose([z()])),contactMethod:new d.FormControl,contactBy:new d.FormControl,comment:new d.FormControl,nextContactDate:new d.FormControl})}return t.prototype.ngAfterViewInit=function(){this.smartAuthService.setPermission("Victim",this.route.snapshot)},t.prototype.ngOnInit=function(){var t=this,e=this.route.snapshot.data;this.loginStaff=e.loginStaff,this.staffId=this.loginStaff.staffId,this.staff=[{staffId:this.loginStaff.staffId,fullName:this.loginStaff.firstName+" "+this.loginStaff.lastName}],this.sub=this.route.params.subscribe((function(e){t.victimId=e.victimId,console.log("my this.victimId"),console.log(t.victimId)})),this._victimServicesComponent.getContactMethods().subscribe((function(e){t.contactMethods=e,console.log("this.contactMethods"),console.log(t.contactMethods)}))},t.prototype.onEditContact=function(t){},t.prototype.onAddNew=function(){},t.prototype.back=function(){this.router.navigate(["victimDetail",this.victimId])},t.prototype.saveContact=function(){var t=this,e={victimId:this.victimId,victimContactId:0,contactDate:this.editContact.contactDate,victimContactMethodId:this.editContact.victimContactMethodId,contactMethod:null,contactedByName:null,contactedBy:this.editContact.contactedBy,comment:this.editContact.comment,nextContactDate:this.editContact.nextContactDate,modifiedBy:this.staffId};this._victimServicesComponent.addContact(e).subscribe((function(e){t.snackBar.open("Saved Successfully !","",{duration:3e3}),t.router.navigate(["victimDetail",t.victimId])}))},t.decorators=[{type:r.Component,args:[{template:'\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n \r\n <mat-toolbar color="primary">\r\n <h4 class="card-header" >Contact detail</h4>\r\n </mat-toolbar>\r\n <br>\r\n \r\n\r\n \r\n <mat-card >\r\n <div class=\'container\'> \r\n <form [formGroup]="contactForm" #contactDetailForm="ngForm" >\r\n \r\n \r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Contact Date:</mat-label>\r\n <input matInput formControlName="contactDate" \r\n (click)="contactDate.open()" \r\n [matDatepicker]="contactDate" \r\n placeholder="Choose a contact date" \r\n [(ngModel)]="editContact.contactDate" required>\r\n <mat-datepicker-toggle matSuffix [for]="contactDate"></mat-datepicker-toggle>\r\n <mat-datepicker #contactDate></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div class="validation-errors">\r\n <div\r\n class="help-block"\r\n *ngIf="\r\n contactForm\r\n .get(\'contactDate\')\r\n .hasError(\'required\') &&\r\n (contactForm.get(\'contactDate\').dirty ||\r\n contactForm.get(\'contactDate\').touched)">\r\n <mat-error>Contact date is\r\n <strong>required</strong></mat-error>\r\n </div>\r\n <div\r\n class="help-block"\r\n *ngIf="\r\n contactForm.get(\'contactDate\').hasError(\'date\') &&\r\n (contactForm.get(\'contactDate\').dirty ||\r\n contactForm.get(\'contactDate\').touched)">\r\n <mat-error >future Date is <strong>not allowed</strong> for contact date</mat-error>\r\n </div>\r\n </div>\r\n </div> \r\n \r\n \r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Method:</mat-label>\r\n <mat-select placeholder="contactMethod" formControlName="contactMethod" required [(ngModel)]="editContact.victimContactMethodId">\r\n <mat-option *ngFor=" let contactMethod of contactMethods" [value]="contactMethod.victimContactMethodId" >{{contactMethod.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n \r\n <div> \r\n <mat-form-field class="mat-select-content">\r\n <mat-label>Contact By:</mat-label>\r\n <mat-select formControlName="contactBy" required [(ngModel)]="editContact.contactedBy" class="mat-select-inner">\r\n <mat-option *ngFor=" let item of staff" [value]="item.staffId" >{{ item.fullName}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n\r\n <mat-form-field>\r\n <mat-label>Comments </mat-label>\r\n <textarea \r\n matInput \r\n placeholder="" \r\n required formControlName="comment" \r\n [(ngModel)]="editContact.comment"\r\n cdkTextareaAutosize\r\n #autosize="cdkTextareaAutosize"\r\n cdkAutosizeMinRows="1"\r\n cdkAutosizeMaxRows="5">\r\n </textarea> \r\n </mat-form-field>\r\n </div>\r\n\r\n <div> \r\n <mat-form-field>\r\n <mat-label>Next Contact Date: </mat-label>\r\n <input matInput formControlName="nextContactDate" \r\n (click)="nextContactDate.open()" \r\n [matDatepicker]="nextContactDate" \r\n placeholder="Choose a next contact date" \r\n [(ngModel)]="editContact.nextContactDate" required>\r\n <mat-datepicker-toggle matSuffix [for]="nextContactDate"></mat-datepicker-toggle>\r\n <mat-datepicker #nextContactDate></mat-datepicker>\r\n </mat-form-field>\r\n </div> \r\n \r\n <div>\r\n \x3c!-- <button mat-raised-button color="primary" (click)="saveContact()" [disabled]="!contactForm.form.valid" >Save</button> --\x3e\r\n <button mat-raised-button color="primary" (click)="saveContact()" [disabled]="!contactForm.valid" >Save</button>\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" >Cancel</button>\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="back()" >Back</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n \r\n \r\n <br>\r\n \r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>',styles:["mat-form-field{width:50%}.container{margin:16px;display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[1];grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}"]}]}],t.ctorParameters=function(){return[{type:U},{type:m.MatSnackBar},{type:l.ActivatedRoute},{type:l.Router},{type:s.SmartAuthService}]},t}();var K=function(){function t(t,e,r,i,a,o,n,l){this._victimServicesComponent=t,this.commonDialogService=e,this.http=r,this.dialog=i,this.route=a,this.router=o,this.snackBar=n,this.smartAuthService=l,this.editSafetyPlan={},this.safetyPlanDataSource=new m.MatTableDataSource}return t.prototype.ngAfterViewInit=function(){this.smartAuthService.setPermission("Victim",this.route.snapshot)},t.prototype.ngOnInit=function(){var t=this,e=this.route.snapshot.data;this.loginStaff=e.loginStaff,this.staffId=this.loginStaff.staffId,this.sub=this.route.params.subscribe((function(e){t.victimId=e.victimId})),this.hiddenAddNewFlag=!1,this.victimName=this.victimName,this._victimServicesComponent.getSafetyPlans(this.victimId).subscribe((function(e){t.victimSafetyPlans=e,t.safetyPlanDataSource.data=t.victimSafetyPlans,console.log("this.victimSafetyPlans"),console.log(t.victimSafetyPlans)})),this._victimServicesComponent.getServiceStatusHistories(1).subscribe((function(t){}))},t.prototype.goToSafetyPlanDetail=function(t){this.router.navigate(["saftyPlanDetail",t,this.victimId])},t.prototype.onAddNew=function(){this.hiddenDetailFlag=!1},t.prototype.onDeleteSafetyPlan=function(t){var e=this;this.commonDialogService.confirm("","Do you want to delete this safety plan?","Yes","No").subscribe((function(r){e.result=r,e.result&&e._victimServicesComponent.deleteSafetyPlan(t,e.staffId).subscribe((function(t){e.snackBar.open("delete safety plan Successfully !","",{duration:3e3}),e._victimServicesComponent.getSafetyPlans(e.victimId).subscribe((function(t){e.victimSafetyPlans=t,e.safetyPlanDataSource.data=e.victimSafetyPlans}))}))}))},t.prototype.back=function(){this.router.navigate(["victimHome"])},t.decorators=[{type:r.Component,args:[{template:'\r\n <mat-card>\r\n <mat-card-header>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color="primary">\r\n <h4 class="card-header" style="display: inline-block;">Safety Plan</h4>\r\n </mat-toolbar>\r\n <br>\r\n <button mat-raised-button color="primary" (click)="goToSafetyPlanDetail(0)" >Add Goal</button>\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="back()">Back</button>\r\n <br>\r\n <br>\r\n <mat-table #table [dataSource]="safetyPlanDataSource" class="example-table">\r\n <ng-container matColumnDef="startDate">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="goal">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Goal</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.goal }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="victimServiceStatus">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Status</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.victimServiceStatus }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef="comment">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.comment }} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef="victimServiceId">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell"></mat-header-cell>\r\n \x3c!-- <mat-cell *matCellDef="let row" class="example-cell">\r\n <button type="button" mat-raised-button color="primary" (click)="goToSafetyPlanDetail(row.victimServiceId)"> \r\n <span class="glyphicon glyphicon-pencil" ></span>&nbsp;\r\n <mat-icon>edit</mat-icon> \r\n </button> \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n &nbsp;&nbsp;\r\n <button type="button" mat-raised-button color="primary" (click)="onDeleteSafetyPlan(row.victimServiceId)"> \r\n <span class="glyphicon glyphicon-trash" ></span>&nbsp;Delete\r\n </button> \r\n </mat-cell> --\x3e\r\n\r\n <mat-cell *matCellDef="let element">\r\n \r\n <button class="edit-btn" mat-icon-button color="primary" matTooltip="Edit Safety Plan" (click)="goToSafetyPlanDetail(element.victimServiceId)">\r\n <i class="material-icons">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n \r\n <button\r\n class="delete-btn"\r\n matTooltip="Delete Safety Plan"\r\n mat-icon-button\r\n color="primary"\r\n (click)="onDeleteSafetyPlan(element.victimServiceId)">\r\n <i class="material-icons">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n \r\n </mat-cell>\r\n\r\n \r\n \r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef="[\'startDate\', \'goal\', \'victimServiceStatus\', \'comment\', \'victimServiceId\']" class="example-header-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns:[\'startDate\', \'goal\', \'victimServiceStatus\', \'comment\', \'victimServiceId\'];" class="example-row"></mat-row>\r\n </mat-table>\r\n \r\n \r\n</mat-card-content>\r\n</mat-card>',providers:[q]}]}],t.ctorParameters=function(){return[{type:U},{type:q},{type:e.HttpClient},{type:m.MatDialog},{type:l.ActivatedRoute},{type:l.Router},{type:m.MatSnackBar},{type:s.SmartAuthService}]},t}();var Q=function(){function t(t,e,r,i){this.formBuilder=t,this.dialogRef=e,this._victimServicesComponent=r,this.data=i,this.spForm=this.formBuilder.group({voteeProviderId:[""]})}return t.prototype.cancel=function(){this.dialogRef.close()},t.prototype.ngOnInit=function(){var t=this;console.log("data.providerCollections"),console.log(this.data),console.log(this.data.serviceTypeId),this._victimServicesComponent.getvVictimServiceTypeProgramProviders().subscribe((function(e){t.programProviders=e.filter((function(e){return e.victimServiceTypeId===t.data.serviceTypeId})),console.log("this.programProviders"),console.log(t.programProviders)})),this.spForm.get("voteeProviderId").valueChanges.subscribe((function(t){console.log("voteeProviderId in service provider component."),console.log(t)}))},t.decorators=[{type:r.Component,args:[{selector:"app-service-provider",template:'\n <h1 mat-dialog-title> {{data.serviceType}}</h1>\n <div mat-dialog-content class="main" [formGroup]="spForm">\n <mat-form-field>\n <mat-label>service provider</mat-label>\n \n <mat-select formControlName="voteeProviderId">\n <mat-option\n *ngFor="let providerOption of programProviders"\n [value]="providerOption.victimProgramProviderId">{{ providerOption.victimProgramProvider }}\n </mat-option>\n </mat-select>\n \n </mat-form-field>\n \n </div>\n <div mat-dialog-actions class="actions">\n <button mat-raised-button color="primary" (click)="cancel()" cdkFocusInitial>\n Cancel Change\n </button>\n <button mat-raised-button color="primary" [mat-dialog-close]="spForm.value" >\n Save Change\n </button>\n </div>\n ',styles:["\n .main {\n width: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .actions{\n display: flex;\n }\n "]}]}],t.ctorParameters=function(){return[{type:d.FormBuilder},{type:m.MatDialogRef},{type:U},{type:void 0,decorators:[{type:r.Inject,args:[m.MAT_DIALOG_DATA]}]}]},t}();var X=function(){function t(t,e,r,i,a,o,n,l){this.dialog=t,this._victimServicesComponent=e,this.http=r,this.snackBar=i,this.route=a,this.router=o,this.commonDialogService=n,this.formBuilder=l,this.editSafetyPlan={},this.providerListCollection=[],this.serviceCheck=[],this.victimServiceStatusHistoriesDataSource=new m.MatTableDataSource,this.initForm()}return t.prototype.initForm=function(){this.spForm=this.formBuilder.group({serviceGoal:new d.FormControl("",d.Validators.compose([d.Validators.required])),goalStatus:new d.FormControl("",d.Validators.compose([d.Validators.required])),goalStatusDate:new d.FormControl("",d.Validators.compose([d.Validators.required,z()])),comment:new d.FormControl("",d.Validators.required)}),this.spForm.markAsPristine(),this.spForm.markAsUntouched()},t.prototype.ngOnInit=function(){var t=this,e=this.route.snapshot.data;this.loginStaff=e.loginStaff,this.staffId=this.loginStaff.staffId,this.sub=this.route.params.subscribe((function(e){t.victimServiceId=e.victimServiceId,t.victimId=e.victimId})),this.hiddenAddNewFlag=!1,this.isDisplay=!1,this._victimServicesComponent.getVictimServiceTypes().subscribe((function(e){t.victimServiceTypes=e})),this._victimServicesComponent.getVictimServiceStatus().subscribe((function(e){t.victimServiceStatus=e})),this._victimServicesComponent.getVictim(this.victimId).subscribe((function(e){t.victimName=e.firstName+", "+e.lastName})),0!=this.victimServiceId&&(this._victimServicesComponent.getVictimServices(this.victimServiceId).subscribe((function(e){console.log("victimSafetyPlans"),console.log(e),t.editSafetyPlan=e[0],t.victimId=e[0].victimId,console.log("this.editSafetyPlan"),console.log(t.editSafetyPlan)})),this._victimServicesComponent.getServiceStatusHistories(this.victimServiceId).subscribe((function(e){t.victimServiceStatusHistoriesDataSource.data=e}))),this.loadProvider()},t.prototype.isInArray=function(t,e,r){var i=this;if(console.log("providerListCollectionKey"),console.log(t),console.log("serviceTypeName"),console.log(e),console.log("event.source.value"),console.log(r.checked),1==r.checked)for(var a=0;a<this.providerListCollection.length;a++){if(t==this.providerListCollection[a].groupId)this.providerListCollection[a].isDisplay=!this.providerListCollection[a].isDisplay,this.dialog.open(Q,{width:"500px",data:{serviceType:e,serviceTypeId:t,providerCollections:S(this.providerListCollection)},panelClass:"formFieldWidth480"}).afterClosed().subscribe((function(e){console.log("The dialog was closed"),console.log(e),e&&(console.log("The dialog was closed, inside result"),i.savePlanProvider(t,e.voteeProviderId))}))}},t.prototype.loadProvider=function(){var t=this;this.providerListCollection=[],this._victimServicesComponent.getvVictimServiceTypeProgramProviders().subscribe((function(e){if(e)for(var r=Object.create(null),i=0;i<e.length;i++){if(!r[e[i].victimServiceTypeId]){if(r[e[i].victimServiceTypeId]=[],null!=t.editSafetyPlan.vVictimServiceDetails)for(var a=0;a<t.editSafetyPlan.vVictimServiceDetails.length;a++)e[i].victimServiceTypeId==t.editSafetyPlan.vVictimServiceDetails[a].victimServiceId.toString()&&(t.isDisplay=!0);t.providerListCollection.push({groupId:e[i].victimServiceTypeId,isDisplay:t.isDisplay,collection:r[e[i].victimServiceTypeId]})}r[e[i].victimServiceTypeId].push(e[i])}}))},t.prototype.evaluateSelection=function(t){if(this.editSafetyPlan.vVictimServiceDetails)return this.editSafetyPlan.vVictimServiceDetails.findIndex((function(e){return e.victimServiceTypeId===t}))>=0},t.prototype.savePlanProvider=function(t,e){var r=this;if(console.log("savePlanProvider"),console.log(t),console.log(e),""===e||null==e)this.snackBar.open("Please pick a program on the drop down list !","",{duration:120});else if(0==this.victimServiceId){console.log("insert new plan");var i={victimId:this.victimId,fullName:null,victimServiceId:0,goal:this.editSafetyPlan.goal,comment:this.editSafetyPlan.comment,modifiedBy:this.staffId,victimServiceStatusId:null,status:null,startDate:null,vVictimServiceDetails:null,victimName:null};this._victimServicesComponent.addSafetyPlan(i).subscribe((function(i){var a={victimServiceStatusHistoryId:0,victimServiceId:i.victimServiceId,victimServiceStatusId:r.editSafetyPlan.victimServiceStatusId,startDate:r.editSafetyPlan.startDate,modifiedBy:r.staffId,comment:"test add safety plan"};r._victimServicesComponent.addVictimServiceStatus(a).subscribe((function(){console.log("check itms.victimServiceId iniside add victim serive status"),console.log(i.victimServiceId);var a={victimServiceId:i.victimServiceId,victimServiceDetailId:0,victimServiceTypeId:t,victimProgramProviderId:e,modifiedBy:r.staffId,victimProgramProvider:null};console.log("add plan provider here at insert"),r._victimServicesComponent.addPlanProvider(a).subscribe((function(){r.router.navigate(["saftyPlanDetail",i.victimServiceId,r.victimId])}))}))}))}else{var a={victimServiceId:this.victimServiceId,victimServiceDetailId:0,victimServiceTypeId:t,victimProgramProviderId:e,modifiedBy:this.staffId,victimProgramProvider:null};console.log("add plan provider here at update"),this._victimServicesComponent.addPlanProvider(a).subscribe((function(){r.router.navigate(["saftyPlanDetail",r.victimServiceId,r.victimId])}))}},t.prototype.deleteProvider=function(t){var e=this;this.commonDialogService.confirm("","Do you want to delete this provider?","Yes","No").subscribe((function(r){e.result=r,e.result&&e._victimServicesComponent.deleteProvider(t,e.staffId).subscribe((function(t){e.snackBar.open("delete provider Successfully !","",{duration:3e3}),location.reload()}))}))},t.prototype.saveSafetyPlan=function(){var t=this;if(void 0===this.editSafetyPlan.victimServiceId){var e={victimId:this.victimId,fullName:null,victimServiceId:0,goal:this.editSafetyPlan.goal,comment:this.editSafetyPlan.comment,modifiedBy:this.staffId,victimServiceStatusId:null,status:null,startDate:null,vVictimServiceDetails:null,victimName:null};this._victimServicesComponent.addSafetyPlan(e).subscribe((function(e){var r={victimServiceStatusHistoryId:0,victimServiceId:e.victimServiceId,victimServiceStatusId:t.editSafetyPlan.victimServiceStatusId,startDate:t.editSafetyPlan.startDate,modifiedBy:t.staffId,comment:"test add safety Plan"};t._victimServicesComponent.addVictimServiceStatus(r).subscribe((function(e){t.snackBar.open("Insert status successfully!","",{duration:3e3})})),t.router.navigate(["saftyPlanDetail",e.victimServiceId,t.victimId])}))}else this.editSafetyPlan.modifiedBy=this.staffId,this._victimServicesComponent.updateSafetyPlan(this.editSafetyPlan).subscribe((function(e){var r={victimServiceStatusHistoryId:0,victimServiceId:t.editSafetyPlan.victimServiceId.toString(),victimServiceStatusId:t.editSafetyPlan.victimServiceStatusId,startDate:t.editSafetyPlan.startDate,modifiedBy:t.staffId,comment:"test update safety Plan"};t._victimServicesComponent.addVictimServiceStatus(r).subscribe(),t.router.navigate(["saftyPlanDetail",t.editSafetyPlan.victimServiceId,t.victimId])}))},t.prototype.back=function(){console.log("this.victimId"),console.log(this.victimId),this.router.navigate(["saftyPlan",this.victimId])},t.decorators=[{type:r.Component,args:[{template:'<mat-card>\r\n <mat-card-header>\r\n \r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color="primary">\r\n <h4 class="card-header" style="display: inline-block;">Safety Plan</h4>\r\n </mat-toolbar>\r\n \r\n \r\n <div class=\'container\'>\r\n <form [formGroup]="spForm" #spDetailForm="ngForm" >\r\n \r\n \r\n <div class="row" ><b>Victim Name:</b> {{victimName}} </div>\r\n \r\n\r\n <div class="row" > \r\n <mat-form-field >\r\n <mat-label>Goal:</mat-label>\r\n <input matInput formControlName="serviceGoal" [(ngModel)]="editSafetyPlan.goal" >\r\n </mat-form-field>\r\n \r\n </div>\r\n \r\n \r\n \r\n \r\n \r\n \r\n <div class="row"> \r\n <mat-form-field>\r\n <mat-label>Goal Status:</mat-label>\r\n <mat-select formControlName="goalStatus" [(ngModel)]="editSafetyPlan.victimServiceStatusId" >\r\n \r\n <mat-option *ngFor=" let victimServiceStatu of victimServiceStatus" [value]="victimServiceStatu.victimServiceStatusId" >{{victimServiceStatu.name}}</mat-option>\r\n \r\n </mat-select> \r\n </mat-form-field>\r\n </div>\r\n \r\n\r\n \r\n \r\n <div class="row"> \r\n \r\n <mat-form-field>\r\n <mat-label>Goal Status Date:</mat-label>\r\n <input matInput \r\n formControlName="goalStatusDate" \r\n [matDatepicker]="goalStatusDate" \r\n placeholder="Choose a date" [(ngModel)]="editSafetyPlan.startDate" \r\n (click)="goalStatusDate.open()" \r\n >\r\n \r\n <mat-datepicker-toggle matSuffix [for]="goalStatusDate"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker> \r\n </mat-form-field> \r\n\r\n\r\n <div class="help-block" \r\n *ngIf="spForm.get(\'goalStatusDate\').hasError(\'date\') \r\n && (spForm.get(\'goalStatusDate\').dirty || spForm.get(\'goalStatusDate\').touched)">\r\n <mat-error>Future Date is <strong>not allowed</strong> for goal status date</mat-error>\r\n </div>\r\n </div>\r\n\r\n \r\n <div class="row" > \r\n \x3c!-- <mat-form-field style="width: 200px;"> --\x3e\r\n \x3c!-- <mat-label>Comment:</mat-label> \r\n <textarea mdInput \r\n class="textarea-content"\r\n [(ngModel)]="editSafetyPlan.comment"\r\n formControlName="comment" \r\n cdkTextareaAutosize\r\n #autosize="cdkTextareaAutosize"\r\n cdkAutosizeMinRows="8"\r\n cdkAutosizeMaxRows="12"\r\n >\r\n </textarea> --\x3e\r\n \x3c!-- </mat-form-field> --\x3e\r\n\r\n\r\n\r\n <mat-form-field style="width: 400px;">\r\n <mat-label>Comment:</mat-label>\r\n <textarea \r\n class="textarea-content"\r\n matInput \r\n placeholder="" \r\n formControlName="comment" \r\n [(ngModel)]="editSafetyPlan.comment"\r\n cdkTextareaAutosize\r\n #autosize="cdkTextareaAutosize"\r\n cdkAutosizeMinRows="8"\r\n cdkAutosizeMaxRows="12">\r\n </textarea> \r\n\r\n \r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </form>\r\n </div>\x3c!--end form--\x3e\r\n \r\n \r\n <br>\r\n\r\n <div class="row"><b>Need and provider:</b><br> (click on a check box to select provider information)\r\n \r\n <mat-list>\r\n <mat-list-item *ngFor="let serviceType of victimServiceTypes; let i=index" >\r\n <mat-checkbox class="example-margin" name="victimService" color ="primary" [checked]="evaluateSelection(serviceType.victimServiceTypeId)" (change)="isInArray(serviceType.victimServiceTypeId,serviceType.name, $event);" > {{serviceType.name}}</mat-checkbox>\r\n <div> &nbsp;&nbsp;</div>\r\n <div *ngFor="let provider of providerListCollection; let pi = index" >\r\n \x3c!-- <div *ngIf="provider.isDisplay && serviceType.victimServiceTypeId == provider.groupId " class="Row">\r\n \r\n <div class="serviceSelect"> --\x3e\r\n \x3c!-- <mat-form-field> --\x3e\r\n \x3c!-- <mat-select name="provider" id="provider.groupId" [(ngModel)]="providerId" > --\x3e\r\n \x3c!-- <mat-select name="provider" id="provider.groupId" [(value)]="providerId" > \r\n <mat-option *ngFor=" let providerOption of provider.collection" [value]="providerOption.victimProgramProviderId" >{{providerOption.victimProgramProvider}}</mat-option>\r\n </mat-select> --\x3e\r\n \x3c!-- </mat-form-field> --\x3e\r\n \r\n \x3c!-- </div>\r\n\r\n <div class="serviceButton">\r\n <button mat-raised-button color="primary" (click)="savePlanProvider(serviceType.victimServiceTypeId ,providerId)">Add Provider</button>\r\n </div>\r\n </div> --\x3e\r\n </div>\r\n <div *ngFor=" let serviceprovider of editSafetyPlan.vVictimServiceDetails" >\r\n \r\n <div *ngIf="serviceType.victimServiceTypeId===serviceprovider.victimServiceTypeId" class="Row" >\r\n \x3c!-- . {{ serviceprovider.victimProgramProvider}}<button mat-raised-button color="primary" (click)="deleteProvider(serviceprovider.victimServiceDetailId)">Delete</button> <br> --\x3e\r\n <div class="serviceSelect" >\r\n . {{ serviceprovider.victimProgramProvider}}\r\n </div>\r\n <div class="serviceButton">\r\n <button mat-raised-button color="primary" (click)="deleteProvider(serviceprovider.victimServiceDetailId)">Delete</button> \r\n </div>\r\n \r\n </div>\r\n \r\n </div>\r\n \r\n </mat-list-item> \r\n \r\n </mat-list>\r\n </div>\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \x3c!-- <div class=\'row\' >\r\n <div class=\'col-md-5 desc-label\'><b>Victim Name:</b> {{victimName}} </div>\r\n <div class=\'col-md-7\'> \r\n \r\n </div> \r\n </div> --\x3e\r\n \x3c!-- <div class=\'row\' >\r\n <div class=\'col-md-5 desc-label\'><b>Goal:<font color="red">*</font></b></div>\r\n <div class=\'col-md-7\'> \r\n <mat-form-field >\r\n <input matInput name="serviceGoal" [(ngModel)]="editSafetyPlan.goal" required placeholder="">\r\n </mat-form-field>\r\n </div> \r\n </div>\r\n\r\n <div class=\'row\' >\r\n <div class=\'col-md-5 desc-label\'><b>Goal Status:<font color="red">*</font></b></div>\r\n <div class=\'col-md-7\'> \r\n <mat-select name="goalStatus" [style.width]="\'50%\'" [(ngModel)]="editSafetyPlan.victimServiceStatusId" required>\r\n <mat-option *ngFor=" let victimServiceStatu of victimServiceStatus" [value]="victimServiceStatu.victimServiceStatusId" >{{victimServiceStatu.name}}</mat-option>\r\n </mat-select>\r\n </div> \r\n </div>\r\n \r\n <div class=\'row\' >\r\n <div class=\'col-md-5 desc-label\'><b>Goal Status Date:<font color="red">*</font></b></div>\r\n <div class=\'col-md-7\'> \r\n <input matInput name="goalStatusDate" [matDatepicker]="goalStatusDate" placeholder="Choose a date" [(ngModel)]="editSafetyPlan.startDate" required>\r\n <mat-datepicker-toggle matSuffix [for]="goalStatusDate"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker> \r\n </div> \r\n </div>\r\n \r\n <div class=\'row\' >\r\n <div class=\'col-md-5 desc-label\'><b>Comment:</b></div>\r\n <div class=\'col-md-7\'> \r\n <textarea mdInput placeholder="" rows="10" cols="50" name="comment" [(ngModel)]="editSafetyPlan.comment"></textarea> \r\n </div> \r\n </div> --\x3e\r\n\r\n \r\n <div class=\'row\' >\r\n <div class=\'col-md-12 text-center\'>\r\n \x3c!-- <button type="button" class="btn btn-default btn-small" (click)="print()">Print</button> --\x3e\r\n <button mat-raised-button color="primary" (click)="saveSafetyPlan()" [disabled]="!spForm.valid">Save</button>\r\n \x3c!-- &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="commondialogRef.close()">Cancel</button> --\x3e\r\n &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="back()">Back</button>\r\n </div> \r\n </div> \r\n\r\n \x3c!--status hisotry--\x3e\r\n \r\n <mat-table #table [dataSource]="victimServiceStatusHistoriesDataSource" class="example-table">\r\n <ng-container matColumnDef="startDate">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef="victimServiceStatusId">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Status</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.victimServiceStatusId}} </mat-cell>\r\n </ng-container>\r\n \r\n \r\n <ng-container matColumnDef="comment">\r\n <mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>\r\n <mat-cell *matCellDef="let row" class="example-cell"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n <mat-header-row *matHeaderRowDef="[ \'startDate\', \'victimServiceStatusId\', \'comment\']" class="example-header-row"></mat-header-row>\r\n <mat-row *matRowDef="let row; columns:[ \'startDate\', \'victimServiceStatusId\', \'comment\'];" class="example-row"></mat-row>\r\n </mat-table>\r\n\r\n \r\n \r\n\r\n</mat-card-content>\r\n</mat-card>',providers:[q],styles:["div.serviceSelect{width:500px}div.serviceButton{width:20%}.container{margin:16px;display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[2];grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.app-class .mat-list-item{height:auto}.textarea-content{width:500px}"]}]}],t.ctorParameters=function(){return[{type:m.MatDialog},{type:U},{type:e.HttpClient},{type:m.MatSnackBar},{type:l.ActivatedRoute},{type:l.Router},{type:q},{type:d.FormBuilder}]},t}();var Z=[{path:"casenote/:victimId",component:$,pathMatch:"full",canActivate:[F.MsalGuard],resolve:{loginStaff:s.LoginStaffResolverService}},{path:"saftyPlan/:victimId",component:K,pathMatch:"full",resolve:{loginStaff:s.LoginStaffResolverService}},{path:"saftyPlanDetail/:victimServiceId/:victimId",component:X,pathMatch:"full",resolve:{loginStaff:s.LoginStaffResolverService}},{path:"victimList",component:B,resolve:{loginStaff:s.LoginStaffResolverService,selectedOffender:s.SelectedOffenderResolverService}},{path:"victimHome",component:B,resolve:{loginStaff:s.LoginStaffResolverService,selectedOffender:s.SelectedOffenderResolverService}},{path:"victimContact/:victimId",component:J,resolve:{loginStaff:s.LoginStaffResolverService,selectedOffender:s.SelectedOffenderResolverService}},{path:"victimDetail/:victimId",component:G,resolve:{loginStaff:s.LoginStaffResolverService,selectedOffender:s.SelectedOffenderResolverService}},{path:"smart-error",component:s.SmartErrorComponent}],tt=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{imports:[l.RouterModule.forChild(Z)],exports:[l.RouterModule]}]}],t}(),et=function(){};var rt=function(){function t(){this.onSearch=new r.EventEmitter,this.change=new r.EventEmitter,this.filter=new et}return t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){},t.prototype.onChange=function(){console.log("this.filter in serach form."),console.log(this.filter),this.onSearch.emit(this.filter)},t.decorators=[{type:r.Component,args:[{selector:"app-victim-search-form",template:'<form name="victimSearchFrom" #From="ngForm">\r\n<mat-expansion-panel [expanded]="true">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Search for Victims\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div class="victimSearch">\r\n <mat-form-field>\r\n <input matInput placeholder="Victim Last Name" [(ngModel)]="filter.lastName" name="lastName" id="lastName">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder="Victim First Name" [(ngModel)]="filter.firstName" name="firstName" id="firstName">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder="Victim Date of Birth" type="date" [(ngModel)]="filter.birthDate" name="birthDate" id="birthDate">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder="Offender PDID" [(ngModel)]="filter.pdid" name="pdid" id="pdid">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder="Offender CSOSA #"[(ngModel)]="filter.offenderId" name="offenderId" id="offenderId">\r\n </mat-form-field>\r\n \r\n \r\n <section>\r\n <button id="victimSearchButton" mat-raised-button color="primary" (click)="onChange()">Search</button>\r\n <span style="padding-right: 5px;"></span>\r\n <button mat-raised-button color="primary" type="reset" value="Reset">Clear Changes</button>\r\n </section>\r\n </div>\r\n </mat-expansion-panel>\r\n</form>\r\n\r\n\r\n',encapsulation:r.ViewEncapsulation.None,styles:['div.services{max-width:500px;margin:auto;border:3px solid #73ad21}.rTable{display:block;width:100%}.rTableBody,.rTableFoot,.rTableHeading,.rTableRow{clear:both}.rTableFoot,.rTableHead{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.victimSearch{display:-ms-grid;display:grid;-ms-grid-columns:1fr 1fr 1fr;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-description,.example-headers-align .mat-expansion-panel-header-title{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-firstName,.mat-column-homePhone,.mat-column-lastName,.mat-column-offenderName,.mat-column-relationship{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}']}]}],t.ctorParameters=function(){return[]},t.propDecorators={onSearch:[{type:r.Output}]},t}();var it=function(){function t(t,e){this.el=t,this.renderer=e}return Object.defineProperty(t.prototype,"phoneControl",{set:function(t){this._phoneControl=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preValue",{set:function(t){this._preValue=t,this.formatPhoneNumber(t)},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.ngOnDestroy=function(){},t.prototype.formatPhoneNumber=function(t){this._preValue||(this._preValue="",t="");var e=this._preValue,r=e.substr(e.length-1),i=t.replace(/\D/g,""),a=this.renderer.selectRootElement("#tel").selectionStart,o=this.renderer.selectRootElement("#tel").selectionEnd;if(t.length<e.length)e.length<a&&")"==r&&(i=i.substr(0,i.length-1)),i=0==i.length?"":i.length<=3?i.replace(/^(\d{0,3})/,"($1"):i.length<=6?i.replace(/^(\d{0,3})(\d{0,3})/,"($1) $2"):i.replace(/^(\d{0,3})(\d{0,3})(.*)/,"($1) $2-$3"),this._phoneControl.setValue(i,{emitEvent:!1}),this.renderer.selectRootElement("#tel").setSelectionRange(a,o);else{var n=t.charAt(a);i=0==i.length?"":i.length<=3?i.replace(/^(\d{0,3})/,"($1)"):i.length<=6?i.replace(/^(\d{0,3})(\d{0,3})/,"($1) $2"):i.replace(/^(\d{0,3})(\d{0,3})(.*)/,"($1) $2-$3"),e.length>=a?("("==n&&(a+=1,o+=1),")"==n&&(a+=2,o+=2),"-"==n&&(a+=1,o+=1)," "==n&&(a+=1,o+=1),""==n&&(a+=1,o+=1),this._phoneControl.setValue(i,{emitEvent:!1}),this.renderer.selectRootElement("#tel").setSelectionRange(a,o)):(this._phoneControl.setValue(i,{emitEvent:!1}),this.renderer.selectRootElement("#tel").setSelectionRange(a+2,o+2))}},t.decorators=[{type:r.Directive,args:[{selector:"[phoneMask]"}]}],t.ctorParameters=function(){return[{type:r.ElementRef},{type:r.Renderer2}]},t.propDecorators={phoneControl:[{type:r.Input,args:["phoneControl"]}],preValue:[{type:r.Input,args:["preValue"]}]},t}();var at=[B,G,_,it],ot=[_],nt=[n.CommonModule,d.ReactiveFormsModule],lt=[s.NgcSmartCoreModule,p.SmartAddressModule],ct=[m.MatButtonModule,m.MatCheckboxModule,m.MatRadioModule,m.MatSliderModule,m.MatCardModule,m.MatSlideToggleModule,m.MatListModule,m.MatIconModule,m.MatButtonToggleModule,m.MatToolbarModule,m.MatTabsModule,m.MatExpansionModule,m.MatMenuModule,m.MatInputModule,m.MatProgressBarModule,m.MatDatepickerModule,m.MatNativeDateModule,m.MatPaginatorModule,m.MatDialogModule,m.MatSidenavModule,m.MatSelectModule,m.MatTableModule,m.MatSortModule,m.MatGridListModule,u.CdkTableModule,v.LayoutModule],mt=function(){function t(){}return t.decorators=[{type:r.NgModule,args:[{declarations:S(at,[$,J,K,X,rt,Q]),imports:S(nt,ct,lt,[Y,d.FormsModule,tt,o.ApolloModule]),exports:S(at,[o.ApolloModule]),entryComponents:S(ot,[Q]),providers:[U]}]}],t}();t.NgcSmartVictimComponent=B,t.NgcSmartVictimModule=mt,t.NgcSmartVictimService=U,t.SMART_LOOKUP_SERVICE_URL=D,t.SMART_OFFENDER_SERVICE_URL=C,t.SMART_VICTIM_SERVICE_URL=P,t.SMART_WARRANT_URL=w,t.Victim=A,t.VictimAdvocate=k,t.VictimDrugUse=V,t.VictimGuardian=T,t.VictimListFilter=N,t.VictimSupport=M,t.VictimWeaponUse=x,t.ɵa=L,t.ɵb=G,t.ɵc=q,t.ɵd=_,t.ɵe=it,t.ɵf=$,t.ɵg=J,t.ɵh=K,t.ɵi=X,t.ɵj=rt,t.ɵk=Q,t.ɵl=Y,t.ɵm=j,t.ɵn=H,t.ɵo=tt,Object.defineProperty(t,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=csmart-ngc-smart-victim.umd.min.js.map