@senior-gestao-pessoas/hcm-contract-employee-history 5.7.0 → 5.7.1-bugfix-hcmfnd-6392-29387dfd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/senior-gestao-pessoas-hcm-contract-employee-history.umd.js +4 -4
- package/bundles/senior-gestao-pessoas-hcm-contract-employee-history.umd.js.map +1 -1
- package/bundles/senior-gestao-pessoas-hcm-contract-employee-history.umd.min.js +1 -1
- package/bundles/senior-gestao-pessoas-hcm-contract-employee-history.umd.min.js.map +1 -1
- package/esm2015/core/entities/annotation-history/annotation-history.js +3 -3
- package/esm2015/lib/employee-dependent/form/employee-dependent-complement-step/employee-dependent-complement-tab/employee-dependent-complement-tab.component.js +3 -3
- package/esm5/core/entities/annotation-history/annotation-history.js +3 -3
- package/esm5/lib/employee-dependent/form/employee-dependent-complement-step/employee-dependent-complement-tab/employee-dependent-complement-tab.component.js +3 -3
- package/fesm2015/senior-gestao-pessoas-hcm-contract-employee-history.js +4 -4
- package/fesm2015/senior-gestao-pessoas-hcm-contract-employee-history.js.map +1 -1
- package/fesm5/senior-gestao-pessoas-hcm-contract-employee-history.js +4 -4
- package/fesm5/senior-gestao-pessoas-hcm-contract-employee-history.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
***************************************************************************** */var j=function(e,t){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function Y(e,t){function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var z=function(){return(z=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function W(e,t,n,o){var i,a=arguments.length,r=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(r=(a<3?i(r):a>3?i(t,n,r):i(t,n))||r);return a>3&&r&&Object.defineProperty(t,n,r),r}function Q(e,t,n,o){return new(n||(n=Promise))((function(i,a){function r(e){try{l(o.next(e))}catch(e){a(e)}}function s(e){try{l(o.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((o=o.apply(e,t||[])).next())}))}function X(e,t){var n,o,i,a,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=2&a[0]?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(6===a[0]&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],o=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function K(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)r.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return r}function $(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(K(arguments[t]));return e}var J,Z,ee=c;function te(e,t,n,o){n?(e.controls[t].setValidators(p.Validators.compose(o&&o.length?o:[p.Validators.required])),e.controls[t].updateValueAndValidity()):(e.controls[t].setValidators(null),e.controls[t].updateValueAndValidity())}function ne(e,t,n,o){t?n.forEach((function(t){return e.get(t).enable()})):(n.forEach((function(t){return e.get(t).disable()})),re(e,o||n))}function oe(e,t){t.forEach((function(t){ie(e,t.field,t.validators),ae(e,t.disabled,t.field,t.clearValue)}))}function ie(e,t,n){n&&n.length?(e.controls[t].setValidators(p.Validators.compose(n)),e.controls[t].updateValueAndValidity()):(e.controls[t].setValidators(null),e.controls[t].updateValueAndValidity())}function ae(e,t,n,o){void 0===o&&(o=!0),t?(n&&e.get(n).disable(),o&&n&&e.get(n).reset()):n&&e.get(n).enable()}function re(e,t){t.forEach((function(t){return e.get(t).reset()}))}function se(e,t,n){return void 0===n&&(n=!1),n?"("+t.map((function(t){return e+" eq '"+t+"'"})).join(" or ")+")":e+" eq '"+t+"'"}function le(e,t,n){var o=n.filter((function(e){return(e.label||"").toLocaleLowerCase().includes((t||"").toLocaleLowerCase())}));return o.length?"("+o.map((function(t){return e+" eq '"+t.value+"'"})).join(" or ")+")":""}function ce(e,t,n){var o=e.name,i=e.type,a=e.multiple,r=e.options;if("number"==typeof t)return o+" eq "+t;if("employeeSituation"==o)return Ne(t);switch(i){case l.FieldType.Date:return o+" eq '"+ee(t).format("YYYY-MM-DD")+"'";case l.FieldType.Time:return o+" eq '"+ee(t).format("HH:mm:ss")+"'";case l.FieldType.DateTime:return o+" eq '"+ee(t).format()+"'";case l.FieldType.LocalDateTime:return o+" eq '"+ee(t).format("YYYY-MM-DD[T]HH:mm:ss.SSS")+"'";case l.FieldType.Enum:return n&&n.textSeachEnum?le(o,t,r):se(o,t,a);case l.FieldType.String:return"containing(upper("+o+"), upper('"+t.replace(/'/g,"'")+"'))";case l.FieldType.Lookup:return o+" eq '"+t.id+"'";default:return o+" eq '"+t+"'"}}function pe(e,t){t.forEach((function(t){var n=e.get(t);n?de(n):console.warn("Campo não encontrado: "+t)}))}function de(e){e.markAsDirty(),e.markAsTouched(),e.updateValueAndValidity({emitEvent:!0})}(J=e.ContractType||(e.ContractType={})).EMPLOYEE="EMPLOYEE",J.DIRECTOR="DIRECTOR",J.TRAINEE="TRAINEE",J.APRENTICE="APRENTICE",J.THIRD_PARTY="THIRD_PARTY",function(e){e.WORKING="WORKING",e.DISMISSED="DISMISSED",e.EVERYONE="EVERYONE"}(Z||(Z={}));var me,ue,he,ye,fe,_e,ve,ge,be,Se,De,Te=[l.FieldType.Integer,l.FieldType.Double],Fe=/^\d+\b$/,Ee=function(e,t){return e.concat(t.filter((function(t){return!e.includes(t)})))},Ce=function(e,t){var n=ke(e,t),o=n.isValidValue;return!(n.typeExists&&!o)},ke=function(e,t){switch(e){case l.FieldType.Time:case l.FieldType.Date:case l.FieldType.DateTime:return{isValidValue:!1,typeExists:!0};case l.FieldType.Integer:case l.FieldType.Double:default:return{isValidValue:t.match(Fe),typeExists:Te.includes(e)}}},Ie=function(e){return e.instant("hcm_contract.employment_additional_info.records_found")},Re=function(e){return 4===e.length?"00"+e:5===e.length?"0"+e:e},Le=Re,Ae=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},we=function(e,t){return e.map((function(e){return z(z({},e),{label:t.map((function(t){return Ae(e,t)})).join(" - ")})}))},Pe=function(e,t){return t.filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or ")},Me=function(e,t){return e&&t?c(c(e).format("YYYY-MM-DD")+c(t).set({second:0,millisecond:0}).format("THH:mm:ssZ")):null},Ge=function(t){return[{label:t.instant("hcm_contract.employment_contract.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:t.instant("hcm_contract.employment_contract.contract_type_director"),value:e.ContractType.DIRECTOR},{label:t.instant("hcm_contract.employment_contract.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:t.instant("hcm_contract.employment_contract.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:t.instant("hcm_contract.employment_contract.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}]},Ve=function(e,t){return[{label:e.instant(t.getTranslationPrefix()+".resignation_situation_type_working"),value:Z.WORKING},{label:e.instant(t.getTranslationPrefix()+".resignation_situation_type_dismissed"),value:Z.DISMISSED},{label:e.instant(t.getTranslationPrefix()+".resignation_situation_type_all"),value:Z.EVERYONE}]},Ne=function(e){var t=c().format("YYYY-MM-DD");return e==Z.WORKING?"(employee.dismissalDate is null or employee.dismissalDate gt '"+t+"')":e==Z.DISMISSED?"(employee.dismissalDate is not null and employee.dismissalDate le '"+t+"')":""},xe=function(e,t){return[{field:"employee.employer.codEmp",header:e.instant(t.getTranslationPrefix()+".history_employer_code")},{field:"employee.employer.nomEmp",header:e.instant(t.getTranslationPrefix()+".history_employer_name")},{field:"employee.employeeSnapshot.companyBranchCode",header:e.instant(t.getTranslationPrefix()+".history_company_branch_code")},{field:"employee.employeeSnapshot.companyBranchName",header:e.instant(t.getTranslationPrefix()+".history_company_branch_name")},{field:"employee.code",header:e.instant(t.getTranslationPrefix()+".history_employee_code")},{field:"employee.person.nomPes",header:e.instant(t.getTranslationPrefix()+".history_employee_person_nom_pes")},{field:"employee.employmentRelationship.contractType",header:e.instant(t.getTranslationPrefix()+".history_employment_contract_type"),enumPrefix:"hcm_contract.employment_additional_info.contract_type_"}]},Oe=function(){function e(e,t,n,o,i){this.http=e,this.messageService=t,this.entityUrl=n,this.actionsUrl=o,this.translate=i,this.http=e,this.messageService=t,this.entityUrl=n,this.actionsUrl=o,this.translate=i,this.defaultCatch=this.defaultCatch.bind(this)}return e.prototype.getListQueryParams=function(e){var t=e.page,n=void 0===t?0:t,i=e.size,a=void 0===i?10:i,r=e.sort,s=void 0===r?[]:r,l=e.filterQuery,c=void 0===l?"":l,p=e.displayFields,d=void 0===p?[]:p,m=new o.HttpParams;return m=(m=m.append("size",String(a))).append("offset",String(n)),s&&s.length&&(m=m.append("orderby",s.map((function(e){var t="";return 1===e.order?t=" asc":-1===e.order&&(t=" desc"),""+e.field+t})).join(", "))),c&&(m=m.append("filter",c)),d&&d.length&&(m=m.append("displayfields",d.join())),m},e.prototype.getBodyParams=function(e){var t=e.page,n=void 0===t?0:t,o=e.size,i=void 0===o?10:o,a=e.sort,r=void 0===a?[]:a,s=e.filterQuery,l=void 0===s?"":s,c=e.displayFields,p=void 0===c?[]:c,d={};return d.size=i,d.offset=n,r&&r.length&&(d.orderBy=r.map((function(e){var t="";return 1===e.order?t=" asc":-1===e.order&&(t=" desc"),""+e.field+t})).join(", ")),l&&(d.filter=l),p&&p.length&&(d.displayfields=p.join()),d},e.prototype.defaultCatch=function(){var e=this;return s.catchError((function(t){if(t){var n=t.status?String(t.status):"Error",o=t.error&&t.error.message||t.statusText||t.message||"Error";401===t.status&&(n=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_title"),o=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_description")),e.messageService.add({severity:"error",life:864e5,summary:n,detail:o})}return r.throwError(t)}))},e.prototype.list=function(e){return this.http.get(this.entityUrl,{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},e.prototype.get=function(e){return this.http.get(this.entityUrl+"/"+e).pipe(this.defaultCatch())},e.prototype.insert=function(e){return this.http.post(""+this.entityUrl,e).pipe(this.defaultCatch())},e.prototype.update=function(e,t){return this.http.put(this.entityUrl+"/"+e,t).pipe(this.defaultCatch())},e.prototype.delete=function(e){return this.http.delete(this.entityUrl+"/"+e).pipe(this.defaultCatch())},e.prototype.listCustomFilter=function(e,t){return this.http.post(this.actionsUrl+"/"+t,this.getBodyParams(e)).pipe(this.defaultCatch())},e}(),Be=function(e){function n(t,n,o){var i=e.call(this,t,n,"erpx_fnd/pessoa/entities/e001pes","erpx_fnd/pessoa/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalE001Pes=function(e){return this.http.get("erpx_fnd/pessoa/entities/e001pes",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),He=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"e001pes",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/erpx_fnd/pessoa/entities/e001pes"}])],providers:[Be],declarations:[],exports:[]})],e)}();(me=e.CollectiveProcessType||(e.CollectiveProcessType={})).INCLUDE="INCLUDE",me.EXCLUDE="EXCLUDE",(ue=e.WorkshiftType||(e.WorkshiftType={})).PERMANENT="PERMANENT",ue.AUTOMATIC_SEARCH="AUTOMATIC_SEARCH",(he=e.BankAccountType||(e.BankAccountType={})).CHECKING_ACCOUNT="CHECKING_ACCOUNT",he.SAVINGS_ACCOUNT="SAVINGS_ACCOUNT",he.SALARY_ACCOUNT="SALARY_ACCOUNT",he.OTHER="OTHER",(ye=e.ESocialReasonType||(e.ESocialReasonType={})).V0="V0",ye.V1="V1",ye.V3="V3",ye.V5="V5",ye.V6="V6",ye.V7="V7",ye.V8="V8",ye.V10="V10",ye.V11="V11",ye.V12="V12",ye.V13="V13",ye.V14="V14",ye.V15="V15",ye.V16="V16",ye.V17="V17",ye.V18="V18",ye.V19="V19",ye.V20="V20",ye.V21="V21",ye.V22="V22",ye.V23="V23",ye.V24="V24",ye.V25="V25",ye.V26="V26",ye.V27="V27",ye.V28="V28",ye.V29="V29",ye.V30="V30",ye.V31="V31",ye.V33="V33",ye.V34="V34",ye.V35="V35",ye.V36="V36",ye.V37="V37",ye.V38="V38",(fe=e.ESocialWorkingHoursType||(e.ESocialWorkingHoursType={})).V1="V1",fe.V2="V2",fe.V3="V3",fe.V4="V4",(_e=e.OnusRemuneration||(e.OnusRemuneration={})).V1="V1",_e.V2="V2",_e.V3="V3",(ve=e.ProcessType||(e.ProcessType={})).V1="V1",ve.V2="V2",ve.V3="V3",(ge=e.SituationType||(e.SituationType={})).WORKING="WORKING",ge.VACATION="VACATION",ge.ILLNESSAID="ILLNESSAID",ge.LABORACCIDENT="LABORACCIDENT",ge.MILITARYSERVICE="MILITARYSERVICE",ge.MATERNITYLEAVE="MATERNITYLEAVE",ge.MATERNITYLEAVENONCRIMINALABORTION="MATERNITYLEAVENONCRIMINALABORTION",ge.MATERNITYLEAVEANTICIPATIONEXTENSION="MATERNITYLEAVEANTICIPATIONEXTENSION",ge.CITIZENCOMPANYMATERNITY="CITIZENCOMPANYMATERNITY",ge.INSSMATERNITYLEAVE="INSSMATERNITYLEAVE",ge.LEAVEWITHOUTCOMPENSATION="LEAVEWITHOUTCOMPENSATION",ge.PAIDLEAVE="PAIDLEAVE",ge.PATERNITYLEAVE="PATERNITYLEAVE",ge.CITIZENCOMPANYPATERNITY="CITIZENCOMPANYPATERNITY",ge.COLLECTIVEVACATION="COLLECTIVEVACATION",ge.MEDICALLEAVE="MEDICALLEAVE",ge.MEDICALLEAVEWITHOUTINSS="MEDICALLEAVEWITHOUTINSS",ge.ABSENCES="ABSENCES",ge.OVERTIME="OVERTIME",ge.TIMEEVALUATIONSITUATION="TIMEEVALUATIONSITUATION",ge.PRECAUTIONREADINESS="PRECAUTIONREADINESS",ge.TRADEUNIONMANDATE="TRADEUNIONMANDATE",ge.WORKACCIDENTLEAVE="WORKACCIDENTLEAVE",ge.WORKACCIDENTLEAVEWITHOUTINSS="WORKACCIDENTLEAVEWITHOUTINSS",ge.RETIREMENTDUETODISABILITY="RETIREMENTDUETODISABILITY",ge.PROFESSIONALQUALIFICATION="PROFESSIONALQUALIFICATION",ge.PRIORNOTICEHOURSWORKED="PRIORNOTICEHOURSWORKED",ge.OTHERS="OTHERS",ge.REINSTATEMENT="REINSTATEMENT",(be=e.SourceReasonChange||(e.SourceReasonChange={})).V1="V1",be.V2="V2",be.V3="V3",(Se=e.WorkAccidentType||(e.WorkAccidentType={})).V1="V1",Se.V2="V2",Se.V3="V3",(De=e.FileValidation||(e.FileValidation={})).MAX_FILE_SIZE="MAX_FILE_SIZE",De.MAX_FILE_LIMIT="MAX_FILE_LIMIT";var qe=function(n){function r(t,o,i){var a=n.call(this,t,o,"hcm_contract/employment_contract/entities/employee","hcm_contract/employment_contract/actions",i)||this;return a.http=t,a.messageService=o,a.translate=i,a.getLabelEmployeeRequest=function(e,t,n){return void 0===n&&(n=!1),n?e.contents.map((function(e){return z(z({},e),{label:a.getLabelEmployeeGeneric(e,t)})})):z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:a.getLabelEmployeeGeneric(e,t)})}))})},a.getLabelEmployeeSearch=function(e,t,n){return void 0===n&&(n=!1),n?{gridData:e.contents.map((function(e){return z(z({},e),{label:a.getLabelEmployeeGeneric(e,t)})})),totalRecords:e.totalElements}:z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:a.getLabelEmployeeGeneric(e,t)})}))})},a.loadLabelFromEnum=function(t){var n=[{label:a.translate.instant("hcm_contract.employment_contract.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:a.translate.instant("hcm_contract.employment_contract.contract_type_director"),value:e.ContractType.DIRECTOR},{label:a.translate.instant("hcm_contract.employment_contract.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:a.translate.instant("hcm_contract.employment_contract.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:a.translate.instant("hcm_contract.employment_contract.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}].filter((function(e){return e.value===t}));return n&&n.length&&n[0].label||a.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")},a}return Y(r,n),r.prototype.listExternalEmployee=function(e){return this.http.get("hcm_contract/employment_contract/entities/employee",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},r.prototype.getLabelEmployeeGeneric=function(e,t){var n=this;return t.map((function(t){return t.indexOf(".")>0&&(e[t]=n.getProp(e,t)),"employmentRelationship.contractType"===t&&(e[t]=n.loadLabelFromEnum(e[t])),e[t]})).join(" - ")},r.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},r.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},r=W([t.Injectable()],r)}(Oe),Ue=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"employee",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/employee"}])],providers:[qe],declarations:[],exports:[]})],e)}(),je=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_foundation/work_schedule/entities/workshiftGroup","hcm_foundation/work_schedule/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalWorkshiftGroup=function(e){return this.http.get("hcm_foundation/work_schedule/entities/workshiftGroup",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Ye=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"workshiftGroup",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/work_schedule/entities/workshiftGroup"}])],providers:[je],declarations:[],exports:[]})],e)}(),ze=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_foundation/work_schedule/entities/workshift","hcm_foundation/work_schedule/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalWorkshift=function(e){return this.http.get("hcm_foundation/work_schedule/entities/workshift",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),We=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"workshift",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/work_schedule/entities/workshift"}])],providers:[ze],declarations:[],exports:[]})],e)}(),Qe=c,Xe=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_contract/entities/workshiftHistory","hcm_contract/employment_contract/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i.queriesUrl="hcm_contract/employment_contract/queries",i}return Y(n,e),n.prototype.getEmployeeWorkshiftByDate=function(e,t){return this.http.post(this.queriesUrl+"/getEmployeeWorkshiftByDate",{employeeId:e,searchDate:Qe(t).format("YYYY-MM-DD")})},n.prototype.saveCollective=function(e){return this.http.post("hcm_contract/employment_contract/actions/workshiftHistoryBatch",e).pipe(this.defaultCatch())},n.prototype.deleteCollective=function(e){return this.http.post("hcm_contract/employment_contract/actions/workshiftHistoryBatchDelete",e).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Ke=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"workshiftHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/workshiftHistory"}])],providers:[Xe],declarations:[],exports:[]})],e)}(),$e=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_foundation/general/entities/annotationType","hcm_foundation/general/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalAnnotationType=function(e){return this.http.get("hcm_foundation/general/entities/annotationType",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Je=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"annotationType",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/general/entities/annotationType"}])],providers:[$e],declarations:[],exports:[]})],e)}(),Ze=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_additional_info/entities/annotationHistory","hcm_contract/employment_additional_info/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.saveCollective=function(e){return this.http.post("hcm_contract/employment_additional_info/actions/annotationHistoryBatch",e).pipe(this.defaultCatch())},n.prototype.deleteCollective=function(e){return this.http.post("hcm_contract/employment_additional_info/actions/annotationHistoryBatchDelete",e).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),et=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"annotationHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/annotationHistory"}])],providers:[Ze],declarations:[],exports:[]})],e)}(),tt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_contract/entities/bankAccountHistory","hcm_contract/employment_contract/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),nt=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"bankAccountHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/bankAccountHistory"}])],providers:[tt],declarations:[],exports:[]})],e)}(),ot=function(n){function r(e,t,o){var i=n.call(this,e,t,"hcm_contract/employment_additional_info/entities/leaveHistory","hcm_contract/employment_additional_info/actions",o)||this;return i.http=e,i.messageService=t,i.translate=o,i}return Y(r,n),r.prototype.hasV1OrV3LeaveWithinSixtyDays=function(t,n){return this.http.post("hcm_contract/employment_additional_info/queries/hasLeaveWithESocialReasonTypeInPeriod",{employeeId:t,periodStartDate:c(n).subtract(60,"days").format("YYYY-MM-DD"),periodEndDate:c(n).subtract(1,"millisecond").format("YYYY-MM-DD"),eSocialReasonTypes:[e.ESocialReasonType.V1,e.ESocialReasonType.V3]}).pipe(this.defaultCatch(),s.map((function(e){return e.result})))},r.prototype.saveCollective=function(e){return this.http.post("hcm_contract/employment_additional_info/actions/leaveHistoryBatch",e).pipe(this.defaultCatch())},r.prototype.deleteCollective=function(e){return this.http.post("hcm_contract/employment_additional_info/actions/leaveHistoryBatchDelete",e).pipe(this.defaultCatch())},r.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},r=W([t.Injectable()],r)}(Oe),it=function(){function n(e,t,n){this.http=e,this.messageService=t,this.translate=n,this.FACADE_URL="hcm_clocking_event_time_evaluation/engine_bff/apis/leaveHistoryAdjustment",this.QUERIES_URL="hcm_clocking_event_time_evaluation/engine_bff/queries"}return n.prototype.hasV1OrV3LeaveWithinSixtyDays=function(t,n){return this.http.post(this.QUERIES_URL+"/hasLeaveWithESocialReasonTypeInPeriodBFF",{employeeId:t,periodStartDate:c(n).subtract(60,"days").format("YYYY-MM-DD"),periodEndDate:c(n).subtract(1,"millisecond").format("YYYY-MM-DD"),eSocialReasonTypes:[e.ESocialReasonType.V1,e.ESocialReasonType.V3]}).pipe(this.defaultCatch(),s.map((function(e){return e.result})))},n.prototype.get=function(e,t){var n=new o.HttpParams;return(null==t?void 0:t.length)&&(n=n.set("displayfields",t.join(","))),this.http.get(this.FACADE_URL+"/"+e,{params:n}).pipe(this.defaultCatch())},n.prototype.insert=function(e){return this.http.post(this.FACADE_URL,e).pipe(this.defaultCatch())},n.prototype.update=function(e,t){return this.http.put(this.FACADE_URL+"/"+e,t).pipe(this.defaultCatch())},n.prototype.delete=function(e){return this.http.delete(this.FACADE_URL+"/"+e).pipe(this.defaultCatch())},n.prototype.defaultCatch=function(){var e=this;return s.catchError((function(t){var n;if(t){var o=t.status?String(t.status):"Error",i=(null===(n=null==t?void 0:t.error)||void 0===n?void 0:n.message)||(null==t?void 0:t.statusText)||(null==t?void 0:t.message)||"Error";401===t.status&&(o=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_title"),i=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_description")),e.messageService.add({severity:"error",summary:o,detail:i})}return r.throwError(t)}))},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(),at=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"leaveHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/leaveHistory"},{name:"customization",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/field/customization"}])],providers:[ot,it],declarations:[],exports:[]})],e)}(),rt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_additional_info/entities/disease","hcm_contract/employment_additional_info/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalDisease=function(e){return this.http.get("legal_register/shared/entities/disease",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),st=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"disease",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/disease"}])],providers:[rt],declarations:[],exports:[]})],e)}(),lt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_additional_info/entities/diseaseSubgroup","hcm_contract/employment_additional_info/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalDiseaseSubgroup=function(e){return this.http.get("legal_register/shared/entities/diseaseSubgroup",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),ct=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"diseaseSubgroup",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/diseaseSubgroup"}])],providers:[lt],declarations:[],exports:[]})],e)}(),pt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_additional_info/entities/eSocialReason","hcm_contract/employment_additional_info/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalESocialReason=function(e){return this.http.get("hcm_foundation/general/entities/eSocialReason",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.prototype.fetchESocialReasonType=function(e,t){return this.listExternalESocialReason({displayFields:["id","eSocialReasonType"],filterQuery:"situation.id eq '"+e+"' and competence le '"+c(t).format("YYYY-MM-DD")+"'",page:0,size:1,sort:[{field:"competence",order:-1}]}).pipe(s.map((function(e){return e.contents&&e.contents.length&&e.contents[0].eSocialReasonType})))},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),dt=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"eSocialReason",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/general/entities/eSocialReason"}])],providers:[pt],declarations:[],exports:[]})],e)}(),mt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_foundation/general/entities/situation","hcm_foundation/general/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalSituation=function(e){return this.http.get("hcm_foundation/general/entities/situation",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),ut=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"situation",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/general/entities/situation"},{name:"situationStructureCompanyHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/general/entities/situationStructureCompanyHistory"}])],providers:[mt],declarations:[],exports:[]})],e)}(),ht=function(){function e(e){this.http=e}return e.prototype.requestUpload=function(e){return this.http.post("platform/ecm_ged/queries/requestUpload",{fileName:e.name})},e.prototype.downloadForDocument=function(e){var t=(new o.HttpParams).set("documentId",e.documentId);return this.http.get("platform/ecm_ged/queries/requestDocumentDownload",{params:t})},e.ctorParameters=function(){return[{type:o.HttpClient}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(o.HttpClient))},token:e,providedIn:"root"}),e=W([t.Injectable({providedIn:"root"})],e)}(),yt=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"leaveHistoryAttachment",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/leaveHistoryAttachment"},{name:"customization",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/field/customization"}])],providers:[ht],declarations:[],exports:[]})],e)}(),ft=function(){function e(e){this.http=e}return e.prototype.requestUpload=function(e){return this.http.post("platform/ecm_ged/queries/requestUpload",{fileName:e.name})},e.prototype.downloadForDocument=function(e){var t=(new o.HttpParams).set("documentId",e.documentId);return this.http.get("platform/ecm_ged/queries/requestDocumentDownload",{params:t})},e.ctorParameters=function(){return[{type:o.HttpClient}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(o.HttpClient))},token:e,providedIn:"root"}),e=W([t.Injectable({providedIn:"root"})],e)}(),_t=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"annotationHistoryAttachment",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/annotationHistoryAttachment"}])],providers:[ft],declarations:[],exports:[]})],e)}();function vt(e,t){return s.catchError((function(n){if(n){var o=n.status?String(n.status):"Error",i=function(e){var t;t=e.error&&e.error.message?e.error.message:e.statusText?e.statusText:e.message?e.message:"Error";return t}(n);401===n.status&&(o=t.instant("hcm_contract.employment_contract.error_unauthorized_title"),i=t.instant("hcm_contract.employment_contract.error_unauthorized_description")),e.add({severity:"error",summary:o,detail:i})}return r.throwError(n)}))}var gt,bt=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translate=n,this.bffFacadeUrl="hcm_clocking_event_time_evaluation/engine_bff/apis/workshiftHistoryAdjustment"}return e.prototype.get=function(e){return this.http.get(this.bffFacadeUrl+"/"+e).pipe(vt(this.messageService,this.translate))},e.prototype.insert=function(e){return this.http.post(""+this.bffFacadeUrl,e).pipe(vt(this.messageService,this.translate))},e.prototype.update=function(e,t){return this.http.put(this.bffFacadeUrl+"/"+e,t).pipe(vt(this.messageService,this.translate))},e.prototype.delete=function(e){return this.http.delete(this.bffFacadeUrl+"/"+e).pipe(vt(this.messageService,this.translate))},e.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(o.HttpClient),t.ɵɵinject(i.MessageService),t.ɵɵinject(a.TranslateService))},token:e,providedIn:"root"}),e=W([t.Injectable({providedIn:"root"})],e)}(),St=function(){function e(){}return e=W([t.NgModule({declarations:[],imports:[n.PermissionsModule.forChild([{name:"workshiftHistoryAdjustment",actions:["Atualizar","Criar","Excluir","Obter"],uri:"res://senior.com.br/hcm_clocking_event_time_evaluation/engine_bff/apis/workshiftHistoryAdjustment"}])],providers:[bt]})],e)}(),Dt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_contract/entities/regulatoryNormTrainingHistory","hcm_contract/employment_contract/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Tt=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"regulatoryNormTrainingHistory",actions:["Visualizar","Incluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/regulatoryNormTrainingHistory"}])],providers:[Dt],declarations:[],exports:[]})],e)}(),Ft=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_contract/entities/workshiftInformationHistory","hcm_contract/employment_contract/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Et=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"workshiftInformationHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/workshiftInformationHistory"}])],providers:[Ft],declarations:[],exports:[]})],e)}(),Ct={domainName:"hcm_contract",serviceName:"employment_contract"},kt=function(){function e(e,t,n,o){this.http=e,this.translate=t,this.messageService=n,this.router=o}return e.prototype.doAction=function(e,t,n){return void 0===n&&(n=Ct),this.do("actions",e,t,n)},e.prototype.doQuery=function(e,t,n){return void 0===n&&(n=Ct),this.do("queries",e,t,n)},e.prototype.doSignal=function(e,t,n){return void 0===n&&(n=Ct),this.do("signals",e,t,n)},e.prototype.list=function(e,t,n){var o=this;return void 0===n&&(n=Ct),this.http.get(this.toBaseUrl(n)+"/entities/"+e,{params:this.getListQueryParams(t)}).pipe(s.catchError((function(e){return o.handleError(e)})))},e.prototype.get=function(e,t,n){var o=this;return void 0===n&&(n=Ct),this.http.get(this.toBaseUrl(n)+"/entities/"+e+"/"+t).pipe(s.catchError((function(e){return o.handleError(e)})))},e.prototype.insert=function(e,t,n){var o=this;return void 0===n&&(n=Ct),this.http.post(this.toBaseUrl(n)+"/entities/"+e,t).pipe(s.catchError((function(e){return o.handleError(e)})))},e.prototype.update=function(e,t,n,o){var i=this;return void 0===o&&(o=Ct),this.http.put(this.toBaseUrl(o)+"/entities/"+e+"/"+t,n).pipe(s.catchError((function(e){return i.handleError(e)})))},e.prototype.delete=function(e,t,n){var o=this;return void 0===n&&(n=Ct),this.http.delete(this.toBaseUrl(n)+"/entities/"+e+"/"+t).pipe(s.catchError((function(e){return o.handleError(e)})))},e.prototype.do=function(e,t,n,o){var i=this;return this.http.post(this.toBaseUrl(o)+"/"+e+"/"+t,n).pipe(s.catchError((function(e){return i.handleError(e)})))},e.prototype.toBaseUrl=function(e){return e.domainName+"/"+e.serviceName},e.prototype.getListQueryParams=function(e){var t=e.page,n=void 0===t?0:t,i=e.size,a=void 0===i?10:i,r=e.sort,s=void 0===r?[]:r,l=e.filterQuery,c=void 0===l?"":l,p=e.displayFields,d=void 0===p?[]:p,m=new o.HttpParams;return m=(m=m.append("size",String(a))).append("offset",String(n)),s&&s.length&&(m=m.append("orderby",s.map((function(e){var t="";return 1===e.order&&(t=" asc"),-1===e.order&&(t=" desc"),""+e.field+t})).join(", "))),c&&(m=m.append("filter",c)),d&&d.length&&(m=m.append("displayfields",d.join())),m},e.prototype.handleError=function(e){if(e){var t=e.status?String(e.status):"Error",n="";n=e.error&&e.error.message?e.error.message:e.statusText?e.statusText:e.message?e.message:"Error",504===(null==e?void 0:e.status)&&(t=e.status.toString(),n=this.translate.instant("hcm_contract.employment_contract.admission_error_server_description"),this.router.navigate(["error-server/"+e.status])),401===(null==e?void 0:e.status)&&(t=this.translate.instant("hcm_contract.employment_contract.error_unauthorized_title"),n=this.translate.instant("hcm_contract.employment_contract.error_unauthorized_description")),this.messageService.add({severity:"error",summary:t,detail:n})}return r.throwError(e)},e.ctorParameters=function(){return[{type:o.HttpClient},{type:a.TranslateService},{type:i.MessageService},{type:d.Router}]},e=W([t.Injectable()],e)}(),It=z({},{name:"@senior-gestao-pessoas/hcm-contract-employee-history",project:{app:"gestao-pessoas",domain:"hcm_contract",service:"employment_contract",serviceDependencies:[{service:"general",version:"develop-SNAPSHOT"}]},production:!1,ignorePermissions:!1}),Rt=function(e){function n(n,o,i,a){var s=e.call(this,n,i,It.project.domain+"/"+It.project.service+"/entities/employeeDependent",It.project.domain+"/"+It.project.service+"/actions",a)||this;return s.http=n,s.httpService=o,s.messageService=i,s.translate=a,s.dependentFormData=new r.Subject,s.openSideBarAndStartForm=new t.EventEmitter,s}return Y(n,e),n.prototype.employeeDpendentSave=function(e){return this.http.post(this.actionsUrl+"/employeeDependentSave",e).pipe(this.defaultCatch())},n.prototype.personRetrieve=function(e){return this.httpService.doAction("personRetrieve",e,{domainName:"erpx_fnd",serviceName:"pessoa"})},n.prototype.getDependentFormData=function(){return this.dependentFormData.asObservable()},n.prototype.setDependentFormData=function(e){this.dependentFormData.next(e)},n.prototype.getOpenSideBarAndStartForm=function(){return this.openSideBarAndStartForm.asObservable()},n.prototype.setOpenSideBarAndStartForm=function(e){this.openSideBarAndStartForm.emit(e)},n.ctorParameters=function(){return[{type:o.HttpClient},{type:kt},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Lt=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"employeeDependent",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/employeeDependent"},{name:"employee",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/employee"},{name:"person",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/person"}])],providers:[Rt,kt],declarations:[],exports:[]})],e)}(),At=function(){function e(){}return e=W([t.NgModule({declarations:[],imports:[n.PermissionsModule.forChild([{name:"exclusionProcess",actions:["Visualizar"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/exclusionProcess"},{name:"exclusionProcessStep",actions:["Visualizar"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/exclusionProcessStep"},{name:"exclusionProcessStepGroup",actions:["Visualizar"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/exclusionProcessStepGroup"}])]})],e)}(),wt=function(){function e(){}return e=W([t.NgModule({imports:[Ue,He,Ye,We,Ke,Je,et,nt,at,st,ct,dt,ut,yt,_t,St,Tt,Et,Lt,At]})],e)}(),Pt=c,Mt=function(){function e(){this.excluido=!1}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&Pt(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Pt(n.lastModifiedDate).toDate();return n.label=["nomPes"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&Pt(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Pt(n.lastModifiedDate).format(),delete n.label,delete n._discriminator,n},e}(),Gt=c,Vt=function(){function e(){this.deleted=!1}return e.fromDto=function(e,t){var n=z({},e);n.hireDate=n.hireDate&&Gt(n.hireDate).toDate(),n.dismissalDate=n.dismissalDate&&Gt(n.dismissalDate).toDate(),n.createdDate=n.createdDate&&Gt(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Gt(n.lastModifiedDate).toDate();return n.label=["id","code","person.nomPes","hireDate","dismissalDate","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"E001Pes"!==t&&n.person&&(n.person=Mt.fromDto(n.person,"Employee")),n},e.toDto=function(e,t){var n,o,i=z({},e);return i.hireDate=i.hireDate&&Gt(i.hireDate).format("YYYY-MM-DD"),i.dismissalDate=i.dismissalDate&&Gt(i.dismissalDate).format("YYYY-MM-DD"),i.createdDate=i.createdDate&&Gt(i.createdDate).format(),i.lastModifiedDate=i.lastModifiedDate&&Gt(i.lastModifiedDate).format(),delete i.label,delete i._discriminator,null===(n=i.employer)||void 0===n||delete n._discriminator,null===(o=i.employmentRelationship)||void 0===o||delete o._discriminator,"E001Pes"!==t&&i.person&&(i.person=Mt.toDto(i.person,"Employee")),i},e}(),Nt=c,xt=function(){function e(){this.deleted=!1}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&Nt(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Nt(n.lastModifiedDate).toDate();return n.label=["id","code","workshiftType","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&Nt(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Nt(n.lastModifiedDate).format(),delete n.label,delete n._discriminator,n},e}(),Ot=c,Bt=function(){function e(){this.deleted=!1}return e.fromDto=function(e,t){var n=z({},e);n.baseDate=n.baseDate&&Ot(n.baseDate).toDate(),n.createdDate=n.createdDate&&Ot(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Ot(n.lastModifiedDate).toDate();return n.label=["id","code","baseDate","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.baseDate=n.baseDate&&Ot(n.baseDate).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&Ot(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Ot(n.lastModifiedDate).format(),delete n.label,delete n._discriminator,n},e}(),Ht=c,qt=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.startDate=n.startDate&&Ht(n.startDate).toDate(),n.endDate=n.endDate&&Ht(n.endDate).toDate(),n.createdDate=n.createdDate&&Ht(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Ht(n.lastModifiedDate).toDate();return n.label=["id","employee.code","employee.person.codPes","employee.person.nomPes","startDate","endDate","workshift.code","workshift.name","workshiftGroup.code","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"Employee"!==t&&n.employee&&(n.employee=Vt.fromDto(n.employee,"WorkshiftHistory")),"Workshift"!==t&&n.workshift&&(n.workshift=xt.fromDto(n.workshift,"WorkshiftHistory")),"WorkshiftGroup"!==t&&n.workshiftGroup&&(n.workshiftGroup=Bt.fromDto(n.workshiftGroup,"WorkshiftHistory")),n},e.toDto=function(e,t){var n=z({},e);return n.startDate=n.startDate&&Ht(n.startDate).format("YYYY-MM-DD"),n.endDate=n.endDate&&Ht(n.endDate).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&Ht(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Ht(n.lastModifiedDate).format(),delete n.label,"Employee"!==t&&n.employee&&(n.employee=Vt.toDto(n.employee,"WorkshiftHistory")),"Workshift"!==t&&n.workshift&&(n.workshift=xt.toDto(n.workshift,"WorkshiftHistory")),"WorkshiftGroup"!==t&&n.workshiftGroup&&(n.workshiftGroup=Bt.toDto(n.workshiftGroup,"WorkshiftHistory")),delete n.workshift.workshiftType,n},e.toDtoCollective=function(e,t){var n,o,i,a=t&&t.employeeIds&&t.employeeIds.map((function(e){return e.id})),r=t&&t.companyIds&&t.companyIds.map((function(e){return e.id}));return{filter:{advancedFilterId:null===(n=null==t?void 0:t.advancedFilter)||void 0===n?void 0:n.id,companyIds:r,employeeIds:a},workshiftHistories:{startDate:(null==e?void 0:e.startDate)&&Ht(null==e?void 0:e.startDate).format("YYYY-MM-DD"),workshiftId:null===(o=null==e?void 0:e.workshift)||void 0===o?void 0:o.id,workshiftGroupId:null===(i=null==e?void 0:e.workshiftGroup)||void 0===i?void 0:i.id,eSocialWorkingHoursType:null==e?void 0:e.eSocialWorkingHoursType}}},e}(),Ut=c,jt=function(){function e(){this.excluido=!1}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&Ut(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Ut(n.lastModifiedDate).toDate();return n.label=["code","name"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&Ut(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Ut(n.lastModifiedDate).format(),delete n.label,n},e}(),Yt=c,zt=function(){function e(){}return e.fromDto=function(e,t){var n,o=z({},e);o.startDate=o.startDate&&Yt(o.startDate).toDate(),o.createdDate=o.createdDate&&Yt(o.createdDate).toDate(),o.lastModifiedDate=o.lastModifiedDate&&Yt(o.lastModifiedDate).toDate();return o.label=["employee.code","employee.person.nomPes","annotationType.code","annotationType.name","startDate"].map((function(e){return o[e]})).join(" - "),"Employee"!==t&&o.employee&&(o.employee=Vt.fromDto(o.employee,"AnnotationHistory")),"AnnotationType"!==t&&o.annotationType&&(o.annotationType=jt.fromDto(o.annotationType,"AnnotationHistory")),"Employee"!==t&&o.responsible&&(o.responsible=Vt.fromDto(o.responsible,"AnnotationHistory")),(null===(n=o.annotationHistoryAttachments)||void 0===n?void 0:n.length)&&(o.annotationHistoryAttachments=o.annotationHistoryAttachments.map((function(e){return{id:e.id,name:e.name,locationURI:e.locationURI,documentId:e.documentId,progress:100}}))),o},e.toDto=function(e,t){var n=z({},e);return n.startDate=n.startDate&&Yt(n.startDate).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&Yt(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Yt(n.lastModifiedDate).format(),delete n.label,"Employee"!==t&&n.employee&&(n.employee=Vt.toDto(n.employee,"AnnotationHistory")),"AnnotationType"!==t&&n.annotationType&&(n.annotationType=jt.toDto(n.annotationType,"AnnotationHistory")),"Employee"!==t&&n.responsible&&(n.responsible=Vt.toDto(n.responsible,"AnnotationHistory")),this.toDtoAttachments(e,n),n},e.toDtoAttachments=function(e,t){var n;(null===(n=e.annotationHistoryAttachments)||void 0===n?void 0:n.length)&&(t.annotationHistoryAttachments=e.annotationHistoryAttachments.map((function(e){return{id:e.id,name:e.name,locationURI:e.locationURI}})))},e.toDtoCollective=function(e,t){var n,o,i,a=null===(n=null==t?void 0:t.employeeIds)||void 0===n?void 0:n.map((function(e){return e.id})),r=null===(o=null==t?void 0:t.companyIds)||void 0===o?void 0:o.map((function(e){return e.id})),s=null===(i=null==t?void 0:t.advancedFilter)||void 0===i?void 0:i.id,l={startDate:e.startDate&&Yt(e.startDate).format("YYYY-MM-DD"),annotationTypeId:e.annotationType.id,documentNumber:e.documentNumber,annotation:e.annotation,responsibleId:e.responsible,sequence:e.sequence},c={filter:{advancedFilterId:s,employeeIds:a,companyIds:r},annotationHistories:l};return this.toDtoAttachments(l,c),c},e}(),Wt=c,Qt=function(){function e(){this.excluido=!1}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&Wt(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Wt(n.lastModifiedDate).toDate();return n.label=["id","codBan","nomBan","abrBan","excluido","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&Wt(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Wt(n.lastModifiedDate).format(),delete n.label,n},e}(),Xt=c,Kt=function(){function e(){this.excluido=!1}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&Xt(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Xt(n.lastModifiedDate).toDate();return n.label=["id","codAge","nomAge","excluido","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"E030Ban"!==t&&n.e030ban&&(n.e030ban=Qt.fromDto(n.e030ban,"E030Age")),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&Xt(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Xt(n.lastModifiedDate).format(),delete n.label,"E030Ban"!==t&&n.e030ban&&(n.e030ban=Qt.toDto(n.e030ban,"E030Age")),n},e}(),$t=c,Jt=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.startDate=n.startDate&&$t(n.startDate).toDate(),n.endDate=n.endDate&&$t(n.endDate).toDate(),n.createdDate=n.createdDate&&$t(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&$t(n.lastModifiedDate).toDate();return n.label=["employee.code","employee.person.codPes","employee.person.nomPes","startDate","endDate","bank.codBan","bank.nomBan","bankBranch.codAge","bankBranch.nomAge","bankAccountType","bankAccountNumber","bankAccountDigit","bankAccountPercentage"].map((function(e){return n[e]})).join(" - "),"Employee"!==t&&n.employee&&(n.employee=Vt.fromDto(n.employee,"BankAccountHistory")),"E030Ban"!==t&&n.bank&&(n.bank=Qt.fromDto(n.bank,"BankAccountHistory")),"E030Age"!==t&&n.bankBranch&&(n.bankBranch=Kt.fromDto(n.bankBranch,"BankAccountHistory")),n},e.toDto=function(e,t){var n=z({},e);return n.startDate=n.startDate&&$t(n.startDate).format("YYYY-MM-DD"),n.endDate=n.endDate&&$t(n.endDate).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&$t(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&$t(n.lastModifiedDate).format(),delete n.label,"Employee"!==t&&n.employee&&(n.employee=Vt.toDto(n.employee,"BankAccountHistory")),"E030Ban"!==t&&n.bank&&(n.bank=Qt.toDto(n.bank,"BankAccountHistory")),"E030Age"!==t&&n.bankBranch&&(n.bankBranch=Kt.toDto(n.bankBranch,"BankAccountHistory")),n},e}(),Zt=function(e){function n(t,n,o){var i=e.call(this,t,n,"erpx_fnd/financeiro/entities/e030ban","erpx_fnd/financeiro/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalE030Ban=function(e){return this.http.get("erpx_fnd/financeiro/entities/e030ban",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),en=function(e){function n(t,n,o){var i=e.call(this,t,n,"erpx_fnd/financeiro/entities/e030age","erpx_fnd/financeiro/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalE030Age=function(e){return this.http.get("erpx_fnd/financeiro/entities/e030age",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),tn=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translate=n}return e.prototype.getCompanyStructureHistoryByCompanyId=function(e,t,n,o){return this.http.get(e+"/"+t+"/entities/"+n+"StructureCompanyHistory",{params:this.getListQueryParams({filterQuery:o})}).pipe(s.map((function(e){return e&&e.contents&&e.contents})),this.defaultCatch())},e.prototype.getListQueryParams=function(e){var t=e.page,n=void 0===t?0:t,i=e.size,a=void 0===i?10:i,r=e.sort,s=void 0===r?[]:r,l=e.filterQuery,c=void 0===l?"":l,p=e.displayFields,d=void 0===p?[]:p,m=new o.HttpParams;return m=(m=m.append("size",String(a))).append("offset",String(n)),s&&s.length&&(m=m.append("orderby",s.map((function(e){var t="";return 1===e.order?t=" asc":-1===e.order&&(t=" desc"),""+e.field+t})).join(", "))),c&&(m=m.append("filter",c)),d&&d.length&&(m=m.append("displayfields",d.join())),m},e.prototype.defaultCatch=function(){var e=this;return s.catchError((function(t){if(t){var n=t.status?String(t.status):"Error",o=t.error&&t.error.message||t.statusText||t.message||"Error";401===t.status&&(n=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_title"),o=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_description")),e.messageService.add({severity:"error",summary:n,detail:o})}return r.throwError(t)}))},e.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},e=W([t.Injectable()],e)}(),nn=function(){function o(e,t){this.router=e,this.permissionsService=t,this.employeesIsPresent=new r.Subject,this.companiesIsPresent=new r.Subject,this.isUsingTable=!1,this.cancelForm=new r.Subject,this.collectiveFilterPanelCollapsed=!1}return o.prototype.checkPermissions=function(t,n){var o=this;return this.permissionsService.get(t).pipe(s.map((function(t){return n===e.CollectiveProcessType.INCLUDE?(t.incluir||o.router.navigate(["forbidden"]),t.visualizar):n===e.CollectiveProcessType.EXCLUDE?(t.excluir||o.router.navigate(["forbidden"]),t.excluir):void o.router.navigate(["not-found"])})))},o.prototype.getEmployeesIsPresent=function(){return this.employeesIsPresent.asObservable()},o.prototype.getCompaniesIsPresent=function(){return this.companiesIsPresent.asObservable()},o.prototype.setEmployeeIsPresent=function(e){this.employeesIsPresent.next(e)},o.prototype.setCompaniesIsPresent=function(e){this.companiesIsPresent.next(e)},o.prototype.setCancelForm=function(e){this.cancelForm.next(e)},o.prototype.getCancelForm=function(){return this.cancelForm.asObservable()},o.prototype.getIsUsingTable=function(){return this.isUsingTable},o.prototype.setIsUsingTable=function(e){return this.isUsingTable=e,this.isUsingTable},o.prototype.getPanelStatus=function(){return this.collectiveFilterPanelCollapsed},o.prototype.setPanelStatus=function(e){return this.collectiveFilterPanelCollapsed=e,this.collectiveFilterPanelCollapsed},o.prototype.resetPanelAndTableStatus=function(){this.setIsUsingTable(!1),this.setPanelStatus(!1)},o.ctorParameters=function(){return[{type:d.Router},{type:n.PermissionsService}]},o=W([t.Injectable()],o)}(),on=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&c(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).toDate();return n.label=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&c(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).format(),delete n.label,n},e}(),an=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&c(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).toDate();return n.label=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"DiseaseSubgroup"!==t&&n.diseaseSubgroup&&(n.diseaseSubgroup=on.fromDto(n.diseaseSubgroup,"Disease")),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&c(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).format(),delete n.label,"DiseaseSubgroup"!==t&&n.diseaseSubgroup&&(n.diseaseSubgroup=on.toDto(n.diseaseSubgroup,"Disease")),n},e}(),rn=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&c(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).toDate();return n.label=["id","code","name","situationType","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&c(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).format(),delete n.label,n},e}(),sn=function(){function e(){}return e.fromDto=function(e,t){var n,o=z({},e);o.startDate=o.startDate&&c(o.startDate).toDate(),o.endDate=o.endDate&&c(o.endDate).toDate(),o.birthDate=o.birthDate&&c(o.birthDate).toDate(),o.estimatedEndDate=o.estimatedEndDate&&c(o.estimatedEndDate).toDate(),o.createdDate=o.createdDate&&c(o.createdDate).toDate(),o.lastModifiedDate=o.lastModifiedDate&&c(o.lastModifiedDate).toDate();return o.label=["id","startDate","endDate","sourceReasonChange","processType","processNumber","birthDate","cnpjUnion","onusRemuneration","workAccidentType","justifiedDays","observation","sameReasonEsocial","resultedSicknessAssistance","estimatedEndDate","estimatedDayEnd","generatedByPayroll","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return o[e]})).join(" - "),"Employee"!==t&&o.employee&&(o.employee=Vt.fromDto(o.employee,"LeaveHistory")),"Situation"!==t&&o.situation&&(o.situation=rn.fromDto(o.situation,"LeaveHistory")),"Disease"!==t&&o.diseaseCid&&(o.diseaseCid=an.fromDto(o.diseaseCid,"LeaveHistory")),"DiseaseSubgroup"!==t&&o.subgroupCid&&(o.subgroupCid=on.fromDto(o.subgroupCid,"LeaveHistory")),(null===(n=o.leaveHistoryAttachments)||void 0===n?void 0:n.length)&&(o.leaveHistoryAttachments=o.leaveHistoryAttachments.map((function(e){return{id:e.id,name:e.name,locationURI:e.locationURI,documentId:e.documentId,progress:100}}))),o},e.toDto=function(e,t){var n,o=z({},e);return o.startDate=o.startDate&&c(o.startDate).format("YYYY-MM-DD"),o.endDate=o.endDate&&c(o.endDate).format("YYYY-MM-DD"),(null==o?void 0:o.cnpjUnion)&&"string"==typeof(null==o?void 0:o.cnpjUnion)&&(o.cnpjUnion=+o.cnpjUnion.replaceAll(".","").replaceAll("/","").replaceAll("-","")),(null==o?void 0:o.cnpjForElectiveMandatory)&&"string"==typeof(null==o?void 0:o.cnpjForElectiveMandatory)&&(o.cnpjForElectiveMandatory=o.cnpjForElectiveMandatory.replaceAll(".","").replaceAll("/","").replaceAll("-","")),(null===(n=null==o?void 0:o.cnpjForElectiveMandatory)||void 0===n?void 0:n.length)||(o.cnpjForElectiveMandatory=null),o.birthDate=o.birthDate&&c(o.birthDate).format("YYYY-MM-DD"),o.estimatedEndDate=o.estimatedEndDate&&c(o.estimatedEndDate).format("YYYY-MM-DD"),o.createdDate=o.createdDate&&c(o.createdDate).format(),o.lastModifiedDate=o.lastModifiedDate&&c(o.lastModifiedDate).format(),delete o.label,"Employee"!==t&&o.employee&&(o.employee=Vt.toDto(o.employee,"LeaveHistory")),"Situation"!==t&&o.situation&&(o.situation=rn.toDto(o.situation,"LeaveHistory")),"Disease"!==t&&o.diseaseCid&&(o.diseaseCid=an.toDto(o.diseaseCid,"LeaveHistory")),"DiseaseSubgroup"!==t&&o.subgroupCid&&(o.subgroupCid=on.toDto(o.subgroupCid,"LeaveHistory")),this.toDtoAttachments(e,o),o},e.toDtoAttachments=function(e,t){var n;(null===(n=e.leaveHistoryAttachments)||void 0===n?void 0:n.length)&&(t.leaveHistoryAttachments=e.leaveHistoryAttachments.map((function(e){return{id:e.id,name:e.name,locationURI:e.locationURI}})))},e.toDtoCollective=function(e,t){var n,o,i,a=null===(n=null==t?void 0:t.employeeIds)||void 0===n?void 0:n.map((function(e){return e.id})),r=null===(o=null==t?void 0:t.companyIds)||void 0===o?void 0:o.map((function(e){return e.id})),s=null===(i=null==t?void 0:t.advancedFilter)||void 0===i?void 0:i.id,l=z({},e),p=z(z({},e),{startDate:e.startDate&&c(e.startDate).format("YYYY-MM-DD"),endDate:e.endDate&&c(e.endDate).format("YYYY-MM-DD"),situationId:e.situation.id,estimatedEndDate:e.estimatedEndDate&&c(e.estimatedEndDate).format("YYYY-MM-DD")});p.cnpjUnion&&"string"==typeof p.cnpjUnion&&(p.cnpjUnion=+l.cnpjUnion.replaceAll(".","").replaceAll("/","").replaceAll("-",""));var d={filter:{advancedFilterId:s,employeeIds:a,companyIds:r},leaveHistories:p};return this.toDtoAttachments(p,d.leaveHistories),d},e}(),ln=function(){function e(){this.sendEsocialObservation=!1}return e.fromDto=function(e,t){var n=z({},e);n.competence=n.competence&&c(n.competence).toDate(),n.createdDate=n.createdDate&&c(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).toDate();return n.label=["id","competence","eSocialReasonType","sendEsocialObservation","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"Situation"!==t&&n.situation&&(n.situation=rn.fromDto(n.situation,"ESocialReason")),n},e.toDto=function(e,t){var n=z({},e);return n.competence=n.competence&&c(n.competence).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&c(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).format(),delete n.label,"Situation"!==t&&n.situation&&(n.situation=rn.toDto(n.situation,"ESocialReason")),n},e}(),cn=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.startDate=n.startDate&&c(n.startDate).toDate(),n.endDate=n.endDate&&c(n.endDate).toDate(),n.createdDate=n.createdDate&&c(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).toDate();return n.label=["id","eSocialTrainingCodeType","startDate","endDate","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"Employee"!==t&&n.employee&&(n.employee=Vt.fromDto(n.employee,"RegulatoryNormTrainingHistory")),n},e.toDto=function(e,t){var n=z({},e);return n.startDate=n.startDate&&c(n.startDate).format("YYYY-MM-DD"),n.endDate=n.endDate&&c(n.endDate).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&c(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).format(),delete n.label,"Employee"!==t&&n.employee&&(n.employee=Vt.toDto(n.employee,"RegulatoryNormTrainingHistory")),n},e}();!function(e){e.IS_BEFORE="isBefore",e.IS_AFTER="isAfter",e.IS_SAME="isSame",e.IS_SAME_OR_AFTER="isSameOrAfter",e.IS_SAME_OF_BEFORE="isSameOrBefore",e.IS_NOT_SAME="isNotSame"}(gt||(gt={}));var pn=function(){function e(e){this.cookieService=e}return e.prototype.getPlatformMenuURLProperties=function(e,t,n,o,i){void 0===i&&(i=!0);var a=this.parseUrl(this.getPlatformURL()?this.getPlatformURL():""),r=this.getPlatformURL()+"#/",s="";a.authorityComplete&&(s=a.authorityComplete.split(":")[0]),s.endsWith("/")||(s+="/");var l=a.scheme+":"+s+e+"/"+t+"/"+n+"/#/"+o;return i?decodeURIComponent(r)+"?category=frame&link="+encodeURIComponent(l):l},e.prototype.parseUrl=function(e){e=e||"";var t=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=e.match(t);return{completeUrl:n[0],schemeComplete:n[1],scheme:n[2],authorityComplete:n[3],authority:n[4],path:n[5],queryComplete:n[6],query:n[7],fragmentComplete:n[8],fragment:n[9]}},e.prototype.getPlatformURL=function(){return this.cookieService.get("com.senior.portal.url")},e.ctorParameters=function(){return[{type:u.CookieService}]},e=W([t.Injectable()],e)}(),dn=function(){function e(){}return e.isValidDateCompare=function(e,t,n,o){var i=this;return function(a){var r=a&&a.value;if(r&&t){r=c(a.value);var s=c(e,t);return i.dateCompare(r,s,n,o)}return null}},e.getDateFormatFromLocale=function(e,t){var n=e&&e.dateFormat;if(n){var o=n.replace(/[y]/g,"YY").replace(/[^a-zA-Z]/g,"").toUpperCase();return t&&(o=o.replace("DD","")),o}return null},e.getDateTimeFormatFromLocale=function(e){if(e){var t=e.dateFormat.toString();return t=t.replace(/[y]/g,"YY").toUpperCase(),t+=" HH:mm:ss"}return null},e.getDateFormatFromCalendar=function(e){if(e&&e.dateFormat){var t=e.dateFormat.toString();return t=t.replace(/[y]/g,"YY").toUpperCase()}return null},e.dateCompare=function(e,t,n,o){var i=n===gt.IS_NOT_SAME?gt.IS_SAME:n,a=o&&o.granularity?o.granularity:"day";if(e.isValid()&&t.isValid()){var r=e[i](t,a);if(r=n===gt.IS_NOT_SAME?!r:r){var s={};return s[o&&o.compareName?o.compareName:n]=!0,s}}return null},e.getFormatDateWithBar=function(e){if(e&&e.dateFormat){var t=e.dateFormat.toString();return t=t.replace("dd","DD").replace("mm","MM").replace("yy","YYYY")}return null},e}();function mn(e,t){e.errors&&delete e.errors[t],JSON.stringify(e.errors)==JSON.stringify({})&&e.setErrors(null)}var un,hn=c,yn=function(){function e(e,t,n,o){this.translate=e,this.baseService=t,this.platformService=n,this.messageService=o,this.gridColumnsEmployee=[{field:"employee.code",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_code")},{field:"employee.person.nomPes",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_person_nom_pes")}],this.registerFieldsForValidation=["initialValidity","finalValidity"],this.employeeFieldsForValidation=["hireDate","dismissalDate"],this.startDateDisable=!1,this.ngUnsubscribe=new r.Subject,this.processed=[],this.useBaseHistoryStructure=!0,this.isPreviewEmployee=!1,this.registerStructures=[],this.dateFormat="YYYY-MM-DD"}return Object.defineProperty(e.prototype,"employee",{set:function(e){e?(this.employeeData=e,this.gridColumnsEmployee=[]):this.gridColumnsEmployee=[{field:"employee.code",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_code")},{field:"employee.person.nomPes",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_person_nom_pes")}]},enumerable:!0,configurable:!0}),e.prototype.setValueEmployee=function(e){var t;(null===(t=this.employeeData)||void 0===t?void 0:t.employeeId)&&this.formGroup.get("employee").setValue({id:this.employeeData.employeeId,label:e||""})},e.prototype.filterByEmployee=function(e){var t=e&&e.trim(),n=t?e:"";return this.employeeData?(t&&(n+=" and "),n+"employee eq '"+this.employeeData.employeeId+"'"):n},e.prototype.getFilterRegisterByStartDate=function(e,t){var n;void 0===t&&(t=!0);var o=this.formGroup.get("startDate").value&&hn(this.formGroup.get("startDate").value).format("YYYY-MM-DD");if(o){var i="",a="";(null===(n=this.registerStructures)||void 0===n?void 0:n.length)&&(a=t?" and":"",i="("+(i=this.entity+"Structure in ("+this.registerStructures.map((function(e){return"'"+e+"'"}))+")")+")"),e=e+" "+(e&&i?"and":"")+" "+i+a+" "+(t?"(\n (initialValidity le '"+o+"' and finalValidity ge '"+o+"')\n or (initialValidity is null and finalValidity ge '"+o+"')\n or (initialValidity le '"+o+"' and finalValidity is null)\n or (initialValidity is null and finalValidity is null))":"")}return e},e.prototype.getFilterStructureCompanyHistoryByStartDate=function(e){var t=this.formGroup.get("employee").value,n=t&&t.employer&&t.employer.id,o="";return e&&n&&(o="company eq '"+n+"' and ((startDate le '"+e+"' and endDate ge '"+e+"') or (startDate le '"+e+"' and endDate is null))"),o},e.prototype.onChangeStartDate=function(e){var t,n=this.formGroup.get("employee").value,o=this.formGroup.get("startDate").value,i=!(!n||!e);if(ae(this.formGroup,!i,this.entity),!this.useBaseHistoryStructure&&(null==n?void 0:n.id)&&o){var a={companyIds:[null===(t=null==n?void 0:n.employer)||void 0===t?void 0:t.id],referenceDate:o||null,useStructure:!0};this.updateStructureParamsLookup(a)}else this.getStructureCompanyHistoryByCompanyId(e)},e.prototype.getStructureCompanyHistoryByCompanyId=function(e){var t=this;if(this.useBaseHistoryStructure&&e&&hn(e).isValid()){var n=hn(e).format("YYYY-MM-DD"),o=this.getFilterStructureCompanyHistoryByStartDate(n);n&&o&&(this.loading=!0,this.baseService.getCompanyStructureHistoryByCompanyId(this.domain,this.service,this.entity,o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return t.loading=!1}))).subscribe((function(e){e.forEach((function(e){var n=e[t.entity+"Structure"].id;t.registerStructures.includes(n)||t.registerStructures.push(n)}))})))}},e.prototype.onSelectEmployee=function(e){var t,n=this.formGroup.get("startDate").value,o=!!n&&e,i=this.formGroup.get("employee").value;if(ae(this.formGroup,!o,this.entity),this.setValidatorStartDate(e,"employee"),!this.useBaseHistoryStructure&&(null==i?void 0:i.id)&&n){var a={companyIds:[null===(t=null==i?void 0:i.employer)||void 0===t?void 0:t.id],referenceDate:n||null,useStructure:!0};this.updateStructureParamsLookup(a)}else n&&this.getStructureCompanyHistoryByCompanyId(n)},e.prototype.updateStructureParamsLookup=function(e){var t,n=hn(null==e?void 0:e.referenceDate).format("YYYY-MM-DD"),o={companyIds:e.companyIds,referenceDate:n||null,useStructure:!0};n&&(null===(t=o.companyIds)||void 0===t?void 0:t.length)&&(o.referenceDate=hn(null==o?void 0:o.referenceDate).format("YYYY-MM-DD"),this.structureParams=z(z({},this.structureParams),o))},e.prototype.setValidatorStartDate=function(e,t){var n="employee"===t?e:this.formGroup.get("employee").value,o="employee"===t?this.formGroup.get(t).value:e,i=[{field:"startDate",disabled:this.startDateDisable,clearValue:!1,validators:$([p.Validators.required],this.setValidatorRegisterValidity(o),this.setValidatorStartDateByEmployee(n))}];oe(this.formGroup,i)},e.prototype.setValidatorRegisterValidity=function(e){var t=[];return e&&e.initialValidity&&t.push(dn.isValidDateCompare(e.initialValidity,this.dateFormat,gt.IS_BEFORE,{compareName:"dateBeforeRegisterInitialDate"})),e&&e.finalValidity&&t.push(dn.isValidDateCompare(e.finalValidity,this.dateFormat,gt.IS_SAME_OR_AFTER,{compareName:"dateBeforeRegisterFinalDate"})),t},e.prototype.setValidatorStartDateByEmployee=function(e){var t=e,n=[];return t&&t.hireDate&&(n.push(dn.isValidDateCompare(t.hireDate,this.dateFormat,gt.IS_BEFORE,{compareName:"dateBeforeAdmission"})),t.dismissalDate&&n.push(dn.isValidDateCompare(t.dismissalDate,this.dateFormat,gt.IS_AFTER,{compareName:"dateAfterDismissal"}))),n},e.prototype.onEditDisableFields=function(){ae(this.formGroup,!0,"employee",!1),ae(this.formGroup,!0,"startDate",!1)},e.prototype.startFuncionsByBaseHistory=function(e){this.subscribeValuesChanges(),this.setValueEmployee(e)},e.prototype.startFuncionsByBaseHistoryInEdit=function(e){this.onEditDisableFields(),this.startDateDisable=!0,this.onChangeStartDate(e&&e.startDate)},e.prototype.subscribeValuesChanges=function(){var e=this;this.formGroup.get("employee").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.onSelectEmployee(t)})),this.formGroup.get("startDate").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.onChangeStartDate(t)}))},e.prototype.getDisableRegister=function(e,t,n,o){var i,a=this.formGroup.get("startDate").value,r=!!e||(null===(i=this.formGroup.get("employee").value)||void 0===i?void 0:i.id);return!(!!(a&&r)&&!t&&n.editar&&!o)},e.ctorParameters=function(){return[{type:a.TranslateService},{type:tn},{type:pn},{type:i.MessageService}]},W([t.Input()],e.prototype,"isPreviewEmployee",void 0),W([t.Input()],e.prototype,"employee",null),e=W([t.Component({template:""})],e)}(),fn=function(){function e(e){this._permissionsService=e}return e.prototype.hasPermissionViewEmployeeDependent=function(){return this.checkPermissions([{actions:["visualizar"],entities:["employee","e001pes","employeeDependent"]}])},e.prototype.hasEmployeeListPermission=function(){return this._permissionsService.get("employee").pipe(s.map((function(e){return e.visualizar})))},e.prototype.checkPermissions=function(e){var t=this;return r.forkJoin(e.map((function(e){return r.forkJoin(e.entities.map((function(e){return t._permissionsService.get(e)}))).pipe(s.map((function(t){return t.every((function(t){return e.actions.every((function(e){return t[e]}))}))})))}))).pipe(s.map((function(e){return e.every((function(e){return e}))})))},e.ctorParameters=function(){return[{type:n.PermissionsService}]},e=W([t.Injectable()],e)}(),_n=function(){function e(){}return e.prototype.focusFirstInvalidInput=function(){var e=Array.from(document.getElementsByClassName("ng-invalid")).find((function(e){return"FORM"!==e.nodeName}));if(e)if("P-CALENDAR"===e.nodeName){var t=e.getAttribute("ng-reflect-input-id"),n=document.getElementById(t);n&&n.focus()}else if("S-LOOKUP"===e.nodeName){var o=this.getNestedInput(e.firstElementChild);o&&o.focus()}else e.focus()},e.prototype.getNestedInput=function(e){return"INPUT"===e.nodeName?e:this.getNestedInput(e.firstElementChild)},e=W([t.Injectable()],e)}(),vn=c,gn=function(){function e(e){this.http=e,this.baseUrl="hcm_clocking_event_time_evaluation/general/"}return e.prototype.getWorkshiftChangeByDate=function(e,t){return this.http.post(this.baseUrl+"queries/getWorkshiftChangeByDate",{employeeId:e,searchDate:vn(t).format("YYYY-MM-DD")})},e.ctorParameters=function(){return[{type:o.HttpClient}]},e=W([t.Injectable()],e)}(),bn=function(){function e(){}return e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=W([t.Injectable({providedIn:"root"})],e)}(),Sn=function(){function e(e,t){this.http=e,this.messageService=t,this.http=e,this.messageService=t,this.defaultCatch=this.defaultCatch.bind(this)}return e.prototype.commitFiles=function(e){return this.http.post("platform/field_customization/actions/commitObject",{objects:e}).pipe(this.defaultCatch())},e.prototype.deleteFiles=function(e){return this.http.post("platform/field_customization/actions/deleteObjects",e).pipe(this.defaultCatch())},e.prototype.getFiles=function(e){var t=this,n=[];e.value.custom&&(n=e.value.custom.fieldCustomization||[],delete e.value.custom.fieldCustomization);var o=[],i={};return n.forEach((function(e){var n=e.domain,a=e.service,r=e.entity,s=e.toDelete,l=e.toInsert;if(!t.isEmpty(l)){var c=Object.keys(l).map((function(e){return{version:l[e].version,fileName:l[e].name,objectId:l[e].objectId}}));t.isEmpty(c)||o.push.apply(o,$(c))}if(!t.isEmpty(s)){var p=[];Object.keys(s).forEach((function(e){var t=(s[e]||[]).map((function(t){return{field:e,objectId:t}}));p.push.apply(p,$(t))})),i={domain:n,service:a,entityName:r,objects:p}}})),{filesToCommit:o,filesToDelete:i}},e.prototype.isEmpty=function(e){return Array.isArray(e)?0===e.length:0===Object.entries(e).length&&e.constructor===Object},e.prototype.defaultCatch=function(){var e=this;return s.catchError((function(t){if(t){var n=t.status?String(t.status):"Error",o=t.error&&t.error.message||t.statusText||t.message||"Error";e.messageService.add({severity:"error",summary:n,detail:o})}return r.throwError(t)}))},e.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService}]},e=W([t.Injectable()],e)}(),Dn=function(){},Tn=function(){function e(){this.ZERO=0,this.MINUTES_IN_A_HOUR=60}return e.prototype.dateToMinutes=function(e,t){return e?this.getTotalMinutes(e.getHours(),e.getMinutes()):t?this.ZERO:void 0},e.prototype.minutesToDate=function(e){if(Boolean(e)||0===e){var t=this.getHours(e),n=this.getMinutes(e);return this.toDate(t,n)}return null},e.prototype.toDate=function(e,t){var n=new Date;return n.setHours(e),n.setMinutes(t),n},e.prototype.getHours=function(e){return Math.floor(e/this.MINUTES_IN_A_HOUR)},e.prototype.getMinutes=function(e){return e%this.MINUTES_IN_A_HOUR},e.prototype.getTotalMinutes=function(e,t){return e*this.MINUTES_IN_A_HOUR+t},e=W([t.Injectable()],e)}(),Fn=function(){function e(){this.GET_USER_ID=A.user.getUserData().then((function(e){return e.id}))}return e.prototype.store=function(e,t){return Q(this,void 0,void 0,(function(){var n,o;return X(this,(function(i){switch(i.label){case 0:return o=(n=localStorage).setItem,[4,this.GET_USER_ID];case 1:return o.apply(n,[i.sent()+"_"+e,JSON.stringify(t)]),[2]}}))}))},e.prototype.get=function(e){return Q(this,void 0,void 0,(function(){var t,n,o,i;return X(this,(function(a){switch(a.label){case 0:return n=(t=JSON).parse,i=(o=localStorage).getItem,[4,this.GET_USER_ID];case 1:return[2,n.apply(t,[i.apply(o,[a.sent()+"_"+e])])||{}]}}))}))},e}(),En=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.FILTERS_KEY="SENIOR_FILTERS",t}return Y(n,e),n.prototype.storeFilters=function(t,n){return Q(this,void 0,void 0,(function(){var o;return X(this,(function(i){switch(i.label){case 0:return[4,e.prototype.get.call(this,this.FILTERS_KEY)];case 1:return o=i.sent()||{},this.removeEmptyValues(n),o[t]=n,[4,e.prototype.store.call(this,this.FILTERS_KEY,o)];case 2:return i.sent(),[2]}}))}))},n.prototype.getFilters=function(t){return Q(this,void 0,void 0,(function(){return X(this,(function(n){switch(n.label){case 0:return[4,e.prototype.get.call(this,this.FILTERS_KEY)];case 1:return[2,(n.sent()||{})[t]||{}]}}))}))},n.prototype.removeFilter=function(t){return Q(this,void 0,void 0,(function(){var n;return X(this,(function(o){switch(o.label){case 0:return[4,e.prototype.get.call(this,this.FILTERS_KEY)];case 1:return delete(n=o.sent()||{})[t],[4,e.prototype.store.call(this,this.FILTERS_KEY,n)];case 2:return o.sent(),[2]}}))}))},n.prototype.clearFilterValue=function(t,n){return Q(this,void 0,void 0,(function(){var o;return X(this,(function(i){switch(i.label){case 0:return[4,e.prototype.get.call(this,this.FILTERS_KEY)];case 1:return o=i.sent()||{},this.removeEmptyValues(n),o[t]=n,[4,e.prototype.store.call(this,this.FILTERS_KEY,o)];case 2:return i.sent(),[2]}}))}))},n.prototype.removeEmptyValues=function(e){Object.keys(e).forEach((function(t){(Array.isArray(e[t])?0!==e[t].length:e[t])||delete e[t]}))},n=W([t.Injectable()],n)}(Fn),Cn=function(){function e(){this.GET_USER_ID=A.user.getUserData().then((function(e){return e.id})),this.PAGINATOR_KEY="SENIOR_PAGINATOR"}return e.prototype.store=function(e,t){return Q(this,void 0,void 0,(function(){var n,o;return X(this,(function(i){switch(i.label){case 0:return o=(n=sessionStorage).setItem,[4,this.GET_USER_ID];case 1:return o.apply(n,[i.sent()+"_"+e,JSON.stringify(t)]),[2]}}))}))},e.prototype.get=function(e){return Q(this,void 0,void 0,(function(){var t,n,o,i;return X(this,(function(a){switch(a.label){case 0:return n=(t=JSON).parse,i=(o=sessionStorage).getItem,[4,this.GET_USER_ID];case 1:return[2,n.apply(t,[i.apply(o,[a.sent()+"_"+e])])||{}]}}))}))},e.prototype.storePaginator=function(e,t){return void 0===t&&(t={}),Q(this,void 0,void 0,(function(){var n;return X(this,(function(o){switch(o.label){case 0:return[4,this.get(this.PAGINATOR_KEY)];case 1:return(n=o.sent()||{})[e]=t,[4,this.store(this.PAGINATOR_KEY,n)];case 2:return o.sent(),[2]}}))}))},e.prototype.getPaginator=function(e){return Q(this,void 0,void 0,(function(){return X(this,(function(t){switch(t.label){case 0:return[4,this.get(this.PAGINATOR_KEY)];case 1:return[2,(t.sent()||{})[e]||{}]}}))}))},e=W([t.Injectable()],e)}(),kn=function(){function e(){}return e=W([t.NgModule({imports:[C.SplitButtonModule,F.MessagesModule,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,f.CurrencyMaskModule,l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,P.FilterContainerModule,l.DynamicFormModule,E.PanelModule,D.InputTextModule,l.ButtonModule,v.ConfirmDialogModule,_.CalendarModule,y.HotkeyModule,l.LoadingStateModule,b.InputMaskModule,l.InfoSignModule,g.DropdownModule,T.InputTextareaModule,R.ToastModule,L.ToggleButtonModule],providers:[En,Cn,_n,Sn,gn,bn,fn,{provide:Dn,useClass:Tn}],declarations:[],exports:[C.SplitButtonModule,F.MessagesModule,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,l.DynamicFormModule,E.PanelModule,D.InputTextModule,l.ButtonModule,v.ConfirmDialogModule,l.CalendarMaskModule,_.CalendarModule,y.HotkeyModule,l.LoadingStateModule,T.InputTextareaModule,S.InputSwitchModule,l.TokenListModule,k.TableModule,R.ToastModule,w.SelectButtonModule,l.TableModule,L.ToggleButtonModule,I.TabViewModule,M.ExclusionDetailsModule]})],e)}(),In=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn],declarations:[yn],providers:[tn],exports:[yn]})],e)}(),Rn=c,Ln=function(e){function n(t,n,o,i,a){var r=e.call(this,t,n,o,i)||this;return r.translate=t,r.baseService=n,r.platformService=o,r.messageService=i,r.collectiveService=a,r.collectiveFormGroup=new p.FormGroup({}),r.processed=[],r.companyIds=[],r.isCollective=!1,r}return Y(n,e),n.prototype.startFuncionsByBaseCollectiveHistory=function(){this.subscribeValuesChangesInCollective(),this.logsURL=this.platformService.getPlatformMenuURLProperties("logs","logs","process","process-summary-user",!0)},n.prototype.subscribeValuesChangesInCollective=function(){var e=this;this.formGroup.get("startDate").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe),s.distinct()).subscribe((function(t){e.onChangeStartDateInCollective(t)}))},n.prototype.onChangeStartDateInCollective=function(e){var t=this.formGroup.get("startDate").value;ae(this.formGroup,!t,this.entity),!this.useBaseHistoryStructure&&t?this.setStructureParamsInCollective():t&&this.getStructureCompanyHistoryByCompaniesInCollective(t)},n.prototype.getStructureCompanyHistoryByCompaniesInCollective=function(e){var t,n=this;if(this.useBaseHistoryStructure&&e&&Rn(e).isValid()&&(null===(t=this.companyIds)||void 0===t?void 0:t.length)){var o=Rn(e).format("YYYY-MM-DD"),i=this.getFilterStructureCompanyHistoryByStartDateInCollective(o);i&&o&&(this.loading=!0,this.baseService.getCompanyStructureHistoryByCompanyId(this.domain,this.service,this.entity,i).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return n.loading=!1}))).subscribe((function(e){e.forEach((function(e){var t=e[n.entity+"Structure"].id;n.registerStructures.includes(t)||n.registerStructures.push(t)}))})))}else this.registerStructures=[]},n.prototype.getFilterStructureCompanyHistoryByStartDateInCollective=function(e){var t="";return e&&this.companyIds&&(t="company in ("+this.companyIds.map((function(e){return"'"+e+"'"}))+") and ((startDate le '"+e+"' and endDate ge '"+e+"') or (startDate le '"+e+"' and endDate is null))"),t},n.prototype.setStructureParamsInCollective=function(){var e,t=this.formGroup.get("startDate").value,n={companyIds:this.companyIds,referenceDate:t||null,useStructure:!0};t&&(null===(e=this.companyIds)||void 0===e?void 0:e.length)?(n.referenceDate=Rn(null==n?void 0:n.referenceDate).format("YYYY-MM-DD"),this.structureParams=z(z({},this.structureParams),n)):this.structureParams={companyIds:null,referenceDate:null,useStructure:!1}},n.prototype.doAfterProcess=function(e){this.collectiveService.setCancelForm(!0),this.loading=!1;var t={evaluateProcessStart:this.translate.instant("hcm_contract.employment_contract.evaluate_process_start"),evaluteProcessConclusion:this.translate.instant("hcm_contract.employment_contract.evaluate_process_conclusion"),clickHere:this.translate.instant("hcm_contract.employment_contract.click_here")};this.messageService.addAll([{severity:"success",summary:this.translate.instant("hcm_contract.employment_contract.success_tooltip"),detail:t.evaluteProcessConclusion}]),this.processed=[],this.processed.push([{key:"info",severity:"info",summary:t.evaluateProcessStart+' <a target="_parent" href="'+this.logsURL+"/"+e.summaryId+'">'+t.clickHere+"</a>"}]),this.collectiveService.setEmployeeIsPresent(!1),this.collectiveService.setCompaniesIsPresent(!1),this.collectiveService.resetPanelAndTableStatus()},n.prototype.onSelectBasicFilterByEmployee=function(e){var t,n,o=this;e?(this.employeeFilter=e,this.onSelectBasicFilter()):!e&&(null===(t=this.employeeFilter)||void 0===t?void 0:t.length)&&(null===(n=this.employeeFilter)||void 0===n||n.filter((function(e){var t,n=null===(t=e.employer)||void 0===t?void 0:t.id;o.companyIds.splice(n,1)})));var i=this.formGroup.get("startDate").value;!this.useBaseHistoryStructure&&i?this.setStructureParamsInCollective():i&&this.getStructureCompanyHistoryByCompaniesInCollective(i)},n.prototype.onSelectBasicFilter=function(){var e,t,n=this;this.companyIds=[],null===(e=this.employeeFilter)||void 0===e||e.filter((function(e){var t,o,i,a=null===(t=e.employer)||void 0===t?void 0:t.id;if(!(null===(o=n.companyIds)||void 0===o?void 0:o.length)||(null===(i=n.companyIds)||void 0===i?void 0:i.length)&&!n.companyIds.includes(a))return n.companyIds.push(a)})),null===(t=this.companyFilter)||void 0===t||t.filter((function(e){var t,o,i=e.id?e.id:e;if(!(null===(t=n.companyIds)||void 0===t?void 0:t.length)||(null===(o=n.companyIds)||void 0===o?void 0:o.length)&&!n.companyIds.includes(i))return n.companyIds.push(i)}))},n.prototype.onSelectBasicFilterByCompany=function(e){var t,n,o=this;e?(this.companyFilter=e,this.onSelectBasicFilter()):!e&&(null===(t=this.companyFilter)||void 0===t?void 0:t.length)&&(null===(n=this.companyFilter)||void 0===n||n.filter((function(e){var t=e.id;o.companyIds.splice(t,1)})));var i=this.formGroup.get("startDate").value;!this.useBaseHistoryStructure&&i?this.setStructureParamsInCollective():i&&this.getStructureCompanyHistoryByCompaniesInCollective(i)},n.ctorParameters=function(){return[{type:a.TranslateService},{type:tn},{type:pn},{type:i.MessageService},{type:nn}]},W([t.Input()],n.prototype,"companyIds",void 0),W([t.Input()],n.prototype,"isCollective",void 0),n=W([t.Component({template:""})],n)}(yn),An=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn],declarations:[Ln],providers:[tn],exports:[Ln]})],e)}();!function(e){e.EMPLOYEE="EMPLOYEE",e.MANAGEMENT="MANAGEMENT"}(un||(un={}));var wn=c,Pn=function(e){function n(t,n,o,i,a,s){var l=e.call(this,t,n,i,a)||this;return l.translate=t,l.baseService=n,l.employeeService=o,l.platformService=i,l.messageService=a,l.leaveHistoryBffService=s,l.onClose=new r.Subject,l.onFormLoadingSubject=new r.Subject,l.onCloseObservable=l.onClose.asObservable(),l.onFormLoading=l.onFormLoadingSubject.asObservable(),l.isClockingEvent=!1,l.gridColumnsEmployee=[{field:"employee.code",header:l.translate.instant("hcm_contract.employment_contract.workshift_history_employee_code")},{field:"employee.person.nomPes",header:l.translate.instant("hcm_contract.employment_contract.workshift_history_employee_person_nom_pes")}],l.DELETE="Delete",l}var o;return Y(n,e),o=n,Object.defineProperty(n.prototype,"employee",{set:function(e){e?(this.employeeData=e,this.gridColumnsEmployee=[{field:"employee.code",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_code")},{field:"employee.person.nomPes",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_person_nom_pes")}]):this.gridColumnsEmployee=[]},enumerable:!0,configurable:!0}),n.prototype.updateSuggestions=function(e){throw new Error("You have to implement the method updateSuggestions!")},n.prototype.clockingEventOnSave=function(){throw new Error("You have to implement the method clockingEventOnSave!")},n.prototype.onDelete=function(){throw new Error("You have to implement the method onDelete!")},n.prototype.setHotkeys=function(){throw new Error("You have to implement the method setHotkeys!")},n.prototype.createHistoryDTO=function(e,t){throw new Error("You have to implement the method createHistoryDTO!")},n.prototype.isNew=function(){throw new Error("You have to implement the method isNew!")},n.prototype.goBack=function(){throw new Error("You have to implement the method goBack!")},n.prototype.finishOperation=function(){this.isClockingEvent&&this.onClose.next(!0)},n.prototype.createClockingEventLeaveHistoryObservable=function(e){var t;if(e.situation=function(e){var t=new rn;return t.id=e.situation.id,t}(e),e.employee=function(e){var t=new Vt;return t.id=e.employee.id,t}(e),this.isNew()||this.employeeData&&!e.id)t=this.leaveHistoryBffService.insert(e);else{var n=this.employeeData?e.id:this.routeParams.leaveHistory;t=this.leaveHistoryBffService.update(n,e)}return t},n.prototype.deleteClockingEventLeaveHistory=function(e){return this.leaveHistoryBffService.delete(e)},n.prototype.allocateLoadedEmployee=function(){var e,t,n=this;this.employeeData?(this.onFormLoadingSubject.next(!0),this.loadLockedEmployee(this.employeeData),null===(e=this.onSubmitObservable)||void 0===e||e.pipe(s.takeUntil(this.ngUnsubscribe),s.filter((function(e){return e===n.historyName||e===""+n.historyName+n.DELETE}))).subscribe((function(e){n.getOperationType(e)===n.DELETE?n.onDelete():n.clockingEventOnSave()})),null===(t=this.onLockedEmployeeChanges)||void 0===t||t.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){n.loadLockedEmployee(e)}))):this.setHotkeys()},n.prototype.addMessage=function(e,t,n){this.employeeData&&this.isClockingEvent?this.messageService.add({key:"employee-clocking-event-adjustment-list-view",severity:e,summary:this.translate.instant(t),detail:this.translate.instant(n)}):this.messageService.add({severity:e,summary:this.translate.instant(t),detail:this.translate.instant(n)})},n.prototype.loadLockedEmployee=function(e){var t=this;if(this.formGroup.controls[o.EMPLOYEE].value)this.formGroup.controls[o.START_DATE].setValue(wn(e.evaluationDate).toDate()),this.onFormLoadingSubject.next(!1);else{var n={filterQuery:"id eq '"+e.employeeId+"'",displayFields:["person.nomPes","employer.*","code","employmentRelationship.contractType"]};this.loading=!0,this.formGroup.controls.employee.disable(),this.employeeService.listExternalEmployee(n).subscribe((function(n){if(!e.schedule){var o=t.createHistoryDTO(e.evaluationDate,n.contents[0]);t.updateSuggestionsAndPatchValue(o),t.loading=!1,t.onFormLoadingSubject.next(!1)}}))}},n.prototype.getOperationType=function(e){var t=e.split(/(?=[A-Z])/);return t[t.length-1]},n.prototype.updateSuggestionsAndPatchValue=function(e){this.formGroup.patchValue(e),this.updateSuggestions(e)},Object.defineProperty(n.prototype,"isReadOnly",{get:function(){var e;return this.isClockingEvent&&(null===(e=this.employeeData)||void 0===e?void 0:e.readOnly)},enumerable:!0,configurable:!0}),n.prototype.setDisabledStatus=function(e){this.isReadOnly&&e.disable()},n.EMPLOYEE="employee",n.START_DATE="startDate",n.ctorParameters=function(){return[{type:a.TranslateService},{type:tn},{type:qe},{type:pn},{type:i.MessageService},{type:it}]},W([t.Input()],n.prototype,"onSubmitObservable",void 0),W([t.Input()],n.prototype,"onLockedEmployeeChanges",void 0),W([t.Output()],n.prototype,"onCloseObservable",void 0),W([t.Output()],n.prototype,"onFormLoading",void 0),W([t.Input()],n.prototype,"isClockingEvent",void 0),W([t.Input()],n.prototype,"employee",null),n=o=W([t.Component({template:""})],n)}(Ln),Mn=c,Gn=function(n){function o(t,o,i,a,r,s,l,p,d,m,u,h,y,f,_,v,g,b,S,D,T){var F=n.call(this,l,f,h,v,a)||this;return F.workshiftHistoryService=t,F.router=o,F.route=i,F.messageService=a,F.confirmationService=r,F.formBuilder=s,F.translate=l,F.hotkeysService=p,F.fieldCustomization=d,F.focusService=m,F.workshiftGroupService=u,F.employeeService=h,F.cd=y,F.baseService=f,F.clockingEventFoundationGeneralService=_,F.platformService=v,F.workshiftLookupService=g,F.collectiveService=b,F.workshiftHistoryAdjustmentService=S,F.employeeLibService=D,F.workshiftInformationHistoryService=T,F.localeConfig={},F.currencyLocaleOptions={},F.permissions={},F.allPermissions={},F.requiredWorkshiftGroup=!1,F.mainPanelCollapsed=!1,F.workshiftGroupLookupDisplayFields=["code","baseDate"],F.workshiftGroupAdvancedDisplayFields=["code","baseDate"],F.eSocialWorkingHoursTypeOptions=[{label:F.translate.instant("hcm_contract.employment_contract.workshift_esocial_working_hours_type_v1"),value:e.ESocialWorkingHoursType.V1},{label:F.translate.instant("hcm_contract.employment_contract.workshift_esocial_working_hours_type_v2"),value:e.ESocialWorkingHoursType.V2},{label:F.translate.instant("hcm_contract.employment_contract.workshift_esocial_working_hours_type_v3"),value:e.ESocialWorkingHoursType.V3},{label:F.translate.instant("hcm_contract.employment_contract.workshift_esocial_working_hours_type_v4"),value:e.ESocialWorkingHoursType.V4}],F.domain=c.DOMAIN,F.service=c.SERVICE,F.entity=c.WORKSHIFT,F.historyName=c.HISTORY_NAME,F.useBaseHistoryStructure=!1,F}var c;return Y(o,n),c=o,o.prototype.ngOnInit=function(){var e=this;this.collectiveProcessType=this.route.snapshot.fragment,this.formGroup=this.getFormGroup(),this.route.queryParams.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){t.id&&(e.employeeData={employeeId:t.id})})),this.allocateLoadedEmployee(),this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)})),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.workshiftGroupSearchFields=this.getWorkshiftGroupSearchFields(),this.workshiftGroupSearchGridFields=this.getWorkshiftGroupSearchGridFields(),this.setHotkeys()},o.prototype.ngAfterViewChecked=function(){this.cd.detectChanges()},o.prototype.ngAfterViewInit=function(){var e=document.getElementsByTagName("input"),t=Array.from(e).find((function(e){return!e.disabled}));t&&!this.isClockingEvent&&t.focus()},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+s",(function(){return(e.isNew()||e.permissions.editar)&&e.confirmBeforeSave(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+c",(function(){return e.onCancel(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.isNew=function(){return"new"===this.routeParams.workshiftHistory},o.prototype.fieldIsNotNull=function(e){return!!this.formGroup.get(e).value},o.prototype.onRouteParamsChange=function(e){this.routeParams=e},o.prototype.updateSuggestions=function(e){var t,n,o=this;e.workshiftGroup&&(e.workshiftGroup.label=this.buildWorkshiftGroupLabel(e.workshiftGroup)),this.workshiftLookupService.updateSuggestions(e);var i=this.formGroup.get("eSocialWorkingHoursType");i.disable(),this.workshiftInformationHistoryService.list({filterQuery:"employee.id eq '"+(null===(t=e.employee)||void 0===t?void 0:t.id)+"' and startDate eq '"+Mn(e.startDate).format("YYYY-MM-DD")+"'"}).pipe(s.finalize((function(){o.loading=!1,o.permissions.editar&&i.enable()}))).subscribe((function(e){var t;if(null===(t=e.contents)||void 0===t?void 0:t.length){var n=e.contents.reduce((function(e,t){return new Date(e.startDate)>new Date(t.startDate)?e:t}));i.setValue(n.eSocialWorkingHoursType)}})),this.employeeLibService.updateSuggestions(e),this.labelEmployee=null===(n=e.employee)||void 0===n?void 0:n.label},o.prototype.buildWorkshiftGroupLabel=function(e){return this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_group").concat(" - "+e.code+" - "+Mn(e.baseDate).format("L"))},o.prototype.onRouteDataChange=function(e){var t,n,o=e.localeConfig.number,i=o.currencySymbol,a=o.thousandsSeparator,r=o.decimalSeparator;if(this.isManager="profileType"in e&&e.profileType===un.MANAGEMENT,this.localeConfig=e.localeConfig,this.currencyLocaleOptions={align:"left",prefix:i,thousands:a,decimal:r},this.permissions=null===(t=null==e?void 0:e.allPermissions)||void 0===t?void 0:t.workshiftHistory,this.allPermissions=null==e?void 0:e.allPermissions,this.customizationPermission=null===(n=null==e?void 0:e.allPermissions)||void 0===n?void 0:n.customization,this.validateVisualization(),e.entity){this.permissions.editar||this.formGroup.disable(),e.entity.workshift.name||(e.entity.workshift.name=this.translate.instant("hcm_contract.employment_contract.list_grid_empty_field"));var s=qt.fromDto(e.entity);this.updateSuggestions(s),this.formGroup.patchValue(s),this.onSelectWorkshift(null==s?void 0:s.workshift,!1),this.startFuncionsByBaseHistoryInEdit(s),this.setDisabledStatus(this.formGroup)}else this.formGroup.patchValue(new qt),this.isCollective?this.startFuncionsByBaseCollectiveHistory():this.startFuncionsByBaseHistory()},o.prototype.onCancel=function(){this.isCollective?this.collectiveService.setCancelForm(!0):this.goBack()},o.prototype.onSendFile=function(e,t){var n=[];return this.fieldCustomization.isEmpty(e)||n.push(this.fieldCustomization.deleteFiles(e)),this.fieldCustomization.isEmpty(t)||n.push(this.fieldCustomization.commitFiles(t)),this.fieldCustomization.isEmpty(n)?r.of({}):r.forkJoin(n)},o.prototype.confirmBeforeSave=function(){var e=this;if(this.loading=!1,!this.formGroup.valid)return this.onFormLoadingSubject.next(!1),this.validateAllFormFields(this.formGroup);(this.isNew()||this.employeeData)&&this.formGroup.get("employee").value?this.workshiftHistoryService.getEmployeeWorkshiftByDate(this.formGroup.get("employee").value.id,this.formGroup.get("startDate").value).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(t){return e.infoBeforeSave(),r.throwError(t)}))).subscribe((function(t){var n,o;(null===(n=e.formGroup.value.workshift)||void 0===n?void 0:n.id)===t.workshiftId&&(null===(o=e.formGroup.value.workshiftGroup)||void 0===o?void 0:o.id)===t.workshiftGroupId?e.confirmationService.confirm({header:e.translate.instant("hcm_contract.employment_contract.generic_confirm"),message:e.translate.instant("hcm_contract.employment_contract.validation_employee_has_this_work_shift_on_period"),accept:function(){e.loading=!0,e.infoBeforeSave()}}):e.infoBeforeSave()})):(this.loading=!1,this.onSave())},o.prototype.infoBeforeSave=function(){var e=this;this.loading=!0,this.clockingEventFoundationGeneralService.getWorkshiftChangeByDate(this.formGroup.get("employee").value.id,this.formGroup.get("startDate").value).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(t){return e.onSave(),r.throwError(t)}))).subscribe((function(t){t.startDate&&e.messageService.add({severity:"warn",detail:e.translate.instant("hcm_contract.employment_contract.employee_has_workshift_change_in_period",{startDate:Mn(t.startDate).format(e.localeConfig.calendar.dateFormat.toUpperCase()),endDate:Mn(t.endDate).format(e.localeConfig.calendar.dateFormat.toUpperCase())})}),e.onSave()}))},o.prototype.onSave=function(){var e=this;this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onSaveCollective()}}):this.onSaveSigle()},o.prototype.onSaveCollective=function(){var e=this;this.loading=!0;var t=this.formGroup.getRawValue(),n=this.collectiveFormGroup.getRawValue(),o=qt.toDtoCollective(t,null==n?void 0:n.filter);this.workshiftHistoryService.saveCollective(o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onSaveSigle=function(){var e=this;this.loading=!0;var t=this.fieldCustomization.getFiles(this.formGroup),n=t.filesToDelete,o=t.filesToCommit;this.getSaveObservable().pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,e.onFormLoadingSubject.next(!1),r.throwError(t)}))).subscribe((function(){e.onSendFile(n,o).pipe(s.takeUntil(e.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,r.throwError(t)}))).subscribe((function(){e.addMessage("success","hcm_contract.employment_contract.saved_message_title","hcm_contract.employment_contract.saved_message_content"),e.employeeData&&e.isClockingEvent?(e.onClose.next(!0),e.loading=!1):e.goBack()}))}))},o.prototype.onDeleteCollective=function(){var e=this,t=this.formGroup.getRawValue(),n=this.collectiveFormGroup.getRawValue(),o=qt.toDtoCollective(t,null==n?void 0:n.filter);this.workshiftHistoryService.deleteCollective(o).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onDelete=function(){var e=this;if(!this.formGroup.valid)return this.loading=!1,this.onFormLoadingSubject.next(!1),this.validateAllFormFields(this.formGroup);this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onDeleteCollective()}}):this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_title"),accept:function(){e.showLoader=!0,e.loading=!0,e.onFormLoadingSubject.next(!0),e.getDeleteObservable().pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.loading=!1,e.showLoader=!1}))).subscribe((function(){e.goBack(),e.finishOperation()}))}})},o.prototype.doAfterProcessAndResetFormGroup=function(e){this.doAfterProcess(e),this.resetFormGroup()},o.prototype.resetFormGroup=function(){this.formGroup.reset(),this.formGroup.get("workshiftGroup").disable()},o.prototype.onWorkshiftGroupLookupRequest=function(e,t){var n=this;void 0===t&&(t=!1);var o=this.workshiftGroupLookupDisplayFields.map((function(e){return{field:e,order:1}})),i=this.getWorkshiftGroupSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or ");i=this.getFilterWorkshiftGroup(i);var a=Ee(this.workshiftGroupLookupDisplayFields,this.workshiftGroupAdvancedDisplayFields);this.workshiftGroupService.listExternalWorkshiftGroup({sort:o,filterQuery:i,displayFields:a}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:n.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_group")+" - "+e.code+" - "+(e&&Mn(e.baseDate).format("L"))})}))})}))).subscribe((function(e){n.workshiftGroupLookupSuggestions=e.contents,t&&n.workshiftGroupLookupSuggestions.length&&1==n.workshiftGroupLookupSuggestions.length&&n.formGroup.get("workshiftGroup").setValue(n.workshiftGroupLookupSuggestions[0])}))},o.prototype.onWorkshiftGroupSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getWorkshiftGroupSearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+Mn(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+Mn(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+Mn(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and ");p=this.getFilterWorkshiftGroup(p);var d=Ee(this.workshiftGroupLookupDisplayFields,this.workshiftGroupAdvancedDisplayFields);this.workshiftGroupService.listExternalWorkshiftGroup({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_group")+" - "+e.code+" - "+(e&&Mn(e.baseDate).format("L"))})}))})}))).subscribe((function(e){t.workshiftGroupSearchGridData=e.contents,t.workshiftGroupSearchTotalRecords=e.totalElements}))},o.prototype.getFormGroup=function(){return this.formBuilder.group({id:[{value:void 0,disabled:!0},p.Validators.compose([])],employee:[{value:void 0,disabled:!1},p.Validators.compose(this.isCollective?[]:[p.Validators.required])],startDate:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required])],endDate:[{value:void 0,disabled:!1},p.Validators.compose([])],workshift:[{value:void 0,disabled:!0},p.Validators.compose([p.Validators.required])],workshiftGroup:[{value:void 0,disabled:!0},p.Validators.compose([])],eSocialWorkingHoursType:[{value:void 0,disabled:!1},p.Validators.compose([])],createdBy:[{value:void 0,disabled:!0},p.Validators.compose([])],createdDate:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedBy:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedDate:[{value:void 0,disabled:!0},p.Validators.compose([])],custom:[]})},o.prototype.getWorkshiftGroupSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.workshift_group_code"),type:l.FieldType.Integer}),new l.FormField({name:"baseDate",label:this.translate.instant("hcm_contract.employment_contract.workshift_group_base_date"),type:l.FieldType.Date,appendTo:"body",calendarLocaleOptions:this.localeConfig.calendar,dateFormat:this.localeConfig.calendar.dateFormat})]},o.prototype.getWorkshiftGroupSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.workshift_group_code"),type:l.FieldType.Integer}),new l.FormField({name:"baseDate",label:this.translate.instant("hcm_contract.employment_contract.workshift_group_base_date"),type:l.FieldType.Date,appendTo:"body",calendarLocaleOptions:this.localeConfig.calendar,dateFormat:this.localeConfig.calendar.dateFormat})]},o.prototype.goBack=function(){history.back();this.router.navigate(["../"],{relativeTo:this.route,queryParams:this.isPreviewEmployee?{tab:"workshift"}:null})},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)})),this.focusService.focusFirstInvalidInput()},o.prototype.getSaveObservable=function(){var e=this.formGroup.getRawValue();e.isManager=this.isManager;var t,n=qt.toDto(e),o=this.defineService();if(this.isNew()||this.employeeData&&!e.id)t=o.insert(n);else{var i=this.employeeData?e.id:this.routeParams.workshiftHistory;t=o.update(i,n)}return t},o.prototype.defineService=function(){return this.isClockingEvent?this.workshiftHistoryAdjustmentService:this.workshiftHistoryService},o.prototype.getDeleteObservable=function(){var e,t=this,n=(null===(e=this.routeParams)||void 0===e?void 0:e.scheduleHistoryId)?this.routeParams.scheduleHistoryId:this.routeParams.workshiftHistory;return this.defineService().delete(n).pipe(s.tap((function(){t.loading=!1,t.addMessage("success","hcm_contract.employment_contract.deleted_message_title","hcm_contract.employment_contract.deleted_message_content"),t.employeeData&&t.isPreviewEmployee&&t.goBack()})))},o.prototype.validateVisualization=function(){var e=this;["employee","workshift"].every((function(t){var n;return null===(n=e.allPermissions[t])||void 0===n?void 0:n.visualizar}))||this.router.navigate(["forbidden"])},o.prototype.convertWorkshiftType=function(t){switch(t){case e.WorkshiftType.AUTOMATIC_SEARCH:return this.translate.instant("hcm_contract.employment_contract.workshift_workshift_type_automatic");case e.WorkshiftType.PERMANENT:return this.translate.instant("hcm_contract.employment_contract.workshift_workshift_type_permanent")}},o.prototype.onClearWorkshift=function(){this.onSelectWorkshift(null),this.setValidatorStartDate(null,"workshift"),ae(this.formGroup,!0,"workshiftGroup")},o.prototype.onSelectWorkshift=function(t,n){void 0===n&&(n=!0);var o=this.formGroup.get("workshiftGroup");(null==t?void 0:t.id)&&(o.enable(),n&&o.reset(),t.workshiftType===this.convertWorkshiftType(e.WorkshiftType.AUTOMATIC_SEARCH)||t.workshiftType===this.convertWorkshiftType(e.WorkshiftType.PERMANENT)?(o.setValidators([p.Validators.required]),this.requiredWorkshiftGroup=!0):(o.setValidators([]),this.requiredWorkshiftGroup=!1),this.formGroup.get("workshift").setValue(t),this.onWorkshiftGroupLookupRequest("",!0)),o.updateValueAndValidity(),this.setValidatorStartDate(t,"workshift")},o.prototype.getFilterWorkshiftGroup=function(e){var t=this.formGroup.get("workshift").value,n=e?"and":"";return(null==t?void 0:t.id)&&(e=e+" "+n+" workshift eq '"+t.id+"'"),e},o.prototype.getSaveButtonPermissions=function(){var t=this.isNew()||this.permissions.editar,n=this.permissions.incluir&&this.collectiveProcessType===e.CollectiveProcessType.INCLUDE;return this.isCollective?n:t},o.prototype.getDeleteButtonPermissions=function(){var t=!this.isNew()&&this.permissions.excluir,n=this.permissions.excluir&&this.collectiveProcessType===e.CollectiveProcessType.EXCLUDE;return this.isCollective?n:t},o.prototype.getFormGeneralTitle=function(){return this.collectiveProcessType?this.getCollectiveFormTitle():"hcm_contract.employment_contract.workshift_history_form_general_title"},o.prototype.getCollectiveFormTitle=function(){return this.collectiveProcessType===e.CollectiveProcessType.INCLUDE?"hcm_contract.employment_contract.workshift_history_collective_form_general_title":"hcm_contract.employment_contract.workshift_history_collective_delete_form_general_title"},o.prototype.isUsingTableChange=function(){return this.collectiveService.getIsUsingTable()},o.prototype.createHistoryDTO=function(e,t){var n=new qt;return n.startDate=Mn(e).toDate(),n.employee=Vt.fromDto(t,"WorkshiftHistory"),n},o.prototype.clockingEventOnSave=function(){this.confirmBeforeSave()},o.WORKSHIFT="workshift",o.DOMAIN="hcm_foundation",o.SERVICE="work_schedule",o.HISTORY_NAME="workshiftHistory",o.ctorParameters=function(){return[{type:Xe},{type:d.Router},{type:d.ActivatedRoute},{type:i.MessageService},{type:i.ConfirmationService},{type:p.FormBuilder},{type:a.TranslateService},{type:y.HotkeysService},{type:Sn},{type:_n},{type:je},{type:qe},{type:t.ChangeDetectorRef},{type:tn},{type:gn},{type:pn},{type:G.WorkshiftLookupService},{type:nn},{type:bt},{type:G.EmployeeLookupService},{type:Ft}]},W([t.ViewChild("customTemplate")],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFormFields")],o.prototype,"customFormFields",void 0),o=c=W([t.Component({selector:"fnd-workshift-history-form",template:'<div *ngFor="let process of processed">\n <p-messages [value]="process" key="info" [escape]="false"></p-messages>\n</div>\n<div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog acceptLabel="{{\'hcm_contract.employment_contract.yes\' | translate}}" acceptIcon="" appendTo="body"\n rejectLabel="{{\'hcm_contract.employment_contract.no\' | translate}}" rejectIcon="">\n </p-confirmDialog>\n <form [formGroup]="formGroup" novalidate>\n <lib-collective-history-filters *ngIf="isCollective"\n [parentFormGroup]="collectiveFormGroup" (onEmployeeSelected)="onSelectBasicFilterByEmployee($event)" (onCompanySelected)="onSelectBasicFilterByCompany($event)" ></lib-collective-history-filters>\n <p-panel *sLoadingState="loading"\n [styleClass]="employeeData && !isPreviewEmployee ? \'form-group sidebar-panel\' : \'form-group\'"\n [toggleable]="false" [collapsed]="mainPanelCollapsed"\n [showHeader]="(!employeeData) || (employeeData && isPreviewEmployee)"\n [hidden]="!isUsingTableChange() && isCollective">\n <p-header>\n {{ getFormGeneralTitle() | translate}}\n </p-header>\n\n <div class="ui-fluid" *ngIf="!customFormFields else customFormFields">\n <div class="ui-g">\n <div [attr.data-hidden]="true" class="ui-g-12 ui-md-6">\n <label for="id">{{"hcm_contract.employment_contract.workshift_history_id" | translate}}</label>\n <input #idFormInput type="text" id="id" name="id" pInputText formControlName="id"\n autocomplete="off" />\n </div>\n <div *ngIf="!isCollective" [attr.data-hidden]="!allPermissions?.employee.visualizar"\n class="ui-g-12 ui-md-6 required">\n <label for="employee">{{"hcm_contract.employment_contract.workshift_history_employee" |\n translate}}</label>\n <fnd-employee-lookup id="employee"\n [formGroup]="formGroup"></fnd-employee-lookup>\n <s-control-errors [control]="formGroup.controls[\'employee\']"\n [errorMessages]="{ required: \'hcm_contract.employment_contract.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div class="ui-g-12 ui-md-6 required">\n <label for="startDate">{{"hcm_contract.employment_contract.workshift_history_start_date" |\n translate}}</label>\n <p-calendar id="startDate" #startDateFormInput inputId="startDate" name="startDate"\n [showIcon]="true" formControlName="startDate" [locale]="localeConfig.calendar"\n [dateFormat]="localeConfig.calendar.dateFormat" sCalendarMask></p-calendar>\n <s-control-errors [control]="formGroup.controls[\'startDate\']" [errorMessages]="{\n required: \'hcm_contract.employment_contract.error_required\' | translate,\n dateBeforeRegisterInitialDate: \'hcm_contract.employment_contract.validation_has_date_before_workshift_initial_validity\' | translate,\n dateBeforeRegisterFinalDate: \'hcm_contract.employment_contract.validation_has_date_after_workshift_final_validity\' | translate,\n dateBeforeAdmission: \'hcm_contract.employment_contract.validation_start_date_is_before_hire_date\' | translate,\n dateAfterDismissal: \'hcm_contract.employment_contract.validation_start_date_is_after_dismissal_date\' | translate\n }">\n </s-control-errors>\n </div>\n <div [attr.data-hidden]="!allPermissions?.workshift.visualizar" class="ui-g-12 ui-md-6 required">\n <label for="workshift">{{"hcm_contract.employment_contract.workshift_history_workshift" |\n translate}}</label>\n <fnd-workshift-lookup\n [structureParams]="structureParams"\n id="workshift" [formGroup]="formGroup"\n [isDisabled]="getDisableRegister(isCollective, isNew(), permissions, isClockingEvent)"\n (select)="onSelectWorkshift($event)" (clear)="onClearWorkshift()">\n </fnd-workshift-lookup>\n <s-control-errors [control]="formGroup.controls[\'workshift\']"\n [errorMessages]="{ required: \'hcm_contract.employment_contract.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div [attr.data-hidden]="true" class="ui-g-12 ui-md-6">\n <label for="endDate">{{"hcm_contract.employment_contract.workshift_history_end_date" |\n translate}}</label>\n <p-calendar id="endDate" #endDateFormInput inputId="endDate" name="endDate" [showIcon]="true"\n formControlName="endDate" [locale]="localeConfig.calendar"\n [dateFormat]="localeConfig.calendar.dateFormat" sCalendarMask></p-calendar>\n </div>\n <div [attr.data-hidden]="!allPermissions?.workshiftInformationHistory.visualizar"\n class="ui-g-12 ui-md-6" [ngClass]="requiredWorkshiftGroup ? \'required\' : \'\'">\n <label\n for="workshiftGroup">{{"hcm_contract.employment_contract.workshift_history_workshift_group"\n | translate}}</label>\n <s-lookup dataKey="id" id="workshiftGroup" name="workshiftGroup"\n [disabled]="!isNew() && !permissions.editar && !isClockingEvent"\n formControlName="workshiftGroup" [searchFields]="workshiftGroupSearchFields"\n [searchGridFields]="workshiftGroupSearchGridFields"\n [searchGridData]="workshiftGroupSearchGridData" [multiple]="false"\n [lookupSuggestions]="workshiftGroupLookupSuggestions"\n (onLookupRequest)="onWorkshiftGroupLookupRequest($event)"\n (onSearchRequest)="onWorkshiftGroupSearchRequest($event)" lookupDisplayField="label"\n [searchTotalRecords]=workshiftGroupSearchTotalRecords\n [searchTitle]="\'hcm_contract.employment_contract.workshift_history_workshift_group_search_title\' | translate"\n [searchEmptyTitle]="\'hcm_contract.employment_contract.nothing_found\' | translate"\n [filterLabel]="\'hcm_contract.employment_contract.filter\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.filters\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.clear\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.cancel\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_contract.total_records\' | translate: {value: workshiftGroupSearchTotalRecords}">\n </s-lookup>\n <s-control-errors [control]="formGroup.controls[\'workshiftGroup\']"\n [errorMessages]="{ required: \'hcm_contract.employment_contract.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div [attr.data-hidden]="!allPermissions?.workshiftInformationHistory.visualizar"\n class="ui-g-12 ui-md-6">\n <label for="eSocialWorkingHoursType">\n {{"hcm_contract.employment_contract.workshift_esocial_working_hours_type"\n | translate}}\n </label>\n <p-dropdown id="eSocialWorkingHoursType" name="eSocialWorkingHoursType" placeholder=\'\n {{"hcm_contract.employment_contract.workshift_esocial_working_hours_type_placeholder"\n | translate}}\' [options]="eSocialWorkingHoursTypeOptions" [showClear]="true"\n formControlName="eSocialWorkingHoursType"></p-dropdown>\n </div>\n </div>\n </div>\n <s-custom-fields *ngIf="!isCollective && customizationPermission.visualizar" domain="hcm_contract"\n service="employment_contract" entity="workshiftHistory" formControlName="custom"\n [invalidErrorLabel]="\'hcm_contract.employment_contract.error_invalid\' | translate"></s-custom-fields>\n <div class="ui-g" *ngIf="!isNew() && employeeData != null">\n <div class="ui-g-12 ui-inputgroup" *ngIf="!isCollective">\n <span *ngIf="fieldIsNotNull(\'createdBy\')" class="label-style">\n {{\'hcm_contract.employment_contract.created_by\' | translate}}\n {{formGroup.get(\'createdBy\').value}}\n {{\'hcm_contract.employment_contract.at_date\' | translate}}\n {{formGroup.get(\'createdDate\').value | date: \'dd/MM/yyyy\'}}\n {{\'hcm_contract.employment_contract.at_time\' | translate}}\n {{formGroup.get(\'createdDate\').value | date: \'HH:mm\'}}.\n </span>\n <span *ngIf="fieldIsNotNull(\'lastModifiedBy\')" class="label-style-updated">\n {{\'hcm_contract.employment_contract.updated_by\' | translate}}\n {{formGroup.get(\'lastModifiedBy\').value}}\n {{\'hcm_contract.employment_contract.at_date\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | date: \'dd/MM/yyyy\'}}\n {{\'hcm_contract.employment_contract.at_time\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | date: \'HH:mm\'}}.\n </span>\n </div>\n </div>\n <p-footer *ngIf="(!employeeData) || (employeeData && isPreviewEmployee)">\n <button id="save-button"\n title="{{\'hcm_contract.employment_contract.save\' | translate}} (Alt + Shift + S)" type="submit"\n pButton label="{{\'hcm_contract.employment_contract.save\' | translate}}"\n (click)="confirmBeforeSave()" *ngIf="getSaveButtonPermissions()"></button>\n <button id="delete-button"\n title="{{\'hcm_contract.employment_contract.delete\' | translate}} (Alt + Shift + X)" type="button"\n class="ui-button-secondary" pButton\n label="{{\'hcm_contract.employment_contract.delete\' | translate}}" (click)="onDelete()"\n *ngIf="getDeleteButtonPermissions()" [disabled]="loading"></button>\n <button id="cancel-button"\n title="{{\'hcm_contract.employment_contract.cancel\' | translate}} (Alt + Shift + C)" type="button"\n class="ui-button-link" pButton label="{{\'hcm_contract.employment_contract.cancel\' | translate}}"\n (click)="onCancel()"></button>\n </p-footer>\n </p-panel>\n </form>\n</div>\n<p-confirmDialog #customized header="{{ \'hcm_contract.employment_contract.generic_confirm\' | translate }}"\n key="customized">\n <p-footer>\n <s-button label="{{ \'hcm_contract.employment_contract.yes\' | translate }}" [disabled]="false" priority="primary"\n (onClick)="customized.accept()" [auxiliary]="false">\n </s-button>\n <s-button label="{{ \'hcm_contract.employment_contract.no\' | translate }}" [auxiliary]="false"\n (onClick)="customized.reject()" priority="secondary" [disabled]="false">\n </s-button>\n </p-footer>\n</p-confirmDialog>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',providers:[i.ConfirmationService],styles:[":host ::ng-deep .sidebar-panel{border:none!important;padding-left:0!important}.label-style{color:#a3a3a3;margin-right:2px}.label-style-updated{color:#a3a3a3}"]})],o)}(Pn),Vn=function(e){function n(t,n,o){var i=e.call(this,t,n,"erpx_fnd/empresa/entities/e070emp","erpx_fnd/empresa/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalE070Emp=function(e){return this.http.get("erpx_fnd/empresa/entities/e070emp",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Nn=function(e){function n(t,n,o){var i=e.call(this,t,n,"erpx_fnd/empresa/entities/e070fil","erpx_fnd/empresa/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalE070Fil=function(e){return this.http.get("erpx_fnd/empresa/entities/e070fil",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),xn=c,On=function(n){function o(t,o,i,a,s,l,c,p,d,m,u,h,y,f,_,v){var g=n.call(this,s)||this;return g.router=t,g.route=o,g.workshiftHistoryService=i,g.confirmationService=a,g.translate=s,g.messageService=l,g.hotkeysService=c,g.formBuilder=p,g.filtersStorageService=d,g.paginatorStorageService=m,g.employeeService=u,g.workshiftService=h,g.companyService=y,g.companyBranchService=f,g.employeeLookupService=_,g.configService=v,g.allPermissions={},g.permissions={},g.localeConfig={},g.currentListParams={page:0,size:10,sort:[],filterData:{}},g.filtersPanelCollapsed=!0,g.searchTokens=[],g.serverError=!1,g.filtersLoaded=!1,g.workshiftGroupLookupDisplayFields=["code"],g.workshiftGroupAdvancedDisplayFields=["code"],g.workshiftLookupDisplayFields=["code","name"],g.workshiftAdvancedDisplayFields=["code","name"],g.employeeLookupDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],g.employeeAdvancedDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],g.companyLookupDisplayFields=["codEmp","nomEmp"],g.companyAdvancedDisplayFields=["codEmp","nomEmp"],g.companyBranchLookupDisplayFields=["codFil","nomFil"],g.companyBranchAdvancedDisplayFields=["codFil","nomFil"],g.collectiveActions=[],g.contractTypeOptions=[{label:g.translate.instant("hcm_contract.employment_contract.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:g.translate.instant("hcm_contract.employment_contract.contract_type_director"),value:e.ContractType.DIRECTOR},{label:g.translate.instant("hcm_contract.employment_contract.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:g.translate.instant("hcm_contract.employment_contract.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:g.translate.instant("hcm_contract.employment_contract.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}],g.workshiftLookupSuggestionsObservable=new r.Subject,g.workshiftLookupSearchObservable=new r.Subject,g.employeeLookupSuggestionsObservable=new r.Subject,g.employeeLookupSearchObservable=new r.Subject,g.companyLookupSuggestionsObservable=new r.Subject,g.companyLookupSearchObservable=new r.Subject,g.companyBranchLookupSuggestionsObservable=new r.Subject,g.companyBranchLookupSearchObservable=new r.Subject,g.resetGridSubject=new r.Subject,g}return Y(o,n),o.prototype.ngOnInit=function(){var e=this;this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.filterFormGroup=this.formBuilder.group({employer:[void 0,p.Validators.compose([])],companyBranch:[void 0,p.Validators.compose([])],contractType:[void 0,p.Validators.compose([])],employee:[void 0,p.Validators.compose([])],workshift:[void 0,p.Validators.compose([])],employeeSituation:[void 0,p.Validators.compose([])]}),this.setStoragePaginator(),this.setStorageFiltersIntoForm(this.filterFormGroup),this.gridColumns=this.getGridColumns(),this.filterFields=this.getFilterFields(),this.filterFormGroup.get("employer").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(){e.filterFormGroup.get("companyBranch").setValue(null)})),this.setHotkeys(),this.permissions.incluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.add_collective"),command:function(){return e.onAddCollective()}}),this.permissions.excluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.remove_collective"),command:function(){return e.onRemoveCollective()}})},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+e",(function(){return e.selection&&1===e.selection.length&&e.onEdit(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.selection&&e.selection.length&&e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+n",(function(){return e.permissions.incluir&&e.onAdd(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+f",(function(){return e.onSearch(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+l",(function(){return e.onClear(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.onRouteDataChange=function(e){this.allPermissions=e.allPermissions,this.permissions=e.allPermissions.workshiftHistory,this.localeConfig=e.localeConfig},o.prototype.hasEmpty=function(e){if(Object.keys(e).filter((function(t){return""===e[t]})).length>0)return!0},o.prototype.onSearch=function(){var e=this.filterFormGroup.getRawValue();if(this.hasEmpty(e))return this.filtersPanelCollapsed=!0,this.validateAllFormFields(this.filterFormGroup);this.currentListParams.page=0,this.filtersPanelCollapsed=!0,this.updateGrid({filterData:e}),this.filtersStorageService.storeFilters("WorkshiftHistoryListComponent",e)},o.prototype.onClear=function(){this.filterFormGroup.reset();var e=this.filterFormGroup.getRawValue();this.updateGrid({filterData:e}),this.filtersStorageService.removeFilter("WorkshiftHistoryListComponent")},o.prototype.onRemoveToken=function(e){this.filterFormGroup.get(e.id).setValue(void 0);var t=this.filterFormGroup.getRawValue();this.updateGrid({filterData:t}),this.filtersStorageService.clearFilterValue("WorkshiftHistoryListComponent",t)},o.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,o=e.multiSortMeta||[];return(10!==t||0!==n||o.length>0)&&this.paginatorStorageService.storePaginator("WorkshiftHistoryListComponentPaginator",{page:n,size:t,sort:o}),this.updateGrid({page:n,size:t,sort:o})},o.prototype.onAdd=function(){var e;if(null===(e=this.employeeData)||void 0===e?void 0:e.employeeId){var t=this.employeeData.employeeId;this.router.navigate(["new"],{relativeTo:this.route,queryParams:{id:t}})}else this.router.navigate(["new"],{relativeTo:this.route})},o.prototype.onEdit=function(){this.router.navigate([this.selection[0].id],{relativeTo:this.route})},o.prototype.onDelete=function(){var e=this;this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_title"),accept:function(){e.showLoader=!0,r.forkJoin(e.selection.map((function(t){return e.workshiftHistoryService.delete(t.id)}))).pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.showLoader=!1,e.resetGrid()}))).subscribe((function(){e.messageService.add({severity:"success",summary:e.translate.instant("hcm_contract.employment_contract.deleted_message_title"),detail:e.translate.instant("hcm_contract.employment_contract.deleted_message_content")})}))}})},o.prototype.focusInput=function(e){var t=document.getElementById(""+e);t&&t.focus()},o.prototype.getLabelValue=function(e,t){var n=this;return e.map((function(e){return z(z({},e),{label:t.map((function(t){return"name"!==t||e.name||(e.name=n.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")),t.indexOf(".")>0&&(e[t]=n.getProp(e,t)),"employmentRelationship.contractType"===t&&(e[t]=n.loadLabelFromEnum(e[t])),e[t]})).join(" - ")})}))},o.prototype.onWorkshiftLookupRequest=function(e){var t=this,n=this.getWorkshiftSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),o=Ee(this.workshiftLookupDisplayFields,this.workshiftAdvancedDisplayFields);this.workshiftService.list({filterQuery:n,displayFields:o}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.workshiftLookupDisplayFields)}))).subscribe((function(e){return t.workshiftLookupSuggestionsObservable.next(e)}))},o.prototype.onWorkshiftSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getWorkshiftSearchFields().filter((function(e){var t=e.name;return!!a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+xn(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+xn(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+xn(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=Ee(this.workshiftLookupDisplayFields,this.workshiftAdvancedDisplayFields);this.workshiftService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.workshiftLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.workshiftLookupSearchObservable.next(e)}))},o.prototype.onEmployeeLookupRequest=function(e){var t=this,n=this.getEmployeeSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),o=Ee(this.employeeLookupDisplayFields,this.employeeAdvancedDisplayFields);this.employeeService.list({filterQuery:n,displayFields:o}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.employeeLookupDisplayFields)}))).subscribe((function(e){return t.employeeLookupSuggestionsObservable.next(e)}))},o.prototype.onEmployeeSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getEmployeeSearchFields().filter((function(e){var t=e.name;return!!a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+xn(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+xn(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+xn(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=Ee(this.employeeLookupDisplayFields,this.employeeAdvancedDisplayFields);this.employeeService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.employeeLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.employeeLookupSearchObservable.next(e)}))},o.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},o.prototype.getGridColumns=function(){var e=[{field:"startDate",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_start_date")},{field:"workshift.code",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_code")},{field:"workshift.name",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_name")},{field:"workshiftGroup.code",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_group_code")}];return this.isPreviewEmployee?e:xe(this.translate,this.configService).concat(e)},o.prototype.getFilterFields=function(){var e=this;return[this.employeeLookupService.getFormField(),new l.FormField({recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),name:"employer",label:this.translate.instant("hcm_contract.employment_contract.employer"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_contract.employer_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_contract.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_contract.filter"),filterTitle:this.translate.instant("hcm_contract.employment_contract.filters"),clearLabel:this.translate.instant("hcm_contract.employment_contract.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_contract.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_contract.select"),dataKey:"id",suggestionsObservable:this.companyLookupSuggestionsObservable,searchObservable:this.companyLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyLookupRequest(t)},onSearchRequest:function(t){return e.onCompanySearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanySearchFields(),searchGridFields:this.getCompanySearchGridFields()}),new l.FormField({name:"companyBranch",label:this.translate.instant("hcm_contract.employment_contract.employee_company_branch"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_contract.employee_company_branch_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_contract.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_contract.filter"),filterTitle:this.translate.instant("hcm_contract.employment_contract.filters"),clearLabel:this.translate.instant("hcm_contract.employment_contract.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_contract.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_contract.select"),recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),dataKey:"id",suggestionsObservable:this.companyBranchLookupSuggestionsObservable,searchObservable:this.companyBranchLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyBranchLookupRequest(t)},onSearchRequest:function(t){return e.onCompanyBranchSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanyBranchSearchFields(),searchGridFields:this.getCompanyBranchSearchGridFields()}),new l.FormField({name:"contractType",label:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type_placeholder"),options:this.contractTypeOptions,multiple:!1}),new l.FormField({name:"workshift",label:this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_contract.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_contract.filter"),filterTitle:this.translate.instant("hcm_contract.employment_contract.filters"),clearLabel:this.translate.instant("hcm_contract.employment_contract.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_contract.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_contract.select"),dataKey:"id",recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),suggestionsObservable:this.workshiftLookupSuggestionsObservable,searchObservable:this.workshiftLookupSearchObservable,onLookupRequest:function(t){return e.onWorkshiftLookupRequest(t)},onSearchRequest:function(t){return e.onWorkshiftSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getWorkshiftSearchFields(),searchGridFields:this.getWorkshiftSearchGridFields()}),new l.FormField({name:"employeeSituation",label:this.translate.instant("hcm_contract.employment_contract.employee_situation"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_contract.employee_situation"),default:Z.EVERYONE,options:Ve(this.translate,this.configService),multiple:!1})]},o.prototype.setStorageFiltersIntoForm=function(e){return Q(this,void 0,void 0,(function(){var t,n;return X(this,(function(o){switch(o.label){case 0:return this.showLoader=!0,[4,this.filtersStorageService.getFilters("WorkshiftHistoryListComponent")];case 1:return t=o.sent(),Object.keys(e.controls).forEach((function(n){var o=xn(t[n],xn.HTML5_FMT.DATETIME_LOCAL_MS+"Z",!0).isValid();e.get(n).setValue(o?new Date(t[n]):t[n])})),this.filtersLoaded=!0,n=this.filterFormGroup.getRawValue(),this.updateGrid({filterData:n}),[2]}}))}))},o.prototype.setStoragePaginator=function(){return Q(this,void 0,void 0,(function(){var e;return X(this,(function(t){switch(t.label){case 0:return[4,this.paginatorStorageService.getPaginator("WorkshiftHistoryListComponentPaginator")];case 1:return e=t.sent(),"{}"!==JSON.stringify(e)&&(this.currentListParams=z(z({},this.currentListParams),e)),[2]}}))}))},o.prototype.getEnumQuery=function(e,t,n){return n?"("+t.map((function(t){return e+" eq '"+t+"'"})).join(" or ")+")":e+" eq '"+t+"'"},o.prototype.getWorkshiftSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.workshift_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_contract.workshift_name"),type:l.FieldType.String})]},o.prototype.getWorkshiftSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.workshift_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_contract.workshift_name"),type:l.FieldType.String})]},o.prototype.getEmployeeSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_contract.employee_employer_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_contract.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getEmployeeSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_contract.employee_employer_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_contract.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.onCompanyLookupRequest=function(e){var t=this,n=this.companyLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanySearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+xn(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+xn(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+xn(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({filterQuery:o,displayFields:i,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyLookupDisplayFields)}))).subscribe((function(e){return t.companyLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanySearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanySearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+xn(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+xn(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+xn(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyLookupSearchObservable.next(e)}))},o.prototype.onCompanyBranchLookupRequest=function(e){var t=this,n=this.companyBranchLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanyBranchSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+xn(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+xn(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+xn(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=this.filterFormGroup.get("employer").value;if(i){var a="e070emp.codEmp eq "+i.codEmp;o=o?o+" and "+a:a}var r=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({filterQuery:o,displayFields:r,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields)}))).subscribe((function(e){return t.companyBranchLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanyBranchSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanyBranchSearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+xn(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+xn(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+xn(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=this.filterFormGroup.get("employer").value;if(d){var m="e070emp.codEmp eq "+d.codEmp;p=p?p+" and "+m:m}var u=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({page:r,sort:c,filterQuery:p,displayFields:u}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyBranchLookupSearchObservable.next(e)}))},o.prototype.getCompanySearchFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_contract.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_contract.company_nom_emp"),type:l.FieldType.String})]},o.prototype.getCompanySearchGridFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_contract.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_contract.company_nom_emp"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_contract.company_branch_history_company_branch_cod_fil"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_contract.company_branch_history_company_branch_nom_fil"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchGridFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_contract.company_branch_history_company_branch_cod_fil"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_contract.company_branch_history_company_branch_nom_fil"),type:l.FieldType.String})]},o.prototype.updateGrid=function(e){var t=this;if(void 0===e&&(e={}),this.filtersLoaded){this.showLoader=!0,this.currentListParams=z(z({},this.currentListParams),e);var n=this.currentListParams,o=n.page,i=n.size,a=n.filterData,r=this.currentListParams.sort;this.searchTokens=this.filterFields.filter((function(e){var t=e.name;return!(!a||!a[t])})).map((function(e){var n=e.name,o=e.label,i=e.type,r=e.searchFields,s=e.options,c=a[n],p=c;if(i===l.FieldType.Date)p=xn(c).format("L");else if(i===l.FieldType.Time)p=xn(c).format("LTS");else if(i===l.FieldType.DateTime)p=xn(c).format("L LTS");else if(i===l.FieldType.Lookup){var d="employee"===n?t.getEmployeeSearchFields():r;p=d.map((function(e){return e.name.indexOf(".")>0&&(c[e.name]=t.getProp(c,e.name)),"employmentRelationship.contractType"===e.name&&(c[e.name]=t.loadLabelFromEnum(c[e.name])),c[e.name]})).join(" - ")}else i===l.FieldType.Enum?p=s.filter((function(e){return e.value===p}))[0].label:i===l.FieldType.Boolean&&(p=c?t.translate.instant("hcm_contract.employment_contract.list_grid_boolean_true"):t.translate.instant("hcm_contract.employment_contract.list_grid_boolean_false"));return{id:n,label:o+": "+p}}));var c=this.filterFields.filter((function(e){var t=e.name;return!(!a||!a[t])})).map((function(e){var n=e.name,o=e.type,i=e.multiple,r=a[n];return"number"==typeof r?n+" eq "+r:"employeeSituation"==n?Ne(r):o===l.FieldType.Date?n+" eq '"+xn(r).format("YYYY-MM-DD")+"'":o===l.FieldType.Time?n+" eq '"+xn(r).format("HH:mm:ss")+"'":o===l.FieldType.DateTime?n+" eq '"+xn(r).format()+"'":o===l.FieldType.String?"containing(upper("+n+"), upper('"+r.replace(/'/g,"\\'")+"'))":o===l.FieldType.Enum?t.getEnumQuery(n,r,i):o===l.FieldType.Lookup?n+" eq '"+r.id+"'":n+" eq '"+r+"'"})).join(" and ");c=this.filterByEmployee(c).replace("employer eq","employee.employer eq").replace("companyBranch eq","employee.employeeSnapshot.companyBranch eq").replace("contractType eq","employee.employmentRelationship.contractType eq");var p=this.gridColumns.map((function(e){return e.field}));r||(r=[{field:"lastModifiedDate",order:-1}]),this.workshiftHistoryService.list({page:o,size:i,sort:r,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(e){throw e.status>=500&&e.status<600&&(t.serverError=!0),e})),s.finalize((function(){t.showLoader=!1}))).subscribe((function(e){t.selection=[],t.gridData=e.contents,t.totalRecords=e.totalElements,t.serverError=!1}))}},o.prototype.resetGrid=function(e){e&&(this.currentListParams=z(z({},this.currentListParams),e)),this.currentListParams=z(z({},this.currentListParams),{page:0,sort:[]}),this.resetGridSubject.next(e),this.updateGrid()},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)}))},o.prototype.getSortField=function(){return this.currentListParams.sort},o.prototype.getPageSize=function(){return this.currentListParams.size},o.prototype.getRowIndex=function(){return this.currentListParams.page*this.currentListParams.size},o.prototype.loadLabelFromEnum=function(e){var t=this.contractTypeOptions.filter((function(t){return t.value===e}));return t&&t.length&&t[0].label||this.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")},o.prototype.onAddCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.INCLUDE})},o.prototype.onRemoveCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.EXCLUDE})},o.ctorParameters=function(){return[{type:d.Router},{type:d.ActivatedRoute},{type:Xe},{type:i.ConfirmationService},{type:a.TranslateService},{type:i.MessageService},{type:y.HotkeysService},{type:p.FormBuilder},{type:En},{type:Cn},{type:qe},{type:ze},{type:Vn},{type:Nn},{type:G.EmployeeLookupService},{type:G.EntityLookupConfigService}]},W([t.ViewChild("workshiftHistoryTable")],o.prototype,"table",void 0),W([t.ViewChild("customTemplate")],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFilterFields")],o.prototype,"customFilterFields",void 0),W([t.ViewChild("customGridColgroup")],o.prototype,"customGridColgroup",void 0),W([t.ViewChild("customGridHeader")],o.prototype,"customGridHeader",void 0),W([t.ViewChild("customGridBody")],o.prototype,"customGridBody",void 0),o=W([t.Component({selector:"fnd-workshift-history",template:'<div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog [acceptLabel]="\'hcm_contract.employment_contract.yes\' | translate" acceptIcon="" [rejectLabel]="\'hcm_contract.employment_contract.no\' | translate"\n rejectIcon=""></p-confirmDialog>\n <form [formGroup]="filterFormGroup" autocomplete="off" *ngIf="!employeeData">\n <p-panel styleClass="form-group" [toggleable]="true" [(collapsed)]="filtersPanelCollapsed" (onAfterToggle)="focusInput(\'employee\')">\n <p-header>\n {{"hcm_contract.employment_contract.filters" | translate}}\n <s-token-list [tokens]="searchTokens" (tokenRemoved)="onRemoveToken($event)" [removableTokens]="true"></s-token-list>\n </p-header>\n <div *ngIf="!customFilterFields else customFilterFields">\n <s-dynamic-form [fields]="filterFields" [form]="filterFormGroup" [errorMessages]="{pattern: \'hcm_contract.employment_contract.error_invalid\' | translate}"></s-dynamic-form>\n </div>\n <p-footer>\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="filter-button" class="ui-button" type="submit" pButton [label]="\'hcm_contract.employment_contract.filter\' | translate"\n title="{{\'hcm_contract.employment_contract.filter\' | translate}} (Alt + Shift + F)"\n (click)="onSearch()"></button>\n <button id="clear-button" class="ui-button ui-button-link" type="button" pButton [label]="\'hcm_contract.employment_contract.clear\' | translate"\n title="{{\'hcm_contract.employment_contract.clear\' | translate}} (Alt + Shift + L)"\n (click)="onClear()"></button>\n </div>\n </div>\n </p-footer>\n </p-panel>\n </form>\n <p-panel *sLoadingState="showLoader" [styleClass]="employeeData && isPreviewEmployee ? \'sidebar-panel\' : \'\'"\n [showHeader]="!isPreviewEmployee">\n <p-header>\n {{"hcm_contract.employment_contract.workshift_history_list_grid_title" | translate}}\n </p-header>\n <s-empty-state\n *ngIf="serverError"\n iconClass="fa fa-exclamation-triangle"\n title="{{\'hcm_contract.employment_contract.error_server_title\' | translate}}"\n primaryActionLabel="{{\'hcm_contract.employment_contract.error_server_try_again\' | translate}}"\n (primaryAction)="resetGrid()" description="{{\'hcm_contract.employment_contract.error_server_description\' | translate}}"></s-empty-state>\n <s-empty-state *ngIf="gridData && !gridData.length" [title]="\'hcm_contract.employment_contract.workshift_history_empty_state_title\' | translate"\n [showPrimaryAction]="permissions.incluir" [primaryActionLabel]="\'hcm_contract.employment_contract.add\' | translate"\n (primaryAction)="onAdd()" [description]="\'hcm_contract.employment_contract.workshift_history_empty_state_description\' | translate"\n [showSecondaryAction]="permissions.incluir"\n [secondaryActionLabel]="\'hcm_contract.employment_contract.add_collective\' | translate"\n (secondaryAction)="onAddCollective()">\n </s-empty-state>\n <div [attr.data-hidden]="!gridData?.length || serverError">\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="add-button" type="button" pButton [label]="\'hcm_contract.employment_contract.add\' | translate"\n title="{{\'hcm_contract.employment_contract.add\' | translate}} (Alt + Shift + N)"\n *ngIf="permissions.incluir" (click)="onAdd()"></button>\n <button id="edit-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_contract.edit\' | translate"\n title="{{\'hcm_contract.employment_contract.edit\' | translate}} (Alt + Shift + E)"\n [disabled]="!selection || selection.length !== 1" (click)="onEdit()"\n *ngIf="permissions.editar"></button>\n <button id="view-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_contract.view\' | translate"\n title="{{\'hcm_contract.employment_contract.view\' | translate}} (Alt + Shift + V)"\n [disabled]="!selection || selection.length !== 1" (click)="onEdit()"\n *ngIf="!permissions.editar && permissions.visualizar"></button>\n <button id="delete-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_contract.delete\' | translate"\n title="{{\'hcm_contract.employment_contract.delete\' | translate}} (Alt + Shift + X)"\n (click)="onDelete()" [disabled]="!selection || !selection.length" *ngIf="permissions.excluir"></button>\n <s-button *ngIf="(permissions.incluir || permissions.excluir) && isCollective"\n [label]="\'hcm_contract.employment_contract.other_actions\' | translate"\n priority="secondary" [model]="collectiveActions" [disabled]="false" [auxiliary]="false">\n </s-button>\n </div>\n </div>\n <div class="ui-g">\n <div class="ui-g-12">\n <p-table #workshiftHistoryTable [value]="gridData" [columns]="gridColumns" dataKey="id" [lazy]="true"\n [scrollable]="true" [resizableColumns]="true" sortMode="multiple" [paginator]="true"\n [totalRecords]="totalRecords" [multiSortMeta]="getSortField()" [first]="getRowIndex()"\n [rows]="getPageSize()" [rowsPerPageOptions]="[10, 20, 50, 100]" [(selection)]="selection"\n (onLazyLoad)="onGridChange($event)">\n <ng-template pTemplate="colgroup" let-columns *ngIf="!customGridColgroup else customGridColgroup">\n <colgroup>\n <col *ngFor="let col of columns" [style.width]="col.width">\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:END}--\x3e\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns *ngIf="!customGridHeader else customGridHeader">\n <tr>\n <th id="tableHeaderCheckbox" style="width: 50px">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id="columnsName" *ngFor="let col of columns" [pSortableColumn]="col.field" style="width: 200px" pResizableColumn>\n <div class="senior-header">\n <span class="senior-header-title">{{col.header}}</span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n \x3c!--{CA:GRID_HEADER_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_HEADER_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n \x3c!--{CA:GRID_HEADER:START}--\x3e\n \x3c!--{CA:GRID_HEADER:END}--\x3e\n <ng-template pTemplate="body" let-rowData let-columns *ngIf="!customGridBody else customGridBody">\n <tr [pSelectableRow]="rowData">\n <td style="width: 50px">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!isPreviewEmployee"> \n <span>{{"" + (getProp(rowData, \'employee.employer.codEmp\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!isPreviewEmployee">\n <span>{{(getProp(rowData, \'employee.employer.nomEmp\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!isPreviewEmployee">\n <span>{{"" + (getProp(rowData, \'employee.employeeSnapshot.companyBranchCode\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!isPreviewEmployee">\n <span>{{(getProp(rowData, \'employee.employeeSnapshot.companyBranchName\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!employeeData">\n <span>{{"" + (getProp(rowData, \'employee.code\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!employeeData">\n <span>{{getProp(rowData, \'employee.person.nomPes\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!isPreviewEmployee">\n <div [ngSwitch]="getProp(rowData, \'employee.employmentRelationship.contractType\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate)">\n <span *ngSwitchCase="\'EMPLOYEE\'">{{ "hcm_contract.employment_contract.contract_type_employee" | translate }}</span>\n <span *ngSwitchCase="\'DIRECTOR\'">{{ "hcm_contract.employment_contract.contract_type_director" | translate }}</span>\n <span *ngSwitchCase="\'TRAINEE\'">{{ "hcm_contract.employment_contract.contract_type_trainee" | translate }}</span>\n <span *ngSwitchCase="\'APRENTICE\'">{{ "hcm_contract.employment_contract.contract_type_aprentice" | translate }}</span>\n <span *ngSwitchCase="\'THIRD_PARTY\'">{{ "hcm_contract.employment_contract.contract_type_third_party" | translate }}</span>\n </div>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'startDate\') | localizedDate:"L" | async}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'workshift.code\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'workshift.name\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'workshiftGroup.code\') | localizedNumber | async)}}</span>\n </td>\n \x3c!--{CA:GRID_BODY_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_BODY_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span [translate]="\'hcm_contract.employment_contract.total_records\'" [translateParams]="{value: totalRecords}"></span>\n </ng-template>\n \x3c!--{CA:GRID_TEMPLATES:START}--\x3e\n \x3c!--{CA:GRID_TEMPLATES:END}--\x3e\n </p-table>\n </div>\n </div>\n </div>\n </p-panel>\n</div>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',providers:[i.ConfirmationService],styles:[":host ::ng-deep .sidebar-panel{border:none!important;padding-left:0!important}.label-style{color:#a3a3a3;margin-right:2px}.label-style-updated{color:#a3a3a3}"]})],o)}(Ln),Bn=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,G.EmployeeLookupModule],declarations:[Pn],providers:[],exports:[Pn]})],e)}(),Hn=c;function qn(e,t,n){return"number"==typeof e?n+" eq "+e:t==l.FieldType.Date?n+" eq '"+Hn(e).format("YYYY-MM-DD")+"'":t==l.FieldType.Time?n+" eq '"+Hn(e).format("HH:mm:ss")+"'":t==l.FieldType.DateTime?n+" eq '"+Hn(e).format()+"'":t==l.FieldType.Enum?n+" eq '"+e+"'":t==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"}function Un(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)}var jn,Yn=function(){function e(e,t){this.translate=e,this.companyService=t,this.companyLookupDisplayFields=["codEmp","nomEmp"],this.companyAdvancedDisplayFields=["codEmp","nomEmp"],this.companyLookupSeparator=" - "}return e.prototype.getCompanySearchFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_contract.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_contract.company_nom_emp"),type:l.FieldType.String})]},e.prototype.onCompanySearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.getCompanySearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type;return qn(a[t],n,t)})).join(" and "),p=this.companyLookupDisplayFields;return this.companyService.listExternalE070Emp({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.map((function(e){return t.mapCompanyLookup(e)})))},e.prototype.onCompanyLookupRequest=function(e){var t=this,n=this.companyLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanySearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return qn(e,o,n)})).filter((function(e){return""!==e})).join(" or "),i=this.companyLookupDisplayFields;return this.companyService.listExternalE070Emp({sort:n,filterQuery:o,displayFields:i}).pipe(s.map((function(e){return t.mapCompanyLookup(e)})))},e.prototype.mapCompanyLookup=function(e){var t=this;return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.companyAdvancedDisplayFields.map((function(t){return t.indexOf(".")>0&&(e[t]=Un(e,t)),e[t]})).join(t.companyLookupSeparator)})}))})},e.ctorParameters=function(){return[{type:a.TranslateService},{type:Vn}]},e=W([t.Injectable()],e)}(),zn=function(){function n(t,n){this.translate=t,this.employeeService=n,this.employeeLookupDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],this.employeeAdvancedDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],this.employeeLookupSeparator=" - ",this.contractTypeOptions=[{label:this.translate.instant("hcm_contract.employment_contract.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:this.translate.instant("hcm_contract.employment_contract.contract_type_director"),value:e.ContractType.DIRECTOR},{label:this.translate.instant("hcm_contract.employment_contract.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:this.translate.instant("hcm_contract.employment_contract.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:this.translate.instant("hcm_contract.employment_contract.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}]}return n.prototype.getEmployeeSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_contract.employee_employer_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_contract.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},n.prototype.getEmployeeSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_contract.employee_employer_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_contract.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},n.prototype.onEmployeeSearchRequest=function(e,t){var n=this,o=e.first,i=e.rows,a=e.multiSortMeta,r=e.filterData,p=o/i,d=a,m="";m=this.getEmployeeSearchFields().filter((function(e){var t=e.name;return!!r[t]})).map((function(e){var t=e.name,n=e.type,o=r[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+c(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+c(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+c(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),t&&(m=m?t+" and ("+m+")":t);var u=this.employeeLookupDisplayFields;return this.employeeService.listExternalEmployee({page:p,sort:d,filterQuery:m,displayFields:u}).pipe(s.map((function(e){return n.mapEmployeeLookup(e)})))},n.prototype.onEmployeeLookupRequest=function(e,t){var n=this,o=this.employeeLookupDisplayFields.map((function(e){return{field:e,order:1}})),i=this.getEmployeeSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var o=t.name,i=t.type;return"number"==typeof e?o+" eq "+e:i===l.FieldType.Date?o+" eq '"+c(e).format("YYYY-MM-DD")+"'":i===l.FieldType.Time?o+" eq '"+c(e).format("HH:mm:ss")+"'":i===l.FieldType.DateTime?o+" eq '"+c(e).format()+"'":i===l.FieldType.Enum?n.loadEnumFromLabel(e).map((function(e){return o+" eq '"+e+"'"})).join(" or "):i===l.FieldType.String?"containing(upper("+o+"), upper('"+e.replace(/'/g,"\\'")+"'))":o+" eq '"+e+"'"})).filter((function(e){return""!==e})).join(" or ");t&&(i=t+" and ("+i+")");var a=this.employeeLookupDisplayFields;return this.employeeService.listExternalEmployee({sort:o,filterQuery:i,displayFields:a}).pipe(s.map((function(e){return n.mapEmployeeLookup(e)})))},n.prototype.mapEmployeeLookup=function(e){var t=this;return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.employeeAdvancedDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=Un(e,n)),"employmentRelationship.contractType"===n&&(e[n]=t.loadLabelFromEnum(e[n])),e[n]})).join(t.employeeLookupSeparator)})}))})},n.prototype.loadLabelFromEnum=function(e){return this.contractTypeOptions.filter((function(t){return t.value===e}))[0].label},n.prototype.loadEnumFromLabel=function(e){return(e=e.toUpperCase().trim())&&void 0!==e?this.contractTypeOptions.filter((function(t){var n=t.label.toUpperCase().match(e);return null!==n&&0!==n.length})).map((function(e){return e.value})):[]},n.ctorParameters=function(){return[{type:a.TranslateService},{type:qe}]},n=W([t.Injectable()],n)}(),Wn=function(){function e(e,n,o,i,a,s,l){this.companyLookupService=e,this.translate=n,this.formBuilder=o,this.advancedFilterService=i,this.router=a,this.route=s,this.collectiveService=l,this.useEmployeeByCompany=!0,this.companySelected=[],this.employeeSelected=[],this.onCompanySelected=new t.EventEmitter,this.onEmployeeSelected=new t.EventEmitter,this.disableContinue=!1,this.allowCancel=!0,this.collectiveAdvancedSearchTokens=[],this.panelCollapsed=this.collectiveService.getPanelStatus(),this.ngUnsubscribe=new r.Subject,this.formFilterType=P.ProcessFilterType.BASIC_FILTER,this.filterControls={BASIC_FILTER:["employeeIds","companyIds"],ADVANCED_FILTER:["advancedFilter"]}}return e.prototype.ngOnInit=function(){var e=this;this.createFormGroup(),this.companiesSearchFields=this.companyLookupService.getCompanySearchFields(),this.companiesSearchGridFields=this.companyLookupService.getCompanySearchFields(),this.collectiveService.getEmployeesIsPresent().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.requiredEmployee=t})),this.collectiveService.getCompaniesIsPresent().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.requiredCompany=t})),this.collectiveService.getCancelForm().pipe(s.takeUntil(this.ngUnsubscribe),s.filter((function(e){return!!e}))).subscribe((function(){e.collectiveAdvancedCancel()}))},e.prototype.onCompaniesLookupRequest=function(e){var t=this;this.companyLookupService.onCompanyLookupRequest(e).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.companiesLookupSuggestions=e.contents}))},e.prototype.onCompaniesSearchRequest=function(e){var t=this;this.companyLookupService.onCompanySearchRequest(e).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.companiesSearchGridData=e.contents,t.companiesSearchTotalRecords=e.totalElements,t.companiesSearchTotalRecordsLabel=t.translate.instant("hcm_contract.employment_additional_info.total_records",{value:e.totalElements})}))},e.prototype.createFormGroup=function(){this.formGroup=this.formBuilder.group({employeeIds:[{value:void 0,disabled:!this.useEmployeeByCompany},p.Validators.compose(this.useEmployeeByCompany?[p.Validators.required]:[])],companyIds:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required,this.onlySingleCompanySelectionPermission?p.Validators.maxLength(1):null])],advancedFilter:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required])]},{validators:this.useEmployeeByCompany?this.employeesOrCompaniesArePresent():""}),this.parentFormGroup.addControl("filter",this.formGroup)},e.prototype.onSelectCompanyIds=function(e){Array.isArray(e)?this.companySelected=e.map((function(e){return e.id})):this.companySelected.push(null==e?void 0:e.id),this.onCompanySelected.emit(this.companySelected),this.useEmployeeByCompany||(this.formGroup.get("employeeIds").reset(),this.formGroup.get("employeeIds").enable())},e.prototype.onClearCompanyIds=function(e){if(Array.isArray(e))this.companySelected=e.map((function(e){return e.id}));else{var t=this.companySelected.indexOf(null==e?void 0:e.id);this.companySelected.splice(t,1)}this.onCompanySelected.emit(this.companySelected)},e.prototype.onClearSingleCompany=function(){this.useEmployeeByCompany||ae(this.formGroup,!0,"employeeIds")},e.prototype.onSelectEmployeeIds=function(e){Array.isArray(e)?this.employeeSelected=e:this.employeeSelected.push(e),this.onEmployeeSelected.emit(this.employeeSelected)},e.prototype.onClearEmployeeIds=function(e){if(Array.isArray(e))this.employeeSelected=e;else{var t=this.employeeSelected.indexOf(e);delete this.employeeSelected[t]}this.onEmployeeSelected.emit(this.employeeSelected)},e.prototype.employeesOrCompaniesArePresent=function(){var e=this;return function(t){var n,o;if(!t.pristine){var i=t.get("companyIds"),a=t.get("employeeIds"),r=(null===(n=null==a?void 0:a.value)||void 0===n?void 0:n.length)>0,s=e.useEmployeeByCompany?(null===(o=null==i?void 0:i.value)||void 0===o?void 0:o.length)>0:i.value;e.formFilterType!==P.ProcessFilterType.BASIC_FILTER||r||s?e.formFilterType===P.ProcessFilterType.BASIC_FILTER&&(i.clearValidators(),mn(i,"required"),a.clearValidators(),mn(a,"required")):(i.setValidators([p.Validators.required]),a.setValidators([p.Validators.required]),t.pristine||(i.markAsDirty(),i.updateValueAndValidity({onlySelf:!0}),a.markAsDirty(),a.updateValueAndValidity({onlySelf:!0}))),e.collectiveService.setEmployeeIsPresent(r),e.collectiveService.setCompaniesIsPresent(s)}return null}},e.prototype.collectiveAdvancedSearch=function(){this.formGroup.valid&&(this.getCollectiveAdvancedFiltersList(),this.disableCollectiveAdvancedFiltersForm(!0)),this.validateAllFormFields(this.formGroup),this.validateAllFormFields(this.parentFormGroup)},e.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)}))},e.prototype.collectiveAdvancedClear=function(){this.formGroup.reset(),this.advancedFilterService.setClearAdvancedFilter(!0),this.validateAllFormFields(this.formGroup),this.companySelected=[],this.collectiveAdvancedCancel(),this.useEmployeeByCompany||ae(this.formGroup,!0,"employeeIds")},e.prototype.getCollectiveAdvancedFiltersList=function(){this.loading=!0,this.panelCollapsed=!0,this.collectiveService.setIsUsingTable(!0),this.disableContinue=!0,this.setCollectiveAdvancedSearchTokens()},e.prototype.collectiveAdvancedRemoveToken=function(e){this.formGroup.get(e.id).setValue(void 0)},e.prototype.getCompanyTokenWhenEntityHasNoStructure=function(){var e,t;return null===(t=null===(e=this.formGroup.get("companyIds"))||void 0===e?void 0:e.value)||void 0===t?void 0:t.label},e.prototype.getCompanyTokenWhenEntityHasStructure=function(){var e;return(null===(e=this.formGroup.get("companyIds"))||void 0===e?void 0:e.value)&&this.formGroup.get("companyIds").value.map((function(e){return e.label})).join(", ")},e.prototype.onFilterTypeChanged=function(e){this.formFilterType=e,this.formGroup.markAsPristine()},e.prototype.setCollectiveAdvancedSearchTokens=function(){var e,t;this.collectiveAdvancedSearchTokens=[];var n=this.useEmployeeByCompany?this.getCompanyTokenWhenEntityHasStructure():this.getCompanyTokenWhenEntityHasNoStructure(),o=(null===(e=this.formGroup.get("employeeIds"))||void 0===e?void 0:e.value)&&this.formGroup.get("employeeIds").value.map((function(e){return e.label})).join(", "),i=this.formGroup.get("advancedFilter");this.companyToken={id:"companyIds",label:this.translate.instant("hcm_contract.employment_contract.employer")+":"+n},this.employeeToken={id:"employeeIds",label:this.translate.instant("hcm_contract.employment_contract.employee")+":"+o},i&&(this.advancedFilterToken={id:"advancedFilter",label:this.translate.instant("hcm_contract.employment_contract.advanced_filter_side_bar_title")+":"+(null===(t=null==i?void 0:i.value)||void 0===t?void 0:t.label)}),this.formFilterType===P.ProcessFilterType.BASIC_FILTER&&(n&&this.collectiveAdvancedSearchTokens.push(this.companyToken),o&&this.collectiveAdvancedSearchTokens.push(this.employeeToken)),(null==i?void 0:i.value)&&this.formFilterType===P.ProcessFilterType.ADVANCED_FILTER&&this.collectiveAdvancedSearchTokens.push(this.advancedFilterToken)},e.prototype.disableCollectiveAdvancedFiltersForm=function(e){e?(this.disableFieldsOnFormGroup(),this.disableContinue=!0):(this.enableFieldsOnFormGroup(),this.disableContinue=!1)},e.prototype.collectiveAdvancedCancel=function(){this.panelCollapsed=!1,this.collectiveService.resetPanelAndTableStatus(),this.collectiveAdvancedSearchTokens=[],this.disableCollectiveAdvancedFiltersForm(!1),this.formFilterType===P.ProcessFilterType.ADVANCED_FILTER&&this.disableFieldsOnFormGroup()},e.prototype.onCancel=function(){this.goBack(),this.collectiveService.resetPanelAndTableStatus()},e.prototype.goBack=function(){var e=this.route.snapshot.params.workshiftHistory,t=this.route.snapshot.params.annotationHistory,n=this.route.snapshot.params.leaveHistory;return e||t||n?this.router.navigate(["../"],{relativeTo:this.route}):this.router.navigate(["../"],{relativeTo:this.route.parent})},e.prototype.enableFieldsOnFormGroup=function(){this.formGroup.get("companyIds").enable(),this.formGroup.get("employeeIds").enable()},e.prototype.disableFieldsOnFormGroup=function(){this.formGroup.get("companyIds").disable(),this.formGroup.get("employeeIds").disable()},e.prototype.companyRequiredError=function(){return this.useEmployeeByCompany?"hcm_contract.employment_contract.collective_history_filters_employees_and_companies_are_empty":"hcm_contract.employment_contract.error_required"},e.prototype.companySearchTitle=function(){return this.useEmployeeByCompany?"hcm_contract.employment_contract.collective_history_filters_collective_companies_search_title":"hcm_contract.employment_contract.fixed_entry_employee_employer_search_title"},e.ctorParameters=function(){return[{type:Yn},{type:a.TranslateService},{type:p.FormBuilder},{type:P.AdvancedFilterService},{type:d.Router},{type:d.ActivatedRoute},{type:nn}]},W([t.Input()],e.prototype,"useEmployeeByCompany",void 0),W([t.Input()],e.prototype,"onlySingleCompanySelectionPermission",void 0),W([t.Input()],e.prototype,"parentFormGroup",void 0),W([t.Output()],e.prototype,"onCompanySelected",void 0),W([t.Output()],e.prototype,"onEmployeeSelected",void 0),W([t.Input()],e.prototype,"allowCancel",void 0),e=W([t.Component({selector:"lib-collective-history-filters",template:'<p-panel styleClass="form-group" [toggleable]="true" [(collapsed)]="panelCollapsed">\n <p-header>\n {{"hcm_contract.employment_contract.collective_history_filters_batch_filters" |translate}}\n <s-token-list [tokens]="collectiveAdvancedSearchTokens" (tokenRemoved)="collectiveAdvancedRemoveToken($event)"></s-token-list>\n </p-header>\n <form [formGroup]="formGroup">\n <div class="ui-fluid">\n <fnd-filter-container [filterType]="\'PROCESS\'"\n [formGroup]="formGroup" [filterControls]="filterControls"\n (filterTypeChanged)="onFilterTypeChanged($event)">\n <div class="ui-g-12 ui-md-6 required">\n <label for="companies">{{"hcm_contract.employment_contract.collective_history_filters_collective_companies" | translate}}</label>\n\n <s-lookup dataKey="id" id="companies" name="companies" formControlName="companyIds"\n [searchFields]="companiesSearchFields" [searchGridFields]="companiesSearchGridFields"\n [searchGridData]="companiesSearchGridData" [multiple]="true"\n [lookupSuggestions]="companiesLookupSuggestions"\n (onLookupRequest)="onCompaniesLookupRequest($event)"\n (onSearchRequest)="onCompaniesSearchRequest($event)" lookupDisplayField="label"\n (onSelect)="onSelectCompanyIds($event)" (onUnselect)="onClearCompanyIds($event)"\n (onClear)="onClearSingleCompany()"\n [searchTotalRecords]=companiesSearchTotalRecords\n [searchTitle]="companySearchTitle() | translate"\n [searchEmptyTitle]="\'hcm_contract.employment_contract.nothing_found\' | translate"\n [filterLabel]="\'hcm_contract.employment_contract.filter\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.filters\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.clear\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.cancel\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_contract.total_records\'\n | translate: {value: companiesSearchTotalRecords}">\n </s-lookup>\n <s-control-errors\n [control]="formGroup.controls[\'companyIds\']"\n [errorMessages]= "{ \n maxlength: \'hcm_contract.employment_contract.collective_history_filters_cant_select_more_than_one_company\'\n | translate,\n required: companyRequiredError() | translate }">\n </s-control-errors>\n </div>\n <div class="ui-sm-12 ui-md-6"\n [ngClass]="requiredCompany || !useEmployeeByCompany ? \'ui-g-12 ui-md-6\' : \'ui-g-12 ui-md-6 required\'">\n <label for="employeeIds">{{"hcm_contract.employment_contract.collective_history_filters_collective_employees" | translate}}</label>\n <fnd-employee-lookup \n [formGroup]="formGroup"\n [setCompanyIds]="companySelected"\n (clear)="onClearEmployeeIds($event)"\n (select)="onSelectEmployeeIds($event)"\n [controlName]="\'employeeIds\'"\n [multiple]="true">\n </fnd-employee-lookup>\n <s-control-errors [control]="formGroup.controls[\'employeeIds\']" [errorMessages]= "{\n required: \'hcm_contract.employment_contract.collective_history_filters_employees_and_companies_are_empty\' | translate\n }">\n </s-control-errors>\n </div>\n </fnd-filter-container>\n </div>\n\n </form>\n <p-footer>\n <div class="ui-g">\n <div class="ui-g-12">\n <s-button id="btn-continue" [label]="\'hcm_contract.employment_contract.collective_history_filters_continue\'|translate" priority="primary"\n [disabled]="disableContinue" [auxiliary]="false" (click)="collectiveAdvancedSearch()"></s-button>\n <s-button [disabled]="disableContinue" id="btn-clear" [label]="\'hcm_contract.employment_contract.collective_history_filters_clear\'|translate"\n priority="secondary" (onClick)="collectiveAdvancedClear()"></s-button>\n <s-button *ngIf="allowCancel" [disabled]="disableContinue" id="btn-cancel" [label]="\'hcm_contract.employment_contract.cancel\'|translate" priority="link"\n (onClick)="onCancel()"></s-button>\n </div>\n </div>\n </p-footer>\n</p-panel>\n'})],e)}(),Qn=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,P.AdvancedFilterModule,P.FilterContainerModule,G.EmployeeLookupModule],providers:[zn,P.AdvancedFilterService,P.FilterContainerService,Yn],declarations:[Wn],exports:[Wn]})],e)}();!function(e){e.ADMISSION="ADMISSION"}(jn||(jn={}));var Xn,Kn=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translate=n,this.domain="journey_flexibilization",this.service="general",this.queriesUrl=this.domain+"/"+this.service+"/queries"}return e.prototype.getModelFieldsConfiguration=function(e,t){void 0===t&&(t=[]);var n={journeyType:jn.ADMISSION,modelGroupId:e,entityNames:t};return this.http.post(this.queriesUrl+"/getModelFieldsConfiguration",n).pipe(vt(this.messageService,this.translate)).pipe(s.map((function(e){var t,n={};return null===(t=e.content)||void 0===t||t.forEach((function(e){n[e.entityName]=n[e.entityName]||{},n[e.entityName][e.fieldName]={id:e.id,required:e.required,visible:e.visible,editable:e.editable,defaultValue:e.defaultValue}})),n})))},e.prototype.mergeFieldsConfig=function(e,t){var n=this,o=t.map((function(e){var t,n;return{field:e.fieldName,disabled:!(null===(t=null==e?void 0:e.config)||void 0===t?void 0:t.editable),clearValue:!1,validators:(null===(n=null==e?void 0:e.config)||void 0===n?void 0:n.required)?[p.Validators.required]:[]}}));oe(e,o),t.forEach((function(t){return n.mergeFieldValue(e,t.fieldName,t.config,t.findById,t.onEdit)}))},e.prototype.mergeFieldValue=function(e,t,n,o,i){var a=e.get(t);(null==n?void 0:n.defaultValue)&&!i?o?o(null==n?void 0:n.defaultValue):a.setValue(null==n?void 0:n.defaultValue):i||a.setValue(null)},e.prototype.clearFieldsConfigs=function(e,t){var n=this;t.forEach((function(t){return n.clearFieldConfig(e,t.fieldName,t.validators)}))},e.prototype.clearFieldConfig=function(e,t,n,o,i){void 0===n&&(n=[]),void 0===o&&(o=!0),void 0===i&&(i=null);var a=e.get(t);a.setValidators(n),a.setValue(i),o?a.enable():a.disable()},e.prototype.isVisible=function(e,t){var n=this.jsonPath(e,t);return void 0===n||(null==n?void 0:n.visible)},e.prototype.isRequired=function(e,t){var n=this.jsonPath(e,t);return void 0===n||(null==n?void 0:n.required)},e.prototype.isEditable=function(e,t){var n=this.jsonPath(e,t);return void 0===n||(null==n?void 0:n.editable)},e.prototype.jsonPath=function(e,t){return null==t?void 0:t.split(".").reduce((function(e,t){return e&&e[t]}),e)},e.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},e=W([t.Injectable()],e)}(),$n=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,In,Bn,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,G.EntityLookupModule.forRoot({domain:"hcm_contract",service:"employment_contract"}),l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,G.WorkshiftLookupModule,l.DynamicFormModule,l.TokenListModule,E.PanelModule,D.InputTextModule,V.ButtonModule,N.CheckboxModule,k.TableModule,v.ConfirmDialogModule,_.CalendarModule,g.DropdownModule,I.TabViewModule,i.SharedModule,y.HotkeyModule,l.LoadingStateModule,l.BignumberInputModule,n.CyclicJsonInterceptorModule,n.HttpInterceptorModule,R.ToastModule,Qn,G.EmployeeLookupModule],declarations:[On,Gn],providers:[Xe,i.MessageService,ze,je,Vn,Nn,nn,pn,Kn],exports:[On,Gn]})],e)}(),Jn=c,Zn=function(n){function o(e,t,o,i,a,r,s,l,p,d,m,u,h,y,f,_,v,g,b){var S=n.call(this,s,h,u,y,i)||this;return S.annotationHistoryService=e,S.router=t,S.route=o,S.messageService=i,S.confirmationService=a,S.formBuilder=r,S.translate=s,S.hotkeysService=l,S.fieldCustomization=p,S.focusService=d,S.annotationTypeLookupService=m,S.employeeService=u,S.baseService=h,S.platformService=y,S.cd=f,S.collectiveService=_,S.sanitizer=v,S.annotationHistoryAttachmentService=g,S.employeeLookupService=b,S.localeConfig={},S.currencyLocaleOptions={},S.permissions={},S.allPermissions={},S.mainPanelCollapsed=!1,S.isUsingTable=!1,S.responsibleLookupDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],S.responsibleAdvancedDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],S.responsibleLookupSeparator=" - ",S.errorMessages={required:S.translate.instant("hcm_contract.employment_additional_info.error_required"),min:S.translate.instant("hcm_contract.employment_additional_info.error_min_value",{value:10}),max:S.translate.instant("hcm_contract.employment_additional_info.error_max_value"),minlength:S.translate.instant("hcm_contract.employment_additional_info.error_min_length"),maxlength:S.translate.instant("hcm_contract.employment_additional_info.error_max_length"),pattern:S.translate.instant("hcm_contract.employment_additional_info.error_invalid"),cnpjNotValid:S.translate.instant("hcm_contract.employment_additional_info.error_cnpj_not_valid"),dateBeforeAdmission:S.translate.instant("hcm_contract.employment_additional_info.validation_start_date_is_before_hire_date"),dateAfterDismissal:S.translate.instant("hcm_contract.employment_additional_info.validation_start_date_is_after_dismissal_date"),messageProcessNumberRequires17Or21Figures:S.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_17_or_21_figures"),messageProcessNumberRequires20Figures:S.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_20_figures"),messageProcessNumberRequires10Figures:S.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_10_figures"),justifiedDaysQuantityMustBeLowerThanEndDate:S.translate.instant("hcm_contract.employment_additional_info.message_justified_days_cant_be_greater_than_days_between_start_and_end_date"),timeMustNotBeZero:S.translate.instant("hcm_contract.employment_additional_info.message_time_must_not_be_zero"),estimatedEndDateMustBeGreaterThanOrEqualToStartDate:S.translate.instant("hcm_contract.employment_additional_info.message_date_should_be_greater_than_or_equal_to_start_date"),endDateMustBeGreaterThanOrEqualToStartDate:S.translate.instant("hcm_contract.employment_additional_info.message_date_should_be_greater_than_or_equal_to_start_date")},S.files=[],S.listFiles=[],S.countBeforeUploadFile=0,S.countAfterUploadFile=0,S.configAnnotation=[],S.domain=c.DOMAIN,S.service=c.SERVICE,S.entity=c.ENTITY,S.historyName=c.HISTORY_NAME,S.useBaseHistoryStructure=!1,S}var c;return Y(o,n),c=o,o.prototype.ngOnInit=function(){var e=this;this.collectiveProcessType=this.route.snapshot.fragment,this.formGroup=this.getFormGroup(),this.allocateLoadedEmployee(),this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)})),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.responsibleSearchFields=this.getResponsibleSearchFields(),this.responsibleSearchGridFields=this.getResponsibleSearchGridFields(),this.isCollective?this.startFuncionsByBaseCollectiveHistory():this.startFuncionsByBaseHistory(),this.configAnnotation=[{type:l.DynamicType.Section,configs:[{type:l.DynamicType.Row,fields:[new l.FormField({type:l.FieldType.TextIA,name:"annotation",rows:5,label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation"),size:{xl:12,lg:12,md:12,sm:12,xs:12},prompt:'Reescreva a seguinte observação fornecida pelo colaborador de forma clara e concisa, mantendo o significado original: "{{context}}".\n Limite a 30 palavras. A observação deve ser feita em '+this.translate.getDefaultLang()+"."})]}]}]},o.prototype.ngAfterViewChecked=function(){this.cd.detectChanges()},o.prototype.ngAfterViewInit=function(){this.cd.detectChanges();var e=document.getElementsByTagName("input"),t=Array.from(e).find((function(e){return!e.disabled}));t&&t.focus()},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+s",(function(){return(e.isNew()||e.permissions.editar)&&e.onSave(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+c",(function(){return e.onCancel(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.isNew=function(){return"new"===this.routeParams.annotationHistory},o.prototype.onRouteParamsChange=function(e){this.routeParams=e},o.prototype.updateSuggestions=function(e){this.employeeLookupService.updateSuggestions(e),this.annotationTypeLookupService.updateSuggestions(e),e.responsible&&(e.responsible.label=this.getSuggestionValue(["code","person.nomPes"],"responsible",e,this.responsibleLookupSeparator),e.responsible.label.trim()===this.responsibleLookupSeparator.trim()&&delete e.responsible.label)},o.prototype.getSuggestionValue=function(e,t,n,o){var i=this;return e.map((function(e){return i.getProp(n,t+"."+e)})).reduce((function(e,t){return""+e+o+t}))},o.prototype.onRouteDataChange=function(e){var t,n,o,i,a=e.localeConfig.number,r=a.currencySymbol,s=a.thousandsSeparator,l=a.decimalSeparator;if(this.localeConfig=e.localeConfig,this.currencyLocaleOptions={align:"left",prefix:r,thousands:s,decimal:l},this.permissions=null===(t=null==e?void 0:e.allPermissions)||void 0===t?void 0:t.annotationHistory,this.allPermissions=null==e?void 0:e.allPermissions,this.customizationPermission=null===(n=null==e?void 0:e.allPermissions)||void 0===n?void 0:n.customization,this.validateVisualization(),e.entity){this.permissions.editar||this.formGroup.disable();var c=zt.fromDto(e.entity);this.listFiles=null==c?void 0:c.annotationHistoryAttachments,this.countAfterUploadFile=null===(o=this.listFiles)||void 0===o?void 0:o.length,this.countBeforeUploadFile=null===(i=this.listFiles)||void 0===i?void 0:i.length,this.updateSuggestions(c),this.formGroup.patchValue(c),this.startFuncionsByBaseHistoryInEdit(c)}else this.formGroup.patchValue(new zt)},o.prototype.onCancel=function(){this.isCollective?this.collectiveService.setCancelForm(!0):this.goBack()},o.prototype.onSendFile=function(e,t){var n=[];return this.fieldCustomization.isEmpty(e)||n.push(this.fieldCustomization.deleteFiles(e)),this.fieldCustomization.isEmpty(t)||n.push(this.fieldCustomization.commitFiles(t)),this.fieldCustomization.isEmpty(n)?r.of({}):r.forkJoin(n)},o.prototype.onSave=function(){var e=this;if(!this.formGroup.valid)return this.loading=!1,this.validateAllFormFields(this.formGroup);this.formGroup.get("annotationHistoryAttachments").setValue(this.listFiles),this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onSaveCollective()}}):this.onSaveSingle()},o.prototype.onSaveCollective=function(){var e=this;this.loading=!0;var t=this.formGroup.getRawValue(),n=this.collectiveFormGroup.getRawValue(),o=zt.toDtoCollective(t,null==n?void 0:n.filter);this.annotationHistoryService.saveCollective(o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onSaveSingle=function(){var e=this;if(this.loading=!0,this.onFormLoadingSubject.next(!0),!this.formGroup.valid)return this.loading=!1,this.onFormLoadingSubject.next(!1),this.validateAllFormFields(this.formGroup);var t=this.fieldCustomization.getFiles(this.formGroup),n=t.filesToDelete,o=t.filesToCommit;this.getSaveObservable().pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,e.onFormLoadingSubject.next(!1),r.throwError(t)}))).subscribe((function(){e.onSendFile(n,o).pipe(s.takeUntil(e.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,r.throwError(t)}))).subscribe((function(){e.addMessage("success","hcm_contract.employment_additional_info.saved_message_title","hcm_contract.employment_additional_info.saved_message_content"),e.employeeData?(e.onClose.next(!0),e.loading=!1):e.goBack()}))}))},o.prototype.onDeleteCollective=function(){var e=this,t=this.formGroup.getRawValue(),n=this.collectiveFormGroup.getRawValue(),o=zt.toDtoCollective(t,null==n?void 0:n.filter);this.annotationHistoryService.deleteCollective(o).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onDelete=function(){var e=this;if(!this.formGroup.valid)return this.loading=!1,this.validateAllFormFields(this.formGroup);this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onDeleteCollective()}}):this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_title"),accept:function(){e.loading=!0,e.getDeleteObservable().pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.loading=!1}))).subscribe()}})},o.prototype.doAfterProcessAndResetFormGroup=function(e){this.doAfterProcess(e),this.resetFormGroup()},o.prototype.resetFormGroup=function(){this.formGroup.reset(),this.collectiveFormGroup.reset()},o.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},o.prototype.onResponsibleLookupRequest=function(e){var t=this,n=this.responsibleLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getResponsibleSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or ");o=this.getFilterDismissalResponsible(o);var i=Ee(this.responsibleLookupDisplayFields,this.responsibleAdvancedDisplayFields);this.employeeService.list({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.responsibleLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),"employmentRelationship.contractType"===n&&(e[n]=t.loadLabelFromEnum(e[n])),e[n]})).join(t.responsibleLookupSeparator)})}))})}))).subscribe((function(e){t.responsibleLookupSuggestions=e.contents}))},o.prototype.onResponsibleSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getResponsibleSearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+Jn(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+Jn(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+Jn(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and ");p=this.getFilterDismissalResponsible(p);var d=Ee(this.responsibleLookupDisplayFields,this.responsibleAdvancedDisplayFields);this.employeeService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.responsibleLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),"employmentRelationship.contractType"===n&&(e[n]=t.loadLabelFromEnum(e[n])),e[n]})).join(t.responsibleLookupSeparator)})}))})}))).subscribe((function(e){t.responsibleSearchGridData=e.contents,t.responsibleSearchTotalRecords=e.totalElements}))},o.prototype.getFormGroup=function(){return this.formBuilder.group({id:[{value:void 0,disabled:!0},p.Validators.compose([])],employee:[{value:void 0,disabled:!1},p.Validators.compose(this.isCollective?[]:[p.Validators.required])],startDate:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required])],annotationType:[{value:void 0,disabled:!0},p.Validators.compose([p.Validators.required])],sequence:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.min(1),p.Validators.max(99)])],documentNumber:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.maxLength(20)])],annotation:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.maxLength(999)])],responsible:[{value:void 0,disabled:!1},p.Validators.compose([])],createdBy:[{value:void 0,disabled:!0},p.Validators.compose([])],createdDate:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedBy:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedDate:[{value:void 0,disabled:!0},p.Validators.compose([])],annotationHistoryAttachments:[{value:void 0,disabled:!1},p.Validators.compose([])],custom:[]})},o.prototype.getResponsibleSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:Ge(this.translate)})]},o.prototype.getResponsibleSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:Ge(this.translate)})]},o.prototype.goBack=function(){this.router.navigate(["../"],{relativeTo:this.route})},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)})),this.focusService.focusFirstInvalidInput()},o.prototype.getSaveObservable=function(){var e=this.formGroup.getRawValue();e.employee=this.formGroup.controls[c.EMPLOYEE].value;var t,n=zt.toDto(e);if(this.isNew()||this.employeeData&&!e.id)t=this.annotationHistoryService.insert(n);else{var o=this.routeParams.annotationHistory;t=this.annotationHistoryService.update(o,n)}return t},o.prototype.getDeleteObservable=function(){var e=this;return this.annotationHistoryService.delete(this.routeParams.annotationHistory).pipe(s.tap((function(){e.addMessage("success","hcm_contract.employment_additional_info.deleted_message_title","hcm_contract.employment_additional_info.deleted_message_content"),e.goBack()})))},o.prototype.validateVisualization=function(){var e=this;["employee","annotationType"].every((function(t){return e.allPermissions[t]&&e.allPermissions[t].visualizar}))||this.router.navigate(["forbidden"])},o.prototype.loadLabelFromEnum=function(e){var t=Ge(this.translate).filter((function(t){return t.value===e}));return t&&t.length&&t[0].label||this.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")},o.prototype.getFilterDismissalResponsible=function(e){var t=this.formGroup.get("startDate").value&&Jn(this.formGroup.get("startDate").value).format("YYYY-MM-DD");t&&(e=e+" "+(e?"and":"")+" ((dismissalDate ge '"+t+"') or (dismissalDate is null))");return e},o.prototype.onSelectAnnotationType=function(e){this.setValidatorStartDate(e,"annotationType")},o.prototype.onClearAnnotationType=function(){this.onSelectAnnotationType(null)},o.prototype.createHistoryDTO=function(e,t){var n=new zt;return n.startDate=Jn(e).toDate(),n.employee=Vt.fromDto(t,"AnnotationHistory"),n},o.prototype.getSaveButtonPermissions=function(){var t=this.isNew()||this.permissions.editar,n=this.permissions.incluir&&this.collectiveProcessType===e.CollectiveProcessType.INCLUDE;return this.isCollective?n:t},o.prototype.getDeleteButtonPermissions=function(){var t=!this.isNew()&&this.permissions.excluir,n=this.permissions.excluir&&this.collectiveProcessType===e.CollectiveProcessType.EXCLUDE;return this.isCollective?n:t},o.prototype.getFormGeneralTitle=function(){return this.collectiveProcessType?this.getCollectiveFormTitle():"hcm_contract.employment_additional_info.annotation_history_form_general_title"},o.prototype.getCollectiveFormTitle=function(){return this.collectiveProcessType===e.CollectiveProcessType.INCLUDE?"hcm_contract.employment_additional_info.annotation_history_collective_form_general_title":"hcm_contract.employment_additional_info.annotation_history_collective_delete_form_general_title"},o.prototype.isUsingTableChange=function(){return this.collectiveService.getIsUsingTable()},o.prototype.onUpload=function(e){var t=this,n=e.files;this.countBeforeUploadFile=this.countBeforeUploadFile+(null==n?void 0:n.length),n.forEach((function(e){e.savedFile||e.progress||(t.listFiles.push(e),e.isUploading=!0,t.saveFile(e).pipe(s.takeUntil(t.ngUnsubscribe),s.finalize((function(){e.isUploading=!1,t.countAfterUploadFile++}))).subscribe((function(){e.objectURL=t.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(e))})))}))},Object.defineProperty(o.prototype,"saveDisable",{get:function(){return this.countBeforeUploadFile&&this.countBeforeUploadFile!=this.countAfterUploadFile},enumerable:!0,configurable:!0}),o.prototype.doUpload=function(e,t,n){var o=new XMLHttpRequest;return t.locationURI=e.fileUrl,t.objectURL=e.uploadUrl,t.progress=100,o.onreadystatechange=function(){4===o.readyState&&(t.complete=!0,o.status<200||o.status>=300?(t.objectURL=void 0,t.error=o.statusText||"Erro ao anexar arquivo"):t.error=!1,n.next(t),n.complete())},o.open("PUT",t.objectURL,!0),o.setRequestHeader("Translate","f"),o.send(t)},o.prototype.saveFile=function(e){var t=this;return new r.Observable((function(n){return t.annotationHistoryAttachmentService.requestUpload(e).pipe(s.takeUntil(t.ngUnsubscribe)).subscribe((function(o){return t.doUpload(o,e,n)}))}))},o.prototype.onRemoveFile=function(e){var t=e.file;this.listFiles.splice(this.listFiles.indexOf(t),1),this.countAfterUploadFile--,this.countBeforeUploadFile--},o.prototype.onCancelUpload=function(e){this.files.splice(e,1)},o.prototype.fileValidationErrors=function(t){switch(t){case e.FileValidation.MAX_FILE_LIMIT:this.messageService.add({severity:"error",detail:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_max_length")});break;case e.FileValidation.MAX_FILE_SIZE:this.messageService.add({severity:"error",detail:this.translate.instant("hcm_contract.employment_additional_info.leave_history_max_mb")})}},o.prototype.onDownloadFile=function(e){var t=this;this.loading=!0;var n=e.index,o=e.anchor,i=this.listFiles[n];i.documentId&&this.annotationHistoryAttachmentService.downloadForDocument(i).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return t.loading=!1}))).subscribe((function(e){i.objectURL=e.downloadUrl,o.nativeElement.setAttribute("href",e.downloadUrl),o.nativeElement.click()})),i.objectURL&&(o.nativeElement.setAttribute("href",URL.createObjectURL(i)),o.nativeElement.click()),this.loading=!1},o.ENTITY="annotationType",o.DOMAIN="hcm_foundation",o.SERVICE="general",o.HISTORY_NAME="annotationHistory",o.ctorParameters=function(){return[{type:Ze},{type:d.Router},{type:d.ActivatedRoute},{type:i.MessageService},{type:i.ConfirmationService},{type:p.FormBuilder},{type:a.TranslateService},{type:y.HotkeysService},{type:Sn},{type:_n},{type:G.AnnotationTypeLookupService},{type:qe},{type:tn},{type:pn},{type:t.ChangeDetectorRef},{type:nn},{type:x.DomSanitizer},{type:ft},{type:G.EmployeeLookupService}]},W([t.ViewChild("customTemplate",{static:!1})],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFormFields",{static:!1})],o.prototype,"customFormFields",void 0),o=c=W([t.Component({template:'<div *ngFor="let process of processed">\n <p-messages [value]="process" key="info" [escape]="false"></p-messages>\n</div>\n<div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog acceptLabel="{{\'hcm_contract.employment_additional_info.yes\' | translate}}" acceptIcon=""\n rejectLabel="{{\'hcm_contract.employment_additional_info.no\' | translate}}" rejectIcon="">\n </p-confirmDialog>\n <form [formGroup]="formGroup" novalidate>\n <lib-collective-history-filters *ngIf="isCollective" (onEmployeeSelected)="onSelectBasicFilterByEmployee($event)" (onCompanySelected)="onSelectBasicFilterByCompany($event)"\n [parentFormGroup]="collectiveFormGroup"></lib-collective-history-filters>\n <p-panel *sLoadingState="loading" [styleClass]="employeeData ? \'form-group sidebar-panel\' : \'form-group\'"\n [toggleable]="false" [collapsed]="mainPanelCollapsed" [showHeader]="!employeeData"\n [hidden]="!isUsingTableChange() && isCollective">\n <p-header>\n {{getFormGeneralTitle() | translate}}\n </p-header>\n <div class="ui-fluid" *ngIf="!customFormFields else customFormFields">\n <div class="ui-g">\n <div [attr.data-hidden]="true" class="ui-g-12 ui-md-6">\n <label for="id">{{"hcm_contract.employment_additional_info.annotation_history_id" |\n translate}}</label>\n <input #idFormInput type="text" id="id" name="id" pInputText formControlName="id"\n autocomplete="off" />\n </div>\n <div *ngIf="!isCollective" [attr.data-hidden]="!allPermissions?.employee.visualizar"\n class="ui-g-12 ui-md-6 required">\n <label for="employee">{{"hcm_contract.employment_additional_info.annotation_history_employee" |\n translate}}</label>\n <fnd-employee-lookup id="employee"\n [formGroup]="formGroup"></fnd-employee-lookup>\n <s-control-errors [control]="formGroup.controls[\'employee\']"\n [errorMessages]="{ required: \'hcm_contract.employment_additional_info.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div class="ui-g-12 ui-md-6 required">\n <label for="startDate">{{"hcm_contract.employment_additional_info.annotation_history_start_date"\n |\n translate}}</label>\n <p-calendar id="startDate" #startDateFormInput inputId="startDate" name="startDate"\n [showIcon]="true" formControlName="startDate" [locale]="localeConfig.calendar"\n [dateFormat]="localeConfig.calendar.dateFormat" sCalendarMask>\n </p-calendar>\n <s-control-errors [control]="formGroup.controls[\'startDate\']"\n [errorMessages]="{ required: \'hcm_contract.employment_additional_info.error_required\'\n | translate,\n dateBeforeAdmission: \'hcm_contract.employment_additional_info.validation_start_date_is_before_hire_date\' | translate,\n dateAfterDismissal: \'hcm_contract.employment_additional_info.validation_start_date_is_after_dismissal_date\' | translate\n }"></s-control-errors>\n </div>\n <div [attr.data-hidden]="!allPermissions?.annotationType.visualizar"\n class="ui-g-12 ui-md-6 required">\n <label for="annotationType">{{"hcm_contract.employment_additional_info.annotation_history_type"\n |\n translate}}</label>\n <fnd-annotation-type-lookup\n id="annotationType"\n [structureParams]="structureParams"\n [formGroup]="formGroup"\n [isDisabled]="getDisableRegister(isCollective, isNew(), permissions)"\n (select)="onSelectAnnotationType($event)" (clear)="onClearAnnotationType()">\n </fnd-annotation-type-lookup>\n <s-control-errors [control]="formGroup.controls[\'annotationType\']"\n [errorMessages]="{ required: \'hcm_contract.employment_additional_info.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div class="ui-g-12 ui-md-6 required">\n <label\n for="sequence">{{"hcm_contract.employment_additional_info.annotation_history_sequence"\n | translate}}</label>\n <input #sequenceFormInput id="sequence" name="sequence" pInputText sBignumberInput\n thousandsSeparator="" decimalSeparator="" [allowNegative]="false"\n formControlName="sequence" autocomplete="off"/>\n <s-control-errors [control]="formGroup.controls[\'sequence\']"\n [errorMessages]="{\n required: \'hcm_contract.employment_additional_info.error_required\' | translate,\n min: \'hcm_contract.employment_additional_info.error_min_value\' | translate: {value: \'1\'},\n max: \'hcm_contract.employment_additional_info.error_max_value\' | translate: {value: \'99\'}\n }">\n </s-control-errors>\n </div>\n <div class="ui-g-12 ui-md-6">\n <label\n for="documentNumber">{{"hcm_contract.employment_additional_info.annotation_history_document_number"\n | translate}}</label>\n <input #documentNumberFormInput type="text" id="documentNumber" name="documentNumber" pInputText\n formControlName="documentNumber" autocomplete="off" />\n <s-control-errors [control]="formGroup.controls[\'documentNumber\']"\n [errorMessages]="{ maxlength: \'hcm_contract.employment_additional_info.error_max_length\' | translate: {value: \'20\'} }">\n </s-control-errors>\n </div>\n <div [attr.data-hidden]="!allPermissions?.employee.visualizar" class="ui-g-12 ui-md-6">\n <label\n for="responsible">{{"hcm_contract.employment_additional_info.annotation_history_responsible"\n | translate}}</label>\n <s-lookup dataKey="id" id="responsible" name="responsible" formControlName="responsible"\n [searchFields]="responsibleSearchFields" [searchGridFields]="responsibleSearchGridFields"\n [searchGridData]="responsibleSearchGridData" [multiple]="false"\n [lookupSuggestions]="responsibleLookupSuggestions"\n (onLookupRequest)="onResponsibleLookupRequest($event)"\n (onSearchRequest)="onResponsibleSearchRequest($event)" lookupDisplayField="label"\n [searchTotalRecords]=responsibleSearchTotalRecords\n [searchTitle]="\'hcm_contract.employment_additional_info.annotation_history_responsible_search_title\' | translate"\n [searchEmptyTitle]="\'hcm_contract.employment_additional_info.nothing_found\' | translate"\n [filterLabel]="\'hcm_contract.employment_additional_info.filter\' | translate"\n [filterTitle]="\'hcm_contract.employment_additional_info.filters\' | translate"\n [clearLabel]="\'hcm_contract.employment_additional_info.clear\' | translate"\n [cancelLabel]="\'hcm_contract.employment_additional_info.cancel\' | translate"\n [selectLabel]="\'hcm_contract.employment_additional_info.select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_additional_info.total_records\' | translate: {value: responsibleSearchTotalRecords}">\n </s-lookup>\n <s-control-errors [control]="formGroup.controls[\'responsible\']"\n [errorMessages]="{ required: \'hcm_contract.employment_additional_info.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div class="ui-g-12 ui-md-12">\n <s-dynamic-form\n [configs]="configAnnotation"\n [id]="\'dynamic\'" [form]="formGroup"\n [errorMessages]="errorMessages">\n </s-dynamic-form>\n </div>\n\n <div class="ui-g-6 ui-md-6">\n <s-file-upload [formGroup]="formGroup.get(\'annotationHistoryAttachments\')" accept="*/*"\n [files]="listFiles" [multiple]="true" [fileLimit]="10"\n [chooseLabel]="\'hcm_contract.employment_additional_info.file_upload_choose_label\'\n | translate"\n [removeLabel]="\'hcm_contract.employment_additional_info.file_upload_remove_label\'\n | translate" [cancelLabel]="\'hcm_contract.employment_additional_info.cancel\' | translate"\n [maxFileSize]="10000000" (validateErrors)="fileValidationErrors($event?.validation)"\n (uploadHandler)="onUpload($event)" (removeFile)="onRemoveFile($event)"\n (cancelUpload)="onCancelUpload($event)" (downloadFile)="onDownloadFile($event)">\n </s-file-upload>\n </div>\n </div>\n </div>\n <s-custom-fields *ngIf="customizationPermission.visualizar && !isCollective" domain="hcm_contract"\n service="employment_additional_info" entity="annotationHistory" formControlName="custom"\n [invalidErrorLabel]="\'hcm_contract.employment_additional_info.error_invalid\' | translate">\n </s-custom-fields>\n <div class="ui-g" *ngIf="!isNew() && !isCollective">\n <div class="ui-g-12 ui-inputgroup">\n <label *ngIf="formGroup.get(\'createdBy\').value !== \'\'" style="color: #a3a3a3; margin-right: 2px;">\n {{\'hcm_contract.employment_contract.created_by\' | translate}}\n {{formGroup.get(\'createdBy\').value}} {{\'hcm_contract.employment_contract.at_date\' | translate}}\n {{formGroup.get(\'createdDate\').value | localizedDate:"L" | async}}\n {{\'hcm_contract.employment_contract.at_time\' | translate}}\n {{formGroup.get(\'createdDate\').value | localizedDate:"LTS" | async}}.\n </label>\n <label *ngIf="formGroup.get(\'lastModifiedBy\').value !== \'\'" style="color: #a3a3a3;">\n {{\'hcm_contract.employment_contract.updated_by\' | translate}}\n {{formGroup.get(\'lastModifiedBy\').value}}\n {{\'hcm_contract.employment_contract.at_date\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | localizedDate:"L" | async}}\n {{\'hcm_contract.employment_contract.at_time\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | localizedDate:"LTS" | async }}.\n </label>\n </div>\n </div>\n <p-footer *ngIf="!employeeData">\n <button id="save-button"\n title="{{\'hcm_contract.employment_additional_info.save\' | translate}} (Alt + Shift + S)"\n [disabled]="saveDisable" type="submit" pButton\n label="{{\'hcm_contract.employment_additional_info.save\' | translate}}" (click)="onSave()"\n *ngIf="getSaveButtonPermissions()"></button>\n <button id="delete-button"\n title="{{\'hcm_contract.employment_additional_info.delete\' | translate}} (Alt + Shift + X)"\n type="button" class="ui-button-secondary" pButton\n label="{{\'hcm_contract.employment_additional_info.delete\' | translate}}" (click)="onDelete()"\n *ngIf="getDeleteButtonPermissions()" [disabled]="loading"></button>\n <button id="cancel-button"\n title="{{\'hcm_contract.employment_additional_info.cancel\' | translate}} (Alt + Shift + C)"\n type="button" class="ui-button-link" pButton\n label="{{\'hcm_contract.employment_additional_info.cancel\' | translate}}"\n (click)="onCancel()"></button>\n </p-footer>\n </p-panel>\n </form>\n</div>\n<p-confirmDialog key="customized" #customized\n header="{{ \'hcm_contract.employment_contract.generic_confirm\' | translate }}">\n <p-footer>\n <s-button label="{{ \'hcm_contract.employment_contract.yes\' | translate }}" (onClick)="customized.accept()"\n priority="primary" [disabled]="false" [auxiliary]="false">\n </s-button>\n <s-button label="{{ \'hcm_contract.employment_contract.no\' | translate }}" (onClick)="customized.reject()"\n priority="secondary" [disabled]="false" [auxiliary]="false">\n </s-button>\n </p-footer>\n</p-confirmDialog>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',selector:"fnd-annotation-history-form",providers:[i.ConfirmationService],styles:[":host ::ng-deep .sidebar-panel{border:none!important;padding-left:0!important}"]})],o)}(Pn),eo=c,to=function(n){function o(t,o,i,a,s,l,c,p,d,m,u,h,y,f,_,v){var g=n.call(this,s)||this;return g.router=t,g.route=o,g.annotationHistoryService=i,g.confirmationService=a,g.translate=s,g.messageService=l,g.hotkeysService=c,g.formBuilder=p,g.filtersStorageService=d,g.paginatorStorageService=m,g.employeeService=u,g.annotationTypeService=h,g.companyService=y,g.companyBranchService=f,g.employeeLookupService=_,g.configService=v,g.allPermissions={},g.permissions={},g.localeConfig={},g.currentListParams={page:0,size:10,sort:[],filterData:{}},g.filtersPanelCollapsed=!0,g.searchTokens=[],g.serverError=!1,g.filtersLoaded=!1,g.annotationTypeLookupDisplayFields=["code","name"],g.annotationTypeAdvancedDisplayFields=["code","name"],g.employeeLookupDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],g.employeeAdvancedDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],g.responsibleLookupDisplayFields=["code","person.nomPes"],g.responsibleAdvancedDisplayFields=["code","person.nomPes"],g.companyLookupDisplayFields=["codEmp","nomEmp"],g.companyAdvancedDisplayFields=["codEmp","nomEmp"],g.companyBranchLookupDisplayFields=["codFil","nomFil"],g.companyBranchAdvancedDisplayFields=["codFil","nomFil"],g.contractTypeOptions=[{label:g.translate.instant("hcm_contract.employment_additional_info.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:g.translate.instant("hcm_contract.employment_additional_info.contract_type_director"),value:e.ContractType.DIRECTOR},{label:g.translate.instant("hcm_contract.employment_additional_info.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:g.translate.instant("hcm_contract.employment_additional_info.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:g.translate.instant("hcm_contract.employment_additional_info.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}],g.annotationTypeLookupSuggestionsObservable=new r.Subject,g.annotationTypeLookupSearchObservable=new r.Subject,g.responsibleLookupSuggestionsObservable=new r.Subject,g.responsibleLookupSearchObservable=new r.Subject,g.companyLookupSuggestionsObservable=new r.Subject,g.companyLookupSearchObservable=new r.Subject,g.companyBranchLookupSuggestionsObservable=new r.Subject,g.companyBranchLookupSearchObservable=new r.Subject,g.collectiveActions=[],g}return Y(o,n),o.prototype.ngOnInit=function(){var e=this;this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.filterFormGroup=this.formBuilder.group({employer:[void 0,p.Validators.compose([])],companyBranch:[void 0,p.Validators.compose([])],contractType:[void 0,p.Validators.compose([])],employee:[void 0,p.Validators.compose([])],annotationType:[void 0,p.Validators.compose([])],employeeSituation:[void 0,p.Validators.compose([])]}),this.setStoragePaginator(),this.setStorageFiltersIntoForm(this.filterFormGroup),this.gridColumns=this.getGridColumns(),this.filterFields=this.getFilterFields(),this.filterFormGroup.get("employer").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(){e.filterFormGroup.get("companyBranch").setValue(null)})),this.setHotkeys(),this.permissions.incluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.add_collective"),command:function(){return e.onAddCollective()}}),this.permissions.excluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.remove_collective"),command:function(){return e.onRemoveCollective()}})},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+e",(function(){return e.selection&&1===e.selection.length&&e.onEdit(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.selection&&e.selection.length&&e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+n",(function(){return e.permissions.incluir&&e.onAdd(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+f",(function(){return e.onSearch(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+l",(function(){return e.onClear(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.onRouteDataChange=function(e){this.allPermissions=e.allPermissions,this.permissions=e.allPermissions.annotationHistory,this.localeConfig=e.localeConfig},o.prototype.hasEmpty=function(e){if(Object.keys(e).filter((function(t){return""===e[t]})).length>0)return!0},o.prototype.onSearch=function(){var e=this.filterFormGroup.getRawValue();if(this.hasEmpty(e))return this.filtersPanelCollapsed=!0,this.validateAllFormFields(this.filterFormGroup);this.currentListParams.page=0,this.filtersPanelCollapsed=!0,this.resetGrid({filterData:e}),this.filtersStorageService.storeFilters("AnnotationHistoryListComponent",e)},o.prototype.onClear=function(){this.filterFormGroup.reset();var e=this.filterFormGroup.getRawValue();this.resetGrid({filterData:e}),this.filtersStorageService.removeFilter("AnnotationHistoryListComponent")},o.prototype.onRemoveToken=function(e){this.filterFormGroup.get(e.id).setValue(void 0);var t=this.filterFormGroup.getRawValue();this.resetGrid({filterData:t}),this.filtersStorageService.clearFilterValue("AnnotationHistoryListComponent",t)},o.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,o=e.multiSortMeta;return(10!==t||0!==n||(null==o?void 0:o.length)>0)&&this.paginatorStorageService.storePaginator("AnnotationHistoryListComponentPaginator",{page:n,size:t,sort:o}),this.updateGrid({page:n,size:t,sort:o})},o.prototype.onAdd=function(){this.router.navigate(["new"],{relativeTo:this.route})},o.prototype.onEdit=function(){this.router.navigate([this.selection[0].id],{relativeTo:this.route})},o.prototype.onDelete=function(){var e=this;this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_additional_info.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_additional_info.delete_confirmation_title"),accept:function(){e.showLoader=!0,r.forkJoin(e.selection.map((function(t){return e.annotationHistoryService.delete(t.id)}))).pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.showLoader=!1,e.resetGrid()}))).subscribe((function(){e.messageService.add({severity:"success",summary:e.translate.instant("hcm_contract.employment_additional_info.deleted_message_title"),detail:e.translate.instant("hcm_contract.employment_additional_info.deleted_message_content")})}),(function(e){}))}})},o.prototype.focusInput=function(e){var t=document.getElementById(""+e);t&&t.focus()},o.prototype.getLabelValue=function(e,t){var n=this;return e.map((function(e){return z(z({},e),{label:t.map((function(t){return t.indexOf(".")>0&&(e[t]=n.getProp(e,t)),"employmentRelationship.contractType"===t&&(e[t]=n.loadLabelFromEnum(e[t])),e[t]})).join(" - ")})}))},o.prototype.onAnnotationTypeLookupRequest=function(e){var t=this,n=this.getAnnotationTypeSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),o=Ee(this.annotationTypeLookupDisplayFields,this.annotationTypeAdvancedDisplayFields);this.annotationTypeService.list({filterQuery:n,displayFields:o}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.annotationTypeLookupDisplayFields)}))).subscribe((function(e){return t.annotationTypeLookupSuggestionsObservable.next(e)}))},o.prototype.onAnnotationTypeSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getAnnotationTypeSearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+eo(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+eo(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+eo(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=Ee(this.annotationTypeLookupDisplayFields,this.annotationTypeAdvancedDisplayFields);this.annotationTypeService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.annotationTypeLookupDisplayFields),totalRecords:e.totalElements}}))).subscribe((function(e){return t.annotationTypeLookupSearchObservable.next(e)}))},o.prototype.onResponsibleLookupRequest=function(e){var t=this,n=this.getResponsibleSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),o=Ee(this.responsibleLookupDisplayFields,this.responsibleAdvancedDisplayFields);this.employeeService.list({filterQuery:n,displayFields:o}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.responsibleLookupDisplayFields)}))).subscribe((function(e){return t.responsibleLookupSuggestionsObservable.next(e)}))},o.prototype.onResponsibleSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getResponsibleSearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+eo(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+eo(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+eo(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=Ee(this.responsibleLookupDisplayFields,this.responsibleAdvancedDisplayFields);this.employeeService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.responsibleLookupDisplayFields),totalRecords:e.totalElements}}))).subscribe((function(e){return t.responsibleLookupSearchObservable.next(e)}))},o.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},o.prototype.getGridColumns=function(){var e=[{field:"startDate",header:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_start_date")},{field:"annotationType.code",header:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation_type_code")},{field:"annotationType.name",header:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation_type_name")},{field:"annotation",header:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation")}];return xe(this.translate,this.configService).concat(e)},o.prototype.getFilterFields=function(){var e=this;return[this.employeeLookupService.getFormField(),new l.FormField({name:"employer",label:this.translate.instant("hcm_contract.employment_additional_info.employer"),type:l.FieldType.Lookup,recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.employer_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),dataKey:"id",suggestionsObservable:this.companyLookupSuggestionsObservable,searchObservable:this.companyLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyLookupRequest(t)},onSearchRequest:function(t){return e.onCompanySearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanySearchFields(),searchGridFields:this.getCompanySearchGridFields()}),new l.FormField({name:"companyBranch",label:this.translate.instant("hcm_contract.employment_additional_info.employee_company_branch"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.employee_company_branch_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),dataKey:"id",suggestionsObservable:this.companyBranchLookupSuggestionsObservable,searchObservable:this.companyBranchLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyBranchLookupRequest(t)},onSearchRequest:function(t){return e.onCompanyBranchSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanyBranchSearchFields(),searchGridFields:this.getCompanyBranchSearchGridFields()}),new l.FormField({name:"contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type_placeholder"),options:this.contractTypeOptions,multiple:!1}),new l.FormField({name:"annotationType",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation_type"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation_type_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),dataKey:"id",suggestionsObservable:this.annotationTypeLookupSuggestionsObservable,searchObservable:this.annotationTypeLookupSearchObservable,onLookupRequest:function(t){return e.onAnnotationTypeLookupRequest(t)},onSearchRequest:function(t){return e.onAnnotationTypeSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getAnnotationTypeSearchFields(),searchGridFields:this.getAnnotationTypeSearchGridFields()}),new l.FormField({name:"employeeSituation",label:this.translate.instant("hcm_contract.employment_additional_info.employee_situation"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_additional_info.employee_situation"),default:Z.EVERYONE,options:Ve(this.translate,this.configService),multiple:!1})]},o.prototype.setStorageFiltersIntoForm=function(e){return Q(this,void 0,void 0,(function(){var t,n;return X(this,(function(o){switch(o.label){case 0:return this.showLoader=!0,[4,this.filtersStorageService.getFilters("AnnotationHistoryListComponent")];case 1:return t=o.sent(),Object.keys(e.controls).forEach((function(n){var o=eo(t[n],eo.HTML5_FMT.DATETIME_LOCAL_MS+"Z",!0).isValid();e.get(n).setValue(o?new Date(t[n]):t[n])})),this.filtersLoaded=!0,n=this.filterFormGroup.getRawValue(),this.resetGrid({filterData:n}),[2]}}))}))},o.prototype.setStoragePaginator=function(){return Q(this,void 0,void 0,(function(){var e;return X(this,(function(t){switch(t.label){case 0:return[4,this.paginatorStorageService.getPaginator("AnnotationHistoryListComponentPaginator")];case 1:return e=t.sent(),"{}"!==JSON.stringify(e)&&(this.currentListParams=z(z({},this.currentListParams),e)),[2]}}))}))},o.prototype.getEnumQuery=function(e,t,n){return n?"("+t.map((function(t){return e+" eq '"+t+"'"})).join(" or ")+")":e+" eq '"+t+"'"},o.prototype.getAnnotationTypeSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_type_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_type_name"),type:l.FieldType.String})]},o.prototype.getAnnotationTypeSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_type_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_type_name"),type:l.FieldType.String})]},o.prototype.getEmployeeSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getEmployeeSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getResponsibleSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getResponsibleSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.onCompanyLookupRequest=function(e){var t=this,n=this.companyLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanySearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+eo(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+eo(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+eo(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({filterQuery:o,displayFields:i,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyLookupDisplayFields)}))).subscribe((function(e){return t.companyLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanySearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanySearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+eo(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+eo(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+eo(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_additional_info.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyLookupSearchObservable.next(e)}))},o.prototype.onCompanyBranchLookupRequest=function(e){var t=this,n=this.companyBranchLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanyBranchSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+eo(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+eo(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+eo(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=this.filterFormGroup.get("employer").value;if(i){var a="e070emp.codEmp eq "+i.codEmp;o=o?o+" and "+a:a}var r=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({filterQuery:o,displayFields:r,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields)}))).subscribe((function(e){return t.companyBranchLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanyBranchSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanyBranchSearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+eo(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+eo(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+eo(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=this.filterFormGroup.get("employer").value;if(d){var m="e070emp.codEmp eq "+d.codEmp;p=p?p+" and "+m:m}var u=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({page:r,sort:c,filterQuery:p,displayFields:u}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_additional_info.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyBranchLookupSearchObservable.next(e)}))},o.prototype.getCompanySearchFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_nom_emp"),type:l.FieldType.String})]},o.prototype.getCompanySearchGridFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_nom_emp"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_code"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_name"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchGridFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_code"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_name"),type:l.FieldType.String})]},o.prototype.updateGrid=function(e){var t=this;if(void 0===e&&(e={}),this.filtersLoaded){this.showLoader=!0,this.currentListParams=z(z({},this.currentListParams),e);var n=this.currentListParams,o=n.page,i=n.size,a=n.filterData,r=this.currentListParams.sort;this.searchTokens=this.filterFields.filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var n=e.name,o=e.label,i=e.type,r=e.searchFields,s=e.options,c=a[n],p=c;if(i===l.FieldType.Date)p=eo(c).format("L");else if(i===l.FieldType.Time)p=eo(c).format("LTS");else if(i===l.FieldType.DateTime)p=eo(c).format("L LTS");else if(i===l.FieldType.Lookup){var d="employee"===n?t.getEmployeeSearchFields():r;p=d.map((function(e){return e.name.indexOf(".")>0&&(c[e.name]=t.getProp(c,e.name)),"employmentRelationship.contractType"===e.name&&(c[e.name]=t.loadLabelFromEnum(c[e.name])),c[e.name]})).join(" - ")}else i===l.FieldType.Enum?p=s.filter((function(e){return e.value===p}))[0].label:i===l.FieldType.Boolean&&(p=c?t.translate.instant("hcm_contract.employment_additional_info.list_grid_boolean_true"):t.translate.instant("hcm_contract.employment_additional_info.list_grid_boolean_false"));return{id:n,label:o+": "+p}}));var c=this.filterFields.filter((function(e){var t=e.name;return!!a[t]})).map((function(e){var n=e.name,o=e.type,i=e.multiple,r=a[n];return"number"==typeof r?n+" eq "+r:"employeeSituation"==n?Ne(r):o===l.FieldType.Date?n+" eq '"+eo(r).format("YYYY-MM-DD")+"'":o===l.FieldType.Time?n+" eq '"+eo(r).format("HH:mm:ss")+"'":o===l.FieldType.DateTime?n+" eq '"+eo(r).format()+"'":o===l.FieldType.String?"containing(upper("+n+"), upper('"+r.replace(/'/g,"\\'")+"'))":o===l.FieldType.Enum?t.getEnumQuery(n,r,i):o===l.FieldType.Lookup?n+" eq '"+r.id+"'":n+" eq '"+r+"'"})).join(" and ");c=c.replace("employer eq","employee.employer eq").replace("companyBranch eq","employee.employeeSnapshot.companyBranch eq").replace("contractType eq","employee.employmentRelationship.contractType eq");var p=this.gridColumns.map((function(e){return e.field}));r||(r=[{field:"lastModifiedDate",order:-1}]),this.annotationHistoryService.list({page:o,size:i,sort:r,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(e){throw e.status>=500&&e.status<600&&(t.serverError=!0),e})),s.finalize((function(){t.showLoader=!1}))).subscribe((function(e){t.selection=[],t.gridData=e.contents,t.totalRecords=e.totalElements,t.serverError=!1}))}},o.prototype.resetGrid=function(e){e&&(this.currentListParams=z(z({},this.currentListParams),e)),this.currentListParams=z(z({},this.currentListParams),{page:0,sort:[]}),this.table.reset()},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)}))},o.prototype.getSortField=function(){return this.currentListParams.sort},o.prototype.getPageSize=function(){return this.currentListParams.size},o.prototype.getRowIndex=function(){return this.currentListParams.page*this.currentListParams.size},o.prototype.loadLabelFromEnum=function(e){var t=this.contractTypeOptions.filter((function(t){return t.value===e}));return t&&t.length&&t[0].label||this.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")},o.prototype.onAddCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.INCLUDE})},o.prototype.onRemoveCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.EXCLUDE})},o.ctorParameters=function(){return[{type:d.Router},{type:d.ActivatedRoute},{type:Ze},{type:i.ConfirmationService},{type:a.TranslateService},{type:i.MessageService},{type:y.HotkeysService},{type:p.FormBuilder},{type:En},{type:Cn},{type:qe},{type:$e},{type:Vn},{type:Nn},{type:G.EmployeeLookupService},{type:G.EntityLookupConfigService}]},W([t.ViewChild("annotationHistoryTable",{static:!1})],o.prototype,"table",void 0),W([t.ViewChild("customTemplate",{static:!1})],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFilterFields",{static:!1})],o.prototype,"customFilterFields",void 0),W([t.ViewChild("customGridColgroup",{static:!1})],o.prototype,"customGridColgroup",void 0),W([t.ViewChild("customGridHeader",{static:!1})],o.prototype,"customGridHeader",void 0),W([t.ViewChild("customGridBody",{static:!1})],o.prototype,"customGridBody",void 0),o=W([t.Component({template:'<div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog [acceptLabel]="\'hcm_contract.employment_additional_info.yes\' | translate" acceptIcon=""\n [rejectLabel]="\'hcm_contract.employment_additional_info.no\' | translate" rejectIcon=""></p-confirmDialog>\n <form [formGroup]="filterFormGroup" autocomplete="off">\n <p-panel styleClass="form-group" [toggleable]="true" [(collapsed)]="filtersPanelCollapsed" (onAfterToggle)="focusInput(\'employee\')">\n <p-header>\n {{"hcm_contract.employment_additional_info.filters" | translate}}\n <s-token-list [tokens]="searchTokens" (tokenRemoved)="onRemoveToken($event)" [removableTokens]="true"></s-token-list>\n </p-header>\n <div *ngIf="!customFilterFields else customFilterFields">\n <s-dynamic-form [fields]="filterFields" [form]="filterFormGroup" [errorMessages]="{pattern: \'hcm_contract.employment_additional_info.error_invalid\' | translate}"></s-dynamic-form>\n </div>\n <p-footer>\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="filter-button" class="ui-button" type="submit" pButton [label]="\'hcm_contract.employment_additional_info.filter\' | translate"\n title="{{\'hcm_contract.employment_additional_info.filter\' | translate}} (Alt + Shift + F)"\n (click)="onSearch()"></button>\n <button id="clear-button" class="ui-button ui-button-link" type="button" pButton [label]="\'hcm_contract.employment_additional_info.clear\' | translate"\n title="{{\'hcm_contract.employment_additional_info.clear\' | translate}} (Alt + Shift + L)"\n (click)="onClear()"></button>\n </div>\n </div>\n </p-footer>\n </p-panel>\n </form>\n <p-panel *sLoadingState="showLoader">\n <p-header>\n {{"hcm_contract.employment_additional_info.annotation_history_list_grid_title" | translate}}\n </p-header>\n <s-empty-state *ngIf="serverError" iconClass="fa fa-exclamation-triangle" title="{{\'hcm_contract.employment_additional_info.error_server_title\' | translate}}"\n primaryActionLabel="{{\'hcm_contract.employment_additional_info.error_server_try_again\' | translate}}"\n (primaryAction)="resetGrid()" description="{{\'hcm_contract.employment_additional_info.error_server_description\' | translate}}"></s-empty-state>\n <s-empty-state *ngIf="gridData && !gridData.length" [title]="\'hcm_contract.employment_additional_info.annotation_history_empty_state_title\' | translate"\n [showPrimaryAction]="permissions.incluir" [primaryActionLabel]="\'hcm_contract.employment_additional_info.add\' | translate"\n (primaryAction)="onAdd()" [description]="\'hcm_contract.employment_additional_info.annotation_history_empty_state_description\' | translate"\n [showSecondaryAction]="permissions.incluir"\n [secondaryActionLabel]="\'hcm_contract.employment_contract.add_collective\' | translate"\n (secondaryAction)="onAddCollective()">\n </s-empty-state>\n <div [attr.data-hidden]="!gridData?.length || serverError">\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="add-button" type="button" pButton [label]="\'hcm_contract.employment_additional_info.add\' | translate"\n title="{{\'hcm_contract.employment_additional_info.add\' | translate}} (Alt + Shift + N)"\n *ngIf="permissions.incluir" (click)="onAdd()"></button>\n <button id="view-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_additional_info.view\' | translate"\n title="{{\'hcm_contract.employment_additional_info.view\' | translate}} (Alt + Shift + V)"\n [disabled]="!selection || selection.length !== 1" (click)="onEdit()"\n *ngIf="!permissions.editar && permissions.visualizar"></button>\n <button id="edit-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_additional_info.edit\' | translate"\n title="{{\'hcm_contract.employment_additional_info.edit\' | translate}} (Alt + Shift + E)"\n [disabled]="!selection || selection.length !== 1" (click)="onEdit()"\n *ngIf="permissions.editar"></button>\n <button id="delete-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_additional_info.delete\' | translate"\n title="{{\'hcm_contract.employment_additional_info.delete\' | translate}} (Alt + Shift + X)"\n (click)="onDelete()" [disabled]="!selection || !selection.length" *ngIf="permissions.excluir"></button>\n <s-button *ngIf="permissions.incluir || permissions.excluir"\n [label]="\'hcm_contract.employment_contract.other_actions\' | translate"\n priority="secondary" [model]="collectiveActions" [disabled]="false" [auxiliary]="false"></s-button>\n </div>\n </div>\n <div class="ui-g">\n <div class="ui-g-12">\n <p-table #annotationHistoryTable [value]="gridData" [columns]="gridColumns" dataKey="id" [lazy]="true"\n [scrollable]="true" [resizableColumns]="true" sortMode="multiple" [paginator]="true"\n [totalRecords]="totalRecords" [multiSortMeta]="getSortField()" [first]="getRowIndex()"\n [rows]="getPageSize()" [rowsPerPageOptions]="[10, 20, 50, 100]" [(selection)]="selection"\n (onLazyLoad)="onGridChange($event)">\n <ng-template pTemplate="colgroup" let-columns *ngIf="!customGridColgroup else customGridColgroup">\n <colgroup>\n <col *ngFor="let col of columns" [style.width]="col.width">\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:END}--\x3e\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns *ngIf="!customGridHeader else customGridHeader">\n <tr>\n <th id="tableHeaderCheckbox" style="width: 50px">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id="columnsName" *ngFor="let col of columns" [pSortableColumn]="col.field" style="width: 200px" pResizableColumn>\n <div class="senior-header">\n <span class="senior-header-title">{{col.header}}</span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n \x3c!--{CA:GRID_HEADER_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_HEADER_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n \x3c!--{CA:GRID_HEADER:START}--\x3e\n \x3c!--{CA:GRID_HEADER:END}--\x3e\n <ng-template pTemplate="body" let-rowData let-columns *ngIf="!customGridBody else customGridBody">\n <tr [pSelectableRow]="rowData">\n <td style="width: 50px">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'employee.employer.codEmp\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'employee.employer.nomEmp\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'employee.employeeSnapshot.companyBranchCode\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'employee.employeeSnapshot.companyBranchName\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'employee.code\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'employee.person.nomPes\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <div [ngSwitch]="getProp(rowData, \'employee.employmentRelationship.contractType\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)">\n <span *ngSwitchCase="\'EMPLOYEE\'">{{ "hcm_contract.employment_additional_info.contract_type_employee" | translate }}</span>\n <span *ngSwitchCase="\'DIRECTOR\'">{{ "hcm_contract.employment_additional_info.contract_type_director" | translate }}</span>\n <span *ngSwitchCase="\'TRAINEE\'">{{ "hcm_contract.employment_additional_info.contract_type_trainee" | translate }}</span>\n <span *ngSwitchCase="\'APRENTICE\'">{{ "hcm_contract.employment_additional_info.contract_type_aprentice" | translate }}</span>\n <span *ngSwitchCase="\'THIRD_PARTY\'">{{ "hcm_contract.employment_additional_info.contract_type_third_party" | translate }}</span>\n </div>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'startDate\') | localizedDate:"L" | async}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'annotationType.code\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'annotationType.name\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'annotation\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)}}</span>\n </td>\n \x3c!--{CA:GRID_BODY_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_BODY_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span [translate]="\'hcm_contract.employment_additional_info.total_records\'" [translateParams]="{value: totalRecords}"></span>\n </ng-template>\n \x3c!--{CA:GRID_TEMPLATES:START}--\x3e\n \x3c!--{CA:GRID_TEMPLATES:END}--\x3e\n </p-table>\n </div>\n </div>\n </div>\n </p-panel>\n</div>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',selector:"fnd-annotation-history",providers:[i.ConfirmationService]})],o)}(Ln),no=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,Bn,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,l.DynamicFormModule,l.TokenListModule,E.PanelModule,D.InputTextModule,V.ButtonModule,N.CheckboxModule,k.TableModule,v.ConfirmDialogModule,_.CalendarModule,g.DropdownModule,I.TabViewModule,y.HotkeyModule,l.LoadingStateModule,l.BignumberInputModule,n.CyclicJsonInterceptorModule,n.HttpInterceptorModule,R.ToastModule,Qn,l.FileUploadModule,G.EmployeeLookupModule,G.EntityLookupModule.forRoot({domain:"hcm_contract",service:"employment_additional_info"}),G.AnnotationTypeLookupModule,G.WorkshiftLookupModule],declarations:[Zn,to],providers:[Ze,i.MessageService,$e,Vn,Nn,nn,pn],exports:[Zn,to]})],e)}(),oo=function(){function e(){}return e.isValidCpf=function(){var e=this;return function(t){var n;return e.validateCpf(t.value)||(null===(n=t.value)||void 0===n?void 0:n.length)<11?null:{cpfNotValid:!0}}},e.isValidCnpj=function(){var e=this;return function(t){return e.validateIsCnpjHasMask(t.value)||e.validateCnpj(t.value)?null:{cnpjNotValid:!0}}},e.validateIsCnpjHasMask=function(e){return!e||"__.___.___/____-__"==e},e.validateCpf=function(e){if(e){e=e.toString().replace(/[^\d]+/g,"");var t=0,n=void 0;if(["00000000000","11111111111","22222222222","33333333333","44444444444","55555555555","66666666666","77777777777","88888888888","99999999999"].includes(e)||11!=e.length)return!1;for(var o=1;o<=9;o++)t+=parseInt(e.substring(o-1,o),0)*(11-o);if(10!=(n=10*t%11)&&11!=n||(n=0),n!=parseInt(e.substring(9,10),0))return!1;t=0;for(o=1;o<=10;o++)t+=parseInt(e.substring(o-1,o),0)*(12-o);if(10!=(n=10*t%11)&&11!=n||(n=0),n!=parseInt(e.substring(10,11),0))return!1}return!0},e.validateCnpj=function(e){if(e){e=e.toString().replace(/[^\d]+/g,"");for(var t=0,n=0,o=0;o<4;o++)t+=e[o]*(5-o),n+=e[o]*(6-o);n+=2*e[4];for(o=0;o<8;o++)t+=e[o+4]*(9-o),n+=e[o+5]*(9-o);var i=[t=t%11>1?11-t%11:0,n=n%11>1?11-n%11:0];return!!(i[0]==e[12]&&i[1]==e[13])}},e}(),io=function(n){function o(o,i,a,s,l,c,p,d,u,h,y,f,_,v,g,b,S,D,T,F,E,C,k,I,R,L){var A=n.call(this,i,o,D,E,h,L)||this;return A.baseHistoryService=o,A.translate=i,A.eSocialReasonService=a,A.cdr=s,A.minutesToTimeConversionService=l,A.leaveHistoryService=c,A.leaveHistoryAttachmentService=p,A.router=d,A.route=u,A.messageService=h,A.confirmationService=y,A.formBuilder=f,A.hotkeysService=_,A.fieldCustomization=v,A.focusService=g,A.diseaseSubgroupService=b,A.diseaseService=S,A.employeeService=D,A.situationService=T,A.errorPageService=F,A.platformService=E,A.collectiveService=C,A.sanitizer=k,A.structureService=I,A.employeeLookupService=R,A.leaveHistoryBFFService=L,A.localeConfig={},A.currencyLocaleOptions={},A.permissions={},A.allPermissions={},A.mainPanelCollapsed=!1,A.isUsingTable=!1,A.sourceReasonChange=[{label:A.translate.instant("hcm_contract.employment_additional_info.source_reason_change_v_1"),value:e.SourceReasonChange.V1},{label:A.translate.instant("hcm_contract.employment_additional_info.source_reason_change_v_2"),value:e.SourceReasonChange.V2},{label:A.translate.instant("hcm_contract.employment_additional_info.source_reason_change_v_3"),value:e.SourceReasonChange.V3}],A.processType=[{label:A.translate.instant("hcm_contract.employment_additional_info.process_type_v_1"),value:e.ProcessType.V1},{label:A.translate.instant("hcm_contract.employment_additional_info.process_type_v_2"),value:e.ProcessType.V2},{label:A.translate.instant("hcm_contract.employment_additional_info.process_type_v_3"),value:e.ProcessType.V3}],A.onusRemuneration=[{label:A.translate.instant("hcm_contract.employment_additional_info.onus_remuneration_v_1"),value:e.OnusRemuneration.V1},{label:A.translate.instant("hcm_contract.employment_additional_info.onus_remuneration_v_2"),value:e.OnusRemuneration.V2},{label:A.translate.instant("hcm_contract.employment_additional_info.onus_remuneration_v_3"),value:e.OnusRemuneration.V3}],A.workAccidentType=[{label:A.translate.instant("hcm_contract.employment_additional_info.work_accident_type_v_1"),value:e.WorkAccidentType.V1},{label:A.translate.instant("hcm_contract.employment_additional_info.work_accident_type_v_2"),value:e.WorkAccidentType.V2},{label:A.translate.instant("hcm_contract.employment_additional_info.work_accident_type_v_3"),value:e.WorkAccidentType.V3}],A.subgroupCidLookupSuggestionsObservable=new r.Subject,A.subgroupCidLookupSearchObservable=new r.Subject,A.subgroupCidLookupDisplayFields=["code","name"],A.subgroupCidAdvancedDisplayFields=["code","name"],A.subgroupCidLookupSeparator=" - ",A.diseaseCidLookupSuggestionsObservable=new r.Subject,A.diseaseCidLookupSearchObservable=new r.Subject,A.diseaseCidLookupDisplayFields=["code","name"],A.diseaseCidAdvancedDisplayFields=["code","name"],A.diseaseCidLookupSeparator=" - ",A.employeeLookupSuggestionsObservable=new r.Subject,A.employeeLookupSearchObservable=new r.Subject,A.employeeLookupDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"].concat(A.employeeFieldsForValidation),A.employeeAdvancedDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"].concat(A.employeeFieldsForValidation),A.employeeLookupSeparator=" - ",A.situationLookupSuggestionsObservable=new r.Subject,A.situationLookupSearchObservable=new r.Subject,A.situationLabelFields=["code","name"],A.situationAdvancedDisplayFields=["code","name","situationType"],A.situationLookupSeparator=" - ",A.initialValueSituation=!1,A.customizationPermission={visualizar:!1},A.isReinstatement=!1,A.files=[],A.onUploadFile=new t.EventEmitter,A.countBeforeUploadFile=0,A.countAfterUploadFile=0,A.errorMessages={required:A.translate.instant("hcm_contract.employment_additional_info.error_required"),min:A.translate.instant("hcm_contract.employment_additional_info.error_min_value",{value:10}),max:A.translate.instant("hcm_contract.employment_additional_info.error_max_value"),minlength:A.translate.instant("hcm_contract.employment_additional_info.error_min_length"),maxlength:A.translate.instant("hcm_contract.employment_additional_info.error_max_length"),pattern:A.translate.instant("hcm_contract.employment_additional_info.error_invalid"),cnpjNotValid:A.translate.instant("hcm_contract.employment_additional_info.error_cnpj_not_valid"),dateBeforeAdmission:A.translate.instant("hcm_contract.employment_additional_info.validation_start_date_is_before_hire_date"),dateAfterDismissal:A.translate.instant("hcm_contract.employment_additional_info.validation_start_date_is_after_dismissal_date"),messageProcessNumberRequires17Or21Figures:A.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_17_or_21_figures"),messageProcessNumberRequires20Figures:A.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_20_figures"),messageProcessNumberRequires10Figures:A.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_10_figures"),justifiedDaysQuantityMustBeLowerThanEndDate:A.translate.instant("hcm_contract.employment_additional_info.message_justified_days_cant_be_greater_than_days_between_start_and_end_date"),timeMustNotBeZero:A.translate.instant("hcm_contract.employment_additional_info.message_time_must_not_be_zero"),estimatedEndDateMustBeGreaterThanOrEqualToStartDate:A.translate.instant("hcm_contract.employment_additional_info.message_date_should_be_greater_than_or_equal_to_start_date"),endDateMustBeGreaterThanOrEqualToStartDate:A.translate.instant("hcm_contract.employment_additional_info.message_date_should_be_greater_than_or_equal_to_start_date")},A.contractTypeOptions=[{label:A.translate.instant("hcm_contract.employment_additional_info.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:A.translate.instant("hcm_contract.employment_additional_info.contract_type_director"),value:e.ContractType.DIRECTOR},{label:A.translate.instant("hcm_contract.employment_additional_info.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:A.translate.instant("hcm_contract.employment_additional_info.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:A.translate.instant("hcm_contract.employment_additional_info.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}],A.situationTypeOptions=[{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_illnessaid"),value:e.SituationType.ILLNESSAID},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_laboraccident"),value:e.SituationType.LABORACCIDENT},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_militaryservice"),value:e.SituationType.MILITARYSERVICE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_maternityleave"),value:e.SituationType.MATERNITYLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_maternityleavenoncriminalabortion"),value:e.SituationType.MATERNITYLEAVENONCRIMINALABORTION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_maternityleaveanticipationextension"),value:e.SituationType.MATERNITYLEAVEANTICIPATIONEXTENSION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_citizencompanymaternity"),value:e.SituationType.CITIZENCOMPANYMATERNITY},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_inssmaternityleave"),value:e.SituationType.INSSMATERNITYLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_leavewithoutcompensation"),value:e.SituationType.LEAVEWITHOUTCOMPENSATION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_paidleave"),value:e.SituationType.PAIDLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_paternityleave"),value:e.SituationType.PATERNITYLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_citizencompanypaternity"),value:e.SituationType.CITIZENCOMPANYPATERNITY},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_medicalleave"),value:e.SituationType.MEDICALLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_medicalleavewithoutinss"),value:e.SituationType.MEDICALLEAVEWITHOUTINSS},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_absences"),value:e.SituationType.ABSENCES},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_timeevaluationsituation"),value:e.SituationType.TIMEEVALUATIONSITUATION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_tradeunionmandate"),value:e.SituationType.TRADEUNIONMANDATE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_workaccidentleave"),value:e.SituationType.WORKACCIDENTLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_workaccidentleavewithoutinss"),value:e.SituationType.WORKACCIDENTLEAVEWITHOUTINSS},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_retirementduetodisability"),value:e.SituationType.RETIREMENTDUETODISABILITY},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_professionalqualification"),value:e.SituationType.PROFESSIONALQUALIFICATION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_vacation"),value:e.SituationType.VACATION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_collectivevacation"),value:e.SituationType.COLLECTIVEVACATION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_priornoticehoursworkd"),value:e.SituationType.PRIORNOTICEHOURSWORKED},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_others"),value:e.SituationType.OTHERS}],A.listFiles=[],A.configs=[],A.configsFieldSet=[],A.configObservation=[],A.configSituation=[],A.domain=m.DOMAIN,A.service=m.SERVICE,A.entity=m.SITUATION,A.historyName=m.HISTORY_NAME,A.subgroupCidSearchFields=A.getSubgroupCidSearchFields(),A.subgroupCidSearchGridFields=A.getSubgroupCidSearchGridFields(),A.diseaseCidSearchFields=A.getDiseaseCidSearchFields(),A.diseaseCidSearchGridFields=A.getDiseaseCidSearchGridFields(),A.employeeSearchFields=A.getEmployeeSearchFields(),A.employeeSearchGridFields=A.getEmployeeSearchGridFields(),A.situationSearchFields=A.getSituationSearchFields(),A.situationSearchGridFields=A.getSituationSearchGridFields(),A}var m;return Y(o,n),m=o,o.prototype.ngOnInit=function(){var e=this;this.collectiveProcessType=this.route.snapshot.fragment,this.formGroup=this.getFormGroup(),this.allocateLoadedEmployee(),this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)})),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.formFields=this.getFormFields(),this.configs=[{type:l.DynamicType.Section,configs:[{type:l.DynamicType.Row,fields:this.setGeneralFields().map((function(e){return new l.FormField(e)}))}]}],this.configSituation=[{type:l.DynamicType.Section,configs:[{type:l.DynamicType.Row,fields:[new l.FormField({type:l.FieldType.Lookup,name:"situation",dataKey:"id",multiple:!1,lookupDisplayField:"label",recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),required:function(){return!0},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.situationLookupSuggestionsObservable,searchObservable:this.situationLookupSearchObservable,onLookupRequest:function(t){return e.onSituationLookupRequest(t)},onSelect:function(t){return e.initialValueSituation=!1},onSearchRequest:function(t){return e.onSituationSearchRequest(t)},searchFields:this.situationSearchFields,searchGridFields:this.situationSearchGridFields})]}]}],this.configObservation=[{type:l.DynamicType.Section,configs:[{type:l.DynamicType.Row,fields:[new l.FormField({type:l.FieldType.TextIA,name:"observation",rows:5,required:function(){return e.isObservationRequired()},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_observation"),size:{xl:12,lg:12,md:12,sm:12,xs:12},prompt:"Ajude o colaborador que irá se afastar, a escrever uma observaçao para o afastamento de trabalho, o colaborador relatou: {{context}}. Limite a 30 palavras. a observação deve ser feita em "+this.translate.getDefaultLang()+"."})]}]}]},o.prototype.ngAfterViewInit=function(){var e=this,t=document.getElementsByTagName("input"),n=Array.from(t).find((function(e){return!e.disabled}));n&&!this.isClockingEvent&&n.focus(),this.onChangeField("employee").subscribe((function(t){e.handleReinstatementInEditMode((function(){e.applyResetFieldWhenIsNew("situation"),e.applyAllFieldBehaviorExceptReinstatement(),e.loadDataByEmployee(t)}))})),this.onChangeField("estimatedJourneyCompleted").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applySituationFieldBehaviour(),e.applyStartTimeFieldBehaviour(),e.applyAllFieldBehaviorExceptReinstatement(),e.applyEndTimeFieldBehaviour()}))})),this.onChangeField("startDate").subscribe((function(t){e.handleReinstatementInEditMode((function(){e.applyResetFieldWhenIsNew("situation"),e.applyAllFieldBehaviorExceptReinstatement(),e.applyEndTimeFieldBehaviour(),e.loadDataByStartDate(t)}))})),this.onChangeField("startTime").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEndTimeFieldBehaviour(),e.applyEndDateFieldBehaviour()}))})),this.onChangeField("situation").subscribe((function(t){e.handleReinstatementInEditMode((function(){var n=new Set(["sourceReasonChange","birthDate","diseaseCid","subgroupCid","cnpjUnion","onusRemuneration","processType","processNumber","workAccidentType","justifiedDays","resultedSicknessAssistance","optedRemunerationPermanentPosition","cnpjForElectiveMandatory","sameReasonEsocial"]);e.currentSituation&&e.currentSituation.id!==(null==t?void 0:t.id)&&(n.forEach((function(t){return e.formGroup.controls[t].setValue(null)})),e.originalLeaveHistory=null),t&&(e.currentSituation=t),e.applyAllFieldBehaviorExceptReinstatement(),e.applyEstimatedJourneyCompletedBehavior(),e.loadDataBySituation(t)}))})),this.onChangeField("sourceReasonChange").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyProcessTypeFieldBehaviour(),e.applyProcessNumberFieldBehaviour()}))})),this.onChangeField("processType").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyProcessNumberFieldBehaviour()}))})),this.onChangeField("diseaseCid").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applySubgroupCidFieldBehaviour()}))})),this.onChangeField("justifiedDays").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEstimatedEndDateFieldBehaviour()}))})),this.onChangeField("estimatedDayEnd").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEstimatedEndDateFieldBehaviour()}))})),this.onChangeField("estimatedEndDate").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEstimatedDayEndFieldBehaviour()}))})),this.onChangeField("endDate").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEndTimeFieldBehaviour(),e.applyJustifiedDaysFieldBehaviour()}))})),this.onChangeField("endTime").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEndTimeFieldBehaviour()}))}))},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+s",(function(){return(e.isNew()||e.permissions.editar)&&e.onSave(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+c",(function(){return e.onCancel(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.applyResetFieldWhenIsNew=function(e){this.isNew()&&this.formGroup.get(e).reset()},o.prototype.setGeneralFields=function(){var e=this;return[this.employeeLookupService.getFormField(this.isCollective),new l.FormField({type:l.FieldType.Boolean,name:"estimatedJourneyCompleted",representedBy:"switch",required:function(){return e.isEstimatedJourneyCompletedRequired()},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_estimated_journey_completed"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")},size:{xl:this.isCollective?12:6}}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"startDate",required:function(){return!0},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_date"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_date_placeholder"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_date"),size:{xl:3}}),new l.FormField({type:l.FieldType.Time,calendarLocaleOptions:this.localeConfig.calendar,name:"startTime",showSeconds:!1,required:function(){return e.isTimeRequired("startDate")},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_time"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_date_time_placeholder"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_time"),size:{xl:3}}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"endDate",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_date"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_date_placeholder"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_date"),size:{xl:3}}),new l.FormField({type:l.FieldType.Time,calendarLocaleOptions:this.localeConfig.calendar,name:"endTime",showSeconds:!1,required:function(){return e.isTimeRequired("endDate")},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_time"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_date_time_placeholder"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_time"),size:{xl:3}}),new l.FormField({type:l.FieldType.Number,name:"estimatedDayEnd",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_estimated_day_end"),required:function(){return!1},precision:4,scale:0,size:{xl:3}}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"estimatedEndDate",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_estimated_end_date"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_estimated_end_date"),size:{xl:3}})]},o.prototype.setAdditionalFields=function(e){this.hasAdditionalInformation=!0;var t=new l.FormField({type:l.FieldType.Integer,name:"justifiedDays",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_justified_days"),required:function(){return!1},precision:2,scale:0,size:{xl:3}}),n=new l.FormField({type:l.FieldType.Boolean,name:"resultedSicknessAssistance",representedBy:"switch",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_resulted_sickness_assistance"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")}}),o=[];switch(e){case"INSSMATERNITYLEAVE":case"MATERNITYLEAVE":o.push.apply(o,$(this.setMaternityLeaveFields().concat(this.setCIDFields()).map((function(e){return new l.FormField(e)}))));break;case"ILLNESSAID":case"LABORACCIDENT":o.push.apply(o,$(this.setCIDFields().map((function(e){return new l.FormField(e)})).concat(t)));break;case"MEDICALLEAVE":case"WORKACCIDENTLEAVE":o.push.apply(o,$(this.setCIDFields().map((function(e){return new l.FormField(e)})).concat(n)));break;case"RETIREMENTDUETODISABILITY":o.push.apply(o,$(this.setCIDFields().map((function(e){return new l.FormField(e)}))))}this.configsFieldSet=[{header:this.translate.instant("hcm_contract.employment_additional_info.additional_information"),type:l.DynamicType.Fieldset,configs:[{type:l.DynamicType.Row,fields:this.setESocialFields(o)}]}],this.hasAdditionalInformation=!!(null==o?void 0:o.length)},o.prototype.setMaternityLeaveFields=function(){return[new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"birthDate",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_birth_date"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_date_placeholder"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_birth_date"),size:{xl:3}})]},o.prototype.setFieldsV22orV23=function(){return[new l.FormField({type:l.FieldType.String,name:"cnpjForElectiveMandatory",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_cnpj_for_elective_mandatory"),mask:function(){return"99.999.999/9999-99"},required:function(){return!1},precision:14,scale:0}),new l.FormField({type:l.FieldType.Boolean,name:"optedRemunerationPermanentPosition",representedBy:"switch",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_opted_remuneration_permanent_position"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")},size:{xl:3}})]},o.prototype.setCIDFields=function(){var e=this;return[new l.FormField({type:l.FieldType.Lookup,name:"diseaseCid",dataKey:"id",multiple:!1,lookupDisplayField:"label",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_disease_cid"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_disease_cid_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.diseaseCidLookupSuggestionsObservable,searchObservable:this.diseaseCidLookupSearchObservable,onLookupRequest:function(t){return e.onDiseaseCidLookupRequest(t)},onSearchRequest:function(t){return e.onDiseaseCidSearchRequest(t)},searchFields:this.diseaseCidSearchFields,searchGridFields:this.diseaseCidSearchGridFields,size:{xl:3,lg:4,md:6,sm:12,xs:12}}),new l.FormField({type:l.FieldType.Lookup,name:"subgroupCid",dataKey:"id",multiple:!1,lookupDisplayField:"label",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_subgroup_cid"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_subgroup_cid_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.subgroupCidLookupSuggestionsObservable,searchObservable:this.subgroupCidLookupSearchObservable,onLookupRequest:function(t){return e.onSubgroupCidLookupRequest(t)},onSearchRequest:function(t){return e.onSubgroupCidSearchRequest(t)},searchFields:this.subgroupCidSearchFields,searchGridFields:this.subgroupCidSearchGridFields,recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),size:{xl:3,lg:4,md:6,sm:12,xs:12}})]},o.prototype.isESocialHasCIDFields=function(t){return t===e.ESocialReasonType.V1||t===e.ESocialReasonType.V3||t===e.ESocialReasonType.V16||t===e.ESocialReasonType.V17||t===e.ESocialReasonType.V33||t===e.ESocialReasonType.V19||t===e.ESocialReasonType.V20||t===e.ESocialReasonType.V35},o.prototype.setESocialFields=function(e){return this.isV1OrV3()?this.setV1OrV3Field().forEach((function(t){return e.push(t)})):this.isV24()?this.setV24Fields().forEach((function(t){return e.push(t)})):this.isV22orV23()&&this.setFieldsV22orV23().forEach((function(t){return e.push(t)})),!this.isESocialHasCIDFields(this.eSocialReasonType)||(null==e?void 0:e.length)&&e.some((function(e){return"diseaseCid"===e.name}))||this.setCIDFields().forEach((function(t){return e.push(t)})),e},o.prototype.setV1OrV3Field=function(){var e=this;return[new l.FormField({type:l.FieldType.Enum,name:"sourceReasonChange",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_source_reason_change"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_source_reason_change_placeholder"),multiple:!1,required:function(){return e.isSourceReasonChangeRequired()},options:this.sourceReasonChange,size:{xl:3}}),new l.FormField({type:l.FieldType.Enum,name:"processType",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_type"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_type_placeholder"),multiple:!1,required:function(){return e.isProcessTypeRequired()},options:this.processType,size:{xl:3}}),new l.FormField({type:l.FieldType.Number,name:"processNumber",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_number"),required:function(){return e.isProcessNumberRequired()},precision:21,scale:0,size:{xl:3}}),new l.FormField({type:l.FieldType.Enum,name:"workAccidentType",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_work_accident_type"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_work_accident_type_placeholder"),multiple:!1,required:function(){return!1},showClear:function(){return!1},options:this.workAccidentType,size:{xl:3}}),new l.FormField({type:l.FieldType.Boolean,name:"sameReasonEsocial",representedBy:"switch",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_same_reason_esocial"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")},size:{xl:3}})]},o.prototype.setV24Fields=function(){var e=this;return[new l.FormField({type:l.FieldType.String,name:"cnpjUnion",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_cnpj_union"),mask:function(){return"99.999.999/9999-99"},required:function(){return e.isCnpjUnionRequired()},precision:15,scale:0}),new l.FormField({type:l.FieldType.Enum,name:"onusRemuneration",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_onus_remuneration"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_onus_remuneration_placeholder"),multiple:!1,required:function(){return e.isOnusRemunerationRequired()},options:this.onusRemuneration})]},o.prototype.isNew=function(){return"new"==this.routeParams.leaveHistory},o.prototype.onRouteParamsChange=function(e){this.routeParams=e},o.prototype.updateSuggestions=function(e){e.subgroupCid&&(e.subgroupCid.label=this.getSuggestionValue(["code","name"],"subgroupCid",e,this.subgroupCidLookupSeparator),e.subgroupCid.label.trim()===this.subgroupCidLookupSeparator.trim()&&delete e.subgroupCid.label),e.diseaseCid&&(e.diseaseCid.label=this.getSuggestionValue(["code","name"],"diseaseCid",e,this.diseaseCidLookupSeparator),e.diseaseCid.label.trim()===this.diseaseCidLookupSeparator.trim()&&delete e.diseaseCid.label),e.employee&&(this.employeeLookupService.updateSuggestions(e),this.employeeLabel=e.employee.label),e.situation&&(e.situation.label=this.getSuggestionValue(["code","name"],"situation",e,this.situationLookupSeparator),e.label.trim()===this.situationLookupSeparator.trim()&&delete e.label)},o.prototype.getSuggestionValue=function(e,t,n,o){var i=this;return e.map((function(e){var o=Ae(n,t+"."+e);return"situationType"===e?i.loadLabelFromEnumOptions(o,i.situationTypeOptions):"employmentRelationship.contractType"===e?i.loadLabelFromEnumOptions(o,i.contractTypeOptions):o})).reduce((function(e,t){return""+e+o+t}))+""},o.prototype.onRouteDataChange=function(e){var t=e.localeConfig.number,n=t.currencySymbol,o=t.thousandsSeparator,i=t.decimalSeparator;if(this.isManager="profileType"in e&&e.profileType===un.MANAGEMENT,this.localeConfig=e.localeConfig,this.currencyLocaleOptions={align:"left",prefix:n,thousands:o,decimal:i},this.permissions=e.allPermissions.leaveHistory,this.allPermissions=e.allPermissions,this.customizationPermission=e.allPermissions.customization,this.validateVisualization())if(e.entity){this.initialValueSituation=!0;var a=this.permissions.editar;a||this.formGroup.disable();var r=sn.fromDto(e.entity);r.startTime=this.minutesToTimeConversionService.minutesToDate(r.startTime),r.endTime=this.minutesToTimeConversionService.minutesToDate(r.endTime),this.currentSituation=r.situation,this.listFiles=r.leaveHistoryAttachments,this.updateSuggestions(r),this.formGroup.patchValue(r),this.originalLeaveHistory=r,this.setEnabledStatusOnCustomFields(a),this.startFuncionsByBaseHistoryInEdit(r),this.handleDateTimeFieldsOnEdit(),this.loadDataForTheFirstTime()}else this.isCollective?this.startFuncionsByBaseCollectiveHistory():this.startFuncionsByBaseHistory(this.employeeLabel),this.applyAllFieldBehaviour(),this.formGroup.patchValue(new sn)},o.prototype.onCancel=function(){this.isCollective?this.collectiveService.setCancelForm(!0):this.goBack()},o.prototype.onSendFile=function(e,t){var n=[];return this.fieldCustomization.isEmpty(e)||n.push(this.fieldCustomization.deleteFiles(e)),this.fieldCustomization.isEmpty(t)||n.push(this.fieldCustomization.commitFiles(t)),this.fieldCustomization.isEmpty(n)?r.of({}):r.forkJoin(n)},o.prototype.onSave=function(){var e=this;if(!this.formGroup.valid)return this.loading=!1,this.validateAllFormFields(this.formGroup);this.formGroup.get("leaveHistoryAttachments").setValue(this.listFiles),this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onSaveCollective()}}):this.onSaveSingle()},o.prototype.onSaveCollective=function(){var e=this;this.loading=!0;var t=this.formGroup.getRawValue();t.startTime=this.minutesToTimeConversionService.dateToMinutes(t.startTime,t.estimatedJourneyCompleted),t.endTime=t.endDate&&this.minutesToTimeConversionService.dateToMinutes(t.endTime,t.estimatedJourneyCompleted);var n=this.collectiveFormGroup.getRawValue(),o=sn.toDtoCollective(t,null==n?void 0:n.filter);this.leaveHistoryService.saveCollective(o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onSaveSingle=function(){var e=this;this.loading=!0,this.onFormLoadingSubject.next(!0);var t=this.fieldCustomization.getFiles(this.formGroup),n=t.filesToDelete,o=t.filesToCommit;this.getSaveObservable().pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,e.onFormLoadingSubject.next(!1),r.throwError(t)}))).subscribe((function(){e.onSendFile(n,o).pipe(s.takeUntil(e.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,r.throwError(t)})),s.finalize((function(){return e.loading=!1}))).subscribe((function(){e.addMessage("success","hcm_contract.employment_additional_info.saved_message_title","hcm_contract.employment_additional_info.saved_message_content"),e.employeeData?e.onClose.next(!0):e.goBack()}))}))},o.prototype.onDeleteCollective=function(){var e=this,t=this.formGroup.getRawValue(),n=this.collectiveFormGroup.getRawValue();t.startTime=this.minutesToTimeConversionService.dateToMinutes(t.startTime,t.estimatedJourneyCompleted),t.endTime=t.endDate&&this.minutesToTimeConversionService.dateToMinutes(t.endTime,t.estimatedJourneyCompleted);var o=sn.toDtoCollective(t,null==n?void 0:n.filter);this.leaveHistoryService.deleteCollective(o).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onDelete=function(){var e=this;if(!this.formGroup.valid&&"DISABLED"!=this.formGroup.status)return this.loading=!1,this.validateAllFormFields(this.formGroup);this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onDeleteCollective()}}):this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_title"),accept:function(){e.loading=!0,e.getDeleteObservable().pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.loading=!1,e.finishOperation()}))).subscribe()}})},o.prototype.doAfterProcessAndResetFormGroup=function(e){this.doAfterProcess(e),this.resetFormGroup()},o.prototype.resetFormGroup=function(){this.formGroup.reset(),this.collectiveFormGroup.reset()},o.prototype.onSituationLookupRequest=function(e){var t=this,n=this.getFilterRegisterByStartDate([Pe(e,this.situationSearchFields),this.getFilterByNotAllowedSituationTypes()].filter(Boolean).map((function(e){return"("+e+")"})).join(" and "),!1),o=this.situationAdvancedDisplayFields.map((function(e){return{field:e,order:1}}));if(this.checkIfExistsStructureToThrowMessage(n)){var i=this.situationAdvancedDisplayFields;this.situationService.list({sort:o,filterQuery:n,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.situationLabelFields)}))).subscribe((function(e){return t.situationLookupSuggestionsObservable.next(e)}))}else this.situationLookupSuggestionsObservable.next([])},o.prototype.onSituationSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.getFilterRegisterByStartDate([this.getFilterByNotAllowedSituationTypes(),this.situationSearchFields.filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){return ce(e,a[e.name])})).join(" and ")].filter(Boolean).map((function(e){return"("+e+")"})).join(" and "),!1);if(this.checkIfExistsStructureToThrowMessage(c)){var p=this.situationAdvancedDisplayFields;this.situationService.list({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.situationLabelFields),searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements}),totalRecords:e.totalElements}}))).subscribe((function(e){return t.situationLookupSearchObservable.next(e)}))}else this.situationLookupSearchObservable.next({gridData:[],totalRecords:0})},o.prototype.checkIfExistsStructureToThrowMessage=function(e){var t,n,o,i;if(!e.includes(this.entity+"Structure")){var a=null===(o=null===(n=null===(t=this.formGroup)||void 0===t?void 0:t.get("employee").value)||void 0===n?void 0:n.employer)||void 0===o?void 0:o.id,r=null===(i=this.formGroup)||void 0===i?void 0:i.get("startDate").value;if(a&&r){var s={companyIds:[a],domain:null,service:null,entity:this.entity,referenceDate:r,useDateValidation:!1,useStructure:!0};return this.structureService.showMessageToCompanyWithoutStructure(s,this.localeConfig)}}return!0},o.prototype.onSubgroupCidLookupRequest=function(e){var t=this,n=this.subgroupCidLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=Pe(e,this.subgroupCidSearchFields),i=Ee(this.subgroupCidLookupDisplayFields,this.subgroupCidAdvancedDisplayFields);this.diseaseSubgroupService.listExternalDiseaseSubgroup({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return we(e.contents,t.subgroupCidLookupDisplayFields)}))).subscribe((function(e){return t.subgroupCidLookupSuggestionsObservable.next(e)}))},o.prototype.onSubgroupCidSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.subgroupCidSearchFields.filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){return ce(e,a[e.name])})).join(" and "),p=Ee(this.subgroupCidLookupDisplayFields,this.subgroupCidAdvancedDisplayFields);this.diseaseSubgroupService.listExternalDiseaseSubgroup({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:we(e.contents,t.subgroupCidLookupDisplayFields),searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements}),totalRecords:e.totalElements}}))).subscribe((function(e){return t.subgroupCidLookupSearchObservable.next(e)}))},o.prototype.onDiseaseCidLookupRequest=function(e){var t=this,n=this.diseaseCidLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=Pe(e,this.diseaseCidSearchFields),i=Ee(this.diseaseCidLookupDisplayFields,this.diseaseCidAdvancedDisplayFields);this.diseaseService.listExternalDisease({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return we(e.contents,t.diseaseCidLookupDisplayFields)}))).subscribe((function(e){return t.diseaseCidLookupSuggestionsObservable.next(e)}))},o.prototype.onDiseaseCidSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.diseaseCidSearchFields.filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){return ce(e,a[e.name])})).join(" and "),p=Ee(this.diseaseCidLookupDisplayFields,this.diseaseCidAdvancedDisplayFields);this.diseaseService.listExternalDisease({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:we(e.contents,t.diseaseCidLookupDisplayFields),searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements}),totalRecords:e.totalElements}}))).subscribe((function(e){return t.diseaseCidLookupSearchObservable.next(e)}))},o.prototype.onEmployeeLookupRequest=function(e){var t=this,n=this.employeeLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=Pe(e,this.employeeSearchFields),i=Ee(this.employeeLookupDisplayFields,this.employeeAdvancedDisplayFields);this.employeeService.list({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.employeeLookupDisplayFields.filter((function(e){return!t.employeeFieldsForValidation.includes(e)})))}))).subscribe((function(e){return t.employeeLookupSuggestionsObservable.next(e)}))},o.prototype.onEmployeeSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.employeeSearchFields.filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){return ce(e,a[e.name])})).join(" and "),p=Ee(this.employeeLookupDisplayFields,this.employeeAdvancedDisplayFields);this.employeeService.list({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.employeeLookupDisplayFields.filter((function(e){return!t.employeeFieldsForValidation.includes(e)}))),searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements}),totalRecords:e.totalElements}}))).subscribe((function(e){return t.employeeLookupSearchObservable.next(e)}))},o.prototype.getFormGroup=function(){return this.formBuilder.group({id:[{value:void 0,disabled:!0},p.Validators.compose([])],employee:[{value:void 0,disabled:!1},p.Validators.compose(this.isCollective?[]:[p.Validators.required])],startDate:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required])],startTime:[{value:void 0,disabled:!1},p.Validators.compose([])],situation:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required])],observation:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.maxLength(255)])],estimatedDayEnd:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.pattern(/^[1-9]\d*$/)])],estimatedEndDate:[{value:void 0,disabled:!1},p.Validators.compose([])],endDate:[{value:void 0,disabled:!1},p.Validators.compose([this.getEndDateTimeIsBeforeOrEqualToStartDateTimeValidator()])],endTime:[{value:void 0,disabled:!1},p.Validators.compose([])],estimatedJourneyCompleted:[{value:void 0,disabled:!1},p.Validators.compose([])],createdBy:[{value:void 0,disabled:!0},p.Validators.compose([])],createdDate:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedBy:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedDate:[{value:void 0,disabled:!0},p.Validators.compose([])],custom:[],sourceReasonChange:[{value:void 0,disabled:!1},p.Validators.compose([])],processType:[{value:void 0,disabled:!1},p.Validators.compose([])],processNumber:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.pattern(/^\-?\d*$/),p.Validators.min(1e9),this.getProcessNumberValidator()])],birthDate:[{value:void 0,disabled:!1},p.Validators.compose([])],diseaseCid:[{value:void 0,disabled:!1},p.Validators.compose([])],subgroupCid:[{value:void 0,disabled:!1},p.Validators.compose([])],cnpjUnion:[{value:void 0,disabled:!1},p.Validators.compose([])],onusRemuneration:[{value:void 0,disabled:!1},p.Validators.compose([])],workAccidentType:[{value:void 0,disabled:!1},p.Validators.compose([])],justifiedDays:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.pattern(/^\-?\d*$/)])],sameReasonEsocial:[{value:void 0,disabled:!1},p.Validators.compose([])],resultedSicknessAssistance:[{value:void 0,disabled:!1},p.Validators.compose([])],leaveHistoryAttachments:[{value:void 0,disabled:!1},p.Validators.compose([])],generatedByPayroll:[{value:!1,disabled:!0},p.Validators.compose([])],cnpjForElectiveMandatory:[{value:void 0,disabled:!1},p.Validators.compose([oo.isValidCnpj()])],optedRemunerationPermanentPosition:[{value:void 0,disabled:!1},p.Validators.compose([])]})},o.prototype.getFormFields=function(){var e=this;return[this.employeeLookupService.getFormField(this.isCollective),new l.FormField({type:l.FieldType.Boolean,name:"estimatedJourneyCompleted",representedBy:"switch",required:function(){return e.isEstimatedJourneyCompletedRequired()},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_estimated_journey_completed"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")}}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"startDate",required:function(){return!0},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_date"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_date")}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"endDate",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_date"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_date")}),new l.FormField({type:l.FieldType.Time,calendarLocaleOptions:this.localeConfig.calendar,name:"startTime",showSeconds:!1,required:function(){return e.isTimeRequired("startDate")},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_time"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_time")}),new l.FormField({type:l.FieldType.Time,calendarLocaleOptions:this.localeConfig.calendar,name:"endTime",showSeconds:!1,required:function(){return e.isTimeRequired("endDate")},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_time"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_time")}),new l.FormField({type:l.FieldType.Lookup,name:"situation",recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),dataKey:"id",multiple:!1,lookupDisplayField:"label",required:function(){return!0},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.situationLookupSuggestionsObservable,searchObservable:this.situationLookupSearchObservable,onLookupRequest:function(t){return e.onSituationLookupRequest(t)},onSearchRequest:function(t){return e.onSituationSearchRequest(t)},searchFields:this.situationSearchFields,searchGridFields:this.situationSearchGridFields}),new l.FormField({type:l.FieldType.Boolean,name:"resultedSicknessAssistance",representedBy:"switch",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_resulted_sickness_assistance"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")}}),new l.FormField({type:l.FieldType.Enum,name:"sourceReasonChange",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_source_reason_change"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_source_reason_change_placeholder"),multiple:!1,required:function(){return e.isSourceReasonChangeRequired()},options:this.sourceReasonChange}),new l.FormField({type:l.FieldType.Enum,name:"processType",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_type"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_type_placeholder"),multiple:!1,required:function(){return e.isProcessTypeRequired()},options:this.processType}),new l.FormField({type:l.FieldType.Number,name:"processNumber",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_number"),required:function(){return e.isProcessNumberRequired()},precision:21,scale:0}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"birthDate",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_birth_date"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_birth_date")}),new l.FormField({type:l.FieldType.Lookup,recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),name:"diseaseCid",dataKey:"id",multiple:!1,lookupDisplayField:"label",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_disease_cid"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_disease_cid_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.diseaseCidLookupSuggestionsObservable,searchObservable:this.diseaseCidLookupSearchObservable,onLookupRequest:function(t){return e.onDiseaseCidLookupRequest(t)},onSearchRequest:function(t){return e.onDiseaseCidSearchRequest(t)},searchFields:this.diseaseCidSearchFields,searchGridFields:this.diseaseCidSearchGridFields,size:{xl:3,lg:4,md:6,sm:12,xs:12}}),new l.FormField({type:l.FieldType.Lookup,name:"subgroupCid",dataKey:"id",multiple:!1,lookupDisplayField:"label",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_subgroup_cid"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_subgroup_cid_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.subgroupCidLookupSuggestionsObservable,searchObservable:this.subgroupCidLookupSearchObservable,onLookupRequest:function(t){return e.onSubgroupCidLookupRequest(t)},onSearchRequest:function(t){return e.onSubgroupCidSearchRequest(t)},searchFields:this.subgroupCidSearchFields,recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),searchGridFields:this.subgroupCidSearchGridFields,size:{xl:3,lg:4,md:6,sm:12,xs:12}}),new l.FormField({type:l.FieldType.String,name:"cnpjUnion",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_cnpj_union"),mask:function(){return"99.999.999/9999-99"},required:function(){return e.isCnpjUnionRequired()},precision:15,scale:0}),new l.FormField({type:l.FieldType.Enum,name:"onusRemuneration",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_onus_remuneration"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_onus_remuneration_placeholder"),multiple:!1,required:function(){return e.isOnusRemunerationRequired()},options:this.onusRemuneration}),new l.FormField({type:l.FieldType.Enum,name:"workAccidentType",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_work_accident_type"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_work_accident_type_placeholder"),multiple:!1,required:function(){return!1},options:this.workAccidentType}),new l.FormField({type:l.FieldType.Integer,name:"justifiedDays",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_justified_days"),required:function(){return!1},precision:2,scale:0}),new l.FormField({type:l.FieldType.Boolean,name:"sameReasonEsocial",representedBy:"switch",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_same_reason_esocial"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")}}),new l.FormField({type:l.FieldType.Text,name:"observation",required:function(){return e.isObservationRequired()},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_observation")})]},o.prototype.ngAfterViewChecked=function(){this.cdr.detectChanges()},o.prototype.isTimeRequired=function(e){return!this.formGroup.get("estimatedJourneyCompleted").value&&!!this.formGroup.get(e).value},o.prototype.isSourceReasonChangeRequired=function(){return this.isV1ToV3OrV3ToV1()},o.prototype.isProcessTypeRequired=function(){return this.isProcessRequired()},o.prototype.isProcessNumberRequired=function(){return this.isProcessRequired()},o.prototype.isCnpjUnionRequired=function(){return this.isV24()},o.prototype.isOnusRemunerationRequired=function(){return this.isV24()},o.prototype.isSameReasonEsocialRequired=function(){return this.isV1OrV3()&&this.v1OrV3LeaveWithinSixtyDays},o.prototype.isResultedSicknessAssistanceRequired=function(){var t=new Set([e.SituationType.MEDICALLEAVE,e.SituationType.WORKACCIDENTLEAVE]),n=this.formGroup.get("situation").value;return n&&t.has(n.situationType)},o.prototype.isObservationRequired=function(){return this.isV21()},o.prototype.isProcessRequired=function(){var t=this.formGroup&&this.formGroup.get("sourceReasonChange");return this.isV1ToV3OrV3ToV1()&&t.value&&(t.value===e.SourceReasonChange.V2.toString()||t.value===e.SourceReasonChange.V3.toString())},o.prototype.isEstimatedJourneyCompletedRequired=function(){var t=this.formGroup.get("situation").value;return!t||t.situationType!==e.SituationType.PROFESSIONALQUALIFICATION},o.prototype.isReinstatementInEditMode=function(t){var n=this.formGroup.get("situation").value;return n&&n.situationType===e.SituationType.REINSTATEMENT&&t},o.prototype.loadDataForTheFirstTime=function(){var e=this;this.loading=!0,this.eSocialReasonType=null,this.v1OrV3LeaveWithinSixtyDays=!1;var t=this.formGroup.get("startDate").value,n=this.formGroup.get("situation").value&&this.formGroup.get("situation").value.id,o=this.formGroup.get("employee").value&&this.formGroup.get("employee").value.id;r.forkJoin([this.getESocialReasonTypeObservable(n,t),this.getHasV1OrV3LeaveWithinSixtyDaysObservable(o,t)]).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){e.loading=!1,e.applyAllFieldBehaviour()}))).subscribe((function(t){var n=K(t,2),o=n[0],i=n[1];e.eSocialReasonType=o,e.originalESocialReasonType=o,e.v1OrV3LeaveWithinSixtyDays=i}))},o.prototype.loadDataBySituation=function(e){var t=this;e||(this.configsFieldSet=[]),this.eSocialReasonType=null;var n=e&&e.id,o=this.formGroup.get("startDate").value;(n&&o||this.isCollective)&&(this.loading=!0,this.getESocialReasonTypeObservable(n,o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){t.loading=!1,t.onESocialReasonTypeChange(),t.setAdditionalFields(e.situationType)}))).subscribe((function(e){return t.eSocialReasonType=e}),(function(){return t.eSocialReasonType=null})))},o.prototype.getESocialReasonTypeObservable=function(e,t){return e&&t?this.eSocialReasonService.fetchESocialReasonType(e,t).pipe(s.takeUntil(this.ngUnsubscribe)):r.of(void 0)},o.prototype.loadDataByStartDate=function(e){var t=this;this.loading=!0,this.eSocialReasonType=null,this.v1OrV3LeaveWithinSixtyDays=!1;var n=this.formGroup.get("situation").value&&this.formGroup.get("situation").value.id,o=this.formGroup.get("employee").value&&this.formGroup.get("employee").value.id;r.forkJoin([this.getESocialReasonTypeObservable(n,e),this.getHasV1OrV3LeaveWithinSixtyDaysObservable(o,e)]).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){t.loading=!1,t.onESocialReasonTypeChange(),t.onV1OrV3LeaveWithinSixtyDaysChange()}))).subscribe((function(e){var n=K(e,2),o=n[0],i=n[1];t.eSocialReasonType=o,t.v1OrV3LeaveWithinSixtyDays=i}),(function(){t.eSocialReasonType=null,t.v1OrV3LeaveWithinSixtyDays=!1}))},o.prototype.loadDataByEmployee=function(e){var t=this;this.v1OrV3LeaveWithinSixtyDays=!1;var n=e&&e.id,o=this.formGroup.get("startDate").value;n&&o&&this.isV1OrV3()&&(this.loading=!0,this.getHasV1OrV3LeaveWithinSixtyDaysObservable(n,o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){t.loading=!1,t.onV1OrV3LeaveWithinSixtyDaysChange()}))).subscribe((function(e){return t.v1OrV3LeaveWithinSixtyDays=e}),(function(){return t.v1OrV3LeaveWithinSixtyDays=!1})))},o.prototype.getHasV1OrV3LeaveWithinSixtyDaysObservable=function(e,t){if(e&&t){var n=this.formGroup.get("estimatedJourneyCompleted").value?c(t).format("YYYY-MM-DDTHH:mm:ss-00:00"):t;return this.getObservable(e,n)}return r.of(void 0)},o.prototype.getObservable=function(e,t){return this.isClockingEvent?this.leaveHistoryBffService.hasV1OrV3LeaveWithinSixtyDays(e,t).pipe(s.takeUntil(this.ngUnsubscribe)):this.leaveHistoryService.hasV1OrV3LeaveWithinSixtyDays(e,t).pipe(s.takeUntil(this.ngUnsubscribe))},o.prototype.onESocialReasonTypeChange=function(){this.applySourceReasonChangeFieldBehaviour(),this.applyProcessTypeFieldBehaviour(),this.applyProcessNumberFieldBehaviour(),this.applyDiseaseCidFieldBehaviour(),this.applySubgroupCidFieldBehaviour(),this.applyCnpjUnionFieldBehaviour(),this.applyOnusRemunerationFieldBehaviour(),this.applyWorkAccidentTypeFieldBehaviour(),this.applySameReasonEsocialFieldBehaviour(),this.applyObservationFieldBehaviour()},o.prototype.onV1OrV3LeaveWithinSixtyDaysChange=function(){this.applySameReasonEsocialFieldBehaviour()},o.prototype.isV1ToV3OrV3ToV1=function(){return this.isEditWhithValueInSourceReason()||this.originalESocialReasonType&&(this.eSocialReasonType===e.ESocialReasonType.V1&&this.originalESocialReasonType===e.ESocialReasonType.V3||this.eSocialReasonType===e.ESocialReasonType.V3&&this.originalESocialReasonType===e.ESocialReasonType.V1)},o.prototype.isEditWhithValueInSourceReason=function(){return!(this.isNew()||!this.formGroup.get("sourceReasonChange")||!this.formGroup.get("sourceReasonChange").value)},o.prototype.isV24=function(){return this.eSocialReasonType===e.ESocialReasonType.V24},o.prototype.isV1OrV3=function(){return this.eSocialReasonType===e.ESocialReasonType.V1||this.eSocialReasonType===e.ESocialReasonType.V3},o.prototype.isV21=function(){return this.eSocialReasonType===e.ESocialReasonType.V21},o.prototype.isV22orV23=function(){return this.eSocialReasonType===e.ESocialReasonType.V22||this.eSocialReasonType===e.ESocialReasonType.V23},o.prototype.getSubgroupCidSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.disease_subgroup_code"),type:l.FieldType.String}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.disease_subgroup_name"),type:l.FieldType.String})]},o.prototype.getSubgroupCidSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.disease_subgroup_code"),type:l.FieldType.String}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.disease_subgroup_name"),type:l.FieldType.String})]},o.prototype.getDiseaseCidSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.disease_code"),type:l.FieldType.String}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.disease_name"),type:l.FieldType.String})]},o.prototype.getDiseaseCidSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.disease_code"),type:l.FieldType.String}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.disease_name"),type:l.FieldType.String})]},o.prototype.getEmployeeSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getEmployeeSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getSituationSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.situation_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.situation_name"),type:l.FieldType.String})]},o.prototype.getSituationSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.situation_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.situation_name"),type:l.FieldType.String}),new l.FormField({name:"situationType",label:this.translate.instant("hcm_contract.employment_additional_info.situation_situation_type"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_additional_info.situation_situation_type_placeholder"),options:this.situationTypeOptions})]},o.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},o.prototype.getLabelValue=function(e,t){var n=this;return e.map((function(e){return z(z({},e),{label:t.map((function(t){return t.indexOf(".")>0&&(e[t]=n.getProp(e,t)),"employmentRelationship.contractType"===t&&(e[t]=n.loadLabelFromEnumOptions(e[t],n.contractTypeOptions)),"situationType"===t&&(e[t]=n.loadLabelFromEnumOptions(e[t],n.situationTypeOptions)),e[t]})).join(" - ")})}))},o.prototype.goBack=function(){this.router.navigate(["../"],{relativeTo:this.route})},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)})),this.verifyPermissionEditOnEdit()||this.focusService.focusFirstInvalidInput()},o.prototype.getSaveObservable=function(){var e=this.formGroup.getRawValue();e.employee=this.formGroup.controls[m.EMPLOYEE].value,e.startTime=this.minutesToTimeConversionService.dateToMinutes(e.startTime,e.estimatedJourneyCompleted),e.endTime=e.endDate&&this.minutesToTimeConversionService.dateToMinutes(e.endTime,e.estimatedJourneyCompleted),e.isManager=this.isManager;var t=sn.toDto(e);return this.isClockingEvent?this.createClockingEventLeaveHistoryObservable(t):this.createLeaveHistoryObservable(t)},o.prototype.createLeaveHistoryObservable=function(e){var t;if(this.isNew()||this.employeeData&&!e.id)t=this.leaveHistoryService.insert(e);else{var n=this.employeeData?e.id:this.routeParams.leaveHistory;t=this.leaveHistoryService.update(n,e)}return t},o.prototype.getDeleteObservable=function(){var e,t=this,n=(null===(e=this.routeParams)||void 0===e?void 0:e.scheduleHistoryId)?this.routeParams.scheduleHistoryId:this.routeParams.leaveHistory;return(this.isClockingEvent?this.deleteClockingEventLeaveHistory(n):this.leaveHistoryService.delete(n)).pipe(s.tap((function(){t.addMessage("success","hcm_contract.employment_additional_info.deleted_message_title","hcm_contract.employment_additional_info.deleted_message_content"),t.goBack()})))},o.prototype.validateVisualization=function(){var e=this;return!!["eSocialReason","employee","situationStructureCompanyHistory","situation"].every((function(t){return e.allPermissions[t]&&e.allPermissions[t].visualizar}))||(this.errorPageService.listEntities=[this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation"),this.translate.instant("hcm_contract.employment_additional_info.leave_history_employee"),this.translate.instant("hcm_contract.employment_additional_info.e_social_reason"),this.translate.instant("hcm_contract.employment_additional_info.situation_structure_company_history"),this.translate.instant("hcm_contract.employment_additional_info.leave_history")],this.router.navigate(["forbidden"]),!1)},o.prototype.validateAttachmentsVisualization=function(){var e,t;if((null===(e=this.allPermissions)||void 0===e?void 0:e.leaveHistoryAttachment)&&(!Object.values(null===(t=this.allPermissions)||void 0===t?void 0:t.leaveHistoryAttachment).every((function(e){return!0===e}))||this.isCollective||this.isReinstatement))return this.translate.instant("hcm_contract.employment_additional_info.leave_history_attachments"),!1;return!0},o.prototype.onChangeField=function(e){return this.formGroup.get(e).valueChanges.pipe(s.takeUntil(this.ngUnsubscribe),s.delay(0),s.distinctUntilChanged())},o.prototype.applyAllFieldBehaviour=function(){this.applyStartTimeFieldBehaviour(),this.applyAllFieldBehaviorExceptReinstatement(),this.applyEndTimeFieldBehaviour(),this.applyEstimatedJourneyCompletedBehavior(),this.applyDisableAllFieldsForEditWhenSituationTypeIsReinstatement()},o.prototype.applyDisableAllFieldsForEditWhenSituationTypeIsReinstatement=function(){var t=this,n=["employee","estimatedJourneyCompleted","startDate","endDate","startTime","endTime","situation","resultedSicknessAssistance","sourceReasonChange","processType","processNumber","birthDate","diseaseCid","subgroupCid","cnpjUnion","onusRemuneration","workAccidentType","justifiedDays","sameReasonEsocial","estimatedDayEnd","estimatedEndDate","observation"],o=this.formGroup.get("situation").value;o&&o.situationType===e.SituationType.REINSTATEMENT&&n.forEach((function(e){t.formGroup.get(e).disable(),t.formGroup.get(e).clearValidators()})),n.forEach((function(e){t.formGroup.get(e).updateValueAndValidity(),t.verifyPermissionEditOnEdit()}))},o.prototype.handleReinstatementInEditMode=function(e){if(this.isReinstatementInEditMode(!this.isNew()))return this.isReinstatement=!0,void this.applyDisableAllFieldsForEditWhenSituationTypeIsReinstatement();e()},o.prototype.applyAllFieldBehaviorExceptReinstatement=function(){this.applySituationFieldBehaviour(),this.applySourceReasonChangeFieldBehaviour(),this.applyProcessTypeFieldBehaviour(),this.applyProcessNumberFieldBehaviour(),this.applyBirthDateFieldBehaviour(),this.applyDiseaseCidFieldBehaviour(),this.applySubgroupCidFieldBehaviour(),this.applyCnpjUnionFieldBehaviour(),this.applyOnusRemunerationFieldBehaviour(),this.applyWorkAccidentTypeFieldBehaviour(),this.applyJustifiedDaysFieldBehaviour(),this.applySameReasonEsocialFieldBehaviour(),this.applyResultedSicknessAssistanceFieldBehaviour(),this.applyObservationFieldBehaviour(),this.applyEstimatedDayEndFieldBehaviour(),this.applyEstimatedEndDateFieldBehaviour(),this.applyEndDateFieldBehaviour()},o.prototype.applyEstimatedJourneyCompletedBehavior=function(){if(this.isNew()){var t=this.formGroup.get("estimatedJourneyCompleted"),n=this.formGroup.get("situation").value;n&&n.situationType===e.SituationType.PROFESSIONALQUALIFICATION?(t.setValue(!0),this.setEnabledStatus(t,!1),t.clearValidators()):this.setEnabledStatus(t,!0),t.updateValueAndValidity(),this.hasConfigDisablePermission(t)}},o.prototype.applyEndDateFieldBehaviour=function(){var e=this.formGroup.get("endDate");this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([this.getEndDateTimeIsBeforeOrEqualToStartDateTimeValidator()])),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyStartTimeFieldBehaviour=function(){var e=this.formGroup.get("startTime"),t=this.formGroup.get("estimatedJourneyCompleted").value;this.originalLeaveHistory?(this.setEnabledStatus(e,!1),e.clearValidators()):t?(this.setEnabledStatus(e,!1),e.reset(),e.clearValidators()):(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required,this.getTimeIsNotZeroValidator()]))),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applySituationFieldBehaviour=function(){var e=this.formGroup.get("situation"),t=!this.formGroup.get("employee").value&&!this.isCollective;this.formGroup.get("startDate").value&&!t?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required])),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)):this.setEnabledStatus(e,!1)},o.prototype.applySourceReasonChangeFieldBehaviour=function(){var e=this.formGroup.get("sourceReasonChange"),t=this.formGroup.get("situation").value,n=this.originalLeaveHistory&&this.originalLeaveHistory.situation,o=this.originalLeaveHistory&&this.originalLeaveHistory.sourceReasonChange;!this.isEditWhithValueInSourceReason()&&t&&n&&t.id===n.id?(this.setEnabledStatus(e,!1),e.setValue(o),e.clearValidators()):this.isSourceReasonChangeRequired()?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required]))):(this.setEnabledStatus(e,!1),e.setValue(o),e.clearValidators()),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyProcessTypeFieldBehaviour=function(){var e=this.formGroup.get("processType"),t=this.formGroup.get("situation").value,n=this.originalLeaveHistory&&this.originalLeaveHistory.situation,o=this.formGroup.get("sourceReasonChange").value,i=this.originalLeaveHistory&&this.originalLeaveHistory.sourceReasonChange,a=this.originalLeaveHistory&&this.originalLeaveHistory.processType;!this.isEditWhithValueInSourceReason()&&t&&n&&t.id===n.id?(this.setEnabledStatus(e,!1),e.setValue(a),e.clearValidators()):this.isProcessTypeRequired()?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required]))):i!==o?(this.setEnabledStatus(e,!1),e.reset(),e.clearValidators()):(this.setEnabledStatus(e,!1),e.setValue(a),e.clearValidators()),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyProcessNumberFieldBehaviour=function(){var e=this.formGroup.get("processNumber"),t=this.formGroup.get("situation").value,n=this.originalLeaveHistory&&this.originalLeaveHistory.situation,o=this.formGroup.get("sourceReasonChange").value,i=this.originalLeaveHistory&&this.originalLeaveHistory.sourceReasonChange,a=this.originalLeaveHistory&&this.originalLeaveHistory.processNumber;!this.isEditWhithValueInSourceReason()&&t&&n&&t.id===n.id?(this.setEnabledStatus(e,!1),e.setValue(a),e.clearValidators()):this.isProcessNumberRequired()?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required,this.getProcessNumberValidator()]))):i!==o?(this.setEnabledStatus(e,!1),e.reset(),e.clearValidators()):(this.setEnabledStatus(e,!1),e.setValue(a),e.clearValidators()),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyBirthDateFieldBehaviour=function(){var t=this.formGroup.get("birthDate"),n=this.formGroup.get("situation").value,o=new Set([e.SituationType.MATERNITYLEAVE,e.SituationType.INSSMATERNITYLEAVE]);n&&o.has(n.situationType)?this.setEnabledStatus(t,!0):(this.setEnabledStatus(t,!1),this.applyResetFieldWhenIsNew("birthDate")),t.updateValueAndValidity(),this.hasConfigDisablePermission(t)},o.prototype.applyDiseaseCidFieldBehaviour=function(){var e=this.formGroup.get("diseaseCid");e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applySubgroupCidFieldBehaviour=function(){var e=this.formGroup.get("subgroupCid");this.formGroup.get("diseaseCid").value?this.setEnabledStatus(e,!0):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("subgroupCid")),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyCnpjUnionFieldBehaviour=function(){var e=this.formGroup.get("cnpjUnion");this.isV24()?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required,oo.isValidCnpj()]))):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("cnpjUnion"),e.clearValidators()),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyOnusRemunerationFieldBehaviour=function(){var e=this.formGroup.get("onusRemuneration");this.isV24()?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required]))):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("onusRemuneration"),e.clearValidators()),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyWorkAccidentTypeFieldBehaviour=function(){var e=this.formGroup.get("workAccidentType");this.isV1OrV3()?this.setEnabledStatus(e,!0):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("workAccidentType")),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyJustifiedDaysFieldBehaviour=function(){var t=this.formGroup.get("justifiedDays"),n=new Set([e.SituationType.ILLNESSAID,e.SituationType.LABORACCIDENT]),o=this.formGroup.get("situation").value;o&&n.has(o.situationType)?(this.setEnabledStatus(t,!0),t.setValidators(p.Validators.compose([p.Validators.pattern(/^\-?\d*$/),this.getJustifiedDaysQuantityIsSuperiorToLeaveDaysValidator()]))):(this.setEnabledStatus(t,!1),t.reset(),t.clearValidators()),t.updateValueAndValidity(),this.hasConfigDisablePermission(t)},o.prototype.applySameReasonEsocialFieldBehaviour=function(){var e=this.formGroup.get("sameReasonEsocial");this.isSameReasonEsocialRequired()?this.setEnabledStatus(e,!0):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("sameReasonEsocial")),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyResultedSicknessAssistanceFieldBehaviour=function(){var e=this.formGroup.get("resultedSicknessAssistance");this.isResultedSicknessAssistanceRequired()?(this.setEnabledStatus(e,!0),!this.isNew()||null!==e.value&&void 0!==e.value||e.setValue(!1)):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("resultedSicknessAssistance")),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyObservationFieldBehaviour=function(){var e=this.formGroup.get("observation");this.isV21()?(this.setEnabledStatus(e,!0),e.clearValidators(),e.setValidators(p.Validators.compose([p.Validators.required,p.Validators.maxLength(255)]))):(e.clearValidators(),e.setValidators(p.Validators.compose([p.Validators.maxLength(255)]))),this.setEnabledStatus(e,!0),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyEstimatedDayEndFieldBehaviour=function(){var t=this.formGroup.get("estimatedDayEnd"),n=this.formGroup.get("situation").value;if(n&&n.situationType===e.SituationType.ABSENCES)this.setEnabledStatus(t,!1),t.reset();else{this.setEnabledStatus(t,!0);var o=this.formGroup.get("startDate").value,i=this.formGroup.get("estimatedEndDate").value;if(o&&i){var a=c(i).diff(c(o),"days")+1;t.setValue(a)}}t.updateValueAndValidity(),this.hasConfigDisablePermission(t)},o.prototype.applyEstimatedEndDateFieldBehaviour=function(){var t=this.formGroup.get("estimatedEndDate"),n=this.formGroup.get("situation").value;if(n&&n.situationType===e.SituationType.ABSENCES)this.setEnabledStatus(t,!1),t.reset(),t.clearValidators();else{this.setEnabledStatus(t,!0),t.setValidators(p.Validators.compose([this.getEstimatedEndDateIsBeforeOrEqualToStartDateValidator()]));var o=this.formGroup.get("startDate").value,i=this.formGroup.get("estimatedDayEnd").value;if(o&&i){var a=c(o).add(i,"days").add(-1,"day").toDate();t.setValue(a)}}t.updateValueAndValidity(),this.hasConfigDisablePermission(t)},o.prototype.applyEndTimeFieldBehaviour=function(){var e=this.formGroup.get("endTime"),t=this.formGroup.get("estimatedJourneyCompleted").value,n=this.formGroup.get("endDate").value;!t&&n?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required,this.getTimeIsNotZeroValidator(),this.getEndDateTimeIsBeforeOrEqualToStartDateTimeValidator()]))):(this.setEnabledStatus(e,!1),e.reset(),e.clearValidators()),e.updateValueAndValidity(),this.formGroup.get("endDate").updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.getEstimatedEndDateIsBeforeOrEqualToStartDateValidator=function(){var e=this;return this.formGroupDependent((function(){var t=e.formGroup.get("startDate").value,n=e.formGroup.get("estimatedEndDate").value;return t&&n&&c(t).isAfter(c(n))?{estimatedEndDateMustBeGreaterThanOrEqualToStartDate:!0}:null}))},o.prototype.hasConfigDisablePermission=function(e){this.verifyPermissionEditOnEdit()&&this.setEnabledStatus(e,!1)},o.prototype.verifyPermissionEditOnEdit=function(){return!this.permissions.editar&&!this.isNew()&&!this.isClockingEvent},o.prototype.getEndDateTimeIsBeforeOrEqualToStartDateTimeValidator=function(){var e=this;return this.formGroupDependent((function(){var t=e.formGroup.get("startDate").value,n=e.formGroup.get("endDate").value,o=e.formGroup.get("estimatedJourneyCompleted").value,i=o?c().hours(0).minutes(0):e.formGroup.get("startTime").value,a=o?c().hours(23).minutes(59):e.formGroup.get("endTime").value,r=e.getFullDateTime(t,i),s=e.getFullDateTime(n,a);return t&&i&&n&&a&&r.isAfter(s)?{endDateMustBeGreaterThanOrEqualToStartDate:!0}:null}))},o.prototype.getProcessNumberValidator=function(){var t=this;return this.formGroupDependent((function(n){var o=n.value,i=t.formGroup.get("processType").value;return i===e.ProcessType.V1&&o&&17!==o.length&&21!==o.length?{messageProcessNumberRequires17Or21Figures:!0}:i===e.ProcessType.V2&&o&&20!==o.length?{messageProcessNumberRequires20Figures:!0}:i===e.ProcessType.V3&&o&&10!==o.length?{messageProcessNumberRequires10Figures:!0}:null}))},o.prototype.getJustifiedDaysQuantityIsSuperiorToLeaveDaysValidator=function(){var e=this;return function(t){var n=t.value,o=e.formGroup.get("startDate").value,i=e.formGroup.get("endDate").value,a=o&&n&&c(o).add(n,"days").subtract(1,"days");return i&&a&&c(a).isAfter(i)?{justifiedDaysQuantityMustBeLowerThanEndDate:!0}:null}},o.prototype.getTimeIsNotZeroValidator=function(){return this.formGroupDependent((function(e){var t=e.value;return"00:00"===(t&&c(t).isValid()&&c(t).format("HH:mm"))?{timeMustNotBeZero:!0}:null}))},o.prototype.formGroupDependent=function(e){var t=this;return function(n){return t.formGroup?e(n):null}},o.prototype.getFullDateTime=function(e,t){return e?t?Me(e,t):c(e):null},o.prototype.handleDateTimeFieldsOnEdit=function(){var e=this.formGroup.get("startDate"),t=this.formGroup.get("startTime"),n=this.formGroup.get("endDate"),o=this.formGroup.get("endTime"),i=this.formGroup.get("estimatedJourneyCompleted");this.isHourAndMinuteZero(t.value)?(i.setValue(!0),e.setValue(c(e.value).toDate()),t.setValue(null),n.value&&n.setValue(c(n.value).set({hour:0,minute:0,second:0,millisecond:0}).toDate()),o.setValue(null),this.setEnabledStatus(o,!1)):i.setValue(!1),this.setEnabledStatus(e,!1),this.setEnabledStatus(t,!1),this.setEnabledStatus(i,!1)},o.prototype.isHourAndMinuteZero=function(e){return 0===c(e).hours()&&0===c(e).minutes()},o.prototype.loadLabelFromEnumOptions=function(e,t){var n=t.filter((function(t){return t.value===e}))||this.situationTypeOptions.filter((function(t){return t.value===e}));return n&&n.length&&n[0].label||this.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")},o.prototype.getFilterByNotAllowedSituationTypes=function(){var t=this,n=new Set([e.SituationType.WORKING.toString(),e.SituationType.OVERTIME.toString(),e.SituationType.PRECAUTIONREADINESS.toString(),e.SituationType.REINSTATEMENT.toString()]);return Object.keys(e.SituationType).filter((function(e){return!n.has(e)})).map((function(e){return t.entity+"Type eq '"+e+"'"})).join(" or ")},o.prototype.createHistoryDTO=function(e,t){if((null==t?void 0:t._discriminator)==m.HISTORY_NAME){var n=sn.fromDto(t);return this.startFuncionsByBaseHistory(),this.applyAllFieldBehaviour(),n}return(n=new sn).startDate=e?c(e).toDate():n.startDate,n.employee=Vt.fromDto(t),this.startFuncionsByBaseHistory(),this.applyAllFieldBehaviour(),n},o.prototype.getSaveButtonPermissions=function(){if(this.isReinstatement&&!this.isNew())return!1;var t=this.isNew()||this.permissions.editar,n=this.permissions.incluir&&this.collectiveProcessType==e.CollectiveProcessType.INCLUDE;return this.isCollective?n:t},o.prototype.getDeleteButtonPermissions=function(){if(this.isReinstatement&&!this.isNew())return!1;var t=!this.isNew()&&this.permissions.excluir,n=this.permissions.excluir&&this.collectiveProcessType==e.CollectiveProcessType.EXCLUDE;return this.isCollective?n:t},o.prototype.getFormGeneralTitle=function(){return this.collectiveProcessType?this.getCollectiveFormTitle():"hcm_contract.employment_additional_info.leave_history_form_general_title"},o.prototype.getCollectiveFormTitle=function(){return this.collectiveProcessType==e.CollectiveProcessType.INCLUDE?"hcm_contract.employment_additional_info.leave_history_collective_form_general_title":"hcm_contract.employment_additional_info.leave_history_collective_delete_form_general_title"},o.prototype.isUsingTableChange=function(){return this.collectiveService.getIsUsingTable()},o.prototype.onUpload=function(e){var t=this,n=e.files;this.countBeforeUploadFile=this.countBeforeUploadFile+(null==n?void 0:n.length),n.forEach((function(e){e.savedFile||e.progress||(t.listFiles.push(e),e.isUploading=!0,t.saveFile(e).pipe(s.takeUntil(t.ngUnsubscribe),s.finalize((function(){e.isUploading=!1,t.countAfterUploadFile++}))).subscribe((function(){e.objectURL=t.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(e))})))}))},Object.defineProperty(o.prototype,"saveDisable",{get:function(){return this.countBeforeUploadFile&&this.countBeforeUploadFile!=this.countAfterUploadFile},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"configurationModeAlert",{get:function(){var e=this;return this.isReinstatement||this.isNew()?this._warn||(e._warn=[{detail:e.translate.instant("hcm_contract.employment_additional_info.cannot_delete_reinstatement"),severity:"warn"}],e._warn):[]},enumerable:!0,configurable:!0}),o.prototype.doUpload=function(e,t,n){var o=new XMLHttpRequest;return t.locationURI=e.fileUrl,t.objectURL=e.uploadUrl,t.progress=100,o.onreadystatechange=function(){4===o.readyState&&(t.complete=!0,o.status<200||o.status>=300?(t.objectURL=void 0,t.error=o.statusText||"Erro ao anexar arquivo"):t.error=!1,n.next(t),n.complete())},o.open("PUT",t.objectURL,!0),o.setRequestHeader("Translate","f"),o.send(t)},o.prototype.saveFile=function(e){var t=this;return new r.Observable((function(n){return t.leaveHistoryAttachmentService.requestUpload(e).pipe(s.takeUntil(t.ngUnsubscribe)).subscribe((function(o){return t.doUpload(o,e,n)}))}))},o.prototype.onRemoveFile=function(e){var t=e.file;this.listFiles.splice(this.listFiles.indexOf(t),1),this.countAfterUploadFile--,this.countBeforeUploadFile--},o.prototype.onCancelUpload=function(e){this.files.splice(e,1)},o.prototype.fieldIsNotNull=function(e){return!!this.formGroup.get(e).value},o.prototype.fileValidationErrors=function(t){switch(t){case e.FileValidation.MAX_FILE_LIMIT:this.messageService.add({severity:"error",detail:this.translate.instant("hcm_contract.employment_additional_info.leave_history_max_length")});break;case e.FileValidation.MAX_FILE_SIZE:this.messageService.add({severity:"error",detail:this.translate.instant("hcm_contract.employment_additional_info.leave_history_max_mb")})}},o.prototype.onDownloadFile=function(e){var t=this;this.loading=!0;var n=e.index,o=e.anchor,i=this.listFiles[n];i.documentId&&this.leaveHistoryAttachmentService.downloadForDocument(i).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return t.loading=!1}))).subscribe((function(e){i.objectURL=e.downloadUrl,o.nativeElement.setAttribute("href",e.downloadUrl),o.nativeElement.click()})),i.objectURL&&(o.nativeElement.setAttribute("href",URL.createObjectURL(i)),o.nativeElement.click()),this.loading=!1},o.prototype.clockingEventOnSave=function(){this.onSave()},o.prototype.setEnabledStatus=function(e,t){t&&!this.isReadOnly?e.enable():e.disable()},o.prototype.setEnabledStatusOnCustomFields=function(e){var t=!!this.isClockingEvent||e,n=this.formGroup.get("custom");this.setEnabledStatus(n,t)},o.HISTORY_NAME="leaveHistory",o.SITUATION="situation",o.DOMAIN="hcm_foundation",o.SERVICE="general",o.ctorParameters=function(){return[{type:tn},{type:a.TranslateService},{type:pt},{type:t.ChangeDetectorRef},{type:Dn},{type:ot},{type:ht},{type:d.Router},{type:d.ActivatedRoute},{type:i.MessageService},{type:i.ConfirmationService},{type:p.FormBuilder},{type:y.HotkeysService},{type:Sn},{type:_n},{type:lt},{type:rt},{type:qe},{type:mt},{type:bn},{type:pn},{type:nn},{type:x.DomSanitizer},{type:G.StructureFilterService},{type:G.EmployeeLookupService},{type:it}]},W([t.ViewChild("customTemplate",{static:!1})],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFormFields",{static:!1})],o.prototype,"customFormFields",void 0),o=m=W([t.Component({template:'<div *ngFor="let process of processed">\n <p-messages [value]="process" key="info" [escape]="false"></p-messages>\n</div><div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog acceptLabel="{{\'hcm_contract.employment_additional_info.yes\' | translate}}" acceptIcon="" appendTo="body"\n rejectLabel="{{\'hcm_contract.employment_additional_info.no\' | translate}}" rejectIcon="">\n </p-confirmDialog>\n <form [formGroup]="formGroup" novalidate>\n <lib-collective-history-filters *ngIf="isCollective"\n [parentFormGroup]="collectiveFormGroup" (onEmployeeSelected)="onSelectBasicFilterByEmployee($event)" (onCompanySelected)="onSelectBasicFilterByCompany($event)" ></lib-collective-history-filters>\n <p-panel *sLoadingState="loading" [styleClass]="employeeData ? \'form-group sidebar-panel\' : \'form-group\'" [toggleable]="false" [collapsed]="mainPanelCollapsed"\n [showHeader]="!employeeData" [hidden]="!isUsingTableChange() && isCollective">\n <div class="ui-sm-12 ui-md-12 ui-lg-12 ui-xl-12" *ngIf="isReinstatement && !isNew()">\n <p-messages [enableService]="false" [value]="configurationModeAlert" [closable]="false"></p-messages>\n </div>\n <p-header>\n {{getFormGeneralTitle() | translate}}\n </p-header>\n <form [formGroup]="formGroup">\n <s-dynamic-form [configs]="configs" [id]="\'dynamic\'" [form]="formGroup" [errorMessages]="errorMessages">\n </s-dynamic-form>\n </form>\n\n <p-tabView styleClass="form-group">\n <p-tabPanel\n [header]="\'hcm_contract.employment_additional_info.leave_history_basic_data_tab_name\' | translate">\n <div class="basic-data-container">\n <s-dynamic-form [configs]="configSituation" [id]="\'dynamic\'"\n [form]="formGroup" [errorMessages]="errorMessages">\n </s-dynamic-form>\n <s-dynamic-form *ngIf="hasAdditionalInformation" [configs]="configsFieldSet" [id]="\'dynamic\'"\n [form]="formGroup" [errorMessages]="errorMessages">\n </s-dynamic-form>\n <s-dynamic-form [configs]="configObservation" [id]="\'dynamic\'"\n [form]="formGroup" [errorMessages]="errorMessages">\n </s-dynamic-form>\n </div>\n </p-tabPanel>\n\n <p-tabPanel [header]="\'hcm_contract.employment_additional_info.leave_history_document_tab_name\' | translate" *ngIf="validateAttachmentsVisualization()">\n <s-file-upload [formGroup]="formGroup.get(\'leaveHistoryAttachments\')"\n accept="*/*"\n [files]="listFiles"\n [multiple]="true"\n [fileLimit]="10"\n [chooseLabel]="\'hcm_contract.employment_additional_info.file_upload_choose_label\' | translate"\n [removeLabel]="\'hcm_contract.employment_additional_info.file_upload_remove_label\' | translate"\n [cancelLabel]="\'hcm_contract.employment_additional_info.cancel\' | translate"\n [maxFileSize]="10000000"\n (validateErrors)="fileValidationErrors($event?.validation)"\n (uploadHandler)="onUpload($event)"\n (removeFile)="onRemoveFile($event)"\n (cancelUpload)="onCancelUpload($event)"\n (downloadFile)="onDownloadFile($event)">\n </s-file-upload>\n </p-tabPanel>\n </p-tabView>\n\n <s-custom-fields *ngIf="customizationPermission.visualizar && !isCollective" domain="hcm_contract" service="employment_additional_info" entity="leaveHistory"\n formControlName="custom"\n [invalidErrorLabel]="\'hcm_contract.employment_additional_info.error_invalid\' | translate">\n </s-custom-fields>\n\n <div class="ui-g" *ngIf="!isNew() && !isCollective">\n <div class="ui-g-12 ui-inputgroup">\n <span *ngIf="fieldIsNotNull(\'createdBy\')" class="label-style">\n {{\'hcm_contract.employment_additional_info.created_by\' | translate}}\n {{formGroup.get(\'createdBy\').value}}\n {{\'hcm_contract.employment_additional_info.at_date\' | translate}}\n {{formGroup.get(\'createdDate\').value | date: \'dd/MM/yyyy\'}}\n {{\'hcm_contract.employment_additional_info.at_time\' | translate}}\n {{formGroup.get(\'createdDate\').value | date: \'HH:mm\'}}.\n </span>\n <span *ngIf="fieldIsNotNull(\'lastModifiedBy\')" class="label-style-updated">\n {{\'hcm_contract.employment_additional_info.updated_by\' | translate}}\n {{formGroup.get(\'lastModifiedBy\').value}}\n {{\'hcm_contract.employment_additional_info.at_date\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | date: \'dd/MM/yyyy\'}}\n {{\'hcm_contract.employment_additional_info.at_time\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | date: \'HH:mm\'}}.\n </span>\n </div>\n </div>\n <p-footer *ngIf="!employeeData">\n <button id="save-button"\n title="{{\'hcm_contract.employment_additional_info.save\' | translate}} (Alt + Shift + S)"\n type="submit" pButton label="{{\'hcm_contract.employment_additional_info.save\' | translate}}"\n [disabled]="saveDisable"\n (click)="onSave()" *ngIf="getSaveButtonPermissions()"></button>\n <button id="delete-button"\n title="{{\'hcm_contract.employment_additional_info.delete\' | translate}} (Alt + Shift + X)"\n type="button" class="ui-button-secondary" pButton\n label="{{\'hcm_contract.employment_additional_info.delete\' | translate}}" (click)="onDelete()"\n *ngIf="getDeleteButtonPermissions()" [disabled]="loading"></button>\n <button id="cancel-button"\n title="{{\'hcm_contract.employment_additional_info.cancel\' | translate}} (Alt + Shift + C)"\n type="button" class="ui-button-link" pButton\n label="{{\'hcm_contract.employment_additional_info.cancel\' | translate}}"\n (click)="onCancel()"></button>\n </p-footer>\n </p-panel>\n </form>\n</div>\n<p-confirmDialog key="customized" #customized\n header="{{ \'hcm_contract.employment_contract.generic_confirm\' | translate }}">\n <p-footer>\n <s-button label="{{ \'hcm_contract.employment_contract.yes\' | translate }}"\n (onClick)="customized.accept()" priority="primary" [disabled]="false" [auxiliary]="false">\n </s-button>\n <s-button label="{{ \'hcm_contract.employment_contract.no\' | translate }}"\n (onClick)="customized.reject()" priority="secondary" [disabled]="false" [auxiliary]="false">\n </s-button>\n </p-footer>\n</p-confirmDialog>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',providers:[i.ConfirmationService],selector:"fnd-leave-history-form",styles:[":host ::ng-deep .sidebar-panel{border:none!important;padding-left:0!important}.label-style{color:#a3a3a3;margin-right:2px}.basic-data-container{display:flex;flex-direction:column;gap:10px}.label-style-updated{color:#a3a3a3}"]})],o)}(Pn),ao=c,ro=function(n){function o(t,o,i,a,s,l,c,p,d,m,u,h,y,f,_,v,g){var b=n.call(this,l,c,v,p)||this;return b.router=t,b.route=o,b.leaveHistoryService=i,b.confirmationService=a,b.situationService=s,b.translate=l,b.baseService=c,b.messageService=p,b.hotkeysService=d,b.formBuilder=m,b.filtersStorageService=u,b.paginatorStorageService=h,b.companyService=y,b.companyBranchService=f,b.employeeLookupService=_,b.platformService=v,b.configService=g,b.allPermissions={},b.permissions={},b.localeConfig={},b.currentListParams={page:0,size:10,sort:[],filterData:{}},b.filtersPanelCollapsed=!0,b.searchTokens=[],b.serverError=!1,b.filtersLoaded=!1,b.subgroupCidLookupDisplayFields=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"],b.subgroupCidAdvancedDisplayFields=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"],b.diseaseCidLookupDisplayFields=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"],b.diseaseCidAdvancedDisplayFields=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"],b.situationLookupDisplayFields=["code","name"],b.situationAdvancedDisplayFields=["code","name"],b.companyLookupDisplayFields=["codEmp","nomEmp"],b.companyAdvancedDisplayFields=["codEmp","nomEmp"],b.companyBranchLookupDisplayFields=["codFil","nomFil"],b.companyBranchAdvancedDisplayFields=["codFil","nomFil"],b.contractTypeOptions=[{label:b.translate.instant("hcm_contract.employment_additional_info.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:b.translate.instant("hcm_contract.employment_additional_info.contract_type_director"),value:e.ContractType.DIRECTOR},{label:b.translate.instant("hcm_contract.employment_additional_info.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:b.translate.instant("hcm_contract.employment_additional_info.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:b.translate.instant("hcm_contract.employment_additional_info.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}],b.situationLookupSuggestionsObservable=new r.Subject,b.situationLookupSearchObservable=new r.Subject,b.companyLookupSuggestionsObservable=new r.Subject,b.companyLookupSearchObservable=new r.Subject,b.companyBranchLookupSuggestionsObservable=new r.Subject,b.companyBranchLookupSearchObservable=new r.Subject,b.standardListSize=10,b.collectiveActions=[],b}return Y(o,n),o.prototype.ngOnInit=function(){var e=this;this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.filterFormGroup=this.formBuilder.group({employer:[void 0,p.Validators.compose([])],companyBranch:[void 0,p.Validators.compose([])],contractType:[void 0,p.Validators.compose([])],employee:[void 0,p.Validators.compose([])],situation:[void 0,p.Validators.compose([])],employeeSituation:[void 0,p.Validators.compose([])]}),this.setStoragePaginator(),this.setStorageFiltersIntoForm(this.filterFormGroup),this.gridColumns=this.getGridColumns(),this.filterFields=this.getFilterFields(),this.filterFormGroup.get("employer").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(){e.filterFormGroup.get("companyBranch").setValue(null)})),this.setHotkeys(),this.permissions.incluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.add_collective"),command:function(){return e.onAddCollective()}}),this.permissions.excluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.remove_collective"),command:function(){return e.onRemoveCollective()}})},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+e",(function(){return e.selection&&1===e.selection.length&&e.onEdit(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.selection&&e.selection.length&&e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+n",(function(){return e.permissions.incluir&&e.onAdd(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+f",(function(){return e.onSearch(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+l",(function(){return e.onClear(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.onRouteDataChange=function(e){this.allPermissions=e.allPermissions,this.permissions=e.allPermissions.leaveHistory,this.localeConfig=e.localeConfig},o.prototype.hasEmpty=function(e){if(Object.keys(e).filter((function(t){return""===e[t]})).length>0)return!0},o.prototype.onSearch=function(){var e=this.filterFormGroup.getRawValue();if(this.hasEmpty(e))return this.filtersPanelCollapsed=!0,this.validateAllFormFields(this.filterFormGroup);this.currentListParams.page=0,this.filtersPanelCollapsed=!0,this.resetGrid({filterData:e}),this.filtersStorageService.storeFilters("LeaveHistoryListComponent",e)},o.prototype.onClear=function(){this.filterFormGroup.reset();var e=this.filterFormGroup.getRawValue();this.resetGrid({filterData:e}),this.filtersStorageService.removeFilter("LeaveHistoryListComponent")},o.prototype.onRemoveToken=function(e){this.filterFormGroup.get(e.id).setValue(void 0);var t=this.filterFormGroup.getRawValue();this.resetGrid({filterData:t}),this.filtersStorageService.clearFilterValue("LeaveHistoryListComponent",t)},o.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,o=e.multiSortMeta;return(t!==this.standardListSize||0!==n||o&&o.length>0)&&this.paginatorStorageService.storePaginator("LeaveHistoryListComponentPaginator",{page:n,size:t,sort:o}),this.updateGrid({page:n,size:t,sort:o})},o.prototype.onAdd=function(){this.router.navigate(["new"],{relativeTo:this.route})},o.prototype.onEdit=function(){this.router.navigate([this.selection[0].id],{relativeTo:this.route})},o.prototype.onDelete=function(){var e=this;this.hasReinstatementInSelection()?this.showReinstatementWarning():this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_additional_info.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_additional_info.delete_confirmation_title"),accept:function(){e.showLoader=!0,r.forkJoin(e.selection.map((function(t){return e.leaveHistoryService.delete(t.id)}))).pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.showLoader=!1,e.resetGrid()}))).subscribe((function(){e.messageService.add({severity:"success",summary:e.translate.instant("hcm_contract.employment_additional_info.deleted_message_title"),detail:e.translate.instant("hcm_contract.employment_additional_info.deleted_message_content")})}),(function(e){}))}})},o.prototype.focusInput=function(e){var t=document.getElementById(""+e);t&&t.focus()},o.prototype.getLabelValue=function(e,t){var n=this;return e.map((function(e){return z(z({},e),{label:t.map((function(t){return t.indexOf(".")>0&&(e[t]=n.getProp(e,t)),"employmentRelationship.contractType"===t&&(e[t]=n.loadLabelFromEnum(e[t])),e[t]})).join(" - ")})}))},o.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},o.prototype.getGridColumns=function(){var e=[{field:"startDate",header:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_date")},{field:"situation.code",header:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation_code")},{field:"situation.name",header:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation_name")},{field:"endDate",header:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_date")}];return xe(this.translate,this.configService).concat(e)},o.prototype.getFilterFields=function(){var e=this;return[new l.FormField({name:"employer",label:this.translate.instant("hcm_contract.employment_additional_info.employer"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.employer_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),dataKey:"id",suggestionsObservable:this.companyLookupSuggestionsObservable,searchObservable:this.companyLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyLookupRequest(t)},onSearchRequest:function(t){return e.onCompanySearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanySearchFields(),searchGridFields:this.getCompanySearchGridFields()}),this.employeeLookupService.getFormField(),new l.FormField({name:"companyBranch",label:this.translate.instant("hcm_contract.employment_additional_info.employee_company_branch"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.employee_company_branch_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),dataKey:"id",recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),suggestionsObservable:this.companyBranchLookupSuggestionsObservable,searchObservable:this.companyBranchLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyBranchLookupRequest(t)},onSearchRequest:function(t){return e.onCompanyBranchSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanyBranchSearchFields(),searchGridFields:this.getCompanyBranchSearchGridFields()}),new l.FormField({name:"contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type_placeholder"),options:this.contractTypeOptions,showClear:function(){return!1},multiple:!1}),new l.FormField({name:"situation",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation"),type:l.FieldType.Lookup,recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),dataKey:"id",suggestionsObservable:this.situationLookupSuggestionsObservable,searchObservable:this.situationLookupSearchObservable,onLookupRequest:function(t){return e.onSituationLookupRequest(t)},onSearchRequest:function(t){return e.onSituationSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getSituationSearchFields(),searchGridFields:this.getSituationSearchGridFields()}),new l.FormField({name:"employeeSituation",label:this.translate.instant("hcm_contract.employment_additional_info.employee_situation"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_additional_info.employee_situation"),default:Z.EVERYONE,options:Ve(this.translate,this.configService),multiple:!1})]},o.prototype.setStorageFiltersIntoForm=function(e){return Q(this,void 0,void 0,(function(){var t,n;return X(this,(function(o){switch(o.label){case 0:return this.showLoader=!0,[4,this.filtersStorageService.getFilters("LeaveHistoryListComponent")];case 1:return t=o.sent(),Object.keys(e.controls).forEach((function(n){var o=ao(t[n],ao.HTML5_FMT.DATETIME_LOCAL_MS+"Z",!0).isValid();e.get(n).setValue(o?new Date(t[n]):t[n])})),this.filtersLoaded=!0,n=this.filterFormGroup.getRawValue(),this.resetGrid({filterData:n}),[2]}}))}))},o.prototype.setStoragePaginator=function(){return Q(this,void 0,void 0,(function(){var e;return X(this,(function(t){switch(t.label){case 0:return[4,this.paginatorStorageService.getPaginator("LeaveHistoryListComponentPaginator")];case 1:return e=t.sent(),"{}"!=JSON.stringify(e)&&(this.currentListParams=z(z({},this.currentListParams),e)),[2]}}))}))},o.prototype.onCompanyLookupRequest=function(e){var t=this,n=this.companyLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanySearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+ao(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+ao(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+ao(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({filterQuery:o,displayFields:i,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyLookupDisplayFields)}))).subscribe((function(e){return t.companyLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanySearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanySearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+ao(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+ao(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+ao(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyLookupSearchObservable.next(e)}))},o.prototype.onCompanyBranchLookupRequest=function(e){var t=this,n=this.companyBranchLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanyBranchSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+ao(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+ao(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+ao(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=this.filterFormGroup.get("employer").value;if(i){var a="e070emp.codEmp eq "+i.codEmp;o=o?o+" and "+a:a}var r=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({filterQuery:o,displayFields:r,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields)}))).subscribe((function(e){return t.companyBranchLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanyBranchSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanyBranchSearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+ao(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+ao(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+ao(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=this.filterFormGroup.get("employer").value;if(d){var m="e070emp.codEmp eq "+d.codEmp;p=p?p+" and "+m:m}var u=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({page:r,sort:c,filterQuery:p,displayFields:u}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyBranchLookupSearchObservable.next(e)}))},o.prototype.getEmployeeSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getEmployeeSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,showClear:function(){return!1},options:this.contractTypeOptions})]},o.prototype.onSituationLookupRequest=function(e){var t=this,n=Pe(e,this.getSituationSearchFields()),o=Ee(this.situationLookupDisplayFields,this.situationAdvancedDisplayFields);this.situationService.list({filterQuery:n,displayFields:o}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.situationLookupDisplayFields)}))).subscribe((function(e){return t.situationLookupSuggestionsObservable.next(e)}))},o.prototype.onSituationSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getSituationSearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+ao(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+ao(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+ao(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=Ee(this.situationLookupDisplayFields,this.situationAdvancedDisplayFields);this.situationService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.situationLookupDisplayFields),searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements}),totalRecords:e.totalElements}}))).subscribe((function(e){return t.situationLookupSearchObservable.next(e)}))},o.prototype.getSituationSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.situation_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.situation_name"),type:l.FieldType.String})]},o.prototype.getSituationSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.situation_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.situation_name"),type:l.FieldType.String})]},o.prototype.getCompanySearchFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_nom_emp"),type:l.FieldType.String})]},o.prototype.getCompanySearchGridFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_code"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_name"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_code"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_name"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchGridFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_code"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_name"),type:l.FieldType.String})]},o.prototype.updateGrid=function(e){var t=this;if(void 0===e&&(e={}),this.filtersLoaded){this.showLoader=!0,this.currentListParams=z(z({},this.currentListParams),e);var n=this.currentListParams,o=n.page,i=n.size,a=n.filterData,r=this.currentListParams.sort;this.searchTokens=this.filterFields.filter((function(e){var t=e.name;return null!=a[t]&&""!==a[t]})).map((function(e){var n=e.name,o=e.label,i=e.type,r=e.searchFields,s=e.options,c=a[n],p=c;if(i==l.FieldType.Date)p=ao(c).format("L");else if(i==l.FieldType.Time)p=ao(c).format("LTS");else if(i==l.FieldType.DateTime)p=ao(c).format("L LTS");else if(i==l.FieldType.Lookup){var d="employee"===n?t.getEmployeeSearchFields():r;p=d.map((function(e){return e.name.indexOf(".")>0&&(c[e.name]=t.getProp(c,e.name)),"employmentRelationship.contractType"===e.name&&(c[e.name]=t.loadLabelFromEnum(c[e.name])),c[e.name]})).join(" - ")}else i==l.FieldType.Enum?p=s.filter((function(e){return e.value===p}))[0].label:i==l.FieldType.Boolean&&(p=c?t.translate.instant("hcm_contract.employment_additional_info.list_grid_boolean_true"):t.translate.instant("hcm_contract.employment_additional_info.list_grid_boolean_false"));return{id:n,label:o+": "+p}}));var c=this.filterFields.filter((function(e){var t=e.name;return null!=a[t]})).map((function(e){return ce(e,a[e.name])})).join(" and ");c=c.replace("employer eq","employee.employer eq").replace("companyBranch eq","employee.employeeSnapshot.companyBranch eq").replace("contractType eq","employee.employmentRelationship.contractType eq");var p=$(this.gridColumns.map((function(e){return e.field})),["employee.person.nomPes","situation.name","situation.situationType"]);r||(r=[{field:"lastModifiedDate",order:-1}]),this.leaveHistoryService.list({page:o,size:i,sort:r,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(e){throw e.status>=500&&e.status<600&&(t.serverError=!0),e})),s.finalize((function(){t.showLoader=!1}))).subscribe((function(e){t.selection=[],t.gridData=e.contents,t.totalRecords=e.totalElements,t.serverError=!1}))}},o.prototype.resetGrid=function(e){e&&(this.currentListParams=z(z({},this.currentListParams),e)),this.currentListParams=z(z({},this.currentListParams),{page:0,sort:[]}),this.table&&this.table.reset&&this.table.reset()},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)}))},o.prototype.getPageSize=function(){return this.currentListParams.size},o.prototype.getRowIndex=function(){return this.currentListParams.page*this.currentListParams.size},o.prototype.getSortField=function(){return this.currentListParams.sort&&this.currentListParams.sort.length?this.currentListParams.sort[0].field:this.gridColumns[0].field},o.prototype.getSortOrder=function(){return this.currentListParams.sort&&this.currentListParams.sort.length?this.currentListParams.sort[0].order:1},o.prototype.getTitleButton=function(){return this.permissions.editar?this.translate.instant("hcm_contract.employment_additional_info.edit"):this.translate.instant("hcm_contract.employment_additional_info.visualize")},o.prototype.loadLabelFromEnum=function(e){var t=this.contractTypeOptions.filter((function(t){return t.value===e}));return t&&t.length&&t[0].label||this.translate.instant("hcm_contract.employment_additional_info.list_grid_empty_field")},o.prototype.hasReinstatementInSelection=function(){return this.selection.some((function(t){var n;return(null===(n=t.situation)||void 0===n?void 0:n.situationType)===e.SituationType.REINSTATEMENT}))},o.prototype.showReinstatementWarning=function(){this.messageService.add({severity:"warn",summary:this.translate.instant("hcm_contract.employment_additional_info.warning"),detail:this.translate.instant("hcm_contract.employment_additional_info.cannot_delete_reinstatement")})},o.prototype.onAddCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.INCLUDE})},o.prototype.onRemoveCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.EXCLUDE})},o.ctorParameters=function(){return[{type:d.Router},{type:d.ActivatedRoute},{type:ot},{type:i.ConfirmationService},{type:mt},{type:a.TranslateService},{type:tn},{type:i.MessageService},{type:y.HotkeysService},{type:p.FormBuilder},{type:En},{type:Cn},{type:Vn},{type:Nn},{type:G.EmployeeLookupService},{type:pn},{type:G.EntityLookupConfigService}]},W([t.ViewChild("leaveHistoryTable",{static:!1})],o.prototype,"table",void 0),W([t.ViewChild("customTemplate",{static:!1})],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFilterFields",{static:!1})],o.prototype,"customFilterFields",void 0),W([t.ViewChild("customGridColgroup",{static:!1})],o.prototype,"customGridColgroup",void 0),W([t.ViewChild("customGridHeader",{static:!1})],o.prototype,"customGridHeader",void 0),W([t.ViewChild("customGridBody",{static:!1})],o.prototype,"customGridBody",void 0),o=W([t.Component({selector:"fnd-leave-history",template:'<div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog [acceptLabel]="\'hcm_contract.employment_additional_info.yes\' | translate" acceptIcon=""\n [rejectLabel]="\'hcm_contract.employment_additional_info.no\' | translate" rejectIcon=""></p-confirmDialog>\n <form [formGroup]="filterFormGroup" autocomplete="off">\n <p-panel styleClass="form-group" [toggleable]="true" [(collapsed)]="filtersPanelCollapsed" (onAfterToggle)="focusInput(\'employee\')">\n <p-header>\n {{"hcm_contract.employment_additional_info.filters" | translate}}\n <s-token-list [tokens]="searchTokens" (tokenRemoved)="onRemoveToken($event)" [removableTokens]="true"></s-token-list>\n </p-header>\n <div *ngIf="!customFilterFields else customFilterFields">\n <s-dynamic-form [fields]="filterFields" [form]="filterFormGroup" [errorMessages]="{pattern: \'hcm_contract.employment_additional_info.error_invalid\' | translate}"></s-dynamic-form>\n </div>\n <p-footer>\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="filter-button" class="ui-button" type="submit" pButton [label]="\'hcm_contract.employment_additional_info.filter\' | translate"\n title="{{\'hcm_contract.employment_additional_info.filter\' | translate}} (Alt + Shift + F)"\n (click)="onSearch()"></button>\n <button id="clear-button" class="ui-button ui-button-link" type="button" pButton [label]="\'hcm_contract.employment_additional_info.clear\' | translate"\n title="{{\'hcm_contract.employment_additional_info.clear\' | translate}} (Alt + Shift + L)"\n (click)="onClear()"></button>\n </div>\n </div>\n </p-footer>\n </p-panel>\n </form>\n <p-panel *sLoadingState="showLoader">\n <p-header>\n {{"hcm_contract.employment_additional_info.leave_history_list_grid_title" | translate}}\n </p-header>\n <s-empty-state *ngIf="serverError" iconClass="fa fa-exclamation-triangle" title="{{\'hcm_contract.employment_additional_info.error_server_title\' | translate}}"\n primaryActionLabel="{{\'hcm_contract.employment_additional_info.error_server_try_again\' | translate}}"\n (primaryAction)="resetGrid()" description="{{\'hcm_contract.employment_additional_info.error_server_description\' | translate}}"></s-empty-state>\n <s-empty-state *ngIf="gridData && !gridData.length" [title]="\'hcm_contract.employment_additional_info.leave_history_empty_state_title\' | translate"\n [showPrimaryAction]="permissions.incluir" [primaryActionLabel]="\'hcm_contract.employment_additional_info.add\' | translate"\n (primaryAction)="onAdd()" [description]="\'hcm_contract.employment_additional_info.leave_history_empty_state_description\' | translate"\n [showSecondaryAction]="permissions.incluir"\n [secondaryActionLabel]="\'hcm_contract.employment_contract.add_collective\' | translate"\n (secondaryAction)="onAddCollective()"></s-empty-state>\n <div [attr.data-hidden]="!gridData?.length || serverError">\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="add-button" type="button" pButton [label]="\'hcm_contract.employment_additional_info.add\' | translate"\n title="{{\'hcm_contract.employment_additional_info.add\' | translate}} (Alt + Shift + N)"\n *ngIf="permissions.incluir" (click)="onAdd()"></button>\n <button id="edit-button" type="button" class="ui-button-secondary" pButton [label]="getTitleButton()"\n title="{{getTitleButton()}} (Alt + Shift + E)"\n [disabled]="!selection || selection.length !== 1" (click)="onEdit()"></button>\n <button id="delete-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_additional_info.delete\' | translate"\n title="{{\'hcm_contract.employment_additional_info.delete\' | translate}} (Alt + Shift + X)"\n (click)="onDelete()" [disabled]="!selection || !selection.length" *ngIf="permissions.excluir"></button>\n <s-button *ngIf="permissions.incluir || permissions.excluir"\n [label]="\'hcm_contract.employment_contract.other_actions\' | translate"\n priority="secondary" [model]="collectiveActions" [disabled]="false" [auxiliary]="false"></s-button>\n </div>\n </div>\n <div class="ui-g">\n <div class="ui-g-12">\n <p-table #leaveHistoryTable [value]="gridData" [columns]="gridColumns" dataKey="id" [lazy]="true" [scrollable]="true"\n [resizableColumns]="true" sortMode="multiple" [paginator]="true" [totalRecords]="totalRecords"\n [sortField]="getSortField()" [sortOrder]="getSortOrder()" [first]="getRowIndex()"\n [rows]="getPageSize()" [lazyLoadOnInit]="false" [rowsPerPageOptions]="[10, 20, 50, 100]"\n [(selection)]="selection" (onLazyLoad)="onGridChange($event)">\n <ng-template pTemplate="colgroup" let-columns *ngIf="!customGridColgroup else customGridColgroup">\n <colgroup>\n <col *ngFor="let col of columns" [style.width]="col.width">\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:END}--\x3e\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns *ngIf="!customGridHeader else customGridHeader">\n <tr>\n <th id="tableHeaderCheckbox" style="width: 50px">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id="columnsName" *ngFor="let col of columns" [pSortableColumn]="col.field" style="width: 200px" pResizableColumn>\n <div class="senior-header">\n <span class="senior-header-title">{{col.header}}</span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n \x3c!--{CA:GRID_HEADER_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_HEADER_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n \x3c!--{CA:GRID_HEADER:START}--\x3e\n \x3c!--{CA:GRID_HEADER:END}--\x3e\n <ng-template pTemplate="body" let-rowData let-columns *ngIf="!customGridBody else customGridBody">\n <tr [pSelectableRow]="rowData">\n <td style="width: 50px">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'employee.employer.codEmp\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'employee.employer.nomEmp\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'employee.employeeSnapshot.companyBranchCode\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'employee.employeeSnapshot.companyBranchName\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'employee.code\') | localizedNumber | async}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'employee.person.nomPes\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <div [ngSwitch]="getProp(rowData, \'employee.employmentRelationship.contractType\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)">\n <span *ngSwitchCase="\'EMPLOYEE\'">{{ "hcm_contract.employment_additional_info.contract_type_employee" | translate }}</span>\n <span *ngSwitchCase="\'DIRECTOR\'">{{ "hcm_contract.employment_additional_info.contract_type_director" | translate }}</span>\n <span *ngSwitchCase="\'TRAINEE\'">{{ "hcm_contract.employment_additional_info.contract_type_trainee" | translate }}</span>\n <span *ngSwitchCase="\'APRENTICE\'">{{ "hcm_contract.employment_additional_info.contract_type_aprentice" | translate }}</span>\n <span *ngSwitchCase="\'THIRD_PARTY\'">{{ "hcm_contract.employment_additional_info.contract_type_third_party" | translate }}</span>\n </div>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'startDate\') | localizedDate:"L" | async}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'situation.code\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'situation.name\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(\n getProp(rowData, \'endDate\') | localizedDate:"L" | async) ||\n (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)}}\n </span>\n </td>\n \x3c!--{CA:GRID_BODY_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_BODY_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <s-table-paging [table]="leaveHistoryTable" [totalRecords]="totalRecords" [exportFileName]="\'hcm_contract.employment_additional_info.leave_history_list_grid_title\' | translate">\n </s-table-paging>\n </ng-template>\n \x3c!--{CA:GRID_TEMPLATES:START}--\x3e\n \x3c!--{CA:GRID_TEMPLATES:END}--\x3e\n </p-table>\n </div>\n </div>\n </div>\n </p-panel>\n</div>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',providers:[i.ConfirmationService]})],o)}(Ln),so=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,In,Bn,Qn,l.FileUploadModule,G.EntityLookupModule.forRoot({domain:"hcm_contract",service:"employment_additional_info"})],declarations:[ro,io],providers:[nn,pn],exports:[ro,io]})],e)}(),lo=c,co=function(){function n(n,o,i,a,s,l){this.route=n,this.translate=o,this.fieldCustomization=i,this.e030AgeService=a,this.e030BanService=s,this.cdr=l,this.locale={},this.currencyLocaleOptions={},this.permissions={},this.allPermissions={},this.mainPanelCollapsed=!1,this.bankAccountType=[{label:this.translate.instant("hcm_contract.employment_contract.bank_account_type_checking_account"),value:e.BankAccountType.CHECKING_ACCOUNT},{label:this.translate.instant("hcm_contract.employment_contract.bank_account_type_savings_account"),value:e.BankAccountType.SAVINGS_ACCOUNT},{label:this.translate.instant("hcm_contract.employment_contract.bank_account_type_salary_account"),value:e.BankAccountType.SALARY_ACCOUNT},{label:this.translate.instant("hcm_contract.employment_contract.bank_account_type_other"),value:e.BankAccountType.OTHER}],this.bankBranchLookupDisplayFields=["codAge","nomAge"],this.bankBranchAdvancedDisplayFields=["codAge","nomAge"],this.bankBranchLookupSeparator=" - ",this.bankLookupDisplayFields=["codBan","nomBan"],this.bankAdvancedDisplayFields=["codBan","nomBan"],this.bankLookupSeparator=" - ",this.remove=new t.EventEmitter,this.ngUnsubscribe=new r.Subject}return n.prototype.ngOnInit=function(){var e=this;this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)})),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.bankBranchSearchFields=this.getBankBranchSearchFields(),this.bankBranchSearchGridFields=this.getBankBranchSearchGridFields(),this.bankSearchFields=this.getBankSearchFields(),this.bankSearchGridFields=this.getBankSearchGridFields()},n.prototype.ngAfterViewInit=function(){var e=document.getElementsByTagName("input"),t=Array.from(e).find((function(e){return!e.disabled}));t&&t.focus(),this.cdr.detectChanges()},n.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},n.prototype.isNew=function(){return"new"==this.routeParams.bankAccountHistory},n.prototype.onRouteParamsChange=function(e){this.routeParams=e},n.prototype.updateSuggestions=function(e){e.bankBranch&&(e.bankBranch.label=this.getSuggestionValue(["codAge","nomAge"],"bankBranch",e,this.bankBranchLookupSeparator),e.bankBranch.label.trim()===this.bankBranchLookupSeparator.trim()&&delete e.bankBranch.label),e.bank&&(e.bank.label=this.getSuggestionValue(["codBan","nomBan"],"bank",e,this.bankLookupSeparator),e.bank.label.trim()===this.bankLookupSeparator.trim()&&delete e.bank.label)},n.prototype.getSuggestionValue=function(e,t,n,o){var i=this;return e.map((function(e){return i.getProp(n,t+"."+e)})).reduce((function(e,t){return""+e+o+t}))},n.prototype.onRouteDataChange=function(e){if(e.locale&&e.locale.number){var t=e.locale.number,n=t.currencySymbol,o=t.thousandsSeparator,i=t.decimalSeparator;this.locale=e.locale,this.currencyLocaleOptions={align:"left",prefix:n,thousands:o,decimal:i}}if(this.permissions=e.allPermissions.bankAccountHistory,this.allPermissions=e.allPermissions,e.entity){this.permissions.editar||this.formGroup.disable();var a=Jt.fromDto(e.entity);this.updateSuggestions(a),this.formGroup.patchValue(a)}else this.formGroup.patchValue(new Jt)},n.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},n.prototype.onBankBranchLookupRequest=function(e){var t=this,n=this.bankBranchLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.mountFilterQuery(this.getBankBranchSearchFields(),e);o=this.getFilterBankBranch(o);var i=Ee(this.bankBranchLookupDisplayFields,this.bankBranchAdvancedDisplayFields);this.e030AgeService.listExternalE030Age({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.bankBranchLookupDisplayFields.map((function(n){return n.indexOf(".")>0?t.getProp(e,n):e[n]})).join(t.bankBranchLookupSeparator)})}))})}))).subscribe((function(e){t.bankBranchLookupSuggestions=e.contents}))},n.prototype.onBankBranchSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.mountFilterQuerySearch(this.getBankBranchSearchFields(),a);c=this.getFilterBankBranch(c);var p=Ee(this.bankBranchLookupDisplayFields,this.bankBranchAdvancedDisplayFields);this.e030AgeService.listExternalE030Age({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.bankBranchLookupDisplayFields.map((function(n){return n.indexOf(".")>0?t.getProp(e,n):e[n]})).join(t.bankBranchLookupSeparator)})}))})}))).subscribe((function(e){t.bankBranchSearchGridData=e.contents,t.bankBranchSearchTotalRecords=e.totalElements}))},n.prototype.onBankLookupRequest=function(e){var t=this,n=this.bankLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.mountFilterQuery(this.getBankSearchFields(),e),i=Ee(this.bankLookupDisplayFields,this.bankAdvancedDisplayFields);this.getBankObservable({sort:n,filterQuery:o,displayFields:i}).subscribe((function(e){t.bankLookupSuggestions=e.contents}))},n.prototype.mountFilterQuery=function(e,t){return e.filter((function(e){var n=e.type;return Ce(n,t)})).map((function(e){var n=e.name,o=e.type;return"number"==typeof t?n+" eq "+t:o==l.FieldType.Date?n+" eq '"+lo(t).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+lo(t).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+lo(t).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+t.replace(/'/g,"\\'")+"'))":n+" eq '"+t+"'"})).join(" or ")},n.prototype.mountFilterQuerySearch=function(e,t){return e.filter((function(e){var n=e.name;return!!t[n]})).map((function(e){var n=e.name,o=e.type,i=t[n];return"number"==typeof i?n+" eq "+i:o==l.FieldType.Date?n+" eq '"+lo(i).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+lo(i).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+lo(i).format()+"'":o==l.FieldType.Enum?n+" eq '"+i+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+i.replace(/'/g,"\\'")+"'))":n+" eq '"+i+"'"})).join(" and ")},n.prototype.onBankSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,s=i,l=this.mountFilterQuerySearch(this.getBankSearchFields(),a),c=Ee(this.bankLookupDisplayFields,this.bankAdvancedDisplayFields);this.getBankObservable({page:r,sort:s,filterQuery:l,displayFields:c}).subscribe((function(e){t.bankSearchGridData=e.contents,t.bankSearchTotalRecords=e.totalElements}))},n.prototype.getBankObservable=function(e){var t=this;return this.e030BanService.listExternalE030Ban(z({},e)).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.bankLookupDisplayFields.map((function(n){return n.indexOf(".")>0?t.getProp(e,n):e[n]})).join(t.bankLookupSeparator)})}))})})))},n.prototype.getBankBranchSearchFields=function(){return[new l.FormField({name:"codAge",label:this.translate.instant("hcm_contract.employment_contract.e_030_age_cod_age"),type:l.FieldType.String}),new l.FormField({name:"nomAge",label:this.translate.instant("hcm_contract.employment_contract.e_030_age_nom_age"),type:l.FieldType.String})]},n.prototype.getBankBranchSearchGridFields=function(){return[new l.FormField({name:"codAge",label:this.translate.instant("hcm_contract.employment_contract.e_030_age_cod_age"),type:l.FieldType.String}),new l.FormField({name:"nomAge",label:this.translate.instant("hcm_contract.employment_contract.e_030_age_nom_age"),type:l.FieldType.String})]},n.prototype.getBankSearchFields=function(){return[new l.FormField({name:"codBan",label:this.translate.instant("hcm_contract.employment_contract.e_030_ban_cod_ban"),type:l.FieldType.String}),new l.FormField({name:"nomBan",label:this.translate.instant("hcm_contract.employment_contract.e_030_ban_nom_ban"),type:l.FieldType.String})]},n.prototype.getBankSearchGridFields=function(){return[new l.FormField({name:"codBan",label:this.translate.instant("hcm_contract.employment_contract.e_030_ban_cod_ban"),type:l.FieldType.String}),new l.FormField({name:"nomBan",label:this.translate.instant("hcm_contract.employment_contract.e_030_ban_nom_ban"),type:l.FieldType.String})]},n.prototype.onClearBank=function(){this.onSelectBank(null),ae(this.formGroup,!0,"bankBranch")},n.prototype.onSelectBank=function(e){var t=this.formGroup.get("bankBranch");e&&(t.enable(),t.reset(),this.requiredBankBranch=!1),t.updateValueAndValidity()},n.prototype.getFilterBankBranch=function(e){var t=this.formGroup.get("bank").value,n=e?"and":"",o=n?n+" ("+e+")":"";return t&&t.id&&(e="e030ban eq '"+t.id+"' "+o),e},n.prototype.checkPermissions=function(){return"new"==this.routeParams.bankAccountHistory||this.permissions.editar},n.ctorParameters=function(){return[{type:d.ActivatedRoute},{type:a.TranslateService},{type:Sn},{type:en},{type:Zt},{type:t.ChangeDetectorRef}]},W([t.Input()],n.prototype,"isDisable",void 0),W([t.Input()],n.prototype,"formGroup",void 0),W([t.ViewChild("customTemplate")],n.prototype,"customTemplate",void 0),W([t.ViewChild("customFormFields")],n.prototype,"customFormFields",void 0),W([t.Input()],n.prototype,"id",void 0),W([t.Output()],n.prototype,"remove",void 0),n=W([t.Component({selector:"fnd-bank-account-item",template:'<form [formGroup]="formGroup">\n <div class="ui-fluid" *ngIf="!customFormFields; else customFormFields">\n <div class="ui-g ui-fluid">\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-2 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isDisable">\n <label for="bank">{{\n "hcm_contract.employment_contract.bank_account_history_bank"\n | translate\n }}</label>\n <s-lookup\n dataKey="id"\n id="bank"\n name="bank"\n formControlName="bank"\n [searchFields]="bankSearchFields"\n [searchGridFields]="bankSearchGridFields"\n [searchGridData]="bankSearchGridData"\n [multiple]="false"\n [lookupSuggestions]="bankLookupSuggestions"\n (onLookupRequest)="onBankLookupRequest($event)"\n (onSearchRequest)="onBankSearchRequest($event)"\n lookupDisplayField="label"\n (onSelect)="onSelectBank($event)"\n (onClear)="onClearBank()"\n [searchTotalRecords]="bankSearchTotalRecords"\n [searchTitle]="\n \'hcm_contract.employment_contract.bank_account_history_bank_search_title\'\n | translate\n "\n [searchEmptyTitle]="\n \'hcm_contract.employment_contract.nothing_found\' | translate\n "\n [filterLabel]="\'hcm_contract.employment_contract.filter\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.filters\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.clear\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.cancel\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.select\' | translate"\n [searchTotalRecordsLabel]="\n \'hcm_contract.employment_contract.total_records\'\n | translate : { value: bankSearchTotalRecords }\n "\n ></s-lookup>\n <s-control-errors\n [control]="formGroup.controls[\'bank\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate\n }"\n ></s-control-errors>\n </div>\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-2 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isDisable">\n <label for="bankBranch">{{\n "hcm_contract.employment_contract.bank_account_history_bank_branch"\n | translate\n }}</label>\n <s-lookup\n dataKey="id"\n id="bankBranch"\n name="bankBranch"\n formControlName="bankBranch"\n [searchFields]="bankBranchSearchFields"\n [searchGridFields]="bankBranchSearchGridFields"\n [searchGridData]="bankBranchSearchGridData"\n [multiple]="false"\n [lookupSuggestions]="bankBranchLookupSuggestions"\n (onLookupRequest)="onBankBranchLookupRequest($event)"\n (onSearchRequest)="onBankBranchSearchRequest($event)"\n lookupDisplayField="label"\n [searchTotalRecords]="bankBranchSearchTotalRecords"\n [searchTitle]="\n \'hcm_contract.employment_contract.bank_account_history_bank_branch_search_title\'\n | translate\n "\n [searchEmptyTitle]="\n \'hcm_contract.employment_contract.nothing_found\' | translate\n "\n [filterLabel]="\'hcm_contract.employment_contract.filter\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.filters\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.clear\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.cancel\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.select\' | translate"\n [searchTotalRecordsLabel]="\n \'hcm_contract.employment_contract.total_records\'\n | translate : { value: bankBranchSearchTotalRecords }\n "\n ></s-lookup>\n <s-control-errors\n [control]="formGroup.controls[\'bankBranch\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate\n }"\n ></s-control-errors>\n </div>\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-2 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isDisable">\n <label for="bankAccountType">{{\n "hcm_contract.employment_contract.bank_account_history_bank_account_type"\n | translate\n }}</label>\n <p-dropdown\n inputId="bankAccountType"\n name="bankAccountType"\n [options]="bankAccountType"\n formControlName="bankAccountType"\n placeholder="{{\n \'hcm_contract.employment_contract.bank_account_history_bank_account_type_placeholder\'\n | translate\n }}"\n ></p-dropdown>\n <s-control-errors\n [control]="formGroup.controls[\'bankAccountType\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate\n }"\n ></s-control-errors>\n </div>\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-2 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isDisable">\n <label for="bankAccountNumber">{{\n "hcm_contract.employment_contract.bank_account_history_bank_account_number"\n | translate\n }}</label>\n <input\n #bankAccountNumberFormInput\n id="bankAccountNumber"\n name="bankAccountNumber"\n pInputText\n formControlName="bankAccountNumber"\n sBignumberInput\n autocomplete="off"\n />\n <s-control-errors\n [control]="formGroup.controls[\'bankAccountNumber\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate,\n pattern:\n \'hcm_contract.employment_contract.error_invalid\' | translate\n }"\n ></s-control-errors>\n </div>\n <div class="ui-sm-4 ui-md-4 ui-lg-4 ui-xl-2 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isDisable">\n <label for="bankAccountDigit">{{\n "hcm_contract.employment_contract.bank_account_history_bank_account_digit"\n | translate\n }}</label>\n <input\n #bankAccountDigitFormInput\n type="text"\n id="bankAccountDigit"\n name="bankAccountDigit"\n pInputText\n formControlName="bankAccountDigit"\n autocomplete="off"\n />\n <s-control-errors\n [control]="formGroup.controls[\'bankAccountDigit\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate,\n maxlength:\n \'hcm_contract.employment_contract.error_max_length\'\n | translate : { value: \'3\' }\n }"\n ></s-control-errors>\n </div>\n <div class="ui-sm-4 ui-md-2 ui-lg-2 ui-xl-1 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isNew()">\n <label for="bankAccountPercentage">{{\n "hcm_contract.employment_contract.bank_account_history_bank_account_percentage"\n | translate\n }}</label>\n <div class="ui-inputgroup">\n <span class="ui-inputgroup-addon">%</span>\n <input\n #bankAccountPercentageFormInput\n id="bankAccountPercentage"\n name="bankAccountPercentage"\n pInputText\n formControlName="bankAccountPercentage"\n [precision]="15"\n [scale]="2"\n sBignumberInput\n autocomplete="off"\n />\n </div>\n <s-control-errors\n [control]="formGroup.controls[\'bankAccountPercentage\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate,\n min:\n \'hcm_contract.employment_contract.error_min_value\'\n | translate : { value: \'0.01\' },\n max:\n \'hcm_contract.employment_contract.error_max_value\'\n | translate : { value: \'100\' }\n }"\n ></s-control-errors>\n </div>\n <div\n [id]="\'dv-remove-bank-account-history-\' + id"\n class="ui-sm-4 ui-md-2 ui-lg-2 ui-xl-1"\n >\n <label> </label>\n <s-button\n id="btn-remove-bank-account-history"\n styleClass="btn-broke"\n label="{{\n \'hcm_contract.employment_contract.admission_generic_remove\'\n | translate\n }}"\n priority="link"\n [auxiliary]="false"\n [disabled]="isDisable"\n (click)="remove.next()"\n *ngIf="checkPermissions()"\n >\n </s-button>\n </div>\n </div>\n </div>\n</form>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',providers:[i.ConfirmationService]})],n)}(),po=function(){function e(e,t,n){this.formBuilder=e,this.route=t,this.changeRef=n,this.permissions={},this.ngUnsubscribe=new r.Subject}return e.prototype.ngOnInit=function(){var e=this;this.parentFormGroup.addControl(this.nameFormControl,this.formArray),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)}))},e.prototype.ngAfterViewChecked=function(){this.changeRef.detectChanges()},e.prototype.onRouteDataChange=function(e){this.permissions=e.allPermissions.bankAccountHistory},e.prototype.onRouteParamsChange=function(e){this.routeParams=e},Object.defineProperty(e.prototype,"parentFormGroupName",{set:function(e){e&&(this.nameFormControl=e,this.createFormGroup())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bankData",{set:function(e){var t=this;e&&e.length&&e.forEach((function(e){var n=t.formBuilder.group({bank:t.formBuilder.control({value:z({},e.bank),disabled:!1},p.Validators.required),bankBranch:t.formBuilder.control({value:z({},e.bankBranch),disabled:!1},p.Validators.required),bankAccountType:t.formBuilder.control({value:e.bankAccountType,disabled:!1},p.Validators.required),bankAccountNumber:t.formBuilder.control({value:e.bankAccountNumber,disabled:!1},p.Validators.required),bankAccountDigit:t.formBuilder.control({value:e.bankAccountDigit,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.maxLength(3)])),bankAccountPercentage:t.formBuilder.control({value:e.bankAccountPercentage,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.min(.01),p.Validators.max(100)]))});t.isDisable&&n.disable({onlySelf:!0}),t.bankAccountHistories.push(n)}))},enumerable:!0,configurable:!0}),e.prototype.addBankAccountListItem=function(){this.bankAccountHistories.push(this.formBuilder.group({bank:this.formBuilder.control({value:null,disabled:!1},p.Validators.required),bankBranch:this.formBuilder.control({value:null,disabled:!0},p.Validators.required),bankAccountType:this.formBuilder.control({value:null,disabled:!1},p.Validators.required),bankAccountNumber:this.formBuilder.control({value:null,disabled:!1},p.Validators.required),bankAccountDigit:this.formBuilder.control({value:null,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.maxLength(3)])),bankAccountPercentage:this.formBuilder.control({value:null,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.min(.01),p.Validators.max(100)]))}))},e.prototype.removeBankDataItem=function(e){this.bankAccountHistories.removeAt(e)},e.prototype.createFormGroup=function(){this.formArray=this.formBuilder.array([])},Object.defineProperty(e.prototype,"bankAccountHistories",{get:function(){return this.nameFormControl&&this.formArray},enumerable:!0,configurable:!0}),e.prototype.checkPermissions=function(){return"new"===this.routeParams.bankAccountHistory||this.permissions.editar},e.ctorParameters=function(){return[{type:p.FormBuilder},{type:d.ActivatedRoute},{type:t.ChangeDetectorRef}]},W([t.Input()],e.prototype,"parentFormGroup",void 0),W([t.Input()],e.prototype,"isDisable",void 0),W([t.Input()],e.prototype,"parentFormGroupName",null),W([t.Input()],e.prototype,"bankData",null),e=W([t.Component({selector:"fnd-bank-account-list",template:'<form [formGroup]="formArray">\n <div *ngFor="let group of bankAccountHistories.controls; let i = index">\n <fnd-bank-account-item\n [formGroup]="group"\n [id]="\'bank-account-history-item\' + i"\n (remove)="removeBankDataItem(i)"\n [isDisable]="isDisable"\n ></fnd-bank-account-item>\n </div>\n <div class="ui-g ui-fluid">\n <div class="ui-sm-12 ui-md-12 ui-lg-12 ui-xl-12 required">\n <s-button\n id="btn-add-bank-account"\n styleClass="btn-broke"\n class="btn-add"\n label="{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_financial_financial_add_bank_account_history\'\n | translate\n }}"\n priority="link"\n [auxiliary]="false"\n [disabled]="isDisable"\n (click)="addBankAccountListItem()"\n *ngIf="checkPermissions()"\n ></s-button>\n </div>\n </div>\n</form>\n',styles:[".btn-add{float:left}"]})],e)}(),mo=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,In,Bn,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,l.DynamicFormModule,l.TokenListModule,E.PanelModule,B.TooltipModule,D.InputTextModule,V.ButtonModule,N.CheckboxModule,k.TableModule,v.ConfirmDialogModule,_.CalendarModule,g.DropdownModule,I.TabViewModule,y.HotkeyModule,l.LoadingStateModule,l.BignumberInputModule,n.CyclicJsonInterceptorModule,n.HttpInterceptorModule,R.ToastModule,O.FieldsetModule],declarations:[co,po],providers:[tt,i.MessageService,qe,Zt,en],exports:[co,po]})],e)}();!function(e){e.V1006="V1006",e.V1207="V1207"}(Xn||(Xn={}));var uo,ho,yo,fo,_o,vo=function(){function e(e,t,n){this.formBuilder=e,this.route=t,this.changeRef=n,this.permissions={},this.ngUnsubscribe=new r.Subject,this.indexToDisable=-1,this.isDisabled=!1}return e.prototype.ngOnInit=function(){var e=this;this.parentFormGroup.addControl(this.nameFormControl,this.formArray),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)}))},e.prototype.ngAfterViewChecked=function(){this.changeRef.detectChanges(),this.enableOrDisableAddButton(this.formArray)},e.prototype.onRouteDataChange=function(e){this.permissions=e.allPermissions.regulatoryNormTrainingHistory},e.prototype.onRouteParamsChange=function(e){this.routeParams=e},e.prototype.addRegulatoryNormTrainingHistoryListItem=function(){this.createRegulatoryNormTrainingHistoryFormGroup(),this.enableOrDisableAddButton(this.regulatoryNormTrainingHistories)},e.prototype.setESocialTrainingCodeTypeValidator=function(){return function(e){var t=e;return t.controls.forEach((function(e,n){var o=t.controls.some((function(t,o){var i=e.get("eSocialTrainingCodeType"),a=t.get("eSocialTrainingCodeType"),r=i.value,s=a.value;return!(n===o||!r||!s||r!==s)})),i=e.get("eSocialTrainingCodeType");o&&!i.disabled?(i.setErrors({eSocialTrainingCodeTypesAreEqual:!0}),i.markAsDirty()):i.hasError("eSocialTrainingCodeTypesAreEqual")&&(mn(i,"eSocialTrainingCodeTypesAreEqual"),i.markAsPristine())})),null}},e.prototype.setStartDateValidator=function(){var e=this;return function(t){return e.personBirthDate&&t.value&&c(t.value).isBefore(c(e.personBirthDate),"day")?{startDateBeforeBirthdate:!0}:(mn(t,"startDateBeforeBirthdate"),null)}},e.prototype.getESocialTrainingCodeQuantity=function(){var e=0;for(var t in Xn)Xn.hasOwnProperty(t)&&isNaN(parseInt(t))&&e++;return e},e.prototype.enableOrDisableAddButton=function(e){this.isAddButtonDisabled=e.length===this.getESocialTrainingCodeQuantity()},Object.defineProperty(e.prototype,"regulatoryNormTrainingHistories",{get:function(){return this.nameFormControl&&this.formArray},enumerable:!0,configurable:!0}),e.prototype.createFormGroup=function(){this.formArray=this.formBuilder.array([],[this.setESocialTrainingCodeTypeValidator()])},e.prototype.removeRegulatoryTraining=function(e){this.regulatoryNormTrainingHistories.removeAt(e),this.enableOrDisableAddButton(this.regulatoryNormTrainingHistories)},e.prototype.checkPermissions=function(){return"new"==this.routeParams.regulatoryNormTrainingHistory||this.permissions.editar},e.prototype.createRegulatoryNormTrainingHistoryFormGroup=function(e){var t=this.formBuilder.group({startDate:this.formBuilder.control({value:null==e?void 0:e.startDate,disabled:!!e},[p.Validators.required,this.setStartDateValidator()]),eSocialTrainingCodeType:this.formBuilder.control({value:null==e?void 0:e.eSocialTrainingCodeType,disabled:!!e},[p.Validators.required])});t&&(this.isDisabled=!0),this.regulatoryNormTrainingHistories.push(t)},Object.defineProperty(e.prototype,"parentFormGroupName",{set:function(e){e&&(this.nameFormControl=e,this.createFormGroup())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trainingData",{set:function(e){var t=this;e&&e.length&&e.forEach((function(e){t.createRegulatoryNormTrainingHistoryFormGroup(e),t.enableOrDisableAddButton(t.regulatoryNormTrainingHistories),t.indexToDisable++}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"personBirthdate",{set:function(e){var t=this;this.personBirthDate=e,this.formArray&&this.formArray.controls.forEach((function(e){var n=e.get("startDate");t.personBirthDate&&n.value&&c(n.value).isBefore(c(t.personBirthDate),"day")?n.setErrors({startDateBeforeBirthdate:!0}):mn(n,"startDateBeforeBirthdate")}))},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:p.FormBuilder},{type:d.ActivatedRoute},{type:t.ChangeDetectorRef}]},W([t.Input()],e.prototype,"parentFormGroup",void 0),W([t.Input()],e.prototype,"parentFormGroupName",null),W([t.Input()],e.prototype,"trainingData",null),W([t.Input()],e.prototype,"personBirthdate",null),e=W([t.Component({selector:"fnd-regulatory-norm-training-history-list",template:'<form [formGroup]="formArray">\n <div *ngFor="let group of regulatoryNormTrainingHistories.controls; let i = index">\n <fnd-regulatory-norm-training-history-item\n [formGroup]="group" [id]="\'regulatory-norm-training-history-item\' + i"\n [personBirthDate]="personBirthDate" (remove)="removeRegulatoryTraining(i)"\n [isRemoveButtonDisabled]="i <= indexToDisable">\n </fnd-regulatory-norm-training-history-item>\n </div>\n <div class="ui-g ui-fluid">\n <div class="ui-sm-12 ui-md-12 ui-lg-12 ui-xl-12 required">\n <s-button\n id="btn-add-training-data"\n styleClass="btn-broke"\n class="btn-add"\n label="{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_acting_acting_add_regulatory-norm-training-history\'\n | translate\n }}"\n priority="link"\n [auxiliary]="false"\n (click)="addRegulatoryNormTrainingHistoryListItem()"\n [disabled]="isAddButtonDisabled"\n *ngIf="checkPermissions()"\n ></s-button>\n </div>\n </div>\n</form>\n',styles:[".btn-add{float:left}"]})],e)}(),go=function(){function e(e,n,o){this.route=e,this.translate=n,this.cdr=o,this.locale={},this.currencyLocaleOptions={},this.permissions={},this.allPermissions={},this.remove=new t.EventEmitter,this.mainPanelCollapsed=!1,this.eSocialTrainingCodeType=[{label:this.translate.instant("hcm_contract.employment_contract.esocial-training-code-type-V1006"),value:Xn.V1006},{label:this.translate.instant("hcm_contract.employment_contract.esocial-training-code-type-V1207"),value:Xn.V1207}],this.ngUnsubscribe=new r.Subject}return e.prototype.ngOnInit=function(){var e=this;this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)})),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)}))},e.prototype.ngAfterViewInit=function(){var e=document.getElementsByTagName("input"),t=Array.from(e).find((function(e){return!e.disabled}));t&&t.focus(),this.cdr.detectChanges()},e.prototype.onRouteParamsChange=function(e){this.routeParams=e},e.prototype.onRouteDataChange=function(e){if(e.locale&&e.locale.number){var t=e.locale.number,n=t.currencySymbol,o=t.thousandsSeparator,i=t.decimalSeparator;this.locale=e.locale,this.currencyLocaleOptions={align:"left",prefix:n,thousands:o,decimal:i}}if(this.permissions=e.allPermissions.regulatoryNormTrainingHistory,this.allPermissions=e.allPermissions,e.entity){this.permissions.editar||this.formGroup.disable();var a=cn.fromDto(e.entity);this.formGroup.patchValue(a)}else this.formGroup.patchValue(new cn)},e.prototype.isNew=function(){return"new"==this.routeParams.regulatoryNormTrainingHistory},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.checkPermissions=function(){return this.isNew()||this.permissions.editar},e.ctorParameters=function(){return[{type:d.ActivatedRoute},{type:a.TranslateService},{type:t.ChangeDetectorRef}]},W([t.Input()],e.prototype,"id",void 0),W([t.Input()],e.prototype,"isRemoveButtonDisabled",void 0),W([t.Input()],e.prototype,"personBirthDate",void 0),W([t.Input()],e.prototype,"formGroup",void 0),W([t.Output()],e.prototype,"remove",void 0),W([t.ViewChild("customTemplate")],e.prototype,"customTemplate",void 0),W([t.ViewChild("customFormFields")],e.prototype,"customFormFields",void 0),e=W([t.Component({selector:"fnd-regulatory-norm-training-history-item",template:'<form [formGroup]="formGroup">\n <div class="ui-fluid" *ngIf="!customFormFields; else customFormFields">\n <div class="ui-g ui-fluid">\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-3 required">\n <label for="eSocialRegulatoryNormTraining">\n {{"hcm_contract.employment_contract.regulatory_norm_training_history_esocial_training_code_type"\n | translate }}\n </label>\n <p-dropdown inputId="eSocialTrainingCodeType"\n name="eSocialTrainingCodeType"\n [options]="eSocialTrainingCodeType"\n formControlName="eSocialTrainingCodeType"\n placeholder="{{ \'hcm_contract.employment_contract.esocial-training-code-type-placeholder\'\n | translate}}"></p-dropdown>\n <s-control-errors [control]="formGroup.controls[\'eSocialTrainingCodeType\']" [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\'\n | translate,\n eSocialTrainingCodeTypesAreEqual:\n \'hcm_contract.employment_contract.e_social_training_code_type_cant_be_equal\'\n | translate\n }"></s-control-errors>\n </div>\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-2 required">\n <label for="startDate">\n {{ "hcm_contract.employment_contract.regulatory_norm_training_history_start_date" | translate }}\n </label>\n <p-calendar id="startDate" #startDateFormInput inputId="startDate" name="startDate"\n [showIcon]="true" formControlName="startDate" [locale]="locale.calendar"\n [dateFormat]="locale.calendar.dateFormat" sCalendarMask>\n </p-calendar>\n <s-control-errors [control]="formGroup.controls[\'startDate\']"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate,\n startDateBeforeBirthdate: \'hcm_contract.employment_contract.start_date_before_birth_date\' | translate\n }"></s-control-errors>\n </div>\n <div\n [id]="\'dv-remove-regulatory-norm-training-history-\' + id"\n class="ui-sm-4 ui-md-2 ui-lg-2 ui-xl-1"\n >\n <label> </label>\n <s-button\n id="btn-remove-regulatory-norm-training-history"\n styleClass="btn-broke"\n label="{{\n \'hcm_contract.employment_contract.admission_generic_remove\'\n | translate\n }}"\n priority="link"\n [auxiliary]="false"\n [disabled]="isRemoveButtonDisabled"\n (click)="remove.next()"\n *ngIf="checkPermissions()"\n >\n </s-button>\n </div>\n </div>\n </div>\n</form>\n',providers:[i.ConfirmationService]})],e)}(),bo=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),In,Bn,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,l.DynamicFormModule,l.TokenListModule,E.PanelModule,B.TooltipModule,D.InputTextModule,l.ButtonModule,N.CheckboxModule,k.TableModule,v.ConfirmDialogModule,_.CalendarModule,g.DropdownModule,I.TabViewModule,y.HotkeyModule,l.LoadingStateModule,l.BignumberInputModule,n.CyclicJsonInterceptorModule,n.HttpInterceptorModule,R.ToastModule,O.FieldsetModule,kn],declarations:[vo,go],providers:[Dt,i.MessageService],exports:[vo,go]})],e)}(),So=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translate=n}return e.prototype.employeeBasicInformations=function(e){return this.http.post("hcm_contract/employment_contract/queries/employeeBasicInformations",{employeeId:e}).pipe(this.defaultCatch())},e.prototype.defaultCatch=function(){var e=this;return s.catchError((function(t){if(t){var n=t.status?String(t.status):"Error",o=t.error&&t.error.message||t.statusText||t.message||"Error";401===t.status&&(n=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_title"),o=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_description")),e.messageService.add({severity:"error",summary:n,detail:o})}return r.throwError(t)}))},e.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},e=W([t.Injectable()],e)}(),Do=function(){function e(e){this.employeeSummaryService=e,this.ngUnsubscribe=new r.Subject}return Object.defineProperty(e.prototype,"employeeId",{set:function(e){this._employeeId=e,this.getEmployeeBasicInformation()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.getEmployeeBasicInformation()},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},e.prototype.getEmployeeBasicInformation=function(){var e=this;this._employeeId&&this._employeeId!=this.lastEmployeeId&&(this.lastEmployeeId=this._employeeId,this.loading=!0,this.employeeSummaryService.employeeBasicInformations(this._employeeId).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){return e.currentEmployee=null==t?void 0:t.employeeBasicInformations})))},e.ctorParameters=function(){return[{type:So}]},W([t.Input()],e.prototype,"employeeId",null),e=W([t.Component({selector:"fnd-employee-summary",template:'<s-loading-state [blockWindow]="true" [loading]="loading">\n <s-object-card *ngIf="_employeeId && currentEmployee">\n <s-object-card-main label="{{currentEmployee.name}}"\n description=\n "{{currentEmployee.jobPosition || (\'hcm_contract.employment_contract.not_informed\' | translate)}}"\n imageSource="{{currentEmployee.imageUrl}}">\n </s-object-card-main>\n <s-object-card-field label="{{currentEmployee.e070emp\n || (\'hcm_contract.employment_contract.not_informed\' | translate)}}" description="{{currentEmployee.e070fil\n || (\'hcm_contract.employment_contract.not_informed\' | translate)}}">\n </s-object-card-field>\n <s-object-card-field label="{{\'hcm_contract.employment_contract.department\' | translate}}"\n description=\n "{{currentEmployee.location || (\'hcm_contract.employment_contract.not_informed\' | translate)}}">\n </s-object-card-field>\n <s-object-card-field label="{{\'hcm_contract.employment_contract.situation\' | translate}}"\n description=\n "{{currentEmployee.situation\n || (\'hcm_contract.employment_contract.not_informed\' | translate)}}"></s-object-card-field>\n <s-object-card-field label="{{\'hcm_contract.employment_contract.hireDate\' | translate}}"\n description=\n "{{(currentEmployee.hireDate | localizedDate: \'L\' | async) || (\'hcm_contract.employment_contract.not_informed\' | translate)}}"\n iconClass="fa fa-calendar"></s-object-card-field>\n <s-object-card-field label="{{\'hcm_contract.employment_contract.code\' | translate}}"\n description=\n "{{currentEmployee.code || (\'hcm_contract.employment_contract.not_informed\' | translate)}}"\n iconClass="fa fa-id-card"></s-object-card-field>\n <s-object-card-field label="{{\'hcm_contract.employment_contract.age\' | translate}}"\n description=\n "{{currentEmployee.age || (\'hcm_contract.employment_contract.not_informed\' | translate)}}"\n iconClass="fa fa-birthday-cake"></s-object-card-field>\n </s-object-card>\n</s-loading-state>\n'})],e)}(),To=function(){function e(){}return e=W([t.NgModule({imports:[a.TranslateModule,l.ObjectCardModule,l.LoadingStateModule,h.CommonModule,l.EmptyStateModule,l.LoadingStateModule,l.LocaleModule],declarations:[Do],providers:[So,i.MessageService],exports:[Do]})],e)}(),Fo=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_contract/entities/dependentDraft","hcm_contract/employment_contract/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i.saveDraftEvent=new r.Subject,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Eo=function(e){function n(t,n,o){var i=e.call(this,t,n,"platform/localization/entities/country","platform/localization/entities/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Co=function(e){function n(t,n,o){var i=e.call(this,t,n,"platform/localization/entities/state","platform/localization/entities/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),ko=function(){function e(){}return e.prototype.ngOnInit=function(){},W([t.Input()],e.prototype,"parentFormGroup",void 0),W([t.Input()],e.prototype,"disableDocumentsAdmission",void 0),e=W([t.Component({selector:"fnd-employee-dependent-complement-step",template:'<div class="ui-fluid ">\n <div class="ui-g">\n <div class="ui-md-12">\n <h3>{{ \'hcm_contract.employment_contract.dependent_complement_data_title\' | translate }}</h3>\n </div>\n <p-tabView class="tab-view-full">\n \x3c!-- Complementar --\x3e\n <p-tabPanel\n [header]="\'hcm_contract.employment_contract.employee_dependent_sidebar_step_complement_data\'\n | translate">\n <fnd-employee-dependent-complement-tab\n [parentFormGroup]="parentFormGroup">\n </fnd-employee-dependent-complement-tab>\n </p-tabPanel>\n\n \x3c!-- Documentos --\x3e\n <p-tabPanel\n [header]="\'hcm_contract.employment_contract.employee_dependent_document_title\' | translate">\n <fnd-employee-dependent-document-tab [parentFormGroup]="parentFormGroup"></fnd-employee-dependent-document-tab>\n </p-tabPanel>\n </p-tabView>\n </div>\n</div>\n',styles:[".tab-view-full{width:100%}.toggle-header-fieldset{display:flex!important;justify-content:space-between!important;align-items:center!important}.toggle-header-fieldset .ui-inputgroup span{margin-right:8px!important;font-size:14px;font-weight:400;line-height:21px;text-align:left;text-underline-position:from-font;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}.footer-sidebar-form-dependent{display:flex;justify-content:space-between}.message-warn-admisison{padding-left:65px;font-size:14px}.message-warn-admisison p:first-of-type{font-weight:700}.btn-next>button{display:flex!important;flex-direction:row-reverse!important}.btn-next>button span{margin-left:5px!important}"]})],e)}();!function(e){e.V01="V01",e.V02="V02",e.V03="V03",e.V04="V04",e.V05="V05",e.V06="V06",e.V07="V07",e.V08="V08",e.V09="V09",e.V10="V10",e.V11="V11",e.V12="V12"}(uo||(uo={})),function(e){e.FATHER="FATHER",e.MOTHER="MOTHER"}(ho||(ho={})),function(e){e.SON="SON",e.SPOUSE="SPOUSE",e.FATHER="FATHER",e.MOTHER="MOTHER",e.GRANDFATHER_GRANDMOTHER="GRANDFATHER_GRANDMOTHER",e.GREAT_GRANDFATHER="GREAT_GRANDFATHER",e.NEPHEW="NEPHEW",e.UNCLE="UNCLE",e.GRANDSON="GRANDSON",e.FATHER_IN_LAW="FATHER_IN_LAW",e.SON_IN_LAW_DAOUGHTER_IN_LAW="FATHER_IN_LAW",e.STEPSON="STEPSON",e.BROTHER="BROTHER",e.ADOPTED_CHILD="ADOPTED_CHILD",e.PENSIONERS="PENSIONERS",e.COMPANION="COMPANION",e.GUARDIANSHIP="GUARDIANSHIP",e.MINOR_UNDER_GUARD="MINOR_UNDER_GUARD",e.STEPMOTHER="MINOR_UNDER",e.STEPFATHER="MINOR_UNDER",e.TUTOR="TUTOR",e.EX_EXPOSED="EX_EXPOSED",e.GREAT_GRANDSON="GREAT_GRANDSON",e.EX_PARTNER="EX_PARTNER",e.CONCUBINE="CONCUBINE",e.CURATORSHIP="CURATORSHIP",e.SOCIOAFFECTIVE="SOCIOAFFECTIVE",e.FATHER_MOTHER="FATHER_MOTHER",e.OTHERS="OTHERS"}(yo||(yo={})),function(e){e.V1="V1",e.V2="V2",e.V3="V3",e.V4="V4",e.V5="V5",e.V6="V6"}(fo||(fo={})),function(e){e.V1="V1",e.V2="V2",e.V3="V3",e.V4="V4",e.V5="V5",e.V6="V6"}(_o||(_o={}));var Io,Ro=function(){function e(e,t,n,o){var i=this;this.countryService=e,this.translateService=t,this.formBuilder=n,this.service=o,this.ONLY_NUMBERS_PATTERN="^[0-9]*$",this.ngUnsubscribe=new r.Subject,this.nacionalityLookupDisplayFields=["code","name"],this.nacionalityLookupSeparator=" - ",this.kinshipDegreeType=Object.keys(yo).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_kinship_degree_"+e),value:e}})),this.nameFiliation=Object.keys(ho).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_gra_par_"+e),value:e}})),this.maritalStatusType=Object.keys(fo).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_marital_status_"+e),value:e}})),this.raceType=Object.keys(_o).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_race_type_"+e),value:e}})),this.degreeOfEducationType=Object.keys(uo).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_enum_gra_ins_"+e),value:e}})),this.formGroup=this.formBuilder.group({kinshipDependentDegreeType:this.formBuilder.control({value:null,disabled:!1},p.Validators.compose([p.Validators.required])),kinshipDegreeType:this.formBuilder.control({value:null,disabled:!1}),kinshipDegreeType2:this.formBuilder.control({value:null,disabled:!1}),raceType:this.formBuilder.control({value:null,disabled:!1}),maritalStatusType:this.formBuilder.control({value:null,disabled:!1}),religion:this.formBuilder.control({value:null,disabled:!1}),nacionality:this.formBuilder.control({value:null,disabled:!1}),degreeOfEducationType:this.formBuilder.control({value:null,disabled:!1}),number:this.formBuilder.control({value:null,disabled:!1},p.Validators.compose([p.Validators.maxLength(20),p.Validators.pattern(this.ONLY_NUMBERS_PATTERN)])),nameFiliation1:this.formBuilder.control({value:null,disabled:!1},p.Validators.maxLength(40)),nameFiliation2:this.formBuilder.control({value:null,disabled:!1},p.Validators.maxLength(40))})}return e.prototype.ngOnInit=function(){this.parentFormGroup.addControl("complementDependentPersonData",this.formGroup),this.subscribeEvents(),this.nacionalitySearchFields=this.getNacionalitySearchFields(),this.nacionalitySearchGridFields=this.getNacionalitySearchFields()},e.prototype.subscribeEvents=function(){var e=this;this.service.getDependentFormData().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){var n;e.formGroup.patchValue(null===(n=null==t?void 0:t.personDependentData)||void 0===n?void 0:n.complementDependentPersonData)}))},e.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},e.prototype.onNacionalityLookupRequest=function(e){var t=this,n=this.nacionalityLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getNacionalitySearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),i=this.nacionalityLookupDisplayFields;this.countryService.list({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.nacionalityLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),e[n]})).join(t.nacionalityLookupSeparator)})}))})}))).subscribe((function(e){t.nacionalityLookupSuggestions=e.contents}))},e.prototype.onNacionalitySearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getNacionalitySearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=this.nacionalityLookupDisplayFields;this.countryService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.nacionalityLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),e[n]})).join(t.nacionalityLookupSeparator)})}))})}))).subscribe((function(e){t.nacionalitySearchGridData=e.contents,t.nacionalitySearchTotalRecords=e.totalElements}))},e.prototype.getNacionalitySearchFields=function(){return[new l.FormField({name:"code",label:this.translateService.instant("hcm_contract.employment_contract.employee_dependent_nom_pes"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translateService.instant("hcm_contract.employment_contract.employee_dependent_cod_pes"),type:l.FieldType.String})]},e.ctorParameters=function(){return[{type:Eo},{type:a.TranslateService},{type:p.FormBuilder},{type:Rt}]},W([t.Input()],e.prototype,"parentFormGroup",void 0),e=W([t.Component({selector:"fnd-employee-dependent-complement-tab",template:'<div class="ui-g" [formGroup]="formGroup">\n \x3c!-- Grau de parentesco --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label for="kinshipDependentDegreeType">{{\n "hcm_contract.employment_contract.employee_dependent_kinship_degree_label" |\n translate\n }}</label>\n <p-dropdown\n inputId="kinshipDependentDegreeType"\n id="kinshipDependentDegreeType"\n name="kinshipDependentDegreeType"\n [options]="kinshipDegreeType"\n formControlName="kinshipDependentDegreeType"\n placeholder="{{\n \'hcm_contract.employment_contract.employee_dependent_kinship_degree_placeholder\'\n | translate}}">\n </p-dropdown>\n <s-control-errors\n id="er-kinshipDependentDegreeType"\n [control]="formGroup.get(\'kinshipDependentDegreeType\')"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate\n }">\n </s-control-errors>\n </div>\n \x3c!-- Contato --\x3e\n <div class="ui-md-6 ui-sm-12">\n <label id="lb-number" for="ff-number">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_phone_data_number\' | translate\n }}</label>\n <input id="ff-number" type="text" pInputText formControlName="number" autocomplete="off"/>\n <s-control-errors\n id="er-number"\n [control]="formGroup.get(\'number\')"\n [errorMessages]="{\n pattern: translateService.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_pattern_only_numbers\'),\n maxlength: translateService\n .instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'number\').errors?.maxlength?.requiredLength\n })\n }">\n </s-control-errors>\n </div>\n \x3c!-- Estado civil --\x3e\n <div id="dv-marital-status-type" class="ui-sm-12 ui-md-6 ui-lg-6">\n <label id="lb-marital-status-type" for="ff-maritalStatusType">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_marital_status_type\' | translate\n }}</label>\n <p-dropdown inputId="maritalStatusType" id="ff-maritalStatusType" name="maritalStatusType"\n [options]="maritalStatusType"\n formControlName="maritalStatusType"\n placeholder="{{\n \'hcm_contract.employment_contract.employee_dependent_marital_status_placeholder\'\n | translate}}">\n </p-dropdown>\n </div>\n \x3c!-- Nacionalidade --\x3e\n <div id="dv-nacionality" class="ui-sm-12 ui-md-6">\n <label id="lb-nacionality" for="ff-nacionality">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_nationality_id\'\n | translate }}\n </label>\n <s-lookup dataKey="id" id="ff-nacionality" name="nacionality" formControlName="nacionality"\n [searchFields]="nacionalitySearchFields" [searchGridFields]="nacionalitySearchGridFields"\n [searchGridData]="nacionalitySearchGridData" [multiple]="false"\n [lookupSuggestions]="nacionalityLookupSuggestions"\n (onLookupRequest)="onNacionalityLookupRequest($event)"\n (onSearchRequest)="onNacionalitySearchRequest($event)" lookupDisplayField="label"\n [searchTotalRecords]=nacionalitySearchTotalRecords\n [searchTitle]="\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_header\'\n | translate"\n [searchEmptyTitle]=\n "\'hcm_contract.employment_contract.admission_generic_lookup_empty_message\' | translate"\n [filterLabel]="\'hcm_contract.employment_contract.admission_generic_filter_label\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.admission_generic_filter_title\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.admission_generic_clear_label\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.admission_generic_btn_cancel_label\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.admission_generic_select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_contract.total_records\' | translate: {value: nacionalitySearchTotalRecords}">\n </s-lookup>\n </div>\n \x3c!-- Religião --\x3e\n <div id="dv-religion" class="ui-sm-12 ui-md-6">\n <label id="lb-religion" for="ff-religion">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_religion\' | translate\n }}</label>\n\n <input id="ff-religion" type="text" pInputText formControlName="religion" autocomplete="off" />\n </div>\n \x3c!-- Raça e Cor --\x3e\n <div id="dv-race-type" class="ui-sm-12 ui-md-6 ui-lg-6">\n <label id="lb-race-type" for="ff-race-type">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_race_type\' | translate\n }}</label>\n <p-dropdown inputId="raceType" id="ff-race-type" name="raceType"\n [options]="raceType"\n formControlName="raceType"\n placeholder=\n "{{\'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_race_type\' | translate}}">\n </p-dropdown>\n </div>\n \x3c!-- Grau de instrução --\x3e\n <div id="dv-degree-of-education-type" class="ui-sm-12 ui-md-12">\n <label id="lb-degree-of-education-type" for="ff-degree-of-education-type">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_degree_of_education_type\' | translate\n }}</label>\n <p-dropdown inputId="raceType" id="ff-degree-of-education-type" name="degree-of-education-type"\n [options]="degreeOfEducationType"\n formControlName="degreeOfEducationType"\n placeholder=\n "{{\'hcm_contract.employment_contract.admission_employee_person_complement_data_degree_of_education_type_placeholder\' | translate}}">\n </p-dropdown>\n </div>\n \x3c!-- Nome Filiação 1 --\x3e\n <div id="dv-nameFiliation1" class="ui-sm-12 ui-md-6">\n <label id="lb-nameFiliation1" for="ff-nameFiliation1">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_parent_name_1\' | translate\n }}</label>\n\n <input id="ff-nameFiliation1" type="text" pInputText formControlName="nameFiliation1" autocomplete="off"/>\n <s-control-errors\n id="er-parent-name-1"\n [control]="formGroup.get(\'nameFiliation1\')"\n [errorMessages]="{\n maxlength: translateService\n .instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'nameFiliation1\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n \x3c!-- Grau de parentesco 1 --\x3e\n <div class="ui-md-6 ui-sm-12">\n <label for="kinshipDegreeType">{{\n "hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_kinship_degree_type_1" |\n translate\n }}</label>\n <p-dropdown inputId="kinshipDegreeType" id="kinshipDegreeType" name="kinshipDegreeType"\n [options]="nameFiliation"\n formControlName="kinshipDegreeType"\n placeholder="{{\'hcm_contract.employment_contract.admission_employee_person_basic_data_kinship_degree_type_1_placeholder\' | translate}}">\n </p-dropdown>\n </div>\n \x3c!-- Nome Filiação 2 --\x3e\n <div id="dv-nameFiliation2" class="ui-sm-12 ui-md-6">\n <label id="lb-nameFiliation2" for="ff-nameFiliation2">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_parent_name_2\' | translate\n }}</label>\n\n <input id="ff-nameFiliation2" type="text" pInputText formControlName="nameFiliation2" autocomplete="off"/>\n <s-control-errors\n id="er-parent-name-2"\n [control]="formGroup.get(\'nameFiliation2\')"\n [errorMessages]="{\n maxlength: translateService\n .instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'nameFiliation2\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n \x3c!-- Grau de parentesco 2 --\x3e\n <div class="ui-md-6 ui-sm-12">\n <label for="kinshipDegreeType2">{{\n "hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_kinship_degree_type_2" |\n translate\n }}</label>\n <p-dropdown inputId="kinshipDegreeType2" id="kinshipDegreeType2" name="kinshipDegreeType2"\n [options]="nameFiliation"\n formControlName="kinshipDegreeType2"\n appendTo="body"\n placeholder="{{\'hcm_contract.employment_contract.admission_employee_person_basic_data_kinship_degree_type_2_placeholder\' | translate}}">\n </p-dropdown>\n </div>\n\n\n</div>\n'})],e)}();!function(e){e.BIRTH_CERTIFICATE="BIRTH_CERTIFICATE",e.WEDDING_CERTIFICATE="WEDDING_CERTIFICATE",e.INDIGENOUS_CERTIFICATE="INDIGENOUS_CERTIFICATE"}(Io||(Io={}));var Lo=function(){function e(e,t,n,o){var i=this;this.translate=e,this.route=t,this.service=n,this.stateService=o,this.stateLookupDisplayFields=["code","name"],this.stateLookupSeparator=" - ",this.civilCertificateType=Object.keys(Io).map((function(e){return{label:i.translate.instant("hcm_contract.employment_contract.employee_dependent_civil_certificate_type_"+e),value:e}})),this.ngUnsubscribe=new r.Subject,this.createFormGroup(),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){return i.onRouteDataChange(e)}))}return e.prototype.ngOnInit=function(){this.subscribeEvents(),this.parentFormGroup.addControl("documentDependentPersonData",this.formGroup),this.stateSearchFields=this.getStateSearchFields(),this.stateSearchGridFields=this.getStateSearchFields()},e.prototype.onRouteDataChange=function(e){this.localeConfig=e.localeConfig},e.prototype.subscribeEvents=function(){var e=this;this.service.getDependentFormData().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){var n;e.formGroup.patchValue(null===(n=null==t?void 0:t.personDependentData)||void 0===n?void 0:n.documentDependentPersonData),e.dependentId,e.enableTogglesWhenExistsData()})),this.service.getOpenSideBarAndStartForm().subscribe((function(t){e.dependentId=null==t?void 0:t.dependentId,Object.keys(e.formGroupToggle.controls).forEach((function(t){e.formGroupToggle.get(t).setValue(!1),e.disableFieldsByDocument(t,!1),e.formGroupToggle.get(t).enable()}))}))},e.prototype.enableTogglesWhenExistsData=function(){var e=this.formGroup.getRawValue();(null==e?void 0:e.civilCertificateRegisterNumber)&&(this.formGroupToggle.get("toggleCivilCertificate").setValue(!0),this.disableFieldsByDocument("toggleCivilCertificate"));(null==e?void 0:e.rgNumber)&&(this.formGroupToggle.get("toggleRg").setValue(!0),this.disableFieldsByDocument("toggleRg"));(null==e?void 0:e.deathCertificateRegisterNumber)&&(this.formGroupToggle.get("toggleDeath").setValue(!0),this.disableFieldsByDocument("toggleDeath"))},e.prototype.createFormGroup=function(){this.formGroupToggle=new p.FormGroup({toggleRg:new p.FormControl(null),toggleCivilCertificate:new p.FormControl(null),toggleDeath:new p.FormControl(null)}),this.formGroup=new p.FormGroup({rgNumber:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(13)),rgIssuer:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(6)),rgIssuerStateId:new p.FormControl({value:null,disabled:!0}),rgIssueDate:new p.FormControl({value:null,disabled:!0}),civilCertificateType:new p.FormControl({value:null,disabled:!0}),civilCertificateIssueDate:new p.FormControl({value:null,disabled:!0}),civilCertificateRegisterNumber:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(255)),civilCertificateTerm:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(255)),civilCertificateBook:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(255)),civilCertificatePage:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(255)),civilCertificateNotaryOffice:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(255)),civilCertificateStateId:new p.FormControl({value:null,disabled:!0}),deathCertificateIssueDate:new p.FormControl({value:null,disabled:!0}),deathCertificateRegisterNumber:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(40)),deathCertificateNumber:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(10))})},Object.defineProperty(e.prototype,"getDisableRg",{get:function(){return!this.formGroupToggle.get("toggleRg").value},enumerable:!0,configurable:!0}),e.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},e.prototype.onStateLookupRequest=function(e){var t=this,n=this.stateLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getStateSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),i=this.stateLookupDisplayFields;this.stateService.list({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.stateLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),e[n]})).join(t.stateLookupSeparator)})}))})}))).subscribe((function(e){t.stateLookupSuggestions=e.contents}))},e.prototype.onStateSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getStateSearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=this.stateLookupDisplayFields;this.stateService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.stateLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),e[n]})).join(t.stateLookupSeparator)})}))})}))).subscribe((function(e){t.stateSearchGridData=e.contents,t.stateSearchTotalRecords=e.totalElements}))},e.prototype.getStateSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_code_description"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_name_description"),type:l.FieldType.String})]},e.prototype.disableFieldsByDocument=function(e,t){switch(e){case"toggleRg":var n=t||this.formGroupToggle.get("toggleRg").value;ne(this.formGroup,n,["rgNumber","rgIssuer","rgIssuerStateId","rgIssueDate"]);break;case"toggleCivilCertificate":n=t||this.formGroupToggle.get("toggleCivilCertificate").value;ne(this.formGroup,n,["civilCertificateType","civilCertificateIssueDate","civilCertificateRegisterNumber","civilCertificateTerm","civilCertificateBook","civilCertificatePage","civilCertificateNotaryOffice","civilCertificateStateId"]);break;case"toggleDeath":n=t||this.formGroupToggle.get("toggleDeath").value;ne(this.formGroup,n,["deathCertificateIssueDate","deathCertificateRegisterNumber","deathCertificateNumber"])}},e.ctorParameters=function(){return[{type:a.TranslateService},{type:d.ActivatedRoute},{type:Rt},{type:Co}]},W([t.Input()],e.prototype,"parentFormGroup",void 0),e=W([t.Component({selector:"fnd-employee-dependent-document-tab",template:'<div class="ui-fluid" [formGroup]="formGroup">\n <p-fieldset>\n <p-header class="toggle-header-fieldset" [formGroup]="formGroupToggle">\n {{ \'hcm_contract.employment_contract.employee_dependent_document_rg_title\' | translate }}\n <div class="ui-inputgroup">\n <div class="input-switch-padding"></div>\n <span *ngIf="formGroupToggle.get(\'toggleRg\').value">\n {{ \'hcm_contract.employment_contract.yes\' | translate }}\n </span>\n <span\n *ngIf="!formGroupToggle.get(\'toggleRg\').value">{{ \'hcm_contract.employment_contract.no\' | translate }}</span>\n <p-inputSwitch id="toggleRg" formControlName="toggleRg" (onChange)="disableFieldsByDocument(\'toggleRg\')"></p-inputSwitch>\n </div>\n </p-header>\n <div class="ui-g">\n <div id="dv-rg-number" class="ui-sm-12 ui-md-4">\n <label id="lb-rg-number" for="ff-rg-number">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_number\' | translate\n }}</label>\n\n <input id="ff-rg-number" type="text" pInputText formControlName="rgNumber" autocomplete="off"/>\n\n <s-control-errors\n id="er-rg-number"\n [control]="formGroup.get(\'rgNumber\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'rgNumber\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Órgão emissor --\x3e\n <div id="dv-rg-issuer" class="ui-sm-12 ui-md-4">\n <label id="lb-rg-issuer" for="ff-rg-issuer">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer\' | translate\n }}</label>\n\n <input id="ff-rg-issuer" type="text" pInputText formControlName="rgIssuer" autocomplete="off"/>\n\n <s-control-errors\n id="er-rg-issuer"\n [control]="formGroup.get(\'rgIssuer\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'rgIssuer\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Estado emissor --\x3e\n <div id="dv-rg-issuer-state-id" class="ui-sm-12 ui-md-4">\n <label id="lb-rg-issuer-state-id" for="ff-rg-issuer-state-id">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_id\'\n | translate\n }}\n </label>\n <s-lookup dataKey="id" id="ff-rg-issuer-state-id" name="rgIssuerStateId"\n formControlName="rgIssuerStateId"\n [searchFields]="stateSearchFields" [searchGridFields]="stateSearchFields"\n [searchGridData]="stateSearchGridData" [multiple]="false"\n [lookupSuggestions]="stateLookupSuggestions"\n (onLookupRequest)="onStateLookupRequest($event)"\n (onSearchRequest)="onStateSearchRequest($event)"\n lookupDisplayField="label"\n [lookupEmptyMessage]="\'hcm_contract.employment_contract.admission_generic_lookup_empty_message\' | translate"\n [searchTotalRecords]="stateSearchTotalRecords"\n [searchTitle]="\'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_id_lookup_tittle\' | translate"\n [searchEmptyTitle]="\'hcm_contract.employment_contract.admission_generic_lookup_empty_message\' | translate"\n [filterLabel]="\'hcm_contract.employment_contract.admission_generic_filter_label\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.admission_generic_filter_title\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.admission_generic_clear_label\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.admission_generic_btn_cancel_label\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.admission_generic_select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_contract.total_records\' | translate: {value: stateSearchTotalRecords}"\n [emptyFieldLabel]="\'hcm_contract.employment_contract.admission_generic_empty_field\' | translate">\n </s-lookup>\n </div>\n\n \x3c!-- Data de emissão --\x3e\n <div id="dv-rg-issue-date" class="ui-sm-12 ui-md-4">\n <label id="lb-rg-issue-date" for="ff-rg-issue-date">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issue_date\' | translate\n }}</label>\n\n <p-calendar\n id="ff-rg-issue-date"\n name="rgIssueDate"\n formControlName="rgIssueDate"\n [dateFormat]="localeConfig?.calendar?.dateFormat"\n [locale]="localeConfig?.calendar"\n [showIcon]="true"\n icon="fa fa-calendar"\n sCalendarMask\n ></p-calendar>\n </div>\n </div>\n </p-fieldset>\n <p-fieldset>\n <p-header class="toggle-header-fieldset" [formGroup]="formGroupToggle">\n {{ \'hcm_contract.employment_contract.employee_dependent_document_civil_certificate_title\' | translate }}\n <div class="ui-inputgroup">\n <div class="input-switch-padding"></div>\n <span\n *ngIf="formGroupToggle.get(\'toggleCivilCertificate\').value">{{ \'hcm_contract.employment_contract.yes\' | translate }}</span>\n <span\n *ngIf="!formGroupToggle.get(\'toggleCivilCertificate\').value">{{ \'hcm_contract.employment_contract.no\' | translate }}</span>\n <p-inputSwitch id="toggleCivilCertificate" formControlName="toggleCivilCertificate" (onChange)="disableFieldsByDocument(\'toggleCivilCertificate\')"></p-inputSwitch>\n </div>\n </p-header>\n <div class="ui-g">\n\n \x3c!-- Tipo de certificado civil --\x3e\n <div id="dv-civil-certificate-type" class="ui-sm-12 ui-md-6 ui-lg-6">\n <label id="lb-civil-certificate-type" for="ff-civilCertificateType">{{\n \'hcm_contract.employment_contract.employee_dependent_civil_certificate_type_placeholder\'\n | translate\n }}</label>\n <p-dropdown inputId="civilCertificateType" id="ff-civilCertificateType" name="maritalStatusType"\n [options]="civilCertificateType"\n formControlName="civilCertificateType"\n placeholder="{{\'hcm_contract.employment_contract.employee_dependent_civil_certificate_type_placeholder\' | translate}}">\n </p-dropdown>\n </div>\n \n \x3c!-- Data de emissão da certidão nascimento --\x3e\n <div id="dv-civil-certificate-issue-date" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-issue-date" for="ff-civil-certificate-issue-date">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_issue_date\' | translate\n }}</label>\n <p-calendar\n id="ff-civil-certificate-issue-date"\n name="civilCertificateIssueDate"\n formControlName="civilCertificateIssueDate"\n [dateFormat]="localeConfig?.calendar.dateFormat"\n [locale]="localeConfig?.calendar"\n [showIcon]="true"\n icon="fa fa-calendar"\n sCalendarMask\n ></p-calendar>\n </div>\n\n \x3c!-- Matrícula da certidão nascimento --\x3e\n <div id="dv-civil-certificate-register-number" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-register-number" for="ff-civil-certificate-register-number">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_register_number\'\n | translate\n }}</label>\n <input\n id="ff-civil-certificate-register-number"\n type="text"\n pInputText\n formControlName="civilCertificateRegisterNumber"\n autocomplete="off"\n />\n <s-control-errors\n id="er-civil-certificate-register-number"\n [control]="formGroup.get(\'civilCertificateRegisterNumber\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'civilCertificateRegisterNumber\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Termo da certidão nascimento --\x3e\n <div id="dv-civil-certificate-term" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-term" for="ff-civil-certificate-term">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_term\' | translate\n }}</label>\n <input id="ff-civil-certificate-term" type="text" pInputText formControlName="civilCertificateTerm"\n autocomplete="off"/>\n <s-control-errors\n id="er-civil-certificate-term"\n [control]="formGroup.get(\'civilCertificateTerm\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'civilCertificateTerm\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Livro da certidão nascimento --\x3e\n <div id="dv-civil-certificate-book" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-book" for="ff-civil-certificate-book">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_book\' | translate\n }}</label>\n <input id="ff-civil-certificate-book" type="text" pInputText formControlName="civilCertificateBook"\n autocomplete="off"/>\n <s-control-errors\n id="er-civil-certificate-book"\n [control]="formGroup.get(\'civilCertificateBook\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'civilCertificateBook\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Folha da certidão nascimento --\x3e\n <div id="dv-civil-certificate-page" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-page" for="ff-civil-certificate-page">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_page\' | translate\n }}</label>\n <input id="ff-civil-certificate-page" type="text" pInputText formControlName="civilCertificatePage"\n autocomplete="off"/>\n <s-control-errors\n id="er-civil-certificate-page"\n [control]="formGroup.get(\'civilCertificatePage\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'civilCertificatePage\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Cartório da certidão nascimento --\x3e\n <div id="dv-civil-certificate-notary-office" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-notary-office" for="ff-civil-certificate-notary-office">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_notary_office\' | translate\n }}</label>\n <input\n id="ff-civil-certificate-notary-office"\n type="text"\n pInputText\n formControlName="civilCertificateNotaryOffice"\n autocomplete="off"\n />\n <s-control-errors\n id="er-civil-certificate-notary-office"\n [control]="formGroup.get(\'civilCertificateNotaryOffice\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'civilCertificateNotaryOffice\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Estado de emissão da certidão nascimento --\x3e\n <div id="dv-civil-certificate-state-id" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-state-id" for="ff-civil-certificate-state-id"\n >{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_state_id\' | translate\n }}\n </label>\n\n <s-lookup dataKey="id" id="ff-civil-certificate-state-id" name="civilCertificateStateId"\n formControlName="civilCertificateStateId"\n [searchFields]="stateSearchFields" [searchGridFields]="stateSearchFields"\n [searchGridData]="stateSearchGridData" [multiple]="false"\n [lookupSuggestions]="stateLookupSuggestions"\n (onLookupRequest)="onStateLookupRequest($event)"\n (onSearchRequest)="onStateSearchRequest($event)"\n lookupDisplayField="label"\n [lookupEmptyMessage]="\'hcm_contract.employment_contract.admission_generic_lookup_empty_message\' | translate"\n [searchTotalRecords]="stateSearchTotalRecords"\n [searchTitle]="\'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_id_lookup_tittle\' | translate"\n [searchEmptyTitle]="\'hcm_contract.employment_contract.admission_generic_lookup_empty_message\' | translate"\n [filterLabel]="\'hcm_contract.employment_contract.admission_generic_filter_label\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.admission_generic_filter_title\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.admission_generic_clear_label\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.admission_generic_btn_cancel_label\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.admission_generic_select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_contract.total_records\' | translate: {value: stateSearchTotalRecords}"\n [emptyFieldLabel]="\'hcm_contract.employment_contract.admission_generic_empty_field\' | translate">\n </s-lookup>\n </div>\n </div>\n </p-fieldset>\n <p-fieldset>\n <p-header class="toggle-header-fieldset" [formGroup]="formGroupToggle">\n {{ \'hcm_contract.employment_contract.employee_dependent_document_certificate_death_title\' | translate }}\n <div class="ui-inputgroup">\n <div class="input-switch-padding"></div>\n <span\n *ngIf="formGroupToggle.get(\'toggleDeath\').value">{{ \'hcm_contract.employment_contract.yes\' | translate }}</span>\n <span\n *ngIf="!formGroupToggle.get(\'toggleDeath\').value">{{ \'hcm_contract.employment_contract.no\' | translate }}</span>\n <p-inputSwitch\n id="toggleDeath"\n formControlName="toggleDeath"\n (onChange)="disableFieldsByDocument(\'toggleDeath\')">\n </p-inputSwitch>\n </div>\n </p-header>\n <div class="ui-g">\n \x3c!--- Data da certidão de óbito--\x3e\n <div class="ui-md-4 ui-sm-12">\n <label id="lb-death-date"\n for="ff-death-date">{{ \'hcm_contract.employment_contract.employee_dependent_death_date\' | translate }}</label>\n <p-calendar\n id="ff-death-date"\n name="deathCertificateIssueDate"\n formControlName="deathCertificateIssueDate"\n [dateFormat]="localeConfig?.calendar.dateFormat"\n [locale]="localeConfig?.calendar"\n [showIcon]="true"\n icon="fa fa-calendar"\n sCalendarMask\n ></p-calendar>\n </div>\n \x3c!--- Matricula da certidão de óbito--\x3e\n <div class="ui-md-4 ui-sm-12">\n <label id="lb-death-certificate-registry"\n for="ff-death-certificate-registry">{{ \'hcm_contract.employment_contract.employee_dependent_death_certificate_register\' | translate }}</label>\n <input pInputText id="ff-death-certificate-registry" formControlName="deathCertificateRegisterNumber">\n <s-control-errors\n id="er-death-certificate-registry"\n [control]="formGroup.get(\'deathCertificateRegisterNumber\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'deathCertificateRegisterNumber\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n \x3c!--Nº certidão de óbito--\x3e\n <div class="ui-md-4 ui-sm-12">\n <label id="lb-death-certificate-number"\n for="ff-death-certificate-registry">{{ \'hcm_contract.employment_contract.employee_dependent_death_certificate_number\' | translate }}</label>\n <input pInputText id="ff-death-certificate-number" formControlName="deathCertificateNumber">\n <s-control-errors\n id="er-death-certificate-number"\n [control]="formGroup.get(\'deathCertificateNumber\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'deathCertificateNumber\').errors?.maxlength?.requiredLength})\n }"\n ></s-control-errors>\n </div>\n </div>\n </p-fieldset>\n</div>\n',styles:[".tab-view-full{width:100%}.toggle-header-fieldset{display:flex!important;justify-content:space-between!important;align-items:center!important}.toggle-header-fieldset .ui-inputgroup span{margin-right:8px!important;font-size:14px;font-weight:400;line-height:21px;text-align:left;text-underline-position:from-font;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}.footer-sidebar-form-dependent{display:flex;justify-content:space-between}.message-warn-admisison{padding-left:65px;font-size:14px}.message-warn-admisison p:first-of-type{font-weight:700}.btn-next>button{display:flex!important;flex-direction:row-reverse!important}.btn-next>button span{margin-left:5px!important}"]})],e)}(),Ao=function(){function e(){}return e.fromDto=function(e){var t=(null==e?void 0:e.data)&&JSON.parse(e.data);return{draftId:null==e?void 0:e.id,basicDependentPersonData:t.basicDependentPersonData?this.normalizeDraft(t.basicDependentPersonData):{},documentDependentPersonData:t.documentDependentPersonData?this.normalizeDraft(t.documentDependentPersonData):{},complementDependentPersonData:t.complementDependentPersonData?this.normalizeDraft(t.complementDependentPersonData):{}}},e.toDto=function(e,t,n){var o,i,a={};return a.personName=null===(o=null==e?void 0:e.basicDependentPersonData)||void 0===o?void 0:o.fullName,a.kinshipDegreeType=null===(i=null==e?void 0:e.complementDependentPersonData)||void 0===i?void 0:i.kinshipDependentDegreeType,a.employee=t?{id:t}:null,a.admissionDraft=n?{id:n}:null,a.createdDate=a.createdDate&&c(a.createdDate).format(),a.lastModifiedDate=a.lastModifiedDate&&c(a.lastModifiedDate).format(),a.data=JSON.stringify({basicDependentPersonData:e.basicDependentPersonData,documentDependentPersonData:e.documentDependentPersonData,complementDependentPersonData:e.complementDependentPersonData}),a},e.normalizeDraft=function(e){var t=this;return e&&"object"==typeof e?(Object.keys(e).forEach((function(n){var o=e[n];if(""!==o)if("string"==typeof o&&/^\d{4}-\d{2}-\d{2}$/.test(o)){var i=new Date(o+"T00:00:00");e[n]=isNaN(i.getTime())?null:i}else if("string"==typeof o&&/^\d{4}-\d{2}-\d{2}T/.test(o)){i=new Date(o);e[n]=isNaN(i.getTime())?null:i}else o&&"object"==typeof o&&t.normalizeDraft(o);else e[n]=null})),e):e},e}();function wo(e,t){return void 0===t&&(t="DD/MM/YYYY"),c(e,t).toDate()}var Po,Mo=function(){function e(e,t,n,o,i,a,s,l){this.translateService=e,this.employeeDependentService=t,this.sUrlService=n,this.focusService=o,this.dependentDraftService=i,this.route=a,this.confirmationService=s,this.messageService=l,this.loading=!1,this.showSideBar=!1,this.buttonLabel=this.translateService.instant("hcm_contract.employment_contract.employee_dependent_button_next"),this.formGroup=new p.FormGroup({draftId:new p.FormControl(null)}),this.ngUnsubscribe=new r.Subject,this.createSteps()}return e.prototype.ngOnInit=function(){var e=this;this.subscribeEvents(),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.onRouteDataChange=function(e){this.localeConfig=e.localeConfig,this.dateFormat=dn.getDateFormatFromCalendar(e.localeConfig.calendar)},e.prototype.undoStep=function(){if(1===this.activeIndex)this.buttonLabel=this.translateService.instant("hcm_contract.employment_contract.employee_dependent_button_next");else if(0===this.activeIndex)return;this.activeIndex--},e.prototype.nextStep=function(){if(0===this.activeIndex){var e=this.formGroup.get("basicDependentPersonData");if(this.validateAllFormFields(e),!e.valid&&!this.dependentId)return this.steps[1].disabled=!0,this.messageService.add({severity:"error",summary:this.translateService.instant("hcm_contract.employment_contract.error"),detail:this.translateService.instant("hcm_contract.employment_contract.admission_generic_invalid_form_group")});this.steps[1].disabled=!1,this.buttonLabel=this.translateService.instant("hcm_contract.employment_contract.admission_employee_form_btn_step_last"),this.activeIndex++}else if(1===this.activeIndex){if(this.validateAllFormFields(this.formGroup),!this.formGroup.valid){var t=this.requiredFieldsStep1?this.translateService.instant("hcm_contract.employment_contract.admission_generic_invalid_form_group_step_1"):this.translateService.instant("hcm_contract.employment_contract.admission_generic_invalid_form_group");return this.messageService.add({severity:"error",summary:this.translateService.instant("hcm_contract.employment_contract.error"),detail:t})}this.dependentId?this.onBeforeSave():this.onSaveDependent()}},e.prototype.isNew=function(){return!this.dependentId},e.prototype.isNewToLabel=function(){return this.isNew()?"create":"edit"},e.prototype.onStepSelected=function(e){if(0===e.index){var t=this.formGroup.get("complementDependentPersonData");if(!t.valid&&!this.dependentId)return void this.validateAllFormFields(t);this.buttonLabel=this.translateService.instant("hcm_contract.employment_contract.employee_dependent_button_next")}if(1===e.index){var n=this.formGroup.get("basicDependentPersonData");if(!n.valid&&!this.dependentId)return void this.validateAllFormFields(n)}this.activeIndex=e.index},e.prototype.onCancel=function(){this.showSideBar=!1},e.prototype.saveDependentDraft=function(){var e=this;pe(this.formGroup,["basicDependentPersonData.fullName","complementDependentPersonData.kinshipDependentDegreeType"]);var t=this.formGroup.get("basicDependentPersonData.fullName"),n=this.formGroup.get("complementDependentPersonData.kinshipDependentDegreeType");if((0!==this.activeIndex||t.valid)&&(1!==this.activeIndex||n.valid)){if(t.valid&&0===this.activeIndex)return this.buttonLabel=this.translateService.instant("hcm_contract.employment_contract.admission_employee_form_btn_step_last"),this.activeIndex++;this.loading=!0,this.getSaveObservable().pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){e.formGroup.get("draftId").setValue(null==t?void 0:t.id),e.messageService.add({severity:"success",summary:e.translateService.instant("hcm_contract.employment_contract.admission_generic_toast_success"),detail:e.translateService.instant("hcm_contract.employment_contract.admission_draft_employee_form_save_sucess")}),e.showSideBar=!1,e.closeSideBar.emit(!0)}))}},e.prototype.subscribeEvents=function(){var e=this;this.employeeDependentService.getOpenSideBarAndStartForm().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.activeIndex=0,e.buttonLabel=e.translateService.instant("hcm_contract.employment_contract.employee_dependent_button_next"),e.dependentId=null==t?void 0:t.dependentId,e.personId=null==t?void 0:t.personId,e.formGroup.reset(),(null==t?void 0:t.dependentId)||t.dependentDraftId?(null==t?void 0:t.personId)&&!t.dependentDraftId?(e.personRetrieveInformation(),e.steps[0].disabled=!1,e.steps[1].disabled=!1):(null==t?void 0:t.dependentDraftId)&&e.loadDraft(t.dependentDraftId):(e.steps[1].disabled=!0,e.formGroup.enable(),t.personId&&e.personRetrieveInformation()),e.showSideBar=!0})),this.onSaveByListDraft()},e.prototype.createSteps=function(){var e={id:"personal-data-step",label:this.translateService.instant("hcm_contract.employment_contract.employee_dependent_sidebar_step_personal_data"),disabled:!1,state:l.StepState.Default},t={id:"personal-data-step",label:this.translateService.instant("hcm_contract.employment_contract.employee_dependent_sidebar_step_complement_data"),disabled:!this.personId,state:l.StepState.Default};this.translateService.instant("hcm_contract.employment_contract.employee_dependent_sidebar_step_payroll_data"),l.StepState.Default;this.steps=[e,t],this.activeIndex=0},e.prototype.personRetrieveInformation=function(){var e=this;this.loading=!0,this.employeeDependentService.personRetrieve({id:this.personId}).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){var n=function(e,t,n){var o,i,a,r,s,l,p,d,m,u,h,y,f,_,v,g,b,S,D,T,F,E,C,k,I,R,L,A,w,P,M,G,V,N,x,O,B,H,q,U,j,Y,W,Q,X,K,$,J=z({},e);return{employee:{id:t},personDependentData:{basicDependentPersonData:{cpf:J.personalData.cpf||null,fullName:J.basicData.fullName,nickname:J.basicData.nickname||null,genderType:J.basicData.genderType,birthDate:(null===(o=J.basicData)||void 0===o?void 0:o.birthDate)&&c(null===(i=J.basicData)||void 0===i?void 0:i.birthDate).format(n),email:Array.isArray(null===(a=J.emailData)||void 0===a?void 0:a.email)?J.emailData.email.join(", "):(null===(r=J.emailData)||void 0===r?void 0:r.email)||null},complementDependentPersonData:{kinshipDependentDegreeType:(null===(s=null==J?void 0:J.basicData)||void 0===s?void 0:s.kinshipDependentDegreeType)||null,kinshipDegreeType:J.basicData.kinshipDegreeType1,kinshipDegreeType2:J.basicData.kinshipDegreeType2,maritalStatusType:(null===(l=J.complementData)||void 0===l?void 0:l.maritalStatusType)||null,religion:(null===(p=J.complementData)||void 0===p?void 0:p.religion)||null,number:(null===(d=J.phoneData)||void 0===d?void 0:d.number)||null,raceType:(null===(m=J.complementData)||void 0===m?void 0:m.raceType)||null,degreeOfEducationType:(null===(u=J.complementData)||void 0===u?void 0:u.degreeOfEducationType)||null,nameFiliation1:J.basicData.parentName1||null,nameFiliation2:J.basicData.parentName2||null,nacionality:(null===(h=null==J?void 0:J.complementData)||void 0===h?void 0:h.nationality)?z(z({},null===(y=null==J?void 0:J.complementData)||void 0===y?void 0:y.nationality),{id:null===(_=null===(f=null==J?void 0:J.complementData)||void 0===f?void 0:f.nationality)||void 0===_?void 0:_.countryId,label:(null===(g=null===(v=null==J?void 0:J.complementData)||void 0===v?void 0:v.nationality)||void 0===g?void 0:g.countryCode)+" - "+(null===(S=null===(b=null==J?void 0:J.complementData)||void 0===b?void 0:b.nationality)||void 0===S?void 0:S.countryName)}):{}},documentDependentPersonData:{rgNumber:(null===(D=J.nationalityData)||void 0===D?void 0:D.rgNumber)||null,rgIssuer:(null===(T=J.nationalityData)||void 0===T?void 0:T.rgIssuer)||null,rgIssuerStateId:(null===(F=J.nationalityData)||void 0===F?void 0:F.rgIssuerState)?z(z({},null===(C=null===(E=J.nationalityData)||void 0===E?void 0:E.rgIssuerState)||void 0===C?void 0:C.value),{id:null===(I=null===(k=J.nationalityData)||void 0===k?void 0:k.rgIssuerState)||void 0===I?void 0:I.key,label:null===(L=null===(R=J.nationalityData)||void 0===R?void 0:R.rgIssuerState)||void 0===L?void 0:L.value}):{},rgIssueDate:(null===(A=J.nationalityData)||void 0===A?void 0:A.rgIssueDate)&&c(null===(w=J.nationalityData)||void 0===w?void 0:w.rgIssueDate).format("L"),civilCertificateType:(null===(P=J.additionalData)||void 0===P?void 0:P.civilCertificateType)||"",civilCertificateIssueDate:(null===(M=J.additionalData)||void 0===M?void 0:M.civilCertificateIssueDate)&&c(null===(G=J.additionalData)||void 0===G?void 0:G.civilCertificateIssueDate).format("L"),civilCertificateRegisterNumber:(null===(V=J.additionalData)||void 0===V?void 0:V.civilCertificateRegisterNumber)||"",civilCertificateTerm:(null===(N=J.additionalData)||void 0===N?void 0:N.civilCertificateTerm)||"",civilCertificateBook:(null===(x=J.additionalData)||void 0===x?void 0:x.civilCertificateBook)||"",civilCertificatePage:(null===(O=J.additionalData)||void 0===O?void 0:O.civilCertificatePage)||"",civilCertificateNotaryOffice:(null===(B=J.additionalData)||void 0===B?void 0:B.civilCertificateNotaryOffice)||"",civilCertificateStateId:(null===(H=J.additionalData)||void 0===H?void 0:H.civilCertificateState)?z(z({},null===(q=J.additionalData)||void 0===q?void 0:q.civilCertificateState),{id:null===(j=null===(U=J.additionalData)||void 0===U?void 0:U.civilCertificateState)||void 0===j?void 0:j.key,label:null===(W=null===(Y=J.additionalData)||void 0===Y?void 0:Y.civilCertificateState)||void 0===W?void 0:W.value}):{},deathCertificateIssueDate:(null===(Q=J.additionalData)||void 0===Q?void 0:Q.deathCertificateIssueDate)&&c(null===(X=J.additionalData)||void 0===X?void 0:X.deathCertificateIssueDate).format("L"),deathCertificateRegisterNumber:(null===(K=J.additionalData)||void 0===K?void 0:K.deathCertificateRegisterNumber)||"",deathCertificateNumber:(null===($=J.additionalData)||void 0===$?void 0:$.deathCertificateNumber)||""}}}}(t,e.employeeId,e.dateFormat);e.loadedDependent=z({},n),e.employeeDependentService.setDependentFormData(n)}))},e.prototype.onSaveDependent=function(){var e=this;this.loading=!0;var t,n,o,i,a,r,l,p,d,m,u,h,y,f,_,v,g,b,S,D,T,F,E,C,k,I,R,L,A,w,P,M,G,V,N,x,O,B,H,q,U,j,Y,z,W,Q,X,K,$,J=(t=this.formGroup.getRawValue(),n=this.employeeId,o=this.dependentId,i=this.personId,a=this.dateFormat,{id:o,employee:{id:n},personDependentData:{basicDependentPersonData:{personId:i||null,cpf:(null===(r=null==t?void 0:t.basicDependentPersonData)||void 0===r?void 0:r.cpf)||"",fullName:(null===(l=null==t?void 0:t.basicDependentPersonData)||void 0===l?void 0:l.fullName)||"",nickname:(null===(p=null==t?void 0:t.basicDependentPersonData)||void 0===p?void 0:p.nickname)||"",genderType:(null===(d=null==t?void 0:t.basicDependentPersonData)||void 0===d?void 0:d.genderType)||null,birthDate:(null===(m=null==t?void 0:t.basicDependentPersonData)||void 0===m?void 0:m.birthDate)?c(wo(null===(u=null==t?void 0:t.basicDependentPersonData)||void 0===u?void 0:u.birthDate,a)).format("YYYY-MM-DD"):null,email:Array.isArray(null===(h=null==t?void 0:t.basicDependentPersonData)||void 0===h?void 0:h.email)?t.basicDependentPersonData.email.join(", "):(null===(y=null==t?void 0:t.basicDependentPersonData)||void 0===y?void 0:y.email)||"",kinshipDependentDegreeType:(null===(f=null==t?void 0:t.complementDependentPersonData)||void 0===f?void 0:f.kinshipDependentDegreeType)||null,kinshipDegreeType:(null===(_=null==t?void 0:t.complementDependentPersonData)||void 0===_?void 0:_.kinshipDegreeType)||null,kinshipDegreeType2:(null===(v=null==t?void 0:t.complementDependentPersonData)||void 0===v?void 0:v.kinshipDegreeType2)||null,maritalStatusType:(null===(g=null==t?void 0:t.complementDependentPersonData)||void 0===g?void 0:g.maritalStatusType)||null,religion:(null===(b=null==t?void 0:t.complementDependentPersonData)||void 0===b?void 0:b.religion)||"",number:(null===(S=null==t?void 0:t.complementDependentPersonData)||void 0===S?void 0:S.number)||"",raceType:(null===(D=null==t?void 0:t.complementDependentPersonData)||void 0===D?void 0:D.raceType)||null,degreeOfEducationType:(null===(T=null==t?void 0:t.complementDependentPersonData)||void 0===T?void 0:T.degreeOfEducationType)||null,nameFiliation1:(null===(F=null==t?void 0:t.complementDependentPersonData)||void 0===F?void 0:F.nameFiliation1)||"",nameFiliation2:(null===(E=null==t?void 0:t.complementDependentPersonData)||void 0===E?void 0:E.nameFiliation2)||"",nacionality:(null===(k=null===(C=null==t?void 0:t.complementDependentPersonData)||void 0===C?void 0:C.nacionality)||void 0===k?void 0:k.id)||null},documentDependentPersonData:{rgNumber:(null===(I=null==t?void 0:t.documentDependentPersonData)||void 0===I?void 0:I.rgNumber)||"",rgIssuer:(null===(R=null==t?void 0:t.documentDependentPersonData)||void 0===R?void 0:R.rgIssuer)||"",rgIssuerStateId:(null===(A=null===(L=null==t?void 0:t.documentDependentPersonData)||void 0===L?void 0:L.rgIssuerStateId)||void 0===A?void 0:A.id)||(null===(P=null===(w=null==t?void 0:t.documentDependentPersonData)||void 0===w?void 0:w.rgIssuerStateId)||void 0===P?void 0:P.key)||null,rgIssueDate:(null===(M=null==t?void 0:t.documentDependentPersonData)||void 0===M?void 0:M.rgIssueDate)?c(wo(null===(G=null==t?void 0:t.documentDependentPersonData)||void 0===G?void 0:G.rgIssueDate,a)).format("YYYY-MM-DD"):null,civilCertificateType:(null===(V=null==t?void 0:t.documentDependentPersonData)||void 0===V?void 0:V.civilCertificateType)||null,civilCertificateIssueDate:(null===(N=null==t?void 0:t.documentDependentPersonData)||void 0===N?void 0:N.civilCertificateIssueDate)?c(wo(null===(x=null==t?void 0:t.documentDependentPersonData)||void 0===x?void 0:x.civilCertificateIssueDate,a)).format("YYYY-MM-DD"):null,civilCertificateRegisterNumber:(null===(O=null==t?void 0:t.documentDependentPersonData)||void 0===O?void 0:O.civilCertificateRegisterNumber)||"",civilCertificateTerm:(null===(B=null==t?void 0:t.documentDependentPersonData)||void 0===B?void 0:B.civilCertificateTerm)||"",civilCertificateBook:(null===(H=null==t?void 0:t.documentDependentPersonData)||void 0===H?void 0:H.civilCertificateBook)||"",civilCertificatePage:(null===(q=null==t?void 0:t.documentDependentPersonData)||void 0===q?void 0:q.civilCertificatePage)||"",civilCertificateNotaryOffice:(null===(U=null==t?void 0:t.documentDependentPersonData)||void 0===U?void 0:U.civilCertificateNotaryOffice)||"",civilCertificateStateId:(null===(Y=null===(j=null==t?void 0:t.documentDependentPersonData)||void 0===j?void 0:j.civilCertificateStateId)||void 0===Y?void 0:Y.id)||(null===(W=null===(z=null==t?void 0:t.documentDependentPersonData)||void 0===z?void 0:z.civilCertificateStateId)||void 0===W?void 0:W.key)||null,deathCertificateIssueDate:(null===(Q=null==t?void 0:t.documentDependentPersonData)||void 0===Q?void 0:Q.deathCertificateIssueDate)?c(wo(null===(X=null==t?void 0:t.documentDependentPersonData)||void 0===X?void 0:X.deathCertificateIssueDate,a)).format("YYYY-MM-DD"):null,deathCertificateRegisterNumber:(null===(K=null==t?void 0:t.documentDependentPersonData)||void 0===K?void 0:K.deathCertificateRegisterNumber)||"",deathCertificateNumber:(null===($=null==t?void 0:t.documentDependentPersonData)||void 0===$?void 0:$.deathCertificateNumber)||""}}});this.employeeDependentService.employeeDpendentSave(J).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){e.loading=!1}))).subscribe((function(t){var n,o=null===(n=e.formGroup.get("draftId"))||void 0===n?void 0:n.value;(null==t?void 0:t.id)&&(e.addMessageSucess(),e.showSideBar=!1,e.closeSideBar.emit(!0),o&&e.deleteDraft(o))}))},e.prototype.deleteDraft=function(e){var t=this;this.loading=!0,this.dependentDraftService.delete(e).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){t.loading=!1}))).subscribe((function(){t.closeSideBar.emit(!0)}))},e.prototype.addMessageSucess=function(){this.messageService.add({severity:"success",summary:this.translateService.instant("hcm_contract.employment_contract.success_tooltip"),detail:this.translateService.instant("hcm_contract.employment_contract.employee_dependent_save_success")})},e.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)})),this.focusService.focusFirstInvalidInput()},e.prototype.requiredFieldsStep1=function(){var e,t,n,o;return(null===(e=this.formGroup.get("basicDependentPersonData.fullName"))||void 0===e?void 0:e.value)&&(null===(t=this.formGroup.get("basicDependentPersonData.birthDate"))||void 0===t?void 0:t.value)&&(null===(n=this.formGroup.get("basicDependentPersonData.genderType"))||void 0===n?void 0:n.value)&&(null===(o=this.formGroup.get("basicDependentPersonData.cpf"))||void 0===o?void 0:o.value)},e.prototype.isFormChanged=function(e,t){if(!(null==e?void 0:e.personDependentData)||!t)return!1;return["basicDependentPersonData","complementDependentPersonData","documentDependentPersonData"].some((function(n){return Object.keys(e.personDependentData[n]||{}).some((function(o){var i,a,r;return(null!==(i=e.personDependentData[n][o])&&void 0!==i?i:"")!==(null!==(r=null===(a=t[n])||void 0===a?void 0:a[o])&&void 0!==r?r:"")}))}))},e.prototype.onBeforeSave=function(){var e=this;if(!this.formGroup.dirty||!this.isFormChanged(this.loadedDependent,this.formGroup.getRawValue()))return this.closeSidebarWithSuccess();var t=this.translateService.instant("hcm_contract.employment_contract.admission_employee_form_dialog_text_person")+"\n"+this.translateService.instant("hcm_contract.employment_contract.admission_employee_form_dialog_confirmation");this.confirmationService.confirm({message:t,key:"edit-dependent",rejectLabel:this.translateService.instant("hcm_contract.employment_contract.admission_generic_no"),acceptLabel:this.translateService.instant("hcm_contract.employment_contract.admission_generic_yes"),header:this.translateService.instant("hcm_contract.employment_contract.admission_employee_form_dialog_title"),accept:function(){return e.onSaveDependent()}})},e.prototype.closeSidebarWithSuccess=function(){this.showSideBar=!1,this.closeSideBar.emit(!0),this.addMessageSucess()},e.prototype.loadDraft=function(e){var t=this;this.loading=!0,this.dependentDraftService.get(e).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){t.loading=!1}))).subscribe((function(n){var o,i=Ao.fromDto(n);t.formGroup.patchValue(i),null===(o=t.formGroup.get("draftId"))||void 0===o||o.setValue(e)}))},e.prototype.getSaveObservable=function(){var e,t=this.formGroup.getRawValue(),n=Ao.toDto(t,this.employeeId,this.admissionDraft),o=null===(e=this.formGroup.get("draftId"))||void 0===e?void 0:e.value;return o?this.dependentDraftService.update(o,n):this.dependentDraftService.insert(n)},e.prototype.onSaveByListDraft=function(){var e=this;this.dependentDraftService.saveDraftEvent.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){if(t){e.loading=!0;var n=Ao.fromDto(t);e.formGroup.patchValue(n),e.onSaveDependent()}}))},e.ctorParameters=function(){return[{type:a.TranslateService},{type:Rt},{type:q.SUrlService},{type:_n},{type:Fo},{type:d.ActivatedRoute},{type:i.ConfirmationService},{type:i.MessageService}]},W([t.Input()],e.prototype,"employeeId",void 0),W([t.Input()],e.prototype,"admissionDraft",void 0),W([t.Input()],e.prototype,"closeSideBar",void 0),e=W([t.Component({selector:"fnd-employee-dependent-form",template:'<s-loading-state [loading]="loading" blockWindow="true"></s-loading-state>\n<s-sidebar [visible]="showSideBar"\n (visibleChange)="showSideBar = !showSideBar"\n [header]="\'hcm_contract.employment_contract.employee_dependent_sidebar_title_\' + isNewToLabel() | translate">\n\n <s-steps [steps]="steps" [activeIndex]="activeIndex" (stepSelected)="onStepSelected($event)"></s-steps>\n <form [formGroup]="formGroup" >\n <div class="ui-fluid">\n \x3c!-- Dados pessoais --\x3e\n <fnd-employee-dependent-personal-step [hidden]="activeIndex !== 0"\n [parentFormGroup]="formGroup"></fnd-employee-dependent-personal-step>\n \x3c!-- Dados complementaris --\x3e\n <fnd-employee-dependent-complement-step [hidden]="activeIndex !== 1"\n [parentFormGroup]="formGroup"></fnd-employee-dependent-complement-step>\n\n </div>\n </form>\n <s-footer class="footer-sidebar-form-dependent">\n <s-button (click)="onCancel()" priority="link" style="margin-right: auto"\n [label]="\'hcm_contract.employment_contract.cancel\' | translate"\n ></s-button>\n <div class="footer-end">\n <s-button priority="secondary"\n *ngIf="activeIndex !== 0"\n iconClass="fa fa-arrow-left"\n (onClick)="undoStep()"\n [disabled]="activeIndex === 0"\n [label]="\'hcm_contract.employment_contract.employee_dependent_button_back\' | translate">\n </s-button>\n <s-button id="btn-draft"\n label="{{ \'hcm_contract.employment_contract.btn_dependent_save_draft\' | translate }}"\n priority="secondary"(click)="saveDependentDraft()" [auxiliary]="false"\n [disabled]="loading"></s-button>\n <s-button\n *ngIf="employeeId"\n class="btn-next"\n [rightIconClass]="!activeIndex ? \'fa fa-arrow-right\' : \'\'"\n (onClick)="nextStep()"\n [disabled]="loading"\n [label]="this.buttonLabel">\n </s-button>\n </div>\n </s-footer>\n</s-sidebar>\n<p-confirmDialog key="edit-dependent"></p-confirmDialog>\n',styles:[".tab-view-full{width:100%}.toggle-header-fieldset{display:flex!important;justify-content:space-between!important;align-items:center!important}.toggle-header-fieldset .ui-inputgroup span{margin-right:8px!important;font-size:14px;font-weight:400;line-height:21px;text-align:left;text-underline-position:from-font;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}.footer-sidebar-form-dependent{display:flex;justify-content:space-between}.message-warn-admisison{padding-left:65px;font-size:14px}.message-warn-admisison p:first-of-type{font-weight:700}.btn-next>button{display:flex!important;flex-direction:row-reverse!important}.btn-next>button span{margin-left:5px!important}"]})],e)}();!function(e){e.VF="VF",e.VM="VM"}(Po||(Po={}));var Go=c,Vo=function(){function e(e,t,n,o){var i=this;this.translateService=e,this.route=t,this.formBuilder=n,this.service=o,this.maxlength=80,this.emailMax=500,this.localeConfig={},this.ngUnsubscribe=new r.Subject,this.genderType=Object.keys(Po).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_gender_type_"+e),value:e}}))}return e.prototype.ngOnInit=function(){var e=this;this.createFormGroup(),this.parentFormGroup.addControl("basicDependentPersonData",this.formGroup),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.subscribeEvents()},e.prototype.createFormGroup=function(){this.formGroup=this.formBuilder.group({birthDate:this.formBuilder.control({value:null,disabled:!1},[p.Validators.required,this.validateBirthDateIsAfterNow()]),cpf:this.formBuilder.control({value:null,disabled:!1},[p.Validators.required,oo.isValidCpf()]),fullName:this.formBuilder.control({value:null,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.maxLength(this.maxlength)])),email:this.formBuilder.control({value:null,disabled:null},p.Validators.compose([p.Validators.maxLength(this.emailMax),this.validatorEmailsList()])),genderType:this.formBuilder.control({value:null,disabled:!1},p.Validators.required),nickname:this.formBuilder.control({value:null,disabled:!1},p.Validators.maxLength(this.maxlength))})},e.prototype.validateBirthDateIsAfterNow=function(){return function(e){if(e.value&&Go(e.value).isAfter(Go()))return{birthDateIsAfter:!0};return null}},e.prototype.subscribeEvents=function(){var e=this;this.service.getDependentFormData().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){var n;e.formGroup.patchValue(null===(n=null==t?void 0:t.personDependentData)||void 0===n?void 0:n.basicDependentPersonData)}))},e.prototype.onRouteDataChange=function(e){this.localeConfig=e.localeConfig},e.prototype.validatorEmailsList=function(){return function(e){return e.value&&!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e.value)?{email:!0}:null}},e.ctorParameters=function(){return[{type:a.TranslateService},{type:d.ActivatedRoute},{type:p.FormBuilder},{type:Rt}]},W([t.Input()],e.prototype,"parentFormGroup",void 0),e=W([t.Component({selector:"fnd-employee-dependent-personal-step",template:'<div class="ui-fluid " [formGroup]="formGroup">\n <div class="ui-g">\n <div class="ui-md-12">\n <h3>{{\'hcm_contract.employment_contract.employee_dependent_personal_data_title\' | translate}}</h3>\n </div>\n \x3c!-- CPF --\x3e\n <div id="dv-cpf" class="ui-sm-12 ui-md-6 ui-lg-6 ui-xl-6 required">\n <label id="lb-cpf" for="ff-cpf">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_personal_data_cpf\' | translate\n }}</label>\n <p-inputMask id="ff-cpf" formControlName="cpf" mask="999.999.999-99" [unmask]="true"></p-inputMask>\n <s-control-errors\n id="er-cpf"\n [control]="formGroup.get(\'cpf\')"\n [errorMessages]="{\n cpfNotValid: \'hcm_contract.employment_contract.employee_dependent_error_invalid\' | translate,\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Nome Completo --\x3e\n <div id="dv-fullname" class="ui-sm-12 ui-md-12 ui-lg-12 required">\n <label id="lb-fullname" for="ff-fullname">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_full_name\' | translate\n }}</label>\n\n <input\n id="ff-fullName"\n type="text" pInputText\n formControlName="fullName"\n autocomplete="off"\n />\n\n <s-control-errors\n id="er-full-name"\n [control]="formGroup.get(\'fullName\')"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate,\n maxlength: translateService.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'fullName\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Apelido --\x3e\n <div id="dv-nickname" class="ui-sm-12 ui-md-12 ui-lg-12">\n <label id="lb-nickname" for="ff-nickname">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_nickname\' | translate\n }}</label>\n\n <input id="ff-nickname" type="text" pInputText formControlName="nickname" autocomplete="off"/>\n\n <s-control-errors\n id="er-nickname"\n [control]="formGroup.get(\'nickname\')"\n [errorMessages]="{\n maxlength: translateService.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'nickname\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n \x3c!-- Sexo --\x3e\n <div class="ui-g-12 ui-md-6 required">\n <label for="genderType">{{"hcm_contract.employment_contract.employee_dependent_gender_label" |\n translate}}</label>\n <p-dropdown inputId="genderType" id="genderType" name="genderType" [options]="genderType"\n formControlName="genderType"\n placeholder="{{\n \'hcm_contract.employment_contract.employee_dependent_gender_type_placeholder\'\n | translate}}">\n </p-dropdown>\n <s-control-errors\n id="er-gender-type"\n [control]="formGroup.get(\'genderType\')"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate\n }"\n ></s-control-errors>\n </div>\n \x3c!-- Nascimento --\x3e\n <div id="dv-birth-date" class="ui-sm-12 ui-md-6 required">\n <label id="lb-birth-date" for="ff-birth-date">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_birth_date\' | translate\n }}</label>\n\n <p-calendar\n id="ff-birth-date"\n name="birthDate"\n formControlName="birthDate"\n [dateFormat]="localeConfig?.calendar?.dateFormat"\n [locale]="localeConfig?.calendar"\n [showIcon]="true"\n icon="fa fa-calendar"\n sCalendarMask\n ></p-calendar>\n <s-control-errors\n id="er-hire-date"\n [control]="formGroup.get(\'birthDate\')"\n [errorMessages]="{\n birthDateIsAfter:\n \'hcm_contract.employment_contract.employee_dependent_error_date_must_be_today_or_later\'\n | translate,\n required:\n \'hcm_contract.employment_contract.admission_generic_field_validator_required\'\n | translate\n }"\n ></s-control-errors>\n </div>\n \x3c!-- E-mail --\x3e\n <div id="dv-email" class="ui-sm-12 ui-md-12">\n <label id="lb-email" for="ff-email">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_email_data_email\' | translate\n }}</label>\n\n <input id="ff-email" type="text" pInputText formControlName="email" autocomplete="off" />\n\n <s-control-errors\n id="er-email"\n [control]="formGroup.get(\'email\')"\n [errorMessages]="{\n email: translateService.instant(\'hcm_contract.employment_contract.employee_dependent_email_invalid\'),\n maxlength: translateService.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'email\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n </div>\n</div>\n'})],e)}(),No=c,xo=function(){function e(e,n,o,i,a,s,l){this.activatedRoute=e,this.paginatorStorageService=n,this.dependentDraftService=o,this.translate=i,this.router=a,this.confirmationService=s,this.messageService=l,this.isLoading=!1,this.allPermissions={},this.currentListParams={page:0,size:10,sort:[]},this.permissions={},this.closeSideBar=new t.EventEmitter,this.addButtonClicked=new t.EventEmitter,this.onEdit=new t.EventEmitter,this.ngUnsubscribe=new r.Subject}return e.prototype.ngOnInit=function(){var e=this;this.gridColumns=this.getGridColumns(),this.activatedRoute.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.closeSideBar.pipe(s.takeUntil(this.ngUnsubscribe),s.filter((function(e){return!!e}))).subscribe((function(){e.updateGrid()}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.onRouteDataChange=function(e){var t;this.allPermissions=e.allPermissions,this.permissions=null===(t=e.allPermissions)||void 0===t?void 0:t.dependentDraft},e.prototype.getActions=function(e){var t=this;return[{id:"1",label:this.translate.instant("hcm_contract.employment_contract.admission_generic_edit"),visible:this.permissions.editar,command:function(){t.onEdit.emit(null==e?void 0:e.id)}},{id:"2",visible:this.permissions.excluir,label:this.translate.instant("hcm_contract.employment_contract.logical_delete"),command:function(){return t.onDelete(e.id)}},{id:"3",visible:!!this._employeeId,label:this.translate.instant("hcm_contract.employment_contract.dependent_draft_effect_data"),command:function(){t.dependentDraftService.saveDraftEvent.next(e)}}]},e.prototype.onDelete=function(e){var t=this;this.confirmationService.confirm({header:this.translate.instant("hcm_contract.employment_contract.draft_delete_confirmation_message"),message:this.translate.instant("hcm_contract.employment_contract.admission_delete_confirmation_message"),acceptLabel:this.translate.instant("hcm_contract.employment_contract.admission_generic_yes"),rejectLabel:this.translate.instant("hcm_contract.employment_contract.admission_generic_no"),accept:function(){t.isLoading=!0,t.dependentDraftService.delete(e).pipe(s.takeUntil(t.ngUnsubscribe),s.finalize((function(){t.isLoading=!1,t.resetGrid()}))).subscribe((function(){t.messageService.add({severity:"success",summary:t.translate.instant("hcm_contract.employment_contract.deleted_message_title"),detail:t.translate.instant("hcm_contract.employment_contract.deleted_message_content")})}))}})},e.prototype.getSortField=function(){return this.currentListParams.sort},e.prototype.getPageSize=function(){return this.currentListParams.size},e.prototype.getRowIndex=function(){return this.currentListParams.page*this.currentListParams.size},e.prototype.formatDate=function(e){return No(e).format(this.dateFormat)},e.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,o=e.multiSortMeta;return(10!==t||0!==n||(null==o?void 0:o.length)>0)&&this.paginatorStorageService.storePaginator("DependentDraftListComponentPaginator",{page:n,size:t,sort:o}),this.updateGrid({page:n,size:t,sort:o})},e.prototype.resetGrid=function(e){e&&(this.currentListParams=z(z({},this.currentListParams),e)),this.currentListParams=z(z({},this.currentListParams),{page:0,sort:[]}),this.table.reset()},e.prototype.getGridColumns=function(){return[{field:"personName",header:this.translate.instant("hcm_contract.employment_contract.e_001_pes_nom_pes")},{field:"kinshipDegreeType",header:this.translate.instant("hcm_contract.employment_contract.employee_dependent_list_kinship")}]},e.prototype.updateGrid=function(e){var t=this;if(void 0===e&&(e={}),this._admissionDraftId||this._employeeId){this.isLoading=!0,this.currentListParams=z(z({},this.currentListParams),e);var n=this.currentListParams,o=n.page,i=n.size,a=this.currentListParams.sort;a||(a=[{field:"lastModifiedDate",order:-1}]);var r=this._employeeId?"(employee.id eq '"+this._employeeId+"')":this._admissionDraftId?"(admissionDraft.id eq '"+this._admissionDraftId+"')":null;r&&this.dependentDraftService.list({page:o,size:i,sort:a,filterQuery:r,displayFields:["*"]}).pipe(s.takeUntil(this.ngUnsubscribe),s.debounceTime(500),s.distinctUntilChanged(),s.finalize((function(){t.isLoading=!1}))).subscribe((function(e){t.gridData=e.contents,t.totalRecords=e.totalElements}))}},e.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},Object.defineProperty(e.prototype,"employeeId",{set:function(e){this._employeeId=e,this.updateGrid()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"admissionDraftId",{set:function(e){this._admissionDraftId=e,this.updateGrid()},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:d.ActivatedRoute},{type:Cn},{type:Fo},{type:a.TranslateService},{type:d.Router},{type:i.ConfirmationService},{type:i.MessageService}]},W([t.Input()],e.prototype,"closeSideBar",void 0),W([t.Output()],e.prototype,"addButtonClicked",void 0),W([t.Output()],e.prototype,"onEdit",void 0),W([t.ViewChild("dependentDraftTable")],e.prototype,"table",void 0),W([t.Input()],e.prototype,"employeeId",null),W([t.Input()],e.prototype,"admissionDraftId",null),e=W([t.Component({selector:"app-dependent-list-draft",template:'<s-loading-state [loading]="isLoading" blockWindow="true"></s-loading-state>\n<div class="ui-g" *ngIf="gridData?.length">\n <div class="ui-g-12">\n <button id="add-button-draft" type="button" pButton\n [label]="\'hcm_contract.employment_contract.add_employee_dependent\' | translate"\n title="{{\'hcm_contract.employment_contract.add_employee_dependent\' | translate}} (Alt + Shift + N)"\n *ngIf="permissions.incluir" (click)="addButtonClicked.emit()"></button>\n </div>\n</div>\n<s-empty-state *ngIf="!gridData?.length"\n [title]="\'hcm_contract.employment_contract.employee_dependent_empty_state_title\' | translate"\n [showPrimaryAction]="this.permissions.incluir"\n [primaryActionLabel]="\'hcm_contract.employment_contract.add_employee_dependent\' | translate"\n (primaryAction)="addButtonClicked.emit()"\n [description]="\'hcm_contract.employment_contract.employee_dependent_empty_state_description\' | translate"\n>\n</s-empty-state>\n<div [attr.data-hidden]="!gridData?.length">\n\n <p-table #dependentDraftTable [value]="gridData" [columns]="gridColumns" dataKey="id" [lazy]="true"\n [scrollable]="true" [resizableColumns]="true" sortMode="multiple" [paginator]="true"\n [totalRecords]="totalRecords" [multiSortMeta]="getSortField()" [first]="getRowIndex()"\n [rows]="getPageSize()" [rowsPerPageOptions]="[10, 20, 50, 100]"\n (onLazyLoad)="onGridChange($event)">\n <ng-template pTemplate="colgroup" let-columns>\n <colgroup>\n <col *ngFor="let col of columns">\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns>\n <tr>\n <th id="th-randon" *ngFor="let col of columns" [pSortableColumn]="col.field"\n pResizableColumn>\n <div class="senior-header">\n <span class="senior-header-title">{{ col.header }}</span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n <th pResizableColumn scope="col" *ngIf="this.permissions.excluir">\n <div class="senior-header">\n <span class="senior-header-title">{{\n \'hcm_contract.employment_contract.actions\' |\n translate\n }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate="body" let-rowData let-columns>\n <tr [pSelectableRow]="rowData">\n <td>\n <span>{{ rowData?.personName }}</span>\n </td><td>\n <div [ngSwitch]="getProp(rowData, \'kinshipDegreeType\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate)">\n <span *ngSwitchCase="\'SON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SON" | translate}}</span>\n <span *ngSwitchCase="\'SPOUSE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SPOUSE" | translate}}</span>\n <span *ngSwitchCase="\'FATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER" | translate}}</span>\n <span *ngSwitchCase="\'GRANDFATHER_GRANDMOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GRANDFATHER_GRANDMOTHER" | translate}}</span>\n <span *ngSwitchCase="\'GREAT_GRANDFATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GREAT_GRANDFATHER" | translate}}</span>\n <span *ngSwitchCase="\'NEPHEW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_NEPHEW" | translate}}</span>\n <span *ngSwitchCase="\'UNCLE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_UNCLE" | translate}}</span>\n <span *ngSwitchCase="\'GRANDSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GRANDSON" | translate}}</span>\n <span *ngSwitchCase="\'FATHER_IN_LAW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER_IN_LAW" | translate}}</span>\n <span *ngSwitchCase="\'SON_IN_LAW_DAOUGHTER_IN_LAW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SON_IN_LAW_DAOUGHTER_IN_LAW" | translate}}</span>\n <span *ngSwitchCase="\'STEPSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPSON" | translate}}</span>\n <span *ngSwitchCase="\'BROTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_BROTHER" | translate}}</span>\n <span *ngSwitchCase="\'ADOPTED_CHILD\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_ADOPTED_CHILD" | translate}}</span>\n <span *ngSwitchCase="\'PENSIONERS\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_PENSIONERS" | translate}}</span>\n <span *ngSwitchCase="\'COMPANION\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_COMPANION" | translate}}</span>\n <span *ngSwitchCase="\'GUARDIANSHIP\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GUARDIANSHIP" | translate}}</span>\n <span *ngSwitchCase="\'MINOR_UNDER_GUARD\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_MINOR_UNDER_GUARD" | translate}}</span>\n <span *ngSwitchCase="\'STEPMOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPMOTHER" | translate}}</span>\n <span *ngSwitchCase="\'STEPFATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPFATHER" | translate}}</span>\n <span *ngSwitchCase="\'TUTOR\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_TUTOR" | translate}}</span>\n <span *ngSwitchCase="\'EX_EXPOSED\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_EX_EXPOSED" | translate}}</span>\n <span *ngSwitchCase="\'GREAT_GRANDSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GREAT_GRANDSON" | translate}}</span>\n <span *ngSwitchCase="\'EX_PARTNER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_EX_PARTNER" | translate}}</span>\n <span *ngSwitchCase="\'CONCUBINE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_CONCUBINE" | translate}}</span>\n <span *ngSwitchCase="\'CURATORSHIP\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_CURATORSHIP" | translate}}</span>\n <span *ngSwitchCase="\'SOCIOAFFECTIVE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SOCIOAFFECTIVE" | translate}}</span>\n <span *ngSwitchCase="\'FATHER_MOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER_MOTHER" | translate}}</span>\n <span *ngSwitchCase="\'OTHERS\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_OTHERS" | translate}}</span>\n <span *ngSwitchDefault>{{ "hcm_contract.employment_contract.list_grid_empty_field" | translate}}</span>\n </div>\n </td>\n <td class="txt-center" tabindex="0" *ngIf="this.permissions.editar && this.permissions.excluir">\n <s-button label="{{\'hcm_contract.employment_contract.admission_generic_actions\' | translate}}"\n priority="default" [model]="getActions(rowData)" [disabled]="false"\n [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span\n [translate]="\'hcm_contract.employment_contract.total_records\'"\n [translateParams]="{value: totalRecords}">\n </span>\n </ng-template>\n </p-table>\n</div>\n'})],e)}(),Oo=c,Bo=function(){function e(e,n,o,i,a,s,l,c,p,d){this.translate=e,this.fb=n,this.cdRef=o,this.focusService=i,this.paginatorStorageService=a,this.employeeDependentService=s,this.activatedRoute=l,this.confirmationService=c,this.messageService=p,this.router=d,this.closeSideBar=new t.EventEmitter,this.filterFields=[],this.loading=!1,this.serverError=!1,this.showDialog=!1,this.localeConfig={},this.personClass="",this.permissions={},this.allPermissions={},this.ngUnsubscribe=new r.Subject,this.currentListParams={page:0,size:10,sort:[],filterData:{}},this.totalRecords=0}return Object.defineProperty(e.prototype,"employeeId",{set:function(e){this._employeeId=e,this.updateGrid()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"admissionDraftId",{set:function(e){this._admissionDraftId=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewChecked=function(){this.cdRef.detectChanges()},e.prototype.ngOnInit=function(){var e=this;this.createFormGroup(),this.subscribeValuesInFormAndEvents(),this.activatedRoute.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.gridColumns=this.getGridColumns()},e.prototype.createFormGroup=function(){this.formGroup=this.fb.group({person:[{value:null,disabled:!0},p.Validators.compose([])],registerMethod:[{value:null,disabled:!1},p.Validators.required]})},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.onRouteDataChange=function(e){var t;this.localeConfig=e.localeConfig,this.allPermissions=e.allPermissions,this.permissions=null===(t=e.allPermissions)||void 0===t?void 0:t.employeeDependent},e.prototype.getGridColumns=function(){return[{field:"dependent.codPes",header:this.translate.instant("hcm_contract.employment_contract.e_001_pes_cod_pes")},{field:"dependent.nomPes",header:this.translate.instant("hcm_contract.employment_contract.e_001_pes_nom_pes")},{field:"dependent.graPar",header:this.translate.instant("hcm_contract.employment_contract.employee_dependent_list_kinship")},{field:"dependent.intNet",header:this.translate.instant("hcm_contract.employment_contract.employee_dependent_list_email")},{field:"dependent.fonPes",header:this.translate.instant("hcm_contract.employment_contract.employee_dependent_list_phoneNumber")}]},e.prototype.subscribeValuesInFormAndEvents=function(){var e=this;this.formGroup.get("registerMethod").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRegisterMethod(t)})),this.formGroup.get("person").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.personId=null==t?void 0:t.id})),this.closeSideBar.pipe(s.takeUntil(this.ngUnsubscribe),s.filter((function(e){return!!e}))).subscribe((function(){e.updateGrid()}))},e.prototype.onRegisterMethod=function(e){this.formGroup.get("person").setValue(null),"newRegister"===e?(ie(this.formGroup,"person",[]),this.formGroup.get("person").disable()):(ie(this.formGroup,"person",[p.Validators.required]),this.personClass="required",this.formGroup.get("person").enable())},e.prototype.getSortField=function(){return this.currentListParams.sort},e.prototype.getPageSize=function(){return this.currentListParams.size},e.prototype.getRowIndex=function(){return this.currentListParams.page*this.currentListParams.size},e.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,o=e.multiSortMeta;return(10!==t||0!==n||(null==o?void 0:o.length)>0)&&this.paginatorStorageService.storePaginator("AnnotationHistoryListComponentPaginator",{page:n,size:t,sort:o}),this.updateGrid({page:n,size:t,sort:o})},e.prototype.resetGrid=function(e){e&&(this.currentListParams=z(z({},this.currentListParams),e)),this.currentListParams=z(z({},this.currentListParams),{page:0,sort:[]}),this.table.reset()},e.prototype.updateGrid=function(e){var t=this;if(void 0===e&&(e={}),this._employeeId){this.loading=!0,this.currentListParams=z(z({},this.currentListParams),e);var n=this.currentListParams,o=n.page,i=n.size,a=n.filterData,r=this.currentListParams.sort,c=this.filterFields.filter((function(e){var t=e.name;return!!a[t]})).map((function(e){var n=e.name,o=e.type,i=e.multiple,r=a[n];return"number"==typeof r?n+" eq "+r:o===l.FieldType.Date?n+" eq '"+Oo(r).format("YYYY-MM-DD")+"'":o===l.FieldType.Time?n+" eq '"+Oo(r).format("HH:mm:ss")+"'":o===l.FieldType.DateTime?n+" eq '"+Oo(r).format()+"'":o===l.FieldType.String?"containing(upper("+n+"), upper('"+r.replace(/'/g,"\\'")+"'))":o===l.FieldType.Enum?t.getEnumQuery(n,r,i):o===l.FieldType.Lookup?n+" eq '"+r.id+"'":n+" eq '"+r+"'"})).join(" and "),p="employee.id eq '"+this._employeeId+"'";c=c?"("+c+") and ("+p+")":p;r||(r=[{field:"lastModifiedDate",order:-1}]),this.employeeDependentService.list({page:o,size:i,sort:r,filterQuery:c,displayFields:["employee.person.*","dependent.*"]}).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(e){throw e.status>=500&&e.status<600&&(t.serverError=!0),e})),s.finalize((function(){t.loading=!1}))).subscribe((function(e){t.gridData=e.contents,t.totalRecords=e.totalElements,t.serverError=!1}))}else this.serverError=!0},e.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},e.prototype.getEnumQuery=function(e,t,n){return n?"("+t.map((function(t){return e+" eq '"+t+"'"})).join(" or ")+")":e+" eq '"+t+"'"},e.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)})),this.focusService.focusFirstInvalidInput()},e.prototype.sendToForm=function(){if(!this.formGroup.valid)return this.loading=!1,this.validateAllFormFields(this.formGroup);this.showDialog=!1,this.employeeDependentService.setOpenSideBarAndStartForm({dependentId:null,personId:this.personId})},e.prototype.onCancel=function(){this.showDialog=!1},e.prototype.onAddDependent=function(){this.formGroup.reset(),this.onRegisterMethod("newRegister"),this.showDialog=!0},e.prototype.onDelete=function(e){var t=this;this.loading=!0,this.employeeDependentService.delete(e.id).subscribe((function(){t.messageService.add({severity:"info",summary:t.translate.instant("hcm_contract.employment_contract.deleted_message_title"),detail:t.translate.instant("hcm_contract.employment_contract.exclusion_process_started_message_content")}),t.updateGrid()})),this.confirmationService.close()},e.prototype.onEdit=function(e){var t;this.personId=null===(t=null==e?void 0:e.dependent)||void 0===t?void 0:t.id,this.employeeDependentService.setOpenSideBarAndStartForm({dependentId:null==e?void 0:e.id,personId:this.personId})},e.prototype.onEditDraft=function(e){this.employeeDependentService.setOpenSideBarAndStartForm({dependentDraftId:e})},e.prototype.getActions=function(e){var t=this;return[{id:"1",label:this.translate.instant("hcm_contract.employment_contract.edit"),command:function(){t.onEdit(e)}},{id:"2",label:this.translate.instant("hcm_contract.employment_contract.logical_delete"),command:function(){t.confirmationService.confirm({message:t.translate.instant("hcm_contract.employment_contract.admission_delete_confirmation_message"),rejectLabel:t.translate.instant("hcm_contract.employment_contract.admission_generic_no"),acceptLabel:t.translate.instant("hcm_contract.employment_contract.admission_generic_yes"),header:t.translate.instant("hcm_contract.employment_contract.admission_delete_confirmation_title"),accept:function(){t.onDelete(e)}})}}]},e.prototype.openRecordExclusions=function(){this.router.navigate(["dependents","exclusions-list"],{queryParams:{entityName:"employeeDependent",entityDescription:this.translate.instant("hcm_contract.employment_contract.employee_dependent")}})},e.prototype.hasPermissionToSeeExclusions=function(){return this.allPermissions.exclusionProcessStep.visualizar&&this.allPermissions.exclusionProcessStepGroup.visualizar},e.prototype.getOtherActions=function(){var e=this,t=[];return this.hasPermissionToSeeExclusions()&&t.push({id:"view-exclusions",label:this.translate.instant("hcm_contract.employment_contract.see_exclusions"),command:function(){e.openRecordExclusions()}}),t},e.ctorParameters=function(){return[{type:a.TranslateService},{type:p.FormBuilder},{type:t.ChangeDetectorRef},{type:_n},{type:Cn},{type:Rt},{type:d.ActivatedRoute},{type:i.ConfirmationService},{type:i.MessageService},{type:d.Router}]},W([t.Input()],e.prototype,"employeeId",null),W([t.Input()],e.prototype,"admissionDraftId",null),W([t.ViewChild("employeeDependentTable",{static:!1})],e.prototype,"table",void 0),e=W([t.Component({selector:"fnd-employee-dependent",template:'<p-panel *sLoadingState="loading">\n <p-tabView styleClass="form-group" *sLoadingState="loading" >\n <p-tabPanel *ngIf="_employeeId"\n [header]="\'hcm_contract.employment_contract.employee_dependent_title_header\' | translate">\n <div class="ui-g" *ngIf="this.gridData?.length">\n <div class="ui-g-12">\n <button id="add-button" type="button" pButton [label]="\'hcm_contract.employment_contract.add_employee_dependent\' | translate"\n title="{{\'hcm_contract.employment_contract.add_employee_dependent\' | translate}} (Alt + Shift + N)"\n *ngIf="permissions.incluir" (click)="onAddDependent()"></button>\n <s-button id="other-actions-button"\n [label]="\'hcm_contract.employment_contract.other_actions\' | translate"\n [model]="getOtherActions()"\n priority="secondary"\n [disabled]="false" [auxiliary]="false"\n *ngIf="hasPermissionToSeeExclusions()">\n </s-button>\n </div>\n </div>\n <s-empty-state *ngIf="!this.gridData?.length" [title]="\'hcm_contract.employment_contract.employee_dependent_empty_state_title\' | translate"\n [showPrimaryAction]="this.permissions.incluir" [primaryActionLabel]="\'hcm_contract.employment_contract.add_employee_dependent\' | translate"\n (primaryAction)="onAddDependent()" [description]="\'hcm_contract.employment_contract.employee_dependent_empty_state_description\' | translate"\n [showSecondaryAction]="permissions.incluir" [showSecondaryAction]="hasPermissionToSeeExclusions()"\n [secondaryActionLabel]="\'hcm_contract.employment_contract.see_exclusions\' | translate"\n (secondaryAction)="openRecordExclusions()">\n </s-empty-state>\n <div [attr.data-hidden]="!gridData?.length || serverError">\n\n <p-table #employeeDependentTable [value]="gridData" [columns]="gridColumns" dataKey="id" [lazy]="true"\n [scrollable]="true" [resizableColumns]="true" sortMode="multiple" [paginator]="true"\n [totalRecords]="totalRecords" [multiSortMeta]="getSortField()" [first]="getRowIndex()"\n [rows]="getPageSize()" [rowsPerPageOptions]="[10, 20, 50, 100]"\n (onLazyLoad)="onGridChange($event)">\n <ng-template pTemplate="colgroup" let-columns>\n <colgroup>\n <col *ngFor="let col of columns">\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns>\n <tr>\n <th *ngFor="let col of columns" [pSortableColumn]="col.field"\n pResizableColumn>\n <div class="senior-header">\n <span class="senior-header-title">{{col.header}}</span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n <th pResizableColumn scope="col" *ngIf="this.permissions.excluir">\n <div class="senior-header">\n <span class="senior-header-title">{{\'hcm_contract.employment_contract.actions\' |\n translate}}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate="body" let-rowData let-columns>\n <tr [pSelectableRow]="rowData">\n <td>\n <span>{{"" + (getProp(rowData, \'dependent.codPes\'))}}</span>\n </td>\n <td>\n <span>{{"" + (getProp(rowData, \'dependent.nomPes\')|| (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td>\n <div [ngSwitch]="getProp(rowData, \'dependent.graPde\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate)">\n <span *ngSwitchCase="\'SON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SON" | translate}}</span>\n <span *ngSwitchCase="\'SPOUSE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SPOUSE" | translate}}</span>\n <span *ngSwitchCase="\'FATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER" | translate}}</span>\n <span *ngSwitchCase="\'GRANDFATHER_GRANDMOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GRANDFATHER_GRANDMOTHER" | translate}}</span>\n <span *ngSwitchCase="\'GREAT_GRANDFATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GREAT_GRANDFATHER" | translate}}</span>\n <span *ngSwitchCase="\'NEPHEW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_NEPHEW" | translate}}</span>\n <span *ngSwitchCase="\'UNCLE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_UNCLE" | translate}}</span>\n <span *ngSwitchCase="\'GRANDSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GRANDSON" | translate}}</span>\n <span *ngSwitchCase="\'FATHER_IN_LAW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER_IN_LAW" | translate}}</span>\n <span *ngSwitchCase="\'SON_IN_LAW_DAOUGHTER_IN_LAW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SON_IN_LAW_DAOUGHTER_IN_LAW" | translate}}</span>\n <span *ngSwitchCase="\'STEPSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPSON" | translate}}</span>\n <span *ngSwitchCase="\'BROTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_BROTHER" | translate}}</span>\n <span *ngSwitchCase="\'ADOPTED_CHILD\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_ADOPTED_CHILD" | translate}}</span>\n <span *ngSwitchCase="\'PENSIONERS\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_PENSIONERS" | translate}}</span>\n <span *ngSwitchCase="\'COMPANION\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_COMPANION" | translate}}</span>\n <span *ngSwitchCase="\'GUARDIANSHIP\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GUARDIANSHIP" | translate}}</span>\n <span *ngSwitchCase="\'MINOR_UNDER_GUARD\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_MINOR_UNDER_GUARD" | translate}}</span>\n <span *ngSwitchCase="\'STEPMOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPMOTHER" | translate}}</span>\n <span *ngSwitchCase="\'STEPFATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPFATHER" | translate}}</span>\n <span *ngSwitchCase="\'TUTOR\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_TUTOR" | translate}}</span>\n <span *ngSwitchCase="\'EX_EXPOSED\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_EX_EXPOSED" | translate}}</span>\n <span *ngSwitchCase="\'GREAT_GRANDSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GREAT_GRANDSON" | translate}}</span>\n <span *ngSwitchCase="\'EX_PARTNER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_EX_PARTNER" | translate}}</span>\n <span *ngSwitchCase="\'CONCUBINE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_CONCUBINE" | translate}}</span>\n <span *ngSwitchCase="\'CURATORSHIP\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_CURATORSHIP" | translate}}</span>\n <span *ngSwitchCase="\'SOCIOAFFECTIVE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SOCIOAFFECTIVE" | translate}}</span>\n <span *ngSwitchCase="\'FATHER_MOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER_MOTHER" | translate}}</span>\n <span *ngSwitchCase="\'OTHERS\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_OTHERS" | translate}}</span>\n <span *ngSwitchDefault>{{ "hcm_contract.employment_contract.list_grid_empty_field" | translate}}</span>\n </div>\n </td>\n <td>\n <span>{{"" + (getProp(rowData, \'dependent.intNet\')|| (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td>\n <span>{{"" + (getProp(rowData, \'dependent.fonPes\')|| (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td class="txt-center" tabindex="0" *ngIf="this.permissions.editar && this.permissions.excluir">\n <s-button label="{{\'hcm_contract.employment_contract.admission_generic_actions\' | translate}}"\n priority="default" [model]="getActions(rowData)" [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span\n [translate]="\'hcm_contract.employment_contract.total_records\'"\n [translateParams]="{value: totalRecords}">\n </span>\n </ng-template>\n </p-table>\n </div>\n </p-tabPanel>\n <p-tabPanel\n [header]="\'hcm_contract.employment_contract.employee_dependent_draft_title_header\' | translate">\n <app-dependent-list-draft\n (addButtonClicked)="onAddDependent()"\n [employeeId]="_employeeId"\n [closeSideBar]="closeSideBar"\n [admissionDraftId]="_admissionDraftId"\n (onEdit)="onEditDraft($event)">\n </app-dependent-list-draft>\n </p-tabPanel>\n </p-tabView>\n</p-panel>\n<p-dialog header="{{ \'hcm_contract.employment_contract.employee_dependent_register_method_title\' | translate }}"\n[draggable]="false" [modal]="true"\n[(visible)]="showDialog" [closable]="false">\n <form class="ui-fluid" [formGroup]="formGroup">\n <div class="radio-buttons required ui-lg-12" style="margin-bottom: 20px;">\n <label id="registerMethod">{{ \'hcm_contract.employment_contract.employee_dependent_register_method_label\' | translate }}</label>\n <div><p-radioButton name="registerMethod" formControlName="registerMethod"\n value="newRegister"\n label="{{ \'hcm_contract.employment_contract.employee_dependent_register_method_create_data\' | translate}}"></p-radioButton></div>\n <div><p-radioButton\n name="registerMethod" formControlName="registerMethod"\n value="existing"\n label="{{ \'hcm_contract.employment_contract.employee_dependent_register_method_existing_data\' | translate}}"></p-radioButton></div>\n <s-control-errors\n id="er-registerMethod"\n [control]="formGroup.get(\'registerMethod\')"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate\n }"\n ></s-control-errors>\n </div>\n\n <div class="ui-lg-12">\n <div class="person-label">\n <label for="personLabel">{{\'hcm_contract.employment_contract.data_person_id_lookup_title\' | translate}}</label>\n <span\n id="personLabel"\n class="fa fa-info-circle"\n [pTooltip]="\'hcm_contract.employment_contract.employee_dependent_tooltip_person\' | translate">\n </span>\n </div>\n <div class="{{personClass}}">\n <fnd-person-lookup [formGroup]="formGroup" [locale]="localeConfig"></fnd-person-lookup>\n <s-control-errors\n id="er-person"\n [control]="formGroup.get(\'person\')"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate\n }"\n ></s-control-errors>\n </div>\n </div>\n </form>\n <p-footer>\n <s-button\n [label]="\'hcm_contract.employment_contract.employee_dependent_next\' | translate"\n priority="primary" (onClick)="sendToForm()">\n </s-button>\n <s-button\n [label]="\'hcm_contract.employment_contract.cancel\' | translate"\n priority="secondary"\n (onClick)="onCancel()">\n </s-button>\n </p-footer>\n</p-dialog>\n<p-confirmDialog></p-confirmDialog>\n<fnd-employee-dependent-form [employeeId]="_employeeId" [admissionDraft]="_admissionDraftId" [closeSideBar]="closeSideBar"></fnd-employee-dependent-form>\n<s-exclusion-details></s-exclusion-details>\n',styles:[".radio-buttons{display:flex;flex-direction:column;gap:6px}.person-label{display:flex;gap:5px;align-items:center}"]})],e)}(),Ho=function(){function e(){}return e=W([t.NgModule({imports:[k.TableModule,h.CommonModule,a.TranslateModule,l.LoadingStateModule,l.EmptyStateModule,E.PanelModule,kn,H.DialogModule,Lt,l.SidebarModule,l.StepsModule,b.InputMaskModule,g.DropdownModule,U.RadioButtonModule,O.FieldsetModule,G.PersonLookupModule,G.EntityLookupModule.forRoot({domain:"hcm_contract",service:"employment_contract"}),n.PermissionsModule.forChild([{name:"dependentDraft",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/dependentDraft"}]),B.TooltipModule],declarations:[Bo,xo,Mo,Vo,ko,Ro,Lo],providers:[Eo,Co,Fo],exports:[Bo]})],e)}();e.AnnotationHistory=zt,e.AnnotationHistoryAttachmentService=ft,e.AnnotationHistoryFeatureModule=no,e.AnnotationHistoryFormComponent=Zn,e.AnnotationHistoryListComponent=to,e.AnnotationHistoryService=Ze,e.AnnotationType=jt,e.AnnotationTypeService=$e,e.BankAccountHistory=Jt,e.BankAccountHistoryService=tt,e.BankAccountItemComponent=co,e.BankAccountItemModule=mo,e.BankAccountListComponent=po,e.BaseCollectiveHistoryComponent=Ln,e.BaseCollectiveHistoryModule=An,e.BaseHistoryComponent=yn,e.BaseHistoryModule=In,e.BaseHistoryService=tn,e.CollectiveHistoryFiltersComponent=Wn,e.CollectiveHistoryFiltersModule=Qn,e.CollectiveHistoryFiltersService=nn,e.CompanyLookupService=Yn,e.CoreHistoryModule=wt,e.DateValidator=dn,e.Disease=an,e.DiseaseService=rt,e.DiseaseSubgroup=on,e.DiseaseSubgroupService=lt,e.E001Pes=Mt,e.E001PesService=Be,e.E030Age=Kt,e.E030AgeService=en,e.E030Ban=Qt,e.E030BanService=Zt,e.ESocialReason=ln,e.ESocialReasonService=pt,e.Employee=Vt,e.EmployeeDependentListComponent=Bo,e.EmployeeDependentModule=Ho,e.EmployeeLookupService=zn,e.EmployeeService=qe,e.EmployeeSummaryComponent=Do,e.EmployeeSummaryModule=To,e.ErrorPageService=bn,e.FieldCustomizationService=Sn,e.FiltersStorageService=En,e.FocusService=_n,e.JourneyFlexibilizationService=Kn,e.LeaveHistory=sn,e.LeaveHistoryAttachmentService=ht,e.LeaveHistoryBFFService=it,e.LeaveHistoryFeatureModule=so,e.LeaveHistoryFormComponent=io,e.LeaveHistoryListComponent=ro,e.LeaveHistoryService=ot,e.MinutesToTimeConversionService=Dn,e.MinutesToTimeConversionServiceImpl=Tn,e.PaginatorStorageService=Cn,e.PermissionService=fn,e.PlatformService=pn,e.RegulatoryNormTrainingHistory=cn,e.RegulatoryNormTrainingHistoryItemComponent=go,e.RegulatoryNormTrainingHistoryItemModule=bo,e.RegulatoryNormTrainingHistoryListComponent=vo,e.RegulatoryNormTrainingHistoryService=Dt,e.Situation=rn,e.SituationService=mt,e.StorageService=Fn,e.Workshift=xt,e.WorkshiftGroup=Bt,e.WorkshiftGroupService=je,e.WorkshiftHistory=qt,e.WorkshiftHistoryAdjustmentService=bt,e.WorkshiftHistoryFeatureModule=$n,e.WorkshiftHistoryFormComponent=Gn,e.WorkshiftHistoryListComponent=On,e.WorkshiftHistoryService=Xe,e.WorkshiftInformationHistoryService=Ft,e.WorkshiftService=ze,e.clearValues=re,e.configEnabledFields=ne,e.contractTypeOptions=Ge,e.convertBooleanString=function(e){return"boolean"==typeof e?!0===e?"true":"false":e},e.convertMinutesToTime=function(e,t){var n=e.replace(".",""),o=Math.floor(parseInt(n)/60),i=parseInt(n)%60,a=o<10?"0"+o:o;return a+=":",a+=i<10?"0"+i:""+i,t&&(a=Re(a.toString())),a},e.convertTimeToMinutes=function(e){if(e){var t=e.toString().split(":");return 60*t[0]+parseInt(t[1])}return null},e.createEnumFilterString=function(e,t,n){var o=e.name,i=e.multiple,a=e.options;return n&&n.textSeachEnum?le(o,t,a):se(o,t,i)},e.createFilterString=ce,e.createFilterTokens=function(e,t,n){var o=e,i=o.name,a=o.type,r=o.label,s=o.searchFields,p=o.options,d=t;switch(a){case l.FieldType.Date:d=c(t).format("L");break;case l.FieldType.Time:d=c(t).format("LTS");break;case l.FieldType.LocalDateTime:case l.FieldType.DateTime:d=c(t).format("L LTS");break;case l.FieldType.Lookup:d=s.map((function(e){return Ae(t,e.name)})).join(" - ");break;case l.FieldType.Enum:d=p.filter((function(e){return e.value===d}))[0].label;break;case l.FieldType.Boolean:d=t?n.instant("platform.localization.list_grid_boolean_true"):n.instant("platform.localization.list_grid_boolean_false")}return{id:i,label:r+": "+d}},e.createLookupRequestFilter=Pe,e.getDefaultHistoryGridColumns=xe,e.getEnumQuery=se,e.getEnumTextSearchQuery=le,e.getLabelValueRequest=we,e.getProp=Ae,e.getRecordLabel=Ie,e.getSituationFilterInHistorics=Ne,e.getSuggestionValue=function(e,t,n,o){return e.map((function(e){return Ae(n,t+"."+e)})).reduce((function(e,t){return""+e+o+t}))+""},e.getTypeInformation=ke,e.getYears=function(e){return ee().diff(e,"years",!1)},e.isObject=function(e){return e&&"object"==typeof e&&!Array.isArray(e)},e.isValid=function(e){return 0===e||"boolean"==typeof e||null!=e&&""!==e},e.isValidFilter=Ce,e.mergeDateTime=Me,e.mergeUnique=Ee,e.removeCharacteresSpecials=function(e){return e?e.toString().replace(/[&\/\\#,+()$~%.'":*?<>{}-]/g,""):null},e.removeErrorFromField=mn,e.setDisableField=ae,e.setErrors=function(e,t,n){var o=this;setTimeout((function(){var i;n?((i=Object.assign({},o.get(e).errors))[t]=n,o.get(e).setErrors(i)):(i=o.get(e).errors)&&Object.keys(i).length&&(delete i[t],Object.keys(i).length||o.get(e).setErrors(null))}),0)},e.setRequired=te,e.setRequiredFields=function(e,t,n){t?n.forEach((function(t){return te(e,t,!0,[p.Validators.required])})):n.forEach((function(t){return te(e,t,!1)}))},e.setValidator=ie,e.setValidatorsAndDisableFields=oe,e.situationOptions=Ve,e.startDateIsBeforeEndDateValidator=function(e,t){if(e&&t&&e.value&&t.value){var n=c(e.value).isSameOrAfter(t.value)?{startDateIsBeforeEndDate:{value:t.value}}:null;if(n)return e.markAsDirty(),t.markAsDirty(),e.setErrors(n),t.setErrors(n),n;mn(t,"startDateIsBeforeEndDate"),mn(e,"startDateIsBeforeEndDate")}else!e||!e.value||t&&t.value?e&&e.value||!t||!t.value||mn(t,"startDateIsBeforeEndDate"):mn(e,"startDateIsBeforeEndDate");return null},e.startDateIsBeforeOrEqualToEndDateValidator=function(e,t){if(e&&t&&e.value&&t.value){var n=e.value>t.value?{startDateIsBeforeEndDate:{value:t.value}}:null;if(n)return e.markAsDirty(),t.markAsDirty(),e.setErrors(n),t.setErrors(n),n;mn(t,"startDateIsBeforeEndDate"),mn(e,"startDateIsBeforeEndDate")}else!e||!e.value||t&&t.value?e&&e.value||!t||!t.value||mn(t,"startDateIsBeforeEndDate"):mn(e,"startDateIsBeforeEndDate");return null},e.startDateTimeIsBeforeEndDateTimeValidator=function(e,t){if(e&&t&&e.value&&t.value){var n=e.value>t.value?{startDateTimeIsBeforeEndDateTime:{value:[t.value,e.value]}}:null;if(n)return e.markAsDirty(),t.markAsDirty(),t.setErrors(n),e.setErrors(n),n;mn(t,"startDateTimeIsBeforeEndDateTime"),mn(e,"startDateTimeIsBeforeEndDateTime")}else!e||!e.value||t&&t.value?e&&e.value||!t||!t.value||mn(t,"startDateTimeIsBeforeEndDateTime"):mn(e,"startDateTimeIsBeforeEndDateTime");return null},e.toastTimeToLive=864e5,e.updateSingleControl=de,e.validateSpecificControls=pe,e.verifyValidationsForm=function e(){var t=this;Object.keys(this.controls).forEach((function(n){var o=t.get(n);o.markAsDirty(),(o instanceof p.FormGroup||o instanceof p.FormArray)&&e.call(o)}))},e.ɵ0=Le,e.ɵa=Ue,e.ɵb=Oe,e.ɵba=Vn,e.ɵbb=Nn,e.ɵbc=Bn,e.ɵbd=So,e.ɵbe=xo,e.ɵbf=Fo,e.ɵbg=Mo,e.ɵbh=Vo,e.ɵbi=ko,e.ɵbj=Ro,e.ɵbk=Eo,e.ɵbl=Lo,e.ɵbm=Co,e.ɵc=He,e.ɵd=Ye,e.ɵe=We,e.ɵf=Ke,e.ɵg=Je,e.ɵh=et,e.ɵi=nt,e.ɵj=at,e.ɵk=st,e.ɵl=ct,e.ɵm=dt,e.ɵn=ut,e.ɵo=yt,e.ɵp=_t,e.ɵq=St,e.ɵr=Tt,e.ɵs=Et,e.ɵt=Lt,e.ɵu=Rt,e.ɵv=kt,e.ɵw=At,e.ɵx=kn,e.ɵy=gn,e.ɵz=Pn,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
15
|
+
***************************************************************************** */var j=function(e,t){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function Y(e,t){function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var z=function(){return(z=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function W(e,t,n,o){var i,a=arguments.length,r=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(r=(a<3?i(r):a>3?i(t,n,r):i(t,n))||r);return a>3&&r&&Object.defineProperty(t,n,r),r}function Q(e,t,n,o){return new(n||(n=Promise))((function(i,a){function r(e){try{l(o.next(e))}catch(e){a(e)}}function s(e){try{l(o.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((o=o.apply(e,t||[])).next())}))}function X(e,t){var n,o,i,a,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(i=2&a[0]?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(6===a[0]&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],o=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function K(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(o=a.next()).done;)r.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return r}function $(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(K(arguments[t]));return e}var J,Z,ee=c;function te(e,t,n,o){n?(e.controls[t].setValidators(p.Validators.compose(o&&o.length?o:[p.Validators.required])),e.controls[t].updateValueAndValidity()):(e.controls[t].setValidators(null),e.controls[t].updateValueAndValidity())}function ne(e,t,n,o){t?n.forEach((function(t){return e.get(t).enable()})):(n.forEach((function(t){return e.get(t).disable()})),re(e,o||n))}function oe(e,t){t.forEach((function(t){ie(e,t.field,t.validators),ae(e,t.disabled,t.field,t.clearValue)}))}function ie(e,t,n){n&&n.length?(e.controls[t].setValidators(p.Validators.compose(n)),e.controls[t].updateValueAndValidity()):(e.controls[t].setValidators(null),e.controls[t].updateValueAndValidity())}function ae(e,t,n,o){void 0===o&&(o=!0),t?(n&&e.get(n).disable(),o&&n&&e.get(n).reset()):n&&e.get(n).enable()}function re(e,t){t.forEach((function(t){return e.get(t).reset()}))}function se(e,t,n){return void 0===n&&(n=!1),n?"("+t.map((function(t){return e+" eq '"+t+"'"})).join(" or ")+")":e+" eq '"+t+"'"}function le(e,t,n){var o=n.filter((function(e){return(e.label||"").toLocaleLowerCase().includes((t||"").toLocaleLowerCase())}));return o.length?"("+o.map((function(t){return e+" eq '"+t.value+"'"})).join(" or ")+")":""}function ce(e,t,n){var o=e.name,i=e.type,a=e.multiple,r=e.options;if("number"==typeof t)return o+" eq "+t;if("employeeSituation"==o)return Ne(t);switch(i){case l.FieldType.Date:return o+" eq '"+ee(t).format("YYYY-MM-DD")+"'";case l.FieldType.Time:return o+" eq '"+ee(t).format("HH:mm:ss")+"'";case l.FieldType.DateTime:return o+" eq '"+ee(t).format()+"'";case l.FieldType.LocalDateTime:return o+" eq '"+ee(t).format("YYYY-MM-DD[T]HH:mm:ss.SSS")+"'";case l.FieldType.Enum:return n&&n.textSeachEnum?le(o,t,r):se(o,t,a);case l.FieldType.String:return"containing(upper("+o+"), upper('"+t.replace(/'/g,"'")+"'))";case l.FieldType.Lookup:return o+" eq '"+t.id+"'";default:return o+" eq '"+t+"'"}}function pe(e,t){t.forEach((function(t){var n=e.get(t);n?de(n):console.warn("Campo não encontrado: "+t)}))}function de(e){e.markAsDirty(),e.markAsTouched(),e.updateValueAndValidity({emitEvent:!0})}(J=e.ContractType||(e.ContractType={})).EMPLOYEE="EMPLOYEE",J.DIRECTOR="DIRECTOR",J.TRAINEE="TRAINEE",J.APRENTICE="APRENTICE",J.THIRD_PARTY="THIRD_PARTY",function(e){e.WORKING="WORKING",e.DISMISSED="DISMISSED",e.EVERYONE="EVERYONE"}(Z||(Z={}));var me,ue,he,ye,fe,_e,ve,ge,be,Se,De,Te=[l.FieldType.Integer,l.FieldType.Double],Fe=/^\d+\b$/,Ee=function(e,t){return e.concat(t.filter((function(t){return!e.includes(t)})))},Ce=function(e,t){var n=ke(e,t),o=n.isValidValue;return!(n.typeExists&&!o)},ke=function(e,t){switch(e){case l.FieldType.Time:case l.FieldType.Date:case l.FieldType.DateTime:return{isValidValue:!1,typeExists:!0};case l.FieldType.Integer:case l.FieldType.Double:default:return{isValidValue:t.match(Fe),typeExists:Te.includes(e)}}},Ie=function(e){return e.instant("hcm_contract.employment_additional_info.records_found")},Re=function(e){return 4===e.length?"00"+e:5===e.length?"0"+e:e},Le=Re,Ae=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},we=function(e,t){return e.map((function(e){return z(z({},e),{label:t.map((function(t){return Ae(e,t)})).join(" - ")})}))},Pe=function(e,t){return t.filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or ")},Me=function(e,t){return e&&t?c(c(e).format("YYYY-MM-DD")+c(t).set({second:0,millisecond:0}).format("THH:mm:ssZ")):null},Ge=function(t){return[{label:t.instant("hcm_contract.employment_contract.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:t.instant("hcm_contract.employment_contract.contract_type_director"),value:e.ContractType.DIRECTOR},{label:t.instant("hcm_contract.employment_contract.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:t.instant("hcm_contract.employment_contract.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:t.instant("hcm_contract.employment_contract.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}]},Ve=function(e,t){return[{label:e.instant(t.getTranslationPrefix()+".resignation_situation_type_working"),value:Z.WORKING},{label:e.instant(t.getTranslationPrefix()+".resignation_situation_type_dismissed"),value:Z.DISMISSED},{label:e.instant(t.getTranslationPrefix()+".resignation_situation_type_all"),value:Z.EVERYONE}]},Ne=function(e){var t=c().format("YYYY-MM-DD");return e==Z.WORKING?"(employee.dismissalDate is null or employee.dismissalDate gt '"+t+"')":e==Z.DISMISSED?"(employee.dismissalDate is not null and employee.dismissalDate le '"+t+"')":""},xe=function(e,t){return[{field:"employee.employer.codEmp",header:e.instant(t.getTranslationPrefix()+".history_employer_code")},{field:"employee.employer.nomEmp",header:e.instant(t.getTranslationPrefix()+".history_employer_name")},{field:"employee.employeeSnapshot.companyBranchCode",header:e.instant(t.getTranslationPrefix()+".history_company_branch_code")},{field:"employee.employeeSnapshot.companyBranchName",header:e.instant(t.getTranslationPrefix()+".history_company_branch_name")},{field:"employee.code",header:e.instant(t.getTranslationPrefix()+".history_employee_code")},{field:"employee.person.nomPes",header:e.instant(t.getTranslationPrefix()+".history_employee_person_nom_pes")},{field:"employee.employmentRelationship.contractType",header:e.instant(t.getTranslationPrefix()+".history_employment_contract_type"),enumPrefix:"hcm_contract.employment_additional_info.contract_type_"}]},Oe=function(){function e(e,t,n,o,i){this.http=e,this.messageService=t,this.entityUrl=n,this.actionsUrl=o,this.translate=i,this.http=e,this.messageService=t,this.entityUrl=n,this.actionsUrl=o,this.translate=i,this.defaultCatch=this.defaultCatch.bind(this)}return e.prototype.getListQueryParams=function(e){var t=e.page,n=void 0===t?0:t,i=e.size,a=void 0===i?10:i,r=e.sort,s=void 0===r?[]:r,l=e.filterQuery,c=void 0===l?"":l,p=e.displayFields,d=void 0===p?[]:p,m=new o.HttpParams;return m=(m=m.append("size",String(a))).append("offset",String(n)),s&&s.length&&(m=m.append("orderby",s.map((function(e){var t="";return 1===e.order?t=" asc":-1===e.order&&(t=" desc"),""+e.field+t})).join(", "))),c&&(m=m.append("filter",c)),d&&d.length&&(m=m.append("displayfields",d.join())),m},e.prototype.getBodyParams=function(e){var t=e.page,n=void 0===t?0:t,o=e.size,i=void 0===o?10:o,a=e.sort,r=void 0===a?[]:a,s=e.filterQuery,l=void 0===s?"":s,c=e.displayFields,p=void 0===c?[]:c,d={};return d.size=i,d.offset=n,r&&r.length&&(d.orderBy=r.map((function(e){var t="";return 1===e.order?t=" asc":-1===e.order&&(t=" desc"),""+e.field+t})).join(", ")),l&&(d.filter=l),p&&p.length&&(d.displayfields=p.join()),d},e.prototype.defaultCatch=function(){var e=this;return s.catchError((function(t){if(t){var n=t.status?String(t.status):"Error",o=t.error&&t.error.message||t.statusText||t.message||"Error";401===t.status&&(n=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_title"),o=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_description")),e.messageService.add({severity:"error",life:864e5,summary:n,detail:o})}return r.throwError(t)}))},e.prototype.list=function(e){return this.http.get(this.entityUrl,{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},e.prototype.get=function(e){return this.http.get(this.entityUrl+"/"+e).pipe(this.defaultCatch())},e.prototype.insert=function(e){return this.http.post(""+this.entityUrl,e).pipe(this.defaultCatch())},e.prototype.update=function(e,t){return this.http.put(this.entityUrl+"/"+e,t).pipe(this.defaultCatch())},e.prototype.delete=function(e){return this.http.delete(this.entityUrl+"/"+e).pipe(this.defaultCatch())},e.prototype.listCustomFilter=function(e,t){return this.http.post(this.actionsUrl+"/"+t,this.getBodyParams(e)).pipe(this.defaultCatch())},e}(),Be=function(e){function n(t,n,o){var i=e.call(this,t,n,"erpx_fnd/pessoa/entities/e001pes","erpx_fnd/pessoa/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalE001Pes=function(e){return this.http.get("erpx_fnd/pessoa/entities/e001pes",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),He=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"e001pes",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/erpx_fnd/pessoa/entities/e001pes"}])],providers:[Be],declarations:[],exports:[]})],e)}();(me=e.CollectiveProcessType||(e.CollectiveProcessType={})).INCLUDE="INCLUDE",me.EXCLUDE="EXCLUDE",(ue=e.WorkshiftType||(e.WorkshiftType={})).PERMANENT="PERMANENT",ue.AUTOMATIC_SEARCH="AUTOMATIC_SEARCH",(he=e.BankAccountType||(e.BankAccountType={})).CHECKING_ACCOUNT="CHECKING_ACCOUNT",he.SAVINGS_ACCOUNT="SAVINGS_ACCOUNT",he.SALARY_ACCOUNT="SALARY_ACCOUNT",he.OTHER="OTHER",(ye=e.ESocialReasonType||(e.ESocialReasonType={})).V0="V0",ye.V1="V1",ye.V3="V3",ye.V5="V5",ye.V6="V6",ye.V7="V7",ye.V8="V8",ye.V10="V10",ye.V11="V11",ye.V12="V12",ye.V13="V13",ye.V14="V14",ye.V15="V15",ye.V16="V16",ye.V17="V17",ye.V18="V18",ye.V19="V19",ye.V20="V20",ye.V21="V21",ye.V22="V22",ye.V23="V23",ye.V24="V24",ye.V25="V25",ye.V26="V26",ye.V27="V27",ye.V28="V28",ye.V29="V29",ye.V30="V30",ye.V31="V31",ye.V33="V33",ye.V34="V34",ye.V35="V35",ye.V36="V36",ye.V37="V37",ye.V38="V38",(fe=e.ESocialWorkingHoursType||(e.ESocialWorkingHoursType={})).V1="V1",fe.V2="V2",fe.V3="V3",fe.V4="V4",(_e=e.OnusRemuneration||(e.OnusRemuneration={})).V1="V1",_e.V2="V2",_e.V3="V3",(ve=e.ProcessType||(e.ProcessType={})).V1="V1",ve.V2="V2",ve.V3="V3",(ge=e.SituationType||(e.SituationType={})).WORKING="WORKING",ge.VACATION="VACATION",ge.ILLNESSAID="ILLNESSAID",ge.LABORACCIDENT="LABORACCIDENT",ge.MILITARYSERVICE="MILITARYSERVICE",ge.MATERNITYLEAVE="MATERNITYLEAVE",ge.MATERNITYLEAVENONCRIMINALABORTION="MATERNITYLEAVENONCRIMINALABORTION",ge.MATERNITYLEAVEANTICIPATIONEXTENSION="MATERNITYLEAVEANTICIPATIONEXTENSION",ge.CITIZENCOMPANYMATERNITY="CITIZENCOMPANYMATERNITY",ge.INSSMATERNITYLEAVE="INSSMATERNITYLEAVE",ge.LEAVEWITHOUTCOMPENSATION="LEAVEWITHOUTCOMPENSATION",ge.PAIDLEAVE="PAIDLEAVE",ge.PATERNITYLEAVE="PATERNITYLEAVE",ge.CITIZENCOMPANYPATERNITY="CITIZENCOMPANYPATERNITY",ge.COLLECTIVEVACATION="COLLECTIVEVACATION",ge.MEDICALLEAVE="MEDICALLEAVE",ge.MEDICALLEAVEWITHOUTINSS="MEDICALLEAVEWITHOUTINSS",ge.ABSENCES="ABSENCES",ge.OVERTIME="OVERTIME",ge.TIMEEVALUATIONSITUATION="TIMEEVALUATIONSITUATION",ge.PRECAUTIONREADINESS="PRECAUTIONREADINESS",ge.TRADEUNIONMANDATE="TRADEUNIONMANDATE",ge.WORKACCIDENTLEAVE="WORKACCIDENTLEAVE",ge.WORKACCIDENTLEAVEWITHOUTINSS="WORKACCIDENTLEAVEWITHOUTINSS",ge.RETIREMENTDUETODISABILITY="RETIREMENTDUETODISABILITY",ge.PROFESSIONALQUALIFICATION="PROFESSIONALQUALIFICATION",ge.PRIORNOTICEHOURSWORKED="PRIORNOTICEHOURSWORKED",ge.OTHERS="OTHERS",ge.REINSTATEMENT="REINSTATEMENT",(be=e.SourceReasonChange||(e.SourceReasonChange={})).V1="V1",be.V2="V2",be.V3="V3",(Se=e.WorkAccidentType||(e.WorkAccidentType={})).V1="V1",Se.V2="V2",Se.V3="V3",(De=e.FileValidation||(e.FileValidation={})).MAX_FILE_SIZE="MAX_FILE_SIZE",De.MAX_FILE_LIMIT="MAX_FILE_LIMIT";var qe=function(n){function r(t,o,i){var a=n.call(this,t,o,"hcm_contract/employment_contract/entities/employee","hcm_contract/employment_contract/actions",i)||this;return a.http=t,a.messageService=o,a.translate=i,a.getLabelEmployeeRequest=function(e,t,n){return void 0===n&&(n=!1),n?e.contents.map((function(e){return z(z({},e),{label:a.getLabelEmployeeGeneric(e,t)})})):z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:a.getLabelEmployeeGeneric(e,t)})}))})},a.getLabelEmployeeSearch=function(e,t,n){return void 0===n&&(n=!1),n?{gridData:e.contents.map((function(e){return z(z({},e),{label:a.getLabelEmployeeGeneric(e,t)})})),totalRecords:e.totalElements}:z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:a.getLabelEmployeeGeneric(e,t)})}))})},a.loadLabelFromEnum=function(t){var n=[{label:a.translate.instant("hcm_contract.employment_contract.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:a.translate.instant("hcm_contract.employment_contract.contract_type_director"),value:e.ContractType.DIRECTOR},{label:a.translate.instant("hcm_contract.employment_contract.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:a.translate.instant("hcm_contract.employment_contract.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:a.translate.instant("hcm_contract.employment_contract.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}].filter((function(e){return e.value===t}));return n&&n.length&&n[0].label||a.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")},a}return Y(r,n),r.prototype.listExternalEmployee=function(e){return this.http.get("hcm_contract/employment_contract/entities/employee",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},r.prototype.getLabelEmployeeGeneric=function(e,t){var n=this;return t.map((function(t){return t.indexOf(".")>0&&(e[t]=n.getProp(e,t)),"employmentRelationship.contractType"===t&&(e[t]=n.loadLabelFromEnum(e[t])),e[t]})).join(" - ")},r.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},r.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},r=W([t.Injectable()],r)}(Oe),Ue=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"employee",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/employee"}])],providers:[qe],declarations:[],exports:[]})],e)}(),je=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_foundation/work_schedule/entities/workshiftGroup","hcm_foundation/work_schedule/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalWorkshiftGroup=function(e){return this.http.get("hcm_foundation/work_schedule/entities/workshiftGroup",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Ye=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"workshiftGroup",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/work_schedule/entities/workshiftGroup"}])],providers:[je],declarations:[],exports:[]})],e)}(),ze=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_foundation/work_schedule/entities/workshift","hcm_foundation/work_schedule/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalWorkshift=function(e){return this.http.get("hcm_foundation/work_schedule/entities/workshift",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),We=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"workshift",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/work_schedule/entities/workshift"}])],providers:[ze],declarations:[],exports:[]})],e)}(),Qe=c,Xe=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_contract/entities/workshiftHistory","hcm_contract/employment_contract/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i.queriesUrl="hcm_contract/employment_contract/queries",i}return Y(n,e),n.prototype.getEmployeeWorkshiftByDate=function(e,t){return this.http.post(this.queriesUrl+"/getEmployeeWorkshiftByDate",{employeeId:e,searchDate:Qe(t).format("YYYY-MM-DD")})},n.prototype.saveCollective=function(e){return this.http.post("hcm_contract/employment_contract/actions/workshiftHistoryBatch",e).pipe(this.defaultCatch())},n.prototype.deleteCollective=function(e){return this.http.post("hcm_contract/employment_contract/actions/workshiftHistoryBatchDelete",e).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Ke=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"workshiftHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/workshiftHistory"}])],providers:[Xe],declarations:[],exports:[]})],e)}(),$e=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_foundation/general/entities/annotationType","hcm_foundation/general/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalAnnotationType=function(e){return this.http.get("hcm_foundation/general/entities/annotationType",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Je=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"annotationType",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/general/entities/annotationType"}])],providers:[$e],declarations:[],exports:[]})],e)}(),Ze=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_additional_info/entities/annotationHistory","hcm_contract/employment_additional_info/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.saveCollective=function(e){return this.http.post("hcm_contract/employment_additional_info/actions/annotationHistoryBatch",e).pipe(this.defaultCatch())},n.prototype.deleteCollective=function(e){return this.http.post("hcm_contract/employment_additional_info/actions/annotationHistoryBatchDelete",e).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),et=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"annotationHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/annotationHistory"}])],providers:[Ze],declarations:[],exports:[]})],e)}(),tt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_contract/entities/bankAccountHistory","hcm_contract/employment_contract/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),nt=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"bankAccountHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/bankAccountHistory"}])],providers:[tt],declarations:[],exports:[]})],e)}(),ot=function(n){function r(e,t,o){var i=n.call(this,e,t,"hcm_contract/employment_additional_info/entities/leaveHistory","hcm_contract/employment_additional_info/actions",o)||this;return i.http=e,i.messageService=t,i.translate=o,i}return Y(r,n),r.prototype.hasV1OrV3LeaveWithinSixtyDays=function(t,n){return this.http.post("hcm_contract/employment_additional_info/queries/hasLeaveWithESocialReasonTypeInPeriod",{employeeId:t,periodStartDate:c(n).subtract(60,"days").format("YYYY-MM-DD"),periodEndDate:c(n).subtract(1,"millisecond").format("YYYY-MM-DD"),eSocialReasonTypes:[e.ESocialReasonType.V1,e.ESocialReasonType.V3]}).pipe(this.defaultCatch(),s.map((function(e){return e.result})))},r.prototype.saveCollective=function(e){return this.http.post("hcm_contract/employment_additional_info/actions/leaveHistoryBatch",e).pipe(this.defaultCatch())},r.prototype.deleteCollective=function(e){return this.http.post("hcm_contract/employment_additional_info/actions/leaveHistoryBatchDelete",e).pipe(this.defaultCatch())},r.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},r=W([t.Injectable()],r)}(Oe),it=function(){function n(e,t,n){this.http=e,this.messageService=t,this.translate=n,this.FACADE_URL="hcm_clocking_event_time_evaluation/engine_bff/apis/leaveHistoryAdjustment",this.QUERIES_URL="hcm_clocking_event_time_evaluation/engine_bff/queries"}return n.prototype.hasV1OrV3LeaveWithinSixtyDays=function(t,n){return this.http.post(this.QUERIES_URL+"/hasLeaveWithESocialReasonTypeInPeriodBFF",{employeeId:t,periodStartDate:c(n).subtract(60,"days").format("YYYY-MM-DD"),periodEndDate:c(n).subtract(1,"millisecond").format("YYYY-MM-DD"),eSocialReasonTypes:[e.ESocialReasonType.V1,e.ESocialReasonType.V3]}).pipe(this.defaultCatch(),s.map((function(e){return e.result})))},n.prototype.get=function(e,t){var n=new o.HttpParams;return(null==t?void 0:t.length)&&(n=n.set("displayfields",t.join(","))),this.http.get(this.FACADE_URL+"/"+e,{params:n}).pipe(this.defaultCatch())},n.prototype.insert=function(e){return this.http.post(this.FACADE_URL,e).pipe(this.defaultCatch())},n.prototype.update=function(e,t){return this.http.put(this.FACADE_URL+"/"+e,t).pipe(this.defaultCatch())},n.prototype.delete=function(e){return this.http.delete(this.FACADE_URL+"/"+e).pipe(this.defaultCatch())},n.prototype.defaultCatch=function(){var e=this;return s.catchError((function(t){var n;if(t){var o=t.status?String(t.status):"Error",i=(null===(n=null==t?void 0:t.error)||void 0===n?void 0:n.message)||(null==t?void 0:t.statusText)||(null==t?void 0:t.message)||"Error";401===t.status&&(o=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_title"),i=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_description")),e.messageService.add({severity:"error",summary:o,detail:i})}return r.throwError(t)}))},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(),at=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"leaveHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/leaveHistory"},{name:"customization",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/field/customization"}])],providers:[ot,it],declarations:[],exports:[]})],e)}(),rt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_additional_info/entities/disease","hcm_contract/employment_additional_info/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalDisease=function(e){return this.http.get("legal_register/shared/entities/disease",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),st=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"disease",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/disease"}])],providers:[rt],declarations:[],exports:[]})],e)}(),lt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_additional_info/entities/diseaseSubgroup","hcm_contract/employment_additional_info/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalDiseaseSubgroup=function(e){return this.http.get("legal_register/shared/entities/diseaseSubgroup",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),ct=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"diseaseSubgroup",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/diseaseSubgroup"}])],providers:[lt],declarations:[],exports:[]})],e)}(),pt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_additional_info/entities/eSocialReason","hcm_contract/employment_additional_info/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalESocialReason=function(e){return this.http.get("hcm_foundation/general/entities/eSocialReason",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.prototype.fetchESocialReasonType=function(e,t){return this.listExternalESocialReason({displayFields:["id","eSocialReasonType"],filterQuery:"situation.id eq '"+e+"' and competence le '"+c(t).format("YYYY-MM-DD")+"'",page:0,size:1,sort:[{field:"competence",order:-1}]}).pipe(s.map((function(e){return e.contents&&e.contents.length&&e.contents[0].eSocialReasonType})))},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),dt=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"eSocialReason",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/general/entities/eSocialReason"}])],providers:[pt],declarations:[],exports:[]})],e)}(),mt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_foundation/general/entities/situation","hcm_foundation/general/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalSituation=function(e){return this.http.get("hcm_foundation/general/entities/situation",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),ut=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"situation",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/general/entities/situation"},{name:"situationStructureCompanyHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_foundation/general/entities/situationStructureCompanyHistory"}])],providers:[mt],declarations:[],exports:[]})],e)}(),ht=function(){function e(e){this.http=e}return e.prototype.requestUpload=function(e){return this.http.post("platform/ecm_ged/queries/requestUpload",{fileName:e.name})},e.prototype.downloadForDocument=function(e){var t=(new o.HttpParams).set("documentId",e.documentId);return this.http.get("platform/ecm_ged/queries/requestDocumentDownload",{params:t})},e.ctorParameters=function(){return[{type:o.HttpClient}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(o.HttpClient))},token:e,providedIn:"root"}),e=W([t.Injectable({providedIn:"root"})],e)}(),yt=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"leaveHistoryAttachment",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/leaveHistoryAttachment"},{name:"customization",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/field/customization"}])],providers:[ht],declarations:[],exports:[]})],e)}(),ft=function(){function e(e){this.http=e}return e.prototype.requestUpload=function(e){return this.http.post("platform/ecm_ged/queries/requestUpload",{fileName:e.name})},e.prototype.downloadForDocument=function(e){var t=(new o.HttpParams).set("documentId",e.documentId);return this.http.get("platform/ecm_ged/queries/requestDocumentDownload",{params:t})},e.ctorParameters=function(){return[{type:o.HttpClient}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(o.HttpClient))},token:e,providedIn:"root"}),e=W([t.Injectable({providedIn:"root"})],e)}(),_t=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"annotationHistoryAttachment",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_additional_info/entities/annotationHistoryAttachment"}])],providers:[ft],declarations:[],exports:[]})],e)}();function vt(e,t){return s.catchError((function(n){if(n){var o=n.status?String(n.status):"Error",i=function(e){var t;t=e.error&&e.error.message?e.error.message:e.statusText?e.statusText:e.message?e.message:"Error";return t}(n);401===n.status&&(o=t.instant("hcm_contract.employment_contract.error_unauthorized_title"),i=t.instant("hcm_contract.employment_contract.error_unauthorized_description")),e.add({severity:"error",summary:o,detail:i})}return r.throwError(n)}))}var gt,bt=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translate=n,this.bffFacadeUrl="hcm_clocking_event_time_evaluation/engine_bff/apis/workshiftHistoryAdjustment"}return e.prototype.get=function(e){return this.http.get(this.bffFacadeUrl+"/"+e).pipe(vt(this.messageService,this.translate))},e.prototype.insert=function(e){return this.http.post(""+this.bffFacadeUrl,e).pipe(vt(this.messageService,this.translate))},e.prototype.update=function(e,t){return this.http.put(this.bffFacadeUrl+"/"+e,t).pipe(vt(this.messageService,this.translate))},e.prototype.delete=function(e){return this.http.delete(this.bffFacadeUrl+"/"+e).pipe(vt(this.messageService,this.translate))},e.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e(t.ɵɵinject(o.HttpClient),t.ɵɵinject(i.MessageService),t.ɵɵinject(a.TranslateService))},token:e,providedIn:"root"}),e=W([t.Injectable({providedIn:"root"})],e)}(),St=function(){function e(){}return e=W([t.NgModule({declarations:[],imports:[n.PermissionsModule.forChild([{name:"workshiftHistoryAdjustment",actions:["Atualizar","Criar","Excluir","Obter"],uri:"res://senior.com.br/hcm_clocking_event_time_evaluation/engine_bff/apis/workshiftHistoryAdjustment"}])],providers:[bt]})],e)}(),Dt=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_contract/entities/regulatoryNormTrainingHistory","hcm_contract/employment_contract/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Tt=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"regulatoryNormTrainingHistory",actions:["Visualizar","Incluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/regulatoryNormTrainingHistory"}])],providers:[Dt],declarations:[],exports:[]})],e)}(),Ft=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_contract/entities/workshiftInformationHistory","hcm_contract/employment_contract/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Et=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"workshiftInformationHistory",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/workshiftInformationHistory"}])],providers:[Ft],declarations:[],exports:[]})],e)}(),Ct={domainName:"hcm_contract",serviceName:"employment_contract"},kt=function(){function e(e,t,n,o){this.http=e,this.translate=t,this.messageService=n,this.router=o}return e.prototype.doAction=function(e,t,n){return void 0===n&&(n=Ct),this.do("actions",e,t,n)},e.prototype.doQuery=function(e,t,n){return void 0===n&&(n=Ct),this.do("queries",e,t,n)},e.prototype.doSignal=function(e,t,n){return void 0===n&&(n=Ct),this.do("signals",e,t,n)},e.prototype.list=function(e,t,n){var o=this;return void 0===n&&(n=Ct),this.http.get(this.toBaseUrl(n)+"/entities/"+e,{params:this.getListQueryParams(t)}).pipe(s.catchError((function(e){return o.handleError(e)})))},e.prototype.get=function(e,t,n){var o=this;return void 0===n&&(n=Ct),this.http.get(this.toBaseUrl(n)+"/entities/"+e+"/"+t).pipe(s.catchError((function(e){return o.handleError(e)})))},e.prototype.insert=function(e,t,n){var o=this;return void 0===n&&(n=Ct),this.http.post(this.toBaseUrl(n)+"/entities/"+e,t).pipe(s.catchError((function(e){return o.handleError(e)})))},e.prototype.update=function(e,t,n,o){var i=this;return void 0===o&&(o=Ct),this.http.put(this.toBaseUrl(o)+"/entities/"+e+"/"+t,n).pipe(s.catchError((function(e){return i.handleError(e)})))},e.prototype.delete=function(e,t,n){var o=this;return void 0===n&&(n=Ct),this.http.delete(this.toBaseUrl(n)+"/entities/"+e+"/"+t).pipe(s.catchError((function(e){return o.handleError(e)})))},e.prototype.do=function(e,t,n,o){var i=this;return this.http.post(this.toBaseUrl(o)+"/"+e+"/"+t,n).pipe(s.catchError((function(e){return i.handleError(e)})))},e.prototype.toBaseUrl=function(e){return e.domainName+"/"+e.serviceName},e.prototype.getListQueryParams=function(e){var t=e.page,n=void 0===t?0:t,i=e.size,a=void 0===i?10:i,r=e.sort,s=void 0===r?[]:r,l=e.filterQuery,c=void 0===l?"":l,p=e.displayFields,d=void 0===p?[]:p,m=new o.HttpParams;return m=(m=m.append("size",String(a))).append("offset",String(n)),s&&s.length&&(m=m.append("orderby",s.map((function(e){var t="";return 1===e.order&&(t=" asc"),-1===e.order&&(t=" desc"),""+e.field+t})).join(", "))),c&&(m=m.append("filter",c)),d&&d.length&&(m=m.append("displayfields",d.join())),m},e.prototype.handleError=function(e){if(e){var t=e.status?String(e.status):"Error",n="";n=e.error&&e.error.message?e.error.message:e.statusText?e.statusText:e.message?e.message:"Error",504===(null==e?void 0:e.status)&&(t=e.status.toString(),n=this.translate.instant("hcm_contract.employment_contract.admission_error_server_description"),this.router.navigate(["error-server/"+e.status])),401===(null==e?void 0:e.status)&&(t=this.translate.instant("hcm_contract.employment_contract.error_unauthorized_title"),n=this.translate.instant("hcm_contract.employment_contract.error_unauthorized_description")),this.messageService.add({severity:"error",summary:t,detail:n})}return r.throwError(e)},e.ctorParameters=function(){return[{type:o.HttpClient},{type:a.TranslateService},{type:i.MessageService},{type:d.Router}]},e=W([t.Injectable()],e)}(),It=z({},{name:"@senior-gestao-pessoas/hcm-contract-employee-history",project:{app:"gestao-pessoas",domain:"hcm_contract",service:"employment_contract",serviceDependencies:[{service:"general",version:"develop-SNAPSHOT"}]},production:!1,ignorePermissions:!1}),Rt=function(e){function n(n,o,i,a){var s=e.call(this,n,i,It.project.domain+"/"+It.project.service+"/entities/employeeDependent",It.project.domain+"/"+It.project.service+"/actions",a)||this;return s.http=n,s.httpService=o,s.messageService=i,s.translate=a,s.dependentFormData=new r.Subject,s.openSideBarAndStartForm=new t.EventEmitter,s}return Y(n,e),n.prototype.employeeDpendentSave=function(e){return this.http.post(this.actionsUrl+"/employeeDependentSave",e).pipe(this.defaultCatch())},n.prototype.personRetrieve=function(e){return this.httpService.doAction("personRetrieve",e,{domainName:"erpx_fnd",serviceName:"pessoa"})},n.prototype.getDependentFormData=function(){return this.dependentFormData.asObservable()},n.prototype.setDependentFormData=function(e){this.dependentFormData.next(e)},n.prototype.getOpenSideBarAndStartForm=function(){return this.openSideBarAndStartForm.asObservable()},n.prototype.setOpenSideBarAndStartForm=function(e){this.openSideBarAndStartForm.emit(e)},n.ctorParameters=function(){return[{type:o.HttpClient},{type:kt},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Lt=function(){function e(){}return e=W([t.NgModule({imports:[n.PermissionsModule.forChild([{name:"employeeDependent",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/employeeDependent"},{name:"employee",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/employee"},{name:"person",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/person"}])],providers:[Rt,kt],declarations:[],exports:[]})],e)}(),At=function(){function e(){}return e=W([t.NgModule({declarations:[],imports:[n.PermissionsModule.forChild([{name:"exclusionProcess",actions:["Visualizar"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/exclusionProcess"},{name:"exclusionProcessStep",actions:["Visualizar"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/exclusionProcessStep"},{name:"exclusionProcessStepGroup",actions:["Visualizar"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/exclusionProcessStepGroup"}])]})],e)}(),wt=function(){function e(){}return e=W([t.NgModule({imports:[Ue,He,Ye,We,Ke,Je,et,nt,at,st,ct,dt,ut,yt,_t,St,Tt,Et,Lt,At]})],e)}(),Pt=c,Mt=function(){function e(){this.excluido=!1}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&Pt(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Pt(n.lastModifiedDate).toDate();return n.label=["nomPes"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&Pt(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Pt(n.lastModifiedDate).format(),delete n.label,delete n._discriminator,n},e}(),Gt=c,Vt=function(){function e(){this.deleted=!1}return e.fromDto=function(e,t){var n=z({},e);n.hireDate=n.hireDate&&Gt(n.hireDate).toDate(),n.dismissalDate=n.dismissalDate&&Gt(n.dismissalDate).toDate(),n.createdDate=n.createdDate&&Gt(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Gt(n.lastModifiedDate).toDate();return n.label=["id","code","person.nomPes","hireDate","dismissalDate","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"E001Pes"!==t&&n.person&&(n.person=Mt.fromDto(n.person,"Employee")),n},e.toDto=function(e,t){var n,o,i=z({},e);return i.hireDate=i.hireDate&&Gt(i.hireDate).format("YYYY-MM-DD"),i.dismissalDate=i.dismissalDate&&Gt(i.dismissalDate).format("YYYY-MM-DD"),i.createdDate=i.createdDate&&Gt(i.createdDate).format(),i.lastModifiedDate=i.lastModifiedDate&&Gt(i.lastModifiedDate).format(),delete i.label,delete i._discriminator,null===(n=i.employer)||void 0===n||delete n._discriminator,null===(o=i.employmentRelationship)||void 0===o||delete o._discriminator,"E001Pes"!==t&&i.person&&(i.person=Mt.toDto(i.person,"Employee")),i},e}(),Nt=c,xt=function(){function e(){this.deleted=!1}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&Nt(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Nt(n.lastModifiedDate).toDate();return n.label=["id","code","workshiftType","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&Nt(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Nt(n.lastModifiedDate).format(),delete n.label,delete n._discriminator,n},e}(),Ot=c,Bt=function(){function e(){this.deleted=!1}return e.fromDto=function(e,t){var n=z({},e);n.baseDate=n.baseDate&&Ot(n.baseDate).toDate(),n.createdDate=n.createdDate&&Ot(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Ot(n.lastModifiedDate).toDate();return n.label=["id","code","baseDate","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.baseDate=n.baseDate&&Ot(n.baseDate).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&Ot(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Ot(n.lastModifiedDate).format(),delete n.label,delete n._discriminator,n},e}(),Ht=c,qt=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.startDate=n.startDate&&Ht(n.startDate).toDate(),n.endDate=n.endDate&&Ht(n.endDate).toDate(),n.createdDate=n.createdDate&&Ht(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Ht(n.lastModifiedDate).toDate();return n.label=["id","employee.code","employee.person.codPes","employee.person.nomPes","startDate","endDate","workshift.code","workshift.name","workshiftGroup.code","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"Employee"!==t&&n.employee&&(n.employee=Vt.fromDto(n.employee,"WorkshiftHistory")),"Workshift"!==t&&n.workshift&&(n.workshift=xt.fromDto(n.workshift,"WorkshiftHistory")),"WorkshiftGroup"!==t&&n.workshiftGroup&&(n.workshiftGroup=Bt.fromDto(n.workshiftGroup,"WorkshiftHistory")),n},e.toDto=function(e,t){var n=z({},e);return n.startDate=n.startDate&&Ht(n.startDate).format("YYYY-MM-DD"),n.endDate=n.endDate&&Ht(n.endDate).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&Ht(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Ht(n.lastModifiedDate).format(),delete n.label,"Employee"!==t&&n.employee&&(n.employee=Vt.toDto(n.employee,"WorkshiftHistory")),"Workshift"!==t&&n.workshift&&(n.workshift=xt.toDto(n.workshift,"WorkshiftHistory")),"WorkshiftGroup"!==t&&n.workshiftGroup&&(n.workshiftGroup=Bt.toDto(n.workshiftGroup,"WorkshiftHistory")),delete n.workshift.workshiftType,n},e.toDtoCollective=function(e,t){var n,o,i,a=t&&t.employeeIds&&t.employeeIds.map((function(e){return e.id})),r=t&&t.companyIds&&t.companyIds.map((function(e){return e.id}));return{filter:{advancedFilterId:null===(n=null==t?void 0:t.advancedFilter)||void 0===n?void 0:n.id,companyIds:r,employeeIds:a},workshiftHistories:{startDate:(null==e?void 0:e.startDate)&&Ht(null==e?void 0:e.startDate).format("YYYY-MM-DD"),workshiftId:null===(o=null==e?void 0:e.workshift)||void 0===o?void 0:o.id,workshiftGroupId:null===(i=null==e?void 0:e.workshiftGroup)||void 0===i?void 0:i.id,eSocialWorkingHoursType:null==e?void 0:e.eSocialWorkingHoursType}}},e}(),Ut=c,jt=function(){function e(){this.excluido=!1}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&Ut(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Ut(n.lastModifiedDate).toDate();return n.label=["code","name"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&Ut(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Ut(n.lastModifiedDate).format(),delete n.label,n},e}(),Yt=c,zt=function(){function e(){}return e.fromDto=function(e,t){var n,o=z({},e);o.startDate=o.startDate&&Yt(o.startDate).toDate(),o.createdDate=o.createdDate&&Yt(o.createdDate).toDate(),o.lastModifiedDate=o.lastModifiedDate&&Yt(o.lastModifiedDate).toDate();return o.label=["employee.code","employee.person.nomPes","annotationType.code","annotationType.name","startDate"].map((function(e){return o[e]})).join(" - "),"Employee"!==t&&o.employee&&(o.employee=Vt.fromDto(o.employee,"AnnotationHistory")),"AnnotationType"!==t&&o.annotationType&&(o.annotationType=jt.fromDto(o.annotationType,"AnnotationHistory")),"Employee"!==t&&o.responsible&&(o.responsible=Vt.fromDto(o.responsible,"AnnotationHistory")),(null===(n=o.annotationHistoryAttachments)||void 0===n?void 0:n.length)&&(o.annotationHistoryAttachments=o.annotationHistoryAttachments.map((function(e){return{id:e.id,name:e.name,locationURI:e.locationURI,documentId:e.documentId,progress:100}}))),o},e.toDto=function(e,t){var n=z({},e);return n.startDate=n.startDate&&Yt(n.startDate).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&Yt(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Yt(n.lastModifiedDate).format(),delete n.label,"Employee"!==t&&n.employee&&(n.employee=Vt.toDto(n.employee,"AnnotationHistory")),"AnnotationType"!==t&&n.annotationType&&(n.annotationType=jt.toDto(n.annotationType,"AnnotationHistory")),"Employee"!==t&&n.responsible&&(n.responsible=Vt.toDto(n.responsible,"AnnotationHistory")),this.toDtoAttachments(e,n),n},e.toDtoAttachments=function(e,t){var n;(null===(n=e.annotationHistoryAttachments)||void 0===n?void 0:n.length)&&(t.annotationHistoryAttachments=e.annotationHistoryAttachments.map((function(e){return{id:e.id,name:e.name,locationURI:e.locationURI}})))},e.toDtoCollective=function(e,t){var n,o,i,a,r=null===(n=null==t?void 0:t.employeeIds)||void 0===n?void 0:n.map((function(e){return e.id})),s=null===(o=null==t?void 0:t.companyIds)||void 0===o?void 0:o.map((function(e){return e.id})),l=null===(i=null==t?void 0:t.advancedFilter)||void 0===i?void 0:i.id,c={startDate:e.startDate&&Yt(e.startDate).format("YYYY-MM-DD"),annotationTypeId:e.annotationType.id,documentNumber:e.documentNumber,annotation:e.annotation,responsibleId:null===(a=e.responsible)||void 0===a?void 0:a.id,sequence:e.sequence},p={filter:{advancedFilterId:l,employeeIds:r,companyIds:s},annotationHistories:c};return this.toDtoAttachments(c,p),p},e}(),Wt=c,Qt=function(){function e(){this.excluido=!1}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&Wt(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Wt(n.lastModifiedDate).toDate();return n.label=["id","codBan","nomBan","abrBan","excluido","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&Wt(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Wt(n.lastModifiedDate).format(),delete n.label,n},e}(),Xt=c,Kt=function(){function e(){this.excluido=!1}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&Xt(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&Xt(n.lastModifiedDate).toDate();return n.label=["id","codAge","nomAge","excluido","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"E030Ban"!==t&&n.e030ban&&(n.e030ban=Qt.fromDto(n.e030ban,"E030Age")),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&Xt(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&Xt(n.lastModifiedDate).format(),delete n.label,"E030Ban"!==t&&n.e030ban&&(n.e030ban=Qt.toDto(n.e030ban,"E030Age")),n},e}(),$t=c,Jt=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.startDate=n.startDate&&$t(n.startDate).toDate(),n.endDate=n.endDate&&$t(n.endDate).toDate(),n.createdDate=n.createdDate&&$t(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&$t(n.lastModifiedDate).toDate();return n.label=["employee.code","employee.person.codPes","employee.person.nomPes","startDate","endDate","bank.codBan","bank.nomBan","bankBranch.codAge","bankBranch.nomAge","bankAccountType","bankAccountNumber","bankAccountDigit","bankAccountPercentage"].map((function(e){return n[e]})).join(" - "),"Employee"!==t&&n.employee&&(n.employee=Vt.fromDto(n.employee,"BankAccountHistory")),"E030Ban"!==t&&n.bank&&(n.bank=Qt.fromDto(n.bank,"BankAccountHistory")),"E030Age"!==t&&n.bankBranch&&(n.bankBranch=Kt.fromDto(n.bankBranch,"BankAccountHistory")),n},e.toDto=function(e,t){var n=z({},e);return n.startDate=n.startDate&&$t(n.startDate).format("YYYY-MM-DD"),n.endDate=n.endDate&&$t(n.endDate).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&$t(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&$t(n.lastModifiedDate).format(),delete n.label,"Employee"!==t&&n.employee&&(n.employee=Vt.toDto(n.employee,"BankAccountHistory")),"E030Ban"!==t&&n.bank&&(n.bank=Qt.toDto(n.bank,"BankAccountHistory")),"E030Age"!==t&&n.bankBranch&&(n.bankBranch=Kt.toDto(n.bankBranch,"BankAccountHistory")),n},e}(),Zt=function(e){function n(t,n,o){var i=e.call(this,t,n,"erpx_fnd/financeiro/entities/e030ban","erpx_fnd/financeiro/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalE030Ban=function(e){return this.http.get("erpx_fnd/financeiro/entities/e030ban",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),en=function(e){function n(t,n,o){var i=e.call(this,t,n,"erpx_fnd/financeiro/entities/e030age","erpx_fnd/financeiro/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalE030Age=function(e){return this.http.get("erpx_fnd/financeiro/entities/e030age",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),tn=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translate=n}return e.prototype.getCompanyStructureHistoryByCompanyId=function(e,t,n,o){return this.http.get(e+"/"+t+"/entities/"+n+"StructureCompanyHistory",{params:this.getListQueryParams({filterQuery:o})}).pipe(s.map((function(e){return e&&e.contents&&e.contents})),this.defaultCatch())},e.prototype.getListQueryParams=function(e){var t=e.page,n=void 0===t?0:t,i=e.size,a=void 0===i?10:i,r=e.sort,s=void 0===r?[]:r,l=e.filterQuery,c=void 0===l?"":l,p=e.displayFields,d=void 0===p?[]:p,m=new o.HttpParams;return m=(m=m.append("size",String(a))).append("offset",String(n)),s&&s.length&&(m=m.append("orderby",s.map((function(e){var t="";return 1===e.order?t=" asc":-1===e.order&&(t=" desc"),""+e.field+t})).join(", "))),c&&(m=m.append("filter",c)),d&&d.length&&(m=m.append("displayfields",d.join())),m},e.prototype.defaultCatch=function(){var e=this;return s.catchError((function(t){if(t){var n=t.status?String(t.status):"Error",o=t.error&&t.error.message||t.statusText||t.message||"Error";401===t.status&&(n=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_title"),o=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_description")),e.messageService.add({severity:"error",summary:n,detail:o})}return r.throwError(t)}))},e.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},e=W([t.Injectable()],e)}(),nn=function(){function o(e,t){this.router=e,this.permissionsService=t,this.employeesIsPresent=new r.Subject,this.companiesIsPresent=new r.Subject,this.isUsingTable=!1,this.cancelForm=new r.Subject,this.collectiveFilterPanelCollapsed=!1}return o.prototype.checkPermissions=function(t,n){var o=this;return this.permissionsService.get(t).pipe(s.map((function(t){return n===e.CollectiveProcessType.INCLUDE?(t.incluir||o.router.navigate(["forbidden"]),t.visualizar):n===e.CollectiveProcessType.EXCLUDE?(t.excluir||o.router.navigate(["forbidden"]),t.excluir):void o.router.navigate(["not-found"])})))},o.prototype.getEmployeesIsPresent=function(){return this.employeesIsPresent.asObservable()},o.prototype.getCompaniesIsPresent=function(){return this.companiesIsPresent.asObservable()},o.prototype.setEmployeeIsPresent=function(e){this.employeesIsPresent.next(e)},o.prototype.setCompaniesIsPresent=function(e){this.companiesIsPresent.next(e)},o.prototype.setCancelForm=function(e){this.cancelForm.next(e)},o.prototype.getCancelForm=function(){return this.cancelForm.asObservable()},o.prototype.getIsUsingTable=function(){return this.isUsingTable},o.prototype.setIsUsingTable=function(e){return this.isUsingTable=e,this.isUsingTable},o.prototype.getPanelStatus=function(){return this.collectiveFilterPanelCollapsed},o.prototype.setPanelStatus=function(e){return this.collectiveFilterPanelCollapsed=e,this.collectiveFilterPanelCollapsed},o.prototype.resetPanelAndTableStatus=function(){this.setIsUsingTable(!1),this.setPanelStatus(!1)},o.ctorParameters=function(){return[{type:d.Router},{type:n.PermissionsService}]},o=W([t.Injectable()],o)}(),on=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&c(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).toDate();return n.label=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&c(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).format(),delete n.label,n},e}(),an=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&c(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).toDate();return n.label=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"DiseaseSubgroup"!==t&&n.diseaseSubgroup&&(n.diseaseSubgroup=on.fromDto(n.diseaseSubgroup,"Disease")),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&c(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).format(),delete n.label,"DiseaseSubgroup"!==t&&n.diseaseSubgroup&&(n.diseaseSubgroup=on.toDto(n.diseaseSubgroup,"Disease")),n},e}(),rn=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.createdDate=n.createdDate&&c(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).toDate();return n.label=["id","code","name","situationType","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),n},e.toDto=function(e,t){var n=z({},e);return n.createdDate=n.createdDate&&c(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).format(),delete n.label,n},e}(),sn=function(){function e(){}return e.fromDto=function(e,t){var n,o=z({},e);o.startDate=o.startDate&&c(o.startDate).toDate(),o.endDate=o.endDate&&c(o.endDate).toDate(),o.birthDate=o.birthDate&&c(o.birthDate).toDate(),o.estimatedEndDate=o.estimatedEndDate&&c(o.estimatedEndDate).toDate(),o.createdDate=o.createdDate&&c(o.createdDate).toDate(),o.lastModifiedDate=o.lastModifiedDate&&c(o.lastModifiedDate).toDate();return o.label=["id","startDate","endDate","sourceReasonChange","processType","processNumber","birthDate","cnpjUnion","onusRemuneration","workAccidentType","justifiedDays","observation","sameReasonEsocial","resultedSicknessAssistance","estimatedEndDate","estimatedDayEnd","generatedByPayroll","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return o[e]})).join(" - "),"Employee"!==t&&o.employee&&(o.employee=Vt.fromDto(o.employee,"LeaveHistory")),"Situation"!==t&&o.situation&&(o.situation=rn.fromDto(o.situation,"LeaveHistory")),"Disease"!==t&&o.diseaseCid&&(o.diseaseCid=an.fromDto(o.diseaseCid,"LeaveHistory")),"DiseaseSubgroup"!==t&&o.subgroupCid&&(o.subgroupCid=on.fromDto(o.subgroupCid,"LeaveHistory")),(null===(n=o.leaveHistoryAttachments)||void 0===n?void 0:n.length)&&(o.leaveHistoryAttachments=o.leaveHistoryAttachments.map((function(e){return{id:e.id,name:e.name,locationURI:e.locationURI,documentId:e.documentId,progress:100}}))),o},e.toDto=function(e,t){var n,o=z({},e);return o.startDate=o.startDate&&c(o.startDate).format("YYYY-MM-DD"),o.endDate=o.endDate&&c(o.endDate).format("YYYY-MM-DD"),(null==o?void 0:o.cnpjUnion)&&"string"==typeof(null==o?void 0:o.cnpjUnion)&&(o.cnpjUnion=+o.cnpjUnion.replaceAll(".","").replaceAll("/","").replaceAll("-","")),(null==o?void 0:o.cnpjForElectiveMandatory)&&"string"==typeof(null==o?void 0:o.cnpjForElectiveMandatory)&&(o.cnpjForElectiveMandatory=o.cnpjForElectiveMandatory.replaceAll(".","").replaceAll("/","").replaceAll("-","")),(null===(n=null==o?void 0:o.cnpjForElectiveMandatory)||void 0===n?void 0:n.length)||(o.cnpjForElectiveMandatory=null),o.birthDate=o.birthDate&&c(o.birthDate).format("YYYY-MM-DD"),o.estimatedEndDate=o.estimatedEndDate&&c(o.estimatedEndDate).format("YYYY-MM-DD"),o.createdDate=o.createdDate&&c(o.createdDate).format(),o.lastModifiedDate=o.lastModifiedDate&&c(o.lastModifiedDate).format(),delete o.label,"Employee"!==t&&o.employee&&(o.employee=Vt.toDto(o.employee,"LeaveHistory")),"Situation"!==t&&o.situation&&(o.situation=rn.toDto(o.situation,"LeaveHistory")),"Disease"!==t&&o.diseaseCid&&(o.diseaseCid=an.toDto(o.diseaseCid,"LeaveHistory")),"DiseaseSubgroup"!==t&&o.subgroupCid&&(o.subgroupCid=on.toDto(o.subgroupCid,"LeaveHistory")),this.toDtoAttachments(e,o),o},e.toDtoAttachments=function(e,t){var n;(null===(n=e.leaveHistoryAttachments)||void 0===n?void 0:n.length)&&(t.leaveHistoryAttachments=e.leaveHistoryAttachments.map((function(e){return{id:e.id,name:e.name,locationURI:e.locationURI}})))},e.toDtoCollective=function(e,t){var n,o,i,a=null===(n=null==t?void 0:t.employeeIds)||void 0===n?void 0:n.map((function(e){return e.id})),r=null===(o=null==t?void 0:t.companyIds)||void 0===o?void 0:o.map((function(e){return e.id})),s=null===(i=null==t?void 0:t.advancedFilter)||void 0===i?void 0:i.id,l=z({},e),p=z(z({},e),{startDate:e.startDate&&c(e.startDate).format("YYYY-MM-DD"),endDate:e.endDate&&c(e.endDate).format("YYYY-MM-DD"),situationId:e.situation.id,estimatedEndDate:e.estimatedEndDate&&c(e.estimatedEndDate).format("YYYY-MM-DD")});p.cnpjUnion&&"string"==typeof p.cnpjUnion&&(p.cnpjUnion=+l.cnpjUnion.replaceAll(".","").replaceAll("/","").replaceAll("-",""));var d={filter:{advancedFilterId:s,employeeIds:a,companyIds:r},leaveHistories:p};return this.toDtoAttachments(p,d.leaveHistories),d},e}(),ln=function(){function e(){this.sendEsocialObservation=!1}return e.fromDto=function(e,t){var n=z({},e);n.competence=n.competence&&c(n.competence).toDate(),n.createdDate=n.createdDate&&c(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).toDate();return n.label=["id","competence","eSocialReasonType","sendEsocialObservation","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"Situation"!==t&&n.situation&&(n.situation=rn.fromDto(n.situation,"ESocialReason")),n},e.toDto=function(e,t){var n=z({},e);return n.competence=n.competence&&c(n.competence).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&c(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).format(),delete n.label,"Situation"!==t&&n.situation&&(n.situation=rn.toDto(n.situation,"ESocialReason")),n},e}(),cn=function(){function e(){}return e.fromDto=function(e,t){var n=z({},e);n.startDate=n.startDate&&c(n.startDate).toDate(),n.endDate=n.endDate&&c(n.endDate).toDate(),n.createdDate=n.createdDate&&c(n.createdDate).toDate(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).toDate();return n.label=["id","eSocialTrainingCodeType","startDate","endDate","createdBy","createdDate","lastModifiedBy","lastModifiedDate"].map((function(e){return n[e]})).join(" - "),"Employee"!==t&&n.employee&&(n.employee=Vt.fromDto(n.employee,"RegulatoryNormTrainingHistory")),n},e.toDto=function(e,t){var n=z({},e);return n.startDate=n.startDate&&c(n.startDate).format("YYYY-MM-DD"),n.endDate=n.endDate&&c(n.endDate).format("YYYY-MM-DD"),n.createdDate=n.createdDate&&c(n.createdDate).format(),n.lastModifiedDate=n.lastModifiedDate&&c(n.lastModifiedDate).format(),delete n.label,"Employee"!==t&&n.employee&&(n.employee=Vt.toDto(n.employee,"RegulatoryNormTrainingHistory")),n},e}();!function(e){e.IS_BEFORE="isBefore",e.IS_AFTER="isAfter",e.IS_SAME="isSame",e.IS_SAME_OR_AFTER="isSameOrAfter",e.IS_SAME_OF_BEFORE="isSameOrBefore",e.IS_NOT_SAME="isNotSame"}(gt||(gt={}));var pn=function(){function e(e){this.cookieService=e}return e.prototype.getPlatformMenuURLProperties=function(e,t,n,o,i){void 0===i&&(i=!0);var a=this.parseUrl(this.getPlatformURL()?this.getPlatformURL():""),r=this.getPlatformURL()+"#/",s="";a.authorityComplete&&(s=a.authorityComplete.split(":")[0]),s.endsWith("/")||(s+="/");var l=a.scheme+":"+s+e+"/"+t+"/"+n+"/#/"+o;return i?decodeURIComponent(r)+"?category=frame&link="+encodeURIComponent(l):l},e.prototype.parseUrl=function(e){e=e||"";var t=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=e.match(t);return{completeUrl:n[0],schemeComplete:n[1],scheme:n[2],authorityComplete:n[3],authority:n[4],path:n[5],queryComplete:n[6],query:n[7],fragmentComplete:n[8],fragment:n[9]}},e.prototype.getPlatformURL=function(){return this.cookieService.get("com.senior.portal.url")},e.ctorParameters=function(){return[{type:u.CookieService}]},e=W([t.Injectable()],e)}(),dn=function(){function e(){}return e.isValidDateCompare=function(e,t,n,o){var i=this;return function(a){var r=a&&a.value;if(r&&t){r=c(a.value);var s=c(e,t);return i.dateCompare(r,s,n,o)}return null}},e.getDateFormatFromLocale=function(e,t){var n=e&&e.dateFormat;if(n){var o=n.replace(/[y]/g,"YY").replace(/[^a-zA-Z]/g,"").toUpperCase();return t&&(o=o.replace("DD","")),o}return null},e.getDateTimeFormatFromLocale=function(e){if(e){var t=e.dateFormat.toString();return t=t.replace(/[y]/g,"YY").toUpperCase(),t+=" HH:mm:ss"}return null},e.getDateFormatFromCalendar=function(e){if(e&&e.dateFormat){var t=e.dateFormat.toString();return t=t.replace(/[y]/g,"YY").toUpperCase()}return null},e.dateCompare=function(e,t,n,o){var i=n===gt.IS_NOT_SAME?gt.IS_SAME:n,a=o&&o.granularity?o.granularity:"day";if(e.isValid()&&t.isValid()){var r=e[i](t,a);if(r=n===gt.IS_NOT_SAME?!r:r){var s={};return s[o&&o.compareName?o.compareName:n]=!0,s}}return null},e.getFormatDateWithBar=function(e){if(e&&e.dateFormat){var t=e.dateFormat.toString();return t=t.replace("dd","DD").replace("mm","MM").replace("yy","YYYY")}return null},e}();function mn(e,t){e.errors&&delete e.errors[t],JSON.stringify(e.errors)==JSON.stringify({})&&e.setErrors(null)}var un,hn=c,yn=function(){function e(e,t,n,o){this.translate=e,this.baseService=t,this.platformService=n,this.messageService=o,this.gridColumnsEmployee=[{field:"employee.code",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_code")},{field:"employee.person.nomPes",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_person_nom_pes")}],this.registerFieldsForValidation=["initialValidity","finalValidity"],this.employeeFieldsForValidation=["hireDate","dismissalDate"],this.startDateDisable=!1,this.ngUnsubscribe=new r.Subject,this.processed=[],this.useBaseHistoryStructure=!0,this.isPreviewEmployee=!1,this.registerStructures=[],this.dateFormat="YYYY-MM-DD"}return Object.defineProperty(e.prototype,"employee",{set:function(e){e?(this.employeeData=e,this.gridColumnsEmployee=[]):this.gridColumnsEmployee=[{field:"employee.code",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_code")},{field:"employee.person.nomPes",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_person_nom_pes")}]},enumerable:!0,configurable:!0}),e.prototype.setValueEmployee=function(e){var t;(null===(t=this.employeeData)||void 0===t?void 0:t.employeeId)&&this.formGroup.get("employee").setValue({id:this.employeeData.employeeId,label:e||""})},e.prototype.filterByEmployee=function(e){var t=e&&e.trim(),n=t?e:"";return this.employeeData?(t&&(n+=" and "),n+"employee eq '"+this.employeeData.employeeId+"'"):n},e.prototype.getFilterRegisterByStartDate=function(e,t){var n;void 0===t&&(t=!0);var o=this.formGroup.get("startDate").value&&hn(this.formGroup.get("startDate").value).format("YYYY-MM-DD");if(o){var i="",a="";(null===(n=this.registerStructures)||void 0===n?void 0:n.length)&&(a=t?" and":"",i="("+(i=this.entity+"Structure in ("+this.registerStructures.map((function(e){return"'"+e+"'"}))+")")+")"),e=e+" "+(e&&i?"and":"")+" "+i+a+" "+(t?"(\n (initialValidity le '"+o+"' and finalValidity ge '"+o+"')\n or (initialValidity is null and finalValidity ge '"+o+"')\n or (initialValidity le '"+o+"' and finalValidity is null)\n or (initialValidity is null and finalValidity is null))":"")}return e},e.prototype.getFilterStructureCompanyHistoryByStartDate=function(e){var t=this.formGroup.get("employee").value,n=t&&t.employer&&t.employer.id,o="";return e&&n&&(o="company eq '"+n+"' and ((startDate le '"+e+"' and endDate ge '"+e+"') or (startDate le '"+e+"' and endDate is null))"),o},e.prototype.onChangeStartDate=function(e){var t,n=this.formGroup.get("employee").value,o=this.formGroup.get("startDate").value,i=!(!n||!e);if(ae(this.formGroup,!i,this.entity),!this.useBaseHistoryStructure&&(null==n?void 0:n.id)&&o){var a={companyIds:[null===(t=null==n?void 0:n.employer)||void 0===t?void 0:t.id],referenceDate:o||null,useStructure:!0};this.updateStructureParamsLookup(a)}else this.getStructureCompanyHistoryByCompanyId(e)},e.prototype.getStructureCompanyHistoryByCompanyId=function(e){var t=this;if(this.useBaseHistoryStructure&&e&&hn(e).isValid()){var n=hn(e).format("YYYY-MM-DD"),o=this.getFilterStructureCompanyHistoryByStartDate(n);n&&o&&(this.loading=!0,this.baseService.getCompanyStructureHistoryByCompanyId(this.domain,this.service,this.entity,o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return t.loading=!1}))).subscribe((function(e){e.forEach((function(e){var n=e[t.entity+"Structure"].id;t.registerStructures.includes(n)||t.registerStructures.push(n)}))})))}},e.prototype.onSelectEmployee=function(e){var t,n=this.formGroup.get("startDate").value,o=!!n&&e,i=this.formGroup.get("employee").value;if(ae(this.formGroup,!o,this.entity),this.setValidatorStartDate(e,"employee"),!this.useBaseHistoryStructure&&(null==i?void 0:i.id)&&n){var a={companyIds:[null===(t=null==i?void 0:i.employer)||void 0===t?void 0:t.id],referenceDate:n||null,useStructure:!0};this.updateStructureParamsLookup(a)}else n&&this.getStructureCompanyHistoryByCompanyId(n)},e.prototype.updateStructureParamsLookup=function(e){var t,n=hn(null==e?void 0:e.referenceDate).format("YYYY-MM-DD"),o={companyIds:e.companyIds,referenceDate:n||null,useStructure:!0};n&&(null===(t=o.companyIds)||void 0===t?void 0:t.length)&&(o.referenceDate=hn(null==o?void 0:o.referenceDate).format("YYYY-MM-DD"),this.structureParams=z(z({},this.structureParams),o))},e.prototype.setValidatorStartDate=function(e,t){var n="employee"===t?e:this.formGroup.get("employee").value,o="employee"===t?this.formGroup.get(t).value:e,i=[{field:"startDate",disabled:this.startDateDisable,clearValue:!1,validators:$([p.Validators.required],this.setValidatorRegisterValidity(o),this.setValidatorStartDateByEmployee(n))}];oe(this.formGroup,i)},e.prototype.setValidatorRegisterValidity=function(e){var t=[];return e&&e.initialValidity&&t.push(dn.isValidDateCompare(e.initialValidity,this.dateFormat,gt.IS_BEFORE,{compareName:"dateBeforeRegisterInitialDate"})),e&&e.finalValidity&&t.push(dn.isValidDateCompare(e.finalValidity,this.dateFormat,gt.IS_SAME_OR_AFTER,{compareName:"dateBeforeRegisterFinalDate"})),t},e.prototype.setValidatorStartDateByEmployee=function(e){var t=e,n=[];return t&&t.hireDate&&(n.push(dn.isValidDateCompare(t.hireDate,this.dateFormat,gt.IS_BEFORE,{compareName:"dateBeforeAdmission"})),t.dismissalDate&&n.push(dn.isValidDateCompare(t.dismissalDate,this.dateFormat,gt.IS_AFTER,{compareName:"dateAfterDismissal"}))),n},e.prototype.onEditDisableFields=function(){ae(this.formGroup,!0,"employee",!1),ae(this.formGroup,!0,"startDate",!1)},e.prototype.startFuncionsByBaseHistory=function(e){this.subscribeValuesChanges(),this.setValueEmployee(e)},e.prototype.startFuncionsByBaseHistoryInEdit=function(e){this.onEditDisableFields(),this.startDateDisable=!0,this.onChangeStartDate(e&&e.startDate)},e.prototype.subscribeValuesChanges=function(){var e=this;this.formGroup.get("employee").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.onSelectEmployee(t)})),this.formGroup.get("startDate").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.onChangeStartDate(t)}))},e.prototype.getDisableRegister=function(e,t,n,o){var i,a=this.formGroup.get("startDate").value,r=!!e||(null===(i=this.formGroup.get("employee").value)||void 0===i?void 0:i.id);return!(!!(a&&r)&&!t&&n.editar&&!o)},e.ctorParameters=function(){return[{type:a.TranslateService},{type:tn},{type:pn},{type:i.MessageService}]},W([t.Input()],e.prototype,"isPreviewEmployee",void 0),W([t.Input()],e.prototype,"employee",null),e=W([t.Component({template:""})],e)}(),fn=function(){function e(e){this._permissionsService=e}return e.prototype.hasPermissionViewEmployeeDependent=function(){return this.checkPermissions([{actions:["visualizar"],entities:["employee","e001pes","employeeDependent"]}])},e.prototype.hasEmployeeListPermission=function(){return this._permissionsService.get("employee").pipe(s.map((function(e){return e.visualizar})))},e.prototype.checkPermissions=function(e){var t=this;return r.forkJoin(e.map((function(e){return r.forkJoin(e.entities.map((function(e){return t._permissionsService.get(e)}))).pipe(s.map((function(t){return t.every((function(t){return e.actions.every((function(e){return t[e]}))}))})))}))).pipe(s.map((function(e){return e.every((function(e){return e}))})))},e.ctorParameters=function(){return[{type:n.PermissionsService}]},e=W([t.Injectable()],e)}(),_n=function(){function e(){}return e.prototype.focusFirstInvalidInput=function(){var e=Array.from(document.getElementsByClassName("ng-invalid")).find((function(e){return"FORM"!==e.nodeName}));if(e)if("P-CALENDAR"===e.nodeName){var t=e.getAttribute("ng-reflect-input-id"),n=document.getElementById(t);n&&n.focus()}else if("S-LOOKUP"===e.nodeName){var o=this.getNestedInput(e.firstElementChild);o&&o.focus()}else e.focus()},e.prototype.getNestedInput=function(e){return"INPUT"===e.nodeName?e:this.getNestedInput(e.firstElementChild)},e=W([t.Injectable()],e)}(),vn=c,gn=function(){function e(e){this.http=e,this.baseUrl="hcm_clocking_event_time_evaluation/general/"}return e.prototype.getWorkshiftChangeByDate=function(e,t){return this.http.post(this.baseUrl+"queries/getWorkshiftChangeByDate",{employeeId:e,searchDate:vn(t).format("YYYY-MM-DD")})},e.ctorParameters=function(){return[{type:o.HttpClient}]},e=W([t.Injectable()],e)}(),bn=function(){function e(){}return e.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e=W([t.Injectable({providedIn:"root"})],e)}(),Sn=function(){function e(e,t){this.http=e,this.messageService=t,this.http=e,this.messageService=t,this.defaultCatch=this.defaultCatch.bind(this)}return e.prototype.commitFiles=function(e){return this.http.post("platform/field_customization/actions/commitObject",{objects:e}).pipe(this.defaultCatch())},e.prototype.deleteFiles=function(e){return this.http.post("platform/field_customization/actions/deleteObjects",e).pipe(this.defaultCatch())},e.prototype.getFiles=function(e){var t=this,n=[];e.value.custom&&(n=e.value.custom.fieldCustomization||[],delete e.value.custom.fieldCustomization);var o=[],i={};return n.forEach((function(e){var n=e.domain,a=e.service,r=e.entity,s=e.toDelete,l=e.toInsert;if(!t.isEmpty(l)){var c=Object.keys(l).map((function(e){return{version:l[e].version,fileName:l[e].name,objectId:l[e].objectId}}));t.isEmpty(c)||o.push.apply(o,$(c))}if(!t.isEmpty(s)){var p=[];Object.keys(s).forEach((function(e){var t=(s[e]||[]).map((function(t){return{field:e,objectId:t}}));p.push.apply(p,$(t))})),i={domain:n,service:a,entityName:r,objects:p}}})),{filesToCommit:o,filesToDelete:i}},e.prototype.isEmpty=function(e){return Array.isArray(e)?0===e.length:0===Object.entries(e).length&&e.constructor===Object},e.prototype.defaultCatch=function(){var e=this;return s.catchError((function(t){if(t){var n=t.status?String(t.status):"Error",o=t.error&&t.error.message||t.statusText||t.message||"Error";e.messageService.add({severity:"error",summary:n,detail:o})}return r.throwError(t)}))},e.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService}]},e=W([t.Injectable()],e)}(),Dn=function(){},Tn=function(){function e(){this.ZERO=0,this.MINUTES_IN_A_HOUR=60}return e.prototype.dateToMinutes=function(e,t){return e?this.getTotalMinutes(e.getHours(),e.getMinutes()):t?this.ZERO:void 0},e.prototype.minutesToDate=function(e){if(Boolean(e)||0===e){var t=this.getHours(e),n=this.getMinutes(e);return this.toDate(t,n)}return null},e.prototype.toDate=function(e,t){var n=new Date;return n.setHours(e),n.setMinutes(t),n},e.prototype.getHours=function(e){return Math.floor(e/this.MINUTES_IN_A_HOUR)},e.prototype.getMinutes=function(e){return e%this.MINUTES_IN_A_HOUR},e.prototype.getTotalMinutes=function(e,t){return e*this.MINUTES_IN_A_HOUR+t},e=W([t.Injectable()],e)}(),Fn=function(){function e(){this.GET_USER_ID=A.user.getUserData().then((function(e){return e.id}))}return e.prototype.store=function(e,t){return Q(this,void 0,void 0,(function(){var n,o;return X(this,(function(i){switch(i.label){case 0:return o=(n=localStorage).setItem,[4,this.GET_USER_ID];case 1:return o.apply(n,[i.sent()+"_"+e,JSON.stringify(t)]),[2]}}))}))},e.prototype.get=function(e){return Q(this,void 0,void 0,(function(){var t,n,o,i;return X(this,(function(a){switch(a.label){case 0:return n=(t=JSON).parse,i=(o=localStorage).getItem,[4,this.GET_USER_ID];case 1:return[2,n.apply(t,[i.apply(o,[a.sent()+"_"+e])])||{}]}}))}))},e}(),En=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.FILTERS_KEY="SENIOR_FILTERS",t}return Y(n,e),n.prototype.storeFilters=function(t,n){return Q(this,void 0,void 0,(function(){var o;return X(this,(function(i){switch(i.label){case 0:return[4,e.prototype.get.call(this,this.FILTERS_KEY)];case 1:return o=i.sent()||{},this.removeEmptyValues(n),o[t]=n,[4,e.prototype.store.call(this,this.FILTERS_KEY,o)];case 2:return i.sent(),[2]}}))}))},n.prototype.getFilters=function(t){return Q(this,void 0,void 0,(function(){return X(this,(function(n){switch(n.label){case 0:return[4,e.prototype.get.call(this,this.FILTERS_KEY)];case 1:return[2,(n.sent()||{})[t]||{}]}}))}))},n.prototype.removeFilter=function(t){return Q(this,void 0,void 0,(function(){var n;return X(this,(function(o){switch(o.label){case 0:return[4,e.prototype.get.call(this,this.FILTERS_KEY)];case 1:return delete(n=o.sent()||{})[t],[4,e.prototype.store.call(this,this.FILTERS_KEY,n)];case 2:return o.sent(),[2]}}))}))},n.prototype.clearFilterValue=function(t,n){return Q(this,void 0,void 0,(function(){var o;return X(this,(function(i){switch(i.label){case 0:return[4,e.prototype.get.call(this,this.FILTERS_KEY)];case 1:return o=i.sent()||{},this.removeEmptyValues(n),o[t]=n,[4,e.prototype.store.call(this,this.FILTERS_KEY,o)];case 2:return i.sent(),[2]}}))}))},n.prototype.removeEmptyValues=function(e){Object.keys(e).forEach((function(t){(Array.isArray(e[t])?0!==e[t].length:e[t])||delete e[t]}))},n=W([t.Injectable()],n)}(Fn),Cn=function(){function e(){this.GET_USER_ID=A.user.getUserData().then((function(e){return e.id})),this.PAGINATOR_KEY="SENIOR_PAGINATOR"}return e.prototype.store=function(e,t){return Q(this,void 0,void 0,(function(){var n,o;return X(this,(function(i){switch(i.label){case 0:return o=(n=sessionStorage).setItem,[4,this.GET_USER_ID];case 1:return o.apply(n,[i.sent()+"_"+e,JSON.stringify(t)]),[2]}}))}))},e.prototype.get=function(e){return Q(this,void 0,void 0,(function(){var t,n,o,i;return X(this,(function(a){switch(a.label){case 0:return n=(t=JSON).parse,i=(o=sessionStorage).getItem,[4,this.GET_USER_ID];case 1:return[2,n.apply(t,[i.apply(o,[a.sent()+"_"+e])])||{}]}}))}))},e.prototype.storePaginator=function(e,t){return void 0===t&&(t={}),Q(this,void 0,void 0,(function(){var n;return X(this,(function(o){switch(o.label){case 0:return[4,this.get(this.PAGINATOR_KEY)];case 1:return(n=o.sent()||{})[e]=t,[4,this.store(this.PAGINATOR_KEY,n)];case 2:return o.sent(),[2]}}))}))},e.prototype.getPaginator=function(e){return Q(this,void 0,void 0,(function(){return X(this,(function(t){switch(t.label){case 0:return[4,this.get(this.PAGINATOR_KEY)];case 1:return[2,(t.sent()||{})[e]||{}]}}))}))},e=W([t.Injectable()],e)}(),kn=function(){function e(){}return e=W([t.NgModule({imports:[C.SplitButtonModule,F.MessagesModule,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,f.CurrencyMaskModule,l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,P.FilterContainerModule,l.DynamicFormModule,E.PanelModule,D.InputTextModule,l.ButtonModule,v.ConfirmDialogModule,_.CalendarModule,y.HotkeyModule,l.LoadingStateModule,b.InputMaskModule,l.InfoSignModule,g.DropdownModule,T.InputTextareaModule,R.ToastModule,L.ToggleButtonModule],providers:[En,Cn,_n,Sn,gn,bn,fn,{provide:Dn,useClass:Tn}],declarations:[],exports:[C.SplitButtonModule,F.MessagesModule,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,l.DynamicFormModule,E.PanelModule,D.InputTextModule,l.ButtonModule,v.ConfirmDialogModule,l.CalendarMaskModule,_.CalendarModule,y.HotkeyModule,l.LoadingStateModule,T.InputTextareaModule,S.InputSwitchModule,l.TokenListModule,k.TableModule,R.ToastModule,w.SelectButtonModule,l.TableModule,L.ToggleButtonModule,I.TabViewModule,M.ExclusionDetailsModule]})],e)}(),In=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn],declarations:[yn],providers:[tn],exports:[yn]})],e)}(),Rn=c,Ln=function(e){function n(t,n,o,i,a){var r=e.call(this,t,n,o,i)||this;return r.translate=t,r.baseService=n,r.platformService=o,r.messageService=i,r.collectiveService=a,r.collectiveFormGroup=new p.FormGroup({}),r.processed=[],r.companyIds=[],r.isCollective=!1,r}return Y(n,e),n.prototype.startFuncionsByBaseCollectiveHistory=function(){this.subscribeValuesChangesInCollective(),this.logsURL=this.platformService.getPlatformMenuURLProperties("logs","logs","process","process-summary-user",!0)},n.prototype.subscribeValuesChangesInCollective=function(){var e=this;this.formGroup.get("startDate").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe),s.distinct()).subscribe((function(t){e.onChangeStartDateInCollective(t)}))},n.prototype.onChangeStartDateInCollective=function(e){var t=this.formGroup.get("startDate").value;ae(this.formGroup,!t,this.entity),!this.useBaseHistoryStructure&&t?this.setStructureParamsInCollective():t&&this.getStructureCompanyHistoryByCompaniesInCollective(t)},n.prototype.getStructureCompanyHistoryByCompaniesInCollective=function(e){var t,n=this;if(this.useBaseHistoryStructure&&e&&Rn(e).isValid()&&(null===(t=this.companyIds)||void 0===t?void 0:t.length)){var o=Rn(e).format("YYYY-MM-DD"),i=this.getFilterStructureCompanyHistoryByStartDateInCollective(o);i&&o&&(this.loading=!0,this.baseService.getCompanyStructureHistoryByCompanyId(this.domain,this.service,this.entity,i).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return n.loading=!1}))).subscribe((function(e){e.forEach((function(e){var t=e[n.entity+"Structure"].id;n.registerStructures.includes(t)||n.registerStructures.push(t)}))})))}else this.registerStructures=[]},n.prototype.getFilterStructureCompanyHistoryByStartDateInCollective=function(e){var t="";return e&&this.companyIds&&(t="company in ("+this.companyIds.map((function(e){return"'"+e+"'"}))+") and ((startDate le '"+e+"' and endDate ge '"+e+"') or (startDate le '"+e+"' and endDate is null))"),t},n.prototype.setStructureParamsInCollective=function(){var e,t=this.formGroup.get("startDate").value,n={companyIds:this.companyIds,referenceDate:t||null,useStructure:!0};t&&(null===(e=this.companyIds)||void 0===e?void 0:e.length)?(n.referenceDate=Rn(null==n?void 0:n.referenceDate).format("YYYY-MM-DD"),this.structureParams=z(z({},this.structureParams),n)):this.structureParams={companyIds:null,referenceDate:null,useStructure:!1}},n.prototype.doAfterProcess=function(e){this.collectiveService.setCancelForm(!0),this.loading=!1;var t={evaluateProcessStart:this.translate.instant("hcm_contract.employment_contract.evaluate_process_start"),evaluteProcessConclusion:this.translate.instant("hcm_contract.employment_contract.evaluate_process_conclusion"),clickHere:this.translate.instant("hcm_contract.employment_contract.click_here")};this.messageService.addAll([{severity:"success",summary:this.translate.instant("hcm_contract.employment_contract.success_tooltip"),detail:t.evaluteProcessConclusion}]),this.processed=[],this.processed.push([{key:"info",severity:"info",summary:t.evaluateProcessStart+' <a target="_parent" href="'+this.logsURL+"/"+e.summaryId+'">'+t.clickHere+"</a>"}]),this.collectiveService.setEmployeeIsPresent(!1),this.collectiveService.setCompaniesIsPresent(!1),this.collectiveService.resetPanelAndTableStatus()},n.prototype.onSelectBasicFilterByEmployee=function(e){var t,n,o=this;e?(this.employeeFilter=e,this.onSelectBasicFilter()):!e&&(null===(t=this.employeeFilter)||void 0===t?void 0:t.length)&&(null===(n=this.employeeFilter)||void 0===n||n.filter((function(e){var t,n=null===(t=e.employer)||void 0===t?void 0:t.id;o.companyIds.splice(n,1)})));var i=this.formGroup.get("startDate").value;!this.useBaseHistoryStructure&&i?this.setStructureParamsInCollective():i&&this.getStructureCompanyHistoryByCompaniesInCollective(i)},n.prototype.onSelectBasicFilter=function(){var e,t,n=this;this.companyIds=[],null===(e=this.employeeFilter)||void 0===e||e.filter((function(e){var t,o,i,a=null===(t=e.employer)||void 0===t?void 0:t.id;if(!(null===(o=n.companyIds)||void 0===o?void 0:o.length)||(null===(i=n.companyIds)||void 0===i?void 0:i.length)&&!n.companyIds.includes(a))return n.companyIds.push(a)})),null===(t=this.companyFilter)||void 0===t||t.filter((function(e){var t,o,i=e.id?e.id:e;if(!(null===(t=n.companyIds)||void 0===t?void 0:t.length)||(null===(o=n.companyIds)||void 0===o?void 0:o.length)&&!n.companyIds.includes(i))return n.companyIds.push(i)}))},n.prototype.onSelectBasicFilterByCompany=function(e){var t,n,o=this;e?(this.companyFilter=e,this.onSelectBasicFilter()):!e&&(null===(t=this.companyFilter)||void 0===t?void 0:t.length)&&(null===(n=this.companyFilter)||void 0===n||n.filter((function(e){var t=e.id;o.companyIds.splice(t,1)})));var i=this.formGroup.get("startDate").value;!this.useBaseHistoryStructure&&i?this.setStructureParamsInCollective():i&&this.getStructureCompanyHistoryByCompaniesInCollective(i)},n.ctorParameters=function(){return[{type:a.TranslateService},{type:tn},{type:pn},{type:i.MessageService},{type:nn}]},W([t.Input()],n.prototype,"companyIds",void 0),W([t.Input()],n.prototype,"isCollective",void 0),n=W([t.Component({template:""})],n)}(yn),An=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn],declarations:[Ln],providers:[tn],exports:[Ln]})],e)}();!function(e){e.EMPLOYEE="EMPLOYEE",e.MANAGEMENT="MANAGEMENT"}(un||(un={}));var wn=c,Pn=function(e){function n(t,n,o,i,a,s){var l=e.call(this,t,n,i,a)||this;return l.translate=t,l.baseService=n,l.employeeService=o,l.platformService=i,l.messageService=a,l.leaveHistoryBffService=s,l.onClose=new r.Subject,l.onFormLoadingSubject=new r.Subject,l.onCloseObservable=l.onClose.asObservable(),l.onFormLoading=l.onFormLoadingSubject.asObservable(),l.isClockingEvent=!1,l.gridColumnsEmployee=[{field:"employee.code",header:l.translate.instant("hcm_contract.employment_contract.workshift_history_employee_code")},{field:"employee.person.nomPes",header:l.translate.instant("hcm_contract.employment_contract.workshift_history_employee_person_nom_pes")}],l.DELETE="Delete",l}var o;return Y(n,e),o=n,Object.defineProperty(n.prototype,"employee",{set:function(e){e?(this.employeeData=e,this.gridColumnsEmployee=[{field:"employee.code",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_code")},{field:"employee.person.nomPes",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_employee_person_nom_pes")}]):this.gridColumnsEmployee=[]},enumerable:!0,configurable:!0}),n.prototype.updateSuggestions=function(e){throw new Error("You have to implement the method updateSuggestions!")},n.prototype.clockingEventOnSave=function(){throw new Error("You have to implement the method clockingEventOnSave!")},n.prototype.onDelete=function(){throw new Error("You have to implement the method onDelete!")},n.prototype.setHotkeys=function(){throw new Error("You have to implement the method setHotkeys!")},n.prototype.createHistoryDTO=function(e,t){throw new Error("You have to implement the method createHistoryDTO!")},n.prototype.isNew=function(){throw new Error("You have to implement the method isNew!")},n.prototype.goBack=function(){throw new Error("You have to implement the method goBack!")},n.prototype.finishOperation=function(){this.isClockingEvent&&this.onClose.next(!0)},n.prototype.createClockingEventLeaveHistoryObservable=function(e){var t;if(e.situation=function(e){var t=new rn;return t.id=e.situation.id,t}(e),e.employee=function(e){var t=new Vt;return t.id=e.employee.id,t}(e),this.isNew()||this.employeeData&&!e.id)t=this.leaveHistoryBffService.insert(e);else{var n=this.employeeData?e.id:this.routeParams.leaveHistory;t=this.leaveHistoryBffService.update(n,e)}return t},n.prototype.deleteClockingEventLeaveHistory=function(e){return this.leaveHistoryBffService.delete(e)},n.prototype.allocateLoadedEmployee=function(){var e,t,n=this;this.employeeData?(this.onFormLoadingSubject.next(!0),this.loadLockedEmployee(this.employeeData),null===(e=this.onSubmitObservable)||void 0===e||e.pipe(s.takeUntil(this.ngUnsubscribe),s.filter((function(e){return e===n.historyName||e===""+n.historyName+n.DELETE}))).subscribe((function(e){n.getOperationType(e)===n.DELETE?n.onDelete():n.clockingEventOnSave()})),null===(t=this.onLockedEmployeeChanges)||void 0===t||t.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){n.loadLockedEmployee(e)}))):this.setHotkeys()},n.prototype.addMessage=function(e,t,n){this.employeeData&&this.isClockingEvent?this.messageService.add({key:"employee-clocking-event-adjustment-list-view",severity:e,summary:this.translate.instant(t),detail:this.translate.instant(n)}):this.messageService.add({severity:e,summary:this.translate.instant(t),detail:this.translate.instant(n)})},n.prototype.loadLockedEmployee=function(e){var t=this;if(this.formGroup.controls[o.EMPLOYEE].value)this.formGroup.controls[o.START_DATE].setValue(wn(e.evaluationDate).toDate()),this.onFormLoadingSubject.next(!1);else{var n={filterQuery:"id eq '"+e.employeeId+"'",displayFields:["person.nomPes","employer.*","code","employmentRelationship.contractType"]};this.loading=!0,this.formGroup.controls.employee.disable(),this.employeeService.listExternalEmployee(n).subscribe((function(n){if(!e.schedule){var o=t.createHistoryDTO(e.evaluationDate,n.contents[0]);t.updateSuggestionsAndPatchValue(o),t.loading=!1,t.onFormLoadingSubject.next(!1)}}))}},n.prototype.getOperationType=function(e){var t=e.split(/(?=[A-Z])/);return t[t.length-1]},n.prototype.updateSuggestionsAndPatchValue=function(e){this.formGroup.patchValue(e),this.updateSuggestions(e)},Object.defineProperty(n.prototype,"isReadOnly",{get:function(){var e;return this.isClockingEvent&&(null===(e=this.employeeData)||void 0===e?void 0:e.readOnly)},enumerable:!0,configurable:!0}),n.prototype.setDisabledStatus=function(e){this.isReadOnly&&e.disable()},n.EMPLOYEE="employee",n.START_DATE="startDate",n.ctorParameters=function(){return[{type:a.TranslateService},{type:tn},{type:qe},{type:pn},{type:i.MessageService},{type:it}]},W([t.Input()],n.prototype,"onSubmitObservable",void 0),W([t.Input()],n.prototype,"onLockedEmployeeChanges",void 0),W([t.Output()],n.prototype,"onCloseObservable",void 0),W([t.Output()],n.prototype,"onFormLoading",void 0),W([t.Input()],n.prototype,"isClockingEvent",void 0),W([t.Input()],n.prototype,"employee",null),n=o=W([t.Component({template:""})],n)}(Ln),Mn=c,Gn=function(n){function o(t,o,i,a,r,s,l,p,d,m,u,h,y,f,_,v,g,b,S,D,T){var F=n.call(this,l,f,h,v,a)||this;return F.workshiftHistoryService=t,F.router=o,F.route=i,F.messageService=a,F.confirmationService=r,F.formBuilder=s,F.translate=l,F.hotkeysService=p,F.fieldCustomization=d,F.focusService=m,F.workshiftGroupService=u,F.employeeService=h,F.cd=y,F.baseService=f,F.clockingEventFoundationGeneralService=_,F.platformService=v,F.workshiftLookupService=g,F.collectiveService=b,F.workshiftHistoryAdjustmentService=S,F.employeeLibService=D,F.workshiftInformationHistoryService=T,F.localeConfig={},F.currencyLocaleOptions={},F.permissions={},F.allPermissions={},F.requiredWorkshiftGroup=!1,F.mainPanelCollapsed=!1,F.workshiftGroupLookupDisplayFields=["code","baseDate"],F.workshiftGroupAdvancedDisplayFields=["code","baseDate"],F.eSocialWorkingHoursTypeOptions=[{label:F.translate.instant("hcm_contract.employment_contract.workshift_esocial_working_hours_type_v1"),value:e.ESocialWorkingHoursType.V1},{label:F.translate.instant("hcm_contract.employment_contract.workshift_esocial_working_hours_type_v2"),value:e.ESocialWorkingHoursType.V2},{label:F.translate.instant("hcm_contract.employment_contract.workshift_esocial_working_hours_type_v3"),value:e.ESocialWorkingHoursType.V3},{label:F.translate.instant("hcm_contract.employment_contract.workshift_esocial_working_hours_type_v4"),value:e.ESocialWorkingHoursType.V4}],F.domain=c.DOMAIN,F.service=c.SERVICE,F.entity=c.WORKSHIFT,F.historyName=c.HISTORY_NAME,F.useBaseHistoryStructure=!1,F}var c;return Y(o,n),c=o,o.prototype.ngOnInit=function(){var e=this;this.collectiveProcessType=this.route.snapshot.fragment,this.formGroup=this.getFormGroup(),this.route.queryParams.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){t.id&&(e.employeeData={employeeId:t.id})})),this.allocateLoadedEmployee(),this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)})),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.workshiftGroupSearchFields=this.getWorkshiftGroupSearchFields(),this.workshiftGroupSearchGridFields=this.getWorkshiftGroupSearchGridFields(),this.setHotkeys()},o.prototype.ngAfterViewChecked=function(){this.cd.detectChanges()},o.prototype.ngAfterViewInit=function(){var e=document.getElementsByTagName("input"),t=Array.from(e).find((function(e){return!e.disabled}));t&&!this.isClockingEvent&&t.focus()},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+s",(function(){return(e.isNew()||e.permissions.editar)&&e.confirmBeforeSave(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+c",(function(){return e.onCancel(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.isNew=function(){return"new"===this.routeParams.workshiftHistory},o.prototype.fieldIsNotNull=function(e){return!!this.formGroup.get(e).value},o.prototype.onRouteParamsChange=function(e){this.routeParams=e},o.prototype.updateSuggestions=function(e){var t,n,o=this;e.workshiftGroup&&(e.workshiftGroup.label=this.buildWorkshiftGroupLabel(e.workshiftGroup)),this.workshiftLookupService.updateSuggestions(e);var i=this.formGroup.get("eSocialWorkingHoursType");i.disable(),this.workshiftInformationHistoryService.list({filterQuery:"employee.id eq '"+(null===(t=e.employee)||void 0===t?void 0:t.id)+"' and startDate eq '"+Mn(e.startDate).format("YYYY-MM-DD")+"'"}).pipe(s.finalize((function(){o.loading=!1,o.permissions.editar&&i.enable()}))).subscribe((function(e){var t;if(null===(t=e.contents)||void 0===t?void 0:t.length){var n=e.contents.reduce((function(e,t){return new Date(e.startDate)>new Date(t.startDate)?e:t}));i.setValue(n.eSocialWorkingHoursType)}})),this.employeeLibService.updateSuggestions(e),this.labelEmployee=null===(n=e.employee)||void 0===n?void 0:n.label},o.prototype.buildWorkshiftGroupLabel=function(e){return this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_group").concat(" - "+e.code+" - "+Mn(e.baseDate).format("L"))},o.prototype.onRouteDataChange=function(e){var t,n,o=e.localeConfig.number,i=o.currencySymbol,a=o.thousandsSeparator,r=o.decimalSeparator;if(this.isManager="profileType"in e&&e.profileType===un.MANAGEMENT,this.localeConfig=e.localeConfig,this.currencyLocaleOptions={align:"left",prefix:i,thousands:a,decimal:r},this.permissions=null===(t=null==e?void 0:e.allPermissions)||void 0===t?void 0:t.workshiftHistory,this.allPermissions=null==e?void 0:e.allPermissions,this.customizationPermission=null===(n=null==e?void 0:e.allPermissions)||void 0===n?void 0:n.customization,this.validateVisualization(),e.entity){this.permissions.editar||this.formGroup.disable(),e.entity.workshift.name||(e.entity.workshift.name=this.translate.instant("hcm_contract.employment_contract.list_grid_empty_field"));var s=qt.fromDto(e.entity);this.updateSuggestions(s),this.formGroup.patchValue(s),this.onSelectWorkshift(null==s?void 0:s.workshift,!1),this.startFuncionsByBaseHistoryInEdit(s),this.setDisabledStatus(this.formGroup)}else this.formGroup.patchValue(new qt),this.isCollective?this.startFuncionsByBaseCollectiveHistory():this.startFuncionsByBaseHistory()},o.prototype.onCancel=function(){this.isCollective?this.collectiveService.setCancelForm(!0):this.goBack()},o.prototype.onSendFile=function(e,t){var n=[];return this.fieldCustomization.isEmpty(e)||n.push(this.fieldCustomization.deleteFiles(e)),this.fieldCustomization.isEmpty(t)||n.push(this.fieldCustomization.commitFiles(t)),this.fieldCustomization.isEmpty(n)?r.of({}):r.forkJoin(n)},o.prototype.confirmBeforeSave=function(){var e=this;if(this.loading=!1,!this.formGroup.valid)return this.onFormLoadingSubject.next(!1),this.validateAllFormFields(this.formGroup);(this.isNew()||this.employeeData)&&this.formGroup.get("employee").value?this.workshiftHistoryService.getEmployeeWorkshiftByDate(this.formGroup.get("employee").value.id,this.formGroup.get("startDate").value).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(t){return e.infoBeforeSave(),r.throwError(t)}))).subscribe((function(t){var n,o;(null===(n=e.formGroup.value.workshift)||void 0===n?void 0:n.id)===t.workshiftId&&(null===(o=e.formGroup.value.workshiftGroup)||void 0===o?void 0:o.id)===t.workshiftGroupId?e.confirmationService.confirm({header:e.translate.instant("hcm_contract.employment_contract.generic_confirm"),message:e.translate.instant("hcm_contract.employment_contract.validation_employee_has_this_work_shift_on_period"),accept:function(){e.loading=!0,e.infoBeforeSave()}}):e.infoBeforeSave()})):(this.loading=!1,this.onSave())},o.prototype.infoBeforeSave=function(){var e=this;this.loading=!0,this.clockingEventFoundationGeneralService.getWorkshiftChangeByDate(this.formGroup.get("employee").value.id,this.formGroup.get("startDate").value).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(t){return e.onSave(),r.throwError(t)}))).subscribe((function(t){t.startDate&&e.messageService.add({severity:"warn",detail:e.translate.instant("hcm_contract.employment_contract.employee_has_workshift_change_in_period",{startDate:Mn(t.startDate).format(e.localeConfig.calendar.dateFormat.toUpperCase()),endDate:Mn(t.endDate).format(e.localeConfig.calendar.dateFormat.toUpperCase())})}),e.onSave()}))},o.prototype.onSave=function(){var e=this;this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onSaveCollective()}}):this.onSaveSigle()},o.prototype.onSaveCollective=function(){var e=this;this.loading=!0;var t=this.formGroup.getRawValue(),n=this.collectiveFormGroup.getRawValue(),o=qt.toDtoCollective(t,null==n?void 0:n.filter);this.workshiftHistoryService.saveCollective(o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onSaveSigle=function(){var e=this;this.loading=!0;var t=this.fieldCustomization.getFiles(this.formGroup),n=t.filesToDelete,o=t.filesToCommit;this.getSaveObservable().pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,e.onFormLoadingSubject.next(!1),r.throwError(t)}))).subscribe((function(){e.onSendFile(n,o).pipe(s.takeUntil(e.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,r.throwError(t)}))).subscribe((function(){e.addMessage("success","hcm_contract.employment_contract.saved_message_title","hcm_contract.employment_contract.saved_message_content"),e.employeeData&&e.isClockingEvent?(e.onClose.next(!0),e.loading=!1):e.goBack()}))}))},o.prototype.onDeleteCollective=function(){var e=this,t=this.formGroup.getRawValue(),n=this.collectiveFormGroup.getRawValue(),o=qt.toDtoCollective(t,null==n?void 0:n.filter);this.workshiftHistoryService.deleteCollective(o).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onDelete=function(){var e=this;if(!this.formGroup.valid)return this.loading=!1,this.onFormLoadingSubject.next(!1),this.validateAllFormFields(this.formGroup);this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onDeleteCollective()}}):this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_title"),accept:function(){e.showLoader=!0,e.loading=!0,e.onFormLoadingSubject.next(!0),e.getDeleteObservable().pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.loading=!1,e.showLoader=!1}))).subscribe((function(){e.goBack(),e.finishOperation()}))}})},o.prototype.doAfterProcessAndResetFormGroup=function(e){this.doAfterProcess(e),this.resetFormGroup()},o.prototype.resetFormGroup=function(){this.formGroup.reset(),this.formGroup.get("workshiftGroup").disable()},o.prototype.onWorkshiftGroupLookupRequest=function(e,t){var n=this;void 0===t&&(t=!1);var o=this.workshiftGroupLookupDisplayFields.map((function(e){return{field:e,order:1}})),i=this.getWorkshiftGroupSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or ");i=this.getFilterWorkshiftGroup(i);var a=Ee(this.workshiftGroupLookupDisplayFields,this.workshiftGroupAdvancedDisplayFields);this.workshiftGroupService.listExternalWorkshiftGroup({sort:o,filterQuery:i,displayFields:a}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:n.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_group")+" - "+e.code+" - "+(e&&Mn(e.baseDate).format("L"))})}))})}))).subscribe((function(e){n.workshiftGroupLookupSuggestions=e.contents,t&&n.workshiftGroupLookupSuggestions.length&&1==n.workshiftGroupLookupSuggestions.length&&n.formGroup.get("workshiftGroup").setValue(n.workshiftGroupLookupSuggestions[0])}))},o.prototype.onWorkshiftGroupSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getWorkshiftGroupSearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+Mn(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+Mn(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+Mn(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and ");p=this.getFilterWorkshiftGroup(p);var d=Ee(this.workshiftGroupLookupDisplayFields,this.workshiftGroupAdvancedDisplayFields);this.workshiftGroupService.listExternalWorkshiftGroup({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_group")+" - "+e.code+" - "+(e&&Mn(e.baseDate).format("L"))})}))})}))).subscribe((function(e){t.workshiftGroupSearchGridData=e.contents,t.workshiftGroupSearchTotalRecords=e.totalElements}))},o.prototype.getFormGroup=function(){return this.formBuilder.group({id:[{value:void 0,disabled:!0},p.Validators.compose([])],employee:[{value:void 0,disabled:!1},p.Validators.compose(this.isCollective?[]:[p.Validators.required])],startDate:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required])],endDate:[{value:void 0,disabled:!1},p.Validators.compose([])],workshift:[{value:void 0,disabled:!0},p.Validators.compose([p.Validators.required])],workshiftGroup:[{value:void 0,disabled:!0},p.Validators.compose([])],eSocialWorkingHoursType:[{value:void 0,disabled:!1},p.Validators.compose([])],createdBy:[{value:void 0,disabled:!0},p.Validators.compose([])],createdDate:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedBy:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedDate:[{value:void 0,disabled:!0},p.Validators.compose([])],custom:[]})},o.prototype.getWorkshiftGroupSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.workshift_group_code"),type:l.FieldType.Integer}),new l.FormField({name:"baseDate",label:this.translate.instant("hcm_contract.employment_contract.workshift_group_base_date"),type:l.FieldType.Date,appendTo:"body",calendarLocaleOptions:this.localeConfig.calendar,dateFormat:this.localeConfig.calendar.dateFormat})]},o.prototype.getWorkshiftGroupSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.workshift_group_code"),type:l.FieldType.Integer}),new l.FormField({name:"baseDate",label:this.translate.instant("hcm_contract.employment_contract.workshift_group_base_date"),type:l.FieldType.Date,appendTo:"body",calendarLocaleOptions:this.localeConfig.calendar,dateFormat:this.localeConfig.calendar.dateFormat})]},o.prototype.goBack=function(){history.back();this.router.navigate(["../"],{relativeTo:this.route,queryParams:this.isPreviewEmployee?{tab:"workshift"}:null})},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)})),this.focusService.focusFirstInvalidInput()},o.prototype.getSaveObservable=function(){var e=this.formGroup.getRawValue();e.isManager=this.isManager;var t,n=qt.toDto(e),o=this.defineService();if(this.isNew()||this.employeeData&&!e.id)t=o.insert(n);else{var i=this.employeeData?e.id:this.routeParams.workshiftHistory;t=o.update(i,n)}return t},o.prototype.defineService=function(){return this.isClockingEvent?this.workshiftHistoryAdjustmentService:this.workshiftHistoryService},o.prototype.getDeleteObservable=function(){var e,t=this,n=(null===(e=this.routeParams)||void 0===e?void 0:e.scheduleHistoryId)?this.routeParams.scheduleHistoryId:this.routeParams.workshiftHistory;return this.defineService().delete(n).pipe(s.tap((function(){t.loading=!1,t.addMessage("success","hcm_contract.employment_contract.deleted_message_title","hcm_contract.employment_contract.deleted_message_content"),t.employeeData&&t.isPreviewEmployee&&t.goBack()})))},o.prototype.validateVisualization=function(){var e=this;["employee","workshift"].every((function(t){var n;return null===(n=e.allPermissions[t])||void 0===n?void 0:n.visualizar}))||this.router.navigate(["forbidden"])},o.prototype.convertWorkshiftType=function(t){switch(t){case e.WorkshiftType.AUTOMATIC_SEARCH:return this.translate.instant("hcm_contract.employment_contract.workshift_workshift_type_automatic");case e.WorkshiftType.PERMANENT:return this.translate.instant("hcm_contract.employment_contract.workshift_workshift_type_permanent")}},o.prototype.onClearWorkshift=function(){this.onSelectWorkshift(null),this.setValidatorStartDate(null,"workshift"),ae(this.formGroup,!0,"workshiftGroup")},o.prototype.onSelectWorkshift=function(t,n){void 0===n&&(n=!0);var o=this.formGroup.get("workshiftGroup");(null==t?void 0:t.id)&&(o.enable(),n&&o.reset(),t.workshiftType===this.convertWorkshiftType(e.WorkshiftType.AUTOMATIC_SEARCH)||t.workshiftType===this.convertWorkshiftType(e.WorkshiftType.PERMANENT)?(o.setValidators([p.Validators.required]),this.requiredWorkshiftGroup=!0):(o.setValidators([]),this.requiredWorkshiftGroup=!1),this.formGroup.get("workshift").setValue(t),this.onWorkshiftGroupLookupRequest("",!0)),o.updateValueAndValidity(),this.setValidatorStartDate(t,"workshift")},o.prototype.getFilterWorkshiftGroup=function(e){var t=this.formGroup.get("workshift").value,n=e?"and":"";return(null==t?void 0:t.id)&&(e=e+" "+n+" workshift eq '"+t.id+"'"),e},o.prototype.getSaveButtonPermissions=function(){var t=this.isNew()||this.permissions.editar,n=this.permissions.incluir&&this.collectiveProcessType===e.CollectiveProcessType.INCLUDE;return this.isCollective?n:t},o.prototype.getDeleteButtonPermissions=function(){var t=!this.isNew()&&this.permissions.excluir,n=this.permissions.excluir&&this.collectiveProcessType===e.CollectiveProcessType.EXCLUDE;return this.isCollective?n:t},o.prototype.getFormGeneralTitle=function(){return this.collectiveProcessType?this.getCollectiveFormTitle():"hcm_contract.employment_contract.workshift_history_form_general_title"},o.prototype.getCollectiveFormTitle=function(){return this.collectiveProcessType===e.CollectiveProcessType.INCLUDE?"hcm_contract.employment_contract.workshift_history_collective_form_general_title":"hcm_contract.employment_contract.workshift_history_collective_delete_form_general_title"},o.prototype.isUsingTableChange=function(){return this.collectiveService.getIsUsingTable()},o.prototype.createHistoryDTO=function(e,t){var n=new qt;return n.startDate=Mn(e).toDate(),n.employee=Vt.fromDto(t,"WorkshiftHistory"),n},o.prototype.clockingEventOnSave=function(){this.confirmBeforeSave()},o.WORKSHIFT="workshift",o.DOMAIN="hcm_foundation",o.SERVICE="work_schedule",o.HISTORY_NAME="workshiftHistory",o.ctorParameters=function(){return[{type:Xe},{type:d.Router},{type:d.ActivatedRoute},{type:i.MessageService},{type:i.ConfirmationService},{type:p.FormBuilder},{type:a.TranslateService},{type:y.HotkeysService},{type:Sn},{type:_n},{type:je},{type:qe},{type:t.ChangeDetectorRef},{type:tn},{type:gn},{type:pn},{type:G.WorkshiftLookupService},{type:nn},{type:bt},{type:G.EmployeeLookupService},{type:Ft}]},W([t.ViewChild("customTemplate")],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFormFields")],o.prototype,"customFormFields",void 0),o=c=W([t.Component({selector:"fnd-workshift-history-form",template:'<div *ngFor="let process of processed">\n <p-messages [value]="process" key="info" [escape]="false"></p-messages>\n</div>\n<div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog acceptLabel="{{\'hcm_contract.employment_contract.yes\' | translate}}" acceptIcon="" appendTo="body"\n rejectLabel="{{\'hcm_contract.employment_contract.no\' | translate}}" rejectIcon="">\n </p-confirmDialog>\n <form [formGroup]="formGroup" novalidate>\n <lib-collective-history-filters *ngIf="isCollective"\n [parentFormGroup]="collectiveFormGroup" (onEmployeeSelected)="onSelectBasicFilterByEmployee($event)" (onCompanySelected)="onSelectBasicFilterByCompany($event)" ></lib-collective-history-filters>\n <p-panel *sLoadingState="loading"\n [styleClass]="employeeData && !isPreviewEmployee ? \'form-group sidebar-panel\' : \'form-group\'"\n [toggleable]="false" [collapsed]="mainPanelCollapsed"\n [showHeader]="(!employeeData) || (employeeData && isPreviewEmployee)"\n [hidden]="!isUsingTableChange() && isCollective">\n <p-header>\n {{ getFormGeneralTitle() | translate}}\n </p-header>\n\n <div class="ui-fluid" *ngIf="!customFormFields else customFormFields">\n <div class="ui-g">\n <div [attr.data-hidden]="true" class="ui-g-12 ui-md-6">\n <label for="id">{{"hcm_contract.employment_contract.workshift_history_id" | translate}}</label>\n <input #idFormInput type="text" id="id" name="id" pInputText formControlName="id"\n autocomplete="off" />\n </div>\n <div *ngIf="!isCollective" [attr.data-hidden]="!allPermissions?.employee.visualizar"\n class="ui-g-12 ui-md-6 required">\n <label for="employee">{{"hcm_contract.employment_contract.workshift_history_employee" |\n translate}}</label>\n <fnd-employee-lookup id="employee"\n [formGroup]="formGroup"></fnd-employee-lookup>\n <s-control-errors [control]="formGroup.controls[\'employee\']"\n [errorMessages]="{ required: \'hcm_contract.employment_contract.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div class="ui-g-12 ui-md-6 required">\n <label for="startDate">{{"hcm_contract.employment_contract.workshift_history_start_date" |\n translate}}</label>\n <p-calendar id="startDate" #startDateFormInput inputId="startDate" name="startDate"\n [showIcon]="true" formControlName="startDate" [locale]="localeConfig.calendar"\n [dateFormat]="localeConfig.calendar.dateFormat" sCalendarMask></p-calendar>\n <s-control-errors [control]="formGroup.controls[\'startDate\']" [errorMessages]="{\n required: \'hcm_contract.employment_contract.error_required\' | translate,\n dateBeforeRegisterInitialDate: \'hcm_contract.employment_contract.validation_has_date_before_workshift_initial_validity\' | translate,\n dateBeforeRegisterFinalDate: \'hcm_contract.employment_contract.validation_has_date_after_workshift_final_validity\' | translate,\n dateBeforeAdmission: \'hcm_contract.employment_contract.validation_start_date_is_before_hire_date\' | translate,\n dateAfterDismissal: \'hcm_contract.employment_contract.validation_start_date_is_after_dismissal_date\' | translate\n }">\n </s-control-errors>\n </div>\n <div [attr.data-hidden]="!allPermissions?.workshift.visualizar" class="ui-g-12 ui-md-6 required">\n <label for="workshift">{{"hcm_contract.employment_contract.workshift_history_workshift" |\n translate}}</label>\n <fnd-workshift-lookup\n [structureParams]="structureParams"\n id="workshift" [formGroup]="formGroup"\n [isDisabled]="getDisableRegister(isCollective, isNew(), permissions, isClockingEvent)"\n (select)="onSelectWorkshift($event)" (clear)="onClearWorkshift()">\n </fnd-workshift-lookup>\n <s-control-errors [control]="formGroup.controls[\'workshift\']"\n [errorMessages]="{ required: \'hcm_contract.employment_contract.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div [attr.data-hidden]="true" class="ui-g-12 ui-md-6">\n <label for="endDate">{{"hcm_contract.employment_contract.workshift_history_end_date" |\n translate}}</label>\n <p-calendar id="endDate" #endDateFormInput inputId="endDate" name="endDate" [showIcon]="true"\n formControlName="endDate" [locale]="localeConfig.calendar"\n [dateFormat]="localeConfig.calendar.dateFormat" sCalendarMask></p-calendar>\n </div>\n <div [attr.data-hidden]="!allPermissions?.workshiftInformationHistory.visualizar"\n class="ui-g-12 ui-md-6" [ngClass]="requiredWorkshiftGroup ? \'required\' : \'\'">\n <label\n for="workshiftGroup">{{"hcm_contract.employment_contract.workshift_history_workshift_group"\n | translate}}</label>\n <s-lookup dataKey="id" id="workshiftGroup" name="workshiftGroup"\n [disabled]="!isNew() && !permissions.editar && !isClockingEvent"\n formControlName="workshiftGroup" [searchFields]="workshiftGroupSearchFields"\n [searchGridFields]="workshiftGroupSearchGridFields"\n [searchGridData]="workshiftGroupSearchGridData" [multiple]="false"\n [lookupSuggestions]="workshiftGroupLookupSuggestions"\n (onLookupRequest)="onWorkshiftGroupLookupRequest($event)"\n (onSearchRequest)="onWorkshiftGroupSearchRequest($event)" lookupDisplayField="label"\n [searchTotalRecords]=workshiftGroupSearchTotalRecords\n [searchTitle]="\'hcm_contract.employment_contract.workshift_history_workshift_group_search_title\' | translate"\n [searchEmptyTitle]="\'hcm_contract.employment_contract.nothing_found\' | translate"\n [filterLabel]="\'hcm_contract.employment_contract.filter\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.filters\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.clear\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.cancel\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_contract.total_records\' | translate: {value: workshiftGroupSearchTotalRecords}">\n </s-lookup>\n <s-control-errors [control]="formGroup.controls[\'workshiftGroup\']"\n [errorMessages]="{ required: \'hcm_contract.employment_contract.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div [attr.data-hidden]="!allPermissions?.workshiftInformationHistory.visualizar"\n class="ui-g-12 ui-md-6">\n <label for="eSocialWorkingHoursType">\n {{"hcm_contract.employment_contract.workshift_esocial_working_hours_type"\n | translate}}\n </label>\n <p-dropdown id="eSocialWorkingHoursType" name="eSocialWorkingHoursType" placeholder=\'\n {{"hcm_contract.employment_contract.workshift_esocial_working_hours_type_placeholder"\n | translate}}\' [options]="eSocialWorkingHoursTypeOptions" [showClear]="true"\n formControlName="eSocialWorkingHoursType"></p-dropdown>\n </div>\n </div>\n </div>\n <s-custom-fields *ngIf="!isCollective && customizationPermission.visualizar" domain="hcm_contract"\n service="employment_contract" entity="workshiftHistory" formControlName="custom"\n [invalidErrorLabel]="\'hcm_contract.employment_contract.error_invalid\' | translate"></s-custom-fields>\n <div class="ui-g" *ngIf="!isNew() && employeeData != null">\n <div class="ui-g-12 ui-inputgroup" *ngIf="!isCollective">\n <span *ngIf="fieldIsNotNull(\'createdBy\')" class="label-style">\n {{\'hcm_contract.employment_contract.created_by\' | translate}}\n {{formGroup.get(\'createdBy\').value}}\n {{\'hcm_contract.employment_contract.at_date\' | translate}}\n {{formGroup.get(\'createdDate\').value | date: \'dd/MM/yyyy\'}}\n {{\'hcm_contract.employment_contract.at_time\' | translate}}\n {{formGroup.get(\'createdDate\').value | date: \'HH:mm\'}}.\n </span>\n <span *ngIf="fieldIsNotNull(\'lastModifiedBy\')" class="label-style-updated">\n {{\'hcm_contract.employment_contract.updated_by\' | translate}}\n {{formGroup.get(\'lastModifiedBy\').value}}\n {{\'hcm_contract.employment_contract.at_date\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | date: \'dd/MM/yyyy\'}}\n {{\'hcm_contract.employment_contract.at_time\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | date: \'HH:mm\'}}.\n </span>\n </div>\n </div>\n <p-footer *ngIf="(!employeeData) || (employeeData && isPreviewEmployee)">\n <button id="save-button"\n title="{{\'hcm_contract.employment_contract.save\' | translate}} (Alt + Shift + S)" type="submit"\n pButton label="{{\'hcm_contract.employment_contract.save\' | translate}}"\n (click)="confirmBeforeSave()" *ngIf="getSaveButtonPermissions()"></button>\n <button id="delete-button"\n title="{{\'hcm_contract.employment_contract.delete\' | translate}} (Alt + Shift + X)" type="button"\n class="ui-button-secondary" pButton\n label="{{\'hcm_contract.employment_contract.delete\' | translate}}" (click)="onDelete()"\n *ngIf="getDeleteButtonPermissions()" [disabled]="loading"></button>\n <button id="cancel-button"\n title="{{\'hcm_contract.employment_contract.cancel\' | translate}} (Alt + Shift + C)" type="button"\n class="ui-button-link" pButton label="{{\'hcm_contract.employment_contract.cancel\' | translate}}"\n (click)="onCancel()"></button>\n </p-footer>\n </p-panel>\n </form>\n</div>\n<p-confirmDialog #customized header="{{ \'hcm_contract.employment_contract.generic_confirm\' | translate }}"\n key="customized">\n <p-footer>\n <s-button label="{{ \'hcm_contract.employment_contract.yes\' | translate }}" [disabled]="false" priority="primary"\n (onClick)="customized.accept()" [auxiliary]="false">\n </s-button>\n <s-button label="{{ \'hcm_contract.employment_contract.no\' | translate }}" [auxiliary]="false"\n (onClick)="customized.reject()" priority="secondary" [disabled]="false">\n </s-button>\n </p-footer>\n</p-confirmDialog>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',providers:[i.ConfirmationService],styles:[":host ::ng-deep .sidebar-panel{border:none!important;padding-left:0!important}.label-style{color:#a3a3a3;margin-right:2px}.label-style-updated{color:#a3a3a3}"]})],o)}(Pn),Vn=function(e){function n(t,n,o){var i=e.call(this,t,n,"erpx_fnd/empresa/entities/e070emp","erpx_fnd/empresa/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalE070Emp=function(e){return this.http.get("erpx_fnd/empresa/entities/e070emp",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Nn=function(e){function n(t,n,o){var i=e.call(this,t,n,"erpx_fnd/empresa/entities/e070fil","erpx_fnd/empresa/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.prototype.listExternalE070Fil=function(e){return this.http.get("erpx_fnd/empresa/entities/e070fil",{params:this.getListQueryParams(e)}).pipe(this.defaultCatch())},n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),xn=c,On=function(n){function o(t,o,i,a,s,l,c,p,d,m,u,h,y,f,_,v){var g=n.call(this,s)||this;return g.router=t,g.route=o,g.workshiftHistoryService=i,g.confirmationService=a,g.translate=s,g.messageService=l,g.hotkeysService=c,g.formBuilder=p,g.filtersStorageService=d,g.paginatorStorageService=m,g.employeeService=u,g.workshiftService=h,g.companyService=y,g.companyBranchService=f,g.employeeLookupService=_,g.configService=v,g.allPermissions={},g.permissions={},g.localeConfig={},g.currentListParams={page:0,size:10,sort:[],filterData:{}},g.filtersPanelCollapsed=!0,g.searchTokens=[],g.serverError=!1,g.filtersLoaded=!1,g.workshiftGroupLookupDisplayFields=["code"],g.workshiftGroupAdvancedDisplayFields=["code"],g.workshiftLookupDisplayFields=["code","name"],g.workshiftAdvancedDisplayFields=["code","name"],g.employeeLookupDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],g.employeeAdvancedDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],g.companyLookupDisplayFields=["codEmp","nomEmp"],g.companyAdvancedDisplayFields=["codEmp","nomEmp"],g.companyBranchLookupDisplayFields=["codFil","nomFil"],g.companyBranchAdvancedDisplayFields=["codFil","nomFil"],g.collectiveActions=[],g.contractTypeOptions=[{label:g.translate.instant("hcm_contract.employment_contract.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:g.translate.instant("hcm_contract.employment_contract.contract_type_director"),value:e.ContractType.DIRECTOR},{label:g.translate.instant("hcm_contract.employment_contract.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:g.translate.instant("hcm_contract.employment_contract.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:g.translate.instant("hcm_contract.employment_contract.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}],g.workshiftLookupSuggestionsObservable=new r.Subject,g.workshiftLookupSearchObservable=new r.Subject,g.employeeLookupSuggestionsObservable=new r.Subject,g.employeeLookupSearchObservable=new r.Subject,g.companyLookupSuggestionsObservable=new r.Subject,g.companyLookupSearchObservable=new r.Subject,g.companyBranchLookupSuggestionsObservable=new r.Subject,g.companyBranchLookupSearchObservable=new r.Subject,g.resetGridSubject=new r.Subject,g}return Y(o,n),o.prototype.ngOnInit=function(){var e=this;this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.filterFormGroup=this.formBuilder.group({employer:[void 0,p.Validators.compose([])],companyBranch:[void 0,p.Validators.compose([])],contractType:[void 0,p.Validators.compose([])],employee:[void 0,p.Validators.compose([])],workshift:[void 0,p.Validators.compose([])],employeeSituation:[void 0,p.Validators.compose([])]}),this.setStoragePaginator(),this.setStorageFiltersIntoForm(this.filterFormGroup),this.gridColumns=this.getGridColumns(),this.filterFields=this.getFilterFields(),this.filterFormGroup.get("employer").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(){e.filterFormGroup.get("companyBranch").setValue(null)})),this.setHotkeys(),this.permissions.incluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.add_collective"),command:function(){return e.onAddCollective()}}),this.permissions.excluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.remove_collective"),command:function(){return e.onRemoveCollective()}})},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+e",(function(){return e.selection&&1===e.selection.length&&e.onEdit(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.selection&&e.selection.length&&e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+n",(function(){return e.permissions.incluir&&e.onAdd(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+f",(function(){return e.onSearch(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+l",(function(){return e.onClear(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.onRouteDataChange=function(e){this.allPermissions=e.allPermissions,this.permissions=e.allPermissions.workshiftHistory,this.localeConfig=e.localeConfig},o.prototype.hasEmpty=function(e){if(Object.keys(e).filter((function(t){return""===e[t]})).length>0)return!0},o.prototype.onSearch=function(){var e=this.filterFormGroup.getRawValue();if(this.hasEmpty(e))return this.filtersPanelCollapsed=!0,this.validateAllFormFields(this.filterFormGroup);this.currentListParams.page=0,this.filtersPanelCollapsed=!0,this.updateGrid({filterData:e}),this.filtersStorageService.storeFilters("WorkshiftHistoryListComponent",e)},o.prototype.onClear=function(){this.filterFormGroup.reset();var e=this.filterFormGroup.getRawValue();this.updateGrid({filterData:e}),this.filtersStorageService.removeFilter("WorkshiftHistoryListComponent")},o.prototype.onRemoveToken=function(e){this.filterFormGroup.get(e.id).setValue(void 0);var t=this.filterFormGroup.getRawValue();this.updateGrid({filterData:t}),this.filtersStorageService.clearFilterValue("WorkshiftHistoryListComponent",t)},o.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,o=e.multiSortMeta||[];return(10!==t||0!==n||o.length>0)&&this.paginatorStorageService.storePaginator("WorkshiftHistoryListComponentPaginator",{page:n,size:t,sort:o}),this.updateGrid({page:n,size:t,sort:o})},o.prototype.onAdd=function(){var e;if(null===(e=this.employeeData)||void 0===e?void 0:e.employeeId){var t=this.employeeData.employeeId;this.router.navigate(["new"],{relativeTo:this.route,queryParams:{id:t}})}else this.router.navigate(["new"],{relativeTo:this.route})},o.prototype.onEdit=function(){this.router.navigate([this.selection[0].id],{relativeTo:this.route})},o.prototype.onDelete=function(){var e=this;this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_title"),accept:function(){e.showLoader=!0,r.forkJoin(e.selection.map((function(t){return e.workshiftHistoryService.delete(t.id)}))).pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.showLoader=!1,e.resetGrid()}))).subscribe((function(){e.messageService.add({severity:"success",summary:e.translate.instant("hcm_contract.employment_contract.deleted_message_title"),detail:e.translate.instant("hcm_contract.employment_contract.deleted_message_content")})}))}})},o.prototype.focusInput=function(e){var t=document.getElementById(""+e);t&&t.focus()},o.prototype.getLabelValue=function(e,t){var n=this;return e.map((function(e){return z(z({},e),{label:t.map((function(t){return"name"!==t||e.name||(e.name=n.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")),t.indexOf(".")>0&&(e[t]=n.getProp(e,t)),"employmentRelationship.contractType"===t&&(e[t]=n.loadLabelFromEnum(e[t])),e[t]})).join(" - ")})}))},o.prototype.onWorkshiftLookupRequest=function(e){var t=this,n=this.getWorkshiftSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),o=Ee(this.workshiftLookupDisplayFields,this.workshiftAdvancedDisplayFields);this.workshiftService.list({filterQuery:n,displayFields:o}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.workshiftLookupDisplayFields)}))).subscribe((function(e){return t.workshiftLookupSuggestionsObservable.next(e)}))},o.prototype.onWorkshiftSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getWorkshiftSearchFields().filter((function(e){var t=e.name;return!!a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+xn(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+xn(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+xn(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=Ee(this.workshiftLookupDisplayFields,this.workshiftAdvancedDisplayFields);this.workshiftService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.workshiftLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.workshiftLookupSearchObservable.next(e)}))},o.prototype.onEmployeeLookupRequest=function(e){var t=this,n=this.getEmployeeSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),o=Ee(this.employeeLookupDisplayFields,this.employeeAdvancedDisplayFields);this.employeeService.list({filterQuery:n,displayFields:o}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.employeeLookupDisplayFields)}))).subscribe((function(e){return t.employeeLookupSuggestionsObservable.next(e)}))},o.prototype.onEmployeeSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getEmployeeSearchFields().filter((function(e){var t=e.name;return!!a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+xn(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+xn(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+xn(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=Ee(this.employeeLookupDisplayFields,this.employeeAdvancedDisplayFields);this.employeeService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.employeeLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.employeeLookupSearchObservable.next(e)}))},o.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},o.prototype.getGridColumns=function(){var e=[{field:"startDate",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_start_date")},{field:"workshift.code",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_code")},{field:"workshift.name",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_name")},{field:"workshiftGroup.code",header:this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_group_code")}];return this.isPreviewEmployee?e:xe(this.translate,this.configService).concat(e)},o.prototype.getFilterFields=function(){var e=this;return[this.employeeLookupService.getFormField(),new l.FormField({recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),name:"employer",label:this.translate.instant("hcm_contract.employment_contract.employer"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_contract.employer_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_contract.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_contract.filter"),filterTitle:this.translate.instant("hcm_contract.employment_contract.filters"),clearLabel:this.translate.instant("hcm_contract.employment_contract.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_contract.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_contract.select"),dataKey:"id",suggestionsObservable:this.companyLookupSuggestionsObservable,searchObservable:this.companyLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyLookupRequest(t)},onSearchRequest:function(t){return e.onCompanySearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanySearchFields(),searchGridFields:this.getCompanySearchGridFields()}),new l.FormField({name:"companyBranch",label:this.translate.instant("hcm_contract.employment_contract.employee_company_branch"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_contract.employee_company_branch_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_contract.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_contract.filter"),filterTitle:this.translate.instant("hcm_contract.employment_contract.filters"),clearLabel:this.translate.instant("hcm_contract.employment_contract.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_contract.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_contract.select"),recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),dataKey:"id",suggestionsObservable:this.companyBranchLookupSuggestionsObservable,searchObservable:this.companyBranchLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyBranchLookupRequest(t)},onSearchRequest:function(t){return e.onCompanyBranchSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanyBranchSearchFields(),searchGridFields:this.getCompanyBranchSearchGridFields()}),new l.FormField({name:"contractType",label:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type_placeholder"),options:this.contractTypeOptions,multiple:!1}),new l.FormField({name:"workshift",label:this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_contract.workshift_history_workshift_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_contract.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_contract.filter"),filterTitle:this.translate.instant("hcm_contract.employment_contract.filters"),clearLabel:this.translate.instant("hcm_contract.employment_contract.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_contract.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_contract.select"),dataKey:"id",recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),suggestionsObservable:this.workshiftLookupSuggestionsObservable,searchObservable:this.workshiftLookupSearchObservable,onLookupRequest:function(t){return e.onWorkshiftLookupRequest(t)},onSearchRequest:function(t){return e.onWorkshiftSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getWorkshiftSearchFields(),searchGridFields:this.getWorkshiftSearchGridFields()}),new l.FormField({name:"employeeSituation",label:this.translate.instant("hcm_contract.employment_contract.employee_situation"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_contract.employee_situation"),default:Z.EVERYONE,options:Ve(this.translate,this.configService),multiple:!1})]},o.prototype.setStorageFiltersIntoForm=function(e){return Q(this,void 0,void 0,(function(){var t,n;return X(this,(function(o){switch(o.label){case 0:return this.showLoader=!0,[4,this.filtersStorageService.getFilters("WorkshiftHistoryListComponent")];case 1:return t=o.sent(),Object.keys(e.controls).forEach((function(n){var o=xn(t[n],xn.HTML5_FMT.DATETIME_LOCAL_MS+"Z",!0).isValid();e.get(n).setValue(o?new Date(t[n]):t[n])})),this.filtersLoaded=!0,n=this.filterFormGroup.getRawValue(),this.updateGrid({filterData:n}),[2]}}))}))},o.prototype.setStoragePaginator=function(){return Q(this,void 0,void 0,(function(){var e;return X(this,(function(t){switch(t.label){case 0:return[4,this.paginatorStorageService.getPaginator("WorkshiftHistoryListComponentPaginator")];case 1:return e=t.sent(),"{}"!==JSON.stringify(e)&&(this.currentListParams=z(z({},this.currentListParams),e)),[2]}}))}))},o.prototype.getEnumQuery=function(e,t,n){return n?"("+t.map((function(t){return e+" eq '"+t+"'"})).join(" or ")+")":e+" eq '"+t+"'"},o.prototype.getWorkshiftSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.workshift_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_contract.workshift_name"),type:l.FieldType.String})]},o.prototype.getWorkshiftSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.workshift_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_contract.workshift_name"),type:l.FieldType.String})]},o.prototype.getEmployeeSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_contract.employee_employer_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_contract.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getEmployeeSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_contract.employee_employer_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_contract.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.onCompanyLookupRequest=function(e){var t=this,n=this.companyLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanySearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+xn(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+xn(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+xn(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({filterQuery:o,displayFields:i,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyLookupDisplayFields)}))).subscribe((function(e){return t.companyLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanySearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanySearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+xn(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+xn(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+xn(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyLookupSearchObservable.next(e)}))},o.prototype.onCompanyBranchLookupRequest=function(e){var t=this,n=this.companyBranchLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanyBranchSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+xn(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+xn(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+xn(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=this.filterFormGroup.get("employer").value;if(i){var a="e070emp.codEmp eq "+i.codEmp;o=o?o+" and "+a:a}var r=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({filterQuery:o,displayFields:r,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields)}))).subscribe((function(e){return t.companyBranchLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanyBranchSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanyBranchSearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+xn(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+xn(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+xn(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=this.filterFormGroup.get("employer").value;if(d){var m="e070emp.codEmp eq "+d.codEmp;p=p?p+" and "+m:m}var u=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({page:r,sort:c,filterQuery:p,displayFields:u}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyBranchLookupSearchObservable.next(e)}))},o.prototype.getCompanySearchFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_contract.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_contract.company_nom_emp"),type:l.FieldType.String})]},o.prototype.getCompanySearchGridFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_contract.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_contract.company_nom_emp"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_contract.company_branch_history_company_branch_cod_fil"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_contract.company_branch_history_company_branch_nom_fil"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchGridFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_contract.company_branch_history_company_branch_cod_fil"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_contract.company_branch_history_company_branch_nom_fil"),type:l.FieldType.String})]},o.prototype.updateGrid=function(e){var t=this;if(void 0===e&&(e={}),this.filtersLoaded){this.showLoader=!0,this.currentListParams=z(z({},this.currentListParams),e);var n=this.currentListParams,o=n.page,i=n.size,a=n.filterData,r=this.currentListParams.sort;this.searchTokens=this.filterFields.filter((function(e){var t=e.name;return!(!a||!a[t])})).map((function(e){var n=e.name,o=e.label,i=e.type,r=e.searchFields,s=e.options,c=a[n],p=c;if(i===l.FieldType.Date)p=xn(c).format("L");else if(i===l.FieldType.Time)p=xn(c).format("LTS");else if(i===l.FieldType.DateTime)p=xn(c).format("L LTS");else if(i===l.FieldType.Lookup){var d="employee"===n?t.getEmployeeSearchFields():r;p=d.map((function(e){return e.name.indexOf(".")>0&&(c[e.name]=t.getProp(c,e.name)),"employmentRelationship.contractType"===e.name&&(c[e.name]=t.loadLabelFromEnum(c[e.name])),c[e.name]})).join(" - ")}else i===l.FieldType.Enum?p=s.filter((function(e){return e.value===p}))[0].label:i===l.FieldType.Boolean&&(p=c?t.translate.instant("hcm_contract.employment_contract.list_grid_boolean_true"):t.translate.instant("hcm_contract.employment_contract.list_grid_boolean_false"));return{id:n,label:o+": "+p}}));var c=this.filterFields.filter((function(e){var t=e.name;return!(!a||!a[t])})).map((function(e){var n=e.name,o=e.type,i=e.multiple,r=a[n];return"number"==typeof r?n+" eq "+r:"employeeSituation"==n?Ne(r):o===l.FieldType.Date?n+" eq '"+xn(r).format("YYYY-MM-DD")+"'":o===l.FieldType.Time?n+" eq '"+xn(r).format("HH:mm:ss")+"'":o===l.FieldType.DateTime?n+" eq '"+xn(r).format()+"'":o===l.FieldType.String?"containing(upper("+n+"), upper('"+r.replace(/'/g,"\\'")+"'))":o===l.FieldType.Enum?t.getEnumQuery(n,r,i):o===l.FieldType.Lookup?n+" eq '"+r.id+"'":n+" eq '"+r+"'"})).join(" and ");c=this.filterByEmployee(c).replace("employer eq","employee.employer eq").replace("companyBranch eq","employee.employeeSnapshot.companyBranch eq").replace("contractType eq","employee.employmentRelationship.contractType eq");var p=this.gridColumns.map((function(e){return e.field}));r||(r=[{field:"lastModifiedDate",order:-1}]),this.workshiftHistoryService.list({page:o,size:i,sort:r,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(e){throw e.status>=500&&e.status<600&&(t.serverError=!0),e})),s.finalize((function(){t.showLoader=!1}))).subscribe((function(e){t.selection=[],t.gridData=e.contents,t.totalRecords=e.totalElements,t.serverError=!1}))}},o.prototype.resetGrid=function(e){e&&(this.currentListParams=z(z({},this.currentListParams),e)),this.currentListParams=z(z({},this.currentListParams),{page:0,sort:[]}),this.resetGridSubject.next(e),this.updateGrid()},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)}))},o.prototype.getSortField=function(){return this.currentListParams.sort},o.prototype.getPageSize=function(){return this.currentListParams.size},o.prototype.getRowIndex=function(){return this.currentListParams.page*this.currentListParams.size},o.prototype.loadLabelFromEnum=function(e){var t=this.contractTypeOptions.filter((function(t){return t.value===e}));return t&&t.length&&t[0].label||this.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")},o.prototype.onAddCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.INCLUDE})},o.prototype.onRemoveCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.EXCLUDE})},o.ctorParameters=function(){return[{type:d.Router},{type:d.ActivatedRoute},{type:Xe},{type:i.ConfirmationService},{type:a.TranslateService},{type:i.MessageService},{type:y.HotkeysService},{type:p.FormBuilder},{type:En},{type:Cn},{type:qe},{type:ze},{type:Vn},{type:Nn},{type:G.EmployeeLookupService},{type:G.EntityLookupConfigService}]},W([t.ViewChild("workshiftHistoryTable")],o.prototype,"table",void 0),W([t.ViewChild("customTemplate")],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFilterFields")],o.prototype,"customFilterFields",void 0),W([t.ViewChild("customGridColgroup")],o.prototype,"customGridColgroup",void 0),W([t.ViewChild("customGridHeader")],o.prototype,"customGridHeader",void 0),W([t.ViewChild("customGridBody")],o.prototype,"customGridBody",void 0),o=W([t.Component({selector:"fnd-workshift-history",template:'<div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog [acceptLabel]="\'hcm_contract.employment_contract.yes\' | translate" acceptIcon="" [rejectLabel]="\'hcm_contract.employment_contract.no\' | translate"\n rejectIcon=""></p-confirmDialog>\n <form [formGroup]="filterFormGroup" autocomplete="off" *ngIf="!employeeData">\n <p-panel styleClass="form-group" [toggleable]="true" [(collapsed)]="filtersPanelCollapsed" (onAfterToggle)="focusInput(\'employee\')">\n <p-header>\n {{"hcm_contract.employment_contract.filters" | translate}}\n <s-token-list [tokens]="searchTokens" (tokenRemoved)="onRemoveToken($event)" [removableTokens]="true"></s-token-list>\n </p-header>\n <div *ngIf="!customFilterFields else customFilterFields">\n <s-dynamic-form [fields]="filterFields" [form]="filterFormGroup" [errorMessages]="{pattern: \'hcm_contract.employment_contract.error_invalid\' | translate}"></s-dynamic-form>\n </div>\n <p-footer>\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="filter-button" class="ui-button" type="submit" pButton [label]="\'hcm_contract.employment_contract.filter\' | translate"\n title="{{\'hcm_contract.employment_contract.filter\' | translate}} (Alt + Shift + F)"\n (click)="onSearch()"></button>\n <button id="clear-button" class="ui-button ui-button-link" type="button" pButton [label]="\'hcm_contract.employment_contract.clear\' | translate"\n title="{{\'hcm_contract.employment_contract.clear\' | translate}} (Alt + Shift + L)"\n (click)="onClear()"></button>\n </div>\n </div>\n </p-footer>\n </p-panel>\n </form>\n <p-panel *sLoadingState="showLoader" [styleClass]="employeeData && isPreviewEmployee ? \'sidebar-panel\' : \'\'"\n [showHeader]="!isPreviewEmployee">\n <p-header>\n {{"hcm_contract.employment_contract.workshift_history_list_grid_title" | translate}}\n </p-header>\n <s-empty-state\n *ngIf="serverError"\n iconClass="fa fa-exclamation-triangle"\n title="{{\'hcm_contract.employment_contract.error_server_title\' | translate}}"\n primaryActionLabel="{{\'hcm_contract.employment_contract.error_server_try_again\' | translate}}"\n (primaryAction)="resetGrid()" description="{{\'hcm_contract.employment_contract.error_server_description\' | translate}}"></s-empty-state>\n <s-empty-state *ngIf="gridData && !gridData.length" [title]="\'hcm_contract.employment_contract.workshift_history_empty_state_title\' | translate"\n [showPrimaryAction]="permissions.incluir" [primaryActionLabel]="\'hcm_contract.employment_contract.add\' | translate"\n (primaryAction)="onAdd()" [description]="\'hcm_contract.employment_contract.workshift_history_empty_state_description\' | translate"\n [showSecondaryAction]="permissions.incluir"\n [secondaryActionLabel]="\'hcm_contract.employment_contract.add_collective\' | translate"\n (secondaryAction)="onAddCollective()">\n </s-empty-state>\n <div [attr.data-hidden]="!gridData?.length || serverError">\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="add-button" type="button" pButton [label]="\'hcm_contract.employment_contract.add\' | translate"\n title="{{\'hcm_contract.employment_contract.add\' | translate}} (Alt + Shift + N)"\n *ngIf="permissions.incluir" (click)="onAdd()"></button>\n <button id="edit-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_contract.edit\' | translate"\n title="{{\'hcm_contract.employment_contract.edit\' | translate}} (Alt + Shift + E)"\n [disabled]="!selection || selection.length !== 1" (click)="onEdit()"\n *ngIf="permissions.editar"></button>\n <button id="view-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_contract.view\' | translate"\n title="{{\'hcm_contract.employment_contract.view\' | translate}} (Alt + Shift + V)"\n [disabled]="!selection || selection.length !== 1" (click)="onEdit()"\n *ngIf="!permissions.editar && permissions.visualizar"></button>\n <button id="delete-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_contract.delete\' | translate"\n title="{{\'hcm_contract.employment_contract.delete\' | translate}} (Alt + Shift + X)"\n (click)="onDelete()" [disabled]="!selection || !selection.length" *ngIf="permissions.excluir"></button>\n <s-button *ngIf="(permissions.incluir || permissions.excluir) && isCollective"\n [label]="\'hcm_contract.employment_contract.other_actions\' | translate"\n priority="secondary" [model]="collectiveActions" [disabled]="false" [auxiliary]="false">\n </s-button>\n </div>\n </div>\n <div class="ui-g">\n <div class="ui-g-12">\n <p-table #workshiftHistoryTable [value]="gridData" [columns]="gridColumns" dataKey="id" [lazy]="true"\n [scrollable]="true" [resizableColumns]="true" sortMode="multiple" [paginator]="true"\n [totalRecords]="totalRecords" [multiSortMeta]="getSortField()" [first]="getRowIndex()"\n [rows]="getPageSize()" [rowsPerPageOptions]="[10, 20, 50, 100]" [(selection)]="selection"\n (onLazyLoad)="onGridChange($event)">\n <ng-template pTemplate="colgroup" let-columns *ngIf="!customGridColgroup else customGridColgroup">\n <colgroup>\n <col *ngFor="let col of columns" [style.width]="col.width">\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:END}--\x3e\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns *ngIf="!customGridHeader else customGridHeader">\n <tr>\n <th id="tableHeaderCheckbox" style="width: 50px">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id="columnsName" *ngFor="let col of columns" [pSortableColumn]="col.field" style="width: 200px" pResizableColumn>\n <div class="senior-header">\n <span class="senior-header-title">{{col.header}}</span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n \x3c!--{CA:GRID_HEADER_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_HEADER_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n \x3c!--{CA:GRID_HEADER:START}--\x3e\n \x3c!--{CA:GRID_HEADER:END}--\x3e\n <ng-template pTemplate="body" let-rowData let-columns *ngIf="!customGridBody else customGridBody">\n <tr [pSelectableRow]="rowData">\n <td style="width: 50px">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!isPreviewEmployee"> \n <span>{{"" + (getProp(rowData, \'employee.employer.codEmp\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!isPreviewEmployee">\n <span>{{(getProp(rowData, \'employee.employer.nomEmp\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!isPreviewEmployee">\n <span>{{"" + (getProp(rowData, \'employee.employeeSnapshot.companyBranchCode\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!isPreviewEmployee">\n <span>{{(getProp(rowData, \'employee.employeeSnapshot.companyBranchName\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!employeeData">\n <span>{{"" + (getProp(rowData, \'employee.code\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!employeeData">\n <span>{{getProp(rowData, \'employee.person.nomPes\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px" *ngIf="!isPreviewEmployee">\n <div [ngSwitch]="getProp(rowData, \'employee.employmentRelationship.contractType\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate)">\n <span *ngSwitchCase="\'EMPLOYEE\'">{{ "hcm_contract.employment_contract.contract_type_employee" | translate }}</span>\n <span *ngSwitchCase="\'DIRECTOR\'">{{ "hcm_contract.employment_contract.contract_type_director" | translate }}</span>\n <span *ngSwitchCase="\'TRAINEE\'">{{ "hcm_contract.employment_contract.contract_type_trainee" | translate }}</span>\n <span *ngSwitchCase="\'APRENTICE\'">{{ "hcm_contract.employment_contract.contract_type_aprentice" | translate }}</span>\n <span *ngSwitchCase="\'THIRD_PARTY\'">{{ "hcm_contract.employment_contract.contract_type_third_party" | translate }}</span>\n </div>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'startDate\') | localizedDate:"L" | async}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'workshift.code\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'workshift.name\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'workshiftGroup.code\') | localizedNumber | async)}}</span>\n </td>\n \x3c!--{CA:GRID_BODY_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_BODY_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span [translate]="\'hcm_contract.employment_contract.total_records\'" [translateParams]="{value: totalRecords}"></span>\n </ng-template>\n \x3c!--{CA:GRID_TEMPLATES:START}--\x3e\n \x3c!--{CA:GRID_TEMPLATES:END}--\x3e\n </p-table>\n </div>\n </div>\n </div>\n </p-panel>\n</div>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',providers:[i.ConfirmationService],styles:[":host ::ng-deep .sidebar-panel{border:none!important;padding-left:0!important}.label-style{color:#a3a3a3;margin-right:2px}.label-style-updated{color:#a3a3a3}"]})],o)}(Ln),Bn=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,G.EmployeeLookupModule],declarations:[Pn],providers:[],exports:[Pn]})],e)}(),Hn=c;function qn(e,t,n){return"number"==typeof e?n+" eq "+e:t==l.FieldType.Date?n+" eq '"+Hn(e).format("YYYY-MM-DD")+"'":t==l.FieldType.Time?n+" eq '"+Hn(e).format("HH:mm:ss")+"'":t==l.FieldType.DateTime?n+" eq '"+Hn(e).format()+"'":t==l.FieldType.Enum?n+" eq '"+e+"'":t==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"}function Un(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)}var jn,Yn=function(){function e(e,t){this.translate=e,this.companyService=t,this.companyLookupDisplayFields=["codEmp","nomEmp"],this.companyAdvancedDisplayFields=["codEmp","nomEmp"],this.companyLookupSeparator=" - "}return e.prototype.getCompanySearchFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_contract.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_contract.company_nom_emp"),type:l.FieldType.String})]},e.prototype.onCompanySearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.getCompanySearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type;return qn(a[t],n,t)})).join(" and "),p=this.companyLookupDisplayFields;return this.companyService.listExternalE070Emp({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.map((function(e){return t.mapCompanyLookup(e)})))},e.prototype.onCompanyLookupRequest=function(e){var t=this,n=this.companyLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanySearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return qn(e,o,n)})).filter((function(e){return""!==e})).join(" or "),i=this.companyLookupDisplayFields;return this.companyService.listExternalE070Emp({sort:n,filterQuery:o,displayFields:i}).pipe(s.map((function(e){return t.mapCompanyLookup(e)})))},e.prototype.mapCompanyLookup=function(e){var t=this;return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.companyAdvancedDisplayFields.map((function(t){return t.indexOf(".")>0&&(e[t]=Un(e,t)),e[t]})).join(t.companyLookupSeparator)})}))})},e.ctorParameters=function(){return[{type:a.TranslateService},{type:Vn}]},e=W([t.Injectable()],e)}(),zn=function(){function n(t,n){this.translate=t,this.employeeService=n,this.employeeLookupDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],this.employeeAdvancedDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],this.employeeLookupSeparator=" - ",this.contractTypeOptions=[{label:this.translate.instant("hcm_contract.employment_contract.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:this.translate.instant("hcm_contract.employment_contract.contract_type_director"),value:e.ContractType.DIRECTOR},{label:this.translate.instant("hcm_contract.employment_contract.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:this.translate.instant("hcm_contract.employment_contract.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:this.translate.instant("hcm_contract.employment_contract.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}]}return n.prototype.getEmployeeSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_contract.employee_employer_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_contract.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},n.prototype.getEmployeeSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_contract.employee_employer_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_contract.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_contract.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},n.prototype.onEmployeeSearchRequest=function(e,t){var n=this,o=e.first,i=e.rows,a=e.multiSortMeta,r=e.filterData,p=o/i,d=a,m="";m=this.getEmployeeSearchFields().filter((function(e){var t=e.name;return!!r[t]})).map((function(e){var t=e.name,n=e.type,o=r[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+c(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+c(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+c(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),t&&(m=m?t+" and ("+m+")":t);var u=this.employeeLookupDisplayFields;return this.employeeService.listExternalEmployee({page:p,sort:d,filterQuery:m,displayFields:u}).pipe(s.map((function(e){return n.mapEmployeeLookup(e)})))},n.prototype.onEmployeeLookupRequest=function(e,t){var n=this,o=this.employeeLookupDisplayFields.map((function(e){return{field:e,order:1}})),i=this.getEmployeeSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var o=t.name,i=t.type;return"number"==typeof e?o+" eq "+e:i===l.FieldType.Date?o+" eq '"+c(e).format("YYYY-MM-DD")+"'":i===l.FieldType.Time?o+" eq '"+c(e).format("HH:mm:ss")+"'":i===l.FieldType.DateTime?o+" eq '"+c(e).format()+"'":i===l.FieldType.Enum?n.loadEnumFromLabel(e).map((function(e){return o+" eq '"+e+"'"})).join(" or "):i===l.FieldType.String?"containing(upper("+o+"), upper('"+e.replace(/'/g,"\\'")+"'))":o+" eq '"+e+"'"})).filter((function(e){return""!==e})).join(" or ");t&&(i=t+" and ("+i+")");var a=this.employeeLookupDisplayFields;return this.employeeService.listExternalEmployee({sort:o,filterQuery:i,displayFields:a}).pipe(s.map((function(e){return n.mapEmployeeLookup(e)})))},n.prototype.mapEmployeeLookup=function(e){var t=this;return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.employeeAdvancedDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=Un(e,n)),"employmentRelationship.contractType"===n&&(e[n]=t.loadLabelFromEnum(e[n])),e[n]})).join(t.employeeLookupSeparator)})}))})},n.prototype.loadLabelFromEnum=function(e){return this.contractTypeOptions.filter((function(t){return t.value===e}))[0].label},n.prototype.loadEnumFromLabel=function(e){return(e=e.toUpperCase().trim())&&void 0!==e?this.contractTypeOptions.filter((function(t){var n=t.label.toUpperCase().match(e);return null!==n&&0!==n.length})).map((function(e){return e.value})):[]},n.ctorParameters=function(){return[{type:a.TranslateService},{type:qe}]},n=W([t.Injectable()],n)}(),Wn=function(){function e(e,n,o,i,a,s,l){this.companyLookupService=e,this.translate=n,this.formBuilder=o,this.advancedFilterService=i,this.router=a,this.route=s,this.collectiveService=l,this.useEmployeeByCompany=!0,this.companySelected=[],this.employeeSelected=[],this.onCompanySelected=new t.EventEmitter,this.onEmployeeSelected=new t.EventEmitter,this.disableContinue=!1,this.allowCancel=!0,this.collectiveAdvancedSearchTokens=[],this.panelCollapsed=this.collectiveService.getPanelStatus(),this.ngUnsubscribe=new r.Subject,this.formFilterType=P.ProcessFilterType.BASIC_FILTER,this.filterControls={BASIC_FILTER:["employeeIds","companyIds"],ADVANCED_FILTER:["advancedFilter"]}}return e.prototype.ngOnInit=function(){var e=this;this.createFormGroup(),this.companiesSearchFields=this.companyLookupService.getCompanySearchFields(),this.companiesSearchGridFields=this.companyLookupService.getCompanySearchFields(),this.collectiveService.getEmployeesIsPresent().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.requiredEmployee=t})),this.collectiveService.getCompaniesIsPresent().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.requiredCompany=t})),this.collectiveService.getCancelForm().pipe(s.takeUntil(this.ngUnsubscribe),s.filter((function(e){return!!e}))).subscribe((function(){e.collectiveAdvancedCancel()}))},e.prototype.onCompaniesLookupRequest=function(e){var t=this;this.companyLookupService.onCompanyLookupRequest(e).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.companiesLookupSuggestions=e.contents}))},e.prototype.onCompaniesSearchRequest=function(e){var t=this;this.companyLookupService.onCompanySearchRequest(e).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){t.companiesSearchGridData=e.contents,t.companiesSearchTotalRecords=e.totalElements,t.companiesSearchTotalRecordsLabel=t.translate.instant("hcm_contract.employment_additional_info.total_records",{value:e.totalElements})}))},e.prototype.createFormGroup=function(){this.formGroup=this.formBuilder.group({employeeIds:[{value:void 0,disabled:!this.useEmployeeByCompany},p.Validators.compose(this.useEmployeeByCompany?[p.Validators.required]:[])],companyIds:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required,this.onlySingleCompanySelectionPermission?p.Validators.maxLength(1):null])],advancedFilter:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required])]},{validators:this.useEmployeeByCompany?this.employeesOrCompaniesArePresent():""}),this.parentFormGroup.addControl("filter",this.formGroup)},e.prototype.onSelectCompanyIds=function(e){Array.isArray(e)?this.companySelected=e.map((function(e){return e.id})):this.companySelected.push(null==e?void 0:e.id),this.onCompanySelected.emit(this.companySelected),this.useEmployeeByCompany||(this.formGroup.get("employeeIds").reset(),this.formGroup.get("employeeIds").enable())},e.prototype.onClearCompanyIds=function(e){if(Array.isArray(e))this.companySelected=e.map((function(e){return e.id}));else{var t=this.companySelected.indexOf(null==e?void 0:e.id);this.companySelected.splice(t,1)}this.onCompanySelected.emit(this.companySelected)},e.prototype.onClearSingleCompany=function(){this.useEmployeeByCompany||ae(this.formGroup,!0,"employeeIds")},e.prototype.onSelectEmployeeIds=function(e){Array.isArray(e)?this.employeeSelected=e:this.employeeSelected.push(e),this.onEmployeeSelected.emit(this.employeeSelected)},e.prototype.onClearEmployeeIds=function(e){if(Array.isArray(e))this.employeeSelected=e;else{var t=this.employeeSelected.indexOf(e);delete this.employeeSelected[t]}this.onEmployeeSelected.emit(this.employeeSelected)},e.prototype.employeesOrCompaniesArePresent=function(){var e=this;return function(t){var n,o;if(!t.pristine){var i=t.get("companyIds"),a=t.get("employeeIds"),r=(null===(n=null==a?void 0:a.value)||void 0===n?void 0:n.length)>0,s=e.useEmployeeByCompany?(null===(o=null==i?void 0:i.value)||void 0===o?void 0:o.length)>0:i.value;e.formFilterType!==P.ProcessFilterType.BASIC_FILTER||r||s?e.formFilterType===P.ProcessFilterType.BASIC_FILTER&&(i.clearValidators(),mn(i,"required"),a.clearValidators(),mn(a,"required")):(i.setValidators([p.Validators.required]),a.setValidators([p.Validators.required]),t.pristine||(i.markAsDirty(),i.updateValueAndValidity({onlySelf:!0}),a.markAsDirty(),a.updateValueAndValidity({onlySelf:!0}))),e.collectiveService.setEmployeeIsPresent(r),e.collectiveService.setCompaniesIsPresent(s)}return null}},e.prototype.collectiveAdvancedSearch=function(){this.formGroup.valid&&(this.getCollectiveAdvancedFiltersList(),this.disableCollectiveAdvancedFiltersForm(!0)),this.validateAllFormFields(this.formGroup),this.validateAllFormFields(this.parentFormGroup)},e.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)}))},e.prototype.collectiveAdvancedClear=function(){this.formGroup.reset(),this.advancedFilterService.setClearAdvancedFilter(!0),this.validateAllFormFields(this.formGroup),this.companySelected=[],this.collectiveAdvancedCancel(),this.useEmployeeByCompany||ae(this.formGroup,!0,"employeeIds")},e.prototype.getCollectiveAdvancedFiltersList=function(){this.loading=!0,this.panelCollapsed=!0,this.collectiveService.setIsUsingTable(!0),this.disableContinue=!0,this.setCollectiveAdvancedSearchTokens()},e.prototype.collectiveAdvancedRemoveToken=function(e){this.formGroup.get(e.id).setValue(void 0)},e.prototype.getCompanyTokenWhenEntityHasNoStructure=function(){var e,t;return null===(t=null===(e=this.formGroup.get("companyIds"))||void 0===e?void 0:e.value)||void 0===t?void 0:t.label},e.prototype.getCompanyTokenWhenEntityHasStructure=function(){var e;return(null===(e=this.formGroup.get("companyIds"))||void 0===e?void 0:e.value)&&this.formGroup.get("companyIds").value.map((function(e){return e.label})).join(", ")},e.prototype.onFilterTypeChanged=function(e){this.formFilterType=e,this.formGroup.markAsPristine()},e.prototype.setCollectiveAdvancedSearchTokens=function(){var e,t;this.collectiveAdvancedSearchTokens=[];var n=this.useEmployeeByCompany?this.getCompanyTokenWhenEntityHasStructure():this.getCompanyTokenWhenEntityHasNoStructure(),o=(null===(e=this.formGroup.get("employeeIds"))||void 0===e?void 0:e.value)&&this.formGroup.get("employeeIds").value.map((function(e){return e.label})).join(", "),i=this.formGroup.get("advancedFilter");this.companyToken={id:"companyIds",label:this.translate.instant("hcm_contract.employment_contract.employer")+":"+n},this.employeeToken={id:"employeeIds",label:this.translate.instant("hcm_contract.employment_contract.employee")+":"+o},i&&(this.advancedFilterToken={id:"advancedFilter",label:this.translate.instant("hcm_contract.employment_contract.advanced_filter_side_bar_title")+":"+(null===(t=null==i?void 0:i.value)||void 0===t?void 0:t.label)}),this.formFilterType===P.ProcessFilterType.BASIC_FILTER&&(n&&this.collectiveAdvancedSearchTokens.push(this.companyToken),o&&this.collectiveAdvancedSearchTokens.push(this.employeeToken)),(null==i?void 0:i.value)&&this.formFilterType===P.ProcessFilterType.ADVANCED_FILTER&&this.collectiveAdvancedSearchTokens.push(this.advancedFilterToken)},e.prototype.disableCollectiveAdvancedFiltersForm=function(e){e?(this.disableFieldsOnFormGroup(),this.disableContinue=!0):(this.enableFieldsOnFormGroup(),this.disableContinue=!1)},e.prototype.collectiveAdvancedCancel=function(){this.panelCollapsed=!1,this.collectiveService.resetPanelAndTableStatus(),this.collectiveAdvancedSearchTokens=[],this.disableCollectiveAdvancedFiltersForm(!1),this.formFilterType===P.ProcessFilterType.ADVANCED_FILTER&&this.disableFieldsOnFormGroup()},e.prototype.onCancel=function(){this.goBack(),this.collectiveService.resetPanelAndTableStatus()},e.prototype.goBack=function(){var e=this.route.snapshot.params.workshiftHistory,t=this.route.snapshot.params.annotationHistory,n=this.route.snapshot.params.leaveHistory;return e||t||n?this.router.navigate(["../"],{relativeTo:this.route}):this.router.navigate(["../"],{relativeTo:this.route.parent})},e.prototype.enableFieldsOnFormGroup=function(){this.formGroup.get("companyIds").enable(),this.formGroup.get("employeeIds").enable()},e.prototype.disableFieldsOnFormGroup=function(){this.formGroup.get("companyIds").disable(),this.formGroup.get("employeeIds").disable()},e.prototype.companyRequiredError=function(){return this.useEmployeeByCompany?"hcm_contract.employment_contract.collective_history_filters_employees_and_companies_are_empty":"hcm_contract.employment_contract.error_required"},e.prototype.companySearchTitle=function(){return this.useEmployeeByCompany?"hcm_contract.employment_contract.collective_history_filters_collective_companies_search_title":"hcm_contract.employment_contract.fixed_entry_employee_employer_search_title"},e.ctorParameters=function(){return[{type:Yn},{type:a.TranslateService},{type:p.FormBuilder},{type:P.AdvancedFilterService},{type:d.Router},{type:d.ActivatedRoute},{type:nn}]},W([t.Input()],e.prototype,"useEmployeeByCompany",void 0),W([t.Input()],e.prototype,"onlySingleCompanySelectionPermission",void 0),W([t.Input()],e.prototype,"parentFormGroup",void 0),W([t.Output()],e.prototype,"onCompanySelected",void 0),W([t.Output()],e.prototype,"onEmployeeSelected",void 0),W([t.Input()],e.prototype,"allowCancel",void 0),e=W([t.Component({selector:"lib-collective-history-filters",template:'<p-panel styleClass="form-group" [toggleable]="true" [(collapsed)]="panelCollapsed">\n <p-header>\n {{"hcm_contract.employment_contract.collective_history_filters_batch_filters" |translate}}\n <s-token-list [tokens]="collectiveAdvancedSearchTokens" (tokenRemoved)="collectiveAdvancedRemoveToken($event)"></s-token-list>\n </p-header>\n <form [formGroup]="formGroup">\n <div class="ui-fluid">\n <fnd-filter-container [filterType]="\'PROCESS\'"\n [formGroup]="formGroup" [filterControls]="filterControls"\n (filterTypeChanged)="onFilterTypeChanged($event)">\n <div class="ui-g-12 ui-md-6 required">\n <label for="companies">{{"hcm_contract.employment_contract.collective_history_filters_collective_companies" | translate}}</label>\n\n <s-lookup dataKey="id" id="companies" name="companies" formControlName="companyIds"\n [searchFields]="companiesSearchFields" [searchGridFields]="companiesSearchGridFields"\n [searchGridData]="companiesSearchGridData" [multiple]="true"\n [lookupSuggestions]="companiesLookupSuggestions"\n (onLookupRequest)="onCompaniesLookupRequest($event)"\n (onSearchRequest)="onCompaniesSearchRequest($event)" lookupDisplayField="label"\n (onSelect)="onSelectCompanyIds($event)" (onUnselect)="onClearCompanyIds($event)"\n (onClear)="onClearSingleCompany()"\n [searchTotalRecords]=companiesSearchTotalRecords\n [searchTitle]="companySearchTitle() | translate"\n [searchEmptyTitle]="\'hcm_contract.employment_contract.nothing_found\' | translate"\n [filterLabel]="\'hcm_contract.employment_contract.filter\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.filters\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.clear\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.cancel\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_contract.total_records\'\n | translate: {value: companiesSearchTotalRecords}">\n </s-lookup>\n <s-control-errors\n [control]="formGroup.controls[\'companyIds\']"\n [errorMessages]= "{ \n maxlength: \'hcm_contract.employment_contract.collective_history_filters_cant_select_more_than_one_company\'\n | translate,\n required: companyRequiredError() | translate }">\n </s-control-errors>\n </div>\n <div class="ui-sm-12 ui-md-6"\n [ngClass]="requiredCompany || !useEmployeeByCompany ? \'ui-g-12 ui-md-6\' : \'ui-g-12 ui-md-6 required\'">\n <label for="employeeIds">{{"hcm_contract.employment_contract.collective_history_filters_collective_employees" | translate}}</label>\n <fnd-employee-lookup \n [formGroup]="formGroup"\n [setCompanyIds]="companySelected"\n (clear)="onClearEmployeeIds($event)"\n (select)="onSelectEmployeeIds($event)"\n [controlName]="\'employeeIds\'"\n [multiple]="true">\n </fnd-employee-lookup>\n <s-control-errors [control]="formGroup.controls[\'employeeIds\']" [errorMessages]= "{\n required: \'hcm_contract.employment_contract.collective_history_filters_employees_and_companies_are_empty\' | translate\n }">\n </s-control-errors>\n </div>\n </fnd-filter-container>\n </div>\n\n </form>\n <p-footer>\n <div class="ui-g">\n <div class="ui-g-12">\n <s-button id="btn-continue" [label]="\'hcm_contract.employment_contract.collective_history_filters_continue\'|translate" priority="primary"\n [disabled]="disableContinue" [auxiliary]="false" (click)="collectiveAdvancedSearch()"></s-button>\n <s-button [disabled]="disableContinue" id="btn-clear" [label]="\'hcm_contract.employment_contract.collective_history_filters_clear\'|translate"\n priority="secondary" (onClick)="collectiveAdvancedClear()"></s-button>\n <s-button *ngIf="allowCancel" [disabled]="disableContinue" id="btn-cancel" [label]="\'hcm_contract.employment_contract.cancel\'|translate" priority="link"\n (onClick)="onCancel()"></s-button>\n </div>\n </div>\n </p-footer>\n</p-panel>\n'})],e)}(),Qn=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,P.AdvancedFilterModule,P.FilterContainerModule,G.EmployeeLookupModule],providers:[zn,P.AdvancedFilterService,P.FilterContainerService,Yn],declarations:[Wn],exports:[Wn]})],e)}();!function(e){e.ADMISSION="ADMISSION"}(jn||(jn={}));var Xn,Kn=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translate=n,this.domain="journey_flexibilization",this.service="general",this.queriesUrl=this.domain+"/"+this.service+"/queries"}return e.prototype.getModelFieldsConfiguration=function(e,t){void 0===t&&(t=[]);var n={journeyType:jn.ADMISSION,modelGroupId:e,entityNames:t};return this.http.post(this.queriesUrl+"/getModelFieldsConfiguration",n).pipe(vt(this.messageService,this.translate)).pipe(s.map((function(e){var t,n={};return null===(t=e.content)||void 0===t||t.forEach((function(e){n[e.entityName]=n[e.entityName]||{},n[e.entityName][e.fieldName]={id:e.id,required:e.required,visible:e.visible,editable:e.editable,defaultValue:e.defaultValue}})),n})))},e.prototype.mergeFieldsConfig=function(e,t){var n=this,o=t.map((function(e){var t,n;return{field:e.fieldName,disabled:!(null===(t=null==e?void 0:e.config)||void 0===t?void 0:t.editable),clearValue:!1,validators:(null===(n=null==e?void 0:e.config)||void 0===n?void 0:n.required)?[p.Validators.required]:[]}}));oe(e,o),t.forEach((function(t){return n.mergeFieldValue(e,t.fieldName,t.config,t.findById,t.onEdit)}))},e.prototype.mergeFieldValue=function(e,t,n,o,i){var a=e.get(t);(null==n?void 0:n.defaultValue)&&!i?o?o(null==n?void 0:n.defaultValue):a.setValue(null==n?void 0:n.defaultValue):i||a.setValue(null)},e.prototype.clearFieldsConfigs=function(e,t){var n=this;t.forEach((function(t){return n.clearFieldConfig(e,t.fieldName,t.validators)}))},e.prototype.clearFieldConfig=function(e,t,n,o,i){void 0===n&&(n=[]),void 0===o&&(o=!0),void 0===i&&(i=null);var a=e.get(t);a.setValidators(n),a.setValue(i),o?a.enable():a.disable()},e.prototype.isVisible=function(e,t){var n=this.jsonPath(e,t);return void 0===n||(null==n?void 0:n.visible)},e.prototype.isRequired=function(e,t){var n=this.jsonPath(e,t);return void 0===n||(null==n?void 0:n.required)},e.prototype.isEditable=function(e,t){var n=this.jsonPath(e,t);return void 0===n||(null==n?void 0:n.editable)},e.prototype.jsonPath=function(e,t){return null==t?void 0:t.split(".").reduce((function(e,t){return e&&e[t]}),e)},e.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},e=W([t.Injectable()],e)}(),$n=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,In,Bn,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,G.EntityLookupModule.forRoot({domain:"hcm_contract",service:"employment_contract"}),l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,G.WorkshiftLookupModule,l.DynamicFormModule,l.TokenListModule,E.PanelModule,D.InputTextModule,V.ButtonModule,N.CheckboxModule,k.TableModule,v.ConfirmDialogModule,_.CalendarModule,g.DropdownModule,I.TabViewModule,i.SharedModule,y.HotkeyModule,l.LoadingStateModule,l.BignumberInputModule,n.CyclicJsonInterceptorModule,n.HttpInterceptorModule,R.ToastModule,Qn,G.EmployeeLookupModule],declarations:[On,Gn],providers:[Xe,i.MessageService,ze,je,Vn,Nn,nn,pn,Kn],exports:[On,Gn]})],e)}(),Jn=c,Zn=function(n){function o(e,t,o,i,a,r,s,l,p,d,m,u,h,y,f,_,v,g,b){var S=n.call(this,s,h,u,y,i)||this;return S.annotationHistoryService=e,S.router=t,S.route=o,S.messageService=i,S.confirmationService=a,S.formBuilder=r,S.translate=s,S.hotkeysService=l,S.fieldCustomization=p,S.focusService=d,S.annotationTypeLookupService=m,S.employeeService=u,S.baseService=h,S.platformService=y,S.cd=f,S.collectiveService=_,S.sanitizer=v,S.annotationHistoryAttachmentService=g,S.employeeLookupService=b,S.localeConfig={},S.currencyLocaleOptions={},S.permissions={},S.allPermissions={},S.mainPanelCollapsed=!1,S.isUsingTable=!1,S.responsibleLookupDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],S.responsibleAdvancedDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],S.responsibleLookupSeparator=" - ",S.errorMessages={required:S.translate.instant("hcm_contract.employment_additional_info.error_required"),min:S.translate.instant("hcm_contract.employment_additional_info.error_min_value",{value:10}),max:S.translate.instant("hcm_contract.employment_additional_info.error_max_value"),minlength:S.translate.instant("hcm_contract.employment_additional_info.error_min_length"),maxlength:S.translate.instant("hcm_contract.employment_additional_info.error_max_length"),pattern:S.translate.instant("hcm_contract.employment_additional_info.error_invalid"),cnpjNotValid:S.translate.instant("hcm_contract.employment_additional_info.error_cnpj_not_valid"),dateBeforeAdmission:S.translate.instant("hcm_contract.employment_additional_info.validation_start_date_is_before_hire_date"),dateAfterDismissal:S.translate.instant("hcm_contract.employment_additional_info.validation_start_date_is_after_dismissal_date"),messageProcessNumberRequires17Or21Figures:S.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_17_or_21_figures"),messageProcessNumberRequires20Figures:S.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_20_figures"),messageProcessNumberRequires10Figures:S.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_10_figures"),justifiedDaysQuantityMustBeLowerThanEndDate:S.translate.instant("hcm_contract.employment_additional_info.message_justified_days_cant_be_greater_than_days_between_start_and_end_date"),timeMustNotBeZero:S.translate.instant("hcm_contract.employment_additional_info.message_time_must_not_be_zero"),estimatedEndDateMustBeGreaterThanOrEqualToStartDate:S.translate.instant("hcm_contract.employment_additional_info.message_date_should_be_greater_than_or_equal_to_start_date"),endDateMustBeGreaterThanOrEqualToStartDate:S.translate.instant("hcm_contract.employment_additional_info.message_date_should_be_greater_than_or_equal_to_start_date")},S.files=[],S.listFiles=[],S.countBeforeUploadFile=0,S.countAfterUploadFile=0,S.configAnnotation=[],S.domain=c.DOMAIN,S.service=c.SERVICE,S.entity=c.ENTITY,S.historyName=c.HISTORY_NAME,S.useBaseHistoryStructure=!1,S}var c;return Y(o,n),c=o,o.prototype.ngOnInit=function(){var e=this;this.collectiveProcessType=this.route.snapshot.fragment,this.formGroup=this.getFormGroup(),this.allocateLoadedEmployee(),this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)})),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.responsibleSearchFields=this.getResponsibleSearchFields(),this.responsibleSearchGridFields=this.getResponsibleSearchGridFields(),this.isCollective?this.startFuncionsByBaseCollectiveHistory():this.startFuncionsByBaseHistory(),this.configAnnotation=[{type:l.DynamicType.Section,configs:[{type:l.DynamicType.Row,fields:[new l.FormField({type:l.FieldType.TextIA,name:"annotation",rows:5,label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation"),size:{xl:12,lg:12,md:12,sm:12,xs:12},prompt:'Reescreva a seguinte observação fornecida pelo colaborador de forma clara e concisa, mantendo o significado original: "{{context}}".\n Limite a 30 palavras. A observação deve ser feita em '+this.translate.getDefaultLang()+"."})]}]}]},o.prototype.ngAfterViewChecked=function(){this.cd.detectChanges()},o.prototype.ngAfterViewInit=function(){this.cd.detectChanges();var e=document.getElementsByTagName("input"),t=Array.from(e).find((function(e){return!e.disabled}));t&&t.focus()},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+s",(function(){return(e.isNew()||e.permissions.editar)&&e.onSave(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+c",(function(){return e.onCancel(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.isNew=function(){return"new"===this.routeParams.annotationHistory},o.prototype.onRouteParamsChange=function(e){this.routeParams=e},o.prototype.updateSuggestions=function(e){this.employeeLookupService.updateSuggestions(e),this.annotationTypeLookupService.updateSuggestions(e),e.responsible&&(e.responsible.label=this.getSuggestionValue(["code","person.nomPes"],"responsible",e,this.responsibleLookupSeparator),e.responsible.label.trim()===this.responsibleLookupSeparator.trim()&&delete e.responsible.label)},o.prototype.getSuggestionValue=function(e,t,n,o){var i=this;return e.map((function(e){return i.getProp(n,t+"."+e)})).reduce((function(e,t){return""+e+o+t}))},o.prototype.onRouteDataChange=function(e){var t,n,o,i,a=e.localeConfig.number,r=a.currencySymbol,s=a.thousandsSeparator,l=a.decimalSeparator;if(this.localeConfig=e.localeConfig,this.currencyLocaleOptions={align:"left",prefix:r,thousands:s,decimal:l},this.permissions=null===(t=null==e?void 0:e.allPermissions)||void 0===t?void 0:t.annotationHistory,this.allPermissions=null==e?void 0:e.allPermissions,this.customizationPermission=null===(n=null==e?void 0:e.allPermissions)||void 0===n?void 0:n.customization,this.validateVisualization(),e.entity){this.permissions.editar||this.formGroup.disable();var c=zt.fromDto(e.entity);this.listFiles=null==c?void 0:c.annotationHistoryAttachments,this.countAfterUploadFile=null===(o=this.listFiles)||void 0===o?void 0:o.length,this.countBeforeUploadFile=null===(i=this.listFiles)||void 0===i?void 0:i.length,this.updateSuggestions(c),this.formGroup.patchValue(c),this.startFuncionsByBaseHistoryInEdit(c)}else this.formGroup.patchValue(new zt)},o.prototype.onCancel=function(){this.isCollective?this.collectiveService.setCancelForm(!0):this.goBack()},o.prototype.onSendFile=function(e,t){var n=[];return this.fieldCustomization.isEmpty(e)||n.push(this.fieldCustomization.deleteFiles(e)),this.fieldCustomization.isEmpty(t)||n.push(this.fieldCustomization.commitFiles(t)),this.fieldCustomization.isEmpty(n)?r.of({}):r.forkJoin(n)},o.prototype.onSave=function(){var e=this;if(!this.formGroup.valid)return this.loading=!1,this.validateAllFormFields(this.formGroup);this.formGroup.get("annotationHistoryAttachments").setValue(this.listFiles),this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onSaveCollective()}}):this.onSaveSingle()},o.prototype.onSaveCollective=function(){var e=this;this.loading=!0;var t=this.formGroup.getRawValue(),n=this.collectiveFormGroup.getRawValue(),o=zt.toDtoCollective(t,null==n?void 0:n.filter);this.annotationHistoryService.saveCollective(o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onSaveSingle=function(){var e=this;if(this.loading=!0,this.onFormLoadingSubject.next(!0),!this.formGroup.valid)return this.loading=!1,this.onFormLoadingSubject.next(!1),this.validateAllFormFields(this.formGroup);var t=this.fieldCustomization.getFiles(this.formGroup),n=t.filesToDelete,o=t.filesToCommit;this.getSaveObservable().pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,e.onFormLoadingSubject.next(!1),r.throwError(t)}))).subscribe((function(){e.onSendFile(n,o).pipe(s.takeUntil(e.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,r.throwError(t)}))).subscribe((function(){e.addMessage("success","hcm_contract.employment_additional_info.saved_message_title","hcm_contract.employment_additional_info.saved_message_content"),e.employeeData?(e.onClose.next(!0),e.loading=!1):e.goBack()}))}))},o.prototype.onDeleteCollective=function(){var e=this,t=this.formGroup.getRawValue(),n=this.collectiveFormGroup.getRawValue(),o=zt.toDtoCollective(t,null==n?void 0:n.filter);this.annotationHistoryService.deleteCollective(o).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onDelete=function(){var e=this;if(!this.formGroup.valid)return this.loading=!1,this.validateAllFormFields(this.formGroup);this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onDeleteCollective()}}):this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_title"),accept:function(){e.loading=!0,e.getDeleteObservable().pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.loading=!1}))).subscribe()}})},o.prototype.doAfterProcessAndResetFormGroup=function(e){this.doAfterProcess(e),this.resetFormGroup()},o.prototype.resetFormGroup=function(){this.formGroup.reset(),this.collectiveFormGroup.reset()},o.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},o.prototype.onResponsibleLookupRequest=function(e){var t=this,n=this.responsibleLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getResponsibleSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or ");o=this.getFilterDismissalResponsible(o);var i=Ee(this.responsibleLookupDisplayFields,this.responsibleAdvancedDisplayFields);this.employeeService.list({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.responsibleLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),"employmentRelationship.contractType"===n&&(e[n]=t.loadLabelFromEnum(e[n])),e[n]})).join(t.responsibleLookupSeparator)})}))})}))).subscribe((function(e){t.responsibleLookupSuggestions=e.contents}))},o.prototype.onResponsibleSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getResponsibleSearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+Jn(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+Jn(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+Jn(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and ");p=this.getFilterDismissalResponsible(p);var d=Ee(this.responsibleLookupDisplayFields,this.responsibleAdvancedDisplayFields);this.employeeService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.responsibleLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),"employmentRelationship.contractType"===n&&(e[n]=t.loadLabelFromEnum(e[n])),e[n]})).join(t.responsibleLookupSeparator)})}))})}))).subscribe((function(e){t.responsibleSearchGridData=e.contents,t.responsibleSearchTotalRecords=e.totalElements}))},o.prototype.getFormGroup=function(){return this.formBuilder.group({id:[{value:void 0,disabled:!0},p.Validators.compose([])],employee:[{value:void 0,disabled:!1},p.Validators.compose(this.isCollective?[]:[p.Validators.required])],startDate:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required])],annotationType:[{value:void 0,disabled:!0},p.Validators.compose([p.Validators.required])],sequence:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.min(1),p.Validators.max(99)])],documentNumber:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.maxLength(20)])],annotation:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.maxLength(999)])],responsible:[{value:void 0,disabled:!1},p.Validators.compose([])],createdBy:[{value:void 0,disabled:!0},p.Validators.compose([])],createdDate:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedBy:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedDate:[{value:void 0,disabled:!0},p.Validators.compose([])],annotationHistoryAttachments:[{value:void 0,disabled:!1},p.Validators.compose([])],custom:[]})},o.prototype.getResponsibleSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:Ge(this.translate)})]},o.prototype.getResponsibleSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:Ge(this.translate)})]},o.prototype.goBack=function(){this.router.navigate(["../"],{relativeTo:this.route})},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)})),this.focusService.focusFirstInvalidInput()},o.prototype.getSaveObservable=function(){var e=this.formGroup.getRawValue();e.employee=this.formGroup.controls[c.EMPLOYEE].value;var t,n=zt.toDto(e);if(this.isNew()||this.employeeData&&!e.id)t=this.annotationHistoryService.insert(n);else{var o=this.routeParams.annotationHistory;t=this.annotationHistoryService.update(o,n)}return t},o.prototype.getDeleteObservable=function(){var e=this;return this.annotationHistoryService.delete(this.routeParams.annotationHistory).pipe(s.tap((function(){e.addMessage("success","hcm_contract.employment_additional_info.deleted_message_title","hcm_contract.employment_additional_info.deleted_message_content"),e.goBack()})))},o.prototype.validateVisualization=function(){var e=this;["employee","annotationType"].every((function(t){return e.allPermissions[t]&&e.allPermissions[t].visualizar}))||this.router.navigate(["forbidden"])},o.prototype.loadLabelFromEnum=function(e){var t=Ge(this.translate).filter((function(t){return t.value===e}));return t&&t.length&&t[0].label||this.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")},o.prototype.getFilterDismissalResponsible=function(e){var t=this.formGroup.get("startDate").value&&Jn(this.formGroup.get("startDate").value).format("YYYY-MM-DD");t&&(e=e+" "+(e?"and":"")+" ((dismissalDate ge '"+t+"') or (dismissalDate is null))");return e},o.prototype.onSelectAnnotationType=function(e){this.setValidatorStartDate(e,"annotationType")},o.prototype.onClearAnnotationType=function(){this.onSelectAnnotationType(null)},o.prototype.createHistoryDTO=function(e,t){var n=new zt;return n.startDate=Jn(e).toDate(),n.employee=Vt.fromDto(t,"AnnotationHistory"),n},o.prototype.getSaveButtonPermissions=function(){var t=this.isNew()||this.permissions.editar,n=this.permissions.incluir&&this.collectiveProcessType===e.CollectiveProcessType.INCLUDE;return this.isCollective?n:t},o.prototype.getDeleteButtonPermissions=function(){var t=!this.isNew()&&this.permissions.excluir,n=this.permissions.excluir&&this.collectiveProcessType===e.CollectiveProcessType.EXCLUDE;return this.isCollective?n:t},o.prototype.getFormGeneralTitle=function(){return this.collectiveProcessType?this.getCollectiveFormTitle():"hcm_contract.employment_additional_info.annotation_history_form_general_title"},o.prototype.getCollectiveFormTitle=function(){return this.collectiveProcessType===e.CollectiveProcessType.INCLUDE?"hcm_contract.employment_additional_info.annotation_history_collective_form_general_title":"hcm_contract.employment_additional_info.annotation_history_collective_delete_form_general_title"},o.prototype.isUsingTableChange=function(){return this.collectiveService.getIsUsingTable()},o.prototype.onUpload=function(e){var t=this,n=e.files;this.countBeforeUploadFile=this.countBeforeUploadFile+(null==n?void 0:n.length),n.forEach((function(e){e.savedFile||e.progress||(t.listFiles.push(e),e.isUploading=!0,t.saveFile(e).pipe(s.takeUntil(t.ngUnsubscribe),s.finalize((function(){e.isUploading=!1,t.countAfterUploadFile++}))).subscribe((function(){e.objectURL=t.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(e))})))}))},Object.defineProperty(o.prototype,"saveDisable",{get:function(){return this.countBeforeUploadFile&&this.countBeforeUploadFile!=this.countAfterUploadFile},enumerable:!0,configurable:!0}),o.prototype.doUpload=function(e,t,n){var o=new XMLHttpRequest;return t.locationURI=e.fileUrl,t.objectURL=e.uploadUrl,t.progress=100,o.onreadystatechange=function(){4===o.readyState&&(t.complete=!0,o.status<200||o.status>=300?(t.objectURL=void 0,t.error=o.statusText||"Erro ao anexar arquivo"):t.error=!1,n.next(t),n.complete())},o.open("PUT",t.objectURL,!0),o.setRequestHeader("Translate","f"),o.send(t)},o.prototype.saveFile=function(e){var t=this;return new r.Observable((function(n){return t.annotationHistoryAttachmentService.requestUpload(e).pipe(s.takeUntil(t.ngUnsubscribe)).subscribe((function(o){return t.doUpload(o,e,n)}))}))},o.prototype.onRemoveFile=function(e){var t=e.file;this.listFiles.splice(this.listFiles.indexOf(t),1),this.countAfterUploadFile--,this.countBeforeUploadFile--},o.prototype.onCancelUpload=function(e){this.files.splice(e,1)},o.prototype.fileValidationErrors=function(t){switch(t){case e.FileValidation.MAX_FILE_LIMIT:this.messageService.add({severity:"error",detail:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_max_length")});break;case e.FileValidation.MAX_FILE_SIZE:this.messageService.add({severity:"error",detail:this.translate.instant("hcm_contract.employment_additional_info.leave_history_max_mb")})}},o.prototype.onDownloadFile=function(e){var t=this;this.loading=!0;var n=e.index,o=e.anchor,i=this.listFiles[n];i.documentId&&this.annotationHistoryAttachmentService.downloadForDocument(i).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return t.loading=!1}))).subscribe((function(e){i.objectURL=e.downloadUrl,o.nativeElement.setAttribute("href",e.downloadUrl),o.nativeElement.click()})),i.objectURL&&(o.nativeElement.setAttribute("href",URL.createObjectURL(i)),o.nativeElement.click()),this.loading=!1},o.ENTITY="annotationType",o.DOMAIN="hcm_foundation",o.SERVICE="general",o.HISTORY_NAME="annotationHistory",o.ctorParameters=function(){return[{type:Ze},{type:d.Router},{type:d.ActivatedRoute},{type:i.MessageService},{type:i.ConfirmationService},{type:p.FormBuilder},{type:a.TranslateService},{type:y.HotkeysService},{type:Sn},{type:_n},{type:G.AnnotationTypeLookupService},{type:qe},{type:tn},{type:pn},{type:t.ChangeDetectorRef},{type:nn},{type:x.DomSanitizer},{type:ft},{type:G.EmployeeLookupService}]},W([t.ViewChild("customTemplate",{static:!1})],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFormFields",{static:!1})],o.prototype,"customFormFields",void 0),o=c=W([t.Component({template:'<div *ngFor="let process of processed">\n <p-messages [value]="process" key="info" [escape]="false"></p-messages>\n</div>\n<div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog acceptLabel="{{\'hcm_contract.employment_additional_info.yes\' | translate}}" acceptIcon=""\n rejectLabel="{{\'hcm_contract.employment_additional_info.no\' | translate}}" rejectIcon="">\n </p-confirmDialog>\n <form [formGroup]="formGroup" novalidate>\n <lib-collective-history-filters *ngIf="isCollective" (onEmployeeSelected)="onSelectBasicFilterByEmployee($event)" (onCompanySelected)="onSelectBasicFilterByCompany($event)"\n [parentFormGroup]="collectiveFormGroup"></lib-collective-history-filters>\n <p-panel *sLoadingState="loading" [styleClass]="employeeData ? \'form-group sidebar-panel\' : \'form-group\'"\n [toggleable]="false" [collapsed]="mainPanelCollapsed" [showHeader]="!employeeData"\n [hidden]="!isUsingTableChange() && isCollective">\n <p-header>\n {{getFormGeneralTitle() | translate}}\n </p-header>\n <div class="ui-fluid" *ngIf="!customFormFields else customFormFields">\n <div class="ui-g">\n <div [attr.data-hidden]="true" class="ui-g-12 ui-md-6">\n <label for="id">{{"hcm_contract.employment_additional_info.annotation_history_id" |\n translate}}</label>\n <input #idFormInput type="text" id="id" name="id" pInputText formControlName="id"\n autocomplete="off" />\n </div>\n <div *ngIf="!isCollective" [attr.data-hidden]="!allPermissions?.employee.visualizar"\n class="ui-g-12 ui-md-6 required">\n <label for="employee">{{"hcm_contract.employment_additional_info.annotation_history_employee" |\n translate}}</label>\n <fnd-employee-lookup id="employee"\n [formGroup]="formGroup"></fnd-employee-lookup>\n <s-control-errors [control]="formGroup.controls[\'employee\']"\n [errorMessages]="{ required: \'hcm_contract.employment_additional_info.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div class="ui-g-12 ui-md-6 required">\n <label for="startDate">{{"hcm_contract.employment_additional_info.annotation_history_start_date"\n |\n translate}}</label>\n <p-calendar id="startDate" #startDateFormInput inputId="startDate" name="startDate"\n [showIcon]="true" formControlName="startDate" [locale]="localeConfig.calendar"\n [dateFormat]="localeConfig.calendar.dateFormat" sCalendarMask>\n </p-calendar>\n <s-control-errors [control]="formGroup.controls[\'startDate\']"\n [errorMessages]="{ required: \'hcm_contract.employment_additional_info.error_required\'\n | translate,\n dateBeforeAdmission: \'hcm_contract.employment_additional_info.validation_start_date_is_before_hire_date\' | translate,\n dateAfterDismissal: \'hcm_contract.employment_additional_info.validation_start_date_is_after_dismissal_date\' | translate\n }"></s-control-errors>\n </div>\n <div [attr.data-hidden]="!allPermissions?.annotationType.visualizar"\n class="ui-g-12 ui-md-6 required">\n <label for="annotationType">{{"hcm_contract.employment_additional_info.annotation_history_type"\n |\n translate}}</label>\n <fnd-annotation-type-lookup\n id="annotationType"\n [structureParams]="structureParams"\n [formGroup]="formGroup"\n [isDisabled]="getDisableRegister(isCollective, isNew(), permissions)"\n (select)="onSelectAnnotationType($event)" (clear)="onClearAnnotationType()">\n </fnd-annotation-type-lookup>\n <s-control-errors [control]="formGroup.controls[\'annotationType\']"\n [errorMessages]="{ required: \'hcm_contract.employment_additional_info.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div class="ui-g-12 ui-md-6 required">\n <label\n for="sequence">{{"hcm_contract.employment_additional_info.annotation_history_sequence"\n | translate}}</label>\n <input #sequenceFormInput id="sequence" name="sequence" pInputText sBignumberInput\n thousandsSeparator="" decimalSeparator="" [allowNegative]="false"\n formControlName="sequence" autocomplete="off"/>\n <s-control-errors [control]="formGroup.controls[\'sequence\']"\n [errorMessages]="{\n required: \'hcm_contract.employment_additional_info.error_required\' | translate,\n min: \'hcm_contract.employment_additional_info.error_min_value\' | translate: {value: \'1\'},\n max: \'hcm_contract.employment_additional_info.error_max_value\' | translate: {value: \'99\'}\n }">\n </s-control-errors>\n </div>\n <div class="ui-g-12 ui-md-6">\n <label\n for="documentNumber">{{"hcm_contract.employment_additional_info.annotation_history_document_number"\n | translate}}</label>\n <input #documentNumberFormInput type="text" id="documentNumber" name="documentNumber" pInputText\n formControlName="documentNumber" autocomplete="off" />\n <s-control-errors [control]="formGroup.controls[\'documentNumber\']"\n [errorMessages]="{ maxlength: \'hcm_contract.employment_additional_info.error_max_length\' | translate: {value: \'20\'} }">\n </s-control-errors>\n </div>\n <div [attr.data-hidden]="!allPermissions?.employee.visualizar" class="ui-g-12 ui-md-6">\n <label\n for="responsible">{{"hcm_contract.employment_additional_info.annotation_history_responsible"\n | translate}}</label>\n <s-lookup dataKey="id" id="responsible" name="responsible" formControlName="responsible"\n [searchFields]="responsibleSearchFields" [searchGridFields]="responsibleSearchGridFields"\n [searchGridData]="responsibleSearchGridData" [multiple]="false"\n [lookupSuggestions]="responsibleLookupSuggestions"\n (onLookupRequest)="onResponsibleLookupRequest($event)"\n (onSearchRequest)="onResponsibleSearchRequest($event)" lookupDisplayField="label"\n [searchTotalRecords]=responsibleSearchTotalRecords\n [searchTitle]="\'hcm_contract.employment_additional_info.annotation_history_responsible_search_title\' | translate"\n [searchEmptyTitle]="\'hcm_contract.employment_additional_info.nothing_found\' | translate"\n [filterLabel]="\'hcm_contract.employment_additional_info.filter\' | translate"\n [filterTitle]="\'hcm_contract.employment_additional_info.filters\' | translate"\n [clearLabel]="\'hcm_contract.employment_additional_info.clear\' | translate"\n [cancelLabel]="\'hcm_contract.employment_additional_info.cancel\' | translate"\n [selectLabel]="\'hcm_contract.employment_additional_info.select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_additional_info.total_records\' | translate: {value: responsibleSearchTotalRecords}">\n </s-lookup>\n <s-control-errors [control]="formGroup.controls[\'responsible\']"\n [errorMessages]="{ required: \'hcm_contract.employment_additional_info.error_required\' | translate }">\n </s-control-errors>\n </div>\n <div class="ui-g-12 ui-md-12">\n <s-dynamic-form\n [configs]="configAnnotation"\n [id]="\'dynamic\'" [form]="formGroup"\n [errorMessages]="errorMessages">\n </s-dynamic-form>\n </div>\n\n <div class="ui-g-6 ui-md-6">\n <s-file-upload [formGroup]="formGroup.get(\'annotationHistoryAttachments\')" accept="*/*"\n [files]="listFiles" [multiple]="true" [fileLimit]="10"\n [chooseLabel]="\'hcm_contract.employment_additional_info.file_upload_choose_label\'\n | translate"\n [removeLabel]="\'hcm_contract.employment_additional_info.file_upload_remove_label\'\n | translate" [cancelLabel]="\'hcm_contract.employment_additional_info.cancel\' | translate"\n [maxFileSize]="10000000" (validateErrors)="fileValidationErrors($event?.validation)"\n (uploadHandler)="onUpload($event)" (removeFile)="onRemoveFile($event)"\n (cancelUpload)="onCancelUpload($event)" (downloadFile)="onDownloadFile($event)">\n </s-file-upload>\n </div>\n </div>\n </div>\n <s-custom-fields *ngIf="customizationPermission.visualizar && !isCollective" domain="hcm_contract"\n service="employment_additional_info" entity="annotationHistory" formControlName="custom"\n [invalidErrorLabel]="\'hcm_contract.employment_additional_info.error_invalid\' | translate">\n </s-custom-fields>\n <div class="ui-g" *ngIf="!isNew() && !isCollective">\n <div class="ui-g-12 ui-inputgroup">\n <label *ngIf="formGroup.get(\'createdBy\').value !== \'\'" style="color: #a3a3a3; margin-right: 2px;">\n {{\'hcm_contract.employment_contract.created_by\' | translate}}\n {{formGroup.get(\'createdBy\').value}} {{\'hcm_contract.employment_contract.at_date\' | translate}}\n {{formGroup.get(\'createdDate\').value | localizedDate:"L" | async}}\n {{\'hcm_contract.employment_contract.at_time\' | translate}}\n {{formGroup.get(\'createdDate\').value | localizedDate:"LTS" | async}}.\n </label>\n <label *ngIf="formGroup.get(\'lastModifiedBy\').value !== \'\'" style="color: #a3a3a3;">\n {{\'hcm_contract.employment_contract.updated_by\' | translate}}\n {{formGroup.get(\'lastModifiedBy\').value}}\n {{\'hcm_contract.employment_contract.at_date\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | localizedDate:"L" | async}}\n {{\'hcm_contract.employment_contract.at_time\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | localizedDate:"LTS" | async }}.\n </label>\n </div>\n </div>\n <p-footer *ngIf="!employeeData">\n <button id="save-button"\n title="{{\'hcm_contract.employment_additional_info.save\' | translate}} (Alt + Shift + S)"\n [disabled]="saveDisable" type="submit" pButton\n label="{{\'hcm_contract.employment_additional_info.save\' | translate}}" (click)="onSave()"\n *ngIf="getSaveButtonPermissions()"></button>\n <button id="delete-button"\n title="{{\'hcm_contract.employment_additional_info.delete\' | translate}} (Alt + Shift + X)"\n type="button" class="ui-button-secondary" pButton\n label="{{\'hcm_contract.employment_additional_info.delete\' | translate}}" (click)="onDelete()"\n *ngIf="getDeleteButtonPermissions()" [disabled]="loading"></button>\n <button id="cancel-button"\n title="{{\'hcm_contract.employment_additional_info.cancel\' | translate}} (Alt + Shift + C)"\n type="button" class="ui-button-link" pButton\n label="{{\'hcm_contract.employment_additional_info.cancel\' | translate}}"\n (click)="onCancel()"></button>\n </p-footer>\n </p-panel>\n </form>\n</div>\n<p-confirmDialog key="customized" #customized\n header="{{ \'hcm_contract.employment_contract.generic_confirm\' | translate }}">\n <p-footer>\n <s-button label="{{ \'hcm_contract.employment_contract.yes\' | translate }}" (onClick)="customized.accept()"\n priority="primary" [disabled]="false" [auxiliary]="false">\n </s-button>\n <s-button label="{{ \'hcm_contract.employment_contract.no\' | translate }}" (onClick)="customized.reject()"\n priority="secondary" [disabled]="false" [auxiliary]="false">\n </s-button>\n </p-footer>\n</p-confirmDialog>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',selector:"fnd-annotation-history-form",providers:[i.ConfirmationService],styles:[":host ::ng-deep .sidebar-panel{border:none!important;padding-left:0!important}"]})],o)}(Pn),eo=c,to=function(n){function o(t,o,i,a,s,l,c,p,d,m,u,h,y,f,_,v){var g=n.call(this,s)||this;return g.router=t,g.route=o,g.annotationHistoryService=i,g.confirmationService=a,g.translate=s,g.messageService=l,g.hotkeysService=c,g.formBuilder=p,g.filtersStorageService=d,g.paginatorStorageService=m,g.employeeService=u,g.annotationTypeService=h,g.companyService=y,g.companyBranchService=f,g.employeeLookupService=_,g.configService=v,g.allPermissions={},g.permissions={},g.localeConfig={},g.currentListParams={page:0,size:10,sort:[],filterData:{}},g.filtersPanelCollapsed=!0,g.searchTokens=[],g.serverError=!1,g.filtersLoaded=!1,g.annotationTypeLookupDisplayFields=["code","name"],g.annotationTypeAdvancedDisplayFields=["code","name"],g.employeeLookupDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],g.employeeAdvancedDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"],g.responsibleLookupDisplayFields=["code","person.nomPes"],g.responsibleAdvancedDisplayFields=["code","person.nomPes"],g.companyLookupDisplayFields=["codEmp","nomEmp"],g.companyAdvancedDisplayFields=["codEmp","nomEmp"],g.companyBranchLookupDisplayFields=["codFil","nomFil"],g.companyBranchAdvancedDisplayFields=["codFil","nomFil"],g.contractTypeOptions=[{label:g.translate.instant("hcm_contract.employment_additional_info.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:g.translate.instant("hcm_contract.employment_additional_info.contract_type_director"),value:e.ContractType.DIRECTOR},{label:g.translate.instant("hcm_contract.employment_additional_info.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:g.translate.instant("hcm_contract.employment_additional_info.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:g.translate.instant("hcm_contract.employment_additional_info.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}],g.annotationTypeLookupSuggestionsObservable=new r.Subject,g.annotationTypeLookupSearchObservable=new r.Subject,g.responsibleLookupSuggestionsObservable=new r.Subject,g.responsibleLookupSearchObservable=new r.Subject,g.companyLookupSuggestionsObservable=new r.Subject,g.companyLookupSearchObservable=new r.Subject,g.companyBranchLookupSuggestionsObservable=new r.Subject,g.companyBranchLookupSearchObservable=new r.Subject,g.collectiveActions=[],g}return Y(o,n),o.prototype.ngOnInit=function(){var e=this;this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.filterFormGroup=this.formBuilder.group({employer:[void 0,p.Validators.compose([])],companyBranch:[void 0,p.Validators.compose([])],contractType:[void 0,p.Validators.compose([])],employee:[void 0,p.Validators.compose([])],annotationType:[void 0,p.Validators.compose([])],employeeSituation:[void 0,p.Validators.compose([])]}),this.setStoragePaginator(),this.setStorageFiltersIntoForm(this.filterFormGroup),this.gridColumns=this.getGridColumns(),this.filterFields=this.getFilterFields(),this.filterFormGroup.get("employer").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(){e.filterFormGroup.get("companyBranch").setValue(null)})),this.setHotkeys(),this.permissions.incluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.add_collective"),command:function(){return e.onAddCollective()}}),this.permissions.excluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.remove_collective"),command:function(){return e.onRemoveCollective()}})},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+e",(function(){return e.selection&&1===e.selection.length&&e.onEdit(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.selection&&e.selection.length&&e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+n",(function(){return e.permissions.incluir&&e.onAdd(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+f",(function(){return e.onSearch(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+l",(function(){return e.onClear(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.onRouteDataChange=function(e){this.allPermissions=e.allPermissions,this.permissions=e.allPermissions.annotationHistory,this.localeConfig=e.localeConfig},o.prototype.hasEmpty=function(e){if(Object.keys(e).filter((function(t){return""===e[t]})).length>0)return!0},o.prototype.onSearch=function(){var e=this.filterFormGroup.getRawValue();if(this.hasEmpty(e))return this.filtersPanelCollapsed=!0,this.validateAllFormFields(this.filterFormGroup);this.currentListParams.page=0,this.filtersPanelCollapsed=!0,this.resetGrid({filterData:e}),this.filtersStorageService.storeFilters("AnnotationHistoryListComponent",e)},o.prototype.onClear=function(){this.filterFormGroup.reset();var e=this.filterFormGroup.getRawValue();this.resetGrid({filterData:e}),this.filtersStorageService.removeFilter("AnnotationHistoryListComponent")},o.prototype.onRemoveToken=function(e){this.filterFormGroup.get(e.id).setValue(void 0);var t=this.filterFormGroup.getRawValue();this.resetGrid({filterData:t}),this.filtersStorageService.clearFilterValue("AnnotationHistoryListComponent",t)},o.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,o=e.multiSortMeta;return(10!==t||0!==n||(null==o?void 0:o.length)>0)&&this.paginatorStorageService.storePaginator("AnnotationHistoryListComponentPaginator",{page:n,size:t,sort:o}),this.updateGrid({page:n,size:t,sort:o})},o.prototype.onAdd=function(){this.router.navigate(["new"],{relativeTo:this.route})},o.prototype.onEdit=function(){this.router.navigate([this.selection[0].id],{relativeTo:this.route})},o.prototype.onDelete=function(){var e=this;this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_additional_info.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_additional_info.delete_confirmation_title"),accept:function(){e.showLoader=!0,r.forkJoin(e.selection.map((function(t){return e.annotationHistoryService.delete(t.id)}))).pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.showLoader=!1,e.resetGrid()}))).subscribe((function(){e.messageService.add({severity:"success",summary:e.translate.instant("hcm_contract.employment_additional_info.deleted_message_title"),detail:e.translate.instant("hcm_contract.employment_additional_info.deleted_message_content")})}),(function(e){}))}})},o.prototype.focusInput=function(e){var t=document.getElementById(""+e);t&&t.focus()},o.prototype.getLabelValue=function(e,t){var n=this;return e.map((function(e){return z(z({},e),{label:t.map((function(t){return t.indexOf(".")>0&&(e[t]=n.getProp(e,t)),"employmentRelationship.contractType"===t&&(e[t]=n.loadLabelFromEnum(e[t])),e[t]})).join(" - ")})}))},o.prototype.onAnnotationTypeLookupRequest=function(e){var t=this,n=this.getAnnotationTypeSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),o=Ee(this.annotationTypeLookupDisplayFields,this.annotationTypeAdvancedDisplayFields);this.annotationTypeService.list({filterQuery:n,displayFields:o}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.annotationTypeLookupDisplayFields)}))).subscribe((function(e){return t.annotationTypeLookupSuggestionsObservable.next(e)}))},o.prototype.onAnnotationTypeSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getAnnotationTypeSearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+eo(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+eo(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+eo(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=Ee(this.annotationTypeLookupDisplayFields,this.annotationTypeAdvancedDisplayFields);this.annotationTypeService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.annotationTypeLookupDisplayFields),totalRecords:e.totalElements}}))).subscribe((function(e){return t.annotationTypeLookupSearchObservable.next(e)}))},o.prototype.onResponsibleLookupRequest=function(e){var t=this,n=this.getResponsibleSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),o=Ee(this.responsibleLookupDisplayFields,this.responsibleAdvancedDisplayFields);this.employeeService.list({filterQuery:n,displayFields:o}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.responsibleLookupDisplayFields)}))).subscribe((function(e){return t.responsibleLookupSuggestionsObservable.next(e)}))},o.prototype.onResponsibleSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getResponsibleSearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Date?t+" eq '"+eo(o).format("YYYY-MM-DD")+"'":n===l.FieldType.Time?t+" eq '"+eo(o).format("HH:mm:ss")+"'":n===l.FieldType.DateTime?t+" eq '"+eo(o).format()+"'":n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=Ee(this.responsibleLookupDisplayFields,this.responsibleAdvancedDisplayFields);this.employeeService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.responsibleLookupDisplayFields),totalRecords:e.totalElements}}))).subscribe((function(e){return t.responsibleLookupSearchObservable.next(e)}))},o.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},o.prototype.getGridColumns=function(){var e=[{field:"startDate",header:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_start_date")},{field:"annotationType.code",header:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation_type_code")},{field:"annotationType.name",header:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation_type_name")},{field:"annotation",header:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation")}];return xe(this.translate,this.configService).concat(e)},o.prototype.getFilterFields=function(){var e=this;return[this.employeeLookupService.getFormField(),new l.FormField({name:"employer",label:this.translate.instant("hcm_contract.employment_additional_info.employer"),type:l.FieldType.Lookup,recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.employer_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),dataKey:"id",suggestionsObservable:this.companyLookupSuggestionsObservable,searchObservable:this.companyLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyLookupRequest(t)},onSearchRequest:function(t){return e.onCompanySearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanySearchFields(),searchGridFields:this.getCompanySearchGridFields()}),new l.FormField({name:"companyBranch",label:this.translate.instant("hcm_contract.employment_additional_info.employee_company_branch"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.employee_company_branch_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),dataKey:"id",suggestionsObservable:this.companyBranchLookupSuggestionsObservable,searchObservable:this.companyBranchLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyBranchLookupRequest(t)},onSearchRequest:function(t){return e.onCompanyBranchSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanyBranchSearchFields(),searchGridFields:this.getCompanyBranchSearchGridFields()}),new l.FormField({name:"contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type_placeholder"),options:this.contractTypeOptions,multiple:!1}),new l.FormField({name:"annotationType",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation_type"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_annotation_type_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),dataKey:"id",suggestionsObservable:this.annotationTypeLookupSuggestionsObservable,searchObservable:this.annotationTypeLookupSearchObservable,onLookupRequest:function(t){return e.onAnnotationTypeLookupRequest(t)},onSearchRequest:function(t){return e.onAnnotationTypeSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getAnnotationTypeSearchFields(),searchGridFields:this.getAnnotationTypeSearchGridFields()}),new l.FormField({name:"employeeSituation",label:this.translate.instant("hcm_contract.employment_additional_info.employee_situation"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_additional_info.employee_situation"),default:Z.EVERYONE,options:Ve(this.translate,this.configService),multiple:!1})]},o.prototype.setStorageFiltersIntoForm=function(e){return Q(this,void 0,void 0,(function(){var t,n;return X(this,(function(o){switch(o.label){case 0:return this.showLoader=!0,[4,this.filtersStorageService.getFilters("AnnotationHistoryListComponent")];case 1:return t=o.sent(),Object.keys(e.controls).forEach((function(n){var o=eo(t[n],eo.HTML5_FMT.DATETIME_LOCAL_MS+"Z",!0).isValid();e.get(n).setValue(o?new Date(t[n]):t[n])})),this.filtersLoaded=!0,n=this.filterFormGroup.getRawValue(),this.resetGrid({filterData:n}),[2]}}))}))},o.prototype.setStoragePaginator=function(){return Q(this,void 0,void 0,(function(){var e;return X(this,(function(t){switch(t.label){case 0:return[4,this.paginatorStorageService.getPaginator("AnnotationHistoryListComponentPaginator")];case 1:return e=t.sent(),"{}"!==JSON.stringify(e)&&(this.currentListParams=z(z({},this.currentListParams),e)),[2]}}))}))},o.prototype.getEnumQuery=function(e,t,n){return n?"("+t.map((function(t){return e+" eq '"+t+"'"})).join(" or ")+")":e+" eq '"+t+"'"},o.prototype.getAnnotationTypeSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_type_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_type_name"),type:l.FieldType.String})]},o.prototype.getAnnotationTypeSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_type_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_type_name"),type:l.FieldType.String})]},o.prototype.getEmployeeSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getEmployeeSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getResponsibleSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getResponsibleSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.annotation_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.onCompanyLookupRequest=function(e){var t=this,n=this.companyLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanySearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+eo(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+eo(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+eo(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({filterQuery:o,displayFields:i,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyLookupDisplayFields)}))).subscribe((function(e){return t.companyLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanySearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanySearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+eo(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+eo(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+eo(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_additional_info.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyLookupSearchObservable.next(e)}))},o.prototype.onCompanyBranchLookupRequest=function(e){var t=this,n=this.companyBranchLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanyBranchSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+eo(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+eo(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+eo(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=this.filterFormGroup.get("employer").value;if(i){var a="e070emp.codEmp eq "+i.codEmp;o=o?o+" and "+a:a}var r=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({filterQuery:o,displayFields:r,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields)}))).subscribe((function(e){return t.companyBranchLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanyBranchSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanyBranchSearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+eo(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+eo(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+eo(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=this.filterFormGroup.get("employer").value;if(d){var m="e070emp.codEmp eq "+d.codEmp;p=p?p+" and "+m:m}var u=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({page:r,sort:c,filterQuery:p,displayFields:u}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_additional_info.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyBranchLookupSearchObservable.next(e)}))},o.prototype.getCompanySearchFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_nom_emp"),type:l.FieldType.String})]},o.prototype.getCompanySearchGridFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_nom_emp"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_code"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_name"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchGridFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_code"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_name"),type:l.FieldType.String})]},o.prototype.updateGrid=function(e){var t=this;if(void 0===e&&(e={}),this.filtersLoaded){this.showLoader=!0,this.currentListParams=z(z({},this.currentListParams),e);var n=this.currentListParams,o=n.page,i=n.size,a=n.filterData,r=this.currentListParams.sort;this.searchTokens=this.filterFields.filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var n=e.name,o=e.label,i=e.type,r=e.searchFields,s=e.options,c=a[n],p=c;if(i===l.FieldType.Date)p=eo(c).format("L");else if(i===l.FieldType.Time)p=eo(c).format("LTS");else if(i===l.FieldType.DateTime)p=eo(c).format("L LTS");else if(i===l.FieldType.Lookup){var d="employee"===n?t.getEmployeeSearchFields():r;p=d.map((function(e){return e.name.indexOf(".")>0&&(c[e.name]=t.getProp(c,e.name)),"employmentRelationship.contractType"===e.name&&(c[e.name]=t.loadLabelFromEnum(c[e.name])),c[e.name]})).join(" - ")}else i===l.FieldType.Enum?p=s.filter((function(e){return e.value===p}))[0].label:i===l.FieldType.Boolean&&(p=c?t.translate.instant("hcm_contract.employment_additional_info.list_grid_boolean_true"):t.translate.instant("hcm_contract.employment_additional_info.list_grid_boolean_false"));return{id:n,label:o+": "+p}}));var c=this.filterFields.filter((function(e){var t=e.name;return!!a[t]})).map((function(e){var n=e.name,o=e.type,i=e.multiple,r=a[n];return"number"==typeof r?n+" eq "+r:"employeeSituation"==n?Ne(r):o===l.FieldType.Date?n+" eq '"+eo(r).format("YYYY-MM-DD")+"'":o===l.FieldType.Time?n+" eq '"+eo(r).format("HH:mm:ss")+"'":o===l.FieldType.DateTime?n+" eq '"+eo(r).format()+"'":o===l.FieldType.String?"containing(upper("+n+"), upper('"+r.replace(/'/g,"\\'")+"'))":o===l.FieldType.Enum?t.getEnumQuery(n,r,i):o===l.FieldType.Lookup?n+" eq '"+r.id+"'":n+" eq '"+r+"'"})).join(" and ");c=c.replace("employer eq","employee.employer eq").replace("companyBranch eq","employee.employeeSnapshot.companyBranch eq").replace("contractType eq","employee.employmentRelationship.contractType eq");var p=this.gridColumns.map((function(e){return e.field}));r||(r=[{field:"lastModifiedDate",order:-1}]),this.annotationHistoryService.list({page:o,size:i,sort:r,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(e){throw e.status>=500&&e.status<600&&(t.serverError=!0),e})),s.finalize((function(){t.showLoader=!1}))).subscribe((function(e){t.selection=[],t.gridData=e.contents,t.totalRecords=e.totalElements,t.serverError=!1}))}},o.prototype.resetGrid=function(e){e&&(this.currentListParams=z(z({},this.currentListParams),e)),this.currentListParams=z(z({},this.currentListParams),{page:0,sort:[]}),this.table.reset()},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)}))},o.prototype.getSortField=function(){return this.currentListParams.sort},o.prototype.getPageSize=function(){return this.currentListParams.size},o.prototype.getRowIndex=function(){return this.currentListParams.page*this.currentListParams.size},o.prototype.loadLabelFromEnum=function(e){var t=this.contractTypeOptions.filter((function(t){return t.value===e}));return t&&t.length&&t[0].label||this.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")},o.prototype.onAddCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.INCLUDE})},o.prototype.onRemoveCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.EXCLUDE})},o.ctorParameters=function(){return[{type:d.Router},{type:d.ActivatedRoute},{type:Ze},{type:i.ConfirmationService},{type:a.TranslateService},{type:i.MessageService},{type:y.HotkeysService},{type:p.FormBuilder},{type:En},{type:Cn},{type:qe},{type:$e},{type:Vn},{type:Nn},{type:G.EmployeeLookupService},{type:G.EntityLookupConfigService}]},W([t.ViewChild("annotationHistoryTable",{static:!1})],o.prototype,"table",void 0),W([t.ViewChild("customTemplate",{static:!1})],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFilterFields",{static:!1})],o.prototype,"customFilterFields",void 0),W([t.ViewChild("customGridColgroup",{static:!1})],o.prototype,"customGridColgroup",void 0),W([t.ViewChild("customGridHeader",{static:!1})],o.prototype,"customGridHeader",void 0),W([t.ViewChild("customGridBody",{static:!1})],o.prototype,"customGridBody",void 0),o=W([t.Component({template:'<div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog [acceptLabel]="\'hcm_contract.employment_additional_info.yes\' | translate" acceptIcon=""\n [rejectLabel]="\'hcm_contract.employment_additional_info.no\' | translate" rejectIcon=""></p-confirmDialog>\n <form [formGroup]="filterFormGroup" autocomplete="off">\n <p-panel styleClass="form-group" [toggleable]="true" [(collapsed)]="filtersPanelCollapsed" (onAfterToggle)="focusInput(\'employee\')">\n <p-header>\n {{"hcm_contract.employment_additional_info.filters" | translate}}\n <s-token-list [tokens]="searchTokens" (tokenRemoved)="onRemoveToken($event)" [removableTokens]="true"></s-token-list>\n </p-header>\n <div *ngIf="!customFilterFields else customFilterFields">\n <s-dynamic-form [fields]="filterFields" [form]="filterFormGroup" [errorMessages]="{pattern: \'hcm_contract.employment_additional_info.error_invalid\' | translate}"></s-dynamic-form>\n </div>\n <p-footer>\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="filter-button" class="ui-button" type="submit" pButton [label]="\'hcm_contract.employment_additional_info.filter\' | translate"\n title="{{\'hcm_contract.employment_additional_info.filter\' | translate}} (Alt + Shift + F)"\n (click)="onSearch()"></button>\n <button id="clear-button" class="ui-button ui-button-link" type="button" pButton [label]="\'hcm_contract.employment_additional_info.clear\' | translate"\n title="{{\'hcm_contract.employment_additional_info.clear\' | translate}} (Alt + Shift + L)"\n (click)="onClear()"></button>\n </div>\n </div>\n </p-footer>\n </p-panel>\n </form>\n <p-panel *sLoadingState="showLoader">\n <p-header>\n {{"hcm_contract.employment_additional_info.annotation_history_list_grid_title" | translate}}\n </p-header>\n <s-empty-state *ngIf="serverError" iconClass="fa fa-exclamation-triangle" title="{{\'hcm_contract.employment_additional_info.error_server_title\' | translate}}"\n primaryActionLabel="{{\'hcm_contract.employment_additional_info.error_server_try_again\' | translate}}"\n (primaryAction)="resetGrid()" description="{{\'hcm_contract.employment_additional_info.error_server_description\' | translate}}"></s-empty-state>\n <s-empty-state *ngIf="gridData && !gridData.length" [title]="\'hcm_contract.employment_additional_info.annotation_history_empty_state_title\' | translate"\n [showPrimaryAction]="permissions.incluir" [primaryActionLabel]="\'hcm_contract.employment_additional_info.add\' | translate"\n (primaryAction)="onAdd()" [description]="\'hcm_contract.employment_additional_info.annotation_history_empty_state_description\' | translate"\n [showSecondaryAction]="permissions.incluir"\n [secondaryActionLabel]="\'hcm_contract.employment_contract.add_collective\' | translate"\n (secondaryAction)="onAddCollective()">\n </s-empty-state>\n <div [attr.data-hidden]="!gridData?.length || serverError">\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="add-button" type="button" pButton [label]="\'hcm_contract.employment_additional_info.add\' | translate"\n title="{{\'hcm_contract.employment_additional_info.add\' | translate}} (Alt + Shift + N)"\n *ngIf="permissions.incluir" (click)="onAdd()"></button>\n <button id="view-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_additional_info.view\' | translate"\n title="{{\'hcm_contract.employment_additional_info.view\' | translate}} (Alt + Shift + V)"\n [disabled]="!selection || selection.length !== 1" (click)="onEdit()"\n *ngIf="!permissions.editar && permissions.visualizar"></button>\n <button id="edit-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_additional_info.edit\' | translate"\n title="{{\'hcm_contract.employment_additional_info.edit\' | translate}} (Alt + Shift + E)"\n [disabled]="!selection || selection.length !== 1" (click)="onEdit()"\n *ngIf="permissions.editar"></button>\n <button id="delete-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_additional_info.delete\' | translate"\n title="{{\'hcm_contract.employment_additional_info.delete\' | translate}} (Alt + Shift + X)"\n (click)="onDelete()" [disabled]="!selection || !selection.length" *ngIf="permissions.excluir"></button>\n <s-button *ngIf="permissions.incluir || permissions.excluir"\n [label]="\'hcm_contract.employment_contract.other_actions\' | translate"\n priority="secondary" [model]="collectiveActions" [disabled]="false" [auxiliary]="false"></s-button>\n </div>\n </div>\n <div class="ui-g">\n <div class="ui-g-12">\n <p-table #annotationHistoryTable [value]="gridData" [columns]="gridColumns" dataKey="id" [lazy]="true"\n [scrollable]="true" [resizableColumns]="true" sortMode="multiple" [paginator]="true"\n [totalRecords]="totalRecords" [multiSortMeta]="getSortField()" [first]="getRowIndex()"\n [rows]="getPageSize()" [rowsPerPageOptions]="[10, 20, 50, 100]" [(selection)]="selection"\n (onLazyLoad)="onGridChange($event)">\n <ng-template pTemplate="colgroup" let-columns *ngIf="!customGridColgroup else customGridColgroup">\n <colgroup>\n <col *ngFor="let col of columns" [style.width]="col.width">\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:END}--\x3e\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns *ngIf="!customGridHeader else customGridHeader">\n <tr>\n <th id="tableHeaderCheckbox" style="width: 50px">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id="columnsName" *ngFor="let col of columns" [pSortableColumn]="col.field" style="width: 200px" pResizableColumn>\n <div class="senior-header">\n <span class="senior-header-title">{{col.header}}</span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n \x3c!--{CA:GRID_HEADER_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_HEADER_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n \x3c!--{CA:GRID_HEADER:START}--\x3e\n \x3c!--{CA:GRID_HEADER:END}--\x3e\n <ng-template pTemplate="body" let-rowData let-columns *ngIf="!customGridBody else customGridBody">\n <tr [pSelectableRow]="rowData">\n <td style="width: 50px">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'employee.employer.codEmp\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'employee.employer.nomEmp\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'employee.employeeSnapshot.companyBranchCode\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'employee.employeeSnapshot.companyBranchName\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'employee.code\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'employee.person.nomPes\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <div [ngSwitch]="getProp(rowData, \'employee.employmentRelationship.contractType\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)">\n <span *ngSwitchCase="\'EMPLOYEE\'">{{ "hcm_contract.employment_additional_info.contract_type_employee" | translate }}</span>\n <span *ngSwitchCase="\'DIRECTOR\'">{{ "hcm_contract.employment_additional_info.contract_type_director" | translate }}</span>\n <span *ngSwitchCase="\'TRAINEE\'">{{ "hcm_contract.employment_additional_info.contract_type_trainee" | translate }}</span>\n <span *ngSwitchCase="\'APRENTICE\'">{{ "hcm_contract.employment_additional_info.contract_type_aprentice" | translate }}</span>\n <span *ngSwitchCase="\'THIRD_PARTY\'">{{ "hcm_contract.employment_additional_info.contract_type_third_party" | translate }}</span>\n </div>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'startDate\') | localizedDate:"L" | async}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'annotationType.code\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'annotationType.name\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'annotation\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)}}</span>\n </td>\n \x3c!--{CA:GRID_BODY_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_BODY_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span [translate]="\'hcm_contract.employment_additional_info.total_records\'" [translateParams]="{value: totalRecords}"></span>\n </ng-template>\n \x3c!--{CA:GRID_TEMPLATES:START}--\x3e\n \x3c!--{CA:GRID_TEMPLATES:END}--\x3e\n </p-table>\n </div>\n </div>\n </div>\n </p-panel>\n</div>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',selector:"fnd-annotation-history",providers:[i.ConfirmationService]})],o)}(Ln),no=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,Bn,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,l.DynamicFormModule,l.TokenListModule,E.PanelModule,D.InputTextModule,V.ButtonModule,N.CheckboxModule,k.TableModule,v.ConfirmDialogModule,_.CalendarModule,g.DropdownModule,I.TabViewModule,y.HotkeyModule,l.LoadingStateModule,l.BignumberInputModule,n.CyclicJsonInterceptorModule,n.HttpInterceptorModule,R.ToastModule,Qn,l.FileUploadModule,G.EmployeeLookupModule,G.EntityLookupModule.forRoot({domain:"hcm_contract",service:"employment_additional_info"}),G.AnnotationTypeLookupModule,G.WorkshiftLookupModule],declarations:[Zn,to],providers:[Ze,i.MessageService,$e,Vn,Nn,nn,pn],exports:[Zn,to]})],e)}(),oo=function(){function e(){}return e.isValidCpf=function(){var e=this;return function(t){var n;return e.validateCpf(t.value)||(null===(n=t.value)||void 0===n?void 0:n.length)<11?null:{cpfNotValid:!0}}},e.isValidCnpj=function(){var e=this;return function(t){return e.validateIsCnpjHasMask(t.value)||e.validateCnpj(t.value)?null:{cnpjNotValid:!0}}},e.validateIsCnpjHasMask=function(e){return!e||"__.___.___/____-__"==e},e.validateCpf=function(e){if(e){e=e.toString().replace(/[^\d]+/g,"");var t=0,n=void 0;if(["00000000000","11111111111","22222222222","33333333333","44444444444","55555555555","66666666666","77777777777","88888888888","99999999999"].includes(e)||11!=e.length)return!1;for(var o=1;o<=9;o++)t+=parseInt(e.substring(o-1,o),0)*(11-o);if(10!=(n=10*t%11)&&11!=n||(n=0),n!=parseInt(e.substring(9,10),0))return!1;t=0;for(o=1;o<=10;o++)t+=parseInt(e.substring(o-1,o),0)*(12-o);if(10!=(n=10*t%11)&&11!=n||(n=0),n!=parseInt(e.substring(10,11),0))return!1}return!0},e.validateCnpj=function(e){if(e){e=e.toString().replace(/[^\d]+/g,"");for(var t=0,n=0,o=0;o<4;o++)t+=e[o]*(5-o),n+=e[o]*(6-o);n+=2*e[4];for(o=0;o<8;o++)t+=e[o+4]*(9-o),n+=e[o+5]*(9-o);var i=[t=t%11>1?11-t%11:0,n=n%11>1?11-n%11:0];return!!(i[0]==e[12]&&i[1]==e[13])}},e}(),io=function(n){function o(o,i,a,s,l,c,p,d,u,h,y,f,_,v,g,b,S,D,T,F,E,C,k,I,R,L){var A=n.call(this,i,o,D,E,h,L)||this;return A.baseHistoryService=o,A.translate=i,A.eSocialReasonService=a,A.cdr=s,A.minutesToTimeConversionService=l,A.leaveHistoryService=c,A.leaveHistoryAttachmentService=p,A.router=d,A.route=u,A.messageService=h,A.confirmationService=y,A.formBuilder=f,A.hotkeysService=_,A.fieldCustomization=v,A.focusService=g,A.diseaseSubgroupService=b,A.diseaseService=S,A.employeeService=D,A.situationService=T,A.errorPageService=F,A.platformService=E,A.collectiveService=C,A.sanitizer=k,A.structureService=I,A.employeeLookupService=R,A.leaveHistoryBFFService=L,A.localeConfig={},A.currencyLocaleOptions={},A.permissions={},A.allPermissions={},A.mainPanelCollapsed=!1,A.isUsingTable=!1,A.sourceReasonChange=[{label:A.translate.instant("hcm_contract.employment_additional_info.source_reason_change_v_1"),value:e.SourceReasonChange.V1},{label:A.translate.instant("hcm_contract.employment_additional_info.source_reason_change_v_2"),value:e.SourceReasonChange.V2},{label:A.translate.instant("hcm_contract.employment_additional_info.source_reason_change_v_3"),value:e.SourceReasonChange.V3}],A.processType=[{label:A.translate.instant("hcm_contract.employment_additional_info.process_type_v_1"),value:e.ProcessType.V1},{label:A.translate.instant("hcm_contract.employment_additional_info.process_type_v_2"),value:e.ProcessType.V2},{label:A.translate.instant("hcm_contract.employment_additional_info.process_type_v_3"),value:e.ProcessType.V3}],A.onusRemuneration=[{label:A.translate.instant("hcm_contract.employment_additional_info.onus_remuneration_v_1"),value:e.OnusRemuneration.V1},{label:A.translate.instant("hcm_contract.employment_additional_info.onus_remuneration_v_2"),value:e.OnusRemuneration.V2},{label:A.translate.instant("hcm_contract.employment_additional_info.onus_remuneration_v_3"),value:e.OnusRemuneration.V3}],A.workAccidentType=[{label:A.translate.instant("hcm_contract.employment_additional_info.work_accident_type_v_1"),value:e.WorkAccidentType.V1},{label:A.translate.instant("hcm_contract.employment_additional_info.work_accident_type_v_2"),value:e.WorkAccidentType.V2},{label:A.translate.instant("hcm_contract.employment_additional_info.work_accident_type_v_3"),value:e.WorkAccidentType.V3}],A.subgroupCidLookupSuggestionsObservable=new r.Subject,A.subgroupCidLookupSearchObservable=new r.Subject,A.subgroupCidLookupDisplayFields=["code","name"],A.subgroupCidAdvancedDisplayFields=["code","name"],A.subgroupCidLookupSeparator=" - ",A.diseaseCidLookupSuggestionsObservable=new r.Subject,A.diseaseCidLookupSearchObservable=new r.Subject,A.diseaseCidLookupDisplayFields=["code","name"],A.diseaseCidAdvancedDisplayFields=["code","name"],A.diseaseCidLookupSeparator=" - ",A.employeeLookupSuggestionsObservable=new r.Subject,A.employeeLookupSearchObservable=new r.Subject,A.employeeLookupDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"].concat(A.employeeFieldsForValidation),A.employeeAdvancedDisplayFields=["employer.codEmp","code","person.nomPes","employmentRelationship.contractType"].concat(A.employeeFieldsForValidation),A.employeeLookupSeparator=" - ",A.situationLookupSuggestionsObservable=new r.Subject,A.situationLookupSearchObservable=new r.Subject,A.situationLabelFields=["code","name"],A.situationAdvancedDisplayFields=["code","name","situationType"],A.situationLookupSeparator=" - ",A.initialValueSituation=!1,A.customizationPermission={visualizar:!1},A.isReinstatement=!1,A.files=[],A.onUploadFile=new t.EventEmitter,A.countBeforeUploadFile=0,A.countAfterUploadFile=0,A.errorMessages={required:A.translate.instant("hcm_contract.employment_additional_info.error_required"),min:A.translate.instant("hcm_contract.employment_additional_info.error_min_value",{value:10}),max:A.translate.instant("hcm_contract.employment_additional_info.error_max_value"),minlength:A.translate.instant("hcm_contract.employment_additional_info.error_min_length"),maxlength:A.translate.instant("hcm_contract.employment_additional_info.error_max_length"),pattern:A.translate.instant("hcm_contract.employment_additional_info.error_invalid"),cnpjNotValid:A.translate.instant("hcm_contract.employment_additional_info.error_cnpj_not_valid"),dateBeforeAdmission:A.translate.instant("hcm_contract.employment_additional_info.validation_start_date_is_before_hire_date"),dateAfterDismissal:A.translate.instant("hcm_contract.employment_additional_info.validation_start_date_is_after_dismissal_date"),messageProcessNumberRequires17Or21Figures:A.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_17_or_21_figures"),messageProcessNumberRequires20Figures:A.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_20_figures"),messageProcessNumberRequires10Figures:A.translate.instant("hcm_contract.employment_additional_info.message_process_number_requires_10_figures"),justifiedDaysQuantityMustBeLowerThanEndDate:A.translate.instant("hcm_contract.employment_additional_info.message_justified_days_cant_be_greater_than_days_between_start_and_end_date"),timeMustNotBeZero:A.translate.instant("hcm_contract.employment_additional_info.message_time_must_not_be_zero"),estimatedEndDateMustBeGreaterThanOrEqualToStartDate:A.translate.instant("hcm_contract.employment_additional_info.message_date_should_be_greater_than_or_equal_to_start_date"),endDateMustBeGreaterThanOrEqualToStartDate:A.translate.instant("hcm_contract.employment_additional_info.message_date_should_be_greater_than_or_equal_to_start_date")},A.contractTypeOptions=[{label:A.translate.instant("hcm_contract.employment_additional_info.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:A.translate.instant("hcm_contract.employment_additional_info.contract_type_director"),value:e.ContractType.DIRECTOR},{label:A.translate.instant("hcm_contract.employment_additional_info.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:A.translate.instant("hcm_contract.employment_additional_info.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:A.translate.instant("hcm_contract.employment_additional_info.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}],A.situationTypeOptions=[{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_illnessaid"),value:e.SituationType.ILLNESSAID},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_laboraccident"),value:e.SituationType.LABORACCIDENT},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_militaryservice"),value:e.SituationType.MILITARYSERVICE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_maternityleave"),value:e.SituationType.MATERNITYLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_maternityleavenoncriminalabortion"),value:e.SituationType.MATERNITYLEAVENONCRIMINALABORTION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_maternityleaveanticipationextension"),value:e.SituationType.MATERNITYLEAVEANTICIPATIONEXTENSION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_citizencompanymaternity"),value:e.SituationType.CITIZENCOMPANYMATERNITY},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_inssmaternityleave"),value:e.SituationType.INSSMATERNITYLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_leavewithoutcompensation"),value:e.SituationType.LEAVEWITHOUTCOMPENSATION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_paidleave"),value:e.SituationType.PAIDLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_paternityleave"),value:e.SituationType.PATERNITYLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_citizencompanypaternity"),value:e.SituationType.CITIZENCOMPANYPATERNITY},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_medicalleave"),value:e.SituationType.MEDICALLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_medicalleavewithoutinss"),value:e.SituationType.MEDICALLEAVEWITHOUTINSS},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_absences"),value:e.SituationType.ABSENCES},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_timeevaluationsituation"),value:e.SituationType.TIMEEVALUATIONSITUATION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_tradeunionmandate"),value:e.SituationType.TRADEUNIONMANDATE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_workaccidentleave"),value:e.SituationType.WORKACCIDENTLEAVE},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_workaccidentleavewithoutinss"),value:e.SituationType.WORKACCIDENTLEAVEWITHOUTINSS},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_retirementduetodisability"),value:e.SituationType.RETIREMENTDUETODISABILITY},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_professionalqualification"),value:e.SituationType.PROFESSIONALQUALIFICATION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_vacation"),value:e.SituationType.VACATION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_collectivevacation"),value:e.SituationType.COLLECTIVEVACATION},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_priornoticehoursworkd"),value:e.SituationType.PRIORNOTICEHOURSWORKED},{label:A.translate.instant("hcm_contract.employment_additional_info.situation_type_others"),value:e.SituationType.OTHERS}],A.listFiles=[],A.configs=[],A.configsFieldSet=[],A.configObservation=[],A.configSituation=[],A.domain=m.DOMAIN,A.service=m.SERVICE,A.entity=m.SITUATION,A.historyName=m.HISTORY_NAME,A.subgroupCidSearchFields=A.getSubgroupCidSearchFields(),A.subgroupCidSearchGridFields=A.getSubgroupCidSearchGridFields(),A.diseaseCidSearchFields=A.getDiseaseCidSearchFields(),A.diseaseCidSearchGridFields=A.getDiseaseCidSearchGridFields(),A.employeeSearchFields=A.getEmployeeSearchFields(),A.employeeSearchGridFields=A.getEmployeeSearchGridFields(),A.situationSearchFields=A.getSituationSearchFields(),A.situationSearchGridFields=A.getSituationSearchGridFields(),A}var m;return Y(o,n),m=o,o.prototype.ngOnInit=function(){var e=this;this.collectiveProcessType=this.route.snapshot.fragment,this.formGroup=this.getFormGroup(),this.allocateLoadedEmployee(),this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)})),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.formFields=this.getFormFields(),this.configs=[{type:l.DynamicType.Section,configs:[{type:l.DynamicType.Row,fields:this.setGeneralFields().map((function(e){return new l.FormField(e)}))}]}],this.configSituation=[{type:l.DynamicType.Section,configs:[{type:l.DynamicType.Row,fields:[new l.FormField({type:l.FieldType.Lookup,name:"situation",dataKey:"id",multiple:!1,lookupDisplayField:"label",recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),required:function(){return!0},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.situationLookupSuggestionsObservable,searchObservable:this.situationLookupSearchObservable,onLookupRequest:function(t){return e.onSituationLookupRequest(t)},onSelect:function(t){return e.initialValueSituation=!1},onSearchRequest:function(t){return e.onSituationSearchRequest(t)},searchFields:this.situationSearchFields,searchGridFields:this.situationSearchGridFields})]}]}],this.configObservation=[{type:l.DynamicType.Section,configs:[{type:l.DynamicType.Row,fields:[new l.FormField({type:l.FieldType.TextIA,name:"observation",rows:5,required:function(){return e.isObservationRequired()},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_observation"),size:{xl:12,lg:12,md:12,sm:12,xs:12},prompt:"Ajude o colaborador que irá se afastar, a escrever uma observaçao para o afastamento de trabalho, o colaborador relatou: {{context}}. Limite a 30 palavras. a observação deve ser feita em "+this.translate.getDefaultLang()+"."})]}]}]},o.prototype.ngAfterViewInit=function(){var e=this,t=document.getElementsByTagName("input"),n=Array.from(t).find((function(e){return!e.disabled}));n&&!this.isClockingEvent&&n.focus(),this.onChangeField("employee").subscribe((function(t){e.handleReinstatementInEditMode((function(){e.applyResetFieldWhenIsNew("situation"),e.applyAllFieldBehaviorExceptReinstatement(),e.loadDataByEmployee(t)}))})),this.onChangeField("estimatedJourneyCompleted").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applySituationFieldBehaviour(),e.applyStartTimeFieldBehaviour(),e.applyAllFieldBehaviorExceptReinstatement(),e.applyEndTimeFieldBehaviour()}))})),this.onChangeField("startDate").subscribe((function(t){e.handleReinstatementInEditMode((function(){e.applyResetFieldWhenIsNew("situation"),e.applyAllFieldBehaviorExceptReinstatement(),e.applyEndTimeFieldBehaviour(),e.loadDataByStartDate(t)}))})),this.onChangeField("startTime").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEndTimeFieldBehaviour(),e.applyEndDateFieldBehaviour()}))})),this.onChangeField("situation").subscribe((function(t){e.handleReinstatementInEditMode((function(){var n=new Set(["sourceReasonChange","birthDate","diseaseCid","subgroupCid","cnpjUnion","onusRemuneration","processType","processNumber","workAccidentType","justifiedDays","resultedSicknessAssistance","optedRemunerationPermanentPosition","cnpjForElectiveMandatory","sameReasonEsocial"]);e.currentSituation&&e.currentSituation.id!==(null==t?void 0:t.id)&&(n.forEach((function(t){return e.formGroup.controls[t].setValue(null)})),e.originalLeaveHistory=null),t&&(e.currentSituation=t),e.applyAllFieldBehaviorExceptReinstatement(),e.applyEstimatedJourneyCompletedBehavior(),e.loadDataBySituation(t)}))})),this.onChangeField("sourceReasonChange").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyProcessTypeFieldBehaviour(),e.applyProcessNumberFieldBehaviour()}))})),this.onChangeField("processType").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyProcessNumberFieldBehaviour()}))})),this.onChangeField("diseaseCid").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applySubgroupCidFieldBehaviour()}))})),this.onChangeField("justifiedDays").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEstimatedEndDateFieldBehaviour()}))})),this.onChangeField("estimatedDayEnd").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEstimatedEndDateFieldBehaviour()}))})),this.onChangeField("estimatedEndDate").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEstimatedDayEndFieldBehaviour()}))})),this.onChangeField("endDate").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEndTimeFieldBehaviour(),e.applyJustifiedDaysFieldBehaviour()}))})),this.onChangeField("endTime").subscribe((function(){e.handleReinstatementInEditMode((function(){e.applyEndTimeFieldBehaviour()}))}))},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+s",(function(){return(e.isNew()||e.permissions.editar)&&e.onSave(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+c",(function(){return e.onCancel(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.applyResetFieldWhenIsNew=function(e){this.isNew()&&this.formGroup.get(e).reset()},o.prototype.setGeneralFields=function(){var e=this;return[this.employeeLookupService.getFormField(this.isCollective),new l.FormField({type:l.FieldType.Boolean,name:"estimatedJourneyCompleted",representedBy:"switch",required:function(){return e.isEstimatedJourneyCompletedRequired()},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_estimated_journey_completed"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")},size:{xl:this.isCollective?12:6}}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"startDate",required:function(){return!0},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_date"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_date_placeholder"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_date"),size:{xl:3}}),new l.FormField({type:l.FieldType.Time,calendarLocaleOptions:this.localeConfig.calendar,name:"startTime",showSeconds:!1,required:function(){return e.isTimeRequired("startDate")},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_time"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_date_time_placeholder"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_time"),size:{xl:3}}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"endDate",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_date"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_date_placeholder"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_date"),size:{xl:3}}),new l.FormField({type:l.FieldType.Time,calendarLocaleOptions:this.localeConfig.calendar,name:"endTime",showSeconds:!1,required:function(){return e.isTimeRequired("endDate")},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_time"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_date_time_placeholder"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_time"),size:{xl:3}}),new l.FormField({type:l.FieldType.Number,name:"estimatedDayEnd",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_estimated_day_end"),required:function(){return!1},precision:4,scale:0,size:{xl:3}}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"estimatedEndDate",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_estimated_end_date"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_estimated_end_date"),size:{xl:3}})]},o.prototype.setAdditionalFields=function(e){this.hasAdditionalInformation=!0;var t=new l.FormField({type:l.FieldType.Integer,name:"justifiedDays",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_justified_days"),required:function(){return!1},precision:2,scale:0,size:{xl:3}}),n=new l.FormField({type:l.FieldType.Boolean,name:"resultedSicknessAssistance",representedBy:"switch",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_resulted_sickness_assistance"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")}}),o=[];switch(e){case"INSSMATERNITYLEAVE":case"MATERNITYLEAVE":o.push.apply(o,$(this.setMaternityLeaveFields().concat(this.setCIDFields()).map((function(e){return new l.FormField(e)}))));break;case"ILLNESSAID":case"LABORACCIDENT":o.push.apply(o,$(this.setCIDFields().map((function(e){return new l.FormField(e)})).concat(t)));break;case"MEDICALLEAVE":case"WORKACCIDENTLEAVE":o.push.apply(o,$(this.setCIDFields().map((function(e){return new l.FormField(e)})).concat(n)));break;case"RETIREMENTDUETODISABILITY":o.push.apply(o,$(this.setCIDFields().map((function(e){return new l.FormField(e)}))))}this.configsFieldSet=[{header:this.translate.instant("hcm_contract.employment_additional_info.additional_information"),type:l.DynamicType.Fieldset,configs:[{type:l.DynamicType.Row,fields:this.setESocialFields(o)}]}],this.hasAdditionalInformation=!!(null==o?void 0:o.length)},o.prototype.setMaternityLeaveFields=function(){return[new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"birthDate",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_birth_date"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_date_placeholder"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_birth_date"),size:{xl:3}})]},o.prototype.setFieldsV22orV23=function(){return[new l.FormField({type:l.FieldType.String,name:"cnpjForElectiveMandatory",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_cnpj_for_elective_mandatory"),mask:function(){return"99.999.999/9999-99"},required:function(){return!1},precision:14,scale:0}),new l.FormField({type:l.FieldType.Boolean,name:"optedRemunerationPermanentPosition",representedBy:"switch",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_opted_remuneration_permanent_position"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")},size:{xl:3}})]},o.prototype.setCIDFields=function(){var e=this;return[new l.FormField({type:l.FieldType.Lookup,name:"diseaseCid",dataKey:"id",multiple:!1,lookupDisplayField:"label",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_disease_cid"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_disease_cid_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.diseaseCidLookupSuggestionsObservable,searchObservable:this.diseaseCidLookupSearchObservable,onLookupRequest:function(t){return e.onDiseaseCidLookupRequest(t)},onSearchRequest:function(t){return e.onDiseaseCidSearchRequest(t)},searchFields:this.diseaseCidSearchFields,searchGridFields:this.diseaseCidSearchGridFields,size:{xl:3,lg:4,md:6,sm:12,xs:12}}),new l.FormField({type:l.FieldType.Lookup,name:"subgroupCid",dataKey:"id",multiple:!1,lookupDisplayField:"label",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_subgroup_cid"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_subgroup_cid_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.subgroupCidLookupSuggestionsObservable,searchObservable:this.subgroupCidLookupSearchObservable,onLookupRequest:function(t){return e.onSubgroupCidLookupRequest(t)},onSearchRequest:function(t){return e.onSubgroupCidSearchRequest(t)},searchFields:this.subgroupCidSearchFields,searchGridFields:this.subgroupCidSearchGridFields,recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),size:{xl:3,lg:4,md:6,sm:12,xs:12}})]},o.prototype.isESocialHasCIDFields=function(t){return t===e.ESocialReasonType.V1||t===e.ESocialReasonType.V3||t===e.ESocialReasonType.V16||t===e.ESocialReasonType.V17||t===e.ESocialReasonType.V33||t===e.ESocialReasonType.V19||t===e.ESocialReasonType.V20||t===e.ESocialReasonType.V35},o.prototype.setESocialFields=function(e){return this.isV1OrV3()?this.setV1OrV3Field().forEach((function(t){return e.push(t)})):this.isV24()?this.setV24Fields().forEach((function(t){return e.push(t)})):this.isV22orV23()&&this.setFieldsV22orV23().forEach((function(t){return e.push(t)})),!this.isESocialHasCIDFields(this.eSocialReasonType)||(null==e?void 0:e.length)&&e.some((function(e){return"diseaseCid"===e.name}))||this.setCIDFields().forEach((function(t){return e.push(t)})),e},o.prototype.setV1OrV3Field=function(){var e=this;return[new l.FormField({type:l.FieldType.Enum,name:"sourceReasonChange",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_source_reason_change"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_source_reason_change_placeholder"),multiple:!1,required:function(){return e.isSourceReasonChangeRequired()},options:this.sourceReasonChange,size:{xl:3}}),new l.FormField({type:l.FieldType.Enum,name:"processType",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_type"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_type_placeholder"),multiple:!1,required:function(){return e.isProcessTypeRequired()},options:this.processType,size:{xl:3}}),new l.FormField({type:l.FieldType.Number,name:"processNumber",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_number"),required:function(){return e.isProcessNumberRequired()},precision:21,scale:0,size:{xl:3}}),new l.FormField({type:l.FieldType.Enum,name:"workAccidentType",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_work_accident_type"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_work_accident_type_placeholder"),multiple:!1,required:function(){return!1},showClear:function(){return!1},options:this.workAccidentType,size:{xl:3}}),new l.FormField({type:l.FieldType.Boolean,name:"sameReasonEsocial",representedBy:"switch",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_same_reason_esocial"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")},size:{xl:3}})]},o.prototype.setV24Fields=function(){var e=this;return[new l.FormField({type:l.FieldType.String,name:"cnpjUnion",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_cnpj_union"),mask:function(){return"99.999.999/9999-99"},required:function(){return e.isCnpjUnionRequired()},precision:15,scale:0}),new l.FormField({type:l.FieldType.Enum,name:"onusRemuneration",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_onus_remuneration"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_onus_remuneration_placeholder"),multiple:!1,required:function(){return e.isOnusRemunerationRequired()},options:this.onusRemuneration})]},o.prototype.isNew=function(){return"new"==this.routeParams.leaveHistory},o.prototype.onRouteParamsChange=function(e){this.routeParams=e},o.prototype.updateSuggestions=function(e){e.subgroupCid&&(e.subgroupCid.label=this.getSuggestionValue(["code","name"],"subgroupCid",e,this.subgroupCidLookupSeparator),e.subgroupCid.label.trim()===this.subgroupCidLookupSeparator.trim()&&delete e.subgroupCid.label),e.diseaseCid&&(e.diseaseCid.label=this.getSuggestionValue(["code","name"],"diseaseCid",e,this.diseaseCidLookupSeparator),e.diseaseCid.label.trim()===this.diseaseCidLookupSeparator.trim()&&delete e.diseaseCid.label),e.employee&&(this.employeeLookupService.updateSuggestions(e),this.employeeLabel=e.employee.label),e.situation&&(e.situation.label=this.getSuggestionValue(["code","name"],"situation",e,this.situationLookupSeparator),e.label.trim()===this.situationLookupSeparator.trim()&&delete e.label)},o.prototype.getSuggestionValue=function(e,t,n,o){var i=this;return e.map((function(e){var o=Ae(n,t+"."+e);return"situationType"===e?i.loadLabelFromEnumOptions(o,i.situationTypeOptions):"employmentRelationship.contractType"===e?i.loadLabelFromEnumOptions(o,i.contractTypeOptions):o})).reduce((function(e,t){return""+e+o+t}))+""},o.prototype.onRouteDataChange=function(e){var t=e.localeConfig.number,n=t.currencySymbol,o=t.thousandsSeparator,i=t.decimalSeparator;if(this.isManager="profileType"in e&&e.profileType===un.MANAGEMENT,this.localeConfig=e.localeConfig,this.currencyLocaleOptions={align:"left",prefix:n,thousands:o,decimal:i},this.permissions=e.allPermissions.leaveHistory,this.allPermissions=e.allPermissions,this.customizationPermission=e.allPermissions.customization,this.validateVisualization())if(e.entity){this.initialValueSituation=!0;var a=this.permissions.editar;a||this.formGroup.disable();var r=sn.fromDto(e.entity);r.startTime=this.minutesToTimeConversionService.minutesToDate(r.startTime),r.endTime=this.minutesToTimeConversionService.minutesToDate(r.endTime),this.currentSituation=r.situation,this.listFiles=r.leaveHistoryAttachments,this.updateSuggestions(r),this.formGroup.patchValue(r),this.originalLeaveHistory=r,this.setEnabledStatusOnCustomFields(a),this.startFuncionsByBaseHistoryInEdit(r),this.handleDateTimeFieldsOnEdit(),this.loadDataForTheFirstTime()}else this.isCollective?this.startFuncionsByBaseCollectiveHistory():this.startFuncionsByBaseHistory(this.employeeLabel),this.applyAllFieldBehaviour(),this.formGroup.patchValue(new sn)},o.prototype.onCancel=function(){this.isCollective?this.collectiveService.setCancelForm(!0):this.goBack()},o.prototype.onSendFile=function(e,t){var n=[];return this.fieldCustomization.isEmpty(e)||n.push(this.fieldCustomization.deleteFiles(e)),this.fieldCustomization.isEmpty(t)||n.push(this.fieldCustomization.commitFiles(t)),this.fieldCustomization.isEmpty(n)?r.of({}):r.forkJoin(n)},o.prototype.onSave=function(){var e=this;if(!this.formGroup.valid)return this.loading=!1,this.validateAllFormFields(this.formGroup);this.formGroup.get("leaveHistoryAttachments").setValue(this.listFiles),this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onSaveCollective()}}):this.onSaveSingle()},o.prototype.onSaveCollective=function(){var e=this;this.loading=!0;var t=this.formGroup.getRawValue();t.startTime=this.minutesToTimeConversionService.dateToMinutes(t.startTime,t.estimatedJourneyCompleted),t.endTime=t.endDate&&this.minutesToTimeConversionService.dateToMinutes(t.endTime,t.estimatedJourneyCompleted);var n=this.collectiveFormGroup.getRawValue(),o=sn.toDtoCollective(t,null==n?void 0:n.filter);this.leaveHistoryService.saveCollective(o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onSaveSingle=function(){var e=this;this.loading=!0,this.onFormLoadingSubject.next(!0);var t=this.fieldCustomization.getFiles(this.formGroup),n=t.filesToDelete,o=t.filesToCommit;this.getSaveObservable().pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,e.onFormLoadingSubject.next(!1),r.throwError(t)}))).subscribe((function(){e.onSendFile(n,o).pipe(s.takeUntil(e.ngUnsubscribe),s.catchError((function(t){return e.loading=!1,r.throwError(t)})),s.finalize((function(){return e.loading=!1}))).subscribe((function(){e.addMessage("success","hcm_contract.employment_additional_info.saved_message_title","hcm_contract.employment_additional_info.saved_message_content"),e.employeeData?e.onClose.next(!0):e.goBack()}))}))},o.prototype.onDeleteCollective=function(){var e=this,t=this.formGroup.getRawValue(),n=this.collectiveFormGroup.getRawValue();t.startTime=this.minutesToTimeConversionService.dateToMinutes(t.startTime,t.estimatedJourneyCompleted),t.endTime=t.endDate&&this.minutesToTimeConversionService.dateToMinutes(t.endTime,t.estimatedJourneyCompleted);var o=sn.toDtoCollective(t,null==n?void 0:n.filter);this.leaveHistoryService.deleteCollective(o).pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.doAfterProcessAndResetFormGroup(t)}))},o.prototype.onDelete=function(){var e=this;if(!this.formGroup.valid&&"DISABLED"!=this.formGroup.status)return this.loading=!1,this.validateAllFormFields(this.formGroup);this.isCollective?this.confirmationService.confirm({key:"customized",message:this.translate.instant("hcm_contract.employment_contract.confirm_process_message"),accept:function(){return e.onDeleteCollective()}}):this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_contract.delete_confirmation_title"),accept:function(){e.loading=!0,e.getDeleteObservable().pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.loading=!1,e.finishOperation()}))).subscribe()}})},o.prototype.doAfterProcessAndResetFormGroup=function(e){this.doAfterProcess(e),this.resetFormGroup()},o.prototype.resetFormGroup=function(){this.formGroup.reset(),this.collectiveFormGroup.reset()},o.prototype.onSituationLookupRequest=function(e){var t=this,n=this.getFilterRegisterByStartDate([Pe(e,this.situationSearchFields),this.getFilterByNotAllowedSituationTypes()].filter(Boolean).map((function(e){return"("+e+")"})).join(" and "),!1),o=this.situationAdvancedDisplayFields.map((function(e){return{field:e,order:1}}));if(this.checkIfExistsStructureToThrowMessage(n)){var i=this.situationAdvancedDisplayFields;this.situationService.list({sort:o,filterQuery:n,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.situationLabelFields)}))).subscribe((function(e){return t.situationLookupSuggestionsObservable.next(e)}))}else this.situationLookupSuggestionsObservable.next([])},o.prototype.onSituationSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.getFilterRegisterByStartDate([this.getFilterByNotAllowedSituationTypes(),this.situationSearchFields.filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){return ce(e,a[e.name])})).join(" and ")].filter(Boolean).map((function(e){return"("+e+")"})).join(" and "),!1);if(this.checkIfExistsStructureToThrowMessage(c)){var p=this.situationAdvancedDisplayFields;this.situationService.list({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.situationLabelFields),searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements}),totalRecords:e.totalElements}}))).subscribe((function(e){return t.situationLookupSearchObservable.next(e)}))}else this.situationLookupSearchObservable.next({gridData:[],totalRecords:0})},o.prototype.checkIfExistsStructureToThrowMessage=function(e){var t,n,o,i;if(!e.includes(this.entity+"Structure")){var a=null===(o=null===(n=null===(t=this.formGroup)||void 0===t?void 0:t.get("employee").value)||void 0===n?void 0:n.employer)||void 0===o?void 0:o.id,r=null===(i=this.formGroup)||void 0===i?void 0:i.get("startDate").value;if(a&&r){var s={companyIds:[a],domain:null,service:null,entity:this.entity,referenceDate:r,useDateValidation:!1,useStructure:!0};return this.structureService.showMessageToCompanyWithoutStructure(s,this.localeConfig)}}return!0},o.prototype.onSubgroupCidLookupRequest=function(e){var t=this,n=this.subgroupCidLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=Pe(e,this.subgroupCidSearchFields),i=Ee(this.subgroupCidLookupDisplayFields,this.subgroupCidAdvancedDisplayFields);this.diseaseSubgroupService.listExternalDiseaseSubgroup({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return we(e.contents,t.subgroupCidLookupDisplayFields)}))).subscribe((function(e){return t.subgroupCidLookupSuggestionsObservable.next(e)}))},o.prototype.onSubgroupCidSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.subgroupCidSearchFields.filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){return ce(e,a[e.name])})).join(" and "),p=Ee(this.subgroupCidLookupDisplayFields,this.subgroupCidAdvancedDisplayFields);this.diseaseSubgroupService.listExternalDiseaseSubgroup({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:we(e.contents,t.subgroupCidLookupDisplayFields),searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements}),totalRecords:e.totalElements}}))).subscribe((function(e){return t.subgroupCidLookupSearchObservable.next(e)}))},o.prototype.onDiseaseCidLookupRequest=function(e){var t=this,n=this.diseaseCidLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=Pe(e,this.diseaseCidSearchFields),i=Ee(this.diseaseCidLookupDisplayFields,this.diseaseCidAdvancedDisplayFields);this.diseaseService.listExternalDisease({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return we(e.contents,t.diseaseCidLookupDisplayFields)}))).subscribe((function(e){return t.diseaseCidLookupSuggestionsObservable.next(e)}))},o.prototype.onDiseaseCidSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.diseaseCidSearchFields.filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){return ce(e,a[e.name])})).join(" and "),p=Ee(this.diseaseCidLookupDisplayFields,this.diseaseCidAdvancedDisplayFields);this.diseaseService.listExternalDisease({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:we(e.contents,t.diseaseCidLookupDisplayFields),searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements}),totalRecords:e.totalElements}}))).subscribe((function(e){return t.diseaseCidLookupSearchObservable.next(e)}))},o.prototype.onEmployeeLookupRequest=function(e){var t=this,n=this.employeeLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=Pe(e,this.employeeSearchFields),i=Ee(this.employeeLookupDisplayFields,this.employeeAdvancedDisplayFields);this.employeeService.list({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.employeeLookupDisplayFields.filter((function(e){return!t.employeeFieldsForValidation.includes(e)})))}))).subscribe((function(e){return t.employeeLookupSuggestionsObservable.next(e)}))},o.prototype.onEmployeeSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.employeeSearchFields.filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){return ce(e,a[e.name])})).join(" and "),p=Ee(this.employeeLookupDisplayFields,this.employeeAdvancedDisplayFields);this.employeeService.list({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.employeeLookupDisplayFields.filter((function(e){return!t.employeeFieldsForValidation.includes(e)}))),searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements}),totalRecords:e.totalElements}}))).subscribe((function(e){return t.employeeLookupSearchObservable.next(e)}))},o.prototype.getFormGroup=function(){return this.formBuilder.group({id:[{value:void 0,disabled:!0},p.Validators.compose([])],employee:[{value:void 0,disabled:!1},p.Validators.compose(this.isCollective?[]:[p.Validators.required])],startDate:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required])],startTime:[{value:void 0,disabled:!1},p.Validators.compose([])],situation:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.required])],observation:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.maxLength(255)])],estimatedDayEnd:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.pattern(/^[1-9]\d*$/)])],estimatedEndDate:[{value:void 0,disabled:!1},p.Validators.compose([])],endDate:[{value:void 0,disabled:!1},p.Validators.compose([this.getEndDateTimeIsBeforeOrEqualToStartDateTimeValidator()])],endTime:[{value:void 0,disabled:!1},p.Validators.compose([])],estimatedJourneyCompleted:[{value:void 0,disabled:!1},p.Validators.compose([])],createdBy:[{value:void 0,disabled:!0},p.Validators.compose([])],createdDate:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedBy:[{value:void 0,disabled:!0},p.Validators.compose([])],lastModifiedDate:[{value:void 0,disabled:!0},p.Validators.compose([])],custom:[],sourceReasonChange:[{value:void 0,disabled:!1},p.Validators.compose([])],processType:[{value:void 0,disabled:!1},p.Validators.compose([])],processNumber:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.pattern(/^\-?\d*$/),p.Validators.min(1e9),this.getProcessNumberValidator()])],birthDate:[{value:void 0,disabled:!1},p.Validators.compose([])],diseaseCid:[{value:void 0,disabled:!1},p.Validators.compose([])],subgroupCid:[{value:void 0,disabled:!1},p.Validators.compose([])],cnpjUnion:[{value:void 0,disabled:!1},p.Validators.compose([])],onusRemuneration:[{value:void 0,disabled:!1},p.Validators.compose([])],workAccidentType:[{value:void 0,disabled:!1},p.Validators.compose([])],justifiedDays:[{value:void 0,disabled:!1},p.Validators.compose([p.Validators.pattern(/^\-?\d*$/)])],sameReasonEsocial:[{value:void 0,disabled:!1},p.Validators.compose([])],resultedSicknessAssistance:[{value:void 0,disabled:!1},p.Validators.compose([])],leaveHistoryAttachments:[{value:void 0,disabled:!1},p.Validators.compose([])],generatedByPayroll:[{value:!1,disabled:!0},p.Validators.compose([])],cnpjForElectiveMandatory:[{value:void 0,disabled:!1},p.Validators.compose([oo.isValidCnpj()])],optedRemunerationPermanentPosition:[{value:void 0,disabled:!1},p.Validators.compose([])]})},o.prototype.getFormFields=function(){var e=this;return[this.employeeLookupService.getFormField(this.isCollective),new l.FormField({type:l.FieldType.Boolean,name:"estimatedJourneyCompleted",representedBy:"switch",required:function(){return e.isEstimatedJourneyCompletedRequired()},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_estimated_journey_completed"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")}}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"startDate",required:function(){return!0},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_date"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_date")}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"endDate",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_date"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_date")}),new l.FormField({type:l.FieldType.Time,calendarLocaleOptions:this.localeConfig.calendar,name:"startTime",showSeconds:!1,required:function(){return e.isTimeRequired("startDate")},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_time"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_time")}),new l.FormField({type:l.FieldType.Time,calendarLocaleOptions:this.localeConfig.calendar,name:"endTime",showSeconds:!1,required:function(){return e.isTimeRequired("endDate")},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_time"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_time")}),new l.FormField({type:l.FieldType.Lookup,name:"situation",recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),dataKey:"id",multiple:!1,lookupDisplayField:"label",required:function(){return!0},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.situationLookupSuggestionsObservable,searchObservable:this.situationLookupSearchObservable,onLookupRequest:function(t){return e.onSituationLookupRequest(t)},onSearchRequest:function(t){return e.onSituationSearchRequest(t)},searchFields:this.situationSearchFields,searchGridFields:this.situationSearchGridFields}),new l.FormField({type:l.FieldType.Boolean,name:"resultedSicknessAssistance",representedBy:"switch",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_resulted_sickness_assistance"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")}}),new l.FormField({type:l.FieldType.Enum,name:"sourceReasonChange",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_source_reason_change"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_source_reason_change_placeholder"),multiple:!1,required:function(){return e.isSourceReasonChangeRequired()},options:this.sourceReasonChange}),new l.FormField({type:l.FieldType.Enum,name:"processType",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_type"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_type_placeholder"),multiple:!1,required:function(){return e.isProcessTypeRequired()},options:this.processType}),new l.FormField({type:l.FieldType.Number,name:"processNumber",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_process_number"),required:function(){return e.isProcessNumberRequired()},precision:21,scale:0}),new l.FormField({type:l.FieldType.Date,calendarLocaleOptions:this.localeConfig.calendar,name:"birthDate",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_birth_date"),tooltip:this.translate.instant("hcm_contract.employment_additional_info.leave_history_birth_date")}),new l.FormField({type:l.FieldType.Lookup,recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),name:"diseaseCid",dataKey:"id",multiple:!1,lookupDisplayField:"label",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_disease_cid"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_disease_cid_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.diseaseCidLookupSuggestionsObservable,searchObservable:this.diseaseCidLookupSearchObservable,onLookupRequest:function(t){return e.onDiseaseCidLookupRequest(t)},onSearchRequest:function(t){return e.onDiseaseCidSearchRequest(t)},searchFields:this.diseaseCidSearchFields,searchGridFields:this.diseaseCidSearchGridFields,size:{xl:3,lg:4,md:6,sm:12,xs:12}}),new l.FormField({type:l.FieldType.Lookup,name:"subgroupCid",dataKey:"id",multiple:!1,lookupDisplayField:"label",required:function(){return!1},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_subgroup_cid"),searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_subgroup_cid_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),suggestionsObservable:this.subgroupCidLookupSuggestionsObservable,searchObservable:this.subgroupCidLookupSearchObservable,onLookupRequest:function(t){return e.onSubgroupCidLookupRequest(t)},onSearchRequest:function(t){return e.onSubgroupCidSearchRequest(t)},searchFields:this.subgroupCidSearchFields,recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),searchGridFields:this.subgroupCidSearchGridFields,size:{xl:3,lg:4,md:6,sm:12,xs:12}}),new l.FormField({type:l.FieldType.String,name:"cnpjUnion",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_cnpj_union"),mask:function(){return"99.999.999/9999-99"},required:function(){return e.isCnpjUnionRequired()},precision:15,scale:0}),new l.FormField({type:l.FieldType.Enum,name:"onusRemuneration",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_onus_remuneration"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_onus_remuneration_placeholder"),multiple:!1,required:function(){return e.isOnusRemunerationRequired()},options:this.onusRemuneration}),new l.FormField({type:l.FieldType.Enum,name:"workAccidentType",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_work_accident_type"),placeholder:this.translate.instant("hcm_contract.employment_additional_info.leave_history_work_accident_type_placeholder"),multiple:!1,required:function(){return!1},options:this.workAccidentType}),new l.FormField({type:l.FieldType.Integer,name:"justifiedDays",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_justified_days"),required:function(){return!1},precision:2,scale:0}),new l.FormField({type:l.FieldType.Boolean,name:"sameReasonEsocial",representedBy:"switch",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_same_reason_esocial"),optionsLabel:{true:this.translate.instant("hcm_contract.employment_additional_info.yes"),false:this.translate.instant("hcm_contract.employment_additional_info.no"),empty:this.translate.instant("hcm_contract.employment_additional_info.nothing")}}),new l.FormField({type:l.FieldType.Text,name:"observation",required:function(){return e.isObservationRequired()},label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_observation")})]},o.prototype.ngAfterViewChecked=function(){this.cdr.detectChanges()},o.prototype.isTimeRequired=function(e){return!this.formGroup.get("estimatedJourneyCompleted").value&&!!this.formGroup.get(e).value},o.prototype.isSourceReasonChangeRequired=function(){return this.isV1ToV3OrV3ToV1()},o.prototype.isProcessTypeRequired=function(){return this.isProcessRequired()},o.prototype.isProcessNumberRequired=function(){return this.isProcessRequired()},o.prototype.isCnpjUnionRequired=function(){return this.isV24()},o.prototype.isOnusRemunerationRequired=function(){return this.isV24()},o.prototype.isSameReasonEsocialRequired=function(){return this.isV1OrV3()&&this.v1OrV3LeaveWithinSixtyDays},o.prototype.isResultedSicknessAssistanceRequired=function(){var t=new Set([e.SituationType.MEDICALLEAVE,e.SituationType.WORKACCIDENTLEAVE]),n=this.formGroup.get("situation").value;return n&&t.has(n.situationType)},o.prototype.isObservationRequired=function(){return this.isV21()},o.prototype.isProcessRequired=function(){var t=this.formGroup&&this.formGroup.get("sourceReasonChange");return this.isV1ToV3OrV3ToV1()&&t.value&&(t.value===e.SourceReasonChange.V2.toString()||t.value===e.SourceReasonChange.V3.toString())},o.prototype.isEstimatedJourneyCompletedRequired=function(){var t=this.formGroup.get("situation").value;return!t||t.situationType!==e.SituationType.PROFESSIONALQUALIFICATION},o.prototype.isReinstatementInEditMode=function(t){var n=this.formGroup.get("situation").value;return n&&n.situationType===e.SituationType.REINSTATEMENT&&t},o.prototype.loadDataForTheFirstTime=function(){var e=this;this.loading=!0,this.eSocialReasonType=null,this.v1OrV3LeaveWithinSixtyDays=!1;var t=this.formGroup.get("startDate").value,n=this.formGroup.get("situation").value&&this.formGroup.get("situation").value.id,o=this.formGroup.get("employee").value&&this.formGroup.get("employee").value.id;r.forkJoin([this.getESocialReasonTypeObservable(n,t),this.getHasV1OrV3LeaveWithinSixtyDaysObservable(o,t)]).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){e.loading=!1,e.applyAllFieldBehaviour()}))).subscribe((function(t){var n=K(t,2),o=n[0],i=n[1];e.eSocialReasonType=o,e.originalESocialReasonType=o,e.v1OrV3LeaveWithinSixtyDays=i}))},o.prototype.loadDataBySituation=function(e){var t=this;e||(this.configsFieldSet=[]),this.eSocialReasonType=null;var n=e&&e.id,o=this.formGroup.get("startDate").value;(n&&o||this.isCollective)&&(this.loading=!0,this.getESocialReasonTypeObservable(n,o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){t.loading=!1,t.onESocialReasonTypeChange(),t.setAdditionalFields(e.situationType)}))).subscribe((function(e){return t.eSocialReasonType=e}),(function(){return t.eSocialReasonType=null})))},o.prototype.getESocialReasonTypeObservable=function(e,t){return e&&t?this.eSocialReasonService.fetchESocialReasonType(e,t).pipe(s.takeUntil(this.ngUnsubscribe)):r.of(void 0)},o.prototype.loadDataByStartDate=function(e){var t=this;this.loading=!0,this.eSocialReasonType=null,this.v1OrV3LeaveWithinSixtyDays=!1;var n=this.formGroup.get("situation").value&&this.formGroup.get("situation").value.id,o=this.formGroup.get("employee").value&&this.formGroup.get("employee").value.id;r.forkJoin([this.getESocialReasonTypeObservable(n,e),this.getHasV1OrV3LeaveWithinSixtyDaysObservable(o,e)]).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){t.loading=!1,t.onESocialReasonTypeChange(),t.onV1OrV3LeaveWithinSixtyDaysChange()}))).subscribe((function(e){var n=K(e,2),o=n[0],i=n[1];t.eSocialReasonType=o,t.v1OrV3LeaveWithinSixtyDays=i}),(function(){t.eSocialReasonType=null,t.v1OrV3LeaveWithinSixtyDays=!1}))},o.prototype.loadDataByEmployee=function(e){var t=this;this.v1OrV3LeaveWithinSixtyDays=!1;var n=e&&e.id,o=this.formGroup.get("startDate").value;n&&o&&this.isV1OrV3()&&(this.loading=!0,this.getHasV1OrV3LeaveWithinSixtyDaysObservable(n,o).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){t.loading=!1,t.onV1OrV3LeaveWithinSixtyDaysChange()}))).subscribe((function(e){return t.v1OrV3LeaveWithinSixtyDays=e}),(function(){return t.v1OrV3LeaveWithinSixtyDays=!1})))},o.prototype.getHasV1OrV3LeaveWithinSixtyDaysObservable=function(e,t){if(e&&t){var n=this.formGroup.get("estimatedJourneyCompleted").value?c(t).format("YYYY-MM-DDTHH:mm:ss-00:00"):t;return this.getObservable(e,n)}return r.of(void 0)},o.prototype.getObservable=function(e,t){return this.isClockingEvent?this.leaveHistoryBffService.hasV1OrV3LeaveWithinSixtyDays(e,t).pipe(s.takeUntil(this.ngUnsubscribe)):this.leaveHistoryService.hasV1OrV3LeaveWithinSixtyDays(e,t).pipe(s.takeUntil(this.ngUnsubscribe))},o.prototype.onESocialReasonTypeChange=function(){this.applySourceReasonChangeFieldBehaviour(),this.applyProcessTypeFieldBehaviour(),this.applyProcessNumberFieldBehaviour(),this.applyDiseaseCidFieldBehaviour(),this.applySubgroupCidFieldBehaviour(),this.applyCnpjUnionFieldBehaviour(),this.applyOnusRemunerationFieldBehaviour(),this.applyWorkAccidentTypeFieldBehaviour(),this.applySameReasonEsocialFieldBehaviour(),this.applyObservationFieldBehaviour()},o.prototype.onV1OrV3LeaveWithinSixtyDaysChange=function(){this.applySameReasonEsocialFieldBehaviour()},o.prototype.isV1ToV3OrV3ToV1=function(){return this.isEditWhithValueInSourceReason()||this.originalESocialReasonType&&(this.eSocialReasonType===e.ESocialReasonType.V1&&this.originalESocialReasonType===e.ESocialReasonType.V3||this.eSocialReasonType===e.ESocialReasonType.V3&&this.originalESocialReasonType===e.ESocialReasonType.V1)},o.prototype.isEditWhithValueInSourceReason=function(){return!(this.isNew()||!this.formGroup.get("sourceReasonChange")||!this.formGroup.get("sourceReasonChange").value)},o.prototype.isV24=function(){return this.eSocialReasonType===e.ESocialReasonType.V24},o.prototype.isV1OrV3=function(){return this.eSocialReasonType===e.ESocialReasonType.V1||this.eSocialReasonType===e.ESocialReasonType.V3},o.prototype.isV21=function(){return this.eSocialReasonType===e.ESocialReasonType.V21},o.prototype.isV22orV23=function(){return this.eSocialReasonType===e.ESocialReasonType.V22||this.eSocialReasonType===e.ESocialReasonType.V23},o.prototype.getSubgroupCidSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.disease_subgroup_code"),type:l.FieldType.String}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.disease_subgroup_name"),type:l.FieldType.String})]},o.prototype.getSubgroupCidSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.disease_subgroup_code"),type:l.FieldType.String}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.disease_subgroup_name"),type:l.FieldType.String})]},o.prototype.getDiseaseCidSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.disease_code"),type:l.FieldType.String}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.disease_name"),type:l.FieldType.String})]},o.prototype.getDiseaseCidSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.disease_code"),type:l.FieldType.String}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.disease_name"),type:l.FieldType.String})]},o.prototype.getEmployeeSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getEmployeeSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getSituationSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.situation_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.situation_name"),type:l.FieldType.String})]},o.prototype.getSituationSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.situation_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.situation_name"),type:l.FieldType.String}),new l.FormField({name:"situationType",label:this.translate.instant("hcm_contract.employment_additional_info.situation_situation_type"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_additional_info.situation_situation_type_placeholder"),options:this.situationTypeOptions})]},o.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},o.prototype.getLabelValue=function(e,t){var n=this;return e.map((function(e){return z(z({},e),{label:t.map((function(t){return t.indexOf(".")>0&&(e[t]=n.getProp(e,t)),"employmentRelationship.contractType"===t&&(e[t]=n.loadLabelFromEnumOptions(e[t],n.contractTypeOptions)),"situationType"===t&&(e[t]=n.loadLabelFromEnumOptions(e[t],n.situationTypeOptions)),e[t]})).join(" - ")})}))},o.prototype.goBack=function(){this.router.navigate(["../"],{relativeTo:this.route})},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)})),this.verifyPermissionEditOnEdit()||this.focusService.focusFirstInvalidInput()},o.prototype.getSaveObservable=function(){var e=this.formGroup.getRawValue();e.employee=this.formGroup.controls[m.EMPLOYEE].value,e.startTime=this.minutesToTimeConversionService.dateToMinutes(e.startTime,e.estimatedJourneyCompleted),e.endTime=e.endDate&&this.minutesToTimeConversionService.dateToMinutes(e.endTime,e.estimatedJourneyCompleted),e.isManager=this.isManager;var t=sn.toDto(e);return this.isClockingEvent?this.createClockingEventLeaveHistoryObservable(t):this.createLeaveHistoryObservable(t)},o.prototype.createLeaveHistoryObservable=function(e){var t;if(this.isNew()||this.employeeData&&!e.id)t=this.leaveHistoryService.insert(e);else{var n=this.employeeData?e.id:this.routeParams.leaveHistory;t=this.leaveHistoryService.update(n,e)}return t},o.prototype.getDeleteObservable=function(){var e,t=this,n=(null===(e=this.routeParams)||void 0===e?void 0:e.scheduleHistoryId)?this.routeParams.scheduleHistoryId:this.routeParams.leaveHistory;return(this.isClockingEvent?this.deleteClockingEventLeaveHistory(n):this.leaveHistoryService.delete(n)).pipe(s.tap((function(){t.addMessage("success","hcm_contract.employment_additional_info.deleted_message_title","hcm_contract.employment_additional_info.deleted_message_content"),t.goBack()})))},o.prototype.validateVisualization=function(){var e=this;return!!["eSocialReason","employee","situationStructureCompanyHistory","situation"].every((function(t){return e.allPermissions[t]&&e.allPermissions[t].visualizar}))||(this.errorPageService.listEntities=[this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation"),this.translate.instant("hcm_contract.employment_additional_info.leave_history_employee"),this.translate.instant("hcm_contract.employment_additional_info.e_social_reason"),this.translate.instant("hcm_contract.employment_additional_info.situation_structure_company_history"),this.translate.instant("hcm_contract.employment_additional_info.leave_history")],this.router.navigate(["forbidden"]),!1)},o.prototype.validateAttachmentsVisualization=function(){var e,t;if((null===(e=this.allPermissions)||void 0===e?void 0:e.leaveHistoryAttachment)&&(!Object.values(null===(t=this.allPermissions)||void 0===t?void 0:t.leaveHistoryAttachment).every((function(e){return!0===e}))||this.isCollective||this.isReinstatement))return this.translate.instant("hcm_contract.employment_additional_info.leave_history_attachments"),!1;return!0},o.prototype.onChangeField=function(e){return this.formGroup.get(e).valueChanges.pipe(s.takeUntil(this.ngUnsubscribe),s.delay(0),s.distinctUntilChanged())},o.prototype.applyAllFieldBehaviour=function(){this.applyStartTimeFieldBehaviour(),this.applyAllFieldBehaviorExceptReinstatement(),this.applyEndTimeFieldBehaviour(),this.applyEstimatedJourneyCompletedBehavior(),this.applyDisableAllFieldsForEditWhenSituationTypeIsReinstatement()},o.prototype.applyDisableAllFieldsForEditWhenSituationTypeIsReinstatement=function(){var t=this,n=["employee","estimatedJourneyCompleted","startDate","endDate","startTime","endTime","situation","resultedSicknessAssistance","sourceReasonChange","processType","processNumber","birthDate","diseaseCid","subgroupCid","cnpjUnion","onusRemuneration","workAccidentType","justifiedDays","sameReasonEsocial","estimatedDayEnd","estimatedEndDate","observation"],o=this.formGroup.get("situation").value;o&&o.situationType===e.SituationType.REINSTATEMENT&&n.forEach((function(e){t.formGroup.get(e).disable(),t.formGroup.get(e).clearValidators()})),n.forEach((function(e){t.formGroup.get(e).updateValueAndValidity(),t.verifyPermissionEditOnEdit()}))},o.prototype.handleReinstatementInEditMode=function(e){if(this.isReinstatementInEditMode(!this.isNew()))return this.isReinstatement=!0,void this.applyDisableAllFieldsForEditWhenSituationTypeIsReinstatement();e()},o.prototype.applyAllFieldBehaviorExceptReinstatement=function(){this.applySituationFieldBehaviour(),this.applySourceReasonChangeFieldBehaviour(),this.applyProcessTypeFieldBehaviour(),this.applyProcessNumberFieldBehaviour(),this.applyBirthDateFieldBehaviour(),this.applyDiseaseCidFieldBehaviour(),this.applySubgroupCidFieldBehaviour(),this.applyCnpjUnionFieldBehaviour(),this.applyOnusRemunerationFieldBehaviour(),this.applyWorkAccidentTypeFieldBehaviour(),this.applyJustifiedDaysFieldBehaviour(),this.applySameReasonEsocialFieldBehaviour(),this.applyResultedSicknessAssistanceFieldBehaviour(),this.applyObservationFieldBehaviour(),this.applyEstimatedDayEndFieldBehaviour(),this.applyEstimatedEndDateFieldBehaviour(),this.applyEndDateFieldBehaviour()},o.prototype.applyEstimatedJourneyCompletedBehavior=function(){if(this.isNew()){var t=this.formGroup.get("estimatedJourneyCompleted"),n=this.formGroup.get("situation").value;n&&n.situationType===e.SituationType.PROFESSIONALQUALIFICATION?(t.setValue(!0),this.setEnabledStatus(t,!1),t.clearValidators()):this.setEnabledStatus(t,!0),t.updateValueAndValidity(),this.hasConfigDisablePermission(t)}},o.prototype.applyEndDateFieldBehaviour=function(){var e=this.formGroup.get("endDate");this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([this.getEndDateTimeIsBeforeOrEqualToStartDateTimeValidator()])),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyStartTimeFieldBehaviour=function(){var e=this.formGroup.get("startTime"),t=this.formGroup.get("estimatedJourneyCompleted").value;this.originalLeaveHistory?(this.setEnabledStatus(e,!1),e.clearValidators()):t?(this.setEnabledStatus(e,!1),e.reset(),e.clearValidators()):(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required,this.getTimeIsNotZeroValidator()]))),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applySituationFieldBehaviour=function(){var e=this.formGroup.get("situation"),t=!this.formGroup.get("employee").value&&!this.isCollective;this.formGroup.get("startDate").value&&!t?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required])),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)):this.setEnabledStatus(e,!1)},o.prototype.applySourceReasonChangeFieldBehaviour=function(){var e=this.formGroup.get("sourceReasonChange"),t=this.formGroup.get("situation").value,n=this.originalLeaveHistory&&this.originalLeaveHistory.situation,o=this.originalLeaveHistory&&this.originalLeaveHistory.sourceReasonChange;!this.isEditWhithValueInSourceReason()&&t&&n&&t.id===n.id?(this.setEnabledStatus(e,!1),e.setValue(o),e.clearValidators()):this.isSourceReasonChangeRequired()?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required]))):(this.setEnabledStatus(e,!1),e.setValue(o),e.clearValidators()),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyProcessTypeFieldBehaviour=function(){var e=this.formGroup.get("processType"),t=this.formGroup.get("situation").value,n=this.originalLeaveHistory&&this.originalLeaveHistory.situation,o=this.formGroup.get("sourceReasonChange").value,i=this.originalLeaveHistory&&this.originalLeaveHistory.sourceReasonChange,a=this.originalLeaveHistory&&this.originalLeaveHistory.processType;!this.isEditWhithValueInSourceReason()&&t&&n&&t.id===n.id?(this.setEnabledStatus(e,!1),e.setValue(a),e.clearValidators()):this.isProcessTypeRequired()?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required]))):i!==o?(this.setEnabledStatus(e,!1),e.reset(),e.clearValidators()):(this.setEnabledStatus(e,!1),e.setValue(a),e.clearValidators()),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyProcessNumberFieldBehaviour=function(){var e=this.formGroup.get("processNumber"),t=this.formGroup.get("situation").value,n=this.originalLeaveHistory&&this.originalLeaveHistory.situation,o=this.formGroup.get("sourceReasonChange").value,i=this.originalLeaveHistory&&this.originalLeaveHistory.sourceReasonChange,a=this.originalLeaveHistory&&this.originalLeaveHistory.processNumber;!this.isEditWhithValueInSourceReason()&&t&&n&&t.id===n.id?(this.setEnabledStatus(e,!1),e.setValue(a),e.clearValidators()):this.isProcessNumberRequired()?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required,this.getProcessNumberValidator()]))):i!==o?(this.setEnabledStatus(e,!1),e.reset(),e.clearValidators()):(this.setEnabledStatus(e,!1),e.setValue(a),e.clearValidators()),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyBirthDateFieldBehaviour=function(){var t=this.formGroup.get("birthDate"),n=this.formGroup.get("situation").value,o=new Set([e.SituationType.MATERNITYLEAVE,e.SituationType.INSSMATERNITYLEAVE]);n&&o.has(n.situationType)?this.setEnabledStatus(t,!0):(this.setEnabledStatus(t,!1),this.applyResetFieldWhenIsNew("birthDate")),t.updateValueAndValidity(),this.hasConfigDisablePermission(t)},o.prototype.applyDiseaseCidFieldBehaviour=function(){var e=this.formGroup.get("diseaseCid");e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applySubgroupCidFieldBehaviour=function(){var e=this.formGroup.get("subgroupCid");this.formGroup.get("diseaseCid").value?this.setEnabledStatus(e,!0):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("subgroupCid")),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyCnpjUnionFieldBehaviour=function(){var e=this.formGroup.get("cnpjUnion");this.isV24()?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required,oo.isValidCnpj()]))):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("cnpjUnion"),e.clearValidators()),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyOnusRemunerationFieldBehaviour=function(){var e=this.formGroup.get("onusRemuneration");this.isV24()?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required]))):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("onusRemuneration"),e.clearValidators()),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyWorkAccidentTypeFieldBehaviour=function(){var e=this.formGroup.get("workAccidentType");this.isV1OrV3()?this.setEnabledStatus(e,!0):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("workAccidentType")),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyJustifiedDaysFieldBehaviour=function(){var t=this.formGroup.get("justifiedDays"),n=new Set([e.SituationType.ILLNESSAID,e.SituationType.LABORACCIDENT]),o=this.formGroup.get("situation").value;o&&n.has(o.situationType)?(this.setEnabledStatus(t,!0),t.setValidators(p.Validators.compose([p.Validators.pattern(/^\-?\d*$/),this.getJustifiedDaysQuantityIsSuperiorToLeaveDaysValidator()]))):(this.setEnabledStatus(t,!1),t.reset(),t.clearValidators()),t.updateValueAndValidity(),this.hasConfigDisablePermission(t)},o.prototype.applySameReasonEsocialFieldBehaviour=function(){var e=this.formGroup.get("sameReasonEsocial");this.isSameReasonEsocialRequired()?this.setEnabledStatus(e,!0):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("sameReasonEsocial")),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyResultedSicknessAssistanceFieldBehaviour=function(){var e=this.formGroup.get("resultedSicknessAssistance");this.isResultedSicknessAssistanceRequired()?(this.setEnabledStatus(e,!0),!this.isNew()||null!==e.value&&void 0!==e.value||e.setValue(!1)):(this.setEnabledStatus(e,!1),this.applyResetFieldWhenIsNew("resultedSicknessAssistance")),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyObservationFieldBehaviour=function(){var e=this.formGroup.get("observation");this.isV21()?(this.setEnabledStatus(e,!0),e.clearValidators(),e.setValidators(p.Validators.compose([p.Validators.required,p.Validators.maxLength(255)]))):(e.clearValidators(),e.setValidators(p.Validators.compose([p.Validators.maxLength(255)]))),this.setEnabledStatus(e,!0),e.updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.applyEstimatedDayEndFieldBehaviour=function(){var t=this.formGroup.get("estimatedDayEnd"),n=this.formGroup.get("situation").value;if(n&&n.situationType===e.SituationType.ABSENCES)this.setEnabledStatus(t,!1),t.reset();else{this.setEnabledStatus(t,!0);var o=this.formGroup.get("startDate").value,i=this.formGroup.get("estimatedEndDate").value;if(o&&i){var a=c(i).diff(c(o),"days")+1;t.setValue(a)}}t.updateValueAndValidity(),this.hasConfigDisablePermission(t)},o.prototype.applyEstimatedEndDateFieldBehaviour=function(){var t=this.formGroup.get("estimatedEndDate"),n=this.formGroup.get("situation").value;if(n&&n.situationType===e.SituationType.ABSENCES)this.setEnabledStatus(t,!1),t.reset(),t.clearValidators();else{this.setEnabledStatus(t,!0),t.setValidators(p.Validators.compose([this.getEstimatedEndDateIsBeforeOrEqualToStartDateValidator()]));var o=this.formGroup.get("startDate").value,i=this.formGroup.get("estimatedDayEnd").value;if(o&&i){var a=c(o).add(i,"days").add(-1,"day").toDate();t.setValue(a)}}t.updateValueAndValidity(),this.hasConfigDisablePermission(t)},o.prototype.applyEndTimeFieldBehaviour=function(){var e=this.formGroup.get("endTime"),t=this.formGroup.get("estimatedJourneyCompleted").value,n=this.formGroup.get("endDate").value;!t&&n?(this.setEnabledStatus(e,!0),e.setValidators(p.Validators.compose([p.Validators.required,this.getTimeIsNotZeroValidator(),this.getEndDateTimeIsBeforeOrEqualToStartDateTimeValidator()]))):(this.setEnabledStatus(e,!1),e.reset(),e.clearValidators()),e.updateValueAndValidity(),this.formGroup.get("endDate").updateValueAndValidity(),this.hasConfigDisablePermission(e)},o.prototype.getEstimatedEndDateIsBeforeOrEqualToStartDateValidator=function(){var e=this;return this.formGroupDependent((function(){var t=e.formGroup.get("startDate").value,n=e.formGroup.get("estimatedEndDate").value;return t&&n&&c(t).isAfter(c(n))?{estimatedEndDateMustBeGreaterThanOrEqualToStartDate:!0}:null}))},o.prototype.hasConfigDisablePermission=function(e){this.verifyPermissionEditOnEdit()&&this.setEnabledStatus(e,!1)},o.prototype.verifyPermissionEditOnEdit=function(){return!this.permissions.editar&&!this.isNew()&&!this.isClockingEvent},o.prototype.getEndDateTimeIsBeforeOrEqualToStartDateTimeValidator=function(){var e=this;return this.formGroupDependent((function(){var t=e.formGroup.get("startDate").value,n=e.formGroup.get("endDate").value,o=e.formGroup.get("estimatedJourneyCompleted").value,i=o?c().hours(0).minutes(0):e.formGroup.get("startTime").value,a=o?c().hours(23).minutes(59):e.formGroup.get("endTime").value,r=e.getFullDateTime(t,i),s=e.getFullDateTime(n,a);return t&&i&&n&&a&&r.isAfter(s)?{endDateMustBeGreaterThanOrEqualToStartDate:!0}:null}))},o.prototype.getProcessNumberValidator=function(){var t=this;return this.formGroupDependent((function(n){var o=n.value,i=t.formGroup.get("processType").value;return i===e.ProcessType.V1&&o&&17!==o.length&&21!==o.length?{messageProcessNumberRequires17Or21Figures:!0}:i===e.ProcessType.V2&&o&&20!==o.length?{messageProcessNumberRequires20Figures:!0}:i===e.ProcessType.V3&&o&&10!==o.length?{messageProcessNumberRequires10Figures:!0}:null}))},o.prototype.getJustifiedDaysQuantityIsSuperiorToLeaveDaysValidator=function(){var e=this;return function(t){var n=t.value,o=e.formGroup.get("startDate").value,i=e.formGroup.get("endDate").value,a=o&&n&&c(o).add(n,"days").subtract(1,"days");return i&&a&&c(a).isAfter(i)?{justifiedDaysQuantityMustBeLowerThanEndDate:!0}:null}},o.prototype.getTimeIsNotZeroValidator=function(){return this.formGroupDependent((function(e){var t=e.value;return"00:00"===(t&&c(t).isValid()&&c(t).format("HH:mm"))?{timeMustNotBeZero:!0}:null}))},o.prototype.formGroupDependent=function(e){var t=this;return function(n){return t.formGroup?e(n):null}},o.prototype.getFullDateTime=function(e,t){return e?t?Me(e,t):c(e):null},o.prototype.handleDateTimeFieldsOnEdit=function(){var e=this.formGroup.get("startDate"),t=this.formGroup.get("startTime"),n=this.formGroup.get("endDate"),o=this.formGroup.get("endTime"),i=this.formGroup.get("estimatedJourneyCompleted");this.isHourAndMinuteZero(t.value)?(i.setValue(!0),e.setValue(c(e.value).toDate()),t.setValue(null),n.value&&n.setValue(c(n.value).set({hour:0,minute:0,second:0,millisecond:0}).toDate()),o.setValue(null),this.setEnabledStatus(o,!1)):i.setValue(!1),this.setEnabledStatus(e,!1),this.setEnabledStatus(t,!1),this.setEnabledStatus(i,!1)},o.prototype.isHourAndMinuteZero=function(e){return 0===c(e).hours()&&0===c(e).minutes()},o.prototype.loadLabelFromEnumOptions=function(e,t){var n=t.filter((function(t){return t.value===e}))||this.situationTypeOptions.filter((function(t){return t.value===e}));return n&&n.length&&n[0].label||this.translate.instant("hcm_contract.employment_contract.list_grid_empty_field")},o.prototype.getFilterByNotAllowedSituationTypes=function(){var t=this,n=new Set([e.SituationType.WORKING.toString(),e.SituationType.OVERTIME.toString(),e.SituationType.PRECAUTIONREADINESS.toString(),e.SituationType.REINSTATEMENT.toString()]);return Object.keys(e.SituationType).filter((function(e){return!n.has(e)})).map((function(e){return t.entity+"Type eq '"+e+"'"})).join(" or ")},o.prototype.createHistoryDTO=function(e,t){if((null==t?void 0:t._discriminator)==m.HISTORY_NAME){var n=sn.fromDto(t);return this.startFuncionsByBaseHistory(),this.applyAllFieldBehaviour(),n}return(n=new sn).startDate=e?c(e).toDate():n.startDate,n.employee=Vt.fromDto(t),this.startFuncionsByBaseHistory(),this.applyAllFieldBehaviour(),n},o.prototype.getSaveButtonPermissions=function(){if(this.isReinstatement&&!this.isNew())return!1;var t=this.isNew()||this.permissions.editar,n=this.permissions.incluir&&this.collectiveProcessType==e.CollectiveProcessType.INCLUDE;return this.isCollective?n:t},o.prototype.getDeleteButtonPermissions=function(){if(this.isReinstatement&&!this.isNew())return!1;var t=!this.isNew()&&this.permissions.excluir,n=this.permissions.excluir&&this.collectiveProcessType==e.CollectiveProcessType.EXCLUDE;return this.isCollective?n:t},o.prototype.getFormGeneralTitle=function(){return this.collectiveProcessType?this.getCollectiveFormTitle():"hcm_contract.employment_additional_info.leave_history_form_general_title"},o.prototype.getCollectiveFormTitle=function(){return this.collectiveProcessType==e.CollectiveProcessType.INCLUDE?"hcm_contract.employment_additional_info.leave_history_collective_form_general_title":"hcm_contract.employment_additional_info.leave_history_collective_delete_form_general_title"},o.prototype.isUsingTableChange=function(){return this.collectiveService.getIsUsingTable()},o.prototype.onUpload=function(e){var t=this,n=e.files;this.countBeforeUploadFile=this.countBeforeUploadFile+(null==n?void 0:n.length),n.forEach((function(e){e.savedFile||e.progress||(t.listFiles.push(e),e.isUploading=!0,t.saveFile(e).pipe(s.takeUntil(t.ngUnsubscribe),s.finalize((function(){e.isUploading=!1,t.countAfterUploadFile++}))).subscribe((function(){e.objectURL=t.sanitizer.bypassSecurityTrustUrl(URL.createObjectURL(e))})))}))},Object.defineProperty(o.prototype,"saveDisable",{get:function(){return this.countBeforeUploadFile&&this.countBeforeUploadFile!=this.countAfterUploadFile},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"configurationModeAlert",{get:function(){var e=this;return this.isReinstatement||this.isNew()?this._warn||(e._warn=[{detail:e.translate.instant("hcm_contract.employment_additional_info.cannot_delete_reinstatement"),severity:"warn"}],e._warn):[]},enumerable:!0,configurable:!0}),o.prototype.doUpload=function(e,t,n){var o=new XMLHttpRequest;return t.locationURI=e.fileUrl,t.objectURL=e.uploadUrl,t.progress=100,o.onreadystatechange=function(){4===o.readyState&&(t.complete=!0,o.status<200||o.status>=300?(t.objectURL=void 0,t.error=o.statusText||"Erro ao anexar arquivo"):t.error=!1,n.next(t),n.complete())},o.open("PUT",t.objectURL,!0),o.setRequestHeader("Translate","f"),o.send(t)},o.prototype.saveFile=function(e){var t=this;return new r.Observable((function(n){return t.leaveHistoryAttachmentService.requestUpload(e).pipe(s.takeUntil(t.ngUnsubscribe)).subscribe((function(o){return t.doUpload(o,e,n)}))}))},o.prototype.onRemoveFile=function(e){var t=e.file;this.listFiles.splice(this.listFiles.indexOf(t),1),this.countAfterUploadFile--,this.countBeforeUploadFile--},o.prototype.onCancelUpload=function(e){this.files.splice(e,1)},o.prototype.fieldIsNotNull=function(e){return!!this.formGroup.get(e).value},o.prototype.fileValidationErrors=function(t){switch(t){case e.FileValidation.MAX_FILE_LIMIT:this.messageService.add({severity:"error",detail:this.translate.instant("hcm_contract.employment_additional_info.leave_history_max_length")});break;case e.FileValidation.MAX_FILE_SIZE:this.messageService.add({severity:"error",detail:this.translate.instant("hcm_contract.employment_additional_info.leave_history_max_mb")})}},o.prototype.onDownloadFile=function(e){var t=this;this.loading=!0;var n=e.index,o=e.anchor,i=this.listFiles[n];i.documentId&&this.leaveHistoryAttachmentService.downloadForDocument(i).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return t.loading=!1}))).subscribe((function(e){i.objectURL=e.downloadUrl,o.nativeElement.setAttribute("href",e.downloadUrl),o.nativeElement.click()})),i.objectURL&&(o.nativeElement.setAttribute("href",URL.createObjectURL(i)),o.nativeElement.click()),this.loading=!1},o.prototype.clockingEventOnSave=function(){this.onSave()},o.prototype.setEnabledStatus=function(e,t){t&&!this.isReadOnly?e.enable():e.disable()},o.prototype.setEnabledStatusOnCustomFields=function(e){var t=!!this.isClockingEvent||e,n=this.formGroup.get("custom");this.setEnabledStatus(n,t)},o.HISTORY_NAME="leaveHistory",o.SITUATION="situation",o.DOMAIN="hcm_foundation",o.SERVICE="general",o.ctorParameters=function(){return[{type:tn},{type:a.TranslateService},{type:pt},{type:t.ChangeDetectorRef},{type:Dn},{type:ot},{type:ht},{type:d.Router},{type:d.ActivatedRoute},{type:i.MessageService},{type:i.ConfirmationService},{type:p.FormBuilder},{type:y.HotkeysService},{type:Sn},{type:_n},{type:lt},{type:rt},{type:qe},{type:mt},{type:bn},{type:pn},{type:nn},{type:x.DomSanitizer},{type:G.StructureFilterService},{type:G.EmployeeLookupService},{type:it}]},W([t.ViewChild("customTemplate",{static:!1})],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFormFields",{static:!1})],o.prototype,"customFormFields",void 0),o=m=W([t.Component({template:'<div *ngFor="let process of processed">\n <p-messages [value]="process" key="info" [escape]="false"></p-messages>\n</div><div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog acceptLabel="{{\'hcm_contract.employment_additional_info.yes\' | translate}}" acceptIcon="" appendTo="body"\n rejectLabel="{{\'hcm_contract.employment_additional_info.no\' | translate}}" rejectIcon="">\n </p-confirmDialog>\n <form [formGroup]="formGroup" novalidate>\n <lib-collective-history-filters *ngIf="isCollective"\n [parentFormGroup]="collectiveFormGroup" (onEmployeeSelected)="onSelectBasicFilterByEmployee($event)" (onCompanySelected)="onSelectBasicFilterByCompany($event)" ></lib-collective-history-filters>\n <p-panel *sLoadingState="loading" [styleClass]="employeeData ? \'form-group sidebar-panel\' : \'form-group\'" [toggleable]="false" [collapsed]="mainPanelCollapsed"\n [showHeader]="!employeeData" [hidden]="!isUsingTableChange() && isCollective">\n <div class="ui-sm-12 ui-md-12 ui-lg-12 ui-xl-12" *ngIf="isReinstatement && !isNew()">\n <p-messages [enableService]="false" [value]="configurationModeAlert" [closable]="false"></p-messages>\n </div>\n <p-header>\n {{getFormGeneralTitle() | translate}}\n </p-header>\n <form [formGroup]="formGroup">\n <s-dynamic-form [configs]="configs" [id]="\'dynamic\'" [form]="formGroup" [errorMessages]="errorMessages">\n </s-dynamic-form>\n </form>\n\n <p-tabView styleClass="form-group">\n <p-tabPanel\n [header]="\'hcm_contract.employment_additional_info.leave_history_basic_data_tab_name\' | translate">\n <div class="basic-data-container">\n <s-dynamic-form [configs]="configSituation" [id]="\'dynamic\'"\n [form]="formGroup" [errorMessages]="errorMessages">\n </s-dynamic-form>\n <s-dynamic-form *ngIf="hasAdditionalInformation" [configs]="configsFieldSet" [id]="\'dynamic\'"\n [form]="formGroup" [errorMessages]="errorMessages">\n </s-dynamic-form>\n <s-dynamic-form [configs]="configObservation" [id]="\'dynamic\'"\n [form]="formGroup" [errorMessages]="errorMessages">\n </s-dynamic-form>\n </div>\n </p-tabPanel>\n\n <p-tabPanel [header]="\'hcm_contract.employment_additional_info.leave_history_document_tab_name\' | translate" *ngIf="validateAttachmentsVisualization()">\n <s-file-upload [formGroup]="formGroup.get(\'leaveHistoryAttachments\')"\n accept="*/*"\n [files]="listFiles"\n [multiple]="true"\n [fileLimit]="10"\n [chooseLabel]="\'hcm_contract.employment_additional_info.file_upload_choose_label\' | translate"\n [removeLabel]="\'hcm_contract.employment_additional_info.file_upload_remove_label\' | translate"\n [cancelLabel]="\'hcm_contract.employment_additional_info.cancel\' | translate"\n [maxFileSize]="10000000"\n (validateErrors)="fileValidationErrors($event?.validation)"\n (uploadHandler)="onUpload($event)"\n (removeFile)="onRemoveFile($event)"\n (cancelUpload)="onCancelUpload($event)"\n (downloadFile)="onDownloadFile($event)">\n </s-file-upload>\n </p-tabPanel>\n </p-tabView>\n\n <s-custom-fields *ngIf="customizationPermission.visualizar && !isCollective" domain="hcm_contract" service="employment_additional_info" entity="leaveHistory"\n formControlName="custom"\n [invalidErrorLabel]="\'hcm_contract.employment_additional_info.error_invalid\' | translate">\n </s-custom-fields>\n\n <div class="ui-g" *ngIf="!isNew() && !isCollective">\n <div class="ui-g-12 ui-inputgroup">\n <span *ngIf="fieldIsNotNull(\'createdBy\')" class="label-style">\n {{\'hcm_contract.employment_additional_info.created_by\' | translate}}\n {{formGroup.get(\'createdBy\').value}}\n {{\'hcm_contract.employment_additional_info.at_date\' | translate}}\n {{formGroup.get(\'createdDate\').value | date: \'dd/MM/yyyy\'}}\n {{\'hcm_contract.employment_additional_info.at_time\' | translate}}\n {{formGroup.get(\'createdDate\').value | date: \'HH:mm\'}}.\n </span>\n <span *ngIf="fieldIsNotNull(\'lastModifiedBy\')" class="label-style-updated">\n {{\'hcm_contract.employment_additional_info.updated_by\' | translate}}\n {{formGroup.get(\'lastModifiedBy\').value}}\n {{\'hcm_contract.employment_additional_info.at_date\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | date: \'dd/MM/yyyy\'}}\n {{\'hcm_contract.employment_additional_info.at_time\' | translate}}\n {{formGroup.get(\'lastModifiedDate\').value | date: \'HH:mm\'}}.\n </span>\n </div>\n </div>\n <p-footer *ngIf="!employeeData">\n <button id="save-button"\n title="{{\'hcm_contract.employment_additional_info.save\' | translate}} (Alt + Shift + S)"\n type="submit" pButton label="{{\'hcm_contract.employment_additional_info.save\' | translate}}"\n [disabled]="saveDisable"\n (click)="onSave()" *ngIf="getSaveButtonPermissions()"></button>\n <button id="delete-button"\n title="{{\'hcm_contract.employment_additional_info.delete\' | translate}} (Alt + Shift + X)"\n type="button" class="ui-button-secondary" pButton\n label="{{\'hcm_contract.employment_additional_info.delete\' | translate}}" (click)="onDelete()"\n *ngIf="getDeleteButtonPermissions()" [disabled]="loading"></button>\n <button id="cancel-button"\n title="{{\'hcm_contract.employment_additional_info.cancel\' | translate}} (Alt + Shift + C)"\n type="button" class="ui-button-link" pButton\n label="{{\'hcm_contract.employment_additional_info.cancel\' | translate}}"\n (click)="onCancel()"></button>\n </p-footer>\n </p-panel>\n </form>\n</div>\n<p-confirmDialog key="customized" #customized\n header="{{ \'hcm_contract.employment_contract.generic_confirm\' | translate }}">\n <p-footer>\n <s-button label="{{ \'hcm_contract.employment_contract.yes\' | translate }}"\n (onClick)="customized.accept()" priority="primary" [disabled]="false" [auxiliary]="false">\n </s-button>\n <s-button label="{{ \'hcm_contract.employment_contract.no\' | translate }}"\n (onClick)="customized.reject()" priority="secondary" [disabled]="false" [auxiliary]="false">\n </s-button>\n </p-footer>\n</p-confirmDialog>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',providers:[i.ConfirmationService],selector:"fnd-leave-history-form",styles:[":host ::ng-deep .sidebar-panel{border:none!important;padding-left:0!important}.label-style{color:#a3a3a3;margin-right:2px}.basic-data-container{display:flex;flex-direction:column;gap:10px}.label-style-updated{color:#a3a3a3}"]})],o)}(Pn),ao=c,ro=function(n){function o(t,o,i,a,s,l,c,p,d,m,u,h,y,f,_,v,g){var b=n.call(this,l,c,v,p)||this;return b.router=t,b.route=o,b.leaveHistoryService=i,b.confirmationService=a,b.situationService=s,b.translate=l,b.baseService=c,b.messageService=p,b.hotkeysService=d,b.formBuilder=m,b.filtersStorageService=u,b.paginatorStorageService=h,b.companyService=y,b.companyBranchService=f,b.employeeLookupService=_,b.platformService=v,b.configService=g,b.allPermissions={},b.permissions={},b.localeConfig={},b.currentListParams={page:0,size:10,sort:[],filterData:{}},b.filtersPanelCollapsed=!0,b.searchTokens=[],b.serverError=!1,b.filtersLoaded=!1,b.subgroupCidLookupDisplayFields=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"],b.subgroupCidAdvancedDisplayFields=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"],b.diseaseCidLookupDisplayFields=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"],b.diseaseCidAdvancedDisplayFields=["id","code","name","deleted","extIntSts","extIntMsg","createdBy","createdDate","lastModifiedBy","lastModifiedDate"],b.situationLookupDisplayFields=["code","name"],b.situationAdvancedDisplayFields=["code","name"],b.companyLookupDisplayFields=["codEmp","nomEmp"],b.companyAdvancedDisplayFields=["codEmp","nomEmp"],b.companyBranchLookupDisplayFields=["codFil","nomFil"],b.companyBranchAdvancedDisplayFields=["codFil","nomFil"],b.contractTypeOptions=[{label:b.translate.instant("hcm_contract.employment_additional_info.contract_type_employee"),value:e.ContractType.EMPLOYEE},{label:b.translate.instant("hcm_contract.employment_additional_info.contract_type_director"),value:e.ContractType.DIRECTOR},{label:b.translate.instant("hcm_contract.employment_additional_info.contract_type_trainee"),value:e.ContractType.TRAINEE},{label:b.translate.instant("hcm_contract.employment_additional_info.contract_type_aprentice"),value:e.ContractType.APRENTICE},{label:b.translate.instant("hcm_contract.employment_additional_info.contract_type_third_party"),value:e.ContractType.THIRD_PARTY}],b.situationLookupSuggestionsObservable=new r.Subject,b.situationLookupSearchObservable=new r.Subject,b.companyLookupSuggestionsObservable=new r.Subject,b.companyLookupSearchObservable=new r.Subject,b.companyBranchLookupSuggestionsObservable=new r.Subject,b.companyBranchLookupSearchObservable=new r.Subject,b.standardListSize=10,b.collectiveActions=[],b}return Y(o,n),o.prototype.ngOnInit=function(){var e=this;this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.filterFormGroup=this.formBuilder.group({employer:[void 0,p.Validators.compose([])],companyBranch:[void 0,p.Validators.compose([])],contractType:[void 0,p.Validators.compose([])],employee:[void 0,p.Validators.compose([])],situation:[void 0,p.Validators.compose([])],employeeSituation:[void 0,p.Validators.compose([])]}),this.setStoragePaginator(),this.setStorageFiltersIntoForm(this.filterFormGroup),this.gridColumns=this.getGridColumns(),this.filterFields=this.getFilterFields(),this.filterFormGroup.get("employer").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(){e.filterFormGroup.get("companyBranch").setValue(null)})),this.setHotkeys(),this.permissions.incluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.add_collective"),command:function(){return e.onAddCollective()}}),this.permissions.excluir&&this.collectiveActions.push({label:this.translate.instant("hcm_contract.employment_contract.remove_collective"),command:function(){return e.onRemoveCollective()}})},o.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},o.prototype.setHotkeys=function(){var e=this;this.hotkeysService.add(new y.Hotkey("alt+shift+e",(function(){return e.selection&&1===e.selection.length&&e.onEdit(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+x",(function(){return e.selection&&e.selection.length&&e.permissions.excluir&&e.onDelete(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+n",(function(){return e.permissions.incluir&&e.onAdd(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+f",(function(){return e.onSearch(),!1}),["INPUT","SELECT","TEXTAREA"])),this.hotkeysService.add(new y.Hotkey("alt+shift+l",(function(){return e.onClear(),!1}),["INPUT","SELECT","TEXTAREA"]))},o.prototype.onRouteDataChange=function(e){this.allPermissions=e.allPermissions,this.permissions=e.allPermissions.leaveHistory,this.localeConfig=e.localeConfig},o.prototype.hasEmpty=function(e){if(Object.keys(e).filter((function(t){return""===e[t]})).length>0)return!0},o.prototype.onSearch=function(){var e=this.filterFormGroup.getRawValue();if(this.hasEmpty(e))return this.filtersPanelCollapsed=!0,this.validateAllFormFields(this.filterFormGroup);this.currentListParams.page=0,this.filtersPanelCollapsed=!0,this.resetGrid({filterData:e}),this.filtersStorageService.storeFilters("LeaveHistoryListComponent",e)},o.prototype.onClear=function(){this.filterFormGroup.reset();var e=this.filterFormGroup.getRawValue();this.resetGrid({filterData:e}),this.filtersStorageService.removeFilter("LeaveHistoryListComponent")},o.prototype.onRemoveToken=function(e){this.filterFormGroup.get(e.id).setValue(void 0);var t=this.filterFormGroup.getRawValue();this.resetGrid({filterData:t}),this.filtersStorageService.clearFilterValue("LeaveHistoryListComponent",t)},o.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,o=e.multiSortMeta;return(t!==this.standardListSize||0!==n||o&&o.length>0)&&this.paginatorStorageService.storePaginator("LeaveHistoryListComponentPaginator",{page:n,size:t,sort:o}),this.updateGrid({page:n,size:t,sort:o})},o.prototype.onAdd=function(){this.router.navigate(["new"],{relativeTo:this.route})},o.prototype.onEdit=function(){this.router.navigate([this.selection[0].id],{relativeTo:this.route})},o.prototype.onDelete=function(){var e=this;this.hasReinstatementInSelection()?this.showReinstatementWarning():this.confirmationService.confirm({message:this.translate.instant("hcm_contract.employment_additional_info.delete_confirmation_message"),header:this.translate.instant("hcm_contract.employment_additional_info.delete_confirmation_title"),accept:function(){e.showLoader=!0,r.forkJoin(e.selection.map((function(t){return e.leaveHistoryService.delete(t.id)}))).pipe(s.takeUntil(e.ngUnsubscribe),s.finalize((function(){e.showLoader=!1,e.resetGrid()}))).subscribe((function(){e.messageService.add({severity:"success",summary:e.translate.instant("hcm_contract.employment_additional_info.deleted_message_title"),detail:e.translate.instant("hcm_contract.employment_additional_info.deleted_message_content")})}),(function(e){}))}})},o.prototype.focusInput=function(e){var t=document.getElementById(""+e);t&&t.focus()},o.prototype.getLabelValue=function(e,t){var n=this;return e.map((function(e){return z(z({},e),{label:t.map((function(t){return t.indexOf(".")>0&&(e[t]=n.getProp(e,t)),"employmentRelationship.contractType"===t&&(e[t]=n.loadLabelFromEnum(e[t])),e[t]})).join(" - ")})}))},o.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},o.prototype.getGridColumns=function(){var e=[{field:"startDate",header:this.translate.instant("hcm_contract.employment_additional_info.leave_history_start_date")},{field:"situation.code",header:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation_code")},{field:"situation.name",header:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation_name")},{field:"endDate",header:this.translate.instant("hcm_contract.employment_additional_info.leave_history_end_date")}];return xe(this.translate,this.configService).concat(e)},o.prototype.getFilterFields=function(){var e=this;return[new l.FormField({name:"employer",label:this.translate.instant("hcm_contract.employment_additional_info.employer"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.employer_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),dataKey:"id",suggestionsObservable:this.companyLookupSuggestionsObservable,searchObservable:this.companyLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyLookupRequest(t)},onSearchRequest:function(t){return e.onCompanySearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanySearchFields(),searchGridFields:this.getCompanySearchGridFields()}),this.employeeLookupService.getFormField(),new l.FormField({name:"companyBranch",label:this.translate.instant("hcm_contract.employment_additional_info.employee_company_branch"),type:l.FieldType.Lookup,multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.employee_company_branch_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),dataKey:"id",recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),suggestionsObservable:this.companyBranchLookupSuggestionsObservable,searchObservable:this.companyBranchLookupSearchObservable,onLookupRequest:function(t){return e.onCompanyBranchLookupRequest(t)},onSearchRequest:function(t){return e.onCompanyBranchSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getCompanyBranchSearchFields(),searchGridFields:this.getCompanyBranchSearchGridFields()}),new l.FormField({name:"contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type_placeholder"),options:this.contractTypeOptions,showClear:function(){return!1},multiple:!1}),new l.FormField({name:"situation",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation"),type:l.FieldType.Lookup,recordLabel:Ie(this.translate),recordsLabel:Ie(this.translate),multiple:!1,searchTitle:this.translate.instant("hcm_contract.employment_additional_info.leave_history_situation_search_title"),searchEmptyTitle:this.translate.instant("hcm_contract.employment_additional_info.nothing_found"),filterLabel:this.translate.instant("hcm_contract.employment_additional_info.filter"),filterTitle:this.translate.instant("hcm_contract.employment_additional_info.filters"),clearLabel:this.translate.instant("hcm_contract.employment_additional_info.clear"),cancelLabel:this.translate.instant("hcm_contract.employment_additional_info.cancel"),selectLabel:this.translate.instant("hcm_contract.employment_additional_info.select"),dataKey:"id",suggestionsObservable:this.situationLookupSuggestionsObservable,searchObservable:this.situationLookupSearchObservable,onLookupRequest:function(t){return e.onSituationLookupRequest(t)},onSearchRequest:function(t){return e.onSituationSearchRequest(t)},lookupDisplayField:"label",searchFields:this.getSituationSearchFields(),searchGridFields:this.getSituationSearchGridFields()}),new l.FormField({name:"employeeSituation",label:this.translate.instant("hcm_contract.employment_additional_info.employee_situation"),type:l.FieldType.Enum,placeholder:this.translate.instant("hcm_contract.employment_additional_info.employee_situation"),default:Z.EVERYONE,options:Ve(this.translate,this.configService),multiple:!1})]},o.prototype.setStorageFiltersIntoForm=function(e){return Q(this,void 0,void 0,(function(){var t,n;return X(this,(function(o){switch(o.label){case 0:return this.showLoader=!0,[4,this.filtersStorageService.getFilters("LeaveHistoryListComponent")];case 1:return t=o.sent(),Object.keys(e.controls).forEach((function(n){var o=ao(t[n],ao.HTML5_FMT.DATETIME_LOCAL_MS+"Z",!0).isValid();e.get(n).setValue(o?new Date(t[n]):t[n])})),this.filtersLoaded=!0,n=this.filterFormGroup.getRawValue(),this.resetGrid({filterData:n}),[2]}}))}))},o.prototype.setStoragePaginator=function(){return Q(this,void 0,void 0,(function(){var e;return X(this,(function(t){switch(t.label){case 0:return[4,this.paginatorStorageService.getPaginator("LeaveHistoryListComponentPaginator")];case 1:return e=t.sent(),"{}"!=JSON.stringify(e)&&(this.currentListParams=z(z({},this.currentListParams),e)),[2]}}))}))},o.prototype.onCompanyLookupRequest=function(e){var t=this,n=this.companyLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanySearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+ao(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+ao(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+ao(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({filterQuery:o,displayFields:i,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyLookupDisplayFields)}))).subscribe((function(e){return t.companyLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanySearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanySearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+ao(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+ao(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+ao(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=Ee(this.companyLookupDisplayFields,this.companyAdvancedDisplayFields);this.companyService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyLookupSearchObservable.next(e)}))},o.prototype.onCompanyBranchLookupRequest=function(e){var t=this,n=this.companyBranchLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getCompanyBranchSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){var n=t.name,o=t.type;return"number"==typeof e?n+" eq "+e:o==l.FieldType.Date?n+" eq '"+ao(e).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+ao(e).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+ao(e).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+e.replace(/'/g,"\\'")+"'))":n+" eq '"+e+"'"})).filter((function(e){return!!e})).join(" or "),i=this.filterFormGroup.get("employer").value;if(i){var a="e070emp.codEmp eq "+i.codEmp;o=o?o+" and "+a:a}var r=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({filterQuery:o,displayFields:r,sort:n}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields)}))).subscribe((function(e){return t.companyBranchLookupSuggestionsObservable.next(e)}))},o.prototype.onCompanyBranchSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getCompanyBranchSearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+ao(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+ao(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+ao(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=this.filterFormGroup.get("employer").value;if(d){var m="e070emp.codEmp eq "+d.codEmp;p=p?p+" and "+m:m}var u=Ee(this.companyBranchLookupDisplayFields,this.companyBranchAdvancedDisplayFields);this.companyBranchService.list({page:r,sort:c,filterQuery:p,displayFields:u}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.companyBranchLookupDisplayFields),totalRecords:e.totalElements,searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements})}}))).subscribe((function(e){return t.companyBranchLookupSearchObservable.next(e)}))},o.prototype.getEmployeeSearchFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,options:this.contractTypeOptions})]},o.prototype.getEmployeeSearchGridFields=function(){return[new l.FormField({name:"employer.codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.leave_history_employer_code"),type:l.FieldType.Integer}),new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.employee_code"),type:l.FieldType.Integer}),new l.FormField({name:"person.nomPes",label:this.translate.instant("hcm_contract.employment_additional_info.employee_person_nom_pes"),type:l.FieldType.String}),new l.FormField({name:"employmentRelationship.contractType",label:this.translate.instant("hcm_contract.employment_additional_info.employee_employment_relationship_contract_type"),type:l.FieldType.Enum,showClear:function(){return!1},options:this.contractTypeOptions})]},o.prototype.onSituationLookupRequest=function(e){var t=this,n=Pe(e,this.getSituationSearchFields()),o=Ee(this.situationLookupDisplayFields,this.situationAdvancedDisplayFields);this.situationService.list({filterQuery:n,displayFields:o}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return t.getLabelValue(e.contents,t.situationLookupDisplayFields)}))).subscribe((function(e){return t.situationLookupSuggestionsObservable.next(e)}))},o.prototype.onSituationSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getSituationSearchFields().filter((function(e){var t=e.name;return null!=a[t]&&""!=a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n==l.FieldType.Date?t+" eq '"+ao(o).format("YYYY-MM-DD")+"'":n==l.FieldType.Time?t+" eq '"+ao(o).format("HH:mm:ss")+"'":n==l.FieldType.DateTime?t+" eq '"+ao(o).format()+"'":n==l.FieldType.Enum?t+" eq '"+o+"'":n==l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).filter((function(e){return!!e})).join(" and "),d=Ee(this.situationLookupDisplayFields,this.situationAdvancedDisplayFields);this.situationService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return{gridData:t.getLabelValue(e.contents,t.situationLookupDisplayFields),searchTotalRecordsLabel:t.translate.instant("hcm_contract.employment_contract.total_records",{value:e.totalElements}),totalRecords:e.totalElements}}))).subscribe((function(e){return t.situationLookupSearchObservable.next(e)}))},o.prototype.getSituationSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.situation_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.situation_name"),type:l.FieldType.String})]},o.prototype.getSituationSearchGridFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_additional_info.situation_code"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_additional_info.situation_name"),type:l.FieldType.String})]},o.prototype.getCompanySearchFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_cod_emp"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_nom_emp"),type:l.FieldType.String})]},o.prototype.getCompanySearchGridFields=function(){return[new l.FormField({name:"codEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_code"),type:l.FieldType.Integer}),new l.FormField({name:"nomEmp",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_name"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_code"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_name"),type:l.FieldType.String})]},o.prototype.getCompanyBranchSearchGridFields=function(){return[new l.FormField({name:"codFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_code"),type:l.FieldType.Integer}),new l.FormField({name:"nomFil",label:this.translate.instant("hcm_contract.employment_additional_info.company_branch_name"),type:l.FieldType.String})]},o.prototype.updateGrid=function(e){var t=this;if(void 0===e&&(e={}),this.filtersLoaded){this.showLoader=!0,this.currentListParams=z(z({},this.currentListParams),e);var n=this.currentListParams,o=n.page,i=n.size,a=n.filterData,r=this.currentListParams.sort;this.searchTokens=this.filterFields.filter((function(e){var t=e.name;return null!=a[t]&&""!==a[t]})).map((function(e){var n=e.name,o=e.label,i=e.type,r=e.searchFields,s=e.options,c=a[n],p=c;if(i==l.FieldType.Date)p=ao(c).format("L");else if(i==l.FieldType.Time)p=ao(c).format("LTS");else if(i==l.FieldType.DateTime)p=ao(c).format("L LTS");else if(i==l.FieldType.Lookup){var d="employee"===n?t.getEmployeeSearchFields():r;p=d.map((function(e){return e.name.indexOf(".")>0&&(c[e.name]=t.getProp(c,e.name)),"employmentRelationship.contractType"===e.name&&(c[e.name]=t.loadLabelFromEnum(c[e.name])),c[e.name]})).join(" - ")}else i==l.FieldType.Enum?p=s.filter((function(e){return e.value===p}))[0].label:i==l.FieldType.Boolean&&(p=c?t.translate.instant("hcm_contract.employment_additional_info.list_grid_boolean_true"):t.translate.instant("hcm_contract.employment_additional_info.list_grid_boolean_false"));return{id:n,label:o+": "+p}}));var c=this.filterFields.filter((function(e){var t=e.name;return null!=a[t]})).map((function(e){return ce(e,a[e.name])})).join(" and ");c=c.replace("employer eq","employee.employer eq").replace("companyBranch eq","employee.employeeSnapshot.companyBranch eq").replace("contractType eq","employee.employmentRelationship.contractType eq");var p=$(this.gridColumns.map((function(e){return e.field})),["employee.person.nomPes","situation.name","situation.situationType"]);r||(r=[{field:"lastModifiedDate",order:-1}]),this.leaveHistoryService.list({page:o,size:i,sort:r,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(e){throw e.status>=500&&e.status<600&&(t.serverError=!0),e})),s.finalize((function(){t.showLoader=!1}))).subscribe((function(e){t.selection=[],t.gridData=e.contents,t.totalRecords=e.totalElements,t.serverError=!1}))}},o.prototype.resetGrid=function(e){e&&(this.currentListParams=z(z({},this.currentListParams),e)),this.currentListParams=z(z({},this.currentListParams),{page:0,sort:[]}),this.table&&this.table.reset&&this.table.reset()},o.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)}))},o.prototype.getPageSize=function(){return this.currentListParams.size},o.prototype.getRowIndex=function(){return this.currentListParams.page*this.currentListParams.size},o.prototype.getSortField=function(){return this.currentListParams.sort&&this.currentListParams.sort.length?this.currentListParams.sort[0].field:this.gridColumns[0].field},o.prototype.getSortOrder=function(){return this.currentListParams.sort&&this.currentListParams.sort.length?this.currentListParams.sort[0].order:1},o.prototype.getTitleButton=function(){return this.permissions.editar?this.translate.instant("hcm_contract.employment_additional_info.edit"):this.translate.instant("hcm_contract.employment_additional_info.visualize")},o.prototype.loadLabelFromEnum=function(e){var t=this.contractTypeOptions.filter((function(t){return t.value===e}));return t&&t.length&&t[0].label||this.translate.instant("hcm_contract.employment_additional_info.list_grid_empty_field")},o.prototype.hasReinstatementInSelection=function(){return this.selection.some((function(t){var n;return(null===(n=t.situation)||void 0===n?void 0:n.situationType)===e.SituationType.REINSTATEMENT}))},o.prototype.showReinstatementWarning=function(){this.messageService.add({severity:"warn",summary:this.translate.instant("hcm_contract.employment_additional_info.warning"),detail:this.translate.instant("hcm_contract.employment_additional_info.cannot_delete_reinstatement")})},o.prototype.onAddCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.INCLUDE})},o.prototype.onRemoveCollective=function(){this.router.navigate(["new-collective"],{relativeTo:this.route,fragment:e.CollectiveProcessType.EXCLUDE})},o.ctorParameters=function(){return[{type:d.Router},{type:d.ActivatedRoute},{type:ot},{type:i.ConfirmationService},{type:mt},{type:a.TranslateService},{type:tn},{type:i.MessageService},{type:y.HotkeysService},{type:p.FormBuilder},{type:En},{type:Cn},{type:Vn},{type:Nn},{type:G.EmployeeLookupService},{type:pn},{type:G.EntityLookupConfigService}]},W([t.ViewChild("leaveHistoryTable",{static:!1})],o.prototype,"table",void 0),W([t.ViewChild("customTemplate",{static:!1})],o.prototype,"customTemplate",void 0),W([t.ViewChild("customFilterFields",{static:!1})],o.prototype,"customFilterFields",void 0),W([t.ViewChild("customGridColgroup",{static:!1})],o.prototype,"customGridColgroup",void 0),W([t.ViewChild("customGridHeader",{static:!1})],o.prototype,"customGridHeader",void 0),W([t.ViewChild("customGridBody",{static:!1})],o.prototype,"customGridBody",void 0),o=W([t.Component({selector:"fnd-leave-history",template:'<div *ngIf="!customTemplate else customTemplate">\n <p-confirmDialog [acceptLabel]="\'hcm_contract.employment_additional_info.yes\' | translate" acceptIcon=""\n [rejectLabel]="\'hcm_contract.employment_additional_info.no\' | translate" rejectIcon=""></p-confirmDialog>\n <form [formGroup]="filterFormGroup" autocomplete="off">\n <p-panel styleClass="form-group" [toggleable]="true" [(collapsed)]="filtersPanelCollapsed" (onAfterToggle)="focusInput(\'employee\')">\n <p-header>\n {{"hcm_contract.employment_additional_info.filters" | translate}}\n <s-token-list [tokens]="searchTokens" (tokenRemoved)="onRemoveToken($event)" [removableTokens]="true"></s-token-list>\n </p-header>\n <div *ngIf="!customFilterFields else customFilterFields">\n <s-dynamic-form [fields]="filterFields" [form]="filterFormGroup" [errorMessages]="{pattern: \'hcm_contract.employment_additional_info.error_invalid\' | translate}"></s-dynamic-form>\n </div>\n <p-footer>\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="filter-button" class="ui-button" type="submit" pButton [label]="\'hcm_contract.employment_additional_info.filter\' | translate"\n title="{{\'hcm_contract.employment_additional_info.filter\' | translate}} (Alt + Shift + F)"\n (click)="onSearch()"></button>\n <button id="clear-button" class="ui-button ui-button-link" type="button" pButton [label]="\'hcm_contract.employment_additional_info.clear\' | translate"\n title="{{\'hcm_contract.employment_additional_info.clear\' | translate}} (Alt + Shift + L)"\n (click)="onClear()"></button>\n </div>\n </div>\n </p-footer>\n </p-panel>\n </form>\n <p-panel *sLoadingState="showLoader">\n <p-header>\n {{"hcm_contract.employment_additional_info.leave_history_list_grid_title" | translate}}\n </p-header>\n <s-empty-state *ngIf="serverError" iconClass="fa fa-exclamation-triangle" title="{{\'hcm_contract.employment_additional_info.error_server_title\' | translate}}"\n primaryActionLabel="{{\'hcm_contract.employment_additional_info.error_server_try_again\' | translate}}"\n (primaryAction)="resetGrid()" description="{{\'hcm_contract.employment_additional_info.error_server_description\' | translate}}"></s-empty-state>\n <s-empty-state *ngIf="gridData && !gridData.length" [title]="\'hcm_contract.employment_additional_info.leave_history_empty_state_title\' | translate"\n [showPrimaryAction]="permissions.incluir" [primaryActionLabel]="\'hcm_contract.employment_additional_info.add\' | translate"\n (primaryAction)="onAdd()" [description]="\'hcm_contract.employment_additional_info.leave_history_empty_state_description\' | translate"\n [showSecondaryAction]="permissions.incluir"\n [secondaryActionLabel]="\'hcm_contract.employment_contract.add_collective\' | translate"\n (secondaryAction)="onAddCollective()"></s-empty-state>\n <div [attr.data-hidden]="!gridData?.length || serverError">\n <div class="ui-g">\n <div class="ui-g-12">\n <button id="add-button" type="button" pButton [label]="\'hcm_contract.employment_additional_info.add\' | translate"\n title="{{\'hcm_contract.employment_additional_info.add\' | translate}} (Alt + Shift + N)"\n *ngIf="permissions.incluir" (click)="onAdd()"></button>\n <button id="edit-button" type="button" class="ui-button-secondary" pButton [label]="getTitleButton()"\n title="{{getTitleButton()}} (Alt + Shift + E)"\n [disabled]="!selection || selection.length !== 1" (click)="onEdit()"></button>\n <button id="delete-button" type="button" class="ui-button-secondary" pButton [label]="\'hcm_contract.employment_additional_info.delete\' | translate"\n title="{{\'hcm_contract.employment_additional_info.delete\' | translate}} (Alt + Shift + X)"\n (click)="onDelete()" [disabled]="!selection || !selection.length" *ngIf="permissions.excluir"></button>\n <s-button *ngIf="permissions.incluir || permissions.excluir"\n [label]="\'hcm_contract.employment_contract.other_actions\' | translate"\n priority="secondary" [model]="collectiveActions" [disabled]="false" [auxiliary]="false"></s-button>\n </div>\n </div>\n <div class="ui-g">\n <div class="ui-g-12">\n <p-table #leaveHistoryTable [value]="gridData" [columns]="gridColumns" dataKey="id" [lazy]="true" [scrollable]="true"\n [resizableColumns]="true" sortMode="multiple" [paginator]="true" [totalRecords]="totalRecords"\n [sortField]="getSortField()" [sortOrder]="getSortOrder()" [first]="getRowIndex()"\n [rows]="getPageSize()" [lazyLoadOnInit]="false" [rowsPerPageOptions]="[10, 20, 50, 100]"\n [(selection)]="selection" (onLazyLoad)="onGridChange($event)">\n <ng-template pTemplate="colgroup" let-columns *ngIf="!customGridColgroup else customGridColgroup">\n <colgroup>\n <col *ngFor="let col of columns" [style.width]="col.width">\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_COLGROUP_COLUMNS:END}--\x3e\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns *ngIf="!customGridHeader else customGridHeader">\n <tr>\n <th id="tableHeaderCheckbox" style="width: 50px">\n <p-tableHeaderCheckbox></p-tableHeaderCheckbox>\n </th>\n <th id="columnsName" *ngFor="let col of columns" [pSortableColumn]="col.field" style="width: 200px" pResizableColumn>\n <div class="senior-header">\n <span class="senior-header-title">{{col.header}}</span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n \x3c!--{CA:GRID_HEADER_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_HEADER_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n \x3c!--{CA:GRID_HEADER:START}--\x3e\n \x3c!--{CA:GRID_HEADER:END}--\x3e\n <ng-template pTemplate="body" let-rowData let-columns *ngIf="!customGridBody else customGridBody">\n <tr [pSelectableRow]="rowData">\n <td style="width: 50px">\n <p-tableCheckbox [value]="rowData"></p-tableCheckbox>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'employee.employer.codEmp\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'employee.employer.nomEmp\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{"" + (getProp(rowData, \'employee.employeeSnapshot.companyBranchCode\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'employee.employeeSnapshot.companyBranchName\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'employee.code\') | localizedNumber | async}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'employee.person.nomPes\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <div [ngSwitch]="getProp(rowData, \'employee.employmentRelationship.contractType\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)">\n <span *ngSwitchCase="\'EMPLOYEE\'">{{ "hcm_contract.employment_additional_info.contract_type_employee" | translate }}</span>\n <span *ngSwitchCase="\'DIRECTOR\'">{{ "hcm_contract.employment_additional_info.contract_type_director" | translate }}</span>\n <span *ngSwitchCase="\'TRAINEE\'">{{ "hcm_contract.employment_additional_info.contract_type_trainee" | translate }}</span>\n <span *ngSwitchCase="\'APRENTICE\'">{{ "hcm_contract.employment_additional_info.contract_type_aprentice" | translate }}</span>\n <span *ngSwitchCase="\'THIRD_PARTY\'">{{ "hcm_contract.employment_additional_info.contract_type_third_party" | translate }}</span>\n </div>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{getProp(rowData, \'startDate\') | localizedDate:"L" | async}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'situation.code\') | localizedNumber | async)}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(getProp(rowData, \'situation.name\') || (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td (click)="selection = [rowData]" style="width: 200px">\n <span>{{(\n getProp(rowData, \'endDate\') | localizedDate:"L" | async) ||\n (\'hcm_contract.employment_additional_info.list_grid_empty_field\' | translate)}}\n </span>\n </td>\n \x3c!--{CA:GRID_BODY_COLUMNS:START}--\x3e\n \x3c!--{CA:GRID_BODY_COLUMNS:END}--\x3e\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <s-table-paging [table]="leaveHistoryTable" [totalRecords]="totalRecords" [exportFileName]="\'hcm_contract.employment_additional_info.leave_history_list_grid_title\' | translate">\n </s-table-paging>\n </ng-template>\n \x3c!--{CA:GRID_TEMPLATES:START}--\x3e\n \x3c!--{CA:GRID_TEMPLATES:END}--\x3e\n </p-table>\n </div>\n </div>\n </div>\n </p-panel>\n</div>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',providers:[i.ConfirmationService]})],o)}(Ln),so=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,In,Bn,Qn,l.FileUploadModule,G.EntityLookupModule.forRoot({domain:"hcm_contract",service:"employment_additional_info"})],declarations:[ro,io],providers:[nn,pn],exports:[ro,io]})],e)}(),lo=c,co=function(){function n(n,o,i,a,s,l){this.route=n,this.translate=o,this.fieldCustomization=i,this.e030AgeService=a,this.e030BanService=s,this.cdr=l,this.locale={},this.currencyLocaleOptions={},this.permissions={},this.allPermissions={},this.mainPanelCollapsed=!1,this.bankAccountType=[{label:this.translate.instant("hcm_contract.employment_contract.bank_account_type_checking_account"),value:e.BankAccountType.CHECKING_ACCOUNT},{label:this.translate.instant("hcm_contract.employment_contract.bank_account_type_savings_account"),value:e.BankAccountType.SAVINGS_ACCOUNT},{label:this.translate.instant("hcm_contract.employment_contract.bank_account_type_salary_account"),value:e.BankAccountType.SALARY_ACCOUNT},{label:this.translate.instant("hcm_contract.employment_contract.bank_account_type_other"),value:e.BankAccountType.OTHER}],this.bankBranchLookupDisplayFields=["codAge","nomAge"],this.bankBranchAdvancedDisplayFields=["codAge","nomAge"],this.bankBranchLookupSeparator=" - ",this.bankLookupDisplayFields=["codBan","nomBan"],this.bankAdvancedDisplayFields=["codBan","nomBan"],this.bankLookupSeparator=" - ",this.remove=new t.EventEmitter,this.ngUnsubscribe=new r.Subject}return n.prototype.ngOnInit=function(){var e=this;this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)})),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.bankBranchSearchFields=this.getBankBranchSearchFields(),this.bankBranchSearchGridFields=this.getBankBranchSearchGridFields(),this.bankSearchFields=this.getBankSearchFields(),this.bankSearchGridFields=this.getBankSearchGridFields()},n.prototype.ngAfterViewInit=function(){var e=document.getElementsByTagName("input"),t=Array.from(e).find((function(e){return!e.disabled}));t&&t.focus(),this.cdr.detectChanges()},n.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},n.prototype.isNew=function(){return"new"==this.routeParams.bankAccountHistory},n.prototype.onRouteParamsChange=function(e){this.routeParams=e},n.prototype.updateSuggestions=function(e){e.bankBranch&&(e.bankBranch.label=this.getSuggestionValue(["codAge","nomAge"],"bankBranch",e,this.bankBranchLookupSeparator),e.bankBranch.label.trim()===this.bankBranchLookupSeparator.trim()&&delete e.bankBranch.label),e.bank&&(e.bank.label=this.getSuggestionValue(["codBan","nomBan"],"bank",e,this.bankLookupSeparator),e.bank.label.trim()===this.bankLookupSeparator.trim()&&delete e.bank.label)},n.prototype.getSuggestionValue=function(e,t,n,o){var i=this;return e.map((function(e){return i.getProp(n,t+"."+e)})).reduce((function(e,t){return""+e+o+t}))},n.prototype.onRouteDataChange=function(e){if(e.locale&&e.locale.number){var t=e.locale.number,n=t.currencySymbol,o=t.thousandsSeparator,i=t.decimalSeparator;this.locale=e.locale,this.currencyLocaleOptions={align:"left",prefix:n,thousands:o,decimal:i}}if(this.permissions=e.allPermissions.bankAccountHistory,this.allPermissions=e.allPermissions,e.entity){this.permissions.editar||this.formGroup.disable();var a=Jt.fromDto(e.entity);this.updateSuggestions(a),this.formGroup.patchValue(a)}else this.formGroup.patchValue(new Jt)},n.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},n.prototype.onBankBranchLookupRequest=function(e){var t=this,n=this.bankBranchLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.mountFilterQuery(this.getBankBranchSearchFields(),e);o=this.getFilterBankBranch(o);var i=Ee(this.bankBranchLookupDisplayFields,this.bankBranchAdvancedDisplayFields);this.e030AgeService.listExternalE030Age({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.bankBranchLookupDisplayFields.map((function(n){return n.indexOf(".")>0?t.getProp(e,n):e[n]})).join(t.bankBranchLookupSeparator)})}))})}))).subscribe((function(e){t.bankBranchLookupSuggestions=e.contents}))},n.prototype.onBankBranchSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,l=i,c=this.mountFilterQuerySearch(this.getBankBranchSearchFields(),a);c=this.getFilterBankBranch(c);var p=Ee(this.bankBranchLookupDisplayFields,this.bankBranchAdvancedDisplayFields);this.e030AgeService.listExternalE030Age({page:r,sort:l,filterQuery:c,displayFields:p}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.bankBranchLookupDisplayFields.map((function(n){return n.indexOf(".")>0?t.getProp(e,n):e[n]})).join(t.bankBranchLookupSeparator)})}))})}))).subscribe((function(e){t.bankBranchSearchGridData=e.contents,t.bankBranchSearchTotalRecords=e.totalElements}))},n.prototype.onBankLookupRequest=function(e){var t=this,n=this.bankLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.mountFilterQuery(this.getBankSearchFields(),e),i=Ee(this.bankLookupDisplayFields,this.bankAdvancedDisplayFields);this.getBankObservable({sort:n,filterQuery:o,displayFields:i}).subscribe((function(e){t.bankLookupSuggestions=e.contents}))},n.prototype.mountFilterQuery=function(e,t){return e.filter((function(e){var n=e.type;return Ce(n,t)})).map((function(e){var n=e.name,o=e.type;return"number"==typeof t?n+" eq "+t:o==l.FieldType.Date?n+" eq '"+lo(t).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+lo(t).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+lo(t).format()+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+t.replace(/'/g,"\\'")+"'))":n+" eq '"+t+"'"})).join(" or ")},n.prototype.mountFilterQuerySearch=function(e,t){return e.filter((function(e){var n=e.name;return!!t[n]})).map((function(e){var n=e.name,o=e.type,i=t[n];return"number"==typeof i?n+" eq "+i:o==l.FieldType.Date?n+" eq '"+lo(i).format("YYYY-MM-DD")+"'":o==l.FieldType.Time?n+" eq '"+lo(i).format("HH:mm:ss")+"'":o==l.FieldType.DateTime?n+" eq '"+lo(i).format()+"'":o==l.FieldType.Enum?n+" eq '"+i+"'":o==l.FieldType.String?"containing(upper("+n+"), upper('"+i.replace(/'/g,"\\'")+"'))":n+" eq '"+i+"'"})).join(" and ")},n.prototype.onBankSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,s=i,l=this.mountFilterQuerySearch(this.getBankSearchFields(),a),c=Ee(this.bankLookupDisplayFields,this.bankAdvancedDisplayFields);this.getBankObservable({page:r,sort:s,filterQuery:l,displayFields:c}).subscribe((function(e){t.bankSearchGridData=e.contents,t.bankSearchTotalRecords=e.totalElements}))},n.prototype.getBankObservable=function(e){var t=this;return this.e030BanService.listExternalE030Ban(z({},e)).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.bankLookupDisplayFields.map((function(n){return n.indexOf(".")>0?t.getProp(e,n):e[n]})).join(t.bankLookupSeparator)})}))})})))},n.prototype.getBankBranchSearchFields=function(){return[new l.FormField({name:"codAge",label:this.translate.instant("hcm_contract.employment_contract.e_030_age_cod_age"),type:l.FieldType.String}),new l.FormField({name:"nomAge",label:this.translate.instant("hcm_contract.employment_contract.e_030_age_nom_age"),type:l.FieldType.String})]},n.prototype.getBankBranchSearchGridFields=function(){return[new l.FormField({name:"codAge",label:this.translate.instant("hcm_contract.employment_contract.e_030_age_cod_age"),type:l.FieldType.String}),new l.FormField({name:"nomAge",label:this.translate.instant("hcm_contract.employment_contract.e_030_age_nom_age"),type:l.FieldType.String})]},n.prototype.getBankSearchFields=function(){return[new l.FormField({name:"codBan",label:this.translate.instant("hcm_contract.employment_contract.e_030_ban_cod_ban"),type:l.FieldType.String}),new l.FormField({name:"nomBan",label:this.translate.instant("hcm_contract.employment_contract.e_030_ban_nom_ban"),type:l.FieldType.String})]},n.prototype.getBankSearchGridFields=function(){return[new l.FormField({name:"codBan",label:this.translate.instant("hcm_contract.employment_contract.e_030_ban_cod_ban"),type:l.FieldType.String}),new l.FormField({name:"nomBan",label:this.translate.instant("hcm_contract.employment_contract.e_030_ban_nom_ban"),type:l.FieldType.String})]},n.prototype.onClearBank=function(){this.onSelectBank(null),ae(this.formGroup,!0,"bankBranch")},n.prototype.onSelectBank=function(e){var t=this.formGroup.get("bankBranch");e&&(t.enable(),t.reset(),this.requiredBankBranch=!1),t.updateValueAndValidity()},n.prototype.getFilterBankBranch=function(e){var t=this.formGroup.get("bank").value,n=e?"and":"",o=n?n+" ("+e+")":"";return t&&t.id&&(e="e030ban eq '"+t.id+"' "+o),e},n.prototype.checkPermissions=function(){return"new"==this.routeParams.bankAccountHistory||this.permissions.editar},n.ctorParameters=function(){return[{type:d.ActivatedRoute},{type:a.TranslateService},{type:Sn},{type:en},{type:Zt},{type:t.ChangeDetectorRef}]},W([t.Input()],n.prototype,"isDisable",void 0),W([t.Input()],n.prototype,"formGroup",void 0),W([t.ViewChild("customTemplate")],n.prototype,"customTemplate",void 0),W([t.ViewChild("customFormFields")],n.prototype,"customFormFields",void 0),W([t.Input()],n.prototype,"id",void 0),W([t.Output()],n.prototype,"remove",void 0),n=W([t.Component({selector:"fnd-bank-account-item",template:'<form [formGroup]="formGroup">\n <div class="ui-fluid" *ngIf="!customFormFields; else customFormFields">\n <div class="ui-g ui-fluid">\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-2 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isDisable">\n <label for="bank">{{\n "hcm_contract.employment_contract.bank_account_history_bank"\n | translate\n }}</label>\n <s-lookup\n dataKey="id"\n id="bank"\n name="bank"\n formControlName="bank"\n [searchFields]="bankSearchFields"\n [searchGridFields]="bankSearchGridFields"\n [searchGridData]="bankSearchGridData"\n [multiple]="false"\n [lookupSuggestions]="bankLookupSuggestions"\n (onLookupRequest)="onBankLookupRequest($event)"\n (onSearchRequest)="onBankSearchRequest($event)"\n lookupDisplayField="label"\n (onSelect)="onSelectBank($event)"\n (onClear)="onClearBank()"\n [searchTotalRecords]="bankSearchTotalRecords"\n [searchTitle]="\n \'hcm_contract.employment_contract.bank_account_history_bank_search_title\'\n | translate\n "\n [searchEmptyTitle]="\n \'hcm_contract.employment_contract.nothing_found\' | translate\n "\n [filterLabel]="\'hcm_contract.employment_contract.filter\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.filters\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.clear\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.cancel\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.select\' | translate"\n [searchTotalRecordsLabel]="\n \'hcm_contract.employment_contract.total_records\'\n | translate : { value: bankSearchTotalRecords }\n "\n ></s-lookup>\n <s-control-errors\n [control]="formGroup.controls[\'bank\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate\n }"\n ></s-control-errors>\n </div>\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-2 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isDisable">\n <label for="bankBranch">{{\n "hcm_contract.employment_contract.bank_account_history_bank_branch"\n | translate\n }}</label>\n <s-lookup\n dataKey="id"\n id="bankBranch"\n name="bankBranch"\n formControlName="bankBranch"\n [searchFields]="bankBranchSearchFields"\n [searchGridFields]="bankBranchSearchGridFields"\n [searchGridData]="bankBranchSearchGridData"\n [multiple]="false"\n [lookupSuggestions]="bankBranchLookupSuggestions"\n (onLookupRequest)="onBankBranchLookupRequest($event)"\n (onSearchRequest)="onBankBranchSearchRequest($event)"\n lookupDisplayField="label"\n [searchTotalRecords]="bankBranchSearchTotalRecords"\n [searchTitle]="\n \'hcm_contract.employment_contract.bank_account_history_bank_branch_search_title\'\n | translate\n "\n [searchEmptyTitle]="\n \'hcm_contract.employment_contract.nothing_found\' | translate\n "\n [filterLabel]="\'hcm_contract.employment_contract.filter\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.filters\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.clear\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.cancel\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.select\' | translate"\n [searchTotalRecordsLabel]="\n \'hcm_contract.employment_contract.total_records\'\n | translate : { value: bankBranchSearchTotalRecords }\n "\n ></s-lookup>\n <s-control-errors\n [control]="formGroup.controls[\'bankBranch\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate\n }"\n ></s-control-errors>\n </div>\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-2 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isDisable">\n <label for="bankAccountType">{{\n "hcm_contract.employment_contract.bank_account_history_bank_account_type"\n | translate\n }}</label>\n <p-dropdown\n inputId="bankAccountType"\n name="bankAccountType"\n [options]="bankAccountType"\n formControlName="bankAccountType"\n placeholder="{{\n \'hcm_contract.employment_contract.bank_account_history_bank_account_type_placeholder\'\n | translate\n }}"\n ></p-dropdown>\n <s-control-errors\n [control]="formGroup.controls[\'bankAccountType\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate\n }"\n ></s-control-errors>\n </div>\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-2 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isDisable">\n <label for="bankAccountNumber">{{\n "hcm_contract.employment_contract.bank_account_history_bank_account_number"\n | translate\n }}</label>\n <input\n #bankAccountNumberFormInput\n id="bankAccountNumber"\n name="bankAccountNumber"\n pInputText\n formControlName="bankAccountNumber"\n sBignumberInput\n autocomplete="off"\n />\n <s-control-errors\n [control]="formGroup.controls[\'bankAccountNumber\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate,\n pattern:\n \'hcm_contract.employment_contract.error_invalid\' | translate\n }"\n ></s-control-errors>\n </div>\n <div class="ui-sm-4 ui-md-4 ui-lg-4 ui-xl-2 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isDisable">\n <label for="bankAccountDigit">{{\n "hcm_contract.employment_contract.bank_account_history_bank_account_digit"\n | translate\n }}</label>\n <input\n #bankAccountDigitFormInput\n type="text"\n id="bankAccountDigit"\n name="bankAccountDigit"\n pInputText\n formControlName="bankAccountDigit"\n autocomplete="off"\n />\n <s-control-errors\n [control]="formGroup.controls[\'bankAccountDigit\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate,\n maxlength:\n \'hcm_contract.employment_contract.error_max_length\'\n | translate : { value: \'3\' }\n }"\n ></s-control-errors>\n </div>\n <div class="ui-sm-4 ui-md-2 ui-lg-2 ui-xl-1 required"\n pTooltip="{{\'hcm_contract.employment_contract.admission_generic_field_validator_editable\' | translate}}"\n [tooltipDisabled]="!isNew()">\n <label for="bankAccountPercentage">{{\n "hcm_contract.employment_contract.bank_account_history_bank_account_percentage"\n | translate\n }}</label>\n <div class="ui-inputgroup">\n <span class="ui-inputgroup-addon">%</span>\n <input\n #bankAccountPercentageFormInput\n id="bankAccountPercentage"\n name="bankAccountPercentage"\n pInputText\n formControlName="bankAccountPercentage"\n [precision]="15"\n [scale]="2"\n sBignumberInput\n autocomplete="off"\n />\n </div>\n <s-control-errors\n [control]="formGroup.controls[\'bankAccountPercentage\']"\n [errorMessages]="{\n required:\n \'hcm_contract.employment_contract.error_required\' | translate,\n min:\n \'hcm_contract.employment_contract.error_min_value\'\n | translate : { value: \'0.01\' },\n max:\n \'hcm_contract.employment_contract.error_max_value\'\n | translate : { value: \'100\' }\n }"\n ></s-control-errors>\n </div>\n <div\n [id]="\'dv-remove-bank-account-history-\' + id"\n class="ui-sm-4 ui-md-2 ui-lg-2 ui-xl-1"\n >\n <label> </label>\n <s-button\n id="btn-remove-bank-account-history"\n styleClass="btn-broke"\n label="{{\n \'hcm_contract.employment_contract.admission_generic_remove\'\n | translate\n }}"\n priority="link"\n [auxiliary]="false"\n [disabled]="isDisable"\n (click)="remove.next()"\n *ngIf="checkPermissions()"\n >\n </s-button>\n </div>\n </div>\n </div>\n</form>\n\x3c!--{CA:FILE_CONTENTS:START}--\x3e\n\x3c!--{CA:FILE_CONTENTS:END}--\x3e\n',providers:[i.ConfirmationService]})],n)}(),po=function(){function e(e,t,n){this.formBuilder=e,this.route=t,this.changeRef=n,this.permissions={},this.ngUnsubscribe=new r.Subject}return e.prototype.ngOnInit=function(){var e=this;this.parentFormGroup.addControl(this.nameFormControl,this.formArray),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)}))},e.prototype.ngAfterViewChecked=function(){this.changeRef.detectChanges()},e.prototype.onRouteDataChange=function(e){this.permissions=e.allPermissions.bankAccountHistory},e.prototype.onRouteParamsChange=function(e){this.routeParams=e},Object.defineProperty(e.prototype,"parentFormGroupName",{set:function(e){e&&(this.nameFormControl=e,this.createFormGroup())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bankData",{set:function(e){var t=this;e&&e.length&&e.forEach((function(e){var n=t.formBuilder.group({bank:t.formBuilder.control({value:z({},e.bank),disabled:!1},p.Validators.required),bankBranch:t.formBuilder.control({value:z({},e.bankBranch),disabled:!1},p.Validators.required),bankAccountType:t.formBuilder.control({value:e.bankAccountType,disabled:!1},p.Validators.required),bankAccountNumber:t.formBuilder.control({value:e.bankAccountNumber,disabled:!1},p.Validators.required),bankAccountDigit:t.formBuilder.control({value:e.bankAccountDigit,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.maxLength(3)])),bankAccountPercentage:t.formBuilder.control({value:e.bankAccountPercentage,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.min(.01),p.Validators.max(100)]))});t.isDisable&&n.disable({onlySelf:!0}),t.bankAccountHistories.push(n)}))},enumerable:!0,configurable:!0}),e.prototype.addBankAccountListItem=function(){this.bankAccountHistories.push(this.formBuilder.group({bank:this.formBuilder.control({value:null,disabled:!1},p.Validators.required),bankBranch:this.formBuilder.control({value:null,disabled:!0},p.Validators.required),bankAccountType:this.formBuilder.control({value:null,disabled:!1},p.Validators.required),bankAccountNumber:this.formBuilder.control({value:null,disabled:!1},p.Validators.required),bankAccountDigit:this.formBuilder.control({value:null,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.maxLength(3)])),bankAccountPercentage:this.formBuilder.control({value:null,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.min(.01),p.Validators.max(100)]))}))},e.prototype.removeBankDataItem=function(e){this.bankAccountHistories.removeAt(e)},e.prototype.createFormGroup=function(){this.formArray=this.formBuilder.array([])},Object.defineProperty(e.prototype,"bankAccountHistories",{get:function(){return this.nameFormControl&&this.formArray},enumerable:!0,configurable:!0}),e.prototype.checkPermissions=function(){return"new"===this.routeParams.bankAccountHistory||this.permissions.editar},e.ctorParameters=function(){return[{type:p.FormBuilder},{type:d.ActivatedRoute},{type:t.ChangeDetectorRef}]},W([t.Input()],e.prototype,"parentFormGroup",void 0),W([t.Input()],e.prototype,"isDisable",void 0),W([t.Input()],e.prototype,"parentFormGroupName",null),W([t.Input()],e.prototype,"bankData",null),e=W([t.Component({selector:"fnd-bank-account-list",template:'<form [formGroup]="formArray">\n <div *ngFor="let group of bankAccountHistories.controls; let i = index">\n <fnd-bank-account-item\n [formGroup]="group"\n [id]="\'bank-account-history-item\' + i"\n (remove)="removeBankDataItem(i)"\n [isDisable]="isDisable"\n ></fnd-bank-account-item>\n </div>\n <div class="ui-g ui-fluid">\n <div class="ui-sm-12 ui-md-12 ui-lg-12 ui-xl-12 required">\n <s-button\n id="btn-add-bank-account"\n styleClass="btn-broke"\n class="btn-add"\n label="{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_financial_financial_add_bank_account_history\'\n | translate\n }}"\n priority="link"\n [auxiliary]="false"\n [disabled]="isDisable"\n (click)="addBankAccountListItem()"\n *ngIf="checkPermissions()"\n ></s-button>\n </div>\n </div>\n</form>\n',styles:[".btn-add{float:left}"]})],e)}(),mo=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),kn,In,Bn,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,l.DynamicFormModule,l.TokenListModule,E.PanelModule,B.TooltipModule,D.InputTextModule,V.ButtonModule,N.CheckboxModule,k.TableModule,v.ConfirmDialogModule,_.CalendarModule,g.DropdownModule,I.TabViewModule,y.HotkeyModule,l.LoadingStateModule,l.BignumberInputModule,n.CyclicJsonInterceptorModule,n.HttpInterceptorModule,R.ToastModule,O.FieldsetModule],declarations:[co,po],providers:[tt,i.MessageService,qe,Zt,en],exports:[co,po]})],e)}();!function(e){e.V1006="V1006",e.V1207="V1207"}(Xn||(Xn={}));var uo,ho,yo,fo,_o,vo=function(){function e(e,t,n){this.formBuilder=e,this.route=t,this.changeRef=n,this.permissions={},this.ngUnsubscribe=new r.Subject,this.indexToDisable=-1,this.isDisabled=!1}return e.prototype.ngOnInit=function(){var e=this;this.parentFormGroup.addControl(this.nameFormControl,this.formArray),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)}))},e.prototype.ngAfterViewChecked=function(){this.changeRef.detectChanges(),this.enableOrDisableAddButton(this.formArray)},e.prototype.onRouteDataChange=function(e){this.permissions=e.allPermissions.regulatoryNormTrainingHistory},e.prototype.onRouteParamsChange=function(e){this.routeParams=e},e.prototype.addRegulatoryNormTrainingHistoryListItem=function(){this.createRegulatoryNormTrainingHistoryFormGroup(),this.enableOrDisableAddButton(this.regulatoryNormTrainingHistories)},e.prototype.setESocialTrainingCodeTypeValidator=function(){return function(e){var t=e;return t.controls.forEach((function(e,n){var o=t.controls.some((function(t,o){var i=e.get("eSocialTrainingCodeType"),a=t.get("eSocialTrainingCodeType"),r=i.value,s=a.value;return!(n===o||!r||!s||r!==s)})),i=e.get("eSocialTrainingCodeType");o&&!i.disabled?(i.setErrors({eSocialTrainingCodeTypesAreEqual:!0}),i.markAsDirty()):i.hasError("eSocialTrainingCodeTypesAreEqual")&&(mn(i,"eSocialTrainingCodeTypesAreEqual"),i.markAsPristine())})),null}},e.prototype.setStartDateValidator=function(){var e=this;return function(t){return e.personBirthDate&&t.value&&c(t.value).isBefore(c(e.personBirthDate),"day")?{startDateBeforeBirthdate:!0}:(mn(t,"startDateBeforeBirthdate"),null)}},e.prototype.getESocialTrainingCodeQuantity=function(){var e=0;for(var t in Xn)Xn.hasOwnProperty(t)&&isNaN(parseInt(t))&&e++;return e},e.prototype.enableOrDisableAddButton=function(e){this.isAddButtonDisabled=e.length===this.getESocialTrainingCodeQuantity()},Object.defineProperty(e.prototype,"regulatoryNormTrainingHistories",{get:function(){return this.nameFormControl&&this.formArray},enumerable:!0,configurable:!0}),e.prototype.createFormGroup=function(){this.formArray=this.formBuilder.array([],[this.setESocialTrainingCodeTypeValidator()])},e.prototype.removeRegulatoryTraining=function(e){this.regulatoryNormTrainingHistories.removeAt(e),this.enableOrDisableAddButton(this.regulatoryNormTrainingHistories)},e.prototype.checkPermissions=function(){return"new"==this.routeParams.regulatoryNormTrainingHistory||this.permissions.editar},e.prototype.createRegulatoryNormTrainingHistoryFormGroup=function(e){var t=this.formBuilder.group({startDate:this.formBuilder.control({value:null==e?void 0:e.startDate,disabled:!!e},[p.Validators.required,this.setStartDateValidator()]),eSocialTrainingCodeType:this.formBuilder.control({value:null==e?void 0:e.eSocialTrainingCodeType,disabled:!!e},[p.Validators.required])});t&&(this.isDisabled=!0),this.regulatoryNormTrainingHistories.push(t)},Object.defineProperty(e.prototype,"parentFormGroupName",{set:function(e){e&&(this.nameFormControl=e,this.createFormGroup())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trainingData",{set:function(e){var t=this;e&&e.length&&e.forEach((function(e){t.createRegulatoryNormTrainingHistoryFormGroup(e),t.enableOrDisableAddButton(t.regulatoryNormTrainingHistories),t.indexToDisable++}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"personBirthdate",{set:function(e){var t=this;this.personBirthDate=e,this.formArray&&this.formArray.controls.forEach((function(e){var n=e.get("startDate");t.personBirthDate&&n.value&&c(n.value).isBefore(c(t.personBirthDate),"day")?n.setErrors({startDateBeforeBirthdate:!0}):mn(n,"startDateBeforeBirthdate")}))},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:p.FormBuilder},{type:d.ActivatedRoute},{type:t.ChangeDetectorRef}]},W([t.Input()],e.prototype,"parentFormGroup",void 0),W([t.Input()],e.prototype,"parentFormGroupName",null),W([t.Input()],e.prototype,"trainingData",null),W([t.Input()],e.prototype,"personBirthdate",null),e=W([t.Component({selector:"fnd-regulatory-norm-training-history-list",template:'<form [formGroup]="formArray">\n <div *ngFor="let group of regulatoryNormTrainingHistories.controls; let i = index">\n <fnd-regulatory-norm-training-history-item\n [formGroup]="group" [id]="\'regulatory-norm-training-history-item\' + i"\n [personBirthDate]="personBirthDate" (remove)="removeRegulatoryTraining(i)"\n [isRemoveButtonDisabled]="i <= indexToDisable">\n </fnd-regulatory-norm-training-history-item>\n </div>\n <div class="ui-g ui-fluid">\n <div class="ui-sm-12 ui-md-12 ui-lg-12 ui-xl-12 required">\n <s-button\n id="btn-add-training-data"\n styleClass="btn-broke"\n class="btn-add"\n label="{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_acting_acting_add_regulatory-norm-training-history\'\n | translate\n }}"\n priority="link"\n [auxiliary]="false"\n (click)="addRegulatoryNormTrainingHistoryListItem()"\n [disabled]="isAddButtonDisabled"\n *ngIf="checkPermissions()"\n ></s-button>\n </div>\n </div>\n</form>\n',styles:[".btn-add{float:left}"]})],e)}(),go=function(){function e(e,n,o){this.route=e,this.translate=n,this.cdr=o,this.locale={},this.currencyLocaleOptions={},this.permissions={},this.allPermissions={},this.remove=new t.EventEmitter,this.mainPanelCollapsed=!1,this.eSocialTrainingCodeType=[{label:this.translate.instant("hcm_contract.employment_contract.esocial-training-code-type-V1006"),value:Xn.V1006},{label:this.translate.instant("hcm_contract.employment_contract.esocial-training-code-type-V1207"),value:Xn.V1207}],this.ngUnsubscribe=new r.Subject}return e.prototype.ngOnInit=function(){var e=this;this.route.params.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteParamsChange(t)})),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)}))},e.prototype.ngAfterViewInit=function(){var e=document.getElementsByTagName("input"),t=Array.from(e).find((function(e){return!e.disabled}));t&&t.focus(),this.cdr.detectChanges()},e.prototype.onRouteParamsChange=function(e){this.routeParams=e},e.prototype.onRouteDataChange=function(e){if(e.locale&&e.locale.number){var t=e.locale.number,n=t.currencySymbol,o=t.thousandsSeparator,i=t.decimalSeparator;this.locale=e.locale,this.currencyLocaleOptions={align:"left",prefix:n,thousands:o,decimal:i}}if(this.permissions=e.allPermissions.regulatoryNormTrainingHistory,this.allPermissions=e.allPermissions,e.entity){this.permissions.editar||this.formGroup.disable();var a=cn.fromDto(e.entity);this.formGroup.patchValue(a)}else this.formGroup.patchValue(new cn)},e.prototype.isNew=function(){return"new"==this.routeParams.regulatoryNormTrainingHistory},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.checkPermissions=function(){return this.isNew()||this.permissions.editar},e.ctorParameters=function(){return[{type:d.ActivatedRoute},{type:a.TranslateService},{type:t.ChangeDetectorRef}]},W([t.Input()],e.prototype,"id",void 0),W([t.Input()],e.prototype,"isRemoveButtonDisabled",void 0),W([t.Input()],e.prototype,"personBirthDate",void 0),W([t.Input()],e.prototype,"formGroup",void 0),W([t.Output()],e.prototype,"remove",void 0),W([t.ViewChild("customTemplate")],e.prototype,"customTemplate",void 0),W([t.ViewChild("customFormFields")],e.prototype,"customFormFields",void 0),e=W([t.Component({selector:"fnd-regulatory-norm-training-history-item",template:'<form [formGroup]="formGroup">\n <div class="ui-fluid" *ngIf="!customFormFields; else customFormFields">\n <div class="ui-g ui-fluid">\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-3 required">\n <label for="eSocialRegulatoryNormTraining">\n {{"hcm_contract.employment_contract.regulatory_norm_training_history_esocial_training_code_type"\n | translate }}\n </label>\n <p-dropdown inputId="eSocialTrainingCodeType"\n name="eSocialTrainingCodeType"\n [options]="eSocialTrainingCodeType"\n formControlName="eSocialTrainingCodeType"\n placeholder="{{ \'hcm_contract.employment_contract.esocial-training-code-type-placeholder\'\n | translate}}"></p-dropdown>\n <s-control-errors [control]="formGroup.controls[\'eSocialTrainingCodeType\']" [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\'\n | translate,\n eSocialTrainingCodeTypesAreEqual:\n \'hcm_contract.employment_contract.e_social_training_code_type_cant_be_equal\'\n | translate\n }"></s-control-errors>\n </div>\n <div class="ui-sm-6 ui-md-4 ui-lg-4 ui-xl-2 required">\n <label for="startDate">\n {{ "hcm_contract.employment_contract.regulatory_norm_training_history_start_date" | translate }}\n </label>\n <p-calendar id="startDate" #startDateFormInput inputId="startDate" name="startDate"\n [showIcon]="true" formControlName="startDate" [locale]="locale.calendar"\n [dateFormat]="locale.calendar.dateFormat" sCalendarMask>\n </p-calendar>\n <s-control-errors [control]="formGroup.controls[\'startDate\']"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate,\n startDateBeforeBirthdate: \'hcm_contract.employment_contract.start_date_before_birth_date\' | translate\n }"></s-control-errors>\n </div>\n <div\n [id]="\'dv-remove-regulatory-norm-training-history-\' + id"\n class="ui-sm-4 ui-md-2 ui-lg-2 ui-xl-1"\n >\n <label> </label>\n <s-button\n id="btn-remove-regulatory-norm-training-history"\n styleClass="btn-broke"\n label="{{\n \'hcm_contract.employment_contract.admission_generic_remove\'\n | translate\n }}"\n priority="link"\n [auxiliary]="false"\n [disabled]="isRemoveButtonDisabled"\n (click)="remove.next()"\n *ngIf="checkPermissions()"\n >\n </s-button>\n </div>\n </div>\n </div>\n</form>\n',providers:[i.ConfirmationService]})],e)}(),bo=function(){function e(){}return e=W([t.NgModule({imports:[l.LocaleModule.forChild(),In,Bn,p.FormsModule,p.ReactiveFormsModule,h.CommonModule,a.TranslateModule,l.CustomFieldsModule,l.ControlErrorsModule,l.EmptyStateModule,l.DynamicFormModule,l.TokenListModule,E.PanelModule,B.TooltipModule,D.InputTextModule,l.ButtonModule,N.CheckboxModule,k.TableModule,v.ConfirmDialogModule,_.CalendarModule,g.DropdownModule,I.TabViewModule,y.HotkeyModule,l.LoadingStateModule,l.BignumberInputModule,n.CyclicJsonInterceptorModule,n.HttpInterceptorModule,R.ToastModule,O.FieldsetModule,kn],declarations:[vo,go],providers:[Dt,i.MessageService],exports:[vo,go]})],e)}(),So=function(){function e(e,t,n){this.http=e,this.messageService=t,this.translate=n}return e.prototype.employeeBasicInformations=function(e){return this.http.post("hcm_contract/employment_contract/queries/employeeBasicInformations",{employeeId:e}).pipe(this.defaultCatch())},e.prototype.defaultCatch=function(){var e=this;return s.catchError((function(t){if(t){var n=t.status?String(t.status):"Error",o=t.error&&t.error.message||t.statusText||t.message||"Error";401===t.status&&(n=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_title"),o=e.translate.instant("hcm_contract.employment_contract.error_unauthorized_description")),e.messageService.add({severity:"error",summary:n,detail:o})}return r.throwError(t)}))},e.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},e=W([t.Injectable()],e)}(),Do=function(){function e(e){this.employeeSummaryService=e,this.ngUnsubscribe=new r.Subject}return Object.defineProperty(e.prototype,"employeeId",{set:function(e){this._employeeId=e,this.getEmployeeBasicInformation()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.getEmployeeBasicInformation()},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(!0),this.ngUnsubscribe.complete()},e.prototype.getEmployeeBasicInformation=function(){var e=this;this._employeeId&&this._employeeId!=this.lastEmployeeId&&(this.lastEmployeeId=this._employeeId,this.loading=!0,this.employeeSummaryService.employeeBasicInformations(this._employeeId).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){return e.currentEmployee=null==t?void 0:t.employeeBasicInformations})))},e.ctorParameters=function(){return[{type:So}]},W([t.Input()],e.prototype,"employeeId",null),e=W([t.Component({selector:"fnd-employee-summary",template:'<s-loading-state [blockWindow]="true" [loading]="loading">\n <s-object-card *ngIf="_employeeId && currentEmployee">\n <s-object-card-main label="{{currentEmployee.name}}"\n description=\n "{{currentEmployee.jobPosition || (\'hcm_contract.employment_contract.not_informed\' | translate)}}"\n imageSource="{{currentEmployee.imageUrl}}">\n </s-object-card-main>\n <s-object-card-field label="{{currentEmployee.e070emp\n || (\'hcm_contract.employment_contract.not_informed\' | translate)}}" description="{{currentEmployee.e070fil\n || (\'hcm_contract.employment_contract.not_informed\' | translate)}}">\n </s-object-card-field>\n <s-object-card-field label="{{\'hcm_contract.employment_contract.department\' | translate}}"\n description=\n "{{currentEmployee.location || (\'hcm_contract.employment_contract.not_informed\' | translate)}}">\n </s-object-card-field>\n <s-object-card-field label="{{\'hcm_contract.employment_contract.situation\' | translate}}"\n description=\n "{{currentEmployee.situation\n || (\'hcm_contract.employment_contract.not_informed\' | translate)}}"></s-object-card-field>\n <s-object-card-field label="{{\'hcm_contract.employment_contract.hireDate\' | translate}}"\n description=\n "{{(currentEmployee.hireDate | localizedDate: \'L\' | async) || (\'hcm_contract.employment_contract.not_informed\' | translate)}}"\n iconClass="fa fa-calendar"></s-object-card-field>\n <s-object-card-field label="{{\'hcm_contract.employment_contract.code\' | translate}}"\n description=\n "{{currentEmployee.code || (\'hcm_contract.employment_contract.not_informed\' | translate)}}"\n iconClass="fa fa-id-card"></s-object-card-field>\n <s-object-card-field label="{{\'hcm_contract.employment_contract.age\' | translate}}"\n description=\n "{{currentEmployee.age || (\'hcm_contract.employment_contract.not_informed\' | translate)}}"\n iconClass="fa fa-birthday-cake"></s-object-card-field>\n </s-object-card>\n</s-loading-state>\n'})],e)}(),To=function(){function e(){}return e=W([t.NgModule({imports:[a.TranslateModule,l.ObjectCardModule,l.LoadingStateModule,h.CommonModule,l.EmptyStateModule,l.LoadingStateModule,l.LocaleModule],declarations:[Do],providers:[So,i.MessageService],exports:[Do]})],e)}(),Fo=function(e){function n(t,n,o){var i=e.call(this,t,n,"hcm_contract/employment_contract/entities/dependentDraft","hcm_contract/employment_contract/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i.saveDraftEvent=new r.Subject,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Eo=function(e){function n(t,n,o){var i=e.call(this,t,n,"platform/localization/entities/country","platform/localization/entities/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),Co=function(e){function n(t,n,o){var i=e.call(this,t,n,"platform/localization/entities/state","platform/localization/entities/actions",o)||this;return i.http=t,i.messageService=n,i.translate=o,i}return Y(n,e),n.ctorParameters=function(){return[{type:o.HttpClient},{type:i.MessageService},{type:a.TranslateService}]},n=W([t.Injectable()],n)}(Oe),ko=function(){function e(){}return e.prototype.ngOnInit=function(){},W([t.Input()],e.prototype,"parentFormGroup",void 0),W([t.Input()],e.prototype,"disableDocumentsAdmission",void 0),e=W([t.Component({selector:"fnd-employee-dependent-complement-step",template:'<div class="ui-fluid ">\n <div class="ui-g">\n <div class="ui-md-12">\n <h3>{{ \'hcm_contract.employment_contract.dependent_complement_data_title\' | translate }}</h3>\n </div>\n <p-tabView class="tab-view-full">\n \x3c!-- Complementar --\x3e\n <p-tabPanel\n [header]="\'hcm_contract.employment_contract.employee_dependent_sidebar_step_complement_data\'\n | translate">\n <fnd-employee-dependent-complement-tab\n [parentFormGroup]="parentFormGroup">\n </fnd-employee-dependent-complement-tab>\n </p-tabPanel>\n\n \x3c!-- Documentos --\x3e\n <p-tabPanel\n [header]="\'hcm_contract.employment_contract.employee_dependent_document_title\' | translate">\n <fnd-employee-dependent-document-tab [parentFormGroup]="parentFormGroup"></fnd-employee-dependent-document-tab>\n </p-tabPanel>\n </p-tabView>\n </div>\n</div>\n',styles:[".tab-view-full{width:100%}.toggle-header-fieldset{display:flex!important;justify-content:space-between!important;align-items:center!important}.toggle-header-fieldset .ui-inputgroup span{margin-right:8px!important;font-size:14px;font-weight:400;line-height:21px;text-align:left;text-underline-position:from-font;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}.footer-sidebar-form-dependent{display:flex;justify-content:space-between}.message-warn-admisison{padding-left:65px;font-size:14px}.message-warn-admisison p:first-of-type{font-weight:700}.btn-next>button{display:flex!important;flex-direction:row-reverse!important}.btn-next>button span{margin-left:5px!important}"]})],e)}();!function(e){e.V01="V01",e.V02="V02",e.V03="V03",e.V04="V04",e.V05="V05",e.V06="V06",e.V07="V07",e.V08="V08",e.V09="V09",e.V10="V10",e.V11="V11",e.V12="V12"}(uo||(uo={})),function(e){e.FATHER="FATHER",e.MOTHER="MOTHER"}(ho||(ho={})),function(e){e.SON="SON",e.SPOUSE="SPOUSE",e.FATHER="FATHER",e.MOTHER="MOTHER",e.GRANDFATHER_GRANDMOTHER="GRANDFATHER_GRANDMOTHER",e.GREAT_GRANDFATHER="GREAT_GRANDFATHER",e.NEPHEW="NEPHEW",e.UNCLE="UNCLE",e.GRANDSON="GRANDSON",e.FATHER_IN_LAW="FATHER_IN_LAW",e.SON_IN_LAW_DAOUGHTER_IN_LAW="FATHER_IN_LAW",e.STEPSON="STEPSON",e.BROTHER="BROTHER",e.ADOPTED_CHILD="ADOPTED_CHILD",e.PENSIONERS="PENSIONERS",e.COMPANION="COMPANION",e.GUARDIANSHIP="GUARDIANSHIP",e.MINOR_UNDER_GUARD="MINOR_UNDER_GUARD",e.STEPMOTHER="MINOR_UNDER",e.STEPFATHER="MINOR_UNDER",e.TUTOR="TUTOR",e.EX_EXPOSED="EX_EXPOSED",e.GREAT_GRANDSON="GREAT_GRANDSON",e.EX_PARTNER="EX_PARTNER",e.CONCUBINE="CONCUBINE",e.CURATORSHIP="CURATORSHIP",e.SOCIOAFFECTIVE="SOCIOAFFECTIVE",e.FATHER_MOTHER="FATHER_MOTHER",e.OTHERS="OTHERS"}(yo||(yo={})),function(e){e.V1="V1",e.V2="V2",e.V3="V3",e.V4="V4",e.V5="V5",e.V6="V6"}(fo||(fo={})),function(e){e.V1="V1",e.V2="V2",e.V3="V3",e.V4="V4",e.V5="V5",e.V6="V6"}(_o||(_o={}));var Io,Ro=function(){function e(e,t,n,o){var i=this;this.countryService=e,this.translateService=t,this.formBuilder=n,this.service=o,this.ONLY_NUMBERS_PATTERN="^[0-9]*$",this.ngUnsubscribe=new r.Subject,this.nacionalityLookupDisplayFields=["code","name"],this.nacionalityLookupSeparator=" - ",this.kinshipDegreeType=Object.keys(yo).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_kinship_degree_"+e),value:e}})),this.nameFiliation=Object.keys(ho).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_gra_par_"+e),value:e}})),this.maritalStatusType=Object.keys(fo).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_marital_status_"+e),value:e}})),this.raceType=Object.keys(_o).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_race_type_"+e),value:e}})),this.degreeOfEducationType=Object.keys(uo).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_enum_gra_ins_"+e),value:e}})),this.formGroup=this.formBuilder.group({kinshipDependentDegreeType:this.formBuilder.control({value:null,disabled:!1},p.Validators.compose([p.Validators.required])),kinshipDegreeType:this.formBuilder.control({value:null,disabled:!1}),kinshipDegreeType2:this.formBuilder.control({value:null,disabled:!1}),raceType:this.formBuilder.control({value:null,disabled:!1}),maritalStatusType:this.formBuilder.control({value:null,disabled:!1}),religion:this.formBuilder.control({value:null,disabled:!1}),nacionality:this.formBuilder.control({value:null,disabled:!1}),degreeOfEducationType:this.formBuilder.control({value:null,disabled:!1}),number:this.formBuilder.control({value:null,disabled:!1},p.Validators.compose([p.Validators.maxLength(20),p.Validators.pattern(this.ONLY_NUMBERS_PATTERN)])),nameFiliation1:this.formBuilder.control({value:null,disabled:!1},p.Validators.maxLength(40)),nameFiliation2:this.formBuilder.control({value:null,disabled:!1},p.Validators.maxLength(40))})}return e.prototype.ngOnInit=function(){this.parentFormGroup.addControl("complementDependentPersonData",this.formGroup),this.subscribeEvents(),this.nacionalitySearchFields=this.getNacionalitySearchFields(),this.nacionalitySearchGridFields=this.getNacionalitySearchFields()},e.prototype.subscribeEvents=function(){var e=this;this.service.getDependentFormData().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){var n;e.formGroup.patchValue(null===(n=null==t?void 0:t.personDependentData)||void 0===n?void 0:n.complementDependentPersonData)}))},e.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},e.prototype.onNacionalityLookupRequest=function(e){var t=this,n=this.nacionalityLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getNacionalitySearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),i=this.nacionalityLookupDisplayFields;this.countryService.list({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.nacionalityLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),e[n]})).join(t.nacionalityLookupSeparator)})}))})}))).subscribe((function(e){t.nacionalityLookupSuggestions=e.contents}))},e.prototype.onNacionalitySearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getNacionalitySearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=this.nacionalityLookupDisplayFields;this.countryService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.nacionalityLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),e[n]})).join(t.nacionalityLookupSeparator)})}))})}))).subscribe((function(e){t.nacionalitySearchGridData=e.contents,t.nacionalitySearchTotalRecords=e.totalElements}))},e.prototype.getNacionalitySearchFields=function(){return[new l.FormField({name:"code",label:this.translateService.instant("hcm_contract.employment_contract.employee_dependent_cod_pes"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translateService.instant("hcm_contract.employment_contract.employee_dependent_nom_pes"),type:l.FieldType.String})]},e.ctorParameters=function(){return[{type:Eo},{type:a.TranslateService},{type:p.FormBuilder},{type:Rt}]},W([t.Input()],e.prototype,"parentFormGroup",void 0),e=W([t.Component({selector:"fnd-employee-dependent-complement-tab",template:'<div class="ui-g" [formGroup]="formGroup">\n \x3c!-- Grau de parentesco --\x3e\n <div class="ui-md-6 ui-sm-12 required">\n <label for="kinshipDependentDegreeType">{{\n "hcm_contract.employment_contract.employee_dependent_kinship_degree_label" |\n translate\n }}</label>\n <p-dropdown\n inputId="kinshipDependentDegreeType"\n id="kinshipDependentDegreeType"\n name="kinshipDependentDegreeType"\n [options]="kinshipDegreeType"\n formControlName="kinshipDependentDegreeType"\n placeholder="{{\n \'hcm_contract.employment_contract.employee_dependent_kinship_degree_placeholder\'\n | translate}}">\n </p-dropdown>\n <s-control-errors\n id="er-kinshipDependentDegreeType"\n [control]="formGroup.get(\'kinshipDependentDegreeType\')"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate\n }">\n </s-control-errors>\n </div>\n \x3c!-- Contato --\x3e\n <div class="ui-md-6 ui-sm-12">\n <label id="lb-number" for="ff-number">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_phone_data_number\' | translate\n }}</label>\n <input id="ff-number" type="text" pInputText formControlName="number" autocomplete="off"/>\n <s-control-errors\n id="er-number"\n [control]="formGroup.get(\'number\')"\n [errorMessages]="{\n pattern: translateService.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_pattern_only_numbers\'),\n maxlength: translateService\n .instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'number\').errors?.maxlength?.requiredLength\n })\n }">\n </s-control-errors>\n </div>\n \x3c!-- Estado civil --\x3e\n <div id="dv-marital-status-type" class="ui-sm-12 ui-md-6 ui-lg-6">\n <label id="lb-marital-status-type" for="ff-maritalStatusType">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_marital_status_type\' | translate\n }}</label>\n <p-dropdown inputId="maritalStatusType" id="ff-maritalStatusType" name="maritalStatusType"\n [options]="maritalStatusType"\n formControlName="maritalStatusType"\n placeholder="{{\n \'hcm_contract.employment_contract.employee_dependent_marital_status_placeholder\'\n | translate}}">\n </p-dropdown>\n </div>\n \x3c!-- Nacionalidade --\x3e\n <div id="dv-nacionality" class="ui-sm-12 ui-md-6">\n <label id="lb-nacionality" for="ff-nacionality">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_nationality_id\'\n | translate }}\n </label>\n <s-lookup dataKey="id" id="ff-nacionality" name="nacionality" formControlName="nacionality"\n [searchFields]="nacionalitySearchFields" [searchGridFields]="nacionalitySearchGridFields"\n [searchGridData]="nacionalitySearchGridData" [multiple]="false"\n [lookupSuggestions]="nacionalityLookupSuggestions"\n (onLookupRequest)="onNacionalityLookupRequest($event)"\n (onSearchRequest)="onNacionalitySearchRequest($event)" lookupDisplayField="label"\n [searchTotalRecords]=nacionalitySearchTotalRecords\n [searchTitle]="\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_header\'\n | translate"\n [searchEmptyTitle]=\n "\'hcm_contract.employment_contract.admission_generic_lookup_empty_message\' | translate"\n [filterLabel]="\'hcm_contract.employment_contract.admission_generic_filter_label\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.admission_generic_filter_title\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.admission_generic_clear_label\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.admission_generic_btn_cancel_label\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.admission_generic_select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_contract.total_records\' | translate: {value: nacionalitySearchTotalRecords}">\n </s-lookup>\n </div>\n \x3c!-- Religião --\x3e\n <div id="dv-religion" class="ui-sm-12 ui-md-6">\n <label id="lb-religion" for="ff-religion">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_religion\' | translate\n }}</label>\n\n <input id="ff-religion" type="text" pInputText formControlName="religion" autocomplete="off" />\n </div>\n \x3c!-- Raça e Cor --\x3e\n <div id="dv-race-type" class="ui-sm-12 ui-md-6 ui-lg-6">\n <label id="lb-race-type" for="ff-race-type">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_race_type\' | translate\n }}</label>\n <p-dropdown inputId="raceType" id="ff-race-type" name="raceType"\n [options]="raceType"\n formControlName="raceType"\n placeholder=\n "{{\'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_race_type\' | translate}}">\n </p-dropdown>\n </div>\n \x3c!-- Grau de instrução --\x3e\n <div id="dv-degree-of-education-type" class="ui-sm-12 ui-md-12">\n <label id="lb-degree-of-education-type" for="ff-degree-of-education-type">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_complement_data_degree_of_education_type\' | translate\n }}</label>\n <p-dropdown inputId="raceType" id="ff-degree-of-education-type" name="degree-of-education-type"\n [options]="degreeOfEducationType"\n formControlName="degreeOfEducationType"\n placeholder=\n "{{\'hcm_contract.employment_contract.admission_employee_person_complement_data_degree_of_education_type_placeholder\' | translate}}">\n </p-dropdown>\n </div>\n \x3c!-- Nome Filiação 1 --\x3e\n <div id="dv-nameFiliation1" class="ui-sm-12 ui-md-6">\n <label id="lb-nameFiliation1" for="ff-nameFiliation1">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_parent_name_1\' | translate\n }}</label>\n\n <input id="ff-nameFiliation1" type="text" pInputText formControlName="nameFiliation1" autocomplete="off"/>\n <s-control-errors\n id="er-parent-name-1"\n [control]="formGroup.get(\'nameFiliation1\')"\n [errorMessages]="{\n maxlength: translateService\n .instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'nameFiliation1\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n \x3c!-- Grau de parentesco 1 --\x3e\n <div class="ui-md-6 ui-sm-12">\n <label for="kinshipDegreeType">{{\n "hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_kinship_degree_type_1" |\n translate\n }}</label>\n <p-dropdown inputId="kinshipDegreeType" id="kinshipDegreeType" name="kinshipDegreeType"\n [options]="nameFiliation"\n formControlName="kinshipDegreeType"\n placeholder="{{\'hcm_contract.employment_contract.admission_employee_person_basic_data_kinship_degree_type_1_placeholder\' | translate}}">\n </p-dropdown>\n </div>\n \x3c!-- Nome Filiação 2 --\x3e\n <div id="dv-nameFiliation2" class="ui-sm-12 ui-md-6">\n <label id="lb-nameFiliation2" for="ff-nameFiliation2">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_parent_name_2\' | translate\n }}</label>\n\n <input id="ff-nameFiliation2" type="text" pInputText formControlName="nameFiliation2" autocomplete="off"/>\n <s-control-errors\n id="er-parent-name-2"\n [control]="formGroup.get(\'nameFiliation2\')"\n [errorMessages]="{\n maxlength: translateService\n .instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'nameFiliation2\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n \x3c!-- Grau de parentesco 2 --\x3e\n <div class="ui-md-6 ui-sm-12">\n <label for="kinshipDegreeType2">{{\n "hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_kinship_degree_type_2" |\n translate\n }}</label>\n <p-dropdown inputId="kinshipDegreeType2" id="kinshipDegreeType2" name="kinshipDegreeType2"\n [options]="nameFiliation"\n formControlName="kinshipDegreeType2"\n appendTo="body"\n placeholder="{{\'hcm_contract.employment_contract.admission_employee_person_basic_data_kinship_degree_type_2_placeholder\' | translate}}">\n </p-dropdown>\n </div>\n\n\n</div>\n'})],e)}();!function(e){e.BIRTH_CERTIFICATE="BIRTH_CERTIFICATE",e.WEDDING_CERTIFICATE="WEDDING_CERTIFICATE",e.INDIGENOUS_CERTIFICATE="INDIGENOUS_CERTIFICATE"}(Io||(Io={}));var Lo=function(){function e(e,t,n,o){var i=this;this.translate=e,this.route=t,this.service=n,this.stateService=o,this.stateLookupDisplayFields=["code","name"],this.stateLookupSeparator=" - ",this.civilCertificateType=Object.keys(Io).map((function(e){return{label:i.translate.instant("hcm_contract.employment_contract.employee_dependent_civil_certificate_type_"+e),value:e}})),this.ngUnsubscribe=new r.Subject,this.createFormGroup(),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(e){return i.onRouteDataChange(e)}))}return e.prototype.ngOnInit=function(){this.subscribeEvents(),this.parentFormGroup.addControl("documentDependentPersonData",this.formGroup),this.stateSearchFields=this.getStateSearchFields(),this.stateSearchGridFields=this.getStateSearchFields()},e.prototype.onRouteDataChange=function(e){this.localeConfig=e.localeConfig},e.prototype.subscribeEvents=function(){var e=this;this.service.getDependentFormData().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){var n;e.formGroup.patchValue(null===(n=null==t?void 0:t.personDependentData)||void 0===n?void 0:n.documentDependentPersonData),e.dependentId,e.enableTogglesWhenExistsData()})),this.service.getOpenSideBarAndStartForm().subscribe((function(t){e.dependentId=null==t?void 0:t.dependentId,Object.keys(e.formGroupToggle.controls).forEach((function(t){e.formGroupToggle.get(t).setValue(!1),e.disableFieldsByDocument(t,!1),e.formGroupToggle.get(t).enable()}))}))},e.prototype.enableTogglesWhenExistsData=function(){var e=this.formGroup.getRawValue();(null==e?void 0:e.civilCertificateRegisterNumber)&&(this.formGroupToggle.get("toggleCivilCertificate").setValue(!0),this.disableFieldsByDocument("toggleCivilCertificate"));(null==e?void 0:e.rgNumber)&&(this.formGroupToggle.get("toggleRg").setValue(!0),this.disableFieldsByDocument("toggleRg"));(null==e?void 0:e.deathCertificateRegisterNumber)&&(this.formGroupToggle.get("toggleDeath").setValue(!0),this.disableFieldsByDocument("toggleDeath"))},e.prototype.createFormGroup=function(){this.formGroupToggle=new p.FormGroup({toggleRg:new p.FormControl(null),toggleCivilCertificate:new p.FormControl(null),toggleDeath:new p.FormControl(null)}),this.formGroup=new p.FormGroup({rgNumber:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(13)),rgIssuer:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(6)),rgIssuerStateId:new p.FormControl({value:null,disabled:!0}),rgIssueDate:new p.FormControl({value:null,disabled:!0}),civilCertificateType:new p.FormControl({value:null,disabled:!0}),civilCertificateIssueDate:new p.FormControl({value:null,disabled:!0}),civilCertificateRegisterNumber:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(255)),civilCertificateTerm:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(255)),civilCertificateBook:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(255)),civilCertificatePage:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(255)),civilCertificateNotaryOffice:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(255)),civilCertificateStateId:new p.FormControl({value:null,disabled:!0}),deathCertificateIssueDate:new p.FormControl({value:null,disabled:!0}),deathCertificateRegisterNumber:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(40)),deathCertificateNumber:new p.FormControl({value:null,disabled:!0},p.Validators.maxLength(10))})},Object.defineProperty(e.prototype,"getDisableRg",{get:function(){return!this.formGroupToggle.get("toggleRg").value},enumerable:!0,configurable:!0}),e.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},e.prototype.onStateLookupRequest=function(e){var t=this,n=this.stateLookupDisplayFields.map((function(e){return{field:e,order:1}})),o=this.getStateSearchFields().filter((function(t){var n=t.type;return Ce(n,e)})).map((function(t){return ce(t,e,{textSeachEnum:!0})})).filter((function(e){return!!e})).join(" or "),i=this.stateLookupDisplayFields;this.stateService.list({sort:n,filterQuery:o,displayFields:i}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.stateLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),e[n]})).join(t.stateLookupSeparator)})}))})}))).subscribe((function(e){t.stateLookupSuggestions=e.contents}))},e.prototype.onStateSearchRequest=function(e){var t=this,n=e.first,o=e.rows,i=e.multiSortMeta,a=e.filterData,r=n/o,c=i,p=this.getStateSearchFields().filter((function(e){var t=e.name;return!!a[t]&&""!==a[t]})).map((function(e){var t=e.name,n=e.type,o=a[t];return"number"==typeof o?t+" eq "+o:n===l.FieldType.Enum?t+" eq '"+o+"'":n===l.FieldType.String?"containing(upper("+t+"), upper('"+o.replace(/'/g,"\\'")+"'))":t+" eq '"+o+"'"})).join(" and "),d=this.stateLookupDisplayFields;this.stateService.list({page:r,sort:c,filterQuery:p,displayFields:d}).pipe(s.takeUntil(this.ngUnsubscribe)).pipe(s.map((function(e){return z(z({},e),{contents:e.contents.map((function(e){return z(z({},e),{label:t.stateLookupDisplayFields.map((function(n){return n.indexOf(".")>0&&(e[n]=t.getProp(e,n)),e[n]})).join(t.stateLookupSeparator)})}))})}))).subscribe((function(e){t.stateSearchGridData=e.contents,t.stateSearchTotalRecords=e.totalElements}))},e.prototype.getStateSearchFields=function(){return[new l.FormField({name:"code",label:this.translate.instant("hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_code_description"),type:l.FieldType.Integer}),new l.FormField({name:"name",label:this.translate.instant("hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_name_description"),type:l.FieldType.String})]},e.prototype.disableFieldsByDocument=function(e,t){switch(e){case"toggleRg":var n=t||this.formGroupToggle.get("toggleRg").value;ne(this.formGroup,n,["rgNumber","rgIssuer","rgIssuerStateId","rgIssueDate"]);break;case"toggleCivilCertificate":n=t||this.formGroupToggle.get("toggleCivilCertificate").value;ne(this.formGroup,n,["civilCertificateType","civilCertificateIssueDate","civilCertificateRegisterNumber","civilCertificateTerm","civilCertificateBook","civilCertificatePage","civilCertificateNotaryOffice","civilCertificateStateId"]);break;case"toggleDeath":n=t||this.formGroupToggle.get("toggleDeath").value;ne(this.formGroup,n,["deathCertificateIssueDate","deathCertificateRegisterNumber","deathCertificateNumber"])}},e.ctorParameters=function(){return[{type:a.TranslateService},{type:d.ActivatedRoute},{type:Rt},{type:Co}]},W([t.Input()],e.prototype,"parentFormGroup",void 0),e=W([t.Component({selector:"fnd-employee-dependent-document-tab",template:'<div class="ui-fluid" [formGroup]="formGroup">\n <p-fieldset>\n <p-header class="toggle-header-fieldset" [formGroup]="formGroupToggle">\n {{ \'hcm_contract.employment_contract.employee_dependent_document_rg_title\' | translate }}\n <div class="ui-inputgroup">\n <div class="input-switch-padding"></div>\n <span *ngIf="formGroupToggle.get(\'toggleRg\').value">\n {{ \'hcm_contract.employment_contract.yes\' | translate }}\n </span>\n <span\n *ngIf="!formGroupToggle.get(\'toggleRg\').value">{{ \'hcm_contract.employment_contract.no\' | translate }}</span>\n <p-inputSwitch id="toggleRg" formControlName="toggleRg" (onChange)="disableFieldsByDocument(\'toggleRg\')"></p-inputSwitch>\n </div>\n </p-header>\n <div class="ui-g">\n <div id="dv-rg-number" class="ui-sm-12 ui-md-4">\n <label id="lb-rg-number" for="ff-rg-number">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_number\' | translate\n }}</label>\n\n <input id="ff-rg-number" type="text" pInputText formControlName="rgNumber" autocomplete="off"/>\n\n <s-control-errors\n id="er-rg-number"\n [control]="formGroup.get(\'rgNumber\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'rgNumber\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Órgão emissor --\x3e\n <div id="dv-rg-issuer" class="ui-sm-12 ui-md-4">\n <label id="lb-rg-issuer" for="ff-rg-issuer">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer\' | translate\n }}</label>\n\n <input id="ff-rg-issuer" type="text" pInputText formControlName="rgIssuer" autocomplete="off"/>\n\n <s-control-errors\n id="er-rg-issuer"\n [control]="formGroup.get(\'rgIssuer\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'rgIssuer\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Estado emissor --\x3e\n <div id="dv-rg-issuer-state-id" class="ui-sm-12 ui-md-4">\n <label id="lb-rg-issuer-state-id" for="ff-rg-issuer-state-id">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_id\'\n | translate\n }}\n </label>\n <s-lookup dataKey="id" id="ff-rg-issuer-state-id" name="rgIssuerStateId"\n formControlName="rgIssuerStateId"\n [searchFields]="stateSearchFields" [searchGridFields]="stateSearchFields"\n [searchGridData]="stateSearchGridData" [multiple]="false"\n [lookupSuggestions]="stateLookupSuggestions"\n (onLookupRequest)="onStateLookupRequest($event)"\n (onSearchRequest)="onStateSearchRequest($event)"\n lookupDisplayField="label"\n [lookupEmptyMessage]="\'hcm_contract.employment_contract.admission_generic_lookup_empty_message\' | translate"\n [searchTotalRecords]="stateSearchTotalRecords"\n [searchTitle]="\'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_id_lookup_tittle\' | translate"\n [searchEmptyTitle]="\'hcm_contract.employment_contract.admission_generic_lookup_empty_message\' | translate"\n [filterLabel]="\'hcm_contract.employment_contract.admission_generic_filter_label\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.admission_generic_filter_title\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.admission_generic_clear_label\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.admission_generic_btn_cancel_label\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.admission_generic_select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_contract.total_records\' | translate: {value: stateSearchTotalRecords}"\n [emptyFieldLabel]="\'hcm_contract.employment_contract.admission_generic_empty_field\' | translate">\n </s-lookup>\n </div>\n\n \x3c!-- Data de emissão --\x3e\n <div id="dv-rg-issue-date" class="ui-sm-12 ui-md-4">\n <label id="lb-rg-issue-date" for="ff-rg-issue-date">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issue_date\' | translate\n }}</label>\n\n <p-calendar\n id="ff-rg-issue-date"\n name="rgIssueDate"\n formControlName="rgIssueDate"\n [dateFormat]="localeConfig?.calendar?.dateFormat"\n [locale]="localeConfig?.calendar"\n [showIcon]="true"\n icon="fa fa-calendar"\n sCalendarMask\n ></p-calendar>\n </div>\n </div>\n </p-fieldset>\n <p-fieldset>\n <p-header class="toggle-header-fieldset" [formGroup]="formGroupToggle">\n {{ \'hcm_contract.employment_contract.employee_dependent_document_civil_certificate_title\' | translate }}\n <div class="ui-inputgroup">\n <div class="input-switch-padding"></div>\n <span\n *ngIf="formGroupToggle.get(\'toggleCivilCertificate\').value">{{ \'hcm_contract.employment_contract.yes\' | translate }}</span>\n <span\n *ngIf="!formGroupToggle.get(\'toggleCivilCertificate\').value">{{ \'hcm_contract.employment_contract.no\' | translate }}</span>\n <p-inputSwitch id="toggleCivilCertificate" formControlName="toggleCivilCertificate" (onChange)="disableFieldsByDocument(\'toggleCivilCertificate\')"></p-inputSwitch>\n </div>\n </p-header>\n <div class="ui-g">\n\n \x3c!-- Tipo de certificado civil --\x3e\n <div id="dv-civil-certificate-type" class="ui-sm-12 ui-md-6 ui-lg-6">\n <label id="lb-civil-certificate-type" for="ff-civilCertificateType">{{\n \'hcm_contract.employment_contract.employee_dependent_civil_certificate_type_placeholder\'\n | translate\n }}</label>\n <p-dropdown inputId="civilCertificateType" id="ff-civilCertificateType" name="maritalStatusType"\n [options]="civilCertificateType"\n formControlName="civilCertificateType"\n placeholder="{{\'hcm_contract.employment_contract.employee_dependent_civil_certificate_type_placeholder\' | translate}}">\n </p-dropdown>\n </div>\n \n \x3c!-- Data de emissão da certidão nascimento --\x3e\n <div id="dv-civil-certificate-issue-date" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-issue-date" for="ff-civil-certificate-issue-date">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_issue_date\' | translate\n }}</label>\n <p-calendar\n id="ff-civil-certificate-issue-date"\n name="civilCertificateIssueDate"\n formControlName="civilCertificateIssueDate"\n [dateFormat]="localeConfig?.calendar.dateFormat"\n [locale]="localeConfig?.calendar"\n [showIcon]="true"\n icon="fa fa-calendar"\n sCalendarMask\n ></p-calendar>\n </div>\n\n \x3c!-- Matrícula da certidão nascimento --\x3e\n <div id="dv-civil-certificate-register-number" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-register-number" for="ff-civil-certificate-register-number">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_register_number\'\n | translate\n }}</label>\n <input\n id="ff-civil-certificate-register-number"\n type="text"\n pInputText\n formControlName="civilCertificateRegisterNumber"\n autocomplete="off"\n />\n <s-control-errors\n id="er-civil-certificate-register-number"\n [control]="formGroup.get(\'civilCertificateRegisterNumber\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'civilCertificateRegisterNumber\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Termo da certidão nascimento --\x3e\n <div id="dv-civil-certificate-term" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-term" for="ff-civil-certificate-term">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_term\' | translate\n }}</label>\n <input id="ff-civil-certificate-term" type="text" pInputText formControlName="civilCertificateTerm"\n autocomplete="off"/>\n <s-control-errors\n id="er-civil-certificate-term"\n [control]="formGroup.get(\'civilCertificateTerm\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'civilCertificateTerm\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Livro da certidão nascimento --\x3e\n <div id="dv-civil-certificate-book" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-book" for="ff-civil-certificate-book">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_book\' | translate\n }}</label>\n <input id="ff-civil-certificate-book" type="text" pInputText formControlName="civilCertificateBook"\n autocomplete="off"/>\n <s-control-errors\n id="er-civil-certificate-book"\n [control]="formGroup.get(\'civilCertificateBook\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'civilCertificateBook\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Folha da certidão nascimento --\x3e\n <div id="dv-civil-certificate-page" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-page" for="ff-civil-certificate-page">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_page\' | translate\n }}</label>\n <input id="ff-civil-certificate-page" type="text" pInputText formControlName="civilCertificatePage"\n autocomplete="off"/>\n <s-control-errors\n id="er-civil-certificate-page"\n [control]="formGroup.get(\'civilCertificatePage\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'civilCertificatePage\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Cartório da certidão nascimento --\x3e\n <div id="dv-civil-certificate-notary-office" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-notary-office" for="ff-civil-certificate-notary-office">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_notary_office\' | translate\n }}</label>\n <input\n id="ff-civil-certificate-notary-office"\n type="text"\n pInputText\n formControlName="civilCertificateNotaryOffice"\n autocomplete="off"\n />\n <s-control-errors\n id="er-civil-certificate-notary-office"\n [control]="formGroup.get(\'civilCertificateNotaryOffice\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'civilCertificateNotaryOffice\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Estado de emissão da certidão nascimento --\x3e\n <div id="dv-civil-certificate-state-id" class="ui-sm-12 ui-md-4">\n <label id="lb-civil-certificate-state-id" for="ff-civil-certificate-state-id"\n >{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_additional_data_civil_certificate_state_id\' | translate\n }}\n </label>\n\n <s-lookup dataKey="id" id="ff-civil-certificate-state-id" name="civilCertificateStateId"\n formControlName="civilCertificateStateId"\n [searchFields]="stateSearchFields" [searchGridFields]="stateSearchFields"\n [searchGridData]="stateSearchGridData" [multiple]="false"\n [lookupSuggestions]="stateLookupSuggestions"\n (onLookupRequest)="onStateLookupRequest($event)"\n (onSearchRequest)="onStateSearchRequest($event)"\n lookupDisplayField="label"\n [lookupEmptyMessage]="\'hcm_contract.employment_contract.admission_generic_lookup_empty_message\' | translate"\n [searchTotalRecords]="stateSearchTotalRecords"\n [searchTitle]="\'hcm_contract.employment_contract.admission_employee_form_sheet_documents_nationality_data_rg_issuer_state_id_lookup_tittle\' | translate"\n [searchEmptyTitle]="\'hcm_contract.employment_contract.admission_generic_lookup_empty_message\' | translate"\n [filterLabel]="\'hcm_contract.employment_contract.admission_generic_filter_label\' | translate"\n [filterTitle]="\'hcm_contract.employment_contract.admission_generic_filter_title\' | translate"\n [clearLabel]="\'hcm_contract.employment_contract.admission_generic_clear_label\' | translate"\n [cancelLabel]="\'hcm_contract.employment_contract.admission_generic_btn_cancel_label\' | translate"\n [selectLabel]="\'hcm_contract.employment_contract.admission_generic_select\' | translate"\n [searchTotalRecordsLabel]="\'hcm_contract.employment_contract.total_records\' | translate: {value: stateSearchTotalRecords}"\n [emptyFieldLabel]="\'hcm_contract.employment_contract.admission_generic_empty_field\' | translate">\n </s-lookup>\n </div>\n </div>\n </p-fieldset>\n <p-fieldset>\n <p-header class="toggle-header-fieldset" [formGroup]="formGroupToggle">\n {{ \'hcm_contract.employment_contract.employee_dependent_document_certificate_death_title\' | translate }}\n <div class="ui-inputgroup">\n <div class="input-switch-padding"></div>\n <span\n *ngIf="formGroupToggle.get(\'toggleDeath\').value">{{ \'hcm_contract.employment_contract.yes\' | translate }}</span>\n <span\n *ngIf="!formGroupToggle.get(\'toggleDeath\').value">{{ \'hcm_contract.employment_contract.no\' | translate }}</span>\n <p-inputSwitch\n id="toggleDeath"\n formControlName="toggleDeath"\n (onChange)="disableFieldsByDocument(\'toggleDeath\')">\n </p-inputSwitch>\n </div>\n </p-header>\n <div class="ui-g">\n \x3c!--- Data da certidão de óbito--\x3e\n <div class="ui-md-4 ui-sm-12">\n <label id="lb-death-date"\n for="ff-death-date">{{ \'hcm_contract.employment_contract.employee_dependent_death_date\' | translate }}</label>\n <p-calendar\n id="ff-death-date"\n name="deathCertificateIssueDate"\n formControlName="deathCertificateIssueDate"\n [dateFormat]="localeConfig?.calendar.dateFormat"\n [locale]="localeConfig?.calendar"\n [showIcon]="true"\n icon="fa fa-calendar"\n sCalendarMask\n ></p-calendar>\n </div>\n \x3c!--- Matricula da certidão de óbito--\x3e\n <div class="ui-md-4 ui-sm-12">\n <label id="lb-death-certificate-registry"\n for="ff-death-certificate-registry">{{ \'hcm_contract.employment_contract.employee_dependent_death_certificate_register\' | translate }}</label>\n <input pInputText id="ff-death-certificate-registry" formControlName="deathCertificateRegisterNumber">\n <s-control-errors\n id="er-death-certificate-registry"\n [control]="formGroup.get(\'deathCertificateRegisterNumber\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'deathCertificateRegisterNumber\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n \x3c!--Nº certidão de óbito--\x3e\n <div class="ui-md-4 ui-sm-12">\n <label id="lb-death-certificate-number"\n for="ff-death-certificate-registry">{{ \'hcm_contract.employment_contract.employee_dependent_death_certificate_number\' | translate }}</label>\n <input pInputText id="ff-death-certificate-number" formControlName="deathCertificateNumber">\n <s-control-errors\n id="er-death-certificate-number"\n [control]="formGroup.get(\'deathCertificateNumber\')"\n [errorMessages]="{\n maxlength: translate.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'deathCertificateNumber\').errors?.maxlength?.requiredLength})\n }"\n ></s-control-errors>\n </div>\n </div>\n </p-fieldset>\n</div>\n',styles:[".tab-view-full{width:100%}.toggle-header-fieldset{display:flex!important;justify-content:space-between!important;align-items:center!important}.toggle-header-fieldset .ui-inputgroup span{margin-right:8px!important;font-size:14px;font-weight:400;line-height:21px;text-align:left;text-underline-position:from-font;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}.footer-sidebar-form-dependent{display:flex;justify-content:space-between}.message-warn-admisison{padding-left:65px;font-size:14px}.message-warn-admisison p:first-of-type{font-weight:700}.btn-next>button{display:flex!important;flex-direction:row-reverse!important}.btn-next>button span{margin-left:5px!important}"]})],e)}(),Ao=function(){function e(){}return e.fromDto=function(e){var t=(null==e?void 0:e.data)&&JSON.parse(e.data);return{draftId:null==e?void 0:e.id,basicDependentPersonData:t.basicDependentPersonData?this.normalizeDraft(t.basicDependentPersonData):{},documentDependentPersonData:t.documentDependentPersonData?this.normalizeDraft(t.documentDependentPersonData):{},complementDependentPersonData:t.complementDependentPersonData?this.normalizeDraft(t.complementDependentPersonData):{}}},e.toDto=function(e,t,n){var o,i,a={};return a.personName=null===(o=null==e?void 0:e.basicDependentPersonData)||void 0===o?void 0:o.fullName,a.kinshipDegreeType=null===(i=null==e?void 0:e.complementDependentPersonData)||void 0===i?void 0:i.kinshipDependentDegreeType,a.employee=t?{id:t}:null,a.admissionDraft=n?{id:n}:null,a.createdDate=a.createdDate&&c(a.createdDate).format(),a.lastModifiedDate=a.lastModifiedDate&&c(a.lastModifiedDate).format(),a.data=JSON.stringify({basicDependentPersonData:e.basicDependentPersonData,documentDependentPersonData:e.documentDependentPersonData,complementDependentPersonData:e.complementDependentPersonData}),a},e.normalizeDraft=function(e){var t=this;return e&&"object"==typeof e?(Object.keys(e).forEach((function(n){var o=e[n];if(""!==o)if("string"==typeof o&&/^\d{4}-\d{2}-\d{2}$/.test(o)){var i=new Date(o+"T00:00:00");e[n]=isNaN(i.getTime())?null:i}else if("string"==typeof o&&/^\d{4}-\d{2}-\d{2}T/.test(o)){i=new Date(o);e[n]=isNaN(i.getTime())?null:i}else o&&"object"==typeof o&&t.normalizeDraft(o);else e[n]=null})),e):e},e}();function wo(e,t){return void 0===t&&(t="DD/MM/YYYY"),c(e,t).toDate()}var Po,Mo=function(){function e(e,t,n,o,i,a,s,l){this.translateService=e,this.employeeDependentService=t,this.sUrlService=n,this.focusService=o,this.dependentDraftService=i,this.route=a,this.confirmationService=s,this.messageService=l,this.loading=!1,this.showSideBar=!1,this.buttonLabel=this.translateService.instant("hcm_contract.employment_contract.employee_dependent_button_next"),this.formGroup=new p.FormGroup({draftId:new p.FormControl(null)}),this.ngUnsubscribe=new r.Subject,this.createSteps()}return e.prototype.ngOnInit=function(){var e=this;this.subscribeEvents(),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.onRouteDataChange=function(e){this.localeConfig=e.localeConfig,this.dateFormat=dn.getDateFormatFromCalendar(e.localeConfig.calendar)},e.prototype.undoStep=function(){if(1===this.activeIndex)this.buttonLabel=this.translateService.instant("hcm_contract.employment_contract.employee_dependent_button_next");else if(0===this.activeIndex)return;this.activeIndex--},e.prototype.nextStep=function(){if(0===this.activeIndex){var e=this.formGroup.get("basicDependentPersonData");if(this.validateAllFormFields(e),!e.valid&&!this.dependentId)return this.steps[1].disabled=!0,this.messageService.add({severity:"error",summary:this.translateService.instant("hcm_contract.employment_contract.error"),detail:this.translateService.instant("hcm_contract.employment_contract.admission_generic_invalid_form_group")});this.steps[1].disabled=!1,this.buttonLabel=this.translateService.instant("hcm_contract.employment_contract.admission_employee_form_btn_step_last"),this.activeIndex++}else if(1===this.activeIndex){if(this.validateAllFormFields(this.formGroup),!this.formGroup.valid){var t=this.requiredFieldsStep1?this.translateService.instant("hcm_contract.employment_contract.admission_generic_invalid_form_group_step_1"):this.translateService.instant("hcm_contract.employment_contract.admission_generic_invalid_form_group");return this.messageService.add({severity:"error",summary:this.translateService.instant("hcm_contract.employment_contract.error"),detail:t})}this.dependentId?this.onBeforeSave():this.onSaveDependent()}},e.prototype.isNew=function(){return!this.dependentId},e.prototype.isNewToLabel=function(){return this.isNew()?"create":"edit"},e.prototype.onStepSelected=function(e){if(0===e.index){var t=this.formGroup.get("complementDependentPersonData");if(!t.valid&&!this.dependentId)return void this.validateAllFormFields(t);this.buttonLabel=this.translateService.instant("hcm_contract.employment_contract.employee_dependent_button_next")}if(1===e.index){var n=this.formGroup.get("basicDependentPersonData");if(!n.valid&&!this.dependentId)return void this.validateAllFormFields(n)}this.activeIndex=e.index},e.prototype.onCancel=function(){this.showSideBar=!1},e.prototype.saveDependentDraft=function(){var e=this;pe(this.formGroup,["basicDependentPersonData.fullName","complementDependentPersonData.kinshipDependentDegreeType"]);var t=this.formGroup.get("basicDependentPersonData.fullName"),n=this.formGroup.get("complementDependentPersonData.kinshipDependentDegreeType");if((0!==this.activeIndex||t.valid)&&(1!==this.activeIndex||n.valid)){if(t.valid&&0===this.activeIndex)return this.buttonLabel=this.translateService.instant("hcm_contract.employment_contract.admission_employee_form_btn_step_last"),this.activeIndex++;this.loading=!0,this.getSaveObservable().pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){e.formGroup.get("draftId").setValue(null==t?void 0:t.id),e.messageService.add({severity:"success",summary:e.translateService.instant("hcm_contract.employment_contract.admission_generic_toast_success"),detail:e.translateService.instant("hcm_contract.employment_contract.admission_draft_employee_form_save_sucess")}),e.showSideBar=!1,e.closeSideBar.emit(!0)}))}},e.prototype.subscribeEvents=function(){var e=this;this.employeeDependentService.getOpenSideBarAndStartForm().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){e.activeIndex=0,e.buttonLabel=e.translateService.instant("hcm_contract.employment_contract.employee_dependent_button_next"),e.dependentId=null==t?void 0:t.dependentId,e.personId=null==t?void 0:t.personId,e.formGroup.reset(),(null==t?void 0:t.dependentId)||t.dependentDraftId?(null==t?void 0:t.personId)&&!t.dependentDraftId?(e.personRetrieveInformation(),e.steps[0].disabled=!1,e.steps[1].disabled=!1):(null==t?void 0:t.dependentDraftId)&&e.loadDraft(t.dependentDraftId):(e.steps[1].disabled=!0,e.formGroup.enable(),t.personId&&e.personRetrieveInformation()),e.showSideBar=!0})),this.onSaveByListDraft()},e.prototype.createSteps=function(){var e={id:"personal-data-step",label:this.translateService.instant("hcm_contract.employment_contract.employee_dependent_sidebar_step_personal_data"),disabled:!1,state:l.StepState.Default},t={id:"personal-data-step",label:this.translateService.instant("hcm_contract.employment_contract.employee_dependent_sidebar_step_complement_data"),disabled:!this.personId,state:l.StepState.Default};this.translateService.instant("hcm_contract.employment_contract.employee_dependent_sidebar_step_payroll_data"),l.StepState.Default;this.steps=[e,t],this.activeIndex=0},e.prototype.personRetrieveInformation=function(){var e=this;this.loading=!0,this.employeeDependentService.personRetrieve({id:this.personId}).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){return e.loading=!1}))).subscribe((function(t){var n=function(e,t,n){var o,i,a,r,s,l,p,d,m,u,h,y,f,_,v,g,b,S,D,T,F,E,C,k,I,R,L,A,w,P,M,G,V,N,x,O,B,H,q,U,j,Y,W,Q,X,K,$,J=z({},e);return{employee:{id:t},personDependentData:{basicDependentPersonData:{cpf:J.personalData.cpf||null,fullName:J.basicData.fullName,nickname:J.basicData.nickname||null,genderType:J.basicData.genderType,birthDate:(null===(o=J.basicData)||void 0===o?void 0:o.birthDate)&&c(null===(i=J.basicData)||void 0===i?void 0:i.birthDate).format(n),email:Array.isArray(null===(a=J.emailData)||void 0===a?void 0:a.email)?J.emailData.email.join(", "):(null===(r=J.emailData)||void 0===r?void 0:r.email)||null},complementDependentPersonData:{kinshipDependentDegreeType:(null===(s=null==J?void 0:J.basicData)||void 0===s?void 0:s.kinshipDependentDegreeType)||null,kinshipDegreeType:J.basicData.kinshipDegreeType1,kinshipDegreeType2:J.basicData.kinshipDegreeType2,maritalStatusType:(null===(l=J.complementData)||void 0===l?void 0:l.maritalStatusType)||null,religion:(null===(p=J.complementData)||void 0===p?void 0:p.religion)||null,number:(null===(d=J.phoneData)||void 0===d?void 0:d.number)||null,raceType:(null===(m=J.complementData)||void 0===m?void 0:m.raceType)||null,degreeOfEducationType:(null===(u=J.complementData)||void 0===u?void 0:u.degreeOfEducationType)||null,nameFiliation1:J.basicData.parentName1||null,nameFiliation2:J.basicData.parentName2||null,nacionality:(null===(h=null==J?void 0:J.complementData)||void 0===h?void 0:h.nationality)?z(z({},null===(y=null==J?void 0:J.complementData)||void 0===y?void 0:y.nationality),{id:null===(_=null===(f=null==J?void 0:J.complementData)||void 0===f?void 0:f.nationality)||void 0===_?void 0:_.countryId,label:(null===(g=null===(v=null==J?void 0:J.complementData)||void 0===v?void 0:v.nationality)||void 0===g?void 0:g.countryCode)+" - "+(null===(S=null===(b=null==J?void 0:J.complementData)||void 0===b?void 0:b.nationality)||void 0===S?void 0:S.countryName)}):{}},documentDependentPersonData:{rgNumber:(null===(D=J.nationalityData)||void 0===D?void 0:D.rgNumber)||null,rgIssuer:(null===(T=J.nationalityData)||void 0===T?void 0:T.rgIssuer)||null,rgIssuerStateId:(null===(F=J.nationalityData)||void 0===F?void 0:F.rgIssuerState)?z(z({},null===(C=null===(E=J.nationalityData)||void 0===E?void 0:E.rgIssuerState)||void 0===C?void 0:C.value),{id:null===(I=null===(k=J.nationalityData)||void 0===k?void 0:k.rgIssuerState)||void 0===I?void 0:I.key,label:null===(L=null===(R=J.nationalityData)||void 0===R?void 0:R.rgIssuerState)||void 0===L?void 0:L.value}):{},rgIssueDate:(null===(A=J.nationalityData)||void 0===A?void 0:A.rgIssueDate)&&c(null===(w=J.nationalityData)||void 0===w?void 0:w.rgIssueDate).format("L"),civilCertificateType:(null===(P=J.additionalData)||void 0===P?void 0:P.civilCertificateType)||"",civilCertificateIssueDate:(null===(M=J.additionalData)||void 0===M?void 0:M.civilCertificateIssueDate)&&c(null===(G=J.additionalData)||void 0===G?void 0:G.civilCertificateIssueDate).format("L"),civilCertificateRegisterNumber:(null===(V=J.additionalData)||void 0===V?void 0:V.civilCertificateRegisterNumber)||"",civilCertificateTerm:(null===(N=J.additionalData)||void 0===N?void 0:N.civilCertificateTerm)||"",civilCertificateBook:(null===(x=J.additionalData)||void 0===x?void 0:x.civilCertificateBook)||"",civilCertificatePage:(null===(O=J.additionalData)||void 0===O?void 0:O.civilCertificatePage)||"",civilCertificateNotaryOffice:(null===(B=J.additionalData)||void 0===B?void 0:B.civilCertificateNotaryOffice)||"",civilCertificateStateId:(null===(H=J.additionalData)||void 0===H?void 0:H.civilCertificateState)?z(z({},null===(q=J.additionalData)||void 0===q?void 0:q.civilCertificateState),{id:null===(j=null===(U=J.additionalData)||void 0===U?void 0:U.civilCertificateState)||void 0===j?void 0:j.key,label:null===(W=null===(Y=J.additionalData)||void 0===Y?void 0:Y.civilCertificateState)||void 0===W?void 0:W.value}):{},deathCertificateIssueDate:(null===(Q=J.additionalData)||void 0===Q?void 0:Q.deathCertificateIssueDate)&&c(null===(X=J.additionalData)||void 0===X?void 0:X.deathCertificateIssueDate).format("L"),deathCertificateRegisterNumber:(null===(K=J.additionalData)||void 0===K?void 0:K.deathCertificateRegisterNumber)||"",deathCertificateNumber:(null===($=J.additionalData)||void 0===$?void 0:$.deathCertificateNumber)||""}}}}(t,e.employeeId,e.dateFormat);e.loadedDependent=z({},n),e.employeeDependentService.setDependentFormData(n)}))},e.prototype.onSaveDependent=function(){var e=this;this.loading=!0;var t,n,o,i,a,r,l,p,d,m,u,h,y,f,_,v,g,b,S,D,T,F,E,C,k,I,R,L,A,w,P,M,G,V,N,x,O,B,H,q,U,j,Y,z,W,Q,X,K,$,J=(t=this.formGroup.getRawValue(),n=this.employeeId,o=this.dependentId,i=this.personId,a=this.dateFormat,{id:o,employee:{id:n},personDependentData:{basicDependentPersonData:{personId:i||null,cpf:(null===(r=null==t?void 0:t.basicDependentPersonData)||void 0===r?void 0:r.cpf)||"",fullName:(null===(l=null==t?void 0:t.basicDependentPersonData)||void 0===l?void 0:l.fullName)||"",nickname:(null===(p=null==t?void 0:t.basicDependentPersonData)||void 0===p?void 0:p.nickname)||"",genderType:(null===(d=null==t?void 0:t.basicDependentPersonData)||void 0===d?void 0:d.genderType)||null,birthDate:(null===(m=null==t?void 0:t.basicDependentPersonData)||void 0===m?void 0:m.birthDate)?c(wo(null===(u=null==t?void 0:t.basicDependentPersonData)||void 0===u?void 0:u.birthDate,a)).format("YYYY-MM-DD"):null,email:Array.isArray(null===(h=null==t?void 0:t.basicDependentPersonData)||void 0===h?void 0:h.email)?t.basicDependentPersonData.email.join(", "):(null===(y=null==t?void 0:t.basicDependentPersonData)||void 0===y?void 0:y.email)||"",kinshipDependentDegreeType:(null===(f=null==t?void 0:t.complementDependentPersonData)||void 0===f?void 0:f.kinshipDependentDegreeType)||null,kinshipDegreeType:(null===(_=null==t?void 0:t.complementDependentPersonData)||void 0===_?void 0:_.kinshipDegreeType)||null,kinshipDegreeType2:(null===(v=null==t?void 0:t.complementDependentPersonData)||void 0===v?void 0:v.kinshipDegreeType2)||null,maritalStatusType:(null===(g=null==t?void 0:t.complementDependentPersonData)||void 0===g?void 0:g.maritalStatusType)||null,religion:(null===(b=null==t?void 0:t.complementDependentPersonData)||void 0===b?void 0:b.religion)||"",number:(null===(S=null==t?void 0:t.complementDependentPersonData)||void 0===S?void 0:S.number)||"",raceType:(null===(D=null==t?void 0:t.complementDependentPersonData)||void 0===D?void 0:D.raceType)||null,degreeOfEducationType:(null===(T=null==t?void 0:t.complementDependentPersonData)||void 0===T?void 0:T.degreeOfEducationType)||null,nameFiliation1:(null===(F=null==t?void 0:t.complementDependentPersonData)||void 0===F?void 0:F.nameFiliation1)||"",nameFiliation2:(null===(E=null==t?void 0:t.complementDependentPersonData)||void 0===E?void 0:E.nameFiliation2)||"",nacionality:(null===(k=null===(C=null==t?void 0:t.complementDependentPersonData)||void 0===C?void 0:C.nacionality)||void 0===k?void 0:k.id)||null},documentDependentPersonData:{rgNumber:(null===(I=null==t?void 0:t.documentDependentPersonData)||void 0===I?void 0:I.rgNumber)||"",rgIssuer:(null===(R=null==t?void 0:t.documentDependentPersonData)||void 0===R?void 0:R.rgIssuer)||"",rgIssuerStateId:(null===(A=null===(L=null==t?void 0:t.documentDependentPersonData)||void 0===L?void 0:L.rgIssuerStateId)||void 0===A?void 0:A.id)||(null===(P=null===(w=null==t?void 0:t.documentDependentPersonData)||void 0===w?void 0:w.rgIssuerStateId)||void 0===P?void 0:P.key)||null,rgIssueDate:(null===(M=null==t?void 0:t.documentDependentPersonData)||void 0===M?void 0:M.rgIssueDate)?c(wo(null===(G=null==t?void 0:t.documentDependentPersonData)||void 0===G?void 0:G.rgIssueDate,a)).format("YYYY-MM-DD"):null,civilCertificateType:(null===(V=null==t?void 0:t.documentDependentPersonData)||void 0===V?void 0:V.civilCertificateType)||null,civilCertificateIssueDate:(null===(N=null==t?void 0:t.documentDependentPersonData)||void 0===N?void 0:N.civilCertificateIssueDate)?c(wo(null===(x=null==t?void 0:t.documentDependentPersonData)||void 0===x?void 0:x.civilCertificateIssueDate,a)).format("YYYY-MM-DD"):null,civilCertificateRegisterNumber:(null===(O=null==t?void 0:t.documentDependentPersonData)||void 0===O?void 0:O.civilCertificateRegisterNumber)||"",civilCertificateTerm:(null===(B=null==t?void 0:t.documentDependentPersonData)||void 0===B?void 0:B.civilCertificateTerm)||"",civilCertificateBook:(null===(H=null==t?void 0:t.documentDependentPersonData)||void 0===H?void 0:H.civilCertificateBook)||"",civilCertificatePage:(null===(q=null==t?void 0:t.documentDependentPersonData)||void 0===q?void 0:q.civilCertificatePage)||"",civilCertificateNotaryOffice:(null===(U=null==t?void 0:t.documentDependentPersonData)||void 0===U?void 0:U.civilCertificateNotaryOffice)||"",civilCertificateStateId:(null===(Y=null===(j=null==t?void 0:t.documentDependentPersonData)||void 0===j?void 0:j.civilCertificateStateId)||void 0===Y?void 0:Y.id)||(null===(W=null===(z=null==t?void 0:t.documentDependentPersonData)||void 0===z?void 0:z.civilCertificateStateId)||void 0===W?void 0:W.key)||null,deathCertificateIssueDate:(null===(Q=null==t?void 0:t.documentDependentPersonData)||void 0===Q?void 0:Q.deathCertificateIssueDate)?c(wo(null===(X=null==t?void 0:t.documentDependentPersonData)||void 0===X?void 0:X.deathCertificateIssueDate,a)).format("YYYY-MM-DD"):null,deathCertificateRegisterNumber:(null===(K=null==t?void 0:t.documentDependentPersonData)||void 0===K?void 0:K.deathCertificateRegisterNumber)||"",deathCertificateNumber:(null===($=null==t?void 0:t.documentDependentPersonData)||void 0===$?void 0:$.deathCertificateNumber)||""}}});this.employeeDependentService.employeeDpendentSave(J).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){e.loading=!1}))).subscribe((function(t){var n,o=null===(n=e.formGroup.get("draftId"))||void 0===n?void 0:n.value;(null==t?void 0:t.id)&&(e.addMessageSucess(),e.showSideBar=!1,e.closeSideBar.emit(!0),o&&e.deleteDraft(o))}))},e.prototype.deleteDraft=function(e){var t=this;this.loading=!0,this.dependentDraftService.delete(e).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){t.loading=!1}))).subscribe((function(){t.closeSideBar.emit(!0)}))},e.prototype.addMessageSucess=function(){this.messageService.add({severity:"success",summary:this.translateService.instant("hcm_contract.employment_contract.success_tooltip"),detail:this.translateService.instant("hcm_contract.employment_contract.employee_dependent_save_success")})},e.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)})),this.focusService.focusFirstInvalidInput()},e.prototype.requiredFieldsStep1=function(){var e,t,n,o;return(null===(e=this.formGroup.get("basicDependentPersonData.fullName"))||void 0===e?void 0:e.value)&&(null===(t=this.formGroup.get("basicDependentPersonData.birthDate"))||void 0===t?void 0:t.value)&&(null===(n=this.formGroup.get("basicDependentPersonData.genderType"))||void 0===n?void 0:n.value)&&(null===(o=this.formGroup.get("basicDependentPersonData.cpf"))||void 0===o?void 0:o.value)},e.prototype.isFormChanged=function(e,t){if(!(null==e?void 0:e.personDependentData)||!t)return!1;return["basicDependentPersonData","complementDependentPersonData","documentDependentPersonData"].some((function(n){return Object.keys(e.personDependentData[n]||{}).some((function(o){var i,a,r;return(null!==(i=e.personDependentData[n][o])&&void 0!==i?i:"")!==(null!==(r=null===(a=t[n])||void 0===a?void 0:a[o])&&void 0!==r?r:"")}))}))},e.prototype.onBeforeSave=function(){var e=this;if(!this.formGroup.dirty||!this.isFormChanged(this.loadedDependent,this.formGroup.getRawValue()))return this.closeSidebarWithSuccess();var t=this.translateService.instant("hcm_contract.employment_contract.admission_employee_form_dialog_text_person")+"\n"+this.translateService.instant("hcm_contract.employment_contract.admission_employee_form_dialog_confirmation");this.confirmationService.confirm({message:t,key:"edit-dependent",rejectLabel:this.translateService.instant("hcm_contract.employment_contract.admission_generic_no"),acceptLabel:this.translateService.instant("hcm_contract.employment_contract.admission_generic_yes"),header:this.translateService.instant("hcm_contract.employment_contract.admission_employee_form_dialog_title"),accept:function(){return e.onSaveDependent()}})},e.prototype.closeSidebarWithSuccess=function(){this.showSideBar=!1,this.closeSideBar.emit(!0),this.addMessageSucess()},e.prototype.loadDraft=function(e){var t=this;this.loading=!0,this.dependentDraftService.get(e).pipe(s.takeUntil(this.ngUnsubscribe),s.finalize((function(){t.loading=!1}))).subscribe((function(n){var o,i=Ao.fromDto(n);t.formGroup.patchValue(i),null===(o=t.formGroup.get("draftId"))||void 0===o||o.setValue(e)}))},e.prototype.getSaveObservable=function(){var e,t=this.formGroup.getRawValue(),n=Ao.toDto(t,this.employeeId,this.admissionDraft),o=null===(e=this.formGroup.get("draftId"))||void 0===e?void 0:e.value;return o?this.dependentDraftService.update(o,n):this.dependentDraftService.insert(n)},e.prototype.onSaveByListDraft=function(){var e=this;this.dependentDraftService.saveDraftEvent.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){if(t){e.loading=!0;var n=Ao.fromDto(t);e.formGroup.patchValue(n),e.onSaveDependent()}}))},e.ctorParameters=function(){return[{type:a.TranslateService},{type:Rt},{type:q.SUrlService},{type:_n},{type:Fo},{type:d.ActivatedRoute},{type:i.ConfirmationService},{type:i.MessageService}]},W([t.Input()],e.prototype,"employeeId",void 0),W([t.Input()],e.prototype,"admissionDraft",void 0),W([t.Input()],e.prototype,"closeSideBar",void 0),e=W([t.Component({selector:"fnd-employee-dependent-form",template:'<s-loading-state [loading]="loading" blockWindow="true"></s-loading-state>\n<s-sidebar [visible]="showSideBar"\n (visibleChange)="showSideBar = !showSideBar"\n [header]="\'hcm_contract.employment_contract.employee_dependent_sidebar_title_\' + isNewToLabel() | translate">\n\n <s-steps [steps]="steps" [activeIndex]="activeIndex" (stepSelected)="onStepSelected($event)"></s-steps>\n <form [formGroup]="formGroup" >\n <div class="ui-fluid">\n \x3c!-- Dados pessoais --\x3e\n <fnd-employee-dependent-personal-step [hidden]="activeIndex !== 0"\n [parentFormGroup]="formGroup"></fnd-employee-dependent-personal-step>\n \x3c!-- Dados complementaris --\x3e\n <fnd-employee-dependent-complement-step [hidden]="activeIndex !== 1"\n [parentFormGroup]="formGroup"></fnd-employee-dependent-complement-step>\n\n </div>\n </form>\n <s-footer class="footer-sidebar-form-dependent">\n <s-button (click)="onCancel()" priority="link" style="margin-right: auto"\n [label]="\'hcm_contract.employment_contract.cancel\' | translate"\n ></s-button>\n <div class="footer-end">\n <s-button priority="secondary"\n *ngIf="activeIndex !== 0"\n iconClass="fa fa-arrow-left"\n (onClick)="undoStep()"\n [disabled]="activeIndex === 0"\n [label]="\'hcm_contract.employment_contract.employee_dependent_button_back\' | translate">\n </s-button>\n <s-button id="btn-draft"\n label="{{ \'hcm_contract.employment_contract.btn_dependent_save_draft\' | translate }}"\n priority="secondary"(click)="saveDependentDraft()" [auxiliary]="false"\n [disabled]="loading"></s-button>\n <s-button\n *ngIf="employeeId"\n class="btn-next"\n [rightIconClass]="!activeIndex ? \'fa fa-arrow-right\' : \'\'"\n (onClick)="nextStep()"\n [disabled]="loading"\n [label]="this.buttonLabel">\n </s-button>\n </div>\n </s-footer>\n</s-sidebar>\n<p-confirmDialog key="edit-dependent"></p-confirmDialog>\n',styles:[".tab-view-full{width:100%}.toggle-header-fieldset{display:flex!important;justify-content:space-between!important;align-items:center!important}.toggle-header-fieldset .ui-inputgroup span{margin-right:8px!important;font-size:14px;font-weight:400;line-height:21px;text-align:left;text-underline-position:from-font;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}.footer-sidebar-form-dependent{display:flex;justify-content:space-between}.message-warn-admisison{padding-left:65px;font-size:14px}.message-warn-admisison p:first-of-type{font-weight:700}.btn-next>button{display:flex!important;flex-direction:row-reverse!important}.btn-next>button span{margin-left:5px!important}"]})],e)}();!function(e){e.VF="VF",e.VM="VM"}(Po||(Po={}));var Go=c,Vo=function(){function e(e,t,n,o){var i=this;this.translateService=e,this.route=t,this.formBuilder=n,this.service=o,this.maxlength=80,this.emailMax=500,this.localeConfig={},this.ngUnsubscribe=new r.Subject,this.genderType=Object.keys(Po).map((function(e){return{label:i.translateService.instant("hcm_contract.employment_contract.employee_dependent_gender_type_"+e),value:e}}))}return e.prototype.ngOnInit=function(){var e=this;this.createFormGroup(),this.parentFormGroup.addControl("basicDependentPersonData",this.formGroup),this.route.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.subscribeEvents()},e.prototype.createFormGroup=function(){this.formGroup=this.formBuilder.group({birthDate:this.formBuilder.control({value:null,disabled:!1},[p.Validators.required,this.validateBirthDateIsAfterNow()]),cpf:this.formBuilder.control({value:null,disabled:!1},[p.Validators.required,oo.isValidCpf()]),fullName:this.formBuilder.control({value:null,disabled:!1},p.Validators.compose([p.Validators.required,p.Validators.maxLength(this.maxlength)])),email:this.formBuilder.control({value:null,disabled:null},p.Validators.compose([p.Validators.maxLength(this.emailMax),this.validatorEmailsList()])),genderType:this.formBuilder.control({value:null,disabled:!1},p.Validators.required),nickname:this.formBuilder.control({value:null,disabled:!1},p.Validators.maxLength(this.maxlength))})},e.prototype.validateBirthDateIsAfterNow=function(){return function(e){if(e.value&&Go(e.value).isAfter(Go()))return{birthDateIsAfter:!0};return null}},e.prototype.subscribeEvents=function(){var e=this;this.service.getDependentFormData().pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){var n;e.formGroup.patchValue(null===(n=null==t?void 0:t.personDependentData)||void 0===n?void 0:n.basicDependentPersonData)}))},e.prototype.onRouteDataChange=function(e){this.localeConfig=e.localeConfig},e.prototype.validatorEmailsList=function(){return function(e){return e.value&&!/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e.value)?{email:!0}:null}},e.ctorParameters=function(){return[{type:a.TranslateService},{type:d.ActivatedRoute},{type:p.FormBuilder},{type:Rt}]},W([t.Input()],e.prototype,"parentFormGroup",void 0),e=W([t.Component({selector:"fnd-employee-dependent-personal-step",template:'<div class="ui-fluid " [formGroup]="formGroup">\n <div class="ui-g">\n <div class="ui-md-12">\n <h3>{{\'hcm_contract.employment_contract.employee_dependent_personal_data_title\' | translate}}</h3>\n </div>\n \x3c!-- CPF --\x3e\n <div id="dv-cpf" class="ui-sm-12 ui-md-6 ui-lg-6 ui-xl-6 required">\n <label id="lb-cpf" for="ff-cpf">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_documents_personal_data_cpf\' | translate\n }}</label>\n <p-inputMask id="ff-cpf" formControlName="cpf" mask="999.999.999-99" [unmask]="true"></p-inputMask>\n <s-control-errors\n id="er-cpf"\n [control]="formGroup.get(\'cpf\')"\n [errorMessages]="{\n cpfNotValid: \'hcm_contract.employment_contract.employee_dependent_error_invalid\' | translate,\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Nome Completo --\x3e\n <div id="dv-fullname" class="ui-sm-12 ui-md-12 ui-lg-12 required">\n <label id="lb-fullname" for="ff-fullname">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_full_name\' | translate\n }}</label>\n\n <input\n id="ff-fullName"\n type="text" pInputText\n formControlName="fullName"\n autocomplete="off"\n />\n\n <s-control-errors\n id="er-full-name"\n [control]="formGroup.get(\'fullName\')"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate,\n maxlength: translateService.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'fullName\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n \x3c!-- Apelido --\x3e\n <div id="dv-nickname" class="ui-sm-12 ui-md-12 ui-lg-12">\n <label id="lb-nickname" for="ff-nickname">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_nickname\' | translate\n }}</label>\n\n <input id="ff-nickname" type="text" pInputText formControlName="nickname" autocomplete="off"/>\n\n <s-control-errors\n id="er-nickname"\n [control]="formGroup.get(\'nickname\')"\n [errorMessages]="{\n maxlength: translateService.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'nickname\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n \x3c!-- Sexo --\x3e\n <div class="ui-g-12 ui-md-6 required">\n <label for="genderType">{{"hcm_contract.employment_contract.employee_dependent_gender_label" |\n translate}}</label>\n <p-dropdown inputId="genderType" id="genderType" name="genderType" [options]="genderType"\n formControlName="genderType"\n placeholder="{{\n \'hcm_contract.employment_contract.employee_dependent_gender_type_placeholder\'\n | translate}}">\n </p-dropdown>\n <s-control-errors\n id="er-gender-type"\n [control]="formGroup.get(\'genderType\')"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate\n }"\n ></s-control-errors>\n </div>\n \x3c!-- Nascimento --\x3e\n <div id="dv-birth-date" class="ui-sm-12 ui-md-6 required">\n <label id="lb-birth-date" for="ff-birth-date">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_basic_data_birth_date\' | translate\n }}</label>\n\n <p-calendar\n id="ff-birth-date"\n name="birthDate"\n formControlName="birthDate"\n [dateFormat]="localeConfig?.calendar?.dateFormat"\n [locale]="localeConfig?.calendar"\n [showIcon]="true"\n icon="fa fa-calendar"\n sCalendarMask\n ></p-calendar>\n <s-control-errors\n id="er-hire-date"\n [control]="formGroup.get(\'birthDate\')"\n [errorMessages]="{\n birthDateIsAfter:\n \'hcm_contract.employment_contract.employee_dependent_error_date_must_be_today_or_later\'\n | translate,\n required:\n \'hcm_contract.employment_contract.admission_generic_field_validator_required\'\n | translate\n }"\n ></s-control-errors>\n </div>\n \x3c!-- E-mail --\x3e\n <div id="dv-email" class="ui-sm-12 ui-md-12">\n <label id="lb-email" for="ff-email">{{\n \'hcm_contract.employment_contract.admission_employee_form_sheet_person_email_data_email\' | translate\n }}</label>\n\n <input id="ff-email" type="text" pInputText formControlName="email" autocomplete="off" />\n\n <s-control-errors\n id="er-email"\n [control]="formGroup.get(\'email\')"\n [errorMessages]="{\n email: translateService.instant(\'hcm_contract.employment_contract.employee_dependent_email_invalid\'),\n maxlength: translateService.instant(\'hcm_contract.employment_contract.admission_generic_field_validator_max_length\', {\n value: formGroup.get(\'email\').errors?.maxlength?.requiredLength\n })\n }"\n ></s-control-errors>\n </div>\n\n </div>\n</div>\n'})],e)}(),No=c,xo=function(){function e(e,n,o,i,a,s,l){this.activatedRoute=e,this.paginatorStorageService=n,this.dependentDraftService=o,this.translate=i,this.router=a,this.confirmationService=s,this.messageService=l,this.isLoading=!1,this.allPermissions={},this.currentListParams={page:0,size:10,sort:[]},this.permissions={},this.closeSideBar=new t.EventEmitter,this.addButtonClicked=new t.EventEmitter,this.onEdit=new t.EventEmitter,this.ngUnsubscribe=new r.Subject}return e.prototype.ngOnInit=function(){var e=this;this.gridColumns=this.getGridColumns(),this.activatedRoute.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.closeSideBar.pipe(s.takeUntil(this.ngUnsubscribe),s.filter((function(e){return!!e}))).subscribe((function(){e.updateGrid()}))},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.onRouteDataChange=function(e){var t;this.allPermissions=e.allPermissions,this.permissions=null===(t=e.allPermissions)||void 0===t?void 0:t.dependentDraft},e.prototype.getActions=function(e){var t=this;return[{id:"1",label:this.translate.instant("hcm_contract.employment_contract.admission_generic_edit"),visible:this.permissions.editar,command:function(){t.onEdit.emit(null==e?void 0:e.id)}},{id:"2",visible:this.permissions.excluir,label:this.translate.instant("hcm_contract.employment_contract.logical_delete"),command:function(){return t.onDelete(e.id)}},{id:"3",visible:!!this._employeeId,label:this.translate.instant("hcm_contract.employment_contract.dependent_draft_effect_data"),command:function(){t.dependentDraftService.saveDraftEvent.next(e)}}]},e.prototype.onDelete=function(e){var t=this;this.confirmationService.confirm({header:this.translate.instant("hcm_contract.employment_contract.draft_delete_confirmation_message"),message:this.translate.instant("hcm_contract.employment_contract.admission_delete_confirmation_message"),acceptLabel:this.translate.instant("hcm_contract.employment_contract.admission_generic_yes"),rejectLabel:this.translate.instant("hcm_contract.employment_contract.admission_generic_no"),accept:function(){t.isLoading=!0,t.dependentDraftService.delete(e).pipe(s.takeUntil(t.ngUnsubscribe),s.finalize((function(){t.isLoading=!1,t.resetGrid()}))).subscribe((function(){t.messageService.add({severity:"success",summary:t.translate.instant("hcm_contract.employment_contract.deleted_message_title"),detail:t.translate.instant("hcm_contract.employment_contract.deleted_message_content")})}))}})},e.prototype.getSortField=function(){return this.currentListParams.sort},e.prototype.getPageSize=function(){return this.currentListParams.size},e.prototype.getRowIndex=function(){return this.currentListParams.page*this.currentListParams.size},e.prototype.formatDate=function(e){return No(e).format(this.dateFormat)},e.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,o=e.multiSortMeta;return(10!==t||0!==n||(null==o?void 0:o.length)>0)&&this.paginatorStorageService.storePaginator("DependentDraftListComponentPaginator",{page:n,size:t,sort:o}),this.updateGrid({page:n,size:t,sort:o})},e.prototype.resetGrid=function(e){e&&(this.currentListParams=z(z({},this.currentListParams),e)),this.currentListParams=z(z({},this.currentListParams),{page:0,sort:[]}),this.table.reset()},e.prototype.getGridColumns=function(){return[{field:"personName",header:this.translate.instant("hcm_contract.employment_contract.e_001_pes_nom_pes")},{field:"kinshipDegreeType",header:this.translate.instant("hcm_contract.employment_contract.employee_dependent_list_kinship")}]},e.prototype.updateGrid=function(e){var t=this;if(void 0===e&&(e={}),this._admissionDraftId||this._employeeId){this.isLoading=!0,this.currentListParams=z(z({},this.currentListParams),e);var n=this.currentListParams,o=n.page,i=n.size,a=this.currentListParams.sort;a||(a=[{field:"lastModifiedDate",order:-1}]);var r=this._employeeId?"(employee.id eq '"+this._employeeId+"')":this._admissionDraftId?"(admissionDraft.id eq '"+this._admissionDraftId+"')":null;r&&this.dependentDraftService.list({page:o,size:i,sort:a,filterQuery:r,displayFields:["*"]}).pipe(s.takeUntil(this.ngUnsubscribe),s.debounceTime(500),s.distinctUntilChanged(),s.finalize((function(){t.isLoading=!1}))).subscribe((function(e){t.gridData=e.contents,t.totalRecords=e.totalElements}))}},e.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},Object.defineProperty(e.prototype,"employeeId",{set:function(e){this._employeeId=e,this.updateGrid()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"admissionDraftId",{set:function(e){this._admissionDraftId=e,this.updateGrid()},enumerable:!0,configurable:!0}),e.ctorParameters=function(){return[{type:d.ActivatedRoute},{type:Cn},{type:Fo},{type:a.TranslateService},{type:d.Router},{type:i.ConfirmationService},{type:i.MessageService}]},W([t.Input()],e.prototype,"closeSideBar",void 0),W([t.Output()],e.prototype,"addButtonClicked",void 0),W([t.Output()],e.prototype,"onEdit",void 0),W([t.ViewChild("dependentDraftTable")],e.prototype,"table",void 0),W([t.Input()],e.prototype,"employeeId",null),W([t.Input()],e.prototype,"admissionDraftId",null),e=W([t.Component({selector:"app-dependent-list-draft",template:'<s-loading-state [loading]="isLoading" blockWindow="true"></s-loading-state>\n<div class="ui-g" *ngIf="gridData?.length">\n <div class="ui-g-12">\n <button id="add-button-draft" type="button" pButton\n [label]="\'hcm_contract.employment_contract.add_employee_dependent\' | translate"\n title="{{\'hcm_contract.employment_contract.add_employee_dependent\' | translate}} (Alt + Shift + N)"\n *ngIf="permissions.incluir" (click)="addButtonClicked.emit()"></button>\n </div>\n</div>\n<s-empty-state *ngIf="!gridData?.length"\n [title]="\'hcm_contract.employment_contract.employee_dependent_empty_state_title\' | translate"\n [showPrimaryAction]="this.permissions.incluir"\n [primaryActionLabel]="\'hcm_contract.employment_contract.add_employee_dependent\' | translate"\n (primaryAction)="addButtonClicked.emit()"\n [description]="\'hcm_contract.employment_contract.employee_dependent_empty_state_description\' | translate"\n>\n</s-empty-state>\n<div [attr.data-hidden]="!gridData?.length">\n\n <p-table #dependentDraftTable [value]="gridData" [columns]="gridColumns" dataKey="id" [lazy]="true"\n [scrollable]="true" [resizableColumns]="true" sortMode="multiple" [paginator]="true"\n [totalRecords]="totalRecords" [multiSortMeta]="getSortField()" [first]="getRowIndex()"\n [rows]="getPageSize()" [rowsPerPageOptions]="[10, 20, 50, 100]"\n (onLazyLoad)="onGridChange($event)">\n <ng-template pTemplate="colgroup" let-columns>\n <colgroup>\n <col *ngFor="let col of columns">\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns>\n <tr>\n <th id="th-randon" *ngFor="let col of columns" [pSortableColumn]="col.field"\n pResizableColumn>\n <div class="senior-header">\n <span class="senior-header-title">{{ col.header }}</span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n <th pResizableColumn scope="col" *ngIf="this.permissions.excluir">\n <div class="senior-header">\n <span class="senior-header-title">{{\n \'hcm_contract.employment_contract.actions\' |\n translate\n }}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate="body" let-rowData let-columns>\n <tr [pSelectableRow]="rowData">\n <td>\n <span>{{ rowData?.personName }}</span>\n </td><td>\n <div [ngSwitch]="getProp(rowData, \'kinshipDegreeType\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate)">\n <span *ngSwitchCase="\'SON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SON" | translate}}</span>\n <span *ngSwitchCase="\'SPOUSE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SPOUSE" | translate}}</span>\n <span *ngSwitchCase="\'FATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER" | translate}}</span>\n <span *ngSwitchCase="\'GRANDFATHER_GRANDMOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GRANDFATHER_GRANDMOTHER" | translate}}</span>\n <span *ngSwitchCase="\'GREAT_GRANDFATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GREAT_GRANDFATHER" | translate}}</span>\n <span *ngSwitchCase="\'NEPHEW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_NEPHEW" | translate}}</span>\n <span *ngSwitchCase="\'UNCLE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_UNCLE" | translate}}</span>\n <span *ngSwitchCase="\'GRANDSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GRANDSON" | translate}}</span>\n <span *ngSwitchCase="\'FATHER_IN_LAW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER_IN_LAW" | translate}}</span>\n <span *ngSwitchCase="\'SON_IN_LAW_DAOUGHTER_IN_LAW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SON_IN_LAW_DAOUGHTER_IN_LAW" | translate}}</span>\n <span *ngSwitchCase="\'STEPSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPSON" | translate}}</span>\n <span *ngSwitchCase="\'BROTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_BROTHER" | translate}}</span>\n <span *ngSwitchCase="\'ADOPTED_CHILD\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_ADOPTED_CHILD" | translate}}</span>\n <span *ngSwitchCase="\'PENSIONERS\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_PENSIONERS" | translate}}</span>\n <span *ngSwitchCase="\'COMPANION\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_COMPANION" | translate}}</span>\n <span *ngSwitchCase="\'GUARDIANSHIP\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GUARDIANSHIP" | translate}}</span>\n <span *ngSwitchCase="\'MINOR_UNDER_GUARD\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_MINOR_UNDER_GUARD" | translate}}</span>\n <span *ngSwitchCase="\'STEPMOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPMOTHER" | translate}}</span>\n <span *ngSwitchCase="\'STEPFATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPFATHER" | translate}}</span>\n <span *ngSwitchCase="\'TUTOR\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_TUTOR" | translate}}</span>\n <span *ngSwitchCase="\'EX_EXPOSED\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_EX_EXPOSED" | translate}}</span>\n <span *ngSwitchCase="\'GREAT_GRANDSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GREAT_GRANDSON" | translate}}</span>\n <span *ngSwitchCase="\'EX_PARTNER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_EX_PARTNER" | translate}}</span>\n <span *ngSwitchCase="\'CONCUBINE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_CONCUBINE" | translate}}</span>\n <span *ngSwitchCase="\'CURATORSHIP\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_CURATORSHIP" | translate}}</span>\n <span *ngSwitchCase="\'SOCIOAFFECTIVE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SOCIOAFFECTIVE" | translate}}</span>\n <span *ngSwitchCase="\'FATHER_MOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER_MOTHER" | translate}}</span>\n <span *ngSwitchCase="\'OTHERS\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_OTHERS" | translate}}</span>\n <span *ngSwitchDefault>{{ "hcm_contract.employment_contract.list_grid_empty_field" | translate}}</span>\n </div>\n </td>\n <td class="txt-center" tabindex="0" *ngIf="this.permissions.editar && this.permissions.excluir">\n <s-button label="{{\'hcm_contract.employment_contract.admission_generic_actions\' | translate}}"\n priority="default" [model]="getActions(rowData)" [disabled]="false"\n [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span\n [translate]="\'hcm_contract.employment_contract.total_records\'"\n [translateParams]="{value: totalRecords}">\n </span>\n </ng-template>\n </p-table>\n</div>\n'})],e)}(),Oo=c,Bo=function(){function e(e,n,o,i,a,s,l,c,p,d){this.translate=e,this.fb=n,this.cdRef=o,this.focusService=i,this.paginatorStorageService=a,this.employeeDependentService=s,this.activatedRoute=l,this.confirmationService=c,this.messageService=p,this.router=d,this.closeSideBar=new t.EventEmitter,this.filterFields=[],this.loading=!1,this.serverError=!1,this.showDialog=!1,this.localeConfig={},this.personClass="",this.permissions={},this.allPermissions={},this.ngUnsubscribe=new r.Subject,this.currentListParams={page:0,size:10,sort:[],filterData:{}},this.totalRecords=0}return Object.defineProperty(e.prototype,"employeeId",{set:function(e){this._employeeId=e,this.updateGrid()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"admissionDraftId",{set:function(e){this._admissionDraftId=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewChecked=function(){this.cdRef.detectChanges()},e.prototype.ngOnInit=function(){var e=this;this.createFormGroup(),this.subscribeValuesInFormAndEvents(),this.activatedRoute.data.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRouteDataChange(t)})),this.gridColumns=this.getGridColumns()},e.prototype.createFormGroup=function(){this.formGroup=this.fb.group({person:[{value:null,disabled:!0},p.Validators.compose([])],registerMethod:[{value:null,disabled:!1},p.Validators.required]})},e.prototype.ngOnDestroy=function(){this.ngUnsubscribe.next(),this.ngUnsubscribe.complete()},e.prototype.onRouteDataChange=function(e){var t;this.localeConfig=e.localeConfig,this.allPermissions=e.allPermissions,this.permissions=null===(t=e.allPermissions)||void 0===t?void 0:t.employeeDependent},e.prototype.getGridColumns=function(){return[{field:"dependent.codPes",header:this.translate.instant("hcm_contract.employment_contract.e_001_pes_cod_pes")},{field:"dependent.nomPes",header:this.translate.instant("hcm_contract.employment_contract.e_001_pes_nom_pes")},{field:"dependent.graPar",header:this.translate.instant("hcm_contract.employment_contract.employee_dependent_list_kinship")},{field:"dependent.intNet",header:this.translate.instant("hcm_contract.employment_contract.employee_dependent_list_email")},{field:"dependent.fonPes",header:this.translate.instant("hcm_contract.employment_contract.employee_dependent_list_phoneNumber")}]},e.prototype.subscribeValuesInFormAndEvents=function(){var e=this;this.formGroup.get("registerMethod").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.onRegisterMethod(t)})),this.formGroup.get("person").valueChanges.pipe(s.takeUntil(this.ngUnsubscribe)).subscribe((function(t){return e.personId=null==t?void 0:t.id})),this.closeSideBar.pipe(s.takeUntil(this.ngUnsubscribe),s.filter((function(e){return!!e}))).subscribe((function(){e.updateGrid()}))},e.prototype.onRegisterMethod=function(e){this.formGroup.get("person").setValue(null),"newRegister"===e?(ie(this.formGroup,"person",[]),this.formGroup.get("person").disable()):(ie(this.formGroup,"person",[p.Validators.required]),this.personClass="required",this.formGroup.get("person").enable())},e.prototype.getSortField=function(){return this.currentListParams.sort},e.prototype.getPageSize=function(){return this.currentListParams.size},e.prototype.getRowIndex=function(){return this.currentListParams.page*this.currentListParams.size},e.prototype.onGridChange=function(e){var t=e.rows,n=e.first/t,o=e.multiSortMeta;return(10!==t||0!==n||(null==o?void 0:o.length)>0)&&this.paginatorStorageService.storePaginator("AnnotationHistoryListComponentPaginator",{page:n,size:t,sort:o}),this.updateGrid({page:n,size:t,sort:o})},e.prototype.resetGrid=function(e){e&&(this.currentListParams=z(z({},this.currentListParams),e)),this.currentListParams=z(z({},this.currentListParams),{page:0,sort:[]}),this.table.reset()},e.prototype.updateGrid=function(e){var t=this;if(void 0===e&&(e={}),this._employeeId){this.loading=!0,this.currentListParams=z(z({},this.currentListParams),e);var n=this.currentListParams,o=n.page,i=n.size,a=n.filterData,r=this.currentListParams.sort,c=this.filterFields.filter((function(e){var t=e.name;return!!a[t]})).map((function(e){var n=e.name,o=e.type,i=e.multiple,r=a[n];return"number"==typeof r?n+" eq "+r:o===l.FieldType.Date?n+" eq '"+Oo(r).format("YYYY-MM-DD")+"'":o===l.FieldType.Time?n+" eq '"+Oo(r).format("HH:mm:ss")+"'":o===l.FieldType.DateTime?n+" eq '"+Oo(r).format()+"'":o===l.FieldType.String?"containing(upper("+n+"), upper('"+r.replace(/'/g,"\\'")+"'))":o===l.FieldType.Enum?t.getEnumQuery(n,r,i):o===l.FieldType.Lookup?n+" eq '"+r.id+"'":n+" eq '"+r+"'"})).join(" and "),p="employee.id eq '"+this._employeeId+"'";c=c?"("+c+") and ("+p+")":p;r||(r=[{field:"lastModifiedDate",order:-1}]),this.employeeDependentService.list({page:o,size:i,sort:r,filterQuery:c,displayFields:["employee.person.*","dependent.*"]}).pipe(s.takeUntil(this.ngUnsubscribe),s.catchError((function(e){throw e.status>=500&&e.status<600&&(t.serverError=!0),e})),s.finalize((function(){t.loading=!1}))).subscribe((function(e){t.gridData=e.contents,t.totalRecords=e.totalElements,t.serverError=!1}))}else this.serverError=!0},e.prototype.getProp=function(e,t){return t.split(".").reduce((function(e,t){return void 0===e[t]?"":e[t]}),e)},e.prototype.getEnumQuery=function(e,t,n){return n?"("+t.map((function(t){return e+" eq '"+t+"'"})).join(" or ")+")":e+" eq '"+t+"'"},e.prototype.validateAllFormFields=function(e){var t=this;Object.keys(e.controls).forEach((function(n){var o=e.get(n);o instanceof p.FormControl?o.markAsDirty({onlySelf:!0}):o instanceof p.FormGroup&&t.validateAllFormFields(o)})),this.focusService.focusFirstInvalidInput()},e.prototype.sendToForm=function(){if(!this.formGroup.valid)return this.loading=!1,this.validateAllFormFields(this.formGroup);this.showDialog=!1,this.employeeDependentService.setOpenSideBarAndStartForm({dependentId:null,personId:this.personId})},e.prototype.onCancel=function(){this.showDialog=!1},e.prototype.onAddDependent=function(){this.formGroup.reset(),this.onRegisterMethod("newRegister"),this.showDialog=!0},e.prototype.onDelete=function(e){var t=this;this.loading=!0,this.employeeDependentService.delete(e.id).subscribe((function(){t.messageService.add({severity:"info",summary:t.translate.instant("hcm_contract.employment_contract.deleted_message_title"),detail:t.translate.instant("hcm_contract.employment_contract.exclusion_process_started_message_content")}),t.updateGrid()})),this.confirmationService.close()},e.prototype.onEdit=function(e){var t;this.personId=null===(t=null==e?void 0:e.dependent)||void 0===t?void 0:t.id,this.employeeDependentService.setOpenSideBarAndStartForm({dependentId:null==e?void 0:e.id,personId:this.personId})},e.prototype.onEditDraft=function(e){this.employeeDependentService.setOpenSideBarAndStartForm({dependentDraftId:e})},e.prototype.getActions=function(e){var t=this;return[{id:"1",label:this.translate.instant("hcm_contract.employment_contract.edit"),command:function(){t.onEdit(e)}},{id:"2",label:this.translate.instant("hcm_contract.employment_contract.logical_delete"),command:function(){t.confirmationService.confirm({message:t.translate.instant("hcm_contract.employment_contract.admission_delete_confirmation_message"),rejectLabel:t.translate.instant("hcm_contract.employment_contract.admission_generic_no"),acceptLabel:t.translate.instant("hcm_contract.employment_contract.admission_generic_yes"),header:t.translate.instant("hcm_contract.employment_contract.admission_delete_confirmation_title"),accept:function(){t.onDelete(e)}})}}]},e.prototype.openRecordExclusions=function(){this.router.navigate(["dependents","exclusions-list"],{queryParams:{entityName:"employeeDependent",entityDescription:this.translate.instant("hcm_contract.employment_contract.employee_dependent")}})},e.prototype.hasPermissionToSeeExclusions=function(){return this.allPermissions.exclusionProcessStep.visualizar&&this.allPermissions.exclusionProcessStepGroup.visualizar},e.prototype.getOtherActions=function(){var e=this,t=[];return this.hasPermissionToSeeExclusions()&&t.push({id:"view-exclusions",label:this.translate.instant("hcm_contract.employment_contract.see_exclusions"),command:function(){e.openRecordExclusions()}}),t},e.ctorParameters=function(){return[{type:a.TranslateService},{type:p.FormBuilder},{type:t.ChangeDetectorRef},{type:_n},{type:Cn},{type:Rt},{type:d.ActivatedRoute},{type:i.ConfirmationService},{type:i.MessageService},{type:d.Router}]},W([t.Input()],e.prototype,"employeeId",null),W([t.Input()],e.prototype,"admissionDraftId",null),W([t.ViewChild("employeeDependentTable",{static:!1})],e.prototype,"table",void 0),e=W([t.Component({selector:"fnd-employee-dependent",template:'<p-panel *sLoadingState="loading">\n <p-tabView styleClass="form-group" *sLoadingState="loading" >\n <p-tabPanel *ngIf="_employeeId"\n [header]="\'hcm_contract.employment_contract.employee_dependent_title_header\' | translate">\n <div class="ui-g" *ngIf="this.gridData?.length">\n <div class="ui-g-12">\n <button id="add-button" type="button" pButton [label]="\'hcm_contract.employment_contract.add_employee_dependent\' | translate"\n title="{{\'hcm_contract.employment_contract.add_employee_dependent\' | translate}} (Alt + Shift + N)"\n *ngIf="permissions.incluir" (click)="onAddDependent()"></button>\n <s-button id="other-actions-button"\n [label]="\'hcm_contract.employment_contract.other_actions\' | translate"\n [model]="getOtherActions()"\n priority="secondary"\n [disabled]="false" [auxiliary]="false"\n *ngIf="hasPermissionToSeeExclusions()">\n </s-button>\n </div>\n </div>\n <s-empty-state *ngIf="!this.gridData?.length" [title]="\'hcm_contract.employment_contract.employee_dependent_empty_state_title\' | translate"\n [showPrimaryAction]="this.permissions.incluir" [primaryActionLabel]="\'hcm_contract.employment_contract.add_employee_dependent\' | translate"\n (primaryAction)="onAddDependent()" [description]="\'hcm_contract.employment_contract.employee_dependent_empty_state_description\' | translate"\n [showSecondaryAction]="permissions.incluir" [showSecondaryAction]="hasPermissionToSeeExclusions()"\n [secondaryActionLabel]="\'hcm_contract.employment_contract.see_exclusions\' | translate"\n (secondaryAction)="openRecordExclusions()">\n </s-empty-state>\n <div [attr.data-hidden]="!gridData?.length || serverError">\n\n <p-table #employeeDependentTable [value]="gridData" [columns]="gridColumns" dataKey="id" [lazy]="true"\n [scrollable]="true" [resizableColumns]="true" sortMode="multiple" [paginator]="true"\n [totalRecords]="totalRecords" [multiSortMeta]="getSortField()" [first]="getRowIndex()"\n [rows]="getPageSize()" [rowsPerPageOptions]="[10, 20, 50, 100]"\n (onLazyLoad)="onGridChange($event)">\n <ng-template pTemplate="colgroup" let-columns>\n <colgroup>\n <col *ngFor="let col of columns">\n </colgroup>\n </ng-template>\n <ng-template pTemplate="header" let-columns>\n <tr>\n <th *ngFor="let col of columns" [pSortableColumn]="col.field"\n pResizableColumn>\n <div class="senior-header">\n <span class="senior-header-title">{{col.header}}</span>\n <p-sortIcon [field]="col.field"></p-sortIcon>\n </div>\n </th>\n <th pResizableColumn scope="col" *ngIf="this.permissions.excluir">\n <div class="senior-header">\n <span class="senior-header-title">{{\'hcm_contract.employment_contract.actions\' |\n translate}}</span>\n </div>\n </th>\n </tr>\n </ng-template>\n <ng-template pTemplate="body" let-rowData let-columns>\n <tr [pSelectableRow]="rowData">\n <td>\n <span>{{"" + (getProp(rowData, \'dependent.codPes\'))}}</span>\n </td>\n <td>\n <span>{{"" + (getProp(rowData, \'dependent.nomPes\')|| (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td>\n <div [ngSwitch]="getProp(rowData, \'dependent.graPde\') || (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate)">\n <span *ngSwitchCase="\'SON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SON" | translate}}</span>\n <span *ngSwitchCase="\'SPOUSE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SPOUSE" | translate}}</span>\n <span *ngSwitchCase="\'FATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER" | translate}}</span>\n <span *ngSwitchCase="\'GRANDFATHER_GRANDMOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GRANDFATHER_GRANDMOTHER" | translate}}</span>\n <span *ngSwitchCase="\'GREAT_GRANDFATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GREAT_GRANDFATHER" | translate}}</span>\n <span *ngSwitchCase="\'NEPHEW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_NEPHEW" | translate}}</span>\n <span *ngSwitchCase="\'UNCLE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_UNCLE" | translate}}</span>\n <span *ngSwitchCase="\'GRANDSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GRANDSON" | translate}}</span>\n <span *ngSwitchCase="\'FATHER_IN_LAW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER_IN_LAW" | translate}}</span>\n <span *ngSwitchCase="\'SON_IN_LAW_DAOUGHTER_IN_LAW\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SON_IN_LAW_DAOUGHTER_IN_LAW" | translate}}</span>\n <span *ngSwitchCase="\'STEPSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPSON" | translate}}</span>\n <span *ngSwitchCase="\'BROTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_BROTHER" | translate}}</span>\n <span *ngSwitchCase="\'ADOPTED_CHILD\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_ADOPTED_CHILD" | translate}}</span>\n <span *ngSwitchCase="\'PENSIONERS\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_PENSIONERS" | translate}}</span>\n <span *ngSwitchCase="\'COMPANION\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_COMPANION" | translate}}</span>\n <span *ngSwitchCase="\'GUARDIANSHIP\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GUARDIANSHIP" | translate}}</span>\n <span *ngSwitchCase="\'MINOR_UNDER_GUARD\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_MINOR_UNDER_GUARD" | translate}}</span>\n <span *ngSwitchCase="\'STEPMOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPMOTHER" | translate}}</span>\n <span *ngSwitchCase="\'STEPFATHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_STEPFATHER" | translate}}</span>\n <span *ngSwitchCase="\'TUTOR\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_TUTOR" | translate}}</span>\n <span *ngSwitchCase="\'EX_EXPOSED\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_EX_EXPOSED" | translate}}</span>\n <span *ngSwitchCase="\'GREAT_GRANDSON\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_GREAT_GRANDSON" | translate}}</span>\n <span *ngSwitchCase="\'EX_PARTNER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_EX_PARTNER" | translate}}</span>\n <span *ngSwitchCase="\'CONCUBINE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_CONCUBINE" | translate}}</span>\n <span *ngSwitchCase="\'CURATORSHIP\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_CURATORSHIP" | translate}}</span>\n <span *ngSwitchCase="\'SOCIOAFFECTIVE\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_SOCIOAFFECTIVE" | translate}}</span>\n <span *ngSwitchCase="\'FATHER_MOTHER\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_FATHER_MOTHER" | translate}}</span>\n <span *ngSwitchCase="\'OTHERS\'">{{ "hcm_contract.employment_contract.employee_dependent_kinship_degree_OTHERS" | translate}}</span>\n <span *ngSwitchDefault>{{ "hcm_contract.employment_contract.list_grid_empty_field" | translate}}</span>\n </div>\n </td>\n <td>\n <span>{{"" + (getProp(rowData, \'dependent.intNet\')|| (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td>\n <span>{{"" + (getProp(rowData, \'dependent.fonPes\')|| (\'hcm_contract.employment_contract.list_grid_empty_field\' | translate))}}</span>\n </td>\n <td class="txt-center" tabindex="0" *ngIf="this.permissions.editar && this.permissions.excluir">\n <s-button label="{{\'hcm_contract.employment_contract.admission_generic_actions\' | translate}}"\n priority="default" [model]="getActions(rowData)" [disabled]="false" [auxiliary]="true"></s-button>\n </td>\n </tr>\n </ng-template>\n <ng-template pTemplate="paginatorright">\n <span\n [translate]="\'hcm_contract.employment_contract.total_records\'"\n [translateParams]="{value: totalRecords}">\n </span>\n </ng-template>\n </p-table>\n </div>\n </p-tabPanel>\n <p-tabPanel\n [header]="\'hcm_contract.employment_contract.employee_dependent_draft_title_header\' | translate">\n <app-dependent-list-draft\n (addButtonClicked)="onAddDependent()"\n [employeeId]="_employeeId"\n [closeSideBar]="closeSideBar"\n [admissionDraftId]="_admissionDraftId"\n (onEdit)="onEditDraft($event)">\n </app-dependent-list-draft>\n </p-tabPanel>\n </p-tabView>\n</p-panel>\n<p-dialog header="{{ \'hcm_contract.employment_contract.employee_dependent_register_method_title\' | translate }}"\n[draggable]="false" [modal]="true"\n[(visible)]="showDialog" [closable]="false">\n <form class="ui-fluid" [formGroup]="formGroup">\n <div class="radio-buttons required ui-lg-12" style="margin-bottom: 20px;">\n <label id="registerMethod">{{ \'hcm_contract.employment_contract.employee_dependent_register_method_label\' | translate }}</label>\n <div><p-radioButton name="registerMethod" formControlName="registerMethod"\n value="newRegister"\n label="{{ \'hcm_contract.employment_contract.employee_dependent_register_method_create_data\' | translate}}"></p-radioButton></div>\n <div><p-radioButton\n name="registerMethod" formControlName="registerMethod"\n value="existing"\n label="{{ \'hcm_contract.employment_contract.employee_dependent_register_method_existing_data\' | translate}}"></p-radioButton></div>\n <s-control-errors\n id="er-registerMethod"\n [control]="formGroup.get(\'registerMethod\')"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate\n }"\n ></s-control-errors>\n </div>\n\n <div class="ui-lg-12">\n <div class="person-label">\n <label for="personLabel">{{\'hcm_contract.employment_contract.data_person_id_lookup_title\' | translate}}</label>\n <span\n id="personLabel"\n class="fa fa-info-circle"\n [pTooltip]="\'hcm_contract.employment_contract.employee_dependent_tooltip_person\' | translate">\n </span>\n </div>\n <div class="{{personClass}}">\n <fnd-person-lookup [formGroup]="formGroup" [locale]="localeConfig"></fnd-person-lookup>\n <s-control-errors\n id="er-person"\n [control]="formGroup.get(\'person\')"\n [errorMessages]="{\n required: \'hcm_contract.employment_contract.admission_generic_field_validator_required\' | translate\n }"\n ></s-control-errors>\n </div>\n </div>\n </form>\n <p-footer>\n <s-button\n [label]="\'hcm_contract.employment_contract.employee_dependent_next\' | translate"\n priority="primary" (onClick)="sendToForm()">\n </s-button>\n <s-button\n [label]="\'hcm_contract.employment_contract.cancel\' | translate"\n priority="secondary"\n (onClick)="onCancel()">\n </s-button>\n </p-footer>\n</p-dialog>\n<p-confirmDialog></p-confirmDialog>\n<fnd-employee-dependent-form [employeeId]="_employeeId" [admissionDraft]="_admissionDraftId" [closeSideBar]="closeSideBar"></fnd-employee-dependent-form>\n<s-exclusion-details></s-exclusion-details>\n',styles:[".radio-buttons{display:flex;flex-direction:column;gap:6px}.person-label{display:flex;gap:5px;align-items:center}"]})],e)}(),Ho=function(){function e(){}return e=W([t.NgModule({imports:[k.TableModule,h.CommonModule,a.TranslateModule,l.LoadingStateModule,l.EmptyStateModule,E.PanelModule,kn,H.DialogModule,Lt,l.SidebarModule,l.StepsModule,b.InputMaskModule,g.DropdownModule,U.RadioButtonModule,O.FieldsetModule,G.PersonLookupModule,G.EntityLookupModule.forRoot({domain:"hcm_contract",service:"employment_contract"}),n.PermissionsModule.forChild([{name:"dependentDraft",actions:["Visualizar","Incluir","Editar","Excluir"],uri:"res://senior.com.br/hcm_contract/employment_contract/entities/dependentDraft"}]),B.TooltipModule],declarations:[Bo,xo,Mo,Vo,ko,Ro,Lo],providers:[Eo,Co,Fo],exports:[Bo]})],e)}();e.AnnotationHistory=zt,e.AnnotationHistoryAttachmentService=ft,e.AnnotationHistoryFeatureModule=no,e.AnnotationHistoryFormComponent=Zn,e.AnnotationHistoryListComponent=to,e.AnnotationHistoryService=Ze,e.AnnotationType=jt,e.AnnotationTypeService=$e,e.BankAccountHistory=Jt,e.BankAccountHistoryService=tt,e.BankAccountItemComponent=co,e.BankAccountItemModule=mo,e.BankAccountListComponent=po,e.BaseCollectiveHistoryComponent=Ln,e.BaseCollectiveHistoryModule=An,e.BaseHistoryComponent=yn,e.BaseHistoryModule=In,e.BaseHistoryService=tn,e.CollectiveHistoryFiltersComponent=Wn,e.CollectiveHistoryFiltersModule=Qn,e.CollectiveHistoryFiltersService=nn,e.CompanyLookupService=Yn,e.CoreHistoryModule=wt,e.DateValidator=dn,e.Disease=an,e.DiseaseService=rt,e.DiseaseSubgroup=on,e.DiseaseSubgroupService=lt,e.E001Pes=Mt,e.E001PesService=Be,e.E030Age=Kt,e.E030AgeService=en,e.E030Ban=Qt,e.E030BanService=Zt,e.ESocialReason=ln,e.ESocialReasonService=pt,e.Employee=Vt,e.EmployeeDependentListComponent=Bo,e.EmployeeDependentModule=Ho,e.EmployeeLookupService=zn,e.EmployeeService=qe,e.EmployeeSummaryComponent=Do,e.EmployeeSummaryModule=To,e.ErrorPageService=bn,e.FieldCustomizationService=Sn,e.FiltersStorageService=En,e.FocusService=_n,e.JourneyFlexibilizationService=Kn,e.LeaveHistory=sn,e.LeaveHistoryAttachmentService=ht,e.LeaveHistoryBFFService=it,e.LeaveHistoryFeatureModule=so,e.LeaveHistoryFormComponent=io,e.LeaveHistoryListComponent=ro,e.LeaveHistoryService=ot,e.MinutesToTimeConversionService=Dn,e.MinutesToTimeConversionServiceImpl=Tn,e.PaginatorStorageService=Cn,e.PermissionService=fn,e.PlatformService=pn,e.RegulatoryNormTrainingHistory=cn,e.RegulatoryNormTrainingHistoryItemComponent=go,e.RegulatoryNormTrainingHistoryItemModule=bo,e.RegulatoryNormTrainingHistoryListComponent=vo,e.RegulatoryNormTrainingHistoryService=Dt,e.Situation=rn,e.SituationService=mt,e.StorageService=Fn,e.Workshift=xt,e.WorkshiftGroup=Bt,e.WorkshiftGroupService=je,e.WorkshiftHistory=qt,e.WorkshiftHistoryAdjustmentService=bt,e.WorkshiftHistoryFeatureModule=$n,e.WorkshiftHistoryFormComponent=Gn,e.WorkshiftHistoryListComponent=On,e.WorkshiftHistoryService=Xe,e.WorkshiftInformationHistoryService=Ft,e.WorkshiftService=ze,e.clearValues=re,e.configEnabledFields=ne,e.contractTypeOptions=Ge,e.convertBooleanString=function(e){return"boolean"==typeof e?!0===e?"true":"false":e},e.convertMinutesToTime=function(e,t){var n=e.replace(".",""),o=Math.floor(parseInt(n)/60),i=parseInt(n)%60,a=o<10?"0"+o:o;return a+=":",a+=i<10?"0"+i:""+i,t&&(a=Re(a.toString())),a},e.convertTimeToMinutes=function(e){if(e){var t=e.toString().split(":");return 60*t[0]+parseInt(t[1])}return null},e.createEnumFilterString=function(e,t,n){var o=e.name,i=e.multiple,a=e.options;return n&&n.textSeachEnum?le(o,t,a):se(o,t,i)},e.createFilterString=ce,e.createFilterTokens=function(e,t,n){var o=e,i=o.name,a=o.type,r=o.label,s=o.searchFields,p=o.options,d=t;switch(a){case l.FieldType.Date:d=c(t).format("L");break;case l.FieldType.Time:d=c(t).format("LTS");break;case l.FieldType.LocalDateTime:case l.FieldType.DateTime:d=c(t).format("L LTS");break;case l.FieldType.Lookup:d=s.map((function(e){return Ae(t,e.name)})).join(" - ");break;case l.FieldType.Enum:d=p.filter((function(e){return e.value===d}))[0].label;break;case l.FieldType.Boolean:d=t?n.instant("platform.localization.list_grid_boolean_true"):n.instant("platform.localization.list_grid_boolean_false")}return{id:i,label:r+": "+d}},e.createLookupRequestFilter=Pe,e.getDefaultHistoryGridColumns=xe,e.getEnumQuery=se,e.getEnumTextSearchQuery=le,e.getLabelValueRequest=we,e.getProp=Ae,e.getRecordLabel=Ie,e.getSituationFilterInHistorics=Ne,e.getSuggestionValue=function(e,t,n,o){return e.map((function(e){return Ae(n,t+"."+e)})).reduce((function(e,t){return""+e+o+t}))+""},e.getTypeInformation=ke,e.getYears=function(e){return ee().diff(e,"years",!1)},e.isObject=function(e){return e&&"object"==typeof e&&!Array.isArray(e)},e.isValid=function(e){return 0===e||"boolean"==typeof e||null!=e&&""!==e},e.isValidFilter=Ce,e.mergeDateTime=Me,e.mergeUnique=Ee,e.removeCharacteresSpecials=function(e){return e?e.toString().replace(/[&\/\\#,+()$~%.'":*?<>{}-]/g,""):null},e.removeErrorFromField=mn,e.setDisableField=ae,e.setErrors=function(e,t,n){var o=this;setTimeout((function(){var i;n?((i=Object.assign({},o.get(e).errors))[t]=n,o.get(e).setErrors(i)):(i=o.get(e).errors)&&Object.keys(i).length&&(delete i[t],Object.keys(i).length||o.get(e).setErrors(null))}),0)},e.setRequired=te,e.setRequiredFields=function(e,t,n){t?n.forEach((function(t){return te(e,t,!0,[p.Validators.required])})):n.forEach((function(t){return te(e,t,!1)}))},e.setValidator=ie,e.setValidatorsAndDisableFields=oe,e.situationOptions=Ve,e.startDateIsBeforeEndDateValidator=function(e,t){if(e&&t&&e.value&&t.value){var n=c(e.value).isSameOrAfter(t.value)?{startDateIsBeforeEndDate:{value:t.value}}:null;if(n)return e.markAsDirty(),t.markAsDirty(),e.setErrors(n),t.setErrors(n),n;mn(t,"startDateIsBeforeEndDate"),mn(e,"startDateIsBeforeEndDate")}else!e||!e.value||t&&t.value?e&&e.value||!t||!t.value||mn(t,"startDateIsBeforeEndDate"):mn(e,"startDateIsBeforeEndDate");return null},e.startDateIsBeforeOrEqualToEndDateValidator=function(e,t){if(e&&t&&e.value&&t.value){var n=e.value>t.value?{startDateIsBeforeEndDate:{value:t.value}}:null;if(n)return e.markAsDirty(),t.markAsDirty(),e.setErrors(n),t.setErrors(n),n;mn(t,"startDateIsBeforeEndDate"),mn(e,"startDateIsBeforeEndDate")}else!e||!e.value||t&&t.value?e&&e.value||!t||!t.value||mn(t,"startDateIsBeforeEndDate"):mn(e,"startDateIsBeforeEndDate");return null},e.startDateTimeIsBeforeEndDateTimeValidator=function(e,t){if(e&&t&&e.value&&t.value){var n=e.value>t.value?{startDateTimeIsBeforeEndDateTime:{value:[t.value,e.value]}}:null;if(n)return e.markAsDirty(),t.markAsDirty(),t.setErrors(n),e.setErrors(n),n;mn(t,"startDateTimeIsBeforeEndDateTime"),mn(e,"startDateTimeIsBeforeEndDateTime")}else!e||!e.value||t&&t.value?e&&e.value||!t||!t.value||mn(t,"startDateTimeIsBeforeEndDateTime"):mn(e,"startDateTimeIsBeforeEndDateTime");return null},e.toastTimeToLive=864e5,e.updateSingleControl=de,e.validateSpecificControls=pe,e.verifyValidationsForm=function e(){var t=this;Object.keys(this.controls).forEach((function(n){var o=t.get(n);o.markAsDirty(),(o instanceof p.FormGroup||o instanceof p.FormArray)&&e.call(o)}))},e.ɵ0=Le,e.ɵa=Ue,e.ɵb=Oe,e.ɵba=Vn,e.ɵbb=Nn,e.ɵbc=Bn,e.ɵbd=So,e.ɵbe=xo,e.ɵbf=Fo,e.ɵbg=Mo,e.ɵbh=Vo,e.ɵbi=ko,e.ɵbj=Ro,e.ɵbk=Eo,e.ɵbl=Lo,e.ɵbm=Co,e.ɵc=He,e.ɵd=Ye,e.ɵe=We,e.ɵf=Ke,e.ɵg=Je,e.ɵh=et,e.ɵi=nt,e.ɵj=at,e.ɵk=st,e.ɵl=ct,e.ɵm=dt,e.ɵn=ut,e.ɵo=yt,e.ɵp=_t,e.ɵq=St,e.ɵr=Tt,e.ɵs=Et,e.ɵt=Lt,e.ɵu=Rt,e.ɵv=kt,e.ɵw=At,e.ɵx=kn,e.ɵy=gn,e.ɵz=Pn,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
16
|
//# sourceMappingURL=senior-gestao-pessoas-hcm-contract-employee-history.umd.min.js.map
|